@configura/web-api 1.3.0-alpha.0 → 1.3.0-alpha.4

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 (53) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +1 -1
  3. package/dist/CatalogueAPI.d.ts +448 -448
  4. package/dist/CatalogueAPI.js +206 -206
  5. package/dist/CfgProduct.d.ts +116 -116
  6. package/dist/CfgProduct.js +588 -588
  7. package/dist/index.d.ts +15 -15
  8. package/dist/index.js +15 -15
  9. package/dist/material/CfgMaterialMapping.d.ts +7 -7
  10. package/dist/material/CfgMaterialMapping.js +176 -176
  11. package/dist/material/CfgMtrlApplication.d.ts +18 -18
  12. package/dist/material/CfgMtrlApplication.js +43 -43
  13. package/dist/material/CfgMtrlApplicationSource.d.ts +7 -7
  14. package/dist/material/CfgMtrlApplicationSource.js +8 -8
  15. package/dist/material/CfgMtrlSource.d.ts +19 -19
  16. package/dist/material/CfgMtrlSource.js +40 -40
  17. package/dist/material/CfgMtrlSourceWithMetaData.d.ts +7 -7
  18. package/dist/material/CfgMtrlSourceWithMetaData.js +1 -1
  19. package/dist/productConfiguration/CfgFeature.d.ts +134 -80
  20. package/dist/productConfiguration/CfgFeature.js +483 -451
  21. package/dist/productConfiguration/CfgOption.d.ts +112 -64
  22. package/dist/productConfiguration/CfgOption.js +293 -263
  23. package/dist/productConfiguration/CfgProductConfiguration.d.ts +50 -50
  24. package/dist/productConfiguration/CfgProductConfiguration.js +198 -198
  25. package/dist/productConfiguration/filters.d.ts +7 -7
  26. package/dist/productConfiguration/filters.js +29 -29
  27. package/dist/productConfiguration/productParamsGenerator.d.ts +15 -15
  28. package/dist/productConfiguration/productParamsGenerator.js +51 -51
  29. package/dist/productConfiguration/utilitiesProductConfiguration.d.ts +9 -9
  30. package/dist/productConfiguration/utilitiesProductConfiguration.js +61 -61
  31. package/dist/productLoader.d.ts +11 -11
  32. package/dist/productLoader.js +41 -41
  33. package/dist/tests/testData/collectorForTest.d.ts +73 -73
  34. package/dist/tests/testData/collectorForTest.js +195 -195
  35. package/dist/tests/testData/dummyProductForTest.d.ts +4 -4
  36. package/dist/tests/testData/dummyProductForTest.js +35 -35
  37. package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.d.ts +32 -32
  38. package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.js +368 -368
  39. package/dist/tests/testData/testDataCachedGetProduct.d.ts +5 -5
  40. package/dist/tests/testData/testDataCachedGetProduct.js +199 -199
  41. package/dist/tests/testData/testDataCachedPostValidate.d.ts +7 -7
  42. package/dist/tests/testData/testDataCachedPostValidate.js +189 -189
  43. package/dist/tests/testData/testDataNoAdditionalProductNoPropagateForTest.d.ts +3 -3
  44. package/dist/tests/testData/testDataNoAdditionalProductNoPropagateForTest.js +1117 -1117
  45. package/dist/tests/testData/testDataProductAggregatedPrice.d.ts +28 -28
  46. package/dist/tests/testData/testDataProductAggregatedPrice.js +205 -205
  47. package/dist/tests/testData/testDataUpcharge.d.ts +29 -29
  48. package/dist/tests/testData/testDataUpcharge.js +159 -159
  49. package/dist/utilitiesCatalogueData.d.ts +20 -18
  50. package/dist/utilitiesCatalogueData.js +64 -56
  51. package/dist/utilitiesCataloguePermission.d.ts +39 -39
  52. package/dist/utilitiesCataloguePermission.js +84 -84
  53. package/package.json +3 -3
@@ -1,189 +1,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
- 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
+ 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,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