@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,51 +1,51 @@
1
- var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
2
- var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
3
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
4
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
5
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
6
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
7
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
8
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
9
- function fulfill(value) { resume("next", value); }
10
- function reject(value) { resume("throw", value); }
11
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
12
- };
13
- import { toError } from "@configura/web-utilities";
14
- import { CfgProduct } from "../CfgProduct.js";
15
- import { applyProductRefFilters } from "./filters.js";
16
- export function generateProductConfigurations(api, lang, catalogues, filters, settings) {
17
- return __asyncGenerator(this, arguments, function* generateProductConfigurations_1() {
18
- const catalogueCount = catalogues.length;
19
- const catalogueEntries = catalogues.entries();
20
- for (const [catalogueIndex, catalogueParams] of catalogueEntries) {
21
- const params = Object.assign(Object.assign({}, catalogueParams), { lang });
22
- try {
23
- const [applicationAreasResponse, toc] = yield __await(Promise.all([
24
- api.getApplicationAreas(params),
25
- api.getTocFlat(params),
26
- ]));
27
- const [, productRefs] = applyProductRefFilters(filters, (toc === null || toc === void 0 ? void 0 : toc.prdRefs) || []);
28
- const productCount = productRefs.length;
29
- const productEntries = productRefs.entries();
30
- for (const [productIndex, prdRef] of productEntries) {
31
- const startTime = performance.now();
32
- const product = yield __await(CfgProduct.make(api, lang, params, prdRef.partNr, settings));
33
- const getProductDuration = performance.now() - startTime;
34
- yield yield __await({
35
- applicationAreasResponse,
36
- catalogueCount,
37
- catalogueIndex,
38
- catalogueParams,
39
- getProductDuration,
40
- product,
41
- productCount,
42
- productIndex,
43
- });
44
- }
45
- }
46
- catch (e) {
47
- yield yield __await(toError(e));
48
- }
49
- }
50
- });
51
- }
1
+ var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
2
+ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
3
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
4
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
5
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
6
+ function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
7
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
8
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
9
+ function fulfill(value) { resume("next", value); }
10
+ function reject(value) { resume("throw", value); }
11
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
12
+ };
13
+ import { toError } from "@configura/web-utilities";
14
+ import { CfgProduct } from "../CfgProduct.js";
15
+ import { applyProductRefFilters } from "./filters.js";
16
+ export function generateProductConfigurations(api, lang, catalogues, filters, settings) {
17
+ return __asyncGenerator(this, arguments, function* generateProductConfigurations_1() {
18
+ const catalogueCount = catalogues.length;
19
+ const catalogueEntries = catalogues.entries();
20
+ for (const [catalogueIndex, catalogueParams] of catalogueEntries) {
21
+ const params = Object.assign(Object.assign({}, catalogueParams), { lang });
22
+ try {
23
+ const [applicationAreasResponse, toc] = yield __await(Promise.all([
24
+ api.getApplicationAreas(params),
25
+ api.getTocFlat(params),
26
+ ]));
27
+ const [, productRefs] = applyProductRefFilters(filters, (toc === null || toc === void 0 ? void 0 : toc.prdRefs) || []);
28
+ const productCount = productRefs.length;
29
+ const productEntries = productRefs.entries();
30
+ for (const [productIndex, prdRef] of productEntries) {
31
+ const startTime = performance.now();
32
+ const product = yield __await(CfgProduct.make(api, lang, params, prdRef.partNr, settings));
33
+ const getProductDuration = performance.now() - startTime;
34
+ yield yield __await({
35
+ applicationAreasResponse,
36
+ catalogueCount,
37
+ catalogueIndex,
38
+ catalogueParams,
39
+ getProductDuration,
40
+ product,
41
+ productCount,
42
+ productIndex,
43
+ });
44
+ }
45
+ }
46
+ catch (e) {
47
+ yield yield __await(toError(e));
48
+ }
49
+ }
50
+ });
51
+ }
@@ -1,10 +1,10 @@
1
- import { AdditionalProductRef, Feature, FeatureRef } from "../CatalogueAPI.js";
2
- import { _CfgProductInternal } from "../CfgProduct.js";
3
- import { CfgMtrlApplication } from "../material/CfgMtrlApplication.js";
4
- import { CfgFeature } from "./CfgFeature.js";
5
- import { _CfgOptionInternal } from "./CfgOption.js";
6
- import { CfgProductConfiguration, _CfgProductConfigurationInternal } from "./CfgProductConfiguration.js";
7
- export declare function syncCfgFeatures(newFeatureRefs: FeatureRef[], currentFeatures: CfgFeature[], allRawFeatures: Feature[], parent: _CfgProductConfigurationInternal | _CfgOptionInternal, parentProduct: _CfgProductInternal, rootProduct: _CfgProductInternal): CfgFeature[];
8
- export declare function getMtrlPreview(mtrlApplications: CfgMtrlApplication[] | undefined): string | undefined;
9
- export declare function collectAdditionalProductRefs(parent: CfgProductConfiguration): AdditionalProductRef[];
1
+ import { AdditionalProductRef, Feature, FeatureRef } from "../CatalogueAPI.js";
2
+ import { _CfgProductInternal } from "../CfgProduct.js";
3
+ import { CfgMtrlApplication } from "../material/CfgMtrlApplication.js";
4
+ import { CfgFeature } from "./CfgFeature.js";
5
+ import { _CfgOptionInternal } from "./CfgOption.js";
6
+ import { CfgProductConfiguration, _CfgProductConfigurationInternal } from "./CfgProductConfiguration.js";
7
+ export declare function syncCfgFeatures(newFeatureRefs: FeatureRef[], currentFeatures: CfgFeature[], allRawFeatures: Feature[], parent: _CfgProductConfigurationInternal | _CfgOptionInternal, parentProduct: _CfgProductInternal, rootProduct: _CfgProductInternal): CfgFeature[];
8
+ export declare function getMtrlPreview(mtrlApplications: CfgMtrlApplication[] | undefined): string | undefined;
9
+ export declare function collectAdditionalProductRefs(parent: CfgProductConfiguration): AdditionalProductRef[];
10
10
  //# sourceMappingURL=utilitiesProductConfiguration.d.ts.map
