jclib-ui 0.0.68 → 0.0.69

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.
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Provider para modal e configurações de acesso à API
3
3
  * @param {{
4
- * apiConfig: import("./createApiConfig").GlobalApiConfig
4
+ * apiConfig: import("../hooks/createApiConfig").GlobalApiConfig
5
5
  * children: React.ReactNode
6
6
  * versionApp: string
7
7
  * useTheme: boolean
@@ -9,7 +9,7 @@
9
9
  * @returns {any}
10
10
  */
11
11
  export function LibProvider({ apiConfig, children, versionApp, useTheme }: {
12
- apiConfig: import("./createApiConfig").GlobalApiConfig;
12
+ apiConfig: import("../hooks/createApiConfig").GlobalApiConfig;
13
13
  children: React.ReactNode;
14
14
  versionApp: string;
15
15
  useTheme: boolean;
@@ -5,13 +5,14 @@ export type GlobalApiConfig = {
5
5
  auth: {
6
6
  username: string;
7
7
  password: string;
8
- prefix?: string;
9
8
  header?: string;
9
+ prefix?: string;
10
10
  };
11
+ ident?: string;
11
12
  loginRoute?: string;
12
- afterRequest: (res: AxiosResponse) => void;
13
+ isProductionMode: boolean;
13
14
  getToken: () => string;
14
15
  setToken: (token: string) => void;
15
- isProductionMode: boolean;
16
+ afterRequest: (res: AxiosResponse) => void;
16
17
  };
17
18
  export declare function createApiConfig(obj?: GlobalApiConfig): GlobalApiConfig;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { default as Alerta, Aviso, Confirma } from './alerta/Alerta';
2
2
  export { LibProvider, useLibContext } from './context/libContext';
3
- export { createApiConfig } from './context/createApiConfig';
3
+ export { createApiConfig } from './hooks/createApiConfig';
4
4
  export { default as Table } from './table/table';
5
5
  export * from './table/tableUtils';
6
6
  export { default as BotaoClonar } from './botaoClonar/botaoClonar';
@@ -1011,11 +1011,12 @@ const Qu = "*** setToken() is not defined ***", li = {
1011
1011
  header: "x-auth"
1012
1012
  },
1013
1013
  loginRoute: "/",
1014
- afterRequest: (e) => {
1015
- },
1014
+ ident: "",
1015
+ isProductionMode: !0,
1016
1016
  getToken: () => "",
1017
1017
  setToken: (e) => console.error(Qu, e),
1018
- isProductionMode: !0
1018
+ afterRequest: (e) => {
1019
+ }
1019
1020
  };
1020
1021
  function $p(e = li) {
1021
1022
  const t = { ...li, ...e };
@@ -4552,7 +4553,7 @@ function Cn(e) {
4552
4553
  let _ = n.getToken();
4553
4554
  _ && (n.auth.prefix && (_ = `${n.auth.prefix} ${_}`), e.headers[n.auth.header] = _);
4554
4555
  }
4555
- e.cache = !!(n.isProductionMode && (!e.method || e.method == "get")), e != null && e.cache && await Ya.init(e);
4556
+ n.ident && (e.headers["x-identify"] = n.ident), e.cache = !!(n.isProductionMode && (!e.method || e.method == "get")), e != null && e.cache && await Ya.init(e);
4556
4557
  let f = {
4557
4558
  baseURL: n.baseURL,
4558
4559
  timeout: n.timeout,