@fctc/interface-logic 2.4.6 → 2.4.8

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/dist/configs.js CHANGED
@@ -2372,16 +2372,24 @@ var axiosClient = {
2372
2372
  const service = serviceName || config?.default_service;
2373
2373
  return config?.default_service === "" ? `${baseUrl.replace(/\/$/, "")}/api/v2` : `${baseUrl.replace(/\/$/, "")}/${service}/api/v2`;
2374
2374
  };
2375
+ function normalizeHeaders(headers) {
2376
+ const _header = { ...headers };
2377
+ if ("x_node" in _header) {
2378
+ _header["X-Node"] = _header.x_node;
2379
+ delete _header.x_node;
2380
+ }
2381
+ return _header;
2382
+ }
2375
2383
  const responseBody = (response) => response;
2376
2384
  const requests = {
2377
2385
  get: (url, headers, serviceName) => instance.get(
2378
2386
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
2379
- headers
2387
+ normalizeHeaders(headers)
2380
2388
  ).then(responseBody),
2381
2389
  post: async (url, body, headers, serviceName) => instance.post(
2382
2390
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
2383
2391
  body,
2384
- headers
2392
+ normalizeHeaders(headers)
2385
2393
  ).then(responseBody),
2386
2394
  post_excel: (url, body, headers, serviceName) => instance.post(
2387
2395
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
@@ -2391,23 +2399,23 @@ var axiosClient = {
2391
2399
  headers: {
2392
2400
  "Content-Type": typeof window !== "undefined" ? "application/json" : "application/javascript",
2393
2401
  Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
2394
- ...headers
2402
+ ...normalizeHeaders(headers)
2395
2403
  }
2396
2404
  }
2397
2405
  ).then(responseBody),
2398
2406
  put: (url, body, headers, serviceName) => instance.put(
2399
2407
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
2400
2408
  body,
2401
- headers
2409
+ normalizeHeaders(headers)
2402
2410
  ).then(responseBody),
2403
2411
  patch: (url, body, headers, serviceName) => instance.patch(
2404
2412
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
2405
2413
  body,
2406
- headers
2414
+ normalizeHeaders(headers)
2407
2415
  ).then(responseBody),
2408
2416
  delete: (url, headers, serviceName) => instance.delete(
2409
2417
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
2410
- headers
2418
+ normalizeHeaders(headers)
2411
2419
  ).then(responseBody)
2412
2420
  };
2413
2421
  return requests;
package/dist/configs.mjs CHANGED
@@ -2336,16 +2336,24 @@ var axiosClient = {
2336
2336
  const service = serviceName || config?.default_service;
2337
2337
  return config?.default_service === "" ? `${baseUrl.replace(/\/$/, "")}/api/v2` : `${baseUrl.replace(/\/$/, "")}/${service}/api/v2`;
2338
2338
  };
2339
+ function normalizeHeaders(headers) {
2340
+ const _header = { ...headers };
2341
+ if ("x_node" in _header) {
2342
+ _header["X-Node"] = _header.x_node;
2343
+ delete _header.x_node;
2344
+ }
2345
+ return _header;
2346
+ }
2339
2347
  const responseBody = (response) => response;
2340
2348
  const requests = {
2341
2349
  get: (url, headers, serviceName) => instance.get(
2342
2350
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
2343
- headers
2351
+ normalizeHeaders(headers)
2344
2352
  ).then(responseBody),
2345
2353
  post: async (url, body, headers, serviceName) => instance.post(
2346
2354
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
2347
2355
  body,
2348
- headers
2356
+ normalizeHeaders(headers)
2349
2357
  ).then(responseBody),
2350
2358
  post_excel: (url, body, headers, serviceName) => instance.post(
2351
2359
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
@@ -2355,23 +2363,23 @@ var axiosClient = {
2355
2363
  headers: {
2356
2364
  "Content-Type": typeof window !== "undefined" ? "application/json" : "application/javascript",
2357
2365
  Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
2358
- ...headers
2366
+ ...normalizeHeaders(headers)
2359
2367
  }
2360
2368
  }
2361
2369
  ).then(responseBody),
2362
2370
  put: (url, body, headers, serviceName) => instance.put(
2363
2371
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
2364
2372
  body,
2365
- headers
2373
+ normalizeHeaders(headers)
2366
2374
  ).then(responseBody),
2367
2375
  patch: (url, body, headers, serviceName) => instance.patch(
2368
2376
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
2369
2377
  body,
2370
- headers
2378
+ normalizeHeaders(headers)
2371
2379
  ).then(responseBody),
2372
2380
  delete: (url, headers, serviceName) => instance.delete(
2373
2381
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
2374
- headers
2382
+ normalizeHeaders(headers)
2375
2383
  ).then(responseBody)
2376
2384
  };
