@salesforce/lds-runtime-aura 1.340.0 → 1.342.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.
@@ -21,7 +21,7 @@ import useRelatedListPlus from '@salesforce/gate/lds.pdl.useRelatedListPlus';
21
21
  import useCmpDefPredictions from '@salesforce/gate/lds.pdl.useCmpDefPredictions';
22
22
  import applyPredictionRequestLimit from '@salesforce/gate/lds.pdl.applyRequestLimit';
23
23
  import { GetApexWireAdapterFactory, registerPrefetcher as registerPrefetcher$1 } from 'force/ldsAdaptersApex';
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
+ import { getRecordAvatarsAdapterFactory, getRecordAdapterFactory, coerceFieldIdArray, getRecordsAdapterFactory, getRecordActionsAdapterFactory, getObjectInfosAdapterFactory, coerceObjectIdArray, getObjectInfoAdapterFactory, coerceObjectId, getRelatedListsActionsAdapterFactory, getRelatedListInfoBatchAdapterFactory, getRelatedListInfoAdapterFactory, getRelatedListRecordsBatchAdapterFactory, getRelatedListRecordsAdapterFactory, getListInfoByNameAdapterFactory, getListInfosByObjectNameAdapterFactory, getListRecordsByNameAdapterFactory, getListObjectInfoAdapterFactory, getRelatedListsInfoAdapterFactory, getRelatedListActionsAdapterFactory, getRecordId18Array, instrument, configuration, InMemoryRecordRepresentationQueryEvaluator, UiApiNamespace, RecordRepresentationRepresentationType, registerPrefetcher } from 'force/ldsAdaptersUiapi';
25
25
  import { getInstrumentation } from 'o11y/client';
26
26
  import { setServices } from 'force/luvioServiceProvisioner1';
27
27
  import oneStoreEnabled from '@salesforce/gate/lds.oneStoreEnabled.ltng';
@@ -3531,6 +3531,81 @@ class GetRelatedListsInfoRequestStrategy extends LuvioAdapterRequestStrategy {
3531
3531
  }
3532
3532
  }
3533
3533
 
3534
+ const GET_RELATED_LIST_ACTIONS_ADAPTER_NAME = 'getRelatedListActions';
3535
+ /**
3536
+ * Returns true if the config is only the required configuration.
3537
+ *
3538
+ * @param config - The related list actions config
3539
+ * @returns boolean - true if the config is only the required configuration
3540
+ */
3541
+ function isRequiredOnlyConfig(config) {
3542
+ return (config.apiNames === undefined &&
3543
+ config.actionTypes === undefined &&
3544
+ config.formFactor === undefined &&
3545
+ config.retrievalMode === undefined &&
3546
+ config.sections === undefined);
3547
+ }
3548
+ class GetRelatedListActionsRequestStrategy extends LuvioAdapterRequestStrategy {
3549
+ constructor() {
3550
+ super(...arguments);
3551
+ this.adapterName = GET_RELATED_LIST_ACTIONS_ADAPTER_NAME;
3552
+ this.adapterFactory = getRelatedListActionsAdapterFactory;
3553
+ }
3554
+ buildConcreteRequest(similarRequest, context) {
3555
+ return {
3556
+ ...similarRequest,
3557
+ config: {
3558
+ ...similarRequest.config,
3559
+ recordIds: [context.recordId],
3560
+ },
3561
+ };
3562
+ }
3563
+ transformForSave(request) {
3564
+ // we only need to coerce the required configuration because only those fields are
3565
+ // manipulated by the strategy.
3566
+ return {
3567
+ ...request,
3568
+ config: {
3569
+ ...request.config,
3570
+ // (!): if is recorded in PDL, it was already validated by the adapter.
3571
+ recordIds: getRecordId18Array(request.config.recordIds) || [],
3572
+ },
3573
+ };
3574
+ }
3575
+ transformForSaveSimilarRequest(request) {
3576
+ return {
3577
+ ...request,
3578
+ config: {
3579
+ ...request.config,
3580
+ recordIds: ['*'],
3581
+ },
3582
+ };
3583
+ }
3584
+ isContextDependent(context, { config }) {
3585
+ // Note: despite recordIds being an array, it is common to send just one recordId as a string.
3586
+ // Also, recordIds is a required param, and the factory would have failed if recordIds is missing,
3587
+ // normalizing to an empty array to avoid an error from PDL if that logic fails.
3588
+ const requestRecordsIds = getRecordId18Array(config.recordIds) || [];
3589
+ const configHasOnlyOneRecord = requestRecordsIds.length === 1;
3590
+ return (configHasOnlyOneRecord &&
3591
+ requestRecordsIds[0] === context.recordId &&
3592
+ isRequiredOnlyConfig(config));
3593
+ }
3594
+ canCombine(reqA, reqB) {
3595
+ // At the moment, these are not combinable by this strategy, except when they are the same request
3596
+ return (isRequiredOnlyConfig(reqA) &&
3597
+ isRequiredOnlyConfig(reqB) &&
3598
+ reqA.recordIds.length === 1 &&
3599
+ reqB.recordIds.length === 1 &&
3600
+ reqA.recordIds[0] === reqB.recordIds[0] &&
3601
+ reqA.relatedListId === reqB.relatedListId);
3602
+ }
3603
+ combineRequests(reqA, _reqB) {
3604
+ // both request are the same, return only one of them.
3605
+ return reqA;
3606
+ }
3607
+ }
3608
+
3534
3609
  /**
3535
3610
  * Base implementation of a home page
3536
3611
  */
