@salesforce/lds-adapters-industries-serviceprocess 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$1, create: ObjectCreate$1 } = Object;
11
11
  const { isArray: ArrayIsArray$1 } = Array;
12
12
  /**
13
13
  * Validates an adapter config is well-formed.
@@ -50,27 +50,9 @@ const snapshotRefreshOptions = {
50
50
  };
51
51
  const keyPrefix = 'serviceprocess';
52
52
 
53
- const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
53
+ const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
54
54
  const { isArray: ArrayIsArray } = Array;
55
55
  const { stringify: JSONStringify } = JSON;
56
- function deepFreeze$4(value) {
57
- // No need to freeze primitives
58
- if (typeof value !== 'object' || value === null) {
59
- return;
60
- }
61
- if (ArrayIsArray(value)) {
62
- for (let i = 0, len = value.length; i < len; i += 1) {
63
- deepFreeze$4(value[i]);
64
- }
65
- }
66
- else {
67
- const keys = ObjectKeys(value);
68
- for (let i = 0, len = keys.length; i < len; i += 1) {
69
- deepFreeze$4(value[keys[i]]);
70
- }
71
- }
72
- ObjectFreeze(value);
73
- }
74
56
  function createLink(ref) {
75
57
  return {
76
58
  __ref: serializeStructuredKey(ref),
@@ -90,11 +72,6 @@ function validate$3(obj, path = 'GenericObjectOutput') {
90
72
  })();
91
73
  return v_error === undefined ? null : v_error;
92
74
  }
93
- function deepFreeze$3(input) {
94
- const input_value = input.value;
95
- deepFreeze$4(input_value);
96
- ObjectFreeze(input);
97
- }
98
75
 
99
76
  function validate$2(obj, path = 'AttributeRepresentation') {
100
77
  const v_error = (() => {
@@ -144,15 +121,6 @@ function validate$2(obj, path = 'AttributeRepresentation') {
144
121
  })();
145
122
  return v_error === undefined ? null : v_error;
146
123
  }
147
- function deepFreeze$2(input) {
148
- const input_childAttributes = input.childAttributes;
149
- for (let i = 0; i < input_childAttributes.length; i++) {
150
- const input_childAttributes_item = input_childAttributes[i];
151
- deepFreeze$2(input_childAttributes_item);
152
- }
153
- ObjectFreeze(input_childAttributes);
154
- ObjectFreeze(input);
155
- }
156
124
 
157
125
  function validate$1(obj, path = 'SvcCatalogItemGroupRepresentation') {
158
126
  const v_error = (() => {
@@ -197,15 +165,6 @@ function validate$1(obj, path = 'SvcCatalogItemGroupRepresentation') {
197
165
  })();
198
166
  return v_error === undefined ? null : v_error;
199
167
  }
200
- function deepFreeze$1(input) {
201
- const input_attributes = input.attributes;
202
- for (let i = 0; i < input_attributes.length; i++) {
203
- const input_attributes_item = input_attributes[i];
204
- deepFreeze$2(input_attributes_item);
205
- }
206
- ObjectFreeze(input_attributes);
207
- ObjectFreeze(input);
208
- }
209
168
 
210
169
  const TTL = 60000;
211
170
  const VERSION = "3c93758e60084dd8896588d82c17fbbe";
@@ -267,24 +226,6 @@ function equals(existing, incoming) {
267
226
  }
268
227
  return true;
269
228
  }
270
- function deepFreeze(input) {
271
- const input_data = input.data;
272
- const input_data_keys = Object.keys(input_data);
273
- const input_data_length = input_data_keys.length;
274
- for (let i = 0; i < input_data_length; i++) {
275
- const key = input_data_keys[i];
276
- const input_data_prop = input_data[key];
277
- deepFreeze$3(input_data_prop);
278
- }
279
- ObjectFreeze(input_data);
280
- const input_groups = input.groups;
281
- for (let i = 0; i < input_groups.length; i++) {
282
- const input_groups_item = input_groups[i];
283
- deepFreeze$1(input_groups_item);
284
- }
285
- ObjectFreeze(input_groups);
286
- ObjectFreeze(input);
287
- }
288
229
  const ingest = function ServiceProcessRequestLayoutDataRepresentationIngest(input, path, luvio, store, timestamp) {
289
230
  if (process.env.NODE_ENV !== 'production') {
290
231
  const validateError = validate(input);
@@ -301,7 +242,6 @@ const ingest = function ServiceProcessRequestLayoutDataRepresentationIngest(inpu
301
242
  propertyName: path.propertyName,
302
243
  ttl: ttlToUse
303
244
  });
304
- deepFreeze(input);
305
245
  if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
306
246
  luvio.storePublish(key, incomingRecord);
307
247
  }
@@ -351,6 +291,7 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
351
291
  throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
352
292
  }
353
293
  }
294
+ deepFreeze(snapshot.data);
354
295
  return snapshot;
355
296
  }
356
297
  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 {
@@ -5,7 +5,6 @@ export declare const RepresentationType: string;
5
5
  export declare function normalize(input: AttributeRepresentation, existing: AttributeRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): AttributeRepresentationNormalized;
6
6
  export declare const select: () => $64$luvio_engine_FragmentSelection;
7
7
  export declare function equals(existing: AttributeRepresentationNormalized, incoming: AttributeRepresentationNormalized): boolean;
8
- export declare function deepFreeze(input: AttributeRepresentation): void;
9
8
  export declare const ingest: $64$luvio_engine_ResourceIngest;
10
9
  export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: AttributeRepresentation, 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: GenericObjectOutput, existing: GenericObjectOutputNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): GenericObjectOutputNormalized;
6
6
  export declare const select: () => $64$luvio_engine_FragmentSelection;
7
7
  export declare function equals(existing: GenericObjectOutputNormalized, incoming: GenericObjectOutputNormalized): boolean;
8
- export declare function deepFreeze(input: GenericObjectOutput): void;
9
8
  export declare const ingest: $64$luvio_engine_ResourceIngest;
10
9
  export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: GenericObjectOutput, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
11
10
  /**
@@ -8,7 +8,6 @@ export declare const RepresentationType: string;
8
8
  export declare function normalize(input: ServiceProcessRequestLayoutDataRepresentation, existing: ServiceProcessRequestLayoutDataRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): ServiceProcessRequestLayoutDataRepresentationNormalized;
9
9
  export declare const select: () => $64$luvio_engine_BaseFragment;
10
10
  export declare function equals(existing: ServiceProcessRequestLayoutDataRepresentationNormalized, incoming: ServiceProcessRequestLayoutDataRepresentationNormalized): boolean;
11
- export declare function deepFreeze(input: ServiceProcessRequestLayoutDataRepresentation): void;
12
11
  export declare const ingest: $64$luvio_engine_ResourceIngest;
13
12
  export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: ServiceProcessRequestLayoutDataRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
14
13
  /**
@@ -6,7 +6,6 @@ export declare const RepresentationType: string;
6
6
  export declare function normalize(input: SvcCatalogItemGroupRepresentation, existing: SvcCatalogItemGroupRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): SvcCatalogItemGroupRepresentationNormalized;
7
7
  export declare const select: () => $64$luvio_engine_FragmentSelection;
8
8
  export declare function equals(existing: SvcCatalogItemGroupRepresentationNormalized, incoming: SvcCatalogItemGroupRepresentationNormalized): boolean;
9
- export declare function deepFreeze(input: SvcCatalogItemGroupRepresentation): void;
10
9
  export declare const ingest: $64$luvio_engine_ResourceIngest;
11
10
  export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: SvcCatalogItemGroupRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
12
11
  /**
@@ -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-serviceprocess",
3
- "version": "1.134.7",
3
+ "version": "1.134.9",
4
4
  "description": "Connect apis for fetching and updating service processes",
5
5
  "license": "MIT",
6
6
  "main": "dist/es/es2018/industries-serviceprocess.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$1, create: ObjectCreate$1 } = Object;
21
21
  const { isArray: ArrayIsArray$1 } = Array;
22
22
  /**
23
23
  * Validates an adapter config is well-formed.
@@ -60,27 +60,9 @@ const snapshotRefreshOptions = {
60
60
  };
61
61
  const keyPrefix = 'serviceprocess';
62
62
 
63
- const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
63
+ const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
64
64
  const { isArray: ArrayIsArray } = Array;
65
65
  const { stringify: JSONStringify } = JSON;
66
- function deepFreeze$4(value) {
67
- // No need to freeze primitives
68
- if (typeof value !== 'object' || value === null) {
69
- return;
70
- }
71
- if (ArrayIsArray(value)) {
72
- for (let i = 0, len = value.length; i < len; i += 1) {
73
- deepFreeze$4(value[i]);
74
- }
75
- }
76
- else {
77
- const keys = ObjectKeys(value);
78
- for (let i = 0, len = keys.length; i < len; i += 1) {
79
- deepFreeze$4(value[keys[i]]);
80
- }
81
- }
82
- ObjectFreeze(value);
83
- }
84
66
  function createLink(ref) {
85
67
  return {
86
68
  __ref: serializeStructuredKey(ref),
@@ -100,11 +82,6 @@ function validate$3(obj, path = 'GenericObjectOutput') {
100
82
  })();
101
83
  return v_error === undefined ? null : v_error;
102
84
  }
103
- function deepFreeze$3(input) {
104
- const input_value = input.value;
105
- deepFreeze$4(input_value);
106
- ObjectFreeze(input);
107
- }
108
85
 
109
86
  function validate$2(obj, path = 'AttributeRepresentation') {
110
87
  const v_error = (() => {
@@ -154,15 +131,6 @@ function validate$2(obj, path = 'AttributeRepresentation') {
154
131
  })();
155
132
  return v_error === undefined ? null : v_error;
156
133
  }
157
- function deepFreeze$2(input) {
158
- const input_childAttributes = input.childAttributes;
159
- for (let i = 0; i < input_childAttributes.length; i++) {
160
- const input_childAttributes_item = input_childAttributes[i];
161
- deepFreeze$2(input_childAttributes_item);
162
- }
163
- ObjectFreeze(input_childAttributes);
164
- ObjectFreeze(input);
165
- }
166
134
 
167
135
  function validate$1(obj, path = 'SvcCatalogItemGroupRepresentation') {
168
136
  const v_error = (() => {
@@ -207,15 +175,6 @@ function validate$1(obj, path = 'SvcCatalogItemGroupRepresentation') {
207
175
  })();
208
176
  return v_error === undefined ? null : v_error;
209
177
  }
210
- function deepFreeze$1(input) {
211
- const input_attributes = input.attributes;
212
- for (let i = 0; i < input_attributes.length; i++) {
213
- const input_attributes_item = input_attributes[i];
214
- deepFreeze$2(input_attributes_item);
215
- }
216
- ObjectFreeze(input_attributes);
217
- ObjectFreeze(input);
218
- }
219
178
 
220
179
  const TTL = 60000;
221
180
  const VERSION = "3c93758e60084dd8896588d82c17fbbe";
@@ -277,24 +236,6 @@ function equals(existing, incoming) {
277
236
  }
278
237
  return true;
279
238
  }
280
- function deepFreeze(input) {
281
- const input_data = input.data;
282
- const input_data_keys = Object.keys(input_data);
283
- const input_data_length = input_data_keys.length;
284
- for (let i = 0; i < input_data_length; i++) {
285
- const key = input_data_keys[i];
286
- const input_data_prop = input_data[key];
287
- deepFreeze$3(input_data_prop);
288
- }
289
- ObjectFreeze(input_data);
290
- const input_groups = input.groups;
291
- for (let i = 0; i < input_groups.length; i++) {
292
- const input_groups_item = input_groups[i];
293
- deepFreeze$1(input_groups_item);
294
- }
295
- ObjectFreeze(input_groups);
296
- ObjectFreeze(input);
297
- }
298
239
  const ingest = function ServiceProcessRequestLayoutDataRepresentationIngest(input, path, luvio, store, timestamp) {
299
240
  if (process.env.NODE_ENV !== 'production') {
300
241
  const validateError = validate(input);
@@ -311,7 +252,6 @@ const ingest = function ServiceProcessRequestLayoutDataRepresentationIngest(inpu
311
252
  propertyName: path.propertyName,
312
253
  ttl: ttlToUse
313
254
  });
314
- deepFreeze(input);
315
255
  if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
316
256
  luvio.storePublish(key, incomingRecord);
317
257
  }
@@ -361,6 +301,7 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
361
301
  throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
362
302
  }
363
303
  }
304
+ deepFreeze(snapshot.data);
364
305
  return snapshot;
365
306
  }
366
307
  function ingestError(luvio, params, error, snapshotRefresh) {
@@ -519,4 +460,4 @@ withDefaultLuvio((luvio) => {
519
460
  });
520
461
 
521
462
  export { getCaseServiceProcessLayoutData, getCaseServiceProcessLayoutData_imperative };
522
- // version: 1.134.7-ed0df45ef
463
+ // version: 1.134.9-fd822024c