@salesforce/lds-adapters-industries-epc 1.213.0 → 1.213.1

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, deepFreeze, StoreKeyMap, typeCheckScalars } from '@luvio/engine';
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$3, typeCheckScalars } from '@luvio/engine';
8
8
 
9
9
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
10
  const { keys: ObjectKeys, create: ObjectCreate } = Object;
@@ -48,6 +48,24 @@ const snapshotRefreshOptions = {
48
48
  },
49
49
  }
50
50
  };
51
+ function generateParamConfigMetadata(name, required, coerceFn) {
52
+ return {
53
+ name,
54
+ required,
55
+ coerceFn,
56
+ };
57
+ }
58
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
59
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
60
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
61
+ return {
62
+ displayName,
63
+ parameters: {
64
+ required,
65
+ optional,
66
+ }
67
+ };
68
+ }
51
69
  const keyPrefix = 'epc';
52
70
 
53
71
  const { isArray: ArrayIsArray } = Array;
@@ -200,26 +218,8 @@ const ingest$4 = function RecordIdMapOutputRepresentationIngest(input, path, luv
200
218
  }
201
219
  }
202
220
  const key = keyBuilderFromType$1(luvio, input);
203
- const existingRecord = store.readEntry(key);
204
221
  const ttlToUse = TTL$3;
205
- let incomingRecord = normalize$4(input, store.readEntry(key), {
206
- fullPath: key,
207
- parent: path.parent,
208
- propertyName: path.propertyName,
209
- ttl: ttlToUse
210
- });
211
- if (existingRecord === undefined || equals$5(existingRecord, incomingRecord) === false) {
212
- luvio.storePublish(key, incomingRecord);
213
- }
214
- {
215
- const storeMetadataParams = {
216
- ttl: ttlToUse,
217
- namespace: "epc",
218
- version: VERSION$5,
219
- representationName: RepresentationType$4,
220
- };
221
- luvio.publishStoreMetadata(key, storeMetadataParams);
222
- }
222
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "epc", VERSION$5, RepresentationType$4, equals$5);
223
223
  return createLink(key);
224
224
  };
225
225
  function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
@@ -269,13 +269,11 @@ function createResourceRequest$4(config) {
269
269
  };
270
270
  }
271
271
 
272
- const deactivate_ConfigPropertyNames = {
273
- displayName: 'deactivate',
274
- parameters: {
275
- required: ['deactivateInputPayload'],
276
- optional: []
277
- }
278
- };
272
+ const adapterName$4 = 'deactivate';
273
+ const deactivate_ConfigPropertyMetadata = [
274
+ generateParamConfigMetadata('deactivateInputPayload', true),
275
+ ];
276
+ const deactivate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, deactivate_ConfigPropertyMetadata);
279
277
  function createResourceParams$4(config) {
280
278
  const resourceParams = {
281
279
  body: {
@@ -444,26 +442,8 @@ const ingest$3 = function ProductAttributeDefinitionListRepresentationIngest(inp
444
442
  }
445
443
  }
446
444
  const key = keyBuilderFromType(luvio, input);
447
- const existingRecord = store.readEntry(key);
448
445
  const ttlToUse = TTL$2;
449
- let incomingRecord = normalize$3(input, store.readEntry(key), {
450
- fullPath: key,
451
- parent: path.parent,
452
- propertyName: path.propertyName,
453
- ttl: ttlToUse
454
- });
455
- if (existingRecord === undefined || equals$4(existingRecord, incomingRecord) === false) {
456
- luvio.storePublish(key, incomingRecord);
457
- }
458
- {
459
- const storeMetadataParams = {
460
- ttl: ttlToUse,
461
- namespace: "epc",
462
- version: VERSION$4,
463
- representationName: RepresentationType$3,
464
- };
465
- luvio.publishStoreMetadata(key, storeMetadataParams);
466
- }
446
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "epc", VERSION$4, RepresentationType$3, equals$4);
467
447
  return createLink(key);
468
448
  };
469
449
  function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
@@ -513,13 +493,11 @@ function createResourceRequest$3(config) {
513
493
  };
514
494
  }
515
495
 
