@fctc/interface-logic 4.0.4 → 4.0.5
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/hooks.js +125 -124
- package/dist/hooks.mjs +3 -2
- package/dist/provider.js +151 -149
- package/dist/provider.mjs +17 -15
- package/dist/services.js +124 -123
- package/dist/services.mjs +3 -2
- package/package.json +1 -1
package/dist/provider.js
CHANGED
|
@@ -42,20 +42,22 @@ __export(provider_exports, {
|
|
|
42
42
|
module.exports = __toCommonJS(provider_exports);
|
|
43
43
|
|
|
44
44
|
// src/provider/react-query-provider.tsx
|
|
45
|
+
var import_react = require("react");
|
|
45
46
|
var import_react_query = require("@tanstack/react-query");
|
|
46
47
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
47
48
|
var ReactQueryProvider = ({ children }) => {
|
|
48
|
-
const queryClient =
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
const [queryClient] = (0, import_react.useState)(
|
|
50
|
+
() => new import_react_query.QueryClient({
|
|
51
|
+
defaultOptions: {
|
|
52
|
+
queries: {
|
|
53
|
+
refetchOnWindowFocus: false,
|
|
54
|
+
refetchOnMount: false,
|
|
55
|
+
refetchOnReconnect: false,
|
|
56
|
+
retry: false
|
|
57
|
+
}
|
|
56
58
|
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
+
})
|
|
60
|
+
);
|
|
59
61
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_query.QueryClientProvider, { client: queryClient, children });
|
|
60
62
|
};
|
|
61
63
|
|
|
@@ -695,11 +697,11 @@ var MainProvider = ({ children }) => {
|
|
|
695
697
|
};
|
|
696
698
|
|
|
697
699
|
// src/provider/version-gate-provider.tsx
|
|
698
|
-
var
|
|
700
|
+
var import_react13 = require("react");
|
|
699
701
|
var import_react_query2 = require("@tanstack/react-query");
|
|
700
702
|
|
|
701
703
|
// src/services/action-service/index.ts
|
|
702
|
-
var
|
|
704
|
+
var import_react3 = require("react");
|
|
703
705
|
|
|
704
706
|
// src/constants/api/uri-constant.ts
|
|
705
707
|
var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
@@ -2869,7 +2871,7 @@ function matchDomain(record, domain) {
|
|
|
2869
2871
|
}
|
|
2870
2872
|
|
|
2871
2873
|
// src/utils/function.ts
|
|
2872
|
-
var
|
|
2874
|
+
var import_react2 = require("react");
|
|
2873
2875
|
var toQueryString = (params) => {
|
|
2874
2876
|
return Object.keys(params).map(
|
|
2875
2877
|
(key) => encodeURIComponent(key) + "=" + encodeURIComponent(params[key].toString())
|
|
@@ -2990,7 +2992,7 @@ var sessionStorageUtils = /* @__PURE__ */ (() => {
|
|
|
2990
2992
|
// src/services/action-service/index.ts
|
|
2991
2993
|
function useActionService() {
|
|
2992
2994
|
const { env } = useEnv();
|
|
2993
|
-
const loadAction = (0,
|
|
2995
|
+
const loadAction = (0, import_react3.useCallback)(
|
|
2994
2996
|
async ({
|
|
2995
2997
|
idAction,
|
|
2996
2998
|
context,
|
|
@@ -3014,7 +3016,7 @@ function useActionService() {
|
|
|
3014
3016
|
},
|
|
3015
3017
|
[env]
|
|
3016
3018
|
);
|
|
3017
|
-
const callButton = (0,
|
|
3019
|
+
const callButton = (0, import_react3.useCallback)(
|
|
3018
3020
|
async ({
|
|
3019
3021
|
model,
|
|
3020
3022
|
ids = [],
|
|
@@ -3048,7 +3050,7 @@ function useActionService() {
|
|
|
3048
3050
|
},
|
|
3049
3051
|
[env]
|
|
3050
3052
|
);
|
|
3051
|
-
const removeRows = (0,
|
|
3053
|
+
const removeRows = (0, import_react3.useCallback)(
|
|
3052
3054
|
async ({
|
|
3053
3055
|
model,
|
|
3054
3056
|
ids,
|
|
@@ -3074,7 +3076,7 @@ function useActionService() {
|
|
|
3074
3076
|
},
|
|
3075
3077
|
[env]
|
|
3076
3078
|
);
|
|
3077
|
-
const duplicateRecord = (0,
|
|
3079
|
+
const duplicateRecord = (0, import_react3.useCallback)(
|
|
3078
3080
|
async ({
|
|
3079
3081
|
model,
|
|
3080
3082
|
id,
|
|
@@ -3100,7 +3102,7 @@ function useActionService() {
|
|
|
3100
3102
|
},
|
|
3101
3103
|
[env]
|
|
3102
3104
|
);
|
|
3103
|
-
const getPrintReportName = (0,
|
|
3105
|
+
const getPrintReportName = (0, import_react3.useCallback)(
|
|
3104
3106
|
async ({ id }) => {
|
|
3105
3107
|
const jsonData = {
|
|
3106
3108
|
model: "ir.actions.report",
|
|
@@ -3118,7 +3120,7 @@ function useActionService() {
|
|
|
3118
3120
|
},
|
|
3119
3121
|
[env]
|
|
3120
3122
|
);
|
|
3121
|
-
const print = (0,
|
|
3123
|
+
const print = (0, import_react3.useCallback)(
|
|
3122
3124
|
async ({ id, report, db }) => {
|
|
3123
3125
|
const jsonData = {
|
|
3124
3126
|
report,
|
|
@@ -3136,7 +3138,7 @@ function useActionService() {
|
|
|
3136
3138
|
},
|
|
3137
3139
|
[env]
|
|
3138
3140
|
);
|
|
3139
|
-
const runAction = (0,
|
|
3141
|
+
const runAction = (0, import_react3.useCallback)(
|
|
3140
3142
|
async ({
|
|
3141
3143
|
idAction,
|
|
3142
3144
|
context,
|
|
@@ -3163,7 +3165,7 @@ function useActionService() {
|
|
|
3163
3165
|
},
|
|
3164
3166
|
[env]
|
|
3165
3167
|
);
|
|
3166
|
-
const generateSerialNumber = (0,
|
|
3168
|
+
const generateSerialNumber = (0, import_react3.useCallback)(
|
|
3167
3169
|
async ({
|
|
3168
3170
|
kwargs,
|
|
3169
3171
|
context,
|
|
@@ -3201,10 +3203,10 @@ function useActionService() {
|
|
|
3201
3203
|
}
|
|
3202
3204
|
|
|
3203
3205
|
// src/services/auth-service/index.ts
|
|
3204
|
-
var
|
|
3206
|
+
var import_react4 = require("react");
|
|
3205
3207
|
function useAuthService() {
|
|
3206
3208
|
const { env } = useEnv();
|
|
3207
|
-
const login = (0,
|
|
3209
|
+
const login = (0, import_react4.useCallback)(
|
|
3208
3210
|
async (body) => {
|
|
3209
3211
|
const payload = Object.fromEntries(
|
|
3210
3212
|
Object.entries({
|
|
@@ -3229,7 +3231,7 @@ function useAuthService() {
|
|
|
3229
3231
|
},
|
|
3230
3232
|
[env]
|
|
3231
3233
|
);
|
|
3232
|
-
const forgotPassword = (0,
|
|
3234
|
+
const forgotPassword = (0, import_react4.useCallback)(
|
|
3233
3235
|
async (email) => {
|
|
3234
3236
|
const bodyData = {
|
|
3235
3237
|
login: email,
|
|
@@ -3243,7 +3245,7 @@ function useAuthService() {
|
|
|
3243
3245
|
},
|
|
3244
3246
|
[env]
|
|
3245
3247
|
);
|
|
3246
|
-
const forgotPasswordSSO = (0,
|
|
3248
|
+
const forgotPasswordSSO = (0, import_react4.useCallback)(
|
|
3247
3249
|
async ({
|
|
3248
3250
|
email,
|
|
3249
3251
|
with_context,
|
|
@@ -3266,7 +3268,7 @@ function useAuthService() {
|
|
|
3266
3268
|
},
|
|
3267
3269
|
[env]
|
|
3268
3270
|
);
|
|
3269
|
-
const resetPassword = (0,
|
|
3271
|
+
const resetPassword = (0, import_react4.useCallback)(
|
|
3270
3272
|
async (data, token) => {
|
|
3271
3273
|
const bodyData = {
|
|
3272
3274
|
token,
|
|
@@ -3281,7 +3283,7 @@ function useAuthService() {
|
|
|
3281
3283
|
},
|
|
3282
3284
|
[env]
|
|
3283
3285
|
);
|
|
3284
|
-
const resetPasswordSSO = (0,
|
|
3286
|
+
const resetPasswordSSO = (0, import_react4.useCallback)(
|
|
3285
3287
|
async ({
|
|
3286
3288
|
method,
|
|
3287
3289
|
password,
|
|
@@ -3304,7 +3306,7 @@ function useAuthService() {
|
|
|
3304
3306
|
},
|
|
3305
3307
|
[env]
|
|
3306
3308
|
);
|
|
3307
|
-
const updatePassword = (0,
|
|
3309
|
+
const updatePassword = (0, import_react4.useCallback)(
|
|
3308
3310
|
async (data, token) => {
|
|
3309
3311
|
const bodyData = {
|
|
3310
3312
|
token,
|
|
@@ -3319,7 +3321,7 @@ function useAuthService() {
|
|
|
3319
3321
|
},
|
|
3320
3322
|
[env]
|
|
3321
3323
|
);
|
|
3322
|
-
const isValidToken = (0,
|
|
3324
|
+
const isValidToken = (0, import_react4.useCallback)(
|
|
3323
3325
|
async (token) => {
|
|
3324
3326
|
const bodyData = {
|
|
3325
3327
|
token
|
|
@@ -3332,7 +3334,7 @@ function useAuthService() {
|
|
|
3332
3334
|
},
|
|
3333
3335
|
[env]
|
|
3334
3336
|
);
|
|
3335
|
-
const isValidActionToken = (0,
|
|
3337
|
+
const isValidActionToken = (0, import_react4.useCallback)(
|
|
3336
3338
|
async (actionToken) => {
|
|
3337
3339
|
const bodyData = {};
|
|
3338
3340
|
return env?.requests?.post("/action-token/validate" /* VALIDATE_ACTION_TOKEN */, bodyData, {
|
|
@@ -3345,7 +3347,7 @@ function useAuthService() {
|
|
|
3345
3347
|
},
|
|
3346
3348
|
[env]
|
|
3347
3349
|
);
|
|
3348
|
-
const loginSocial = (0,
|
|
3350
|
+
const loginSocial = (0, import_react4.useCallback)(
|
|
3349
3351
|
async ({
|
|
3350
3352
|
db,
|
|
3351
3353
|
state,
|
|
@@ -3363,13 +3365,13 @@ function useAuthService() {
|
|
|
3363
3365
|
},
|
|
3364
3366
|
[env]
|
|
3365
3367
|
);
|
|
3366
|
-
const getProviders = (0,
|
|
3368
|
+
const getProviders = (0, import_react4.useCallback)(
|
|
3367
3369
|
async (db) => {
|
|
3368
3370
|
return env?.requests?.get("/oauth/providers", { params: { db } });
|
|
3369
3371
|
},
|
|
3370
3372
|
[env]
|
|
3371
3373
|
);
|
|
3372
|
-
const getAccessByCode = (0,
|
|
3374
|
+
const getAccessByCode = (0, import_react4.useCallback)(
|
|
3373
3375
|
async (code) => {
|
|
3374
3376
|
const data = new URLSearchParams();
|
|
3375
3377
|
data.append("code", code);
|
|
@@ -3389,7 +3391,7 @@ function useAuthService() {
|
|
|
3389
3391
|
},
|
|
3390
3392
|
[env]
|
|
3391
3393
|
);
|
|
3392
|
-
const logout = (0,
|
|
3394
|
+
const logout = (0, import_react4.useCallback)(
|
|
3393
3395
|
async (service) => {
|
|
3394
3396
|
return env?.requests?.post(
|
|
3395
3397
|
"/logout" /* LOGOUT */,
|
|
@@ -3406,7 +3408,7 @@ function useAuthService() {
|
|
|
3406
3408
|
},
|
|
3407
3409
|
[env]
|
|
3408
3410
|
);
|
|
3409
|
-
const getTenantMapping = (0,
|
|
3411
|
+
const getTenantMapping = (0, import_react4.useCallback)(
|
|
3410
3412
|
async ({ shortName, service }) => {
|
|
3411
3413
|
const bodyData = {
|
|
3412
3414
|
short_name: shortName
|
|
@@ -3424,7 +3426,7 @@ function useAuthService() {
|
|
|
3424
3426
|
},
|
|
3425
3427
|
[env]
|
|
3426
3428
|
);
|
|
3427
|
-
const getToken = (0,
|
|
3429
|
+
const getToken = (0, import_react4.useCallback)(
|
|
3428
3430
|
async ({
|
|
3429
3431
|
phone,
|
|
3430
3432
|
name,
|
|
@@ -3468,10 +3470,10 @@ function useAuthService() {
|
|
|
3468
3470
|
}
|
|
3469
3471
|
|
|
3470
3472
|
// src/services/company-service/index.ts
|
|
3471
|
-
var
|
|
3473
|
+
var import_react5 = require("react");
|
|
3472
3474
|
function useCompanyService() {
|
|
3473
3475
|
const { env } = useEnv();
|
|
3474
|
-
const getCurrentCompany = (0,
|
|
3476
|
+
const getCurrentCompany = (0, import_react5.useCallback)(
|
|
3475
3477
|
async (service, extraHeaders) => {
|
|
3476
3478
|
return await env.requests.get(
|
|
3477
3479
|
"/company" /* COMPANY_PATH */,
|
|
@@ -3488,7 +3490,7 @@ function useCompanyService() {
|
|
|
3488
3490
|
},
|
|
3489
3491
|
[env]
|
|
3490
3492
|
);
|
|
3491
|
-
const getInfoCompany = (0,
|
|
3493
|
+
const getInfoCompany = (0, import_react5.useCallback)(
|
|
3492
3494
|
async (id, service) => {
|
|
3493
3495
|
const jsonData = {
|
|
3494
3496
|
ids: [id],
|
|
@@ -3524,10 +3526,10 @@ function useCompanyService() {
|
|
|
3524
3526
|
}
|
|
3525
3527
|
|
|
3526
3528
|
// src/services/excel-service/index.ts
|
|
3527
|
-
var
|
|
3529
|
+
var import_react6 = require("react");
|
|
3528
3530
|
function useExcelService() {
|
|
3529
3531
|
const { env } = useEnv();
|
|
3530
|
-
const uploadFileExcel = (0,
|
|
3532
|
+
const uploadFileExcel = (0, import_react6.useCallback)(
|
|
3531
3533
|
async ({
|
|
3532
3534
|
formData,
|
|
3533
3535
|
service,
|
|
@@ -3544,7 +3546,7 @@ function useExcelService() {
|
|
|
3544
3546
|
},
|
|
3545
3547
|
[env]
|
|
3546
3548
|
);
|
|
3547
|
-
const uploadIdFile = (0,
|
|
3549
|
+
const uploadIdFile = (0, import_react6.useCallback)(
|
|
3548
3550
|
async ({
|
|
3549
3551
|
formData,
|
|
3550
3552
|
service,
|
|
@@ -3561,7 +3563,7 @@ function useExcelService() {
|
|
|
3561
3563
|
},
|
|
3562
3564
|
[env]
|
|
3563
3565
|
);
|
|
3564
|
-
const parsePreview = (0,
|
|
3566
|
+
const parsePreview = (0, import_react6.useCallback)(
|
|
3565
3567
|
async ({
|
|
3566
3568
|
id,
|
|
3567
3569
|
selectedSheet,
|
|
@@ -3610,7 +3612,7 @@ function useExcelService() {
|
|
|
3610
3612
|
},
|
|
3611
3613
|
[env]
|
|
3612
3614
|
);
|
|
3613
|
-
const executeImport = (0,
|
|
3615
|
+
const executeImport = (0, import_react6.useCallback)(
|
|
3614
3616
|
async ({
|
|
3615
3617
|
columns,
|
|
3616
3618
|
fields,
|
|
@@ -3644,7 +3646,7 @@ function useExcelService() {
|
|
|
3644
3646
|
},
|
|
3645
3647
|
[env]
|
|
3646
3648
|
);
|
|
3647
|
-
const getFileExcel = (0,
|
|
3649
|
+
const getFileExcel = (0, import_react6.useCallback)(
|
|
3648
3650
|
async ({
|
|
3649
3651
|
model,
|
|
3650
3652
|
service,
|
|
@@ -3668,7 +3670,7 @@ function useExcelService() {
|
|
|
3668
3670
|
},
|
|
3669
3671
|
[env]
|
|
3670
3672
|
);
|
|
3671
|
-
const getFieldExport = (0,
|
|
3673
|
+
const getFieldExport = (0, import_react6.useCallback)(
|
|
3672
3674
|
async ({
|
|
3673
3675
|
ids,
|
|
3674
3676
|
model,
|
|
@@ -3708,7 +3710,7 @@ function useExcelService() {
|
|
|
3708
3710
|
},
|
|
3709
3711
|
[env]
|
|
3710
3712
|
);
|
|
3711
|
-
const exportExcel = (0,
|
|
3713
|
+
const exportExcel = (0, import_react6.useCallback)(
|
|
3712
3714
|
async ({
|
|
3713
3715
|
model,
|
|
3714
3716
|
domain,
|
|
@@ -3756,10 +3758,10 @@ function useExcelService() {
|
|
|
3756
3758
|
}
|
|
3757
3759
|
|
|
3758
3760
|
// src/services/form-service/index.ts
|
|
3759
|
-
var
|
|
3761
|
+
var import_react7 = require("react");
|
|
3760
3762
|
function useFormService() {
|
|
3761
3763
|
const { env } = useEnv();
|
|
3762
|
-
const getComment = (0,
|
|
3764
|
+
const getComment = (0, import_react7.useCallback)(
|
|
3763
3765
|
async ({ data }) => {
|
|
3764
3766
|
const jsonData = {
|
|
3765
3767
|
thread_id: data.thread_id,
|
|
@@ -3777,7 +3779,7 @@ function useFormService() {
|
|
|
3777
3779
|
},
|
|
3778
3780
|
[env]
|
|
3779
3781
|
);
|
|
3780
|
-
const getThreadData = (0,
|
|
3782
|
+
const getThreadData = (0, import_react7.useCallback)(
|
|
3781
3783
|
async ({
|
|
3782
3784
|
data,
|
|
3783
3785
|
xNode,
|
|
@@ -3804,7 +3806,7 @@ function useFormService() {
|
|
|
3804
3806
|
},
|
|
3805
3807
|
[env]
|
|
3806
3808
|
);
|
|
3807
|
-
const getThreadMessages = (0,
|
|
3809
|
+
const getThreadMessages = (0, import_react7.useCallback)(
|
|
3808
3810
|
async ({
|
|
3809
3811
|
data,
|
|
3810
3812
|
xNode,
|
|
@@ -3830,7 +3832,7 @@ function useFormService() {
|
|
|
3830
3832
|
},
|
|
3831
3833
|
[env]
|
|
3832
3834
|
);
|
|
3833
|
-
const sentComment = (0,
|
|
3835
|
+
const sentComment = (0, import_react7.useCallback)(
|
|
3834
3836
|
async ({ data }) => {
|
|
3835
3837
|
const jsonData = {
|
|
3836
3838
|
context: {
|
|
@@ -3858,7 +3860,7 @@ function useFormService() {
|
|
|
3858
3860
|
},
|
|
3859
3861
|
[env]
|
|
3860
3862
|
);
|
|
3861
|
-
const deleteComment = (0,
|
|
3863
|
+
const deleteComment = (0, import_react7.useCallback)(
|
|
3862
3864
|
async ({ data }) => {
|
|
3863
3865
|
const jsonData = {
|
|
3864
3866
|
attachment_ids: [],
|
|
@@ -3874,7 +3876,7 @@ function useFormService() {
|
|
|
3874
3876
|
},
|
|
3875
3877
|
[env]
|
|
3876
3878
|
);
|
|
3877
|
-
const getImage = (0,
|
|
3879
|
+
const getImage = (0, import_react7.useCallback)(
|
|
3878
3880
|
async ({ data }) => {
|
|
3879
3881
|
return env.requests.get(
|
|
3880
3882
|
`${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
|
|
@@ -3887,7 +3889,7 @@ function useFormService() {
|
|
|
3887
3889
|
},
|
|
3888
3890
|
[env]
|
|
3889
3891
|
);
|
|
3890
|
-
const uploadImage = (0,
|
|
3892
|
+
const uploadImage = (0, import_react7.useCallback)(
|
|
3891
3893
|
async ({
|
|
3892
3894
|
formData,
|
|
3893
3895
|
service,
|
|
@@ -3906,7 +3908,7 @@ function useFormService() {
|
|
|
3906
3908
|
},
|
|
3907
3909
|
[env]
|
|
3908
3910
|
);
|
|
3909
|
-
const uploadFile = (0,
|
|
3911
|
+
const uploadFile = (0, import_react7.useCallback)(
|
|
3910
3912
|
async ({
|
|
3911
3913
|
formData,
|
|
3912
3914
|
service,
|
|
@@ -3925,7 +3927,7 @@ function useFormService() {
|
|
|
3925
3927
|
},
|
|
3926
3928
|
[env]
|
|
3927
3929
|
);
|
|
3928
|
-
const getFormView = (0,
|
|
3930
|
+
const getFormView = (0, import_react7.useCallback)(
|
|
3929
3931
|
async ({ data }) => {
|
|
3930
3932
|
const jsonData = {
|
|
3931
3933
|
model: data.model,
|
|
@@ -3941,7 +3943,7 @@ function useFormService() {
|
|
|
3941
3943
|
},
|
|
3942
3944
|
[env]
|
|
3943
3945
|
);
|
|
3944
|
-
const changeStatus = (0,
|
|
3946
|
+
const changeStatus = (0, import_react7.useCallback)(
|
|
3945
3947
|
async ({ data }) => {
|
|
3946
3948
|
const vals = {
|
|
3947
3949
|
[data.name]: data.stage_id
|
|
@@ -3970,7 +3972,7 @@ function useFormService() {
|
|
|
3970
3972
|
},
|
|
3971
3973
|
[env]
|
|
3972
3974
|
);
|
|
3973
|
-
const getExternalTab = (0,
|
|
3975
|
+
const getExternalTab = (0, import_react7.useCallback)(
|
|
3974
3976
|
async ({ method, context, service, xNode }) => {
|
|
3975
3977
|
return env?.requests?.post(
|
|
3976
3978
|
"/call" /* CALL_PATH */,
|
|
@@ -4005,10 +4007,10 @@ function useFormService() {
|
|
|
4005
4007
|
}
|
|
4006
4008
|
|
|
4007
4009
|
// src/services/kanban-service/index.ts
|
|
4008
|
-
var
|
|
4010
|
+
var import_react8 = require("react");
|
|
4009
4011
|
function useKanbanService() {
|
|
4010
4012
|
const { env } = useEnv();
|
|
4011
|
-
const getGroups = (0,
|
|
4013
|
+
const getGroups = (0, import_react8.useCallback)(
|
|
4012
4014
|
async ({ model, width_context }) => {
|
|
4013
4015
|
const jsonData = {
|
|
4014
4016
|
model,
|
|
@@ -4028,7 +4030,7 @@ function useKanbanService() {
|
|
|
4028
4030
|
},
|
|
4029
4031
|
[env]
|
|
4030
4032
|
);
|
|
4031
|
-
const getProgressBar = (0,
|
|
4033
|
+
const getProgressBar = (0, import_react8.useCallback)(
|
|
4032
4034
|
async ({ field, color, model, width_context }) => {
|
|
4033
4035
|
const jsonData = {
|
|
4034
4036
|
model,
|
|
@@ -4058,10 +4060,10 @@ function useKanbanService() {
|
|
|
4058
4060
|
}
|
|
4059
4061
|
|
|
4060
4062
|
// src/services/model-service/index.ts
|
|
4061
|
-
var
|
|
4063
|
+
var import_react9 = require("react");
|
|
4062
4064
|
function useModelService() {
|
|
4063
4065
|
const { env } = useEnv();
|
|
4064
|
-
const getListMyBankAccount = (0,
|
|
4066
|
+
const getListMyBankAccount = (0, import_react9.useCallback)(
|
|
4065
4067
|
async ({
|
|
4066
4068
|
domain,
|
|
4067
4069
|
spectification,
|
|
@@ -4085,7 +4087,7 @@ function useModelService() {
|
|
|
4085
4087
|
},
|
|
4086
4088
|
[env]
|
|
4087
4089
|
);
|
|
4088
|
-
const getCurrency = (0,
|
|
4090
|
+
const getCurrency = (0, import_react9.useCallback)(async () => {
|
|
4089
4091
|
const jsonData = {
|
|
4090
4092
|
model: "res.currency",
|
|
4091
4093
|
method: "web_search_read",
|
|
@@ -4105,7 +4107,7 @@ function useModelService() {
|
|
|
4105
4107
|
}
|
|
4106
4108
|
});
|
|
4107
4109
|
}, [env]);
|
|
4108
|
-
const getConversionRate = (0,
|
|
4110
|
+
const getConversionRate = (0, import_react9.useCallback)(async () => {
|
|
4109
4111
|
const jsonData = {
|
|
4110
4112
|
model: "res.currency",
|
|
4111
4113
|
method: "web_search_read",
|
|
@@ -4131,7 +4133,7 @@ function useModelService() {
|
|
|
4131
4133
|
}
|
|
4132
4134
|
});
|
|
4133
4135
|
}, [env]);
|
|
4134
|
-
const getAll = (0,
|
|
4136
|
+
const getAll = (0, import_react9.useCallback)(
|
|
4135
4137
|
async ({
|
|
4136
4138
|
data,
|
|
4137
4139
|
service,
|
|
@@ -4173,7 +4175,7 @@ function useModelService() {
|
|
|
4173
4175
|
},
|
|
4174
4176
|
[env]
|
|
4175
4177
|
);
|
|
4176
|
-
const getListCalendar = (0,
|
|
4178
|
+
const getListCalendar = (0, import_react9.useCallback)(
|
|
4177
4179
|
async ({ data }) => {
|
|
4178
4180
|
const jsonReadGroup = data.type == "calendar" ? data?.fields : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
4179
4181
|
fields: data.fields,
|
|
@@ -4204,7 +4206,7 @@ function useModelService() {
|
|
|
4204
4206
|
},
|
|
4205
4207
|
[env]
|
|
4206
4208
|
);
|
|
4207
|
-
const getList = (0,
|
|
4209
|
+
const getList = (0, import_react9.useCallback)(
|
|
4208
4210
|
async ({
|
|
4209
4211
|
model,
|
|
4210
4212
|
ids = [],
|
|
@@ -4236,7 +4238,7 @@ function useModelService() {
|
|
|
4236
4238
|
},
|
|
4237
4239
|
[env]
|
|
4238
4240
|
);
|
|
4239
|
-
const getDetail = (0,
|
|
4241
|
+
const getDetail = (0, import_react9.useCallback)(
|
|
4240
4242
|
async ({
|
|
4241
4243
|
ids = [],
|
|
4242
4244
|
model,
|
|
@@ -4268,7 +4270,7 @@ function useModelService() {
|
|
|
4268
4270
|
},
|
|
4269
4271
|
[env]
|
|
4270
4272
|
);
|
|
4271
|
-
const save = (0,
|
|
4273
|
+
const save = (0, import_react9.useCallback)(
|
|
4272
4274
|
async ({
|
|
4273
4275
|
model,
|
|
4274
4276
|
ids = [],
|
|
@@ -4303,7 +4305,7 @@ function useModelService() {
|
|
|
4303
4305
|
},
|
|
4304
4306
|
[env]
|
|
4305
4307
|
);
|
|
4306
|
-
const deleteApi = (0,
|
|
4308
|
+
const deleteApi = (0, import_react9.useCallback)(
|
|
4307
4309
|
async ({ ids = [], model, service }) => {
|
|
4308
4310
|
const jsonData = {
|
|
4309
4311
|
model,
|
|
@@ -4323,7 +4325,7 @@ function useModelService() {
|
|
|
4323
4325
|
},
|
|
4324
4326
|
[env]
|
|
4325
4327
|
);
|
|
4326
|
-
const onChange = (0,
|
|
4328
|
+
const onChange = (0, import_react9.useCallback)(
|
|
4327
4329
|
async ({
|
|
4328
4330
|
ids = [],
|
|
4329
4331
|
model,
|
|
@@ -4359,7 +4361,7 @@ function useModelService() {
|
|
|
4359
4361
|
},
|
|
4360
4362
|
[env]
|
|
4361
4363
|
);
|
|
4362
|
-
const getListFieldsOnchange = (0,
|
|
4364
|
+
const getListFieldsOnchange = (0, import_react9.useCallback)(
|
|
4363
4365
|
async ({
|
|
4364
4366
|
model,
|
|
4365
4367
|
service,
|
|
@@ -4383,7 +4385,7 @@ function useModelService() {
|
|
|
4383
4385
|
},
|
|
4384
4386
|
[env]
|
|
4385
4387
|
);
|
|
4386
|
-
const parseORMOdoo = (0,
|
|
4388
|
+
const parseORMOdoo = (0, import_react9.useCallback)((data) => {
|
|
4387
4389
|
for (const key in data) {
|
|
4388
4390
|
if (key === "display_name") {
|
|
4389
4391
|
delete data[key];
|
|
@@ -4396,7 +4398,7 @@ function useModelService() {
|
|
|
4396
4398
|
}
|
|
4397
4399
|
return { ...data };
|
|
4398
4400
|
}, []);
|
|
4399
|
-
const toDataJS = (0,
|
|
4401
|
+
const toDataJS = (0, import_react9.useCallback)(
|
|
4400
4402
|
(data, viewData, model) => {
|
|
4401
4403
|
for (const key in data) {
|
|
4402
4404
|
if (data[key] === false) {
|
|
@@ -4456,10 +4458,10 @@ function useModelService() {
|
|
|
4456
4458
|
}
|
|
4457
4459
|
|
|
4458
4460
|
// src/services/user-service/index.ts
|
|
4459
|
-
var
|
|
4461
|
+
var import_react10 = require("react");
|
|
4460
4462
|
function useUserService() {
|
|
4461
4463
|
const { env } = useEnv();
|
|
4462
|
-
const getProfile = (0,
|
|
4464
|
+
const getProfile = (0, import_react10.useCallback)(
|
|
4463
4465
|
async (service, path, extraHeaders) => {
|
|
4464
4466
|
return env?.requests?.get(
|
|
4465
4467
|
path || "/userinfo" /* PROFILE_PATH */,
|
|
@@ -4476,7 +4478,7 @@ function useUserService() {
|
|
|
4476
4478
|
},
|
|
4477
4479
|
[env]
|
|
4478
4480
|
);
|
|
4479
|
-
const getUser = (0,
|
|
4481
|
+
const getUser = (0, import_react10.useCallback)(
|
|
4480
4482
|
async ({ context, id }) => {
|
|
4481
4483
|
const jsonData = {
|
|
4482
4484
|
model: "res.users",
|
|
@@ -4514,7 +4516,7 @@ function useUserService() {
|
|
|
4514
4516
|
},
|
|
4515
4517
|
[env]
|
|
4516
4518
|
);
|
|
4517
|
-
const switchUserLocale = (0,
|
|
4519
|
+
const switchUserLocale = (0, import_react10.useCallback)(
|
|
4518
4520
|
async ({ id, values, service }) => {
|
|
4519
4521
|
const jsonData = {
|
|
4520
4522
|
model: "res.users",
|
|
@@ -4542,10 +4544,10 @@ function useUserService() {
|
|
|
4542
4544
|
}
|
|
4543
4545
|
|
|
4544
4546
|
// src/services/view-service/index.ts
|
|
4545
|
-
var
|
|
4547
|
+
var import_react11 = require("react");
|
|
4546
4548
|
function useViewService() {
|
|
4547
4549
|
const { env } = useEnv();
|
|
4548
|
-
const getView = (0,
|
|
4550
|
+
const getView = (0, import_react11.useCallback)(
|
|
4549
4551
|
async ({
|
|
4550
4552
|
model,
|
|
4551
4553
|
views,
|
|
@@ -4585,7 +4587,7 @@ function useViewService() {
|
|
|
4585
4587
|
},
|
|
4586
4588
|
[env]
|
|
4587
4589
|
);
|
|
4588
|
-
const getMenu = (0,
|
|
4590
|
+
const getMenu = (0, import_react11.useCallback)(
|
|
4589
4591
|
async (context, specification, domain, service) => {
|
|
4590
4592
|
const jsonData = {
|
|
4591
4593
|
model: "ir.ui.menu" /* MENU */,
|
|
@@ -4616,7 +4618,7 @@ function useViewService() {
|
|
|
4616
4618
|
},
|
|
4617
4619
|
[env]
|
|
4618
4620
|
);
|
|
4619
|
-
const getActionDetail = (0,
|
|
4621
|
+
const getActionDetail = (0, import_react11.useCallback)(
|
|
4620
4622
|
async (aid, context) => {
|
|
4621
4623
|
const jsonData = {
|
|
4622
4624
|
model: "ir.actions.act_window" /* WINDOW_ACTION */,
|
|
@@ -4646,7 +4648,7 @@ function useViewService() {
|
|
|
4646
4648
|
},
|
|
4647
4649
|
[env]
|
|
4648
4650
|
);
|
|
4649
|
-
const getResequence = (0,
|
|
4651
|
+
const getResequence = (0, import_react11.useCallback)(
|
|
4650
4652
|
async ({
|
|
4651
4653
|
model,
|
|
4652
4654
|
ids,
|
|
@@ -4676,7 +4678,7 @@ function useViewService() {
|
|
|
4676
4678
|
},
|
|
4677
4679
|
[env]
|
|
4678
4680
|
);
|
|
4679
|
-
const getSelectionItem = (0,
|
|
4681
|
+
const getSelectionItem = (0, import_react11.useCallback)(
|
|
4680
4682
|
async ({
|
|
4681
4683
|
data,
|
|
4682
4684
|
service,
|
|
@@ -4713,7 +4715,7 @@ function useViewService() {
|
|
|
4713
4715
|
},
|
|
4714
4716
|
[env]
|
|
4715
4717
|
);
|
|
4716
|
-
const loadMessages = (0,
|
|
4718
|
+
const loadMessages = (0, import_react11.useCallback)(async () => {
|
|
4717
4719
|
return env.requests.post(
|
|
4718
4720
|
"/load_message_failures" /* LOAD_MESSAGE */,
|
|
4719
4721
|
{},
|
|
@@ -4724,14 +4726,14 @@ function useViewService() {
|
|
|
4724
4726
|
}
|
|
4725
4727
|
);
|
|
4726
4728
|
}, [env]);
|
|
4727
|
-
const getVersion = (0,
|
|
4729
|
+
const getVersion = (0, import_react11.useCallback)(async () => {
|
|
4728
4730
|
return env?.requests?.get("", {
|
|
4729
4731
|
headers: {
|
|
4730
4732
|
"Content-Type": "application/json"
|
|
4731
4733
|
}
|
|
4732
4734
|
});
|
|
4733
4735
|
}, [env]);
|
|
4734
|
-
const grantAccess = (0,
|
|
4736
|
+
const grantAccess = (0, import_react11.useCallback)(
|
|
4735
4737
|
async ({
|
|
4736
4738
|
redirect_uri,
|
|
4737
4739
|
state,
|
|
@@ -4758,7 +4760,7 @@ function useViewService() {
|
|
|
4758
4760
|
},
|
|
4759
4761
|
[env]
|
|
4760
4762
|
);
|
|
4761
|
-
const removeTotpSetUp = (0,
|
|
4763
|
+
const removeTotpSetUp = (0, import_react11.useCallback)(
|
|
4762
4764
|
async ({ method, token }) => {
|
|
4763
4765
|
const jsonData = {
|
|
4764
4766
|
method,
|
|
@@ -4779,7 +4781,7 @@ function useViewService() {
|
|
|
4779
4781
|
},
|
|
4780
4782
|
[env]
|
|
4781
4783
|
);
|
|
4782
|
-
const requestSetupTotp = (0,
|
|
4784
|
+
const requestSetupTotp = (0, import_react11.useCallback)(
|
|
4783
4785
|
async ({ method, token }) => {
|
|
4784
4786
|
const jsonData = {
|
|
4785
4787
|
method,
|
|
@@ -4798,7 +4800,7 @@ function useViewService() {
|
|
|
4798
4800
|
},
|
|
4799
4801
|
[env]
|
|
4800
4802
|
);
|
|
4801
|
-
const settingsWebRead2fa = (0,
|
|
4803
|
+
const settingsWebRead2fa = (0, import_react11.useCallback)(
|
|
4802
4804
|
async ({
|
|
4803
4805
|
method,
|
|
4804
4806
|
model,
|
|
@@ -4826,7 +4828,7 @@ function useViewService() {
|
|
|
4826
4828
|
},
|
|
4827
4829
|
[env]
|
|
4828
4830
|
);
|
|
4829
|
-
const signInSSO = (0,
|
|
4831
|
+
const signInSSO = (0, import_react11.useCallback)(
|
|
4830
4832
|
async ({
|
|
4831
4833
|
redirect_uri,
|
|
4832
4834
|
state,
|
|
@@ -4858,7 +4860,7 @@ function useViewService() {
|
|
|
4858
4860
|
},
|
|
4859
4861
|
[env]
|
|
4860
4862
|
);
|
|
4861
|
-
const verify2FA = (0,
|
|
4863
|
+
const verify2FA = (0, import_react11.useCallback)(
|
|
4862
4864
|
({
|
|
4863
4865
|
method,
|
|
4864
4866
|
with_context,
|
|
@@ -4891,7 +4893,7 @@ function useViewService() {
|
|
|
4891
4893
|
},
|
|
4892
4894
|
[env]
|
|
4893
4895
|
);
|
|
4894
|
-
const get2FAMethods = (0,
|
|
4896
|
+
const get2FAMethods = (0, import_react11.useCallback)(
|
|
4895
4897
|
({ method, with_context }) => {
|
|
4896
4898
|
const jsonData = {
|
|
4897
4899
|
method,
|
|
@@ -4910,7 +4912,7 @@ function useViewService() {
|
|
|
4910
4912
|
},
|
|
4911
4913
|
[env]
|
|
4912
4914
|
);
|
|
4913
|
-
const verifyTotp = (0,
|
|
4915
|
+
const verifyTotp = (0, import_react11.useCallback)(
|
|
4914
4916
|
({
|
|
4915
4917
|
method,
|
|
4916
4918
|
action_token,
|
|
@@ -4935,7 +4937,7 @@ function useViewService() {
|
|
|
4935
4937
|
},
|
|
4936
4938
|
[env]
|
|
4937
4939
|
);
|
|
4938
|
-
const getASession = (0,
|
|
4940
|
+
const getASession = (0, import_react11.useCallback)(
|
|
4939
4941
|
async ({
|
|
4940
4942
|
model,
|
|
4941
4943
|
args,
|
|
@@ -4978,7 +4980,7 @@ function useViewService() {
|
|
|
4978
4980
|
},
|
|
4979
4981
|
[env]
|
|
4980
4982
|
);
|
|
4981
|
-
const updateClosedSession = (0,
|
|
4983
|
+
const updateClosedSession = (0, import_react11.useCallback)(
|
|
4982
4984
|
({
|
|
4983
4985
|
model,
|
|
4984
4986
|
domain,
|
|
@@ -5005,7 +5007,7 @@ function useViewService() {
|
|
|
5005
5007
|
},
|
|
5006
5008
|
[env]
|
|
5007
5009
|
);
|
|
5008
|
-
const manageSession = (0,
|
|
5010
|
+
const manageSession = (0, import_react11.useCallback)(
|
|
5009
5011
|
({
|
|
5010
5012
|
model,
|
|
5011
5013
|
method,
|
|
@@ -5036,7 +5038,7 @@ function useViewService() {
|
|
|
5036
5038
|
},
|
|
5037
5039
|
[env]
|
|
5038
5040
|
);
|
|
5039
|
-
const handleClosingSession = (0,
|
|
5041
|
+
const handleClosingSession = (0, import_react11.useCallback)(
|
|
5040
5042
|
({
|
|
5041
5043
|
model,
|
|
5042
5044
|
method,
|
|
@@ -5065,7 +5067,7 @@ function useViewService() {
|
|
|
5065
5067
|
},
|
|
5066
5068
|
[env]
|
|
5067
5069
|
);
|
|
5068
|
-
const createSession = (0,
|
|
5070
|
+
const createSession = (0, import_react11.useCallback)(
|
|
5069
5071
|
({
|
|
5070
5072
|
model,
|
|
5071
5073
|
configId,
|
|
@@ -5095,7 +5097,7 @@ function useViewService() {
|
|
|
5095
5097
|
},
|
|
5096
5098
|
[env]
|
|
5097
5099
|
);
|
|
5098
|
-
const getPOS = (0,
|
|
5100
|
+
const getPOS = (0, import_react11.useCallback)(
|
|
5099
5101
|
({
|
|
5100
5102
|
model,
|
|
5101
5103
|
args,
|
|
@@ -5153,7 +5155,7 @@ function useViewService() {
|
|
|
5153
5155
|
},
|
|
5154
5156
|
[env]
|
|
5155
5157
|
);
|
|
5156
|
-
const createEntity = (0,
|
|
5158
|
+
const createEntity = (0, import_react11.useCallback)(
|
|
5157
5159
|
({
|
|
5158
5160
|
model,
|
|
5159
5161
|
args,
|
|
@@ -5179,7 +5181,7 @@ function useViewService() {
|
|
|
5179
5181
|
},
|
|
5180
5182
|
[env]
|
|
5181
5183
|
);
|
|
5182
|
-
const addEntity = (0,
|
|
5184
|
+
const addEntity = (0, import_react11.useCallback)(
|
|
5183
5185
|
({
|
|
5184
5186
|
model,
|
|
5185
5187
|
values,
|
|
@@ -5205,7 +5207,7 @@ function useViewService() {
|
|
|
5205
5207
|
},
|
|
5206
5208
|
[env]
|
|
5207
5209
|
);
|
|
5208
|
-
const getList = (0,
|
|
5210
|
+
const getList = (0, import_react11.useCallback)(
|
|
5209
5211
|
({
|
|
5210
5212
|
model,
|
|
5211
5213
|
domain,
|
|
@@ -5239,7 +5241,7 @@ function useViewService() {
|
|
|
5239
5241
|
},
|
|
5240
5242
|
[env]
|
|
5241
5243
|
);
|
|
5242
|
-
const updateEntity = (0,
|
|
5244
|
+
const updateEntity = (0, import_react11.useCallback)(
|
|
5243
5245
|
({
|
|
5244
5246
|
model,
|
|
5245
5247
|
domain,
|
|
@@ -5267,7 +5269,7 @@ function useViewService() {
|
|
|
5267
5269
|
},
|
|
5268
5270
|
[env]
|
|
5269
5271
|
);
|
|
5270
|
-
const deleteEntity = (0,
|
|
5272
|
+
const deleteEntity = (0, import_react11.useCallback)(
|
|
5271
5273
|
({
|
|
5272
5274
|
model,
|
|
5273
5275
|
ids,
|
|
@@ -5294,7 +5296,7 @@ function useViewService() {
|
|
|
5294
5296
|
},
|
|
5295
5297
|
[env]
|
|
5296
5298
|
);
|
|
5297
|
-
const loadDataPosSession = (0,
|
|
5299
|
+
const loadDataPosSession = (0, import_react11.useCallback)(
|
|
5298
5300
|
({
|
|
5299
5301
|
model,
|
|
5300
5302
|
ids,
|
|
@@ -5332,7 +5334,7 @@ function useViewService() {
|
|
|
5332
5334
|
},
|
|
5333
5335
|
[env]
|
|
5334
5336
|
);
|
|
5335
|
-
const getPreparationDisplayData = (0,
|
|
5337
|
+
const getPreparationDisplayData = (0, import_react11.useCallback)(
|
|
5336
5338
|
({
|
|
5337
5339
|
ids,
|
|
5338
5340
|
xNode,
|
|
@@ -5359,7 +5361,7 @@ function useViewService() {
|
|
|
5359
5361
|
},
|
|
5360
5362
|
[env]
|
|
5361
5363
|
);
|
|
5362
|
-
const manageOnChange = (0,
|
|
5364
|
+
const manageOnChange = (0, import_react11.useCallback)(
|
|
5363
5365
|
({
|
|
5364
5366
|
model,
|
|
5365
5367
|
ids,
|
|
@@ -5387,7 +5389,7 @@ function useViewService() {
|
|
|
5387
5389
|
},
|
|
5388
5390
|
[env]
|
|
5389
5391
|
);
|
|
5390
|
-
const getOrderLine = (0,
|
|
5392
|
+
const getOrderLine = (0, import_react11.useCallback)(
|
|
5391
5393
|
({
|
|
5392
5394
|
model,
|
|
5393
5395
|
ids,
|
|
@@ -5417,7 +5419,7 @@ function useViewService() {
|
|
|
5417
5419
|
},
|
|
5418
5420
|
[env]
|
|
5419
5421
|
);
|
|
5420
|
-
const getProductImage = (0,
|
|
5422
|
+
const getProductImage = (0, import_react11.useCallback)(
|
|
5421
5423
|
({
|
|
5422
5424
|
model,
|
|
5423
5425
|
fields,
|
|
@@ -5450,7 +5452,7 @@ function useViewService() {
|
|
|
5450
5452
|
},
|
|
5451
5453
|
[env]
|
|
5452
5454
|
);
|
|
5453
|
-
const checkPayment = (0,
|
|
5455
|
+
const checkPayment = (0, import_react11.useCallback)(
|
|
5454
5456
|
({
|
|
5455
5457
|
model,
|
|
5456
5458
|
ids,
|
|
@@ -5478,7 +5480,7 @@ function useViewService() {
|
|
|
5478
5480
|
},
|
|
5479
5481
|
[env]
|
|
5480
5482
|
);
|
|
5481
|
-
const handleCloseSession = (0,
|
|
5483
|
+
const handleCloseSession = (0, import_react11.useCallback)(
|
|
5482
5484
|
({
|
|
5483
5485
|
model,
|
|
5484
5486
|
ids,
|
|
@@ -5505,7 +5507,7 @@ function useViewService() {
|
|
|
5505
5507
|
},
|
|
5506
5508
|
[env]
|
|
5507
5509
|
);
|
|
5508
|
-
const handleClosingDetailSession = (0,
|
|
5510
|
+
const handleClosingDetailSession = (0, import_react11.useCallback)(
|
|
5509
5511
|
({
|
|
5510
5512
|
model,
|
|
5511
5513
|
ids,
|
|
@@ -5534,7 +5536,7 @@ function useViewService() {
|
|
|
5534
5536
|
},
|
|
5535
5537
|
[env]
|
|
5536
5538
|
);
|
|
5537
|
-
const createPosConfig = (0,
|
|
5539
|
+
const createPosConfig = (0, import_react11.useCallback)(
|
|
5538
5540
|
({
|
|
5539
5541
|
model,
|
|
5540
5542
|
name,
|
|
@@ -5563,7 +5565,7 @@ function useViewService() {
|
|
|
5563
5565
|
},
|
|
5564
5566
|
[env]
|
|
5565
5567
|
);
|
|
5566
|
-
const searchJournal = (0,
|
|
5568
|
+
const searchJournal = (0, import_react11.useCallback)(
|
|
5567
5569
|
({
|
|
5568
5570
|
model,
|
|
5569
5571
|
method,
|
|
@@ -5592,7 +5594,7 @@ function useViewService() {
|
|
|
5592
5594
|
},
|
|
5593
5595
|
[env]
|
|
5594
5596
|
);
|
|
5595
|
-
const changeOrderPreparaionState = (0,
|
|
5597
|
+
const changeOrderPreparaionState = (0, import_react11.useCallback)(
|
|
5596
5598
|
({
|
|
5597
5599
|
orderId,
|
|
5598
5600
|
stageId,
|
|
@@ -5623,7 +5625,7 @@ function useViewService() {
|
|
|
5623
5625
|
},
|
|
5624
5626
|
[env]
|
|
5625
5627
|
);
|
|
5626
|
-
const updateOrderStatus = (0,
|
|
5628
|
+
const updateOrderStatus = (0, import_react11.useCallback)(
|
|
5627
5629
|
({
|
|
5628
5630
|
orderId,
|
|
5629
5631
|
state,
|
|
@@ -5648,7 +5650,7 @@ function useViewService() {
|
|
|
5648
5650
|
},
|
|
5649
5651
|
[env]
|
|
5650
5652
|
);
|
|
5651
|
-
const processOrder = (0,
|
|
5653
|
+
const processOrder = (0, import_react11.useCallback)(
|
|
5652
5654
|
({
|
|
5653
5655
|
orderId,
|
|
5654
5656
|
xNode,
|
|
@@ -5675,7 +5677,7 @@ function useViewService() {
|
|
|
5675
5677
|
},
|
|
5676
5678
|
[env]
|
|
5677
5679
|
);
|
|
5678
|
-
const generatePaymentQRInfo = (0,
|
|
5680
|
+
const generatePaymentQRInfo = (0, import_react11.useCallback)(
|
|
5679
5681
|
({
|
|
5680
5682
|
orderId,
|
|
5681
5683
|
amount,
|
|
@@ -5702,7 +5704,7 @@ function useViewService() {
|
|
|
5702
5704
|
},
|
|
5703
5705
|
[env]
|
|
5704
5706
|
);
|
|
5705
|
-
const savePinCode = (0,
|
|
5707
|
+
const savePinCode = (0, import_react11.useCallback)(
|
|
5706
5708
|
({
|
|
5707
5709
|
serialNumber,
|
|
5708
5710
|
pinCode,
|
|
@@ -5727,7 +5729,7 @@ function useViewService() {
|
|
|
5727
5729
|
},
|
|
5728
5730
|
[env]
|
|
5729
5731
|
);
|
|
5730
|
-
const getPinCode = (0,
|
|
5732
|
+
const getPinCode = (0, import_react11.useCallback)(
|
|
5731
5733
|
({
|
|
5732
5734
|
serialNumber,
|
|
5733
5735
|
xNode,
|
|
@@ -5750,7 +5752,7 @@ function useViewService() {
|
|
|
5750
5752
|
},
|
|
5751
5753
|
[env]
|
|
5752
5754
|
);
|
|
5753
|
-
const getNotifications = (0,
|
|
5755
|
+
const getNotifications = (0, import_react11.useCallback)(
|
|
5754
5756
|
async ({
|
|
5755
5757
|
service,
|
|
5756
5758
|
xNode,
|
|
@@ -5818,10 +5820,10 @@ function useViewService() {
|
|
|
5818
5820
|
}
|
|
5819
5821
|
|
|
5820
5822
|
// src/services/dashboard-service/index.ts
|
|
5821
|
-
var
|
|
5823
|
+
var import_react12 = require("react");
|
|
5822
5824
|
function useDashboardService() {
|
|
5823
5825
|
const { env } = useEnv();
|
|
5824
|
-
const readGroup = (0,
|
|
5826
|
+
const readGroup = (0, import_react12.useCallback)(
|
|
5825
5827
|
async ({
|
|
5826
5828
|
service,
|
|
5827
5829
|
xNode,
|
|
@@ -5838,7 +5840,7 @@ function useDashboardService() {
|
|
|
5838
5840
|
},
|
|
5839
5841
|
[env]
|
|
5840
5842
|
);
|
|
5841
|
-
const getDataChart = (0,
|
|
5843
|
+
const getDataChart = (0, import_react12.useCallback)(
|
|
5842
5844
|
async ({
|
|
5843
5845
|
service,
|
|
5844
5846
|
xNode,
|
|
@@ -5877,9 +5879,9 @@ function useDashboardService() {
|
|
|
5877
5879
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
5878
5880
|
var VersionGate = ({ children }) => {
|
|
5879
5881
|
const queryClient = (0, import_react_query2.useQueryClient)();
|
|
5880
|
-
const [ready, setReady] = (0,
|
|
5882
|
+
const [ready, setReady] = (0, import_react13.useState)(false);
|
|
5881
5883
|
const { getVersion } = useViewService();
|
|
5882
|
-
(0,
|
|
5884
|
+
(0, import_react13.useEffect)(() => {
|
|
5883
5885
|
const clearVersion = () => {
|
|
5884
5886
|
queryClient.clear();
|
|
5885
5887
|
localStorage.removeItem("__api_version__");
|
|
@@ -5910,7 +5912,7 @@ var VersionGate = ({ children }) => {
|
|
|
5910
5912
|
};
|
|
5911
5913
|
|
|
5912
5914
|
// src/provider/env-provider.tsx
|
|
5913
|
-
var
|
|
5915
|
+
var import_react14 = require("react");
|
|
5914
5916
|
|
|
5915
5917
|
// src/configs/axios-client.ts
|
|
5916
5918
|
var import_axios = __toESM(require("axios"));
|
|
@@ -6255,18 +6257,18 @@ var initialEnvState = {
|
|
|
6255
6257
|
tz: "Asia/Saigon"
|
|
6256
6258
|
}
|
|
6257
6259
|
};
|
|
6258
|
-
var EnvContext = (0,
|
|
6260
|
+
var EnvContext = (0, import_react14.createContext)(null);
|
|
6259
6261
|
function EnvProvider({
|
|
6260
6262
|
children,
|
|
6261
6263
|
localStorageUtils: localStorageUtil = localStorageUtils(),
|
|
6262
6264
|
sessionStorageUtils: sessionStorageUtil = sessionStorageUtils
|
|
6263
6265
|
}) {
|
|
6264
|
-
const [env, setEnvState] = (0,
|
|
6266
|
+
const [env, setEnvState] = (0, import_react14.useState)({
|
|
6265
6267
|
...initialEnvState,
|
|
6266
6268
|
localStorageUtils: localStorageUtil,
|
|
6267
6269
|
sessionStorageUtils: sessionStorageUtil
|
|
6268
6270
|
});
|
|
6269
|
-
const setupEnv = (0,
|
|
6271
|
+
const setupEnv = (0, import_react14.useCallback)(
|
|
6270
6272
|
(envConfig) => {
|
|
6271
6273
|
const updatedEnv = {
|
|
6272
6274
|
...env,
|
|
@@ -6280,31 +6282,31 @@ function EnvProvider({
|
|
|
6280
6282
|
},
|
|
6281
6283
|
[env, localStorageUtil, sessionStorageUtil]
|
|
6282
6284
|
);
|
|
6283
|
-
const setUid2 = (0,
|
|
6285
|
+
const setUid2 = (0, import_react14.useCallback)((uid) => {
|
|
6284
6286
|
setEnvState((prev) => ({
|
|
6285
6287
|
...prev,
|
|
6286
6288
|
context: { ...prev.context, uid }
|
|
6287
6289
|
}));
|
|
6288
6290
|
}, []);
|
|
6289
|
-
const setLang2 = (0,
|
|
6291
|
+
const setLang2 = (0, import_react14.useCallback)((lang) => {
|
|
6290
6292
|
setEnvState((prev) => ({
|
|
6291
6293
|
...prev,
|
|
6292
6294
|
context: { ...prev.context, lang }
|
|
6293
6295
|
}));
|
|
6294
6296
|
}, []);
|
|
6295
|
-
const setAllowCompanies2 = (0,
|
|
6297
|
+
const setAllowCompanies2 = (0, import_react14.useCallback)((allowed_company_ids) => {
|
|
6296
6298
|
setEnvState((prev) => ({
|
|
6297
6299
|
...prev,
|
|
6298
6300
|
context: { ...prev.context, allowed_company_ids }
|
|
6299
6301
|
}));
|
|
6300
6302
|
}, []);
|
|
6301
|
-
const setCompanies2 = (0,
|
|
6303
|
+
const setCompanies2 = (0, import_react14.useCallback)((companies) => {
|
|
6302
6304
|
setEnvState((prev) => ({
|
|
6303
6305
|
...prev,
|
|
6304
6306
|
companies
|
|
6305
6307
|
}));
|
|
6306
6308
|
}, []);
|
|
6307
|
-
const setDefaultCompany2 = (0,
|
|
6309
|
+
const setDefaultCompany2 = (0, import_react14.useCallback)(
|
|
6308
6310
|
(defaultCompany) => {
|
|
6309
6311
|
setEnvState((prev) => ({
|
|
6310
6312
|
...prev,
|
|
@@ -6313,19 +6315,19 @@ function EnvProvider({
|
|
|
6313
6315
|
},
|
|
6314
6316
|
[]
|
|
6315
6317
|
);
|
|
6316
|
-
const setUserInfo = (0,
|
|
6318
|
+
const setUserInfo = (0, import_react14.useCallback)((user) => {
|
|
6317
6319
|
setEnvState((prev) => ({
|
|
6318
6320
|
...prev,
|
|
6319
6321
|
user
|
|
6320
6322
|
}));
|
|
6321
6323
|
}, []);
|
|
6322
|
-
const setConfig2 = (0,
|
|
6324
|
+
const setConfig2 = (0, import_react14.useCallback)((config) => {
|
|
6323
6325
|
setEnvState((prev) => ({
|
|
6324
6326
|
...prev,
|
|
6325
6327
|
config
|
|
6326
6328
|
}));
|
|
6327
6329
|
}, []);
|
|
6328
|
-
const setEnvFile2 = (0,
|
|
6330
|
+
const setEnvFile2 = (0, import_react14.useCallback)((envFile) => {
|
|
6329
6331
|
setEnvState((prev) => ({
|
|
6330
6332
|
...prev,
|
|
6331
6333
|
envFile
|
|
@@ -6351,7 +6353,7 @@ function EnvProvider({
|
|
|
6351
6353
|
);
|
|
6352
6354
|
}
|
|
6353
6355
|
function useEnv() {
|
|
6354
|
-
const context = (0,
|
|
6356
|
+
const context = (0, import_react14.useContext)(EnvContext);
|
|
6355
6357
|
if (!context) {
|
|
6356
6358
|
throw new Error("useEnv must be used within an EnvProvider");
|
|
6357
6359
|
}
|
|
@@ -6359,7 +6361,7 @@ function useEnv() {
|
|
|
6359
6361
|
}
|
|
6360
6362
|
|
|
6361
6363
|
// src/provider/service-provider.tsx
|
|
6362
|
-
var
|
|
6364
|
+
var import_react16 = require("react");
|
|
6363
6365
|
|
|
6364
6366
|
// src/hooks/auth/use-forgot-password.ts
|
|
6365
6367
|
var import_react_query3 = require("@tanstack/react-query");
|
|
@@ -7228,9 +7230,9 @@ var BaseModel = class {
|
|
|
7228
7230
|
};
|
|
7229
7231
|
|
|
7230
7232
|
// src/hooks/model/use-model.ts
|
|
7231
|
-
var
|
|
7233
|
+
var import_react15 = require("react");
|
|
7232
7234
|
var useModel = () => {
|
|
7233
|
-
const initModel = (0,
|
|
7235
|
+
const initModel = (0, import_react15.useCallback)((modelData) => {
|
|
7234
7236
|
switch (modelData?.name) {
|
|
7235
7237
|
default:
|
|
7236
7238
|
return new BaseModel(modelData);
|
|
@@ -8611,7 +8613,7 @@ var use_get_data_chart_default = useGetDataChart;
|
|
|
8611
8613
|
|
|
8612
8614
|
// src/provider/service-provider.tsx
|
|
8613
8615
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
8614
|
-
var ServiceContext = (0,
|
|
8616
|
+
var ServiceContext = (0, import_react16.createContext)(null);
|
|
8615
8617
|
var ServiceProvider = ({
|
|
8616
8618
|
children
|
|
8617
8619
|
}) => {
|
|
@@ -8726,7 +8728,7 @@ var ServiceProvider = ({
|
|
|
8726
8728
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ServiceContext.Provider, { value: services, children });
|
|
8727
8729
|
};
|
|
8728
8730
|
var useService = () => {
|
|
8729
|
-
const context = (0,
|
|
8731
|
+
const context = (0, import_react16.useContext)(ServiceContext);
|
|
8730
8732
|
if (!context) {
|
|
8731
8733
|
throw new Error("useService must be used within a ServiceProvider");
|
|
8732
8734
|
}
|
|
@@ -8734,7 +8736,7 @@ var useService = () => {
|
|
|
8734
8736
|
};
|
|
8735
8737
|
|
|
8736
8738
|
// src/provider/meta-provider.tsx
|
|
8737
|
-
var
|
|
8739
|
+
var import_react17 = require("react");
|
|
8738
8740
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
8739
8741
|
var MetaProvider = ({ children }) => {
|
|
8740
8742
|
const { env } = useEnv();
|
|
@@ -8783,7 +8785,7 @@ var MetaProvider = ({ children }) => {
|
|
|
8783
8785
|
}
|
|
8784
8786
|
}
|
|
8785
8787
|
}
|
|
8786
|
-
(0,
|
|
8788
|
+
(0, import_react17.useEffect)(() => {
|
|
8787
8789
|
updateMetadata();
|
|
8788
8790
|
}, [env?.defaultCompany]);
|
|
8789
8791
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children });
|