@salesforce/lds-adapters-industries-loyalty-engine 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, typeCheckScalars, StoreKeyMap } from '@luvio/engine';
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2, typeCheckScalars, StoreKeyMap } from '@luvio/engine';
8
8
 
9
9
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
10
  const { keys: ObjectKeys$1, create: ObjectCreate$1 } = 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 = 'loyalty-engine';
52
70
 
53
71
  const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
@@ -1402,26 +1420,8 @@ const ingest$3 = function LoyaltyExplainabilityOutputRepresentationIngest(input,
1402
1420
  }
1403
1421
  }
1404
1422
  const key = path.fullPath;
1405
- const existingRecord = store.readEntry(key);
1406
1423
  const ttlToUse = TTL$3;
1407
- let incomingRecord = normalize$3(input, store.readEntry(key), {
1408
- fullPath: key,
1409
- parent: path.parent,
1410
- propertyName: path.propertyName,
1411
- ttl: ttlToUse
1412
- });
1413
- if (existingRecord === undefined || equals$d(existingRecord, incomingRecord) === false) {
1414
- luvio.storePublish(key, incomingRecord);
1415
- }
1416
- {
1417
- const storeMetadataParams = {
1418
- ttl: ttlToUse,
1419
- namespace: "loyalty-engine",
1420
- version: VERSION$d,
1421
- representationName: RepresentationType$3,
1422
- };
1423
- luvio.publishStoreMetadata(key, storeMetadataParams);
1424
- }
1424
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "loyalty-engine", VERSION$d, RepresentationType$3, equals$d);
1425
1425
  return createLink(key);
1426
1426
  };
1427
1427
  function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
@@ -1486,13 +1486,11 @@ function createResourceRequest$4(config) {
1486
1486
  };
1487
1487
  }
1488
1488
 
1489
- const getJournalExplainabilityInfo_ConfigPropertyNames = {
1490
- displayName: 'getJournalExplainabilityInfo',
1491
- parameters: {
1492
- required: ['journalId'],
1493
- optional: []
1494
- }
1495
- };
1489
+ const adapterName$4 = 'getJournalExplainabilityInfo';
1490
+ const getJournalExplainabilityInfo_ConfigPropertyMetadata = [
1491
+ generateParamConfigMetadata('journalId', true),
1492
+ ];
1493
+ const getJournalExplainabilityInfo_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getJournalExplainabilityInfo_ConfigPropertyMetadata);
1496
1494
  function createResourceParams$4(config) {
1497
1495
  const resourceParams = {
1498
1496
  urlParams: {
@@ -1558,21 +1556,7 @@ function buildNetworkSnapshot$4(luvio, config, options) {
1558
1556
  });
1559
1557
  }
1560
1558
  function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
1561
- const { luvio, config } = context;
1562
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1563
- const dispatchOptions = {
1564
- resourceRequestContext: {
1565
- requestCorrelator,
1566
- luvioRequestMethod: undefined,
1567
- },
1568
- eventObservers
1569
- };
1570
- if (networkPriority !== 'normal') {
1571
- dispatchOptions.overrides = {
1572
- priority: networkPriority
1573
- };
1574
- }
1575
- return buildNetworkSnapshot$4(luvio, config, dispatchOptions);
1559
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, undefined, false);
1576
1560
  }
1577
1561
  function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
1578
1562
  const { luvio, config } = context;
@@ -2037,26 +2021,8 @@ const ingest$2 = function ProcessRuleStatusRepresentationIngest(input, path, luv
2037
2021
  }
2038
2022
  }
2039
2023
  const key = keyBuilderFromType$1(luvio, input);
2040
- const existingRecord = store.readEntry(key);
2041
2024
  const ttlToUse = TTL$2;
