yube-sdk
v1.0.4
Published
Yube API wrapper
Downloads
8
Readme
Integration with Yube
How to use
To use the service it is necessary to follow a few steps:
- Provide the access key (token) -- Token provided by the company
- Provide the access key (companyId) -- Company ID / Branch ID
- Provide the access url (endPoint) -- API access address (Production / Approval)
- Provide the access key (StatusId) -- Token to set default status ( Convidado / Em Cadastro / Pronto / Arquivado / Finalizado)
- Provide the access key (processesTemplateId) -- Token for defining ProcessTemplate Types ( ADMISSION / BENEFITS )
Example Usage:
const yube = new Yube(token, companyId, endPoint, statusId, processesTemplateId);
Yube Data Route
postContributorInvite()
- Requires the parameters (token, companyId, endPoint, statusId, processesTemplateId)**
| Campo | Tipo do dados | Obrigatório | | ------ | ------ |------ | | Email | STRING | Yes | | mobilePhone | STRING | Yes | | name | STRING | Yes | | dueDate | STRING |No | | referenceCode | STRING |No |
Example Usage:
yube.postContributorInvite({
email: "[email protected]",
mobilePhone: "13 997591181",
name: "Usuario teste,
dueDate: "2021-12-10",
referenceCode: "123456"
}).then({data} => console.log(data))
Return:
{
"data": {
"createInvites": {
"invites": [
{
"messages": [],
"result": {
"__typename": "Invite",
"deliveredAt": "2021-12-07T17:52:35.912574Z",
"dueDate": "2021-12-10",
"id": "SW52aXRlOjFjMDZiYTA1LTQ3NTAtNDhhMS1iZGRhLTk1M2Q3NDg4MmFlZQ==",
"personCompany": {
"__typename": "PersonCompany",
"company": {
"__typename": "Company",
"corporateName": "Plooral",
"id": "Q29tcGFueTo3ZjNmZGU4YS0zYzY3LTRlMjEtYTY4Yi0xYWU3NDc3OGRlY2M=",
"nickname": "Plooral"
},
"id": "UGVyc29uQ29tcGFueTo1NmRhOWZmZC1lZjAzLTRmZWYtOTViOC0xZDg0MTM3NzQ4MDc=",
"person": {
"__typename": "Person",
"email": "[email protected]",
"id": "UGVyc29uOjcxZjc4MGEyLTIyZmItNDJlMi1iMGMwLTJhZDRjZWY0ZTVhZg==",
"mobilePhone": "13 997591181",
"name": "Leandro teste"
}
},
"referenceCode": "1234"
},
"successful": true
}
],
"messages": [],
"status": "OK",
"successful": true
}
}
}
getAllTemplates()
- Requires the parameters (token, companyId, endpoint, null, null)**
Example Usage:
yube.getAllTemplates().then((data) => console.log(data))
Return:
{
"data": {
"node": {
"__typename": "Company",
"corporateName": "Plooral",
"id": "Q29tcGFueTo3ZjNmZGU4YS0zYzY3LTRlMjEtYTY4Yi0xYWU3NDc3OGRlY2M=",
"nickname": "Plooral",
"processesTemplates": [
{
"__typename": "ProcessTemplate",
"category": "ADMISSION",
"description": null,
"id": "UHJvY2Vzc1RlbXBsYXRlOjQ5MWQxMjMxLTRkZTQtNGFiOC1iZWQ0LWUwYzk5MjA5MzBiZQ==",
"insertedAt": "2021-11-08T13:45:25.348889Z",
"templateId": "UHJvY2Vzc1RlbXBsYXRlOjg1YjcwOWQzLTgwN2ItNDdmZC1iYzk2LTc5YzNhZmIyZDI0Nw==",
"title": "Admissão Padrão",
"updatedAt": "2021-11-08T13:45:25.348889Z"
}
]
}
}
}
getAllCompanyStatus()
- Requires the parameters (token, null, endpoint, null, null)**
Example Usage:
yube.getAllCompanyStatus().then((data) => console.log(data))
Return:
{
"data": {
"viewer": {
"id": "root_viewer_id",
"user": {
"__typename": "User",
"email": "[email protected]",
"groups": [
{
"__typename": "Group",
"companies": [
{
"__typename": "Company",
"corporateName": "Plooral",
"id": "Q29tcGFueTo3ZjNmZGU4YS0zYzY3LTRlMjEtYTY4Yi0xYWU3NDc3OGRlY2M=",
"nickname": "Plooral"
}
],
"id": "R3JvdXA6YWI1ZDM5YjUtYjMyYy00ODA3LWEzNjEtMzRjMmFhNDVkNTJl",
"name": "Plooral",
"organization": {
"__typename": "Organization",
"id": "T3JnYW5pemF0aW9uOmY2OWJkNmJjLTQ0MWItNDA0Mi1iNDUxLWYxMzU0NTc0NWFlNg==",
"pipeStatus": [
{
"__typename": "Status",
"category": "IN_PROGRESS",
"description": null,
"id": "U3RhdHVzOjAxZTVjNDU0LTlkY2EtNGU3MC05MzAzLTA1NWYyOGJhNjhlNQ==",
"name": "Convidado"
},
{
"__typename": "Status",
"category": "IN_PROGRESS",
"description": null,
"id": "U3RhdHVzOmFlOWY1MWVmLWQ4Y2EtNGYyZi05NDQ0LTZmYTQ3NzZlMDMyZg==",
"name": "Em Cadastro"
},
{
"__typename": "Status",
"category": "IN_PROGRESS",
"description": null,
"id": "U3RhdHVzOjk3ODEyYzA1LWI4OGUtNDAxMy04YWZmLThiODhhMTg3N2YwYw==",
"name": "Pronto"
},
{
"__typename": "Status",
"category": "DONE",
"description": null,
"id": "U3RhdHVzOjA4NDc2NWQ4LWUwNjktNDcxNy04NWE2LTNlNzgzNGY2NWFjMA==",
"name": "Arquivado"
},
{
"__typename": "Status",
"category": "DONE",
"description": null,
"id": "U3RhdHVzOjNkMWM3NmU3LTM4ZTEtNDlkYi1iNWZkLTNmZjIzNjhjNTViZA==",
"name": "Finalizado"
}
],
"title": "Plooral"
}
}
],
"id": "VXNlcjo0ZmFmYzBiYi0wM2FhLTRlYTEtYTg5Yy04NTQ0Yjc5OTdjOGQ=",
"name": "Juliano Santos"
}
}
}
}