516
- const createProductAttributeDefinition_ConfigPropertyNames = {
517
- displayName: 'createProductAttributeDefinition',
518
- parameters: {
519
- required: ['productAttributeDefinitionListInputPayload'],
520
- optional: []
521
- }
522
- };
496
+ const adapterName$3 = 'createProductAttributeDefinition';
497
+ const createProductAttributeDefinition_ConfigPropertyMetadata = [
498
+ generateParamConfigMetadata('productAttributeDefinitionListInputPayload', true),
499
+ ];
500
+ const createProductAttributeDefinition_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, createProductAttributeDefinition_ConfigPropertyMetadata);
523
501
  function createResourceParams$3(config) {
524
502
  const resourceParams = {
525
503
  body: {
@@ -730,26 +708,8 @@ const ingest$2 = function ProductFlowOutputRepresentationIngest(input, path, luv
730
708
  }
731
709
  }
732
710
  const key = path.fullPath;
733
- const existingRecord = store.readEntry(key);
734
711
  const ttlToUse = TTL$1;
735
- let incomingRecord = normalize$2(input, store.readEntry(key), {
736
- fullPath: key,
737
- parent: path.parent,
738
- propertyName: path.propertyName,
739
- ttl: ttlToUse
740
- });
741
- if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
742
- luvio.storePublish(key, incomingRecord);
743
- }
744
- {
745
- const storeMetadataParams = {
746
- ttl: ttlToUse,
747
- namespace: "epc",
748
- version: VERSION$2,
749
- representationName: RepresentationType$2,
750
- };
751
- luvio.publishStoreMetadata(key, storeMetadataParams);
752
- }
712
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "epc", VERSION$2, RepresentationType$2, equals$2);
753
713
  return createLink(key);
754
714
  };
755
715
  function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
@@ -814,13 +774,12 @@ function createResourceRequest$2(config) {
814
774
  };
815
775
  }
816
776
 
817
- const getProductFlowByProductId_ConfigPropertyNames = {
818
- displayName: 'getProductFlowByProductId',
819
- parameters: {
820
- required: ['productId'],
821
- optional: ['correlationId']
822
- }
823
- };
777
+ const adapterName$2 = 'getProductFlowByProductId';
778
+ const getProductFlowByProductId_ConfigPropertyMetadata = [
779
+ generateParamConfigMetadata('productId', true),
780
+ generateParamConfigMetadata('correlationId', false),
781
+ ];
782
+ const getProductFlowByProductId_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getProductFlowByProductId_ConfigPropertyMetadata);
824
783
  function createResourceParams$2(config) {
825
784
  const resourceParams = {
826
785
  urlParams: {
@@ -890,21 +849,7 @@ function buildNetworkSnapshot$2(luvio, config, options) {
890
849
  });
891
850
  }
892
851
  function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
893
- const { luvio, config } = context;
894
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
895
- const dispatchOptions = {
896
- resourceRequestContext: {
897
- requestCorrelator,
898
- luvioRequestMethod: undefined,
899
- },
900
- eventObservers
901
- };
902
- if (networkPriority !== 'normal') {
903
- dispatchOptions.overrides = {
904
- priority: networkPriority
905
- };
906
- }
907
- return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
852
+ return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
908
853
  }
909
854
  function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
910
855
  const { luvio, config } = context;
@@ -1709,26 +1654,8 @@ const ingest$1 = function ProductOutputRepresentationIngest(input, path, luvio,
1709
1654
  }
1710
1655
  }
1711
1656
  const key = path.fullPath;
1712
- const existingRecord = store.readEntry(key);
1713
1657
  const ttlToUse = TTL;
1714
- let incomingRecord = normalize$1(input, store.readEntry(key), {
1715
- fullPath: key,
1716
- parent: path.parent,
1717
- propertyName: path.propertyName,
1718
- ttl: ttlToUse
1719
- });
1720
- if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
1721
- luvio.storePublish(key, incomingRecord);
1722
- }
1723
- {
1724
- const storeMetadataParams = {
1725
- ttl: ttlToUse,
1726
- namespace: "epc",
1727
- version: VERSION$1,
1728
- representationName: RepresentationType$1,
1729
- };
1730
- luvio.publishStoreMetadata(key, storeMetadataParams);
1731
- }
1658
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "epc", VERSION$1, RepresentationType$1, equals$1);
1732
1659
  return createLink(key);
1733
1660
  };
1734
1661
  function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
@@ -1793,13 +1720,13 @@ function createResourceRequest$1(config) {
1793
1720
  };
1794
1721
  }
1795
1722
 
