@contrail/flexplm 1.1.52 → 1.1.54
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/lib/entity-processor/base-entity-processor.d.ts +1 -0
- package/lib/entity-processor/base-entity-processor.js +100 -14
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/publish/base-process-publish-assortment.js +6 -13
- package/lib/transform/identifier-conversion-spec-mockData.d.ts +0 -0
- package/lib/transform/identifier-conversion-spec-mockData.js +444 -0
- package/lib/transform/identifier-conversion.d.ts +6 -0
- package/lib/transform/identifier-conversion.js +47 -0
- package/lib/transform/identifier-conversion.spec.d.ts +1 -0
- package/lib/transform/identifier-conversion.spec.js +339 -0
- package/lib/util/event-short-message-status.d.ts +15 -0
- package/lib/util/event-short-message-status.js +19 -0
- package/lib/util/flexplm-connect.js +6 -2
- package/package.json +1 -1
- package/src/entity-processor/base-entity-processor.ts +106 -20
- package/src/index.ts +1 -0
- package/src/publish/base-process-publish-assortment.ts +6 -13
- package/src/transform/identifier-conversion-spec-mockData.ts +496 -0
- package/src/transform/identifier-conversion.spec.ts +354 -0
- package/src/transform/identifier-conversion.ts +56 -0
- package/src/util/event-short-message-status.ts +18 -0
- package/src/util/flexplm-connect.ts +7 -3
|
@@ -17,6 +17,7 @@ export declare abstract class BaseEntityProcessor {
|
|
|
17
17
|
constructor(config: FCConfig, dc: DataConverter, mapFileUtil: MapFileUtil, baseType: string);
|
|
18
18
|
inbound(event: EntityPayloadType): Promise<any>;
|
|
19
19
|
handleIncomingUpsert(event: EntityPayloadType): Promise<any>;
|
|
20
|
+
getInboundStatusMessage(statusObject: any): string;
|
|
20
21
|
handleIncomingDelete(event: any): Promise<void>;
|
|
21
22
|
getTransformedData(event: any): Promise<any>;
|
|
22
23
|
getUpdatesForEntity(entity: any, inboundData: any): Promise<object>;
|
|
@@ -6,6 +6,7 @@ const flexplm_connect_1 = require("../util/flexplm-connect");
|
|
|
6
6
|
const map_utils_1 = require("../util/map-utils");
|
|
7
7
|
const sdk_1 = require("@contrail/sdk");
|
|
8
8
|
const type_conversion_utils_1 = require("../util/type-conversion-utils");
|
|
9
|
+
const event_short_message_status_1 = require("../util/event-short-message-status");
|
|
9
10
|
const UNSUPPORTED_TYPE = 'Unsupported eventType.';
|
|
10
11
|
class IncomingEntityResponse {
|
|
11
12
|
}
|
|
@@ -40,26 +41,76 @@ class BaseEntityProcessor {
|
|
|
40
41
|
const inboundData = await this.getTransformedData(event);
|
|
41
42
|
const incomingEntityResponse = await this.getIncomingEntity(event, inboundData);
|
|
42
43
|
if (incomingEntityResponse.earlyReturn) {
|
|
44
|
+
const statusMsg = this.getInboundStatusMessage({
|
|
45
|
+
status: event_short_message_status_1.EventShortMessageStatus.FAILURE,
|
|
46
|
+
statusMessage: incomingEntityResponse.earlyReturn.shortStatusMessage || '',
|
|
47
|
+
objectClass: event.objectClass,
|
|
48
|
+
federatedId: event.federatedId
|
|
49
|
+
});
|
|
50
|
+
console.log(statusMsg);
|
|
43
51
|
return incomingEntityResponse.earlyReturn;
|
|
44
52
|
}
|
|
45
53
|
const entity = incomingEntityResponse.entity;
|
|
46
54
|
if (!entity) {
|
|
47
55
|
const createEntityResponse = await this.getCreateEntity(inboundData);
|
|
48
56
|
if (createEntityResponse.earlyReturn) {
|
|
57
|
+
const status = (createEntityResponse.earlyReturn.shortStatusMessage === event_short_message_status_1.EventShortMessageStatus.NOT_CREATABLE)
|
|
58
|
+
? event_short_message_status_1.EventShortMessageStatus.SUCCESS
|
|
59
|
+
: event_short_message_status_1.EventShortMessageStatus.FAILURE;
|
|
60
|
+
const statusMsg = this.getInboundStatusMessage({
|
|
61
|
+
status,
|
|
62
|
+
statusMessage: createEntityResponse.earlyReturn.shortStatusMessage || '',
|
|
63
|
+
objectClass: event.objectClass,
|
|
64
|
+
federatedId: event.federatedId
|
|
65
|
+
});
|
|
66
|
+
console.log(statusMsg);
|
|
49
67
|
return createEntityResponse.earlyReturn;
|
|
50
68
|
}
|
|
51
|
-
|
|
69
|
+
const createdEntity = await this.createEntity(this.baseType, createEntityResponse.entity);
|
|
70
|
+
const statusMsg = this.getInboundStatusMessage({
|
|
71
|
+
status: event_short_message_status_1.EventShortMessageStatus.SUCCESS,
|
|
72
|
+
statusMessage: event_short_message_status_1.EventShortMessageStatus.CREATED,
|
|
73
|
+
objectClass: event.objectClass,
|
|
74
|
+
entityId: 'id',
|
|
75
|
+
federatedId: event.federatedId
|
|
76
|
+
});
|
|
77
|
+
console.log(statusMsg);
|
|
78
|
+
return createdEntity;
|
|
52
79
|
}
|
|
53
80
|
const diffs = await this.getUpdatesForEntity(entity, inboundData);
|
|
54
81
|
if (Object.getOwnPropertyNames(diffs).length == 0) {
|
|
82
|
+
const statusMsg = this.getInboundStatusMessage({
|
|
83
|
+
status: event_short_message_status_1.EventShortMessageStatus.SUCCESS,
|
|
84
|
+
statusMessage: event_short_message_status_1.EventShortMessageStatus.NO_CHANGES,
|
|
85
|
+
objectClass: event.objectClass,
|
|
86
|
+
entityId: entity.id,
|
|
87
|
+
federatedId: event.federatedId
|
|
88
|
+
});
|
|
89
|
+
console.log(statusMsg);
|
|
55
90
|
const message = 'No Changes to persist for entity: ' + entity.id;
|
|
56
|
-
console.log(message);
|
|
57
91
|
return {
|
|
58
92
|
status: 200,
|
|
59
93
|
data: { message }
|
|
60
94
|
};
|
|
61
95
|
}
|
|
62
|
-
|
|
96
|
+
const updatedEntity = await this.updateEntity(this.baseType, entity, diffs);
|
|
97
|
+
const statusMsg = this.getInboundStatusMessage({
|
|
98
|
+
status: event_short_message_status_1.EventShortMessageStatus.SUCCESS,
|
|
99
|
+
statusMessage: event_short_message_status_1.EventShortMessageStatus.UPDATED,
|
|
100
|
+
objectClass: event.objectClass,
|
|
101
|
+
entityId: entity.id,
|
|
102
|
+
federatedId: event.federatedId
|
|
103
|
+
});
|
|
104
|
+
console.log(statusMsg);
|
|
105
|
+
return updatedEntity;
|
|
106
|
+
}
|
|
107
|
+
getInboundStatusMessage(statusObject) {
|
|
108
|
+
return 'BaseEntityProcessor: inbound: status: ' + statusObject.status
|
|
109
|
+
+ ', statusMessage: ' + statusObject.statusMessage
|
|
110
|
+
+ ', entityType: ' + this.baseType
|
|
111
|
+
+ ', entityId: ' + statusObject.entityId
|
|
112
|
+
+ ', objectClass: ' + statusObject.objectClass
|
|
113
|
+
+ ', federatedId: ' + statusObject.federatedId;
|
|
63
114
|
}
|
|
64
115
|
async handleIncomingDelete(event) {
|
|
65
116
|
console.warn('delete is not configured', event);
|
|
@@ -153,13 +204,30 @@ class BaseEntityProcessor {
|
|
|
153
204
|
data: { message }
|
|
154
205
|
};
|
|
155
206
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
207
|
+
try {
|
|
208
|
+
const payload = await this.getOutgoingUpsertPayload(entityType, event);
|
|
209
|
+
const flexResponse = await new flexplm_connect_1.FlexPLMConnect(this.config).sendToFlexPLM(payload);
|
|
210
|
+
const outboundEntityUpdates = await this.getOutboundEntityUpdates(event, flexResponse);
|
|
211
|
+
if (outboundEntityUpdates) {
|
|
212
|
+
flexResponse['outboundEntityUpdates'] = outboundEntityUpdates;
|
|
213
|
+
}
|
|
214
|
+
const statusMsg = 'BaseEntityProcessor: outbound: ' + flexResponse.status
|
|
215
|
+
+ ', entityType: ' + this.baseType
|
|
216
|
+
+ ', entityId: ' + event.id
|
|
217
|
+
+ ', objectClass: ' + payload.objectClass
|
|
218
|
+
+ ', updateFromResponse: ' + ((outboundEntityUpdates && Object.keys(outboundEntityUpdates).length > 0) ? 'true' : 'false');
|
|
219
|
+
console.log(statusMsg);
|
|
220
|
+
return flexResponse;
|
|
221
|
+
}
|
|
222
|
+
catch (e) {
|
|
223
|
+
const statusMsg = 'BaseEntityProcessor: outbound: ' + e.httpResponseStatus
|
|
224
|
+
+ ', entityType: ' + this.baseType
|
|
225
|
+
+ ', entityId: ' + event.id
|
|
226
|
+
+ ', objectClass: ' + objectClass
|
|
227
|
+
+ ', updateFromResponse: ' + 'false';
|
|
228
|
+
console.log(statusMsg);
|
|
229
|
+
throw e;
|
|
161
230
|
}
|
|
162
|
-
return flexResponse;
|
|
163
231
|
}
|
|
164
232
|
async getOutboundEntityUpdates(event, flexResponse) {
|
|
165
233
|
const payload = flexResponse?.data?.payload;
|
|
@@ -196,12 +264,30 @@ class BaseEntityProcessor {
|
|
|
196
264
|
};
|
|
197
265
|
}
|
|
198
266
|
;
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
267
|
+
let objectClass = payload.objectClass;
|
|
268
|
+
try {
|
|
269
|
+
const flexResponse = await new flexplm_connect_1.FlexPLMConnect(this.config).sendToFlexPLM(payload);
|
|
270
|
+
const outboundEntityUpdates = await this.getOutboundEntityUpdates(event, flexResponse);
|
|
271
|
+
if (outboundEntityUpdates) {
|
|
272
|
+
flexResponse['outboundEntityUpdates'] = outboundEntityUpdates;
|
|
273
|
+
}
|
|
274
|
+
const statusMsg = 'BaseEntityProcessor: outbound: ' + flexResponse.status
|
|
275
|
+
+ ', entityType: ' + this.baseType
|
|
276
|
+
+ ', entityId: ' + event.id
|
|
277
|
+
+ ', objectClass: ' + objectClass
|
|
278
|
+
+ ', updateFromResponse: ' + ((outboundEntityUpdates && Object.keys(outboundEntityUpdates).length > 0) ? 'true' : 'false');
|
|
279
|
+
console.log(statusMsg);
|
|
280
|
+
return flexResponse;
|
|
281
|
+
}
|
|
282
|
+
catch (e) {
|
|
283
|
+
const statusMsg = 'BaseEntityProcessor: outbound: ' + e.httpResponseStatus
|
|
284
|
+
+ ', entityType: ' + this.baseType
|
|
285
|
+
+ ', entityId: ' + event.id
|
|
286
|
+
+ ', objectClass: ' + objectClass
|
|
287
|
+
+ ', updateFromResponse: ' + 'false';
|
|
288
|
+
console.log(statusMsg);
|
|
289
|
+
throw e;
|
|
203
290
|
}
|
|
204
|
-
return flexResponse;
|
|
205
291
|
}
|
|
206
292
|
async getEntityCurrentStateUpsertPayload(event) {
|
|
207
293
|
const id = event.id;
|
package/lib/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './flexplm-utils';
|
|
|
3
3
|
export * from './util/config-defaults';
|
|
4
4
|
export * from './util/data-converter';
|
|
5
5
|
export * from './util/error-response-object';
|
|
6
|
+
export * from './util/event-short-message-status';
|
|
6
7
|
export * from './util/federation';
|
|
7
8
|
export * from './util/flexplm-connect';
|
|
8
9
|
export * from './interfaces/interfaces';
|
package/lib/index.js
CHANGED
|
@@ -19,6 +19,7 @@ __exportStar(require("./flexplm-utils"), exports);
|
|
|
19
19
|
__exportStar(require("./util/config-defaults"), exports);
|
|
20
20
|
__exportStar(require("./util/data-converter"), exports);
|
|
21
21
|
__exportStar(require("./util/error-response-object"), exports);
|
|
22
|
+
__exportStar(require("./util/event-short-message-status"), exports);
|
|
22
23
|
__exportStar(require("./util/federation"), exports);
|
|
23
24
|
__exportStar(require("./util/flexplm-connect"), exports);
|
|
24
25
|
__exportStar(require("./interfaces/interfaces"), exports);
|
|
@@ -10,14 +10,7 @@ const type_conversion_utils_1 = require("../util/type-conversion-utils");
|
|
|
10
10
|
const fsPromise = require("fs/promises");
|
|
11
11
|
const path = require("path");
|
|
12
12
|
const app_framework_1 = require("@contrail/app-framework");
|
|
13
|
-
|
|
14
|
-
(function (EventStatuses) {
|
|
15
|
-
EventStatuses["NOT_PUBLISHABLE"] = "Not_Publishable";
|
|
16
|
-
EventStatuses["NO_FEDERATION_INFO"] = "No_Federation_Information";
|
|
17
|
-
EventStatuses["NO_EVENTS_TO_SEND"] = "No_Events_to_Send";
|
|
18
|
-
EventStatuses["FAILURE"] = "Failure";
|
|
19
|
-
EventStatuses["SUCCESS"] = "Success";
|
|
20
|
-
})(EventStatuses || (EventStatuses = {}));
|
|
13
|
+
const event_short_message_status_1 = require("../util/event-short-message-status");
|
|
21
14
|
class BaseProcessPublishAssortment {
|
|
22
15
|
constructor(_config, _dc, _mapFileUtil) {
|
|
23
16
|
this.TTL = 30 * 24 * 60 * 60 * 1000;
|
|
@@ -42,9 +35,9 @@ class BaseProcessPublishAssortment {
|
|
|
42
35
|
}
|
|
43
36
|
catch (e) {
|
|
44
37
|
const message = e.message;
|
|
45
|
-
const eventStatus = (message.includes(BaseProcessPublishAssortment.ASSORTMENT_NOT_PUBLISHABLE)) ?
|
|
46
|
-
(message.startsWith(BaseProcessPublishAssortment.ASSORTMENT_NO_FED_INFO)) ?
|
|
47
|
-
|
|
38
|
+
const eventStatus = (message.includes(BaseProcessPublishAssortment.ASSORTMENT_NOT_PUBLISHABLE)) ? event_short_message_status_1.EventShortMessageStatus.NOT_PUBLISHABLE :
|
|
39
|
+
(message.startsWith(BaseProcessPublishAssortment.ASSORTMENT_NO_FED_INFO)) ? event_short_message_status_1.EventShortMessageStatus.NO_FEDERATION_INFO :
|
|
40
|
+
event_short_message_status_1.EventShortMessageStatus.FAILURE;
|
|
48
41
|
const processStatus = 'BaseProcessPublishAssortment: ' + eventStatus
|
|
49
42
|
+ ': assortmentId: ' + event.assortmentId + ': assortmentPublishChangeId: ' + event.assortmentPublishChangeId;
|
|
50
43
|
console.log(JSON.stringify(processStatus));
|
|
@@ -525,7 +518,7 @@ class BaseProcessPublishAssortment {
|
|
|
525
518
|
pcd.itemFamilyChanges = this.getItemFamilyChanges(pcd, changeDetail, assortmentItemFullChangeMap, assortmentItemDeleteMap);
|
|
526
519
|
const events = await this.getEventsForPublishChangeData(pcd);
|
|
527
520
|
if (events.length === 0) {
|
|
528
|
-
const processStatus = 'BaseProcessPublishAssortment: ' +
|
|
521
|
+
const processStatus = 'BaseProcessPublishAssortment: ' + event_short_message_status_1.EventShortMessageStatus.NO_EVENTS_TO_SEND
|
|
529
522
|
+ ': assortmentId: ' + pcd.assortmentId + ': assortmentPublishChangeId: ' + pcd.assortmentPublishChangeId;
|
|
530
523
|
console.log(processStatus);
|
|
531
524
|
const message = 'No Events to Send; returning';
|
|
@@ -537,7 +530,7 @@ class BaseProcessPublishAssortment {
|
|
|
537
530
|
}
|
|
538
531
|
const results = await this.sendEvents(events);
|
|
539
532
|
const resultsCount = this.getResultsCount(events);
|
|
540
|
-
const processStatus = 'BaseProcessPublishAssortment: ' +
|
|
533
|
+
const processStatus = 'BaseProcessPublishAssortment: ' + event_short_message_status_1.EventShortMessageStatus.SENDING_EVENTS
|
|
541
534
|
+ ': assortmentId: ' + pcd.assortmentId + ': assortmentPublishChangeId: ' + pcd.assortmentPublishChangeId
|
|
542
535
|
+ ': resultsCount: ' + JSON.stringify(resultsCount);
|
|
543
536
|
console.log(processStatus);
|
|
File without changes
|
|
@@ -0,0 +1,444 @@
|
|
|
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
|
+
LCSSeason: {
|
|
36
|
+
vibe2flex: {
|
|
37
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
38
|
+
rekey: {
|
|
39
|
+
seasonName: 'flexPLMSeasonName',
|
|
40
|
+
year: 'seasonYear'
|
|
41
|
+
},
|
|
42
|
+
getSoftType: () => 'Season',
|
|
43
|
+
getClass: () => 'LCSSeason'
|
|
44
|
+
},
|
|
45
|
+
flex2vibe: {
|
|
46
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
47
|
+
rekey: {
|
|
48
|
+
flexPLMSeasonName: 'seasonName',
|
|
49
|
+
seasonYear: 'year'
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
LCSProduct: {
|
|
54
|
+
vibeOwningKeys: ['itemNumber', 'lifecycleStage'],
|
|
55
|
+
vibe2flex: {
|
|
56
|
+
getClass: () => 'LCSProduct',
|
|
57
|
+
getSoftType: (entity) => {
|
|
58
|
+
const prodType = entity['prodType'];
|
|
59
|
+
let val = '';
|
|
60
|
+
switch (prodType) {
|
|
61
|
+
case 'acc':
|
|
62
|
+
val = 'Product\\Accesories';
|
|
63
|
+
break;
|
|
64
|
+
case 'app':
|
|
65
|
+
val = 'Product\\Apparel';
|
|
66
|
+
break;
|
|
67
|
+
case 'eqp':
|
|
68
|
+
val = 'Product\\Equipment';
|
|
69
|
+
break;
|
|
70
|
+
case 'foot':
|
|
71
|
+
val = 'Product\\Footwear';
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
return val;
|
|
75
|
+
},
|
|
76
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }, { processor: 'VALUE_TRANSFORM', functionTransformersKey: 'valueTransform' }],
|
|
77
|
+
rekey: {
|
|
78
|
+
productName: 'name',
|
|
79
|
+
vibeIQIdentifier: 'itemNumber'
|
|
80
|
+
},
|
|
81
|
+
valueTransform: {
|
|
82
|
+
transformEx: (row) => {
|
|
83
|
+
return row['otherProp'] + 'xxx';
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
flex2vibe: {
|
|
88
|
+
getClass: () => 'item',
|
|
89
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
90
|
+
rekey: {
|
|
91
|
+
itemNumber: 'vibeIQIdentifier',
|
|
92
|
+
name: 'productName',
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
LCSSKU: {
|
|
97
|
+
vibeOwningKeys: ['itemNumber', 'lifecycleStage'],
|
|
98
|
+
vibe2flex: {
|
|
99
|
+
getClass: () => 'LCSSKU',
|
|
100
|
+
getSoftType: (entity) => {
|
|
101
|
+
const prodType = entity['prodType'];
|
|
102
|
+
let val = '';
|
|
103
|
+
switch (prodType) {
|
|
104
|
+
case 'acc':
|
|
105
|
+
val = 'Product\\Accesories';
|
|
106
|
+
break;
|
|
107
|
+
case 'app':
|
|
108
|
+
val = 'Product\\Apparel';
|
|
109
|
+
break;
|
|
110
|
+
case 'eqp':
|
|
111
|
+
val = 'Product\\Equipment';
|
|
112
|
+
break;
|
|
113
|
+
case 'foot':
|
|
114
|
+
val = 'Product\\Footwear';
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
return val;
|
|
118
|
+
},
|
|
119
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
120
|
+
rekey: {
|
|
121
|
+
skuName: 'optionName',
|
|
122
|
+
vibeIQIdentifier: 'itemNumber'
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
flex2vibe: {
|
|
126
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
127
|
+
rekey: {
|
|
128
|
+
itemNumber: 'vibeIQIdentifier',
|
|
129
|
+
optionName: 'skuName',
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
packaging: {
|
|
134
|
+
vibe2flex: {
|
|
135
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
136
|
+
rekey: {
|
|
137
|
+
retailPackType: 'packType',
|
|
138
|
+
retailIntroDate: 'introDate'
|
|
139
|
+
},
|
|
140
|
+
getSoftType: () => 'Revisable Entity\\packaging',
|
|
141
|
+
getClass: () => 'LCSRevisableEntity'
|
|
142
|
+
},
|
|
143
|
+
flex2vibe: {
|
|
144
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
145
|
+
rekey: {
|
|
146
|
+
packType: 'retailPackType',
|
|
147
|
+
introDate: 'retailIntroDate'
|
|
148
|
+
},
|
|
149
|
+
getClass: () => 'custom-entity',
|
|
150
|
+
getSoftType: () => 'custom-entity:pack',
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
prefix: {
|
|
154
|
+
vibe2flex: {
|
|
155
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
156
|
+
rekey: {
|
|
157
|
+
retailOwner: 'owner',
|
|
158
|
+
retailIntroDate: 'introDate'
|
|
159
|
+
},
|
|
160
|
+
getSoftType: () => 'Revisable Entity\\prefix',
|
|
161
|
+
getClass: () => 'LCSRevisableEntity'
|
|
162
|
+
},
|
|
163
|
+
flex2vibe: {
|
|
164
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
165
|
+
rekey: {
|
|
166
|
+
owner: 'retailOwner',
|
|
167
|
+
introDate: 'retailIntroDate'
|
|
168
|
+
},
|
|
169
|
+
getClass: () => 'custom-entity',
|
|
170
|
+
getSoftType: () => 'custom-entity:prefix',
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
catName: {
|
|
174
|
+
getIdentifierProperties: () => ['catName', 'catNumber'],
|
|
175
|
+
getInformationalProperties: () => ['longName'],
|
|
176
|
+
vibe2flex: {
|
|
177
|
+
transformOrder: [],
|
|
178
|
+
getSoftType: () => 'Last\\catName',
|
|
179
|
+
getClass: () => 'LCSLast'
|
|
180
|
+
},
|
|
181
|
+
flex2vibe: {
|
|
182
|
+
transformOrder: [],
|
|
183
|
+
getClass: () => 'custom-entity',
|
|
184
|
+
getSoftType: () => 'custom-entity:catName',
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
partnerOrg: {
|
|
188
|
+
vibe2flex: {
|
|
189
|
+
transformOrder: [],
|
|
190
|
+
getSoftType: () => 'Business Object\\partnerOrg',
|
|
191
|
+
getClass: () => 'LCSLifecycleManaged'
|
|
192
|
+
},
|
|
193
|
+
flex2vibe: {
|
|
194
|
+
transformOrder: [],
|
|
195
|
+
getClass: () => 'custom-entity',
|
|
196
|
+
getSoftType: () => 'custom-entity:partnerOrg',
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
catFamily: {
|
|
200
|
+
vibe2flex: {
|
|
201
|
+
transformOrder: [],
|
|
202
|
+
getSoftType: () => 'Revisable Entity\\catFamily',
|
|
203
|
+
getClass: () => 'LCSRevisableEntity'
|
|
204
|
+
},
|
|
205
|
+
flex2vibe: {
|
|
206
|
+
transformOrder: [],
|
|
207
|
+
getClass: () => 'custom-entity',
|
|
208
|
+
getSoftType: () => 'custom-entity:catFamily',
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
formName: {
|
|
212
|
+
vibe2flex: {
|
|
213
|
+
transformOrder: [],
|
|
214
|
+
getSoftType: () => 'Material\\form',
|
|
215
|
+
getClass: () => 'LCSMaterial'
|
|
216
|
+
},
|
|
217
|
+
flex2vibe: {
|
|
218
|
+
transformOrder: [],
|
|
219
|
+
getClass: () => 'custom-entity',
|
|
220
|
+
getSoftType: () => 'custom-entity:formName',
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
};
|
|
224
|
+
exports.mapping2 = {
|
|
225
|
+
typeConversion: {
|
|
226
|
+
vibe2flex: {
|
|
227
|
+
'custom-entity': {
|
|
228
|
+
getMapKey: (entity) => {
|
|
229
|
+
const typePath = entity['typePath'];
|
|
230
|
+
let mapKey = '';
|
|
231
|
+
switch (typePath) {
|
|
232
|
+
case 'custom-entity:pack':
|
|
233
|
+
mapKey = 'packaging';
|
|
234
|
+
break;
|
|
235
|
+
case 'custom-entity:prefix':
|
|
236
|
+
mapKey = 'prefix';
|
|
237
|
+
break;
|
|
238
|
+
case 'custom-entity:catName':
|
|
239
|
+
mapKey = 'catName';
|
|
240
|
+
break;
|
|
241
|
+
case 'custom-entity:partnerOrg':
|
|
242
|
+
mapKey = 'partnerOrg';
|
|
243
|
+
break;
|
|
244
|
+
case 'custom-entity:catFamily':
|
|
245
|
+
mapKey = 'catFamily';
|
|
246
|
+
break;
|
|
247
|
+
case 'custom-entity:formName':
|
|
248
|
+
mapKey = 'formName';
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
return mapKey;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
LCSSeason: {
|
|
257
|
+
getIdentifierProperties: () => ['brand', 'year', 'seasonType'],
|
|
258
|
+
vibe2flex: {
|
|
259
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
260
|
+
rekey: {
|
|
261
|
+
seasonName: 'flexPLMSeasonName'
|
|
262
|
+
},
|
|
263
|
+
getSoftType: () => 'Season',
|
|
264
|
+
getClass: () => 'LCSSeason'
|
|
265
|
+
},
|
|
266
|
+
flex2vibe: {
|
|
267
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
268
|
+
rekey: {
|
|
269
|
+
flexPLMSeasonName: 'seasonName'
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
LCSProduct: {
|
|
274
|
+
vibeOwningKeys: ['itemNumber', 'lifecycleStage'],
|
|
275
|
+
vibe2flex: {
|
|
276
|
+
getClass: () => 'LCSProduct',
|
|
277
|
+
getSoftType: (entity) => {
|
|
278
|
+
const prodType = entity['prodType'];
|
|
279
|
+
let val = '';
|
|
280
|
+
switch (prodType) {
|
|
281
|
+
case 'acc':
|
|
282
|
+
val = 'Product\\Accesories';
|
|
283
|
+
break;
|
|
284
|
+
case 'app':
|
|
285
|
+
val = 'Product\\Apparel';
|
|
286
|
+
break;
|
|
287
|
+
case 'eqp':
|
|
288
|
+
val = 'Product\\Equipment';
|
|
289
|
+
break;
|
|
290
|
+
case 'foot':
|
|
291
|
+
val = 'Product\\Footwear';
|
|
292
|
+
break;
|
|
293
|
+
}
|
|
294
|
+
return val;
|
|
295
|
+
},
|
|
296
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }, { processor: 'VALUE_TRANSFORM', functionTransformersKey: 'valueTransform' }],
|
|
297
|
+
rekey: {
|
|
298
|
+
productName: 'name',
|
|
299
|
+
vibeIQIdentifier: 'itemNumber'
|
|
300
|
+
},
|
|
301
|
+
valueTransform: {
|
|
302
|
+
transformEx: (row) => {
|
|
303
|
+
return row['otherProp'] + 'xxx';
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
flex2vibe: {
|
|
308
|
+
getClass: () => 'item',
|
|
309
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
310
|
+
rekey: {
|
|
311
|
+
itemNumber: 'vibeIQIdentifier',
|
|
312
|
+
name: 'productName',
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
LCSSKU: {
|
|
317
|
+
vibeOwningKeys: ['itemNumber', 'lifecycleStage'],
|
|
318
|
+
getIdentifierProperties: () => ['uniqueIdentifierA', 'uniqueIdentifierB'],
|
|
319
|
+
vibe2flex: {
|
|
320
|
+
getClass: () => 'LCSSKU',
|
|
321
|
+
getSoftType: (entity) => {
|
|
322
|
+
const prodType = entity['prodType'];
|
|
323
|
+
let val = '';
|
|
324
|
+
switch (prodType) {
|
|
325
|
+
case 'acc':
|
|
326
|
+
val = 'Product\\Accesories';
|
|
327
|
+
break;
|
|
328
|
+
case 'app':
|
|
329
|
+
val = 'Product\\Apparel';
|
|
330
|
+
break;
|
|
331
|
+
case 'eqp':
|
|
332
|
+
val = 'Product\\Equipment';
|
|
333
|
+
break;
|
|
334
|
+
case 'foot':
|
|
335
|
+
val = 'Product\\Footwear';
|
|
336
|
+
break;
|
|
337
|
+
}
|
|
338
|
+
return val;
|
|
339
|
+
},
|
|
340
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
341
|
+
rekey: {
|
|
342
|
+
skuName: 'optionName',
|
|
343
|
+
vibeIQIdentifier: 'itemNumber'
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
flex2vibe: {
|
|
347
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
348
|
+
rekey: {
|
|
349
|
+
itemNumber: 'vibeIQIdentifier',
|
|
350
|
+
optionName: 'skuName',
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
packaging: {
|
|
355
|
+
vibe2flex: {
|
|
356
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
357
|
+
rekey: {
|
|
358
|
+
retailPackType: 'packType',
|
|
359
|
+
retailIntroDate: 'introDate'
|
|
360
|
+
},
|
|
361
|
+
getSoftType: () => 'Revisable Entity\\packaging',
|
|
362
|
+
getClass: () => 'LCSRevisableEntity'
|
|
363
|
+
},
|
|
364
|
+
flex2vibe: {
|
|
365
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
366
|
+
rekey: {
|
|
367
|
+
packType: 'retailPackType',
|
|
368
|
+
introDate: 'retailIntroDate'
|
|
369
|
+
},
|
|
370
|
+
getClass: () => 'custom-entity',
|
|
371
|
+
getSoftType: () => 'custom-entity:pack',
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
prefix: {
|
|
375
|
+
vibe2flex: {
|
|
376
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
377
|
+
rekey: {
|
|
378
|
+
retailOwner: 'owner',
|
|
379
|
+
retailIntroDate: 'introDate'
|
|
380
|
+
},
|
|
381
|
+
getSoftType: () => 'Revisable Entity\\prefix',
|
|
382
|
+
getClass: () => 'LCSRevisableEntity'
|
|
383
|
+
},
|
|
384
|
+
flex2vibe: {
|
|
385
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
386
|
+
rekey: {
|
|
387
|
+
owner: 'retailOwner',
|
|
388
|
+
introDate: 'retailIntroDate'
|
|
389
|
+
},
|
|
390
|
+
getClass: () => 'custom-entity',
|
|
391
|
+
getSoftType: () => 'custom-entity:prefix',
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
catName: {
|
|
395
|
+
getIdentifierProperties: () => ['catName', 'catNumber'],
|
|
396
|
+
getInformationalProperties: () => ['longName'],
|
|
397
|
+
vibe2flex: {
|
|
398
|
+
transformOrder: [],
|
|
399
|
+
getSoftType: () => 'Last\\catName',
|
|
400
|
+
getClass: () => 'LCSLast'
|
|
401
|
+
},
|
|
402
|
+
flex2vibe: {
|
|
403
|
+
transformOrder: [],
|
|
404
|
+
getClass: () => 'custom-entity',
|
|
405
|
+
getSoftType: () => 'custom-entity:catName',
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
partnerOrg: {
|
|
409
|
+
vibe2flex: {
|
|
410
|
+
transformOrder: [],
|
|
411
|
+
getSoftType: () => 'Business Object\\partnerOrg',
|
|
412
|
+
getClass: () => 'LCSLifecycleManaged'
|
|
413
|
+
},
|
|
414
|
+
flex2vibe: {
|
|
415
|
+
transformOrder: [],
|
|
416
|
+
getClass: () => 'custom-entity',
|
|
417
|
+
getSoftType: () => 'custom-entity:partnerOrg',
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
catFamily: {
|
|
421
|
+
vibe2flex: {
|
|
422
|
+
transformOrder: [],
|
|
423
|
+
getSoftType: () => 'Revisable Entity\\catFamily',
|
|
424
|
+
getClass: () => 'LCSRevisableEntity'
|
|
425
|
+
},
|
|
426
|
+
flex2vibe: {
|
|
427
|
+
transformOrder: [],
|
|
428
|
+
getClass: () => 'custom-entity',
|
|
429
|
+
getSoftType: () => 'custom-entity:catFamily',
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
formName: {
|
|
433
|
+
vibe2flex: {
|
|
434
|
+
transformOrder: [],
|
|
435
|
+
getSoftType: () => 'Material\\form',
|
|
436
|
+
getClass: () => 'LCSMaterial'
|
|
437
|
+
},
|
|
438
|
+
flex2vibe: {
|
|
439
|
+
transformOrder: [],
|
|
440
|
+
getClass: () => 'custom-entity',
|
|
441
|
+
getSoftType: () => 'custom-entity:formName',
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
};
|