@configura/web-api 1.4.0-alpha.4 → 1.4.0

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 (57) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +1 -1
  3. package/dist/CatalogueAPI.d.ts +504 -504
  4. package/dist/CatalogueAPI.js +248 -248
  5. package/dist/CfgMeasure.d.ts +32 -32
  6. package/dist/CfgMeasure.js +30 -30
  7. package/dist/CfgProduct.d.ts +217 -217
  8. package/dist/CfgProduct.js +636 -636
  9. package/dist/index.d.ts +16 -16
  10. package/dist/index.js +16 -16
  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 +160 -160
  22. package/dist/productConfiguration/CfgFeature.js +593 -593
  23. package/dist/productConfiguration/CfgOption.d.ts +128 -128
  24. package/dist/productConfiguration/CfgOption.js +394 -394
  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 +67 -67
  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/tests/testData/collectorForTest.d.ts +73 -73
  36. package/dist/tests/testData/collectorForTest.js +195 -195
  37. package/dist/tests/testData/dummyProductForTest.d.ts +4 -4
  38. package/dist/tests/testData/dummyProductForTest.js +36 -36
  39. package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.d.ts +32 -32
  40. package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.js +348 -348
  41. package/dist/tests/testData/testDataCachedGetProduct.d.ts +5 -5
  42. package/dist/tests/testData/testDataCachedGetProduct.js +196 -196
  43. package/dist/tests/testData/testDataCachedPostValidate.d.ts +7 -7
  44. package/dist/tests/testData/testDataCachedPostValidate.js +183 -183
  45. package/dist/tests/testData/testDataNoAdditionalProductNoPropagateForTest.d.ts +3 -3
  46. package/dist/tests/testData/testDataNoAdditionalProductNoPropagateForTest.js +1099 -1099
  47. package/dist/tests/testData/testDataProductAggregatedPrice.d.ts +6 -6
  48. package/dist/tests/testData/testDataProductAggregatedPrice.js +198 -198
  49. package/dist/tests/testData/testDataUpcharge.d.ts +29 -29
  50. package/dist/tests/testData/testDataUpcharge.js +151 -151
  51. package/dist/utilitiesCatalogueData.d.ts +25 -25
  52. package/dist/utilitiesCatalogueData.js +64 -64
  53. package/dist/utilitiesCataloguePermission.d.ts +39 -39
  54. package/dist/utilitiesCataloguePermission.js +84 -84
  55. package/dist/utilitiesNumericValues.d.ts +24 -24
  56. package/dist/utilitiesNumericValues.js +109 -109
  57. package/package.json +3 -3
