@configura/web-api 1.3.0-alpha.4 → 1.4.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.
Files changed (57) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +1 -1
  3. package/dist/CatalogueAPI.d.ts +502 -448
  4. package/dist/CatalogueAPI.js +206 -206
  5. package/dist/CfgMeasure.d.ts +33 -0
  6. package/dist/CfgMeasure.js +30 -0
  7. package/dist/CfgProduct.d.ts +217 -116
  8. package/dist/CfgProduct.js +634 -588
  9. package/dist/index.d.ts +16 -15
  10. package/dist/index.js +16 -15
  11. package/dist/material/CfgMaterialMapping.d.ts +7 -7
  12. package/dist/material/CfgMaterialMapping.js +181 -176
  13. package/dist/material/CfgMtrlApplication.d.ts +18 -18
  14. package/dist/material/CfgMtrlApplication.js +43 -43
  15. package/dist/material/CfgMtrlApplicationSource.d.ts +7 -7
  16. package/dist/material/CfgMtrlApplicationSource.js +8 -8
  17. package/dist/material/CfgMtrlSource.d.ts +19 -19
  18. package/dist/material/CfgMtrlSource.js +40 -40
  19. package/dist/material/CfgMtrlSourceWithMetaData.d.ts +7 -7
  20. package/dist/material/CfgMtrlSourceWithMetaData.js +1 -1
  21. package/dist/productConfiguration/CfgFeature.d.ts +160 -134
  22. package/dist/productConfiguration/CfgFeature.js +593 -483
  23. package/dist/productConfiguration/CfgOption.d.ts +128 -112
  24. package/dist/productConfiguration/CfgOption.js +394 -293
  25. package/dist/productConfiguration/CfgProductConfiguration.d.ts +120 -50
  26. package/dist/productConfiguration/CfgProductConfiguration.js +307 -198
  27. package/dist/productConfiguration/filters.d.ts +7 -7
  28. package/dist/productConfiguration/filters.js +29 -29
  29. package/dist/productConfiguration/productParamsGenerator.d.ts +15 -15
  30. package/dist/productConfiguration/productParamsGenerator.js +51 -51
  31. package/dist/productConfiguration/utilitiesProductConfiguration.d.ts +17 -9
  32. package/dist/productConfiguration/utilitiesProductConfiguration.js +80 -61
  33. package/dist/productLoader.d.ts +33 -11
  34. package/dist/productLoader.js +49 -41
  35. package/dist/tests/testData/collectorForTest.d.ts +73 -73
  36. package/dist/tests/testData/collectorForTest.js +195 -195
  37. package/dist/tests/testData/dummyProductForTest.d.ts +4 -4
  38. package/dist/tests/testData/dummyProductForTest.js +36 -35
  39. package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.d.ts +32 -32
  40. package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.js +381 -368
  41. package/dist/tests/testData/testDataCachedGetProduct.d.ts +5 -5
  42. package/dist/tests/testData/testDataCachedGetProduct.js +205 -199
  43. package/dist/tests/testData/testDataCachedPostValidate.d.ts +7 -7
  44. package/dist/tests/testData/testDataCachedPostValidate.js +195 -189
  45. package/dist/tests/testData/testDataNoAdditionalProductNoPropagateForTest.d.ts +3 -3
  46. package/dist/tests/testData/testDataNoAdditionalProductNoPropagateForTest.js +1119 -1117
  47. package/dist/tests/testData/testDataProductAggregatedPrice.d.ts +28 -28
  48. package/dist/tests/testData/testDataProductAggregatedPrice.js +210 -205
  49. package/dist/tests/testData/testDataUpcharge.d.ts +29 -29
  50. package/dist/tests/testData/testDataUpcharge.js +163 -159
  51. package/dist/utilitiesCatalogueData.d.ts +22 -20
  52. package/dist/utilitiesCatalogueData.js +64 -64
  53. package/dist/utilitiesCataloguePermission.d.ts +39 -39
  54. package/dist/utilitiesCataloguePermission.js +84 -84
  55. package/dist/utilitiesNumericValues.d.ts +25 -0
  56. package/dist/utilitiesNumericValues.js +109 -0
  57. package/package.json +3 -3
