@randstad-uca/aws-sns-publisher 1.2.12 → 1.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/constants.d.ts +2 -6
- package/build/constants.js +11 -8
- package/build/generate-schema-doc.js +5 -0
- package/build/schemas/custom-tags.schema.d.ts +2 -0
- package/build/schemas/custom-tags.schema.js +17 -0
- package/build/schemas/index.d.ts +1 -0
- package/build/schemas/index.js +1 -0
- package/build/schemas/personal-data.schema.js +5 -0
- package/build/types/custom-tags.type.d.ts +8 -0
- package/build/types/custom-tags.type.js +6 -0
- package/build/types/index.d.ts +1 -0
- package/build/types/index.js +1 -0
- package/build/types/personal-data.type.d.ts +1 -0
- package/build/types/user-identity.type.d.ts +1 -0
- package/build/validator.js +4 -0
- package/package.json +1 -1
- package/schema-doc.md +13 -1
package/build/constants.d.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Valid API names
|
|
3
|
-
*/
|
|
4
1
|
export declare const validApiNames: string[];
|
|
5
|
-
/**
|
|
6
|
-
* Valid Event types
|
|
7
|
-
*/
|
|
8
2
|
export declare const validEventTypes: {
|
|
9
3
|
sms: string;
|
|
10
4
|
updatePersonalData: string;
|
|
@@ -35,6 +29,7 @@ export declare const validEventTypes: {
|
|
|
35
29
|
addUserIdentity: string;
|
|
36
30
|
deleteOneSignalUser: string;
|
|
37
31
|
customEvents: string;
|
|
32
|
+
setCustomTags: string;
|
|
38
33
|
};
|
|
39
34
|
export declare const validDocumentStatus: {
|
|
40
35
|
enviado: string;
|
|
@@ -45,3 +40,4 @@ export declare const validDocumentStatus: {
|
|
|
45
40
|
incompleto: string;
|
|
46
41
|
pendienteFirma: string;
|
|
47
42
|
};
|
|
43
|
+
export declare const USER_STATUS: string[];
|
package/build/constants.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validDocumentStatus = exports.validEventTypes = exports.validApiNames = void 0;
|
|
4
|
-
|
|
5
|
-
* Valid API names
|
|
6
|
-
*/
|
|
3
|
+
exports.USER_STATUS = exports.validDocumentStatus = exports.validEventTypes = exports.validApiNames = void 0;
|
|
4
|
+
/* Valid API names */
|
|
7
5
|
exports.validApiNames = ['candidate', 'talent'];
|
|
8
|
-
|
|
9
|
-
* Valid Event types
|
|
10
|
-
*/
|
|
6
|
+
/* Valid Event types */
|
|
11
7
|
exports.validEventTypes = {
|
|
12
8
|
sms: 'sms',
|
|
13
9
|
updatePersonalData: 'update-personal-data',
|
|
@@ -38,6 +34,7 @@ exports.validEventTypes = {
|
|
|
38
34
|
addUserIdentity: 'add-user-identity',
|
|
39
35
|
deleteOneSignalUser: 'delete-one-signal-user',
|
|
40
36
|
customEvents: 'custom-events',
|
|
37
|
+
setCustomTags: 'set-custom-tags',
|
|
41
38
|
};
|
|
42
39
|
exports.validDocumentStatus = {
|
|
43
40
|
enviado: 'enviado',
|
|
@@ -46,5 +43,11 @@ exports.validDocumentStatus = {
|
|
|
46
43
|
anulado: 'anulado',
|
|
47
44
|
pendienteEnvio: 'pendiente envio',
|
|
48
45
|
incompleto: 'incompleto',
|
|
49
|
-
pendienteFirma: 'pendiente firma'
|
|
46
|
+
pendienteFirma: 'pendiente firma',
|
|
50
47
|
};
|
|
48
|
+
/* Map UseEst with an user status */
|
|
49
|
+
exports.USER_STATUS = [
|
|
50
|
+
'candidato temporal',
|
|
51
|
+
'candidato',
|
|
52
|
+
'talento',
|
|
53
|
+
];
|
|
@@ -23,6 +23,7 @@ const user_identity_schema_1 = require("./schemas/user-identity.schema");
|
|
|
23
23
|
const one_signal_schema_1 = require("./schemas/one-signal.schema");
|
|
24
24
|
const certifications_schema_1 = require("./schemas/certifications.schema");
|
|
25
25
|
const custom_events_schema_1 = require("./schemas/custom-events.schema");
|
|
26
|
+
const custom_tags_schema_1 = require("./schemas/custom-tags.schema");
|
|
26
27
|
const schemas = {
|
|
27
28
|
[constants_1.validEventTypes.sms]: { schema: sms_schema_1.SMSSchema, label: 'SMS' },
|
|
28
29
|
[constants_1.validEventTypes.updatePersonalData]: {
|
|
@@ -137,6 +138,10 @@ const schemas = {
|
|
|
137
138
|
schema: custom_events_schema_1.CustomEventsSchema,
|
|
138
139
|
label: 'Custom Events',
|
|
139
140
|
},
|
|
141
|
+
[constants_1.validEventTypes.setCustomTags]: {
|
|
142
|
+
schema: custom_tags_schema_1.SetCustomTagsSchema,
|
|
143
|
+
label: 'Set Custom Tags',
|
|
144
|
+
},
|
|
140
145
|
};
|
|
141
146
|
function getFieldsFromJoi(schema) {
|
|
142
147
|
const description = schema.describe();
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SetCustomTagsSchema = void 0;
|
|
7
|
+
const joi_1 = __importDefault(require("joi"));
|
|
8
|
+
const constants_1 = require("../constants");
|
|
9
|
+
exports.SetCustomTagsSchema = joi_1.default.object({
|
|
10
|
+
userId: joi_1.default.string().uuid().required(),
|
|
11
|
+
usuario: joi_1.default.string()
|
|
12
|
+
.valid(...constants_1.USER_STATUS)
|
|
13
|
+
.allow('')
|
|
14
|
+
.optional(),
|
|
15
|
+
})
|
|
16
|
+
.unknown(false)
|
|
17
|
+
.meta({ className: 'SetCustomTagsType' });
|
package/build/schemas/index.d.ts
CHANGED
package/build/schemas/index.js
CHANGED
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./alert.schema"), exports);
|
|
18
18
|
__exportStar(require("./certifications.schema"), exports);
|
|
19
19
|
__exportStar(require("./custom-events.schema"), exports);
|
|
20
|
+
__exportStar(require("./custom-tags.schema"), exports);
|
|
20
21
|
__exportStar(require("./cv-adjunto.schema"), exports);
|
|
21
22
|
__exportStar(require("./education.schema"), exports);
|
|
22
23
|
__exportStar(require("./email.schema"), exports);
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.DeletePersonalDataSchema = exports.UpdatePersonalDataSchema = void 0;
|
|
7
7
|
const joi_1 = __importDefault(require("joi"));
|
|
8
8
|
const one_signal_schema_1 = require("./one-signal.schema");
|
|
9
|
+
const constants_1 = require("../constants");
|
|
9
10
|
const baseFields = {
|
|
10
11
|
userId: joi_1.default.string().uuid().required(),
|
|
11
12
|
email: joi_1.default.string().email().optional(),
|
|
@@ -23,6 +24,10 @@ const baseFields = {
|
|
|
23
24
|
.optional(),
|
|
24
25
|
subscriptions: one_signal_schema_1.SubscriptionSchema.optional(),
|
|
25
26
|
fechaActualizacionPerfil: joi_1.default.date().timestamp('javascript').required(),
|
|
27
|
+
usuario: joi_1.default.string()
|
|
28
|
+
.valid(...constants_1.USER_STATUS)
|
|
29
|
+
.allow('')
|
|
30
|
+
.optional(),
|
|
26
31
|
};
|
|
27
32
|
exports.UpdatePersonalDataSchema = joi_1.default.object(baseFields)
|
|
28
33
|
.unknown(false)
|
package/build/types/index.d.ts
CHANGED
package/build/types/index.js
CHANGED
|
@@ -21,6 +21,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
21
21
|
__exportStar(require("./alert.type"), exports);
|
|
22
22
|
__exportStar(require("./certifications.type"), exports);
|
|
23
23
|
__exportStar(require("./custom-events.type"), exports);
|
|
24
|
+
__exportStar(require("./custom-tags.type"), exports);
|
|
24
25
|
__exportStar(require("./cv-adjunto.type"), exports);
|
|
25
26
|
__exportStar(require("./education.type"), exports);
|
|
26
27
|
__exportStar(require("./email.type"), exports);
|
package/build/validator.js
CHANGED
|
@@ -18,6 +18,7 @@ const update_documents_status_schema_1 = require("./schemas/update-documents-sta
|
|
|
18
18
|
const user_identity_schema_1 = require("./schemas/user-identity.schema");
|
|
19
19
|
const one_signal_schema_1 = require("./schemas/one-signal.schema");
|
|
20
20
|
const custom_events_schema_1 = require("./schemas/custom-events.schema");
|
|
21
|
+
const custom_tags_schema_1 = require("./schemas/custom-tags.schema");
|
|
21
22
|
const validateSchema = (eventType, data) => {
|
|
22
23
|
let schema;
|
|
23
24
|
switch (eventType) {
|
|
@@ -106,6 +107,9 @@ const validateSchema = (eventType, data) => {
|
|
|
106
107
|
case constants_1.validEventTypes.customEvents:
|
|
107
108
|
schema = custom_events_schema_1.CustomEventsSchema;
|
|
108
109
|
break;
|
|
110
|
+
case constants_1.validEventTypes.setCustomTags:
|
|
111
|
+
schema = custom_tags_schema_1.SetCustomTagsSchema;
|
|
112
|
+
break;
|
|
109
113
|
default:
|
|
110
114
|
console.error(`Unknown event type: ${eventType}`);
|
|
111
115
|
return false;
|
package/package.json
CHANGED
package/schema-doc.md
CHANGED
|
@@ -29,6 +29,7 @@ This file describes the required and optional fields for each `eventType`.
|
|
|
29
29
|
- `localidad` (string)
|
|
30
30
|
- `telefono` (string)
|
|
31
31
|
- `subscriptions` (object)
|
|
32
|
+
- `usuario` (string) (valid: 'candidato temporal', 'candidato', 'talento', '')
|
|
32
33
|
|
|
33
34
|
---
|
|
34
35
|
|
|
@@ -363,6 +364,7 @@ This file describes the required and optional fields for each `eventType`.
|
|
|
363
364
|
- `workExperiences` (array)
|
|
364
365
|
|
|
365
366
|
**Optional fields:**
|
|
367
|
+
- `fechaActualizacionPerfil` (date)
|
|
366
368
|
- `email` (string)
|
|
367
369
|
- `nombre` (string)
|
|
368
370
|
- `fechaNacimiento` (date)
|
|
@@ -371,7 +373,7 @@ This file describes the required and optional fields for each `eventType`.
|
|
|
371
373
|
- `localidad` (string)
|
|
372
374
|
- `telefono` (string)
|
|
373
375
|
- `subscriptions` (object)
|
|
374
|
-
- `
|
|
376
|
+
- `usuario` (string) (valid: 'candidato temporal', 'candidato', 'talento', '')
|
|
375
377
|
- `fechaActualizacionCVAdjunto` (date)
|
|
376
378
|
|
|
377
379
|
---
|
|
@@ -408,3 +410,13 @@ This file describes the required and optional fields for each `eventType`.
|
|
|
408
410
|
|
|
409
411
|
---
|
|
410
412
|
|
|
413
|
+
## Event: `set-custom-tags` (Set Custom Tags)
|
|
414
|
+
|
|
415
|
+
**Required fields:**
|
|
416
|
+
- `userId` (string)
|
|
417
|
+
|
|
418
|
+
**Optional fields:**
|
|
419
|
+
- `usuario` (string) (valid: 'candidato temporal', 'candidato', 'talento', '')
|
|
420
|
+
|
|
421
|
+
---
|
|
422
|
+
|