@fctc/interface-logic 2.0.4 → 2.0.6
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.d.mts +6 -6
- package/dist/configs.d.ts +6 -6
- package/dist/configs.js +40 -15
- package/dist/configs.mjs +40 -15
- package/dist/environment.js +40 -15
- package/dist/environment.mjs +40 -15
- package/dist/hooks.d.mts +15 -5
- package/dist/hooks.d.ts +15 -5
- package/dist/hooks.js +182 -187
- package/dist/hooks.mjs +182 -187
- package/dist/provider.d.mts +1 -1
- package/dist/provider.d.ts +1 -1
- package/dist/provider.js +222 -202
- package/dist/provider.mjs +222 -202
- package/dist/services.d.mts +23 -16
- package/dist/services.d.ts +23 -16
- package/dist/services.js +141 -162
- package/dist/services.mjs +141 -162
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/{view-type-BGJfDe73.d.mts → view-type-p4JdAOsz.d.mts} +5 -0
- package/dist/{view-type-BGJfDe73.d.ts → view-type-p4JdAOsz.d.ts} +5 -0
- package/package.json +85 -85
package/dist/provider.mjs
CHANGED
|
@@ -2848,15 +2848,21 @@ function useActionService() {
|
|
|
2848
2848
|
const loadAction = useCallback(
|
|
2849
2849
|
async ({
|
|
2850
2850
|
idAction,
|
|
2851
|
-
context
|
|
2851
|
+
context,
|
|
2852
|
+
service
|
|
2852
2853
|
}) => {
|
|
2853
2854
|
const jsonData = {
|
|
2854
2855
|
action_id: idAction,
|
|
2855
2856
|
with_context: { ...context }
|
|
2856
2857
|
};
|
|
2857
|
-
return env.requests.post(
|
|
2858
|
-
|
|
2859
|
-
|
|
2858
|
+
return env.requests.post(
|
|
2859
|
+
"/load_action" /* LOAD_ACTION */,
|
|
2860
|
+
jsonData,
|
|
2861
|
+
{
|
|
2862
|
+
headers: { "Content-Type": "application/json" }
|
|
2863
|
+
},
|
|
2864
|
+
service
|
|
2865
|
+
);
|
|
2860
2866
|
},
|
|
2861
2867
|
[env]
|
|
2862
2868
|
);
|
|
@@ -2865,7 +2871,8 @@ function useActionService() {
|
|
|
2865
2871
|
model,
|
|
2866
2872
|
ids = [],
|
|
2867
2873
|
context,
|
|
2868
|
-
method
|
|
2874
|
+
method,
|
|
2875
|
+
service
|
|
2869
2876
|
}) => {
|
|
2870
2877
|
try {
|
|
2871
2878
|
const jsonData = {
|
|
@@ -2874,9 +2881,14 @@ function useActionService() {
|
|
|
2874
2881
|
ids,
|
|
2875
2882
|
with_context: context
|
|
2876
2883
|
};
|
|
2877
|
-
return env.requests.post(
|
|
2878
|
-
|
|
2879
|
-
|
|
2884
|
+
return env.requests.post(
|
|
2885
|
+
"/call" /* CALL_PATH */,
|
|
2886
|
+
jsonData,
|
|
2887
|
+
{
|
|
2888
|
+
headers: { "Content-Type": "application/json" }
|
|
2889
|
+
},
|
|
2890
|
+
service
|
|
2891
|
+
);
|
|
2880
2892
|
} catch (error) {
|
|
2881
2893
|
console.error("Error when calling button action:", error);
|
|
2882
2894
|
throw error;
|
|
@@ -2888,7 +2900,8 @@ function useActionService() {
|
|
|
2888
2900
|
async ({
|
|
2889
2901
|
model,
|
|
2890
2902
|
ids,
|
|
2891
|
-
context
|
|
2903
|
+
context,
|
|
2904
|
+
service
|
|
2892
2905
|
}) => {
|
|
2893
2906
|
const jsonData = {
|
|
2894
2907
|
model,
|
|
@@ -2896,9 +2909,14 @@ function useActionService() {
|
|
|
2896
2909
|
ids,
|
|
2897
2910
|
with_context: context
|
|
2898
2911
|
};
|
|
2899
|
-
return env.requests.post(
|
|
2900
|
-
|
|
2901
|
-
|
|
2912
|
+
return env.requests.post(
|
|
2913
|
+
"/call" /* CALL_PATH */,
|
|
2914
|
+
jsonData,
|
|
2915
|
+
{
|
|
2916
|
+
headers: { "Content-Type": "application/json" }
|
|
2917
|
+
},
|
|
2918
|
+
service
|
|
2919
|
+
);
|
|
2902
2920
|
},
|
|
2903
2921
|
[env]
|
|
2904
2922
|
);
|
|
@@ -2906,7 +2924,8 @@ function useActionService() {
|
|
|
2906
2924
|
async ({
|
|
2907
2925
|
model,
|
|
2908
2926
|
id,
|
|
2909
|
-
context
|
|
2927
|
+
context,
|
|
2928
|
+
service
|
|
2910
2929
|
}) => {
|
|
2911
2930
|
const jsonData = {
|
|
2912
2931
|
model,
|
|
@@ -2914,9 +2933,14 @@ function useActionService() {
|
|
|
2914
2933
|
ids: id,
|
|
2915
2934
|
with_context: context
|
|
2916
2935
|
};
|
|
2917
|
-
return env.requests.post(
|
|
2918
|
-
|
|
2919
|
-
|
|
2936
|
+
return env.requests.post(
|
|
2937
|
+
"/call" /* CALL_PATH */,
|
|
2938
|
+
jsonData,
|
|
2939
|
+
{
|
|
2940
|
+
headers: { "Content-Type": "application/json" }
|
|
2941
|
+
},
|
|
2942
|
+
service
|
|
2943
|
+
);
|
|
2920
2944
|
},
|
|
2921
2945
|
[env]
|
|
2922
2946
|
);
|
|
@@ -2959,15 +2983,21 @@ function useActionService() {
|
|
|
2959
2983
|
const runAction = useCallback(
|
|
2960
2984
|
async ({
|
|
2961
2985
|
idAction,
|
|
2962
|
-
context
|
|
2986
|
+
context,
|
|
2987
|
+
service
|
|
2963
2988
|
}) => {
|
|
2964
2989
|
const jsonData = {
|
|
2965
2990
|
action_id: idAction,
|
|
2966
2991
|
with_context: { ...context }
|
|
2967
2992
|
};
|
|
2968
|
-
return env.requests.post(
|
|
2969
|
-
|
|
2970
|
-
|
|
2993
|
+
return env.requests.post(
|
|
2994
|
+
"/run_action" /* RUN_ACTION_PATH */,
|
|
2995
|
+
jsonData,
|
|
2996
|
+
{
|
|
2997
|
+
headers: { "Content-Type": "application/json" }
|
|
2998
|
+
},
|
|
2999
|
+
service
|
|
3000
|
+
);
|
|
2971
3001
|
},
|
|
2972
3002
|
[env]
|
|
2973
3003
|
);
|
|
@@ -3248,11 +3278,7 @@ function useExcelService() {
|
|
|
3248
3278
|
const { env } = useEnv();
|
|
3249
3279
|
const uploadFile = useCallback4(
|
|
3250
3280
|
async ({ formData }) => {
|
|
3251
|
-
return env.requests.post("/upload/file" /* UPLOAD_FILE_PATH */, formData
|
|
3252
|
-
headers: {
|
|
3253
|
-
"Content-Type": "multipart/form-data"
|
|
3254
|
-
}
|
|
3255
|
-
});
|
|
3281
|
+
return env.requests.post("/upload/file" /* UPLOAD_FILE_PATH */, formData);
|
|
3256
3282
|
},
|
|
3257
3283
|
[env]
|
|
3258
3284
|
);
|
|
@@ -3496,12 +3522,8 @@ function useFormService() {
|
|
|
3496
3522
|
[env]
|
|
3497
3523
|
);
|
|
3498
3524
|
const uploadImage = useCallback5(
|
|
3499
|
-
async ({
|
|
3500
|
-
return env.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */,
|
|
3501
|
-
headers: {
|
|
3502
|
-
"Content-Type": "multipart/form-data"
|
|
3503
|
-
}
|
|
3504
|
-
});
|
|
3525
|
+
async ({ formData }) => {
|
|
3526
|
+
return env.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, formData);
|
|
3505
3527
|
},
|
|
3506
3528
|
[env]
|
|
3507
3529
|
);
|
|
@@ -3690,7 +3712,7 @@ function useModelService() {
|
|
|
3690
3712
|
});
|
|
3691
3713
|
}, [env]);
|
|
3692
3714
|
const getAll = useCallback7(
|
|
3693
|
-
async ({ data }) => {
|
|
3715
|
+
async ({ data, service }) => {
|
|
3694
3716
|
const jsonReadGroup = data.type == "calendar" ? { fields: data?.fields } : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
3695
3717
|
fields: data.fields,
|
|
3696
3718
|
groupby: data.groupby
|
|
@@ -3711,11 +3733,16 @@ function useModelService() {
|
|
|
3711
3733
|
...jsonReadGroup
|
|
3712
3734
|
}
|
|
3713
3735
|
};
|
|
3714
|
-
return env.requests.post(
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3736
|
+
return env.requests.post(
|
|
3737
|
+
"/call" /* CALL_PATH */,
|
|
3738
|
+
jsonData,
|
|
3739
|
+
{
|
|
3740
|
+
headers: {
|
|
3741
|
+
"Content-Type": "application/json"
|
|
3742
|
+
}
|
|
3743
|
+
},
|
|
3744
|
+
service
|
|
3745
|
+
);
|
|
3719
3746
|
},
|
|
3720
3747
|
[env]
|
|
3721
3748
|
);
|
|
@@ -3783,7 +3810,13 @@ function useModelService() {
|
|
|
3783
3810
|
[env]
|
|
3784
3811
|
);
|
|
3785
3812
|
const getDetail = useCallback7(
|
|
3786
|
-
async ({
|
|
3813
|
+
async ({
|
|
3814
|
+
ids = [],
|
|
3815
|
+
model,
|
|
3816
|
+
specification,
|
|
3817
|
+
context,
|
|
3818
|
+
service
|
|
3819
|
+
}) => {
|
|
3787
3820
|
const jsonData = {
|
|
3788
3821
|
model,
|
|
3789
3822
|
method: "web_read" /* WEB_READ */,
|
|
@@ -3793,11 +3826,16 @@ function useModelService() {
|
|
|
3793
3826
|
specification
|
|
3794
3827
|
}
|
|
3795
3828
|
};
|
|
3796
|
-
return env.requests.post(
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3829
|
+
return env.requests.post(
|
|
3830
|
+
"/call" /* CALL_PATH */,
|
|
3831
|
+
jsonData,
|
|
3832
|
+
{
|
|
3833
|
+
headers: {
|
|
3834
|
+
"Content-Type": "application/json"
|
|
3835
|
+
}
|
|
3836
|
+
},
|
|
3837
|
+
service
|
|
3838
|
+
);
|
|
3801
3839
|
},
|
|
3802
3840
|
[env]
|
|
3803
3841
|
);
|
|
@@ -3808,7 +3846,8 @@ function useModelService() {
|
|
|
3808
3846
|
data = {},
|
|
3809
3847
|
specification = {},
|
|
3810
3848
|
context = {},
|
|
3811
|
-
path
|
|
3849
|
+
path,
|
|
3850
|
+
service
|
|
3812
3851
|
}) => {
|
|
3813
3852
|
const jsonData = {
|
|
3814
3853
|
model,
|
|
@@ -3820,26 +3859,36 @@ function useModelService() {
|
|
|
3820
3859
|
specification
|
|
3821
3860
|
}
|
|
3822
3861
|
};
|
|
3823
|
-
return env.requests.post(
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3862
|
+
return env.requests.post(
|
|
3863
|
+
path ?? "/call" /* CALL_PATH */,
|
|
3864
|
+
jsonData,
|
|
3865
|
+
{
|
|
3866
|
+
headers: {
|
|
3867
|
+
"Content-Type": "application/json"
|
|
3868
|
+
}
|
|
3869
|
+
},
|
|
3870
|
+
service
|
|
3871
|
+
);
|
|
3828
3872
|
},
|
|
3829
3873
|
[env]
|
|
3830
3874
|
);
|
|
3831
3875
|
const deleteApi = useCallback7(
|
|
3832
|
-
async ({ ids = [], model }) => {
|
|
3876
|
+
async ({ ids = [], model, service }) => {
|
|
3833
3877
|
const jsonData = {
|
|
3834
3878
|
model,
|
|
3835
3879
|
method: "unlink" /* UNLINK */,
|
|
3836
3880
|
ids
|
|
3837
3881
|
};
|
|
3838
|
-
return env.requests.post(
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3882
|
+
return env.requests.post(
|
|
3883
|
+
"/call" /* CALL_PATH */,
|
|
3884
|
+
jsonData,
|
|
3885
|
+
{
|
|
3886
|
+
headers: {
|
|
3887
|
+
"Content-Type": "application/json"
|
|
3888
|
+
}
|
|
3889
|
+
},
|
|
3890
|
+
service
|
|
3891
|
+
);
|
|
3843
3892
|
},
|
|
3844
3893
|
[env]
|
|
3845
3894
|
);
|
|
@@ -3850,7 +3899,8 @@ function useModelService() {
|
|
|
3850
3899
|
object,
|
|
3851
3900
|
specification,
|
|
3852
3901
|
context,
|
|
3853
|
-
fieldChange
|
|
3902
|
+
fieldChange,
|
|
3903
|
+
service
|
|
3854
3904
|
}) => {
|
|
3855
3905
|
const jsonData = {
|
|
3856
3906
|
model,
|
|
@@ -3863,11 +3913,16 @@ function useModelService() {
|
|
|
3863
3913
|
specification
|
|
3864
3914
|
]
|
|
3865
3915
|
};
|
|
3866
|
-
return env.requests.post(
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3916
|
+
return env.requests.post(
|
|
3917
|
+
"/call" /* CALL_PATH */,
|
|
3918
|
+
jsonData,
|
|
3919
|
+
{
|
|
3920
|
+
headers: {
|
|
3921
|
+
"Content-Type": "application/json"
|
|
3922
|
+
}
|
|
3923
|
+
},
|
|
3924
|
+
service
|
|
3925
|
+
);
|
|
3871
3926
|
},
|
|
3872
3927
|
[env]
|
|
3873
3928
|
);
|
|
@@ -4041,7 +4096,8 @@ function useViewService() {
|
|
|
4041
4096
|
views,
|
|
4042
4097
|
context = {},
|
|
4043
4098
|
options = {},
|
|
4044
|
-
aid
|
|
4099
|
+
aid,
|
|
4100
|
+
service
|
|
4045
4101
|
}) => {
|
|
4046
4102
|
const defaultOptions = {
|
|
4047
4103
|
load_filters: true,
|
|
@@ -4057,110 +4113,28 @@ function useViewService() {
|
|
|
4057
4113
|
},
|
|
4058
4114
|
with_context: context
|
|
4059
4115
|
};
|
|
4060
|
-
return env?.requests?.post(
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4116
|
+
return env?.requests?.post(
|
|
4117
|
+
"/call" /* CALL_PATH */,
|
|
4118
|
+
jsonDataView,
|
|
4119
|
+
{
|
|
4120
|
+
headers: {
|
|
4121
|
+
"Content-Type": "application/json"
|
|
4122
|
+
}
|
|
4123
|
+
},
|
|
4124
|
+
service
|
|
4125
|
+
);
|
|
4065
4126
|
},
|
|
4066
4127
|
[env]
|
|
4067
4128
|
);
|
|
4068
4129
|
const getMenu = useCallback9(
|
|
4069
|
-
async (context) => {
|
|
4130
|
+
async (context, specification) => {
|
|
4070
4131
|
const jsonData = {
|
|
4071
4132
|
model: "ir.ui.menu" /* MENU */,
|
|
4072
4133
|
method: "web_search_read" /* WEB_SEARCH_READ */,
|
|
4073
4134
|
ids: [],
|
|
4074
4135
|
with_context: context,
|
|
4075
4136
|
kwargs: {
|
|
4076
|
-
specification
|
|
4077
|
-
active: {},
|
|
4078
|
-
name: {},
|
|
4079
|
-
is_display: {},
|
|
4080
|
-
sequence: {},
|
|
4081
|
-
complete_name: {},
|
|
4082
|
-
action: {
|
|
4083
|
-
fields: {
|
|
4084
|
-
display_name: {},
|
|
4085
|
-
type: {},
|
|
4086
|
-
binding_view_types: {}
|
|
4087
|
-
}
|
|
4088
|
-
},
|
|
4089
|
-
url_icon: {},
|
|
4090
|
-
web_icon: {},
|
|
4091
|
-
web_icon_data: {},
|
|
4092
|
-
groups_id: {
|
|
4093
|
-
fields: {
|
|
4094
|
-
full_name: {}
|
|
4095
|
-
},
|
|
4096
|
-
limit: 40,
|
|
4097
|
-
order: ""
|
|
4098
|
-
},
|
|
4099
|
-
display_name: {},
|
|
4100
|
-
child_id: {
|
|
4101
|
-
fields: {
|
|
4102
|
-
active: {},
|
|
4103
|
-
name: {},
|
|
4104
|
-
is_display: {},
|
|
4105
|
-
sequence: {},
|
|
4106
|
-
complete_name: {},
|
|
4107
|
-
action: {
|
|
4108
|
-
fields: {
|
|
4109
|
-
display_name: {},
|
|
4110
|
-
type: {},
|
|
4111
|
-
binding_view_types: {}
|
|
4112
|
-
}
|
|
4113
|
-
},
|
|
4114
|
-
url_icon: {},
|
|
4115
|
-
web_icon: {},
|
|
4116
|
-
web_icon_data: {},
|
|
4117
|
-
groups_id: {
|
|
4118
|
-
fields: {
|
|
4119
|
-
full_name: {}
|
|
4120
|
-
},
|
|
4121
|
-
limit: 40,
|
|
4122
|
-
order: ""
|
|
4123
|
-
},
|
|
4124
|
-
display_name: {},
|
|
4125
|
-
child_id: {
|
|
4126
|
-
fields: {
|
|
4127
|
-
active: {},
|
|
4128
|
-
name: {},
|
|
4129
|
-
is_display: {},
|
|
4130
|
-
sequence: {},
|
|
4131
|
-
complete_name: {},
|
|
4132
|
-
action: {
|
|
4133
|
-
fields: {
|
|
4134
|
-
display_name: {},
|
|
4135
|
-
type: {},
|
|
4136
|
-
binding_view_types: {}
|
|
4137
|
-
}
|
|
4138
|
-
},
|
|
4139
|
-
url_icon: {},
|
|
4140
|
-
web_icon: {},
|
|
4141
|
-
web_icon_data: {},
|
|
4142
|
-
groups_id: {
|
|
4143
|
-
fields: {
|
|
4144
|
-
full_name: {}
|
|
4145
|
-
},
|
|
4146
|
-
limit: 40,
|
|
4147
|
-
order: ""
|
|
4148
|
-
},
|
|
4149
|
-
display_name: {},
|
|
4150
|
-
child_id: {
|
|
4151
|
-
fields: {},
|
|
4152
|
-
limit: 40,
|
|
4153
|
-
order: ""
|
|
4154
|
-
}
|
|
4155
|
-
},
|
|
4156
|
-
limit: 40,
|
|
4157
|
-
order: ""
|
|
4158
|
-
}
|
|
4159
|
-
},
|
|
4160
|
-
limit: 40,
|
|
4161
|
-
order: ""
|
|
4162
|
-
}
|
|
4163
|
-
},
|
|
4137
|
+
specification,
|
|
4164
4138
|
domain: [
|
|
4165
4139
|
"&",
|
|
4166
4140
|
["is_display", "=", true],
|
|
@@ -4231,7 +4205,7 @@ function useViewService() {
|
|
|
4231
4205
|
[env]
|
|
4232
4206
|
);
|
|
4233
4207
|
const getSelectionItem = useCallback9(
|
|
4234
|
-
async ({ data }) => {
|
|
4208
|
+
async ({ data, service }) => {
|
|
4235
4209
|
const jsonData = {
|
|
4236
4210
|
model: data.model,
|
|
4237
4211
|
ids: [],
|
|
@@ -4249,11 +4223,16 @@ function useViewService() {
|
|
|
4249
4223
|
}
|
|
4250
4224
|
}
|
|
4251
4225
|
};
|
|
4252
|
-
return env?.requests.post(
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4226
|
+
return env?.requests.post(
|
|
4227
|
+
"/call" /* CALL_PATH */,
|
|
4228
|
+
jsonData,
|
|
4229
|
+
{
|
|
4230
|
+
headers: {
|
|
4231
|
+
"Content-Type": "application/json"
|
|
4232
|
+
}
|
|
4233
|
+
},
|
|
4234
|
+
service
|
|
4235
|
+
);
|
|
4257
4236
|
},
|
|
4258
4237
|
[env]
|
|
4259
4238
|
);
|
|
@@ -4546,7 +4525,6 @@ var sessionStorageUtils = () => {
|
|
|
4546
4525
|
// src/configs/axios-client.ts
|
|
4547
4526
|
var axiosClient = {
|
|
4548
4527
|
init(config) {
|
|
4549
|
-
console.log("config", config);
|
|
4550
4528
|
const localStorage2 = config?.localStorageUtils ?? localStorageUtils();
|
|
4551
4529
|
const sessionStorage2 = config?.sessionStorageUtils ?? sessionStorageUtils();
|
|
4552
4530
|
const db = config?.db;
|
|
@@ -4565,7 +4543,7 @@ var axiosClient = {
|
|
|
4565
4543
|
};
|
|
4566
4544
|
const instance = axios.create({
|
|
4567
4545
|
adapter: axios.defaults.adapter,
|
|
4568
|
-
baseURL: config
|
|
4546
|
+
baseURL: config?.baseUrl,
|
|
4569
4547
|
timeout: 5e4,
|
|
4570
4548
|
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
4571
4549
|
});
|
|
@@ -4577,7 +4555,6 @@ var axiosClient = {
|
|
|
4577
4555
|
if (database) {
|
|
4578
4556
|
config2.headers["DATABASE"] = database;
|
|
4579
4557
|
}
|
|
4580
|
-
console.log("database", database);
|
|
4581
4558
|
const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
|
|
4582
4559
|
const token = await getToken?.();
|
|
4583
4560
|
if (token) config2.headers["Authorization"] = `Bearer ${token}`;
|
|
@@ -4635,7 +4612,7 @@ var axiosClient = {
|
|
|
4635
4612
|
);
|
|
4636
4613
|
return new Promise(function(resolve) {
|
|
4637
4614
|
axios.post(
|
|
4638
|
-
`${config
|
|
4615
|
+
`${config?.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
|
|
4639
4616
|
payload,
|
|
4640
4617
|
{
|
|
4641
4618
|
headers: {
|
|
@@ -4703,20 +4680,47 @@ var axiosClient = {
|
|
|
4703
4680
|
function formatUrl(url, db2) {
|
|
4704
4681
|
return url + (db2 ? "?db=" + db2 : "");
|
|
4705
4682
|
}
|
|
4683
|
+
const getBaseUrl = (baseUrl, serviceName) => {
|
|
4684
|
+
const service = serviceName || config?.default_service;
|
|
4685
|
+
return `${baseUrl.replace(/\/$/, "")}/${service}/api/v2`;
|
|
4686
|
+
};
|
|
4706
4687
|
const responseBody = (response) => response;
|
|
4707
4688
|
const requests = {
|
|
4708
|
-
get: (url, headers) => instance.get(
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4689
|
+
get: (url, headers, serviceName) => instance.get(
|
|
4690
|
+
formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
|
|
4691
|
+
headers
|
|
4692
|
+
).then(responseBody),
|
|
4693
|
+
post: (url, body, headers, serviceName) => instance.post(
|
|
4694
|
+
formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
|
|
4695
|
+
body,
|
|
4696
|
+
headers
|
|
4697
|
+
).then(responseBody),
|
|
4698
|
+
post_excel: (url, body, headers, serviceName) => instance.post(
|
|
4699
|
+
formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
|
|
4700
|
+
body,
|
|
4701
|
+
{
|
|
4702
|
+
responseType: "arraybuffer",
|
|
4703
|
+
headers: {
|
|
4704
|
+
"Content-Type": typeof window !== "undefined" ? "application/json" : "application/javascript",
|
|
4705
|
+
Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
4706
|
+
...headers
|
|
4707
|
+
}
|
|
4715
4708
|
}
|
|
4716
|
-
|
|
4717
|
-
put: (url, body, headers) => instance.put(
|
|
4718
|
-
|
|
4719
|
-
|
|
4709
|
+
).then(responseBody),
|
|
4710
|
+
put: (url, body, headers, serviceName) => instance.put(
|
|
4711
|
+
formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
|
|
4712
|
+
body,
|
|
4713
|
+
headers
|
|
4714
|
+
).then(responseBody),
|
|
4715
|
+
patch: (url, body, headers, serviceName) => instance.patch(
|
|
4716
|
+
formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
|
|
4717
|
+
body,
|
|
4718
|
+
headers
|
|
4719
|
+
).then(responseBody),
|
|
4720
|
+
delete: (url, headers, serviceName) => instance.delete(
|
|
4721
|
+
formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
|
|
4722
|
+
headers
|
|
4723
|
+
).then(responseBody)
|
|
4720
4724
|
};
|
|
4721
4725
|
return requests;
|
|
4722
4726
|
}
|
|
@@ -5300,8 +5304,8 @@ import { useMutation as useMutation24 } from "@tanstack/react-query";
|
|
|
5300
5304
|
var useUploadImage = () => {
|
|
5301
5305
|
const { uploadImage } = useFormService();
|
|
5302
5306
|
return useMutation24({
|
|
5303
|
-
mutationFn: ({
|
|
5304
|
-
|
|
5307
|
+
mutationFn: ({ formData }) => uploadImage({
|
|
5308
|
+
formData
|
|
5305
5309
|
})
|
|
5306
5310
|
});
|
|
5307
5311
|
};
|
|
@@ -5312,7 +5316,7 @@ import { useMutation as useMutation25 } from "@tanstack/react-query";
|
|
|
5312
5316
|
var useDelete = () => {
|
|
5313
5317
|
const { deleteApi } = useModelService();
|
|
5314
5318
|
return useMutation25({
|
|
5315
|
-
mutationFn: ({ ids, model }) => deleteApi({ ids, model })
|
|
5319
|
+
mutationFn: ({ ids, model, service }) => deleteApi({ ids, model, service })
|
|
5316
5320
|
});
|
|
5317
5321
|
};
|
|
5318
5322
|
var use_delete_default = useDelete;
|
|
@@ -5375,12 +5379,14 @@ var useGetDetail = () => {
|
|
|
5375
5379
|
model,
|
|
5376
5380
|
ids,
|
|
5377
5381
|
specification,
|
|
5378
|
-
context
|
|
5382
|
+
context,
|
|
5383
|
+
service
|
|
5379
5384
|
}) => getDetail({
|
|
5380
5385
|
model,
|
|
5381
5386
|
ids,
|
|
5382
5387
|
specification,
|
|
5383
|
-
context
|
|
5388
|
+
context,
|
|
5389
|
+
service
|
|
5384
5390
|
})
|
|
5385
5391
|
});
|
|
5386
5392
|
};
|
|
@@ -5576,14 +5582,16 @@ var useOnChangeForm = () => {
|
|
|
5576
5582
|
specification,
|
|
5577
5583
|
context,
|
|
5578
5584
|
object,
|
|
5579
|
-
fieldChange
|
|
5585
|
+
fieldChange,
|
|
5586
|
+
service
|
|
5580
5587
|
}) => onChange({
|
|
5581
5588
|
ids,
|
|
5582
5589
|
model,
|
|
5583
5590
|
specification,
|
|
5584
5591
|
context,
|
|
5585
5592
|
object,
|
|
5586
|
-
fieldChange
|
|
5593
|
+
fieldChange,
|
|
5594
|
+
service
|
|
5587
5595
|
})
|
|
5588
5596
|
});
|
|
5589
5597
|
};
|
|
@@ -5600,8 +5608,9 @@ var useSave = () => {
|
|
|
5600
5608
|
data,
|
|
5601
5609
|
specification,
|
|
5602
5610
|
context,
|
|
5603
|
-
path
|
|
5604
|
-
|
|
5611
|
+
path,
|
|
5612
|
+
service
|
|
5613
|
+
}) => save({ ids, model, data, specification, context, path, service })
|
|
5605
5614
|
});
|
|
5606
5615
|
};
|
|
5607
5616
|
var use_save_default = useSave;
|
|
@@ -5653,12 +5662,14 @@ var useButton = () => {
|
|
|
5653
5662
|
model,
|
|
5654
5663
|
ids,
|
|
5655
5664
|
context,
|
|
5656
|
-
method
|
|
5665
|
+
method,
|
|
5666
|
+
service
|
|
5657
5667
|
}) => callButton({
|
|
5658
5668
|
model,
|
|
5659
5669
|
ids,
|
|
5660
5670
|
context,
|
|
5661
|
-
method
|
|
5671
|
+
method,
|
|
5672
|
+
service
|
|
5662
5673
|
}),
|
|
5663
5674
|
onSuccess: (response) => {
|
|
5664
5675
|
return response;
|
|
@@ -5675,11 +5686,13 @@ var useDuplicateRecord = () => {
|
|
|
5675
5686
|
mutationFn: ({
|
|
5676
5687
|
id,
|
|
5677
5688
|
model,
|
|
5678
|
-
context
|
|
5689
|
+
context,
|
|
5690
|
+
service
|
|
5679
5691
|
}) => duplicateRecord({
|
|
5680
5692
|
id,
|
|
5681
5693
|
model,
|
|
5682
|
-
context
|
|
5694
|
+
context,
|
|
5695
|
+
service
|
|
5683
5696
|
})
|
|
5684
5697
|
});
|
|
5685
5698
|
};
|
|
@@ -5762,11 +5775,11 @@ var use_get_groups_default = useGetGroups;
|
|
|
5762
5775
|
|
|
5763
5776
|
// src/hooks/view/use-get-list-data.ts
|
|
5764
5777
|
import { useQuery as useQuery14 } from "@tanstack/react-query";
|
|
5765
|
-
var useGetListData = (listDataProps, queryKey, enabled) => {
|
|
5778
|
+
var useGetListData = (listDataProps, queryKey, enabled, service) => {
|
|
5766
5779
|
const { getAll } = useModelService();
|
|
5767
5780
|
return useQuery14({
|
|
5768
5781
|
queryKey,
|
|
5769
|
-
queryFn: () => getAll({ data: listDataProps }).then((res) => {
|
|
5782
|
+
queryFn: () => getAll({ data: listDataProps, service }).then((res) => {
|
|
5770
5783
|
if (res) {
|
|
5771
5784
|
return res;
|
|
5772
5785
|
}
|
|
@@ -5781,11 +5794,11 @@ var use_get_list_data_default = useGetListData;
|
|
|
5781
5794
|
|
|
5782
5795
|
// src/hooks/view/use-get-menu.ts
|
|
5783
5796
|
import { useQuery as useQuery15 } from "@tanstack/react-query";
|
|
5784
|
-
var useGetMenu = (context, enabled) => {
|
|
5797
|
+
var useGetMenu = (context, specification, enabled) => {
|
|
5785
5798
|
const { getMenu } = useViewService();
|
|
5786
5799
|
return useQuery15({
|
|
5787
5800
|
queryKey: ["menus" /* MENU */, context],
|
|
5788
|
-
queryFn: () => getMenu(context).then((res) => {
|
|
5801
|
+
queryFn: () => getMenu(context, specification).then((res) => {
|
|
5789
5802
|
if (res && res?.records && res?.records?.length > 0) {
|
|
5790
5803
|
return res?.records;
|
|
5791
5804
|
}
|
|
@@ -5842,12 +5855,13 @@ import { useQuery as useQuery17 } from "@tanstack/react-query";
|
|
|
5842
5855
|
var useGetSelection = ({
|
|
5843
5856
|
data,
|
|
5844
5857
|
queryKey,
|
|
5845
|
-
enabled
|
|
5858
|
+
enabled,
|
|
5859
|
+
service
|
|
5846
5860
|
}) => {
|
|
5847
5861
|
const { getSelectionItem } = useViewService();
|
|
5848
5862
|
return useQuery17({
|
|
5849
5863
|
queryKey,
|
|
5850
|
-
queryFn: () => getSelectionItem({ data }),
|
|
5864
|
+
queryFn: () => getSelectionItem({ data, service }),
|
|
5851
5865
|
enabled,
|
|
5852
5866
|
refetchOnWindowFocus: false
|
|
5853
5867
|
});
|
|
@@ -5875,11 +5889,13 @@ var useLoadAction = () => {
|
|
|
5875
5889
|
return useMutation35({
|
|
5876
5890
|
mutationFn: ({
|
|
5877
5891
|
idAction,
|
|
5878
|
-
context
|
|
5892
|
+
context,
|
|
5893
|
+
service
|
|
5879
5894
|
}) => {
|
|
5880
5895
|
return loadAction({
|
|
5881
5896
|
idAction,
|
|
5882
|
-
context
|
|
5897
|
+
context,
|
|
5898
|
+
service
|
|
5883
5899
|
});
|
|
5884
5900
|
}
|
|
5885
5901
|
});
|
|
@@ -5920,11 +5936,13 @@ var useRemoveRow = () => {
|
|
|
5920
5936
|
mutationFn: ({
|
|
5921
5937
|
model,
|
|
5922
5938
|
ids,
|
|
5923
|
-
context
|
|
5939
|
+
context,
|
|
5940
|
+
service
|
|
5924
5941
|
}) => removeRows({
|
|
5925
5942
|
model,
|
|
5926
5943
|
ids,
|
|
5927
|
-
context
|
|
5944
|
+
context,
|
|
5945
|
+
service
|
|
5928
5946
|
})
|
|
5929
5947
|
});
|
|
5930
5948
|
};
|
|
@@ -5955,10 +5973,12 @@ var useRunAction = () => {
|
|
|
5955
5973
|
return useMutation38({
|
|
5956
5974
|
mutationFn: ({
|
|
5957
5975
|
idAction,
|
|
5958
|
-
context
|
|
5976
|
+
context,
|
|
5977
|
+
service
|
|
5959
5978
|
}) => runAction({
|
|
5960
5979
|
idAction,
|
|
5961
|
-
context
|
|
5980
|
+
context,
|
|
5981
|
+
service
|
|
5962
5982
|
})
|
|
5963
5983
|
});
|
|
5964
5984
|
};
|