@configura/web-api 1.4.0-alpha.4 → 1.4.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 +504 -504
  4. package/dist/CatalogueAPI.js +248 -248
  5. package/dist/CfgMeasure.d.ts +32 -32
  6. package/dist/CfgMeasure.js +30 -30
  7. package/dist/CfgProduct.d.ts +217 -217
  8. package/dist/CfgProduct.js +636 -636
  9. package/dist/index.d.ts +16 -16
  10. package/dist/index.js +16 -16
  11. package/dist/material/CfgMaterialMapping.d.ts +7 -7
  12. package/dist/material/CfgMaterialMapping.js +181 -181
  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 -160
  22. package/dist/productConfiguration/CfgFeature.js +593 -593
  23. package/dist/productConfiguration/CfgOption.d.ts +128 -128
  24. package/dist/productConfiguration/CfgOption.js +394 -394
  25. package/dist/productConfiguration/CfgProductConfiguration.d.ts +120 -120
  26. package/dist/productConfiguration/CfgProductConfiguration.js +307 -307
  27. package/dist/productConfiguration/filters.d.ts +15 -15
  28. package/dist/productConfiguration/filters.js +67 -67
  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 -17
  32. package/dist/productConfiguration/utilitiesProductConfiguration.js +80 -80
  33. package/dist/productLoader.d.ts +33 -33
  34. package/dist/productLoader.js +49 -49
  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 -36
  39. package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.d.ts +32 -32
  40. package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.js +348 -348
  41. package/dist/tests/testData/testDataCachedGetProduct.d.ts +5 -5
  42. package/dist/tests/testData/testDataCachedGetProduct.js +196 -196
  43. package/dist/tests/testData/testDataCachedPostValidate.d.ts +7 -7
  44. package/dist/tests/testData/testDataCachedPostValidate.js +183 -183
  45. package/dist/tests/testData/testDataNoAdditionalProductNoPropagateForTest.d.ts +3 -3
  46. package/dist/tests/testData/testDataNoAdditionalProductNoPropagateForTest.js +1099 -1099
  47. package/dist/tests/testData/testDataProductAggregatedPrice.d.ts +6 -6
  48. package/dist/tests/testData/testDataProductAggregatedPrice.js +198 -198
  49. package/dist/tests/testData/testDataUpcharge.d.ts +29 -29
  50. package/dist/tests/testData/testDataUpcharge.js +151 -151
  51. package/dist/utilitiesCatalogueData.d.ts +25 -25
  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 +24 -24
  56. package/dist/utilitiesNumericValues.js +109 -109
  57. package/package.json +3 -3
