@configura/web-api 3.0.0-alpha.1 → 3.0.0-alpha.3
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/dist/CatalogueAPI.d.ts +68 -1
- package/dist/CatalogueAPI.js +184 -219
- package/dist/CfgMeasure.js +1 -2
- package/dist/CfgProduct.d.ts +22 -3
- package/dist/CfgProduct.js +172 -162
- package/dist/io/CfgIOManager.js +2 -11
- package/dist/io/CfgIOProdConfConnector.js +14 -25
- package/dist/io/CfgObservableStateManager.js +1 -1
- package/dist/productConfiguration/CfgFeature.d.ts +5 -0
- package/dist/productConfiguration/CfgFeature.js +68 -53
- package/dist/productConfiguration/CfgOption.d.ts +8 -0
- package/dist/productConfiguration/CfgOption.js +68 -73
- package/dist/productConfiguration/CfgProductConfiguration.js +22 -34
- package/dist/productConfiguration/productParamsGenerator.js +43 -57
- package/dist/productLoader.js +2 -13
- package/dist/syncGroups/SyncGroupsHandler.js +60 -83
- package/dist/syncGroups/SyncGroupsPathHelper.js +5 -5
- package/dist/syncGroups/SyncGroupsState.js +4 -5
- package/dist/syncGroups/SyncGroupsTransaction.d.ts +19 -1
- package/dist/syncGroups/SyncGroupsTransaction.js +352 -303
- package/dist/tasks/TaskHandler.js +53 -64
- package/dist/tests/testData/dummyProductForTest.js +4 -1
- package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.js +18 -21
- package/dist/tests/testData/testDataCachedGetProduct.js +20 -20
- package/dist/tests/testData/testDataCachedPostValidate.js +6 -15
- package/dist/tests/testData/testDataProductAggregatedPrice.js +21 -21
- package/dist/tests/testData/testDataUpcharge.js +31 -22
- package/dist/utilitiesCatalogueData.js +21 -9
- package/dist/utilitiesCataloguePermission.js +5 -2
- package/dist/utilitiesConfiguration.js +21 -23
- package/package.json +3 -3
package/dist/CatalogueAPI.d.ts
CHANGED
|
@@ -70,6 +70,19 @@ export interface DtoAuthorizeResponse {
|
|
|
70
70
|
secretToken: string;
|
|
71
71
|
apiSession: DtoCatalogueAPISession;
|
|
72
72
|
}
|
|
73
|
+
/** BooleanConstrainedOption */
|
|
74
|
+
export interface DtoBooleanConstrainedOption {
|
|
75
|
+
code: string;
|
|
76
|
+
/**
|
|
77
|
+
* The value of the boolean option:
|
|
78
|
+
*
|
|
79
|
+
* - If true, the option must be selected
|
|
80
|
+
* - If false, the option cannot be selected.
|
|
81
|
+
*
|
|
82
|
+
* Note: If not present, signifies that there is no valid value for the option.
|
|
83
|
+
*/
|
|
84
|
+
value?: boolean;
|
|
85
|
+
}
|
|
73
86
|
/** CacheFilterType */
|
|
74
87
|
export declare type DtoCacheFilterType = "Contains" | "StartsWith";
|
|
75
88
|
export declare const dtoCacheFilterTypeNames: DtoCacheFilterType[];
|
|
@@ -199,12 +212,33 @@ export interface DtoDynamoAccessToken extends DtoDynamoObject {
|
|
|
199
212
|
}
|
|
200
213
|
/** DynamoObject - Common properties that are shared between all objects we put into DynamoDB */
|
|
201
214
|
export interface DtoDynamoObject {
|
|
215
|
+
/**
|
|
216
|
+
* partitionKey
|
|
217
|
+
*/
|
|
202
218
|
pk: string;
|
|
219
|
+
/**
|
|
220
|
+
* sortKey
|
|
221
|
+
*/
|
|
203
222
|
sk: string;
|
|
223
|
+
/**
|
|
224
|
+
* itemType
|
|
225
|
+
*/
|
|
204
226
|
it: string;
|
|
227
|
+
/**
|
|
228
|
+
* created
|
|
229
|
+
*/
|
|
205
230
|
cr: string;
|
|
231
|
+
/**
|
|
232
|
+
* modified
|
|
233
|
+
*/
|
|
206
234
|
mo: string;
|
|
235
|
+
/**
|
|
236
|
+
* owner
|
|
237
|
+
*/
|
|
207
238
|
ow: string;
|
|
239
|
+
/**
|
|
240
|
+
* time to live
|
|
241
|
+
*/
|
|
208
242
|
ttl: number;
|
|
209
243
|
}
|
|
210
244
|
/** EmptyResponse */
|
|
@@ -217,13 +251,18 @@ export interface DtoErrorResponse {
|
|
|
217
251
|
eventId?: string;
|
|
218
252
|
}
|
|
219
253
|
/** ExportFormat - Format of the exported product, identical to the format's file extension. */
|
|
220
|
-
export declare type DtoExportFormat = "glb" | "gltf" | "fbx" | "dwg" | "cmdrw" | "cmfav" | "cmsym";
|
|
254
|
+
export declare type DtoExportFormat = "glb" | "gltf" | "fbx" | "dwg" | "cmdrw" | "cmfav" | "cmsym" | "obj";
|
|
221
255
|
export declare const dtoExportFormatNames: DtoExportFormat[];
|
|
222
256
|
/** ExportRequest */
|
|
223
257
|
export interface DtoExportRequest {
|
|
224
258
|
format: DtoExportFormat;
|
|
225
259
|
selOptions: Array<DtoSelectedOption>;
|
|
226
260
|
additionalProducts?: Array<DtoAdditionalProductConfiguration>;
|
|
261
|
+
/**
|
|
262
|
+
* This boolean indicates if the exported file should be zipped or not.
|
|
263
|
+
* When the export outputs multiple files they will always be zipped.
|
|
264
|
+
* The default behaviour is to always zip the exported file.
|
|
265
|
+
*/
|
|
227
266
|
preferUnzipped?: boolean;
|
|
228
267
|
}
|
|
229
268
|
/** ExportResponse */
|
|
@@ -459,15 +498,31 @@ export interface DtoOptionConf {
|
|
|
459
498
|
}
|
|
460
499
|
/** Orientation */
|
|
461
500
|
export interface DtoOrientation {
|
|
501
|
+
/**
|
|
502
|
+
* radians
|
|
503
|
+
*/
|
|
462
504
|
yaw: number;
|
|
505
|
+
/**
|
|
506
|
+
* radians
|
|
507
|
+
*/
|
|
463
508
|
pitch: number;
|
|
509
|
+
/**
|
|
510
|
+
* radians
|
|
511
|
+
*/
|
|
464
512
|
roll: number;
|
|
465
513
|
}
|
|
466
514
|
/** PartsConstrainedOption */
|
|
467
515
|
export interface DtoPartsConstrainedOption {
|
|
468
516
|
code: string;
|
|
469
517
|
feature: string;
|
|
518
|
+
/**
|
|
519
|
+
* Mutually exclusive with `constrBooleans`
|
|
520
|
+
*/
|
|
470
521
|
constrOptions?: Array<string>;
|
|
522
|
+
/**
|
|
523
|
+
* Mutually exclusive with `constrOptions`
|
|
524
|
+
*/
|
|
525
|
+
constrBooleans?: Array<DtoBooleanConstrainedOption>;
|
|
471
526
|
next?: {
|
|
472
527
|
[index: string]: DtoPartsConstrainedOption;
|
|
473
528
|
};
|
|
@@ -751,9 +806,21 @@ export interface DtoTargetCameraArgs {
|
|
|
751
806
|
target?: DtoPoint;
|
|
752
807
|
direction?: DtoVector;
|
|
753
808
|
normal?: DtoVector;
|
|
809
|
+
/**
|
|
810
|
+
* radians
|
|
811
|
+
*/
|
|
754
812
|
yaw?: number;
|
|
813
|
+
/**
|
|
814
|
+
* radians
|
|
815
|
+
*/
|
|
755
816
|
pitch?: number;
|
|
817
|
+
/**
|
|
818
|
+
* radians
|
|
819
|
+
*/
|
|
756
820
|
roll?: number;
|
|
821
|
+
/**
|
|
822
|
+
* radians
|
|
823
|
+
*/
|
|
757
824
|
fov?: number;
|
|
758
825
|
nearClip?: number;
|
|
759
826
|
minHeight?: number;
|
package/dist/CatalogueAPI.js
CHANGED
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
// WARNING: This file was auto generated by the code in web-rnd/tygen.
|
|
2
2
|
// Do not commit manual changes to this file.
|
|
3
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
3
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
13
4
|
// @ts-ignore
|
|
14
5
|
import packageInfo from "../package.json";
|
|
15
6
|
export const dtoCacheFilterTypeNames = ["Contains", "StartsWith"];
|
|
16
7
|
export const dtoCacheRegionNames = ["ap", "eu", "us"];
|
|
17
|
-
export const dtoExportFormatNames = ["glb", "gltf", "fbx", "dwg", "cmdrw", "cmfav", "cmsym"];
|
|
8
|
+
export const dtoExportFormatNames = ["glb", "gltf", "fbx", "dwg", "cmdrw", "cmfav", "cmsym", "obj"];
|
|
18
9
|
export const dtoExportStatusStatusNames = ["pending", "running", "finished", "failed"];
|
|
19
10
|
export const dtoKeyTypeNames = ["Production", "Test", "RateLimitTest", "RateLimitProduction"];
|
|
20
11
|
export const dtoNoteSeverityNames = ["Information", "Critical", "Warning"];
|
|
@@ -41,229 +32,203 @@ export class CatalogueAPI {
|
|
|
41
32
|
hasFeature(feature) {
|
|
42
33
|
return this.auth !== undefined && this.auth.apiSession.features !== undefined && this.auth.apiSession.features.indexOf(feature) > -1;
|
|
43
34
|
}
|
|
44
|
-
fetch(url, options) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
err = new DtoAPIError(parsed.error);
|
|
58
|
-
err.body = body;
|
|
59
|
-
err.status = response.status;
|
|
60
|
-
err.parsed = parsed;
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
return parsed;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
catch (e) {
|
|
67
|
-
const msg = e instanceof Error ? e.message : `${e}`;
|
|
68
|
-
err = new DtoAPIError(msg);
|
|
35
|
+
async fetch(url, options) {
|
|
36
|
+
let response;
|
|
37
|
+
let body;
|
|
38
|
+
let err;
|
|
39
|
+
if (options.method === "POST" && options.body) {
|
|
40
|
+
options.headers["Content-Type"] = "application/json;charset=utf-8";
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
response = await this._fetch(url, options);
|
|
44
|
+
body = await response.text();
|
|
45
|
+
const parsed = JSON.parse(body);
|
|
46
|
+
if (parsed && typeof parsed === "object" && "error" in parsed) {
|
|
47
|
+
err = new DtoAPIError(parsed.error);
|
|
69
48
|
err.body = body;
|
|
70
|
-
err.status = response
|
|
71
|
-
err.
|
|
49
|
+
err.status = response.status;
|
|
50
|
+
err.parsed = parsed;
|
|
72
51
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
postPublicAccessTokenAuthorize(params, endpoint) {
|
|
77
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
-
const url = `/v2/access-token/public/${encodeURIComponent(params.accessTokenId)}/authorize`;
|
|
79
|
-
const options = {
|
|
80
|
-
method: "POST",
|
|
81
|
-
headers: { "X-SDK-Version": packageInfo.version },
|
|
82
|
-
};
|
|
83
|
-
if (this._alternativeReferer) {
|
|
84
|
-
options.headers["Alternative-Referer"] = this._alternativeReferer;
|
|
52
|
+
else {
|
|
53
|
+
return parsed;
|
|
85
54
|
}
|
|
86
|
-
|
|
87
|
-
|
|
55
|
+
}
|
|
56
|
+
catch (e) {
|
|
57
|
+
const msg = e instanceof Error ? e.message : `${e}`;
|
|
58
|
+
err = new DtoAPIError(msg);
|
|
59
|
+
err.body = body;
|
|
60
|
+
err.status = response && response.status;
|
|
61
|
+
err.error = e instanceof Error ? e : Error(msg);
|
|
62
|
+
}
|
|
63
|
+
throw err;
|
|
64
|
+
}
|
|
65
|
+
async postPublicAccessTokenAuthorize(params, endpoint) {
|
|
66
|
+
const url = `/v2/access-token/public/${encodeURIComponent(params.accessTokenId)}/authorize`;
|
|
67
|
+
const options = {
|
|
68
|
+
method: "POST",
|
|
69
|
+
headers: { "X-SDK-Version": packageInfo.version },
|
|
70
|
+
};
|
|
71
|
+
if (this._alternativeReferer) {
|
|
72
|
+
options.headers["Alternative-Referer"] = this._alternativeReferer;
|
|
73
|
+
}
|
|
74
|
+
return this.fetch(endpoint + url, options);
|
|
88
75
|
}
|
|
89
|
-
getApplicationAreas(params) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return this.fetch(this.auth.endpoint + url, options);
|
|
103
|
-
});
|
|
76
|
+
async getApplicationAreas(params) {
|
|
77
|
+
if (this.auth === undefined) {
|
|
78
|
+
throw new Error("missing auth");
|
|
79
|
+
}
|
|
80
|
+
const url = `/v2/catalogue/${encodeURIComponent(params.cid)}/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/application-areas`;
|
|
81
|
+
const options = {
|
|
82
|
+
method: "GET",
|
|
83
|
+
headers: { "X-API-Key": this.auth.secretToken || "", "X-SDK-Version": packageInfo.version },
|
|
84
|
+
};
|
|
85
|
+
if (this._alternativeReferer) {
|
|
86
|
+
options.headers["Alternative-Referer"] = this._alternativeReferer;
|
|
87
|
+
}
|
|
88
|
+
return this.fetch(this.auth.endpoint + url, options);
|
|
104
89
|
}
|
|
105
|
-
postExport(params, body) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
return this.fetch(this.auth.endpoint + url, options);
|
|
120
|
-
});
|
|
90
|
+
async postExport(params, body) {
|
|
91
|
+
if (this.auth === undefined) {
|
|
92
|
+
throw new Error("missing auth");
|
|
93
|
+
}
|
|
94
|
+
const url = `/v2/catalogue/${encodeURIComponent(params.cid)}/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/export/${encodeURIComponent(params.partNumber)}`;
|
|
95
|
+
const options = {
|
|
96
|
+
method: "POST",
|
|
97
|
+
headers: { "X-API-Key": this.auth.secretToken || "", "X-SDK-Version": packageInfo.version },
|
|
98
|
+
body: JSON.stringify(body),
|
|
99
|
+
};
|
|
100
|
+
if (this._alternativeReferer) {
|
|
101
|
+
options.headers["Alternative-Referer"] = this._alternativeReferer;
|
|
102
|
+
}
|
|
103
|
+
return this.fetch(this.auth.endpoint + url, options);
|
|
121
104
|
}
|
|
122
|
-
getPriceLists(params) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return this.fetch(this.auth.endpoint + url, options);
|
|
136
|
-
});
|
|
105
|
+
async getPriceLists(params) {
|
|
106
|
+
if (this.auth === undefined) {
|
|
107
|
+
throw new Error("missing auth");
|
|
108
|
+
}
|
|
109
|
+
const url = `/v2/catalogue/${encodeURIComponent(params.cid)}/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/price-lists`;
|
|
110
|
+
const options = {
|
|
111
|
+
method: "GET",
|
|
112
|
+
headers: { "X-API-Key": this.auth.secretToken || "", "X-SDK-Version": packageInfo.version },
|
|
113
|
+
};
|
|
114
|
+
if (this._alternativeReferer) {
|
|
115
|
+
options.headers["Alternative-Referer"] = this._alternativeReferer;
|
|
116
|
+
}
|
|
117
|
+
return this.fetch(this.auth.endpoint + url, options);
|
|
137
118
|
}
|
|
138
|
-
getProduct(params) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
return this.fetch(this.auth.endpoint + url, options);
|
|
152
|
-
});
|
|
119
|
+
async getProduct(params) {
|
|
120
|
+
if (this.auth === undefined) {
|
|
121
|
+
throw new Error("missing auth");
|
|
122
|
+
}
|
|
123
|
+
const url = `/v2/catalogue/${encodeURIComponent(params.cid)}/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/product/${encodeURIComponent(params.partNumber)}`;
|
|
124
|
+
const options = {
|
|
125
|
+
method: "GET",
|
|
126
|
+
headers: { "X-API-Key": this.auth.secretToken || "", "X-SDK-Version": packageInfo.version },
|
|
127
|
+
};
|
|
128
|
+
if (this._alternativeReferer) {
|
|
129
|
+
options.headers["Alternative-Referer"] = this._alternativeReferer;
|
|
130
|
+
}
|
|
131
|
+
return this.fetch(this.auth.endpoint + url, options);
|
|
153
132
|
}
|
|
154
|
-
postRender(params, body) {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
return this.fetch(this.auth.endpoint + url, options);
|
|
169
|
-
});
|
|
133
|
+
async postRender(params, body) {
|
|
134
|
+
if (this.auth === undefined) {
|
|
135
|
+
throw new Error("missing auth");
|
|
136
|
+
}
|
|
137
|
+
const url = `/v2/catalogue/${encodeURIComponent(params.cid)}/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/product/${encodeURIComponent(params.partNumber)}/render`;
|
|
138
|
+
const options = {
|
|
139
|
+
method: "POST",
|
|
140
|
+
headers: { "X-API-Key": this.auth.secretToken || "", "X-SDK-Version": packageInfo.version },
|
|
141
|
+
body: JSON.stringify(body),
|
|
142
|
+
};
|
|
143
|
+
if (this._alternativeReferer) {
|
|
144
|
+
options.headers["Alternative-Referer"] = this._alternativeReferer;
|
|
145
|
+
}
|
|
146
|
+
return this.fetch(this.auth.endpoint + url, options);
|
|
170
147
|
}
|
|
171
|
-
postValidate(params, body) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
return this.fetch(this.auth.endpoint + url, options);
|
|
186
|
-
});
|
|
148
|
+
async postValidate(params, body) {
|
|
149
|
+
if (this.auth === undefined) {
|
|
150
|
+
throw new Error("missing auth");
|
|
151
|
+
}
|
|
152
|
+
const url = `/v2/catalogue/${encodeURIComponent(params.cid)}/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/product/${encodeURIComponent(params.partNumber)}/validate`;
|
|
153
|
+
const options = {
|
|
154
|
+
method: "POST",
|
|
155
|
+
headers: { "X-API-Key": this.auth.secretToken || "", "X-SDK-Version": packageInfo.version },
|
|
156
|
+
body: JSON.stringify(body),
|
|
157
|
+
};
|
|
158
|
+
if (this._alternativeReferer) {
|
|
159
|
+
options.headers["Alternative-Referer"] = this._alternativeReferer;
|
|
160
|
+
}
|
|
161
|
+
return this.fetch(this.auth.endpoint + url, options);
|
|
187
162
|
}
|
|
188
|
-
getTocTree(params) {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
return this.fetch(this.auth.endpoint + url, options);
|
|
202
|
-
});
|
|
163
|
+
async getTocTree(params) {
|
|
164
|
+
if (this.auth === undefined) {
|
|
165
|
+
throw new Error("missing auth");
|
|
166
|
+
}
|
|
167
|
+
const url = `/v2/catalogue/${encodeURIComponent(params.cid)}/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/toc`;
|
|
168
|
+
const options = {
|
|
169
|
+
method: "GET",
|
|
170
|
+
headers: { "X-API-Key": this.auth.secretToken || "", "X-SDK-Version": packageInfo.version },
|
|
171
|
+
};
|
|
172
|
+
if (this._alternativeReferer) {
|
|
173
|
+
options.headers["Alternative-Referer"] = this._alternativeReferer;
|
|
174
|
+
}
|
|
175
|
+
return this.fetch(this.auth.endpoint + url, options);
|
|
203
176
|
}
|
|
204
|
-
getTocFlat(params) {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
return this.fetch(this.auth.endpoint + url, options);
|
|
218
|
-
});
|
|
177
|
+
async getTocFlat(params) {
|
|
178
|
+
if (this.auth === undefined) {
|
|
179
|
+
throw new Error("missing auth");
|
|
180
|
+
}
|
|
181
|
+
const url = `/v2/catalogue/${encodeURIComponent(params.cid)}/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/toc/flat`;
|
|
182
|
+
const options = {
|
|
183
|
+
method: "GET",
|
|
184
|
+
headers: { "X-API-Key": this.auth.secretToken || "", "X-SDK-Version": packageInfo.version },
|
|
185
|
+
};
|
|
186
|
+
if (this._alternativeReferer) {
|
|
187
|
+
options.headers["Alternative-Referer"] = this._alternativeReferer;
|
|
188
|
+
}
|
|
189
|
+
return this.fetch(this.auth.endpoint + url, options);
|
|
219
190
|
}
|
|
220
|
-
getExportById(params) {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
return this.fetch(this.auth.endpoint + url, options);
|
|
234
|
-
});
|
|
191
|
+
async getExportById(params) {
|
|
192
|
+
if (this.auth === undefined) {
|
|
193
|
+
throw new Error("missing auth");
|
|
194
|
+
}
|
|
195
|
+
const url = `/v2/export/${encodeURIComponent(params.uuid)}`;
|
|
196
|
+
const options = {
|
|
197
|
+
method: "GET",
|
|
198
|
+
headers: { "X-API-Key": this.auth.secretToken || "", "X-SDK-Version": packageInfo.version },
|
|
199
|
+
};
|
|
200
|
+
if (this._alternativeReferer) {
|
|
201
|
+
options.headers["Alternative-Referer"] = this._alternativeReferer;
|
|
202
|
+
}
|
|
203
|
+
return this.fetch(this.auth.endpoint + url, options);
|
|
235
204
|
}
|
|
236
|
-
getRenderById(params) {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
return this.fetch(this.auth.endpoint + url, options);
|
|
250
|
-
});
|
|
205
|
+
async getRenderById(params) {
|
|
206
|
+
if (this.auth === undefined) {
|
|
207
|
+
throw new Error("missing auth");
|
|
208
|
+
}
|
|
209
|
+
const url = `/v2/render/${encodeURIComponent(params.uuid)}`;
|
|
210
|
+
const options = {
|
|
211
|
+
method: "GET",
|
|
212
|
+
headers: { "X-API-Key": this.auth.secretToken || "", "X-SDK-Version": packageInfo.version },
|
|
213
|
+
};
|
|
214
|
+
if (this._alternativeReferer) {
|
|
215
|
+
options.headers["Alternative-Referer"] = this._alternativeReferer;
|
|
216
|
+
}
|
|
217
|
+
return this.fetch(this.auth.endpoint + url, options);
|
|
251
218
|
}
|
|
252
|
-
postSessionTokenRefresh() {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
return this.fetch(this.auth.endpoint + url, options);
|
|
266
|
-
});
|
|
219
|
+
async postSessionTokenRefresh() {
|
|
220
|
+
if (this.auth === undefined) {
|
|
221
|
+
throw new Error("missing auth");
|
|
222
|
+
}
|
|
223
|
+
const url = `/v2/session-token/refresh`;
|
|
224
|
+
const options = {
|
|
225
|
+
method: "POST",
|
|
226
|
+
headers: { "X-API-Key": this.auth.secretToken || "", "X-SDK-Version": packageInfo.version },
|
|
227
|
+
};
|
|
228
|
+
if (this._alternativeReferer) {
|
|
229
|
+
options.headers["Alternative-Referer"] = this._alternativeReferer;
|
|
230
|
+
}
|
|
231
|
+
return this.fetch(this.auth.endpoint + url, options);
|
|
267
232
|
}
|
|
268
233
|
}
|
|
269
234
|
export const DTO_OPERATION_ID_TO_DEBIT_GROUP = {
|
package/dist/CfgMeasure.js
CHANGED
|
@@ -16,13 +16,12 @@ export class CfgMeasureDefinition {
|
|
|
16
16
|
// We however only use this for anchoring and stretching and so it is the
|
|
17
17
|
// code of the measureParam that is relevant. Hence Measurements with no
|
|
18
18
|
// measureParam are ignored.
|
|
19
|
-
var _a;
|
|
20
19
|
const measureParam = measurement.measureParam;
|
|
21
20
|
if (measureParam === undefined) {
|
|
22
21
|
return undefined;
|
|
23
22
|
}
|
|
24
23
|
const code = measureParam.code;
|
|
25
|
-
return new this(code, measurement.numericValue, (
|
|
24
|
+
return new this(code, measurement.numericValue, (measureParam.measurePriority ?? []).map((p, index) => ({
|
|
26
25
|
modelLocalFilePath: p.url,
|
|
27
26
|
index,
|
|
28
27
|
})));
|
package/dist/CfgProduct.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { AggregatedLoadingObservable, LengthUnit, Observable, SingleArgCallback
|
|
|
2
2
|
import { DtoAdditionalProductConfiguration, DtoAdditionalProductRef, DtoCatalogueParams, DtoMeasureParam, DtoMiscFile, DtoMtrlApplication, DtoNote, DtoPrices, DtoProductConf, DtoProductParamsWithLang, DtoTransform } from "./CatalogueAPI.js";
|
|
3
3
|
import { CfgMeasureDefinition } from "./CfgMeasure.js";
|
|
4
4
|
import { _CfgFeatureInternal } from "./productConfiguration/CfgFeature.js";
|
|
5
|
-
import { ProductConfigurationBubbleMode } from "./productConfiguration/CfgOption.js";
|
|
5
|
+
import { ProductConfigurationBubbleMode, _CfgOptionInternal } from "./productConfiguration/CfgOption.js";
|
|
6
6
|
import { CfgProductConfiguration } from "./productConfiguration/CfgProductConfiguration.js";
|
|
7
7
|
import { ProductLoader } from "./productLoader.js";
|
|
8
8
|
import { SyncGroupsApplyMode } from "./syncGroups/SyncGroupsApplyMode.js";
|
|
@@ -102,6 +102,13 @@ export declare class _CfgProductInternal {
|
|
|
102
102
|
private _configuration;
|
|
103
103
|
private _notes;
|
|
104
104
|
readonly changeObservable: Observable<CfgProductChangeNotification>;
|
|
105
|
+
/**
|
|
106
|
+
* The last diff that was generated during the last validate call.
|
|
107
|
+
*
|
|
108
|
+
* This is used to keep track of the changes that were made to the
|
|
109
|
+
* configuration as a result of apply constraints.
|
|
110
|
+
*/
|
|
111
|
+
private _lastDiff;
|
|
105
112
|
get selected(): boolean;
|
|
106
113
|
readonly isAdditionalProduct: boolean;
|
|
107
114
|
/**
|
|
@@ -198,10 +205,22 @@ export declare class _CfgProductInternal {
|
|
|
198
205
|
tryMatchSelection: (other: _CfgProductInternal, descriptionMatch?: boolean, productLoaderForGroupedLoad?: ProductLoader | undefined) => Promise<boolean>;
|
|
199
206
|
/** Only features in selected options and selected additional products. */
|
|
200
207
|
_getDescendantFeaturesWithCode: (code: string) => _CfgFeatureInternal[];
|
|
208
|
+
/**
|
|
209
|
+
* Obtains the differences found in the last validate call.
|
|
210
|
+
* Used to update the sync group state.
|
|
211
|
+
*
|
|
212
|
+
* Removes the diff from the product.
|
|
213
|
+
*/
|
|
214
|
+
takeDiff(): _CfgOptionInternal[] | undefined;
|
|
201
215
|
private _revalidateInProgressToken;
|
|
202
216
|
/**
|
|
203
|
-
* Do a validate call for this product.
|
|
204
|
-
*
|
|
217
|
+
* Do a validate call for this product.
|
|
218
|
+
*
|
|
219
|
+
* Does not validate additional products, unless application of sync groups
|
|
220
|
+
* on the result of the validate call results in changes in the additional
|
|
221
|
+
* product.
|
|
222
|
+
*
|
|
223
|
+
* The validation result is applied on the configuration. Then additional
|
|
205
224
|
* products are synced (unloaded, loaded etc.) Finally the changes bubble up the tree.
|
|
206
225
|
*/
|
|
207
226
|
_revalidate: (bubbleMode: CfgProductBubbleMode, productLoader: ProductLoader, committed: boolean) => Promise<boolean>;
|