@fctc/interface-logic 2.0.4 → 2.1.3

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
@@ -2208,11 +2208,9 @@ var sessionStorageUtils = () => {
2208
2208
  // src/configs/axios-client.ts
2209
2209
  var axiosClient = {
2210
2210
  init(config) {
2211
- console.log("config", config);
2212
2211
  const localStorage2 = config?.localStorageUtils ?? localStorageUtils();
2213
2212
  const sessionStorage2 = config?.sessionStorageUtils ?? sessionStorageUtils();
2214
2213
  const db = config?.db;
2215
- const database = config?.config?.database;
2216
2214
  let isRefreshing = false;
2217
2215
  let failedQueue = [];
2218
2216
  const processQueue = (error, token = null) => {
@@ -2236,10 +2234,6 @@ var axiosClient = {
2236
2234
  if (useActionToken && actionToken) {
2237
2235
  config2.headers["Action-Token"] = actionToken;
2238
2236
  }
2239
- if (database) {
2240
- config2.headers["DATABASE"] = database;
2241
- }
2242
- console.log("database", database);
2243
2237
  const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
2244
2238
  const token = await getToken?.();
2245
2239
  if (token) config2.headers["Authorization"] = `Bearer ${token}`;
package/dist/configs.mjs CHANGED
@@ -2172,11 +2172,9 @@ var sessionStorageUtils = () => {
2172
2172
  // src/configs/axios-client.ts
2173
2173
  var axiosClient = {
2174
2174
  init(config) {
2175
- console.log("config", config);
2176
2175
  const localStorage2 = config?.localStorageUtils ?? localStorageUtils();
2177
2176
  const sessionStorage2 = config?.sessionStorageUtils ?? sessionStorageUtils();
2178
2177
  const db = config?.db;
2179
- const database = config?.config?.database;
2180
2178
  let isRefreshing = false;
2181
2179
  let failedQueue = [];
2182
2180
  const processQueue = (error, token = null) => {
@@ -2200,10 +2198,6 @@ var axiosClient = {
2200
2198
  if (useActionToken && actionToken) {
2201
2199
  config2.headers["Action-Token"] = actionToken;
2202
2200
  }
2203
- if (database) {
2204
- config2.headers["DATABASE"] = database;
2205
- }
2206
- console.log("database", database);
2207
2201
  const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
2208
2202
  const token = await getToken?.();
2209
2203
  if (token) config2.headers["Authorization"] = `Bearer ${token}`;
@@ -19,7 +19,6 @@ interface EnvConfig {
19
19
  companies?: any[];
20
20
  user?: any;
21
21
  db?: string;
22
- database?: string;
23
22
  refreshTokenEndpoint?: string;
24
23
  localStorageUtils?: LocalStorageUtilsType;
25
24
  sessionStorageUtils?: SessionStorageUtilsType;
@@ -19,7 +19,6 @@ interface EnvConfig {
19
19
  companies?: any[];
20
20
  user?: any;
21
21
  db?: string;
22
- database?: string;
23
22
  refreshTokenEndpoint?: string;
24
23
  localStorageUtils?: LocalStorageUtilsType;
25
24
  sessionStorageUtils?: SessionStorageUtilsType;
@@ -2210,11 +2210,9 @@ var sessionStorageUtils = () => {
2210
2210
  // src/configs/axios-client.ts
2211
2211
  var axiosClient = {
2212
2212
  init(config) {
2213
- console.log("config", config);
2214
2213
  const localStorage2 = config?.localStorageUtils ?? localStorageUtils();
2215
2214
  const sessionStorage2 = config?.sessionStorageUtils ?? sessionStorageUtils();
2216
2215
  const db = config?.db;
2217
- const database = config?.config?.database;
2218
2216
  let isRefreshing = false;
2219
2217
  let failedQueue = [];
2220
2218
  const processQueue = (error, token = null) => {
@@ -2238,10 +2236,6 @@ var axiosClient = {
2238
2236
  if (useActionToken && actionToken) {
2239
2237
  config2.headers["Action-Token"] = actionToken;
2240
2238
  }
2241
- if (database) {
2242
- config2.headers["DATABASE"] = database;
2243
- }
2244
- console.log("database", database);
2245
2239
  const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
2246
2240
  const token = await getToken?.();
2247
2241
  if (token) config2.headers["Authorization"] = `Bearer ${token}`;
@@ -2172,11 +2172,9 @@ var sessionStorageUtils = () => {
2172
2172
  // src/configs/axios-client.ts
2173
2173
  var axiosClient = {
2174
2174
  init(config) {
2175
- console.log("config", config);
2176
2175
  const localStorage2 = config?.localStorageUtils ?? localStorageUtils();
2177
2176
  const sessionStorage2 = config?.sessionStorageUtils ?? sessionStorageUtils();
2178
2177
  const db = config?.db;
2179
- const database = config?.config?.database;
2180
2178
  let isRefreshing = false;
2181
2179
  let failedQueue = [];
2182
2180
  const processQueue = (error, token = null) => {
@@ -2200,10 +2198,6 @@ var axiosClient = {
2200
2198
  if (useActionToken && actionToken) {
2201
2199
  config2.headers["Action-Token"] = actionToken;
2202
2200
  }
2203
- if (database) {
2204
- config2.headers["DATABASE"] = database;
2205
- }
2206
- console.log("database", database);
2207
2201
  const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
2208
2202
  const token = await getToken?.();
2209
2203
  if (token) config2.headers["Authorization"] = `Bearer ${token}`;
package/dist/hooks.d.mts CHANGED
@@ -134,7 +134,7 @@ declare const useSendComment: () => _tanstack_react_query.UseMutationResult<any,
134
134
  }, unknown>;
135
135
 
136
136
  declare const useUploadImage: () => _tanstack_react_query.UseMutationResult<any, Error, {
137
- data: any;
137
+ formData: any;
138
138
  }, unknown>;
139
139
 
140
140
  declare const useDelete: () => _tanstack_react_query.UseMutationResult<any, Error, {
@@ -314,7 +314,6 @@ declare const useSignInSSO: () => _tanstack_react_query.UseMutationResult<any, E
314
314
  client_id: string;
315
315
  response_type: string;
316
316
  path: string;
317
- scope: string;
318
317
  }, unknown>;
319
318
 
320
319
  declare const useVerify2FA: () => _tanstack_react_query.UseMutationResult<unknown, Error, {
package/dist/hooks.d.ts CHANGED
@@ -134,7 +134,7 @@ declare const useSendComment: () => _tanstack_react_query.UseMutationResult<any,
134
134
  }, unknown>;
135
135
 
136
136
  declare const useUploadImage: () => _tanstack_react_query.UseMutationResult<any, Error, {
137
- data: any;
137
+ formData: any;
138
138
  }, unknown>;
139
139
 
140
140
  declare const useDelete: () => _tanstack_react_query.UseMutationResult<any, Error, {
@@ -314,7 +314,6 @@ declare const useSignInSSO: () => _tanstack_react_query.UseMutationResult<any, E
314
314
  client_id: string;
315
315
  response_type: string;
316
316
  path: string;
317
- scope: string;
318
317
  }, unknown>;
319
318
 
320
319
  declare const useVerify2FA: () => _tanstack_react_query.UseMutationResult<unknown, Error, {
package/dist/hooks.js CHANGED
@@ -3342,11 +3342,7 @@ function useExcelService() {
3342
3342
  const { env } = useEnv();
3343
3343
  const uploadFile = (0, import_react9.useCallback)(
3344
3344
  async ({ formData }) => {
3345
- return env.requests.post("/upload/file" /* UPLOAD_FILE_PATH */, formData, {
3346
- headers: {
3347
- "Content-Type": "multipart/form-data"
3348
- }
3349
- });
3345
+ return env.requests.post("/upload/file" /* UPLOAD_FILE_PATH */, formData);
3350
3346
  },
3351
3347
  [env]
3352
3348
  );
@@ -3590,12 +3586,8 @@ function useFormService() {
3590
3586
  [env]
3591
3587
  );
3592
3588
  const uploadImage = (0, import_react10.useCallback)(
3593
- async ({ data }) => {
3594
- return env.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
3595
- headers: {
3596
- "Content-Type": "multipart/form-data"
3597
- }
3598
- });
3589
+ async ({ formData }) => {
3590
+ return env.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, formData);
3599
3591
  },
3600
3592
  [env]
3601
3593
  );
@@ -4449,25 +4441,18 @@ function useViewService() {
4449
4441
  redirect_uri,
4450
4442
  state,
4451
4443
  client_id,
4452
- response_type,
4453
- path,
4454
- scope
4444
+ response_type
4455
4445
  }) => {
4456
- const params = new URLSearchParams({
4457
- response_type,
4458
- client_id,
4446
+ const jsonData = {
4459
4447
  redirect_uri,
4460
- state
4461
- });
4462
- const queryString = `${params.toString()}&scope=${encodeURIComponent(
4463
- scope
4464
- )}`;
4465
- const url = `${path}?${queryString}`;
4466
- return env?.requests.get(url, {
4448
+ state,
4449
+ client_id,
4450
+ response_type
4451
+ };
4452
+ return env?.requests.get("/signin-sso/oauth" /* SIGNIN_SSO */, jsonData, {
4467
4453
  headers: {
4468
- "Content-Type": "application/json"
4469
- },
4470
- withCredentials: true
4454
+ credentials: "include"
4455
+ }
4471
4456
  });
4472
4457
  },
4473
4458
  [env]
@@ -5006,8 +4991,8 @@ var import_react_query31 = require("@tanstack/react-query");
5006
4991
  var useUploadImage = () => {
5007
4992
  const { uploadImage } = useFormService();
5008
4993
  return (0, import_react_query31.useMutation)({
5009
- mutationFn: ({ data }) => uploadImage({
5010
- data
4994
+ mutationFn: ({ formData }) => uploadImage({
4995
+ formData
5011
4996
  })
5012
4997
  });
5013
4998
  };
@@ -5401,6 +5386,7 @@ var useGetActionDetail = ({
5401
5386
  model,
5402
5387
  queryKey
5403
5388
  }) => {
5389
+ const { getFormView } = useFormService();
5404
5390
  const { getActionDetail } = useViewService();
5405
5391
  const data = {
5406
5392
  id,
@@ -5415,6 +5401,9 @@ var useGetActionDetail = ({
5415
5401
  if (res && res.length > 0) {
5416
5402
  return res[0];
5417
5403
  }
5404
+ } else {
5405
+ const res = await getFormView({ data });
5406
+ return res;
5418
5407
  }
5419
5408
  },
5420
5409
  enabled,
@@ -5680,16 +5669,13 @@ var useSignInSSO = () => {
5680
5669
  state,
5681
5670
  client_id,
5682
5671
  response_type,
5683
- path,
5684
- scope
5672
+ path
5685
5673
  }) => {
5686
5674
  return signInSSO({
5687
5675
  redirect_uri,
5688
5676
  state,
5689
5677
  client_id,
5690
- response_type,
5691
- path,
5692
- scope
5678
+ response_type
5693
5679
  });
5694
5680
  }
5695
5681
  });
package/dist/hooks.mjs CHANGED
@@ -3239,11 +3239,7 @@ function useExcelService() {
3239
3239
  const { env } = useEnv();
3240
3240
  const uploadFile = useCallback5(
3241
3241
  async ({ formData }) => {
3242
- return env.requests.post("/upload/file" /* UPLOAD_FILE_PATH */, formData, {
3243
- headers: {
3244
- "Content-Type": "multipart/form-data"
3245
- }
3246
- });
3242
+ return env.requests.post("/upload/file" /* UPLOAD_FILE_PATH */, formData);
3247
3243
  },
3248
3244
  [env]
3249
3245
  );
@@ -3487,12 +3483,8 @@ function useFormService() {
3487
3483
  [env]
3488
3484
  );
3489
3485
  const uploadImage = useCallback6(
3490
- async ({ data }) => {
3491
- return env.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
3492
- headers: {
3493
- "Content-Type": "multipart/form-data"
3494
- }
3495
- });
3486
+ async ({ formData }) => {
3487
+ return env.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, formData);
3496
3488
  },
3497
3489
  [env]
3498
3490
  );
@@ -4346,25 +4338,18 @@ function useViewService() {
4346
4338
  redirect_uri,
4347
4339
  state,
4348
4340
  client_id,
4349
- response_type,
4350
- path,
4351
- scope
4341
+ response_type
4352
4342
  }) => {
4353
- const params = new URLSearchParams({
4354
- response_type,
4355
- client_id,
4343
+ const jsonData = {
4356
4344
  redirect_uri,
4357
- state
4358
- });
4359
- const queryString = `${params.toString()}&scope=${encodeURIComponent(
4360
- scope
4361
- )}`;
4362
- const url = `${path}?${queryString}`;
4363
- return env?.requests.get(url, {
4345
+ state,
4346
+ client_id,
4347
+ response_type
4348
+ };
4349
+ return env?.requests.get("/signin-sso/oauth" /* SIGNIN_SSO */, jsonData, {
4364
4350
  headers: {
4365
- "Content-Type": "application/json"
4366
- },
4367
- withCredentials: true
4351
+ credentials: "include"
4352
+ }
4368
4353
  });
4369
4354
  },
4370
4355
  [env]
@@ -4903,8 +4888,8 @@ import { useMutation as useMutation24 } from "@tanstack/react-query";
4903
4888
  var useUploadImage = () => {
4904
4889
  const { uploadImage } = useFormService();
4905
4890
  return useMutation24({
4906
- mutationFn: ({ data }) => uploadImage({
4907
- data
4891
+ mutationFn: ({ formData }) => uploadImage({
4892
+ formData
4908
4893
  })
4909
4894
  });
4910
4895
  };
@@ -5298,6 +5283,7 @@ var useGetActionDetail = ({
5298
5283
  model,
5299
5284
  queryKey
5300
5285
  }) => {
5286
+ const { getFormView } = useFormService();
5301
5287
  const { getActionDetail } = useViewService();
5302
5288
  const data = {
5303
5289
  id,
@@ -5312,6 +5298,9 @@ var useGetActionDetail = ({
5312
5298
  if (res && res.length > 0) {
5313
5299
  return res[0];
5314
5300
  }
5301
+ } else {
5302
+ const res = await getFormView({ data });
5303
+ return res;
5315
5304
  }
5316
5305
  },
5317
5306
  enabled,
@@ -5577,16 +5566,13 @@ var useSignInSSO = () => {
5577
5566
  state,
5578
5567
  client_id,
5579
5568
  response_type,
5580
- path,
5581
- scope
5569
+ path
5582
5570
  }) => {
5583
5571
  return signInSSO({
5584
5572
  redirect_uri,
5585
5573
  state,
5586
5574
  client_id,
5587
- response_type,
5588
- path,
5589
- scope
5575
+ response_type
5590
5576
  });
5591
5577
  }
5592
5578
  });
@@ -1,4 +1,3 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import { ReactNode } from 'react';
3
2
  import { L as LocalStorageUtilsType, S as SessionStorageUtilsType } from './session-storage-ARp_lhTD.mjs';
4
3
  import { useForgotPassword, useForgotPasswordSSO, useGetProvider, useIsValidToken, useLoginCredential, useLoginSocial, useResetPassword, useResetPasswordSSO, useUpdatePassword, useLogout, useGetAccessByCode, useValidateActionToken, useGetCompanyInfo, useGetCurrentCompany, useGetListCompany, useExecuteImport, useExportExcel, useGetFieldExport, useGetFileExcel, useParsePreview, useUploadFile, 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 } from './hooks.mjs';
@@ -7,15 +6,15 @@ import './view-type-BGJfDe73.mjs';
7
6
 
8
7
  declare const MainProvider: ({ children }: {
9
8
  children: ReactNode;
10
- }) => react_jsx_runtime.JSX.Element;
9
+ }) => JSX.Element;
11
10
 
12
11
  declare const ReactQueryProvider: ({ children }: {
13
12
  children: ReactNode;
14
- }) => react_jsx_runtime.JSX.Element;
13
+ }) => JSX.Element;
15
14
 
16
15
  declare const VersionGate: ({ children }: {
17
16
  children: ReactNode;
18
- }) => react_jsx_runtime.JSX.Element | null;
17
+ }) => JSX.Element | null;
19
18
 
20
19
  interface EnvConfig {
21
20
  env?: any;
@@ -46,7 +45,7 @@ declare function EnvProvider({ children, localStorageUtils: localStorageUtil, se
46
45
  children: React.ReactNode;
47
46
  localStorageUtils?: LocalStorageUtilsType;
48
47
  sessionStorageUtils?: SessionStorageUtilsType;
49
- }): react_jsx_runtime.JSX.Element;
48
+ }): JSX.Element;
50
49
  declare function useEnv(): {
51
50
  env: EnvConfig;
52
51
  setupEnv: (envConfig: Partial<EnvConfig>) => EnvConfig;
@@ -132,12 +131,12 @@ interface ServiceContextType {
132
131
  }
133
132
  declare const ServiceProvider: ({ children, }: {
134
133
  children: React.ReactNode;
135
- }) => react_jsx_runtime.JSX.Element;
134
+ }) => JSX.Element;
136
135
  declare const useService: () => ServiceContextType;
137
136
 
138
137
  type MetaProviderProps = {
139
138
  children: ReactNode;
140
139
  };
141
- declare const MetaProvider: ({ children }: MetaProviderProps) => react_jsx_runtime.JSX.Element;
140
+ declare const MetaProvider: ({ children }: MetaProviderProps) => JSX.Element;
142
141
 
143
142
  export { EnvProvider, MainProvider, MetaProvider, ReactQueryProvider, ServiceProvider, VersionGate, useEnv, useService };
@@ -1,4 +1,3 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import { ReactNode } from 'react';
3
2
  import { L as LocalStorageUtilsType, S as SessionStorageUtilsType } from './session-storage-ARp_lhTD.js';
4
3
  import { useForgotPassword, useForgotPasswordSSO, useGetProvider, useIsValidToken, useLoginCredential, useLoginSocial, useResetPassword, useResetPasswordSSO, useUpdatePassword, useLogout, useGetAccessByCode, useValidateActionToken, useGetCompanyInfo, useGetCurrentCompany, useGetListCompany, useExecuteImport, useExportExcel, useGetFieldExport, useGetFileExcel, useParsePreview, useUploadFile, 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 } from './hooks.js';
@@ -7,15 +6,15 @@ import './view-type-BGJfDe73.js';
7
6
 
8
7
  declare const MainProvider: ({ children }: {
9
8
  children: ReactNode;
10
- }) => react_jsx_runtime.JSX.Element;
9
+ }) => JSX.Element;
11
10
 
12
11
  declare const ReactQueryProvider: ({ children }: {
13
12
  children: ReactNode;
14
- }) => react_jsx_runtime.JSX.Element;
13
+ }) => JSX.Element;
15
14
 
16
15
  declare const VersionGate: ({ children }: {
17
16
  children: ReactNode;
18
- }) => react_jsx_runtime.JSX.Element | null;
17
+ }) => JSX.Element | null;
19
18
 
20
19
  interface EnvConfig {
21
20
  env?: any;
@@ -46,7 +45,7 @@ declare function EnvProvider({ children, localStorageUtils: localStorageUtil, se
46
45
  children: React.ReactNode;
47
46
  localStorageUtils?: LocalStorageUtilsType;
48
47
  sessionStorageUtils?: SessionStorageUtilsType;
49
- }): react_jsx_runtime.JSX.Element;
48
+ }): JSX.Element;
50
49
  declare function useEnv(): {
51
50
  env: EnvConfig;
52
51
  setupEnv: (envConfig: Partial<EnvConfig>) => EnvConfig;
@@ -132,12 +131,12 @@ interface ServiceContextType {
132
131
  }
133
132
  declare const ServiceProvider: ({ children, }: {
134
133
  children: React.ReactNode;
135
- }) => react_jsx_runtime.JSX.Element;
134
+ }) => JSX.Element;
136
135
  declare const useService: () => ServiceContextType;
137
136
 
138
137
  type MetaProviderProps = {
139
138
  children: ReactNode;
140
139
  };
141
- declare const MetaProvider: ({ children }: MetaProviderProps) => react_jsx_runtime.JSX.Element;
140
+ declare const MetaProvider: ({ children }: MetaProviderProps) => JSX.Element;
142
141
 
143
142
  export { EnvProvider, MainProvider, MetaProvider, ReactQueryProvider, ServiceProvider, VersionGate, useEnv, useService };
package/dist/provider.js CHANGED
@@ -3291,11 +3291,7 @@ function useExcelService() {
3291
3291
  const { env } = useEnv();
3292
3292
  const uploadFile = (0, import_react5.useCallback)(
3293
3293
  async ({ formData }) => {
3294
- return env.requests.post("/upload/file" /* UPLOAD_FILE_PATH */, formData, {
3295
- headers: {
3296
- "Content-Type": "multipart/form-data"
3297
- }
3298
- });
3294
+ return env.requests.post("/upload/file" /* UPLOAD_FILE_PATH */, formData);
3299
3295
  },
3300
3296
  [env]
3301
3297
  );
@@ -3539,12 +3535,8 @@ function useFormService() {
3539
3535
  [env]
3540
3536
  );
3541
3537
  const uploadImage = (0, import_react6.useCallback)(
3542
- async ({ data }) => {
3543
- return env.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
3544
- headers: {
3545
- "Content-Type": "multipart/form-data"
3546
- }
3547
- });
3538
+ async ({ formData }) => {
3539
+ return env.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, formData);
3548
3540
  },
3549
3541
  [env]
3550
3542
  );
@@ -4398,25 +4390,18 @@ function useViewService() {
4398
4390
  redirect_uri,
4399
4391
  state,
4400
4392
  client_id,
4401
- response_type,
4402
- path,
4403
- scope
4393
+ response_type
4404
4394
  }) => {
4405
- const params = new URLSearchParams({
4406
- response_type,
4407
- client_id,
4395
+ const jsonData = {
4408
4396
  redirect_uri,
4409
- state
4410
- });
4411
- const queryString = `${params.toString()}&scope=${encodeURIComponent(
4412
- scope
4413
- )}`;
4414
- const url = `${path}?${queryString}`;
4415
- return env?.requests.get(url, {
4397
+ state,
4398
+ client_id,
4399
+ response_type
4400
+ };
4401
+ return env?.requests.get("/signin-sso/oauth" /* SIGNIN_SSO */, jsonData, {
4416
4402
  headers: {
4417
- "Content-Type": "application/json"
4418
- },
4419
- withCredentials: true
4403
+ credentials: "include"
4404
+ }
4420
4405
  });
4421
4406
  },
4422
4407
  [env]
@@ -4589,11 +4574,9 @@ var sessionStorageUtils = () => {
4589
4574
  // src/configs/axios-client.ts
4590
4575
  var axiosClient = {
4591
4576
  init(config) {
4592
- console.log("config", config);
4593
4577
  const localStorage2 = config?.localStorageUtils ?? localStorageUtils();
4594
4578
  const sessionStorage2 = config?.sessionStorageUtils ?? sessionStorageUtils();
4595
4579
  const db = config?.db;
4596
- const database = config?.config?.database;
4597
4580
  let isRefreshing = false;
4598
4581
  let failedQueue = [];
4599
4582
  const processQueue = (error, token = null) => {
@@ -4617,10 +4600,6 @@ var axiosClient = {
4617
4600
  if (useActionToken && actionToken) {
4618
4601
  config2.headers["Action-Token"] = actionToken;
4619
4602
  }
4620
- if (database) {
4621
- config2.headers["DATABASE"] = database;
4622
- }
4623
- console.log("database", database);
4624
4603
  const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
4625
4604
  const token = await getToken?.();
4626
4605
  if (token) config2.headers["Authorization"] = `Bearer ${token}`;
@@ -5343,8 +5322,8 @@ var import_react_query31 = require("@tanstack/react-query");
5343
5322
  var useUploadImage = () => {
5344
5323
  const { uploadImage } = useFormService();
5345
5324
  return (0, import_react_query31.useMutation)({
5346
- mutationFn: ({ data }) => uploadImage({
5347
- data
5325
+ mutationFn: ({ formData }) => uploadImage({
5326
+ formData
5348
5327
  })
5349
5328
  });
5350
5329
  };
@@ -5738,6 +5717,7 @@ var useGetActionDetail = ({
5738
5717
  model,
5739
5718
  queryKey
5740
5719
  }) => {
5720
+ const { getFormView } = useFormService();
5741
5721
  const { getActionDetail } = useViewService();
5742
5722
  const data = {
5743
5723
  id,
@@ -5752,6 +5732,9 @@ var useGetActionDetail = ({
5752
5732
  if (res && res.length > 0) {
5753
5733
  return res[0];
5754
5734
  }
5735
+ } else {
5736
+ const res = await getFormView({ data });
5737
+ return res;
5755
5738
  }
5756
5739
  },
5757
5740
  enabled,
@@ -6017,16 +6000,13 @@ var useSignInSSO = () => {
6017
6000
  state,
6018
6001
  client_id,
6019
6002
  response_type,
6020
- path,
6021
- scope
6003
+ path
6022
6004
  }) => {
6023
6005
  return signInSSO({
6024
6006
  redirect_uri,
6025
6007
  state,
6026
6008
  client_id,
6027
- response_type,
6028
- path,
6029
- scope
6009
+ response_type
6030
6010
  });
6031
6011
  }
6032
6012
  });
package/dist/provider.mjs CHANGED
@@ -3248,11 +3248,7 @@ function useExcelService() {
3248
3248
  const { env } = useEnv();
3249
3249
  const uploadFile = useCallback4(
3250
3250
  async ({ formData }) => {
3251
- return env.requests.post("/upload/file" /* UPLOAD_FILE_PATH */, formData, {
3252
- headers: {
3253
- "Content-Type": "multipart/form-data"
3254
- }
3255
- });
3251
+ return env.requests.post("/upload/file" /* UPLOAD_FILE_PATH */, formData);
3256
3252
  },
3257
3253
  [env]
3258
3254
  );
@@ -3496,12 +3492,8 @@ function useFormService() {
3496
3492
  [env]
3497
3493
  );
3498
3494
  const uploadImage = useCallback5(
3499
- async ({ data }) => {
3500
- return env.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
3501
- headers: {
3502
- "Content-Type": "multipart/form-data"
3503
- }
3504
- });
3495
+ async ({ formData }) => {
3496
+ return env.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, formData);
3505
3497
  },
3506
3498
  [env]
3507
3499
  );
@@ -4355,25 +4347,18 @@ function useViewService() {
4355
4347
  redirect_uri,
4356
4348
  state,
4357
4349
  client_id,
4358
- response_type,
4359
- path,
4360
- scope
4350
+ response_type
4361
4351
  }) => {
4362
- const params = new URLSearchParams({
4363
- response_type,
4364
- client_id,
4352
+ const jsonData = {
4365
4353
  redirect_uri,
4366
- state
4367
- });
4368
- const queryString = `${params.toString()}&scope=${encodeURIComponent(
4369
- scope
4370
- )}`;
4371
- const url = `${path}?${queryString}`;
4372
- return env?.requests.get(url, {
4354
+ state,
4355
+ client_id,
4356
+ response_type
4357
+ };
4358
+ return env?.requests.get("/signin-sso/oauth" /* SIGNIN_SSO */, jsonData, {
4373
4359
  headers: {
4374
- "Content-Type": "application/json"
4375
- },
4376
- withCredentials: true
4360
+ credentials: "include"
4361
+ }
4377
4362
  });
4378
4363
  },
4379
4364
  [env]
@@ -4546,11 +4531,9 @@ var sessionStorageUtils = () => {
4546
4531
  // src/configs/axios-client.ts
4547
4532
  var axiosClient = {
4548
4533
  init(config) {
4549
- console.log("config", config);
4550
4534
  const localStorage2 = config?.localStorageUtils ?? localStorageUtils();
4551
4535
  const sessionStorage2 = config?.sessionStorageUtils ?? sessionStorageUtils();
4552
4536
  const db = config?.db;
4553
- const database = config?.config?.database;
4554
4537
  let isRefreshing = false;
4555
4538
  let failedQueue = [];
4556
4539
  const processQueue = (error, token = null) => {
@@ -4574,10 +4557,6 @@ var axiosClient = {
4574
4557
  if (useActionToken && actionToken) {
4575
4558
  config2.headers["Action-Token"] = actionToken;
4576
4559
  }
4577
- if (database) {
4578
- config2.headers["DATABASE"] = database;
4579
- }
4580
- console.log("database", database);
4581
4560
  const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
4582
4561
  const token = await getToken?.();
4583
4562
  if (token) config2.headers["Authorization"] = `Bearer ${token}`;
@@ -5300,8 +5279,8 @@ import { useMutation as useMutation24 } from "@tanstack/react-query";
5300
5279
  var useUploadImage = () => {
5301
5280
  const { uploadImage } = useFormService();
5302
5281
  return useMutation24({
5303
- mutationFn: ({ data }) => uploadImage({
5304
- data
5282
+ mutationFn: ({ formData }) => uploadImage({
5283
+ formData
5305
5284
  })
5306
5285
  });
5307
5286
  };
@@ -5695,6 +5674,7 @@ var useGetActionDetail = ({
5695
5674
  model,
5696
5675
  queryKey
5697
5676
  }) => {
5677
+ const { getFormView } = useFormService();
5698
5678
  const { getActionDetail } = useViewService();
5699
5679
  const data = {
5700
5680
  id,
@@ -5709,6 +5689,9 @@ var useGetActionDetail = ({
5709
5689
  if (res && res.length > 0) {
5710
5690
  return res[0];
5711
5691
  }
5692
+ } else {
5693
+ const res = await getFormView({ data });
5694
+ return res;
5712
5695
  }
5713
5696
  },
5714
5697
  enabled,
@@ -5974,16 +5957,13 @@ var useSignInSSO = () => {
5974
5957
  state,
5975
5958
  client_id,
5976
5959
  response_type,
5977
- path,
5978
- scope
5960
+ path
5979
5961
  }) => {
5980
5962
  return signInSSO({
5981
5963
  redirect_uri,
5982
5964
  state,
5983
5965
  client_id,
5984
- response_type,
5985
- path,
5986
- scope
5966
+ response_type
5987
5967
  });
5988
5968
  }
5989
5969
  });
@@ -131,8 +131,8 @@ declare function useFormService(): {
131
131
  getImage: ({ data }: {
132
132
  data: any;
133
133
  }) => Promise<any>;
134
- uploadImage: ({ data }: {
135
- data: any;
134
+ uploadImage: ({ formData }: {
135
+ formData: any;
136
136
  }) => Promise<any>;
137
137
  getFormView: ({ data }: {
138
138
  data: TFormView;
@@ -229,13 +229,11 @@ declare function useViewService(): {
229
229
  kwargs: any;
230
230
  model: string;
231
231
  }) => Promise<any>;
232
- signInSSO: ({ redirect_uri, state, client_id, response_type, path, scope, }: {
232
+ signInSSO: ({ redirect_uri, state, client_id, response_type, }: {
233
233
  redirect_uri: string;
234
234
  state: string;
235
235
  client_id: string;
236
236
  response_type: string;
237
- path: string;
238
- scope: string;
239
237
  }) => Promise<any>;
240
238
  verify2FA: ({ method, with_context, code, device, location, }: {
241
239
  method: string;
@@ -131,8 +131,8 @@ declare function useFormService(): {
131
131
  getImage: ({ data }: {
132
132
  data: any;
133
133
  }) => Promise<any>;
134
- uploadImage: ({ data }: {
135
- data: any;
134
+ uploadImage: ({ formData }: {
135
+ formData: any;
136
136
  }) => Promise<any>;
137
137
  getFormView: ({ data }: {
138
138
  data: TFormView;
@@ -229,13 +229,11 @@ declare function useViewService(): {
229
229
  kwargs: any;
230
230
  model: string;
231
231
  }) => Promise<any>;
232
- signInSSO: ({ redirect_uri, state, client_id, response_type, path, scope, }: {
232
+ signInSSO: ({ redirect_uri, state, client_id, response_type, }: {
233
233
  redirect_uri: string;
234
234
  state: string;
235
235
  client_id: string;
236
236
  response_type: string;
237
- path: string;
238
- scope: string;
239
237
  }) => Promise<any>;
240
238
  verify2FA: ({ method, with_context, code, device, location, }: {
241
239
  method: string;
package/dist/services.js CHANGED
@@ -3458,11 +3458,7 @@ function useExcelService() {
3458
3458
  const { env } = useEnv();
3459
3459
  const uploadFile = (0, import_react9.useCallback)(
3460
3460
  async ({ formData }) => {
3461
- return env.requests.post("/upload/file" /* UPLOAD_FILE_PATH */, formData, {
3462
- headers: {
3463
- "Content-Type": "multipart/form-data"
3464
- }
3465
- });
3461
+ return env.requests.post("/upload/file" /* UPLOAD_FILE_PATH */, formData);
3466
3462
  },
3467
3463
  [env]
3468
3464
  );
@@ -3706,12 +3702,8 @@ function useFormService() {
3706
3702
  [env]
3707
3703
  );
3708
3704
  const uploadImage = (0, import_react10.useCallback)(
3709
- async ({ data }) => {
3710
- return env.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
3711
- headers: {
3712
- "Content-Type": "multipart/form-data"
3713
- }
3714
- });
3705
+ async ({ formData }) => {
3706
+ return env.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, formData);
3715
3707
  },
3716
3708
  [env]
3717
3709
  );
@@ -4565,25 +4557,18 @@ function useViewService() {
4565
4557
  redirect_uri,
4566
4558
  state,
4567
4559
  client_id,
4568
- response_type,
4569
- path,
4570
- scope
4560
+ response_type
4571
4561
  }) => {
4572
- const params = new URLSearchParams({
4573
- response_type,
4574
- client_id,
4562
+ const jsonData = {
4575
4563
  redirect_uri,
4576
- state
4577
- });
4578
- const queryString = `${params.toString()}&scope=${encodeURIComponent(
4579
- scope
4580
- )}`;
4581
- const url = `${path}?${queryString}`;
4582
- return env?.requests.get(url, {
4564
+ state,
4565
+ client_id,
4566
+ response_type
4567
+ };
4568
+ return env?.requests.get("/signin-sso/oauth" /* SIGNIN_SSO */, jsonData, {
4583
4569
  headers: {
4584
- "Content-Type": "application/json"
4585
- },
4586
- withCredentials: true
4570
+ credentials: "include"
4571
+ }
4587
4572
  });
4588
4573
  },
4589
4574
  [env]
package/dist/services.mjs CHANGED
@@ -3414,11 +3414,7 @@ function useExcelService() {
3414
3414
  const { env } = useEnv();
3415
3415
  const uploadFile = useCallback5(
3416
3416
  async ({ formData }) => {
3417
- return env.requests.post("/upload/file" /* UPLOAD_FILE_PATH */, formData, {
3418
- headers: {
3419
- "Content-Type": "multipart/form-data"
3420
- }
3421
- });
3417
+ return env.requests.post("/upload/file" /* UPLOAD_FILE_PATH */, formData);
3422
3418
  },
3423
3419
  [env]
3424
3420
  );
@@ -3662,12 +3658,8 @@ function useFormService() {
3662
3658
  [env]
3663
3659
  );
3664
3660
  const uploadImage = useCallback6(
3665
- async ({ data }) => {
3666
- return env.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
3667
- headers: {
3668
- "Content-Type": "multipart/form-data"
3669
- }
3670
- });
3661
+ async ({ formData }) => {
3662
+ return env.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, formData);
3671
3663
  },
3672
3664
  [env]
3673
3665
  );
@@ -4521,25 +4513,18 @@ function useViewService() {
4521
4513
  redirect_uri,
4522
4514
  state,
4523
4515
  client_id,
4524
- response_type,
4525
- path,
4526
- scope
4516
+ response_type
4527
4517
  }) => {
4528
- const params = new URLSearchParams({
4529
- response_type,
4530
- client_id,
4518
+ const jsonData = {
4531
4519
  redirect_uri,
4532
- state
4533
- });
4534
- const queryString = `${params.toString()}&scope=${encodeURIComponent(
4535
- scope
4536
- )}`;
4537
- const url = `${path}?${queryString}`;
4538
- return env?.requests.get(url, {
4520
+ state,
4521
+ client_id,
4522
+ response_type
4523
+ };
4524
+ return env?.requests.get("/signin-sso/oauth" /* SIGNIN_SSO */, jsonData, {
4539
4525
  headers: {
4540
- "Content-Type": "application/json"
4541
- },
4542
- withCredentials: true
4526
+ credentials: "include"
4527
+ }
4543
4528
  });
4544
4529
  },
4545
4530
  [env]
package/dist/types.d.mts CHANGED
@@ -5,7 +5,6 @@ interface Config {
5
5
  grantType: string;
6
6
  clientId: string;
7
7
  clientSecret: string;
8
- database: string;
9
8
  }
10
9
 
11
10
  interface Context {
package/dist/types.d.ts CHANGED
@@ -5,7 +5,6 @@ interface Config {
5
5
  grantType: string;
6
6
  clientId: string;
7
7
  clientSecret: string;
8
- database: string;
9
8
  }
10
9
 
11
10
  interface Context {
package/package.json CHANGED
@@ -1,85 +1,85 @@
1
- {
2
- "name": "@fctc/interface-logic",
3
- "version": "2.0.4",
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
- },
59
- "files": [
60
- "dist"
61
- ],
62
- "scripts": {
63
- "build": "tsup",
64
- "test": "jest"
65
- },
66
- "peerDependencies": {
67
- "react": "18.0.0",
68
- "@tanstack/react-query": "^5.83.0"
69
- },
70
- "dependencies": {
71
- "@reduxjs/toolkit": "^2.8.2",
72
- "@tanstack/react-query": "^5.83.0",
73
- "axios": "^1.11.0",
74
- "moment": "^2.30.1",
75
- "react-redux": "^9.2.0"
76
- },
77
- "devDependencies": {
78
- "@types/react": "^18.3.1",
79
- "react": "18.0.0",
80
- "jest": "^29.7.0",
81
- "tsup": "^8.0.0",
82
- "typescript": "^5.8.2"
83
- },
84
- "packageManager": "yarn@1.22.0"
85
- }
1
+ {
2
+ "name": "@fctc/interface-logic",
3
+ "version": "2.1.3",
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
+ },
59
+ "files": [
60
+ "dist"
61
+ ],
62
+ "scripts": {
63
+ "build": "tsup",
64
+ "test": "jest"
65
+ },
66
+ "peerDependencies": {
67
+ "react": "18.0.0",
68
+ "@tanstack/react-query": "^5.83.0"
69
+ },
70
+ "dependencies": {
71
+ "@reduxjs/toolkit": "^2.8.2",
72
+ "@tanstack/react-query": "^5.83.0",
73
+ "axios": "^1.11.0",
74
+ "moment": "^2.30.1",
75
+ "react-redux": "^9.2.0"
76
+ },
77
+ "devDependencies": {
78
+ "@types/react": "^18.3.1",
79
+ "react": "18.0.0",
80
+ "jest": "^29.7.0",
81
+ "tsup": "^8.0.0",
82
+ "typescript": "^5.8.2"
83
+ },
84
+ "packageManager": "yarn@1.22.0"
85
+ }