@salesforce/lds-adapters-platform-i18n 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 = 'platformi18n';
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) {
@@ -82,9 +81,6 @@ function validate$1(obj, path = 'TimezoneRepresentation') {
82
81
  })();
83
82
  return v_error === undefined ? null : v_error;
84
83
  }
85
- function deepFreeze$1(input) {
86
- ObjectFreeze(input);
87
- }
88
84
 
89
85
  const VERSION = "e0cab40b3591377c632eb866ff79268c";
90
86
  function validate(obj, path = 'TimezoneOutputRepresentation') {
@@ -128,15 +124,6 @@ function equals(existing, incoming) {
128
124
  }
129
125
  return true;
130
126
  }
131
- function deepFreeze(input) {
132
- const input_timezones = input.timezones;
133
- for (let i = 0; i < input_timezones.length; i++) {
134
- const input_timezones_item = input_timezones[i];
135
- deepFreeze$1(input_timezones_item);
136
- }
137
- ObjectFreeze(input_timezones);
138
- ObjectFreeze(input);
139
- }
140
127
  const ingest = function TimezoneOutputRepresentationIngest(input, path, luvio, store, timestamp) {
141
128
  if (process.env.NODE_ENV !== 'production') {
142
129
  const validateError = validate(input);
@@ -153,7 +140,6 @@ const ingest = function TimezoneOutputRepresentationIngest(input, path, luvio, s
153
140
  propertyName: path.propertyName,
154
141
  ttl: ttlToUse
155
142
  });
156
- deepFreeze(input);
157
143
  if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
158
144
  luvio.storePublish(key, incomingRecord);
159
145
  }
@@ -203,6 +189,7 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
203
189
  throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
204
190
  }
205
191
  }
192
+ deepFreeze(snapshot.data);
206
193
  return snapshot;
207
194
  }
