@salesforce/lds-adapters-revenue-place-quote 1.134.6 → 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
  }
@@ -43,27 +43,8 @@ function areRequiredParametersPresent(config, configPropertyNames) {
43
43
  }
44
44
  const keyPrefix = 'place-quote';
45
45
 
46
- const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
47
46
  const { isArray: ArrayIsArray } = Array;
48
47
  const { stringify: JSONStringify } = JSON;
49
- function deepFreeze$2(value) {
50
- // No need to freeze primitives
51
- if (typeof value !== 'object' || value === null) {
52
- return;
53
- }
54
- if (ArrayIsArray(value)) {
55
- for (let i = 0, len = value.length; i < len; i += 1) {
56
- deepFreeze$2(value[i]);
57
- }
58
- }
59
- else {
60
- const keys = ObjectKeys(value);
61
- for (let i = 0, len = keys.length; i < len; i += 1) {
62
- deepFreeze$2(value[keys[i]]);
63
- }
64
- }
65
- ObjectFreeze(value);
66
- }
67
48
  function createLink(ref) {
68
49
  return {
69
50
  __ref: serializeStructuredKey(ref),
@@ -112,9 +93,6 @@ function validate$1(obj, path = 'PlaceQuoteErrorResponseRepresentation') {
112
93
  })();
113
94
  return v_error === undefined ? null : v_error;
114
95
  }
115
- function deepFreeze$1(input) {
116
- ObjectFreeze(input);
117
- }
118
96
 
119
97
  const TTL = 1000;
120
98
  const VERSION = "32a768cba447434ebb8e37e67aed1302";
@@ -188,15 +166,6 @@ function equals(existing, incoming) {
188
166
  }
189
167
  return true;
190
168
  }
191
- function deepFreeze(input) {
192
- const input_responseError = input.responseError;
193
- for (let i = 0; i < input_responseError.length; i++) {
194
- const input_responseError_item = input_responseError[i];
195
- deepFreeze$1(input_responseError_item);
196
- }
197
- ObjectFreeze(input_responseError);
198
- ObjectFreeze(input);
199
- }
200
169
  const ingest = function PlaceQuoteOutputRepresentationIngest(input, path, luvio, store, timestamp) {
201
170
  if (process.env.NODE_ENV !== 'production') {
202
171
  const validateError = validate(input);
@@ -213,7 +182,6 @@ const ingest = function PlaceQuoteOutputRepresentationIngest(input, path, luvio,
213
182
  propertyName: path.propertyName,
214
183
  ttl: ttlToUse
215
184
  });
216
- deepFreeze(input);
217
185
  if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
218
186
  luvio.storePublish(key, incomingRecord);
219
187
  }
@@ -260,6 +228,7 @@ function ingestSuccess(luvio, resourceParams, response) {
260
228
  throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
261
229
  }
262
230
  }
231
+ deepFreeze(snapshot.data);
263
232
  return snapshot;
264
233
  }
265
234
  function createResourceRequest(config) {
@@ -323,7 +292,7 @@ function buildNetworkSnapshot(luvio, config, options) {
323
292
  return luvio.storeBroadcast().then(() => snapshot);
324
293
  }, () => getResponseCacheKeys(luvio, resourceParams, response.body));
325
294
  }, (response) => {
326
- deepFreeze$2(response);
295
+ deepFreeze(response);
327
296
  throw response;
328
297
  });
329
298
  }
@@ -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: PlaceQuoteErrorResponseRepresentation, existing: PlaceQuoteErrorResponseRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): PlaceQuoteErrorResponseRepresentationNormalized;
6
6
  export declare const select: () => $64$luvio_engine_FragmentSelection;
7
7
  export declare function equals(existing: PlaceQuoteErrorResponseRepresentationNormalized, incoming: PlaceQuoteErrorResponseRepresentationNormalized): boolean;
8
- export declare function deepFreeze(input: PlaceQuoteErrorResponseRepresentation): void;
9
8
  export declare const ingest: $64$luvio_engine_ResourceIngest;
10
9
  export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: PlaceQuoteErrorResponseRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
