@iblai/data-layer 1.7.2 → 1.7.4
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/index.d.ts +1183 -1183
- package/dist/index.esm.js +32 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +32 -11
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/features/__tests__/utils.test.d.ts +1 -0
- package/dist/src/features/utils.d.ts +21 -18
- package/package.json +1 -1
package/dist/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -15,30 +15,39 @@ export declare const getServiceUrl: (service: SERVICES) => string;
|
|
|
15
15
|
export declare const getHeaders: (service: SERVICES) => Promise<{
|
|
16
16
|
Authorization: string;
|
|
17
17
|
} | undefined>;
|
|
18
|
+
/**
|
|
19
|
+
* Options for the `buildEndpointFrom*Service` builders.
|
|
20
|
+
*
|
|
21
|
+
* - `maxRetries`: overrides the default retry count.
|
|
22
|
+
* - `expectedErrorStatuses`: statuses that are an EXPECTED empty state for this
|
|
23
|
+
* endpoint (e.g. a 404 for a resource that only exists after a POST). For
|
|
24
|
+
* these statuses we skip retries (fail fast) and log via `console.warn`
|
|
25
|
+
* instead of `console.error`, so they don't escalate to Sentry error alerts.
|
|
26
|
+
* The returned `{ error }` shape is unchanged. Defaults to `[]`, so existing
|
|
27
|
+
* endpoints behave exactly as before.
|
|
28
|
+
*/
|
|
29
|
+
type BuildEndpointOptions = {
|
|
30
|
+
maxRetries?: number;
|
|
31
|
+
expectedErrorStatuses?: number[];
|
|
32
|
+
};
|
|
18
33
|
/**
|
|
19
34
|
* Build a generic RTK Query endpoint from a service function.
|
|
20
35
|
* Includes built-in retry with exponential backoff (since RTK Query
|
|
21
36
|
* skips baseQuery retry for queryFn endpoints).
|
|
22
37
|
*/
|
|
23
|
-
export declare const buildEndpointFromService: <Args extends Record<string, unknown>, Result>(service: SERVICES, serviceFn: (args: Args) => Promise<Result>, options?: {
|
|
24
|
-
maxRetries?: number;
|
|
25
|
-
}) => {
|
|
38
|
+
export declare const buildEndpointFromService: <Args extends Record<string, unknown>, Result>(service: SERVICES, serviceFn: (args: Args) => Promise<Result>, options?: BuildEndpointOptions) => {
|
|
26
39
|
queryFn: BaseQueryFn<Args, Result, FetchBaseQueryError | CustomError>;
|
|
27
40
|
};
|
|
28
41
|
/**
|
|
29
42
|
* Shortcut for building an endpoint using the DM service.
|
|
30
43
|
*/
|
|
31
|
-
export declare const buildEndpointFromDmService: <Args extends Record<string, unknown>, Result>(serviceFn: (args: Args) => Promise<Result>, options?: {
|
|
32
|
-
maxRetries?: number;
|
|
33
|
-
}) => {
|
|
44
|
+
export declare const buildEndpointFromDmService: <Args extends Record<string, unknown>, Result>(serviceFn: (args: Args) => Promise<Result>, options?: BuildEndpointOptions) => {
|
|
34
45
|
queryFn: BaseQueryFn<Args, Result, FetchBaseQueryError | CustomError>;
|
|
35
46
|
};
|
|
36
47
|
/**
|
|
37
48
|
* Shortcut for building an endpoint using the AXD service.
|
|
38
49
|
*/
|
|
39
|
-
export declare const buildEndpointFromAxdService: <Args extends Record<string, unknown>, Result>(serviceFn: (args: Args) => Promise<Result>, options?: {
|
|
40
|
-
maxRetries?: number;
|
|
41
|
-
}) => {
|
|
50
|
+
export declare const buildEndpointFromAxdService: <Args extends Record<string, unknown>, Result>(serviceFn: (args: Args) => Promise<Result>, options?: BuildEndpointOptions) => {
|
|
42
51
|
queryFn: BaseQueryFn<Args, Result, FetchBaseQueryError | CustomError>;
|
|
43
52
|
};
|
|
44
53
|
export interface CustomQueryArgs extends Omit<FetchArgs, 'url'> {
|
|
@@ -61,24 +70,18 @@ export declare const iblFetchBaseQuery: BaseQueryFn<CustomQueryArgs, unknown, Ex
|
|
|
61
70
|
* Build a generic RTK Query endpoint from a service function (legacy variant).
|
|
62
71
|
* Includes built-in retry with exponential backoff.
|
|
63
72
|
*/
|
|
64
|
-
export declare const buildEndpointFromServiceLegacy: <Args extends any[], Result>(service: SERVICES, serviceFn: (...args: Args) => Promise<Result>, options?: {
|
|
65
|
-
maxRetries?: number;
|
|
66
|
-
}) => {
|
|
73
|
+
export declare const buildEndpointFromServiceLegacy: <Args extends any[], Result>(service: SERVICES, serviceFn: (...args: Args) => Promise<Result>, options?: BuildEndpointOptions) => {
|
|
67
74
|
queryFn: BaseQueryFn<Args, Result, FetchBaseQueryError | CustomError>;
|
|
68
75
|
};
|
|
69
76
|
/**
|
|
70
77
|
* Shortcut for building an endpoint using the DM service.
|
|
71
78
|
*/
|
|
72
|
-
export declare const buildEndpointFromDmServiceLegacy: <Args extends any[], Result>(serviceFn: (...args: Args) => Promise<Result>, options?: {
|
|
73
|
-
maxRetries?: number;
|
|
74
|
-
}) => {
|
|
79
|
+
export declare const buildEndpointFromDmServiceLegacy: <Args extends any[], Result>(serviceFn: (...args: Args) => Promise<Result>, options?: BuildEndpointOptions) => {
|
|
75
80
|
queryFn: BaseQueryFn<Args, Result, FetchBaseQueryError | CustomError>;
|
|
76
81
|
};
|
|
77
82
|
/**
|
|
78
83
|
* Shortcut for building an endpoint using the AXD service.
|
|
79
84
|
*/
|
|
80
|
-
export declare const buildEndpointFromAxdServiceLegacy: <Args extends any[], Result>(serviceFn: (...args: Args) => Promise<Result>, options?: {
|
|
81
|
-
maxRetries?: number;
|
|
82
|
-
}) => {
|
|
85
|
+
export declare const buildEndpointFromAxdServiceLegacy: <Args extends any[], Result>(serviceFn: (...args: Args) => Promise<Result>, options?: BuildEndpointOptions) => {
|
|
83
86
|
queryFn: BaseQueryFn<Args, Result, FetchBaseQueryError | CustomError>;
|
|
84
87
|
};
|