@contrail/flexplm 1.1.66 → 1.1.67-alpha.1
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/CHANGELOG.md +21 -0
- package/lib/entity-processor/base-entity-processor.spec.js +1 -1
- package/lib/util/event-short-message-status.d.ts +2 -0
- package/lib/util/event-short-message-status.js +2 -0
- package/package.json +1 -1
- package/src/entity-processor/base-entity-processor.spec.ts +1 -1
- package/src/util/event-short-message-status.ts +3 -0
- package/src/util/type-conversion-utils-spec-mockData.ts +243 -238
- package/src/util/type-conversion-utils.spec.ts +39 -0
- package/src/util/type-conversion-utils.ts +359 -359
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@contrail/flexplm` are documented here.
|
|
4
|
+
|
|
5
|
+
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
6
|
+
Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [1.1.67] - 2026-xx-xx
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- Added EventShortMessageStatus status values for adding items to projects functionality.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- Added optional `context` parameter to `TypeConversionUtils.isInboundCreatableFromObject` method to allow passing context data to map file `isInboundCreatable` functions.
|
|
17
|
+
|
|
18
|
+
## [1.1.66] - (initial changelog entry)
|
|
19
|
+
|
|
20
|
+
- Initial changelog. Prior releases did not include a changelog.
|
|
21
|
+
See git history for changes predating this entry.
|
|
@@ -146,7 +146,7 @@ describe('BaseEntityProcessor', () => {
|
|
|
146
146
|
expect(getTransformedDataSpy).toBeCalledWith(flexResponse.data.payload[0]);
|
|
147
147
|
expect(getUpdatesForEntitySpy).toBeCalledTimes(1);
|
|
148
148
|
});
|
|
149
|
-
it('should
|
|
149
|
+
it('should skip setting flexPLMObjectClass when data is null or undefined', async () => {
|
|
150
150
|
const btep = new TestBaseEntityProcessor(config, dc, mapFileUtil, 'test');
|
|
151
151
|
const event = { newData: { id: '123' } };
|
|
152
152
|
const flexResponse = {
|
|
@@ -2,6 +2,8 @@ export declare enum EventShortMessageStatus {
|
|
|
2
2
|
SUCCESS = "Success",
|
|
3
3
|
FAILURE = "Failure",
|
|
4
4
|
CREATED = "Created",
|
|
5
|
+
ITEM_FAMILY_ID_MISSING = "Item_family_id_missing",
|
|
6
|
+
PROJECT_ITEM_NOT_FOUND = "Project_item_not_found",
|
|
5
7
|
MISSING_IDENTIFIER_PROPERTIES = "Missing_identifier_properties",
|
|
6
8
|
MISSING_INPUT = "Missing_input",
|
|
7
9
|
NOT_CREATABLE = "Not_creatable",
|
|
@@ -6,6 +6,8 @@ var EventShortMessageStatus;
|
|
|
6
6
|
EventShortMessageStatus["SUCCESS"] = "Success";
|
|
7
7
|
EventShortMessageStatus["FAILURE"] = "Failure";
|
|
8
8
|
EventShortMessageStatus["CREATED"] = "Created";
|
|
9
|
+
EventShortMessageStatus["ITEM_FAMILY_ID_MISSING"] = "Item_family_id_missing";
|
|
10
|
+
EventShortMessageStatus["PROJECT_ITEM_NOT_FOUND"] = "Project_item_not_found";
|
|
9
11
|
EventShortMessageStatus["MISSING_IDENTIFIER_PROPERTIES"] = "Missing_identifier_properties";
|
|
10
12
|
EventShortMessageStatus["MISSING_INPUT"] = "Missing_input";
|
|
11
13
|
EventShortMessageStatus["NOT_CREATABLE"] = "Not_creatable";
|
package/package.json
CHANGED
|
@@ -160,7 +160,7 @@ describe('BaseEntityProcessor', () =>{
|
|
|
160
160
|
expect(getUpdatesForEntitySpy).toBeCalledTimes(1);
|
|
161
161
|
});
|
|
162
162
|
|
|
163
|
-
it('should
|
|
163
|
+
it('should skip setting flexPLMObjectClass when data is null or undefined', async () =>{
|
|
164
164
|
const btep = new TestBaseEntityProcessor(config, dc, mapFileUtil, 'test');
|
|
165
165
|
const event = { newData: { id: '123' } };
|
|
166
166
|
const flexResponse = {
|
|
@@ -2,6 +2,9 @@ export enum EventShortMessageStatus {
|
|
|
2
2
|
SUCCESS = 'Success',
|
|
3
3
|
FAILURE = 'Failure',
|
|
4
4
|
CREATED = 'Created',
|
|
5
|
+
ITEM_FAMILY_ID_MISSING = "Item_family_id_missing",
|
|
6
|
+
ITEM_FAMILY_NOT_FOUND = "Item_family_not_found",
|
|
7
|
+
PROJECT_ITEM_NOT_FOUND = "Project_item_not_found",
|
|
5
8
|
MISSING_IDENTIFIER_PROPERTIES = 'Missing_identifier_properties',
|
|
6
9
|
MISSING_INPUT = 'Missing_input',
|
|
7
10
|
NOT_CREATABLE = 'Not_creatable',
|
|
@@ -1,239 +1,244 @@
|
|
|
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
|
-
|
|
31
|
-
return mapKey;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
flex2vibe: {
|
|
36
|
-
LCSLast: {
|
|
37
|
-
getMapKey: (object) =>{ return 'catName';}
|
|
38
|
-
},
|
|
39
|
-
LCSRevisableEntity : {
|
|
40
|
-
getMapKey: (object) =>{
|
|
41
|
-
const typePath = object['flexPLMTypePath'];
|
|
42
|
-
let mapKey = '';
|
|
43
|
-
switch (typePath) {
|
|
44
|
-
case 'Revisable Entity\\packaging':
|
|
45
|
-
mapKey = 'packaging';
|
|
46
|
-
break
|
|
47
|
-
case 'Revisable Entity\\prefix':
|
|
48
|
-
mapKey = 'prefix';
|
|
49
|
-
break
|
|
50
|
-
};
|
|
51
|
-
return mapKey;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
LCSProduct: {
|
|
58
|
-
vibeOwningKeys: ['itemNumber', 'lifecycleStage'],
|
|
59
|
-
vibe2flex: {
|
|
60
|
-
getClass: () => 'LCSProduct',
|
|
61
|
-
getSoftType: (entity /*, dependencies*/) =>{
|
|
62
|
-
const prodType = entity['prodType'];
|
|
63
|
-
let val = '';
|
|
64
|
-
switch (prodType) {
|
|
65
|
-
case 'acc':
|
|
66
|
-
val = 'Product\\Accesories';
|
|
67
|
-
break;
|
|
68
|
-
case 'app':
|
|
69
|
-
val = 'Product\\Apparel';
|
|
70
|
-
break;
|
|
71
|
-
case 'eqp':
|
|
72
|
-
val = 'Product\\Equipment';
|
|
73
|
-
break;
|
|
74
|
-
case 'foot':
|
|
75
|
-
val = 'Product\\Footwear';
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return val;
|
|
80
|
-
},
|
|
81
|
-
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }, { processor: 'VALUE_TRANSFORM', functionTransformersKey: 'valueTransform' }],
|
|
82
|
-
rekey: {
|
|
83
|
-
productName: 'name',
|
|
84
|
-
vibeIQIdentifier: 'itemNumber'
|
|
85
|
-
},
|
|
86
|
-
valueTransform: {
|
|
87
|
-
transformEx: (row/*, dependencies*/) => {
|
|
88
|
-
return row['otherProp'] + 'xxx';
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
},
|
|
93
|
-
flex2vibe: {
|
|
94
|
-
getClass: () => 'item',
|
|
95
|
-
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
96
|
-
rekey: {
|
|
97
|
-
itemNumber: 'vibeIQIdentifier',
|
|
98
|
-
name: 'productName',
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
LCSSKU: {
|
|
103
|
-
vibeOwningKeys: ['itemNumber', 'lifecycleStage'],
|
|
104
|
-
vibe2flex: {
|
|
105
|
-
getClass: () => 'LCSSKU',
|
|
106
|
-
getSoftType: (entity /*, dependencies*/) =>{
|
|
107
|
-
const prodType = entity['prodType'];
|
|
108
|
-
let val = '';
|
|
109
|
-
switch (prodType) {
|
|
110
|
-
case 'acc':
|
|
111
|
-
val = 'Product\\Accesories';
|
|
112
|
-
break;
|
|
113
|
-
case 'app':
|
|
114
|
-
val = 'Product\\Apparel';
|
|
115
|
-
break;
|
|
116
|
-
case 'eqp':
|
|
117
|
-
val = 'Product\\Equipment';
|
|
118
|
-
break;
|
|
119
|
-
case 'foot':
|
|
120
|
-
val = 'Product\\Footwear';
|
|
121
|
-
break;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
return val;
|
|
125
|
-
},
|
|
126
|
-
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
127
|
-
rekey: {
|
|
128
|
-
skuName: 'optionName',
|
|
129
|
-
vibeIQIdentifier: 'itemNumber'
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
flex2vibe: {
|
|
133
|
-
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
134
|
-
rekey: {
|
|
135
|
-
itemNumber: 'vibeIQIdentifier',
|
|
136
|
-
optionName: 'skuName',
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
packaging: {
|
|
142
|
-
vibe2flex: {
|
|
143
|
-
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
144
|
-
rekey: {
|
|
145
|
-
retailPackType: 'packType',
|
|
146
|
-
retailIntroDate: 'introDate'
|
|
147
|
-
},
|
|
148
|
-
getSoftType: () => 'Revisable Entity\\packaging',
|
|
149
|
-
getClass: () => 'LCSRevisableEntity'
|
|
150
|
-
},
|
|
151
|
-
flex2vibe: {
|
|
152
|
-
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
153
|
-
rekey: {
|
|
154
|
-
packType: 'retailPackType',
|
|
155
|
-
introDate: 'retailIntroDate'
|
|
156
|
-
},
|
|
157
|
-
getClass: () => 'custom-entity',
|
|
158
|
-
getSoftType: () => 'custom-entity:pack',
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
prefix: {
|
|
163
|
-
isInboundCreatable: () =>
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
transformOrder: [],
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
transformOrder: [],
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
transformOrder: [],
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
transformOrder: [],
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
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
|
+
|
|
31
|
+
return mapKey;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
flex2vibe: {
|
|
36
|
+
LCSLast: {
|
|
37
|
+
getMapKey: (object) =>{ return 'catName';}
|
|
38
|
+
},
|
|
39
|
+
LCSRevisableEntity : {
|
|
40
|
+
getMapKey: (object) =>{
|
|
41
|
+
const typePath = object['flexPLMTypePath'];
|
|
42
|
+
let mapKey = '';
|
|
43
|
+
switch (typePath) {
|
|
44
|
+
case 'Revisable Entity\\packaging':
|
|
45
|
+
mapKey = 'packaging';
|
|
46
|
+
break
|
|
47
|
+
case 'Revisable Entity\\prefix':
|
|
48
|
+
mapKey = 'prefix';
|
|
49
|
+
break
|
|
50
|
+
};
|
|
51
|
+
return mapKey;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
},
|
|
57
|
+
LCSProduct: {
|
|
58
|
+
vibeOwningKeys: ['itemNumber', 'lifecycleStage'],
|
|
59
|
+
vibe2flex: {
|
|
60
|
+
getClass: () => 'LCSProduct',
|
|
61
|
+
getSoftType: (entity /*, dependencies*/) =>{
|
|
62
|
+
const prodType = entity['prodType'];
|
|
63
|
+
let val = '';
|
|
64
|
+
switch (prodType) {
|
|
65
|
+
case 'acc':
|
|
66
|
+
val = 'Product\\Accesories';
|
|
67
|
+
break;
|
|
68
|
+
case 'app':
|
|
69
|
+
val = 'Product\\Apparel';
|
|
70
|
+
break;
|
|
71
|
+
case 'eqp':
|
|
72
|
+
val = 'Product\\Equipment';
|
|
73
|
+
break;
|
|
74
|
+
case 'foot':
|
|
75
|
+
val = 'Product\\Footwear';
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return val;
|
|
80
|
+
},
|
|
81
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }, { processor: 'VALUE_TRANSFORM', functionTransformersKey: 'valueTransform' }],
|
|
82
|
+
rekey: {
|
|
83
|
+
productName: 'name',
|
|
84
|
+
vibeIQIdentifier: 'itemNumber'
|
|
85
|
+
},
|
|
86
|
+
valueTransform: {
|
|
87
|
+
transformEx: (row/*, dependencies*/) => {
|
|
88
|
+
return row['otherProp'] + 'xxx';
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
},
|
|
93
|
+
flex2vibe: {
|
|
94
|
+
getClass: () => 'item',
|
|
95
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
96
|
+
rekey: {
|
|
97
|
+
itemNumber: 'vibeIQIdentifier',
|
|
98
|
+
name: 'productName',
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
LCSSKU: {
|
|
103
|
+
vibeOwningKeys: ['itemNumber', 'lifecycleStage'],
|
|
104
|
+
vibe2flex: {
|
|
105
|
+
getClass: () => 'LCSSKU',
|
|
106
|
+
getSoftType: (entity /*, dependencies*/) =>{
|
|
107
|
+
const prodType = entity['prodType'];
|
|
108
|
+
let val = '';
|
|
109
|
+
switch (prodType) {
|
|
110
|
+
case 'acc':
|
|
111
|
+
val = 'Product\\Accesories';
|
|
112
|
+
break;
|
|
113
|
+
case 'app':
|
|
114
|
+
val = 'Product\\Apparel';
|
|
115
|
+
break;
|
|
116
|
+
case 'eqp':
|
|
117
|
+
val = 'Product\\Equipment';
|
|
118
|
+
break;
|
|
119
|
+
case 'foot':
|
|
120
|
+
val = 'Product\\Footwear';
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return val;
|
|
125
|
+
},
|
|
126
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
127
|
+
rekey: {
|
|
128
|
+
skuName: 'optionName',
|
|
129
|
+
vibeIQIdentifier: 'itemNumber'
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
flex2vibe: {
|
|
133
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
134
|
+
rekey: {
|
|
135
|
+
itemNumber: 'vibeIQIdentifier',
|
|
136
|
+
optionName: 'skuName',
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
packaging: {
|
|
142
|
+
vibe2flex: {
|
|
143
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
144
|
+
rekey: {
|
|
145
|
+
retailPackType: 'packType',
|
|
146
|
+
retailIntroDate: 'introDate'
|
|
147
|
+
},
|
|
148
|
+
getSoftType: () => 'Revisable Entity\\packaging',
|
|
149
|
+
getClass: () => 'LCSRevisableEntity'
|
|
150
|
+
},
|
|
151
|
+
flex2vibe: {
|
|
152
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
153
|
+
rekey: {
|
|
154
|
+
packType: 'retailPackType',
|
|
155
|
+
introDate: 'retailIntroDate'
|
|
156
|
+
},
|
|
157
|
+
getClass: () => 'custom-entity',
|
|
158
|
+
getSoftType: () => 'custom-entity:pack',
|
|
159
|
+
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
prefix: {
|
|
163
|
+
isInboundCreatable: (object, context) => {
|
|
164
|
+
if (context && context.skipPrefix) {
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
return true;
|
|
168
|
+
},
|
|
169
|
+
vibe2flex: {
|
|
170
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
171
|
+
rekey: {
|
|
172
|
+
retailOwner: 'owner',
|
|
173
|
+
retailIntroDate: 'introDate'
|
|
174
|
+
},
|
|
175
|
+
getSoftType: () => 'Revisable Entity\\prefix',
|
|
176
|
+
getClass: () => 'LCSRevisableEntity'
|
|
177
|
+
},
|
|
178
|
+
flex2vibe: {
|
|
179
|
+
transformOrder: [{ processor: 'REKEY', rekeyDelete: true, rekeyTransformersKey: 'rekey' }],
|
|
180
|
+
rekey: {
|
|
181
|
+
owner: 'retailOwner',
|
|
182
|
+
introDate: 'retailIntroDate'
|
|
183
|
+
},
|
|
184
|
+
getClass: () => 'custom-entity',
|
|
185
|
+
getSoftType: () => 'custom-entity:prefix',
|
|
186
|
+
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
catName: {
|
|
190
|
+
getIdentifierProperties: () => ['catName', 'catNumber'],
|
|
191
|
+
getInformationalProperties: () => ['longName'],
|
|
192
|
+
vibe2flex: {
|
|
193
|
+
transformOrder: [],
|
|
194
|
+
getSoftType: () => 'Last\\catName',
|
|
195
|
+
getClass: () => 'LCSLast'
|
|
196
|
+
},
|
|
197
|
+
flex2vibe: {
|
|
198
|
+
transformOrder: [],
|
|
199
|
+
getClass: () => 'custom-entity',
|
|
200
|
+
getSoftType: () => 'custom-entity:catName',
|
|
201
|
+
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
partnerOrg: {
|
|
205
|
+
vibe2flex: {
|
|
206
|
+
transformOrder: [],
|
|
207
|
+
getSoftType: () => 'Business Object\\partnerOrg',
|
|
208
|
+
getClass: () => 'LCSLifecycleManaged'
|
|
209
|
+
},
|
|
210
|
+
flex2vibe: {
|
|
211
|
+
transformOrder: [],
|
|
212
|
+
getClass: () => 'custom-entity',
|
|
213
|
+
getSoftType: () => 'custom-entity:partnerOrg',
|
|
214
|
+
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
catFamily: {
|
|
218
|
+
vibe2flex: {
|
|
219
|
+
transformOrder: [],
|
|
220
|
+
getSoftType: () => 'Revisable Entity\\catFamily',
|
|
221
|
+
getClass: () => 'LCSRevisableEntity'
|
|
222
|
+
},
|
|
223
|
+
flex2vibe: {
|
|
224
|
+
transformOrder: [],
|
|
225
|
+
getClass: () => 'custom-entity',
|
|
226
|
+
getSoftType: () => 'custom-entity:catFamily',
|
|
227
|
+
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
formName: {
|
|
231
|
+
vibe2flex: {
|
|
232
|
+
transformOrder: [],
|
|
233
|
+
getSoftType: () => 'Material\\form',
|
|
234
|
+
getClass: () => 'LCSMaterial'
|
|
235
|
+
},
|
|
236
|
+
flex2vibe: {
|
|
237
|
+
transformOrder: [],
|
|
238
|
+
getClass: () => 'custom-entity',
|
|
239
|
+
getSoftType: () => 'custom-entity:formName',
|
|
240
|
+
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
|
|
239
244
|
};
|
|
@@ -640,5 +640,44 @@ describe('conversion-utils', () => {
|
|
|
640
640
|
}
|
|
641
641
|
});
|
|
642
642
|
|
|
643
|
+
it('should pass context to isInboundCreatable function', async () =>{
|
|
644
|
+
const spy = jest.spyOn(mapFileUtil, 'getMapFile')
|
|
645
|
+
.mockImplementation(async () =>{
|
|
646
|
+
return mapping;
|
|
647
|
+
});
|
|
648
|
+
const object = {
|
|
649
|
+
flexPLMObjectClass: 'LCSRevisableEntity',
|
|
650
|
+
flexPLMTypePath: 'Revisable Entity\\prefix'
|
|
651
|
+
}
|
|
652
|
+
const context = { skipPrefix: true };
|
|
653
|
+
|
|
654
|
+
try{
|
|
655
|
+
const results = await TypeConversionUtils.isInboundCreatableFromObject(TRANSFORM_MAP_FILE, mapFileUtil, object, context);
|
|
656
|
+
expect(results).toBeFalsy();
|
|
657
|
+
|
|
658
|
+
} finally {
|
|
659
|
+
spy.mockRestore();
|
|
660
|
+
}
|
|
661
|
+
});
|
|
662
|
+
|
|
663
|
+
it('should work without context parameter', async () =>{
|
|
664
|
+
const spy = jest.spyOn(mapFileUtil, 'getMapFile')
|
|
665
|
+
.mockImplementation(async () =>{
|
|
666
|
+
return mapping;
|
|
667
|
+
});
|
|
668
|
+
const object = {
|
|
669
|
+
flexPLMObjectClass: 'LCSRevisableEntity',
|
|
670
|
+
flexPLMTypePath: 'Revisable Entity\\prefix'
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
try{
|
|
674
|
+
const results = await TypeConversionUtils.isInboundCreatableFromObject(TRANSFORM_MAP_FILE, mapFileUtil, object);
|
|
675
|
+
expect(results).toBeTruthy();
|
|
676
|
+
|
|
677
|
+
} finally {
|
|
678
|
+
spy.mockRestore();
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
|
|
643
682
|
});
|
|
644
683
|
});
|