@@ -1,61 +1,61 @@
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
- /// Returns a new array of CfgFeatures that maps to the newFeatureRefs array. Uses
6
- /// CfgFeatures from currentFeatures if they can be found, otherwise makes new.
7
- export function syncCfgFeatures(newFeatureRefs, currentFeatures, allRawFeatures, parent, parentProduct, rootProduct) {
8
- const usedRawFeatures = newFeatureRefs
9
- .map((r) => r.code)
10
- .map((c) => {
11
- const rawFeature = allRawFeatures.find((f) => c === f.code);
12
- if (rawFeature === undefined) {
13
- throw new Error(`Feature not found. Requested feature code: "${c}".`);
14
- }
15
- return rawFeature;
16
- });
17
- const hasDuplicateDescription = someMatch(usedRawFeatures, (l, r) => {
18
- return l.description.toLowerCase() === r.description.toLowerCase();
19
- });
20
- currentFeatures = currentFeatures.slice();
21
- return usedRawFeatures.map((f) => {
22
- // Description based code helps when switching between
23
- // products with similar feature-options tree and trying
24
- // to retain made selections
25
- const key = f.description + (f.description === "" || hasDuplicateDescription ? f.code : "");
26
- const i = currentFeatures.findIndex((cfgF) => cfgF.code === f.code && cfgF.key === key);
27
- if (i === -1) {
28
- return CfgFeature.make(f, allRawFeatures, key, parent, parentProduct, rootProduct);
29
- }
30
- return currentFeatures.splice(i, 1)[0];
31
- });
32
- }
33
- export function getMtrlPreview(mtrlApplications) {
34
- if (mtrlApplications === undefined) {
35
- return;
36
- }
37
- const first = mtrlApplications[0];
38
- if (first === undefined) {
39
- return;
40
- }
41
- return first.previewUrl;
42
- }
43
- /// Recursively find all additional product references given a
44
- /// product configuration. Only selected options are considered.
45
- export function collectAdditionalProductRefs(parent) {
46
- function c(parent) {
47
- const result = [];
48
- if (parent instanceof CfgOption && parent.selected) {
49
- result.push(...(parent.rawOption.additionalProductRefs || []));
50
- }
51
- if (parent instanceof CfgProductConfiguration || parent.selected) {
52
- for (const feature of parent.features) {
53
- for (const option of feature.options) {
54
- result.push(...c(option));
55
- }
56
- }
57
- }
58
- return result;
59
- }
60
- return c(parent);
61
- }
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
+ /// Returns a new array of CfgFeatures that maps to the newFeatureRefs array. Uses
6
+ /// CfgFeatures from currentFeatures if they can be found, otherwise makes new.
7
+ export function syncCfgFeatures(newFeatureRefs, currentFeatures, allRawFeatures, parent, parentProduct, rootProduct) {
8
+ const usedRawFeatures = newFeatureRefs
9
+ .map((r) => r.code)
10
+ .map((c) => {
11
+ const rawFeature = allRawFeatures.find((f) => c === f.code);
12
+ if (rawFeature === undefined) {
13
+ throw new Error(`Feature not found. Requested feature code: "${c}".`);
14
+ }
15
+ return rawFeature;
16
+ });
17
+ const hasDuplicateDescription = someMatch(usedRawFeatures, (l, r) => {
18
+ return l.description.toLowerCase() === r.description.toLowerCase();
19
+ });
20
+ currentFeatures = currentFeatures.slice();
21
+ return usedRawFeatures.map((f) => {
22
+ // Description based code helps when switching between
23
+ // products with similar feature-options tree and trying
24
+ // to retain made selections
25
+ const key = f.description + (f.description === "" || hasDuplicateDescription ? f.code : "");
26
+ const i = currentFeatures.findIndex((cfgF) => cfgF.code === f.code && cfgF.key === key);
27
+ if (i === -1) {
28
+ return CfgFeature.make(f, allRawFeatures, key, parent, parentProduct, rootProduct);
29
+ }
30
+ return currentFeatures.splice(i, 1)[0];
31
+ });
32
+ }
33
+ export function getMtrlPreview(mtrlApplications) {
34
+ if (mtrlApplications === undefined) {
35
+ return;
36
+ }
37
+ const first = mtrlApplications[0];
38
+ if (first === undefined) {
39
+ return;
40
+ }
41
+ return first.previewUrl;
42
+ }
43
+ /// Recursively find all additional product references given a
44
+ /// product configuration. Only selected options are considered.
45
+ export function collectAdditionalProductRefs(parent) {
46
+ function c(parent) {
47
+ const result = [];
48
+ if (parent instanceof CfgOption && parent.selected) {
49
+ result.push(...(parent.rawOption.additionalProductRefs || []));
50
+ }
51
+ if (parent instanceof CfgProductConfiguration || parent.selected) {
52
+ for (const feature of parent.features) {
53
+ for (const option of feature.options) {
54
+ result.push(...c(option));
55
+ }
56
+ }
57
+ }
58
+ return result;
59
+ }
60
+ return c(parent);
61
+ }
@@ -1,12 +1,12 @@
1
- import { GetProductParams, PostValidateParams, ValidateRequest } from "./CatalogueAPI";
2
- import { CfgProductResponse, CfgValidateResponse } from "./utilitiesCatalogueData.js";
3
- export declare type GetProduct = (params: GetProductParams) => Promise<CfgProductResponse>;
4
- export declare type PostValidate = (params: PostValidateParams, body: ValidateRequest) => Promise<CfgValidateResponse>;
5
- export declare type ProductLoader = {
6
- getProduct: GetProduct;
7
- postValidate: PostValidate;
8
- };
9
- export declare function wrapWithGetProductCache(getProduct: GetProduct): GetProduct;
10
- export declare function wrapWithPostValidateCache(postValidate: PostValidate): PostValidate;
11
- export declare function wrapWithCache(loader: ProductLoader): ProductLoader;
1
+ import { GetProductParams, PostValidateParams, ValidateRequest } from "./CatalogueAPI";
2
+ import { CfgProductResponse, CfgValidateResponse } from "./utilitiesCatalogueData.js";
3
+ export declare type GetProduct = (params: GetProductParams) => Promise<CfgProductResponse>;
4
+ export declare type PostValidate = (params: PostValidateParams, body: ValidateRequest) => Promise<CfgValidateResponse>;
5
+ export declare type ProductLoader = {
6
+ getProduct: GetProduct;
7
+ postValidate: PostValidate;
8
+ };
9
+ export declare function wrapWithGetProductCache(getProduct: GetProduct): GetProduct;
10
+ export declare function wrapWithPostValidateCache(postValidate: PostValidate): PostValidate;
11
+ export declare function wrapWithCache(loader: ProductLoader): ProductLoader;
12
12
  //# sourceMappingURL=productLoader.d.ts.map