1796
- const getProductAttributesByProductId_ConfigPropertyNames = {
1797
- displayName: 'getProductAttributesByProductId',
1798
- parameters: {
1799
- required: ['productId'],
1800
- optional: ['correlationId', 'isPriceImpacting']
1801
- }
1802
- };
1723
+ const adapterName$1 = 'getProductAttributesByProductId';
1724
+ const getProductAttributesByProductId_ConfigPropertyMetadata = [
1725
+ generateParamConfigMetadata('productId', true),
1726
+ generateParamConfigMetadata('correlationId', false),
1727
+ generateParamConfigMetadata('isPriceImpacting', false),
1728
+ ];
1729
+ const getProductAttributesByProductId_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getProductAttributesByProductId_ConfigPropertyMetadata);
1803
1730
  function createResourceParams$1(config) {
1804
1731
  const resourceParams = {
1805
1732
  urlParams: {
@@ -1870,21 +1797,7 @@ function buildNetworkSnapshot$1(luvio, config, options) {
1870
1797
  });
1871
1798
  }
1872
1799
  function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
1873
- const { luvio, config } = context;
1874
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1875
- const dispatchOptions = {
1876
- resourceRequestContext: {
1877
- requestCorrelator,
1878
- luvioRequestMethod: undefined,
1879
- },
1880
- eventObservers
1881
- };
1882
- if (networkPriority !== 'normal') {
1883
- dispatchOptions.overrides = {
1884
- priority: networkPriority
1885
- };
1886
- }
1887
- return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
1800
+ return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
1888
1801
  }
1889
1802
  function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
1890
1803
  const { luvio, config } = context;
@@ -1973,7 +1886,7 @@ function normalize(input, existing, path, luvio, store, timestamp) {
1973
1886
  existing: existing,
1974
1887
  },
1975
1888
  ttl: path.ttl
1976
- }, luvio, store);
1889
+ }, luvio, store, timestamp);
1977
1890
  }
1978
1891
  }
1979
1892
  return input;
@@ -2079,26 +1992,8 @@ const ingest = function ProductsOutputRepresentationIngest(input, path, luvio, s
2079
1992
  }
2080
1993
  }
2081
1994
  const key = path.fullPath;
2082
- const existingRecord = store.readEntry(key);
2083
1995
  const ttlToUse = path.ttl !== undefined ? path.ttl : 360000;
2084
- let incomingRecord = normalize(input, store.readEntry(key), {
2085
- fullPath: key,
2086
- parent: path.parent,
2087
- propertyName: path.propertyName,
2088
- ttl: ttlToUse
2089
- }, luvio, store);
2090
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
2091
- luvio.storePublish(key, incomingRecord);
2092
- }
2093
- if (ttlToUse !== undefined) {
2094
- const storeMetadataParams = {
2095
- ttl: ttlToUse,
2096
- namespace: "epc",
2097
- version: VERSION,
2098
- representationName: RepresentationType,
2099
- };
2100
- luvio.publishStoreMetadata(key, storeMetadataParams);
2101
- }
1996
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "epc", VERSION, RepresentationType, equals);
2102
1997
  return createLink(key);
2103
1998
  };
2104
1999
  function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
@@ -2163,13 +2058,12 @@ function createResourceRequest(config) {
2163
2058
  };
2164
2059
  }
2165
2060
 
2166
- const getProductById_ConfigPropertyNames = {
2167
- displayName: 'getProductById',
2168
- parameters: {
2169
- required: ['productId'],
2170
- optional: ['correlationId']
2171
- }
2172
- };
2061
+ const adapterName = 'getProductById';
2062
+ const getProductById_ConfigPropertyMetadata = [
2063
+ generateParamConfigMetadata('productId', true),
2064
+ generateParamConfigMetadata('correlationId', false),
2065
+ ];
2066
+ const getProductById_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getProductById_ConfigPropertyMetadata);
2173
2067
  function createResourceParams(config) {
2174
2068
  const resourceParams = {
2175
2069
  urlParams: {
@@ -2239,21 +2133,7 @@ function buildNetworkSnapshot(luvio, config, options) {
2239
2133
  });
2240
2134
  }
2241
2135
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
2242
- const { luvio, config } = context;
2243
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
2244
- const dispatchOptions = {
2245
- resourceRequestContext: {
2246
- requestCorrelator,
2247
- luvioRequestMethod: undefined,
2248
- },
2249
- eventObservers
2250
- };
2251
- if (networkPriority !== 'normal') {
2252
- dispatchOptions.overrides = {
2253
- priority: networkPriority
2254
- };
2255
- }
2256
- return buildNetworkSnapshot(luvio, config, dispatchOptions);
2136
+ return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
2257
2137
  }
2258
2138
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
2259
2139
  const { luvio, config } = context;
@@ -1,4 +1,4 @@
1
- import { Adapter as $64$luvio_engine_Adapter, Snapshot as $64$luvio_engine_Snapshot, UnfulfilledSnapshot as $64$luvio_engine_UnfulfilledSnapshot } from '@luvio/engine';
1
+ import { Adapter as $64$luvio_engine_Adapter, Snapshot as $64$luvio_engine_Snapshot, UnfulfilledSnapshot as $64$luvio_engine_UnfulfilledSnapshot, AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata } from '@luvio/engine';
2
2
  export declare const ObjectPrototypeHasOwnProperty: (v: PropertyKey) => boolean;
