@salesforce/lds-runtime-aura 1.459.0 → 1.461.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/ldsEngineCreator.js +123 -2343
- package/dist/types/main.d.ts +7 -59
- package/package.json +41 -41
- package/dist/types/predictive-loading/common/index.d.ts +0 -17
- package/dist/types/predictive-loading/index.d.ts +0 -7
- package/dist/types/predictive-loading/lex/index.d.ts +0 -17
- package/dist/types/predictive-loading/lex/predictions-ready-manager.d.ts +0 -32
- package/dist/types/predictive-loading/pages/abstract-home-page.d.ts +0 -17
- package/dist/types/predictive-loading/pages/index.d.ts +0 -4
- package/dist/types/predictive-loading/pages/lex-default-page.d.ts +0 -15
- package/dist/types/predictive-loading/pages/object-home-page.d.ts +0 -23
- package/dist/types/predictive-loading/pages/predictive-prefetch-page.d.ts +0 -12
- package/dist/types/predictive-loading/pages/record-home-page.d.ts +0 -26
- package/dist/types/predictive-loading/prefetcher/events.d.ts +0 -25
- package/dist/types/predictive-loading/prefetcher/index.d.ts +0 -4
- package/dist/types/predictive-loading/prefetcher/lex-predictive-prefetcher.d.ts +0 -18
- package/dist/types/predictive-loading/prefetcher/predictive-prefetcher.d.ts +0 -38
- package/dist/types/predictive-loading/prefetcher/utils.d.ts +0 -52
- package/dist/types/predictive-loading/repository/index.d.ts +0 -2
- package/dist/types/predictive-loading/repository/prefetch-repository.d.ts +0 -31
- package/dist/types/predictive-loading/repository/utils.d.ts +0 -13
- package/dist/types/predictive-loading/request-runner/index.d.ts +0 -2
- package/dist/types/predictive-loading/request-runner/lex-request-runner.d.ts +0 -10
- package/dist/types/predictive-loading/request-runner/request-runner.d.ts +0 -5
- package/dist/types/predictive-loading/request-strategy/get-apex-request-strategy.d.ts +0 -30
- package/dist/types/predictive-loading/request-strategy/get-list-info-by-name-request-strategy.d.ts +0 -19
- package/dist/types/predictive-loading/request-strategy/get-list-infos-by-object-name-request-strategy.d.ts +0 -19
- package/dist/types/predictive-loading/request-strategy/get-list-object-info-request-strategy.d.ts +0 -18
- package/dist/types/predictive-loading/request-strategy/get-list-records-by-name-request-strategy.d.ts +0 -19
- package/dist/types/predictive-loading/request-strategy/get-object-info-request-strategy.d.ts +0 -26
- package/dist/types/predictive-loading/request-strategy/get-object-infos-request-strategy.d.ts +0 -25
- package/dist/types/predictive-loading/request-strategy/get-record-actions-request-strategy.d.ts +0 -20
- package/dist/types/predictive-loading/request-strategy/get-record-avatars-request-strategy.d.ts +0 -20
- package/dist/types/predictive-loading/request-strategy/get-record-request-strategy.d.ts +0 -26
- package/dist/types/predictive-loading/request-strategy/get-records-request-strategy.d.ts +0 -18
- package/dist/types/predictive-loading/request-strategy/get-related-list-actions-request-strategy.d.ts +0 -21
- package/dist/types/predictive-loading/request-strategy/get-related-list-info-batch-request-strategy.d.ts +0 -24
- package/dist/types/predictive-loading/request-strategy/get-related-list-info-request-strategy.d.ts +0 -50
- package/dist/types/predictive-loading/request-strategy/get-related-list-records-batch-request-strategy.d.ts +0 -32
- package/dist/types/predictive-loading/request-strategy/get-related-list-records-request-strategy.d.ts +0 -34
- package/dist/types/predictive-loading/request-strategy/get-related-lists-actions-request-strategy.d.ts +0 -28
- package/dist/types/predictive-loading/request-strategy/get-related-lists-info-strategy.d.ts +0 -30
- package/dist/types/predictive-loading/request-strategy/index.d.ts +0 -20
- package/dist/types/predictive-loading/request-strategy/lex-request-strategy.d.ts +0 -13
- package/dist/types/predictive-loading/request-strategy/luvio-adapter-request-strategy.d.ts +0 -27
- package/dist/types/predictive-loading/request-strategy/request-strategy.d.ts +0 -79
- package/dist/types/predictive-loading/request-strategy-manager/request-strategy-manager.d.ts +0 -12
- package/dist/types/predictive-loading/storage/aura-prefetch-storage.d.ts +0 -25
- package/dist/types/predictive-loading/storage/in-memory-prefetch-storage.d.ts +0 -6
- package/dist/types/predictive-loading/storage/index.d.ts +0 -8
- package/dist/types/predictive-loading/storage/local-prefetch-storage.d.ts +0 -7
package/dist/types/main.d.ts
CHANGED
|
@@ -1,74 +1,22 @@
|
|
|
1
1
|
import { Luvio } from '@luvio/engine';
|
|
2
2
|
import type { KeyParamsRecord } from '@salesforce/lds-adapters-uiapi';
|
|
3
|
-
import type { ObjectHomePageContext, PdlPrefetcherEventType, PrefetcherEventMap } from './predictive-loading';
|
|
4
|
-
import { type RecordHomePageContext } from './predictive-loading';
|
|
5
|
-
import type { LexRequestStrategy } from './predictive-loading/request-strategy/lex-request-strategy';
|
|
6
|
-
import { type LexRequest } from './predictive-loading/lex';
|
|
7
|
-
export { PdlRequestPriority, PdlPrefetcherEventType } from './predictive-loading';
|
|
8
|
-
export { LexRequestStrategy } from './predictive-loading/request-strategy/lex-request-strategy';
|
|
9
3
|
export { configService } from './config-service-util';
|
|
10
4
|
export declare const PDL_ENGINE_REGISTRATION_ID = "@salesforce/lds-pdl-engine";
|
|
11
5
|
export type PdlEngineRegistration = {
|
|
12
6
|
id: typeof PDL_ENGINE_REGISTRATION_ID;
|
|
13
7
|
buildPredictorForContext: typeof buildPredictorForContext;
|
|
14
8
|
};
|
|
15
|
-
/**
|
|
16
|
-
* Registers a request strategy to be utilized by PDL.
|
|
17
|
-
* @param requestStrategy - {@link LexRequestStrategy} The request strategy/strategies to register.
|
|
18
|
-
* @returns boolean | boolean[] - true/false depending on registration success.
|
|
19
|
-
*/
|
|
20
|
-
export declare function registerRequestStrategy(...requestStrategy: LexRequestStrategy[]): boolean | boolean[];
|
|
21
|
-
/**
|
|
22
|
-
* Unregisters a request strategy to be utilized by PDL.
|
|
23
|
-
* @param requestStrategy - {@link LexRequestStrategy} The request strategy to unregister.
|
|
24
|
-
* @returns boolean | boolean[] - true/false depending on unregistration success.
|
|
25
|
-
*/
|
|
26
|
-
export declare function unregisterRequestStrategy(...requestStrategy: LexRequestStrategy[]): boolean | boolean[];
|
|
27
|
-
export declare function whenPredictionsReady(callback: () => void): void;
|
|
28
|
-
export declare function saveRequestAsPrediction(request: LexRequest): void;
|
|
29
|
-
/**
|
|
30
|
-
* Subscribes to a specific prefetcher event type.
|
|
31
|
-
* @param type - The type of event to subscribe to.
|
|
32
|
-
* @param callback - The callback to invoke when the specified event occurs.
|
|
33
|
-
* @returns A function to unsubscribe from the prefetcher events.
|
|
34
|
-
*/
|
|
35
|
-
export declare function subscribeToPrefetcherEvents<T extends PdlPrefetcherEventType>(type: T, callback: (event: PrefetcherEventMap[T]) => void): () => void;
|
|
36
9
|
export declare const notifyUpdateAvailableFactory: (luvio: Luvio) => (configs: Partial<KeyParamsRecord>[]) => Promise<void>;
|
|
37
10
|
/**
|
|
38
|
-
*
|
|
39
|
-
* @property {string} objectApiName - The API name of the object.
|
|
40
|
-
* @property {string} recordId - The unique identifier for the record.
|
|
41
|
-
* @property {string} actionName - The name of the action being performed.
|
|
42
|
-
* @property {'recordPage'} type - The type of the context, specifically for a record page.
|
|
43
|
-
*/
|
|
44
|
-
/**
|
|
45
|
-
* Builds a predictor for a given record home page context. This predictor is responsible for
|
|
46
|
-
* preloading data based on predictions for the current context and create new predictions based
|
|
47
|
-
* on page requests of this context.
|
|
11
|
+
* Builds a predictor for a given page context.
|
|
48
12
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* getPredictionSummary: () => Map<String,Number>
|
|
55
|
-
* }} An object containing methods to handle predictions:
|
|
56
|
-
* - hasPredictions: Checks if there are any predictions available.
|
|
57
|
-
* - watchPageLoadForPredictions: Starts recording the page request for prediction purposes.
|
|
58
|
-
* - runPredictions: Executes the predictions based on the recorded data and returns a promise
|
|
59
|
-
* of when those predictions are completed.
|
|
60
|
-
* - getPredictionSummary: Returns the count of exact and similar prediction requests
|
|
13
|
+
* Predictive data loading (PDL) has been removed from the default LDS engine creator, so this
|
|
14
|
+
* is a permanent no-op that returns undefined ("no predictor"). It is retained only to satisfy
|
|
15
|
+
* the `@salesforce/lds-pdl-engine` bus registration above; shared cross-runtime laf loaders read
|
|
16
|
+
* it off the bus and already handle an undefined result by skipping predictions. LEX predictive
|
|
17
|
+
* loading now lives in the One Runtime / one.app engine creators.
|
|
61
18
|
*/
|
|
62
|
-
export declare function buildPredictorForContext(
|
|
63
|
-
hasPredictions(): boolean;
|
|
64
|
-
watchPageLoadForPredictions(): void;
|
|
65
|
-
runPredictions(): Promise<void>;
|
|
66
|
-
getPredictionSummary(): {
|
|
67
|
-
exact: number;
|
|
68
|
-
similar: number;
|
|
69
|
-
totalRequestCount: Number;
|
|
70
|
-
};
|
|
71
|
-
} | undefined;
|
|
19
|
+
export declare function buildPredictorForContext(_context: unknown): undefined;
|
|
72
20
|
export declare function initializeLDS(): Luvio;
|
|
73
21
|
export declare function initializeOneStore(luvio: Luvio): void;
|
|
74
22
|
declare function ldsEngineCreator(): {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-runtime-aura",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.461.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "LDS engine for Aura runtime.",
|
|
6
6
|
"main": "dist/ldsEngineCreator.js",
|
|
@@ -34,53 +34,53 @@
|
|
|
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-adapter": "^1.
|
|
46
|
-
"@salesforce/lds-network-aura": "^1.
|
|
47
|
-
"@salesforce/lds-network-fetch": "^1.
|
|
37
|
+
"@conduit-client/service-provisioner": "3.28.0",
|
|
38
|
+
"@conduit-client/tools-core": "3.28.0",
|
|
39
|
+
"@salesforce/lds-adapters-apex": "^1.461.0",
|
|
40
|
+
"@salesforce/lds-adapters-uiapi": "^1.461.0",
|
|
41
|
+
"@salesforce/lds-ads-bridge": "^1.461.0",
|
|
42
|
+
"@salesforce/lds-aura-storage": "^1.461.0",
|
|
43
|
+
"@salesforce/lds-bindings": "^1.461.0",
|
|
44
|
+
"@salesforce/lds-instrumentation": "^1.461.0",
|
|
45
|
+
"@salesforce/lds-network-adapter": "^1.461.0",
|
|
46
|
+
"@salesforce/lds-network-aura": "^1.461.0",
|
|
47
|
+
"@salesforce/lds-network-fetch": "^1.461.0",
|
|
48
48
|
"jwt-encode": "1.0.1"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@conduit-client/command-aura-graphql-normalized-cache-control": "3.
|
|
52
|
-
"@conduit-client/command-aura-network": "3.
|
|
53
|
-
"@conduit-client/command-aura-normalized-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/jwt-manager": "3.
|
|
62
|
-
"@conduit-client/service-aura-network": "3.
|
|
63
|
-
"@conduit-client/service-bindings-imperative": "3.
|
|
64
|
-
"@conduit-client/service-bindings-lwc": "3.
|
|
65
|
-
"@conduit-client/service-cache": "3.
|
|
66
|
-
"@conduit-client/service-cache-control": "3.
|
|
67
|
-
"@conduit-client/service-cache-inclusion-policy": "3.
|
|
68
|
-
"@conduit-client/service-config": "3.
|
|
69
|
-
"@conduit-client/service-feature-flags": "3.
|
|
70
|
-
"@conduit-client/service-fetch-network": "3.
|
|
71
|
-
"@conduit-client/service-instrument-command": "3.
|
|
72
|
-
"@conduit-client/service-pubsub": "3.
|
|
73
|
-
"@conduit-client/service-renewable-resource-manager": "3.
|
|
74
|
-
"@conduit-client/service-store": "3.
|
|
75
|
-
"@conduit-client/utils": "3.
|
|
51
|
+
"@conduit-client/command-aura-graphql-normalized-cache-control": "3.28.0",
|
|
52
|
+
"@conduit-client/command-aura-network": "3.28.0",
|
|
53
|
+
"@conduit-client/command-aura-normalized-cache-control": "3.28.0",
|
|
54
|
+
"@conduit-client/command-fetch-network": "3.28.0",
|
|
55
|
+
"@conduit-client/command-http-graphql-normalized-cache-control": "3.28.0",
|
|
56
|
+
"@conduit-client/command-http-normalized-cache-control": "3.28.0",
|
|
57
|
+
"@conduit-client/command-ndjson": "3.28.0",
|
|
58
|
+
"@conduit-client/command-network": "3.28.0",
|
|
59
|
+
"@conduit-client/command-sse": "3.28.0",
|
|
60
|
+
"@conduit-client/command-streaming": "3.28.0",
|
|
61
|
+
"@conduit-client/jwt-manager": "3.28.0",
|
|
62
|
+
"@conduit-client/service-aura-network": "3.28.0",
|
|
63
|
+
"@conduit-client/service-bindings-imperative": "3.28.0",
|
|
64
|
+
"@conduit-client/service-bindings-lwc": "3.28.0",
|
|
65
|
+
"@conduit-client/service-cache": "3.28.0",
|
|
66
|
+
"@conduit-client/service-cache-control": "3.28.0",
|
|
67
|
+
"@conduit-client/service-cache-inclusion-policy": "3.28.0",
|
|
68
|
+
"@conduit-client/service-config": "3.28.0",
|
|
69
|
+
"@conduit-client/service-feature-flags": "3.28.0",
|
|
70
|
+
"@conduit-client/service-fetch-network": "3.28.0",
|
|
71
|
+
"@conduit-client/service-instrument-command": "3.28.0",
|
|
72
|
+
"@conduit-client/service-pubsub": "3.28.0",
|
|
73
|
+
"@conduit-client/service-renewable-resource-manager": "3.28.0",
|
|
74
|
+
"@conduit-client/service-store": "3.28.0",
|
|
75
|
+
"@conduit-client/utils": "3.28.0",
|
|
76
76
|
"@luvio/network-adapter-composable": "0.161.2",
|
|
77
77
|
"@luvio/network-adapter-fetch": "0.161.2",
|
|
78
78
|
"@lwc/state": "^0.29.0",
|
|
79
|
-
"@salesforce/lds-adapters-onestore-graphql": "^1.
|
|
79
|
+
"@salesforce/lds-adapters-onestore-graphql": "^1.461.0",
|
|
80
80
|
"@salesforce/lds-adapters-uiapi-lex": "^1.415.0",
|
|
81
|
-
"@salesforce/lds-durable-storage": "^1.
|
|
82
|
-
"@salesforce/lds-luvio-service": "^1.
|
|
83
|
-
"@salesforce/lds-luvio-uiapi-records-service": "^1.
|
|
81
|
+
"@salesforce/lds-durable-storage": "^1.461.0",
|
|
82
|
+
"@salesforce/lds-luvio-service": "^1.461.0",
|
|
83
|
+
"@salesforce/lds-luvio-uiapi-records-service": "^1.461.0"
|
|
84
84
|
},
|
|
85
85
|
"luvioBundlesize": [
|
|
86
86
|
{
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare const PDL_EXECUTE_ASYNC_OPTIONS: {
|
|
2
|
-
LOG_ERROR_ONLY: boolean;
|
|
3
|
-
ERROR_SCOPE: string;
|
|
4
|
-
};
|
|
5
|
-
export type RequestEntry<Request> = {
|
|
6
|
-
request: Request;
|
|
7
|
-
requestMetadata: {
|
|
8
|
-
requestTime: number;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Request and context-based Key data to be saved.
|
|
13
|
-
*/
|
|
14
|
-
export type SaveRequestData<Request, Context> = {
|
|
15
|
-
request: Request;
|
|
16
|
-
key: Context;
|
|
17
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { BaseAdapterRequest } from '../../predictive-loading';
|
|
2
|
-
import type { DefaultPageContext, ObjectHomePageContext, RecordHomePageContext } from '../pages';
|
|
3
|
-
/**
|
|
4
|
-
* Options for the predictive prefetcher.
|
|
5
|
-
*/
|
|
6
|
-
export type LexPrefetcherOptions = {
|
|
7
|
-
/**
|
|
8
|
-
* Limit on the number of requests that can be inflight at any given time.
|
|
9
|
-
*/
|
|
10
|
-
inflightRequestLimit: number;
|
|
11
|
-
};
|
|
12
|
-
export { PredictionsReadyManager } from './predictions-ready-manager';
|
|
13
|
-
export type LexRequest<Config = unknown> = BaseAdapterRequest<Config>;
|
|
14
|
-
export type LexRequestOptions = {
|
|
15
|
-
disableHotspot?: boolean;
|
|
16
|
-
};
|
|
17
|
-
export type LexContext = RecordHomePageContext | ObjectHomePageContext | DefaultPageContext;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Manages the state of predictions and notifies registered callbacks when predictions are ready.
|
|
3
|
-
*/
|
|
4
|
-
export declare class PredictionsReadyManager {
|
|
5
|
-
/**
|
|
6
|
-
* Array of callbacks to be executed when predictions are ready.
|
|
7
|
-
* @private
|
|
8
|
-
*/
|
|
9
|
-
private predictionsReadyCallbacks;
|
|
10
|
-
/**
|
|
11
|
-
* Indicates whether the predictions are ready.
|
|
12
|
-
* @private
|
|
13
|
-
*/
|
|
14
|
-
private predictionsReady;
|
|
15
|
-
/**
|
|
16
|
-
* Registers a callback to be called when predictions are ready.
|
|
17
|
-
* If predictions are already ready, the callback is invoked immediately.
|
|
18
|
-
*
|
|
19
|
-
* @param {() => void} callback - The callback function to be executed when predictions are ready.
|
|
20
|
-
*/
|
|
21
|
-
whenPredictionsReady(callback: () => void): void;
|
|
22
|
-
/**
|
|
23
|
-
* Notifies that predictions are ready by invoking all registered callbacks.
|
|
24
|
-
*/
|
|
25
|
-
notifyPredictionsReady(): void;
|
|
26
|
-
/**
|
|
27
|
-
* Retrieves the list of callbacks registered to be executed when predictions are ready.
|
|
28
|
-
*
|
|
29
|
-
* @returns {Array<() => void>} Array of callback functions.
|
|
30
|
-
*/
|
|
31
|
-
getCallbacks(): Array<() => void>;
|
|
32
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { LexDefaultPage } from './lex-default-page';
|
|
2
|
-
import type { LexRequest } from '../lex';
|
|
3
|
-
import type { DefaultPageContext } from './lex-default-page';
|
|
4
|
-
import type { RequestStrategyManager } from '../request-strategy-manager/request-strategy-manager';
|
|
5
|
-
/**
|
|
6
|
-
* Base implementation of a home page
|
|
7
|
-
*/
|
|
8
|
-
export declare abstract class AbstractHomePage<HomePageContext extends DefaultPageContext> extends LexDefaultPage<LexRequest, HomePageContext> {
|
|
9
|
-
protected requestStrategyManager: RequestStrategyManager;
|
|
10
|
-
private supportedAdapters;
|
|
11
|
-
protected constructor(context: HomePageContext, similarContext: HomePageContext, requestStrategyManager: RequestStrategyManager, supportedAdapters: Set<string>);
|
|
12
|
-
supportsRequest(request: LexRequest): boolean;
|
|
13
|
-
buildSaveRequestData(request: LexRequest): {
|
|
14
|
-
key: HomePageContext;
|
|
15
|
-
request: LexRequest<unknown>;
|
|
16
|
-
}[];
|
|
17
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { BaseAdapterRequest } from '../request-strategy';
|
|
2
|
-
import { PredictivePrefetchPage } from './predictive-prefetch-page';
|
|
3
|
-
export type DefaultPageContext = Record<string, any>;
|
|
4
|
-
export declare class LexDefaultPage<Request extends BaseAdapterRequest, Context extends DefaultPageContext> extends PredictivePrefetchPage<Request, Context> {
|
|
5
|
-
constructor(context: Context, similarContext?: Context);
|
|
6
|
-
supportsRequest(_request: Request): boolean;
|
|
7
|
-
buildSaveRequestData(request: Request): {
|
|
8
|
-
key: Context;
|
|
9
|
-
request: Request;
|
|
10
|
-
}[];
|
|
11
|
-
resolveSimilarRequest(similarRequest: Request): Request;
|
|
12
|
-
getAlwaysRunRequests(): Request[];
|
|
13
|
-
shouldReduceAlwaysRequestsWithPredictions(): boolean;
|
|
14
|
-
shouldExecuteAlwaysRequestByThemself(): boolean;
|
|
15
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { LexRequest } from '../lex';
|
|
2
|
-
import type { DefaultPageContext } from './lex-default-page';
|
|
3
|
-
import type { RequestStrategyManager } from '../request-strategy-manager/request-strategy-manager';
|
|
4
|
-
import { AbstractHomePage } from './abstract-home-page';
|
|
5
|
-
export type ObjectHomePageContext = {
|
|
6
|
-
objectApiName: string;
|
|
7
|
-
listViewApiName: string;
|
|
8
|
-
type: 'objectHomePage';
|
|
9
|
-
};
|
|
10
|
-
export declare const OBJECT_HOME_SUPPORTED_ADAPTERS: Set<string>;
|
|
11
|
-
export declare class ObjectHomePage extends AbstractHomePage<ObjectHomePageContext> {
|
|
12
|
-
constructor(context: ObjectHomePageContext, requestStrategyManager: RequestStrategyManager);
|
|
13
|
-
getAlwaysRunRequests(): LexRequest[];
|
|
14
|
-
/**
|
|
15
|
-
* In OH, the always requests are reduced with predictions, and because they
|
|
16
|
-
* can't be merged with other predictions, they will always run by themself.
|
|
17
|
-
* This value must be `false`, otherwise we may see repeated requests.
|
|
18
|
-
*
|
|
19
|
-
* @returns false
|
|
20
|
-
*/
|
|
21
|
-
shouldExecuteAlwaysRequestByThemself(): boolean;
|
|
22
|
-
static handlesContext(context: DefaultPageContext): context is ObjectHomePageContext;
|
|
23
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { SaveRequestData } from '../common';
|
|
2
|
-
export declare abstract class PredictivePrefetchPage<Request, Context> {
|
|
3
|
-
protected context: Context;
|
|
4
|
-
protected similarContext?: Context | undefined;
|
|
5
|
-
protected constructor(context: Context, similarContext?: Context | undefined);
|
|
6
|
-
abstract supportsRequest(request: Request): boolean;
|
|
7
|
-
abstract buildSaveRequestData(request: Request): SaveRequestData<Request, Context>[];
|
|
8
|
-
abstract resolveSimilarRequest(similarRequest: Request): Request;
|
|
9
|
-
abstract getAlwaysRunRequests(): Request[];
|
|
10
|
-
getExactKey(): Context;
|
|
11
|
-
getSimilarKey(): Context;
|
|
12
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { LexRequest } from '../lex';
|
|
2
|
-
import type { DefaultPageContext } from './lex-default-page';
|
|
3
|
-
import type { RequestStrategyManager } from '../request-strategy-manager/request-strategy-manager';
|
|
4
|
-
import { AbstractHomePage } from './abstract-home-page';
|
|
5
|
-
export declare const RECORD_HOME_SUPPORTED_ADAPTERS: Set<string>;
|
|
6
|
-
export type RecordHomePageContext = {
|
|
7
|
-
objectApiName: string;
|
|
8
|
-
recordId: string;
|
|
9
|
-
recordTypeId?: string;
|
|
10
|
-
actionName: string;
|
|
11
|
-
type: 'recordPage';
|
|
12
|
-
};
|
|
13
|
-
export declare class RecordHomePage extends AbstractHomePage<RecordHomePageContext> {
|
|
14
|
-
constructor(context: RecordHomePageContext, requestStrategyManager: RequestStrategyManager);
|
|
15
|
-
getExactKey(): RecordHomePageContext;
|
|
16
|
-
resolveSimilarRequest(similarRequest: LexRequest): LexRequest;
|
|
17
|
-
getAlwaysRunRequests(): LexRequest[];
|
|
18
|
-
/**
|
|
19
|
-
* In RH, we should execute the getRecord(id, type) by itself as we want the result asap, so
|
|
20
|
-
* it does not stop rendering.
|
|
21
|
-
* @returns true
|
|
22
|
-
*/
|
|
23
|
-
shouldExecuteAlwaysRequestByThemself(): boolean;
|
|
24
|
-
static handlesContext(context: DefaultPageContext): context is RecordHomePageContext;
|
|
25
|
-
static contextToExactKey(context: RecordHomePageContext): RecordHomePageContext;
|
|
26
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { PredictivePrefetchPage } from '../pages';
|
|
2
|
-
export declare enum PdlPrefetcherEventType {
|
|
3
|
-
STARTED_RECORDING = "started-recording",
|
|
4
|
-
STOPPED_RECORDING = "stopped-recording"
|
|
5
|
-
}
|
|
6
|
-
export type StartedRecordingEvent = {
|
|
7
|
-
type: PdlPrefetcherEventType.STARTED_RECORDING;
|
|
8
|
-
page: PredictivePrefetchPage<any, any>;
|
|
9
|
-
};
|
|
10
|
-
export type StoppedRecordingEvent = {
|
|
11
|
-
type: PdlPrefetcherEventType.STOPPED_RECORDING;
|
|
12
|
-
page: PredictivePrefetchPage<any, any>;
|
|
13
|
-
};
|
|
14
|
-
export type PrefetcherEvent = StartedRecordingEvent | StoppedRecordingEvent;
|
|
15
|
-
export type PrefetcherEventMap = {
|
|
16
|
-
[PdlPrefetcherEventType.STARTED_RECORDING]: StartedRecordingEvent;
|
|
17
|
-
[PdlPrefetcherEventType.STOPPED_RECORDING]: StoppedRecordingEvent;
|
|
18
|
-
};
|
|
19
|
-
type ListenerFn<T extends PdlPrefetcherEventType> = (event: PrefetcherEventMap[T]) => void;
|
|
20
|
-
export declare class PrefetcherEventEmitter {
|
|
21
|
-
private listeners;
|
|
22
|
-
subscribeTo<T extends PdlPrefetcherEventType>(type: T, listener: ListenerFn<T>): () => void;
|
|
23
|
-
emit<T extends PdlPrefetcherEventType>(event: PrefetcherEventMap[T]): void;
|
|
24
|
-
}
|
|
25
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { LexDefaultPage } from '../pages';
|
|
2
|
-
import { ApplicationPredictivePrefetcher } from './predictive-prefetcher';
|
|
3
|
-
import type { RequestRunner } from '../request-runner';
|
|
4
|
-
import type { PrefetchRepository } from '../repository';
|
|
5
|
-
import type { RequestEntry } from '../common';
|
|
6
|
-
import type { LexContext, LexPrefetcherOptions, LexRequest } from '../lex';
|
|
7
|
-
import type { RequestStrategyManager } from '../request-strategy-manager/request-strategy-manager';
|
|
8
|
-
import type { PrefetcherEventEmitter } from './events';
|
|
9
|
-
export declare class LexPredictivePrefetcher extends ApplicationPredictivePrefetcher<LexRequest, LexContext, LexDefaultPage<LexRequest, LexContext>> {
|
|
10
|
-
protected options: LexPrefetcherOptions;
|
|
11
|
-
page: LexDefaultPage<LexRequest, LexContext>;
|
|
12
|
-
private requestStrategyManager;
|
|
13
|
-
constructor(context: LexContext, repository: PrefetchRepository<LexRequest>, requestRunner: RequestRunner<LexRequest>, eventEmitter: PrefetcherEventEmitter, requestStrategyManager: RequestStrategyManager, options: LexPrefetcherOptions);
|
|
14
|
-
getPage(): LexDefaultPage<LexRequest, LexContext>;
|
|
15
|
-
getAllPageRequests(): RequestEntry<LexRequest>[];
|
|
16
|
-
getPredictedRequestsOrderedByPriority(): RequestEntry<LexRequest>[];
|
|
17
|
-
predict(): Promise<void>;
|
|
18
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { PrefetchRepository } from '../repository';
|
|
2
|
-
import type { PredictivePrefetchPage } from '../pages';
|
|
3
|
-
import type { RequestRunner } from '../request-runner';
|
|
4
|
-
import type { BaseAdapterRequest } from '../request-strategy';
|
|
5
|
-
import type { PrefetcherEventEmitter, PrefetcherEventMap } from './events';
|
|
6
|
-
import { PdlPrefetcherEventType } from './events';
|
|
7
|
-
export declare abstract class ApplicationPredictivePrefetcher<Request extends BaseAdapterRequest, Context extends Record<string, any>, Page extends PredictivePrefetchPage<Request, Context>> {
|
|
8
|
-
protected repository: PrefetchRepository<Request>;
|
|
9
|
-
protected requestRunner: RequestRunner<Request>;
|
|
10
|
-
protected eventEmitter: PrefetcherEventEmitter;
|
|
11
|
-
private _context;
|
|
12
|
-
isRecording: boolean;
|
|
13
|
-
totalRequestCount: Number;
|
|
14
|
-
page: Page;
|
|
15
|
-
queuedPredictionRequests: Request[];
|
|
16
|
-
protected constructor(context: Context, repository: PrefetchRepository<Request>, requestRunner: RequestRunner<Request>, eventEmitter: PrefetcherEventEmitter);
|
|
17
|
-
abstract getPage(): Page;
|
|
18
|
-
set context(value: Context);
|
|
19
|
-
get context(): Context;
|
|
20
|
-
subscribeToEvent<T extends PdlPrefetcherEventType>(type: T, callback: (event: PrefetcherEventMap[T]) => void): () => void;
|
|
21
|
-
stopRecording(): Promise<void>;
|
|
22
|
-
startRecording(): void;
|
|
23
|
-
saveRequest(request: Request): void;
|
|
24
|
-
predict(): Promise<void>;
|
|
25
|
-
getPredictionSummary(): {
|
|
26
|
-
exact: number;
|
|
27
|
-
similar: number;
|
|
28
|
-
totalRequestCount: Number;
|
|
29
|
-
};
|
|
30
|
-
hasPredictions(): boolean;
|
|
31
|
-
getSimilarPageRequests(): {
|
|
32
|
-
request: Request;
|
|
33
|
-
requestMetadata: {
|
|
34
|
-
requestTime: number;
|
|
35
|
-
};
|
|
36
|
-
}[];
|
|
37
|
-
getExactPageRequests(): import("../common").RequestEntry<Request>[];
|
|
38
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { RequestRunner } from '../request-runner';
|
|
2
|
-
import type { RequestEntry } from '../common';
|
|
3
|
-
import type { LexRequest, LexRequestOptions } from '../lex';
|
|
4
|
-
import type { RequestStrategyManager } from '../request-strategy-manager/request-strategy-manager';
|
|
5
|
-
import type { DefaultPageContext } from '../pages';
|
|
6
|
-
/**
|
|
7
|
-
* Runs a list of requests with a specified concurrency limit.
|
|
8
|
-
*
|
|
9
|
-
* @template Request - The type of the requests being processed.
|
|
10
|
-
* @param {RequestEntry<Request>[]} requests - An array of request entries to be processed in the array order.
|
|
11
|
-
* @param {RequestRunner<Request>} runner - The runner instance responsible for executing the requests.
|
|
12
|
-
* @param {number} concurrentRequestsLimit - The maximum number of concurrent requests allowed.
|
|
13
|
-
* @param {number} pageStartTime - The start time of the page load, used to calculate the time elapsed since the page starts loading.
|
|
14
|
-
* @returns {Promise<void>} A promise that resolves when all requests have been processed.
|
|
15
|
-
*
|
|
16
|
-
* This function manages a queue of pending requests and processes them with a concurrency limit.
|
|
17
|
-
* Requests are only processed if their `requestTime` is less than the time elapsed since `pageStartTime`.
|
|
18
|
-
*/
|
|
19
|
-
export declare function runRequestsWithLimit<Request>(requests: RequestEntry<Request>[], runner: RequestRunner<Request>, concurrentRequestsLimit: number, pageStartTime: number): Promise<void>;
|
|
20
|
-
/**
|
|
21
|
-
* Runs entire list of LEX requests, applying hotspot up to the specified limit and disabling for all remaining
|
|
22
|
-
*
|
|
23
|
-
* @param {RequestEntry<LexRequest>[]} requests - An array of request entries to be processed in the array order.
|
|
24
|
-
* @param {RequestRunner<LexRequest, LexRequestOptions>} runner - The runner instance responsible for executing the requests.
|
|
25
|
-
* @param {number} hotspotLimit - The number of hotspot requests allowed.
|
|
26
|
-
* @returns {Promise<void>} A promise that resolves when all requests have been processed.
|
|
27
|
-
*
|
|
28
|
-
* This function processes a queue of pending requests, enabling hotspot for the first N requests,
|
|
29
|
-
* as specified by the hotspotLimit argument. The remaining requests have hotspot disabled.
|
|
30
|
-
*/
|
|
31
|
-
export declare function runRequestsWithHotspotLimit(requests: RequestEntry<LexRequest>[], runner: RequestRunner<LexRequest, LexRequestOptions>, hotspotLimit: number): Promise<void>;
|
|
32
|
-
/**
|
|
33
|
-
* Compares two request entries based on their priority and, if the priorities are the same, their request times.
|
|
34
|
-
* This function is typically used for sorting requests where priority takes precedence, and timing is used
|
|
35
|
-
* as a secondary criterion. The function assumes that any necessary filtering of requests has already been done.
|
|
36
|
-
*
|
|
37
|
-
* @template Context - Extends `DefaultPageContext`, provides additional context for the request priority determination.
|
|
38
|
-
*
|
|
39
|
-
* @param {RequestEntry<LexRequest>} requestA - The first request entry containing the request and its metadata.
|
|
40
|
-
* @param {RequestEntry<LexRequest>} requestB - The second request entry containing the request and its metadata.
|
|
41
|
-
* @param {RequestStrategyManager} requestStrategyManager - Manager that provides access to request strategies based on adapter names.
|
|
42
|
-
* @param {Context} context - The context in which the requests are being compared, used to determine request priority.
|
|
43
|
-
*
|
|
44
|
-
* @returns {number} A negative number if the first request should come before the second, a positive number if the
|
|
45
|
-
* second should come before the first, or zero if they are considered equal for sorting purposes.
|
|
46
|
-
* This is determined first by the priority (higher priority comes first) and then by the request
|
|
47
|
-
* time (earlier request comes first) if priorities are the same. The priorities are fetched from
|
|
48
|
-
* the `requestStrategyManager` for each request's `adapterName`. If a strategy is not found,
|
|
49
|
-
* the priority defaults to `RequestPriority.LOW`.
|
|
50
|
-
*/
|
|
51
|
-
export declare function compareByPriorityThenTime<Context extends DefaultPageContext = DefaultPageContext>({ request: requestA, requestMetadata: requestMetadataA }: RequestEntry<LexRequest>, { request: requestB, requestMetadata: requestMetadataB }: RequestEntry<LexRequest>, requestStrategyManager: RequestStrategyManager, context: Context): number;
|
|
52
|
-
export declare function isUseHotspotLimitOpen(): boolean;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { PrefetchStorage } from '../storage';
|
|
2
|
-
import type { RequestEntry } from '../common';
|
|
3
|
-
type Key = Record<string, any>;
|
|
4
|
-
export type History = {
|
|
5
|
-
version: '1.0';
|
|
6
|
-
pages: Key[];
|
|
7
|
-
};
|
|
8
|
-
export type PageEntry<Request> = {
|
|
9
|
-
id: string;
|
|
10
|
-
recordTypeId?: string;
|
|
11
|
-
requests: RequestEntry<Request>[];
|
|
12
|
-
};
|
|
13
|
-
export type PrefetchRepositoryOptions<Request> = {
|
|
14
|
-
modifyBeforeSaveHook?: (requests: RequestEntry<Request>[]) => RequestEntry<Request>[];
|
|
15
|
-
modifyPageBeforeSavingHook?: (page: PageEntry<Request>) => void;
|
|
16
|
-
};
|
|
17
|
-
export declare class PrefetchRepository<Request> {
|
|
18
|
-
private storage;
|
|
19
|
-
private options;
|
|
20
|
-
private requestBuffer;
|
|
21
|
-
constructor(storage: PrefetchStorage, options?: PrefetchRepositoryOptions<Request>);
|
|
22
|
-
clearRequestBuffer(): void;
|
|
23
|
-
pageStartTime: number;
|
|
24
|
-
markPageStart(): void;
|
|
25
|
-
flushRequestsToStorage(): Promise<void>;
|
|
26
|
-
getKeyId(key: Key): string;
|
|
27
|
-
saveRequest<Request>(key: Key, request: Request): void;
|
|
28
|
-
getPage(key: Key): PageEntry<Request> | undefined;
|
|
29
|
-
getPageRequests(key: Key): RequestEntry<Request>[];
|
|
30
|
-
}
|
|
31
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A deterministic JSON stringify implementation. Heavily adapted from https://github.com/epoberezkin/fast-json-stable-stringify.
|
|
3
|
-
* This is needed because insertion order for JSON.stringify(object) affects output:
|
|
4
|
-
* JSON.stringify({a: 1, b: 2})
|
|
5
|
-
* "{"a":1,"b":2}"
|
|
6
|
-
* JSON.stringify({b: 2, a: 1})
|
|
7
|
-
* "{"b":2,"a":1}"
|
|
8
|
-
* @param data Data to be JSON-stringified.
|
|
9
|
-
* @returns JSON.stringified value with consistent ordering of keys.
|
|
10
|
-
*/
|
|
11
|
-
export declare function stableJSONStringify(node: any): string | undefined;
|
|
12
|
-
export declare function isObject(obj: any): obj is Record<string, unknown>;
|
|
13
|
-
export declare function deepEquals(objA: any, objB: any): boolean;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { RequestRunner } from './request-runner';
|
|
2
|
-
import type { RequestEntry } from '../common';
|
|
3
|
-
import type { LexRequest, LexRequestOptions } from '../lex';
|
|
4
|
-
import type { RequestStrategyManager } from '../request-strategy-manager/request-strategy-manager';
|
|
5
|
-
export declare class LexRequestRunner implements RequestRunner<LexRequest, LexRequestOptions> {
|
|
6
|
-
private requestStrategyManager;
|
|
7
|
-
constructor(requestStrategyManager: RequestStrategyManager);
|
|
8
|
-
reduceRequests(requests: RequestEntry<LexRequest>[]): RequestEntry<LexRequest>[];
|
|
9
|
-
runRequest(request: LexRequest, options?: LexRequestOptions): Promise<void>;
|
|
10
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { ApexInvokerParams } from '@salesforce/lds-adapters-apex';
|
|
2
|
-
import type { AdapterRequestContext, Luvio } from '@luvio/engine';
|
|
3
|
-
import { LuvioAdapterRequestStrategy } from './luvio-adapter-request-strategy';
|
|
4
|
-
import { RequestPriority } from './request-strategy';
|
|
5
|
-
import type { LexRequestOptions } from '../lex';
|
|
6
|
-
export type GetApexConfig = {
|
|
7
|
-
name: string;
|
|
8
|
-
invokerParams: ApexInvokerParams;
|
|
9
|
-
config: Record<string, any>;
|
|
10
|
-
};
|
|
11
|
-
export type GetApexRequest = {
|
|
12
|
-
adapterName: 'getApex';
|
|
13
|
-
config: GetApexConfig;
|
|
14
|
-
};
|
|
15
|
-
export declare function getApexPdlFactory(luvio: Luvio): ({ invokerParams, config }: GetApexConfig, requestContext?: AdapterRequestContext) => import("@luvio/engine").Snapshot<any> | Promise<import("@luvio/engine").Snapshot<any>> | null;
|
|
16
|
-
type GetApexContext = Record<string, unknown>;
|
|
17
|
-
export declare const GET_APEX_ADAPTER_NAME = "getApex";
|
|
18
|
-
export declare class GetApexRequestStrategy extends LuvioAdapterRequestStrategy<GetApexConfig, GetApexRequest, GetApexContext> {
|
|
19
|
-
adapterName: string;
|
|
20
|
-
adapterFactory: typeof getApexPdlFactory;
|
|
21
|
-
buildConcreteRequest(similarRequest: GetApexRequest): GetApexRequest;
|
|
22
|
-
protected createAdapterContext(_options: LexRequestOptions): {
|
|
23
|
-
sourceContext: {
|
|
24
|
-
actionConfig: undefined;
|
|
25
|
-
tagName: string;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
getRequestPriority(_request: GetApexRequest, _context: GetApexContext): RequestPriority;
|
|
29
|
-
}
|
|
30
|
-
export {};
|