@fctc/interface-logic 4.4.1 → 4.4.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/hooks.js +37 -10
- package/dist/hooks.mjs +37 -10
- package/dist/provider.js +188 -152
- package/dist/provider.mjs +66 -30
- package/dist/services.d.mts +21 -0
- package/dist/services.d.ts +21 -0
- package/dist/services.js +29 -9
- package/dist/services.mjs +29 -9
- package/package.json +1 -1
package/dist/provider.js
CHANGED
|
@@ -3268,10 +3268,42 @@ function useActionService() {
|
|
|
3268
3268
|
}
|
|
3269
3269
|
|
|
3270
3270
|
// src/services/auth-service/index.ts
|
|
3271
|
+
var import_react5 = require("react");
|
|
3272
|
+
|
|
3273
|
+
// src/provider/supabase-provider.tsx
|
|
3271
3274
|
var import_react4 = require("react");
|
|
3275
|
+
var import_supabase_js = require("@supabase/supabase-js");
|
|
3276
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
3277
|
+
var SupabaseContext = (0, import_react4.createContext)(null);
|
|
3278
|
+
var SupabaseProvider = ({
|
|
3279
|
+
supabaseUrl,
|
|
3280
|
+
supabaseKey,
|
|
3281
|
+
children
|
|
3282
|
+
}) => {
|
|
3283
|
+
const supabase = (0, import_react4.useMemo)(() => {
|
|
3284
|
+
if (!supabaseUrl || !supabaseKey) return null;
|
|
3285
|
+
return (0, import_supabase_js.createClient)(supabaseUrl, supabaseKey);
|
|
3286
|
+
}, [supabaseUrl, supabaseKey]);
|
|
3287
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SupabaseContext.Provider, { value: supabase, children });
|
|
3288
|
+
};
|
|
3289
|
+
var useSupabase = () => {
|
|
3290
|
+
const context = (0, import_react4.useContext)(SupabaseContext);
|
|
3291
|
+
if (!context) {
|
|
3292
|
+
throw new Error(
|
|
3293
|
+
"useSupabase must be used within a SupabaseProvider or check your env config"
|
|
3294
|
+
);
|
|
3295
|
+
}
|
|
3296
|
+
return context;
|
|
3297
|
+
};
|
|
3298
|
+
var useSupabaseOptional = () => {
|
|
3299
|
+
return (0, import_react4.useContext)(SupabaseContext);
|
|
3300
|
+
};
|
|
3301
|
+
|
|
3302
|
+
// src/services/auth-service/index.ts
|
|
3272
3303
|
function useAuthService() {
|
|
3273
3304
|
const { env } = useEnv();
|
|
3274
|
-
const
|
|
3305
|
+
const supabase = useSupabaseOptional();
|
|
3306
|
+
const login = (0, import_react5.useCallback)(
|
|
3275
3307
|
async (body) => {
|
|
3276
3308
|
const payload = Object.fromEntries(
|
|
3277
3309
|
Object.entries({
|
|
@@ -3296,7 +3328,23 @@ function useAuthService() {
|
|
|
3296
3328
|
},
|
|
3297
3329
|
[env]
|
|
3298
3330
|
);
|
|
3299
|
-
const
|
|
3331
|
+
const loginSupabase = (0, import_react5.useCallback)(
|
|
3332
|
+
async (body) => {
|
|
3333
|
+
if (!supabase) {
|
|
3334
|
+
return {
|
|
3335
|
+
data: null,
|
|
3336
|
+
error: { message: "Supabase client is not initialized" }
|
|
3337
|
+
};
|
|
3338
|
+
}
|
|
3339
|
+
const { data, error } = await supabase.auth.signInWithPassword({
|
|
3340
|
+
email: body.email,
|
|
3341
|
+
password: body.password
|
|
3342
|
+
});
|
|
3343
|
+
return { data, error };
|
|
3344
|
+
},
|
|
3345
|
+
[supabase]
|
|
3346
|
+
);
|
|
3347
|
+
const forgotPassword = (0, import_react5.useCallback)(
|
|
3300
3348
|
async (email) => {
|
|
3301
3349
|
const bodyData = {
|
|
3302
3350
|
login: email,
|
|
@@ -3310,7 +3358,7 @@ function useAuthService() {
|
|
|
3310
3358
|
},
|
|
3311
3359
|
[env]
|
|
3312
3360
|
);
|
|
3313
|
-
const forgotPasswordSSO = (0,
|
|
3361
|
+
const forgotPasswordSSO = (0, import_react5.useCallback)(
|
|
3314
3362
|
async ({
|
|
3315
3363
|
email,
|
|
3316
3364
|
with_context,
|
|
@@ -3333,7 +3381,7 @@ function useAuthService() {
|
|
|
3333
3381
|
},
|
|
3334
3382
|
[env]
|
|
3335
3383
|
);
|
|
3336
|
-
const resetPassword = (0,
|
|
3384
|
+
const resetPassword = (0, import_react5.useCallback)(
|
|
3337
3385
|
async (data, token) => {
|
|
3338
3386
|
const bodyData = {
|
|
3339
3387
|
token,
|
|
@@ -3348,7 +3396,7 @@ function useAuthService() {
|
|
|
3348
3396
|
},
|
|
3349
3397
|
[env]
|
|
3350
3398
|
);
|
|
3351
|
-
const resetPasswordSSO = (0,
|
|
3399
|
+
const resetPasswordSSO = (0, import_react5.useCallback)(
|
|
3352
3400
|
async ({
|
|
3353
3401
|
method,
|
|
3354
3402
|
password,
|
|
@@ -3371,7 +3419,7 @@ function useAuthService() {
|
|
|
3371
3419
|
},
|
|
3372
3420
|
[env]
|
|
3373
3421
|
);
|
|
3374
|
-
const updatePassword = (0,
|
|
3422
|
+
const updatePassword = (0, import_react5.useCallback)(
|
|
3375
3423
|
async (data, token) => {
|
|
3376
3424
|
const bodyData = {
|
|
3377
3425
|
token,
|
|
@@ -3386,7 +3434,7 @@ function useAuthService() {
|
|
|
3386
3434
|
},
|
|
3387
3435
|
[env]
|
|
3388
3436
|
);
|
|
3389
|
-
const isValidToken = (0,
|
|
3437
|
+
const isValidToken = (0, import_react5.useCallback)(
|
|
3390
3438
|
async (token) => {
|
|
3391
3439
|
const bodyData = {
|
|
3392
3440
|
token
|
|
@@ -3399,7 +3447,7 @@ function useAuthService() {
|
|
|
3399
3447
|
},
|
|
3400
3448
|
[env]
|
|
3401
3449
|
);
|
|
3402
|
-
const isValidActionToken = (0,
|
|
3450
|
+
const isValidActionToken = (0, import_react5.useCallback)(
|
|
3403
3451
|
async (actionToken) => {
|
|
3404
3452
|
const bodyData = {};
|
|
3405
3453
|
return env?.requests?.post("/action-token/validate" /* VALIDATE_ACTION_TOKEN */, bodyData, {
|
|
@@ -3412,7 +3460,7 @@ function useAuthService() {
|
|
|
3412
3460
|
},
|
|
3413
3461
|
[env]
|
|
3414
3462
|
);
|
|
3415
|
-
const loginSocial = (0,
|
|
3463
|
+
const loginSocial = (0, import_react5.useCallback)(
|
|
3416
3464
|
async ({
|
|
3417
3465
|
db,
|
|
3418
3466
|
state,
|
|
@@ -3430,13 +3478,13 @@ function useAuthService() {
|
|
|
3430
3478
|
},
|
|
3431
3479
|
[env]
|
|
3432
3480
|
);
|
|
3433
|
-
const getProviders = (0,
|
|
3481
|
+
const getProviders = (0, import_react5.useCallback)(
|
|
3434
3482
|
async (db) => {
|
|
3435
3483
|
return env?.requests?.get("/oauth/providers", { params: { db } });
|
|
3436
3484
|
},
|
|
3437
3485
|
[env]
|
|
3438
3486
|
);
|
|
3439
|
-
const getAccessByCode = (0,
|
|
3487
|
+
const getAccessByCode = (0, import_react5.useCallback)(
|
|
3440
3488
|
async (code) => {
|
|
3441
3489
|
const data = new URLSearchParams();
|
|
3442
3490
|
data.append("code", code);
|
|
@@ -3456,7 +3504,7 @@ function useAuthService() {
|
|
|
3456
3504
|
},
|
|
3457
3505
|
[env]
|
|
3458
3506
|
);
|
|
3459
|
-
const logout = (0,
|
|
3507
|
+
const logout = (0, import_react5.useCallback)(
|
|
3460
3508
|
async (service) => {
|
|
3461
3509
|
return env?.requests?.post(
|
|
3462
3510
|
"/logout" /* LOGOUT */,
|
|
@@ -3473,7 +3521,7 @@ function useAuthService() {
|
|
|
3473
3521
|
},
|
|
3474
3522
|
[env]
|
|
3475
3523
|
);
|
|
3476
|
-
const getTenantMapping = (0,
|
|
3524
|
+
const getTenantMapping = (0, import_react5.useCallback)(
|
|
3477
3525
|
async ({ shortName, service }) => {
|
|
3478
3526
|
const bodyData = {
|
|
3479
3527
|
short_name: shortName
|
|
@@ -3491,7 +3539,7 @@ function useAuthService() {
|
|
|
3491
3539
|
},
|
|
3492
3540
|
[env]
|
|
3493
3541
|
);
|
|
3494
|
-
const getToken = (0,
|
|
3542
|
+
const getToken = (0, import_react5.useCallback)(
|
|
3495
3543
|
async ({
|
|
3496
3544
|
phone,
|
|
3497
3545
|
name,
|
|
@@ -3518,6 +3566,7 @@ function useAuthService() {
|
|
|
3518
3566
|
);
|
|
3519
3567
|
return {
|
|
3520
3568
|
login,
|
|
3569
|
+
loginSupabase,
|
|
3521
3570
|
forgotPassword,
|
|
3522
3571
|
forgotPasswordSSO,
|
|
3523
3572
|
resetPassword,
|
|
@@ -3535,10 +3584,10 @@ function useAuthService() {
|
|
|
3535
3584
|
}
|
|
3536
3585
|
|
|
3537
3586
|
// src/services/company-service/index.ts
|
|
3538
|
-
var
|
|
3587
|
+
var import_react6 = require("react");
|
|
3539
3588
|
function useCompanyService() {
|
|
3540
3589
|
const { env } = useEnv();
|
|
3541
|
-
const getCurrentCompany = (0,
|
|
3590
|
+
const getCurrentCompany = (0, import_react6.useCallback)(
|
|
3542
3591
|
async (service, extraHeaders) => {
|
|
3543
3592
|
return await env.requests.get(
|
|
3544
3593
|
"/company" /* COMPANY_PATH */,
|
|
@@ -3555,7 +3604,7 @@ function useCompanyService() {
|
|
|
3555
3604
|
},
|
|
3556
3605
|
[env]
|
|
3557
3606
|
);
|
|
3558
|
-
const getInfoCompany = (0,
|
|
3607
|
+
const getInfoCompany = (0, import_react6.useCallback)(
|
|
3559
3608
|
async (id, service) => {
|
|
3560
3609
|
const jsonData = {
|
|
3561
3610
|
ids: [id],
|
|
@@ -3591,10 +3640,10 @@ function useCompanyService() {
|
|
|
3591
3640
|
}
|
|
3592
3641
|
|
|
3593
3642
|
// src/services/excel-service/index.ts
|
|
3594
|
-
var
|
|
3643
|
+
var import_react7 = require("react");
|
|
3595
3644
|
function useExcelService() {
|
|
3596
3645
|
const { env } = useEnv();
|
|
3597
|
-
const uploadFileExcel = (0,
|
|
3646
|
+
const uploadFileExcel = (0, import_react7.useCallback)(
|
|
3598
3647
|
async ({
|
|
3599
3648
|
formData,
|
|
3600
3649
|
service,
|
|
@@ -3611,7 +3660,7 @@ function useExcelService() {
|
|
|
3611
3660
|
},
|
|
3612
3661
|
[env]
|
|
3613
3662
|
);
|
|
3614
|
-
const uploadIdFile = (0,
|
|
3663
|
+
const uploadIdFile = (0, import_react7.useCallback)(
|
|
3615
3664
|
async ({
|
|
3616
3665
|
formData,
|
|
3617
3666
|
service,
|
|
@@ -3628,7 +3677,7 @@ function useExcelService() {
|
|
|
3628
3677
|
},
|
|
3629
3678
|
[env]
|
|
3630
3679
|
);
|
|
3631
|
-
const parsePreview = (0,
|
|
3680
|
+
const parsePreview = (0, import_react7.useCallback)(
|
|
3632
3681
|
async ({
|
|
3633
3682
|
id,
|
|
3634
3683
|
selectedSheet,
|
|
@@ -3677,7 +3726,7 @@ function useExcelService() {
|
|
|
3677
3726
|
},
|
|
3678
3727
|
[env]
|
|
3679
3728
|
);
|
|
3680
|
-
const executeImport = (0,
|
|
3729
|
+
const executeImport = (0, import_react7.useCallback)(
|
|
3681
3730
|
async ({
|
|
3682
3731
|
columns,
|
|
3683
3732
|
fields,
|
|
@@ -3711,7 +3760,7 @@ function useExcelService() {
|
|
|
3711
3760
|
},
|
|
3712
3761
|
[env]
|
|
3713
3762
|
);
|
|
3714
|
-
const getFileExcel = (0,
|
|
3763
|
+
const getFileExcel = (0, import_react7.useCallback)(
|
|
3715
3764
|
async ({
|
|
3716
3765
|
model,
|
|
3717
3766
|
service,
|
|
@@ -3735,7 +3784,7 @@ function useExcelService() {
|
|
|
3735
3784
|
},
|
|
3736
3785
|
[env]
|
|
3737
3786
|
);
|
|
3738
|
-
const getFieldExport = (0,
|
|
3787
|
+
const getFieldExport = (0, import_react7.useCallback)(
|
|
3739
3788
|
async ({
|
|
3740
3789
|
ids,
|
|
3741
3790
|
model,
|
|
@@ -3775,7 +3824,7 @@ function useExcelService() {
|
|
|
3775
3824
|
},
|
|
3776
3825
|
[env]
|
|
3777
3826
|
);
|
|
3778
|
-
const exportExcel = (0,
|
|
3827
|
+
const exportExcel = (0, import_react7.useCallback)(
|
|
3779
3828
|
async ({
|
|
3780
3829
|
model,
|
|
3781
3830
|
domain,
|
|
@@ -3823,10 +3872,10 @@ function useExcelService() {
|
|
|
3823
3872
|
}
|
|
3824
3873
|
|
|
3825
3874
|
// src/services/form-service/index.ts
|
|
3826
|
-
var
|
|
3875
|
+
var import_react8 = require("react");
|
|
3827
3876
|
function useFormService() {
|
|
3828
3877
|
const { env } = useEnv();
|
|
3829
|
-
const getComment = (0,
|
|
3878
|
+
const getComment = (0, import_react8.useCallback)(
|
|
3830
3879
|
async ({ data }) => {
|
|
3831
3880
|
const jsonData = {
|
|
3832
3881
|
thread_id: data.thread_id,
|
|
@@ -3844,7 +3893,7 @@ function useFormService() {
|
|
|
3844
3893
|
},
|
|
3845
3894
|
[env]
|
|
3846
3895
|
);
|
|
3847
|
-
const getThreadData = (0,
|
|
3896
|
+
const getThreadData = (0, import_react8.useCallback)(
|
|
3848
3897
|
async ({
|
|
3849
3898
|
data,
|
|
3850
3899
|
xNode,
|
|
@@ -3871,7 +3920,7 @@ function useFormService() {
|
|
|
3871
3920
|
},
|
|
3872
3921
|
[env]
|
|
3873
3922
|
);
|
|
3874
|
-
const getThreadMessages = (0,
|
|
3923
|
+
const getThreadMessages = (0, import_react8.useCallback)(
|
|
3875
3924
|
async ({
|
|
3876
3925
|
data,
|
|
3877
3926
|
xNode,
|
|
@@ -3897,7 +3946,7 @@ function useFormService() {
|
|
|
3897
3946
|
},
|
|
3898
3947
|
[env]
|
|
3899
3948
|
);
|
|
3900
|
-
const sentComment = (0,
|
|
3949
|
+
const sentComment = (0, import_react8.useCallback)(
|
|
3901
3950
|
async ({ data }) => {
|
|
3902
3951
|
const jsonData = {
|
|
3903
3952
|
context: {
|
|
@@ -3925,7 +3974,7 @@ function useFormService() {
|
|
|
3925
3974
|
},
|
|
3926
3975
|
[env]
|
|
3927
3976
|
);
|
|
3928
|
-
const deleteComment = (0,
|
|
3977
|
+
const deleteComment = (0, import_react8.useCallback)(
|
|
3929
3978
|
async ({ data }) => {
|
|
3930
3979
|
const jsonData = {
|
|
3931
3980
|
attachment_ids: [],
|
|
@@ -3941,7 +3990,7 @@ function useFormService() {
|
|
|
3941
3990
|
},
|
|
3942
3991
|
[env]
|
|
3943
3992
|
);
|
|
3944
|
-
const getImage = (0,
|
|
3993
|
+
const getImage = (0, import_react8.useCallback)(
|
|
3945
3994
|
async ({ data }) => {
|
|
3946
3995
|
return env.requests.get(
|
|
3947
3996
|
`${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
|
|
@@ -3954,7 +4003,7 @@ function useFormService() {
|
|
|
3954
4003
|
},
|
|
3955
4004
|
[env]
|
|
3956
4005
|
);
|
|
3957
|
-
const uploadImage = (0,
|
|
4006
|
+
const uploadImage = (0, import_react8.useCallback)(
|
|
3958
4007
|
async ({
|
|
3959
4008
|
formData,
|
|
3960
4009
|
service,
|
|
@@ -3973,7 +4022,7 @@ function useFormService() {
|
|
|
3973
4022
|
},
|
|
3974
4023
|
[env]
|
|
3975
4024
|
);
|
|
3976
|
-
const uploadFile = (0,
|
|
4025
|
+
const uploadFile = (0, import_react8.useCallback)(
|
|
3977
4026
|
async ({
|
|
3978
4027
|
formData,
|
|
3979
4028
|
service,
|
|
@@ -3993,7 +4042,7 @@ function useFormService() {
|
|
|
3993
4042
|
},
|
|
3994
4043
|
[env]
|
|
3995
4044
|
);
|
|
3996
|
-
const getFormView = (0,
|
|
4045
|
+
const getFormView = (0, import_react8.useCallback)(
|
|
3997
4046
|
async ({ data }) => {
|
|
3998
4047
|
const jsonData = {
|
|
3999
4048
|
model: data.model,
|
|
@@ -4009,7 +4058,7 @@ function useFormService() {
|
|
|
4009
4058
|
},
|
|
4010
4059
|
[env]
|
|
4011
4060
|
);
|
|
4012
|
-
const changeStatus = (0,
|
|
4061
|
+
const changeStatus = (0, import_react8.useCallback)(
|
|
4013
4062
|
async ({ data }) => {
|
|
4014
4063
|
const vals = {
|
|
4015
4064
|
[data.name]: data.stage_id
|
|
@@ -4038,7 +4087,7 @@ function useFormService() {
|
|
|
4038
4087
|
},
|
|
4039
4088
|
[env]
|
|
4040
4089
|
);
|
|
4041
|
-
const getExternalTab = (0,
|
|
4090
|
+
const getExternalTab = (0, import_react8.useCallback)(
|
|
4042
4091
|
async ({ method, context, service, xNode }) => {
|
|
4043
4092
|
return env?.requests?.post(
|
|
4044
4093
|
"/call" /* CALL_PATH */,
|
|
@@ -4073,10 +4122,10 @@ function useFormService() {
|
|
|
4073
4122
|
}
|
|
4074
4123
|
|
|
4075
4124
|
// src/services/kanban-service/index.ts
|
|
4076
|
-
var
|
|
4125
|
+
var import_react9 = require("react");
|
|
4077
4126
|
function useKanbanService() {
|
|
4078
4127
|
const { env } = useEnv();
|
|
4079
|
-
const getGroups = (0,
|
|
4128
|
+
const getGroups = (0, import_react9.useCallback)(
|
|
4080
4129
|
async ({ model, width_context }) => {
|
|
4081
4130
|
const jsonData = {
|
|
4082
4131
|
model,
|
|
@@ -4096,7 +4145,7 @@ function useKanbanService() {
|
|
|
4096
4145
|
},
|
|
4097
4146
|
[env]
|
|
4098
4147
|
);
|
|
4099
|
-
const getProgressBar = (0,
|
|
4148
|
+
const getProgressBar = (0, import_react9.useCallback)(
|
|
4100
4149
|
async ({ field, color, model, width_context }) => {
|
|
4101
4150
|
const jsonData = {
|
|
4102
4151
|
model,
|
|
@@ -4126,10 +4175,10 @@ function useKanbanService() {
|
|
|
4126
4175
|
}
|
|
4127
4176
|
|
|
4128
4177
|
// src/services/model-service/index.ts
|
|
4129
|
-
var
|
|
4178
|
+
var import_react10 = require("react");
|
|
4130
4179
|
function useModelService() {
|
|
4131
4180
|
const { env } = useEnv();
|
|
4132
|
-
const getListMyBankAccount = (0,
|
|
4181
|
+
const getListMyBankAccount = (0, import_react10.useCallback)(
|
|
4133
4182
|
async ({
|
|
4134
4183
|
domain,
|
|
4135
4184
|
spectification,
|
|
@@ -4153,7 +4202,7 @@ function useModelService() {
|
|
|
4153
4202
|
},
|
|
4154
4203
|
[env]
|
|
4155
4204
|
);
|
|
4156
|
-
const getCurrency = (0,
|
|
4205
|
+
const getCurrency = (0, import_react10.useCallback)(async () => {
|
|
4157
4206
|
const jsonData = {
|
|
4158
4207
|
model: "res.currency",
|
|
4159
4208
|
method: "web_search_read",
|
|
@@ -4173,7 +4222,7 @@ function useModelService() {
|
|
|
4173
4222
|
}
|
|
4174
4223
|
});
|
|
4175
4224
|
}, [env]);
|
|
4176
|
-
const getConversionRate = (0,
|
|
4225
|
+
const getConversionRate = (0, import_react10.useCallback)(async () => {
|
|
4177
4226
|
const jsonData = {
|
|
4178
4227
|
model: "res.currency",
|
|
4179
4228
|
method: "web_search_read",
|
|
@@ -4199,7 +4248,7 @@ function useModelService() {
|
|
|
4199
4248
|
}
|
|
4200
4249
|
});
|
|
4201
4250
|
}, [env]);
|
|
4202
|
-
const getAll = (0,
|
|
4251
|
+
const getAll = (0, import_react10.useCallback)(
|
|
4203
4252
|
async ({
|
|
4204
4253
|
data,
|
|
4205
4254
|
service,
|
|
@@ -4241,7 +4290,7 @@ function useModelService() {
|
|
|
4241
4290
|
},
|
|
4242
4291
|
[env]
|
|
4243
4292
|
);
|
|
4244
|
-
const getListCalendar = (0,
|
|
4293
|
+
const getListCalendar = (0, import_react10.useCallback)(
|
|
4245
4294
|
async ({ data }) => {
|
|
4246
4295
|
const jsonReadGroup = data.type == "calendar" ? data?.fields : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
4247
4296
|
fields: data.fields,
|
|
@@ -4272,7 +4321,7 @@ function useModelService() {
|
|
|
4272
4321
|
},
|
|
4273
4322
|
[env]
|
|
4274
4323
|
);
|
|
4275
|
-
const getList = (0,
|
|
4324
|
+
const getList = (0, import_react10.useCallback)(
|
|
4276
4325
|
async ({
|
|
4277
4326
|
model,
|
|
4278
4327
|
ids = [],
|
|
@@ -4304,7 +4353,7 @@ function useModelService() {
|
|
|
4304
4353
|
},
|
|
4305
4354
|
[env]
|
|
4306
4355
|
);
|
|
4307
|
-
const getDetail = (0,
|
|
4356
|
+
const getDetail = (0, import_react10.useCallback)(
|
|
4308
4357
|
async ({
|
|
4309
4358
|
ids = [],
|
|
4310
4359
|
model,
|
|
@@ -4336,7 +4385,7 @@ function useModelService() {
|
|
|
4336
4385
|
},
|
|
4337
4386
|
[env]
|
|
4338
4387
|
);
|
|
4339
|
-
const save = (0,
|
|
4388
|
+
const save = (0, import_react10.useCallback)(
|
|
4340
4389
|
async ({
|
|
4341
4390
|
model,
|
|
4342
4391
|
ids = [],
|
|
@@ -4371,7 +4420,7 @@ function useModelService() {
|
|
|
4371
4420
|
},
|
|
4372
4421
|
[env]
|
|
4373
4422
|
);
|
|
4374
|
-
const deleteApi = (0,
|
|
4423
|
+
const deleteApi = (0, import_react10.useCallback)(
|
|
4375
4424
|
async ({ ids = [], model, service }) => {
|
|
4376
4425
|
const jsonData = {
|
|
4377
4426
|
model,
|
|
@@ -4391,7 +4440,7 @@ function useModelService() {
|
|
|
4391
4440
|
},
|
|
4392
4441
|
[env]
|
|
4393
4442
|
);
|
|
4394
|
-
const onChange = (0,
|
|
4443
|
+
const onChange = (0, import_react10.useCallback)(
|
|
4395
4444
|
async ({
|
|
4396
4445
|
ids = [],
|
|
4397
4446
|
model,
|
|
@@ -4427,7 +4476,7 @@ function useModelService() {
|
|
|
4427
4476
|
},
|
|
4428
4477
|
[env]
|
|
4429
4478
|
);
|
|
4430
|
-
const getListFieldsOnchange = (0,
|
|
4479
|
+
const getListFieldsOnchange = (0, import_react10.useCallback)(
|
|
4431
4480
|
async ({
|
|
4432
4481
|
model,
|
|
4433
4482
|
service,
|
|
@@ -4451,7 +4500,7 @@ function useModelService() {
|
|
|
4451
4500
|
},
|
|
4452
4501
|
[env]
|
|
4453
4502
|
);
|
|
4454
|
-
const parseORMOdoo = (0,
|
|
4503
|
+
const parseORMOdoo = (0, import_react10.useCallback)((data) => {
|
|
4455
4504
|
for (const key in data) {
|
|
4456
4505
|
if (key === "display_name") {
|
|
4457
4506
|
delete data[key];
|
|
@@ -4462,7 +4511,7 @@ function useModelService() {
|
|
|
4462
4511
|
}
|
|
4463
4512
|
return { ...data };
|
|
4464
4513
|
}, []);
|
|
4465
|
-
const toDataJS = (0,
|
|
4514
|
+
const toDataJS = (0, import_react10.useCallback)(
|
|
4466
4515
|
(data, viewData, model) => {
|
|
4467
4516
|
for (const key in data) {
|
|
4468
4517
|
if (data[key] === false) {
|
|
@@ -4520,10 +4569,10 @@ function useModelService() {
|
|
|
4520
4569
|
}
|
|
4521
4570
|
|
|
4522
4571
|
// src/services/user-service/index.ts
|
|
4523
|
-
var
|
|
4572
|
+
var import_react11 = require("react");
|
|
4524
4573
|
function useUserService() {
|
|
4525
4574
|
const { env } = useEnv();
|
|
4526
|
-
const getProfile = (0,
|
|
4575
|
+
const getProfile = (0, import_react11.useCallback)(
|
|
4527
4576
|
async (service, path, extraHeaders) => {
|
|
4528
4577
|
return env?.requests?.get(
|
|
4529
4578
|
path || "/userinfo" /* PROFILE_PATH */,
|
|
@@ -4540,7 +4589,7 @@ function useUserService() {
|
|
|
4540
4589
|
},
|
|
4541
4590
|
[env]
|
|
4542
4591
|
);
|
|
4543
|
-
const getUser = (0,
|
|
4592
|
+
const getUser = (0, import_react11.useCallback)(
|
|
4544
4593
|
async ({ context, id }) => {
|
|
4545
4594
|
const jsonData = {
|
|
4546
4595
|
model: "res.users",
|
|
@@ -4578,7 +4627,7 @@ function useUserService() {
|
|
|
4578
4627
|
},
|
|
4579
4628
|
[env]
|
|
4580
4629
|
);
|
|
4581
|
-
const switchUserLocale = (0,
|
|
4630
|
+
const switchUserLocale = (0, import_react11.useCallback)(
|
|
4582
4631
|
async ({ id, values, service }) => {
|
|
4583
4632
|
const jsonData = {
|
|
4584
4633
|
model: "res.users",
|
|
@@ -4606,10 +4655,10 @@ function useUserService() {
|
|
|
4606
4655
|
}
|
|
4607
4656
|
|
|
4608
4657
|
// src/services/view-service/index.ts
|
|
4609
|
-
var
|
|
4658
|
+
var import_react12 = require("react");
|
|
4610
4659
|
function useViewService() {
|
|
4611
4660
|
const { env } = useEnv();
|
|
4612
|
-
const getView = (0,
|
|
4661
|
+
const getView = (0, import_react12.useCallback)(
|
|
4613
4662
|
async ({
|
|
4614
4663
|
model,
|
|
4615
4664
|
views,
|
|
@@ -4649,7 +4698,7 @@ function useViewService() {
|
|
|
4649
4698
|
},
|
|
4650
4699
|
[env]
|
|
4651
4700
|
);
|
|
4652
|
-
const getMenu = (0,
|
|
4701
|
+
const getMenu = (0, import_react12.useCallback)(
|
|
4653
4702
|
async (context, specification, domain, service) => {
|
|
4654
4703
|
const jsonData = {
|
|
4655
4704
|
model: "ir.ui.menu" /* MENU */,
|
|
@@ -4680,7 +4729,7 @@ function useViewService() {
|
|
|
4680
4729
|
},
|
|
4681
4730
|
[env]
|
|
4682
4731
|
);
|
|
4683
|
-
const getActionDetail = (0,
|
|
4732
|
+
const getActionDetail = (0, import_react12.useCallback)(
|
|
4684
4733
|
async (aid, context) => {
|
|
4685
4734
|
const jsonData = {
|
|
4686
4735
|
model: "ir.actions.act_window" /* WINDOW_ACTION */,
|
|
@@ -4710,7 +4759,7 @@ function useViewService() {
|
|
|
4710
4759
|
},
|
|
4711
4760
|
[env]
|
|
4712
4761
|
);
|
|
4713
|
-
const getResequence = (0,
|
|
4762
|
+
const getResequence = (0, import_react12.useCallback)(
|
|
4714
4763
|
async ({
|
|
4715
4764
|
model,
|
|
4716
4765
|
ids,
|
|
@@ -4740,7 +4789,7 @@ function useViewService() {
|
|
|
4740
4789
|
},
|
|
4741
4790
|
[env]
|
|
4742
4791
|
);
|
|
4743
|
-
const getSelectionItem = (0,
|
|
4792
|
+
const getSelectionItem = (0, import_react12.useCallback)(
|
|
4744
4793
|
async ({
|
|
4745
4794
|
data,
|
|
4746
4795
|
service,
|
|
@@ -4777,7 +4826,7 @@ function useViewService() {
|
|
|
4777
4826
|
},
|
|
4778
4827
|
[env]
|
|
4779
4828
|
);
|
|
4780
|
-
const loadMessages = (0,
|
|
4829
|
+
const loadMessages = (0, import_react12.useCallback)(async () => {
|
|
4781
4830
|
return env.requests.post(
|
|
4782
4831
|
"/load_message_failures" /* LOAD_MESSAGE */,
|
|
4783
4832
|
{},
|
|
@@ -4788,14 +4837,14 @@ function useViewService() {
|
|
|
4788
4837
|
}
|
|
4789
4838
|
);
|
|
4790
4839
|
}, [env]);
|
|
4791
|
-
const getVersion = (0,
|
|
4840
|
+
const getVersion = (0, import_react12.useCallback)(async () => {
|
|
4792
4841
|
return env?.requests?.get("", {
|
|
4793
4842
|
headers: {
|
|
4794
4843
|
"Content-Type": "application/json"
|
|
4795
4844
|
}
|
|
4796
4845
|
});
|
|
4797
4846
|
}, [env]);
|
|
4798
|
-
const grantAccess = (0,
|
|
4847
|
+
const grantAccess = (0, import_react12.useCallback)(
|
|
4799
4848
|
async ({
|
|
4800
4849
|
redirect_uri,
|
|
4801
4850
|
state,
|
|
@@ -4822,7 +4871,7 @@ function useViewService() {
|
|
|
4822
4871
|
},
|
|
4823
4872
|
[env]
|
|
4824
4873
|
);
|
|
4825
|
-
const removeTotpSetUp = (0,
|
|
4874
|
+
const removeTotpSetUp = (0, import_react12.useCallback)(
|
|
4826
4875
|
async ({ method, token }) => {
|
|
4827
4876
|
const jsonData = {
|
|
4828
4877
|
method,
|
|
@@ -4843,7 +4892,7 @@ function useViewService() {
|
|
|
4843
4892
|
},
|
|
4844
4893
|
[env]
|
|
4845
4894
|
);
|
|
4846
|
-
const requestSetupTotp = (0,
|
|
4895
|
+
const requestSetupTotp = (0, import_react12.useCallback)(
|
|
4847
4896
|
async ({ method, token }) => {
|
|
4848
4897
|
const jsonData = {
|
|
4849
4898
|
method,
|
|
@@ -4862,7 +4911,7 @@ function useViewService() {
|
|
|
4862
4911
|
},
|
|
4863
4912
|
[env]
|
|
4864
4913
|
);
|
|
4865
|
-
const settingsWebRead2fa = (0,
|
|
4914
|
+
const settingsWebRead2fa = (0, import_react12.useCallback)(
|
|
4866
4915
|
async ({
|
|
4867
4916
|
method,
|
|
4868
4917
|
model,
|
|
@@ -4890,7 +4939,7 @@ function useViewService() {
|
|
|
4890
4939
|
},
|
|
4891
4940
|
[env]
|
|
4892
4941
|
);
|
|
4893
|
-
const signInSSO = (0,
|
|
4942
|
+
const signInSSO = (0, import_react12.useCallback)(
|
|
4894
4943
|
async ({
|
|
4895
4944
|
redirect_uri,
|
|
4896
4945
|
state,
|
|
@@ -4922,7 +4971,7 @@ function useViewService() {
|
|
|
4922
4971
|
},
|
|
4923
4972
|
[env]
|
|
4924
4973
|
);
|
|
4925
|
-
const verify2FA = (0,
|
|
4974
|
+
const verify2FA = (0, import_react12.useCallback)(
|
|
4926
4975
|
({
|
|
4927
4976
|
method,
|
|
4928
4977
|
with_context,
|
|
@@ -4955,7 +5004,7 @@ function useViewService() {
|
|
|
4955
5004
|
},
|
|
4956
5005
|
[env]
|
|
4957
5006
|
);
|
|
4958
|
-
const get2FAMethods = (0,
|
|
5007
|
+
const get2FAMethods = (0, import_react12.useCallback)(
|
|
4959
5008
|
({ method, with_context }) => {
|
|
4960
5009
|
const jsonData = {
|
|
4961
5010
|
method,
|
|
@@ -4974,7 +5023,7 @@ function useViewService() {
|
|
|
4974
5023
|
},
|
|
4975
5024
|
[env]
|
|
4976
5025
|
);
|
|
4977
|
-
const verifyTotp = (0,
|
|
5026
|
+
const verifyTotp = (0, import_react12.useCallback)(
|
|
4978
5027
|
({
|
|
4979
5028
|
method,
|
|
4980
5029
|
action_token,
|
|
@@ -4999,7 +5048,7 @@ function useViewService() {
|
|
|
4999
5048
|
},
|
|
5000
5049
|
[env]
|
|
5001
5050
|
);
|
|
5002
|
-
const getNotifications = (0,
|
|
5051
|
+
const getNotifications = (0, import_react12.useCallback)(
|
|
5003
5052
|
async ({
|
|
5004
5053
|
service,
|
|
5005
5054
|
xNode,
|
|
@@ -5019,7 +5068,7 @@ function useViewService() {
|
|
|
5019
5068
|
},
|
|
5020
5069
|
[env]
|
|
5021
5070
|
);
|
|
5022
|
-
const getCountry = (0,
|
|
5071
|
+
const getCountry = (0, import_react12.useCallback)(
|
|
5023
5072
|
async ({
|
|
5024
5073
|
service,
|
|
5025
5074
|
xNode,
|
|
@@ -5046,7 +5095,7 @@ function useViewService() {
|
|
|
5046
5095
|
},
|
|
5047
5096
|
[env]
|
|
5048
5097
|
);
|
|
5049
|
-
const getCity = (0,
|
|
5098
|
+
const getCity = (0, import_react12.useCallback)(
|
|
5050
5099
|
async ({
|
|
5051
5100
|
service,
|
|
5052
5101
|
xNode,
|
|
@@ -5073,7 +5122,7 @@ function useViewService() {
|
|
|
5073
5122
|
},
|
|
5074
5123
|
[env]
|
|
5075
5124
|
);
|
|
5076
|
-
const getWard = (0,
|
|
5125
|
+
const getWard = (0, import_react12.useCallback)(
|
|
5077
5126
|
async ({
|
|
5078
5127
|
service,
|
|
5079
5128
|
xNode,
|
|
@@ -5098,7 +5147,7 @@ function useViewService() {
|
|
|
5098
5147
|
},
|
|
5099
5148
|
[env]
|
|
5100
5149
|
);
|
|
5101
|
-
const getPartnerTitle = (0,
|
|
5150
|
+
const getPartnerTitle = (0, import_react12.useCallback)(
|
|
5102
5151
|
async ({
|
|
5103
5152
|
service,
|
|
5104
5153
|
xNode,
|
|
@@ -5150,10 +5199,10 @@ function useViewService() {
|
|
|
5150
5199
|
}
|
|
5151
5200
|
|
|
5152
5201
|
// src/services/dashboard-service/index.ts
|
|
5153
|
-
var
|
|
5202
|
+
var import_react13 = require("react");
|
|
5154
5203
|
function useDashboardService() {
|
|
5155
5204
|
const { env } = useEnv();
|
|
5156
|
-
const readGroup = (0,
|
|
5205
|
+
const readGroup = (0, import_react13.useCallback)(
|
|
5157
5206
|
async ({
|
|
5158
5207
|
service,
|
|
5159
5208
|
xNode,
|
|
@@ -5170,7 +5219,7 @@ function useDashboardService() {
|
|
|
5170
5219
|
},
|
|
5171
5220
|
[env]
|
|
5172
5221
|
);
|
|
5173
|
-
const getDataChart = (0,
|
|
5222
|
+
const getDataChart = (0, import_react13.useCallback)(
|
|
5174
5223
|
async ({
|
|
5175
5224
|
service,
|
|
5176
5225
|
xNode,
|
|
@@ -5206,9 +5255,9 @@ function useDashboardService() {
|
|
|
5206
5255
|
}
|
|
5207
5256
|
|
|
5208
5257
|
// src/services/pos-service/get-a-session.ts
|
|
5209
|
-
var
|
|
5258
|
+
var import_react14 = require("react");
|
|
5210
5259
|
var getASessionService = (env) => {
|
|
5211
|
-
const getASession = (0,
|
|
5260
|
+
const getASession = (0, import_react14.useCallback)(
|
|
5212
5261
|
async ({
|
|
5213
5262
|
model,
|
|
5214
5263
|
args,
|
|
@@ -5257,9 +5306,9 @@ var getASessionService = (env) => {
|
|
|
5257
5306
|
};
|
|
5258
5307
|
|
|
5259
5308
|
// src/services/pos-service/add-entity.ts
|
|
5260
|
-
var
|
|
5309
|
+
var import_react15 = require("react");
|
|
5261
5310
|
var addEntityService = (env) => {
|
|
5262
|
-
const addEntity = (0,
|
|
5311
|
+
const addEntity = (0, import_react15.useCallback)(
|
|
5263
5312
|
({
|
|
5264
5313
|
model,
|
|
5265
5314
|
values,
|
|
@@ -5291,9 +5340,9 @@ var addEntityService = (env) => {
|
|
|
5291
5340
|
};
|
|
5292
5341
|
|
|
5293
5342
|
// src/services/pos-service/change-order-preparation-state.ts
|
|
5294
|
-
var
|
|
5343
|
+
var import_react16 = require("react");
|
|
5295
5344
|
var changOrderPreparationStateService = (env) => {
|
|
5296
|
-
const changeOrderPreparationState = (0,
|
|
5345
|
+
const changeOrderPreparationState = (0, import_react16.useCallback)(
|
|
5297
5346
|
({
|
|
5298
5347
|
orderId,
|
|
5299
5348
|
stageId,
|
|
@@ -5330,9 +5379,9 @@ var changOrderPreparationStateService = (env) => {
|
|
|
5330
5379
|
};
|
|
5331
5380
|
|
|
5332
5381
|
// src/services/pos-service/check-payment.ts
|
|
5333
|
-
var
|
|
5382
|
+
var import_react17 = require("react");
|
|
5334
5383
|
var checkPaymentService = (env) => {
|
|
5335
|
-
const checkPayment = (0,
|
|
5384
|
+
const checkPayment = (0, import_react17.useCallback)(
|
|
5336
5385
|
({
|
|
5337
5386
|
model,
|
|
5338
5387
|
ids,
|
|
@@ -5366,9 +5415,9 @@ var checkPaymentService = (env) => {
|
|
|
5366
5415
|
};
|
|
5367
5416
|
|
|
5368
5417
|
// src/services/pos-service/create-e-invoice.ts
|
|
5369
|
-
var
|
|
5418
|
+
var import_react18 = require("react");
|
|
5370
5419
|
var createEInvoiceService = (env) => {
|
|
5371
|
-
const createEInvoice = (0,
|
|
5420
|
+
const createEInvoice = (0, import_react18.useCallback)(
|
|
5372
5421
|
async ({
|
|
5373
5422
|
service,
|
|
5374
5423
|
xNode,
|
|
@@ -5403,9 +5452,9 @@ var createEInvoiceService = (env) => {
|
|
|
5403
5452
|
};
|
|
5404
5453
|
|
|
5405
5454
|
// src/services/pos-service/create-entity.ts
|
|
5406
|
-
var
|
|
5455
|
+
var import_react19 = require("react");
|
|
5407
5456
|
var createEntityService = (env) => {
|
|
5408
|
-
const createEntity = (0,
|
|
5457
|
+
const createEntity = (0, import_react19.useCallback)(
|
|
5409
5458
|
({
|
|
5410
5459
|
model,
|
|
5411
5460
|
args,
|
|
@@ -5437,9 +5486,9 @@ var createEntityService = (env) => {
|
|
|
5437
5486
|
};
|
|
5438
5487
|
|
|
5439
5488
|
// src/services/pos-service/create-pos-config.ts
|
|
5440
|
-
var
|
|
5489
|
+
var import_react20 = require("react");
|
|
5441
5490
|
var createPosConfigService = (env) => {
|
|
5442
|
-
const createPosConfig = (0,
|
|
5491
|
+
const createPosConfig = (0, import_react20.useCallback)(
|
|
5443
5492
|
({
|
|
5444
5493
|
model,
|
|
5445
5494
|
name,
|
|
@@ -5474,9 +5523,9 @@ var createPosConfigService = (env) => {
|
|
|
5474
5523
|
};
|
|
5475
5524
|
|
|
5476
5525
|
// src/services/pos-service/create-session.ts
|
|
5477
|
-
var
|
|
5526
|
+
var import_react21 = require("react");
|
|
5478
5527
|
var createSessionService = (env) => {
|
|
5479
|
-
const createSession = (0,
|
|
5528
|
+
const createSession = (0, import_react21.useCallback)(
|
|
5480
5529
|
({
|
|
5481
5530
|
model,
|
|
5482
5531
|
configId,
|
|
@@ -5512,9 +5561,9 @@ var createSessionService = (env) => {
|
|
|
5512
5561
|
};
|
|
5513
5562
|
|
|
5514
5563
|
// src/services/pos-service/delete-entity.ts
|
|
5515
|
-
var
|
|
5564
|
+
var import_react22 = require("react");
|
|
5516
5565
|
var deleteEntityService = (env) => {
|
|
5517
|
-
const deleteEntity = (0,
|
|
5566
|
+
const deleteEntity = (0, import_react22.useCallback)(
|
|
5518
5567
|
({
|
|
5519
5568
|
model,
|
|
5520
5569
|
ids,
|
|
@@ -5547,9 +5596,9 @@ var deleteEntityService = (env) => {
|
|
|
5547
5596
|
};
|
|
5548
5597
|
|
|
5549
5598
|
// src/services/pos-service/generate-payment-qr-info.ts
|
|
5550
|
-
var
|
|
5599
|
+
var import_react23 = require("react");
|
|
5551
5600
|
var generatePaymentQrInfoService = (env) => {
|
|
5552
|
-
const generatePaymentQRInfo = (0,
|
|
5601
|
+
const generatePaymentQRInfo = (0, import_react23.useCallback)(
|
|
5553
5602
|
({
|
|
5554
5603
|
orderId,
|
|
5555
5604
|
amount,
|
|
@@ -5582,9 +5631,9 @@ var generatePaymentQrInfoService = (env) => {
|
|
|
5582
5631
|
};
|
|
5583
5632
|
|
|
5584
5633
|
// src/services/pos-service/get-current-user.ts
|
|
5585
|
-
var
|
|
5634
|
+
var import_react24 = require("react");
|
|
5586
5635
|
var getCurrentUserService = (env) => {
|
|
5587
|
-
const getCurrentUser = (0,
|
|
5636
|
+
const getCurrentUser = (0, import_react24.useCallback)(
|
|
5588
5637
|
async ({
|
|
5589
5638
|
service,
|
|
5590
5639
|
xNode,
|
|
@@ -5614,9 +5663,9 @@ var getCurrentUserService = (env) => {
|
|
|
5614
5663
|
};
|
|
5615
5664
|
|
|
5616
5665
|
// src/services/pos-service/get-list.ts
|
|
5617
|
-
var
|
|
5666
|
+
var import_react25 = require("react");
|
|
5618
5667
|
var getListService = (env) => {
|
|
5619
|
-
const getList = (0,
|
|
5668
|
+
const getList = (0, import_react25.useCallback)(
|
|
5620
5669
|
async ({
|
|
5621
5670
|
model,
|
|
5622
5671
|
domain,
|
|
@@ -5656,9 +5705,9 @@ var getListService = (env) => {
|
|
|
5656
5705
|
};
|
|
5657
5706
|
|
|
5658
5707
|
// src/services/pos-service/get-order-line.ts
|
|
5659
|
-
var
|
|
5708
|
+
var import_react26 = require("react");
|
|
5660
5709
|
var getOrderLineService = (env) => {
|
|
5661
|
-
const getOrderLine = (0,
|
|
5710
|
+
const getOrderLine = (0, import_react26.useCallback)(
|
|
5662
5711
|
({
|
|
5663
5712
|
model,
|
|
5664
5713
|
ids,
|
|
@@ -5694,9 +5743,9 @@ var getOrderLineService = (env) => {
|
|
|
5694
5743
|
};
|
|
5695
5744
|
|
|
5696
5745
|
// src/services/pos-service/get-pin-code.ts
|
|
5697
|
-
var
|
|
5746
|
+
var import_react27 = require("react");
|
|
5698
5747
|
var getPinCodeService = (env) => {
|
|
5699
|
-
const getPinCode = (0,
|
|
5748
|
+
const getPinCode = (0, import_react27.useCallback)(
|
|
5700
5749
|
({
|
|
5701
5750
|
serialNumber,
|
|
5702
5751
|
xNode,
|
|
@@ -5725,9 +5774,9 @@ var getPinCodeService = (env) => {
|
|
|
5725
5774
|
};
|
|
5726
5775
|
|
|
5727
5776
|
// src/services/pos-service/get-pos.ts
|
|
5728
|
-
var
|
|
5777
|
+
var import_react28 = require("react");
|
|
5729
5778
|
var getPosService = (env) => {
|
|
5730
|
-
const getPOS = (0,
|
|
5779
|
+
const getPOS = (0, import_react28.useCallback)(
|
|
5731
5780
|
({
|
|
5732
5781
|
model,
|
|
5733
5782
|
args,
|
|
@@ -5791,9 +5840,9 @@ var getPosService = (env) => {
|
|
|
5791
5840
|
};
|
|
5792
5841
|
|
|
5793
5842
|
// src/services/pos-service/get-preparation-display-data.ts
|
|
5794
|
-
var
|
|
5843
|
+
var import_react29 = require("react");
|
|
5795
5844
|
var getPreparationDisplayDataService = (env) => {
|
|
5796
|
-
const getPreparationDisplayData = (0,
|
|
5845
|
+
const getPreparationDisplayData = (0, import_react29.useCallback)(
|
|
5797
5846
|
({
|
|
5798
5847
|
ids,
|
|
5799
5848
|
xNode,
|
|
@@ -5826,9 +5875,9 @@ var getPreparationDisplayDataService = (env) => {
|
|
|
5826
5875
|
};
|
|
5827
5876
|
|
|
5828
5877
|
// src/services/pos-service/get-product-image.ts
|
|
5829
|
-
var
|
|
5878
|
+
var import_react30 = require("react");
|
|
5830
5879
|
var getProductImageService = (env) => {
|
|
5831
|
-
const getProductImage = (0,
|
|
5880
|
+
const getProductImage = (0, import_react30.useCallback)(
|
|
5832
5881
|
({
|
|
5833
5882
|
model,
|
|
5834
5883
|
fields,
|
|
@@ -5867,9 +5916,9 @@ var getProductImageService = (env) => {
|
|
|
5867
5916
|
};
|
|
5868
5917
|
|
|
5869
5918
|
// src/services/pos-service/handle-close-session.ts
|
|
5870
|
-
var
|
|
5919
|
+
var import_react31 = require("react");
|
|
5871
5920
|
var handleCloseSessionService = (env) => {
|
|
5872
|
-
const handleCloseSession = (0,
|
|
5921
|
+
const handleCloseSession = (0, import_react31.useCallback)(
|
|
5873
5922
|
({
|
|
5874
5923
|
model,
|
|
5875
5924
|
ids,
|
|
@@ -5902,9 +5951,9 @@ var handleCloseSessionService = (env) => {
|
|
|
5902
5951
|
};
|
|
5903
5952
|
|
|
5904
5953
|
// src/services/pos-service/handle-closing-detail-session.ts
|
|
5905
|
-
var
|
|
5954
|
+
var import_react32 = require("react");
|
|
5906
5955
|
var handleClosingDetailSessionService = (env) => {
|
|
5907
|
-
const handleClosingDetailSession = (0,
|
|
5956
|
+
const handleClosingDetailSession = (0, import_react32.useCallback)(
|
|
5908
5957
|
({
|
|
5909
5958
|
model,
|
|
5910
5959
|
ids,
|
|
@@ -5939,9 +5988,9 @@ var handleClosingDetailSessionService = (env) => {
|
|
|
5939
5988
|
};
|
|
5940
5989
|
|
|
5941
5990
|
// src/services/pos-service/handle-closing-session.ts
|
|
5942
|
-
var
|
|
5991
|
+
var import_react33 = require("react");
|
|
5943
5992
|
var handleClosingSessionService = (env) => {
|
|
5944
|
-
const handleClosingSession = (0,
|
|
5993
|
+
const handleClosingSession = (0, import_react33.useCallback)(
|
|
5945
5994
|
({
|
|
5946
5995
|
model,
|
|
5947
5996
|
method,
|
|
@@ -5977,34 +6026,6 @@ var handleClosingSessionService = (env) => {
|
|
|
5977
6026
|
|
|
5978
6027
|
// src/services/pos-service/load-data-pos-session.ts
|
|
5979
6028
|
var import_react34 = require("react");
|
|
5980
|
-
|
|
5981
|
-
// src/provider/supabase-provider.tsx
|
|
5982
|
-
var import_react33 = require("react");
|
|
5983
|
-
var import_supabase_js = require("@supabase/supabase-js");
|
|
5984
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
5985
|
-
var SupabaseContext = (0, import_react33.createContext)(null);
|
|
5986
|
-
var SupabaseProvider = ({
|
|
5987
|
-
supabaseUrl,
|
|
5988
|
-
supabaseKey,
|
|
5989
|
-
children
|
|
5990
|
-
}) => {
|
|
5991
|
-
const supabase = (0, import_react33.useMemo)(() => {
|
|
5992
|
-
if (!supabaseUrl || !supabaseKey) return null;
|
|
5993
|
-
return (0, import_supabase_js.createClient)(supabaseUrl, supabaseKey);
|
|
5994
|
-
}, [supabaseUrl, supabaseKey]);
|
|
5995
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SupabaseContext.Provider, { value: supabase, children });
|
|
5996
|
-
};
|
|
5997
|
-
var useSupabase = () => {
|
|
5998
|
-
const context = (0, import_react33.useContext)(SupabaseContext);
|
|
5999
|
-
if (!context) {
|
|
6000
|
-
throw new Error(
|
|
6001
|
-
"useSupabase must be used within a SupabaseProvider or check your env config"
|
|
6002
|
-
);
|
|
6003
|
-
}
|
|
6004
|
-
return context;
|
|
6005
|
-
};
|
|
6006
|
-
|
|
6007
|
-
// src/services/pos-service/load-data-pos-session.ts
|
|
6008
6029
|
var MODEL_TO_TABLE = {
|
|
6009
6030
|
["account.tax" /* ACCOUNT_TAX */]: "account_taxes",
|
|
6010
6031
|
["res.company" /* RES_COMPANY */]: "companies",
|
|
@@ -6022,7 +6043,7 @@ var MODEL_TO_TABLE = {
|
|
|
6022
6043
|
["restaurant.table" /* RESTAURANT_TABLE */]: "restaurant_tables"
|
|
6023
6044
|
};
|
|
6024
6045
|
var loadDataPosSessionService = (env) => {
|
|
6025
|
-
const supabase =
|
|
6046
|
+
const supabase = useSupabaseOptional();
|
|
6026
6047
|
const loadDataPosSession = (0, import_react34.useCallback)(
|
|
6027
6048
|
async ({
|
|
6028
6049
|
model,
|
|
@@ -6074,6 +6095,14 @@ var loadDataPosSessionService = (env) => {
|
|
|
6074
6095
|
relations: {}
|
|
6075
6096
|
};
|
|
6076
6097
|
}
|
|
6098
|
+
if (!supabase) {
|
|
6099
|
+
return {
|
|
6100
|
+
modelName,
|
|
6101
|
+
data: [],
|
|
6102
|
+
fields: {},
|
|
6103
|
+
relations: {}
|
|
6104
|
+
};
|
|
6105
|
+
}
|
|
6077
6106
|
const { data, error } = await supabase.from(tableName).select("*");
|
|
6078
6107
|
if (error) {
|
|
6079
6108
|
console.error(`Error loading ${modelName}:`, error);
|
|
@@ -7036,9 +7065,16 @@ var use_isvalid_token_default = useIsValidToken;
|
|
|
7036
7065
|
// src/hooks/auth/use-login-credential.tsx
|
|
7037
7066
|
var import_react_query7 = require("@tanstack/react-query");
|
|
7038
7067
|
var useLoginCredential = () => {
|
|
7039
|
-
const { login } = useAuthService();
|
|
7068
|
+
const { login, loginSupabase } = useAuthService();
|
|
7069
|
+
const { env } = useEnv();
|
|
7040
7070
|
return (0, import_react_query7.useMutation)({
|
|
7041
7071
|
mutationFn: (data) => {
|
|
7072
|
+
if (env.isSupaMode) {
|
|
7073
|
+
return loginSupabase({
|
|
7074
|
+
email: data.email,
|
|
7075
|
+
password: data.password
|
|
7076
|
+
});
|
|
7077
|
+
}
|
|
7042
7078
|
return login(data);
|
|
7043
7079
|
}
|
|
7044
7080
|
});
|