@fctc/interface-logic 2.3.0 → 2.3.1

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/services.mjs CHANGED
@@ -2894,9 +2894,12 @@ import { useMutation as useMutation24 } from "@tanstack/react-query";
2894
2894
  // src/hooks/form/use-upload-file.ts
2895
2895
  import { useMutation as useMutation25 } from "@tanstack/react-query";
2896
2896
 
2897
- // src/hooks/model/use-delete.ts
2897
+ // src/hooks/form/use-save-file.ts
2898
2898
  import { useMutation as useMutation26 } from "@tanstack/react-query";
2899
2899
 
2900
+ // src/hooks/model/use-delete.ts
2901
+ import { useMutation as useMutation27 } from "@tanstack/react-query";
2902
+
2900
2903
  // src/hooks/model/use-get-all.ts
2901
2904
  import { useQuery as useQuery6 } from "@tanstack/react-query";
2902
2905
 
@@ -2907,7 +2910,7 @@ import { useQuery as useQuery7 } from "@tanstack/react-query";
2907
2910
  import { useQuery as useQuery8 } from "@tanstack/react-query";
2908
2911
 
2909
2912
  // src/hooks/model/use-get-detail.ts
2910
- import { useMutation as useMutation27 } from "@tanstack/react-query";
2913
+ import { useMutation as useMutation28 } from "@tanstack/react-query";
2911
2914
 
2912
2915
  // src/hooks/model/use-get-field-onchange.ts
2913
2916
  import { useQuery as useQuery9 } from "@tanstack/react-query";
@@ -2916,25 +2919,25 @@ import { useQuery as useQuery9 } from "@tanstack/react-query";
2916
2919
  import { useQuery as useQuery10 } from "@tanstack/react-query";
2917
2920
 
2918
2921
  // src/hooks/model/use-onchange-form.ts
2919
- import { useMutation as useMutation28 } from "@tanstack/react-query";
2922
+ import { useMutation as useMutation29 } from "@tanstack/react-query";
2920
2923
 
2921
2924
  // src/hooks/model/use-save.ts
2922
- import { useMutation as useMutation29 } from "@tanstack/react-query";
2925
+ import { useMutation as useMutation30 } from "@tanstack/react-query";
2923
2926
 
2924
2927
  // src/hooks/user/use-get-profile.ts
2925
- import { useMutation as useMutation30 } from "@tanstack/react-query";
2928
+ import { useMutation as useMutation31 } from "@tanstack/react-query";
2926
2929
 
2927
2930
  // src/hooks/user/use-get-user.ts
2928
- import { useMutation as useMutation31 } from "@tanstack/react-query";
2931
+ import { useMutation as useMutation32 } from "@tanstack/react-query";
2929
2932
 
2930
2933
  // src/hooks/user/use-switch-locale.ts
2931
- import { useMutation as useMutation32 } from "@tanstack/react-query";
2934
+ import { useMutation as useMutation33 } from "@tanstack/react-query";
2932
2935
 
2933
2936
  // src/hooks/view/use-button.ts
2934
- import { useMutation as useMutation33 } from "@tanstack/react-query";
2937
+ import { useMutation as useMutation34 } from "@tanstack/react-query";
2935
2938
 
2936
2939
  // src/hooks/view/use-duplicate-record.ts
2937
- import { useMutation as useMutation34 } from "@tanstack/react-query";
2940
+ import { useMutation as useMutation35 } from "@tanstack/react-query";
2938
2941
 
2939
2942
  // src/hooks/view/use-get-action-detail.ts
2940
2943
  import { useQuery as useQuery11 } from "@tanstack/react-query";
@@ -2952,7 +2955,7 @@ import { useQuery as useQuery14 } from "@tanstack/react-query";
2952
2955
  import { useQuery as useQuery15 } from "@tanstack/react-query";
2953
2956
 
2954
2957
  // src/hooks/view/use-get-print-report.ts
2955
- import { useMutation as useMutation35 } from "@tanstack/react-query";
2958
+ import { useMutation as useMutation36 } from "@tanstack/react-query";
2956
2959
 
2957
2960
  // src/hooks/view/use-get-progress-bar.ts
2958
2961
  import { useQuery as useQuery16 } from "@tanstack/react-query";
@@ -2964,46 +2967,46 @@ import { useQuery as useQuery17 } from "@tanstack/react-query";
2964
2967
  import { useQuery as useQuery18 } from "@tanstack/react-query";
2965
2968
 
2966
2969
  // src/hooks/view/use-load-action.ts
2967
- import { useMutation as useMutation36 } from "@tanstack/react-query";
2970
+ import { useMutation as useMutation37 } from "@tanstack/react-query";
2968
2971
 
2969
2972
  // src/hooks/view/use-load-message.ts
2970
2973
  import { useQuery as useQuery19 } from "@tanstack/react-query";
2971
2974
 
2972
2975
  // src/hooks/view/use-print.ts
2973
- import { useMutation as useMutation37 } from "@tanstack/react-query";
2976
+ import { useMutation as useMutation38 } from "@tanstack/react-query";
2974
2977
 
