@fctc/interface-logic 2.3.1 → 2.3.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/provider.mjs CHANGED
@@ -667,8 +667,7 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
667
667
  UriConstants2["LOAD_ACTION"] = `/load_action`;
668
668
  UriConstants2["REPORT_PATH"] = `/report`;
669
669
  UriConstants2["RUN_ACTION_PATH"] = `/run_action`;
670
- UriConstants2["UPLOAD_FILE_EXCEL_PATH"] = `/upload/file`;
671
- UriConstants2["UPLOAD_FILE_PATH"] = `/web/binary/upload_attachment`;
670
+ UriConstants2["UPLOAD_FILE_PATH"] = `/upload/file`;
672
671
  UriConstants2["GET_MESSAGE"] = `/chatter/thread/messages`;
673
672
  UriConstants2["SENT_MESSAGE"] = `/chatter/message/post`;
674
673
  UriConstants2["UPLOAD_IMAGE"] = `/mail/attachment/upload`;
@@ -676,7 +675,6 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
676
675
  UriConstants2["IMAGE_PATH"] = `/web/image`;
677
676
  UriConstants2["LOAD_MESSAGE"] = `/load_message_failures`;
678
677
  UriConstants2["TOKEN"] = `/check_token`;
679
- UriConstants2["VALIDATE_ACTION_TOKEN"] = `/action-token/validate`;
680
678
  UriConstants2["CREATE_UPDATE_PATH"] = `/create_update`;
681
679
  UriConstants2["TWOFA_METHOD_PATH"] = `/id/api/v2/call`;
682
680
  UriConstants2["SIGNIN_SSO"] = `/signin-sso/oauth`;
