@salesforce/lds-adapters-industries-tearsheet 1.134.7 → 1.134.8

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
  }
@@ -50,7 +50,6 @@ const snapshotRefreshOptions = {
50
50
  };
51
51
  const keyPrefix = 'tearsheet';
52
52
 
53
- const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
54
53
  const { isArray: ArrayIsArray } = Array;
55
54
  const { stringify: JSONStringify } = JSON;
56
55
  function createLink(ref) {
@@ -77,9 +76,6 @@ function validate$1(obj, path = 'TearsheetRepresentation') {
77
76
  })();
78
77
  return v_error === undefined ? null : v_error;
79
78
  }
80
- function deepFreeze$1(input) {
81
- ObjectFreeze(input);
82
- }
83
79
 
84
80
  const TTL = 1000;
85
81
  const VERSION = "33cf28595aef16a27da68accf962bce3";
@@ -124,15 +120,6 @@ function equals(existing, incoming) {
124
120
  }
125
121
  return true;
126
122
  }
127
- function deepFreeze(input) {
128
- const input_data = input.data;
129
- for (let i = 0; i < input_data.length; i++) {
130
- const input_data_item = input_data[i];
131
- deepFreeze$1(input_data_item);
132
- }
133
- ObjectFreeze(input_data);
134
- ObjectFreeze(input);
135
- }
136
123
  const ingest = function TearsheetListRepresentationIngest(input, path, luvio, store, timestamp) {
137
124
  if (process.env.NODE_ENV !== 'production') {
138
125
  const validateError = validate(input);
@@ -149,7 +136,6 @@ const ingest = function TearsheetListRepresentationIngest(input, path, luvio, st
149
136
  propertyName: path.propertyName,
150
137
  ttl: ttlToUse
151
138
  });
152
- deepFreeze(input);
153
139
  if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
154
140
  luvio.storePublish(key, incomingRecord);
155
141
  }
@@ -199,6 +185,7 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
199
185
  throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
200
186
  }
201
187
  }
188
+ deepFreeze(snapshot.data);
202
189
  return snapshot;
203
190
  }
204
191
  function ingestError(luvio, params, error, snapshotRefresh) {
@@ -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 {
@@ -7,7 +7,6 @@ export declare const RepresentationType: string;
7
7
  export declare function normalize(input: TearsheetListRepresentation, existing: TearsheetListRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): TearsheetListRepresentationNormalized;
8
8
  export declare const select: () => $64$luvio_engine_BaseFragment;
9
9
  export declare function equals(existing: TearsheetListRepresentationNormalized, incoming: TearsheetListRepresentationNormalized): boolean;
10
- export declare function deepFreeze(input: TearsheetListRepresentation): void;
11
10
  export declare const ingest: $64$luvio_engine_ResourceIngest;
12
11
  export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: TearsheetListRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
13
12
  /**
@@ -5,7 +5,6 @@ export declare const RepresentationType: string;
5
5
  export declare function normalize(input: TearsheetRepresentation, existing: TearsheetRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): TearsheetRepresentationNormalized;
6
6
  export declare const select: () => $64$luvio_engine_FragmentSelection;
7
7
  export declare function equals(existing: TearsheetRepresentationNormalized, incoming: TearsheetRepresentationNormalized): boolean;
8
- export declare function deepFreeze(input: TearsheetRepresentation): void;
9
8
  export declare const ingest: $64$luvio_engine_ResourceIngest;
10
9
  export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: TearsheetRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
11
10
  /**
@@ -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-industries-tearsheet",
3
- "version": "1.134.7",
3
+ "version": "1.134.8",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "APIs for Tearsheets feature in FSC",
6
6
  "main": "dist/es/es2018/industries-tearsheet.js",
package/sfdc/index.js CHANGED
@@ -14,10 +14,10 @@
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, StoreKeyMap } from 'force/luvioEngine';
17
+ import { serializeStructuredKey, StoreKeyMap, deepFreeze } from 'force/luvioEngine';
18
18
 
19
19
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
20
- const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
20
+ const { keys: ObjectKeys, create: ObjectCreate } = Object;
21
21
  const { isArray: ArrayIsArray$1 } = Array;
22
22
  /**
23
23
  * Validates an adapter config is well-formed.
@@ -41,7 +41,7 @@ function validateConfig(config, adapter, oneOf) {
41
41
  throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
42
42
  }
43
43
  const supported = required.concat(optional);
44
- if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
44
+ if (ObjectKeys(config).some(key => !supported.includes(key))) {
45
45
  throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
46
46
  }
47
47
  }
@@ -60,7 +60,6 @@ const snapshotRefreshOptions = {
60
60
  };
61
61
  const keyPrefix = 'tearsheet';
62
62
 
63
- const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
64
63
  const { isArray: ArrayIsArray } = Array;
65
64
  const { stringify: JSONStringify } = JSON;
66
65
  function createLink(ref) {
@@ -87,9 +86,6 @@ function validate$1(obj, path = 'TearsheetRepresentation') {
87
86
  })();
88
87
  return v_error === undefined ? null : v_error;
89
88
  }
90
- function deepFreeze$1(input) {
91
- ObjectFreeze(input);
92
- }
93
89
 
94
90
  const TTL = 1000;
95
91
  const VERSION = "33cf28595aef16a27da68accf962bce3";
@@ -134,15 +130,6 @@ function equals(existing, incoming) {
134
130
  }
135
131
  return true;
136
132
  }
137
- function deepFreeze(input) {
138
- const input_data = input.data;
139
- for (let i = 0; i < input_data.length; i++) {
140
- const input_data_item = input_data[i];
141
- deepFreeze$1(input_data_item);
142
- }
143
- ObjectFreeze(input_data);
144
- ObjectFreeze(input);
145
- }
146
133
  const ingest = function TearsheetListRepresentationIngest(input, path, luvio, store, timestamp) {
147
134
  if (process.env.NODE_ENV !== 'production') {
148
135
  const validateError = validate(input);
@@ -159,7 +146,6 @@ const ingest = function TearsheetListRepresentationIngest(input, path, luvio, st
159
146
  propertyName: path.propertyName,
160
147
  ttl: ttlToUse
161
148
  });
162
- deepFreeze(input);
163
149
  if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
164
150
  luvio.storePublish(key, incomingRecord);
165
151
  }
@@ -209,6 +195,7 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
209
195
  throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
210
196
  }
211
197
  }
198
+ deepFreeze(snapshot.data);
212
199
  return snapshot;
213
200
  }
214
201
  function ingestError(luvio, params, error, snapshotRefresh) {
@@ -382,4 +369,4 @@ withDefaultLuvio((luvio) => {
382
369
  });
383
370
 
384
371
  export { getTearsheets, getTearsheets_imperative };
385
- // version: 1.134.7-ed0df45ef
372
+ // version: 1.134.8-c3d6d2cfc