@@ -3581,6 +3656,7 @@ const RECORD_HOME_SUPPORTED_ADAPTERS = new Set([
3581
3656
  GET_RELATED_LIST_RECORDS_ADAPTER_NAME,
3582
3657
  GET_RELATED_LISTS_ACTIONS_ADAPTER_NAME,
3583
3658
  GET_RELATED_LISTS_INFO_ADAPTER_NAME,
3659
+ GET_RELATED_LIST_ACTIONS_ADAPTER_NAME,
3584
3660
  'templateApi', // external - getTemplateDescriptorWithExpansionBundle
3585
3661
  ]);
3586
3662
  class RecordHomePage extends AbstractHomePage {
@@ -4710,7 +4786,7 @@ function getEnvironmentSetting(name) {
4710
4786
  }
4711
4787
  return undefined;
4712
4788
  }
4713
- // version: 1.340.0-08235a5e1b
4789
+ // version: 1.342.0-f478af8b93
4714
4790
 
4715
4791
  const forceRecordTransactionsDisabled = getEnvironmentSetting(EnvironmentSettings.ForceRecordTransactionsDisabled);
4716
4792
  //TODO: Some duplication here that can be most likely moved to a util class
@@ -5200,6 +5276,7 @@ function setupPredictivePrefetcher(luvio) {
5200
5276
  new GetListInfosByObjectNameRequestStrategy(luvio),
5201
5277
  new GetListObjectInfoRequestStrategy(luvio),
5202
5278
  new GetRelatedListsInfoRequestStrategy(luvio),
5279
+ new GetRelatedListActionsRequestStrategy(luvio),
5203
5280
  ];
5204
5281
  requestStrategyManager.register(allStrategies);