2975
2978
  // src/hooks/view/use-remove-row.ts
2976
- import { useMutation as useMutation38 } from "@tanstack/react-query";
2979
+ import { useMutation as useMutation39 } from "@tanstack/react-query";
2977
2980
 
2978
2981
  // src/hooks/view/use-resequence.ts
2979
2982
  import { useQuery as useQuery20 } from "@tanstack/react-query";
2980
2983
 
2981
2984
  // src/hooks/view/use-run-action.ts
2982
- import { useMutation as useMutation39 } from "@tanstack/react-query";
2985
+ import { useMutation as useMutation40 } from "@tanstack/react-query";
2983
2986
 
2984
2987
  // src/hooks/view/use-signin-sso.ts
2985
- import { useMutation as useMutation40 } from "@tanstack/react-query";
2988
+ import { useMutation as useMutation41 } from "@tanstack/react-query";
2986
2989
 
2987
2990
  // src/hooks/view/use-verify-2FA.ts
2988
- import { useMutation as useMutation41 } from "@tanstack/react-query";
2991
+ import { useMutation as useMutation42 } from "@tanstack/react-query";
2989
2992
 
2990
2993
  // src/hooks/view/uset-get-2FA-method.ts
2991
- import { useMutation as useMutation42 } from "@tanstack/react-query";
2994
+ import { useMutation as useMutation43 } from "@tanstack/react-query";
2992
2995
 
2993
2996
  // src/hooks/view/use-grant-access.ts
2994
- import { useMutation as useMutation43 } from "@tanstack/react-query";
2997
+ import { useMutation as useMutation44 } from "@tanstack/react-query";
2995
2998
 
2996
2999
  // src/hooks/view/use-remove-totp-setup.ts
2997
- import { useMutation as useMutation44 } from "@tanstack/react-query";
3000
+ import { useMutation as useMutation45 } from "@tanstack/react-query";
2998
3001
 
2999
3002
  // src/hooks/view/use-request-setup-totp.ts
3000
- import { useMutation as useMutation45 } from "@tanstack/react-query";
3003
+ import { useMutation as useMutation46 } from "@tanstack/react-query";
3001
3004
 
3002
3005
  // src/hooks/view/use-settings-web-read-2fa.ts
3003
- import { useMutation as useMutation46 } from "@tanstack/react-query";
3006
+ import { useMutation as useMutation47 } from "@tanstack/react-query";
3004
3007
 
3005
3008
  // src/hooks/view/use-verify-totp.ts
3006
- import { useMutation as useMutation47 } from "@tanstack/react-query";
3009
+ import { useMutation as useMutation48 } from "@tanstack/react-query";
3007
3010
 
3008
3011
  // src/provider/service-provider.tsx
3009
3012
  import { jsx as jsx6 } from "react/jsx-runtime";
@@ -3702,6 +3705,35 @@ function useFormService() {
3702
3705
  },
3703
3706
  [env]
3704
3707
  );
3708
+ const saveFile = useCallback6(
3709
+ async ({
3710
+ model,
3711
+ idForm,
3712
+ idFile,
3713
+ context
3714
+ }) => {
3715
+ const jsonData = {
3716
+ model,
3717
+ method: "web_save" /* WEB_SAVE */,
3718
+ ids: [
3719
+ [idForm],
3720
+ {
3721
+ attachment_ids: [[4, idFile]]
3722
+ }
3723
+ ],
3724
+ kwargs: {
3725
+ context,
3726
+ specification: {}
3727
+ }
3728
+ };
3729
+ return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3730
+ headers: {
3731
+ "Content-Type": "application/json"
3732
+ }
3733
+ });
3734
+ },
3735
+ [env]
3736
+ );
3705
3737
  const getFormView = useCallback6(
3706
3738
  async ({ data }) => {
3707
3739
  const jsonData = {
@@ -3755,7 +3787,8 @@ function useFormService() {
3755
3787
  uploadImage,
3756
3788
  getFormView,
3757
3789
  changeStatus,
3758
- uploadFile
3790
+ uploadFile,
3791
+ saveFile
3759
3792
  };
3760
3793
  }
3761
3794
 
@@ -4308,8 +4341,7 @@ function useViewService() {
4308
4341
  [env]
4309
4342
  );
4310
4343
  const getMenu = useCallback10(
4311
- async (context, specification, domain) => {
4312
- console.log("domain", domain);
4344
+ async (context, specification) => {
4313
4345
  const jsonData = {
4314
4346
  model: "ir.ui.menu" /* MENU */,
4315
4347
  method: "web_search_read" /* WEB_SEARCH_READ */,
@@ -4317,7 +4349,7 @@ function useViewService() {
4317
4349
  with_context: context,
4318
4350
  kwargs: {
4319
4351
  specification,
4320
- domain: domain ?? [
4352
+ domain: [
4321
4353
  "&",
4322
4354
  ["is_display", "=", true],
4323
4355
  "&",
package/package.json CHANGED
@@ -1,85 +1,85 @@
1
- {
2
- "name": "@fctc/interface-logic",
3
- "version": "2.3.0",
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.3.1",
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
+ }