@configura/web-api 2.0.0-alpha.2 → 2.0.0-alpha.21

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 (100) hide show
  1. package/.eslintrc.json +5 -18
  2. package/LICENSE +201 -201
  3. package/README.md +1 -1
  4. package/dist/CatalogueAPI.d.ts +597 -551
  5. package/dist/CatalogueAPI.js +328 -293
  6. package/dist/CfgMeasure.d.ts +32 -32
  7. package/dist/CfgMeasure.js +30 -30
  8. package/dist/CfgProduct.d.ts +328 -268
  9. package/dist/CfgProduct.js +934 -778
  10. package/dist/CfgReferencePathHelper.d.ts +26 -13
  11. package/dist/CfgReferencePathHelper.js +26 -13
  12. package/dist/ConfigurationConverter.d.ts +17 -4
  13. package/dist/ConfigurationConverter.js +175 -72
  14. package/dist/index.d.ts +23 -23
  15. package/dist/index.js +23 -23
  16. package/dist/io/CfgHistoryManager.d.ts +83 -50
  17. package/dist/io/CfgHistoryManager.js +144 -82
  18. package/dist/io/CfgHistoryToProdConfConnector.d.ts +21 -20
  19. package/dist/io/CfgHistoryToProdConfConnector.js +50 -56
  20. package/dist/io/CfgIOManager.d.ts +53 -48
  21. package/dist/io/CfgIOManager.js +134 -115
  22. package/dist/io/CfgIOProdConfConnector.d.ts +64 -52
  23. package/dist/io/CfgIOProdConfConnector.js +149 -141
  24. package/dist/io/CfgIOWarningSupplier.d.ts +4 -0
  25. package/dist/io/CfgIOWarningSupplier.js +1 -0
  26. package/dist/io/CfgObservableStateManager.d.ts +25 -21
  27. package/dist/io/CfgObservableStateManager.js +69 -65
  28. package/dist/io/CfgObservableStateToProdConfConnector.d.ts +14 -14
  29. package/dist/io/CfgObservableStateToProdConfConnector.js +16 -16
  30. package/dist/io/CfgWindowEventManager.d.ts +21 -21
  31. package/dist/io/CfgWindowEventManager.js +38 -38
  32. package/dist/io/CfgWindowMessageManager.d.ts +40 -40
  33. package/dist/io/CfgWindowMessageManager.js +91 -84
  34. package/dist/io/CfgWindowMessageToProdConfConnector.d.ts +16 -16
  35. package/dist/io/CfgWindowMessageToProdConfConnector.js +18 -18
  36. package/dist/io/index.d.ts +8 -8
  37. package/dist/io/index.js +8 -8
  38. package/dist/material/CfgMaterialMapping.d.ts +7 -7
  39. package/dist/material/CfgMaterialMapping.js +181 -181
  40. package/dist/material/CfgMtrlApplication.d.ts +18 -18
  41. package/dist/material/CfgMtrlApplication.js +43 -43
  42. package/dist/material/CfgMtrlApplicationSource.d.ts +7 -7
  43. package/dist/material/CfgMtrlApplicationSource.js +8 -8
  44. package/dist/material/CfgMtrlSource.d.ts +19 -19
  45. package/dist/material/CfgMtrlSource.js +40 -40
  46. package/dist/material/CfgMtrlSourceWithMetaData.d.ts +7 -7
  47. package/dist/material/CfgMtrlSourceWithMetaData.js +1 -1
  48. package/dist/productConfiguration/CfgFeature.d.ts +189 -187
  49. package/dist/productConfiguration/CfgFeature.js +658 -645
  50. package/dist/productConfiguration/CfgOption.d.ts +151 -151
  51. package/dist/productConfiguration/CfgOption.js +422 -416
  52. package/dist/productConfiguration/CfgProductConfiguration.d.ts +129 -117
  53. package/dist/productConfiguration/CfgProductConfiguration.js +340 -307
  54. package/dist/productConfiguration/filters.d.ts +15 -15
  55. package/dist/productConfiguration/filters.js +70 -70
  56. package/dist/productConfiguration/productParamsGenerator.d.ts +15 -15
  57. package/dist/productConfiguration/productParamsGenerator.js +51 -51
  58. package/dist/productConfiguration/utilitiesProductConfiguration.d.ts +17 -17
  59. package/dist/productConfiguration/utilitiesProductConfiguration.js +87 -80
  60. package/dist/productLoader.d.ts +33 -33
  61. package/dist/productLoader.js +49 -49
  62. package/dist/syncGroups/SyncGroupsApplyMode.d.ts +20 -20
  63. package/dist/syncGroups/SyncGroupsApplyMode.js +21 -21
  64. package/dist/syncGroups/SyncGroupsHandler.d.ts +47 -40
  65. package/dist/syncGroups/SyncGroupsHandler.js +370 -359
  66. package/dist/syncGroups/SyncGroupsPathHelper.d.ts +26 -26
  67. package/dist/syncGroups/SyncGroupsPathHelper.js +90 -90
  68. package/dist/syncGroups/SyncGroupsState.d.ts +39 -35
  69. package/dist/syncGroups/SyncGroupsState.js +167 -125
  70. package/dist/syncGroups/SyncGroupsTransaction.d.ts +154 -154
  71. package/dist/syncGroups/SyncGroupsTransaction.js +589 -576
  72. package/dist/tasks/TaskHandler.d.ts +77 -77
  73. package/dist/tasks/TaskHandler.js +276 -275
  74. package/dist/tasks/formats.d.ts +4 -4
  75. package/dist/tasks/formats.js +7 -7
  76. package/dist/tests/testData/collectorForTest.d.ts +73 -73
  77. package/dist/tests/testData/collectorForTest.js +194 -194
  78. package/dist/tests/testData/dummyProductForTest.d.ts +4 -4
  79. package/dist/tests/testData/dummyProductForTest.js +32 -32
  80. package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.d.ts +11 -11
  81. package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.js +282 -277
  82. package/dist/tests/testData/testDataCachedGetProduct.d.ts +5 -5
  83. package/dist/tests/testData/testDataCachedGetProduct.js +187 -185
  84. package/dist/tests/testData/testDataCachedPostValidate.d.ts +7 -7
  85. package/dist/tests/testData/testDataCachedPostValidate.js +185 -183
  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 -187
  92. package/dist/tests/testData/testDataUpcharge.d.ts +8 -8
  93. package/dist/tests/testData/testDataUpcharge.js +121 -119
  94. package/dist/utilitiesCatalogueData.d.ts +47 -42
  95. package/dist/utilitiesCatalogueData.js +180 -173
  96. package/dist/utilitiesCataloguePermission.d.ts +38 -38
  97. package/dist/utilitiesCataloguePermission.js +79 -79
  98. package/dist/utilitiesNumericValues.d.ts +24 -24
  99. package/dist/utilitiesNumericValues.js +114 -109
  100. 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