@tracktor/shared-module 2.1.5 → 2.1.7
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/CHANGELOG.md +2 -2
- package/dist/{config/orval/mutator/axiosCustomInstance.ts → axiosCustomInstance.ts} +1 -2
- package/dist/components/Utils/InitializeAxiosConfig.d.ts +5 -0
- package/dist/components/Utils/RequireAuth.d.ts +4 -0
- package/dist/context/InjectDependenciesProvider.d.ts +1 -0
- package/dist/hooks/useAuth/useAuth.d.ts +8 -1
- package/dist/main.js +489 -502
- package/dist/main.umd.cjs +13 -15
- package/package.json +4 -7
- package/dist/config/orval/mutator/axiosCustomInstance.d.ts +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
1
2
|
import axios, { AxiosError, AxiosRequestConfig } from "axios";
|
|
2
3
|
|
|
3
|
-
axios.create();
|
|
4
|
-
|
|
5
4
|
export const axiosCustomInstance = <T>(config: AxiosRequestConfig, options?: AxiosRequestConfig): Promise<T> => {
|
|
6
5
|
const source = axios.CancelToken.source();
|
|
7
6
|
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import { InjectDependenciesContextProps } from '../../context/InjectDependenciesProvider';
|
|
1
2
|
interface InitializeAxiosConfigProps {
|
|
3
|
+
/**
|
|
4
|
+
* Axios library
|
|
5
|
+
*/
|
|
6
|
+
axios?: NonNullable<InjectDependenciesContextProps["libraries"]>["axios"];
|
|
2
7
|
/**
|
|
3
8
|
* User local storage key
|
|
4
9
|
* @default user
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { InjectDependenciesContextProps } from '../../context/InjectDependenciesProvider';
|
|
3
3
|
export interface RequireAuthProps {
|
|
4
|
+
/**
|
|
5
|
+
* Axios library
|
|
6
|
+
*/
|
|
7
|
+
axios?: NonNullable<InjectDependenciesContextProps["libraries"]>["axios"];
|
|
4
8
|
/**
|
|
5
9
|
* React router is a libraries dependencies
|
|
6
10
|
*/
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { InjectDependenciesContextProps } from '../../context/InjectDependenciesProvider';
|
|
2
|
+
interface useAuthParams {
|
|
3
|
+
/**
|
|
4
|
+
* Axios library
|
|
5
|
+
*/
|
|
6
|
+
axios?: NonNullable<InjectDependenciesContextProps["libraries"]>["axios"];
|
|
7
|
+
}
|
|
8
|
+
declare const useAuth: (params?: useAuthParams) => {
|
|
2
9
|
clearAuthenticationToken: () => void;
|
|
3
10
|
setAuthenticationToken: ({ tokenType, accessToken }: {
|
|
4
11
|
tokenType: string;
|