@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/provider.mjs
CHANGED
|
@@ -2849,6 +2849,74 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
|
|
|
2849
2849
|
return originalRequest.data;
|
|
2850
2850
|
};
|
|
2851
2851
|
|
|
2852
|
+
// src/utils/storage/local-storage.ts
|
|
2853
|
+
var localStorageUtils = () => {
|
|
2854
|
+
const setToken = async (access_token) => {
|
|
2855
|
+
localStorage.setItem("accessToken", access_token);
|
|
2856
|
+
};
|
|
2857
|
+
const setRefreshToken = async (refresh_token) => {
|
|
2858
|
+
localStorage.setItem("refreshToken", refresh_token);
|
|
2859
|
+
};
|
|
2860
|
+
const getAccessToken = async () => {
|
|
2861
|
+
return localStorage.getItem("accessToken");
|
|
2862
|
+
};
|
|
2863
|
+
const getRefreshToken = async () => {
|
|
2864
|
+
return localStorage.getItem("refreshToken");
|
|
2865
|
+
};
|
|
2866
|
+
const clearToken = async () => {
|
|
2867
|
+
localStorage.removeItem("accessToken");
|
|
2868
|
+
localStorage.removeItem("refreshToken");
|
|
2869
|
+
};
|
|
2870
|
+
return {
|
|
2871
|
+
setToken,
|
|
2872
|
+
setRefreshToken,
|
|
2873
|
+
getAccessToken,
|
|
2874
|
+
getRefreshToken,
|
|
2875
|
+
clearToken
|
|
2876
|
+
};
|
|
2877
|
+
};
|
|
2878
|
+
|
|
2879
|
+
// src/utils/storage/session-storage.ts
|
|
2880
|
+
var sessionStorageUtils = /* @__PURE__ */ (() => {
|
|
2881
|
+
const getMenuFocus = () => {
|
|
2882
|
+
const menuFocus = sessionStorage.getItem("menuFocus");
|
|
2883
|
+
return menuFocus ? JSON.parse(menuFocus) : {
|
|
2884
|
+
id: void 0,
|
|
2885
|
+
service: ""
|
|
2886
|
+
};
|
|
2887
|
+
};
|
|
2888
|
+
const setMenuFocus2 = (menuTree) => {
|
|
2889
|
+
sessionStorage.setItem("menuFocus", JSON.stringify({ ...menuTree }));
|
|
2890
|
+
};
|
|
2891
|
+
const getActionData = () => {
|
|
2892
|
+
const actionData = sessionStorage.getItem("actionData");
|
|
2893
|
+
return actionData ? JSON.parse(actionData) : {};
|
|
2894
|
+
};
|
|
2895
|
+
const setActionData = (actData) => {
|
|
2896
|
+
sessionStorage.setItem("actionData", JSON.stringify(actData));
|
|
2897
|
+
};
|
|
2898
|
+
const getViewData = () => {
|
|
2899
|
+
const viewData = sessionStorage.getItem("viewData");
|
|
2900
|
+
return viewData ? JSON.parse(viewData) : {};
|
|
2901
|
+
};
|
|
2902
|
+
const getBrowserSession = () => {
|
|
2903
|
+
const actionData = sessionStorage.getItem("browserSession");
|
|
2904
|
+
return actionData ? JSON.parse(actionData) : null;
|
|
2905
|
+
};
|
|
2906
|
+
const setViewData = (viewData) => {
|
|
2907
|
+
sessionStorage.setItem("viewData", JSON.stringify(viewData));
|
|
2908
|
+
};
|
|
2909
|
+
return {
|
|
2910
|
+
getMenuFocus,
|
|
2911
|
+
setMenuFocus: setMenuFocus2,
|
|
2912
|
+
setActionData,
|
|
2913
|
+
getActionData,
|
|
2914
|
+
getViewData,
|
|
2915
|
+
setViewData,
|
|
2916
|
+
getBrowserSession
|
|
2917
|
+
};
|
|
2918
|
+
})();
|
|
2919
|
+
|
|
2852
2920
|
// src/services/action-service/index.ts
|
|
2853
2921
|
function useActionService() {
|
|
2854
2922
|
const { env } = useEnv();
|
|
@@ -3275,13 +3343,20 @@ function useAuthService() {
|
|
|
3275
3343
|
import { useCallback as useCallback3 } from "react";
|
|
3276
3344
|
function useCompanyService() {
|
|
3277
3345
|
const { env } = useEnv();
|
|
3278
|
-
const getCurrentCompany = useCallback3(
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
"
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3346
|
+
const getCurrentCompany = useCallback3(
|
|
3347
|
+
async (service) => {
|
|
3348
|
+
return await env.requests.get(
|
|
3349
|
+
"/company" /* COMPANY_PATH */,
|
|
3350
|
+
{
|
|
3351
|
+
headers: {
|
|
3352
|
+
"Content-Type": "application/json"
|
|
3353
|
+
}
|
|
3354
|
+
},
|
|
3355
|
+
service
|
|
3356
|
+
);
|
|
3357
|
+
},
|
|
3358
|
+
[env]
|
|
3359
|
+
);
|
|
3285
3360
|
const getInfoCompany = useCallback3(
|
|
3286
3361
|
async (id) => {
|
|
3287
3362
|
const jsonData = {
|
|
@@ -4142,12 +4217,16 @@ import { useCallback as useCallback8 } from "react";
|
|
|
4142
4217
|
function useUserService() {
|
|
4143
4218
|
const { env } = useEnv();
|
|
4144
4219
|
const getProfile = useCallback8(
|
|
4145
|
-
async (path) => {
|
|
4146
|
-
return env?.requests?.get(
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4220
|
+
async (path, service) => {
|
|
4221
|
+
return env?.requests?.get(
|
|
4222
|
+
path ?? "/userinfo" /* PROFILE_PATH */,
|
|
4223
|
+
{
|
|
4224
|
+
headers: {
|
|
4225
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
4226
|
+
}
|
|
4227
|
+
},
|
|
4228
|
+
service
|
|
4229
|
+
);
|
|
4151
4230
|
},
|
|
4152
4231
|
[env]
|
|
4153
4232
|
);
|
|
@@ -5101,61 +5180,6 @@ function useViewService() {
|
|
|
5101
5180
|
},
|
|
5102
5181
|
[env]
|
|
5103
5182
|
);
|
|
5104
|
-
const getDataCloseSession = useCallback9(
|
|
5105
|
-
({
|
|
5106
|
-
model,
|
|
5107
|
-
ids,
|
|
5108
|
-
xNode,
|
|
5109
|
-
service
|
|
5110
|
-
}) => {
|
|
5111
|
-
const jsonData = {
|
|
5112
|
-
model,
|
|
5113
|
-
ids,
|
|
5114
|
-
method: "get_closing_control_data" /* GET_CLOSING_CONTROL_DATA */
|
|
5115
|
-
};
|
|
5116
|
-
return env?.requests.post(
|
|
5117
|
-
"/call" /* CALL_PATH */,
|
|
5118
|
-
jsonData,
|
|
5119
|
-
{
|
|
5120
|
-
headers: {
|
|
5121
|
-
"Content-Type": "application/json",
|
|
5122
|
-
...xNode ? { "X-Node": xNode } : {}
|
|
5123
|
-
}
|
|
5124
|
-
},
|
|
5125
|
-
service
|
|
5126
|
-
);
|
|
5127
|
-
},
|
|
5128
|
-
[env]
|
|
5129
|
-
);
|
|
5130
|
-
const getDetailEntity = useCallback9(
|
|
5131
|
-
({
|
|
5132
|
-
model,
|
|
5133
|
-
ids,
|
|
5134
|
-
method,
|
|
5135
|
-
xNode,
|
|
5136
|
-
service,
|
|
5137
|
-
kwargs
|
|
5138
|
-
}) => {
|
|
5139
|
-
const jsonData = {
|
|
5140
|
-
model,
|
|
5141
|
-
ids,
|
|
5142
|
-
method,
|
|
5143
|
-
kwargs
|
|
5144
|
-
};
|
|
5145
|
-
return env?.requests.post(
|
|
5146
|
-
"/call" /* CALL_PATH */,
|
|
5147
|
-
jsonData,
|
|
5148
|
-
{
|
|
5149
|
-
headers: {
|
|
5150
|
-
"Content-Type": "application/json",
|
|
5151
|
-
...xNode ? { "X-Node": xNode } : {}
|
|
5152
|
-
}
|
|
5153
|
-
},
|
|
5154
|
-
service
|
|
5155
|
-
);
|
|
5156
|
-
},
|
|
5157
|
-
[env]
|
|
5158
|
-
);
|
|
5159
5183
|
return {
|
|
5160
5184
|
getView,
|
|
5161
5185
|
getMenu,
|
|
@@ -5187,9 +5211,7 @@ function useViewService() {
|
|
|
5187
5211
|
getOrderLine,
|
|
5188
5212
|
getProductImage,
|
|
5189
5213
|
addEntity,
|
|
5190
|
-
checkPayment
|
|
5191
|
-
getDataCloseSession,
|
|
5192
|
-
getDetailEntity
|
|
5214
|
+
checkPayment
|
|
5193
5215
|
};
|
|
5194
5216
|
}
|
|
5195
5217
|
|
|
@@ -5234,53 +5256,15 @@ import { createContext, useContext, useState as useState3, useCallback as useCal
|
|
|
5234
5256
|
|
|
5235
5257
|
// src/configs/axios-client.ts
|
|
5236
5258
|
import axios from "axios";
|
|
5237
|
-
|
|
5238
|
-
// src/utils/storage/local-storage.ts
|
|
5239
|
-
var localStorageUtils = () => {
|
|
5240
|
-
const setToken = async (access_token) => {
|
|
5241
|
-
localStorage.setItem("accessToken", access_token);
|
|
5242
|
-
};
|
|
5243
|
-
const setRefreshToken = async (refresh_token) => {
|
|
5244
|
-
localStorage.setItem("refreshToken", refresh_token);
|
|
5245
|
-
};
|
|
5246
|
-
const getAccessToken = async () => {
|
|
5247
|
-
return localStorage.getItem("accessToken");
|
|
5248
|
-
};
|
|
5249
|
-
const getRefreshToken = async () => {
|
|
5250
|
-
return localStorage.getItem("refreshToken");
|
|
5251
|
-
};
|
|
5252
|
-
const clearToken = async () => {
|
|
5253
|
-
localStorage.removeItem("accessToken");
|
|
5254
|
-
localStorage.removeItem("refreshToken");
|
|
5255
|
-
};
|
|
5256
|
-
return {
|
|
5257
|
-
setToken,
|
|
5258
|
-
setRefreshToken,
|
|
5259
|
-
getAccessToken,
|
|
5260
|
-
getRefreshToken,
|
|
5261
|
-
clearToken
|
|
5262
|
-
};
|
|
5263
|
-
};
|
|
5264
|
-
|
|
5265
|
-
// src/utils/storage/session-storage.ts
|
|
5266
|
-
var sessionStorageUtils = () => {
|
|
5267
|
-
const getBrowserSession = async () => {
|
|
5268
|
-
return sessionStorage.getItem("browserSession");
|
|
5269
|
-
};
|
|
5270
|
-
return {
|
|
5271
|
-
getBrowserSession
|
|
5272
|
-
};
|
|
5273
|
-
};
|
|
5274
|
-
|
|
5275
|
-
// src/configs/axios-client.ts
|
|
5276
5259
|
var axiosClient = {
|
|
5277
5260
|
init(config) {
|
|
5278
5261
|
const localStorage2 = config?.localStorageUtils ?? localStorageUtils();
|
|
5279
|
-
const sessionStorage2 = config?.sessionStorageUtils ?? sessionStorageUtils
|
|
5262
|
+
const sessionStorage2 = config?.sessionStorageUtils ?? sessionStorageUtils;
|
|
5280
5263
|
const db = config?.db;
|
|
5281
5264
|
const database = config?.config?.database;
|
|
5282
5265
|
let isRefreshing = false;
|
|
5283
5266
|
let failedQueue = [];
|
|
5267
|
+
const xNode = config?.xNode;
|
|
5284
5268
|
const processQueue = (error, token = null) => {
|
|
5285
5269
|
failedQueue?.forEach((prom) => {
|
|
5286
5270
|
if (error) {
|
|
@@ -5435,46 +5419,48 @@ var axiosClient = {
|
|
|
5435
5419
|
function formatUrl(url, db2) {
|
|
5436
5420
|
return url + (db2 ? "?db=" + db2 : "");
|
|
5437
5421
|
}
|
|
5438
|
-
const getBaseUrl = (baseUrl,
|
|
5439
|
-
|
|
5440
|
-
|
|
5422
|
+
const getBaseUrl = (baseUrl, hardService) => {
|
|
5423
|
+
return `${baseUrl.replace(/\/$/, "")}/${hardService ?? (sessionStorage2.getMenuFocus().service || config?.default_service)}/api/v2`;
|
|
5424
|
+
};
|
|
5425
|
+
const getHeaders = (header) => {
|
|
5426
|
+
const headers = {
|
|
5427
|
+
...header,
|
|
5428
|
+
...xNode ? { "X-Node": xNode } : {}
|
|
5429
|
+
};
|
|
5430
|
+
return headers;
|
|
5441
5431
|
};
|
|
5442
5432
|
const responseBody = (response) => response;
|
|
5443
5433
|
const requests = {
|
|
5444
|
-
get: (url, headers,
|
|
5445
|
-
formatUrl(getBaseUrl(config?.baseUrl,
|
|
5446
|
-
headers
|
|
5434
|
+
get: (url, headers, hardService) => instance.get(
|
|
5435
|
+
formatUrl(getBaseUrl(config?.baseUrl, hardService) + url, db),
|
|
5436
|
+
getHeaders(headers)
|
|
5447
5437
|
).then(responseBody),
|
|
5448
|
-
post: async (url, body, headers,
|
|
5449
|
-
formatUrl(getBaseUrl(config?.baseUrl,
|
|
5438
|
+
post: async (url, body, headers, hardService) => instance.post(
|
|
5439
|
+
formatUrl(getBaseUrl(config?.baseUrl, hardService) + url, db),
|
|
5450
5440
|
body,
|
|
5451
|
-
headers
|
|
5441
|
+
getHeaders(headers)
|
|
5452
5442
|
).then(responseBody),
|
|
5453
|
-
post_excel: (url, body, headers
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
headers
|
|
5459
|
-
"Content-Type": typeof window !== "undefined" ? "application/json" : "application/javascript",
|
|
5460
|
-
Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
5461
|
-
...headers
|
|
5462
|
-
}
|
|
5443
|
+
post_excel: (url, body, headers) => instance.post(formatUrl(getBaseUrl(config?.baseUrl) + url, db), body, {
|
|
5444
|
+
responseType: "arraybuffer",
|
|
5445
|
+
headers: {
|
|
5446
|
+
"Content-Type": typeof window !== "undefined" ? "application/json" : "application/javascript",
|
|
5447
|
+
Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
5448
|
+
...headers
|
|
5463
5449
|
}
|
|
5464
|
-
).then(responseBody),
|
|
5465
|
-
put: (url, body, headers,
|
|
5466
|
-
formatUrl(getBaseUrl(config?.baseUrl,
|
|
5450
|
+
}).then(responseBody),
|
|
5451
|
+
put: (url, body, headers, hardService) => instance.put(
|
|
5452
|
+
formatUrl(getBaseUrl(config?.baseUrl, hardService) + url, db),
|
|
5467
5453
|
body,
|
|
5468
|
-
headers
|
|
5454
|
+
getHeaders(headers)
|
|
5469
5455
|
).then(responseBody),
|
|
5470
|
-
patch: (url, body, headers,
|
|
5471
|
-
formatUrl(getBaseUrl(config?.baseUrl,
|
|
5456
|
+
patch: (url, body, headers, hardService) => instance.patch(
|
|
5457
|
+
formatUrl(getBaseUrl(config?.baseUrl, hardService) + url, db),
|
|
5472
5458
|
body,
|
|
5473
|
-
headers
|
|
5459
|
+
getHeaders(headers)
|
|
5474
5460
|
).then(responseBody),
|
|
5475
|
-
delete: (url, headers,
|
|
5476
|
-
formatUrl(getBaseUrl(config?.baseUrl,
|
|
5477
|
-
headers
|
|
5461
|
+
delete: (url, headers, hardService) => instance.delete(
|
|
5462
|
+
formatUrl(getBaseUrl(config?.baseUrl, hardService) + url, db),
|
|
5463
|
+
getHeaders(headers)
|
|
5478
5464
|
).then(responseBody)
|
|
5479
5465
|
};
|
|
5480
5466
|
return requests;
|
|
@@ -5508,7 +5494,7 @@ var EnvContext = createContext(null);
|
|
|
5508
5494
|
function EnvProvider({
|
|
5509
5495
|
children,
|
|
5510
5496
|
localStorageUtils: localStorageUtil = localStorageUtils(),
|
|
5511
|
-
sessionStorageUtils: sessionStorageUtil = sessionStorageUtils
|
|
5497
|
+
sessionStorageUtils: sessionStorageUtil = sessionStorageUtils
|
|
5512
5498
|
}) {
|
|
5513
5499
|
const [env, setEnvState] = useState3({
|
|
5514
5500
|
...initialEnvState,
|
|
@@ -5778,10 +5764,10 @@ var use_get_company_info_default = useGetCompanyInfo;
|
|
|
5778
5764
|
|
|
5779
5765
|
// src/hooks/company/use-get-current-company.ts
|
|
5780
5766
|
import { useMutation as useMutation14 } from "@tanstack/react-query";
|
|
5781
|
-
var useGetCurrentCompany = () => {
|
|
5767
|
+
var useGetCurrentCompany = ({ service }) => {
|
|
5782
5768
|
const { getCurrentCompany } = useCompanyService();
|
|
5783
5769
|
return useMutation14({
|
|
5784
|
-
mutationFn: () => getCurrentCompany()
|
|
5770
|
+
mutationFn: () => getCurrentCompany(service)
|
|
5785
5771
|
});
|
|
5786
5772
|
};
|
|
5787
5773
|
var use_get_current_company_default = useGetCurrentCompany;
|
|
@@ -6424,10 +6410,10 @@ var use_save_default = useSave;
|
|
|
6424
6410
|
|
|
6425
6411
|
// src/hooks/user/use-get-profile.ts
|
|
6426
6412
|
import { useMutation as useMutation30 } from "@tanstack/react-query";
|
|
6427
|
-
var useGetProfile = (path) => {
|
|
6413
|
+
var useGetProfile = (path, service) => {
|
|
6428
6414
|
const { getProfile } = useUserService();
|
|
6429
6415
|
return useMutation30({
|
|
6430
|
-
mutationFn: () => getProfile(path)
|
|
6416
|
+
mutationFn: () => getProfile(path, service)
|
|
6431
6417
|
});
|
|
6432
6418
|
};
|
|
6433
6419
|
var use_get_profile_default = useGetProfile;
|
|
@@ -7384,54 +7370,6 @@ var useCheckPayment = () => {
|
|
|
7384
7370
|
};
|
|
7385
7371
|
var use_check_payment_default = useCheckPayment;
|
|
7386
7372
|
|
|
7387
|
-
// src/hooks/view/use-get-data-close-session.ts
|
|
7388
|
-
import { useMutation as useMutation65 } from "@tanstack/react-query";
|
|
7389
|
-
var useGetDataCloseSession = () => {
|
|
7390
|
-
const { getDataCloseSession } = useViewService();
|
|
7391
|
-
return useMutation65({
|
|
7392
|
-
mutationFn: ({
|
|
7393
|
-
model,
|
|
7394
|
-
ids,
|
|
7395
|
-
xNode,
|
|
7396
|
-
service
|
|
7397
|
-
}) => {
|
|
7398
|
-
return getDataCloseSession({
|
|
7399
|
-
model,
|
|
7400
|
-
ids,
|
|
7401
|
-
xNode,
|
|
7402
|
-
service
|
|
7403
|
-
});
|
|
7404
|
-
}
|
|
7405
|
-
});
|
|
7406
|
-
};
|
|
7407
|
-
var use_get_data_close_session_default = useGetDataCloseSession;
|
|
7408
|
-
|
|
7409
|
-
// src/hooks/view/use-get-detail-entity.ts
|
|
7410
|
-
import { useMutation as useMutation66 } from "@tanstack/react-query";
|
|
7411
|
-
var useGetDetailEntity = () => {
|
|
7412
|
-
const { getDetailEntity } = useViewService();
|
|
7413
|
-
return useMutation66({
|
|
7414
|
-
mutationFn: ({
|
|
7415
|
-
model,
|
|
7416
|
-
ids,
|
|
7417
|
-
method,
|
|
7418
|
-
xNode,
|
|
7419
|
-
service,
|
|
7420
|
-
kwargs
|
|
7421
|
-
}) => {
|
|
7422
|
-
return getDetailEntity({
|
|
7423
|
-
model,
|
|
7424
|
-
ids,
|
|
7425
|
-
method,
|
|
7426
|
-
xNode,
|
|
7427
|
-
service,
|
|
7428
|
-
kwargs
|
|
7429
|
-
});
|
|
7430
|
-
}
|
|
7431
|
-
});
|
|
7432
|
-
};
|
|
7433
|
-
var use_get_detail_entity_default = useGetDetailEntity;
|
|
7434
|
-
|
|
7435
7373
|
// src/provider/service-provider.tsx
|
|
7436
7374
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
7437
7375
|
var ServiceContext = createContext2(null);
|
|
@@ -7524,9 +7462,7 @@ var ServiceProvider = ({
|
|
|
7524
7462
|
useGetOrderLine: use_get_order_line_default,
|
|
7525
7463
|
useGetProductImage: use_get_product_image_default,
|
|
7526
7464
|
useAddEntity: use_add_entity_default,
|
|
7527
|
-
useCheckPayment: use_check_payment_default
|
|
7528
|
-
useGetDataCloseSession: use_get_data_close_session_default,
|
|
7529
|
-
useGetDetailEntity: use_get_detail_entity_default
|
|
7465
|
+
useCheckPayment: use_check_payment_default
|
|
7530
7466
|
};
|
|
7531
7467
|
return /* @__PURE__ */ jsx6(ServiceContext.Provider, { value: services, children });
|
|
7532
7468
|
};
|
package/dist/services.d.mts
CHANGED
|
@@ -79,7 +79,7 @@ declare function useAuthService(): {
|
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
declare function useCompanyService(): {
|
|
82
|
-
getCurrentCompany: () => Promise<any>;
|
|
82
|
+
getCurrentCompany: (service?: string) => Promise<any>;
|
|
83
83
|
getInfoCompany: (id: number) => Promise<any>;
|
|
84
84
|
};
|
|
85
85
|
|
|
@@ -223,7 +223,7 @@ declare function useModelService(): {
|
|
|
223
223
|
};
|
|
224
224
|
|
|
225
225
|
declare function useUserService(): {
|
|
226
|
-
getProfile: (path?: string) => Promise<any>;
|
|
226
|
+
getProfile: (path?: string, service?: string) => Promise<any>;
|
|
227
227
|
getUser: ({ context, id }: {
|
|
228
228
|
context: any;
|
|
229
229
|
id: any;
|
|
@@ -408,20 +408,6 @@ declare function useViewService(): {
|
|
|
408
408
|
service: string;
|
|
409
409
|
xNode: string;
|
|
410
410
|
}) => any;
|
|
411
|
-
getDataCloseSession: ({ model, ids, xNode, service, }: {
|
|
412
|
-
model: string;
|
|
413
|
-
ids: any;
|
|
414
|
-
service: string;
|
|
415
|
-
xNode: string;
|
|
416
|
-
}) => any;
|
|
417
|
-
getDetailEntity: ({ model, ids, method, xNode, service, kwargs, }: {
|
|
418
|
-
model: string;
|
|
419
|
-
ids: any;
|
|
420
|
-
method: string;
|
|
421
|
-
service: string;
|
|
422
|
-
xNode: string;
|
|
423
|
-
kwargs: any;
|
|
424
|
-
}) => any;
|
|
425
411
|
};
|
|
426
412
|
|
|
427
413
|
export { useActionService, useAuthService, useCompanyService, useExcelService, useFormService, useKanbanService, useModelService, useUserService, useViewService };
|
package/dist/services.d.ts
CHANGED
|
@@ -79,7 +79,7 @@ declare function useAuthService(): {
|
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
declare function useCompanyService(): {
|
|
82
|
-
getCurrentCompany: () => Promise<any>;
|
|
82
|
+
getCurrentCompany: (service?: string) => Promise<any>;
|
|
83
83
|
getInfoCompany: (id: number) => Promise<any>;
|
|
84
84
|
};
|
|
85
85
|
|
|
@@ -223,7 +223,7 @@ declare function useModelService(): {
|
|
|
223
223
|
};
|
|
224
224
|
|
|
225
225
|
declare function useUserService(): {
|
|
226
|
-
getProfile: (path?: string) => Promise<any>;
|
|
226
|
+
getProfile: (path?: string, service?: string) => Promise<any>;
|
|
227
227
|
getUser: ({ context, id }: {
|
|
228
228
|
context: any;
|
|
229
229
|
id: any;
|
|
@@ -408,20 +408,6 @@ declare function useViewService(): {
|
|
|
408
408
|
service: string;
|
|
409
409
|
xNode: string;
|
|
410
410
|
}) => any;
|
|
411
|
-
getDataCloseSession: ({ model, ids, xNode, service, }: {
|
|
412
|
-
model: string;
|
|
413
|
-
ids: any;
|
|
414
|
-
service: string;
|
|
415
|
-
xNode: string;
|
|
416
|
-
}) => any;
|
|
417
|
-
getDetailEntity: ({ model, ids, method, xNode, service, kwargs, }: {
|
|
418
|
-
model: string;
|
|
419
|
-
ids: any;
|
|
420
|
-
method: string;
|
|
421
|
-
service: string;
|
|
422
|
-
xNode: string;
|
|
423
|
-
kwargs: any;
|
|
424
|
-
}) => any;
|
|
425
411
|
};
|
|
426
412
|
|
|
427
413
|
export { useActionService, useAuthService, useCompanyService, useExcelService, useFormService, useKanbanService, useModelService, useUserService, useViewService };
|
package/dist/services.js
CHANGED
|
@@ -3105,12 +3105,6 @@ var import_react_query85 = require("@tanstack/react-query");
|
|
|
3105
3105
|
// src/hooks/view/use-check-payment.ts
|
|
3106
3106
|
var import_react_query86 = require("@tanstack/react-query");
|
|
3107
3107
|
|
|
3108
|
-
// src/hooks/view/use-get-data-close-session.ts
|
|
3109
|
-
var import_react_query87 = require("@tanstack/react-query");
|
|
3110
|
-
|
|
3111
|
-
// src/hooks/view/use-get-detail-entity.ts
|
|
3112
|
-
var import_react_query88 = require("@tanstack/react-query");
|
|
3113
|
-
|
|
3114
3108
|
// src/provider/service-provider.tsx
|
|
3115
3109
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
3116
3110
|
var ServiceContext = (0, import_react4.createContext)(null);
|
|
@@ -3545,13 +3539,20 @@ function useAuthService() {
|
|
|
3545
3539
|
var import_react8 = require("react");
|
|
3546
3540
|
function useCompanyService() {
|
|
3547
3541
|
const { env } = useEnv();
|
|
3548
|
-
const getCurrentCompany = (0, import_react8.useCallback)(
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
"
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3542
|
+
const getCurrentCompany = (0, import_react8.useCallback)(
|
|
3543
|
+
async (service) => {
|
|
3544
|
+
return await env.requests.get(
|
|
3545
|
+
"/company" /* COMPANY_PATH */,
|
|
3546
|
+
{
|
|
3547
|
+
headers: {
|
|
3548
|
+
"Content-Type": "application/json"
|
|
3549
|
+
}
|
|
3550
|
+
},
|
|
3551
|
+
service
|
|
3552
|
+
);
|
|
3553
|
+
},
|
|
3554
|
+
[env]
|
|
3555
|
+
);
|
|
3555
3556
|
const getInfoCompany = (0, import_react8.useCallback)(
|
|
3556
3557
|
async (id) => {
|
|
3557
3558
|
const jsonData = {
|
|
@@ -4412,12 +4413,16 @@ var import_react13 = require("react");
|
|
|
4412
4413
|
function useUserService() {
|
|
4413
4414
|
const { env } = useEnv();
|
|
4414
4415
|
const getProfile = (0, import_react13.useCallback)(
|
|
4415
|
-
async (path) => {
|
|
4416
|
-
return env?.requests?.get(
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4416
|
+
async (path, service) => {
|
|
4417
|
+
return env?.requests?.get(
|
|
4418
|
+
path ?? "/userinfo" /* PROFILE_PATH */,
|
|
4419
|
+
{
|
|
4420
|
+
headers: {
|
|
4421
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
4422
|
+
}
|
|
4423
|
+
},
|
|
4424
|
+
service
|
|
4425
|
+
);
|
|
4421
4426
|
},
|
|
4422
4427
|
[env]
|
|
4423
4428
|
);
|
|
@@ -5371,61 +5376,6 @@ function useViewService() {
|
|
|
5371
5376
|
},
|
|
5372
5377
|
[env]
|
|
5373
5378
|
);
|
|
5374
|
-
const getDataCloseSession = (0, import_react14.useCallback)(
|
|
5375
|
-
({
|
|
5376
|
-
model,
|
|
5377
|
-
ids,
|
|
5378
|
-
xNode,
|
|
5379
|
-
service
|
|
5380
|
-
}) => {
|
|
5381
|
-
const jsonData = {
|
|
5382
|
-
model,
|
|
5383
|
-
ids,
|
|
5384
|
-
method: "get_closing_control_data" /* GET_CLOSING_CONTROL_DATA */
|
|
5385
|
-
};
|
|
5386
|
-
return env?.requests.post(
|
|
5387
|
-
"/call" /* CALL_PATH */,
|
|
5388
|
-
jsonData,
|
|
5389
|
-
{
|
|
5390
|
-
headers: {
|
|
5391
|
-
"Content-Type": "application/json",
|
|
5392
|
-
...xNode ? { "X-Node": xNode } : {}
|
|
5393
|
-
}
|
|
5394
|
-
},
|
|
5395
|
-
service
|
|
5396
|
-
);
|
|
5397
|
-
},
|
|
5398
|
-
[env]
|
|
5399
|
-
);
|
|
5400
|
-
const getDetailEntity = (0, import_react14.useCallback)(
|
|
5401
|
-
({
|
|
5402
|
-
model,
|
|
5403
|
-
ids,
|
|
5404
|
-
method,
|
|
5405
|
-
xNode,
|
|
5406
|
-
service,
|
|
5407
|
-
kwargs
|
|
5408
|
-
}) => {
|
|
5409
|
-
const jsonData = {
|
|
5410
|
-
model,
|
|
5411
|
-
ids,
|
|
5412
|
-
method,
|
|
5413
|
-
kwargs
|
|
5414
|
-
};
|
|
5415
|
-
return env?.requests.post(
|
|
5416
|
-
"/call" /* CALL_PATH */,
|
|
5417
|
-
jsonData,
|
|
5418
|
-
{
|
|
5419
|
-
headers: {
|
|
5420
|
-
"Content-Type": "application/json",
|
|
5421
|
-
...xNode ? { "X-Node": xNode } : {}
|
|
5422
|
-
}
|
|
5423
|
-
},
|
|
5424
|
-
service
|
|
5425
|
-
);
|
|
5426
|
-
},
|
|
5427
|
-
[env]
|
|
5428
|
-
);
|
|
5429
5379
|
return {
|
|
5430
5380
|
getView,
|
|
5431
5381
|
getMenu,
|
|
@@ -5457,9 +5407,7 @@ function useViewService() {
|
|
|
5457
5407
|
getOrderLine,
|
|
5458
5408
|
getProductImage,
|
|
5459
5409
|
addEntity,
|
|
5460
|
-
checkPayment
|
|
5461
|
-
getDataCloseSession,
|
|
5462
|
-
getDetailEntity
|
|
5410
|
+
checkPayment
|
|
5463
5411
|
};
|
|
5464
5412
|
}
|
|
5465
5413
|
// Annotate the CommonJS export names for ESM import in node:
|