@salesforce/lds-worker-api 1.360.1 → 1.362.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/sfdc/es/ldsWorkerApi.js +110 -14
- package/dist/sfdc/es/types/customLuvioAdapter.d.ts +13 -0
- package/dist/sfdc/es/types/executeAdapter.d.ts +5 -2
- package/dist/sfdc/es/types/lightningAdapterApi.d.ts +6 -2
- package/dist/sfdc/es/types/main.d.ts +2 -1
- package/dist/standalone/es/lds-worker-api.js +3553 -3172
- package/dist/standalone/es/types/customLuvioAdapter.d.ts +13 -0
- package/dist/standalone/es/types/executeAdapter.d.ts +5 -2
- package/dist/standalone/es/types/lightningAdapterApi.d.ts +6 -2
- package/dist/standalone/es/types/main.d.ts +2 -1
- package/dist/standalone/umd/lds-worker-api.js +3553 -3171
- package/dist/standalone/umd/types/customLuvioAdapter.d.ts +13 -0
- package/dist/standalone/umd/types/executeAdapter.d.ts +5 -2
- package/dist/standalone/umd/types/lightningAdapterApi.d.ts +6 -2
- package/dist/standalone/umd/types/main.d.ts +2 -1
- package/package.json +12 -12
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Unsubscribe } from '@luvio/engine';
|
|
2
|
+
import { NativeAdapterRequestContext, type NativeCallbackValue, type NativeOnSnapshot } from './executeAdapter';
|
|
3
|
+
import { type ImperativeAdapterMapValue, type AdapterMapValue } from './lightningAdapterApi';
|
|
4
|
+
export declare function importLuvioAdapterModule(specifier: string): Promise<LuvioAdapterModule>;
|
|
5
|
+
declare class LuvioAdapterModule {
|
|
6
|
+
imperativeAdapterMap: Record<string, ImperativeAdapterMapValue>;
|
|
7
|
+
dmlAdapterMap: Record<string, AdapterMapValue>;
|
|
8
|
+
constructor(module: any);
|
|
9
|
+
invokeAdapter<Config>(adapterName: string, config: Config, nativeAdapterRequestContext?: NativeAdapterRequestContext): Promise<NativeCallbackValue>;
|
|
10
|
+
subscribeAdapter<Config>(adapterName: string, config: Config, nativeAdapterRequestContext: NativeAdapterRequestContext, callback: NativeOnSnapshot): Unsubscribe;
|
|
11
|
+
private invokeDmlAdapter;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AdapterRequestContext, CachePolicy, LuvioAdapterEventObserver } from '@luvio/engine';
|
|
2
|
+
import type { DataCallbackTuple } from '@salesforce/lds-bindings';
|
|
2
3
|
import type { DraftQueueItemMetadata } from '@salesforce/lds-drafts';
|
|
3
4
|
import type { NativeErrorResponse } from './responses';
|
|
4
5
|
import type { ObservabilityContext } from '@salesforce/lds-runtime-mobile';
|
|
@@ -21,12 +22,12 @@ export type NativeCallbackErrors = {
|
|
|
21
22
|
};
|
|
22
23
|
export type NativeOnSnapshot = (value: NativeCallbackValue) => void;
|
|
23
24
|
export type NativeOnResponse = (value: NativeCallbackValue) => void;
|
|
24
|
-
type Unsubscribe = () => void;
|
|
25
|
+
export type Unsubscribe = () => void;
|
|
25
26
|
type NativeCachePolicy = CachePolicy;
|
|
26
27
|
type NativeAdapterRequestPriority = 'high' | 'normal' | 'background';
|
|
27
28
|
type NativeObservabilityContext = ObservabilityContext;
|
|
28
29
|
type NativeLuvioEventObserver = LuvioAdapterEventObserver;
|
|
29
|
-
interface NativeAdapterRequestContext {
|
|
30
|
+
export interface NativeAdapterRequestContext {
|
|
30
31
|
cachePolicy?: NativeCachePolicy;
|
|
31
32
|
priority?: NativeAdapterRequestPriority;
|
|
32
33
|
observabilityContext?: NativeObservabilityContext;
|
|
@@ -38,6 +39,8 @@ interface NativeAdapterRequestContext {
|
|
|
38
39
|
* @returns Coerced luvio request context
|
|
39
40
|
*/
|
|
40
41
|
export declare function buildAdapterRequestContext(nativeRequestContext: NativeAdapterRequestContext | undefined): AdapterRequestContext | undefined;
|
|
42
|
+
export declare function buildInvalidConfigError(error: unknown): NativeCallbackError;
|
|
43
|
+
export declare function buildNativeCallbackValue(adapterCallbackValue: DataCallbackTuple<unknown>): NativeCallbackValue;
|
|
41
44
|
/**
|
|
42
45
|
* Executes the adapter with the given adapterId and config. Will call onSnapshot
|
|
43
46
|
* callback with data or error. Returns an unsubscribe function that should
|
|
@@ -3,8 +3,12 @@ import type { Adapter } from '@luvio/engine';
|
|
|
3
3
|
import * as gqlApi from 'force/ldsAdaptersGraphql';
|
|
4
4
|
export declare const IMPERATIVE_ADAPTER_SUFFIX = "_imperative";
|
|
5
5
|
export declare const UNSTABLE_ADAPTER_PREFIX = "unstable_";
|
|
6
|
-
type AdapterMapValue = Adapter<unknown, unknown> | ImperativeAdapter<unknown, unknown> | undefined;
|
|
7
|
-
type ImperativeAdapterMapValue = ImperativeAdapter<unknown, unknown> | undefined;
|
|
6
|
+
export type AdapterMapValue = Adapter<unknown, unknown> | ImperativeAdapter<unknown, unknown> | undefined;
|
|
7
|
+
export type ImperativeAdapterMapValue = ImperativeAdapter<unknown, unknown> | undefined;
|
|
8
|
+
export declare function buildAdapterMaps(map: Record<string, AdapterMapValue>): {
|
|
9
|
+
dmlAdapterMap: Record<string, AdapterMapValue>;
|
|
10
|
+
imperativeAdapterMap: Record<string, ImperativeAdapterMapValue>;
|
|
11
|
+
};
|
|
8
12
|
declare function getDMLAdapterFromName(name: string): AdapterMapValue;
|
|
9
13
|
declare function getImperativeAdapterFromName(name: string): ImperativeAdapterMapValue;
|
|
10
14
|
declare function getImperativeAdapterNames(): string[];
|
|
@@ -6,4 +6,5 @@ import { setUiApiRecordTTL, setMetadataTTL } from './ttl';
|
|
|
6
6
|
import { registerReportObserver } from '@salesforce/lds-runtime-mobile';
|
|
7
7
|
import { createPrimingSession } from './primingApi';
|
|
8
8
|
import { evictCacheRecordsByIds, evictExpiredCacheEntries, stopEviction } from './cachePurging';
|
|
9
|
-
|
|
9
|
+
import { importLuvioAdapterModule } from './customLuvioAdapter';
|
|
10
|
+
export { subscribeToAdapter, invokeAdapter, invokeAdapterWithMetadata, invokeAdapterWithDraftToReplace, invokeAdapterWithDraftToMerge, executeAdapter, executeMutatingAdapter, nimbusDraftQueue, draftQueue, draftManager, setUiApiRecordTTL, setMetadataTTL, registerReportObserver, getImperativeAdapterNames, createPrimingSession, evictCacheRecordsByIds, evictExpiredCacheEntries, stopEviction, importLuvioAdapterModule, };
|