@salesforce/lds-adapters-uiapi 1.113.0 → 1.114.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/es/es2018/uiapi-records-service.js +11 -6
- package/dist/types/src/util/lists.d.ts +2 -2
- package/dist/umd/es2018/uiapi-records-service.js +11 -6
- package/dist/umd/es5/uiapi-records-service.js +11 -6
- package/package.json +7 -7
- package/sfdc/graphqlAdapters.js +1 -1
- package/sfdc/index.js +12 -7
|
@@ -7299,14 +7299,15 @@ function buildDefaultsKey(listRef) {
|
|
|
7299
7299
|
* @param config getListUi config
|
|
7300
7300
|
* @param serverResponse ListUiRepresentation from the server
|
|
7301
7301
|
*/
|
|
7302
|
-
function addServerDefaults(config,
|
|
7303
|
-
|
|
7304
|
-
|
|
7302
|
+
function addServerDefaults(config, records, listReference, context) {
|
|
7303
|
+
// If the request already contains the potential default information,
|
|
7304
|
+
// or the response does not come back with a default
|
|
7305
|
+
if (config.sortBy !== undefined || records.sortBy === null) {
|
|
7305
7306
|
return;
|
|
7306
7307
|
}
|
|
7307
7308
|
const key = buildDefaultsKey(listReference);
|
|
7308
7309
|
const currentDefaults = context.get(key) || {};
|
|
7309
|
-
context.set(key, { ...currentDefaults, sortBy });
|
|
7310
|
+
context.set(key, { ...currentDefaults, sortBy: records.sortBy });
|
|
7310
7311
|
}
|
|
7311
7312
|
/**
|
|
7312
7313
|
* Returns default values observed on previous requests for a list.
|
|
@@ -7456,11 +7457,14 @@ function keyBuilder$2w(luvio, params) {
|
|
|
7456
7457
|
// Fetch listReference from internal store to better ensure a cache hit regardless of listViewApiName or listViewId
|
|
7457
7458
|
const listReference = getListReference(query, context$1);
|
|
7458
7459
|
if (listReference !== undefined) {
|
|
7460
|
+
// Check and use any default values returned from the server (i.e. sortBy)
|
|
7461
|
+
const config = { ...params.urlParams, ...params.queryParams };
|
|
7462
|
+
const defaults = getServerDefaults(config, context$1);
|
|
7459
7463
|
return keyBuilder$2C(luvio, {
|
|
7460
7464
|
objectApiName: listReference.objectApiName,
|
|
7461
7465
|
listViewApiName: listReference.listViewApiName,
|
|
7462
7466
|
listViewId: listReference.id,
|
|
7463
|
-
sortBy: params.queryParams.sortBy || [],
|
|
7467
|
+
sortBy: params.queryParams.sortBy || defaults.sortBy || [],
|
|
7464
7468
|
});
|
|
7465
7469
|
}
|
|
7466
7470
|
// If there are no matching entries in the store, then we haven't fetched any data for this list view yet.
|
|
@@ -9086,7 +9090,7 @@ function onResourceSuccess_getListUi(luvio, context, config, response) {
|
|
|
9086
9090
|
// remember the id/name of this list
|
|
9087
9091
|
addListReference(listReference, context);
|
|
9088
9092
|
// remember any default values that the server filled in
|
|
9089
|
-
addServerDefaults(config, body, context);
|
|
9093
|
+
addServerDefaults(config, body.records, listReference, context);
|
|
9090
9094
|
// build the selector while the list info is still easily accessible
|
|
9091
9095
|
const fragment = buildListUiFragment(config, context, fields);
|
|
9092
9096
|
luvio.storeIngest(listUiKey, ingest$1p, body);
|
|
@@ -49175,6 +49179,7 @@ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
|
49175
49179
|
// Note: The original listReference will remain unchanged in the response.
|
|
49176
49180
|
mutatedListRef.id = body.listInfoETag;
|
|
49177
49181
|
addListReferenceWithId(mutatedListRef, context, body.listReference.id);
|
|
49182
|
+
addServerDefaults(config, body, originalListRef, context);
|
|
49178
49183
|
}
|
|
49179
49184
|
return onFetchResponseSuccess$2(luvio, config, resourceParams, response);
|
|
49180
49185
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Luvio, PathSelection, AdapterContext, Snapshot, FulfilledSnapshot, StaleSnapshot, StoreLookup } from '@luvio/engine';
|
|
2
2
|
import type { ListInfoRepresentation } from '../generated/types/ListInfoRepresentation';
|
|
3
3
|
import type { ListReferenceRepresentation } from '../generated/types/ListReferenceRepresentation';
|
|
4
|
-
import type { ListUiRepresentation } from '../generated/types/ListUiRepresentation';
|
|
5
4
|
import type { RecordRepresentation } from '../generated/types/RecordRepresentation';
|
|
5
|
+
import type { ListRecordCollectionRepresentation } from '../generated/types/ListRecordCollectionRepresentation';
|
|
6
6
|
export interface ListReferenceQuery {
|
|
7
7
|
listViewId?: string;
|
|
8
8
|
objectApiName?: string;
|
|
@@ -57,7 +57,7 @@ export interface ServerDefaults {
|
|
|
57
57
|
* @param config getListUi config
|
|
58
58
|
* @param serverResponse ListUiRepresentation from the server
|
|
59
59
|
*/
|
|
60
|
-
export declare function addServerDefaults(config: ListReferenceQuery & ServerDefaultable,
|
|
60
|
+
export declare function addServerDefaults(config: ListReferenceQuery & ServerDefaultable, records: ListRecordCollectionRepresentation, listReference: ListReferenceRepresentation, context: AdapterContext): void;
|
|
61
61
|
/**
|
|
62
62
|
* Returns default values observed on previous requests for a list.
|
|
63
63
|
*
|
|
@@ -7301,14 +7301,15 @@
|
|
|
7301
7301
|
* @param config getListUi config
|
|
7302
7302
|
* @param serverResponse ListUiRepresentation from the server
|
|
7303
7303
|
*/
|
|
7304
|
-
function addServerDefaults(config,
|
|
7305
|
-
|
|
7306
|
-
|
|
7304
|
+
function addServerDefaults(config, records, listReference, context) {
|
|
7305
|
+
// If the request already contains the potential default information,
|
|
7306
|
+
// or the response does not come back with a default
|
|
7307
|
+
if (config.sortBy !== undefined || records.sortBy === null) {
|
|
7307
7308
|
return;
|
|
7308
7309
|
}
|
|
7309
7310
|
const key = buildDefaultsKey(listReference);
|
|
7310
7311
|
const currentDefaults = context.get(key) || {};
|
|
7311
|
-
context.set(key, { ...currentDefaults, sortBy });
|
|
7312
|
+
context.set(key, { ...currentDefaults, sortBy: records.sortBy });
|
|
7312
7313
|
}
|
|
7313
7314
|
/**
|
|
7314
7315
|
* Returns default values observed on previous requests for a list.
|
|
@@ -7458,11 +7459,14 @@
|
|
|
7458
7459
|
// Fetch listReference from internal store to better ensure a cache hit regardless of listViewApiName or listViewId
|
|
7459
7460
|
const listReference = getListReference(query, context$1);
|
|
7460
7461
|
if (listReference !== undefined) {
|
|
7462
|
+
// Check and use any default values returned from the server (i.e. sortBy)
|
|
7463
|
+
const config = { ...params.urlParams, ...params.queryParams };
|
|
7464
|
+
const defaults = getServerDefaults(config, context$1);
|
|
7461
7465
|
return keyBuilder$2C(luvio, {
|
|
7462
7466
|
objectApiName: listReference.objectApiName,
|
|
7463
7467
|
listViewApiName: listReference.listViewApiName,
|
|
7464
7468
|
listViewId: listReference.id,
|
|
7465
|
-
sortBy: params.queryParams.sortBy || [],
|
|
7469
|
+
sortBy: params.queryParams.sortBy || defaults.sortBy || [],
|
|
7466
7470
|
});
|
|
7467
7471
|
}
|
|
7468
7472
|
// If there are no matching entries in the store, then we haven't fetched any data for this list view yet.
|
|
@@ -9088,7 +9092,7 @@
|
|
|
9088
9092
|
// remember the id/name of this list
|
|
9089
9093
|
addListReference(listReference, context);
|
|
9090
9094
|
// remember any default values that the server filled in
|
|
9091
|
-
addServerDefaults(config, body, context);
|
|
9095
|
+
addServerDefaults(config, body.records, listReference, context);
|
|
9092
9096
|
// build the selector while the list info is still easily accessible
|
|
9093
9097
|
const fragment = buildListUiFragment(config, context, fields);
|
|
9094
9098
|
luvio.storeIngest(listUiKey, ingest$1p, body);
|
|
@@ -49177,6 +49181,7 @@
|
|
|
49177
49181
|
// Note: The original listReference will remain unchanged in the response.
|
|
49178
49182
|
mutatedListRef.id = body.listInfoETag;
|
|
49179
49183
|
addListReferenceWithId(mutatedListRef, context, body.listReference.id);
|
|
49184
|
+
addServerDefaults(config, body, originalListRef, context);
|
|
49180
49185
|
}
|
|
49181
49186
|
return onFetchResponseSuccess$2(luvio, config, resourceParams, response);
|
|
49182
49187
|
}
|
|
@@ -7372,14 +7372,15 @@
|
|
|
7372
7372
|
* @param config getListUi config
|
|
7373
7373
|
* @param serverResponse ListUiRepresentation from the server
|
|
7374
7374
|
*/
|
|
7375
|
-
function addServerDefaults(config,
|
|
7376
|
-
|
|
7377
|
-
|
|
7375
|
+
function addServerDefaults(config, records, listReference, context) {
|
|
7376
|
+
// If the request already contains the potential default information,
|
|
7377
|
+
// or the response does not come back with a default
|
|
7378
|
+
if (config.sortBy !== undefined || records.sortBy === null) {
|
|
7378
7379
|
return;
|
|
7379
7380
|
}
|
|
7380
7381
|
var key = buildDefaultsKey(listReference);
|
|
7381
7382
|
var currentDefaults = context.get(key) || {};
|
|
7382
|
-
context.set(key, __assign(__assign({}, currentDefaults), { sortBy: sortBy }));
|
|
7383
|
+
context.set(key, __assign(__assign({}, currentDefaults), { sortBy: records.sortBy }));
|
|
7383
7384
|
}
|
|
7384
7385
|
/**
|
|
7385
7386
|
* Returns default values observed on previous requests for a list.
|
|
@@ -7530,11 +7531,14 @@
|
|
|
7530
7531
|
// Fetch listReference from internal store to better ensure a cache hit regardless of listViewApiName or listViewId
|
|
7531
7532
|
var listReference = getListReference(query, context$1);
|
|
7532
7533
|
if (listReference !== undefined) {
|
|
7534
|
+
// Check and use any default values returned from the server (i.e. sortBy)
|
|
7535
|
+
var config = __assign(__assign({}, params.urlParams), params.queryParams);
|
|
7536
|
+
var defaults = getServerDefaults(config, context$1);
|
|
7533
7537
|
return keyBuilder$2C(luvio, {
|
|
7534
7538
|
objectApiName: listReference.objectApiName,
|
|
7535
7539
|
listViewApiName: listReference.listViewApiName,
|
|
7536
7540
|
listViewId: listReference.id,
|
|
7537
|
-
sortBy: params.queryParams.sortBy || [],
|
|
7541
|
+
sortBy: params.queryParams.sortBy || defaults.sortBy || [],
|
|
7538
7542
|
});
|
|
7539
7543
|
}
|
|
7540
7544
|
// If there are no matching entries in the store, then we haven't fetched any data for this list view yet.
|
|
@@ -9135,7 +9139,7 @@
|
|
|
9135
9139
|
// remember the id/name of this list
|
|
9136
9140
|
addListReference(listReference, context);
|
|
9137
9141
|
// remember any default values that the server filled in
|
|
9138
|
-
addServerDefaults(config, body, context);
|
|
9142
|
+
addServerDefaults(config, body.records, listReference, context);
|
|
9139
9143
|
// build the selector while the list info is still easily accessible
|
|
9140
9144
|
var fragment = buildListUiFragment(config, context, fields);
|
|
9141
9145
|
luvio.storeIngest(listUiKey, ingest$1p, body);
|
|
@@ -48864,6 +48868,7 @@
|
|
|
48864
48868
|
// Note: The original listReference will remain unchanged in the response.
|
|
48865
48869
|
mutatedListRef.id = body.listInfoETag;
|
|
48866
48870
|
addListReferenceWithId(mutatedListRef, context, body.listReference.id);
|
|
48871
|
+
addServerDefaults(config, body, originalListRef, context);
|
|
48867
48872
|
}
|
|
48868
48873
|
return onFetchResponseSuccess$2(luvio, config, resourceParams, response);
|
|
48869
48874
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-adapters-uiapi",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.114.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "Wire adapters for record related UI API endpoints",
|
|
6
6
|
"main": "dist/umd/es2018/uiapi-records-service.js",
|
|
@@ -69,15 +69,15 @@
|
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"@luvio/graphql-parser": "0.137.1",
|
|
72
|
-
"@salesforce/lds-bindings": "^1.
|
|
73
|
-
"@salesforce/lds-default-luvio": "^1.
|
|
72
|
+
"@salesforce/lds-bindings": "^1.114.0",
|
|
73
|
+
"@salesforce/lds-default-luvio": "^1.114.0"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@databases/sqlite": "^3.0.0",
|
|
77
|
-
"@salesforce/lds-compiler-plugins": "^1.
|
|
78
|
-
"@salesforce/lds-jest": "^1.
|
|
79
|
-
"@salesforce/lds-karma": "^1.
|
|
80
|
-
"@salesforce/lds-store-binary": "^1.
|
|
77
|
+
"@salesforce/lds-compiler-plugins": "^1.114.0",
|
|
78
|
+
"@salesforce/lds-jest": "^1.114.0",
|
|
79
|
+
"@salesforce/lds-karma": "^1.114.0",
|
|
80
|
+
"@salesforce/lds-store-binary": "^1.114.0",
|
|
81
81
|
"brotli-size": "4.0.0",
|
|
82
82
|
"bytes": "3.1.2",
|
|
83
83
|
"extract-zip": "^2.0.1",
|
package/sfdc/graphqlAdapters.js
CHANGED
|
@@ -17815,4 +17815,4 @@ register({
|
|
|
17815
17815
|
});
|
|
17816
17816
|
|
|
17817
17817
|
export { configurationForGraphQLAdapters as configuration, graphql, factory$1 as graphqlAdapterFactory, graphqlBatch, graphqlBatch_imperative, graphql_imperative };
|
|
17818
|
-
// version: 1.
|
|
17818
|
+
// version: 1.114.0-16d81e7
|
package/sfdc/index.js
CHANGED
|
@@ -6829,14 +6829,15 @@ function buildDefaultsKey(listRef) {
|
|
|
6829
6829
|
* @param config getListUi config
|
|
6830
6830
|
* @param serverResponse ListUiRepresentation from the server
|
|
6831
6831
|
*/
|
|
6832
|
-
function addServerDefaults(config,
|
|
6833
|
-
|
|
6834
|
-
|
|
6832
|
+
function addServerDefaults(config, records, listReference, context) {
|
|
6833
|
+
// If the request already contains the potential default information,
|
|
6834
|
+
// or the response does not come back with a default
|
|
6835
|
+
if (config.sortBy !== undefined || records.sortBy === null) {
|
|
6835
6836
|
return;
|
|
6836
6837
|
}
|
|
6837
6838
|
const key = buildDefaultsKey(listReference);
|
|
6838
6839
|
const currentDefaults = context.get(key) || {};
|
|
6839
|
-
context.set(key, { ...currentDefaults, sortBy });
|
|
6840
|
+
context.set(key, { ...currentDefaults, sortBy: records.sortBy });
|
|
6840
6841
|
}
|
|
6841
6842
|
/**
|
|
6842
6843
|
* Returns default values observed on previous requests for a list.
|
|
@@ -6986,11 +6987,14 @@ function keyBuilder$1L(luvio, params) {
|
|
|
6986
6987
|
// Fetch listReference from internal store to better ensure a cache hit regardless of listViewApiName or listViewId
|
|
6987
6988
|
const listReference = getListReference(query, context$1);
|
|
6988
6989
|
if (listReference !== undefined) {
|
|
6990
|
+
// Check and use any default values returned from the server (i.e. sortBy)
|
|
6991
|
+
const config = { ...params.urlParams, ...params.queryParams };
|
|
6992
|
+
const defaults = getServerDefaults(config, context$1);
|
|
6989
6993
|
return keyBuilder$1N(luvio, {
|
|
6990
6994
|
objectApiName: listReference.objectApiName,
|
|
6991
6995
|
listViewApiName: listReference.listViewApiName,
|
|
6992
6996
|
listViewId: listReference.id,
|
|
6993
|
-
sortBy: params.queryParams.sortBy || [],
|
|
6997
|
+
sortBy: params.queryParams.sortBy || defaults.sortBy || [],
|
|
6994
6998
|
});
|
|
6995
6999
|
}
|
|
6996
7000
|
// If there are no matching entries in the store, then we haven't fetched any data for this list view yet.
|
|
@@ -8616,7 +8620,7 @@ function onResourceSuccess_getListUi(luvio, context, config, response) {
|
|
|
8616
8620
|
// remember the id/name of this list
|
|
8617
8621
|
addListReference(listReference, context);
|
|
8618
8622
|
// remember any default values that the server filled in
|
|
8619
|
-
addServerDefaults(config, body, context);
|
|
8623
|
+
addServerDefaults(config, body.records, listReference, context);
|
|
8620
8624
|
// build the selector while the list info is still easily accessible
|
|
8621
8625
|
const fragment = buildListUiFragment(config, context, fields);
|
|
8622
8626
|
luvio.storeIngest(listUiKey, ingest$E, body);
|
|
@@ -31756,6 +31760,7 @@ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
|
31756
31760
|
// Note: The original listReference will remain unchanged in the response.
|
|
31757
31761
|
mutatedListRef.id = body.listInfoETag;
|
|
31758
31762
|
addListReferenceWithId(mutatedListRef, context, body.listReference.id);
|
|
31763
|
+
addServerDefaults(config, body, originalListRef, context);
|
|
31759
31764
|
}
|
|
31760
31765
|
return onFetchResponseSuccess$2(luvio, config, resourceParams, response);
|
|
31761
31766
|
}
|
|
@@ -35913,4 +35918,4 @@ withDefaultLuvio((luvio) => {
|
|
|
35913
35918
|
});
|
|
35914
35919
|
|
|
35915
35920
|
export { InMemoryRecordRepresentationQueryEvaluator, MRU, RepresentationType$I as ObjectInfoRepresentationType, RepresentationType$N as RecordRepresentationRepresentationType, TTL$v as RecordRepresentationTTL, RepresentationType$N as RecordRepresentationType, VERSION$14 as RecordRepresentationVersion, keyPrefix as UiApiNamespace, configurationForRestAdapters as configuration, createContentDocumentAndVersion, createContentVersion, createIngestRecordWithFields, createRecord, deleteRecord, getActionOverrides, getActionOverrides_imperative, getAllApps, getAllApps_imperative, getAppDetails, getAppDetails_imperative, getDuplicateConfiguration, getDuplicateConfiguration_imperative, getDuplicates, getDuplicates_imperative, getGlobalActions, getGlobalActions_imperative, getKeywordSearchResults, getKeywordSearchResults_imperative, getLayout, getLayoutUserState, getLayoutUserState_imperative, getLayout_imperative, getListInfoByName, getListInfoByName_imperative, getListInfosByName, getListInfosByName_imperative, getListRecordsByName, getListRecordsByName_imperative, getListUi, getListUi_imperative, getLookupActions, getLookupActions_imperative, getLookupMetadata, getLookupMetadata_imperative, getLookupRecords, getLookupRecords_imperative, getNavItems, getNavItems_imperative, getObjectCreateActions, getObjectCreateActions_imperative, getObjectInfo, getObjectInfoAdapterFactory, getObjectInfo_imperative, getObjectInfos, getObjectInfosAdapterFactory, getObjectInfos_imperative, getPicklistValues, getPicklistValuesByRecordType, getPicklistValuesByRecordType_imperative, getPicklistValues_imperative, getQuickActionDefaults, getQuickActionDefaults_imperative, getQuickActionLayout, getQuickActionLayout_imperative, getRecord, getRecordActions, getRecordActions_imperative, factory$e as getRecordAdapterFactory, getRecordAvatars, getRecordAvatars_imperative, getRecordCreateDefaults, getRecordCreateDefaults_imperative, getRecordEditActions, getRecordEditActions_imperative, getRecordId18, getRecordNotifyChange, getRecordTemplateClone, getRecordTemplateClone_imperative, getRecordTemplateCreate, getRecordTemplateCreate_imperative, getRecordUi, getRecordUi_imperative, getRecord_imperative, getRecords, getRecords_imperative, getRelatedListActions, getRelatedListActions_imperative, getRelatedListCount, getRelatedListCount_imperative, getRelatedListInfo, getRelatedListInfoBatch, getRelatedListInfoBatch_imperative, getRelatedListInfo_imperative, getRelatedListPreferences, getRelatedListPreferencesBatch, getRelatedListPreferencesBatch_imperative, getRelatedListPreferences_imperative, getRelatedListRecordActions, getRelatedListRecordActions_imperative, getRelatedListRecords, getRelatedListRecordsBatch, getRelatedListRecordsBatch_imperative, getRelatedListRecords_imperative, getRelatedListsActions, getRelatedListsActions_imperative, getRelatedListsCount, getRelatedListsCount_imperative, getRelatedListsInfo, getRelatedListsInfo_imperative, getResponseCacheKeys as getResponseCacheKeysContentDocumentCompositeRepresentation, getSearchFilterMetadata, getSearchFilterMetadata_imperative, getSearchFilterOptions, getSearchFilterOptions_imperative, getSearchResults, getSearchResults_imperative, getTypeCacheKeys$N as getTypeCacheKeysRecord, ingest as ingestContentDocumentCompositeRepresentation, ingest$B as ingestObjectInfo, ingest$x as ingestQuickActionExecutionRepresentation, ingest$G as ingestRecord, instrument, keyBuilder as keyBuilderContentDocumentCompositeRepresentation, keyBuilderFromType as keyBuilderFromTypeContentDocumentCompositeRepresentation, keyBuilderFromType$x as keyBuilderFromTypeRecordRepresentation, keyBuilder$1F as keyBuilderObjectInfo, keyBuilder$1z as keyBuilderQuickActionExecutionRepresentation, keyBuilder$1Q as keyBuilderRecord, notifyRecordUpdateAvailable, performQuickAction, performUpdateRecordQuickAction, refresh, updateLayoutUserState, updateRecord, updateRecordAvatar, updateRelatedListInfo, updateRelatedListPreferences };
|
|
35916
|
-
// version: 1.
|
|
35921
|
+
// version: 1.114.0-16d81e7
|