@salesforce/lds-network-aura 0.131.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.
Files changed (31) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/ldsNetwork.js +2994 -0
  3. package/dist/types/AuraFetchResponse.d.ts +10 -0
  4. package/dist/types/__mocks__/@salesforce/lds-environment-settings.d.ts +2 -0
  5. package/dist/types/__mocks__/@salesforce/lds-instrumentation.d.ts +7 -0
  6. package/dist/types/__mocks__/aura-storage.d.ts +19 -0
  7. package/dist/types/__mocks__/aura.d.ts +3 -0
  8. package/dist/types/__mocks__/instrumentation/service.d.ts +33 -0
  9. package/dist/types/instrumentation.d.ts +30 -0
  10. package/dist/types/main.d.ts +6 -0
  11. package/dist/types/middlewares/analyticswaveprivate.d.ts +1 -0
  12. package/dist/types/middlewares/apex.d.ts +1 -0
  13. package/dist/types/middlewares/cdpadapters.d.ts +1 -0
  14. package/dist/types/middlewares/connect-base.d.ts +46 -0
  15. package/dist/types/middlewares/connect.d.ts +1 -0
  16. package/dist/types/middlewares/event-logging.d.ts +31 -0
  17. package/dist/types/middlewares/execute-aggregate-ui.d.ts +16 -0
  18. package/dist/types/middlewares/index.d.ts +12 -0
  19. package/dist/types/middlewares/uiapi-actions.d.ts +1 -0
  20. package/dist/types/middlewares/uiapi-apps.d.ts +1 -0
  21. package/dist/types/middlewares/uiapi-base.d.ts +3 -0
  22. package/dist/types/middlewares/uiapi-lists.d.ts +1 -0
  23. package/dist/types/middlewares/uiapi-lookup.d.ts +1 -0
  24. package/dist/types/middlewares/uiapi-mrulists.d.ts +1 -0
  25. package/dist/types/middlewares/uiapi-records.d.ts +1 -0
  26. package/dist/types/middlewares/uiapi-relatedlist.d.ts +1 -0
  27. package/dist/types/middlewares/uiapi-search.d.ts +1 -0
  28. package/dist/types/middlewares/utils.d.ts +86 -0
  29. package/dist/types/router.d.ts +17 -0
  30. package/dist/types/utils/language.d.ts +19 -0
  31. package/package.json +46 -0
