@salesforce/lds-adapters-industries-dataloading 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.
- package/dist/es/es2018/industries-dataloading.js +5 -23
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +1 -7
- package/dist/es/es2018/types/src/generated/types/FeatureObjectRepresentation.d.ts +0 -1
- package/dist/es/es2018/types/src/generated/types/FeatureObjectsResultRepresentation.d.ts +0 -1
- package/dist/es/es2018/types/src/generated/types/ObjectCsvDataTemplateRepresentation.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 -24
|
@@ -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 = 'dataloading';
|
|
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) {
|
|
@@ -102,11 +101,6 @@ function equals$1(existing, incoming) {
|
|
|
102
101
|
}
|
|
103
102
|
return true;
|
|
104
103
|
}
|
|
105
|
-
function deepFreeze$2(input) {
|
|
106
|
-
const input_template = input.template;
|
|
107
|
-
ObjectFreeze(input_template);
|
|
108
|
-
ObjectFreeze(input);
|
|
109
|
-
}
|
|
110
104
|
const ingest$1 = function ObjectCsvDataTemplateRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
111
105
|
if (process.env.NODE_ENV !== 'production') {
|
|
112
106
|
const validateError = validate$2(input);
|
|
@@ -123,7 +117,6 @@ const ingest$1 = function ObjectCsvDataTemplateRepresentationIngest(input, path,
|
|
|
123
117
|
propertyName: path.propertyName,
|
|
124
118
|
ttl: ttlToUse
|
|
125
119
|
});
|
|
126
|
-
deepFreeze$2(input);
|
|
127
120
|
if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
|
|
128
121
|
luvio.storePublish(key, incomingRecord);
|
|
129
122
|
}
|
|
@@ -173,6 +166,7 @@ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
173
166
|
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
174
167
|
}
|
|
175
168
|
}
|
|
169
|
+
deepFreeze(snapshot.data);
|
|
176
170
|
return snapshot;
|
|
177
171
|
}
|
|
178
172
|
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
@@ -327,9 +321,6 @@ function validate$1(obj, path = 'FeatureObjectRepresentation') {
|
|
|
327
321
|
})();
|
|
328
322
|
return v_error === undefined ? null : v_error;
|
|
329
323
|
}
|
|
330
|
-
function deepFreeze$1(input) {
|
|
331
|
-
ObjectFreeze(input);
|
|
332
|
-
}
|
|
333
324
|
|
|
334
325
|
const TTL = 300;
|
|
335
326
|
const VERSION = "440ab792d2d7f730b3d308c484a9222b";
|
|
@@ -399,15 +390,6 @@ function equals(existing, incoming) {
|
|
|
399
390
|
}
|
|
400
391
|
return true;
|
|
401
392
|
}
|
|
402
|
-
function deepFreeze(input) {
|
|
403
|
-
const input_objects = input.objects;
|
|
404
|
-
for (let i = 0; i < input_objects.length; i++) {
|
|
405
|
-
const input_objects_item = input_objects[i];
|
|
406
|
-
deepFreeze$1(input_objects_item);
|
|
407
|
-
}
|
|
408
|
-
ObjectFreeze(input_objects);
|
|
409
|
-
ObjectFreeze(input);
|
|
410
|
-
}
|
|
411
393
|
const ingest = function FeatureObjectsResultRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
412
394
|
if (process.env.NODE_ENV !== 'production') {
|
|
413
395
|
const validateError = validate(input);
|
|
@@ -424,7 +406,6 @@ const ingest = function FeatureObjectsResultRepresentationIngest(input, path, lu
|
|
|
424
406
|
propertyName: path.propertyName,
|
|
425
407
|
ttl: ttlToUse
|
|
426
408
|
});
|
|
427
|
-
deepFreeze(input);
|
|
428
409
|
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
429
410
|
luvio.storePublish(key, incomingRecord);
|
|
430
411
|
}
|
|
@@ -474,6 +455,7 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
474
455
|
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
475
456
|
}
|
|
476
457
|
}
|
|
458
|
+
deepFreeze(snapshot.data);
|
|
477
459
|
return snapshot;
|
|
478
460
|
}
|
|
479
461
|
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 {
|
|
@@ -5,7 +5,6 @@ export declare const RepresentationType: string;
|
|
|
5
5
|
export declare function normalize(input: FeatureObjectRepresentation, existing: FeatureObjectRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): FeatureObjectRepresentationNormalized;
|
|
6
6
|
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
7
7
|
export declare function equals(existing: FeatureObjectRepresentationNormalized, incoming: FeatureObjectRepresentationNormalized): boolean;
|
|
8
|
-
export declare function deepFreeze(input: FeatureObjectRepresentation): void;
|
|
9
8
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
10
9
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: FeatureObjectRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
|
|
11
10
|
/**
|
|
@@ -7,7 +7,6 @@ export declare const RepresentationType: string;
|
|
|
7
7
|
export declare function normalize(input: FeatureObjectsResultRepresentation, existing: FeatureObjectsResultRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): FeatureObjectsResultRepresentationNormalized;
|
|
8
8
|
export declare const select: () => $64$luvio_engine_BaseFragment;
|
|
9
9
|
export declare function equals(existing: FeatureObjectsResultRepresentationNormalized, incoming: FeatureObjectsResultRepresentationNormalized): boolean;
|
|
10
|
-
export declare function deepFreeze(input: FeatureObjectsResultRepresentation): void;
|
|
11
10
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
12
11
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: FeatureObjectsResultRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): $64$luvio_engine_DurableStoreKeyMetadataMap;
|
|
13
12
|
/**
|
|
@@ -6,7 +6,6 @@ export declare const RepresentationType: string;
|
|
|
6
6
|
export declare function normalize(input: ObjectCsvDataTemplateRepresentation, existing: ObjectCsvDataTemplateRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): ObjectCsvDataTemplateRepresentationNormalized;
|
|
7
7
|
export declare const select: () => $64$luvio_engine_BaseFragment;
|
|
8
8
|
export declare function equals(existing: ObjectCsvDataTemplateRepresentationNormalized, incoming: ObjectCsvDataTemplateRepresentationNormalized): boolean;
|
|
9
|
-
export declare function deepFreeze(input: ObjectCsvDataTemplateRepresentation): void;
|
|
10
9
|
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
11
10
|
export declare function getTypeCacheKeys(luvio: $64$luvio_engine_Luvio, input: ObjectCsvDataTemplateRepresentation, 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
|
|
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-dataloading",
|
|
3
|
-
"version": "1.134.
|
|
3
|
+
"version": "1.134.8",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "API Family to support data loading for objects",
|
|
6
6
|
"main": "dist/es/es2018/industries-dataloading.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 = 'dataloading';
|
|
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) {
|
|
@@ -112,11 +111,6 @@ function equals$1(existing, incoming) {
|
|
|
112
111
|
}
|
|
113
112
|
return true;
|
|
114
113
|
}
|
|
115
|
-
function deepFreeze$2(input) {
|
|
116
|
-
const input_template = input.template;
|
|
117
|
-
ObjectFreeze(input_template);
|
|
118
|
-
ObjectFreeze(input);
|
|
119
|
-
}
|
|
120
114
|
const ingest$1 = function ObjectCsvDataTemplateRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
121
115
|
if (process.env.NODE_ENV !== 'production') {
|
|
122
116
|
const validateError = validate$2(input);
|
|
@@ -133,7 +127,6 @@ const ingest$1 = function ObjectCsvDataTemplateRepresentationIngest(input, path,
|
|
|
133
127
|
propertyName: path.propertyName,
|
|
134
128
|
ttl: ttlToUse
|
|
135
129
|
});
|
|
136
|
-
deepFreeze$2(input);
|
|
137
130
|
if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
|
|
138
131
|
luvio.storePublish(key, incomingRecord);
|
|
139
132
|
}
|
|
@@ -183,6 +176,7 @@ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
183
176
|
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
184
177
|
}
|
|
185
178
|
}
|
|
179
|
+
deepFreeze(snapshot.data);
|
|
186
180
|
return snapshot;
|
|
187
181
|
}
|
|
188
182
|
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
@@ -337,9 +331,6 @@ function validate$1(obj, path = 'FeatureObjectRepresentation') {
|
|
|
337
331
|
})();
|
|
338
332
|
return v_error === undefined ? null : v_error;
|
|
339
333
|
}
|
|
340
|
-
function deepFreeze$1(input) {
|
|
341
|
-
ObjectFreeze(input);
|
|
342
|
-
}
|
|
343
334
|
|
|
344
335
|
const TTL = 300;
|
|
345
336
|
const VERSION = "440ab792d2d7f730b3d308c484a9222b";
|
|
@@ -409,15 +400,6 @@ function equals(existing, incoming) {
|
|
|
409
400
|
}
|
|
410
401
|
return true;
|
|
411
402
|
}
|
|
412
|
-
function deepFreeze(input) {
|
|
413
|
-
const input_objects = input.objects;
|
|
414
|
-
for (let i = 0; i < input_objects.length; i++) {
|
|
415
|
-
const input_objects_item = input_objects[i];
|
|
416
|
-
deepFreeze$1(input_objects_item);
|
|
417
|
-
}
|
|
418
|
-
ObjectFreeze(input_objects);
|
|
419
|
-
ObjectFreeze(input);
|
|
420
|
-
}
|
|
421
403
|
const ingest = function FeatureObjectsResultRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
422
404
|
if (process.env.NODE_ENV !== 'production') {
|
|
423
405
|
const validateError = validate(input);
|
|
@@ -434,7 +416,6 @@ const ingest = function FeatureObjectsResultRepresentationIngest(input, path, lu
|
|
|
434
416
|
propertyName: path.propertyName,
|
|
435
417
|
ttl: ttlToUse
|
|
436
418
|
});
|
|
437
|
-
deepFreeze(input);
|
|
438
419
|
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
439
420
|
luvio.storePublish(key, incomingRecord);
|
|
440
421
|
}
|
|
@@ -484,6 +465,7 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
484
465
|
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
485
466
|
}
|
|
486
467
|
}
|
|
468
|
+
deepFreeze(snapshot.data);
|
|
487
469
|
return snapshot;
|
|
488
470
|
}
|
|
489
471
|
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
@@ -665,4 +647,4 @@ withDefaultLuvio((luvio) => {
|
|
|
665
647
|
});
|
|
666
648
|
|
|
667
649
|
export { getCsvDataTemplate, getCsvDataTemplate_imperative, getObjectsForFeature, getObjectsForFeature_imperative };
|
|
668
|
-
// version: 1.134.
|
|
650
|
+
// version: 1.134.8-c3d6d2cfc
|