3
3
  declare const ObjectKeys: {
4
4
  (o: object): string[];
@@ -57,4 +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;
61
+ export declare function buildAdapterValidationConfig(displayName: string, paramsMeta: $64$luvio_engine_AdapterConfigMetadata[]): AdapterValidationConfig;
60
62
  export declare const keyPrefix = "epc";
@@ -1,9 +1,10 @@
1
- import { AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig, Untrusted as adapter$45$utils_Untrusted } from './adapter-utils';
1
+ import { AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata, Luvio as $64$luvio_engine_Luvio, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
2
+ import { Untrusted as adapter$45$utils_Untrusted, AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig } from './adapter-utils';
2
3
  import { ProductAttributeDefinitionListInputRepresentation as types_ProductAttributeDefinitionListInputRepresentation_ProductAttributeDefinitionListInputRepresentation } from '../types/ProductAttributeDefinitionListInputRepresentation';
3
4
  import { ResourceRequestConfig as resources_postConnectEpcProductAttributeDefinition_ResourceRequestConfig } from '../resources/postConnectEpcProductAttributeDefinition';
4
- import { Luvio as $64$luvio_engine_Luvio, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
5
5
  import { ProductAttributeDefinitionListRepresentation as types_ProductAttributeDefinitionListRepresentation_ProductAttributeDefinitionListRepresentation } from '../types/ProductAttributeDefinitionListRepresentation';
6
6
  export declare const adapterName = "createProductAttributeDefinition";
7
+ export declare const createProductAttributeDefinition_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
7
8
  export declare const createProductAttributeDefinition_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
8
9
  export interface CreateProductAttributeDefinitionConfig {
9
10
  productAttributeDefinitionListInputPayload: types_ProductAttributeDefinitionListInputRepresentation_ProductAttributeDefinitionListInputRepresentation;
@@ -1,9 +1,10 @@
1
- import { AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig, Untrusted as adapter$45$utils_Untrusted } from './adapter-utils';
1
+ import { AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata, Luvio as $64$luvio_engine_Luvio, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
2
+ import { Untrusted as adapter$45$utils_Untrusted, AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig } from './adapter-utils';
2
3
  import { DeactivateInputRepresentation as types_DeactivateInputRepresentation_DeactivateInputRepresentation } from '../types/DeactivateInputRepresentation';
3
4
  import { ResourceRequestConfig as resources_patchConnectEpcActionsDeactivate_ResourceRequestConfig } from '../resources/patchConnectEpcActionsDeactivate';
4
- import { Luvio as $64$luvio_engine_Luvio, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
5
5
  import { RecordIdMapOutputRepresentation as types_RecordIdMapOutputRepresentation_RecordIdMapOutputRepresentation } from '../types/RecordIdMapOutputRepresentation';
6
6
  export declare const adapterName = "deactivate";
7
+ export declare const deactivate_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
7
8
  export declare const deactivate_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
8
9
  export interface DeactivateConfig {
9
10
  deactivateInputPayload: types_DeactivateInputRepresentation_DeactivateInputRepresentation;
@@ -1,8 +1,9 @@
1
- import { AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig, Untrusted as adapter$45$utils_Untrusted } from './adapter-utils';
1
+ import { AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata, Luvio as $64$luvio_engine_Luvio, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, Fragment as $64$luvio_engine_Fragment, Snapshot as $64$luvio_engine_Snapshot, FetchResponse as $64$luvio_engine_FetchResponse, ErrorResponse as $64$luvio_engine_ErrorResponse, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, CoercedAdapterRequestContext as $64$luvio_engine_CoercedAdapterRequestContext, StoreLookup as $64$luvio_engine_StoreLookup, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
2
+ import { Untrusted as adapter$45$utils_Untrusted, AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig } from './adapter-utils';
2
3
  import { ResourceRequestConfig as resources_getConnectEpcProductAttributesByProductId_ResourceRequestConfig } from '../resources/getConnectEpcProductAttributesByProductId';
3
- import { Luvio as $64$luvio_engine_Luvio, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, Fragment as $64$luvio_engine_Fragment, Snapshot as $64$luvio_engine_Snapshot, FetchResponse as $64$luvio_engine_FetchResponse, ErrorResponse as $64$luvio_engine_ErrorResponse, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, CoercedAdapterRequestContext as $64$luvio_engine_CoercedAdapterRequestContext, StoreLookup as $64$luvio_engine_StoreLookup, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
4
4
  import { ProductOutputRepresentation as types_ProductOutputRepresentation_ProductOutputRepresentation } from '../types/ProductOutputRepresentation';
5
5
  export declare const adapterName = "getProductAttributesByProductId";
6
+ export declare const getProductAttributesByProductId_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
6
7
  export declare const getProductAttributesByProductId_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
7
8
  export interface GetProductAttributesByProductIdConfig {
8
9
  productId: string;
@@ -1,8 +1,9 @@
1
- import { AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig, Untrusted as adapter$45$utils_Untrusted } from './adapter-utils';
1
+ import { AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata, Luvio as $64$luvio_engine_Luvio, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, Fragment as $64$luvio_engine_Fragment, Snapshot as $64$luvio_engine_Snapshot, FetchResponse as $64$luvio_engine_FetchResponse, ErrorResponse as $64$luvio_engine_ErrorResponse, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, CoercedAdapterRequestContext as $64$luvio_engine_CoercedAdapterRequestContext, StoreLookup as $64$luvio_engine_StoreLookup, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
2
+ import { Untrusted as adapter$45$utils_Untrusted, AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig } from './adapter-utils';
2
3
  import { ResourceRequestConfig as resources_getConnectEpcProductsByProductId_ResourceRequestConfig } from '../resources/getConnectEpcProductsByProductId';
3
- import { Luvio as $64$luvio_engine_Luvio, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, Fragment as $64$luvio_engine_Fragment, Snapshot as $64$luvio_engine_Snapshot, FetchResponse as $64$luvio_engine_FetchResponse, ErrorResponse as $64$luvio_engine_ErrorResponse, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, CoercedAdapterRequestContext as $64$luvio_engine_CoercedAdapterRequestContext, StoreLookup as $64$luvio_engine_StoreLookup, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
4
4
  import { ProductsOutputRepresentation as types_ProductsOutputRepresentation_ProductsOutputRepresentation } from '../types/ProductsOutputRepresentation';
5
5
  export declare const adapterName = "getProductById";
6
+ export declare const getProductById_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
6
7
  export declare const getProductById_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
7
8
  export interface GetProductByIdConfig {
8
9
  productId: string;
@@ -1,8 +1,9 @@
1
- import { AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig, Untrusted as adapter$45$utils_Untrusted } from './adapter-utils';
1
+ import { AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata, Luvio as $64$luvio_engine_Luvio, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, Fragment as $64$luvio_engine_Fragment, Snapshot as $64$luvio_engine_Snapshot, FetchResponse as $64$luvio_engine_FetchResponse, ErrorResponse as $64$luvio_engine_ErrorResponse, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, CoercedAdapterRequestContext as $64$luvio_engine_CoercedAdapterRequestContext, StoreLookup as $64$luvio_engine_StoreLookup, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
2
+ import { Untrusted as adapter$45$utils_Untrusted, AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig } from './adapter-utils';
2
3
  import { ResourceRequestConfig as resources_getConnectEpcProductsFlowByProductId_ResourceRequestConfig } from '../resources/getConnectEpcProductsFlowByProductId';
3
- import { Luvio as $64$luvio_engine_Luvio, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, Fragment as $64$luvio_engine_Fragment, Snapshot as $64$luvio_engine_Snapshot, FetchResponse as $64$luvio_engine_FetchResponse, ErrorResponse as $64$luvio_engine_ErrorResponse, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, CoercedAdapterRequestContext as $64$luvio_engine_CoercedAdapterRequestContext, StoreLookup as $64$luvio_engine_StoreLookup, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
4
4
  import { ProductFlowOutputRepresentation as types_ProductFlowOutputRepresentation_ProductFlowOutputRepresentation } from '../types/ProductFlowOutputRepresentation';
5
5
  export declare const adapterName = "getProductFlowByProductId";
6
+ export declare const getProductFlowByProductId_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
6
7
  export declare const getProductFlowByProductId_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
7
8
  export interface GetProductFlowByProductIdConfig {
8
9
  productId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-adapters-industries-epc",
3
- "version": "1.213.0",
3
+ "version": "1.213.1",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "APIs for EPCNext project",
6
6
  "main": "dist/es/es2018/industries-epc.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, deepFreeze, StoreKeyMap, typeCheckScalars } from 'force/luvioEngine';
17
+ import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$3, typeCheckScalars } from 'force/luvioEngine';
18
18
 
19
19
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
20
20
  const { keys: ObjectKeys, create: ObjectCreate } = Object;
@@ -58,6 +58,24 @@ const snapshotRefreshOptions = {
58
58
  },
59
59
  }
60
60
  };
61
+ function generateParamConfigMetadata(name, required, coerceFn) {
62
+ return {
63
+ name,
64
+ required,
65
+ coerceFn,
66
+ };
67
+ }
68
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
69
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
70
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
71
+ return {
72
+ displayName,
73
+ parameters: {
74
+ required,
75
+ optional,
76
+ }
77
+ };
78
+ }
61
79
  const keyPrefix = 'epc';
62
80
 
63
81
  const { isArray: ArrayIsArray } = Array;
@@ -190,26 +208,8 @@ const ingest$4 = function ProductAttributeDefinitionListRepresentationIngest(inp
190
208
  }
191
209
  }
192
210
  const key = keyBuilderFromType$1(luvio, input);
193
- const existingRecord = store.readEntry(key);
194
211
  const ttlToUse = TTL$3;
195
- let incomingRecord = normalize$4(input, store.readEntry(key), {
196
- fullPath: key,
197
- parent: path.parent,
198
- propertyName: path.propertyName,
199
- ttl: ttlToUse
200
- });
201
- if (existingRecord === undefined || equals$5(existingRecord, incomingRecord) === false) {
202
- luvio.storePublish(key, incomingRecord);
203
- }
204
- {
205
- const storeMetadataParams = {
206
- ttl: ttlToUse,
207
- namespace: "epc",
208
- version: VERSION$5,
209
- representationName: RepresentationType$4,
210
- };
211
- luvio.publishStoreMetadata(key, storeMetadataParams);
212
- }
212
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "epc", VERSION$5, RepresentationType$4, equals$5);
213
213
  return createLink(key);
214
214
  };
215
215
  function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
@@ -259,13 +259,11 @@ function createResourceRequest$4(config) {
259
259
  };
260
260
  }
261
261
 
262
- const createProductAttributeDefinition_ConfigPropertyNames = {
263
- displayName: 'createProductAttributeDefinition',
264
- parameters: {
265
- required: ['productAttributeDefinitionListInputPayload'],
266
- optional: []
267
- }
268
- };
262
+ const adapterName$4 = 'createProductAttributeDefinition';
263
+ const createProductAttributeDefinition_ConfigPropertyMetadata = [
264
+ generateParamConfigMetadata('productAttributeDefinitionListInputPayload', true),
265
+ ];
266
+ const createProductAttributeDefinition_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, createProductAttributeDefinition_ConfigPropertyMetadata);
269
267
  function createResourceParams$4(config) {
270
268
  const resourceParams = {
271
269
  body: {
@@ -454,26 +452,8 @@ const ingest$3 = function RecordIdMapOutputRepresentationIngest(input, path, luv
454
452
  }
455
453
  }
456
454
  const key = keyBuilderFromType(luvio, input);
457
- const existingRecord = store.readEntry(key);
458
455
  const ttlToUse = TTL$2;
459
- let incomingRecord = normalize$3(input, store.readEntry(key), {
460
- fullPath: key,
461
- parent: path.parent,
462
- propertyName: path.propertyName,
463
- ttl: ttlToUse
464
- });
465
- if (existingRecord === undefined || equals$4(existingRecord, incomingRecord) === false) {
466
- luvio.storePublish(key, incomingRecord);
467
- }
468
- {
469
- const storeMetadataParams = {
470
- ttl: ttlToUse,
471
- namespace: "epc",
472
- version: VERSION$4,
473
- representationName: RepresentationType$3,
474
- };
475
- luvio.publishStoreMetadata(key, storeMetadataParams);
476
- }
456
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "epc", VERSION$4, RepresentationType$3, equals$4);
477
457
  return createLink(key);
478
458
  };
479
459
  function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
@@ -523,13 +503,11 @@ function createResourceRequest$3(config) {
523
503
  };
524
504
  }
525
505
 
526
- const deactivate_ConfigPropertyNames = {
527
- displayName: 'deactivate',
528
- parameters: {
529
- required: ['deactivateInputPayload'],
530
- optional: []
531
- }
532
- };
506
+ const adapterName$3 = 'deactivate';
507
+ const deactivate_ConfigPropertyMetadata = [
508
+ generateParamConfigMetadata('deactivateInputPayload', true),
509
+ ];
510
+ const deactivate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, deactivate_ConfigPropertyMetadata);
533
511
  function createResourceParams$3(config) {
534
512
  const resourceParams = {
535
513
  body: {
@@ -1369,26 +1347,8 @@ const ingest$2 = function ProductOutputRepresentationIngest(input, path, luvio,
1369
1347
  }
1370
1348
  }
1371
1349
  const key = path.fullPath;
1372
- const existingRecord = store.readEntry(key);
1373
1350
  const ttlToUse = TTL$1;
1374
- let incomingRecord = normalize$2(input, store.readEntry(key), {
1375
- fullPath: key,
1376
- parent: path.parent,
1377
- propertyName: path.propertyName,
1378
- ttl: ttlToUse
1379
- });
1380
- if (existingRecord === undefined || equals$3(existingRecord, incomingRecord) === false) {
1381
- luvio.storePublish(key, incomingRecord);
1382
- }
1383
- {
1384
- const storeMetadataParams = {
1385
- ttl: ttlToUse,
1386
- namespace: "epc",
1387
- version: VERSION$3,
1388
- representationName: RepresentationType$2,
1389
- };
1390
- luvio.publishStoreMetadata(key, storeMetadataParams);
1391
- }
1351
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "epc", VERSION$3, RepresentationType$2, equals$3);
1392
1352
  return createLink(key);
1393
1353
  };
1394
1354
  function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
@@ -1453,13 +1413,13 @@ function createResourceRequest$2(config) {
1453
1413
  };
1454
1414
  }
1455
1415
 
1456
- const getProductAttributesByProductId_ConfigPropertyNames = {
1457
- displayName: 'getProductAttributesByProductId',
1458
- parameters: {
1459
- required: ['productId'],
1460
- optional: ['correlationId', 'isPriceImpacting']
1461
- }
1462
- };
1416
+ const adapterName$2 = 'getProductAttributesByProductId';
1417
+ const getProductAttributesByProductId_ConfigPropertyMetadata = [
1418
+ generateParamConfigMetadata('productId', true),
1419
+ generateParamConfigMetadata('correlationId', false),
1420
+ generateParamConfigMetadata('isPriceImpacting', false),
1421
+ ];
1422
+ const getProductAttributesByProductId_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getProductAttributesByProductId_ConfigPropertyMetadata);
1463
1423
  function createResourceParams$2(config) {
1464
1424
  const resourceParams = {
1465
1425
  urlParams: {
@@ -1530,21 +1490,7 @@ function buildNetworkSnapshot$2(luvio, config, options) {
1530
1490
  });
1531
1491
  }
1532
1492
  function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
1533
- const { luvio, config } = context;
1534
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1535
- const dispatchOptions = {
1536
- resourceRequestContext: {
1537
- requestCorrelator,
1538
- luvioRequestMethod: undefined,
1539
- },
1540
- eventObservers
1541
- };
1542
- if (networkPriority !== 'normal') {
1543
- dispatchOptions.overrides = {
1544
- priority: networkPriority
1545
- };
1546
- }
1547
- return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
1493
+ return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
1548
1494
  }
1549
1495
  function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
1550
1496
  const { luvio, config } = context;
@@ -1705,7 +1651,7 @@ function normalize$1(input, existing, path, luvio, store, timestamp) {
1705
1651
  existing: existing,
1706
1652
  },
1707
1653
  ttl: path.ttl
1708
- }, luvio, store);
1654
+ }, luvio, store, timestamp);
1709
1655
  }
