@contrail/flexplm 1.1.60 → 1.1.62

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.
@@ -4,10 +4,10 @@ on:
4
4
  workflow_dispatch: # allow running in github actions manually
5
5
  jobs:
6
6
  test:
7
- runs-on: ubuntu-20.04
7
+ runs-on: ubuntu-24.04
8
8
  strategy:
9
9
  matrix:
10
- node-version: [16.17.0]
10
+ node-version: [22.14.0]
11
11
  steps:
12
12
  - name: Node.js
13
13
  uses: actions/setup-node@v3
@@ -462,7 +462,6 @@ class DataConverter {
462
462
  const currentObjPath = '' + currentObj['typePath'];
463
463
  if (!currentObjPath.startsWith(entityTypePath)) {
464
464
  found = false;
465
- break;
466
465
  }
467
466
  }
468
467
  for (const key in criteria) {
@@ -287,7 +287,7 @@ describe('getPersistableChanges', () => {
287
287
  };
288
288
  const diffs = dc.getPersistableChanges(entity, potentialChanges);
289
289
  expect(Object.getOwnPropertyNames(diffs).length).toEqual(1);
290
- expect(diffs['str']).toBeNull();
290
+ expect(diffs['str']).toBe('');
291
291
  });
292
292
  });
293
293
  describe('getObjectReferenceValue cache', () => {
@@ -651,6 +651,19 @@ describe('checkKeysAndValues', () => {
651
651
  const results = dc.checkKeysAndValues(criteria, testData, typePath);
652
652
  expect(results.length).toBe(1);
653
653
  });
654
+ it('first & last entity have the wrong typePath', () => {
655
+ const criteria = {
656
+ objectId: "2562",
657
+ };
658
+ const typePath = 'custom-entity:group2';
659
+ const testData = [
660
+ { "typePath": "custom-entity:group1", "name": "BLACK (BK)", "id": "o1v2rh8olgQ78GcL", "objectId": "2562", "entityType": "custom-entity" },
661
+ { "typePath": "custom-entity:group2", "name": "BLACK (BK)", "id": "t5n22S2gqswe8GcL", "objectId": "2562", "entityType": "custom-entity" },
662
+ { "typePath": "custom-entity:group1", "name": "BLACK (BK)", "id": "t5rh8o2gqswk3drt", "objectId": "2562", "entityType": "custom-entity" }
663
+ ];
664
+ const results = dc.checkKeysAndValues(criteria, testData, typePath);
665
+ expect(results.length).toBe(1);
666
+ });
654
667
  });
