@contrail/flexplm 1.1.39 → 1.1.40
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/publish/base-process-publish-assortment.d.ts +1 -1
- package/lib/publish/base-process-publish-assortment.js +5 -5
- package/lib/publish/base-process-publish-assortment.spec.js +8 -7
- package/package.json +1 -1
- package/src/publish/base-process-publish-assortment.spec.ts +8 -7
- package/src/publish/base-process-publish-assortment.ts +5 -5
|
@@ -24,7 +24,7 @@ export declare class BaseProcessPublishAssortment {
|
|
|
24
24
|
results: any;
|
|
25
25
|
skip_await?: undefined;
|
|
26
26
|
}>;
|
|
27
|
-
getPublishInfo(assortmentPublishChangeId:
|
|
27
|
+
getPublishInfo(assortmentId: string, assortmentPublishChangeId: string, apcHistory: any, publisher: any): Promise<any>;
|
|
28
28
|
getSeasonFederation(assortmentId: any): Promise<SeasonFederation>;
|
|
29
29
|
getAssortment(assortmentId: any): Promise<any>;
|
|
30
30
|
getSinceDate(assortmentId: any, assortmentPublishChangeId: any, apcHistory: object[]): Promise<Date>;
|
|
@@ -25,9 +25,9 @@ class BaseProcessPublishAssortment {
|
|
|
25
25
|
const assortmentPublishChangeId = event.assortmentPublishChangeId;
|
|
26
26
|
let apcHistory;
|
|
27
27
|
let publisher;
|
|
28
|
+
const assortmentId = event.assortmentId;
|
|
28
29
|
try {
|
|
29
30
|
console.info('process-start!');
|
|
30
|
-
const assortmentId = event.assortmentId;
|
|
31
31
|
let seasonFed;
|
|
32
32
|
try {
|
|
33
33
|
seasonFed = await this.getSeasonFederation(assortmentId);
|
|
@@ -54,13 +54,13 @@ class BaseProcessPublishAssortment {
|
|
|
54
54
|
pcd.itemToFederatedIdMapping = itemToFederatedIdMapping;
|
|
55
55
|
pcd.releasedForDevelopmentItemIds = releasedForDevelopmentItemIds;
|
|
56
56
|
const output = await this.processPublish(pcd, changeDetail, assortmentBaseline, deleteChanges);
|
|
57
|
-
output['publishInfo'] = await this.getPublishInfo(assortmentPublishChangeId, apcHistory, publisher);
|
|
57
|
+
output['publishInfo'] = await this.getPublishInfo(assortmentId, assortmentPublishChangeId, apcHistory, publisher);
|
|
58
58
|
console.info('process-end');
|
|
59
59
|
return output;
|
|
60
60
|
}
|
|
61
61
|
catch (e) {
|
|
62
62
|
try {
|
|
63
|
-
const publishInfo = await this.getPublishInfo(assortmentPublishChangeId, apcHistory, publisher);
|
|
63
|
+
const publishInfo = await this.getPublishInfo(assortmentId, assortmentPublishChangeId, apcHistory, publisher);
|
|
64
64
|
e.publishInfo = publishInfo;
|
|
65
65
|
}
|
|
66
66
|
catch (e2) {
|
|
@@ -70,9 +70,9 @@ class BaseProcessPublishAssortment {
|
|
|
70
70
|
throw e;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
async getPublishInfo(assortmentPublishChangeId, apcHistory, publisher) {
|
|
73
|
+
async getPublishInfo(assortmentId, assortmentPublishChangeId, apcHistory, publisher) {
|
|
74
74
|
const apc = apcHistory?.find(apc => apc?.id === assortmentPublishChangeId) || {};
|
|
75
|
-
const assortmentName = (await this.getAssortment(
|
|
75
|
+
const assortmentName = (await this.getAssortment(assortmentId))?.name;
|
|
76
76
|
const publishInfo = {
|
|
77
77
|
assortmentName,
|
|
78
78
|
versionName: apc?.versionName,
|
|
@@ -61,6 +61,7 @@ describe('getPublishInfo', () => {
|
|
|
61
61
|
const config = {};
|
|
62
62
|
const mapFileUtil = new transform_data_1.MapFileUtil(new sdk_1.Entities());
|
|
63
63
|
const dc = new data_converter_1.DataConverter(config, mapFileUtil);
|
|
64
|
+
const assortmentId = 'oqIFX3ELRy8sFRd0';
|
|
64
65
|
const versionName = 'Version 1';
|
|
65
66
|
const versionComments = 'Some Comments';
|
|
66
67
|
const createdOn = '2023-01-15T19:13:58.902Z';
|
|
@@ -83,7 +84,7 @@ describe('getPublishInfo', () => {
|
|
|
83
84
|
.mockImplementation(async (assortmentId) => {
|
|
84
85
|
return { id: assortmentId, name: assortmentName };
|
|
85
86
|
});
|
|
86
|
-
const publishInfo = await ppa.getPublishInfo(assortmentPublishChangeId, plan_history, publisher);
|
|
87
|
+
const publishInfo = await ppa.getPublishInfo(assortmentId, assortmentPublishChangeId, plan_history, publisher);
|
|
87
88
|
expect(publishInfo.assortmentName).toEqual(assortmentName);
|
|
88
89
|
expect(publishInfo.versionName).toEqual(versionName);
|
|
89
90
|
expect(publishInfo.versionComments).toEqual(versionComments);
|
|
@@ -101,7 +102,7 @@ describe('getPublishInfo', () => {
|
|
|
101
102
|
.mockImplementation(async (assortmentId) => {
|
|
102
103
|
return { id: assortmentId, name: undefined };
|
|
103
104
|
});
|
|
104
|
-
const publishInfo = await ppa.getPublishInfo(assortmentPublishChangeId, plan_history, publisher);
|
|
105
|
+
const publishInfo = await ppa.getPublishInfo(assortmentId, assortmentPublishChangeId, plan_history, publisher);
|
|
105
106
|
expect(publishInfo.assortmentName).toBeUndefined;
|
|
106
107
|
expect(publishInfo.versionName).toEqual(versionName);
|
|
107
108
|
expect(publishInfo.versionComments).toEqual(versionComments);
|
|
@@ -119,7 +120,7 @@ describe('getPublishInfo', () => {
|
|
|
119
120
|
.mockImplementation(async (assortmentId) => {
|
|
120
121
|
return undefined;
|
|
121
122
|
});
|
|
122
|
-
const publishInfo = await ppa.getPublishInfo(assortmentPublishChangeId, plan_history, publisher);
|
|
123
|
+
const publishInfo = await ppa.getPublishInfo(assortmentId, assortmentPublishChangeId, plan_history, publisher);
|
|
123
124
|
expect(publishInfo.assortmentName).toBeUndefined();
|
|
124
125
|
expect(publishInfo.versionName).toEqual(versionName);
|
|
125
126
|
expect(publishInfo.versionComments).toEqual(versionComments);
|
|
@@ -146,7 +147,7 @@ describe('getPublishInfo', () => {
|
|
|
146
147
|
.mockImplementation(async (assortmentId) => {
|
|
147
148
|
return { id: assortmentId, name: assortmentName };
|
|
148
149
|
});
|
|
149
|
-
const publishInfo = await ppa.getPublishInfo(assortmentPublishChangeId, history, publisher);
|
|
150
|
+
const publishInfo = await ppa.getPublishInfo(assortmentId, assortmentPublishChangeId, history, publisher);
|
|
150
151
|
expect(publishInfo.assortmentName).toEqual(assortmentName);
|
|
151
152
|
expect(publishInfo.versionName).toEqual('');
|
|
152
153
|
expect(publishInfo.versionComments).toEqual('');
|
|
@@ -163,7 +164,7 @@ describe('getPublishInfo', () => {
|
|
|
163
164
|
.mockImplementation(async (assortmentId) => {
|
|
164
165
|
return { id: assortmentId, name: assortmentName };
|
|
165
166
|
});
|
|
166
|
-
const publishInfo = await ppa.getPublishInfo(assortmentPublishChangeId, plan_history, publisher);
|
|
167
|
+
const publishInfo = await ppa.getPublishInfo(assortmentId, assortmentPublishChangeId, plan_history, publisher);
|
|
167
168
|
expect(publishInfo.assortmentName).toEqual(assortmentName);
|
|
168
169
|
expect(publishInfo.versionName).toEqual(versionName);
|
|
169
170
|
expect(publishInfo.versionComments).toEqual(versionComments);
|
|
@@ -182,7 +183,7 @@ describe('getPublishInfo', () => {
|
|
|
182
183
|
.mockImplementation(async (assortmentId) => {
|
|
183
184
|
return { id: assortmentId, name: assortmentName };
|
|
184
185
|
});
|
|
185
|
-
const publishInfo = await ppa.getPublishInfo(assortmentPublishChangeId, plan_history, publisher);
|
|
186
|
+
const publishInfo = await ppa.getPublishInfo(assortmentId, assortmentPublishChangeId, plan_history, publisher);
|
|
186
187
|
expect(publishInfo.assortmentName).toEqual(assortmentName);
|
|
187
188
|
expect(publishInfo.versionName).toBeUndefined();
|
|
188
189
|
expect(publishInfo.versionComments).toBeUndefined();
|
|
@@ -201,7 +202,7 @@ describe('getPublishInfo', () => {
|
|
|
201
202
|
.mockImplementation(async (assortmentId) => {
|
|
202
203
|
return { id: assortmentId, name: assortmentName };
|
|
203
204
|
});
|
|
204
|
-
const publishInfo = await ppa.getPublishInfo(assortmentPublishChangeId, undefined, publisher);
|
|
205
|
+
const publishInfo = await ppa.getPublishInfo(assortmentId, assortmentPublishChangeId, undefined, publisher);
|
|
205
206
|
expect(publishInfo.assortmentName).toEqual(assortmentName);
|
|
206
207
|
expect(publishInfo.versionName).toBeUndefined();
|
|
207
208
|
expect(publishInfo.versionComments).toBeUndefined();
|
package/package.json
CHANGED
|
@@ -65,6 +65,7 @@ describe('getPublishInfo', () =>{
|
|
|
65
65
|
const mapFileUtil = new MapFileUtil(new Entities());
|
|
66
66
|
const dc = new DataConverter(config, mapFileUtil);
|
|
67
67
|
|
|
68
|
+
const assortmentId = 'oqIFX3ELRy8sFRd0';
|
|
68
69
|
const versionName = 'Version 1';
|
|
69
70
|
const versionComments = 'Some Comments';
|
|
70
71
|
const createdOn = '2023-01-15T19:13:58.902Z';
|
|
@@ -89,7 +90,7 @@ describe('getPublishInfo', () =>{
|
|
|
89
90
|
.mockImplementation(async (assortmentId) => {
|
|
90
91
|
return {id: assortmentId, name: assortmentName};
|
|
91
92
|
});
|
|
92
|
-
const publishInfo = await ppa.getPublishInfo(assortmentPublishChangeId, plan_history, publisher);
|
|
93
|
+
const publishInfo = await ppa.getPublishInfo(assortmentId, assortmentPublishChangeId, plan_history, publisher);
|
|
93
94
|
expect(publishInfo.assortmentName).toEqual(assortmentName);
|
|
94
95
|
expect(publishInfo.versionName).toEqual(versionName);
|
|
95
96
|
expect(publishInfo.versionComments).toEqual(versionComments);
|
|
@@ -109,7 +110,7 @@ describe('getPublishInfo', () =>{
|
|
|
109
110
|
.mockImplementation(async (assortmentId) => {
|
|
110
111
|
return {id: assortmentId, name: undefined};
|
|
111
112
|
});
|
|
112
|
-
const publishInfo = await ppa.getPublishInfo(assortmentPublishChangeId, plan_history, publisher);
|
|
113
|
+
const publishInfo = await ppa.getPublishInfo(assortmentId, assortmentPublishChangeId, plan_history, publisher);
|
|
113
114
|
expect(publishInfo.assortmentName).toBeUndefined;
|
|
114
115
|
expect(publishInfo.versionName).toEqual(versionName);
|
|
115
116
|
expect(publishInfo.versionComments).toEqual(versionComments);
|
|
@@ -129,7 +130,7 @@ describe('getPublishInfo', () =>{
|
|
|
129
130
|
.mockImplementation(async (assortmentId) => {
|
|
130
131
|
return undefined;
|
|
131
132
|
});
|
|
132
|
-
const publishInfo = await ppa.getPublishInfo(assortmentPublishChangeId, plan_history, publisher);
|
|
133
|
+
const publishInfo = await ppa.getPublishInfo(assortmentId, assortmentPublishChangeId, plan_history, publisher);
|
|
133
134
|
expect(publishInfo.assortmentName).toBeUndefined();
|
|
134
135
|
expect(publishInfo.versionName).toEqual(versionName);
|
|
135
136
|
expect(publishInfo.versionComments).toEqual(versionComments);
|
|
@@ -157,7 +158,7 @@ describe('getPublishInfo', () =>{
|
|
|
157
158
|
.mockImplementation(async (assortmentId) => {
|
|
158
159
|
return {id: assortmentId, name: assortmentName};
|
|
159
160
|
});
|
|
160
|
-
const publishInfo = await ppa.getPublishInfo(assortmentPublishChangeId, history, publisher);
|
|
161
|
+
const publishInfo = await ppa.getPublishInfo(assortmentId, assortmentPublishChangeId, history, publisher);
|
|
161
162
|
expect(publishInfo.assortmentName).toEqual(assortmentName);
|
|
162
163
|
expect(publishInfo.versionName).toEqual('');
|
|
163
164
|
expect(publishInfo.versionComments).toEqual('');
|
|
@@ -176,7 +177,7 @@ describe('getPublishInfo', () =>{
|
|
|
176
177
|
.mockImplementation(async (assortmentId) => {
|
|
177
178
|
return {id: assortmentId, name: assortmentName};
|
|
178
179
|
});
|
|
179
|
-
const publishInfo = await ppa.getPublishInfo(assortmentPublishChangeId, plan_history, publisher);
|
|
180
|
+
const publishInfo = await ppa.getPublishInfo(assortmentId, assortmentPublishChangeId, plan_history, publisher);
|
|
180
181
|
expect(publishInfo.assortmentName).toEqual(assortmentName);
|
|
181
182
|
expect(publishInfo.versionName).toEqual(versionName);
|
|
182
183
|
expect(publishInfo.versionComments).toEqual(versionComments);
|
|
@@ -197,7 +198,7 @@ describe('getPublishInfo', () =>{
|
|
|
197
198
|
.mockImplementation(async (assortmentId) => {
|
|
198
199
|
return {id: assortmentId, name: assortmentName};
|
|
199
200
|
});
|
|
200
|
-
const publishInfo = await ppa.getPublishInfo(assortmentPublishChangeId, plan_history, publisher);
|
|
201
|
+
const publishInfo = await ppa.getPublishInfo(assortmentId, assortmentPublishChangeId, plan_history, publisher);
|
|
201
202
|
expect(publishInfo.assortmentName).toEqual(assortmentName);
|
|
202
203
|
expect(publishInfo.versionName).toBeUndefined();
|
|
203
204
|
expect(publishInfo.versionComments).toBeUndefined();
|
|
@@ -218,7 +219,7 @@ describe('getPublishInfo', () =>{
|
|
|
218
219
|
.mockImplementation(async (assortmentId) => {
|
|
219
220
|
return {id: assortmentId, name: assortmentName};
|
|
220
221
|
});
|
|
221
|
-
const publishInfo = await ppa.getPublishInfo(assortmentPublishChangeId, undefined, publisher);
|
|
222
|
+
const publishInfo = await ppa.getPublishInfo(assortmentId, assortmentPublishChangeId, undefined, publisher);
|
|
222
223
|
expect(publishInfo.assortmentName).toEqual(assortmentName);
|
|
223
224
|
expect(publishInfo.versionName).toBeUndefined();
|
|
224
225
|
expect(publishInfo.versionComments).toBeUndefined();
|
|
@@ -39,9 +39,9 @@ export class BaseProcessPublishAssortment {
|
|
|
39
39
|
const assortmentPublishChangeId = event.assortmentPublishChangeId;
|
|
40
40
|
let apcHistory;
|
|
41
41
|
let publisher;
|
|
42
|
+
const assortmentId = event.assortmentId;
|
|
42
43
|
try {
|
|
43
44
|
console.info('process-start!');
|
|
44
|
-
const assortmentId = event.assortmentId;
|
|
45
45
|
let seasonFed: SeasonFederation;
|
|
46
46
|
try {
|
|
47
47
|
seasonFed = await this.getSeasonFederation(assortmentId);
|
|
@@ -78,13 +78,13 @@ export class BaseProcessPublishAssortment {
|
|
|
78
78
|
pcd.releasedForDevelopmentItemIds = releasedForDevelopmentItemIds;
|
|
79
79
|
|
|
80
80
|
const output = await this.processPublish(pcd, changeDetail, assortmentBaseline, deleteChanges);
|
|
81
|
-
output ['publishInfo'] = await this.getPublishInfo(assortmentPublishChangeId, apcHistory, publisher);
|
|
81
|
+
output ['publishInfo'] = await this.getPublishInfo(assortmentId, assortmentPublishChangeId, apcHistory, publisher);
|
|
82
82
|
console.info('process-end');
|
|
83
83
|
|
|
84
84
|
return output;
|
|
85
85
|
} catch (e) {
|
|
86
86
|
try {
|
|
87
|
-
const publishInfo = await this.getPublishInfo(assortmentPublishChangeId, apcHistory, publisher);
|
|
87
|
+
const publishInfo = await this.getPublishInfo(assortmentId, assortmentPublishChangeId, apcHistory, publisher);
|
|
88
88
|
e.publishInfo = publishInfo;
|
|
89
89
|
}catch(e2){
|
|
90
90
|
console.log('catch e2: ' + e2.message);
|
|
@@ -93,9 +93,9 @@ export class BaseProcessPublishAssortment {
|
|
|
93
93
|
throw e;
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
async getPublishInfo(assortmentPublishChangeId:
|
|
96
|
+
async getPublishInfo(assortmentId: string, assortmentPublishChangeId: string, apcHistory: any, publisher: any): Promise<any> {
|
|
97
97
|
const apc = apcHistory?.find(apc => apc?.id === assortmentPublishChangeId) || {};
|
|
98
|
-
const assortmentName = (await this.getAssortment(
|
|
98
|
+
const assortmentName = (await this.getAssortment(assortmentId))?.name;
|
|
99
99
|
const publishInfo = {
|
|
100
100
|
assortmentName,
|
|
101
101
|
versionName: apc?.versionName,
|