@salesforce/lds-adapters-sales-automation-rules 1.213.0 → 1.213.2

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 } from '@luvio/engine';
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap } from '@luvio/engine';
8
8
 
9
9
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
10
  const { keys: ObjectKeys, create: ObjectCreate } = Object;
@@ -41,6 +41,24 @@ function untrustedIsObject(untrusted) {
41
41
  function areRequiredParametersPresent(config, configPropertyNames) {
42
42
  return configPropertyNames.parameters.required.every(req => req in config);
43
43
  }
44
+ function generateParamConfigMetadata(name, required, coerceFn) {
45
+ return {
46
+ name,
47
+ required,
48
+ coerceFn,
49
+ };
50
+ }
51
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
52
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
53
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
54
+ return {
55
+ displayName,
56
+ parameters: {
57
+ required,
58
+ optional,
59
+ }
60
+ };
61
+ }
44
62
  const keyPrefix = 'sales-automation-rules';
45
63
 
46
64
  const { isArray: ArrayIsArray } = Array;
@@ -164,26 +182,8 @@ const ingest = function AutomatedActionApplyReminderRepresentationIngest(input,
164
182
  }
165
183
  }
166
184
  const key = keyBuilderFromType(luvio, input);
167
- const existingRecord = store.readEntry(key);
168
185
  const ttlToUse = path.ttl !== undefined ? path.ttl : 1000;
169
- let incomingRecord = normalize(input, store.readEntry(key), {
170
- fullPath: key,
171
- parent: path.parent,
172
- propertyName: path.propertyName,
173
- ttl: ttlToUse
174
- });
175
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
176
- luvio.storePublish(key, incomingRecord);
177
- }
178
- if (ttlToUse !== undefined) {
179
- const storeMetadataParams = {
180
- ttl: ttlToUse,
181
- namespace: "sales-automation-rules",
182
- version: VERSION,
183
- representationName: RepresentationType,
184
- };
185
- luvio.publishStoreMetadata(key, storeMetadataParams);
186
- }
186
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "sales-automation-rules", VERSION, RepresentationType, equals);
187
187
  return createLink(key);
188
188
  };
189
189
  function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
@@ -233,13 +233,11 @@ function createResourceRequest(config) {
233
233
  };
234
234
  }
235
235
 
236
- const applyReminder_ConfigPropertyNames = {
237
- displayName: 'applyReminder',
238
- parameters: {
239
- required: ['ApplyReminderInput'],
240
- optional: []
241
- }
242
- };
236
+ const adapterName = 'applyReminder';
237
+ const applyReminder_ConfigPropertyMetadata = [
238
+ generateParamConfigMetadata('ApplyReminderInput', true),
239
+ ];
240
+ const applyReminder_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, applyReminder_ConfigPropertyMetadata);
243
241
  function createResourceParams(config) {
244
242
  const resourceParams = {
245
243
  body: {
@@ -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 = "sales-automation-rules";
@@ -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 { AutomatedActionApplyReminderInputRepresentation as types_AutomatedActionApplyReminderInputRepresentation_AutomatedActionApplyReminderInputRepresentation } from '../types/AutomatedActionApplyReminderInputRepresentation';
3
4
  import { ResourceRequestConfig as resources_putConnectAutomatedActionsReminderApply_ResourceRequestConfig } from '../resources/putConnectAutomatedActionsReminderApply';
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 { AutomatedActionApplyReminderRepresentation as types_AutomatedActionApplyReminderRepresentation_AutomatedActionApplyReminderRepresentation } from '../types/AutomatedActionApplyReminderRepresentation';
6
6
  export declare const adapterName = "applyReminder";
7
+ export declare const applyReminder_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
7
8
  export declare const applyReminder_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
8
9
  export interface ApplyReminderConfig {
9
10
  ApplyReminderInput: types_AutomatedActionApplyReminderInputRepresentation_AutomatedActionApplyReminderInputRepresentation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-adapters-sales-automation-rules",
3
- "version": "1.213.0",
3
+ "version": "1.213.2",
4
4
  "description": "APIs for the Automation Rules feature in Sales",
5
5
  "license": "MIT",
6
6
  "main": "dist/es/es2018/sales-automation-rules.js",
package/sfdc/index.js CHANGED
@@ -13,7 +13,7 @@
13
13
  */
14
14
  /* proxy-compat-disable */
15
15
  import { withDefaultLuvio } from 'force/ldsEngine';
16
- import { serializeStructuredKey, deepFreeze, StoreKeyMap } from 'force/luvioEngine';
16
+ import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap } from 'force/luvioEngine';
17
17
 
18
18
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
19
19
  const { keys: ObjectKeys, create: ObjectCreate } = Object;
@@ -50,6 +50,24 @@ function untrustedIsObject(untrusted) {
50
50
  function areRequiredParametersPresent(config, configPropertyNames) {
51
51
  return configPropertyNames.parameters.required.every(req => req in config);
52
52
  }
53
+ function generateParamConfigMetadata(name, required, coerceFn) {
54
+ return {
55
+ name,
56
+ required,
57
+ coerceFn,
58
+ };
59
+ }
60
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
61
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
62
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
63
+ return {
64
+ displayName,
65
+ parameters: {
66
+ required,
67
+ optional,
68
+ }
69
+ };
70
+ }
53
71
  const keyPrefix = 'sales-automation-rules';
54
72
 
55
73
  const { isArray: ArrayIsArray } = Array;
@@ -173,26 +191,8 @@ const ingest = function AutomatedActionApplyReminderRepresentationIngest(input,
173
191
  }
174
192
  }
175
193
  const key = keyBuilderFromType(luvio, input);
176
- const existingRecord = store.readEntry(key);
177
194
  const ttlToUse = path.ttl !== undefined ? path.ttl : 1000;
178
- let incomingRecord = normalize(input, store.readEntry(key), {
179
- fullPath: key,
180
- parent: path.parent,
181
- propertyName: path.propertyName,
182
- ttl: ttlToUse
183
- });
184
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
185
- luvio.storePublish(key, incomingRecord);
186
- }
187
- if (ttlToUse !== undefined) {
188
- const storeMetadataParams = {
189
- ttl: ttlToUse,
190
- namespace: "sales-automation-rules",
191
- version: VERSION,
192
- representationName: RepresentationType,
193
- };
194
- luvio.publishStoreMetadata(key, storeMetadataParams);
195
- }
195
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "sales-automation-rules", VERSION, RepresentationType, equals);
196
196
  return createLink(key);
197
197
  };
198
198
  function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
@@ -242,13 +242,11 @@ function createResourceRequest(config) {
242
242
  };
243
243
  }
244
244
 
245
- const applyReminder_ConfigPropertyNames = {
246
- displayName: 'applyReminder',
247
- parameters: {
248
- required: ['ApplyReminderInput'],
249
- optional: []
250
- }
251
- };
245
+ const adapterName = 'applyReminder';
246
+ const applyReminder_ConfigPropertyMetadata = [
247
+ generateParamConfigMetadata('ApplyReminderInput', true),
248
+ ];
249
+ const applyReminder_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, applyReminder_ConfigPropertyMetadata);
252
250
  function createResourceParams(config) {
253
251
  const resourceParams = {
254
252
  body: {
@@ -326,4 +324,4 @@ withDefaultLuvio((luvio) => {
326
324
  });
327
325
 
328
326
  export { applyReminder };
329
- // version: 1.213.0-951602080
327
+ // version: 1.213.2-1eb996209