@salesforce/lds-worker-api 1.296.1 → 1.298.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 +3 -2
- package/dist/standalone/es/lds-worker-api.js +572 -551
- package/dist/standalone/umd/lds-worker-api.js +572 -551
- 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.298.0-3a2eedddc
|
|
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.298.0-3a2eedddc
|
|
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.298.0-3a2eedddc
|
|
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) {
|
|
@@ -43198,11 +43198,23 @@ function validateAdapterConfig$2$1(untrustedConfig, configPropertyNames) {
|
|
|
43198
43198
|
return config;
|
|
43199
43199
|
}
|
|
43200
43200
|
|
|
43201
|
+
const ISO8601_DATE_REGEX = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z$/;
|
|
43201
43202
|
function getHeaders(clientOptions) {
|
|
43202
43203
|
const headers = {};
|
|
43203
43204
|
if (untrustedIsObject$2(clientOptions)) {
|
|
43204
43205
|
if (typeof clientOptions.ifUnmodifiedSince === 'string') {
|
|
43205
43206
|
headers.ifUnmodifiedSince = clientOptions.ifUnmodifiedSince;
|
|
43207
|
+
// HTTP standard format date is expected by UI-API
|
|
43208
|
+
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Unmodified-Since
|
|
43209
|
+
// A component built for Connect API must use If-Unmodified-Since
|
|
43210
|
+
// dates formatted as ISO 8601, which does not match the HTTP spec.
|
|
43211
|
+
// For compatibility, convert the date to match the standard.
|
|
43212
|
+
if (headers.ifUnmodifiedSince.match(ISO8601_DATE_REGEX)) {
|
|
43213
|
+
const utcString = new Date(headers.ifUnmodifiedSince).toUTCString();
|
|
43214
|
+
if (utcString !== 'Invalid Date') {
|
|
43215
|
+
headers.ifUnmodifiedSince = utcString;
|
|
43216
|
+
}
|
|
43217
|
+
}
|
|
43206
43218
|
}
|
|
43207
43219
|
}
|
|
43208
43220
|
return headers;
|
|
@@ -44238,7 +44250,7 @@ withDefaultLuvio((luvio) => {
|
|
|
44238
44250
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
44239
44251
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
44240
44252
|
});
|
|
44241
|
-
// version: 1.
|
|
44253
|
+
// version: 1.298.0-6f15dc1ec
|
|
44242
44254
|
|
|
44243
44255
|
var ldsIdempotencyWriteDisabled = {
|
|
44244
44256
|
isOpen: function (e) {
|
|
@@ -44414,7 +44426,7 @@ var graphqlL2AdapterGate = {
|
|
|
44414
44426
|
const { parse: parse$6, stringify: stringify$6 } = JSON;
|
|
44415
44427
|
const { join: join$2, push: push$2, unshift } = Array.prototype;
|
|
44416
44428
|
const { isArray: isArray$5 } = Array;
|
|
44417
|
-
const { entries: entries$
|
|
44429
|
+
const { entries: entries$6, keys: keys$9 } = Object;
|
|
44418
44430
|
|
|
44419
44431
|
const UI_API_BASE_URI = '/services/data/v62.0/ui-api';
|
|
44420
44432
|
|
|
@@ -44479,7 +44491,7 @@ function isSpanningRecord$1(fieldValue) {
|
|
|
44479
44491
|
function mergeRecordFields$1(first, second) {
|
|
44480
44492
|
const { fields: targetFields } = first;
|
|
44481
44493
|
const { fields: sourceFields } = second;
|
|
44482
|
-
const fieldNames = keys$
|
|
44494
|
+
const fieldNames = keys$9(sourceFields);
|
|
44483
44495
|
for (let i = 0, len = fieldNames.length; i < len; i += 1) {
|
|
44484
44496
|
const fieldName = fieldNames[i];
|
|
44485
44497
|
const sourceField = sourceFields[fieldName];
|
|
@@ -44721,7 +44733,7 @@ function getFulfillingRequest(inflightRequests, resourceRequest) {
|
|
|
44721
44733
|
if (fulfill === undefined) {
|
|
44722
44734
|
return null;
|
|
44723
44735
|
}
|
|
44724
|
-
const handlersMap = entries$
|
|
44736
|
+
const handlersMap = entries$6(inflightRequests);
|
|
44725
44737
|
for (let i = 0, len = handlersMap.length; i < len; i += 1) {
|
|
44726
44738
|
const [transactionKey, handlers] = handlersMap[i];
|
|
44727
44739
|
// check fulfillment against only the first handler ([0]) because it's equal or
|
|
@@ -44886,7 +44898,7 @@ const RedirectDurableSegment = 'REDIRECT_KEYS';
|
|
|
44886
44898
|
const MessagingDurableSegment = 'MESSAGING';
|
|
44887
44899
|
const MessageNotifyStoreUpdateAvailable = 'notifyStoreUpdateAvailable';
|
|
44888
44900
|
|
|
44889
|
-
const { keys: keys$
|
|
44901
|
+
const { keys: keys$8, create: create$7, assign: assign$7, freeze: freeze$2$1 } = Object;
|
|
44890
44902
|
|
|
44891
44903
|
//Durable store error instrumentation key
|
|
44892
44904
|
const DURABLE_STORE_ERROR = 'durable-store-error';
|
|
@@ -44933,7 +44945,7 @@ function publishDurableStoreEntries(durableRecords, put, publishMetadata) {
|
|
|
44933
44945
|
if (durableRecords === undefined) {
|
|
44934
44946
|
return { revivedKeys, hadUnexpectedShape };
|
|
44935
44947
|
}
|
|
44936
|
-
const durableKeys = keys$
|
|
44948
|
+
const durableKeys = keys$8(durableRecords);
|
|
44937
44949
|
if (durableKeys.length === 0) {
|
|
44938
44950
|
// no records to revive
|
|
44939
44951
|
return { revivedKeys, hadUnexpectedShape };
|
|
@@ -45118,7 +45130,7 @@ class DurableTTLStore {
|
|
|
45118
45130
|
overrides,
|
|
45119
45131
|
};
|
|
45120
45132
|
}
|
|
45121
|
-
const keys$1 = keys$
|
|
45133
|
+
const keys$1 = keys$8(entries);
|
|
45122
45134
|
for (let i = 0, len = keys$1.length; i < len; i++) {
|
|
45123
45135
|
const key = keys$1[i];
|
|
45124
45136
|
const entry = entries[key];
|
|
@@ -45140,14 +45152,14 @@ class DurableTTLStore {
|
|
|
45140
45152
|
}
|
|
45141
45153
|
|
|
45142
45154
|
function flushInMemoryStoreValuesToDurableStore(store, durableStore, durableStoreErrorHandler, redirects, additionalDurableStoreOperations = [], enableDurableMetadataRefresh = false) {
|
|
45143
|
-
const durableRecords = create$
|
|
45144
|
-
const refreshedDurableRecords = create$
|
|
45145
|
-
const evictedRecords = create$
|
|
45155
|
+
const durableRecords = create$7(null);
|
|
45156
|
+
const refreshedDurableRecords = create$7(null);
|
|
45157
|
+
const evictedRecords = create$7(null);
|
|
45146
45158
|
const { visitedIds, refreshedIds } = store.fallbackStringKeyInMemoryStore;
|
|
45147
45159
|
// TODO: W-8909393 Once metadata is stored in its own segment we need to
|
|
45148
45160
|
// call setEntries for the visitedIds on default segment and call setEntries
|
|
45149
45161
|
// on the metadata segment for the refreshedIds
|
|
45150
|
-
const keys$1 = keys$
|
|
45162
|
+
const keys$1 = keys$8({ ...visitedIds, ...refreshedIds });
|
|
45151
45163
|
for (let i = 0, len = keys$1.length; i < len; i += 1) {
|
|
45152
45164
|
const key = keys$1[i];
|
|
45153
45165
|
const canonicalKey = store.getCanonicalRecordId(key);
|
|
@@ -45170,7 +45182,7 @@ function flushInMemoryStoreValuesToDurableStore(store, durableStore, durableStor
|
|
|
45170
45182
|
setRecordTo(entries, key, record, metadata);
|
|
45171
45183
|
}
|
|
45172
45184
|
const durableStoreOperations = additionalDurableStoreOperations;
|
|
45173
|
-
const recordKeys = keys$
|
|
45185
|
+
const recordKeys = keys$8(durableRecords);
|
|
45174
45186
|
if (recordKeys.length > 0) {
|
|
45175
45187
|
// publishes with data
|
|
45176
45188
|
durableStoreOperations.push({
|
|
@@ -45179,7 +45191,7 @@ function flushInMemoryStoreValuesToDurableStore(store, durableStore, durableStor
|
|
|
45179
45191
|
segment: DefaultDurableSegment,
|
|
45180
45192
|
});
|
|
45181
45193
|
}
|
|
45182
|
-
const refreshKeys = keys$
|
|
45194
|
+
const refreshKeys = keys$8(refreshedDurableRecords);
|
|
45183
45195
|
if (refreshKeys.length > 0) {
|
|
45184
45196
|
// publishes with only metadata updates
|
|
45185
45197
|
durableStoreOperations.push({
|
|
@@ -45201,7 +45213,7 @@ function flushInMemoryStoreValuesToDurableStore(store, durableStore, durableStor
|
|
|
45201
45213
|
});
|
|
45202
45214
|
});
|
|
45203
45215
|
// evicts
|
|
45204
|
-
const evictedKeys = keys$
|
|
45216
|
+
const evictedKeys = keys$8(evictedRecords);
|
|
45205
45217
|
if (evictedKeys.length > 0) {
|
|
45206
45218
|
durableStoreOperations.push({
|
|
45207
45219
|
type: 'evictEntries',
|
|
@@ -45305,7 +45317,7 @@ function buildRevivingStagingStore(upstreamStore) {
|
|
|
45305
45317
|
// A reviving store is only "active" during a call to `environment.storeLookup`, and will
|
|
45306
45318
|
// be used by the reader attempting to build an L1 snapshot. Immediately after the L1 rebuild
|
|
45307
45319
|
// the reviving store becomes inactive other than receiving change notifications.
|
|
45308
|
-
return create$
|
|
45320
|
+
return create$7(upstreamStore, {
|
|
45309
45321
|
readEntry: { value: readEntry },
|
|
45310
45322
|
markStale: { value: markStale },
|
|
45311
45323
|
clearStale: { value: clearStale },
|
|
@@ -45317,7 +45329,7 @@ const AdapterContextSegment = 'ADAPTER-CONTEXT';
|
|
|
45317
45329
|
const ADAPTER_CONTEXT_ID_SUFFIX = '__NAMED_CONTEXT';
|
|
45318
45330
|
async function reviveOrCreateContext(adapterId, durableStore, durableStoreErrorHandler, contextStores, pendingContextStoreKeys, onContextLoaded) {
|
|
45319
45331
|
// initialize empty context store
|
|
45320
|
-
contextStores[adapterId] = create$
|
|
45332
|
+
contextStores[adapterId] = create$7(null);
|
|
45321
45333
|
const context = {
|
|
45322
45334
|
set(key, value) {
|
|
45323
45335
|
contextStores[adapterId][key] = value;
|
|
@@ -45382,7 +45394,7 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
|
|
|
45382
45394
|
const revivingStores = new Set();
|
|
45383
45395
|
// redirects that need to be flushed to the durable store
|
|
45384
45396
|
const pendingStoreRedirects = new Map();
|
|
45385
|
-
const contextStores = create$
|
|
45397
|
+
const contextStores = create$7(null);
|
|
45386
45398
|
let initializationPromise = new Promise((resolve) => {
|
|
45387
45399
|
const finish = () => {
|
|
45388
45400
|
resolve();
|
|
@@ -45459,7 +45471,7 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
|
|
|
45459
45471
|
try {
|
|
45460
45472
|
const entries = await durableStore.getEntries(adapterContextKeysFromDifferentInstance, AdapterContextSegment);
|
|
45461
45473
|
if (entries !== undefined) {
|
|
45462
|
-
const entryKeys = keys$
|
|
45474
|
+
const entryKeys = keys$8(entries);
|
|
45463
45475
|
for (let i = 0, len = entryKeys.length; i < len; i++) {
|
|
45464
45476
|
const entryKey = entryKeys[i];
|
|
45465
45477
|
const entry = entries[entryKey];
|
|
@@ -45494,7 +45506,7 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
|
|
|
45494
45506
|
if (filteredKeys.length > 0) {
|
|
45495
45507
|
const entries = await durableStore.getMetadata(filteredKeys, DefaultDurableSegment);
|
|
45496
45508
|
if (entries !== undefined) {
|
|
45497
|
-
const entryKeys = keys$
|
|
45509
|
+
const entryKeys = keys$8(entries);
|
|
45498
45510
|
for (let i = 0, len = entryKeys.length; i < len; i++) {
|
|
45499
45511
|
const entryKey = entryKeys[i];
|
|
45500
45512
|
const { metadata } = entries[entryKey];
|
|
@@ -45866,7 +45878,7 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
|
|
|
45866
45878
|
validateNotDisposed();
|
|
45867
45879
|
const entryKeys = keys$1.map(serializeStructuredKey);
|
|
45868
45880
|
const entries = await durableStore.getEntries(entryKeys, DefaultDurableSegment);
|
|
45869
|
-
if (entries === undefined || keys$
|
|
45881
|
+
if (entries === undefined || keys$8(entries).length === 0) {
|
|
45870
45882
|
return environment.notifyStoreUpdateAvailable(keys$1);
|
|
45871
45883
|
}
|
|
45872
45884
|
const now = Date.now();
|
|
@@ -45918,7 +45930,7 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
|
|
|
45918
45930
|
type: 'stale-while-revalidate',
|
|
45919
45931
|
staleDurationSeconds: Number.MAX_SAFE_INTEGER,
|
|
45920
45932
|
});
|
|
45921
|
-
return create$
|
|
45933
|
+
return create$7(environment, {
|
|
45922
45934
|
publishStoreMetadata: { value: publishStoreMetadata },
|
|
45923
45935
|
storeIngest: { value: storeIngest },
|
|
45924
45936
|
storeIngestError: { value: storeIngestError },
|
|
@@ -45954,14 +45966,10 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
|
|
|
45954
45966
|
* For full license text, see the LICENSE.txt file
|
|
45955
45967
|
*/
|
|
45956
45968
|
|
|
45957
|
-
|
|
45958
|
-
function isStoreKeyRecordId(key) {
|
|
45959
|
-
return key.indexOf(RECORD_ID_PREFIX$1) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION$1) === -1;
|
|
45960
|
-
}
|
|
45961
45969
|
function isStoreKeyRecordField(key) {
|
|
45962
45970
|
return key.indexOf(RECORD_ID_PREFIX$1) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION$1) > -1;
|
|
45963
45971
|
}
|
|
45964
|
-
function buildRecordFieldStoreKey(recordKey, fieldName) {
|
|
45972
|
+
function buildRecordFieldStoreKey$1(recordKey, fieldName) {
|
|
45965
45973
|
return `${recordKey}${RECORD_FIELDS_KEY_JUNCTION$1}${fieldName}`;
|
|
45966
45974
|
}
|
|
45967
45975
|
function objectsDeepEqual(lhs, rhs) {
|
|
@@ -45988,15 +45996,6 @@ function objectsDeepEqual(lhs, rhs) {
|
|
|
45988
45996
|
return true;
|
|
45989
45997
|
}
|
|
45990
45998
|
|
|
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
45999
|
/**
|
|
46001
46000
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
46002
46001
|
* All rights reserved.
|
|
@@ -46382,7 +46381,7 @@ function isFailure(result) {
|
|
|
46382
46381
|
function errors(result) {
|
|
46383
46382
|
return result.error;
|
|
46384
46383
|
}
|
|
46385
|
-
function values$
|
|
46384
|
+
function values$5(result) {
|
|
46386
46385
|
return result.value;
|
|
46387
46386
|
}
|
|
46388
46387
|
function flattenResults(results) {
|
|
@@ -46390,7 +46389,7 @@ function flattenResults(results) {
|
|
|
46390
46389
|
if (fails.length > 0) {
|
|
46391
46390
|
return failure(fails);
|
|
46392
46391
|
}
|
|
46393
|
-
return success(results.filter(isSuccess).map(values$
|
|
46392
|
+
return success(results.filter(isSuccess).map(values$5));
|
|
46394
46393
|
}
|
|
46395
46394
|
|
|
46396
46395
|
function getFieldInfo(apiName, fieldName, infoMap) {
|
|
@@ -47207,7 +47206,7 @@ function compoundOperatorToSql(operator) {
|
|
|
47207
47206
|
}
|
|
47208
47207
|
|
|
47209
47208
|
const { isArray: isArray$4 } = Array;
|
|
47210
|
-
const { keys: keys$
|
|
47209
|
+
const { keys: keys$7 } = Object;
|
|
47211
47210
|
|
|
47212
47211
|
function isListValueNode(node) {
|
|
47213
47212
|
return node.kind === 'ListValue';
|
|
@@ -47275,7 +47274,7 @@ function fieldsToFilters(fieldValues, joinAlias, apiName, input, compoundOperato
|
|
|
47275
47274
|
if (failures.length > 0) {
|
|
47276
47275
|
return failure(failures);
|
|
47277
47276
|
}
|
|
47278
|
-
const containers = results.filter(isSuccess).map(values$
|
|
47277
|
+
const containers = results.filter(isSuccess).map(values$5);
|
|
47279
47278
|
const predicates = [];
|
|
47280
47279
|
containers.forEach((c) => {
|
|
47281
47280
|
if (c.predicate !== undefined) {
|
|
@@ -47567,7 +47566,7 @@ function dateFunctions(operatorNode, extract, dataType) {
|
|
|
47567
47566
|
if (fails.length > 0) {
|
|
47568
47567
|
return failure(fails);
|
|
47569
47568
|
}
|
|
47570
|
-
const vals = results.filter(isSuccess).reduce(flatMap$1(values$
|
|
47569
|
+
const vals = results.filter(isSuccess).reduce(flatMap$1(values$5), []);
|
|
47571
47570
|
return success(vals);
|
|
47572
47571
|
}
|
|
47573
47572
|
function isFilterFunction(name) {
|
|
@@ -47577,7 +47576,7 @@ function fieldOperators(operatorNode, dataType) {
|
|
|
47577
47576
|
const results = Object.entries(operatorNode.fields)
|
|
47578
47577
|
.filter(([key, _]) => isFilterFunction(key) === false)
|
|
47579
47578
|
.map(([key, value]) => operatorWithValue(key, value, dataType));
|
|
47580
|
-
const _values = results.filter(isSuccess).map(values$
|
|
47579
|
+
const _values = results.filter(isSuccess).map(values$5);
|
|
47581
47580
|
const fails = results.filter(isFailure).reduce(flatMap$1(errors), []);
|
|
47582
47581
|
if (fails.length > 0) {
|
|
47583
47582
|
return failure(fails);
|
|
@@ -48498,7 +48497,7 @@ function selectionToQueryField(node, names, parentApiName, parentAlias, input, j
|
|
|
48498
48497
|
}
|
|
48499
48498
|
function recordFields(luvioSelections, names, parentApiName, parentAlias, input, joins) {
|
|
48500
48499
|
const results = luvioSelections.map((selection) => selectionToQueryField(selection, names, parentApiName, parentAlias, input, joins));
|
|
48501
|
-
const fields = results.filter(isSuccess).reduce(flatMap$1(values$
|
|
48500
|
+
const fields = results.filter(isSuccess).reduce(flatMap$1(values$5), []);
|
|
48502
48501
|
const fails = results.filter(isFailure).reduce(flatMap$1(errors), []);
|
|
48503
48502
|
if (fails.length > 0) {
|
|
48504
48503
|
return failure(fails);
|
|
@@ -48746,7 +48745,7 @@ function rootRecordQuery(selection, input) {
|
|
|
48746
48745
|
}
|
|
48747
48746
|
function rootQuery(recordNodes, input) {
|
|
48748
48747
|
const results = recordNodes.map((record) => rootRecordQuery(record, input));
|
|
48749
|
-
const connections = results.filter(isSuccess).map(values$
|
|
48748
|
+
const connections = results.filter(isSuccess).map(values$5);
|
|
48750
48749
|
const fails = results.filter(isFailure).reduce(flatMap$1(errors), []);
|
|
48751
48750
|
if (fails.length > 0) {
|
|
48752
48751
|
return failure(fails);
|
|
@@ -48842,7 +48841,7 @@ function generateVariableSubQuery(valueNode, name, type, variables) {
|
|
|
48842
48841
|
switch (valueNode.kind) {
|
|
48843
48842
|
case Kind$1.OBJECT: {
|
|
48844
48843
|
// For example, `{ Id: { eq: $draftId } }` is a `ObjectValueNode`, which has field keys 'Id'
|
|
48845
|
-
const resultQuery = keys$
|
|
48844
|
+
const resultQuery = keys$7(valueNode.fields)
|
|
48846
48845
|
.map((key) => generateVariableSubQuery(valueNode.fields[key], key, type, variables))
|
|
48847
48846
|
.filter((subquery) => subquery.length > 0)
|
|
48848
48847
|
.join(',');
|
|
@@ -48918,7 +48917,7 @@ function swapArgumentWithVariableNodes(swapped, original) {
|
|
|
48918
48917
|
}
|
|
48919
48918
|
function swapValueNodeWithVariableNodes(original, swapped) {
|
|
48920
48919
|
if (original.kind === Kind$1.OBJECT) {
|
|
48921
|
-
for (const key of keys$
|
|
48920
|
+
for (const key of keys$7(original.fields)) {
|
|
48922
48921
|
if (isObjectValueNode$1(swapped) && swapped.fields[key]) {
|
|
48923
48922
|
if (is(original.fields[key], 'Variable')) {
|
|
48924
48923
|
original.fields[key] = swapped.fields[key];
|
|
@@ -49527,7 +49526,7 @@ function createDraftSynthesisErrorResponse(message = 'failed to synthesize draft
|
|
|
49527
49526
|
return new DraftErrorFetchResponse(HttpStatusCode$1.BadRequest, error);
|
|
49528
49527
|
}
|
|
49529
49528
|
|
|
49530
|
-
const { keys: keys$
|
|
49529
|
+
const { keys: keys$6, create: create$6, assign: assign$6, values: values$4 } = Object;
|
|
49531
49530
|
const { stringify: stringify$5, parse: parse$5 } = JSON;
|
|
49532
49531
|
const { isArray: isArray$3$1 } = Array;
|
|
49533
49532
|
|
|
@@ -49637,13 +49636,13 @@ function buildLuvioOverrideForDraftAdapters(luvio, handler, extractTargetIdFromC
|
|
|
49637
49636
|
}
|
|
49638
49637
|
softEvict(key);
|
|
49639
49638
|
};
|
|
49640
|
-
return create$
|
|
49639
|
+
return create$6(luvio, {
|
|
49641
49640
|
dispatchResourceRequest: { value: dispatchResourceRequest },
|
|
49642
49641
|
publishStoreMetadata: { value: publishStoreMetadata },
|
|
49643
49642
|
storeEvict: { value: storeEvict },
|
|
49644
49643
|
});
|
|
49645
49644
|
}
|
|
49646
|
-
return create$
|
|
49645
|
+
return create$6(luvio, {
|
|
49647
49646
|
dispatchResourceRequest: { value: dispatchResourceRequest },
|
|
49648
49647
|
publishStoreMetadata: { value: publishStoreMetadata },
|
|
49649
49648
|
});
|
|
@@ -49677,7 +49676,7 @@ async function getDraftIdMappings(durableStore, mappingIds) {
|
|
|
49677
49676
|
if (entries === undefined) {
|
|
49678
49677
|
return mappings;
|
|
49679
49678
|
}
|
|
49680
|
-
const keys$1 = keys$
|
|
49679
|
+
const keys$1 = keys$6(entries);
|
|
49681
49680
|
for (const key of keys$1) {
|
|
49682
49681
|
const entry = entries[key].data;
|
|
49683
49682
|
if (isLegacyDraftIdMapping(key)) {
|
|
@@ -49695,7 +49694,7 @@ async function getDraftIdMappings(durableStore, mappingIds) {
|
|
|
49695
49694
|
async function clearDraftIdSegment(durableStore) {
|
|
49696
49695
|
const entries = await durableStore.getAllEntries(DRAFT_ID_MAPPINGS_SEGMENT);
|
|
49697
49696
|
if (entries) {
|
|
49698
|
-
const keys$1 = keys$
|
|
49697
|
+
const keys$1 = keys$6(entries);
|
|
49699
49698
|
if (keys$1.length > 0) {
|
|
49700
49699
|
await durableStore.evictEntries(keys$1, DRAFT_ID_MAPPINGS_SEGMENT);
|
|
49701
49700
|
}
|
|
@@ -49954,7 +49953,7 @@ class DurableDraftQueue {
|
|
|
49954
49953
|
const queueOperations = handler.getQueueOperationsForCompletingDrafts(queue, action);
|
|
49955
49954
|
// write the queue operations to the store prior to ingesting the result
|
|
49956
49955
|
await this.draftStore.completeAction(queueOperations);
|
|
49957
|
-
await handler.handleActionCompleted(action, queueOperations, values$
|
|
49956
|
+
await handler.handleActionCompleted(action, queueOperations, values$4(this.handlers));
|
|
49958
49957
|
this.retryIntervalMilliseconds = 0;
|
|
49959
49958
|
this.uploadingActionId = undefined;
|
|
49960
49959
|
await this.notifyChangedListeners({
|
|
@@ -50106,7 +50105,7 @@ class DurableDraftQueue {
|
|
|
50106
50105
|
return this.replaceOrMergeActions(targetActionId, sourceActionId, true);
|
|
50107
50106
|
}
|
|
50108
50107
|
async setMetadata(actionId, metadata) {
|
|
50109
|
-
const keys$1 = keys$
|
|
50108
|
+
const keys$1 = keys$6(metadata);
|
|
50110
50109
|
const compatibleKeys = keys$1.filter((key) => {
|
|
50111
50110
|
const value = metadata[key];
|
|
50112
50111
|
return typeof key === 'string' && typeof value === 'string';
|
|
@@ -50261,7 +50260,7 @@ class DurableDraftStore {
|
|
|
50261
50260
|
const waitForOngoingSync = this.syncPromise || Promise.resolve();
|
|
50262
50261
|
return waitForOngoingSync.then(() => {
|
|
50263
50262
|
const { draftStore } = this;
|
|
50264
|
-
const keys$1 = keys$
|
|
50263
|
+
const keys$1 = keys$6(draftStore);
|
|
50265
50264
|
const actionArray = [];
|
|
50266
50265
|
for (let i = 0, len = keys$1.length; i < len; i++) {
|
|
50267
50266
|
const key = keys$1[i];
|
|
@@ -50285,7 +50284,7 @@ class DurableDraftStore {
|
|
|
50285
50284
|
deleteByTag(tag) {
|
|
50286
50285
|
const deleteAction = () => {
|
|
50287
50286
|
const { draftStore } = this;
|
|
50288
|
-
const keys$1 = keys$
|
|
50287
|
+
const keys$1 = keys$6(draftStore);
|
|
50289
50288
|
const durableKeys = [];
|
|
50290
50289
|
for (let i = 0, len = keys$1.length; i < len; i++) {
|
|
50291
50290
|
const key = keys$1[i];
|
|
@@ -50375,7 +50374,7 @@ class DurableDraftStore {
|
|
|
50375
50374
|
return this.runQueuedOperations();
|
|
50376
50375
|
}
|
|
50377
50376
|
const { draftStore } = this;
|
|
50378
|
-
const keys$1 = keys$
|
|
50377
|
+
const keys$1 = keys$6(durableEntries);
|
|
50379
50378
|
for (let i = 0, len = keys$1.length; i < len; i++) {
|
|
50380
50379
|
const entry = durableEntries[keys$1[i]];
|
|
50381
50380
|
const action = entry.data;
|
|
@@ -51249,7 +51248,7 @@ function makeEnvironmentDraftAware(luvio, env, durableStore, handlers, draftQueu
|
|
|
51249
51248
|
decrementRefCount(key);
|
|
51250
51249
|
};
|
|
51251
51250
|
// note the makeEnvironmentUiApiRecordDraftAware will eventually go away once the adapters become draft aware
|
|
51252
|
-
return create$
|
|
51251
|
+
return create$6(env, {
|
|
51253
51252
|
storePublish: { value: storePublish },
|
|
51254
51253
|
handleSuccessResponse: { value: handleSuccessResponse },
|
|
51255
51254
|
softEvict: { value: softEvict },
|
|
@@ -51263,7 +51262,7 @@ function makeEnvironmentDraftAware(luvio, env, durableStore, handlers, draftQueu
|
|
|
51263
51262
|
*/
|
|
51264
51263
|
|
|
51265
51264
|
|
|
51266
|
-
const { keys: keys$
|
|
51265
|
+
const { keys: keys$5, values: values$3, create: create$5, assign: assign$5, freeze: freeze$1$1, entries: entries$5 } = Object;
|
|
51267
51266
|
const { stringify: stringify$4, parse: parse$4 } = JSON;
|
|
51268
51267
|
const { shift } = Array.prototype;
|
|
51269
51268
|
const { isArray: isArray$2$1, from: from$2 } = Array;
|
|
@@ -51330,7 +51329,7 @@ function getRecordKeyForId(luvio, recordId) {
|
|
|
51330
51329
|
*/
|
|
51331
51330
|
function filterOutReferenceFieldsAndLinks(record) {
|
|
51332
51331
|
const filteredFields = {};
|
|
51333
|
-
const fieldNames = keys$
|
|
51332
|
+
const fieldNames = keys$5(record.fields);
|
|
51334
51333
|
for (const fieldName of fieldNames) {
|
|
51335
51334
|
const field = record.fields[fieldName];
|
|
51336
51335
|
if (isFieldLink(field) === false) {
|
|
@@ -51431,7 +51430,7 @@ function getRecordDraftEnvironment(luvio, env, { isDraftId, durableStore }) {
|
|
|
51431
51430
|
const resolvedRequest = resolveResourceRequestIds(luvio, resourceRequest, canonicalKey);
|
|
51432
51431
|
return env.dispatchResourceRequest(resolvedRequest, context, eventObservers);
|
|
51433
51432
|
};
|
|
51434
|
-
return create$
|
|
51433
|
+
return create$5(env, {
|
|
51435
51434
|
dispatchResourceRequest: { value: dispatchResourceRequest },
|
|
51436
51435
|
});
|
|
51437
51436
|
}
|
|
@@ -51609,7 +51608,7 @@ function getRecordsDraftEnvironment(luvio, env, { isDraftId }) {
|
|
|
51609
51608
|
return applyDraftsToBatchResponse(resourceRequest, response, removedDraftIds);
|
|
51610
51609
|
}));
|
|
51611
51610
|
};
|
|
51612
|
-
return create$
|
|
51611
|
+
return create$5(env, {
|
|
51613
51612
|
dispatchResourceRequest: { value: dispatchResourceRequest },
|
|
51614
51613
|
});
|
|
51615
51614
|
}
|
|
@@ -51619,7 +51618,7 @@ function makeEnvironmentUiApiRecordDraftAware(luvio, options, env) {
|
|
|
51619
51618
|
const adapterSpecificEnvironments = synthesizers.reduce((environment, synthesizer) => {
|
|
51620
51619
|
return synthesizer(luvio, environment, options);
|
|
51621
51620
|
}, env);
|
|
51622
|
-
return create$
|
|
51621
|
+
return create$5(adapterSpecificEnvironments, {});
|
|
51623
51622
|
}
|
|
51624
51623
|
|
|
51625
51624
|
function clone(obj) {
|
|
@@ -51713,7 +51712,7 @@ function compoundNameFieldFromDraftUpdates(record, draftFields, apiName, objectI
|
|
|
51713
51712
|
changedNameFields[fieldName] = fieldValue;
|
|
51714
51713
|
}
|
|
51715
51714
|
}
|
|
51716
|
-
if (keys$
|
|
51715
|
+
if (keys$5(changedNameFields).length > 0) {
|
|
51717
51716
|
const newNameValue = filteredNameFields
|
|
51718
51717
|
.map((key) => {
|
|
51719
51718
|
if (changedNameFields[key] !== undefined) {
|
|
@@ -51796,7 +51795,7 @@ function recursivelyApplyDraftsToRecord(record, draftMetadata, recordOperations)
|
|
|
51796
51795
|
const injectedCompoundNameField = compoundNameFieldFromDraftUpdates(record, draftOperationFields, apiName, objectInfos);
|
|
51797
51796
|
// inject the compound Name field into the DraftOperation so on broadcast it doesnt try to
|
|
51798
51797
|
// synthesize the Name field a second time when the durable store change notifier is triggered
|
|
51799
|
-
if (keys$
|
|
51798
|
+
if (keys$5(injectedCompoundNameField).length > 0 && draftActionType === 'update') {
|
|
51800
51799
|
draftOperation.fields['Name'] = injectedCompoundNameField['Name'];
|
|
51801
51800
|
}
|
|
51802
51801
|
const fields = { ...draftOperationFields, ...injectedCompoundNameField };
|
|
@@ -51807,7 +51806,7 @@ function recursivelyApplyDraftsToRecord(record, draftMetadata, recordOperations)
|
|
|
51807
51806
|
LastModifiedDate: lastModifiedDate,
|
|
51808
51807
|
};
|
|
51809
51808
|
const draftFields = buildRecordFieldValueRepresentationsFromDraftFields(luvio, apiName, internalFields, objectInfos, referencedRecords, formatDisplayValue);
|
|
51810
|
-
const fieldNames = keys$
|
|
51809
|
+
const fieldNames = keys$5(draftFields);
|
|
51811
51810
|
for (let i = 0, len = fieldNames.length; i < len; i++) {
|
|
51812
51811
|
const fieldName = fieldNames[i];
|
|
51813
51812
|
// don't apply server values to draft created records
|
|
@@ -51868,7 +51867,7 @@ function removeDrafts(record, luvio, objectInfo) {
|
|
|
51868
51867
|
return undefined;
|
|
51869
51868
|
}
|
|
51870
51869
|
const updatedFields = {};
|
|
51871
|
-
const fieldNames = keys$
|
|
51870
|
+
const fieldNames = keys$5(fields);
|
|
51872
51871
|
for (let i = 0, len = fieldNames.length; i < len; i++) {
|
|
51873
51872
|
const fieldName = fieldNames[i];
|
|
51874
51873
|
const field = fields[fieldName];
|
|
@@ -51915,7 +51914,7 @@ function removeDrafts(record, luvio, objectInfo) {
|
|
|
51915
51914
|
* @param fields List of draft record fields
|
|
51916
51915
|
*/
|
|
51917
51916
|
function buildRecordFieldValueRepresentationsFromDraftFields(luvio, apiName, fields, objectInfos, referencedRecords, formatDisplayValue) {
|
|
51918
|
-
const fieldNames = keys$
|
|
51917
|
+
const fieldNames = keys$5(fields);
|
|
51919
51918
|
const recordFields = {};
|
|
51920
51919
|
const objectInfo = objectInfos.get(apiName);
|
|
51921
51920
|
for (let i = 0, len = fieldNames.length; i < len; i++) {
|
|
@@ -51983,7 +51982,7 @@ function buildSyntheticRecordRepresentation(luvio, createOperation, userId, obje
|
|
|
51983
51982
|
draftFields[DEFAULT_FIELD_LAST_MODIFIED_DATE] = { value: timestampString, displayValue: null };
|
|
51984
51983
|
draftFields[DEFAULT_FIELD_OWNER_ID] = { value: userId, displayValue: null };
|
|
51985
51984
|
draftFields[DEFAULT_FIELD_ID] = { value: recordId, displayValue: null };
|
|
51986
|
-
const allObjectFields = keys$
|
|
51985
|
+
const allObjectFields = keys$5(objectInfo.fields);
|
|
51987
51986
|
allObjectFields.forEach((fieldName) => {
|
|
51988
51987
|
if (draftFields[fieldName] === undefined) {
|
|
51989
51988
|
draftFields[fieldName] = { value: null, displayValue: null };
|
|
@@ -52124,7 +52123,7 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
52124
52123
|
this.isDraftId = isDraftId;
|
|
52125
52124
|
this.recordService = recordService;
|
|
52126
52125
|
this.handlerId = LDS_ACTION_HANDLER_ID;
|
|
52127
|
-
this.collectedFields = create$
|
|
52126
|
+
this.collectedFields = create$5(null);
|
|
52128
52127
|
recordService.registerRecordHandler(this);
|
|
52129
52128
|
}
|
|
52130
52129
|
async buildPendingAction(request, queue) {
|
|
@@ -52186,7 +52185,7 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
52186
52185
|
throw Error(`Could not generate draft. Object info is missing`);
|
|
52187
52186
|
}
|
|
52188
52187
|
const appendedFields = this.getBackdatingFields(objectInfo, resolvedRequest.method, pendingAction);
|
|
52189
|
-
if (keys$
|
|
52188
|
+
if (keys$5(appendedFields).length > 0) {
|
|
52190
52189
|
pendingAction.data.body = {
|
|
52191
52190
|
...pendingAction.data.body,
|
|
52192
52191
|
fields: {
|
|
@@ -52200,7 +52199,7 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
52200
52199
|
}
|
|
52201
52200
|
getBackdatingFields(objectInfo, requestMethod, pendingAction) {
|
|
52202
52201
|
const fields = {};
|
|
52203
|
-
const actionFieldNames = keys$
|
|
52202
|
+
const actionFieldNames = keys$5(pendingAction.data.body.fields);
|
|
52204
52203
|
if (requestMethod === 'post') {
|
|
52205
52204
|
// `CreateRecord` with `CreatedDate` field
|
|
52206
52205
|
if (isBackdatingFieldEditable(objectInfo, DEFAULT_FIELD_CREATED_DATE$1, 'createable', actionFieldNames)) {
|
|
@@ -52246,7 +52245,7 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
52246
52245
|
return;
|
|
52247
52246
|
}
|
|
52248
52247
|
const objectInfo = objectInfoMap[apiName];
|
|
52249
|
-
const optionalFields = values$
|
|
52248
|
+
const optionalFields = values$3(objectInfo.fields).map((field) => `${apiName}.${field.apiName}`);
|
|
52250
52249
|
await getAdapterData(this.getRecordAdapter, {
|
|
52251
52250
|
recordId: referenceFieldInfo.id,
|
|
52252
52251
|
optionalFields,
|
|
@@ -52265,7 +52264,7 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
52265
52264
|
const referenceToInfos = fieldInfo.referenceToInfos;
|
|
52266
52265
|
const apiNames = referenceToInfos.map((referenceToInfo) => referenceToInfo.apiName);
|
|
52267
52266
|
const objectInfoMap = await this.objectInfoService.getObjectInfos(apiNames);
|
|
52268
|
-
for (const objectInfo of values$
|
|
52267
|
+
for (const objectInfo of values$3(objectInfoMap)) {
|
|
52269
52268
|
const { apiName, keyPrefix } = objectInfo;
|
|
52270
52269
|
if (keyPrefix !== null && id.startsWith(keyPrefix)) {
|
|
52271
52270
|
return apiName;
|
|
@@ -52393,17 +52392,17 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
52393
52392
|
// otherwise we're a record
|
|
52394
52393
|
if (draftMetadata === undefined) {
|
|
52395
52394
|
// no drafts applied to this record, publish and be done
|
|
52396
|
-
this.collectedFields = create$
|
|
52395
|
+
this.collectedFields = create$5(null);
|
|
52397
52396
|
return publishData(key, data);
|
|
52398
52397
|
}
|
|
52399
52398
|
// create a denormalized record with the collected fields
|
|
52400
|
-
const recordFieldNames = keys$
|
|
52399
|
+
const recordFieldNames = keys$5(data.fields);
|
|
52401
52400
|
const partialRecord = {
|
|
52402
52401
|
...data,
|
|
52403
52402
|
fields: {},
|
|
52404
52403
|
};
|
|
52405
52404
|
for (const fieldName of recordFieldNames) {
|
|
52406
|
-
const collectedField = this.collectedFields[buildRecordFieldStoreKey(key, fieldName)];
|
|
52405
|
+
const collectedField = this.collectedFields[buildRecordFieldStoreKey$1(key, fieldName)];
|
|
52407
52406
|
if (collectedField !== undefined) {
|
|
52408
52407
|
partialRecord.fields[fieldName] =
|
|
52409
52408
|
collectedField;
|
|
@@ -52419,15 +52418,15 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
52419
52418
|
lastModifiedDate: recordWithDrafts.lastModifiedDate,
|
|
52420
52419
|
lastModifiedById: recordWithDrafts.lastModifiedById,
|
|
52421
52420
|
};
|
|
52422
|
-
for (const fieldName of keys$
|
|
52423
|
-
const fieldKey = buildRecordFieldStoreKey(key, fieldName);
|
|
52421
|
+
for (const fieldName of keys$5(recordWithSpanningRefLinks.fields)) {
|
|
52422
|
+
const fieldKey = buildRecordFieldStoreKey$1(key, fieldName);
|
|
52424
52423
|
normalizedRecord.fields[fieldName] = { __ref: fieldKey };
|
|
52425
52424
|
publishData(fieldKey, recordWithSpanningRefLinks.fields[fieldName]);
|
|
52426
52425
|
}
|
|
52427
52426
|
// publish the normalized record
|
|
52428
52427
|
publishData(key, normalizedRecord);
|
|
52429
52428
|
// we've published the record, now clear the collected fields
|
|
52430
|
-
this.collectedFields = create$
|
|
52429
|
+
this.collectedFields = create$5(null);
|
|
52431
52430
|
}
|
|
52432
52431
|
updateMetadata(existingMetadata, incomingMetadata) {
|
|
52433
52432
|
// ensure the the api name cannot be overwritten in the incoming metadata
|
|
@@ -52464,7 +52463,7 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
52464
52463
|
let resolvedUrlParams = request.urlParams;
|
|
52465
52464
|
if (request.method === 'post' || request.method === 'patch') {
|
|
52466
52465
|
const bodyFields = resolvedBody.fields;
|
|
52467
|
-
const fieldNames = keys$
|
|
52466
|
+
const fieldNames = keys$5(bodyFields);
|
|
52468
52467
|
for (let i = 0, len = fieldNames.length; i < len; i++) {
|
|
52469
52468
|
const fieldName = fieldNames[i];
|
|
52470
52469
|
const fieldValue = bodyFields[fieldName];
|
|
@@ -52558,366 +52557,6 @@ function isBackdatingFieldEditable(objectInfo, backdatingFieldName, attributeNam
|
|
|
52558
52557
|
!draftActionFieldNames.includes(backdatingFieldName));
|
|
52559
52558
|
}
|
|
52560
52559
|
|
|
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
52560
|
/**
|
|
52922
52561
|
* This function takes an unknown error and normalizes it to an Error object
|
|
52923
52562
|
*/
|
|
@@ -52956,7 +52595,7 @@ function performQuickActionDraftEnvironment(luvio, env, handler) {
|
|
|
52956
52595
|
}
|
|
52957
52596
|
return createOkResponse(data);
|
|
52958
52597
|
};
|
|
52959
|
-
return create$
|
|
52598
|
+
return create$5(env, {
|
|
52960
52599
|
dispatchResourceRequest: { value: dispatchResourceRequest },
|
|
52961
52600
|
});
|
|
52962
52601
|
}
|
|
@@ -53023,7 +52662,7 @@ class UiApiDraftRecordService {
|
|
|
53023
52662
|
};
|
|
53024
52663
|
}
|
|
53025
52664
|
objectInfoMap.set(apiName, objectInfo);
|
|
53026
|
-
const fields = keys$
|
|
52665
|
+
const fields = keys$5(operation.fields);
|
|
53027
52666
|
const unexpectedFields = [];
|
|
53028
52667
|
for (const field of fields) {
|
|
53029
52668
|
const fieldInfo = objectInfo.fields[field];
|
|
@@ -53347,7 +52986,7 @@ function createContentDocumentAndVersionDraftAdapterFactory(luvio, binaryStore,
|
|
|
53347
52986
|
...trimmedDownData.contentVersion,
|
|
53348
52987
|
fields: cvFields,
|
|
53349
52988
|
};
|
|
53350
|
-
freeze$
|
|
52989
|
+
freeze$1$1(trimmedDownData);
|
|
53351
52990
|
snapshot.data = trimmedDownData;
|
|
53352
52991
|
}
|
|
53353
52992
|
eventEmitter({ type: 'create-content-document-and-version-draft-finished' });
|
|
@@ -53361,14 +53000,13 @@ const CONTENT_DOCUMENT_LINK_API_NAME = 'ContentDocumentLink';
|
|
|
53361
53000
|
const CONTENT_VERSION_API_NAME = 'ContentVersion';
|
|
53362
53001
|
const LATEST_PUBLISHED_VERSION_ID_FIELD = 'LatestPublishedVersionId';
|
|
53363
53002
|
class ContentDocumentCompositeRepresentationActionHandler extends AbstractResourceRequestActionHandler {
|
|
53364
|
-
constructor(getLuvio, draftRecordService, draftQueue, networkAdapter, isDraftId,
|
|
53003
|
+
constructor(getLuvio, draftRecordService, draftQueue, networkAdapter, isDraftId, binaryStore) {
|
|
53365
53004
|
super(draftQueue, networkAdapter, getLuvio);
|
|
53366
53005
|
this.getLuvio = getLuvio;
|
|
53367
53006
|
this.draftRecordService = draftRecordService;
|
|
53368
53007
|
this.draftQueue = draftQueue;
|
|
53369
53008
|
this.networkAdapter = networkAdapter;
|
|
53370
53009
|
this.isDraftId = isDraftId;
|
|
53371
|
-
this.durableStore = durableStore;
|
|
53372
53010
|
this.binaryStore = binaryStore;
|
|
53373
53011
|
this.binaryStoreUrlsToUpdate = new Map();
|
|
53374
53012
|
this.handlerId = HANDLER_ID;
|
|
@@ -53780,6 +53418,389 @@ function deleteRecordDraftAdapterFactory(luvio, actionHandler) {
|
|
|
53780
53418
|
};
|
|
53781
53419
|
}
|
|
53782
53420
|
|
|
53421
|
+
/**
|
|
53422
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
53423
|
+
* All rights reserved.
|
|
53424
|
+
* For full license text, see the LICENSE.txt file
|
|
53425
|
+
*/
|
|
53426
|
+
|
|
53427
|
+
|
|
53428
|
+
const { keys: keys$4, values: values$2, create: create$4, assign: assign$4, freeze: freeze$3, entries: entries$4 } = Object;
|
|
53429
|
+
|
|
53430
|
+
function buildRecordFieldStoreKey(recordKey, fieldName) {
|
|
53431
|
+
return `${recordKey}${RECORD_FIELDS_KEY_JUNCTION$1}${fieldName}`;
|
|
53432
|
+
}
|
|
53433
|
+
function isStoreKeyRecordId(key) {
|
|
53434
|
+
return key.indexOf(RECORD_ID_PREFIX$1) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION$1) === -1;
|
|
53435
|
+
}
|
|
53436
|
+
function createLink$2(key) {
|
|
53437
|
+
return { __ref: key };
|
|
53438
|
+
}
|
|
53439
|
+
function isStoreRecordError(storeRecord) {
|
|
53440
|
+
return storeRecord.__type === 'error';
|
|
53441
|
+
}
|
|
53442
|
+
function isEntryDurableRecordRepresentation(entry, key) {
|
|
53443
|
+
// Either a DurableRecordRepresentation or StoreRecordError can live at a record key
|
|
53444
|
+
return ((isStoreKeyRecordId(key) || isStoreKeyRecordViewEntity$1(key)) &&
|
|
53445
|
+
entry.data.__type === undefined);
|
|
53446
|
+
}
|
|
53447
|
+
/**
|
|
53448
|
+
* Records are stored in the durable store with scalar fields denormalized. This function takes that denoramlized
|
|
53449
|
+
* durable store record representation and normalizes it back out into the format the the luvio store expects it
|
|
53450
|
+
* @param key Record store key
|
|
53451
|
+
* @param entry Durable entry containing a denormalized record representation
|
|
53452
|
+
* @returns a set of entries containing the normalized record and its normalized fields
|
|
53453
|
+
*/
|
|
53454
|
+
function normalizeRecordFields(key, entry) {
|
|
53455
|
+
const { data: record } = entry;
|
|
53456
|
+
const { fields, links } = record;
|
|
53457
|
+
const missingFieldLinks = keys$4(links);
|
|
53458
|
+
const fieldNames = keys$4(fields);
|
|
53459
|
+
const normalizedFields = {};
|
|
53460
|
+
const returnEntries = {};
|
|
53461
|
+
// restore fields
|
|
53462
|
+
for (let i = 0, len = fieldNames.length; i < len; i++) {
|
|
53463
|
+
const fieldName = fieldNames[i];
|
|
53464
|
+
const field = fields[fieldName];
|
|
53465
|
+
const fieldKey = buildRecordFieldStoreKey(key, fieldName);
|
|
53466
|
+
returnEntries[fieldKey] = { data: field };
|
|
53467
|
+
normalizedFields[fieldName] = createLink$2(fieldKey);
|
|
53468
|
+
}
|
|
53469
|
+
// restore missing fields
|
|
53470
|
+
for (let i = 0, len = missingFieldLinks.length; i < len; i++) {
|
|
53471
|
+
const fieldName = missingFieldLinks[i];
|
|
53472
|
+
const link = links[fieldName];
|
|
53473
|
+
if (link.isMissing === true) {
|
|
53474
|
+
normalizedFields[fieldName] = { ...link, __ref: undefined };
|
|
53475
|
+
}
|
|
53476
|
+
}
|
|
53477
|
+
returnEntries[key] = {
|
|
53478
|
+
data: assign$4(record, { fields: normalizedFields }),
|
|
53479
|
+
metadata: entry.metadata,
|
|
53480
|
+
};
|
|
53481
|
+
return returnEntries;
|
|
53482
|
+
}
|
|
53483
|
+
/**
|
|
53484
|
+
* Transforms a record for storage in the durable store. The transformation involves denormalizing
|
|
53485
|
+
* scalar fields and persisting link metadata to transform back into a normalized representation
|
|
53486
|
+
*
|
|
53487
|
+
* If the record contains pending fields this will return undefined as pending records do not get persisted
|
|
53488
|
+
* to the durable store. There should be a refresh operation outbound that will bring in the updated record.
|
|
53489
|
+
*
|
|
53490
|
+
* @param normalizedRecord Record containing normalized field links
|
|
53491
|
+
* @param recordStore a store containing referenced record fields
|
|
53492
|
+
*/
|
|
53493
|
+
function buildDurableRecordRepresentation(normalizedRecord, records, pendingEntries, store) {
|
|
53494
|
+
const fields = normalizedRecord.fields;
|
|
53495
|
+
const filteredFields = {};
|
|
53496
|
+
const links = {};
|
|
53497
|
+
const fieldNames = keys$4(fields);
|
|
53498
|
+
for (let i = 0, len = fieldNames.length; i < len; i++) {
|
|
53499
|
+
const fieldName = fieldNames[i];
|
|
53500
|
+
const field = fields[fieldName];
|
|
53501
|
+
// pending fields get filtered out of the durable store
|
|
53502
|
+
const { pending } = field;
|
|
53503
|
+
if (pending === true) {
|
|
53504
|
+
// do not write records with pending fields to the durable store
|
|
53505
|
+
// there should be a refresh operation outbound that will bring in the updated record
|
|
53506
|
+
return undefined;
|
|
53507
|
+
}
|
|
53508
|
+
const { __ref } = field;
|
|
53509
|
+
if (__ref !== undefined) {
|
|
53510
|
+
let ref = records[__ref];
|
|
53511
|
+
if (pendingEntries !== undefined) {
|
|
53512
|
+
// If the ref was part of the pending write that takes precedence
|
|
53513
|
+
const pendingEntry = pendingEntries[__ref];
|
|
53514
|
+
if (pendingEntry !== undefined) {
|
|
53515
|
+
ref = pendingEntry.data;
|
|
53516
|
+
}
|
|
53517
|
+
}
|
|
53518
|
+
// if field reference exists then add it to our filteredFields
|
|
53519
|
+
if (ref !== undefined) {
|
|
53520
|
+
filteredFields[fieldName] = ref;
|
|
53521
|
+
}
|
|
53522
|
+
else {
|
|
53523
|
+
// if we have a store to read, try to find the field there too
|
|
53524
|
+
// The durable ingest staging store may pass through to L1, and
|
|
53525
|
+
// not all fields are necessarily published every time, so it is
|
|
53526
|
+
// important to check L1 and not just the fields being published,
|
|
53527
|
+
// otherwise we risk truncating the fields on the record.
|
|
53528
|
+
if (store) {
|
|
53529
|
+
ref = store.readEntry(__ref);
|
|
53530
|
+
if (ref !== undefined) {
|
|
53531
|
+
filteredFields[fieldName] = ref;
|
|
53532
|
+
}
|
|
53533
|
+
}
|
|
53534
|
+
}
|
|
53535
|
+
}
|
|
53536
|
+
// we want to preserve fields that are missing nodes
|
|
53537
|
+
if (field.isMissing === true) {
|
|
53538
|
+
links[fieldName] = field;
|
|
53539
|
+
}
|
|
53540
|
+
}
|
|
53541
|
+
return {
|
|
53542
|
+
...normalizedRecord,
|
|
53543
|
+
fields: filteredFields,
|
|
53544
|
+
links,
|
|
53545
|
+
};
|
|
53546
|
+
}
|
|
53547
|
+
function getDenormalizedKey(originalKey, recordId, luvio) {
|
|
53548
|
+
// this will likely need to be handled when moving to structured keys
|
|
53549
|
+
// note record view entities dont have an associated keybuilder. They get ingested as records to a different key format
|
|
53550
|
+
// see the override for how they are handled packages/lds-adapters-uiapi/src/raml-artifacts/types/RecordRepresentation/keyBuilderFromType.ts
|
|
53551
|
+
if (originalKey.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX$1)) {
|
|
53552
|
+
return RECORD_VIEW_ENTITY_ID_PREFIX$1 + recordId;
|
|
53553
|
+
}
|
|
53554
|
+
return keyBuilder$26(luvio, { recordId });
|
|
53555
|
+
}
|
|
53556
|
+
function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecords, getStoreMetadata, getStore, sqlStore) {
|
|
53557
|
+
const getEntries = function (entries, segment) {
|
|
53558
|
+
// this HOF only inspects records in the default segment
|
|
53559
|
+
if (segment !== DefaultDurableSegment) {
|
|
53560
|
+
return durableStore.getEntries(entries, segment);
|
|
53561
|
+
}
|
|
53562
|
+
const { length: entriesLength } = entries;
|
|
53563
|
+
if (entriesLength === 0) {
|
|
53564
|
+
return Promise.resolve({});
|
|
53565
|
+
}
|
|
53566
|
+
// filter out record field keys
|
|
53567
|
+
const filteredEntryIds = [];
|
|
53568
|
+
// map of records to avoid requesting duplicate record keys when requesting both records and fields
|
|
53569
|
+
const recordEntries = {};
|
|
53570
|
+
const recordViewEntries = {};
|
|
53571
|
+
for (let i = 0, len = entriesLength; i < len; i++) {
|
|
53572
|
+
const id = entries[i];
|
|
53573
|
+
const recordId = extractRecordIdFromStoreKey$1(id);
|
|
53574
|
+
if (recordId !== undefined) {
|
|
53575
|
+
if (id.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX$1)) {
|
|
53576
|
+
if (recordViewEntries[recordId] === undefined) {
|
|
53577
|
+
const key = getDenormalizedKey(id, recordId, luvio);
|
|
53578
|
+
recordViewEntries[recordId] = true;
|
|
53579
|
+
filteredEntryIds.push(key);
|
|
53580
|
+
}
|
|
53581
|
+
}
|
|
53582
|
+
else {
|
|
53583
|
+
if (recordEntries[recordId] === undefined) {
|
|
53584
|
+
const key = getDenormalizedKey(id, recordId, luvio);
|
|
53585
|
+
recordEntries[recordId] = true;
|
|
53586
|
+
filteredEntryIds.push(key);
|
|
53587
|
+
}
|
|
53588
|
+
}
|
|
53589
|
+
}
|
|
53590
|
+
else {
|
|
53591
|
+
filteredEntryIds.push(id);
|
|
53592
|
+
}
|
|
53593
|
+
}
|
|
53594
|
+
// call base getEntries
|
|
53595
|
+
return durableStore.getEntries(filteredEntryIds, segment).then((durableEntries) => {
|
|
53596
|
+
if (durableEntries === undefined) {
|
|
53597
|
+
return undefined;
|
|
53598
|
+
}
|
|
53599
|
+
const returnEntries = create$4(null);
|
|
53600
|
+
const keys$1 = keys$4(durableEntries);
|
|
53601
|
+
for (let i = 0, len = keys$1.length; i < len; i++) {
|
|
53602
|
+
const key = keys$1[i];
|
|
53603
|
+
const value = durableEntries[key];
|
|
53604
|
+
if (value === undefined) {
|
|
53605
|
+
continue;
|
|
53606
|
+
}
|
|
53607
|
+
if (isEntryDurableRecordRepresentation(value, key)) {
|
|
53608
|
+
assign$4(returnEntries, normalizeRecordFields(key, value));
|
|
53609
|
+
}
|
|
53610
|
+
else {
|
|
53611
|
+
returnEntries[key] = value;
|
|
53612
|
+
}
|
|
53613
|
+
}
|
|
53614
|
+
return returnEntries;
|
|
53615
|
+
});
|
|
53616
|
+
};
|
|
53617
|
+
const denormalizeEntries = function (entries) {
|
|
53618
|
+
let hasEntries = false;
|
|
53619
|
+
let hasMetadata = false;
|
|
53620
|
+
const putEntries = create$4(null);
|
|
53621
|
+
const putMetadata = create$4(null);
|
|
53622
|
+
const keys$1 = keys$4(entries);
|
|
53623
|
+
const putRecords = {};
|
|
53624
|
+
const putRecordViews = {};
|
|
53625
|
+
const storeRecords = getStoreRecords !== undefined ? getStoreRecords() : {};
|
|
53626
|
+
const storeMetadata = getStoreMetadata !== undefined ? getStoreMetadata() : {};
|
|
53627
|
+
const store = getStore();
|
|
53628
|
+
for (let i = 0, len = keys$1.length; i < len; i++) {
|
|
53629
|
+
const key = keys$1[i];
|
|
53630
|
+
let value = entries[key];
|
|
53631
|
+
const recordId = extractRecordIdFromStoreKey$1(key);
|
|
53632
|
+
// do not put normalized field values
|
|
53633
|
+
if (recordId !== undefined) {
|
|
53634
|
+
const isRecordView = key.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX$1);
|
|
53635
|
+
if (isRecordView) {
|
|
53636
|
+
if (putRecordViews[recordId] === true) {
|
|
53637
|
+
continue;
|
|
53638
|
+
}
|
|
53639
|
+
}
|
|
53640
|
+
else {
|
|
53641
|
+
if (putRecords[recordId] === true) {
|
|
53642
|
+
continue;
|
|
53643
|
+
}
|
|
53644
|
+
}
|
|
53645
|
+
const recordKey = getDenormalizedKey(key, recordId, luvio);
|
|
53646
|
+
const recordEntries = entries;
|
|
53647
|
+
const entry = recordEntries[recordKey];
|
|
53648
|
+
let record = entry && entry.data;
|
|
53649
|
+
if (record === undefined) {
|
|
53650
|
+
record = storeRecords[recordKey];
|
|
53651
|
+
if (record === undefined) {
|
|
53652
|
+
// fields are being published without a record for them existing,
|
|
53653
|
+
// fields cannot exist standalone in the durable store
|
|
53654
|
+
continue;
|
|
53655
|
+
}
|
|
53656
|
+
}
|
|
53657
|
+
if (isRecordView) {
|
|
53658
|
+
putRecordViews[recordId] = true;
|
|
53659
|
+
}
|
|
53660
|
+
else {
|
|
53661
|
+
putRecords[recordId] = true;
|
|
53662
|
+
}
|
|
53663
|
+
if (isStoreRecordError(record)) {
|
|
53664
|
+
hasEntries = true;
|
|
53665
|
+
putEntries[recordKey] = value;
|
|
53666
|
+
continue;
|
|
53667
|
+
}
|
|
53668
|
+
let metadata = entry && entry.metadata;
|
|
53669
|
+
if (metadata === undefined) {
|
|
53670
|
+
metadata = {
|
|
53671
|
+
...storeMetadata[recordKey],
|
|
53672
|
+
metadataVersion: DURABLE_METADATA_VERSION,
|
|
53673
|
+
};
|
|
53674
|
+
}
|
|
53675
|
+
const denormalizedRecord = buildDurableRecordRepresentation(record, storeRecords, recordEntries, store);
|
|
53676
|
+
if (denormalizedRecord !== undefined) {
|
|
53677
|
+
hasEntries = true;
|
|
53678
|
+
putEntries[recordKey] = {
|
|
53679
|
+
data: denormalizedRecord,
|
|
53680
|
+
metadata,
|
|
53681
|
+
};
|
|
53682
|
+
// if undefined then it is pending
|
|
53683
|
+
// we should still update metadata on pending records
|
|
53684
|
+
}
|
|
53685
|
+
else {
|
|
53686
|
+
hasMetadata = true;
|
|
53687
|
+
metadata.expirationTimestamp = metadata.ingestionTimestamp;
|
|
53688
|
+
putMetadata[recordKey] = {
|
|
53689
|
+
metadata,
|
|
53690
|
+
};
|
|
53691
|
+
}
|
|
53692
|
+
}
|
|
53693
|
+
else {
|
|
53694
|
+
hasEntries = true;
|
|
53695
|
+
putEntries[key] = value;
|
|
53696
|
+
}
|
|
53697
|
+
}
|
|
53698
|
+
return { putEntries, putMetadata, hasEntries, hasMetadata };
|
|
53699
|
+
};
|
|
53700
|
+
const setEntries = function (entries, segment) {
|
|
53701
|
+
if (segment !== DefaultDurableSegment) {
|
|
53702
|
+
return durableStore.setEntries(entries, segment);
|
|
53703
|
+
}
|
|
53704
|
+
const { putEntries, putMetadata, hasEntries, hasMetadata } = denormalizeEntries(entries);
|
|
53705
|
+
const promises = [
|
|
53706
|
+
hasEntries ? durableStore.setEntries(putEntries, segment) : undefined,
|
|
53707
|
+
];
|
|
53708
|
+
if (sqlStore !== undefined && sqlStore.isBatchUpdateSupported()) {
|
|
53709
|
+
promises.push(hasMetadata && sqlStore !== undefined
|
|
53710
|
+
? durableStore.setMetadata(putMetadata, segment)
|
|
53711
|
+
: undefined);
|
|
53712
|
+
}
|
|
53713
|
+
return Promise.all(promises).then(() => { });
|
|
53714
|
+
};
|
|
53715
|
+
const batchOperations = function (operations) {
|
|
53716
|
+
const operationsWithDenormedRecords = [];
|
|
53717
|
+
for (let i = 0, len = operations.length; i < len; i++) {
|
|
53718
|
+
const operation = operations[i];
|
|
53719
|
+
if (operation.type === 'setMetadata') {
|
|
53720
|
+
// if setMetadata also contains entry data then it needs to be denormalized.
|
|
53721
|
+
const keys$1 = keys$4(operation.entries);
|
|
53722
|
+
if (keys$1.length > 0) {
|
|
53723
|
+
const firstKey = keys$1[0];
|
|
53724
|
+
// casted to any to check if data exists
|
|
53725
|
+
const firstEntry = operation.entries[firstKey];
|
|
53726
|
+
// it is not possible for setMetadata to contain entries with both data and no data in the same operation.
|
|
53727
|
+
// this is determined by the plugin supporting update batch calls before it gets to this HOF.
|
|
53728
|
+
// so we only need to check one entry to confirm this for performance
|
|
53729
|
+
if (firstEntry.data !== undefined) {
|
|
53730
|
+
const { putEntries, putMetadata, hasMetadata } = denormalizeEntries(operation.entries);
|
|
53731
|
+
operationsWithDenormedRecords.push({
|
|
53732
|
+
...operation,
|
|
53733
|
+
entries: putEntries,
|
|
53734
|
+
});
|
|
53735
|
+
if (hasMetadata &&
|
|
53736
|
+
sqlStore !== undefined &&
|
|
53737
|
+
sqlStore.isBatchUpdateSupported() === true) {
|
|
53738
|
+
operationsWithDenormedRecords.push({
|
|
53739
|
+
...operation,
|
|
53740
|
+
entries: putMetadata,
|
|
53741
|
+
type: 'setMetadata',
|
|
53742
|
+
});
|
|
53743
|
+
}
|
|
53744
|
+
}
|
|
53745
|
+
else {
|
|
53746
|
+
operationsWithDenormedRecords.push(operation);
|
|
53747
|
+
}
|
|
53748
|
+
}
|
|
53749
|
+
continue;
|
|
53750
|
+
}
|
|
53751
|
+
if (operation.segment !== DefaultDurableSegment || operation.type === 'evictEntries') {
|
|
53752
|
+
operationsWithDenormedRecords.push(operation);
|
|
53753
|
+
continue;
|
|
53754
|
+
}
|
|
53755
|
+
const { putEntries, putMetadata, hasMetadata } = denormalizeEntries(operation.entries);
|
|
53756
|
+
operationsWithDenormedRecords.push({
|
|
53757
|
+
...operation,
|
|
53758
|
+
entries: putEntries,
|
|
53759
|
+
});
|
|
53760
|
+
if (hasMetadata &&
|
|
53761
|
+
sqlStore !== undefined &&
|
|
53762
|
+
sqlStore.isBatchUpdateSupported() === true) {
|
|
53763
|
+
operationsWithDenormedRecords.push({
|
|
53764
|
+
...operation,
|
|
53765
|
+
entries: putMetadata,
|
|
53766
|
+
type: 'setMetadata',
|
|
53767
|
+
});
|
|
53768
|
+
}
|
|
53769
|
+
}
|
|
53770
|
+
return durableStore.batchOperations(operationsWithDenormedRecords);
|
|
53771
|
+
};
|
|
53772
|
+
/**
|
|
53773
|
+
* Retrieves a denormalized record from the store
|
|
53774
|
+
* NOTE: do no use this if you don't know what you're doing, this can still contain normalized record references
|
|
53775
|
+
* @param recordKey record key
|
|
53776
|
+
* @param durableStore the durable store
|
|
53777
|
+
* @returns a DraftRecordRepresentation containing the requested fields
|
|
53778
|
+
*/
|
|
53779
|
+
const getDenormalizedRecord = function (recordKey) {
|
|
53780
|
+
return durableStore.getEntries([recordKey], DefaultDurableSegment).then((entries) => {
|
|
53781
|
+
if (entries === undefined) {
|
|
53782
|
+
return undefined;
|
|
53783
|
+
}
|
|
53784
|
+
const denormalizedEntry = entries[recordKey];
|
|
53785
|
+
if (denormalizedEntry === undefined) {
|
|
53786
|
+
return undefined;
|
|
53787
|
+
}
|
|
53788
|
+
// don't include link information
|
|
53789
|
+
const denormalizedRecord = denormalizedEntry.data;
|
|
53790
|
+
if (isStoreRecordError(denormalizedRecord)) {
|
|
53791
|
+
return undefined;
|
|
53792
|
+
}
|
|
53793
|
+
return denormalizedRecord;
|
|
53794
|
+
});
|
|
53795
|
+
};
|
|
53796
|
+
return create$4(durableStore, {
|
|
53797
|
+
getEntries: { value: getEntries, writable: true },
|
|
53798
|
+
setEntries: { value: setEntries, writable: true },
|
|
53799
|
+
batchOperations: { value: batchOperations, writable: true },
|
|
53800
|
+
getDenormalizedRecord: { value: getDenormalizedRecord, writable: true },
|
|
53801
|
+
});
|
|
53802
|
+
}
|
|
53803
|
+
|
|
53783
53804
|
function serializeFieldArguments$1(argumentNodes, variables) {
|
|
53784
53805
|
const mutableArgumentNodes = Object.assign([], argumentNodes);
|
|
53785
53806
|
return `args__(${mutableArgumentNodes
|
|
@@ -60581,7 +60602,7 @@ function registerReportObserver(reportObserver) {
|
|
|
60581
60602
|
};
|
|
60582
60603
|
}
|
|
60583
60604
|
|
|
60584
|
-
const { keys: keys$
|
|
60605
|
+
const { keys: keys$a, create: create$8, assign: assign$8, entries, values } = Object;
|
|
60585
60606
|
const { stringify: stringify$7, parse: parse$7 } = JSON;
|
|
60586
60607
|
|
|
60587
60608
|
function selectColumnsFromTableWhereKeyIn(columnNames, table, keyColumnName, whereIn) {
|
|
@@ -60648,7 +60669,7 @@ class LdsDataTable {
|
|
|
60648
60669
|
},
|
|
60649
60670
|
conflictColumns: this.conflictColumnNames,
|
|
60650
60671
|
columns: this.columnNames,
|
|
60651
|
-
rows: keys$
|
|
60672
|
+
rows: keys$a(entries).reduce((rows, key) => {
|
|
60652
60673
|
const entry = entries[key];
|
|
60653
60674
|
const { data, metadata } = entry;
|
|
60654
60675
|
const row = [key, stringify$7(data), metadata ? stringify$7(metadata) : null];
|
|
@@ -60667,7 +60688,7 @@ class LdsDataTable {
|
|
|
60667
60688
|
type: 'setMetadata',
|
|
60668
60689
|
},
|
|
60669
60690
|
columns: [COLUMN_NAME_METADATA$1],
|
|
60670
|
-
values: keys$
|
|
60691
|
+
values: keys$a(entries).reduce((values, key) => {
|
|
60671
60692
|
const { metadata } = entries[key];
|
|
60672
60693
|
const row = [metadata ? stringify$7(metadata) : null];
|
|
60673
60694
|
values[key] = row;
|
|
@@ -60757,7 +60778,7 @@ class LdsInternalDataTable {
|
|
|
60757
60778
|
},
|
|
60758
60779
|
conflictColumns: this.conflictColumnNames,
|
|
60759
60780
|
columns: this.columnNames,
|
|
60760
|
-
rows: keys$
|
|
60781
|
+
rows: keys$a(entries).reduce((rows, key) => {
|
|
60761
60782
|
const entry = entries[key];
|
|
60762
60783
|
const { data, metadata } = entry;
|
|
60763
60784
|
const row = [key, stringify$7(data)];
|
|
@@ -60783,7 +60804,7 @@ class LdsInternalDataTable {
|
|
|
60783
60804
|
type: 'setMetadata',
|
|
60784
60805
|
},
|
|
60785
60806
|
columns: [COLUMN_NAME_METADATA],
|
|
60786
|
-
values: keys$
|
|
60807
|
+
values: keys$a(entries).reduce((values, key) => {
|
|
60787
60808
|
const { metadata } = entries[key];
|
|
60788
60809
|
const row = [metadata ? stringify$7(metadata) : null];
|
|
60789
60810
|
values[key] = row;
|
|
@@ -60792,7 +60813,7 @@ class LdsInternalDataTable {
|
|
|
60792
60813
|
};
|
|
60793
60814
|
}
|
|
60794
60815
|
metadataToUpdateSQLQueries(entries, segment) {
|
|
60795
|
-
return keys$
|
|
60816
|
+
return keys$a(entries).reduce((accu, key) => {
|
|
60796
60817
|
const { metadata } = entries[key];
|
|
60797
60818
|
if (metadata !== undefined) {
|
|
60798
60819
|
accu.push({
|
|
@@ -60863,7 +60884,7 @@ class NimbusSqliteStore {
|
|
|
60863
60884
|
return this.getTable(segment).getAll(segment);
|
|
60864
60885
|
}
|
|
60865
60886
|
setEntries(entries, segment) {
|
|
60866
|
-
if (keys$
|
|
60887
|
+
if (keys$a(entries).length === 0) {
|
|
60867
60888
|
return Promise.resolve();
|
|
60868
60889
|
}
|
|
60869
60890
|
const table = this.getTable(segment);
|
|
@@ -60871,7 +60892,7 @@ class NimbusSqliteStore {
|
|
|
60871
60892
|
return this.batchOperationAsPromise([upsertOperation]);
|
|
60872
60893
|
}
|
|
60873
60894
|
setMetadata(entries, segment) {
|
|
60874
|
-
if (keys$
|
|
60895
|
+
if (keys$a(entries).length === 0) {
|
|
60875
60896
|
return Promise.resolve();
|
|
60876
60897
|
}
|
|
60877
60898
|
const table = this.getTable(segment);
|
|
@@ -60890,13 +60911,13 @@ class NimbusSqliteStore {
|
|
|
60890
60911
|
batchOperations(operations) {
|
|
60891
60912
|
const sqliteOperations = operations.reduce((acc, cur) => {
|
|
60892
60913
|
if (cur.type === 'setEntries') {
|
|
60893
|
-
if (keys$
|
|
60914
|
+
if (keys$a(cur.entries).length > 0) {
|
|
60894
60915
|
const table = this.getTable(cur.segment);
|
|
60895
60916
|
acc.push(table.entriesToUpsertOperations(cur.entries, cur.segment));
|
|
60896
60917
|
}
|
|
60897
60918
|
}
|
|
60898
60919
|
else if (cur.type === 'setMetadata') {
|
|
60899
|
-
if (keys$
|
|
60920
|
+
if (keys$a(cur.entries).length > 0) {
|
|
60900
60921
|
const table = this.getTable(cur.segment);
|
|
60901
60922
|
if (this.supportsBatchUpdates) {
|
|
60902
60923
|
acc.push(table.metadataToUpdateOperations(cur.entries, cur.segment));
|
|
@@ -61029,7 +61050,7 @@ class AbstractKeyValueDataTable {
|
|
|
61029
61050
|
},
|
|
61030
61051
|
conflictColumns: this.conflictColumnNames,
|
|
61031
61052
|
columns: this.columnNames,
|
|
61032
|
-
rows: keys$
|
|
61053
|
+
rows: keys$a(entries).reduce((rows, key) => {
|
|
61033
61054
|
const entry = entries[key];
|
|
61034
61055
|
rows.push([key, stringify$7(entry.data)]);
|
|
61035
61056
|
return rows;
|
|
@@ -62540,7 +62561,7 @@ function getRuntime() {
|
|
|
62540
62561
|
const draftService = new UiApiDraftRecordService(lazyDraftQueue, () => lazyLuvio, recordDenormingStore, getObjectInfo, newRecordId, userId, formatDisplayValue);
|
|
62541
62562
|
const uiApiRecordHandler = new UiApiActionHandler(() => lazyLuvio, lazyNetworkAdapter, recordDenormingStore, lazyDraftQueue, getRecord, lazyObjectInfoService, isGenerated, draftService);
|
|
62542
62563
|
const quickActionHandler = new QuickActionExecutionRepresentationHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated);
|
|
62543
|
-
const contentDocumentCompositeActionHandler = new ContentDocumentCompositeRepresentationActionHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated,
|
|
62564
|
+
const contentDocumentCompositeActionHandler = new ContentDocumentCompositeRepresentationActionHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated, NimbusBinaryStore);
|
|
62544
62565
|
lazyDraftQueue.addHandler(uiApiRecordHandler);
|
|
62545
62566
|
lazyDraftQueue.addHandler(quickActionHandler);
|
|
62546
62567
|
lazyDraftQueue.addHandler(contentDocumentCompositeActionHandler);
|
|
@@ -62639,7 +62660,7 @@ register$1({
|
|
|
62639
62660
|
id: '@salesforce/lds-network-adapter',
|
|
62640
62661
|
instrument: instrument$2,
|
|
62641
62662
|
});
|
|
62642
|
-
// version: 1.
|
|
62663
|
+
// version: 1.298.0-3a2eedddc
|
|
62643
62664
|
|
|
62644
62665
|
const { create: create$3, keys: keys$3 } = Object;
|
|
62645
62666
|
const { stringify: stringify$1, parse: parse$1 } = JSON;
|
|
@@ -82708,7 +82729,7 @@ register$1({
|
|
|
82708
82729
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
82709
82730
|
instrument: instrument$1,
|
|
82710
82731
|
});
|
|
82711
|
-
// version: 1.
|
|
82732
|
+
// version: 1.298.0-6f15dc1ec
|
|
82712
82733
|
|
|
82713
82734
|
// On core the unstable adapters are re-exported with different names,
|
|
82714
82735
|
// we want to match them here.
|
|
@@ -84964,7 +84985,7 @@ withDefaultLuvio((luvio) => {
|
|
|
84964
84985
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
84965
84986
|
graphQLImperative = ldsAdapter;
|
|
84966
84987
|
});
|
|
84967
|
-
// version: 1.
|
|
84988
|
+
// version: 1.298.0-6f15dc1ec
|
|
84968
84989
|
|
|
84969
84990
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
84970
84991
|
__proto__: null,
|
|
@@ -84989,7 +85010,7 @@ function getAdapterMaps() {
|
|
|
84989
85010
|
if (lazyDMLAdapterMap === undefined || lazyImperativeAdapterMap === undefined) {
|
|
84990
85011
|
// We should eventually be explicit about what we expose here instead of exporting everything from the modules,
|
|
84991
85012
|
// this is our API contract to native callers and should be explicit
|
|
84992
|
-
const map = Object.assign({}, gqlApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi);
|
|
85013
|
+
const map = Object.assign({}, gqlApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi, unstableLightningRelatedListApi);
|
|
84993
85014
|
const imperativeAdapterNames = keys$3(map).filter((name) => name.endsWith(IMPERATIVE_ADAPTER_SUFFIX));
|
|
84994
85015
|
const imperativeMap = {};
|
|
84995
85016
|
for (const adapterName of imperativeAdapterNames) {
|
|
@@ -85699,7 +85720,7 @@ const callbacks$1 = [];
|
|
|
85699
85720
|
function register(r) {
|
|
85700
85721
|
callbacks$1.forEach((callback) => callback(r));
|
|
85701
85722
|
}
|
|
85702
|
-
// version: 1.
|
|
85723
|
+
// version: 1.298.0-3a2eedddc
|
|
85703
85724
|
|
|
85704
85725
|
/**
|
|
85705
85726
|
* Returns true if the value acts like a Promise, i.e. has a "then" function,
|
|
@@ -90661,4 +90682,4 @@ const { luvio } = getRuntime();
|
|
|
90661
90682
|
setDefaultLuvio({ luvio });
|
|
90662
90683
|
|
|
90663
90684
|
export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
|
|
90664
|
-
// version: 1.
|
|
90685
|
+
// version: 1.298.0-3a2eedddc
|