@fctc/interface-logic 2.1.5 → 2.2.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/configs.d.mts +6 -6
- package/dist/configs.d.ts +6 -6
- package/dist/configs.js +44 -22
- package/dist/configs.mjs +44 -22
- package/dist/constants.d.mts +0 -1
- package/dist/constants.d.ts +0 -1
- package/dist/constants.js +0 -1
- package/dist/constants.mjs +0 -1
- package/dist/environment.js +44 -22
- package/dist/environment.mjs +44 -22
- package/dist/hooks.d.mts +16 -4
- package/dist/hooks.d.ts +16 -4
- package/dist/hooks.js +198 -96
- package/dist/hooks.mjs +198 -96
- package/dist/provider.d.mts +2 -1
- package/dist/provider.d.ts +2 -1
- package/dist/provider.js +242 -118
- package/dist/provider.mjs +242 -118
- package/dist/services.d.mts +23 -15
- package/dist/services.d.ts +23 -15
- package/dist/services.js +150 -71
- package/dist/services.mjs +150 -71
- 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
|
@@ -675,7 +675,6 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
|
675
675
|
UriConstants2["IMAGE_PATH"] = `/web/image`;
|
|
676
676
|
UriConstants2["LOAD_MESSAGE"] = `/load_message_failures`;
|
|
677
677
|
UriConstants2["TOKEN"] = `/check_token`;
|
|
678
|
-
UriConstants2["VALIDATE_ACTION_TOKEN"] = "/action-token/validate";
|
|
679
678
|
UriConstants2["CREATE_UPDATE_PATH"] = `/create_update`;
|
|
680
679
|
UriConstants2["TWOFA_METHOD_PATH"] = `/id/api/v2/call`;
|
|
681
680
|
UriConstants2["SIGNIN_SSO"] = `/signin-sso/oauth`;
|
|
@@ -2849,15 +2848,21 @@ function useActionService() {
|
|
|
2849
2848
|
const loadAction = useCallback(
|
|
2850
2849
|
async ({
|
|
2851
2850
|
idAction,
|
|
2852
|
-
context
|
|
2851
|
+
context,
|
|
2852
|
+
service
|
|
2853
2853
|
}) => {
|
|
2854
2854
|
const jsonData = {
|
|
2855
2855
|
action_id: idAction,
|
|
2856
2856
|
with_context: { ...context }
|
|
2857
2857
|
};
|
|
2858
|
-
return env.requests.post(
|
|
2859
|
-
|
|
2860
|
-
|
|
2858
|
+
return env.requests.post(
|
|
2859
|
+
"/load_action" /* LOAD_ACTION */,
|
|
2860
|
+
jsonData,
|
|
2861
|
+
{
|
|
2862
|
+
headers: { "Content-Type": "application/json" }
|
|
2863
|
+
},
|
|
2864
|
+
service
|
|
2865
|
+
);
|
|
2861
2866
|
},
|
|
2862
2867
|
[env]
|
|
2863
2868
|
);
|
|
@@ -2866,7 +2871,8 @@ function useActionService() {
|
|
|
2866
2871
|
model,
|
|
2867
2872
|
ids = [],
|
|
2868
2873
|
context,
|
|
2869
|
-
method
|
|
2874
|
+
method,
|
|
2875
|
+
service
|
|
2870
2876
|
}) => {
|
|
2871
2877
|
try {
|
|
2872
2878
|
const jsonData = {
|
|
@@ -2875,9 +2881,14 @@ function useActionService() {
|
|
|
2875
2881
|
ids,
|
|
2876
2882
|
with_context: context
|
|
2877
2883
|
};
|
|
2878
|
-
return env.requests.post(
|
|
2879
|
-
|
|
2880
|
-
|
|
2884
|
+
return env.requests.post(
|
|
2885
|
+
"/call" /* CALL_PATH */,
|
|
2886
|
+
jsonData,
|
|
2887
|
+
{
|
|
2888
|
+
headers: { "Content-Type": "application/json" }
|
|
2889
|
+
},
|
|
2890
|
+
service
|
|
2891
|
+
);
|
|
2881
2892
|
} catch (error) {
|
|
2882
2893
|
console.error("Error when calling button action:", error);
|
|
2883
2894
|
throw error;
|
|
@@ -2889,7 +2900,8 @@ function useActionService() {
|
|
|
2889
2900
|
async ({
|
|
2890
2901
|
model,
|
|
2891
2902
|
ids,
|
|
2892
|
-
context
|
|
2903
|
+
context,
|
|
2904
|
+
service
|
|
2893
2905
|
}) => {
|
|
2894
2906
|
const jsonData = {
|
|
2895
2907
|
model,
|
|
@@ -2897,9 +2909,14 @@ function useActionService() {
|
|
|
2897
2909
|
ids,
|
|
2898
2910
|
with_context: context
|
|
2899
2911
|
};
|
|
2900
|
-
return env.requests.post(
|
|
2901
|
-
|
|
2902
|
-
|
|
2912
|
+
return env.requests.post(
|
|
2913
|
+
"/call" /* CALL_PATH */,
|
|
2914
|
+
jsonData,
|
|
2915
|
+
{
|
|
2916
|
+
headers: { "Content-Type": "application/json" }
|
|
2917
|
+
},
|
|
2918
|
+
service
|
|
2919
|
+
);
|
|
2903
2920
|
},
|
|
2904
2921
|
[env]
|
|
2905
2922
|
);
|
|
@@ -2907,7 +2924,8 @@ function useActionService() {
|
|
|
2907
2924
|
async ({
|
|
2908
2925
|
model,
|
|
2909
2926
|
id,
|
|
2910
|
-
context
|
|
2927
|
+
context,
|
|
2928
|
+
service
|
|
2911
2929
|
}) => {
|
|
2912
2930
|
const jsonData = {
|
|
2913
2931
|
model,
|
|
@@ -2915,9 +2933,14 @@ function useActionService() {
|
|
|
2915
2933
|
ids: id,
|
|
2916
2934
|
with_context: context
|
|
2917
2935
|
};
|
|
2918
|
-
return env.requests.post(
|
|
2919
|
-
|
|
2920
|
-
|
|
2936
|
+
return env.requests.post(
|
|
2937
|
+
"/call" /* CALL_PATH */,
|
|
2938
|
+
jsonData,
|
|
2939
|
+
{
|
|
2940
|
+
headers: { "Content-Type": "application/json" }
|
|
2941
|
+
},
|
|
2942
|
+
service
|
|
2943
|
+
);
|
|
2921
2944
|
},
|
|
2922
2945
|
[env]
|
|
2923
2946
|
);
|
|
@@ -2960,15 +2983,21 @@ function useActionService() {
|
|
|
2960
2983
|
const runAction = useCallback(
|
|
2961
2984
|
async ({
|
|
2962
2985
|
idAction,
|
|
2963
|
-
context
|
|
2986
|
+
context,
|
|
2987
|
+
service
|
|
2964
2988
|
}) => {
|
|
2965
2989
|
const jsonData = {
|
|
2966
2990
|
action_id: idAction,
|
|
2967
2991
|
with_context: { ...context }
|
|
2968
2992
|
};
|
|
2969
|
-
return env.requests.post(
|
|
2970
|
-
|
|
2971
|
-
|
|
2993
|
+
return env.requests.post(
|
|
2994
|
+
"/run_action" /* RUN_ACTION_PATH */,
|
|
2995
|
+
jsonData,
|
|
2996
|
+
{
|
|
2997
|
+
headers: { "Content-Type": "application/json" }
|
|
2998
|
+
},
|
|
2999
|
+
service
|
|
3000
|
+
);
|
|
2972
3001
|
},
|
|
2973
3002
|
[env]
|
|
2974
3003
|
);
|
|
@@ -3111,9 +3140,9 @@ function useAuthService() {
|
|
|
3111
3140
|
[env]
|
|
3112
3141
|
);
|
|
3113
3142
|
const isValidActionToken = useCallback2(
|
|
3114
|
-
async (actionToken) => {
|
|
3143
|
+
async (actionToken, path) => {
|
|
3115
3144
|
return env?.requests?.post(
|
|
3116
|
-
|
|
3145
|
+
path,
|
|
3117
3146
|
{},
|
|
3118
3147
|
{
|
|
3119
3148
|
headers: {
|
|
@@ -3683,7 +3712,7 @@ function useModelService() {
|
|
|
3683
3712
|
});
|
|
3684
3713
|
}, [env]);
|
|
3685
3714
|
const getAll = useCallback7(
|
|
3686
|
-
async ({ data }) => {
|
|
3715
|
+
async ({ data, service }) => {
|
|
3687
3716
|
const jsonReadGroup = data.type == "calendar" ? { fields: data?.fields } : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
3688
3717
|
fields: data.fields,
|
|
3689
3718
|
groupby: data.groupby
|
|
@@ -3704,11 +3733,16 @@ function useModelService() {
|
|
|
3704
3733
|
...jsonReadGroup
|
|
3705
3734
|
}
|
|
3706
3735
|
};
|
|
3707
|
-
return env.requests.post(
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3736
|
+
return env.requests.post(
|
|
3737
|
+
"/call" /* CALL_PATH */,
|
|
3738
|
+
jsonData,
|
|
3739
|
+
{
|
|
3740
|
+
headers: {
|
|
3741
|
+
"Content-Type": "application/json"
|
|
3742
|
+
}
|
|
3743
|
+
},
|
|
3744
|
+
service
|
|
3745
|
+
);
|
|
3712
3746
|
},
|
|
3713
3747
|
[env]
|
|
3714
3748
|
);
|
|
@@ -3776,7 +3810,13 @@ function useModelService() {
|
|
|
3776
3810
|
[env]
|
|
3777
3811
|
);
|
|
3778
3812
|
const getDetail = useCallback7(
|
|
3779
|
-
async ({
|
|
3813
|
+
async ({
|
|
3814
|
+
ids = [],
|
|
3815
|
+
model,
|
|
3816
|
+
specification,
|
|
3817
|
+
context,
|
|
3818
|
+
service
|
|
3819
|
+
}) => {
|
|
3780
3820
|
const jsonData = {
|
|
3781
3821
|
model,
|
|
3782
3822
|
method: "web_read" /* WEB_READ */,
|
|
@@ -3786,11 +3826,16 @@ function useModelService() {
|
|
|
3786
3826
|
specification
|
|
3787
3827
|
}
|
|
3788
3828
|
};
|
|
3789
|
-
return env.requests.post(
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3829
|
+
return env.requests.post(
|
|
3830
|
+
"/call" /* CALL_PATH */,
|
|
3831
|
+
jsonData,
|
|
3832
|
+
{
|
|
3833
|
+
headers: {
|
|
3834
|
+
"Content-Type": "application/json"
|
|
3835
|
+
}
|
|
3836
|
+
},
|
|
3837
|
+
service
|
|
3838
|
+
);
|
|
3794
3839
|
},
|
|
3795
3840
|
[env]
|
|
3796
3841
|
);
|
|
@@ -3801,7 +3846,8 @@ function useModelService() {
|
|
|
3801
3846
|
data = {},
|
|
3802
3847
|
specification = {},
|
|
3803
3848
|
context = {},
|
|
3804
|
-
path
|
|
3849
|
+
path,
|
|
3850
|
+
service
|
|
3805
3851
|
}) => {
|
|
3806
3852
|
const jsonData = {
|
|
3807
3853
|
model,
|
|
@@ -3813,26 +3859,36 @@ function useModelService() {
|
|
|
3813
3859
|
specification
|
|
3814
3860
|
}
|
|
3815
3861
|
};
|
|
3816
|
-
return env.requests.post(
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
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
|
+
);
|
|
3821
3872
|
},
|
|
3822
3873
|
[env]
|
|
3823
3874
|
);
|
|
3824
3875
|
const deleteApi = useCallback7(
|
|
3825
|
-
async ({ ids = [], model }) => {
|
|
3876
|
+
async ({ ids = [], model, service }) => {
|
|
3826
3877
|
const jsonData = {
|
|
3827
3878
|
model,
|
|
3828
3879
|
method: "unlink" /* UNLINK */,
|
|
3829
3880
|
ids
|
|
3830
3881
|
};
|
|
3831
|
-
return env.requests.post(
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3882
|
+
return env.requests.post(
|
|
3883
|
+
"/call" /* CALL_PATH */,
|
|
3884
|
+
jsonData,
|
|
3885
|
+
{
|
|
3886
|
+
headers: {
|
|
3887
|
+
"Content-Type": "application/json"
|
|
3888
|
+
}
|
|
3889
|
+
},
|
|
3890
|
+
service
|
|
3891
|
+
);
|
|
3836
3892
|
},
|
|
3837
3893
|
[env]
|
|
3838
3894
|
);
|
|
@@ -3843,7 +3899,8 @@ function useModelService() {
|
|
|
3843
3899
|
object,
|
|
3844
3900
|
specification,
|
|
3845
3901
|
context,
|
|
3846
|
-
fieldChange
|
|
3902
|
+
fieldChange,
|
|
3903
|
+
service
|
|
3847
3904
|
}) => {
|
|
3848
3905
|
const jsonData = {
|
|
3849
3906
|
model,
|
|
@@ -3856,25 +3913,36 @@ function useModelService() {
|
|
|
3856
3913
|
specification
|
|
3857
3914
|
]
|
|
3858
3915
|
};
|
|
3859
|
-
return env.requests.post(
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3916
|
+
return env.requests.post(
|
|
3917
|
+
"/call" /* CALL_PATH */,
|
|
3918
|
+
jsonData,
|
|
3919
|
+
{
|
|
3920
|
+
headers: {
|
|
3921
|
+
"Content-Type": "application/json"
|
|
3922
|
+
}
|
|
3923
|
+
},
|
|
3924
|
+
service
|
|
3925
|
+
);
|
|
3864
3926
|
},
|
|
3865
3927
|
[env]
|
|
3866
3928
|
);
|
|
3867
3929
|
const getListFieldsOnchange = useCallback7(
|
|
3868
|
-
async ({ model }) => {
|
|
3930
|
+
async ({ model, service }) => {
|
|
3931
|
+
console.log("service", service);
|
|
3869
3932
|
const jsonData = {
|
|
3870
3933
|
model,
|
|
3871
3934
|
method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
|
|
3872
3935
|
};
|
|
3873
|
-
return env.requests.post(
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3936
|
+
return env.requests.post(
|
|
3937
|
+
"/call" /* CALL_PATH */,
|
|
3938
|
+
jsonData,
|
|
3939
|
+
{
|
|
3940
|
+
headers: {
|
|
3941
|
+
"Content-Type": "application/json"
|
|
3942
|
+
}
|
|
3943
|
+
},
|
|
3944
|
+
service
|
|
3945
|
+
);
|
|
3878
3946
|
},
|
|
3879
3947
|
[env]
|
|
3880
3948
|
);
|
|
@@ -4034,7 +4102,8 @@ function useViewService() {
|
|
|
4034
4102
|
views,
|
|
4035
4103
|
context = {},
|
|
4036
4104
|
options = {},
|
|
4037
|
-
aid
|
|
4105
|
+
aid,
|
|
4106
|
+
service
|
|
4038
4107
|
}) => {
|
|
4039
4108
|
const defaultOptions = {
|
|
4040
4109
|
load_filters: true,
|
|
@@ -4050,11 +4119,16 @@ function useViewService() {
|
|
|
4050
4119
|
},
|
|
4051
4120
|
with_context: context
|
|
4052
4121
|
};
|
|
4053
|
-
return env?.requests?.post(
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4122
|
+
return env?.requests?.post(
|
|
4123
|
+
"/call" /* CALL_PATH */,
|
|
4124
|
+
jsonDataView,
|
|
4125
|
+
{
|
|
4126
|
+
headers: {
|
|
4127
|
+
"Content-Type": "application/json"
|
|
4128
|
+
}
|
|
4129
|
+
},
|
|
4130
|
+
service
|
|
4131
|
+
);
|
|
4058
4132
|
},
|
|
4059
4133
|
[env]
|
|
4060
4134
|
);
|
|
@@ -4137,7 +4211,7 @@ function useViewService() {
|
|
|
4137
4211
|
[env]
|
|
4138
4212
|
);
|
|
4139
4213
|
const getSelectionItem = useCallback9(
|
|
4140
|
-
async ({ data }) => {
|
|
4214
|
+
async ({ data, service }) => {
|
|
4141
4215
|
const jsonData = {
|
|
4142
4216
|
model: data.model,
|
|
4143
4217
|
ids: [],
|
|
@@ -4155,11 +4229,16 @@ function useViewService() {
|
|
|
4155
4229
|
}
|
|
4156
4230
|
}
|
|
4157
4231
|
};
|
|
4158
|
-
return env?.requests.post(
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4232
|
+
return env?.requests.post(
|
|
4233
|
+
"/call" /* CALL_PATH */,
|
|
4234
|
+
jsonData,
|
|
4235
|
+
{
|
|
4236
|
+
headers: {
|
|
4237
|
+
"Content-Type": "application/json"
|
|
4238
|
+
}
|
|
4239
|
+
},
|
|
4240
|
+
service
|
|
4241
|
+
);
|
|
4163
4242
|
},
|
|
4164
4243
|
[env]
|
|
4165
4244
|
);
|
|
@@ -4452,7 +4531,6 @@ var sessionStorageUtils = () => {
|
|
|
4452
4531
|
// src/configs/axios-client.ts
|
|
4453
4532
|
var axiosClient = {
|
|
4454
4533
|
init(config) {
|
|
4455
|
-
console.log("config", config);
|
|
4456
4534
|
const localStorage2 = config?.localStorageUtils ?? localStorageUtils();
|
|
4457
4535
|
const sessionStorage2 = config?.sessionStorageUtils ?? sessionStorageUtils();
|
|
4458
4536
|
const db = config?.db;
|
|
@@ -4471,25 +4549,21 @@ var axiosClient = {
|
|
|
4471
4549
|
};
|
|
4472
4550
|
const instance = axios.create({
|
|
4473
4551
|
adapter: axios.defaults.adapter,
|
|
4474
|
-
baseURL: config
|
|
4552
|
+
baseURL: config?.baseUrl,
|
|
4475
4553
|
timeout: 5e4,
|
|
4476
4554
|
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
4477
4555
|
});
|
|
4478
4556
|
instance.interceptors.request.use(async (config2) => {
|
|
4479
4557
|
const { useRefreshToken, useActionToken, actionToken } = config2;
|
|
4480
|
-
let token = null;
|
|
4481
4558
|
if (useActionToken && actionToken) {
|
|
4482
|
-
|
|
4483
|
-
} else {
|
|
4484
|
-
const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
|
|
4485
|
-
token = await getToken?.();
|
|
4486
|
-
}
|
|
4487
|
-
if (token) {
|
|
4488
|
-
config2.headers["Authorization"] = `Bearer ${token}`;
|
|
4559
|
+
config2.headers["Action-Token"] = actionToken;
|
|
4489
4560
|
}
|
|
4490
4561
|
if (database) {
|
|
4491
4562
|
config2.headers["DATABASE"] = database;
|
|
4492
4563
|
}
|
|
4564
|
+
const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
|
|
4565
|
+
const token = await getToken?.();
|
|
4566
|
+
if (token) config2.headers["Authorization"] = `Bearer ${token}`;
|
|
4493
4567
|
return config2;
|
|
4494
4568
|
}, Promise.reject);
|
|
4495
4569
|
instance.interceptors.response.use(
|
|
@@ -4544,7 +4618,7 @@ var axiosClient = {
|
|
|
4544
4618
|
);
|
|
4545
4619
|
return new Promise(function(resolve) {
|
|
4546
4620
|
axios.post(
|
|
4547
|
-
`${config
|
|
4621
|
+
`${config?.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
|
|
4548
4622
|
payload,
|
|
4549
4623
|
{
|
|
4550
4624
|
headers: {
|
|
@@ -4612,20 +4686,47 @@ var axiosClient = {
|
|
|
4612
4686
|
function formatUrl(url, db2) {
|
|
4613
4687
|
return url + (db2 ? "?db=" + db2 : "");
|
|
4614
4688
|
}
|
|
4689
|
+
const getBaseUrl = (baseUrl, serviceName) => {
|
|
4690
|
+
const service = serviceName || config?.default_service;
|
|
4691
|
+
return `${baseUrl.replace(/\/$/, "")}/${service}/api/v2`;
|
|
4692
|
+
};
|
|
4615
4693
|
const responseBody = (response) => response;
|
|
4616
4694
|
const requests = {
|
|
4617
|
-
get: (url, headers) => instance.get(
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4695
|
+
get: (url, headers, serviceName) => instance.get(
|
|
4696
|
+
formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
|
|
4697
|
+
headers
|
|
4698
|
+
).then(responseBody),
|
|
4699
|
+
post: (url, body, headers, serviceName) => instance.post(
|
|
4700
|
+
formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
|
|
4701
|
+
body,
|
|
4702
|
+
headers
|
|
4703
|
+
).then(responseBody),
|
|
4704
|
+
post_excel: (url, body, headers, serviceName) => instance.post(
|
|
4705
|
+
formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
|
|
4706
|
+
body,
|
|
4707
|
+
{
|
|
4708
|
+
responseType: "arraybuffer",
|
|
4709
|
+
headers: {
|
|
4710
|
+
"Content-Type": typeof window !== "undefined" ? "application/json" : "application/javascript",
|
|
4711
|
+
Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
4712
|
+
...headers
|
|
4713
|
+
}
|
|
4624
4714
|
}
|
|
4625
|
-
|
|
4626
|
-
put: (url, body, headers) => instance.put(
|
|
4627
|
-
|
|
4628
|
-
|
|
4715
|
+
).then(responseBody),
|
|
4716
|
+
put: (url, body, headers, serviceName) => instance.put(
|
|
4717
|
+
formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
|
|
4718
|
+
body,
|
|
4719
|
+
headers
|
|
4720
|
+
).then(responseBody),
|
|
4721
|
+
patch: (url, body, headers, serviceName) => instance.patch(
|
|
4722
|
+
formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
|
|
4723
|
+
body,
|
|
4724
|
+
headers
|
|
4725
|
+
).then(responseBody),
|
|
4726
|
+
delete: (url, headers, serviceName) => instance.delete(
|
|
4727
|
+
formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
|
|
4728
|
+
headers
|
|
4729
|
+
).then(responseBody)
|
|
4629
4730
|
};
|
|
4630
4731
|
return requests;
|
|
4631
4732
|
}
|
|
@@ -4909,8 +5010,11 @@ import { useMutation as useMutation12 } from "@tanstack/react-query";
|
|
|
4909
5010
|
var useValidateActionToken = () => {
|
|
4910
5011
|
const { isValidActionToken } = useAuthService();
|
|
4911
5012
|
return useMutation12({
|
|
4912
|
-
mutationFn: ({
|
|
4913
|
-
|
|
5013
|
+
mutationFn: ({
|
|
5014
|
+
actionToken,
|
|
5015
|
+
path
|
|
5016
|
+
}) => {
|
|
5017
|
+
return isValidActionToken(actionToken, path);
|
|
4914
5018
|
}
|
|
4915
5019
|
});
|
|
4916
5020
|
};
|
|
@@ -5218,7 +5322,7 @@ import { useMutation as useMutation25 } from "@tanstack/react-query";
|
|
|
5218
5322
|
var useDelete = () => {
|
|
5219
5323
|
const { deleteApi } = useModelService();
|
|
5220
5324
|
return useMutation25({
|
|
5221
|
-
mutationFn: ({ ids, model }) => deleteApi({ ids, model })
|
|
5325
|
+
mutationFn: ({ ids, model, service }) => deleteApi({ ids, model, service })
|
|
5222
5326
|
});
|
|
5223
5327
|
};
|
|
5224
5328
|
var use_delete_default = useDelete;
|
|
@@ -5281,12 +5385,14 @@ var useGetDetail = () => {
|
|
|
5281
5385
|
model,
|
|
5282
5386
|
ids,
|
|
5283
5387
|
specification,
|
|
5284
|
-
context
|
|
5388
|
+
context,
|
|
5389
|
+
service
|
|
5285
5390
|
}) => getDetail({
|
|
5286
5391
|
model,
|
|
5287
5392
|
ids,
|
|
5288
5393
|
specification,
|
|
5289
|
-
context
|
|
5394
|
+
context,
|
|
5395
|
+
service
|
|
5290
5396
|
})
|
|
5291
5397
|
});
|
|
5292
5398
|
};
|
|
@@ -5294,12 +5400,16 @@ var use_get_detail_default = useGetDetail;
|
|
|
5294
5400
|
|
|
5295
5401
|
// src/hooks/model/use-get-field-onchange.ts
|
|
5296
5402
|
import { useQuery as useQuery9 } from "@tanstack/react-query";
|
|
5297
|
-
var useGetFieldOnChange = ({
|
|
5403
|
+
var useGetFieldOnChange = ({
|
|
5404
|
+
model,
|
|
5405
|
+
service
|
|
5406
|
+
}) => {
|
|
5298
5407
|
const { getListFieldsOnchange } = useModelService();
|
|
5299
5408
|
return useQuery9({
|
|
5300
5409
|
queryKey: [`field-onchange-${model}`, model],
|
|
5301
5410
|
queryFn: () => getListFieldsOnchange({
|
|
5302
|
-
model
|
|
5411
|
+
model,
|
|
5412
|
+
service
|
|
5303
5413
|
}).then((res) => {
|
|
5304
5414
|
if (res) {
|
|
5305
5415
|
return res;
|
|
@@ -5482,14 +5592,16 @@ var useOnChangeForm = () => {
|
|
|
5482
5592
|
specification,
|
|
5483
5593
|
context,
|
|
5484
5594
|
object,
|
|
5485
|
-
fieldChange
|
|
5595
|
+
fieldChange,
|
|
5596
|
+
service
|
|
5486
5597
|
}) => onChange({
|
|
5487
5598
|
ids,
|
|
5488
5599
|
model,
|
|
5489
5600
|
specification,
|
|
5490
5601
|
context,
|
|
5491
5602
|
object,
|
|
5492
|
-
fieldChange
|
|
5603
|
+
fieldChange,
|
|
5604
|
+
service
|
|
5493
5605
|
})
|
|
5494
5606
|
});
|
|
5495
5607
|
};
|
|
@@ -5506,8 +5618,9 @@ var useSave = () => {
|
|
|
5506
5618
|
data,
|
|
5507
5619
|
specification,
|
|
5508
5620
|
context,
|
|
5509
|
-
path
|
|
5510
|
-
|
|
5621
|
+
path,
|
|
5622
|
+
service
|
|
5623
|
+
}) => save({ ids, model, data, specification, context, path, service })
|
|
5511
5624
|
});
|
|
5512
5625
|
};
|
|
5513
5626
|
var use_save_default = useSave;
|
|
@@ -5559,12 +5672,14 @@ var useButton = () => {
|
|
|
5559
5672
|
model,
|
|
5560
5673
|
ids,
|
|
5561
5674
|
context,
|
|
5562
|
-
method
|
|
5675
|
+
method,
|
|
5676
|
+
service
|
|
5563
5677
|
}) => callButton({
|
|
5564
5678
|
model,
|
|
5565
5679
|
ids,
|
|
5566
5680
|
context,
|
|
5567
|
-
method
|
|
5681
|
+
method,
|
|
5682
|
+
service
|
|
5568
5683
|
}),
|
|
5569
5684
|
onSuccess: (response) => {
|
|
5570
5685
|
return response;
|
|
@@ -5581,11 +5696,13 @@ var useDuplicateRecord = () => {
|
|
|
5581
5696
|
mutationFn: ({
|
|
5582
5697
|
id,
|
|
5583
5698
|
model,
|
|
5584
|
-
context
|
|
5699
|
+
context,
|
|
5700
|
+
service
|
|
5585
5701
|
}) => duplicateRecord({
|
|
5586
5702
|
id,
|
|
5587
5703
|
model,
|
|
5588
|
-
context
|
|
5704
|
+
context,
|
|
5705
|
+
service
|
|
5589
5706
|
})
|
|
5590
5707
|
});
|
|
5591
5708
|
};
|
|
@@ -5668,11 +5785,11 @@ var use_get_groups_default = useGetGroups;
|
|
|
5668
5785
|
|
|
5669
5786
|
// src/hooks/view/use-get-list-data.ts
|
|
5670
5787
|
import { useQuery as useQuery14 } from "@tanstack/react-query";
|
|
5671
|
-
var useGetListData = (listDataProps, queryKey, enabled) => {
|
|
5788
|
+
var useGetListData = (listDataProps, queryKey, enabled, service) => {
|
|
5672
5789
|
const { getAll } = useModelService();
|
|
5673
5790
|
return useQuery14({
|
|
5674
5791
|
queryKey,
|
|
5675
|
-
queryFn: () => getAll({ data: listDataProps }).then((res) => {
|
|
5792
|
+
queryFn: () => getAll({ data: listDataProps, service }).then((res) => {
|
|
5676
5793
|
if (res) {
|
|
5677
5794
|
return res;
|
|
5678
5795
|
}
|
|
@@ -5748,12 +5865,13 @@ import { useQuery as useQuery17 } from "@tanstack/react-query";
|
|
|
5748
5865
|
var useGetSelection = ({
|
|
5749
5866
|
data,
|
|
5750
5867
|
queryKey,
|
|
5751
|
-
enabled
|
|
5868
|
+
enabled,
|
|
5869
|
+
service
|
|
5752
5870
|
}) => {
|
|
5753
5871
|
const { getSelectionItem } = useViewService();
|
|
5754
5872
|
return useQuery17({
|
|
5755
5873
|
queryKey,
|
|
5756
|
-
queryFn: () => getSelectionItem({ data }),
|
|
5874
|
+
queryFn: () => getSelectionItem({ data, service }),
|
|
5757
5875
|
enabled,
|
|
5758
5876
|
refetchOnWindowFocus: false
|
|
5759
5877
|
});
|
|
@@ -5781,11 +5899,13 @@ var useLoadAction = () => {
|
|
|
5781
5899
|
return useMutation35({
|
|
5782
5900
|
mutationFn: ({
|
|
5783
5901
|
idAction,
|
|
5784
|
-
context
|
|
5902
|
+
context,
|
|
5903
|
+
service
|
|
5785
5904
|
}) => {
|
|
5786
5905
|
return loadAction({
|
|
5787
5906
|
idAction,
|
|
5788
|
-
context
|
|
5907
|
+
context,
|
|
5908
|
+
service
|
|
5789
5909
|
});
|
|
5790
5910
|
}
|
|
5791
5911
|
});
|
|
@@ -5826,11 +5946,13 @@ var useRemoveRow = () => {
|
|
|
5826
5946
|
mutationFn: ({
|
|
5827
5947
|
model,
|
|
5828
5948
|
ids,
|
|
5829
|
-
context
|
|
5949
|
+
context,
|
|
5950
|
+
service
|
|
5830
5951
|
}) => removeRows({
|
|
5831
5952
|
model,
|
|
5832
5953
|
ids,
|
|
5833
|
-
context
|
|
5954
|
+
context,
|
|
5955
|
+
service
|
|
5834
5956
|
})
|
|
5835
5957
|
});
|
|
5836
5958
|
};
|
|
@@ -5861,10 +5983,12 @@ var useRunAction = () => {
|
|
|
5861
5983
|
return useMutation38({
|
|
5862
5984
|
mutationFn: ({
|
|
5863
5985
|
idAction,
|
|
5864
|
-
context
|
|
5986
|
+
context,
|
|
5987
|
+
service
|
|
5865
5988
|
}) => runAction({
|
|
5866
5989
|
idAction,
|
|
5867
|
-
context
|
|
5990
|
+
context,
|
|
5991
|
+
service
|
|
5868
5992
|
})
|
|
5869
5993
|
});
|
|
5870
5994
|
};
|