@salesforce/lds-runtime-aura 1.335.0 → 1.337.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.
@@ -17,10 +17,11 @@ import ldsTrackedFieldsBehaviorGate from '@salesforce/gate/lds.useNewTrackedFiel
17
17
  import usePredictiveLoading from '@salesforce/gate/lds.usePredictiveLoading';
18
18
  import useApexPredictions from '@salesforce/gate/lds.pdl.useApexPredictions';
19
19
  import useRelatedListsPredictions from '@salesforce/gate/lds.pdl.useRelatedListsPredictions';
20
+ import useRelatedListPlus from '@salesforce/gate/lds.pdl.useRelatedListPlus';
20
21
  import useCmpDefPredictions from '@salesforce/gate/lds.pdl.useCmpDefPredictions';
21
22
  import applyPredictionRequestLimit from '@salesforce/gate/lds.pdl.applyRequestLimit';
22
23
  import { GetApexWireAdapterFactory, registerPrefetcher as registerPrefetcher$1 } from 'force/ldsAdaptersApex';
23
- import { getRecordAvatarsAdapterFactory, getRecordAdapterFactory, coerceFieldIdArray, getRecordsAdapterFactory, getRecordActionsAdapterFactory, getObjectInfosAdapterFactory, coerceObjectIdArray, getObjectInfoAdapterFactory, coerceObjectId, getRelatedListsActionsAdapterFactory, getRelatedListInfoBatchAdapterFactory, getRelatedListInfoAdapterFactory, getRelatedListRecordsBatchAdapterFactory, getRelatedListRecordsAdapterFactory, getListInfoByNameAdapterFactory, getListInfosByObjectNameAdapterFactory, getListRecordsByNameAdapterFactory, getListObjectInfoAdapterFactory, instrument, configuration, InMemoryRecordRepresentationQueryEvaluator, UiApiNamespace, RecordRepresentationRepresentationType, registerPrefetcher } from 'force/ldsAdaptersUiapi';
24
+ import { getRecordAvatarsAdapterFactory, getRecordAdapterFactory, coerceFieldIdArray, getRecordsAdapterFactory, getRecordActionsAdapterFactory, getObjectInfosAdapterFactory, coerceObjectIdArray, getObjectInfoAdapterFactory, coerceObjectId, getRelatedListsActionsAdapterFactory, getRelatedListInfoBatchAdapterFactory, getRelatedListInfoAdapterFactory, getRelatedListRecordsBatchAdapterFactory, getRelatedListRecordsAdapterFactory, getListInfoByNameAdapterFactory, getListInfosByObjectNameAdapterFactory, getListRecordsByNameAdapterFactory, getListObjectInfoAdapterFactory, getRelatedListsInfoAdapterFactory, instrument, configuration, InMemoryRecordRepresentationQueryEvaluator, UiApiNamespace, RecordRepresentationRepresentationType, registerPrefetcher } from 'force/ldsAdaptersUiapi';
24
25
  import { getInstrumentation } from 'o11y/client';
25
26
  import { setServices } from 'force/luvioServiceProvisioner1';
26
27
  import oneStoreEnabled from '@salesforce/gate/lds.oneStoreEnabled.ltng';
@@ -37,7 +38,6 @@ import useHotspotLimit from '@salesforce/gate/lds.pdl.useHotspotLimit';
37
38
  import { createStorage, clearStorages } from 'force/ldsStorage';
38
39
  import useHttpInsteadAuraTransport from '@salesforce/gate/lds.useHttpInsteadAuraTransport';
39
40
  import { ThirdPartyTracker } from 'instrumentation:beaconLib';
40
- import { getObjectInfo, getObjectInfos } from 'force/ldsAdaptersUiapiLex';
41
41
 
