@salesforce/lds-adapters-experience-marketing-integration 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/experience-marketing-integration.js +6 -22
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +1 -7
- package/dist/es/es2018/types/src/generated/types/FormFieldInputList.d.ts +0 -1
- package/dist/es/es2018/types/src/generated/types/FormFieldInputRepresentation.d.ts +0 -1
- package/dist/es/es2018/types/src/generated/types/FormFieldList.d.ts +0 -1
- package/dist/es/es2018/types/src/generated/types/FormFieldRepresentation.d.ts +0 -1
- package/dist/es/es2018/types/src/generated/types/FormInputRepresentation.d.ts +0 -1
- package/dist/es/es2018/types/src/generated/types/FormInputWrapperRepresentation.d.ts +0 -1
- package/dist/es/es2018/types/src/generated/types/FormRepresentation.d.ts +0 -1
- package/dist/es/es2018/types/src/generated/types/FormSubmissionFieldInputList.d.ts +0 -1
- package/dist/es/es2018/types/src/generated/types/FormSubmissionFieldInputRepresentation.d.ts +0 -1
- package/dist/es/es2018/types/src/generated/types/FormSubmissionInputRepresentation.d.ts +0 -1
- package/dist/es/es2018/types/src/generated/types/FormSubmissionInputWrapperRepresentation.d.ts +0 -1
- package/dist/es/es2018/types/src/generated/types/FormSubmissionRepresentation.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 +7 -23
|
@@ -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
|
|
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
|
|
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 = 'marketing-integration';
|
|
52
52
|
|
|
53
|
-
const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
54
53
|
const { isArray: ArrayIsArray } = Array;
|
|
55
54
|
function equalsArray(a, b, equalsItem) {
|
|
56
55
|
const aLength = a.length;
|
|
@@ -65,24 +64,6 @@ function equalsArray(a, b, equalsItem) {
|
|
|
65
64
|
}
|
|
66
65
|
return true;
|
|
67
66
|
}
|
|
68
|
-
function deepFreeze(value) {
|
|
69
|
-
// No need to freeze primitives
|
|
70
|
-
if (typeof value !== 'object' || value === null) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
if (ArrayIsArray(value)) {
|
|
74
|
-
for (let i = 0, len = value.length; i < len; i += 1) {
|
|
75
|
-
deepFreeze(value[i]);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
const keys = ObjectKeys(value);
|
|
80
|
-
for (let i = 0, len = keys.length; i < len; i += 1) {
|
|
81
|
-
deepFreeze(value[keys[i]]);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
ObjectFreeze(value);
|
|
85
|
-
}
|
|
86
67
|
function createLink(ref) {
|
|
87
68
|
return {
|
|
88
69
|
__ref: serializeStructuredKey(ref),
|
|
@@ -421,6 +402,7 @@ function ingestSuccess$2(luvio, resourceParams, response) {
|
|
|
421
402
|
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
422
403
|
}
|
|
423
404
|
}
|
|
405
|
+
deepFreeze(snapshot.data);
|
|
424
406
|
return snapshot;
|
|
425
407
|
}
|
|
426
408
|
function createResourceRequest$2(config) {
|
|
@@ -531,6 +513,7 @@ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
531
513
|
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
532
514
|
}
|
|
533
515
|
}
|
|
516
|
+
deepFreeze(snapshot.data);
|
|
534
517
|
return snapshot;
|
|
535
518
|
}
|
|
536
519
|
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
@@ -842,6 +825,7 @@ function ingestSuccess(luvio, resourceParams, response) {
|
|
|
842
825
|
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
843
826
|
}
|
|
844
827
|
}
|
|
828
|
+
deepFreeze(snapshot.data);
|
|
845
829
|
return snapshot;
|
|
846
830
|
}
|
|
847
831
|
function createResourceRequest(config) {
|
|
@@ -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 {
|
|
@@ -6,7 +6,6 @@ export declare const RepresentationType: string;
|
|
|
6
6
|
export declare function normalize(input: FormFieldInputList, existing: FormFieldInputListNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): FormFieldInputListNormalized;
|
|
7
7
|
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
8
8
|
export declare function equals(existing: FormFieldInputListNormalized, incoming: FormFieldInputListNormalized): boolean;
|
|
9
|
-
export declare function deepFreeze(input: FormFieldInputList): void;
|
|
10
9
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
11
10
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: FormFieldInputList, 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: FormFieldInputRepresentation, existing: FormFieldInputRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): FormFieldInputRepresentationNormalized;
|
|
6
6
|
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
7
7
|
export declare function equals(existing: FormFieldInputRepresentationNormalized, incoming: FormFieldInputRepresentationNormalized): boolean;
|
|
8
|
-
export declare function deepFreeze(input: FormFieldInputRepresentation): void;
|
|
9
8
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
10
9
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: FormFieldInputRepresentation, 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: FormFieldList, existing: FormFieldListNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): FormFieldListNormalized;
|
|
7
7
|
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
8
8
|
export declare function equals(existing: FormFieldListNormalized, incoming: FormFieldListNormalized): boolean;
|
|
9
|
-
export declare function deepFreeze(input: FormFieldList): void;
|
|
10
9
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
11
10
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: FormFieldList, 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: FormFieldRepresentation, existing: FormFieldRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): FormFieldRepresentationNormalized;
|
|
6
6
|
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
7
7
|
export declare function equals(existing: FormFieldRepresentationNormalized, incoming: FormFieldRepresentationNormalized): boolean;
|
|
8
|
-
export declare function deepFreeze(input: FormFieldRepresentation): void;
|
|
9
8
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
10
9
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: FormFieldRepresentation, 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: FormInputRepresentation, existing: FormInputRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): FormInputRepresentationNormalized;
|
|
7
7
|
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
8
8
|
export declare function equals(existing: FormInputRepresentationNormalized, incoming: FormInputRepresentationNormalized): boolean;
|
|
9
|
-
export declare function deepFreeze(input: FormInputRepresentation): void;
|
|
10
9
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
11
10
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: FormInputRepresentation, 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: FormInputWrapperRepresentation, existing: FormInputWrapperRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): FormInputWrapperRepresentationNormalized;
|
|
7
7
|
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
8
8
|
export declare function equals(existing: FormInputWrapperRepresentationNormalized, incoming: FormInputWrapperRepresentationNormalized): boolean;
|
|
9
|
-
export declare function deepFreeze(input: FormInputWrapperRepresentation): void;
|
|
10
9
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
11
10
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: FormInputWrapperRepresentation, 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: FormRepresentation, existing: FormRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): FormRepresentationNormalized;
|
|
17
17
|
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
18
18
|
export declare function equals(existing: FormRepresentationNormalized, incoming: FormRepresentationNormalized): boolean;
|
|
19
|
-
export declare function deepFreeze(input: FormRepresentation): void;
|
|
20
19
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
21
20
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: FormRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
|
|
22
21
|
/**
|
|
@@ -6,7 +6,6 @@ export declare const RepresentationType: string;
|
|
|
6
6
|
export declare function normalize(input: FormSubmissionFieldInputList, existing: FormSubmissionFieldInputListNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): FormSubmissionFieldInputListNormalized;
|
|
7
7
|
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
8
8
|
export declare function equals(existing: FormSubmissionFieldInputListNormalized, incoming: FormSubmissionFieldInputListNormalized): boolean;
|
|
9
|
-
export declare function deepFreeze(input: FormSubmissionFieldInputList): void;
|
|
10
9
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
11
10
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: FormSubmissionFieldInputList, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
|
|
12
11
|
/**
|
package/dist/es/es2018/types/src/generated/types/FormSubmissionFieldInputRepresentation.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ export declare const RepresentationType: string;
|
|
|
5
5
|
export declare function normalize(input: FormSubmissionFieldInputRepresentation, existing: FormSubmissionFieldInputRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): FormSubmissionFieldInputRepresentationNormalized;
|
|
6
6
|
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
7
7
|
export declare function equals(existing: FormSubmissionFieldInputRepresentationNormalized, incoming: FormSubmissionFieldInputRepresentationNormalized): boolean;
|
|
8
|
-
export declare function deepFreeze(input: FormSubmissionFieldInputRepresentation): void;
|
|
9
8
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
10
9
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: FormSubmissionFieldInputRepresentation, 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: FormSubmissionInputRepresentation, existing: FormSubmissionInputRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): FormSubmissionInputRepresentationNormalized;
|
|
7
7
|
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
8
8
|
export declare function equals(existing: FormSubmissionInputRepresentationNormalized, incoming: FormSubmissionInputRepresentationNormalized): boolean;
|
|
9
|
-
export declare function deepFreeze(input: FormSubmissionInputRepresentation): void;
|
|
10
9
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
11
10
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: FormSubmissionInputRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
|
|
12
11
|
/**
|
package/dist/es/es2018/types/src/generated/types/FormSubmissionInputWrapperRepresentation.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export declare const RepresentationType: string;
|
|
|
6
6
|
export declare function normalize(input: FormSubmissionInputWrapperRepresentation, existing: FormSubmissionInputWrapperRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): FormSubmissionInputWrapperRepresentationNormalized;
|
|
7
7
|
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
8
8
|
export declare function equals(existing: FormSubmissionInputWrapperRepresentationNormalized, incoming: FormSubmissionInputWrapperRepresentationNormalized): boolean;
|
|
9
|
-
export declare function deepFreeze(input: FormSubmissionInputWrapperRepresentation): void;
|
|
10
9
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
11
10
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: FormSubmissionInputWrapperRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
|
|
12
11
|
/**
|
|
@@ -15,7 +15,6 @@ export declare function keyBuilderFromType_StructuredKey(luvio: $64$luvio_engine
|
|
|
15
15
|
export declare function normalize(input: FormSubmissionRepresentation, existing: FormSubmissionRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): FormSubmissionRepresentationNormalized;
|
|
16
16
|
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
17
17
|
export declare function equals(existing: FormSubmissionRepresentationNormalized, incoming: FormSubmissionRepresentationNormalized): boolean;
|
|
18
|
-
export declare function deepFreeze(input: FormSubmissionRepresentation): void;
|
|
19
18
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
20
19
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: FormSubmissionRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
|
|
21
20
|
/**
|
|
@@ -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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-adapters-experience-marketing-integration",
|
|
3
|
-
"version": "1.134.
|
|
3
|
+
"version": "1.134.8",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "With this API, you can CRUD data in Marketing Cloud's storage, Data Extensions.",
|
|
6
6
|
"main": "dist/es/es2018/experience-marketing-integration.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
|
|
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
|
|
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 = 'marketing-integration';
|
|
62
62
|
|
|
63
|
-
const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
64
63
|
const { isArray: ArrayIsArray } = Array;
|
|
65
64
|
function equalsArray(a, b, equalsItem) {
|
|
66
65
|
const aLength = a.length;
|
|
@@ -75,24 +74,6 @@ function equalsArray(a, b, equalsItem) {
|
|
|
75
74
|
}
|
|
76
75
|
return true;
|
|
77
76
|
}
|
|
78
|
-
function deepFreeze(value) {
|
|
79
|
-
// No need to freeze primitives
|
|
80
|
-
if (typeof value !== 'object' || value === null) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
if (ArrayIsArray(value)) {
|
|
84
|
-
for (let i = 0, len = value.length; i < len; i += 1) {
|
|
85
|
-
deepFreeze(value[i]);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
const keys = ObjectKeys(value);
|
|
90
|
-
for (let i = 0, len = keys.length; i < len; i += 1) {
|
|
91
|
-
deepFreeze(value[keys[i]]);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
ObjectFreeze(value);
|
|
95
|
-
}
|
|
96
77
|
function createLink(ref) {
|
|
97
78
|
return {
|
|
98
79
|
__ref: serializeStructuredKey(ref),
|
|
@@ -366,6 +347,7 @@ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
366
347
|
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
367
348
|
}
|
|
368
349
|
}
|
|
350
|
+
deepFreeze(snapshot.data);
|
|
369
351
|
return snapshot;
|
|
370
352
|
}
|
|
371
353
|
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
@@ -633,6 +615,7 @@ function ingestSuccess$1(luvio, resourceParams, response) {
|
|
|
633
615
|
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
634
616
|
}
|
|
635
617
|
}
|
|
618
|
+
deepFreeze(snapshot.data);
|
|
636
619
|
return snapshot;
|
|
637
620
|
}
|
|
638
621
|
function createResourceRequest$1(config) {
|
|
@@ -889,6 +872,7 @@ function ingestSuccess(luvio, resourceParams, response) {
|
|
|
889
872
|
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
890
873
|
}
|
|
891
874
|
}
|
|
875
|
+
deepFreeze(snapshot.data);
|
|
892
876
|
return snapshot;
|
|
893
877
|
}
|
|
894
878
|
function createResourceRequest(config) {
|
|
@@ -1013,4 +997,4 @@ withDefaultLuvio((luvio) => {
|
|
|
1013
997
|
});
|
|
1014
998
|
|
|
1015
999
|
export { getForm, getFormNotifyChange, getForm_imperative, saveForm, submitForm };
|
|
1016
|
-
// version: 1.134.
|
|
1000
|
+
// version: 1.134.8-c3d6d2cfc
|