@configura/web-api 3.0.0-alpha.0 → 3.0.0-alpha.2

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.
Files changed (29) hide show
  1. package/dist/CatalogueAPI.d.ts +68 -1
  2. package/dist/CatalogueAPI.js +184 -219
  3. package/dist/CfgMeasure.js +1 -2
  4. package/dist/CfgProduct.js +131 -159
  5. package/dist/io/CfgIOManager.js +2 -11
  6. package/dist/io/CfgIOProdConfConnector.js +14 -25
  7. package/dist/io/CfgObservableStateManager.js +1 -1
  8. package/dist/productConfiguration/CfgFeature.d.ts +5 -0
  9. package/dist/productConfiguration/CfgFeature.js +64 -54
  10. package/dist/productConfiguration/CfgOption.d.ts +44 -0
  11. package/dist/productConfiguration/CfgOption.js +107 -71
  12. package/dist/productConfiguration/CfgProductConfiguration.js +22 -34
  13. package/dist/productConfiguration/productParamsGenerator.js +43 -57
  14. package/dist/productLoader.js +2 -13
  15. package/dist/syncGroups/SyncGroupsHandler.js +60 -83
  16. package/dist/syncGroups/SyncGroupsPathHelper.js +5 -5
  17. package/dist/syncGroups/SyncGroupsState.js +4 -5
  18. package/dist/syncGroups/SyncGroupsTransaction.js +259 -303
  19. package/dist/tasks/TaskHandler.js +53 -64
  20. package/dist/tests/testData/dummyProductForTest.js +4 -1
  21. package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.js +18 -21
  22. package/dist/tests/testData/testDataCachedGetProduct.js +20 -20
  23. package/dist/tests/testData/testDataCachedPostValidate.js +6 -15
  24. package/dist/tests/testData/testDataProductAggregatedPrice.js +21 -21
  25. package/dist/tests/testData/testDataUpcharge.js +31 -22
  26. package/dist/utilitiesCatalogueData.js +21 -9
  27. package/dist/utilitiesCataloguePermission.js +5 -2
  28. package/dist/utilitiesConfiguration.js +21 -23
  29. package/package.json +3 -3
