@salesforce/lds-worker-api 1.147.1 → 1.147.3
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.
|
@@ -770,4 +770,4 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
770
770
|
}
|
|
771
771
|
|
|
772
772
|
export { createPrimingSession, draftManager, draftQueue, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, setMetadataTTL, setUiApiRecordTTL, subscribeToAdapter };
|
|
773
|
-
// version: 1.147.
|
|
773
|
+
// version: 1.147.3-6ff8ead8f
|
|
@@ -22,7 +22,7 @@ var SnapshotState$3;
|
|
|
22
22
|
SnapshotState["Stale"] = "Stale";
|
|
23
23
|
})(SnapshotState$3 || (SnapshotState$3 = {}));
|
|
24
24
|
|
|
25
|
-
const { create: create$a, entries: entries$4, freeze: freeze$5, keys: keys$b, values: values$
|
|
25
|
+
const { create: create$a, entries: entries$4, freeze: freeze$5, keys: keys$b, values: values$4 } = Object;
|
|
26
26
|
const { hasOwnProperty: hasOwnProperty$3 } = Object.prototype;
|
|
27
27
|
const { isArray: isArray$9 } = Array;
|
|
28
28
|
const { push: push$4, indexOf, slice: slice$2 } = Array.prototype;
|
|
@@ -3801,7 +3801,7 @@ function withDefaultLuvio(callback) {
|
|
|
3801
3801
|
}
|
|
3802
3802
|
callbacks.push(callback);
|
|
3803
3803
|
}
|
|
3804
|
-
// version: 1.147.
|
|
3804
|
+
// version: 1.147.3-6ff8ead8f
|
|
3805
3805
|
|
|
3806
3806
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
3807
3807
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -15225,7 +15225,7 @@ function parseAndVisit(source) {
|
|
|
15225
15225
|
updateReferenceMapWithKnownKey(ast, luvioDocumentNode);
|
|
15226
15226
|
return luvioDocumentNode;
|
|
15227
15227
|
}
|
|
15228
|
-
// version: 1.147.
|
|
15228
|
+
// version: 1.147.3-6ff8ead8f
|
|
15229
15229
|
|
|
15230
15230
|
function unwrap(data) {
|
|
15231
15231
|
// The lwc-luvio bindings import a function from lwc called "unwrap".
|
|
@@ -16138,7 +16138,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
|
|
|
16138
16138
|
const { apiFamily, name } = metadata;
|
|
16139
16139
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
16140
16140
|
}
|
|
16141
|
-
// version: 1.147.
|
|
16141
|
+
// version: 1.147.3-6ff8ead8f
|
|
16142
16142
|
|
|
16143
16143
|
/**
|
|
16144
16144
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -16788,7 +16788,7 @@ const select$1F = function ListScopeRelatedEntityRepresentationSelect() {
|
|
|
16788
16788
|
};
|
|
16789
16789
|
};
|
|
16790
16790
|
|
|
16791
|
-
const VERSION$1a$1 = "
|
|
16791
|
+
const VERSION$1a$1 = "a51de242c746e5500a833e84dfaa2170";
|
|
16792
16792
|
const select$1E = function ListScopeRepresentationSelect() {
|
|
16793
16793
|
const { selections: ListScopeEntityRepresentation__selections, opaque: ListScopeEntityRepresentation__opaque, } = select$1G();
|
|
16794
16794
|
const { selections: ListScopeRelatedEntityRepresentation__selections, opaque: ListScopeRelatedEntityRepresentation__opaque, } = select$1F();
|
|
@@ -16804,6 +16804,7 @@ const select$1E = function ListScopeRepresentationSelect() {
|
|
|
16804
16804
|
{
|
|
16805
16805
|
name: 'entity',
|
|
16806
16806
|
kind: 'Object',
|
|
16807
|
+
nullable: true,
|
|
16807
16808
|
selections: ListScopeEntityRepresentation__selections
|
|
16808
16809
|
},
|
|
16809
16810
|
{
|
|
@@ -16813,6 +16814,7 @@ const select$1E = function ListScopeRepresentationSelect() {
|
|
|
16813
16814
|
{
|
|
16814
16815
|
name: 'relatedEntity',
|
|
16815
16816
|
kind: 'Object',
|
|
16817
|
+
nullable: true,
|
|
16816
16818
|
selections: ListScopeRelatedEntityRepresentation__selections
|
|
16817
16819
|
}
|
|
16818
16820
|
]
|
|
@@ -43999,7 +44001,7 @@ withDefaultLuvio((luvio) => {
|
|
|
43999
44001
|
dropFunction: instrumentation$2.notifyRecordUpdateAvailableDropped,
|
|
44000
44002
|
});
|
|
44001
44003
|
});
|
|
44002
|
-
// version: 1.147.
|
|
44004
|
+
// version: 1.147.3-7875ca9bf
|
|
44003
44005
|
|
|
44004
44006
|
var caseSensitiveUserId = '005B0000000GR4OIAW';
|
|
44005
44007
|
|
|
@@ -45845,7 +45847,7 @@ function isFailure(result) {
|
|
|
45845
45847
|
function errors(result) {
|
|
45846
45848
|
return result.error;
|
|
45847
45849
|
}
|
|
45848
|
-
function values$
|
|
45850
|
+
function values$3(result) {
|
|
45849
45851
|
return result.value;
|
|
45850
45852
|
}
|
|
45851
45853
|
function flattenResults(results) {
|
|
@@ -45853,7 +45855,7 @@ function flattenResults(results) {
|
|
|
45853
45855
|
if (fails.length > 0) {
|
|
45854
45856
|
return failure(fails);
|
|
45855
45857
|
}
|
|
45856
|
-
return success(results.filter(isSuccess).map(values$
|
|
45858
|
+
return success(results.filter(isSuccess).map(values$3));
|
|
45857
45859
|
}
|
|
45858
45860
|
|
|
45859
45861
|
function getFieldInfo(apiName, fieldName, infoMap) {
|
|
@@ -46727,7 +46729,7 @@ function fieldsToFilters(fieldValues, joinAlias, apiName, input, compoundOperato
|
|
|
46727
46729
|
if (failures.length > 0) {
|
|
46728
46730
|
return failure(failures);
|
|
46729
46731
|
}
|
|
46730
|
-
const containers = results.filter(isSuccess).map(values$
|
|
46732
|
+
const containers = results.filter(isSuccess).map(values$3);
|
|
46731
46733
|
const predicates = [];
|
|
46732
46734
|
containers.forEach((c) => {
|
|
46733
46735
|
if (c.predicate !== undefined) {
|
|
@@ -47019,7 +47021,7 @@ function dateFunctions(operatorNode, extract, dataType) {
|
|
|
47019
47021
|
if (fails.length > 0) {
|
|
47020
47022
|
return failure(fails);
|
|
47021
47023
|
}
|
|
47022
|
-
const vals = results.filter(isSuccess).reduce(flatMap$1(values$
|
|
47024
|
+
const vals = results.filter(isSuccess).reduce(flatMap$1(values$3), []);
|
|
47023
47025
|
return success(vals);
|
|
47024
47026
|
}
|
|
47025
47027
|
function isFilterFunction(name) {
|
|
@@ -47029,7 +47031,7 @@ function fieldOperators(operatorNode, dataType) {
|
|
|
47029
47031
|
const results = Object.entries(operatorNode.fields)
|
|
47030
47032
|
.filter(([key, _]) => isFilterFunction(key) === false)
|
|
47031
47033
|
.map(([key, value]) => operatorWithValue(key, value, dataType));
|
|
47032
|
-
const _values = results.filter(isSuccess).map(values$
|
|
47034
|
+
const _values = results.filter(isSuccess).map(values$3);
|
|
47033
47035
|
const fails = results.filter(isFailure).reduce(flatMap$1(errors), []);
|
|
47034
47036
|
if (fails.length > 0) {
|
|
47035
47037
|
return failure(fails);
|
|
@@ -47950,7 +47952,7 @@ function selectionToQueryField(node, names, parentApiName, parentAlias, input, j
|
|
|
47950
47952
|
}
|
|
47951
47953
|
function recordFields(luvioSelections, names, parentApiName, parentAlias, input, joins) {
|
|
47952
47954
|
const results = luvioSelections.map((selection) => selectionToQueryField(selection, names, parentApiName, parentAlias, input, joins));
|
|
47953
|
-
const fields = results.filter(isSuccess).reduce(flatMap$1(values$
|
|
47955
|
+
const fields = results.filter(isSuccess).reduce(flatMap$1(values$3), []);
|
|
47954
47956
|
const fails = results.filter(isFailure).reduce(flatMap$1(errors), []);
|
|
47955
47957
|
if (fails.length > 0) {
|
|
47956
47958
|
return failure(fails);
|
|
@@ -48155,7 +48157,7 @@ function rootRecordQuery(selection, input) {
|
|
|
48155
48157
|
}
|
|
48156
48158
|
function rootQuery(recordNodes, input) {
|
|
48157
48159
|
const results = recordNodes.map((record) => rootRecordQuery(record, input));
|
|
48158
|
-
const connections = results.filter(isSuccess).map(values$
|
|
48160
|
+
const connections = results.filter(isSuccess).map(values$3);
|
|
48159
48161
|
const fails = results.filter(isFailure).reduce(flatMap$1(errors), []);
|
|
48160
48162
|
if (fails.length > 0) {
|
|
48161
48163
|
return failure(fails);
|
|
@@ -48894,7 +48896,7 @@ function createDraftSynthesisErrorResponse(message = 'failed to synthesize draft
|
|
|
48894
48896
|
return new DraftErrorFetchResponse(HttpStatusCode$1.BadRequest, error);
|
|
48895
48897
|
}
|
|
48896
48898
|
|
|
48897
|
-
const { keys: keys$4, create: create$4, assign: assign$3, values: values$
|
|
48899
|
+
const { keys: keys$4, create: create$4, assign: assign$3, values: values$2 } = Object;
|
|
48898
48900
|
const { stringify: stringify$4, parse: parse$4 } = JSON;
|
|
48899
48901
|
const { isArray: isArray$3 } = Array;
|
|
48900
48902
|
|
|
@@ -49269,7 +49271,7 @@ class DurableDraftQueue {
|
|
|
49269
49271
|
const queueOperations = handler.getQueueOperationsForCompletingDrafts(queue, action);
|
|
49270
49272
|
// write the queue operations to the store prior to ingesting the result
|
|
49271
49273
|
await this.draftStore.completeAction(queueOperations);
|
|
49272
|
-
await handler.handleActionCompleted(action, queueOperations, values$
|
|
49274
|
+
await handler.handleActionCompleted(action, queueOperations, values$2(this.handlers));
|
|
49273
49275
|
this.retryIntervalMilliseconds = 0;
|
|
49274
49276
|
this.uploadingActionId = undefined;
|
|
49275
49277
|
await this.notifyChangedListeners({
|
|
@@ -50592,7 +50594,7 @@ function isArrayLike(x) {
|
|
|
50592
50594
|
(x.length === 0 || (x.length > 0 && Object.prototype.hasOwnProperty.call(x, x.length - 1))));
|
|
50593
50595
|
}
|
|
50594
50596
|
|
|
50595
|
-
const { create: create$3, keys: keys$3, values, entries: entries$2 } = Object;
|
|
50597
|
+
const { create: create$3, keys: keys$3, values: values$1, entries: entries$2 } = Object;
|
|
50596
50598
|
const { stringify: stringify$3, parse: parse$3 } = JSON;
|
|
50597
50599
|
const { isArray: isArray$2 } = Array;
|
|
50598
50600
|
|
|
@@ -50925,7 +50927,7 @@ function dateTimePredicate(input, operator, field, alias) {
|
|
|
50925
50927
|
return predicate;
|
|
50926
50928
|
}
|
|
50927
50929
|
else if (literal !== undefined) {
|
|
50928
|
-
const isAvailableLiteral = values(DateLiteral).includes(literal);
|
|
50930
|
+
const isAvailableLiteral = values$1(DateLiteral).includes(literal);
|
|
50929
50931
|
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
50930
50932
|
if (!isAvailableLiteral)
|
|
50931
50933
|
throw new Error(`${literal} is not a valid DateLiteral`);
|
|
@@ -51587,7 +51589,7 @@ function dedupeJoins(joins) {
|
|
|
51587
51589
|
for (const join of joins) {
|
|
51588
51590
|
deduped[join.alias + join.to] = join;
|
|
51589
51591
|
}
|
|
51590
|
-
return values(deduped);
|
|
51592
|
+
return values$1(deduped);
|
|
51591
51593
|
}
|
|
51592
51594
|
function buildJoins(config) {
|
|
51593
51595
|
let sql = '';
|
|
@@ -52221,7 +52223,7 @@ function flatten(previous, current) {
|
|
|
52221
52223
|
return previous.concat(current);
|
|
52222
52224
|
}
|
|
52223
52225
|
function findFieldInfo(objectInfo, fieldName) {
|
|
52224
|
-
return values(objectInfo.fields).find((field) => field.apiName === fieldName ||
|
|
52226
|
+
return values$1(objectInfo.fields).find((field) => field.apiName === fieldName ||
|
|
52225
52227
|
(field.dataType === 'Reference' && field.relationshipName === fieldName));
|
|
52226
52228
|
}
|
|
52227
52229
|
|
|
@@ -52241,10 +52243,10 @@ function orderByToPredicate(orderBy, recordType, alias, objectInfoMap, joins) {
|
|
|
52241
52243
|
for (let i = 0, len = keys$1.length; i < len; i++) {
|
|
52242
52244
|
const key = keys$1[i];
|
|
52243
52245
|
const parentFields = objectInfoMap[recordType].fields;
|
|
52244
|
-
const fieldInfo = values(parentFields).find(findSpanningField(key));
|
|
52246
|
+
const fieldInfo = values$1(parentFields).find(findSpanningField(key));
|
|
52245
52247
|
if (fieldInfo && fieldInfo.referenceToInfos.length > 0) {
|
|
52246
52248
|
const { apiName } = fieldInfo.referenceToInfos[0];
|
|
52247
|
-
const parentFieldInfo = values(objectInfoMap[recordType].fields).find(findSpanningField(fieldInfo.apiName));
|
|
52249
|
+
const parentFieldInfo = values$1(objectInfoMap[recordType].fields).find(findSpanningField(fieldInfo.apiName));
|
|
52248
52250
|
if (parentFieldInfo !== undefined) {
|
|
52249
52251
|
const path = {
|
|
52250
52252
|
leftPath: `$.fields.${parentFieldInfo.apiName}.value`,
|
|
@@ -52386,7 +52388,7 @@ function addResolversToSchema(schema, polyFields) {
|
|
|
52386
52388
|
let baseRecord = undefined;
|
|
52387
52389
|
// Concrete types for Polymorphic field
|
|
52388
52390
|
const polyTypes = [];
|
|
52389
|
-
for (const type of values(schema.getTypeMap())) {
|
|
52391
|
+
for (const type of values$1(schema.getTypeMap())) {
|
|
52390
52392
|
if (type.name === 'Record') {
|
|
52391
52393
|
recordInterface = type;
|
|
52392
52394
|
}
|
|
@@ -52399,7 +52401,7 @@ function addResolversToSchema(schema, polyFields) {
|
|
|
52399
52401
|
if (polyFields.find((fieldTypeName) => fieldTypeName === type.name) !== undefined) {
|
|
52400
52402
|
polyTypes.push(type);
|
|
52401
52403
|
}
|
|
52402
|
-
const fields = values(type.getFields());
|
|
52404
|
+
const fields = values$1(type.getFields());
|
|
52403
52405
|
// initialize the fields of current type with default behavior
|
|
52404
52406
|
for (const field of fields) {
|
|
52405
52407
|
field.resolve = defaultFieldResolver;
|
|
@@ -52716,7 +52718,7 @@ function generateRecordQueries(objectInfos) {
|
|
|
52716
52718
|
let recordConnections = ``;
|
|
52717
52719
|
const polymorphicFieldTypeNames = new Set();
|
|
52718
52720
|
let typedScalars = new Set();
|
|
52719
|
-
for (const objectInfo of values(objectInfos)) {
|
|
52721
|
+
for (const objectInfo of values$1(objectInfos)) {
|
|
52720
52722
|
const { apiName, childRelationships } = objectInfo;
|
|
52721
52723
|
let fields = ``;
|
|
52722
52724
|
typedScalars.add(`${apiName}_Filter`);
|
|
@@ -52732,7 +52734,7 @@ function generateRecordQueries(objectInfos) {
|
|
|
52732
52734
|
typedScalars.add(`${childObjectApiName}_OrderBy`);
|
|
52733
52735
|
}
|
|
52734
52736
|
}
|
|
52735
|
-
for (const field of values(objectInfo.fields)) {
|
|
52737
|
+
for (const field of values$1(objectInfo.fields)) {
|
|
52736
52738
|
if (!fieldsStaticallyAdded.includes(field.apiName)) {
|
|
52737
52739
|
fields += `${field.apiName}: ${dataTypeToType(field.dataType, field.apiName)}\n`;
|
|
52738
52740
|
}
|
|
@@ -53235,7 +53237,7 @@ function isMineScopeAvailable(apiNamePath, objectInfoApiMap, objectInfos) {
|
|
|
53235
53237
|
const objectInfo = objectInfos[apiName[0]];
|
|
53236
53238
|
if (!objectInfo)
|
|
53237
53239
|
return false;
|
|
53238
|
-
return values(objectInfo.fields).some((fieldInfo) => {
|
|
53240
|
+
return values$1(objectInfo.fields).some((fieldInfo) => {
|
|
53239
53241
|
return (fieldInfo.apiName === 'OwnerId' &&
|
|
53240
53242
|
fieldInfo.referenceToInfos.some((referenceToInfo) => {
|
|
53241
53243
|
return referenceToInfo.apiName === 'User';
|
|
@@ -54486,7 +54488,7 @@ function referenceIdFieldForRelationship(relationshipName) {
|
|
|
54486
54488
|
* For full license text, see the LICENSE.txt file
|
|
54487
54489
|
*/
|
|
54488
54490
|
|
|
54489
|
-
const { keys: keys$2$1, create: create$2$1, assign: assign$2, freeze: freeze$2 } = Object;
|
|
54491
|
+
const { keys: keys$2$1, values, create: create$2$1, assign: assign$2, freeze: freeze$2 } = Object;
|
|
54490
54492
|
const { stringify: stringify$2, parse: parse$2 } = JSON;
|
|
54491
54493
|
const { shift } = Array.prototype;
|
|
54492
54494
|
const { isArray: isArray$1$1 } = Array;
|
|
@@ -55217,15 +55219,15 @@ async function getAdapterData(adapter, config) {
|
|
|
55217
55219
|
const LDS_ACTION_HANDLER_ID = 'LDS_ACTION_HANDLER';
|
|
55218
55220
|
const LDS_ACTION_METADATA_API_NAME = 'LDS_ACTION_METADATA_API_NAME';
|
|
55219
55221
|
class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
55220
|
-
constructor(getLuvio, networkAdapter, durableStore, draftQueue, getRecordAdapter,
|
|
55222
|
+
constructor(getLuvio, networkAdapter, durableStore, draftQueue, getRecordAdapter, objectInfoService, isDraftId, recordService) {
|
|
55221
55223
|
super(draftQueue, networkAdapter, getLuvio);
|
|
55222
55224
|
this.getLuvio = getLuvio;
|
|
55223
55225
|
this.networkAdapter = networkAdapter;
|
|
55224
55226
|
this.durableStore = durableStore;
|
|
55225
55227
|
this.draftQueue = draftQueue;
|
|
55226
55228
|
this.getRecordAdapter = getRecordAdapter;
|
|
55229
|
+
this.objectInfoService = objectInfoService;
|
|
55227
55230
|
this.isDraftId = isDraftId;
|
|
55228
|
-
this.apiNameForPrefix = apiNameForPrefix;
|
|
55229
55231
|
this.recordService = recordService;
|
|
55230
55232
|
this.handlerId = LDS_ACTION_HANDLER_ID;
|
|
55231
55233
|
this.collectedFields = create$2$1(null);
|
|
@@ -55272,8 +55274,55 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
55272
55274
|
throw Error('unknown draft precondition failed');
|
|
55273
55275
|
}
|
|
55274
55276
|
}
|
|
55277
|
+
else if (metaDataResult.status === 'missing-referenced-records') {
|
|
55278
|
+
const referenceFields = metaDataResult.missingRecordReferences;
|
|
55279
|
+
if (referenceFields !== undefined) {
|
|
55280
|
+
//fetches the reference record async
|
|
55281
|
+
this.fetchReferenceRecord(referenceFields);
|
|
55282
|
+
}
|
|
55283
|
+
}
|
|
55275
55284
|
return pendingAction;
|
|
55276
55285
|
}
|
|
55286
|
+
async fetchReferenceRecord(referenceFields) {
|
|
55287
|
+
const promises = referenceFields.map(async (referenceFieldInfo) => {
|
|
55288
|
+
const apiName = await this.identifyApiName(referenceFieldInfo.id, referenceFieldInfo.field);
|
|
55289
|
+
if (apiName === undefined) {
|
|
55290
|
+
return;
|
|
55291
|
+
}
|
|
55292
|
+
const objectInfoMap = await this.objectInfoService.getObjectInfos([
|
|
55293
|
+
apiName,
|
|
55294
|
+
]);
|
|
55295
|
+
if (objectInfoMap[apiName] === undefined) {
|
|
55296
|
+
return;
|
|
55297
|
+
}
|
|
55298
|
+
const objectInfo = objectInfoMap[apiName];
|
|
55299
|
+
const optionalFields = values(objectInfo.fields).map((field) => `${apiName}.${field.apiName}`);
|
|
55300
|
+
await getAdapterData(this.getRecordAdapter, {
|
|
55301
|
+
recordId: referenceFieldInfo.id,
|
|
55302
|
+
optionalFields,
|
|
55303
|
+
});
|
|
55304
|
+
});
|
|
55305
|
+
await Promise.all(promises);
|
|
55306
|
+
}
|
|
55307
|
+
/**
|
|
55308
|
+
* identify the API Name from the record ID and its field representation. For example, ApiName for `001x0000004cKfzAAE` is `Account` if its field info reference to `Account`
|
|
55309
|
+
* representation
|
|
55310
|
+
* @param id
|
|
55311
|
+
* @param fieldInfo
|
|
55312
|
+
* @returns apiName
|
|
55313
|
+
*/
|
|
55314
|
+
async identifyApiName(id, fieldInfo) {
|
|
55315
|
+
const referenceToInfos = fieldInfo.referenceToInfos;
|
|
55316
|
+
const apiNames = referenceToInfos.map((referenceToInfo) => referenceToInfo.apiName);
|
|
55317
|
+
const objectInfoMap = await this.objectInfoService.getObjectInfos(apiNames);
|
|
55318
|
+
for (const objectInfo of values(objectInfoMap)) {
|
|
55319
|
+
const { apiName, keyPrefix } = objectInfo;
|
|
55320
|
+
if (keyPrefix !== null && id.startsWith(keyPrefix)) {
|
|
55321
|
+
return apiName;
|
|
55322
|
+
}
|
|
55323
|
+
}
|
|
55324
|
+
return undefined;
|
|
55325
|
+
}
|
|
55277
55326
|
canRepresentationContainDraftMetadata(representationName) {
|
|
55278
55327
|
return representationName === RECORD_REPRESENTATION_NAME$1;
|
|
55279
55328
|
}
|
|
@@ -55451,7 +55500,7 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
55451
55500
|
// as a last resort we'll do a lookup for cached object infos by prefix
|
|
55452
55501
|
// note this will throw if the object info hasn't been previously cached
|
|
55453
55502
|
const prefix = recordId.substring(0, 3);
|
|
55454
|
-
return this.apiNameForPrefix(prefix);
|
|
55503
|
+
return this.objectInfoService.apiNameForPrefix(prefix);
|
|
55455
55504
|
}
|
|
55456
55505
|
/**
|
|
55457
55506
|
* Inspects the resource request to ensure this handler can handle it
|
|
@@ -55893,7 +55942,7 @@ class UiApiDraftRecordService {
|
|
|
55893
55942
|
}
|
|
55894
55943
|
const objectInfoMap = new Map();
|
|
55895
55944
|
const referenceMap = new Map();
|
|
55896
|
-
const
|
|
55945
|
+
const referenceFields = [];
|
|
55897
55946
|
const metadata = {
|
|
55898
55947
|
luvio: this.getLuvio(),
|
|
55899
55948
|
userId: this.userId,
|
|
@@ -55934,13 +55983,17 @@ class UiApiDraftRecordService {
|
|
|
55934
55983
|
continue;
|
|
55935
55984
|
}
|
|
55936
55985
|
const key = getRecordKeyForId(this.getLuvio(), id);
|
|
55937
|
-
if (referenceMap.has(key) === false &&
|
|
55986
|
+
if (referenceMap.has(key) === false &&
|
|
55987
|
+
!referenceFields.some((refInfo) => refInfo.id === id)) {
|
|
55938
55988
|
const record = await this.durableStore.getDenormalizedRecord(key);
|
|
55939
55989
|
if (record !== undefined) {
|
|
55940
55990
|
referenceMap.set(key, record);
|
|
55941
55991
|
}
|
|
55942
55992
|
else {
|
|
55943
|
-
|
|
55993
|
+
referenceFields.push({
|
|
55994
|
+
id,
|
|
55995
|
+
field: fieldInfo,
|
|
55996
|
+
});
|
|
55944
55997
|
}
|
|
55945
55998
|
}
|
|
55946
55999
|
}
|
|
@@ -55953,12 +56006,12 @@ class UiApiDraftRecordService {
|
|
|
55953
56006
|
};
|
|
55954
56007
|
}
|
|
55955
56008
|
}
|
|
55956
|
-
if (
|
|
56009
|
+
if (referenceFields.length > 0) {
|
|
55957
56010
|
return {
|
|
55958
56011
|
ok: true,
|
|
55959
56012
|
data: metadata,
|
|
55960
56013
|
status: 'missing-referenced-records',
|
|
55961
|
-
|
|
56014
|
+
missingRecordReferences: referenceFields,
|
|
55962
56015
|
};
|
|
55963
56016
|
}
|
|
55964
56017
|
return {
|
|
@@ -59480,7 +59533,7 @@ function getRuntime() {
|
|
|
59480
59533
|
// draft queue
|
|
59481
59534
|
lazyDraftQueue = buildLdsDraftQueue(recordDenormingStore);
|
|
59482
59535
|
const draftService = new UiApiDraftRecordService(lazyDraftQueue, () => lazyLuvio, recordDenormingStore, getObjectInfo, newRecordId, userId, formatDisplayValue);
|
|
59483
|
-
const uiApiRecordHandler = new UiApiActionHandler(() => lazyLuvio, lazyNetworkAdapter, recordDenormingStore, lazyDraftQueue, getRecord,
|
|
59536
|
+
const uiApiRecordHandler = new UiApiActionHandler(() => lazyLuvio, lazyNetworkAdapter, recordDenormingStore, lazyDraftQueue, getRecord, lazyObjectInfoService, isGenerated, draftService);
|
|
59484
59537
|
const quickActionHandler = new QuickActionExecutionRepresentationHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated);
|
|
59485
59538
|
const contentDocumentCompositeActionHandler = new ContentDocumentCompositeRepresentationActionHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated, recordDenormingStore, NimbusBinaryStore);
|
|
59486
59539
|
lazyDraftQueue.addHandler(uiApiRecordHandler);
|
|
@@ -59570,7 +59623,7 @@ register({
|
|
|
59570
59623
|
id: '@salesforce/lds-network-adapter',
|
|
59571
59624
|
instrument: instrument$1,
|
|
59572
59625
|
});
|
|
59573
|
-
// version: 1.147.
|
|
59626
|
+
// version: 1.147.3-6ff8ead8f
|
|
59574
59627
|
|
|
59575
59628
|
const { create: create$2, keys: keys$2 } = Object;
|
|
59576
59629
|
const { stringify: stringify$1, parse: parse$1 } = JSON;
|
|
@@ -80415,7 +80468,7 @@ register({
|
|
|
80415
80468
|
configuration: { ...configurationForGraphQLAdapters },
|
|
80416
80469
|
instrument,
|
|
80417
80470
|
});
|
|
80418
|
-
// version: 1.147.
|
|
80471
|
+
// version: 1.147.3-7875ca9bf
|
|
80419
80472
|
|
|
80420
80473
|
// On core the unstable adapters are re-exported with different names,
|
|
80421
80474
|
|
|
@@ -82653,7 +82706,7 @@ withDefaultLuvio((luvio) => {
|
|
|
82653
82706
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
82654
82707
|
graphQLImperative = ldsAdapter;
|
|
82655
82708
|
});
|
|
82656
|
-
// version: 1.147.
|
|
82709
|
+
// version: 1.147.3-7875ca9bf
|
|
82657
82710
|
|
|
82658
82711
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
82659
82712
|
__proto__: null,
|
|
@@ -83342,4 +83395,4 @@ const { luvio } = getRuntime();
|
|
|
83342
83395
|
setDefaultLuvio({ luvio });
|
|
83343
83396
|
|
|
83344
83397
|
export { createPrimingSession, draftManager, draftQueue, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, subscribeToAdapter };
|
|
83345
|
-
// version: 1.147.
|
|
83398
|
+
// version: 1.147.3-6ff8ead8f
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
SnapshotState["Stale"] = "Stale";
|
|
31
31
|
})(SnapshotState$3 || (SnapshotState$3 = {}));
|
|
32
32
|
|
|
33
|
-
const { create: create$a, entries: entries$4, freeze: freeze$5, keys: keys$b, values: values$
|
|
33
|
+
const { create: create$a, entries: entries$4, freeze: freeze$5, keys: keys$b, values: values$4 } = Object;
|
|
34
34
|
const { hasOwnProperty: hasOwnProperty$3 } = Object.prototype;
|
|
35
35
|
const { isArray: isArray$9 } = Array;
|
|
36
36
|
const { push: push$4, indexOf, slice: slice$2 } = Array.prototype;
|
|
@@ -3809,7 +3809,7 @@
|
|
|
3809
3809
|
}
|
|
3810
3810
|
callbacks.push(callback);
|
|
3811
3811
|
}
|
|
3812
|
-
// version: 1.147.
|
|
3812
|
+
// version: 1.147.3-6ff8ead8f
|
|
3813
3813
|
|
|
3814
3814
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
3815
3815
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -15233,7 +15233,7 @@
|
|
|
15233
15233
|
updateReferenceMapWithKnownKey(ast, luvioDocumentNode);
|
|
15234
15234
|
return luvioDocumentNode;
|
|
15235
15235
|
}
|
|
15236
|
-
// version: 1.147.
|
|
15236
|
+
// version: 1.147.3-6ff8ead8f
|
|
15237
15237
|
|
|
15238
15238
|
function unwrap(data) {
|
|
15239
15239
|
// The lwc-luvio bindings import a function from lwc called "unwrap".
|
|
@@ -16146,7 +16146,7 @@
|
|
|
16146
16146
|
const { apiFamily, name } = metadata;
|
|
16147
16147
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
16148
16148
|
}
|
|
16149
|
-
// version: 1.147.
|
|
16149
|
+
// version: 1.147.3-6ff8ead8f
|
|
16150
16150
|
|
|
16151
16151
|
/**
|
|
16152
16152
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -16796,7 +16796,7 @@
|
|
|
16796
16796
|
};
|
|
16797
16797
|
};
|
|
16798
16798
|
|
|
16799
|
-
const VERSION$1a$1 = "
|
|
16799
|
+
const VERSION$1a$1 = "a51de242c746e5500a833e84dfaa2170";
|
|
16800
16800
|
const select$1E = function ListScopeRepresentationSelect() {
|
|
16801
16801
|
const { selections: ListScopeEntityRepresentation__selections, opaque: ListScopeEntityRepresentation__opaque, } = select$1G();
|
|
16802
16802
|
const { selections: ListScopeRelatedEntityRepresentation__selections, opaque: ListScopeRelatedEntityRepresentation__opaque, } = select$1F();
|
|
@@ -16812,6 +16812,7 @@
|
|
|
16812
16812
|
{
|
|
16813
16813
|
name: 'entity',
|
|
16814
16814
|
kind: 'Object',
|
|
16815
|
+
nullable: true,
|
|
16815
16816
|
selections: ListScopeEntityRepresentation__selections
|
|
16816
16817
|
},
|
|
16817
16818
|
{
|
|
@@ -16821,6 +16822,7 @@
|
|
|
16821
16822
|
{
|
|
16822
16823
|
name: 'relatedEntity',
|
|
16823
16824
|
kind: 'Object',
|
|
16825
|
+
nullable: true,
|
|
16824
16826
|
selections: ListScopeRelatedEntityRepresentation__selections
|
|
16825
16827
|
}
|
|
16826
16828
|
]
|
|
@@ -44007,7 +44009,7 @@
|
|
|
44007
44009
|
dropFunction: instrumentation$2.notifyRecordUpdateAvailableDropped,
|
|
44008
44010
|
});
|
|
44009
44011
|
});
|
|
44010
|
-
// version: 1.147.
|
|
44012
|
+
// version: 1.147.3-7875ca9bf
|
|
44011
44013
|
|
|
44012
44014
|
var caseSensitiveUserId = '005B0000000GR4OIAW';
|
|
44013
44015
|
|
|
@@ -45853,7 +45855,7 @@
|
|
|
45853
45855
|
function errors(result) {
|
|
45854
45856
|
return result.error;
|
|
45855
45857
|
}
|
|
45856
|
-
function values$
|
|
45858
|
+
function values$3(result) {
|
|
45857
45859
|
return result.value;
|
|
45858
45860
|
}
|
|
45859
45861
|
function flattenResults(results) {
|
|
@@ -45861,7 +45863,7 @@
|
|
|
45861
45863
|
if (fails.length > 0) {
|
|
45862
45864
|
return failure(fails);
|
|
45863
45865
|
}
|
|
45864
|
-
return success(results.filter(isSuccess).map(values$
|
|
45866
|
+
return success(results.filter(isSuccess).map(values$3));
|
|
45865
45867
|
}
|
|
45866
45868
|
|
|
45867
45869
|
function getFieldInfo(apiName, fieldName, infoMap) {
|
|
@@ -46735,7 +46737,7 @@
|
|
|
46735
46737
|
if (failures.length > 0) {
|
|
46736
46738
|
return failure(failures);
|
|
46737
46739
|
}
|
|
46738
|
-
const containers = results.filter(isSuccess).map(values$
|
|
46740
|
+
const containers = results.filter(isSuccess).map(values$3);
|
|
46739
46741
|
const predicates = [];
|
|
46740
46742
|
containers.forEach((c) => {
|
|
46741
46743
|
if (c.predicate !== undefined) {
|
|
@@ -47027,7 +47029,7 @@
|
|
|
47027
47029
|
if (fails.length > 0) {
|
|
47028
47030
|
return failure(fails);
|
|
47029
47031
|
}
|
|
47030
|
-
const vals = results.filter(isSuccess).reduce(flatMap$1(values$
|
|
47032
|
+
const vals = results.filter(isSuccess).reduce(flatMap$1(values$3), []);
|
|
47031
47033
|
return success(vals);
|
|
47032
47034
|
}
|
|
47033
47035
|
function isFilterFunction(name) {
|
|
@@ -47037,7 +47039,7 @@
|
|
|
47037
47039
|
const results = Object.entries(operatorNode.fields)
|
|
47038
47040
|
.filter(([key, _]) => isFilterFunction(key) === false)
|
|
47039
47041
|
.map(([key, value]) => operatorWithValue(key, value, dataType));
|
|
47040
|
-
const _values = results.filter(isSuccess).map(values$
|
|
47042
|
+
const _values = results.filter(isSuccess).map(values$3);
|
|
47041
47043
|
const fails = results.filter(isFailure).reduce(flatMap$1(errors), []);
|
|
47042
47044
|
if (fails.length > 0) {
|
|
47043
47045
|
return failure(fails);
|
|
@@ -47958,7 +47960,7 @@
|
|
|
47958
47960
|
}
|
|
47959
47961
|
function recordFields(luvioSelections, names, parentApiName, parentAlias, input, joins) {
|
|
47960
47962
|
const results = luvioSelections.map((selection) => selectionToQueryField(selection, names, parentApiName, parentAlias, input, joins));
|
|
47961
|
-
const fields = results.filter(isSuccess).reduce(flatMap$1(values$
|
|
47963
|
+
const fields = results.filter(isSuccess).reduce(flatMap$1(values$3), []);
|
|
47962
47964
|
const fails = results.filter(isFailure).reduce(flatMap$1(errors), []);
|
|
47963
47965
|
if (fails.length > 0) {
|
|
47964
47966
|
return failure(fails);
|
|
@@ -48163,7 +48165,7 @@
|
|
|
48163
48165
|
}
|
|
48164
48166
|
function rootQuery(recordNodes, input) {
|
|
48165
48167
|
const results = recordNodes.map((record) => rootRecordQuery(record, input));
|
|
48166
|
-
const connections = results.filter(isSuccess).map(values$
|
|
48168
|
+
const connections = results.filter(isSuccess).map(values$3);
|
|
48167
48169
|
const fails = results.filter(isFailure).reduce(flatMap$1(errors), []);
|
|
48168
48170
|
if (fails.length > 0) {
|
|
48169
48171
|
return failure(fails);
|
|
@@ -48902,7 +48904,7 @@
|
|
|
48902
48904
|
return new DraftErrorFetchResponse(HttpStatusCode$1.BadRequest, error);
|
|
48903
48905
|
}
|
|
48904
48906
|
|
|
48905
|
-
const { keys: keys$4, create: create$4, assign: assign$3, values: values$
|
|
48907
|
+
const { keys: keys$4, create: create$4, assign: assign$3, values: values$2 } = Object;
|
|
48906
48908
|
const { stringify: stringify$4, parse: parse$4 } = JSON;
|
|
48907
48909
|
const { isArray: isArray$3 } = Array;
|
|
48908
48910
|
|
|
@@ -49277,7 +49279,7 @@
|
|
|
49277
49279
|
const queueOperations = handler.getQueueOperationsForCompletingDrafts(queue, action);
|
|
49278
49280
|
// write the queue operations to the store prior to ingesting the result
|
|
49279
49281
|
await this.draftStore.completeAction(queueOperations);
|
|
49280
|
-
await handler.handleActionCompleted(action, queueOperations, values$
|
|
49282
|
+
await handler.handleActionCompleted(action, queueOperations, values$2(this.handlers));
|
|
49281
49283
|
this.retryIntervalMilliseconds = 0;
|
|
49282
49284
|
this.uploadingActionId = undefined;
|
|
49283
49285
|
await this.notifyChangedListeners({
|
|
@@ -50600,7 +50602,7 @@
|
|
|
50600
50602
|
(x.length === 0 || (x.length > 0 && Object.prototype.hasOwnProperty.call(x, x.length - 1))));
|
|
50601
50603
|
}
|
|
50602
50604
|
|
|
50603
|
-
const { create: create$3, keys: keys$3, values, entries: entries$2 } = Object;
|
|
50605
|
+
const { create: create$3, keys: keys$3, values: values$1, entries: entries$2 } = Object;
|
|
50604
50606
|
const { stringify: stringify$3, parse: parse$3 } = JSON;
|
|
50605
50607
|
const { isArray: isArray$2 } = Array;
|
|
50606
50608
|
|
|
@@ -50933,7 +50935,7 @@
|
|
|
50933
50935
|
return predicate;
|
|
50934
50936
|
}
|
|
50935
50937
|
else if (literal !== undefined) {
|
|
50936
|
-
const isAvailableLiteral = values(DateLiteral).includes(literal);
|
|
50938
|
+
const isAvailableLiteral = values$1(DateLiteral).includes(literal);
|
|
50937
50939
|
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
50938
50940
|
if (!isAvailableLiteral)
|
|
50939
50941
|
throw new Error(`${literal} is not a valid DateLiteral`);
|
|
@@ -51595,7 +51597,7 @@
|
|
|
51595
51597
|
for (const join of joins) {
|
|
51596
51598
|
deduped[join.alias + join.to] = join;
|
|
51597
51599
|
}
|
|
51598
|
-
return values(deduped);
|
|
51600
|
+
return values$1(deduped);
|
|
51599
51601
|
}
|
|
51600
51602
|
function buildJoins(config) {
|
|
51601
51603
|
let sql = '';
|
|
@@ -52229,7 +52231,7 @@
|
|
|
52229
52231
|
return previous.concat(current);
|
|
52230
52232
|
}
|
|
52231
52233
|
function findFieldInfo(objectInfo, fieldName) {
|
|
52232
|
-
return values(objectInfo.fields).find((field) => field.apiName === fieldName ||
|
|
52234
|
+
return values$1(objectInfo.fields).find((field) => field.apiName === fieldName ||
|
|
52233
52235
|
(field.dataType === 'Reference' && field.relationshipName === fieldName));
|
|
52234
52236
|
}
|
|
52235
52237
|
|
|
@@ -52249,10 +52251,10 @@
|
|
|
52249
52251
|
for (let i = 0, len = keys$1.length; i < len; i++) {
|
|
52250
52252
|
const key = keys$1[i];
|
|
52251
52253
|
const parentFields = objectInfoMap[recordType].fields;
|
|
52252
|
-
const fieldInfo = values(parentFields).find(findSpanningField(key));
|
|
52254
|
+
const fieldInfo = values$1(parentFields).find(findSpanningField(key));
|
|
52253
52255
|
if (fieldInfo && fieldInfo.referenceToInfos.length > 0) {
|
|
52254
52256
|
const { apiName } = fieldInfo.referenceToInfos[0];
|
|
52255
|
-
const parentFieldInfo = values(objectInfoMap[recordType].fields).find(findSpanningField(fieldInfo.apiName));
|
|
52257
|
+
const parentFieldInfo = values$1(objectInfoMap[recordType].fields).find(findSpanningField(fieldInfo.apiName));
|
|
52256
52258
|
if (parentFieldInfo !== undefined) {
|
|
52257
52259
|
const path = {
|
|
52258
52260
|
leftPath: `$.fields.${parentFieldInfo.apiName}.value`,
|
|
@@ -52394,7 +52396,7 @@
|
|
|
52394
52396
|
let baseRecord = undefined;
|
|
52395
52397
|
// Concrete types for Polymorphic field
|
|
52396
52398
|
const polyTypes = [];
|
|
52397
|
-
for (const type of values(schema.getTypeMap())) {
|
|
52399
|
+
for (const type of values$1(schema.getTypeMap())) {
|
|
52398
52400
|
if (type.name === 'Record') {
|
|
52399
52401
|
recordInterface = type;
|
|
52400
52402
|
}
|
|
@@ -52407,7 +52409,7 @@
|
|
|
52407
52409
|
if (polyFields.find((fieldTypeName) => fieldTypeName === type.name) !== undefined) {
|
|
52408
52410
|
polyTypes.push(type);
|
|
52409
52411
|
}
|
|
52410
|
-
const fields = values(type.getFields());
|
|
52412
|
+
const fields = values$1(type.getFields());
|
|
52411
52413
|
// initialize the fields of current type with default behavior
|
|
52412
52414
|
for (const field of fields) {
|
|
52413
52415
|
field.resolve = defaultFieldResolver;
|
|
@@ -52724,7 +52726,7 @@
|
|
|
52724
52726
|
let recordConnections = ``;
|
|
52725
52727
|
const polymorphicFieldTypeNames = new Set();
|
|
52726
52728
|
let typedScalars = new Set();
|
|
52727
|
-
for (const objectInfo of values(objectInfos)) {
|
|
52729
|
+
for (const objectInfo of values$1(objectInfos)) {
|
|
52728
52730
|
const { apiName, childRelationships } = objectInfo;
|
|
52729
52731
|
let fields = ``;
|
|
52730
52732
|
typedScalars.add(`${apiName}_Filter`);
|
|
@@ -52740,7 +52742,7 @@
|
|
|
52740
52742
|
typedScalars.add(`${childObjectApiName}_OrderBy`);
|
|
52741
52743
|
}
|
|
52742
52744
|
}
|
|
52743
|
-
for (const field of values(objectInfo.fields)) {
|
|
52745
|
+
for (const field of values$1(objectInfo.fields)) {
|
|
52744
52746
|
if (!fieldsStaticallyAdded.includes(field.apiName)) {
|
|
52745
52747
|
fields += `${field.apiName}: ${dataTypeToType(field.dataType, field.apiName)}\n`;
|
|
52746
52748
|
}
|
|
@@ -53243,7 +53245,7 @@
|
|
|
53243
53245
|
const objectInfo = objectInfos[apiName[0]];
|
|
53244
53246
|
if (!objectInfo)
|
|
53245
53247
|
return false;
|
|
53246
|
-
return values(objectInfo.fields).some((fieldInfo) => {
|
|
53248
|
+
return values$1(objectInfo.fields).some((fieldInfo) => {
|
|
53247
53249
|
return (fieldInfo.apiName === 'OwnerId' &&
|
|
53248
53250
|
fieldInfo.referenceToInfos.some((referenceToInfo) => {
|
|
53249
53251
|
return referenceToInfo.apiName === 'User';
|
|
@@ -54494,7 +54496,7 @@
|
|
|
54494
54496
|
* For full license text, see the LICENSE.txt file
|
|
54495
54497
|
*/
|
|
54496
54498
|
|
|
54497
|
-
const { keys: keys$2$1, create: create$2$1, assign: assign$2, freeze: freeze$2 } = Object;
|
|
54499
|
+
const { keys: keys$2$1, values, create: create$2$1, assign: assign$2, freeze: freeze$2 } = Object;
|
|
54498
54500
|
const { stringify: stringify$2, parse: parse$2 } = JSON;
|
|
54499
54501
|
const { shift } = Array.prototype;
|
|
54500
54502
|
const { isArray: isArray$1$1 } = Array;
|
|
@@ -55225,15 +55227,15 @@
|
|
|
55225
55227
|
const LDS_ACTION_HANDLER_ID = 'LDS_ACTION_HANDLER';
|
|
55226
55228
|
const LDS_ACTION_METADATA_API_NAME = 'LDS_ACTION_METADATA_API_NAME';
|
|
55227
55229
|
class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
55228
|
-
constructor(getLuvio, networkAdapter, durableStore, draftQueue, getRecordAdapter,
|
|
55230
|
+
constructor(getLuvio, networkAdapter, durableStore, draftQueue, getRecordAdapter, objectInfoService, isDraftId, recordService) {
|
|
55229
55231
|
super(draftQueue, networkAdapter, getLuvio);
|
|
55230
55232
|
this.getLuvio = getLuvio;
|
|
55231
55233
|
this.networkAdapter = networkAdapter;
|
|
55232
55234
|
this.durableStore = durableStore;
|
|
55233
55235
|
this.draftQueue = draftQueue;
|
|
55234
55236
|
this.getRecordAdapter = getRecordAdapter;
|
|
55237
|
+
this.objectInfoService = objectInfoService;
|
|
55235
55238
|
this.isDraftId = isDraftId;
|
|
55236
|
-
this.apiNameForPrefix = apiNameForPrefix;
|
|
55237
55239
|
this.recordService = recordService;
|
|
55238
55240
|
this.handlerId = LDS_ACTION_HANDLER_ID;
|
|
55239
55241
|
this.collectedFields = create$2$1(null);
|
|
@@ -55280,8 +55282,55 @@
|
|
|
55280
55282
|
throw Error('unknown draft precondition failed');
|
|
55281
55283
|
}
|
|
55282
55284
|
}
|
|
55285
|
+
else if (metaDataResult.status === 'missing-referenced-records') {
|
|
55286
|
+
const referenceFields = metaDataResult.missingRecordReferences;
|
|
55287
|
+
if (referenceFields !== undefined) {
|
|
55288
|
+
//fetches the reference record async
|
|
55289
|
+
this.fetchReferenceRecord(referenceFields);
|
|
55290
|
+
}
|
|
55291
|
+
}
|
|
55283
55292
|
return pendingAction;
|
|
55284
55293
|
}
|
|
55294
|
+
async fetchReferenceRecord(referenceFields) {
|
|
55295
|
+
const promises = referenceFields.map(async (referenceFieldInfo) => {
|
|
55296
|
+
const apiName = await this.identifyApiName(referenceFieldInfo.id, referenceFieldInfo.field);
|
|
55297
|
+
if (apiName === undefined) {
|
|
55298
|
+
return;
|
|
55299
|
+
}
|
|
55300
|
+
const objectInfoMap = await this.objectInfoService.getObjectInfos([
|
|
55301
|
+
apiName,
|
|
55302
|
+
]);
|
|
55303
|
+
if (objectInfoMap[apiName] === undefined) {
|
|
55304
|
+
return;
|
|
55305
|
+
}
|
|
55306
|
+
const objectInfo = objectInfoMap[apiName];
|
|
55307
|
+
const optionalFields = values(objectInfo.fields).map((field) => `${apiName}.${field.apiName}`);
|
|
55308
|
+
await getAdapterData(this.getRecordAdapter, {
|
|
55309
|
+
recordId: referenceFieldInfo.id,
|
|
55310
|
+
optionalFields,
|
|
55311
|
+
});
|
|
55312
|
+
});
|
|
55313
|
+
await Promise.all(promises);
|
|
55314
|
+
}
|
|
55315
|
+
/**
|
|
55316
|
+
* identify the API Name from the record ID and its field representation. For example, ApiName for `001x0000004cKfzAAE` is `Account` if its field info reference to `Account`
|
|
55317
|
+
* representation
|
|
55318
|
+
* @param id
|
|
55319
|
+
* @param fieldInfo
|
|
55320
|
+
* @returns apiName
|
|
55321
|
+
*/
|
|
55322
|
+
async identifyApiName(id, fieldInfo) {
|
|
55323
|
+
const referenceToInfos = fieldInfo.referenceToInfos;
|
|
55324
|
+
const apiNames = referenceToInfos.map((referenceToInfo) => referenceToInfo.apiName);
|
|
55325
|
+
const objectInfoMap = await this.objectInfoService.getObjectInfos(apiNames);
|
|
55326
|
+
for (const objectInfo of values(objectInfoMap)) {
|
|
55327
|
+
const { apiName, keyPrefix } = objectInfo;
|
|
55328
|
+
if (keyPrefix !== null && id.startsWith(keyPrefix)) {
|
|
55329
|
+
return apiName;
|
|
55330
|
+
}
|
|
55331
|
+
}
|
|
55332
|
+
return undefined;
|
|
55333
|
+
}
|
|
55285
55334
|
canRepresentationContainDraftMetadata(representationName) {
|
|
55286
55335
|
return representationName === RECORD_REPRESENTATION_NAME$1;
|
|
55287
55336
|
}
|
|
@@ -55459,7 +55508,7 @@
|
|
|
55459
55508
|
// as a last resort we'll do a lookup for cached object infos by prefix
|
|
55460
55509
|
// note this will throw if the object info hasn't been previously cached
|
|
55461
55510
|
const prefix = recordId.substring(0, 3);
|
|
55462
|
-
return this.apiNameForPrefix(prefix);
|
|
55511
|
+
return this.objectInfoService.apiNameForPrefix(prefix);
|
|
55463
55512
|
}
|
|
55464
55513
|
/**
|
|
55465
55514
|
* Inspects the resource request to ensure this handler can handle it
|
|
@@ -55901,7 +55950,7 @@
|
|
|
55901
55950
|
}
|
|
55902
55951
|
const objectInfoMap = new Map();
|
|
55903
55952
|
const referenceMap = new Map();
|
|
55904
|
-
const
|
|
55953
|
+
const referenceFields = [];
|
|
55905
55954
|
const metadata = {
|
|
55906
55955
|
luvio: this.getLuvio(),
|
|
55907
55956
|
userId: this.userId,
|
|
@@ -55942,13 +55991,17 @@
|
|
|
55942
55991
|
continue;
|
|
55943
55992
|
}
|
|
55944
55993
|
const key = getRecordKeyForId(this.getLuvio(), id);
|
|
55945
|
-
if (referenceMap.has(key) === false &&
|
|
55994
|
+
if (referenceMap.has(key) === false &&
|
|
55995
|
+
!referenceFields.some((refInfo) => refInfo.id === id)) {
|
|
55946
55996
|
const record = await this.durableStore.getDenormalizedRecord(key);
|
|
55947
55997
|
if (record !== undefined) {
|
|
55948
55998
|
referenceMap.set(key, record);
|
|
55949
55999
|
}
|
|
55950
56000
|
else {
|
|
55951
|
-
|
|
56001
|
+
referenceFields.push({
|
|
56002
|
+
id,
|
|
56003
|
+
field: fieldInfo,
|
|
56004
|
+
});
|
|
55952
56005
|
}
|
|
55953
56006
|
}
|
|
55954
56007
|
}
|
|
@@ -55961,12 +56014,12 @@
|
|
|
55961
56014
|
};
|
|
55962
56015
|
}
|
|
55963
56016
|
}
|
|
55964
|
-
if (
|
|
56017
|
+
if (referenceFields.length > 0) {
|
|
55965
56018
|
return {
|
|
55966
56019
|
ok: true,
|
|
55967
56020
|
data: metadata,
|
|
55968
56021
|
status: 'missing-referenced-records',
|
|
55969
|
-
|
|
56022
|
+
missingRecordReferences: referenceFields,
|
|
55970
56023
|
};
|
|
55971
56024
|
}
|
|
55972
56025
|
return {
|
|
@@ -59488,7 +59541,7 @@
|
|
|
59488
59541
|
// draft queue
|
|
59489
59542
|
lazyDraftQueue = buildLdsDraftQueue(recordDenormingStore);
|
|
59490
59543
|
const draftService = new UiApiDraftRecordService(lazyDraftQueue, () => lazyLuvio, recordDenormingStore, getObjectInfo, newRecordId, userId, formatDisplayValue);
|
|
59491
|
-
const uiApiRecordHandler = new UiApiActionHandler(() => lazyLuvio, lazyNetworkAdapter, recordDenormingStore, lazyDraftQueue, getRecord,
|
|
59544
|
+
const uiApiRecordHandler = new UiApiActionHandler(() => lazyLuvio, lazyNetworkAdapter, recordDenormingStore, lazyDraftQueue, getRecord, lazyObjectInfoService, isGenerated, draftService);
|
|
59492
59545
|
const quickActionHandler = new QuickActionExecutionRepresentationHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated);
|
|
59493
59546
|
const contentDocumentCompositeActionHandler = new ContentDocumentCompositeRepresentationActionHandler(() => lazyLuvio, draftService, lazyDraftQueue, lazyNetworkAdapter, isGenerated, recordDenormingStore, NimbusBinaryStore);
|
|
59494
59547
|
lazyDraftQueue.addHandler(uiApiRecordHandler);
|
|
@@ -59578,7 +59631,7 @@
|
|
|
59578
59631
|
id: '@salesforce/lds-network-adapter',
|
|
59579
59632
|
instrument: instrument$1,
|
|
59580
59633
|
});
|
|
59581
|
-
// version: 1.147.
|
|
59634
|
+
// version: 1.147.3-6ff8ead8f
|
|
59582
59635
|
|
|
59583
59636
|
const { create: create$2, keys: keys$2 } = Object;
|
|
59584
59637
|
const { stringify: stringify$1, parse: parse$1 } = JSON;
|
|
@@ -80423,7 +80476,7 @@
|
|
|
80423
80476
|
configuration: { ...configurationForGraphQLAdapters },
|
|
80424
80477
|
instrument,
|
|
80425
80478
|
});
|
|
80426
|
-
// version: 1.147.
|
|
80479
|
+
// version: 1.147.3-7875ca9bf
|
|
80427
80480
|
|
|
80428
80481
|
// On core the unstable adapters are re-exported with different names,
|
|
80429
80482
|
|
|
@@ -82661,7 +82714,7 @@
|
|
|
82661
82714
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
82662
82715
|
graphQLImperative = ldsAdapter;
|
|
82663
82716
|
});
|
|
82664
|
-
// version: 1.147.
|
|
82717
|
+
// version: 1.147.3-7875ca9bf
|
|
82665
82718
|
|
|
82666
82719
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
82667
82720
|
__proto__: null,
|
|
@@ -83367,4 +83420,4 @@
|
|
|
83367
83420
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
83368
83421
|
|
|
83369
83422
|
}));
|
|
83370
|
-
// version: 1.147.
|
|
83423
|
+
// version: 1.147.3-6ff8ead8f
|