2042
- let incomingRecord = normalize$2(input, store.readEntry(key), {
2043
- fullPath: key,
2044
- parent: path.parent,
2045
- propertyName: path.propertyName,
2046
- ttl: ttlToUse
2047
- });
2048
- if (existingRecord === undefined || equals$b(existingRecord, incomingRecord) === false) {
2049
- luvio.storePublish(key, incomingRecord);
2050
- }
2051
- {
2052
- const storeMetadataParams = {
2053
- ttl: ttlToUse,
2054
- namespace: "loyalty-engine",
2055
- version: VERSION$b,
2056
- representationName: RepresentationType$2,
2057
- };
2058
- luvio.publishStoreMetadata(key, storeMetadataParams);
2059
- }
2025
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "loyalty-engine", VERSION$b, RepresentationType$2, equals$b);
2060
2026
  return createLink(key);
2061
2027
  };
2062
2028
  function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
@@ -2106,13 +2072,13 @@ function createResourceRequest$3(config) {
2106
2072
  };
2107
2073
  }
2108
2074
 
2109
- const createProgramProcessRule_ConfigPropertyNames = {
2110
- displayName: 'createProgramProcessRule',
2111
- parameters: {
2112
- required: ['processName', 'programName', 'programProcessRule'],
2113
- optional: []
2114
- }
2115
- };
2075
+ const adapterName$3 = 'createProgramProcessRule';
2076
+ const createProgramProcessRule_ConfigPropertyMetadata = [
2077
+ generateParamConfigMetadata('processName', true),
2078
+ generateParamConfigMetadata('programName', true),
2079
+ generateParamConfigMetadata('programProcessRule', true),
2080
+ ];
2081
+ const createProgramProcessRule_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, createProgramProcessRule_ConfigPropertyMetadata);
2116
2082
  function createResourceParams$3(config) {
2117
2083
  const resourceParams = {
2118
2084
  urlParams: {
@@ -2929,26 +2895,8 @@ const ingest$1 = function ProcessRuleDetailRepresentationIngest(input, path, luv
2929
2895
  }
2930
2896
  }
2931
2897
  const key = path.fullPath;
2932
- const existingRecord = store.readEntry(key);
2933
2898
  const ttlToUse = TTL$1;
2934
- let incomingRecord = normalize$1(input, store.readEntry(key), {
2935
- fullPath: key,
2936
- parent: path.parent,
2937
- propertyName: path.propertyName,
2938
- ttl: ttlToUse
2939
- });
2940
- if (existingRecord === undefined || equals$a(existingRecord, incomingRecord) === false) {
2941
- luvio.storePublish(key, incomingRecord);
2942
- }
2943
- {
2944
- const storeMetadataParams = {
2945
- ttl: ttlToUse,
2946
- namespace: "loyalty-engine",
2947
- version: VERSION$a,
2948
- representationName: RepresentationType$1,
2949
- };
2950
- luvio.publishStoreMetadata(key, storeMetadataParams);
2951
- }
2899
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "loyalty-engine", VERSION$a, RepresentationType$1, equals$a);
2952
2900
  return createLink(key);
2953
2901
  };
2954
2902
  function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
@@ -3013,13 +2961,13 @@ function createResourceRequest$2(config) {
3013
2961
  };
3014
2962
  }
3015
2963
 
3016
- const getProgramProcessRule_ConfigPropertyNames = {
3017
- displayName: 'getProgramProcessRule',
3018
- parameters: {
3019
- required: ['processName', 'programName', 'ruleName'],
3020
- optional: []
3021
- }
3022
- };
2964
+ const adapterName$2 = 'getProgramProcessRule';
2965
+ const getProgramProcessRule_ConfigPropertyMetadata = [
2966
+ generateParamConfigMetadata('processName', true),
2967
+ generateParamConfigMetadata('programName', true),
2968
+ generateParamConfigMetadata('ruleName', true),
2969
+ ];
2970
+ const getProgramProcessRule_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getProgramProcessRule_ConfigPropertyMetadata);
3023
2971
  function createResourceParams$2(config) {
3024
2972
  const resourceParams = {
3025
2973
  urlParams: {
@@ -3087,21 +3035,7 @@ function buildNetworkSnapshot$2(luvio, config, options) {
3087
3035
  });
3088
3036
  }
3089
3037
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
3090
- const { luvio, config } = context;
3091
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
3092
- const dispatchOptions = {
3093
- resourceRequestContext: {
3094
- requestCorrelator,
3095
- luvioRequestMethod: undefined,
3096
- },
3097
- eventObservers
3098
- };
3099
- if (networkPriority !== 'normal') {
3100
- dispatchOptions.overrides = {
3101
- priority: networkPriority
3102
- };
3103
- }
3104
- return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
3038
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
3105
3039
  }