@@ -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;
@@ -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
- return __awaiter(this, void 0, void 0, function* () {
46
- let response;
47
- let body;
48
- let err;
49
- if (options.method === "POST" && options.body) {
50
- options.headers["Content-Type"] = "application/json;charset=utf-8";
51
- }
52
- try {
53
- response = yield this._fetch(url, options);
54
- body = yield response.text();
55
- const parsed = JSON.parse(body);
56
- if (parsed && typeof parsed === "object" && "error" in parsed) {
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 && response.status;
71
- err.error = e instanceof Error ? e : Error(msg);
49
+ err.status = response.status;
50
+ err.parsed = parsed;
72
51
  }
73
- throw err;
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
- return this.fetch(endpoint + url, options);
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
- return __awaiter(this, void 0, void 0, function* () {
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)}/application-areas`;
95
- const options = {
96
- method: "GET",
97
- headers: { "X-API-Key": this.auth.secretToken || "", "X-SDK-Version": packageInfo.version },
98
- };
99
- if (this._alternativeReferer) {
100
- options.headers["Alternative-Referer"] = this._alternativeReferer;
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
- return __awaiter(this, void 0, void 0, function* () {
107
- if (this.auth === undefined) {
108
- throw new Error("missing auth");
109
- }
110
- 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)}`;
111
- const options = {
112
- method: "POST",
113
- headers: { "X-API-Key": this.auth.secretToken || "", "X-SDK-Version": packageInfo.version },
114
- body: JSON.stringify(body),
115
- };
116
- if (this._alternativeReferer) {
117
- options.headers["Alternative-Referer"] = this._alternativeReferer;
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
- return __awaiter(this, void 0, void 0, function* () {
124
- if (this.auth === undefined) {
125
- throw new Error("missing auth");
126
- }
127
- 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`;
128
- const options = {
129
- method: "GET",
130
- headers: { "X-API-Key": this.auth.secretToken || "", "X-SDK-Version": packageInfo.version },
131
- };
132
- if (this._alternativeReferer) {
133
- options.headers["Alternative-Referer"] = this._alternativeReferer;
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
- return __awaiter(this, void 0, void 0, function* () {
140
- if (this.auth === undefined) {
141
- throw new Error("missing auth");
142
- }
143
- 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)}`;
144
- const options = {
145
- method: "GET",
146
- headers: { "X-API-Key": this.auth.secretToken || "", "X-SDK-Version": packageInfo.version },
147
- };
148
- if (this._alternativeReferer) {
149
- options.headers["Alternative-Referer"] = this._alternativeReferer;
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
- return __awaiter(this, void 0, void 0, function* () {
156
- if (this.auth === undefined) {
157
- throw new Error("missing auth");
158
- }
159
- 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`;
160
- const options = {
161
- method: "POST",
162
- headers: { "X-API-Key": this.auth.secretToken || "", "X-SDK-Version": packageInfo.version },
163
- body: JSON.stringify(body),
164
- };
165
- if (this._alternativeReferer) {
166
- options.headers["Alternative-Referer"] = this._alternativeReferer;
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
- return __awaiter(this, void 0, void 0, function* () {
173
- if (this.auth === undefined) {
174
- throw new Error("missing auth");
175
- }
176
- 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`;
177
- const options = {
178
- method: "POST",
179
- headers: { "X-API-Key": this.auth.secretToken || "", "X-SDK-Version": packageInfo.version },
180
- body: JSON.stringify(body),
181
- };
182
- if (this._alternativeReferer) {
183
- options.headers["Alternative-Referer"] = this._alternativeReferer;
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
- return __awaiter(this, void 0, void 0, function* () {
190
- if (this.auth === undefined) {
191
- throw new Error("missing auth");
192
- }
193
- 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`;
194
- const options = {
195
- method: "GET",
196
- headers: { "X-API-Key": this.auth.secretToken || "", "X-SDK-Version": packageInfo.version },
197
- };
198
- if (this._alternativeReferer) {
199
- options.headers["Alternative-Referer"] = this._alternativeReferer;
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
- return __awaiter(this, void 0, void 0, function* () {
206
- if (this.auth === undefined) {
207
- throw new Error("missing auth");
208
- }
209
- 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`;
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);
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
- return __awaiter(this, void 0, void 0, function* () {
222
- if (this.auth === undefined) {
223
- throw new Error("missing auth");
224
- }
225
- const url = `/v2/export/${encodeURIComponent(params.uuid)}`;
226
- const options = {
227
- method: "GET",
228
- headers: { "X-API-Key": this.auth.secretToken || "", "X-SDK-Version": packageInfo.version },
229
- };
230
- if (this._alternativeReferer) {
231
- options.headers["Alternative-Referer"] = this._alternativeReferer;
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
- return __awaiter(this, void 0, void 0, function* () {
238
- if (this.auth === undefined) {
239
- throw new Error("missing auth");
240
- }
241
- const url = `/v2/render/${encodeURIComponent(params.uuid)}`;
242
- const options = {
243
- method: "GET",
244
- headers: { "X-API-Key": this.auth.secretToken || "", "X-SDK-Version": packageInfo.version },
245
- };
246
- if (this._alternativeReferer) {
247
- options.headers["Alternative-Referer"] = this._alternativeReferer;
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
- return __awaiter(this, void 0, void 0, function* () {
254
- if (this.auth === undefined) {
255
- throw new Error("missing auth");
256
- }
257
- const url = `/v2/session-token/refresh`;
258
- const options = {
259
- method: "POST",
260
- headers: { "X-API-Key": this.auth.secretToken || "", "X-SDK-Version": packageInfo.version },
261
- };
262
- if (this._alternativeReferer) {
263
- options.headers["Alternative-Referer"] = this._alternativeReferer;
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 = {
@@ -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, ((_a = measureParam.measurePriority) !== null && _a !== void 0 ? _a : []).map((p, index) => ({
24
+ return new this(code, measurement.numericValue, (measureParam.measurePriority ?? []).map((p, index) => ({
26
25
  modelLocalFilePath: p.url,
27
26
  index,
28
27
  })));