2377
2385
  return requests;
@@ -2374,16 +2374,24 @@ var axiosClient = {
2374
2374
  const service = serviceName || config?.default_service;
2375
2375
  return config?.default_service === "" ? `${baseUrl.replace(/\/$/, "")}/api/v2` : `${baseUrl.replace(/\/$/, "")}/${service}/api/v2`;
2376
2376
  };
2377
+ function normalizeHeaders(headers) {
2378
+ const _header = { ...headers };
2379
+ if ("x_node" in _header) {
2380
+ _header["X-Node"] = _header.x_node;
2381
+ delete _header.x_node;
2382
+ }
2383
+ return _header;
2384
+ }
2377
2385
  const responseBody = (response) => response;
2378
2386
  const requests = {
2379
2387
  get: (url, headers, serviceName) => instance.get(
2380
2388
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
2381
- headers
2389
+ normalizeHeaders(headers)
2382
2390
  ).then(responseBody),
2383
2391
  post: async (url, body, headers, serviceName) => instance.post(
2384
2392
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
2385
2393
  body,
2386
- headers
2394
+ normalizeHeaders(headers)
2387
2395
  ).then(responseBody),
2388
2396
  post_excel: (url, body, headers, serviceName) => instance.post(
2389
2397
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
@@ -2393,23 +2401,23 @@ var axiosClient = {
2393
2401
  headers: {
2394
2402
  "Content-Type": typeof window !== "undefined" ? "application/json" : "application/javascript",
2395
2403
  Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
2396
- ...headers
2404
+ ...normalizeHeaders(headers)
2397
2405
  }
2398
2406
  }
2399
2407
  ).then(responseBody),
2400
2408
  put: (url, body, headers, serviceName) => instance.put(
2401
2409
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
2402
2410
  body,
2403
- headers
2411
+ normalizeHeaders(headers)
2404
2412
  ).then(responseBody),
2405
2413
  patch: (url, body, headers, serviceName) => instance.patch(
2406
2414
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
2407
2415
  body,
2408
- headers
2416
+ normalizeHeaders(headers)
2409
2417
  ).then(responseBody),
2410
2418
  delete: (url, headers, serviceName) => instance.delete(
2411
2419
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
2412
- headers
2420
+ normalizeHeaders(headers)
2413
2421
  ).then(responseBody)
2414
2422
  };
2415
2423
  return requests;
@@ -2336,16 +2336,24 @@ var axiosClient = {
2336
2336
  const service = serviceName || config?.default_service;
2337
2337
  return config?.default_service === "" ? `${baseUrl.replace(/\/$/, "")}/api/v2` : `${baseUrl.replace(/\/$/, "")}/${service}/api/v2`;
2338
2338
  };
2339
+ function normalizeHeaders(headers) {
2340
+ const _header = { ...headers };
2341
+ if ("x_node" in _header) {
2342
+ _header["X-Node"] = _header.x_node;
2343
+ delete _header.x_node;
2344
+ }
2345
+ return _header;
2346
+ }
2339
2347
  const responseBody = (response) => response;
2340
2348
  const requests = {
2341
2349
  get: (url, headers, serviceName) => instance.get(
2342
2350
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
2343
- headers
2351
+ normalizeHeaders(headers)
2344
2352
  ).then(responseBody),
2345
2353
  post: async (url, body, headers, serviceName) => instance.post(
2346
2354
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
2347
2355
  body,
2348
- headers
2356
+ normalizeHeaders(headers)
2349
2357
  ).then(responseBody),
2350
2358
  post_excel: (url, body, headers, serviceName) => instance.post(
2351
2359
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
@@ -2355,23 +2363,23 @@ var axiosClient = {
2355
2363
  headers: {
2356
2364
  "Content-Type": typeof window !== "undefined" ? "application/json" : "application/javascript",
2357
2365
  Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
2358
- ...headers
2366
+ ...normalizeHeaders(headers)
2359
2367
  }
2360
2368
  }
2361
2369
  ).then(responseBody),
2362
2370
  put: (url, body, headers, serviceName) => instance.put(
2363
2371
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
2364
2372
  body,
2365
- headers
2373
+ normalizeHeaders(headers)
2366
2374
  ).then(responseBody),
2367
2375
  patch: (url, body, headers, serviceName) => instance.patch(
2368
2376
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
2369
2377
  body,
2370
- headers
2378
+ normalizeHeaders(headers)
2371
2379
  ).then(responseBody),
2372
2380
  delete: (url, headers, serviceName) => instance.delete(
2373
2381
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
2374
- headers
2382
+ normalizeHeaders(headers)
2375
2383
  ).then(responseBody)
2376
2384
  };