3106
3040
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
3107
3041
  const { luvio, config } = context;
@@ -3163,13 +3097,14 @@ function createResourceRequest$1(config) {
3163
3097
  };
3164
3098
  }
3165
3099
 
3166
- const updateProgramProcessRule_ConfigPropertyNames = {
3167
- displayName: 'updateProgramProcessRule',
3168
- parameters: {
3169
- required: ['processName', 'programName', 'ruleName', 'programProcessRule'],
3170
- optional: []
3171
- }
3172
- };
3100
+ const adapterName$1 = 'updateProgramProcessRule';
3101
+ const updateProgramProcessRule_ConfigPropertyMetadata = [
3102
+ generateParamConfigMetadata('processName', true),
3103
+ generateParamConfigMetadata('programName', true),
3104
+ generateParamConfigMetadata('ruleName', true),
3105
+ generateParamConfigMetadata('programProcessRule', true),
3106
+ ];
3107
+ const updateProgramProcessRule_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, updateProgramProcessRule_ConfigPropertyMetadata);
3173
3108
  function createResourceParams$1(config) {
3174
3109
  const resourceParams = {
3175
3110
  urlParams: {
@@ -4189,26 +4124,8 @@ const ingest = function LoyaltyEngineRealtimeOutputRepresentationIngest(input, p
4189
4124
  }
4190
4125
  }
4191
4126
  const key = keyBuilderFromType(luvio, input);
4192
- const existingRecord = store.readEntry(key);
4193
4127
  const ttlToUse = TTL;
4194
- let incomingRecord = normalize(input, store.readEntry(key), {
4195
- fullPath: key,
4196
- parent: path.parent,
4197
- propertyName: path.propertyName,
4198
- ttl: ttlToUse
4199
- });
4200
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
4201
- luvio.storePublish(key, incomingRecord);
4202
- }
4203
- {
4204
- const storeMetadataParams = {
4205
- ttl: ttlToUse,
4206
- namespace: "loyalty-engine",
4207
- version: VERSION,
4208
- representationName: RepresentationType,
4209
- };
4210
- luvio.publishStoreMetadata(key, storeMetadataParams);
4211
- }
4128
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "loyalty-engine", VERSION, RepresentationType, equals);
4212
4129
  return createLink(key);
4213
4130
  };
4214
4131
  function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
@@ -4258,13 +4175,12 @@ function createResourceRequest(config) {
4258
4175
  };
4259
4176
  }
4260
4177
 
