@salesforce/lds-adapters-commerce-catalog 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.
- package/dist/es/es2018/commerce-catalog.js +5 -54
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +1 -7
- package/dist/es/es2018/types/src/generated/types/ProductCategoryDetailRepresentation.d.ts +0 -1
- package/dist/es/es2018/types/src/generated/types/ProductCategoryMediaGroupRepresentation.d.ts +0 -1
- package/dist/es/es2018/types/src/generated/types/ProductCategoryMediaRepresentation.d.ts +0 -1
- package/dist/es/es2018/types/src/generated/types/ProductCategoryPathRepresentation.d.ts +0 -1
- package/dist/es/es2018/types/src/generated/types/ProductCategoryRepresentation.d.ts +0 -1
- package/dist/es/es2018/types/src/generated/types/ProductDetailRepresentation.d.ts +0 -1
- package/dist/es/es2018/types/src/generated/types/ProductEntitlementRepresentation.d.ts +0 -1
- package/dist/es/es2018/types/src/generated/types/ProductMediaContentDocumentRepresentation.d.ts +0 -1
- package/dist/es/es2018/types/src/generated/types/ProductMediaGroupRepresentation.d.ts +0 -1
- package/dist/es/es2018/types/src/generated/types/ProductMediaRepresentation.d.ts +0 -1
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +1 -8
- package/package.json +1 -1
- package/sfdc/index.js +6 -55
|
@@ -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,
|
|
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,7 +50,7 @@ const snapshotRefreshOptions = {
|
|
|
50
50
|
};
|
|
51
51
|
const keyPrefix = 'Commerce';
|
|
52
52
|
|
|
53
|
-
const {
|
|
53
|
+
const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
54
54
|
const { isArray: ArrayIsArray } = Array;
|
|
55
55
|
const { stringify: JSONStringify } = JSON;
|
|
56
56
|
function createLink(ref) {
|
|
@@ -124,9 +124,6 @@ function validate$5(obj, path = 'ProductCategoryRepresentation') {
|
|
|
124
124
|
})();
|
|
125
125
|
return v_error === undefined ? null : v_error;
|
|
126
126
|
}
|
|
127
|
-
function deepFreeze$5(input) {
|
|
128
|
-
ObjectFreeze(input);
|
|
129
|
-
}
|
|
130
127
|
|
|
131
128
|
const VERSION$1 = "931ade08fb09ff2c63a3cbfcd5f9a73a";
|
|
132
129
|
function validate$4(obj, path = 'ProductCategoryPathRepresentation') {
|
|
@@ -170,15 +167,6 @@ function equals$1(existing, incoming) {
|
|
|
170
167
|
}
|
|
171
168
|
return true;
|
|
172
169
|
}
|
|
173
|
-
function deepFreeze$4(input) {
|
|
174
|
-
const input_path = input.path;
|
|
175
|
-
for (let i = 0; i < input_path.length; i++) {
|
|
176
|
-
const input_path_item = input_path[i];
|
|
177
|
-
deepFreeze$5(input_path_item);
|
|
178
|
-
}
|
|
179
|
-
ObjectFreeze(input_path);
|
|
180
|
-
ObjectFreeze(input);
|
|
181
|
-
}
|
|
182
170
|
const ingest$1 = function ProductCategoryPathRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
183
171
|
if (process.env.NODE_ENV !== 'production') {
|
|
184
172
|
const validateError = validate$4(input);
|
|
@@ -195,7 +183,6 @@ const ingest$1 = function ProductCategoryPathRepresentationIngest(input, path, l
|
|
|
195
183
|
propertyName: path.propertyName,
|
|
196
184
|
ttl: ttlToUse
|
|
197
185
|
});
|
|
198
|
-
deepFreeze$4(input);
|
|
199
186
|
if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
|
|
200
187
|
luvio.storePublish(key, incomingRecord);
|
|
201
188
|
}
|
|
@@ -245,6 +232,7 @@ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
245
232
|
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
246
233
|
}
|
|
247
234
|
}
|
|
235
|
+
deepFreeze(snapshot.data);
|
|
248
236
|
return snapshot;
|
|
249
237
|
}
|
|
250
238
|
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
@@ -485,9 +473,6 @@ function validate$3(obj, path = 'ProductMediaRepresentation') {
|
|
|
485
473
|
})();
|
|
486
474
|
return v_error === undefined ? null : v_error;
|
|
487
475
|
}
|
|
488
|
-
function deepFreeze$3(input) {
|
|
489
|
-
ObjectFreeze(input);
|
|
490
|
-
}
|
|
491
476
|
|
|
492
477
|
function validate$2(obj, path = 'ProductEntitlementRepresentation') {
|
|
493
478
|
const v_error = (() => {
|
|
@@ -523,9 +508,6 @@ function validate$2(obj, path = 'ProductEntitlementRepresentation') {
|
|
|
523
508
|
})();
|
|
524
509
|
return v_error === undefined ? null : v_error;
|
|
525
510
|
}
|
|
526
|
-
function deepFreeze$2(input) {
|
|
527
|
-
ObjectFreeze(input);
|
|
528
|
-
}
|
|
529
511
|
|
|
530
512
|
function validate$1(obj, path = 'ProductMediaGroupRepresentation') {
|
|
531
513
|
const v_error = (() => {
|
|
@@ -570,15 +552,6 @@ function validate$1(obj, path = 'ProductMediaGroupRepresentation') {
|
|
|
570
552
|
})();
|
|
571
553
|
return v_error === undefined ? null : v_error;
|
|
572
554
|
}
|
|
573
|
-
function deepFreeze$1(input) {
|
|
574
|
-
const input_mediaItems = input.mediaItems;
|
|
575
|
-
for (let i = 0; i < input_mediaItems.length; i++) {
|
|
576
|
-
const input_mediaItems_item = input_mediaItems[i];
|
|
577
|
-
deepFreeze$3(input_mediaItems_item);
|
|
578
|
-
}
|
|
579
|
-
ObjectFreeze(input_mediaItems);
|
|
580
|
-
ObjectFreeze(input);
|
|
581
|
-
}
|
|
582
555
|
|
|
583
556
|
const VERSION = "aeb68d0cbb5b505d40ca2f6997bb9194";
|
|
584
557
|
function validate(obj, path = 'ProductDetailRepresentation') {
|
|
@@ -686,28 +659,6 @@ function equals(existing, incoming) {
|
|
|
686
659
|
}
|
|
687
660
|
return true;
|
|
688
661
|
}
|
|
689
|
-
function deepFreeze(input) {
|
|
690
|
-
const input_defaultImage = input.defaultImage;
|
|
691
|
-
deepFreeze$3(input_defaultImage);
|
|
692
|
-
const input_entitlement = input.entitlement;
|
|
693
|
-
deepFreeze$2(input_entitlement);
|
|
694
|
-
const input_fields = input.fields;
|
|
695
|
-
const input_fields_keys = Object.keys(input_fields);
|
|
696
|
-
const input_fields_length = input_fields_keys.length;
|
|
697
|
-
for (let i = 0; i < input_fields_length; i++) {
|
|
698
|
-
input_fields_keys[i];
|
|
699
|
-
}
|
|
700
|
-
ObjectFreeze(input_fields);
|
|
701
|
-
const input_mediaGroups = input.mediaGroups;
|
|
702
|
-
for (let i = 0; i < input_mediaGroups.length; i++) {
|
|
703
|
-
const input_mediaGroups_item = input_mediaGroups[i];
|
|
704
|
-
deepFreeze$1(input_mediaGroups_item);
|
|
705
|
-
}
|
|
706
|
-
ObjectFreeze(input_mediaGroups);
|
|
707
|
-
const input_primaryProductCategoryPath = input.primaryProductCategoryPath;
|
|
708
|
-
deepFreeze$4(input_primaryProductCategoryPath);
|
|
709
|
-
ObjectFreeze(input);
|
|
710
|
-
}
|
|
711
662
|
const ingest = function ProductDetailRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
712
663
|
if (process.env.NODE_ENV !== 'production') {
|
|
713
664
|
const validateError = validate(input);
|
|
@@ -724,7 +675,6 @@ const ingest = function ProductDetailRepresentationIngest(input, path, luvio, st
|
|
|
724
675
|
propertyName: path.propertyName,
|
|
725
676
|
ttl: ttlToUse
|
|
726
677
|
});
|
|
727
|
-
deepFreeze(input);
|
|
728
678
|
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
729
679
|
luvio.storePublish(key, incomingRecord);
|
|
730
680
|
}
|
|
@@ -774,6 +724,7 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
774
724
|
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
775
725
|
}
|
|
776
726
|
}
|
|
727
|
+
deepFreeze(snapshot.data);
|
|
777
728
|
return snapshot;
|
|
778
729
|
}
|
|
779
730
|
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 {
|
|
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: ProductCategoryDetailRepresentation, existing: ProductCategoryDetailRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): ProductCategoryDetailRepresentationNormalized;
|
|
8
8
|
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
9
9
|
export declare function equals(existing: ProductCategoryDetailRepresentationNormalized, incoming: ProductCategoryDetailRepresentationNormalized): boolean;
|
|
10
|
-
export declare function deepFreeze(input: ProductCategoryDetailRepresentation): void;
|
|
11
10
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
12
11
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: ProductCategoryDetailRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
|
|
13
12
|
/**
|
package/dist/es/es2018/types/src/generated/types/ProductCategoryMediaGroupRepresentation.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export declare const RepresentationType: string;
|
|
|
6
6
|
export declare function normalize(input: ProductCategoryMediaGroupRepresentation, existing: ProductCategoryMediaGroupRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): ProductCategoryMediaGroupRepresentationNormalized;
|
|
7
7
|
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
8
8
|
export declare function equals(existing: ProductCategoryMediaGroupRepresentationNormalized, incoming: ProductCategoryMediaGroupRepresentationNormalized): boolean;
|
|
9
|
-
export declare function deepFreeze(input: ProductCategoryMediaGroupRepresentation): void;
|
|
10
9
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
11
10
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: ProductCategoryMediaGroupRepresentation, 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: ProductCategoryMediaRepresentation, existing: ProductCategoryMediaRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): ProductCategoryMediaRepresentationNormalized;
|
|
6
6
|
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
7
7
|
export declare function equals(existing: ProductCategoryMediaRepresentationNormalized, incoming: ProductCategoryMediaRepresentationNormalized): boolean;
|
|
8
|
-
export declare function deepFreeze(input: ProductCategoryMediaRepresentation): void;
|
|
9
8
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
10
9
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: ProductCategoryMediaRepresentation, 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: ProductCategoryPathRepresentation, existing: ProductCategoryPathRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): ProductCategoryPathRepresentationNormalized;
|
|
7
7
|
export declare const select: () => $64$luvio_engine_BaseFragment;
|
|
8
8
|
export declare function equals(existing: ProductCategoryPathRepresentationNormalized, incoming: ProductCategoryPathRepresentationNormalized): boolean;
|
|
9
|
-
export declare function deepFreeze(input: ProductCategoryPathRepresentation): void;
|
|
10
9
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
11
10
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: ProductCategoryPathRepresentation, 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: ProductCategoryRepresentation, existing: ProductCategoryRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): ProductCategoryRepresentationNormalized;
|
|
6
6
|
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
7
7
|
export declare function equals(existing: ProductCategoryRepresentationNormalized, incoming: ProductCategoryRepresentationNormalized): boolean;
|
|
8
|
-
export declare function deepFreeze(input: ProductCategoryRepresentation): void;
|
|
9
8
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
10
9
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: ProductCategoryRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
|
|
11
10
|
/**
|
|
@@ -9,7 +9,6 @@ export declare const RepresentationType: string;
|
|
|
9
9
|
export declare function normalize(input: ProductDetailRepresentation, existing: ProductDetailRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): ProductDetailRepresentationNormalized;
|
|
10
10
|
export declare const select: () => $64$luvio_engine_BaseFragment;
|
|
11
11
|
export declare function equals(existing: ProductDetailRepresentationNormalized, incoming: ProductDetailRepresentationNormalized): boolean;
|
|
12
|
-
export declare function deepFreeze(input: ProductDetailRepresentation): void;
|
|
13
12
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
14
13
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: ProductDetailRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
|
|
15
14
|
/**
|
|
@@ -5,7 +5,6 @@ export declare const RepresentationType: string;
|
|
|
5
5
|
export declare function normalize(input: ProductEntitlementRepresentation, existing: ProductEntitlementRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): ProductEntitlementRepresentationNormalized;
|
|
6
6
|
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
7
7
|
export declare function equals(existing: ProductEntitlementRepresentationNormalized, incoming: ProductEntitlementRepresentationNormalized): boolean;
|
|
8
|
-
export declare function deepFreeze(input: ProductEntitlementRepresentation): void;
|
|
9
8
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
10
9
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: ProductEntitlementRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
|
|
11
10
|
/**
|
package/dist/es/es2018/types/src/generated/types/ProductMediaContentDocumentRepresentation.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ export declare const RepresentationType: string;
|
|
|
5
5
|
export declare function normalize(input: ProductMediaContentDocumentRepresentation, existing: ProductMediaContentDocumentRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): ProductMediaContentDocumentRepresentationNormalized;
|
|
6
6
|
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
7
7
|
export declare function equals(existing: ProductMediaContentDocumentRepresentationNormalized, incoming: ProductMediaContentDocumentRepresentationNormalized): boolean;
|
|
8
|
-
export declare function deepFreeze(input: ProductMediaContentDocumentRepresentation): void;
|
|
9
8
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
10
9
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: ProductMediaContentDocumentRepresentation, 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: ProductMediaGroupRepresentation, existing: ProductMediaGroupRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): ProductMediaGroupRepresentationNormalized;
|
|
7
7
|
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
8
8
|
export declare function equals(existing: ProductMediaGroupRepresentationNormalized, incoming: ProductMediaGroupRepresentationNormalized): boolean;
|
|
9
|
-
export declare function deepFreeze(input: ProductMediaGroupRepresentation): void;
|
|
10
9
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
11
10
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: ProductMediaGroupRepresentation, 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: ProductMediaRepresentation, existing: ProductMediaRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): ProductMediaRepresentationNormalized;
|
|
6
6
|
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
7
7
|
export declare function equals(existing: ProductMediaRepresentationNormalized, incoming: ProductMediaRepresentationNormalized): boolean;
|
|
8
|
-
export declare function deepFreeze(input: ProductMediaRepresentation): void;
|
|
9
8
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
10
9
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: ProductMediaRepresentation, 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
|
|
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
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,
|
|
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,7 +60,7 @@ const snapshotRefreshOptions = {
|
|
|
60
60
|
};
|
|
61
61
|
const keyPrefix = 'Commerce';
|
|
62
62
|
|
|
63
|
-
const {
|
|
63
|
+
const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
64
64
|
const { isArray: ArrayIsArray } = Array;
|
|
65
65
|
const { stringify: JSONStringify } = JSON;
|
|
66
66
|
function createLink(ref) {
|
|
@@ -175,9 +175,6 @@ function validate$5(obj, path = 'ProductMediaRepresentation') {
|
|
|
175
175
|
})();
|
|
176
176
|
return v_error === undefined ? null : v_error;
|
|
177
177
|
}
|
|
178
|
-
function deepFreeze$5(input) {
|
|
179
|
-
ObjectFreeze(input);
|
|
180
|
-
}
|
|
181
178
|
|
|
182
179
|
function validate$4(obj, path = 'ProductEntitlementRepresentation') {
|
|
183
180
|
const v_error = (() => {
|
|
@@ -213,9 +210,6 @@ function validate$4(obj, path = 'ProductEntitlementRepresentation') {
|
|
|
213
210
|
})();
|
|
214
211
|
return v_error === undefined ? null : v_error;
|
|
215
212
|
}
|
|
216
|
-
function deepFreeze$4(input) {
|
|
217
|
-
ObjectFreeze(input);
|
|
218
|
-
}
|
|
219
213
|
|
|
220
214
|
function validate$3(obj, path = 'ProductMediaGroupRepresentation') {
|
|
221
215
|
const v_error = (() => {
|
|
@@ -260,15 +254,6 @@ function validate$3(obj, path = 'ProductMediaGroupRepresentation') {
|
|
|
260
254
|
})();
|
|
261
255
|
return v_error === undefined ? null : v_error;
|
|
262
256
|
}
|
|
263
|
-
function deepFreeze$3(input) {
|
|
264
|
-
const input_mediaItems = input.mediaItems;
|
|
265
|
-
for (let i = 0; i < input_mediaItems.length; i++) {
|
|
266
|
-
const input_mediaItems_item = input_mediaItems[i];
|
|
267
|
-
deepFreeze$5(input_mediaItems_item);
|
|
268
|
-
}
|
|
269
|
-
ObjectFreeze(input_mediaItems);
|
|
270
|
-
ObjectFreeze(input);
|
|
271
|
-
}
|
|
272
257
|
|
|
273
258
|
function validate$2(obj, path = 'ProductCategoryRepresentation') {
|
|
274
259
|
const v_error = (() => {
|
|
@@ -335,9 +320,6 @@ function validate$2(obj, path = 'ProductCategoryRepresentation') {
|
|
|
335
320
|
})();
|
|
336
321
|
return v_error === undefined ? null : v_error;
|
|
337
322
|
}
|
|
338
|
-
function deepFreeze$2(input) {
|
|
339
|
-
ObjectFreeze(input);
|
|
340
|
-
}
|
|
341
323
|
|
|
342
324
|
const VERSION$1 = "931ade08fb09ff2c63a3cbfcd5f9a73a";
|
|
343
325
|
function validate$1(obj, path = 'ProductCategoryPathRepresentation') {
|
|
@@ -381,15 +363,6 @@ function equals$1(existing, incoming) {
|
|
|
381
363
|
}
|
|
382
364
|
return true;
|
|
383
365
|
}
|
|
384
|
-
function deepFreeze$1(input) {
|
|
385
|
-
const input_path = input.path;
|
|
386
|
-
for (let i = 0; i < input_path.length; i++) {
|
|
387
|
-
const input_path_item = input_path[i];
|
|
388
|
-
deepFreeze$2(input_path_item);
|
|
389
|
-
}
|
|
390
|
-
ObjectFreeze(input_path);
|
|
391
|
-
ObjectFreeze(input);
|
|
392
|
-
}
|
|
393
366
|
const ingest$1 = function ProductCategoryPathRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
394
367
|
if (process.env.NODE_ENV !== 'production') {
|
|
395
368
|
const validateError = validate$1(input);
|
|
@@ -406,7 +379,6 @@ const ingest$1 = function ProductCategoryPathRepresentationIngest(input, path, l
|
|
|
406
379
|
propertyName: path.propertyName,
|
|
407
380
|
ttl: ttlToUse
|
|
408
381
|
});
|
|
409
|
-
deepFreeze$1(input);
|
|
410
382
|
if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
|
|
411
383
|
luvio.storePublish(key, incomingRecord);
|
|
412
384
|
}
|
|
@@ -539,28 +511,6 @@ function equals(existing, incoming) {
|
|
|
539
511
|
}
|
|
540
512
|
return true;
|
|
541
513
|
}
|
|
542
|
-
function deepFreeze(input) {
|
|
543
|
-
const input_defaultImage = input.defaultImage;
|
|
544
|
-
deepFreeze$5(input_defaultImage);
|
|
545
|
-
const input_entitlement = input.entitlement;
|
|
546
|
-
deepFreeze$4(input_entitlement);
|
|
547
|
-
const input_fields = input.fields;
|
|
548
|
-
const input_fields_keys = Object.keys(input_fields);
|
|
549
|
-
const input_fields_length = input_fields_keys.length;
|
|
550
|
-
for (let i = 0; i < input_fields_length; i++) {
|
|
551
|
-
input_fields_keys[i];
|
|
552
|
-
}
|
|
553
|
-
ObjectFreeze(input_fields);
|
|
554
|
-
const input_mediaGroups = input.mediaGroups;
|
|
555
|
-
for (let i = 0; i < input_mediaGroups.length; i++) {
|
|
556
|
-
const input_mediaGroups_item = input_mediaGroups[i];
|
|
557
|
-
deepFreeze$3(input_mediaGroups_item);
|
|
558
|
-
}
|
|
559
|
-
ObjectFreeze(input_mediaGroups);
|
|
560
|
-
const input_primaryProductCategoryPath = input.primaryProductCategoryPath;
|
|
561
|
-
deepFreeze$1(input_primaryProductCategoryPath);
|
|
562
|
-
ObjectFreeze(input);
|
|
563
|
-
}
|
|
564
514
|
const ingest = function ProductDetailRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
565
515
|
if (process.env.NODE_ENV !== 'production') {
|
|
566
516
|
const validateError = validate(input);
|
|
@@ -577,7 +527,6 @@ const ingest = function ProductDetailRepresentationIngest(input, path, luvio, st
|
|
|
577
527
|
propertyName: path.propertyName,
|
|
578
528
|
ttl: ttlToUse
|
|
579
529
|
});
|
|
580
|
-
deepFreeze(input);
|
|
581
530
|
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
582
531
|
luvio.storePublish(key, incomingRecord);
|
|
583
532
|
}
|
|
@@ -627,6 +576,7 @@ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
627
576
|
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
628
577
|
}
|
|
629
578
|
}
|
|
579
|
+
deepFreeze(snapshot.data);
|
|
630
580
|
return snapshot;
|
|
631
581
|
}
|
|
632
582
|
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
@@ -829,6 +779,7 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
829
779
|
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
830
780
|
}
|
|
831
781
|
}
|
|
782
|
+
deepFreeze(snapshot.data);
|
|
832
783
|
return snapshot;
|
|
833
784
|
}
|
|
834
785
|
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
@@ -993,4 +944,4 @@ withDefaultLuvio((luvio) => {
|
|
|
993
944
|
});
|
|
994
945
|
|
|
995
946
|
export { getProduct, getProductCategoryPath, getProductCategoryPath_imperative, getProduct_imperative };
|
|
996
|
-
// version: 1.134.
|
|
947
|
+
// version: 1.134.8-c3d6d2cfc
|