@@ -1,41 +1,41 @@
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
- /// Wraps a getProduct function so that it caches for the time it lives.
13
- /// It has no cache invalidation or timeouts, so whatever ends up in the cache stays
14
- /// there indefinitely. For this reason we recommend using this with caution.
15
- /// In our Example App we use it to cache the internal calls in additional products
16
- /// as in such a product you tend to frequently get calls to same sub-product. Such
17
- /// as loading the same table leg four times.
18
- export function wrapWithGetProductCache(getProduct) {
19
- const cache = new PromiseCache();
20
- return (params) => __awaiter(this, void 0, void 0, function* () { return cache.get(makeProductKey(params, params.partNumber), () => getProduct(params)); });
21
- }
22
- /// Wraps a postValidate function so that it caches for the time it lives.
23
- /// It has no cache invalidation or timeouts, so whatever ends up in the cache stays
24
- /// there indefinitely. We recommend you do not use this unless you are really, really
25
- /// sure what you are doing.
26
- /// We use it in additional products to avoid validating for example the same table legs four
27
- /// times at the same time. There we make sure the this cache only stays in scope for one
28
- /// user interaction. No longer than the actions caused by a user clicking an option.
29
- export function wrapWithPostValidateCache(postValidate) {
30
- const cache = new PromiseCache();
31
- return (params, body) => __awaiter(this, void 0, void 0, function* () {
32
- return cache.get(`${makeProductKey(params, params.partNumber)}-${makeSelOptionsKey(body.selOptions)}`, () => postValidate(params, body));
33
- });
34
- }
35
- // Does both wrapWithGetProductCache and wrapWithPostValidateCache
36
- export function wrapWithCache(loader) {
37
- return {
38
- getProduct: wrapWithGetProductCache(loader.getProduct.bind(loader)),
39
- postValidate: wrapWithPostValidateCache(loader.postValidate.bind(loader)),
40
- };
41
- }
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
+ /// Wraps a getProduct function so that it caches for the time it lives.
13
+ /// It has no cache invalidation or timeouts, so whatever ends up in the cache stays
14
+ /// there indefinitely. For this reason we recommend using this with caution.
15
+ /// In our Example App we use it to cache the internal calls in additional products
16
+ /// as in such a product you tend to frequently get calls to same sub-product. Such
17
+ /// as loading the same table leg four times.
18
+ export function wrapWithGetProductCache(getProduct) {
19
+ const cache = new PromiseCache();
20
+ return (params) => __awaiter(this, void 0, void 0, function* () { return cache.get(makeProductKey(params, params.partNumber), () => getProduct(params)); });
21
+ }
22
+ /// Wraps a postValidate function so that it caches for the time it lives.
23
+ /// It has no cache invalidation or timeouts, so whatever ends up in the cache stays
24
+ /// there indefinitely. We recommend you do not use this unless you are really, really
25
+ /// sure what you are doing.
26
+ /// We use it in additional products to avoid validating for example the same table legs four
27
+ /// times at the same time. There we make sure the this cache only stays in scope for one
28
+ /// user interaction. No longer than the actions caused by a user clicking an option.
29
+ export function wrapWithPostValidateCache(postValidate) {
30
+ const cache = new PromiseCache();
31
+ return (params, body) => __awaiter(this, void 0, void 0, function* () {
32
+ return cache.get(`${makeProductKey(params, params.partNumber)}-${makeSelOptionsKey(body.selOptions)}`, () => postValidate(params, body));
33
+ });
34
+ }
35
+ // Does both wrapWithGetProductCache and wrapWithPostValidateCache
36
+ export function wrapWithCache(loader) {
37
+ return {
38
+ getProduct: wrapWithGetProductCache(loader.getProduct.bind(loader)),
39
+ postValidate: wrapWithPostValidateCache(loader.postValidate.bind(loader)),
40
+ };
41
+ }
@@ -1,74 +1,74 @@
1
- import { CfgProduct } from "../../CfgProduct";
2
- import { CfgFeature } from "../../productConfiguration/CfgFeature";
3
- import { CfgOption } from "../../productConfiguration/CfgOption";
4
- import { CfgProductConfiguration } from "../../productConfiguration/CfgProductConfiguration";
5
- declare type SnapShotForWrapper = {
6
- path: string;
7
- selected: boolean;
8
- };
9
- declare type SnapShotForWrapperWithoutRef = SnapShotForWrapper & {
10
- productConfiguration: SnapShotForConfiguration;
11
- additionalProducts: SnapShotForWrapper[];
12
- };
13
- declare type SnapShotForWrapperWithRef = SnapShotForWrapper & {
14
- ref: CfgProduct;
15
- productConfiguration: SnapShotForConfigurationWithRef;
16
- additionalProducts: SnapShotForWrapperWithRef[];
17
- };
18
- declare type SnapShotForConfiguration = {
19
- path: string;
20
- };
21
- declare type SnapShotForConfigurationWithoutRef = SnapShotForConfiguration & {
22
- features: SnapShotForFeature[];
23
- };
24
- declare type SnapShotForConfigurationWithRef = SnapShotForConfiguration & {
25
- ref: CfgProductConfiguration;
26
- features: SnapShotForFeatureWithRef[];
27
- };
28
- declare type SnapShotForFeature = {
29
- path: string;
30
- };
31
- declare type SnapShotForFeatureWithoutRef = SnapShotForFeature & {
32
- options: SnapShotForOption[];
33
- };
34
- declare type SnapShotForFeatureWithRef = SnapShotForFeature & {
35
- ref: CfgFeature;
36
- options: SnapShotForOptionWithRef[];
37
- };
38
- declare type SnapShotForOption = {
39
- path: string;
40
- selected: boolean;
41
- };
42
- declare type SnapShotForOptionWithoutRef = SnapShotForOption & {
43
- features: SnapShotForFeature[];
44
- };
45
- declare type SnapShotForOptionWithRef = SnapShotForOption & {
46
- ref: CfgOption;
47
- features: SnapShotForFeatureWithRef[];
48
- };
49
- export declare class Collector {
50
- product: CfgProduct;
51
- static stripRefsForWrapper: (w: SnapShotForWrapperWithRef) => SnapShotForWrapperWithoutRef;
52
- static stripRefsForConf: (c: SnapShotForConfigurationWithRef) => SnapShotForConfigurationWithoutRef;
53
- static stripRefsForFeature: (f: SnapShotForFeatureWithRef) => SnapShotForFeatureWithoutRef;
54
- static stripRefsForOption: (o: SnapShotForOptionWithRef) => SnapShotForOptionWithoutRef;
55
- constructor(product: CfgProduct);
56
- notifications: string[];
57
- pushNotification: (message: string) => void;
58
- takeSnapshot: () => SnapShotForWrapperWithRef;
59
- compareSnapshot: (o: SnapShotForWrapperWithRef, n: SnapShotForWrapperWithRef) => string[];
60
- takeRefSnapshotForWrapper: (path: string, product: CfgProduct) => SnapShotForWrapperWithRef;
61
- compareSnapshotForWrapper: (result: string[], o: SnapShotForWrapperWithRef, n: SnapShotForWrapperWithRef) => void;
62
- takeRefSnapshopForConf: (path: string, productConfiguration: CfgProductConfiguration) => SnapShotForConfigurationWithRef;
63
- compareSnapshopForConf: (result: string[], o: SnapShotForConfigurationWithRef, n: SnapShotForConfigurationWithRef) => void;
64
- takeRefSnapshotForFeature: (path: string, feature: CfgFeature) => SnapShotForFeatureWithRef;
65
- compareSnapshopForFeature: (result: string[], o: SnapShotForFeatureWithRef, n: SnapShotForFeatureWithRef) => void;
66
- takeRefSnapshotForOption: (path: string, option: CfgOption) => SnapShotForOptionWithRef;
67
- compareSnapshopForOption: (result: string[], o: SnapShotForOptionWithRef, n: SnapShotForOptionWithRef) => void;
68
- addListenersForProduct: (path: string, product: CfgProduct) => void;
69
- addListenersForProductConfiguration: (path: string, productConfiguration: CfgProductConfiguration) => void;
70
- addListenersForFeature: (path: string, feature: CfgFeature) => void;
71
- addListenersForOption: (path: string, option: CfgOption) => void;
72
- }
73
- export {};
1
+ import { CfgProduct } from "../../CfgProduct";
2
+ import { CfgFeature } from "../../productConfiguration/CfgFeature";
3
+ import { CfgOption } from "../../productConfiguration/CfgOption";
4
+ import { CfgProductConfiguration } from "../../productConfiguration/CfgProductConfiguration";
5
+ declare type SnapShotForWrapper = {
6
+ path: string;
7
+ selected: boolean;
8
+ };
9
+ declare type SnapShotForWrapperWithoutRef = SnapShotForWrapper & {
10
+ productConfiguration: SnapShotForConfiguration;
11
+ additionalProducts: SnapShotForWrapper[];
12
+ };
13
+ declare type SnapShotForWrapperWithRef = SnapShotForWrapper & {
14
+ ref: CfgProduct;
15
+ productConfiguration: SnapShotForConfigurationWithRef;
16
+ additionalProducts: SnapShotForWrapperWithRef[];
17
+ };
18
+ declare type SnapShotForConfiguration = {
19
+ path: string;
20
+ };
21
+ declare type SnapShotForConfigurationWithoutRef = SnapShotForConfiguration & {
22
+ features: SnapShotForFeature[];
23
+ };
24
+ declare type SnapShotForConfigurationWithRef = SnapShotForConfiguration & {
25
+ ref: CfgProductConfiguration;
26
+ features: SnapShotForFeatureWithRef[];
27
+ };
28
+ declare type SnapShotForFeature = {
29
+ path: string;
30
+ };
31
+ declare type SnapShotForFeatureWithoutRef = SnapShotForFeature & {
32
+ options: SnapShotForOption[];
33
+ };
34
+ declare type SnapShotForFeatureWithRef = SnapShotForFeature & {
35
+ ref: CfgFeature;
36
+ options: SnapShotForOptionWithRef[];
37
+ };
38
+ declare type SnapShotForOption = {
39
+ path: string;
40
+ selected: boolean;
41
+ };
42
+ declare type SnapShotForOptionWithoutRef = SnapShotForOption & {
43
+ features: SnapShotForFeature[];
44
+ };
45
+ declare type SnapShotForOptionWithRef = SnapShotForOption & {
46
+ ref: CfgOption;
47
+ features: SnapShotForFeatureWithRef[];
48
+ };
49
+ export declare class Collector {
50
+ product: CfgProduct;
51
+ static stripRefsForWrapper: (w: SnapShotForWrapperWithRef) => SnapShotForWrapperWithoutRef;
52
+ static stripRefsForConf: (c: SnapShotForConfigurationWithRef) => SnapShotForConfigurationWithoutRef;
53
+ static stripRefsForFeature: (f: SnapShotForFeatureWithRef) => SnapShotForFeatureWithoutRef;
54
+ static stripRefsForOption: (o: SnapShotForOptionWithRef) => SnapShotForOptionWithoutRef;
55
+ constructor(product: CfgProduct);
56
+ notifications: string[];
57
+ pushNotification: (message: string) => void;
58
+ takeSnapshot: () => SnapShotForWrapperWithRef;
59
+ compareSnapshot: (o: SnapShotForWrapperWithRef, n: SnapShotForWrapperWithRef) => string[];
60
+ takeRefSnapshotForWrapper: (path: string, product: CfgProduct) => SnapShotForWrapperWithRef;
61
+ compareSnapshotForWrapper: (result: string[], o: SnapShotForWrapperWithRef, n: SnapShotForWrapperWithRef) => void;
62
+ takeRefSnapshopForConf: (path: string, productConfiguration: CfgProductConfiguration) => SnapShotForConfigurationWithRef;
63
+ compareSnapshopForConf: (result: string[], o: SnapShotForConfigurationWithRef, n: SnapShotForConfigurationWithRef) => void;
64
+ takeRefSnapshotForFeature: (path: string, feature: CfgFeature) => SnapShotForFeatureWithRef;
65
+ compareSnapshopForFeature: (result: string[], o: SnapShotForFeatureWithRef, n: SnapShotForFeatureWithRef) => void;
66
+ takeRefSnapshotForOption: (path: string, option: CfgOption) => SnapShotForOptionWithRef;
67
+ compareSnapshopForOption: (result: string[], o: SnapShotForOptionWithRef, n: SnapShotForOptionWithRef) => void;
68
+ addListenersForProduct: (path: string, product: CfgProduct) => void;
69
+ addListenersForProductConfiguration: (path: string, productConfiguration: CfgProductConfiguration) => void;
70
+ addListenersForFeature: (path: string, feature: CfgFeature) => void;
71
+ addListenersForOption: (path: string, option: CfgOption) => void;
72
+ }
73
+ export {};
74
74
  //# sourceMappingURL=collectorForTest.d.ts.map