@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.
Files changed (102) hide show
  1. package/.eslintrc.json +5 -5
  2. package/LICENSE +201 -201
  3. package/README.md +1 -1
  4. package/dist/CatalogueAPI.d.ts +633 -633
  5. package/dist/CatalogueAPI.js +312 -312
  6. package/dist/CfgMeasure.d.ts +32 -32
  7. package/dist/CfgMeasure.js +30 -30
  8. package/dist/CfgProduct.d.ts +359 -344
  9. package/dist/CfgProduct.js +1005 -992
  10. package/dist/CfgReferencePathHelper.d.ts +26 -26
  11. package/dist/CfgReferencePathHelper.js +26 -26
  12. package/dist/index.d.ts +24 -24
  13. package/dist/index.js +24 -24
  14. package/dist/io/CfgHistoryManager.d.ts +83 -83
  15. package/dist/io/CfgHistoryManager.js +144 -144
  16. package/dist/io/CfgHistoryToProdConfConnector.d.ts +21 -21
  17. package/dist/io/CfgHistoryToProdConfConnector.js +50 -50
  18. package/dist/io/CfgIOManager.d.ts +53 -53
  19. package/dist/io/CfgIOManager.js +134 -134
  20. package/dist/io/CfgIOProdConfConnector.d.ts +54 -54
  21. package/dist/io/CfgIOProdConfConnector.js +139 -139
  22. package/dist/io/CfgIOWarningSupplier.d.ts +3 -3
  23. package/dist/io/CfgIOWarningSupplier.js +1 -1
  24. package/dist/io/CfgObservableStateManager.d.ts +25 -25
  25. package/dist/io/CfgObservableStateManager.js +69 -69
  26. package/dist/io/CfgObservableStateToProdConfConnector.d.ts +15 -15
  27. package/dist/io/CfgObservableStateToProdConfConnector.js +17 -17
  28. package/dist/io/CfgWindowEventManager.d.ts +21 -21
  29. package/dist/io/CfgWindowEventManager.js +38 -38
  30. package/dist/io/CfgWindowMessageManager.d.ts +40 -40
  31. package/dist/io/CfgWindowMessageManager.js +91 -91
  32. package/dist/io/CfgWindowMessageToProdConfConnector.d.ts +17 -17
  33. package/dist/io/CfgWindowMessageToProdConfConnector.js +19 -19
  34. package/dist/io/index.d.ts +8 -8
  35. package/dist/io/index.js +8 -8
  36. package/dist/material/CfgMaterialMapping.d.ts +7 -7
  37. package/dist/material/CfgMaterialMapping.js +181 -181
  38. package/dist/material/CfgMtrlApplication.d.ts +18 -18
  39. package/dist/material/CfgMtrlApplication.js +43 -43
  40. package/dist/material/CfgMtrlApplicationSource.d.ts +7 -7
  41. package/dist/material/CfgMtrlApplicationSource.js +8 -8
  42. package/dist/material/CfgMtrlSource.d.ts +19 -19
  43. package/dist/material/CfgMtrlSource.js +40 -40
  44. package/dist/material/CfgMtrlSourceWithMetaData.d.ts +7 -7
  45. package/dist/material/CfgMtrlSourceWithMetaData.js +1 -1
  46. package/dist/productConfiguration/CfgFeature.d.ts +199 -199
  47. package/dist/productConfiguration/CfgFeature.js +691 -691
  48. package/dist/productConfiguration/CfgOption.d.ts +160 -160
  49. package/dist/productConfiguration/CfgOption.js +464 -464
  50. package/dist/productConfiguration/CfgProductConfiguration.d.ts +136 -129
  51. package/dist/productConfiguration/CfgProductConfiguration.js +355 -346
  52. package/dist/productConfiguration/filters.d.ts +17 -17
  53. package/dist/productConfiguration/filters.js +141 -141
  54. package/dist/productConfiguration/productParamsGenerator.d.ts +15 -15
  55. package/dist/productConfiguration/productParamsGenerator.js +65 -65
  56. package/dist/productConfiguration/utilitiesProductConfiguration.d.ts +17 -17
  57. package/dist/productConfiguration/utilitiesProductConfiguration.js +89 -87
  58. package/dist/productLoader.d.ts +33 -33
  59. package/dist/productLoader.js +49 -49
  60. package/dist/syncGroups/SyncGroupsApplyMode.d.ts +20 -20
  61. package/dist/syncGroups/SyncGroupsApplyMode.js +21 -21
  62. package/dist/syncGroups/SyncGroupsHandler.d.ts +47 -47
  63. package/dist/syncGroups/SyncGroupsHandler.js +370 -370
  64. package/dist/syncGroups/SyncGroupsPathHelper.d.ts +26 -26
  65. package/dist/syncGroups/SyncGroupsPathHelper.js +90 -90
  66. package/dist/syncGroups/SyncGroupsState.d.ts +39 -39
  67. package/dist/syncGroups/SyncGroupsState.js +167 -167
  68. package/dist/syncGroups/SyncGroupsTransaction.d.ts +154 -154
  69. package/dist/syncGroups/SyncGroupsTransaction.js +589 -589
  70. package/dist/tasks/TaskHandler.d.ts +77 -77
  71. package/dist/tasks/TaskHandler.js +276 -276
  72. package/dist/tasks/formats.d.ts +4 -4
  73. package/dist/tasks/formats.js +7 -7
  74. package/dist/tests/testData/collectorForTest.d.ts +73 -73
  75. package/dist/tests/testData/collectorForTest.js +194 -194
  76. package/dist/tests/testData/dummyProductForTest.d.ts +4 -4
  77. package/dist/tests/testData/dummyProductForTest.js +32 -32
  78. package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.d.ts +11 -11
  79. package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.js +282 -282
  80. package/dist/tests/testData/testDataCachedGetProduct.d.ts +5 -5
  81. package/dist/tests/testData/testDataCachedGetProduct.js +187 -187
  82. package/dist/tests/testData/testDataCachedPostValidate.d.ts +7 -7
  83. package/dist/tests/testData/testDataCachedPostValidate.js +185 -185
  84. package/dist/tests/testData/testDataConstraints.d.ts +3 -3
  85. package/dist/tests/testData/testDataConstraints.js +174 -174
  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 -189
  92. package/dist/tests/testData/testDataUpcharge.d.ts +8 -8
  93. package/dist/tests/testData/testDataUpcharge.js +121 -121
  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/utilitiesConfiguration.d.ts +28 -28
  99. package/dist/utilitiesConfiguration.js +200 -200
  100. package/dist/utilitiesNumericValues.d.ts +24 -24
  101. package/dist/utilitiesNumericValues.js +114 -114
  102. package/package.json +3 -3
