@salesforce/lds-worker-api 1.136.5 → 1.136.7
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/sfdc/es/ldsWorkerApi.js +10 -13
- package/dist/standalone/es/lds-worker-api.js +402 -161
- package/dist/standalone/umd/lds-worker-api.js +402 -161
- package/package.json +1 -1
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
SnapshotState["Stale"] = "Stale";
|
|
27
27
|
})(SnapshotState$3 || (SnapshotState$3 = {}));
|
|
28
28
|
|
|
29
|
-
const { create: create$a, entries: entries$4, freeze: freeze$5, keys: keys$
|
|
29
|
+
const { create: create$a, entries: entries$4, freeze: freeze$5, keys: keys$b, values: values$3 } = Object;
|
|
30
30
|
const { hasOwnProperty: hasOwnProperty$3 } = Object.prototype;
|
|
31
31
|
const { isArray: isArray$9 } = Array;
|
|
32
32
|
const { push: push$4, indexOf, slice: slice$2 } = Array.prototype;
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
else {
|
|
46
|
-
const keys$1 = keys$
|
|
46
|
+
const keys$1 = keys$b(value);
|
|
47
47
|
for (let i = 0, len = keys$1.length; i < len; i += 1) {
|
|
48
48
|
deepFreeze(value[keys$1[i]]);
|
|
49
49
|
}
|
|
@@ -304,7 +304,7 @@
|
|
|
304
304
|
if (node === null) {
|
|
305
305
|
return 'null';
|
|
306
306
|
}
|
|
307
|
-
const keys$1 = keys$
|
|
307
|
+
const keys$1 = keys$b(node).sort();
|
|
308
308
|
out = '';
|
|
309
309
|
for (i = 0; i < keys$1.length; i++) {
|
|
310
310
|
const key = keys$1[i];
|
|
@@ -575,13 +575,13 @@
|
|
|
575
575
|
return this.records[this.getCanonicalRecordId(key)];
|
|
576
576
|
}
|
|
577
577
|
getNumEntries() {
|
|
578
|
-
return keys$
|
|
578
|
+
return keys$b(this.records).length;
|
|
579
579
|
}
|
|
580
580
|
readMetadata(key) {
|
|
581
581
|
return this.metadata[this.getCanonicalRecordId(key)];
|
|
582
582
|
}
|
|
583
583
|
readMetadataWhere(query) {
|
|
584
|
-
const keys$1 = keys$
|
|
584
|
+
const keys$1 = keys$b(this.metadata);
|
|
585
585
|
const results = [];
|
|
586
586
|
const hasNamespaceQuery = hasOwnProperty$3.call(query, 'namespace');
|
|
587
587
|
const hasRepresentationNameQuery = hasOwnProperty$3.call(query, 'representationName');
|
|
@@ -677,8 +677,8 @@
|
|
|
677
677
|
// Note: we should always get the subscription references from this at the beginning
|
|
678
678
|
// of the function, in case the reference changes (because of an unsubscribe)
|
|
679
679
|
const { snapshotSubscriptions, watchSubscriptions, visitedIds, refreshedIds, insertedIds } = this;
|
|
680
|
-
const allVisitedIds = keys$
|
|
681
|
-
const allRefreshedIds = keys$
|
|
680
|
+
const allVisitedIds = keys$b(visitedIds);
|
|
681
|
+
const allRefreshedIds = keys$b(refreshedIds);
|
|
682
682
|
// Early exit if nothing has changed
|
|
683
683
|
if (allVisitedIds.length === 0 && allRefreshedIds.length === 0) {
|
|
684
684
|
return Promise.resolve();
|
|
@@ -1125,7 +1125,7 @@
|
|
|
1125
1125
|
hasOverlappingIds(snapshot, visitedIds) === false);
|
|
1126
1126
|
}
|
|
1127
1127
|
function getMatchingIds(partialKey, visitedIds) {
|
|
1128
|
-
const keys$1 = keys$
|
|
1128
|
+
const keys$1 = keys$b(partialKey);
|
|
1129
1129
|
return visitedIds.filter((visitedId) => {
|
|
1130
1130
|
return keys$1.every((key) => {
|
|
1131
1131
|
return partialKey[key] === visitedId[key];
|
|
@@ -1752,8 +1752,8 @@
|
|
|
1752
1752
|
} while (redirectKey !== undefined);
|
|
1753
1753
|
}
|
|
1754
1754
|
isUsingStringKeys() {
|
|
1755
|
-
return (keys$
|
|
1756
|
-
keys$
|
|
1755
|
+
return (keys$b(this.fallbackStringKeyInMemoryStore.visitedIds).length !== 0 ||
|
|
1756
|
+
keys$b(this.fallbackStringKeyInMemoryStore.refreshedIds).length !== 0);
|
|
1757
1757
|
}
|
|
1758
1758
|
delegateToFallbackStringKeyStore(snapshot) {
|
|
1759
1759
|
return !isErrorSnapshot$3(snapshot) && typeof snapshot.recordId === 'string';
|
|
@@ -1795,7 +1795,7 @@
|
|
|
1795
1795
|
buildKeySchema(keyMetadata) {
|
|
1796
1796
|
// pull NamespacedType type out of NormalizedKeyMetadata
|
|
1797
1797
|
const { namespace: _ns, representationName: _rn, ...keyParamValues } = keyMetadata;
|
|
1798
|
-
const keySchema = keys$
|
|
1798
|
+
const keySchema = keys$b(keyParamValues).sort();
|
|
1799
1799
|
return ['namespace', 'representationName', ...keySchema];
|
|
1800
1800
|
}
|
|
1801
1801
|
}
|
|
@@ -2083,7 +2083,7 @@
|
|
|
2083
2083
|
return value;
|
|
2084
2084
|
}
|
|
2085
2085
|
keys() {
|
|
2086
|
-
return keys$
|
|
2086
|
+
return keys$b(this.data);
|
|
2087
2087
|
}
|
|
2088
2088
|
isScalar(propertyName) {
|
|
2089
2089
|
// TODO W-6900046 - merge.ts casts these to any and manually sets `data`
|
|
@@ -2462,7 +2462,7 @@
|
|
|
2462
2462
|
}
|
|
2463
2463
|
}
|
|
2464
2464
|
selectAllObject(record, data, visitedKeys) {
|
|
2465
|
-
const recordKeys = keys$
|
|
2465
|
+
const recordKeys = keys$b(record);
|
|
2466
2466
|
const { length } = recordKeys;
|
|
2467
2467
|
for (let i = 0; i < length; i += 1) {
|
|
2468
2468
|
const key = recordKeys[i];
|
|
@@ -2643,7 +2643,7 @@
|
|
|
2643
2643
|
}
|
|
2644
2644
|
const { baseSnapshotValue } = this.currentPath;
|
|
2645
2645
|
if (isDefined$1(baseSnapshotValue)) {
|
|
2646
|
-
this.snapshotChanged = keys$1.length !== keys$
|
|
2646
|
+
this.snapshotChanged = keys$1.length !== keys$b(baseSnapshotValue).length;
|
|
2647
2647
|
}
|
|
2648
2648
|
}
|
|
2649
2649
|
checkIfChanged(value) {
|
|
@@ -2681,7 +2681,7 @@
|
|
|
2681
2681
|
return this.markMissing();
|
|
2682
2682
|
}
|
|
2683
2683
|
const sink = (data[propertyName] = {});
|
|
2684
|
-
const keys$1 = keys$
|
|
2684
|
+
const keys$1 = keys$b(obj);
|
|
2685
2685
|
this.checkIfObjectKeysLengthChanged(keys$1);
|
|
2686
2686
|
for (let i = 0, len = keys$1.length; i < len; i += 1) {
|
|
2687
2687
|
const key = keys$1[i];
|
|
@@ -2692,7 +2692,7 @@
|
|
|
2692
2692
|
}
|
|
2693
2693
|
readLinkMap(propertyName, selection, record, data) {
|
|
2694
2694
|
const map = record[propertyName];
|
|
2695
|
-
const keys$1 = keys$
|
|
2695
|
+
const keys$1 = keys$b(map);
|
|
2696
2696
|
const sink = {};
|
|
2697
2697
|
this.checkIfObjectKeysLengthChanged(keys$1);
|
|
2698
2698
|
for (let i = 0, len = keys$1.length; i < len; i += 1) {
|
|
@@ -2820,7 +2820,7 @@
|
|
|
2820
2820
|
return;
|
|
2821
2821
|
}
|
|
2822
2822
|
const sink = (data[propertyName] = {});
|
|
2823
|
-
const keys$1 = keys$
|
|
2823
|
+
const keys$1 = keys$b(obj);
|
|
2824
2824
|
this.checkIfObjectKeysLengthChanged(keys$1);
|
|
2825
2825
|
for (let i = 0, len = keys$1.length; i < len; i += 1) {
|
|
2826
2826
|
const key = keys$1[i];
|
|
@@ -3503,13 +3503,13 @@
|
|
|
3503
3503
|
// undefined values on the injected networkAdapter. So we do it here, on
|
|
3504
3504
|
// the API that those adapters call to dispatch their ResourceRequests.
|
|
3505
3505
|
const { queryParams, urlParams } = mergedResourceRequest;
|
|
3506
|
-
for (const paramKey of keys$
|
|
3506
|
+
for (const paramKey of keys$b(queryParams)) {
|
|
3507
3507
|
const value = queryParams[paramKey];
|
|
3508
3508
|
if (value === undefined) {
|
|
3509
3509
|
delete queryParams[paramKey];
|
|
3510
3510
|
}
|
|
3511
3511
|
}
|
|
3512
|
-
for (const paramKey of keys$
|
|
3512
|
+
for (const paramKey of keys$b(urlParams)) {
|
|
3513
3513
|
const value = urlParams[paramKey];
|
|
3514
3514
|
if (value === undefined) {
|
|
3515
3515
|
delete urlParams[paramKey];
|
|
@@ -3803,7 +3803,7 @@
|
|
|
3803
3803
|
}
|
|
3804
3804
|
callbacks.push(callback);
|
|
3805
3805
|
}
|
|
3806
|
-
// version: 1.136.
|
|
3806
|
+
// version: 1.136.7-777657471
|
|
3807
3807
|
|
|
3808
3808
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
3809
3809
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -15227,7 +15227,7 @@
|
|
|
15227
15227
|
updateReferenceMapWithKnownKey(ast, luvioDocumentNode);
|
|
15228
15228
|
return luvioDocumentNode;
|
|
15229
15229
|
}
|
|
15230
|
-
// version: 1.136.
|
|
15230
|
+
// version: 1.136.7-777657471
|
|
15231
15231
|
|
|
15232
15232
|
function unwrap(data) {
|
|
15233
15233
|
// The lwc-luvio bindings import a function from lwc called "unwrap".
|
|
@@ -16140,7 +16140,7 @@
|
|
|
16140
16140
|
const { apiFamily, name } = metadata;
|
|
16141
16141
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
16142
16142
|
}
|
|
16143
|
-
// version: 1.136.
|
|
16143
|
+
// version: 1.136.7-777657471
|
|
16144
16144
|
|
|
16145
16145
|
/**
|
|
16146
16146
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -16227,7 +16227,7 @@
|
|
|
16227
16227
|
|
|
16228
16228
|
const { keys: ObjectKeys$3, create: ObjectCreate$3 } = Object;
|
|
16229
16229
|
|
|
16230
|
-
const { assign: assign$7, create: create$8, freeze: freeze$4, keys: keys$
|
|
16230
|
+
const { assign: assign$7, create: create$8, freeze: freeze$4, keys: keys$a } = Object;
|
|
16231
16231
|
|
|
16232
16232
|
ObjectCreate$3(null);
|
|
16233
16233
|
|
|
@@ -17065,7 +17065,7 @@
|
|
|
17065
17065
|
return rootKeySet;
|
|
17066
17066
|
}
|
|
17067
17067
|
|
|
17068
|
-
const { assign: assign$6, create: create$7, freeze: freeze$3, keys: keys$
|
|
17068
|
+
const { assign: assign$6, create: create$7, freeze: freeze$3, keys: keys$9 } = Object;
|
|
17069
17069
|
const { hasOwnProperty: hasOwnProperty$1 } = Object.prototype;
|
|
17070
17070
|
const { split, endsWith } = String.prototype;
|
|
17071
17071
|
const { isArray: isArray$7 } = Array;
|
|
@@ -17083,7 +17083,7 @@
|
|
|
17083
17083
|
mergeable: true,
|
|
17084
17084
|
});
|
|
17085
17085
|
const input_childRelationships = input.childRelationships;
|
|
17086
|
-
const input_childRelationships_keys = keys$
|
|
17086
|
+
const input_childRelationships_keys = keys$9(input_childRelationships);
|
|
17087
17087
|
const input_childRelationships_length = input_childRelationships_keys.length;
|
|
17088
17088
|
for (let i = 0; i < input_childRelationships_length; i++) {
|
|
17089
17089
|
const key = input_childRelationships_keys[i];
|
|
@@ -17091,7 +17091,7 @@
|
|
|
17091
17091
|
rootKeySet.merge(cacheKeys);
|
|
17092
17092
|
}
|
|
17093
17093
|
const input_fields = input.fields;
|
|
17094
|
-
const input_fields_keys = keys$
|
|
17094
|
+
const input_fields_keys = keys$9(input_fields);
|
|
17095
17095
|
const input_fields_length = input_fields_keys.length;
|
|
17096
17096
|
for (let i = 0; i < input_fields_length; i++) {
|
|
17097
17097
|
const key = input_fields_keys[i];
|
|
@@ -17558,7 +17558,7 @@
|
|
|
17558
17558
|
for (let i = 0, len = value.length; i < len; i += 1) {
|
|
17559
17559
|
result[value[i]] = true;
|
|
17560
17560
|
}
|
|
17561
|
-
return keys$
|
|
17561
|
+
return keys$9(result);
|
|
17562
17562
|
}
|
|
17563
17563
|
/**
|
|
17564
17564
|
* @param source The array of string to filter
|
|
@@ -19006,7 +19006,7 @@
|
|
|
19006
19006
|
function createPathSelection(propertyName, fieldDefinition) {
|
|
19007
19007
|
const fieldsSelection = [];
|
|
19008
19008
|
const { children } = fieldDefinition;
|
|
19009
|
-
const childrenKeys = keys$
|
|
19009
|
+
const childrenKeys = keys$9(children);
|
|
19010
19010
|
for (let i = 0, len = childrenKeys.length; i < len; i += 1) {
|
|
19011
19011
|
const childKey = childrenKeys[i];
|
|
19012
19012
|
const childFieldDefinition = children[childKey];
|
|
@@ -19051,7 +19051,7 @@
|
|
|
19051
19051
|
*/
|
|
19052
19052
|
function createPathSelectionFromValue(fields) {
|
|
19053
19053
|
const fieldsSelection = [];
|
|
19054
|
-
const fieldNames = keys$
|
|
19054
|
+
const fieldNames = keys$9(fields);
|
|
19055
19055
|
for (let i = 0, len = fieldNames.length; i < len; i++) {
|
|
19056
19056
|
const fieldName = fieldNames[i];
|
|
19057
19057
|
const { value: fieldValue } = fields[fieldName];
|
|
@@ -19090,7 +19090,7 @@
|
|
|
19090
19090
|
}
|
|
19091
19091
|
function extractRecordFieldsRecursively(record) {
|
|
19092
19092
|
const fields = [];
|
|
19093
|
-
const fieldNames = keys$
|
|
19093
|
+
const fieldNames = keys$9(record.fields);
|
|
19094
19094
|
for (let i = 0, len = fieldNames.length; i < len; i++) {
|
|
19095
19095
|
const fieldName = fieldNames[i];
|
|
19096
19096
|
const { value: fieldValue } = record.fields[fieldName];
|
|
@@ -19278,7 +19278,7 @@
|
|
|
19278
19278
|
continue;
|
|
19279
19279
|
}
|
|
19280
19280
|
extractTrackedFieldsToTrie(spanningLink.data.__ref, spanning, next, config, spanningVisitedRecordIds, depth + 1);
|
|
19281
|
-
if (keys$
|
|
19281
|
+
if (keys$9(next.children).length > 0) {
|
|
19282
19282
|
current.children[key] = next;
|
|
19283
19283
|
}
|
|
19284
19284
|
else {
|
|
@@ -19330,13 +19330,13 @@
|
|
|
19330
19330
|
return endsWith.call(spanningNode.scalar('apiName'), CUSTOM_EXTERNAL_OBJECT_FIELD_SUFFIX);
|
|
19331
19331
|
}
|
|
19332
19332
|
function convertTrieToFields(root) {
|
|
19333
|
-
if (keys$
|
|
19333
|
+
if (keys$9(root.children).length === 0) {
|
|
19334
19334
|
return [];
|
|
19335
19335
|
}
|
|
19336
19336
|
return convertTrieToFieldsRecursively(root);
|
|
19337
19337
|
}
|
|
19338
19338
|
function convertTrieToFieldsRecursively(root) {
|
|
19339
|
-
const childKeys = keys$
|
|
19339
|
+
const childKeys = keys$9(root.children);
|
|
19340
19340
|
if (childKeys.length === 0) {
|
|
19341
19341
|
if (root.name === '') {
|
|
19342
19342
|
return [];
|
|
@@ -19373,7 +19373,7 @@
|
|
|
19373
19373
|
function mergeFieldsTries(rootA, rootB) {
|
|
19374
19374
|
const rootAchildren = rootA.children;
|
|
19375
19375
|
const rootBchildren = rootB.children;
|
|
19376
|
-
const childBKeys = keys$
|
|
19376
|
+
const childBKeys = keys$9(rootBchildren);
|
|
19377
19377
|
for (let i = 0, len = childBKeys.length; i < len; i++) {
|
|
19378
19378
|
const childBKey = childBKeys[i];
|
|
19379
19379
|
if (rootAchildren[childBKey] === undefined) {
|
|
@@ -19526,8 +19526,8 @@
|
|
|
19526
19526
|
}
|
|
19527
19527
|
const childrenA = a.children;
|
|
19528
19528
|
const childrenB = b.children;
|
|
19529
|
-
const childKeysA = keys$
|
|
19530
|
-
const childKeysB = keys$
|
|
19529
|
+
const childKeysA = keys$9(childrenA);
|
|
19530
|
+
const childKeysB = keys$9(childrenB);
|
|
19531
19531
|
const childKeysBLength = childKeysB.length;
|
|
19532
19532
|
if (childKeysBLength > childKeysA.length) {
|
|
19533
19533
|
return false;
|
|
@@ -19551,7 +19551,7 @@
|
|
|
19551
19551
|
// RecordRepresentationNormalized['fields'] to include `pending:true` property
|
|
19552
19552
|
const mergedFields = { ...newRecord.fields };
|
|
19553
19553
|
const merged = { ...newRecord, fields: mergedFields };
|
|
19554
|
-
const existingFields = keys$
|
|
19554
|
+
const existingFields = keys$9(oldRecord.fields);
|
|
19555
19555
|
for (let i = 0, len = existingFields.length; i < len; i += 1) {
|
|
19556
19556
|
const spanningFieldName = existingFields[i];
|
|
19557
19557
|
if (newRecord.fields[spanningFieldName] === undefined) {
|
|
@@ -19684,7 +19684,7 @@
|
|
|
19684
19684
|
if (isGraphNode(node)) {
|
|
19685
19685
|
const dependencies = node.retrieve();
|
|
19686
19686
|
if (dependencies !== null) {
|
|
19687
|
-
const depKeys = keys$
|
|
19687
|
+
const depKeys = keys$9(dependencies);
|
|
19688
19688
|
for (let i = 0, len = depKeys.length; i < len; i++) {
|
|
19689
19689
|
luvio.storeEvict(depKeys[i]);
|
|
19690
19690
|
}
|
|
@@ -19831,7 +19831,7 @@
|
|
|
19831
19831
|
}
|
|
19832
19832
|
for (let i = 0; i < fieldSubtries.length; i++) {
|
|
19833
19833
|
const subtrie = fieldSubtries[i];
|
|
19834
|
-
const fieldNames = keys$
|
|
19834
|
+
const fieldNames = keys$9(subtrie.children);
|
|
19835
19835
|
for (let i = 0; i < fieldNames.length; i++) {
|
|
19836
19836
|
const fieldName = fieldNames[i];
|
|
19837
19837
|
const childTrie = subtrie.children[fieldName];
|
|
@@ -19943,9 +19943,9 @@
|
|
|
19943
19943
|
return false;
|
|
19944
19944
|
}
|
|
19945
19945
|
}
|
|
19946
|
-
const headersKeys = keys$
|
|
19946
|
+
const headersKeys = keys$9(headers);
|
|
19947
19947
|
const headersKeyLength = headersKeys.length;
|
|
19948
|
-
if (headersKeyLength !== keys$
|
|
19948
|
+
if (headersKeyLength !== keys$9(existingHeaders).length) {
|
|
19949
19949
|
return false;
|
|
19950
19950
|
}
|
|
19951
19951
|
for (let i = 0, len = headersKeyLength; i < len; i++) {
|
|
@@ -20714,7 +20714,7 @@
|
|
|
20714
20714
|
|
|
20715
20715
|
// iterate through the map to build configs for network calls
|
|
20716
20716
|
function resolveConflict(luvio, map) {
|
|
20717
|
-
const ids = keys$
|
|
20717
|
+
const ids = keys$9(map.conflicts);
|
|
20718
20718
|
if (ids.length === 0) {
|
|
20719
20719
|
instrumentation$2.recordConflictsResolved(map.serverRequestCount);
|
|
20720
20720
|
return;
|
|
@@ -21894,18 +21894,18 @@
|
|
|
21894
21894
|
return {
|
|
21895
21895
|
getRecordSelectionFieldSets() {
|
|
21896
21896
|
const optionalPlusDefaultFields = { ...optionalFields_ };
|
|
21897
|
-
const fields = keys$
|
|
21897
|
+
const fields = keys$9(defaultFields_);
|
|
21898
21898
|
for (let i = 0; i < fields.length; ++i) {
|
|
21899
21899
|
const field = fields[i];
|
|
21900
21900
|
if (!fields_[field] && !defaultServerFieldStatus.missingFields[field]) {
|
|
21901
21901
|
optionalPlusDefaultFields[field] = true;
|
|
21902
21902
|
}
|
|
21903
21903
|
}
|
|
21904
|
-
return [keys$
|
|
21904
|
+
return [keys$9(fields_).sort(), keys$9(optionalPlusDefaultFields).sort()];
|
|
21905
21905
|
},
|
|
21906
21906
|
processRecords(records) {
|
|
21907
21907
|
const { missingFields } = defaultServerFieldStatus;
|
|
21908
|
-
const fields = keys$
|
|
21908
|
+
const fields = keys$9(missingFields);
|
|
21909
21909
|
for (let i = 0; i < fields.length; ++i) {
|
|
21910
21910
|
const field = fields[i], splitField = field.split('.').slice(1);
|
|
21911
21911
|
for (let i = 0; i < records.length; ++i) {
|
|
@@ -24638,7 +24638,7 @@
|
|
|
24638
24638
|
const lookupFields = {};
|
|
24639
24639
|
const { apiName, fields: recordFields } = record;
|
|
24640
24640
|
const { fields: objectInfoFields } = objectInfo;
|
|
24641
|
-
const objectInfoFieldNames = keys$
|
|
24641
|
+
const objectInfoFieldNames = keys$9(objectInfoFields);
|
|
24642
24642
|
for (let i = 0, len = objectInfoFieldNames.length; i < len; i += 1) {
|
|
24643
24643
|
const fieldName = objectInfoFieldNames[i];
|
|
24644
24644
|
const field = objectInfoFields[fieldName];
|
|
@@ -24657,12 +24657,12 @@
|
|
|
24657
24657
|
const nameField = `${apiName}.${relationshipName}.${getNameField(objectInfo, fieldName)}`;
|
|
24658
24658
|
lookupFields[nameField] = true;
|
|
24659
24659
|
}
|
|
24660
|
-
return keys$
|
|
24660
|
+
return keys$9(lookupFields);
|
|
24661
24661
|
}
|
|
24662
24662
|
function getRecordUiMissingRecordLookupFields(recordUi) {
|
|
24663
24663
|
const { records, objectInfos } = recordUi;
|
|
24664
24664
|
const recordLookupFields = {};
|
|
24665
|
-
const recordIds = keys$
|
|
24665
|
+
const recordIds = keys$9(records);
|
|
24666
24666
|
for (let i = 0, len = recordIds.length; i < len; i += 1) {
|
|
24667
24667
|
const recordId = recordIds[i];
|
|
24668
24668
|
const recordData = records[recordId];
|
|
@@ -24700,19 +24700,19 @@
|
|
|
24700
24700
|
}
|
|
24701
24701
|
function eachLayout(recordUi, cb) {
|
|
24702
24702
|
const { layouts } = recordUi;
|
|
24703
|
-
const layoutApiNames = keys$
|
|
24703
|
+
const layoutApiNames = keys$9(layouts);
|
|
24704
24704
|
for (let a = 0, len = layoutApiNames.length; a < len; a += 1) {
|
|
24705
24705
|
const apiName = layoutApiNames[a];
|
|
24706
24706
|
const apiNameData = layouts[apiName];
|
|
24707
|
-
const recordTypeIds = keys$
|
|
24707
|
+
const recordTypeIds = keys$9(apiNameData);
|
|
24708
24708
|
for (let b = 0, recordTypeIdsLen = recordTypeIds.length; b < recordTypeIdsLen; b += 1) {
|
|
24709
24709
|
const recordTypeId = recordTypeIds[b];
|
|
24710
24710
|
const recordTypeData = apiNameData[recordTypeId];
|
|
24711
|
-
const layoutTypes = keys$
|
|
24711
|
+
const layoutTypes = keys$9(recordTypeData);
|
|
24712
24712
|
for (let c = 0, layoutTypesLen = layoutTypes.length; c < layoutTypesLen; c += 1) {
|
|
24713
24713
|
const layoutType = layoutTypes[c];
|
|
24714
24714
|
const layoutTypeData = recordTypeData[layoutType];
|
|
24715
|
-
const modes = keys$
|
|
24715
|
+
const modes = keys$9(layoutTypeData);
|
|
24716
24716
|
for (let d = 0, modesLen = modes.length; d < modesLen; d += 1) {
|
|
24717
24717
|
const mode = modes[d];
|
|
24718
24718
|
const layout = layoutTypeData[mode];
|
|
@@ -25091,11 +25091,11 @@
|
|
|
25091
25091
|
];
|
|
25092
25092
|
function getFieldsFromLayoutMap(layoutMap, objectInfo) {
|
|
25093
25093
|
let fields = [];
|
|
25094
|
-
const layoutTypes = keys$
|
|
25094
|
+
const layoutTypes = keys$9(layoutMap);
|
|
25095
25095
|
for (let i = 0, layoutTypesLen = layoutTypes.length; i < layoutTypesLen; i += 1) {
|
|
25096
25096
|
const layoutType = layoutTypes[i];
|
|
25097
25097
|
const modesMap = layoutMap[layoutType];
|
|
25098
|
-
const modes = keys$
|
|
25098
|
+
const modes = keys$9(modesMap);
|
|
25099
25099
|
for (let m = 0, modesLen = modes.length; m < modesLen; m += 1) {
|
|
25100
25100
|
const mode = modes[m];
|
|
25101
25101
|
const modeKeys = getQualifiedFieldApiNamesFromLayout(modesMap[mode], objectInfo);
|
|
@@ -40023,7 +40023,7 @@
|
|
|
40023
40023
|
let clonedLayoutUserStateSections;
|
|
40024
40024
|
const { sectionUserStates } = layoutUserStateInput;
|
|
40025
40025
|
const { sectionUserStates: cachedSectionUserStates } = cachedLayoutUserState;
|
|
40026
|
-
const sectionUserStateKeys = keys$
|
|
40026
|
+
const sectionUserStateKeys = keys$9(sectionUserStates);
|
|
40027
40027
|
for (let i = 0, len = sectionUserStateKeys.length; i < len; i += 1) {
|
|
40028
40028
|
const sectionId = sectionUserStateKeys[i];
|
|
40029
40029
|
if (cachedSectionUserStates[sectionId] === undefined) {
|
|
@@ -43907,7 +43907,7 @@
|
|
|
43907
43907
|
dropFunction: instrumentation$2.notifyRecordUpdateAvailableDropped,
|
|
43908
43908
|
});
|
|
43909
43909
|
});
|
|
43910
|
-
// version: 1.136.
|
|
43910
|
+
// version: 1.136.7-ae23b4cbb
|
|
43911
43911
|
|
|
43912
43912
|
var caseSensitiveUserId = '005B0000000GR4OIAW';
|
|
43913
43913
|
|
|
@@ -43985,7 +43985,7 @@
|
|
|
43985
43985
|
const { parse: parse$5, stringify: stringify$5 } = JSON;
|
|
43986
43986
|
const { join: join$2, push: push$2, unshift } = Array.prototype;
|
|
43987
43987
|
const { isArray: isArray$5 } = Array;
|
|
43988
|
-
const { entries: entries$3, keys: keys$
|
|
43988
|
+
const { entries: entries$3, keys: keys$7 } = Object;
|
|
43989
43989
|
|
|
43990
43990
|
const UI_API_BASE_URI = '/services/data/v59.0/ui-api';
|
|
43991
43991
|
|
|
@@ -44050,7 +44050,7 @@
|
|
|
44050
44050
|
function mergeRecordFields$1(first, second) {
|
|
44051
44051
|
const { fields: targetFields } = first;
|
|
44052
44052
|
const { fields: sourceFields } = second;
|
|
44053
|
-
const fieldNames = keys$
|
|
44053
|
+
const fieldNames = keys$7(sourceFields);
|
|
44054
44054
|
for (let i = 0, len = fieldNames.length; i < len; i += 1) {
|
|
44055
44055
|
const fieldName = fieldNames[i];
|
|
44056
44056
|
const sourceField = sourceFields[fieldName];
|
|
@@ -44454,7 +44454,7 @@
|
|
|
44454
44454
|
}
|
|
44455
44455
|
const DefaultDurableSegment = 'DEFAULT';
|
|
44456
44456
|
|
|
44457
|
-
const { keys: keys$
|
|
44457
|
+
const { keys: keys$6, create: create$5, assign: assign$4, freeze: freeze$1$1 } = Object;
|
|
44458
44458
|
|
|
44459
44459
|
//Durable store error instrumentation key
|
|
44460
44460
|
const DURABLE_STORE_ERROR = 'durable-store-error';
|
|
@@ -44498,7 +44498,7 @@
|
|
|
44498
44498
|
if (durableRecords === undefined) {
|
|
44499
44499
|
return { revivedKeys, hadUnexpectedShape };
|
|
44500
44500
|
}
|
|
44501
|
-
const durableKeys = keys$
|
|
44501
|
+
const durableKeys = keys$6(durableRecords);
|
|
44502
44502
|
if (durableKeys.length === 0) {
|
|
44503
44503
|
// no records to revive
|
|
44504
44504
|
return { revivedKeys, hadUnexpectedShape };
|
|
@@ -44672,7 +44672,7 @@
|
|
|
44672
44672
|
overrides,
|
|
44673
44673
|
};
|
|
44674
44674
|
}
|
|
44675
|
-
const keys$1 = keys$
|
|
44675
|
+
const keys$1 = keys$6(entries);
|
|
44676
44676
|
for (let i = 0, len = keys$1.length; i < len; i++) {
|
|
44677
44677
|
const key = keys$1[i];
|
|
44678
44678
|
const entry = entries[key];
|
|
@@ -44700,7 +44700,7 @@
|
|
|
44700
44700
|
// TODO: W-8909393 Once metadata is stored in its own segment we need to
|
|
44701
44701
|
// call setEntries for the visitedIds on default segment and call setEntries
|
|
44702
44702
|
// on the metadata segment for the refreshedIds
|
|
44703
|
-
const keys$1 = keys$
|
|
44703
|
+
const keys$1 = keys$6({ ...visitedIds, ...refreshedIds });
|
|
44704
44704
|
for (let i = 0, len = keys$1.length; i < len; i += 1) {
|
|
44705
44705
|
const key = keys$1[i];
|
|
44706
44706
|
const record = records[key];
|
|
@@ -44722,7 +44722,7 @@
|
|
|
44722
44722
|
}
|
|
44723
44723
|
const durableStoreOperations = [];
|
|
44724
44724
|
// publishes
|
|
44725
|
-
const recordKeys = keys$
|
|
44725
|
+
const recordKeys = keys$6(durableRecords);
|
|
44726
44726
|
if (recordKeys.length > 0) {
|
|
44727
44727
|
durableStoreOperations.push({
|
|
44728
44728
|
type: 'setEntries',
|
|
@@ -44731,7 +44731,7 @@
|
|
|
44731
44731
|
});
|
|
44732
44732
|
}
|
|
44733
44733
|
// evicts
|
|
44734
|
-
const evictedKeys = keys$
|
|
44734
|
+
const evictedKeys = keys$6(evictedRecords);
|
|
44735
44735
|
if (evictedKeys.length > 0) {
|
|
44736
44736
|
durableStoreOperations.push({
|
|
44737
44737
|
type: 'evictEntries',
|
|
@@ -44885,7 +44885,7 @@
|
|
|
44885
44885
|
try {
|
|
44886
44886
|
const entries = await durableStore.getEntries(adapterContextKeysFromDifferentInstance, AdapterContextSegment);
|
|
44887
44887
|
if (entries !== undefined) {
|
|
44888
|
-
const entryKeys = keys$
|
|
44888
|
+
const entryKeys = keys$6(entries);
|
|
44889
44889
|
for (let i = 0, len = entryKeys.length; i < len; i++) {
|
|
44890
44890
|
const entryKey = entryKeys[i];
|
|
44891
44891
|
const entry = entries[entryKey];
|
|
@@ -45702,6 +45702,12 @@
|
|
|
45702
45702
|
function stringLiteral(value, safe = false, isCaseSensitive = false) {
|
|
45703
45703
|
return { type: ValueType.StringLiteral, value, safe, isCaseSensitive };
|
|
45704
45704
|
}
|
|
45705
|
+
function isStringLiteral(expression) {
|
|
45706
|
+
return expression.type === ValueType.StringLiteral;
|
|
45707
|
+
}
|
|
45708
|
+
function isStringArray(expression) {
|
|
45709
|
+
return expression.type === ValueType.StringArray;
|
|
45710
|
+
}
|
|
45705
45711
|
function comparison(left, operator, right) {
|
|
45706
45712
|
return { type: PredicateType$1.comparison, left, right, operator };
|
|
45707
45713
|
}
|
|
@@ -45961,7 +45967,7 @@
|
|
|
45961
45967
|
case ComparisonOperator.eq:
|
|
45962
45968
|
return '=';
|
|
45963
45969
|
case ComparisonOperator.ne:
|
|
45964
|
-
return '
|
|
45970
|
+
return 'IS NOT';
|
|
45965
45971
|
case ComparisonOperator.gt:
|
|
45966
45972
|
return '>';
|
|
45967
45973
|
case ComparisonOperator.gte:
|
|
@@ -46472,6 +46478,9 @@
|
|
|
46472
46478
|
}
|
|
46473
46479
|
}
|
|
46474
46480
|
|
|
46481
|
+
const { isArray: isArray$4 } = Array;
|
|
46482
|
+
const { keys: keys$5 } = Object;
|
|
46483
|
+
|
|
46475
46484
|
function isListValueNode(node) {
|
|
46476
46485
|
return node.kind === 'ListValue';
|
|
46477
46486
|
}
|
|
@@ -46524,13 +46533,13 @@
|
|
|
46524
46533
|
const NotOperator = 'not';
|
|
46525
46534
|
const { eq, ne, gt, gte, lt, lte, nin, like, includes, excludes } = ComparisonOperator;
|
|
46526
46535
|
const inOp = ComparisonOperator.in;
|
|
46527
|
-
function fieldsToFilters(fieldValues, joinAlias, apiName, input, compoundOperator = CompoundOperator.and, joins) {
|
|
46536
|
+
function fieldsToFilters(fieldValues, joinAlias, apiName, input, compoundOperator = CompoundOperator.and, joins, draftFunctions) {
|
|
46528
46537
|
const results = fieldValues
|
|
46529
46538
|
.map((value) => {
|
|
46530
46539
|
if (!isObjectValueNode$1(value)) {
|
|
46531
46540
|
return [failure([message('Parent filter node should be an object.')])];
|
|
46532
46541
|
}
|
|
46533
|
-
return Object.entries(value.fields).map(([key, value]) => filter(key, value, joinAlias, apiName, input, joins));
|
|
46542
|
+
return Object.entries(value.fields).map(([key, value]) => filter(key, value, joinAlias, apiName, input, joins, draftFunctions));
|
|
46534
46543
|
})
|
|
46535
46544
|
.reduce(flatten$1, []);
|
|
46536
46545
|
const failures = results.filter(isFailure).reduce(flatMap$1(errors), []);
|
|
@@ -46552,22 +46561,22 @@
|
|
|
46552
46561
|
return success({ predicate: resolvedPredicate });
|
|
46553
46562
|
}
|
|
46554
46563
|
//{where: {Field: ... | and: ... | or: ... | not: ...}}
|
|
46555
|
-
function recordFilter(where, joinAlias, apiName, input, joins) {
|
|
46564
|
+
function recordFilter(where, joinAlias, apiName, input, joins, draftFunctions) {
|
|
46556
46565
|
if (where === undefined) {
|
|
46557
46566
|
return success(undefined);
|
|
46558
46567
|
}
|
|
46559
46568
|
// when 'recordFilter' starts, there is no 'NotPredicated'
|
|
46560
|
-
return fieldsToFilters([where.value], joinAlias, apiName, input, CompoundOperator.and, joins).map((result) => result.predicate === undefined || isEmptyPredicate(result.predicate) ? undefined : result);
|
|
46569
|
+
return fieldsToFilters([where.value], joinAlias, apiName, input, CompoundOperator.and, joins, draftFunctions).map((result) => result.predicate === undefined || isEmptyPredicate(result.predicate) ? undefined : result);
|
|
46561
46570
|
}
|
|
46562
|
-
function filter(name, value, tableAlias, apiName, input, joins) {
|
|
46571
|
+
function filter(name, value, tableAlias, apiName, input, joins, draftFunctions) {
|
|
46563
46572
|
if (isCompoundOperator(name)) {
|
|
46564
46573
|
if (!isListValueNode(value)) {
|
|
46565
46574
|
return failure([message(`Value for ${name} node must be a list.`)]);
|
|
46566
46575
|
}
|
|
46567
|
-
return compoundPredicate(name, value, tableAlias, apiName, input, joins);
|
|
46576
|
+
return compoundPredicate(name, value, tableAlias, apiName, input, joins, draftFunctions);
|
|
46568
46577
|
}
|
|
46569
46578
|
if (name === NotOperator) {
|
|
46570
|
-
const children = fieldsToFilters([value], tableAlias, apiName, input, CompoundOperator.and, joins);
|
|
46579
|
+
const children = fieldsToFilters([value], tableAlias, apiName, input, CompoundOperator.and, joins, draftFunctions);
|
|
46571
46580
|
// take the children of a not predicate
|
|
46572
46581
|
// and wrap them all inside it
|
|
46573
46582
|
return children.flatMap((container) => {
|
|
@@ -46585,10 +46594,10 @@
|
|
|
46585
46594
|
if (!isObjectValueNode$1(value)) {
|
|
46586
46595
|
return failure([message('Filter node must be an object or list.')]);
|
|
46587
46596
|
}
|
|
46588
|
-
return fieldFilter(name, value, tableAlias, apiName, input, joins);
|
|
46597
|
+
return fieldFilter(name, value, tableAlias, apiName, input, joins, draftFunctions);
|
|
46589
46598
|
}
|
|
46590
|
-
function compoundPredicate(operator, list, joinAlias, apiName, input, joins) {
|
|
46591
|
-
return fieldsToFilters(list.values, joinAlias, apiName, input, operator, joins);
|
|
46599
|
+
function compoundPredicate(operator, list, joinAlias, apiName, input, joins, draftFunctions) {
|
|
46600
|
+
return fieldsToFilters(list.values, joinAlias, apiName, input, operator, joins, draftFunctions);
|
|
46592
46601
|
}
|
|
46593
46602
|
/**
|
|
46594
46603
|
* spans a FieldNode with its ObjectValueNode is passed. All the predicates is added into the 'join' array.
|
|
@@ -46599,7 +46608,7 @@
|
|
|
46599
46608
|
* @param joins
|
|
46600
46609
|
* @returns undefined predicate
|
|
46601
46610
|
*/
|
|
46602
|
-
function spanningFilter(fieldInfo, fieldNode, alias, input, joins) {
|
|
46611
|
+
function spanningFilter(fieldInfo, fieldNode, alias, input, joins, draftFunctions) {
|
|
46603
46612
|
const { apiName: fieldName, referenceToInfos, relationshipName } = fieldInfo;
|
|
46604
46613
|
const referenceInfo = referenceToInfos[0];
|
|
46605
46614
|
const jsonAlias = `${alias}.${relationshipName}`;
|
|
@@ -46618,7 +46627,7 @@
|
|
|
46618
46627
|
joins.push(join);
|
|
46619
46628
|
// moves constraint predicate to where
|
|
46620
46629
|
const constraintPredicates = [];
|
|
46621
|
-
const filterResult = fieldsToFilters([fieldNode], jsonAlias, apiName, input, CompoundOperator.and, joins);
|
|
46630
|
+
const filterResult = fieldsToFilters([fieldNode], jsonAlias, apiName, input, CompoundOperator.and, joins, draftFunctions);
|
|
46622
46631
|
if (filterResult.isSuccess === false) {
|
|
46623
46632
|
return filterResult;
|
|
46624
46633
|
}
|
|
@@ -46630,7 +46639,11 @@
|
|
|
46630
46639
|
});
|
|
46631
46640
|
return success({ predicate: combinePredicates(constraintPredicates, CompoundOperator.and) });
|
|
46632
46641
|
}
|
|
46633
|
-
function
|
|
46642
|
+
function isIDValueField$1(fieldInfo) {
|
|
46643
|
+
return (fieldInfo.apiName === 'Id' ||
|
|
46644
|
+
(fieldInfo.referenceToInfos !== undefined && fieldInfo.referenceToInfos.length > 0));
|
|
46645
|
+
}
|
|
46646
|
+
function fieldFilter(fieldName, fieldNode, alias, apiName, input, joins, draftFunctions) {
|
|
46634
46647
|
const fieldInfoResult = getFieldInfo(apiName, fieldName, input);
|
|
46635
46648
|
if (fieldInfoResult.isSuccess === false) {
|
|
46636
46649
|
return failure([fieldInfoResult.error]);
|
|
@@ -46640,8 +46653,9 @@
|
|
|
46640
46653
|
return failure([message(`Field ${fieldName} for type ${apiName} not found.`)]);
|
|
46641
46654
|
}
|
|
46642
46655
|
if (fieldInfo.dataType === 'Reference' && fieldInfo.relationshipName === fieldName) {
|
|
46643
|
-
return spanningFilter(fieldInfo, fieldNode, alias, input, joins);
|
|
46656
|
+
return spanningFilter(fieldInfo, fieldNode, alias, input, joins, draftFunctions);
|
|
46644
46657
|
}
|
|
46658
|
+
const idProcessingNeeded = isIDValueField$1(fieldInfo);
|
|
46645
46659
|
const extract = {
|
|
46646
46660
|
type: ValueType.Extract,
|
|
46647
46661
|
jsonAlias: alias,
|
|
@@ -46732,7 +46746,29 @@
|
|
|
46732
46746
|
children,
|
|
46733
46747
|
};
|
|
46734
46748
|
}
|
|
46735
|
-
|
|
46749
|
+
const rightOperand = op.value;
|
|
46750
|
+
if (idProcessingNeeded) {
|
|
46751
|
+
if (isStringLiteral(rightOperand)) {
|
|
46752
|
+
if (rightOperand.value !== null) {
|
|
46753
|
+
if (draftFunctions.isDraftId(rightOperand.value)) {
|
|
46754
|
+
rightOperand.value = draftFunctions.getCanonicalId(rightOperand.value);
|
|
46755
|
+
}
|
|
46756
|
+
}
|
|
46757
|
+
}
|
|
46758
|
+
else if (isStringArray(rightOperand)) {
|
|
46759
|
+
if (rightOperand.value !== null) {
|
|
46760
|
+
rightOperand.value = rightOperand.value.map((originalId) => {
|
|
46761
|
+
if (originalId !== null) {
|
|
46762
|
+
if (draftFunctions.isDraftId(originalId)) {
|
|
46763
|
+
return draftFunctions.getCanonicalId(originalId);
|
|
46764
|
+
}
|
|
46765
|
+
}
|
|
46766
|
+
return originalId;
|
|
46767
|
+
});
|
|
46768
|
+
}
|
|
46769
|
+
}
|
|
46770
|
+
}
|
|
46771
|
+
return comparison(extract, op.operator, rightOperand);
|
|
46736
46772
|
});
|
|
46737
46773
|
const combined = combinePredicates(comparisons.concat(...dateFunction.value), CompoundOperator.and);
|
|
46738
46774
|
const container = {
|
|
@@ -47834,7 +47870,7 @@
|
|
|
47834
47870
|
const orderByJoins = [];
|
|
47835
47871
|
const orderByResult = parseOrderBy(orderByArg, alias, apiName, input.objectInfoMap, orderByJoins);
|
|
47836
47872
|
const filterJoins = [];
|
|
47837
|
-
const whereResult = recordFilter(whereArg, alias, apiName, input.objectInfoMap, filterJoins);
|
|
47873
|
+
const whereResult = recordFilter(whereArg, alias, apiName, input.objectInfoMap, filterJoins, input.draftFunctions);
|
|
47838
47874
|
const scopeJoins = [];
|
|
47839
47875
|
const scopeResult = scopeFilter(scopeArg, alias, apiName, input, scopeJoins);
|
|
47840
47876
|
let additionalPredicates = [];
|
|
@@ -47996,27 +48032,19 @@
|
|
|
47996
48032
|
? node.arguments
|
|
47997
48033
|
.map((args) => {
|
|
47998
48034
|
const { value, name } = args;
|
|
48035
|
+
//The variable is on the top level, for example `where: ${filter}`
|
|
47999
48036
|
if (is(value, 'Variable')) {
|
|
48000
|
-
|
|
48001
|
-
|
|
48002
|
-
|
|
48003
|
-
|
|
48004
|
-
return `${name}: ${transform(query)}`;
|
|
48005
|
-
};
|
|
48006
|
-
switch (name) {
|
|
48007
|
-
case 'scope':
|
|
48008
|
-
case 'orderBy':
|
|
48009
|
-
return buildRecordQueryString(name, jsonString, removeAllQuotations);
|
|
48010
|
-
default:
|
|
48011
|
-
return buildRecordQueryString(name, jsonString, removeQuotationsFromKeys);
|
|
48012
|
-
}
|
|
48013
|
-
}
|
|
48014
|
-
return '';
|
|
48037
|
+
return generateVariableNodeQuery(value, name, name, variables);
|
|
48038
|
+
}
|
|
48039
|
+
else if (isObjectValueNode$1(value)) {
|
|
48040
|
+
return generateVariableSubQuery(value, name, name, variables);
|
|
48015
48041
|
}
|
|
48016
48042
|
})
|
|
48017
48043
|
.filter(Boolean)
|
|
48018
48044
|
: undefined;
|
|
48019
|
-
return gqlArguments
|
|
48045
|
+
return gqlArguments
|
|
48046
|
+
? `${node.name} ${gqlArguments.length > 0 ? '(' + gqlArguments.join(',') + ')' : ''} { Id }`
|
|
48047
|
+
: '';
|
|
48020
48048
|
})
|
|
48021
48049
|
//remove empty strings
|
|
48022
48050
|
.filter(Boolean)
|
|
@@ -48026,6 +48054,51 @@
|
|
|
48026
48054
|
return [accu.slice(0, 1), query, accu.slice(1, length)].join('');
|
|
48027
48055
|
}, '{ }'));
|
|
48028
48056
|
}
|
|
48057
|
+
/**
|
|
48058
|
+
* Given a LuvioValueNode, generates a sql with its variable node replaced with actual value.
|
|
48059
|
+
* @param valueNode G
|
|
48060
|
+
* @param name
|
|
48061
|
+
* @param type
|
|
48062
|
+
* @param variables
|
|
48063
|
+
* @returns
|
|
48064
|
+
*/
|
|
48065
|
+
function generateVariableSubQuery(valueNode, name, type, variables) {
|
|
48066
|
+
switch (valueNode.kind) {
|
|
48067
|
+
case Kind.OBJECT: {
|
|
48068
|
+
// For example, `{ Id: { eq: $draftId } }` is a `ObjectValueNode`, which has field keys 'Id'
|
|
48069
|
+
const resultQuery = keys$5(valueNode.fields)
|
|
48070
|
+
.map((key) => generateVariableSubQuery(valueNode.fields[key], key, type, variables))
|
|
48071
|
+
.filter((subquery) => subquery.length > 0)
|
|
48072
|
+
.join(',');
|
|
48073
|
+
if (resultQuery.length > 0) {
|
|
48074
|
+
return `${name}: {${resultQuery}}`;
|
|
48075
|
+
}
|
|
48076
|
+
return resultQuery;
|
|
48077
|
+
}
|
|
48078
|
+
case Kind.VARIABLE:
|
|
48079
|
+
return generateVariableNodeQuery(valueNode, name, type, variables);
|
|
48080
|
+
default:
|
|
48081
|
+
return '';
|
|
48082
|
+
}
|
|
48083
|
+
}
|
|
48084
|
+
// Generate a sql for the variable node with its actual value.
|
|
48085
|
+
function generateVariableNodeQuery(value, name, type, variables) {
|
|
48086
|
+
const variable = variables[value.name];
|
|
48087
|
+
if (variable) {
|
|
48088
|
+
const jsonString = JSON.stringify(variable);
|
|
48089
|
+
const buildRecordQueryString = (name, query, transform) => {
|
|
48090
|
+
return `${name}: ${transform(query)}`;
|
|
48091
|
+
};
|
|
48092
|
+
switch (type) {
|
|
48093
|
+
case 'scope':
|
|
48094
|
+
case 'orderBy':
|
|
48095
|
+
return buildRecordQueryString(name, jsonString, removeAllQuotations);
|
|
48096
|
+
default:
|
|
48097
|
+
return buildRecordQueryString(name, jsonString, removeQuotationsFromKeys);
|
|
48098
|
+
}
|
|
48099
|
+
}
|
|
48100
|
+
return '';
|
|
48101
|
+
}
|
|
48029
48102
|
/**
|
|
48030
48103
|
* Given an AST with variables
|
|
48031
48104
|
* Swap out the LuvioArgumentNodes on the original AST with ones generated from its variables.
|
|
@@ -48044,14 +48117,43 @@
|
|
|
48044
48117
|
const { name } = node;
|
|
48045
48118
|
const first = allArgumentRecords.find((n) => n.name === name);
|
|
48046
48119
|
if (first) {
|
|
48047
|
-
|
|
48048
|
-
first.arguments =
|
|
48049
|
-
? first.arguments.filter((x) => x.value.kind !== 'Variable')
|
|
48050
|
-
: [], node.arguments ? node.arguments : []);
|
|
48120
|
+
const swappedArgments = swapArgumentWithVariableNodes(node.arguments, first.arguments);
|
|
48121
|
+
first.arguments = swappedArgments ? swappedArgments : [];
|
|
48051
48122
|
}
|
|
48052
48123
|
});
|
|
48053
48124
|
}
|
|
48054
48125
|
}
|
|
48126
|
+
// Replaces the variable node in original LuvioArgumentNode with the actual value in the swapped node with the same path.
|
|
48127
|
+
function swapArgumentWithVariableNodes(swapped, original) {
|
|
48128
|
+
if (swapped === undefined || original === undefined) {
|
|
48129
|
+
return original;
|
|
48130
|
+
}
|
|
48131
|
+
return original.map((x) => {
|
|
48132
|
+
const targetNode = swapped.find((y) => y.name === x.name);
|
|
48133
|
+
if (targetNode === undefined) {
|
|
48134
|
+
return x;
|
|
48135
|
+
}
|
|
48136
|
+
if (x.value.kind === 'Variable') {
|
|
48137
|
+
return targetNode;
|
|
48138
|
+
}
|
|
48139
|
+
swapValueNodeWithVariableNodes(x.value, targetNode.value);
|
|
48140
|
+
return x;
|
|
48141
|
+
});
|
|
48142
|
+
}
|
|
48143
|
+
function swapValueNodeWithVariableNodes(original, swapped) {
|
|
48144
|
+
if (original.kind === Kind.OBJECT) {
|
|
48145
|
+
for (const key of keys$5(original.fields)) {
|
|
48146
|
+
if (isObjectValueNode$1(swapped) && swapped.fields[key]) {
|
|
48147
|
+
if (is(original.fields[key], 'Variable')) {
|
|
48148
|
+
original.fields[key] = swapped.fields[key];
|
|
48149
|
+
}
|
|
48150
|
+
else {
|
|
48151
|
+
swapValueNodeWithVariableNodes(original.fields[key], swapped.fields[key]);
|
|
48152
|
+
}
|
|
48153
|
+
}
|
|
48154
|
+
}
|
|
48155
|
+
}
|
|
48156
|
+
}
|
|
48055
48157
|
//find top level record queries
|
|
48056
48158
|
function findRecordSelections$1(document) {
|
|
48057
48159
|
return document.definitions
|
|
@@ -48086,7 +48188,7 @@
|
|
|
48086
48188
|
* Missing object info records triggers the objectInfoService (same instance shared with Drafts code), to
|
|
48087
48189
|
* use the getObjectInfos adapter to efficiently fetch the necessary records.
|
|
48088
48190
|
*/
|
|
48089
|
-
async createRootQuery(config, objectInfoService, userId) {
|
|
48191
|
+
async createRootQuery(config, objectInfoService, userId, draftFunctions) {
|
|
48090
48192
|
const { query: ast, variables } = config;
|
|
48091
48193
|
swapVariableArguments(ast, variables);
|
|
48092
48194
|
// Parse out top-level record queries types we know we will need, since spanning fields will
|
|
@@ -48133,6 +48235,7 @@
|
|
|
48133
48235
|
astTransformResult = transform(ast, {
|
|
48134
48236
|
userId,
|
|
48135
48237
|
objectInfoMap,
|
|
48238
|
+
draftFunctions,
|
|
48136
48239
|
});
|
|
48137
48240
|
if (astTransformResult.isSuccess === false) {
|
|
48138
48241
|
for (const error of astTransformResult.error) {
|
|
@@ -48170,8 +48273,6 @@
|
|
|
48170
48273
|
}
|
|
48171
48274
|
}
|
|
48172
48275
|
|
|
48173
|
-
const { isArray: isArray$4 } = Array;
|
|
48174
|
-
|
|
48175
48276
|
/**
|
|
48176
48277
|
* Checks a GraphQL-shaped network response for errors, returning true if it does
|
|
48177
48278
|
* and false otherwise
|
|
@@ -48217,7 +48318,7 @@
|
|
|
48217
48318
|
return snapshot;
|
|
48218
48319
|
};
|
|
48219
48320
|
};
|
|
48220
|
-
function sqliteStoreEvalFactory(userId, sqliteStore, objectInfoService) {
|
|
48321
|
+
function sqliteStoreEvalFactory(userId, sqliteStore, objectInfoService, draftFunctions) {
|
|
48221
48322
|
// if the store does not support eval then use the noop version
|
|
48222
48323
|
if (sqliteStore.isEvalSupported() === false) {
|
|
48223
48324
|
return noopStoreEval;
|
|
@@ -48225,7 +48326,7 @@
|
|
|
48225
48326
|
const preconditioner = new StoreEvalPreconditioner();
|
|
48226
48327
|
return makeStoreEval(preconditioner, objectInfoService, userId, async () => {
|
|
48227
48328
|
return undefined;
|
|
48228
|
-
}, (query, _context, eventEmitter) => evaluateSqlite(query, eventEmitter, sqliteStore));
|
|
48329
|
+
}, (query, _context, eventEmitter) => evaluateSqlite(query, eventEmitter, sqliteStore), draftFunctions);
|
|
48229
48330
|
}
|
|
48230
48331
|
async function noopStoreEval(_config, nonEvaluatedSnapshotOrPromise, _observers) {
|
|
48231
48332
|
return nonEvaluatedSnapshotOrPromise;
|
|
@@ -48244,7 +48345,7 @@
|
|
|
48244
48345
|
function generateUniqueRecordId$1() {
|
|
48245
48346
|
return `${GRAPHQL_ROOT_KEY$1}${Date.now() + Math.random().toFixed(5).split('.')[1]}`;
|
|
48246
48347
|
}
|
|
48247
|
-
function makeStoreEval(preconditioner, objectInfoService, userId, contextProvider, queryEvaluator) {
|
|
48348
|
+
function makeStoreEval(preconditioner, objectInfoService, userId, contextProvider, queryEvaluator, draftFunctions) {
|
|
48248
48349
|
const storeEval = async (config, nonEvaluatedSnapshotOrPromise, observers) => {
|
|
48249
48350
|
const eventEmitter = createCustomAdapterEventEmitter(GRAPHQL_EVAL_NAMESPACE$1, observers);
|
|
48250
48351
|
// the non-eval'ed input could either be a snapshot or promise of one so
|
|
@@ -48274,7 +48375,7 @@
|
|
|
48274
48375
|
context = await contextProvider();
|
|
48275
48376
|
// Ensures ObjectInfo metadata is available for the request. Sourcing records from L1/L2/Network
|
|
48276
48377
|
// is delegated to the getObjectInfo adapter via objectInfoService
|
|
48277
|
-
rootQuery = await preconditioner.createRootQuery(config, objectInfoService, userId);
|
|
48378
|
+
rootQuery = await preconditioner.createRootQuery(config, objectInfoService, userId, draftFunctions);
|
|
48278
48379
|
}
|
|
48279
48380
|
catch (error) {
|
|
48280
48381
|
eventEmitter({
|
|
@@ -55860,6 +55961,19 @@
|
|
|
55860
55961
|
});
|
|
55861
55962
|
}
|
|
55862
55963
|
|
|
55964
|
+
/**
|
|
55965
|
+
* This function takes an unknown error and normalizes it to an Error object
|
|
55966
|
+
*/
|
|
55967
|
+
function normalizeError$1(error) {
|
|
55968
|
+
if (typeof error === 'object' && error instanceof Error) {
|
|
55969
|
+
return error;
|
|
55970
|
+
}
|
|
55971
|
+
else if (typeof error === 'string') {
|
|
55972
|
+
return new Error(error);
|
|
55973
|
+
}
|
|
55974
|
+
return new Error(stringify$2(error));
|
|
55975
|
+
}
|
|
55976
|
+
|
|
55863
55977
|
const PERFORM_QUICK_ACTION_ENDPOINT_REGEX = /^\/ui-api\/actions\/perform-quick-action\/.*$/;
|
|
55864
55978
|
/**
|
|
55865
55979
|
* Checks if a provided resource request is a POST operation on the record
|
|
@@ -55878,7 +55992,7 @@
|
|
|
55878
55992
|
return env.dispatchResourceRequest(request, context, eventObservers);
|
|
55879
55993
|
}
|
|
55880
55994
|
const { data } = await handler.enqueue(request).catch((err) => {
|
|
55881
|
-
throw createDraftSynthesisErrorResponse(err.message);
|
|
55995
|
+
throw createDraftSynthesisErrorResponse(normalizeError$1(err).message);
|
|
55882
55996
|
});
|
|
55883
55997
|
if (data === undefined) {
|
|
55884
55998
|
return Promise.reject(createDraftSynthesisErrorResponse());
|
|
@@ -56215,7 +56329,7 @@
|
|
|
56215
56329
|
return `UiApi::GraphQLRepresentation:${Date.now() + Math.random().toFixed(5).split('.')[1]}`;
|
|
56216
56330
|
}
|
|
56217
56331
|
// Recursively replace draft ids with canonical ids
|
|
56218
|
-
const replaceDraftIdsInVariables = (variables, draftFunctions, unmappedDraftIDs) => {
|
|
56332
|
+
const replaceDraftIdsInVariables$1 = (variables, draftFunctions, unmappedDraftIDs) => {
|
|
56219
56333
|
const replace = (object) => {
|
|
56220
56334
|
if (typeof object === 'string') {
|
|
56221
56335
|
if (!draftFunctions.isDraftId(object)) {
|
|
@@ -56272,7 +56386,7 @@
|
|
|
56272
56386
|
unmappedDraftIDs,
|
|
56273
56387
|
} = await injectSyntheticFields(copy, objectInfoService, draftFunctions, config.variables));
|
|
56274
56388
|
if (config.variables) {
|
|
56275
|
-
config.variables = replaceDraftIdsInVariables(config.variables, draftFunctions, unmappedDraftIDs);
|
|
56389
|
+
config.variables = replaceDraftIdsInVariables$1(config.variables, draftFunctions, unmappedDraftIDs);
|
|
56276
56390
|
}
|
|
56277
56391
|
}
|
|
56278
56392
|
catch (throwable) {
|
|
@@ -57858,7 +57972,7 @@
|
|
|
57858
57972
|
}, networkAdapter);
|
|
57859
57973
|
}
|
|
57860
57974
|
|
|
57861
|
-
const { keys: keys$
|
|
57975
|
+
const { keys: keys$8, create: create$6, assign: assign$5, entries } = Object;
|
|
57862
57976
|
const { stringify: stringify$6, parse: parse$6 } = JSON;
|
|
57863
57977
|
const { push, join, slice } = Array.prototype;
|
|
57864
57978
|
|
|
@@ -57874,15 +57988,15 @@
|
|
|
57874
57988
|
enqueue(handlerId, data) {
|
|
57875
57989
|
const callProxyMethod = __nimbus.plugins.LdsDraftQueue.callProxyMethod;
|
|
57876
57990
|
if (callProxyMethod === undefined) {
|
|
57877
|
-
return Promise.reject('callProxyMethod not defined on the nimbus plugin');
|
|
57991
|
+
return Promise.reject(new Error('callProxyMethod not defined on the nimbus plugin'));
|
|
57878
57992
|
}
|
|
57879
57993
|
const serializedAction = stringify$6([handlerId, data]);
|
|
57880
57994
|
return new Promise((resolve, reject) => {
|
|
57881
57995
|
callProxyMethod('enqueue', serializedAction, (serializedActionResponse) => {
|
|
57882
57996
|
const response = parse$6(serializedActionResponse);
|
|
57883
57997
|
resolve(response);
|
|
57884
|
-
}, (
|
|
57885
|
-
reject(
|
|
57998
|
+
}, (errorMessage) => {
|
|
57999
|
+
reject(new Error(errorMessage));
|
|
57886
58000
|
});
|
|
57887
58001
|
});
|
|
57888
58002
|
}
|
|
@@ -57892,18 +58006,18 @@
|
|
|
57892
58006
|
return Promise.resolve;
|
|
57893
58007
|
}
|
|
57894
58008
|
processNextAction() {
|
|
57895
|
-
return Promise.reject('Cannot call processNextAction from the NimbusDraftQueue');
|
|
58009
|
+
return Promise.reject(new Error('Cannot call processNextAction from the NimbusDraftQueue'));
|
|
57896
58010
|
}
|
|
57897
58011
|
getQueueActions() {
|
|
57898
58012
|
const callProxyMethod = __nimbus.plugins.LdsDraftQueue.callProxyMethod;
|
|
57899
58013
|
if (callProxyMethod === undefined) {
|
|
57900
|
-
return Promise.reject('callProxyMethod not defined on the nimbus plugin');
|
|
58014
|
+
return Promise.reject(new Error('callProxyMethod not defined on the nimbus plugin'));
|
|
57901
58015
|
}
|
|
57902
58016
|
return new Promise((resolve, reject) => {
|
|
57903
58017
|
callProxyMethod('getQueueActions', stringify$6([]), (serializedQueue) => {
|
|
57904
58018
|
resolve(parse$6(serializedQueue));
|
|
57905
|
-
}, (
|
|
57906
|
-
reject(
|
|
58019
|
+
}, (errorMessage) => {
|
|
58020
|
+
reject(new Error(errorMessage));
|
|
57907
58021
|
});
|
|
57908
58022
|
});
|
|
57909
58023
|
}
|
|
@@ -57931,32 +58045,32 @@
|
|
|
57931
58045
|
throw new Error('Cannot call getQueueState from the NimbusDraftQueue');
|
|
57932
58046
|
}
|
|
57933
58047
|
removeDraftAction(_actionId) {
|
|
57934
|
-
return Promise.reject('Cannot call removeDraftAction from the NimbusDraftQueue');
|
|
58048
|
+
return Promise.reject(new Error('Cannot call removeDraftAction from the NimbusDraftQueue'));
|
|
57935
58049
|
}
|
|
57936
58050
|
startQueue() {
|
|
57937
|
-
return Promise.reject('Cannot call startQueue from the NimbusDraftQueue');
|
|
58051
|
+
return Promise.reject(new Error('Cannot call startQueue from the NimbusDraftQueue'));
|
|
57938
58052
|
}
|
|
57939
58053
|
stopQueue() {
|
|
57940
|
-
return Promise.reject('Cannot call stopQueue from the NimbusDraftQueue');
|
|
58054
|
+
return Promise.reject(new Error('Cannot call stopQueue from the NimbusDraftQueue'));
|
|
57941
58055
|
}
|
|
57942
58056
|
replaceAction(_actionId, _withActionId) {
|
|
57943
|
-
return Promise.reject('Cannot call replaceAction from the NimbusDraftQueue');
|
|
58057
|
+
return Promise.reject(new Error('Cannot call replaceAction from the NimbusDraftQueue'));
|
|
57944
58058
|
}
|
|
57945
58059
|
mergeActions(_targetActionId, _sourceActionId) {
|
|
57946
|
-
return Promise.reject('Cannot call mergeActions from the NimbusDraftQueue');
|
|
58060
|
+
return Promise.reject(new Error('Cannot call mergeActions from the NimbusDraftQueue'));
|
|
57947
58061
|
}
|
|
57948
58062
|
setMetadata(_actionId, _metadata) {
|
|
57949
|
-
return Promise.reject('Cannot call setMetadata from the NimbusDraftQueue');
|
|
58063
|
+
return Promise.reject(new Error('Cannot call setMetadata from the NimbusDraftQueue'));
|
|
57950
58064
|
}
|
|
57951
58065
|
addHandler(_handler) {
|
|
57952
58066
|
// no-op -- all registration occurs against concrete draft queue
|
|
57953
58067
|
return Promise.resolve();
|
|
57954
58068
|
}
|
|
57955
58069
|
addCustomHandler(_id, _executor) {
|
|
57956
|
-
return Promise.reject('Cannot call setMetadata from the NimbusDraftQueue');
|
|
58070
|
+
return Promise.reject(new Error('Cannot call setMetadata from the NimbusDraftQueue'));
|
|
57957
58071
|
}
|
|
57958
58072
|
removeHandler(_id) {
|
|
57959
|
-
return Promise.reject('Cannot call setMetadata from the NimbusDraftQueue');
|
|
58073
|
+
return Promise.reject(new Error('Cannot call setMetadata from the NimbusDraftQueue'));
|
|
57960
58074
|
}
|
|
57961
58075
|
}
|
|
57962
58076
|
|
|
@@ -57979,7 +58093,7 @@
|
|
|
57979
58093
|
* @param err Unknown object to sanitize
|
|
57980
58094
|
* @returns an instance of error
|
|
57981
58095
|
*/
|
|
57982
|
-
function normalizeError$
|
|
58096
|
+
function normalizeError$2(err) {
|
|
57983
58097
|
if (err instanceof Error) {
|
|
57984
58098
|
return err;
|
|
57985
58099
|
}
|
|
@@ -57991,13 +58105,13 @@
|
|
|
57991
58105
|
const DRAFT_QUEUE_TOTAL_MERGE_ACTIONS_CALLS = 'draft-queue-total-mergeActions-calls';
|
|
57992
58106
|
const DRAFT_AWARE_CREATE_CONTENT_DOCUMENT_AND_VERSION_ERROR = 'draft-aware-create-content-document-and-version-error';
|
|
57993
58107
|
function reportGraphqlQueryParseError(err) {
|
|
57994
|
-
normalizeError$
|
|
58108
|
+
normalizeError$2(err);
|
|
57995
58109
|
}
|
|
57996
58110
|
function reportGraphqlSqlEvalPreconditionError(err) {
|
|
57997
|
-
normalizeError$
|
|
58111
|
+
normalizeError$2(err);
|
|
57998
58112
|
}
|
|
57999
58113
|
function reportGraphqlCreateSnapshotError(err) {
|
|
58000
|
-
normalizeError$
|
|
58114
|
+
normalizeError$2(err);
|
|
58001
58115
|
}
|
|
58002
58116
|
function reportGraphQlEvalDbReadDuration(duration) {
|
|
58003
58117
|
}
|
|
@@ -58007,7 +58121,7 @@
|
|
|
58007
58121
|
error = err.body;
|
|
58008
58122
|
}
|
|
58009
58123
|
else {
|
|
58010
|
-
error = normalizeError$
|
|
58124
|
+
error = normalizeError$2(err);
|
|
58011
58125
|
}
|
|
58012
58126
|
const errorCode = DRAFT_AWARE_CREATE_CONTENT_DOCUMENT_AND_VERSION_ERROR;
|
|
58013
58127
|
const errorType = error.errorType;
|
|
@@ -58036,7 +58150,7 @@
|
|
|
58036
58150
|
const { tags, metricName, logError } = config;
|
|
58037
58151
|
return operation()
|
|
58038
58152
|
.catch((err) => {
|
|
58039
|
-
const error = normalizeError$
|
|
58153
|
+
const error = normalizeError$2(err);
|
|
58040
58154
|
tags['errorMessage'] = error.message;
|
|
58041
58155
|
throw err;
|
|
58042
58156
|
})
|
|
@@ -58418,7 +58532,7 @@
|
|
|
58418
58532
|
},
|
|
58419
58533
|
conflictColumns: this.conflictColumnNames,
|
|
58420
58534
|
columns: this.columnNames,
|
|
58421
|
-
rows: keys$
|
|
58535
|
+
rows: keys$8(entries).reduce((rows, key) => {
|
|
58422
58536
|
const entry = entries[key];
|
|
58423
58537
|
const { data, metadata } = entry;
|
|
58424
58538
|
const row = [key, stringify$6(data), metadata ? stringify$6(metadata) : null];
|
|
@@ -58479,7 +58593,7 @@
|
|
|
58479
58593
|
},
|
|
58480
58594
|
conflictColumns: this.conflictColumnNames,
|
|
58481
58595
|
columns: this.columnNames,
|
|
58482
|
-
rows: keys$
|
|
58596
|
+
rows: keys$8(entries).reduce((rows, key) => {
|
|
58483
58597
|
const entry = entries[key];
|
|
58484
58598
|
rows.push([key, stringify$6(entry.data)]);
|
|
58485
58599
|
return rows;
|
|
@@ -58564,7 +58678,7 @@
|
|
|
58564
58678
|
},
|
|
58565
58679
|
conflictColumns: this.conflictColumnNames,
|
|
58566
58680
|
columns: this.columnNames,
|
|
58567
|
-
rows: keys$
|
|
58681
|
+
rows: keys$8(entries).reduce((rows, key) => {
|
|
58568
58682
|
const entry = entries[key];
|
|
58569
58683
|
const { data, metadata } = entry;
|
|
58570
58684
|
const row = [key, stringify$6(data)];
|
|
@@ -59428,11 +59542,6 @@
|
|
|
59428
59542
|
getIngestMetadataForInternalAdapters =
|
|
59429
59543
|
internalAdapterDurableEnvironment.getIngestStagingStoreRecords;
|
|
59430
59544
|
lazyObjectInfoService = new ObjectInfoService(getObjectInfo, getObjectInfos, internalAdapterDurableStore);
|
|
59431
|
-
// set storeEval function for lds-adapters-graghql to use
|
|
59432
|
-
withRegistration('@salesforce/lds-adapters-graphql', (registration) => {
|
|
59433
|
-
const { configuration: { setStoreEval }, } = registration;
|
|
59434
|
-
setStoreEval(sqliteStoreEvalFactory(userId, lazyBaseDurableStore, lazyObjectInfoService));
|
|
59435
|
-
});
|
|
59436
59545
|
// creates a durable store that denormalizes scalar fields for records
|
|
59437
59546
|
let getIngestRecords;
|
|
59438
59547
|
let getIngestMetadata;
|
|
@@ -59471,6 +59580,20 @@
|
|
|
59471
59580
|
setupMobileInstrumentation();
|
|
59472
59581
|
// If the inspection nimbus plugin is configured, inspection is enabled otherwise this is a no-op
|
|
59473
59582
|
setupInspection(lazyLuvio);
|
|
59583
|
+
// set storeEval function for lds-adapters-graghql to use
|
|
59584
|
+
withRegistration('@salesforce/lds-adapters-graphql', (registration) => {
|
|
59585
|
+
const { configuration: { setStoreEval, setDraftFunctions }, } = registration;
|
|
59586
|
+
const getCanonicalId = (id) => {
|
|
59587
|
+
var _a;
|
|
59588
|
+
return ((_a = extractRecordIdFromStoreKey(lazyLuvio.storeGetCanonicalKey(RECORD_ID_PREFIX + id))) !== null && _a !== void 0 ? _a : id);
|
|
59589
|
+
};
|
|
59590
|
+
const draftFuncs = {
|
|
59591
|
+
isDraftId: isGenerated,
|
|
59592
|
+
getCanonicalId,
|
|
59593
|
+
};
|
|
59594
|
+
setStoreEval(sqliteStoreEvalFactory(userId, lazyBaseDurableStore, lazyObjectInfoService, draftFuncs));
|
|
59595
|
+
setDraftFunctions(draftFuncs);
|
|
59596
|
+
});
|
|
59474
59597
|
// on core the graphql configuration is split so we need to set configureUIAPIGraphQL both in the
|
|
59475
59598
|
// graphql registration and the uiapi for off core
|
|
59476
59599
|
const configureUIAPIGraphQL = (registration) => {
|
|
@@ -59520,7 +59643,7 @@
|
|
|
59520
59643
|
id: '@salesforce/lds-network-adapter',
|
|
59521
59644
|
instrument: instrument$1,
|
|
59522
59645
|
});
|
|
59523
|
-
// version: 1.136.
|
|
59646
|
+
// version: 1.136.7-777657471
|
|
59524
59647
|
|
|
59525
59648
|
const { create: create$2, keys: keys$2 } = Object;
|
|
59526
59649
|
const { stringify: stringify$1, parse: parse$1 } = JSON;
|
|
@@ -73954,7 +74077,7 @@
|
|
|
73954
74077
|
configuration: { ...configurationForGraphQLAdapters },
|
|
73955
74078
|
instrument,
|
|
73956
74079
|
});
|
|
73957
|
-
// version: 1.136.
|
|
74080
|
+
// version: 1.136.7-ae23b4cbb
|
|
73958
74081
|
|
|
73959
74082
|
// On core the unstable adapters are re-exported with different names,
|
|
73960
74083
|
|
|
@@ -75326,10 +75449,14 @@
|
|
|
75326
75449
|
}
|
|
75327
75450
|
|
|
75328
75451
|
let storeEval = undefined;
|
|
75452
|
+
let draftFunctions = undefined;
|
|
75329
75453
|
const configuration = {
|
|
75330
75454
|
setStoreEval: function (storeEvalArg) {
|
|
75331
75455
|
storeEval = storeEvalArg;
|
|
75332
75456
|
},
|
|
75457
|
+
setDraftFunctions: function (draftFuncs) {
|
|
75458
|
+
draftFunctions = draftFuncs;
|
|
75459
|
+
},
|
|
75333
75460
|
};
|
|
75334
75461
|
|
|
75335
75462
|
const assignedToMe = {
|
|
@@ -75415,6 +75542,78 @@
|
|
|
75415
75542
|
function injectFieldsGQL(ast) {
|
|
75416
75543
|
return injectScopeFields(ast);
|
|
75417
75544
|
}
|
|
75545
|
+
function swapIdsOfDocumentNode(documentnode, draftFunctions) {
|
|
75546
|
+
const recordNodes = findRecordSelections(documentnode);
|
|
75547
|
+
recordNodes.forEach((recordConnection) => {
|
|
75548
|
+
swapIdsOfFieldNode(recordConnection, draftFunctions);
|
|
75549
|
+
});
|
|
75550
|
+
return documentnode;
|
|
75551
|
+
}
|
|
75552
|
+
function swapIdsOfFieldNode(selectionNode, draftFunctions) {
|
|
75553
|
+
if (isCustomFieldNode(selectionNode) &&
|
|
75554
|
+
selectionNode.type === 'Connection' &&
|
|
75555
|
+
selectionNode.arguments !== undefined &&
|
|
75556
|
+
selectionNode.arguments.some((argment) => argment.name === 'where')) {
|
|
75557
|
+
const swappedArguments = selectionNode.arguments.map((argument) => {
|
|
75558
|
+
if (argument.name === 'where') {
|
|
75559
|
+
return {
|
|
75560
|
+
...argument,
|
|
75561
|
+
value: swapIdsOfValueNode(argument.value, draftFunctions.isDraftId, draftFunctions.getCanonicalId),
|
|
75562
|
+
};
|
|
75563
|
+
}
|
|
75564
|
+
else {
|
|
75565
|
+
return argument;
|
|
75566
|
+
}
|
|
75567
|
+
});
|
|
75568
|
+
selectionNode.arguments = swappedArguments;
|
|
75569
|
+
}
|
|
75570
|
+
if (selectionNode.luvioSelections !== undefined) {
|
|
75571
|
+
for (const childSelectionNode of selectionNode.luvioSelections) {
|
|
75572
|
+
if (isCustomFieldNode(childSelectionNode) ||
|
|
75573
|
+
isObjectFieldSelection(childSelectionNode)) {
|
|
75574
|
+
swapIdsOfFieldNode(childSelectionNode, draftFunctions);
|
|
75575
|
+
}
|
|
75576
|
+
}
|
|
75577
|
+
}
|
|
75578
|
+
}
|
|
75579
|
+
function swapIdsOfValueNode(valueNode, isDraftId, idMapper) {
|
|
75580
|
+
switch (valueNode.kind) {
|
|
75581
|
+
case Kind.OBJECT: {
|
|
75582
|
+
const swappedObjectValueNode = {};
|
|
75583
|
+
for (const key of keys(valueNode.fields)) {
|
|
75584
|
+
swappedObjectValueNode[key] = swapIdsOfValueNode(valueNode.fields[key], isDraftId, idMapper);
|
|
75585
|
+
}
|
|
75586
|
+
return {
|
|
75587
|
+
kind: 'ObjectValue',
|
|
75588
|
+
fields: swappedObjectValueNode,
|
|
75589
|
+
};
|
|
75590
|
+
}
|
|
75591
|
+
case Kind.LIST: {
|
|
75592
|
+
const listValueNodes = [];
|
|
75593
|
+
for (const child of valueNode.values) {
|
|
75594
|
+
listValueNodes.push(swapIdsOfValueNode(child, isDraftId, idMapper));
|
|
75595
|
+
}
|
|
75596
|
+
return {
|
|
75597
|
+
kind: 'ListValue',
|
|
75598
|
+
values: listValueNodes,
|
|
75599
|
+
};
|
|
75600
|
+
}
|
|
75601
|
+
case Kind.STRING: {
|
|
75602
|
+
if (!isDraftId(valueNode.value)) {
|
|
75603
|
+
return valueNode;
|
|
75604
|
+
}
|
|
75605
|
+
return {
|
|
75606
|
+
kind: 'StringValue',
|
|
75607
|
+
value: idMapper(valueNode.value),
|
|
75608
|
+
block: false,
|
|
75609
|
+
};
|
|
75610
|
+
}
|
|
75611
|
+
default:
|
|
75612
|
+
return {
|
|
75613
|
+
...valueNode,
|
|
75614
|
+
};
|
|
75615
|
+
}
|
|
75616
|
+
}
|
|
75418
75617
|
function injectScopeFields(ast) {
|
|
75419
75618
|
const modifiedDocumentNode = {
|
|
75420
75619
|
kind: 'Document',
|
|
@@ -75996,6 +76195,34 @@
|
|
|
75996
76195
|
}
|
|
75997
76196
|
return buildNetworkSnapshot(luvio, config, fragment, dispatchOptions);
|
|
75998
76197
|
}
|
|
76198
|
+
const replaceDraftIdsInVariables = (variables, draftFunctions) => {
|
|
76199
|
+
const replace = (object) => {
|
|
76200
|
+
if (typeof object === 'string') {
|
|
76201
|
+
if (!draftFunctions.isDraftId(object)) {
|
|
76202
|
+
return object;
|
|
76203
|
+
}
|
|
76204
|
+
return draftFunctions.getCanonicalId(object);
|
|
76205
|
+
}
|
|
76206
|
+
else if (isArray(object)) {
|
|
76207
|
+
return object.map(replace);
|
|
76208
|
+
}
|
|
76209
|
+
else if (typeof object === 'object' && object !== null) {
|
|
76210
|
+
let source = object;
|
|
76211
|
+
return keys(source).reduce((acc, key) => {
|
|
76212
|
+
acc[key] = replace(source[key]);
|
|
76213
|
+
return acc;
|
|
76214
|
+
}, {});
|
|
76215
|
+
}
|
|
76216
|
+
else {
|
|
76217
|
+
return object;
|
|
76218
|
+
}
|
|
76219
|
+
};
|
|
76220
|
+
let newVariables = keys(variables).reduce((acc, key) => {
|
|
76221
|
+
acc[key] = replace(variables[key]);
|
|
76222
|
+
return acc;
|
|
76223
|
+
}, {});
|
|
76224
|
+
return newVariables;
|
|
76225
|
+
};
|
|
75999
76226
|
const graphQLAdapterFactory = (luvio) => {
|
|
76000
76227
|
const uiApiGraphQLAdapter = factory$1(luvio);
|
|
76001
76228
|
function graphql(untrustedConfig, requestContext) {
|
|
@@ -76020,9 +76247,17 @@
|
|
|
76020
76247
|
const validatedConfigWithInjection = fieldInjectionRequired
|
|
76021
76248
|
? graphqlConfigWithInjectedAST(validatedConfig)
|
|
76022
76249
|
: validatedConfig;
|
|
76023
|
-
const
|
|
76250
|
+
const sanitizedConfig = draftFunctions !== undefined
|
|
76251
|
+
? sanitizeConfig(validatedConfigWithInjection, draftFunctions)
|
|
76252
|
+
: validatedConfigWithInjection;
|
|
76253
|
+
if (sanitizedConfig.variables && draftFunctions !== undefined) {
|
|
76254
|
+
const variablesWithSwappedDraftIds = replaceDraftIdsInVariables(sanitizedConfig.variables, draftFunctions);
|
|
76255
|
+
sanitizedConfig.variables = variablesWithSwappedDraftIds;
|
|
76256
|
+
validatedConfig.variables = variablesWithSwappedDraftIds;
|
|
76257
|
+
}
|
|
76258
|
+
const fragment = createFragment(luvio, sanitizedConfig.query, sanitizedConfig.variables);
|
|
76024
76259
|
const context = {
|
|
76025
|
-
config:
|
|
76260
|
+
config: sanitizedConfig,
|
|
76026
76261
|
fragment,
|
|
76027
76262
|
luvio,
|
|
76028
76263
|
};
|
|
@@ -76031,7 +76266,7 @@
|
|
|
76031
76266
|
const observers = requestContext && requestContext.eventObservers
|
|
76032
76267
|
? requestContext.eventObservers
|
|
76033
76268
|
: [];
|
|
76034
|
-
// uses the original ast to do the eval to avoid fields not needed by users
|
|
76269
|
+
// uses the original ast to do the eval to avoid fields not needed by users. The draftID swapping happens when filters transform to predicates.
|
|
76035
76270
|
return storeEval(validatedConfig, snapshotOrPromiseFromCachePolicy, observers);
|
|
76036
76271
|
}
|
|
76037
76272
|
return snapshotOrPromiseFromCachePolicy;
|
|
@@ -76048,6 +76283,15 @@
|
|
|
76048
76283
|
query: modifiedAST,
|
|
76049
76284
|
};
|
|
76050
76285
|
}
|
|
76286
|
+
function sanitizeConfig(graphqlConfig, draftFunctions) {
|
|
76287
|
+
const { query } = graphqlConfig;
|
|
76288
|
+
const astCopy = parse(stringify(query));
|
|
76289
|
+
const modifiedAST = swapIdsOfDocumentNode(astCopy, draftFunctions);
|
|
76290
|
+
return {
|
|
76291
|
+
...graphqlConfig,
|
|
76292
|
+
query: modifiedAST,
|
|
76293
|
+
};
|
|
76294
|
+
}
|
|
76051
76295
|
// make sure to register the configuration whenever this module loads
|
|
76052
76296
|
register({ id: '@salesforce/lds-adapters-graphql', configuration });
|
|
76053
76297
|
|
|
@@ -76065,7 +76309,7 @@
|
|
|
76065
76309
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
76066
76310
|
graphQLImperative = ldsAdapter;
|
|
76067
76311
|
});
|
|
76068
|
-
// version: 1.136.
|
|
76312
|
+
// version: 1.136.7-ae23b4cbb
|
|
76069
76313
|
|
|
76070
76314
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
76071
76315
|
__proto__: null,
|
|
@@ -76675,24 +76919,21 @@
|
|
|
76675
76919
|
* to the instance of the lds-drafts' DraftQueue implementation
|
|
76676
76920
|
*/
|
|
76677
76921
|
const nimbusDraftQueue = {
|
|
76678
|
-
callProxyMethod(methodName, serializedArgsArray, resultCallback,
|
|
76922
|
+
callProxyMethod(methodName, serializedArgsArray, resultCallback,
|
|
76923
|
+
// NOTE: the other side of the proxy is expecting an error message string
|
|
76924
|
+
// (not a JSON serialized Error object)
|
|
76925
|
+
errorCallback) {
|
|
76679
76926
|
const method = draftQueue[methodName];
|
|
76680
76927
|
if (method === undefined) {
|
|
76681
|
-
return errorCallback(
|
|
76682
|
-
message: 'Method does not exist on the draft queue',
|
|
76683
|
-
}));
|
|
76928
|
+
return errorCallback('Method does not exist on the draft queue');
|
|
76684
76929
|
}
|
|
76685
76930
|
if (allowList.includes(methodName) === false) {
|
|
76686
|
-
return errorCallback(
|
|
76687
|
-
message: `Method ${methodName} is not available for proxy invocation`,
|
|
76688
|
-
}));
|
|
76931
|
+
return errorCallback(`Method ${methodName} is not available for proxy invocation`);
|
|
76689
76932
|
}
|
|
76690
76933
|
const parsedArgs = parse$1(serializedArgsArray);
|
|
76691
76934
|
// TODO [W-9933226]: we should validate the argument list based on which method is being called
|
|
76692
76935
|
if (isArray$1(parsedArgs) === false) {
|
|
76693
|
-
return errorCallback(
|
|
76694
|
-
message: 'expected array argument list',
|
|
76695
|
-
}));
|
|
76936
|
+
return errorCallback('expected array argument list');
|
|
76696
76937
|
}
|
|
76697
76938
|
let methodResult = undefined;
|
|
76698
76939
|
try {
|
|
@@ -76704,7 +76945,7 @@
|
|
|
76704
76945
|
}
|
|
76705
76946
|
}
|
|
76706
76947
|
catch (err) {
|
|
76707
|
-
return errorCallback(
|
|
76948
|
+
return errorCallback(normalizeError(err).message);
|
|
76708
76949
|
}
|
|
76709
76950
|
if (methodResult.then === undefined) {
|
|
76710
76951
|
return resultCallback(stringify$1(methodResult));
|
|
@@ -76714,7 +76955,7 @@
|
|
|
76714
76955
|
resultCallback(stringify$1(result));
|
|
76715
76956
|
})
|
|
76716
76957
|
.catch((err) => {
|
|
76717
|
-
errorCallback(
|
|
76958
|
+
errorCallback(normalizeError(err).message);
|
|
76718
76959
|
});
|
|
76719
76960
|
},
|
|
76720
76961
|
};
|
|
@@ -76774,4 +77015,4 @@
|
|
|
76774
77015
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
76775
77016
|
|
|
76776
77017
|
}));
|
|
76777
|
-
// version: 1.136.
|
|
77018
|
+
// version: 1.136.7-777657471
|