zudello-integration-sdk 1.0.19 → 1.0.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudello-integration-sdk",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "description": "Zudello Integrations SDK",
5
5
  "main": "./src/index.js",
6
6
  "repository": {
@@ -1,63 +1,69 @@
1
- 'use strict'
1
+ "use strict";
2
2
 
3
3
  class EmployeeModule {
4
- /**
5
- * Constructor.
6
- * @param {class} parentModule Object of ZudelloV3 class.
7
- */
8
- constructor (parentModule) {
9
- this.module = parentModule
10
-
11
- this.staticFields = {
12
- model: 'Employee',
13
- module: 'RELATIONSHIPS',
14
- submodule: 'EMPLOYEE',
15
- documentType: 'EMPLOYEE',
16
- enrich: true,
17
- extractedEvent: false,
18
- update: true,
19
- create: true
20
- }
21
- }
22
-
23
- async fetch ({ uuid, fetchDetails = true, simplified = true }) {
24
- const validateIsEmpty = this.module.validator.isEmpty({ uuid })
25
-
26
- if (!validateIsEmpty.valid) {
27
- return this.module.responseHandler.error(validateIsEmpty.errors)
28
- }
29
-
30
- return await this.module.fetch({
31
- model: this.staticFields.model,
32
- uuid,
33
- fetchDetails,
34
- simplified
35
- })
36
- }
37
-
38
- async updateOrCreate ({ data, clearNulls = true, simplified = false, submit = false, updateStatus = false }) {
39
- const validateIsEmpty = this.module.validator.isEmpty({ data })
40
-
41
- if (!validateIsEmpty.valid) {
42
- return this.module.responseHandler.error(validateIsEmpty.errors)
43
- }
44
-
45
- this.module.logger.log(`[UPDATE OR CREATE]: ZudelloV3 [model - ${this.staticFields.model}]`)
46
- this.module.logger.log('[PAGE DATA]:')
47
- this.module.logger.log(data)
48
-
49
- data = this.module.mapUpdateOrCreateData({
50
- data,
51
- staticFields: this.staticFields,
52
- submit,
53
- updateStatus
54
- })
55
-
56
- this.module.logger.log('[MAPPED PAGE DATA]:')
57
- this.module.logger.log(data)
58
-
59
- return await this.module.updateOrCreate({ data, clearNulls, simplified })
60
- }
4
+ /**
5
+ * Constructor.
6
+ * @param {class} parentModule Object of ZudelloV3 class.
7
+ */
8
+ constructor(parentModule) {
9
+ this.module = parentModule;
10
+
11
+ this.staticFields = {
12
+ model: "Employee",
13
+ module: "RELATIONSHIPS",
14
+ submodule: "EMPLOYEE",
15
+ documentType: "EMPLOYEE",
16
+ enrich: false,
17
+ extractedEvent: false,
18
+ update: true,
19
+ create: true,
20
+ };
21
+ }
22
+
23
+ async fetch({ uuid, fetchDetails = true, simplified = true }) {
24
+ const validateIsEmpty = this.module.validator.isEmpty({ uuid });
25
+
26
+ if (!validateIsEmpty.valid) {
27
+ return this.module.responseHandler.error(validateIsEmpty.errors);
28
+ }
29
+
30
+ return await this.module.fetch({
31
+ model: this.staticFields.model,
32
+ uuid,
33
+ fetchDetails,
34
+ simplified,
35
+ });
36
+ }
37
+
38
+ async updateOrCreate({
39
+ data,
40
+ clearNulls = true,
41
+ simplified = false,
42
+ submit = false,
43
+ updateStatus = false,
44
+ }) {
45
+ const validateIsEmpty = this.module.validator.isEmpty({ data });
46
+
47
+ if (!validateIsEmpty.valid) {
48
+ return this.module.responseHandler.error(validateIsEmpty.errors);
49
+ }
50
+
51
+ this.module.logger.log(`[UPDATE OR CREATE]: ZudelloV3 [model - ${this.staticFields.model}]`);
52
+ this.module.logger.log("[PAGE DATA]:");
53
+ this.module.logger.log(data);
54
+
55
+ data = this.module.mapUpdateOrCreateData({
56
+ data,
57
+ staticFields: this.staticFields,
58
+ submit,
59
+ updateStatus,
60
+ });
61
+
62
+ this.module.logger.log("[MAPPED PAGE DATA]:");
63
+ this.module.logger.log(data);
64
+
65
+ return await this.module.updateOrCreate({ data, clearNulls, simplified });
66
+ }
61
67
  }
62
68
 
63
- module.exports = EmployeeModule
69
+ module.exports = EmployeeModule;