@tracktor/shared-module 2.1.4 → 2.1.5

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 CHANGED
@@ -1,4 +1,4 @@
1
1
  # [Versions](https://github.com/Tracktor/shared-module/releases)
2
2
 
3
- ## v2.1.4
4
- - **[fix]** - axios use now same instance than orval
3
+ ## v2.1.5
4
+ - **[fix]** - axios instance useAuth
@@ -1,9 +1,4 @@
1
- import { InjectDependenciesContextProps } from '../../context/InjectDependenciesProvider';
2
1
  interface InitializeAxiosConfigProps {
3
- /**
4
- * Axios library
5
- */
6
- axios?: NonNullable<InjectDependenciesContextProps["libraries"]>["axios"];
7
2
  /**
8
3
  * User local storage key
9
4
  * @default user
@@ -5,10 +5,6 @@ export interface RequireAuthProps {
5
5
  * React router is a libraries dependencies
6
6
  */
7
7
  reactRouter?: NonNullable<InjectDependenciesContextProps["libraries"]>["reactRouter"];
8
- /**
9
- * Axios is a libraries dependencies
10
- */
11
- axios?: NonNullable<InjectDependenciesContextProps["libraries"]>["axios"];
12
8
  /**
13
9
  * Is user logged in
14
10
  */
@@ -1,5 +1,4 @@
1
1
  import { AxiosError, AxiosRequestConfig } from "axios";
2
- export declare const AXIOS_INSTANCE: import("axios").AxiosInstance;
3
2
  export declare const axiosCustomInstance: <T>(config: AxiosRequestConfig, options?: AxiosRequestConfig) => Promise<T>;
4
3
  export default axiosCustomInstance;
5
4
  export type ErrorType<Error> = AxiosError<Error>;
@@ -1,11 +1,11 @@
1
1
  import axios, { AxiosError, AxiosRequestConfig } from "axios";
2
2
 
3
- export const AXIOS_INSTANCE = axios.create();
3
+ axios.create();
4
4
 
5
5
  export const axiosCustomInstance = <T>(config: AxiosRequestConfig, options?: AxiosRequestConfig): Promise<T> => {
6
6
  const source = axios.CancelToken.source();
7
7
 
8
- const promise = AXIOS_INSTANCE({
8
+ const promise = axios({
9
9
  ...config,
10
10
  ...options,
11
11
  cancelToken: source.token,
@@ -12,7 +12,6 @@ export interface InjectDependenciesContextProps {
12
12
  * List of dependencies for libraries
13
13
  */
14
14
  libraries?: {
15
- axios?: any;
16
15
  dayjs?: any;
17
16
  dayjsPlugin?: any[];
18
17
  gtm?: any;
@@ -1,11 +1,4 @@
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) => {
1
+ declare const useAuth: () => {
9
2
  clearAuthenticationToken: () => void;
10
3
  setAuthenticationToken: ({ tokenType, accessToken }: {
11
4
  tokenType: string;