@tracktor/shared-module 2.1.4 → 2.1.6
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} +2 -3
- package/dist/components/Utils/RequireAuth.d.ts +4 -4
- package/dist/main.js +475 -494
- package/dist/main.umd.cjs +13 -15
- package/package.json +4 -7
- package/dist/config/orval/mutator/axiosCustomInstance.d.ts +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
1
2
|
import axios, { AxiosError, AxiosRequestConfig } from "axios";
|
|
2
3
|
|
|
3
|
-
export const AXIOS_INSTANCE = axios.create();
|
|
4
|
-
|
|
5
4
|
export const axiosCustomInstance = <T>(config: AxiosRequestConfig, options?: AxiosRequestConfig): Promise<T> => {
|
|
6
5
|
const source = axios.CancelToken.source();
|
|
7
6
|
|
|
8
|
-
const promise =
|
|
7
|
+
const promise = axios({
|
|
9
8
|
...config,
|
|
10
9
|
...options,
|
|
11
10
|
cancelToken: source.token,
|
|
@@ -2,13 +2,13 @@ import { ReactNode } from "react";
|
|
|
2
2
|
import { InjectDependenciesContextProps } from '../../context/InjectDependenciesProvider';
|
|
3
3
|
export interface RequireAuthProps {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Axios library
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
axios?: NonNullable<InjectDependenciesContextProps["libraries"]>["axios"];
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* React router is a libraries dependencies
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
reactRouter?: NonNullable<InjectDependenciesContextProps["libraries"]>["reactRouter"];
|
|
12
12
|
/**
|
|
13
13
|
* Is user logged in
|
|
14
14
|
*/
|