1710
1656
  }
1711
1657
  return input;
@@ -1811,26 +1757,8 @@ const ingest$1 = function ProductsOutputRepresentationIngest(input, path, luvio,
1811
1757
  }
1812
1758
  }
1813
1759
  const key = path.fullPath;
1814
- const existingRecord = store.readEntry(key);
1815
1760
  const ttlToUse = path.ttl !== undefined ? path.ttl : 360000;
1816
- let incomingRecord = normalize$1(input, store.readEntry(key), {
1817
- fullPath: key,
1818
- parent: path.parent,
1819
- propertyName: path.propertyName,
1820
- ttl: ttlToUse
1821
- }, luvio, store);
1822
- if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
1823
- luvio.storePublish(key, incomingRecord);
1824
- }
1825
- if (ttlToUse !== undefined) {
1826
- const storeMetadataParams = {
1827
- ttl: ttlToUse,
1828
- namespace: "epc",
1829
- version: VERSION$1,
1830
- representationName: RepresentationType$1,
1831
- };
1832
- luvio.publishStoreMetadata(key, storeMetadataParams);
1833
- }
1761
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "epc", VERSION$1, RepresentationType$1, equals$1);
1834
1762
  return createLink(key);
1835
1763
  };
1836
1764
  function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
@@ -1895,13 +1823,12 @@ function createResourceRequest$1(config) {
1895
1823
  };
