@fctc/interface-logic 1.9.10 → 1.10.0

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/hooks.mjs CHANGED
@@ -4117,6 +4117,9 @@ var useIsValidToken = () => {
4117
4117
  };
4118
4118
  var use_isvalid_token_default = useIsValidToken;
4119
4119
 
4120
+ // src/hooks/auth/use-login-credential.tsx
4121
+ import { useMutation as useMutation5 } from "@tanstack/react-query";
4122
+
4120
4123
  // src/services/auth-service/backup.ts
4121
4124
  import { useCallback as useCallback3 } from "react";
4122
4125
 
@@ -4762,12 +4765,33 @@ import { Fragment, jsx as jsx4 } from "react/jsx-runtime";
4762
4765
  // src/provider/env-provider.tsx
4763
4766
  import { createContext, useContext, useState as useState3, useCallback as useCallback2 } from "react";
4764
4767
  import { jsx as jsx5 } from "react/jsx-runtime";
4768
+ var initialEnvState = {
4769
+ env: null,
4770
+ baseUrl: "",
4771
+ requests: null,
4772
+ companies: [],
4773
+ user: {},
4774
+ config: null,
4775
+ envFile: null,
4776
+ defaultCompany: {
4777
+ id: null,
4778
+ logo: "",
4779
+ secondary_color: "",
4780
+ primary_color: ""
4781
+ },
4782
+ context: {
4783
+ uid: null,
4784
+ allowed_company_ids: [],
4785
+ lang: "vi_VN",
4786
+ tz: "Asia/Saigon"
4787
+ }
4788
+ };
4765
4789
  var EnvContext = createContext(null);
4766
4790
  function useEnv() {
4767
4791
  const context = useContext(EnvContext);
4768
4792
  console.log("useEnv context:", context, new Error().stack);
4769
4793
  if (!context) {
4770
- throw new Error("useEnv must be used within an EnvProvider");
4794
+ return initialEnvState;
4771
4795
  }
4772
4796
  return context;
4773
4797
  }
@@ -4780,6 +4804,7 @@ var EnvShareContext = createContext2(null);
4780
4804
  // src/services/auth-service/backup.ts