@@ -1,87 +1,89 @@
1
- import { someMatch } from "@configura/web-utilities";
2
- import { CfgFeature } from "./CfgFeature.js";
3
- import { CfgOption } from "./CfgOption.js";
4
- import { CfgProductConfiguration, } from "./CfgProductConfiguration.js";
5
- /**
6
- * Returns a new array of CfgFeatures that maps to the newFeatureRefs array. Uses CfgFeatures from
7
- * currentFeatures if they can be found, otherwise makes new.
8
- */
9
- export function syncCfgFeatures(newFeatureRefs, currentFeatures, rawFeatures, parent, parentConfiguration, parentProduct, rootProduct) {
10
- const usedRawFeatures = newFeatureRefs
11
- .map((r) => r.code)
12
- .map((c) => {
13
- const rawFeature = rawFeatures.find((f) => c === f.code);
14
- if (rawFeature === undefined) {
15
- throw new Error(`Feature not found. Requested feature code: "${c}".`);
16
- }
17
- return rawFeature;
18
- });
19
- const hasDuplicateDescription = someMatch(usedRawFeatures, (l, r) => {
20
- return l.description.toLowerCase() === r.description.toLowerCase();
21
- });
22
- const newFeatures = [];
23
- for (const f of usedRawFeatures) {
24
- const fCode = f.code;
25
- const fDescription = f.description;
26
- // It is possible in Cat Creator to add the same Feature twice
27
- // to the root of a Product. This fills no apparent purpose,
28
- // and in CET the seem to behave as if they were the same.
29
- // Removing the duplicates causes sync issues where the server
30
- // expects all copies, and hence we short circuit them here
31
- // by letting them refer to the same object instead.
32
- const twin = newFeatures.find((f) => f.code === fCode);
33
- if (twin !== undefined) {
34
- newFeatures.push(twin);
35
- continue;
36
- }
37
- // Description based code helps when switching between
38
- // products with similar feature-options tree and trying
39
- // to retain made selections
40
- const key = fDescription + (fDescription === "" || hasDuplicateDescription ? fCode : "");
41
- const existingFeature = currentFeatures.find((cfgF) => cfgF.code === fCode);
42
- if (existingFeature !== undefined) {
43
- if (hasDuplicateDescription) {
44
- // HasDuplicateDescription could mean the key need to be more specific compared
45
- // to the one we already have, so then we set it. An old duplicate description
46
- // key will cause no harm as it is guaranteed to be at least as specific as this.
47
- // Not changing the key will make React not rerender, so we don't change.
48
- existingFeature._internal.key = key;
49
- }
50
- newFeatures.push(existingFeature);
51
- continue;
52
- }
53
- newFeatures.push(CfgFeature.make(f, rawFeatures, key, parent, parentConfiguration, parentProduct, rootProduct));
54
- }
55
- return newFeatures;
56
- }
57
- export function getMtrlPreview(mtrlApplications) {
58
- if (mtrlApplications === undefined) {
59
- return;
60
- }
61
- const first = mtrlApplications[0];
62
- if (first === undefined) {
63
- return;
64
- }
65
- return first.previewUrl;
66
- }
67
- /**
68
- * Recursively find all additional product references given a product configuration.
69
- * Only selected options are considered.
70
- */
71
- export function collectAdditionalProductRefs(parent) {
72
- function c(parent) {
73
- const result = [];
74
- if (parent instanceof CfgOption && parent.selected) {
75
- result.push(...(parent.rawOption.additionalProductRefs || []));
76
- }
77
- if (parent instanceof CfgProductConfiguration || parent.selected) {
78
- for (const feature of parent.features) {
79
- for (const option of feature.options) {
80
- result.push(...c(option));
81
- }
82
- }
83
- }
84
- return result;
85
- }
86
- return c(parent);
87
- }
1
+ import { someMatch } from "@configura/web-utilities";
2
+ import { CfgFeature } from "./CfgFeature.js";
3
+ import { CfgOption } from "./CfgOption.js";
4
+ import { CfgProductConfiguration, } from "./CfgProductConfiguration.js";
5
+ /**
6
+ * Returns a new array of CfgFeatures that maps to the newFeatureRefs array. Uses CfgFeatures from
7
+ * currentFeatures if they can be found, otherwise makes new.
8
+ */
9
+ export function syncCfgFeatures(newFeatureRefs, currentFeatures, rawFeatures, parent, parentConfiguration, parentProduct, rootProduct) {
10
+ const usedRawFeatures = newFeatureRefs
11
+ .map((r) => r.code)
12
+ .map((c) => {
13
+ const rawFeature = rawFeatures.find((f) => c === f.code);
14
+ if (rawFeature === undefined) {
15
+ throw new Error(`Feature not found. Requested feature code: "${c}".`);
16
+ }
17
+ return rawFeature;
18
+ });
19
+ const hasDuplicateDescription = parentProduct.settings.disableMatchOnDescription
20
+ ? true
21
+ : someMatch(usedRawFeatures, (l, r) => {
22
+ return l.description.toLowerCase() === r.description.toLowerCase();
23
+ });
24
+ const newFeatures = [];
25
+ for (const f of usedRawFeatures) {
26
+ const fCode = f.code;
27
+ const fDescription = f.description;
28
+ // It is possible in Cat Creator to add the same Feature twice
29
+ // to the root of a Product. This fills no apparent purpose,
30
+ // and in CET the seem to behave as if they were the same.
31
+ // Removing the duplicates causes sync issues where the server
32
+ // expects all copies, and hence we short circuit them here
33
+ // by letting them refer to the same object instead.
34
+ const twin = newFeatures.find((f) => f.code === fCode);
35
+ if (twin !== undefined) {
36
+ newFeatures.push(twin);
37
+ continue;
38
+ }
39
+ // Description based code helps when switching between
40
+ // products with similar feature-options tree and trying
41
+ // to retain made selections
42
+ const key = fDescription + (fDescription === "" || hasDuplicateDescription ? fCode : "");
43
+ const existingFeature = currentFeatures.find((cfgF) => cfgF.code === fCode);
44
+ if (existingFeature !== undefined) {
45
+ if (hasDuplicateDescription) {
46
+ // HasDuplicateDescription could mean the key need to be more specific compared
47
+ // to the one we already have, so then we set it. An old duplicate description
48
+ // key will cause no harm as it is guaranteed to be at least as specific as this.
49
+ // Not changing the key will make React not rerender, so we don't change.
50
+ existingFeature._internal.key = key;
51
+ }
52
+ newFeatures.push(existingFeature);
53
+ continue;
54
+ }
55
+ newFeatures.push(CfgFeature.make(f, rawFeatures, key, parent, parentConfiguration, parentProduct, rootProduct));
56
+ }
57
+ return newFeatures;
58
+ }
59
+ export function getMtrlPreview(mtrlApplications) {
60
+ if (mtrlApplications === undefined) {
61
+ return;
62
+ }
63
+ const first = mtrlApplications[0];
64
+ if (first === undefined) {
65
+ return;
66
+ }
67
+ return first.previewUrl;
68
+ }
69
+ /**
70
+ * Recursively find all additional product references given a product configuration.
71
+ * Only selected options are considered.
72
+ */
73
+ export function collectAdditionalProductRefs(parent) {
74
+ function c(parent) {
75
+ const result = [];
76
+ if (parent instanceof CfgOption && parent.selected) {
77
+ result.push(...(parent.rawOption.additionalProductRefs || []));
78
+ }
79
+ if (parent instanceof CfgProductConfiguration || parent.selected) {
80
+ for (const feature of parent.features) {
81
+ for (const option of feature.options) {
82
+ result.push(...c(option));
83
+ }
84
+ }
85
+ }
86
+ return result;
87
+ }
88
+ return c(parent);
89
+ }
@@ -1,34 +1,34 @@
1
- import { DtoProductParamsWithCidAndLang, DtoValidateRequest } from "./CatalogueAPI.js";
2
- import { CfgProductResponse, CfgValidateResponse } from "./utilitiesCatalogueData.js";
3
- export declare type GetProduct = (params: DtoProductParamsWithCidAndLang) => Promise<CfgProductResponse>;
4
- export declare type PostValidate = (params: DtoProductParamsWithCidAndLang, body: DtoValidateRequest) => Promise<CfgValidateResponse>;
5
- export declare type ProductLoader = {
6
- getProduct: GetProduct;
7
- postValidate: PostValidate;
8
- };
9
- /**
10
- * Wraps a getProduct function so that it caches for the time it lives.
11
- *
12
- * It has no cache invalidation or timeouts, so whatever ends up in the cache stays there
13
- * indefinitely. For this reason we recommend using this with caution.
14
- *
15
- * In our Example App we use it to cache the internal calls in additional products as in such a
16
- * product you tend to frequently get calls to same sub-product. Such as loading the same table leg
17
- * four times.
18
- */
19
- export declare function wrapWithGetProductCache(getProduct: GetProduct): GetProduct;
20
- /**
21
- * Wraps a postValidate function so that it caches for the time it lives.
22
- *
23
- * It has no cache invalidation or timeouts, so whatever ends up in the cache stays there
24
- * indefinitely. We recommend you do not use this unless you are really, really sure what you are
25
- * doing.
26
- *
27
- * The SDK uses it for additional products to avoid validating for example the same table legs four
28
- * times at the same time. There we make sure the this cache only stays in scope for one user
29
- * interaction. No longer than the actions caused by a user clicking an option.
30
- */
31
- export declare function wrapWithPostValidateCache(postValidate: PostValidate): PostValidate;
32
- /** Does both wrapWithGetProductCache and wrapWithPostValidateCache. */
33
- export declare function wrapWithCache(loader: ProductLoader): ProductLoader;
1
+ import { DtoProductParamsWithCidAndLang, DtoValidateRequest } from "./CatalogueAPI.js";
2
+ import { CfgProductResponse, CfgValidateResponse } from "./utilitiesCatalogueData.js";
3
+ export declare type GetProduct = (params: DtoProductParamsWithCidAndLang) => Promise<CfgProductResponse>;
4
+ export declare type PostValidate = (params: DtoProductParamsWithCidAndLang, body: DtoValidateRequest) => Promise<CfgValidateResponse>;
5
+ export declare type ProductLoader = {
6
+ getProduct: GetProduct;
7
+ postValidate: PostValidate;
8
+ };
9
+ /**
10
+ * Wraps a getProduct function so that it caches for the time it lives.
11
+ *
12
+ * It has no cache invalidation or timeouts, so whatever ends up in the cache stays there
13
+ * indefinitely. For this reason we recommend using this with caution.
14
+ *
15
+ * In our Example App we use it to cache the internal calls in additional products as in such a
16
+ * product you tend to frequently get calls to same sub-product. Such as loading the same table leg
17
+ * four times.
18
+ */
19
+ export declare function wrapWithGetProductCache(getProduct: GetProduct): GetProduct;
20
+ /**
21
+ * Wraps a postValidate function so that it caches for the time it lives.
22
+ *
23
+ * It has no cache invalidation or timeouts, so whatever ends up in the cache stays there
24
+ * indefinitely. We recommend you do not use this unless you are really, really sure what you are
25
+ * doing.
26
+ *
27
+ * The SDK uses it for additional products to avoid validating for example the same table legs four
28
+ * times at the same time. There we make sure the this cache only stays in scope for one user
29
+ * interaction. No longer than the actions caused by a user clicking an option.
30
+ */
31
+ export declare function wrapWithPostValidateCache(postValidate: PostValidate): PostValidate;
32
+ /** Does both wrapWithGetProductCache and wrapWithPostValidateCache. */
33
+ export declare function wrapWithCache(loader: ProductLoader): ProductLoader;
34
34
  //# sourceMappingURL=productLoader.d.ts.map