@@ -1,189 +1,195 @@
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 { dummyCatId } from "./dummyProductForTest.js";
12
- const Table = () => ({
13
- uuid: "Table",
14
- features: [
15
- {
16
- code: "Leg",
17
- description: "",
18
- options: [
19
- {
20
- code: "LegA",
21
- description: "",
22
- additionalProductRefs: [
23
- { refKey: "Leg_0", catId: dummyCatId, partNumber: "LegA" },
24
- { refKey: "Leg_1", catId: dummyCatId, partNumber: "LegA" },
25
- { refKey: "Leg_2", catId: dummyCatId, partNumber: "LegA" },
26
- { refKey: "Leg_3", catId: dummyCatId, partNumber: "LegA" },
27
- ],
28
- },
29
- {
30
- code: "LegB",
31
- description: "",
32
- additionalProductRefs: [
33
- { refKey: "Leg_0", catId: dummyCatId, partNumber: "LegA" },
34
- { refKey: "Leg_1", catId: dummyCatId, partNumber: "LegA" },
35
- { refKey: "LegWheel_0", catId: dummyCatId, partNumber: "LegWheel" },
36
- { refKey: "LegWheel_1", catId: dummyCatId, partNumber: "LegWheel" },
37
- ],
38
- },
39
- ],
40
- },
41
- ],
42
- productData: {
43
- sku: "Table",
44
- partsData: {
45
- basePrice: 40,
46
- currency: "EURO",
47
- listPrice: 50,
48
- pkgCount: 0,
49
- styleNr: "",
50
- selOptions: [
51
- {
52
- code: "!~!",
53
- feature: "LegA",
54
- featDesc: "",
55
- next: {
56
- LegA: {
57
- code: "LegA",
58
- feature: "LegA",
59
- featDesc: "",
60
- },
61
- },
62
- },
63
- ],
64
- },
65
- },
66
- rootFeatureRefs: [{ code: "Leg" }],
67
- });
68
- const LegA = () => ({
69
- uuid: "LegA",
70
- features: [
71
- {
72
- code: "Color",
73
- description: "",
74
- options: [
75
- {
76
- code: "Red",
77
- description: "",
78
- },
79
- {
80
- code: "Blue",
81
- description: "",
82
- },
83
- {
84
- code: "Yellow",
85
- description: "",
86
- },
87
- ],
88
- },
89
- ],
90
- productData: {
91
- sku: "LegA",
92
- partsData: {
93
- basePrice: 40,
94
- currency: "EURO",
95
- listPrice: 50,
96
- pkgCount: 0,
97
- styleNr: "",
98
- selOptions: [
99
- {
100
- code: "!~!",
101
- feature: "Color",
102
- featDesc: "",
103
- next: {
104
- Red: {
105
- code: "Red",
106
- feature: "Color",
107
- featDesc: "",
108
- },
109
- },
110
- },
111
- ],
112
- },
113
- },
114
- rootFeatureRefs: [{ code: "Color" }],
115
- });
116
- const LegWheel = () => ({
117
- uuid: "LegWheel",
118
- features: [
119
- {
120
- code: "Color",
121
- description: "",
122
- options: [
123
- {
124
- code: "Red",
125
- description: "",
126
- },
127
- {
128
- code: "Blue",
129
- description: "",
130
- },
131
- ],
132
- },
133
- ],
134
- productData: {
135
- sku: "LegWheel",
136
- partsData: {
137
- basePrice: 40,
138
- currency: "EURO",
139
- listPrice: 50,
140
- pkgCount: 0,
141
- styleNr: "",
142
- selOptions: [
143
- {
144
- code: "!~!",
145
- feature: "Color",
146
- featDesc: "",
147
- next: {
148
- Red: {
149
- code: "Red",
150
- feature: "Color",
151
- featDesc: "",
152
- },
153
- },
154
- },
155
- ],
156
- },
157
- },
158
- rootFeatureRefs: [{ code: "Color" }],
159
- });
160
- const getProduct = (params) => __awaiter(void 0, void 0, void 0, function* () {
161
- const partNumber = params.partNumber;
162
- switch (partNumber) {
163
- case "Table":
164
- return Table();
165
- case "LegA":
166
- return LegA();
167
- case "LegWheel":
168
- return LegWheel();
169
- }
170
- throw new Error("No such part");
171
- });
172
- export const cachedProductLoaderTest = () => __awaiter(void 0, void 0, void 0, function* () {
173
- const validateCounter = { count: 0 };
174
- const productLoader = {
175
- getProduct,
176
- postValidate: (params, _body) => __awaiter(void 0, void 0, void 0, function* () {
177
- const productData = (yield getProduct(params)).productData;
178
- const validateResponse = {
179
- uuid: "",
180
- validated: true,
181
- productData,
182
- };
183
- validateCounter.count++;
184
- return validateResponse;
185
- }),
186
- };
187
- const product = yield CfgProduct.make(productLoader, "lang", dummyCatId, "Table");
188
- return { product, validateCounter };
189
- });
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 { dummyCatId } from "./dummyProductForTest.js";
12
+ const Table = () => ({
13
+ uuid: "Table",
14
+ unit: "m",
15
+ features: [
16
+ {
17
+ code: "Leg",
18
+ description: "",
19
+ numericOrder: false,
20
+ options: [
21
+ {
22
+ code: "LegA",
23
+ description: "",
24
+ additionalProductRefs: [
25
+ { refKey: "Leg_0", catId: dummyCatId, partNumber: "LegA" },
26
+ { refKey: "Leg_1", catId: dummyCatId, partNumber: "LegA" },
27
+ { refKey: "Leg_2", catId: dummyCatId, partNumber: "LegA" },
28
+ { refKey: "Leg_3", catId: dummyCatId, partNumber: "LegA" },
29
+ ],
30
+ },
31
+ {
32
+ code: "LegB",
33
+ description: "",
34
+ additionalProductRefs: [
35
+ { refKey: "Leg_0", catId: dummyCatId, partNumber: "LegA" },
36
+ { refKey: "Leg_1", catId: dummyCatId, partNumber: "LegA" },
37
+ { refKey: "LegWheel_0", catId: dummyCatId, partNumber: "LegWheel" },
38
+ { refKey: "LegWheel_1", catId: dummyCatId, partNumber: "LegWheel" },
39
+ ],
40
+ },
41
+ ],
42
+ },
43
+ ],
44
+ productData: {
45
+ sku: "Table",
46
+ partsData: {
47
+ basePrice: 40,
48
+ currency: "EURO",
49
+ listPrice: 50,
50
+ pkgCount: 0,
51
+ styleNr: "",
52
+ selOptions: [
53
+ {
54
+ code: "!~!",
55
+ feature: "LegA",
56
+ featDesc: "",
57
+ next: {
58
+ LegA: {
59
+ code: "LegA",
60
+ feature: "LegA",
61
+ featDesc: "",
62
+ },
63
+ },
64
+ },
65
+ ],
66
+ },
67
+ },
68
+ rootFeatureRefs: [{ code: "Leg" }],
69
+ });
70
+ const LegA = () => ({
71
+ uuid: "LegA",
72
+ unit: "m",
73
+ features: [
74
+ {
75
+ code: "Color",
76
+ description: "",
77
+ numericOrder: false,
78
+ options: [
79
+ {
80
+ code: "Red",
81
+ description: "",
82
+ },
83
+ {
84
+ code: "Blue",
85
+ description: "",
86
+ },
87
+ {
88
+ code: "Yellow",
89
+ description: "",
90
+ },
91
+ ],
92
+ },
93
+ ],
94
+ productData: {
95
+ sku: "LegA",
96
+ partsData: {
97
+ basePrice: 40,
98
+ currency: "EURO",
99
+ listPrice: 50,
100
+ pkgCount: 0,
101
+ styleNr: "",
102
+ selOptions: [
103
+ {
104
+ code: "!~!",
105
+ feature: "Color",
106
+ featDesc: "",
107
+ next: {
108
+ Red: {
109
+ code: "Red",
110
+ feature: "Color",
111
+ featDesc: "",
112
+ },
113
+ },
114
+ },
115
+ ],
116
+ },
117
+ },
118
+ rootFeatureRefs: [{ code: "Color" }],
119
+ });
120
+ const LegWheel = () => ({
121
+ uuid: "LegWheel",
122
+ unit: "m",
123
+ features: [
124
+ {
125
+ code: "Color",
126
+ description: "",
127
+ numericOrder: false,
128
+ options: [
129
+ {
130
+ code: "Red",
131
+ description: "",
132
+ },
133
+ {
134
+ code: "Blue",
135
+ description: "",
136
+ },
137
+ ],
138
+ },
139
+ ],
140
+ productData: {
141
+ sku: "LegWheel",
142
+ partsData: {
143
+ basePrice: 40,
144
+ currency: "EURO",
145
+ listPrice: 50,
146
+ pkgCount: 0,
147
+ styleNr: "",
148
+ selOptions: [
149
+ {
150
+ code: "!~!",
151
+ feature: "Color",
152
+ featDesc: "",
153
+ next: {
154
+ Red: {
155
+ code: "Red",
156
+ feature: "Color",
157
+ featDesc: "",
158
+ },
159
+ },
160
+ },
161
+ ],
162
+ },
163
+ },
164
+ rootFeatureRefs: [{ code: "Color" }],
165
+ });
166
+ const getProduct = (params) => __awaiter(void 0, void 0, void 0, function* () {
167
+ const partNumber = params.partNumber;
168
+ switch (partNumber) {
169
+ case "Table":
170
+ return Table();
171
+ case "LegA":
172
+ return LegA();
173
+ case "LegWheel":
174
+ return LegWheel();
175
+ }
176
+ throw new Error("No such part");
177
+ });
178
+ export const cachedProductLoaderTest = () => __awaiter(void 0, void 0, void 0, function* () {
179
+ const validateCounter = { count: 0 };
180
+ const productLoader = {
181
+ getProduct,
182
+ postValidate: (params, _body) => __awaiter(void 0, void 0, void 0, function* () {
183
+ const productData = (yield getProduct(params)).productData;
184
+ const validateResponse = {
185
+ uuid: "",
186
+ validated: true,
187
+ productData,
188
+ };
189
+ validateCounter.count++;
190
+ return validateResponse;
191
+ }),
192
+ };
193
+ const product = yield CfgProduct.make(productLoader, "lang", dummyCatId, "Table");
194
+ return { product, validateCounter };
195
+ });
@@ -1,4 +1,4 @@
1
- import { CfgProductResponse } from "../../utilitiesCatalogueData";
2
- declare const _default: CfgProductResponse;
3
- export default _default;
1
+ import { CfgProductResponse } from "../../utilitiesCatalogueData";
2
+ declare const _default: CfgProductResponse;
3
+ export default _default;
4
4
  //# sourceMappingURL=testDataNoAdditionalProductNoPropagateForTest.d.ts.map