@contrail/flexplm 1.5.1-alpha.c9b11be → 1.6.0-alpha.6f15d4e
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/cli/commands/compile.d.ts +4 -0
- package/lib/cli/commands/compile.js +73 -0
- package/lib/cli/commands/compile.spec.d.ts +1 -0
- package/lib/cli/commands/compile.spec.js +80 -0
- package/lib/cli/commands/create.d.ts +5 -0
- package/lib/cli/commands/create.js +77 -0
- package/lib/cli/commands/create.spec.d.ts +1 -0
- package/lib/cli/commands/create.spec.js +78 -0
- package/lib/cli/commands/upload.d.ts +17 -0
- package/lib/cli/commands/upload.js +228 -0
- package/lib/cli/commands/upload.spec.d.ts +1 -0
- package/lib/cli/commands/upload.spec.js +88 -0
- package/lib/cli/index.d.ts +5 -0
- package/lib/cli/index.js +70 -0
- package/lib/cli/index.spec.d.ts +1 -0
- package/lib/cli/index.spec.js +85 -0
- package/lib/cli/template/mapping-template.ts.template +62 -0
- package/lib/entity-processor/base-entity-processor.d.ts +65 -0
- package/lib/entity-processor/base-entity-processor.js +71 -0
- package/lib/entity-processor/base-entity-processor.spec.js +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/interfaces/mapping-file.d.ts +460 -0
- package/lib/interfaces/mapping-file.js +2 -0
- package/lib/publish/base-process-publish-assortment.d.ts +25 -1
- package/lib/publish/base-process-publish-assortment.js +67 -48
- package/lib/publish/base-process-publish-assortment.spec.js +22 -143
- package/lib/publish/mockData.js +5 -0
- package/lib/transform/identifier-conversion-spec-mockData.js +34 -6
- package/lib/transform/identifier-conversion.d.ts +36 -0
- package/lib/transform/identifier-conversion.js +36 -0
- package/lib/transform/identifier-conversion.spec.js +4 -0
- package/lib/util/config-defaults.js +3 -0
- package/lib/util/config-defaults.spec.js +9 -0
- package/lib/util/data-converter-spec-mockData.js +17 -3
- package/lib/util/data-converter.d.ts +97 -0
- package/lib/util/data-converter.js +127 -1
- package/lib/util/data-converter.spec.js +2 -0
- package/lib/util/error-response-object.d.ts +5 -0
- package/lib/util/error-response-object.js +7 -0
- package/lib/util/event-short-message-status.js +1 -0
- package/lib/util/federation.js +8 -0
- package/lib/util/flexplm-connect.d.ts +7 -0
- package/lib/util/flexplm-connect.js +14 -0
- package/lib/util/logger-config.js +1 -0
- package/lib/util/map-util-spec-mockData.js +17 -3
- package/lib/util/map-utils.d.ts +27 -0
- package/lib/util/map-utils.js +27 -0
- package/lib/util/thumbnail-util.d.ts +21 -0
- package/lib/util/thumbnail-util.js +28 -1
- package/lib/util/thumbnail-util.spec.js +6 -0
- package/lib/util/type-conversion-utils-spec-mockData.js +3 -3
- package/lib/util/type-conversion-utils.d.ts +151 -0
- package/lib/util/type-conversion-utils.js +154 -0
- package/lib/util/type-defaults.d.ts +66 -0
- package/lib/util/type-defaults.js +66 -0
- package/lib/util/type-defaults.spec.js +5 -5
- package/lib/util/type-utils.d.ts +21 -0
- package/lib/util/type-utils.js +23 -0
- package/lib/util/type-utils.spec.js +2 -0
- package/package.json +21 -6
- package/scripts/copy-template.js +10 -0
- package/.github/pull_request_template.md +0 -31
- package/.github/workflows/flexplm-lib.yml +0 -27
- package/.github/workflows/publish-to-npm.yml +0 -121
- package/CHANGELOG.md +0 -49
- package/publish.bat +0 -5
- package/publish.sh +0 -5
- package/src/entity-processor/base-entity-processor.spec.ts +0 -689
- package/src/entity-processor/base-entity-processor.ts +0 -583
- package/src/flexplm-request.ts +0 -28
- package/src/flexplm-utils.spec.ts +0 -27
- package/src/flexplm-utils.ts +0 -29
- package/src/index.ts +0 -22
- package/src/interfaces/interfaces.ts +0 -122
- package/src/interfaces/item-family-changes.ts +0 -67
- package/src/interfaces/publish-change-data.ts +0 -43
- package/src/publish/base-process-publish-assortment-callback.ts +0 -50
- package/src/publish/base-process-publish-assortment.spec.ts +0 -2154
- package/src/publish/base-process-publish-assortment.ts +0 -1173
- package/src/publish/mockData.ts +0 -4561
- package/src/transform/identifier-conversion-spec-mockData.ts +0 -496
- package/src/transform/identifier-conversion.spec.ts +0 -386
- package/src/transform/identifier-conversion.ts +0 -282
- package/src/util/config-defaults.spec.ts +0 -445
- package/src/util/config-defaults.ts +0 -106
- package/src/util/data-converter-spec-mockData.ts +0 -231
- package/src/util/data-converter.spec.ts +0 -1622
- package/src/util/data-converter.ts +0 -819
- package/src/util/error-response-object.spec.ts +0 -116
- package/src/util/error-response-object.ts +0 -50
- package/src/util/event-short-message-status.ts +0 -22
- package/src/util/federation.ts +0 -172
- package/src/util/flexplm-connect.spec.ts +0 -132
- package/src/util/flexplm-connect.ts +0 -208
- package/src/util/logger-config.ts +0 -20
- package/src/util/map-util-spec-mockData.ts +0 -231
- package/src/util/map-utils.spec.ts +0 -103
- package/src/util/map-utils.ts +0 -41
- package/src/util/mockData.ts +0 -101
- package/src/util/thumbnail-util.spec.ts +0 -508
- package/src/util/thumbnail-util.ts +0 -272
- package/src/util/type-conversion-utils-spec-mockData.ts +0 -272
- package/src/util/type-conversion-utils.spec.ts +0 -1031
- package/src/util/type-conversion-utils.ts +0 -490
- package/src/util/type-defaults.spec.ts +0 -797
- package/src/util/type-defaults.ts +0 -320
- package/src/util/type-utils.spec.ts +0 -227
- package/src/util/type-utils.ts +0 -144
- package/tsconfig.json +0 -24
- package/tslint.json +0 -57
|
@@ -4,12 +4,26 @@ exports.TypeDefaults = void 0;
|
|
|
4
4
|
class TypeDefaults {
|
|
5
5
|
constructor() {
|
|
6
6
|
}
|
|
7
|
+
/** Applies values from the resolved config to TypeDefaults static state.
|
|
8
|
+
* Currently toggles whether LCSMaterial is treated as an item (new) or a
|
|
9
|
+
* custom-entity (old) based on config.LCSMaterial.processAsItem.
|
|
10
|
+
* Technically this could cause side effects if different parts of the code
|
|
11
|
+
* expect different behavior, but in practice * @param config will be
|
|
12
|
+
* consistent across the app and this is simpler than passing this config
|
|
13
|
+
* through multiple layers of function calls.
|
|
14
|
+
*/
|
|
7
15
|
static applyConfig(config) {
|
|
8
16
|
TypeDefaults.processLCSMaterialAsItem = TypeDefaults.isPropertyTrue(config?.LCSMaterial?.processAsItem);
|
|
9
17
|
}
|
|
10
18
|
static isPropertyTrue(value) {
|
|
11
19
|
return value === true || (typeof value === 'string' && value.toLowerCase() === 'true');
|
|
12
20
|
}
|
|
21
|
+
/**Takes in full entity and returs the default FlexPLM
|
|
22
|
+
* object class.
|
|
23
|
+
*
|
|
24
|
+
* @param entity
|
|
25
|
+
* @returns string
|
|
26
|
+
*/
|
|
13
27
|
static getDefaultObjectClass(entity) {
|
|
14
28
|
const entityType = this.getEntityType(entity);
|
|
15
29
|
let objectClass = '';
|
|
@@ -48,6 +62,12 @@ class TypeDefaults {
|
|
|
48
62
|
}
|
|
49
63
|
return objectClass;
|
|
50
64
|
}
|
|
65
|
+
/**Takes in full entity and returns the default FlexPLM type path
|
|
66
|
+
* object class.
|
|
67
|
+
*
|
|
68
|
+
* @param entity
|
|
69
|
+
* @returns string
|
|
70
|
+
*/
|
|
51
71
|
static getDefaultObjectTypePath(entity) {
|
|
52
72
|
let typePath = '';
|
|
53
73
|
const entityType = this.getEntityType(entity);
|
|
@@ -76,6 +96,13 @@ class TypeDefaults {
|
|
|
76
96
|
}
|
|
77
97
|
return typePath;
|
|
78
98
|
}
|
|
99
|
+
/**Takes in full entity and returns the slugs for the default identifier
|
|
100
|
+
* properties. These properties are used when searching for an entity
|
|
101
|
+
* object class.
|
|
102
|
+
*
|
|
103
|
+
* @param entity
|
|
104
|
+
* @returns string[]
|
|
105
|
+
*/
|
|
79
106
|
static getDefaultIdentifierProperties(entity) {
|
|
80
107
|
const identifierProps = [];
|
|
81
108
|
const entityType = this.getEntityType(entity);
|
|
@@ -101,6 +128,13 @@ class TypeDefaults {
|
|
|
101
128
|
}
|
|
102
129
|
return identifierProps;
|
|
103
130
|
}
|
|
131
|
+
/** Takes in full entity and returns the slugs for informational
|
|
132
|
+
* properties. These properties are helpful when debugging issues
|
|
133
|
+
* where the identifier properties don't find a match.
|
|
134
|
+
*
|
|
135
|
+
* @param entity
|
|
136
|
+
* @returns string[]
|
|
137
|
+
*/
|
|
104
138
|
static getDefaultInformationalProperties(entity) {
|
|
105
139
|
const entityType = this.getEntityType(entity);
|
|
106
140
|
let properties = [];
|
|
@@ -117,6 +151,12 @@ class TypeDefaults {
|
|
|
117
151
|
}
|
|
118
152
|
return properties;
|
|
119
153
|
}
|
|
154
|
+
/** Returns the VibeIQ entity type from an entity.
|
|
155
|
+
* Throws error if it can't determine the entity type
|
|
156
|
+
*
|
|
157
|
+
* @param entity
|
|
158
|
+
* @returns string
|
|
159
|
+
*/
|
|
120
160
|
static getEntityType(entity) {
|
|
121
161
|
let entityType = entity['entityType'];
|
|
122
162
|
if (!entityType) {
|
|
@@ -133,6 +173,12 @@ class TypeDefaults {
|
|
|
133
173
|
}
|
|
134
174
|
return entityType;
|
|
135
175
|
}
|
|
176
|
+
/**Takes in full object and returns the default VibeIQ
|
|
177
|
+
* entity class.
|
|
178
|
+
*
|
|
179
|
+
* @param entity
|
|
180
|
+
* @returns string
|
|
181
|
+
*/
|
|
136
182
|
static getDefaultEntityClass(object) {
|
|
137
183
|
let entityClass = '';
|
|
138
184
|
let objectClass = TypeDefaults.getObjectClass(object);
|
|
@@ -161,6 +207,12 @@ class TypeDefaults {
|
|
|
161
207
|
throw Error(TypeDefaults.NO_OBJECT_CLASS);
|
|
162
208
|
return entityClass;
|
|
163
209
|
}
|
|
210
|
+
/**Takes in full object and returns the default VibeIQ type path
|
|
211
|
+
* object class.
|
|
212
|
+
*
|
|
213
|
+
* @param object
|
|
214
|
+
* @returns string
|
|
215
|
+
*/
|
|
164
216
|
static getDefaultEntityTypePath(object) {
|
|
165
217
|
let typePath = '';
|
|
166
218
|
const objectClass = TypeDefaults.getObjectClass(object);
|
|
@@ -190,6 +242,13 @@ class TypeDefaults {
|
|
|
190
242
|
throw Error(TypeDefaults.NO_TYPE_PATH);
|
|
191
243
|
return typePath;
|
|
192
244
|
}
|
|
245
|
+
/**Takes in full entity and returns the slugs for the default identifier
|
|
246
|
+
* properties. These properties are used when searching for an entity
|
|
247
|
+
* object class.
|
|
248
|
+
*
|
|
249
|
+
* @param entity
|
|
250
|
+
* @returns string[]
|
|
251
|
+
*/
|
|
193
252
|
static getDefaultIdentifierPropertiesFromObject(object) {
|
|
194
253
|
const identifierProps = [];
|
|
195
254
|
const objectClass = TypeDefaults.getObjectClass(object);
|
|
@@ -221,6 +280,13 @@ class TypeDefaults {
|
|
|
221
280
|
}
|
|
222
281
|
return identifierProps;
|
|
223
282
|
}
|
|
283
|
+
/** Takes in full object and returns the slugs for informational
|
|
284
|
+
* properties. These properties are helpful when debugging issues
|
|
285
|
+
* where the identifier properties don't find a match.
|
|
286
|
+
*
|
|
287
|
+
* @param object
|
|
288
|
+
* @returns string[]
|
|
289
|
+
*/
|
|
224
290
|
static getDefaultInformationalPropertiesFromObject(object) {
|
|
225
291
|
const objectClass = TypeDefaults.getObjectClass(object);
|
|
226
292
|
let properties = [];
|
|
@@ -304,7 +304,7 @@ describe('Type Defaults', () => {
|
|
|
304
304
|
expect(() => type_defaults_1.TypeDefaults.getEntityType(entity)).toThrowError();
|
|
305
305
|
expect(() => type_defaults_1.TypeDefaults.getEntityType(entity)).toThrow(type_defaults_1.TypeDefaults.NO_ENTITY_TYPE);
|
|
306
306
|
});
|
|
307
|
-
});
|
|
307
|
+
}); //getEntityType
|
|
308
308
|
describe('getDefaultEntityClass', () => {
|
|
309
309
|
it('item - LCSProduct', () => {
|
|
310
310
|
const object = {
|
|
@@ -389,7 +389,7 @@ describe('Type Defaults', () => {
|
|
|
389
389
|
const entityClass = type_defaults_1.TypeDefaults.getDefaultEntityClass(object);
|
|
390
390
|
expect(entityClass).toBe('custom-entity');
|
|
391
391
|
});
|
|
392
|
-
});
|
|
392
|
+
}); //getDefaultEntityClass
|
|
393
393
|
describe('getDefaultEntityTypePath', () => {
|
|
394
394
|
it('LCSProduct', () => {
|
|
395
395
|
const object = {
|
|
@@ -459,7 +459,7 @@ describe('Type Defaults', () => {
|
|
|
459
459
|
};
|
|
460
460
|
expect(() => type_defaults_1.TypeDefaults.getDefaultEntityTypePath(object)).toThrowError(type_defaults_1.TypeDefaults.NO_TYPE_PATH);
|
|
461
461
|
});
|
|
462
|
-
});
|
|
462
|
+
}); //getDefaultEntityTypePath
|
|
463
463
|
describe('getDefaultIdentifierPropertiesFromObject', () => {
|
|
464
464
|
it('LCSProduct', () => {
|
|
465
465
|
const object = {
|
|
@@ -539,7 +539,7 @@ describe('Type Defaults', () => {
|
|
|
539
539
|
expect(defaultIdentifiers).toContain('name');
|
|
540
540
|
expect(defaultIdentifiers).toHaveLength(1);
|
|
541
541
|
});
|
|
542
|
-
});
|
|
542
|
+
}); //getDefaultIdentifierPropertiesFromObject
|
|
543
543
|
describe('getDefaultInformationalPropertiesFromObject', () => {
|
|
544
544
|
it('LCSProduct', () => {
|
|
545
545
|
const object = {
|
|
@@ -594,7 +594,7 @@ describe('Type Defaults', () => {
|
|
|
594
594
|
const defaultIdentifiers = type_defaults_1.TypeDefaults.getDefaultInformationalPropertiesFromObject(object);
|
|
595
595
|
expect(defaultIdentifiers).toHaveLength(0);
|
|
596
596
|
});
|
|
597
|
-
});
|
|
597
|
+
}); //getDefaultInformationalPropertiesFromObject
|
|
598
598
|
describe('applyConfig', () => {
|
|
599
599
|
afterEach(() => {
|
|
600
600
|
type_defaults_1.TypeDefaults.applyConfig({});
|
package/lib/util/type-utils.d.ts
CHANGED
|
@@ -5,9 +5,30 @@ export declare class TypeUtils {
|
|
|
5
5
|
constructor();
|
|
6
6
|
getTypeById(id: any): Promise<import("@contrail/types").Type>;
|
|
7
7
|
getByRootAndPath(options: TypeClientOptions): Promise<import("@contrail/types").Type>;
|
|
8
|
+
/** Deprecated: use TypeConversionUtils.getObjectTypePath() */
|
|
8
9
|
static getFlexPLMTypePath(entity: any): any;
|
|
10
|
+
/** Deprecated: use TypeConversionUtils.getObjectClass()
|
|
11
|
+
*
|
|
12
|
+
* @param entityType
|
|
13
|
+
* @param newData
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
9
16
|
getEventObjectClass(entityType: string, newData: any): string;
|
|
17
|
+
/** Gets the VibeIQ entity type for the object data
|
|
18
|
+
* @param data: object data
|
|
19
|
+
*/
|
|
10
20
|
getEntityTypeClientOptionsUsingMapping(transformMapFile: any, mapFileUtil: any, data: any): Promise<TypeClientOptions>;
|
|
21
|
+
/** Gets the VibeIQ entity type for the object data
|
|
22
|
+
* @param objectClass: string object class
|
|
23
|
+
* @param data: object data
|
|
24
|
+
*/
|
|
11
25
|
getEntityTypeClientOptions(objectClass: string, data: any): TypeClientOptions;
|
|
26
|
+
/** This will filter the properties based the newData entity.
|
|
27
|
+
* It is assumed the type is correct for the entity
|
|
28
|
+
*
|
|
29
|
+
* @param type entire type object
|
|
30
|
+
* @param newData the entity being processed
|
|
31
|
+
* @returns TypeProperty[] of applicable properties
|
|
32
|
+
*/
|
|
12
33
|
filterTypeProperties(type: any, newData: any): TypeProperty[];
|
|
13
34
|
}
|
package/lib/util/type-utils.js
CHANGED
|
@@ -9,6 +9,7 @@ class TypeUtils {
|
|
|
9
9
|
this.typesObj = new sdk_1.Types();
|
|
10
10
|
}
|
|
11
11
|
async getTypeById(id) {
|
|
12
|
+
// this.logger.log('!-getTypeById: ' + id);
|
|
12
13
|
const type = await this.typesObj.getType({
|
|
13
14
|
id,
|
|
14
15
|
relations: ['typeProperties', 'typeInterfaces']
|
|
@@ -19,9 +20,16 @@ class TypeUtils {
|
|
|
19
20
|
const type = await this.typesObj.getByRootAndPath(options);
|
|
20
21
|
return type;
|
|
21
22
|
}
|
|
23
|
+
/** Deprecated: use TypeConversionUtils.getObjectTypePath() */
|
|
22
24
|
static getFlexPLMTypePath(entity) {
|
|
23
25
|
return entity['flexPLMTypePath'] || entity['flexTypePath'] || '';
|
|
24
26
|
}
|
|
27
|
+
/** Deprecated: use TypeConversionUtils.getObjectClass()
|
|
28
|
+
*
|
|
29
|
+
* @param entityType
|
|
30
|
+
* @param newData
|
|
31
|
+
* @returns
|
|
32
|
+
*/
|
|
25
33
|
getEventObjectClass(entityType, newData) {
|
|
26
34
|
let objectClass = '';
|
|
27
35
|
if ('item' === entityType) {
|
|
@@ -48,6 +56,9 @@ class TypeUtils {
|
|
|
48
56
|
}
|
|
49
57
|
return objectClass;
|
|
50
58
|
}
|
|
59
|
+
/** Gets the VibeIQ entity type for the object data
|
|
60
|
+
* @param data: object data
|
|
61
|
+
*/
|
|
51
62
|
async getEntityTypeClientOptionsUsingMapping(transformMapFile, mapFileUtil, data) {
|
|
52
63
|
const root = await type_conversion_utils_1.TypeConversionUtils.getEntityClassFromObject(transformMapFile, mapFileUtil, data);
|
|
53
64
|
const path = await type_conversion_utils_1.TypeConversionUtils.getEntityTypePathFromOjbect(transformMapFile, mapFileUtil, data);
|
|
@@ -57,6 +68,10 @@ class TypeUtils {
|
|
|
57
68
|
};
|
|
58
69
|
return tco;
|
|
59
70
|
}
|
|
71
|
+
/** Gets the VibeIQ entity type for the object data
|
|
72
|
+
* @param objectClass: string object class
|
|
73
|
+
* @param data: object data
|
|
74
|
+
*/
|
|
60
75
|
getEntityTypeClientOptions(objectClass, data) {
|
|
61
76
|
let tco;
|
|
62
77
|
if (['LCSProduct', 'LCSSKU'].includes(objectClass)) {
|
|
@@ -75,6 +90,7 @@ class TypeUtils {
|
|
|
75
90
|
};
|
|
76
91
|
}
|
|
77
92
|
else if (['LCSBusinessObject', 'LCSRevisableEntity', 'LCSLast'].includes(objectClass)) {
|
|
93
|
+
//TODO need to write logic using mapping file
|
|
78
94
|
tco = {
|
|
79
95
|
root: 'custom-entity'
|
|
80
96
|
};
|
|
@@ -82,6 +98,13 @@ class TypeUtils {
|
|
|
82
98
|
}
|
|
83
99
|
return tco;
|
|
84
100
|
}
|
|
101
|
+
/** This will filter the properties based the newData entity.
|
|
102
|
+
* It is assumed the type is correct for the entity
|
|
103
|
+
*
|
|
104
|
+
* @param type entire type object
|
|
105
|
+
* @param newData the entity being processed
|
|
106
|
+
* @returns TypeProperty[] of applicable properties
|
|
107
|
+
*/
|
|
85
108
|
filterTypeProperties(type, newData) {
|
|
86
109
|
let filteredProps = type['typeProperties'];
|
|
87
110
|
const typePath = type['typePath'];
|
|
@@ -103,6 +103,7 @@ describe('filterProperties-item', () => {
|
|
|
103
103
|
expect(filteredProps.length).toEqual(len);
|
|
104
104
|
});
|
|
105
105
|
});
|
|
106
|
+
//project-item
|
|
106
107
|
describe('filterProperties-project-item', () => {
|
|
107
108
|
const projectItemType = {
|
|
108
109
|
typePath: 'project-item'
|
|
@@ -152,6 +153,7 @@ describe('filterProperties-project-item', () => {
|
|
|
152
153
|
expect(filteredProps.length).toEqual(len);
|
|
153
154
|
});
|
|
154
155
|
});
|
|
156
|
+
//color
|
|
155
157
|
describe('filterProperties-color', () => {
|
|
156
158
|
const colorType = {
|
|
157
159
|
typePath: 'color'
|
package/package.json
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrail/flexplm",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0-alpha.6f15d4e",
|
|
4
4
|
"description": "Library used for integration with flexplm.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"flexplm-mapping": "lib/cli/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"lib/**/*",
|
|
12
|
+
"scripts/copy-template.js"
|
|
13
|
+
],
|
|
7
14
|
"scripts": {
|
|
8
|
-
"build": "tsc",
|
|
15
|
+
"build": "tsc && node scripts/copy-template.js",
|
|
9
16
|
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
|
|
10
17
|
"lint": "tslint -p tsconfig.json",
|
|
11
18
|
"test": "jest",
|
|
@@ -25,6 +32,14 @@
|
|
|
25
32
|
"tslint-config-prettier": "^1.18.0",
|
|
26
33
|
"typescript": "^4.0.0"
|
|
27
34
|
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"typescript": ">=4.0.0"
|
|
37
|
+
},
|
|
38
|
+
"peerDependenciesMeta": {
|
|
39
|
+
"typescript": {
|
|
40
|
+
"optional": true
|
|
41
|
+
}
|
|
42
|
+
},
|
|
28
43
|
"jest": {
|
|
29
44
|
"moduleFileExtensions": [
|
|
30
45
|
"js",
|
|
@@ -40,10 +55,10 @@
|
|
|
40
55
|
"testEnvironment": "node"
|
|
41
56
|
},
|
|
42
57
|
"dependencies": {
|
|
43
|
-
"@contrail/app-framework": "^1.3
|
|
44
|
-
"@contrail/sdk": "^1.
|
|
45
|
-
"@contrail/transform-data": "^1.
|
|
46
|
-
"@contrail/util": "^1.
|
|
58
|
+
"@contrail/app-framework": "^1.4.3",
|
|
59
|
+
"@contrail/sdk": "^1.5.10",
|
|
60
|
+
"@contrail/transform-data": "^1.3.2",
|
|
61
|
+
"@contrail/util": "^1.3.1",
|
|
47
62
|
"axios": "^1.4.0",
|
|
48
63
|
"p-limit": "^3.1.0"
|
|
49
64
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
const SRC = path.join('src', 'cli', 'template', 'mapping-template.ts.template');
|
|
6
|
+
const DST = path.join('lib', 'cli', 'template', 'mapping-template.ts.template');
|
|
7
|
+
|
|
8
|
+
fs.mkdirSync(path.dirname(DST), { recursive: true });
|
|
9
|
+
fs.copyFileSync(SRC, DST);
|
|
10
|
+
console.log(`Copied ${SRC} -> ${DST}`);
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
## What
|
|
2
|
-
- [ ] Bugfix
|
|
3
|
-
- [ ] Feature
|
|
4
|
-
- [ ] Enhancement
|
|
5
|
-
|
|
6
|
-
Description:
|
|
7
|
-
<!--
|
|
8
|
-
Describe the functional changes of the PR.
|
|
9
|
-
|
|
10
|
-
If the mechanism of your change are complex, describe them in detail as you
|
|
11
|
-
would if you were explaining them to a team mate.
|
|
12
|
-
|
|
13
|
-
If the PR is simple, there is no need to repeat yourself. A small description
|
|
14
|
-
is sufficient.
|
|
15
|
-
-->
|
|
16
|
-
|
|
17
|
-
## Why
|
|
18
|
-
<!--
|
|
19
|
-
why is this change needed? Same rules as with #What
|
|
20
|
-
-->
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
## Testing added
|
|
24
|
-
<!--
|
|
25
|
-
Describe the testing you added to this PR
|
|
26
|
-
-->
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
## Link to Jira ticket(s)
|
|
30
|
-
https://vibe-team.atlassian.net/browse/VIBE-TICKET_NUMBER_HERE
|
|
31
|
-
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
name: flexplm-lib-tests
|
|
2
|
-
on:
|
|
3
|
-
pull_request:
|
|
4
|
-
workflow_dispatch: # allow running in github actions manually
|
|
5
|
-
jobs:
|
|
6
|
-
test:
|
|
7
|
-
runs-on: ubuntu-24.04
|
|
8
|
-
strategy:
|
|
9
|
-
matrix:
|
|
10
|
-
node-version: [22.14.0, 24]
|
|
11
|
-
steps:
|
|
12
|
-
- name: Node.js
|
|
13
|
-
uses: actions/setup-node@v3
|
|
14
|
-
with:
|
|
15
|
-
node-version: ${{ matrix.node-version }}
|
|
16
|
-
|
|
17
|
-
- uses: actions/checkout@v3
|
|
18
|
-
|
|
19
|
-
- name: NPM Install
|
|
20
|
-
env:
|
|
21
|
-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
22
|
-
run: npm ci
|
|
23
|
-
|
|
24
|
-
- name: Unit Tests -
|
|
25
|
-
env:
|
|
26
|
-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
27
|
-
run: npm test
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
name: Publish to NPM
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [master]
|
|
6
|
-
paths-ignore:
|
|
7
|
-
- '.github/**'
|
|
8
|
-
pull_request:
|
|
9
|
-
branches: [master]
|
|
10
|
-
paths-ignore:
|
|
11
|
-
- '.github/**'
|
|
12
|
-
|
|
13
|
-
jobs:
|
|
14
|
-
check-version:
|
|
15
|
-
name: Verify version is available on npm
|
|
16
|
-
if: github.event_name == 'pull_request'
|
|
17
|
-
runs-on: ubuntu-latest
|
|
18
|
-
steps:
|
|
19
|
-
- uses: actions/checkout@v4
|
|
20
|
-
|
|
21
|
-
- name: Check version not already published
|
|
22
|
-
run: |
|
|
23
|
-
PACKAGE_NAME=$(node -p "require('./package.json').name")
|
|
24
|
-
VERSION=$(node -p "require('./package.json').version")
|
|
25
|
-
echo "Checking if ${PACKAGE_NAME}@${VERSION} exists on npm..."
|
|
26
|
-
if npm view "${PACKAGE_NAME}@${VERSION}" version 2>/dev/null; then
|
|
27
|
-
echo "::error::Version ${VERSION} is already published on npm. Bump the version in package.json before merging."
|
|
28
|
-
exit 1
|
|
29
|
-
else
|
|
30
|
-
echo "Version ${VERSION} is available."
|
|
31
|
-
fi
|
|
32
|
-
|
|
33
|
-
check-dependencies:
|
|
34
|
-
name: Verify no private dependencies
|
|
35
|
-
runs-on: ubuntu-latest
|
|
36
|
-
steps:
|
|
37
|
-
- uses: actions/checkout@v4
|
|
38
|
-
|
|
39
|
-
- name: Verify no private dependencies
|
|
40
|
-
run: |
|
|
41
|
-
node -e "
|
|
42
|
-
const deps = require('./package.json').dependencies || {};
|
|
43
|
-
const { execSync } = require('child_process');
|
|
44
|
-
let failed = false;
|
|
45
|
-
for (const pkg of Object.keys(deps)) {
|
|
46
|
-
try {
|
|
47
|
-
execSync('npm view ' + pkg, { stdio: 'pipe' });
|
|
48
|
-
} catch {
|
|
49
|
-
console.error('::error::Dependency ' + pkg + ' is not publicly accessible on npm');
|
|
50
|
-
failed = true;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
if (failed) process.exit(1);
|
|
54
|
-
console.log('All ' + Object.keys(deps).length + ' dependencies are public.');
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
publish-alpha:
|
|
58
|
-
name: Publish alpha
|
|
59
|
-
needs: check-dependencies
|
|
60
|
-
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
|
|
61
|
-
runs-on: ubuntu-latest
|
|
62
|
-
permissions:
|
|
63
|
-
id-token: write
|
|
64
|
-
contents: read
|
|
65
|
-
outputs:
|
|
66
|
-
version: ${{ steps.publish.outputs.version }}
|
|
67
|
-
steps:
|
|
68
|
-
- uses: actions/checkout@v4
|
|
69
|
-
|
|
70
|
-
- uses: actions/setup-node@v4
|
|
71
|
-
with:
|
|
72
|
-
node-version: '24'
|
|
73
|
-
registry-url: 'https://registry.npmjs.org'
|
|
74
|
-
|
|
75
|
-
- name: Install and build
|
|
76
|
-
run: npm ci && npm run build
|
|
77
|
-
|
|
78
|
-
- name: Publish alpha
|
|
79
|
-
id: publish
|
|
80
|
-
run: |
|
|
81
|
-
SHORT_SHA=$(echo ${{ github.event.pull_request.head.sha }} | cut -c1-7)
|
|
82
|
-
VERSION=$(node -p "require('./package.json').version")-alpha.${SHORT_SHA}
|
|
83
|
-
npm version $VERSION --no-git-tag-version
|
|
84
|
-
OUTPUT=$(npm publish --tag alpha 2>&1) && {
|
|
85
|
-
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
86
|
-
} || {
|
|
87
|
-
if echo "$OUTPUT" | grep -q "You cannot publish over the previously published versions"; then
|
|
88
|
-
echo "::warning::Alpha ${VERSION} already published, skipping."
|
|
89
|
-
else
|
|
90
|
-
echo "::error::Failed to publish alpha ${VERSION}"
|
|
91
|
-
echo "$OUTPUT"
|
|
92
|
-
exit 1
|
|
93
|
-
fi
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
publish-release:
|
|
97
|
-
name: Publish release
|
|
98
|
-
needs: check-dependencies
|
|
99
|
-
if: github.event_name == 'push'
|
|
100
|
-
runs-on: ubuntu-latest
|
|
101
|
-
permissions:
|
|
102
|
-
id-token: write
|
|
103
|
-
contents: read
|
|
104
|
-
outputs:
|
|
105
|
-
version: ${{ steps.publish.outputs.version }}
|
|
106
|
-
steps:
|
|
107
|
-
- uses: actions/checkout@v4
|
|
108
|
-
|
|
109
|
-
- uses: actions/setup-node@v4
|
|
110
|
-
with:
|
|
111
|
-
node-version: '24'
|
|
112
|
-
registry-url: 'https://registry.npmjs.org'
|
|
113
|
-
|
|
114
|
-
- name: Install and build
|
|
115
|
-
run: npm ci && npm run build
|
|
116
|
-
|
|
117
|
-
- name: Publish release
|
|
118
|
-
id: publish
|
|
119
|
-
run: |
|
|
120
|
-
npm publish
|
|
121
|
-
echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
|
package/CHANGELOG.md
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
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.5.1] - 2026-05-14
|
|
11
|
-
### Added
|
|
12
|
-
- Added sending an external event with the publish payload and trigger key of `VibeIQ|AssortmentPublishedToFlexPLM` to enable secondary events to run on the event / data which was generated. Also includes the payload in the data which can be passed to the next action.
|
|
13
|
-
|
|
14
|
-
## [1.5.0] - 2026-05-12
|
|
15
|
-
### Added
|
|
16
|
-
- Added support for Inbound `LCSMaterial` to sync to the entity class `item` with type path `item:material` and `itemNumber` as identifier. This is controlled by an `LCSMaterial.processAsItem` (default `false`) config default.
|
|
17
|
-
- Added optional identity-service lookup in `DataConverter.setObjectReferenceValue` for resolving inbound `object_reference` values. Enabled per referenced entity type via `config.search.<entityType>.useIdentityServiceForInboundData`. When enabled the reference is resolved via the identity service using a uniqueness pool key; otherwise behavior falls through to the existing `getAllObjectReferences` query path.
|
|
18
|
-
|
|
19
|
-
## [1.4.0] - 2026-05-06
|
|
20
|
-
### Added
|
|
21
|
-
- Added `getEntityUsingIdentityService` method to `BaseEntityProcessor` for looking up entities via the identity service using a pool key and property criteria. Returns the resolved entity from the identity's `entityReference`, `undefined` if not found, or throws if multiple matches exist.
|
|
22
|
-
|
|
23
|
-
## [1.3.2] - 2026-05-01
|
|
24
|
-
### Added
|
|
25
|
-
- Added syncing Size Range properties; they sync as the raw VibeIQ data. For Example: { "sizes": { "30": ["30","32"], "32": ["30","32"]}, "dimension1": {"slug": "width","label": "Width"}, "dimension2": {"slug": "length", "label": "Length"}}
|
|
26
|
-
|
|
27
|
-
## [1.3.0] - 2026-04-15
|
|
28
|
-
### Added
|
|
29
|
-
- Added inbound thumbnail/primary content syncing from FlexPLM to VibeIQ via `ThumbnailUtil.syncThumbnailToVibeIQ`.
|
|
30
|
-
- Added `syncInboundImages` and `syncOutboundImages` methods to `TypeConversionUtils` for controlling image sync per map file configuration.
|
|
31
|
-
- Added `PRIMARY_CONTENT_UPDATED` status to `EventShortMessageStatus` for when only primary content changes are detected.
|
|
32
|
-
|
|
33
|
-
### Changed
|
|
34
|
-
- `BaseEntityProcessor` update flow now distinguishes between primary-content-only changes and no changes, returning the updated entity when only the thumbnail was synced.
|
|
35
|
-
- Improved `FlexPLMConnect.getRequest` function and added unit tests.
|
|
36
|
-
|
|
37
|
-
## [1.2.1] - 2026-04-08
|
|
38
|
-
|
|
39
|
-
### Added
|
|
40
|
-
- Added EventShortMessageStatus status values for adding items to projects functionality.
|
|
41
|
-
- Added `TypeConversionUtils.isOutboundCreatableFromEntity` method to determine if VibeIQ entities are creatable in FlexPLM (defaults to true).
|
|
42
|
-
|
|
43
|
-
### Changed
|
|
44
|
-
- Added optional `context` parameter to `TypeConversionUtils.isInboundCreatableFromObject` method to allow passing context data to map file `isInboundCreatable` functions.
|
|
45
|
-
|
|
46
|
-
## [1.1.66] - (initial changelog entry)
|
|
47
|
-
|
|
48
|
-
- Initial changelog. Prior releases did not include a changelog.
|
|
49
|
-
See git history for changes predating this entry.
|
package/publish.bat
DELETED