@@ -1,49 +1,49 @@
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 { PromiseCache } from "@configura/web-utilities";
11
- import { makeProductKey, makeSelOptionsKey, } from "./utilitiesCatalogueData.js";
12
- /**
13
- * Wraps a getProduct function so that it caches for the time it lives.
14
- *
15
- * It has no cache invalidation or timeouts, so whatever ends up in the cache stays there
16
- * indefinitely. For this reason we recommend using this with caution.
17
- *
18
- * In our Example App we use it to cache the internal calls in additional products as in such a
19
- * product you tend to frequently get calls to same sub-product. Such as loading the same table leg
20
- * four times.
21
- */
22
- export function wrapWithGetProductCache(getProduct) {
23
- const cache = new PromiseCache();
24
- return (params) => __awaiter(this, void 0, void 0, function* () { return cache.get(makeProductKey(params), () => getProduct(params)); });
25
- }
26
- /**
27
- * Wraps a postValidate function so that it caches for the time it lives.
28
- *
29
- * It has no cache invalidation or timeouts, so whatever ends up in the cache stays there
30
- * indefinitely. We recommend you do not use this unless you are really, really sure what you are
31
- * doing.
32
- *
33
- * The SDK uses it for additional products to avoid validating for example the same table legs four
34
- * times at the same time. There we make sure the this cache only stays in scope for one user
35
- * interaction. No longer than the actions caused by a user clicking an option.
36
- */
37
- export function wrapWithPostValidateCache(postValidate) {
38
- const cache = new PromiseCache();
39
- return (params, body) => __awaiter(this, void 0, void 0, function* () {
40
- return cache.get(`${makeProductKey(params)}-${makeSelOptionsKey(body.selOptions)}-${body.knownFeatureCodes.join(",")}`, () => postValidate(params, body));
41
- });
42
- }
43
- /** Does both wrapWithGetProductCache and wrapWithPostValidateCache. */
44
- export function wrapWithCache(loader) {
45
- return {
46
- getProduct: wrapWithGetProductCache(loader.getProduct.bind(loader)),
47
- postValidate: wrapWithPostValidateCache(loader.postValidate.bind(loader)),
48
- };
49
- }
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 { PromiseCache } from "@configura/web-utilities";
11
+ import { makeProductKey, makeSelOptionsKey, } from "./utilitiesCatalogueData.js";
12
+ /**
13
+ * Wraps a getProduct function so that it caches for the time it lives.
14
+ *
15
+ * It has no cache invalidation or timeouts, so whatever ends up in the cache stays there
16
+ * indefinitely. For this reason we recommend using this with caution.
17
+ *
18
+ * In our Example App we use it to cache the internal calls in additional products as in such a
19
+ * product you tend to frequently get calls to same sub-product. Such as loading the same table leg
20
+ * four times.
21
+ */
22
+ export function wrapWithGetProductCache(getProduct) {
23
+ const cache = new PromiseCache();
24
+ return (params) => __awaiter(this, void 0, void 0, function* () { return cache.get(makeProductKey(params), () => getProduct(params)); });
25
+ }
26
+ /**
27
+ * Wraps a postValidate function so that it caches for the time it lives.
28
+ *
29
+ * It has no cache invalidation or timeouts, so whatever ends up in the cache stays there
30
+ * indefinitely. We recommend you do not use this unless you are really, really sure what you are
31
+ * doing.
32
+ *
33
+ * The SDK uses it for additional products to avoid validating for example the same table legs four
34
+ * times at the same time. There we make sure the this cache only stays in scope for one user
35
+ * interaction. No longer than the actions caused by a user clicking an option.
36
+ */
37
+ export function wrapWithPostValidateCache(postValidate) {
38
+ const cache = new PromiseCache();
39
+ return (params, body) => __awaiter(this, void 0, void 0, function* () {
40
+ return cache.get(`${makeProductKey(params)}-${makeSelOptionsKey(body.selOptions)}-${body.knownFeatureCodes.join(",")}`, () => postValidate(params, body));
41
+ });
42
+ }
43
+ /** Does both wrapWithGetProductCache and wrapWithPostValidateCache. */
44
+ export function wrapWithCache(loader) {
45
+ return {
46
+ getProduct: wrapWithGetProductCache(loader.getProduct.bind(loader)),
47
+ postValidate: wrapWithPostValidateCache(loader.postValidate.bind(loader)),
48
+ };
49
+ }
@@ -1,21 +1,21 @@
1
- /**
2
- * The SyncGroupsApplyMode controls how many SyncGroups can be updated in the SyncState for one
3
- * run of rootProductOntoSyncState.
4
- *
5
- * "Fast" will update any SyncGroup that should be updated before running syncStateOntoRootProduct
6
- * This way several SyncGroups can be applied in one go before sending the validation calls to the * server, making the whole process faster.
7
- *
8
- * The downside of this is that is not exactly how CET (the desktop software) works. CET will
9
- * instead apply Features to the SyncState as soon as it gets the chance.
10
- *
11
- * "Strict" tries to behave exactly as CET. This will potentially generate a lot more validate
12
- * calls, increasing delay and cost.
13
- *
14
- * Strict is the safer option of the two, but we still recommend trying out Fast since it should
15
- * work fine in most cases.
16
- */
17
- export declare enum SyncGroupsApplyMode {
18
- Strict = "Strict",
19
- Fast = "Fast"
20
- }
1
+ /**
2
+ * The SyncGroupsApplyMode controls how many SyncGroups can be updated in the SyncState for one
3
+ * run of rootProductOntoSyncState.
4
+ *
5
+ * "Fast" will update any SyncGroup that should be updated before running syncStateOntoRootProduct
6
+ * This way several SyncGroups can be applied in one go before sending the validation calls to the * server, making the whole process faster.
7
+ *
8
+ * The downside of this is that is not exactly how CET (the desktop software) works. CET will
9
+ * instead apply Features to the SyncState as soon as it gets the chance.
10
+ *
11
+ * "Strict" tries to behave exactly as CET. This will potentially generate a lot more validate
12
+ * calls, increasing delay and cost.
13
+ *
14
+ * Strict is the safer option of the two, but we still recommend trying out Fast since it should
15
+ * work fine in most cases.
16
+ */
17
+ export declare enum SyncGroupsApplyMode {
18
+ Strict = "Strict",
19
+ Fast = "Fast"
20
+ }
21
21
  //# sourceMappingURL=SyncGroupsApplyMode.d.ts.map