4781
4805
  function useAuthService() {
4782
4806
  const { env: env2 } = useEnv();
4807
+ console.log("auth env", env2);
4783
4808
  const login = useCallback3(
4784
4809
  async (body) => {
4785
4810
  const payload = Object.fromEntries(
@@ -4997,18 +5022,21 @@ function useAuthService() {
4997
5022
 
4998
5023
  // src/hooks/auth/use-login-credential.tsx
4999
5024
  var useLoginCredential = () => {
5000
- console.log("useLoginCredential called", new Error().stack);
5025
+ const { env: env2 } = useEnv();
5026
+ console.log("useLoginCredential called", env2, new Error().stack);
5001
5027
  const { login } = useAuthService();
5002
- return {
5003
- login
5004
- };
5028
+ return useMutation5({
5029
+ mutationFn: (data) => {
5030
+ return login(data);
5031
+ }
5032
+ });
5005
5033
  };
5006
5034
  var use_login_credential_default = useLoginCredential;
5007
5035
 
5008
5036
  // src/hooks/auth/use-login-socical.ts
5009
- import { useMutation as useMutation5 } from "@tanstack/react-query";
5037
+ import { useMutation as useMutation6 } from "@tanstack/react-query";
5010
5038
  var useLoginSocial = () => {
5011
- return useMutation5({
5039
+ return useMutation6({
5012
5040
  mutationFn: (data) => {
5013
5041
  return auth_service_default.loginSocial(data);
5014
5042
  }
@@ -5017,9 +5045,9 @@ var useLoginSocial = () => {
5017
5045
  var use_login_socical_default = useLoginSocial;
5018
5046
 
5019
5047
  // src/hooks/auth/use-reset-password.ts
5020
- import { useMutation as useMutation6 } from "@tanstack/react-query";
5048
+ import { useMutation as useMutation7 } from "@tanstack/react-query";
5021
5049
  var useResetPassword = () => {
5022
- return useMutation6({
5050
+ return useMutation7({
5023
5051
  mutationFn: (request) => {
5024
5052
  return auth_service_default.resetPassword(request.data, request.token);
5025
5053
  }
@@ -5028,9 +5056,9 @@ var useResetPassword = () => {
5028
5056
  var use_reset_password_default = useResetPassword;
5029
5057
 
5030
5058
  // src/hooks/auth/use-reset-password-sso.ts
5031
- import { useMutation as useMutation7 } from "@tanstack/react-query";
5059
+ import { useMutation as useMutation8 } from "@tanstack/react-query";
5032
5060
  var useResetPasswordSSO = () => {
5033
- return useMutation7({
5061
+ return useMutation8({
5034
5062
  mutationFn: ({
5035
5063
  method,
5036
5064
  password,
@@ -5047,9 +5075,9 @@ var useResetPasswordSSO = () => {
5047
5075
  var use_reset_password_sso_default = useResetPasswordSSO;
5048
5076
 
5049
5077
  // src/hooks/auth/use-update-password.ts
5050
- import { useMutation as useMutation8 } from "@tanstack/react-query";
5078
+ import { useMutation as useMutation9 } from "@tanstack/react-query";
5051
5079
  var useUpdatePassword = () => {
5052
- return useMutation8({
5080
+ return useMutation9({
5053
5081
  mutationFn: (request) => {
5054
5082
  return auth_service_default.updatePassword(request.data, request.token);
5055
5083
  }
@@ -5058,9 +5086,9 @@ var useUpdatePassword = () => {
5058
5086
  var use_update_password_default = useUpdatePassword;
5059
5087
 
5060
5088
  // src/hooks/auth/use-logout.ts
5061
- import { useMutation as useMutation9 } from "@tanstack/react-query";
5089
+ import { useMutation as useMutation10 } from "@tanstack/react-query";
5062
5090
  var useLogout = () => {
5063
- return useMutation9({
5091
+ return useMutation10({
5064
5092
  mutationFn: (data) => {
5065
5093
  return auth_service_default.logout(data);
5066
5094
  }
@@ -5069,9 +5097,9 @@ var useLogout = () => {
5069
5097
  var use_logout_default = useLogout;
5070
5098
 
5071
5099
  // src/hooks/auth/use-get-access-by-code.ts
5072
- import { useMutation as useMutation10 } from "@tanstack/react-query";
5100
+ import { useMutation as useMutation11 } from "@tanstack/react-query";
5073
5101
  var useGetAccessByCode = () => {
5074
- return useMutation10({
5102
+ return useMutation11({
5075
5103
  mutationFn: ({ code }) => {
5076
5104
  return auth_service_default.getAccessByCode(code);
5077
5105
  }
@@ -5080,9 +5108,9 @@ var useGetAccessByCode = () => {
5080
5108
  var use_get_access_by_code_default = useGetAccessByCode;
5081
5109
 
5082
5110
  // src/hooks/auth/use-validate-action-token.ts
5083
- import { useMutation as useMutation11 } from "@tanstack/react-query";
5111
+ import { useMutation as useMutation12 } from "@tanstack/react-query";
5084
5112
  var useValidateActionToken = () => {
5085
- return useMutation11({
5113
+ return useMutation12({
5086
5114
  mutationFn: ({
5087
5115
  actionToken,
5088
5116
  path
@@ -5094,18 +5122,18 @@ var useValidateActionToken = () => {
5094
5122
  var use_validate_action_token_default = useValidateActionToken;
5095
5123
 
5096
5124
  // src/hooks/company/use-get-company-info.ts
5097
- import { useMutation as useMutation12 } from "@tanstack/react-query";
5125
+ import { useMutation as useMutation13 } from "@tanstack/react-query";
5098
5126
  var useGetCompanyInfo = () => {
5099
- return useMutation12({
5127
+ return useMutation13({
5100
5128
  mutationFn: (id) => company_service_default.getInfoCompany(id)
5101
5129
  });
5102
5130
  };
5103
5131
  var use_get_company_info_default = useGetCompanyInfo;
5104
5132
 
5105
5133
  // src/hooks/company/use-get-current-company.ts
5106
- import { useMutation as useMutation13 } from "@tanstack/react-query";
5134
+ import { useMutation as useMutation14 } from "@tanstack/react-query";
5107
5135
  var useGetCurrentCompany = () => {
5108
- return useMutation13({
5136
+ return useMutation14({
5109
5137
  mutationFn: () => company_service_default.getCurrentCompany()
5110
5138
  });
5111
5139
  };
@@ -5132,9 +5160,9 @@ var useGetListCompany = (companyIDs = []) => {
5132
5160
  var use_get_list_company_default = useGetListCompany;
5133
5161
 
5134
5162
  // src/hooks/excel/use-export-excel.ts
5135
- import { useMutation as useMutation14 } from "@tanstack/react-query";
5163
+ import { useMutation as useMutation15 } from "@tanstack/react-query";
5136
5164
  var useExportExcel = () => {
5137
- return useMutation14({
5165
+ return useMutation15({
5138
5166
  mutationFn: ({
5139
5167
  model,
5140
5168
  domain,
@@ -5159,9 +5187,9 @@ var useExportExcel = () => {
5159
5187
  var use_export_excel_default = useExportExcel;
5160
5188
 
5161
5189
  // src/hooks/excel/use-get-field-export.ts
5162
- import { useMutation as useMutation15 } from "@tanstack/react-query";
5190
+ import { useMutation as useMutation16 } from "@tanstack/react-query";
5163
5191
  var useGetFieldExport = () => {
5164
- return useMutation15({
5192
+ return useMutation16({
5165
5193
  mutationFn: ({
5166
5194
  ids,
5167
5195
  model,
@@ -5208,9 +5236,9 @@ var useGetFileExcel = ({ model }) => {
5208
5236
  var use_get_file_excel_default = useGetFileExcel;
5209
5237
 
5210
5238
  // src/hooks/excel/use-parse-preview.ts
5211
- import { useMutation as useMutation16 } from "@tanstack/react-query";
5239
+ import { useMutation as useMutation17 } from "@tanstack/react-query";
5212
5240
  var useParsePreview = () => {
5213
- return useMutation16({
5241
+ return useMutation17({
5214
5242
  mutationFn: ({
5215
5243
  id,
5216
5244
  selectedSheet,
@@ -5227,9 +5255,9 @@ var useParsePreview = () => {
5227
5255
  var use_parse_preview_default = useParsePreview;
5228
5256
 
5229
5257
  // src/hooks/excel/use-upload-file.ts
5230
- import { useMutation as useMutation17 } from "@tanstack/react-query";
5258
+ import { useMutation as useMutation18 } from "@tanstack/react-query";
5231
5259
  var useUploadFile = () => {
5232
- return useMutation17({
5260
+ return useMutation18({
5233
5261
  mutationFn: ({ formData }) => excel_service_default.uploadFile({
5234
5262
  formData
5235
5263
  })
@@ -5238,9 +5266,9 @@ var useUploadFile = () => {
5238
5266
  var use_upload_file_default = useUploadFile;
5239
5267
 
5240
5268
  // src/hooks/excel/use-upload-id-file.ts
5241
- import { useMutation as useMutation18 } from "@tanstack/react-query";
5269
+ import { useMutation as useMutation19 } from "@tanstack/react-query";
5242
5270
  var useUploadIdFile = () => {
5243
- return useMutation18({
5271
+ return useMutation19({
5244
5272
  mutationFn: ({ formData }) => excel_service_default.uploadIdFile({
5245
5273
  formData
5246
5274
  })
@@ -5249,9 +5277,9 @@ var useUploadIdFile = () => {
5249
5277
  var use_upload_id_file_default = useUploadIdFile;
5250
5278
 
5251
5279
  // src/hooks/excel/uss-execute-import.ts
5252
- import { useMutation as useMutation19 } from "@tanstack/react-query";
5280
+ import { useMutation as useMutation20 } from "@tanstack/react-query";
5253
5281
  var useExecuteImport = () => {
5254
- return useMutation19({
5282
+ return useMutation20({
5255
5283
  mutationFn: ({
5256
5284
  fields,
5257
5285
  columns,
@@ -5272,9 +5300,9 @@ var useExecuteImport = () => {
5272
5300
  var uss_execute_import_default = useExecuteImport;
5273
5301
 
5274
5302
  // src/hooks/form/use-change-status.ts
5275
- import { useMutation as useMutation20 } from "@tanstack/react-query";
5303
+ import { useMutation as useMutation21 } from "@tanstack/react-query";
5276
5304
  var useChangeStatus = () => {
5277
- return useMutation20({
5305
+ return useMutation21({
5278
5306
  mutationFn: ({ data }) => {
5279
5307
  return form_service_default.changeStatus({
5280
5308
  data
@@ -5285,9 +5313,9 @@ var useChangeStatus = () => {
5285
5313
  var use_change_status_default = useChangeStatus;
5286
5314
 
5287
5315
  // src/hooks/form/use-delete-comment.ts
5288
- import { useMutation as useMutation21 } from "@tanstack/react-query";
5316
+ import { useMutation as useMutation22 } from "@tanstack/react-query";
5289
5317
  var useDeleteComment = () => {
5290
- return useMutation21({
5318
+ return useMutation22({
5291
5319
  mutationFn: ({ data }) => form_service_default.deleteComment({
5292
5320
  data
5293
5321
  })
@@ -5352,9 +5380,9 @@ var useGetImage = ({
5352
5380
  var use_get_image_default = useGetImage;
5353
5381
 
5354
5382
  // src/hooks/form/use-send-comment.ts
5355
- import { useMutation as useMutation22 } from "@tanstack/react-query";
5383
+ import { useMutation as useMutation23 } from "@tanstack/react-query";
5356
5384
  var useSendComment = () => {
5357
- return useMutation22({
5385
+ return useMutation23({
5358
5386
  mutationFn: ({ data }) => form_service_default.sentComment({
5359
5387
  data
5360
5388
  })
@@ -5363,9 +5391,9 @@ var useSendComment = () => {
5363
5391
  var use_send_comment_default = useSendComment;
5364
5392
 
5365
5393
  // src/hooks/form/use-upload-image.ts
5366
- import { useMutation as useMutation23 } from "@tanstack/react-query";
5394
+ import { useMutation as useMutation24 } from "@tanstack/react-query";
5367
5395
  var useUploadImage = () => {
5368
- return useMutation23({
5396
+ return useMutation24({
5369
5397
  mutationFn: ({ data }) => form_service_default.uploadImage({
5370
5398
  data
5371
5399
  })
@@ -5374,9 +5402,9 @@ var useUploadImage = () => {
5374
5402
  var use_upload_image_default = useUploadImage;
5375
5403
 
5376
5404
  // src/hooks/model/use-delete.ts
5377
- import { useMutation as useMutation24 } from "@tanstack/react-query";
5405
+ import { useMutation as useMutation25 } from "@tanstack/react-query";
5378
5406
  var useDelete = () => {
5379
- return useMutation24({
5407
+ return useMutation25({
5380
5408
  mutationFn: ({ ids, model }) => model_service_default.delete({ ids, model })
5381
5409
  });
5382
5410
  };
@@ -5430,9 +5458,9 @@ var useGetCurrency = () => {
5430
5458
  var use_get_currency_default = useGetCurrency;
5431
5459
 
5432
5460
  // src/hooks/model/use-get-detail.ts
5433
- import { useMutation as useMutation25 } from "@tanstack/react-query";
5461
+ import { useMutation as useMutation26 } from "@tanstack/react-query";
5434
5462
  var useGetDetail = () => {
5435
- return useMutation25({
5463
+ return useMutation26({
5436
5464
  mutationFn: ({
5437
5465
  model,
5438
5466
  ids,
@@ -5625,9 +5653,9 @@ var useOdooDataTransform = () => {
5625
5653
  var use_odoo_data_transform_default = useOdooDataTransform;
5626
5654
 
5627
5655
  // src/hooks/model/use-onchange-form.ts
5628
- import { useMutation as useMutation26 } from "@tanstack/react-query";
5656
+ import { useMutation as useMutation27 } from "@tanstack/react-query";
5629
5657
  var useOnChangeForm = () => {
5630
- return useMutation26({
5658
+ return useMutation27({
5631
5659
  mutationFn: ({
5632
5660
  ids,
5633
5661
  model,
@@ -5648,9 +5676,9 @@ var useOnChangeForm = () => {
5648
5676
  var use_onchange_form_default = useOnChangeForm;
5649
5677
 
5650
5678
  // src/hooks/model/use-save.ts
5651
- import { useMutation as useMutation27 } from "@tanstack/react-query";
5679
+ import { useMutation as useMutation28 } from "@tanstack/react-query";
5652
5680
  var useSave = () => {
5653
- return useMutation27({
5681
+ return useMutation28({
5654
5682
  mutationFn: ({
5655
5683
  ids,
5656
5684
  model,
@@ -5664,18 +5692,18 @@ var useSave = () => {
5664
5692
  var use_save_default = useSave;
5665
5693
 
5666
5694
  // src/hooks/user/use-get-profile.ts
5667
- import { useMutation as useMutation28 } from "@tanstack/react-query";
5695
+ import { useMutation as useMutation29 } from "@tanstack/react-query";
5668
5696
  var useGetProfile = (path) => {
5669
- return useMutation28({
5697
+ return useMutation29({
5670
5698
  mutationFn: () => user_service_default.getProfile(path)
5671
5699
  });
5672
5700
  };
5673
5701
  var use_get_profile_default = useGetProfile;
5674
5702
 
5675
5703
  // src/hooks/user/use-get-user.ts
5676
- import { useMutation as useMutation29 } from "@tanstack/react-query";
5704
+ import { useMutation as useMutation30 } from "@tanstack/react-query";
5677
5705
  var useGetUser = () => {
5678
- return useMutation29({
5706
+ return useMutation30({
5679
5707
  mutationFn: ({ id, context }) => user_service_default.getUser({
5680
5708
  id,
5681
5709
  context
@@ -5685,9 +5713,9 @@ var useGetUser = () => {
5685
5713
  var use_get_user_default = useGetUser;
5686
5714
 
5687
5715
  // src/hooks/user/use-switch-locale.ts
5688
- import { useMutation as useMutation30 } from "@tanstack/react-query";
5716
+ import { useMutation as useMutation31 } from "@tanstack/react-query";
5689
5717
  var useSwitchLocale = () => {
5690
- return useMutation30({
5718
+ return useMutation31({
5691
5719
  mutationFn: ({ data }) => {
5692
5720
  return user_service_default.switchUserLocale({
5693
5721
  id: data.id,
@@ -5699,9 +5727,9 @@ var useSwitchLocale = () => {
5699
5727
  var use_switch_locale_default = useSwitchLocale;
5700
5728
 
5701
5729
  // src/hooks/view/use-button.ts
5702
- import { useMutation as useMutation31 } from "@tanstack/react-query";
5730
+ import { useMutation as useMutation32 } from "@tanstack/react-query";
5703
5731
  var useButton = () => {
5704
- return useMutation31({
5732
+ return useMutation32({
5705
5733
  mutationFn: ({
5706
5734
  model,
5707
5735
  ids,
@@ -5721,9 +5749,9 @@ var useButton = () => {
5721
5749
  var use_button_default = useButton;
5722
5750
 
5723
5751
  // src/hooks/view/use-duplicate-record.ts
5724
- import { useMutation as useMutation32 } from "@tanstack/react-query";
5752
+ import { useMutation as useMutation33 } from "@tanstack/react-query";
5725
5753
  var useDuplicateRecord = () => {
5726
- return useMutation32({
5754
+ return useMutation33({
5727
5755
  mutationFn: ({
5728
5756
  id,
5729
5757
  model,
@@ -5849,9 +5877,9 @@ var useGetMenu = (context, enabled) => {
5849
5877
  var use_get_menu_default = useGetMenu;
5850
5878
 
5851
5879
  // src/hooks/view/use-get-print-report.ts
5852
- import { useMutation as useMutation33 } from "@tanstack/react-query";
5880
+ import { useMutation as useMutation34 } from "@tanstack/react-query";
5853
5881
  var useGetPrintReport = () => {
5854
- return useMutation33({
5882
+ return useMutation34({
5855
5883
  mutationFn: ({ id }) => action_service_default.getPrintReportName({
5856
5884
  id
5857
5885
  })
@@ -5915,9 +5943,9 @@ var useGetView = (viewParams, actData) => {
5915
5943
  var use_get_view_default = useGetView;
5916
5944
 
5917
5945
  // src/hooks/view/use-load-action.ts
5918
- import { useMutation as useMutation34 } from "@tanstack/react-query";
5946
+ import { useMutation as useMutation35 } from "@tanstack/react-query";
5919
5947
  var useLoadAction = () => {
5920
- return useMutation34({
5948
+ return useMutation35({
5921
5949
  mutationFn: ({
5922
5950
  idAction,
5923
5951
  context
@@ -5943,9 +5971,9 @@ var useLoadMessage = () => {
5943
5971
  var use_load_message_default = useLoadMessage;
5944
5972
 
5945
5973
  // src/hooks/view/use-print.ts
5946
- import { useMutation as useMutation35 } from "@tanstack/react-query";
5974
+ import { useMutation as useMutation36 } from "@tanstack/react-query";
5947
5975
  var usePrint = () => {
5948
- return useMutation35({
5976
+ return useMutation36({
5949
5977
  mutationFn: ({ id, report, db }) => action_service_default.print({
5950
5978
  id,
5951
5979
  report,
@@ -5956,9 +5984,9 @@ var usePrint = () => {
5956
5984
  var use_print_default = usePrint;
5957
5985
 
5958
5986
  // src/hooks/view/use-remove-row.ts
5959
- import { useMutation as useMutation36 } from "@tanstack/react-query";
5987
+ import { useMutation as useMutation37 } from "@tanstack/react-query";
5960
5988
  var useRemoveRow = () => {
5961
- return useMutation36({
5989
+ return useMutation37({
5962
5990
  mutationFn: ({
5963
5991
  model,
5964
5992
  ids,
@@ -5990,9 +6018,9 @@ var useGetResequence = (model, resIds, context, offset) => {
5990
6018
  var use_resequence_default = useGetResequence;
5991
6019
 
5992
6020
  // src/hooks/view/use-run-action.ts
5993
- import { useMutation as useMutation37 } from "@tanstack/react-query";
6021
+ import { useMutation as useMutation38 } from "@tanstack/react-query";
5994
6022
  var useRunAction = () => {
5995
- return useMutation37({
6023
+ return useMutation38({
5996
6024
  mutationFn: ({
5997
6025
  idAction,
5998
6026
  context
@@ -6005,9 +6033,9 @@ var useRunAction = () => {
6005
6033
  var use_run_action_default = useRunAction;
6006
6034
 
6007
6035
  // src/hooks/view/use-signin-sso.ts
6008
- import { useMutation as useMutation38 } from "@tanstack/react-query";
6036
+ import { useMutation as useMutation39 } from "@tanstack/react-query";
6009
6037
  var useSignInSSO = () => {
6010
- return useMutation38({
6038
+ return useMutation39({
6011
6039
  mutationFn: ({
6012
6040
  redirect_uri,
6013
6041
  state,
@@ -6028,9 +6056,9 @@ var useSignInSSO = () => {
6028
6056
  var use_signin_sso_default = useSignInSSO;
6029
6057
 
6030
6058
  // src/hooks/view/use-verify-2FA.ts
6031
- import { useMutation as useMutation39 } from "@tanstack/react-query";
6059
+ import { useMutation as useMutation40 } from "@tanstack/react-query";
6032
6060
  var useVerify2FA = () => {
6033
- return useMutation39({
6061
+ return useMutation40({
6034
6062
  mutationFn: ({
6035
6063
  method,
6036
6064
  with_context,
@@ -6051,9 +6079,9 @@ var useVerify2FA = () => {
6051
6079
  var use_verify_2FA_default = useVerify2FA;
6052
6080
 
6053
6081
  // src/hooks/view/uset-get-2FA-method.ts
6054
- import { useMutation as useMutation40 } from "@tanstack/react-query";
6082
+ import { useMutation as useMutation41 } from "@tanstack/react-query";
6055
6083
  var useGet2FAMethods = () => {
6056
- return useMutation40({
6084
+ return useMutation41({
6057
6085
  mutationFn: ({
6058
6086
  method,
6059
6087
  with_context
@@ -6068,9 +6096,9 @@ var useGet2FAMethods = () => {
6068
6096
  var uset_get_2FA_method_default = useGet2FAMethods;
6069
6097
 
6070
6098
  // src/hooks/view/use-get-fields-view-security.ts
6071
- import { useMutation as useMutation41 } from "@tanstack/react-query";
6099
+ import { useMutation as useMutation42 } from "@tanstack/react-query";
6072
6100
  var useGetFieldsViewSecurity = () => {
6073
- return useMutation41({
6101
+ return useMutation42({
6074
6102
  mutationFn: ({
6075
6103
  method,
6076
6104
  token,
@@ -6087,9 +6115,9 @@ var useGetFieldsViewSecurity = () => {
6087
6115
  var use_get_fields_view_security_default = useGetFieldsViewSecurity;
6088
6116
 
6089
6117
  // src/hooks/view/use-grant-access.ts
6090
- import { useMutation as useMutation42 } from "@tanstack/react-query";
6118
+ import { useMutation as useMutation43 } from "@tanstack/react-query";
6091
6119
  var useGrantAccess = () => {
6092
- return useMutation42({
6120
+ return useMutation43({
6093
6121
  mutationFn: ({
6094
6122
  redirect_uri,
6095
6123
  state,
@@ -6108,9 +6136,9 @@ var useGrantAccess = () => {
6108
6136
  var use_grant_access_default = useGrantAccess;
6109
6137
 
6110
6138
  // src/hooks/view/use-remove-totp-setup.ts
6111
- import { useMutation as useMutation43 } from "@tanstack/react-query";
6139
+ import { useMutation as useMutation44 } from "@tanstack/react-query";
6112
6140
  var useRemoveTotpSetup = () => {
6113
- return useMutation43({
6141
+ return useMutation44({
6114
6142
  mutationFn: ({ method, token }) => {
6115
6143
  return view_service_default.removeTotpSetUp({
6116
6144
  method,
@@ -6122,9 +6150,9 @@ var useRemoveTotpSetup = () => {
6122
6150
  var use_remove_totp_setup_default = useRemoveTotpSetup;
6123
6151
 
6124
6152
  // src/hooks/view/use-request-setup-totp.ts
6125
- import { useMutation as useMutation44 } from "@tanstack/react-query";
6153
+ import { useMutation as useMutation45 } from "@tanstack/react-query";
6126
6154
  var useRequestSetupTotp = () => {
6127
- return useMutation44({
6155
+ return useMutation45({
6128
6156
  mutationFn: ({ method, token }) => {
6129
6157
  return view_service_default.requestSetupTotp({
6130
6158
  method,
@@ -6136,9 +6164,9 @@ var useRequestSetupTotp = () => {
6136
6164
  var use_request_setup_totp_default = useRequestSetupTotp;
6137
6165
 
6138
6166
  // src/hooks/view/use-settings-web-read-2fa.ts
6139
- import { useMutation as useMutation45 } from "@tanstack/react-query";
6167
+ import { useMutation as useMutation46 } from "@tanstack/react-query";
6140
6168
  var useSettingsWebRead2fa = () => {
6141
- return useMutation45({
6169
+ return useMutation46({
6142
6170
  mutationFn: ({
6143
6171
  method,
6144
6172
  token,
@@ -6157,9 +6185,9 @@ var useSettingsWebRead2fa = () => {
6157
6185
  var use_settings_web_read_2fa_default = useSettingsWebRead2fa;
6158
6186
 
6159
6187
  // src/hooks/view/use-verify-totp.ts
6160
- import { useMutation as useMutation46 } from "@tanstack/react-query";
6188
+ import { useMutation as useMutation47 } from "@tanstack/react-query";
6161
6189
  var useVerifyTotp = () => {
6162
- return useMutation46({
6190
+ return useMutation47({
6163
6191
  mutationFn: ({
6164
6192
  method,
6165
6193
  action_token,
@@ -15,6 +15,7 @@ declare const VersionGate: ({ children }: {
15
15
  }) => react_jsx_runtime.JSX.Element | null;
16
16
 
17
17
  interface EnvConfig {
18
+ env?: any;
18
19
  baseUrl?: string;
19
20
  requests?: any;
20
21
  context?: {
@@ -43,7 +44,7 @@ declare function EnvProvider({ children, localStorageUtils: localStorageUtil, se
43
44
  localStorageUtils?: LocalStorageUtilsType;
44
45
  sessionStorageUtils?: SessionStorageUtilsType;
45
46
  }): react_jsx_runtime.JSX.Element;
46
- declare function useEnv(): {
47
+ declare function useEnv(): EnvConfig | {
47
48
  env: EnvConfig;
48
49
  setupEnv: (envConfig: Partial<EnvConfig>) => EnvConfig;
49
50
  setUid: (uid: number) => void;
@@ -15,6 +15,7 @@ declare const VersionGate: ({ children }: {
15
15
  }) => react_jsx_runtime.JSX.Element | null;
16
16
 
17
17
  interface EnvConfig {
18
+ env?: any;
18
19
  baseUrl?: string;
19
20
  requests?: any;
20
21
  context?: {
@@ -43,7 +44,7 @@ declare function EnvProvider({ children, localStorageUtils: localStorageUtil, se
43
44
  localStorageUtils?: LocalStorageUtilsType;
44
45
  sessionStorageUtils?: SessionStorageUtilsType;
45
46
  }): react_jsx_runtime.JSX.Element;
46
- declare function useEnv(): {
47
+ declare function useEnv(): EnvConfig | {
47
48
  env: EnvConfig;
48
49
  setupEnv: (envConfig: Partial<EnvConfig>) => EnvConfig;
49
50
  setUid: (uid: number) => void;
package/dist/provider.js CHANGED
@@ -3331,6 +3331,7 @@ var axiosClient = {
3331
3331
  // src/provider/env-provider.tsx
3332
3332
  var import_jsx_runtime5 = require("react/jsx-runtime");
3333
3333
  var initialEnvState = {
3334
+ env: null,
3334
3335
  baseUrl: "",
3335
3336
  requests: null,
3336
3337
  companies: [],
@@ -3449,7 +3450,7 @@ function useEnv() {
3449
3450
  const context = (0, import_react4.useContext)(EnvContext);
3450
3451
  console.log("useEnv context:", context, new Error().stack);
3451
3452
  if (!context) {
3452
- throw new Error("useEnv must be used within an EnvProvider");
3453
+ return initialEnvState;
3453
3454
  }
3454
3455
  return context;
3455
3456
  }
package/dist/provider.mjs CHANGED
@@ -3289,6 +3289,7 @@ var axiosClient = {
3289
3289
  // src/provider/env-provider.tsx
3290
3290
  import { jsx as jsx5 } from "react/jsx-runtime";
3291
3291
  var initialEnvState = {
3292
+ env: null,
3292
3293
  baseUrl: "",
3293
3294
  requests: null,
3294
3295
  companies: [],
@@ -3407,7 +3408,7 @@ function useEnv() {
3407
3408
  const context = useContext(EnvContext);
3408
3409
  console.log("useEnv context:", context, new Error().stack);
3409
3410
  if (!context) {
3410
- throw new Error("useEnv must be used within an EnvProvider");
3411
+ return initialEnvState;
3411
3412
  }
3412
3413
  return context;
3413
3414
  }
@@ -1,4 +1,4 @@
1
- import { C as ContextApi, L as LoginCredentialBody, R as ResetPasswordRequest, U as UpdatePasswordRequest, b as GetListParams, c as GetDetailParams, d as SaveParams, D as DeleteParams, O as OnChangeParams, V as ViewData, a as GetViewParams, G as GetSelectionType } from './view-type-DtGzLLEa.mjs';
1
+ import { C as ContextApi, L as LoginCredentialBody, R as ResetPasswordRequest, U as UpdatePasswordRequest, b as GetListParams, c as GetDetailParams, d as SaveParams, D as DeleteParams, O as OnChangeParams, V as ViewData, a as GetViewParams, G as GetSelectionType } from './view-type-D8ukwj_2.mjs';
2
2
 
3
3
  declare const ActionService: {
4
4
  loadAction({ idAction, context, }: {
@@ -1,4 +1,4 @@
1
- import { C as ContextApi, L as LoginCredentialBody, R as ResetPasswordRequest, U as UpdatePasswordRequest, b as GetListParams, c as GetDetailParams, d as SaveParams, D as DeleteParams, O as OnChangeParams, V as ViewData, a as GetViewParams, G as GetSelectionType } from './view-type-DtGzLLEa.js';
1
+ import { C as ContextApi, L as LoginCredentialBody, R as ResetPasswordRequest, U as UpdatePasswordRequest, b as GetListParams, c as GetDetailParams, d as SaveParams, D as DeleteParams, O as OnChangeParams, V as ViewData, a as GetViewParams, G as GetSelectionType } from './view-type-D8ukwj_2.js';
2
2
 
3
3
  declare const ActionService: {
4
4
  loadAction({ idAction, context, }: {
package/dist/types.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- export { C as ContextApi, D as DeleteParams, F as ForgotPasswordBody, e as GetAllParams, c as GetDetailParams, b as GetListParams, G as GetSelectionType, a as GetViewParams, L as LoginCredentialBody, O as OnChangeParams, R as ResetPasswordRequest, d as SaveParams, S as SocialTokenBody, f as Specification, U as UpdatePasswordRequest, g as View, V as ViewData, u as updatePasswordBody } from './view-type-DtGzLLEa.mjs';
1
+ export { C as ContextApi, D as DeleteParams, F as ForgotPasswordBody, e as GetAllParams, c as GetDetailParams, b as GetListParams, G as GetSelectionType, a as GetViewParams, L as LoginCredentialBody, O as OnChangeParams, R as ResetPasswordRequest, d as SaveParams, S as SocialTokenBody, f as Specification, U as UpdatePasswordRequest, g as View, V as ViewData, u as updatePasswordBody } from './view-type-D8ukwj_2.mjs';
2
2
 
3
3
  interface Config {
4
4
  baseUrl: string;
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { C as ContextApi, D as DeleteParams, F as ForgotPasswordBody, e as GetAllParams, c as GetDetailParams, b as GetListParams, G as GetSelectionType, a as GetViewParams, L as LoginCredentialBody, O as OnChangeParams, R as ResetPasswordRequest, d as SaveParams, S as SocialTokenBody, f as Specification, U as UpdatePasswordRequest, g as View, V as ViewData, u as updatePasswordBody } from './view-type-DtGzLLEa.js';
1
+ export { C as ContextApi, D as DeleteParams, F as ForgotPasswordBody, e as GetAllParams, c as GetDetailParams, b as GetListParams, G as GetSelectionType, a as GetViewParams, L as LoginCredentialBody, O as OnChangeParams, R as ResetPasswordRequest, d as SaveParams, S as SocialTokenBody, f as Specification, U as UpdatePasswordRequest, g as View, V as ViewData, u as updatePasswordBody } from './view-type-D8ukwj_2.js';
2
2
 
3
3
  interface Config {
4
4
  baseUrl: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fctc/interface-logic",
3
- "version": "1.9.10",
3
+ "version": "1.10.0",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",