@salesforce/lds-adapters-commerce-store-pricing 1.214.2 → 1.216.0

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.
@@ -4,7 +4,7 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
 
7
- import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckScalars, StoreKeyMap } from '@luvio/engine';
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckConfig as typeCheckConfig$1, StoreKeyMap, createResourceParams as createResourceParams$1 } from '@luvio/engine';
8
8
 
9
9
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
10
  const { keys: ObjectKeys, create: ObjectCreate } = Object;
@@ -48,10 +48,13 @@ const snapshotRefreshOptions = {
48
48
  },
49
49
  }
50
50
  };
51
- function generateParamConfigMetadata(name, required, coerceFn) {
51
+ function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
52
52
  return {
53
53
  name,
54
54
  required,
55
+ resourceType,
56
+ typeCheckShape,
57
+ isArrayShape,
55
58
  coerceFn,
56
59
  };
57
60
  }
@@ -290,33 +293,19 @@ function createResourceRequest(config) {
290
293
 
291
294
  const adapterName = 'getProductPrice';
292
295
  const getProductPrice_ConfigPropertyMetadata = [
293
- generateParamConfigMetadata('productId', true),
294
- generateParamConfigMetadata('webstoreId', true),
295
- generateParamConfigMetadata('effectiveAccountId', false),
296
+ generateParamConfigMetadata('productId', true, 0 /* UrlParameter */, 0 /* String */),
297
+ generateParamConfigMetadata('webstoreId', true, 0 /* UrlParameter */, 0 /* String */),
298
+ generateParamConfigMetadata('effectiveAccountId', false, 1 /* QueryParameter */, 0 /* String */),
296
299
  ];
297
300
  const getProductPrice_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getProductPrice_ConfigPropertyMetadata);
298
- function createResourceParams(config) {
299
- const resourceParams = {
300
- urlParams: {
301
- productId: config.productId, webstoreId: config.webstoreId
302
- },
303
- queryParams: {
304
- effectiveAccountId: config.effectiveAccountId
305
- }
306
- };
307
- return resourceParams;
308
- }
301
+ const createResourceParams = /*#__PURE__*/ createResourceParams$1(getProductPrice_ConfigPropertyMetadata);
309
302
  function keyBuilder(luvio, config) {
310
303
  const resourceParams = createResourceParams(config);
311
304
  return keyBuilder$1(luvio, resourceParams);
312
305
  }
313
306
  function typeCheckConfig(untrustedConfig) {
314
307
  const config = {};
315
- typeCheckScalars(untrustedConfig, config, {
316
- productId: 0 /* String */,
317
- webstoreId: 0 /* String */,
318
- effectiveAccountId: 0 /* String */,
319
- });
308
+ typeCheckConfig$1(untrustedConfig, config, getProductPrice_ConfigPropertyMetadata);
320
309
  return config;
321
310
  }