1896
1824
  }
1897
1825
 
1898
- const getProductById_ConfigPropertyNames = {
1899
- displayName: 'getProductById',
1900
- parameters: {
1901
- required: ['productId'],
1902
- optional: ['correlationId']
1903
- }
1904
- };
1826
+ const adapterName$1 = 'getProductById';
1827
+ const getProductById_ConfigPropertyMetadata = [
1828
+ generateParamConfigMetadata('productId', true),
1829
+ generateParamConfigMetadata('correlationId', false),
1830
+ ];
1831
+ const getProductById_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getProductById_ConfigPropertyMetadata);
1905
1832
  function createResourceParams$1(config) {
1906
1833
  const resourceParams = {
1907
1834
  urlParams: {
@@ -1971,21 +1898,7 @@ function buildNetworkSnapshot$1(luvio, config, options) {
1971
1898
  });
1972
1899
  }
1973
1900
  function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
1974
- const { luvio, config } = context;
1975
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1976
- const dispatchOptions = {
1977
- resourceRequestContext: {
1978
- requestCorrelator,
1979
- luvioRequestMethod: undefined,
1980
- },
1981
- eventObservers
1982
- };
1983
- if (networkPriority !== 'normal') {
1984
- dispatchOptions.overrides = {
1985
- priority: networkPriority
1986
- };
1987
- }
1988
- return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
1901
+ return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
1989
1902
  }
