@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,155 +1,155 @@
1
- import { _CfgProductInternal } from "../CfgProduct.js";
2
- import { ProductLoader } from "../productLoader.js";
3
- import { SyncGroupsApplyMode } from "./SyncGroupsApplyMode.js";
4
- import { CfgPath } from "./SyncGroupsPathHelper.js";
5
- import { SyncGroupsState } from "./SyncGroupsState.js";
6
- /**
7
- * The Transaction is a transient object used to track all the changes made to the supplied
8
- * SyncGroupState as a result of a (normally) single initial event, like when opening a product
9
- * or the user selecting an option on an already open product.
10
- *
11
- * All state changes are made on an internal copy of the original SyncGroupState (called target)
12
- * so they can later be used (i.e. committed) at once to the visible product, or safely discarded
13
- * without affecting anything.
14
- *
15
- * The Transaction keeps track of which Features and SyncGroups have been affected so far, to
16
- * eliminate the risk of infinite loops.
17
- *
18
- * Terminology
19
- * ===========
20
- *
21
- * You APPLY things onto the transaction in order to update the sync state inside the transaction.
22
- * The transaction can then UPDATE other things in order to apply it's sync state onto them.
23
- *
24
- * Transaction.applyThing() ...onto the transaction
25
- * Transaction.updateThing() ...with the transaction
26
- *
27
- * @see SyncGroupHandler.ts for more information, including the general resolution algorithm.
28
- */
29
- export declare class SyncGroupsTransaction {
30
- /**
31
- * A clone of the original syncState.
32
- * Replaces the original syncState if nothing fails and the transaction doesn't get cancelled.
33
- */
34
- private readonly syncState;
35
- /**
36
- * A clone of the original product used to apply the configuration changes to.
37
- */
38
- private readonly target;
39
- /**
40
- * A clone of the original product used to track what the original state was. As a safe measure
41
- * we do not use originalProduct for this, as it might be changed by someone else.
42
- */
43
- private readonly initial;
44
- /**
45
- * The original sync state instance that this transaction will be applied on, provided nothing
46
- * fails and the transaction doesn't get cancelled.
47
- */
48
- private readonly originalSyncState;
49
- /**
50
- * The original product instance that this transaction will be applied on, provided nothing
51
- * fails and the transaction doesn't get cancelled.
52
- */
53
- private readonly originalProduct;
54
- private readonly updateMode;
55
- private readonly productLoader;
56
- static make(syncState: SyncGroupsState, updateMode: SyncGroupsApplyMode, product: _CfgProductInternal, productLoader: ProductLoader, assumeNoStartState: boolean): Promise<SyncGroupsTransaction>;
57
- private constructor();
58
- private _closed;
59
- private affectedSelectOneFeatures;
60
- private affectedSelectManyOptions;
61
- private affectedSelectOneSyncGroups;
62
- private affectedSelectManySyncGroupsAndOptions;
63
- /************************************************************************
64
- * Public API (intentionally limited)
65
- ************************************************************************/
66
- get isClosed(): boolean;
67
- close(): void;
68
- /**
69
- * This is (among other) the entry point when loading a new product.
70
- *
71
- * @returns true if at least one Feature changed it state. This is a bit counter intuitive,
72
- * but as this method will hand over to applyProduct if it updates the SyncState it can cause
73
- * the Features to change. And we need to pass that information back to know when to stop.
74
- */
75
- applyRootProduct(): Promise<boolean>;
76
- /**
77
- * This is the entry point for an active (often user) selection of an option.
78
- */
79
- selectOption(optionPath: CfgPath, on: boolean): Promise<boolean>;
80
- /**
81
- * Overwrites the original Product and SyncGroupState (supplied when creating the Transaction)
82
- * with the internal versions inside this Transaction.
83
- *
84
- * @throws error if the transaction has already been closed.
85
- */
86
- commit(): Promise<void>;
87
- /************************************************************************
88
- * Updating things with the Transaction's SyncState
89
- ************************************************************************/
90
- /**
91
- * Apply current sync groups on those who wants to listen until there is no more to settle.
92
- * @returns true if at least one Feature changed selected Option
93
- */
94
- private updateRootProduct;
95
- /**
96
- * Applies the SyncState to the Product and it's AdditionalProducts (sub-products).
97
- * @param productsToValidate To this all products that will need validation are added.
98
- */
99
- private updateProduct;
100
- /**
101
- * Applies the SyncState to an array of Features.
102
- * @param productsToValidate To this all products that will need validation are added.
103
- */
104
- private updateFeatures;
105
- /**
106
- * Applies the SyncState to an array of Options.
107
- * @param productsToValidate To this all products that will need validation are added.
108
- */
109
- private updateOptions;
110
- /**
111
- * Applies the SyncState to a Feature
112
- * @param productsToValidate To this all products that will need validation are added
113
- * @returns Whether we shall stop recursing down (because we are in a state which we
114
- * expect to be resolved later), we shall continue recursing down.
115
- */
116
- private updateFeature;
117
- /**
118
- * Decides if the SyncState can be applied to the SelectOne Feature, and then changes
119
- * the state of the Feature if so.
120
- * @param syncCode What SyncGroup the Feature belongs to
121
- * @param productsToValidate To this all products that will need validation are added
122
- * @returns Whether we shall stop recursing down (because we are in a state which we
123
- * expect to be resolved later), we shall continue recursing down.
124
- */
125
- private updateSelectOneFeature;
126
- /**
127
- * Decides if the SyncState can be applied to Options in the SelectMany Feature, and
128
- * then changes the state of the Options if so.
129
- * @param syncCode What SyncGroup the Feature belongs to
130
- * @param productsToValidate To this all products that will need validation are added
131
- * @returns Always "stop" as recursion is handled internally. Return for consistency.
132
- */
133
- private updateSelectManyFeature;
134
- /**
135
- * Decides if the SyncState can be applied to the SelectMany Option, and then changes
136
- * the state of the Option if so.
137
- * @param syncCode What SyncGroup the Feature belongs to
138
- * @param productsToValidate To this all products that will need validation are added
139
- * @returns Whether we shall stop recursing down (because we are in a state which we
140
- * expect to be resolved later), we shall continue recursing down.
141
- */
142
- private updateSelectManyOption;
143
- /************************************************************************
144
- * Applying things to the Transaction's SyncState
145
- ************************************************************************/
146
- private applyProduct;
147
- private applyFeatures;
148
- private applyOptions;
149
- private applySelectOneFeature;
150
- private applySelectManyFeature;
151
- private applySelectManyOption;
152
- private addSyncGroupAffectedForSelectMany;
153
- private hasSyncGroupAffectedForSelectMany;
154
- }
1
+ import { _CfgProductInternal } from "../CfgProduct.js";
2
+ import { ProductLoader } from "../productLoader.js";
3
+ import { SyncGroupsApplyMode } from "./SyncGroupsApplyMode.js";
4
+ import { CfgPath } from "./SyncGroupsPathHelper.js";
5
+ import { SyncGroupsState } from "./SyncGroupsState.js";
6
+ /**
7
+ * The Transaction is a transient object used to track all the changes made to the supplied
8
+ * SyncGroupState as a result of a (normally) single initial event, like when opening a product
9
+ * or the user selecting an option on an already open product.
10
+ *
11
+ * All state changes are made on an internal copy of the original SyncGroupState (called target)
12
+ * so they can later be used (i.e. committed) at once to the visible product, or safely discarded
13
+ * without affecting anything.
14
+ *
15
+ * The Transaction keeps track of which Features and SyncGroups have been affected so far, to
16
+ * eliminate the risk of infinite loops.
17
+ *
18
+ * Terminology
19
+ * ===========
20
+ *
21
+ * You APPLY things onto the transaction in order to update the sync state inside the transaction.
22
+ * The transaction can then UPDATE other things in order to apply it's sync state onto them.
23
+ *
24
+ * Transaction.applyThing() ...onto the transaction
25
+ * Transaction.updateThing() ...with the transaction
26
+ *
27
+ * @see SyncGroupHandler.ts for more information, including the general resolution algorithm.
28
+ */
29
+ export declare class SyncGroupsTransaction {
30
+ /**
31
+ * A clone of the original syncState.
32
+ * Replaces the original syncState if nothing fails and the transaction doesn't get cancelled.
33
+ */
34
+ private readonly syncState;
35
+ /**
36
+ * A clone of the original product used to apply the configuration changes to.
37
+ */
38
+ private readonly target;
39
+ /**
40
+ * A clone of the original product used to track what the original state was. As a safe measure
41
+ * we do not use originalProduct for this, as it might be changed by someone else.
42
+ */
43
+ private readonly initial;
44
+ /**
45
+ * The original sync state instance that this transaction will be applied on, provided nothing
46
+ * fails and the transaction doesn't get cancelled.
47
+ */
48
+ private readonly originalSyncState;
49
+ /**
50
+ * The original product instance that this transaction will be applied on, provided nothing
51
+ * fails and the transaction doesn't get cancelled.
52
+ */
53
+ private readonly originalProduct;
54
+ private readonly updateMode;
55
+ private readonly productLoader;
56
+ static make(syncState: SyncGroupsState, updateMode: SyncGroupsApplyMode, product: _CfgProductInternal, productLoader: ProductLoader, assumeNoStartState: boolean): Promise<SyncGroupsTransaction>;
57
+ private constructor();
58
+ private _closed;
59
+ private affectedSelectOneFeatures;
60
+ private affectedSelectManyOptions;
61
+ private affectedSelectOneSyncGroups;
62
+ private affectedSelectManySyncGroupsAndOptions;
63
+ /************************************************************************
64
+ * Public API (intentionally limited)
65
+ ************************************************************************/
66
+ get isClosed(): boolean;
67
+ close(): void;
68
+ /**
69
+ * This is (among other) the entry point when loading a new product.
70
+ *
71
+ * @returns true if at least one Feature changed it state. This is a bit counter intuitive,
72
+ * but as this method will hand over to applyProduct if it updates the SyncState it can cause
73
+ * the Features to change. And we need to pass that information back to know when to stop.
74
+ */
75
+ applyRootProduct(): Promise<boolean>;
76
+ /**
77
+ * This is the entry point for an active (often user) selection of an option.
78
+ */
79
+ selectOption(optionPath: CfgPath, on: boolean): Promise<boolean>;
80
+ /**
81
+ * Overwrites the original Product and SyncGroupState (supplied when creating the Transaction)
82
+ * with the internal versions inside this Transaction.
83
+ *
84
+ * @throws error if the transaction has already been closed.
85
+ */
86
+ commit(): Promise<void>;
87
+ /************************************************************************
88
+ * Updating things with the Transaction's SyncState
89
+ ************************************************************************/
90
+ /**
91
+ * Apply current sync groups on those who wants to listen until there is no more to settle.
92
+ * @returns true if at least one Feature changed selected Option
93
+ */
94
+ private updateRootProduct;
95
+ /**
96
+ * Applies the SyncState to the Product and it's AdditionalProducts (sub-products).
97
+ * @param productsToValidate To this all products that will need validation are added.
98
+ */
99
+ private updateProduct;
100
+ /**
101
+ * Applies the SyncState to an array of Features.
102
+ * @param productsToValidate To this all products that will need validation are added.
103
+ */
104
+ private updateFeatures;
105
+ /**
106
+ * Applies the SyncState to an array of Options.
107
+ * @param productsToValidate To this all products that will need validation are added.
108
+ */
109
+ private updateOptions;
110
+ /**
111
+ * Applies the SyncState to a Feature
112
+ * @param productsToValidate To this all products that will need validation are added
113
+ * @returns Whether we shall stop recursing down (because we are in a state which we
114
+ * expect to be resolved later), we shall continue recursing down.
115
+ */
116
+ private updateFeature;
117
+ /**
118
+ * Decides if the SyncState can be applied to the SelectOne Feature, and then changes
119
+ * the state of the Feature if so.
120
+ * @param syncCode What SyncGroup the Feature belongs to
121
+ * @param productsToValidate To this all products that will need validation are added
122
+ * @returns Whether we shall stop recursing down (because we are in a state which we
123
+ * expect to be resolved later), we shall continue recursing down.
124
+ */
125
+ private updateSelectOneFeature;
126
+ /**
127
+ * Decides if the SyncState can be applied to Options in the SelectMany Feature, and
128
+ * then changes the state of the Options if so.
129
+ * @param syncCode What SyncGroup the Feature belongs to
130
+ * @param productsToValidate To this all products that will need validation are added
131
+ * @returns Always "stop" as recursion is handled internally. Return for consistency.
132
+ */
133
+ private updateSelectManyFeature;
134
+ /**
135
+ * Decides if the SyncState can be applied to the SelectMany Option, and then changes
136
+ * the state of the Option if so.
137
+ * @param syncCode What SyncGroup the Feature belongs to
138
+ * @param productsToValidate To this all products that will need validation are added
139
+ * @returns Whether we shall stop recursing down (because we are in a state which we
140
+ * expect to be resolved later), we shall continue recursing down.
141
+ */
142
+ private updateSelectManyOption;
143
+ /************************************************************************
144
+ * Applying things to the Transaction's SyncState
145
+ ************************************************************************/
146
+ private applyProduct;
147
+ private applyFeatures;
148
+ private applyOptions;
149
+ private applySelectOneFeature;
150
+ private applySelectManyFeature;
151
+ private applySelectManyOption;
152
+ private addSyncGroupAffectedForSelectMany;
153
+ private hasSyncGroupAffectedForSelectMany;
154
+ }
155
155
  //# sourceMappingURL=SyncGroupsTransaction.d.ts.map