2377
2385
  return requests;
package/dist/hooks.d.mts CHANGED
@@ -32,7 +32,7 @@ declare const useResetPasswordSSO: () => _tanstack_react_query.UseMutationResult
32
32
 
33
33
  declare const useUpdatePassword: () => _tanstack_react_query.UseMutationResult<any, Error, updatePasswordBody, unknown>;
34
34
 
35
- declare const useLogout: () => _tanstack_react_query.UseMutationResult<any, Error, string, unknown>;
35
+ declare const useLogout: () => _tanstack_react_query.UseMutationResult<any, Error, string | undefined, unknown>;
36
36
 
37
37
  declare const useGetAccessByCode: () => _tanstack_react_query.UseMutationResult<any, Error, {
38
38
  code: string;
package/dist/hooks.d.ts CHANGED
@@ -32,7 +32,7 @@ declare const useResetPasswordSSO: () => _tanstack_react_query.UseMutationResult
32
32
 
33
33
  declare const useUpdatePassword: () => _tanstack_react_query.UseMutationResult<any, Error, updatePasswordBody, unknown>;
34
34
 
35
- declare const useLogout: () => _tanstack_react_query.UseMutationResult<any, Error, string, unknown>;
35
+ declare const useLogout: () => _tanstack_react_query.UseMutationResult<any, Error, string | undefined, unknown>;
36
36
 
37
37
  declare const useGetAccessByCode: () => _tanstack_react_query.UseMutationResult<any, Error, {
38
38
  code: string;
package/dist/hooks.js CHANGED
@@ -3303,8 +3303,7 @@ function useAuthService() {
3303
3303
  [env]
3304
3304
  );
3305
3305
  const logout = (0, import_react7.useCallback)(
3306
- async (data) => {
3307
- console.log(data);
3306
+ async (service) => {
3308
3307
  return env?.requests?.post(
3309
3308
  "/logout" /* LOGOUT */,
3310
3309
  {},
@@ -3314,7 +3313,8 @@ function useAuthService() {
3314
3313
  },
3315
3314
  withCredentials: true,
3316
3315
  useRefreshToken: true
3317
- }
3316
+ },
3317
+ service
3318
3318
  );
3319
3319
  },
3320
3320
  [env]
@@ -4707,8 +4707,8 @@ var import_react_query12 = require("@tanstack/react-query");
4707
4707
  var useLogout = () => {
4708
4708
  const { logout } = useAuthService();
4709
4709
  return (0, import_react_query12.useMutation)({
4710
- mutationFn: (data) => {
4711
- return logout(data);
4710
+ mutationFn: (service) => {
4711
+ return logout(service);
4712
4712
  }
4713
4713
  });
4714
4714
  };
package/dist/hooks.mjs CHANGED
@@ -3199,8 +3199,7 @@ function useAuthService() {
3199
3199
  [env]
3200
3200
  );
3201
3201
  const logout = useCallback3(
3202
- async (data) => {
3203
- console.log(data);
3202
+ async (service) => {
3204
3203
  return env?.requests?.post(
3205
3204
  "/logout" /* LOGOUT */,
3206
3205
  {},
@@ -3210,7 +3209,8 @@ function useAuthService() {
3210
3209
  },
3211
3210
  withCredentials: true,
3212
3211
  useRefreshToken: true
3213
- }
3212
+ },
3213
+ service
3214
3214
  );
3215
3215
  },
3216
3216
  [env]
@@ -4603,8 +4603,8 @@ import { useMutation as useMutation10 } from "@tanstack/react-query";
4603
4603
  var useLogout = () => {
4604
4604
  const { logout } = useAuthService();
4605
4605
  return useMutation10({
4606
- mutationFn: (data) => {
4607
- return logout(data);
4606
+ mutationFn: (service) => {
4607
+ return logout(service);
4608
4608
  }
4609
4609
  });
4610
4610
  };
@@ -1,3 +1,4 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import { ReactNode } from 'react';
2
3
  import { L as LocalStorageUtilsType, S as SessionStorageUtilsType } from './session-storage-ARp_lhTD.mjs';
3
4
  import { useForgotPassword, useForgotPasswordSSO, useGetProvider, useIsValidToken, useLoginCredential, useLoginSocial, useResetPassword, useResetPasswordSSO, useUpdatePassword, useLogout, useGetAccessByCode, useValidateActionToken, useGetCompanyInfo, useGetCurrentCompany, useGetListCompany, useExecuteImport, useExportExcel, useGetFieldExport, useGetFileExcel, useParsePreview, useUploadFileExcel, useUploadIdFile, useChangeStatus, useDeleteComment, useGetComment, useGetFormView, useGetImage, useSendComment, useUploadImage, useDelete, useGetAll, useGetConversionRate, useGetCurrency, useGetDetail, useGetFieldOnChange, useGetListMyBankAccount, useModel, useOdooDataTransform, useOnChangeForm, useSave, useGetProfile, useGetUser, useSwitchLocale, useButton, useDuplicateRecord, useGet2FAMethods, useGetActionDetail, useGetCalendar, useGetGroups, useGetListData, useGetMenu, useGetPrintReport, useGetProGressBar, useGetResequence, useGetSelection, useGetView, useLoadAction, useLoadMessage, usePrint, useRemoveRow, useRunAction, useSignInSSO, useVerify2FA, useGrantAccess, useRemoveTotpSetup, useRequestSetupTotp, useSettingsWebRead2fa, useVerifyTotp, useUploadFile } from './hooks.mjs';
@@ -8,15 +9,15 @@ import './models.mjs';
8
9
 
9
10
  declare const MainProvider: ({ children }: {
10
11
  children: ReactNode;
11
- }) => JSX.Element;
12
+ }) => react_jsx_runtime.JSX.Element;
12
13
 
13
14
  declare const ReactQueryProvider: ({ children }: {
14
15
  children: ReactNode;
15
- }) => JSX.Element;
16
+ }) => react_jsx_runtime.JSX.Element;
16
17
 
