@contrail/flexplm 1.3.0 → 1.3.1-alpha.3e8dbdd

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.
Files changed (149) hide show
  1. package/lib/cli/commands/compile.d.ts +1 -0
  2. package/lib/cli/commands/compile.js +71 -0
  3. package/lib/cli/commands/compile.spec.d.ts +1 -0
  4. package/lib/cli/commands/compile.spec.js +80 -0
  5. package/lib/cli/commands/create.d.ts +1 -0
  6. package/lib/cli/commands/create.js +75 -0
  7. package/lib/cli/commands/create.spec.d.ts +1 -0
  8. package/lib/cli/commands/create.spec.js +78 -0
  9. package/lib/cli/commands/upload.d.ts +10 -0
  10. package/lib/cli/commands/upload.js +226 -0
  11. package/lib/cli/commands/upload.spec.d.ts +1 -0
  12. package/lib/cli/commands/upload.spec.js +88 -0
  13. package/lib/cli/index.d.ts +2 -0
  14. package/lib/cli/index.js +64 -0
  15. package/lib/cli/index.spec.d.ts +1 -0
  16. package/lib/cli/index.spec.js +79 -0
  17. package/lib/cli/template/mapping-template.ts.template +62 -0
  18. package/lib/entity-processor/base-entity-processor.d.ts +89 -42
  19. package/lib/entity-processor/base-entity-processor.js +438 -385
  20. package/lib/entity-processor/base-entity-processor.spec.d.ts +1 -1
  21. package/lib/entity-processor/base-entity-processor.spec.js +398 -397
  22. package/lib/flexplm-request.d.ts +3 -3
  23. package/lib/flexplm-request.js +34 -34
  24. package/lib/flexplm-utils.d.ts +5 -5
  25. package/lib/flexplm-utils.js +33 -33
  26. package/lib/flexplm-utils.spec.d.ts +1 -1
  27. package/lib/flexplm-utils.spec.js +26 -26
  28. package/lib/index.d.ts +23 -22
  29. package/lib/index.js +39 -38
  30. package/lib/interfaces/interfaces.d.ts +105 -105
  31. package/lib/interfaces/interfaces.js +2 -2
  32. package/lib/interfaces/item-family-changes.d.ts +20 -20
  33. package/lib/interfaces/item-family-changes.js +56 -56
  34. package/lib/interfaces/mapping-file.d.ts +460 -0
  35. package/lib/interfaces/mapping-file.js +2 -0
  36. package/lib/interfaces/publish-change-data.d.ts +19 -19
  37. package/lib/interfaces/publish-change-data.js +32 -32
  38. package/lib/publish/base-process-publish-assortment-callback.d.ts +9 -9
  39. package/lib/publish/base-process-publish-assortment-callback.js +38 -38
  40. package/lib/publish/base-process-publish-assortment.d.ts +118 -93
  41. package/lib/publish/base-process-publish-assortment.js +998 -944
  42. package/lib/publish/base-process-publish-assortment.spec.d.ts +1 -1
  43. package/lib/publish/base-process-publish-assortment.spec.js +1688 -1670
  44. package/lib/publish/mockData.d.ts +1389 -1389
  45. package/lib/publish/mockData.js +4524 -4519
  46. package/lib/transform/identifier-conversion-spec-mockData.js +472 -444
  47. package/lib/transform/identifier-conversion.d.ts +51 -15
  48. package/lib/transform/identifier-conversion.js +248 -212
  49. package/lib/transform/identifier-conversion.spec.d.ts +1 -1
  50. package/lib/transform/identifier-conversion.spec.js +343 -339
  51. package/lib/util/config-defaults.d.ts +8 -8
  52. package/lib/util/config-defaults.js +88 -85
  53. package/lib/util/config-defaults.spec.d.ts +1 -1
  54. package/lib/util/config-defaults.spec.js +302 -293
  55. package/lib/util/data-converter-spec-mockData.js +219 -205
  56. package/lib/util/data-converter.d.ts +136 -39
  57. package/lib/util/data-converter.js +718 -592
  58. package/lib/util/data-converter.spec.d.ts +1 -1
  59. package/lib/util/data-converter.spec.js +906 -904
  60. package/lib/util/error-response-object.d.ts +9 -4
  61. package/lib/util/error-response-object.js +54 -47
  62. package/lib/util/error-response-object.spec.d.ts +1 -1
  63. package/lib/util/error-response-object.spec.js +99 -99
  64. package/lib/util/event-short-message-status.d.ts +19 -19
  65. package/lib/util/event-short-message-status.js +24 -23
  66. package/lib/util/federation.d.ts +15 -15
  67. package/lib/util/federation.js +157 -149
  68. package/lib/util/flexplm-connect.d.ts +29 -22
  69. package/lib/util/flexplm-connect.js +190 -176
  70. package/lib/util/flexplm-connect.spec.d.ts +1 -1
  71. package/lib/util/flexplm-connect.spec.js +88 -88
  72. package/lib/util/logger-config.d.ts +1 -1
  73. package/lib/util/logger-config.js +27 -26
  74. package/lib/util/map-util-spec-mockData.js +219 -205
  75. package/lib/util/map-utils.d.ts +33 -6
  76. package/lib/util/map-utils.js +42 -15
  77. package/lib/util/map-utils.spec.d.ts +1 -1
  78. package/lib/util/map-utils.spec.js +89 -89
  79. package/lib/util/mockData.d.ts +80 -80
  80. package/lib/util/mockData.js +103 -103
  81. package/lib/util/thumbnail-util.d.ts +55 -34
  82. package/lib/util/thumbnail-util.js +242 -215
  83. package/lib/util/thumbnail-util.spec.d.ts +1 -1
  84. package/lib/util/thumbnail-util.spec.js +440 -434
  85. package/lib/util/type-conversion-utils-spec-mockData.js +259 -259
  86. package/lib/util/type-conversion-utils.d.ts +163 -23
  87. package/lib/util/type-conversion-utils.js +408 -265
  88. package/lib/util/type-conversion-utils.spec.d.ts +1 -1
  89. package/lib/util/type-conversion-utils.spec.js +868 -868
  90. package/lib/util/type-defaults.d.ts +74 -16
  91. package/lib/util/type-defaults.js +279 -221
  92. package/lib/util/type-defaults.spec.d.ts +1 -1
  93. package/lib/util/type-defaults.spec.js +516 -516
  94. package/lib/util/type-utils.d.ts +34 -13
  95. package/lib/util/type-utils.js +137 -114
  96. package/lib/util/type-utils.spec.d.ts +1 -1
  97. package/lib/util/type-utils.spec.js +192 -190
  98. package/package.json +21 -6
  99. package/scripts/copy-template.js +10 -0
  100. package/.claude/settings.local.json +0 -8
  101. package/.github/pull_request_template.md +0 -31
  102. package/.github/workflows/flexplm-lib.yml +0 -27
  103. package/.github/workflows/publish-to-npm.yml +0 -124
  104. package/CHANGELOG.md +0 -32
  105. package/publish.bat +0 -5
  106. package/publish.sh +0 -5
  107. package/src/entity-processor/base-entity-processor.spec.ts +0 -460
  108. package/src/entity-processor/base-entity-processor.ts +0 -515
  109. package/src/flexplm-request.ts +0 -28
  110. package/src/flexplm-utils.spec.ts +0 -27
  111. package/src/flexplm-utils.ts +0 -29
  112. package/src/index.ts +0 -22
  113. package/src/interfaces/interfaces.ts +0 -122
  114. package/src/interfaces/item-family-changes.ts +0 -67
  115. package/src/interfaces/publish-change-data.ts +0 -43
  116. package/src/publish/base-process-publish-assortment-callback.ts +0 -50
  117. package/src/publish/base-process-publish-assortment.spec.ts +0 -1992
  118. package/src/publish/base-process-publish-assortment.ts +0 -1134
  119. package/src/publish/mockData.ts +0 -4561
  120. package/src/transform/identifier-conversion-spec-mockData.ts +0 -496
  121. package/src/transform/identifier-conversion.spec.ts +0 -354
  122. package/src/transform/identifier-conversion.ts +0 -282
  123. package/src/util/config-defaults.spec.ts +0 -350
  124. package/src/util/config-defaults.ts +0 -93
  125. package/src/util/data-converter-spec-mockData.ts +0 -231
  126. package/src/util/data-converter.spec.ts +0 -1041
  127. package/src/util/data-converter.ts +0 -762
  128. package/src/util/error-response-object.spec.ts +0 -116
  129. package/src/util/error-response-object.ts +0 -50
  130. package/src/util/event-short-message-status.ts +0 -22
  131. package/src/util/federation.ts +0 -172
  132. package/src/util/flexplm-connect.spec.ts +0 -132
  133. package/src/util/flexplm-connect.ts +0 -208
  134. package/src/util/logger-config.ts +0 -20
  135. package/src/util/map-util-spec-mockData.ts +0 -231
  136. package/src/util/map-utils.spec.ts +0 -103
  137. package/src/util/map-utils.ts +0 -41
  138. package/src/util/mockData.ts +0 -101
  139. package/src/util/thumbnail-util.spec.ts +0 -508
  140. package/src/util/thumbnail-util.ts +0 -272
  141. package/src/util/type-conversion-utils-spec-mockData.ts +0 -271
  142. package/src/util/type-conversion-utils.spec.ts +0 -968
  143. package/src/util/type-conversion-utils.ts +0 -460
  144. package/src/util/type-defaults.spec.ts +0 -669
  145. package/src/util/type-defaults.ts +0 -281
  146. package/src/util/type-utils.spec.ts +0 -227
  147. package/src/util/type-utils.ts +0 -144
  148. package/tsconfig.json +0 -29
  149. package/tslint.json +0 -57