322
311
  function validateAdapterConfig(untrustedConfig, configPropertyNames) {
@@ -57,6 +57,6 @@ export declare const snapshotRefreshOptions: {
57
57
  export declare function stableJSONStringify(node: any): string | undefined;
58
58
  export declare function getFetchResponseStatusText(status: number): string;
59
59
  export declare function isUnfulfilledSnapshot<T, U>(snapshot: $64$luvio_engine_Snapshot<T, U>): snapshot is $64$luvio_engine_UnfulfilledSnapshot<T, U>;
60
- export declare function generateParamConfigMetadata(name: string, required: boolean, coerceFn?: (v: unknown) => unknown): $64$luvio_engine_AdapterConfigMetadata;
60
+ export declare function generateParamConfigMetadata(name: string, required: boolean, resourceType: $64$luvio_engine_AdapterConfigMetadata['resourceType'], typeCheckShape: $64$luvio_engine_AdapterConfigMetadata['typeCheckShape'], isArrayShape?: boolean, coerceFn?: (v: unknown) => unknown): $64$luvio_engine_AdapterConfigMetadata;
61
61
  export declare function buildAdapterValidationConfig(displayName: string, paramsMeta: $64$luvio_engine_AdapterConfigMetadata[]): AdapterValidationConfig;
62
62
  export declare const keyPrefix = "Commerce";
@@ -10,7 +10,7 @@ export interface GetProductPriceConfig {
10
10
  webstoreId: string;
11
11
  effectiveAccountId?: string;
12
12
  }
13
- export declare function createResourceParams(config: GetProductPriceConfig): resources_getCommerceWebstoresPricingProductsByProductIdAndWebstoreId_ResourceRequestConfig;
13
+ export declare const createResourceParams: (config: GetProductPriceConfig) => resources_getCommerceWebstoresPricingProductsByProductIdAndWebstoreId_ResourceRequestConfig;
14
14
  export declare function keyBuilder(luvio: $64$luvio_engine_Luvio, config: GetProductPriceConfig): string;
15
15
  export declare function keyBuilder_StructuredKey(luvio: $64$luvio_engine_Luvio, config: GetProductPriceConfig): $64$luvio_engine_NormalizedKeyMetadata;
16
16
  export declare function typeCheckConfig(untrustedConfig: adapter$45$utils_Untrusted<GetProductPriceConfig>): adapter$45$utils_Untrusted<GetProductPriceConfig>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-adapters-commerce-store-pricing",
3
- "version": "1.214.2",
3
+ "version": "1.216.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "Wire adapters Commerce Store Pricing",
6
6
  "main": "dist/es/es2018/commerce-store-pricing.js",
package/sfdc/index.js CHANGED
@@ -14,7 +14,7 @@
14
14
  /* proxy-compat-disable */
15
15
  import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
16
16
  import { withDefaultLuvio } from 'force/ldsEngine';
17
- import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckScalars, StoreKeyMap } from 'force/luvioEngine';
17
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckConfig as typeCheckConfig$1, StoreKeyMap, createResourceParams as createResourceParams$1 } from 'force/luvioEngine';
18
18
 
19
19
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
20
20
  const { keys: ObjectKeys, create: ObjectCreate } = Object;
@@ -58,10 +58,13 @@ const snapshotRefreshOptions = {
58
58
  },
59
59
  }
60
60
  };
61
- function generateParamConfigMetadata(name, required, coerceFn) {
61
+ function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
62
62
  return {
63
63
  name,
64
64
  required,
65
+ resourceType,
66
+ typeCheckShape,
67
+ isArrayShape,
65
68
  coerceFn,
66
69
  };
67
70
  }
@@ -300,33 +303,19 @@ function createResourceRequest(config) {
300
303
 
301
304
  const adapterName = 'getProductPrice';
302
305
  const getProductPrice_ConfigPropertyMetadata = [
303
- generateParamConfigMetadata('productId', true),
304
- generateParamConfigMetadata('webstoreId', true),
305
- generateParamConfigMetadata('effectiveAccountId', false),
306
+ generateParamConfigMetadata('productId', true, 0 /* UrlParameter */, 0 /* String */),
307
+ generateParamConfigMetadata('webstoreId', true, 0 /* UrlParameter */, 0 /* String */),
308
+ generateParamConfigMetadata('effectiveAccountId', false, 1 /* QueryParameter */, 0 /* String */),
306
309
  ];
307
310
  const getProductPrice_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getProductPrice_ConfigPropertyMetadata);
308
- function createResourceParams(config) {
309
- const resourceParams = {
310
- urlParams: {
311
- productId: config.productId, webstoreId: config.webstoreId
312
- },
313
- queryParams: {
314
- effectiveAccountId: config.effectiveAccountId
315
- }
316
- };
317
- return resourceParams;
318
- }
311
+ const createResourceParams = /*#__PURE__*/ createResourceParams$1(getProductPrice_ConfigPropertyMetadata);
319
312
  function keyBuilder(luvio, config) {
320
313
  const resourceParams = createResourceParams(config);
321
314
  return keyBuilder$1(luvio, resourceParams);
322
315
  }
323
316
  function typeCheckConfig(untrustedConfig) {
324
317
  const config = {};
325
- typeCheckScalars(untrustedConfig, config, {
326
- productId: 0 /* String */,
327
- webstoreId: 0 /* String */,
328
- effectiveAccountId: 0 /* String */,
329
- });
318
+ typeCheckConfig$1(untrustedConfig, config, getProductPrice_ConfigPropertyMetadata);
330
319
  return config;
331
320
  }
332
321
  function validateAdapterConfig(untrustedConfig, configPropertyNames) {
@@ -422,4 +411,4 @@ withDefaultLuvio((luvio) => {
422
411
  });
423
412
 
424
413
  export { getProductPrice, getProductPrice_imperative };
425
- // version: 1.214.2-2e2871620
414
+ // version: 1.216.0-1d57d45fe