42
42
  /**
43
43
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -1059,7 +1059,60 @@ class DefaultRecordableCache {
1059
1059
  return this.baseCache.toKeySet(keys);
1060
1060
  }
1061
1061
  record() {
1062
- return this.baseCache.record();
1062
+ return new DefaultRecordableCache(this);
1063
+ }
1064
+ filter(predicate) {
1065
+ return new DefaultFilteredCache(this, predicate);
1066
+ }
1067
+ }
1068
+ /**
1069
+ A utility class for filtering cache entries based on a given predicate.
1070
+ */
1071
+ class DefaultFilteredCache {
1072
+ constructor(baseCache, predicate) {
1073
+ this.baseCache = baseCache;
1074
+ this.predicate = predicate;
1075
+ }
1076
+ delete(key) {
1077
+ this.baseCache.delete(key);
1078
+ }
1079
+ get(key) {
1080
+ const result = this.baseCache.get(key);
1081
+ // if we're chaining filtered caches together, then it's possible the result will be undefined here
1082
+ if (result && this.predicate(key, result)) {
1083
+ return result;
1084
+ }
1085
+ return undefined;
1086
+ }
1087
+ set(key, value) {
1088
+ this.baseCache.set(key, value);
1089
+ }
1090
+ length() {
1091
+ return this.getFilteredKeys().length;
1092
+ }
1093
+ keys() {
1094
+ return this.getFilteredKeys();
1095
+ }
1096
+ toKeySet(keys) {
1097
+ return this.baseCache.toKeySet(keys);
1098
+ }
1099
+ record() {
1100
+ return new DefaultRecordableCache(this);
1101
+ }
1102
+ filter(predicate) {
1103
+ return new DefaultFilteredCache(this, predicate);
1104
+ }
1105
+ getFilteredKeys() {
1106
+ const filteredKeySet = new KeySetImpl();
1107
+ this.baseCache
1108
+ .keys()
1109
+ .elements()
1110
+ .forEach((key) => {
1111
+ if (this.get(key)) {
1112
+ filteredKeySet.add(key);
1113
+ }
1114
+ });
1115
+ return filteredKeySet;
1063
1116
  }
1064
1117
  }
1065
1118
 
@@ -1108,6 +1161,9 @@ class DefaultCache {
1108
1161
  record() {
1109
1162
  return new DefaultRecordableCache(this);
1110
1163
  }
1164
+ filter(predicate) {
1165
+ return new DefaultFilteredCache(this, predicate);
1166
+ }
1111
1167
  }
1112
1168
 
1113
1169
  function buildServiceDescriptor$2() {
@@ -3433,6 +3489,48 @@ class GetListObjectInfoRequestStrategy extends LuvioAdapterRequestStrategy {
3433
3489
  }
3434
3490
  }
3435
3491
 
3492
+ const GET_RELATED_LISTS_INFO_ADAPTER_NAME = 'getRelatedListsInfo';
3493
+ class GetRelatedListsInfoRequestStrategy extends LuvioAdapterRequestStrategy {
3494
+ constructor() {
3495
+ super(...arguments);
3496
+ this.adapterName = GET_RELATED_LISTS_INFO_ADAPTER_NAME;
3497
+ this.adapterFactory = getRelatedListsInfoAdapterFactory;
3498
+ }
3499
+ /**
3500
+ * @override
3501
+ */
3502
+ isContextDependent(context, request) {
3503
+ return (context.objectApiName === coerceObjectId(request.config.parentObjectApiName) &&
3504
+ context.recordTypeId === request.config.recordTypeId);
3505
+ }
3506
+ /**
3507
+ * @override
3508
+ */
3509
+ buildConcreteRequest(similarRequest, _context) {
3510
+ return similarRequest;
3511
+ }
3512
+ /**
3513
+ * @override
3514
+ */
3515
+ transformForSave(request) {
3516
+ return {
3517
+ ...request,
3518
+ config: {
3519
+ ...request.config,
3520
+ parentObjectApiName: coerceObjectId(request.config.parentObjectApiName),
3521
+ },
3522
+ };
3523
+ }
3524
+ canCombine(reqA, reqB) {
3525
+ // only combine if both requests are equal.
3526
+ return (reqA.parentObjectApiName === reqB.parentObjectApiName &&
3527
+ reqA.recordTypeId === reqB.recordTypeId);
3528
+ }
3529
+ combineRequests(reqA, _reqB) {
3530
+ return reqA;
3531
+ }
3532
+ }
3533
+
3436
3534
  /**
3437
3535
  * Base implementation of a home page
3438
3536
  */
@@ -3482,6 +3580,7 @@ const RECORD_HOME_SUPPORTED_ADAPTERS = new Set([
3482
3580
  GET_RELATED_LIST_RECORDS_BATCH_ADAPTER_NAME,
3483
3581
  GET_RELATED_LIST_RECORDS_ADAPTER_NAME,
3484
3582
  GET_RELATED_LISTS_ACTIONS_ADAPTER_NAME,
3583
+ GET_RELATED_LISTS_INFO_ADAPTER_NAME,
3485
3584
  'templateApi', // external - getTemplateDescriptorWithExpansionBundle
3486
3585
  ]);
3487
3586
  class RecordHomePage extends AbstractHomePage {
@@ -4611,7 +4710,7 @@ function getEnvironmentSetting(name) {
4611
4710
  }
4612
4711
  return undefined;
4613
4712
  }
4614
- // version: 1.335.0-22a7c4d20b
4713
+ // version: 1.337.0-d4cf32d77b
4615
4714
 
4616
4715
  const forceRecordTransactionsDisabled = getEnvironmentSetting(EnvironmentSettings.ForceRecordTransactionsDisabled);