1990
1903
  function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
1991
1904
  const { luvio, config } = context;
@@ -2089,26 +2002,8 @@ const ingest = function ProductFlowOutputRepresentationIngest(input, path, luvio
2089
2002
  }
2090
2003
  }
2091
2004
  const key = path.fullPath;
2092
- const existingRecord = store.readEntry(key);
2093
2005
  const ttlToUse = TTL;
2094
- let incomingRecord = normalize(input, store.readEntry(key), {
2095
- fullPath: key,
2096
- parent: path.parent,
2097
- propertyName: path.propertyName,
2098
- ttl: ttlToUse
2099
- });
2100
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
2101
- luvio.storePublish(key, incomingRecord);
2102
- }
2103
- {
2104
- const storeMetadataParams = {
2105
- ttl: ttlToUse,
2106
- namespace: "epc",
2107
- version: VERSION,
2108
- representationName: RepresentationType,
2109
- };
2110
- luvio.publishStoreMetadata(key, storeMetadataParams);
2111
- }
2006
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "epc", VERSION, RepresentationType, equals);
2112
2007
  return createLink(key);
2113
2008
  };
2114
2009
  function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
@@ -2173,13 +2068,12 @@ function createResourceRequest(config) {
2173
2068
  };
2174
2069
  }
2175
2070
 