@@ -1,21 +1,21 @@
1
- /**
2
- * The SyncGroupsApplyMode controls how many SyncGroups can be updated in the SyncState for one
3
- * run of rootProductOntoSyncState.
4
- *
5
- * "Fast" will update any SyncGroup that should be updated before running syncStateOntoRootProduct
6
- * This way several SyncGroups can be applied in one go before sending the validation calls to the * server, making the whole process faster.
7
- *
8
- * The downside of this is that is not exactly how CET (the desktop software) works. CET will
9
- * instead apply Features to the SyncState as soon as it gets the chance.
10
- *
11
- * "Strict" tries to behave exactly as CET. This will potentially generate a lot more validate
12
- * calls, increasing delay and cost.
13
- *
14
- * Strict is the safer option of the two, but we still recommend trying out Fast since it should
15
- * work fine in most cases.
16
- */
17
- export var SyncGroupsApplyMode;
18
- (function (SyncGroupsApplyMode) {
19
- SyncGroupsApplyMode["Strict"] = "Strict";
20
- SyncGroupsApplyMode["Fast"] = "Fast";
21
- })(SyncGroupsApplyMode || (SyncGroupsApplyMode = {}));
1
+ /**
2
+ * The SyncGroupsApplyMode controls how many SyncGroups can be updated in the SyncState for one
3
+ * run of rootProductOntoSyncState.
4
+ *
5
+ * "Fast" will update any SyncGroup that should be updated before running syncStateOntoRootProduct
6
+ * This way several SyncGroups can be applied in one go before sending the validation calls to the * server, making the whole process faster.
7
+ *
8
+ * The downside of this is that is not exactly how CET (the desktop software) works. CET will
9
+ * instead apply Features to the SyncState as soon as it gets the chance.
10
+ *
11
+ * "Strict" tries to behave exactly as CET. This will potentially generate a lot more validate
12
+ * calls, increasing delay and cost.
13
+ *
14
+ * Strict is the safer option of the two, but we still recommend trying out Fast since it should
15
+ * work fine in most cases.
16
+ */
17
+ export var SyncGroupsApplyMode;
18
+ (function (SyncGroupsApplyMode) {
19
+ SyncGroupsApplyMode["Strict"] = "Strict";
20
+ SyncGroupsApplyMode["Fast"] = "Fast";
21
+ })(SyncGroupsApplyMode || (SyncGroupsApplyMode = {}));
@@ -1,48 +1,48 @@
1
- import { AggregatedLoadingObservable } from "@configura/web-utilities";
2
- import { DtoSyncGroupState } from "../CatalogueAPI.js";
3
- import { _CfgProductInternal } from "../CfgProduct.js";
4
- import { _CfgOptionInternal } from "../productConfiguration/CfgOption.js";
5
- import { ProductLoader } from "../productLoader.js";
6
- import { SyncGroupsApplyMode } from "./SyncGroupsApplyMode.js";
7
- import { SyncGroupsTransaction } from "./SyncGroupsTransaction.js";
8
- export declare type SyncCode = string;
9
- export declare type OptionCode = string;
10
- /**
11
- * Is used to apply the SyncGroups functionality on the Configuration and the other way around.
12
- * It also keeps the SyncState.
13
- */
14
- export declare class SyncGroupsHandler {
15
- private _syncState;
16
- readonly updateMode: SyncGroupsApplyMode;
17
- private readonly _loadingObservable;
18
- private _currentTransaction;
19
- /**
20
- * @param verboseLogging Set to true to get verbose sync state changes logged to the console.
21
- */
22
- static make(updateMode?: SyncGroupsApplyMode, loadingObservable?: AggregatedLoadingObservable, initial?: DtoSyncGroupState, verboseLogging?: boolean): SyncGroupsHandler;
23
- private constructor();
24
- /** Please note that clones will use the same loadingObservable as their source. */
25
- clone(): SyncGroupsHandler;
26
- getCompactSyncGroupState(): DtoSyncGroupState;
27
- /** Overwrites the sync state */
28
- setCompactSyncGroupState(s: DtoSyncGroupState): void;
29
- get verboseLogging(): boolean;
30
- set verboseLogging(v: boolean);
31
- /**
32
- * Used to initially apply the sync state onto a new product so that it is "in sync"
33
- * and to reapply the sync state when an optional additional product is selected.
34
- */
35
- init(product: _CfgProductInternal, productLoader: ProductLoader): Promise<void>;
36
- /**
37
- * Used when an Option is selected or deselected to apply all consequences of the sync groups.
38
- * Can cause multiple extra validation calls to the server.
39
- */
40
- selectOption(product: _CfgProductInternal, option: _CfgOptionInternal, on: boolean, productLoader: ProductLoader): Promise<boolean>;
41
- private _pending;
42
- private setPending;
43
- get pending(): _CfgOptionInternal | undefined;
44
- private newTransaction;
45
- private closeTransaction;
46
- commitTransaction(transaction: SyncGroupsTransaction): Promise<void>;
47
- }
1
+ import { AggregatedLoadingObservable } from "@configura/web-utilities";
2
+ import { DtoSyncGroupState } from "../CatalogueAPI.js";
3
+ import { _CfgProductInternal } from "../CfgProduct.js";
4
+ import { _CfgOptionInternal } from "../productConfiguration/CfgOption.js";
5
+ import { ProductLoader } from "../productLoader.js";
6
+ import { SyncGroupsApplyMode } from "./SyncGroupsApplyMode.js";
7
+ import { SyncGroupsTransaction } from "./SyncGroupsTransaction.js";
8
+ export declare type SyncCode = string;
9
+ export declare type OptionCode = string;
10
+ /**
11
+ * Is used to apply the SyncGroups functionality on the Configuration and the other way around.
12
+ * It also keeps the SyncState.
13
+ */
14
+ export declare class SyncGroupsHandler {
15
+ private _syncState;
16
+ readonly updateMode: SyncGroupsApplyMode;
17
+ private readonly _loadingObservable;
18
+ private _currentTransaction;
19
+ /**
20
+ * @param verboseLogging Set to true to get verbose sync state changes logged to the console.
21
+ */
22
+ static make(updateMode?: SyncGroupsApplyMode, loadingObservable?: AggregatedLoadingObservable, initial?: DtoSyncGroupState, verboseLogging?: boolean): SyncGroupsHandler;
23
+ private constructor();
24
+ /** Please note that clones will use the same loadingObservable as their source. */
25
+ clone(): SyncGroupsHandler;
26
+ getCompactSyncGroupState(): DtoSyncGroupState;
27
+ /** Overwrites the sync state */
28
+ setCompactSyncGroupState(s: DtoSyncGroupState): void;
29
+ get verboseLogging(): boolean;
30
+ set verboseLogging(v: boolean);
31
+ /**
32
+ * Used to initially apply the sync state onto a new product so that it is "in sync"
33
+ * and to reapply the sync state when an optional additional product is selected.
34
+ */
35
+ init(product: _CfgProductInternal, productLoader: ProductLoader): Promise<void>;
36
+ /**
37
+ * Used when an Option is selected or deselected to apply all consequences of the sync groups.
38
+ * Can cause multiple extra validation calls to the server.
39
+ */
40
+ selectOption(product: _CfgProductInternal, option: _CfgOptionInternal, on: boolean, productLoader: ProductLoader): Promise<boolean>;
41
+ private _pending;
42
+ private setPending;
43
+ get pending(): _CfgOptionInternal | undefined;
44
+ private newTransaction;
45
+ private closeTransaction;
46
+ commitTransaction(transaction: SyncGroupsTransaction): Promise<void>;
47
+ }
48
48
  //# sourceMappingURL=SyncGroupsHandler.d.ts.map