@salesforce/lds-runtime-mobile 1.266.0-dev1 → 1.266.0-dev11
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/main.js +49 -22
- package/package.json +16 -16
- package/sfdc/main.js +49 -22
package/dist/main.js
CHANGED
|
@@ -1385,6 +1385,10 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
|
|
|
1385
1385
|
}
|
|
1386
1386
|
return {};
|
|
1387
1387
|
};
|
|
1388
|
+
const getIngestStagingStore = function () {
|
|
1389
|
+
validateNotDisposed();
|
|
1390
|
+
return stagingStore === null || stagingStore === void 0 ? void 0 : stagingStore.fallbackStringKeyInMemoryStore;
|
|
1391
|
+
};
|
|
1388
1392
|
const handleSuccessResponse = async function (ingestAndBroadcastFunc, getResponseCacheKeysFunc) {
|
|
1389
1393
|
validateNotDisposed();
|
|
1390
1394
|
const cacheKeyMap = getResponseCacheKeysFunc();
|
|
@@ -1577,6 +1581,7 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
|
|
|
1577
1581
|
applyCachePolicy: { value: applyCachePolicy },
|
|
1578
1582
|
getIngestStagingStoreRecords: { value: getIngestStagingStoreRecords },
|
|
1579
1583
|
getIngestStagingStoreMetadata: { value: getIngestStagingStoreMetadata },
|
|
1584
|
+
getIngestStagingStore: { value: getIngestStagingStore },
|
|
1580
1585
|
handleSuccessResponse: { value: handleSuccessResponse },
|
|
1581
1586
|
handleErrorResponse: { value: handleErrorResponse },
|
|
1582
1587
|
getNotifyChangeStoreEntries: { value: getNotifyChangeStoreEntries },
|
|
@@ -4374,9 +4379,10 @@ function rootRecordQuery(selection, input) {
|
|
|
4374
4379
|
// If there is no metadata for this query or it somehow lacks a timestamp
|
|
4375
4380
|
// skip setting the root timestamp
|
|
4376
4381
|
if (queryMetadata !== undefined && queryMetadata.ingestionTimestamp !== undefined) {
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4382
|
+
const timestamp = Number(queryMetadata.ingestionTimestamp);
|
|
4383
|
+
if (!isNaN(timestamp)) {
|
|
4384
|
+
input.rootTimestamp = timestamp;
|
|
4385
|
+
}
|
|
4380
4386
|
}
|
|
4381
4387
|
}
|
|
4382
4388
|
return recordQuery(selection, alias, apiName, [], input);
|
|
@@ -9041,6 +9047,20 @@ function findFieldInfo(objectInfo, fieldName) {
|
|
|
9041
9047
|
return values$2(objectInfo.fields).find((field) => field.apiName === fieldName ||
|
|
9042
9048
|
(field.dataType === 'Reference' && field.relationshipName === fieldName));
|
|
9043
9049
|
}
|
|
9050
|
+
async function readIngestionTimestampForKey(key, query) {
|
|
9051
|
+
let ingestionTimestamp = 0;
|
|
9052
|
+
const sql = `SELECT json_extract(metadata, '${JSON_EXTRACT_PATH_INGESTION_TIMESTAMP}') FROM lds_data WHERE key IS ?`;
|
|
9053
|
+
const results = await query(sql, [key]);
|
|
9054
|
+
const [timestamp] = results.rows.map((row) => row[0]);
|
|
9055
|
+
if (timestamp !== null) {
|
|
9056
|
+
const numericalTimestamp = Number(timestamp);
|
|
9057
|
+
if (isNaN(numericalTimestamp)) {
|
|
9058
|
+
return ingestionTimestamp;
|
|
9059
|
+
}
|
|
9060
|
+
ingestionTimestamp = numericalTimestamp;
|
|
9061
|
+
}
|
|
9062
|
+
return ingestionTimestamp;
|
|
9063
|
+
}
|
|
9044
9064
|
|
|
9045
9065
|
function findSpanningField(name) {
|
|
9046
9066
|
return (field) => {
|
|
@@ -9560,18 +9580,7 @@ async function fetchIngestionTimeStampFromDatabase(apiName, info, args, query) {
|
|
|
9560
9580
|
const key = buildKeyStringForRecordQuery(operation,
|
|
9561
9581
|
// join varables passed from query to the argument variables given from the AST
|
|
9562
9582
|
{ ...variableValues, ...args }, info.fieldNodes[0].arguments, apiName);
|
|
9563
|
-
|
|
9564
|
-
SELECT json_extract(metadata, '${JSON_EXTRACT_PATH_INGESTION_TIMESTAMP}')
|
|
9565
|
-
FROM lds_data
|
|
9566
|
-
WHERE key IS ?
|
|
9567
|
-
`;
|
|
9568
|
-
const results = await query(sql, [key]);
|
|
9569
|
-
const [timestamp] = results.rows.map((row) => row[0]);
|
|
9570
|
-
if (timestamp !== null && typeof timestamp === 'number') {
|
|
9571
|
-
// adjust the timestamp to account for ingestion processing time
|
|
9572
|
-
// 30s is used because this is the default record TTL
|
|
9573
|
-
ingestionTimestamp = timestamp - 30000;
|
|
9574
|
-
}
|
|
9583
|
+
return readIngestionTimestampForKey(key, query);
|
|
9575
9584
|
}
|
|
9576
9585
|
return ingestionTimestamp;
|
|
9577
9586
|
}
|
|
@@ -11638,7 +11647,7 @@ function createUserJsonOutput(selection, jsonInput, jsonOutput) {
|
|
|
11638
11647
|
function createjsonOutput(selections, jsonInput, jsonOutput) {
|
|
11639
11648
|
const keys$1 = keys$4(jsonInput);
|
|
11640
11649
|
selections.filter(isFieldNode).forEach((subSelection) => {
|
|
11641
|
-
const fieldName = subSelection.name.value;
|
|
11650
|
+
const fieldName = subSelection.alias ? subSelection.alias.value : subSelection.name.value;
|
|
11642
11651
|
if (keys$1.includes(fieldName)) {
|
|
11643
11652
|
if (isArray$2(jsonInput[fieldName])) {
|
|
11644
11653
|
jsonOutput[fieldName] = [];
|
|
@@ -12954,7 +12963,7 @@ function normalizeRecordFields(key, entry) {
|
|
|
12954
12963
|
* @param normalizedRecord Record containing normalized field links
|
|
12955
12964
|
* @param recordStore a store containing referenced record fields
|
|
12956
12965
|
*/
|
|
12957
|
-
function buildDurableRecordRepresentation(normalizedRecord, records, pendingEntries) {
|
|
12966
|
+
function buildDurableRecordRepresentation(normalizedRecord, records, pendingEntries, store) {
|
|
12958
12967
|
const fields = normalizedRecord.fields;
|
|
12959
12968
|
const filteredFields = {};
|
|
12960
12969
|
const links = {};
|
|
@@ -12981,6 +12990,19 @@ function buildDurableRecordRepresentation(normalizedRecord, records, pendingEntr
|
|
|
12981
12990
|
if (ref !== undefined) {
|
|
12982
12991
|
filteredFields[fieldName] = ref;
|
|
12983
12992
|
}
|
|
12993
|
+
else {
|
|
12994
|
+
// if we have a store to read, try to find the field there too
|
|
12995
|
+
// The durable ingest staging store may pass through to L1, and
|
|
12996
|
+
// not all fields are necessarily published every time, so it is
|
|
12997
|
+
// important to check L1 and not just the fields being published,
|
|
12998
|
+
// otherwise we risk truncating the fields on the record.
|
|
12999
|
+
if (store) {
|
|
13000
|
+
ref = store.readEntry(__ref);
|
|
13001
|
+
if (ref !== undefined) {
|
|
13002
|
+
filteredFields[fieldName] = ref;
|
|
13003
|
+
}
|
|
13004
|
+
}
|
|
13005
|
+
}
|
|
12984
13006
|
}
|
|
12985
13007
|
// we want to preserve fields that are missing nodes
|
|
12986
13008
|
if (filteredFields[fieldName] !== undefined || field.isMissing === true) {
|
|
@@ -13002,7 +13024,7 @@ function getDenormalizedKey(originalKey, recordId, luvio) {
|
|
|
13002
13024
|
}
|
|
13003
13025
|
return keyBuilderRecord(luvio, { recordId });
|
|
13004
13026
|
}
|
|
13005
|
-
function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecords, getStoreMetadata) {
|
|
13027
|
+
function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecords, getStoreMetadata, getStore) {
|
|
13006
13028
|
const getEntries = function (entries, segment) {
|
|
13007
13029
|
// this HOF only inspects records in the default segment
|
|
13008
13030
|
if (segment !== DefaultDurableSegment) {
|
|
@@ -13070,6 +13092,7 @@ function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecord
|
|
|
13070
13092
|
const putRecordViews = {};
|
|
13071
13093
|
const storeRecords = getStoreRecords !== undefined ? getStoreRecords() : {};
|
|
13072
13094
|
const storeMetadata = getStoreMetadata !== undefined ? getStoreMetadata() : {};
|
|
13095
|
+
const store = getStore();
|
|
13073
13096
|
for (let i = 0, len = keys$1.length; i < len; i++) {
|
|
13074
13097
|
const key = keys$1[i];
|
|
13075
13098
|
let value = entries[key];
|
|
@@ -13116,7 +13139,7 @@ function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecord
|
|
|
13116
13139
|
metadataVersion: DURABLE_METADATA_VERSION,
|
|
13117
13140
|
};
|
|
13118
13141
|
}
|
|
13119
|
-
const denormalizedRecord = buildDurableRecordRepresentation(record, storeRecords, recordEntries);
|
|
13142
|
+
const denormalizedRecord = buildDurableRecordRepresentation(record, storeRecords, recordEntries, store);
|
|
13120
13143
|
putEntries[recordKey] = {
|
|
13121
13144
|
data: denormalizedRecord,
|
|
13122
13145
|
metadata,
|
|
@@ -17793,22 +17816,25 @@ function getRuntime() {
|
|
|
17793
17816
|
const internalAdapterStore = new InMemoryStore();
|
|
17794
17817
|
let getIngestRecordsForInternalAdapters;
|
|
17795
17818
|
let getIngestMetadataForInternalAdapters;
|
|
17819
|
+
let getIngestStoreInternal;
|
|
17796
17820
|
const internalAdapterDurableStore = makeRecordDenormalizingDurableStore(lazyLuvio, lazyBaseDurableStore, () => getIngestRecordsForInternalAdapters !== undefined
|
|
17797
17821
|
? getIngestRecordsForInternalAdapters()
|
|
17798
17822
|
: {}, () => getIngestMetadataForInternalAdapters !== undefined
|
|
17799
17823
|
? getIngestMetadataForInternalAdapters()
|
|
17800
|
-
: {});
|
|
17824
|
+
: {}, () => (getIngestStoreInternal !== undefined ? getIngestStoreInternal() : undefined));
|
|
17801
17825
|
const { adapters: { getObjectInfo, getObjectInfos, getRecord, getObjectInfoDirectory }, durableEnvironment: internalAdapterDurableEnvironment, luvio: internalLuvio, } = buildInternalAdapters(internalAdapterStore, lazyNetworkAdapter, internalAdapterDurableStore, (apiName, objectInfo) => lazyObjectInfoService.ensureObjectInfoCached(apiName, objectInfo));
|
|
17802
17826
|
lazyInternalLuvio = internalLuvio;
|
|
17803
17827
|
getIngestRecordsForInternalAdapters =
|
|
17804
17828
|
internalAdapterDurableEnvironment.getIngestStagingStoreRecords;
|
|
17805
17829
|
getIngestMetadataForInternalAdapters =
|
|
17806
17830
|
internalAdapterDurableEnvironment.getIngestStagingStoreRecords;
|
|
17831
|
+
getIngestStoreInternal = internalAdapterDurableEnvironment.getIngestStagingStore;
|
|
17807
17832
|
lazyObjectInfoService = new ObjectInfoService(getObjectInfo, getObjectInfos, getObjectInfoDirectory, lazyBaseDurableStore);
|
|
17808
17833
|
// creates a durable store that denormalizes scalar fields for records
|
|
17809
17834
|
let getIngestRecords;
|
|
17810
17835
|
let getIngestMetadata;
|
|
17811
|
-
|
|
17836
|
+
let getIngestStore;
|
|
17837
|
+
const recordDenormingStore = makeRecordDenormalizingDurableStore(lazyLuvio, lazyBaseDurableStore, () => (getIngestRecords !== undefined ? getIngestRecords() : {}), () => (getIngestMetadata !== undefined ? getIngestMetadata() : {}), () => (getIngestStore !== undefined ? getIngestStore() : undefined));
|
|
17812
17838
|
const baseEnv = new Environment(store, lazyNetworkAdapter);
|
|
17813
17839
|
const gqlEnv = makeEnvironmentGraphqlAware(baseEnv);
|
|
17814
17840
|
const durableEnv = makeDurable(gqlEnv, {
|
|
@@ -17817,6 +17843,7 @@ function getRuntime() {
|
|
|
17817
17843
|
});
|
|
17818
17844
|
getIngestRecords = durableEnv.getIngestStagingStoreRecords;
|
|
17819
17845
|
getIngestMetadata = durableEnv.getIngestStagingStoreMetadata;
|
|
17846
|
+
getIngestStore = durableEnv.getIngestStagingStore;
|
|
17820
17847
|
// draft queue
|
|
17821
17848
|
lazyDraftQueue = buildLdsDraftQueue(recordDenormingStore);
|
|
17822
17849
|
const draftService = new UiApiDraftRecordService(lazyDraftQueue, () => lazyLuvio, recordDenormingStore, getObjectInfo, newRecordId, userId, formatDisplayValue);
|
|
@@ -17916,4 +17943,4 @@ register({
|
|
|
17916
17943
|
});
|
|
17917
17944
|
|
|
17918
17945
|
export { O11Y_NAMESPACE_LDS_MOBILE, getRuntime, registerReportObserver, reportGraphqlQueryParseError };
|
|
17919
|
-
// version: 1.266.0-
|
|
17946
|
+
// version: 1.266.0-dev11-133bca5b9
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-runtime-mobile",
|
|
3
|
-
"version": "1.266.0-
|
|
3
|
+
"version": "1.266.0-dev11",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "LDS runtime for mobile/hybrid environments.",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -32,25 +32,25 @@
|
|
|
32
32
|
"release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-runtime-mobile"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@salesforce/lds-adapters-uiapi": "^1.266.0-
|
|
36
|
-
"@salesforce/lds-bindings": "^1.266.0-
|
|
37
|
-
"@salesforce/lds-instrumentation": "^1.266.0-
|
|
38
|
-
"@salesforce/lds-priming": "^1.266.0-
|
|
35
|
+
"@salesforce/lds-adapters-uiapi": "^1.266.0-dev11",
|
|
36
|
+
"@salesforce/lds-bindings": "^1.266.0-dev11",
|
|
37
|
+
"@salesforce/lds-instrumentation": "^1.266.0-dev11",
|
|
38
|
+
"@salesforce/lds-priming": "^1.266.0-dev11",
|
|
39
39
|
"@salesforce/user": "0.0.21",
|
|
40
40
|
"o11y": "244.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@salesforce/lds-adapters-graphql": "^1.266.0-
|
|
44
|
-
"@salesforce/lds-drafts": "^1.266.0-
|
|
45
|
-
"@salesforce/lds-drafts-adapters-uiapi": "^1.266.0-
|
|
46
|
-
"@salesforce/lds-graphql-eval": "^1.266.0-
|
|
47
|
-
"@salesforce/lds-network-adapter": "^1.266.0-
|
|
48
|
-
"@salesforce/lds-network-nimbus": "^1.266.0-
|
|
49
|
-
"@salesforce/lds-store-binary": "^1.266.0-
|
|
50
|
-
"@salesforce/lds-store-nimbus": "^1.266.0-
|
|
51
|
-
"@salesforce/lds-store-sql": "^1.266.0-
|
|
52
|
-
"@salesforce/lds-utils-adapters": "^1.266.0-
|
|
53
|
-
"@salesforce/nimbus-plugin-lds": "^1.266.0-
|
|
43
|
+
"@salesforce/lds-adapters-graphql": "^1.266.0-dev11",
|
|
44
|
+
"@salesforce/lds-drafts": "^1.266.0-dev11",
|
|
45
|
+
"@salesforce/lds-drafts-adapters-uiapi": "^1.266.0-dev11",
|
|
46
|
+
"@salesforce/lds-graphql-eval": "^1.266.0-dev11",
|
|
47
|
+
"@salesforce/lds-network-adapter": "^1.266.0-dev11",
|
|
48
|
+
"@salesforce/lds-network-nimbus": "^1.266.0-dev11",
|
|
49
|
+
"@salesforce/lds-store-binary": "^1.266.0-dev11",
|
|
50
|
+
"@salesforce/lds-store-nimbus": "^1.266.0-dev11",
|
|
51
|
+
"@salesforce/lds-store-sql": "^1.266.0-dev11",
|
|
52
|
+
"@salesforce/lds-utils-adapters": "^1.266.0-dev11",
|
|
53
|
+
"@salesforce/nimbus-plugin-lds": "^1.266.0-dev11",
|
|
54
54
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
55
55
|
"wait-for-expect": "^3.0.2"
|
|
56
56
|
},
|
package/sfdc/main.js
CHANGED
|
@@ -1385,6 +1385,10 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
|
|
|
1385
1385
|
}
|
|
1386
1386
|
return {};
|
|
1387
1387
|
};
|
|
1388
|
+
const getIngestStagingStore = function () {
|
|
1389
|
+
validateNotDisposed();
|
|
1390
|
+
return stagingStore === null || stagingStore === void 0 ? void 0 : stagingStore.fallbackStringKeyInMemoryStore;
|
|
1391
|
+
};
|
|
1388
1392
|
const handleSuccessResponse = async function (ingestAndBroadcastFunc, getResponseCacheKeysFunc) {
|
|
1389
1393
|
validateNotDisposed();
|
|
1390
1394
|
const cacheKeyMap = getResponseCacheKeysFunc();
|
|
@@ -1577,6 +1581,7 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
|
|
|
1577
1581
|
applyCachePolicy: { value: applyCachePolicy },
|
|
1578
1582
|
getIngestStagingStoreRecords: { value: getIngestStagingStoreRecords },
|
|
1579
1583
|
getIngestStagingStoreMetadata: { value: getIngestStagingStoreMetadata },
|
|
1584
|
+
getIngestStagingStore: { value: getIngestStagingStore },
|
|
1580
1585
|
handleSuccessResponse: { value: handleSuccessResponse },
|
|
1581
1586
|
handleErrorResponse: { value: handleErrorResponse },
|
|
1582
1587
|
getNotifyChangeStoreEntries: { value: getNotifyChangeStoreEntries },
|
|
@@ -4374,9 +4379,10 @@ function rootRecordQuery(selection, input) {
|
|
|
4374
4379
|
// If there is no metadata for this query or it somehow lacks a timestamp
|
|
4375
4380
|
// skip setting the root timestamp
|
|
4376
4381
|
if (queryMetadata !== undefined && queryMetadata.ingestionTimestamp !== undefined) {
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4382
|
+
const timestamp = Number(queryMetadata.ingestionTimestamp);
|
|
4383
|
+
if (!isNaN(timestamp)) {
|
|
4384
|
+
input.rootTimestamp = timestamp;
|
|
4385
|
+
}
|
|
4380
4386
|
}
|
|
4381
4387
|
}
|
|
4382
4388
|
return recordQuery(selection, alias, apiName, [], input);
|
|
@@ -9041,6 +9047,20 @@ function findFieldInfo(objectInfo, fieldName) {
|
|
|
9041
9047
|
return values$2(objectInfo.fields).find((field) => field.apiName === fieldName ||
|
|
9042
9048
|
(field.dataType === 'Reference' && field.relationshipName === fieldName));
|
|
9043
9049
|
}
|
|
9050
|
+
async function readIngestionTimestampForKey(key, query) {
|
|
9051
|
+
let ingestionTimestamp = 0;
|
|
9052
|
+
const sql = `SELECT json_extract(metadata, '${JSON_EXTRACT_PATH_INGESTION_TIMESTAMP}') FROM lds_data WHERE key IS ?`;
|
|
9053
|
+
const results = await query(sql, [key]);
|
|
9054
|
+
const [timestamp] = results.rows.map((row) => row[0]);
|
|
9055
|
+
if (timestamp !== null) {
|
|
9056
|
+
const numericalTimestamp = Number(timestamp);
|
|
9057
|
+
if (isNaN(numericalTimestamp)) {
|
|
9058
|
+
return ingestionTimestamp;
|
|
9059
|
+
}
|
|
9060
|
+
ingestionTimestamp = numericalTimestamp;
|
|
9061
|
+
}
|
|
9062
|
+
return ingestionTimestamp;
|
|
9063
|
+
}
|
|
9044
9064
|
|
|
9045
9065
|
function findSpanningField(name) {
|
|
9046
9066
|
return (field) => {
|
|
@@ -9560,18 +9580,7 @@ async function fetchIngestionTimeStampFromDatabase(apiName, info, args, query) {
|
|
|
9560
9580
|
const key = buildKeyStringForRecordQuery(operation,
|
|
9561
9581
|
// join varables passed from query to the argument variables given from the AST
|
|
9562
9582
|
{ ...variableValues, ...args }, info.fieldNodes[0].arguments, apiName);
|
|
9563
|
-
|
|
9564
|
-
SELECT json_extract(metadata, '${JSON_EXTRACT_PATH_INGESTION_TIMESTAMP}')
|
|
9565
|
-
FROM lds_data
|
|
9566
|
-
WHERE key IS ?
|
|
9567
|
-
`;
|
|
9568
|
-
const results = await query(sql, [key]);
|
|
9569
|
-
const [timestamp] = results.rows.map((row) => row[0]);
|
|
9570
|
-
if (timestamp !== null && typeof timestamp === 'number') {
|
|
9571
|
-
// adjust the timestamp to account for ingestion processing time
|
|
9572
|
-
// 30s is used because this is the default record TTL
|
|
9573
|
-
ingestionTimestamp = timestamp - 30000;
|
|
9574
|
-
}
|
|
9583
|
+
return readIngestionTimestampForKey(key, query);
|
|
9575
9584
|
}
|
|
9576
9585
|
return ingestionTimestamp;
|
|
9577
9586
|
}
|
|
@@ -11638,7 +11647,7 @@ function createUserJsonOutput(selection, jsonInput, jsonOutput) {
|
|
|
11638
11647
|
function createjsonOutput(selections, jsonInput, jsonOutput) {
|
|
11639
11648
|
const keys$1 = keys$4(jsonInput);
|
|
11640
11649
|
selections.filter(isFieldNode).forEach((subSelection) => {
|
|
11641
|
-
const fieldName = subSelection.name.value;
|
|
11650
|
+
const fieldName = subSelection.alias ? subSelection.alias.value : subSelection.name.value;
|
|
11642
11651
|
if (keys$1.includes(fieldName)) {
|
|
11643
11652
|
if (isArray$2(jsonInput[fieldName])) {
|
|
11644
11653
|
jsonOutput[fieldName] = [];
|
|
@@ -12954,7 +12963,7 @@ function normalizeRecordFields(key, entry) {
|
|
|
12954
12963
|
* @param normalizedRecord Record containing normalized field links
|
|
12955
12964
|
* @param recordStore a store containing referenced record fields
|
|
12956
12965
|
*/
|
|
12957
|
-
function buildDurableRecordRepresentation(normalizedRecord, records, pendingEntries) {
|
|
12966
|
+
function buildDurableRecordRepresentation(normalizedRecord, records, pendingEntries, store) {
|
|
12958
12967
|
const fields = normalizedRecord.fields;
|
|
12959
12968
|
const filteredFields = {};
|
|
12960
12969
|
const links = {};
|
|
@@ -12981,6 +12990,19 @@ function buildDurableRecordRepresentation(normalizedRecord, records, pendingEntr
|
|
|
12981
12990
|
if (ref !== undefined) {
|
|
12982
12991
|
filteredFields[fieldName] = ref;
|
|
12983
12992
|
}
|
|
12993
|
+
else {
|
|
12994
|
+
// if we have a store to read, try to find the field there too
|
|
12995
|
+
// The durable ingest staging store may pass through to L1, and
|
|
12996
|
+
// not all fields are necessarily published every time, so it is
|
|
12997
|
+
// important to check L1 and not just the fields being published,
|
|
12998
|
+
// otherwise we risk truncating the fields on the record.
|
|
12999
|
+
if (store) {
|
|
13000
|
+
ref = store.readEntry(__ref);
|
|
13001
|
+
if (ref !== undefined) {
|
|
13002
|
+
filteredFields[fieldName] = ref;
|
|
13003
|
+
}
|
|
13004
|
+
}
|
|
13005
|
+
}
|
|
12984
13006
|
}
|
|
12985
13007
|
// we want to preserve fields that are missing nodes
|
|
12986
13008
|
if (filteredFields[fieldName] !== undefined || field.isMissing === true) {
|
|
@@ -13002,7 +13024,7 @@ function getDenormalizedKey(originalKey, recordId, luvio) {
|
|
|
13002
13024
|
}
|
|
13003
13025
|
return keyBuilderRecord(luvio, { recordId });
|
|
13004
13026
|
}
|
|
13005
|
-
function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecords, getStoreMetadata) {
|
|
13027
|
+
function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecords, getStoreMetadata, getStore) {
|
|
13006
13028
|
const getEntries = function (entries, segment) {
|
|
13007
13029
|
// this HOF only inspects records in the default segment
|
|
13008
13030
|
if (segment !== DefaultDurableSegment) {
|
|
@@ -13070,6 +13092,7 @@ function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecord
|
|
|
13070
13092
|
const putRecordViews = {};
|
|
13071
13093
|
const storeRecords = getStoreRecords !== undefined ? getStoreRecords() : {};
|
|
13072
13094
|
const storeMetadata = getStoreMetadata !== undefined ? getStoreMetadata() : {};
|
|
13095
|
+
const store = getStore();
|
|
13073
13096
|
for (let i = 0, len = keys$1.length; i < len; i++) {
|
|
13074
13097
|
const key = keys$1[i];
|
|
13075
13098
|
let value = entries[key];
|
|
@@ -13116,7 +13139,7 @@ function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecord
|
|
|
13116
13139
|
metadataVersion: DURABLE_METADATA_VERSION,
|
|
13117
13140
|
};
|
|
13118
13141
|
}
|
|
13119
|
-
const denormalizedRecord = buildDurableRecordRepresentation(record, storeRecords, recordEntries);
|
|
13142
|
+
const denormalizedRecord = buildDurableRecordRepresentation(record, storeRecords, recordEntries, store);
|
|
13120
13143
|
putEntries[recordKey] = {
|
|
13121
13144
|
data: denormalizedRecord,
|
|
13122
13145
|
metadata,
|
|
@@ -17793,22 +17816,25 @@ function getRuntime() {
|
|
|
17793
17816
|
const internalAdapterStore = new InMemoryStore();
|
|
17794
17817
|
let getIngestRecordsForInternalAdapters;
|
|
17795
17818
|
let getIngestMetadataForInternalAdapters;
|
|
17819
|
+
let getIngestStoreInternal;
|
|
17796
17820
|
const internalAdapterDurableStore = makeRecordDenormalizingDurableStore(lazyLuvio, lazyBaseDurableStore, () => getIngestRecordsForInternalAdapters !== undefined
|
|
17797
17821
|
? getIngestRecordsForInternalAdapters()
|
|
17798
17822
|
: {}, () => getIngestMetadataForInternalAdapters !== undefined
|
|
17799
17823
|
? getIngestMetadataForInternalAdapters()
|
|
17800
|
-
: {});
|
|
17824
|
+
: {}, () => (getIngestStoreInternal !== undefined ? getIngestStoreInternal() : undefined));
|
|
17801
17825
|
const { adapters: { getObjectInfo, getObjectInfos, getRecord, getObjectInfoDirectory }, durableEnvironment: internalAdapterDurableEnvironment, luvio: internalLuvio, } = buildInternalAdapters(internalAdapterStore, lazyNetworkAdapter, internalAdapterDurableStore, (apiName, objectInfo) => lazyObjectInfoService.ensureObjectInfoCached(apiName, objectInfo));
|
|
17802
17826
|
lazyInternalLuvio = internalLuvio;
|
|
17803
17827
|
getIngestRecordsForInternalAdapters =
|
|
17804
17828
|
internalAdapterDurableEnvironment.getIngestStagingStoreRecords;
|
|
17805
17829
|
getIngestMetadataForInternalAdapters =
|
|
17806
17830
|
internalAdapterDurableEnvironment.getIngestStagingStoreRecords;
|
|
17831
|
+
getIngestStoreInternal = internalAdapterDurableEnvironment.getIngestStagingStore;
|
|
17807
17832
|
lazyObjectInfoService = new ObjectInfoService(getObjectInfo, getObjectInfos, getObjectInfoDirectory, lazyBaseDurableStore);
|
|
17808
17833
|
// creates a durable store that denormalizes scalar fields for records
|
|
17809
17834
|
let getIngestRecords;
|
|
17810
17835
|
let getIngestMetadata;
|
|
17811
|
-
|
|
17836
|
+
let getIngestStore;
|
|
17837
|
+
const recordDenormingStore = makeRecordDenormalizingDurableStore(lazyLuvio, lazyBaseDurableStore, () => (getIngestRecords !== undefined ? getIngestRecords() : {}), () => (getIngestMetadata !== undefined ? getIngestMetadata() : {}), () => (getIngestStore !== undefined ? getIngestStore() : undefined));
|
|
17812
17838
|
const baseEnv = new Environment(store, lazyNetworkAdapter);
|
|
17813
17839
|
const gqlEnv = makeEnvironmentGraphqlAware(baseEnv);
|
|
17814
17840
|
const durableEnv = makeDurable(gqlEnv, {
|
|
@@ -17817,6 +17843,7 @@ function getRuntime() {
|
|
|
17817
17843
|
});
|
|
17818
17844
|
getIngestRecords = durableEnv.getIngestStagingStoreRecords;
|
|
17819
17845
|
getIngestMetadata = durableEnv.getIngestStagingStoreMetadata;
|
|
17846
|
+
getIngestStore = durableEnv.getIngestStagingStore;
|
|
17820
17847
|
// draft queue
|
|
17821
17848
|
lazyDraftQueue = buildLdsDraftQueue(recordDenormingStore);
|
|
17822
17849
|
const draftService = new UiApiDraftRecordService(lazyDraftQueue, () => lazyLuvio, recordDenormingStore, getObjectInfo, newRecordId, userId, formatDisplayValue);
|
|
@@ -17916,4 +17943,4 @@ register({
|
|
|
17916
17943
|
});
|
|
17917
17944
|
|
|
17918
17945
|
export { O11Y_NAMESPACE_LDS_MOBILE, getRuntime, registerReportObserver, reportGraphqlQueryParseError };
|
|
17919
|
-
// version: 1.266.0-
|
|
17946
|
+
// version: 1.266.0-dev11-133bca5b9
|