@fctc/interface-logic 3.0.3 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/configs.d.mts +6 -6
- package/dist/configs.d.ts +6 -6
- package/dist/configs.js +68 -34
- package/dist/configs.mjs +68 -34
- package/dist/constants.d.mts +1 -2
- package/dist/constants.d.ts +1 -2
- package/dist/constants.js +0 -1
- package/dist/constants.mjs +0 -1
- package/dist/environment.d.mts +8 -5
- package/dist/environment.d.ts +8 -5
- package/dist/environment.js +70 -36
- package/dist/environment.mjs +70 -36
- package/dist/hooks.d.mts +5 -19
- package/dist/hooks.d.ts +5 -19
- package/dist/hooks.js +29 -127
- package/dist/hooks.mjs +29 -125
- package/dist/{session-storage-ARp_lhTD.d.mts → local-storage-BPvoMGYJ.d.mts} +1 -6
- package/dist/{session-storage-ARp_lhTD.d.ts → local-storage-BPvoMGYJ.d.ts} +1 -6
- package/dist/provider.d.mts +5 -6
- package/dist/provider.d.ts +5 -6
- package/dist/provider.js +132 -196
- package/dist/provider.mjs +132 -196
- package/dist/services.d.mts +2 -16
- package/dist/services.d.ts +2 -16
- package/dist/services.js +25 -77
- package/dist/services.mjs +25 -77
- package/dist/utils.d.mts +15 -1
- package/dist/utils.d.ts +15 -1
- package/dist/utils.js +43 -0
- package/dist/utils.mjs +42 -0
- package/package.json +1 -1
package/dist/environment.mjs
CHANGED
|
@@ -2162,24 +2162,56 @@ var localStorageUtils = () => {
|
|
|
2162
2162
|
};
|
|
2163
2163
|
|
|
2164
2164
|
// src/utils/storage/session-storage.ts
|
|
2165
|
-
var sessionStorageUtils = () => {
|
|
2166
|
-
const
|
|
2167
|
-
|
|
2165
|
+
var sessionStorageUtils = /* @__PURE__ */ (() => {
|
|
2166
|
+
const getMenuFocus = () => {
|
|
2167
|
+
const menuFocus = sessionStorage.getItem("menuFocus");
|
|
2168
|
+
return menuFocus ? JSON.parse(menuFocus) : {
|
|
2169
|
+
id: void 0,
|
|
2170
|
+
service: ""
|
|
2171
|
+
};
|
|
2172
|
+
};
|
|
2173
|
+
const setMenuFocus = (menuTree) => {
|
|
2174
|
+
sessionStorage.setItem("menuFocus", JSON.stringify({ ...menuTree }));
|
|
2175
|
+
};
|
|
2176
|
+
const getActionData = () => {
|
|
2177
|
+
const actionData = sessionStorage.getItem("actionData");
|
|
2178
|
+
return actionData ? JSON.parse(actionData) : {};
|
|
2179
|
+
};
|
|
2180
|
+
const setActionData = (actData) => {
|
|
2181
|
+
sessionStorage.setItem("actionData", JSON.stringify(actData));
|
|
2182
|
+
};
|
|
2183
|
+
const getViewData = () => {
|
|
2184
|
+
const viewData = sessionStorage.getItem("viewData");
|
|
2185
|
+
return viewData ? JSON.parse(viewData) : {};
|
|
2186
|
+
};
|
|
2187
|
+
const getBrowserSession = () => {
|
|
2188
|
+
const actionData = sessionStorage.getItem("browserSession");
|
|
2189
|
+
return actionData ? JSON.parse(actionData) : null;
|
|
2190
|
+
};
|
|
2191
|
+
const setViewData = (viewData) => {
|
|
2192
|
+
sessionStorage.setItem("viewData", JSON.stringify(viewData));
|
|
2168
2193
|
};
|
|
2169
2194
|
return {
|
|
2195
|
+
getMenuFocus,
|
|
2196
|
+
setMenuFocus,
|
|
2197
|
+
setActionData,
|
|
2198
|
+
getActionData,
|
|
2199
|
+
getViewData,
|
|
2200
|
+
setViewData,
|
|
2170
2201
|
getBrowserSession
|
|
2171
2202
|
};
|
|
2172
|
-
};
|
|
2203
|
+
})();
|
|
2173
2204
|
|
|
2174
2205
|
// src/configs/axios-client.ts
|
|
2175
2206
|
var axiosClient = {
|
|
2176
2207
|
init(config) {
|
|
2177
2208
|
const localStorage2 = config?.localStorageUtils ?? localStorageUtils();
|
|
2178
|
-
const sessionStorage2 = config?.sessionStorageUtils ?? sessionStorageUtils
|
|
2209
|
+
const sessionStorage2 = config?.sessionStorageUtils ?? sessionStorageUtils;
|
|
2179
2210
|
const db = config?.db;
|
|
2180
2211
|
const database = config?.config?.database;
|
|
2181
2212
|
let isRefreshing = false;
|
|
2182
2213
|
let failedQueue = [];
|
|
2214
|
+
const xNode = config?.xNode;
|
|
2183
2215
|
const processQueue = (error, token = null) => {
|
|
2184
2216
|
failedQueue?.forEach((prom) => {
|
|
2185
2217
|
if (error) {
|
|
@@ -2334,46 +2366,48 @@ var axiosClient = {
|
|
|
2334
2366
|
function formatUrl(url, db2) {
|
|
2335
2367
|
return url + (db2 ? "?db=" + db2 : "");
|
|
2336
2368
|
}
|
|
2337
|
-
const getBaseUrl = (baseUrl,
|
|
2338
|
-
|
|
2339
|
-
|
|
2369
|
+
const getBaseUrl = (baseUrl, hardService) => {
|
|
2370
|
+
return `${baseUrl.replace(/\/$/, "")}/${hardService ?? (sessionStorage2.getMenuFocus().service || config?.default_service)}/api/v2`;
|
|
2371
|
+
};
|
|
2372
|
+
const getHeaders = (header) => {
|
|
2373
|
+
const headers = {
|
|
2374
|
+
...header,
|
|
2375
|
+
...xNode ? { "X-Node": xNode } : {}
|
|
2376
|
+
};
|
|
2377
|
+
return headers;
|
|
2340
2378
|
};
|
|
2341
2379
|
const responseBody = (response) => response;
|
|
2342
2380
|
const requests = {
|
|
2343
|
-
get: (url, headers,
|
|
2344
|
-
formatUrl(getBaseUrl(config?.baseUrl,
|
|
2345
|
-
headers
|
|
2381
|
+
get: (url, headers, hardService) => instance.get(
|
|
2382
|
+
formatUrl(getBaseUrl(config?.baseUrl, hardService) + url, db),
|
|
2383
|
+
getHeaders(headers)
|
|
2346
2384
|
).then(responseBody),
|
|
2347
|
-
post: async (url, body, headers,
|
|
2348
|
-
formatUrl(getBaseUrl(config?.baseUrl,
|
|
2385
|
+
post: async (url, body, headers, hardService) => instance.post(
|
|
2386
|
+
formatUrl(getBaseUrl(config?.baseUrl, hardService) + url, db),
|
|
2349
2387
|
body,
|
|
2350
|
-
headers
|
|
2388
|
+
getHeaders(headers)
|
|
2351
2389
|
).then(responseBody),
|
|
2352
|
-
post_excel: (url, body, headers
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
headers
|
|
2358
|
-
"Content-Type": typeof window !== "undefined" ? "application/json" : "application/javascript",
|
|
2359
|
-
Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
2360
|
-
...headers
|
|
2361
|
-
}
|
|
2390
|
+
post_excel: (url, body, headers) => instance.post(formatUrl(getBaseUrl(config?.baseUrl) + url, db), body, {
|
|
2391
|
+
responseType: "arraybuffer",
|
|
2392
|
+
headers: {
|
|
2393
|
+
"Content-Type": typeof window !== "undefined" ? "application/json" : "application/javascript",
|
|
2394
|
+
Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
2395
|
+
...headers
|
|
2362
2396
|
}
|
|
2363
|
-
).then(responseBody),
|
|
2364
|
-
put: (url, body, headers,
|
|
2365
|
-
formatUrl(getBaseUrl(config?.baseUrl,
|
|
2397
|
+
}).then(responseBody),
|
|
2398
|
+
put: (url, body, headers, hardService) => instance.put(
|
|
2399
|
+
formatUrl(getBaseUrl(config?.baseUrl, hardService) + url, db),
|
|
2366
2400
|
body,
|
|
2367
|
-
headers
|
|
2401
|
+
getHeaders(headers)
|
|
2368
2402
|
).then(responseBody),
|
|
2369
|
-
patch: (url, body, headers,
|
|
2370
|
-
formatUrl(getBaseUrl(config?.baseUrl,
|
|
2403
|
+
patch: (url, body, headers, hardService) => instance.patch(
|
|
2404
|
+
formatUrl(getBaseUrl(config?.baseUrl, hardService) + url, db),
|
|
2371
2405
|
body,
|
|
2372
|
-
headers
|
|
2406
|
+
getHeaders(headers)
|
|
2373
2407
|
).then(responseBody),
|
|
2374
|
-
delete: (url, headers,
|
|
2375
|
-
formatUrl(getBaseUrl(config?.baseUrl,
|
|
2376
|
-
headers
|
|
2408
|
+
delete: (url, headers, hardService) => instance.delete(
|
|
2409
|
+
formatUrl(getBaseUrl(config?.baseUrl, hardService) + url, db),
|
|
2410
|
+
getHeaders(headers)
|
|
2377
2411
|
).then(responseBody)
|
|
2378
2412
|
};
|
|
2379
2413
|
return requests;
|
|
@@ -2400,7 +2434,7 @@ var EnvStore = class {
|
|
|
2400
2434
|
emitter;
|
|
2401
2435
|
localStorageUtil;
|
|
2402
2436
|
sessionStorageUtil;
|
|
2403
|
-
constructor(localStorageUtil = localStorageUtils(), sessionStorageUtil = sessionStorageUtils
|
|
2437
|
+
constructor(localStorageUtil = localStorageUtils(), sessionStorageUtil = sessionStorageUtils) {
|
|
2404
2438
|
this.state = {
|
|
2405
2439
|
baseUrl: "",
|
|
2406
2440
|
requests: null,
|
|
@@ -2489,7 +2523,7 @@ var EnvStore = class {
|
|
|
2489
2523
|
var env = null;
|
|
2490
2524
|
function initEnv({
|
|
2491
2525
|
localStorageUtils: localStorageUtil = localStorageUtils(),
|
|
2492
|
-
sessionStorageUtils: sessionStorageUtil = sessionStorageUtils
|
|
2526
|
+
sessionStorageUtils: sessionStorageUtil = sessionStorageUtils
|
|
2493
2527
|
}) {
|
|
2494
2528
|
if (!env) {
|
|
2495
2529
|
env = new EnvStore(localStorageUtil, sessionStorageUtil);
|
package/dist/hooks.d.mts
CHANGED
|
@@ -44,7 +44,9 @@ declare const useValidateActionToken: () => _tanstack_react_query.UseMutationRes
|
|
|
44
44
|
|
|
45
45
|
declare const useGetCompanyInfo: () => _tanstack_react_query.UseMutationResult<any, Error, number, unknown>;
|
|
46
46
|
|
|
47
|
-
declare const useGetCurrentCompany: (
|
|
47
|
+
declare const useGetCurrentCompany: ({ service }: {
|
|
48
|
+
service?: string;
|
|
49
|
+
}) => _tanstack_react_query.UseMutationResult<any, Error, void, unknown>;
|
|
48
50
|
|
|
49
51
|
declare const useGetListCompany: (companyIDs?: number[]) => _tanstack_react_query.UseQueryResult<any, Error>;
|
|
50
52
|
|
|
@@ -224,7 +226,7 @@ declare const useSave: () => _tanstack_react_query.UseMutationResult<any, Error,
|
|
|
224
226
|
xNode?: string;
|
|
225
227
|
}, unknown>;
|
|
226
228
|
|
|
227
|
-
declare const useGetProfile: (path?: string) => _tanstack_react_query.UseMutationResult<any, Error, void, unknown>;
|
|
229
|
+
declare const useGetProfile: (path?: string, service?: string) => _tanstack_react_query.UseMutationResult<any, Error, void, unknown>;
|
|
228
230
|
|
|
229
231
|
declare const useGetUser: () => _tanstack_react_query.UseMutationResult<any, Error, {
|
|
230
232
|
id: any;
|
|
@@ -524,20 +526,4 @@ declare const useCheckPayment: () => _tanstack_react_query.UseMutationResult<unk
|
|
|
524
526
|
xNode: string;
|
|
525
527
|
}, unknown>;
|
|
526
528
|
|
|
527
|
-
|
|
528
|
-
model: string;
|
|
529
|
-
ids: any;
|
|
530
|
-
service: string;
|
|
531
|
-
xNode: string;
|
|
532
|
-
}, unknown>;
|
|
533
|
-
|
|
534
|
-
declare const useGetDetailEntity: () => _tanstack_react_query.UseMutationResult<unknown, Error, {
|
|
535
|
-
model: string;
|
|
536
|
-
ids: any;
|
|
537
|
-
method: string;
|
|
538
|
-
service: string;
|
|
539
|
-
xNode: string;
|
|
540
|
-
kwargs: any;
|
|
541
|
-
}, unknown>;
|
|
542
|
-
|
|
543
|
-
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, useGetDataCloseSession, useGetDetail, useGetDetailEntity, 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 };
|
|
529
|
+
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
|
@@ -44,7 +44,9 @@ declare const useValidateActionToken: () => _tanstack_react_query.UseMutationRes
|
|
|
44
44
|
|
|
45
45
|
declare const useGetCompanyInfo: () => _tanstack_react_query.UseMutationResult<any, Error, number, unknown>;
|
|
46
46
|
|
|
47
|
-
declare const useGetCurrentCompany: (
|
|
47
|
+
declare const useGetCurrentCompany: ({ service }: {
|
|
48
|
+
service?: string;
|
|
49
|
+
}) => _tanstack_react_query.UseMutationResult<any, Error, void, unknown>;
|
|
48
50
|
|
|
49
51
|
declare const useGetListCompany: (companyIDs?: number[]) => _tanstack_react_query.UseQueryResult<any, Error>;
|
|
50
52
|
|
|
@@ -224,7 +226,7 @@ declare const useSave: () => _tanstack_react_query.UseMutationResult<any, Error,
|
|
|
224
226
|
xNode?: string;
|
|
225
227
|
}, unknown>;
|
|
226
228
|
|
|
227
|
-
declare const useGetProfile: (path?: string) => _tanstack_react_query.UseMutationResult<any, Error, void, unknown>;
|
|
229
|
+
declare const useGetProfile: (path?: string, service?: string) => _tanstack_react_query.UseMutationResult<any, Error, void, unknown>;
|
|
228
230
|
|
|
229
231
|
declare const useGetUser: () => _tanstack_react_query.UseMutationResult<any, Error, {
|
|
230
232
|
id: any;
|
|
@@ -524,20 +526,4 @@ declare const useCheckPayment: () => _tanstack_react_query.UseMutationResult<unk
|
|
|
524
526
|
xNode: string;
|
|
525
527
|
}, unknown>;
|
|
526
528
|
|
|
527
|
-
|
|
528
|
-
model: string;
|
|
529
|
-
ids: any;
|
|
530
|
-
service: string;
|
|
531
|
-
xNode: string;
|
|
532
|
-
}, unknown>;
|
|
533
|
-
|
|
534
|
-
declare const useGetDetailEntity: () => _tanstack_react_query.UseMutationResult<unknown, Error, {
|
|
535
|
-
model: string;
|
|
536
|
-
ids: any;
|
|
537
|
-
method: string;
|
|
538
|
-
service: string;
|
|
539
|
-
xNode: string;
|
|
540
|
-
kwargs: any;
|
|
541
|
-
}, unknown>;
|
|
542
|
-
|
|
543
|
-
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, useGetDataCloseSession, useGetDetail, useGetDetailEntity, 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 };
|
|
529
|
+
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
|
@@ -56,9 +56,7 @@ __export(hooks_exports, {
|
|
|
56
56
|
useGetConversionRate: () => use_get_conversion_rate_default,
|
|
57
57
|
useGetCurrency: () => use_get_currency_default,
|
|
58
58
|
useGetCurrentCompany: () => use_get_current_company_default,
|
|
59
|
-
useGetDataCloseSession: () => use_get_data_close_session_default,
|
|
60
59
|
useGetDetail: () => use_get_detail_default,
|
|
61
|
-
useGetDetailEntity: () => use_get_detail_entity_default,
|
|
62
60
|
useGetFieldExport: () => use_get_field_export_default,
|
|
63
61
|
useGetFieldOnChange: () => use_get_field_onchange_default,
|
|
64
62
|
useGetFileExcel: () => use_get_file_excel_default,
|
|
@@ -3389,13 +3387,20 @@ function useAuthService() {
|
|
|
3389
3387
|
var import_react8 = require("react");
|
|
3390
3388
|
function useCompanyService() {
|
|
3391
3389
|
const { env } = useEnv();
|
|
3392
|
-
const getCurrentCompany = (0, import_react8.useCallback)(
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
"
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3390
|
+
const getCurrentCompany = (0, import_react8.useCallback)(
|
|
3391
|
+
async (service) => {
|
|
3392
|
+
return await env.requests.get(
|
|
3393
|
+
"/company" /* COMPANY_PATH */,
|
|
3394
|
+
{
|
|
3395
|
+
headers: {
|
|
3396
|
+
"Content-Type": "application/json"
|
|
3397
|
+
}
|
|
3398
|
+
},
|
|
3399
|
+
service
|
|
3400
|
+
);
|
|
3401
|
+
},
|
|
3402
|
+
[env]
|
|
3403
|
+
);
|
|
3399
3404
|
const getInfoCompany = (0, import_react8.useCallback)(
|
|
3400
3405
|
async (id) => {
|
|
3401
3406
|
const jsonData = {
|
|
@@ -4256,12 +4261,16 @@ var import_react13 = require("react");
|
|
|
4256
4261
|
function useUserService() {
|
|
4257
4262
|
const { env } = useEnv();
|
|
4258
4263
|
const getProfile = (0, import_react13.useCallback)(
|
|
4259
|
-
async (path) => {
|
|
4260
|
-
return env?.requests?.get(
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4264
|
+
async (path, service) => {
|
|
4265
|
+
return env?.requests?.get(
|
|
4266
|
+
path ?? "/userinfo" /* PROFILE_PATH */,
|
|
4267
|
+
{
|
|
4268
|
+
headers: {
|
|
4269
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
4270
|
+
}
|
|
4271
|
+
},
|
|
4272
|
+
service
|
|
4273
|
+
);
|
|
4265
4274
|
},
|
|
4266
4275
|
[env]
|
|
4267
4276
|
);
|
|
@@ -5215,61 +5224,6 @@ function useViewService() {
|
|
|
5215
5224
|
},
|
|
5216
5225
|
[env]
|
|
5217
5226
|
);
|
|
5218
|
-
const getDataCloseSession = (0, import_react14.useCallback)(
|
|
5219
|
-
({
|
|
5220
|
-
model,
|
|
5221
|
-
ids,
|
|
5222
|
-
xNode,
|
|
5223
|
-
service
|
|
5224
|
-
}) => {
|
|
5225
|
-
const jsonData = {
|
|
5226
|
-
model,
|
|
5227
|
-
ids,
|
|
5228
|
-
method: "get_closing_control_data" /* GET_CLOSING_CONTROL_DATA */
|
|
5229
|
-
};
|
|
5230
|
-
return env?.requests.post(
|
|
5231
|
-
"/call" /* CALL_PATH */,
|
|
5232
|
-
jsonData,
|
|
5233
|
-
{
|
|
5234
|
-
headers: {
|
|
5235
|
-
"Content-Type": "application/json",
|
|
5236
|
-
...xNode ? { "X-Node": xNode } : {}
|
|
5237
|
-
}
|
|
5238
|
-
},
|
|
5239
|
-
service
|
|
5240
|
-
);
|
|
5241
|
-
},
|
|
5242
|
-
[env]
|
|
5243
|
-
);
|
|
5244
|
-
const getDetailEntity = (0, import_react14.useCallback)(
|
|
5245
|
-
({
|
|
5246
|
-
model,
|
|
5247
|
-
ids,
|
|
5248
|
-
method,
|
|
5249
|
-
xNode,
|
|
5250
|
-
service,
|
|
5251
|
-
kwargs
|
|
5252
|
-
}) => {
|
|
5253
|
-
const jsonData = {
|
|
5254
|
-
model,
|
|
5255
|
-
ids,
|
|
5256
|
-
method,
|
|
5257
|
-
kwargs
|
|
5258
|
-
};
|
|
5259
|
-
return env?.requests.post(
|
|
5260
|
-
"/call" /* CALL_PATH */,
|
|
5261
|
-
jsonData,
|
|
5262
|
-
{
|
|
5263
|
-
headers: {
|
|
5264
|
-
"Content-Type": "application/json",
|
|
5265
|
-
...xNode ? { "X-Node": xNode } : {}
|
|
5266
|
-
}
|
|
5267
|
-
},
|
|
5268
|
-
service
|
|
5269
|
-
);
|
|
5270
|
-
},
|
|
5271
|
-
[env]
|
|
5272
|
-
);
|
|
5273
5227
|
return {
|
|
5274
5228
|
getView,
|
|
5275
5229
|
getMenu,
|
|
@@ -5301,9 +5255,7 @@ function useViewService() {
|
|
|
5301
5255
|
getOrderLine,
|
|
5302
5256
|
getProductImage,
|
|
5303
5257
|
addEntity,
|
|
5304
|
-
checkPayment
|
|
5305
|
-
getDataCloseSession,
|
|
5306
|
-
getDetailEntity
|
|
5258
|
+
checkPayment
|
|
5307
5259
|
};
|
|
5308
5260
|
}
|
|
5309
5261
|
|
|
@@ -5474,10 +5426,10 @@ var use_get_company_info_default = useGetCompanyInfo;
|
|
|
5474
5426
|
|
|
5475
5427
|
// src/hooks/company/use-get-current-company.ts
|
|
5476
5428
|
var import_react_query16 = require("@tanstack/react-query");
|
|
5477
|
-
var useGetCurrentCompany = () => {
|
|
5429
|
+
var useGetCurrentCompany = ({ service }) => {
|
|
5478
5430
|
const { getCurrentCompany } = useCompanyService();
|
|
5479
5431
|
return (0, import_react_query16.useMutation)({
|
|
5480
|
-
mutationFn: () => getCurrentCompany()
|
|
5432
|
+
mutationFn: () => getCurrentCompany(service)
|
|
5481
5433
|
});
|
|
5482
5434
|
};
|
|
5483
5435
|
var use_get_current_company_default = useGetCurrentCompany;
|
|
@@ -6120,10 +6072,10 @@ var use_save_default = useSave;
|
|
|
6120
6072
|
|
|
6121
6073
|
// src/hooks/user/use-get-profile.ts
|
|
6122
6074
|
var import_react_query42 = require("@tanstack/react-query");
|
|
6123
|
-
var useGetProfile = (path) => {
|
|
6075
|
+
var useGetProfile = (path, service) => {
|
|
6124
6076
|
const { getProfile } = useUserService();
|
|
6125
6077
|
return (0, import_react_query42.useMutation)({
|
|
6126
|
-
mutationFn: () => getProfile(path)
|
|
6078
|
+
mutationFn: () => getProfile(path, service)
|
|
6127
6079
|
});
|
|
6128
6080
|
};
|
|
6129
6081
|
var use_get_profile_default = useGetProfile;
|
|
@@ -7079,54 +7031,6 @@ var useCheckPayment = () => {
|
|
|
7079
7031
|
});
|
|
7080
7032
|
};
|
|
7081
7033
|
var use_check_payment_default = useCheckPayment;
|
|
7082
|
-
|
|
7083
|
-
// src/hooks/view/use-get-data-close-session.ts
|
|
7084
|
-
var import_react_query87 = require("@tanstack/react-query");
|
|
7085
|
-
var useGetDataCloseSession = () => {
|
|
7086
|
-
const { getDataCloseSession } = useViewService();
|
|
7087
|
-
return (0, import_react_query87.useMutation)({
|
|
7088
|
-
mutationFn: ({
|
|
7089
|
-
model,
|
|
7090
|
-
ids,
|
|
7091
|
-
xNode,
|
|
7092
|
-
service
|
|
7093
|
-
}) => {
|
|
7094
|
-
return getDataCloseSession({
|
|
7095
|
-
model,
|
|
7096
|
-
ids,
|
|
7097
|
-
xNode,
|
|
7098
|
-
service
|
|
7099
|
-
});
|
|
7100
|
-
}
|
|
7101
|
-
});
|
|
7102
|
-
};
|
|
7103
|
-
var use_get_data_close_session_default = useGetDataCloseSession;
|
|
7104
|
-
|
|
7105
|
-
// src/hooks/view/use-get-detail-entity.ts
|
|
7106
|
-
var import_react_query88 = require("@tanstack/react-query");
|
|
7107
|
-
var useGetDetailEntity = () => {
|
|
7108
|
-
const { getDetailEntity } = useViewService();
|
|
7109
|
-
return (0, import_react_query88.useMutation)({
|
|
7110
|
-
mutationFn: ({
|
|
7111
|
-
model,
|
|
7112
|
-
ids,
|
|
7113
|
-
method,
|
|
7114
|
-
xNode,
|
|
7115
|
-
service,
|
|
7116
|
-
kwargs
|
|
7117
|
-
}) => {
|
|
7118
|
-
return getDetailEntity({
|
|
7119
|
-
model,
|
|
7120
|
-
ids,
|
|
7121
|
-
method,
|
|
7122
|
-
xNode,
|
|
7123
|
-
service,
|
|
7124
|
-
kwargs
|
|
7125
|
-
});
|
|
7126
|
-
}
|
|
7127
|
-
});
|
|
7128
|
-
};
|
|
7129
|
-
var use_get_detail_entity_default = useGetDetailEntity;
|
|
7130
7034
|
// Annotate the CommonJS export names for ESM import in node:
|
|
7131
7035
|
0 && (module.exports = {
|
|
7132
7036
|
useAddEntity,
|
|
@@ -7155,9 +7059,7 @@ var use_get_detail_entity_default = useGetDetailEntity;
|
|
|
7155
7059
|
useGetConversionRate,
|
|
7156
7060
|
useGetCurrency,
|
|
7157
7061
|
useGetCurrentCompany,
|
|
7158
|
-
useGetDataCloseSession,
|
|
7159
7062
|
useGetDetail,
|
|
7160
|
-
useGetDetailEntity,
|
|
7161
7063
|
useGetFieldExport,
|
|
7162
7064
|
useGetFieldOnChange,
|
|
7163
7065
|
useGetFileExcel,
|
package/dist/hooks.mjs
CHANGED
|
@@ -3266,13 +3266,20 @@ function useAuthService() {
|
|
|
3266
3266
|
import { useCallback as useCallback4 } from "react";
|
|
3267
3267
|
function useCompanyService() {
|
|
3268
3268
|
const { env } = useEnv();
|
|
3269
|
-
const getCurrentCompany = useCallback4(
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
"
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3269
|
+
const getCurrentCompany = useCallback4(
|
|
3270
|
+
async (service) => {
|
|
3271
|
+
return await env.requests.get(
|
|
3272
|
+
"/company" /* COMPANY_PATH */,
|
|
3273
|
+
{
|
|
3274
|
+
headers: {
|
|
3275
|
+
"Content-Type": "application/json"
|
|
3276
|
+
}
|
|
3277
|
+
},
|
|
3278
|
+
service
|
|
3279
|
+
);
|
|
3280
|
+
},
|
|
3281
|
+
[env]
|
|
3282
|
+
);
|
|
3276
3283
|
const getInfoCompany = useCallback4(
|
|
3277
3284
|
async (id) => {
|
|
3278
3285
|
const jsonData = {
|
|
@@ -4133,12 +4140,16 @@ import { useCallback as useCallback9 } from "react";
|
|
|
4133
4140
|
function useUserService() {
|
|
4134
4141
|
const { env } = useEnv();
|
|
4135
4142
|
const getProfile = useCallback9(
|
|
4136
|
-
async (path) => {
|
|
4137
|
-
return env?.requests?.get(
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4143
|
+
async (path, service) => {
|
|
4144
|
+
return env?.requests?.get(
|
|
4145
|
+
path ?? "/userinfo" /* PROFILE_PATH */,
|
|
4146
|
+
{
|
|
4147
|
+
headers: {
|
|
4148
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
4149
|
+
}
|
|
4150
|
+
},
|
|
4151
|
+
service
|
|
4152
|
+
);
|
|
4142
4153
|
},
|
|
4143
4154
|
[env]
|
|
4144
4155
|
);
|
|
@@ -5092,61 +5103,6 @@ function useViewService() {
|
|
|
5092
5103
|
},
|
|
5093
5104
|
[env]
|
|
5094
5105
|
);
|
|
5095
|
-
const getDataCloseSession = useCallback10(
|
|
5096
|
-
({
|
|
5097
|
-
model,
|
|
5098
|
-
ids,
|
|
5099
|
-
xNode,
|
|
5100
|
-
service
|
|
5101
|
-
}) => {
|
|
5102
|
-
const jsonData = {
|
|
5103
|
-
model,
|
|
5104
|
-
ids,
|
|
5105
|
-
method: "get_closing_control_data" /* GET_CLOSING_CONTROL_DATA */
|
|
5106
|
-
};
|
|
5107
|
-
return env?.requests.post(
|
|
5108
|
-
"/call" /* CALL_PATH */,
|
|
5109
|
-
jsonData,
|
|
5110
|
-
{
|
|
5111
|
-
headers: {
|
|
5112
|
-
"Content-Type": "application/json",
|
|
5113
|
-
...xNode ? { "X-Node": xNode } : {}
|
|
5114
|
-
}
|
|
5115
|
-
},
|
|
5116
|
-
service
|
|
5117
|
-
);
|
|
5118
|
-
},
|
|
5119
|
-
[env]
|
|
5120
|
-
);
|
|
5121
|
-
const getDetailEntity = useCallback10(
|
|
5122
|
-
({
|
|
5123
|
-
model,
|
|
5124
|
-
ids,
|
|
5125
|
-
method,
|
|
5126
|
-
xNode,
|
|
5127
|
-
service,
|
|
5128
|
-
kwargs
|
|
5129
|
-
}) => {
|
|
5130
|
-
const jsonData = {
|
|
5131
|
-
model,
|
|
5132
|
-
ids,
|
|
5133
|
-
method,
|
|
5134
|
-
kwargs
|
|
5135
|
-
};
|
|
5136
|
-
return env?.requests.post(
|
|
5137
|
-
"/call" /* CALL_PATH */,
|
|
5138
|
-
jsonData,
|
|
5139
|
-
{
|
|
5140
|
-
headers: {
|
|
5141
|
-
"Content-Type": "application/json",
|
|
5142
|
-
...xNode ? { "X-Node": xNode } : {}
|
|
5143
|
-
}
|
|
5144
|
-
},
|
|
5145
|
-
service
|
|
5146
|
-
);
|
|
5147
|
-
},
|
|
5148
|
-
[env]
|
|
5149
|
-
);
|
|
5150
5106
|
return {
|
|
5151
5107
|
getView,
|
|
5152
5108
|
getMenu,
|
|
@@ -5178,9 +5134,7 @@ function useViewService() {
|
|
|
5178
5134
|
getOrderLine,
|
|
5179
5135
|
getProductImage,
|
|
5180
5136
|
addEntity,
|
|
5181
|
-
checkPayment
|
|
5182
|
-
getDataCloseSession,
|
|
5183
|
-
getDetailEntity
|
|
5137
|
+
checkPayment
|
|
5184
5138
|
};
|
|
5185
5139
|
}
|
|
5186
5140
|
|
|
@@ -5351,10 +5305,10 @@ var use_get_company_info_default = useGetCompanyInfo;
|
|
|
5351
5305
|
|
|
5352
5306
|
// src/hooks/company/use-get-current-company.ts
|
|
5353
5307
|
import { useMutation as useMutation14 } from "@tanstack/react-query";
|
|
5354
|
-
var useGetCurrentCompany = () => {
|
|
5308
|
+
var useGetCurrentCompany = ({ service }) => {
|
|
5355
5309
|
const { getCurrentCompany } = useCompanyService();
|
|
5356
5310
|
return useMutation14({
|
|
5357
|
-
mutationFn: () => getCurrentCompany()
|
|
5311
|
+
mutationFn: () => getCurrentCompany(service)
|
|
5358
5312
|
});
|
|
5359
5313
|
};
|
|
5360
5314
|
var use_get_current_company_default = useGetCurrentCompany;
|
|
@@ -5997,10 +5951,10 @@ var use_save_default = useSave;
|
|
|
5997
5951
|
|
|
5998
5952
|
// src/hooks/user/use-get-profile.ts
|
|
5999
5953
|
import { useMutation as useMutation30 } from "@tanstack/react-query";
|
|
6000
|
-
var useGetProfile = (path) => {
|
|
5954
|
+
var useGetProfile = (path, service) => {
|
|
6001
5955
|
const { getProfile } = useUserService();
|
|
6002
5956
|
return useMutation30({
|
|
6003
|
-
mutationFn: () => getProfile(path)
|
|
5957
|
+
mutationFn: () => getProfile(path, service)
|
|
6004
5958
|
});
|
|
6005
5959
|
};
|
|
6006
5960
|
var use_get_profile_default = useGetProfile;
|
|
@@ -6956,54 +6910,6 @@ var useCheckPayment = () => {
|
|
|
6956
6910
|
});
|
|
6957
6911
|
};
|
|
6958
6912
|
var use_check_payment_default = useCheckPayment;
|
|
6959
|
-
|
|
6960
|
-
// src/hooks/view/use-get-data-close-session.ts
|
|
6961
|
-
import { useMutation as useMutation65 } from "@tanstack/react-query";
|
|
6962
|
-
var useGetDataCloseSession = () => {
|
|
6963
|
-
const { getDataCloseSession } = useViewService();
|
|
6964
|
-
return useMutation65({
|
|
6965
|
-
mutationFn: ({
|
|
6966
|
-
model,
|
|
6967
|
-
ids,
|
|
6968
|
-
xNode,
|
|
6969
|
-
service
|
|
6970
|
-
}) => {
|
|
6971
|
-
return getDataCloseSession({
|
|
6972
|
-
model,
|
|
6973
|
-
ids,
|
|
6974
|
-
xNode,
|
|
6975
|
-
service
|
|
6976
|
-
});
|
|
6977
|
-
}
|
|
6978
|
-
});
|
|
6979
|
-
};
|
|
6980
|
-
var use_get_data_close_session_default = useGetDataCloseSession;
|
|
6981
|
-
|
|
6982
|
-
// src/hooks/view/use-get-detail-entity.ts
|
|
6983
|
-
import { useMutation as useMutation66 } from "@tanstack/react-query";
|
|
6984
|
-
var useGetDetailEntity = () => {
|
|
6985
|
-
const { getDetailEntity } = useViewService();
|
|
6986
|
-
return useMutation66({
|
|
6987
|
-
mutationFn: ({
|
|
6988
|
-
model,
|
|
6989
|
-
ids,
|
|
6990
|
-
method,
|
|
6991
|
-
xNode,
|
|
6992
|
-
service,
|
|
6993
|
-
kwargs
|
|
6994
|
-
}) => {
|
|
6995
|
-
return getDetailEntity({
|
|
6996
|
-
model,
|
|
6997
|
-
ids,
|
|
6998
|
-
method,
|
|
6999
|
-
xNode,
|
|
7000
|
-
service,
|
|
7001
|
-
kwargs
|
|
7002
|
-
});
|
|
7003
|
-
}
|
|
7004
|
-
});
|
|
7005
|
-
};
|
|
7006
|
-
var use_get_detail_entity_default = useGetDetailEntity;
|
|
7007
6913
|
export {
|
|
7008
6914
|
use_add_entity_default as useAddEntity,
|
|
7009
6915
|
use_button_default as useButton,
|
|
@@ -7031,9 +6937,7 @@ export {
|
|
|
7031
6937
|
use_get_conversion_rate_default as useGetConversionRate,
|
|
7032
6938
|
use_get_currency_default as useGetCurrency,
|
|
7033
6939
|
use_get_current_company_default as useGetCurrentCompany,
|
|
7034
|
-
use_get_data_close_session_default as useGetDataCloseSession,
|
|
7035
6940
|
use_get_detail_default as useGetDetail,
|
|
7036
|
-
use_get_detail_entity_default as useGetDetailEntity,
|
|
7037
6941
|
use_get_field_export_default as useGetFieldExport,
|
|
7038
6942
|
use_get_field_onchange_default as useGetFieldOnChange,
|
|
7039
6943
|
use_get_file_excel_default as useGetFileExcel,
|