@@ -1,205 +1,219 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
3
- exports.mapping = {
4
- typeConversion: {
5
- vibe2flex: {
6
- 'custom-entity': {
7
- getMapKey: (entity) => {
8
- const typePath = entity['typePath'];
9
- let mapKey = '';
10
- switch (typePath) {
11
- case 'custom-entity:pack':
12
- mapKey = 'packaging';
13
- break;
14
- case 'custom-entity:prefix':
15
- mapKey = 'prefix';
16
- break;
17
- case 'custom-entity:catName':
18
- mapKey = 'catName';
19
- break;
20
- case 'custom-entity:partnerOrg':
21
- mapKey = 'partnerOrg';
22
- break;
23
- case 'custom-entity:catFamily':
24
- mapKey = 'catFamily';
25
- break;
26
- case 'custom-entity:formName':
27
- mapKey = 'formName';
28
- break;
29
- }
30
- return mapKey;
31
- }
32
- }
33
- }
34
- },
35
- LCSProduct: {
36
- vibeOwningKeys: ['itemNumber', 'lifecycleStage'],
37
- vibe2flex: {
38
- getClass: () => 'LCSProduct',
39
- getSoftType: (entity) => {
40
- const prodType = entity['prodType'];
41
- let val = '';
42
- switch (prodType) {
43
- case 'acc':
44
- val = 'Product\\Accesories';
45
- break;
46
- case 'app':
47
- val = 'Product\\Apparel';
48
- break;
49
- case 'eqp':
50
- val = 'Product\\Equipment';
51
- break;
52
- case 'foot':
53
- val = 'Product\\Footwear';
54
- break;
55
- }
56
- return val;
57
- },
58
- transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }, { processor: 'VALUE_TRANSFORM', functionTransformersKey: 'valueTransform' }],
59
- rekey: {
60
- productName: 'name',
61
- vibeIQIdentifier: 'itemNumber'
62
- },
63
- valueTransform: {
64
- transformEx: (row) => {
65
- return row['otherProp'] + 'xxx';
66
- }
67
- }
68
- },
69
- flex2vibe: {
70
- getClass: () => 'item',
71
- transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
72
- rekey: {
73
- itemNumber: 'vibeIQIdentifier',
74
- name: 'productName',
75
- }
76
- }
77
- },
78
- LCSSKU: {
79
- vibeOwningKeys: ['itemNumber', 'lifecycleStage'],
80
- vibe2flex: {
81
- getClass: () => 'LCSSKU',
82
- getSoftType: (entity) => {
83
- const prodType = entity['prodType'];
84
- let val = '';
85
- switch (prodType) {
86
- case 'acc':
87
- val = 'Product\\Accesories';
88
- break;
89
- case 'app':
90
- val = 'Product\\Apparel';
91
- break;
92
- case 'eqp':
93
- val = 'Product\\Equipment';
94
- break;
95
- case 'foot':
96
- val = 'Product\\Footwear';
97
- break;
98
- }
99
- return val;
100
- },
101
- transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
102
- rekey: {
103
- skuName: 'optionName',
104
- vibeIQIdentifier: 'itemNumber'
105
- }
106
- },
107
- flex2vibe: {
108
- transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
109
- rekey: {
110
- itemNumber: 'vibeIQIdentifier',
111
- optionName: 'skuName',
112
- }
113
- }
114
- },
115
- packaging: {
116
- vibe2flex: {
117
- transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
118
- rekey: {
119
- retailPackType: 'packType',
120
- retailIntroDate: 'introDate'
121
- },
122
- getSoftType: () => 'Revisable Entity\\packaging',
123
- getClass: () => 'LCSRevisableEntity'
124
- },
125
- flex2vibe: {
126
- transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
127
- rekey: {
128
- packType: 'retailPackType',
129
- introDate: 'retailIntroDate'
130
- },
131
- getClass: () => 'custom-entity',
132
- getSoftType: () => 'custom-entity:pack',
133
- }
134
- },
135
- prefix: {
136
- vibe2flex: {
137
- transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
138
- rekey: {
139
- retailOwner: 'owner',
140
- retailIntroDate: 'introDate'
141
- },
142
- getSoftType: () => 'Revisable Entity\\prefix',
143
- getClass: () => 'LCSRevisableEntity'
144
- },
145
- flex2vibe: {
146
- transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
147
- rekey: {
148
- owner: 'retailOwner',
149
- introDate: 'retailIntroDate'
150
- },
151
- getClass: () => 'custom-entity',
152
- getSoftType: () => 'custom-entity:prefix',
153
- }
154
- },
155
- catName: {
156
- getIdentifierProperties: () => ['catName', 'catNumber'],
157
- getInformationalProperties: () => ['longName'],
158
- vibe2flex: {
159
- transformOrder: [],
160
- getSoftType: () => 'Last\\catName',
161
- getClass: () => 'LCSLast'
162
- },
163
- flex2vibe: {
164
- transformOrder: [],
165
- getClass: () => 'custom-entity',
166
- getSoftType: () => 'custom-entity:catName',
167
- }
168
- },
169
- partnerOrg: {
170
- vibe2flex: {
171
- transformOrder: [],
172
- getSoftType: () => 'Business Object\\partnerOrg',
173
- getClass: () => 'LCSLifecycleManaged'
174
- },
175
- flex2vibe: {
176
- transformOrder: [],
177
- getClass: () => 'custom-entity',
178
- getSoftType: () => 'custom-entity:partnerOrg',
179
- }
180
- },
181
- catFamily: {
182
- vibe2flex: {
183
- transformOrder: [],
184
- getSoftType: () => 'Revisable Entity\\catFamily',
185
- getClass: () => 'LCSRevisableEntity'
186
- },
187
- flex2vibe: {
188
- transformOrder: [],
189
- getClass: () => 'custom-entity',
190
- getSoftType: () => 'custom-entity:catFamily',
191
- }
192
- },
193
- formName: {
194
- vibe2flex: {
195
- transformOrder: [],
196
- getSoftType: () => 'Material\\form',
197
- getClass: () => 'LCSMaterial'
198
- },
199
- flex2vibe: {
200
- transformOrder: [],
201
- getClass: () => 'custom-entity',
202
- getSoftType: () => 'custom-entity:formName',
203
- }
204
- },
205
- };
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ exports.mapping = {
4
+ typeConversion: {
5
+ vibe2flex: {
6
+ 'custom-entity': {
7
+ getMapKey: (entity) => {
8
+ const typePath = entity['typePath'];
9
+ let mapKey = '';
10
+ switch (typePath) {
11
+ case 'custom-entity:pack':
12
+ mapKey = 'packaging';
13
+ break;
14
+ case 'custom-entity:prefix':
15
+ mapKey = 'prefix';
16
+ break;
17
+ case 'custom-entity:catName':
18
+ mapKey = 'catName';
19
+ break;
20
+ case 'custom-entity:partnerOrg':
21
+ mapKey = 'partnerOrg';
22
+ break;
23
+ case 'custom-entity:catFamily':
24
+ mapKey = 'catFamily';
25
+ break;
26
+ case 'custom-entity:formName':
27
+ mapKey = 'formName';
28
+ break;
29
+ }
30
+ return mapKey;
31
+ }
32
+ }
33
+ }
34
+ // flex2vibe: {
35
+ // LCSRevisableEntity: {
36
+ // getMapKey: (object) =>{ return object;}
37
+ // },
38
+ // LCSLast: {
39
+ // getMapKey: (object) => {return object;}
40
+ // },
41
+ // LCSMaterial: {
42
+ // getMapKey: (object) =>{ return object;}
43
+ // },
44
+ // LCSBusinessObject: {
45
+ // getMapKey: (object) => {return object;}
46
+ // }
47
+ // },
48
+ },
49
+ LCSProduct: {
50
+ vibeOwningKeys: ['itemNumber', 'lifecycleStage'],
51
+ vibe2flex: {
52
+ getClass: () => 'LCSProduct',
53
+ getSoftType: (entity /*, dependencies*/) => {
54
+ const prodType = entity['prodType'];
55
+ let val = '';
56
+ switch (prodType) {
57
+ case 'acc':
58
+ val = 'Product\\Accesories';
59
+ break;
60
+ case 'app':
61
+ val = 'Product\\Apparel';
62
+ break;
63
+ case 'eqp':
64
+ val = 'Product\\Equipment';
65
+ break;
66
+ case 'foot':
67
+ val = 'Product\\Footwear';
68
+ break;
69
+ }
70
+ return val;
71
+ },
72
+ transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }, { processor: 'VALUE_TRANSFORM', functionTransformersKey: 'valueTransform' }],
73
+ rekey: {
74
+ productName: 'name',
75
+ vibeIQIdentifier: 'itemNumber'
76
+ },
77
+ valueTransform: {
78
+ transformEx: (row /*, dependencies*/) => {
79
+ return row['otherProp'] + 'xxx';
80
+ }
81
+ }
82
+ },
83
+ flex2vibe: {
84
+ getClass: () => 'item',
85
+ transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
86
+ rekey: {
87
+ itemNumber: 'vibeIQIdentifier',
88
+ name: 'productName',
89
+ }
90
+ }
91
+ },
92
+ LCSSKU: {
93
+ vibeOwningKeys: ['itemNumber', 'lifecycleStage'],
94
+ vibe2flex: {
95
+ getClass: () => 'LCSSKU',
96
+ getSoftType: (entity /*, dependencies*/) => {
97
+ const prodType = entity['prodType'];
98
+ let val = '';
99
+ switch (prodType) {
100
+ case 'acc':
101
+ val = 'Product\\Accesories';
102
+ break;
103
+ case 'app':
104
+ val = 'Product\\Apparel';
105
+ break;
106
+ case 'eqp':
107
+ val = 'Product\\Equipment';
108
+ break;
109
+ case 'foot':
110
+ val = 'Product\\Footwear';
111
+ break;
112
+ }
113
+ return val;
114
+ },
115
+ transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
116
+ rekey: {
117
+ skuName: 'optionName',
118
+ vibeIQIdentifier: 'itemNumber'
119
+ }
120
+ },
121
+ flex2vibe: {
122
+ transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
123
+ rekey: {
124
+ itemNumber: 'vibeIQIdentifier',
125
+ optionName: 'skuName',
126
+ }
127
+ }
128
+ },
129
+ packaging: {
130
+ vibe2flex: {
131
+ transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
132
+ rekey: {
133
+ retailPackType: 'packType',
134
+ retailIntroDate: 'introDate'
135
+ },
136
+ getSoftType: () => 'Revisable Entity\\packaging',
137
+ getClass: () => 'LCSRevisableEntity'
138
+ },
139
+ flex2vibe: {
140
+ transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
141
+ rekey: {
142
+ packType: 'retailPackType',
143
+ introDate: 'retailIntroDate'
144
+ },
145
+ getClass: () => 'custom-entity',
146
+ getSoftType: () => 'custom-entity:pack',
147
+ }
148
+ },
149
+ prefix: {
150
+ vibe2flex: {
151
+ transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
152
+ rekey: {
153
+ retailOwner: 'owner',
154
+ retailIntroDate: 'introDate'
155
+ },
156
+ getSoftType: () => 'Revisable Entity\\prefix',
157
+ getClass: () => 'LCSRevisableEntity'
158
+ },
159
+ flex2vibe: {
160
+ transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
161
+ rekey: {
162
+ owner: 'retailOwner',
163
+ introDate: 'retailIntroDate'
164
+ },
165
+ getClass: () => 'custom-entity',
166
+ getSoftType: () => 'custom-entity:prefix',
167
+ }
168
+ },
169
+ catName: {
170
+ getIdentifierProperties: () => ['catName', 'catNumber'],
171
+ getInformationalProperties: () => ['longName'],
172
+ vibe2flex: {
173
+ transformOrder: [],
174
+ getSoftType: () => 'Last\\catName',
175
+ getClass: () => 'LCSLast'
176
+ },
177
+ flex2vibe: {
178
+ transformOrder: [],
179
+ getClass: () => 'custom-entity',
180
+ getSoftType: () => 'custom-entity:catName',
181
+ }
182
+ },
183
+ partnerOrg: {
184
+ vibe2flex: {
185
+ transformOrder: [],
186
+ getSoftType: () => 'Business Object\\partnerOrg',
187
+ getClass: () => 'LCSLifecycleManaged'
188
+ },
189
+ flex2vibe: {
190
+ transformOrder: [],
191
+ getClass: () => 'custom-entity',
192
+ getSoftType: () => 'custom-entity:partnerOrg',
193
+ }
194
+ },
195
+ catFamily: {
196
+ vibe2flex: {
197
+ transformOrder: [],
198
+ getSoftType: () => 'Revisable Entity\\catFamily',
199
+ getClass: () => 'LCSRevisableEntity'
200
+ },
201
+ flex2vibe: {
202
+ transformOrder: [],
203
+ getClass: () => 'custom-entity',
204
+ getSoftType: () => 'custom-entity:catFamily',
205
+ }
206
+ },
207
+ formName: {
208
+ vibe2flex: {
209
+ transformOrder: [],
210
+ getSoftType: () => 'Material\\form',
211
+ getClass: () => 'LCSMaterial'
212
+ },
213
+ flex2vibe: {
214
+ transformOrder: [],
215
+ getClass: () => 'custom-entity',
216
+ getSoftType: () => 'custom-entity:formName',
217
+ }
218
+ },
219
+ };
@@ -1,39 +1,136 @@
1
- import { FCConfig } from '../interfaces/interfaces';
2
- import { MapFileUtil } from '@contrail/transform-data';
3
- export declare class DataConverter {
4
- private config;
5
- private mapFileUtil;
6
- private typeUtils;
7
- private transformMapFile;
8
- private useDisplayForEnumerationMatching;
9
- private verboseDebug;
10
- private objRefCache;
11
- private userRefCache;
12
- static staticUserCache: {};
13
- static clearStaticUserCache(): void;
14
- static getFromStaticCache(id: string): any;
15
- static setToStaticCache(id: string, value: any): void;
16
- constructor(config: FCConfig, mapFileUtil: MapFileUtil);
17
- setVerboseDebug(val?: boolean): void;
18
- isVerboseDebugOn(): boolean;
19
- getFlexPLMObjectDataFromEvent(event: any, dataToSkip: string[]): Promise<{}>;
20
- getFlexPLMObjectData(newData: any, dataToSkip: string[], inflateObjRef: boolean): Promise<{}>;
21
- getFlexPLMValue(prop: any, newData: any, inflateObjRef: boolean): Promise<any>;
22
- getEnumerationValue(prop: any, nd: any): any;
23
- getObjectReferenceValue(prop: any, newData: any, inflateObjRef?: boolean): Promise<any>;
24
- getMappingClass(entity: object, mapping: any): string;
25
- setEntityValues(entity: any, data: any, keysToSkip?: string[]): Promise<any>;
26
- getEntityValues(objectClass: string, data: any, keysToSkip?: string[]): Promise<{}>;
27
- getEntityValue(prop: any, data: any): Promise<any>;
28
- setEnumerationKeys(prop: any, nd: any, matchByDisplay: any): any;
29
- getPersistableChanges(entity: object, changes: object): object;
30
- setObjectReferenceValue(prop: any, nd: any): Promise<any>;
31
- getAllObjectReferences(entityType: string, rootTypeCriteria: any, postProcessCriteria?: any): Promise<any[]>;
32
- checkKeysAndValues(criteria: any, arrayOfObjects: any, entityTypePath: any): any[];
33
- filterOutArchivedAndTrashedEntities(entities: any[]): any[];
34
- setUserListValue(prop: any, nd: any): Promise<any>;
35
- getUserByEmail(nd: any): Promise<any>;
36
- processGroupMemberCheck(prop: any, userEmail: any): Promise<void>;
37
- getUserListValue(prop: any, newData: any): Promise<any>;
38
- getUserById(userId: any): Promise<any>;
39
- }
1
+ import { FCConfig } from '../interfaces/interfaces';
2
+ import { MapFileUtil } from '@contrail/transform-data';
3
+ export declare class DataConverter {
4
+ private config;
5
+ private mapFileUtil;
6
+ private typeUtils;
7
+ private transformMapFile;
8
+ private useDisplayForEnumerationMatching;
9
+ private verboseDebug;
10
+ private objRefCache;
11
+ private userRefCache;
12
+ static staticUserCache: {};
13
+ static clearStaticUserCache(): void;
14
+ static getFromStaticCache(id: string): any;
15
+ static setToStaticCache(id: string, value: any): void;
16
+ constructor(config: FCConfig, mapFileUtil: MapFileUtil);
17
+ setVerboseDebug(val?: boolean): void;
18
+ isVerboseDebugOn(): boolean;
19
+ getFlexPLMObjectDataFromEvent(event: any, dataToSkip: string[]): Promise<{}>;
20
+ getFlexPLMObjectData(newData: any, dataToSkip: string[], inflateObjRef: boolean): Promise<{}>;
21
+ getFlexPLMValue(prop: any, newData: any, inflateObjRef: boolean): Promise<any>;
22
+ /** Returns the display values for list properties (choice & multi_select)
23
+ *
24
+ * @param prop
25
+ * @param newData
26
+ * @returns
27
+ */
28
+ getEnumerationValue(prop: any, nd: any): any;
29
+ getObjectReferenceValue(prop: any, newData: any, inflateObjRef?: boolean): Promise<any>;
30
+ /** (Deprecated) Use TypeConversionUtils.getMapKey()
31
+ * Will return the class to use to get mapping.
32
+ * This is needed because mappings will be different for different sub types
33
+ * of custom-entity
34
+ *
35
+ * @param obj: Entity being checked
36
+ * @param mapping: The whole mapping file
37
+ */
38
+ getMappingClass(entity: object, mapping: any): string;
39
+ /** Sets entity values from FlexPLM data passed in
40
+ * Assumes the entity has a VibeIQ typeId and 'roles' value to filter if necessary.
41
+ * @param entity the entity to update
42
+ * @param data the FlexPLM data
43
+ * @param keysToSkip properties to skip
44
+ * @returns the modified entity with VibeIQ values
45
+ */
46
+ setEntityValues(entity: any, data: any, keysToSkip?: string[]): Promise<any>;
47
+ /** Gets the entity values from FlexPLM data
48
+ * Assumes there isn't a VibeIQ typeId, so uses FlexPLM data to determine type
49
+ * @param objectClass FlexPLM object class
50
+ * @param data object data
51
+ * @param keysToSkip type properties to not process
52
+ * @returns object with VibeIQ values
53
+ */
54
+ getEntityValues(objectClass: string, data: any, keysToSkip?: string[]): Promise<{}>;
55
+ /** Gets the VibeIQ value for the property from data
56
+ *
57
+ * @param prop the VibeIQ property
58
+ * @param data the FlexPLM data
59
+ * @returns value to be set in VibeIQ
60
+ */
61
+ getEntityValue(prop: any, data: any): Promise<any>;
62
+ setEnumerationKeys(prop: any, nd: any, matchByDisplay: any): any;
63
+ /** Compares the potential changes to the entity and returns only the actual differences.
64
+ *
65
+ * @param entity the full entity
66
+ * @param changes the potential changes
67
+ * @returns only the change values that are different from the entity's value
68
+ */
69
+ getPersistableChanges(entity: object, changes: object): object;
70
+ /** Sets object reference value from FlexPLM data passed in
71
+ *
72
+ * @param prop the VibeIQ property
73
+ * @param nd the VibeIQ data
74
+ * @returns the object reference id from VibeIQ
75
+ */
76
+ setObjectReferenceValue(prop: any, nd: any): Promise<any>;
77
+ /**
78
+ * Retrieves all object references of a specified entity type based on the provided criteria.
79
+ * This function handles pagination and asynchronously fetches object references until there are no more pages.
80
+ * @param {string} entityType - The type of entity for which object references are to be retrieved.
81
+ * @param {object} rootTypeCriteria - The criteria used to filter object references.
82
+ * @returns {Promise<Array>} A Promise that resolves to an array containing all object references.
83
+ */
84
+ getAllObjectReferences(entityType: string, rootTypeCriteria: any, postProcessCriteria?: any): Promise<any[]>;
85
+ /**
86
+ * Checks if all keys and values of a given object are present in an array of objects.
87
+ * @param {Object} criteria - The object whose keys and values are to be checked in the array of objects.
88
+ * @param {Array<Object>} arrayOfObjects - The array of objects to be searched for matching keys and values.
89
+ * @param {string} entityTypePath - The type / subtype for the property; objects must be this type or a sub type of it.
90
+ * @returns {(Object|boolean)} Returns the array of objects that matches all keys and values of the provided object.
91
+ * If no match is found, returns empty array.
92
+ */
93
+ checkKeysAndValues(criteria: any, arrayOfObjects: any, entityTypePath: any): any[];
94
+ /** Filters out archived and trashed entities from the provided array of entities.
95
+ *
96
+ * @param entities
97
+ * @returns
98
+ */
99
+ filterOutArchivedAndTrashedEntities(entities: any[]): any[];
100
+ /** Sets userListId value from FlexPLM data passed in
101
+ *
102
+ * @param prop the VibeIQ property
103
+ * @param nd the VibeIQ data
104
+ * @returns the modified entity with FlexPLM values
105
+ */
106
+ setUserListValue(prop: any, nd: any): Promise<any>;
107
+ /** Makes batch calls of 1000 of user-org entities until
108
+ * it find one with userEmail of passed in nd.email.
109
+ * Maxes out after querying for 15,000 user-org entities
110
+ *
111
+ * @param nd
112
+ * @returns
113
+ */
114
+ getUserByEmail(nd: any): Promise<any>;
115
+ /** Shows warning if user email address not present in group associated to property
116
+ *
117
+ * @param prop the VibeIQ property
118
+ * @param userEmail user email address
119
+ */
120
+ processGroupMemberCheck(prop: any, userEmail: any): Promise<void>;
121
+ /** Gets the VibeIQ value for the userList property from data
122
+ *
123
+ * @param prop the VibeIQ property
124
+ * @param newData the FlexPLM data
125
+ * @returns value to be set in VibeIQ
126
+ */
127
+ getUserListValue(prop: any, newData: any): Promise<any>;
128
+ /** Makes batch calls of 1000 of user-org entities until
129
+ * it find one with user.id of passed in userId.
130
+ * Maxes out after querying for 15,000 user-org entities
131
+ *
132
+ * @param userId
133
+ * @returns
134
+ */
135
+ getUserById(userId: any): Promise<any>;
136
+ }