@configura/web-api 2.0.0-alpha.18 → 2.0.0-alpha.19

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.
@@ -13,7 +13,7 @@ export interface DtoAdditionalProductConfiguration {
13
13
  /** AdditionalProductRef */
14
14
  export interface DtoAdditionalProductRef {
15
15
  refKey: string;
16
- catId: DtoCatalogueParams;
16
+ catId: DtoCatalogueParamsWithCid;
17
17
  partNumber: string;
18
18
  refDescription?: string;
19
19
  anchor?: DtoMeasureParam;
@@ -44,22 +44,22 @@ export interface DtoCatalogueAPISession {
44
44
  features?: Array<string>;
45
45
  permissions?: Array<DtoCataloguePermission>;
46
46
  }
47
- /** CatalogueParams */
48
- export interface DtoCatalogueParams extends DtoCatalogueParamsWithoutCid {
49
- cid: number;
50
- }
51
- /** CatalogueParamsWithLang */
52
- export interface DtoCatalogueParamsWithLang extends DtoCatalogueParams {
53
- lang: string;
54
- }
55
- /** CatalogueParamsWithoutCid - 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. */
56
- 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 {
57
49
  enterprise: string;
58
50
  prdCat: string;
59
51
  prdCatVersion: string;
60
52
  vendor: string;
61
53
  priceList: string;
62
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
+ }
63
63
  /** CataloguePermission */
64
64
  export interface DtoCataloguePermission {
65
65
  cid: number;
@@ -357,7 +357,7 @@ export interface DtoProductCatalogueInfo {
357
357
  export interface DtoProductConf {
358
358
  features?: Array<DtoFeatureConf>;
359
359
  additionalProducts?: Array<DtoAdditionalProductConf>;
360
- prodParams?: DtoProductParamsWithLang;
360
+ prodParams?: DtoProductParamsWithCidAndLang;
361
361
  }
362
362
  /** ProductData */
363
363
  export interface DtoProductData {
@@ -383,12 +383,12 @@ export interface DtoProductData {
383
383
  models?: Array<DtoModel>;
384
384
  partsData: DtoPartsData;
385
385
  }
386
- /** ProductParams */
387
- export interface DtoProductParams extends DtoCatalogueParams {
386
+ /** ProductParamsWithCid */
387
+ export interface DtoProductParamsWithCid extends DtoCatalogueParamsWithCid {
388
388
  partNumber: string;
389
389
  }
390
- /** ProductParamsWithLang */
391
- export interface DtoProductParamsWithLang extends DtoProductParams {
390
+ /** ProductParamsWithCidAndLang */
391
+ export interface DtoProductParamsWithCidAndLang extends DtoProductParamsWithCid {
392
392
  lang: string;
393
393
  }
394
394
  /** ProductRef */
@@ -1,5 +1,5 @@
1
1
  import { AggregatedLoadingObservable, LengthUnit, Observable, SingleArgCallback } from "@configura/web-utilities";
2
- import { DtoAdditionalProductConfiguration, DtoAdditionalProductRef, DtoCatalogueParams, DtoMeasureParam, DtoMtrlApplication, DtoPrices, DtoProductConf, 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,7 @@ 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
85
  private constructor();
86
86
  readonly root: _CfgProductInternal;
87
87
  private _destroyed;
@@ -173,7 +173,7 @@ export declare class _CfgProductInternal {
173
173
  }
174
174
  export declare class CfgProduct {
175
175
  readonly _internal: _CfgProductInternal;
176
- static make(productLoader: ProductLoader, prodParams: DtoProductParamsWithLang, settings?: Partial<CfgProductSettings>): Promise<CfgProduct>;
176
+ static make(productLoader: ProductLoader, prodParams: DtoProductParamsWithCidAndLang, settings?: Partial<CfgProductSettings>): Promise<CfgProduct>;
177
177
  /**
178
178
  * Makes an object wrapping the passed object. This is not a clone method, it is a method to
179
179
  * make a new outer reference. Like a shallow copy. We use this to help frameworks that are
@@ -200,9 +200,9 @@ export declare class CfgProduct {
200
200
  * It will be unique amongst child products, but not globally unique.
201
201
  */
202
202
  get refKey(): string | undefined;
203
- get prodParams(): DtoProductParamsWithLang;
203
+ get prodParams(): DtoProductParamsWithCidAndLang;
204
204
  get lang(): string;
205
- get catId(): DtoCatalogueParams;
205
+ get catId(): DtoCatalogueParamsWithCid;
206
206
  get partNumber(): string;
207
207
  get isAdditionalProduct(): boolean;
208
208
  /** Only used when this product is an additional product. Root products are never optional. */
@@ -1,4 +1,4 @@
1
- import { DtoCatalogueParamsWithLang, DtoProductParamsWithLang } from "./CatalogueAPI";
1
+ import { DtoCatalogueParamsWithCidAndLang, DtoProductParamsWithCidAndLang } from "./CatalogueAPI";
2
2
  /**
3
3
  * These methods aims to provide a default suggested way of building
4
4
  * URLs to Products and Catalogues. By using consistent URL:s copy-paste
@@ -14,7 +14,7 @@ export declare class CfgReferencePathHelper {
14
14
  * @param catParams What catalogue to generate URL for.
15
15
  * @returns An URL to a catalogue
16
16
  */
17
- static getCataloguePath: (browsingRootUrl: string, catParams: DtoCatalogueParamsWithLang) => string;
17
+ static getCataloguePath: (browsingRootUrl: string, catParams: DtoCatalogueParamsWithCidAndLang) => string;
18
18
  /**
19
19
  * Use to generate URLs in our reference format. This is the format Configura uses in our integrations.
20
20
  * @param browsingRootUrl The URL where Stage browsing begins
@@ -22,6 +22,6 @@ export declare class CfgReferencePathHelper {
22
22
  * @param separator Optional, defaults to "product", but can be changed to indicate another function.
23
23
  * @returns An URL to a product
24
24
  */
25
- static getProductPath: (browsingRootUrl: string, productParams: DtoProductParamsWithLang, separator?: string) => string;
25
+ static getProductPath: (browsingRootUrl: string, productParams: DtoProductParamsWithCidAndLang, separator?: string) => string;
26
26
  }
27
27
  //# sourceMappingURL=CfgReferencePathHelper.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { Filters, Matches } from "@configura/web-utilities";
2
- import { DtoCatalogueParamsWithoutCid, DtoLevel, DtoProductRef } from "../CatalogueAPI.js";
3
- export declare function applyCatalogueFilters<T extends DtoCatalogueParamsWithoutCid>(filters: Filters<DtoCatalogueParamsWithoutCid>, catalogues: T[]): [Matches<DtoCatalogueParamsWithoutCid>, T[]];
2
+ import { DtoCatalogueParams, DtoLevel, DtoProductRef } from "../CatalogueAPI.js";
3
+ export declare function applyCatalogueFilters<T extends DtoCatalogueParams>(filters: Filters<DtoCatalogueParams>, catalogues: T[]): [Matches<DtoCatalogueParams>, T[]];
4
4
  export interface ProductRefParams {
5
5
  partNr: string;
6
6
  }
@@ -1,16 +1,16 @@
1
1
  import { Filters } from "@configura/web-utilities";
2
- import { CatalogueAPI, DtoApplicationAreasResponse, DtoCatalogueParams, DtoCatalogueParamsWithLang } from "../CatalogueAPI.js";
2
+ import { CatalogueAPI, DtoApplicationAreasResponse, DtoCatalogueParamsWithCid, DtoCatalogueParamsWithCidAndLang } from "../CatalogueAPI.js";
3
3
  import { CfgProduct, CfgProductSettings } from "../CfgProduct.js";
4
4
  import { ProductRefParams } from "./filters.js";
5
5
  export interface GeneratedProductConfiguration {
6
6
  applicationAreasResponse: DtoApplicationAreasResponse;
7
7
  catalogueCount: number;
8
8
  catalogueIndex: number;
9
- catalogueParams: DtoCatalogueParamsWithLang;
9
+ catalogueParams: DtoCatalogueParamsWithCidAndLang;
10
10
  getProductDuration: number;
11
11
  product: CfgProduct;
12
12
  productCount: number;
13
13
  productIndex: number;
14
14
  }
15
- export declare function generateProductConfigurations(api: CatalogueAPI, lang: string, catalogues: DtoCatalogueParams[], filters: Filters<ProductRefParams>, settings?: Partial<CfgProductSettings>): AsyncIterableIterator<GeneratedProductConfiguration | Error>;
15
+ export declare function generateProductConfigurations(api: CatalogueAPI, lang: string, catalogues: DtoCatalogueParamsWithCid[], filters: Filters<ProductRefParams>, settings?: Partial<CfgProductSettings>): AsyncIterableIterator<GeneratedProductConfiguration | Error>;
16
16
  //# sourceMappingURL=productParamsGenerator.d.ts.map
@@ -1,7 +1,7 @@
1
- import { DtoProductParamsWithLang, DtoValidateRequest } from "./CatalogueAPI.js";
1
+ import { DtoProductParamsWithCidAndLang, DtoValidateRequest } from "./CatalogueAPI.js";
2
2
  import { CfgProductResponse, CfgValidateResponse } from "./utilitiesCatalogueData.js";
3
- export declare type GetProduct = (params: DtoProductParamsWithLang) => Promise<CfgProductResponse>;
4
- export declare type PostValidate = (params: DtoProductParamsWithLang, body: DtoValidateRequest) => Promise<CfgValidateResponse>;
3
+ export declare type GetProduct = (params: DtoProductParamsWithCidAndLang) => Promise<CfgProductResponse>;
4
+ export declare type PostValidate = (params: DtoProductParamsWithCidAndLang, body: DtoValidateRequest) => Promise<CfgValidateResponse>;
5
5
  export declare type ProductLoader = {
6
6
  getProduct: GetProduct;
7
7
  postValidate: PostValidate;
@@ -1,5 +1,5 @@
1
1
  import { Observable, SingleArgCallback } from "@configura/web-utilities";
2
- import { CatalogueAPI, DtoAdditionalProductConfiguration, DtoExportStatus, DtoExportStatusStatus, DtoProductParamsWithLang, DtoRenderStatus, DtoRenderStatusStatus, DtoTargetCameraArgs } from "../CatalogueAPI.js";
2
+ import { CatalogueAPI, DtoAdditionalProductConfiguration, DtoExportStatus, DtoExportStatusStatus, DtoProductParamsWithCidAndLang, DtoRenderStatus, DtoRenderStatusStatus, DtoTargetCameraArgs } from "../CatalogueAPI.js";
3
3
  import { CfgProduct } from "../CfgProduct.js";
4
4
  import { RenderOrExportFormat } from "./formats.js";
5
5
  export declare type TasksChangeNotification = {
@@ -51,7 +51,7 @@ export declare abstract class Task<F extends RenderOrExportFormat> {
51
51
  protected constructor(taskHandler: _TaskHandlerInternal, format: F, product: CfgProduct, getPreviewUrl: (() => Promise<string>) | undefined);
52
52
  protected abstract postInit(): Promise<DtoRenderStatus | DtoExportStatus>;
53
53
  protected abstract pollStatus(): Promise<DtoRenderStatus | DtoExportStatus>;
54
- protected _productParams: DtoProductParamsWithLang;
54
+ protected _productParams: DtoProductParamsWithCidAndLang;
55
55
  protected _apiSelection: DtoAdditionalProductConfiguration;
56
56
  private _status;
57
57
  private _uuid;
@@ -1,5 +1,5 @@
1
- import { DtoCatalogueParamsWithLang } from "../../CatalogueAPI.js";
1
+ import { DtoCatalogueParamsWithCidAndLang } from "../../CatalogueAPI.js";
2
2
  import { CfgProduct } from "../../CfgProduct.js";
3
- export declare const dummyCatId: DtoCatalogueParamsWithLang;
3
+ export declare const dummyCatId: DtoCatalogueParamsWithCidAndLang;
4
4
  export declare const getDummyCfgProduct: () => Promise<CfgProduct>;
5
5
  //# sourceMappingURL=dummyProductForTest.d.ts.map
@@ -1,12 +1,12 @@
1
- import { DtoAdditionalProductRef, DtoCatalogueParams, DtoCatalogueParamsWithLang, DtoCatalogueParamsWithoutCid, DtoMeasureParam, DtoModel, DtoOrientation, DtoPartsData, DtoPrices, DtoProductData, DtoProductParams, DtoProductParamsWithLang, DtoProductResponse, DtoSelectedOption, DtoTransform, DtoValidateResponse, DtoVector } from "./CatalogueAPI.js";
1
+ import { DtoAdditionalProductRef, DtoCatalogueParams, DtoCatalogueParamsWithCid, DtoCatalogueParamsWithCidAndLang, DtoMeasureParam, DtoModel, DtoOrientation, DtoPartsData, DtoPrices, DtoProductData, DtoProductParamsWithCid, DtoProductParamsWithCidAndLang, DtoProductResponse, DtoSelectedOption, DtoTransform, DtoValidateResponse, DtoVector } from "./CatalogueAPI.js";
2
2
  /**
3
3
  * Makes a string from the params which can be used as a key in for example React. Language is not respected.
4
4
  */
5
- export declare const makeCatalogueKey: (cat: DtoCatalogueParams) => string;
5
+ export declare const makeCatalogueKey: (cat: DtoCatalogueParamsWithCid) => string;
6
6
  /**
7
7
  * Makes a string from the params which can be used as a key in for example React. Language is not respected.
8
8
  */
9
- export declare const makeProductKey: (prod: DtoProductParams) => string;
9
+ export declare const makeProductKey: (prod: DtoProductParamsWithCid) => string;
10
10
  /**
11
11
  * Makes a string from selected options, can be used as a key for a selection.
12
12
  */
@@ -27,17 +27,17 @@ export declare type CfgValidateResponse = Omit<DtoValidateResponse, "productData
27
27
  };
28
28
  export declare function isModel(arg: unknown): arg is DtoModel;
29
29
  /** Replace empty strings with "-" for compatibility with the API. */
30
- export declare function correctDefaultsOnCatalogueParams<T extends DtoCatalogueParamsWithoutCid>(catId: T): T;
30
+ export declare function correctDefaultsOnCatalogueParams<T extends DtoCatalogueParams>(catId: T): T;
31
31
  export declare function recursivelyGetPriceCodeValue(priceCodes: string[], prices: DtoPrices | undefined): number | undefined;
32
32
  export declare function comparePricesObjects(prices1: DtoPrices | undefined, prices2: DtoPrices | undefined): boolean;
33
- export declare const decodeCatalogueParams: <T extends DtoCatalogueParamsWithoutCid>(params: T) => T;
34
- export declare const decodeProductParams: <T extends DtoProductParams>(params: T) => T;
35
- export declare function isSameCatalogueParams(left: DtoCatalogueParamsWithoutCid, right: DtoCatalogueParamsWithoutCid): boolean;
33
+ export declare const decodeCatalogueParams: <T extends DtoCatalogueParams>(params: T) => T;
34
+ export declare const decodeProductParams: <T extends DtoProductParamsWithCid>(params: T) => T;
35
+ export declare function isSameCatalogueParams(left: DtoCatalogueParams, right: DtoCatalogueParams): boolean;
36
36
  export declare function isSameVector(left: DtoVector, right: DtoVector): boolean;
37
37
  export declare function isSameOrientation(left: DtoOrientation, right: DtoOrientation): boolean;
38
38
  export declare function isSameAnchor(left: DtoMeasureParam, right: DtoMeasureParam): boolean;
39
39
  export declare function isSameTransform(left: DtoTransform, right: DtoTransform): boolean;
40
40
  export declare function isSameProductRef(left: DtoAdditionalProductRef, right: DtoAdditionalProductRef): boolean;
41
- export declare const isSameDtoCatalogueParamsWithLang: (left: DtoCatalogueParamsWithLang, right: DtoCatalogueParamsWithLang) => boolean;
42
- export declare const isSameDtoProductParamsWithLang: (left: DtoProductParamsWithLang, right: DtoProductParamsWithLang) => boolean;
41
+ export declare const isSameDtoCatalogueParamsWithLang: (left: DtoCatalogueParamsWithCidAndLang, right: DtoCatalogueParamsWithCidAndLang) => boolean;
42
+ export declare const isSameDtoProductParamsWithLang: (left: DtoProductParamsWithCidAndLang, right: DtoProductParamsWithCidAndLang) => boolean;
43
43
  //# sourceMappingURL=utilitiesCatalogueData.d.ts.map
@@ -1,10 +1,10 @@
1
- import { DtoCatalogueParams, DtoCataloguePermission } from "./CatalogueAPI.js";
1
+ import { DtoCatalogueParamsWithCid, DtoCataloguePermission } from "./CatalogueAPI.js";
2
2
  interface CataloguePermissionByEnterpriseKey {
3
3
  [key: string]: DtoCataloguePermission[];
4
4
  }
5
5
  export declare const groupAndSortCataloguePermissions: (cataloguePermissions: DtoCataloguePermission[]) => CataloguePermissionByEnterpriseKey;
6
6
  export declare const isParamSet: (param: string | undefined) => boolean;
7
- export declare const createCataloguePermissionsFilter: (catParams: Partial<DtoCatalogueParams>) => (perm: DtoCataloguePermission) => boolean;
7
+ export declare const createCataloguePermissionsFilter: (catParams: Partial<DtoCatalogueParamsWithCid>) => (perm: DtoCataloguePermission) => boolean;
8
8
  /**
9
9
  * Sometimes you will want to use the latest available prdCatVersion. This method will
10
10
  * find the highest prdCatVersion version in the cataloguePermissions. If the versions are
@@ -25,7 +25,7 @@ export declare const getPrdCatVersionFromPermissions: (cataloguePermissions: Dto
25
25
  * @param auth
26
26
  * @param params
27
27
  */
28
- export declare const getPrdCatVersionOrLatestFromPermissions: (params: DtoCatalogueParams, cataloguePermissions: DtoCataloguePermission[]) => string;
28
+ export declare const getPrdCatVersionOrLatestFromPermissions: (params: DtoCatalogueParamsWithCid, cataloguePermissions: DtoCataloguePermission[]) => string;
29
29
  /**
30
30
  * Sometimes you will want a missing prdCatVersion to represent "Get the current highest version".
31
31
  * This method will, if the prdCatVersion is not set, fetch the highest available from the
@@ -34,6 +34,6 @@ export declare const getPrdCatVersionOrLatestFromPermissions: (params: DtoCatalo
34
34
  * @param auth
35
35
  * @param params
36
36
  */
37
- export declare const fillMissingPrdCatVersionFromPermissions: <T extends DtoCatalogueParams>(params: T, cataloguePermissions: DtoCataloguePermission[]) => T;
37
+ export declare const fillMissingPrdCatVersionFromPermissions: <T extends DtoCatalogueParamsWithCid>(params: T, cataloguePermissions: DtoCataloguePermission[]) => T;
38
38
  export {};
39
39
  //# sourceMappingURL=utilitiesCataloguePermission.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@configura/web-api",
3
- "version": "2.0.0-alpha.18",
3
+ "version": "2.0.0-alpha.19",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -23,7 +23,7 @@
23
23
  "access": "public"
24
24
  },
25
25
  "dependencies": {
26
- "@configura/web-utilities": "2.0.0-alpha.18"
26
+ "@configura/web-utilities": "2.0.0-alpha.19"
27
27
  },
28
- "gitHead": "6771998ca63444a51edc9eb35f31bf2f767a356a"
28
+ "gitHead": "cabb223e0e55c63991c09f652d446e98b0546bf8"
29
29
  }