4617
4716
  //TODO: Some duplication here that can be most likely moved to a util class
@@ -5100,6 +5199,7 @@ function setupPredictivePrefetcher(luvio) {
5100
5199
  new GetComponentsDefStrategy(),
5101
5200
  new GetListInfosByObjectNameRequestStrategy(luvio),
5102
5201
  new GetListObjectInfoRequestStrategy(luvio),
5202
+ new GetRelatedListsInfoRequestStrategy(luvio),
5103
5203
  ];
5104
5204
  requestStrategyManager.register(allStrategies);
5105
5205
  const storage = buildAuraPrefetchStorage({
@@ -5247,6 +5347,7 @@ function initializeLDS() {
5247
5347
  // This configuration is needed by bindings time in adapter. Needs to happen
5248
5348
  // before setDefaultLuvio is called.
5249
5349
  configuration.setRelatedListsPredictionsEnabled(useRelatedListsPredictions.isOpen({ fallback: false }));
5350
+ configuration.setRelatedListsPlusPredictionsEnabled(useRelatedListPlus.isOpen({ fallback: false }));
5250
5351
  setupInstrumentation(luvio, store);
5251
5352
  setupMetadataWatcher(luvio);
5252
5353
  setupQueryEvaluators(luvio, store);
@@ -5278,10 +5379,6 @@ function initializeOneStore() {
5278
5379
  ];
5279
5380
  setServices(services);
5280
5381
  }
5281
- function initializeOnestoreUiApiAdapters() {
5282
- configuration.setGetObjectInfoAdapter(getObjectInfo);
5283
- configuration.setGetObjectInfosAdapter(getObjectInfos);
5284
- }
5285
5382
  function buildAuraNetworkService() {
5286
5383
  return {
5287
5384
  type: 'auraNetwork',
@@ -5294,13 +5391,11 @@ function ldsEngineCreator() {
5294
5391
  // One store initialization needs to happen first in order to set the one store adapter correctly in configuration object.
5295
5392
  if (oneStoreEnabled.isOpen({ fallback: false })) {
5296
5393
  initializeOneStore();
5297
- if (oneStoreUiapiEnabled.isOpen({ fallback: false })) {
5298
- initializeOnestoreUiApiAdapters();
5299
- }
5394
+ if (oneStoreUiapiEnabled.isOpen({ fallback: false })) ;
5300
5395
  }
5301
5396
  initializeLDS();
5302
5397
  return { name: 'ldsEngineCreator' };
5303
5398
  }
5304
5399
 
5305
5400
  export { LexRequestStrategy, PdlRequestPriority, buildPredictorForContext, ldsEngineCreator as default, initializeLDS, initializeOneStore, registerRequestStrategy, saveRequestAsPrediction, unregisterRequestStrategy, whenPredictionsReady };
5306
- // version: 1.335.0-290eb12c27
5401
+ // version: 1.337.0-d91af1f460
@@ -0,0 +1,30 @@
1
+ import type { GetRelatedListsInfoConfig } from '@salesforce/lds-adapters-uiapi';
2
+ import { LuvioAdapterRequestStrategy } from './luvio-adapter-request-strategy';
3
+ export type GetRelatedListsInfoRequest = {
4
+ adapterName: 'getRelatedListsInfo';
5
+ config: GetRelatedListsInfoConfig;
6
+ };
7
+ type GetRelatedListsInfoContext = {
8
+ objectApiName: string;
9
+ recordTypeId: string;
10
+ };
11
+ export declare const GET_RELATED_LISTS_INFO_ADAPTER_NAME = "getRelatedListsInfo";
12
+ export declare class GetRelatedListsInfoRequestStrategy extends LuvioAdapterRequestStrategy<GetRelatedListsInfoConfig, GetRelatedListsInfoRequest, GetRelatedListsInfoContext> {
13
+ adapterName: string;
14
+ adapterFactory: import("@luvio/engine").AdapterFactory<GetRelatedListsInfoConfig, import("packages/lds-adapters-uiapi/dist/es/es2018/types/src/generated/types/RelatedListSummaryInfoCollectionRepresentation").RelatedListSummaryInfoCollectionRepresentation>;
15
+ /**
16
+ * @override
17
+ */
18
+ isContextDependent(context: GetRelatedListsInfoContext, request: GetRelatedListsInfoRequest): boolean;
19
+ /**
20
+ * @override
21
+ */
22
+ buildConcreteRequest(similarRequest: GetRelatedListsInfoRequest, _context: GetRelatedListsInfoContext): GetRelatedListsInfoRequest;
23
+ /**
24
+ * @override
25
+ */
26
+ transformForSave(request: GetRelatedListsInfoRequest): GetRelatedListsInfoRequest;
27
+ canCombine(reqA: GetRelatedListsInfoConfig, reqB: GetRelatedListsInfoConfig): boolean;
28
+ combineRequests(reqA: GetRelatedListsInfoConfig, _reqB: GetRelatedListsInfoConfig): GetRelatedListsInfoConfig;
29
+ }
30
+ export {};
@@ -17,3 +17,4 @@ export * from './request-strategy';
17
17
  export * from './get-list-infos-by-object-name-request-strategy';
18
18
  export * from './get-list-records-by-name-request-strategy';
19
19
  export * from './get-list-object-info-request-strategy';
20
+ export * from './get-related-lists-info-strategy';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-aura",
3
- "version": "1.335.0",
3
+ "version": "1.337.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS engine for Aura runtime",
6
6
  "main": "dist/ldsEngineCreator.js",
@@ -34,42 +34,42 @@
34
34
  "release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-runtime-aura"
35
35
  },
36
36
  "devDependencies": {
37
- "@luvio/service-provisioner": "5.24.1",
38
- "@salesforce/lds-adapters-apex": "^1.335.0",
39
- "@salesforce/lds-adapters-uiapi": "^1.335.0",
37
+ "@luvio/service-provisioner": "5.26.0",
38
+ "@salesforce/lds-adapters-apex": "^1.337.0",
39
+ "@salesforce/lds-adapters-uiapi": "^1.337.0",
40
40
  "@salesforce/lds-adapters-uiapi-lex": "^1.302.0",
41
- "@salesforce/lds-ads-bridge": "^1.335.0",
42
- "@salesforce/lds-aura-storage": "^1.335.0",
43
- "@salesforce/lds-bindings": "^1.335.0",
44
- "@salesforce/lds-instrumentation": "^1.335.0",
45
- "@salesforce/lds-network-aura": "^1.335.0",
46
- "@salesforce/lds-network-fetch": "^1.335.0",
41
+ "@salesforce/lds-ads-bridge": "^1.337.0",
42
+ "@salesforce/lds-aura-storage": "^1.337.0",
43
+ "@salesforce/lds-bindings": "^1.337.0",
44
+ "@salesforce/lds-instrumentation": "^1.337.0",
45
+ "@salesforce/lds-network-aura": "^1.337.0",
46
+ "@salesforce/lds-network-fetch": "^1.337.0",
47
47
  "jwt-encode": "1.0.1"
48
48
  },
49
49
  "dependencies": {
50
- "@luvio/command-aura-network": "5.24.1",
51
- "@luvio/command-aura-resource-cache-control": "5.24.1",
52
- "@luvio/command-fetch-network": "5.24.1",
53
- "@luvio/command-network": "5.24.1",
54
- "@luvio/command-sse": "5.24.1",
55
- "@luvio/command-streaming": "5.24.1",
50
+ "@luvio/command-aura-network": "5.26.0",
51
+ "@luvio/command-aura-resource-cache-control": "5.26.0",
52
+ "@luvio/command-fetch-network": "5.26.0",
53
+ "@luvio/command-network": "5.26.0",
54
+ "@luvio/command-sse": "5.26.0",
55
+ "@luvio/command-streaming": "5.26.0",
56
56
  "@luvio/network-adapter-composable": "0.156.5",
57
57
  "@luvio/network-adapter-fetch": "0.156.5",
58
- "@luvio/service-aura-network": "5.24.1",
59
- "@luvio/service-cache": "5.24.1",
60
- "@luvio/service-cache-control": "5.24.1",
61
- "@luvio/service-fetch-network": "5.24.1",
62
- "@luvio/service-instrument-command": "5.24.1",
63
- "@luvio/service-store": "5.24.1",
64
- "@luvio/utils": "5.24.1",
65
- "@salesforce/lds-adapters-uiapi-lex": "^1.335.0"
58
+ "@luvio/service-aura-network": "5.26.0",
59
+ "@luvio/service-cache": "5.26.0",
60
+ "@luvio/service-cache-control": "5.26.0",
61
+ "@luvio/service-fetch-network": "5.26.0",
62
+ "@luvio/service-instrument-command": "5.26.0",
63
+ "@luvio/service-store": "5.26.0",
64
+ "@luvio/utils": "5.26.0",
65
+ "@salesforce/lds-adapters-uiapi-lex": "^1.337.0"
66
66
  },
67
67
  "luvioBundlesize": [
68
68
  {
69
69
  "path": "./dist/ldsEngineCreator.js",
70
70
  "maxSize": {
71
- "none": "200 kB",
72
- "min": "83 kB",
71
+ "none": "205 kB",
72
+ "min": "84.5 kB",
73
73
  "compressed": "36 kB"
74
74
  }
75
75
  }