@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 CHANGED
@@ -1,4 +1,4 @@
1
1
  # [Versions](https://github.com/Tracktor/shared-module/releases)
2
2
 
3
- ## v2.1.5
4
- - **[fix]** - axios instance useAuth
3
+ ## v2.1.7
4
+ - **[fix]** - dayjs load locale
@@ -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
  */
@@ -12,6 +12,7 @@ export interface InjectDependenciesContextProps {
12
12
  * List of dependencies for libraries
13
13
  */
14
14
  libraries?: {
15
+ axios?: any;
15
16
  dayjs?: any;
16
17
  dayjsPlugin?: any[];
17
18
  gtm?: any;
@@ -1,4 +1,11 @@
1
- declare const useAuth: () => {
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;