@@ -2850,21 +2848,15 @@ function useActionService() {
2850
2848
  const loadAction = useCallback(
2851
2849
  async ({
2852
2850
  idAction,
2853
- context,
2854
- service
2851
+ context
2855
2852
  }) => {
2856
2853
  const jsonData = {
2857
2854
  action_id: idAction,
2858
2855
  with_context: { ...context }
2859
2856
  };
2860
- return env.requests.post(
2861
- "/load_action" /* LOAD_ACTION */,
2862
- jsonData,
2863
- {
2864
- headers: { "Content-Type": "application/json" }
2865
- },
2866
- service
2867
- );
2857
+ return env.requests.post("/load_action" /* LOAD_ACTION */, jsonData, {
2858
+ headers: { "Content-Type": "application/json" }
2859
+ });
2868
2860
  },
2869
2861
  [env]
2870
2862
  );
@@ -2873,8 +2865,7 @@ function useActionService() {
2873
2865
  model,
2874
2866
  ids = [],
2875
2867
  context,
2876
- method,
2877
- service
2868
+ method
2878
2869
  }) => {
2879
2870
  try {
2880
2871
  const jsonData = {
@@ -2883,14 +2874,9 @@ function useActionService() {
2883
2874
  ids,
2884
2875
  with_context: context
2885
2876
  };
2886
- return env.requests.post(
2887
- "/call" /* CALL_PATH */,
2888
- jsonData,
2889
- {
2890
- headers: { "Content-Type": "application/json" }
2891
- },
2892
- service
2893
- );
2877
+ return env.requests.post("/call" /* CALL_PATH */, jsonData, {
2878
+ headers: { "Content-Type": "application/json" }
2879
+ });
2894
2880
  } catch (error) {
2895
2881
  console.error("Error when calling button action:", error);
2896
2882
  throw error;
@@ -2902,8 +2888,7 @@ function useActionService() {
2902
2888
  async ({
2903
2889
  model,
2904
2890
  ids,
2905
- context,
2906
- service
2891
+ context
2907
2892
  }) => {
2908
2893
  const jsonData = {
2909
2894
  model,
@@ -2911,14 +2896,9 @@ function useActionService() {
2911
2896
  ids,
2912
2897
  with_context: context
2913
2898
  };
2914
- return env.requests.post(
2915
- "/call" /* CALL_PATH */,
2916
- jsonData,
2917
- {
2918
- headers: { "Content-Type": "application/json" }
2919
- },
2920
- service
2921
- );
2899
+ return env.requests.post("/call" /* CALL_PATH */, jsonData, {
2900
+ headers: { "Content-Type": "application/json" }
2901
+ });
2922
2902
  },
2923
2903
  [env]
2924
2904
  );
@@ -2926,8 +2906,7 @@ function useActionService() {
2926
2906
  async ({
2927
2907
  model,
2928
2908
  id,
2929
- context,
2930
- service
2909
+ context
2931
2910
  }) => {
2932
2911
  const jsonData = {
2933
2912
  model,
@@ -2935,14 +2914,9 @@ function useActionService() {
2935
2914
  ids: id,
2936
2915
  with_context: context
2937
2916
  };
2938
- return env.requests.post(
2939
- "/call" /* CALL_PATH */,
2940
- jsonData,
2941
- {
2942
- headers: { "Content-Type": "application/json" }
2943
- },
2944
- service
2945
- );
2917
+ return env.requests.post("/call" /* CALL_PATH */, jsonData, {
2918
+ headers: { "Content-Type": "application/json" }
2919
+ });
2946
2920
  },
2947
2921
  [env]
2948
2922
  );
@@ -2985,21 +2959,15 @@ function useActionService() {
2985
2959
  const runAction = useCallback(
2986
2960
  async ({
2987
2961
  idAction,
2988
- context,
2989
- service
2962
+ context
2990
2963
  }) => {
2991
2964
  const jsonData = {
2992
2965
  action_id: idAction,
2993
2966
  with_context: { ...context }
2994
2967
  };
2995
- return env.requests.post(
2996
- "/run_action" /* RUN_ACTION_PATH */,
2997
- jsonData,
2998
- {
2999
- headers: { "Content-Type": "application/json" }
3000
- },
3001
- service
3002
- );
2968
+ return env.requests.post("/run_action" /* RUN_ACTION_PATH */, jsonData, {
2969
+ headers: { "Content-Type": "application/json" }
2970
+ });
3003
2971
  },
3004
2972
  [env]
3005
2973
  );
@@ -3142,15 +3110,18 @@ function useAuthService() {
3142
3110
  [env]
3143
3111
  );
3144
3112
  const isValidActionToken = useCallback2(
3145
- async (actionToken) => {
3146
- const bodyData = {};
3147
- return env?.requests?.post("/action-token/validate" /* VALIDATE_ACTION_TOKEN */, bodyData, {
3148
- headers: {
3149
- "Content-Type": "application/json"
3150
- },
3151
- useActionToken: true,
3152
- actionToken
3153
- });
3113
+ async (actionToken, path) => {
3114
+ return env?.requests?.post(
3115
+ path,
3116
+ {},
3117
+ {
3118
+ headers: {
3119
+ "Content-Type": "application/json"
3120
+ },
3121
+ useActionToken: true,
3122
+ actionToken
3123
+ }
3124
+ );
3154
3125
  },
3155
3126
  [env]
3156
3127
  );
@@ -3186,14 +3157,13 @@ function useAuthService() {
3186
3157
  data.append("client_id", env?.config?.clientId || "");
3187
3158
  data.append("redirect_uri", env?.config?.redirectUri || "");
3188
3159
  return env?.requests?.post(
3189
- "/token" /* TOKEN_BY_CODE */,
3160
+ `${env?.baseUrl?.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
3190
3161
  data,
3191
3162
  {
3192
3163
  headers: {
3193
3164
  "Content-Type": "application/x-www-form-urlencoded"
3194
3165
  }
3195
- },
3196
- "id"
3166
+ }
3197
3167
  );
3198
3168
  },
3199
3169
  [env]
@@ -3276,15 +3246,15 @@ function useCompanyService() {
3276
3246
  import { useCallback as useCallback4 } from "react";
3277
3247
  function useExcelService() {
3278
3248
  const { env } = useEnv();
3279
- const uploadFileExcel = useCallback4(
3249
+ const uploadFile = useCallback4(
3280
3250
  async ({ formData }) => {
3281
- return env.requests.post("/upload/file" /* UPLOAD_FILE_EXCEL_PATH */, formData);
3251
+ return env.requests.post("/upload/file" /* UPLOAD_FILE_PATH */, formData);
3282
3252
  },
3283
3253
  [env]
3284
3254
  );
3285
3255
  const uploadIdFile = useCallback4(
3286
3256
  async ({ formData }) => {
3287
- return env.requests.post("/upload/file" /* UPLOAD_FILE_EXCEL_PATH */, formData, {
3257
+ return env.requests.post("/upload/file" /* UPLOAD_FILE_PATH */, formData, {
3288
3258
  headers: {
3289
3259
  "Content-Type": "multipart/form-data"
3290
3260
  }
@@ -3432,7 +3402,7 @@ function useExcelService() {
3432
3402
  [env]
3433
3403
  );
3434
3404
  return {
3435
- uploadFileExcel,
3405
+ uploadFile,
3436
3406
  uploadIdFile,
3437
3407
  parsePreview,
3438
3408
  executeImport,
@@ -3527,41 +3497,6 @@ function useFormService() {
3527
3497
  },
3528
3498
  [env]
3529
3499
  );
3530
- const uploadFile = useCallback5(
3531
- async ({ formData }) => {
3532
- return env.requests.post("/web/binary/upload_attachment" /* UPLOAD_FILE_PATH */, formData);
3533
- },
3534
- [env]
3535
- );
3536
- const saveFile = useCallback5(
3537
- async ({
3538
- model,
3539
- idForm,
3540
- idFile,
3541
- context
3542
- }) => {
3543
- const jsonData = {
3544
- model,
3545
- method: "web_save" /* WEB_SAVE */,
3546
- ids: [
3547
- [idForm],
3548
- {
3549
- attachment_ids: [[4, idFile]]
3550
- }
3551
- ],
3552
- kwargs: {
3553
- context,
3554
- specification: {}
3555
- }
3556
- };
3557
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3558
- headers: {
3559
- "Content-Type": "application/json"
3560
- }
3561
- });
3562
- },
3563
- [env]
3564
- );
3565
3500
  const getFormView = useCallback5(
3566
3501
  async ({ data }) => {
3567
3502
  const jsonData = {
@@ -3614,9 +3549,7 @@ function useFormService() {
3614
3549
  getImage,
3615
3550
  uploadImage,
3616
3551
  getFormView,
3617
- changeStatus,
3618
- uploadFile,
3619
- saveFile
3552
+ changeStatus
3620
3553
  };
3621
3554
  }
3622
3555
 
@@ -3749,7 +3682,7 @@ function useModelService() {
3749
3682
  });
3750
3683
  }, [env]);
3751
3684
  const getAll = useCallback7(
3752
- async ({ data, service }) => {
3685
+ async ({ data }) => {
3753
3686
  const jsonReadGroup = data.type == "calendar" ? { fields: data?.fields } : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
3754
3687
  fields: data.fields,
3755
3688
  groupby: data.groupby
@@ -3770,16 +3703,11 @@ function useModelService() {
3770
3703
  ...jsonReadGroup
3771
3704
  }
3772
3705
  };
3773
- return env.requests.post(
3774
- "/call" /* CALL_PATH */,
3775
- jsonData,
3776
- {
3777
- headers: {
3778
- "Content-Type": "application/json"
3779
- }
3780
- },
3781
- service
3782
- );
3706
+ return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3707
+ headers: {
3708
+ "Content-Type": "application/json"
3709
+ }
3710
+ });
3783
3711
  },
3784
3712
  [env]
3785
3713
  );
@@ -3847,13 +3775,7 @@ function useModelService() {
3847
3775
  [env]
3848
3776
  );
3849
3777
  const getDetail = useCallback7(
3850
- async ({
3851
- ids = [],
3852
- model,
3853
- specification,
3854
- context,
3855
- service
3856
- }) => {
3778
+ async ({ ids = [], model, specification, context }) => {
3857
3779
  const jsonData = {
3858
3780
  model,
3859
3781
  method: "web_read" /* WEB_READ */,
@@ -3863,16 +3785,11 @@ function useModelService() {
3863
3785
  specification
3864
3786
  }
3865
3787
  };
3866
- return env.requests.post(
3867
- "/call" /* CALL_PATH */,
3868
- jsonData,
3869
- {
3870
- headers: {
3871
- "Content-Type": "application/json"
3872
- }
3873
- },
3874
- service
3875
- );
3788
+ return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3789
+ headers: {
3790
+ "Content-Type": "application/json"
3791
+ }
3792
+ });
3876
3793
  },
3877
3794
  [env]
3878
3795
  );
@@ -3883,8 +3800,7 @@ function useModelService() {
3883
3800
  data = {},
3884
3801
  specification = {},
3885
3802
  context = {},
3886
- path,
3887
- service
3803
+ path
3888
3804
  }) => {
3889
3805
  const jsonData = {
3890
3806
  model,
@@ -3896,36 +3812,26 @@ function useModelService() {
3896
3812
  specification
3897
3813
  }
3898
3814
  };
3899
- return env.requests.post(
3900
- path ?? "/call" /* CALL_PATH */,
3901
- jsonData,
3902
- {
3903
- headers: {
3904
- "Content-Type": "application/json"
3905
- }
3906
- },
3907
- service
3908
- );
3815
+ return env.requests.post(path ?? "/call" /* CALL_PATH */, jsonData, {
3816
+ headers: {
3817
+ "Content-Type": "application/json"
3818
+ }
3819
+ });
3909
3820
  },
3910
3821
  [env]
3911
3822
  );
3912
3823
  const deleteApi = useCallback7(
3913
- async ({ ids = [], model, service }) => {
3824
+ async ({ ids = [], model }) => {
3914
3825
  const jsonData = {
3915
3826
  model,
3916
3827
  method: "unlink" /* UNLINK */,
3917
3828
  ids
3918
3829
  };
3919
- return env.requests.post(
3920
- "/call" /* CALL_PATH */,
3921
- jsonData,
3922
- {
3923
- headers: {
3924
- "Content-Type": "application/json"
3925
- }
3926
- },
3927
- service
3928
- );
3830
+ return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3831
+ headers: {
3832
+ "Content-Type": "application/json"
3833
+ }
3834
+ });
3929
3835
  },
3930
3836
  [env]
3931
3837
  );
@@ -3936,8 +3842,7 @@ function useModelService() {
3936
3842
  object,
3937
3843
  specification,
3938
3844
  context,
3939
- fieldChange,
3940
- service
3845
+ fieldChange
3941
3846
  }) => {
3942
3847
  const jsonData = {
3943
3848
  model,
@@ -3950,35 +3855,25 @@ function useModelService() {
3950
3855
  specification
3951
3856
  ]
3952
3857
  };
3953
- return env.requests.post(
3954
- "/call" /* CALL_PATH */,
3955
- jsonData,
3956
- {
3957
- headers: {
3958
- "Content-Type": "application/json"
3959
- }
3960
- },
3961
- service
3962
- );
3858
+ return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3859
+ headers: {
3860
+ "Content-Type": "application/json"
3861
+ }
3862
+ });
3963
3863
  },
3964
3864
  [env]
3965
3865
  );
3966
3866
  const getListFieldsOnchange = useCallback7(
3967
- async ({ model, service }) => {
3867
+ async ({ model }) => {
3968
3868
  const jsonData = {
3969
3869
  model,
3970
3870
  method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
3971
3871
  };
3972
- return env.requests.post(
3973
- "/call" /* CALL_PATH */,
3974
- jsonData,
3975
- {
3976
- headers: {
3977
- "Content-Type": "application/json"
3978
- }
3979
- },
3980
- service
3981
- );
3872
+ return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3873
+ headers: {
3874
+ "Content-Type": "application/json"
3875
+ }
3876
+ });
3982
3877
  },
3983
3878
  [env]
3984
3879
  );
@@ -4138,8 +4033,7 @@ function useViewService() {
4138
4033
  views,
4139
4034
  context = {},
4140
4035
  options = {},
4141
- aid,
4142
- service
4036
+ aid
4143
4037
  }) => {
4144
4038
  const defaultOptions = {
4145
4039
  load_filters: true,
@@ -4155,16 +4049,11 @@ function useViewService() {
4155
4049
  },
4156
4050
  with_context: context
4157
4051
  };
4158
- return env?.requests?.post(
4159
- "/call" /* CALL_PATH */,
4160
- jsonDataView,
4161
- {
4162
- headers: {
4163
- "Content-Type": "application/json"
4164
- }
4165
- },
4166
- service
4167
- );
4052
+ return env?.requests?.post("/call" /* CALL_PATH */, jsonDataView, {
4053
+ headers: {
4054
+ "Content-Type": "application/json"
4055
+ }
4056
+ });
4168
4057
  },
4169
4058
  [env]
4170
4059
  );
@@ -4247,7 +4136,7 @@ function useViewService() {
4247
4136
  [env]
4248
4137
  );
4249
4138
  const getSelectionItem = useCallback9(
4250
- async ({ data, service }) => {
4139
+ async ({ data }) => {
4251
4140
  const jsonData = {
4252
4141
  model: data.model,
4253
4142
  ids: [],
@@ -4265,16 +4154,11 @@ function useViewService() {
4265
4154
  }
4266
4155
  }
4267
4156
  };
4268
- return env?.requests.post(
4269
- "/call" /* CALL_PATH */,
4270
- jsonData,
4271
- {
4272
- headers: {
4273
- "Content-Type": "application/json"
4274
- }
4275
- },
4276
- service
4277
- );
4157
+ return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
4158
+ headers: {
4159
+ "Content-Type": "application/json"
4160
+ }
4161
+ });
4278
4162
  },
4279
4163
  [env]
4280
4164
  );
@@ -4567,6 +4451,7 @@ var sessionStorageUtils = () => {
4567
4451
  // src/configs/axios-client.ts
4568
4452
  var axiosClient = {
4569
4453
  init(config) {
4454
+ console.log("config", config);
4570
4455
  const localStorage2 = config?.localStorageUtils ?? localStorageUtils();
4571
4456
  const sessionStorage2 = config?.sessionStorageUtils ?? sessionStorageUtils();
4572
4457
  const db = config?.db;
@@ -4585,25 +4470,21 @@ var axiosClient = {
4585
4470
  };
4586
4471
  const instance = axios.create({
4587
4472
  adapter: axios.defaults.adapter,
4588
- baseURL: config?.baseUrl,
4473
+ baseURL: config.baseUrl,
4589
4474
  timeout: 5e4,
4590
4475
  paramsSerializer: (params) => new URLSearchParams(params).toString()
4591
4476
  });
4592
4477
  instance.interceptors.request.use(async (config2) => {
4593
4478
  const { useRefreshToken, useActionToken, actionToken } = config2;
4594
- let token = null;
4595
4479
  if (useActionToken && actionToken) {
4596
- token = actionToken;
4597
- } else {
4598
- const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
4599
- token = await getToken?.();
4600
- }
4601
- if (token) {
4602
- config2.headers["Authorization"] = `Bearer ${token}`;
4480
+ config2.headers["Action-Token"] = actionToken;
4603
4481
  }
4604
4482
  if (database) {
4605
4483
  config2.headers["DATABASE"] = database;
4606
4484
  }
4485
+ console.log("database", database);
4486
+ const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
4487
+ const token = await getToken?.();
4607
4488
  if (token) config2.headers["Authorization"] = `Bearer ${token}`;
4608
4489
  return config2;
4609
4490
  }, Promise.reject);
@@ -4659,7 +4540,7 @@ var axiosClient = {
4659
4540
  );
4660
4541
  return new Promise(function(resolve) {
4661
4542
  axios.post(
4662
- `${config?.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
4543
+ `${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
4663
4544
  payload,
4664
4545
  {
4665
4546
  headers: {
@@ -4727,47 +4608,20 @@ var axiosClient = {
4727
4608
  function formatUrl(url, db2) {
4728
4609
  return url + (db2 ? "?db=" + db2 : "");
4729
4610
  }
4730
- const getBaseUrl = (baseUrl, serviceName) => {
4731
- const service = serviceName || config?.default_service;
4732
- return config?.default_service === "" ? `${baseUrl.replace(/\/$/, "")}/api/v2` : `${baseUrl.replace(/\/$/, "")}/${service}/api/v2`;
4733
- };
4734
4611
  const responseBody = (response) => response;
4735
4612
  const requests = {
4736
- get: (url, headers, serviceName) => instance.get(
4737
- formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
4738
- headers
4739
- ).then(responseBody),
4740
- post: (url, body, headers, serviceName) => instance.post(
4741
- formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
4742
- body,
4743
- headers
4744
- ).then(responseBody),
4745
- post_excel: (url, body, headers, serviceName) => instance.post(
4746
- formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
4747
- body,
4748
- {
4749
- responseType: "arraybuffer",
4750
- headers: {
4751
- "Content-Type": typeof window !== "undefined" ? "application/json" : "application/javascript",
4752
- Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
4753
- ...headers
4754
- }
4613
+ get: (url, headers) => instance.get(formatUrl(url, db), headers).then(responseBody),
4614
+ post: (url, body, headers) => instance.post(formatUrl(url, db), body, headers).then(responseBody),
4615
+ post_excel: (url, body, headers) => instance.post(formatUrl(url, db), body, {
4616
+ responseType: "arraybuffer",
4617
+ headers: {
4618
+ "Content-Type": typeof window !== "undefined" ? "application/json" : "application/javascript",
4619
+ Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
4755
4620
  }
4756
- ).then(responseBody),
4757
- put: (url, body, headers, serviceName) => instance.put(
4758
- formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
4759
- body,
4760
- headers
4761
- ).then(responseBody),
4762
- patch: (url, body, headers, serviceName) => instance.patch(
4763
- formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
4764
- body,
4765
- headers
4766
- ).then(responseBody),
4767
- delete: (url, headers, serviceName) => instance.delete(
4768
- formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
4769
- headers
4770
- ).then(responseBody)
4621
+ }).then(responseBody),
4622
+ put: (url, body, headers) => instance.put(formatUrl(url, db), body, headers).then(responseBody),
4623
+ patch: (url, body) => instance.patch(formatUrl(url, db), body).then(responseBody),
4624
+ delete: (url, body) => instance.delete(formatUrl(url, db), body).then(responseBody)
4771
4625
  };
4772
4626
  return requests;
4773
4627
  }
@@ -5051,8 +4905,11 @@ import { useMutation as useMutation12 } from "@tanstack/react-query";
5051
4905
  var useValidateActionToken = () => {
5052
4906
  const { isValidActionToken } = useAuthService();
5053
4907
  return useMutation12({
5054
- mutationFn: ({ actionToken }) => {
5055
- return isValidActionToken(actionToken);
4908
+ mutationFn: ({
4909
+ actionToken,
4910
+ path
4911
+ }) => {
4912
+ return isValidActionToken(actionToken, path);
5056
4913
  }
5057
4914
  });
5058
4915
  };
@@ -5198,17 +5055,17 @@ var useParsePreview = () => {
5198
5055
  };
5199
5056
  var use_parse_preview_default = useParsePreview;
5200
5057
 
5201
- // src/hooks/excel/use-upload-file-excel.ts
5058
+ // src/hooks/excel/use-upload-file.ts
5202
5059
  import { useMutation as useMutation18 } from "@tanstack/react-query";
5203
- var useUploadFileExcel = () => {
5204
- const { uploadFileExcel } = useExcelService();
5060
+ var useUploadFile = () => {
5061
+ const { uploadFile } = useExcelService();
5205
5062
  return useMutation18({
5206
- mutationFn: ({ formData }) => uploadFileExcel({
5063
+ mutationFn: ({ formData }) => uploadFile({
5207
5064
  formData
5208
5065
  })
5209
5066
  });
5210
5067
  };
5211
- var use_upload_file_excel_default = useUploadFileExcel;
5068
+ var use_upload_file_default = useUploadFile;
5212
5069
 
5213
5070
  // src/hooks/excel/use-upload-id-file.ts
5214
5071
  import { useMutation as useMutation19 } from "@tanstack/react-query";
@@ -5355,39 +5212,12 @@ var useUploadImage = () => {
5355
5212
  };
5356
5213
  var use_upload_image_default = useUploadImage;
5357
5214
 
5358
- // src/hooks/form/use-upload-file.ts
5359
- import { useMutation as useMutation25 } from "@tanstack/react-query";
5360
- var useUploadFile = () => {
5361
- const { uploadFile } = useFormService();
5362
- return useMutation25({
5363
- mutationFn: ({ formData }) => uploadFile({
5364
- formData
5365
- })
5366
- });
5367
- };
5368
- var use_upload_file_default = useUploadFile;
5369
-
5370
- // src/hooks/form/use-save-file.ts
5371
- import { useMutation as useMutation26 } from "@tanstack/react-query";
5372
- var useSaveFile = () => {
5373
- const { saveFile } = useFormService();
5374
- return useMutation26({
5375
- mutationFn: ({
5376
- model,
5377
- idForm,
5378
- idFile,
5379
- context
5380
- }) => saveFile({ model, idForm, idFile, context })
5381
- });
5382
- };
5383
- var use_save_file_default = useSaveFile;
5384
-
5385
5215
  // src/hooks/model/use-delete.ts
5386
- import { useMutation as useMutation27 } from "@tanstack/react-query";
5216
+ import { useMutation as useMutation25 } from "@tanstack/react-query";
5387
5217
  var useDelete = () => {
5388
5218
  const { deleteApi } = useModelService();
5389
- return useMutation27({
5390
- mutationFn: ({ ids, model, service }) => deleteApi({ ids, model, service })
5219
+ return useMutation25({
5220
+ mutationFn: ({ ids, model }) => deleteApi({ ids, model })
5391
5221
  });
5392
5222
  };
5393
5223
  var use_delete_default = useDelete;
@@ -5442,22 +5272,20 @@ var useGetCurrency = () => {
5442
5272
  var use_get_currency_default = useGetCurrency;
5443
5273
 
5444
5274
  // src/hooks/model/use-get-detail.ts
5445
- import { useMutation as useMutation28 } from "@tanstack/react-query";
5275
+ import { useMutation as useMutation26 } from "@tanstack/react-query";
5446
5276
  var useGetDetail = () => {
5447
5277
  const { getDetail } = useModelService();
5448
- return useMutation28({
5278
+ return useMutation26({
5449
5279
  mutationFn: ({
5450
5280
  model,
5451
5281
  ids,
5452
5282
  specification,
5453
- context,
5454
- service
5283
+ context
5455
5284
  }) => getDetail({
5456
5285
  model,
5457
5286
  ids,
5458
5287
  specification,
5459
- context,
5460
- service
5288
+ context
5461
5289
  })
5462
5290
  });
5463
5291
  };
@@ -5465,16 +5293,12 @@ var use_get_detail_default = useGetDetail;
5465
5293
 
5466
5294
  // src/hooks/model/use-get-field-onchange.ts
5467
5295
  import { useQuery as useQuery9 } from "@tanstack/react-query";
5468
- var useGetFieldOnChange = ({
5469
- model,
5470
- service
5471
- }) => {
5296
+ var useGetFieldOnChange = ({ model }) => {
5472
5297
  const { getListFieldsOnchange } = useModelService();
5473
5298
  return useQuery9({
5474
5299
  queryKey: [`field-onchange-${model}`, model],
5475
5300
  queryFn: () => getListFieldsOnchange({
5476
- model,
5477
- service
5301
+ model
5478
5302
  }).then((res) => {
5479
5303
  if (res) {
5480
5304
  return res;
@@ -5556,8 +5380,7 @@ var BaseModel = class {
5556
5380
  spec[field?.name] = {
5557
5381
  fields: {
5558
5382
  id: {},
5559
- display_name: {},
5560
- ...field?.widget === "many2many_binary" ? { mimetype: {} } : {}
5383
+ display_name: {}
5561
5384
  }
5562
5385
  };
5563
5386
  }
@@ -5648,64 +5471,61 @@ var useOdooDataTransform = () => {
5648
5471
  var use_odoo_data_transform_default = useOdooDataTransform;
5649
5472
 
5650
5473
  // src/hooks/model/use-onchange-form.ts
5651
- import { useMutation as useMutation29 } from "@tanstack/react-query";
5474
+ import { useMutation as useMutation27 } from "@tanstack/react-query";
5652
5475
  var useOnChangeForm = () => {
5653
5476
  const { onChange } = useModelService();
5654
- return useMutation29({
5477
+ return useMutation27({
5655
5478
  mutationFn: ({
5656
5479
  ids,
5657
5480
  model,
5658
5481
  specification,
5659
5482
  context,
5660
5483
  object,
5661
- fieldChange,
5662
- service
5484
+ fieldChange
5663
5485
  }) => onChange({
5664
5486
  ids,
5665
5487
  model,
5666
5488
  specification,
5667
5489
  context,
5668
5490
  object,
5669
- fieldChange,
5670
- service
5491
+ fieldChange
5671
5492
  })
5672
5493
  });
5673
5494
  };
5674
5495
  var use_onchange_form_default = useOnChangeForm;
5675
5496
 
5676
5497
  // src/hooks/model/use-save.ts
5677
- import { useMutation as useMutation30 } from "@tanstack/react-query";
5498
+ import { useMutation as useMutation28 } from "@tanstack/react-query";
5678
5499
  var useSave = () => {
5679
5500
  const { save } = useModelService();
5680
- return useMutation30({
5501
+ return useMutation28({
5681
5502
  mutationFn: ({
5682
5503
  ids,
5683
5504
  model,
5684
5505
  data,
5685
5506
  specification,
5686
5507
  context,
5687
- path,
5688
- service
5689
- }) => save({ ids, model, data, specification, context, path, service })
5508
+ path
5509
+ }) => save({ ids, model, data, specification, context, path })
5690
5510
  });
5691
5511
  };
5692
5512
  var use_save_default = useSave;
5693
5513
 
5694
5514
  // src/hooks/user/use-get-profile.ts
5695
- import { useMutation as useMutation31 } from "@tanstack/react-query";
5515
+ import { useMutation as useMutation29 } from "@tanstack/react-query";
5696
5516
  var useGetProfile = (path) => {
5697
5517
  const { getProfile } = useUserService();
5698
- return useMutation31({
5518
+ return useMutation29({
5699
5519
  mutationFn: () => getProfile(path)
5700
5520
  });
5701
5521
  };
5702
5522
  var use_get_profile_default = useGetProfile;
5703
5523
 
5704
5524
  // src/hooks/user/use-get-user.ts
5705
- import { useMutation as useMutation32 } from "@tanstack/react-query";
5525
+ import { useMutation as useMutation30 } from "@tanstack/react-query";
5706
5526
  var useGetUser = () => {
5707
5527
  const { getUser } = useUserService();
5708
- return useMutation32({
5528
+ return useMutation30({
5709
5529
  mutationFn: ({ id, context }) => getUser({
5710
5530
  id,
5711
5531
  context
@@ -5715,10 +5535,10 @@ var useGetUser = () => {
5715
5535
  var use_get_user_default = useGetUser;
5716
5536
 
5717
5537
  // src/hooks/user/use-switch-locale.ts
5718
- import { useMutation as useMutation33 } from "@tanstack/react-query";
5538
+ import { useMutation as useMutation31 } from "@tanstack/react-query";
5719
5539
  var useSwitchLocale = () => {
5720
5540
  const { switchUserLocale } = useUserService();
5721
- return useMutation33({
5541
+ return useMutation31({
5722
5542
  mutationFn: ({ data }) => {
5723
5543
  return switchUserLocale({
5724
5544
  id: data.id,
@@ -5730,22 +5550,20 @@ var useSwitchLocale = () => {
5730
5550
  var use_switch_locale_default = useSwitchLocale;
5731
5551
 
5732
5552
  // src/hooks/view/use-button.ts
5733
- import { useMutation as useMutation34 } from "@tanstack/react-query";
5553
+ import { useMutation as useMutation32 } from "@tanstack/react-query";
5734
5554
  var useButton = () => {
5735
5555
  const { callButton } = useActionService();
5736
- return useMutation34({
5556
+ return useMutation32({
5737
5557
  mutationFn: ({
5738
5558
  model,
5739
5559
  ids,
5740
5560
  context,
5741
- method,
5742
- service
5561
+ method
5743
5562
  }) => callButton({
5744
5563
  model,
5745
5564
  ids,
5746
5565
  context,
5747
- method,
5748
- service
5566
+ method
5749
5567
  }),
5750
5568
  onSuccess: (response) => {
5751
5569
  return response;
@@ -5755,20 +5573,18 @@ var useButton = () => {
5755
5573
  var use_button_default = useButton;
5756
5574
 
5757
5575
  // src/hooks/view/use-duplicate-record.ts
5758
- import { useMutation as useMutation35 } from "@tanstack/react-query";
5576
+ import { useMutation as useMutation33 } from "@tanstack/react-query";
5759
5577
  var useDuplicateRecord = () => {
5760
5578
  const { duplicateRecord } = useActionService();
5761
- return useMutation35({
5579
+ return useMutation33({
5762
5580
  mutationFn: ({
5763
5581
  id,
5764
5582
  model,
5765
- context,
5766
- service
5583
+ context
5767
5584
  }) => duplicateRecord({
5768
5585
  id,
5769
5586
  model,
5770
- context,
5771
- service
5587
+ context
5772
5588
  })
5773
5589
  });
5774
5590
  };
@@ -5851,11 +5667,11 @@ var use_get_groups_default = useGetGroups;
5851
5667
 
5852
5668
  // src/hooks/view/use-get-list-data.ts
5853
5669
  import { useQuery as useQuery14 } from "@tanstack/react-query";
5854
- var useGetListData = (listDataProps, queryKey, enabled, service) => {
5670
+ var useGetListData = (listDataProps, queryKey, enabled) => {
5855
5671
  const { getAll } = useModelService();
5856
5672
  return useQuery14({
5857
5673
  queryKey,
5858
- queryFn: () => getAll({ data: listDataProps, service }).then((res) => {
5674
+ queryFn: () => getAll({ data: listDataProps }).then((res) => {
5859
5675
  if (res) {
5860
5676
  return res;
5861
5677
  }
@@ -5888,10 +5704,10 @@ var useGetMenu = (context, specification, enabled) => {
5888
5704
  var use_get_menu_default = useGetMenu;
5889
5705
 
5890
5706
  // src/hooks/view/use-get-print-report.ts
5891
- import { useMutation as useMutation36 } from "@tanstack/react-query";
5707
+ import { useMutation as useMutation34 } from "@tanstack/react-query";
5892
5708
  var useGetPrintReport = () => {
5893
5709
  const { getPrintReportName } = useActionService();
5894
- return useMutation36({
5710
+ return useMutation34({
5895
5711
  mutationFn: ({ id }) => getPrintReportName({
5896
5712
  id
5897
5713
  })
@@ -5931,13 +5747,12 @@ import { useQuery as useQuery17 } from "@tanstack/react-query";
5931
5747
  var useGetSelection = ({
5932
5748
  data,
5933
5749
  queryKey,
5934
- enabled,
5935
- service
5750
+ enabled
5936
5751
  }) => {
5937
5752
  const { getSelectionItem } = useViewService();
5938
5753
  return useQuery17({
5939
5754
  queryKey,
5940
- queryFn: () => getSelectionItem({ data, service }),
5755
+ queryFn: () => getSelectionItem({ data }),
5941
5756
  enabled,
5942
5757
  refetchOnWindowFocus: false
5943
5758
  });
@@ -5959,19 +5774,17 @@ var useGetView = (viewParams, actData) => {
5959
5774
  var use_get_view_default = useGetView;
5960
5775
 
5961
5776
  // src/hooks/view/use-load-action.ts
5962
- import { useMutation as useMutation37 } from "@tanstack/react-query";
5777
+ import { useMutation as useMutation35 } from "@tanstack/react-query";
5963
5778
  var useLoadAction = () => {
5964
5779
  const { loadAction } = useActionService();
5965
- return useMutation37({
5780
+ return useMutation35({
5966
5781
  mutationFn: ({
5967
5782
  idAction,
5968
- context,
5969
- service
5783
+ context
5970
5784
  }) => {
5971
5785
  return loadAction({
5972
5786
  idAction,
5973
- context,
5974
- service
5787
+ context
5975
5788
  });
5976
5789
  }
5977
5790
  });
@@ -5991,10 +5804,10 @@ var useLoadMessage = () => {
5991
5804
  var use_load_message_default = useLoadMessage;
5992
5805
 
5993
5806
  // src/hooks/view/use-print.ts
5994
- import { useMutation as useMutation38 } from "@tanstack/react-query";
5807
+ import { useMutation as useMutation36 } from "@tanstack/react-query";
5995
5808
  var usePrint = () => {
5996
5809
  const { print } = useActionService();
5997
- return useMutation38({
5810
+ return useMutation36({
5998
5811
  mutationFn: ({ id, report, db }) => print({
5999
5812
  id,
6000
5813
  report,
@@ -6005,20 +5818,18 @@ var usePrint = () => {
6005
5818
  var use_print_default = usePrint;
6006
5819
 
6007
5820
  // src/hooks/view/use-remove-row.ts
6008
- import { useMutation as useMutation39 } from "@tanstack/react-query";
5821
+ import { useMutation as useMutation37 } from "@tanstack/react-query";
6009
5822
  var useRemoveRow = () => {
6010
5823
  const { removeRows } = useActionService();
6011
- return useMutation39({
5824
+ return useMutation37({
6012
5825
  mutationFn: ({
6013
5826
  model,
6014
5827
  ids,
6015
- context,
6016
- service
5828
+ context
6017
5829
  }) => removeRows({
6018
5830
  model,
6019
5831
  ids,
6020
- context,
6021
- service
5832
+ context
6022
5833
  })
6023
5834
  });
6024
5835
  };
@@ -6043,28 +5854,26 @@ var useGetResequence = (model, resIds, context, offset) => {
6043
5854
  var use_resequence_default = useGetResequence;
6044
5855
 
6045
5856
  // src/hooks/view/use-run-action.ts
6046
- import { useMutation as useMutation40 } from "@tanstack/react-query";
5857
+ import { useMutation as useMutation38 } from "@tanstack/react-query";
6047
5858
  var useRunAction = () => {
6048
5859
  const { runAction } = useActionService();
6049
- return useMutation40({
5860
+ return useMutation38({
6050
5861
  mutationFn: ({
6051
5862
  idAction,
6052
- context,
6053
- service
5863
+ context
6054
5864
  }) => runAction({
6055
5865
  idAction,
6056
- context,
6057
- service
5866
+ context
6058
5867
  })
6059
5868
  });
6060
5869
  };
6061
5870
  var use_run_action_default = useRunAction;
6062
5871
 
6063
5872
  // src/hooks/view/use-signin-sso.ts
6064
- import { useMutation as useMutation41 } from "@tanstack/react-query";
5873
+ import { useMutation as useMutation39 } from "@tanstack/react-query";
6065
5874
  var useSignInSSO = () => {
6066
5875
  const { signInSSO } = useViewService();
6067
- return useMutation41({
5876
+ return useMutation39({
6068
5877
  mutationFn: ({
6069
5878
  redirect_uri,
6070
5879
  state,
@@ -6087,10 +5896,10 @@ var useSignInSSO = () => {
6087
5896
  var use_signin_sso_default = useSignInSSO;
6088
5897
 
6089
5898
  // src/hooks/view/use-verify-2FA.ts
6090
- import { useMutation as useMutation42 } from "@tanstack/react-query";
5899
+ import { useMutation as useMutation40 } from "@tanstack/react-query";
6091
5900
  var useVerify2FA = () => {
6092
5901
  const { verify2FA } = useViewService();
6093
- return useMutation42({
5902
+ return useMutation40({
6094
5903
  mutationFn: ({
6095
5904
  method,
6096
5905
  with_context,
@@ -6111,10 +5920,10 @@ var useVerify2FA = () => {
6111
5920
  var use_verify_2FA_default = useVerify2FA;
6112
5921
 
6113
5922
  // src/hooks/view/uset-get-2FA-method.ts
6114
- import { useMutation as useMutation43 } from "@tanstack/react-query";
5923
+ import { useMutation as useMutation41 } from "@tanstack/react-query";
6115
5924
  var useGet2FAMethods = () => {
6116
5925
  const { get2FAMethods } = useViewService();
6117
- return useMutation43({
5926
+ return useMutation41({
6118
5927
  mutationFn: ({
6119
5928
  method,
6120
5929
  with_context
@@ -6129,10 +5938,10 @@ var useGet2FAMethods = () => {
6129
5938
  var uset_get_2FA_method_default = useGet2FAMethods;
6130
5939
 
6131
5940
  // src/hooks/view/use-grant-access.ts
6132
- import { useMutation as useMutation44 } from "@tanstack/react-query";
5941
+ import { useMutation as useMutation42 } from "@tanstack/react-query";
6133
5942
  var useGrantAccess = () => {
6134
5943
  const { grantAccess } = useViewService();
6135
- return useMutation44({
5944
+ return useMutation42({
6136
5945
  mutationFn: ({
6137
5946
  redirect_uri,
6138
5947
  state,
@@ -6151,10 +5960,10 @@ var useGrantAccess = () => {
6151
5960
  var use_grant_access_default = useGrantAccess;
6152
5961
 
6153
5962
  // src/hooks/view/use-remove-totp-setup.ts
6154
- import { useMutation as useMutation45 } from "@tanstack/react-query";
5963
+ import { useMutation as useMutation43 } from "@tanstack/react-query";
6155
5964
  var useRemoveTotpSetup = () => {
6156
5965
  const { removeTotpSetUp } = useViewService();
6157
- return useMutation45({
5966
+ return useMutation43({
6158
5967
  mutationFn: ({ method, token }) => {
6159
5968
  return removeTotpSetUp({
6160
5969
  method,
@@ -6166,10 +5975,10 @@ var useRemoveTotpSetup = () => {
6166
5975
  var use_remove_totp_setup_default = useRemoveTotpSetup;
6167
5976
 
6168
5977
  // src/hooks/view/use-request-setup-totp.ts
6169
- import { useMutation as useMutation46 } from "@tanstack/react-query";
5978
+ import { useMutation as useMutation44 } from "@tanstack/react-query";
6170
5979
  var useRequestSetupTotp = () => {
6171
5980
  const { requestSetupTotp } = useViewService();
6172
- return useMutation46({
5981
+ return useMutation44({
6173
5982
  mutationFn: ({ method, token }) => {
6174
5983
  return requestSetupTotp({
6175
5984
  method,
@@ -6181,10 +5990,10 @@ var useRequestSetupTotp = () => {
6181
5990
  var use_request_setup_totp_default = useRequestSetupTotp;
6182
5991
 
6183
5992
  // src/hooks/view/use-settings-web-read-2fa.ts
6184
- import { useMutation as useMutation47 } from "@tanstack/react-query";
5993
+ import { useMutation as useMutation45 } from "@tanstack/react-query";
6185
5994
  var useSettingsWebRead2fa = () => {
6186
5995
  const { settingsWebRead2fa } = useViewService();
6187
- return useMutation47({
5996
+ return useMutation45({
6188
5997
  mutationFn: ({
6189
5998
  method,
6190
5999
  token,
@@ -6203,10 +6012,10 @@ var useSettingsWebRead2fa = () => {
6203
6012
  var use_settings_web_read_2fa_default = useSettingsWebRead2fa;
6204
6013
 
6205
6014
  // src/hooks/view/use-verify-totp.ts
6206
- import { useMutation as useMutation48 } from "@tanstack/react-query";
6015
+ import { useMutation as useMutation46 } from "@tanstack/react-query";
6207
6016
  var useVerifyTotp = () => {
6208
6017
  const { verifyTotp } = useViewService();
6209
- return useMutation48({
6018
+ return useMutation46({
6210
6019
  mutationFn: ({
6211
6020
  method,
6212
6021
  action_token,
@@ -6229,7 +6038,6 @@ var ServiceProvider = ({
6229
6038
  children
6230
6039
  }) => {
6231
6040
  const services = {
6232
- useSaveFile: use_save_file_default,
6233
6041
  useForgotPassword: use_forgot_password_default,
6234
6042
  useForgotPasswordSSO: use_forgotpassword_sso_default,
6235
6043
  useGetProvider: use_get_provider_default,
@@ -6250,7 +6058,7 @@ var ServiceProvider = ({
6250
6058
  useGetFieldExport: use_get_field_export_default,
6251
6059
  useGetFileExcel: use_get_file_excel_default,
6252
6060
  useParsePreview: use_parse_preview_default,
6253
- useUploadFileExcel: use_upload_file_excel_default,
6061
+ useUploadFile: use_upload_file_default,
6254
6062
  useUploadIdFile: use_upload_id_file_default,
6255
6063
  useChangeStatus: use_change_status_default,
6256
6064
  useDeleteComment: use_delete_comment_default,
@@ -6297,8 +6105,7 @@ var ServiceProvider = ({
6297
6105
  useRemoveTotpSetup: use_remove_totp_setup_default,
6298
6106
  useRequestSetupTotp: use_request_setup_totp_default,
6299
6107
  useSettingsWebRead2fa: use_settings_web_read_2fa_default,
6300
- useVerifyTotp: use_verify_totp_default,
6301
- useUploadFile: use_upload_file_default
6108
+ useVerifyTotp: use_verify_totp_default
6302
6109
  };
6303
6110
  return /* @__PURE__ */ jsx6(ServiceContext.Provider, { value: services, children });
6304
6111
  };