@salesforce/lds-runtime-aura 1.403.0 → 1.404.0-dev10
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/ldsEngineCreator.js
CHANGED
|
@@ -22,8 +22,9 @@ import useCmpDefPredictions from '@salesforce/gate/lds.pdl.useCmpDefPredictions'
|
|
|
22
22
|
import applyPredictionRequestLimit from '@salesforce/gate/lds.pdl.applyRequestLimit';
|
|
23
23
|
import useLocalStorage from '@salesforce/gate/lds.pdl.useLocalStorage';
|
|
24
24
|
import useOneStoreGraphql from '@salesforce/gate/lds.oneStoreGraphqlEnabled.ltng';
|
|
25
|
+
import canCombineRecordLayoutRequests from '@salesforce/gate/lds.pdl.canCombineRecordLayoutRequests';
|
|
25
26
|
import { GetApexWireAdapterFactory, registerPrefetcher as registerPrefetcher$1 } from 'force/ldsAdaptersApex';
|
|
26
|
-
import { instrument, getRecordAvatarsAdapterFactory, getRecordAdapterFactory, coerceFieldIdArray, getRecordsAdapterFactory, getRecordActionsAdapterFactory, getObjectInfosAdapterFactory, coerceObjectIdArray, getObjectInfoAdapterFactory, coerceObjectId, getRelatedListsActionsAdapterFactory, getRelatedListInfoBatchAdapterFactory, getRelatedListInfoAdapterFactory, getRelatedListRecordsBatchAdapterFactory, getRelatedListRecordsAdapterFactory, getListInfoByNameAdapterFactory, getListInfosByObjectNameAdapterFactory, getListRecordsByNameAdapterFactory, getListObjectInfoAdapterFactory, getRelatedListsInfoAdapterFactory, getRelatedListActionsAdapterFactory, getRecordId18Array, buildRecordRepKeyFromId, configuration, InMemoryRecordRepresentationQueryEvaluator, UiApiNamespace, RecordRepresentationRepresentationType, registerPrefetcher, RecordRepresentationVersion } from 'force/ldsAdaptersUiapi';
|
|
27
|
+
import { instrument, getRecordAvatarsAdapterFactory, getRecordAdapterFactory, coerceFieldIdArray, coerceLayoutTypeArray, coerceLayoutModeArray, getRecordsAdapterFactory, getRecordActionsAdapterFactory, getObjectInfosAdapterFactory, coerceObjectIdArray, getObjectInfoAdapterFactory, coerceObjectId, getRelatedListsActionsAdapterFactory, getRelatedListInfoBatchAdapterFactory, getRelatedListInfoAdapterFactory, getRelatedListRecordsBatchAdapterFactory, getRelatedListRecordsAdapterFactory, getListInfoByNameAdapterFactory, getListInfosByObjectNameAdapterFactory, getListRecordsByNameAdapterFactory, getListObjectInfoAdapterFactory, getRelatedListsInfoAdapterFactory, getRelatedListActionsAdapterFactory, getRecordId18Array, buildRecordRepKeyFromId, configuration, InMemoryRecordRepresentationQueryEvaluator, UiApiNamespace, RecordRepresentationRepresentationType, registerPrefetcher, RecordRepresentationVersion } from 'force/ldsAdaptersUiapi';
|
|
27
28
|
import { getInstrumentation } from 'o11y/client';
|
|
28
29
|
import { findExecutableOperation, buildGraphQLInputExtension, addTypenameToDocument } from 'force/luvioGraphqlNormalization';
|
|
29
30
|
import { print, wrapConfigAndVerify, resolveAst, validateGraphQLOperations } from 'force/luvioOnestoreGraphqlParser';
|
|
@@ -41,6 +42,10 @@ import { instrument as instrument$5 } from '@lwc/state';
|
|
|
41
42
|
import { withRegistration, register, setDefaultLuvio } from 'force/ldsEngine';
|
|
42
43
|
import { pageScopedCache } from 'instrumentation/utility';
|
|
43
44
|
import { createStorage, clearStorages } from 'force/ldsStorage';
|
|
45
|
+
import lightningConnectEnabled from '@salesforce/gate/ui.services.LightningConnect.enabled';
|
|
46
|
+
import bypassAppRestrictionEnabled from '@salesforce/gate/ui.services.LightningConnect.BypassAppRestriction.enabled';
|
|
47
|
+
import csrfValidationEnabled from '@salesforce/gate/ui.services.LightningConnect.CsrfValidation.enabled';
|
|
48
|
+
import sessionApiEnabled from '@salesforce/gate/ui.uisdk.session.api.enabled';
|
|
44
49
|
import useHotspotLimit from '@salesforce/gate/lds.pdl.useHotspotLimit';
|
|
45
50
|
import useHttpUiapiOneApp from '@salesforce/gate/lds.useHttpUiapiOneApp';
|
|
46
51
|
import useHttpUiapiOneRuntime from '@salesforce/gate/lds.useHttpUiapiOneRuntime';
|
|
@@ -470,7 +475,12 @@ class AuraNetworkCommand extends NetworkCommand$1 {
|
|
|
470
475
|
this.coerceAuraErrors
|
|
471
476
|
);
|
|
472
477
|
} else if (this.shouldUseFetch()) {
|
|
473
|
-
|
|
478
|
+
const params = this.fetchParams;
|
|
479
|
+
try {
|
|
480
|
+
return this.convertFetchResponseToData(this.services.fetch(...params));
|
|
481
|
+
} catch (reason) {
|
|
482
|
+
return resolvedPromiseLike$2(err$1(toError(reason)));
|
|
483
|
+
}
|
|
474
484
|
}
|
|
475
485
|
return resolvedPromiseLike$2(err$1(toError("Aura/Fetch network services not found")));
|
|
476
486
|
}
|
|
@@ -1068,7 +1078,12 @@ let AuraCacheControlCommand$1 = class AuraCacheControlCommand extends CacheContr
|
|
|
1068
1078
|
(errs) => this.coerceAuraErrors(errs)
|
|
1069
1079
|
);
|
|
1070
1080
|
} else if (this.shouldUseFetch()) {
|
|
1071
|
-
|
|
1081
|
+
const params = this.fetchParams;
|
|
1082
|
+
try {
|
|
1083
|
+
return this.convertFetchResponseToData(this.services.fetch(...params));
|
|
1084
|
+
} catch (reason) {
|
|
1085
|
+
return resolvedPromiseLike$2(err$1(toError(reason)));
|
|
1086
|
+
}
|
|
1072
1087
|
}
|
|
1073
1088
|
return resolvedPromiseLike$2(err$1(toError("Aura/Fetch network services not found")));
|
|
1074
1089
|
}
|
|
@@ -1211,7 +1226,12 @@ class AuraCacheControlCommand extends CacheControlCommand {
|
|
|
1211
1226
|
(errs) => this.coerceAuraErrors(errs)
|
|
1212
1227
|
);
|
|
1213
1228
|
} else if (this.shouldUseFetch()) {
|
|
1214
|
-
|
|
1229
|
+
const params = this.fetchParams;
|
|
1230
|
+
try {
|
|
1231
|
+
return this.convertFetchResponseToData(this.services.fetch(...params));
|
|
1232
|
+
} catch (reason) {
|
|
1233
|
+
return resolvedPromiseLike$2(err$1(toError(reason)));
|
|
1234
|
+
}
|
|
1215
1235
|
}
|
|
1216
1236
|
return resolvedPromiseLike$2(err$1(toError("Aura/Fetch network services not found")));
|
|
1217
1237
|
}
|
|
@@ -1329,7 +1349,11 @@ class HttpCacheControlCommand extends CacheControlCommand {
|
|
|
1329
1349
|
return this.fetch();
|
|
1330
1350
|
}
|
|
1331
1351
|
fetch() {
|
|
1332
|
-
|
|
1352
|
+
try {
|
|
1353
|
+
return this.convertFetchResponseToData(this.services.fetch(...this.fetchParams));
|
|
1354
|
+
} catch (reason) {
|
|
1355
|
+
return resolvedPromiseLike$2(err$1(toError(reason)));
|
|
1356
|
+
}
|
|
1333
1357
|
}
|
|
1334
1358
|
async coerceError(errorResponse) {
|
|
1335
1359
|
return toError(errorResponse.statusText);
|
|
@@ -1532,7 +1556,11 @@ const _FetchNetworkCommand = class _FetchNetworkCommand extends NetworkCommand {
|
|
|
1532
1556
|
this.services = services;
|
|
1533
1557
|
}
|
|
1534
1558
|
fetch() {
|
|
1535
|
-
|
|
1559
|
+
try {
|
|
1560
|
+
return this.convertFetchResponseToData(this.services.fetch(...this.fetchParams));
|
|
1561
|
+
} catch (reason) {
|
|
1562
|
+
return resolvedPromiseLike$2(err$1(toError(reason)));
|
|
1563
|
+
}
|
|
1536
1564
|
}
|
|
1537
1565
|
async coerceError(errorResponse) {
|
|
1538
1566
|
return toError(errorResponse.statusText);
|
|
@@ -1588,7 +1616,11 @@ class StreamingCommand extends BaseCommand {
|
|
|
1588
1616
|
this.services = services;
|
|
1589
1617
|
}
|
|
1590
1618
|
execute() {
|
|
1591
|
-
|
|
1619
|
+
try {
|
|
1620
|
+
return this.convertFetchStreamResponseToData(this.services.fetch(...this.fetchParams));
|
|
1621
|
+
} catch (reason) {
|
|
1622
|
+
return resolvedPromiseLike$2(err$1(toError(reason)));
|
|
1623
|
+
}
|
|
1592
1624
|
}
|
|
1593
1625
|
convertFetchStreamResponseToData(response) {
|
|
1594
1626
|
return response.then(
|
|
@@ -2424,9 +2456,13 @@ class OnlyIfCachedCacheControlStrategy extends CacheControlStrategy {
|
|
|
2424
2456
|
}
|
|
2425
2457
|
get expiredChecks() {
|
|
2426
2458
|
return [
|
|
2427
|
-
|
|
2459
|
+
...super.expiredChecks,
|
|
2460
|
+
(cacheControlMetadata) => cacheControlMetadata.type === "no-cache"
|
|
2428
2461
|
];
|
|
2429
2462
|
}
|
|
2463
|
+
// Note: If we add support for `stale-while-revalidate` in the future, we may
|
|
2464
|
+
// need to further override expiredChecks to allow stale entries that are within the
|
|
2465
|
+
// stale-while-revalidate window to be returned for only-if-cached requests.
|
|
2430
2466
|
collectCacheHitInstrumentation(startTime, instrumentationAttributes) {
|
|
2431
2467
|
if (this.services.instrumentation) {
|
|
2432
2468
|
const meter = this.services.instrumentation.metrics.getMeter("onestore");
|
|
@@ -2666,7 +2702,7 @@ function buildServiceDescriptor$d(luvio) {
|
|
|
2666
2702
|
},
|
|
2667
2703
|
};
|
|
2668
2704
|
}
|
|
2669
|
-
// version: 1.
|
|
2705
|
+
// version: 1.404.0-dev10-1e49deeb66
|
|
2670
2706
|
|
|
2671
2707
|
/*!
|
|
2672
2708
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -2782,11 +2818,26 @@ class AuraGraphQLNormalizedCacheControlCommand extends AuraNormalizedCacheContro
|
|
|
2782
2818
|
return buildSubscribableResult$1(result, this.buildSubscribe(), () => this.refresh());
|
|
2783
2819
|
});
|
|
2784
2820
|
} else if (this.shouldUseFetch()) {
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2821
|
+
const params = this.originalFetchParams;
|
|
2822
|
+
try {
|
|
2823
|
+
return this.convertFetchResponseToData(this.services.fetch(...params)).then(
|
|
2824
|
+
(result) => {
|
|
2825
|
+
return buildSubscribableResult$1(
|
|
2826
|
+
result,
|
|
2827
|
+
this.buildSubscribe(),
|
|
2828
|
+
() => this.refresh()
|
|
2829
|
+
);
|
|
2830
|
+
}
|
|
2831
|
+
);
|
|
2832
|
+
} catch (reason) {
|
|
2833
|
+
return resolvedPromiseLike$2(
|
|
2834
|
+
buildSubscribableResult$1(
|
|
2835
|
+
err$1(toError(reason)),
|
|
2836
|
+
this.buildSubscribe(),
|
|
2837
|
+
() => this.refresh()
|
|
2838
|
+
)
|
|
2839
|
+
);
|
|
2840
|
+
}
|
|
2790
2841
|
}
|
|
2791
2842
|
return resolvedPromiseLike$2(
|
|
2792
2843
|
buildSubscribableResult$1(
|
|
@@ -3004,7 +3055,7 @@ function buildServiceDescriptor$9(notifyRecordUpdateAvailable, getNormalizedLuvi
|
|
|
3004
3055
|
},
|
|
3005
3056
|
};
|
|
3006
3057
|
}
|
|
3007
|
-
// version: 1.
|
|
3058
|
+
// version: 1.404.0-dev10-1e49deeb66
|
|
3008
3059
|
|
|
3009
3060
|
/*!
|
|
3010
3061
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -4707,7 +4758,7 @@ function getEnvironmentSetting(name) {
|
|
|
4707
4758
|
}
|
|
4708
4759
|
return undefined;
|
|
4709
4760
|
}
|
|
4710
|
-
// version: 1.
|
|
4761
|
+
// version: 1.404.0-dev10-1e49deeb66
|
|
4711
4762
|
|
|
4712
4763
|
/**
|
|
4713
4764
|
* Observability / Critical Availability Program (230+)
|
|
@@ -5717,6 +5768,9 @@ function buildLexRuntimeLuvio5xxStatusResponseInterceptor() {
|
|
|
5717
5768
|
|
|
5718
5769
|
const CSRF_TOKEN_KEY = 'salesforce_csrf_token';
|
|
5719
5770
|
const CSRF_STORAGE_NAME = 'ldsCSRFToken';
|
|
5771
|
+
const BASE_URI = '/services/data/v66.0';
|
|
5772
|
+
const UI_API_BASE_URI = `${BASE_URI}/ui-api`;
|
|
5773
|
+
const CSRF_TOKEN_ENDPOINT = `${UI_API_BASE_URI}/session/csrf`;
|
|
5720
5774
|
const CSRF_STORAGE_CONFIG = {
|
|
5721
5775
|
name: CSRF_STORAGE_NAME,
|
|
5722
5776
|
persistent: true,
|
|
@@ -5732,10 +5786,9 @@ const CSRF_STORAGE_CONFIG = {
|
|
|
5732
5786
|
*/
|
|
5733
5787
|
class CsrfTokenManager {
|
|
5734
5788
|
constructor() {
|
|
5789
|
+
this.tokenPromise = null;
|
|
5735
5790
|
// Initialize AuraStorage
|
|
5736
5791
|
this.storage = createStorage(CSRF_STORAGE_CONFIG);
|
|
5737
|
-
// Try to load token from AuraStorage on initialization
|
|
5738
|
-
this.tokenPromise = this.loadOrFetchToken();
|
|
5739
5792
|
}
|
|
5740
5793
|
static getInstance() {
|
|
5741
5794
|
if (!CsrfTokenManager.instance) {
|
|
@@ -5771,7 +5824,7 @@ class CsrfTokenManager {
|
|
|
5771
5824
|
*/
|
|
5772
5825
|
async fetchFreshToken() {
|
|
5773
5826
|
try {
|
|
5774
|
-
const response = await fetch(
|
|
5827
|
+
const response = await fetch(CSRF_TOKEN_ENDPOINT, {
|
|
5775
5828
|
method: 'GET',
|
|
5776
5829
|
credentials: 'same-origin',
|
|
5777
5830
|
});
|
|
@@ -5797,8 +5850,13 @@ class CsrfTokenManager {
|
|
|
5797
5850
|
}
|
|
5798
5851
|
/**
|
|
5799
5852
|
* Returns the current token value as a Promise.
|
|
5853
|
+
* Lazy-loads the token on first call (from cache or by fetching).
|
|
5800
5854
|
*/
|
|
5801
5855
|
async getToken() {
|
|
5856
|
+
// Lazy initialization: only fetch token when actually needed
|
|
5857
|
+
if (!this.tokenPromise) {
|
|
5858
|
+
this.tokenPromise = this.loadOrFetchToken();
|
|
5859
|
+
}
|
|
5802
5860
|
return this.tokenPromise;
|
|
5803
5861
|
}
|
|
5804
5862
|
/**
|
|
@@ -5830,6 +5888,23 @@ class CsrfTokenManager {
|
|
|
5830
5888
|
CsrfTokenManager.instance = null;
|
|
5831
5889
|
|
|
5832
5890
|
const CSRF_TOKEN_HEADER = 'X-CSRF-Token';
|
|
5891
|
+
/**
|
|
5892
|
+
* Checks if all required gates are enabled for CSRF token interceptor.
|
|
5893
|
+
*
|
|
5894
|
+
* @returns true if all gates are enabled, false otherwise
|
|
5895
|
+
*/
|
|
5896
|
+
function areCsrfGatesEnabled() {
|
|
5897
|
+
try {
|
|
5898
|
+
return (lightningConnectEnabled.isOpen({ fallback: false }) &&
|
|
5899
|
+
bypassAppRestrictionEnabled.isOpen({ fallback: false }) &&
|
|
5900
|
+
csrfValidationEnabled.isOpen({ fallback: false }) &&
|
|
5901
|
+
sessionApiEnabled.isOpen({ fallback: false }));
|
|
5902
|
+
}
|
|
5903
|
+
catch (error) {
|
|
5904
|
+
// If any gate check fails, disable CSRF interceptor
|
|
5905
|
+
return false;
|
|
5906
|
+
}
|
|
5907
|
+
}
|
|
5833
5908
|
/**
|
|
5834
5909
|
* Determines if the HTTP method requires CSRF protection.
|
|
5835
5910
|
* Only mutating operations (POST, PUT, PATCH, DELETE) require CSRF tokens.
|
|
@@ -5857,6 +5932,10 @@ function isCsrfMethod(method) {
|
|
|
5857
5932
|
function buildCsrfTokenInterceptor() {
|
|
5858
5933
|
const csrfTokenManager = CsrfTokenManager.getInstance();
|
|
5859
5934
|
return async (fetchArgs) => {
|
|
5935
|
+
// Check if all required gates are enabled before running
|
|
5936
|
+
if (!areCsrfGatesEnabled()) {
|
|
5937
|
+
return resolvedPromiseLike$2(fetchArgs);
|
|
5938
|
+
}
|
|
5860
5939
|
const [urlOrRequest, options] = fetchArgs;
|
|
5861
5940
|
// Determine the method from either Request object or options
|
|
5862
5941
|
let method;
|
|
@@ -5886,6 +5965,10 @@ function buildCsrfTokenInterceptor() {
|
|
|
5886
5965
|
function buildLuvioCsrfTokenInterceptor() {
|
|
5887
5966
|
const csrfTokenManager = CsrfTokenManager.getInstance();
|
|
5888
5967
|
return async (resourceRequest) => {
|
|
5968
|
+
// Check if all required gates are enabled before running
|
|
5969
|
+
if (!areCsrfGatesEnabled()) {
|
|
5970
|
+
return resolvedPromiseLike$2(resourceRequest);
|
|
5971
|
+
}
|
|
5889
5972
|
// Ensure headers object exists
|
|
5890
5973
|
if (!resourceRequest.headers) {
|
|
5891
5974
|
resourceRequest.headers = {};
|
|
@@ -6134,8 +6217,8 @@ async function isCsrfError(response) {
|
|
|
6134
6217
|
// Clone to avoid consuming the original response
|
|
6135
6218
|
const cloned = response.clone();
|
|
6136
6219
|
const body = await cloned.json();
|
|
6137
|
-
// Check the error array format:
|
|
6138
|
-
const errorCode = body?.
|
|
6220
|
+
// Check the error array format: body[0].errorCode
|
|
6221
|
+
const errorCode = body?.[0]?.errorCode;
|
|
6139
6222
|
return errorCode === 'INVALID_ACCESS_TOKEN';
|
|
6140
6223
|
}
|
|
6141
6224
|
catch {
|
|
@@ -6768,9 +6851,31 @@ function isFieldsRequest(config) {
|
|
|
6768
6851
|
config.modes === undefined &&
|
|
6769
6852
|
(config.fields !== undefined || config.optionalFields !== undefined));
|
|
6770
6853
|
}
|
|
6854
|
+
function isCombinableLayoutRequest(config) {
|
|
6855
|
+
// We will only consider a layout request combinable if it is a single layout type request
|
|
6856
|
+
// and the only request parameters are:
|
|
6857
|
+
// - layoutTypes
|
|
6858
|
+
// - optionalFields
|
|
6859
|
+
// - modes
|
|
6860
|
+
const hasExtraParams = config.childRelationships !== undefined ||
|
|
6861
|
+
config.pageSize !== undefined ||
|
|
6862
|
+
config.updateMru !== undefined;
|
|
6863
|
+
return config.layoutTypes !== undefined && !hasExtraParams;
|
|
6864
|
+
}
|
|
6865
|
+
function areCombinableLayoutRequests(reqA, reqB) {
|
|
6866
|
+
const normilizedLayoutTypesA = coerceLayoutTypeArray(reqA.layoutTypes) || [];
|
|
6867
|
+
const normilizedLayoutTypesB = coerceLayoutTypeArray(reqB.layoutTypes) || [];
|
|
6868
|
+
// Let's only combine when the layoutTypes are the same
|
|
6869
|
+
return (isCombinableLayoutRequest(reqA) &&
|
|
6870
|
+
isCombinableLayoutRequest(reqB) &&
|
|
6871
|
+
reqA.recordId === reqB.recordId &&
|
|
6872
|
+
normilizedLayoutTypesA.length === normilizedLayoutTypesB.length &&
|
|
6873
|
+
normilizedLayoutTypesA.every((type, index) => type === normilizedLayoutTypesB[index]));
|
|
6874
|
+
}
|
|
6771
6875
|
class GetRecordRequestStrategy extends LuvioAdapterRequestStrategy {
|
|
6772
|
-
constructor() {
|
|
6773
|
-
super(
|
|
6876
|
+
constructor(luvio, canCombineRecordLayoutRequests = false) {
|
|
6877
|
+
super(luvio);
|
|
6878
|
+
this.canCombineRecordLayoutRequests = canCombineRecordLayoutRequests;
|
|
6774
6879
|
this.adapterName = GET_RECORD_ADAPTER_NAME;
|
|
6775
6880
|
this.adapterFactory = getRecordAdapterFactory;
|
|
6776
6881
|
}
|
|
@@ -6799,10 +6904,41 @@ class GetRecordRequestStrategy extends LuvioAdapterRequestStrategy {
|
|
|
6799
6904
|
};
|
|
6800
6905
|
}
|
|
6801
6906
|
canCombine(reqA, reqB) {
|
|
6802
|
-
// must be same record and
|
|
6803
|
-
return reqA.recordId === reqB.recordId &&
|
|
6907
|
+
// must be same record and either both are fields requests or both are combinable layout requests
|
|
6908
|
+
return (reqA.recordId === reqB.recordId &&
|
|
6909
|
+
((isFieldsRequest(reqA) && isFieldsRequest(reqB)) ||
|
|
6910
|
+
(this.canCombineRecordLayoutRequests && areCombinableLayoutRequests(reqA, reqB))));
|
|
6804
6911
|
}
|
|
6805
6912
|
combineRequests(reqA, reqB) {
|
|
6913
|
+
if (isFieldsRequest(reqA)) {
|
|
6914
|
+
return this.combineFieldsRequests(reqA, reqB);
|
|
6915
|
+
}
|
|
6916
|
+
else {
|
|
6917
|
+
return this.combineLayoutRequests(reqA, reqB);
|
|
6918
|
+
}
|
|
6919
|
+
}
|
|
6920
|
+
combineLayoutRequests(reqA, reqB) {
|
|
6921
|
+
const combined = {
|
|
6922
|
+
recordId: reqA.recordId,
|
|
6923
|
+
layoutTypes: coerceLayoutTypeArray(reqA.layoutTypes),
|
|
6924
|
+
};
|
|
6925
|
+
// combine Modes.
|
|
6926
|
+
// Note: the || ['View'] is important; it is to cover the case in which it needs to
|
|
6927
|
+
// combine mode: undefined (defaults to View) with mode: ['something else than View']
|
|
6928
|
+
const modeA = coerceLayoutModeArray(reqA.modes) || ['View'];
|
|
6929
|
+
const modeB = coerceLayoutModeArray(reqB.modes) || ['View'];
|
|
6930
|
+
if (reqA.modes !== undefined || reqB.modes !== undefined) {
|
|
6931
|
+
combined.modes = Array.from(new Set([...modeA, ...modeB]));
|
|
6932
|
+
}
|
|
6933
|
+
// combine Optional Fields.
|
|
6934
|
+
const optionalFieldsA = coerceFieldIdArray(reqA.optionalFields, COERCE_FIELD_ID_ARRAY_OPTIONS) || [];
|
|
6935
|
+
const optionalFieldsB = coerceFieldIdArray(reqB.optionalFields, COERCE_FIELD_ID_ARRAY_OPTIONS) || [];
|
|
6936
|
+
if (optionalFieldsA !== undefined || optionalFieldsB !== undefined) {
|
|
6937
|
+
combined.optionalFields = Array.from(new Set([...optionalFieldsA, ...optionalFieldsB]));
|
|
6938
|
+
}
|
|
6939
|
+
return combined;
|
|
6940
|
+
}
|
|
6941
|
+
combineFieldsRequests(reqA, reqB) {
|
|
6806
6942
|
const fields = new Set();
|
|
6807
6943
|
const optionalFields = new Set();
|
|
6808
6944
|
if (reqA.fields !== undefined) {
|
|
@@ -9488,7 +9624,7 @@ function whenPredictionsReady(callback) {
|
|
|
9488
9624
|
}
|
|
9489
9625
|
function setupPredictivePrefetcher(luvio) {
|
|
9490
9626
|
const allStrategies = [
|
|
9491
|
-
new GetRecordRequestStrategy(luvio),
|
|
9627
|
+
new GetRecordRequestStrategy(luvio, canCombineRecordLayoutRequests.isOpen({ fallback: false })),
|
|
9492
9628
|
new GetRecordsRequestStrategy(luvio),
|
|
9493
9629
|
new GetRecordActionsRequestStrategy(luvio),
|
|
9494
9630
|
new GetRecordAvatarsRequestStrategy(luvio),
|
|
@@ -9781,4 +9917,4 @@ function ldsEngineCreator() {
|
|
|
9781
9917
|
}
|
|
9782
9918
|
|
|
9783
9919
|
export { LexRequestStrategy, PdlRequestPriority, buildPredictorForContext, ldsEngineCreator as default, initializeLDS, initializeOneStore, notifyUpdateAvailableFactory, registerRequestStrategy, saveRequestAsPrediction, unregisterRequestStrategy, whenPredictionsReady };
|
|
9784
|
-
// version: 1.
|
|
9920
|
+
// version: 1.404.0-dev10-5a5eea9232
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Luvio } from '@luvio/engine';
|
|
1
2
|
import type { GetRecordConfig } from '@salesforce/lds-adapters-uiapi';
|
|
2
3
|
import { LuvioAdapterRequestStrategy } from './luvio-adapter-request-strategy';
|
|
3
4
|
export type GetRecordRequest = {
|
|
@@ -9,12 +10,16 @@ type GetRecordContext = {
|
|
|
9
10
|
};
|
|
10
11
|
export declare const GET_RECORD_ADAPTER_NAME = "getRecord";
|
|
11
12
|
export declare class GetRecordRequestStrategy extends LuvioAdapterRequestStrategy<GetRecordConfig, GetRecordRequest, GetRecordContext> {
|
|
13
|
+
private readonly canCombineRecordLayoutRequests;
|
|
12
14
|
adapterName: string;
|
|
13
15
|
adapterFactory: import("@luvio/engine").AdapterFactory<GetRecordConfig, import("@salesforce/lds-adapters-uiapi").RecordRepresentation>;
|
|
16
|
+
constructor(luvio: Luvio, canCombineRecordLayoutRequests?: boolean);
|
|
14
17
|
buildConcreteRequest(similarRequest: GetRecordRequest, context: GetRecordContext): GetRecordRequest;
|
|
15
18
|
transformForSave(request: GetRecordRequest): GetRecordRequest;
|
|
16
19
|
canCombine(reqA: GetRecordConfig, reqB: GetRecordConfig): boolean;
|
|
17
20
|
combineRequests(reqA: GetRecordConfig, reqB: GetRecordConfig): GetRecordConfig;
|
|
21
|
+
combineLayoutRequests(reqA: GetRecordConfig, reqB: GetRecordConfig): GetRecordConfig;
|
|
22
|
+
combineFieldsRequests(reqA: GetRecordConfig, reqB: GetRecordConfig): GetRecordConfig;
|
|
18
23
|
isContextDependent(context: GetRecordContext, request: GetRecordRequest): boolean;
|
|
19
24
|
transformForSaveSimilarRequest(request: GetRecordRequest): GetRecordRequest;
|
|
20
25
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-runtime-aura",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.404.0-dev10",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "LDS engine for Aura runtime",
|
|
6
6
|
"main": "dist/ldsEngineCreator.js",
|
|
@@ -34,47 +34,49 @@
|
|
|
34
34
|
"release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-runtime-aura"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@conduit-client/service-provisioner": "3.
|
|
38
|
-
"@conduit-client/tools-core": "3.
|
|
39
|
-
"@salesforce/lds-adapters-apex": "^1.
|
|
40
|
-
"@salesforce/lds-adapters-uiapi": "^1.
|
|
41
|
-
"@salesforce/lds-ads-bridge": "^1.
|
|
42
|
-
"@salesforce/lds-aura-storage": "^1.
|
|
43
|
-
"@salesforce/lds-bindings": "^1.
|
|
44
|
-
"@salesforce/lds-instrumentation": "^1.
|
|
45
|
-
"@salesforce/lds-network-aura": "^1.
|
|
46
|
-
"@salesforce/lds-network-fetch": "^1.
|
|
37
|
+
"@conduit-client/service-provisioner": "3.7.0-dev2",
|
|
38
|
+
"@conduit-client/tools-core": "3.7.0-dev2",
|
|
39
|
+
"@salesforce/lds-adapters-apex": "^1.404.0-dev10",
|
|
40
|
+
"@salesforce/lds-adapters-uiapi": "^1.404.0-dev10",
|
|
41
|
+
"@salesforce/lds-ads-bridge": "^1.404.0-dev10",
|
|
42
|
+
"@salesforce/lds-aura-storage": "^1.404.0-dev10",
|
|
43
|
+
"@salesforce/lds-bindings": "^1.404.0-dev10",
|
|
44
|
+
"@salesforce/lds-instrumentation": "^1.404.0-dev10",
|
|
45
|
+
"@salesforce/lds-network-aura": "^1.404.0-dev10",
|
|
46
|
+
"@salesforce/lds-network-fetch": "^1.404.0-dev10",
|
|
47
47
|
"jwt-encode": "1.0.1"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@conduit-client/command-aura-graphql-normalized-cache-control": "3.
|
|
51
|
-
"@conduit-client/command-aura-network": "3.
|
|
52
|
-
"@conduit-client/command-aura-normalized-cache-control": "3.
|
|
53
|
-
"@conduit-client/command-aura-resource-cache-control": "3.
|
|
54
|
-
"@conduit-client/command-fetch-network": "3.
|
|
55
|
-
"@conduit-client/command-http-graphql-normalized-cache-control": "3.
|
|
56
|
-
"@conduit-client/command-http-normalized-cache-control": "3.
|
|
57
|
-
"@conduit-client/command-ndjson": "3.
|
|
58
|
-
"@conduit-client/command-network": "3.
|
|
59
|
-
"@conduit-client/command-sse": "3.
|
|
60
|
-
"@conduit-client/command-streaming": "3.
|
|
61
|
-
"@conduit-client/service-aura-network": "3.
|
|
62
|
-
"@conduit-client/service-
|
|
63
|
-
"@conduit-client/service-
|
|
64
|
-
"@conduit-client/service-cache
|
|
65
|
-
"@conduit-client/service-
|
|
66
|
-
"@conduit-client/service-
|
|
67
|
-
"@conduit-client/service-
|
|
68
|
-
"@conduit-client/service-
|
|
69
|
-
"@conduit-client/service-
|
|
70
|
-
"@conduit-client/
|
|
50
|
+
"@conduit-client/command-aura-graphql-normalized-cache-control": "3.7.0-dev2",
|
|
51
|
+
"@conduit-client/command-aura-network": "3.7.0-dev2",
|
|
52
|
+
"@conduit-client/command-aura-normalized-cache-control": "3.7.0-dev2",
|
|
53
|
+
"@conduit-client/command-aura-resource-cache-control": "3.7.0-dev2",
|
|
54
|
+
"@conduit-client/command-fetch-network": "3.7.0-dev2",
|
|
55
|
+
"@conduit-client/command-http-graphql-normalized-cache-control": "3.7.0-dev2",
|
|
56
|
+
"@conduit-client/command-http-normalized-cache-control": "3.7.0-dev2",
|
|
57
|
+
"@conduit-client/command-ndjson": "3.7.0-dev2",
|
|
58
|
+
"@conduit-client/command-network": "3.7.0-dev2",
|
|
59
|
+
"@conduit-client/command-sse": "3.7.0-dev2",
|
|
60
|
+
"@conduit-client/command-streaming": "3.7.0-dev2",
|
|
61
|
+
"@conduit-client/service-aura-network": "3.7.0-dev2",
|
|
62
|
+
"@conduit-client/service-bindings-imperative": "3.7.0-dev2",
|
|
63
|
+
"@conduit-client/service-bindings-lwc": "3.7.0-dev2",
|
|
64
|
+
"@conduit-client/service-cache": "3.7.0-dev2",
|
|
65
|
+
"@conduit-client/service-cache-control": "3.7.0-dev2",
|
|
66
|
+
"@conduit-client/service-cache-inclusion-policy": "3.7.0-dev2",
|
|
67
|
+
"@conduit-client/service-feature-flags": "3.7.0-dev2",
|
|
68
|
+
"@conduit-client/service-fetch-network": "3.7.0-dev2",
|
|
69
|
+
"@conduit-client/service-instrument-command": "3.7.0-dev2",
|
|
70
|
+
"@conduit-client/service-pubsub": "3.7.0-dev2",
|
|
71
|
+
"@conduit-client/service-store": "3.7.0-dev2",
|
|
72
|
+
"@conduit-client/utils": "3.7.0-dev2",
|
|
71
73
|
"@luvio/network-adapter-composable": "0.158.7",
|
|
72
74
|
"@luvio/network-adapter-fetch": "0.158.7",
|
|
73
75
|
"@lwc/state": "^0.23.0",
|
|
74
|
-
"@salesforce/lds-adapters-onestore-graphql": "^1.
|
|
75
|
-
"@salesforce/lds-adapters-uiapi-lex": "^1.
|
|
76
|
-
"@salesforce/lds-luvio-service": "^1.
|
|
77
|
-
"@salesforce/lds-luvio-uiapi-records-service": "^1.
|
|
76
|
+
"@salesforce/lds-adapters-onestore-graphql": "^1.404.0-dev10",
|
|
77
|
+
"@salesforce/lds-adapters-uiapi-lex": "^1.404.0-dev10",
|
|
78
|
+
"@salesforce/lds-luvio-service": "^1.404.0-dev10",
|
|
79
|
+
"@salesforce/lds-luvio-uiapi-records-service": "^1.404.0-dev10"
|
|
78
80
|
},
|
|
79
81
|
"luvioBundlesize": [
|
|
80
82
|
{
|
|
@@ -82,7 +84,7 @@
|
|
|
82
84
|
"maxSize": {
|
|
83
85
|
"none": "350 kB",
|
|
84
86
|
"min": "190 kB",
|
|
85
|
-
"compressed": "
|
|
87
|
+
"compressed": "57 kB"
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
],
|