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

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 (52) hide show
  1. package/dist/CatalogueAPI.d.ts +73 -43
  2. package/dist/CatalogueAPI.js +37 -2
  3. package/dist/CfgProduct.d.ts +73 -11
  4. package/dist/CfgProduct.js +130 -29
  5. package/dist/CfgReferencePathHelper.d.ts +16 -3
  6. package/dist/CfgReferencePathHelper.js +14 -1
  7. package/dist/ConfigurationConverter.d.ts +13 -4
  8. package/dist/ConfigurationConverter.js +106 -12
  9. package/dist/io/CfgHistoryManager.d.ts +37 -4
  10. package/dist/io/CfgHistoryManager.js +76 -8
  11. package/dist/io/CfgHistoryToProdConfConnector.d.ts +7 -10
  12. package/dist/io/CfgHistoryToProdConfConnector.js +29 -38
  13. package/dist/io/CfgIOManager.d.ts +5 -0
  14. package/dist/io/CfgIOManager.js +20 -1
  15. package/dist/io/CfgIOProdConfConnector.d.ts +21 -17
  16. package/dist/io/CfgIOProdConfConnector.js +54 -37
  17. package/dist/io/CfgIOWarningSupplier.d.ts +4 -0
  18. package/dist/io/CfgIOWarningSupplier.js +1 -0
  19. package/dist/io/CfgObservableStateManager.d.ts +4 -0
  20. package/dist/io/CfgObservableStateManager.js +4 -0
  21. package/dist/io/CfgObservableStateToProdConfConnector.d.ts +4 -4
  22. package/dist/io/CfgObservableStateToProdConfConnector.js +4 -4
  23. package/dist/io/CfgWindowMessageManager.d.ts +2 -2
  24. package/dist/io/CfgWindowMessageManager.js +9 -2
  25. package/dist/io/CfgWindowMessageToProdConfConnector.d.ts +4 -4
  26. package/dist/io/CfgWindowMessageToProdConfConnector.js +4 -4
  27. package/dist/productConfiguration/CfgFeature.d.ts +8 -6
  28. package/dist/productConfiguration/CfgFeature.js +19 -6
  29. package/dist/productConfiguration/CfgOption.d.ts +5 -5
  30. package/dist/productConfiguration/CfgOption.js +11 -5
  31. package/dist/productConfiguration/CfgProductConfiguration.d.ts +27 -15
  32. package/dist/productConfiguration/CfgProductConfiguration.js +54 -21
  33. package/dist/productConfiguration/filters.d.ts +2 -2
  34. package/dist/productConfiguration/productParamsGenerator.d.ts +3 -3
  35. package/dist/productConfiguration/utilitiesProductConfiguration.d.ts +1 -1
  36. package/dist/productConfiguration/utilitiesProductConfiguration.js +11 -4
  37. package/dist/productLoader.d.ts +3 -3
  38. package/dist/syncGroups/SyncGroupsHandler.d.ts +4 -1
  39. package/dist/syncGroups/SyncGroupsHandler.js +6 -2
  40. package/dist/syncGroups/SyncGroupsTransaction.js +34 -21
  41. package/dist/tasks/TaskHandler.d.ts +2 -2
  42. package/dist/tasks/TaskHandler.js +2 -1
  43. package/dist/tests/testData/dummyProductForTest.d.ts +2 -2
  44. package/dist/tests/testData/testDataAdditionalProductInAdditionalProductInProductForTest.js +1 -0
  45. package/dist/tests/testData/testDataCachedGetProduct.js +1 -0
  46. package/dist/tests/testData/testDataCachedPostValidate.js +1 -0
  47. package/dist/tests/testData/testDataProductAggregatedPrice.js +1 -0
  48. package/dist/tests/testData/testDataUpcharge.js +1 -0
  49. package/dist/utilitiesCatalogueData.d.ts +14 -9
  50. package/dist/utilitiesCatalogueData.js +7 -0
  51. package/dist/utilitiesCataloguePermission.d.ts +4 -4
  52. package/package.json +3 -3
