@randstad-uca/aws-sns-publisher 1.2.11 → 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.
@@ -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[];
@@ -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,2 @@
1
+ import Joi from 'joi';
2
+ export declare const SetCustomTagsSchema: Joi.ObjectSchema<any>;
@@ -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' });
@@ -9,7 +9,7 @@ const userId = joi_1.default.string().uuid().required();
9
9
  const nivel = joi_1.default.string()
10
10
  .valid('primario', 'secundario', 'terciario', 'universitario', 'posgrado', 'master', 'doctorado')
11
11
  .required();
12
- const area = joi_1.default.string().min(1).max(50).optional();
12
+ const area = joi_1.default.string().min(1).max(50).allow('').optional();
13
13
  const estado = joi_1.default.string()
14
14
  .valid('completo', 'incompleto', 'en curso')
15
15
  .required();
@@ -1,6 +1,7 @@
1
1
  export * from './alert.schema';
2
2
  export * from './certifications.schema';
3
3
  export * from './custom-events.schema';
4
+ export * from './custom-tags.schema';
4
5
  export * from './cv-adjunto.schema';
5
6
  export * from './education.schema';
6
7
  export * from './email.schema';
@@ -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)
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was automatically generated by joi-to-typescript
3
+ * Do not modify this file manually
4
+ */
5
+ export interface SetCustomTagsType {
6
+ userId: string;
7
+ usuario?: 'candidato temporal' | 'candidato' | 'talento' | '';
8
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /**
3
+ * This file was automatically generated by joi-to-typescript
4
+ * Do not modify this file manually
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,6 +5,7 @@
5
5
  export * from './alert.type';
6
6
  export * from './certifications.type';
7
7
  export * from './custom-events.type';
8
+ export * from './custom-tags.type';
8
9
  export * from './cv-adjunto.type';
9
10
  export * from './education.type';
10
11
  export * from './email.type';
@@ -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);
@@ -17,4 +17,5 @@ export interface UpdatePersonalDataType {
17
17
  subscriptions?: SubscriptionType;
18
18
  telefono?: string;
19
19
  userId: string;
20
+ usuario?: 'candidato temporal' | 'candidato' | 'talento' | '';
20
21
  }
@@ -21,5 +21,6 @@ export interface AddUserIdentityType {
21
21
  subscriptions?: SubscriptionType;
22
22
  telefono?: string;
23
23
  userId: string;
24
+ usuario?: 'candidato temporal' | 'candidato' | 'talento' | '';
24
25
  workExperiences: AddWorkExperienceType[];
25
26
  }
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@randstad-uca/aws-sns-publisher",
3
- "version": "1.2.11",
3
+ "version": "1.3.12",
4
4
  "description": "AWS SNS Publisher",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
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
 
@@ -52,7 +53,7 @@ This file describes the required and optional fields for each `eventType`.
52
53
  - `fechaActualizacionPerfil` (date)
53
54
 
54
55
  **Optional fields:**
55
- - `area` (string)
56
+ - `area` (string) (valid: '')
56
57
 
57
58
  ---
58
59
 
@@ -68,8 +69,8 @@ This file describes the required and optional fields for each `eventType`.
68
69
  - `prevEstado` (string) (valid: 'completo', 'incompleto', 'en curso')
69
70
 
70
71
  **Optional fields:**
71
- - `area` (string)
72
- - `prevArea` (string)
72
+ - `area` (string) (valid: '')
73
+ - `prevArea` (string) (valid: '')
73
74
 
74
75
  ---
75
76
 
@@ -83,7 +84,7 @@ This file describes the required and optional fields for each `eventType`.
83
84
  - `fechaActualizacionPerfil` (date)
84
85
 
85
86
  **Optional fields:**
86
- - `area` (string)
87
+ - `area` (string) (valid: '')
87
88
 
88
89
  ---
89
90
 
@@ -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
- - `fechaActualizacionPerfil` (date)
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
+