@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
|
@@ -4183,7 +4183,7 @@
|
|
|
4183
4183
|
}
|
|
4184
4184
|
callbacks.push(callback);
|
|
4185
4185
|
}
|
|
4186
|
-
// version: 1.
|
|
4186
|
+
// version: 1.284.0-a7e8dc51c
|
|
4187
4187
|
|
|
4188
4188
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
4189
4189
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -15691,7 +15691,7 @@
|
|
|
15691
15691
|
}
|
|
15692
15692
|
return superResult;
|
|
15693
15693
|
}
|
|
15694
|
-
// version: 1.
|
|
15694
|
+
// version: 1.284.0-a7e8dc51c
|
|
15695
15695
|
|
|
15696
15696
|
function unwrap(data) {
|
|
15697
15697
|
// The lwc-luvio bindings import a function from lwc called "unwrap".
|
|
@@ -16616,7 +16616,7 @@
|
|
|
16616
16616
|
const { apiFamily, name } = metadata;
|
|
16617
16617
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
16618
16618
|
}
|
|
16619
|
-
// version: 1.
|
|
16619
|
+
// version: 1.284.0-a7e8dc51c
|
|
16620
16620
|
|
|
16621
16621
|
/**
|
|
16622
16622
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -16829,6 +16829,41 @@
|
|
|
16829
16829
|
* @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
|
|
16830
16830
|
*/
|
|
16831
16831
|
let trackedFieldLeafNodeIdAndNameOnly$2 = false;
|
|
16832
|
+
/**
|
|
16833
|
+
* One store enabled Get Object Info adapter
|
|
16834
|
+
*/
|
|
16835
|
+
let oneStoreGetObjectInfoAdapter$2 = undefined;
|
|
16836
|
+
/**
|
|
16837
|
+
* One store enabled Get Object Infos adapter
|
|
16838
|
+
*/
|
|
16839
|
+
let oneStoreGetObjectInfosAdapter$2 = undefined;
|
|
16840
|
+
/**
|
|
16841
|
+
* Defines the configuration API and is exposed internally as well as externally.
|
|
16842
|
+
* Configuration for one store enabled REST adapters only.
|
|
16843
|
+
*/
|
|
16844
|
+
const configurationForOneStoreEnabledAdapters$2 = {
|
|
16845
|
+
setGetObjectInfoAdapter: function (adapter) {
|
|
16846
|
+
oneStoreGetObjectInfoAdapter$2 = adapter;
|
|
16847
|
+
},
|
|
16848
|
+
getGetObjectInfoAdapter: function () {
|
|
16849
|
+
return oneStoreGetObjectInfoAdapter$2;
|
|
16850
|
+
},
|
|
16851
|
+
setGetObjectInfosAdapter: function (adapter) {
|
|
16852
|
+
oneStoreGetObjectInfosAdapter$2 = adapter;
|
|
16853
|
+
},
|
|
16854
|
+
getGetObjectInfosAdapter: function () {
|
|
16855
|
+
return oneStoreGetObjectInfosAdapter$2;
|
|
16856
|
+
},
|
|
16857
|
+
};
|
|
16858
|
+
/**
|
|
16859
|
+
* Helper function to return the one store adapter if it's defined, otherwise return the luvio adapter.
|
|
16860
|
+
* @param luvioAdapter - The luvio bound adapter.
|
|
16861
|
+
* @param oneStoreAdapter - The one store bound adapter.
|
|
16862
|
+
* @returns Luvio or one store wire adapter constructor.
|
|
16863
|
+
*/
|
|
16864
|
+
function getLuvioOrOneStoreAdapter(luvioAdapter, oneStoreAdapter) {
|
|
16865
|
+
return oneStoreAdapter !== null && oneStoreAdapter !== void 0 ? oneStoreAdapter : luvioAdapter;
|
|
16866
|
+
}
|
|
16832
16867
|
/**
|
|
16833
16868
|
* Defines the configuration API and is exposed internally as well as externally.
|
|
16834
16869
|
* Configuration for REST adapters only.
|
|
@@ -16893,6 +16928,7 @@
|
|
|
16893
16928
|
getDraftAwareCreateContentVersionAdapter: function () {
|
|
16894
16929
|
return draftAwareCreateContentVersionAdapter$2;
|
|
16895
16930
|
},
|
|
16931
|
+
...configurationForOneStoreEnabledAdapters$2,
|
|
16896
16932
|
};
|
|
16897
16933
|
/**
|
|
16898
16934
|
* Defines the configuration API and is exposed internally as well as externally.
|
|
@@ -17249,15 +17285,17 @@
|
|
|
17249
17285
|
/**
|
|
17250
17286
|
* Returns the field API name, qualified with an object name if possible.
|
|
17251
17287
|
* @param value The value from which to get the qualified field API name.
|
|
17288
|
+
* @param onlyQualifiedFieldNames - Whether or not this function should skip fieldApiName that do not include the delimiter '.'
|
|
17252
17289
|
* @return The qualified field API name.
|
|
17253
17290
|
*/
|
|
17254
|
-
function getFieldApiName$2(value) {
|
|
17291
|
+
function getFieldApiName$2(value, onlyQualifiedFieldNames = false) {
|
|
17255
17292
|
// Note: tightening validation logic changes behavior from userland getting
|
|
17256
17293
|
// a server-provided error to the adapter noop'ing. In 224 we decided to not
|
|
17257
|
-
// change the behavior.
|
|
17294
|
+
// change the behavior. In 250 we decided to add the 'onlyQualifiedFieldName' flag to tighten the logic
|
|
17295
|
+
// optionally to avoid issues with persisted invalid field names.
|
|
17258
17296
|
if (isString$2(value)) {
|
|
17259
17297
|
const trimmed = value.trim();
|
|
17260
|
-
if (trimmed.length > 0) {
|
|
17298
|
+
if (trimmed.length > 0 && (onlyQualifiedFieldNames ? trimmed.indexOf('.') > -1 : true)) {
|
|
17261
17299
|
return trimmed;
|
|
17262
17300
|
}
|
|
17263
17301
|
}
|
|
@@ -17270,15 +17308,19 @@
|
|
|
17270
17308
|
/**
|
|
17271
17309
|
* Returns the field API name.
|
|
17272
17310
|
* @param value The value from which to get the field API name.
|
|
17311
|
+
* @param options Option bag. onlyQualifiedFieldNames is a boolean that allows this function to skip returning invalid FieldApiNames.
|
|
17273
17312
|
* @returns The field API name.
|
|
17274
17313
|
*/
|
|
17275
|
-
function getFieldApiNamesArray$2(value) {
|
|
17314
|
+
function getFieldApiNamesArray$2(value, options = { onlyQualifiedFieldNames: false }) {
|
|
17276
17315
|
const valueArray = isArray$7(value) ? value : [value];
|
|
17277
17316
|
const array = [];
|
|
17278
17317
|
for (let i = 0, len = valueArray.length; i < len; i += 1) {
|
|
17279
17318
|
const item = valueArray[i];
|
|
17280
|
-
const apiName = getFieldApiName$2(item);
|
|
17319
|
+
const apiName = getFieldApiName$2(item, options.onlyQualifiedFieldNames);
|
|
17281
17320
|
if (apiName === undefined) {
|
|
17321
|
+
if (options.onlyQualifiedFieldNames) {
|
|
17322
|
+
continue; // Just skips invalid field names rather than failing to return an array at all
|
|
17323
|
+
}
|
|
17282
17324
|
return undefined;
|
|
17283
17325
|
}
|
|
17284
17326
|
push$4.call(array, apiName);
|
|
@@ -21645,17 +21687,16 @@
|
|
|
21645
21687
|
}
|
|
21646
21688
|
|
|
21647
21689
|
const TTL$x = 30000;
|
|
21648
|
-
const VERSION$18$1 = "
|
|
21690
|
+
const VERSION$18$1 = "e5c90c4081cd557f8ffec53028ede1e8";
|
|
21649
21691
|
const RepresentationType$T = 'ListRecordCollectionRepresentation';
|
|
21650
21692
|
function keyBuilder$23(luvio, config) {
|
|
21651
|
-
return keyPrefix$2 + '::' + RepresentationType$T + ':' + config.objectApiName + ':' + (config.searchTerm === null ? '' : config.searchTerm) + ':' + (config.sortBy === null ? '' : '[' + config.sortBy.join(',') + ']') + ':' + (config.
|
|
21693
|
+
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);
|
|
21652
21694
|
}
|
|
21653
21695
|
function keyBuilderFromType$B(luvio, object) {
|
|
21654
21696
|
const keyParams = {
|
|
21655
21697
|
objectApiName: object.listReference.objectApiName,
|
|
21656
21698
|
searchTerm: object.searchTerm,
|
|
21657
21699
|
sortBy: object.sortBy,
|
|
21658
|
-
listViewId: object.listInfoETag,
|
|
21659
21700
|
where: object.where,
|
|
21660
21701
|
listViewApiName: object.listReference.listViewApiName
|
|
21661
21702
|
};
|
|
@@ -22716,7 +22757,7 @@
|
|
|
22716
22757
|
const keyElements = key.split(':');
|
|
22717
22758
|
return {
|
|
22718
22759
|
objectApiName: keyElements[3],
|
|
22719
|
-
listViewApiName: keyElements[
|
|
22760
|
+
listViewApiName: keyElements[7],
|
|
22720
22761
|
};
|
|
22721
22762
|
}
|
|
22722
22763
|
function splitListSummaryCollectionKey(key) {
|
|
@@ -23014,7 +23055,8 @@
|
|
|
23014
23055
|
return keyBuilder$23(luvio, {
|
|
23015
23056
|
objectApiName: listReference.objectApiName,
|
|
23016
23057
|
listViewApiName: listReference.listViewApiName,
|
|
23017
|
-
listViewId
|
|
23058
|
+
// # removing listViewId from key only supporing getting records using api name
|
|
23059
|
+
// listViewId: listReference.id,
|
|
23018
23060
|
searchTerm: params.body.searchTerm || null,
|
|
23019
23061
|
where: params.body.where || null,
|
|
23020
23062
|
sortBy: params.body.sortBy !== undefined && params.body.sortBy.length <= 0
|
|
@@ -23027,7 +23069,8 @@
|
|
|
23027
23069
|
return keyBuilder$23(luvio, {
|
|
23028
23070
|
objectApiName: params.urlParams.objectApiName,
|
|
23029
23071
|
listViewApiName: params.urlParams.listViewApiName,
|
|
23030
|
-
listViewId
|
|
23072
|
+
// # removing listViewId from key only supporing getting records using api name
|
|
23073
|
+
// listViewId: '',
|
|
23031
23074
|
searchTerm: params.body.searchTerm || null,
|
|
23032
23075
|
where: params.body.where || null,
|
|
23033
23076
|
sortBy: params.body.sortBy || [],
|
|
@@ -32199,7 +32242,7 @@
|
|
|
32199
32242
|
}
|
|
32200
32243
|
|
|
32201
32244
|
const TTL$k = 900000;
|
|
32202
|
-
const VERSION$D$1 = "
|
|
32245
|
+
const VERSION$D$1 = "2405a0b25c2c00f82e88b600edc16387";
|
|
32203
32246
|
const RepresentationType$u = 'ListObjectInfoRepresentation';
|
|
32204
32247
|
function keyBuilder$15$1(luvio, config) {
|
|
32205
32248
|
return keyPrefix$2 + '::' + RepresentationType$u + ':' + config.objectApiName;
|
|
@@ -32241,6 +32284,10 @@
|
|
|
32241
32284
|
name: 'objectApiName',
|
|
32242
32285
|
kind: 'Scalar'
|
|
32243
32286
|
},
|
|
32287
|
+
{
|
|
32288
|
+
name: 'publicOrSharedCreateable',
|
|
32289
|
+
kind: 'Scalar'
|
|
32290
|
+
},
|
|
32244
32291
|
{
|
|
32245
32292
|
name: 'relatedEntityApiName',
|
|
32246
32293
|
kind: 'Scalar'
|
|
@@ -32254,6 +32301,11 @@
|
|
|
32254
32301
|
if (!(existing_createable === incoming_createable)) {
|
|
32255
32302
|
return false;
|
|
32256
32303
|
}
|
|
32304
|
+
const existing_publicOrSharedCreateable = existing.publicOrSharedCreateable;
|
|
32305
|
+
const incoming_publicOrSharedCreateable = incoming.publicOrSharedCreateable;
|
|
32306
|
+
if (!(existing_publicOrSharedCreateable === incoming_publicOrSharedCreateable)) {
|
|
32307
|
+
return false;
|
|
32308
|
+
}
|
|
32257
32309
|
const existing_objectApiName = existing.objectApiName;
|
|
32258
32310
|
const incoming_objectApiName = incoming.objectApiName;
|
|
32259
32311
|
if (!(existing_objectApiName === incoming_objectApiName)) {
|
|
@@ -40855,6 +40907,7 @@
|
|
|
40855
40907
|
// Note: The original listReference will remain unchanged in the response.
|
|
40856
40908
|
mutatedListRef.id = body.listInfoETag;
|
|
40857
40909
|
addListReferenceWithId(mutatedListRef, context, body.listReference.id);
|
|
40910
|
+
// storing sortBy ensuring a cache hit when requesting records with no sortBy provided
|
|
40858
40911
|
addServerDefaults(config, body, originalListRef, context);
|
|
40859
40912
|
}
|
|
40860
40913
|
return onFetchResponseSuccess$2$1(luvio, config, resourceParams, response);
|
|
@@ -43569,7 +43622,11 @@
|
|
|
43569
43622
|
}
|
|
43570
43623
|
ensureRegisteredOnce$2({
|
|
43571
43624
|
id: '@salesforce/lds-adapters-uiapi',
|
|
43572
|
-
configuration: {
|
|
43625
|
+
configuration: {
|
|
43626
|
+
...configurationForRestAdapters$2,
|
|
43627
|
+
...configurationForGraphQLAdapters$2,
|
|
43628
|
+
...configurationForOneStoreEnabledAdapters$2,
|
|
43629
|
+
},
|
|
43573
43630
|
instrument: instrument$3,
|
|
43574
43631
|
});
|
|
43575
43632
|
|
|
@@ -43830,15 +43887,13 @@
|
|
|
43830
43887
|
getListInfosByObjectName: createWireAdapterConstructor(luvio, getListInfosByObjectName_ldsAdapter, getListInfosByObjectNameMetadata),
|
|
43831
43888
|
getListObjectInfo: createWireAdapterConstructor(luvio, getListObjectInfo_ldsAdapter, getListObjectInfoMetadata),
|
|
43832
43889
|
getListPreferences: createWireAdapterConstructor(luvio, getListPreferences_ldsAdapter, getListPreferencesMetadata),
|
|
43833
|
-
getListRecordsByName:
|
|
43890
|
+
getListRecordsByName: createInfiniteScrollingWireAdapterConstructor(luvio, getListRecordsByName_ldsAdapter, getListRecordsByNameMetadata),
|
|
43834
43891
|
getListUi: createInfiniteScrollingWireAdapterConstructor(luvio, getListUi_ldsAdapter, getListUiMetadata),
|
|
43835
43892
|
getLookupActions: createWireAdapterConstructor(luvio, getLookupActions_ldsAdapter, getLookupActionsMetadata),
|
|
43836
43893
|
getLookupMetadata: createWireAdapterConstructor(luvio, getLookupMetadata_ldsAdapter, getLookupMetadataMetadata),
|
|
43837
43894
|
getLookupRecords: createWireAdapterConstructor(luvio, getLookupRecords_ldsAdapter, getLookupRecordsMetadata),
|
|
43838
43895
|
getNavItems: createWireAdapterConstructor(luvio, getNavItems_ldsAdapter, getNavItemsMetadata),
|
|
43839
43896
|
getObjectCreateActions: createWireAdapterConstructor(luvio, getObjectCreateActions_ldsAdapter, getObjectCreateActionsMetadata),
|
|
43840
|
-
getObjectInfo: createWireAdapterConstructor(luvio, getObjectInfo_ldsAdapter, getObjectInfoMetadata),
|
|
43841
|
-
getObjectInfos: createWireAdapterConstructor(luvio, getObjectInfos_ldsAdapter, getObjectInfosMetadata),
|
|
43842
43897
|
getPathLayout: createWireAdapterConstructor(luvio, getPathLayout_ldsAdapter, getPathLayoutMetadata),
|
|
43843
43898
|
getPicklistValues: createWireAdapterConstructor(luvio, getPicklistValues_ldsAdapter, getPicklistValuesMetadata),
|
|
43844
43899
|
getPicklistValuesByRecordType: createWireAdapterConstructor(luvio, getPicklistValuesByRecordType_ldsAdapter, getPicklistValuesByRecordTypeMetadata),
|
|
@@ -43874,6 +43929,9 @@
|
|
|
43874
43929
|
updateListPreferences: createLDSAdapter(luvio, adapterName$z, updateListPreferencesAdapterFactory),
|
|
43875
43930
|
updateRecord: unwrapSnapshotData(factory$2),
|
|
43876
43931
|
updateRecordAvatar: unwrapSnapshotData(factory$8),
|
|
43932
|
+
// One Store Enabled Adapters
|
|
43933
|
+
getObjectInfo: getLuvioOrOneStoreAdapter(createWireAdapterConstructor(luvio, getObjectInfo_ldsAdapter, getObjectInfoMetadata), configurationForOneStoreEnabledAdapters$2.getGetObjectInfoAdapter()),
|
|
43934
|
+
getObjectInfos: getLuvioOrOneStoreAdapter(createWireAdapterConstructor(luvio, getObjectInfos_ldsAdapter, getObjectInfosMetadata), configurationForOneStoreEnabledAdapters$2.getGetObjectInfosAdapter()),
|
|
43877
43935
|
// Imperative Adapters
|
|
43878
43936
|
unstable_getActionOverrides_imperative: createImperativeAdapter(luvio, getActionOverrides_ldsAdapter, getActionOverridesMetadata),
|
|
43879
43937
|
getAllApps_imperative: createImperativeAdapter(luvio, getAllApps_ldsAdapter, getAllAppsMetadata),
|
|
@@ -44099,7 +44157,7 @@
|
|
|
44099
44157
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
44100
44158
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
44101
44159
|
});
|
|
44102
|
-
// version: 1.
|
|
44160
|
+
// version: 1.284.0-8b78b708e
|
|
44103
44161
|
|
|
44104
44162
|
var ldsIdempotencyWriteDisabled = {
|
|
44105
44163
|
isOpen: function (e) {
|
|
@@ -49733,6 +49791,10 @@
|
|
|
49733
49791
|
switch (result) {
|
|
49734
49792
|
case ProcessActionResult.BLOCKED_ON_ERROR:
|
|
49735
49793
|
this.state = DraftQueueState.Error;
|
|
49794
|
+
await this.notifyChangedListeners({
|
|
49795
|
+
type: DraftQueueEventType.QueueStateChanged,
|
|
49796
|
+
state: this.state,
|
|
49797
|
+
});
|
|
49736
49798
|
return Promise.reject();
|
|
49737
49799
|
default:
|
|
49738
49800
|
return Promise.resolve();
|
|
@@ -52250,6 +52312,9 @@
|
|
|
52250
52312
|
else if (field.apiName === 'weakEtag') {
|
|
52251
52313
|
leftPath = '$.weakEtag';
|
|
52252
52314
|
}
|
|
52315
|
+
else if (field.apiName === 'RecordTypeId') {
|
|
52316
|
+
leftPath = '$.recordTypeId';
|
|
52317
|
+
}
|
|
52253
52318
|
return {
|
|
52254
52319
|
alias,
|
|
52255
52320
|
leftPath,
|
|
@@ -55523,7 +55588,7 @@
|
|
|
55523
55588
|
* @param objectInfos
|
|
55524
55589
|
* @returns
|
|
55525
55590
|
*/
|
|
55526
|
-
function injectFieldsForDisplayValue(topNode,
|
|
55591
|
+
function injectFieldsForDisplayValue(topNode, apiName, objectInfos) {
|
|
55527
55592
|
const { selectionSet } = topNode;
|
|
55528
55593
|
if (selectionSet === undefined)
|
|
55529
55594
|
return [];
|
|
@@ -55537,13 +55602,8 @@
|
|
|
55537
55602
|
displayValue = node;
|
|
55538
55603
|
break;
|
|
55539
55604
|
}
|
|
55540
|
-
if (isInlineFragmentNode(node)) {
|
|
55541
|
-
const name = node.typeCondition !== undefined ? node.typeCondition.name : parentNode.name;
|
|
55542
|
-
displayValueNameFields = injectFieldsForDisplayValue(node, { ...parentNode, name }, objectInfos);
|
|
55543
|
-
}
|
|
55544
55605
|
}
|
|
55545
55606
|
if (displayValue !== undefined) {
|
|
55546
|
-
const apiName = parentNode.name.value;
|
|
55547
55607
|
const objectInfo = objectInfos[apiName];
|
|
55548
55608
|
if (objectInfo !== undefined &&
|
|
55549
55609
|
objectInfo.nameFields !== undefined &&
|
|
@@ -55610,19 +55670,24 @@
|
|
|
55610
55670
|
// example: TimeSheetId { value }
|
|
55611
55671
|
relatedIdForChildRelationship.push(createFieldNode(injectedParentFieldName, FieldValueNodeSelectionSet));
|
|
55612
55672
|
}
|
|
55613
|
-
displayValueNameFields.push(...injectFieldsForDisplayValue(parentNode,
|
|
55614
|
-
...parent,
|
|
55615
|
-
name: {
|
|
55616
|
-
...parent.name,
|
|
55617
|
-
value: targetRelationship.childObjectApiName,
|
|
55618
|
-
},
|
|
55619
|
-
}, objectInfos));
|
|
55673
|
+
displayValueNameFields.push(...injectFieldsForDisplayValue(parentNode, targetRelationship.childObjectApiName, objectInfos));
|
|
55620
55674
|
}
|
|
55621
55675
|
}
|
|
55622
55676
|
}
|
|
55623
|
-
|
|
55677
|
+
else {
|
|
55678
|
+
let apiName = parent.name.value;
|
|
55679
|
+
if (pathToObjectApiNamesMap[parentPath] !== undefined &&
|
|
55680
|
+
pathToObjectApiNamesMap[parentPath].length === 1) {
|
|
55681
|
+
apiName = pathToObjectApiNamesMap[parentPath][0];
|
|
55682
|
+
}
|
|
55683
|
+
displayValueNameFields.push(...injectFieldsForDisplayValue(parentNode, apiName, objectInfos));
|
|
55684
|
+
}
|
|
55624
55685
|
}
|
|
55625
55686
|
}
|
|
55687
|
+
else if (isInlineFragmentNode(parentNode) && parentNode.typeCondition !== undefined) {
|
|
55688
|
+
const { typeCondition: { name: { value: apiName }, }, } = parentNode;
|
|
55689
|
+
displayValueNameFields.push(...injectFieldsForDisplayValue(parentNode, apiName, objectInfos));
|
|
55690
|
+
}
|
|
55626
55691
|
return [
|
|
55627
55692
|
...rootQueryIdField,
|
|
55628
55693
|
...flat(parentRelaltionships),
|
|
@@ -55873,6 +55938,10 @@
|
|
|
55873
55938
|
// build our output from the original result set
|
|
55874
55939
|
// so we keep any other results that are not included in a record query
|
|
55875
55940
|
const output = { ...result };
|
|
55941
|
+
// graphqlBatch return deep frozon object, need to spread out new writeable copy for injected field removal
|
|
55942
|
+
output.data = { ...output.data };
|
|
55943
|
+
output.data.uiapi = { ...output.data.uiapi };
|
|
55944
|
+
output.data.uiapi.query = { ...output.data.uiapi.query };
|
|
55876
55945
|
const outputApiParent = output.data.uiapi.query;
|
|
55877
55946
|
const keys$1 = keys$4(nodeJson);
|
|
55878
55947
|
keys$1.forEach((recordName) => {
|
|
@@ -57303,6 +57372,9 @@
|
|
|
57303
57372
|
* Transforms a record for storage in the durable store. The transformation involves denormalizing
|
|
57304
57373
|
* scalar fields and persisting link metadata to transform back into a normalized representation
|
|
57305
57374
|
*
|
|
57375
|
+
* If the record contains pending fields this will return undefined as pending records do not get persisted
|
|
57376
|
+
* to the durable store. There should be a refresh operation outbound that will bring in the updated record.
|
|
57377
|
+
*
|
|
57306
57378
|
* @param normalizedRecord Record containing normalized field links
|
|
57307
57379
|
* @param recordStore a store containing referenced record fields
|
|
57308
57380
|
*/
|
|
@@ -57317,7 +57389,9 @@
|
|
|
57317
57389
|
// pending fields get filtered out of the durable store
|
|
57318
57390
|
const { pending } = field;
|
|
57319
57391
|
if (pending === true) {
|
|
57320
|
-
|
|
57392
|
+
// do not write records with pending fields to the durable store
|
|
57393
|
+
// there should be a refresh operation outbound that will bring in the updated record
|
|
57394
|
+
return undefined;
|
|
57321
57395
|
}
|
|
57322
57396
|
const { __ref } = field;
|
|
57323
57397
|
if (__ref !== undefined) {
|
|
@@ -57483,10 +57557,12 @@
|
|
|
57483
57557
|
};
|
|
57484
57558
|
}
|
|
57485
57559
|
const denormalizedRecord = buildDurableRecordRepresentation(record, storeRecords, recordEntries, store);
|
|
57486
|
-
|
|
57487
|
-
|
|
57488
|
-
|
|
57489
|
-
|
|
57560
|
+
if (denormalizedRecord !== undefined) {
|
|
57561
|
+
putEntries[recordKey] = {
|
|
57562
|
+
data: denormalizedRecord,
|
|
57563
|
+
metadata,
|
|
57564
|
+
};
|
|
57565
|
+
}
|
|
57490
57566
|
}
|
|
57491
57567
|
else {
|
|
57492
57568
|
putEntries[key] = value;
|
|
@@ -57976,11 +58052,14 @@
|
|
|
57976
58052
|
};
|
|
57977
58053
|
// create the runtime cache for the graphql schema when the factory creates the adapter
|
|
57978
58054
|
const graphqlSchemaCache = new CachedGraphQLSchema();
|
|
57979
|
-
function
|
|
57980
|
-
|
|
58055
|
+
function getCanonicalIdFunction(luvio) {
|
|
58056
|
+
return (id) => {
|
|
57981
58057
|
var _a;
|
|
57982
58058
|
return ((_a = extractRecordIdFromStoreKey$1(luvio.storeGetCanonicalKey(RECORD_ID_PREFIX$1 + id))) !== null && _a !== void 0 ? _a : id);
|
|
57983
58059
|
};
|
|
58060
|
+
}
|
|
58061
|
+
function draftAwareGraphQLAdapterFactory(userId, objectInfoService, store, luvio, isDraftId) {
|
|
58062
|
+
const getCanonicalId = getCanonicalIdFunction(luvio);
|
|
57984
58063
|
return async function draftAwareGraphQLAdapter(config, buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy, requestContext = {}) {
|
|
57985
58064
|
//create a copy to not accidentally modify the AST in the astResolver map of luvio
|
|
57986
58065
|
const copy = parse$3(stringify$3(config.query));
|
|
@@ -58130,9 +58209,61 @@
|
|
|
58130
58209
|
return resultSnapshot;
|
|
58131
58210
|
};
|
|
58132
58211
|
}
|
|
58133
|
-
function environmentAwareGraphQLBatchAdapterFactory(objectInfoService, luvio) {
|
|
58212
|
+
function environmentAwareGraphQLBatchAdapterFactory(objectInfoService, luvio, isDraftId) {
|
|
58134
58213
|
return async function environmentAwareGraphQLBatchAdapter(config, buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy, requestContext = {}) {
|
|
58135
|
-
|
|
58214
|
+
const batchQueryCopy = config.batchQuery.map((query) => clone(query));
|
|
58215
|
+
let injectedBatchQuery = [];
|
|
58216
|
+
const getCanonicalId = getCanonicalIdFunction(luvio);
|
|
58217
|
+
const draftFunctions = {
|
|
58218
|
+
isDraftId,
|
|
58219
|
+
getCanonicalId,
|
|
58220
|
+
};
|
|
58221
|
+
// return error snapshot if fails injecting fields into grapqhBatch batchQuery
|
|
58222
|
+
try {
|
|
58223
|
+
injectedBatchQuery = await Promise.all(batchQueryCopy.map((query) => injectSyntheticFields(query.query, objectInfoService, draftFunctions, query.variables)));
|
|
58224
|
+
}
|
|
58225
|
+
catch (error) {
|
|
58226
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
58227
|
+
return {
|
|
58228
|
+
data: undefined,
|
|
58229
|
+
state: 'Error',
|
|
58230
|
+
error: {
|
|
58231
|
+
errorType: 'adapterError',
|
|
58232
|
+
error: {
|
|
58233
|
+
message,
|
|
58234
|
+
},
|
|
58235
|
+
},
|
|
58236
|
+
};
|
|
58237
|
+
}
|
|
58238
|
+
const injectedConfig = {
|
|
58239
|
+
batchQuery: injectedBatchQuery.map((query, index) => {
|
|
58240
|
+
return {
|
|
58241
|
+
query: query.modifiedAST,
|
|
58242
|
+
variables: config.batchQuery[index].variables,
|
|
58243
|
+
};
|
|
58244
|
+
}),
|
|
58245
|
+
};
|
|
58246
|
+
const snapshot = (await luvio.applyCachePolicy(requestContext, { config: injectedConfig, luvio }, buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy));
|
|
58247
|
+
if (snapshot.state === 'Error') {
|
|
58248
|
+
return snapshot;
|
|
58249
|
+
}
|
|
58250
|
+
// remove injected fields from response.
|
|
58251
|
+
const data = snapshot.data;
|
|
58252
|
+
const userResults = data.results.map((compositeResult, index) => {
|
|
58253
|
+
if (compositeResult.statusCode === HttpStatusCode$1.Ok) {
|
|
58254
|
+
return {
|
|
58255
|
+
result: removeSyntheticFields(compositeResult.result, config.batchQuery[index].query),
|
|
58256
|
+
statusCode: compositeResult.statusCode,
|
|
58257
|
+
};
|
|
58258
|
+
}
|
|
58259
|
+
return compositeResult;
|
|
58260
|
+
});
|
|
58261
|
+
return {
|
|
58262
|
+
...snapshot,
|
|
58263
|
+
data: {
|
|
58264
|
+
results: userResults,
|
|
58265
|
+
},
|
|
58266
|
+
};
|
|
58136
58267
|
};
|
|
58137
58268
|
}
|
|
58138
58269
|
|
|
@@ -60864,17 +60995,6 @@
|
|
|
60864
60995
|
},
|
|
60865
60996
|
};
|
|
60866
60997
|
|
|
60867
|
-
function setupInspection(luvio) {
|
|
60868
|
-
if (__nimbus.plugins.LdsInspectorPlugin !== undefined) {
|
|
60869
|
-
// when inspection is enabled, make luvio available as a global
|
|
60870
|
-
// eslint-disable-next-line no-undef
|
|
60871
|
-
globalThis.luvio = luvio;
|
|
60872
|
-
registerReportObserver((report) => {
|
|
60873
|
-
__nimbus.plugins.LdsInspectorPlugin.sendAdapterReport(stringify$1$1(report));
|
|
60874
|
-
});
|
|
60875
|
-
}
|
|
60876
|
-
}
|
|
60877
|
-
|
|
60878
60998
|
/**
|
|
60879
60999
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
60880
61000
|
* All rights reserved.
|
|
@@ -61996,6 +62116,21 @@
|
|
|
61996
62116
|
return instrumentPrimingSession(session);
|
|
61997
62117
|
}
|
|
61998
62118
|
|
|
62119
|
+
// so eslint doesn't complain about nimbus
|
|
62120
|
+
/* global __nimbus */
|
|
62121
|
+
function setupObserver() {
|
|
62122
|
+
if (__nimbus.plugins.LdsObserverPlugin !== undefined) {
|
|
62123
|
+
registerReportObserver((report) => {
|
|
62124
|
+
__nimbus.plugins.LdsObserverPlugin.logAdapterExecution({
|
|
62125
|
+
name: report.adapterName,
|
|
62126
|
+
serializedConfig: stringify$1$1(report.config),
|
|
62127
|
+
status: report.result,
|
|
62128
|
+
duration: report.executionTime,
|
|
62129
|
+
});
|
|
62130
|
+
});
|
|
62131
|
+
}
|
|
62132
|
+
}
|
|
62133
|
+
|
|
61999
62134
|
// so eslint doesn't complain about nimbus
|
|
62000
62135
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
62001
62136
|
/* global __nimbus */
|
|
@@ -62090,8 +62225,8 @@
|
|
|
62090
62225
|
lazyGetRecords = getRecordsAdapterFactory(lazyLuvio);
|
|
62091
62226
|
// Currently instruments store runtime perf
|
|
62092
62227
|
setupMobileInstrumentation();
|
|
62093
|
-
// If the
|
|
62094
|
-
|
|
62228
|
+
// If the observer nimbus plugin is configured, observation is enabled otherwise this is a no-op
|
|
62229
|
+
setupObserver();
|
|
62095
62230
|
// set storeEval function for lds-adapters-graghql to use
|
|
62096
62231
|
withRegistration('@salesforce/lds-adapters-graphql', (registration) => {
|
|
62097
62232
|
const { configuration: { setStoreEval, setDraftFunctions }, } = registration;
|
|
@@ -62114,7 +62249,7 @@
|
|
|
62114
62249
|
setDraftAwareGraphQLAdapter(
|
|
62115
62250
|
// return a draft aware graphql adapter here
|
|
62116
62251
|
draftAwareGraphQLAdapter);
|
|
62117
|
-
const environmentAwareGraphQLBatchAdapter = environmentAwareGraphQLBatchAdapterFactory(lazyObjectInfoService, lazyLuvio);
|
|
62252
|
+
const environmentAwareGraphQLBatchAdapter = environmentAwareGraphQLBatchAdapterFactory(lazyObjectInfoService, lazyLuvio, isGenerated);
|
|
62118
62253
|
setEnvironmentAwareGraphQLBatchAdapter(environmentAwareGraphQLBatchAdapter);
|
|
62119
62254
|
};
|
|
62120
62255
|
const draftAwareCreateContentDocumentAndVersionAdapter = createContentDocumentAndVersionDraftAdapterFactory(lazyLuvio, NimbusBinaryStore, contentDocumentCompositeActionHandler);
|
|
@@ -62161,7 +62296,7 @@
|
|
|
62161
62296
|
id: '@salesforce/lds-network-adapter',
|
|
62162
62297
|
instrument: instrument$2,
|
|
62163
62298
|
});
|
|
62164
|
-
// version: 1.
|
|
62299
|
+
// version: 1.284.0-a7e8dc51c
|
|
62165
62300
|
|
|
62166
62301
|
const { create: create$3, keys: keys$3 } = Object;
|
|
62167
62302
|
const { stringify: stringify$1, parse: parse$1 } = JSON;
|
|
@@ -81093,6 +81228,32 @@
|
|
|
81093
81228
|
* @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
|
|
81094
81229
|
*/
|
|
81095
81230
|
let trackedFieldLeafNodeIdAndNameOnly$1 = false;
|
|
81231
|
+
/**
|
|
81232
|
+
* One store enabled Get Object Info adapter
|
|
81233
|
+
*/
|
|
81234
|
+
let oneStoreGetObjectInfoAdapter$1 = undefined;
|
|
81235
|
+
/**
|
|
81236
|
+
* One store enabled Get Object Infos adapter
|
|
81237
|
+
*/
|
|
81238
|
+
let oneStoreGetObjectInfosAdapter$1 = undefined;
|
|
81239
|
+
/**
|
|
81240
|
+
* Defines the configuration API and is exposed internally as well as externally.
|
|
81241
|
+
* Configuration for one store enabled REST adapters only.
|
|
81242
|
+
*/
|
|
81243
|
+
const configurationForOneStoreEnabledAdapters$1 = {
|
|
81244
|
+
setGetObjectInfoAdapter: function (adapter) {
|
|
81245
|
+
oneStoreGetObjectInfoAdapter$1 = adapter;
|
|
81246
|
+
},
|
|
81247
|
+
getGetObjectInfoAdapter: function () {
|
|
81248
|
+
return oneStoreGetObjectInfoAdapter$1;
|
|
81249
|
+
},
|
|
81250
|
+
setGetObjectInfosAdapter: function (adapter) {
|
|
81251
|
+
oneStoreGetObjectInfosAdapter$1 = adapter;
|
|
81252
|
+
},
|
|
81253
|
+
getGetObjectInfosAdapter: function () {
|
|
81254
|
+
return oneStoreGetObjectInfosAdapter$1;
|
|
81255
|
+
},
|
|
81256
|
+
};
|
|
81096
81257
|
/**
|
|
81097
81258
|
* Defines the configuration API and is exposed internally as well as externally.
|
|
81098
81259
|
* Configuration for REST adapters only.
|
|
@@ -81157,6 +81318,7 @@
|
|
|
81157
81318
|
getDraftAwareCreateContentVersionAdapter: function () {
|
|
81158
81319
|
return draftAwareCreateContentVersionAdapter$1;
|
|
81159
81320
|
},
|
|
81321
|
+
...configurationForOneStoreEnabledAdapters$1,
|
|
81160
81322
|
};
|
|
81161
81323
|
/**
|
|
81162
81324
|
* Defines the configuration API and is exposed internally as well as externally.
|
|
@@ -81665,6 +81827,7 @@
|
|
|
81665
81827
|
// Wire Adapters
|
|
81666
81828
|
graphql: createGraphQLWireAdapterConstructor(luvio, graphql_ldsAdapter, graphqlMetadata, astResolver),
|
|
81667
81829
|
graphqlBatch: createGraphQLWireAdapterConstructor(luvio, graphqlBatch_ldsAdapter, graphqlBatchMetadata, astResolver),
|
|
81830
|
+
// One Store Enabled Adapters
|
|
81668
81831
|
// Imperative Adapters
|
|
81669
81832
|
graphql_imperative: createGraphQLImperativeAdapter(luvio, graphql_ldsAdapter, graphqlMetadata, astResolver),
|
|
81670
81833
|
graphqlBatch_imperative: createGraphQLImperativeAdapter(luvio, graphqlBatch_ldsAdapter, graphqlBatchMetadata, astResolver),
|
|
@@ -81786,15 +81949,17 @@
|
|
|
81786
81949
|
/**
|
|
81787
81950
|
* Returns the field API name, qualified with an object name if possible.
|
|
81788
81951
|
* @param value The value from which to get the qualified field API name.
|
|
81952
|
+
* @param onlyQualifiedFieldNames - Whether or not this function should skip fieldApiName that do not include the delimiter '.'
|
|
81789
81953
|
* @return The qualified field API name.
|
|
81790
81954
|
*/
|
|
81791
|
-
function getFieldApiName$1(value) {
|
|
81955
|
+
function getFieldApiName$1(value, onlyQualifiedFieldNames = false) {
|
|
81792
81956
|
// Note: tightening validation logic changes behavior from userland getting
|
|
81793
81957
|
// a server-provided error to the adapter noop'ing. In 224 we decided to not
|
|
81794
|
-
// change the behavior.
|
|
81958
|
+
// change the behavior. In 250 we decided to add the 'onlyQualifiedFieldName' flag to tighten the logic
|
|
81959
|
+
// optionally to avoid issues with persisted invalid field names.
|
|
81795
81960
|
if (isString$1(value)) {
|
|
81796
81961
|
const trimmed = value.trim();
|
|
81797
|
-
if (trimmed.length > 0) {
|
|
81962
|
+
if (trimmed.length > 0 && (onlyQualifiedFieldNames ? trimmed.indexOf('.') > -1 : true)) {
|
|
81798
81963
|
return trimmed;
|
|
81799
81964
|
}
|
|
81800
81965
|
}
|
|
@@ -81807,15 +81972,19 @@
|
|
|
81807
81972
|
/**
|
|
81808
81973
|
* Returns the field API name.
|
|
81809
81974
|
* @param value The value from which to get the field API name.
|
|
81975
|
+
* @param options Option bag. onlyQualifiedFieldNames is a boolean that allows this function to skip returning invalid FieldApiNames.
|
|
81810
81976
|
* @returns The field API name.
|
|
81811
81977
|
*/
|
|
81812
|
-
function getFieldApiNamesArray$1(value) {
|
|
81978
|
+
function getFieldApiNamesArray$1(value, options = { onlyQualifiedFieldNames: false }) {
|
|
81813
81979
|
const valueArray = isArray$2(value) ? value : [value];
|
|
81814
81980
|
const array = [];
|
|
81815
81981
|
for (let i = 0, len = valueArray.length; i < len; i += 1) {
|
|
81816
81982
|
const item = valueArray[i];
|
|
81817
|
-
const apiName = getFieldApiName$1(item);
|
|
81983
|
+
const apiName = getFieldApiName$1(item, options.onlyQualifiedFieldNames);
|
|
81818
81984
|
if (apiName === undefined) {
|
|
81985
|
+
if (options.onlyQualifiedFieldNames) {
|
|
81986
|
+
continue; // Just skips invalid field names rather than failing to return an array at all
|
|
81987
|
+
}
|
|
81819
81988
|
return undefined;
|
|
81820
81989
|
}
|
|
81821
81990
|
push$1.call(array, apiName);
|
|
@@ -82162,7 +82331,11 @@
|
|
|
82162
82331
|
})(DiscriminatorValues$6 || (DiscriminatorValues$6 = {}));
|
|
82163
82332
|
ensureRegisteredOnce$1({
|
|
82164
82333
|
id: '@salesforce/lds-adapters-uiapi',
|
|
82165
|
-
configuration: {
|
|
82334
|
+
configuration: {
|
|
82335
|
+
...configurationForRestAdapters$1,
|
|
82336
|
+
...configurationForGraphQLAdapters$1,
|
|
82337
|
+
...configurationForOneStoreEnabledAdapters$1,
|
|
82338
|
+
},
|
|
82166
82339
|
instrument: instrument$1,
|
|
82167
82340
|
});
|
|
82168
82341
|
|
|
@@ -82171,7 +82344,7 @@
|
|
|
82171
82344
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
82172
82345
|
instrument: instrument$1,
|
|
82173
82346
|
});
|
|
82174
|
-
// version: 1.
|
|
82347
|
+
// version: 1.284.0-8b78b708e
|
|
82175
82348
|
|
|
82176
82349
|
// On core the unstable adapters are re-exported with different names,
|
|
82177
82350
|
// we want to match them here.
|
|
@@ -84427,7 +84600,7 @@
|
|
|
84427
84600
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
84428
84601
|
graphQLImperative = ldsAdapter;
|
|
84429
84602
|
});
|
|
84430
|
-
// version: 1.
|
|
84603
|
+
// version: 1.284.0-8b78b708e
|
|
84431
84604
|
|
|
84432
84605
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
84433
84606
|
__proto__: null,
|
|
@@ -84729,72 +84902,75 @@
|
|
|
84729
84902
|
}
|
|
84730
84903
|
}
|
|
84731
84904
|
/**
|
|
84732
|
-
*
|
|
84733
|
-
*
|
|
84734
|
-
*
|
|
84905
|
+
* @deprecated There is no situation in which any consumer actually wants to replace the draft.
|
|
84906
|
+
* call {@link invokeAdapterWithDraftToMerge} instead`.
|
|
84907
|
+
* Keep it for now for app back compatibility.
|
|
84908
|
+
* Will be removed in future, ideally 2 releases later.
|
|
84909
|
+
*/
|
|
84910
|
+
function invokeAdapterWithDraftToReplace(adapterId, config, draftIdToReplace, onResponse, nativeAdapterRequestContext) {
|
|
84911
|
+
invokeAdapterWithDraftToMerge(adapterId, config, draftIdToReplace, onResponse, nativeAdapterRequestContext);
|
|
84912
|
+
}
|
|
84913
|
+
/**
|
|
84914
|
+
* Executes the specified adapter with the given @param dapterId and @param config. Then
|
|
84915
|
+
* it merge the draft with the given id with the draft generated by
|
|
84916
|
+
* the mutating adapter. Will call onResult callback once with data or error.
|
|
84735
84917
|
*
|
|
84736
84918
|
* This function throws an error if the given adapterId cannot be found, or if the
|
|
84737
|
-
* adapterId is not a mutating adapter
|
|
84738
|
-
* fails to parse the given config string.
|
|
84919
|
+
* adapterId is not a mutating adapter if a draft isn't created, or
|
|
84920
|
+
* if it fails to parse the given config string.
|
|
84921
|
+
*
|
|
84922
|
+
* If the @param adapterId is deleteRecod, the invocation of it will generate a delele draft.
|
|
84923
|
+
* The newly generated delete draft will replace the draft specified by @param targetDraftId
|
|
84739
84924
|
*/
|
|
84740
|
-
function
|
|
84925
|
+
function invokeAdapterWithDraftToMerge(adapterId, config, targetDraftId, onResponse, nativeAdapterRequestContext) {
|
|
84926
|
+
const adapter = getDMLAdapterFromName(adapterId);
|
|
84927
|
+
if (adapter === undefined) {
|
|
84928
|
+
// Check if the adapter is non-mutating adapter and create proper error message.
|
|
84929
|
+
const message = getImperativeAdapterFromName(imperativeAdapterKeyBuilder(adapterId)) !== undefined
|
|
84930
|
+
? NON_MUTATING_ADAPTER_MESSAGE
|
|
84931
|
+
: `adapter ${adapterId} not recognized`;
|
|
84932
|
+
onResponse({
|
|
84933
|
+
data: undefined,
|
|
84934
|
+
error: createNativeFetchErrorResponse(message),
|
|
84935
|
+
});
|
|
84936
|
+
return;
|
|
84937
|
+
}
|
|
84938
|
+
// deleteRecord adapter call will generate a delete draft and
|
|
84939
|
+
// the newly generate draft will replace the target draft
|
|
84940
|
+
if (adapterId === 'deleteRecord') {
|
|
84941
|
+
invokeAdapterWithDraftToMergeDeleteRecord(adapter, config, targetDraftId, onResponse, nativeAdapterRequestContext);
|
|
84942
|
+
return;
|
|
84943
|
+
}
|
|
84741
84944
|
draftManager.getQueue().then((draftInfo) => {
|
|
84742
84945
|
const draftIds = draftInfo.items.map((draft) => draft.id);
|
|
84743
|
-
if (draftIds.includes(
|
|
84946
|
+
if (draftIds.includes(targetDraftId) === false) {
|
|
84744
84947
|
onResponse({
|
|
84745
84948
|
data: undefined,
|
|
84746
84949
|
error: createNativeFetchErrorResponse(DRAFT_DOESNT_EXIST_MESSAGE),
|
|
84747
84950
|
});
|
|
84748
84951
|
return;
|
|
84749
84952
|
}
|
|
84750
|
-
|
|
84751
|
-
|
|
84752
|
-
|
|
84753
|
-
|
|
84754
|
-
|
|
84755
|
-
|
|
84756
|
-
|
|
84757
|
-
|
|
84953
|
+
invokeDmlAdapter(adapter, parse$1(config), (responseValue) => {
|
|
84954
|
+
const draftIds = draftIdsForResponseValue(responseValue);
|
|
84955
|
+
if (responseValue.error === undefined &&
|
|
84956
|
+
draftIds !== undefined &&
|
|
84957
|
+
draftIds.length > 0) {
|
|
84958
|
+
const draftId = draftIds[draftIds.length - 1];
|
|
84959
|
+
draftManager
|
|
84960
|
+
.mergeActions(targetDraftId, draftId)
|
|
84961
|
+
.then(() => {
|
|
84962
|
+
onResponse(responseValue);
|
|
84963
|
+
})
|
|
84964
|
+
.catch((error) => {
|
|
84965
|
+
onResponse(convertErrorIntoNativeFetchError(error, `Unknown error merging draft`));
|
|
84758
84966
|
});
|
|
84759
|
-
return;
|
|
84760
84967
|
}
|
|
84761
|
-
|
|
84762
|
-
|
|
84763
|
-
|
|
84764
|
-
|
|
84765
|
-
|
|
84766
|
-
|
|
84767
|
-
invokeDmlAdapter(adapter, parse$1(config), (responseValue) => {
|
|
84768
|
-
const draftIds = draftIdsForResponseValue(responseValue);
|
|
84769
|
-
if (responseValue.error === undefined &&
|
|
84770
|
-
draftIds !== undefined &&
|
|
84771
|
-
draftIds.length > 0) {
|
|
84772
|
-
const draftId = draftIds[draftIds.length - 1];
|
|
84773
|
-
draftManager
|
|
84774
|
-
.replaceAction(draftIdToReplace, draftId)
|
|
84775
|
-
.then(() => {
|
|
84776
|
-
onResponse(responseValue);
|
|
84777
|
-
})
|
|
84778
|
-
.catch((error) => {
|
|
84779
|
-
let message = 'Unknown error replacing draft';
|
|
84780
|
-
if (error instanceof Error) {
|
|
84781
|
-
message = error.message;
|
|
84782
|
-
}
|
|
84783
|
-
else if (typeof error === 'string') {
|
|
84784
|
-
message = error;
|
|
84785
|
-
}
|
|
84786
|
-
onResponse({
|
|
84787
|
-
error: createNativeFetchErrorResponse(message),
|
|
84788
|
-
});
|
|
84789
|
-
});
|
|
84790
|
-
}
|
|
84791
|
-
else {
|
|
84792
|
-
let response = responseValue;
|
|
84793
|
-
response.error = createNativeFetchErrorResponse(NO_DRAFT_CREATED_MESSAGE);
|
|
84794
|
-
onResponse(response);
|
|
84795
|
-
}
|
|
84796
|
-
}, nativeAdapterRequestContext);
|
|
84797
|
-
}
|
|
84968
|
+
else {
|
|
84969
|
+
let response = responseValue;
|
|
84970
|
+
response.error = createNativeFetchErrorResponse(NO_DRAFT_CREATED_MESSAGE);
|
|
84971
|
+
onResponse(response);
|
|
84972
|
+
}
|
|
84973
|
+
}, nativeAdapterRequestContext);
|
|
84798
84974
|
});
|
|
84799
84975
|
}
|
|
84800
84976
|
/**
|
|
@@ -84836,6 +85012,9 @@
|
|
|
84836
85012
|
.setMetadata(draftId, { ...existingMetadata, ...metadata })
|
|
84837
85013
|
.then(() => {
|
|
84838
85014
|
onResponse(responseValue);
|
|
85015
|
+
})
|
|
85016
|
+
.catch((error) => {
|
|
85017
|
+
onResponse(convertErrorIntoNativeFetchError(error, 'Unknown error setting metadata'));
|
|
84839
85018
|
});
|
|
84840
85019
|
}
|
|
84841
85020
|
else {
|
|
@@ -84878,8 +85057,13 @@
|
|
|
84878
85057
|
onResponse(response);
|
|
84879
85058
|
}
|
|
84880
85059
|
else {
|
|
84881
|
-
draftManager
|
|
85060
|
+
draftManager
|
|
85061
|
+
.setMetadata(addedDrafts[0].id, metadata)
|
|
85062
|
+
.then(() => {
|
|
84882
85063
|
onResponse(responseValue);
|
|
85064
|
+
})
|
|
85065
|
+
.catch((error) => {
|
|
85066
|
+
onResponse(convertErrorIntoNativeFetchError(error, 'Unknown error setting metadata'));
|
|
84883
85067
|
});
|
|
84884
85068
|
}
|
|
84885
85069
|
});
|
|
@@ -84894,11 +85078,11 @@
|
|
|
84894
85078
|
}
|
|
84895
85079
|
/*
|
|
84896
85080
|
//TODO W-10284305: Remove this function in 238
|
|
84897
|
-
This is a special case version of the
|
|
85081
|
+
This is a special case version of the invokeAdapterWithDraftToMerge function
|
|
84898
85082
|
which should only be used for the deleteRecord wire adapter, since it does not
|
|
84899
85083
|
contain record data in the result and has to do special querying of the draft queue
|
|
84900
85084
|
*/
|
|
84901
|
-
function
|
|
85085
|
+
function invokeAdapterWithDraftToMergeDeleteRecord(adapter, config, draftIdToReplace, onResponse, nativeAdapterRequestContext) {
|
|
84902
85086
|
const targetedRecordId = parse$1(config);
|
|
84903
85087
|
let priorDraftIds;
|
|
84904
85088
|
draftManager.getQueue().then((draftState) => {
|
|
@@ -84928,6 +85112,9 @@
|
|
|
84928
85112
|
.replaceAction(draftIdToReplace, addedDrafts[0].id)
|
|
84929
85113
|
.then(() => {
|
|
84930
85114
|
onResponse(responseValue);
|
|
85115
|
+
})
|
|
85116
|
+
.catch((error) => {
|
|
85117
|
+
onResponse(convertErrorIntoNativeFetchError(error, 'Unknown error replacing action'));
|
|
84931
85118
|
});
|
|
84932
85119
|
}
|
|
84933
85120
|
});
|
|
@@ -84940,6 +85127,18 @@
|
|
|
84940
85127
|
}, nativeAdapterRequestContext);
|
|
84941
85128
|
});
|
|
84942
85129
|
}
|
|
85130
|
+
function convertErrorIntoNativeFetchError(error, defaultMessage) {
|
|
85131
|
+
let message = defaultMessage;
|
|
85132
|
+
if (error instanceof Error) {
|
|
85133
|
+
message = error.message;
|
|
85134
|
+
}
|
|
85135
|
+
else if (typeof error === 'string') {
|
|
85136
|
+
message = error;
|
|
85137
|
+
}
|
|
85138
|
+
return {
|
|
85139
|
+
error: createNativeFetchErrorResponse(message),
|
|
85140
|
+
};
|
|
85141
|
+
}
|
|
84943
85142
|
function draftIdsForResponseValue(response) {
|
|
84944
85143
|
if (response.data !== undefined &&
|
|
84945
85144
|
response.data.drafts !== undefined &&
|
|
@@ -85139,7 +85338,7 @@
|
|
|
85139
85338
|
function register(r) {
|
|
85140
85339
|
callbacks$1.forEach((callback) => callback(r));
|
|
85141
85340
|
}
|
|
85142
|
-
// version: 1.
|
|
85341
|
+
// version: 1.284.0-a7e8dc51c
|
|
85143
85342
|
|
|
85144
85343
|
/**
|
|
85145
85344
|
* Returns true if the value acts like a Promise, i.e. has a "then" function,
|
|
@@ -89123,6 +89322,32 @@
|
|
|
89123
89322
|
* @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
|
|
89124
89323
|
*/
|
|
89125
89324
|
let trackedFieldLeafNodeIdAndNameOnly = false;
|
|
89325
|
+
/**
|
|
89326
|
+
* One store enabled Get Object Info adapter
|
|
89327
|
+
*/
|
|
89328
|
+
let oneStoreGetObjectInfoAdapter = undefined;
|
|
89329
|
+
/**
|
|
89330
|
+
* One store enabled Get Object Infos adapter
|
|
89331
|
+
*/
|
|
89332
|
+
let oneStoreGetObjectInfosAdapter = undefined;
|
|
89333
|
+
/**
|
|
89334
|
+
* Defines the configuration API and is exposed internally as well as externally.
|
|
89335
|
+
* Configuration for one store enabled REST adapters only.
|
|
89336
|
+
*/
|
|
89337
|
+
const configurationForOneStoreEnabledAdapters = {
|
|
89338
|
+
setGetObjectInfoAdapter: function (adapter) {
|
|
89339
|
+
oneStoreGetObjectInfoAdapter = adapter;
|
|
89340
|
+
},
|
|
89341
|
+
getGetObjectInfoAdapter: function () {
|
|
89342
|
+
return oneStoreGetObjectInfoAdapter;
|
|
89343
|
+
},
|
|
89344
|
+
setGetObjectInfosAdapter: function (adapter) {
|
|
89345
|
+
oneStoreGetObjectInfosAdapter = adapter;
|
|
89346
|
+
},
|
|
89347
|
+
getGetObjectInfosAdapter: function () {
|
|
89348
|
+
return oneStoreGetObjectInfosAdapter;
|
|
89349
|
+
},
|
|
89350
|
+
};
|
|
89126
89351
|
/**
|
|
89127
89352
|
* Defines the configuration API and is exposed internally as well as externally.
|
|
89128
89353
|
* Configuration for REST adapters only.
|
|
@@ -89187,6 +89412,7 @@
|
|
|
89187
89412
|
getDraftAwareCreateContentVersionAdapter: function () {
|
|
89188
89413
|
return draftAwareCreateContentVersionAdapter;
|
|
89189
89414
|
},
|
|
89415
|
+
...configurationForOneStoreEnabledAdapters,
|
|
89190
89416
|
};
|
|
89191
89417
|
/**
|
|
89192
89418
|
* Defines the configuration API and is exposed internally as well as externally.
|
|
@@ -89359,15 +89585,17 @@
|
|
|
89359
89585
|
/**
|
|
89360
89586
|
* Returns the field API name, qualified with an object name if possible.
|
|
89361
89587
|
* @param value The value from which to get the qualified field API name.
|
|
89588
|
+
* @param onlyQualifiedFieldNames - Whether or not this function should skip fieldApiName that do not include the delimiter '.'
|
|
89362
89589
|
* @return The qualified field API name.
|
|
89363
89590
|
*/
|
|
89364
|
-
function getFieldApiName(value) {
|
|
89591
|
+
function getFieldApiName(value, onlyQualifiedFieldNames = false) {
|
|
89365
89592
|
// Note: tightening validation logic changes behavior from userland getting
|
|
89366
89593
|
// a server-provided error to the adapter noop'ing. In 224 we decided to not
|
|
89367
|
-
// change the behavior.
|
|
89594
|
+
// change the behavior. In 250 we decided to add the 'onlyQualifiedFieldName' flag to tighten the logic
|
|
89595
|
+
// optionally to avoid issues with persisted invalid field names.
|
|
89368
89596
|
if (isString(value)) {
|
|
89369
89597
|
const trimmed = value.trim();
|
|
89370
|
-
if (trimmed.length > 0) {
|
|
89598
|
+
if (trimmed.length > 0 && (onlyQualifiedFieldNames ? trimmed.indexOf('.') > -1 : true)) {
|
|
89371
89599
|
return trimmed;
|
|
89372
89600
|
}
|
|
89373
89601
|
}
|
|
@@ -89380,15 +89608,19 @@
|
|
|
89380
89608
|
/**
|
|
89381
89609
|
* Returns the field API name.
|
|
89382
89610
|
* @param value The value from which to get the field API name.
|
|
89611
|
+
* @param options Option bag. onlyQualifiedFieldNames is a boolean that allows this function to skip returning invalid FieldApiNames.
|
|
89383
89612
|
* @returns The field API name.
|
|
89384
89613
|
*/
|
|
89385
|
-
function getFieldApiNamesArray(value) {
|
|
89614
|
+
function getFieldApiNamesArray(value, options = { onlyQualifiedFieldNames: false }) {
|
|
89386
89615
|
const valueArray = isArray(value) ? value : [value];
|
|
89387
89616
|
const array = [];
|
|
89388
89617
|
for (let i = 0, len = valueArray.length; i < len; i += 1) {
|
|
89389
89618
|
const item = valueArray[i];
|
|
89390
|
-
const apiName = getFieldApiName(item);
|
|
89619
|
+
const apiName = getFieldApiName(item, options.onlyQualifiedFieldNames);
|
|
89391
89620
|
if (apiName === undefined) {
|
|
89621
|
+
if (options.onlyQualifiedFieldNames) {
|
|
89622
|
+
continue; // Just skips invalid field names rather than failing to return an array at all
|
|
89623
|
+
}
|
|
89392
89624
|
return undefined;
|
|
89393
89625
|
}
|
|
89394
89626
|
push.call(array, apiName);
|
|
@@ -89737,7 +89969,11 @@
|
|
|
89737
89969
|
ObjectCreate$1(null);
|
|
89738
89970
|
ensureRegisteredOnce({
|
|
89739
89971
|
id: '@salesforce/lds-adapters-uiapi',
|
|
89740
|
-
configuration: {
|
|
89972
|
+
configuration: {
|
|
89973
|
+
...configurationForRestAdapters,
|
|
89974
|
+
...configurationForGraphQLAdapters,
|
|
89975
|
+
...configurationForOneStoreEnabledAdapters,
|
|
89976
|
+
},
|
|
89741
89977
|
instrument,
|
|
89742
89978
|
});
|
|
89743
89979
|
|
|
@@ -90062,6 +90298,7 @@
|
|
|
90062
90298
|
exports.executeMutatingAdapter = executeMutatingAdapter;
|
|
90063
90299
|
exports.getImperativeAdapterNames = getImperativeAdapterNames;
|
|
90064
90300
|
exports.invokeAdapter = invokeAdapter;
|
|
90301
|
+
exports.invokeAdapterWithDraftToMerge = invokeAdapterWithDraftToMerge;
|
|
90065
90302
|
exports.invokeAdapterWithDraftToReplace = invokeAdapterWithDraftToReplace;
|
|
90066
90303
|
exports.invokeAdapterWithMetadata = invokeAdapterWithMetadata;
|
|
90067
90304
|
exports.nimbusDraftQueue = nimbusDraftQueue;
|
|
@@ -90072,4 +90309,4 @@
|
|
|
90072
90309
|
exports.subscribeToAdapter = subscribeToAdapter;
|
|
90073
90310
|
|
|
90074
90311
|
}));
|
|
90075
|
-
// version: 1.
|
|
90312
|
+
// version: 1.284.0-a7e8dc51c
|