@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/configs.d.mts +6 -6
- package/dist/configs.d.ts +6 -6
- package/dist/configs.js +18 -48
- package/dist/configs.mjs +18 -48
- package/dist/constants.d.mts +1 -3
- package/dist/constants.d.ts +1 -3
- package/dist/constants.js +1 -3
- package/dist/constants.mjs +1 -3
- package/dist/environment.js +18 -48
- package/dist/environment.mjs +18 -48
- package/dist/hooks.d.mts +7 -28
- package/dist/hooks.d.ts +7 -28
- package/dist/hooks.js +196 -361
- package/dist/hooks.mjs +166 -329
- package/dist/provider.d.mts +10 -12
- package/dist/provider.d.ts +10 -12
- package/dist/provider.js +216 -409
- package/dist/provider.mjs +186 -379
- package/dist/services.d.mts +16 -33
- package/dist/services.d.ts +16 -33
- package/dist/services.js +126 -248
- package/dist/services.mjs +111 -233
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils.d.mts +2 -1
- package/dist/utils.d.ts +2 -1
- package/dist/utils.js +3 -2
- package/dist/utils.mjs +3 -2
- package/dist/{view-type-p4JdAOsz.d.mts → view-type-BGJfDe73.d.mts} +0 -5
- package/dist/{view-type-p4JdAOsz.d.ts → view-type-BGJfDe73.d.ts} +0 -5
- package/package.json +85 -85
package/dist/provider.js
CHANGED
|
@@ -710,8 +710,7 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
|
710
710
|
UriConstants2["LOAD_ACTION"] = `/load_action`;
|
|
711
711
|
UriConstants2["REPORT_PATH"] = `/report`;
|
|
712
712
|
UriConstants2["RUN_ACTION_PATH"] = `/run_action`;
|
|
713
|
-
UriConstants2["
|
|
714
|
-
UriConstants2["UPLOAD_FILE_PATH"] = `/web/binary/upload_attachment`;
|
|
713
|
+
UriConstants2["UPLOAD_FILE_PATH"] = `/upload/file`;
|
|
715
714
|
UriConstants2["GET_MESSAGE"] = `/chatter/thread/messages`;
|
|
716
715
|
UriConstants2["SENT_MESSAGE"] = `/chatter/message/post`;
|
|
717
716
|
UriConstants2["UPLOAD_IMAGE"] = `/mail/attachment/upload`;
|
|
@@ -719,7 +718,6 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
|
719
718
|
UriConstants2["IMAGE_PATH"] = `/web/image`;
|
|
720
719
|
UriConstants2["LOAD_MESSAGE"] = `/load_message_failures`;
|
|
721
720
|
UriConstants2["TOKEN"] = `/check_token`;
|
|
722
|
-
UriConstants2["VALIDATE_ACTION_TOKEN"] = `/action-token/validate`;
|
|
723
721
|
UriConstants2["CREATE_UPDATE_PATH"] = `/create_update`;
|
|
724
722
|
UriConstants2["TWOFA_METHOD_PATH"] = `/id/api/v2/call`;
|
|
725
723
|
UriConstants2["SIGNIN_SSO"] = `/signin-sso/oauth`;
|
|
@@ -2893,21 +2891,15 @@ function useActionService() {
|
|
|
2893
2891
|
const loadAction = (0, import_react2.useCallback)(
|
|
2894
2892
|
async ({
|
|
2895
2893
|
idAction,
|
|
2896
|
-
context
|
|
2897
|
-
service
|
|
2894
|
+
context
|
|
2898
2895
|
}) => {
|
|
2899
2896
|
const jsonData = {
|
|
2900
2897
|
action_id: idAction,
|
|
2901
2898
|
with_context: { ...context }
|
|
2902
2899
|
};
|
|
2903
|
-
return env.requests.post(
|
|
2904
|
-
"/
|
|
2905
|
-
|
|
2906
|
-
{
|
|
2907
|
-
headers: { "Content-Type": "application/json" }
|
|
2908
|
-
},
|
|
2909
|
-
service
|
|
2910
|
-
);
|
|
2900
|
+
return env.requests.post("/load_action" /* LOAD_ACTION */, jsonData, {
|
|
2901
|
+
headers: { "Content-Type": "application/json" }
|
|
2902
|
+
});
|
|
2911
2903
|
},
|
|
2912
2904
|
[env]
|
|
2913
2905
|
);
|
|
@@ -2916,8 +2908,7 @@ function useActionService() {
|
|
|
2916
2908
|
model,
|
|
2917
2909
|
ids = [],
|
|
2918
2910
|
context,
|
|
2919
|
-
method
|
|
2920
|
-
service
|
|
2911
|
+
method
|
|
2921
2912
|
}) => {
|
|
2922
2913
|
try {
|
|
2923
2914
|
const jsonData = {
|
|
@@ -2926,14 +2917,9 @@ function useActionService() {
|
|
|
2926
2917
|
ids,
|
|
2927
2918
|
with_context: context
|
|
2928
2919
|
};
|
|
2929
|
-
return env.requests.post(
|
|
2930
|
-
"/
|
|
2931
|
-
|
|
2932
|
-
{
|
|
2933
|
-
headers: { "Content-Type": "application/json" }
|
|
2934
|
-
},
|
|
2935
|
-
service
|
|
2936
|
-
);
|
|
2920
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
2921
|
+
headers: { "Content-Type": "application/json" }
|
|
2922
|
+
});
|
|
2937
2923
|
} catch (error) {
|
|
2938
2924
|
console.error("Error when calling button action:", error);
|
|
2939
2925
|
throw error;
|
|
@@ -2945,8 +2931,7 @@ function useActionService() {
|
|
|
2945
2931
|
async ({
|
|
2946
2932
|
model,
|
|
2947
2933
|
ids,
|
|
2948
|
-
context
|
|
2949
|
-
service
|
|
2934
|
+
context
|
|
2950
2935
|
}) => {
|
|
2951
2936
|
const jsonData = {
|
|
2952
2937
|
model,
|
|
@@ -2954,14 +2939,9 @@ function useActionService() {
|
|
|
2954
2939
|
ids,
|
|
2955
2940
|
with_context: context
|
|
2956
2941
|
};
|
|
2957
|
-
return env.requests.post(
|
|
2958
|
-
"/
|
|
2959
|
-
|
|
2960
|
-
{
|
|
2961
|
-
headers: { "Content-Type": "application/json" }
|
|
2962
|
-
},
|
|
2963
|
-
service
|
|
2964
|
-
);
|
|
2942
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
2943
|
+
headers: { "Content-Type": "application/json" }
|
|
2944
|
+
});
|
|
2965
2945
|
},
|
|
2966
2946
|
[env]
|
|
2967
2947
|
);
|
|
@@ -2969,8 +2949,7 @@ function useActionService() {
|
|
|
2969
2949
|
async ({
|
|
2970
2950
|
model,
|
|
2971
2951
|
id,
|
|
2972
|
-
context
|
|
2973
|
-
service
|
|
2952
|
+
context
|
|
2974
2953
|
}) => {
|
|
2975
2954
|
const jsonData = {
|
|
2976
2955
|
model,
|
|
@@ -2978,14 +2957,9 @@ function useActionService() {
|
|
|
2978
2957
|
ids: id,
|
|
2979
2958
|
with_context: context
|
|
2980
2959
|
};
|
|
2981
|
-
return env.requests.post(
|
|
2982
|
-
"/
|
|
2983
|
-
|
|
2984
|
-
{
|
|
2985
|
-
headers: { "Content-Type": "application/json" }
|
|
2986
|
-
},
|
|
2987
|
-
service
|
|
2988
|
-
);
|
|
2960
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
2961
|
+
headers: { "Content-Type": "application/json" }
|
|
2962
|
+
});
|
|
2989
2963
|
},
|
|
2990
2964
|
[env]
|
|
2991
2965
|
);
|
|
@@ -3028,21 +3002,15 @@ function useActionService() {
|
|
|
3028
3002
|
const runAction = (0, import_react2.useCallback)(
|
|
3029
3003
|
async ({
|
|
3030
3004
|
idAction,
|
|
3031
|
-
context
|
|
3032
|
-
service
|
|
3005
|
+
context
|
|
3033
3006
|
}) => {
|
|
3034
3007
|
const jsonData = {
|
|
3035
3008
|
action_id: idAction,
|
|
3036
3009
|
with_context: { ...context }
|
|
3037
3010
|
};
|
|
3038
|
-
return env.requests.post(
|
|
3039
|
-
"/
|
|
3040
|
-
|
|
3041
|
-
{
|
|
3042
|
-
headers: { "Content-Type": "application/json" }
|
|
3043
|
-
},
|
|
3044
|
-
service
|
|
3045
|
-
);
|
|
3011
|
+
return env.requests.post("/run_action" /* RUN_ACTION_PATH */, jsonData, {
|
|
3012
|
+
headers: { "Content-Type": "application/json" }
|
|
3013
|
+
});
|
|
3046
3014
|
},
|
|
3047
3015
|
[env]
|
|
3048
3016
|
);
|
|
@@ -3185,15 +3153,18 @@ function useAuthService() {
|
|
|
3185
3153
|
[env]
|
|
3186
3154
|
);
|
|
3187
3155
|
const isValidActionToken = (0, import_react3.useCallback)(
|
|
3188
|
-
async (actionToken) => {
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3156
|
+
async (actionToken, path) => {
|
|
3157
|
+
return env?.requests?.post(
|
|
3158
|
+
path,
|
|
3159
|
+
{},
|
|
3160
|
+
{
|
|
3161
|
+
headers: {
|
|
3162
|
+
"Content-Type": "application/json"
|
|
3163
|
+
},
|
|
3164
|
+
useActionToken: true,
|
|
3165
|
+
actionToken
|
|
3166
|
+
}
|
|
3167
|
+
);
|
|
3197
3168
|
},
|
|
3198
3169
|
[env]
|
|
3199
3170
|
);
|
|
@@ -3229,14 +3200,13 @@ function useAuthService() {
|
|
|
3229
3200
|
data.append("client_id", env?.config?.clientId || "");
|
|
3230
3201
|
data.append("redirect_uri", env?.config?.redirectUri || "");
|
|
3231
3202
|
return env?.requests?.post(
|
|
3232
|
-
"/token" /* TOKEN_BY_CODE
|
|
3203
|
+
`${env?.baseUrl?.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
|
|
3233
3204
|
data,
|
|
3234
3205
|
{
|
|
3235
3206
|
headers: {
|
|
3236
3207
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
3237
3208
|
}
|
|
3238
|
-
}
|
|
3239
|
-
"id"
|
|
3209
|
+
}
|
|
3240
3210
|
);
|
|
3241
3211
|
},
|
|
3242
3212
|
[env]
|
|
@@ -3319,15 +3289,15 @@ function useCompanyService() {
|
|
|
3319
3289
|
var import_react5 = require("react");
|
|
3320
3290
|
function useExcelService() {
|
|
3321
3291
|
const { env } = useEnv();
|
|
3322
|
-
const
|
|
3292
|
+
const uploadFile = (0, import_react5.useCallback)(
|
|
3323
3293
|
async ({ formData }) => {
|
|
3324
|
-
return env.requests.post("/upload/file" /*
|
|
3294
|
+
return env.requests.post("/upload/file" /* UPLOAD_FILE_PATH */, formData);
|
|
3325
3295
|
},
|
|
3326
3296
|
[env]
|
|
3327
3297
|
);
|
|
3328
3298
|
const uploadIdFile = (0, import_react5.useCallback)(
|
|
3329
3299
|
async ({ formData }) => {
|
|
3330
|
-
return env.requests.post("/upload/file" /*
|
|
3300
|
+
return env.requests.post("/upload/file" /* UPLOAD_FILE_PATH */, formData, {
|
|
3331
3301
|
headers: {
|
|
3332
3302
|
"Content-Type": "multipart/form-data"
|
|
3333
3303
|
}
|
|
@@ -3475,7 +3445,7 @@ function useExcelService() {
|
|
|
3475
3445
|
[env]
|
|
3476
3446
|
);
|
|
3477
3447
|
return {
|
|
3478
|
-
|
|
3448
|
+
uploadFile,
|
|
3479
3449
|
uploadIdFile,
|
|
3480
3450
|
parsePreview,
|
|
3481
3451
|
executeImport,
|
|
@@ -3570,41 +3540,6 @@ function useFormService() {
|
|
|
3570
3540
|
},
|
|
3571
3541
|
[env]
|
|
3572
3542
|
);
|
|
3573
|
-
const uploadFile = (0, import_react6.useCallback)(
|
|
3574
|
-
async ({ formData }) => {
|
|
3575
|
-
return env.requests.post("/web/binary/upload_attachment" /* UPLOAD_FILE_PATH */, formData);
|
|
3576
|
-
},
|
|
3577
|
-
[env]
|
|
3578
|
-
);
|
|
3579
|
-
const saveFile = (0, import_react6.useCallback)(
|
|
3580
|
-
async ({
|
|
3581
|
-
model,
|
|
3582
|
-
idForm,
|
|
3583
|
-
idFile,
|
|
3584
|
-
context
|
|
3585
|
-
}) => {
|
|
3586
|
-
const jsonData = {
|
|
3587
|
-
model,
|
|
3588
|
-
method: "web_save" /* WEB_SAVE */,
|
|
3589
|
-
ids: [
|
|
3590
|
-
[idForm],
|
|
3591
|
-
{
|
|
3592
|
-
attachment_ids: [[4, idFile]]
|
|
3593
|
-
}
|
|
3594
|
-
],
|
|
3595
|
-
kwargs: {
|
|
3596
|
-
context,
|
|
3597
|
-
specification: {}
|
|
3598
|
-
}
|
|
3599
|
-
};
|
|
3600
|
-
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3601
|
-
headers: {
|
|
3602
|
-
"Content-Type": "application/json"
|
|
3603
|
-
}
|
|
3604
|
-
});
|
|
3605
|
-
},
|
|
3606
|
-
[env]
|
|
3607
|
-
);
|
|
3608
3543
|
const getFormView = (0, import_react6.useCallback)(
|
|
3609
3544
|
async ({ data }) => {
|
|
3610
3545
|
const jsonData = {
|
|
@@ -3657,9 +3592,7 @@ function useFormService() {
|
|
|
3657
3592
|
getImage,
|
|
3658
3593
|
uploadImage,
|
|
3659
3594
|
getFormView,
|
|
3660
|
-
changeStatus
|
|
3661
|
-
uploadFile,
|
|
3662
|
-
saveFile
|
|
3595
|
+
changeStatus
|
|
3663
3596
|
};
|
|
3664
3597
|
}
|
|
3665
3598
|
|
|
@@ -3792,7 +3725,7 @@ function useModelService() {
|
|
|
3792
3725
|
});
|
|
3793
3726
|
}, [env]);
|
|
3794
3727
|
const getAll = (0, import_react8.useCallback)(
|
|
3795
|
-
async ({ data
|
|
3728
|
+
async ({ data }) => {
|
|
3796
3729
|
const jsonReadGroup = data.type == "calendar" ? { fields: data?.fields } : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
3797
3730
|
fields: data.fields,
|
|
3798
3731
|
groupby: data.groupby
|
|
@@ -3813,16 +3746,11 @@ function useModelService() {
|
|
|
3813
3746
|
...jsonReadGroup
|
|
3814
3747
|
}
|
|
3815
3748
|
};
|
|
3816
|
-
return env.requests.post(
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
"Content-Type": "application/json"
|
|
3822
|
-
}
|
|
3823
|
-
},
|
|
3824
|
-
service
|
|
3825
|
-
);
|
|
3749
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3750
|
+
headers: {
|
|
3751
|
+
"Content-Type": "application/json"
|
|
3752
|
+
}
|
|
3753
|
+
});
|
|
3826
3754
|
},
|
|
3827
3755
|
[env]
|
|
3828
3756
|
);
|
|
@@ -3890,13 +3818,7 @@ function useModelService() {
|
|
|
3890
3818
|
[env]
|
|
3891
3819
|
);
|
|
3892
3820
|
const getDetail = (0, import_react8.useCallback)(
|
|
3893
|
-
async ({
|
|
3894
|
-
ids = [],
|
|
3895
|
-
model,
|
|
3896
|
-
specification,
|
|
3897
|
-
context,
|
|
3898
|
-
service
|
|
3899
|
-
}) => {
|
|
3821
|
+
async ({ ids = [], model, specification, context }) => {
|
|
3900
3822
|
const jsonData = {
|
|
3901
3823
|
model,
|
|
3902
3824
|
method: "web_read" /* WEB_READ */,
|
|
@@ -3906,16 +3828,11 @@ function useModelService() {
|
|
|
3906
3828
|
specification
|
|
3907
3829
|
}
|
|
3908
3830
|
};
|
|
3909
|
-
return env.requests.post(
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
"Content-Type": "application/json"
|
|
3915
|
-
}
|
|
3916
|
-
},
|
|
3917
|
-
service
|
|
3918
|
-
);
|
|
3831
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3832
|
+
headers: {
|
|
3833
|
+
"Content-Type": "application/json"
|
|
3834
|
+
}
|
|
3835
|
+
});
|
|
3919
3836
|
},
|
|
3920
3837
|
[env]
|
|
3921
3838
|
);
|
|
@@ -3926,8 +3843,7 @@ function useModelService() {
|
|
|
3926
3843
|
data = {},
|
|
3927
3844
|
specification = {},
|
|
3928
3845
|
context = {},
|
|
3929
|
-
path
|
|
3930
|
-
service
|
|
3846
|
+
path
|
|
3931
3847
|
}) => {
|
|
3932
3848
|
const jsonData = {
|
|
3933
3849
|
model,
|
|
@@ -3939,36 +3855,26 @@ function useModelService() {
|
|
|
3939
3855
|
specification
|
|
3940
3856
|
}
|
|
3941
3857
|
};
|
|
3942
|
-
return env.requests.post(
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
"Content-Type": "application/json"
|
|
3948
|
-
}
|
|
3949
|
-
},
|
|
3950
|
-
service
|
|
3951
|
-
);
|
|
3858
|
+
return env.requests.post(path ?? "/call" /* CALL_PATH */, jsonData, {
|
|
3859
|
+
headers: {
|
|
3860
|
+
"Content-Type": "application/json"
|
|
3861
|
+
}
|
|
3862
|
+
});
|
|
3952
3863
|
},
|
|
3953
3864
|
[env]
|
|
3954
3865
|
);
|
|
3955
3866
|
const deleteApi = (0, import_react8.useCallback)(
|
|
3956
|
-
async ({ ids = [], model
|
|
3867
|
+
async ({ ids = [], model }) => {
|
|
3957
3868
|
const jsonData = {
|
|
3958
3869
|
model,
|
|
3959
3870
|
method: "unlink" /* UNLINK */,
|
|
3960
3871
|
ids
|
|
3961
3872
|
};
|
|
3962
|
-
return env.requests.post(
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
"Content-Type": "application/json"
|
|
3968
|
-
}
|
|
3969
|
-
},
|
|
3970
|
-
service
|
|
3971
|
-
);
|
|
3873
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3874
|
+
headers: {
|
|
3875
|
+
"Content-Type": "application/json"
|
|
3876
|
+
}
|
|
3877
|
+
});
|
|
3972
3878
|
},
|
|
3973
3879
|
[env]
|
|
3974
3880
|
);
|
|
@@ -3979,8 +3885,7 @@ function useModelService() {
|
|
|
3979
3885
|
object,
|
|
3980
3886
|
specification,
|
|
3981
3887
|
context,
|
|
3982
|
-
fieldChange
|
|
3983
|
-
service
|
|
3888
|
+
fieldChange
|
|
3984
3889
|
}) => {
|
|
3985
3890
|
const jsonData = {
|
|
3986
3891
|
model,
|
|
@@ -3993,35 +3898,25 @@ function useModelService() {
|
|
|
3993
3898
|
specification
|
|
3994
3899
|
]
|
|
3995
3900
|
};
|
|
3996
|
-
return env.requests.post(
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
"Content-Type": "application/json"
|
|
4002
|
-
}
|
|
4003
|
-
},
|
|
4004
|
-
service
|
|
4005
|
-
);
|
|
3901
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3902
|
+
headers: {
|
|
3903
|
+
"Content-Type": "application/json"
|
|
3904
|
+
}
|
|
3905
|
+
});
|
|
4006
3906
|
},
|
|
4007
3907
|
[env]
|
|
4008
3908
|
);
|
|
4009
3909
|
const getListFieldsOnchange = (0, import_react8.useCallback)(
|
|
4010
|
-
async ({ model
|
|
3910
|
+
async ({ model }) => {
|
|
4011
3911
|
const jsonData = {
|
|
4012
3912
|
model,
|
|
4013
3913
|
method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
|
|
4014
3914
|
};
|
|
4015
|
-
return env.requests.post(
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
"Content-Type": "application/json"
|
|
4021
|
-
}
|
|
4022
|
-
},
|
|
4023
|
-
service
|
|
4024
|
-
);
|
|
3915
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3916
|
+
headers: {
|
|
3917
|
+
"Content-Type": "application/json"
|
|
3918
|
+
}
|
|
3919
|
+
});
|
|
4025
3920
|
},
|
|
4026
3921
|
[env]
|
|
4027
3922
|
);
|
|
@@ -4181,8 +4076,7 @@ function useViewService() {
|
|
|
4181
4076
|
views,
|
|
4182
4077
|
context = {},
|
|
4183
4078
|
options = {},
|
|
4184
|
-
aid
|
|
4185
|
-
service
|
|
4079
|
+
aid
|
|
4186
4080
|
}) => {
|
|
4187
4081
|
const defaultOptions = {
|
|
4188
4082
|
load_filters: true,
|
|
@@ -4198,16 +4092,11 @@ function useViewService() {
|
|
|
4198
4092
|
},
|
|
4199
4093
|
with_context: context
|
|
4200
4094
|
};
|
|
4201
|
-
return env?.requests?.post(
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
"Content-Type": "application/json"
|
|
4207
|
-
}
|
|
4208
|
-
},
|
|
4209
|
-
service
|
|
4210
|
-
);
|
|
4095
|
+
return env?.requests?.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
4096
|
+
headers: {
|
|
4097
|
+
"Content-Type": "application/json"
|
|
4098
|
+
}
|
|
4099
|
+
});
|
|
4211
4100
|
},
|
|
4212
4101
|
[env]
|
|
4213
4102
|
);
|
|
@@ -4290,7 +4179,7 @@ function useViewService() {
|
|
|
4290
4179
|
[env]
|
|
4291
4180
|
);
|
|
4292
4181
|
const getSelectionItem = (0, import_react10.useCallback)(
|
|
4293
|
-
async ({ data
|
|
4182
|
+
async ({ data }) => {
|
|
4294
4183
|
const jsonData = {
|
|
4295
4184
|
model: data.model,
|
|
4296
4185
|
ids: [],
|
|
@@ -4308,16 +4197,11 @@ function useViewService() {
|
|
|
4308
4197
|
}
|
|
4309
4198
|
}
|
|
4310
4199
|
};
|
|
4311
|
-
return env?.requests.post(
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
"Content-Type": "application/json"
|
|
4317
|
-
}
|
|
4318
|
-
},
|
|
4319
|
-
service
|
|
4320
|
-
);
|
|
4200
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4201
|
+
headers: {
|
|
4202
|
+
"Content-Type": "application/json"
|
|
4203
|
+
}
|
|
4204
|
+
});
|
|
4321
4205
|
},
|
|
4322
4206
|
[env]
|
|
4323
4207
|
);
|
|
@@ -4610,6 +4494,7 @@ var sessionStorageUtils = () => {
|
|
|
4610
4494
|
// src/configs/axios-client.ts
|
|
4611
4495
|
var axiosClient = {
|
|
4612
4496
|
init(config) {
|
|
4497
|
+
console.log("config", config);
|
|
4613
4498
|
const localStorage2 = config?.localStorageUtils ?? localStorageUtils();
|
|
4614
4499
|
const sessionStorage2 = config?.sessionStorageUtils ?? sessionStorageUtils();
|
|
4615
4500
|
const db = config?.db;
|
|
@@ -4628,25 +4513,21 @@ var axiosClient = {
|
|
|
4628
4513
|
};
|
|
4629
4514
|
const instance = import_axios.default.create({
|
|
4630
4515
|
adapter: import_axios.default.defaults.adapter,
|
|
4631
|
-
baseURL: config
|
|
4516
|
+
baseURL: config.baseUrl,
|
|
4632
4517
|
timeout: 5e4,
|
|
4633
4518
|
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
4634
4519
|
});
|
|
4635
4520
|
instance.interceptors.request.use(async (config2) => {
|
|
4636
4521
|
const { useRefreshToken, useActionToken, actionToken } = config2;
|
|
4637
|
-
let token = null;
|
|
4638
4522
|
if (useActionToken && actionToken) {
|
|
4639
|
-
|
|
4640
|
-
} else {
|
|
4641
|
-
const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
|
|
4642
|
-
token = await getToken?.();
|
|
4643
|
-
}
|
|
4644
|
-
if (token) {
|
|
4645
|
-
config2.headers["Authorization"] = `Bearer ${token}`;
|
|
4523
|
+
config2.headers["Action-Token"] = actionToken;
|
|
4646
4524
|
}
|
|
4647
4525
|
if (database) {
|
|
4648
4526
|
config2.headers["DATABASE"] = database;
|
|
4649
4527
|
}
|
|
4528
|
+
console.log("database", database);
|
|
4529
|
+
const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
|
|
4530
|
+
const token = await getToken?.();
|
|
4650
4531
|
if (token) config2.headers["Authorization"] = `Bearer ${token}`;
|
|
4651
4532
|
return config2;
|
|
4652
4533
|
}, Promise.reject);
|
|
@@ -4702,7 +4583,7 @@ var axiosClient = {
|
|
|
4702
4583
|
);
|
|
4703
4584
|
return new Promise(function(resolve) {
|
|
4704
4585
|
import_axios.default.post(
|
|
4705
|
-
`${config
|
|
4586
|
+
`${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
|
|
4706
4587
|
payload,
|
|
4707
4588
|
{
|
|
4708
4589
|
headers: {
|
|
@@ -4770,47 +4651,20 @@ var axiosClient = {
|
|
|
4770
4651
|
function formatUrl(url, db2) {
|
|
4771
4652
|
return url + (db2 ? "?db=" + db2 : "");
|
|
4772
4653
|
}
|
|
4773
|
-
const getBaseUrl = (baseUrl, serviceName) => {
|
|
4774
|
-
const service = serviceName || config?.default_service;
|
|
4775
|
-
return config?.default_service === "" ? `${baseUrl.replace(/\/$/, "")}/api/v2` : `${baseUrl.replace(/\/$/, "")}/${service}/api/v2`;
|
|
4776
|
-
};
|
|
4777
4654
|
const responseBody = (response) => response;
|
|
4778
4655
|
const requests = {
|
|
4779
|
-
get: (url, headers
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
headers
|
|
4787
|
-
).then(responseBody),
|
|
4788
|
-
post_excel: (url, body, headers, serviceName) => instance.post(
|
|
4789
|
-
formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
|
|
4790
|
-
body,
|
|
4791
|
-
{
|
|
4792
|
-
responseType: "arraybuffer",
|
|
4793
|
-
headers: {
|
|
4794
|
-
"Content-Type": typeof window !== "undefined" ? "application/json" : "application/javascript",
|
|
4795
|
-
Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
4796
|
-
...headers
|
|
4797
|
-
}
|
|
4656
|
+
get: (url, headers) => instance.get(formatUrl(url, db), headers).then(responseBody),
|
|
4657
|
+
post: (url, body, headers) => instance.post(formatUrl(url, db), body, headers).then(responseBody),
|
|
4658
|
+
post_excel: (url, body, headers) => instance.post(formatUrl(url, db), body, {
|
|
4659
|
+
responseType: "arraybuffer",
|
|
4660
|
+
headers: {
|
|
4661
|
+
"Content-Type": typeof window !== "undefined" ? "application/json" : "application/javascript",
|
|
4662
|
+
Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
4798
4663
|
}
|
|
4799
|
-
).then(responseBody),
|
|
4800
|
-
put: (url, body, headers
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
headers
|
|
4804
|
-
).then(responseBody),
|
|
4805
|
-
patch: (url, body, headers, serviceName) => instance.patch(
|
|
4806
|
-
formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
|
|
4807
|
-
body,
|
|
4808
|
-
headers
|
|
4809
|
-
).then(responseBody),
|
|
4810
|
-
delete: (url, headers, serviceName) => instance.delete(
|
|
4811
|
-
formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
|
|
4812
|
-
headers
|
|
4813
|
-
).then(responseBody)
|
|
4664
|
+
}).then(responseBody),
|
|
4665
|
+
put: (url, body, headers) => instance.put(formatUrl(url, db), body, headers).then(responseBody),
|
|
4666
|
+
patch: (url, body) => instance.patch(formatUrl(url, db), body).then(responseBody),
|
|
4667
|
+
delete: (url, body) => instance.delete(formatUrl(url, db), body).then(responseBody)
|
|
4814
4668
|
};
|
|
4815
4669
|
return requests;
|
|
4816
4670
|
}
|
|
@@ -5094,8 +4948,11 @@ var import_react_query14 = require("@tanstack/react-query");
|
|
|
5094
4948
|
var useValidateActionToken = () => {
|
|
5095
4949
|
const { isValidActionToken } = useAuthService();
|
|
5096
4950
|
return (0, import_react_query14.useMutation)({
|
|
5097
|
-
mutationFn: ({
|
|
5098
|
-
|
|
4951
|
+
mutationFn: ({
|
|
4952
|
+
actionToken,
|
|
4953
|
+
path
|
|
4954
|
+
}) => {
|
|
4955
|
+
return isValidActionToken(actionToken, path);
|
|
5099
4956
|
}
|
|
5100
4957
|
});
|
|
5101
4958
|
};
|
|
@@ -5241,17 +5098,17 @@ var useParsePreview = () => {
|
|
|
5241
5098
|
};
|
|
5242
5099
|
var use_parse_preview_default = useParsePreview;
|
|
5243
5100
|
|
|
5244
|
-
// src/hooks/excel/use-upload-file
|
|
5101
|
+
// src/hooks/excel/use-upload-file.ts
|
|
5245
5102
|
var import_react_query22 = require("@tanstack/react-query");
|
|
5246
|
-
var
|
|
5247
|
-
const {
|
|
5103
|
+
var useUploadFile = () => {
|
|
5104
|
+
const { uploadFile } = useExcelService();
|
|
5248
5105
|
return (0, import_react_query22.useMutation)({
|
|
5249
|
-
mutationFn: ({ formData }) =>
|
|
5106
|
+
mutationFn: ({ formData }) => uploadFile({
|
|
5250
5107
|
formData
|
|
5251
5108
|
})
|
|
5252
5109
|
});
|
|
5253
5110
|
};
|
|
5254
|
-
var
|
|
5111
|
+
var use_upload_file_default = useUploadFile;
|
|
5255
5112
|
|
|
5256
5113
|
// src/hooks/excel/use-upload-id-file.ts
|
|
5257
5114
|
var import_react_query23 = require("@tanstack/react-query");
|
|
@@ -5398,48 +5255,21 @@ var useUploadImage = () => {
|
|
|
5398
5255
|
};
|
|
5399
5256
|
var use_upload_image_default = useUploadImage;
|
|
5400
5257
|
|
|
5401
|
-
// src/hooks/form/use-upload-file.ts
|
|
5402
|
-
var import_react_query32 = require("@tanstack/react-query");
|
|
5403
|
-
var useUploadFile = () => {
|
|
5404
|
-
const { uploadFile } = useFormService();
|
|
5405
|
-
return (0, import_react_query32.useMutation)({
|
|
5406
|
-
mutationFn: ({ formData }) => uploadFile({
|
|
5407
|
-
formData
|
|
5408
|
-
})
|
|
5409
|
-
});
|
|
5410
|
-
};
|
|
5411
|
-
var use_upload_file_default = useUploadFile;
|
|
5412
|
-
|
|
5413
|
-
// src/hooks/form/use-save-file.ts
|
|
5414
|
-
var import_react_query33 = require("@tanstack/react-query");
|
|
5415
|
-
var useSaveFile = () => {
|
|
5416
|
-
const { saveFile } = useFormService();
|
|
5417
|
-
return (0, import_react_query33.useMutation)({
|
|
5418
|
-
mutationFn: ({
|
|
5419
|
-
model,
|
|
5420
|
-
idForm,
|
|
5421
|
-
idFile,
|
|
5422
|
-
context
|
|
5423
|
-
}) => saveFile({ model, idForm, idFile, context })
|
|
5424
|
-
});
|
|
5425
|
-
};
|
|
5426
|
-
var use_save_file_default = useSaveFile;
|
|
5427
|
-
|
|
5428
5258
|
// src/hooks/model/use-delete.ts
|
|
5429
|
-
var
|
|
5259
|
+
var import_react_query32 = require("@tanstack/react-query");
|
|
5430
5260
|
var useDelete = () => {
|
|
5431
5261
|
const { deleteApi } = useModelService();
|
|
5432
|
-
return (0,
|
|
5433
|
-
mutationFn: ({ ids, model
|
|
5262
|
+
return (0, import_react_query32.useMutation)({
|
|
5263
|
+
mutationFn: ({ ids, model }) => deleteApi({ ids, model })
|
|
5434
5264
|
});
|
|
5435
5265
|
};
|
|
5436
5266
|
var use_delete_default = useDelete;
|
|
5437
5267
|
|
|
5438
5268
|
// src/hooks/model/use-get-all.ts
|
|
5439
|
-
var
|
|
5269
|
+
var import_react_query33 = require("@tanstack/react-query");
|
|
5440
5270
|
var useGetAll = ({ data, queryKey, viewResponse }) => {
|
|
5441
5271
|
const { getAll } = useModelService();
|
|
5442
|
-
return (0,
|
|
5272
|
+
return (0, import_react_query33.useQuery)({
|
|
5443
5273
|
queryKey,
|
|
5444
5274
|
queryFn: () => getAll({ data }).then((res) => {
|
|
5445
5275
|
if (res) {
|
|
@@ -5453,10 +5283,10 @@ var useGetAll = ({ data, queryKey, viewResponse }) => {
|
|
|
5453
5283
|
var use_get_all_default = useGetAll;
|
|
5454
5284
|
|
|
5455
5285
|
// src/hooks/model/use-get-conversion-rate.ts
|
|
5456
|
-
var
|
|
5286
|
+
var import_react_query34 = require("@tanstack/react-query");
|
|
5457
5287
|
var useGetConversionRate = () => {
|
|
5458
5288
|
const { getConversionRate } = useModelService();
|
|
5459
|
-
return (0,
|
|
5289
|
+
return (0, import_react_query34.useQuery)({
|
|
5460
5290
|
queryKey: ["currency-rate"],
|
|
5461
5291
|
queryFn: () => getConversionRate().then((res) => {
|
|
5462
5292
|
if (res) {
|
|
@@ -5469,10 +5299,10 @@ var useGetConversionRate = () => {
|
|
|
5469
5299
|
var use_get_conversion_rate_default = useGetConversionRate;
|
|
5470
5300
|
|
|
5471
5301
|
// src/hooks/model/use-get-currency.ts
|
|
5472
|
-
var
|
|
5302
|
+
var import_react_query35 = require("@tanstack/react-query");
|
|
5473
5303
|
var useGetCurrency = () => {
|
|
5474
5304
|
const { getCurrency } = useModelService();
|
|
5475
|
-
return (0,
|
|
5305
|
+
return (0, import_react_query35.useQuery)({
|
|
5476
5306
|
queryKey: ["currency"],
|
|
5477
5307
|
queryFn: () => getCurrency().then((res) => {
|
|
5478
5308
|
if (res) {
|
|
@@ -5485,39 +5315,33 @@ var useGetCurrency = () => {
|
|
|
5485
5315
|
var use_get_currency_default = useGetCurrency;
|
|
5486
5316
|
|
|
5487
5317
|
// src/hooks/model/use-get-detail.ts
|
|
5488
|
-
var
|
|
5318
|
+
var import_react_query36 = require("@tanstack/react-query");
|
|
5489
5319
|
var useGetDetail = () => {
|
|
5490
5320
|
const { getDetail } = useModelService();
|
|
5491
|
-
return (0,
|
|
5321
|
+
return (0, import_react_query36.useMutation)({
|
|
5492
5322
|
mutationFn: ({
|
|
5493
5323
|
model,
|
|
5494
5324
|
ids,
|
|
5495
5325
|
specification,
|
|
5496
|
-
context
|
|
5497
|
-
service
|
|
5326
|
+
context
|
|
5498
5327
|
}) => getDetail({
|
|
5499
5328
|
model,
|
|
5500
5329
|
ids,
|
|
5501
5330
|
specification,
|
|
5502
|
-
context
|
|
5503
|
-
service
|
|
5331
|
+
context
|
|
5504
5332
|
})
|
|
5505
5333
|
});
|
|
5506
5334
|
};
|
|
5507
5335
|
var use_get_detail_default = useGetDetail;
|
|
5508
5336
|
|
|
5509
5337
|
// src/hooks/model/use-get-field-onchange.ts
|
|
5510
|
-
var
|
|
5511
|
-
var useGetFieldOnChange = ({
|
|
5512
|
-
model,
|
|
5513
|
-
service
|
|
5514
|
-
}) => {
|
|
5338
|
+
var import_react_query37 = require("@tanstack/react-query");
|
|
5339
|
+
var useGetFieldOnChange = ({ model }) => {
|
|
5515
5340
|
const { getListFieldsOnchange } = useModelService();
|
|
5516
|
-
return (0,
|
|
5341
|
+
return (0, import_react_query37.useQuery)({
|
|
5517
5342
|
queryKey: [`field-onchange-${model}`, model],
|
|
5518
5343
|
queryFn: () => getListFieldsOnchange({
|
|
5519
|
-
model
|
|
5520
|
-
service
|
|
5344
|
+
model
|
|
5521
5345
|
}).then((res) => {
|
|
5522
5346
|
if (res) {
|
|
5523
5347
|
return res;
|
|
@@ -5530,14 +5354,14 @@ var useGetFieldOnChange = ({
|
|
|
5530
5354
|
var use_get_field_onchange_default = useGetFieldOnChange;
|
|
5531
5355
|
|
|
5532
5356
|
// src/hooks/model/use-get-list-my-bank-account.ts
|
|
5533
|
-
var
|
|
5357
|
+
var import_react_query38 = require("@tanstack/react-query");
|
|
5534
5358
|
var useGetListMyBankAccount = ({
|
|
5535
5359
|
domain,
|
|
5536
5360
|
spectification,
|
|
5537
5361
|
model
|
|
5538
5362
|
}) => {
|
|
5539
5363
|
const { getListMyBankAccount } = useModelService();
|
|
5540
|
-
return (0,
|
|
5364
|
+
return (0, import_react_query38.useQuery)({
|
|
5541
5365
|
queryKey: ["bank-account", model, domain],
|
|
5542
5366
|
queryFn: () => getListMyBankAccount({
|
|
5543
5367
|
domain,
|
|
@@ -5599,8 +5423,7 @@ var BaseModel = class {
|
|
|
5599
5423
|
spec[field?.name] = {
|
|
5600
5424
|
fields: {
|
|
5601
5425
|
id: {},
|
|
5602
|
-
display_name: {}
|
|
5603
|
-
...field?.widget === "many2many_binary" ? { mimetype: {} } : {}
|
|
5426
|
+
display_name: {}
|
|
5604
5427
|
}
|
|
5605
5428
|
};
|
|
5606
5429
|
}
|
|
@@ -5691,64 +5514,61 @@ var useOdooDataTransform = () => {
|
|
|
5691
5514
|
var use_odoo_data_transform_default = useOdooDataTransform;
|
|
5692
5515
|
|
|
5693
5516
|
// src/hooks/model/use-onchange-form.ts
|
|
5694
|
-
var
|
|
5517
|
+
var import_react_query39 = require("@tanstack/react-query");
|
|
5695
5518
|
var useOnChangeForm = () => {
|
|
5696
5519
|
const { onChange } = useModelService();
|
|
5697
|
-
return (0,
|
|
5520
|
+
return (0, import_react_query39.useMutation)({
|
|
5698
5521
|
mutationFn: ({
|
|
5699
5522
|
ids,
|
|
5700
5523
|
model,
|
|
5701
5524
|
specification,
|
|
5702
5525
|
context,
|
|
5703
5526
|
object,
|
|
5704
|
-
fieldChange
|
|
5705
|
-
service
|
|
5527
|
+
fieldChange
|
|
5706
5528
|
}) => onChange({
|
|
5707
5529
|
ids,
|
|
5708
5530
|
model,
|
|
5709
5531
|
specification,
|
|
5710
5532
|
context,
|
|
5711
5533
|
object,
|
|
5712
|
-
fieldChange
|
|
5713
|
-
service
|
|
5534
|
+
fieldChange
|
|
5714
5535
|
})
|
|
5715
5536
|
});
|
|
5716
5537
|
};
|
|
5717
5538
|
var use_onchange_form_default = useOnChangeForm;
|
|
5718
5539
|
|
|
5719
5540
|
// src/hooks/model/use-save.ts
|
|
5720
|
-
var
|
|
5541
|
+
var import_react_query40 = require("@tanstack/react-query");
|
|
5721
5542
|
var useSave = () => {
|
|
5722
5543
|
const { save } = useModelService();
|
|
5723
|
-
return (0,
|
|
5544
|
+
return (0, import_react_query40.useMutation)({
|
|
5724
5545
|
mutationFn: ({
|
|
5725
5546
|
ids,
|
|
5726
5547
|
model,
|
|
5727
5548
|
data,
|
|
5728
5549
|
specification,
|
|
5729
5550
|
context,
|
|
5730
|
-
path
|
|
5731
|
-
|
|
5732
|
-
}) => save({ ids, model, data, specification, context, path, service })
|
|
5551
|
+
path
|
|
5552
|
+
}) => save({ ids, model, data, specification, context, path })
|
|
5733
5553
|
});
|
|
5734
5554
|
};
|
|
5735
5555
|
var use_save_default = useSave;
|
|
5736
5556
|
|
|
5737
5557
|
// src/hooks/user/use-get-profile.ts
|
|
5738
|
-
var
|
|
5558
|
+
var import_react_query41 = require("@tanstack/react-query");
|
|
5739
5559
|
var useGetProfile = (path) => {
|
|
5740
5560
|
const { getProfile } = useUserService();
|
|
5741
|
-
return (0,
|
|
5561
|
+
return (0, import_react_query41.useMutation)({
|
|
5742
5562
|
mutationFn: () => getProfile(path)
|
|
5743
5563
|
});
|
|
5744
5564
|
};
|
|
5745
5565
|
var use_get_profile_default = useGetProfile;
|
|
5746
5566
|
|
|
5747
5567
|
// src/hooks/user/use-get-user.ts
|
|
5748
|
-
var
|
|
5568
|
+
var import_react_query42 = require("@tanstack/react-query");
|
|
5749
5569
|
var useGetUser = () => {
|
|
5750
5570
|
const { getUser } = useUserService();
|
|
5751
|
-
return (0,
|
|
5571
|
+
return (0, import_react_query42.useMutation)({
|
|
5752
5572
|
mutationFn: ({ id, context }) => getUser({
|
|
5753
5573
|
id,
|
|
5754
5574
|
context
|
|
@@ -5758,10 +5578,10 @@ var useGetUser = () => {
|
|
|
5758
5578
|
var use_get_user_default = useGetUser;
|
|
5759
5579
|
|
|
5760
5580
|
// src/hooks/user/use-switch-locale.ts
|
|
5761
|
-
var
|
|
5581
|
+
var import_react_query43 = require("@tanstack/react-query");
|
|
5762
5582
|
var useSwitchLocale = () => {
|
|
5763
5583
|
const { switchUserLocale } = useUserService();
|
|
5764
|
-
return (0,
|
|
5584
|
+
return (0, import_react_query43.useMutation)({
|
|
5765
5585
|
mutationFn: ({ data }) => {
|
|
5766
5586
|
return switchUserLocale({
|
|
5767
5587
|
id: data.id,
|
|
@@ -5773,22 +5593,20 @@ var useSwitchLocale = () => {
|
|
|
5773
5593
|
var use_switch_locale_default = useSwitchLocale;
|
|
5774
5594
|
|
|
5775
5595
|
// src/hooks/view/use-button.ts
|
|
5776
|
-
var
|
|
5596
|
+
var import_react_query44 = require("@tanstack/react-query");
|
|
5777
5597
|
var useButton = () => {
|
|
5778
5598
|
const { callButton } = useActionService();
|
|
5779
|
-
return (0,
|
|
5599
|
+
return (0, import_react_query44.useMutation)({
|
|
5780
5600
|
mutationFn: ({
|
|
5781
5601
|
model,
|
|
5782
5602
|
ids,
|
|
5783
5603
|
context,
|
|
5784
|
-
method
|
|
5785
|
-
service
|
|
5604
|
+
method
|
|
5786
5605
|
}) => callButton({
|
|
5787
5606
|
model,
|
|
5788
5607
|
ids,
|
|
5789
5608
|
context,
|
|
5790
|
-
method
|
|
5791
|
-
service
|
|
5609
|
+
method
|
|
5792
5610
|
}),
|
|
5793
5611
|
onSuccess: (response) => {
|
|
5794
5612
|
return response;
|
|
@@ -5798,27 +5616,25 @@ var useButton = () => {
|
|
|
5798
5616
|
var use_button_default = useButton;
|
|
5799
5617
|
|
|
5800
5618
|
// src/hooks/view/use-duplicate-record.ts
|
|
5801
|
-
var
|
|
5619
|
+
var import_react_query45 = require("@tanstack/react-query");
|
|
5802
5620
|
var useDuplicateRecord = () => {
|
|
5803
5621
|
const { duplicateRecord } = useActionService();
|
|
5804
|
-
return (0,
|
|
5622
|
+
return (0, import_react_query45.useMutation)({
|
|
5805
5623
|
mutationFn: ({
|
|
5806
5624
|
id,
|
|
5807
5625
|
model,
|
|
5808
|
-
context
|
|
5809
|
-
service
|
|
5626
|
+
context
|
|
5810
5627
|
}) => duplicateRecord({
|
|
5811
5628
|
id,
|
|
5812
5629
|
model,
|
|
5813
|
-
context
|
|
5814
|
-
service
|
|
5630
|
+
context
|
|
5815
5631
|
})
|
|
5816
5632
|
});
|
|
5817
5633
|
};
|
|
5818
5634
|
var use_duplicate_record_default = useDuplicateRecord;
|
|
5819
5635
|
|
|
5820
5636
|
// src/hooks/view/use-get-action-detail.ts
|
|
5821
|
-
var
|
|
5637
|
+
var import_react_query46 = require("@tanstack/react-query");
|
|
5822
5638
|
var useGetActionDetail = ({
|
|
5823
5639
|
aid,
|
|
5824
5640
|
context,
|
|
@@ -5833,7 +5649,7 @@ var useGetActionDetail = ({
|
|
|
5833
5649
|
model: model ?? "",
|
|
5834
5650
|
context
|
|
5835
5651
|
};
|
|
5836
|
-
return (0,
|
|
5652
|
+
return (0, import_react_query46.useQuery)({
|
|
5837
5653
|
queryKey,
|
|
5838
5654
|
queryFn: async () => {
|
|
5839
5655
|
if (aid) {
|
|
@@ -5851,10 +5667,10 @@ var useGetActionDetail = ({
|
|
|
5851
5667
|
var use_get_action_detail_default = useGetActionDetail;
|
|
5852
5668
|
|
|
5853
5669
|
// src/hooks/view/use-get-calendar.ts
|
|
5854
|
-
var
|
|
5670
|
+
var import_react_query47 = require("@tanstack/react-query");
|
|
5855
5671
|
var useGetCalendar = (listDataProps, queryKey, enabled) => {
|
|
5856
5672
|
const { getListCalendar } = useModelService();
|
|
5857
|
-
return (0,
|
|
5673
|
+
return (0, import_react_query47.useQuery)({
|
|
5858
5674
|
queryKey,
|
|
5859
5675
|
queryFn: () => getListCalendar({ data: listDataProps }).then((res) => {
|
|
5860
5676
|
if (res) {
|
|
@@ -5870,13 +5686,13 @@ var useGetCalendar = (listDataProps, queryKey, enabled) => {
|
|
|
5870
5686
|
var use_get_calendar_default = useGetCalendar;
|
|
5871
5687
|
|
|
5872
5688
|
// src/hooks/view/use-get-groups.ts
|
|
5873
|
-
var
|
|
5689
|
+
var import_react_query48 = require("@tanstack/react-query");
|
|
5874
5690
|
var useGetGroups = ({
|
|
5875
5691
|
model,
|
|
5876
5692
|
width_context
|
|
5877
5693
|
}) => {
|
|
5878
5694
|
const { getGroups } = useKanbanService();
|
|
5879
|
-
return (0,
|
|
5695
|
+
return (0, import_react_query48.useQuery)({
|
|
5880
5696
|
queryKey: [model, width_context],
|
|
5881
5697
|
queryFn: () => getGroups({
|
|
5882
5698
|
model,
|
|
@@ -5893,12 +5709,12 @@ var useGetGroups = ({
|
|
|
5893
5709
|
var use_get_groups_default = useGetGroups;
|
|
5894
5710
|
|
|
5895
5711
|
// src/hooks/view/use-get-list-data.ts
|
|
5896
|
-
var
|
|
5897
|
-
var useGetListData = (listDataProps, queryKey, enabled
|
|
5712
|
+
var import_react_query49 = require("@tanstack/react-query");
|
|
5713
|
+
var useGetListData = (listDataProps, queryKey, enabled) => {
|
|
5898
5714
|
const { getAll } = useModelService();
|
|
5899
|
-
return (0,
|
|
5715
|
+
return (0, import_react_query49.useQuery)({
|
|
5900
5716
|
queryKey,
|
|
5901
|
-
queryFn: () => getAll({ data: listDataProps
|
|
5717
|
+
queryFn: () => getAll({ data: listDataProps }).then((res) => {
|
|
5902
5718
|
if (res) {
|
|
5903
5719
|
return res;
|
|
5904
5720
|
}
|
|
@@ -5912,10 +5728,10 @@ var useGetListData = (listDataProps, queryKey, enabled, service) => {
|
|
|
5912
5728
|
var use_get_list_data_default = useGetListData;
|
|
5913
5729
|
|
|
5914
5730
|
// src/hooks/view/use-get-menu.ts
|
|
5915
|
-
var
|
|
5731
|
+
var import_react_query50 = require("@tanstack/react-query");
|
|
5916
5732
|
var useGetMenu = (context, specification, enabled) => {
|
|
5917
5733
|
const { getMenu } = useViewService();
|
|
5918
|
-
return (0,
|
|
5734
|
+
return (0, import_react_query50.useQuery)({
|
|
5919
5735
|
queryKey: ["menus" /* MENU */, context],
|
|
5920
5736
|
queryFn: () => getMenu(context, specification).then((res) => {
|
|
5921
5737
|
if (res && res?.records && res?.records?.length > 0) {
|
|
@@ -5931,10 +5747,10 @@ var useGetMenu = (context, specification, enabled) => {
|
|
|
5931
5747
|
var use_get_menu_default = useGetMenu;
|
|
5932
5748
|
|
|
5933
5749
|
// src/hooks/view/use-get-print-report.ts
|
|
5934
|
-
var
|
|
5750
|
+
var import_react_query51 = require("@tanstack/react-query");
|
|
5935
5751
|
var useGetPrintReport = () => {
|
|
5936
5752
|
const { getPrintReportName } = useActionService();
|
|
5937
|
-
return (0,
|
|
5753
|
+
return (0, import_react_query51.useMutation)({
|
|
5938
5754
|
mutationFn: ({ id }) => getPrintReportName({
|
|
5939
5755
|
id
|
|
5940
5756
|
})
|
|
@@ -5943,7 +5759,7 @@ var useGetPrintReport = () => {
|
|
|
5943
5759
|
var use_get_print_report_default = useGetPrintReport;
|
|
5944
5760
|
|
|
5945
5761
|
// src/hooks/view/use-get-progress-bar.ts
|
|
5946
|
-
var
|
|
5762
|
+
var import_react_query52 = require("@tanstack/react-query");
|
|
5947
5763
|
var useGetProGressBar = ({
|
|
5948
5764
|
field,
|
|
5949
5765
|
color,
|
|
@@ -5951,7 +5767,7 @@ var useGetProGressBar = ({
|
|
|
5951
5767
|
width_context
|
|
5952
5768
|
}) => {
|
|
5953
5769
|
const { getProgressBar } = useKanbanService();
|
|
5954
|
-
return (0,
|
|
5770
|
+
return (0, import_react_query52.useQuery)({
|
|
5955
5771
|
queryKey: [],
|
|
5956
5772
|
queryFn: () => getProgressBar({
|
|
5957
5773
|
field,
|
|
@@ -5970,17 +5786,16 @@ var useGetProGressBar = ({
|
|
|
5970
5786
|
var use_get_progress_bar_default = useGetProGressBar;
|
|
5971
5787
|
|
|
5972
5788
|
// src/hooks/view/use-get-selection.ts
|
|
5973
|
-
var
|
|
5789
|
+
var import_react_query53 = require("@tanstack/react-query");
|
|
5974
5790
|
var useGetSelection = ({
|
|
5975
5791
|
data,
|
|
5976
5792
|
queryKey,
|
|
5977
|
-
enabled
|
|
5978
|
-
service
|
|
5793
|
+
enabled
|
|
5979
5794
|
}) => {
|
|
5980
5795
|
const { getSelectionItem } = useViewService();
|
|
5981
|
-
return (0,
|
|
5796
|
+
return (0, import_react_query53.useQuery)({
|
|
5982
5797
|
queryKey,
|
|
5983
|
-
queryFn: () => getSelectionItem({ data
|
|
5798
|
+
queryFn: () => getSelectionItem({ data }),
|
|
5984
5799
|
enabled,
|
|
5985
5800
|
refetchOnWindowFocus: false
|
|
5986
5801
|
});
|
|
@@ -5988,10 +5803,10 @@ var useGetSelection = ({
|
|
|
5988
5803
|
var use_get_selection_default = useGetSelection;
|
|
5989
5804
|
|
|
5990
5805
|
// src/hooks/view/use-get-view.ts
|
|
5991
|
-
var
|
|
5806
|
+
var import_react_query54 = require("@tanstack/react-query");
|
|
5992
5807
|
var useGetView = (viewParams, actData) => {
|
|
5993
5808
|
const { getView } = useViewService();
|
|
5994
|
-
return (0,
|
|
5809
|
+
return (0, import_react_query54.useQuery)({
|
|
5995
5810
|
queryKey: ["get_view_by_action" /* GET_VIEW_BY_ACTION */, viewParams],
|
|
5996
5811
|
queryFn: () => getView(viewParams),
|
|
5997
5812
|
enabled: !!actData,
|
|
@@ -6002,19 +5817,17 @@ var useGetView = (viewParams, actData) => {
|
|
|
6002
5817
|
var use_get_view_default = useGetView;
|
|
6003
5818
|
|
|
6004
5819
|
// src/hooks/view/use-load-action.ts
|
|
6005
|
-
var
|
|
5820
|
+
var import_react_query55 = require("@tanstack/react-query");
|
|
6006
5821
|
var useLoadAction = () => {
|
|
6007
5822
|
const { loadAction } = useActionService();
|
|
6008
|
-
return (0,
|
|
5823
|
+
return (0, import_react_query55.useMutation)({
|
|
6009
5824
|
mutationFn: ({
|
|
6010
5825
|
idAction,
|
|
6011
|
-
context
|
|
6012
|
-
service
|
|
5826
|
+
context
|
|
6013
5827
|
}) => {
|
|
6014
5828
|
return loadAction({
|
|
6015
5829
|
idAction,
|
|
6016
|
-
context
|
|
6017
|
-
service
|
|
5830
|
+
context
|
|
6018
5831
|
});
|
|
6019
5832
|
}
|
|
6020
5833
|
});
|
|
@@ -6022,10 +5835,10 @@ var useLoadAction = () => {
|
|
|
6022
5835
|
var use_load_action_default = useLoadAction;
|
|
6023
5836
|
|
|
6024
5837
|
// src/hooks/view/use-load-message.ts
|
|
6025
|
-
var
|
|
5838
|
+
var import_react_query56 = require("@tanstack/react-query");
|
|
6026
5839
|
var useLoadMessage = () => {
|
|
6027
5840
|
const { loadMessages } = useViewService();
|
|
6028
|
-
return (0,
|
|
5841
|
+
return (0, import_react_query56.useQuery)({
|
|
6029
5842
|
queryKey: [`load-message-failure`],
|
|
6030
5843
|
queryFn: () => loadMessages(),
|
|
6031
5844
|
refetchOnWindowFocus: false
|
|
@@ -6034,10 +5847,10 @@ var useLoadMessage = () => {
|
|
|
6034
5847
|
var use_load_message_default = useLoadMessage;
|
|
6035
5848
|
|
|
6036
5849
|
// src/hooks/view/use-print.ts
|
|
6037
|
-
var
|
|
5850
|
+
var import_react_query57 = require("@tanstack/react-query");
|
|
6038
5851
|
var usePrint = () => {
|
|
6039
5852
|
const { print } = useActionService();
|
|
6040
|
-
return (0,
|
|
5853
|
+
return (0, import_react_query57.useMutation)({
|
|
6041
5854
|
mutationFn: ({ id, report, db }) => print({
|
|
6042
5855
|
id,
|
|
6043
5856
|
report,
|
|
@@ -6048,30 +5861,28 @@ var usePrint = () => {
|
|
|
6048
5861
|
var use_print_default = usePrint;
|
|
6049
5862
|
|
|
6050
5863
|
// src/hooks/view/use-remove-row.ts
|
|
6051
|
-
var
|
|
5864
|
+
var import_react_query58 = require("@tanstack/react-query");
|
|
6052
5865
|
var useRemoveRow = () => {
|
|
6053
5866
|
const { removeRows } = useActionService();
|
|
6054
|
-
return (0,
|
|
5867
|
+
return (0, import_react_query58.useMutation)({
|
|
6055
5868
|
mutationFn: ({
|
|
6056
5869
|
model,
|
|
6057
5870
|
ids,
|
|
6058
|
-
context
|
|
6059
|
-
service
|
|
5871
|
+
context
|
|
6060
5872
|
}) => removeRows({
|
|
6061
5873
|
model,
|
|
6062
5874
|
ids,
|
|
6063
|
-
context
|
|
6064
|
-
service
|
|
5875
|
+
context
|
|
6065
5876
|
})
|
|
6066
5877
|
});
|
|
6067
5878
|
};
|
|
6068
5879
|
var use_remove_row_default = useRemoveRow;
|
|
6069
5880
|
|
|
6070
5881
|
// src/hooks/view/use-resequence.ts
|
|
6071
|
-
var
|
|
5882
|
+
var import_react_query59 = require("@tanstack/react-query");
|
|
6072
5883
|
var useGetResequence = (model, resIds, context, offset) => {
|
|
6073
5884
|
const { getResequence } = useViewService();
|
|
6074
|
-
return (0,
|
|
5885
|
+
return (0, import_react_query59.useQuery)({
|
|
6075
5886
|
queryKey: [],
|
|
6076
5887
|
queryFn: () => getResequence({
|
|
6077
5888
|
model,
|
|
@@ -6086,28 +5897,26 @@ var useGetResequence = (model, resIds, context, offset) => {
|
|
|
6086
5897
|
var use_resequence_default = useGetResequence;
|
|
6087
5898
|
|
|
6088
5899
|
// src/hooks/view/use-run-action.ts
|
|
6089
|
-
var
|
|
5900
|
+
var import_react_query60 = require("@tanstack/react-query");
|
|
6090
5901
|
var useRunAction = () => {
|
|
6091
5902
|
const { runAction } = useActionService();
|
|
6092
|
-
return (0,
|
|
5903
|
+
return (0, import_react_query60.useMutation)({
|
|
6093
5904
|
mutationFn: ({
|
|
6094
5905
|
idAction,
|
|
6095
|
-
context
|
|
6096
|
-
service
|
|
5906
|
+
context
|
|
6097
5907
|
}) => runAction({
|
|
6098
5908
|
idAction,
|
|
6099
|
-
context
|
|
6100
|
-
service
|
|
5909
|
+
context
|
|
6101
5910
|
})
|
|
6102
5911
|
});
|
|
6103
5912
|
};
|
|
6104
5913
|
var use_run_action_default = useRunAction;
|
|
6105
5914
|
|
|
6106
5915
|
// src/hooks/view/use-signin-sso.ts
|
|
6107
|
-
var
|
|
5916
|
+
var import_react_query61 = require("@tanstack/react-query");
|
|
6108
5917
|
var useSignInSSO = () => {
|
|
6109
5918
|
const { signInSSO } = useViewService();
|
|
6110
|
-
return (0,
|
|
5919
|
+
return (0, import_react_query61.useMutation)({
|
|
6111
5920
|
mutationFn: ({
|
|
6112
5921
|
redirect_uri,
|
|
6113
5922
|
state,
|
|
@@ -6130,10 +5939,10 @@ var useSignInSSO = () => {
|
|
|
6130
5939
|
var use_signin_sso_default = useSignInSSO;
|
|
6131
5940
|
|
|
6132
5941
|
// src/hooks/view/use-verify-2FA.ts
|
|
6133
|
-
var
|
|
5942
|
+
var import_react_query62 = require("@tanstack/react-query");
|
|
6134
5943
|
var useVerify2FA = () => {
|
|
6135
5944
|
const { verify2FA } = useViewService();
|
|
6136
|
-
return (0,
|
|
5945
|
+
return (0, import_react_query62.useMutation)({
|
|
6137
5946
|
mutationFn: ({
|
|
6138
5947
|
method,
|
|
6139
5948
|
with_context,
|
|
@@ -6154,10 +5963,10 @@ var useVerify2FA = () => {
|
|
|
6154
5963
|
var use_verify_2FA_default = useVerify2FA;
|
|
6155
5964
|
|
|
6156
5965
|
// src/hooks/view/uset-get-2FA-method.ts
|
|
6157
|
-
var
|
|
5966
|
+
var import_react_query63 = require("@tanstack/react-query");
|
|
6158
5967
|
var useGet2FAMethods = () => {
|
|
6159
5968
|
const { get2FAMethods } = useViewService();
|
|
6160
|
-
return (0,
|
|
5969
|
+
return (0, import_react_query63.useMutation)({
|
|
6161
5970
|
mutationFn: ({
|
|
6162
5971
|
method,
|
|
6163
5972
|
with_context
|
|
@@ -6172,10 +5981,10 @@ var useGet2FAMethods = () => {
|
|
|
6172
5981
|
var uset_get_2FA_method_default = useGet2FAMethods;
|
|
6173
5982
|
|
|
6174
5983
|
// src/hooks/view/use-grant-access.ts
|
|
6175
|
-
var
|
|
5984
|
+
var import_react_query64 = require("@tanstack/react-query");
|
|
6176
5985
|
var useGrantAccess = () => {
|
|
6177
5986
|
const { grantAccess } = useViewService();
|
|
6178
|
-
return (0,
|
|
5987
|
+
return (0, import_react_query64.useMutation)({
|
|
6179
5988
|
mutationFn: ({
|
|
6180
5989
|
redirect_uri,
|
|
6181
5990
|
state,
|
|
@@ -6194,10 +6003,10 @@ var useGrantAccess = () => {
|
|
|
6194
6003
|
var use_grant_access_default = useGrantAccess;
|
|
6195
6004
|
|
|
6196
6005
|
// src/hooks/view/use-remove-totp-setup.ts
|
|
6197
|
-
var
|
|
6006
|
+
var import_react_query65 = require("@tanstack/react-query");
|
|
6198
6007
|
var useRemoveTotpSetup = () => {
|
|
6199
6008
|
const { removeTotpSetUp } = useViewService();
|
|
6200
|
-
return (0,
|
|
6009
|
+
return (0, import_react_query65.useMutation)({
|
|
6201
6010
|
mutationFn: ({ method, token }) => {
|
|
6202
6011
|
return removeTotpSetUp({
|
|
6203
6012
|
method,
|
|
@@ -6209,10 +6018,10 @@ var useRemoveTotpSetup = () => {
|
|
|
6209
6018
|
var use_remove_totp_setup_default = useRemoveTotpSetup;
|
|
6210
6019
|
|
|
6211
6020
|
// src/hooks/view/use-request-setup-totp.ts
|
|
6212
|
-
var
|
|
6021
|
+
var import_react_query66 = require("@tanstack/react-query");
|
|
6213
6022
|
var useRequestSetupTotp = () => {
|
|
6214
6023
|
const { requestSetupTotp } = useViewService();
|
|
6215
|
-
return (0,
|
|
6024
|
+
return (0, import_react_query66.useMutation)({
|
|
6216
6025
|
mutationFn: ({ method, token }) => {
|
|
6217
6026
|
return requestSetupTotp({
|
|
6218
6027
|
method,
|
|
@@ -6224,10 +6033,10 @@ var useRequestSetupTotp = () => {
|
|
|
6224
6033
|
var use_request_setup_totp_default = useRequestSetupTotp;
|
|
6225
6034
|
|
|
6226
6035
|
// src/hooks/view/use-settings-web-read-2fa.ts
|
|
6227
|
-
var
|
|
6036
|
+
var import_react_query67 = require("@tanstack/react-query");
|
|
6228
6037
|
var useSettingsWebRead2fa = () => {
|
|
6229
6038
|
const { settingsWebRead2fa } = useViewService();
|
|
6230
|
-
return (0,
|
|
6039
|
+
return (0, import_react_query67.useMutation)({
|
|
6231
6040
|
mutationFn: ({
|
|
6232
6041
|
method,
|
|
6233
6042
|
token,
|
|
@@ -6246,10 +6055,10 @@ var useSettingsWebRead2fa = () => {
|
|
|
6246
6055
|
var use_settings_web_read_2fa_default = useSettingsWebRead2fa;
|
|
6247
6056
|
|
|
6248
6057
|
// src/hooks/view/use-verify-totp.ts
|
|
6249
|
-
var
|
|
6058
|
+
var import_react_query68 = require("@tanstack/react-query");
|
|
6250
6059
|
var useVerifyTotp = () => {
|
|
6251
6060
|
const { verifyTotp } = useViewService();
|
|
6252
|
-
return (0,
|
|
6061
|
+
return (0, import_react_query68.useMutation)({
|
|
6253
6062
|
mutationFn: ({
|
|
6254
6063
|
method,
|
|
6255
6064
|
action_token,
|
|
@@ -6272,7 +6081,6 @@ var ServiceProvider = ({
|
|
|
6272
6081
|
children
|
|
6273
6082
|
}) => {
|
|
6274
6083
|
const services = {
|
|
6275
|
-
useSaveFile: use_save_file_default,
|
|
6276
6084
|
useForgotPassword: use_forgot_password_default,
|
|
6277
6085
|
useForgotPasswordSSO: use_forgotpassword_sso_default,
|
|
6278
6086
|
useGetProvider: use_get_provider_default,
|
|
@@ -6293,7 +6101,7 @@ var ServiceProvider = ({
|
|
|
6293
6101
|
useGetFieldExport: use_get_field_export_default,
|
|
6294
6102
|
useGetFileExcel: use_get_file_excel_default,
|
|
6295
6103
|
useParsePreview: use_parse_preview_default,
|
|
6296
|
-
|
|
6104
|
+
useUploadFile: use_upload_file_default,
|
|
6297
6105
|
useUploadIdFile: use_upload_id_file_default,
|
|
6298
6106
|
useChangeStatus: use_change_status_default,
|
|
6299
6107
|
useDeleteComment: use_delete_comment_default,
|
|
@@ -6340,8 +6148,7 @@ var ServiceProvider = ({
|
|
|
6340
6148
|
useRemoveTotpSetup: use_remove_totp_setup_default,
|
|
6341
6149
|
useRequestSetupTotp: use_request_setup_totp_default,
|
|
6342
6150
|
useSettingsWebRead2fa: use_settings_web_read_2fa_default,
|
|
6343
|
-
useVerifyTotp: use_verify_totp_default
|
|
6344
|
-
useUploadFile: use_upload_file_default
|
|
6151
|
+
useVerifyTotp: use_verify_totp_default
|
|
6345
6152
|
};
|
|
6346
6153
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ServiceContext.Provider, { value: services, children });
|
|
6347
6154
|
};
|