lucor-sdk
v1.0.7
Published
Lucor API Wrapper
Readme
lucor-sdk
A JavaScript SDK wrapper for the Lucor API, enabling easy integration with Lucor's assessment and position management system.
Installation
npm install lucor-sdkUsage
import Lucor from 'lucor-sdk';
// Initialize the SDK with your token and base URL
const lucor = new Lucor('your-api-token', 'https://api.lucor.com');
// Example: Get positions
lucor.getPositions()
.then(positions => console.log(positions))
.catch(error => console.error(error));API Reference
Constructor
const lucor = new Lucor(token, base_url);| Parameter | Type | Description | |-----------|------|-------------| | token | string | Your Lucor API authentication token | | base_url | string | The base URL for the Lucor API |
Assessment Methods
getAssessedPersonById(cargoId, avaliacaoId)
Return the assessment results of a specific candidate and evaluation.
| Parameter | Type | Description | |-----------|------|-------------| | cargoId | string | ID of the assessed person | | avaliacaoId | string | ID of the assessment |
Position Methods
getPositions(tipoCargo, codigoReferencia)
Return a list of positions already created by the user at Lucor.
| Parameter | Type | Description | |-----------|------|-------------| | tipoCargo | Object | Type of the position (Modelo or Normal) | | codigoReferencia | string | Unique reference code for the position (position_id) |
getPositionById(cargoId)
Return the position with the given ID.
| Parameter | Type | Description | |-----------|------|-------------| | cargoId | string | ID of the position |
createModelPositionByRef(codigoReferencia, cargoId, adicionarWebhooks, adicionarAvaliadosReferenciados)
Create or update a position using a model position ID and a unique reference code.
| Parameter | Type | Description | |-----------|------|-------------| | codigoReferencia | string | Unique reference code for the position (position_id) | | cargoId | string | ID of the model position | | adicionarWebhooks | Array | Array of webhooks to add to the position | | adicionarAvaliadosReferenciados | Array | Array of candidates to add to the position |
Candidate Methods
calculatePersonAdherencePosition(avaliadoId, ciencias, cargoId)
Calculate the adherence of candidates to a position and return the result.
| Parameter | Type | Description | |-----------|------|-------------| | avaliadoId | string | ID of the candidate | | ciencias | Array | Array of sciences to calculate the adherence | | cargoId | string | ID of the model position |
createRefPerson(cargoId, CodigoReferencia, Nome, Email)
Add candidates to a position with a unique reference code, name, and email.
| Parameter | Type | Description | |-----------|------|-------------| | cargoId | string | ID of the position | | CodigoReferencia | string | Unique reference code for the candidate (candidate_id) | | Nome | string | Name of the candidate | | Email | string | Email of the candidate |
deleteRefPerson(cargoId, codigoReferencia)
Delete a candidate from a position with a unique reference code.
| Parameter | Type | Description | |-----------|------|-------------| | cargoId | string | ID of the position | | codigoReferencia | string | Unique reference code for the candidate (candidate_id) |
Webhook Methods
createWebhookConfiguration(UrlNotificacao, PlataformaIntegrada, cargoId)
Configure a webhook to receive assessment results.
| Parameter | Type | Description | |-----------|------|-------------| | UrlNotificacao | string | URL to receive the results of the assessments | | PlataformaIntegrada | string | Integrated platform name | | cargoId | string | ID of the model position |
deleteWebhook(cargoId, webhookId)
Delete a webhook.
| Parameter | Type | Description | |-----------|------|-------------| | cargoId | string | ID of the position | | webhookId | string | ID of the webhook |
Examples
Managing Positions
// Get all positions
const positions = await lucor.getPositions();
// Get a specific position
const position = await lucor.getPositionById('position-id');
// Create a position based on a model
const newPosition = await lucor.createModelPositionByRef(
'unique-reference-code',
'model-position-id',
[], // webhooks
[] // candidates
);Managing Candidates
// Add a candidate to a position
const candidate = await lucor.createRefPerson(
'position-id',
'candidate-ref-code',
'John Doe',
'[email protected]'
);
// Calculate candidate adherence to a position
const adherence = await lucor.calculatePersonAdherencePosition(
'candidate-id',
['science1', 'science2'],
'position-id'
);
// Remove a candidate from a position
await lucor.deleteRefPerson('position-id', 'candidate-ref-code');Webhooks
// Configure a webhook
const webhook = await lucor.createWebhookConfiguration(
'https://your-callback-url.com/webhook',
'Your Platform Name',
'position-id'
);
// Delete a webhook
await lucor.deleteWebhook('position-id', 'webhook-id');License
This project is licensed under the MIT License - see the LICENSE file for details.
