@configura/web-api 2.2.0-alpha.1 → 2.2.0-alpha.3
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 +5 -5
- package/LICENSE +201 -201
- package/README.md +1 -1
- package/dist/CatalogueAPI.d.ts +633 -633
- package/dist/CatalogueAPI.js +312 -312
- package/dist/CfgMeasure.d.ts +32 -32
- package/dist/CfgMeasure.js +30 -30
- package/dist/CfgProduct.d.ts +359 -344
- package/dist/CfgProduct.js +1005 -992
- package/dist/CfgReferencePathHelper.d.ts +26 -26
- package/dist/CfgReferencePathHelper.js +26 -26
- package/dist/index.d.ts +24 -24
- package/dist/index.js +24 -24
- package/dist/io/CfgHistoryManager.d.ts +83 -83
- package/dist/io/CfgHistoryManager.js +144 -144
- package/dist/io/CfgHistoryToProdConfConnector.d.ts +21 -21
- package/dist/io/CfgHistoryToProdConfConnector.js +50 -50
- package/dist/io/CfgIOManager.d.ts +53 -53
- package/dist/io/CfgIOManager.js +134 -134
- package/dist/io/CfgIOProdConfConnector.d.ts +54 -54
- package/dist/io/CfgIOProdConfConnector.js +139 -139
- package/dist/io/CfgIOWarningSupplier.d.ts +3 -3
- package/dist/io/CfgIOWarningSupplier.js +1 -1
- package/dist/io/CfgObservableStateManager.d.ts +25 -25
- package/dist/io/CfgObservableStateManager.js +69 -69
- package/dist/io/CfgObservableStateToProdConfConnector.d.ts +15 -15
- package/dist/io/CfgObservableStateToProdConfConnector.js +17 -17
- package/dist/io/CfgWindowEventManager.d.ts +21 -21
- package/dist/io/CfgWindowEventManager.js +38 -38
- package/dist/io/CfgWindowMessageManager.d.ts +40 -40
- package/dist/io/CfgWindowMessageManager.js +91 -91
- package/dist/io/CfgWindowMessageToProdConfConnector.d.ts +17 -17
- package/dist/io/CfgWindowMessageToProdConfConnector.js +19 -19
- package/dist/io/index.d.ts +8 -8
- package/dist/io/index.js +8 -8
- 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 +199 -199
- package/dist/productConfiguration/CfgFeature.js +691 -691
- package/dist/productConfiguration/CfgOption.d.ts +160 -160
- package/dist/productConfiguration/CfgOption.js +464 -464
- package/dist/productConfiguration/CfgProductConfiguration.d.ts +136 -129
- package/dist/productConfiguration/CfgProductConfiguration.js +355 -346
- package/dist/productConfiguration/filters.d.ts +17 -17
- package/dist/productConfiguration/filters.js +141 -141
- package/dist/productConfiguration/productParamsGenerator.d.ts +15 -15
- package/dist/productConfiguration/productParamsGenerator.js +65 -65
- package/dist/productConfiguration/utilitiesProductConfiguration.d.ts +17 -17
- package/dist/productConfiguration/utilitiesProductConfiguration.js +89 -87
- package/dist/productLoader.d.ts +33 -33
- package/dist/productLoader.js +49 -49
- package/dist/syncGroups/SyncGroupsApplyMode.d.ts +20 -20
- package/dist/syncGroups/SyncGroupsApplyMode.js +21 -21
- package/dist/syncGroups/SyncGroupsHandler.d.ts +47 -47
- package/dist/syncGroups/SyncGroupsHandler.js +370 -370
- package/dist/syncGroups/SyncGroupsPathHelper.d.ts +26 -26
- package/dist/syncGroups/SyncGroupsPathHelper.js +90 -90
- package/dist/syncGroups/SyncGroupsState.d.ts +39 -39
- package/dist/syncGroups/SyncGroupsState.js +167 -167
- package/dist/syncGroups/SyncGroupsTransaction.d.ts +154 -154
- package/dist/syncGroups/SyncGroupsTransaction.js +589 -589
- package/dist/tasks/TaskHandler.d.ts +77 -77
- package/dist/tasks/TaskHandler.js +276 -276
- 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 -194
- package/dist/tests/testData/dummyProductForTest.d.ts +4 -4
- package/dist/tests/testData/dummyProductForTest.js +32 -32
- package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.d.ts +11 -11
- package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.js +282 -282
- package/dist/tests/testData/testDataCachedGetProduct.d.ts +5 -5
- package/dist/tests/testData/testDataCachedGetProduct.js +187 -187
- package/dist/tests/testData/testDataCachedPostValidate.d.ts +7 -7
- package/dist/tests/testData/testDataCachedPostValidate.js +185 -185
- package/dist/tests/testData/testDataConstraints.d.ts +3 -3
- package/dist/tests/testData/testDataConstraints.js +174 -174
- package/dist/tests/testData/testDataNoAdditionalProductNoPropagateForTest.d.ts +3 -3
- package/dist/tests/testData/testDataNoAdditionalProductNoPropagateForTest.js +1099 -1099
- package/dist/tests/testData/testDataOptions.d.ts +12 -12
- package/dist/tests/testData/testDataOptions.js +60 -60
- package/dist/tests/testData/testDataProductAggregatedPrice.d.ts +6 -6
- package/dist/tests/testData/testDataProductAggregatedPrice.js +189 -189
- package/dist/tests/testData/testDataUpcharge.d.ts +8 -8
- package/dist/tests/testData/testDataUpcharge.js +121 -121
- package/dist/utilitiesCatalogueData.d.ts +47 -47
- package/dist/utilitiesCatalogueData.js +180 -180
- package/dist/utilitiesCataloguePermission.d.ts +38 -38
- package/dist/utilitiesCataloguePermission.js +79 -79
- package/dist/utilitiesConfiguration.d.ts +28 -28
- package/dist/utilitiesConfiguration.js +200 -200
- package/dist/utilitiesNumericValues.d.ts +24 -24
- package/dist/utilitiesNumericValues.js +114 -114
- package/package.json +3 -3
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { CfgProduct } from "../../CfgProduct.js";
|
|
11
|
-
import { Collector } from "./collectorForTest.js";
|
|
12
|
-
import { dummyCatId } from "./dummyProductForTest.js";
|
|
13
|
-
import { letterOptionCodeA, letterOptions } from "./testDataOptions.js";
|
|
14
|
-
const Prd = () => ({
|
|
15
|
-
uuid: "Prd",
|
|
16
|
-
unit: "m",
|
|
17
|
-
features: [
|
|
18
|
-
{
|
|
19
|
-
code: "NoUpcharge",
|
|
20
|
-
description: "",
|
|
21
|
-
numericOrder: false,
|
|
22
|
-
options: [
|
|
23
|
-
letterOptions[0],
|
|
24
|
-
Object.assign(Object.assign({}, letterOptions[1]), { upcharge: undefined }),
|
|
25
|
-
Object.assign(Object.assign({}, letterOptions[2]), { upcharge: 0 }),
|
|
26
|
-
],
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
code: "WithUpcharge",
|
|
30
|
-
description: "",
|
|
31
|
-
numericOrder: false,
|
|
32
|
-
options: [
|
|
33
|
-
letterOptions[0],
|
|
34
|
-
Object.assign(Object.assign({}, letterOptions[1]), { upcharge: undefined }),
|
|
35
|
-
Object.assign(Object.assign({}, letterOptions[2]), { upcharge: 10 }),
|
|
36
|
-
],
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
code: "WithUpchargeSelectMany",
|
|
40
|
-
description: "",
|
|
41
|
-
numericOrder: false,
|
|
42
|
-
optional: true,
|
|
43
|
-
options: [
|
|
44
|
-
letterOptions[0],
|
|
45
|
-
Object.assign(Object.assign({}, letterOptions[1]), { upcharge: undefined }),
|
|
46
|
-
Object.assign(Object.assign({}, letterOptions[2]), { upcharge: 10 }),
|
|
47
|
-
],
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
productData: {
|
|
51
|
-
sku: "Prd",
|
|
52
|
-
partsData: {
|
|
53
|
-
basePrice: 40,
|
|
54
|
-
currency: "EURO",
|
|
55
|
-
listPrice: 50,
|
|
56
|
-
pkgCount: 0,
|
|
57
|
-
styleNr: "",
|
|
58
|
-
selOptions: [
|
|
59
|
-
{
|
|
60
|
-
code: "!~!",
|
|
61
|
-
next: {
|
|
62
|
-
[letterOptionCodeA]: {
|
|
63
|
-
code: letterOptionCodeA,
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
code: "!~!",
|
|
69
|
-
next: {
|
|
70
|
-
[letterOptionCodeA]: {
|
|
71
|
-
code: letterOptionCodeA,
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
code: "!~!",
|
|
77
|
-
next: {
|
|
78
|
-
[letterOptionCodeA]: {
|
|
79
|
-
code: letterOptionCodeA,
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
],
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
rootFeatureRefs: [
|
|
87
|
-
{ code: "NoUpcharge" },
|
|
88
|
-
{ code: "WithUpcharge" },
|
|
89
|
-
{ code: "WithUpchargeSelectMany" },
|
|
90
|
-
],
|
|
91
|
-
});
|
|
92
|
-
const getProduct = (params) => Promise.resolve(Prd());
|
|
93
|
-
export const getUpchargeProduct = (testFunc) => __awaiter(void 0, void 0, void 0, function* () {
|
|
94
|
-
const productLoader = {
|
|
95
|
-
getProduct,
|
|
96
|
-
postValidate: (params, _body) => __awaiter(void 0, void 0, void 0, function* () {
|
|
97
|
-
const productData = (yield getProduct(params)).productData;
|
|
98
|
-
const validateResponse = {
|
|
99
|
-
uuid: "",
|
|
100
|
-
unit: "m",
|
|
101
|
-
validated: true,
|
|
102
|
-
productData,
|
|
103
|
-
features: [],
|
|
104
|
-
};
|
|
105
|
-
return validateResponse;
|
|
106
|
-
}),
|
|
107
|
-
};
|
|
108
|
-
const product = yield CfgProduct.make(productLoader, Object.assign(Object.assign({}, dummyCatId), { partNumber: "Table" }));
|
|
109
|
-
const collect = new Collector(product);
|
|
110
|
-
const beforeSnapshot = collect.takeSnapshot();
|
|
111
|
-
yield testFunc(product);
|
|
112
|
-
const afterSnapshot = collect.takeSnapshot();
|
|
113
|
-
const diff = collect.compareSnapshot(beforeSnapshot, afterSnapshot);
|
|
114
|
-
const notifications = collect.notifications;
|
|
115
|
-
return {
|
|
116
|
-
beforeSnapshot: Collector.stripRefsForWrapper(beforeSnapshot),
|
|
117
|
-
afterSnapshot: Collector.stripRefsForWrapper(afterSnapshot),
|
|
118
|
-
diff,
|
|
119
|
-
notifications,
|
|
120
|
-
};
|
|
121
|
-
});
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { CfgProduct } from "../../CfgProduct.js";
|
|
11
|
+
import { Collector } from "./collectorForTest.js";
|
|
12
|
+
import { dummyCatId } from "./dummyProductForTest.js";
|
|
13
|
+
import { letterOptionCodeA, letterOptions } from "./testDataOptions.js";
|
|
14
|
+
const Prd = () => ({
|
|
15
|
+
uuid: "Prd",
|
|
16
|
+
unit: "m",
|
|
17
|
+
features: [
|
|
18
|
+
{
|
|
19
|
+
code: "NoUpcharge",
|
|
20
|
+
description: "",
|
|
21
|
+
numericOrder: false,
|
|
22
|
+
options: [
|
|
23
|
+
letterOptions[0],
|
|
24
|
+
Object.assign(Object.assign({}, letterOptions[1]), { upcharge: undefined }),
|
|
25
|
+
Object.assign(Object.assign({}, letterOptions[2]), { upcharge: 0 }),
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
code: "WithUpcharge",
|
|
30
|
+
description: "",
|
|
31
|
+
numericOrder: false,
|
|
32
|
+
options: [
|
|
33
|
+
letterOptions[0],
|
|
34
|
+
Object.assign(Object.assign({}, letterOptions[1]), { upcharge: undefined }),
|
|
35
|
+
Object.assign(Object.assign({}, letterOptions[2]), { upcharge: 10 }),
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
code: "WithUpchargeSelectMany",
|
|
40
|
+
description: "",
|
|
41
|
+
numericOrder: false,
|
|
42
|
+
optional: true,
|
|
43
|
+
options: [
|
|
44
|
+
letterOptions[0],
|
|
45
|
+
Object.assign(Object.assign({}, letterOptions[1]), { upcharge: undefined }),
|
|
46
|
+
Object.assign(Object.assign({}, letterOptions[2]), { upcharge: 10 }),
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
productData: {
|
|
51
|
+
sku: "Prd",
|
|
52
|
+
partsData: {
|
|
53
|
+
basePrice: 40,
|
|
54
|
+
currency: "EURO",
|
|
55
|
+
listPrice: 50,
|
|
56
|
+
pkgCount: 0,
|
|
57
|
+
styleNr: "",
|
|
58
|
+
selOptions: [
|
|
59
|
+
{
|
|
60
|
+
code: "!~!",
|
|
61
|
+
next: {
|
|
62
|
+
[letterOptionCodeA]: {
|
|
63
|
+
code: letterOptionCodeA,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
code: "!~!",
|
|
69
|
+
next: {
|
|
70
|
+
[letterOptionCodeA]: {
|
|
71
|
+
code: letterOptionCodeA,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
code: "!~!",
|
|
77
|
+
next: {
|
|
78
|
+
[letterOptionCodeA]: {
|
|
79
|
+
code: letterOptionCodeA,
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
rootFeatureRefs: [
|
|
87
|
+
{ code: "NoUpcharge" },
|
|
88
|
+
{ code: "WithUpcharge" },
|
|
89
|
+
{ code: "WithUpchargeSelectMany" },
|
|
90
|
+
],
|
|
91
|
+
});
|
|
92
|
+
const getProduct = (params) => Promise.resolve(Prd());
|
|
93
|
+
export const getUpchargeProduct = (testFunc) => __awaiter(void 0, void 0, void 0, function* () {
|
|
94
|
+
const productLoader = {
|
|
95
|
+
getProduct,
|
|
96
|
+
postValidate: (params, _body) => __awaiter(void 0, void 0, void 0, function* () {
|
|
97
|
+
const productData = (yield getProduct(params)).productData;
|
|
98
|
+
const validateResponse = {
|
|
99
|
+
uuid: "",
|
|
100
|
+
unit: "m",
|
|
101
|
+
validated: true,
|
|
102
|
+
productData,
|
|
103
|
+
features: [],
|
|
104
|
+
};
|
|
105
|
+
return validateResponse;
|
|
106
|
+
}),
|
|
107
|
+
};
|
|
108
|
+
const product = yield CfgProduct.make(productLoader, Object.assign(Object.assign({}, dummyCatId), { partNumber: "Table" }));
|
|
109
|
+
const collect = new Collector(product);
|
|
110
|
+
const beforeSnapshot = collect.takeSnapshot();
|
|
111
|
+
yield testFunc(product);
|
|
112
|
+
const afterSnapshot = collect.takeSnapshot();
|
|
113
|
+
const diff = collect.compareSnapshot(beforeSnapshot, afterSnapshot);
|
|
114
|
+
const notifications = collect.notifications;
|
|
115
|
+
return {
|
|
116
|
+
beforeSnapshot: Collector.stripRefsForWrapper(beforeSnapshot),
|
|
117
|
+
afterSnapshot: Collector.stripRefsForWrapper(afterSnapshot),
|
|
118
|
+
diff,
|
|
119
|
+
notifications,
|
|
120
|
+
};
|
|
121
|
+
});
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { DtoAdditionalProductRef, DtoCatalogueParams, DtoCatalogueParamsWithCid, DtoCatalogueParamsWithCidAndLang, DtoMeasureParam, DtoModel, DtoOrientation, DtoPartsData, DtoPrices, DtoProductData, DtoProductParamsWithCid, DtoProductParamsWithCidAndLang, DtoProductResponse, DtoSelectedOption, DtoTransform, DtoValidateResponse, DtoVector } from "./CatalogueAPI.js";
|
|
2
|
-
/**
|
|
3
|
-
* Makes a string from the params which can be used as a key in for example React. Language is not respected.
|
|
4
|
-
*/
|
|
5
|
-
export declare const makeCatalogueKey: (cat: DtoCatalogueParamsWithCid) => string;
|
|
6
|
-
/**
|
|
7
|
-
* Makes a string from the params which can be used as a key in for example React. Language is not respected.
|
|
8
|
-
*/
|
|
9
|
-
export declare const makeProductKey: (prod: DtoProductParamsWithCid) => string;
|
|
10
|
-
/**
|
|
11
|
-
* Makes a string from selected options, can be used as a key for a selection.
|
|
12
|
-
*/
|
|
13
|
-
export declare const makeSelOptionsKey: (options: DtoSelectedOption[]) => string;
|
|
14
|
-
export declare type RootNodeSource = DtoModel | File;
|
|
15
|
-
export declare type CfgProductData = Omit<Omit<DtoProductData, "models">, "partsData"> & {
|
|
16
|
-
models?: RootNodeSource[];
|
|
17
|
-
partsData: Omit<DtoPartsData, "selOptions"> & {
|
|
18
|
-
selOptions: DtoSelectedOption[];
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Deep compare. Uses the JSON.stringify method for comparison
|
|
23
|
-
* @returns true if equal. Key and array order is respected.
|
|
24
|
-
*/
|
|
25
|
-
export declare function compareCfgProductData(pd1: CfgProductData, pd2: CfgProductData): boolean;
|
|
26
|
-
export declare type CfgProductResponse = Omit<DtoProductResponse, "productData"> & {
|
|
27
|
-
productData: CfgProductData;
|
|
28
|
-
};
|
|
29
|
-
/** This must be kept in sync with DtoValidateResponse. */
|
|
30
|
-
export declare type CfgValidateResponse = Omit<DtoValidateResponse, "productData"> & {
|
|
31
|
-
productData: CfgProductData;
|
|
32
|
-
};
|
|
33
|
-
export declare function isModel(arg: unknown): arg is DtoModel;
|
|
34
|
-
/** Replace empty strings with "-" for compatibility with the API. */
|
|
35
|
-
export declare function correctDefaultsOnCatalogueParams<T extends DtoCatalogueParams>(catId: T): T;
|
|
36
|
-
export declare function recursivelyGetPriceCodeValue(priceCodes: string[], prices: DtoPrices | undefined): number | undefined;
|
|
37
|
-
export declare function comparePricesObjects(prices1: DtoPrices | undefined, prices2: DtoPrices | undefined): boolean;
|
|
38
|
-
export declare const decodeCatalogueParams: <T extends DtoCatalogueParams>(params: T) => T;
|
|
39
|
-
export declare const decodeProductParams: <T extends DtoProductParamsWithCid>(params: T) => T;
|
|
40
|
-
export declare function isSameCatalogueParams(left: DtoCatalogueParams, right: DtoCatalogueParams): boolean;
|
|
41
|
-
export declare function isSameVector(left: DtoVector, right: DtoVector): boolean;
|
|
42
|
-
export declare function isSameOrientation(left: DtoOrientation, right: DtoOrientation): boolean;
|
|
43
|
-
export declare function isSameAnchor(left: DtoMeasureParam, right: DtoMeasureParam): boolean;
|
|
44
|
-
export declare function isSameTransform(left: DtoTransform, right: DtoTransform): boolean;
|
|
45
|
-
export declare function isSameProductRef(left: DtoAdditionalProductRef, right: DtoAdditionalProductRef): boolean;
|
|
46
|
-
export declare const isSameDtoCatalogueParamsWithLang: (left: DtoCatalogueParamsWithCidAndLang, right: DtoCatalogueParamsWithCidAndLang) => boolean;
|
|
47
|
-
export declare const isSameDtoProductParamsWithLang: (left: DtoProductParamsWithCidAndLang, right: DtoProductParamsWithCidAndLang) => boolean;
|
|
1
|
+
import { DtoAdditionalProductRef, DtoCatalogueParams, DtoCatalogueParamsWithCid, DtoCatalogueParamsWithCidAndLang, DtoMeasureParam, DtoModel, DtoOrientation, DtoPartsData, DtoPrices, DtoProductData, DtoProductParamsWithCid, DtoProductParamsWithCidAndLang, DtoProductResponse, DtoSelectedOption, DtoTransform, DtoValidateResponse, DtoVector } from "./CatalogueAPI.js";
|
|
2
|
+
/**
|
|
3
|
+
* Makes a string from the params which can be used as a key in for example React. Language is not respected.
|
|
4
|
+
*/
|
|
5
|
+
export declare const makeCatalogueKey: (cat: DtoCatalogueParamsWithCid) => string;
|
|
6
|
+
/**
|
|
7
|
+
* Makes a string from the params which can be used as a key in for example React. Language is not respected.
|
|
8
|
+
*/
|
|
9
|
+
export declare const makeProductKey: (prod: DtoProductParamsWithCid) => string;
|
|
10
|
+
/**
|
|
11
|
+
* Makes a string from selected options, can be used as a key for a selection.
|
|
12
|
+
*/
|
|
13
|
+
export declare const makeSelOptionsKey: (options: DtoSelectedOption[]) => string;
|
|
14
|
+
export declare type RootNodeSource = DtoModel | File;
|
|
15
|
+
export declare type CfgProductData = Omit<Omit<DtoProductData, "models">, "partsData"> & {
|
|
16
|
+
models?: RootNodeSource[];
|
|
17
|
+
partsData: Omit<DtoPartsData, "selOptions"> & {
|
|
18
|
+
selOptions: DtoSelectedOption[];
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Deep compare. Uses the JSON.stringify method for comparison
|
|
23
|
+
* @returns true if equal. Key and array order is respected.
|
|
24
|
+
*/
|
|
25
|
+
export declare function compareCfgProductData(pd1: CfgProductData, pd2: CfgProductData): boolean;
|
|
26
|
+
export declare type CfgProductResponse = Omit<DtoProductResponse, "productData"> & {
|
|
27
|
+
productData: CfgProductData;
|
|
28
|
+
};
|
|
29
|
+
/** This must be kept in sync with DtoValidateResponse. */
|
|
30
|
+
export declare type CfgValidateResponse = Omit<DtoValidateResponse, "productData"> & {
|
|
31
|
+
productData: CfgProductData;
|
|
32
|
+
};
|
|
33
|
+
export declare function isModel(arg: unknown): arg is DtoModel;
|
|
34
|
+
/** Replace empty strings with "-" for compatibility with the API. */
|
|
35
|
+
export declare function correctDefaultsOnCatalogueParams<T extends DtoCatalogueParams>(catId: T): T;
|
|
36
|
+
export declare function recursivelyGetPriceCodeValue(priceCodes: string[], prices: DtoPrices | undefined): number | undefined;
|
|
37
|
+
export declare function comparePricesObjects(prices1: DtoPrices | undefined, prices2: DtoPrices | undefined): boolean;
|
|
38
|
+
export declare const decodeCatalogueParams: <T extends DtoCatalogueParams>(params: T) => T;
|
|
39
|
+
export declare const decodeProductParams: <T extends DtoProductParamsWithCid>(params: T) => T;
|
|
40
|
+
export declare function isSameCatalogueParams(left: DtoCatalogueParams, right: DtoCatalogueParams): boolean;
|
|
41
|
+
export declare function isSameVector(left: DtoVector, right: DtoVector): boolean;
|
|
42
|
+
export declare function isSameOrientation(left: DtoOrientation, right: DtoOrientation): boolean;
|
|
43
|
+
export declare function isSameAnchor(left: DtoMeasureParam, right: DtoMeasureParam): boolean;
|
|
44
|
+
export declare function isSameTransform(left: DtoTransform, right: DtoTransform): boolean;
|
|
45
|
+
export declare function isSameProductRef(left: DtoAdditionalProductRef, right: DtoAdditionalProductRef): boolean;
|
|
46
|
+
export declare const isSameDtoCatalogueParamsWithLang: (left: DtoCatalogueParamsWithCidAndLang, right: DtoCatalogueParamsWithCidAndLang) => boolean;
|
|
47
|
+
export declare const isSameDtoProductParamsWithLang: (left: DtoProductParamsWithCidAndLang, right: DtoProductParamsWithCidAndLang) => boolean;
|
|
48
48
|
//# sourceMappingURL=utilitiesCatalogueData.d.ts.map
|