17
18
  declare const VersionGate: ({ children }: {
18
19
  children: ReactNode;
19
- }) => JSX.Element | null;
20
+ }) => react_jsx_runtime.JSX.Element | null;
20
21
 
21
22
  interface EnvConfig {
22
23
  env?: any;
@@ -48,7 +49,7 @@ declare function EnvProvider({ children, localStorageUtils: localStorageUtil, se
48
49
  children: React.ReactNode;
49
50
  localStorageUtils?: LocalStorageUtilsType;
50
51
  sessionStorageUtils?: SessionStorageUtilsType;
51
- }): JSX.Element;
52
+ }): react_jsx_runtime.JSX.Element;
52
53
  declare function useEnv(): {
53
54
  env: EnvConfig;
54
55
  setupEnv: (envConfig: Partial<EnvConfig>) => EnvConfig;
@@ -135,12 +136,12 @@ interface ServiceContextType {
135
136
  }
136
137
  declare const ServiceProvider: ({ children, }: {
137
138
  children: React.ReactNode;
138
- }) => JSX.Element;
139
+ }) => react_jsx_runtime.JSX.Element;
139
140
  declare const useService: () => ServiceContextType;
140
141
 
141
142
  type MetaProviderProps = {
142
143
  children: ReactNode;
143
144
  };
144
- declare const MetaProvider: ({ children }: MetaProviderProps) => JSX.Element;
145
+ declare const MetaProvider: ({ children }: MetaProviderProps) => react_jsx_runtime.JSX.Element;
145
146
 
146
147
  export { EnvProvider, MainProvider, MetaProvider, ReactQueryProvider, ServiceProvider, VersionGate, useEnv, useService };
@@ -1,3 +1,4 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import { ReactNode } from 'react';
2
3
  import { L as LocalStorageUtilsType, S as SessionStorageUtilsType } from './session-storage-ARp_lhTD.js';
3
4
  import { useForgotPassword, useForgotPasswordSSO, useGetProvider, useIsValidToken, useLoginCredential, useLoginSocial, useResetPassword, useResetPasswordSSO, useUpdatePassword, useLogout, useGetAccessByCode, useValidateActionToken, useGetCompanyInfo, useGetCurrentCompany, useGetListCompany, useExecuteImport, useExportExcel, useGetFieldExport, useGetFileExcel, useParsePreview, useUploadFileExcel, useUploadIdFile, useChangeStatus, useDeleteComment, useGetComment, useGetFormView, useGetImage, useSendComment, useUploadImage, useDelete, useGetAll, useGetConversionRate, useGetCurrency, useGetDetail, useGetFieldOnChange, useGetListMyBankAccount, useModel, useOdooDataTransform, useOnChangeForm, useSave, useGetProfile, useGetUser, useSwitchLocale, useButton, useDuplicateRecord, useGet2FAMethods, useGetActionDetail, useGetCalendar, useGetGroups, useGetListData, useGetMenu, useGetPrintReport, useGetProGressBar, useGetResequence, useGetSelection, useGetView, useLoadAction, useLoadMessage, usePrint, useRemoveRow, useRunAction, useSignInSSO, useVerify2FA, useGrantAccess, useRemoveTotpSetup, useRequestSetupTotp, useSettingsWebRead2fa, useVerifyTotp, useUploadFile } from './hooks.js';
