@salesforce/lds-worker-api 1.283.0 → 1.285.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 +60 -48
- 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 +333 -146
- 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 +333 -145
- package/dist/standalone/umd/types/executeAdapter.d.ts +16 -6
- package/dist/standalone/umd/types/main.d.ts +2 -2
- package/package.json +12 -12
|
@@ -4183,7 +4183,7 @@
|
|
|
4183
4183
|
}
|
|
4184
4184
|
callbacks.push(callback);
|
|
4185
4185
|
}
|
|
4186
|
-
// version: 1.
|
|
4186
|
+
// version: 1.285.0-67d4d6869
|
|
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.285.0-67d4d6869
|
|
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.285.0-67d4d6869
|
|
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)) {
|
|
@@ -39855,7 +39907,7 @@
|
|
|
39855
39907
|
buildCachedSnapshotCachePolicy$5, buildNetworkSnapshotCachePolicy$6);
|
|
39856
39908
|
};
|
|
39857
39909
|
|
|
39858
|
-
const TTL$5 = 200;
|
|
39910
|
+
const TTL$5$1 = 200;
|
|
39859
39911
|
const VERSION$7$1 = "3102453bf10ea449d9665914d5f5febf";
|
|
39860
39912
|
const RepresentationType$8 = 'KeywordSearchResultsSummaryRepresentation';
|
|
39861
39913
|
function keyBuilder$c$1(luvio, config) {
|
|
@@ -39888,7 +39940,7 @@
|
|
|
39888
39940
|
}
|
|
39889
39941
|
const ingest$3$1 = function KeywordSearchResultsSummaryRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
39890
39942
|
const key = keyBuilderFromType$5(luvio, input);
|
|
39891
|
-
const ttlToUse = TTL$5;
|
|
39943
|
+
const ttlToUse = TTL$5$1;
|
|
39892
39944
|
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "UiApi", VERSION$7$1, RepresentationType$8, equals$7);
|
|
39893
39945
|
return createLink$3(key);
|
|
39894
39946
|
};
|
|
@@ -39931,7 +39983,7 @@
|
|
|
39931
39983
|
const key = keyBuilder$b$1(luvio, params);
|
|
39932
39984
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
39933
39985
|
const storeMetadataParams = {
|
|
39934
|
-
ttl: TTL$5,
|
|
39986
|
+
ttl: TTL$5$1,
|
|
39935
39987
|
namespace: keyPrefix$2,
|
|
39936
39988
|
version: VERSION$7$1,
|
|
39937
39989
|
representationName: RepresentationType$8
|
|
@@ -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.285.0-c97dec82e
|
|
44103
44161
|
|
|
44104
44162
|
var ldsIdempotencyWriteDisabled = {
|
|
44105
44163
|
isOpen: function (e) {
|
|
@@ -49733,10 +49791,6 @@
|
|
|
49733
49791
|
switch (result) {
|
|
49734
49792
|
case ProcessActionResult.BLOCKED_ON_ERROR:
|
|
49735
49793
|
this.state = DraftQueueState.Error;
|
|
49736
|
-
await this.notifyChangedListeners({
|
|
49737
|
-
type: DraftQueueEventType.QueueStateChanged,
|
|
49738
|
-
state: this.state,
|
|
49739
|
-
});
|
|
49740
49794
|
return Promise.reject();
|
|
49741
49795
|
default:
|
|
49742
49796
|
return Promise.resolve();
|
|
@@ -49882,6 +49936,10 @@
|
|
|
49882
49936
|
if (status === DraftActionStatus.Error) {
|
|
49883
49937
|
this.state = DraftQueueState.Error;
|
|
49884
49938
|
this.processingAction = undefined;
|
|
49939
|
+
this.notifyChangedListeners({
|
|
49940
|
+
type: DraftQueueEventType.ActionFailed,
|
|
49941
|
+
action: action,
|
|
49942
|
+
});
|
|
49885
49943
|
return ProcessActionResult.BLOCKED_ON_ERROR;
|
|
49886
49944
|
}
|
|
49887
49945
|
if (id === this.uploadingActionId) {
|
|
@@ -55530,7 +55588,7 @@
|
|
|
55530
55588
|
* @param objectInfos
|
|
55531
55589
|
* @returns
|
|
55532
55590
|
*/
|
|
55533
|
-
function injectFieldsForDisplayValue(topNode,
|
|
55591
|
+
function injectFieldsForDisplayValue(topNode, apiName, objectInfos) {
|
|
55534
55592
|
const { selectionSet } = topNode;
|
|
55535
55593
|
if (selectionSet === undefined)
|
|
55536
55594
|
return [];
|
|
@@ -55544,13 +55602,8 @@
|
|
|
55544
55602
|
displayValue = node;
|
|
55545
55603
|
break;
|
|
55546
55604
|
}
|
|
55547
|
-
if (isInlineFragmentNode(node)) {
|
|
55548
|
-
const name = node.typeCondition !== undefined ? node.typeCondition.name : parentNode.name;
|
|
55549
|
-
displayValueNameFields = injectFieldsForDisplayValue(node, { ...parentNode, name }, objectInfos);
|
|
55550
|
-
}
|
|
55551
55605
|
}
|
|
55552
55606
|
if (displayValue !== undefined) {
|
|
55553
|
-
const apiName = parentNode.name.value;
|
|
55554
55607
|
const objectInfo = objectInfos[apiName];
|
|
55555
55608
|
if (objectInfo !== undefined &&
|
|
55556
55609
|
objectInfo.nameFields !== undefined &&
|
|
@@ -55617,19 +55670,24 @@
|
|
|
55617
55670
|
// example: TimeSheetId { value }
|
|
55618
55671
|
relatedIdForChildRelationship.push(createFieldNode(injectedParentFieldName, FieldValueNodeSelectionSet));
|
|
55619
55672
|
}
|
|
55620
|
-
displayValueNameFields.push(...injectFieldsForDisplayValue(parentNode,
|
|
55621
|
-
...parent,
|
|
55622
|
-
name: {
|
|
55623
|
-
...parent.name,
|
|
55624
|
-
value: targetRelationship.childObjectApiName,
|
|
55625
|
-
},
|
|
55626
|
-
}, objectInfos));
|
|
55673
|
+
displayValueNameFields.push(...injectFieldsForDisplayValue(parentNode, targetRelationship.childObjectApiName, objectInfos));
|
|
55627
55674
|
}
|
|
55628
55675
|
}
|
|
55629
55676
|
}
|
|
55630
|
-
|
|
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
|
+
}
|
|
55631
55685
|
}
|
|
55632
55686
|
}
|
|
55687
|
+
else if (isInlineFragmentNode(parentNode) && parentNode.typeCondition !== undefined) {
|
|
55688
|
+
const { typeCondition: { name: { value: apiName }, }, } = parentNode;
|
|
55689
|
+
displayValueNameFields.push(...injectFieldsForDisplayValue(parentNode, apiName, objectInfos));
|
|
55690
|
+
}
|
|
55633
55691
|
return [
|
|
55634
55692
|
...rootQueryIdField,
|
|
55635
55693
|
...flat(parentRelaltionships),
|
|
@@ -56948,6 +57006,21 @@
|
|
|
56948
57006
|
}
|
|
56949
57007
|
return fields;
|
|
56950
57008
|
}
|
|
57009
|
+
getRedirectMappings(action) {
|
|
57010
|
+
if (action.data.method === 'post' && action.response.status === 204) {
|
|
57011
|
+
return undefined;
|
|
57012
|
+
}
|
|
57013
|
+
return super.getRedirectMappings(action);
|
|
57014
|
+
}
|
|
57015
|
+
async handleActionCompleted(completedAction, queueOperations, allHandlers) {
|
|
57016
|
+
if (completedAction.response.status === 204 && completedAction.data.method === 'post') {
|
|
57017
|
+
// if we get a 204 it means the record creation was successful but we don't have the record to ingest
|
|
57018
|
+
// remove the synthesized draft and do not try to ingest the response
|
|
57019
|
+
await this.evictKey(completedAction.tag);
|
|
57020
|
+
return;
|
|
57021
|
+
}
|
|
57022
|
+
return super.handleActionCompleted(completedAction, queueOperations, allHandlers);
|
|
57023
|
+
}
|
|
56951
57024
|
async fetchReferenceRecord(referenceFields) {
|
|
56952
57025
|
const promises = referenceFields.map(async (referenceFieldInfo) => {
|
|
56953
57026
|
const apiName = await this.identifyApiName(referenceFieldInfo.id, referenceFieldInfo.field);
|
|
@@ -57314,6 +57387,9 @@
|
|
|
57314
57387
|
* Transforms a record for storage in the durable store. The transformation involves denormalizing
|
|
57315
57388
|
* scalar fields and persisting link metadata to transform back into a normalized representation
|
|
57316
57389
|
*
|
|
57390
|
+
* If the record contains pending fields this will return undefined as pending records do not get persisted
|
|
57391
|
+
* to the durable store. There should be a refresh operation outbound that will bring in the updated record.
|
|
57392
|
+
*
|
|
57317
57393
|
* @param normalizedRecord Record containing normalized field links
|
|
57318
57394
|
* @param recordStore a store containing referenced record fields
|
|
57319
57395
|
*/
|
|
@@ -57328,7 +57404,9 @@
|
|
|
57328
57404
|
// pending fields get filtered out of the durable store
|
|
57329
57405
|
const { pending } = field;
|
|
57330
57406
|
if (pending === true) {
|
|
57331
|
-
|
|
57407
|
+
// do not write records with pending fields to the durable store
|
|
57408
|
+
// there should be a refresh operation outbound that will bring in the updated record
|
|
57409
|
+
return undefined;
|
|
57332
57410
|
}
|
|
57333
57411
|
const { __ref } = field;
|
|
57334
57412
|
if (__ref !== undefined) {
|
|
@@ -57494,10 +57572,12 @@
|
|
|
57494
57572
|
};
|
|
57495
57573
|
}
|
|
57496
57574
|
const denormalizedRecord = buildDurableRecordRepresentation(record, storeRecords, recordEntries, store);
|
|
57497
|
-
|
|
57498
|
-
|
|
57499
|
-
|
|
57500
|
-
|
|
57575
|
+
if (denormalizedRecord !== undefined) {
|
|
57576
|
+
putEntries[recordKey] = {
|
|
57577
|
+
data: denormalizedRecord,
|
|
57578
|
+
metadata,
|
|
57579
|
+
};
|
|
57580
|
+
}
|
|
57501
57581
|
}
|
|
57502
57582
|
else {
|
|
57503
57583
|
putEntries[key] = value;
|
|
@@ -60548,11 +60628,17 @@
|
|
|
60548
60628
|
return this.getTable(segment).getAll(segment);
|
|
60549
60629
|
}
|
|
60550
60630
|
setEntries(entries, segment) {
|
|
60631
|
+
if (keys$9(entries).length === 0) {
|
|
60632
|
+
return Promise.resolve();
|
|
60633
|
+
}
|
|
60551
60634
|
const table = this.getTable(segment);
|
|
60552
60635
|
const upsertOperation = table.entriesToUpsertOperations(entries, segment);
|
|
60553
60636
|
return this.batchOperationAsPromise([upsertOperation]);
|
|
60554
60637
|
}
|
|
60555
60638
|
setMetadata(entries, segment) {
|
|
60639
|
+
if (keys$9(entries).length === 0) {
|
|
60640
|
+
return Promise.resolve();
|
|
60641
|
+
}
|
|
60556
60642
|
const table = this.getTable(segment);
|
|
60557
60643
|
let operation;
|
|
60558
60644
|
if (this.supportsBatchUpdates) {
|
|
@@ -60569,32 +60655,41 @@
|
|
|
60569
60655
|
batchOperations(operations) {
|
|
60570
60656
|
const sqliteOperations = operations.reduce((acc, cur) => {
|
|
60571
60657
|
if (cur.type === 'setEntries') {
|
|
60572
|
-
|
|
60573
|
-
|
|
60658
|
+
if (keys$9(cur.entries).length > 0) {
|
|
60659
|
+
const table = this.getTable(cur.segment);
|
|
60660
|
+
acc.push(table.entriesToUpsertOperations(cur.entries, cur.segment));
|
|
60661
|
+
}
|
|
60574
60662
|
}
|
|
60575
60663
|
else if (cur.type === 'setMetadata') {
|
|
60576
|
-
|
|
60577
|
-
|
|
60578
|
-
|
|
60579
|
-
|
|
60580
|
-
|
|
60581
|
-
|
|
60582
|
-
|
|
60583
|
-
|
|
60584
|
-
|
|
60585
|
-
|
|
60664
|
+
if (keys$9(cur.entries).length > 0) {
|
|
60665
|
+
const table = this.getTable(cur.segment);
|
|
60666
|
+
if (this.supportsBatchUpdates) {
|
|
60667
|
+
acc.push(table.metadataToUpdateOperations(cur.entries, cur.segment));
|
|
60668
|
+
}
|
|
60669
|
+
else {
|
|
60670
|
+
const upsert = table.entriesToUpsertOperations(cur.entries, cur.segment);
|
|
60671
|
+
// manually set the context type on the upsert so notifications do not notify rebuilds without
|
|
60672
|
+
// plugin updates
|
|
60673
|
+
upsert.context.type = 'setMetadata';
|
|
60674
|
+
acc.push(upsert);
|
|
60675
|
+
}
|
|
60586
60676
|
}
|
|
60587
60677
|
}
|
|
60588
60678
|
else {
|
|
60589
|
-
|
|
60679
|
+
if (cur.ids.length > 0) {
|
|
60680
|
+
acc.push(this.idsToDeleteOperation(cur.ids, cur.segment));
|
|
60681
|
+
}
|
|
60590
60682
|
}
|
|
60591
60683
|
return acc;
|
|
60592
60684
|
}, []);
|
|
60593
|
-
return
|
|
60685
|
+
return sqliteOperations.length === 0
|
|
60686
|
+
? Promise.resolve()
|
|
60687
|
+
: this.batchOperationAsPromise(sqliteOperations);
|
|
60594
60688
|
}
|
|
60595
60689
|
evictEntries(entryIds, segment) {
|
|
60596
|
-
|
|
60597
|
-
|
|
60690
|
+
return entryIds.length === 0
|
|
60691
|
+
? Promise.resolve()
|
|
60692
|
+
: this.batchOperationAsPromise([this.idsToDeleteOperation(entryIds, segment)]);
|
|
60598
60693
|
}
|
|
60599
60694
|
registerOnChangedListener(listener) {
|
|
60600
60695
|
let unsubscribeId = undefined;
|
|
@@ -60930,17 +61025,6 @@
|
|
|
60930
61025
|
},
|
|
60931
61026
|
};
|
|
60932
61027
|
|
|
60933
|
-
function setupInspection(luvio) {
|
|
60934
|
-
if (__nimbus.plugins.LdsInspectorPlugin !== undefined) {
|
|
60935
|
-
// when inspection is enabled, make luvio available as a global
|
|
60936
|
-
// eslint-disable-next-line no-undef
|
|
60937
|
-
globalThis.luvio = luvio;
|
|
60938
|
-
registerReportObserver((report) => {
|
|
60939
|
-
__nimbus.plugins.LdsInspectorPlugin.sendAdapterReport(stringify$1$1(report));
|
|
60940
|
-
});
|
|
60941
|
-
}
|
|
60942
|
-
}
|
|
60943
|
-
|
|
60944
61028
|
/**
|
|
60945
61029
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
60946
61030
|
* All rights reserved.
|
|
@@ -62062,6 +62146,21 @@
|
|
|
62062
62146
|
return instrumentPrimingSession(session);
|
|
62063
62147
|
}
|
|
62064
62148
|
|
|
62149
|
+
// so eslint doesn't complain about nimbus
|
|
62150
|
+
/* global __nimbus */
|
|
62151
|
+
function setupObserver() {
|
|
62152
|
+
if (__nimbus.plugins.LdsObserverPlugin !== undefined) {
|
|
62153
|
+
registerReportObserver((report) => {
|
|
62154
|
+
__nimbus.plugins.LdsObserverPlugin.logAdapterExecution({
|
|
62155
|
+
name: report.adapterName,
|
|
62156
|
+
serializedConfig: stringify$1$1(report.config),
|
|
62157
|
+
status: report.result,
|
|
62158
|
+
duration: report.executionTime,
|
|
62159
|
+
});
|
|
62160
|
+
});
|
|
62161
|
+
}
|
|
62162
|
+
}
|
|
62163
|
+
|
|
62065
62164
|
// so eslint doesn't complain about nimbus
|
|
62066
62165
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
62067
62166
|
/* global __nimbus */
|
|
@@ -62156,8 +62255,8 @@
|
|
|
62156
62255
|
lazyGetRecords = getRecordsAdapterFactory(lazyLuvio);
|
|
62157
62256
|
// Currently instruments store runtime perf
|
|
62158
62257
|
setupMobileInstrumentation();
|
|
62159
|
-
// If the
|
|
62160
|
-
|
|
62258
|
+
// If the observer nimbus plugin is configured, observation is enabled otherwise this is a no-op
|
|
62259
|
+
setupObserver();
|
|
62161
62260
|
// set storeEval function for lds-adapters-graghql to use
|
|
62162
62261
|
withRegistration('@salesforce/lds-adapters-graphql', (registration) => {
|
|
62163
62262
|
const { configuration: { setStoreEval, setDraftFunctions }, } = registration;
|
|
@@ -62227,7 +62326,7 @@
|
|
|
62227
62326
|
id: '@salesforce/lds-network-adapter',
|
|
62228
62327
|
instrument: instrument$2,
|
|
62229
62328
|
});
|
|
62230
|
-
// version: 1.
|
|
62329
|
+
// version: 1.285.0-67d4d6869
|
|
62231
62330
|
|
|
62232
62331
|
const { create: create$3, keys: keys$3 } = Object;
|
|
62233
62332
|
const { stringify: stringify$1, parse: parse$1 } = JSON;
|
|
@@ -69244,7 +69343,7 @@
|
|
|
69244
69343
|
}
|
|
69245
69344
|
|
|
69246
69345
|
const name$E = 'RecordConnection';
|
|
69247
|
-
const TTL$
|
|
69346
|
+
const TTL$5 = 300000;
|
|
69248
69347
|
const VERSION$N = '5109e37c62e492243c1e6ae3967b0655';
|
|
69249
69348
|
function keyBuilder$I(luvio, path, data) {
|
|
69250
69349
|
return path.fullPath;
|
|
@@ -69322,7 +69421,7 @@
|
|
|
69322
69421
|
createLink: createLink,
|
|
69323
69422
|
mergeData: mergeData$E,
|
|
69324
69423
|
storeMetadataParams: {
|
|
69325
|
-
ttl: TTL$
|
|
69424
|
+
ttl: TTL$5,
|
|
69326
69425
|
namespace: keyPrefix$1,
|
|
69327
69426
|
representationName: "RecordConnection",
|
|
69328
69427
|
version: VERSION$N,
|
|
@@ -76223,7 +76322,7 @@
|
|
|
76223
76322
|
}
|
|
76224
76323
|
|
|
76225
76324
|
const name$a = 'ObjectInfo';
|
|
76226
|
-
const TTL$
|
|
76325
|
+
const TTL$4 = 900000;
|
|
76227
76326
|
const VERSION$j = 'f8f627dd56d42a39e1a6642edb039182';
|
|
76228
76327
|
function keyBuilder$e(luvio, path, data) {
|
|
76229
76328
|
return path.fullPath;
|
|
@@ -76249,7 +76348,7 @@
|
|
|
76249
76348
|
createLink: createLink,
|
|
76250
76349
|
mergeData: mergeData$a,
|
|
76251
76350
|
storeMetadataParams: {
|
|
76252
|
-
ttl: TTL$
|
|
76351
|
+
ttl: TTL$4,
|
|
76253
76352
|
namespace: keyPrefix$1,
|
|
76254
76353
|
representationName: "ObjectInfo",
|
|
76255
76354
|
version: VERSION$j,
|
|
@@ -76939,7 +77038,7 @@
|
|
|
76939
77038
|
}
|
|
76940
77039
|
|
|
76941
77040
|
const name$7 = 'RelatedListInfo';
|
|
76942
|
-
const TTL$
|
|
77041
|
+
const TTL$3 = 900000;
|
|
76943
77042
|
const VERSION$g = 'a32cfdff7ca8dcf4b534b3491fef2019';
|
|
76944
77043
|
function keyBuilder$b(luvio, path, data) {
|
|
76945
77044
|
return path.fullPath;
|
|
@@ -76965,7 +77064,7 @@
|
|
|
76965
77064
|
createLink: createLink,
|
|
76966
77065
|
mergeData: mergeData$7,
|
|
76967
77066
|
storeMetadataParams: {
|
|
76968
|
-
ttl: TTL$
|
|
77067
|
+
ttl: TTL$3,
|
|
76969
77068
|
namespace: keyPrefix$1,
|
|
76970
77069
|
representationName: "RelatedListInfo",
|
|
76971
77070
|
version: VERSION$g,
|
|
@@ -78793,6 +78892,7 @@
|
|
|
78793
78892
|
}
|
|
78794
78893
|
|
|
78795
78894
|
const name$1 = 'Setup__Setup';
|
|
78895
|
+
const TTL$2 = 1000;
|
|
78796
78896
|
const VERSION$9 = '57c66c8147b44793116747c96b2b0fc9';
|
|
78797
78897
|
function keyBuilder$5(luvio, path, data) {
|
|
78798
78898
|
return path.fullPath;
|
|
@@ -78818,7 +78918,7 @@
|
|
|
78818
78918
|
createLink: createLink,
|
|
78819
78919
|
mergeData: mergeData$1,
|
|
78820
78920
|
storeMetadataParams: {
|
|
78821
|
-
ttl: TTL$
|
|
78921
|
+
ttl: TTL$2,
|
|
78822
78922
|
namespace: keyPrefix$1,
|
|
78823
78923
|
representationName: "Setup__Setup",
|
|
78824
78924
|
version: VERSION$9,
|
|
@@ -81159,6 +81259,32 @@
|
|
|
81159
81259
|
* @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
|
|
81160
81260
|
*/
|
|
81161
81261
|
let trackedFieldLeafNodeIdAndNameOnly$1 = false;
|
|
81262
|
+
/**
|
|
81263
|
+
* One store enabled Get Object Info adapter
|
|
81264
|
+
*/
|
|
81265
|
+
let oneStoreGetObjectInfoAdapter$1 = undefined;
|
|
81266
|
+
/**
|
|
81267
|
+
* One store enabled Get Object Infos adapter
|
|
81268
|
+
*/
|
|
81269
|
+
let oneStoreGetObjectInfosAdapter$1 = undefined;
|
|
81270
|
+
/**
|
|
81271
|
+
* Defines the configuration API and is exposed internally as well as externally.
|
|
81272
|
+
* Configuration for one store enabled REST adapters only.
|
|
81273
|
+
*/
|
|
81274
|
+
const configurationForOneStoreEnabledAdapters$1 = {
|
|
81275
|
+
setGetObjectInfoAdapter: function (adapter) {
|
|
81276
|
+
oneStoreGetObjectInfoAdapter$1 = adapter;
|
|
81277
|
+
},
|
|
81278
|
+
getGetObjectInfoAdapter: function () {
|
|
81279
|
+
return oneStoreGetObjectInfoAdapter$1;
|
|
81280
|
+
},
|
|
81281
|
+
setGetObjectInfosAdapter: function (adapter) {
|
|
81282
|
+
oneStoreGetObjectInfosAdapter$1 = adapter;
|
|
81283
|
+
},
|
|
81284
|
+
getGetObjectInfosAdapter: function () {
|
|
81285
|
+
return oneStoreGetObjectInfosAdapter$1;
|
|
81286
|
+
},
|
|
81287
|
+
};
|
|
81162
81288
|
/**
|
|
81163
81289
|
* Defines the configuration API and is exposed internally as well as externally.
|
|
81164
81290
|
* Configuration for REST adapters only.
|
|
@@ -81223,6 +81349,7 @@
|
|
|
81223
81349
|
getDraftAwareCreateContentVersionAdapter: function () {
|
|
81224
81350
|
return draftAwareCreateContentVersionAdapter$1;
|
|
81225
81351
|
},
|
|
81352
|
+
...configurationForOneStoreEnabledAdapters$1,
|
|
81226
81353
|
};
|
|
81227
81354
|
/**
|
|
81228
81355
|
* Defines the configuration API and is exposed internally as well as externally.
|
|
@@ -81731,6 +81858,7 @@
|
|
|
81731
81858
|
// Wire Adapters
|
|
81732
81859
|
graphql: createGraphQLWireAdapterConstructor(luvio, graphql_ldsAdapter, graphqlMetadata, astResolver),
|
|
81733
81860
|
graphqlBatch: createGraphQLWireAdapterConstructor(luvio, graphqlBatch_ldsAdapter, graphqlBatchMetadata, astResolver),
|
|
81861
|
+
// One Store Enabled Adapters
|
|
81734
81862
|
// Imperative Adapters
|
|
81735
81863
|
graphql_imperative: createGraphQLImperativeAdapter(luvio, graphql_ldsAdapter, graphqlMetadata, astResolver),
|
|
81736
81864
|
graphqlBatch_imperative: createGraphQLImperativeAdapter(luvio, graphqlBatch_ldsAdapter, graphqlBatchMetadata, astResolver),
|
|
@@ -81852,15 +81980,17 @@
|
|
|
81852
81980
|
/**
|
|
81853
81981
|
* Returns the field API name, qualified with an object name if possible.
|
|
81854
81982
|
* @param value The value from which to get the qualified field API name.
|
|
81983
|
+
* @param onlyQualifiedFieldNames - Whether or not this function should skip fieldApiName that do not include the delimiter '.'
|
|
81855
81984
|
* @return The qualified field API name.
|
|
81856
81985
|
*/
|
|
81857
|
-
function getFieldApiName$1(value) {
|
|
81986
|
+
function getFieldApiName$1(value, onlyQualifiedFieldNames = false) {
|
|
81858
81987
|
// Note: tightening validation logic changes behavior from userland getting
|
|
81859
81988
|
// a server-provided error to the adapter noop'ing. In 224 we decided to not
|
|
81860
|
-
// change the behavior.
|
|
81989
|
+
// change the behavior. In 250 we decided to add the 'onlyQualifiedFieldName' flag to tighten the logic
|
|
81990
|
+
// optionally to avoid issues with persisted invalid field names.
|
|
81861
81991
|
if (isString$1(value)) {
|
|
81862
81992
|
const trimmed = value.trim();
|
|
81863
|
-
if (trimmed.length > 0) {
|
|
81993
|
+
if (trimmed.length > 0 && (onlyQualifiedFieldNames ? trimmed.indexOf('.') > -1 : true)) {
|
|
81864
81994
|
return trimmed;
|
|
81865
81995
|
}
|
|
81866
81996
|
}
|
|
@@ -81873,15 +82003,19 @@
|
|
|
81873
82003
|
/**
|
|
81874
82004
|
* Returns the field API name.
|
|
81875
82005
|
* @param value The value from which to get the field API name.
|
|
82006
|
+
* @param options Option bag. onlyQualifiedFieldNames is a boolean that allows this function to skip returning invalid FieldApiNames.
|
|
81876
82007
|
* @returns The field API name.
|
|
81877
82008
|
*/
|
|
81878
|
-
function getFieldApiNamesArray$1(value) {
|
|
82009
|
+
function getFieldApiNamesArray$1(value, options = { onlyQualifiedFieldNames: false }) {
|
|
81879
82010
|
const valueArray = isArray$2(value) ? value : [value];
|
|
81880
82011
|
const array = [];
|
|
81881
82012
|
for (let i = 0, len = valueArray.length; i < len; i += 1) {
|
|
81882
82013
|
const item = valueArray[i];
|
|
81883
|
-
const apiName = getFieldApiName$1(item);
|
|
82014
|
+
const apiName = getFieldApiName$1(item, options.onlyQualifiedFieldNames);
|
|
81884
82015
|
if (apiName === undefined) {
|
|
82016
|
+
if (options.onlyQualifiedFieldNames) {
|
|
82017
|
+
continue; // Just skips invalid field names rather than failing to return an array at all
|
|
82018
|
+
}
|
|
81885
82019
|
return undefined;
|
|
81886
82020
|
}
|
|
81887
82021
|
push$1.call(array, apiName);
|
|
@@ -82228,7 +82362,11 @@
|
|
|
82228
82362
|
})(DiscriminatorValues$6 || (DiscriminatorValues$6 = {}));
|
|
82229
82363
|
ensureRegisteredOnce$1({
|
|
82230
82364
|
id: '@salesforce/lds-adapters-uiapi',
|
|
82231
|
-
configuration: {
|
|
82365
|
+
configuration: {
|
|
82366
|
+
...configurationForRestAdapters$1,
|
|
82367
|
+
...configurationForGraphQLAdapters$1,
|
|
82368
|
+
...configurationForOneStoreEnabledAdapters$1,
|
|
82369
|
+
},
|
|
82232
82370
|
instrument: instrument$1,
|
|
82233
82371
|
});
|
|
82234
82372
|
|
|
@@ -82237,7 +82375,7 @@
|
|
|
82237
82375
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
82238
82376
|
instrument: instrument$1,
|
|
82239
82377
|
});
|
|
82240
|
-
// version: 1.
|
|
82378
|
+
// version: 1.285.0-c97dec82e
|
|
82241
82379
|
|
|
82242
82380
|
// On core the unstable adapters are re-exported with different names,
|
|
82243
82381
|
// we want to match them here.
|
|
@@ -84493,7 +84631,7 @@
|
|
|
84493
84631
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
84494
84632
|
graphQLImperative = ldsAdapter;
|
|
84495
84633
|
});
|
|
84496
|
-
// version: 1.
|
|
84634
|
+
// version: 1.285.0-c97dec82e
|
|
84497
84635
|
|
|
84498
84636
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
84499
84637
|
__proto__: null,
|
|
@@ -84795,63 +84933,75 @@
|
|
|
84795
84933
|
}
|
|
84796
84934
|
}
|
|
84797
84935
|
/**
|
|
84798
|
-
*
|
|
84799
|
-
*
|
|
84800
|
-
*
|
|
84936
|
+
* @deprecated There is no situation in which any consumer actually wants to replace the draft.
|
|
84937
|
+
* call {@link invokeAdapterWithDraftToMerge} instead`.
|
|
84938
|
+
* Keep it for now for app back compatibility.
|
|
84939
|
+
* Will be removed in future, ideally 2 releases later.
|
|
84940
|
+
*/
|
|
84941
|
+
function invokeAdapterWithDraftToReplace(adapterId, config, draftIdToReplace, onResponse, nativeAdapterRequestContext) {
|
|
84942
|
+
invokeAdapterWithDraftToMerge(adapterId, config, draftIdToReplace, onResponse, nativeAdapterRequestContext);
|
|
84943
|
+
}
|
|
84944
|
+
/**
|
|
84945
|
+
* Executes the specified adapter with the given @param dapterId and @param config. Then
|
|
84946
|
+
* it merge the draft with the given id with the draft generated by
|
|
84947
|
+
* the mutating adapter. Will call onResult callback once with data or error.
|
|
84801
84948
|
*
|
|
84802
84949
|
* This function throws an error if the given adapterId cannot be found, or if the
|
|
84803
|
-
* adapterId is not a mutating adapter
|
|
84804
|
-
* fails to parse the given config string.
|
|
84950
|
+
* adapterId is not a mutating adapter if a draft isn't created, or
|
|
84951
|
+
* if it fails to parse the given config string.
|
|
84952
|
+
*
|
|
84953
|
+
* If the @param adapterId is deleteRecod, the invocation of it will generate a delele draft.
|
|
84954
|
+
* The newly generated delete draft will replace the draft specified by @param targetDraftId
|
|
84805
84955
|
*/
|
|
84806
|
-
function
|
|
84956
|
+
function invokeAdapterWithDraftToMerge(adapterId, config, targetDraftId, onResponse, nativeAdapterRequestContext) {
|
|
84957
|
+
const adapter = getDMLAdapterFromName(adapterId);
|
|
84958
|
+
if (adapter === undefined) {
|
|
84959
|
+
// Check if the adapter is non-mutating adapter and create proper error message.
|
|
84960
|
+
const message = getImperativeAdapterFromName(imperativeAdapterKeyBuilder(adapterId)) !== undefined
|
|
84961
|
+
? NON_MUTATING_ADAPTER_MESSAGE
|
|
84962
|
+
: `adapter ${adapterId} not recognized`;
|
|
84963
|
+
onResponse({
|
|
84964
|
+
data: undefined,
|
|
84965
|
+
error: createNativeFetchErrorResponse(message),
|
|
84966
|
+
});
|
|
84967
|
+
return;
|
|
84968
|
+
}
|
|
84969
|
+
// deleteRecord adapter call will generate a delete draft and
|
|
84970
|
+
// the newly generate draft will replace the target draft
|
|
84971
|
+
if (adapterId === 'deleteRecord') {
|
|
84972
|
+
invokeAdapterWithDraftToMergeDeleteRecord(adapter, config, targetDraftId, onResponse, nativeAdapterRequestContext);
|
|
84973
|
+
return;
|
|
84974
|
+
}
|
|
84807
84975
|
draftManager.getQueue().then((draftInfo) => {
|
|
84808
84976
|
const draftIds = draftInfo.items.map((draft) => draft.id);
|
|
84809
|
-
if (draftIds.includes(
|
|
84977
|
+
if (draftIds.includes(targetDraftId) === false) {
|
|
84810
84978
|
onResponse({
|
|
84811
84979
|
data: undefined,
|
|
84812
84980
|
error: createNativeFetchErrorResponse(DRAFT_DOESNT_EXIST_MESSAGE),
|
|
84813
84981
|
});
|
|
84814
84982
|
return;
|
|
84815
84983
|
}
|
|
84816
|
-
|
|
84817
|
-
|
|
84818
|
-
|
|
84819
|
-
|
|
84820
|
-
|
|
84821
|
-
|
|
84822
|
-
|
|
84823
|
-
|
|
84984
|
+
invokeDmlAdapter(adapter, parse$1(config), (responseValue) => {
|
|
84985
|
+
const draftIds = draftIdsForResponseValue(responseValue);
|
|
84986
|
+
if (responseValue.error === undefined &&
|
|
84987
|
+
draftIds !== undefined &&
|
|
84988
|
+
draftIds.length > 0) {
|
|
84989
|
+
const draftId = draftIds[draftIds.length - 1];
|
|
84990
|
+
draftManager
|
|
84991
|
+
.mergeActions(targetDraftId, draftId)
|
|
84992
|
+
.then(() => {
|
|
84993
|
+
onResponse(responseValue);
|
|
84994
|
+
})
|
|
84995
|
+
.catch((error) => {
|
|
84996
|
+
onResponse(convertErrorIntoNativeFetchError(error, `Unknown error merging draft`));
|
|
84824
84997
|
});
|
|
84825
|
-
return;
|
|
84826
84998
|
}
|
|
84827
|
-
|
|
84828
|
-
|
|
84829
|
-
|
|
84830
|
-
|
|
84831
|
-
|
|
84832
|
-
|
|
84833
|
-
invokeDmlAdapter(adapter, parse$1(config), (responseValue) => {
|
|
84834
|
-
const draftIds = draftIdsForResponseValue(responseValue);
|
|
84835
|
-
if (responseValue.error === undefined &&
|
|
84836
|
-
draftIds !== undefined &&
|
|
84837
|
-
draftIds.length > 0) {
|
|
84838
|
-
const draftId = draftIds[draftIds.length - 1];
|
|
84839
|
-
draftManager
|
|
84840
|
-
.replaceAction(draftIdToReplace, draftId)
|
|
84841
|
-
.then(() => {
|
|
84842
|
-
onResponse(responseValue);
|
|
84843
|
-
})
|
|
84844
|
-
.catch((error) => {
|
|
84845
|
-
onResponse(convertErrorIntoNativeFetchError(error, 'Unknown error replacing draft'));
|
|
84846
|
-
});
|
|
84847
|
-
}
|
|
84848
|
-
else {
|
|
84849
|
-
let response = responseValue;
|
|
84850
|
-
response.error = createNativeFetchErrorResponse(NO_DRAFT_CREATED_MESSAGE);
|
|
84851
|
-
onResponse(response);
|
|
84852
|
-
}
|
|
84853
|
-
}, nativeAdapterRequestContext);
|
|
84854
|
-
}
|
|
84999
|
+
else {
|
|
85000
|
+
let response = responseValue;
|
|
85001
|
+
response.error = createNativeFetchErrorResponse(NO_DRAFT_CREATED_MESSAGE);
|
|
85002
|
+
onResponse(response);
|
|
85003
|
+
}
|
|
85004
|
+
}, nativeAdapterRequestContext);
|
|
84855
85005
|
});
|
|
84856
85006
|
}
|
|
84857
85007
|
/**
|
|
@@ -84959,11 +85109,11 @@
|
|
|
84959
85109
|
}
|
|
84960
85110
|
/*
|
|
84961
85111
|
//TODO W-10284305: Remove this function in 238
|
|
84962
|
-
This is a special case version of the
|
|
85112
|
+
This is a special case version of the invokeAdapterWithDraftToMerge function
|
|
84963
85113
|
which should only be used for the deleteRecord wire adapter, since it does not
|
|
84964
85114
|
contain record data in the result and has to do special querying of the draft queue
|
|
84965
85115
|
*/
|
|
84966
|
-
function
|
|
85116
|
+
function invokeAdapterWithDraftToMergeDeleteRecord(adapter, config, draftIdToReplace, onResponse, nativeAdapterRequestContext) {
|
|
84967
85117
|
const targetedRecordId = parse$1(config);
|
|
84968
85118
|
let priorDraftIds;
|
|
84969
85119
|
draftManager.getQueue().then((draftState) => {
|
|
@@ -85219,7 +85369,7 @@
|
|
|
85219
85369
|
function register(r) {
|
|
85220
85370
|
callbacks$1.forEach((callback) => callback(r));
|
|
85221
85371
|
}
|
|
85222
|
-
// version: 1.
|
|
85372
|
+
// version: 1.285.0-67d4d6869
|
|
85223
85373
|
|
|
85224
85374
|
/**
|
|
85225
85375
|
* Returns true if the value acts like a Promise, i.e. has a "then" function,
|
|
@@ -89203,6 +89353,32 @@
|
|
|
89203
89353
|
* @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
|
|
89204
89354
|
*/
|
|
89205
89355
|
let trackedFieldLeafNodeIdAndNameOnly = false;
|
|
89356
|
+
/**
|
|
89357
|
+
* One store enabled Get Object Info adapter
|
|
89358
|
+
*/
|
|
89359
|
+
let oneStoreGetObjectInfoAdapter = undefined;
|
|
89360
|
+
/**
|
|
89361
|
+
* One store enabled Get Object Infos adapter
|
|
89362
|
+
*/
|
|
89363
|
+
let oneStoreGetObjectInfosAdapter = undefined;
|
|
89364
|
+
/**
|
|
89365
|
+
* Defines the configuration API and is exposed internally as well as externally.
|
|
89366
|
+
* Configuration for one store enabled REST adapters only.
|
|
89367
|
+
*/
|
|
89368
|
+
const configurationForOneStoreEnabledAdapters = {
|
|
89369
|
+
setGetObjectInfoAdapter: function (adapter) {
|
|
89370
|
+
oneStoreGetObjectInfoAdapter = adapter;
|
|
89371
|
+
},
|
|
89372
|
+
getGetObjectInfoAdapter: function () {
|
|
89373
|
+
return oneStoreGetObjectInfoAdapter;
|
|
89374
|
+
},
|
|
89375
|
+
setGetObjectInfosAdapter: function (adapter) {
|
|
89376
|
+
oneStoreGetObjectInfosAdapter = adapter;
|
|
89377
|
+
},
|
|
89378
|
+
getGetObjectInfosAdapter: function () {
|
|
89379
|
+
return oneStoreGetObjectInfosAdapter;
|
|
89380
|
+
},
|
|
89381
|
+
};
|
|
89206
89382
|
/**
|
|
89207
89383
|
* Defines the configuration API and is exposed internally as well as externally.
|
|
89208
89384
|
* Configuration for REST adapters only.
|
|
@@ -89267,6 +89443,7 @@
|
|
|
89267
89443
|
getDraftAwareCreateContentVersionAdapter: function () {
|
|
89268
89444
|
return draftAwareCreateContentVersionAdapter;
|
|
89269
89445
|
},
|
|
89446
|
+
...configurationForOneStoreEnabledAdapters,
|
|
89270
89447
|
};
|
|
89271
89448
|
/**
|
|
89272
89449
|
* Defines the configuration API and is exposed internally as well as externally.
|
|
@@ -89439,15 +89616,17 @@
|
|
|
89439
89616
|
/**
|
|
89440
89617
|
* Returns the field API name, qualified with an object name if possible.
|
|
89441
89618
|
* @param value The value from which to get the qualified field API name.
|
|
89619
|
+
* @param onlyQualifiedFieldNames - Whether or not this function should skip fieldApiName that do not include the delimiter '.'
|
|
89442
89620
|
* @return The qualified field API name.
|
|
89443
89621
|
*/
|
|
89444
|
-
function getFieldApiName(value) {
|
|
89622
|
+
function getFieldApiName(value, onlyQualifiedFieldNames = false) {
|
|
89445
89623
|
// Note: tightening validation logic changes behavior from userland getting
|
|
89446
89624
|
// a server-provided error to the adapter noop'ing. In 224 we decided to not
|
|
89447
|
-
// change the behavior.
|
|
89625
|
+
// change the behavior. In 250 we decided to add the 'onlyQualifiedFieldName' flag to tighten the logic
|
|
89626
|
+
// optionally to avoid issues with persisted invalid field names.
|
|
89448
89627
|
if (isString(value)) {
|
|
89449
89628
|
const trimmed = value.trim();
|
|
89450
|
-
if (trimmed.length > 0) {
|
|
89629
|
+
if (trimmed.length > 0 && (onlyQualifiedFieldNames ? trimmed.indexOf('.') > -1 : true)) {
|
|
89451
89630
|
return trimmed;
|
|
89452
89631
|
}
|
|
89453
89632
|
}
|
|
@@ -89460,15 +89639,19 @@
|
|
|
89460
89639
|
/**
|
|
89461
89640
|
* Returns the field API name.
|
|
89462
89641
|
* @param value The value from which to get the field API name.
|
|
89642
|
+
* @param options Option bag. onlyQualifiedFieldNames is a boolean that allows this function to skip returning invalid FieldApiNames.
|
|
89463
89643
|
* @returns The field API name.
|
|
89464
89644
|
*/
|
|
89465
|
-
function getFieldApiNamesArray(value) {
|
|
89645
|
+
function getFieldApiNamesArray(value, options = { onlyQualifiedFieldNames: false }) {
|
|
89466
89646
|
const valueArray = isArray(value) ? value : [value];
|
|
89467
89647
|
const array = [];
|
|
89468
89648
|
for (let i = 0, len = valueArray.length; i < len; i += 1) {
|
|
89469
89649
|
const item = valueArray[i];
|
|
89470
|
-
const apiName = getFieldApiName(item);
|
|
89650
|
+
const apiName = getFieldApiName(item, options.onlyQualifiedFieldNames);
|
|
89471
89651
|
if (apiName === undefined) {
|
|
89652
|
+
if (options.onlyQualifiedFieldNames) {
|
|
89653
|
+
continue; // Just skips invalid field names rather than failing to return an array at all
|
|
89654
|
+
}
|
|
89472
89655
|
return undefined;
|
|
89473
89656
|
}
|
|
89474
89657
|
push.call(array, apiName);
|
|
@@ -89817,7 +90000,11 @@
|
|
|
89817
90000
|
ObjectCreate$1(null);
|
|
89818
90001
|
ensureRegisteredOnce({
|
|
89819
90002
|
id: '@salesforce/lds-adapters-uiapi',
|
|
89820
|
-
configuration: {
|
|
90003
|
+
configuration: {
|
|
90004
|
+
...configurationForRestAdapters,
|
|
90005
|
+
...configurationForGraphQLAdapters,
|
|
90006
|
+
...configurationForOneStoreEnabledAdapters,
|
|
90007
|
+
},
|
|
89821
90008
|
instrument,
|
|
89822
90009
|
});
|
|
89823
90010
|
|
|
@@ -90142,6 +90329,7 @@
|
|
|
90142
90329
|
exports.executeMutatingAdapter = executeMutatingAdapter;
|
|
90143
90330
|
exports.getImperativeAdapterNames = getImperativeAdapterNames;
|
|
90144
90331
|
exports.invokeAdapter = invokeAdapter;
|
|
90332
|
+
exports.invokeAdapterWithDraftToMerge = invokeAdapterWithDraftToMerge;
|
|
90145
90333
|
exports.invokeAdapterWithDraftToReplace = invokeAdapterWithDraftToReplace;
|
|
90146
90334
|
exports.invokeAdapterWithMetadata = invokeAdapterWithMetadata;
|
|
90147
90335
|
exports.nimbusDraftQueue = nimbusDraftQueue;
|
|
@@ -90152,4 +90340,4 @@
|
|
|
90152
90340
|
exports.subscribeToAdapter = subscribeToAdapter;
|
|
90153
90341
|
|
|
90154
90342
|
}));
|
|
90155
|
-
// version: 1.
|
|
90343
|
+
// version: 1.285.0-67d4d6869
|