@salesforce/lds-runtime-aura 1.320.0 → 1.321.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.
@@ -1594,21 +1594,27 @@ const PDL_EXECUTE_ASYNC_OPTIONS = {
1594
1594
  };
1595
1595
 
1596
1596
  class PredictivePrefetchPage {
1597
- constructor(context) {
1597
+ constructor(context, similarContext) {
1598
1598
  this.context = context;
1599
- this.similarContext = undefined;
1599
+ this.similarContext = similarContext;
1600
+ }
1601
+ getExactKey() {
1602
+ return { ...this.context };
1603
+ }
1604
+ getSimilarKey() {
1605
+ return { ...this.similarContext };
1600
1606
  }
1601
1607
  }
1602
1608
 
1603
1609
  class LexDefaultPage extends PredictivePrefetchPage {
1604
- constructor(context) {
1605
- super(context);
1610
+ constructor(context, similarContext) {
1611
+ super(context, similarContext);
1606
1612
  }
1607
1613
  supportsRequest(_request) {
1608
1614
  return true;
1609
1615
  }
1610
1616
  buildSaveRequestData(request) {
1611
- return [{ context: this.context, request }];
1617
+ return [{ key: this.getExactKey(), request }];
1612
1618
  }
1613
1619
  resolveSimilarRequest(similarRequest) {
1614
1620
  return similarRequest;
@@ -2379,6 +2385,15 @@ class GetRelatedListInfoBatchRequestStrategy extends LuvioAdapterRequestStrategy
2379
2385
  },
2380
2386
  };
2381
2387
  }
2388
+ isContextDependent(context, request) {
2389
+ // We have a higher degree of confidence of being able to use a similar request when
2390
+ // optional config is not set AND the object type of the page context is the same as the
2391
+ // object type related list is for. This approach is based heavily with early predictions
2392
+ // and the max of 12 aura requests in mind. Same approach is taken in the single version of
2393
+ // this request
2394
+ return (context.objectApiName === request.config.parentObjectApiName &&
2395
+ request.config.recordTypeId === undefined);
2396
+ }
2382
2397
  canCombine(reqA, reqB) {
2383
2398
  return reqA.parentObjectApiName === reqB.parentObjectApiName;
2384
2399
  }
@@ -2400,9 +2415,11 @@ class GetRelatedListInfoRequestStrategy extends LuvioAdapterRequestStrategy {
2400
2415
  * @override
2401
2416
  */
2402
2417
  isContextDependent(context, request) {
2403
- // we have a higher degree of confidence of being able to use a similar request when
2418
+ // We have a higher degree of confidence of being able to use a similar request when
2404
2419
  // optional config is not set AND the object type of the page context is the same as the
2405
- // object type related list is for
2420
+ // object type related list is for. This approach is based heavily with early predictions
2421
+ // and the max of 12 aura requests in mind. Same approach is taken in the batch version of
2422
+ // this request
2406
2423
  return (context.objectApiName === request.config.parentObjectApiName &&
2407
2424
  this.isRequiredOnlyConfig(request.config));
2408
2425
  }
@@ -2597,10 +2614,13 @@ class PrefetchRepository {
2597
2614
  existingRequestEntry.requestMetadata.requestTime = requestTime;
2598
2615
  }
2599
2616
  });
2600
- const { modifyBeforeSaveHook } = this.options;
2617
+ const { modifyBeforeSaveHook, modifyPageBeforeSavingHook } = this.options;
2601
2618
  if (modifyBeforeSaveHook !== undefined) {
2602
2619
  page.requests = modifyBeforeSaveHook(page.requests);
2603
2620
  }
2621
+ if (modifyPageBeforeSavingHook !== undefined) {
2622
+ modifyPageBeforeSavingHook(page);
2623
+ }
2604
2624
  setPromises.push(this.storage.set(id, page));
2605
2625
  }
2606
2626
  this.clearRequestBuffer();
@@ -2619,10 +2639,13 @@ class PrefetchRepository {
2619
2639
  this.requestBuffer.set(identifier, batchForKey);
2620
2640
  }
2621
2641
  getPage(key) {
2622
- const identifier = stableJSONStringify$1(key);
2642
+ const identifier = this.getKeyId(key);
2623
2643
  return this.storage.get(identifier);
2624
2644
  }
