@configura/web-api 2.0.0-alpha.20 → 2.0.0-alpha.21

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 (100) hide show
  1. package/.eslintrc.json +5 -18
  2. package/LICENSE +201 -201
  3. package/README.md +1 -1
  4. package/dist/CatalogueAPI.d.ts +597 -581
  5. package/dist/CatalogueAPI.js +328 -328
  6. package/dist/CfgMeasure.d.ts +32 -32
  7. package/dist/CfgMeasure.js +30 -30
  8. package/dist/CfgProduct.d.ts +328 -330
  9. package/dist/CfgProduct.js +934 -879
  10. package/dist/CfgReferencePathHelper.d.ts +26 -26
  11. package/dist/CfgReferencePathHelper.js +26 -26
  12. package/dist/ConfigurationConverter.d.ts +17 -13
  13. package/dist/ConfigurationConverter.js +175 -166
  14. package/dist/index.d.ts +23 -23
  15. package/dist/index.js +23 -23
  16. package/dist/io/CfgHistoryManager.d.ts +83 -83
  17. package/dist/io/CfgHistoryManager.js +144 -150
  18. package/dist/io/CfgHistoryToProdConfConnector.d.ts +21 -17
  19. package/dist/io/CfgHistoryToProdConfConnector.js +50 -47
  20. package/dist/io/CfgIOManager.d.ts +53 -53
  21. package/dist/io/CfgIOManager.js +134 -134
  22. package/dist/io/CfgIOProdConfConnector.d.ts +64 -56
  23. package/dist/io/CfgIOProdConfConnector.js +149 -158
  24. package/dist/io/CfgIOWarningSupplier.d.ts +3 -3
  25. package/dist/io/CfgIOWarningSupplier.js +1 -1
  26. package/dist/io/CfgObservableStateManager.d.ts +25 -25
  27. package/dist/io/CfgObservableStateManager.js +69 -69
  28. package/dist/io/CfgObservableStateToProdConfConnector.d.ts +14 -14
  29. package/dist/io/CfgObservableStateToProdConfConnector.js +16 -16
  30. package/dist/io/CfgWindowEventManager.d.ts +21 -21
  31. package/dist/io/CfgWindowEventManager.js +38 -38
  32. package/dist/io/CfgWindowMessageManager.d.ts +40 -40
  33. package/dist/io/CfgWindowMessageManager.js +91 -91
  34. package/dist/io/CfgWindowMessageToProdConfConnector.d.ts +16 -16
  35. package/dist/io/CfgWindowMessageToProdConfConnector.js +18 -18
  36. package/dist/io/index.d.ts +8 -8
  37. package/dist/io/index.js +8 -8
  38. package/dist/material/CfgMaterialMapping.d.ts +7 -7
  39. package/dist/material/CfgMaterialMapping.js +181 -181
  40. package/dist/material/CfgMtrlApplication.d.ts +18 -18
  41. package/dist/material/CfgMtrlApplication.js +43 -43
  42. package/dist/material/CfgMtrlApplicationSource.d.ts +7 -7
  43. package/dist/material/CfgMtrlApplicationSource.js +8 -8
  44. package/dist/material/CfgMtrlSource.d.ts +19 -19
  45. package/dist/material/CfgMtrlSource.js +40 -40
  46. package/dist/material/CfgMtrlSourceWithMetaData.d.ts +7 -7
  47. package/dist/material/CfgMtrlSourceWithMetaData.js +1 -1
  48. package/dist/productConfiguration/CfgFeature.d.ts +189 -189
  49. package/dist/productConfiguration/CfgFeature.js +658 -658
  50. package/dist/productConfiguration/CfgOption.d.ts +151 -151
  51. package/dist/productConfiguration/CfgOption.js +422 -422
  52. package/dist/productConfiguration/CfgProductConfiguration.d.ts +129 -129
  53. package/dist/productConfiguration/CfgProductConfiguration.js +340 -340
  54. package/dist/productConfiguration/filters.d.ts +15 -15
  55. package/dist/productConfiguration/filters.js +70 -70
  56. package/dist/productConfiguration/productParamsGenerator.d.ts +15 -15
  57. package/dist/productConfiguration/productParamsGenerator.js +51 -51
  58. package/dist/productConfiguration/utilitiesProductConfiguration.d.ts +17 -17
  59. package/dist/productConfiguration/utilitiesProductConfiguration.js +87 -87
  60. package/dist/productLoader.d.ts +33 -33
  61. package/dist/productLoader.js +49 -49
  62. package/dist/syncGroups/SyncGroupsApplyMode.d.ts +20 -20
  63. package/dist/syncGroups/SyncGroupsApplyMode.js +21 -21
  64. package/dist/syncGroups/SyncGroupsHandler.d.ts +47 -43
  65. package/dist/syncGroups/SyncGroupsHandler.js +370 -363
  66. package/dist/syncGroups/SyncGroupsPathHelper.d.ts +26 -26
  67. package/dist/syncGroups/SyncGroupsPathHelper.js +90 -90
  68. package/dist/syncGroups/SyncGroupsState.d.ts +39 -35
  69. package/dist/syncGroups/SyncGroupsState.js +167 -125
  70. package/dist/syncGroups/SyncGroupsTransaction.d.ts +154 -154
  71. package/dist/syncGroups/SyncGroupsTransaction.js +589 -589
  72. package/dist/tasks/TaskHandler.d.ts +77 -77
  73. package/dist/tasks/TaskHandler.js +276 -276
  74. package/dist/tasks/formats.d.ts +4 -4
  75. package/dist/tasks/formats.js +7 -7
  76. package/dist/tests/testData/collectorForTest.d.ts +73 -73
  77. package/dist/tests/testData/collectorForTest.js +194 -194
  78. package/dist/tests/testData/dummyProductForTest.d.ts +4 -4
  79. package/dist/tests/testData/dummyProductForTest.js +32 -32
  80. package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.d.ts +11 -11
  81. package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.js +282 -278
  82. package/dist/tests/testData/testDataCachedGetProduct.d.ts +5 -5
  83. package/dist/tests/testData/testDataCachedGetProduct.js +187 -186
  84. package/dist/tests/testData/testDataCachedPostValidate.d.ts +7 -7
  85. package/dist/tests/testData/testDataCachedPostValidate.js +185 -184
  86. package/dist/tests/testData/testDataNoAdditionalProductNoPropagateForTest.d.ts +3 -3
  87. package/dist/tests/testData/testDataNoAdditionalProductNoPropagateForTest.js +1099 -1099
  88. package/dist/tests/testData/testDataOptions.d.ts +12 -12
  89. package/dist/tests/testData/testDataOptions.js +60 -60
  90. package/dist/tests/testData/testDataProductAggregatedPrice.d.ts +6 -6
  91. package/dist/tests/testData/testDataProductAggregatedPrice.js +189 -188
  92. package/dist/tests/testData/testDataUpcharge.d.ts +8 -8
  93. package/dist/tests/testData/testDataUpcharge.js +121 -120
  94. package/dist/utilitiesCatalogueData.d.ts +47 -47
  95. package/dist/utilitiesCatalogueData.js +180 -180
  96. package/dist/utilitiesCataloguePermission.d.ts +38 -38
  97. package/dist/utilitiesCataloguePermission.js +79 -79
  98. package/dist/utilitiesNumericValues.d.ts +24 -24
  99. package/dist/utilitiesNumericValues.js +114 -109
  100. package/package.json +3 -3
@@ -1,120 +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
- validated: true,
101
- productData,
102
- features: [],
103
- };
104
- return validateResponse;
105
- }),
106
- };
107
- const product = yield CfgProduct.make(productLoader, Object.assign(Object.assign({}, dummyCatId), { partNumber: "Table" }));
108
- const collect = new Collector(product);
109
- const beforeSnapshot = collect.takeSnapshot();
110
- yield testFunc(product);
111
- const afterSnapshot = collect.takeSnapshot();
112
- const diff = collect.compareSnapshot(beforeSnapshot, afterSnapshot);
113
- const notifications = collect.notifications;
114
- return {
115
- beforeSnapshot: Collector.stripRefsForWrapper(beforeSnapshot),
116
- afterSnapshot: Collector.stripRefsForWrapper(afterSnapshot),
117
- diff,
118
- notifications,
119
- };
120
- });
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