@@ -1,3 +1,8 @@
1
+ /** AdditionalProductConf */
2
+ export interface DtoAdditionalProductConf extends DtoProductConf {
3
+ refKey: string;
4
+ selected: boolean;
5
+ }
1
6
  /** AdditionalProductConfiguration */
2
7
  export interface DtoAdditionalProductConfiguration {
3
8
  refKey?: string;
@@ -22,7 +27,7 @@ export interface DtoApplicationArea {
22
27
  material?: string;
23
28
  preview?: string;
24
29
  }
25
- /** DtoApplicationAreasResponse */
30
+ /** ApplicationAreasResponse */
26
31
  export interface DtoApplicationAreasResponse {
27
32
  applicationAreas: Array<DtoApplicationArea>;
28
33
  uuid: string;
@@ -39,22 +44,22 @@ export interface DtoCatalogueAPISession {
39
44
  features?: Array<string>;
40
45
  permissions?: Array<DtoCataloguePermission>;
41
46
  }
42
- /** CatalogueParams */
43
- export interface DtoCatalogueParams extends DtoCatalogueParamsWithoutCid {
44
- cid: number;
45
- }
46
- /** CatalogueParamsWithLang */
47
- export interface DtoCatalogueParamsWithLang extends DtoCatalogueParams {
48
- lang: string;
49
- }
50
- /** CatalogueParamsWithoutCid */
51
- export interface DtoCatalogueParamsWithoutCid {
47
+ /** CatalogueParams - To identify one catalogue the Portfolio ID CID is needed in addition to the parameters in this object. However as of now CID is not used in API calls and therefore this version without CID is needed. */
48
+ export interface DtoCatalogueParams {
52
49
  enterprise: string;
53
50
  prdCat: string;
54
51
  prdCatVersion: string;
55
52
  vendor: string;
56
53
  priceList: string;
57
54
  }
55
+ /** CatalogueParamsWithCid */
56
+ export interface DtoCatalogueParamsWithCid extends DtoCatalogueParams {
57
+ cid: number;
58
+ }
59
+ /** CatalogueParamsWithCidAndLang */
60
+ export interface DtoCatalogueParamsWithCidAndLang extends DtoCatalogueParamsWithCid {
61
+ lang: string;
62
+ }
58
63
  /** CataloguePermission */
59
64
  export interface DtoCataloguePermission {
60
65
  cid: number;
@@ -74,31 +79,6 @@ export interface DtoCodeRange {
74
79
  maxValue: number;
75
80
  increment?: number;
76
81
  }
77
- /** ConfAddProd */
78
- export interface DtoConfAddProd extends DtoConfProd {
79
- refKey: string;
80
- selected: boolean;
81
- }
82
- /** ConfFeature */
83
- export interface DtoConfFeature {
84
- code: string;
85
- groupCode?: string;
86
- unit?: string;
87
- options?: Array<DtoConfOption>;
88
- }
89
- /** ConfOption */
90
- export interface DtoConfOption {
91
- code: string;
92
- selected: boolean;
93
- numericValue?: DtoValueWithUnit;
94
- features?: Array<DtoConfFeature>;
95
- }
96
- /** ConfProd */
97
- export interface DtoConfProd {
98
- features?: Array<DtoConfFeature>;
99
- additionalProducts?: Array<DtoConfAddProd>;
100
- prodParams?: DtoProductParamsWithLang;
101
- }
102
82
  /** ErrorResponse */
103
83
  export interface DtoErrorResponse {
104
84
  error: string;
@@ -147,6 +127,13 @@ export interface DtoFeature {
147
127
  syncGroup?: DtoSyncGroup;
148
128
  unit?: string;
149
129
  }
130
+ /** FeatureConf */
131
+ export interface DtoFeatureConf {
132
+ code: string;
133
+ groupCode?: string;
134
+ unit?: string;
135
+ options?: Array<DtoOptionConf>;
136
+ }
150
137
  /** FeatureRef */
151
138
  export interface DtoFeatureRef {
152
139
  code: string;
@@ -176,7 +163,17 @@ export interface DtoGetPriceListsParams {
176
163
  vendor: string;
177
164
  priceList: string;
178
165
  }
179
- /** DtoProductParamsWithLang represents the URL parameters of getProduct */
166
+ /** GetProductLegacyV2Params represents the URL parameters of getProductLegacyV2 */
167
+ export interface DtoGetProductLegacyV2Params {
168
+ lang: string;
169
+ enterprise: string;
170
+ prdCat: string;
171
+ prdCatVersion: string;
172
+ vendor: string;
173
+ priceList: string;
174
+ partNumber: string;
175
+ }
176
+ /** GetProductParams represents the URL parameters of getProduct */
180
177
  export interface DtoGetProductParams {
181
178
  lang: string;
182
179
  enterprise: string;
@@ -261,6 +258,13 @@ export interface DtoOption {
261
258
  upcharge?: number;
262
259
  priceCodes?: Array<string>;
263
260
  }
261
+ /** OptionConf */
262
+ export interface DtoOptionConf {
263
+ code: string;
264
+ selected: boolean;
265
+ numericValue?: DtoValueWithUnit;
266
+ features?: Array<DtoFeatureConf>;
267
+ }
264
268
  /** Orientation */
265
269
  export interface DtoOrientation {
266
270
  yaw: number;
@@ -320,6 +324,16 @@ export interface DtoPostRenderParams {
320
324
  priceList: string;
321
325
  partNumber: string;
322
326
  }
327
+ /** PostValidateLegacyV1Params represents the URL parameters of postValidateLegacyV1 */
328
+ export interface DtoPostValidateLegacyV1Params {
329
+ lang: string;
330
+ enterprise: string;
331
+ prdCat: string;
332
+ prdCatVersion: string;
333
+ vendor: string;
334
+ priceList: string;
335
+ partNumber: string;
336
+ }
323
337
  /** PostValidateParams represents the URL parameters of postValidate */
324
338
  export interface DtoPostValidateParams {
325
339
  lang: string;
@@ -359,6 +373,12 @@ export interface DtoProductCatalogueInfo {
359
373
  exchangeRate: number;
360
374
  lastModified: string;
361
375
  }
376
+ /** ProductConf - This is intended to eventually supersede AdditionalProductConfiguration as the format for sending/receiving how a Product is configured. */
377
+ export interface DtoProductConf {
378
+ features?: Array<DtoFeatureConf>;
379
+ additionalProducts?: Array<DtoAdditionalProductConf>;
380
+ prodParams?: DtoProductParamsWithCidAndLang;
381
+ }
362
382
  /** ProductData */
363
383
  export interface DtoProductData {
364
384
  area?: string;
@@ -383,12 +403,12 @@ export interface DtoProductData {
383
403
  models?: Array<DtoModel>;
384
404
  partsData: DtoPartsData;
385
405
  }
386
- /** ProductParams */
387
- export interface DtoProductParams extends DtoCatalogueParams {
406
+ /** ProductParamsWithCid */
407
+ export interface DtoProductParamsWithCid extends DtoCatalogueParamsWithCid {
388
408
  partNumber: string;
389
409
  }
390
- /** ProductParamsWithLang */
391
- export interface DtoProductParamsWithLang extends DtoProductParams {
410
+ /** ProductParamsWithCidAndLang */
411
+ export interface DtoProductParamsWithCidAndLang extends DtoProductParamsWithCid {
392
412
  lang: string;
393
413
  }
394
414
  /** ProductRef */
@@ -489,11 +509,19 @@ export interface DtoTransform {
489
509
  rot: DtoOrientation;
490
510
  }
491
511
  /** ValidateRequest */
492
- export interface DtoValidateRequest {
512
+ export interface DtoValidateRequest extends DtoValidateRequestLegacyV1 {
513
+ knownFeatureCodes: Array<string>;
514
+ }
515
+ /** ValidateRequestLegacyV1 */
516
+ export interface DtoValidateRequestLegacyV1 {
493
517
  selOptions: Array<DtoSelectedOption>;
494
518
  }
495
519
  /** ValidateResponse */
496
- export interface DtoValidateResponse {
520
+ export interface DtoValidateResponse extends DtoValidateResponseLegacyV1 {
521
+ features: Array<DtoFeature>;
522
+ }
523
+ /** ValidateResponseLegacyV1 */
524
+ export interface DtoValidateResponseLegacyV1 {
497
525
  productData: DtoProductData;
498
526
  uuid: string;
499
527
  validated: boolean;
@@ -536,8 +564,10 @@ export declare class CatalogueAPI {
536
564
  getApplicationAreas(params: DtoGetApplicationAreasParams): Promise<DtoApplicationAreasResponse>;
537
565
  postExport(params: DtoPostExportParams, body: DtoExportRequest): Promise<DtoExportResponse>;
538
566
  getPriceLists(params: DtoGetPriceListsParams): Promise<DtoPriceListsResponse>;
567
+ getProductLegacyV2(params: DtoGetProductLegacyV2Params): Promise<DtoProductResponse>;
539
568
  getProduct(params: DtoGetProductParams): Promise<DtoProductResponse>;
540
569
  postRender(params: DtoPostRenderParams, body: DtoRenderRequest): Promise<DtoRenderResponse>;
570
+ postValidateLegacyV1(params: DtoPostValidateLegacyV1Params, body: DtoValidateRequestLegacyV1): Promise<DtoValidateResponseLegacyV1>;
541
571
  postValidate(params: DtoPostValidateParams, body: DtoValidateRequest): Promise<DtoValidateResponse>;
542
572
  getTocTree(params: DtoGetTocTreeParams): Promise<DtoTOCResponse>;
543
573
  getTocFlat(params: DtoGetTocFlatParams): Promise<DtoTOCResponse>;
@@ -147,7 +147,7 @@ export class CatalogueAPI {
147
147
  return this.fetch(this.auth.endpoint + url, options);
148
148
  });
149
149
  }
150
- getProduct(params) {
150
+ getProductLegacyV2(params) {
151
151
  return __awaiter(this, void 0, void 0, function* () {
152
152
  if (this.auth === undefined) {
153
153
  throw new Error("missing auth");
@@ -163,6 +163,22 @@ export class CatalogueAPI {
163
163
  return this.fetch(this.auth.endpoint + url, options);
164
164
  });
165
165
  }
166
+ getProduct(params) {
167
+ return __awaiter(this, void 0, void 0, function* () {
168
+ if (this.auth === undefined) {
169
+ throw new Error("missing auth");
170
+ }
171
+ const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/product-v3/${encodeURIComponent(params.partNumber)}`;
172
+ const options = {
173
+ method: "GET",
174
+ headers: { "X-API-Key": this.auth.secretToken || "" },
175
+ };
176
+ if (this._alternativeReferer) {
177
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
178
+ }
179
+ return this.fetch(this.auth.endpoint + url, options);
180
+ });
181
+ }
166
182
  postRender(params, body) {
167
183
  return __awaiter(this, void 0, void 0, function* () {
168
184
  if (this.auth === undefined) {
@@ -180,7 +196,7 @@ export class CatalogueAPI {
180
196
  return this.fetch(this.auth.endpoint + url, options);
181
197
  });
182
198
  }
183
- postValidate(params, body) {
199
+ postValidateLegacyV1(params, body) {
184
200
  return __awaiter(this, void 0, void 0, function* () {
185
201
  if (this.auth === undefined) {
186
202
  throw new Error("missing auth");
@@ -197,6 +213,23 @@ export class CatalogueAPI {
197
213
  return this.fetch(this.auth.endpoint + url, options);
198
214
  });
199
215
  }
216
+ postValidate(params, body) {
217
+ return __awaiter(this, void 0, void 0, function* () {
218
+ if (this.auth === undefined) {
219
+ throw new Error("missing auth");
220
+ }
221
+ const url = `/v1/catalogue/${encodeURIComponent(params.lang)}/${encodeURIComponent(params.enterprise)}/${encodeURIComponent(params.prdCat)}/${encodeURIComponent(params.prdCatVersion)}/${encodeURIComponent(params.vendor)}/${encodeURIComponent(params.priceList)}/product/${encodeURIComponent(params.partNumber)}/validate-v2`;
222
+ const options = {
223
+ method: "POST",
224
+ headers: { "X-API-Key": this.auth.secretToken || "" },
225
+ body: JSON.stringify(body),
226
+ };
227
+ if (this._alternativeReferer) {
228
+ options.headers["Alternative-Referer"] = this._alternativeReferer;
229
+ }
230
+ return this.fetch(this.auth.endpoint + url, options);
231
+ });
232
+ }
200
233
  getTocTree(params) {
201
234
  return __awaiter(this, void 0, void 0, function* () {
202
235
  if (this.auth === undefined) {
@@ -283,8 +316,10 @@ export const DTO_OPERATION_ID_TO_DEBIT_GROUP = {
283
316
  getApplicationAreas: "base",
284
317
  postExport: "export",
285
318
  getPriceLists: "base",
319
+ getProductLegacyV2: "base",
286
320
  getProduct: "base",
287
321
  postRender: "render",
322
+ postValidateLegacyV1: "base",
288
323
  postValidate: "base",
289
324
  getTocTree: "base",
290
325
  getTocFlat: "base",
@@ -1,5 +1,5 @@
1
1
  import { AggregatedLoadingObservable, LengthUnit, Observable, SingleArgCallback } from "@configura/web-utilities";
2
- import { DtoAdditionalProductConfiguration, DtoAdditionalProductRef, DtoCatalogueParams, DtoConfProd, DtoMeasureParam, DtoMtrlApplication, DtoPrices, DtoProductParamsWithLang, DtoTransform } from "./CatalogueAPI.js";
2
+ import { DtoAdditionalProductConfiguration, DtoAdditionalProductRef, DtoCatalogueParamsWithCid, DtoMeasureParam, DtoMtrlApplication, DtoPrices, DtoProductConf, DtoProductParamsWithCidAndLang, DtoTransform } from "./CatalogueAPI.js";
3
3
  import { CfgMeasureDefinition } from "./CfgMeasure.js";
4
4
  import { _CfgFeatureInternal } from "./productConfiguration/CfgFeature.js";
5
5
  import { ProductConfigurationBubbleMode } from "./productConfiguration/CfgOption.js";
@@ -72,7 +72,7 @@ export declare type CfgPrice = {
72
72
  */
73
73
  export declare class _CfgProductInternal {
74
74
  readonly _productLoaderRaw: ProductLoader;
75
- readonly prodParams: DtoProductParamsWithLang;
75
+ readonly prodParams: DtoProductParamsWithCidAndLang;
76
76
  readonly settings: CfgProductSettings;
77
77
  readonly uuid: string;
78
78
  private readonly _rawUnit;
@@ -81,7 +81,8 @@ export declare class _CfgProductInternal {
81
81
  readonly parent: _CfgProductInternal | undefined;
82
82
  private _additionalProductRef;
83
83
  private readonly _syncGroupHandler;
84
- static make: (productLoaderRaw: ProductLoader, productLoaderForGroupedLoad: ProductLoader | undefined, prodParams: DtoProductParamsWithLang, settings: CfgProductSettings, optional: boolean, loadingObservable: AggregatedLoadingObservable, parent: _CfgProductInternal | undefined, root: _CfgProductInternal | undefined, additionalProductRef: DtoAdditionalProductRef | undefined) => Promise<_CfgProductInternal>;
84
+ static make: (productLoaderRaw: ProductLoader, productLoaderForGroupedLoad: ProductLoader | undefined, prodParams: DtoProductParamsWithCidAndLang, settings: CfgProductSettings, optional: boolean, loadingObservable: AggregatedLoadingObservable, parent: _CfgProductInternal | undefined, root: _CfgProductInternal | undefined, additionalProductRef: DtoAdditionalProductRef | undefined) => Promise<_CfgProductInternal>;
85
+ _initialClone: _CfgProductInternal | undefined;
85
86
  private constructor();
86
87
  readonly root: _CfgProductInternal;
87
88
  private _destroyed;
@@ -92,9 +93,26 @@ export declare class _CfgProductInternal {
92
93
  readonly changeObservable: Observable<CfgProductChangeNotification>;
93
94
  get selected(): boolean;
94
95
  readonly isAdditionalProduct: boolean;
96
+ /**
97
+ * Please note that cloning an additional product will make the clone believe is is
98
+ * an additional product, even if it has no parent and root.
99
+ * Providing the parent and root of what you clone as arguments is unwise as it will
100
+ * make changes you do on the clone be propagated up to the original non-clone root product.
101
+ */
95
102
  clone(parent?: _CfgProductInternal, root?: _CfgProductInternal): Promise<_CfgProductInternal>;
103
+ /** Mark this and its descendants as destroyed and remove all listeners */
96
104
  destroy: () => void;
105
+ /**
106
+ * Reset will reset the product to its initial state
107
+ */
108
+ reset: () => Promise<void>;
109
+ /**
110
+ * Internal use. Used when this product is an additional product, and
111
+ * changing a parent product has made the settings for this product
112
+ * change.
113
+ */
97
114
  _updateAdditionalProdRef(p: DtoAdditionalProductRef): void;
115
+ get hasRootFeaturesChanged(): boolean;
98
116
  get description(): string | undefined;
99
117
  get rootNodeSources(): RootNodeSource[] | undefined;
100
118
  get mtrlApplications(): DtoMtrlApplication[] | undefined;
@@ -136,8 +154,8 @@ export declare class _CfgProductInternal {
136
154
  _additionalProductHasChanged: (freshRef: CfgProduct, bubbleMode: CfgProductBubbleMode, committed: boolean) => Promise<void>;
137
155
  /** Called by the configuration to tell its parent that it has changed. */
138
156
  _configurationHasChanged: (freshRef: CfgProductConfiguration, bubbleMode: ProductConfigurationBubbleMode, committed: boolean) => Promise<void>;
139
- getDtoConf: (includeExtendedData: boolean, includeProductParams: boolean) => DtoConfProd;
140
- setDtoConf: (s: DtoConfProd, doValidate: boolean, productLoaderForGroupedLoad?: ProductLoader | undefined) => Promise<boolean>;
157
+ getDtoConf: (includeExtendedData: boolean, includeProductParams: boolean) => DtoProductConf;
158
+ setDtoConf: (s: DtoProductConf, doValidate: boolean, productLoaderForGroupedLoad?: ProductLoader | undefined) => Promise<boolean>;
141
159
  setApiSelection: (s: DtoAdditionalProductConfiguration, doValidate: boolean, productLoaderForGroupedLoad?: ProductLoader | undefined) => Promise<boolean>;
142
160
  copyFrom: (source: _CfgProductInternal, doValidate: boolean, productLoaderForGroupedLoad?: ProductLoader | undefined) => Promise<boolean>;
143
161
  private _setApiSelectionWithOtherProduct;
@@ -166,7 +184,7 @@ export declare class _CfgProductInternal {
166
184
  }
167
185
  export declare class CfgProduct {
168
186
  readonly _internal: _CfgProductInternal;
169
- static make(productLoader: ProductLoader, prodParams: DtoProductParamsWithLang, settings?: Partial<CfgProductSettings>): Promise<CfgProduct>;
187
+ static make(productLoader: ProductLoader, prodParams: DtoProductParamsWithCidAndLang, settings?: Partial<CfgProductSettings>): Promise<CfgProduct>;
170
188
  /**
171
189
  * Makes an object wrapping the passed object. This is not a clone method, it is a method to
172
190
  * make a new outer reference. Like a shallow copy. We use this to help frameworks that are
@@ -193,9 +211,9 @@ export declare class CfgProduct {
193
211
  * It will be unique amongst child products, but not globally unique.
194
212
  */
195
213
  get refKey(): string | undefined;
196
- get prodParams(): DtoProductParamsWithLang;
214
+ get prodParams(): DtoProductParamsWithCidAndLang;
197
215
  get lang(): string;
198
- get catId(): DtoCatalogueParams;
216
+ get catId(): DtoCatalogueParamsWithCid;
199
217
  get partNumber(): string;
200
218
  get isAdditionalProduct(): boolean;
201
219
  /** Only used when this product is an additional product. Root products are never optional. */
@@ -218,6 +236,18 @@ export declare class CfgProduct {
218
236
  * assumed to always be legal.
219
237
  */
220
238
  setSelected: (v: boolean) => Promise<boolean>;
239
+ /**
240
+ * Functional selection is a Catalogues feature where selecting Options on Features result in that you
241
+ * "jump" to another Product as a result of the Validate call. You normally do not notice that a functional
242
+ * selection has occurred except for the styleNr changing. Functional selection can change which Features
243
+ * from the original product call are used as root Features. This can in turn affect if serialized
244
+ * configuration can be applied or not.
245
+ *
246
+ * The SDK can currently only apply serialized configuration if the list of root Features has not changed.
247
+ * For this reason, when functional selection has happened, extracting data for external systems might work
248
+ * well, but reapplying back into Stage will probably fail.
249
+ */
250
+ get hasRootFeaturesChanged(): boolean;
221
251
  get rawProductData(): CfgProductData;
222
252
  get uuid(): string;
223
253
  get unit(): LengthUnit;
@@ -254,11 +284,43 @@ export declare class CfgProduct {
254
284
  * Gets what selections has been made on the product, recursively including product
255
285
  * configuration, optional products and additional products. Used when a full view of all
256
286
  * selections on a product is needed, such as when doing Render or Export.
287
+ * @deprecated getDtoConf provides a newer format.
288
+ * @see getDtoConf
257
289
  */
258
290
  getApiSelection: () => DtoAdditionalProductConfiguration;
259
- getDtoConf: (includeExtendedData?: boolean, includeProductParams?: boolean) => DtoConfProd;
260
- setDtoConf: (s: DtoConfProd, doValidate?: boolean) => Promise<boolean>;
261
- setApiSelection: (s: DtoAdditionalProductConfiguration, doValidate?: boolean) => Promise<boolean>;
291
+ /**
292
+ * Applies the configuration (selections) in the passed object onto the product recursively
293
+ * including product configuration, optional products and additional products.
294
+ * @param doValidate Makes a server side validation call. These are necessary to ensure that
295
+ * the right models are loaded.
296
+ * @deprecated setDtoConf uses a newer format.
297
+ */
298
+ setApiSelection: (configuration: DtoAdditionalProductConfiguration, doValidate?: boolean) => Promise<boolean>;
299
+ /**
300
+ * A newer alternative version of getApiSelection. This returns the configuration (selections)
301
+ * on the product, recursively including product configuration, optional products and additional
302
+ * products.
303
+ * This version has the following advantages over getApiSelection:
304
+ * - The format is clearer, designed to be readable
305
+ * - Makes less assumptions about the structure in the Product being unchanging over time. In
306
+ * particular, the Feature codes are included in the data, so that changes to what Features
307
+ * are used in a Product is less likely to lead to unexpected results.
308
+ * - You can request ExtendedData and/or ProductParams to be included in the result. This extra
309
+ * data is ignored when passed back into the API, but it can be very useful for external
310
+ * applications.
311
+ * The other version (getApiSelection) has the advantage of using a format directly compatible with the API:s.
312
+ * @param includeExtendedData Includes extra data which is not an actual part of the configuration,
313
+ * i.e. units and groupCodes
314
+ * @param includeProductParams Includes what Product this was generated for, and the same for any
315
+ * Additional Products.
316
+ */
317
+ getDtoConf: (includeExtendedData?: boolean, includeProductParams?: boolean) => DtoProductConf;
318
+ /**
319
+ * A newer alternative version of setApiSelection.
320
+ * @param doValidate Makes a server side validation call. These are necessary to ensure that
321
+ * the right models are loaded.
322
+ */
323
+ setDtoConf: (configuration: DtoProductConf, doValidate?: boolean) => Promise<boolean>;
262
324
  listenForChange: (l: SingleArgCallback<CfgProductChangeNotification>) => void;
263
325
  stopListenForChange: (l: SingleArgCallback<CfgProductChangeNotification>) => void;
264
326
  stopAllListenForChange: () => void;