@fctc/interface-logic 2.9.0 → 2.9.2
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.js +2 -2
- package/dist/configs.mjs +2 -2
- package/dist/constants.d.mts +2 -1
- package/dist/constants.d.ts +2 -1
- package/dist/constants.js +1 -0
- package/dist/constants.mjs +1 -0
- package/dist/environment.js +2 -2
- package/dist/environment.mjs +2 -2
- package/dist/hooks.d.mts +15 -1
- package/dist/hooks.d.ts +15 -1
- package/dist/hooks.js +113 -23
- package/dist/hooks.mjs +112 -23
- package/dist/provider.d.mts +2 -1
- package/dist/provider.d.ts +2 -1
- package/dist/provider.js +113 -24
- package/dist/provider.mjs +113 -24
- package/dist/services.d.mts +16 -3
- package/dist/services.d.ts +16 -3
- package/dist/services.js +70 -17
- package/dist/services.mjs +70 -17
- package/dist/utils.js +2 -2
- package/dist/utils.mjs +2 -2
- package/package.json +1 -1
package/dist/configs.js
CHANGED
|
@@ -1711,7 +1711,7 @@ function evaluate(ast, context = {}) {
|
|
|
1711
1711
|
return ast2.value;
|
|
1712
1712
|
case 5:
|
|
1713
1713
|
if (ast2.value in evalContext) {
|
|
1714
|
-
if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
|
|
1714
|
+
if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id && ast2?.value !== "parent") {
|
|
1715
1715
|
return evalContext[ast2.value]?.id;
|
|
1716
1716
|
}
|
|
1717
1717
|
return evalContext[ast2.value] ?? false;
|
|
@@ -1782,7 +1782,7 @@ function evaluate(ast, context = {}) {
|
|
|
1782
1782
|
} else if (typeof leftVal === "number") {
|
|
1783
1783
|
result = leftVal;
|
|
1784
1784
|
} else {
|
|
1785
|
-
result = leftVal[ast2.key];
|
|
1785
|
+
result = leftVal[ast2.key]?.id ?? leftVal[ast2.key];
|
|
1786
1786
|
}
|
|
1787
1787
|
if (typeof result === "function") {
|
|
1788
1788
|
const bound = result.bind(leftVal);
|
package/dist/configs.mjs
CHANGED
|
@@ -1675,7 +1675,7 @@ function evaluate(ast, context = {}) {
|
|
|
1675
1675
|
return ast2.value;
|
|
1676
1676
|
case 5:
|
|
1677
1677
|
if (ast2.value in evalContext) {
|
|
1678
|
-
if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
|
|
1678
|
+
if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id && ast2?.value !== "parent") {
|
|
1679
1679
|
return evalContext[ast2.value]?.id;
|
|
1680
1680
|
}
|
|
1681
1681
|
return evalContext[ast2.value] ?? false;
|
|
@@ -1746,7 +1746,7 @@ function evaluate(ast, context = {}) {
|
|
|
1746
1746
|
} else if (typeof leftVal === "number") {
|
|
1747
1747
|
result = leftVal;
|
|
1748
1748
|
} else {
|
|
1749
|
-
result = leftVal[ast2.key];
|
|
1749
|
+
result = leftVal[ast2.key]?.id ?? leftVal[ast2.key];
|
|
1750
1750
|
}
|
|
1751
1751
|
if (typeof result === "function") {
|
|
1752
1752
|
const bound = result.bind(leftVal);
|
package/dist/constants.d.mts
CHANGED
package/dist/constants.d.ts
CHANGED
package/dist/constants.js
CHANGED
|
@@ -64,6 +64,7 @@ var MethodConstants = /* @__PURE__ */ ((MethodConstants2) => {
|
|
|
64
64
|
MethodConstants2["GET_FIELD_VIEW"] = "get_fields_view_v2";
|
|
65
65
|
MethodConstants2["CREATE"] = "create";
|
|
66
66
|
MethodConstants2["LOAD_DATA"] = "load_data";
|
|
67
|
+
MethodConstants2["CHECK"] = "check";
|
|
67
68
|
return MethodConstants2;
|
|
68
69
|
})(MethodConstants || {});
|
|
69
70
|
|
package/dist/constants.mjs
CHANGED
|
@@ -26,6 +26,7 @@ var MethodConstants = /* @__PURE__ */ ((MethodConstants2) => {
|
|
|
26
26
|
MethodConstants2["GET_FIELD_VIEW"] = "get_fields_view_v2";
|
|
27
27
|
MethodConstants2["CREATE"] = "create";
|
|
28
28
|
MethodConstants2["LOAD_DATA"] = "load_data";
|
|
29
|
+
MethodConstants2["CHECK"] = "check";
|
|
29
30
|
return MethodConstants2;
|
|
30
31
|
})(MethodConstants || {});
|
|
31
32
|
|
package/dist/environment.js
CHANGED
|
@@ -1713,7 +1713,7 @@ function evaluate(ast, context = {}) {
|
|
|
1713
1713
|
return ast2.value;
|
|
1714
1714
|
case 5:
|
|
1715
1715
|
if (ast2.value in evalContext) {
|
|
1716
|
-
if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
|
|
1716
|
+
if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id && ast2?.value !== "parent") {
|
|
1717
1717
|
return evalContext[ast2.value]?.id;
|
|
1718
1718
|
}
|
|
1719
1719
|
return evalContext[ast2.value] ?? false;
|
|
@@ -1784,7 +1784,7 @@ function evaluate(ast, context = {}) {
|
|
|
1784
1784
|
} else if (typeof leftVal === "number") {
|
|
1785
1785
|
result = leftVal;
|
|
1786
1786
|
} else {
|
|
1787
|
-
result = leftVal[ast2.key];
|
|
1787
|
+
result = leftVal[ast2.key]?.id ?? leftVal[ast2.key];
|
|
1788
1788
|
}
|
|
1789
1789
|
if (typeof result === "function") {
|
|
1790
1790
|
const bound = result.bind(leftVal);
|
package/dist/environment.mjs
CHANGED
|
@@ -1675,7 +1675,7 @@ function evaluate(ast, context = {}) {
|
|
|
1675
1675
|
return ast2.value;
|
|
1676
1676
|
case 5:
|
|
1677
1677
|
if (ast2.value in evalContext) {
|
|
1678
|
-
if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
|
|
1678
|
+
if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id && ast2?.value !== "parent") {
|
|
1679
1679
|
return evalContext[ast2.value]?.id;
|
|
1680
1680
|
}
|
|
1681
1681
|
return evalContext[ast2.value] ?? false;
|
|
@@ -1746,7 +1746,7 @@ function evaluate(ast, context = {}) {
|
|
|
1746
1746
|
} else if (typeof leftVal === "number") {
|
|
1747
1747
|
result = leftVal;
|
|
1748
1748
|
} else {
|
|
1749
|
-
result = leftVal[ast2.key];
|
|
1749
|
+
result = leftVal[ast2.key]?.id ?? leftVal[ast2.key];
|
|
1750
1750
|
}
|
|
1751
1751
|
if (typeof result === "function") {
|
|
1752
1752
|
const bound = result.bind(leftVal);
|
package/dist/hooks.d.mts
CHANGED
|
@@ -81,10 +81,14 @@ declare const useParsePreview: () => _tanstack_react_query.UseMutationResult<any
|
|
|
81
81
|
selectedSheet: any;
|
|
82
82
|
isHeader: boolean;
|
|
83
83
|
context: any;
|
|
84
|
+
service?: string;
|
|
85
|
+
xNode?: string;
|
|
84
86
|
}, unknown>;
|
|
85
87
|
|
|
86
88
|
declare const useUploadFileExcel: () => _tanstack_react_query.UseMutationResult<any, Error, {
|
|
87
89
|
formData: any;
|
|
90
|
+
service?: string;
|
|
91
|
+
xNode?: string;
|
|
88
92
|
}, unknown>;
|
|
89
93
|
|
|
90
94
|
declare const useUploadIdFile: () => _tanstack_react_query.UseMutationResult<any, Error, {
|
|
@@ -98,6 +102,8 @@ declare const useExecuteImport: () => _tanstack_react_query.UseMutationResult<an
|
|
|
98
102
|
options: any;
|
|
99
103
|
dryrun: any;
|
|
100
104
|
context: any;
|
|
105
|
+
service?: string;
|
|
106
|
+
xNode?: string;
|
|
101
107
|
}, unknown>;
|
|
102
108
|
|
|
103
109
|
declare const useChangeStatus: () => _tanstack_react_query.UseMutationResult<any, Error, {
|
|
@@ -502,4 +508,12 @@ declare const useAddEntity: () => _tanstack_react_query.UseMutationResult<unknow
|
|
|
502
508
|
isCreateEndpoint?: boolean;
|
|
503
509
|
}, unknown>;
|
|
504
510
|
|
|
505
|
-
|
|
511
|
+
declare const useCheckPayment: () => _tanstack_react_query.UseMutationResult<unknown, Error, {
|
|
512
|
+
model: string;
|
|
513
|
+
ids: any;
|
|
514
|
+
withContext: any;
|
|
515
|
+
service: string;
|
|
516
|
+
xNode: string;
|
|
517
|
+
}, unknown>;
|
|
518
|
+
|
|
519
|
+
export { useAddEntity, useButton, useChangeStatus, useCheckPayment, useCreateEntity, useCreateSession, useDelete, useDeleteComment, useDeleteEntity, useDuplicateRecord, useExecuteImport, useExportExcel, useForgotPassword, useForgotPasswordSSO, useGenSerialNumber, useGet2FAMethods, useGetASession, useGetAccessByCode, useGetActionDetail, useGetAll, useGetCalendar, useGetComment, useGetCompanyInfo, useGetConversionRate, useGetCurrency, useGetCurrentCompany, useGetDetail, useGetFieldExport, useGetFieldOnChange, useGetFileExcel, useGetFormView, useGetGroups, useGetImage, useGetList, useGetListCompany, useGetListData, useGetListMyBankAccount, useGetMenu, useGetOrderLine, useGetPos, useGetPrintReport, useGetProGressBar, useGetProductImage, useGetProfile, useGetProvider, useGetResequence, useGetSelection, useGetUser, useGetView, useGrantAccess, useHandleClosingSession, useIsValidToken, useLoadAction, useLoadDataPosSession, useLoadMessage, useLoginCredential, useLoginSocial, useLogout, useManageOnChange, useManageSession, useModel, useOdooDataTransform, useOnChangeForm, useParsePreview, usePrint, useRemoveRow, useRemoveTotpSetup, useRequestSetupTotp, useResetPassword, useResetPasswordSSO, useRunAction, useSave, useSendComment, useSettingsWebRead2fa, useSignInSSO, useSwitchLocale, useUpdateClosedSession, useUpdateEntity, useUpdatePassword, useUploadFile, useUploadFileExcel, useUploadIdFile, useUploadImage, useValidateActionToken, useVerify2FA, useVerifyTotp };
|
package/dist/hooks.d.ts
CHANGED
|
@@ -81,10 +81,14 @@ declare const useParsePreview: () => _tanstack_react_query.UseMutationResult<any
|
|
|
81
81
|
selectedSheet: any;
|
|
82
82
|
isHeader: boolean;
|
|
83
83
|
context: any;
|
|
84
|
+
service?: string;
|
|
85
|
+
xNode?: string;
|
|
84
86
|
}, unknown>;
|
|
85
87
|
|
|
86
88
|
declare const useUploadFileExcel: () => _tanstack_react_query.UseMutationResult<any, Error, {
|
|
87
89
|
formData: any;
|
|
90
|
+
service?: string;
|
|
91
|
+
xNode?: string;
|
|
88
92
|
}, unknown>;
|
|
89
93
|
|
|
90
94
|
declare const useUploadIdFile: () => _tanstack_react_query.UseMutationResult<any, Error, {
|
|
@@ -98,6 +102,8 @@ declare const useExecuteImport: () => _tanstack_react_query.UseMutationResult<an
|
|
|
98
102
|
options: any;
|
|
99
103
|
dryrun: any;
|
|
100
104
|
context: any;
|
|
105
|
+
service?: string;
|
|
106
|
+
xNode?: string;
|
|
101
107
|
}, unknown>;
|
|
102
108
|
|
|
103
109
|
declare const useChangeStatus: () => _tanstack_react_query.UseMutationResult<any, Error, {
|
|
@@ -502,4 +508,12 @@ declare const useAddEntity: () => _tanstack_react_query.UseMutationResult<unknow
|
|
|
502
508
|
isCreateEndpoint?: boolean;
|
|
503
509
|
}, unknown>;
|
|
504
510
|
|
|
505
|
-
|
|
511
|
+
declare const useCheckPayment: () => _tanstack_react_query.UseMutationResult<unknown, Error, {
|
|
512
|
+
model: string;
|
|
513
|
+
ids: any;
|
|
514
|
+
withContext: any;
|
|
515
|
+
service: string;
|
|
516
|
+
xNode: string;
|
|
517
|
+
}, unknown>;
|
|
518
|
+
|
|
519
|
+
export { useAddEntity, useButton, useChangeStatus, useCheckPayment, useCreateEntity, useCreateSession, useDelete, useDeleteComment, useDeleteEntity, useDuplicateRecord, useExecuteImport, useExportExcel, useForgotPassword, useForgotPasswordSSO, useGenSerialNumber, useGet2FAMethods, useGetASession, useGetAccessByCode, useGetActionDetail, useGetAll, useGetCalendar, useGetComment, useGetCompanyInfo, useGetConversionRate, useGetCurrency, useGetCurrentCompany, useGetDetail, useGetFieldExport, useGetFieldOnChange, useGetFileExcel, useGetFormView, useGetGroups, useGetImage, useGetList, useGetListCompany, useGetListData, useGetListMyBankAccount, useGetMenu, useGetOrderLine, useGetPos, useGetPrintReport, useGetProGressBar, useGetProductImage, useGetProfile, useGetProvider, useGetResequence, useGetSelection, useGetUser, useGetView, useGrantAccess, useHandleClosingSession, useIsValidToken, useLoadAction, useLoadDataPosSession, useLoadMessage, useLoginCredential, useLoginSocial, useLogout, useManageOnChange, useManageSession, useModel, useOdooDataTransform, useOnChangeForm, useParsePreview, usePrint, useRemoveRow, useRemoveTotpSetup, useRequestSetupTotp, useResetPassword, useResetPasswordSSO, useRunAction, useSave, useSendComment, useSettingsWebRead2fa, useSignInSSO, useSwitchLocale, useUpdateClosedSession, useUpdateEntity, useUpdatePassword, useUploadFile, useUploadFileExcel, useUploadIdFile, useUploadImage, useValidateActionToken, useVerify2FA, useVerifyTotp };
|
package/dist/hooks.js
CHANGED
|
@@ -33,6 +33,7 @@ __export(hooks_exports, {
|
|
|
33
33
|
useAddEntity: () => use_add_entity_default,
|
|
34
34
|
useButton: () => use_button_default,
|
|
35
35
|
useChangeStatus: () => use_change_status_default,
|
|
36
|
+
useCheckPayment: () => use_check_payment_default,
|
|
36
37
|
useCreateEntity: () => use_create_entity_default,
|
|
37
38
|
useCreateSession: () => use_create_session_default,
|
|
38
39
|
useDelete: () => use_delete_default,
|
|
@@ -1840,7 +1841,7 @@ function evaluate(ast, context = {}) {
|
|
|
1840
1841
|
return ast2.value;
|
|
1841
1842
|
case 5:
|
|
1842
1843
|
if (ast2.value in evalContext) {
|
|
1843
|
-
if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
|
|
1844
|
+
if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id && ast2?.value !== "parent") {
|
|
1844
1845
|
return evalContext[ast2.value]?.id;
|
|
1845
1846
|
}
|
|
1846
1847
|
return evalContext[ast2.value] ?? false;
|
|
@@ -1911,7 +1912,7 @@ function evaluate(ast, context = {}) {
|
|
|
1911
1912
|
} else if (typeof leftVal === "number") {
|
|
1912
1913
|
result = leftVal;
|
|
1913
1914
|
} else {
|
|
1914
|
-
result = leftVal[ast2.key];
|
|
1915
|
+
result = leftVal[ast2.key]?.id ?? leftVal[ast2.key];
|
|
1915
1916
|
}
|
|
1916
1917
|
if (typeof result === "function") {
|
|
1917
1918
|
const bound = result.bind(leftVal);
|
|
@@ -3428,8 +3429,19 @@ var import_react9 = require("react");
|
|
|
3428
3429
|
function useExcelService() {
|
|
3429
3430
|
const { env } = useEnv();
|
|
3430
3431
|
const uploadFileExcel = (0, import_react9.useCallback)(
|
|
3431
|
-
async ({
|
|
3432
|
-
|
|
3432
|
+
async ({
|
|
3433
|
+
formData,
|
|
3434
|
+
service,
|
|
3435
|
+
xNode
|
|
3436
|
+
}) => {
|
|
3437
|
+
return env.requests.post(
|
|
3438
|
+
"/upload/file" /* UPLOAD_FILE_EXCEL_PATH */,
|
|
3439
|
+
formData,
|
|
3440
|
+
{
|
|
3441
|
+
headers: { "Content-Type": "application/json", "X-Node": xNode }
|
|
3442
|
+
},
|
|
3443
|
+
service
|
|
3444
|
+
);
|
|
3433
3445
|
},
|
|
3434
3446
|
[env]
|
|
3435
3447
|
);
|
|
@@ -3448,7 +3460,9 @@ function useExcelService() {
|
|
|
3448
3460
|
id,
|
|
3449
3461
|
selectedSheet,
|
|
3450
3462
|
isHeader,
|
|
3451
|
-
context
|
|
3463
|
+
context,
|
|
3464
|
+
service,
|
|
3465
|
+
xNode
|
|
3452
3466
|
}) => {
|
|
3453
3467
|
const jsonData = {
|
|
3454
3468
|
model: "base_import.import" /* BASE_IMPORT */,
|
|
@@ -3479,11 +3493,14 @@ function useExcelService() {
|
|
|
3479
3493
|
},
|
|
3480
3494
|
with_context: context
|
|
3481
3495
|
};
|
|
3482
|
-
return env.requests.post(
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3496
|
+
return env.requests.post(
|
|
3497
|
+
"/call" /* CALL_PATH */,
|
|
3498
|
+
jsonData,
|
|
3499
|
+
{
|
|
3500
|
+
headers: { "Content-Type": "application/json", "X-Node": xNode }
|
|
3501
|
+
},
|
|
3502
|
+
service
|
|
3503
|
+
);
|
|
3487
3504
|
},
|
|
3488
3505
|
[env]
|
|
3489
3506
|
);
|
|
@@ -3494,7 +3511,9 @@ function useExcelService() {
|
|
|
3494
3511
|
idFile,
|
|
3495
3512
|
options,
|
|
3496
3513
|
dryrun,
|
|
3497
|
-
context
|
|
3514
|
+
context,
|
|
3515
|
+
service,
|
|
3516
|
+
xNode
|
|
3498
3517
|
}) => {
|
|
3499
3518
|
const jsonData = {
|
|
3500
3519
|
model: "base_import.import" /* BASE_IMPORT */,
|
|
@@ -3508,11 +3527,14 @@ function useExcelService() {
|
|
|
3508
3527
|
},
|
|
3509
3528
|
with_context: context
|
|
3510
3529
|
};
|
|
3511
|
-
return env.requests.post(
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3530
|
+
return env.requests.post(
|
|
3531
|
+
"/call" /* CALL_PATH */,
|
|
3532
|
+
jsonData,
|
|
3533
|
+
{
|
|
3534
|
+
headers: { "Content-Type": "application/json", "X-Node": xNode }
|
|
3535
|
+
},
|
|
3536
|
+
service
|
|
3537
|
+
);
|
|
3516
3538
|
},
|
|
3517
3539
|
[env]
|
|
3518
3540
|
);
|
|
@@ -5127,6 +5149,34 @@ function useViewService() {
|
|
|
5127
5149
|
},
|
|
5128
5150
|
[env]
|
|
5129
5151
|
);
|
|
5152
|
+
const checkPayment = (0, import_react14.useCallback)(
|
|
5153
|
+
({
|
|
5154
|
+
model,
|
|
5155
|
+
ids,
|
|
5156
|
+
withContext,
|
|
5157
|
+
xNode,
|
|
5158
|
+
service
|
|
5159
|
+
}) => {
|
|
5160
|
+
const jsonData = {
|
|
5161
|
+
model,
|
|
5162
|
+
method: "check" /* CHECK */,
|
|
5163
|
+
ids,
|
|
5164
|
+
with_context: withContext
|
|
5165
|
+
};
|
|
5166
|
+
return env?.requests.post(
|
|
5167
|
+
"/call" /* CALL_PATH */,
|
|
5168
|
+
jsonData,
|
|
5169
|
+
{
|
|
5170
|
+
headers: {
|
|
5171
|
+
"Content-Type": "application/json",
|
|
5172
|
+
...xNode ? { "X-Node": xNode } : {}
|
|
5173
|
+
}
|
|
5174
|
+
},
|
|
5175
|
+
service
|
|
5176
|
+
);
|
|
5177
|
+
},
|
|
5178
|
+
[env]
|
|
5179
|
+
);
|
|
5130
5180
|
return {
|
|
5131
5181
|
getView,
|
|
5132
5182
|
getMenu,
|
|
@@ -5157,7 +5207,8 @@ function useViewService() {
|
|
|
5157
5207
|
manageOnChange,
|
|
5158
5208
|
getOrderLine,
|
|
5159
5209
|
getProductImage,
|
|
5160
|
-
addEntity
|
|
5210
|
+
addEntity,
|
|
5211
|
+
checkPayment
|
|
5161
5212
|
};
|
|
5162
5213
|
}
|
|
5163
5214
|
|
|
@@ -5445,12 +5496,16 @@ var useParsePreview = () => {
|
|
|
5445
5496
|
id,
|
|
5446
5497
|
selectedSheet,
|
|
5447
5498
|
isHeader,
|
|
5448
|
-
context
|
|
5499
|
+
context,
|
|
5500
|
+
service,
|
|
5501
|
+
xNode
|
|
5449
5502
|
}) => parsePreview({
|
|
5450
5503
|
id,
|
|
5451
5504
|
selectedSheet,
|
|
5452
5505
|
isHeader,
|
|
5453
|
-
context
|
|
5506
|
+
context,
|
|
5507
|
+
service,
|
|
5508
|
+
xNode
|
|
5454
5509
|
})
|
|
5455
5510
|
});
|
|
5456
5511
|
};
|
|
@@ -5461,8 +5516,14 @@ var import_react_query22 = require("@tanstack/react-query");
|
|
|
5461
5516
|
var useUploadFileExcel = () => {
|
|
5462
5517
|
const { uploadFileExcel } = useExcelService();
|
|
5463
5518
|
return (0, import_react_query22.useMutation)({
|
|
5464
|
-
mutationFn: ({
|
|
5465
|
-
formData
|
|
5519
|
+
mutationFn: ({
|
|
5520
|
+
formData,
|
|
5521
|
+
service,
|
|
5522
|
+
xNode
|
|
5523
|
+
}) => uploadFileExcel({
|
|
5524
|
+
formData,
|
|
5525
|
+
service,
|
|
5526
|
+
xNode
|
|
5466
5527
|
})
|
|
5467
5528
|
});
|
|
5468
5529
|
};
|
|
@@ -5491,14 +5552,18 @@ var useExecuteImport = () => {
|
|
|
5491
5552
|
idFile,
|
|
5492
5553
|
options,
|
|
5493
5554
|
dryrun,
|
|
5494
|
-
context
|
|
5555
|
+
context,
|
|
5556
|
+
service,
|
|
5557
|
+
xNode
|
|
5495
5558
|
}) => executeImport({
|
|
5496
5559
|
fields,
|
|
5497
5560
|
columns,
|
|
5498
5561
|
idFile,
|
|
5499
5562
|
options,
|
|
5500
5563
|
dryrun,
|
|
5501
|
-
context
|
|
5564
|
+
context,
|
|
5565
|
+
service,
|
|
5566
|
+
xNode
|
|
5502
5567
|
})
|
|
5503
5568
|
});
|
|
5504
5569
|
};
|
|
@@ -6875,11 +6940,36 @@ var useAddEntity = () => {
|
|
|
6875
6940
|
});
|
|
6876
6941
|
};
|
|
6877
6942
|
var use_add_entity_default = useAddEntity;
|
|
6943
|
+
|
|
6944
|
+
// src/hooks/view/use-check-payment.ts
|
|
6945
|
+
var import_react_query86 = require("@tanstack/react-query");
|
|
6946
|
+
var useCheckPayment = () => {
|
|
6947
|
+
const { checkPayment } = useViewService();
|
|
6948
|
+
return (0, import_react_query86.useMutation)({
|
|
6949
|
+
mutationFn: ({
|
|
6950
|
+
model,
|
|
6951
|
+
ids,
|
|
6952
|
+
withContext,
|
|
6953
|
+
xNode,
|
|
6954
|
+
service
|
|
6955
|
+
}) => {
|
|
6956
|
+
return checkPayment({
|
|
6957
|
+
model,
|
|
6958
|
+
ids,
|
|
6959
|
+
withContext,
|
|
6960
|
+
xNode,
|
|
6961
|
+
service
|
|
6962
|
+
});
|
|
6963
|
+
}
|
|
6964
|
+
});
|
|
6965
|
+
};
|
|
6966
|
+
var use_check_payment_default = useCheckPayment;
|
|
6878
6967
|
// Annotate the CommonJS export names for ESM import in node:
|
|
6879
6968
|
0 && (module.exports = {
|
|
6880
6969
|
useAddEntity,
|
|
6881
6970
|
useButton,
|
|
6882
6971
|
useChangeStatus,
|
|
6972
|
+
useCheckPayment,
|
|
6883
6973
|
useCreateEntity,
|
|
6884
6974
|
useCreateSession,
|
|
6885
6975
|
useDelete,
|
package/dist/hooks.mjs
CHANGED
|
@@ -1720,7 +1720,7 @@ function evaluate(ast, context = {}) {
|
|
|
1720
1720
|
return ast2.value;
|
|
1721
1721
|
case 5:
|
|
1722
1722
|
if (ast2.value in evalContext) {
|
|
1723
|
-
if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
|
|
1723
|
+
if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id && ast2?.value !== "parent") {
|
|
1724
1724
|
return evalContext[ast2.value]?.id;
|
|
1725
1725
|
}
|
|
1726
1726
|
return evalContext[ast2.value] ?? false;
|
|
@@ -1791,7 +1791,7 @@ function evaluate(ast, context = {}) {
|
|
|
1791
1791
|
} else if (typeof leftVal === "number") {
|
|
1792
1792
|
result = leftVal;
|
|
1793
1793
|
} else {
|
|
1794
|
-
result = leftVal[ast2.key];
|
|
1794
|
+
result = leftVal[ast2.key]?.id ?? leftVal[ast2.key];
|
|
1795
1795
|
}
|
|
1796
1796
|
if (typeof result === "function") {
|
|
1797
1797
|
const bound = result.bind(leftVal);
|
|
@@ -3308,8 +3308,19 @@ import { useCallback as useCallback5 } from "react";
|
|
|
3308
3308
|
function useExcelService() {
|
|
3309
3309
|
const { env } = useEnv();
|
|
3310
3310
|
const uploadFileExcel = useCallback5(
|
|
3311
|
-
async ({
|
|
3312
|
-
|
|
3311
|
+
async ({
|
|
3312
|
+
formData,
|
|
3313
|
+
service,
|
|
3314
|
+
xNode
|
|
3315
|
+
}) => {
|
|
3316
|
+
return env.requests.post(
|
|
3317
|
+
"/upload/file" /* UPLOAD_FILE_EXCEL_PATH */,
|
|
3318
|
+
formData,
|
|
3319
|
+
{
|
|
3320
|
+
headers: { "Content-Type": "application/json", "X-Node": xNode }
|
|
3321
|
+
},
|
|
3322
|
+
service
|
|
3323
|
+
);
|
|
3313
3324
|
},
|
|
3314
3325
|
[env]
|
|
3315
3326
|
);
|
|
@@ -3328,7 +3339,9 @@ function useExcelService() {
|
|
|
3328
3339
|
id,
|
|
3329
3340
|
selectedSheet,
|
|
3330
3341
|
isHeader,
|
|
3331
|
-
context
|
|
3342
|
+
context,
|
|
3343
|
+
service,
|
|
3344
|
+
xNode
|
|
3332
3345
|
}) => {
|
|
3333
3346
|
const jsonData = {
|
|
3334
3347
|
model: "base_import.import" /* BASE_IMPORT */,
|
|
@@ -3359,11 +3372,14 @@ function useExcelService() {
|
|
|
3359
3372
|
},
|
|
3360
3373
|
with_context: context
|
|
3361
3374
|
};
|
|
3362
|
-
return env.requests.post(
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3375
|
+
return env.requests.post(
|
|
3376
|
+
"/call" /* CALL_PATH */,
|
|
3377
|
+
jsonData,
|
|
3378
|
+
{
|
|
3379
|
+
headers: { "Content-Type": "application/json", "X-Node": xNode }
|
|
3380
|
+
},
|
|
3381
|
+
service
|
|
3382
|
+
);
|
|
3367
3383
|
},
|
|
3368
3384
|
[env]
|
|
3369
3385
|
);
|
|
@@ -3374,7 +3390,9 @@ function useExcelService() {
|
|
|
3374
3390
|
idFile,
|
|
3375
3391
|
options,
|
|
3376
3392
|
dryrun,
|
|
3377
|
-
context
|
|
3393
|
+
context,
|
|
3394
|
+
service,
|
|
3395
|
+
xNode
|
|
3378
3396
|
}) => {
|
|
3379
3397
|
const jsonData = {
|
|
3380
3398
|
model: "base_import.import" /* BASE_IMPORT */,
|
|
@@ -3388,11 +3406,14 @@ function useExcelService() {
|
|
|
3388
3406
|
},
|
|
3389
3407
|
with_context: context
|
|
3390
3408
|
};
|
|
3391
|
-
return env.requests.post(
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3409
|
+
return env.requests.post(
|
|
3410
|
+
"/call" /* CALL_PATH */,
|
|
3411
|
+
jsonData,
|
|
3412
|
+
{
|
|
3413
|
+
headers: { "Content-Type": "application/json", "X-Node": xNode }
|
|
3414
|
+
},
|
|
3415
|
+
service
|
|
3416
|
+
);
|
|
3396
3417
|
},
|
|
3397
3418
|
[env]
|
|
3398
3419
|
);
|
|
@@ -5007,6 +5028,34 @@ function useViewService() {
|
|
|
5007
5028
|
},
|
|
5008
5029
|
[env]
|
|
5009
5030
|
);
|
|
5031
|
+
const checkPayment = useCallback10(
|
|
5032
|
+
({
|
|
5033
|
+
model,
|
|
5034
|
+
ids,
|
|
5035
|
+
withContext,
|
|
5036
|
+
xNode,
|
|
5037
|
+
service
|
|
5038
|
+
}) => {
|
|
5039
|
+
const jsonData = {
|
|
5040
|
+
model,
|
|
5041
|
+
method: "check" /* CHECK */,
|
|
5042
|
+
ids,
|
|
5043
|
+
with_context: withContext
|
|
5044
|
+
};
|
|
5045
|
+
return env?.requests.post(
|
|
5046
|
+
"/call" /* CALL_PATH */,
|
|
5047
|
+
jsonData,
|
|
5048
|
+
{
|
|
5049
|
+
headers: {
|
|
5050
|
+
"Content-Type": "application/json",
|
|
5051
|
+
...xNode ? { "X-Node": xNode } : {}
|
|
5052
|
+
}
|
|
5053
|
+
},
|
|
5054
|
+
service
|
|
5055
|
+
);
|
|
5056
|
+
},
|
|
5057
|
+
[env]
|
|
5058
|
+
);
|
|
5010
5059
|
return {
|
|
5011
5060
|
getView,
|
|
5012
5061
|
getMenu,
|
|
@@ -5037,7 +5086,8 @@ function useViewService() {
|
|
|
5037
5086
|
manageOnChange,
|
|
5038
5087
|
getOrderLine,
|
|
5039
5088
|
getProductImage,
|
|
5040
|
-
addEntity
|
|
5089
|
+
addEntity,
|
|
5090
|
+
checkPayment
|
|
5041
5091
|
};
|
|
5042
5092
|
}
|
|
5043
5093
|
|
|
@@ -5325,12 +5375,16 @@ var useParsePreview = () => {
|
|
|
5325
5375
|
id,
|
|
5326
5376
|
selectedSheet,
|
|
5327
5377
|
isHeader,
|
|
5328
|
-
context
|
|
5378
|
+
context,
|
|
5379
|
+
service,
|
|
5380
|
+
xNode
|
|
5329
5381
|
}) => parsePreview({
|
|
5330
5382
|
id,
|
|
5331
5383
|
selectedSheet,
|
|
5332
5384
|
isHeader,
|
|
5333
|
-
context
|
|
5385
|
+
context,
|
|
5386
|
+
service,
|
|
5387
|
+
xNode
|
|
5334
5388
|
})
|
|
5335
5389
|
});
|
|
5336
5390
|
};
|
|
@@ -5341,8 +5395,14 @@ import { useMutation as useMutation18 } from "@tanstack/react-query";
|
|
|
5341
5395
|
var useUploadFileExcel = () => {
|
|
5342
5396
|
const { uploadFileExcel } = useExcelService();
|
|
5343
5397
|
return useMutation18({
|
|
5344
|
-
mutationFn: ({
|
|
5345
|
-
formData
|
|
5398
|
+
mutationFn: ({
|
|
5399
|
+
formData,
|
|
5400
|
+
service,
|
|
5401
|
+
xNode
|
|
5402
|
+
}) => uploadFileExcel({
|
|
5403
|
+
formData,
|
|
5404
|
+
service,
|
|
5405
|
+
xNode
|
|
5346
5406
|
})
|
|
5347
5407
|
});
|
|
5348
5408
|
};
|
|
@@ -5371,14 +5431,18 @@ var useExecuteImport = () => {
|
|
|
5371
5431
|
idFile,
|
|
5372
5432
|
options,
|
|
5373
5433
|
dryrun,
|
|
5374
|
-
context
|
|
5434
|
+
context,
|
|
5435
|
+
service,
|
|
5436
|
+
xNode
|
|
5375
5437
|
}) => executeImport({
|
|
5376
5438
|
fields,
|
|
5377
5439
|
columns,
|
|
5378
5440
|
idFile,
|
|
5379
5441
|
options,
|
|
5380
5442
|
dryrun,
|
|
5381
|
-
context
|
|
5443
|
+
context,
|
|
5444
|
+
service,
|
|
5445
|
+
xNode
|
|
5382
5446
|
})
|
|
5383
5447
|
});
|
|
5384
5448
|
};
|
|
@@ -6755,10 +6819,35 @@ var useAddEntity = () => {
|
|
|
6755
6819
|
});
|
|
6756
6820
|
};
|
|
6757
6821
|
var use_add_entity_default = useAddEntity;
|
|
6822
|
+
|
|
6823
|
+
// src/hooks/view/use-check-payment.ts
|
|
6824
|
+
import { useMutation as useMutation64 } from "@tanstack/react-query";
|
|
6825
|
+
var useCheckPayment = () => {
|
|
6826
|
+
const { checkPayment } = useViewService();
|
|
6827
|
+
return useMutation64({
|
|
6828
|
+
mutationFn: ({
|
|
6829
|
+
model,
|
|
6830
|
+
ids,
|
|
6831
|
+
withContext,
|
|
6832
|
+
xNode,
|
|
6833
|
+
service
|
|
6834
|
+
}) => {
|
|
6835
|
+
return checkPayment({
|
|
6836
|
+
model,
|
|
6837
|
+
ids,
|
|
6838
|
+
withContext,
|
|
6839
|
+
xNode,
|
|
6840
|
+
service
|
|
6841
|
+
});
|
|
6842
|
+
}
|
|
6843
|
+
});
|
|
6844
|
+
};
|
|
6845
|
+
var use_check_payment_default = useCheckPayment;
|
|
6758
6846
|
export {
|
|
6759
6847
|
use_add_entity_default as useAddEntity,
|
|
6760
6848
|
use_button_default as useButton,
|
|
6761
6849
|
use_change_status_default as useChangeStatus,
|
|
6850
|
+
use_check_payment_default as useCheckPayment,
|
|
6762
6851
|
use_create_entity_default as useCreateEntity,
|
|
6763
6852
|
use_create_session_default as useCreateSession,
|
|
6764
6853
|
use_delete_default as useDelete,
|