@salesforce/lds-adapters-sales-automation-rules 1.134.7 → 1.134.9

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,10 +4,10 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
 
7
- import { serializeStructuredKey, StoreKeyMap } from '@luvio/engine';
7
+ import { serializeStructuredKey, StoreKeyMap, deepFreeze } from '@luvio/engine';
8
8
 
9
9
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
- const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
10
+ const { keys: ObjectKeys, create: ObjectCreate } = Object;
11
11
  const { isArray: ArrayIsArray$1 } = Array;
12
12
  /**
13
13
  * Validates an adapter config is well-formed.
@@ -31,7 +31,7 @@ function validateConfig(config, adapter, oneOf) {
31
31
  throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
32
32
  }
33
33
  const supported = required.concat(optional);
34
- if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
34
+ if (ObjectKeys(config).some(key => !supported.includes(key))) {
35
35
  throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
36
36
  }
37
37
  }
@@ -43,26 +43,7 @@ function areRequiredParametersPresent(config, configPropertyNames) {
43
43
  }
44
44
  const keyPrefix = 'sales-automation-rules';
45
45
 
46
- const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
47
46
  const { isArray: ArrayIsArray } = Array;
48
- function deepFreeze(value) {
49
- // No need to freeze primitives
50
- if (typeof value !== 'object' || value === null) {
51
- return;
52
- }
53
- if (ArrayIsArray(value)) {
54
- for (let i = 0, len = value.length; i < len; i += 1) {
55
- deepFreeze(value[i]);
56
- }
57
- }
58
- else {
59
- const keys = ObjectKeys(value);
60
- for (let i = 0, len = keys.length; i < len; i += 1) {
61
- deepFreeze(value[keys[i]]);
62
- }
63
- }
64
- ObjectFreeze(value);
65
- }
66
47
  function createLink(ref) {
67
48
  return {
68
49
  __ref: serializeStructuredKey(ref),
@@ -237,6 +218,7 @@ function ingestSuccess(luvio, resourceParams, response) {
237
218
  throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
238
219
  }
239
220
  }
221
+ deepFreeze(snapshot.data);
240
222
  return snapshot;
241
223
  }
242
224
  function createResourceRequest(config) {
@@ -3,17 +3,11 @@ export declare const ObjectPrototypeHasOwnProperty: (v: PropertyKey) => boolean;
3
3
  declare const ObjectKeys: {
4
4
  (o: object): string[];
5
5
  (o: {}): string[];
6
- }, ObjectFreeze: {
7
- <T extends Function>(f: T): T;
8
- <T_1 extends {
9
- [idx: string]: object | U | null | undefined;
10
- }, U extends string | number | bigint | boolean | symbol>(o: T_1): Readonly<T_1>;
11
- <T_2>(o: T_2): Readonly<T_2>;
12
6
  }, ObjectCreate: {
13
7
  (o: object | null): any;
14
8
  (o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
15
9
  };
16
- export { ObjectFreeze, ObjectCreate, ObjectKeys };
10
+ export { ObjectCreate, ObjectKeys };
17
11
  export declare const ArrayIsArray: (arg: any) => arg is any[];
18
12
  export declare const ArrayPrototypePush: (...items: any[]) => number;
19
13
  export interface AdapterValidationConfig {
@@ -5,7 +5,6 @@ export declare const RepresentationType: string;
5
5
  export declare function normalize(input: AutomatedActionApplyReminderInputRepresentation, existing: AutomatedActionApplyReminderInputRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): AutomatedActionApplyReminderInputRepresentationNormalized;
6
6
  export declare const select: () => $64$luvio_engine_FragmentSelection;
7
7
  export declare function equals(existing: AutomatedActionApplyReminderInputRepresentationNormalized, incoming: AutomatedActionApplyReminderInputRepresentationNormalized): boolean;
8
- export declare function deepFreeze(input: AutomatedActionApplyReminderInputRepresentation): void;
9
8
  export declare const ingest: $64$luvio_engine_ResourceIngest;
10
9
  export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: AutomatedActionApplyReminderInputRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
11
10
  /**
@@ -6,7 +6,6 @@ export declare const RepresentationType: string;
6
6
  export declare function normalize(input: AutomatedActionApplyReminderInputWrapperRepresentation, existing: AutomatedActionApplyReminderInputWrapperRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): AutomatedActionApplyReminderInputWrapperRepresentationNormalized;
7
7
  export declare const select: () => $64$luvio_engine_FragmentSelection;
8
8
  export declare function equals(existing: AutomatedActionApplyReminderInputWrapperRepresentationNormalized, incoming: AutomatedActionApplyReminderInputWrapperRepresentationNormalized): boolean;
9
- export declare function deepFreeze(input: AutomatedActionApplyReminderInputWrapperRepresentation): void;
10
9
  export declare const ingest: $64$luvio_engine_ResourceIngest;
11
10
  export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: AutomatedActionApplyReminderInputWrapperRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
12
11
  /**
@@ -14,7 +14,6 @@ export declare function keyBuilderFromType_StructuredKey(luvio: $64$luvio_engine
14
14
  export declare function normalize(input: AutomatedActionApplyReminderRepresentation, existing: AutomatedActionApplyReminderRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): AutomatedActionApplyReminderRepresentationNormalized;
15
15
  export declare const select: () => $64$luvio_engine_FragmentSelection;
16
16
  export declare function equals(existing: AutomatedActionApplyReminderRepresentationNormalized, incoming: AutomatedActionApplyReminderRepresentationNormalized): boolean;
17
- export declare function deepFreeze(input: AutomatedActionApplyReminderRepresentation): void;
18
17
  export declare const ingest: $64$luvio_engine_ResourceIngest;
19
18
  export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: AutomatedActionApplyReminderRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
20
19
  /**
@@ -1,11 +1,5 @@
1
1
  import { NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
2
- export declare const ObjectFreeze: {
3
- <T extends Function>(f: T): T;
4
- <T_1 extends {
5
- [idx: string]: object | U | null | undefined;
6
- }, U extends string | number | bigint | boolean | symbol>(o: T_1): Readonly<T_1>;
7
- <T_2>(o: T_2): Readonly<T_2>;
8
- }, ObjectKeys: {
2
+ export declare const ObjectKeys: {
9
3
  (o: object): string[];
10
4
  (o: {}): string[];
11
5
  }, ObjectCreate: {
@@ -31,7 +25,6 @@ export declare function equalsArray<U, V extends U[]>(a: V, b: V, equalsItem: (i
31
25
  export declare function equalsObject<U, V extends {
32
26
  [key: string]: U;
33
27
  }>(a: V, b: V, equalsProp: (propA: U, propB: U) => boolean | void): boolean;
34
- export declare function deepFreeze(value: any): void;
35
28
  export declare function createLink(ref: string | $64$luvio_engine_NormalizedKeyMetadata): {
36
29
  __ref: string;
37
30
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-adapters-sales-automation-rules",
3
- "version": "1.134.7",
3
+ "version": "1.134.9",
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,10 +13,10 @@
13
13
  */
