@salesforce/lds-worker-api 1.287.0-dev12 → 1.287.0-dev14
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.
|
@@ -1074,4 +1074,4 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
1074
1074
|
}
|
|
1075
1075
|
|
|
1076
1076
|
export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
|
|
1077
|
-
// version: 1.287.0-
|
|
1077
|
+
// version: 1.287.0-dev14-85b5de0a8f
|
|
@@ -4204,7 +4204,7 @@ function withDefaultLuvio(callback) {
|
|
|
4204
4204
|
}
|
|
4205
4205
|
callbacks.push(callback);
|
|
4206
4206
|
}
|
|
4207
|
-
// version: 1.287.0-
|
|
4207
|
+
// version: 1.287.0-dev14-85b5de0a8f
|
|
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.287.0-
|
|
15715
|
+
// version: 1.287.0-dev14-85b5de0a8f
|
|
15716
15716
|
|
|
15717
15717
|
function unwrap(data) {
|
|
15718
15718
|
// The lwc-luvio bindings import a function from lwc called "unwrap".
|
|
@@ -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.287.0-
|
|
16644
|
+
// version: 1.287.0-dev14-85b5de0a8f
|
|
16645
16645
|
|
|
16646
16646
|
/**
|
|
16647
16647
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -25490,6 +25490,7 @@ function getNameField(objectInfo, fieldApiName) {
|
|
|
25490
25490
|
}
|
|
25491
25491
|
function getQualifiedFieldApiNamesFromLayout(layout, objectInfo) {
|
|
25492
25492
|
const qualifiedFieldNames = [];
|
|
25493
|
+
const qualifiedOptionalFieldNames = [];
|
|
25493
25494
|
for (let a = 0, alen = layout.sections.length; a < alen; a++) {
|
|
25494
25495
|
const section = layout.sections[a];
|
|
25495
25496
|
for (let b = 0, blen = section.layoutRows.length; b < blen; b++) {
|
|
@@ -25505,7 +25506,8 @@ function getQualifiedFieldApiNamesFromLayout(layout, objectInfo) {
|
|
|
25505
25506
|
// By default, include the "Id" field on spanning records that are on the layout.
|
|
25506
25507
|
qualifiedFieldNames.push(`${objectInfo.apiName}.${relationshipFieldApiName}.${FIELD_ID}`);
|
|
25507
25508
|
const nameField = getNameField(objectInfo, apiName);
|
|
25508
|
-
|
|
25509
|
+
// W-15692973: Name field of referenced entites are moved to optionalFields since the Name field may not exist for few entites.
|
|
25510
|
+
qualifiedOptionalFieldNames.push(`${objectInfo.apiName}.${relationshipFieldApiName}.${nameField}`);
|
|
25509
25511
|
}
|
|
25510
25512
|
qualifiedFieldNames.push(`${objectInfo.apiName}.${component.apiName}`);
|
|
25511
25513
|
}
|
|
@@ -25513,7 +25515,10 @@ function getQualifiedFieldApiNamesFromLayout(layout, objectInfo) {
|
|
|
25513
25515
|
}
|
|
25514
25516
|
}
|
|
25515
25517
|
}
|
|
25516
|
-
return
|
|
25518
|
+
return {
|
|
25519
|
+
fields: qualifiedFieldNames,
|
|
25520
|
+
optionalFields: qualifiedOptionalFieldNames,
|
|
25521
|
+
};
|
|
25517
25522
|
}
|
|
25518
25523
|
|
|
25519
25524
|
function getMissingRecordLookupFields(record, objectInfo) {
|
|
@@ -25930,11 +25935,13 @@ function refresh$1(luvio, config) {
|
|
|
25930
25935
|
throw new Error(`RecordUi adapter resolved with a ${snapshot.state} snapshot with undefined data`);
|
|
25931
25936
|
}
|
|
25932
25937
|
const { layoutMap, objectInfo } = getLayoutMapAndObjectInfo(recordId, data);
|
|
25933
|
-
|
|
25938
|
+
// W-15692973: Name field of referenced entites are moved to optionalFields since the Name field may not exist for few entites.
|
|
25939
|
+
const { fields, optionalFields: layoutOptionalFields } = getFieldsFromLayoutMap(layoutMap, objectInfo);
|
|
25940
|
+
const mergedOptionalFields = dedupe$2(optionalFields.concat(layoutOptionalFields));
|
|
25934
25941
|
return buildCachedSnapshot$9(luvio, {
|
|
25935
25942
|
recordId,
|
|
25936
25943
|
fields,
|
|
25937
|
-
optionalFields,
|
|
25944
|
+
optionalFields: mergedOptionalFields,
|
|
25938
25945
|
}, refresh);
|
|
25939
25946
|
});
|
|
25940
25947
|
}
|
|
@@ -25991,6 +25998,7 @@ const recordLayoutFragmentSelector = [
|
|
|
25991
25998
|
];
|
|
25992
25999
|
function getFieldsFromLayoutMap(layoutMap, objectInfo) {
|
|
25993
26000
|
let fields = [];
|
|
26001
|
+
let optionalFields = [];
|
|
25994
26002
|
const layoutTypes = keys$a(layoutMap);
|
|
25995
26003
|
for (let i = 0, layoutTypesLen = layoutTypes.length; i < layoutTypesLen; i += 1) {
|
|
25996
26004
|
const layoutType = layoutTypes[i];
|
|
@@ -25998,11 +26006,15 @@ function getFieldsFromLayoutMap(layoutMap, objectInfo) {
|
|
|
25998
26006
|
const modes = keys$a(modesMap);
|
|
25999
26007
|
for (let m = 0, modesLen = modes.length; m < modesLen; m += 1) {
|
|
26000
26008
|
const mode = modes[m];
|
|
26001
|
-
const
|
|
26002
|
-
fields = fields.concat(
|
|
26009
|
+
const { fields: modeFields, optionalFields: modeOptionalFields } = getQualifiedFieldApiNamesFromLayout(modesMap[mode], objectInfo);
|
|
26010
|
+
fields = fields.concat(modeFields);
|
|
26011
|
+
optionalFields = optionalFields.concat(modeOptionalFields);
|
|
26003
26012
|
}
|
|
26004
26013
|
}
|
|
26005
|
-
return
|
|
26014
|
+
return {
|
|
26015
|
+
fields: dedupe$2(fields).sort(),
|
|
26016
|
+
optionalFields: dedupe$2(optionalFields).sort(),
|
|
26017
|
+
};
|
|
26006
26018
|
}
|
|
26007
26019
|
/**
|
|
26008
26020
|
* W-14696113
|
|
@@ -26019,8 +26031,12 @@ function convertToImplicitFields(fields, optionalFields) {
|
|
|
26019
26031
|
return implicitFields;
|
|
26020
26032
|
}
|
|
26021
26033
|
function getRecordForLayoutableEntities(luvio, refresh, recordId, layoutMap, objectInfo, configOptionalFields) {
|
|
26022
|
-
|
|
26023
|
-
|
|
26034
|
+
// W-15692973: Name field of referenced entites are moved to optionalFields since the Name field may not exist for few entites.
|
|
26035
|
+
let { fields, optionalFields } = getFieldsFromLayoutMap(layoutMap, objectInfo);
|
|
26036
|
+
if (configOptionalFields && configOptionalFields.length > 0) {
|
|
26037
|
+
optionalFields = dedupe$2(optionalFields.concat(configOptionalFields));
|
|
26038
|
+
}
|
|
26039
|
+
const implicitFields = convertToImplicitFields(fields, optionalFields);
|
|
26024
26040
|
return getRecord$1(luvio, refresh, recordId, [], implicitFields);
|
|
26025
26041
|
}
|
|
26026
26042
|
function getRecordForNonLayoutableEntities(luvio, adapterContext, refresh, recordId, objectInfo, configOptionalFields, configFields) {
|
|
@@ -26282,8 +26298,15 @@ function buildRecordLayoutSnapshot(recordLayout, luvio, config, recordLayoutSnap
|
|
|
26282
26298
|
return;
|
|
26283
26299
|
}
|
|
26284
26300
|
// transform the layouts & object info into a set of fields
|
|
26285
|
-
|
|
26286
|
-
|
|
26301
|
+
// // W-15692973: Name field of referenced entites are moved to optionalFields since the Name field may not exist for few entites.
|
|
26302
|
+
const { fields, optionalFields } = getFieldsFromLayoutMap(layoutMap, objectInfoSnapshot.data);
|
|
26303
|
+
let configWithModifiedOptionalFields = {
|
|
26304
|
+
...config,
|
|
26305
|
+
optionalFields: config.optionalFields
|
|
26306
|
+
? dedupe$2(config.optionalFields.concat(optionalFields)).sort()
|
|
26307
|
+
: optionalFields,
|
|
26308
|
+
};
|
|
26309
|
+
return getRecordRepSnapshot(luvio, configWithModifiedOptionalFields, recordLayoutSnapshot, objectInfoSnapshot, fields, isRecordLayoutStale, context, storeLookup);
|
|
26287
26310
|
};
|
|
26288
26311
|
}
|
|
26289
26312
|
function buildRecordSnapshot(luvio, config, recordLayoutSnapshot, objectInfoSnapshot, fields) {
|
|
@@ -26312,6 +26335,8 @@ function getRecordRepSnapshot(luvio, config, recordLayoutSnapshot, objectInfoSna
|
|
|
26312
26335
|
// allow buildNetworkSnapshot() to use GetRecordFields if we were just missing some fields in L1
|
|
26313
26336
|
else if (isUnfulfilledSnapshot$2(recordRepSnapshot)) {
|
|
26314
26337
|
context.fields = fields;
|
|
26338
|
+
// W-15692973: Update optionalFields of config as the optional fields may have Name fields of referenced entities
|
|
26339
|
+
context.config.optionalFields = optionalFields;
|
|
26315
26340
|
}
|
|
26316
26341
|
// return however much of the record we were able to find in L1; cache policy decides if we
|
|
26317
26342
|
// should consult L2 or go to network
|
|
@@ -44231,7 +44256,7 @@ withDefaultLuvio((luvio) => {
|
|
|
44231
44256
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
44232
44257
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
44233
44258
|
});
|
|
44234
|
-
// version: 1.287.0-
|
|
44259
|
+
// version: 1.287.0-dev14-912e45c126
|
|
44235
44260
|
|
|
44236
44261
|
var ldsIdempotencyWriteDisabled = {
|
|
44237
44262
|
isOpen: function (e) {
|
|
@@ -61778,6 +61803,7 @@ class RecordLoaderGraphQL {
|
|
|
61778
61803
|
let rep;
|
|
61779
61804
|
try {
|
|
61780
61805
|
rep = await this.callGraphQL(batch, abortController);
|
|
61806
|
+
return this.generateFetchResult(rep, batch);
|
|
61781
61807
|
}
|
|
61782
61808
|
catch (e) {
|
|
61783
61809
|
return {
|
|
@@ -61787,12 +61813,15 @@ class RecordLoaderGraphQL {
|
|
|
61787
61813
|
missingIds: batch.ids,
|
|
61788
61814
|
};
|
|
61789
61815
|
}
|
|
61790
|
-
return this.generateFetchResult(rep, batch);
|
|
61791
61816
|
}
|
|
61792
61817
|
async batchFetchRecordData(batchs, abortController) {
|
|
61793
|
-
let reps;
|
|
61794
61818
|
try {
|
|
61795
|
-
reps = await this.callBatchGraphQL(batchs, abortController);
|
|
61819
|
+
const reps = await this.callBatchGraphQL(batchs, abortController);
|
|
61820
|
+
const recordFetchResults = [];
|
|
61821
|
+
for (let i = 0; i < reps.length; i++) {
|
|
61822
|
+
recordFetchResults.push(this.generateFetchResult(reps[i], batchs[i]));
|
|
61823
|
+
}
|
|
61824
|
+
return recordFetchResults;
|
|
61796
61825
|
}
|
|
61797
61826
|
catch (e) {
|
|
61798
61827
|
const missingIds = batchs
|
|
@@ -61807,11 +61836,6 @@ class RecordLoaderGraphQL {
|
|
|
61807
61836
|
},
|
|
61808
61837
|
];
|
|
61809
61838
|
}
|
|
61810
|
-
const recordFetchResults = [];
|
|
61811
|
-
for (let i = 0; i < reps.length; i++) {
|
|
61812
|
-
recordFetchResults.push(this.generateFetchResult(reps[i], batchs[i]));
|
|
61813
|
-
}
|
|
61814
|
-
return recordFetchResults;
|
|
61815
61839
|
}
|
|
61816
61840
|
generateFetchResult(repResult, batchInput) {
|
|
61817
61841
|
const { data, errors } = repResult;
|
|
@@ -62013,19 +62037,26 @@ class NimbusPrimingNetworkAdapter {
|
|
|
62013
62037
|
priority: 'background',
|
|
62014
62038
|
observabilityContext: {},
|
|
62015
62039
|
}, abortController, (response) => {
|
|
62016
|
-
|
|
62017
|
-
|
|
62018
|
-
|
|
62019
|
-
|
|
62020
|
-
|
|
62021
|
-
|
|
62040
|
+
if (response.status < 200 || response.status > 299) {
|
|
62041
|
+
reject(new Error(response.body || 'Network error'));
|
|
62042
|
+
return;
|
|
62043
|
+
}
|
|
62044
|
+
try {
|
|
62045
|
+
const { body } = response;
|
|
62046
|
+
if (body) {
|
|
62047
|
+
const { results } = JSON.parse(body);
|
|
62048
|
+
if (results) {
|
|
62049
|
+
const gqlResults = results.map((compositeGqlResult) => compositeGqlResult.result);
|
|
62050
|
+
resolve(gqlResults);
|
|
62051
|
+
return;
|
|
62052
|
+
}
|
|
62022
62053
|
}
|
|
62023
62054
|
else {
|
|
62024
62055
|
reject(new Error(`No body returned from ${batchEndPointPath} endpoint`));
|
|
62025
62056
|
}
|
|
62026
62057
|
}
|
|
62027
|
-
|
|
62028
|
-
reject(
|
|
62058
|
+
catch (error) {
|
|
62059
|
+
reject(error);
|
|
62029
62060
|
}
|
|
62030
62061
|
}, (error) => {
|
|
62031
62062
|
reject(error);
|
|
@@ -62046,12 +62077,21 @@ class NimbusPrimingNetworkAdapter {
|
|
|
62046
62077
|
priority: 'background',
|
|
62047
62078
|
observabilityContext: {},
|
|
62048
62079
|
}, abortController, (response) => {
|
|
62049
|
-
|
|
62050
|
-
|
|
62051
|
-
|
|
62080
|
+
if (response.status < 200 || response.status > 299) {
|
|
62081
|
+
reject(new Error(response.body || 'Network error'));
|
|
62082
|
+
return;
|
|
62052
62083
|
}
|
|
62053
|
-
|
|
62054
|
-
|
|
62084
|
+
try {
|
|
62085
|
+
const { body } = response;
|
|
62086
|
+
if (body) {
|
|
62087
|
+
resolve(JSON.parse(body));
|
|
62088
|
+
}
|
|
62089
|
+
else {
|
|
62090
|
+
reject(new Error(`No body returned from ${endPointPath} endpoint`));
|
|
62091
|
+
}
|
|
62092
|
+
}
|
|
62093
|
+
catch (error) {
|
|
62094
|
+
reject(error);
|
|
62055
62095
|
}
|
|
62056
62096
|
}, (error) => {
|
|
62057
62097
|
reject(error);
|
|
@@ -62069,12 +62109,21 @@ class NimbusPrimingNetworkAdapter {
|
|
|
62069
62109
|
priority: 'background',
|
|
62070
62110
|
observabilityContext: {},
|
|
62071
62111
|
}, abortController, (response) => {
|
|
62072
|
-
|
|
62073
|
-
|
|
62074
|
-
|
|
62112
|
+
if (response.status < 200 || response.status > 299) {
|
|
62113
|
+
reject(new Error(response.body || 'Network error'));
|
|
62114
|
+
return;
|
|
62075
62115
|
}
|
|
62076
|
-
|
|
62077
|
-
|
|
62116
|
+
try {
|
|
62117
|
+
const { body } = response;
|
|
62118
|
+
if (body) {
|
|
62119
|
+
resolve(JSON.parse(body).objects);
|
|
62120
|
+
}
|
|
62121
|
+
else {
|
|
62122
|
+
reject(new Error(`No body returned from ${endPointPath} endpoint`));
|
|
62123
|
+
}
|
|
62124
|
+
}
|
|
62125
|
+
catch (error) {
|
|
62126
|
+
reject(error);
|
|
62078
62127
|
}
|
|
62079
62128
|
}, (error) => {
|
|
62080
62129
|
reject(error);
|
|
@@ -62096,19 +62145,28 @@ class NimbusPrimingNetworkAdapter {
|
|
|
62096
62145
|
priority: 'background',
|
|
62097
62146
|
observabilityContext: {},
|
|
62098
62147
|
}, abortController, (response) => {
|
|
62099
|
-
|
|
62100
|
-
|
|
62101
|
-
|
|
62102
|
-
results.forEach((result) => {
|
|
62103
|
-
// only populate the map if the status code is 200, caller needs to check for missing keys
|
|
62104
|
-
if (result.statusCode === 200) {
|
|
62105
|
-
map.set(result.result.apiName, result.result);
|
|
62106
|
-
}
|
|
62107
|
-
});
|
|
62108
|
-
resolve(map);
|
|
62148
|
+
if (response.status < 200 || response.status > 299) {
|
|
62149
|
+
reject(new Error(response.body || 'Network error'));
|
|
62150
|
+
return;
|
|
62109
62151
|
}
|
|
62110
|
-
|
|
62111
|
-
|
|
62152
|
+
try {
|
|
62153
|
+
const { body } = response;
|
|
62154
|
+
if (body) {
|
|
62155
|
+
const results = JSON.parse(body).results;
|
|
62156
|
+
results.forEach((result) => {
|
|
62157
|
+
// only populate the map if the status code is 200, caller needs to check for missing keys
|
|
62158
|
+
if (result.statusCode === 200) {
|
|
62159
|
+
map.set(result.result.apiName, result.result);
|
|
62160
|
+
}
|
|
62161
|
+
});
|
|
62162
|
+
resolve(map);
|
|
62163
|
+
}
|
|
62164
|
+
else {
|
|
62165
|
+
reject(new Error(`No body returned from ${endPointPath} endpoint`));
|
|
62166
|
+
}
|
|
62167
|
+
}
|
|
62168
|
+
catch (error) {
|
|
62169
|
+
reject(error);
|
|
62112
62170
|
}
|
|
62113
62171
|
}, (error) => {
|
|
62114
62172
|
reject(error);
|
|
@@ -62537,7 +62595,7 @@ register$1({
|
|
|
62537
62595
|
id: '@salesforce/lds-network-adapter',
|
|
62538
62596
|
instrument: instrument$2,
|
|
62539
62597
|
});
|
|
62540
|
-
// version: 1.287.0-
|
|
62598
|
+
// version: 1.287.0-dev14-85b5de0a8f
|
|
62541
62599
|
|
|
62542
62600
|
const { create: create$3, keys: keys$3 } = Object;
|
|
62543
62601
|
const { stringify: stringify$1, parse: parse$1 } = JSON;
|
|
@@ -82601,7 +82659,7 @@ register$1({
|
|
|
82601
82659
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
82602
82660
|
instrument: instrument$1,
|
|
82603
82661
|
});
|
|
82604
|
-
// version: 1.287.0-
|
|
82662
|
+
// version: 1.287.0-dev14-912e45c126
|
|
82605
82663
|
|
|
82606
82664
|
// On core the unstable adapters are re-exported with different names,
|
|
82607
82665
|
// we want to match them here.
|
|
@@ -84857,7 +84915,7 @@ withDefaultLuvio((luvio) => {
|
|
|
84857
84915
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
84858
84916
|
graphQLImperative = ldsAdapter;
|
|
84859
84917
|
});
|
|
84860
|
-
// version: 1.287.0-
|
|
84918
|
+
// version: 1.287.0-dev14-912e45c126
|
|
84861
84919
|
|
|
84862
84920
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
84863
84921
|
__proto__: null,
|
|
@@ -85595,7 +85653,7 @@ const callbacks$1 = [];
|
|
|
85595
85653
|
function register(r) {
|
|
85596
85654
|
callbacks$1.forEach((callback) => callback(r));
|
|
85597
85655
|
}
|
|
85598
|
-
// version: 1.287.0-
|
|
85656
|
+
// version: 1.287.0-dev14-85b5de0a8f
|
|
85599
85657
|
|
|
85600
85658
|
/**
|
|
85601
85659
|
* Returns true if the value acts like a Promise, i.e. has a "then" function,
|
|
@@ -90557,4 +90615,4 @@ const { luvio } = getRuntime();
|
|
|
90557
90615
|
setDefaultLuvio({ luvio });
|
|
90558
90616
|
|
|
90559
90617
|
export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
|
|
90560
|
-
// version: 1.287.0-
|
|
90618
|
+
// version: 1.287.0-dev14-85b5de0a8f
|
|
@@ -4210,7 +4210,7 @@
|
|
|
4210
4210
|
}
|
|
4211
4211
|
callbacks.push(callback);
|
|
4212
4212
|
}
|
|
4213
|
-
// version: 1.287.0-
|
|
4213
|
+
// version: 1.287.0-dev14-85b5de0a8f
|
|
4214
4214
|
|
|
4215
4215
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
4216
4216
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -15718,7 +15718,7 @@
|
|
|
15718
15718
|
}
|
|
15719
15719
|
return superResult;
|
|
15720
15720
|
}
|
|
15721
|
-
// version: 1.287.0-
|
|
15721
|
+
// version: 1.287.0-dev14-85b5de0a8f
|
|
15722
15722
|
|
|
15723
15723
|
function unwrap(data) {
|
|
15724
15724
|
// The lwc-luvio bindings import a function from lwc called "unwrap".
|
|
@@ -16647,7 +16647,7 @@
|
|
|
16647
16647
|
const { apiFamily, name } = metadata;
|
|
16648
16648
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
16649
16649
|
}
|
|
16650
|
-
// version: 1.287.0-
|
|
16650
|
+
// version: 1.287.0-dev14-85b5de0a8f
|
|
16651
16651
|
|
|
16652
16652
|
/**
|
|
16653
16653
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -25496,6 +25496,7 @@
|
|
|
25496
25496
|
}
|
|
25497
25497
|
function getQualifiedFieldApiNamesFromLayout(layout, objectInfo) {
|
|
25498
25498
|
const qualifiedFieldNames = [];
|
|
25499
|
+
const qualifiedOptionalFieldNames = [];
|
|
25499
25500
|
for (let a = 0, alen = layout.sections.length; a < alen; a++) {
|
|
25500
25501
|
const section = layout.sections[a];
|
|
25501
25502
|
for (let b = 0, blen = section.layoutRows.length; b < blen; b++) {
|
|
@@ -25511,7 +25512,8 @@
|
|
|
25511
25512
|
// By default, include the "Id" field on spanning records that are on the layout.
|
|
25512
25513
|
qualifiedFieldNames.push(`${objectInfo.apiName}.${relationshipFieldApiName}.${FIELD_ID}`);
|
|
25513
25514
|
const nameField = getNameField(objectInfo, apiName);
|
|
25514
|
-
|
|
25515
|
+
// W-15692973: Name field of referenced entites are moved to optionalFields since the Name field may not exist for few entites.
|
|
25516
|
+
qualifiedOptionalFieldNames.push(`${objectInfo.apiName}.${relationshipFieldApiName}.${nameField}`);
|
|
25515
25517
|
}
|
|
25516
25518
|
qualifiedFieldNames.push(`${objectInfo.apiName}.${component.apiName}`);
|
|
25517
25519
|
}
|
|
@@ -25519,7 +25521,10 @@
|
|
|
25519
25521
|
}
|
|
25520
25522
|
}
|
|
25521
25523
|
}
|
|
25522
|
-
return
|
|
25524
|
+
return {
|
|
25525
|
+
fields: qualifiedFieldNames,
|
|
25526
|
+
optionalFields: qualifiedOptionalFieldNames,
|
|
25527
|
+
};
|
|
25523
25528
|
}
|
|
25524
25529
|
|
|
25525
25530
|
function getMissingRecordLookupFields(record, objectInfo) {
|
|
@@ -25936,11 +25941,13 @@
|
|
|
25936
25941
|
throw new Error(`RecordUi adapter resolved with a ${snapshot.state} snapshot with undefined data`);
|
|
25937
25942
|
}
|
|
25938
25943
|
const { layoutMap, objectInfo } = getLayoutMapAndObjectInfo(recordId, data);
|
|
25939
|
-
|
|
25944
|
+
// W-15692973: Name field of referenced entites are moved to optionalFields since the Name field may not exist for few entites.
|
|
25945
|
+
const { fields, optionalFields: layoutOptionalFields } = getFieldsFromLayoutMap(layoutMap, objectInfo);
|
|
25946
|
+
const mergedOptionalFields = dedupe$2(optionalFields.concat(layoutOptionalFields));
|
|
25940
25947
|
return buildCachedSnapshot$9(luvio, {
|
|
25941
25948
|
recordId,
|
|
25942
25949
|
fields,
|
|
25943
|
-
optionalFields,
|
|
25950
|
+
optionalFields: mergedOptionalFields,
|
|
25944
25951
|
}, refresh);
|
|
25945
25952
|
});
|
|
25946
25953
|
}
|
|
@@ -25997,6 +26004,7 @@
|
|
|
25997
26004
|
];
|
|
25998
26005
|
function getFieldsFromLayoutMap(layoutMap, objectInfo) {
|
|
25999
26006
|
let fields = [];
|
|
26007
|
+
let optionalFields = [];
|
|
26000
26008
|
const layoutTypes = keys$a(layoutMap);
|
|
26001
26009
|
for (let i = 0, layoutTypesLen = layoutTypes.length; i < layoutTypesLen; i += 1) {
|
|
26002
26010
|
const layoutType = layoutTypes[i];
|
|
@@ -26004,11 +26012,15 @@
|
|
|
26004
26012
|
const modes = keys$a(modesMap);
|
|
26005
26013
|
for (let m = 0, modesLen = modes.length; m < modesLen; m += 1) {
|
|
26006
26014
|
const mode = modes[m];
|
|
26007
|
-
const
|
|
26008
|
-
fields = fields.concat(
|
|
26015
|
+
const { fields: modeFields, optionalFields: modeOptionalFields } = getQualifiedFieldApiNamesFromLayout(modesMap[mode], objectInfo);
|
|
26016
|
+
fields = fields.concat(modeFields);
|
|
26017
|
+
optionalFields = optionalFields.concat(modeOptionalFields);
|
|
26009
26018
|
}
|
|
26010
26019
|
}
|
|
26011
|
-
return
|
|
26020
|
+
return {
|
|
26021
|
+
fields: dedupe$2(fields).sort(),
|
|
26022
|
+
optionalFields: dedupe$2(optionalFields).sort(),
|
|
26023
|
+
};
|
|
26012
26024
|
}
|
|
26013
26025
|
/**
|
|
26014
26026
|
* W-14696113
|
|
@@ -26025,8 +26037,12 @@
|
|
|
26025
26037
|
return implicitFields;
|
|
26026
26038
|
}
|
|
26027
26039
|
function getRecordForLayoutableEntities(luvio, refresh, recordId, layoutMap, objectInfo, configOptionalFields) {
|
|
26028
|
-
|
|
26029
|
-
|
|
26040
|
+
// W-15692973: Name field of referenced entites are moved to optionalFields since the Name field may not exist for few entites.
|
|
26041
|
+
let { fields, optionalFields } = getFieldsFromLayoutMap(layoutMap, objectInfo);
|
|
26042
|
+
if (configOptionalFields && configOptionalFields.length > 0) {
|
|
26043
|
+
optionalFields = dedupe$2(optionalFields.concat(configOptionalFields));
|
|
26044
|
+
}
|
|
26045
|
+
const implicitFields = convertToImplicitFields(fields, optionalFields);
|
|
26030
26046
|
return getRecord$1(luvio, refresh, recordId, [], implicitFields);
|
|
26031
26047
|
}
|
|
26032
26048
|
function getRecordForNonLayoutableEntities(luvio, adapterContext, refresh, recordId, objectInfo, configOptionalFields, configFields) {
|
|
@@ -26288,8 +26304,15 @@
|
|
|
26288
26304
|
return;
|
|
26289
26305
|
}
|
|
26290
26306
|
// transform the layouts & object info into a set of fields
|
|
26291
|
-
|
|
26292
|
-
|
|
26307
|
+
// // W-15692973: Name field of referenced entites are moved to optionalFields since the Name field may not exist for few entites.
|
|
26308
|
+
const { fields, optionalFields } = getFieldsFromLayoutMap(layoutMap, objectInfoSnapshot.data);
|
|
26309
|
+
let configWithModifiedOptionalFields = {
|
|
26310
|
+
...config,
|
|
26311
|
+
optionalFields: config.optionalFields
|
|
26312
|
+
? dedupe$2(config.optionalFields.concat(optionalFields)).sort()
|
|
26313
|
+
: optionalFields,
|
|
26314
|
+
};
|
|
26315
|
+
return getRecordRepSnapshot(luvio, configWithModifiedOptionalFields, recordLayoutSnapshot, objectInfoSnapshot, fields, isRecordLayoutStale, context, storeLookup);
|
|
26293
26316
|
};
|
|
26294
26317
|
}
|
|
26295
26318
|
function buildRecordSnapshot(luvio, config, recordLayoutSnapshot, objectInfoSnapshot, fields) {
|
|
@@ -26318,6 +26341,8 @@
|
|
|
26318
26341
|
// allow buildNetworkSnapshot() to use GetRecordFields if we were just missing some fields in L1
|
|
26319
26342
|
else if (isUnfulfilledSnapshot$2(recordRepSnapshot)) {
|
|
26320
26343
|
context.fields = fields;
|
|
26344
|
+
// W-15692973: Update optionalFields of config as the optional fields may have Name fields of referenced entities
|
|
26345
|
+
context.config.optionalFields = optionalFields;
|
|
26321
26346
|
}
|
|
26322
26347
|
// return however much of the record we were able to find in L1; cache policy decides if we
|
|
26323
26348
|
// should consult L2 or go to network
|
|
@@ -44237,7 +44262,7 @@
|
|
|
44237
44262
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
44238
44263
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
44239
44264
|
});
|
|
44240
|
-
// version: 1.287.0-
|
|
44265
|
+
// version: 1.287.0-dev14-912e45c126
|
|
44241
44266
|
|
|
44242
44267
|
var ldsIdempotencyWriteDisabled = {
|
|
44243
44268
|
isOpen: function (e) {
|
|
@@ -61784,6 +61809,7 @@
|
|
|
61784
61809
|
let rep;
|
|
61785
61810
|
try {
|
|
61786
61811
|
rep = await this.callGraphQL(batch, abortController);
|
|
61812
|
+
return this.generateFetchResult(rep, batch);
|
|
61787
61813
|
}
|
|
61788
61814
|
catch (e) {
|
|
61789
61815
|
return {
|
|
@@ -61793,12 +61819,15 @@
|
|
|
61793
61819
|
missingIds: batch.ids,
|
|
61794
61820
|
};
|
|
61795
61821
|
}
|
|
61796
|
-
return this.generateFetchResult(rep, batch);
|
|
61797
61822
|
}
|
|
61798
61823
|
async batchFetchRecordData(batchs, abortController) {
|
|
61799
|
-
let reps;
|
|
61800
61824
|
try {
|
|
61801
|
-
reps = await this.callBatchGraphQL(batchs, abortController);
|
|
61825
|
+
const reps = await this.callBatchGraphQL(batchs, abortController);
|
|
61826
|
+
const recordFetchResults = [];
|
|
61827
|
+
for (let i = 0; i < reps.length; i++) {
|
|
61828
|
+
recordFetchResults.push(this.generateFetchResult(reps[i], batchs[i]));
|
|
61829
|
+
}
|
|
61830
|
+
return recordFetchResults;
|
|
61802
61831
|
}
|
|
61803
61832
|
catch (e) {
|
|
61804
61833
|
const missingIds = batchs
|
|
@@ -61813,11 +61842,6 @@
|
|
|
61813
61842
|
},
|
|
61814
61843
|
];
|
|
61815
61844
|
}
|
|
61816
|
-
const recordFetchResults = [];
|
|
61817
|
-
for (let i = 0; i < reps.length; i++) {
|
|
61818
|
-
recordFetchResults.push(this.generateFetchResult(reps[i], batchs[i]));
|
|
61819
|
-
}
|
|
61820
|
-
return recordFetchResults;
|
|
61821
61845
|
}
|
|
61822
61846
|
generateFetchResult(repResult, batchInput) {
|
|
61823
61847
|
const { data, errors } = repResult;
|
|
@@ -62019,19 +62043,26 @@
|
|
|
62019
62043
|
priority: 'background',
|
|
62020
62044
|
observabilityContext: {},
|
|
62021
62045
|
}, abortController, (response) => {
|
|
62022
|
-
|
|
62023
|
-
|
|
62024
|
-
|
|
62025
|
-
|
|
62026
|
-
|
|
62027
|
-
|
|
62046
|
+
if (response.status < 200 || response.status > 299) {
|
|
62047
|
+
reject(new Error(response.body || 'Network error'));
|
|
62048
|
+
return;
|
|
62049
|
+
}
|
|
62050
|
+
try {
|
|
62051
|
+
const { body } = response;
|
|
62052
|
+
if (body) {
|
|
62053
|
+
const { results } = JSON.parse(body);
|
|
62054
|
+
if (results) {
|
|
62055
|
+
const gqlResults = results.map((compositeGqlResult) => compositeGqlResult.result);
|
|
62056
|
+
resolve(gqlResults);
|
|
62057
|
+
return;
|
|
62058
|
+
}
|
|
62028
62059
|
}
|
|
62029
62060
|
else {
|
|
62030
62061
|
reject(new Error(`No body returned from ${batchEndPointPath} endpoint`));
|
|
62031
62062
|
}
|
|
62032
62063
|
}
|
|
62033
|
-
|
|
62034
|
-
reject(
|
|
62064
|
+
catch (error) {
|
|
62065
|
+
reject(error);
|
|
62035
62066
|
}
|
|
62036
62067
|
}, (error) => {
|
|
62037
62068
|
reject(error);
|
|
@@ -62052,12 +62083,21 @@
|
|
|
62052
62083
|
priority: 'background',
|
|
62053
62084
|
observabilityContext: {},
|
|
62054
62085
|
}, abortController, (response) => {
|
|
62055
|
-
|
|
62056
|
-
|
|
62057
|
-
|
|
62086
|
+
if (response.status < 200 || response.status > 299) {
|
|
62087
|
+
reject(new Error(response.body || 'Network error'));
|
|
62088
|
+
return;
|
|
62058
62089
|
}
|
|
62059
|
-
|
|
62060
|
-
|
|
62090
|
+
try {
|
|
62091
|
+
const { body } = response;
|
|
62092
|
+
if (body) {
|
|
62093
|
+
resolve(JSON.parse(body));
|
|
62094
|
+
}
|
|
62095
|
+
else {
|
|
62096
|
+
reject(new Error(`No body returned from ${endPointPath} endpoint`));
|
|
62097
|
+
}
|
|
62098
|
+
}
|
|
62099
|
+
catch (error) {
|
|
62100
|
+
reject(error);
|
|
62061
62101
|
}
|
|
62062
62102
|
}, (error) => {
|
|
62063
62103
|
reject(error);
|
|
@@ -62075,12 +62115,21 @@
|
|
|
62075
62115
|
priority: 'background',
|
|
62076
62116
|
observabilityContext: {},
|
|
62077
62117
|
}, abortController, (response) => {
|
|
62078
|
-
|
|
62079
|
-
|
|
62080
|
-
|
|
62118
|
+
if (response.status < 200 || response.status > 299) {
|
|
62119
|
+
reject(new Error(response.body || 'Network error'));
|
|
62120
|
+
return;
|
|
62081
62121
|
}
|
|
62082
|
-
|
|
62083
|
-
|
|
62122
|
+
try {
|
|
62123
|
+
const { body } = response;
|
|
62124
|
+
if (body) {
|
|
62125
|
+
resolve(JSON.parse(body).objects);
|
|
62126
|
+
}
|
|
62127
|
+
else {
|
|
62128
|
+
reject(new Error(`No body returned from ${endPointPath} endpoint`));
|
|
62129
|
+
}
|
|
62130
|
+
}
|
|
62131
|
+
catch (error) {
|
|
62132
|
+
reject(error);
|
|
62084
62133
|
}
|
|
62085
62134
|
}, (error) => {
|
|
62086
62135
|
reject(error);
|
|
@@ -62102,19 +62151,28 @@
|
|
|
62102
62151
|
priority: 'background',
|
|
62103
62152
|
observabilityContext: {},
|
|
62104
62153
|
}, abortController, (response) => {
|
|
62105
|
-
|
|
62106
|
-
|
|
62107
|
-
|
|
62108
|
-
results.forEach((result) => {
|
|
62109
|
-
// only populate the map if the status code is 200, caller needs to check for missing keys
|
|
62110
|
-
if (result.statusCode === 200) {
|
|
62111
|
-
map.set(result.result.apiName, result.result);
|
|
62112
|
-
}
|
|
62113
|
-
});
|
|
62114
|
-
resolve(map);
|
|
62154
|
+
if (response.status < 200 || response.status > 299) {
|
|
62155
|
+
reject(new Error(response.body || 'Network error'));
|
|
62156
|
+
return;
|
|
62115
62157
|
}
|
|
62116
|
-
|
|
62117
|
-
|
|
62158
|
+
try {
|
|
62159
|
+
const { body } = response;
|
|
62160
|
+
if (body) {
|
|
62161
|
+
const results = JSON.parse(body).results;
|
|
62162
|
+
results.forEach((result) => {
|
|
62163
|
+
// only populate the map if the status code is 200, caller needs to check for missing keys
|
|
62164
|
+
if (result.statusCode === 200) {
|
|
62165
|
+
map.set(result.result.apiName, result.result);
|
|
62166
|
+
}
|
|
62167
|
+
});
|
|
62168
|
+
resolve(map);
|
|
62169
|
+
}
|
|
62170
|
+
else {
|
|
62171
|
+
reject(new Error(`No body returned from ${endPointPath} endpoint`));
|
|
62172
|
+
}
|
|
62173
|
+
}
|
|
62174
|
+
catch (error) {
|
|
62175
|
+
reject(error);
|
|
62118
62176
|
}
|
|
62119
62177
|
}, (error) => {
|
|
62120
62178
|
reject(error);
|
|
@@ -62543,7 +62601,7 @@
|
|
|
62543
62601
|
id: '@salesforce/lds-network-adapter',
|
|
62544
62602
|
instrument: instrument$2,
|
|
62545
62603
|
});
|
|
62546
|
-
// version: 1.287.0-
|
|
62604
|
+
// version: 1.287.0-dev14-85b5de0a8f
|
|
62547
62605
|
|
|
62548
62606
|
const { create: create$3, keys: keys$3 } = Object;
|
|
62549
62607
|
const { stringify: stringify$1, parse: parse$1 } = JSON;
|
|
@@ -82607,7 +82665,7 @@
|
|
|
82607
82665
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
82608
82666
|
instrument: instrument$1,
|
|
82609
82667
|
});
|
|
82610
|
-
// version: 1.287.0-
|
|
82668
|
+
// version: 1.287.0-dev14-912e45c126
|
|
82611
82669
|
|
|
82612
82670
|
// On core the unstable adapters are re-exported with different names,
|
|
82613
82671
|
// we want to match them here.
|
|
@@ -84863,7 +84921,7 @@
|
|
|
84863
84921
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
84864
84922
|
graphQLImperative = ldsAdapter;
|
|
84865
84923
|
});
|
|
84866
|
-
// version: 1.287.0-
|
|
84924
|
+
// version: 1.287.0-dev14-912e45c126
|
|
84867
84925
|
|
|
84868
84926
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
84869
84927
|
__proto__: null,
|
|
@@ -85601,7 +85659,7 @@
|
|
|
85601
85659
|
function register(r) {
|
|
85602
85660
|
callbacks$1.forEach((callback) => callback(r));
|
|
85603
85661
|
}
|
|
85604
|
-
// version: 1.287.0-
|
|
85662
|
+
// version: 1.287.0-dev14-85b5de0a8f
|
|
85605
85663
|
|
|
85606
85664
|
/**
|
|
85607
85665
|
* Returns true if the value acts like a Promise, i.e. has a "then" function,
|
|
@@ -90582,4 +90640,4 @@
|
|
|
90582
90640
|
exports.subscribeToAdapter = subscribeToAdapter;
|
|
90583
90641
|
|
|
90584
90642
|
}));
|
|
90585
|
-
// version: 1.287.0-
|
|
90643
|
+
// version: 1.287.0-dev14-85b5de0a8f
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-worker-api",
|
|
3
|
-
"version": "1.287.0-
|
|
3
|
+
"version": "1.287.0-dev14",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "dist/standalone/es/lds-worker-api.js",
|
|
@@ -35,15 +35,15 @@
|
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@oat-sa/rollup-plugin-wildcard-external": "^1.0.0",
|
|
38
|
-
"@salesforce/lds-adapters-graphql": "^1.287.0-
|
|
39
|
-
"@salesforce/lds-adapters-uiapi": "^1.287.0-
|
|
40
|
-
"@salesforce/lds-default-luvio": "^1.287.0-
|
|
41
|
-
"@salesforce/lds-drafts": "^1.287.0-
|
|
42
|
-
"@salesforce/lds-graphql-parser": "^1.287.0-
|
|
43
|
-
"@salesforce/lds-luvio-engine": "^1.287.0-
|
|
44
|
-
"@salesforce/lds-priming": "^1.287.0-
|
|
45
|
-
"@salesforce/lds-runtime-mobile": "^1.287.0-
|
|
46
|
-
"@salesforce/nimbus-plugin-lds": "^1.287.0-
|
|
38
|
+
"@salesforce/lds-adapters-graphql": "^1.287.0-dev14",
|
|
39
|
+
"@salesforce/lds-adapters-uiapi": "^1.287.0-dev14",
|
|
40
|
+
"@salesforce/lds-default-luvio": "^1.287.0-dev14",
|
|
41
|
+
"@salesforce/lds-drafts": "^1.287.0-dev14",
|
|
42
|
+
"@salesforce/lds-graphql-parser": "^1.287.0-dev14",
|
|
43
|
+
"@salesforce/lds-luvio-engine": "^1.287.0-dev14",
|
|
44
|
+
"@salesforce/lds-priming": "^1.287.0-dev14",
|
|
45
|
+
"@salesforce/lds-runtime-mobile": "^1.287.0-dev14",
|
|
46
|
+
"@salesforce/nimbus-plugin-lds": "^1.287.0-dev14",
|
|
47
47
|
"ajv": "^8.11.0",
|
|
48
48
|
"glob": "^7.1.5",
|
|
49
49
|
"nimbus-types": "^2.0.0-alpha1",
|