@configura/web-api 1.6.1-alpha.2 → 1.6.1-alpha.7

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 (75) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +1 -1
  3. package/dist/CatalogueAPI.d.ts +512 -511
  4. package/dist/CatalogueAPI.js +277 -273
  5. package/dist/CfgMeasure.d.ts +32 -32
  6. package/dist/CfgMeasure.js +30 -30
  7. package/dist/CfgProduct.d.ts +239 -257
  8. package/dist/CfgProduct.js +668 -732
  9. package/dist/index.d.ts +18 -20
  10. package/dist/index.js +18 -20
  11. package/dist/material/CfgMaterialMapping.d.ts +7 -7
  12. package/dist/material/CfgMaterialMapping.js +181 -181
  13. package/dist/material/CfgMtrlApplication.d.ts +18 -18
  14. package/dist/material/CfgMtrlApplication.js +43 -43
  15. package/dist/material/CfgMtrlApplicationSource.d.ts +7 -7
  16. package/dist/material/CfgMtrlApplicationSource.js +8 -8
  17. package/dist/material/CfgMtrlSource.d.ts +19 -19
  18. package/dist/material/CfgMtrlSource.js +40 -40
  19. package/dist/material/CfgMtrlSourceWithMetaData.d.ts +7 -7
  20. package/dist/material/CfgMtrlSourceWithMetaData.js +1 -1
  21. package/dist/productConfiguration/CfgFeature.d.ts +178 -179
  22. package/dist/productConfiguration/CfgFeature.js +611 -617
  23. package/dist/productConfiguration/CfgOption.d.ts +128 -150
  24. package/dist/productConfiguration/CfgOption.js +394 -426
  25. package/dist/productConfiguration/CfgProductConfiguration.d.ts +120 -120
  26. package/dist/productConfiguration/CfgProductConfiguration.js +307 -307
  27. package/dist/productConfiguration/filters.d.ts +15 -15
  28. package/dist/productConfiguration/filters.js +70 -70
  29. package/dist/productConfiguration/productParamsGenerator.d.ts +15 -15
  30. package/dist/productConfiguration/productParamsGenerator.js +51 -51
  31. package/dist/productConfiguration/utilitiesProductConfiguration.d.ts +17 -17
  32. package/dist/productConfiguration/utilitiesProductConfiguration.js +80 -80
  33. package/dist/productLoader.d.ts +33 -33
  34. package/dist/productLoader.js +49 -49
  35. package/dist/tasks/TaskHandler.d.ts +78 -78
  36. package/dist/tasks/TaskHandler.js +265 -265
  37. package/dist/tasks/formats.d.ts +4 -4
  38. package/dist/tasks/formats.js +7 -7
  39. package/dist/tests/testData/collectorForTest.d.ts +73 -73
  40. package/dist/tests/testData/collectorForTest.js +195 -195
  41. package/dist/tests/testData/dummyProductForTest.d.ts +4 -4
  42. package/dist/tests/testData/dummyProductForTest.js +36 -36
  43. package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.d.ts +32 -32
  44. package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.js +348 -277
  45. package/dist/tests/testData/testDataCachedGetProduct.d.ts +5 -5
  46. package/dist/tests/testData/testDataCachedGetProduct.js +196 -185
  47. package/dist/tests/testData/testDataCachedPostValidate.d.ts +7 -7
  48. package/dist/tests/testData/testDataCachedPostValidate.js +183 -183
  49. package/dist/tests/testData/testDataNoAdditionalProductNoPropagateForTest.d.ts +3 -3
  50. package/dist/tests/testData/testDataNoAdditionalProductNoPropagateForTest.js +1099 -1099
  51. package/dist/tests/testData/testDataProductAggregatedPrice.d.ts +6 -6
  52. package/dist/tests/testData/testDataProductAggregatedPrice.js +198 -187
  53. package/dist/tests/testData/testDataUpcharge.d.ts +29 -29
  54. package/dist/tests/testData/testDataUpcharge.js +151 -119
  55. package/dist/utilitiesCatalogueData.d.ts +25 -31
  56. package/dist/utilitiesCatalogueData.js +66 -168
  57. package/dist/utilitiesCataloguePermission.d.ts +39 -39
  58. package/dist/utilitiesCataloguePermission.js +84 -84
  59. package/dist/utilitiesNumericValues.d.ts +24 -24
  60. package/dist/utilitiesNumericValues.js +109 -109
  61. package/package.json +3 -3
  62. package/dist/syncGroups/SyncGroupsApplier.d.ts +0 -20
  63. package/dist/syncGroups/SyncGroupsApplier.js +0 -520
  64. package/dist/syncGroups/SyncGroupsApplyMode.d.ts +0 -21
  65. package/dist/syncGroups/SyncGroupsApplyMode.js +0 -21
  66. package/dist/syncGroups/SyncGroupsHandler.d.ts +0 -40
  67. package/dist/syncGroups/SyncGroupsHandler.js +0 -352
  68. package/dist/syncGroups/SyncGroupsPathHelper.d.ts +0 -27
  69. package/dist/syncGroups/SyncGroupsPathHelper.js +0 -89
  70. package/dist/syncGroups/SyncGroupsState.d.ts +0 -26
  71. package/dist/syncGroups/SyncGroupsState.js +0 -111
  72. package/dist/syncGroups/SyncGroupsTransaction.d.ts +0 -51
  73. package/dist/syncGroups/SyncGroupsTransaction.js +0 -100
  74. package/dist/tests/testData/testDataOptions.d.ts +0 -13
  75. package/dist/tests/testData/testDataOptions.js +0 -60
