@configura/web-api 2.1.0-alpha.2 → 2.2.0-alpha.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/dist/CatalogueAPI.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export interface DtoApplicationAreasResponse {
|
|
|
32
32
|
applicationAreas: Array<DtoApplicationArea>;
|
|
33
33
|
uuid: string;
|
|
34
34
|
}
|
|
35
|
-
/** AuthorizeResponse */
|
|
35
|
+
/** AuthorizeResponse - The response to an authorize request. It contains an endpoint, a session token and an API session. The endpoint is the URL to access the API. The secret token is used to validate each request to the API. The API session contains information about the user's catalogue access. */
|
|
36
36
|
export interface DtoAuthorizeResponse {
|
|
37
37
|
endpoint: string;
|
|
38
38
|
secretToken: string;
|
|
@@ -466,7 +466,7 @@ export interface DtoProductResponse {
|
|
|
466
466
|
uuid: string;
|
|
467
467
|
notes?: Array<DtoNote>;
|
|
468
468
|
}
|
|
469
|
-
/** RefreshSessionTokenResponse */
|
|
469
|
+
/** RefreshSessionTokenResponse - The response to a refresh session token request. It contains a new API session. */
|
|
470
470
|
export interface DtoRefreshSessionTokenResponse {
|
|
471
471
|
apiSession: DtoCatalogueAPISession;
|
|
472
472
|
}
|
package/dist/CatalogueAPI.js
CHANGED
|
@@ -9,29 +9,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
|
-
export const dtoExportFormatNames = [
|
|
13
|
-
|
|
14
|
-
"gltf",
|
|
15
|
-
"fbx",
|
|
16
|
-
"dwg",
|
|
17
|
-
"cmdrw",
|
|
18
|
-
"cmfav",
|
|
19
|
-
"cmsym",
|
|
20
|
-
];
|
|
21
|
-
export const dtoExportStatusStatusNames = [
|
|
22
|
-
"pending",
|
|
23
|
-
"running",
|
|
24
|
-
"finished",
|
|
25
|
-
"failed",
|
|
26
|
-
];
|
|
12
|
+
export const dtoExportFormatNames = ["glb", "gltf", "fbx", "dwg", "cmdrw", "cmfav", "cmsym"];
|
|
13
|
+
export const dtoExportStatusStatusNames = ["pending", "running", "finished", "failed"];
|
|
27
14
|
export const dtoNoteSeverityNames = ["Information", "Critical", "Warning"];
|
|
28
15
|
export const dtoRenderFormatNames = ["jpg", "png"];
|
|
29
|
-
export const dtoRenderStatusStatusNames = [
|
|
30
|
-
"pending",
|
|
31
|
-
"running",
|
|
32
|
-
"finished",
|
|
33
|
-
"failed",
|
|
34
|
-
];
|
|
16
|
+
export const dtoRenderStatusStatusNames = ["pending", "running", "finished", "failed"];
|
|
35
17
|
export const dtoSyncGroupMethodsNames = ["pull", "push", "twoWay"];
|
|
36
18
|
export class DtoAPIError extends Error {
|
|
37
19
|
}
|
|
@@ -50,9 +32,7 @@ export class CatalogueAPI {
|
|
|
50
32
|
}
|
|
51
33
|
}
|
|
52
34
|
hasFeature(feature) {
|
|
53
|
-
return
|
|
54
|
-
this.auth.apiSession.features !== undefined &&
|
|
55
|
-
this.auth.apiSession.features.indexOf(feature) > -1);
|
|
35
|
+
return this.auth !== undefined && this.auth.apiSession.features !== undefined && this.auth.apiSession.features.indexOf(feature) > -1;
|
|
56
36
|
}
|
|
57
37
|
fetch(url, options) {
|
|
58
38
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -66,7 +46,7 @@ export class CatalogueAPI {
|
|
|
66
46
|
response = yield this._fetch(url, options);
|
|
67
47
|
body = yield response.text();
|
|
68
48
|
const parsed = JSON.parse(body);
|
|
69
|
-
if ("error" in parsed) {
|
|
49
|
+
if (parsed && typeof parsed === "object" && "error" in parsed) {
|
|
70
50
|
err = new DtoAPIError(parsed.error);
|
|
71
51
|
err.body = body;
|
|
72
52
|
err.status = response.status;
|
package/dist/CfgProduct.js
CHANGED
|
@@ -7,6 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
var _a;
|
|
10
11
|
import { AggregatedLoadingObservable, assert, assertDefined, augmentErrorMessage, compareArrays, count, Observable, toLengthUnit, } from "@configura/web-utilities";
|
|
11
12
|
import { CfgMeasureDefinition } from "./CfgMeasure.js";
|
|
12
13
|
import { ProductConfigurationBubbleMode } from "./productConfiguration/CfgOption.js";
|
|
@@ -17,9 +18,9 @@ import { SyncGroupsHandler } from "./syncGroups/SyncGroupsHandler.js";
|
|
|
17
18
|
import { compareCfgProductData, correctDefaultsOnCatalogueParams, isSameCatalogueParams, isSameProductRef, makeProductKey, } from "./utilitiesCatalogueData.js";
|
|
18
19
|
import { CfgProdConfParts, convertDtoProductConfToV1, isAdditionalProductConfiguration, isProductConf, } from "./utilitiesConfiguration.js";
|
|
19
20
|
function completeSettings(incompleteSettings) {
|
|
20
|
-
var
|
|
21
|
+
var _b;
|
|
21
22
|
return {
|
|
22
|
-
strictSelectOneSelectionCount: (
|
|
23
|
+
strictSelectOneSelectionCount: (_b = incompleteSettings === null || incompleteSettings === void 0 ? void 0 : incompleteSettings.strictSelectOneSelectionCount) !== null && _b !== void 0 ? _b : false,
|
|
23
24
|
syncGroupsApplyMode: incompleteSettings === null || incompleteSettings === void 0 ? void 0 : incompleteSettings.syncGroupsApplyMode,
|
|
24
25
|
};
|
|
25
26
|
}
|
|
@@ -53,7 +54,7 @@ function isDescriptionMatch(l, r) {
|
|
|
53
54
|
*/
|
|
54
55
|
export class _CfgProductInternal {
|
|
55
56
|
constructor(initSuccess, initFail, _productLoaderRaw, prodParams, settings, optional, selected, rootFeatureRefs, rawFeatures, notes, uuid, _rawUnit, _rawProductData, apiSelection, apiConstraints, loadingObservable, parent, root, _additionalProductRef, _syncGroupHandler) {
|
|
56
|
-
var
|
|
57
|
+
var _b;
|
|
57
58
|
this._productLoaderRaw = _productLoaderRaw;
|
|
58
59
|
this.prodParams = prodParams;
|
|
59
60
|
this.settings = settings;
|
|
@@ -70,11 +71,11 @@ export class _CfgProductInternal {
|
|
|
70
71
|
this.changeObservable = new Observable();
|
|
71
72
|
/** Mark this and its descendants as destroyed and remove all listeners */
|
|
72
73
|
this.destroy = () => {
|
|
73
|
-
var
|
|
74
|
+
var _b;
|
|
74
75
|
this._destroyed = true;
|
|
75
76
|
this.changeObservable.stopAllListen();
|
|
76
77
|
this.configuration.stopAllListenForChange();
|
|
77
|
-
for (const additionalProduct of (
|
|
78
|
+
for (const additionalProduct of (_b = this.additionalProducts) !== null && _b !== void 0 ? _b : []) {
|
|
78
79
|
additionalProduct.destroy();
|
|
79
80
|
}
|
|
80
81
|
};
|
|
@@ -152,7 +153,7 @@ export class _CfgProductInternal {
|
|
|
152
153
|
}
|
|
153
154
|
});
|
|
154
155
|
this.getDtoConf = (include) => {
|
|
155
|
-
var
|
|
156
|
+
var _b;
|
|
156
157
|
const conf = {};
|
|
157
158
|
const features = this.configuration._internal.getDtoConf((include & CfgProdConfParts.ExtendedData) === CfgProdConfParts.ExtendedData);
|
|
158
159
|
if (0 < features.length) {
|
|
@@ -166,7 +167,7 @@ export class _CfgProductInternal {
|
|
|
166
167
|
// so no need to store it for additional products.
|
|
167
168
|
if ((include & CfgProdConfParts.SyncGroupState) === CfgProdConfParts.SyncGroupState &&
|
|
168
169
|
this.parent === undefined) {
|
|
169
|
-
conf.syncGroupState = (
|
|
170
|
+
conf.syncGroupState = (_b = this.syncGroupHandler) === null || _b === void 0 ? void 0 : _b.getCompactSyncGroupState();
|
|
170
171
|
}
|
|
171
172
|
const additionalProducts = this.additionalProducts;
|
|
172
173
|
if (0 < additionalProducts.length) {
|
|
@@ -256,7 +257,7 @@ export class _CfgProductInternal {
|
|
|
256
257
|
assert(!sourceProductAdditionalProducts ||
|
|
257
258
|
additionalProductsCount === sourceProductAdditionalProducts.length, `Passed sourceProduct does not have the same number of additional products as this.`);
|
|
258
259
|
if ((yield Promise.all(apiSelectionAdditionalProducts.map((apiSelectionAdditionalProduct) => __awaiter(this, void 0, void 0, function* () {
|
|
259
|
-
var
|
|
260
|
+
var _c;
|
|
260
261
|
const refKey = apiSelectionAdditionalProduct.refKey;
|
|
261
262
|
assertDefined(refKey, "Additional product api configurations must have refKey.");
|
|
262
263
|
const i = additionalProducts.findIndex((a) => refKey === a.refKey);
|
|
@@ -264,7 +265,7 @@ export class _CfgProductInternal {
|
|
|
264
265
|
let sourceProductAdditionalProduct = undefined;
|
|
265
266
|
if (sourceProductAdditionalProducts !== undefined) {
|
|
266
267
|
sourceProductAdditionalProduct =
|
|
267
|
-
(
|
|
268
|
+
(_c = sourceProductAdditionalProducts.find((a) => refKey === a.refKey)) === null || _c === void 0 ? void 0 : _c._internal;
|
|
268
269
|
assertDefined(sourceProductAdditionalProduct, "Additional product not found in sourceProduct");
|
|
269
270
|
}
|
|
270
271
|
const additionalProduct = additionalProducts.splice(i, 1)[0]; // Splicing like this is okay because this is done synchronous. The setCon. is what is async.
|
|
@@ -454,10 +455,10 @@ export class _CfgProductInternal {
|
|
|
454
455
|
change = true;
|
|
455
456
|
}
|
|
456
457
|
const newAdditionalProducts = yield Promise.all(additionalProductRefs.map((p) => (() => __awaiter(this, void 0, void 0, function* () {
|
|
457
|
-
var
|
|
458
|
+
var _d;
|
|
458
459
|
const additionalProductRef = p.prodRef;
|
|
459
460
|
const refKey = additionalProductRef.refKey;
|
|
460
|
-
const additionalProductInitialProductConfiguration = (
|
|
461
|
+
const additionalProductInitialProductConfiguration = (_d = initialProductConfiguration === null || initialProductConfiguration === void 0 ? void 0 : initialProductConfiguration.additionalProducts) === null || _d === void 0 ? void 0 : _d.find((aP) => refKey === aP.refKey);
|
|
461
462
|
if (initialProductConfiguration !== undefined &&
|
|
462
463
|
additionalProductInitialProductConfiguration === undefined) {
|
|
463
464
|
console.warn(`Did not find initial product configuration for additional product with refKey ${refKey}`);
|
|
@@ -480,7 +481,7 @@ export class _CfgProductInternal {
|
|
|
480
481
|
}
|
|
481
482
|
});
|
|
482
483
|
this.root = root !== null && root !== void 0 ? root : this;
|
|
483
|
-
this.key = makeProductKey(Object.assign(Object.assign({}, prodParams), { partNumber: (
|
|
484
|
+
this.key = makeProductKey(Object.assign(Object.assign({}, prodParams), { partNumber: (_b = _additionalProductRef === null || _additionalProductRef === void 0 ? void 0 : _additionalProductRef.refKey) !== null && _b !== void 0 ? _b : prodParams.partNumber }));
|
|
484
485
|
this._selected = optional ? selected : undefined;
|
|
485
486
|
this.isAdditionalProduct = _additionalProductRef !== undefined;
|
|
486
487
|
if (notes !== undefined) {
|
|
@@ -500,10 +501,10 @@ export class _CfgProductInternal {
|
|
|
500
501
|
clone(parent, root) {
|
|
501
502
|
return __awaiter(this, void 0, void 0, function* () {
|
|
502
503
|
const product = yield new Promise((initSuccess, initFail) => {
|
|
503
|
-
var
|
|
504
|
+
var _b;
|
|
504
505
|
const p = new _CfgProductInternal(() => {
|
|
505
506
|
initSuccess(p);
|
|
506
|
-
}, initFail, this._productLoaderRaw, this.prodParams, this.settings, this.optional, this.selected, this._configuration.rootFeatureRefs, this._configuration.rawFeatures, this._notes.values(), this.uuid, this._rawUnit, this._rawProductData, this.configuration._internal.getApiSelection(), this.configuration._internal.getApiConstrained(), new AggregatedLoadingObservable(), parent, root, this._additionalProductRef, (
|
|
507
|
+
}, initFail, this._productLoaderRaw, this.prodParams, this.settings, this.optional, this.selected, this._configuration.rootFeatureRefs, this._configuration.rawFeatures, this._notes.values(), this.uuid, this._rawUnit, this._rawProductData, this.configuration._internal.getApiSelection(), this.configuration._internal.getApiConstrained(), new AggregatedLoadingObservable(), parent, root, this._additionalProductRef, (_b = this._syncGroupHandler) === null || _b === void 0 ? void 0 : _b.clone());
|
|
507
508
|
});
|
|
508
509
|
for (const additionalProduct of this.additionalProducts) {
|
|
509
510
|
product.additionalProducts.push(CfgProduct._makeNewRefFrom(yield additionalProduct._internal.clone(product, root || product)));
|
|
@@ -550,20 +551,20 @@ export class _CfgProductInternal {
|
|
|
550
551
|
}
|
|
551
552
|
}
|
|
552
553
|
get notes() {
|
|
553
|
-
var
|
|
554
|
-
return this.getNotes((
|
|
554
|
+
var _b;
|
|
555
|
+
return this.getNotes((_b = this.rawProductData.noteRefs) !== null && _b !== void 0 ? _b : []);
|
|
555
556
|
}
|
|
556
557
|
get miscFiles() {
|
|
557
|
-
var
|
|
558
|
-
return (
|
|
558
|
+
var _b;
|
|
559
|
+
return (_b = this._rawProductData.miscFiles) !== null && _b !== void 0 ? _b : [];
|
|
559
560
|
}
|
|
560
561
|
get hasRootFeaturesChanged() {
|
|
561
562
|
return (this._configuration._internal.hasRootFeaturesChanged ||
|
|
562
563
|
this.additionalProducts.some((p) => p._internal.hasRootFeaturesChanged));
|
|
563
564
|
}
|
|
564
565
|
get description() {
|
|
565
|
-
var
|
|
566
|
-
return (
|
|
566
|
+
var _b, _c;
|
|
567
|
+
return (_c = (_b = this._additionalProductRef) === null || _b === void 0 ? void 0 : _b.refDescription) !== null && _c !== void 0 ? _c : this._rawProductData.description;
|
|
567
568
|
}
|
|
568
569
|
get rootNodeSources() {
|
|
569
570
|
return this._rawProductData.models;
|
|
@@ -581,25 +582,25 @@ export class _CfgProductInternal {
|
|
|
581
582
|
return this._rawProductData.partsData.prices;
|
|
582
583
|
}
|
|
583
584
|
get measureDefinitions() {
|
|
584
|
-
var
|
|
585
|
+
var _b;
|
|
585
586
|
if (this._measureDefinitions === undefined) {
|
|
586
|
-
this._measureDefinitions = ((
|
|
587
|
+
this._measureDefinitions = ((_b = this._rawProductData.measurements) !== null && _b !== void 0 ? _b : [])
|
|
587
588
|
.map((m) => CfgMeasureDefinition.make(m))
|
|
588
589
|
.filter((m) => m !== undefined);
|
|
589
590
|
}
|
|
590
591
|
return this._measureDefinitions;
|
|
591
592
|
}
|
|
592
593
|
get refKey() {
|
|
593
|
-
var
|
|
594
|
-
return (
|
|
594
|
+
var _b;
|
|
595
|
+
return (_b = this._additionalProductRef) === null || _b === void 0 ? void 0 : _b.refKey;
|
|
595
596
|
}
|
|
596
597
|
get transform() {
|
|
597
|
-
var
|
|
598
|
-
return (
|
|
598
|
+
var _b;
|
|
599
|
+
return (_b = this._additionalProductRef) === null || _b === void 0 ? void 0 : _b.transform;
|
|
599
600
|
}
|
|
600
601
|
get anchor() {
|
|
601
|
-
var
|
|
602
|
-
return (
|
|
602
|
+
var _b;
|
|
603
|
+
return (_b = this._additionalProductRef) === null || _b === void 0 ? void 0 : _b.anchor;
|
|
603
604
|
}
|
|
604
605
|
/** @throws an error if the actual unit sent by the server was not a LengthUnit */
|
|
605
606
|
get unit() {
|
|
@@ -697,8 +698,8 @@ export class _CfgProductInternal {
|
|
|
697
698
|
return this.root._syncGroupHandler;
|
|
698
699
|
}
|
|
699
700
|
get syncGroupsVerboseLogging() {
|
|
700
|
-
var
|
|
701
|
-
return (
|
|
701
|
+
var _b, _c;
|
|
702
|
+
return (_c = (_b = this.syncGroupHandler) === null || _b === void 0 ? void 0 : _b.verboseLogging) !== null && _c !== void 0 ? _c : false;
|
|
702
703
|
}
|
|
703
704
|
/**
|
|
704
705
|
* Set to true to get verbose sync state changes logged to the console.
|
|
@@ -711,6 +712,7 @@ export class _CfgProductInternal {
|
|
|
711
712
|
syncGroupHandler.verboseLogging = v;
|
|
712
713
|
}
|
|
713
714
|
}
|
|
715
|
+
_a = _CfgProductInternal;
|
|
714
716
|
_CfgProductInternal.make = (productLoaderRaw, productLoaderForGroupedLoad, // Used when instantiating the current product
|
|
715
717
|
prodParams, settings, optional, loadingObservable, parent, root, additionalProductRef, initialProductConfiguration) => __awaiter(void 0, void 0, void 0, function* () {
|
|
716
718
|
// Wrap with cache will make getProduct for this function call use the same server call
|
|
@@ -750,13 +752,13 @@ prodParams, settings, optional, loadingObservable, parent, root, additionalProdu
|
|
|
750
752
|
const { productData, rootFeatureRefs, features: rawFeatures, notes, uuid, unit, } = productResponse;
|
|
751
753
|
const initiallySelected = !optional || (initialProductConfigurationV1 === null || initialProductConfigurationV1 === void 0 ? void 0 : initialProductConfigurationV1.selected) === true;
|
|
752
754
|
const product = yield new Promise((initSuccess, initFail) => {
|
|
753
|
-
var
|
|
755
|
+
var _b;
|
|
754
756
|
const p = new _CfgProductInternal(() => {
|
|
755
757
|
// We absolutely do not want anyone to assign to this._configuration. So we want that field private.
|
|
756
758
|
// But we can not set the api selection synchronously. And the product configuration needs "this". So we use this callback.
|
|
757
759
|
// Feel free to find a nicer more readable solution :)
|
|
758
760
|
initSuccess(p);
|
|
759
|
-
}, initFail, productLoaderRaw, prodParams, settings, optional, initiallySelected, rootFeatureRefs !== null && rootFeatureRefs !== void 0 ? rootFeatureRefs : [], rawFeatures, notes === null || notes === void 0 ? void 0 : notes.values(), uuid, unit, productData, (
|
|
761
|
+
}, initFail, productLoaderRaw, prodParams, settings, optional, initiallySelected, rootFeatureRefs !== null && rootFeatureRefs !== void 0 ? rootFeatureRefs : [], rawFeatures, notes === null || notes === void 0 ? void 0 : notes.values(), uuid, unit, productData, (_b = productData.partsData.selOptions) !== null && _b !== void 0 ? _b : [], productData.partsData.constrOptions, loadingObservable, parent, root, additionalProductRef, syncGroupHandler);
|
|
760
762
|
});
|
|
761
763
|
yield product._syncAndLoadAdditionalProducts(productLoaderForGroupedLoad, initialProductConfigurationV1);
|
|
762
764
|
product._initialClone = yield product.clone();
|
|
@@ -7,6 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
var _a;
|
|
10
11
|
import { convertDtoProductConfToV1 } from "../utilitiesConfiguration.js";
|
|
11
12
|
export const isCfgProdConfMessage = (data) => typeof data === "object" && data !== null && "version" in data && "conf" in data;
|
|
12
13
|
export const isCfgProdConfMessageV1 = (data) => isCfgProdConfMessage(data) && data.version === "1.0";
|
|
@@ -31,7 +32,7 @@ export class CfgIOProdConfConnector {
|
|
|
31
32
|
this._stopListenToMessage = undefined;
|
|
32
33
|
this._stopListenToProdConf = undefined;
|
|
33
34
|
this.setProduct = (product) => __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
var
|
|
35
|
+
var _b, _c;
|
|
35
36
|
const currentProduct = this._product;
|
|
36
37
|
const newProduct = product;
|
|
37
38
|
this._product = newProduct;
|
|
@@ -42,8 +43,8 @@ export class CfgIOProdConfConnector {
|
|
|
42
43
|
return;
|
|
43
44
|
}
|
|
44
45
|
if (currentProduct !== undefined) {
|
|
45
|
-
(
|
|
46
|
-
(
|
|
46
|
+
(_b = this._stopListenToMessage) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
47
|
+
(_c = this._stopListenToProdConf) === null || _c === void 0 ? void 0 : _c.call(this);
|
|
47
48
|
}
|
|
48
49
|
if (newProduct === undefined) {
|
|
49
50
|
return;
|
|
@@ -72,9 +73,9 @@ export class CfgIOProdConfConnector {
|
|
|
72
73
|
_ioManager.addWarningSupplier(this);
|
|
73
74
|
}
|
|
74
75
|
destroy() {
|
|
75
|
-
var
|
|
76
|
-
(
|
|
77
|
-
(
|
|
76
|
+
var _b, _c;
|
|
77
|
+
(_b = this._stopListenToMessage) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
78
|
+
(_c = this._stopListenToProdConf) === null || _c === void 0 ? void 0 : _c.call(this);
|
|
78
79
|
this._ioManager.removeWarningSupplier(this);
|
|
79
80
|
}
|
|
80
81
|
getWarnings() {
|
|
@@ -105,6 +106,7 @@ export class CfgIOProdConfConnector {
|
|
|
105
106
|
};
|
|
106
107
|
}
|
|
107
108
|
}
|
|
109
|
+
_a = CfgIOProdConfConnector;
|
|
108
110
|
CfgIOProdConfConnector.makeMessage = (conf, initial, sendVersions) => {
|
|
109
111
|
const result = [];
|
|
110
112
|
if ((sendVersions & CfgProdConfMessageVersions.V1dot0) ===
|
|
@@ -29,18 +29,32 @@ export function generateProductConfigurations(api, lang, catalogues, filters, se
|
|
|
29
29
|
const productEntries = productRefs.entries();
|
|
30
30
|
for (const [productIndex, prdRef] of productEntries) {
|
|
31
31
|
const startTime = performance.now();
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
try {
|
|
33
|
+
const product = yield __await(CfgProduct.make(api, Object.assign(Object.assign({}, catalogueParams), { partNumber: prdRef.partNr }), settings));
|
|
34
|
+
const getProductDuration = performance.now() - startTime;
|
|
35
|
+
yield yield __await({
|
|
36
|
+
applicationAreasResponse,
|
|
37
|
+
catalogueCount,
|
|
38
|
+
catalogueIndex,
|
|
39
|
+
catalogueParams,
|
|
40
|
+
getProductDuration,
|
|
41
|
+
product,
|
|
42
|
+
productCount,
|
|
43
|
+
productIndex,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
catch (e) {
|
|
47
|
+
const err = e;
|
|
48
|
+
// Product load error, for example missing CmSym files.
|
|
49
|
+
// Safe to continue loading the next product.
|
|
50
|
+
const split = err.message.indexOf(", request ID: ");
|
|
51
|
+
if (split > -1) {
|
|
52
|
+
// The request ID part of the error from the server is mostly just spam and
|
|
53
|
+
// makes it harder to read list of errors, so remove it.
|
|
54
|
+
err.message = err.message.slice(0, split);
|
|
55
|
+
}
|
|
56
|
+
yield yield __await(toError(e));
|
|
57
|
+
}
|
|
44
58
|
}
|
|
45
59
|
}
|
|
46
60
|
catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@configura/web-api",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0-alpha.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/jest": "^26.0.23",
|
|
19
19
|
"del-cli": "^3.0.0",
|
|
20
|
-
"typescript": "4.
|
|
20
|
+
"typescript": "4.5"
|
|
21
21
|
},
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@configura/web-utilities": "2.
|
|
26
|
+
"@configura/web-utilities": "2.2.0-alpha.0"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "b01f3df9b902478356fb957c7b85ec6e3f2c5e9c"
|
|
29
29
|
}
|