@configura/web-api 1.6.1 → 2.0.0-alpha.2
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.
- package/.eslintrc.json +18 -18
- package/LICENSE +201 -201
- package/README.md +1 -1
- package/dist/CatalogueAPI.d.ts +551 -507
- package/dist/CatalogueAPI.js +293 -280
- package/dist/CfgMeasure.d.ts +32 -32
- package/dist/CfgMeasure.js +30 -30
- package/dist/CfgProduct.d.ts +268 -258
- package/dist/CfgProduct.js +778 -747
- package/dist/CfgReferencePathHelper.d.ts +14 -0
- package/dist/CfgReferencePathHelper.js +13 -0
- package/dist/ConfigurationConverter.d.ts +5 -0
- package/dist/ConfigurationConverter.js +72 -0
- package/dist/index.d.ts +23 -20
- package/dist/index.js +23 -20
- package/dist/io/CfgHistoryManager.d.ts +51 -0
- package/dist/io/CfgHistoryManager.js +82 -0
- package/dist/io/CfgHistoryToProdConfConnector.d.ts +21 -0
- package/dist/io/CfgHistoryToProdConfConnector.js +56 -0
- package/dist/io/CfgIOManager.d.ts +49 -0
- package/dist/io/CfgIOManager.js +115 -0
- package/dist/io/CfgIOProdConfConnector.d.ts +53 -0
- package/dist/io/CfgIOProdConfConnector.js +141 -0
- package/dist/io/CfgObservableStateManager.d.ts +22 -0
- package/dist/io/CfgObservableStateManager.js +65 -0
- package/dist/io/CfgObservableStateToProdConfConnector.d.ts +15 -0
- package/dist/io/CfgObservableStateToProdConfConnector.js +16 -0
- package/dist/io/CfgWindowEventManager.d.ts +22 -0
- package/dist/io/CfgWindowEventManager.js +38 -0
- package/dist/io/CfgWindowMessageManager.d.ts +41 -0
- package/dist/io/CfgWindowMessageManager.js +84 -0
- package/dist/io/CfgWindowMessageToProdConfConnector.d.ts +17 -0
- package/dist/io/CfgWindowMessageToProdConfConnector.js +18 -0
- package/dist/io/index.d.ts +9 -0
- package/dist/io/index.js +8 -0
- package/dist/material/CfgMaterialMapping.d.ts +7 -7
- package/dist/material/CfgMaterialMapping.js +181 -181
- package/dist/material/CfgMtrlApplication.d.ts +18 -18
- package/dist/material/CfgMtrlApplication.js +43 -43
- package/dist/material/CfgMtrlApplicationSource.d.ts +7 -7
- package/dist/material/CfgMtrlApplicationSource.js +8 -8
- package/dist/material/CfgMtrlSource.d.ts +19 -19
- package/dist/material/CfgMtrlSource.js +40 -40
- package/dist/material/CfgMtrlSourceWithMetaData.d.ts +7 -7
- package/dist/material/CfgMtrlSourceWithMetaData.js +1 -1
- package/dist/productConfiguration/CfgFeature.d.ts +187 -188
- package/dist/productConfiguration/CfgFeature.js +645 -636
- package/dist/productConfiguration/CfgOption.d.ts +151 -150
- package/dist/productConfiguration/CfgOption.js +416 -426
- package/dist/productConfiguration/CfgProductConfiguration.d.ts +117 -120
- package/dist/productConfiguration/CfgProductConfiguration.js +307 -309
- package/dist/productConfiguration/filters.d.ts +15 -15
- package/dist/productConfiguration/filters.js +70 -70
- package/dist/productConfiguration/productParamsGenerator.d.ts +15 -15
- package/dist/productConfiguration/productParamsGenerator.js +51 -51
- package/dist/productConfiguration/utilitiesProductConfiguration.d.ts +17 -17
- package/dist/productConfiguration/utilitiesProductConfiguration.js +80 -80
- package/dist/productLoader.d.ts +33 -33
- package/dist/productLoader.js +49 -49
- package/dist/syncGroups/SyncGroupsApplyMode.d.ts +20 -20
- package/dist/syncGroups/SyncGroupsApplyMode.js +21 -21
- package/dist/syncGroups/SyncGroupsHandler.d.ts +40 -40
- package/dist/syncGroups/SyncGroupsHandler.js +359 -358
- package/dist/syncGroups/SyncGroupsPathHelper.d.ts +26 -26
- package/dist/syncGroups/SyncGroupsPathHelper.js +90 -90
- package/dist/syncGroups/SyncGroupsState.d.ts +35 -35
- package/dist/syncGroups/SyncGroupsState.js +125 -125
- package/dist/syncGroups/SyncGroupsTransaction.d.ts +154 -154
- package/dist/syncGroups/SyncGroupsTransaction.js +576 -576
- package/dist/tasks/TaskHandler.d.ts +77 -78
- package/dist/tasks/TaskHandler.js +275 -276
- package/dist/tasks/formats.d.ts +4 -4
- package/dist/tasks/formats.js +7 -7
- package/dist/tests/testData/collectorForTest.d.ts +73 -73
- package/dist/tests/testData/collectorForTest.js +194 -194
- package/dist/tests/testData/dummyProductForTest.d.ts +4 -4
- package/dist/tests/testData/dummyProductForTest.js +32 -36
- package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.d.ts +11 -11
- package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.js +277 -277
- package/dist/tests/testData/testDataCachedGetProduct.d.ts +5 -5
- package/dist/tests/testData/testDataCachedGetProduct.js +185 -185
- package/dist/tests/testData/testDataCachedPostValidate.d.ts +7 -7
- package/dist/tests/testData/testDataCachedPostValidate.js +183 -183
- package/dist/tests/testData/testDataNoAdditionalProductNoPropagateForTest.d.ts +3 -3
- package/dist/tests/testData/testDataNoAdditionalProductNoPropagateForTest.js +1099 -1099
- package/dist/tests/testData/testDataOptions.d.ts +12 -12
- package/dist/tests/testData/testDataOptions.js +60 -60
- package/dist/tests/testData/testDataProductAggregatedPrice.d.ts +6 -6
- package/dist/tests/testData/testDataProductAggregatedPrice.js +187 -187
- package/dist/tests/testData/testDataUpcharge.d.ts +8 -8
- package/dist/tests/testData/testDataUpcharge.js +119 -119
- package/dist/utilitiesCatalogueData.d.ts +42 -31
- package/dist/utilitiesCatalogueData.js +173 -162
- package/dist/utilitiesCataloguePermission.d.ts +38 -37
- package/dist/utilitiesCataloguePermission.js +79 -80
- package/dist/utilitiesNumericValues.d.ts +24 -24
- package/dist/utilitiesNumericValues.js +109 -109
- package/package.json +3 -3
|
@@ -1,121 +1,118 @@
|
|
|
1
|
-
import { LengthUnit, Observable, SingleArgCallback } from "@configura/web-utilities";
|
|
2
|
-
import {
|
|
3
|
-
import { CfgProduct, _CfgProductInternal } from "../CfgProduct.js";
|
|
4
|
-
import { CfgFeature, _CfgFeatureInternal } from "./CfgFeature.js";
|
|
5
|
-
import { ProductConfigurationBubbleMode } from "./CfgOption.js";
|
|
6
|
-
export declare type ProductConfigurationChangeNotification = {
|
|
7
|
-
freshRef: CfgProductConfiguration;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
private
|
|
29
|
-
readonly
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
*
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
stopListenForChange: (l: SingleArgCallback<ProductConfigurationChangeNotification>) => void;
|
|
119
|
-
stopAllListenForChange: () => void;
|
|
120
|
-
}
|
|
1
|
+
import { LengthUnit, LengthValue, Observable, SingleArgCallback } from "@configura/web-utilities";
|
|
2
|
+
import { DtoConfFeature, DtoFeature, DtoFeatureRef, DtoSelectedOption } from "../CatalogueAPI.js";
|
|
3
|
+
import { CfgProduct, _CfgProductInternal } from "../CfgProduct.js";
|
|
4
|
+
import { CfgFeature, _CfgFeatureInternal } from "./CfgFeature.js";
|
|
5
|
+
import { ProductConfigurationBubbleMode } from "./CfgOption.js";
|
|
6
|
+
export declare type ProductConfigurationChangeNotification = {
|
|
7
|
+
freshRef: CfgProductConfiguration;
|
|
8
|
+
committed: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare type StretchMap = Map<string, {
|
|
11
|
+
def: LengthValue | undefined;
|
|
12
|
+
current: LengthValue;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* This class is meant to only be used through CfgProductConfiguration. It should never be
|
|
16
|
+
* instantiated on its own. Normally the internal state of this class should never be directly
|
|
17
|
+
* modified. CfgProductConfiguration is the class that should be used and interacted with.
|
|
18
|
+
*/
|
|
19
|
+
export declare class _CfgProductConfigurationInternal {
|
|
20
|
+
readonly allRawFeatures: DtoFeature[];
|
|
21
|
+
readonly parentProduct: _CfgProductInternal;
|
|
22
|
+
readonly rootProduct: _CfgProductInternal;
|
|
23
|
+
static _makeUninitialized(rootFeatureRefs: DtoFeatureRef[], allRawFeatures: DtoFeature[], // Flat packed. All the features that can appear anyplace in the selection tree.
|
|
24
|
+
parentProduct: _CfgProductInternal, rootProduct: _CfgProductInternal): _CfgProductConfigurationInternal;
|
|
25
|
+
private constructor();
|
|
26
|
+
readonly key = "~";
|
|
27
|
+
private _rootFeatureRefs;
|
|
28
|
+
private _features;
|
|
29
|
+
readonly stretchReferenceLengthsByMeasureParamCode: StretchMap;
|
|
30
|
+
readonly changeObservable: Observable<ProductConfigurationChangeNotification>;
|
|
31
|
+
get rootFeatureRefs(): DtoFeatureRef[];
|
|
32
|
+
get features(): CfgFeature[];
|
|
33
|
+
private _notifyAllOfChange;
|
|
34
|
+
_freshRefDescendants(): void;
|
|
35
|
+
/** Called by child to tell its parent that it has changed. */
|
|
36
|
+
_childHasChanged: (freshRef: CfgFeature, bubbleMode: ProductConfigurationBubbleMode, committed: boolean) => Promise<void>;
|
|
37
|
+
getDtoConf: (includeExtendedData: boolean) => DtoConfFeature[];
|
|
38
|
+
/**
|
|
39
|
+
* When used internally the notifications are taken care off by the caller, but if set from
|
|
40
|
+
* outside we want notifications to bubble all the way to the root.
|
|
41
|
+
*/
|
|
42
|
+
setApiSelection: (selectedOptions: DtoSelectedOption[], bubbleToRoot: boolean) => Promise<boolean>;
|
|
43
|
+
structureCompare: (other: _CfgProductConfigurationInternal, strictOrder: boolean, descriptionMatch: boolean) => boolean;
|
|
44
|
+
/**
|
|
45
|
+
* When used internally the notifications are taken care off by the caller, but if set from
|
|
46
|
+
* outside we want notifications to bubble all the way to the root.
|
|
47
|
+
*/
|
|
48
|
+
tryMatchSelection: (other: _CfgProductConfigurationInternal, descriptionMatch: boolean | undefined, validate: boolean) => Promise<boolean>;
|
|
49
|
+
/** Only selected features. */
|
|
50
|
+
_getFeaturesWithCode: (code: string) => _CfgFeatureInternal[];
|
|
51
|
+
populateFeatures: (rootFeatureRefs: DtoFeatureRef[]) => void;
|
|
52
|
+
setStretchReferenceLength: (measureParamCode: string, referenceLength: number | undefined, unit: LengthUnit) => Promise<boolean>;
|
|
53
|
+
}
|
|
54
|
+
export declare class CfgProductConfiguration {
|
|
55
|
+
readonly _internal: _CfgProductConfigurationInternal;
|
|
56
|
+
/**
|
|
57
|
+
* This method is semi-async. It will immediately give you a reference to the created
|
|
58
|
+
* CfgProductConfiguration, but is not properly initialized until the initDone-callback
|
|
59
|
+
* has been called.
|
|
60
|
+
*/
|
|
61
|
+
static make(initSuccess: (c: CfgProductConfiguration) => void, initFail: (error: Error) => void, rootFeatureRefs: DtoFeatureRef[], allRawFeatures: DtoFeature[], // Flat packed. All the features that can appear anyplace in the selection tree.
|
|
62
|
+
apiSelection: DtoSelectedOption[], parentProduct: _CfgProductInternal, rootProduct: _CfgProductInternal): CfgProductConfiguration;
|
|
63
|
+
/**
|
|
64
|
+
* Makes an object wrapping the passed object. This is not a clone method, it is a method to
|
|
65
|
+
* make a new outer reference. Like a shallow copy.
|
|
66
|
+
*
|
|
67
|
+
* We use this to help frameworks that are built around using equals to detect change.
|
|
68
|
+
*/
|
|
69
|
+
static _makeNewRefFrom(internal: _CfgProductConfigurationInternal): CfgProductConfiguration;
|
|
70
|
+
/**
|
|
71
|
+
* Private constructor and make-method because make new ref requires the constructor to take an
|
|
72
|
+
* internal and we don't want those who instantiate CfgProductConfiguration to have to be aware
|
|
73
|
+
* of the internal.
|
|
74
|
+
*/
|
|
75
|
+
private constructor();
|
|
76
|
+
isBackedBySame: (other: CfgProductConfiguration) => boolean;
|
|
77
|
+
get parentProduct(): CfgProduct;
|
|
78
|
+
get rootProduct(): CfgProduct;
|
|
79
|
+
get key(): string;
|
|
80
|
+
/**
|
|
81
|
+
* Every (unprocessed) feature which might be used in this product. This is constant for a
|
|
82
|
+
* product load. What features are actually used is controlled by rootFeatureRefs and what
|
|
83
|
+
* options are selected.
|
|
84
|
+
*/
|
|
85
|
+
get allRawFeatures(): DtoFeature[];
|
|
86
|
+
/** What features are used in the root of this. This can change with new validate calls. */
|
|
87
|
+
get rootFeatureRefs(): DtoFeatureRef[];
|
|
88
|
+
/** The root features at the root of the selection tree. */
|
|
89
|
+
get features(): CfgFeature[];
|
|
90
|
+
structureCompare: (other: CfgProductConfiguration, strictOrder?: boolean, descriptionMatch?: boolean) => boolean;
|
|
91
|
+
/**
|
|
92
|
+
* This method will try to match the selection from another product configuration
|
|
93
|
+
* This method does not propagate its selections.
|
|
94
|
+
* This method will cause validation calls.
|
|
95
|
+
*/
|
|
96
|
+
tryMatchSelection: (other: CfgProductConfiguration, descriptionMatch?: boolean) => Promise<boolean>;
|
|
97
|
+
getApiSelection: () => DtoSelectedOption[];
|
|
98
|
+
/**
|
|
99
|
+
* This method does not propagate its selections.
|
|
100
|
+
* This method will not cause validation calls. Data is assumed to already be validated.
|
|
101
|
+
*/
|
|
102
|
+
setApiSelection: (selectedOptions: DtoSelectedOption[]) => Promise<boolean>;
|
|
103
|
+
/**
|
|
104
|
+
* Set how stretched a certain measure should be measureParamCode is the measure to be
|
|
105
|
+
* stretched referenceLength is a value relative to the initial length of the measure. If the
|
|
106
|
+
* stretch drawn up in Model Lab was from the start let's say 2.4 units from start point to end
|
|
107
|
+
* point a reference value of 4.8 would stretch the start point to end point to double length.
|
|
108
|
+
* This however does not stop things from extending outside start point to end point. So the
|
|
109
|
+
* actual perceived length after stretching might have little to do with the referenceLength.
|
|
110
|
+
* Undefined as referenceLength will clear, that is, make the stretched thing revert to its
|
|
111
|
+
* default state.
|
|
112
|
+
*/
|
|
113
|
+
setStretchReferenceLength: (measureParamCode: string, referenceLength: number, unit: LengthUnit) => Promise<boolean>;
|
|
114
|
+
listenForChange: (l: SingleArgCallback<ProductConfigurationChangeNotification>) => void;
|
|
115
|
+
stopListenForChange: (l: SingleArgCallback<ProductConfigurationChangeNotification>) => void;
|
|
116
|
+
stopAllListenForChange: () => void;
|
|
117
|
+
}
|
|
121
118
|
//# sourceMappingURL=CfgProductConfiguration.d.ts.map
|