@@ -1,273 +1,277 @@
1
- // WARNING: This file was auto generated by the code in web-rnd/tygen.
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
- export const exportFormatNames = [
13
- "glb",
14
- "gltf",
15
- "fbx",
16
- "dwg",
17
- "cmdrw",
18
- "cmfav",
19
- "cmsym",
20
- ];
21
- export const exportStatusStatusNames = [
22
- "pending",
23
- "running",
24
- "finished",
25
- "failed",
26
- ];
27
- export const renderFormatNames = ["jpg", "png"];
28
- export const renderStatusStatusNames = [
29
- "pending",
30
- "running",
31
- "finished",
32
- "failed",
33
- ];
34
- export const syncGroupMethodsNames = ["pull", "push", "twoWay"];
35
- export class APIError extends Error {
36
- }
37
- export class CatalogueAPI {
38
- constructor() {
39
- const parts = new RegExp("^(http[s]?:\\/\\/[^:\\/\\s]+)", "i").exec(document.referrer);
40
- if (parts !== null) {
41
- this._alternativeReferer = parts[1];
42
- }
43
- }
44
- hasFeature(feature) {
45
- return (this.auth !== undefined &&
46
- this.auth.apiSession.features !== undefined &&
47
- this.auth.apiSession.features.indexOf(feature) > -1);
48
- }
49
- fetch(url, options) {
50
- return __awaiter(this, void 0, void 0, function* () {
51
- let response;
52
- let body;
53
- let err;
54
- if (options.method === "POST" && options.body) {
55
- options.headers["Content-Type"] = "application/json;charset=utf-8";
56
- }
57
- try {
58
- response = yield fetch(url, options);
59
- body = yield response.text();
60
- const parsed = JSON.parse(body);
61
- if ("error" in parsed) {
62
- err = new APIError(parsed.error);
63
- err.body = body;
64
- err.status = response.status;
65
- err.parsed = parsed;
66
- }
67
- else {
68
- return parsed;
69
- }
70
- }
71
- catch (e) {
72
- const msg = e instanceof Error ? e.message : `${e}`;
73
- err = new APIError(msg);
74
- err.body = body;
75
- err.status = response && response.status;
76
- err.error = e instanceof Error ? e : Error(msg);
77
- }
78
- throw err;
79
- });
80
- }
81
- postPublicAccessTokenAuthorize(params, endpoint) {
82
- return __awaiter(this, void 0, void 0, function* () {
83
- const url = `/v1/access-token/public/${encodeURIComponent(params.accessTokenId)}/authorize`;
84
- const options = {
85
- method: "POST",
86
- headers: {},
87
- };
88
- if (this._alternativeReferer) {
89
- options.headers["Alternative-Referer"] = this._alternativeReferer;
90
- }
91
- return this.fetch(endpoint + url, options);
92
- });
93
- }
94
- getApplicationAreas(params) {
95
- return __awaiter(this, void 0, void 0, function* () {
96
- if (this.auth === undefined) {
97
- throw new Error("missing auth");
98
- }
99
- const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/application-areas`;
100
- const options = {
101
- method: "GET",
102
- headers: { "X-API-Key": this.auth.secretToken || "" },
103
- };
104
- if (this._alternativeReferer) {
105
- options.headers["Alternative-Referer"] = this._alternativeReferer;
106
- }
107
- return this.fetch(this.auth.endpoint + url, options);
108
- });
109
- }
110
- postExport(params, body) {
111
- return __awaiter(this, void 0, void 0, function* () {
112
- if (this.auth === undefined) {
113
- throw new Error("missing auth");
114
- }
115
- const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/export/${encodeURIComponent(params.partNumber)}`;
116
- const options = {
117
- method: "POST",
118
- headers: { "X-API-Key": this.auth.secretToken || "" },
119
- body: JSON.stringify(body),
120
- };
121
- if (this._alternativeReferer) {
122
- options.headers["Alternative-Referer"] = this._alternativeReferer;
123
- }
124
- return this.fetch(this.auth.endpoint + url, options);
125
- });
126
- }
127
- getPriceLists(params) {
128
- return __awaiter(this, void 0, void 0, function* () {
129
- if (this.auth === undefined) {
130
- throw new Error("missing auth");
131
- }
132
- const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/price-lists`;
133
- const options = {
134
- method: "GET",
135
- headers: { "X-API-Key": this.auth.secretToken || "" },
136
- };
137
- if (this._alternativeReferer) {
138
- options.headers["Alternative-Referer"] = this._alternativeReferer;
139
- }
140
- return this.fetch(this.auth.endpoint + url, options);
141
- });
142
- }
143
- getProduct(params) {
144
- return __awaiter(this, void 0, void 0, function* () {
145
- if (this.auth === undefined) {
146
- throw new Error("missing auth");
147
- }
148
- const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/product-v2/${encodeURIComponent(params.partNumber)}`;
149
- const options = {
150
- method: "GET",
151
- headers: { "X-API-Key": this.auth.secretToken || "" },
152
- };
153
- if (this._alternativeReferer) {
154
- options.headers["Alternative-Referer"] = this._alternativeReferer;
155
- }
156
- return this.fetch(this.auth.endpoint + url, options);
157
- });
158
- }
159
- postRender(params, body) {
160
- return __awaiter(this, void 0, void 0, function* () {
161
- if (this.auth === undefined) {
162
- throw new Error("missing auth");
163
- }
164
- const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/product/${encodeURIComponent(params.partNumber)}/render`;
165
- const options = {
166
- method: "POST",
167
- headers: { "X-API-Key": this.auth.secretToken || "" },
168
- body: JSON.stringify(body),
169
- };
170
- if (this._alternativeReferer) {
171
- options.headers["Alternative-Referer"] = this._alternativeReferer;
172
- }
173
- return this.fetch(this.auth.endpoint + url, options);
174
- });
175
- }
176
- postValidate(params, body) {
177
- return __awaiter(this, void 0, void 0, function* () {
178
- if (this.auth === undefined) {
179
- throw new Error("missing auth");
180
- }
181
- const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/product/${encodeURIComponent(params.partNumber)}/validate`;
182
- const options = {
183
- method: "POST",
184
- headers: { "X-API-Key": this.auth.secretToken || "" },
185
- body: JSON.stringify(body),
186
- };
187
- if (this._alternativeReferer) {
188
- options.headers["Alternative-Referer"] = this._alternativeReferer;
189
- }
190
- return this.fetch(this.auth.endpoint + url, options);
191
- });
192
- }
193
- getTocTree(params) {
194
- return __awaiter(this, void 0, void 0, function* () {
195
- if (this.auth === undefined) {
196
- throw new Error("missing auth");
197
- }
198
- const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/toc`;
199
- const options = {
200
- method: "GET",
201
- headers: { "X-API-Key": this.auth.secretToken || "" },
202
- };
203
- if (this._alternativeReferer) {
204
- options.headers["Alternative-Referer"] = this._alternativeReferer;
205
- }
206
- return this.fetch(this.auth.endpoint + url, options);
207
- });
208
- }
209
- getTocFlat(params) {
210
- return __awaiter(this, void 0, void 0, function* () {
211
- if (this.auth === undefined) {
212
- throw new Error("missing auth");
213
- }
214
- const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/toc/flat`;
215
- const options = {
216
- method: "GET",
217
- headers: { "X-API-Key": this.auth.secretToken || "" },
218
- };
219
- if (this._alternativeReferer) {
220
- options.headers["Alternative-Referer"] = this._alternativeReferer;
221
- }
222
- return this.fetch(this.auth.endpoint + url, options);
223
- });
224
- }
225
- getExportById(params) {
226
- return __awaiter(this, void 0, void 0, function* () {
227
- if (this.auth === undefined) {
228
- throw new Error("missing auth");
229
- }
230
- const url = `/v1/export/${encodeURIComponent(params.uuid)}`;
231
- const options = {
232
- method: "GET",
233
- headers: { "X-API-Key": this.auth.secretToken || "" },
234
- };
235
- if (this._alternativeReferer) {
236
- options.headers["Alternative-Referer"] = this._alternativeReferer;
237
- }
238
- return this.fetch(this.auth.endpoint + url, options);
239
- });
240
- }
241
- getRenderById(params) {
242
- return __awaiter(this, void 0, void 0, function* () {
243
- if (this.auth === undefined) {
244
- throw new Error("missing auth");
245
- }
246
- const url = `/v1/render/${encodeURIComponent(params.uuid)}`;
247
- const options = {
248
- method: "GET",
249
- headers: { "X-API-Key": this.auth.secretToken || "" },
250
- };
251
- if (this._alternativeReferer) {
252
- options.headers["Alternative-Referer"] = this._alternativeReferer;
253
- }
254
- return this.fetch(this.auth.endpoint + url, options);
255
- });
256
- }
257
- postSessionTokenRefresh() {
258
- return __awaiter(this, void 0, void 0, function* () {
259
- if (this.auth === undefined) {
260
- throw new Error("missing auth");
261
- }
262
- const url = `/v1/session-token/refresh`;
263
- const options = {
264
- method: "POST",
265
- headers: { "X-API-Key": this.auth.secretToken || "" },
266
- };
267
- if (this._alternativeReferer) {
268
- options.headers["Alternative-Referer"] = this._alternativeReferer;
269
- }
270
- return this.fetch(this.auth.endpoint + url, options);
271
- });
272
- }
273
- }
1
+ // WARNING: This file was auto generated by the code in web-rnd/tygen.
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
+ export const exportFormatNames = [
13
+ "glb",
14
+ "gltf",
15
+ "fbx",
16
+ "dwg",
17
+ "cmdrw",
18
+ "cmfav",
19
+ "cmsym",
20
+ ];
21
+ export const exportStatusStatusNames = [
22
+ "pending",
23
+ "running",
24
+ "finished",
25
+ "failed",
26
+ ];
27
+ export const renderFormatNames = ["jpg", "png"];
28
+ export const renderStatusStatusNames = [
29
+ "pending",
30
+ "running",
31
+ "finished",
32
+ "failed",
33
+ ];
34
+ export const syncGroupMethodsNames = ["pull", "push", "twoWay"];
35
+ export class APIError extends Error {
36
+ }
37
+ export class CatalogueAPI {
38
+ // For internal use
39
+ _saveAlternativeReferer() {
40
+ if (typeof document === "undefined") {
41
+ return;
42
+ }
43
+ const parts = new RegExp("^(http[s]?:\\/\\/[^:\\/\\s]+)", "i").exec(document.referrer);
44
+ if (parts !== null) {
45
+ this._alternativeReferer = parts[1];
46
+ }
47
+ }
48
+ hasFeature(feature) {
49
+ return (this.auth !== undefined &&
50
+ this.auth.apiSession.features !== undefined &&
51
+ this.auth.apiSession.features.indexOf(feature) > -1);
52
+ }
53
+ fetch(url, options) {
54
+ return __awaiter(this, void 0, void 0, function* () {
55
+ let response;
56
+ let body;
57
+ let err;
58
+ if (options.method === "POST" && options.body) {
59
+ options.headers["Content-Type"] = "application/json;charset=utf-8";
60
+ }
61
+ try {
62
+ response = yield fetch(url, options);
63
+ body = yield response.text();
64
+ const parsed = JSON.parse(body);
65
+ if ("error" in parsed) {
66
+ err = new APIError(parsed.error);
67
+ err.body = body;
68
+ err.status = response.status;
69
+ err.parsed = parsed;
70
+ }
71
+ else {
72
+ return parsed;
73
+ }
74
+ }
75
+ catch (e) {
76
+ const msg = e instanceof Error ? e.message : `${e}`;
77
+ err = new APIError(msg);
78
+ err.body = body;
79
+ err.status = response && response.status;
80
+ err.error = e instanceof Error ? e : Error(msg);
81
+ }
82
+ throw err;
83
+ });
84
+ }
85
+ postPublicAccessTokenAuthorize(params, endpoint) {
86
+ return __awaiter(this, void 0, void 0, function* () {
87
+ const url = `/v1/access-token/public/${encodeURIComponent(params.accessTokenId)}/authorize`;
88
+ const options = {
89
+ method: "POST",
90
+ headers: {},
91
+ };
92
+ if (this._alternativeReferer) {
93
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
94
+ }
95
+ return this.fetch(endpoint + url, options);
96
+ });
97
+ }
98
+ getApplicationAreas(params) {
99
+ return __awaiter(this, void 0, void 0, function* () {
100
+ if (this.auth === undefined) {
101
+ throw new Error("missing auth");
102
+ }
103
+ const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/application-areas`;
104
+ const options = {
105
+ method: "GET",
106
+ headers: { "X-API-Key": this.auth.secretToken || "" },
107
+ };
108
+ if (this._alternativeReferer) {
109
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
110
+ }
111
+ return this.fetch(this.auth.endpoint + url, options);
112
+ });
113
+ }
114
+ postExport(params, body) {
115
+ return __awaiter(this, void 0, void 0, function* () {
116
+ if (this.auth === undefined) {
117
+ throw new Error("missing auth");
118
+ }
119
+ const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/export/${encodeURIComponent(params.partNumber)}`;
120
+ const options = {
121
+ method: "POST",
122
+ headers: { "X-API-Key": this.auth.secretToken || "" },
123
+ body: JSON.stringify(body),
124
+ };
125
+ if (this._alternativeReferer) {
126
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
127
+ }
128
+ return this.fetch(this.auth.endpoint + url, options);
129
+ });
130
+ }
131
+ getPriceLists(params) {
132
+ return __awaiter(this, void 0, void 0, function* () {
133
+ if (this.auth === undefined) {
134
+ throw new Error("missing auth");
135
+ }
136
+ const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/price-lists`;
137
+ const options = {
138
+ method: "GET",
139
+ headers: { "X-API-Key": this.auth.secretToken || "" },
140
+ };
141
+ if (this._alternativeReferer) {
142
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
143
+ }
144
+ return this.fetch(this.auth.endpoint + url, options);
145
+ });
146
+ }
147
+ getProduct(params) {
148
+ return __awaiter(this, void 0, void 0, function* () {
149
+ if (this.auth === undefined) {
150
+ throw new Error("missing auth");
151
+ }
152
+ const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/product-v2/${encodeURIComponent(params.partNumber)}`;
153
+ const options = {
154
+ method: "GET",
155
+ headers: { "X-API-Key": this.auth.secretToken || "" },
156
+ };
157
+ if (this._alternativeReferer) {
158
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
159
+ }
160
+ return this.fetch(this.auth.endpoint + url, options);
161
+ });
162
+ }
163
+ postRender(params, body) {
164
+ return __awaiter(this, void 0, void 0, function* () {
165
+ if (this.auth === undefined) {
166
+ throw new Error("missing auth");
167
+ }
168
+ const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/product/${encodeURIComponent(params.partNumber)}/render`;
169
+ const options = {
170
+ method: "POST",
171
+ headers: { "X-API-Key": this.auth.secretToken || "" },
172
+ body: JSON.stringify(body),
173
+ };
174
+ if (this._alternativeReferer) {
175
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
176
+ }
177
+ return this.fetch(this.auth.endpoint + url, options);
178
+ });
179
+ }
180
+ postValidate(params, body) {
181
+ return __awaiter(this, void 0, void 0, function* () {
182
+ if (this.auth === undefined) {
183
+ throw new Error("missing auth");
184
+ }
185
+ const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/product/${encodeURIComponent(params.partNumber)}/validate`;
186
+ const options = {
187
+ method: "POST",
188
+ headers: { "X-API-Key": this.auth.secretToken || "" },
189
+ body: JSON.stringify(body),
190
+ };
191
+ if (this._alternativeReferer) {
192
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
193
+ }
194
+ return this.fetch(this.auth.endpoint + url, options);
195
+ });
196
+ }
197
+ getTocTree(params) {
198
+ return __awaiter(this, void 0, void 0, function* () {
199
+ if (this.auth === undefined) {
200
+ throw new Error("missing auth");
201
+ }
202
+ const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/toc`;
203
+ const options = {
204
+ method: "GET",
205
+ headers: { "X-API-Key": this.auth.secretToken || "" },
206
+ };
207
+ if (this._alternativeReferer) {
208
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
209
+ }
210
+ return this.fetch(this.auth.endpoint + url, options);
211
+ });
212
+ }
213
+ getTocFlat(params) {
214
+ return __awaiter(this, void 0, void 0, function* () {
215
+ if (this.auth === undefined) {
216
+ throw new Error("missing auth");
217
+ }
218
+ const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/toc/flat`;
219
+ const options = {
220
+ method: "GET",
221
+ headers: { "X-API-Key": this.auth.secretToken || "" },
222
+ };
223
+ if (this._alternativeReferer) {
224
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
225
+ }
226
+ return this.fetch(this.auth.endpoint + url, options);
227
+ });
228
+ }
229
+ getExportById(params) {
230
+ return __awaiter(this, void 0, void 0, function* () {
231
+ if (this.auth === undefined) {
232
+ throw new Error("missing auth");
233
+ }
234
+ const url = `/v1/export/${encodeURIComponent(params.uuid)}`;
235
+ const options = {
236
+ method: "GET",
237
+ headers: { "X-API-Key": this.auth.secretToken || "" },
238
+ };
239
+ if (this._alternativeReferer) {
240
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
241
+ }
242
+ return this.fetch(this.auth.endpoint + url, options);
243
+ });
244
+ }
245
+ getRenderById(params) {
246
+ return __awaiter(this, void 0, void 0, function* () {
247
+ if (this.auth === undefined) {
248
+ throw new Error("missing auth");
249
+ }
250
+ const url = `/v1/render/${encodeURIComponent(params.uuid)}`;
251
+ const options = {
252
+ method: "GET",
253
+ headers: { "X-API-Key": this.auth.secretToken || "" },
254
+ };
255
+ if (this._alternativeReferer) {
256
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
257
+ }
258
+ return this.fetch(this.auth.endpoint + url, options);
259
+ });
260
+ }
261
+ postSessionTokenRefresh() {
262
+ return __awaiter(this, void 0, void 0, function* () {
263
+ if (this.auth === undefined) {
264
+ throw new Error("missing auth");
265
+ }
266
+ const url = `/v1/session-token/refresh`;
267
+ const options = {
268
+ method: "POST",
269
+ headers: { "X-API-Key": this.auth.secretToken || "" },
270
+ };
271
+ if (this._alternativeReferer) {
272
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
273
+ }
274
+ return this.fetch(this.auth.endpoint + url, options);
275
+ });
276
+ }
277
+ }
@@ -1,33 +1,33 @@
1
- import { Measurement, ValueWithUnit } from "./CatalogueAPI.js";
2
- /**
3
- * Measures can be used to Anchor items (Models or Additional Products).
4
- *
5
- * Measures originates in Models, and can then be used in Products. There is nothing stopping
6
- * having multiple Models in the same Product that use the same Measure name. If so it is ambiguous
7
- * which of the Models in the Product to anchor to.
8
- *
9
- * Measure Priority tries to solve this by allowing MeasureParams to contain an ordered list
10
- * containing which Model should have highest priority (i.e. gets "first dibs") when Anchoring.
11
- *
12
- * Unfortunately the solution is currently a bit limited - we can not differentiate between Models
13
- * pointing to the same URL in a Product. However, we consistently pick the first one.
14
- * Lower index = higher priority
15
- */
16
- export declare type CfgMeasurePriority = {
17
- index: number;
18
- modelLocalFilePath: string;
19
- };
20
- /**
21
- * This class strips the Measurement of things that are not actually used or relevant
22
- * to Stage, specifically anchoring and stretching. Measurements can also contain
23
- * volume and area, but these are ignored. Here Measures are used to define defaults
24
- * such as its preferences when dealing with ambiguity or its default value.
25
- */
26
- export declare class CfgMeasureDefinition {
27
- readonly measureParamCode: string;
28
- readonly numericValue: ValueWithUnit | undefined;
29
- readonly measurePriorities: CfgMeasurePriority[];
30
- static make(measurement: Measurement): CfgMeasureDefinition | undefined;
31
- private constructor();
32
- }
1
+ import { Measurement, ValueWithUnit } from "./CatalogueAPI.js";
2
+ /**
3
+ * Measures can be used to Anchor items (Models or Additional Products).
4
+ *
5
+ * Measures originates in Models, and can then be used in Products. There is nothing stopping
6
+ * having multiple Models in the same Product that use the same Measure name. If so it is ambiguous
7
+ * which of the Models in the Product to anchor to.
8
+ *
9
+ * Measure Priority tries to solve this by allowing MeasureParams to contain an ordered list
10
+ * containing which Model should have highest priority (i.e. gets "first dibs") when Anchoring.
11
+ *
12
+ * Unfortunately the solution is currently a bit limited - we can not differentiate between Models
13
+ * pointing to the same URL in a Product. However, we consistently pick the first one.
14
+ * Lower index = higher priority
15
+ */
16
+ export declare type CfgMeasurePriority = {
17
+ index: number;
18
+ modelLocalFilePath: string;
19
+ };
20
+ /**
21
+ * This class strips the Measurement of things that are not actually used or relevant
22
+ * to Stage, specifically anchoring and stretching. Measurements can also contain
23
+ * volume and area, but these are ignored. Here Measures are used to define defaults
24
+ * such as its preferences when dealing with ambiguity or its default value.
25
+ */
26
+ export declare class CfgMeasureDefinition {
27
+ readonly measureParamCode: string;
28
+ readonly numericValue: ValueWithUnit | undefined;
29
+ readonly measurePriorities: CfgMeasurePriority[];
30
+ static make(measurement: Measurement): CfgMeasureDefinition | undefined;
31
+ private constructor();
32
+ }
33
33
  //# sourceMappingURL=CfgMeasure.d.ts.map