@@ -8,15 +9,15 @@ import './models.js';
8
9
 
9
10
  declare const MainProvider: ({ children }: {
10
11
  children: ReactNode;
11
- }) => JSX.Element;
12
+ }) => react_jsx_runtime.JSX.Element;
12
13
 
13
14
  declare const ReactQueryProvider: ({ children }: {
14
15
  children: ReactNode;
15
- }) => JSX.Element;
16
+ }) => react_jsx_runtime.JSX.Element;
16
17
 
17
18
  declare const VersionGate: ({ children }: {
18
19
  children: ReactNode;
19
- }) => JSX.Element | null;
20
+ }) => react_jsx_runtime.JSX.Element | null;
20
21
 
21
22
  interface EnvConfig {
22
23
  env?: any;
@@ -48,7 +49,7 @@ declare function EnvProvider({ children, localStorageUtils: localStorageUtil, se
48
49
  children: React.ReactNode;
49
50
  localStorageUtils?: LocalStorageUtilsType;
50
51
  sessionStorageUtils?: SessionStorageUtilsType;
51
- }): JSX.Element;
52
+ }): react_jsx_runtime.JSX.Element;
52
53
  declare function useEnv(): {
53
54
  env: EnvConfig;
54
55
  setupEnv: (envConfig: Partial<EnvConfig>) => EnvConfig;
@@ -135,12 +136,12 @@ interface ServiceContextType {
135
136
  }
136
137
  declare const ServiceProvider: ({ children, }: {
137
138
  children: React.ReactNode;
138
- }) => JSX.Element;
139
+ }) => react_jsx_runtime.JSX.Element;
139
140
  declare const useService: () => ServiceContextType;
140
141
 
141
142
  type MetaProviderProps = {
142
143
  children: ReactNode;
143
144
  };
144
- declare const MetaProvider: ({ children }: MetaProviderProps) => JSX.Element;
145
+ declare const MetaProvider: ({ children }: MetaProviderProps) => react_jsx_runtime.JSX.Element;
145
146
 
146
147
  export { EnvProvider, MainProvider, MetaProvider, ReactQueryProvider, ServiceProvider, VersionGate, useEnv, useService };
package/dist/provider.js CHANGED
@@ -3251,8 +3251,7 @@ function useAuthService() {
3251
3251
  [env]
3252
3252
  );
3253
3253
  const logout = (0, import_react3.useCallback)(
3254
- async (data) => {
3255
- console.log(data);
3254
+ async (service) => {
3256
3255
  return env?.requests?.post(
3257
3256
  "/logout" /* LOGOUT */,
3258
3257
  {},
@@ -3262,7 +3261,8 @@ function useAuthService() {
3262
3261
  },
3263
3262
  withCredentials: true,
3264
3263
  useRefreshToken: true
3265
- }
3264
+ },
3265
+ service
3266
3266
  );
3267
3267
  },
3268
3268
  [env]
@@ -4777,16 +4777,24 @@ var axiosClient = {
4777
4777
  const service = serviceName || config?.default_service;
4778
4778
  return config?.default_service === "" ? `${baseUrl.replace(/\/$/, "")}/api/v2` : `${baseUrl.replace(/\/$/, "")}/${service}/api/v2`;
4779
4779
  };
4780
+ function normalizeHeaders(headers) {
4781
+ const _header = { ...headers };
4782
+ if ("x_node" in _header) {
4783
+ _header["X-Node"] = _header.x_node;
4784
+ delete _header.x_node;
4785
+ }
4786
+ return _header;
4787
+ }
4780
4788
  const responseBody = (response) => response;