208
195
  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 {
@@ -6,7 +6,6 @@ export declare const RepresentationType: string;
6
6
  export declare function normalize(input: AddressCountry, existing: AddressCountryNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): AddressCountryNormalized;
7
7
  export declare const select: () => $64$luvio_engine_FragmentSelection;
8
8
  export declare function equals(existing: AddressCountryNormalized, incoming: AddressCountryNormalized): boolean;
9
- export declare function deepFreeze(input: AddressCountry): void;
10
9
  export declare const ingest: $64$luvio_engine_ResourceIngest;
11
10
  export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: AddressCountry, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
12
11
  /**
@@ -5,7 +5,6 @@ export declare const RepresentationType: string;
5
5
  export declare function normalize(input: AddressState, existing: AddressStateNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): AddressStateNormalized;
6
6
  export declare const select: () => $64$luvio_engine_FragmentSelection;
7
7
  export declare function equals(existing: AddressStateNormalized, incoming: AddressStateNormalized): boolean;
8
- export declare function deepFreeze(input: AddressState): void;
9
8
  export declare const ingest: $64$luvio_engine_ResourceIngest;
10
9
  export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: AddressState, 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: StateCountryInputRequest, existing: StateCountryInputRequestNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): StateCountryInputRequestNormalized;
6
6
  export declare const select: () => $64$luvio_engine_FragmentSelection;
7
7
  export declare function equals(existing: StateCountryInputRequestNormalized, incoming: StateCountryInputRequestNormalized): boolean;
8
- export declare function deepFreeze(input: StateCountryInputRequest): void;
9
8
  export declare const ingest: $64$luvio_engine_ResourceIngest;
10
9
  export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: StateCountryInputRequest, 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: StateCountryOutputRepresentation, existing: StateCountryOutputRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): StateCountryOutputRepresentationNormalized;
6
6
  export declare const select: () => $64$luvio_engine_FragmentSelection;
7
7
  export declare function equals(existing: StateCountryOutputRepresentationNormalized, incoming: StateCountryOutputRepresentationNormalized): boolean;
8
- export declare function deepFreeze(input: StateCountryOutputRepresentation): void;
9
8
  export declare const ingest: $64$luvio_engine_ResourceIngest;
10
9
  export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: StateCountryOutputRepresentation, 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: StateCountryTranslations, existing: StateCountryTranslationsNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): StateCountryTranslationsNormalized;
7
7
  export declare const select: () => $64$luvio_engine_FragmentSelection;
8
8
  export declare function equals(existing: StateCountryTranslationsNormalized, incoming: StateCountryTranslationsNormalized): boolean;
9
- export declare function deepFreeze(input: StateCountryTranslations): void;
10
9
  export declare const ingest: $64$luvio_engine_ResourceIngest;
11
10
  export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: StateCountryTranslations, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
12
11
  /**
@@ -6,7 +6,6 @@ export declare const RepresentationType: string;
6
6
  export declare function normalize(input: TimezoneOutputRepresentation, existing: TimezoneOutputRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): TimezoneOutputRepresentationNormalized;
7
7
  export declare const select: () => $64$luvio_engine_BaseFragment;
8
8
  export declare function equals(existing: TimezoneOutputRepresentationNormalized, incoming: TimezoneOutputRepresentationNormalized): boolean;
9
- export declare function deepFreeze(input: TimezoneOutputRepresentation): void;
10
9
  export declare const ingest: $64$luvio_engine_ResourceIngest;
11
10
  export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: TimezoneOutputRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
12
11
  /**
@@ -5,7 +5,6 @@ export declare const RepresentationType: string;
5
5
  export declare function normalize(input: TimezoneRepresentation, existing: TimezoneRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): TimezoneRepresentationNormalized;
6
6
  export declare const select: () => $64$luvio_engine_FragmentSelection;
7
7
  export declare function equals(existing: TimezoneRepresentationNormalized, incoming: TimezoneRepresentationNormalized): boolean;
8
- export declare function deepFreeze(input: TimezoneRepresentation): void;
9
8
  export declare const ingest: $64$luvio_engine_ResourceIngest;
10
9
  export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: TimezoneRepresentation, 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-platform-i18n",
3
- "version": "1.134.7",
3
+ "version": "1.134.8",
4
4
  "description": "Glboalization Services",
5
5
  "license": "MIT",
6
6
  "main": "dist/es/es2018/platform-i18n.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 = 'platformi18n';
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) {
@@ -92,9 +91,6 @@ function validate$1(obj, path = 'TimezoneRepresentation') {
92
91
  })();
93
92
  return v_error === undefined ? null : v_error;
94
93
  }
95
- function deepFreeze$1(input) {
96
- ObjectFreeze(input);
97
- }
98
94
 
99
95
  const VERSION = "e0cab40b3591377c632eb866ff79268c";
100
96
  function validate(obj, path = 'TimezoneOutputRepresentation') {
@@ -138,15 +134,6 @@ function equals(existing, incoming) {
138
134
  }
139
135
  return true;
140
136
  }
141
- function deepFreeze(input) {
142
- const input_timezones = input.timezones;
143
- for (let i = 0; i < input_timezones.length; i++) {
144
- const input_timezones_item = input_timezones[i];
145
- deepFreeze$1(input_timezones_item);
146
- }
147
- ObjectFreeze(input_timezones);
148
- ObjectFreeze(input);
149
- }
150
137
  const ingest = function TimezoneOutputRepresentationIngest(input, path, luvio, store, timestamp) {
151
138
  if (process.env.NODE_ENV !== 'production') {
152
139
  const validateError = validate(input);
@@ -163,7 +150,6 @@ const ingest = function TimezoneOutputRepresentationIngest(input, path, luvio, s
163
150
  propertyName: path.propertyName,
164
151
  ttl: ttlToUse
165
152
  });
166
- deepFreeze(input);
167
153
  if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
168
154
  luvio.storePublish(key, incomingRecord);
169
155
  }
@@ -213,6 +199,7 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
213
199
  throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
214
200
  }
215
201
  }
202
+ deepFreeze(snapshot.data);
216
203
  return snapshot;
217
204
  }
218
205
  function ingestError(luvio, params, error, snapshotRefresh) {
@@ -365,4 +352,4 @@ withDefaultLuvio((luvio) => {
365
352
  });
366
353
 
367
354
  export { getTimezonesByLocale, getTimezonesByLocale_imperative };
368
- // version: 1.134.7-ed0df45ef
355
+ // version: 1.134.8-c3d6d2cfc