5205
5282
  const storage = buildAuraPrefetchStorage({
@@ -5398,4 +5475,4 @@ function ldsEngineCreator() {
5398
5475
  }
5399
5476
 
5400
5477
  export { LexRequestStrategy, PdlRequestPriority, buildPredictorForContext, ldsEngineCreator as default, initializeLDS, initializeOneStore, registerRequestStrategy, saveRequestAsPrediction, unregisterRequestStrategy, whenPredictionsReady };
5401
- // version: 1.340.0-6f2e2f8197
5478
+ // version: 1.342.0-651bed9637
@@ -0,0 +1,21 @@
1
+ import type { GetRelatedListActionsConfig } from '@salesforce/lds-adapters-uiapi';
2
+ import { LuvioAdapterRequestStrategy } from './luvio-adapter-request-strategy';
3
+ export type GetRelatedListActionsRequest = {
4
+ adapterName: 'getRelatedListActions';
5
+ config: GetRelatedListActionsConfig;
6
+ };
7
+ type GetRelatedListActionsContext = {
8
+ recordId: string;
9
+ };
10
+ export declare const GET_RELATED_LIST_ACTIONS_ADAPTER_NAME = "getRelatedListActions";
11
+ export declare class GetRelatedListActionsRequestStrategy extends LuvioAdapterRequestStrategy<GetRelatedListActionsConfig, GetRelatedListActionsRequest, GetRelatedListActionsContext> {
12
+ adapterName: string;
13
+ adapterFactory: import("@luvio/engine").AdapterFactory<GetRelatedListActionsConfig, import("packages/lds-adapters-uiapi/dist/es/es2018/types/src/generated/types/ActionRepresentation").ActionRepresentation>;
14
+ buildConcreteRequest(similarRequest: GetRelatedListActionsRequest, context: GetRelatedListActionsContext): GetRelatedListActionsRequest;
15
+ transformForSave(request: GetRelatedListActionsRequest): GetRelatedListActionsRequest;
16
+ transformForSaveSimilarRequest(request: GetRelatedListActionsRequest): GetRelatedListActionsRequest;
17
+ isContextDependent(context: GetRelatedListActionsContext, { config }: GetRelatedListActionsRequest): boolean;
18
+ canCombine(reqA: GetRelatedListActionsConfig, reqB: GetRelatedListActionsConfig): boolean;
19
+ combineRequests(reqA: GetRelatedListActionsConfig, _reqB: GetRelatedListActionsConfig): GetRelatedListActionsConfig;
20
+ }
21
+ export {};
@@ -18,3 +18,4 @@ 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
20
  export * from './get-related-lists-info-strategy';
21
+ export * from './get-related-list-actions-request-strategy';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-aura",
3
- "version": "1.340.0",
3
+ "version": "1.342.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS engine for Aura runtime",
6
6
  "main": "dist/ldsEngineCreator.js",
@@ -35,15 +35,15 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@luvio/service-provisioner": "5.26.0",
38
- "@salesforce/lds-adapters-apex": "^1.340.0",
39
- "@salesforce/lds-adapters-uiapi": "^1.340.0",
38
+ "@salesforce/lds-adapters-apex": "^1.342.0",
39
+ "@salesforce/lds-adapters-uiapi": "^1.342.0",
40
40
  "@salesforce/lds-adapters-uiapi-lex": "^1.302.0",
41
- "@salesforce/lds-ads-bridge": "^1.340.0",
42
- "@salesforce/lds-aura-storage": "^1.340.0",
43
- "@salesforce/lds-bindings": "^1.340.0",
44
- "@salesforce/lds-instrumentation": "^1.340.0",
45
- "@salesforce/lds-network-aura": "^1.340.0",
46
- "@salesforce/lds-network-fetch": "^1.340.0",
41
+ "@salesforce/lds-ads-bridge": "^1.342.0",
42
+ "@salesforce/lds-aura-storage": "^1.342.0",
43
+ "@salesforce/lds-bindings": "^1.342.0",
44
+ "@salesforce/lds-instrumentation": "^1.342.0",
45
+ "@salesforce/lds-network-aura": "^1.342.0",
46
+ "@salesforce/lds-network-fetch": "^1.342.0",
47
47
  "jwt-encode": "1.0.1"
48
48
  },
49
49
  "dependencies": {
@@ -62,15 +62,15 @@
62
62
  "@luvio/service-instrument-command": "5.26.0",
63
63
  "@luvio/service-store": "5.26.0",
64
64
  "@luvio/utils": "5.26.0",
65
- "@salesforce/lds-adapters-uiapi-lex": "^1.340.0"
65
+ "@salesforce/lds-adapters-uiapi-lex": "^1.342.0"
66
66
  },
67
67
  "luvioBundlesize": [
68
68
  {
69
69
  "path": "./dist/ldsEngineCreator.js",
70
70
  "maxSize": {
71
- "none": "205 kB",
72
- "min": "84.5 kB",
73
- "compressed": "36 kB"
71
+ "none": "207 kB",
72
+ "min": "86 kB",
73
+ "compressed": "36.5 kB"
74
74
  }
75
75
  }
76
76
  ],