655
668
  describe('setUserListValue', () => {
656
669
  const config = {
@@ -87,22 +87,18 @@ class ThumbnailUtil {
87
87
  return sizes;
88
88
  }
89
89
  async getContentEntity(primaryViewableId, sizes) {
90
- const criteria = {
91
- id: primaryViewableId
92
- };
93
90
  const relations = sizes.map(s => s.slug);
94
91
  relations.push('primaryFile');
95
- const contentResults = await this.entities.get({
92
+ const content = await this.entities.get({
96
93
  entityName: 'content',
97
- criteria,
94
+ id: primaryViewableId,
98
95
  relations
99
96
  });
100
- const content = (contentResults && contentResults[0]) ? contentResults[0] : undefined;
101
97
  this.logContentResults(content, relations);
102
98
  return content;
103
99
  }
104
100
  logContentResults(content, relations) {
105
- if (app_framework_1.Logger.isDebugOn()) {
101
+ if (app_framework_1.Logger.isDebugOn() && content && relations) {
106
102
  const contentCopy = JSON.parse(JSON.stringify(content));
107
103
  relations.forEach(r => {
108
104
  delete contentCopy[r];
@@ -211,4 +211,32 @@ describe('ThumbnailUtil Tests', () => {
211
211
  expect(results).toBeTruthy();
212
212
  });
213
213
  });
214
+ describe('logContentResults', () => {
215
+ it('no content - doesnt error', () => {
216
+ const tu = new thumbnail_util_1.ThumbnailUtil(config);
217
+ const content = undefined;
218
+ const relations = [];
219
+ tu.logContentResults(content, relations);
220
+ });
221
+ it('no relations - doesnt error', () => {
222
+ const tu = new thumbnail_util_1.ThumbnailUtil(config);
223
+ const content = undefined;
224
+ const relations = undefined;
225
+ tu.logContentResults(content, relations);
226
+ });
227
+ it('content and relations - logs', () => {
228
+ const tu = new thumbnail_util_1.ThumbnailUtil(config);
229
+ const content = {
230
+ id: '123',
231
+ name: 'Test',
232
+ primaryFile: { id: 'file123' }
233
+ };
234
+ const relations = ['primaryFile'];
235
+ tu.logContentResults(content, relations);
236
+ expect(Object.keys(content)).toHaveLength(3);
237
+ expect(content).toHaveProperty('primaryFile');
238
+ expect(content.primaryFile).toHaveProperty('id');
239
+ expect(content.primaryFile.id).toEqual('file123');
240
+ });
241
+ });
214
242
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/flexplm",
3
- "version": "1.1.60",
3
+ "version": "1.1.62",
4
4
  "description": "Library used for integration with flexplm.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -1,122 +1,122 @@
1
- export interface FCConfig {
2
- apiKey?: string;
3
- orgSlug?: string;
4
- action?: string;
5
- configFile? :string;
6
- eventObjectClassParam?: string;
7
- eventFlexTypePathParam?: string;
8
- flexplmConnect?: any;
9
- taskId?: string;
10
- apiHost: string;
11
- userName(): string;
12
- password(): string;
13
- plmEnviornment?: string;
14
- urlContext: string;
15
- vibeEventEndpoint: string;
16
- csrfEndpoint: string;
17
- itemPreDevelopmentLifecycleStages: string[];
18
- identifierAtts?: {
19
- [key:string]: string[]
20
- };
21
- propertyMapping?: object;
22
- [key: string]: any;
23
- }
24
-
25
- export interface ProductFederation {
26
- entityReference: string;
27
- objectClass: 'LCSProduct';
28
- federatedId?: string;
29
- flexPLMTypePath?: string;
30
- vibeIQIdentifier?: string
31
- }
32
- export interface ProductData extends ProductFederation {
33
- data: object;
34
- productSeason: {
35
- data: object;
36
- }
37
- }
38
-
39
- export interface SeasonFederation {
40
- entityReference: string;
41
- objectClass: 'LCSSeason';
42
- flexPLMSeasonName?: string;
43
- federationId?: string;
44
- flexPLMTypePath?: string;
45
- }
46
-
47
- export interface SeasonGroupFederation {
48
- entityReference: string;
49
- objectClass: 'SeasonGroup';
50
- seasonGroupName?: string;
51
- federationId?: string;
52
- flexPLMTypePath?: string;
53
- }
54
-
55
- export interface SkuFederation {
56
- entityReference: string;
57
- objectClass: 'LCSSKU';
58
- LCSProduct?: ProductFederation;
59
- federatedId?: string;
60
- flexPLMTypePath?: string;
61
- vibeIQIdentifier?: string;
62
- }
63
- export interface SkuData extends SkuFederation{
64
- data: object;
65
- }
66
-
67
- export interface PayloadType {
68
- eventType: string;
69
- objectClass: string;
70
- }
71
- export interface AsyncPayloadType extends PayloadType {
72
- taskId: string;
73
- }
74
- export interface AsyncEventsPayloadType extends AsyncPayloadType {
75
- events?: PayloadType[];
76
- eventsFileId?: string;
77
- eventsDownloadLink?: string;
78
- eventsAdminDownloadLink?: string;
79
- }
80
-
81
- export interface EntityPayloadType extends PayloadType {
82
- entityReference: string;
83
- federatedId?: string;
84
- flexPLMTypePath?: string;
85
- data: object;
86
- }
87
-
88
- export interface ItemPayloadType extends EntityPayloadType {
89
- LCSProduct?: ProductFederation;
90
- }
91
-
92
- /////////////////////////////////////////////////////////////////////////////
93
- ///////// Custom seasonalPayload: start
94
- /////////////////////////////////////////////////////////////////////////////
95
- export interface SeasonalPayload extends EntityPayloadType {
96
- eventType: 'UPSERT_ON_SEASON' | 'REMOVE_FROM_SEASON';
97
- objectClass: 'LCSProductSeasonLink' | 'LCSSKUSeasonLink';
98
- LCSSeason : SeasonFederation;
99
- LCSProduct? : ProductFederation;
100
- LCSSKU? : SkuFederation;
101
- carriedFromSeason? : object;
102
- }
103
- /////////////////////////////////////////////////////////////////////////////
104
- ///////// Custom seasonalPayload: start
105
- /////////////////////////////////////////////////////////////////////////////
106
-
107
- export interface ExportPayloadType extends AsyncPayloadType {
108
- flexPLMTypePath: string;
109
- }
110
-
111
- export interface FederationRecord {
112
- reference: string;
113
- mappedReference: string
114
- appIdentifier: string;
115
- federationSchema: string
116
- }
117
-
118
- export interface FlexPLMResponseData {
119
- status: number;
120
- data?: object;
121
- error?: string;
1
+ export interface FCConfig {
2
+ apiKey?: string;
3
+ orgSlug?: string;
4
+ action?: string;
5
+ configFile? :string;
6
+ eventObjectClassParam?: string;
7
+ eventFlexTypePathParam?: string;
8
+ flexplmConnect?: any;
9
+ taskId?: string;
10
+ apiHost: string;
11
+ userName(): string;
12
+ password(): string;
13
+ plmEnviornment?: string;
14
+ urlContext: string;
15
+ vibeEventEndpoint: string;
16
+ csrfEndpoint: string;
17
+ itemPreDevelopmentLifecycleStages: string[];
18
+ identifierAtts?: {
19
+ [key:string]: string[]
20
+ };
21
+ propertyMapping?: object;
22
+ [key: string]: any;
23
+ }
24
+
25
+ export interface ProductFederation {
26
+ entityReference: string;
27
+ objectClass: 'LCSProduct';
28
+ federatedId?: string;
29
+ flexPLMTypePath?: string;
30
+ vibeIQIdentifier?: string
31
+ }
32
+ export interface ProductData extends ProductFederation {
33
+ data: object;
34
+ productSeason: {
35
+ data: object;
36
+ }
37
+ }
38
+
39
+ export interface SeasonFederation {
40
+ entityReference: string;
41
+ objectClass: 'LCSSeason';
42
+ flexPLMSeasonName?: string;
43
+ federationId?: string;
44
+ flexPLMTypePath?: string;
45
+ }
46
+
47
+ export interface SeasonGroupFederation {
48
+ entityReference: string;
49
+ objectClass: 'SeasonGroup';
50
+ seasonGroupName?: string;
51
+ federationId?: string;
52
+ flexPLMTypePath?: string;
53
+ }
54
+
55
+ export interface SkuFederation {
56
+ entityReference: string;
57
+ objectClass: 'LCSSKU';
58
+ LCSProduct?: ProductFederation;
59
+ federatedId?: string;
60
+ flexPLMTypePath?: string;
61
+ vibeIQIdentifier?: string;
62
+ }
63
+ export interface SkuData extends SkuFederation{
64
+ data: object;
65
+ }
66
+
67
+ export interface PayloadType {
68
+ eventType: string;
69
+ objectClass: string;
70
+ }
71
+ export interface AsyncPayloadType extends PayloadType {
72
+ taskId: string;
73
+ }
74
+ export interface AsyncEventsPayloadType extends AsyncPayloadType {
75
+ events?: PayloadType[];
76
+ eventsFileId?: string;
77
+ eventsDownloadLink?: string;
78
+ eventsAdminDownloadLink?: string;
79
+ }
80
+
81
+ export interface EntityPayloadType extends PayloadType {
82
+ entityReference: string;
83
+ federatedId?: string;
84
+ flexPLMTypePath?: string;
85
+ data: object;
86
+ }
87
+
88
+ export interface ItemPayloadType extends EntityPayloadType {
89
+ LCSProduct?: ProductFederation;
90
+ }
91
+
92
+ /////////////////////////////////////////////////////////////////////////////
93
+ ///////// Custom seasonalPayload: start
94
+ /////////////////////////////////////////////////////////////////////////////
95
+ export interface SeasonalPayload extends EntityPayloadType {
96
+ eventType: 'UPSERT_ON_SEASON' | 'REMOVE_FROM_SEASON';
97
+ objectClass: 'LCSProductSeasonLink' | 'LCSSKUSeasonLink';
98
+ LCSSeason : SeasonFederation;
99
+ LCSProduct? : ProductFederation;
100
+ LCSSKU? : SkuFederation;
101
+ carriedFromSeason? : object;
102
+ }
103
+ /////////////////////////////////////////////////////////////////////////////
104
+ ///////// Custom seasonalPayload: start
105
+ /////////////////////////////////////////////////////////////////////////////
106
+
107
+ export interface ExportPayloadType extends AsyncPayloadType {
108
+ flexPLMTypePath: string;
109
+ }
110
+
111
+ export interface FederationRecord {
112
+ reference: string;
113
+ mappedReference: string
114
+ appIdentifier: string;
115
+ federationSchema: string
116
+ }
117
+
118
+ export interface FlexPLMResponseData {
119
+ status: number;
120
+ data?: object;
121
+ error?: string;
122
122
  }