@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
|
@@ -4177,7 +4177,7 @@ function withDefaultLuvio(callback) {
|
|
|
4177
4177
|
}
|
|
4178
4178
|
callbacks.push(callback);
|
|
4179
4179
|
}
|
|
4180
|
-
// version: 1.
|
|
4180
|
+
// version: 1.285.0-67d4d6869
|
|
4181
4181
|
|
|
4182
4182
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
4183
4183
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -15685,7 +15685,7 @@ function gql(literals, ...subs) {
|
|
|
15685
15685
|
}
|
|
15686
15686
|
return superResult;
|
|
15687
15687
|
}
|
|
15688
|
-
// version: 1.
|
|
15688
|
+
// version: 1.285.0-67d4d6869
|
|
15689
15689
|
|
|
15690
15690
|
function unwrap(data) {
|
|
15691
15691
|
// The lwc-luvio bindings import a function from lwc called "unwrap".
|
|
@@ -16610,7 +16610,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
|
|
|
16610
16610
|
const { apiFamily, name } = metadata;
|
|
16611
16611
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
16612
16612
|
}
|
|
16613
|
-
// version: 1.
|
|
16613
|
+
// version: 1.285.0-67d4d6869
|
|
16614
16614
|
|
|
16615
16615
|
/**
|
|
16616
16616
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -16823,6 +16823,41 @@ let trackedFieldDepthOnNotifyChange$2 = 5;
|
|
|
16823
16823
|
* @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
|
|
16824
16824
|
*/
|
|
16825
16825
|
let trackedFieldLeafNodeIdAndNameOnly$2 = false;
|
|
16826
|
+
/**
|
|
16827
|
+
* One store enabled Get Object Info adapter
|
|
16828
|
+
*/
|
|
16829
|
+
let oneStoreGetObjectInfoAdapter$2 = undefined;
|
|
16830
|
+
/**
|
|
16831
|
+
* One store enabled Get Object Infos adapter
|
|
16832
|
+
*/
|
|
16833
|
+
let oneStoreGetObjectInfosAdapter$2 = undefined;
|
|
16834
|
+
/**
|
|
16835
|
+
* Defines the configuration API and is exposed internally as well as externally.
|
|
16836
|
+
* Configuration for one store enabled REST adapters only.
|
|
16837
|
+
*/
|
|
16838
|
+
const configurationForOneStoreEnabledAdapters$2 = {
|
|
16839
|
+
setGetObjectInfoAdapter: function (adapter) {
|
|
16840
|
+
oneStoreGetObjectInfoAdapter$2 = adapter;
|
|
16841
|
+
},
|
|
16842
|
+
getGetObjectInfoAdapter: function () {
|
|
16843
|
+
return oneStoreGetObjectInfoAdapter$2;
|
|
16844
|
+
},
|
|
16845
|
+
setGetObjectInfosAdapter: function (adapter) {
|
|
16846
|
+
oneStoreGetObjectInfosAdapter$2 = adapter;
|
|
16847
|
+
},
|
|
16848
|
+
getGetObjectInfosAdapter: function () {
|
|
16849
|
+
return oneStoreGetObjectInfosAdapter$2;
|
|
16850
|
+
},
|
|
16851
|
+
};
|
|
16852
|
+
/**
|
|
16853
|
+
* Helper function to return the one store adapter if it's defined, otherwise return the luvio adapter.
|
|
16854
|
+
* @param luvioAdapter - The luvio bound adapter.
|
|
16855
|
+
* @param oneStoreAdapter - The one store bound adapter.
|
|
16856
|
+
* @returns Luvio or one store wire adapter constructor.
|
|
16857
|
+
*/
|
|
16858
|
+
function getLuvioOrOneStoreAdapter(luvioAdapter, oneStoreAdapter) {
|
|
16859
|
+
return oneStoreAdapter !== null && oneStoreAdapter !== void 0 ? oneStoreAdapter : luvioAdapter;
|
|
16860
|
+
}
|
|
16826
16861
|
/**
|
|
16827
16862
|
* Defines the configuration API and is exposed internally as well as externally.
|
|
16828
16863
|
* Configuration for REST adapters only.
|
|
@@ -16887,6 +16922,7 @@ const configurationForRestAdapters$2 = {
|
|
|
16887
16922
|
getDraftAwareCreateContentVersionAdapter: function () {
|
|
16888
16923
|
return draftAwareCreateContentVersionAdapter$2;
|
|
16889
16924
|
},
|
|
16925
|
+
...configurationForOneStoreEnabledAdapters$2,
|
|
16890
16926
|
};
|
|
16891
16927
|
/**
|
|
16892
16928
|
* Defines the configuration API and is exposed internally as well as externally.
|
|
@@ -17243,15 +17279,17 @@ function splitQualifiedFieldApiName(fieldApiName) {
|
|
|
17243
17279
|
/**
|
|
17244
17280
|
* Returns the field API name, qualified with an object name if possible.
|
|
17245
17281
|
* @param value The value from which to get the qualified field API name.
|
|
17282
|
+
* @param onlyQualifiedFieldNames - Whether or not this function should skip fieldApiName that do not include the delimiter '.'
|
|
17246
17283
|
* @return The qualified field API name.
|
|
17247
17284
|
*/
|
|
17248
|
-
function getFieldApiName$2(value) {
|
|
17285
|
+
function getFieldApiName$2(value, onlyQualifiedFieldNames = false) {
|
|
17249
17286
|
// Note: tightening validation logic changes behavior from userland getting
|
|
17250
17287
|
// a server-provided error to the adapter noop'ing. In 224 we decided to not
|
|
17251
|
-
// change the behavior.
|
|
17288
|
+
// change the behavior. In 250 we decided to add the 'onlyQualifiedFieldName' flag to tighten the logic
|
|
17289
|
+
// optionally to avoid issues with persisted invalid field names.
|
|
17252
17290
|
if (isString$2(value)) {
|
|
17253
17291
|
const trimmed = value.trim();
|
|
17254
|
-
if (trimmed.length > 0) {
|
|
17292
|
+
if (trimmed.length > 0 && (onlyQualifiedFieldNames ? trimmed.indexOf('.') > -1 : true)) {
|
|
17255
17293
|
return trimmed;
|
|
17256
17294
|
}
|
|
17257
17295
|
}
|
|
@@ -17264,15 +17302,19 @@ function getFieldApiName$2(value) {
|
|
|
17264
17302
|
/**
|
|
17265
17303
|
* Returns the field API name.
|
|
17266
17304
|
* @param value The value from which to get the field API name.
|
|
17305
|
+
* @param options Option bag. onlyQualifiedFieldNames is a boolean that allows this function to skip returning invalid FieldApiNames.
|
|
17267
17306
|
* @returns The field API name.
|
|
17268
17307
|
*/
|
|
17269
|
-
function getFieldApiNamesArray$2(value) {
|
|
17308
|
+
function getFieldApiNamesArray$2(value, options = { onlyQualifiedFieldNames: false }) {
|
|
17270
17309
|
const valueArray = isArray$7(value) ? value : [value];
|
|
17271
17310
|
const array = [];
|
|
17272
17311
|
for (let i = 0, len = valueArray.length; i < len; i += 1) {
|
|
17273
17312
|
const item = valueArray[i];
|
|
17274
|
-
const apiName = getFieldApiName$2(item);
|
|
17313
|
+
const apiName = getFieldApiName$2(item, options.onlyQualifiedFieldNames);
|
|
17275
17314
|
if (apiName === undefined) {
|
|
17315
|
+
if (options.onlyQualifiedFieldNames) {
|
|
17316
|
+
continue; // Just skips invalid field names rather than failing to return an array at all
|
|
17317
|
+
}
|
|
17276
17318
|
return undefined;
|
|
17277
17319
|
}
|
|
17278
17320
|
push$4.call(array, apiName);
|
|
@@ -21639,17 +21681,16 @@ function tokenForAtMost$1(paginationMetadata, maxOffset) {
|
|
|
21639
21681
|
}
|
|
21640
21682
|
|
|
21641
21683
|
const TTL$x = 30000;
|
|
21642
|
-
const VERSION$18$1 = "
|
|
21684
|
+
const VERSION$18$1 = "e5c90c4081cd557f8ffec53028ede1e8";
|
|
21643
21685
|
const RepresentationType$T = 'ListRecordCollectionRepresentation';
|
|
21644
21686
|
function keyBuilder$23(luvio, config) {
|
|
21645
|
-
return keyPrefix$2 + '::' + RepresentationType$T + ':' + config.objectApiName + ':' + (config.searchTerm === null ? '' : config.searchTerm) + ':' + (config.sortBy === null ? '' : '[' + config.sortBy.join(',') + ']') + ':' + (config.
|
|
21687
|
+
return keyPrefix$2 + '::' + RepresentationType$T + ':' + config.objectApiName + ':' + (config.searchTerm === null ? '' : config.searchTerm) + ':' + (config.sortBy === null ? '' : '[' + config.sortBy.join(',') + ']') + ':' + (config.where === null ? '' : config.where) + ':' + (config.listViewApiName === null ? '' : config.listViewApiName);
|
|
21646
21688
|
}
|
|
21647
21689
|
function keyBuilderFromType$B(luvio, object) {
|
|
21648
21690
|
const keyParams = {
|
|
21649
21691
|
objectApiName: object.listReference.objectApiName,
|
|
21650
21692
|
searchTerm: object.searchTerm,
|
|
21651
21693
|
sortBy: object.sortBy,
|
|
21652
|
-
listViewId: object.listInfoETag,
|
|
21653
21694
|
where: object.where,
|
|
21654
21695
|
listViewApiName: object.listReference.listViewApiName
|
|
21655
21696
|
};
|
|
@@ -22710,7 +22751,7 @@ function splitListRecordCollectionKey(key) {
|
|
|
22710
22751
|
const keyElements = key.split(':');
|
|
22711
22752
|
return {
|
|
22712
22753
|
objectApiName: keyElements[3],
|
|
22713
|
-
listViewApiName: keyElements[
|
|
22754
|
+
listViewApiName: keyElements[7],
|
|
22714
22755
|
};
|
|
22715
22756
|
}
|
|
22716
22757
|
function splitListSummaryCollectionKey(key) {
|
|
@@ -23008,7 +23049,8 @@ function keyBuilder$1$(luvio, params) {
|
|
|
23008
23049
|
return keyBuilder$23(luvio, {
|
|
23009
23050
|
objectApiName: listReference.objectApiName,
|
|
23010
23051
|
listViewApiName: listReference.listViewApiName,
|
|
23011
|
-
listViewId
|
|
23052
|
+
// # removing listViewId from key only supporing getting records using api name
|
|
23053
|
+
// listViewId: listReference.id,
|
|
23012
23054
|
searchTerm: params.body.searchTerm || null,
|
|
23013
23055
|
where: params.body.where || null,
|
|
23014
23056
|
sortBy: params.body.sortBy !== undefined && params.body.sortBy.length <= 0
|
|
@@ -23021,7 +23063,8 @@ function keyBuilder$1$(luvio, params) {
|
|
|
23021
23063
|
return keyBuilder$23(luvio, {
|
|
23022
23064
|
objectApiName: params.urlParams.objectApiName,
|
|
23023
23065
|
listViewApiName: params.urlParams.listViewApiName,
|
|
23024
|
-
listViewId
|
|
23066
|
+
// # removing listViewId from key only supporing getting records using api name
|
|
23067
|
+
// listViewId: '',
|
|
23025
23068
|
searchTerm: params.body.searchTerm || null,
|
|
23026
23069
|
where: params.body.where || null,
|
|
23027
23070
|
sortBy: params.body.sortBy || [],
|
|
@@ -32193,7 +32236,7 @@ function equals$y(existing, incoming) {
|
|
|
32193
32236
|
}
|
|
32194
32237
|
|
|
32195
32238
|
const TTL$k = 900000;
|
|
32196
|
-
const VERSION$D$1 = "
|
|
32239
|
+
const VERSION$D$1 = "2405a0b25c2c00f82e88b600edc16387";
|
|
32197
32240
|
const RepresentationType$u = 'ListObjectInfoRepresentation';
|
|
32198
32241
|
function keyBuilder$15$1(luvio, config) {
|
|
32199
32242
|
return keyPrefix$2 + '::' + RepresentationType$u + ':' + config.objectApiName;
|
|
@@ -32235,6 +32278,10 @@ const select$Z$1 = function ListObjectInfoRepresentationSelect() {
|
|
|
32235
32278
|
name: 'objectApiName',
|
|
32236
32279
|
kind: 'Scalar'
|
|
32237
32280
|
},
|
|
32281
|
+
{
|
|
32282
|
+
name: 'publicOrSharedCreateable',
|
|
32283
|
+
kind: 'Scalar'
|
|
32284
|
+
},
|
|
32238
32285
|
{
|
|
32239
32286
|
name: 'relatedEntityApiName',
|
|
32240
32287
|
kind: 'Scalar'
|
|
@@ -32248,6 +32295,11 @@ function equals$x(existing, incoming) {
|
|
|
32248
32295
|
if (!(existing_createable === incoming_createable)) {
|
|
32249
32296
|
return false;
|
|
32250
32297
|
}
|
|
32298
|
+
const existing_publicOrSharedCreateable = existing.publicOrSharedCreateable;
|
|
32299
|
+
const incoming_publicOrSharedCreateable = incoming.publicOrSharedCreateable;
|
|
32300
|
+
if (!(existing_publicOrSharedCreateable === incoming_publicOrSharedCreateable)) {
|
|
32301
|
+
return false;
|
|
32302
|
+
}
|
|
32251
32303
|
const existing_objectApiName = existing.objectApiName;
|
|
32252
32304
|
const incoming_objectApiName = incoming.objectApiName;
|
|
32253
32305
|
if (!(existing_objectApiName === incoming_objectApiName)) {
|
|
@@ -39849,7 +39901,7 @@ const getSearchResultsAdapterFactory = (luvio) => function UiApi__getSearchResul
|
|
|
39849
39901
|
buildCachedSnapshotCachePolicy$5, buildNetworkSnapshotCachePolicy$6);
|
|
39850
39902
|
};
|
|
39851
39903
|
|
|
39852
|
-
const TTL$5 = 200;
|
|
39904
|
+
const TTL$5$1 = 200;
|
|
39853
39905
|
const VERSION$7$1 = "3102453bf10ea449d9665914d5f5febf";
|
|
39854
39906
|
const RepresentationType$8 = 'KeywordSearchResultsSummaryRepresentation';
|
|
39855
39907
|
function keyBuilder$c$1(luvio, config) {
|
|
@@ -39882,7 +39934,7 @@ function equals$7(existing, incoming) {
|
|
|
39882
39934
|
}
|
|
39883
39935
|
const ingest$3$1 = function KeywordSearchResultsSummaryRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
39884
39936
|
const key = keyBuilderFromType$5(luvio, input);
|
|
39885
|
-
const ttlToUse = TTL$5;
|
|
39937
|
+
const ttlToUse = TTL$5$1;
|
|
39886
39938
|
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "UiApi", VERSION$7$1, RepresentationType$8, equals$7);
|
|
39887
39939
|
return createLink$3(key);
|
|
39888
39940
|
};
|
|
@@ -39925,7 +39977,7 @@ function ingestError$1$1(luvio, params, error, snapshotRefresh) {
|
|
|
39925
39977
|
const key = keyBuilder$b$1(luvio, params);
|
|
39926
39978
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
39927
39979
|
const storeMetadataParams = {
|
|
39928
|
-
ttl: TTL$5,
|
|
39980
|
+
ttl: TTL$5$1,
|
|
39929
39981
|
namespace: keyPrefix$2,
|
|
39930
39982
|
version: VERSION$7$1,
|
|
39931
39983
|
representationName: RepresentationType$8
|
|
@@ -40849,6 +40901,7 @@ function onFetchResponseSuccess$1$1(luvio, config, resourceParams, response) {
|
|
|
40849
40901
|
// Note: The original listReference will remain unchanged in the response.
|
|
40850
40902
|
mutatedListRef.id = body.listInfoETag;
|
|
40851
40903
|
addListReferenceWithId(mutatedListRef, context, body.listReference.id);
|
|
40904
|
+
// storing sortBy ensuring a cache hit when requesting records with no sortBy provided
|
|
40852
40905
|
addServerDefaults(config, body, originalListRef, context);
|
|
40853
40906
|
}
|
|
40854
40907
|
return onFetchResponseSuccess$2$1(luvio, config, resourceParams, response);
|
|
@@ -43563,7 +43616,11 @@ function createDispatchResourceRequestContext(requestContext) {
|
|
|
43563
43616
|
}
|
|
43564
43617
|
ensureRegisteredOnce$2({
|
|
43565
43618
|
id: '@salesforce/lds-adapters-uiapi',
|
|
43566
|
-
configuration: {
|
|
43619
|
+
configuration: {
|
|
43620
|
+
...configurationForRestAdapters$2,
|
|
43621
|
+
...configurationForGraphQLAdapters$2,
|
|
43622
|
+
...configurationForOneStoreEnabledAdapters$2,
|
|
43623
|
+
},
|
|
43567
43624
|
instrument: instrument$3,
|
|
43568
43625
|
});
|
|
43569
43626
|
|
|
@@ -43824,15 +43881,13 @@ function bindExportsTo$1(luvio) {
|
|
|
43824
43881
|
getListInfosByObjectName: createWireAdapterConstructor(luvio, getListInfosByObjectName_ldsAdapter, getListInfosByObjectNameMetadata),
|
|
43825
43882
|
getListObjectInfo: createWireAdapterConstructor(luvio, getListObjectInfo_ldsAdapter, getListObjectInfoMetadata),
|
|
43826
43883
|
getListPreferences: createWireAdapterConstructor(luvio, getListPreferences_ldsAdapter, getListPreferencesMetadata),
|
|
43827
|
-
getListRecordsByName:
|
|
43884
|
+
getListRecordsByName: createInfiniteScrollingWireAdapterConstructor(luvio, getListRecordsByName_ldsAdapter, getListRecordsByNameMetadata),
|
|
43828
43885
|
getListUi: createInfiniteScrollingWireAdapterConstructor(luvio, getListUi_ldsAdapter, getListUiMetadata),
|
|
43829
43886
|
getLookupActions: createWireAdapterConstructor(luvio, getLookupActions_ldsAdapter, getLookupActionsMetadata),
|
|
43830
43887
|
getLookupMetadata: createWireAdapterConstructor(luvio, getLookupMetadata_ldsAdapter, getLookupMetadataMetadata),
|
|
43831
43888
|
getLookupRecords: createWireAdapterConstructor(luvio, getLookupRecords_ldsAdapter, getLookupRecordsMetadata),
|
|
43832
43889
|
getNavItems: createWireAdapterConstructor(luvio, getNavItems_ldsAdapter, getNavItemsMetadata),
|
|
43833
43890
|
getObjectCreateActions: createWireAdapterConstructor(luvio, getObjectCreateActions_ldsAdapter, getObjectCreateActionsMetadata),
|
|
43834
|
-
getObjectInfo: createWireAdapterConstructor(luvio, getObjectInfo_ldsAdapter, getObjectInfoMetadata),
|
|
43835
|
-
getObjectInfos: createWireAdapterConstructor(luvio, getObjectInfos_ldsAdapter, getObjectInfosMetadata),
|
|
43836
43891
|
getPathLayout: createWireAdapterConstructor(luvio, getPathLayout_ldsAdapter, getPathLayoutMetadata),
|
|
43837
43892
|
getPicklistValues: createWireAdapterConstructor(luvio, getPicklistValues_ldsAdapter, getPicklistValuesMetadata),
|
|
43838
43893
|
getPicklistValuesByRecordType: createWireAdapterConstructor(luvio, getPicklistValuesByRecordType_ldsAdapter, getPicklistValuesByRecordTypeMetadata),
|
|
@@ -43868,6 +43923,9 @@ function bindExportsTo$1(luvio) {
|
|
|
43868
43923
|
updateListPreferences: createLDSAdapter(luvio, adapterName$z, updateListPreferencesAdapterFactory),
|
|
43869
43924
|
updateRecord: unwrapSnapshotData(factory$2),
|
|
43870
43925
|
updateRecordAvatar: unwrapSnapshotData(factory$8),
|
|
43926
|
+
// One Store Enabled Adapters
|
|
43927
|
+
getObjectInfo: getLuvioOrOneStoreAdapter(createWireAdapterConstructor(luvio, getObjectInfo_ldsAdapter, getObjectInfoMetadata), configurationForOneStoreEnabledAdapters$2.getGetObjectInfoAdapter()),
|
|
43928
|
+
getObjectInfos: getLuvioOrOneStoreAdapter(createWireAdapterConstructor(luvio, getObjectInfos_ldsAdapter, getObjectInfosMetadata), configurationForOneStoreEnabledAdapters$2.getGetObjectInfosAdapter()),
|
|
43871
43929
|
// Imperative Adapters
|
|
43872
43930
|
unstable_getActionOverrides_imperative: createImperativeAdapter(luvio, getActionOverrides_ldsAdapter, getActionOverridesMetadata),
|
|
43873
43931
|
getAllApps_imperative: createImperativeAdapter(luvio, getAllApps_ldsAdapter, getAllAppsMetadata),
|
|
@@ -44093,7 +44151,7 @@ withDefaultLuvio((luvio) => {
|
|
|
44093
44151
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
44094
44152
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
44095
44153
|
});
|
|
44096
|
-
// version: 1.
|
|
44154
|
+
// version: 1.285.0-c97dec82e
|
|
44097
44155
|
|
|
44098
44156
|
var ldsIdempotencyWriteDisabled = {
|
|
44099
44157
|
isOpen: function (e) {
|
|
@@ -49727,10 +49785,6 @@ class DurableDraftQueue {
|
|
|
49727
49785
|
switch (result) {
|
|
49728
49786
|
case ProcessActionResult.BLOCKED_ON_ERROR:
|
|
49729
49787
|
this.state = DraftQueueState.Error;
|
|
49730
|
-
await this.notifyChangedListeners({
|
|
49731
|
-
type: DraftQueueEventType.QueueStateChanged,
|
|
49732
|
-
state: this.state,
|
|
49733
|
-
});
|
|
49734
49788
|
return Promise.reject();
|
|
49735
49789
|
default:
|
|
49736
49790
|
return Promise.resolve();
|
|
@@ -49876,6 +49930,10 @@ class DurableDraftQueue {
|
|
|
49876
49930
|
if (status === DraftActionStatus.Error) {
|
|
49877
49931
|
this.state = DraftQueueState.Error;
|
|
49878
49932
|
this.processingAction = undefined;
|
|
49933
|
+
this.notifyChangedListeners({
|
|
49934
|
+
type: DraftQueueEventType.ActionFailed,
|
|
49935
|
+
action: action,
|
|
49936
|
+
});
|
|
49879
49937
|
return ProcessActionResult.BLOCKED_ON_ERROR;
|
|
49880
49938
|
}
|
|
49881
49939
|
if (id === this.uploadingActionId) {
|
|
@@ -55524,7 +55582,7 @@ function injectParentRelationships(selections, parentNode, parentPath, ancestors
|
|
|
55524
55582
|
* @param objectInfos
|
|
55525
55583
|
* @returns
|
|
55526
55584
|
*/
|
|
55527
|
-
function injectFieldsForDisplayValue(topNode,
|
|
55585
|
+
function injectFieldsForDisplayValue(topNode, apiName, objectInfos) {
|
|
55528
55586
|
const { selectionSet } = topNode;
|
|
55529
55587
|
if (selectionSet === undefined)
|
|
55530
55588
|
return [];
|
|
@@ -55538,13 +55596,8 @@ function injectFieldsForDisplayValue(topNode, parentNode, objectInfos) {
|
|
|
55538
55596
|
displayValue = node;
|
|
55539
55597
|
break;
|
|
55540
55598
|
}
|
|
55541
|
-
if (isInlineFragmentNode(node)) {
|
|
55542
|
-
const name = node.typeCondition !== undefined ? node.typeCondition.name : parentNode.name;
|
|
55543
|
-
displayValueNameFields = injectFieldsForDisplayValue(node, { ...parentNode, name }, objectInfos);
|
|
55544
|
-
}
|
|
55545
55599
|
}
|
|
55546
55600
|
if (displayValue !== undefined) {
|
|
55547
|
-
const apiName = parentNode.name.value;
|
|
55548
55601
|
const objectInfo = objectInfos[apiName];
|
|
55549
55602
|
if (objectInfo !== undefined &&
|
|
55550
55603
|
objectInfo.nameFields !== undefined &&
|
|
@@ -55611,19 +55664,24 @@ function injectFields(selections, parentNode, parentPath, ancestors, objectInfos
|
|
|
55611
55664
|
// example: TimeSheetId { value }
|
|
55612
55665
|
relatedIdForChildRelationship.push(createFieldNode(injectedParentFieldName, FieldValueNodeSelectionSet));
|
|
55613
55666
|
}
|
|
55614
|
-
displayValueNameFields.push(...injectFieldsForDisplayValue(parentNode,
|
|
55615
|
-
...parent,
|
|
55616
|
-
name: {
|
|
55617
|
-
...parent.name,
|
|
55618
|
-
value: targetRelationship.childObjectApiName,
|
|
55619
|
-
},
|
|
55620
|
-
}, objectInfos));
|
|
55667
|
+
displayValueNameFields.push(...injectFieldsForDisplayValue(parentNode, targetRelationship.childObjectApiName, objectInfos));
|
|
55621
55668
|
}
|
|
55622
55669
|
}
|
|
55623
55670
|
}
|
|
55624
|
-
|
|
55671
|
+
else {
|
|
55672
|
+
let apiName = parent.name.value;
|
|
55673
|
+
if (pathToObjectApiNamesMap[parentPath] !== undefined &&
|
|
55674
|
+
pathToObjectApiNamesMap[parentPath].length === 1) {
|
|
55675
|
+
apiName = pathToObjectApiNamesMap[parentPath][0];
|
|
55676
|
+
}
|
|
55677
|
+
displayValueNameFields.push(...injectFieldsForDisplayValue(parentNode, apiName, objectInfos));
|
|
55678
|
+
}
|
|
55625
55679
|
}
|
|
55626
55680
|
}
|
|
55681
|
+
else if (isInlineFragmentNode(parentNode) && parentNode.typeCondition !== undefined) {
|
|
55682
|
+
const { typeCondition: { name: { value: apiName }, }, } = parentNode;
|
|
55683
|
+
displayValueNameFields.push(...injectFieldsForDisplayValue(parentNode, apiName, objectInfos));
|
|
55684
|
+
}
|
|
55627
55685
|
return [
|
|
55628
55686
|
...rootQueryIdField,
|
|
55629
55687
|
...flat(parentRelaltionships),
|
|
@@ -56942,6 +57000,21 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
|
|
|
56942
57000
|
}
|
|
56943
57001
|
return fields;
|
|
56944
57002
|
}
|
|
57003
|
+
getRedirectMappings(action) {
|
|
57004
|
+
if (action.data.method === 'post' && action.response.status === 204) {
|
|
57005
|
+
return undefined;
|
|
57006
|
+
}
|
|
57007
|
+
return super.getRedirectMappings(action);
|
|
57008
|
+
}
|
|
57009
|
+
async handleActionCompleted(completedAction, queueOperations, allHandlers) {
|
|
57010
|
+
if (completedAction.response.status === 204 && completedAction.data.method === 'post') {
|
|
57011
|
+
// if we get a 204 it means the record creation was successful but we don't have the record to ingest
|
|
57012
|
+
// remove the synthesized draft and do not try to ingest the response
|
|
57013
|
+
await this.evictKey(completedAction.tag);
|
|
57014
|
+
return;
|
|
57015
|
+
}
|
|
57016
|
+
return super.handleActionCompleted(completedAction, queueOperations, allHandlers);
|
|
57017
|
+
}
|
|
56945
57018
|
async fetchReferenceRecord(referenceFields) {
|
|
56946
57019
|
const promises = referenceFields.map(async (referenceFieldInfo) => {
|
|
56947
57020
|
const apiName = await this.identifyApiName(referenceFieldInfo.id, referenceFieldInfo.field);
|
|
@@ -57308,6 +57381,9 @@ function normalizeRecordFields(key, entry) {
|
|
|
57308
57381
|
* Transforms a record for storage in the durable store. The transformation involves denormalizing
|
|
57309
57382
|
* scalar fields and persisting link metadata to transform back into a normalized representation
|
|
57310
57383
|
*
|
|
57384
|
+
* If the record contains pending fields this will return undefined as pending records do not get persisted
|
|
57385
|
+
* to the durable store. There should be a refresh operation outbound that will bring in the updated record.
|
|
57386
|
+
*
|
|
57311
57387
|
* @param normalizedRecord Record containing normalized field links
|
|
57312
57388
|
* @param recordStore a store containing referenced record fields
|
|
57313
57389
|
*/
|
|
@@ -57322,7 +57398,9 @@ function buildDurableRecordRepresentation(normalizedRecord, records, pendingEntr
|
|
|
57322
57398
|
// pending fields get filtered out of the durable store
|
|
57323
57399
|
const { pending } = field;
|
|
57324
57400
|
if (pending === true) {
|
|
57325
|
-
|
|
57401
|
+
// do not write records with pending fields to the durable store
|
|
57402
|
+
// there should be a refresh operation outbound that will bring in the updated record
|
|
57403
|
+
return undefined;
|
|
57326
57404
|
}
|
|
57327
57405
|
const { __ref } = field;
|
|
57328
57406
|
if (__ref !== undefined) {
|
|
@@ -57488,10 +57566,12 @@ function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecord
|
|
|
57488
57566
|
};
|
|
57489
57567
|
}
|
|
57490
57568
|
const denormalizedRecord = buildDurableRecordRepresentation(record, storeRecords, recordEntries, store);
|
|
57491
|
-
|
|
57492
|
-
|
|
57493
|
-
|
|
57494
|
-
|
|
57569
|
+
if (denormalizedRecord !== undefined) {
|
|
57570
|
+
putEntries[recordKey] = {
|
|
57571
|
+
data: denormalizedRecord,
|
|
57572
|
+
metadata,
|
|
57573
|
+
};
|
|
57574
|
+
}
|
|
57495
57575
|
}
|
|
57496
57576
|
else {
|
|
57497
57577
|
putEntries[key] = value;
|
|
@@ -60542,11 +60622,17 @@ class NimbusSqliteStore {
|
|
|
60542
60622
|
return this.getTable(segment).getAll(segment);
|
|
60543
60623
|
}
|
|
60544
60624
|
setEntries(entries, segment) {
|
|
60625
|
+
if (keys$9(entries).length === 0) {
|
|
60626
|
+
return Promise.resolve();
|
|
60627
|
+
}
|
|
60545
60628
|
const table = this.getTable(segment);
|
|
60546
60629
|
const upsertOperation = table.entriesToUpsertOperations(entries, segment);
|
|
60547
60630
|
return this.batchOperationAsPromise([upsertOperation]);
|
|
60548
60631
|
}
|
|
60549
60632
|
setMetadata(entries, segment) {
|
|
60633
|
+
if (keys$9(entries).length === 0) {
|
|
60634
|
+
return Promise.resolve();
|
|
60635
|
+
}
|
|
60550
60636
|
const table = this.getTable(segment);
|
|
60551
60637
|
let operation;
|
|
60552
60638
|
if (this.supportsBatchUpdates) {
|
|
@@ -60563,32 +60649,41 @@ class NimbusSqliteStore {
|
|
|
60563
60649
|
batchOperations(operations) {
|
|
60564
60650
|
const sqliteOperations = operations.reduce((acc, cur) => {
|
|
60565
60651
|
if (cur.type === 'setEntries') {
|
|
60566
|
-
|
|
60567
|
-
|
|
60652
|
+
if (keys$9(cur.entries).length > 0) {
|
|
60653
|
+
const table = this.getTable(cur.segment);
|
|
60654
|
+
acc.push(table.entriesToUpsertOperations(cur.entries, cur.segment));
|
|
60655
|
+
}
|
|
60568
60656
|
}
|
|
60569
60657
|
else if (cur.type === 'setMetadata') {
|
|
60570
|
-
|
|
60571
|
-
|
|
60572
|
-
|
|
60573
|
-
|
|
60574
|
-
|
|
60575
|
-
|
|
60576
|
-
|
|
60577
|
-
|
|
60578
|
-
|
|
60579
|
-
|
|
60658
|
+
if (keys$9(cur.entries).length > 0) {
|
|
60659
|
+
const table = this.getTable(cur.segment);
|
|
60660
|
+
if (this.supportsBatchUpdates) {
|
|
60661
|
+
acc.push(table.metadataToUpdateOperations(cur.entries, cur.segment));
|
|
60662
|
+
}
|
|
60663
|
+
else {
|
|
60664
|
+
const upsert = table.entriesToUpsertOperations(cur.entries, cur.segment);
|
|
60665
|
+
// manually set the context type on the upsert so notifications do not notify rebuilds without
|
|
60666
|
+
// plugin updates
|
|
60667
|
+
upsert.context.type = 'setMetadata';
|
|
60668
|
+
acc.push(upsert);
|
|
60669
|
+
}
|
|
60580
60670
|
}
|
|
60581
60671
|
}
|
|
60582
60672
|
else {
|
|
60583
|
-
|
|
60673
|
+
if (cur.ids.length > 0) {
|
|
60674
|
+
acc.push(this.idsToDeleteOperation(cur.ids, cur.segment));
|
|
60675
|
+
}
|
|
60584
60676
|
}
|
|
60585
60677
|
return acc;
|
|
60586
60678
|
}, []);
|
|
60587
|
-
return
|
|
60679
|
+
return sqliteOperations.length === 0
|
|
60680
|
+
? Promise.resolve()
|
|
60681
|
+
: this.batchOperationAsPromise(sqliteOperations);
|
|
60588
60682
|
}
|
|
60589
60683
|
evictEntries(entryIds, segment) {
|
|
60590
|
-
|
|
60591
|
-
|
|
60684
|
+
return entryIds.length === 0
|
|
60685
|
+
? Promise.resolve()
|
|
60686
|
+
: this.batchOperationAsPromise([this.idsToDeleteOperation(entryIds, segment)]);
|
|
60592
60687
|
}
|
|
60593
60688
|
registerOnChangedListener(listener) {
|
|
60594
60689
|
let unsubscribeId = undefined;
|
|
@@ -60924,17 +61019,6 @@ const NimbusBinaryStore = {
|
|
|
60924
61019
|
},
|
|
60925
61020
|
};
|
|
60926
61021
|
|
|
60927
|
-
function setupInspection(luvio) {
|
|
60928
|
-
if (__nimbus.plugins.LdsInspectorPlugin !== undefined) {
|
|
60929
|
-
// when inspection is enabled, make luvio available as a global
|
|
60930
|
-
// eslint-disable-next-line no-undef
|
|
60931
|
-
globalThis.luvio = luvio;
|
|
60932
|
-
registerReportObserver((report) => {
|
|
60933
|
-
__nimbus.plugins.LdsInspectorPlugin.sendAdapterReport(stringify$1$1(report));
|
|
60934
|
-
});
|
|
60935
|
-
}
|
|
60936
|
-
}
|
|
60937
|
-
|
|
60938
61022
|
/**
|
|
60939
61023
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
60940
61024
|
* All rights reserved.
|
|
@@ -62056,6 +62140,21 @@ function primingSessionFactory(config) {
|
|
|
62056
62140
|
return instrumentPrimingSession(session);
|
|
62057
62141
|
}
|
|
62058
62142
|
|
|
62143
|
+
// so eslint doesn't complain about nimbus
|
|
62144
|
+
/* global __nimbus */
|
|
62145
|
+
function setupObserver() {
|
|
62146
|
+
if (__nimbus.plugins.LdsObserverPlugin !== undefined) {
|
|
62147
|
+
registerReportObserver((report) => {
|
|
62148
|
+
__nimbus.plugins.LdsObserverPlugin.logAdapterExecution({
|
|
62149
|
+
name: report.adapterName,
|
|
62150
|
+
serializedConfig: stringify$1$1(report.config),
|
|
62151
|
+
status: report.result,
|
|
62152
|
+
duration: report.executionTime,
|
|
62153
|
+
});
|
|
62154
|
+
});
|
|
62155
|
+
}
|
|
62156
|
+
}
|
|
62157
|
+
|
|
62059
62158
|
// so eslint doesn't complain about nimbus
|
|
62060
62159
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
62061
62160
|
/* global __nimbus */
|
|
@@ -62150,8 +62249,8 @@ function getRuntime() {
|
|
|
62150
62249
|
lazyGetRecords = getRecordsAdapterFactory(lazyLuvio);
|
|
62151
62250
|
// Currently instruments store runtime perf
|
|
62152
62251
|
setupMobileInstrumentation();
|
|
62153
|
-
// If the
|
|
62154
|
-
|
|
62252
|
+
// If the observer nimbus plugin is configured, observation is enabled otherwise this is a no-op
|
|
62253
|
+
setupObserver();
|
|
62155
62254
|
// set storeEval function for lds-adapters-graghql to use
|
|
62156
62255
|
withRegistration('@salesforce/lds-adapters-graphql', (registration) => {
|
|
62157
62256
|
const { configuration: { setStoreEval, setDraftFunctions }, } = registration;
|
|
@@ -62221,7 +62320,7 @@ register$1({
|
|
|
62221
62320
|
id: '@salesforce/lds-network-adapter',
|
|
62222
62321
|
instrument: instrument$2,
|
|
62223
62322
|
});
|
|
62224
|
-
// version: 1.
|
|
62323
|
+
// version: 1.285.0-67d4d6869
|
|
62225
62324
|
|
|
62226
62325
|
const { create: create$3, keys: keys$3 } = Object;
|
|
62227
62326
|
const { stringify: stringify$1, parse: parse$1 } = JSON;
|
|
@@ -69238,7 +69337,7 @@ function getInContextFragmentType$Q(fragment, fragmentMap) {
|
|
|
69238
69337
|
}
|
|
69239
69338
|
|
|
69240
69339
|
const name$E = 'RecordConnection';
|
|
69241
|
-
const TTL$
|
|
69340
|
+
const TTL$5 = 300000;
|
|
69242
69341
|
const VERSION$N = '5109e37c62e492243c1e6ae3967b0655';
|
|
69243
69342
|
function keyBuilder$I(luvio, path, data) {
|
|
69244
69343
|
return path.fullPath;
|
|
@@ -69316,7 +69415,7 @@ function ingest$G(astNode, state) {
|
|
|
69316
69415
|
createLink: createLink,
|
|
69317
69416
|
mergeData: mergeData$E,
|
|
69318
69417
|
storeMetadataParams: {
|
|
69319
|
-
ttl: TTL$
|
|
69418
|
+
ttl: TTL$5,
|
|
69320
69419
|
namespace: keyPrefix$1,
|
|
69321
69420
|
representationName: "RecordConnection",
|
|
69322
69421
|
version: VERSION$N,
|
|
@@ -76217,7 +76316,7 @@ function getInContextFragmentType$m(fragment, fragmentMap) {
|
|
|
76217
76316
|
}
|
|
76218
76317
|
|
|
76219
76318
|
const name$a = 'ObjectInfo';
|
|
76220
|
-
const TTL$
|
|
76319
|
+
const TTL$4 = 900000;
|
|
76221
76320
|
const VERSION$j = 'f8f627dd56d42a39e1a6642edb039182';
|
|
76222
76321
|
function keyBuilder$e(luvio, path, data) {
|
|
76223
76322
|
return path.fullPath;
|
|
@@ -76243,7 +76342,7 @@ function ingest$c(astNode, state) {
|
|
|
76243
76342
|
createLink: createLink,
|
|
76244
76343
|
mergeData: mergeData$a,
|
|
76245
76344
|
storeMetadataParams: {
|
|
76246
|
-
ttl: TTL$
|
|
76345
|
+
ttl: TTL$4,
|
|
76247
76346
|
namespace: keyPrefix$1,
|
|
76248
76347
|
representationName: "ObjectInfo",
|
|
76249
76348
|
version: VERSION$j,
|
|
@@ -76933,7 +77032,7 @@ function getInContextFragmentType$j(fragment, fragmentMap) {
|
|
|
76933
77032
|
}
|
|
76934
77033
|
|
|
76935
77034
|
const name$7 = 'RelatedListInfo';
|
|
76936
|
-
const TTL$
|
|
77035
|
+
const TTL$3 = 900000;
|
|
76937
77036
|
const VERSION$g = 'a32cfdff7ca8dcf4b534b3491fef2019';
|
|
76938
77037
|
function keyBuilder$b(luvio, path, data) {
|
|
76939
77038
|
return path.fullPath;
|
|
@@ -76959,7 +77058,7 @@ function ingest$9(astNode, state) {
|
|
|
76959
77058
|
createLink: createLink,
|
|
76960
77059
|
mergeData: mergeData$7,
|
|
76961
77060
|
storeMetadataParams: {
|
|
76962
|
-
ttl: TTL$
|
|
77061
|
+
ttl: TTL$3,
|
|
76963
77062
|
namespace: keyPrefix$1,
|
|
76964
77063
|
representationName: "RelatedListInfo",
|
|
76965
77064
|
version: VERSION$g,
|
|
@@ -78787,6 +78886,7 @@ function getInContextFragmentType$c(fragment, fragmentMap) {
|
|
|
78787
78886
|
}
|
|
78788
78887
|
|
|
78789
78888
|
const name$1 = 'Setup__Setup';
|
|
78889
|
+
const TTL$2 = 1000;
|
|
78790
78890
|
const VERSION$9 = '57c66c8147b44793116747c96b2b0fc9';
|
|
78791
78891
|
function keyBuilder$5(luvio, path, data) {
|
|
78792
78892
|
return path.fullPath;
|
|
@@ -78812,7 +78912,7 @@ function ingest$2(astNode, state) {
|
|
|
78812
78912
|
createLink: createLink,
|
|
78813
78913
|
mergeData: mergeData$1,
|
|
78814
78914
|
storeMetadataParams: {
|
|
78815
|
-
ttl: TTL$
|
|
78915
|
+
ttl: TTL$2,
|
|
78816
78916
|
namespace: keyPrefix$1,
|
|
78817
78917
|
representationName: "Setup__Setup",
|
|
78818
78918
|
version: VERSION$9,
|
|
@@ -81153,6 +81253,32 @@ let trackedFieldDepthOnNotifyChange$1 = 5;
|
|
|
81153
81253
|
* @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
|
|
81154
81254
|
*/
|
|
81155
81255
|
let trackedFieldLeafNodeIdAndNameOnly$1 = false;
|
|
81256
|
+
/**
|
|
81257
|
+
* One store enabled Get Object Info adapter
|
|
81258
|
+
*/
|
|
81259
|
+
let oneStoreGetObjectInfoAdapter$1 = undefined;
|
|
81260
|
+
/**
|
|
81261
|
+
* One store enabled Get Object Infos adapter
|
|
81262
|
+
*/
|
|
81263
|
+
let oneStoreGetObjectInfosAdapter$1 = undefined;
|
|
81264
|
+
/**
|
|
81265
|
+
* Defines the configuration API and is exposed internally as well as externally.
|
|
81266
|
+
* Configuration for one store enabled REST adapters only.
|
|
81267
|
+
*/
|
|
81268
|
+
const configurationForOneStoreEnabledAdapters$1 = {
|
|
81269
|
+
setGetObjectInfoAdapter: function (adapter) {
|
|
81270
|
+
oneStoreGetObjectInfoAdapter$1 = adapter;
|
|
81271
|
+
},
|
|
81272
|
+
getGetObjectInfoAdapter: function () {
|
|
81273
|
+
return oneStoreGetObjectInfoAdapter$1;
|
|
81274
|
+
},
|
|
81275
|
+
setGetObjectInfosAdapter: function (adapter) {
|
|
81276
|
+
oneStoreGetObjectInfosAdapter$1 = adapter;
|
|
81277
|
+
},
|
|
81278
|
+
getGetObjectInfosAdapter: function () {
|
|
81279
|
+
return oneStoreGetObjectInfosAdapter$1;
|
|
81280
|
+
},
|
|
81281
|
+
};
|
|
81156
81282
|
/**
|
|
81157
81283
|
* Defines the configuration API and is exposed internally as well as externally.
|
|
81158
81284
|
* Configuration for REST adapters only.
|
|
@@ -81217,6 +81343,7 @@ const configurationForRestAdapters$1 = {
|
|
|
81217
81343
|
getDraftAwareCreateContentVersionAdapter: function () {
|
|
81218
81344
|
return draftAwareCreateContentVersionAdapter$1;
|
|
81219
81345
|
},
|
|
81346
|
+
...configurationForOneStoreEnabledAdapters$1,
|
|
81220
81347
|
};
|
|
81221
81348
|
/**
|
|
81222
81349
|
* Defines the configuration API and is exposed internally as well as externally.
|
|
@@ -81725,6 +81852,7 @@ function bindExportsTo(luvio) {
|
|
|
81725
81852
|
// Wire Adapters
|
|
81726
81853
|
graphql: createGraphQLWireAdapterConstructor(luvio, graphql_ldsAdapter, graphqlMetadata, astResolver),
|
|
81727
81854
|
graphqlBatch: createGraphQLWireAdapterConstructor(luvio, graphqlBatch_ldsAdapter, graphqlBatchMetadata, astResolver),
|
|
81855
|
+
// One Store Enabled Adapters
|
|
81728
81856
|
// Imperative Adapters
|
|
81729
81857
|
graphql_imperative: createGraphQLImperativeAdapter(luvio, graphql_ldsAdapter, graphqlMetadata, astResolver),
|
|
81730
81858
|
graphqlBatch_imperative: createGraphQLImperativeAdapter(luvio, graphqlBatch_ldsAdapter, graphqlBatchMetadata, astResolver),
|
|
@@ -81846,15 +81974,17 @@ function isFieldId$1(unknown) {
|
|
|
81846
81974
|
/**
|
|
81847
81975
|
* Returns the field API name, qualified with an object name if possible.
|
|
81848
81976
|
* @param value The value from which to get the qualified field API name.
|
|
81977
|
+
* @param onlyQualifiedFieldNames - Whether or not this function should skip fieldApiName that do not include the delimiter '.'
|
|
81849
81978
|
* @return The qualified field API name.
|
|
81850
81979
|
*/
|
|
81851
|
-
function getFieldApiName$1(value) {
|
|
81980
|
+
function getFieldApiName$1(value, onlyQualifiedFieldNames = false) {
|
|
81852
81981
|
// Note: tightening validation logic changes behavior from userland getting
|
|
81853
81982
|
// a server-provided error to the adapter noop'ing. In 224 we decided to not
|
|
81854
|
-
// change the behavior.
|
|
81983
|
+
// change the behavior. In 250 we decided to add the 'onlyQualifiedFieldName' flag to tighten the logic
|
|
81984
|
+
// optionally to avoid issues with persisted invalid field names.
|
|
81855
81985
|
if (isString$1(value)) {
|
|
81856
81986
|
const trimmed = value.trim();
|
|
81857
|
-
if (trimmed.length > 0) {
|
|
81987
|
+
if (trimmed.length > 0 && (onlyQualifiedFieldNames ? trimmed.indexOf('.') > -1 : true)) {
|
|
81858
81988
|
return trimmed;
|
|
81859
81989
|
}
|
|
81860
81990
|
}
|
|
@@ -81867,15 +81997,19 @@ function getFieldApiName$1(value) {
|
|
|
81867
81997
|
/**
|
|
81868
81998
|
* Returns the field API name.
|
|
81869
81999
|
* @param value The value from which to get the field API name.
|
|
82000
|
+
* @param options Option bag. onlyQualifiedFieldNames is a boolean that allows this function to skip returning invalid FieldApiNames.
|
|
81870
82001
|
* @returns The field API name.
|
|
81871
82002
|
*/
|
|
81872
|
-
function getFieldApiNamesArray$1(value) {
|
|
82003
|
+
function getFieldApiNamesArray$1(value, options = { onlyQualifiedFieldNames: false }) {
|
|
81873
82004
|
const valueArray = isArray$2(value) ? value : [value];
|
|
81874
82005
|
const array = [];
|
|
81875
82006
|
for (let i = 0, len = valueArray.length; i < len; i += 1) {
|
|
81876
82007
|
const item = valueArray[i];
|
|
81877
|
-
const apiName = getFieldApiName$1(item);
|
|
82008
|
+
const apiName = getFieldApiName$1(item, options.onlyQualifiedFieldNames);
|
|
81878
82009
|
if (apiName === undefined) {
|
|
82010
|
+
if (options.onlyQualifiedFieldNames) {
|
|
82011
|
+
continue; // Just skips invalid field names rather than failing to return an array at all
|
|
82012
|
+
}
|
|
81879
82013
|
return undefined;
|
|
81880
82014
|
}
|
|
81881
82015
|
push$1.call(array, apiName);
|
|
@@ -82222,7 +82356,11 @@ var DiscriminatorValues$6;
|
|
|
82222
82356
|
})(DiscriminatorValues$6 || (DiscriminatorValues$6 = {}));
|
|
82223
82357
|
ensureRegisteredOnce$1({
|
|
82224
82358
|
id: '@salesforce/lds-adapters-uiapi',
|
|
82225
|
-
configuration: {
|
|
82359
|
+
configuration: {
|
|
82360
|
+
...configurationForRestAdapters$1,
|
|
82361
|
+
...configurationForGraphQLAdapters$1,
|
|
82362
|
+
...configurationForOneStoreEnabledAdapters$1,
|
|
82363
|
+
},
|
|
82226
82364
|
instrument: instrument$1,
|
|
82227
82365
|
});
|
|
82228
82366
|
|
|
@@ -82231,7 +82369,7 @@ register$1({
|
|
|
82231
82369
|
configuration: { ...configurationForGraphQLAdapters$1 },
|
|
82232
82370
|
instrument: instrument$1,
|
|
82233
82371
|
});
|
|
82234
|
-
// version: 1.
|
|
82372
|
+
// version: 1.285.0-c97dec82e
|
|
82235
82373
|
|
|
82236
82374
|
// On core the unstable adapters are re-exported with different names,
|
|
82237
82375
|
// we want to match them here.
|
|
@@ -84487,7 +84625,7 @@ withDefaultLuvio((luvio) => {
|
|
|
84487
84625
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
84488
84626
|
graphQLImperative = ldsAdapter;
|
|
84489
84627
|
});
|
|
84490
|
-
// version: 1.
|
|
84628
|
+
// version: 1.285.0-c97dec82e
|
|
84491
84629
|
|
|
84492
84630
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
84493
84631
|
__proto__: null,
|
|
@@ -84789,63 +84927,75 @@ function invokeDmlAdapter(adapter, configObject, onResponse, nativeAdapterReques
|
|
|
84789
84927
|
}
|
|
84790
84928
|
}
|
|
84791
84929
|
/**
|
|
84792
|
-
*
|
|
84793
|
-
*
|
|
84794
|
-
*
|
|
84930
|
+
* @deprecated There is no situation in which any consumer actually wants to replace the draft.
|
|
84931
|
+
* call {@link invokeAdapterWithDraftToMerge} instead`.
|
|
84932
|
+
* Keep it for now for app back compatibility.
|
|
84933
|
+
* Will be removed in future, ideally 2 releases later.
|
|
84934
|
+
*/
|
|
84935
|
+
function invokeAdapterWithDraftToReplace(adapterId, config, draftIdToReplace, onResponse, nativeAdapterRequestContext) {
|
|
84936
|
+
invokeAdapterWithDraftToMerge(adapterId, config, draftIdToReplace, onResponse, nativeAdapterRequestContext);
|
|
84937
|
+
}
|
|
84938
|
+
/**
|
|
84939
|
+
* Executes the specified adapter with the given @param dapterId and @param config. Then
|
|
84940
|
+
* it merge the draft with the given id with the draft generated by
|
|
84941
|
+
* the mutating adapter. Will call onResult callback once with data or error.
|
|
84795
84942
|
*
|
|
84796
84943
|
* This function throws an error if the given adapterId cannot be found, or if the
|
|
84797
|
-
* adapterId is not a mutating adapter
|
|
84798
|
-
* fails to parse the given config string.
|
|
84944
|
+
* adapterId is not a mutating adapter if a draft isn't created, or
|
|
84945
|
+
* if it fails to parse the given config string.
|
|
84946
|
+
*
|
|
84947
|
+
* If the @param adapterId is deleteRecod, the invocation of it will generate a delele draft.
|
|
84948
|
+
* The newly generated delete draft will replace the draft specified by @param targetDraftId
|
|
84799
84949
|
*/
|
|
84800
|
-
function
|
|
84950
|
+
function invokeAdapterWithDraftToMerge(adapterId, config, targetDraftId, onResponse, nativeAdapterRequestContext) {
|
|
84951
|
+
const adapter = getDMLAdapterFromName(adapterId);
|
|
84952
|
+
if (adapter === undefined) {
|
|
84953
|
+
// Check if the adapter is non-mutating adapter and create proper error message.
|
|
84954
|
+
const message = getImperativeAdapterFromName(imperativeAdapterKeyBuilder(adapterId)) !== undefined
|
|
84955
|
+
? NON_MUTATING_ADAPTER_MESSAGE
|
|
84956
|
+
: `adapter ${adapterId} not recognized`;
|
|
84957
|
+
onResponse({
|
|
84958
|
+
data: undefined,
|
|
84959
|
+
error: createNativeFetchErrorResponse(message),
|
|
84960
|
+
});
|
|
84961
|
+
return;
|
|
84962
|
+
}
|
|
84963
|
+
// deleteRecord adapter call will generate a delete draft and
|
|
84964
|
+
// the newly generate draft will replace the target draft
|
|
84965
|
+
if (adapterId === 'deleteRecord') {
|
|
84966
|
+
invokeAdapterWithDraftToMergeDeleteRecord(adapter, config, targetDraftId, onResponse, nativeAdapterRequestContext);
|
|
84967
|
+
return;
|
|
84968
|
+
}
|
|
84801
84969
|
draftManager.getQueue().then((draftInfo) => {
|
|
84802
84970
|
const draftIds = draftInfo.items.map((draft) => draft.id);
|
|
84803
|
-
if (draftIds.includes(
|
|
84971
|
+
if (draftIds.includes(targetDraftId) === false) {
|
|
84804
84972
|
onResponse({
|
|
84805
84973
|
data: undefined,
|
|
84806
84974
|
error: createNativeFetchErrorResponse(DRAFT_DOESNT_EXIST_MESSAGE),
|
|
84807
84975
|
});
|
|
84808
84976
|
return;
|
|
84809
84977
|
}
|
|
84810
|
-
|
|
84811
|
-
|
|
84812
|
-
|
|
84813
|
-
|
|
84814
|
-
|
|
84815
|
-
|
|
84816
|
-
|
|
84817
|
-
|
|
84978
|
+
invokeDmlAdapter(adapter, parse$1(config), (responseValue) => {
|
|
84979
|
+
const draftIds = draftIdsForResponseValue(responseValue);
|
|
84980
|
+
if (responseValue.error === undefined &&
|
|
84981
|
+
draftIds !== undefined &&
|
|
84982
|
+
draftIds.length > 0) {
|
|
84983
|
+
const draftId = draftIds[draftIds.length - 1];
|
|
84984
|
+
draftManager
|
|
84985
|
+
.mergeActions(targetDraftId, draftId)
|
|
84986
|
+
.then(() => {
|
|
84987
|
+
onResponse(responseValue);
|
|
84988
|
+
})
|
|
84989
|
+
.catch((error) => {
|
|
84990
|
+
onResponse(convertErrorIntoNativeFetchError(error, `Unknown error merging draft`));
|
|
84818
84991
|
});
|
|
84819
|
-
return;
|
|
84820
84992
|
}
|
|
84821
|
-
|
|
84822
|
-
|
|
84823
|
-
|
|
84824
|
-
|
|
84825
|
-
|
|
84826
|
-
|
|
84827
|
-
invokeDmlAdapter(adapter, parse$1(config), (responseValue) => {
|
|
84828
|
-
const draftIds = draftIdsForResponseValue(responseValue);
|
|
84829
|
-
if (responseValue.error === undefined &&
|
|
84830
|
-
draftIds !== undefined &&
|
|
84831
|
-
draftIds.length > 0) {
|
|
84832
|
-
const draftId = draftIds[draftIds.length - 1];
|
|
84833
|
-
draftManager
|
|
84834
|
-
.replaceAction(draftIdToReplace, draftId)
|
|
84835
|
-
.then(() => {
|
|
84836
|
-
onResponse(responseValue);
|
|
84837
|
-
})
|
|
84838
|
-
.catch((error) => {
|
|
84839
|
-
onResponse(convertErrorIntoNativeFetchError(error, 'Unknown error replacing draft'));
|
|
84840
|
-
});
|
|
84841
|
-
}
|
|
84842
|
-
else {
|
|
84843
|
-
let response = responseValue;
|
|
84844
|
-
response.error = createNativeFetchErrorResponse(NO_DRAFT_CREATED_MESSAGE);
|
|
84845
|
-
onResponse(response);
|
|
84846
|
-
}
|
|
84847
|
-
}, nativeAdapterRequestContext);
|
|
84848
|
-
}
|
|
84993
|
+
else {
|
|
84994
|
+
let response = responseValue;
|
|
84995
|
+
response.error = createNativeFetchErrorResponse(NO_DRAFT_CREATED_MESSAGE);
|
|
84996
|
+
onResponse(response);
|
|
84997
|
+
}
|
|
84998
|
+
}, nativeAdapterRequestContext);
|
|
84849
84999
|
});
|
|
84850
85000
|
}
|
|
84851
85001
|
/**
|
|
@@ -84953,11 +85103,11 @@ function invokeAdapterWithMetadataDeleteRecord(adapter, config, metadata, onResp
|
|
|
84953
85103
|
}
|
|
84954
85104
|
/*
|
|
84955
85105
|
//TODO W-10284305: Remove this function in 238
|
|
84956
|
-
This is a special case version of the
|
|
85106
|
+
This is a special case version of the invokeAdapterWithDraftToMerge function
|
|
84957
85107
|
which should only be used for the deleteRecord wire adapter, since it does not
|
|
84958
85108
|
contain record data in the result and has to do special querying of the draft queue
|
|
84959
85109
|
*/
|
|
84960
|
-
function
|
|
85110
|
+
function invokeAdapterWithDraftToMergeDeleteRecord(adapter, config, draftIdToReplace, onResponse, nativeAdapterRequestContext) {
|
|
84961
85111
|
const targetedRecordId = parse$1(config);
|
|
84962
85112
|
let priorDraftIds;
|
|
84963
85113
|
draftManager.getQueue().then((draftState) => {
|
|
@@ -85213,7 +85363,7 @@ const callbacks$1 = [];
|
|
|
85213
85363
|
function register(r) {
|
|
85214
85364
|
callbacks$1.forEach((callback) => callback(r));
|
|
85215
85365
|
}
|
|
85216
|
-
// version: 1.
|
|
85366
|
+
// version: 1.285.0-67d4d6869
|
|
85217
85367
|
|
|
85218
85368
|
/**
|
|
85219
85369
|
* Returns true if the value acts like a Promise, i.e. has a "then" function,
|
|
@@ -89197,6 +89347,32 @@ let trackedFieldDepthOnNotifyChange = 5;
|
|
|
89197
89347
|
* @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
|
|
89198
89348
|
*/
|
|
89199
89349
|
let trackedFieldLeafNodeIdAndNameOnly = false;
|
|
89350
|
+
/**
|
|
89351
|
+
* One store enabled Get Object Info adapter
|
|
89352
|
+
*/
|
|
89353
|
+
let oneStoreGetObjectInfoAdapter = undefined;
|
|
89354
|
+
/**
|
|
89355
|
+
* One store enabled Get Object Infos adapter
|
|
89356
|
+
*/
|
|
89357
|
+
let oneStoreGetObjectInfosAdapter = undefined;
|
|
89358
|
+
/**
|
|
89359
|
+
* Defines the configuration API and is exposed internally as well as externally.
|
|
89360
|
+
* Configuration for one store enabled REST adapters only.
|
|
89361
|
+
*/
|
|
89362
|
+
const configurationForOneStoreEnabledAdapters = {
|
|
89363
|
+
setGetObjectInfoAdapter: function (adapter) {
|
|
89364
|
+
oneStoreGetObjectInfoAdapter = adapter;
|
|
89365
|
+
},
|
|
89366
|
+
getGetObjectInfoAdapter: function () {
|
|
89367
|
+
return oneStoreGetObjectInfoAdapter;
|
|
89368
|
+
},
|
|
89369
|
+
setGetObjectInfosAdapter: function (adapter) {
|
|
89370
|
+
oneStoreGetObjectInfosAdapter = adapter;
|
|
89371
|
+
},
|
|
89372
|
+
getGetObjectInfosAdapter: function () {
|
|
89373
|
+
return oneStoreGetObjectInfosAdapter;
|
|
89374
|
+
},
|
|
89375
|
+
};
|
|
89200
89376
|
/**
|
|
89201
89377
|
* Defines the configuration API and is exposed internally as well as externally.
|
|
89202
89378
|
* Configuration for REST adapters only.
|
|
@@ -89261,6 +89437,7 @@ const configurationForRestAdapters = {
|
|
|
89261
89437
|
getDraftAwareCreateContentVersionAdapter: function () {
|
|
89262
89438
|
return draftAwareCreateContentVersionAdapter;
|
|
89263
89439
|
},
|
|
89440
|
+
...configurationForOneStoreEnabledAdapters,
|
|
89264
89441
|
};
|
|
89265
89442
|
/**
|
|
89266
89443
|
* Defines the configuration API and is exposed internally as well as externally.
|
|
@@ -89433,15 +89610,17 @@ function isFieldId(unknown) {
|
|
|
89433
89610
|
/**
|
|
89434
89611
|
* Returns the field API name, qualified with an object name if possible.
|
|
89435
89612
|
* @param value The value from which to get the qualified field API name.
|
|
89613
|
+
* @param onlyQualifiedFieldNames - Whether or not this function should skip fieldApiName that do not include the delimiter '.'
|
|
89436
89614
|
* @return The qualified field API name.
|
|
89437
89615
|
*/
|
|
89438
|
-
function getFieldApiName(value) {
|
|
89616
|
+
function getFieldApiName(value, onlyQualifiedFieldNames = false) {
|
|
89439
89617
|
// Note: tightening validation logic changes behavior from userland getting
|
|
89440
89618
|
// a server-provided error to the adapter noop'ing. In 224 we decided to not
|
|
89441
|
-
// change the behavior.
|
|
89619
|
+
// change the behavior. In 250 we decided to add the 'onlyQualifiedFieldName' flag to tighten the logic
|
|
89620
|
+
// optionally to avoid issues with persisted invalid field names.
|
|
89442
89621
|
if (isString(value)) {
|
|
89443
89622
|
const trimmed = value.trim();
|
|
89444
|
-
if (trimmed.length > 0) {
|
|
89623
|
+
if (trimmed.length > 0 && (onlyQualifiedFieldNames ? trimmed.indexOf('.') > -1 : true)) {
|
|
89445
89624
|
return trimmed;
|
|
89446
89625
|
}
|
|
89447
89626
|
}
|
|
@@ -89454,15 +89633,19 @@ function getFieldApiName(value) {
|
|
|
89454
89633
|
/**
|
|
89455
89634
|
* Returns the field API name.
|
|
89456
89635
|
* @param value The value from which to get the field API name.
|
|
89636
|
+
* @param options Option bag. onlyQualifiedFieldNames is a boolean that allows this function to skip returning invalid FieldApiNames.
|
|
89457
89637
|
* @returns The field API name.
|
|
89458
89638
|
*/
|
|
89459
|
-
function getFieldApiNamesArray(value) {
|
|
89639
|
+
function getFieldApiNamesArray(value, options = { onlyQualifiedFieldNames: false }) {
|
|
89460
89640
|
const valueArray = isArray(value) ? value : [value];
|
|
89461
89641
|
const array = [];
|
|
89462
89642
|
for (let i = 0, len = valueArray.length; i < len; i += 1) {
|
|
89463
89643
|
const item = valueArray[i];
|
|
89464
|
-
const apiName = getFieldApiName(item);
|
|
89644
|
+
const apiName = getFieldApiName(item, options.onlyQualifiedFieldNames);
|
|
89465
89645
|
if (apiName === undefined) {
|
|
89646
|
+
if (options.onlyQualifiedFieldNames) {
|
|
89647
|
+
continue; // Just skips invalid field names rather than failing to return an array at all
|
|
89648
|
+
}
|
|
89466
89649
|
return undefined;
|
|
89467
89650
|
}
|
|
89468
89651
|
push.call(array, apiName);
|
|
@@ -89811,7 +89994,11 @@ var DiscriminatorValues;
|
|
|
89811
89994
|
ObjectCreate$1(null);
|
|
89812
89995
|
ensureRegisteredOnce({
|
|
89813
89996
|
id: '@salesforce/lds-adapters-uiapi',
|
|
89814
|
-
configuration: {
|
|
89997
|
+
configuration: {
|
|
89998
|
+
...configurationForRestAdapters,
|
|
89999
|
+
...configurationForGraphQLAdapters,
|
|
90000
|
+
...configurationForOneStoreEnabledAdapters,
|
|
90001
|
+
},
|
|
89815
90002
|
instrument,
|
|
89816
90003
|
});
|
|
89817
90004
|
|
|
@@ -90127,5 +90314,5 @@ function handleInstrumentation(activity, stat, progress) {
|
|
|
90127
90314
|
const { luvio } = getRuntime();
|
|
90128
90315
|
setDefaultLuvio({ luvio });
|
|
90129
90316
|
|
|
90130
|
-
export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
|
|
90131
|
-
// version: 1.
|
|
90317
|
+
export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
|
|
90318
|
+
// version: 1.285.0-67d4d6869
|