@@ -1,248 +1,248 @@
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 class APIError extends Error {
13
- }
14
- export class CatalogueAPI {
15
- constructor() {
16
- const parts = new RegExp("^(http[s]?:\\/\\/[^:\\/\\s]+)", "i").exec(document.referrer);
17
- if (parts !== null) {
18
- this._alternativeReferer = parts[1];
19
- }
20
- }
21
- hasFeature(feature) {
22
- return this.auth !== undefined && this.auth.apiSession.features !== undefined && this.auth.apiSession.features.indexOf(feature) > -1;
23
- }
24
- fetch(url, options) {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- let response;
27
- let body;
28
- let err;
29
- if (options.method === "POST" && options.body) {
30
- options.headers["Content-Type"] = "application/json;charset=utf-8";
31
- }
32
- try {
33
- response = yield fetch(url, options);
34
- body = yield response.text();
35
- const parsed = JSON.parse(body);
36
- if ("error" in parsed) {
37
- err = new APIError(parsed.error);
38
- err.body = body;
39
- err.status = response.status;
40
- err.parsed = parsed;
41
- }
42
- else {
43
- return parsed;
44
- }
45
- }
46
- catch (e) {
47
- const msg = e instanceof Error ? e.message : `${e}`;
48
- err = new APIError(msg);
49
- err.body = body;
50
- err.status = response && response.status;
51
- err.error = e instanceof Error ? e : Error(msg);
52
- }
53
- throw err;
54
- });
55
- }
56
- postPublicAccessTokenAuthorize(params, endpoint) {
57
- return __awaiter(this, void 0, void 0, function* () {
58
- const url = `/v1/access-token/public/${encodeURIComponent(params.accessTokenId)}/authorize`;
59
- const options = {
60
- method: "POST",
61
- headers: {},
62
- };
63
- if (this._alternativeReferer) {
64
- options.headers["Alternative-Referer"] = this._alternativeReferer;
65
- }
66
- return this.fetch(endpoint + url, options);
67
- });
68
- }
69
- getApplicationAreas(params) {
70
- return __awaiter(this, void 0, void 0, function* () {
71
- if (this.auth === undefined) {
72
- throw new Error("missing auth");
73
- }
74
- const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/application-areas`;
75
- const options = {
76
- method: "GET",
77
- headers: { "X-API-Key": this.auth.secretToken || "" },
78
- };
79
- if (this._alternativeReferer) {
80
- options.headers["Alternative-Referer"] = this._alternativeReferer;
81
- }
82
- return this.fetch(this.auth.endpoint + url, options);
83
- });
84
- }
85
- postExport(params, body) {
86
- return __awaiter(this, void 0, void 0, function* () {
87
- if (this.auth === undefined) {
88
- throw new Error("missing auth");
89
- }
90
- 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)}`;
91
- const options = {
92
- method: "POST",
93
- headers: { "X-API-Key": this.auth.secretToken || "" },
94
- body: JSON.stringify(body),
95
- };
96
- if (this._alternativeReferer) {
97
- options.headers["Alternative-Referer"] = this._alternativeReferer;
98
- }
99
- return this.fetch(this.auth.endpoint + url, options);
100
- });
101
- }
102
- getPriceLists(params) {
103
- return __awaiter(this, void 0, void 0, function* () {
104
- if (this.auth === undefined) {
105
- throw new Error("missing auth");
106
- }
107
- const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/price-lists`;
108
- const options = {
109
- method: "GET",
110
- headers: { "X-API-Key": this.auth.secretToken || "" },
111
- };
112
- if (this._alternativeReferer) {
113
- options.headers["Alternative-Referer"] = this._alternativeReferer;
114
- }
115
- return this.fetch(this.auth.endpoint + url, options);
116
- });
117
- }
118
- getProduct(params) {
119
- return __awaiter(this, void 0, void 0, function* () {
120
- if (this.auth === undefined) {
121
- throw new Error("missing auth");
122
- }
123
- 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)}`;
124
- const options = {
125
- method: "GET",
126
- headers: { "X-API-Key": this.auth.secretToken || "" },
127
- };
128
- if (this._alternativeReferer) {
129
- options.headers["Alternative-Referer"] = this._alternativeReferer;
130
- }
131
- return this.fetch(this.auth.endpoint + url, options);
132
- });
133
- }
134
- postRender(params, body) {
135
- return __awaiter(this, void 0, void 0, function* () {
136
- if (this.auth === undefined) {
137
- throw new Error("missing auth");
138
- }
139
- 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`;
140
- const options = {
141
- method: "POST",
142
- headers: { "X-API-Key": this.auth.secretToken || "" },
143
- body: JSON.stringify(body),
144
- };
145
- if (this._alternativeReferer) {
146
- options.headers["Alternative-Referer"] = this._alternativeReferer;
147
- }
148
- return this.fetch(this.auth.endpoint + url, options);
149
- });
150
- }
151
- postValidate(params, body) {
152
- return __awaiter(this, void 0, void 0, function* () {
153
- if (this.auth === undefined) {
154
- throw new Error("missing auth");
155
- }
156
- 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`;
157
- const options = {
158
- method: "POST",
159
- headers: { "X-API-Key": this.auth.secretToken || "" },
160
- body: JSON.stringify(body),
161
- };
162
- if (this._alternativeReferer) {
163
- options.headers["Alternative-Referer"] = this._alternativeReferer;
164
- }
165
- return this.fetch(this.auth.endpoint + url, options);
166
- });
167
- }
168
- getTocTree(params) {
169
- return __awaiter(this, void 0, void 0, function* () {
170
- if (this.auth === undefined) {
171
- throw new Error("missing auth");
172
- }
173
- const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/toc`;
174
- const options = {
175
- method: "GET",
176
- headers: { "X-API-Key": this.auth.secretToken || "" },
177
- };
178
- if (this._alternativeReferer) {
179
- options.headers["Alternative-Referer"] = this._alternativeReferer;
180
- }
181
- return this.fetch(this.auth.endpoint + url, options);
182
- });
183
- }
184
- getTocFlat(params) {
185
- return __awaiter(this, void 0, void 0, function* () {
186
- if (this.auth === undefined) {
187
- throw new Error("missing auth");
188
- }
189
- const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/toc/flat`;
190
- const options = {
191
- method: "GET",
192
- headers: { "X-API-Key": this.auth.secretToken || "" },
193
- };
194
- if (this._alternativeReferer) {
195
- options.headers["Alternative-Referer"] = this._alternativeReferer;
196
- }
197
- return this.fetch(this.auth.endpoint + url, options);
198
- });
199
- }
200
- getExportById(params) {
201
- return __awaiter(this, void 0, void 0, function* () {
202
- if (this.auth === undefined) {
203
- throw new Error("missing auth");
204
- }
205
- const url = `/v1/export/${encodeURIComponent(params.uuid)}`;
206
- const options = {
207
- method: "GET",
208
- headers: { "X-API-Key": this.auth.secretToken || "" },
209
- };
210
- if (this._alternativeReferer) {
211
- options.headers["Alternative-Referer"] = this._alternativeReferer;
212
- }
213
- return this.fetch(this.auth.endpoint + url, options);
214
- });
215
- }
216
- getRenderById(params) {
217
- return __awaiter(this, void 0, void 0, function* () {
218
- if (this.auth === undefined) {
219
- throw new Error("missing auth");
220
- }
221
- const url = `/v1/render/${encodeURIComponent(params.uuid)}`;
222
- const options = {
223
- method: "GET",
224
- headers: { "X-API-Key": this.auth.secretToken || "" },
225
- };
226
- if (this._alternativeReferer) {
227
- options.headers["Alternative-Referer"] = this._alternativeReferer;
228
- }
229
- return this.fetch(this.auth.endpoint + url, options);
230
- });
231
- }
232
- postSessionTokenRefresh() {
233
- return __awaiter(this, void 0, void 0, function* () {
234
- if (this.auth === undefined) {
235
- throw new Error("missing auth");
236
- }
237
- const url = `/v1/session-token/refresh`;
238
- const options = {
239
- method: "POST",
240
- headers: { "X-API-Key": this.auth.secretToken || "" },
241
- };
242
- if (this._alternativeReferer) {
243
- options.headers["Alternative-Referer"] = this._alternativeReferer;
244
- }
245
- return this.fetch(this.auth.endpoint + url, options);
246
- });
247
- }
248
- }
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 class APIError extends Error {
13
+ }
14
+ export class CatalogueAPI {
15
+ constructor() {
16
+ const parts = new RegExp("^(http[s]?:\\/\\/[^:\\/\\s]+)", "i").exec(document.referrer);
17
+ if (parts !== null) {
18
+ this._alternativeReferer = parts[1];
19
+ }
20
+ }
21
+ hasFeature(feature) {
22
+ return this.auth !== undefined && this.auth.apiSession.features !== undefined && this.auth.apiSession.features.indexOf(feature) > -1;
23
+ }
24
+ fetch(url, options) {
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ let response;
27
+ let body;
28
+ let err;
29
+ if (options.method === "POST" && options.body) {
30
+ options.headers["Content-Type"] = "application/json;charset=utf-8";
31
+ }
32
+ try {
33
+ response = yield fetch(url, options);
34
+ body = yield response.text();
35
+ const parsed = JSON.parse(body);
36
+ if ("error" in parsed) {
37
+ err = new APIError(parsed.error);
38
+ err.body = body;
39
+ err.status = response.status;
40
+ err.parsed = parsed;
41
+ }
42
+ else {
43
+ return parsed;
44
+ }
45
+ }
46
+ catch (e) {
47
+ const msg = e instanceof Error ? e.message : `${e}`;
48
+ err = new APIError(msg);
49
+ err.body = body;
50
+ err.status = response && response.status;
51
+ err.error = e instanceof Error ? e : Error(msg);
52
+ }
53
+ throw err;
54
+ });
55
+ }
56
+ postPublicAccessTokenAuthorize(params, endpoint) {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ const url = `/v1/access-token/public/${encodeURIComponent(params.accessTokenId)}/authorize`;
59
+ const options = {
60
+ method: "POST",
61
+ headers: {},
62
+ };
63
+ if (this._alternativeReferer) {
64
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
65
+ }
66
+ return this.fetch(endpoint + url, options);
67
+ });
68
+ }
69
+ getApplicationAreas(params) {
70
+ return __awaiter(this, void 0, void 0, function* () {
71
+ if (this.auth === undefined) {
72
+ throw new Error("missing auth");
73
+ }
74
+ const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/application-areas`;
75
+ const options = {
76
+ method: "GET",
77
+ headers: { "X-API-Key": this.auth.secretToken || "" },
78
+ };
79
+ if (this._alternativeReferer) {
80
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
81
+ }
82
+ return this.fetch(this.auth.endpoint + url, options);
83
+ });
84
+ }
85
+ postExport(params, body) {
86
+ return __awaiter(this, void 0, void 0, function* () {
87
+ if (this.auth === undefined) {
88
+ throw new Error("missing auth");
89
+ }
90
+ 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)}`;
91
+ const options = {
92
+ method: "POST",
93
+ headers: { "X-API-Key": this.auth.secretToken || "" },
94
+ body: JSON.stringify(body),
95
+ };
96
+ if (this._alternativeReferer) {
97
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
98
+ }
99
+ return this.fetch(this.auth.endpoint + url, options);
100
+ });
101
+ }
102
+ getPriceLists(params) {
103
+ return __awaiter(this, void 0, void 0, function* () {
104
+ if (this.auth === undefined) {
105
+ throw new Error("missing auth");
106
+ }
107
+ const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/price-lists`;
108
+ const options = {
109
+ method: "GET",
110
+ headers: { "X-API-Key": this.auth.secretToken || "" },
111
+ };
112
+ if (this._alternativeReferer) {
113
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
114
+ }
115
+ return this.fetch(this.auth.endpoint + url, options);
116
+ });
117
+ }
118
+ getProduct(params) {
119
+ return __awaiter(this, void 0, void 0, function* () {
120
+ if (this.auth === undefined) {
121
+ throw new Error("missing auth");
122
+ }
123
+ 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)}`;
124
+ const options = {
125
+ method: "GET",
126
+ headers: { "X-API-Key": this.auth.secretToken || "" },
127
+ };
128
+ if (this._alternativeReferer) {
129
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
130
+ }
131
+ return this.fetch(this.auth.endpoint + url, options);
132
+ });
133
+ }
134
+ postRender(params, body) {
135
+ return __awaiter(this, void 0, void 0, function* () {
136
+ if (this.auth === undefined) {
137
+ throw new Error("missing auth");
138
+ }
139
+ 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`;
140
+ const options = {
141
+ method: "POST",
142
+ headers: { "X-API-Key": this.auth.secretToken || "" },
143
+ body: JSON.stringify(body),
144
+ };
145
+ if (this._alternativeReferer) {
146
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
147
+ }
148
+ return this.fetch(this.auth.endpoint + url, options);
149
+ });
150
+ }
151
+ postValidate(params, body) {
152
+ return __awaiter(this, void 0, void 0, function* () {
153
+ if (this.auth === undefined) {
154
+ throw new Error("missing auth");
155
+ }
156
+ 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`;
157
+ const options = {
158
+ method: "POST",
159
+ headers: { "X-API-Key": this.auth.secretToken || "" },
160
+ body: JSON.stringify(body),
161
+ };
162
+ if (this._alternativeReferer) {
163
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
164
+ }
165
+ return this.fetch(this.auth.endpoint + url, options);
166
+ });
167
+ }
168
+ getTocTree(params) {
169
+ return __awaiter(this, void 0, void 0, function* () {
170
+ if (this.auth === undefined) {
171
+ throw new Error("missing auth");
172
+ }
173
+ const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/toc`;
174
+ const options = {
175
+ method: "GET",
176
+ headers: { "X-API-Key": this.auth.secretToken || "" },
177
+ };
178
+ if (this._alternativeReferer) {
179
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
180
+ }
181
+ return this.fetch(this.auth.endpoint + url, options);
182
+ });
183
+ }
184
+ getTocFlat(params) {
185
+ return __awaiter(this, void 0, void 0, function* () {
186
+ if (this.auth === undefined) {
187
+ throw new Error("missing auth");
188
+ }
189
+ const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/toc/flat`;
190
+ const options = {
191
+ method: "GET",
192
+ headers: { "X-API-Key": this.auth.secretToken || "" },
193
+ };
194
+ if (this._alternativeReferer) {
195
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
196
+ }
197
+ return this.fetch(this.auth.endpoint + url, options);
198
+ });
199
+ }
200
+ getExportById(params) {
201
+ return __awaiter(this, void 0, void 0, function* () {
202
+ if (this.auth === undefined) {
203
+ throw new Error("missing auth");
204
+ }
205
+ const url = `/v1/export/${encodeURIComponent(params.uuid)}`;
206
+ const options = {
207
+ method: "GET",
208
+ headers: { "X-API-Key": this.auth.secretToken || "" },
209
+ };
210
+ if (this._alternativeReferer) {
211
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
212
+ }
213
+ return this.fetch(this.auth.endpoint + url, options);
214
+ });
215
+ }
216
+ getRenderById(params) {
217
+ return __awaiter(this, void 0, void 0, function* () {
218
+ if (this.auth === undefined) {
219
+ throw new Error("missing auth");
220
+ }
221
+ const url = `/v1/render/${encodeURIComponent(params.uuid)}`;
222
+ const options = {
223
+ method: "GET",
224
+ headers: { "X-API-Key": this.auth.secretToken || "" },
225
+ };
226
+ if (this._alternativeReferer) {
227
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
228
+ }
229
+ return this.fetch(this.auth.endpoint + url, options);
230
+ });
231
+ }
232
+ postSessionTokenRefresh() {
233
+ return __awaiter(this, void 0, void 0, function* () {
234
+ if (this.auth === undefined) {
235
+ throw new Error("missing auth");
236
+ }
237
+ const url = `/v1/session-token/refresh`;
238
+ const options = {
239
+ method: "POST",
240
+ headers: { "X-API-Key": this.auth.secretToken || "" },
241
+ };
242
+ if (this._alternativeReferer) {
243
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
244
+ }
245
+ return this.fetch(this.auth.endpoint + url, options);
246
+ });
247
+ }
248
+ }
@@ -1,33 +1,33 @@
1
- import { Measurement, ValueWithUnit } from "./CatalogueAPI";
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. Measurments 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";
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. Measurments 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
@@ -1,30 +1,30 @@
1
- /**
2
- * This class strips the Measurement of things that are not actually used or relevant
3
- * to Stage, specifically anchoring and stretching. Measurments can also contain
4
- * volume and area, but these are ignored. Here Measures are used to define defaults
5
- * such as its preferences when dealing with ambiguity or its default value.
6
- */
7
- export class CfgMeasureDefinition {
8
- constructor(measureParamCode, numericValue, measurePriorities) {
9
- this.measureParamCode = measureParamCode;
10
- this.numericValue = numericValue;
11
- this.measurePriorities = measurePriorities;
12
- }
13
- static make(measurement) {
14
- // The measurement.code seems to be used in CET to connect the value to
15
- // pre-existing fields in the product, such as width, height and depth.
16
- // We however only use this for anchoring and stretching and so it is the
17
- // code of the measureParam that is relevant. Hence Measurements with no
18
- // measureParam are ignored.
19
- var _a;
20
- const measureParam = measurement.measureParam;
21
- if (measureParam === undefined) {
22
- return undefined;
23
- }
24
- const code = measureParam.code;
25
- return new this(code, measurement.numericValue, ((_a = measureParam.measurePriority) !== null && _a !== void 0 ? _a : []).map((p, index) => ({
26
- modelLocalFilePath: p.url,
27
- index,
28
- })));
29
- }
30
- }
1
+ /**
2
+ * This class strips the Measurement of things that are not actually used or relevant
3
+ * to Stage, specifically anchoring and stretching. Measurments can also contain
4
+ * volume and area, but these are ignored. Here Measures are used to define defaults
5
+ * such as its preferences when dealing with ambiguity or its default value.
6
+ */
7
+ export class CfgMeasureDefinition {
8
+ constructor(measureParamCode, numericValue, measurePriorities) {
9
+ this.measureParamCode = measureParamCode;
10
+ this.numericValue = numericValue;
11
+ this.measurePriorities = measurePriorities;
12
+ }
13
+ static make(measurement) {
14
+ // The measurement.code seems to be used in CET to connect the value to
15
+ // pre-existing fields in the product, such as width, height and depth.
16
+ // We however only use this for anchoring and stretching and so it is the
17
+ // code of the measureParam that is relevant. Hence Measurements with no
18
+ // measureParam are ignored.
19
+ var _a;
20
+ const measureParam = measurement.measureParam;
21
+ if (measureParam === undefined) {
22
+ return undefined;
23
+ }
24
+ const code = measureParam.code;
25
+ return new this(code, measurement.numericValue, ((_a = measureParam.measurePriority) !== null && _a !== void 0 ? _a : []).map((p, index) => ({
26
+ modelLocalFilePath: p.url,
27
+ index,
28
+ })));
29
+ }
30
+ }