@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.js
CHANGED
|
@@ -718,7 +718,6 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
|
718
718
|
UriConstants2["IMAGE_PATH"] = `/web/image`;
|
|
719
719
|
UriConstants2["LOAD_MESSAGE"] = `/load_message_failures`;
|
|
720
720
|
UriConstants2["TOKEN"] = `/check_token`;
|
|
721
|
-
UriConstants2["VALIDATE_ACTION_TOKEN"] = "/action-token/validate";
|
|
722
721
|
UriConstants2["CREATE_UPDATE_PATH"] = `/create_update`;
|
|
723
722
|
UriConstants2["TWOFA_METHOD_PATH"] = `/id/api/v2/call`;
|
|
724
723
|
UriConstants2["SIGNIN_SSO"] = `/signin-sso/oauth`;
|
|
@@ -2892,15 +2891,21 @@ function useActionService() {
|
|
|
2892
2891
|
const loadAction = (0, import_react2.useCallback)(
|
|
2893
2892
|
async ({
|
|
2894
2893
|
idAction,
|
|
2895
|
-
context
|
|
2894
|
+
context,
|
|
2895
|
+
service
|
|
2896
2896
|
}) => {
|
|
2897
2897
|
const jsonData = {
|
|
2898
2898
|
action_id: idAction,
|
|
2899
2899
|
with_context: { ...context }
|
|
2900
2900
|
};
|
|
2901
|
-
return env.requests.post(
|
|
2902
|
-
|
|
2903
|
-
|
|
2901
|
+
return env.requests.post(
|
|
2902
|
+
"/load_action" /* LOAD_ACTION */,
|
|
2903
|
+
jsonData,
|
|
2904
|
+
{
|
|
2905
|
+
headers: { "Content-Type": "application/json" }
|
|
2906
|
+
},
|
|
2907
|
+
service
|
|
2908
|
+
);
|
|
2904
2909
|
},
|
|
2905
2910
|
[env]
|
|
2906
2911
|
);
|
|
@@ -2909,7 +2914,8 @@ function useActionService() {
|
|
|
2909
2914
|
model,
|
|
2910
2915
|
ids = [],
|
|
2911
2916
|
context,
|
|
2912
|
-
method
|
|
2917
|
+
method,
|
|
2918
|
+
service
|
|
2913
2919
|
}) => {
|
|
2914
2920
|
try {
|
|
2915
2921
|
const jsonData = {
|
|
@@ -2918,9 +2924,14 @@ function useActionService() {
|
|
|
2918
2924
|
ids,
|
|
2919
2925
|
with_context: context
|
|
2920
2926
|
};
|
|
2921
|
-
return env.requests.post(
|
|
2922
|
-
|
|
2923
|
-
|
|
2927
|
+
return env.requests.post(
|
|
2928
|
+
"/call" /* CALL_PATH */,
|
|
2929
|
+
jsonData,
|
|
2930
|
+
{
|
|
2931
|
+
headers: { "Content-Type": "application/json" }
|
|
2932
|
+
},
|
|
2933
|
+
service
|
|
2934
|
+
);
|
|
2924
2935
|
} catch (error) {
|
|
2925
2936
|
console.error("Error when calling button action:", error);
|
|
2926
2937
|
throw error;
|
|
@@ -2932,7 +2943,8 @@ function useActionService() {
|
|
|
2932
2943
|
async ({
|
|
2933
2944
|
model,
|
|
2934
2945
|
ids,
|
|
2935
|
-
context
|
|
2946
|
+
context,
|
|
2947
|
+
service
|
|
2936
2948
|
}) => {
|
|
2937
2949
|
const jsonData = {
|
|
2938
2950
|
model,
|
|
@@ -2940,9 +2952,14 @@ function useActionService() {
|
|
|
2940
2952
|
ids,
|
|
2941
2953
|
with_context: context
|
|
2942
2954
|
};
|
|
2943
|
-
return env.requests.post(
|
|
2944
|
-
|
|
2945
|
-
|
|
2955
|
+
return env.requests.post(
|
|
2956
|
+
"/call" /* CALL_PATH */,
|
|
2957
|
+
jsonData,
|
|
2958
|
+
{
|
|
2959
|
+
headers: { "Content-Type": "application/json" }
|
|
2960
|
+
},
|
|
2961
|
+
service
|
|
2962
|
+
);
|
|
2946
2963
|
},
|
|
2947
2964
|
[env]
|
|
2948
2965
|
);
|
|
@@ -2950,7 +2967,8 @@ function useActionService() {
|
|
|
2950
2967
|
async ({
|
|
2951
2968
|
model,
|
|
2952
2969
|
id,
|
|
2953
|
-
context
|
|
2970
|
+
context,
|
|
2971
|
+
service
|
|
2954
2972
|
}) => {
|
|
2955
2973
|
const jsonData = {
|
|
2956
2974
|
model,
|
|
@@ -2958,9 +2976,14 @@ function useActionService() {
|
|
|
2958
2976
|
ids: id,
|
|
2959
2977
|
with_context: context
|
|
2960
2978
|
};
|
|
2961
|
-
return env.requests.post(
|
|
2962
|
-
|
|
2963
|
-
|
|
2979
|
+
return env.requests.post(
|
|
2980
|
+
"/call" /* CALL_PATH */,
|
|
2981
|
+
jsonData,
|
|
2982
|
+
{
|
|
2983
|
+
headers: { "Content-Type": "application/json" }
|
|
2984
|
+
},
|
|
2985
|
+
service
|
|
2986
|
+
);
|
|
2964
2987
|
},
|
|
2965
2988
|
[env]
|
|
2966
2989
|
);
|
|
@@ -3003,15 +3026,21 @@ function useActionService() {
|
|
|
3003
3026
|
const runAction = (0, import_react2.useCallback)(
|
|
3004
3027
|
async ({
|
|
3005
3028
|
idAction,
|
|
3006
|
-
context
|
|
3029
|
+
context,
|
|
3030
|
+
service
|
|
3007
3031
|
}) => {
|
|
3008
3032
|
const jsonData = {
|
|
3009
3033
|
action_id: idAction,
|
|
3010
3034
|
with_context: { ...context }
|
|
3011
3035
|
};
|
|
3012
|
-
return env.requests.post(
|
|
3013
|
-
|
|
3014
|
-
|
|
3036
|
+
return env.requests.post(
|
|
3037
|
+
"/run_action" /* RUN_ACTION_PATH */,
|
|
3038
|
+
jsonData,
|
|
3039
|
+
{
|
|
3040
|
+
headers: { "Content-Type": "application/json" }
|
|
3041
|
+
},
|
|
3042
|
+
service
|
|
3043
|
+
);
|
|
3015
3044
|
},
|
|
3016
3045
|
[env]
|
|
3017
3046
|
);
|
|
@@ -3154,9 +3183,9 @@ function useAuthService() {
|
|
|
3154
3183
|
[env]
|
|
3155
3184
|
);
|
|
3156
3185
|
const isValidActionToken = (0, import_react3.useCallback)(
|
|
3157
|
-
async (actionToken) => {
|
|
3186
|
+
async (actionToken, path) => {
|
|
3158
3187
|
return env?.requests?.post(
|
|
3159
|
-
|
|
3188
|
+
path,
|
|
3160
3189
|
{},
|
|
3161
3190
|
{
|
|
3162
3191
|
headers: {
|
|
@@ -3726,7 +3755,7 @@ function useModelService() {
|
|
|
3726
3755
|
});
|
|
3727
3756
|
}, [env]);
|
|
3728
3757
|
const getAll = (0, import_react8.useCallback)(
|
|
3729
|
-
async ({ data }) => {
|
|
3758
|
+
async ({ data, service }) => {
|
|
3730
3759
|
const jsonReadGroup = data.type == "calendar" ? { fields: data?.fields } : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
3731
3760
|
fields: data.fields,
|
|
3732
3761
|
groupby: data.groupby
|
|
@@ -3747,11 +3776,16 @@ function useModelService() {
|
|
|
3747
3776
|
...jsonReadGroup
|
|
3748
3777
|
}
|
|
3749
3778
|
};
|
|
3750
|
-
return env.requests.post(
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3779
|
+
return env.requests.post(
|
|
3780
|
+
"/call" /* CALL_PATH */,
|
|
3781
|
+
jsonData,
|
|
3782
|
+
{
|
|
3783
|
+
headers: {
|
|
3784
|
+
"Content-Type": "application/json"
|
|
3785
|
+
}
|
|
3786
|
+
},
|
|
3787
|
+
service
|
|
3788
|
+
);
|
|
3755
3789
|
},
|
|
3756
3790
|
[env]
|
|
3757
3791
|
);
|
|
@@ -3819,7 +3853,13 @@ function useModelService() {
|
|
|
3819
3853
|
[env]
|
|
3820
3854
|
);
|
|
3821
3855
|
const getDetail = (0, import_react8.useCallback)(
|
|
3822
|
-
async ({
|
|
3856
|
+
async ({
|
|
3857
|
+
ids = [],
|
|
3858
|
+
model,
|
|
3859
|
+
specification,
|
|
3860
|
+
context,
|
|
3861
|
+
service
|
|
3862
|
+
}) => {
|
|
3823
3863
|
const jsonData = {
|
|
3824
3864
|
model,
|
|
3825
3865
|
method: "web_read" /* WEB_READ */,
|
|
@@ -3829,11 +3869,16 @@ function useModelService() {
|
|
|
3829
3869
|
specification
|
|
3830
3870
|
}
|
|
3831
3871
|
};
|
|
3832
|
-
return env.requests.post(
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3872
|
+
return env.requests.post(
|
|
3873
|
+
"/call" /* CALL_PATH */,
|
|
3874
|
+
jsonData,
|
|
3875
|
+
{
|
|
3876
|
+
headers: {
|
|
3877
|
+
"Content-Type": "application/json"
|
|
3878
|
+
}
|
|
3879
|
+
},
|
|
3880
|
+
service
|
|
3881
|
+
);
|
|
3837
3882
|
},
|
|
3838
3883
|
[env]
|
|
3839
3884
|
);
|
|
@@ -3844,7 +3889,8 @@ function useModelService() {
|
|
|
3844
3889
|
data = {},
|
|
3845
3890
|
specification = {},
|
|
3846
3891
|
context = {},
|
|
3847
|
-
path
|
|
3892
|
+
path,
|
|
3893
|
+
service
|
|
3848
3894
|
}) => {
|
|
3849
3895
|
const jsonData = {
|
|
3850
3896
|
model,
|
|
@@ -3856,26 +3902,36 @@ function useModelService() {
|
|
|
3856
3902
|
specification
|
|
3857
3903
|
}
|
|
3858
3904
|
};
|
|
3859
|
-
return env.requests.post(
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3905
|
+
return env.requests.post(
|
|
3906
|
+
path ?? "/call" /* CALL_PATH */,
|
|
3907
|
+
jsonData,
|
|
3908
|
+
{
|
|
3909
|
+
headers: {
|
|
3910
|
+
"Content-Type": "application/json"
|
|
3911
|
+
}
|
|
3912
|
+
},
|
|
3913
|
+
service
|
|
3914
|
+
);
|
|
3864
3915
|
},
|
|
3865
3916
|
[env]
|
|
3866
3917
|
);
|
|
3867
3918
|
const deleteApi = (0, import_react8.useCallback)(
|
|
3868
|
-
async ({ ids = [], model }) => {
|
|
3919
|
+
async ({ ids = [], model, service }) => {
|
|
3869
3920
|
const jsonData = {
|
|
3870
3921
|
model,
|
|
3871
3922
|
method: "unlink" /* UNLINK */,
|
|
3872
3923
|
ids
|
|
3873
3924
|
};
|
|
3874
|
-
return env.requests.post(
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3925
|
+
return env.requests.post(
|
|
3926
|
+
"/call" /* CALL_PATH */,
|
|
3927
|
+
jsonData,
|
|
3928
|
+
{
|
|
3929
|
+
headers: {
|
|
3930
|
+
"Content-Type": "application/json"
|
|
3931
|
+
}
|
|
3932
|
+
},
|
|
3933
|
+
service
|
|
3934
|
+
);
|
|
3879
3935
|
},
|
|
3880
3936
|
[env]
|
|
3881
3937
|
);
|
|
@@ -3886,7 +3942,8 @@ function useModelService() {
|
|
|
3886
3942
|
object,
|
|
3887
3943
|
specification,
|
|
3888
3944
|
context,
|
|
3889
|
-
fieldChange
|
|
3945
|
+
fieldChange,
|
|
3946
|
+
service
|
|
3890
3947
|
}) => {
|
|
3891
3948
|
const jsonData = {
|
|
3892
3949
|
model,
|
|
@@ -3899,25 +3956,36 @@ function useModelService() {
|
|
|
3899
3956
|
specification
|
|
3900
3957
|
]
|
|
3901
3958
|
};
|
|
3902
|
-
return env.requests.post(
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3959
|
+
return env.requests.post(
|
|
3960
|
+
"/call" /* CALL_PATH */,
|
|
3961
|
+
jsonData,
|
|
3962
|
+
{
|
|
3963
|
+
headers: {
|
|
3964
|
+
"Content-Type": "application/json"
|
|
3965
|
+
}
|
|
3966
|
+
},
|
|
3967
|
+
service
|
|
3968
|
+
);
|
|
3907
3969
|
},
|
|
3908
3970
|
[env]
|
|
3909
3971
|
);
|
|
3910
3972
|
const getListFieldsOnchange = (0, import_react8.useCallback)(
|
|
3911
|
-
async ({ model }) => {
|
|
3973
|
+
async ({ model, service }) => {
|
|
3974
|
+
console.log("service", service);
|
|
3912
3975
|
const jsonData = {
|
|
3913
3976
|
model,
|
|
3914
3977
|
method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
|
|
3915
3978
|
};
|
|
3916
|
-
return env.requests.post(
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3979
|
+
return env.requests.post(
|
|
3980
|
+
"/call" /* CALL_PATH */,
|
|
3981
|
+
jsonData,
|
|
3982
|
+
{
|
|
3983
|
+
headers: {
|
|
3984
|
+
"Content-Type": "application/json"
|
|
3985
|
+
}
|
|
3986
|
+
},
|
|
3987
|
+
service
|
|
3988
|
+
);
|
|
3921
3989
|
},
|
|
3922
3990
|
[env]
|
|
3923
3991
|
);
|
|
@@ -4077,7 +4145,8 @@ function useViewService() {
|
|
|
4077
4145
|
views,
|
|
4078
4146
|
context = {},
|
|
4079
4147
|
options = {},
|
|
4080
|
-
aid
|
|
4148
|
+
aid,
|
|
4149
|
+
service
|
|
4081
4150
|
}) => {
|
|
4082
4151
|
const defaultOptions = {
|
|
4083
4152
|
load_filters: true,
|
|
@@ -4093,11 +4162,16 @@ function useViewService() {
|
|
|
4093
4162
|
},
|
|
4094
4163
|
with_context: context
|
|
4095
4164
|
};
|
|
4096
|
-
return env?.requests?.post(
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4165
|
+
return env?.requests?.post(
|
|
4166
|
+
"/call" /* CALL_PATH */,
|
|
4167
|
+
jsonDataView,
|
|
4168
|
+
{
|
|
4169
|
+
headers: {
|
|
4170
|
+
"Content-Type": "application/json"
|
|
4171
|
+
}
|
|
4172
|
+
},
|
|
4173
|
+
service
|
|
4174
|
+
);
|
|
4101
4175
|
},
|
|
4102
4176
|
[env]
|
|
4103
4177
|
);
|
|
@@ -4180,7 +4254,7 @@ function useViewService() {
|
|
|
4180
4254
|
[env]
|
|
4181
4255
|
);
|
|
4182
4256
|
const getSelectionItem = (0, import_react10.useCallback)(
|
|
4183
|
-
async ({ data }) => {
|
|
4257
|
+
async ({ data, service }) => {
|
|
4184
4258
|
const jsonData = {
|
|
4185
4259
|
model: data.model,
|
|
4186
4260
|
ids: [],
|
|
@@ -4198,11 +4272,16 @@ function useViewService() {
|
|
|
4198
4272
|
}
|
|
4199
4273
|
}
|
|
4200
4274
|
};
|
|
4201
|
-
return env?.requests.post(
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4275
|
+
return env?.requests.post(
|
|
4276
|
+
"/call" /* CALL_PATH */,
|
|
4277
|
+
jsonData,
|
|
4278
|
+
{
|
|
4279
|
+
headers: {
|
|
4280
|
+
"Content-Type": "application/json"
|
|
4281
|
+
}
|
|
4282
|
+
},
|
|
4283
|
+
service
|
|
4284
|
+
);
|
|
4206
4285
|
},
|
|
4207
4286
|
[env]
|
|
4208
4287
|
);
|
|
@@ -4495,7 +4574,6 @@ var sessionStorageUtils = () => {
|
|
|
4495
4574
|
// src/configs/axios-client.ts
|
|
4496
4575
|
var axiosClient = {
|
|
4497
4576
|
init(config) {
|
|
4498
|
-
console.log("config", config);
|
|
4499
4577
|
const localStorage2 = config?.localStorageUtils ?? localStorageUtils();
|
|
4500
4578
|
const sessionStorage2 = config?.sessionStorageUtils ?? sessionStorageUtils();
|
|
4501
4579
|
const db = config?.db;
|
|
@@ -4514,25 +4592,21 @@ var axiosClient = {
|
|
|
4514
4592
|
};
|
|
4515
4593
|
const instance = import_axios.default.create({
|
|
4516
4594
|
adapter: import_axios.default.defaults.adapter,
|
|
4517
|
-
baseURL: config
|
|
4595
|
+
baseURL: config?.baseUrl,
|
|
4518
4596
|
timeout: 5e4,
|
|
4519
4597
|
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
4520
4598
|
});
|
|
4521
4599
|
instance.interceptors.request.use(async (config2) => {
|
|
4522
4600
|
const { useRefreshToken, useActionToken, actionToken } = config2;
|
|
4523
|
-
let token = null;
|
|
4524
4601
|
if (useActionToken && actionToken) {
|
|
4525
|
-
|
|
4526
|
-
} else {
|
|
4527
|
-
const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
|
|
4528
|
-
token = await getToken?.();
|
|
4529
|
-
}
|
|
4530
|
-
if (token) {
|
|
4531
|
-
config2.headers["Authorization"] = `Bearer ${token}`;
|
|
4602
|
+
config2.headers["Action-Token"] = actionToken;
|
|
4532
4603
|
}
|
|
4533
4604
|
if (database) {
|
|
4534
4605
|
config2.headers["DATABASE"] = database;
|
|
4535
4606
|
}
|
|
4607
|
+
const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
|
|
4608
|
+
const token = await getToken?.();
|
|
4609
|
+
if (token) config2.headers["Authorization"] = `Bearer ${token}`;
|
|
4536
4610
|
return config2;
|
|
4537
4611
|
}, Promise.reject);
|
|
4538
4612
|
instance.interceptors.response.use(
|
|
@@ -4587,7 +4661,7 @@ var axiosClient = {
|
|
|
4587
4661
|
);
|
|
4588
4662
|
return new Promise(function(resolve) {
|
|
4589
4663
|
import_axios.default.post(
|
|
4590
|
-
`${config
|
|
4664
|
+
`${config?.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
|
|
4591
4665
|
payload,
|
|
4592
4666
|
{
|
|
4593
4667
|
headers: {
|
|
@@ -4655,20 +4729,47 @@ var axiosClient = {
|
|
|
4655
4729
|
function formatUrl(url, db2) {
|
|
4656
4730
|
return url + (db2 ? "?db=" + db2 : "");
|
|
4657
4731
|
}
|
|
4732
|
+
const getBaseUrl = (baseUrl, serviceName) => {
|
|
4733
|
+
const service = serviceName || config?.default_service;
|
|
4734
|
+
return `${baseUrl.replace(/\/$/, "")}/${service}/api/v2`;
|
|
4735
|
+
};
|
|
4658
4736
|
const responseBody = (response) => response;
|
|
4659
4737
|
const requests = {
|
|
4660
|
-
get: (url, headers) => instance.get(
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4738
|
+
get: (url, headers, serviceName) => instance.get(
|
|
4739
|
+
formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
|
|
4740
|
+
headers
|
|
4741
|
+
).then(responseBody),
|
|
4742
|
+
post: (url, body, headers, serviceName) => instance.post(
|
|
4743
|
+
formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
|
|
4744
|
+
body,
|
|
4745
|
+
headers
|
|
4746
|
+
).then(responseBody),
|
|
4747
|
+
post_excel: (url, body, headers, serviceName) => instance.post(
|
|
4748
|
+
formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
|
|
4749
|
+
body,
|
|
4750
|
+
{
|
|
4751
|
+
responseType: "arraybuffer",
|
|
4752
|
+
headers: {
|
|
4753
|
+
"Content-Type": typeof window !== "undefined" ? "application/json" : "application/javascript",
|
|
4754
|
+
Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
4755
|
+
...headers
|
|
4756
|
+
}
|
|
4667
4757
|
}
|
|
4668
|
-
|
|
4669
|
-
put: (url, body, headers) => instance.put(
|
|
4670
|
-
|
|
4671
|
-
|
|
4758
|
+
).then(responseBody),
|
|
4759
|
+
put: (url, body, headers, serviceName) => instance.put(
|
|
4760
|
+
formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
|
|
4761
|
+
body,
|
|
4762
|
+
headers
|
|
4763
|
+
).then(responseBody),
|
|
4764
|
+
patch: (url, body, headers, serviceName) => instance.patch(
|
|
4765
|
+
formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
|
|
4766
|
+
body,
|
|
4767
|
+
headers
|
|
4768
|
+
).then(responseBody),
|
|
4769
|
+
delete: (url, headers, serviceName) => instance.delete(
|
|
4770
|
+
formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
|
|
4771
|
+
headers
|
|
4772
|
+
).then(responseBody)
|
|
4672
4773
|
};
|
|
4673
4774
|
return requests;
|
|
4674
4775
|
}
|
|
@@ -4952,8 +5053,11 @@ var import_react_query14 = require("@tanstack/react-query");
|
|
|
4952
5053
|
var useValidateActionToken = () => {
|
|
4953
5054
|
const { isValidActionToken } = useAuthService();
|
|
4954
5055
|
return (0, import_react_query14.useMutation)({
|
|
4955
|
-
mutationFn: ({
|
|
4956
|
-
|
|
5056
|
+
mutationFn: ({
|
|
5057
|
+
actionToken,
|
|
5058
|
+
path
|
|
5059
|
+
}) => {
|
|
5060
|
+
return isValidActionToken(actionToken, path);
|
|
4957
5061
|
}
|
|
4958
5062
|
});
|
|
4959
5063
|
};
|
|
@@ -5261,7 +5365,7 @@ var import_react_query32 = require("@tanstack/react-query");
|
|
|
5261
5365
|
var useDelete = () => {
|
|
5262
5366
|
const { deleteApi } = useModelService();
|
|
5263
5367
|
return (0, import_react_query32.useMutation)({
|
|
5264
|
-
mutationFn: ({ ids, model }) => deleteApi({ ids, model })
|
|
5368
|
+
mutationFn: ({ ids, model, service }) => deleteApi({ ids, model, service })
|
|
5265
5369
|
});
|
|
5266
5370
|
};
|
|
5267
5371
|
var use_delete_default = useDelete;
|
|
@@ -5324,12 +5428,14 @@ var useGetDetail = () => {
|
|
|
5324
5428
|
model,
|
|
5325
5429
|
ids,
|
|
5326
5430
|
specification,
|
|
5327
|
-
context
|
|
5431
|
+
context,
|
|
5432
|
+
service
|
|
5328
5433
|
}) => getDetail({
|
|
5329
5434
|
model,
|
|
5330
5435
|
ids,
|
|
5331
5436
|
specification,
|
|
5332
|
-
context
|
|
5437
|
+
context,
|
|
5438
|
+
service
|
|
5333
5439
|
})
|
|
5334
5440
|
});
|
|
5335
5441
|
};
|
|
@@ -5337,12 +5443,16 @@ var use_get_detail_default = useGetDetail;
|
|
|
5337
5443
|
|
|
5338
5444
|
// src/hooks/model/use-get-field-onchange.ts
|
|
5339
5445
|
var import_react_query37 = require("@tanstack/react-query");
|
|
5340
|
-
var useGetFieldOnChange = ({
|
|
5446
|
+
var useGetFieldOnChange = ({
|
|
5447
|
+
model,
|
|
5448
|
+
service
|
|
5449
|
+
}) => {
|
|
5341
5450
|
const { getListFieldsOnchange } = useModelService();
|
|
5342
5451
|
return (0, import_react_query37.useQuery)({
|
|
5343
5452
|
queryKey: [`field-onchange-${model}`, model],
|
|
5344
5453
|
queryFn: () => getListFieldsOnchange({
|
|
5345
|
-
model
|
|
5454
|
+
model,
|
|
5455
|
+
service
|
|
5346
5456
|
}).then((res) => {
|
|
5347
5457
|
if (res) {
|
|
5348
5458
|
return res;
|
|
@@ -5525,14 +5635,16 @@ var useOnChangeForm = () => {
|
|
|
5525
5635
|
specification,
|
|
5526
5636
|
context,
|
|
5527
5637
|
object,
|
|
5528
|
-
fieldChange
|
|
5638
|
+
fieldChange,
|
|
5639
|
+
service
|
|
5529
5640
|
}) => onChange({
|
|
5530
5641
|
ids,
|
|
5531
5642
|
model,
|
|
5532
5643
|
specification,
|
|
5533
5644
|
context,
|
|
5534
5645
|
object,
|
|
5535
|
-
fieldChange
|
|
5646
|
+
fieldChange,
|
|
5647
|
+
service
|
|
5536
5648
|
})
|
|
5537
5649
|
});
|
|
5538
5650
|
};
|
|
@@ -5549,8 +5661,9 @@ var useSave = () => {
|
|
|
5549
5661
|
data,
|
|
5550
5662
|
specification,
|
|
5551
5663
|
context,
|
|
5552
|
-
path
|
|
5553
|
-
|
|
5664
|
+
path,
|
|
5665
|
+
service
|
|
5666
|
+
}) => save({ ids, model, data, specification, context, path, service })
|
|
5554
5667
|
});
|
|
5555
5668
|
};
|
|
5556
5669
|
var use_save_default = useSave;
|
|
@@ -5602,12 +5715,14 @@ var useButton = () => {
|
|
|
5602
5715
|
model,
|
|
5603
5716
|
ids,
|
|
5604
5717
|
context,
|
|
5605
|
-
method
|
|
5718
|
+
method,
|
|
5719
|
+
service
|
|
5606
5720
|
}) => callButton({
|
|
5607
5721
|
model,
|
|
5608
5722
|
ids,
|
|
5609
5723
|
context,
|
|
5610
|
-
method
|
|
5724
|
+
method,
|
|
5725
|
+
service
|
|
5611
5726
|
}),
|
|
5612
5727
|
onSuccess: (response) => {
|
|
5613
5728
|
return response;
|
|
@@ -5624,11 +5739,13 @@ var useDuplicateRecord = () => {
|
|
|
5624
5739
|
mutationFn: ({
|
|
5625
5740
|
id,
|
|
5626
5741
|
model,
|
|
5627
|
-
context
|
|
5742
|
+
context,
|
|
5743
|
+
service
|
|
5628
5744
|
}) => duplicateRecord({
|
|
5629
5745
|
id,
|
|
5630
5746
|
model,
|
|
5631
|
-
context
|
|
5747
|
+
context,
|
|
5748
|
+
service
|
|
5632
5749
|
})
|
|
5633
5750
|
});
|
|
5634
5751
|
};
|
|
@@ -5711,11 +5828,11 @@ var use_get_groups_default = useGetGroups;
|
|
|
5711
5828
|
|
|
5712
5829
|
// src/hooks/view/use-get-list-data.ts
|
|
5713
5830
|
var import_react_query49 = require("@tanstack/react-query");
|
|
5714
|
-
var useGetListData = (listDataProps, queryKey, enabled) => {
|
|
5831
|
+
var useGetListData = (listDataProps, queryKey, enabled, service) => {
|
|
5715
5832
|
const { getAll } = useModelService();
|
|
5716
5833
|
return (0, import_react_query49.useQuery)({
|
|
5717
5834
|
queryKey,
|
|
5718
|
-
queryFn: () => getAll({ data: listDataProps }).then((res) => {
|
|
5835
|
+
queryFn: () => getAll({ data: listDataProps, service }).then((res) => {
|
|
5719
5836
|
if (res) {
|
|
5720
5837
|
return res;
|
|
5721
5838
|
}
|
|
@@ -5791,12 +5908,13 @@ var import_react_query53 = require("@tanstack/react-query");
|
|
|
5791
5908
|
var useGetSelection = ({
|
|
5792
5909
|
data,
|
|
5793
5910
|
queryKey,
|
|
5794
|
-
enabled
|
|
5911
|
+
enabled,
|
|
5912
|
+
service
|
|
5795
5913
|
}) => {
|
|
5796
5914
|
const { getSelectionItem } = useViewService();
|
|
5797
5915
|
return (0, import_react_query53.useQuery)({
|
|
5798
5916
|
queryKey,
|
|
5799
|
-
queryFn: () => getSelectionItem({ data }),
|
|
5917
|
+
queryFn: () => getSelectionItem({ data, service }),
|
|
5800
5918
|
enabled,
|
|
5801
5919
|
refetchOnWindowFocus: false
|
|
5802
5920
|
});
|
|
@@ -5824,11 +5942,13 @@ var useLoadAction = () => {
|
|
|
5824
5942
|
return (0, import_react_query55.useMutation)({
|
|
5825
5943
|
mutationFn: ({
|
|
5826
5944
|
idAction,
|
|
5827
|
-
context
|
|
5945
|
+
context,
|
|
5946
|
+
service
|
|
5828
5947
|
}) => {
|
|
5829
5948
|
return loadAction({
|
|
5830
5949
|
idAction,
|
|
5831
|
-
context
|
|
5950
|
+
context,
|
|
5951
|
+
service
|
|
5832
5952
|
});
|
|
5833
5953
|
}
|
|
5834
5954
|
});
|
|
@@ -5869,11 +5989,13 @@ var useRemoveRow = () => {
|
|
|
5869
5989
|
mutationFn: ({
|
|
5870
5990
|
model,
|
|
5871
5991
|
ids,
|
|
5872
|
-
context
|
|
5992
|
+
context,
|
|
5993
|
+
service
|
|
5873
5994
|
}) => removeRows({
|
|
5874
5995
|
model,
|
|
5875
5996
|
ids,
|
|
5876
|
-
context
|
|
5997
|
+
context,
|
|
5998
|
+
service
|
|
5877
5999
|
})
|
|
5878
6000
|
});
|
|
5879
6001
|
};
|
|
@@ -5904,10 +6026,12 @@ var useRunAction = () => {
|
|
|
5904
6026
|
return (0, import_react_query60.useMutation)({
|
|
5905
6027
|
mutationFn: ({
|
|
5906
6028
|
idAction,
|
|
5907
|
-
context
|
|
6029
|
+
context,
|
|
6030
|
+
service
|
|
5908
6031
|
}) => runAction({
|
|
5909
6032
|
idAction,
|
|
5910
|
-
context
|
|
6033
|
+
context,
|
|
6034
|
+
service
|
|
5911
6035
|
})
|
|
5912
6036
|
});
|
|
5913
6037
|
};
|