4261
- const executeRealtimeLoyaltyEngine_ConfigPropertyNames = {
4262
- displayName: 'executeRealtimeLoyaltyEngine',
4263
- parameters: {
4264
- required: ['programName', 'loyaltyProcessInput'],
4265
- optional: []
4266
- }
4267
- };
4178
+ const adapterName = 'executeRealtimeLoyaltyEngine';
4179
+ const executeRealtimeLoyaltyEngine_ConfigPropertyMetadata = [
4180
+ generateParamConfigMetadata('programName', true),
4181
+ generateParamConfigMetadata('loyaltyProcessInput', true),
4182
+ ];
4183
+ const executeRealtimeLoyaltyEngine_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, executeRealtimeLoyaltyEngine_ConfigPropertyMetadata);
4268
4184
  function createResourceParams(config) {
4269
4185
  const resourceParams = {
4270
4186
  urlParams: {
@@ -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 = "loyalty-engine";
@@ -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 { ProcessRuleInputRepresentation as types_ProcessRuleInputRepresentation_ProcessRuleInputRepresentation } from '../types/ProcessRuleInputRepresentation';
3
4
  import { ResourceRequestConfig as resources_putConnectLoyaltyProgramsProcessesByProcessNameAndProgramName_ResourceRequestConfig } from '../resources/putConnectLoyaltyProgramsProcessesByProcessNameAndProgramName';
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 { ProcessRuleStatusRepresentation as types_ProcessRuleStatusRepresentation_ProcessRuleStatusRepresentation } from '../types/ProcessRuleStatusRepresentation';
6
6
  export declare const adapterName = "createProgramProcessRule";
7
+ export declare const createProgramProcessRule_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
7
8
  export declare const createProgramProcessRule_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
8
9
  export interface CreateProgramProcessRuleConfig {
9
10
  processName: string;
@@ -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 { LoyaltyEngineInputRepresentation as types_LoyaltyEngineInputRepresentation_LoyaltyEngineInputRepresentation } from '../types/LoyaltyEngineInputRepresentation';
3
4
  import { ResourceRequestConfig as resources_postConnectRealtimeLoyaltyProgramsByProgramName_ResourceRequestConfig } from '../resources/postConnectRealtimeLoyaltyProgramsByProgramName';
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 { LoyaltyEngineRealtimeOutputRepresentation as types_LoyaltyEngineRealtimeOutputRepresentation_LoyaltyEngineRealtimeOutputRepresentation } from '../types/LoyaltyEngineRealtimeOutputRepresentation';
6
6
  export declare const adapterName = "executeRealtimeLoyaltyEngine";
7
+ export declare const executeRealtimeLoyaltyEngine_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
7
8
  export declare const executeRealtimeLoyaltyEngine_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
8
9
  export interface ExecuteRealtimeLoyaltyEngineConfig {
9
10
  programName: 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_getConnectLoyaltyProgramProcessTransactionJournalsByJournalId_ResourceRequestConfig } from '../resources/getConnectLoyaltyProgramProcessTransactionJournalsByJournalId';
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 { LoyaltyExplainabilityOutputRepresentation as types_LoyaltyExplainabilityOutputRepresentation_LoyaltyExplainabilityOutputRepresentation } from '../types/LoyaltyExplainabilityOutputRepresentation';
5
5
  export declare const adapterName = "getJournalExplainabilityInfo";
6
+ export declare const getJournalExplainabilityInfo_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
6
7
  export declare const getJournalExplainabilityInfo_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
7
8
  export interface GetJournalExplainabilityInfoConfig {
8
9
  journalId: 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_getConnectLoyaltyProgramsProcessesRuleByProcessNameAndProgramNameAndRuleName_ResourceRequestConfig } from '../resources/getConnectLoyaltyProgramsProcessesRuleByProcessNameAndProgramNameAndRuleName';
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 { ProcessRuleDetailRepresentation as types_ProcessRuleDetailRepresentation_ProcessRuleDetailRepresentation } from '../types/ProcessRuleDetailRepresentation';
5
5
  export declare const adapterName = "getProgramProcessRule";
6
+ export declare const getProgramProcessRule_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
6
7
  export declare const getProgramProcessRule_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
7
8
  export interface GetProgramProcessRuleConfig {
8
9
  processName: string;
@@ -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 { ProcessRuleInputRepresentation as types_ProcessRuleInputRepresentation_ProcessRuleInputRepresentation } from '../types/ProcessRuleInputRepresentation';
3
4
  import { ResourceRequestConfig as resources_patchConnectLoyaltyProgramsProcessesRuleByProcessNameAndProgramNameAndRuleName_ResourceRequestConfig } from '../resources/patchConnectLoyaltyProgramsProcessesRuleByProcessNameAndProgramNameAndRuleName';
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 { ProcessRuleStatusRepresentation as types_ProcessRuleStatusRepresentation_ProcessRuleStatusRepresentation } from '../types/ProcessRuleStatusRepresentation';
6
6
  export declare const adapterName = "updateProgramProcessRule";
7
+ export declare const updateProgramProcessRule_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
7
8
  export declare const updateProgramProcessRule_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
8
9
  export interface UpdateProgramProcessRuleConfig {
9
10
  processName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-adapters-industries-loyalty-engine",
3
- "version": "1.213.0",
3
+ "version": "1.213.1",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "The api is responsible for upserting Loyalty Process Rules",
6
6
  "main": "dist/es/es2018/industries-loyalty-engine.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, typeCheckScalars, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2 } from 'force/luvioEngine';
18
18
 
19
19
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
20
20
  const { keys: ObjectKeys$1, create: ObjectCreate$1 } = 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 = 'loyalty-engine';
62
80
 
63
81
  const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
@@ -522,26 +540,8 @@ const ingest$3 = function ProcessRuleStatusRepresentationIngest(input, path, luv
522
540
  }
523
541
  }
524
542
  const key = keyBuilderFromType$1(luvio, input);
525
- const existingRecord = store.readEntry(key);
526
543
  const ttlToUse = TTL$3;
527
- let incomingRecord = normalize$3(input, store.readEntry(key), {
528
- fullPath: key,
529
- parent: path.parent,
530
- propertyName: path.propertyName,
531
- ttl: ttlToUse
532
- });
533
- if (existingRecord === undefined || equals$i(existingRecord, incomingRecord) === false) {
534
- luvio.storePublish(key, incomingRecord);
535
- }
536
- {
537
- const storeMetadataParams = {
538
- ttl: ttlToUse,
539
- namespace: "loyalty-engine",
540
- version: VERSION$g,
541
- representationName: RepresentationType$3,
542
- };
543
- luvio.publishStoreMetadata(key, storeMetadataParams);
544
- }
544
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "loyalty-engine", VERSION$g, RepresentationType$3, equals$i);
545
545
  return createLink(key);
546
546
  };
547
547
  function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
@@ -591,13 +591,13 @@ function createResourceRequest$4(config) {
591
591
  };
592
592
  }
593
593
 
594
- const createProgramProcessRule_ConfigPropertyNames = {
595
- displayName: 'createProgramProcessRule',
596
- parameters: {
597
- required: ['processName', 'programName', 'programProcessRule'],
598
- optional: []
599
- }
600
- };
594
+ const adapterName$4 = 'createProgramProcessRule';
595
+ const createProgramProcessRule_ConfigPropertyMetadata = [
596
+ generateParamConfigMetadata('processName', true),
597
+ generateParamConfigMetadata('programName', true),
598
+ generateParamConfigMetadata('programProcessRule', true),
599
+ ];
600
+ const createProgramProcessRule_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, createProgramProcessRule_ConfigPropertyMetadata);
601
601
  function createResourceParams$4(config) {
602
602
  const resourceParams = {
603
603
  urlParams: {
@@ -2850,26 +2850,8 @@ const ingest$2 = function LoyaltyEngineRealtimeOutputRepresentationIngest(input,
2850
2850
  }
2851
2851
  }
2852
2852
  const key = keyBuilderFromType(luvio, input);
2853
- const existingRecord = store.readEntry(key);
2854
2853
  const ttlToUse = TTL$2;
2855
- let incomingRecord = normalize$2(input, store.readEntry(key), {
2856
- fullPath: key,
2857
- parent: path.parent,
2858
- propertyName: path.propertyName,
2859
- ttl: ttlToUse
2860
- });
2861
- if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
2862
- luvio.storePublish(key, incomingRecord);
2863
- }
2864
- {
2865
- const storeMetadataParams = {
2866
- ttl: ttlToUse,
2867
- namespace: "loyalty-engine",
2868
- version: VERSION$2,
2869
- representationName: RepresentationType$2,
2870
- };
2871
- luvio.publishStoreMetadata(key, storeMetadataParams);
2872
- }
2854
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "loyalty-engine", VERSION$2, RepresentationType$2, equals$2);
2873
2855
  return createLink(key);
2874
2856
  };