4781
4789
  const requests = {
4782
4790
  get: (url, headers, serviceName) => instance.get(
4783
4791
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
4784
- headers
4792
+ normalizeHeaders(headers)
4785
4793
  ).then(responseBody),
4786
4794
  post: async (url, body, headers, serviceName) => instance.post(
4787
4795
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
4788
4796
  body,
4789
- headers
4797
+ normalizeHeaders(headers)
4790
4798
  ).then(responseBody),
4791
4799
  post_excel: (url, body, headers, serviceName) => instance.post(
4792
4800
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
@@ -4796,23 +4804,23 @@ var axiosClient = {
4796
4804
  headers: {
4797
4805
  "Content-Type": typeof window !== "undefined" ? "application/json" : "application/javascript",
4798
4806
  Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
4799
- ...headers
4807
+ ...normalizeHeaders(headers)
4800
4808
  }
4801
4809
  }
4802
4810
  ).then(responseBody),
4803
4811
  put: (url, body, headers, serviceName) => instance.put(
4804
4812
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
4805
4813
  body,
4806
- headers
4814
+ normalizeHeaders(headers)
4807
4815
  ).then(responseBody),
4808
4816
  patch: (url, body, headers, serviceName) => instance.patch(
4809
4817
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
4810
4818
  body,
4811
- headers
4819
+ normalizeHeaders(headers)
4812
4820
  ).then(responseBody),
4813
4821
  delete: (url, headers, serviceName) => instance.delete(
4814
4822
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
4815
- headers
4823
+ normalizeHeaders(headers)
4816
4824
  ).then(responseBody)
4817
4825
  };
4818
4826
  return requests;
@@ -5073,8 +5081,8 @@ var import_react_query12 = require("@tanstack/react-query");
5073
5081
  var useLogout = () => {
5074
5082
  const { logout } = useAuthService();
5075
5083
  return (0, import_react_query12.useMutation)({
5076
- mutationFn: (data) => {
5077
- return logout(data);
5084
+ mutationFn: (service) => {
5085
+ return logout(service);
5078
5086
  }
5079
5087
  });
5080
5088
  };
package/dist/provider.mjs CHANGED
@@ -3208,8 +3208,7 @@ function useAuthService() {
3208
3208
  [env]
3209
3209
  );
3210
3210
  const logout = useCallback2(
3211
- async (data) => {
3212
- console.log(data);
3211
+ async (service) => {
3213
3212
  return env?.requests?.post(
3214
3213
  "/logout" /* LOGOUT */,
3215
3214
  {},
@@ -3219,7 +3218,8 @@ function useAuthService() {
3219
3218
  },
3220
3219
  withCredentials: true,
3221
3220
  useRefreshToken: true
3222
- }
3221
+ },
3222
+ service
3223
3223
  );
3224
3224
  },
3225
3225
  [env]
@@ -4734,16 +4734,24 @@ var axiosClient = {
4734
4734
  const service = serviceName || config?.default_service;
4735
4735
  return config?.default_service === "" ? `${baseUrl.replace(/\/$/, "")}/api/v2` : `${baseUrl.replace(/\/$/, "")}/${service}/api/v2`;
4736
4736
  };
4737
+ function normalizeHeaders(headers) {
4738
+ const _header = { ...headers };
4739
+ if ("x_node" in _header) {
4740
+ _header["X-Node"] = _header.x_node;
4741
+ delete _header.x_node;
4742
+ }
4743
+ return _header;
4744
+ }
4737
4745
  const responseBody = (response) => response;
4738
4746
  const requests = {
4739
4747
  get: (url, headers, serviceName) => instance.get(
4740
4748
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
4741
- headers
4749
+ normalizeHeaders(headers)
4742
4750
  ).then(responseBody),
4743
4751
  post: async (url, body, headers, serviceName) => instance.post(
4744
4752
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
4745
4753
  body,
4746
- headers
4754
+ normalizeHeaders(headers)
4747
4755
  ).then(responseBody),
4748
4756
  post_excel: (url, body, headers, serviceName) => instance.post(
4749
4757
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
@@ -4753,23 +4761,23 @@ var axiosClient = {
4753
4761
  headers: {
4754
4762
  "Content-Type": typeof window !== "undefined" ? "application/json" : "application/javascript",
4755
4763
  Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
4756
- ...headers
4764
+ ...normalizeHeaders(headers)
4757
4765
  }
4758
4766
  }
4759
4767
  ).then(responseBody),
4760
4768
  put: (url, body, headers, serviceName) => instance.put(
4761
4769
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
4762
4770
  body,
4763
- headers
4771
+ normalizeHeaders(headers)
4764
4772
  ).then(responseBody),
4765
4773
  patch: (url, body, headers, serviceName) => instance.patch(
4766
4774
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
4767
4775
  body,
4768
- headers
4776
+ normalizeHeaders(headers)
4769
4777
  ).then(responseBody),
4770
4778
  delete: (url, headers, serviceName) => instance.delete(
4771
4779
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
4772
- headers
4780
+ normalizeHeaders(headers)
4773
4781
  ).then(responseBody)
4774
4782
  };
4775
4783
  return requests;
@@ -5030,8 +5038,8 @@ import { useMutation as useMutation10 } from "@tanstack/react-query";
5030
5038
  var useLogout = () => {
5031
5039
  const { logout } = useAuthService();
5032
5040
  return useMutation10({
5033
- mutationFn: (data) => {
5034
- return logout(data);
5041
+ mutationFn: (service) => {
5042
+ return logout(service);
5035
5043
  }
5036
5044
  });
5037
5045
  };
@@ -69,7 +69,7 @@ declare function useAuthService(): {
69
69
  }) => Promise<any>;
70
70
  getProviders: (db?: string) => Promise<any>;
71
71
  getAccessByCode: (code: string) => Promise<any>;
72
- logout: (data: string) => Promise<any>;
72
+ logout: (service?: string) => Promise<any>;
73
73
  };
