@acrool/react-fetcher 0.0.5 → 0.0.6-alpha.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/README.md +1 -1
- package/dist/FetcherProvider/FetcherProvider.d.ts +1 -2
- package/dist/FetcherProvider/index.d.ts +1 -1
- package/dist/FetcherProvider/types.d.ts +2 -2
- package/dist/FetcherProvider/utils.d.ts +2 -2
- package/dist/acrool-react-fetcher.es.js +2553 -1725
- package/dist/acrool-react-fetcher.es.js.map +1 -0
- package/dist/exception/FetcherException.d.ts +14 -0
- package/dist/exception/index.d.ts +1 -1
- package/dist/fetchers/createRestFulFetcher/createRestFulFetcher.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/exception/SystemException.d.ts +0 -17
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Acrool React Fetcher is a solution for API integration and Auth state management in React projects. It helps you easily manage tokens, make API requests, perform GraphQL queries, and handle authentication flows.
|
|
4
4
|
|
|
5
5
|
<a href="https://acrool-react-fetcher.pages.dev/" title="Acrool React Fetcher - This is a block function for React development loading block">
|
|
6
|
-
<img src="https://raw.githubusercontent.com/acrool/acrool-react-fetcher/main/example/
|
|
6
|
+
<img src="https://raw.githubusercontent.com/acrool/acrool-react-fetcher/main/example/public/og.png" alt="Acrool React Fetcher Logo"/>
|
|
7
7
|
</a>
|
|
8
8
|
|
|
9
9
|
<p align="center">
|
|
@@ -12,7 +12,6 @@ interface IProps {
|
|
|
12
12
|
getResponseFormatError?: TGetResponseFormatError;
|
|
13
13
|
onError?: (error: IFormatResponseErrorReturn) => void;
|
|
14
14
|
authorizationPrefix?: string;
|
|
15
|
-
i18nDict?: Record<string, Record<number, string>>;
|
|
16
15
|
isDebug?: boolean;
|
|
17
16
|
}
|
|
18
17
|
/**
|
|
@@ -22,5 +21,5 @@ interface IProps {
|
|
|
22
21
|
* @param locale
|
|
23
22
|
* @param onError
|
|
24
23
|
*/
|
|
25
|
-
declare const FetcherProvider: ({ children, axiosInstance, locale, getResponseFormatError, onError, checkIsRefreshTokenRequest, authorizationPrefix,
|
|
24
|
+
declare const FetcherProvider: ({ children, axiosInstance, locale, getResponseFormatError, onError, checkIsRefreshTokenRequest, authorizationPrefix, isDebug, }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
25
|
export default FetcherProvider;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default as FetcherProvider } from './FetcherProvider';
|
|
2
2
|
export { getGraphQLResponseFormatError, getRestFulResponseFormatError } from './utils';
|
|
3
|
-
export type { TGetResponseFormatError } from './types';
|
|
3
|
+
export type { TGetResponseFormatError, IFormatResponseErrorReturn } from './types';
|
|
@@ -4,8 +4,8 @@ export type TInterceptorResponseSuccess = (value: AxiosResponse<any>) => AxiosRe
|
|
|
4
4
|
export type TInterceptorResponseError = (error: AxiosError<any>) => AxiosResponse<any> | Promise<AxiosResponse<any>>;
|
|
5
5
|
export interface IFormatResponseErrorReturn {
|
|
6
6
|
message: string;
|
|
7
|
-
code
|
|
7
|
+
code?: string;
|
|
8
8
|
path?: string;
|
|
9
9
|
args?: any;
|
|
10
10
|
}
|
|
11
|
-
export type TGetResponseFormatError = (
|
|
11
|
+
export type TGetResponseFormatError = (axiosError?: AxiosError) => IFormatResponseErrorReturn;
|
|
@@ -2,11 +2,11 @@ import { TGetResponseFormatError } from './types';
|
|
|
2
2
|
/**
|
|
3
3
|
* 返回 Axios 格式錯誤 With GraphQL
|
|
4
4
|
* 針對 GraphQL多錯誤格式
|
|
5
|
-
* @param
|
|
5
|
+
* @param axiosError
|
|
6
6
|
*/
|
|
7
7
|
export declare const getGraphQLResponseFormatError: TGetResponseFormatError;
|
|
8
8
|
/**
|
|
9
9
|
* 返回 Axios 格式錯誤 with RestFul
|
|
10
|
-
* @param
|
|
10
|
+
* @param axiosError
|
|
11
11
|
*/
|
|
12
12
|
export declare const getRestFulResponseFormatError: TGetResponseFormatError;
|