2875
2857
  function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
@@ -2919,13 +2901,12 @@ function createResourceRequest$3(config) {
2919
2901
  };
2920
2902
  }
2921
2903
 
2922
- const executeRealtimeLoyaltyEngine_ConfigPropertyNames = {
2923
- displayName: 'executeRealtimeLoyaltyEngine',
2924
- parameters: {
2925
- required: ['programName', 'loyaltyProcessInput'],
2926
- optional: []
2927
- }
2928
- };
2904
+ const adapterName$3 = 'executeRealtimeLoyaltyEngine';
2905
+ const executeRealtimeLoyaltyEngine_ConfigPropertyMetadata = [
2906
+ generateParamConfigMetadata('programName', true),
2907
+ generateParamConfigMetadata('loyaltyProcessInput', true),
2908
+ ];
2909
+ const executeRealtimeLoyaltyEngine_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, executeRealtimeLoyaltyEngine_ConfigPropertyMetadata);
2929
2910
  function createResourceParams$3(config) {
2930
2911
  const resourceParams = {
2931
2912
  urlParams: {
@@ -3087,26 +3068,8 @@ const ingest$1 = function LoyaltyExplainabilityOutputRepresentationIngest(input,
3087
3068
  }
3088
3069
  }
3089
3070
  const key = path.fullPath;
3090
- const existingRecord = store.readEntry(key);
3091
3071
  const ttlToUse = TTL$1;
3092
- let incomingRecord = normalize$1(input, store.readEntry(key), {
3093
- fullPath: key,
3094
- parent: path.parent,
3095
- propertyName: path.propertyName,
3096
- ttl: ttlToUse
3097
- });
3098
- if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
3099
- luvio.storePublish(key, incomingRecord);
3100
- }
3101
- {
3102
- const storeMetadataParams = {
3103
- ttl: ttlToUse,
3104
- namespace: "loyalty-engine",
3105
- version: VERSION$1,
3106
- representationName: RepresentationType$1,
3107
- };
3108
- luvio.publishStoreMetadata(key, storeMetadataParams);
3109
- }
3072
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "loyalty-engine", VERSION$1, RepresentationType$1, equals$1);
3110
3073
  return createLink(key);