@@ -1,183 +1,183 @@
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
- next: {
56
- LegA: {
57
- code: "LegA",
58
- },
59
- },
60
- },
61
- ],
62
- },
63
- },
64
- rootFeatureRefs: [{ code: "Leg" }],
65
- });
66
- const LegA = () => ({
67
- uuid: "LegA",
68
- unit: "m",
69
- features: [
70
- {
71
- code: "Color",
72
- description: "",
73
- numericOrder: false,
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
- next: {
102
- Red: {
103
- code: "Red",
104
- },
105
- },
106
- },
107
- ],
108
- },
109
- },
110
- rootFeatureRefs: [{ code: "Color" }],
111
- });
112
- const LegWheel = () => ({
113
- uuid: "LegWheel",
114
- unit: "m",
115
- features: [
116
- {
117
- code: "Color",
118
- description: "",
119
- numericOrder: false,
120
- options: [
121
- {
122
- code: "Red",
123
- description: "",
124
- },
125
- {
126
- code: "Blue",
127
- description: "",
128
- },
129
- ],
130
- },
131
- ],
132
- productData: {
133
- sku: "LegWheel",
134
- partsData: {
135
- basePrice: 40,
136
- currency: "EURO",
137
- listPrice: 50,
138
- pkgCount: 0,
139
- styleNr: "",
140
- selOptions: [
141
- {
142
- code: "!~!",
143
- next: {
144
- Red: {
145
- code: "Red",
146
- },
147
- },
148
- },
149
- ],
150
- },
151
- },
152
- rootFeatureRefs: [{ code: "Color" }],
153
- });
154
- const getProduct = (params) => __awaiter(void 0, void 0, void 0, function* () {
155
- const partNumber = params.partNumber;
156
- switch (partNumber) {
157
- case "Table":
158
- return Table();
159
- case "LegA":
160
- return LegA();
161
- case "LegWheel":
162
- return LegWheel();
163
- }
164
- throw new Error("No such part");
165
- });
166
- export const cachedProductLoaderTest = () => __awaiter(void 0, void 0, void 0, function* () {
167
- const validateCounter = { count: 0 };
168
- const productLoader = {
169
- getProduct,
170
- postValidate: (params, _body) => __awaiter(void 0, void 0, void 0, function* () {
171
- const productData = (yield getProduct(params)).productData;
172
- const validateResponse = {
173
- uuid: "",
174
- validated: true,
175
- productData,
176
- };
177
- validateCounter.count++;
178
- return validateResponse;
179
- }),
180
- };
181
- const product = yield CfgProduct.make(productLoader, "lang", dummyCatId, "Table");
182
- return { product, validateCounter };
183
- });
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
+ next: {
56
+ LegA: {
57
+ code: "LegA",
58
+ },
59
+ },
60
+ },
61
+ ],
62
+ },
63
+ },
64
+ rootFeatureRefs: [{ code: "Leg" }],
65
+ });
66
+ const LegA = () => ({
67
+ uuid: "LegA",
68
+ unit: "m",
69
+ features: [
70
+ {
71
+ code: "Color",
72
+ description: "",
73
+ numericOrder: false,
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
+ next: {
102
+ Red: {
103
+ code: "Red",
104
+ },
105
+ },
106
+ },
107
+ ],
108
+ },
109
+ },
110
+ rootFeatureRefs: [{ code: "Color" }],
111
+ });
112
+ const LegWheel = () => ({
113
+ uuid: "LegWheel",
114
+ unit: "m",
115
+ features: [
116
+ {
117
+ code: "Color",
118
+ description: "",
119
+ numericOrder: false,
120
+ options: [
121
+ {
122
+ code: "Red",
123
+ description: "",
124
+ },
125
+ {
126
+ code: "Blue",
127
+ description: "",
128
+ },
129
+ ],
130
+ },
131
+ ],
132
+ productData: {
133
+ sku: "LegWheel",
134
+ partsData: {
135
+ basePrice: 40,
136
+ currency: "EURO",
137
+ listPrice: 50,
138
+ pkgCount: 0,
139
+ styleNr: "",
140
+ selOptions: [
141
+ {
142
+ code: "!~!",
143
+ next: {
144
+ Red: {
145
+ code: "Red",
146
+ },
147
+ },
148
+ },
149
+ ],
150
+ },
151
+ },
152
+ rootFeatureRefs: [{ code: "Color" }],
153
+ });
154
+ const getProduct = (params) => __awaiter(void 0, void 0, void 0, function* () {
155
+ const partNumber = params.partNumber;
156
+ switch (partNumber) {
157
+ case "Table":
158
+ return Table();
159
+ case "LegA":
160
+ return LegA();
161
+ case "LegWheel":
162
+ return LegWheel();
163
+ }
164
+ throw new Error("No such part");
165
+ });
166
+ export const cachedProductLoaderTest = () => __awaiter(void 0, void 0, void 0, function* () {
167
+ const validateCounter = { count: 0 };
168
+ const productLoader = {
169
+ getProduct,
170
+ postValidate: (params, _body) => __awaiter(void 0, void 0, void 0, function* () {
171
+ const productData = (yield getProduct(params)).productData;
172
+ const validateResponse = {
173
+ uuid: "",
174
+ validated: true,
175
+ productData,
176
+ };
177
+ validateCounter.count++;
178
+ return validateResponse;
179
+ }),
180
+ };
181
+ const product = yield CfgProduct.make(productLoader, "lang", dummyCatId, "Table");
182
+ return { product, validateCounter };
183
+ });
@@ -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