@configura/web-api 1.3.0-alpha.2 → 1.3.0-alpha.3

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.
@@ -1,4 +1,4 @@
1
- import { CatalogueParams, Model, Prices, ProductData, ProductResponse, SelectedOption, ValidateResponse } from "./CatalogueAPI";
1
+ import { CatalogueParams, GetProductParams, Model, Prices, ProductData, ProductResponse, SelectedOption, ValidateResponse } from "./CatalogueAPI";
2
2
  export declare const makeCatalogueKey: (cat: CatalogueParams) => string;
3
3
  export declare const makeProductKey: (cat: CatalogueParams, pKey: string) => string;
4
4
  export declare const makeSelOptionsKey: (options: SelectedOption[]) => string;
@@ -16,4 +16,6 @@ export declare function isModel(arg: any): arg is Model;
16
16
  export declare function correctDefaultsOnCatalogueParams(catId: CatalogueParams): CatalogueParams;
17
17
  export declare function recursivelyGetPriceCodeValue(priceCodes: string[], prices: Prices | undefined): number | undefined;
18
18
  export declare function comparePricesObjects(prices1: Prices | undefined, prices2: Prices | undefined): boolean;
19
+ export declare const decodeCatalogueParams: <T extends CatalogueParams>(params: T) => T;
20
+ export declare const decodeProductParams: <T extends GetProductParams>(params: T) => T;
19
21
  //# sourceMappingURL=utilitiesCatalogueData.d.ts.map
@@ -54,3 +54,11 @@ export function comparePricesObjects(prices1, prices2) {
54
54
  }
55
55
  return shallowCompareDictionaries(prices1.values, prices2.values);
56
56
  }
57
+ export const decodeCatalogueParams = (params) => {
58
+ const decoded = Object.assign(Object.assign({}, params), { enterprise: decodeURIComponent(params.enterprise), prdCat: decodeURIComponent(params.prdCat), prdCatVersion: decodeURIComponent(params.prdCatVersion), priceList: decodeURIComponent(params.priceList), vendor: decodeURIComponent(params.vendor) });
59
+ return decoded;
60
+ };
61
+ export const decodeProductParams = (params) => {
62
+ const decoded = Object.assign(Object.assign({}, decodeCatalogueParams(params)), { partNumber: decodeURIComponent(params.partNumber) });
63
+ return decoded;
64
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@configura/web-api",
3
- "version": "1.3.0-alpha.2",
3
+ "version": "1.3.0-alpha.3",
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": "^1.3.0-alpha.2"
26
+ "@configura/web-utilities": "^1.3.0-alpha.3"
27
27
  },
28
- "gitHead": "ecc00b624310c03a59c0ac5933e06df92326436d"
28
+ "gitHead": "cf818cec9159a46e5254a1f001da6df7b663c62d"
29
29
  }