3111
3074
  };
3112
3075
  function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
@@ -3171,13 +3134,11 @@ function createResourceRequest$2(config) {
3171
3134
  };
3172
3135
  }
3173
3136
 
3174
- const getJournalExplainabilityInfo_ConfigPropertyNames = {
3175
- displayName: 'getJournalExplainabilityInfo',
3176
- parameters: {
3177
- required: ['journalId'],
3178
- optional: []
3179
- }
3180
- };
3137
+ const adapterName$2 = 'getJournalExplainabilityInfo';
3138
+ const getJournalExplainabilityInfo_ConfigPropertyMetadata = [
3139
+ generateParamConfigMetadata('journalId', true),
3140
+ ];
3141
+ const getJournalExplainabilityInfo_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getJournalExplainabilityInfo_ConfigPropertyMetadata);
3181
3142
  function createResourceParams$2(config) {
3182
3143
  const resourceParams = {
3183
3144
  urlParams: {
@@ -3243,21 +3204,7 @@ function buildNetworkSnapshot$2(luvio, config, options) {
3243
3204
  });
3244
3205
  }
3245
3206
  function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
3246
- const { luvio, config } = context;
3247
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
3248
- const dispatchOptions = {
3249
- resourceRequestContext: {
3250
- requestCorrelator,
3251
- luvioRequestMethod: undefined,
3252
- },
3253
- eventObservers
3254
- };
3255
- if (networkPriority !== 'normal') {
3256
- dispatchOptions.overrides = {
3257
- priority: networkPriority
3258
- };
3259
- }
3260
- return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
3207
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
3261
3208
  }
3262
3209
  function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
3263
3210
  const { luvio, config } = context;
@@ -4032,26 +3979,8 @@ const ingest = function ProcessRuleDetailRepresentationIngest(input, path, luvio
4032
3979
  }
4033
3980
  }
4034
3981
  const key = path.fullPath;
4035
- const existingRecord = store.readEntry(key);
4036
3982
  const ttlToUse = TTL;