74
74
 
75
75
  declare function useCompanyService(): {
@@ -69,7 +69,7 @@ declare function useAuthService(): {
69
69
  }) => Promise<any>;
70
70
  getProviders: (db?: string) => Promise<any>;
71
71
  getAccessByCode: (code: string) => Promise<any>;
72
- logout: (data: string) => Promise<any>;
72
+ logout: (service?: string) => Promise<any>;
73
73
  };
74
74
 
75
75
  declare function useCompanyService(): {
package/dist/services.js CHANGED
@@ -3421,8 +3421,7 @@ function useAuthService() {
3421
3421
  [env]
3422
3422
  );
3423
3423
  const logout = (0, import_react7.useCallback)(
3424
- async (data) => {
3425
- console.log(data);
3424
+ async (service) => {
3426
3425
  return env?.requests?.post(
3427
3426
  "/logout" /* LOGOUT */,
3428
3427
  {},
@@ -3432,7 +3431,8 @@ function useAuthService() {
3432
3431
  },
3433
3432
  withCredentials: true,
3434
3433
  useRefreshToken: true
3435
- }
3434
+ },
3435
+ service
3436
3436
  );
3437
3437
  },
3438
3438
  [env]
package/dist/services.mjs CHANGED
@@ -3377,8 +3377,7 @@ function useAuthService() {
3377
3377
  [env]
3378
3378
  );
3379
3379
  const logout = useCallback3(
3380
- async (data) => {
3381
- console.log(data);
3380
+ async (service) => {
3382
3381
  return env?.requests?.post(
3383
3382
  "/logout" /* LOGOUT */,
3384
3383
  {},
@@ -3388,7 +3387,8 @@ function useAuthService() {
3388
3387
  },
3389
3388
  withCredentials: true,
3390
3389
  useRefreshToken: true
3391
- }
3390
+ },
3391
+ service
3392
3392
  );
3393
3393
  },
3394
3394
  [env]
package/package.json CHANGED
@@ -1,90 +1,90 @@
1
- {
2
- "name": "@fctc/interface-logic",
3
- "version": "2.4.6",
4
- "types": "dist/index.d.ts",
5
- "main": "dist/index.cjs",
6
- "module": "dist/index.mjs",
7
- "exports": {
8
- ".": {
9
- "types": "./dist/index.d.ts",
10
- "import": "./dist/index.mjs",
11
- "require": "./dist/index.cjs"
12
- },
13
- "./configs": {
14
- "types": "./dist/configs.d.ts",
15
- "import": "./dist/configs.mjs",
16
- "require": "./dist/configs.cjs"
17
- },
18
- "./constants": {
19
- "types": "./dist/constants.d.ts",
20
- "import": "./dist/constants.mjs",
21
- "require": "./dist/constants.cjs"
22
- },
23
- "./environment": {
24
- "types": "./dist/environment.d.ts",
25
- "import": "./dist/environment.mjs",
26
- "require": "./dist/environment.cjs"
27
- },
28
- "./hooks": {
29
- "types": "./dist/hooks.d.ts",
30
- "import": "./dist/hooks.mjs",
31
- "require": "./dist/hooks.cjs"
32
- },
33
- "./provider": {
34
- "types": "./dist/provider.d.ts",
35
- "import": "./dist/provider.mjs",
36
- "require": "./dist/provider.cjs"
37
- },
38
- "./services": {
39
- "types": "./dist/services.d.ts",
40
- "import": "./dist/services.mjs",
41
- "require": "./dist/services.cjs"
42
- },
43
- "./store": {
44
- "types": "./dist/store.d.ts",
45
- "import": "./dist/store.mjs",
46
- "require": "./dist/store.cjs"
47
- },
48
- "./utils": {
49
- "types": "./dist/utils.d.ts",
50
- "import": "./dist/utils.mjs",
51
- "require": "./dist/utils.cjs"
52
- },
53
- "./types": {
54
- "types": "./dist/types.d.ts",
55
- "import": "./dist/types.mjs",
56
- "require": "./dist/types.cjs"
57
- },
58
- "./models": {
59
- "types": "./dist/models.d.ts",
60
- "import": "./dist/models.mjs",
61
- "require": "./dist/models.cjs"
62
- }
63
- },
64
- "files": [
65
- "dist"
66
- ],
67
- "scripts": {
68
- "build": "tsup",
69
- "test": "jest"
70
- },
71
- "peerDependencies": {
72
- "react": "18.0.0",
73
- "@tanstack/react-query": "^5.83.0"
74
- },
75
- "dependencies": {
76
- "@reduxjs/toolkit": "^2.8.2",
77
- "@tanstack/react-query": "^5.83.0",
78
- "axios": "^1.11.0",
79
- "moment": "^2.30.1",
80
- "react-redux": "^9.2.0"
81
- },
82
- "devDependencies": {
83
- "@types/react": "^18.3.1",
84
- "react": "18.0.0",
85
- "jest": "^29.7.0",
86
- "tsup": "^8.0.0",
87
- "typescript": "^5.8.2"
88
- },
89
- "packageManager": "yarn@1.22.0"
90
- }
1
+ {
2
+ "name": "@fctc/interface-logic",
3
+ "version": "2.4.8",
4
+ "types": "dist/index.d.ts",
5
+ "main": "dist/index.cjs",
6
+ "module": "dist/index.mjs",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.mjs",
11
+ "require": "./dist/index.cjs"
12
+ },
13
+ "./configs": {
14
+ "types": "./dist/configs.d.ts",
15
+ "import": "./dist/configs.mjs",
16
+ "require": "./dist/configs.cjs"
17
+ },
18
+ "./constants": {
19
+ "types": "./dist/constants.d.ts",
20
+ "import": "./dist/constants.mjs",
21
+ "require": "./dist/constants.cjs"
22
+ },
23
+ "./environment": {
24
+ "types": "./dist/environment.d.ts",
25
+ "import": "./dist/environment.mjs",
26
+ "require": "./dist/environment.cjs"
27
+ },
28
+ "./hooks": {
29
+ "types": "./dist/hooks.d.ts",
30
+ "import": "./dist/hooks.mjs",
31
+ "require": "./dist/hooks.cjs"
32
+ },
33
+ "./provider": {
34
+ "types": "./dist/provider.d.ts",
35
+ "import": "./dist/provider.mjs",
36
+ "require": "./dist/provider.cjs"
37
+ },
38
+ "./services": {
39
+ "types": "./dist/services.d.ts",
40
+ "import": "./dist/services.mjs",
41
+ "require": "./dist/services.cjs"
42
+ },
43
+ "./store": {
44
+ "types": "./dist/store.d.ts",
45
+ "import": "./dist/store.mjs",
46
+ "require": "./dist/store.cjs"
47
+ },
48
+ "./utils": {
49
+ "types": "./dist/utils.d.ts",
50
+ "import": "./dist/utils.mjs",
51
+ "require": "./dist/utils.cjs"
52
+ },
53
+ "./types": {
54
+ "types": "./dist/types.d.ts",
55
+ "import": "./dist/types.mjs",
56
+ "require": "./dist/types.cjs"
57
+ },
58
+ "./models": {
59
+ "types": "./dist/models.d.ts",
60
+ "import": "./dist/models.mjs",
61
+ "require": "./dist/models.cjs"
62
+ }
63
+ },
64
+ "files": [
65
+ "dist"
66
+ ],
67
+ "scripts": {
68
+ "build": "tsup",
69
+ "test": "jest"
70
+ },
71
+ "peerDependencies": {
72
+ "react": "18.0.0",
73
+ "@tanstack/react-query": "^5.83.0"
74
+ },
75
+ "dependencies": {
76
+ "@reduxjs/toolkit": "^2.8.2",
77
+ "@tanstack/react-query": "^5.83.0",
78
+ "axios": "^1.11.0",
79
+ "moment": "^2.30.1",
80
+ "react-redux": "^9.2.0"
81
+ },
82
+ "devDependencies": {
83
+ "@types/react": "^18.3.1",
84
+ "react": "18.0.0",
85
+ "jest": "^29.7.0",
86
+ "tsup": "^8.0.0",
87
+ "typescript": "^5.8.2"
88
+ },
89
+ "packageManager": "yarn@1.22.0"
90
+ }