11
10
  /**
@@ -5,7 +5,6 @@ export declare const RepresentationType: string;
5
5
  export declare function normalize(input: PlaceQuoteInputRepresentation, existing: PlaceQuoteInputRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): PlaceQuoteInputRepresentationNormalized;
6
6
  export declare const select: () => $64$luvio_engine_FragmentSelection;
7
7
  export declare function equals(existing: PlaceQuoteInputRepresentationNormalized, incoming: PlaceQuoteInputRepresentationNormalized): boolean;
8
- export declare function deepFreeze(input: PlaceQuoteInputRepresentation): void;
9
8
  export declare const ingest: $64$luvio_engine_ResourceIngest;
10
9
  export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: PlaceQuoteInputRepresentation, 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: PlaceQuoteInputWrapperRepresentation, existing: PlaceQuoteInputWrapperRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): PlaceQuoteInputWrapperRepresentationNormalized;
7
7
  export declare const select: () => $64$luvio_engine_FragmentSelection;
8
8
  export declare function equals(existing: PlaceQuoteInputWrapperRepresentationNormalized, incoming: PlaceQuoteInputWrapperRepresentationNormalized): boolean;
9
- export declare function deepFreeze(input: PlaceQuoteInputWrapperRepresentation): void;
10
9
  export declare const ingest: $64$luvio_engine_ResourceIngest;
11
10
  export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: PlaceQuoteInputWrapperRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
12
11
  /**
@@ -16,7 +16,6 @@ export declare function keyBuilderFromType_StructuredKey(luvio: $64$luvio_engine
16
16
  export declare function normalize(input: PlaceQuoteOutputRepresentation, existing: PlaceQuoteOutputRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): PlaceQuoteOutputRepresentationNormalized;
17
17
  export declare const select: () => $64$luvio_engine_BaseFragment;
18
18
  export declare function equals(existing: PlaceQuoteOutputRepresentationNormalized, incoming: PlaceQuoteOutputRepresentationNormalized): boolean;
19
- export declare function deepFreeze(input: PlaceQuoteOutputRepresentation): void;
20
19
  export declare const ingest: $64$luvio_engine_ResourceIngest;
21
20
  export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: PlaceQuoteOutputRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
22
21
  /**
@@ -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-revenue-place-quote",
3
- "version": "1.134.6",
3
+ "version": "1.134.8",
4
4
  "description": "Place Quote API for partial items and price/taxation updates async",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "dist/es/es2018/revenue-place-quote.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,27 +52,8 @@ function areRequiredParametersPresent(config, configPropertyNames) {
52
52
  }
53
53
  const keyPrefix = 'place-quote';
54
54
 
55
- const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
56
55
  const { isArray: ArrayIsArray } = Array;
57
56
  const { stringify: JSONStringify } = JSON;
58
- function deepFreeze$2(value) {
59
- // No need to freeze primitives
60
- if (typeof value !== 'object' || value === null) {
61
- return;
62
- }
63
- if (ArrayIsArray(value)) {
64
- for (let i = 0, len = value.length; i < len; i += 1) {
65
- deepFreeze$2(value[i]);
66
- }
67
- }
68
- else {
69
- const keys = ObjectKeys(value);
70
- for (let i = 0, len = keys.length; i < len; i += 1) {
71
- deepFreeze$2(value[keys[i]]);
72
- }
73
- }
74
- ObjectFreeze(value);
75
- }
76
57
  function createLink(ref) {
77
58
  return {
78
59
  __ref: serializeStructuredKey(ref),
@@ -121,9 +102,6 @@ function validate$1(obj, path = 'PlaceQuoteErrorResponseRepresentation') {
121
102
  })();
122
103
  return v_error === undefined ? null : v_error;
123
104
  }
124
- function deepFreeze$1(input) {
125
- ObjectFreeze(input);
126
- }
127
105
 
128
106
  const TTL = 1000;
129
107
  const VERSION = "32a768cba447434ebb8e37e67aed1302";
@@ -197,15 +175,6 @@ function equals(existing, incoming) {
197
175
  }
198
176
  return true;
199
177
  }
200
- function deepFreeze(input) {
201
- const input_responseError = input.responseError;
202
- for (let i = 0; i < input_responseError.length; i++) {
203
- const input_responseError_item = input_responseError[i];
204
- deepFreeze$1(input_responseError_item);
205
- }
206
- ObjectFreeze(input_responseError);
207
- ObjectFreeze(input);
208
- }
209
178
  const ingest = function PlaceQuoteOutputRepresentationIngest(input, path, luvio, store, timestamp) {
210
179
  if (process.env.NODE_ENV !== 'production') {
211
180
  const validateError = validate(input);
@@ -222,7 +191,6 @@ const ingest = function PlaceQuoteOutputRepresentationIngest(input, path, luvio,
222
191
  propertyName: path.propertyName,
223
192
  ttl: ttlToUse
224
193
  });
225
- deepFreeze(input);
226
194
  if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
227
195
  luvio.storePublish(key, incomingRecord);
228
196
  }
@@ -269,6 +237,7 @@ function ingestSuccess(luvio, resourceParams, response) {
269
237
  throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
270
238
  }
271
239
  }
240
+ deepFreeze(snapshot.data);
272
241
  return snapshot;
273
242
  }
274
243
  function createResourceRequest(config) {
@@ -332,7 +301,7 @@ function buildNetworkSnapshot(luvio, config, options) {
332
301
  return luvio.storeBroadcast().then(() => snapshot);
333
302
  }, () => getResponseCacheKeys(luvio, resourceParams, response.body));
334
303
  }, (response) => {
335
- deepFreeze$2(response);
304
+ deepFreeze(response);
336
305
  throw response;
337
306
  });
338
307
  }
@@ -365,4 +334,4 @@ withDefaultLuvio((luvio) => {
365
334
  });
366
335
 
367
336
  export { updateQuote };
368
- // version: 1.134.6-a88a77801
337
+ // version: 1.134.8-c3d6d2cfc