@configura/web-api 1.6.0-iotest.2 → 1.6.0-rc.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.
- package/.eslintrc.json +18 -0
- package/LICENSE +201 -201
- package/README.md +1 -1
- package/dist/CatalogueAPI.d.ts +507 -511
- package/dist/CatalogueAPI.js +280 -273
- package/dist/CfgMeasure.d.ts +32 -32
- package/dist/CfgMeasure.js +30 -30
- package/dist/CfgProduct.d.ts +253 -244
- package/dist/CfgProduct.js +733 -674
- package/dist/index.d.ts +20 -22
- package/dist/index.js +20 -22
- package/dist/material/CfgMaterialMapping.d.ts +7 -7
- package/dist/material/CfgMaterialMapping.js +181 -181
- package/dist/material/CfgMtrlApplication.d.ts +18 -18
- package/dist/material/CfgMtrlApplication.js +43 -43
- package/dist/material/CfgMtrlApplicationSource.d.ts +7 -7
- package/dist/material/CfgMtrlApplicationSource.js +8 -8
- package/dist/material/CfgMtrlSource.d.ts +19 -19
- package/dist/material/CfgMtrlSource.js +40 -40
- package/dist/material/CfgMtrlSourceWithMetaData.d.ts +7 -7
- package/dist/material/CfgMtrlSourceWithMetaData.js +1 -1
- package/dist/productConfiguration/CfgFeature.d.ts +188 -178
- package/dist/productConfiguration/CfgFeature.js +636 -611
- package/dist/productConfiguration/CfgOption.d.ts +150 -128
- package/dist/productConfiguration/CfgOption.js +426 -394
- package/dist/productConfiguration/CfgProductConfiguration.d.ts +120 -121
- package/dist/productConfiguration/CfgProductConfiguration.js +309 -306
- package/dist/productConfiguration/filters.d.ts +15 -15
- package/dist/productConfiguration/filters.js +70 -67
- package/dist/productConfiguration/productParamsGenerator.d.ts +15 -15
- package/dist/productConfiguration/productParamsGenerator.js +51 -51
- package/dist/productConfiguration/utilitiesProductConfiguration.d.ts +17 -17
- package/dist/productConfiguration/utilitiesProductConfiguration.js +80 -80
- package/dist/productLoader.d.ts +33 -33
- package/dist/productLoader.js +49 -49
- package/dist/syncGroups/SyncGroupsApplyMode.d.ts +21 -0
- package/dist/syncGroups/SyncGroupsApplyMode.js +21 -0
- package/dist/syncGroups/SyncGroupsHandler.d.ts +36 -0
- package/dist/syncGroups/SyncGroupsHandler.js +349 -0
- package/dist/syncGroups/SyncGroupsPathHelper.d.ts +27 -0
- package/dist/syncGroups/SyncGroupsPathHelper.js +90 -0
- package/dist/syncGroups/SyncGroupsState.d.ts +26 -0
- package/dist/syncGroups/SyncGroupsState.js +113 -0
- package/dist/syncGroups/SyncGroupsTransaction.d.ts +155 -0
- package/dist/syncGroups/SyncGroupsTransaction.js +576 -0
- package/dist/tasks/TaskHandler.d.ts +78 -78
- package/dist/tasks/TaskHandler.js +276 -265
- package/dist/tasks/formats.d.ts +4 -4
- package/dist/tasks/formats.js +7 -7
- package/dist/tests/testData/collectorForTest.d.ts +73 -73
- package/dist/tests/testData/collectorForTest.js +194 -195
- package/dist/tests/testData/dummyProductForTest.d.ts +4 -4
- package/dist/tests/testData/dummyProductForTest.js +36 -36
- package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.d.ts +11 -32
- package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.js +277 -348
- package/dist/tests/testData/testDataCachedGetProduct.d.ts +5 -5
- package/dist/tests/testData/testDataCachedGetProduct.js +185 -196
- package/dist/tests/testData/testDataCachedPostValidate.d.ts +7 -7
- package/dist/tests/testData/testDataCachedPostValidate.js +183 -183
- package/dist/tests/testData/testDataNoAdditionalProductNoPropagateForTest.d.ts +3 -3
- package/dist/tests/testData/testDataNoAdditionalProductNoPropagateForTest.js +1099 -1099
- package/dist/tests/testData/testDataOptions.d.ts +13 -0
- package/dist/tests/testData/testDataOptions.js +60 -0
- package/dist/tests/testData/testDataProductAggregatedPrice.d.ts +6 -6
- package/dist/tests/testData/testDataProductAggregatedPrice.js +187 -198
- package/dist/tests/testData/testDataUpcharge.d.ts +8 -29
- package/dist/tests/testData/testDataUpcharge.js +119 -151
- package/dist/utilitiesCatalogueData.d.ts +31 -25
- package/dist/utilitiesCatalogueData.js +162 -65
- package/dist/utilitiesCataloguePermission.d.ts +37 -39
- package/dist/utilitiesCataloguePermission.js +80 -84
- package/dist/utilitiesNumericValues.d.ts +24 -24
- package/dist/utilitiesNumericValues.js +109 -109
- package/package.json +3 -3
- package/dist/io/CfgHistoryManager.d.ts +0 -30
- package/dist/io/CfgHistoryManager.js +0 -62
- package/dist/io/CfgHistoryToProdConfConnector.d.ts +0 -10
- package/dist/io/CfgHistoryToProdConfConnector.js +0 -20
- package/dist/io/CfgIOManager.d.ts +0 -29
- package/dist/io/CfgIOManager.js +0 -89
- package/dist/io/CfgIOProdConfConnector.d.ts +0 -33
- package/dist/io/CfgIOProdConfConnector.js +0 -100
- package/dist/io/CfgWindowMessageManager.d.ts +0 -13
- package/dist/io/CfgWindowMessageManager.js +0 -28
- package/dist/io/CfgWindowMessageToProdConfConnector.d.ts +0 -13
- package/dist/io/CfgWindowMessageToProdConfConnector.js +0 -17
package/dist/CatalogueAPI.js
CHANGED
|
@@ -1,273 +1,280 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
}
|
|
1
|
+
// TODO: Fix the linter issue in Tygen and regenerate this file.
|
|
2
|
+
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
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(_fetch = window.fetch.bind(window)) {
|
|
39
|
+
this._fetch = _fetch;
|
|
40
|
+
}
|
|
41
|
+
// For internal use
|
|
42
|
+
_saveAlternativeReferer() {
|
|
43
|
+
if (typeof document === "undefined") {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const parts = new RegExp("^(http[s]?:\\/\\/[^:\\/\\s]+)", "i").exec(document.referrer);
|
|
47
|
+
if (parts !== null) {
|
|
48
|
+
this._alternativeReferer = parts[1];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
hasFeature(feature) {
|
|
52
|
+
return (this.auth !== undefined &&
|
|
53
|
+
this.auth.apiSession.features !== undefined &&
|
|
54
|
+
this.auth.apiSession.features.indexOf(feature) > -1);
|
|
55
|
+
}
|
|
56
|
+
fetch(url, options) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
let response;
|
|
59
|
+
let body;
|
|
60
|
+
let err;
|
|
61
|
+
if (options.method === "POST" && options.body) {
|
|
62
|
+
options.headers["Content-Type"] = "application/json;charset=utf-8";
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
response = yield this._fetch(url, options);
|
|
66
|
+
body = yield response.text();
|
|
67
|
+
const parsed = JSON.parse(body);
|
|
68
|
+
if ("error" in parsed) {
|
|
69
|
+
err = new APIError(parsed.error);
|
|
70
|
+
err.body = body;
|
|
71
|
+
err.status = response.status;
|
|
72
|
+
err.parsed = parsed;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
return parsed;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
catch (e) {
|
|
79
|
+
const msg = e instanceof Error ? e.message : `${e}`;
|
|
80
|
+
err = new APIError(msg);
|
|
81
|
+
err.body = body;
|
|
82
|
+
err.status = response && response.status;
|
|
83
|
+
err.error = e instanceof Error ? e : Error(msg);
|
|
84
|
+
}
|
|
85
|
+
throw err;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
postPublicAccessTokenAuthorize(params, endpoint) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
const url = `/v1/access-token/public/${encodeURIComponent(params.accessTokenId)}/authorize`;
|
|
91
|
+
const options = {
|
|
92
|
+
method: "POST",
|
|
93
|
+
headers: {},
|
|
94
|
+
};
|
|
95
|
+
if (this._alternativeReferer) {
|
|
96
|
+
options.headers["Alternative-Referer"] = this._alternativeReferer;
|
|
97
|
+
}
|
|
98
|
+
return this.fetch(endpoint + url, options);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
getApplicationAreas(params) {
|
|
102
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
103
|
+
if (this.auth === undefined) {
|
|
104
|
+
throw new Error("missing auth");
|
|
105
|
+
}
|
|
106
|
+
const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/application-areas`;
|
|
107
|
+
const options = {
|
|
108
|
+
method: "GET",
|
|
109
|
+
headers: { "X-API-Key": this.auth.secretToken || "" },
|
|
110
|
+
};
|
|
111
|
+
if (this._alternativeReferer) {
|
|
112
|
+
options.headers["Alternative-Referer"] = this._alternativeReferer;
|
|
113
|
+
}
|
|
114
|
+
return this.fetch(this.auth.endpoint + url, options);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
postExport(params, body) {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
if (this.auth === undefined) {
|
|
120
|
+
throw new Error("missing auth");
|
|
121
|
+
}
|
|
122
|
+
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)}`;
|
|
123
|
+
const options = {
|
|
124
|
+
method: "POST",
|
|
125
|
+
headers: { "X-API-Key": this.auth.secretToken || "" },
|
|
126
|
+
body: JSON.stringify(body),
|
|
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
|
+
getPriceLists(params) {
|
|
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)}/price-lists`;
|
|
140
|
+
const options = {
|
|
141
|
+
method: "GET",
|
|
142
|
+
headers: { "X-API-Key": this.auth.secretToken || "" },
|
|
143
|
+
};
|
|
144
|
+
if (this._alternativeReferer) {
|
|
145
|
+
options.headers["Alternative-Referer"] = this._alternativeReferer;
|
|
146
|
+
}
|
|
147
|
+
return this.fetch(this.auth.endpoint + url, options);
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
getProduct(params) {
|
|
151
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
152
|
+
if (this.auth === undefined) {
|
|
153
|
+
throw new Error("missing auth");
|
|
154
|
+
}
|
|
155
|
+
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)}`;
|
|
156
|
+
const options = {
|
|
157
|
+
method: "GET",
|
|
158
|
+
headers: { "X-API-Key": this.auth.secretToken || "" },
|
|
159
|
+
};
|
|
160
|
+
if (this._alternativeReferer) {
|
|
161
|
+
options.headers["Alternative-Referer"] = this._alternativeReferer;
|
|
162
|
+
}
|
|
163
|
+
return this.fetch(this.auth.endpoint + url, options);
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
postRender(params, body) {
|
|
167
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
168
|
+
if (this.auth === undefined) {
|
|
169
|
+
throw new Error("missing auth");
|
|
170
|
+
}
|
|
171
|
+
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`;
|
|
172
|
+
const options = {
|
|
173
|
+
method: "POST",
|
|
174
|
+
headers: { "X-API-Key": this.auth.secretToken || "" },
|
|
175
|
+
body: JSON.stringify(body),
|
|
176
|
+
};
|
|
177
|
+
if (this._alternativeReferer) {
|
|
178
|
+
options.headers["Alternative-Referer"] = this._alternativeReferer;
|
|
179
|
+
}
|
|
180
|
+
return this.fetch(this.auth.endpoint + url, options);
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
postValidate(params, body) {
|
|
184
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
185
|
+
if (this.auth === undefined) {
|
|
186
|
+
throw new Error("missing auth");
|
|
187
|
+
}
|
|
188
|
+
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`;
|
|
189
|
+
const options = {
|
|
190
|
+
method: "POST",
|
|
191
|
+
headers: { "X-API-Key": this.auth.secretToken || "" },
|
|
192
|
+
body: JSON.stringify(body),
|
|
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
|
+
getTocTree(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/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/toc`;
|
|
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
|
+
getTocFlat(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/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/toc/flat`;
|
|
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
|
+
getExportById(params) {
|
|
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/export/${encodeURIComponent(params.uuid)}`;
|
|
238
|
+
const options = {
|
|
239
|
+
method: "GET",
|
|
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
|
+
getRenderById(params) {
|
|
249
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
250
|
+
if (this.auth === undefined) {
|
|
251
|
+
throw new Error("missing auth");
|
|
252
|
+
}
|
|
253
|
+
const url = `/v1/render/${encodeURIComponent(params.uuid)}`;
|
|
254
|
+
const options = {
|
|
255
|
+
method: "GET",
|
|
256
|
+
headers: { "X-API-Key": this.auth.secretToken || "" },
|
|
257
|
+
};
|
|
258
|
+
if (this._alternativeReferer) {
|
|
259
|
+
options.headers["Alternative-Referer"] = this._alternativeReferer;
|
|
260
|
+
}
|
|
261
|
+
return this.fetch(this.auth.endpoint + url, options);
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
postSessionTokenRefresh() {
|
|
265
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
266
|
+
if (this.auth === undefined) {
|
|
267
|
+
throw new Error("missing auth");
|
|
268
|
+
}
|
|
269
|
+
const url = `/v1/session-token/refresh`;
|
|
270
|
+
const options = {
|
|
271
|
+
method: "POST",
|
|
272
|
+
headers: { "X-API-Key": this.auth.secretToken || "" },
|
|
273
|
+
};
|
|
274
|
+
if (this._alternativeReferer) {
|
|
275
|
+
options.headers["Alternative-Referer"] = this._alternativeReferer;
|
|
276
|
+
}
|
|
277
|
+
return this.fetch(this.auth.endpoint + url, options);
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
}
|
package/dist/CfgMeasure.d.ts
CHANGED
|
@@ -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
|