2625
2645
  getPageRequests(key) {
2646
+ if (!key) {
2647
+ return [];
2648
+ }
2626
2649
  const page = this.getPage(key);
2627
2650
  if (page === undefined) {
2628
2651
  return [];
@@ -2923,18 +2946,19 @@ const RECORD_HOME_SUPPORTED_ADAPTERS = new Set([
2923
2946
  ]);
2924
2947
  class RecordHomePage extends LexDefaultPage {
2925
2948
  constructor(context, requestStrategyManager, options) {
2926
- super(context);
2949
+ super(context, {
2950
+ ...context,
2951
+ recordId: '*',
2952
+ });
2927
2953
  this.requestStrategyManager = requestStrategyManager;
2928
2954
  this.options = options;
2929
- const { recordId: _, ...rest } = this.context;
2930
- this.similarContext = {
2931
- recordId: '*',
2932
- ...rest,
2933
- };
2934
2955
  }
2935
2956
  supportsRequest(request) {
2936
2957
  return RECORD_HOME_SUPPORTED_ADAPTERS.has(request.adapterName);
2937
2958
  }
2959
+ getExactKey() {
2960
+ return RecordHomePage.contextToExactKey(this.context);
2961
+ }
2938
2962
  buildSaveRequestData(request) {
2939
2963
  const requestBuckets = [];
2940
2964
  const { adapterName } = request;
@@ -2944,7 +2968,7 @@ class RecordHomePage extends LexDefaultPage {
2944
2968
  }
2945
2969
  if (matchingRequestStrategy.isContextDependent(this.context, request)) {
2946
2970
  requestBuckets.push({
2947
- context: this.similarContext,
2971
+ key: this.getSimilarKey(),
2948
2972
  request: matchingRequestStrategy.transformForSaveSimilarRequest(request),
2949
2973
  });
2950
2974
  // When `options.useExactMatchesPlus` is not enabled, we can save this request on the similar bucket only
@@ -2954,7 +2978,7 @@ class RecordHomePage extends LexDefaultPage {
2954
2978
  }
2955
2979
  if (!matchingRequestStrategy.onlySavedInSimilar) {
2956
2980
  requestBuckets.push({
2957
- context: this.context,
2981
+ key: this.getExactKey(),
2958
2982
  request: matchingRequestStrategy.transformForSave(request),
2959
2983
  });
2960
2984
  }
@@ -3005,6 +3029,10 @@ class RecordHomePage extends LexDefaultPage {
3005
3029
  context.recordId !== undefined &&
3006
3030
  context.type === 'recordPage');
3007
3031
  }
3032
+ static contextToExactKey(context) {
3033
+ const { recordTypeId: _, ...key } = context;
3034
+ return key;
3035
+ }
3008
3036
  }
3009
3037
 
3010
3038
  const OBJECT_HOME_SUPPORTED_ADAPTERS = new Set([
@@ -3016,10 +3044,9 @@ const OBJECT_HOME_SUPPORTED_ADAPTERS = new Set([
3016
3044
  ]);
3017
3045
  class ObjectHomePage extends LexDefaultPage {
3018
3046
  constructor(context, requestStrategyManager, options) {
3019
- super(context);
3047
+ super(context, context);
3020
3048
  this.requestStrategyManager = requestStrategyManager;
3021
3049
  this.options = options;
3022
- this.similarContext = context;
3023
3050
  }
3024
3051
  supportsRequest(request) {
3025
3052
  return OBJECT_HOME_SUPPORTED_ADAPTERS.has(request.adapterName);
@@ -3033,7 +3060,7 @@ class ObjectHomePage extends LexDefaultPage {
3033
3060
  }
3034
3061
  if (matchingRequestStrategy.isContextDependent(this.context, request)) {
3035
3062
  requestBuckets.push({
3036
- context: this.similarContext,
3063
+ key: this.getSimilarKey(),
3037
3064
  request: matchingRequestStrategy.transformForSaveSimilarRequest(request),
3038
3065
  });
3039
3066
  // When `options.useExactMatchesPlus` is not enabled, we can save this request on the similar bucket only
@@ -3042,7 +3069,7 @@ class ObjectHomePage extends LexDefaultPage {
3042
3069
  }
3043
3070
  }
3044
3071
  requestBuckets.push({
3045
- context: this.context,
3072
+ key: this.getExactKey(),
3046
3073
  request: matchingRequestStrategy.transformForSave(request),
3047
3074
  });
3048
3075
  return requestBuckets;
@@ -3721,10 +3748,10 @@ class ApplicationPredictivePrefetcher {
3721
3748
  if (this.page.supportsRequest(request)) {
3722
3749
  const saveBuckets = this.page.buildSaveRequestData(request);
3723
3750
  saveBuckets.forEach((saveBucket) => {
3724
- const { request: requestToSave, context } = saveBucket;
3751
+ const { request: requestToSave, key } = saveBucket;
3725
3752
  // No need to differentiate from predictions requests because these
3726
3753
  // are made from the adapters factory, which are not prediction aware.
3727
- this.repository.saveRequest(context, requestToSave);
3754
+ this.repository.saveRequest(key, requestToSave);
3728
3755
  });
3729
3756
  }
3730
3757
  return Promise.resolve().then();
@@ -3732,8 +3759,8 @@ class ApplicationPredictivePrefetcher {
3732
3759
  }
3733
3760
  async predict() {
3734
3761
  const alwaysRequests = this.page.getAlwaysRunRequests();
3735
- const similarPageRequests = await this.getSimilarPageRequests();
3736
- const exactPageRequests = await this.getExactPageRequest();
3762
+ const similarPageRequests = this.getSimilarPageRequests();
3763
+ const exactPageRequests = this.getExactPageRequests();
3737
3764
  // Always requests can't be reduced in - Some of them are essential to keep the page rendering at the beginning.
3738
3765
  const reducedRequests = this.requestRunner
3739
3766
  .reduceRequests([...exactPageRequests, ...similarPageRequests])
@@ -3744,13 +3771,9 @@ class ApplicationPredictivePrefetcher {
3744
3771
  return Promise.all(predictedRequests.map((request) => this.requestRunner.runRequest(request))).then();
3745
3772
  }
3746
3773
  getPredictionSummary() {
3747
- const exactPageRequests = this.repository.getPageRequests(this.context) || [];
3748
- const similarPageRequests = this.page.similarContext !== undefined
3749
- ? this.repository.getPageRequests(this.page.similarContext)
3750
- : [];
3751
3774
  return {
3752
- exact: exactPageRequests.length,
3753
- similar: similarPageRequests.length,
3775
+ exact: this.getExactPageRequests().length,
3776
+ similar: this.getSimilarPageRequests().length,
3754
3777
  totalRequestCount: this.totalRequestCount,
3755
3778
  };
3756
3779
  }
@@ -3759,22 +3782,15 @@ class ApplicationPredictivePrefetcher {
3759
3782
  return summary.exact > 0 || summary.similar > 0;
3760
3783
  }
3761
3784
  getSimilarPageRequests() {
3762
- let resolvedSimilarPageRequests = [];
3763
- if (this.page.similarContext !== undefined) {
3764
- const similarPageRequests = this.repository.getPageRequests(this.page.similarContext);
3765
- if (similarPageRequests !== undefined) {
3766
- resolvedSimilarPageRequests = similarPageRequests.map((entry) => {
3767
- return {
3768
- ...entry,
3769
- request: this.page.resolveSimilarRequest(entry.request),
3770
- };
3771
- });
3772
- }
3773
- }
3774
- return resolvedSimilarPageRequests;
3785
+ return this.repository.getPageRequests(this.page.getSimilarKey()).map((entry) => {
3786
+ return {
3787
+ ...entry,
3788
+ request: this.page.resolveSimilarRequest(entry.request),
3789
+ };
3790
+ });
3775
3791
  }
3776
- getExactPageRequest() {
3777
- return this.repository.getPageRequests(this.context) || [];
3792
+ getExactPageRequests() {
3793
+ return this.repository.getPageRequests(this.page.getExactKey()) || [];
3778
3794
  }
3779
3795
  }
3780
3796
 
@@ -3838,6 +3854,7 @@ function predictNonBoxcarableRequest(nonBoxcaredPredictions, requestRunner) {
3838
3854
  const reducedPredictions = requestRunner.reduceRequests(nonBoxcaredPredictions);
3839
3855
  reducedPredictions.map((request) => requestRunner.runRequest(request.request));
3840
3856
  }
3857
+ const DEFAULT_RECORD_TYPE_ID = '012000000000000AAA';
3841
3858
  class LexPredictivePrefetcher extends ApplicationPredictivePrefetcher {
3842
3859
  constructor(context, repository, requestRunner,
3843
3860
  // These strategies need to be in sync with the "predictiveDataLoadCapable" list
@@ -3850,6 +3867,17 @@ class LexPredictivePrefetcher extends ApplicationPredictivePrefetcher {
3850
3867
  }
3851
3868
  getPage() {
3852
3869
  if (RecordHomePage.handlesContext(this.context)) {
3870
+ /*
3871
+ * `recordTypeId` is required in order to create similar request keys. However, the means by which it is
3872
+ * obtained varies based on when in the app lifecycle predictions are requested.
3873
+ */
3874
+ // check context for record type
3875
+ if (!this.context.recordTypeId) {
3876
+ // don't have it (i.e., early predictions), so need try to obtain via exact matches
3877
+ const exact = this.repository.getPage(RecordHomePage.contextToExactKey(this.context));
3878
+ // use found recordTypeId, otherwise fallback to default
3879
+ this.context.recordTypeId = (exact && exact.recordTypeId) || DEFAULT_RECORD_TYPE_ID;
3880
+ }
3853
3881
  return new RecordHomePage(this.context, this.requestStrategyManager, this.options);
3854
3882
  }
3855
3883
  else if (ObjectHomePage.handlesContext(this.context)) {
@@ -3858,7 +3886,7 @@ class LexPredictivePrefetcher extends ApplicationPredictivePrefetcher {
3858
3886
  return new LexDefaultPage(this.context);
3859
3887
  }
3860
3888
  getAllPageRequests() {
3861
- const exactPageRequests = this.getExactPageRequest();
3889
+ const exactPageRequests = this.getExactPageRequests();
3862
3890
  let similarPageRequests = this.getSimilarPageRequests();
3863
3891
  if (exactPageRequests.length > 0 && this.options.useExactMatchesPlus === true) {
3864
3892
  similarPageRequests = similarPageRequests.filter((requestEntry) => {
@@ -3871,7 +3899,7 @@ class LexPredictivePrefetcher extends ApplicationPredictivePrefetcher {
3871
3899
  async predict() {
3872
3900
  const alwaysRequests = this.page.getAlwaysRunRequests();
3873
3901
  const pageRequests = this.getAllPageRequests();
3874
- // IMPORTANT: Because there's no way to diferentiate a cmpDef prediction from the page
3902
+ // IMPORTANT: Because there's no way to differentiate a cmpDef prediction from the page
3875
3903
  // requesting the cmpDef, we need to predict cmpDefs before we start watching
3876
3904
  // for predictions in the page. Having this code after an
3877
3905
  // await will make the predictions to be saved as predictions too.
@@ -4048,7 +4076,7 @@ function getEnvironmentSetting(name) {
4048
4076
  }
4049
4077
  return undefined;
4050
4078
  }
4051
- // version: 1.320.0-e3e5f3d984
4079
+ // version: 1.321.0-40847d67a8
4052
4080
 
4053
4081
  const forceRecordTransactionsDisabled = getEnvironmentSetting(EnvironmentSettings.ForceRecordTransactionsDisabled);
4054
4082
  //TODO: Some duplication here that can be most likely moved to a util class
@@ -4552,6 +4580,11 @@ function setupPredictivePrefetcher(luvio) {
4552
4580
  const requestRunner = new LexRequestRunner(requestStrategyManager);
4553
4581
  const repository = new PrefetchRepository(storage, {
4554
4582
  modifyBeforeSaveHook: (requests) => requestRunner.reduceRequests(requests),
4583
+ modifyPageBeforeSavingHook: (page) => {
4584
+ if (RecordHomePage.handlesContext(__lexPrefetcher.context)) {
4585
+ page.recordTypeId = __lexPrefetcher.context.recordTypeId;
4586
+ }
4587
+ },
4555
4588
  });
4556
4589
  const inflightRequestLimit = applyPredictionRequestLimit.isOpen({ fallback: false })
4557
4590
  ? getInflightRequestLimit()
@@ -4630,13 +4663,12 @@ function buildPredictorForContext(context) {
4630
4663
  }
4631
4664
  const currentContext = __lexPrefetcher.context;
4632
4665
  let isSameContext = false;
4633
- if (currentContext && currentContext.type === 'recordPage') {
4634
- const rhPageContext = currentContext;
4666
+ if (RecordHomePage.handlesContext(currentContext)) {
4635
4667
  isSameContext =
4636
- rhPageContext.actionName === context.actionName &&
4637
- rhPageContext.objectApiName === context.objectApiName &&
4638
- rhPageContext.recordId === context.recordId &&
4639
- rhPageContext.type === context.type;
4668
+ currentContext.actionName === context.actionName &&
4669
+ currentContext.objectApiName === context.objectApiName &&
4670
+ currentContext.recordId === context.recordId &&
4671
+ currentContext.type === context.type;
4640
4672
  }
4641
4673
  // // This chunk configures which page we're going to use to try and preload.
4642
4674
  __lexPrefetcher.context = context;
@@ -4743,4 +4775,4 @@ function ldsEngineCreator() {
4743
4775
  }
4744
4776
 
4745
4777
  export { LexRequestStrategy, buildPredictorForContext, ldsEngineCreator as default, initializeLDS, initializeOneStore, registerRequestStrategy, saveRequestAsPrediction, unregisterRequestStrategy, whenPredictionsReady };
4746
- // version: 1.320.0-85be789480
4778
+ // version: 1.321.0-1fd3fba1c4
@@ -9,9 +9,9 @@ export type RequestEntry<Request> = {
9
9
  };
10
10
  };
11
11
  /**
12
- * Request and Context data to be saved.
12
+ * Request and context-based Key data to be saved.
13
13
  */
14
14
  export type SaveRequestData<Request, Context> = {
15
15
  request: Request;
16
- context: Context;
16
+ key: Context;
17
17
  };
@@ -2,10 +2,10 @@ import type { BaseAdapterRequest } from '../request-strategy';
2
2
  import { PredictivePrefetchPage } from './predictive-prefetch-page';
3
3
  export type DefaultPageContext = Record<string, any>;
4
4
  export declare class LexDefaultPage<Request extends BaseAdapterRequest, Context extends DefaultPageContext> extends PredictivePrefetchPage<Request, Context> {
5
- constructor(context: Context);
5
+ constructor(context: Context, similarContext?: Context);
6
6
  supportsRequest(_request: Request): boolean;
7
7
  buildSaveRequestData(request: Request): {
8
- context: Context;
8
+ key: Context;
9
9
  request: Request;
10
10
  }[];
11
11
  resolveSimilarRequest(similarRequest: Request): Request;
@@ -11,11 +11,10 @@ export declare const OBJECT_HOME_SUPPORTED_ADAPTERS: Set<string>;
11
11
  export declare class ObjectHomePage extends LexDefaultPage<LexRequest, ObjectHomePageContext> {
12
12
  private requestStrategyManager;
13
13
  private options;
14
- similarContext: ObjectHomePageContext;
15
14
  constructor(context: ObjectHomePageContext, requestStrategyManager: RequestStrategyManager, options: LexPrefetcherOptions);
16
15
  supportsRequest(request: LexRequest): boolean;
17
16
  buildSaveRequestData(request: LexRequest): {
18
- context: ObjectHomePageContext;
17
+ key: ObjectHomePageContext;
19
18
  request: LexRequest<unknown>;
20
19
  }[];
21
20
  resolveSimilarRequest(similarRequest: LexRequest): LexRequest;
@@ -1,10 +1,12 @@
1
1
  import type { SaveRequestData } from '../common';
2
2
  export declare abstract class PredictivePrefetchPage<Request, Context> {
3
- context: Context;
4
- similarContext: Partial<Context> | undefined;
5
- constructor(context: Context);
3
+ protected context: Context;
4
+ protected similarContext?: Context | undefined;
5
+ protected constructor(context: Context, similarContext?: Context | undefined);
6
6
  abstract supportsRequest(request: Request): boolean;
7
7
  abstract buildSaveRequestData(request: Request): SaveRequestData<Request, Context>[];
8
8
  abstract resolveSimilarRequest(similarRequest: Request): Request;
9
9
  abstract getAlwaysRunRequests(): Request[];
10
+ getExactKey(): Context;
11
+ getSimilarKey(): Context;
10
12
  }
@@ -6,17 +6,18 @@ export declare const RECORD_HOME_SUPPORTED_ADAPTERS: Set<string>;
6
6
  export type RecordHomePageContext = {
7
7
  objectApiName: string;
8
8
  recordId: string;
9
+ recordTypeId?: string;
9
10
  actionName: string;
10
11
  type: 'recordPage';
11
12
  };
12
13
  export declare class RecordHomePage extends LexDefaultPage<LexRequest, RecordHomePageContext> {
13
14
  private requestStrategyManager;
14
15
  private options;
15
- similarContext: RecordHomePageContext;
16
16
  constructor(context: RecordHomePageContext, requestStrategyManager: RequestStrategyManager, options: LexPrefetcherOptions);
17
17
  supportsRequest(request: LexRequest): boolean;
18
+ getExactKey(): RecordHomePageContext;
18
19
  buildSaveRequestData(request: LexRequest): {
19
- context: RecordHomePageContext;
20
+ key: RecordHomePageContext;
20
21
  request: LexRequest<unknown>;
21
22
  }[];
22
23
  resolveSimilarRequest(similarRequest: LexRequest): LexRequest;
@@ -35,4 +36,5 @@ export declare class RecordHomePage extends LexDefaultPage<LexRequest, RecordHom
35
36
  */
36
37
  shouldExecuteAlwaysRequestByThemself(): boolean;
37
38
  static handlesContext(context: DefaultPageContext): context is RecordHomePageContext;
39
+ static contextToExactKey(context: RecordHomePageContext): RecordHomePageContext;
38
40
  }
@@ -1,7 +1,7 @@
1
+ import { LexDefaultPage } from '../pages';
1
2
  import { ApplicationPredictivePrefetcher } from './predictive-prefetcher';
2
- import { LexDefaultPage } from '../pages/lex-default-page';
3
3
  import type { RequestRunner } from '../request-runner';
4
- import type { PrefetchRepository } from '../repository/prefetch-repository';
4
+ import type { PrefetchRepository } from '../repository';
5
5
  import type { RequestEntry } from '../common';
6
6
  import type { LexContext, LexPrefetcherOptions, LexRequest } from '../lex';
7
7
  import type { RequestStrategyManager } from '../request-strategy-manager/request-strategy-manager';
@@ -9,7 +9,7 @@ export declare class LexPredictivePrefetcher extends ApplicationPredictivePrefet
9
9
  protected options: LexPrefetcherOptions;
10
10
  page: LexDefaultPage<LexRequest, LexContext>;
11
11
  private requestStrategyManager;
12
- constructor(context: LexContext, repository: PrefetchRepository, requestRunner: RequestRunner<LexRequest>, requestStrategyManager: RequestStrategyManager, options: LexPrefetcherOptions);
12
+ constructor(context: LexContext, repository: PrefetchRepository<LexRequest>, requestRunner: RequestRunner<LexRequest>, requestStrategyManager: RequestStrategyManager, options: LexPrefetcherOptions);
13
13
  getPage(): LexDefaultPage<LexRequest, LexContext>;
14
14
  getAllPageRequests(): RequestEntry<LexRequest>[];
15
15
  predict(): Promise<void>;
@@ -1,16 +1,16 @@
1
1
  import type { PrefetchRepository } from '../repository';
2
2
  import type { PredictivePrefetchPage } from '../pages';
3
3
  import type { RequestRunner } from '../request-runner';
4
- import type { RequestEntry } from '../common';
5
- export declare abstract class ApplicationPredictivePrefetcher<Request, Context extends Record<string, any>> {
6
- protected repository: PrefetchRepository;
4
+ import type { BaseAdapterRequest } from '../request-strategy';
5
+ export declare abstract class ApplicationPredictivePrefetcher<Request extends BaseAdapterRequest, Context extends Record<string, any>> {
6
+ protected repository: PrefetchRepository<Request>;
7
7
  protected requestRunner: RequestRunner<Request>;
8
8
  private _context;
9
9
  isRecording: boolean;
10
10
  totalRequestCount: Number;
11
11
  page: PredictivePrefetchPage<Request, Context>;
12
12
  queuedPredictionRequests: Request[];
13
- constructor(context: Context, repository: PrefetchRepository, requestRunner: RequestRunner<Request>);
13
+ protected constructor(context: Context, repository: PrefetchRepository<Request>, requestRunner: RequestRunner<Request>);
14
14
  abstract getPage(): PredictivePrefetchPage<Request, Context>;
15
15
  set context(value: Context);
16
16
  get context(): Context;
@@ -24,6 +24,11 @@ export declare abstract class ApplicationPredictivePrefetcher<Request, Context e
24
24
  totalRequestCount: Number;
25
25
  };
26
26
  hasPredictions(): boolean;
27
- getSimilarPageRequests(): RequestEntry<Request>[];
28
- getExactPageRequest(): RequestEntry<Request>[];
27
+ getSimilarPageRequests(): {
28
+ request: Request;
29
+ requestMetadata: {
30
+ requestTime: number;
31
+ };
32
+ }[];
33
+ getExactPageRequests(): import("../common").RequestEntry<Request>[];
29
34
  }
@@ -7,23 +7,25 @@ export type History = {
7
7
  };
8
8
  export type PageEntry<Request> = {
9
9
  id: string;
10
+ recordTypeId?: string;
10
11
  requests: RequestEntry<Request>[];
11
12
  };
12
- export type PrefetchRepositoryOptions = {
13
- modifyBeforeSaveHook?: (requests: RequestEntry<any>[]) => RequestEntry<any>[];
13
+ export type PrefetchRepositoryOptions<Request> = {
14
+ modifyBeforeSaveHook?: (requests: RequestEntry<Request>[]) => RequestEntry<Request>[];
15
+ modifyPageBeforeSavingHook?: (page: PageEntry<Request>) => void;
14
16
  };
15
- export declare class PrefetchRepository {
17
+ export declare class PrefetchRepository<Request> {
16
18
  private storage;
17
19
  private options;
18
20
  private requestBuffer;
19
- constructor(storage: PrefetchStorage, options?: PrefetchRepositoryOptions);
21
+ constructor(storage: PrefetchStorage, options?: PrefetchRepositoryOptions<Request>);
20
22
  clearRequestBuffer(): void;
21
23
  pageStartTime: number;
22
24
  markPageStart(): void;
23
25
  flushRequestsToStorage(): Promise<void>;
24
26
  getKeyId(key: Key): string;
25
27
  saveRequest<Request>(key: Key, request: Request): void;
26
- getPage<Request>(key: Key): PageEntry<Request> | undefined;
27
- getPageRequests<Request>(key: Key): RequestEntry<Request>[];
28
+ getPage(key: Key): PageEntry<Request> | undefined;
29
+ getPageRequests(key: Key): RequestEntry<Request>[];
28
30
  }
29
31
  export {};
@@ -6,6 +6,7 @@ export type GetRelatedListInfoBatchRequest = {
6
6
  };
7
7
  type GetRelatedListInfoBatchContext = {
8
8
  objectApiName: string;
9
+ recordTypeId: string;
9
10
  };
10
11
  export declare const GET_RELATED_LIST_INFO_BATCH_ADAPTER_NAME = "getRelatedListInfoBatch";
11
12
  export declare class GetRelatedListInfoBatchRequestStrategy extends LuvioAdapterRequestStrategy<GetRelatedListInfoBatchConfig, GetRelatedListInfoBatchRequest, GetRelatedListInfoBatchContext> {
@@ -16,6 +17,7 @@ export declare class GetRelatedListInfoBatchRequestStrategy extends LuvioAdapter
16
17
  * @override
17
18
  */
18
19
  transformForSave(request: GetRelatedListInfoBatchRequest): GetRelatedListInfoBatchRequest;
20
+ isContextDependent(context: GetRelatedListInfoBatchContext, request: GetRelatedListInfoBatchRequest): boolean;
19
21
  canCombine(reqA: GetRelatedListInfoBatchConfig, reqB: GetRelatedListInfoBatchConfig): boolean;
20
22
  combineRequests(reqA: GetRelatedListInfoBatchConfig, reqB: GetRelatedListInfoBatchConfig): GetRelatedListInfoBatchConfig;
21
23
  }
@@ -8,6 +8,7 @@ export type GetRelatedListInfoRequest = {
8
8
  };
9
9
  type GetRelatedListInfoContext = {
10
10
  objectApiName: string;
11
+ recordTypeId: string;
11
12
  };
12
13
  export declare const GET_RELATED_LIST_INFO_ADAPTER_NAME = "getRelatedListInfo";
13
14
  export declare class GetRelatedListInfoRequestStrategy extends LuvioAdapterRequestStrategy<GetRelatedListInfoConfig, GetRelatedListInfoRequest, GetRelatedListInfoContext> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-aura",
3
- "version": "1.320.0",
3
+ "version": "1.321.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS engine for Aura runtime",
6
6
  "main": "dist/ldsEngineCreator.js",
@@ -34,33 +34,33 @@
34
34
  "release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-runtime-aura"
35
35
  },
36
36
  "devDependencies": {
37
- "@luvio/service-broker": "5.11.0",
38
- "@salesforce/lds-adapters-apex": "^1.320.0",
39
- "@salesforce/lds-adapters-uiapi": "^1.320.0",
37
+ "@luvio/service-broker": "5.12.0",
38
+ "@salesforce/lds-adapters-apex": "^1.321.0",
39
+ "@salesforce/lds-adapters-uiapi": "^1.321.0",
40
40
  "@salesforce/lds-adapters-uiapi-lex": "^1.302.0",
41
- "@salesforce/lds-ads-bridge": "^1.320.0",
42
- "@salesforce/lds-aura-storage": "^1.320.0",
43
- "@salesforce/lds-bindings": "^1.320.0",
44
- "@salesforce/lds-instrumentation": "^1.320.0",
45
- "@salesforce/lds-network-aura": "^1.320.0",
46
- "@salesforce/lds-network-fetch-with-jwt": "^1.320.0"
41
+ "@salesforce/lds-ads-bridge": "^1.321.0",
42
+ "@salesforce/lds-aura-storage": "^1.321.0",
43
+ "@salesforce/lds-bindings": "^1.321.0",
44
+ "@salesforce/lds-instrumentation": "^1.321.0",
45
+ "@salesforce/lds-network-aura": "^1.321.0",
46
+ "@salesforce/lds-network-fetch-with-jwt": "^1.321.0"
47
47
  },
48
48
  "dependencies": {
49
- "@luvio/command-aura-network": "5.11.0",
50
- "@luvio/command-fetch-network": "5.11.0",
51
- "@luvio/command-network": "5.11.0",
52
- "@luvio/command-sse": "5.11.0",
53
- "@luvio/command-streaming": "5.11.0",
54
- "@luvio/network-adapter-composable": "0.156.4",
55
- "@luvio/network-adapter-fetch": "0.156.4",
56
- "@luvio/service-aura-network": "5.11.0",
57
- "@luvio/service-cache": "5.11.0",
58
- "@luvio/service-cache-control": "5.11.0",
59
- "@luvio/service-fetch-network": "5.11.0",
60
- "@luvio/service-instrument-command": "5.11.0",
61
- "@luvio/service-store": "5.11.0",
62
- "@luvio/utils": "5.11.0",
63
- "@salesforce/lds-adapters-uiapi-lex": "^1.320.0"
49
+ "@luvio/command-aura-network": "5.12.0",
50
+ "@luvio/command-fetch-network": "5.12.0",
51
+ "@luvio/command-network": "5.12.0",
52
+ "@luvio/command-sse": "5.12.0",
53
+ "@luvio/command-streaming": "5.12.0",
54
+ "@luvio/network-adapter-composable": "0.156.5",
55
+ "@luvio/network-adapter-fetch": "0.156.5",
56
+ "@luvio/service-aura-network": "5.12.0",
57
+ "@luvio/service-cache": "5.12.0",
58
+ "@luvio/service-cache-control": "5.12.0",
59
+ "@luvio/service-fetch-network": "5.12.0",
60
+ "@luvio/service-instrument-command": "5.12.0",
61
+ "@luvio/service-store": "5.12.0",
62
+ "@luvio/utils": "5.12.0",
63
+ "@salesforce/lds-adapters-uiapi-lex": "^1.321.0"
64
64
  },
65
65
  "luvioBundlesize": [
66
66
  {