@salesforce/lds-worker-api 1.282.0 → 1.284.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sfdc/es/ldsWorkerApi.js +84 -58
- package/dist/sfdc/es/types/executeAdapter.d.ts +16 -6
- package/dist/sfdc/es/types/main.d.ts +2 -2
- package/dist/standalone/es/lds-worker-api.js +367 -131
- package/dist/standalone/es/types/executeAdapter.d.ts +16 -6
- package/dist/standalone/es/types/main.d.ts +2 -2
- package/dist/standalone/umd/lds-worker-api.js +367 -130
- package/dist/standalone/umd/types/executeAdapter.d.ts +16 -6
- package/dist/standalone/umd/types/main.d.ts +2 -2
- package/package.json +13 -13
|
@@ -4177,7 +4177,7 @@ function withDefaultLuvio(callback) {
|
|
|
4177
4177
|
}
|
|
4178
4178
|
callbacks.push(callback);
|
|
4179
4179
|
}
|
|
4180
|
-
// version: 1.
|
|
4180
|
+
// version: 1.284.0-a7e8dc51c
|
|
4181
4181
|
|
|
4182
4182
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
4183
4183
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -15685,7 +15685,7 @@ function gql(literals, ...subs) {
|
|
|
15685
15685
|
}
|
|
15686
15686
|
return superResult;
|
|
15687
15687
|
}
|
|
15688
|
-
// version: 1.
|
|
15688
|
+
// version: 1.284.0-a7e8dc51c
|
|
15689
15689
|
|
|
15690
15690
|
function unwrap(data) {
|
|
15691
15691
|
// The lwc-luvio bindings import a function from lwc called "unwrap".
|
|
@@ -16610,7 +16610,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
|
|
|
16610
16610
|
const { apiFamily, name } = metadata;
|
|
16611
16611
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
16612
16612
|
}
|
|
16613
|
-
// version: 1.
|
|
16613
|
+
// version: 1.284.0-a7e8dc51c
|
|
16614
16614
|
|
|
16615
16615
|
/**
|
|
16616
16616
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -16823,6 +16823,41 @@ let trackedFieldDepthOnNotifyChange$2 = 5;
|
|
|
16823
16823
|
* @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
|
|
16824
16824
|
*/
|
|
16825
16825
|
let trackedFieldLeafNodeIdAndNameOnly$2 = false;
|
|
16826
|
+
/**
|
|
16827
|
+
* One store enabled Get Object Info adapter
|
|
16828
|
+
*/
|
|
16829
|
+
let oneStoreGetObjectInfoAdapter$2 = undefined;
|
|
16830
|
+
/**
|
|
16831
|
+
* One store enabled Get Object Infos adapter
|
|
16832
|
+
*/
|
|
16833
|
+
let oneStoreGetObjectInfosAdapter$2 = undefined;
|
|
16834
|
+
/**
|
|
16835
|
+
* Defines the configuration API and is exposed internally as well as externally.
|
|
16836
|
+
* Configuration for one store enabled REST adapters only.
|
|
16837
|
+
*/
|
|
16838
|
+
const configurationForOneStoreEnabledAdapters$2 = {
|
|
16839
|
+
setGetObjectInfoAdapter: function (adapter) {
|
|
16840
|
+
oneStoreGetObjectInfoAdapter$2 = adapter;
|
|
16841
|
+
},
|
|
16842
|
+
getGetObjectInfoAdapter: function () {
|
|
16843
|
+
return oneStoreGetObjectInfoAdapter$2;
|
|
16844
|
+
},
|
|
16845
|
+
setGetObjectInfosAdapter: function (adapter) {
|
|
16846
|
+
oneStoreGetObjectInfosAdapter$2 = adapter;
|
|
16847
|
+
},
|
|
16848
|
+
getGetObjectInfosAdapter: function () {
|
|
16849
|
+
return oneStoreGetObjectInfosAdapter$2;
|
|
16850
|
+
},
|
|
16851
|
+
};
|
|
16852
|
+
/**
|
|
16853
|
+
* Helper function to return the one store adapter if it's defined, otherwise return the luvio adapter.
|
|
16854
|
+
* @param luvioAdapter - The luvio bound adapter.
|
|
16855
|
+
* @param oneStoreAdapter - The one store bound adapter.
|
|
16856
|
+
* @returns Luvio or one store wire adapter constructor.
|
|
16857
|
+
*/
|
|
16858
|
+
function getLuvioOrOneStoreAdapter(luvioAdapter, oneStoreAdapter) {
|
|
16859
|
+
return oneStoreAdapter !== null && oneStoreAdapter !== void 0 ? oneStoreAdapter : luvioAdapter;
|
|
16860
|
+
}
|
|
16826
16861
|
/**
|
|
16827
16862
|
* Defines the configuration API and is exposed internally as well as externally.
|
|
16828
16863
|
* Configuration for REST adapters only.
|
|
@@ -16887,6 +16922,7 @@ const configurationForRestAdapters$2 = {
|
|
|
16887
16922
|
getDraftAwareCreateContentVersionAdapter: function () {
|
|
16888
16923
|
return draftAwareCreateContentVersionAdapter$2;
|
|
16889
16924
|
},
|
|
16925
|
+
...configurationForOneStoreEnabledAdapters$2,
|
|
16890
16926
|
};
|
|
16891
16927
|
/**
|
|
16892
16928
|
* Defines the configuration API and is exposed internally as well as externally.
|
|
@@ -17243,15 +17279,17 @@ function splitQualifiedFieldApiName(fieldApiName) {
|
|
|
17243
17279
|
/**
|
|
17244
17280
|
* Returns the field API name, qualified with an object name if possible.
|
|
17245
17281
|
* @param value The value from which to get the qualified field API name.
|
|
17282
|
+
* @param onlyQualifiedFieldNames - Whether or not this function should skip fieldApiName that do not include the delimiter '.'
|
|
17246
17283
|
* @return The qualified field API name.
|
|
17247
17284
|
*/
|
|
17248
|
-
function getFieldApiName$2(value) {
|
|
17285
|
+
function getFieldApiName$2(value, onlyQualifiedFieldNames = false) {
|
|
17249
17286
|
// Note: tightening validation logic changes behavior from userland getting
|
|
17250
17287
|
// a server-provided error to the adapter noop'ing. In 224 we decided to not
|
|
17251
|
-
// change the behavior.
|
|
17288
|
+
// change the behavior. In 250 we decided to add the 'onlyQualifiedFieldName' flag to tighten the logic
|
|
17289
|
+
// optionally to avoid issues with persisted invalid field names.
|
|
17252
17290
|
if (isString$2(value)) {
|
|
17253
17291
|
const trimmed = value.trim();
|
|
17254
|
-
if (trimmed.length > 0) {
|
|
17292
|
+
if (trimmed.length > 0 && (onlyQualifiedFieldNames ? trimmed.indexOf('.') > -1 : true)) {
|
|
17255
17293
|
return trimmed;
|
|
17256
17294
|
}
|
|
17257
17295
|
}
|
|
@@ -17264,15 +17302,19 @@ function getFieldApiName$2(value) {
|
|
|
17264
17302
|
/**
|
|
17265
17303
|
* Returns the field API name.
|
|
17266
17304
|
* @param value The value from which to get the field API name.
|
|
17305
|
+
* @param options Option bag. onlyQualifiedFieldNames is a boolean that allows this function to skip returning invalid FieldApiNames.
|
|
17267
17306
|
* @returns The field API name.
|
|
17268
17307
|
*/
|
|
17269
|
-
function getFieldApiNamesArray$2(value) {
|
|
17308
|
+
function getFieldApiNamesArray$2(value, options = { onlyQualifiedFieldNames: false }) {
|
|
17270
17309
|
const valueArray = isArray$7(value) ? value : [value];
|
|
17271
17310
|
const array = [];
|
|
17272
17311
|
for (let i = 0, len = valueArray.length; i < len; i += 1) {
|
|
17273
17312
|
const item = valueArray[i];
|
|
17274
|
-
const apiName = getFieldApiName$2(item);
|
|
17313
|
+
const apiName = getFieldApiName$2(item, options.onlyQualifiedFieldNames);
|
|
17275
17314
|
if (apiName === undefined) {
|
|
17315
|
+
if (options.onlyQualifiedFieldNames) {
|
|
17316
|
+
continue; // Just skips invalid field names rather than failing to return an array at all
|
|
17317
|
+
}
|
|
17276
17318
|
return undefined;
|
|
17277
17319
|
}
|
|
17278
17320
|
push$4.call(array, apiName);
|
|
@@ -21639,17 +21681,16 @@ function tokenForAtMost$1(paginationMetadata, maxOffset) {
|
|
|
21639
21681
|
}
|
|
21640
21682
|
|
|
21641
21683
|
const TTL$x = 30000;
|
|
21642
|
-
const VERSION$18$1 = "
|
|
21684
|
+
const VERSION$18$1 = "e5c90c4081cd557f8ffec53028ede1e8";
|
|
21643
21685
|
const RepresentationType$T = 'ListRecordCollectionRepresentation';
|
|
21644
21686
|
function keyBuilder$23(luvio, config) {
|
|
21645
|
-
return keyPrefix$2 + '::' + RepresentationType$T + ':' + config.objectApiName + ':' + (config.searchTerm === null ? '' : config.searchTerm) + ':' + (config.sortBy === null ? '' : '[' + config.sortBy.join(',') + ']') + ':' + (config.
|
|
21687
|
+
return keyPrefix$2 + '::' + RepresentationType$T + ':' + config.objectApiName + ':' + (config.searchTerm === null ? '' : config.searchTerm) + ':' + (config.sortBy === null ? '' : '[' + config.sortBy.join(',') + ']') + ':' + (config.where === null ? '' : config.where) + ':' + (config.listViewApiName === null ? '' : config.listViewApiName);
|
|
21646
21688
|
}
|
|
21647
21689
|
function keyBuilderFromType$B(luvio, object) {
|
|
21648
21690
|
const keyParams = {
|
|
21649
21691
|
objectApiName: object.listReference.objectApiName,
|
|
21650
21692
|
searchTerm: object.searchTerm,
|
|
21651
21693
|
sortBy: object.sortBy,
|
|
21652
|
-
listViewId: object.listInfoETag,
|
|
21653
21694
|
where: object.where,
|
|
21654
21695
|
listViewApiName: object.listReference.listViewApiName
|
|
21655
21696
|
};
|
|
@@ -22710,7 +22751,7 @@ function splitListRecordCollectionKey(key) {
|
|
|
22710
22751
|
const keyElements = key.split(':');
|
|
22711
22752
|
return {
|
|
22712
22753
|
objectApiName: keyElements[3],
|
|
22713
|
-
listViewApiName: keyElements[
|
|
22754
|
+
listViewApiName: keyElements[7],
|
|
22714
22755
|
};
|
|
22715
22756
|
}
|
|
22716
22757
|
function splitListSummaryCollectionKey(key) {
|
|
@@ -23008,7 +23049,8 @@ function keyBuilder$1$(luvio, params) {
|
|
|
23008
23049
|
return keyBuilder$23(luvio, {
|
|
23009
23050
|
objectApiName: listReference.objectApiName,
|
|
23010
23051
|
listViewApiName: listReference.listViewApiName,
|
|
23011
|
-
listViewId
|
|
23052
|
+
// # removing listViewId from key only supporing getting records using api name
|
|
23053
|
+
// listViewId: listReference.id,
|
|
23012
23054
|
searchTerm: params.body.searchTerm || null,
|
|
23013
23055
|
where: params.body.where || null,
|
|
23014
23056
|
sortBy: params.body.sortBy !== undefined && params.body.sortBy.length <= 0
|
|
@@ -23021,7 +23063,8 @@ function keyBuilder$1$(luvio, params) {
|
|
|
23021
23063
|
return keyBuilder$23(luvio, {
|
|
23022
23064
|
objectApiName: params.urlParams.objectApiName,
|
|
23023
23065
|
listViewApiName: params.urlParams.listViewApiName,
|
|
23024
|
-
listViewId
|
|
23066
|
+
// # removing listViewId from key only supporing getting records using api name
|
|
23067
|
+
// listViewId: '',
|
|
23025
23068
|
searchTerm: params.body.searchTerm || null,
|
|
23026
23069
|
where: params.body.where || null,
|
|
23027
23070
|
sortBy: params.body.sortBy || [],
|
|
@@ -32193,7 +32236,7 @@ function equals$y(existing, incoming) {
|
|
|
32193
32236
|
}
|
|
32194
32237
|
|
|
32195
32238
|
const TTL$k = 900000;
|
|
32196
|
-
const VERSION$D$1 = "
|
|
32239
|
+
const VERSION$D$1 = "2405a0b25c2c00f82e88b600edc16387";
|
|
32197
32240
|
const RepresentationType$u = 'ListObjectInfoRepresentation';
|
|
32198
32241
|
function keyBuilder$15$1(luvio, config) {
|
|
32199
32242
|
return keyPrefix$2 + '::' + RepresentationType$u + ':' + config.objectApiName;
|
|
@@ -32235,6 +32278,10 @@ const select$Z$1 = function ListObjectInfoRepresentationSelect() {
|
|
|
32235
32278
|
name: 'objectApiName',
|
|
32236
32279
|
kind: 'Scalar'
|
|
32237
32280
|
},
|
|
32281
|
+
{
|
|
32282
|
+
name: 'publicOrSharedCreateable',
|
|
32283
|
+
kind: 'Scalar'
|
|
32284
|
+
},
|
|
32238
32285
|
{
|
|
32239
32286
|
name: 'relatedEntityApiName',
|
|
32240
32287
|
kind: 'Scalar'
|
|
@@ -32248,6 +32295,11 @@ function equals$x(existing, incoming) {
|
|
|
32248
32295
|
if (!(existing_createable === incoming_createable)) {
|
|
32249
32296
|
return false;
|
|
32250
32297
|
}
|
|
32298
|
+
const existing_publicOrSharedCreateable = existing.publicOrSharedCreateable;
|
|
32299
|
+
const incoming_publicOrSharedCreateable = incoming.publicOrSharedCreateable;
|
|
32300
|
+
if (!(existing_publicOrSharedCreateable === incoming_publicOrSharedCreateable)) {
|
|
32301
|
+
return false;
|
|
32302
|
+
}
|
|
32251
32303
|
const existing_objectApiName = existing.objectApiName;
|
|
32252
32304
|
const incoming_objectApiName = incoming.objectApiName;
|
|
32253
32305
|
if (!(existing_objectApiName === incoming_objectApiName)) {
|
|
@@ -40849,6 +40901,7 @@ function onFetchResponseSuccess$1$1(luvio, config, resourceParams, response) {
|
|
|
40849
40901
|
// Note: The original listReference will remain unchanged in the response.
|
|
40850
40902
|
mutatedListRef.id = body.listInfoETag;
|
|
40851
40903
|
addListReferenceWithId(mutatedListRef, context, body.listReference.id);
|
|
40904
|
+
// storing sortBy ensuring a cache hit when requesting records with no sortBy provided
|
|
40852
40905
|
addServerDefaults(config, body, originalListRef, context);
|
|
40853
40906
|
}
|
|
40854
40907
|
return onFetchResponseSuccess$2$1(luvio, config, resourceParams, response);
|
|
@@ -43563,7 +43616,11 @@ function createDispatchResourceRequestContext(requestContext) {
|
|
|
43563
43616
|
}
|
|
43564
43617
|
ensureRegisteredOnce$2({
|
|
43565
43618
|
id: '@salesforce/lds-adapters-uiapi',
|
|
43566
|
-
configuration: {
|
|
43619
|
+
configuration: {
|
|
43620
|
+
...configurationForRestAdapters$2,
|
|
43621
|
+
...configurationForGraphQLAdapters$2,
|
|
43622
|
+
...configurationForOneStoreEnabledAdapters$2,
|
|
43623
|
+
},
|
|
43567
43624
|
instrument: instrument$3,
|
|
43568
43625
|
});
|
|
43569
43626
|
|
|
@@ -43824,15 +43881,13 @@ function bindExportsTo$1(luvio) {
|
|
|
43824
43881
|
getListInfosByObjectName: createWireAdapterConstructor(luvio, getListInfosByObjectName_ldsAdapter, getListInfosByObjectNameMetadata),
|
|
43825
43882
|
getListObjectInfo: createWireAdapterConstructor(luvio, getListObjectInfo_ldsAdapter, getListObjectInfoMetadata),
|
|
43826
43883
|
getListPreferences: createWireAdapterConstructor(luvio, getListPreferences_ldsAdapter, getListPreferencesMetadata),
|
|
43827
|
-
getListRecordsByName:
|
|
43884
|
+
getListRecordsByName: createInfiniteScrollingWireAdapterConstructor(luvio, getListRecordsByName_ldsAdapter, getListRecordsByNameMetadata),
|
|
43828
43885
|
getListUi: createInfiniteScrollingWireAdapterConstructor(luvio, getListUi_ldsAdapter, getListUiMetadata),
|
|
43829
43886
|
getLookupActions: createWireAdapterConstructor(luvio, getLookupActions_ldsAdapter, getLookupActionsMetadata),
|
|
43830
43887
|
getLookupMetadata: createWireAdapterConstructor(luvio, getLookupMetadata_ldsAdapter, getLookupMetadataMetadata),
|
|
43831
43888
|
getLookupRecords: createWireAdapterConstructor(luvio, getLookupRecords_ldsAdapter, getLookupRecordsMetadata),
|
|
43832
43889
|
getNavItems: createWireAdapterConstructor(luvio, getNavItems_ldsAdapter, getNavItemsMetadata),
|
|
43833
43890
|
getObjectCreateActions: createWireAdapterConstructor(luvio, getObjectCreateActions_ldsAdapter, getObjectCreateActionsMetadata),
|
|
43834
|
-
getObjectInfo: createWireAdapterConstructor(luvio, getObjectInfo_ldsAdapter, getObjectInfoMetadata),
|
|
43835
|
-
getObjectInfos: createWireAdapterConstructor(luvio, getObjectInfos_ldsAdapter, getObjectInfosMetadata),
|
|
43836
43891
|
getPathLayout: createWireAdapterConstructor(luvio, getPathLayout_ldsAdapter, getPathLayoutMetadata),
|
|
43837
43892
|
getPicklistValues: createWireAdapterConstructor(luvio, getPicklistValues_ldsAdapter, getPicklistValuesMetadata),
|
|
43838
43893
|
getPicklistValuesByRecordType: createWireAdapterConstructor(luvio, getPicklistValuesByRecordType_ldsAdapter, getPicklistValuesByRecordTypeMetadata),
|
|
@@ -43868,6 +43923,9 @@ function bindExportsTo$1(luvio) {
|
|
|
43868
43923
|
updateListPreferences: createLDSAdapter(luvio, adapterName$z, updateListPreferencesAdapterFactory),
|
|
43869
43924
|
updateRecord: unwrapSnapshotData(factory$2),
|
|
43870
43925
|
updateRecordAvatar: unwrapSnapshotData(factory$8),
|
|
43926
|
+
// One Store Enabled Adapters
|
|
43927
|
+
getObjectInfo: getLuvioOrOneStoreAdapter(createWireAdapterConstructor(luvio, getObjectInfo_ldsAdapter, getObjectInfoMetadata), configurationForOneStoreEnabledAdapters$2.getGetObjectInfoAdapter()),
|
|
43928
|
+
getObjectInfos: getLuvioOrOneStoreAdapter(createWireAdapterConstructor(luvio, getObjectInfos_ldsAdapter, getObjectInfosMetadata), configurationForOneStoreEnabledAdapters$2.getGetObjectInfosAdapter()),
|
|
43871
43929
|
// Imperative Adapters
|
|
43872
43930
|
unstable_getActionOverrides_imperative: createImperativeAdapter(luvio, getActionOverrides_ldsAdapter, getActionOverridesMetadata),
|
|
43873
43931
|
getAllApps_imperative: createImperativeAdapter(luvio, getAllApps_ldsAdapter, getAllAppsMetadata),
|
|
@@ -44093,7 +44151,7 @@ withDefaultLuvio((luvio) => {
|
|
|
44093
44151
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
44094
44152
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
44095
44153
|
});
|
|
44096
|
-
// version: 1.
|
|
44154
|
+
// version: 1.284.0-8b78b708e
|
|
44097
44155
|
|
|
44098
44156
|
var ldsIdempotencyWriteDisabled = {
|
|
44099
44157
|
isOpen: function (e) {
|
|
@@ -49727,6 +49785,10 @@ class DurableDraftQueue {
|
|
|
49727
49785
|
switch (result) {
|
|
49728
49786
|
case ProcessActionResult.BLOCKED_ON_ERROR:
|
|
49729
49787
|
this.state = DraftQueueState.Error;
|
|
49788
|
+
await this.notifyChangedListeners({
|
|
49789
|
+
type: DraftQueueEventType.QueueStateChanged,
|
|
49790
|
+
state: this.state,
|
|
49791
|
+
});
|
|
49730
49792
|
return Promise.reject();
|
|
49731
49793
|
default:
|
|
49732
49794
|
return Promise.resolve();
|
|
@@ -52244,6 +52306,9 @@ function createSinglePredicate(val, operator, field, alias) {
|
|
|
52244
52306
|
else if (field.apiName === 'weakEtag') {
|
|
52245
52307
|
leftPath = '$.weakEtag';
|
|
52246
52308
|
}
|
|
52309
|
+
else if (field.apiName === 'RecordTypeId') {
|
|
52310
|
+
leftPath = '$.recordTypeId';
|
|
52311
|
+
}
|
|
52247
52312
|
return {
|
|
52248
52313
|
alias,
|
|
52249
52314
|
leftPath,
|
|
@@ -55517,7 +55582,7 @@ function injectParentRelationships(selections, parentNode, parentPath, ancestors
|
|
|
55517
55582
|
* @param objectInfos
|
|
55518
55583
|
* @returns
|
|
55519
55584
|
*/
|
|
55520
|
-
function injectFieldsForDisplayValue(topNode,
|
|
55585
|
+
function injectFieldsForDisplayValue(topNode, apiName, objectInfos) {
|
|
55521
55586
|
const { selectionSet } = topNode;
|
|
55522
55587
|
if (selectionSet === undefined)
|
|
55523
55588
|
return [];
|
|
@@ -55531,13 +55596,8 @@ function injectFieldsForDisplayValue(topNode, parentNode, objectInfos) {
|
|
|
55531
55596
|
displayValue = node;
|
|
55532
55597
|
break;
|
|
55533
55598
|
}
|
|
55534
|
-
if (isInlineFragmentNode(node)) {
|
|
55535
|
-
const name = node.typeCondition !== undefined ? node.typeCondition.name : parentNode.name;
|
|
55536
|
-
displayValueNameFields = injectFieldsForDisplayValue(node, { ...parentNode, name }, objectInfos);
|
|
55537
|
-
}
|
|
55538
55599
|
}
|
|
55539
55600
|
if (displayValue !== undefined) {
|
|
55540
|
-
const apiName = parentNode.name.value;
|
|
55541
55601
|
const objectInfo = objectInfos[apiName];
|
|
55542
55602
|
if (objectInfo !== undefined &&
|
|
55543
55603
|
objectInfo.nameFields !== undefined &&
|
|
@@ -55604,19 +55664,24 @@ function injectFields(selections, parentNode, parentPath, ancestors, objectInfos
|
|
|
55604
55664
|
// example: TimeSheetId { value }
|
|
55605
55665
|
relatedIdForChildRelationship.push(createFieldNode(injectedParentFieldName, FieldValueNodeSelectionSet));
|
|
55606
55666
|
}
|
|
55607
|
-
displayValueNameFields.push(...injectFieldsForDisplayValue(parentNode,
|
|
55608
|
-
...parent,
|
|
55609
|
-
name: {
|
|
55610
|
-
...parent.name,
|
|
55611
|
-
value: targetRelationship.childObjectApiName,
|
|
55612
|
-
},
|
|
55613
|
-
}, objectInfos));
|
|
55667
|
+
displayValueNameFields.push(...injectFieldsForDisplayValue(parentNode, targetRelationship.childObjectApiName, objectInfos));
|
|
55614
55668
|
}
|
|
55615
55669
|
}
|
|
55616
55670
|
}
|
|
55617
|
-
|
|
55671
|
+
else {
|
|
55672
|
+
let apiName = parent.name.value;
|
|
55673
|
+
if (pathToObjectApiNamesMap[parentPath] !== undefined &&
|
|
55674
|
+
pathToObjectApiNamesMap[parentPath].length === 1) {
|
|
55675
|
+
apiName = pathToObjectApiNamesMap[parentPath][0];
|
|
55676
|
+
}
|
|
55677
|
+
displayValueNameFields.push(...injectFieldsForDisplayValue(parentNode, apiName, objectInfos));
|
|
55678
|
+
}
|
|
55618
55679
|
}
|
|
55619
55680
|
}
|
|
55681
|
+
else if (isInlineFragmentNode(parentNode) && parentNode.typeCondition !== undefined) {
|
|
55682
|
+
const { typeCondition: { name: { value: apiName }, }, } = parentNode;
|
|
55683
|
+
displayValueNameFields.push(...injectFieldsForDisplayValue(parentNode, apiName, objectInfos));
|
|
55684
|
+
}
|
|
55620
55685
|
return [
|
|
55621
55686
|
...rootQueryIdField,
|
|
55622
55687
|
...flat(parentRelaltionships),
|
|
@@ -55867,6 +55932,10 @@ function removeSyntheticFields(result, query) {
|
|
|
55867
55932
|
// build our output from the original result set
|
|
55868
55933
|
// so we keep any other results that are not included in a record query
|
|
55869
55934
|
const output = { ...result };
|
|
55935
|
+
// graphqlBatch return deep frozon object, need to spread out new writeable copy for injected field removal
|
|
55936
|
+
output.data = { ...output.data };
|
|
55937
|
+
output.data.uiapi = { ...output.data.uiapi };
|
|
55938
|
+
output.data.uiapi.query = { ...output.data.uiapi.query };
|
|
55870
55939
|
const outputApiParent = output.data.uiapi.query;
|
|
55871
55940
|
const keys$1 = keys$4(nodeJson);
|
|
55872
55941
|
keys$1.forEach((recordName) => {
|
|
@@ -57297,6 +57366,9 @@ function normalizeRecordFields(key, entry) {
|
|
|
57297
57366
|
* Transforms a record for storage in the durable store. The transformation involves denormalizing
|
|
57298
57367
|
* scalar fields and persisting link metadata to transform back into a normalized representation
|
|
57299
57368
|
*
|
|
57369
|
+
* If the record contains pending fields this will return undefined as pending records do not get persisted
|
|
57370
|
+
* to the durable store. There should be a refresh operation outbound that will bring in the updated record.
|
|
57371
|
+
*
|
|
57300
57372
|
* @param normalizedRecord Record containing normalized field links
|
|
57301
57373
|
* @param recordStore a store containing referenced record fields
|
|
57302
57374
|
*/
|
|
@@ -57311,7 +57383,9 @@ function buildDurableRecordRepresentation(normalizedRecord, records, pendingEntr
|
|
|
57311
57383
|
// pending fields get filtered out of the durable store
|
|
57312
57384
|
const { pending } = field;
|
|
57313
57385
|
if (pending === true) {
|
|
57314
|
-
|
|
57386
|
+
// do not write records with pending fields to the durable store
|
|
57387
|
+
// there should be a refresh operation outbound that will bring in the updated record
|
|
57388
|
+
return undefined;
|
|
57315
57389
|
}
|
|
57316
57390
|
const { __ref } = field;
|
|
57317
57391
|
if (__ref !== undefined) {
|
|
@@ -57477,10 +57551,12 @@ function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecord
|
|
|
57477
57551
|
};
|
|
57478
57552
|
}
|
|
57479
57553
|
const denormalizedRecord = buildDurableRecordRepresentation(record, storeRecords, recordEntries, store);
|
|
57480
|
-
|
|
57481
|
-
|
|
57482
|
-
|
|
57483
|
-
|
|
57554
|
+
if (denormalizedRecord !== undefined) {
|
|
57555
|
+
putEntries[recordKey] = {
|
|
57556
|
+
data: denormalizedRecord,
|
|
57557
|
+
metadata,
|
|
57558
|
+
};
|
|
57559
|
+
}
|
|
57484
57560
|
}
|
|
57485
57561
|
else {
|
|
57486
57562
|
putEntries[key] = value;
|
|
@@ -57970,11 +58046,14 @@ const replaceDraftIdsInVariables$1 = (variables, draftFunctions, unmappedDraftID
|
|
|
57970
58046
|
};
|
|
57971
58047
|
// create the runtime cache for the graphql schema when the factory creates the adapter
|
|
57972
58048
|
const graphqlSchemaCache = new CachedGraphQLSchema();
|
|
57973
|
-
function
|
|
57974
|
-
|
|
58049
|
+
function getCanonicalIdFunction(luvio) {
|
|
58050
|
+
return (id) => {
|
|
57975
58051
|
var _a;
|
|
57976
58052
|
return ((_a = extractRecordIdFromStoreKey$1(luvio.storeGetCanonicalKey(RECORD_ID_PREFIX$1 + id))) !== null && _a !== void 0 ? _a : id);
|
|
57977
58053
|
};
|
|
58054
|
+
}
|
|
58055
|
+
function draftAwareGraphQLAdapterFactory(userId, objectInfoService, store, luvio, isDraftId) {
|
|
58056
|
+
const getCanonicalId = getCanonicalIdFunction(luvio);
|
|
57978
58057
|
return async function draftAwareGraphQLAdapter(config, buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy, requestContext = {}) {
|
|
57979
58058
|
//create a copy to not accidentally modify the AST in the astResolver map of luvio
|
|
57980
58059
|
const copy = parse$3(stringify$3(config.query));
|
|
@@ -58124,9 +58203,61 @@ function draftAwareGraphQLAdapterFactory(userId, objectInfoService, store, luvio
|
|
|
58124
58203
|
return resultSnapshot;
|
|
58125
58204
|
};
|
|
58126
58205
|
}
|
|
58127
|
-
function environmentAwareGraphQLBatchAdapterFactory(objectInfoService, luvio) {
|
|
58206
|
+
function environmentAwareGraphQLBatchAdapterFactory(objectInfoService, luvio, isDraftId) {
|
|
58128
58207
|
return async function environmentAwareGraphQLBatchAdapter(config, buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy, requestContext = {}) {
|
|
58129
|
-
|
|
58208
|
+
const batchQueryCopy = config.batchQuery.map((query) => clone(query));
|
|
58209
|
+
let injectedBatchQuery = [];
|
|
58210
|
+
const getCanonicalId = getCanonicalIdFunction(luvio);
|
|
58211
|
+
const draftFunctions = {
|
|
58212
|
+
isDraftId,
|
|
58213
|
+
getCanonicalId,
|
|
58214
|
+
};
|
|
58215
|
+
// return error snapshot if fails injecting fields into grapqhBatch batchQuery
|
|
58216
|
+
try {
|
|
58217
|
+
injectedBatchQuery = await Promise.all(batchQueryCopy.map((query) => injectSyntheticFields(query.query, objectInfoService, draftFunctions, query.variables)));
|
|
58218
|
+
}
|
|
58219
|
+
catch (error) {
|
|
58220
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
58221
|
+
return {
|
|
58222
|
+
data: undefined,
|
|
58223
|
+
state: 'Error',
|
|
58224
|
+
error: {
|
|
58225
|
+
errorType: 'adapterError',
|
|
58226
|
+
error: {
|
|
58227
|
+
message,
|
|
58228
|
+
},
|
|
58229
|
+
},
|
|
58230
|
+
};
|
|
58231
|
+
}
|
|
58232
|
+
const injectedConfig = {
|
|
58233
|
+
batchQuery: injectedBatchQuery.map((query, index) => {
|
|
58234
|
+
return {
|
|
58235
|
+
query: query.modifiedAST,
|
|
58236
|
+
variables: config.batchQuery[index].variables,
|
|
58237
|
+
};
|
|
58238
|
+
}),
|
|
58239
|
+
};
|
|
58240
|
+
const snapshot = (await luvio.applyCachePolicy(requestContext, { config: injectedConfig, luvio }, buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy));
|
|
58241
|
+
if (snapshot.state === 'Error') {
|
|
58242
|
+
return snapshot;
|
|
58243
|
+
}
|
|
58244
|
+
// remove injected fields from response.
|
|
58245
|
+
const data = snapshot.data;
|
|
58246
|
+
const userResults = data.results.map((compositeResult, index) => {
|
|
58247
|
+
if (compositeResult.statusCode === HttpStatusCode$1.Ok) {
|
|
58248
|
+
return {
|
|
58249
|
+
result: removeSyntheticFields(compositeResult.result, config.batchQuery[index].query),
|
|
58250
|
+
statusCode: compositeResult.statusCode,
|
|
58251
|
+
};
|
|
58252
|
+
}
|
|
58253
|
+
return compositeResult;
|
|
58254
|
+
});
|
|
58255
|
+
return {
|
|
58256
|
+
...snapshot,
|
|
58257
|
+
data: {
|
|
58258
|
+
results: userResults,
|
|
58259
|
+
},
|
|
58260
|
+
};
|
|
58130
58261
|
};
|
|
58131
58262
|
}
|
|
58132
58263
|
|
|
@@ -60858,17 +60989,6 @@ const NimbusBinaryStore = {
|
|
|
60858
60989
|
},
|
|
60859
60990
|
};
|
|
60860
60991
|
|
|
60861
|
-
function setupInspection(luvio) {
|
|
60862
|
-
if (__nimbus.plugins.LdsInspectorPlugin !== undefined) {
|
|
60863
|
-
// when inspection is enabled, make luvio available as a global
|
|
60864
|
-
// eslint-disable-next-line no-undef
|
|
60865
|
-
globalThis.luvio = luvio;
|
|
60866
|
-
registerReportObserver((report) => {
|
|
60867
|
-
__nimbus.plugins.LdsInspectorPlugin.sendAdapterReport(stringify$1$1(report));
|
|
60868
|
-
});
|
|
60869
|
-
}
|
|
60870
|
-
}
|
|
60871
|
-
|
|
60872
60992
|
/**
|
|
60873
60993
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
60874
60994
|
* All rights reserved.
|
|
@@ -61990,6 +62110,21 @@ function primingSessionFactory(config) {
|
|
|
61990
62110
|
return instrumentPrimingSession(session);
|
|
61991
62111
|
}
|
|
61992
62112
|
|
|
62113
|
+
// so eslint doesn't complain about nimbus
|
|
62114
|
+
/* global __nimbus */
|
|
62115
|
+
function setupObserver() {
|
|
62116
|
+
if (__nimbus.plugins.LdsObserverPlugin !== undefined) {
|
|
62117
|
+
registerReportObserver((report) => {
|
|
62118
|
+
__nimbus.plugins.LdsObserverPlugin.logAdapterExecution({
|
|
62119
|
+
name: report.adapterName,
|
|
62120
|
+
serializedConfig: stringify$1$1(report.config),
|
|
62121
|
+
status: report.result,
|
|
62122
|
+
duration: report.executionTime,
|
|
62123
|
+
});
|
|
62124
|
+
});
|
|
62125
|
+
}
|
|
62126
|
+
}
|
|
62127
|
+
|
|
61993
62128
|
// so eslint doesn't complain about nimbus
|
|
61994
62129
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
61995
62130
|
/* global __nimbus */
|
|
@@ -62084,8 +62219,8 @@ function getRuntime() {
|
|
|
62084
62219
|
lazyGetRecords = getRecordsAdapterFactory(lazyLuvio);
|
|
62085
62220
|
// Currently instruments store runtime perf
|
|
62086
62221
|
setupMobileInstrumentation();
|
|
62087
|
-
// If the
|
|
62088
|
-
|
|
62222
|
+
// If the observer nimbus plugin is configured, observation is enabled otherwise this is a no-op
|
|
62223
|
+
setupObserver();
|
|
62089
62224
|
// set storeEval function for lds-adapters-graghql to use
|
|
62090
62225
|
withRegistration('@salesforce/lds-adapters-graphql', (registration) => {
|
|
62091
62226
|
const { configuration: { setStoreEval, setDraftFunctions }, } = registration;
|
|
@@ -62108,7 +62243,7 @@ function getRuntime() {
|
|
|
62108
62243
|
setDraftAwareGraphQLAdapter(
|
|
62109
62244
|
// return a draft aware graphql adapter here
|
|
62110
62245
|
draftAwareGraphQLAdapter);
|
|
62111
|
-
const environmentAwareGraphQLBatchAdapter = environmentAwareGraphQLBatchAdapterFactory(lazyObjectInfoService, lazyLuvio);
|
|
62246
|
+
const environmentAwareGraphQLBatchAdapter = environmentAwareGraphQLBatchAdapterFactory(lazyObjectInfoService, lazyLuvio, isGenerated);
|
|
62112
62247
|
setEnvironmentAwareGraphQLBatchAdapter(environmentAwareGraphQLBatchAdapter);
|
|
62113
62248
|
};
|
|
62114
62249
|
const draftAwareCreateContentDocumentAndVersionAdapter = createContentDocumentAndVersionDraftAdapterFactory(lazyLuvio, NimbusBinaryStore, contentDocumentCompositeActionHandler);
|
|
@@ -62155,7 +62290,7 @@ register$1({
|
|
|
62155
62290
|
id: '@salesforce/lds-network-adapter',
|
|
62156
62291
|
instrument: instrument$2,
|
|
62157
62292
|
});
|
|
62158
|
-
// version: 1.
|
|
62293
|
+
// version: 1.284.0-a7e8dc51c
|
|
62159
62294
|
|
|
62160
62295
|
const { create: create$3, keys: keys$3 } = Object;
|
|
62161
62296
|
const { stringify: stringify$1, parse: parse$1 } = JSON;
|
|
@@ -81087,6 +81222,32 @@ let trackedFieldDepthOnNotifyChange$1 = 5;
|
|
|
81087
81222
|
* @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
|
|
81088
81223
|
*/
|
|
81089
81224
|
let trackedFieldLeafNodeIdAndNameOnly$1 = false;
|
|
81225
|
+
/**
|
|
81226
|
+
* One store enabled Get Object Info adapter
|
|
81227
|
+
*/
|
|
81228
|
+
let oneStoreGetObjectInfoAdapter$1 = undefined;
|
|
81229
|
+
/**
|
|
81230
|
+
* One store enabled Get Object Infos adapter
|
|
81231
|
+
*/
|
|
81232
|
+
let oneStoreGetObjectInfosAdapter$1 = undefined;
|
|
81233
|
+
/**
|
|
81234
|
+
* Defines the configuration API and is exposed internally as well as externally.
|
|
81235
|
+
* Configuration for one store enabled REST adapters only.
|
|
81236
|
+
*/
|
|
81237
|
+
const configurationForOneStoreEnabledAdapters$1 = {
|
|
81238
|
+
setGetObjectInfoAdapter: function (adapter) {
|
|
81239
|
+
oneStoreGetObjectInfoAdapter$1 = adapter;
|
|
81240
|
+
},
|
|
81241
|
+
getGetObjectInfoAdapter: function () {
|
|
81242
|
+
return oneStoreGetObjectInfoAdapter$1;
|
|
81243
|
+
},
|
|
81244
|
+
setGetObjectInfosAdapter: function (adapter) {
|
|
81245
|
+
oneStoreGetObjectInfosAdapter$1 = adapter;
|
|
81246
|
+
},
|
|
81247
|
+
getGetObjectInfosAdapter: function () {
|
|
81248
|
+
return oneStoreGetObjectInfosAdapter$1;
|
|
81249
|
+
},
|
|
81250
|
+
};
|
|
81090
81251
|
/**
|
|
81091
81252
|
* Defines the configuration API and is exposed internally as well as externally.
|
|
81092
81253
|
* Configuration for REST adapters only.
|
|
@@ -81151,6 +81312,7 @@ const configurationForRestAdapters$1 = {
|
|
|
81151
81312
|
getDraftAwareCreateContentVersionAdapter: function () {
|
|
81152
81313
|
return draftAwareCreateContentVersionAdapter$1;
|
|
81153
81314
|
},
|
|
81315
|
+
...configurationForOneStoreEnabledAdapters$1,
|
|
81154
81316
|
};
|
|
81155
81317
|
/**
|
|
81156
81318
|
* Defines the configuration API and is exposed internally as well as externally.
|
|
@@ -81659,6 +81821,7 @@ function bindExportsTo(luvio) {
|
|
|
81659
81821
|
// Wire Adapters
|
|
81660
81822
|
graphql: createGraphQLWireAdapterConstructor(luvio, graphql_ldsAdapter, graphqlMetadata, astResolver),
|
|
81661
81823
|
graphqlBatch: createGraphQLWireAdapterConstructor(luvio, graphqlBatch_ldsAdapter, graphqlBatchMetadata, astResolver),
|
|
81824
|
+
// One Store Enabled Adapters
|
|
81662
81825
|
// Imperative Adapters
|
|
81663
81826
|
graphql_imperative: createGraphQLImperativeAdapter(luvio, graphql_ldsAdapter, graphqlMetadata, astResolver),
|
|
81664
81827
|
graphqlBatch_imperative: createGraphQLImperativeAdapter(luvio, graphqlBatch_ldsAdapter, graphqlBatchMetadata, astResolver),
|
|
@@ -81780,15 +81943,17 @@ function isFieldId$1(unknown) {
|
|
|
81780
81943
|
/**
|
|
81781
81944
|
* Returns the field API name, qualified with an object name if possible.
|
|
81782
81945
|
* @param value The value from which to get the qualified field API name.
|
|
81946
|
+
* @param onlyQualifiedFieldNames - Whether or not this function should skip fieldApiName that do not include the delimiter '.'
|
|
81783
81947
|
* @return The qualified field API name.
|
|
81784
81948
|
*/
|
|
81785
|
-
function getFieldApiName$1(value) {
|
|
81949
|
+
function getFieldApiName$1(value, onlyQualifiedFieldNames = false) {
|
|
81786
81950
|
// Note: tightening validation logic changes behavior from userland getting
|
|
81787
81951
|
// a server-provided error to the adapter noop'ing. In 224 we decided to not
|
|
81788
|
-
// change the behavior.
|
|
81952
|
+
// change the behavior. In 250 we decided to add the 'onlyQualifiedFieldName' flag to tighten the logic
|
|
81953
|
+
// optionally to avoid issues with persisted invalid field names.
|
|
81789
81954
|
if (isString$1(value)) {
|
|
81790
81955
|
const trimmed = value.trim();
|
|
81791
|
-
if (trimmed.length > 0) {
|
|
81956
|
+
if (trimmed.length > 0 && (onlyQualifiedFieldNames ? trimmed.indexOf('.') > -1 : true)) {
|
|
81792
81957
|
return trimmed;
|
|
81793
81958
|
}
|
|
81794
81959
|
}
|
|
@@ -81801,15 +81966,19 @@ function getFieldApiName$1(value) {
|
|
|
81801
81966
|
/**
|
|
81802
81967
|
* Returns the field API name.
|
|
81803
81968
|
* @param value The value from which to get the field API name.
|
|
81969
|
+
* @param options Option bag. onlyQualifiedFieldNames is a boolean that allows this function to skip returning invalid FieldApiNames.
|
|
81804
81970
|
* @returns The field API name.
|
|
81805
81971
|
*/
|
|
81806
|
-
function getFieldApiNamesArray$1(value) {
|
|
81972
|
+
function getFieldApiNamesArray$1(value, options = { onlyQualifiedFieldNames: false }) {
|
|
81807
81973
|
const valueArray = isArray$2(value) ? value : [value];
|
|
81808
81974
|
const array = [];
|
|
81809
81975
|
for (let i = 0, len = valueArray.length; i < len; i += 1) {
|
|
81810
81976
|
const item = valueArray[i];
|
|
81811
|
-
const apiName = getFieldApiName$1(item);
|
|
81977
|
+
const apiName = getFieldApiName$1(item, options.onlyQualifiedFieldNames);
|
|
81812
81978
|
if (apiName === undefined) {
|
|
81979
|
+
if (options.onlyQualifiedFieldNames) {
|
|
81980
|
+
continue; // Just skips invalid field names rather than failing to return an array at all
|
|
81981
|
+
}
|
|
81813
81982
|
return undefined;
|
|
81814
81983
|
}
|
|
81815
81984
|
push$1.call(array, apiName);
|
|
@@ -82156,7 +82325,11 @@ var DiscriminatorValues$6;
|
|
|
82156
82325
|
})(DiscriminatorValues$6 || (DiscriminatorValues$6 = {}));
|
|
82157
82326
|
ensureRegisteredOnce$1({
|
|
82158
82327
|
id: '@salesforce/lds-adapters-uiapi',
|
|
82159
|
-
configuration: {
|
|
82328
|
+
configuration: {
|
|
82329
|
+
...configurationForRestAdapters$1,
|
|
82330
|
+
...configurationForGraphQLAdapters$1,
|
|
82331
|
+
...configurationForOneStoreEnabledAdapters$1,
|
|
82332
|
+
},
|
|
82160
82333
|
instrument: instrument$1,
|
|
82161
82334
|
});
|
|
82162
82335
|
|
|
@@ -82165,7 +82338,7 @@ register$1({
|
|
|
82165
82338
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
82166
82339
|
instrument: instrument$1,
|
|
82167
82340
|
});
|
|
82168
|
-
// version: 1.
|
|
82341
|
+
// version: 1.284.0-8b78b708e
|
|
82169
82342
|
|
|
82170
82343
|
// On core the unstable adapters are re-exported with different names,
|
|
82171
82344
|
// we want to match them here.
|
|
@@ -84421,7 +84594,7 @@ withDefaultLuvio((luvio) => {
|
|
|
84421
84594
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
84422
84595
|
graphQLImperative = ldsAdapter;
|
|
84423
84596
|
});
|
|
84424
|
-
// version: 1.
|
|
84597
|
+
// version: 1.284.0-8b78b708e
|
|
84425
84598
|
|
|
84426
84599
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
84427
84600
|
__proto__: null,
|
|
@@ -84723,72 +84896,75 @@ function invokeDmlAdapter(adapter, configObject, onResponse, nativeAdapterReques
|
|
|
84723
84896
|
}
|
|
84724
84897
|
}
|
|
84725
84898
|
/**
|
|
84726
|
-
*
|
|
84727
|
-
*
|
|
84728
|
-
*
|
|
84899
|
+
* @deprecated There is no situation in which any consumer actually wants to replace the draft.
|
|
84900
|
+
* call {@link invokeAdapterWithDraftToMerge} instead`.
|
|
84901
|
+
* Keep it for now for app back compatibility.
|
|
84902
|
+
* Will be removed in future, ideally 2 releases later.
|
|
84903
|
+
*/
|
|
84904
|
+
function invokeAdapterWithDraftToReplace(adapterId, config, draftIdToReplace, onResponse, nativeAdapterRequestContext) {
|
|
84905
|
+
invokeAdapterWithDraftToMerge(adapterId, config, draftIdToReplace, onResponse, nativeAdapterRequestContext);
|
|
84906
|
+
}
|
|
84907
|
+
/**
|
|
84908
|
+
* Executes the specified adapter with the given @param dapterId and @param config. Then
|
|
84909
|
+
* it merge the draft with the given id with the draft generated by
|
|
84910
|
+
* the mutating adapter. Will call onResult callback once with data or error.
|
|
84729
84911
|
*
|
|
84730
84912
|
* This function throws an error if the given adapterId cannot be found, or if the
|
|
84731
|
-
* adapterId is not a mutating adapter
|
|
84732
|
-
* fails to parse the given config string.
|
|
84913
|
+
* adapterId is not a mutating adapter if a draft isn't created, or
|
|
84914
|
+
* if it fails to parse the given config string.
|
|
84915
|
+
*
|
|
84916
|
+
* If the @param adapterId is deleteRecod, the invocation of it will generate a delele draft.
|
|
84917
|
+
* The newly generated delete draft will replace the draft specified by @param targetDraftId
|
|
84733
84918
|
*/
|
|
84734
|
-
function
|
|
84919
|
+
function invokeAdapterWithDraftToMerge(adapterId, config, targetDraftId, onResponse, nativeAdapterRequestContext) {
|
|
84920
|
+
const adapter = getDMLAdapterFromName(adapterId);
|
|
84921
|
+
if (adapter === undefined) {
|
|
84922
|
+
// Check if the adapter is non-mutating adapter and create proper error message.
|
|
84923
|
+
const message = getImperativeAdapterFromName(imperativeAdapterKeyBuilder(adapterId)) !== undefined
|
|
84924
|
+
? NON_MUTATING_ADAPTER_MESSAGE
|
|
84925
|
+
: `adapter ${adapterId} not recognized`;
|
|
84926
|
+
onResponse({
|
|
84927
|
+
data: undefined,
|
|
84928
|
+
error: createNativeFetchErrorResponse(message),
|
|
84929
|
+
});
|
|
84930
|
+
return;
|
|
84931
|
+
}
|
|
84932
|
+
// deleteRecord adapter call will generate a delete draft and
|
|
84933
|
+
// the newly generate draft will replace the target draft
|
|
84934
|
+
if (adapterId === 'deleteRecord') {
|
|
84935
|
+
invokeAdapterWithDraftToMergeDeleteRecord(adapter, config, targetDraftId, onResponse, nativeAdapterRequestContext);
|
|
84936
|
+
return;
|
|
84937
|
+
}
|
|
84735
84938
|
draftManager.getQueue().then((draftInfo) => {
|
|
84736
84939
|
const draftIds = draftInfo.items.map((draft) => draft.id);
|
|
84737
|
-
if (draftIds.includes(
|
|
84940
|
+
if (draftIds.includes(targetDraftId) === false) {
|
|
84738
84941
|
onResponse({
|
|
84739
84942
|
data: undefined,
|
|
84740
84943
|
error: createNativeFetchErrorResponse(DRAFT_DOESNT_EXIST_MESSAGE),
|
|
84741
84944
|
});
|
|
84742
84945
|
return;
|
|
84743
84946
|
}
|
|
84744
|
-
|
|
84745
|
-
|
|
84746
|
-
|
|
84747
|
-
|
|
84748
|
-
|
|
84749
|
-
|
|
84750
|
-
|
|
84751
|
-
|
|
84947
|
+
invokeDmlAdapter(adapter, parse$1(config), (responseValue) => {
|
|
84948
|
+
const draftIds = draftIdsForResponseValue(responseValue);
|
|
84949
|
+
if (responseValue.error === undefined &&
|
|
84950
|
+
draftIds !== undefined &&
|
|
84951
|
+
draftIds.length > 0) {
|
|
84952
|
+
const draftId = draftIds[draftIds.length - 1];
|
|
84953
|
+
draftManager
|
|
84954
|
+
.mergeActions(targetDraftId, draftId)
|
|
84955
|
+
.then(() => {
|
|
84956
|
+
onResponse(responseValue);
|
|
84957
|
+
})
|
|
84958
|
+
.catch((error) => {
|
|
84959
|
+
onResponse(convertErrorIntoNativeFetchError(error, `Unknown error merging draft`));
|
|
84752
84960
|
});
|
|
84753
|
-
return;
|
|
84754
84961
|
}
|
|
84755
|
-
|
|
84756
|
-
|
|
84757
|
-
|
|
84758
|
-
|
|
84759
|
-
|
|
84760
|
-
|
|
84761
|
-
invokeDmlAdapter(adapter, parse$1(config), (responseValue) => {
|
|
84762
|
-
const draftIds = draftIdsForResponseValue(responseValue);
|
|
84763
|
-
if (responseValue.error === undefined &&
|
|
84764
|
-
draftIds !== undefined &&
|
|
84765
|
-
draftIds.length > 0) {
|
|
84766
|
-
const draftId = draftIds[draftIds.length - 1];
|
|
84767
|
-
draftManager
|
|
84768
|
-
.replaceAction(draftIdToReplace, draftId)
|
|
84769
|
-
.then(() => {
|
|
84770
|
-
onResponse(responseValue);
|
|
84771
|
-
})
|
|
84772
|
-
.catch((error) => {
|
|
84773
|
-
let message = 'Unknown error replacing draft';
|
|
84774
|
-
if (error instanceof Error) {
|
|
84775
|
-
message = error.message;
|
|
84776
|
-
}
|
|
84777
|
-
else if (typeof error === 'string') {
|
|
84778
|
-
message = error;
|
|
84779
|
-
}
|
|
84780
|
-
onResponse({
|
|
84781
|
-
error: createNativeFetchErrorResponse(message),
|
|
84782
|
-
});
|
|
84783
|
-
});
|
|
84784
|
-
}
|
|
84785
|
-
else {
|
|
84786
|
-
let response = responseValue;
|
|
84787
|
-
response.error = createNativeFetchErrorResponse(NO_DRAFT_CREATED_MESSAGE);
|
|
84788
|
-
onResponse(response);
|
|
84789
|
-
}
|
|
84790
|
-
}, nativeAdapterRequestContext);
|
|
84791
|
-
}
|
|
84962
|
+
else {
|
|
84963
|
+
let response = responseValue;
|
|
84964
|
+
response.error = createNativeFetchErrorResponse(NO_DRAFT_CREATED_MESSAGE);
|
|
84965
|
+
onResponse(response);
|
|
84966
|
+
}
|
|
84967
|
+
}, nativeAdapterRequestContext);
|
|
84792
84968
|
});
|
|
84793
84969
|
}
|
|
84794
84970
|
/**
|
|
@@ -84830,6 +85006,9 @@ function invokeAdapterWithMetadata(adapterId, config, metadata, onResponse, nati
|
|
|
84830
85006
|
.setMetadata(draftId, { ...existingMetadata, ...metadata })
|
|
84831
85007
|
.then(() => {
|
|
84832
85008
|
onResponse(responseValue);
|
|
85009
|
+
})
|
|
85010
|
+
.catch((error) => {
|
|
85011
|
+
onResponse(convertErrorIntoNativeFetchError(error, 'Unknown error setting metadata'));
|
|
84833
85012
|
});
|
|
84834
85013
|
}
|
|
84835
85014
|
else {
|
|
@@ -84872,8 +85051,13 @@ function invokeAdapterWithMetadataDeleteRecord(adapter, config, metadata, onResp
|
|
|
84872
85051
|
onResponse(response);
|
|
84873
85052
|
}
|
|
84874
85053
|
else {
|
|
84875
|
-
draftManager
|
|
85054
|
+
draftManager
|
|
85055
|
+
.setMetadata(addedDrafts[0].id, metadata)
|
|
85056
|
+
.then(() => {
|
|
84876
85057
|
onResponse(responseValue);
|
|
85058
|
+
})
|
|
85059
|
+
.catch((error) => {
|
|
85060
|
+
onResponse(convertErrorIntoNativeFetchError(error, 'Unknown error setting metadata'));
|
|
84877
85061
|
});
|
|
84878
85062
|
}
|
|
84879
85063
|
});
|
|
@@ -84888,11 +85072,11 @@ function invokeAdapterWithMetadataDeleteRecord(adapter, config, metadata, onResp
|
|
|
84888
85072
|
}
|
|
84889
85073
|
/*
|
|
84890
85074
|
//TODO W-10284305: Remove this function in 238
|
|
84891
|
-
This is a special case version of the
|
|
85075
|
+
This is a special case version of the invokeAdapterWithDraftToMerge function
|
|
84892
85076
|
which should only be used for the deleteRecord wire adapter, since it does not
|
|
84893
85077
|
contain record data in the result and has to do special querying of the draft queue
|
|
84894
85078
|
*/
|
|
84895
|
-
function
|
|
85079
|
+
function invokeAdapterWithDraftToMergeDeleteRecord(adapter, config, draftIdToReplace, onResponse, nativeAdapterRequestContext) {
|
|
84896
85080
|
const targetedRecordId = parse$1(config);
|
|
84897
85081
|
let priorDraftIds;
|
|
84898
85082
|
draftManager.getQueue().then((draftState) => {
|
|
@@ -84922,6 +85106,9 @@ function invokeAdapterWithDraftToReplaceDeleteRecord(adapter, config, draftIdToR
|
|
|
84922
85106
|
.replaceAction(draftIdToReplace, addedDrafts[0].id)
|
|
84923
85107
|
.then(() => {
|
|
84924
85108
|
onResponse(responseValue);
|
|
85109
|
+
})
|
|
85110
|
+
.catch((error) => {
|
|
85111
|
+
onResponse(convertErrorIntoNativeFetchError(error, 'Unknown error replacing action'));
|
|
84925
85112
|
});
|
|
84926
85113
|
}
|
|
84927
85114
|
});
|
|
@@ -84934,6 +85121,18 @@ function invokeAdapterWithDraftToReplaceDeleteRecord(adapter, config, draftIdToR
|
|
|
84934
85121
|
}, nativeAdapterRequestContext);
|
|
84935
85122
|
});
|
|
84936
85123
|
}
|
|
85124
|
+
function convertErrorIntoNativeFetchError(error, defaultMessage) {
|
|
85125
|
+
let message = defaultMessage;
|
|
85126
|
+
if (error instanceof Error) {
|
|
85127
|
+
message = error.message;
|
|
85128
|
+
}
|
|
85129
|
+
else if (typeof error === 'string') {
|
|
85130
|
+
message = error;
|
|
85131
|
+
}
|
|
85132
|
+
return {
|
|
85133
|
+
error: createNativeFetchErrorResponse(message),
|
|
85134
|
+
};
|
|
85135
|
+
}
|
|
84937
85136
|
function draftIdsForResponseValue(response) {
|
|
84938
85137
|
if (response.data !== undefined &&
|
|
84939
85138
|
response.data.drafts !== undefined &&
|
|
@@ -85133,7 +85332,7 @@ const callbacks$1 = [];
|
|
|
85133
85332
|
function register(r) {
|
|
85134
85333
|
callbacks$1.forEach((callback) => callback(r));
|
|
85135
85334
|
}
|
|
85136
|
-
// version: 1.
|
|
85335
|
+
// version: 1.284.0-a7e8dc51c
|
|
85137
85336
|
|
|
85138
85337
|
/**
|
|
85139
85338
|
* Returns true if the value acts like a Promise, i.e. has a "then" function,
|
|
@@ -89117,6 +89316,32 @@ let trackedFieldDepthOnNotifyChange = 5;
|
|
|
89117
89316
|
* @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
|
|
89118
89317
|
*/
|
|
89119
89318
|
let trackedFieldLeafNodeIdAndNameOnly = false;
|
|
89319
|
+
/**
|
|
89320
|
+
* One store enabled Get Object Info adapter
|
|
89321
|
+
*/
|
|
89322
|
+
let oneStoreGetObjectInfoAdapter = undefined;
|
|
89323
|
+
/**
|
|
89324
|
+
* One store enabled Get Object Infos adapter
|
|
89325
|
+
*/
|
|
89326
|
+
let oneStoreGetObjectInfosAdapter = undefined;
|
|
89327
|
+
/**
|
|
89328
|
+
* Defines the configuration API and is exposed internally as well as externally.
|
|
89329
|
+
* Configuration for one store enabled REST adapters only.
|
|
89330
|
+
*/
|
|
89331
|
+
const configurationForOneStoreEnabledAdapters = {
|
|
89332
|
+
setGetObjectInfoAdapter: function (adapter) {
|
|
89333
|
+
oneStoreGetObjectInfoAdapter = adapter;
|
|
89334
|
+
},
|
|
89335
|
+
getGetObjectInfoAdapter: function () {
|
|
89336
|
+
return oneStoreGetObjectInfoAdapter;
|
|
89337
|
+
},
|
|
89338
|
+
setGetObjectInfosAdapter: function (adapter) {
|
|
89339
|
+
oneStoreGetObjectInfosAdapter = adapter;
|
|
89340
|
+
},
|
|
89341
|
+
getGetObjectInfosAdapter: function () {
|
|
89342
|
+
return oneStoreGetObjectInfosAdapter;
|
|
89343
|
+
},
|
|
89344
|
+
};
|
|
89120
89345
|
/**
|
|
89121
89346
|
* Defines the configuration API and is exposed internally as well as externally.
|
|
89122
89347
|
* Configuration for REST adapters only.
|
|
@@ -89181,6 +89406,7 @@ const configurationForRestAdapters = {
|
|
|
89181
89406
|
getDraftAwareCreateContentVersionAdapter: function () {
|
|
89182
89407
|
return draftAwareCreateContentVersionAdapter;
|
|
89183
89408
|
},
|
|
89409
|
+
...configurationForOneStoreEnabledAdapters,
|
|
89184
89410
|
};
|
|
89185
89411
|
/**
|
|
89186
89412
|
* Defines the configuration API and is exposed internally as well as externally.
|
|
@@ -89353,15 +89579,17 @@ function isFieldId(unknown) {
|
|
|
89353
89579
|
/**
|
|
89354
89580
|
* Returns the field API name, qualified with an object name if possible.
|
|
89355
89581
|
* @param value The value from which to get the qualified field API name.
|
|
89582
|
+
* @param onlyQualifiedFieldNames - Whether or not this function should skip fieldApiName that do not include the delimiter '.'
|
|
89356
89583
|
* @return The qualified field API name.
|
|
89357
89584
|
*/
|
|
89358
|
-
function getFieldApiName(value) {
|
|
89585
|
+
function getFieldApiName(value, onlyQualifiedFieldNames = false) {
|
|
89359
89586
|
// Note: tightening validation logic changes behavior from userland getting
|
|
89360
89587
|
// a server-provided error to the adapter noop'ing. In 224 we decided to not
|
|
89361
|
-
// change the behavior.
|
|
89588
|
+
// change the behavior. In 250 we decided to add the 'onlyQualifiedFieldName' flag to tighten the logic
|
|
89589
|
+
// optionally to avoid issues with persisted invalid field names.
|
|
89362
89590
|
if (isString(value)) {
|
|
89363
89591
|
const trimmed = value.trim();
|
|
89364
|
-
if (trimmed.length > 0) {
|
|
89592
|
+
if (trimmed.length > 0 && (onlyQualifiedFieldNames ? trimmed.indexOf('.') > -1 : true)) {
|
|
89365
89593
|
return trimmed;
|
|
89366
89594
|
}
|
|
89367
89595
|
}
|
|
@@ -89374,15 +89602,19 @@ function getFieldApiName(value) {
|
|
|
89374
89602
|
/**
|
|
89375
89603
|
* Returns the field API name.
|
|
89376
89604
|
* @param value The value from which to get the field API name.
|
|
89605
|
+
* @param options Option bag. onlyQualifiedFieldNames is a boolean that allows this function to skip returning invalid FieldApiNames.
|
|
89377
89606
|
* @returns The field API name.
|
|
89378
89607
|
*/
|
|
89379
|
-
function getFieldApiNamesArray(value) {
|
|
89608
|
+
function getFieldApiNamesArray(value, options = { onlyQualifiedFieldNames: false }) {
|
|
89380
89609
|
const valueArray = isArray(value) ? value : [value];
|
|
89381
89610
|
const array = [];
|
|
89382
89611
|
for (let i = 0, len = valueArray.length; i < len; i += 1) {
|
|
89383
89612
|
const item = valueArray[i];
|
|
89384
|
-
const apiName = getFieldApiName(item);
|
|
89613
|
+
const apiName = getFieldApiName(item, options.onlyQualifiedFieldNames);
|
|
89385
89614
|
if (apiName === undefined) {
|
|
89615
|
+
if (options.onlyQualifiedFieldNames) {
|
|
89616
|
+
continue; // Just skips invalid field names rather than failing to return an array at all
|
|
89617
|
+
}
|
|
89386
89618
|
return undefined;
|
|
89387
89619
|
}
|
|
89388
89620
|
push.call(array, apiName);
|
|
@@ -89731,7 +89963,11 @@ var DiscriminatorValues;
|
|
|
89731
89963
|
ObjectCreate$1(null);
|
|
89732
89964
|
ensureRegisteredOnce({
|
|
89733
89965
|
id: '@salesforce/lds-adapters-uiapi',
|
|
89734
|
-
configuration: {
|
|
89966
|
+
configuration: {
|
|
89967
|
+
...configurationForRestAdapters,
|
|
89968
|
+
...configurationForGraphQLAdapters,
|
|
89969
|
+
...configurationForOneStoreEnabledAdapters,
|
|
89970
|
+
},
|
|
89735
89971
|
instrument,
|
|
89736
89972
|
});
|
|
89737
89973
|
|
|
@@ -90047,5 +90283,5 @@ function handleInstrumentation(activity, stat, progress) {
|
|
|
90047
90283
|
const { luvio } = getRuntime();
|
|
90048
90284
|
setDefaultLuvio({ luvio });
|
|
90049
90285
|
|
|
90050
|
-
export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
|
|
90051
|
-
// version: 1.
|
|
90286
|
+
export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
|
|
90287
|
+
// version: 1.284.0-a7e8dc51c
|