4037
- let incomingRecord = normalize(input, store.readEntry(key), {
4038
- fullPath: key,
4039
- parent: path.parent,
4040
- propertyName: path.propertyName,
4041
- ttl: ttlToUse
4042
- });
4043
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
4044
- luvio.storePublish(key, incomingRecord);
4045
- }
4046
- {
4047
- const storeMetadataParams = {
4048
- ttl: ttlToUse,
4049
- namespace: "loyalty-engine",
4050
- version: VERSION,
4051
- representationName: RepresentationType,
4052
- };
4053
- luvio.publishStoreMetadata(key, storeMetadataParams);
4054
- }
3983
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "loyalty-engine", VERSION, RepresentationType, equals);
4055
3984
  return createLink(key);
4056
3985
  };
4057
3986
  function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
@@ -4116,13 +4045,13 @@ function createResourceRequest$1(config) {
4116
4045
  };
4117
4046
  }
4118
4047
 
4119
- const getProgramProcessRule_ConfigPropertyNames = {
4120
- displayName: 'getProgramProcessRule',
4121
- parameters: {
4122
- required: ['processName', 'programName', 'ruleName'],
4123
- optional: []
4124
- }
4125
- };
4048
+ const adapterName$1 = 'getProgramProcessRule';
4049
+ const getProgramProcessRule_ConfigPropertyMetadata = [
4050
+ generateParamConfigMetadata('processName', true),
4051
+ generateParamConfigMetadata('programName', true),
4052
+ generateParamConfigMetadata('ruleName', true),
4053
+ ];
4054
+ const getProgramProcessRule_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getProgramProcessRule_ConfigPropertyMetadata);
4126
4055
  function createResourceParams$1(config) {
4127
4056
  const resourceParams = {
4128
4057
  urlParams: {
@@ -4190,21 +4119,7 @@ function buildNetworkSnapshot$1(luvio, config, options) {
4190
4119
  });
4191
4120
  }
4192
4121
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
4193
- const { luvio, config } = context;
4194
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
4195
- const dispatchOptions = {
4196
- resourceRequestContext: {
4197
- requestCorrelator,
4198
- luvioRequestMethod: undefined,
4199
- },
4200
- eventObservers
4201
- };
4202
- if (networkPriority !== 'normal') {
4203
- dispatchOptions.overrides = {
4204
- priority: networkPriority
4205
- };
4206
- }
4207
- return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
4122
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
4208
4123
  }
4209
4124
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
4210
4125
  const { luvio, config } = context;
@@ -4266,13 +4181,14 @@ function createResourceRequest(config) {
4266
4181
  };
4267
4182
  }
4268
4183
 
4269
- const updateProgramProcessRule_ConfigPropertyNames = {
4270
- displayName: 'updateProgramProcessRule',
4271
- parameters: {
4272
- required: ['processName', 'programName', 'ruleName', 'programProcessRule'],
4273
- optional: []
4274
- }
4275
- };
4184
+ const adapterName = 'updateProgramProcessRule';
4185
+ const updateProgramProcessRule_ConfigPropertyMetadata = [
4186
+ generateParamConfigMetadata('processName', true),
4187
+ generateParamConfigMetadata('programName', true),
4188
+ generateParamConfigMetadata('ruleName', true),
4189
+ generateParamConfigMetadata('programProcessRule', true),
4190
+ ];
4191
+ const updateProgramProcessRule_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, updateProgramProcessRule_ConfigPropertyMetadata);
4276
4192
  function createResourceParams(config) {
4277
4193
  const resourceParams = {
4278
4194
  urlParams: {
@@ -4382,4 +4298,4 @@ withDefaultLuvio((luvio) => {
4382
4298
  });
4383
4299
 
4384
4300
  export { createProgramProcessRule, executeRealtimeLoyaltyEngine, getJournalExplainabilityInfo, getJournalExplainabilityInfo_imperative, getProgramProcessRule, getProgramProcessRule_imperative, updateProgramProcessRule };
4385
- // version: 1.213.0-951602080
4301
+ // version: 1.213.1-79de10fe1