@salesforce/lds-network-aura 0.1.0-dev1

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 (32) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/ldsNetwork.js +5789 -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 +13 -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 +136 -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 +13 -0
  19. package/dist/types/middlewares/tableau-embedding.d.ts +1 -0
  20. package/dist/types/middlewares/uiapi-actions.d.ts +1 -0
  21. package/dist/types/middlewares/uiapi-apps.d.ts +1 -0
  22. package/dist/types/middlewares/uiapi-base.d.ts +3 -0
  23. package/dist/types/middlewares/uiapi-lists.d.ts +1 -0
  24. package/dist/types/middlewares/uiapi-lookup.d.ts +1 -0
  25. package/dist/types/middlewares/uiapi-mrulists.d.ts +1 -0
  26. package/dist/types/middlewares/uiapi-records.d.ts +13 -0
  27. package/dist/types/middlewares/uiapi-relatedlist.d.ts +2 -0
  28. package/dist/types/middlewares/uiapi-search.d.ts +1 -0
  29. package/dist/types/middlewares/utils.d.ts +103 -0
  30. package/dist/types/router.d.ts +17 -0
  31. package/dist/types/utils/language.d.ts +19 -0
  32. package/package.json +50 -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, 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,13 @@
1
+ import type { ResourceRequest } from '@luvio/engine';
2
+ import './middlewares';
3
+ export declare function getTransactionKey(resourceRequest: ResourceRequest): string;
4
+ declare const _default: import("@luvio/engine").NetworkAdapter;
5
+ export default _default;
6
+ export { instrument, AuraNetworkInstrumentation } from './instrumentation';
7
+ export { instrument as ldsNetworkAdapterInstrument } from '@salesforce/lds-network-adapter';
8
+ export { CrudEventState, CrudEventType, forceRecordTransactionsDisabled, type RecordInstrumentationCallbacks, type RelatedListInstrumentationCallbacks, } from './middlewares/event-logging';
9
+ export { createOkResponse, dispatchAction as dispatchAuraAction, defaultActionConfig, shouldForceRefresh, } from './middlewares/utils';
10
+ export type { DispatchActionConfig, ConnectInJavaError, InstrumentationCallbacks, InstrumentationRejectConfig, InstrumentationResolveConfig, } from './middlewares/utils';
11
+ export type { AuraFetchResponse } from './AuraFetchResponse';
12
+ export { UIAPI_RELATED_LIST_RECORDS_BATCH_PATH, UIAPI_RELATED_LIST_RECORDS_PATH, } from './middlewares/uiapi-relatedlist';
13
+ export { objectInfoStorage, objectInfoStorageStatsLogger, layoutStorage, layoutStorageStatsLogger, layoutUserStateStorage, layoutUserStateStorageStatsLogger, UIAPI_GET_LAYOUT, UIAPI_GET_LAYOUT_USER_STATE, UIAPI_OBJECT_INFO_PATH, UIAPI_OBJECT_INFO_BATCH_PATH, UIAPI_RECORDS_PATH, } from './middlewares/uiapi-records';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export declare const LWR_APEX_BASE_URI = "/lwr/apex/v66.0";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,136 @@
1
+ export declare const BASE_URI = "/services/data/v66.0";
2
+ export declare const CONNECT_BASE_URI: string;
3
+ export declare const ASSET_MANAGEMENT_BASE_URI: string;
4
+ export declare const COMMERCE_BASE_URI: string;
5
+ export declare const COMMERCE_CONFIGURATION_BASE_URI: string;
6
+ export declare const COMMERCE_CHANNEL_MANAGEMENT_BASE_URI: string;
7
+ export declare const COMMERCE_EXTENSION_BASE_URI: string;
8
+ export declare const COMMERCE_META_CONFIGURATION_BASE_URI: string;
9
+ export declare const COMMERCE_ESF_BASE_URI: string;
10
+ export declare const GUIDANCE_BASE_URI: string;
11
+ export declare const WAVE_BASE_URI: string;
12
+ export declare const SMART_DATA_DISCOVERY_BASE_URI: string;
13
+ export declare const CMS_BASE_URI: string;
14
+ export declare const CMS_NON_CONNECT_BASE_URI: string;
15
+ export declare const SCALECENTER_BASE_URI: string;
16
+ export declare const BILLING_BASE_URI: string;
17
+ export declare const ARTICLE_FEEDBACK_BASE_URI: string;
18
+ export declare const FILEBASED_DATAIMPORT_BASE_URI: string;
19
+ export declare const INTERACTION_BASE_URI: string;
20
+ export declare const EXPLAINABILITY_BASE_URI: string;
21
+ export declare const SITES_BASE_URI: string;
22
+ export declare const CIB_BASE_URI: string;
23
+ export declare const RCG_TENANTMANAGEMENT_BASE_URI: string;
24
+ export declare const IDENTITY_VERIFICATION_BASE_URI: string;
25
+ export declare const PSS_SOCIAL_CARE_BASE_URI: string;
26
+ export declare const CLM_BASE_URI: string;
27
+ export declare const LEARNING_CONTENT_PLATFORM_BASE_URI: string;
28
+ export declare const ASSETCREATION_BASE_URI: string;
29
+ export declare const HEALTH_CLOUD_BASE_URI: string;
30
+ export declare const SALES_ENABLEMENT_BASE_URI: string;
31
+ export declare const NAMED_CREDENTIAL_BASE_URI: string;
32
+ export declare const EXTERNAL_CONNECTIVITY_BASE_URI: string;
33
+ export declare const EXTERNAL_SERVICES_BASE_URI: string;
34
+ export declare const E_SIGN_BASE_URI: string;
35
+ export declare const CLAUSE_LIBRARY_BASE_URI: string;
36
+ export declare const OMNI_ANALYTICS_BASE_URI: string;
37
+ export declare const SERVICE_EXCELLENCE_BASE_URI: string;
38
+ export declare const SERVICE_AUTOMATION_BASE_URI: string;
39
+ export declare const EPC_BASE_URI: string;
40
+ export declare const ERI_BASE_URI: string;
41
+ export declare const EXPERIENCE_MODEL_BASE_URI: string;
42
+ export declare const LIGHTNING_MODEL_BASE_URI: string;
43
+ export declare const TABLEAU_EMBEDDING_BASE_URI: string;
44
+ export declare const PEOPLE_API_BASE_URI: string;
45
+ export declare const SALES_EXCELLENCE_BASE_URI: string;
46
+ export declare const ENABLEMENT_BASE_URI: string;
47
+ export declare const EXTERNAL_DOC_BASE_URI: string;
48
+ export declare const INSURANCE_BASE_URI: string;
49
+ export declare const EXTERNAL_DOC_USERS_BASE_URI: string;
50
+ export declare const I18N_BASE_URI: string;
51
+ export declare const GROUP_BASE_URI: string;
52
+ export declare const SCHEDULER_BASE_URI: string;
53
+ export declare const DATA_PROVIDER_BASE_URI: string;
54
+ export declare const FORMULA_BASE_URI: string;
55
+ export declare const DEV_WORKSPACE_BASE_URI: string;
56
+ export declare const EDUCATION_BASE_URI: string;
57
+ export declare const CPQ_BASE_URI: string;
58
+ export declare const LIGHTNING_CARDS_BASE_URI: string;
59
+ export declare const FUNDRAISING_BASE_URI: string;
60
+ export declare const CDP_BASE_URI: string;
61
+ export declare const CDP_SALES_EXCELLENCE_BASE_URI: string;
62
+ export declare const CDP_MACHINE_LEARNING_BASE_URI: string;
63
+ export declare const CDP_DATA_TRANSFORM_EXPERIENCE_BASE_URI: string;
64
+ export declare const CDP_COMMUNICATION_CAPPING_BASE_URI: string;
65
+ export declare const CDP_BYOC_BASE_URI: string;
66
+ export declare const CDP_DOCUMENT_PROCESSING: string;
67
+ export declare const DOCGEN_BASE_URI: string;
68
+ export declare const MATERIALITY_ASSESSMENT_BASE_URI: string;
69
+ export declare const INDUSTRIES_BASE_URI: string;
70
+ export declare const MEDIA_ADSALES_BASE_URI: string;
71
+ export declare const EINSTEIN_BASE_URI: string;
72
+ export declare const ECI_CONVERSATION_BASE_URI: string;
73
+ export declare const COMMERCE_STORE_MANAGEMENT_BASE_URI: string;
74
+ export declare const COMMERCE_CUSTOM_DOMAIN_BASE_URI: string;
75
+ export declare const STAGE_MANAGEMENT_BASE_URI: string;
76
+ export declare const SERVICE_CATALOG_CATEGORIES_BASE_URI: string;
77
+ export declare const SERVICE_SLACK_BASE_URI: string;
78
+ export declare const REMINDER_BASE_URI: string;
79
+ export declare const PATHASSISTANT_BASE_URI: string;
80
+ export declare const AI4M_EINSTEIN_BASE_URI: string;
81
+ export declare const DECISIONTABLE_BASE_URI: string;
82
+ export declare const CONTENT_TAXONOMY_BASE_URI: string;
83
+ export declare const ENERGY_UTILITIES_PROGRAMS_BASE_URI: string;
84
+ export declare const COMMERCE_GOALS_RECS_BUSINESS_OBJECTIVES_URI: string;
85
+ export declare const COMMERCE_CATALOG_MANAGEMENT_BASE_URI: string;
86
+ export declare const COMMERCE_CATALOG_MANAGEMENT_URI: string;
87
+ export declare const DPE_BASE_URI: string;
88
+ export declare const PROGRAM_MGMT_BASE_URI: string;
89
+ export declare const SHARING_BASE_URI: string;
90
+ export declare const MFG_PRODUCT_SERVICE_CAMPAIGN_BASE_URI: string;
91
+ export declare const OMNI_DESIGNER_BASE_URI: string;
92
+ export declare const OMNI_GLOBAL_BASE_URI: string;
93
+ export declare const SALESFORCE_JOURNEY_BASE_URI: string;
94
+ export declare const PERSONALIZATION_SERVICE_BASE_URI: string;
95
+ export declare const INDUSTRIES_DFO_BASE_URI: string;
96
+ export declare const RECORD_AGGREGATION_BASE_URI: string;
97
+ export declare const EVF_SDK_BASE_URI: string;
98
+ export declare const CONTEXT_RULES_BASE_URI: string;
99
+ export declare const SEMANTIC_ENGINE_BASE_URI: string;
100
+ export declare const SEMANTIC_AUTHORING_BASE_URI: string;
101
+ export declare const PAYMENTS_BASE_URI: string;
102
+ export declare const GDF_BASE_URI: string;
103
+ export declare const GDF_DISCOVERY_FRAMEWORK_BASE_URI: string;
104
+ export declare const SERVICE_PLAN_BASE_URI: string;
105
+ export declare const MILESTONES_BASE_URI: string;
106
+ export declare const CONTENT_LINK_BASE_URI: string;
107
+ export declare const LEARNING_ITEM_BASE_URI: string;
108
+ export declare const AI_AUTOFILL_BASE_URI: string;
109
+ export declare const APP_FRAMEWORK_BASE_URI: string;
110
+ export declare const REVENUE_MANAGEMENT_URI: string;
111
+ export declare const APPEXCHANGE_BASE_URI: string;
112
+ export declare const SALES_EINSTEIN_COACH_BASE_URI: string;
113
+ export declare const BASE_SETUP_BASE_URI: string;
114
+ export declare const SALES_YUKON_BASE_URI: string;
115
+ export declare const MFG_INVENTORY_COUNT_SCHEDULES_BASE_URI: string;
116
+ export declare const UNIFIED_ANALYTICS_BASE_URI: string;
117
+ export declare const CONTENT_AUTHORING_BASE_URI: string;
118
+ export declare const ARC_GRAPH_BASE_URI: string;
119
+ export declare const INDUSTRIES_GUARDRAIL_FRAMEWORK_BASE_URI: string;
120
+ export declare const PLATFORM_LIGHTNING_TYPES_BASE_URI: string;
121
+ export declare const INVOICING_BASE_URI: string;
122
+ export declare const SLACK_BRIDGE_BASE_URI: string;
123
+ export declare const EXPLORER_VIEW_BASE_URI: string;
124
+ export declare const INDUSTRIES_DFO_BASE_DECOMP_VIEWER_URI: string;
125
+ export declare const SERVICE_ITSM_CONNECT_BASE_URI: string;
126
+ export declare const SERVICE_ITSM_RISK_QST_RESPONSE_URI: string;
127
+ export declare const CDP_DATA_CLEAN_ROOM_BASE_URI: string;
128
+ export declare const SALESFORCE_APPS_BASE_URI: string;
129
+ export declare const BUSINESS_UNITS_BASE_URI: string;
130
+ export declare const MOBILE_PUBLISHER_CONTAINER_BASE_URI: string;
131
+ export declare const INSURANCE_CLAIM_BASE_URI: string;
132
+ export declare const CLAIM_BASE_URI: string;
133
+ export declare const KNOWLEDGE_SUMMARY_BASE_URI: string;
134
+ export declare const GIE_API_BASE_URI: string;
135
+ export declare const MARKETING_CONFIGURATIONS_CONNECT_BASE_URI: string;
136
+ export declare const CONTENT_LINK_DATA_SYNC_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,13 @@
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';
13
+ import './tableau-embedding';
@@ -0,0 +1 @@
1
+ export {};
@@ -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,13 @@
1
+ /// <reference path="../../typings/aura-storage.d.ts" />
2
+ /// <reference path="../../typings/instrumentation.d.ts" />
3
+ export declare const UIAPI_GET_LAYOUT: string;
4
+ export declare const UIAPI_RECORDS_PATH: string;
5
+ export declare const UIAPI_GET_LAYOUT_USER_STATE = "/user-state";
6
+ export declare const UIAPI_OBJECT_INFO_PATH: string;
7
+ export declare const UIAPI_OBJECT_INFO_BATCH_PATH: string;
8
+ export declare const objectInfoStorage: import("aura-storage").AuraStorage | null;
9
+ export declare const objectInfoStorageStatsLogger: import("instrumentation/service").CacheStatsLogger;
10
+ export declare const layoutStorage: import("aura-storage").AuraStorage | null;
11
+ export declare const layoutStorageStatsLogger: import("instrumentation/service").CacheStatsLogger;
12
+ export declare const layoutUserStateStorage: import("aura-storage").AuraStorage | null;
13
+ export declare const layoutUserStateStorageStatsLogger: import("instrumentation/service").CacheStatsLogger;
@@ -0,0 +1,2 @@
1
+ export declare const UIAPI_RELATED_LIST_RECORDS_PATH: string;
2
+ export declare const UIAPI_RELATED_LIST_RECORDS_BATCH_PATH: string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,103 @@
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, ResourceRequestContext } from '@luvio/engine';
5
+ import { AuraFetchResponse } from '../AuraFetchResponse';
6
+ import type { HttpVerb } from '../router';
7
+ export type ControllerInvoker = (resourceRequest: ResourceRequest, resourceRequestContext: ResourceRequestContext, 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
+ export 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
+ export interface Adapter {
49
+ method: HttpVerb;
50
+ predicate: (path: string) => boolean;
51
+ transport: AuraAction;
52
+ bodyParamName?: string;
53
+ }
54
+ export type ApiFamily = Array<Adapter>;
55
+ interface InstrumentationConfig {
56
+ params: UiApiParams;
57
+ }
58
+ export interface InstrumentationResolveConfig extends InstrumentationConfig {
59
+ body: UiApiBody;
60
+ }
61
+ export interface InstrumentationRejectConfig extends InstrumentationConfig {
62
+ err?: UiApiError | ConnectInJavaError;
63
+ }
64
+ export declare const defaultActionConfig: ActionConfig;
65
+ export type InstrumentationResolveCallback = (config: InstrumentationResolveConfig) => void;
66
+ export type InstrumentationRejectCallback = (config: InstrumentationRejectConfig) => void;
67
+ export interface InstrumentationCallbacks {
68
+ rejectFn?: InstrumentationRejectCallback;
69
+ resolveFn?: InstrumentationResolveCallback;
70
+ }
71
+ export declare function createOkResponse(body: unknown): AuraFetchResponse<unknown>;
72
+ /** Invoke an Aura controller with the pass parameters. */
73
+ export declare function dispatchAction(endpoint: string, params: UiApiParams, config?: DispatchActionConfig, instrumentationCallbacks?: InstrumentationCallbacks): Promise<AuraFetchResponse<unknown>>;
74
+ /**
75
+ * All the methods exposed out of the UiApiController accept a clientOption config. This method
76
+ * adds methods returns a new params object with the client option if necessary, otherwise it
77
+ * returns the passed params object.
78
+ */
79
+ export declare function buildUiApiParams(params: UiApiParams, resourceRequest: ResourceRequest): UiApiParams;
80
+ /**
81
+ * The connect generation code appends a "Param" suffix to certain parameter names when
82
+ * generating Aura controllers. This function accepts a set of UiApiParams and returns
83
+ * an equivalent UiApiParams suitable for passing to an Aura controller.
84
+ */
85
+ export declare function fixParamsForAuraController(params: UiApiParams): UiApiParams;
86
+ /** Returns true if an action should ignore the network cache data. */
87
+ export declare function shouldForceRefresh(resourceRequest: ResourceRequest): boolean;
88
+ export declare function registerApiFamilyRoutes(apiFamily: ApiFamily): void;
89
+ /**
90
+ * Enriches a dispatch action config with additional context.
91
+ *
92
+ * This function takes an existing object and augments it with additional context
93
+ * provided by the second object. The resulting enriched object contains both the
94
+ * original data from the existing object and the extra context from the
95
+ * additional object.
96
+ *
97
+ * @param {ResourceRequestContext} context - The object containing additional context
98
+ * to be added to the existing object.
99
+ * @param {DispatchActionConfig} config - The existing object to be enriched.
100
+ * @returns {DispatchActionConfig} The enriched object with combined data and context.
101
+ */
102
+ export declare function enrichWithSourceContext(context: ResourceRequestContext, config?: DispatchActionConfig): DispatchActionConfig;
103
+ 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,50 @@
1
+ {
2
+ "name": "@salesforce/lds-network-aura",
3
+ "version": "0.1.0-dev1",
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
+ "types": "./dist/types/main.d.ts",
15
+ "import": "./dist/ldsNetwork.js",
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 --bundleConfigAsCjs --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.158.7"
38
+ },
39
+ "devDependencies": {
40
+ "@salesforce/lds-adapters-uiapi": "^0.1.0-dev1",
41
+ "@salesforce/lds-aura-storage": "^0.1.0-dev1",
42
+ "@salesforce/lds-environment-settings": "^0.1.0-dev1",
43
+ "@salesforce/lds-instrumentation": "^0.1.0-dev1",
44
+ "@salesforce/lds-network-adapter": "^0.1.0-dev1"
45
+ },
46
+ "volta": {
47
+ "extends": "../../package.json"
48
+ },
49
+ "test:unit": "jest"
50
+ }