14
14
  /* proxy-compat-disable */
15
15
  import { withDefaultLuvio } from 'force/ldsEngine';
16
- import { serializeStructuredKey, StoreKeyMap } from 'force/luvioEngine';
16
+ import { serializeStructuredKey, StoreKeyMap, deepFreeze } from 'force/luvioEngine';
17
17
 
18
18
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
19
- const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
19
+ const { keys: ObjectKeys, create: ObjectCreate } = Object;
20
20
  const { isArray: ArrayIsArray$1 } = Array;
21
21
  /**
22
22
  * Validates an adapter config is well-formed.
@@ -40,7 +40,7 @@ function validateConfig(config, adapter, oneOf) {
40
40
  throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
41
41
  }
42
42
  const supported = required.concat(optional);
43
- if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
43
+ if (ObjectKeys(config).some(key => !supported.includes(key))) {
44
44
  throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
45
45
  }
46
46
  }
@@ -52,26 +52,7 @@ function areRequiredParametersPresent(config, configPropertyNames) {
52
52
  }
53
53
  const keyPrefix = 'sales-automation-rules';
54
54
 
55
- const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
56
55
  const { isArray: ArrayIsArray } = Array;
57
- function deepFreeze(value) {
58
- // No need to freeze primitives
59
- if (typeof value !== 'object' || value === null) {
60
- return;
61
- }
62
- if (ArrayIsArray(value)) {
63
- for (let i = 0, len = value.length; i < len; i += 1) {
64
- deepFreeze(value[i]);
65
- }
66
- }
67
- else {
68
- const keys = ObjectKeys(value);
69
- for (let i = 0, len = keys.length; i < len; i += 1) {
70
- deepFreeze(value[keys[i]]);
71
- }
72
- }
73
- ObjectFreeze(value);
74
- }
75
56
  function createLink(ref) {
76
57
  return {
77
58
  __ref: serializeStructuredKey(ref),
@@ -246,6 +227,7 @@ function ingestSuccess(luvio, resourceParams, response) {
246
227
  throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
247
228
  }
248
229
  }
230
+ deepFreeze(snapshot.data);
249
231
  return snapshot;
250
232
  }
251
233
  function createResourceRequest(config) {
@@ -342,4 +324,4 @@ withDefaultLuvio((luvio) => {
342
324
  });
343
325
 
344
326
  export { applyReminder };
345
- // version: 1.134.7-ed0df45ef
327
+ // version: 1.134.9-fd822024c