@salesforce/lds-worker-api 1.296.0 → 1.297.0
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 +1 -1
- package/dist/standalone/es/lds-worker-api.js +559 -550
- package/dist/standalone/umd/lds-worker-api.js +559 -550
- package/package.json +10 -10
|
@@ -20,7 +20,7 @@ var SnapshotState$3;
|
|
|
20
20
|
SnapshotState["Stale"] = "Stale";
|
|
21
21
|
})(SnapshotState$3 || (SnapshotState$3 = {}));
|
|
22
22
|
|
|
23
|
-
const { create: create$
|
|
23
|
+
const { create: create$c, entries: entries$7, freeze: freeze$6, keys: keys$d, values: values$6, assign: assign$b } = Object;
|
|
24
24
|
const { hasOwnProperty: hasOwnProperty$3 } = Object.prototype;
|
|
25
25
|
const { isArray: isArray$9 } = Array;
|
|
26
26
|
const { push: push$5, indexOf, slice: slice$2 } = Array.prototype;
|
|
@@ -48,7 +48,7 @@ function deepFreeze(value) {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
else {
|
|
51
|
-
const keys$1 = keys$
|
|
51
|
+
const keys$1 = keys$d(value);
|
|
52
52
|
for (let i = 0, len = keys$1.length; i < len; i += 1) {
|
|
53
53
|
deepFreeze(value[keys$1[i]]);
|
|
54
54
|
}
|
|
@@ -319,7 +319,7 @@ function stableJSONStringify$3(node) {
|
|
|
319
319
|
if (node === null) {
|
|
320
320
|
return 'null';
|
|
321
321
|
}
|
|
322
|
-
const keys$1 = keys$
|
|
322
|
+
const keys$1 = keys$d(node).sort();
|
|
323
323
|
out = '';
|
|
324
324
|
for (i = 0; i < keys$1.length; i++) {
|
|
325
325
|
const key = keys$1[i];
|
|
@@ -587,13 +587,13 @@ function getTTLOverride$1(ttlOverrideKey, ttlOverrides, defaultTTLOverride) {
|
|
|
587
587
|
class StringKeyInMemoryStore {
|
|
588
588
|
constructor(options = {}) {
|
|
589
589
|
// public, in memory properties
|
|
590
|
-
this.records = create$
|
|
591
|
-
this.metadata = create$
|
|
592
|
-
this.visitedIds = create$
|
|
593
|
-
this.refreshedIds = create$
|
|
594
|
-
this.redirectKeys = create$
|
|
595
|
-
this.retainedIds = create$
|
|
596
|
-
this.ttlOverrides = create$
|
|
590
|
+
this.records = create$c(null);
|
|
591
|
+
this.metadata = create$c(null);
|
|
592
|
+
this.visitedIds = create$c(null);
|
|
593
|
+
this.refreshedIds = create$c(null);
|
|
594
|
+
this.redirectKeys = create$c(null);
|
|
595
|
+
this.retainedIds = create$c(null);
|
|
596
|
+
this.ttlOverrides = create$c(null);
|
|
597
597
|
this.snapshotSubscriptions = [];
|
|
598
598
|
this.trimTask = null;
|
|
599
599
|
this.pendingTrimKeys = new Set();
|
|
@@ -601,8 +601,8 @@ class StringKeyInMemoryStore {
|
|
|
601
601
|
this.watchSubscriptions = [];
|
|
602
602
|
this.eventObservers = [];
|
|
603
603
|
// private/protected
|
|
604
|
-
this.insertedIds = create$
|
|
605
|
-
this.reverseRedirectKeys = create$
|
|
604
|
+
this.insertedIds = create$c(null);
|
|
605
|
+
this.reverseRedirectKeys = create$c(null);
|
|
606
606
|
this.currentSnapshotId = 0;
|
|
607
607
|
this.scheduler = options.scheduler || buildDefaultScheduler();
|
|
608
608
|
if (options.initialData) {
|
|
@@ -615,13 +615,13 @@ class StringKeyInMemoryStore {
|
|
|
615
615
|
return this.records[this.getCanonicalRecordId(key)];
|
|
616
616
|
}
|
|
617
617
|
getNumEntries() {
|
|
618
|
-
return keys$
|
|
618
|
+
return keys$d(this.records).length;
|
|
619
619
|
}
|
|
620
620
|
readMetadata(key) {
|
|
621
621
|
return this.metadata[this.getCanonicalRecordId(key)];
|
|
622
622
|
}
|
|
623
623
|
readMetadataWhere(query) {
|
|
624
|
-
const keys$1 = keys$
|
|
624
|
+
const keys$1 = keys$d(this.metadata);
|
|
625
625
|
const results = [];
|
|
626
626
|
const hasNamespaceQuery = hasOwnProperty$3.call(query, 'namespace');
|
|
627
627
|
const hasRepresentationNameQuery = hasOwnProperty$3.call(query, 'representationName');
|
|
@@ -718,8 +718,8 @@ class StringKeyInMemoryStore {
|
|
|
718
718
|
// Note: we should always get the subscription references from this at the beginning
|
|
719
719
|
// of the function, in case the reference changes (because of an unsubscribe)
|
|
720
720
|
const { snapshotSubscriptions, watchSubscriptions, visitedIds, refreshedIds, insertedIds } = this;
|
|
721
|
-
const allVisitedIds = keys$
|
|
722
|
-
const allRefreshedIds = keys$
|
|
721
|
+
const allVisitedIds = keys$d(visitedIds);
|
|
722
|
+
const allRefreshedIds = keys$d(refreshedIds);
|
|
723
723
|
// Early exit if nothing has changed
|
|
724
724
|
if (allVisitedIds.length === 0 && allRefreshedIds.length === 0) {
|
|
725
725
|
return Promise.resolve();
|
|
@@ -762,9 +762,9 @@ class StringKeyInMemoryStore {
|
|
|
762
762
|
callback(watchCallbackEntries);
|
|
763
763
|
}
|
|
764
764
|
}
|
|
765
|
-
this.visitedIds = create$
|
|
766
|
-
this.refreshedIds = create$
|
|
767
|
-
this.insertedIds = create$
|
|
765
|
+
this.visitedIds = create$c(null);
|
|
766
|
+
this.refreshedIds = create$c(null);
|
|
767
|
+
this.insertedIds = create$c(null);
|
|
768
768
|
// the .then removes the return of an array of voids to a single void
|
|
769
769
|
return Promise.all(snapshotSubPromises).then(() => { });
|
|
770
770
|
}
|
|
@@ -953,18 +953,18 @@ class StringKeyInMemoryStore {
|
|
|
953
953
|
return this.defaultTTLOverride;
|
|
954
954
|
}
|
|
955
955
|
reset() {
|
|
956
|
-
this.records = create$
|
|
956
|
+
this.records = create$c(null);
|
|
957
957
|
this.snapshotSubscriptions = [];
|
|
958
958
|
this.watchSubscriptions = [];
|
|
959
|
-
this.visitedIds = create$
|
|
960
|
-
this.refreshedIds = create$
|
|
961
|
-
this.insertedIds = create$
|
|
962
|
-
this.redirectKeys = create$
|
|
963
|
-
this.reverseRedirectKeys = create$
|
|
964
|
-
this.retainedIds = create$
|
|
965
|
-
this.ttlOverrides = create$
|
|
959
|
+
this.visitedIds = create$c(null);
|
|
960
|
+
this.refreshedIds = create$c(null);
|
|
961
|
+
this.insertedIds = create$c(null);
|
|
962
|
+
this.redirectKeys = create$c(null);
|
|
963
|
+
this.reverseRedirectKeys = create$c(null);
|
|
964
|
+
this.retainedIds = create$c(null);
|
|
965
|
+
this.ttlOverrides = create$c(null);
|
|
966
966
|
this.trimTask = null;
|
|
967
|
-
this.metadata = create$
|
|
967
|
+
this.metadata = create$c(null);
|
|
968
968
|
this.defaultTTLOverride = undefined;
|
|
969
969
|
emitLuvioStoreEvent({ type: 'store-reset', timestamp: Date.now() }, this.eventObservers);
|
|
970
970
|
}
|
|
@@ -1223,7 +1223,7 @@ class StringKeyInMemoryStore {
|
|
|
1223
1223
|
calculateAndSetNewTTLs(storeMetadata, resetInitialDataTtls) {
|
|
1224
1224
|
if (resetInitialDataTtls === true) {
|
|
1225
1225
|
const now = Date.now();
|
|
1226
|
-
keys$
|
|
1226
|
+
keys$d(storeMetadata).forEach((key) => {
|
|
1227
1227
|
const storeMetadataEntry = storeMetadata[key];
|
|
1228
1228
|
const ttl = storeMetadataEntry.expirationTimestamp - storeMetadataEntry.ingestionTimestamp;
|
|
1229
1229
|
storeMetadataEntry.ingestionTimestamp = now;
|
|
@@ -1252,7 +1252,7 @@ function isPendingSnapshotWithNoOverlappingIds(snapshot, visitedIds, refreshedId
|
|
|
1252
1252
|
hasOverlappingIds(snapshot, visitedIds) === false);
|
|
1253
1253
|
}
|
|
1254
1254
|
function getMatchingIds(partialKey, visitedIds) {
|
|
1255
|
-
const keys$1 = keys$
|
|
1255
|
+
const keys$1 = keys$d(partialKey);
|
|
1256
1256
|
return visitedIds.filter((visitedId) => {
|
|
1257
1257
|
return keys$1.every((key) => {
|
|
1258
1258
|
return partialKey[key] === visitedId[key];
|
|
@@ -1902,8 +1902,8 @@ class InMemoryStore {
|
|
|
1902
1902
|
} while (redirectKey !== undefined);
|
|
1903
1903
|
}
|
|
1904
1904
|
isUsingStringKeys() {
|
|
1905
|
-
return (keys$
|
|
1906
|
-
keys$
|
|
1905
|
+
return (keys$d(this.fallbackStringKeyInMemoryStore.visitedIds).length !== 0 ||
|
|
1906
|
+
keys$d(this.fallbackStringKeyInMemoryStore.refreshedIds).length !== 0);
|
|
1907
1907
|
}
|
|
1908
1908
|
delegateToFallbackStringKeyStore(snapshot) {
|
|
1909
1909
|
return !isErrorSnapshot$3(snapshot) && typeof snapshot.recordId === 'string';
|
|
@@ -1945,7 +1945,7 @@ class InMemoryStore {
|
|
|
1945
1945
|
buildKeySchema(keyMetadata) {
|
|
1946
1946
|
// pull NamespacedType type out of NormalizedKeyMetadata
|
|
1947
1947
|
const { namespace: _ns, representationName: _rn, ...keyParamValues } = keyMetadata;
|
|
1948
|
-
const keySchema = keys$
|
|
1948
|
+
const keySchema = keys$d(keyParamValues).sort();
|
|
1949
1949
|
return ['namespace', 'representationName', ...keySchema];
|
|
1950
1950
|
}
|
|
1951
1951
|
serialize() {
|
|
@@ -2239,7 +2239,7 @@ class GraphNode {
|
|
|
2239
2239
|
return value;
|
|
2240
2240
|
}
|
|
2241
2241
|
keys() {
|
|
2242
|
-
return keys$
|
|
2242
|
+
return keys$d(this.data);
|
|
2243
2243
|
}
|
|
2244
2244
|
isScalar(propertyName) {
|
|
2245
2245
|
// TODO W-6900046 - merge.ts casts these to any and manually sets `data`
|
|
@@ -2660,7 +2660,7 @@ class Reader {
|
|
|
2660
2660
|
}
|
|
2661
2661
|
}
|
|
2662
2662
|
selectAllObject(record, data, visitedKeys) {
|
|
2663
|
-
const recordKeys = keys$
|
|
2663
|
+
const recordKeys = keys$d(record);
|
|
2664
2664
|
const { length } = recordKeys;
|
|
2665
2665
|
for (let i = 0; i < length; i += 1) {
|
|
2666
2666
|
const key = recordKeys[i];
|
|
@@ -2844,7 +2844,7 @@ class Reader {
|
|
|
2844
2844
|
}
|
|
2845
2845
|
const { baseSnapshotValue } = this.currentPath;
|
|
2846
2846
|
if (isDefined$1(baseSnapshotValue)) {
|
|
2847
|
-
this.snapshotChanged = keys$1.length !== keys$
|
|
2847
|
+
this.snapshotChanged = keys$1.length !== keys$d(baseSnapshotValue).length;
|
|
2848
2848
|
}
|
|
2849
2849
|
}
|
|
2850
2850
|
checkIfChanged(value, options) {
|
|
@@ -2888,7 +2888,7 @@ class Reader {
|
|
|
2888
2888
|
return this.markMissing();
|
|
2889
2889
|
}
|
|
2890
2890
|
const sink = (data[propertyName] = {});
|
|
2891
|
-
const keys$1 = keys$
|
|
2891
|
+
const keys$1 = keys$d(obj);
|
|
2892
2892
|
this.checkIfObjectKeysLengthChanged(keys$1);
|
|
2893
2893
|
for (let i = 0, len = keys$1.length; i < len; i += 1) {
|
|
2894
2894
|
const key = keys$1[i];
|
|
@@ -2899,7 +2899,7 @@ class Reader {
|
|
|
2899
2899
|
}
|
|
2900
2900
|
readLinkMap(propertyName, selection, record, data) {
|
|
2901
2901
|
const map = record[propertyName];
|
|
2902
|
-
const keys$1 = keys$
|
|
2902
|
+
const keys$1 = keys$d(map);
|
|
2903
2903
|
const sink = {};
|
|
2904
2904
|
this.checkIfObjectKeysLengthChanged(keys$1);
|
|
2905
2905
|
for (let i = 0, len = keys$1.length; i < len; i += 1) {
|
|
@@ -3033,7 +3033,7 @@ class Reader {
|
|
|
3033
3033
|
return;
|
|
3034
3034
|
}
|
|
3035
3035
|
const sink = (data[propertyName] = {});
|
|
3036
|
-
const keys$1 = keys$
|
|
3036
|
+
const keys$1 = keys$d(obj);
|
|
3037
3037
|
this.checkIfObjectKeysLengthChanged(keys$1);
|
|
3038
3038
|
for (let i = 0, len = keys$1.length; i < len; i += 1) {
|
|
3039
3039
|
const key = keys$1[i];
|
|
@@ -3266,8 +3266,8 @@ class Environment {
|
|
|
3266
3266
|
this.defaultCachePolicy = { type: 'cache-then-network' };
|
|
3267
3267
|
this.store = store;
|
|
3268
3268
|
this.networkAdapter = networkAdapter;
|
|
3269
|
-
this.adapterContextMap = create$
|
|
3270
|
-
this.typeQueryEvaluatorMap = create$
|
|
3269
|
+
this.adapterContextMap = create$c(null);
|
|
3270
|
+
this.typeQueryEvaluatorMap = create$c(null);
|
|
3271
3271
|
// bind these methods so when they get passed into the
|
|
3272
3272
|
// Store, the this reference is preserved
|
|
3273
3273
|
this.createSnapshot = this.createSnapshot.bind(this);
|
|
@@ -3467,7 +3467,7 @@ class Environment {
|
|
|
3467
3467
|
// retrieve from adapterContextMap if contextId is supplied
|
|
3468
3468
|
// we will only track context of adapters that explicitly provide a contextId
|
|
3469
3469
|
if (this.adapterContextMap[contextId] === undefined) {
|
|
3470
|
-
this.adapterContextMap[contextId] = create$
|
|
3470
|
+
this.adapterContextMap[contextId] = create$c(null);
|
|
3471
3471
|
}
|
|
3472
3472
|
const contextStore = this.adapterContextMap[contextId];
|
|
3473
3473
|
const context = {
|
|
@@ -3729,13 +3729,13 @@ class Luvio {
|
|
|
3729
3729
|
// undefined values on the injected networkAdapter. So we do it here, on
|
|
3730
3730
|
// the API that those adapters call to dispatch their ResourceRequests.
|
|
3731
3731
|
const { queryParams, urlParams } = mergedResourceRequest;
|
|
3732
|
-
for (const paramKey of keys$
|
|
3732
|
+
for (const paramKey of keys$d(queryParams)) {
|
|
3733
3733
|
const value = queryParams[paramKey];
|
|
3734
3734
|
if (value === undefined) {
|
|
3735
3735
|
delete queryParams[paramKey];
|
|
3736
3736
|
}
|
|
3737
3737
|
}
|
|
3738
|
-
for (const paramKey of keys$
|
|
3738
|
+
for (const paramKey of keys$d(urlParams)) {
|
|
3739
3739
|
const value = urlParams[paramKey];
|
|
3740
3740
|
if (value === undefined) {
|
|
3741
3741
|
delete urlParams[paramKey];
|
|
@@ -4062,16 +4062,16 @@ function createResourceParamsImpl(config, configMetadata) {
|
|
|
4062
4062
|
return acc;
|
|
4063
4063
|
}, {});
|
|
4064
4064
|
const resourceParams = {};
|
|
4065
|
-
if (keys$
|
|
4065
|
+
if (keys$d(urlParams).length > 0) {
|
|
4066
4066
|
resourceParams[CONFIG_PROPERTY_URL_PARAMS] = urlParams;
|
|
4067
4067
|
}
|
|
4068
|
-
if (keys$
|
|
4068
|
+
if (keys$d(queryParams).length > 0) {
|
|
4069
4069
|
resourceParams[CONFIG_PROPERTY_QUERY_PARAMS] = queryParams;
|
|
4070
4070
|
}
|
|
4071
4071
|
if (bodyParams.length > 0) {
|
|
4072
4072
|
resourceParams[CONFIG_PROPERTY_BODY] = actualBodyParams;
|
|
4073
4073
|
}
|
|
4074
|
-
if (keys$
|
|
4074
|
+
if (keys$d(headerParams).length > 0) {
|
|
4075
4075
|
resourceParams[CONFIG_PROPERTY_HEADERS] = headerParams;
|
|
4076
4076
|
}
|
|
4077
4077
|
return resourceParams;
|
|
@@ -4204,7 +4204,7 @@ function withDefaultLuvio(callback) {
|
|
|
4204
4204
|
}
|
|
4205
4205
|
callbacks.push(callback);
|
|
4206
4206
|
}
|
|
4207
|
-
// version: 1.
|
|
4207
|
+
// version: 1.297.0-1fc775982
|
|
4208
4208
|
|
|
4209
4209
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
4210
4210
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -15712,7 +15712,7 @@ function gql(literals, ...subs) {
|
|
|
15712
15712
|
}
|
|
15713
15713
|
return superResult;
|
|
15714
15714
|
}
|
|
15715
|
-
// version: 1.
|
|
15715
|
+
// version: 1.297.0-1fc775982
|
|
15716
15716
|
|
|
15717
15717
|
function unwrap(data) {
|
|
15718
15718
|
// The lwc-luvio bindings import a function from lwc called "unwrap".
|
|
@@ -16302,7 +16302,7 @@ function createLDSAdapter(luvio, name, factory) {
|
|
|
16302
16302
|
return factory(luvio);
|
|
16303
16303
|
}
|
|
16304
16304
|
|
|
16305
|
-
const { create: create$
|
|
16305
|
+
const { create: create$b, defineProperty, defineProperties } = Object;
|
|
16306
16306
|
|
|
16307
16307
|
var SnapshotState$2;
|
|
16308
16308
|
(function (SnapshotState) {
|
|
@@ -16641,7 +16641,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
|
|
|
16641
16641
|
const { apiFamily, name } = metadata;
|
|
16642
16642
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
16643
16643
|
}
|
|
16644
|
-
// version: 1.
|
|
16644
|
+
// version: 1.297.0-1fc775982
|
|
16645
16645
|
|
|
16646
16646
|
/**
|
|
16647
16647
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -16744,7 +16744,7 @@ var TypeCheckShapes;
|
|
|
16744
16744
|
|
|
16745
16745
|
const { keys: ObjectKeys$3, create: ObjectCreate$3 } = Object;
|
|
16746
16746
|
|
|
16747
|
-
const { assign: assign$
|
|
16747
|
+
const { assign: assign$a, create: create$a, freeze: freeze$5, isFrozen: isFrozen$3, keys: keys$c } = Object;
|
|
16748
16748
|
|
|
16749
16749
|
ObjectCreate$3(null);
|
|
16750
16750
|
|
|
@@ -17201,7 +17201,7 @@ function buildAdapterValidationConfig$2(displayName, paramsMeta) {
|
|
|
17201
17201
|
}
|
|
17202
17202
|
const keyPrefix$2 = 'UiApi';
|
|
17203
17203
|
|
|
17204
|
-
const { assign: assign$
|
|
17204
|
+
const { assign: assign$9, create: create$9, freeze: freeze$4, isFrozen: isFrozen$2, keys: keys$b } = Object;
|
|
17205
17205
|
const { hasOwnProperty: hasOwnProperty$1 } = Object.prototype;
|
|
17206
17206
|
const { split, endsWith } = String.prototype;
|
|
17207
17207
|
const { isArray: isArray$7 } = Array;
|
|
@@ -17230,7 +17230,7 @@ function dedupe$2(value) {
|
|
|
17230
17230
|
for (let i = 0, len = value.length; i < len; i += 1) {
|
|
17231
17231
|
result[value[i]] = true;
|
|
17232
17232
|
}
|
|
17233
|
-
return keys$
|
|
17233
|
+
return keys$b(result);
|
|
17234
17234
|
}
|
|
17235
17235
|
/**
|
|
17236
17236
|
* @param source The array of string to filter
|
|
@@ -18085,14 +18085,14 @@ const getTypeCacheKeys$W$1 = (rootKeySet, luvio, input, _fullPathFactory) => {
|
|
|
18085
18085
|
mergeable: true,
|
|
18086
18086
|
});
|
|
18087
18087
|
const input_childRelationships = input.childRelationships;
|
|
18088
|
-
const input_childRelationships_keys = keys$
|
|
18088
|
+
const input_childRelationships_keys = keys$b(input_childRelationships);
|
|
18089
18089
|
const input_childRelationships_length = input_childRelationships_keys.length;
|
|
18090
18090
|
for (let i = 0; i < input_childRelationships_length; i++) {
|
|
18091
18091
|
const key = input_childRelationships_keys[i];
|
|
18092
18092
|
getTypeCacheKeys$V$1(rootKeySet, luvio, input_childRelationships[key], () => rootKey + '__childRelationships' + '__' + key);
|
|
18093
18093
|
}
|
|
18094
18094
|
const input_fields = input.fields;
|
|
18095
|
-
const input_fields_keys = keys$
|
|
18095
|
+
const input_fields_keys = keys$b(input_fields);
|
|
18096
18096
|
const input_fields_length = input_fields_keys.length;
|
|
18097
18097
|
for (let i = 0; i < input_fields_length; i++) {
|
|
18098
18098
|
const key = input_fields_keys[i];
|
|
@@ -20009,7 +20009,7 @@ function convertRecordFieldsArrayToTrie(fields, optionalFields = []) {
|
|
|
20009
20009
|
function createPathSelection(propertyName, fieldDefinition) {
|
|
20010
20010
|
const fieldsSelection = [];
|
|
20011
20011
|
const { children } = fieldDefinition;
|
|
20012
|
-
const childrenKeys = keys$
|
|
20012
|
+
const childrenKeys = keys$b(children);
|
|
20013
20013
|
for (let i = 0, len = childrenKeys.length; i < len; i += 1) {
|
|
20014
20014
|
const childKey = childrenKeys[i];
|
|
20015
20015
|
const childFieldDefinition = children[childKey];
|
|
@@ -20054,7 +20054,7 @@ function createPathSelection(propertyName, fieldDefinition) {
|
|
|
20054
20054
|
*/
|
|
20055
20055
|
function createPathSelectionFromValue(fields) {
|
|
20056
20056
|
const fieldsSelection = [];
|
|
20057
|
-
const fieldNames = keys$
|
|
20057
|
+
const fieldNames = keys$b(fields);
|
|
20058
20058
|
for (let i = 0, len = fieldNames.length; i < len; i++) {
|
|
20059
20059
|
const fieldName = fieldNames[i];
|
|
20060
20060
|
const { value: fieldValue } = fields[fieldName];
|
|
@@ -20093,7 +20093,7 @@ function createPathSelectionFromValue(fields) {
|
|
|
20093
20093
|
}
|
|
20094
20094
|
function extractRecordFieldsRecursively(record) {
|
|
20095
20095
|
const fields = [];
|
|
20096
|
-
const fieldNames = keys$
|
|
20096
|
+
const fieldNames = keys$b(record.fields);
|
|
20097
20097
|
for (let i = 0, len = fieldNames.length; i < len; i++) {
|
|
20098
20098
|
const fieldName = fieldNames[i];
|
|
20099
20099
|
const { value: fieldValue } = record.fields[fieldName];
|
|
@@ -20284,7 +20284,7 @@ function extractTrackedFieldsToTrie(recordId, node, root, config, visitedRecordI
|
|
|
20284
20284
|
// For a spanning record that is detected to be a circular reference, we add the field along with Id and Name.
|
|
20285
20285
|
// It's possible for spanning record lookup fields to sometimes be circular, and sometimes not - depending on the value of the lookup field.
|
|
20286
20286
|
// For more information on scenarios that caused this fix: search "LDS Recursive Spanning Fields Problem" in Quip
|
|
20287
|
-
if (keys$
|
|
20287
|
+
if (keys$b(next.children).length === 0) {
|
|
20288
20288
|
addScalarFieldId(next);
|
|
20289
20289
|
addScalarFieldName(next);
|
|
20290
20290
|
}
|
|
@@ -20335,13 +20335,13 @@ function isExternalLookupFieldKey(spanningNode) {
|
|
|
20335
20335
|
return endsWith.call(spanningNode.scalar('apiName'), CUSTOM_EXTERNAL_OBJECT_FIELD_SUFFIX);
|
|
20336
20336
|
}
|
|
20337
20337
|
function convertTrieToFields(root) {
|
|
20338
|
-
if (keys$
|
|
20338
|
+
if (keys$b(root.children).length === 0) {
|
|
20339
20339
|
return [];
|
|
20340
20340
|
}
|
|
20341
20341
|
return convertTrieToFieldsRecursively(root);
|
|
20342
20342
|
}
|
|
20343
20343
|
function convertTrieToFieldsRecursively(root) {
|
|
20344
|
-
const childKeys = keys$
|
|
20344
|
+
const childKeys = keys$b(root.children);
|
|
20345
20345
|
if (childKeys.length === 0) {
|
|
20346
20346
|
if (root.name === '') {
|
|
20347
20347
|
return [];
|
|
@@ -20378,7 +20378,7 @@ const getObjectNameFromField = (field) => {
|
|
|
20378
20378
|
function mergeFieldsTries(rootA, rootB) {
|
|
20379
20379
|
const rootAchildren = rootA.children;
|
|
20380
20380
|
const rootBchildren = rootB.children;
|
|
20381
|
-
const childBKeys = keys$
|
|
20381
|
+
const childBKeys = keys$b(rootBchildren);
|
|
20382
20382
|
for (let i = 0, len = childBKeys.length; i < len; i++) {
|
|
20383
20383
|
const childBKey = childBKeys[i];
|
|
20384
20384
|
if (rootAchildren[childBKey] === undefined) {
|
|
@@ -20538,8 +20538,8 @@ function isSuperRecordFieldTrie(a, b) {
|
|
|
20538
20538
|
}
|
|
20539
20539
|
const childrenA = a.children;
|
|
20540
20540
|
const childrenB = b.children;
|
|
20541
|
-
const childKeysA = keys$
|
|
20542
|
-
const childKeysB = keys$
|
|
20541
|
+
const childKeysA = keys$b(childrenA);
|
|
20542
|
+
const childKeysB = keys$b(childrenB);
|
|
20543
20543
|
const childKeysBLength = childKeysB.length;
|
|
20544
20544
|
if (childKeysBLength > childKeysA.length) {
|
|
20545
20545
|
return false;
|
|
@@ -20583,7 +20583,7 @@ function mergePendingFields(newRecord, oldRecord) {
|
|
|
20583
20583
|
// RecordRepresentationNormalized['fields'] to include `pending:true` property
|
|
20584
20584
|
const mergedFields = { ...newRecord.fields };
|
|
20585
20585
|
const merged = { ...newRecord, fields: mergedFields };
|
|
20586
|
-
const existingFields = keys$
|
|
20586
|
+
const existingFields = keys$b(oldRecord.fields);
|
|
20587
20587
|
for (let i = 0, len = existingFields.length; i < len; i += 1) {
|
|
20588
20588
|
const spanningFieldName = existingFields[i];
|
|
20589
20589
|
if (newRecord.fields[spanningFieldName] === undefined) {
|
|
@@ -20716,7 +20716,7 @@ function merge$3(existing, incoming, luvio, _path, recordConflictMap) {
|
|
|
20716
20716
|
if (isGraphNode(node)) {
|
|
20717
20717
|
const dependencies = node.retrieve();
|
|
20718
20718
|
if (dependencies !== null) {
|
|
20719
|
-
const depKeys = keys$
|
|
20719
|
+
const depKeys = keys$b(dependencies);
|
|
20720
20720
|
for (let i = 0, len = depKeys.length; i < len; i++) {
|
|
20721
20721
|
luvio.storeEvict(depKeys[i]);
|
|
20722
20722
|
}
|
|
@@ -20863,7 +20863,7 @@ function addFieldsToStoreLink(fieldsTrie, optionalFieldsTrie, storeLink) {
|
|
|
20863
20863
|
}
|
|
20864
20864
|
for (let i = 0; i < fieldSubtries.length; i++) {
|
|
20865
20865
|
const subtrie = fieldSubtries[i];
|
|
20866
|
-
const fieldNames = keys$
|
|
20866
|
+
const fieldNames = keys$b(subtrie.children);
|
|
20867
20867
|
for (let i = 0; i < fieldNames.length; i++) {
|
|
20868
20868
|
const fieldName = fieldNames[i];
|
|
20869
20869
|
const childTrie = subtrie.children[fieldName];
|
|
@@ -20977,9 +20977,9 @@ function fulfill(existing, incoming) {
|
|
|
20977
20977
|
return false;
|
|
20978
20978
|
}
|
|
20979
20979
|
}
|
|
20980
|
-
const headersKeys = keys$
|
|
20980
|
+
const headersKeys = keys$b(headers);
|
|
20981
20981
|
const headersKeyLength = headersKeys.length;
|
|
20982
|
-
if (headersKeyLength !== keys$
|
|
20982
|
+
if (headersKeyLength !== keys$b(existingHeaders).length) {
|
|
20983
20983
|
return false;
|
|
20984
20984
|
}
|
|
20985
20985
|
for (let i = 0, len = headersKeyLength; i < len; i++) {
|
|
@@ -21587,7 +21587,7 @@ function buildNetworkSnapshot$14(luvio, config, serverRequestCount = 0, options)
|
|
|
21587
21587
|
|
|
21588
21588
|
// iterate through the map to build configs for network calls
|
|
21589
21589
|
function resolveConflict(luvio, map) {
|
|
21590
|
-
const ids = keys$
|
|
21590
|
+
const ids = keys$b(map.conflicts);
|
|
21591
21591
|
if (ids.length === 0) {
|
|
21592
21592
|
instrumentation$3.recordConflictsResolved(map.serverRequestCount);
|
|
21593
21593
|
return;
|
|
@@ -23039,18 +23039,18 @@ function listFields(luvio, { fields = [], optionalFields = [], sortBy, }, listIn
|
|
|
23039
23039
|
return {
|
|
23040
23040
|
getRecordSelectionFieldSets() {
|
|
23041
23041
|
const optionalPlusDefaultFields = { ...optionalFields_ };
|
|
23042
|
-
const fields = keys$
|
|
23042
|
+
const fields = keys$b(defaultFields_);
|
|
23043
23043
|
for (let i = 0; i < fields.length; ++i) {
|
|
23044
23044
|
const field = fields[i];
|
|
23045
23045
|
if (!fields_[field] && !defaultServerFieldStatus.missingFields[field]) {
|
|
23046
23046
|
optionalPlusDefaultFields[field] = true;
|
|
23047
23047
|
}
|
|
23048
23048
|
}
|
|
23049
|
-
return [keys$
|
|
23049
|
+
return [keys$b(fields_).sort(), keys$b(optionalPlusDefaultFields).sort()];
|
|
23050
23050
|
},
|
|
23051
23051
|
processRecords(records) {
|
|
23052
23052
|
const { missingFields } = defaultServerFieldStatus;
|
|
23053
|
-
const fields = keys$
|
|
23053
|
+
const fields = keys$b(missingFields);
|
|
23054
23054
|
for (let i = 0; i < fields.length; ++i) {
|
|
23055
23055
|
const field = fields[i], splitField = field.split('.').slice(1);
|
|
23056
23056
|
for (let i = 0; i < records.length; ++i) {
|
|
@@ -25505,7 +25505,7 @@ function getMissingRecordLookupFields(record, objectInfo) {
|
|
|
25505
25505
|
const lookupFields = {};
|
|
25506
25506
|
const { apiName, fields: recordFields } = record;
|
|
25507
25507
|
const { fields: objectInfoFields } = objectInfo;
|
|
25508
|
-
const objectInfoFieldNames = keys$
|
|
25508
|
+
const objectInfoFieldNames = keys$b(objectInfoFields);
|
|
25509
25509
|
for (let i = 0, len = objectInfoFieldNames.length; i < len; i += 1) {
|
|
25510
25510
|
const fieldName = objectInfoFieldNames[i];
|
|
25511
25511
|
const field = objectInfoFields[fieldName];
|
|
@@ -25524,12 +25524,12 @@ function getMissingRecordLookupFields(record, objectInfo) {
|
|
|
25524
25524
|
const nameField = `${apiName}.${relationshipName}.${getNameField(objectInfo, fieldName)}`;
|
|
25525
25525
|
lookupFields[nameField] = true;
|
|
25526
25526
|
}
|
|
25527
|
-
return keys$
|
|
25527
|
+
return keys$b(lookupFields);
|
|
25528
25528
|
}
|
|
25529
25529
|
function getRecordUiMissingRecordLookupFields(recordUi) {
|
|
25530
25530
|
const { records, objectInfos } = recordUi;
|
|
25531
25531
|
const recordLookupFields = {};
|
|
25532
|
-
const recordIds = keys$
|
|
25532
|
+
const recordIds = keys$b(records);
|
|
25533
25533
|
for (let i = 0, len = recordIds.length; i < len; i += 1) {
|
|
25534
25534
|
const recordId = recordIds[i];
|
|
25535
25535
|
const recordData = records[recordId];
|
|
@@ -25567,19 +25567,19 @@ function buildCachedSelectorKey(key) {
|
|
|
25567
25567
|
}
|
|
25568
25568
|
function eachLayout(recordUi, cb) {
|
|
25569
25569
|
const { layouts } = recordUi;
|
|
25570
|
-
const layoutApiNames = keys$
|
|
25570
|
+
const layoutApiNames = keys$b(layouts);
|
|
25571
25571
|
for (let a = 0, len = layoutApiNames.length; a < len; a += 1) {
|
|
25572
25572
|
const apiName = layoutApiNames[a];
|
|
25573
25573
|
const apiNameData = layouts[apiName];
|
|
25574
|
-
const recordTypeIds = keys$
|
|
25574
|
+
const recordTypeIds = keys$b(apiNameData);
|
|
25575
25575
|
for (let b = 0, recordTypeIdsLen = recordTypeIds.length; b < recordTypeIdsLen; b += 1) {
|
|
25576
25576
|
const recordTypeId = recordTypeIds[b];
|
|
25577
25577
|
const recordTypeData = apiNameData[recordTypeId];
|
|
25578
|
-
const layoutTypes = keys$
|
|
25578
|
+
const layoutTypes = keys$b(recordTypeData);
|
|
25579
25579
|
for (let c = 0, layoutTypesLen = layoutTypes.length; c < layoutTypesLen; c += 1) {
|
|
25580
25580
|
const layoutType = layoutTypes[c];
|
|
25581
25581
|
const layoutTypeData = recordTypeData[layoutType];
|
|
25582
|
-
const modes = keys$
|
|
25582
|
+
const modes = keys$b(layoutTypeData);
|
|
25583
25583
|
for (let d = 0, modesLen = modes.length; d < modesLen; d += 1) {
|
|
25584
25584
|
const mode = modes[d];
|
|
25585
25585
|
const layout = layoutTypeData[mode];
|
|
@@ -25785,14 +25785,14 @@ function buildNetworkSnapshot$11(luvio, config, dispatchContext) {
|
|
|
25785
25785
|
function publishDependencies(luvio, recordIds, depKeys) {
|
|
25786
25786
|
for (let i = 0, len = recordIds.length; i < len; i += 1) {
|
|
25787
25787
|
const recordDepKey = dependencyKeyBuilder({ recordId: recordIds[i] });
|
|
25788
|
-
const dependencies = create$
|
|
25788
|
+
const dependencies = create$9(null);
|
|
25789
25789
|
for (let j = 0, len = depKeys.length; j < len; j++) {
|
|
25790
25790
|
dependencies[depKeys[j]] = true;
|
|
25791
25791
|
}
|
|
25792
25792
|
const node = luvio.getNode(recordDepKey);
|
|
25793
25793
|
if (isGraphNode(node)) {
|
|
25794
25794
|
const recordDeps = node.retrieve();
|
|
25795
|
-
assign$
|
|
25795
|
+
assign$9(dependencies, recordDeps);
|
|
25796
25796
|
}
|
|
25797
25797
|
luvio.storePublish(recordDepKey, dependencies);
|
|
25798
25798
|
}
|
|
@@ -25976,11 +25976,11 @@ const recordLayoutFragmentSelector = [
|
|
|
25976
25976
|
];
|
|
25977
25977
|
function getFieldsFromLayoutMap(layoutMap, objectInfo) {
|
|
25978
25978
|
let fields = [];
|
|
25979
|
-
const layoutTypes = keys$
|
|
25979
|
+
const layoutTypes = keys$b(layoutMap);
|
|
25980
25980
|
for (let i = 0, layoutTypesLen = layoutTypes.length; i < layoutTypesLen; i += 1) {
|
|
25981
25981
|
const layoutType = layoutTypes[i];
|
|
25982
25982
|
const modesMap = layoutMap[layoutType];
|
|
25983
|
-
const modes = keys$
|
|
25983
|
+
const modes = keys$b(modesMap);
|
|
25984
25984
|
for (let m = 0, modesLen = modes.length; m < modesLen; m += 1) {
|
|
25985
25985
|
const mode = modes[m];
|
|
25986
25986
|
const modeKeys = getQualifiedFieldApiNamesFromLayout(modesMap[mode], objectInfo);
|
|
@@ -26009,7 +26009,7 @@ function getRecordForLayoutableEntities(luvio, refresh, recordId, layoutMap, obj
|
|
|
26009
26009
|
return getRecord$1(luvio, refresh, recordId, [], implicitFields);
|
|
26010
26010
|
}
|
|
26011
26011
|
function getRecordForNonLayoutableEntities(luvio, adapterContext, refresh, recordId, objectInfo, configOptionalFields, configFields) {
|
|
26012
|
-
const fields = keys$
|
|
26012
|
+
const fields = keys$b(configFields ? configFields : {}).map((key) => `${objectInfo.apiName}.${key}`);
|
|
26013
26013
|
// W-12697744
|
|
26014
26014
|
// Set the implicit fields received from the server in adapter context
|
|
26015
26015
|
// This ensures that the implicit fields are available when data is read locally or from durable store
|
|
@@ -26248,7 +26248,7 @@ function makeRecordLayoutMap(luvio, config, apiName, recordTypeId, layoutTypes,
|
|
|
26248
26248
|
}
|
|
26249
26249
|
const { layoutType, mode, snapshot } = container;
|
|
26250
26250
|
if (wrapper.layoutMap[layoutType] === undefined) {
|
|
26251
|
-
wrapper.layoutMap = assign$
|
|
26251
|
+
wrapper.layoutMap = assign$9({}, wrapper.layoutMap, {
|
|
26252
26252
|
[layoutType]: {},
|
|
26253
26253
|
});
|
|
26254
26254
|
}
|
|
@@ -35567,7 +35567,7 @@ function typeCheckConfig$u(untrustedConfig) {
|
|
|
35567
35567
|
}
|
|
35568
35568
|
}
|
|
35569
35569
|
if (records.length > 0) {
|
|
35570
|
-
assign$
|
|
35570
|
+
assign$9(config, { records });
|
|
35571
35571
|
}
|
|
35572
35572
|
}
|
|
35573
35573
|
return config;
|
|
@@ -40709,7 +40709,7 @@ function optimisticUpdate(cachedLayoutUserState, layoutUserStateInput) {
|
|
|
40709
40709
|
let clonedLayoutUserStateSections;
|
|
40710
40710
|
const { sectionUserStates } = layoutUserStateInput;
|
|
40711
40711
|
const { sectionUserStates: cachedSectionUserStates } = cachedLayoutUserState;
|
|
40712
|
-
const sectionUserStateKeys = keys$
|
|
40712
|
+
const sectionUserStateKeys = keys$b(sectionUserStates);
|
|
40713
40713
|
for (let i = 0, len = sectionUserStateKeys.length; i < len; i += 1) {
|
|
40714
40714
|
const sectionId = sectionUserStateKeys[i];
|
|
40715
40715
|
if (cachedSectionUserStates[sectionId] === undefined) {
|
|
@@ -44238,7 +44238,7 @@ withDefaultLuvio((luvio) => {
|
|
|
44238
44238
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
44239
44239
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
44240
44240
|
});
|
|
44241
|
-
// version: 1.
|
|
44241
|
+
// version: 1.297.0-e0cfbd880
|
|
44242
44242
|
|
|
44243
44243
|
var ldsIdempotencyWriteDisabled = {
|
|
44244
44244
|
isOpen: function (e) {
|
|
@@ -44414,7 +44414,7 @@ var graphqlL2AdapterGate = {
|
|
|
44414
44414
|
const { parse: parse$6, stringify: stringify$6 } = JSON;
|
|
44415
44415
|
const { join: join$2, push: push$2, unshift } = Array.prototype;
|
|
44416
44416
|
const { isArray: isArray$5 } = Array;
|
|
44417
|
-
const { entries: entries$
|
|
44417
|
+
const { entries: entries$6, keys: keys$9 } = Object;
|
|
44418
44418
|
|
|
44419
44419
|
const UI_API_BASE_URI = '/services/data/v62.0/ui-api';
|
|
44420
44420
|
|
|
@@ -44479,7 +44479,7 @@ function isSpanningRecord$1(fieldValue) {
|
|
|
44479
44479
|
function mergeRecordFields$1(first, second) {
|
|
44480
44480
|
const { fields: targetFields } = first;
|
|
44481
44481
|
const { fields: sourceFields } = second;
|
|
44482
|
-
const fieldNames = keys$
|
|
44482
|
+
const fieldNames = keys$9(sourceFields);
|
|
44483
44483
|
for (let i = 0, len = fieldNames.length; i < len; i += 1) {
|
|
44484
44484
|
const fieldName = fieldNames[i];
|
|
44485
44485
|
const sourceField = sourceFields[fieldName];
|
|
@@ -44721,7 +44721,7 @@ function getFulfillingRequest(inflightRequests, resourceRequest) {
|
|
|
44721
44721
|
if (fulfill === undefined) {
|
|
44722
44722
|
return null;
|
|
44723
44723
|
}
|
|
44724
|
-
const handlersMap = entries$
|
|
44724
|
+
const handlersMap = entries$6(inflightRequests);
|
|
44725
44725
|
for (let i = 0, len = handlersMap.length; i < len; i += 1) {
|
|
44726
44726
|
const [transactionKey, handlers] = handlersMap[i];
|
|
44727
44727
|
// check fulfillment against only the first handler ([0]) because it's equal or
|
|
@@ -44886,7 +44886,7 @@ const RedirectDurableSegment = 'REDIRECT_KEYS';
|
|
|
44886
44886
|
const MessagingDurableSegment = 'MESSAGING';
|
|
44887
44887
|
const MessageNotifyStoreUpdateAvailable = 'notifyStoreUpdateAvailable';
|
|
44888
44888
|
|
|
44889
|
-
const { keys: keys$
|
|
44889
|
+
const { keys: keys$8, create: create$7, assign: assign$7, freeze: freeze$2$1 } = Object;
|
|
44890
44890
|
|
|
44891
44891
|
//Durable store error instrumentation key
|
|
44892
44892
|
const DURABLE_STORE_ERROR = 'durable-store-error';
|
|
@@ -44933,7 +44933,7 @@ function publishDurableStoreEntries(durableRecords, put, publishMetadata) {
|
|
|
44933
44933
|
if (durableRecords === undefined) {
|
|
44934
44934
|
return { revivedKeys, hadUnexpectedShape };
|
|
44935
44935
|
}
|
|
44936
|
-
const durableKeys = keys$
|
|
44936
|
+
const durableKeys = keys$8(durableRecords);
|
|
44937
44937
|
if (durableKeys.length === 0) {
|
|
44938
44938
|
// no records to revive
|
|
44939
44939
|
return { revivedKeys, hadUnexpectedShape };
|
|
@@ -45118,7 +45118,7 @@ class DurableTTLStore {
|
|
|
45118
45118
|
overrides,
|
|
45119
45119
|
};
|
|
45120
45120
|
}
|
|
45121
|
-
const keys$1 = keys$
|
|
45121
|
+
const keys$1 = keys$8(entries);
|
|
45122
45122
|
for (let i = 0, len = keys$1.length; i < len; i++) {
|
|
45123
45123
|
const key = keys$1[i];
|
|
45124
45124
|
const entry = entries[key];
|
|
@@ -45140,14 +45140,14 @@ class DurableTTLStore {
|
|
|
45140
45140
|
}
|
|
45141
45141
|
|
|
45142
45142
|
function flushInMemoryStoreValuesToDurableStore(store, durableStore, durableStoreErrorHandler, redirects, additionalDurableStoreOperations = [], enableDurableMetadataRefresh = false) {
|
|
45143
|
-
const durableRecords = create$
|
|
45144
|
-
const refreshedDurableRecords = create$
|
|
45145
|
-
const evictedRecords = create$
|
|
45143
|
+
const durableRecords = create$7(null);
|
|
45144
|
+
const refreshedDurableRecords = create$7(null);
|
|
45145
|
+
const evictedRecords = create$7(null);
|
|
45146
45146
|
const { visitedIds, refreshedIds } = store.fallbackStringKeyInMemoryStore;
|
|
45147
45147
|
// TODO: W-8909393 Once metadata is stored in its own segment we need to
|
|
45148
45148
|
// call setEntries for the visitedIds on default segment and call setEntries
|
|
45149
45149
|
// on the metadata segment for the refreshedIds
|
|
45150
|
-
const keys$1 = keys$
|
|
45150
|
+
const keys$1 = keys$8({ ...visitedIds, ...refreshedIds });
|
|
45151
45151
|
for (let i = 0, len = keys$1.length; i < len; i += 1) {
|
|
45152
45152
|
const key = keys$1[i];
|
|
45153
45153
|
const canonicalKey = store.getCanonicalRecordId(key);
|
|
@@ -45170,7 +45170,7 @@ function flushInMemoryStoreValuesToDurableStore(store, durableStore, durableStor
|
|
|
45170
45170
|
setRecordTo(entries, key, record, metadata);
|
|
45171
45171
|
}
|
|
45172
45172
|
const durableStoreOperations = additionalDurableStoreOperations;
|
|
45173
|
-
const recordKeys = keys$
|
|
45173
|
+
const recordKeys = keys$8(durableRecords);
|
|
45174
45174
|
if (recordKeys.length > 0) {
|
|
45175
45175
|
// publishes with data
|
|
45176
45176
|
durableStoreOperations.push({
|
|
@@ -45179,7 +45179,7 @@ function flushInMemoryStoreValuesToDurableStore(store, durableStore, durableStor
|
|
|
45179
45179
|
segment: DefaultDurableSegment,
|
|
45180
45180
|
});
|
|
45181
45181
|
}
|
|
45182
|
-
const refreshKeys = keys$
|
|
45182
|
+
const refreshKeys = keys$8(refreshedDurableRecords);
|
|
45183
45183
|
if (refreshKeys.length > 0) {
|
|
45184
45184
|
// publishes with only metadata updates
|
|
45185
45185
|
durableStoreOperations.push({
|
|
@@ -45201,7 +45201,7 @@ function flushInMemoryStoreValuesToDurableStore(store, durableStore, durableStor
|
|
|
45201
45201
|
});
|
|
45202
45202
|
});
|
|
45203
45203
|
// evicts
|
|
45204
|
-
const evictedKeys = keys$
|
|
45204
|
+
const evictedKeys = keys$8(evictedRecords);
|
|
45205
45205
|
if (evictedKeys.length > 0) {
|
|
45206
45206
|
durableStoreOperations.push({
|
|
45207
45207
|
type: 'evictEntries',
|
|
@@ -45305,7 +45305,7 @@ function buildRevivingStagingStore(upstreamStore) {
|
|
|
45305
45305
|
// A reviving store is only "active" during a call to `environment.storeLookup`, and will
|
|
45306
45306
|
// be used by the reader attempting to build an L1 snapshot. Immediately after the L1 rebuild
|
|
45307
45307
|
// the reviving store becomes inactive other than receiving change notifications.
|
|
45308
|
-
return create$
|
|
45308
|
+
return create$7(upstreamStore, {
|
|
45309
45309
|
readEntry: { value: readEntry },
|
|
45310
45310
|
markStale: { value: markStale },
|
|
45311
45311
|
clearStale: { value: clearStale },
|
|
@@ -45317,7 +45317,7 @@ const AdapterContextSegment = 'ADAPTER-CONTEXT';
|
|
|
45317
45317
|
const ADAPTER_CONTEXT_ID_SUFFIX = '__NAMED_CONTEXT';
|
|
45318
45318
|
async function reviveOrCreateContext(adapterId, durableStore, durableStoreErrorHandler, contextStores, pendingContextStoreKeys, onContextLoaded) {
|
|
45319
45319
|
// initialize empty context store
|
|
45320
|
-
contextStores[adapterId] = create$
|
|
45320
|
+
contextStores[adapterId] = create$7(null);
|
|
45321
45321
|
const context = {
|
|
45322
45322
|
set(key, value) {
|
|
45323
45323
|
contextStores[adapterId][key] = value;
|
|
@@ -45382,7 +45382,7 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
|
|
|
45382
45382
|
const revivingStores = new Set();
|
|
45383
45383
|
// redirects that need to be flushed to the durable store
|
|
45384
45384
|
const pendingStoreRedirects = new Map();
|
|
45385
|
-
const contextStores = create$
|
|
45385
|
+
const contextStores = create$7(null);
|
|
45386
45386
|
let initializationPromise = new Promise((resolve) => {
|
|
45387
45387
|
const finish = () => {
|
|
45388
45388
|
resolve();
|
|
@@ -45459,7 +45459,7 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
|
|
|
45459
45459
|
try {
|
|
45460
45460
|
const entries = await durableStore.getEntries(adapterContextKeysFromDifferentInstance, AdapterContextSegment);
|
|
45461
45461
|
if (entries !== undefined) {
|
|
45462
|
-
const entryKeys = keys$
|
|
45462
|
+
const entryKeys = keys$8(entries);
|
|
45463
45463
|
for (let i = 0, len = entryKeys.length; i < len; i++) {
|
|
45464
45464
|
const entryKey = entryKeys[i];
|
|
45465
45465
|
const entry = entries[entryKey];
|
|
@@ -45494,7 +45494,7 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
|
|
|
45494
45494
|
if (filteredKeys.length > 0) {
|
|
45495
45495
|
const entries = await durableStore.getMetadata(filteredKeys, DefaultDurableSegment);
|
|
45496
45496
|
if (entries !== undefined) {
|
|
45497
|
-
const entryKeys = keys$
|
|
45497
|
+
const entryKeys = keys$8(entries);
|
|
45498
45498
|
for (let i = 0, len = entryKeys.length; i < len; i++) {
|
|
45499
45499
|
const entryKey = entryKeys[i];
|
|
45500
45500
|
const { metadata } = entries[entryKey];
|
|
@@ -45866,7 +45866,7 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
|
|
|
45866
45866
|
validateNotDisposed();
|
|
45867
45867
|
const entryKeys = keys$1.map(serializeStructuredKey);
|
|
45868
45868
|
const entries = await durableStore.getEntries(entryKeys, DefaultDurableSegment);
|
|
45869
|
-
if (entries === undefined || keys$
|
|
45869
|
+
if (entries === undefined || keys$8(entries).length === 0) {
|
|
45870
45870
|
return environment.notifyStoreUpdateAvailable(keys$1);
|
|
45871
45871
|
}
|
|
45872
45872
|
const now = Date.now();
|
|
@@ -45918,7 +45918,7 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
|
|
|
45918
45918
|
type: 'stale-while-revalidate',
|
|
45919
45919
|
staleDurationSeconds: Number.MAX_SAFE_INTEGER,
|
|
45920
45920
|
});
|
|
45921
|
-
return create$
|
|
45921
|
+
return create$7(environment, {
|
|
45922
45922
|
publishStoreMetadata: { value: publishStoreMetadata },
|
|
45923
45923
|
storeIngest: { value: storeIngest },
|
|
45924
45924
|
storeIngestError: { value: storeIngestError },
|
|
@@ -45954,14 +45954,10 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
|
|
|
45954
45954
|
* For full license text, see the LICENSE.txt file
|
|
45955
45955
|
*/
|
|
45956
45956
|
|
|
45957
|
-
|
|
45958
|
-
function isStoreKeyRecordId(key) {
|
|
45959
|
-
return key.indexOf(RECORD_ID_PREFIX$1) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION$1) === -1;
|
|
45960
|
-
}
|
|
45961
45957
|
function isStoreKeyRecordField(key) {
|
|
45962
45958
|
return key.indexOf(RECORD_ID_PREFIX$1) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION$1) > -1;
|
|
45963
45959
|
}
|
|
45964
|
-
function buildRecordFieldStoreKey(recordKey, fieldName) {
|
|
45960
|
+
function buildRecordFieldStoreKey$1(recordKey, fieldName) {
|
|
45965
45961
|
return `${recordKey}${RECORD_FIELDS_KEY_JUNCTION$1}${fieldName}`;
|
|
45966
45962
|
}
|
|
45967
45963
|
function objectsDeepEqual(lhs, rhs) {
|
|
@@ -45988,15 +45984,6 @@ function objectsDeepEqual(lhs, rhs) {
|
|
|
45988
45984
|
return true;
|
|
45989
45985
|
}
|
|
45990
45986
|
|
|
45991
|
-
function isStoreRecordError(storeRecord) {
|
|
45992
|
-
return storeRecord.__type === 'error';
|
|
45993
|
-
}
|
|
45994
|
-
function isEntryDurableRecordRepresentation(entry, key) {
|
|
45995
|
-
// Either a DurableRecordRepresentation or StoreRecordError can live at a record key
|
|
45996
|
-
return ((isStoreKeyRecordId(key) || isStoreKeyRecordViewEntity$1(key)) &&
|
|
45997
|
-
entry.data.__type === undefined);
|
|
45998
|
-
}
|
|
45999
|
-
|
|
46000
45987
|
/**
|
|
46001
45988
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
46002
45989
|
* All rights reserved.
|
|
@@ -46382,7 +46369,7 @@ function isFailure(result) {
|
|
|
46382
46369
|
function errors(result) {
|
|
46383
46370
|
return result.error;
|
|
46384
46371
|
}
|
|
46385
|
-
function values$
|
|
46372
|
+
function values$5(result) {
|
|
46386
46373
|
return result.value;
|
|
46387
46374
|
}
|
|
46388
46375
|
function flattenResults(results) {
|
|
@@ -46390,7 +46377,7 @@ function flattenResults(results) {
|
|
|
46390
46377
|
if (fails.length > 0) {
|
|
46391
46378
|
return failure(fails);
|
|
46392
46379
|
}
|
|
46393
|
-
return success(results.filter(isSuccess).map(values$
|
|
46380
|
+
return success(results.filter(isSuccess).map(values$5));
|
|
46394
46381
|
}
|
|
46395
46382
|
|
|
46396
46383
|
function getFieldInfo(apiName, fieldName, infoMap) {
|
|
@@ -47207,7 +47194,7 @@ function compoundOperatorToSql(operator) {
|
|
|
47207
47194
|
}
|
|
47208
47195
|
|
|
47209
47196
|
const { isArray: isArray$4 } = Array;
|
|
47210
|
-
const { keys: keys$
|
|
47197
|
+
const { keys: keys$7 } = Object;
|
|
47211
47198
|
|
|
47212
47199
|
function isListValueNode(node) {
|
|
47213
47200
|
return node.kind === 'ListValue';
|
|
@@ -47275,7 +47262,7 @@ function fieldsToFilters(fieldValues, joinAlias, apiName, input, compoundOperato
|
|
|
47275
47262
|
if (failures.length > 0) {
|
|
47276
47263
|
return failure(failures);
|
|
47277
47264
|
}
|
|
47278
|
-
const containers = results.filter(isSuccess).map(values$
|
|
47265
|
+
const containers = results.filter(isSuccess).map(values$5);
|
|
47279
47266
|
const predicates = [];
|
|
47280
47267
|
containers.forEach((c) => {
|
|
47281
47268
|
if (c.predicate !== undefined) {
|
|
@@ -47567,7 +47554,7 @@ function dateFunctions(operatorNode, extract, dataType) {
|
|
|
47567
47554
|
if (fails.length > 0) {
|
|
47568
47555
|
return failure(fails);
|
|
47569
47556
|
}
|
|
47570
|
-
const vals = results.filter(isSuccess).reduce(flatMap$1(values$
|
|
47557
|
+
const vals = results.filter(isSuccess).reduce(flatMap$1(values$5), []);
|
|
47571
47558
|
return success(vals);
|
|
47572
47559
|
}
|
|
47573
47560
|
function isFilterFunction(name) {
|
|
@@ -47577,7 +47564,7 @@ function fieldOperators(operatorNode, dataType) {
|
|
|
47577
47564
|
const results = Object.entries(operatorNode.fields)
|
|
47578
47565
|
.filter(([key, _]) => isFilterFunction(key) === false)
|
|
47579
47566
|
.map(([key, value]) => operatorWithValue(key, value, dataType));
|
|
47580
|
-
const _values = results.filter(isSuccess).map(values$
|
|
47567
|
+
const _values = results.filter(isSuccess).map(values$5);
|
|
47581
47568
|
const fails = results.filter(isFailure).reduce(flatMap$1(errors), []);
|
|
47582
47569
|
if (fails.length > 0) {
|
|
47583
47570
|
return failure(fails);
|
|
@@ -48498,7 +48485,7 @@ function selectionToQueryField(node, names, parentApiName, parentAlias, input, j
|
|
|
48498
48485
|
}
|
|
48499
48486
|
function recordFields(luvioSelections, names, parentApiName, parentAlias, input, joins) {
|
|
48500
48487
|
const results = luvioSelections.map((selection) => selectionToQueryField(selection, names, parentApiName, parentAlias, input, joins));
|
|
48501
|
-
const fields = results.filter(isSuccess).reduce(flatMap$1(values$
|
|
48488
|
+
const fields = results.filter(isSuccess).reduce(flatMap$1(values$5), []);
|
|
48502
48489
|
const fails = results.filter(isFailure).reduce(flatMap$1(errors), []);
|
|
48503
48490
|
if (fails.length > 0) {
|
|
48504
48491
|
return failure(fails);
|
|
@@ -48746,7 +48733,7 @@ function rootRecordQuery(selection, input) {
|
|
|
48746
48733
|
}
|
|
48747
48734
|
function rootQuery(recordNodes, input) {
|
|
48748
48735
|
const results = recordNodes.map((record) => rootRecordQuery(record, input));
|
|
48749
|
-
const connections = results.filter(isSuccess).map(values$
|
|
48736
|
+
const connections = results.filter(isSuccess).map(values$5);
|
|
48750
48737
|
const fails = results.filter(isFailure).reduce(flatMap$1(errors), []);
|
|
48751
48738
|
if (fails.length > 0) {
|
|
48752
48739
|
return failure(fails);
|
|
@@ -48842,7 +48829,7 @@ function generateVariableSubQuery(valueNode, name, type, variables) {
|
|
|
48842
48829
|
switch (valueNode.kind) {
|
|
48843
48830
|
case Kind$1.OBJECT: {
|
|
48844
48831
|
// For example, `{ Id: { eq: $draftId } }` is a `ObjectValueNode`, which has field keys 'Id'
|
|
48845
|
-
const resultQuery = keys$
|
|
48832
|
+
const resultQuery = keys$7(valueNode.fields)
|
|
48846
48833
|
.map((key) => generateVariableSubQuery(valueNode.fields[key], key, type, variables))
|
|
48847
48834
|
.filter((subquery) => subquery.length > 0)
|
|
48848
48835
|
.join(',');
|
|
@@ -48918,7 +48905,7 @@ function swapArgumentWithVariableNodes(swapped, original) {
|
|
|
48918
48905
|
}
|
|
48919
48906
|
function swapValueNodeWithVariableNodes(original, swapped) {
|
|
48920
48907
|
if (original.kind === Kind$1.OBJECT) {
|
|
48921
|
-
for (const key of keys$
|
|
48908
|
+
for (const key of keys$7(original.fields)) {
|
|
48922
48909
|
if (isObjectValueNode$1(swapped) && swapped.fields[key]) {
|
|
48923
48910
|
if (is(original.fields[key], 'Variable')) {
|
|
48924
48911
|
original.fields[key] = swapped.fields[key];
|
|
@@ -49527,7 +49514,7 @@ function createDraftSynthesisErrorResponse(message = 'failed to synthesize draft
|
|
|
49527
49514
|
return new DraftErrorFetchResponse(HttpStatusCode$1.BadRequest, error);
|
|
49528
49515
|
}
|
|
49529
49516
|
|
|
49530
|
-
const { keys: keys$
|
|
49517
|
+
const { keys: keys$6, create: create$6, assign: assign$6, values: values$4 } = Object;
|
|
49531
49518
|
const { stringify: stringify$5, parse: parse$5 } = JSON;
|
|
49532
49519
|
const { isArray: isArray$3$1 } = Array;
|
|
49533
49520
|
|
|
@@ -49637,13 +49624,13 @@ function buildLuvioOverrideForDraftAdapters(luvio, handler, extractTargetIdFromC
|
|
|
49637
49624
|
}
|
|
49638
49625
|
softEvict(key);
|
|
49639
49626
|
};
|
|
49640
|
-
return create$
|
|
49627
|
+
return create$6(luvio, {
|
|
49641
49628
|
dispatchResourceRequest: { value: dispatchResourceRequest },
|
|
49642
49629
|
publishStoreMetadata: { value: publishStoreMetadata },
|
|
49643
49630
|
storeEvict: { value: storeEvict },
|
|
49644
49631
|
});
|
|
49645
49632
|
}
|
|
49646
|
-
return create$
|
|
49633
|
+
return create$6(luvio, {
|
|
49647
49634
|
dispatchResourceRequest: { value: dispatchResourceRequest },
|
|
49648
49635
|
publishStoreMetadata: { value: publishStoreMetadata },
|
|
49649
49636
|
});
|
|
@@ -49677,7 +49664,7 @@ async function getDraftIdMappings(durableStore, mappingIds) {
|
|
|
49677
49664
|
if (entries === undefined) {
|
|
49678
49665
|
return mappings;
|
|
49679
49666
|
}
|
|
49680
|
-
const keys$1 = keys$
|
|
49667
|
+
const keys$1 = keys$6(entries);
|
|
49681
49668
|
for (const key of keys$1) {
|
|
49682
49669
|
const entry = entries[key].data;
|
|
49683
49670
|
if (isLegacyDraftIdMapping(key)) {
|
|
@@ -49695,7 +49682,7 @@ async function getDraftIdMappings(durableStore, mappingIds) {
|
|
|
49695
49682
|
async function clearDraftIdSegment(durableStore) {
|
|
49696
49683
|
const entries = await durableStore.getAllEntries(DRAFT_ID_MAPPINGS_SEGMENT);
|
|
49697
49684
|
if (entries) {
|
|
49698
|
-
const keys$1 = keys$
|
|
49685
|
+
const keys$1 = keys$6(entries);
|
|
49699
49686
|
if (keys$1.length > 0) {
|
|
49700
49687
|
await durableStore.evictEntries(keys$1, DRAFT_ID_MAPPINGS_SEGMENT);
|
|
49701
49688
|
}
|
|
@@ -49954,7 +49941,7 @@ class DurableDraftQueue {
|
|
|
49954
49941
|
const queueOperations = handler.getQueueOperationsForCompletingDrafts(queue, action);
|
|
49955
49942
|
// write the queue operations to the store prior to ingesting the result
|
|
49956
49943
|
await this.draftStore.completeAction(queueOperations);
|
|
49957
|
-
await handler.handleActionCompleted(action, queueOperations, values$
|
|
49944
|
+
await handler.handleActionCompleted(action, queueOperations, values$4(this.handlers));
|
|
49958
49945
|
this.retryIntervalMilliseconds = 0;
|
|
49959
49946
|
this.uploadingActionId = undefined;
|
|
49960
49947
|
await this.notifyChangedListeners({
|
|
@@ -50106,7 +50093,7 @@ class DurableDraftQueue {
|
|
|
50106
50093
|
return this.replaceOrMergeActions(targetActionId, sourceActionId, true);
|
|
50107
50094
|
}
|
|
50108
50095
|
async setMetadata(actionId, metadata) {
|
|
50109
|
-
const keys$1 = keys$
|
|
50096
|
+
const keys$1 = keys$6(metadata);
|
|
50110
50097
|
const compatibleKeys = keys$1.filter((key) => {
|
|
50111
50098
|
const value = metadata[key];
|
|
50112
50099
|
return typeof key === 'string' && typeof value === 'string';
|
|
@@ -50261,7 +50248,7 @@ class DurableDraftStore {
|
|
|
50261
50248
|
const waitForOngoingSync = this.syncPromise || Promise.resolve();
|
|
50262
50249
|
return waitForOngoingSync.then(() => {
|
|
50263
50250
|
const { draftStore } = this;
|
|
50264
|
-
const keys$1 = keys$
|
|
50251
|
+
const keys$1 = keys$6(draftStore);
|
|
50265
50252
|
const actionArray = [];
|
|
50266
50253
|
for (let i = 0, len = keys$1.length; i < len; i++) {
|
|
50267
50254
|
const key = keys$1[i];
|
|
@@ -50285,7 +50272,7 @@ class DurableDraftStore {
|
|
|
50285
50272
|
deleteByTag(tag) {
|
|
50286
50273
|
const deleteAction = () => {
|
|
50287
50274
|
const { draftStore } = this;
|
|
50288
|
-
const keys$1 = keys$
|
|
50275
|
+
const keys$1 = keys$6(draftStore);
|
|
50289
50276
|
const durableKeys = [];
|
|
50290
50277
|
for (let i = 0, len = keys$1.length; i < len; i++) {
|
|
50291
50278
|
const key = keys$1[i];
|
|
@@ -50375,7 +50362,7 @@ class DurableDraftStore {
|
|
|
50375
50362
|
return this.runQueuedOperations();
|
|
50376
50363
|
}
|
|
50377
50364
|
const { draftStore } = this;
|
|
50378
|
-
const keys$1 = keys$
|
|
50365
|
+
const keys$1 = keys$6(durableEntries);
|
|
50379
50366
|
for (let i = 0, len = keys$1.length; i < len; i++) {
|
|
50380
50367
|
const entry = durableEntries[keys$1[i]];
|
|
50381
50368
|
const action = entry.data;
|
|
@@ -51249,7 +51236,7 @@ function makeEnvironmentDraftAware(luvio, env, durableStore, handlers, draftQueu
|
|
|
51249
51236
|
decrementRefCount(key);
|
|
51250
51237
|
};
|
|
51251
51238
|
// note the makeEnvironmentUiApiRecordDraftAware will eventually go away once the adapters become draft aware
|
|
51252
|
-
return create$
|
|
51239
|
+
return create$6(env, {
|
|
51253
51240
|
storePublish: { value: storePublish },
|
|
51254
51241
|
handleSuccessResponse: { value: handleSuccessResponse },
|
|
51255
51242
|
softEvict: { value: softEvict },
|
|
@@ -51263,7 +51250,7 @@ function makeEnvironmentDraftAware(luvio, env, durableStore, handlers, draftQueu
|
|
|
51263
51250
|
*/
|
|
51264
51251
|
|
|
51265
51252
|
|
|
51266
|
-
const { keys: keys$
|
|
51253
|
+
const { keys: keys$5, values: values$3, create: create$5, assign: assign$5, freeze: freeze$1$1, entries: entries$5 } = Object;
|
|
51267
51254
|
const { stringify: stringify$4, parse: parse$4 } = JSON;
|
|
51268
51255
|
const { shift } = Array.prototype;
|
|
51269
51256
|
const { isArray: isArray$2$1, from: from$2 } = Array;
|
|
@@ -51330,7 +51317,7 @@ function getRecordKeyForId(luvio, recordId) {
|
|
|
51330
51317
|
*/
|
|
51331
51318
|
function filterOutReferenceFieldsAndLinks(record) {
|
|
51332
51319
|
const filteredFields = {};
|
|
51333
|
-
const fieldNames = keys$
|
|
51320
|
+
const fieldNames = keys$5(record.fields);
|
|
51334
51321
|
for (const fieldName of fieldNames) {
|
|
51335
51322
|
const field = record.fields[fieldName];
|
|
51336
51323
|
if (isFieldLink(field) === false) {
|
|
@@ -51431,7 +51418,7 @@ function getRecordDraftEnvironment(luvio, env, { isDraftId, durableStore }) {
|
|
|
51431
51418
|
const resolvedRequest = resolveResourceRequestIds(luvio, resourceRequest, canonicalKey);
|
|
51432
51419
|
return env.dispatchResourceRequest(resolvedRequest, context, eventObservers);
|
|
51433
51420
|
};
|
|
51434
|
-
return create$
|
|
51421
|
+
return create$5(env, {
|
|
51435
51422
|
dispatchResourceRequest: { value: dispatchResourceRequest },
|
|
51436
51423
|
});
|
|
51437
51424
|
}
|
|
@@ -51609,7 +51596,7 @@ function getRecordsDraftEnvironment(luvio, env, { isDraftId }) {
|
|
|
51609
51596
|
return applyDraftsToBatchResponse(resourceRequest, response, removedDraftIds);
|
|
51610
51597
|
}));
|
|
51611
51598
|
};
|
|
51612
|
-
return create$
|
|
51599
|
+
return create$5(env, {
|
|
51613
51600
|
dispatchResourceRequest: { value: dispatchResourceRequest },
|
|
51614
51601
|
});
|
|
51615
51602
|
}
|
|
@@ -51619,7 +51606,7 @@ function makeEnvironmentUiApiRecordDraftAware(luvio, options, env) {
|
|
|
51619
51606
|
const adapterSpecificEnvironments = synthesizers.reduce((environment, synthesizer) => {
|
|
51620
51607
|
return synthesizer(luvio, environment, options);
|
|
51621
51608
|
}, env);
|
|
51622
|
-
return create$
|
|
51609
|
+
return create$5(adapterSpecificEnvironments, {});
|
|
51623
51610
|
}
|
|
51624
51611
|
|
|
51625
51612
|
function clone(obj) {
|
|
@@ -51713,7 +51700,7 @@ function compoundNameFieldFromDraftUpdates(record, draftFields, apiName, objectI
|
|
|
51713
51700
|
changedNameFields[fieldName] = fieldValue;
|
|
51714
51701
|
}
|
|
51715
51702
|
}
|
|
51716
|
-
if (keys$
|
|
51703
|
+
if (keys$5(changedNameFields).length > 0) {
|
|
51717
51704
|
const newNameValue = filteredNameFields
|
|
51718
51705
|
.map((key) => {
|
|
51719
51706
|
if (changedNameFields[key] !== undefined) {
|
|
@@ -51796,7 +51783,7 @@ function recursivelyApplyDraftsToRecord(record, draftMetadata, recordOperations)
|
|
|
51796
51783
|
const injectedCompoundNameField = compoundNameFieldFromDraftUpdates(record, draftOperationFields, apiName, objectInfos);
|
|
51797
51784
|
// inject the compound Name field into the DraftOperation so on broadcast it doesnt try to
|
|
51798
51785
|
// synthesize the Name field a second time when the durable store change notifier is triggered
|
|
51799
|
-
if (keys$
|
|
51786
|
+
if (keys$5(injectedCompoundNameField).length > 0 && draftActionType === 'update') {
|
|
51800
51787
|
draftOperation.fields['Name'] = injectedCompoundNameField['Name'];
|
|
51801
51788
|
}
|
|
51802
51789
|
const fields = { ...draftOperationFields, ...injectedCompoundNameField };
|
|
@@ -51807,7 +51794,7 @@ function recursivelyApplyDraftsToRecord(record, draftMetadata, recordOperations)
|
|
|
51807
51794
|
LastModifiedDate: lastModifiedDate,
|
|
51808
51795
|
};
|
|
51809
51796
|
const draftFields = buildRecordFieldValueRepresentationsFromDraftFields(luvio, apiName, internalFields, objectInfos, referencedRecords, formatDisplayValue);
|
|
51810
|
-
const fieldNames = keys$
|
|
51797
|
+
const fieldNames = keys$5(draftFields);
|
|
51811
51798
|
for (let i = 0, len = fieldNames.length; i < len; i++) {
|
|
51812
51799
|
const fieldName = fieldNames[i];
|
|
51813
51800
|
// don't apply server values to draft created records
|
|
@@ -51868,7 +51855,7 @@ function removeDrafts(record, luvio, objectInfo) {
|
|
|
51868
51855
|
return undefined;
|
|
51869
51856
|
}
|
|
51870
51857
|
const updatedFields = {};
|
|
51871
|
-
const fieldNames = keys$
|
|
51858
|
+
const fieldNames = keys$5(fields);
|
|
51872
51859
|
for (let i = 0, len = fieldNames.length; i < len; i++) {
|
|
51873
51860
|
const fieldName = fieldNames[i];
|
|
51874
51861
|
const field = fields[fieldName];
|
|
@@ -51915,7 +51902,7 @@ function removeDrafts(record, luvio, objectInfo) {
|
|
|
51915
51902
|
* @param fields List of draft record fields
|
|
51916
51903
|
*/
|
|
51917
51904
|
function buildRecordFieldValueRepresentationsFromDraftFields(luvio, apiName, fields, objectInfos, referencedRecords, formatDisplayValue) {
|
|
51918
|
-
const fieldNames = keys$
|
|
51905
|
+
const fieldNames = keys$5(fields);
|
|
51919
51906
|
const recordFields = {};
|
|
51920
51907
|
const objectInfo = objectInfos.get(apiName);
|
|
51921
51908
|
for (let i = 0, len = fieldNames.length; i < len; i++) {
|
|
@@ -51983,7 +51970,7 @@ function buildSyntheticRecordRepresentation(luvio, createOperation, userId, obje
|
|
|
51983
51970
|
draftFields[DEFAULT_FIELD_LAST_MODIFIED_DATE] = { value: timestampString, displayValue: null };
|
|
51984
51971
|
draftFields[DEFAULT_FIELD_OWNER_ID] = { value: userId, displayValue: null };
|
|
51985
51972
|
draftFields[DEFAULT_FIELD_ID] = { value: recordId, displayValue: null };
|
|
51986
|
-
const allObjectFields = keys$
|
|
51973
|
+
const allObjectFields = keys$5(objectInfo.fields);
|
|
51987
51974
|
allObjectFields.forEach((fieldName) => {
|
|
51988
51975
|
if (draftFields[fieldName] === undefined) {
|
|
51989
51976
|
draftFields[fieldName] = { value: null, displayValue: null };
|
|
@@ -52124,7 +52111,7 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
52124
52111
|
this.isDraftId = isDraftId;
|
|
52125
52112
|
this.recordService = recordService;
|
|
52126
52113
|
this.handlerId = LDS_ACTION_HANDLER_ID;
|
|
52127
|
-
this.collectedFields = create$
|
|
52114
|
+
this.collectedFields = create$5(null);
|
|
52128
52115
|
recordService.registerRecordHandler(this);
|
|
52129
52116
|
}
|
|
52130
52117
|
async buildPendingAction(request, queue) {
|
|
@@ -52186,7 +52173,7 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
52186
52173
|
throw Error(`Could not generate draft. Object info is missing`);
|
|
52187
52174
|
}
|
|
52188
52175
|
const appendedFields = this.getBackdatingFields(objectInfo, resolvedRequest.method, pendingAction);
|
|
52189
|
-
if (keys$
|
|
52176
|
+
if (keys$5(appendedFields).length > 0) {
|
|
52190
52177
|
pendingAction.data.body = {
|
|
52191
52178
|
...pendingAction.data.body,
|
|
52192
52179
|
fields: {
|
|
@@ -52200,7 +52187,7 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
52200
52187
|
}
|
|
52201
52188
|
getBackdatingFields(objectInfo, requestMethod, pendingAction) {
|
|
52202
52189
|
const fields = {};
|
|
52203
|
-
const actionFieldNames = keys$
|
|
52190
|
+
const actionFieldNames = keys$5(pendingAction.data.body.fields);
|
|
52204
52191
|
if (requestMethod === 'post') {
|
|
52205
52192
|
// `CreateRecord` with `CreatedDate` field
|
|
52206
52193
|
if (isBackdatingFieldEditable(objectInfo, DEFAULT_FIELD_CREATED_DATE$1, 'createable', actionFieldNames)) {
|
|
@@ -52246,7 +52233,7 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
52246
52233
|
return;
|
|
52247
52234
|
}
|
|
52248
52235
|
const objectInfo = objectInfoMap[apiName];
|
|
52249
|
-
const optionalFields = values$
|
|
52236
|
+
const optionalFields = values$3(objectInfo.fields).map((field) => `${apiName}.${field.apiName}`);
|
|
52250
52237
|
await getAdapterData(this.getRecordAdapter, {
|
|
52251
52238
|
recordId: referenceFieldInfo.id,
|
|
52252
52239
|
optionalFields,
|
|
@@ -52265,7 +52252,7 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
52265
52252
|
const referenceToInfos = fieldInfo.referenceToInfos;
|
|
52266
52253
|
const apiNames = referenceToInfos.map((referenceToInfo) => referenceToInfo.apiName);
|
|
52267
52254
|
const objectInfoMap = await this.objectInfoService.getObjectInfos(apiNames);
|
|
52268
|
-
for (const objectInfo of values$
|
|
52255
|
+
for (const objectInfo of values$3(objectInfoMap)) {
|
|
52269
52256
|
const { apiName, keyPrefix } = objectInfo;
|
|
52270
52257
|
if (keyPrefix !== null && id.startsWith(keyPrefix)) {
|
|
52271
52258
|
return apiName;
|
|
@@ -52393,17 +52380,17 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
52393
52380
|
// otherwise we're a record
|
|
52394
52381
|
if (draftMetadata === undefined) {
|
|
52395
52382
|
// no drafts applied to this record, publish and be done
|
|
52396
|
-
this.collectedFields = create$
|
|
52383
|
+
this.collectedFields = create$5(null);
|
|
52397
52384
|
return publishData(key, data);
|
|
52398
52385
|
}
|
|
52399
52386
|
// create a denormalized record with the collected fields
|
|
52400
|
-
const recordFieldNames = keys$
|
|
52387
|
+
const recordFieldNames = keys$5(data.fields);
|
|
52401
52388
|
const partialRecord = {
|
|
52402
52389
|
...data,
|
|
52403
52390
|
fields: {},
|
|
52404
52391
|
};
|
|
52405
52392
|
for (const fieldName of recordFieldNames) {
|
|
52406
|
-
const collectedField = this.collectedFields[buildRecordFieldStoreKey(key, fieldName)];
|
|
52393
|
+
const collectedField = this.collectedFields[buildRecordFieldStoreKey$1(key, fieldName)];
|
|
52407
52394
|
if (collectedField !== undefined) {
|
|
52408
52395
|
partialRecord.fields[fieldName] =
|
|
52409
52396
|
collectedField;
|
|
@@ -52419,15 +52406,15 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
52419
52406
|
lastModifiedDate: recordWithDrafts.lastModifiedDate,
|
|
52420
52407
|
lastModifiedById: recordWithDrafts.lastModifiedById,
|
|
52421
52408
|
};
|
|
52422
|
-
for (const fieldName of keys$
|
|
52423
|
-
const fieldKey = buildRecordFieldStoreKey(key, fieldName);
|
|
52409
|
+
for (const fieldName of keys$5(recordWithSpanningRefLinks.fields)) {
|
|
52410
|
+
const fieldKey = buildRecordFieldStoreKey$1(key, fieldName);
|
|
52424
52411
|
normalizedRecord.fields[fieldName] = { __ref: fieldKey };
|
|
52425
52412
|
publishData(fieldKey, recordWithSpanningRefLinks.fields[fieldName]);
|
|
52426
52413
|
}
|
|
52427
52414
|
// publish the normalized record
|
|
52428
52415
|
publishData(key, normalizedRecord);
|
|
52429
52416
|
// we've published the record, now clear the collected fields
|
|
52430
|
-
this.collectedFields = create$
|
|
52417
|
+
this.collectedFields = create$5(null);
|
|
52431
52418
|
}
|
|
52432
52419
|
updateMetadata(existingMetadata, incomingMetadata) {
|
|
52433
52420
|
// ensure the the api name cannot be overwritten in the incoming metadata
|
|
@@ -52464,7 +52451,7 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
52464
52451
|
let resolvedUrlParams = request.urlParams;
|
|
52465
52452
|
if (request.method === 'post' || request.method === 'patch') {
|
|
52466
52453
|
const bodyFields = resolvedBody.fields;
|
|
52467
|
-
const fieldNames = keys$
|
|
52454
|
+
const fieldNames = keys$5(bodyFields);
|
|
52468
52455
|
for (let i = 0, len = fieldNames.length; i < len; i++) {
|
|
52469
52456
|
const fieldName = fieldNames[i];
|
|
52470
52457
|
const fieldValue = bodyFields[fieldName];
|
|
@@ -52558,366 +52545,6 @@ function isBackdatingFieldEditable(objectInfo, backdatingFieldName, attributeNam
|
|
|
52558
52545
|
!draftActionFieldNames.includes(backdatingFieldName));
|
|
52559
52546
|
}
|
|
52560
52547
|
|
|
52561
|
-
function createLink$2(key) {
|
|
52562
|
-
return { __ref: key };
|
|
52563
|
-
}
|
|
52564
|
-
/**
|
|
52565
|
-
* Records are stored in the durable store with scalar fields denormalized. This function takes that denoramlized
|
|
52566
|
-
* durable store record representation and normalizes it back out into the format the the luvio store expects it
|
|
52567
|
-
* @param key Record store key
|
|
52568
|
-
* @param entry Durable entry containing a denormalized record representation
|
|
52569
|
-
* @returns a set of entries containing the normalized record and its normalized fields
|
|
52570
|
-
*/
|
|
52571
|
-
function normalizeRecordFields(key, entry) {
|
|
52572
|
-
const { data: record } = entry;
|
|
52573
|
-
const { fields, links } = record;
|
|
52574
|
-
const missingFieldLinks = keys$4(links);
|
|
52575
|
-
const fieldNames = keys$4(fields);
|
|
52576
|
-
const normalizedFields = {};
|
|
52577
|
-
const returnEntries = {};
|
|
52578
|
-
// restore fields
|
|
52579
|
-
for (let i = 0, len = fieldNames.length; i < len; i++) {
|
|
52580
|
-
const fieldName = fieldNames[i];
|
|
52581
|
-
const field = fields[fieldName];
|
|
52582
|
-
const fieldKey = buildRecordFieldStoreKey(key, fieldName);
|
|
52583
|
-
returnEntries[fieldKey] = { data: field };
|
|
52584
|
-
normalizedFields[fieldName] = createLink$2(fieldKey);
|
|
52585
|
-
}
|
|
52586
|
-
// restore missing fields
|
|
52587
|
-
for (let i = 0, len = missingFieldLinks.length; i < len; i++) {
|
|
52588
|
-
const fieldName = missingFieldLinks[i];
|
|
52589
|
-
const link = links[fieldName];
|
|
52590
|
-
if (link.isMissing === true) {
|
|
52591
|
-
normalizedFields[fieldName] = { ...link, __ref: undefined };
|
|
52592
|
-
}
|
|
52593
|
-
}
|
|
52594
|
-
returnEntries[key] = {
|
|
52595
|
-
data: assign$4(record, { fields: normalizedFields }),
|
|
52596
|
-
metadata: entry.metadata,
|
|
52597
|
-
};
|
|
52598
|
-
return returnEntries;
|
|
52599
|
-
}
|
|
52600
|
-
/**
|
|
52601
|
-
* Transforms a record for storage in the durable store. The transformation involves denormalizing
|
|
52602
|
-
* scalar fields and persisting link metadata to transform back into a normalized representation
|
|
52603
|
-
*
|
|
52604
|
-
* If the record contains pending fields this will return undefined as pending records do not get persisted
|
|
52605
|
-
* to the durable store. There should be a refresh operation outbound that will bring in the updated record.
|
|
52606
|
-
*
|
|
52607
|
-
* @param normalizedRecord Record containing normalized field links
|
|
52608
|
-
* @param recordStore a store containing referenced record fields
|
|
52609
|
-
*/
|
|
52610
|
-
function buildDurableRecordRepresentation(normalizedRecord, records, pendingEntries, store) {
|
|
52611
|
-
const fields = normalizedRecord.fields;
|
|
52612
|
-
const filteredFields = {};
|
|
52613
|
-
const links = {};
|
|
52614
|
-
const fieldNames = keys$4(fields);
|
|
52615
|
-
for (let i = 0, len = fieldNames.length; i < len; i++) {
|
|
52616
|
-
const fieldName = fieldNames[i];
|
|
52617
|
-
const field = fields[fieldName];
|
|
52618
|
-
// pending fields get filtered out of the durable store
|
|
52619
|
-
const { pending } = field;
|
|
52620
|
-
if (pending === true) {
|
|
52621
|
-
// do not write records with pending fields to the durable store
|
|
52622
|
-
// there should be a refresh operation outbound that will bring in the updated record
|
|
52623
|
-
return undefined;
|
|
52624
|
-
}
|
|
52625
|
-
const { __ref } = field;
|
|
52626
|
-
if (__ref !== undefined) {
|
|
52627
|
-
let ref = records[__ref];
|
|
52628
|
-
if (pendingEntries !== undefined) {
|
|
52629
|
-
// If the ref was part of the pending write that takes precedence
|
|
52630
|
-
const pendingEntry = pendingEntries[__ref];
|
|
52631
|
-
if (pendingEntry !== undefined) {
|
|
52632
|
-
ref = pendingEntry.data;
|
|
52633
|
-
}
|
|
52634
|
-
}
|
|
52635
|
-
// if field reference exists then add it to our filteredFields
|
|
52636
|
-
if (ref !== undefined) {
|
|
52637
|
-
filteredFields[fieldName] = ref;
|
|
52638
|
-
}
|
|
52639
|
-
else {
|
|
52640
|
-
// if we have a store to read, try to find the field there too
|
|
52641
|
-
// The durable ingest staging store may pass through to L1, and
|
|
52642
|
-
// not all fields are necessarily published every time, so it is
|
|
52643
|
-
// important to check L1 and not just the fields being published,
|
|
52644
|
-
// otherwise we risk truncating the fields on the record.
|
|
52645
|
-
if (store) {
|
|
52646
|
-
ref = store.readEntry(__ref);
|
|
52647
|
-
if (ref !== undefined) {
|
|
52648
|
-
filteredFields[fieldName] = ref;
|
|
52649
|
-
}
|
|
52650
|
-
}
|
|
52651
|
-
}
|
|
52652
|
-
}
|
|
52653
|
-
// we want to preserve fields that are missing nodes
|
|
52654
|
-
if (field.isMissing === true) {
|
|
52655
|
-
links[fieldName] = field;
|
|
52656
|
-
}
|
|
52657
|
-
}
|
|
52658
|
-
return {
|
|
52659
|
-
...normalizedRecord,
|
|
52660
|
-
fields: filteredFields,
|
|
52661
|
-
links,
|
|
52662
|
-
};
|
|
52663
|
-
}
|
|
52664
|
-
function getDenormalizedKey(originalKey, recordId, luvio) {
|
|
52665
|
-
// this will likely need to be handled when moving to structured keys
|
|
52666
|
-
// note record view entities dont have an associated keybuilder. They get ingested as records to a different key format
|
|
52667
|
-
// see the override for how they are handled packages/lds-adapters-uiapi/src/raml-artifacts/types/RecordRepresentation/keyBuilderFromType.ts
|
|
52668
|
-
if (originalKey.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX$1)) {
|
|
52669
|
-
return RECORD_VIEW_ENTITY_ID_PREFIX$1 + recordId;
|
|
52670
|
-
}
|
|
52671
|
-
return keyBuilder$26(luvio, { recordId });
|
|
52672
|
-
}
|
|
52673
|
-
function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecords, getStoreMetadata, getStore, sqlStore) {
|
|
52674
|
-
const getEntries = function (entries, segment) {
|
|
52675
|
-
// this HOF only inspects records in the default segment
|
|
52676
|
-
if (segment !== DefaultDurableSegment) {
|
|
52677
|
-
return durableStore.getEntries(entries, segment);
|
|
52678
|
-
}
|
|
52679
|
-
const { length: entriesLength } = entries;
|
|
52680
|
-
if (entriesLength === 0) {
|
|
52681
|
-
return Promise.resolve({});
|
|
52682
|
-
}
|
|
52683
|
-
// filter out record field keys
|
|
52684
|
-
const filteredEntryIds = [];
|
|
52685
|
-
// map of records to avoid requesting duplicate record keys when requesting both records and fields
|
|
52686
|
-
const recordEntries = {};
|
|
52687
|
-
const recordViewEntries = {};
|
|
52688
|
-
for (let i = 0, len = entriesLength; i < len; i++) {
|
|
52689
|
-
const id = entries[i];
|
|
52690
|
-
const recordId = extractRecordIdFromStoreKey$1(id);
|
|
52691
|
-
if (recordId !== undefined) {
|
|
52692
|
-
if (id.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX$1)) {
|
|
52693
|
-
if (recordViewEntries[recordId] === undefined) {
|
|
52694
|
-
const key = getDenormalizedKey(id, recordId, luvio);
|
|
52695
|
-
recordViewEntries[recordId] = true;
|
|
52696
|
-
filteredEntryIds.push(key);
|
|
52697
|
-
}
|
|
52698
|
-
}
|
|
52699
|
-
else {
|
|
52700
|
-
if (recordEntries[recordId] === undefined) {
|
|
52701
|
-
const key = getDenormalizedKey(id, recordId, luvio);
|
|
52702
|
-
recordEntries[recordId] = true;
|
|
52703
|
-
filteredEntryIds.push(key);
|
|
52704
|
-
}
|
|
52705
|
-
}
|
|
52706
|
-
}
|
|
52707
|
-
else {
|
|
52708
|
-
filteredEntryIds.push(id);
|
|
52709
|
-
}
|
|
52710
|
-
}
|
|
52711
|
-
// call base getEntries
|
|
52712
|
-
return durableStore.getEntries(filteredEntryIds, segment).then((durableEntries) => {
|
|
52713
|
-
if (durableEntries === undefined) {
|
|
52714
|
-
return undefined;
|
|
52715
|
-
}
|
|
52716
|
-
const returnEntries = create$4(null);
|
|
52717
|
-
const keys$1 = keys$4(durableEntries);
|
|
52718
|
-
for (let i = 0, len = keys$1.length; i < len; i++) {
|
|
52719
|
-
const key = keys$1[i];
|
|
52720
|
-
const value = durableEntries[key];
|
|
52721
|
-
if (value === undefined) {
|
|
52722
|
-
continue;
|
|
52723
|
-
}
|
|
52724
|
-
if (isEntryDurableRecordRepresentation(value, key)) {
|
|
52725
|
-
assign$4(returnEntries, normalizeRecordFields(key, value));
|
|
52726
|
-
}
|
|
52727
|
-
else {
|
|
52728
|
-
returnEntries[key] = value;
|
|
52729
|
-
}
|
|
52730
|
-
}
|
|
52731
|
-
return returnEntries;
|
|
52732
|
-
});
|
|
52733
|
-
};
|
|
52734
|
-
const denormalizeEntries = function (entries) {
|
|
52735
|
-
let hasEntries = false;
|
|
52736
|
-
let hasMetadata = false;
|
|
52737
|
-
const putEntries = create$4(null);
|
|
52738
|
-
const putMetadata = create$4(null);
|
|
52739
|
-
const keys$1 = keys$4(entries);
|
|
52740
|
-
const putRecords = {};
|
|
52741
|
-
const putRecordViews = {};
|
|
52742
|
-
const storeRecords = getStoreRecords !== undefined ? getStoreRecords() : {};
|
|
52743
|
-
const storeMetadata = getStoreMetadata !== undefined ? getStoreMetadata() : {};
|
|
52744
|
-
const store = getStore();
|
|
52745
|
-
for (let i = 0, len = keys$1.length; i < len; i++) {
|
|
52746
|
-
const key = keys$1[i];
|
|
52747
|
-
let value = entries[key];
|
|
52748
|
-
const recordId = extractRecordIdFromStoreKey$1(key);
|
|
52749
|
-
// do not put normalized field values
|
|
52750
|
-
if (recordId !== undefined) {
|
|
52751
|
-
const isRecordView = key.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX$1);
|
|
52752
|
-
if (isRecordView) {
|
|
52753
|
-
if (putRecordViews[recordId] === true) {
|
|
52754
|
-
continue;
|
|
52755
|
-
}
|
|
52756
|
-
}
|
|
52757
|
-
else {
|
|
52758
|
-
if (putRecords[recordId] === true) {
|
|
52759
|
-
continue;
|
|
52760
|
-
}
|
|
52761
|
-
}
|
|
52762
|
-
const recordKey = getDenormalizedKey(key, recordId, luvio);
|
|
52763
|
-
const recordEntries = entries;
|
|
52764
|
-
const entry = recordEntries[recordKey];
|
|
52765
|
-
let record = entry && entry.data;
|
|
52766
|
-
if (record === undefined) {
|
|
52767
|
-
record = storeRecords[recordKey];
|
|
52768
|
-
if (record === undefined) {
|
|
52769
|
-
// fields are being published without a record for them existing,
|
|
52770
|
-
// fields cannot exist standalone in the durable store
|
|
52771
|
-
continue;
|
|
52772
|
-
}
|
|
52773
|
-
}
|
|
52774
|
-
if (isRecordView) {
|
|
52775
|
-
putRecordViews[recordId] = true;
|
|
52776
|
-
}
|
|
52777
|
-
else {
|
|
52778
|
-
putRecords[recordId] = true;
|
|
52779
|
-
}
|
|
52780
|
-
if (isStoreRecordError(record)) {
|
|
52781
|
-
hasEntries = true;
|
|
52782
|
-
putEntries[recordKey] = value;
|
|
52783
|
-
continue;
|
|
52784
|
-
}
|
|
52785
|
-
let metadata = entry && entry.metadata;
|
|
52786
|
-
if (metadata === undefined) {
|
|
52787
|
-
metadata = {
|
|
52788
|
-
...storeMetadata[recordKey],
|
|
52789
|
-
metadataVersion: DURABLE_METADATA_VERSION,
|
|
52790
|
-
};
|
|
52791
|
-
}
|
|
52792
|
-
const denormalizedRecord = buildDurableRecordRepresentation(record, storeRecords, recordEntries, store);
|
|
52793
|
-
if (denormalizedRecord !== undefined) {
|
|
52794
|
-
hasEntries = true;
|
|
52795
|
-
putEntries[recordKey] = {
|
|
52796
|
-
data: denormalizedRecord,
|
|
52797
|
-
metadata,
|
|
52798
|
-
};
|
|
52799
|
-
// if undefined then it is pending
|
|
52800
|
-
// we should still update metadata on pending records
|
|
52801
|
-
}
|
|
52802
|
-
else {
|
|
52803
|
-
hasMetadata = true;
|
|
52804
|
-
metadata.expirationTimestamp = metadata.ingestionTimestamp;
|
|
52805
|
-
putMetadata[recordKey] = {
|
|
52806
|
-
metadata,
|
|
52807
|
-
};
|
|
52808
|
-
}
|
|
52809
|
-
}
|
|
52810
|
-
else {
|
|
52811
|
-
hasEntries = true;
|
|
52812
|
-
putEntries[key] = value;
|
|
52813
|
-
}
|
|
52814
|
-
}
|
|
52815
|
-
return { putEntries, putMetadata, hasEntries, hasMetadata };
|
|
52816
|
-
};
|
|
52817
|
-
const setEntries = function (entries, segment) {
|
|
52818
|
-
if (segment !== DefaultDurableSegment) {
|
|
52819
|
-
return durableStore.setEntries(entries, segment);
|
|
52820
|
-
}
|
|
52821
|
-
const { putEntries, putMetadata, hasEntries, hasMetadata } = denormalizeEntries(entries);
|
|
52822
|
-
const promises = [
|
|
52823
|
-
hasEntries ? durableStore.setEntries(putEntries, segment) : undefined,
|
|
52824
|
-
];
|
|
52825
|
-
if (sqlStore !== undefined && sqlStore.isBatchUpdateSupported()) {
|
|
52826
|
-
promises.push(hasMetadata && sqlStore !== undefined
|
|
52827
|
-
? durableStore.setMetadata(putMetadata, segment)
|
|
52828
|
-
: undefined);
|
|
52829
|
-
}
|
|
52830
|
-
return Promise.all(promises).then(() => { });
|
|
52831
|
-
};
|
|
52832
|
-
const batchOperations = function (operations) {
|
|
52833
|
-
const operationsWithDenormedRecords = [];
|
|
52834
|
-
for (let i = 0, len = operations.length; i < len; i++) {
|
|
52835
|
-
const operation = operations[i];
|
|
52836
|
-
if (operation.type === 'setMetadata') {
|
|
52837
|
-
// if setMetadata also contains entry data then it needs to be denormalized.
|
|
52838
|
-
const keys$1 = keys$4(operation.entries);
|
|
52839
|
-
if (keys$1.length > 0) {
|
|
52840
|
-
const firstKey = keys$1[0];
|
|
52841
|
-
// casted to any to check if data exists
|
|
52842
|
-
const firstEntry = operation.entries[firstKey];
|
|
52843
|
-
// it is not possible for setMetadata to contain entries with both data and no data in the same operation.
|
|
52844
|
-
// this is determined by the plugin supporting update batch calls before it gets to this HOF.
|
|
52845
|
-
// so we only need to check one entry to confirm this for performance
|
|
52846
|
-
if (firstEntry.data !== undefined) {
|
|
52847
|
-
const { putEntries, putMetadata, hasMetadata } = denormalizeEntries(operation.entries);
|
|
52848
|
-
operationsWithDenormedRecords.push({
|
|
52849
|
-
...operation,
|
|
52850
|
-
entries: putEntries,
|
|
52851
|
-
});
|
|
52852
|
-
if (hasMetadata &&
|
|
52853
|
-
sqlStore !== undefined &&
|
|
52854
|
-
sqlStore.isBatchUpdateSupported() === true) {
|
|
52855
|
-
operationsWithDenormedRecords.push({
|
|
52856
|
-
...operation,
|
|
52857
|
-
entries: putMetadata,
|
|
52858
|
-
type: 'setMetadata',
|
|
52859
|
-
});
|
|
52860
|
-
}
|
|
52861
|
-
}
|
|
52862
|
-
else {
|
|
52863
|
-
operationsWithDenormedRecords.push(operation);
|
|
52864
|
-
}
|
|
52865
|
-
}
|
|
52866
|
-
continue;
|
|
52867
|
-
}
|
|
52868
|
-
if (operation.segment !== DefaultDurableSegment || operation.type === 'evictEntries') {
|
|
52869
|
-
operationsWithDenormedRecords.push(operation);
|
|
52870
|
-
continue;
|
|
52871
|
-
}
|
|
52872
|
-
const { putEntries, putMetadata, hasMetadata } = denormalizeEntries(operation.entries);
|
|
52873
|
-
operationsWithDenormedRecords.push({
|
|
52874
|
-
...operation,
|
|
52875
|
-
entries: putEntries,
|
|
52876
|
-
});
|
|
52877
|
-
if (hasMetadata &&
|
|
52878
|
-
sqlStore !== undefined &&
|
|
52879
|
-
sqlStore.isBatchUpdateSupported() === true) {
|
|
52880
|
-
operationsWithDenormedRecords.push({
|
|
52881
|
-
...operation,
|
|
52882
|
-
entries: putMetadata,
|
|
52883
|
-
type: 'setMetadata',
|
|
52884
|
-
});
|
|
52885
|
-
}
|
|
52886
|
-
}
|
|
52887
|
-
return durableStore.batchOperations(operationsWithDenormedRecords);
|
|
52888
|
-
};
|
|
52889
|
-
/**
|
|
52890
|
-
* Retrieves a denormalized record from the store
|
|
52891
|
-
* NOTE: do no use this if you don't know what you're doing, this can still contain normalized record references
|
|
52892
|
-
* @param recordKey record key
|
|
52893
|
-
* @param durableStore the durable store
|
|
52894
|
-
* @returns a DraftRecordRepresentation containing the requested fields
|
|
52895
|
-
*/
|
|
52896
|
-
const getDenormalizedRecord = function (recordKey) {
|
|
52897
|
-
return durableStore.getEntries([recordKey], DefaultDurableSegment).then((entries) => {
|
|
52898
|
-
if (entries === undefined) {
|
|
52899
|
-
return undefined;
|
|
52900
|
-
}
|
|
52901
|
-
const denormalizedEntry = entries[recordKey];
|
|
52902
|
-
if (denormalizedEntry === undefined) {
|
|
52903
|
-
return undefined;
|
|
52904
|
-
}
|
|
52905
|
-
// don't include link information
|
|
52906
|
-
const denormalizedRecord = denormalizedEntry.data;
|
|
52907
|
-
if (isStoreRecordError(denormalizedRecord)) {
|
|
52908
|
-
return undefined;
|
|
52909
|
-
}
|
|
52910
|
-
return denormalizedRecord;
|
|
52911
|
-
});
|
|
52912
|
-
};
|
|
52913
|
-
return create$4(durableStore, {
|
|
52914
|
-
getEntries: { value: getEntries, writable: true },
|
|
52915
|
-
setEntries: { value: setEntries, writable: true },
|
|
52916
|
-
batchOperations: { value: batchOperations, writable: true },
|
|
52917
|
-
getDenormalizedRecord: { value: getDenormalizedRecord, writable: true },
|
|
52918
|
-
});
|
|
52919
|
-
}
|
|
52920
|
-
|
|
52921
52548
|
/**
|
|
52922
52549
|
* This function takes an unknown error and normalizes it to an Error object
|
|
52923
52550
|
*/
|
|
@@ -52956,7 +52583,7 @@ function performQuickActionDraftEnvironment(luvio, env, handler) {
|
|
|
52956
52583
|
}
|
|
52957
52584
|
return createOkResponse(data);
|
|
52958
52585
|
};
|
|
52959
|
-
return create$
|
|
52586
|
+
return create$5(env, {
|
|
52960
52587
|
dispatchResourceRequest: { value: dispatchResourceRequest },
|
|
52961
52588
|
});
|
|
52962
52589
|
}
|
|
@@ -53023,7 +52650,7 @@ class UiApiDraftRecordService {
|
|
|
53023
52650
|
};
|
|
53024
52651
|
}
|
|
53025
52652
|
objectInfoMap.set(apiName, objectInfo);
|
|
53026
|
-
const fields = keys$
|
|
52653
|
+
const fields = keys$5(operation.fields);
|
|
53027
52654
|
const unexpectedFields = [];
|
|
53028
52655
|
for (const field of fields) {
|
|
53029
52656
|
const fieldInfo = objectInfo.fields[field];
|
|
@@ -53347,7 +52974,7 @@ function createContentDocumentAndVersionDraftAdapterFactory(luvio, binaryStore,
|
|
|
53347
52974
|
...trimmedDownData.contentVersion,
|
|
53348
52975
|
fields: cvFields,
|
|
53349
52976
|
};
|
|
53350
|
-
freeze$
|
|
52977
|
+
freeze$1$1(trimmedDownData);
|
|
53351
52978
|
snapshot.data = trimmedDownData;
|
|
53352
52979
|
}
|
|
53353
52980
|
eventEmitter({ type: 'create-content-document-and-version-draft-finished' });
|
|
@@ -53361,14 +52988,13 @@ const CONTENT_DOCUMENT_LINK_API_NAME = 'ContentDocumentLink';
|
|
|
53361
52988
|
const CONTENT_VERSION_API_NAME = 'ContentVersion';
|
|
53362
52989
|
const LATEST_PUBLISHED_VERSION_ID_FIELD = 'LatestPublishedVersionId';
|
|
53363
52990
|
class ContentDocumentCompositeRepresentationActionHandler extends AbstractResourceRequestActionHandler {
|
|
53364
|
-
constructor(getLuvio, draftRecordService, draftQueue, networkAdapter, isDraftId,
|
|
52991
|
+
constructor(getLuvio, draftRecordService, draftQueue, networkAdapter, isDraftId, binaryStore) {
|
|
53365
52992
|
super(draftQueue, networkAdapter, getLuvio);
|
|
53366
52993
|
this.getLuvio = getLuvio;
|
|
53367
52994
|
this.draftRecordService = draftRecordService;
|
|
53368
52995
|
this.draftQueue = draftQueue;
|
|
53369
52996
|
this.networkAdapter = networkAdapter;
|
|
53370
52997
|
this.isDraftId = isDraftId;
|
|
53371
|
-
this.durableStore = durableStore;
|
|
53372
52998
|
this.binaryStore = binaryStore;
|
|
53373
52999
|
this.binaryStoreUrlsToUpdate = new Map();
|
|
53374
53000
|
this.handlerId = HANDLER_ID;
|
|
@@ -53780,6 +53406,389 @@ function deleteRecordDraftAdapterFactory(luvio, actionHandler) {
|
|
|
53780
53406
|
};
|
|
53781
53407
|
}
|
|
53782
53408
|
|
|
53409
|
+
/**
|
|
53410
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
53411
|
+
* All rights reserved.
|
|
53412
|
+
* For full license text, see the LICENSE.txt file
|
|
53413
|
+
*/
|
|
53414
|
+
|
|
53415
|
+
|
|
53416
|
+
const { keys: keys$4, values: values$2, create: create$4, assign: assign$4, freeze: freeze$3, entries: entries$4 } = Object;
|
|
53417
|
+
|
|
53418
|
+
function buildRecordFieldStoreKey(recordKey, fieldName) {
|
|
53419
|
+
return `${recordKey}${RECORD_FIELDS_KEY_JUNCTION$1}${fieldName}`;
|
|
53420
|
+
}
|
|
53421
|
+
function isStoreKeyRecordId(key) {
|
|
53422
|
+
return key.indexOf(RECORD_ID_PREFIX$1) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION$1) === -1;
|
|
53423
|
+
}
|
|
53424
|
+
function createLink$2(key) {
|
|
53425
|
+
return { __ref: key };
|
|
53426
|
+
}
|
|
53427
|
+
function isStoreRecordError(storeRecord) {
|
|
53428
|
+
return storeRecord.__type === 'error';
|
|
53429
|
+
}
|
|
53430
|
+
function isEntryDurableRecordRepresentation(entry, key) {
|
|
53431
|
+
// Either a DurableRecordRepresentation or StoreRecordError can live at a record key
|
|
53432
|
+
return ((isStoreKeyRecordId(key) || isStoreKeyRecordViewEntity$1(key)) &&
|
|
53433
|
+
entry.data.__type === undefined);
|
|
53434
|
+
}
|
|
53435
|
+
/**
|
|
53436
|
+
* Records are stored in the durable store with scalar fields denormalized. This function takes that denoramlized
|
|
53437
|
+
* durable store record representation and normalizes it back out into the format the the luvio store expects it
|
|
53438
|
+
* @param key Record store key
|
|
53439
|
+
* @param entry Durable entry containing a denormalized record representation
|
|
53440
|
+
* @returns a set of entries containing the normalized record and its normalized fields
|
|
53441
|
+
*/
|
|
53442
|
+
function normalizeRecordFields(key, entry) {
|
|
53443
|
+
const { data: record } = entry;
|
|
53444
|
+
const { fields, links } = record;
|
|
53445
|
+
const missingFieldLinks = keys$4(links);
|
|
53446
|
+
const fieldNames = keys$4(fields);
|
|
53447
|
+
const normalizedFields = {};
|
|
53448
|
+
const returnEntries = {};
|
|
53449
|
+
// restore fields
|
|
53450
|
+
for (let i = 0, len = fieldNames.length; i < len; i++) {
|
|
53451
|
+
const fieldName = fieldNames[i];
|
|
53452
|
+
const field = fields[fieldName];
|
|
53453
|
+
const fieldKey = buildRecordFieldStoreKey(key, fieldName);
|
|
53454
|
+
returnEntries[fieldKey] = { data: field };
|
|
53455
|
+
normalizedFields[fieldName] = createLink$2(fieldKey);
|
|
53456
|
+
}
|
|
53457
|
+
// restore missing fields
|
|
53458
|
+
for (let i = 0, len = missingFieldLinks.length; i < len; i++) {
|
|
53459
|
+
const fieldName = missingFieldLinks[i];
|
|
53460
|
+
const link = links[fieldName];
|
|
53461
|
+
if (link.isMissing === true) {
|
|
53462
|
+
normalizedFields[fieldName] = { ...link, __ref: undefined };
|
|
53463
|
+
}
|
|
53464
|
+
}
|
|
53465
|
+
returnEntries[key] = {
|
|
53466
|
+
data: assign$4(record, { fields: normalizedFields }),
|
|
53467
|
+
metadata: entry.metadata,
|
|
53468
|
+
};
|
|
53469
|
+
return returnEntries;
|
|
53470
|
+
}
|
|
53471
|
+
/**
|
|
53472
|
+
* Transforms a record for storage in the durable store. The transformation involves denormalizing
|
|
53473
|
+
* scalar fields and persisting link metadata to transform back into a normalized representation
|
|
53474
|
+
*
|
|
53475
|
+
* If the record contains pending fields this will return undefined as pending records do not get persisted
|
|
53476
|
+
* to the durable store. There should be a refresh operation outbound that will bring in the updated record.
|
|
53477
|
+
*
|
|
53478
|
+
* @param normalizedRecord Record containing normalized field links
|
|
53479
|
+
* @param recordStore a store containing referenced record fields
|
|
53480
|
+
*/
|
|
53481
|
+
function buildDurableRecordRepresentation(normalizedRecord, records, pendingEntries, store) {
|
|
53482
|
+
const fields = normalizedRecord.fields;
|
|
53483
|
+
const filteredFields = {};
|
|
53484
|
+
const links = {};
|
|
53485
|
+
const fieldNames = keys$4(fields);
|
|
53486
|
+
for (let i = 0, len = fieldNames.length; i < len; i++) {
|
|
53487
|
+
const fieldName = fieldNames[i];
|
|
53488
|
+
const field = fields[fieldName];
|
|
53489
|
+
// pending fields get filtered out of the durable store
|
|
53490
|
+
const { pending } = field;
|
|
53491
|
+
if (pending === true) {
|
|
53492
|
+
// do not write records with pending fields to the durable store
|
|
53493
|
+
// there should be a refresh operation outbound that will bring in the updated record
|
|
53494
|
+
return undefined;
|
|
53495
|
+
}
|
|
53496
|
+
const { __ref } = field;
|
|
53497
|
+
if (__ref !== undefined) {
|
|
53498
|
+
let ref = records[__ref];
|
|
53499
|
+
if (pendingEntries !== undefined) {
|
|
53500
|
+
// If the ref was part of the pending write that takes precedence
|
|
53501
|
+
const pendingEntry = pendingEntries[__ref];
|
|
53502
|
+
if (pendingEntry !== undefined) {
|
|
53503
|
+
ref = pendingEntry.data;
|
|
53504
|
+
}
|
|
53505
|
+
}
|
|
53506
|
+
// if field reference exists then add it to our filteredFields
|
|
53507
|
+
if (ref !== undefined) {
|
|
53508
|
+
filteredFields[fieldName] = ref;
|
|
53509
|
+
}
|
|
53510
|
+
else {
|
|
53511
|
+
// if we have a store to read, try to find the field there too
|
|
53512
|
+
// The durable ingest staging store may pass through to L1, and
|
|
53513
|
+
// not all fields are necessarily published every time, so it is
|
|
53514
|
+
// important to check L1 and not just the fields being published,
|
|
53515
|
+
// otherwise we risk truncating the fields on the record.
|
|
53516
|
+
if (store) {
|
|
53517
|
+
ref = store.readEntry(__ref);
|
|
53518
|
+
if (ref !== undefined) {
|
|
53519
|
+
filteredFields[fieldName] = ref;
|
|
53520
|
+
}
|
|
53521
|
+
}
|
|
53522
|
+
}
|
|
53523
|
+
}
|
|
53524
|
+
// we want to preserve fields that are missing nodes
|
|
53525
|
+
if (field.isMissing === true) {
|
|
53526
|
+
links[fieldName] = field;
|
|
53527
|
+
}
|
|
53528
|
+
}
|
|
53529
|
+
return {
|
|
53530
|
+
...normalizedRecord,
|
|
53531
|
+
fields: filteredFields,
|
|
53532
|
+
links,
|
|
53533
|
+
};
|
|
53534
|
+
}
|
|
53535
|
+
function getDenormalizedKey(originalKey, recordId, luvio) {
|
|
53536
|
+
// this will likely need to be handled when moving to structured keys
|
|
53537
|
+
// note record view entities dont have an associated keybuilder. They get ingested as records to a different key format
|
|
53538
|
+
// see the override for how they are handled packages/lds-adapters-uiapi/src/raml-artifacts/types/RecordRepresentation/keyBuilderFromType.ts
|
|
53539
|
+
if (originalKey.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX$1)) {
|
|
53540
|
+
return RECORD_VIEW_ENTITY_ID_PREFIX$1 + recordId;
|
|
53541
|
+
}
|
|
53542
|
+
return keyBuilder$26(luvio, { recordId });
|
|
53543
|
+
}
|
|
53544
|
+
function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecords, getStoreMetadata, getStore, sqlStore) {
|
|
53545
|
+
const getEntries = function (entries, segment) {
|
|
53546
|
+
// this HOF only inspects records in the default segment
|
|
53547
|
+
if (segment !== DefaultDurableSegment) {
|
|
53548
|
+
return durableStore.getEntries(entries, segment);
|
|
53549
|
+
}
|
|
53550
|
+
const { length: entriesLength } = entries;
|
|
53551
|
+
if (entriesLength === 0) {
|
|
53552
|
+
return Promise.resolve({});
|
|
53553
|
+
}
|
|
53554
|
+
// filter out record field keys
|
|
53555
|
+
const filteredEntryIds = [];
|
|
53556
|
+
// map of records to avoid requesting duplicate record keys when requesting both records and fields
|
|
53557
|
+
const recordEntries = {};
|
|
53558
|
+
const recordViewEntries = {};
|
|
53559
|
+
for (let i = 0, len = entriesLength; i < len; i++) {
|
|
53560
|
+
const id = entries[i];
|
|
53561
|
+
const recordId = extractRecordIdFromStoreKey$1(id);
|
|
53562
|
+
if (recordId !== undefined) {
|
|
53563
|
+
if (id.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX$1)) {
|
|
53564
|
+
if (recordViewEntries[recordId] === undefined) {
|
|
53565
|
+
const key = getDenormalizedKey(id, recordId, luvio);
|
|
53566
|
+
recordViewEntries[recordId] = true;
|
|
53567
|
+
filteredEntryIds.push(key);
|
|
53568
|
+
}
|
|
53569
|
+
}
|
|
53570
|
+
else {
|
|
53571
|
+
if (recordEntries[recordId] === undefined) {
|
|
53572
|
+
const key = getDenormalizedKey(id, recordId, luvio);
|
|
53573
|
+
recordEntries[recordId] = true;
|
|
53574
|
+
filteredEntryIds.push(key);
|
|
53575
|
+
}
|
|
53576
|
+
}
|
|
53577
|
+
}
|
|
53578
|
+
else {
|
|
53579
|
+
filteredEntryIds.push(id);
|
|
53580
|
+
}
|
|
53581
|
+
}
|
|
53582
|
+
// call base getEntries
|
|
53583
|
+
return durableStore.getEntries(filteredEntryIds, segment).then((durableEntries) => {
|
|
53584
|
+
if (durableEntries === undefined) {
|
|
53585
|
+
return undefined;
|
|
53586
|
+
}
|
|
53587
|
+
const returnEntries = create$4(null);
|
|
53588
|
+
const keys$1 = keys$4(durableEntries);
|
|
53589
|
+
for (let i = 0, len = keys$1.length; i < len; i++) {
|
|
53590
|
+
const key = keys$1[i];
|
|
53591
|
+
const value = durableEntries[key];
|
|
53592
|
+
if (value === undefined) {
|
|
53593
|
+
continue;
|
|
53594
|
+
}
|
|
53595
|
+
if (isEntryDurableRecordRepresentation(value, key)) {
|
|
53596
|
+
assign$4(returnEntries, normalizeRecordFields(key, value));
|
|
53597
|
+
}
|
|
53598
|
+
else {
|
|
53599
|
+
returnEntries[key] = value;
|
|
53600
|
+
}
|
|
53601
|
+
}
|
|
53602
|
+
return returnEntries;
|
|
53603
|
+
});
|
|
53604
|
+
};
|
|
53605
|
+
const denormalizeEntries = function (entries) {
|
|
53606
|
+
let hasEntries = false;
|
|
53607
|
+
let hasMetadata = false;
|
|
53608
|
+
const putEntries = create$4(null);
|
|
53609
|
+
const putMetadata = create$4(null);
|
|
53610
|
+
const keys$1 = keys$4(entries);
|
|
53611
|
+
const putRecords = {};
|
|
53612
|
+
const putRecordViews = {};
|
|
53613
|
+
const storeRecords = getStoreRecords !== undefined ? getStoreRecords() : {};
|
|
53614
|
+
const storeMetadata = getStoreMetadata !== undefined ? getStoreMetadata() : {};
|
|
53615
|
+
const store = getStore();
|
|
53616
|
+
for (let i = 0, len = keys$1.length; i < len; i++) {
|
|
53617
|
+
const key = keys$1[i];
|
|
53618
|
+
let value = entries[key];
|
|
53619
|
+
const recordId = extractRecordIdFromStoreKey$1(key);
|
|
53620
|
+
// do not put normalized field values
|
|
53621
|
+
if (recordId !== undefined) {
|
|
53622
|
+
const isRecordView = key.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX$1);
|
|
53623
|
+
if (isRecordView) {
|
|
53624
|
+
if (putRecordViews[recordId] === true) {
|
|
53625
|
+
continue;
|
|
53626
|
+
}
|
|
53627
|
+
}
|
|
53628
|
+
else {
|
|
53629
|
+
if (putRecords[recordId] === true) {
|
|
53630
|
+
continue;
|
|
53631
|
+
}
|
|
53632
|
+
}
|
|
53633
|
+
const recordKey = getDenormalizedKey(key, recordId, luvio);
|
|
53634
|
+
const recordEntries = entries;
|
|
53635
|
+
const entry = recordEntries[recordKey];
|
|
53636
|
+
let record = entry && entry.data;
|
|
53637
|
+
if (record === undefined) {
|
|
53638
|
+
record = storeRecords[recordKey];
|
|
53639
|
+
if (record === undefined) {
|
|
53640
|
+
// fields are being published without a record for them existing,
|
|
53641
|
+
// fields cannot exist standalone in the durable store
|
|
53642
|
+
continue;
|
|
53643
|
+
}
|
|
53644
|
+
}
|
|
53645
|
+
if (isRecordView) {
|
|
53646
|
+
putRecordViews[recordId] = true;
|
|
53647
|
+
}
|
|
53648
|
+
else {
|
|
53649
|
+
putRecords[recordId] = true;
|
|
53650
|
+
}
|
|
53651
|
+
if (isStoreRecordError(record)) {
|
|
53652
|
+
hasEntries = true;
|
|
53653
|
+
putEntries[recordKey] = value;
|
|
53654
|
+
continue;
|
|
53655
|
+
}
|
|
53656
|
+
let metadata = entry && entry.metadata;
|
|
53657
|
+
if (metadata === undefined) {
|
|
53658
|
+
metadata = {
|
|
53659
|
+
...storeMetadata[recordKey],
|
|
53660
|
+
metadataVersion: DURABLE_METADATA_VERSION,
|
|
53661
|
+
};
|
|
53662
|
+
}
|
|
53663
|
+
const denormalizedRecord = buildDurableRecordRepresentation(record, storeRecords, recordEntries, store);
|
|
53664
|
+
if (denormalizedRecord !== undefined) {
|
|
53665
|
+
hasEntries = true;
|
|
53666
|
+
putEntries[recordKey] = {
|
|
53667
|
+
data: denormalizedRecord,
|
|
53668
|
+
metadata,
|
|
53669
|
+
};
|
|
53670
|
+
// if undefined then it is pending
|
|
53671
|
+
// we should still update metadata on pending records
|
|
53672
|
+
}
|
|
53673
|
+
else {
|
|
53674
|
+
hasMetadata = true;
|
|
53675
|
+
metadata.expirationTimestamp = metadata.ingestionTimestamp;
|
|
53676
|
+
putMetadata[recordKey] = {
|
|
53677
|
+
metadata,
|
|
53678
|
+
};
|
|
53679
|
+
}
|
|
53680
|
+
}
|
|
53681
|
+
else {
|
|
53682
|
+
hasEntries = true;
|
|
53683
|
+
putEntries[key] = value;
|
|
53684
|
+
}
|
|
53685
|
+
}
|
|
53686
|
+
return { putEntries, putMetadata, hasEntries, hasMetadata };
|
|
53687
|
+
};
|
|
53688
|
+
const setEntries = function (entries, segment) {
|
|
53689
|
+
if (segment !== DefaultDurableSegment) {
|
|
53690
|
+
return durableStore.setEntries(entries, segment);
|
|
53691
|
+
}
|
|
53692
|
+
const { putEntries, putMetadata, hasEntries, hasMetadata } = denormalizeEntries(entries);
|
|
53693
|
+
const promises = [
|
|
53694
|
+
hasEntries ? durableStore.setEntries(putEntries, segment) : undefined,
|
|
53695
|
+
];
|
|
53696
|
+
if (sqlStore !== undefined && sqlStore.isBatchUpdateSupported()) {
|
|
53697
|
+
promises.push(hasMetadata && sqlStore !== undefined
|
|
53698
|
+
? durableStore.setMetadata(putMetadata, segment)
|
|
53699
|
+
: undefined);
|
|
53700
|
+
}
|
|
53701
|
+
return Promise.all(promises).then(() => { });
|
|
53702
|
+
};
|
|
53703
|
+
const batchOperations = function (operations) {
|
|
53704
|
+
const operationsWithDenormedRecords = [];
|
|
53705
|
+
for (let i = 0, len = operations.length; i < len; i++) {
|
|
53706
|
+
const operation = operations[i];
|
|
53707
|
+
if (operation.type === 'setMetadata') {
|
|
53708
|
+
// if setMetadata also contains entry data then it needs to be denormalized.
|
|
53709
|
+
const keys$1 = keys$4(operation.entries);
|
|
53710
|
+
if (keys$1.length > 0) {
|
|
53711
|
+
const firstKey = keys$1[0];
|
|
53712
|
+
// casted to any to check if data exists
|
|
53713
|
+
const firstEntry = operation.entries[firstKey];
|
|
53714
|
+
// it is not possible for setMetadata to contain entries with both data and no data in the same operation.
|
|
53715
|
+
// this is determined by the plugin supporting update batch calls before it gets to this HOF.
|
|
53716
|
+
// so we only need to check one entry to confirm this for performance
|
|
53717
|
+
if (firstEntry.data !== undefined) {
|
|
53718
|
+
const { putEntries, putMetadata, hasMetadata } = denormalizeEntries(operation.entries);
|
|
53719
|
+
operationsWithDenormedRecords.push({
|
|
53720
|
+
...operation,
|
|
53721
|
+
entries: putEntries,
|
|
53722
|
+
});
|
|
53723
|
+
if (hasMetadata &&
|
|
53724
|
+
sqlStore !== undefined &&
|
|
53725
|
+
sqlStore.isBatchUpdateSupported() === true) {
|
|
53726
|
+
operationsWithDenormedRecords.push({
|
|
53727
|
+
...operation,
|
|
53728
|
+
entries: putMetadata,
|
|
53729
|
+
type: 'setMetadata',
|
|
53730
|
+
});
|
|
53731
|
+
}
|
|
53732
|
+
}
|
|
53733
|
+
else {
|
|
53734
|
+
operationsWithDenormedRecords.push(operation);
|
|
53735
|
+
}
|
|
53736
|
+
}
|
|
53737
|
+
continue;
|
|
53738
|
+
}
|
|
53739
|
+
if (operation.segment !== DefaultDurableSegment || operation.type === 'evictEntries') {
|
|
53740
|
+
operationsWithDenormedRecords.push(operation);
|
|
53741
|
+
continue;
|
|
53742
|
+
}
|
|
53743
|
+
const { putEntries, putMetadata, hasMetadata } = denormalizeEntries(operation.entries);
|
|
53744
|
+
operationsWithDenormedRecords.push({
|
|
53745
|
+
...operation,
|
|
53746
|
+
entries: putEntries,
|
|
53747
|
+
});
|
|
53748
|
+
if (hasMetadata &&
|
|
53749
|
+
sqlStore !== undefined &&
|
|
53750
|
+
sqlStore.isBatchUpdateSupported() === true) {
|
|
53751
|
+
operationsWithDenormedRecords.push({
|
|
53752
|
+
...operation,
|
|
53753
|
+
entries: putMetadata,
|
|
53754
|
+
type: 'setMetadata',
|
|
53755
|
+
});
|
|
53756
|
+
}
|
|
53757
|
+
}
|
|
53758
|
+
return durableStore.batchOperations(operationsWithDenormedRecords);
|
|
53759
|
+
};
|
|
53760
|
+
/**
|
|
53761
|
+
* Retrieves a denormalized record from the store
|
|
53762
|
+
* NOTE: do no use this if you don't know what you're doing, this can still contain normalized record references
|
|
53763
|
+
* @param recordKey record key
|
|
53764
|
+
* @param durableStore the durable store
|
|
53765
|
+
* @returns a DraftRecordRepresentation containing the requested fields
|
|
53766
|
+
*/
|
|
53767
|
+
const getDenormalizedRecord = function (recordKey) {
|
|
53768
|
+
return durableStore.getEntries([recordKey], DefaultDurableSegment).then((entries) => {
|
|
53769
|
+
if (entries === undefined) {
|
|
53770
|
+
return undefined;
|
|
53771
|
+
}
|
|
53772
|
+
const denormalizedEntry = entries[recordKey];
|
|
53773
|
+
if (denormalizedEntry === undefined) {
|
|
53774
|
+
return undefined;
|
|
53775
|
+
}
|
|
53776
|
+
// don't include link information
|
|
53777
|
+
const denormalizedRecord = denormalizedEntry.data;
|
|
53778
|
+
if (isStoreRecordError(denormalizedRecord)) {
|
|
53779
|
+
return undefined;
|
|
53780
|
+
}
|
|
53781
|
+
return denormalizedRecord;
|
|
53782
|
+
});
|
|
53783
|
+
};
|
|
53784
|
+
return create$4(durableStore, {
|
|
53785
|
+
getEntries: { value: getEntries, writable: true },
|
|
53786
|
+
setEntries: { value: setEntries, writable: true },
|
|
53787
|
+
batchOperations: { value: batchOperations, writable: true },
|
|
53788
|
+
getDenormalizedRecord: { value: getDenormalizedRecord, writable: true },
|
|
53789
|
+
});
|
|
53790
|
+
}
|
|
53791
|
+
|
|
53783
53792
|
function serializeFieldArguments$1(argumentNodes, variables) {
|
|
53784
53793
|
const mutableArgumentNodes = Object.assign([], argumentNodes);
|
|
53785
53794
|
return `args__(${mutableArgumentNodes
|
|
@@ -60581,7 +60590,7 @@ function registerReportObserver(reportObserver) {
|
|
|
60581
60590
|
};
|
|
60582
60591
|
}
|
|
60583
60592
|
|
|
60584
|
-
const { keys: keys$
|
|
60593
|
+
const { keys: keys$a, create: create$8, assign: assign$8, entries, values } = Object;
|
|
60585
60594
|
const { stringify: stringify$7, parse: parse$7 } = JSON;
|
|
60586
60595
|
|
|
60587
60596
|
function selectColumnsFromTableWhereKeyIn(columnNames, table, keyColumnName, whereIn) {
|
|
@@ -60648,7 +60657,7 @@ class LdsDataTable {
|
|
|
60648
60657
|
},
|
|
60649
60658
|
conflictColumns: this.conflictColumnNames,
|
|
60650
60659
|
columns: this.columnNames,
|
|
60651
|
-
rows: keys$
|
|
60660
|
+
rows: keys$a(entries).reduce((rows, key) => {
|
|
60652
60661
|
const entry = entries[key];
|
|
60653
60662
|
const { data, metadata } = entry;
|
|
60654
60663
|
const row = [key, stringify$7(data), metadata ? stringify$7(metadata) : null];
|
|
@@ -60667,7 +60676,7 @@ class LdsDataTable {
|
|
|
60667
60676
|
type: 'setMetadata',
|
|
60668
60677
|
},
|
|
60669
60678
|
columns: [COLUMN_NAME_METADATA$1],
|
|
60670
|
-
values: keys$
|
|
60679
|
+
values: keys$a(entries).reduce((values, key) => {
|
|
60671
60680
|
const { metadata } = entries[key];
|
|
60672
60681
|
const row = [metadata ? stringify$7(metadata) : null];
|
|
60673
60682
|
values[key] = row;
|
|
@@ -60757,7 +60766,7 @@ class LdsInternalDataTable {
|
|
|
60757
60766
|
},
|
|
60758
60767
|
conflictColumns: this.conflictColumnNames,
|
|
60759
60768
|
columns: this.columnNames,
|
|
60760
|
-
rows: keys$
|
|
60769
|
+
rows: keys$a(entries).reduce((rows, key) => {
|
|
60761
60770
|
const entry = entries[key];
|
|
60762
60771
|
const { data, metadata } = entry;
|
|
60763
60772
|
const row = [key, stringify$7(data)];
|
|
@@ -60783,7 +60792,7 @@ class LdsInternalDataTable {
|
|
|
60783
60792
|
type: 'setMetadata',
|
|
60784
60793
|
},
|
|
60785
60794
|
columns: [COLUMN_NAME_METADATA],
|
|
60786
|
-
values: keys$
|
|
60795
|
+
values: keys$a(entries).reduce((values, key) => {
|
|
60787
60796
|
const { metadata } = entries[key];
|
|
60788
60797
|
const row = [metadata ? stringify$7(metadata) : null];
|
|
60789
60798
|
values[key] = row;
|
|
@@ -60792,7 +60801,7 @@ class LdsInternalDataTable {
|
|
|
60792
60801
|
};
|
|
60793
60802
|
}
|
|
60794
60803
|
metadataToUpdateSQLQueries(entries, segment) {
|
|
60795
|
-
return keys$
|
|
60804
|
+
return keys$a(entries).reduce((accu, key) => {
|
|
60796
60805
|
const { metadata } = entries[key];
|
|
60797
60806
|
if (metadata !== undefined) {
|
|
60798
60807
|
accu.push({
|
|
@@ -60863,7 +60872,7 @@ class NimbusSqliteStore {
|
|
|
60863
60872
|
return this.getTable(segment).getAll(segment);
|
|
60864
60873
|
}
|
|
60865
60874
|
setEntries(entries, segment) {
|
|
60866
|
-
if (keys$
|
|
60875
|
+
if (keys$a(entries).length === 0) {
|
|
60867
60876
|
return Promise.resolve();
|
|
60868
60877
|
}
|
|
60869
60878
|
const table = this.getTable(segment);
|
|
@@ -60871,7 +60880,7 @@ class NimbusSqliteStore {
|
|
|
60871
60880
|
return this.batchOperationAsPromise([upsertOperation]);
|
|
60872
60881
|
}
|
|
60873
60882
|
setMetadata(entries, segment) {
|
|
60874
|
-
if (keys$
|
|
60883
|
+
if (keys$a(entries).length === 0) {
|
|
60875
60884
|
return Promise.resolve();
|
|
60876
60885
|
}
|
|
60877
60886
|
const table = this.getTable(segment);
|
|
@@ -60890,13 +60899,13 @@ class NimbusSqliteStore {
|
|
|
60890
60899
|
batchOperations(operations) {
|
|
60891
60900
|
const sqliteOperations = operations.reduce((acc, cur) => {
|
|
60892
60901
|
if (cur.type === 'setEntries') {
|
|
60893
|
-
if (keys$
|
|
60902
|
+
if (keys$a(cur.entries).length > 0) {
|
|
60894
60903
|
const table = this.getTable(cur.segment);
|
|
60895
60904
|
acc.push(table.entriesToUpsertOperations(cur.entries, cur.segment));
|
|
60896
60905
|
}
|
|
60897
60906
|
}
|
|
60898
60907
|
else if (cur.type === 'setMetadata') {
|
|
60899
|
-
if (keys$
|
|
60908
|
+
if (keys$a(cur.entries).length > 0) {
|
|
60900
60909
|
const table = this.getTable(cur.segment);
|
|
60901
60910
|
if (this.supportsBatchUpdates) {
|
|
60902
60911
|
acc.push(table.metadataToUpdateOperations(cur.entries, cur.segment));
|
|
@@ -61029,7 +61038,7 @@ class AbstractKeyValueDataTable {
|
|
|
61029
61038
|
},
|
|
61030
61039
|
conflictColumns: this.conflictColumnNames,
|
|
61031
61040
|
columns: this.columnNames,
|
|
61032
|
-
rows: keys$
|
|
61041
|
+
rows: keys$a(entries).reduce((rows, key) => {
|
|
61033
61042
|
const entry = entries[key];
|
|
61034
61043
|
rows.push([key, stringify$7(entry.data)]);
|
|
61035
61044
|
return rows;
|
|
@@ -62540,7 +62549,7 @@ function getRuntime() {
|
|
|
62540
62549
|
const draftService = new UiApiDraftRecordService(lazyDraftQueue, () => lazyLuvio, recordDenormingStore, getObjectInfo, newRecordId, userId, formatDisplayValue);
|
|
62541
62550
|
const uiApiRecordHandler = new UiApiActionHandler(() => lazyLuvio, lazyNetworkAdapter, recordDenormingStore, lazyDraftQueue, getRecord, lazyObjectInfoService, isGenerated, draftService);
|
|
62542
62551
|
const quickActionHandler = new QuickActionExecutionRepresentationHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated);
|
|
62543
|
-
const contentDocumentCompositeActionHandler = new ContentDocumentCompositeRepresentationActionHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated,
|
|
62552
|
+
const contentDocumentCompositeActionHandler = new ContentDocumentCompositeRepresentationActionHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated, NimbusBinaryStore);
|
|
62544
62553
|
lazyDraftQueue.addHandler(uiApiRecordHandler);
|
|
62545
62554
|
lazyDraftQueue.addHandler(quickActionHandler);
|
|
62546
62555
|
lazyDraftQueue.addHandler(contentDocumentCompositeActionHandler);
|
|
@@ -62639,7 +62648,7 @@ register$1({
|
|
|
62639
62648
|
id: '@salesforce/lds-network-adapter',
|
|
62640
62649
|
instrument: instrument$2,
|
|
62641
62650
|
});
|
|
62642
|
-
// version: 1.
|
|
62651
|
+
// version: 1.297.0-1fc775982
|
|
62643
62652
|
|
|
62644
62653
|
const { create: create$3, keys: keys$3 } = Object;
|
|
62645
62654
|
const { stringify: stringify$1, parse: parse$1 } = JSON;
|
|
@@ -82708,7 +82717,7 @@ register$1({
|
|
|
82708
82717
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
82709
82718
|
instrument: instrument$1,
|
|
82710
82719
|
});
|
|
82711
|
-
// version: 1.
|
|
82720
|
+
// version: 1.297.0-e0cfbd880
|
|
82712
82721
|
|
|
82713
82722
|
// On core the unstable adapters are re-exported with different names,
|
|
82714
82723
|
// we want to match them here.
|
|
@@ -84964,7 +84973,7 @@ withDefaultLuvio((luvio) => {
|
|
|
84964
84973
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
84965
84974
|
graphQLImperative = ldsAdapter;
|
|
84966
84975
|
});
|
|
84967
|
-
// version: 1.
|
|
84976
|
+
// version: 1.297.0-e0cfbd880
|
|
84968
84977
|
|
|
84969
84978
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
84970
84979
|
__proto__: null,
|
|
@@ -85699,7 +85708,7 @@ const callbacks$1 = [];
|
|
|
85699
85708
|
function register(r) {
|
|
85700
85709
|
callbacks$1.forEach((callback) => callback(r));
|
|
85701
85710
|
}
|
|
85702
|
-
// version: 1.
|
|
85711
|
+
// version: 1.297.0-1fc775982
|
|
85703
85712
|
|
|
85704
85713
|
/**
|
|
85705
85714
|
* Returns true if the value acts like a Promise, i.e. has a "then" function,
|
|
@@ -90661,4 +90670,4 @@ const { luvio } = getRuntime();
|
|
|
90661
90670
|
setDefaultLuvio({ luvio });
|
|
90662
90671
|
|
|
90663
90672
|
export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
|
|
90664
|
-
// version: 1.
|
|
90673
|
+
// version: 1.297.0-1fc775982
|