@@ -0,0 +1,10 @@
1
+ import type { FetchResponse, Headers } from '@luvio/engine';
2
+ import { HttpStatusCode } from '@luvio/engine';
3
+ export declare class AuraFetchResponse<T> implements FetchResponse<T> {
4
+ readonly status: HttpStatusCode;
5
+ readonly body: T;
6
+ readonly headers: Headers;
7
+ readonly ok: boolean;
8
+ readonly statusText: string;
9
+ constructor(status: HttpStatusCode, body: T, headers?: Headers);
10
+ }
@@ -0,0 +1,2 @@
1
+ export declare function getEnvironmentSetting(): void;
2
+ export declare const EnvironmentSettings: {};
@@ -0,0 +1,7 @@
1
+ export declare const instrumentation: {
2
+ instrumentAdapter: (adapter: any) => any;
3
+ };
4
+ export declare function registerLdsCacheStats(): {
5
+ logHits(): void;
6
+ logMisses(): void;
7
+ };
@@ -0,0 +1,19 @@
1
+ declare class Storage {
2
+ _entries: {
3
+ [key: string]: any;
4
+ };
5
+ get(key: string): Promise<any>;
6
+ set(key: string, value: any): Promise<void>;
7
+ clear(): Promise<void>;
8
+ getSize(): Promise<number>;
9
+ isPersistent(): boolean;
10
+ }
11
+ declare const _default: {
12
+ initStorage({ name }: {
13
+ name: string;
14
+ }): Storage;
15
+ getStorage(name: string): Storage;
16
+ deleteStorage(name: string): void;
17
+ __reset(): Promise<void>;
18
+ };
19
+ export default _default;
@@ -0,0 +1,3 @@
1
+ /// <reference types="jest" />
2
+ declare const executeGlobalControllerRawResponse: jest.Mock<any, any>;
3
+ export { executeGlobalControllerRawResponse };
@@ -0,0 +1,33 @@
1
+ export declare function counter(): {
2
+ increment(): void;
3
+ decrement(): void;
4
+ getValue(): void;
5
+ reset(): void;
6
+ };
7
+ export declare function gauge(): {
8
+ setValue(): void;
9
+ getValue(): void;
10
+ reset(): void;
11
+ };
12
+ export declare function mark(): void;
13
+ export declare function markStart(): void;
14
+ export declare function markEnd(): void;
15
+ export declare function perfStart(): void;
16
+ export declare function perfEnd(): void;
17
+ export declare function percentileHistogram(): {
18
+ update(): void;
19
+ getValue(): void;
20
+ reset(): void;
21
+ };
22
+ export declare function time(): void;
23
+ export declare function timer(): {
24
+ addDuration(): void;
25
+ getValue(): void;
26
+ time(): void;
27
+ };
28
+ export declare function registerCacheStats(): {
29
+ logHits(): void;
30
+ logMisses(): void;
31
+ };
32
+ export declare function registerPlugin(): void;
33
+ export declare function registerPeriodicLogger(): void;
@@ -0,0 +1,30 @@
1
+ import type { FetchResponse } from '@luvio/engine';
2
+ /**
3
+ * Instrumentation hooks exposed by this module.
4
+ */
5
+ export interface AuraNetworkInstrumentation {
6
+ /**
7
+ * Called after completion of a CRUD event.
8
+ * Used for Event Monitoring.
9
+ */
10
+ logCrud(operation: string, options: object): void;
11
+ /**
12
+ * Called at the start of a network request
13
+ */
14
+ networkRequest(): void;
15
+ /**
16
+ * Called with the response from the network
17
+ * @param cb callback to retrieve the FetchResponse
18
+ */
19
+ networkResponse(cb: () => FetchResponse<unknown>): void;
20
+ }
21
+ export declare const instrumentation: AuraNetworkInstrumentation;
22
+ /**
23
+ * Allows external modules (typically a runtime environment) to set
24
+ * instrumentation hooks for this module. Note that the hooks are
25
+ * incremental - hooks not suppiled in newInstrumentation will retain
26
+ * their previous values. The default instrumentation hooks are no-ops.
27
+ *
28
+ * @param newInstrumentation instrumentation hooks to be overridden
29
+ */
30
+ export declare function instrument(newInstrumentation: Partial<AuraNetworkInstrumentation>): void;
@@ -0,0 +1,6 @@
1
+ import './middlewares';
2
+ declare const _default: import("@luvio/engine").NetworkAdapter;
3
+ export default _default;
4
+ export { instrument, AuraNetworkInstrumentation } from './instrumentation';
5
+ export { instrument as ldsNetworkAdapterInstrument } from '@salesforce/lds-network-adapter';
6
+ export { forceRecordTransactionsDisabled } from './middlewares/event-logging';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export declare const LWR_APEX_BASE_URI = "/lwr/apex/v58.0";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,46 @@
1
+ export declare const BASE_URI = "/services/data/v58.0";
2
+ export declare const CONNECT_BASE_URI: string;
3
+ export declare const COMMERCE_BASE_URI: string;
4
+ export declare const COMMERCE_EXTENSION_BASE_URI: string;
5
+ export declare const GUIDANCE_BASE_URI: string;
6
+ export declare const WAVE_BASE_URI: string;
7
+ export declare const SMART_DATA_DISCOVERY_BASE_URI: string;
8
+ export declare const CMS_BASE_URI: string;
9
+ export declare const CMS_NON_CONNECT_BASE_URI: string;
10
+ export declare const SCALECENTER_BASE_URI: string;
11
+ export declare const BILLING_BASE_URI: string;
12
+ export declare const INTERACTION_BASE_URI: string;
13
+ export declare const EXPLAINABILITY_BASE_URI: string;
14
+ export declare const SITES_BASE_URI: string;
15
+ export declare const CIB_BASE_URI: string;
16
+ export declare const RCG_TENANTMANAGEMENT_BASE_URI: string;
17
+ export declare const IDENTITY_VERIFICATION_BASE_URI: string;
18
+ export declare const PSS_SOCIAL_CARE_BASE_URI: string;
19
+ export declare const CLM_BASE_URI: string;
20
+ export declare const LEARNING_CONTENT_PLATFORM_BASE_URI: string;
21
+ export declare const ASSETCREATION_BASE_URI: string;
22
+ export declare const HEALTH_CLOUD_BASE_URI: string;
23
+ export declare const SALES_ENABLEMENT_BASE_URI: string;
24
+ export declare const NAMED_CREDENTIAL_BASE_URI: string;
25
+ export declare const EXTERNAL_SERVICES_BASE_URI: string;
26
+ export declare const E_SIGN_BASE_URI: string;
27
+ export declare const CLAUSE_LIBRARY_BASE_URI: string;
28
+ export declare const SERVICE_EXCELLENCE_BASE_URI: string;
29
+ export declare const EPC_BASE_URI: string;
30
+ export declare const ERI_BASE_URI: string;
31
+ export declare const EXPERIENCE_MODEL_BASE_URI: string;
32
+ export declare const TABLEAU_EMBEDDING_BASE_URI: string;
33
+ export declare const SERVICE_AUTOMATION_SERVIRCE_CATALOG_BASE_URI: string;
34
+ export declare const PEOPLE_API_BASE_URI: string;
35
+ export declare const SALES_EXCELLENCE_BASE_URI: string;
36
+ export declare const ENABLEMENT_BASE_URI: string;
37
+ export declare const EXTERNAL_DOC_BASE_URI: string;
38
+ export declare const I18N_BASE_URI: string;
39
+ export declare const GROUP_BASE_URI: string;
40
+ export declare const SCHEDULER_BASE_URI: string;
41
+ export declare const DATA_PROVIDER_BASE_URI: string;
42
+ export declare const EDUCATION_BASE_URI: string;
43
+ export declare const CPQ_BASE_URI: string;
44
+ export declare const LIGHTNING_CARDS_BASE_URI: string;
45
+ export declare const FUNDRAISING_BASE_URI: string;
46
+ export declare const CDP_BASE_URI: string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,31 @@
1
+ import type { InstrumentationRejectCallback, InstrumentationResolveCallback } from './utils';
2
+ export declare enum CrudEventType {
3
+ CREATE = "create",
4
+ DELETE = "delete",
5
+ READ = "read",
6
+ READS = "reads",
7
+ UPDATE = "update"
8
+ }
9
+ export declare enum CrudEventState {
10
+ ERROR = "ERROR",
11
+ SUCCESS = "SUCCESS"
12
+ }
13
+ export declare const forceRecordTransactionsDisabled: boolean | undefined;
14
+ export interface RecordInstrumentationCallbacks {
15
+ createRecordRejectFunction: InstrumentationRejectCallback;
16
+ createRecordResolveFunction: InstrumentationResolveCallback;
17
+ deleteRecordRejectFunction: InstrumentationRejectCallback;
18
+ deleteRecordResolveFunction: InstrumentationResolveCallback;
19
+ getRecordAggregateRejectFunction: InstrumentationRejectCallback;
20
+ getRecordAggregateResolveFunction: InstrumentationResolveCallback;
21
+ getRecordRejectFunction: InstrumentationRejectCallback;
22
+ getRecordResolveFunction: InstrumentationResolveCallback;
23
+ updateRecordRejectFunction: InstrumentationRejectCallback;
24
+ updateRecordResolveFunction: InstrumentationResolveCallback;
25
+ }
26
+ export interface RelatedListInstrumentationCallbacks {
27
+ getRelatedListRecordsRejectFunction: InstrumentationRejectCallback;
28
+ getRelatedListRecordsResolveFunction: InstrumentationResolveCallback;
29
+ getRelatedListRecordsBatchRejectFunction: InstrumentationRejectCallback;
30
+ getRelatedListRecordsBatchResolveFunction: InstrumentationResolveCallback;
31
+ }
@@ -0,0 +1,16 @@
1
+ import type { DispatchActionConfig } from './utils';
2
+ import { AuraFetchResponse } from '../AuraFetchResponse';
3
+ interface AggregateUiParams {
4
+ input: {
5
+ compositeRequest: CompositeRequest[];
6
+ };
7
+ }
8
+ export interface CompositeRequest {
9
+ url: string;
10
+ referenceId: string;
11
+ }
12
+ /** Invoke executeAggregateUi Aura controller. This is only to be used with large getRecord requests that
13
+ * would otherwise cause a query length exception.
14
+ */
15
+ export declare function dispatchSplitRecordAggregateUiAction(endpoint: string, params: AggregateUiParams, config?: DispatchActionConfig): Promise<AuraFetchResponse<unknown>>;
16
+ export {};
@@ -0,0 +1,12 @@
1
+ import './analyticswaveprivate';
2
+ import './cdpadapters';
3
+ import './apex';
4
+ import './connect';
5
+ import './uiapi-records';
6
+ import './uiapi-actions';
7
+ import './uiapi-lists';
8
+ import './uiapi-lookup';
9
+ import './uiapi-mrulists';
10
+ import './uiapi-relatedlist';
11
+ import './uiapi-search';
12
+ import './uiapi-apps';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { DispatchActionConfig } from './utils';
2
+ export declare const UI_API_BASE_URI: string;
3
+ export declare const actionConfig: DispatchActionConfig;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,86 @@
1
+ import type { ActionConfig } from 'aura';
2
+ import type { AuraStorage } from 'aura-storage';
3
+ import type { CacheStatsLogger } from 'instrumentation/service';
4
+ import type { FetchResponse, ResourceRequest } from '@luvio/engine';
5
+ import { AuraFetchResponse } from '../AuraFetchResponse';
6
+ import type { HttpVerb } from '../router';
7
+ export type ControllerInvoker = (resourceRequest: ResourceRequest, resourceKey: string) => Promise<FetchResponse<any>>;
8
+ interface CacheConfig {
9
+ storage: AuraStorage;
10
+ key: string;
11
+ statsLogger: CacheStatsLogger;
12
+ forceRefresh?: boolean;
13
+ }
14
+ export declare function registerLdsCacheStats(name: string): CacheStatsLogger;
15
+ export interface DispatchActionConfig {
16
+ action?: ActionConfig;
17
+ cache?: CacheConfig;
18
+ }
19
+ interface UiApiClientOptions {
20
+ ifModifiedSince?: string;
21
+ ifUnmodifiedSince?: string;
22
+ }
23
+ export interface UiApiParams {
24
+ [name: string]: any;
25
+ clientOptions?: UiApiClientOptions;
26
+ }
27
+ interface UiApiBody {
28
+ [name: string]: any;
29
+ }
30
+ interface UiApiError {
31
+ errorCode: number;
32
+ message: string;
33
+ }
34
+ interface ConnectInJavaError {
35
+ data: {
36
+ errorCode: string;
37
+ message: string;
38
+ statusCode: number;
39
+ };
40
+ id: string;
41
+ message: string;
42
+ stackTrace: string;
43
+ }
44
+ interface AuraAction {
45
+ controller: string;
46
+ action?: ActionConfig;
47
+ }
48
+ interface Adapter {
49
+ method: HttpVerb;
50
+ predicate: (path: string) => boolean;
51
+ transport: AuraAction;
52
+ }
53
+ export type ApiFamily = Array<Adapter>;
54
+ interface InstrumentationConfig {
55
+ params: UiApiParams;
56
+ }
57
+ export interface InstrumentationResolveConfig extends InstrumentationConfig {
58
+ body: UiApiBody;
59
+ }
60
+ export interface InstrumentationRejectConfig extends InstrumentationConfig {
61
+ err?: UiApiError | ConnectInJavaError;
62
+ }
63
+ export type InstrumentationResolveCallback = (config: InstrumentationResolveConfig) => void;
64
+ export type InstrumentationRejectCallback = (config: InstrumentationRejectConfig) => void;
65
+ export interface InstrumentationCallbacks {
66
+ rejectFn?: InstrumentationRejectCallback;
67
+ resolveFn?: InstrumentationResolveCallback;
68
+ }
69
+ /** Invoke an Aura controller with the pass parameters. */
70
+ export declare function dispatchAction(endpoint: string, params: UiApiParams, config?: DispatchActionConfig, instrumentationCallbacks?: InstrumentationCallbacks): Promise<AuraFetchResponse<unknown>>;
71
+ /**
72
+ * All the methods exposed out of the UiApiController accept a clientOption config. This method
73
+ * adds methods returns a new params object with the client option if necessary, otherwise it
74
+ * returns the passed params object.
75
+ */
76
+ export declare function buildUiApiParams(params: UiApiParams, resourceRequest: ResourceRequest): UiApiParams;
77
+ /**
78
+ * The connect generation code appends a "Param" suffix to certain parameter names when
79
+ * generating Aura controllers. This function accepts a set of UiApiParams and returns
80
+ * an equivalent UiApiParams suitable for passing to an Aura controller.
81
+ */
82
+ export declare function fixParamsForAuraController(params: UiApiParams): UiApiParams;
83
+ /** Returns true if an action should ignore the network cache data. */
84
+ export declare function shouldForceRefresh(resourceRequest: ResourceRequest): boolean;
85
+ export declare function registerApiFamilyRoutes(apiFamily: ApiFamily): void;
86
+ export {};
@@ -0,0 +1,17 @@
1
+ import type { ResourceRequest } from '@luvio/engine';
2
+ import type { ControllerInvoker } from './middlewares/utils';
3
+ type RoutePredicate = (path: string) => boolean;
4
+ export interface Route {
5
+ predicate: RoutePredicate;
6
+ handler: ControllerInvoker;
7
+ }
8
+ export type HttpVerb = 'delete' | 'get' | 'patch' | 'post' | 'put';
9
+ type HttpVerbMethod = {
10
+ [key in HttpVerb]: (predicate: RoutePredicate, handler: ControllerInvoker) => void;
11
+ };
12
+ interface Router {
13
+ methods: Record<string, Route[]>;
14
+ lookup: (resourceRequest: ResourceRequest) => ControllerInvoker | null;
15
+ }
16
+ declare const router: Router & HttpVerbMethod;
17
+ export default router;
@@ -0,0 +1,19 @@
1
+ declare const push: (...items: any[]) => number, join: (separator?: string | undefined) => string;
2
+ declare const isArray: (arg: any) => arg is any[];
3
+ declare const create: {
4
+ (o: object | null): any;
5
+ (o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
6
+ }, entries: {
7
+ <T>(o: {
8
+ [s: string]: T;
9
+ } | ArrayLike<T>): [string, T][];
10
+ (o: {}): [string, any][];
11
+ }, keys: {
12
+ (o: object): string[];
13
+ (o: {}): string[];
14
+ };
15
+ declare const parse: (text: string, reviver?: ((this: any, key: string, value: any) => any) | undefined) => any, stringify: {
16
+ (value: any, replacer?: ((this: any, key: string, value: any) => any) | undefined, space?: string | number | undefined): string;
17
+ (value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string;
18
+ };
19
+ export { push as ArrayPrototypePush, join as ArrayPrototypeJoin, isArray as ArrayIsArray, create as ObjectCreate, entries as ObjectEntries, keys as ObjectKeys, parse as JSONParse, stringify as JSONStringify, };
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@salesforce/lds-network-aura",
3
+ "version": "0.131.0",
4
+ "license": "SEE LICENSE IN LICENSE.txt",
5
+ "description": "LDS Network Adapter for Aura Runtime",
6
+ "main": "dist/ldsNetwork.js",
7
+ "module": "dist/ldsNetwork.js",
8
+ "types": "dist/types/main.d.ts",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/ldsNetwork.js",
15
+ "types": "./dist/types/main.d.ts",
16
+ "default": "./dist/ldsNetwork.js"
17
+ }
18
+ },
19
+ "sfdc": {
20
+ "path": "forcelds/ldsNetwork/",
21
+ "publishedFileName": "ldsNetwork.js",
22
+ "overrides": {
23
+ "artifactDirectory": "dist",
24
+ "outputModuleName": "ldsNetwork"
25
+ }
26
+ },
27
+ "scripts": {
28
+ "prepare": "yarn build",
29
+ "build": "rollup --config rollup.config.js",
30
+ "clean": "rm -rf dist",
31
+ "test:perf": "best",
32
+ "test:unit": "jest",
33
+ "test:debug": "node --inspect-brk ../../node_modules/.bin/jest --runInBand",
34
+ "release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-network-aura"
35
+ },
36
+ "dependencies": {
37
+ "@luvio/engine": "0.138.8-244.1"
38
+ },
39
+ "devDependencies": {
40
+ "@salesforce/lds-adapters-uiapi": "1.131.0-244.6",
41
+ "@salesforce/lds-aura-storage": "1.131.0-244.6",
42
+ "@salesforce/lds-environment-settings": "1.131.0-244.6",
43
+ "@salesforce/lds-instrumentation": "1.131.0-244.6",
44
+ "@salesforce/lds-network-adapter": "1.131.0-244.6"
45
+ }
46
+ }