2176
- const getProductFlowByProductId_ConfigPropertyNames = {
2177
- displayName: 'getProductFlowByProductId',
2178
- parameters: {
2179
- required: ['productId'],
2180
- optional: ['correlationId']
2181
- }
2182
- };
2071
+ const adapterName = 'getProductFlowByProductId';
2072
+ const getProductFlowByProductId_ConfigPropertyMetadata = [
2073
+ generateParamConfigMetadata('productId', true),
2074
+ generateParamConfigMetadata('correlationId', false),
2075
+ ];
2076
+ const getProductFlowByProductId_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getProductFlowByProductId_ConfigPropertyMetadata);
2183
2077
  function createResourceParams(config) {
2184
2078
  const resourceParams = {
2185
2079
  urlParams: {
@@ -2249,21 +2143,7 @@ function buildNetworkSnapshot(luvio, config, options) {
2249
2143
  });
2250
2144
  }
2251
2145
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
2252
- const { luvio, config } = context;
2253
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
2254
- const dispatchOptions = {
2255
- resourceRequestContext: {
2256
- requestCorrelator,
2257
- luvioRequestMethod: undefined,
2258
- },
2259
- eventObservers
2260
- };
2261
- if (networkPriority !== 'normal') {
2262
- dispatchOptions.overrides = {
2263
- priority: networkPriority
2264
- };
2265
- }
2266
- return buildNetworkSnapshot(luvio, config, dispatchOptions);
2146
+ return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
2267
2147
  }
2268
2148
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
2269
2149
  const { luvio, config } = context;
@@ -2335,4 +2215,4 @@ withDefaultLuvio((luvio) => {
2335
2215
  });
2336
2216
 
2337
2217
  export { createProductAttributeDefinition, deactivate, getProductAttributesByProductId, getProductAttributesByProductId_imperative, getProductById, getProductById_imperative, getProductFlowByProductId, getProductFlowByProductId_imperative };
2338
- // version: 1.213.0-951602080
2218
+ // version: 1.213.1-79de10fe1