api-core-lib 12.0.93 → 12.0.94
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/{apiModule.types-0YqoHN1K.d.cts → apiModule.types-DNSvFUla.d.cts} +11 -10
- package/dist/{apiModule.types-0YqoHN1K.d.ts → apiModule.types-DNSvFUla.d.ts} +11 -10
- package/dist/client.d.cts +3 -5
- package/dist/client.d.ts +3 -5
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/server.d.cts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/{useApiRecord.types-Q5Ux9P1x.d.ts → useApiRecord.types-kAcLy9LB.d.ts} +1 -1
- package/dist/{useApiRecord.types-CdbyfLNG.d.cts → useApiRecord.types-vHAh2k4p.d.cts} +1 -1
- package/package.json +1 -1
|
@@ -255,19 +255,20 @@ type ModuleActions<TActions extends Record<string, ActionConfigModule<any, any>>
|
|
|
255
255
|
type ModuleStates<TActions extends Record<string, ActionConfigModule<any, any>>> = {
|
|
256
256
|
[K in keyof TActions]: ActionState<OutputOf<TActions[K]>>;
|
|
257
257
|
};
|
|
258
|
-
|
|
259
|
-
/** @description The complete, fully-typed return object of the `useApiModule` hook.
|
|
260
|
-
*/
|
|
261
|
-
type ActionsWithQuery<TActions extends Record<string, any>> = {
|
|
258
|
+
type ActionsWithQuery<TActions extends Record<string, ActionConfigModule<any, any>>> = {
|
|
262
259
|
[K in keyof TActions]: TActions[K] extends {
|
|
263
260
|
hasQuery: true;
|
|
264
261
|
} ? K : never;
|
|
265
262
|
}[keyof TActions];
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
263
|
+
/**
|
|
264
|
+
* يُنشئ نوعًا لكائن `queries` يكون آمنًا ومحددًا.
|
|
265
|
+
*/
|
|
266
|
+
type ModuleQueries<TActions extends Record<string, ActionConfigModule<any, any>>> = {
|
|
267
|
+
[K in keyof TActions]: K extends ActionsWithQuery<TActions> ? UseApiQuery : never;
|
|
268
|
+
};
|
|
269
|
+
/**
|
|
270
|
+
* @description The complete, fully-typed return object of the `useApiModule` hook.
|
|
271
|
+
*/
|
|
271
272
|
type UseApiModuleReturn<TActions extends Record<string, ActionConfigModule<any, any>>, TExtra extends object = {}> = {
|
|
272
273
|
states: ModuleStates<TActions>;
|
|
273
274
|
actions: ModuleActions<TActions>;
|
|
@@ -292,4 +293,4 @@ type ActionMethods<TAction extends ActionConfigModule<any, any>> = {
|
|
|
292
293
|
}) => void;
|
|
293
294
|
};
|
|
294
295
|
|
|
295
|
-
export type { ActionConfigModule as A, ExecutableAction as E, InputOf as I, LogLevel as L, ModuleStates as M, OutputOf as O, PaginationMeta as P, QueryOptions as Q, RequestConfig as R, StandardResponse as S, Tokens as T, UseApiConfig as U, ValidationError as V, ApiModuleConfig as a, UseApiModuleOptions as b, UseApiModuleReturn as c, ModuleActions as d,
|
|
296
|
+
export type { ActionConfigModule as A, ExecutableAction as E, InputOf as I, LogLevel as L, ModuleStates as M, OutputOf as O, PaginationMeta as P, QueryOptions as Q, RequestConfig as R, StandardResponse as S, Tokens as T, UseApiConfig as U, ValidationError as V, ApiModuleConfig as a, UseApiModuleOptions as b, UseApiModuleReturn as c, ModuleActions as d, ModuleQueries as e, ApiClientConfig as f, ActionOptions as g, ActionStateModule as h, UseApiQuery as i, ApiError as j, TokenManager as k, MiddlewareContext as l, Middleware as m, RefreshTokenConfig as n, ActionConfig as o, UseApiState as p, ActionState as q, ExecuteOptions as r, ActionsWithQuery as s, t, ActionMethods as u };
|
|
@@ -255,19 +255,20 @@ type ModuleActions<TActions extends Record<string, ActionConfigModule<any, any>>
|
|
|
255
255
|
type ModuleStates<TActions extends Record<string, ActionConfigModule<any, any>>> = {
|
|
256
256
|
[K in keyof TActions]: ActionState<OutputOf<TActions[K]>>;
|
|
257
257
|
};
|
|
258
|
-
|
|
259
|
-
/** @description The complete, fully-typed return object of the `useApiModule` hook.
|
|
260
|
-
*/
|
|
261
|
-
type ActionsWithQuery<TActions extends Record<string, any>> = {
|
|
258
|
+
type ActionsWithQuery<TActions extends Record<string, ActionConfigModule<any, any>>> = {
|
|
262
259
|
[K in keyof TActions]: TActions[K] extends {
|
|
263
260
|
hasQuery: true;
|
|
264
261
|
} ? K : never;
|
|
265
262
|
}[keyof TActions];
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
263
|
+
/**
|
|
264
|
+
* يُنشئ نوعًا لكائن `queries` يكون آمنًا ومحددًا.
|
|
265
|
+
*/
|
|
266
|
+
type ModuleQueries<TActions extends Record<string, ActionConfigModule<any, any>>> = {
|
|
267
|
+
[K in keyof TActions]: K extends ActionsWithQuery<TActions> ? UseApiQuery : never;
|
|
268
|
+
};
|
|
269
|
+
/**
|
|
270
|
+
* @description The complete, fully-typed return object of the `useApiModule` hook.
|
|
271
|
+
*/
|
|
271
272
|
type UseApiModuleReturn<TActions extends Record<string, ActionConfigModule<any, any>>, TExtra extends object = {}> = {
|
|
272
273
|
states: ModuleStates<TActions>;
|
|
273
274
|
actions: ModuleActions<TActions>;
|
|
@@ -292,4 +293,4 @@ type ActionMethods<TAction extends ActionConfigModule<any, any>> = {
|
|
|
292
293
|
}) => void;
|
|
293
294
|
};
|
|
294
295
|
|
|
295
|
-
export type { ActionConfigModule as A, ExecutableAction as E, InputOf as I, LogLevel as L, ModuleStates as M, OutputOf as O, PaginationMeta as P, QueryOptions as Q, RequestConfig as R, StandardResponse as S, Tokens as T, UseApiConfig as U, ValidationError as V, ApiModuleConfig as a, UseApiModuleOptions as b, UseApiModuleReturn as c, ModuleActions as d,
|
|
296
|
+
export type { ActionConfigModule as A, ExecutableAction as E, InputOf as I, LogLevel as L, ModuleStates as M, OutputOf as O, PaginationMeta as P, QueryOptions as Q, RequestConfig as R, StandardResponse as S, Tokens as T, UseApiConfig as U, ValidationError as V, ApiModuleConfig as a, UseApiModuleOptions as b, UseApiModuleReturn as c, ModuleActions as d, ModuleQueries as e, ApiClientConfig as f, ActionOptions as g, ActionStateModule as h, UseApiQuery as i, ApiError as j, TokenManager as k, MiddlewareContext as l, Middleware as m, RefreshTokenConfig as n, ActionConfig as o, UseApiState as p, ActionState as q, ExecuteOptions as r, ActionsWithQuery as s, t, ActionMethods as u };
|
package/dist/client.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
import { U as UseApiConfig, A as ActionConfigModule, a as ApiModuleConfig, b as UseApiModuleOptions, c as UseApiModuleReturn, M as ModuleStates, d as ModuleActions, e as
|
|
3
|
-
import { U as UseApiRecordConfig, a as UseApiRecordReturn } from './useApiRecord.types-
|
|
2
|
+
import { U as UseApiConfig, A as ActionConfigModule, a as ApiModuleConfig, b as UseApiModuleOptions, c as UseApiModuleReturn, M as ModuleStates, d as ModuleActions, e as ModuleQueries } from './apiModule.types-DNSvFUla.cjs';
|
|
3
|
+
import { U as UseApiRecordConfig, a as UseApiRecordReturn } from './useApiRecord.types-vHAh2k4p.cjs';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import { ReactNode } from 'react';
|
|
6
6
|
|
|
@@ -25,9 +25,7 @@ declare function useDeepCompareEffect(callback: EffectCallback, dependencies: De
|
|
|
25
25
|
declare const ApiModuleProvider: react.Provider<{
|
|
26
26
|
states: ModuleStates<any>;
|
|
27
27
|
actions: ModuleActions<any>;
|
|
28
|
-
queries:
|
|
29
|
-
[x: string]: UseApiQuery;
|
|
30
|
-
}>;
|
|
28
|
+
queries: ModuleQueries<any>;
|
|
31
29
|
dehydrate: () => string;
|
|
32
30
|
} | null>;
|
|
33
31
|
declare function useApiModule<TActions extends Record<string, ActionConfigModule<any, any>>, TExtra extends object = {}>(axiosInstance: AxiosInstance, moduleConfig: ApiModuleConfig<TActions>, options?: UseApiModuleOptions<TExtra>): UseApiModuleReturn<TActions, TExtra>;
|
package/dist/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
import { U as UseApiConfig, A as ActionConfigModule, a as ApiModuleConfig, b as UseApiModuleOptions, c as UseApiModuleReturn, M as ModuleStates, d as ModuleActions, e as
|
|
3
|
-
import { U as UseApiRecordConfig, a as UseApiRecordReturn } from './useApiRecord.types-
|
|
2
|
+
import { U as UseApiConfig, A as ActionConfigModule, a as ApiModuleConfig, b as UseApiModuleOptions, c as UseApiModuleReturn, M as ModuleStates, d as ModuleActions, e as ModuleQueries } from './apiModule.types-DNSvFUla.js';
|
|
3
|
+
import { U as UseApiRecordConfig, a as UseApiRecordReturn } from './useApiRecord.types-kAcLy9LB.js';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import { ReactNode } from 'react';
|
|
6
6
|
|
|
@@ -25,9 +25,7 @@ declare function useDeepCompareEffect(callback: EffectCallback, dependencies: De
|
|
|
25
25
|
declare const ApiModuleProvider: react.Provider<{
|
|
26
26
|
states: ModuleStates<any>;
|
|
27
27
|
actions: ModuleActions<any>;
|
|
28
|
-
queries:
|
|
29
|
-
[x: string]: UseApiQuery;
|
|
30
|
-
}>;
|
|
28
|
+
queries: ModuleQueries<any>;
|
|
31
29
|
dehydrate: () => string;
|
|
32
30
|
} | null>;
|
|
33
31
|
declare function useApiModule<TActions extends Record<string, ActionConfigModule<any, any>>, TExtra extends object = {}>(axiosInstance: AxiosInstance, moduleConfig: ApiModuleConfig<TActions>, options?: UseApiModuleOptions<TExtra>): UseApiModuleReturn<TActions, TExtra>;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AxiosInstance, AxiosRequestConfig, Method, AxiosResponse, AxiosError } from 'axios';
|
|
2
|
-
import { f as ApiClientConfig, A as ActionConfigModule, S as StandardResponse, g as ActionOptions, R as RequestConfig, h as ActionStateModule, Q as QueryOptions,
|
|
3
|
-
export {
|
|
4
|
-
export { c as UseApiRecordActions, U as UseApiRecordConfig, a as UseApiRecordReturn, b as UseApiRecordState } from './useApiRecord.types-
|
|
2
|
+
import { f as ApiClientConfig, A as ActionConfigModule, S as StandardResponse, g as ActionOptions, R as RequestConfig, h as ActionStateModule, Q as QueryOptions, i as UseApiQuery, j as ApiError, L as LogLevel } from './apiModule.types-DNSvFUla.cjs';
|
|
3
|
+
export { o as ActionConfig, u as ActionMethods, q as ActionState, s as ActionsWithQuery, a as ApiModuleConfig, E as ExecutableAction, r as ExecuteOptions, I as InputOf, m as Middleware, l as MiddlewareContext, d as ModuleActions, e as ModuleQueries, M as ModuleStates, O as OutputOf, P as PaginationMeta, n as RefreshTokenConfig, k as TokenManager, T as Tokens, U as UseApiConfig, b as UseApiModuleOptions, c as UseApiModuleReturn, p as UseApiState, V as ValidationError, t } from './apiModule.types-DNSvFUla.cjs';
|
|
4
|
+
export { c as UseApiRecordActions, U as UseApiRecordConfig, a as UseApiRecordReturn, b as UseApiRecordState } from './useApiRecord.types-vHAh2k4p.cjs';
|
|
5
5
|
import 'react';
|
|
6
6
|
|
|
7
7
|
declare function createApiClient(config: ApiClientConfig): AxiosInstance;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AxiosInstance, AxiosRequestConfig, Method, AxiosResponse, AxiosError } from 'axios';
|
|
2
|
-
import { f as ApiClientConfig, A as ActionConfigModule, S as StandardResponse, g as ActionOptions, R as RequestConfig, h as ActionStateModule, Q as QueryOptions,
|
|
3
|
-
export {
|
|
4
|
-
export { c as UseApiRecordActions, U as UseApiRecordConfig, a as UseApiRecordReturn, b as UseApiRecordState } from './useApiRecord.types-
|
|
2
|
+
import { f as ApiClientConfig, A as ActionConfigModule, S as StandardResponse, g as ActionOptions, R as RequestConfig, h as ActionStateModule, Q as QueryOptions, i as UseApiQuery, j as ApiError, L as LogLevel } from './apiModule.types-DNSvFUla.js';
|
|
3
|
+
export { o as ActionConfig, u as ActionMethods, q as ActionState, s as ActionsWithQuery, a as ApiModuleConfig, E as ExecutableAction, r as ExecuteOptions, I as InputOf, m as Middleware, l as MiddlewareContext, d as ModuleActions, e as ModuleQueries, M as ModuleStates, O as OutputOf, P as PaginationMeta, n as RefreshTokenConfig, k as TokenManager, T as Tokens, U as UseApiConfig, b as UseApiModuleOptions, c as UseApiModuleReturn, p as UseApiState, V as ValidationError, t } from './apiModule.types-DNSvFUla.js';
|
|
4
|
+
export { c as UseApiRecordActions, U as UseApiRecordConfig, a as UseApiRecordReturn, b as UseApiRecordState } from './useApiRecord.types-kAcLy9LB.js';
|
|
5
5
|
import 'react';
|
|
6
6
|
|
|
7
7
|
declare function createApiClient(config: ApiClientConfig): AxiosInstance;
|
package/dist/server.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
import { A as ActionConfigModule, a as ApiModuleConfig, I as InputOf } from './apiModule.types-
|
|
2
|
+
import { A as ActionConfigModule, a as ApiModuleConfig, I as InputOf } from './apiModule.types-DNSvFUla.cjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
import { A as ActionConfigModule, a as ApiModuleConfig, I as InputOf } from './apiModule.types-
|
|
2
|
+
import { A as ActionConfigModule, a as ApiModuleConfig, I as InputOf } from './apiModule.types-DNSvFUla.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
import { R as RequestConfig,
|
|
2
|
+
import { R as RequestConfig, j as ApiError, S as StandardResponse, g as ActionOptions } from './apiModule.types-DNSvFUla.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Represents the internal state of the `useApiRecord` hook.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
import { R as RequestConfig,
|
|
2
|
+
import { R as RequestConfig, j as ApiError, S as StandardResponse, g as ActionOptions } from './apiModule.types-DNSvFUla.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Represents the internal state of the `useApiRecord` hook.
|