@fctc/interface-logic 1.5.7 → 1.5.9
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.cts → configs.d.mts} +1 -2
- package/dist/configs.d.ts +0 -1
- package/dist/configs.js +146 -124
- package/dist/{configs.cjs → configs.mjs} +111 -161
- package/dist/constants.js +41 -2
- package/dist/{constants.cjs → constants.mjs} +2 -40
- package/dist/{environment.d.cts → environment.d.mts} +1 -4
- package/dist/environment.d.ts +1 -4
- package/dist/environment.js +207 -189
- package/dist/{environment.cjs → environment.mjs} +172 -230
- package/dist/{hooks.d.cts → hooks.d.mts} +7 -2
- package/dist/hooks.d.ts +6 -1
- package/dist/hooks.js +1771 -1807
- package/dist/{hooks.cjs → hooks.mjs} +1674 -1915
- package/dist/{provider.d.cts → provider.d.mts} +1 -1
- package/dist/provider.d.ts +1 -1
- package/dist/provider.js +608 -629
- package/dist/{provider.cjs → provider.mjs} +574 -669
- package/dist/{services.d.cts → services.d.mts} +2 -1
- package/dist/services.d.ts +1 -0
- package/dist/services.js +1467 -1580
- package/dist/{services.cjs → services.mjs} +1428 -1627
- package/dist/{store.d.cts → store.d.mts} +155 -127
- package/dist/store.d.ts +155 -127
- package/dist/store.js +131 -41
- package/dist/{store.cjs → store.mjs} +30 -146
- package/dist/{types.d.cts → types.d.mts} +1 -1
- package/dist/types.js +18 -0
- package/dist/types.mjs +0 -0
- package/dist/{utils.d.cts → utils.d.mts} +2 -2
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +176 -135
- package/dist/{utils.cjs → utils.mjs} +115 -202
- package/package.json +81 -82
- package/dist/types.cjs +0 -17
- /package/dist/{constants.d.cts → constants.d.mts} +0 -0
- /package/dist/{view-type-BGJfDe73.d.cts → view-type-BGJfDe73.d.mts} +0 -0
package/dist/hooks.js
CHANGED
|
@@ -1,46 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
1
3
|
var __defProp = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var __spreadValues = (a, b) => {
|
|
10
|
-
for (var prop in b || (b = {}))
|
|
11
|
-
if (__hasOwnProp.call(b, prop))
|
|
12
|
-
__defNormalProp(a, prop, b[prop]);
|
|
13
|
-
if (__getOwnPropSymbols)
|
|
14
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
-
if (__propIsEnum.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
}
|
|
18
|
-
return a;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
11
|
};
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
reject(e);
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
var rejected = (value) => {
|
|
31
|
-
try {
|
|
32
|
-
step(generator.throw(value));
|
|
33
|
-
} catch (e) {
|
|
34
|
-
reject(e);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
38
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
39
|
-
});
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
40
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/hooks.ts
|
|
31
|
+
var hooks_exports = {};
|
|
32
|
+
__export(hooks_exports, {
|
|
33
|
+
useButton: () => use_button_default,
|
|
34
|
+
useChangeStatus: () => use_change_status_default,
|
|
35
|
+
useDelete: () => use_delete_default,
|
|
36
|
+
useDeleteComment: () => use_delete_comment_default,
|
|
37
|
+
useDuplicateRecord: () => use_duplicate_record_default,
|
|
38
|
+
useExecuteImport: () => uss_execute_import_default,
|
|
39
|
+
useExportExcel: () => use_export_excel_default,
|
|
40
|
+
useForgotPassword: () => use_forgot_password_default,
|
|
41
|
+
useForgotPasswordSSO: () => use_forgotpassword_sso_default,
|
|
42
|
+
useGet2FAMethods: () => uset_get_2FA_method_default,
|
|
43
|
+
useGetAccessByCode: () => use_get_access_by_code_default,
|
|
44
|
+
useGetActionDetail: () => use_get_action_detail_default,
|
|
45
|
+
useGetAll: () => use_get_all_default,
|
|
46
|
+
useGetCalendar: () => use_get_calendar_default,
|
|
47
|
+
useGetComment: () => use_get_comment_default,
|
|
48
|
+
useGetCompanyInfo: () => use_get_company_info_default,
|
|
49
|
+
useGetConversionRate: () => use_get_conversion_rate_default,
|
|
50
|
+
useGetCurrency: () => use_get_currency_default,
|
|
51
|
+
useGetCurrentCompany: () => use_get_current_company_default,
|
|
52
|
+
useGetDetail: () => use_get_detail_default,
|
|
53
|
+
useGetFieldExport: () => use_get_field_export_default,
|
|
54
|
+
useGetFieldOnChange: () => use_get_field_onchange_default,
|
|
55
|
+
useGetFieldsViewSecurity: () => use_get_fields_view_security_default,
|
|
56
|
+
useGetFileExcel: () => use_get_file_excel_default,
|
|
57
|
+
useGetFormView: () => use_get_form_view_default,
|
|
58
|
+
useGetGroups: () => use_get_groups_default,
|
|
59
|
+
useGetImage: () => use_get_image_default,
|
|
60
|
+
useGetListCompany: () => use_get_list_company_default,
|
|
61
|
+
useGetListData: () => use_get_list_data_default,
|
|
62
|
+
useGetListMyBankAccount: () => use_get_list_my_bank_account_default,
|
|
63
|
+
useGetMenu: () => use_get_menu_default,
|
|
64
|
+
useGetPrintReport: () => use_get_print_report_default,
|
|
65
|
+
useGetProGressBar: () => use_get_progress_bar_default,
|
|
66
|
+
useGetProfile: () => use_get_profile_default,
|
|
67
|
+
useGetProvider: () => use_get_provider_default,
|
|
68
|
+
useGetResequence: () => use_resequence_default,
|
|
69
|
+
useGetSelection: () => use_get_selection_default,
|
|
70
|
+
useGetUser: () => use_get_user_default,
|
|
71
|
+
useGetView: () => use_get_view_default,
|
|
72
|
+
useGrantAccess: () => use_grant_access_default,
|
|
73
|
+
useIsValidToken: () => use_isvalid_token_default,
|
|
74
|
+
useLoadAction: () => use_load_action_default,
|
|
75
|
+
useLoadMessage: () => use_load_message_default,
|
|
76
|
+
useLoginCredential: () => use_login_credential_default,
|
|
77
|
+
useLoginSocial: () => use_login_socical_default,
|
|
78
|
+
useLogout: () => use_logout_default,
|
|
79
|
+
useModel: () => use_model_default,
|
|
80
|
+
useOdooDataTransform: () => use_odoo_data_transform_default,
|
|
81
|
+
useOnChangeForm: () => use_onchange_form_default,
|
|
82
|
+
useParsePreview: () => use_parse_preview_default,
|
|
83
|
+
usePrint: () => use_print_default,
|
|
84
|
+
useRemoveRow: () => use_remove_row_default,
|
|
85
|
+
useRemoveTotpSetup: () => use_remove_totp_setup_default,
|
|
86
|
+
useRequestSetupTotp: () => use_request_setup_totp_default,
|
|
87
|
+
useResetPassword: () => use_reset_password_default,
|
|
88
|
+
useResetPasswordSSO: () => use_reset_password_sso_default,
|
|
89
|
+
useRunAction: () => use_run_action_default,
|
|
90
|
+
useSave: () => use_save_default,
|
|
91
|
+
useSendComment: () => use_send_comment_default,
|
|
92
|
+
useSettingsWebRead2fa: () => use_settings_web_read_2fa_default,
|
|
93
|
+
useSignInSSO: () => use_signin_sso_default,
|
|
94
|
+
useSwitchLocale: () => use_switch_locale_default,
|
|
95
|
+
useUpdatePassword: () => use_update_password_default,
|
|
96
|
+
useUploadFile: () => use_upload_file_default,
|
|
97
|
+
useUploadIdFile: () => use_upload_id_file_default,
|
|
98
|
+
useUploadImage: () => use_upload_image_default,
|
|
99
|
+
useValidateActionToken: () => use_validate_action_token_default,
|
|
100
|
+
useVerify2FA: () => use_verify_2FA_default,
|
|
101
|
+
useVerifyTotp: () => use_verify_totp_default
|
|
102
|
+
});
|
|
103
|
+
module.exports = __toCommonJS(hooks_exports);
|
|
41
104
|
|
|
42
105
|
// src/hooks/auth/use-forgot-password.ts
|
|
43
|
-
|
|
106
|
+
var import_react_query = require("@tanstack/react-query");
|
|
44
107
|
|
|
45
108
|
// src/constants/api/uri-constant.ts
|
|
46
109
|
var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
@@ -73,10 +136,10 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
|
73
136
|
})(UriConstants || {});
|
|
74
137
|
|
|
75
138
|
// src/configs/axios-client.ts
|
|
76
|
-
|
|
139
|
+
var import_axios = __toESM(require("axios"));
|
|
77
140
|
|
|
78
141
|
// src/utils/format.ts
|
|
79
|
-
|
|
142
|
+
var import_moment = __toESM(require("moment"));
|
|
80
143
|
|
|
81
144
|
// src/constants/widget/widget-avatar-constant.ts
|
|
82
145
|
var WIDGETAVATAR = /* @__PURE__ */ ((WIDGETAVATAR2) => {
|
|
@@ -1163,6 +1226,22 @@ var PyRelativeDelta = class _PyRelativeDelta {
|
|
|
1163
1226
|
this.microsecond = params.microsecond;
|
|
1164
1227
|
this.weekday = params.weekday;
|
|
1165
1228
|
}
|
|
1229
|
+
years;
|
|
1230
|
+
months;
|
|
1231
|
+
days;
|
|
1232
|
+
hours;
|
|
1233
|
+
minutes;
|
|
1234
|
+
seconds;
|
|
1235
|
+
microseconds;
|
|
1236
|
+
leapDays;
|
|
1237
|
+
year;
|
|
1238
|
+
month;
|
|
1239
|
+
day;
|
|
1240
|
+
hour;
|
|
1241
|
+
minute;
|
|
1242
|
+
second;
|
|
1243
|
+
microsecond;
|
|
1244
|
+
weekday;
|
|
1166
1245
|
negate() {
|
|
1167
1246
|
return new _PyRelativeDelta(this, -1);
|
|
1168
1247
|
}
|
|
@@ -1277,7 +1356,7 @@ function execOnIterable(iterable, func) {
|
|
|
1277
1356
|
if (typeof iterable === "object" && !Array.isArray(iterable) && !(iterable instanceof Set)) {
|
|
1278
1357
|
iterable = Object.keys(iterable);
|
|
1279
1358
|
}
|
|
1280
|
-
if (typeof
|
|
1359
|
+
if (typeof iterable?.[Symbol.iterator] !== "function") {
|
|
1281
1360
|
throw new EvaluationError("value not iterable");
|
|
1282
1361
|
}
|
|
1283
1362
|
return func(iterable);
|
|
@@ -1600,7 +1679,7 @@ function applyBinaryOp(ast, context) {
|
|
|
1600
1679
|
}
|
|
1601
1680
|
return Math.floor(left / right);
|
|
1602
1681
|
case "**":
|
|
1603
|
-
return
|
|
1682
|
+
return left ** right;
|
|
1604
1683
|
case "==":
|
|
1605
1684
|
return isEqual(left, right);
|
|
1606
1685
|
case "<>":
|
|
@@ -1722,7 +1801,7 @@ function evaluate(ast, context = {}) {
|
|
|
1722
1801
|
const dicts = /* @__PURE__ */ new Set();
|
|
1723
1802
|
let pyContext;
|
|
1724
1803
|
const evalContext = Object.create(context);
|
|
1725
|
-
if (!
|
|
1804
|
+
if (!evalContext?.context) {
|
|
1726
1805
|
Object.defineProperty(evalContext, "context", {
|
|
1727
1806
|
get() {
|
|
1728
1807
|
if (!pyContext) {
|
|
@@ -1733,18 +1812,17 @@ function evaluate(ast, context = {}) {
|
|
|
1733
1812
|
});
|
|
1734
1813
|
}
|
|
1735
1814
|
function _innerEvaluate(ast2) {
|
|
1736
|
-
|
|
1737
|
-
switch (ast2 == null ? void 0 : ast2.type) {
|
|
1815
|
+
switch (ast2?.type) {
|
|
1738
1816
|
case 0:
|
|
1739
1817
|
// Number
|
|
1740
1818
|
case 1:
|
|
1741
1819
|
return ast2.value;
|
|
1742
1820
|
case 5:
|
|
1743
1821
|
if (ast2.value in evalContext) {
|
|
1744
|
-
if (typeof evalContext[ast2.value] === "object" &&
|
|
1745
|
-
return
|
|
1822
|
+
if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
|
|
1823
|
+
return evalContext[ast2.value]?.id;
|
|
1746
1824
|
}
|
|
1747
|
-
return
|
|
1825
|
+
return evalContext[ast2.value] ?? false;
|
|
1748
1826
|
} else if (ast2.value in BUILTINS) {
|
|
1749
1827
|
return BUILTINS[ast2.value];
|
|
1750
1828
|
} else {
|
|
@@ -1781,7 +1859,7 @@ function evaluate(ast, context = {}) {
|
|
|
1781
1859
|
const args = ast2.args.map(_evaluate);
|
|
1782
1860
|
const kwargs = {};
|
|
1783
1861
|
for (const kwarg in ast2.kwargs) {
|
|
1784
|
-
kwargs[kwarg] = _evaluate(ast2
|
|
1862
|
+
kwargs[kwarg] = _evaluate(ast2?.kwargs[kwarg]);
|
|
1785
1863
|
}
|
|
1786
1864
|
if (fnValue === PyDate || fnValue === PyDateTime || fnValue === PyTime || fnValue === PyRelativeDelta || fnValue === PyTimeDelta) {
|
|
1787
1865
|
return fnValue.create(...args, kwargs);
|
|
@@ -1860,25 +1938,9 @@ function escapeRegExp(str) {
|
|
|
1860
1938
|
var InvalidDomainError = class extends Error {
|
|
1861
1939
|
};
|
|
1862
1940
|
var Domain = class _Domain {
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
return new _Domain(descr.toString());
|
|
1867
|
-
} else {
|
|
1868
|
-
let rawAST;
|
|
1869
|
-
try {
|
|
1870
|
-
rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
|
|
1871
|
-
} catch (error) {
|
|
1872
|
-
throw new InvalidDomainError(
|
|
1873
|
-
`Invalid domain representation: ${descr}`,
|
|
1874
|
-
{
|
|
1875
|
-
cause: error
|
|
1876
|
-
}
|
|
1877
|
-
);
|
|
1878
|
-
}
|
|
1879
|
-
this.ast = normalizeDomainAST(rawAST);
|
|
1880
|
-
}
|
|
1881
|
-
}
|
|
1941
|
+
ast = { type: -1, value: null };
|
|
1942
|
+
static TRUE;
|
|
1943
|
+
static FALSE;
|
|
1882
1944
|
static combine(domains, operator) {
|
|
1883
1945
|
if (domains.length === 0) {
|
|
1884
1946
|
return new _Domain([]);
|
|
@@ -1957,6 +2019,24 @@ var Domain = class _Domain {
|
|
|
1957
2019
|
processLeaf(d.ast.value, 0, "&", newDomain);
|
|
1958
2020
|
return newDomain;
|
|
1959
2021
|
}
|
|
2022
|
+
constructor(descr = []) {
|
|
2023
|
+
if (descr instanceof _Domain) {
|
|
2024
|
+
return new _Domain(descr.toString());
|
|
2025
|
+
} else {
|
|
2026
|
+
let rawAST;
|
|
2027
|
+
try {
|
|
2028
|
+
rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
|
|
2029
|
+
} catch (error) {
|
|
2030
|
+
throw new InvalidDomainError(
|
|
2031
|
+
`Invalid domain representation: ${descr}`,
|
|
2032
|
+
{
|
|
2033
|
+
cause: error
|
|
2034
|
+
}
|
|
2035
|
+
);
|
|
2036
|
+
}
|
|
2037
|
+
this.ast = normalizeDomainAST(rawAST);
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
1960
2040
|
contains(record) {
|
|
1961
2041
|
const expr = evaluate(this.ast, record);
|
|
1962
2042
|
return matchDomain(record, expr);
|
|
@@ -1975,7 +2055,7 @@ var Domain = class _Domain {
|
|
|
1975
2055
|
return evaluatedAsList;
|
|
1976
2056
|
}
|
|
1977
2057
|
return this.toString();
|
|
1978
|
-
} catch
|
|
2058
|
+
} catch {
|
|
1979
2059
|
return this.toString();
|
|
1980
2060
|
}
|
|
1981
2061
|
}
|
|
@@ -2175,7 +2255,7 @@ function matchDomain(record, domain) {
|
|
|
2175
2255
|
}
|
|
2176
2256
|
|
|
2177
2257
|
// src/utils/function.ts
|
|
2178
|
-
|
|
2258
|
+
var import_react = require("react");
|
|
2179
2259
|
var toQueryString = (params) => {
|
|
2180
2260
|
return Object.keys(params).map(
|
|
2181
2261
|
(key) => encodeURIComponent(key) + "=" + encodeURIComponent(params[key].toString())
|
|
@@ -2218,22 +2298,22 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
|
|
|
2218
2298
|
|
|
2219
2299
|
// src/utils/storage/local-storage.ts
|
|
2220
2300
|
var localStorageUtils = () => {
|
|
2221
|
-
const setToken = (access_token) =>
|
|
2301
|
+
const setToken = async (access_token) => {
|
|
2222
2302
|
localStorage.setItem("accessToken", access_token);
|
|
2223
|
-
}
|
|
2224
|
-
const setRefreshToken = (refresh_token) =>
|
|
2303
|
+
};
|
|
2304
|
+
const setRefreshToken = async (refresh_token) => {
|
|
2225
2305
|
localStorage.setItem("refreshToken", refresh_token);
|
|
2226
|
-
}
|
|
2227
|
-
const getAccessToken = () =>
|
|
2306
|
+
};
|
|
2307
|
+
const getAccessToken = async () => {
|
|
2228
2308
|
return localStorage.getItem("accessToken");
|
|
2229
|
-
}
|
|
2230
|
-
const getRefreshToken = () =>
|
|
2309
|
+
};
|
|
2310
|
+
const getRefreshToken = async () => {
|
|
2231
2311
|
return localStorage.getItem("refreshToken");
|
|
2232
|
-
}
|
|
2233
|
-
const clearToken = () =>
|
|
2312
|
+
};
|
|
2313
|
+
const clearToken = async () => {
|
|
2234
2314
|
localStorage.removeItem("accessToken");
|
|
2235
2315
|
localStorage.removeItem("refreshToken");
|
|
2236
|
-
}
|
|
2316
|
+
};
|
|
2237
2317
|
return {
|
|
2238
2318
|
setToken,
|
|
2239
2319
|
setRefreshToken,
|
|
@@ -2245,9 +2325,9 @@ var localStorageUtils = () => {
|
|
|
2245
2325
|
|
|
2246
2326
|
// src/utils/storage/session-storage.ts
|
|
2247
2327
|
var sessionStorageUtils = () => {
|
|
2248
|
-
const getBrowserSession = () =>
|
|
2328
|
+
const getBrowserSession = async () => {
|
|
2249
2329
|
return sessionStorage.getItem("browserSession");
|
|
2250
|
-
}
|
|
2330
|
+
};
|
|
2251
2331
|
return {
|
|
2252
2332
|
getBrowserSession
|
|
2253
2333
|
};
|
|
@@ -2256,14 +2336,13 @@ var sessionStorageUtils = () => {
|
|
|
2256
2336
|
// src/configs/axios-client.ts
|
|
2257
2337
|
var axiosClient = {
|
|
2258
2338
|
init(config) {
|
|
2259
|
-
|
|
2260
|
-
const
|
|
2261
|
-
const sessionStorage2 = (_b = config.sessionStorageUtils) != null ? _b : sessionStorageUtils();
|
|
2339
|
+
const localStorage2 = config.localStorageUtils ?? localStorageUtils();
|
|
2340
|
+
const sessionStorage2 = config.sessionStorageUtils ?? sessionStorageUtils();
|
|
2262
2341
|
const db = config.db;
|
|
2263
2342
|
let isRefreshing = false;
|
|
2264
2343
|
let failedQueue = [];
|
|
2265
2344
|
const processQueue = (error, token = null) => {
|
|
2266
|
-
failedQueue
|
|
2345
|
+
failedQueue?.forEach((prom) => {
|
|
2267
2346
|
if (error) {
|
|
2268
2347
|
prom.reject(error);
|
|
2269
2348
|
} else {
|
|
@@ -2272,44 +2351,39 @@ var axiosClient = {
|
|
|
2272
2351
|
});
|
|
2273
2352
|
failedQueue = [];
|
|
2274
2353
|
};
|
|
2275
|
-
const instance =
|
|
2276
|
-
adapter:
|
|
2354
|
+
const instance = import_axios.default.create({
|
|
2355
|
+
adapter: import_axios.default.defaults.adapter,
|
|
2277
2356
|
baseURL: config.baseUrl,
|
|
2278
2357
|
timeout: 5e4,
|
|
2279
2358
|
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
2280
2359
|
});
|
|
2281
|
-
instance.interceptors.request.use(
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
if (token) {
|
|
2286
|
-
config2.headers["Authorization"] = "Bearer " + token;
|
|
2287
|
-
}
|
|
2288
|
-
return config2;
|
|
2289
|
-
}),
|
|
2290
|
-
(error) => {
|
|
2291
|
-
Promise.reject(error);
|
|
2360
|
+
instance.interceptors.request.use(async (config2) => {
|
|
2361
|
+
const { useRefreshToken, useActionToken, actionToken } = config2;
|
|
2362
|
+
if (useActionToken && actionToken) {
|
|
2363
|
+
config2.headers["Action-Token"] = actionToken;
|
|
2292
2364
|
}
|
|
2293
|
-
|
|
2365
|
+
const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
|
|
2366
|
+
const token = await getToken?.();
|
|
2367
|
+
if (token) config2.headers["Authorization"] = `Bearer ${token}`;
|
|
2368
|
+
return config2;
|
|
2369
|
+
}, Promise.reject);
|
|
2294
2370
|
instance.interceptors.response.use(
|
|
2295
2371
|
(response) => {
|
|
2296
2372
|
return handleResponse(response);
|
|
2297
2373
|
},
|
|
2298
|
-
(error) =>
|
|
2299
|
-
|
|
2300
|
-
const handleError3 = (error2) => __async(null, null, function* () {
|
|
2301
|
-
var _a3;
|
|
2374
|
+
async (error) => {
|
|
2375
|
+
const handleError3 = async (error2) => {
|
|
2302
2376
|
if (!error2.response) {
|
|
2303
2377
|
return error2;
|
|
2304
2378
|
}
|
|
2305
2379
|
const { data } = error2.response;
|
|
2306
|
-
if (data && data.code === 400 && ["invalid_grant"].includes(
|
|
2307
|
-
|
|
2380
|
+
if (data && data.code === 400 && ["invalid_grant"].includes(data.data?.error)) {
|
|
2381
|
+
await clearAuthToken();
|
|
2308
2382
|
}
|
|
2309
2383
|
return data;
|
|
2310
|
-
}
|
|
2384
|
+
};
|
|
2311
2385
|
const originalRequest = error.config;
|
|
2312
|
-
if ((
|
|
2386
|
+
if ((error.response?.status === 403 || error.response?.status === 401 || error.response?.status === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
|
|
2313
2387
|
error.response.data.code
|
|
2314
2388
|
)) {
|
|
2315
2389
|
if (isRefreshing) {
|
|
@@ -2322,19 +2396,18 @@ var axiosClient = {
|
|
|
2322
2396
|
token
|
|
2323
2397
|
);
|
|
2324
2398
|
return instance.request(originalRequest);
|
|
2325
|
-
}).catch((err) =>
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
yield clearAuthToken();
|
|
2399
|
+
}).catch(async (err) => {
|
|
2400
|
+
if ((err.response?.status === 400 || err.response?.status === 401) && ["invalid_grant"].includes(err.response.data.error)) {
|
|
2401
|
+
await clearAuthToken();
|
|
2329
2402
|
}
|
|
2330
|
-
})
|
|
2403
|
+
});
|
|
2331
2404
|
}
|
|
2332
|
-
const browserSession =
|
|
2333
|
-
const refreshToken =
|
|
2334
|
-
const accessTokenExp =
|
|
2405
|
+
const browserSession = await sessionStorage2.getBrowserSession();
|
|
2406
|
+
const refreshToken = await localStorage2.getRefreshToken();
|
|
2407
|
+
const accessTokenExp = await localStorage2.getAccessToken();
|
|
2335
2408
|
isRefreshing = true;
|
|
2336
2409
|
if (!refreshToken && (!browserSession || browserSession == "unActive")) {
|
|
2337
|
-
|
|
2410
|
+
await clearAuthToken();
|
|
2338
2411
|
} else {
|
|
2339
2412
|
const payload = Object.fromEntries(
|
|
2340
2413
|
Object.entries({
|
|
@@ -2345,9 +2418,8 @@ var axiosClient = {
|
|
|
2345
2418
|
}).filter(([_, value]) => !!value)
|
|
2346
2419
|
);
|
|
2347
2420
|
return new Promise(function(resolve) {
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
`${config.baseUrl}${(_a3 = config.refreshTokenEndpoint) != null ? _a3 : "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
|
|
2421
|
+
import_axios.default.post(
|
|
2422
|
+
`${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
|
|
2351
2423
|
payload,
|
|
2352
2424
|
{
|
|
2353
2425
|
headers: {
|
|
@@ -2355,11 +2427,11 @@ var axiosClient = {
|
|
|
2355
2427
|
Authorization: `Bearer ${accessTokenExp}`
|
|
2356
2428
|
}
|
|
2357
2429
|
}
|
|
2358
|
-
).then((res) =>
|
|
2430
|
+
).then(async (res) => {
|
|
2359
2431
|
const data = res.data;
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2432
|
+
await localStorage2.setToken(data.access_token);
|
|
2433
|
+
await localStorage2.setRefreshToken(data.refresh_token);
|
|
2434
|
+
import_axios.default.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
|
|
2363
2435
|
originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
|
|
2364
2436
|
originalRequest.data = updateTokenParamInOriginalRequest(
|
|
2365
2437
|
originalRequest,
|
|
@@ -2367,26 +2439,25 @@ var axiosClient = {
|
|
|
2367
2439
|
);
|
|
2368
2440
|
processQueue(null, data.access_token);
|
|
2369
2441
|
resolve(instance.request(originalRequest));
|
|
2370
|
-
})
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
yield clearAuthToken();
|
|
2442
|
+
}).catch(async (err) => {
|
|
2443
|
+
if (err && (err?.error_code === "AUTHEN_FAIL" || err?.error_code === "TOKEN_EXPIRED" || err?.error_code === "TOKEN_INCORRECT" || err?.code === "ERR_BAD_REQUEST") || err?.error_code === "ERR_2FA_006") {
|
|
2444
|
+
await clearAuthToken();
|
|
2374
2445
|
}
|
|
2375
2446
|
if (err && err.response) {
|
|
2376
|
-
const { error_code } =
|
|
2447
|
+
const { error_code } = err.response?.data || {};
|
|
2377
2448
|
if (error_code === "AUTHEN_FAIL") {
|
|
2378
|
-
|
|
2449
|
+
await clearAuthToken();
|
|
2379
2450
|
}
|
|
2380
2451
|
}
|
|
2381
2452
|
processQueue(err, null);
|
|
2382
|
-
})
|
|
2453
|
+
}).finally(() => {
|
|
2383
2454
|
isRefreshing = false;
|
|
2384
2455
|
});
|
|
2385
2456
|
});
|
|
2386
2457
|
}
|
|
2387
2458
|
}
|
|
2388
|
-
return Promise.reject(
|
|
2389
|
-
}
|
|
2459
|
+
return Promise.reject(await handleError3(error));
|
|
2460
|
+
}
|
|
2390
2461
|
);
|
|
2391
2462
|
const handleResponse = (res) => {
|
|
2392
2463
|
if (res && res.data) {
|
|
@@ -2395,7 +2466,6 @@ var axiosClient = {
|
|
|
2395
2466
|
return res;
|
|
2396
2467
|
};
|
|
2397
2468
|
const handleError2 = (error) => {
|
|
2398
|
-
var _a2, _b2, _c;
|
|
2399
2469
|
if (error.isAxiosError && error.code === "ECONNABORTED") {
|
|
2400
2470
|
console.error("Request Timeout Error:", error);
|
|
2401
2471
|
return "Request Timeout Error";
|
|
@@ -2403,17 +2473,17 @@ var axiosClient = {
|
|
|
2403
2473
|
console.error("Network Error:", error);
|
|
2404
2474
|
return "Network Error";
|
|
2405
2475
|
} else {
|
|
2406
|
-
console.error("Other Error:", error
|
|
2407
|
-
const errorMessage =
|
|
2408
|
-
return { message: errorMessage, status:
|
|
2476
|
+
console.error("Other Error:", error?.response);
|
|
2477
|
+
const errorMessage = error?.response?.data?.message || "An error occurred";
|
|
2478
|
+
return { message: errorMessage, status: error?.response?.status };
|
|
2409
2479
|
}
|
|
2410
2480
|
};
|
|
2411
|
-
const clearAuthToken = () =>
|
|
2412
|
-
|
|
2481
|
+
const clearAuthToken = async () => {
|
|
2482
|
+
await localStorage2.clearToken();
|
|
2413
2483
|
if (typeof window !== "undefined") {
|
|
2414
2484
|
window.location.href = `/login`;
|
|
2415
2485
|
}
|
|
2416
|
-
}
|
|
2486
|
+
};
|
|
2417
2487
|
function formatUrl(url, db2) {
|
|
2418
2488
|
return url + (db2 ? "?db=" + db2 : "");
|
|
2419
2489
|
}
|
|
@@ -2437,14 +2507,14 @@ var axiosClient = {
|
|
|
2437
2507
|
};
|
|
2438
2508
|
|
|
2439
2509
|
// src/store/index.ts
|
|
2440
|
-
|
|
2510
|
+
var import_react_redux = require("react-redux");
|
|
2441
2511
|
|
|
2442
2512
|
// src/store/reducers/breadcrums-slice/index.ts
|
|
2443
|
-
|
|
2513
|
+
var import_toolkit = require("@reduxjs/toolkit");
|
|
2444
2514
|
var initialState = {
|
|
2445
2515
|
breadCrumbs: []
|
|
2446
2516
|
};
|
|
2447
|
-
var breadcrumbsSlice = createSlice({
|
|
2517
|
+
var breadcrumbsSlice = (0, import_toolkit.createSlice)({
|
|
2448
2518
|
name: "breadcrumbs",
|
|
2449
2519
|
initialState,
|
|
2450
2520
|
reducers: {
|
|
@@ -2457,12 +2527,14 @@ var { setBreadCrumbs } = breadcrumbsSlice.actions;
|
|
|
2457
2527
|
var breadcrums_slice_default = breadcrumbsSlice.reducer;
|
|
2458
2528
|
|
|
2459
2529
|
// src/store/reducers/env-slice/index.ts
|
|
2460
|
-
|
|
2530
|
+
var import_toolkit2 = require("@reduxjs/toolkit");
|
|
2461
2531
|
var initialState2 = {
|
|
2462
2532
|
baseUrl: "",
|
|
2463
2533
|
requests: null,
|
|
2464
2534
|
companies: [],
|
|
2465
2535
|
user: {},
|
|
2536
|
+
db: "",
|
|
2537
|
+
refreshTokenEndpoint: "",
|
|
2466
2538
|
config: null,
|
|
2467
2539
|
envFile: null,
|
|
2468
2540
|
defaultCompany: {
|
|
@@ -2478,7 +2550,7 @@ var initialState2 = {
|
|
|
2478
2550
|
tz: "Asia/Saigon"
|
|
2479
2551
|
}
|
|
2480
2552
|
};
|
|
2481
|
-
var envSlice =
|
|
2553
|
+
var envSlice = (0, import_toolkit2.createSlice)({
|
|
2482
2554
|
name: "env",
|
|
2483
2555
|
initialState: initialState2,
|
|
2484
2556
|
reducers: {
|
|
@@ -2525,7 +2597,7 @@ var {
|
|
|
2525
2597
|
var env_slice_default = envSlice.reducer;
|
|
2526
2598
|
|
|
2527
2599
|
// src/store/reducers/excel-slice/index.ts
|
|
2528
|
-
|
|
2600
|
+
var import_toolkit3 = require("@reduxjs/toolkit");
|
|
2529
2601
|
var initialState3 = {
|
|
2530
2602
|
dataParse: null,
|
|
2531
2603
|
idFile: null,
|
|
@@ -2534,7 +2606,7 @@ var initialState3 = {
|
|
|
2534
2606
|
selectedFile: null,
|
|
2535
2607
|
errorData: null
|
|
2536
2608
|
};
|
|
2537
|
-
var excelSlice =
|
|
2609
|
+
var excelSlice = (0, import_toolkit3.createSlice)({
|
|
2538
2610
|
name: "excel",
|
|
2539
2611
|
initialState: initialState3,
|
|
2540
2612
|
reducers: {
|
|
@@ -2569,7 +2641,7 @@ var {
|
|
|
2569
2641
|
var excel_slice_default = excelSlice.reducer;
|
|
2570
2642
|
|
|
2571
2643
|
// src/store/reducers/form-slice/index.ts
|
|
2572
|
-
|
|
2644
|
+
var import_toolkit4 = require("@reduxjs/toolkit");
|
|
2573
2645
|
var initialState4 = {
|
|
2574
2646
|
viewDataStore: {},
|
|
2575
2647
|
isShowingModalDetail: false,
|
|
@@ -2579,7 +2651,7 @@ var initialState4 = {
|
|
|
2579
2651
|
listSubject: {},
|
|
2580
2652
|
dataUser: {}
|
|
2581
2653
|
};
|
|
2582
|
-
var formSlice =
|
|
2654
|
+
var formSlice = (0, import_toolkit4.createSlice)({
|
|
2583
2655
|
name: "form",
|
|
2584
2656
|
initialState: initialState4,
|
|
2585
2657
|
reducers: {
|
|
@@ -2618,15 +2690,15 @@ var {
|
|
|
2618
2690
|
var form_slice_default = formSlice.reducer;
|
|
2619
2691
|
|
|
2620
2692
|
// src/store/reducers/header-slice/index.ts
|
|
2621
|
-
|
|
2622
|
-
var headerSlice =
|
|
2693
|
+
var import_toolkit5 = require("@reduxjs/toolkit");
|
|
2694
|
+
var headerSlice = (0, import_toolkit5.createSlice)({
|
|
2623
2695
|
name: "header",
|
|
2624
2696
|
initialState: {
|
|
2625
2697
|
value: { allowedCompanyIds: [] }
|
|
2626
2698
|
},
|
|
2627
2699
|
reducers: {
|
|
2628
2700
|
setHeader: (state, action) => {
|
|
2629
|
-
state.value =
|
|
2701
|
+
state.value = { ...state.value, ...action.payload };
|
|
2630
2702
|
},
|
|
2631
2703
|
setAllowedCompanyIds: (state, action) => {
|
|
2632
2704
|
state.value.allowedCompanyIds = action.payload;
|
|
@@ -2637,7 +2709,7 @@ var { setAllowedCompanyIds, setHeader } = headerSlice.actions;
|
|
|
2637
2709
|
var header_slice_default = headerSlice.reducer;
|
|
2638
2710
|
|
|
2639
2711
|
// src/store/reducers/list-slice/index.ts
|
|
2640
|
-
|
|
2712
|
+
var import_toolkit6 = require("@reduxjs/toolkit");
|
|
2641
2713
|
var initialState5 = {
|
|
2642
2714
|
pageLimit: 10,
|
|
2643
2715
|
fields: {},
|
|
@@ -2651,7 +2723,7 @@ var initialState5 = {
|
|
|
2651
2723
|
page: 0,
|
|
2652
2724
|
domainTable: []
|
|
2653
2725
|
};
|
|
2654
|
-
var listSlice =
|
|
2726
|
+
var listSlice = (0, import_toolkit6.createSlice)({
|
|
2655
2727
|
name: "list",
|
|
2656
2728
|
initialState: initialState5,
|
|
2657
2729
|
reducers: {
|
|
@@ -2702,13 +2774,13 @@ var {
|
|
|
2702
2774
|
var list_slice_default = listSlice.reducer;
|
|
2703
2775
|
|
|
2704
2776
|
// src/store/reducers/login-slice/index.ts
|
|
2705
|
-
|
|
2777
|
+
var import_toolkit7 = require("@reduxjs/toolkit");
|
|
2706
2778
|
var initialState6 = {
|
|
2707
2779
|
db: "",
|
|
2708
2780
|
redirectTo: "/",
|
|
2709
2781
|
forgotPasswordUrl: "/"
|
|
2710
2782
|
};
|
|
2711
|
-
var loginSlice =
|
|
2783
|
+
var loginSlice = (0, import_toolkit7.createSlice)({
|
|
2712
2784
|
name: "login",
|
|
2713
2785
|
initialState: initialState6,
|
|
2714
2786
|
reducers: {
|
|
@@ -2727,14 +2799,14 @@ var { setDb, setRedirectTo, setForgotPasswordUrl } = loginSlice.actions;
|
|
|
2727
2799
|
var login_slice_default = loginSlice.reducer;
|
|
2728
2800
|
|
|
2729
2801
|
// src/store/reducers/navbar-slice/index.ts
|
|
2730
|
-
|
|
2802
|
+
var import_toolkit8 = require("@reduxjs/toolkit");
|
|
2731
2803
|
var initialState7 = {
|
|
2732
2804
|
menuFocus: {},
|
|
2733
2805
|
menuAction: {},
|
|
2734
2806
|
navbarWidth: 250,
|
|
2735
2807
|
menuList: []
|
|
2736
2808
|
};
|
|
2737
|
-
var navbarSlice =
|
|
2809
|
+
var navbarSlice = (0, import_toolkit8.createSlice)({
|
|
2738
2810
|
name: "navbar",
|
|
2739
2811
|
initialState: initialState7,
|
|
2740
2812
|
reducers: {
|
|
@@ -2756,11 +2828,11 @@ var { setMenuFocus, setMenuFocusAction, setNavbarWidth, setMenuList } = navbarSl
|
|
|
2756
2828
|
var navbar_slice_default = navbarSlice.reducer;
|
|
2757
2829
|
|
|
2758
2830
|
// src/store/reducers/profile-slice/index.ts
|
|
2759
|
-
|
|
2831
|
+
var import_toolkit9 = require("@reduxjs/toolkit");
|
|
2760
2832
|
var initialState8 = {
|
|
2761
2833
|
profile: {}
|
|
2762
2834
|
};
|
|
2763
|
-
var profileSlice =
|
|
2835
|
+
var profileSlice = (0, import_toolkit9.createSlice)({
|
|
2764
2836
|
name: "profile",
|
|
2765
2837
|
initialState: initialState8,
|
|
2766
2838
|
reducers: {
|
|
@@ -2773,7 +2845,7 @@ var { setProfile } = profileSlice.actions;
|
|
|
2773
2845
|
var profile_slice_default = profileSlice.reducer;
|
|
2774
2846
|
|
|
2775
2847
|
// src/store/reducers/search-slice/index.ts
|
|
2776
|
-
|
|
2848
|
+
var import_toolkit10 = require("@reduxjs/toolkit");
|
|
2777
2849
|
var initialState9 = {
|
|
2778
2850
|
groupByDomain: null,
|
|
2779
2851
|
searchBy: [],
|
|
@@ -2785,7 +2857,7 @@ var initialState9 = {
|
|
|
2785
2857
|
filterBy: [],
|
|
2786
2858
|
groupBy: []
|
|
2787
2859
|
};
|
|
2788
|
-
var searchSlice =
|
|
2860
|
+
var searchSlice = (0, import_toolkit10.createSlice)({
|
|
2789
2861
|
name: "search",
|
|
2790
2862
|
initialState: initialState9,
|
|
2791
2863
|
reducers: {
|
|
@@ -2859,7 +2931,7 @@ var {
|
|
|
2859
2931
|
var search_slice_default = searchSlice.reducer;
|
|
2860
2932
|
|
|
2861
2933
|
// src/store/store.ts
|
|
2862
|
-
|
|
2934
|
+
var import_toolkit11 = require("@reduxjs/toolkit");
|
|
2863
2935
|
|
|
2864
2936
|
// node_modules/redux/dist/redux.mjs
|
|
2865
2937
|
function formatProdErrorMessage(code) {
|
|
@@ -3043,7 +3115,7 @@ var rootReducer = combineReducers({
|
|
|
3043
3115
|
excel: excel_slice_default,
|
|
3044
3116
|
profile: profile_slice_default
|
|
3045
3117
|
});
|
|
3046
|
-
var envStore = configureStore({
|
|
3118
|
+
var envStore = (0, import_toolkit11.configureStore)({
|
|
3047
3119
|
reducer: rootReducer,
|
|
3048
3120
|
middleware: (getDefaultMiddleware) => getDefaultMiddleware({
|
|
3049
3121
|
serializableCheck: false
|
|
@@ -3052,130 +3124,114 @@ var envStore = configureStore({
|
|
|
3052
3124
|
|
|
3053
3125
|
// src/environment/EnvStore.ts
|
|
3054
3126
|
var EnvStore = class {
|
|
3055
|
-
|
|
3056
|
-
|
|
3127
|
+
baseUrl;
|
|
3128
|
+
requests;
|
|
3129
|
+
context;
|
|
3130
|
+
defaultCompany;
|
|
3131
|
+
config;
|
|
3132
|
+
companies;
|
|
3133
|
+
user;
|
|
3134
|
+
db;
|
|
3135
|
+
localStorageUtils;
|
|
3136
|
+
sessionStorageUtils;
|
|
3137
|
+
refreshTokenEndpoint;
|
|
3138
|
+
constructor(localStorageUtils2, sessionStorageUtils2) {
|
|
3057
3139
|
this.localStorageUtils = localStorageUtils2;
|
|
3058
3140
|
this.sessionStorageUtils = sessionStorageUtils2;
|
|
3059
3141
|
this.setup();
|
|
3060
3142
|
}
|
|
3061
3143
|
setup() {
|
|
3062
|
-
const env2 =
|
|
3063
|
-
this.baseUrl = env2
|
|
3064
|
-
this.requests = env2
|
|
3065
|
-
this.context = env2
|
|
3066
|
-
this.defaultCompany = env2
|
|
3067
|
-
this.config = env2
|
|
3068
|
-
this.companies =
|
|
3069
|
-
this.user = env2
|
|
3070
|
-
this.db = env2
|
|
3071
|
-
this.refreshTokenEndpoint = env2
|
|
3144
|
+
const env2 = envStore.getState().env;
|
|
3145
|
+
this.baseUrl = env2?.baseUrl;
|
|
3146
|
+
this.requests = env2?.requests;
|
|
3147
|
+
this.context = env2?.context;
|
|
3148
|
+
this.defaultCompany = env2?.defaultCompany;
|
|
3149
|
+
this.config = env2?.config;
|
|
3150
|
+
this.companies = env2?.companies || [];
|
|
3151
|
+
this.user = env2?.user;
|
|
3152
|
+
this.db = env2?.db;
|
|
3153
|
+
this.refreshTokenEndpoint = env2?.refreshTokenEndpoint;
|
|
3072
3154
|
}
|
|
3073
3155
|
setupEnv(envConfig) {
|
|
3074
|
-
const dispatch =
|
|
3075
|
-
const env2 =
|
|
3156
|
+
const dispatch = envStore.dispatch;
|
|
3157
|
+
const env2 = {
|
|
3158
|
+
...envConfig,
|
|
3076
3159
|
localStorageUtils: this.localStorageUtils,
|
|
3077
3160
|
sessionStorageUtils: this.sessionStorageUtils
|
|
3078
|
-
}
|
|
3161
|
+
};
|
|
3079
3162
|
const requests = axiosClient.init(env2);
|
|
3080
|
-
dispatch(setEnv(
|
|
3163
|
+
dispatch(setEnv({ ...env2, requests }));
|
|
3081
3164
|
this.setup();
|
|
3082
3165
|
}
|
|
3083
3166
|
setUid(uid) {
|
|
3084
|
-
const dispatch =
|
|
3167
|
+
const dispatch = envStore.dispatch;
|
|
3085
3168
|
dispatch(setUid(uid));
|
|
3086
3169
|
this.setup();
|
|
3087
3170
|
}
|
|
3088
3171
|
setLang(lang) {
|
|
3089
|
-
const dispatch =
|
|
3172
|
+
const dispatch = envStore.dispatch;
|
|
3090
3173
|
dispatch(setLang(lang));
|
|
3091
3174
|
this.setup();
|
|
3092
3175
|
}
|
|
3093
3176
|
setAllowCompanies(allowCompanies) {
|
|
3094
|
-
const dispatch =
|
|
3177
|
+
const dispatch = envStore.dispatch;
|
|
3095
3178
|
dispatch(setAllowCompanies(allowCompanies));
|
|
3096
3179
|
this.setup();
|
|
3097
3180
|
}
|
|
3098
3181
|
setCompanies(companies) {
|
|
3099
|
-
const dispatch =
|
|
3182
|
+
const dispatch = envStore.dispatch;
|
|
3100
3183
|
dispatch(setCompanies(companies));
|
|
3101
3184
|
this.setup();
|
|
3102
3185
|
}
|
|
3103
3186
|
setDefaultCompany(company) {
|
|
3104
|
-
const dispatch =
|
|
3187
|
+
const dispatch = envStore.dispatch;
|
|
3105
3188
|
dispatch(setDefaultCompany(company));
|
|
3106
3189
|
this.setup();
|
|
3107
3190
|
}
|
|
3108
3191
|
setUserInfo(userInfo) {
|
|
3109
|
-
const dispatch =
|
|
3192
|
+
const dispatch = envStore.dispatch;
|
|
3110
3193
|
dispatch(setUser(userInfo));
|
|
3111
3194
|
this.setup();
|
|
3112
3195
|
}
|
|
3113
3196
|
};
|
|
3114
3197
|
var env = null;
|
|
3115
3198
|
function getEnv() {
|
|
3116
|
-
if (!env)
|
|
3117
|
-
env = new EnvStore(envStore, localStorageUtils(), sessionStorageUtils());
|
|
3199
|
+
if (!env) env = new EnvStore(localStorageUtils(), sessionStorageUtils());
|
|
3118
3200
|
return env;
|
|
3119
3201
|
}
|
|
3120
3202
|
|
|
3121
3203
|
// src/services/action-service/index.ts
|
|
3122
3204
|
var ActionService = {
|
|
3123
3205
|
// Load Action
|
|
3124
|
-
loadAction(
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
}
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
});
|
|
3139
|
-
});
|
|
3140
|
-
},
|
|
3141
|
-
// Call Button
|
|
3142
|
-
callButton(_0) {
|
|
3143
|
-
return __async(this, arguments, function* ({
|
|
3144
|
-
model,
|
|
3145
|
-
ids = [],
|
|
3146
|
-
context,
|
|
3147
|
-
method
|
|
3148
|
-
}) {
|
|
3149
|
-
try {
|
|
3150
|
-
const env2 = getEnv();
|
|
3151
|
-
const jsonData = {
|
|
3152
|
-
model,
|
|
3153
|
-
method,
|
|
3154
|
-
ids,
|
|
3155
|
-
with_context: context
|
|
3156
|
-
};
|
|
3157
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3158
|
-
headers: {
|
|
3159
|
-
"Content-Type": "application/json"
|
|
3160
|
-
}
|
|
3161
|
-
});
|
|
3162
|
-
} catch (error) {
|
|
3163
|
-
console.error("Error when calling button action:", error);
|
|
3164
|
-
throw error;
|
|
3206
|
+
async loadAction({
|
|
3207
|
+
idAction,
|
|
3208
|
+
context
|
|
3209
|
+
}) {
|
|
3210
|
+
const env2 = getEnv();
|
|
3211
|
+
const jsonData = {
|
|
3212
|
+
action_id: idAction,
|
|
3213
|
+
with_context: {
|
|
3214
|
+
...context
|
|
3215
|
+
}
|
|
3216
|
+
};
|
|
3217
|
+
return env2.requests.post(`${"/load_action" /* LOAD_ACTION */}`, jsonData, {
|
|
3218
|
+
headers: {
|
|
3219
|
+
"Content-Type": "application/json"
|
|
3165
3220
|
}
|
|
3166
3221
|
});
|
|
3167
3222
|
},
|
|
3168
|
-
//
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3223
|
+
// Call Button
|
|
3224
|
+
async callButton({
|
|
3225
|
+
model,
|
|
3226
|
+
ids = [],
|
|
3227
|
+
context,
|
|
3228
|
+
method
|
|
3229
|
+
}) {
|
|
3230
|
+
try {
|
|
3175
3231
|
const env2 = getEnv();
|
|
3176
3232
|
const jsonData = {
|
|
3177
3233
|
model,
|
|
3178
|
-
method
|
|
3234
|
+
method,
|
|
3179
3235
|
ids,
|
|
3180
3236
|
with_context: context
|
|
3181
3237
|
};
|
|
@@ -3184,96 +3240,112 @@ var ActionService = {
|
|
|
3184
3240
|
"Content-Type": "application/json"
|
|
3185
3241
|
}
|
|
3186
3242
|
});
|
|
3243
|
+
} catch (error) {
|
|
3244
|
+
console.error("Error when calling button action:", error);
|
|
3245
|
+
throw error;
|
|
3246
|
+
}
|
|
3247
|
+
},
|
|
3248
|
+
// remove Row
|
|
3249
|
+
async removeRows({
|
|
3250
|
+
model,
|
|
3251
|
+
ids,
|
|
3252
|
+
context
|
|
3253
|
+
}) {
|
|
3254
|
+
const env2 = getEnv();
|
|
3255
|
+
const jsonData = {
|
|
3256
|
+
model,
|
|
3257
|
+
method: "unlink",
|
|
3258
|
+
ids,
|
|
3259
|
+
with_context: context
|
|
3260
|
+
};
|
|
3261
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3262
|
+
headers: {
|
|
3263
|
+
"Content-Type": "application/json"
|
|
3264
|
+
}
|
|
3187
3265
|
});
|
|
3188
3266
|
},
|
|
3189
3267
|
// Duplicate Model
|
|
3190
|
-
duplicateRecord(
|
|
3191
|
-
|
|
3268
|
+
async duplicateRecord({
|
|
3269
|
+
model,
|
|
3270
|
+
id,
|
|
3271
|
+
context
|
|
3272
|
+
}) {
|
|
3273
|
+
const env2 = getEnv();
|
|
3274
|
+
const jsonData = {
|
|
3192
3275
|
model,
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
with_context: context
|
|
3202
|
-
};
|
|
3203
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3204
|
-
headers: {
|
|
3205
|
-
"Content-Type": "application/json"
|
|
3206
|
-
}
|
|
3207
|
-
});
|
|
3276
|
+
method: "copy",
|
|
3277
|
+
ids: id,
|
|
3278
|
+
with_context: context
|
|
3279
|
+
};
|
|
3280
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3281
|
+
headers: {
|
|
3282
|
+
"Content-Type": "application/json"
|
|
3283
|
+
}
|
|
3208
3284
|
});
|
|
3209
3285
|
},
|
|
3210
3286
|
// Get Print Report
|
|
3211
|
-
getPrintReportName(
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
report_name: {}
|
|
3221
|
-
}
|
|
3222
|
-
}
|
|
3223
|
-
};
|
|
3224
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3225
|
-
headers: {
|
|
3226
|
-
"Content-Type": "application/json"
|
|
3287
|
+
async getPrintReportName({ id }) {
|
|
3288
|
+
const env2 = getEnv();
|
|
3289
|
+
const jsonData = {
|
|
3290
|
+
model: "ir.actions.report",
|
|
3291
|
+
method: "web_read",
|
|
3292
|
+
id,
|
|
3293
|
+
kwargs: {
|
|
3294
|
+
specification: {
|
|
3295
|
+
report_name: {}
|
|
3227
3296
|
}
|
|
3228
|
-
}
|
|
3297
|
+
}
|
|
3298
|
+
};
|
|
3299
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3300
|
+
headers: {
|
|
3301
|
+
"Content-Type": "application/json"
|
|
3302
|
+
}
|
|
3229
3303
|
});
|
|
3230
3304
|
},
|
|
3231
3305
|
//Save Print Invoice
|
|
3232
|
-
print(
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
responseType: "arraybuffer"
|
|
3249
|
-
});
|
|
3306
|
+
async print({ id, report, db }) {
|
|
3307
|
+
const env2 = getEnv();
|
|
3308
|
+
const jsonData = {
|
|
3309
|
+
report,
|
|
3310
|
+
id,
|
|
3311
|
+
type: "pdf",
|
|
3312
|
+
file_response: true,
|
|
3313
|
+
db
|
|
3314
|
+
};
|
|
3315
|
+
const queryString = toQueryString(jsonData);
|
|
3316
|
+
const urlWithParams = `${"/report" /* REPORT_PATH */}?${queryString}`;
|
|
3317
|
+
return env2.requests.get(urlWithParams, {
|
|
3318
|
+
headers: {
|
|
3319
|
+
"Content-Type": "application/json"
|
|
3320
|
+
},
|
|
3321
|
+
responseType: "arraybuffer"
|
|
3250
3322
|
});
|
|
3251
3323
|
},
|
|
3252
3324
|
//Run Action
|
|
3253
|
-
runAction(
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
}
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
}
|
|
3325
|
+
async runAction({
|
|
3326
|
+
idAction,
|
|
3327
|
+
context
|
|
3328
|
+
}) {
|
|
3329
|
+
const env2 = getEnv();
|
|
3330
|
+
const jsonData = {
|
|
3331
|
+
action_id: idAction,
|
|
3332
|
+
with_context: {
|
|
3333
|
+
...context
|
|
3334
|
+
}
|
|
3335
|
+
// context: {
|
|
3336
|
+
// lang: 'en_US',
|
|
3337
|
+
// tz: 'Asia/Saigon',
|
|
3338
|
+
// uid: 2,
|
|
3339
|
+
// allowed_company_ids: [1],
|
|
3340
|
+
// active_id: Array.isArray(idDetail) ? idDetail[0] : idDetail,
|
|
3341
|
+
// active_ids: Array.isArray(idDetail) ? [...idDetail] : idDetail,
|
|
3342
|
+
// active_model: model,
|
|
3343
|
+
// },
|
|
3344
|
+
};
|
|
3345
|
+
return env2.requests.post(`${"/run_action" /* RUN_ACTION_PATH */}`, jsonData, {
|
|
3346
|
+
headers: {
|
|
3347
|
+
"Content-Type": "application/json"
|
|
3348
|
+
}
|
|
3277
3349
|
});
|
|
3278
3350
|
}
|
|
3279
3351
|
};
|
|
@@ -3281,238 +3353,214 @@ var action_service_default = ActionService;
|
|
|
3281
3353
|
|
|
3282
3354
|
// src/services/auth-service/index.ts
|
|
3283
3355
|
var AuthService = {
|
|
3284
|
-
login(body) {
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
3301
|
-
}
|
|
3302
|
-
});
|
|
3356
|
+
async login(body) {
|
|
3357
|
+
const env2 = getEnv();
|
|
3358
|
+
const payload = Object.fromEntries(
|
|
3359
|
+
Object.entries({
|
|
3360
|
+
username: body.email,
|
|
3361
|
+
password: body.password,
|
|
3362
|
+
grant_type: env2?.config?.grantType || "",
|
|
3363
|
+
client_id: env2?.config?.clientId || "",
|
|
3364
|
+
client_secret: env2?.config?.clientSecret || ""
|
|
3365
|
+
}).filter(([_, value]) => !!value)
|
|
3366
|
+
);
|
|
3367
|
+
const encodedData = new URLSearchParams(payload).toString();
|
|
3368
|
+
return env2?.requests?.post(body.path, encodedData, {
|
|
3369
|
+
headers: {
|
|
3370
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
3371
|
+
}
|
|
3303
3372
|
});
|
|
3304
3373
|
},
|
|
3305
|
-
forgotPassword(email) {
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
"Content-Type": "application/json"
|
|
3316
|
-
}
|
|
3317
|
-
});
|
|
3374
|
+
async forgotPassword(email) {
|
|
3375
|
+
const env2 = getEnv();
|
|
3376
|
+
const bodyData = {
|
|
3377
|
+
login: email,
|
|
3378
|
+
url: `${window.location.origin}/reset-password`
|
|
3379
|
+
};
|
|
3380
|
+
return env2?.requests?.post("/reset_password" /* RESET_PASSWORD_PATH */, bodyData, {
|
|
3381
|
+
headers: {
|
|
3382
|
+
"Content-Type": "application/json"
|
|
3383
|
+
}
|
|
3318
3384
|
});
|
|
3319
3385
|
},
|
|
3320
|
-
forgotPasswordSSO(
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
vals: {
|
|
3332
|
-
email
|
|
3333
|
-
}
|
|
3334
|
-
},
|
|
3335
|
-
with_context
|
|
3336
|
-
};
|
|
3337
|
-
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, body, {
|
|
3338
|
-
headers: {
|
|
3339
|
-
"Content-Type": "application/json"
|
|
3386
|
+
async forgotPasswordSSO({
|
|
3387
|
+
email,
|
|
3388
|
+
with_context,
|
|
3389
|
+
method
|
|
3390
|
+
}) {
|
|
3391
|
+
const env2 = getEnv();
|
|
3392
|
+
const body = {
|
|
3393
|
+
method,
|
|
3394
|
+
kwargs: {
|
|
3395
|
+
vals: {
|
|
3396
|
+
email
|
|
3340
3397
|
}
|
|
3341
|
-
}
|
|
3398
|
+
},
|
|
3399
|
+
with_context
|
|
3400
|
+
};
|
|
3401
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, body, {
|
|
3402
|
+
headers: {
|
|
3403
|
+
"Content-Type": "application/json"
|
|
3404
|
+
}
|
|
3342
3405
|
});
|
|
3343
3406
|
},
|
|
3344
|
-
resetPassword(data, token) {
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
"Content-Type": "application/json"
|
|
3356
|
-
}
|
|
3357
|
-
});
|
|
3407
|
+
async resetPassword(data, token) {
|
|
3408
|
+
const env2 = getEnv();
|
|
3409
|
+
const bodyData = {
|
|
3410
|
+
token,
|
|
3411
|
+
password: data.password,
|
|
3412
|
+
new_password: data.confirmPassword
|
|
3413
|
+
};
|
|
3414
|
+
return env2?.requests?.post("/change_password" /* CHANGE_PASSWORD_PATH */, bodyData, {
|
|
3415
|
+
headers: {
|
|
3416
|
+
"Content-Type": "application/json"
|
|
3417
|
+
}
|
|
3358
3418
|
});
|
|
3359
3419
|
},
|
|
3360
|
-
resetPasswordSSO(
|
|
3361
|
-
|
|
3420
|
+
async resetPasswordSSO({
|
|
3421
|
+
method,
|
|
3422
|
+
password,
|
|
3423
|
+
with_context
|
|
3424
|
+
}) {
|
|
3425
|
+
const env2 = getEnv();
|
|
3426
|
+
const bodyData = {
|
|
3362
3427
|
method,
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
var _a;
|
|
3367
|
-
const env2 = getEnv();
|
|
3368
|
-
const bodyData = {
|
|
3369
|
-
method,
|
|
3370
|
-
kwargs: {
|
|
3371
|
-
vals: {
|
|
3372
|
-
password
|
|
3373
|
-
}
|
|
3374
|
-
},
|
|
3375
|
-
with_context
|
|
3376
|
-
};
|
|
3377
|
-
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, bodyData, {
|
|
3378
|
-
headers: {
|
|
3379
|
-
"Content-Type": "application/json"
|
|
3428
|
+
kwargs: {
|
|
3429
|
+
vals: {
|
|
3430
|
+
password
|
|
3380
3431
|
}
|
|
3381
|
-
}
|
|
3432
|
+
},
|
|
3433
|
+
with_context
|
|
3434
|
+
};
|
|
3435
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, bodyData, {
|
|
3436
|
+
headers: {
|
|
3437
|
+
"Content-Type": "application/json"
|
|
3438
|
+
}
|
|
3382
3439
|
});
|
|
3383
3440
|
},
|
|
3384
|
-
updatePassword(data, token) {
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
"Content-Type": "application/json"
|
|
3396
|
-
}
|
|
3397
|
-
});
|
|
3441
|
+
async updatePassword(data, token) {
|
|
3442
|
+
const env2 = getEnv();
|
|
3443
|
+
const bodyData = {
|
|
3444
|
+
token,
|
|
3445
|
+
old_password: data.oldPassword,
|
|
3446
|
+
new_password: data.newPassword
|
|
3447
|
+
};
|
|
3448
|
+
return env2?.requests?.post("/change_password_parent" /* UPDATE_PASSWORD_PATH */, bodyData, {
|
|
3449
|
+
headers: {
|
|
3450
|
+
"Content-Type": "application/json"
|
|
3451
|
+
}
|
|
3398
3452
|
});
|
|
3399
3453
|
},
|
|
3400
|
-
isValidToken(token) {
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3454
|
+
async isValidToken(token) {
|
|
3455
|
+
const env2 = getEnv();
|
|
3456
|
+
const bodyData = {
|
|
3457
|
+
token
|
|
3458
|
+
};
|
|
3459
|
+
return env2?.requests?.post("/check_token" /* TOKEN */, bodyData, {
|
|
3460
|
+
headers: {
|
|
3461
|
+
"Content-Type": "application/json"
|
|
3462
|
+
}
|
|
3463
|
+
});
|
|
3464
|
+
},
|
|
3465
|
+
async isValidActionToken(actionToken, path) {
|
|
3466
|
+
const env2 = getEnv();
|
|
3467
|
+
return env2?.requests?.post(
|
|
3468
|
+
path,
|
|
3469
|
+
{},
|
|
3470
|
+
{
|
|
3408
3471
|
headers: {
|
|
3409
3472
|
"Content-Type": "application/json"
|
|
3410
|
-
}
|
|
3411
|
-
|
|
3412
|
-
|
|
3473
|
+
},
|
|
3474
|
+
useActionToken: true,
|
|
3475
|
+
actionToken
|
|
3476
|
+
}
|
|
3477
|
+
);
|
|
3413
3478
|
},
|
|
3414
|
-
loginSocial(
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
{
|
|
3425
|
-
|
|
3426
|
-
headers: {
|
|
3427
|
-
"Content-Type": "application/json"
|
|
3428
|
-
}
|
|
3479
|
+
async loginSocial({
|
|
3480
|
+
db,
|
|
3481
|
+
state,
|
|
3482
|
+
access_token
|
|
3483
|
+
}) {
|
|
3484
|
+
const env2 = getEnv();
|
|
3485
|
+
return env2?.requests?.post(
|
|
3486
|
+
"/token/generate" /* GENTOKEN_SOCIAL */,
|
|
3487
|
+
{ state, access_token },
|
|
3488
|
+
{
|
|
3489
|
+
headers: {
|
|
3490
|
+
"Content-Type": "application/json"
|
|
3429
3491
|
}
|
|
3430
|
-
|
|
3431
|
-
|
|
3492
|
+
}
|
|
3493
|
+
);
|
|
3432
3494
|
},
|
|
3433
|
-
getProviders(db) {
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
const env2 = getEnv();
|
|
3437
|
-
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.get("/oauth/providers", { params: { db } });
|
|
3438
|
-
});
|
|
3495
|
+
async getProviders(db) {
|
|
3496
|
+
const env2 = getEnv();
|
|
3497
|
+
return env2?.requests?.get("/oauth/providers", { params: { db } });
|
|
3439
3498
|
},
|
|
3440
|
-
getAccessByCode(code) {
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
headers: {
|
|
3454
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
3455
|
-
}
|
|
3499
|
+
async getAccessByCode(code) {
|
|
3500
|
+
const env2 = getEnv();
|
|
3501
|
+
const data = new URLSearchParams();
|
|
3502
|
+
data.append("code", code);
|
|
3503
|
+
data.append("grant_type", "authorization_code");
|
|
3504
|
+
data.append("client_id", env2?.config?.clientId || "");
|
|
3505
|
+
data.append("redirect_uri", env2?.config?.redirectUri || "");
|
|
3506
|
+
return env2?.requests?.post(
|
|
3507
|
+
`${env2?.baseUrl?.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
|
|
3508
|
+
data,
|
|
3509
|
+
{
|
|
3510
|
+
headers: {
|
|
3511
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
3456
3512
|
}
|
|
3457
|
-
|
|
3458
|
-
|
|
3513
|
+
}
|
|
3514
|
+
);
|
|
3459
3515
|
},
|
|
3460
|
-
logout(data) {
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
{
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
}
|
|
3475
|
-
);
|
|
3476
|
-
});
|
|
3516
|
+
async logout(data) {
|
|
3517
|
+
const env2 = getEnv();
|
|
3518
|
+
console.log(data);
|
|
3519
|
+
return env2?.requests?.post(
|
|
3520
|
+
"/logout" /* LOGOUT */,
|
|
3521
|
+
{},
|
|
3522
|
+
{
|
|
3523
|
+
headers: {
|
|
3524
|
+
"Content-Type": "application/json"
|
|
3525
|
+
},
|
|
3526
|
+
withCredentials: true,
|
|
3527
|
+
useRefreshToken: true
|
|
3528
|
+
}
|
|
3529
|
+
);
|
|
3477
3530
|
}
|
|
3478
3531
|
};
|
|
3479
3532
|
var auth_service_default = AuthService;
|
|
3480
3533
|
|
|
3481
3534
|
// src/services/company-service/index.ts
|
|
3482
3535
|
var CompanyService = {
|
|
3483
|
-
getCurrentCompany() {
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
}
|
|
3490
|
-
});
|
|
3536
|
+
async getCurrentCompany() {
|
|
3537
|
+
const env2 = getEnv();
|
|
3538
|
+
return await env2.requests.get("/company" /* COMPANY_PATH */, {
|
|
3539
|
+
headers: {
|
|
3540
|
+
"Content-Type": "application/json"
|
|
3541
|
+
}
|
|
3491
3542
|
});
|
|
3492
3543
|
},
|
|
3493
|
-
getInfoCompany(id) {
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
display_name: {},
|
|
3507
|
-
secondary_logo: {}
|
|
3508
|
-
}
|
|
3509
|
-
}
|
|
3510
|
-
};
|
|
3511
|
-
return yield (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
3512
|
-
headers: {
|
|
3513
|
-
"Content-Type": "application/json"
|
|
3544
|
+
async getInfoCompany(id) {
|
|
3545
|
+
const env2 = getEnv();
|
|
3546
|
+
const jsonData = {
|
|
3547
|
+
ids: [id],
|
|
3548
|
+
model: "res.company" /* COMPANY */,
|
|
3549
|
+
method: "web_read" /* WEB_READ */,
|
|
3550
|
+
kwargs: {
|
|
3551
|
+
specification: {
|
|
3552
|
+
primary_color: {},
|
|
3553
|
+
secondary_color: {},
|
|
3554
|
+
logo: {},
|
|
3555
|
+
display_name: {},
|
|
3556
|
+
secondary_logo: {}
|
|
3514
3557
|
}
|
|
3515
|
-
}
|
|
3558
|
+
}
|
|
3559
|
+
};
|
|
3560
|
+
return await env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
3561
|
+
headers: {
|
|
3562
|
+
"Content-Type": "application/json"
|
|
3563
|
+
}
|
|
3516
3564
|
});
|
|
3517
3565
|
}
|
|
3518
3566
|
};
|
|
@@ -3520,328 +3568,300 @@ var company_service_default = CompanyService;
|
|
|
3520
3568
|
|
|
3521
3569
|
// src/services/excel-service/index.ts
|
|
3522
3570
|
var ExcelService = {
|
|
3523
|
-
uploadFile(
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
}
|
|
3530
|
-
});
|
|
3571
|
+
async uploadFile({ formData }) {
|
|
3572
|
+
const env2 = getEnv();
|
|
3573
|
+
return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
|
|
3574
|
+
headers: {
|
|
3575
|
+
"Content-Type": "multipart/form-data"
|
|
3576
|
+
}
|
|
3531
3577
|
});
|
|
3532
3578
|
},
|
|
3533
|
-
uploadIdFile(
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
}
|
|
3540
|
-
});
|
|
3579
|
+
async uploadIdFile({ formData }) {
|
|
3580
|
+
const env2 = getEnv();
|
|
3581
|
+
return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
|
|
3582
|
+
headers: {
|
|
3583
|
+
"Content-Type": "multipart/form-data"
|
|
3584
|
+
}
|
|
3541
3585
|
});
|
|
3542
3586
|
},
|
|
3543
|
-
parsePreview(
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
tracking_disable: true
|
|
3576
|
-
}
|
|
3577
|
-
},
|
|
3578
|
-
with_context: context
|
|
3579
|
-
};
|
|
3580
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3581
|
-
headers: {
|
|
3582
|
-
"Content-Type": "multipart/form-data"
|
|
3587
|
+
async parsePreview({
|
|
3588
|
+
id,
|
|
3589
|
+
selectedSheet,
|
|
3590
|
+
isHeader,
|
|
3591
|
+
context
|
|
3592
|
+
}) {
|
|
3593
|
+
const env2 = getEnv();
|
|
3594
|
+
const jsonData = {
|
|
3595
|
+
model: "base_import.import" /* BASE_IMPORT */,
|
|
3596
|
+
method: "parse_preview",
|
|
3597
|
+
ids: [id],
|
|
3598
|
+
kwargs: {
|
|
3599
|
+
options: {
|
|
3600
|
+
import_skip_records: [],
|
|
3601
|
+
import_set_empty_fields: [],
|
|
3602
|
+
fallback_values: {},
|
|
3603
|
+
name_create_enabled_fields: {},
|
|
3604
|
+
encoding: "",
|
|
3605
|
+
separator: "",
|
|
3606
|
+
quoting: '"',
|
|
3607
|
+
date_format: "",
|
|
3608
|
+
datetime_format: "",
|
|
3609
|
+
float_thousand_separator: ",",
|
|
3610
|
+
float_decimal_separator: ".",
|
|
3611
|
+
advanced: true,
|
|
3612
|
+
has_headers: isHeader,
|
|
3613
|
+
keep_matches: false,
|
|
3614
|
+
limit: 2e3,
|
|
3615
|
+
sheets: [],
|
|
3616
|
+
sheet: selectedSheet,
|
|
3617
|
+
skip: 0,
|
|
3618
|
+
tracking_disable: true
|
|
3583
3619
|
}
|
|
3584
|
-
}
|
|
3620
|
+
},
|
|
3621
|
+
with_context: context
|
|
3622
|
+
};
|
|
3623
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3624
|
+
headers: {
|
|
3625
|
+
"Content-Type": "multipart/form-data"
|
|
3626
|
+
}
|
|
3585
3627
|
});
|
|
3586
3628
|
},
|
|
3587
|
-
executeImport(
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
}
|
|
3613
|
-
});
|
|
3629
|
+
async executeImport({
|
|
3630
|
+
columns,
|
|
3631
|
+
fields,
|
|
3632
|
+
idFile,
|
|
3633
|
+
options,
|
|
3634
|
+
dryrun,
|
|
3635
|
+
context
|
|
3636
|
+
}) {
|
|
3637
|
+
const env2 = getEnv();
|
|
3638
|
+
const jsonData = {
|
|
3639
|
+
model: "base_import.import" /* BASE_IMPORT */,
|
|
3640
|
+
method: "execute_import",
|
|
3641
|
+
ids: [idFile],
|
|
3642
|
+
kwargs: {
|
|
3643
|
+
fields,
|
|
3644
|
+
columns,
|
|
3645
|
+
options,
|
|
3646
|
+
dryrun
|
|
3647
|
+
},
|
|
3648
|
+
with_context: context
|
|
3649
|
+
};
|
|
3650
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3651
|
+
headers: {
|
|
3652
|
+
"Content-Type": "multipart/form-data"
|
|
3653
|
+
}
|
|
3614
3654
|
});
|
|
3615
3655
|
},
|
|
3616
|
-
getFileExcel(
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonData);
|
|
3625
|
-
});
|
|
3656
|
+
async getFileExcel({ model }) {
|
|
3657
|
+
const env2 = getEnv();
|
|
3658
|
+
const jsonData = {
|
|
3659
|
+
model,
|
|
3660
|
+
method: "get_import_templates" /* GET_IMPORT */,
|
|
3661
|
+
args: []
|
|
3662
|
+
};
|
|
3663
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData);
|
|
3626
3664
|
},
|
|
3627
|
-
getFieldExport(
|
|
3628
|
-
|
|
3629
|
-
|
|
3665
|
+
async getFieldExport({
|
|
3666
|
+
ids,
|
|
3667
|
+
model,
|
|
3668
|
+
isShow,
|
|
3669
|
+
parentField,
|
|
3670
|
+
fieldType,
|
|
3671
|
+
parentName,
|
|
3672
|
+
prefix,
|
|
3673
|
+
name,
|
|
3674
|
+
context,
|
|
3675
|
+
importCompat
|
|
3676
|
+
}) {
|
|
3677
|
+
const env2 = getEnv();
|
|
3678
|
+
const jsonData = {
|
|
3630
3679
|
model,
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
domain: [["id", "in", ids]],
|
|
3645
|
-
with_context: context
|
|
3646
|
-
};
|
|
3647
|
-
if (isShow) {
|
|
3648
|
-
jsonData.parent_field = parentField;
|
|
3649
|
-
jsonData.parent_field_type = fieldType;
|
|
3650
|
-
jsonData.parent_name = parentName;
|
|
3651
|
-
jsonData.name = name;
|
|
3652
|
-
jsonData.prefix = prefix;
|
|
3653
|
-
jsonData.exclude = [null];
|
|
3654
|
-
}
|
|
3655
|
-
return env2.requests.post("/export/get_fields", jsonData);
|
|
3656
|
-
});
|
|
3680
|
+
import_compat: importCompat,
|
|
3681
|
+
domain: [["id", "in", ids]],
|
|
3682
|
+
with_context: context
|
|
3683
|
+
};
|
|
3684
|
+
if (isShow) {
|
|
3685
|
+
jsonData.parent_field = parentField;
|
|
3686
|
+
jsonData.parent_field_type = fieldType;
|
|
3687
|
+
jsonData.parent_name = parentName;
|
|
3688
|
+
jsonData.name = name;
|
|
3689
|
+
jsonData.prefix = prefix;
|
|
3690
|
+
jsonData.exclude = [null];
|
|
3691
|
+
}
|
|
3692
|
+
return env2.requests.post("/export/get_fields", jsonData);
|
|
3657
3693
|
},
|
|
3658
|
-
exportExcel(
|
|
3659
|
-
|
|
3694
|
+
async exportExcel({
|
|
3695
|
+
model,
|
|
3696
|
+
domain,
|
|
3697
|
+
ids,
|
|
3698
|
+
fields,
|
|
3699
|
+
type,
|
|
3700
|
+
importCompat,
|
|
3701
|
+
context,
|
|
3702
|
+
groupby
|
|
3703
|
+
}) {
|
|
3704
|
+
const env2 = getEnv();
|
|
3705
|
+
const jsonData = {
|
|
3660
3706
|
model,
|
|
3661
3707
|
domain,
|
|
3662
3708
|
ids,
|
|
3709
|
+
import_compat: importCompat,
|
|
3663
3710
|
fields,
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
}) {
|
|
3669
|
-
const env2 = getEnv();
|
|
3670
|
-
const jsonData = {
|
|
3671
|
-
model,
|
|
3672
|
-
domain,
|
|
3673
|
-
ids,
|
|
3674
|
-
import_compat: importCompat,
|
|
3675
|
-
fields,
|
|
3676
|
-
with_context: context,
|
|
3677
|
-
groupby: groupby != null ? groupby : []
|
|
3678
|
-
};
|
|
3679
|
-
return env2.requests.post_excel(`/export/${type}`, jsonData);
|
|
3680
|
-
});
|
|
3711
|
+
with_context: context,
|
|
3712
|
+
groupby: groupby ?? []
|
|
3713
|
+
};
|
|
3714
|
+
return env2.requests.post_excel(`/export/${type}`, jsonData);
|
|
3681
3715
|
}
|
|
3682
3716
|
};
|
|
3683
3717
|
var excel_service_default = ExcelService;
|
|
3684
3718
|
|
|
3685
3719
|
// src/services/form-service/index.ts
|
|
3686
3720
|
var FormService = {
|
|
3687
|
-
getComment(
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
}
|
|
3708
|
-
});
|
|
3709
|
-
},
|
|
3710
|
-
sentComment(_0) {
|
|
3711
|
-
return __async(this, arguments, function* ({ data }) {
|
|
3712
|
-
try {
|
|
3713
|
-
const env2 = getEnv();
|
|
3714
|
-
const jsonData = {
|
|
3715
|
-
context: {
|
|
3716
|
-
tz: "Asia/Saigon",
|
|
3717
|
-
uid: 2,
|
|
3718
|
-
allowed_company_ids: [1],
|
|
3719
|
-
mail_post_autofollow: false,
|
|
3720
|
-
temporary_id: 142183.01
|
|
3721
|
-
},
|
|
3722
|
-
post_data: {
|
|
3723
|
-
body: data.message,
|
|
3724
|
-
message_type: "comment",
|
|
3725
|
-
attachment_ids: data.attachment_ids,
|
|
3726
|
-
attachment_tokens: [],
|
|
3727
|
-
subtype_xmlid: data.subtype
|
|
3728
|
-
},
|
|
3729
|
-
thread_id: Number(data.thread_id),
|
|
3730
|
-
thread_model: data.thread_model
|
|
3731
|
-
};
|
|
3732
|
-
return env2.requests.post("/chatter/message/post" /* SENT_MESSAGE */, jsonData, {
|
|
3733
|
-
headers: {
|
|
3734
|
-
"Content-Type": "application/json"
|
|
3735
|
-
}
|
|
3736
|
-
});
|
|
3737
|
-
} catch (error) {
|
|
3738
|
-
console.error("Error when sent message:", error);
|
|
3739
|
-
throw error;
|
|
3740
|
-
}
|
|
3741
|
-
});
|
|
3721
|
+
async getComment({ data }) {
|
|
3722
|
+
try {
|
|
3723
|
+
const env2 = getEnv();
|
|
3724
|
+
const jsonData = {
|
|
3725
|
+
thread_id: data.thread_id,
|
|
3726
|
+
thread_model: data.thread_model,
|
|
3727
|
+
limit: 100,
|
|
3728
|
+
with_context: {
|
|
3729
|
+
lang: data.lang
|
|
3730
|
+
}
|
|
3731
|
+
};
|
|
3732
|
+
return env2.requests.post("/chatter/thread/messages" /* GET_MESSAGE */, jsonData, {
|
|
3733
|
+
headers: {
|
|
3734
|
+
"Content-Type": "application/json"
|
|
3735
|
+
}
|
|
3736
|
+
});
|
|
3737
|
+
} catch (error) {
|
|
3738
|
+
console.error("Error when sending message:", error);
|
|
3739
|
+
throw error;
|
|
3740
|
+
}
|
|
3742
3741
|
},
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3742
|
+
async sentComment({ data }) {
|
|
3743
|
+
try {
|
|
3744
|
+
const env2 = getEnv();
|
|
3745
|
+
const jsonData = {
|
|
3746
|
+
context: {
|
|
3747
|
+
tz: "Asia/Saigon",
|
|
3748
|
+
uid: 2,
|
|
3749
|
+
allowed_company_ids: [1],
|
|
3750
|
+
mail_post_autofollow: false,
|
|
3751
|
+
temporary_id: 142183.01
|
|
3752
|
+
},
|
|
3753
|
+
post_data: {
|
|
3754
|
+
body: data.message,
|
|
3755
|
+
message_type: "comment",
|
|
3756
|
+
attachment_ids: data.attachment_ids,
|
|
3749
3757
|
attachment_tokens: [],
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
getImage(_0) {
|
|
3765
|
-
return __async(this, arguments, function* ({ data }) {
|
|
3766
|
-
try {
|
|
3767
|
-
const env2 = getEnv();
|
|
3768
|
-
return env2.requests.get(
|
|
3769
|
-
`${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
|
|
3770
|
-
{
|
|
3771
|
-
headers: {
|
|
3772
|
-
"Content-Type": "application/json"
|
|
3773
|
-
}
|
|
3774
|
-
}
|
|
3775
|
-
);
|
|
3776
|
-
} catch (error) {
|
|
3777
|
-
console.error("Error when sent message:", error);
|
|
3778
|
-
throw error;
|
|
3779
|
-
}
|
|
3780
|
-
});
|
|
3758
|
+
subtype_xmlid: data.subtype
|
|
3759
|
+
},
|
|
3760
|
+
thread_id: Number(data.thread_id),
|
|
3761
|
+
thread_model: data.thread_model
|
|
3762
|
+
};
|
|
3763
|
+
return env2.requests.post("/chatter/message/post" /* SENT_MESSAGE */, jsonData, {
|
|
3764
|
+
headers: {
|
|
3765
|
+
"Content-Type": "application/json"
|
|
3766
|
+
}
|
|
3767
|
+
});
|
|
3768
|
+
} catch (error) {
|
|
3769
|
+
console.error("Error when sent message:", error);
|
|
3770
|
+
throw error;
|
|
3771
|
+
}
|
|
3781
3772
|
},
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3773
|
+
async deleteComment({ data }) {
|
|
3774
|
+
try {
|
|
3775
|
+
const env2 = getEnv();
|
|
3776
|
+
const jsonData = {
|
|
3777
|
+
attachment_ids: [],
|
|
3778
|
+
attachment_tokens: [],
|
|
3779
|
+
body: "",
|
|
3780
|
+
message_id: data.message_id
|
|
3781
|
+
};
|
|
3782
|
+
return env2.requests.post("/chatter/message/update_content" /* DELETE_MESSAGE */, jsonData, {
|
|
3783
|
+
headers: {
|
|
3784
|
+
"Content-Type": "application/json"
|
|
3785
|
+
}
|
|
3786
|
+
});
|
|
3787
|
+
} catch (error) {
|
|
3788
|
+
console.error("Error when sent message:", error);
|
|
3789
|
+
throw error;
|
|
3790
|
+
}
|
|
3796
3791
|
},
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
method: "get_formview_action",
|
|
3804
|
-
ids: data.id ? [data.id] : [],
|
|
3805
|
-
with_context: data.context
|
|
3806
|
-
};
|
|
3807
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3792
|
+
async getImage({ data }) {
|
|
3793
|
+
try {
|
|
3794
|
+
const env2 = getEnv();
|
|
3795
|
+
return env2.requests.get(
|
|
3796
|
+
`${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
|
|
3797
|
+
{
|
|
3808
3798
|
headers: {
|
|
3809
3799
|
"Content-Type": "application/json"
|
|
3810
3800
|
}
|
|
3811
|
-
}
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
}
|
|
3801
|
+
}
|
|
3802
|
+
);
|
|
3803
|
+
} catch (error) {
|
|
3804
|
+
console.error("Error when sent message:", error);
|
|
3805
|
+
throw error;
|
|
3806
|
+
}
|
|
3817
3807
|
},
|
|
3818
|
-
|
|
3819
|
-
|
|
3808
|
+
async uploadImage({ data }) {
|
|
3809
|
+
try {
|
|
3810
|
+
const env2 = getEnv();
|
|
3811
|
+
return env2.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
|
|
3812
|
+
headers: {
|
|
3813
|
+
"Content-Type": "multipart/form-data"
|
|
3814
|
+
}
|
|
3815
|
+
});
|
|
3816
|
+
} catch (error) {
|
|
3817
|
+
console.error("Error when sent message:", error);
|
|
3818
|
+
throw error;
|
|
3819
|
+
}
|
|
3820
|
+
},
|
|
3821
|
+
async getFormView({ data }) {
|
|
3822
|
+
try {
|
|
3820
3823
|
const env2 = getEnv();
|
|
3821
|
-
const vals = {
|
|
3822
|
-
[data.name]: data.stage_id
|
|
3823
|
-
};
|
|
3824
3824
|
const jsonData = {
|
|
3825
3825
|
model: data.model,
|
|
3826
|
-
method: "
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
allowed_company_ids: [1],
|
|
3830
|
-
uid: 2,
|
|
3831
|
-
search_default_my_ticket: true,
|
|
3832
|
-
search_default_is_open: true
|
|
3833
|
-
},
|
|
3834
|
-
ids: [data.id],
|
|
3835
|
-
kwargs: {
|
|
3836
|
-
vals,
|
|
3837
|
-
specification: {}
|
|
3838
|
-
}
|
|
3826
|
+
method: "get_formview_action",
|
|
3827
|
+
ids: data.id ? [data.id] : [],
|
|
3828
|
+
with_context: data.context
|
|
3839
3829
|
};
|
|
3840
3830
|
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3841
3831
|
headers: {
|
|
3842
3832
|
"Content-Type": "application/json"
|
|
3843
3833
|
}
|
|
3844
3834
|
});
|
|
3835
|
+
} catch (error) {
|
|
3836
|
+
console.error("Error when fetching form view:", error);
|
|
3837
|
+
throw error;
|
|
3838
|
+
}
|
|
3839
|
+
},
|
|
3840
|
+
async changeStatus({ data }) {
|
|
3841
|
+
const env2 = getEnv();
|
|
3842
|
+
const vals = {
|
|
3843
|
+
[data.name]: data.stage_id
|
|
3844
|
+
};
|
|
3845
|
+
const jsonData = {
|
|
3846
|
+
model: data.model,
|
|
3847
|
+
method: "web_save",
|
|
3848
|
+
with_context: {
|
|
3849
|
+
lang: data.lang,
|
|
3850
|
+
allowed_company_ids: [1],
|
|
3851
|
+
uid: 2,
|
|
3852
|
+
search_default_my_ticket: true,
|
|
3853
|
+
search_default_is_open: true
|
|
3854
|
+
},
|
|
3855
|
+
ids: [data.id],
|
|
3856
|
+
kwargs: {
|
|
3857
|
+
vals,
|
|
3858
|
+
specification: {}
|
|
3859
|
+
}
|
|
3860
|
+
};
|
|
3861
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3862
|
+
headers: {
|
|
3863
|
+
"Content-Type": "application/json"
|
|
3864
|
+
}
|
|
3845
3865
|
});
|
|
3846
3866
|
}
|
|
3847
3867
|
};
|
|
@@ -3849,55 +3869,51 @@ var form_service_default = FormService;
|
|
|
3849
3869
|
|
|
3850
3870
|
// src/services/kanban-service/index.ts
|
|
3851
3871
|
var KanbanServices = {
|
|
3852
|
-
getGroups(
|
|
3853
|
-
|
|
3872
|
+
async getGroups({
|
|
3873
|
+
model,
|
|
3874
|
+
width_context
|
|
3875
|
+
}) {
|
|
3876
|
+
const env2 = getEnv();
|
|
3877
|
+
const jsonDataView = {
|
|
3854
3878
|
model,
|
|
3879
|
+
method: "web_read_group",
|
|
3880
|
+
kwargs: {
|
|
3881
|
+
domain: [["stage_id.fold", "=", false]],
|
|
3882
|
+
fields: ["color:sum"],
|
|
3883
|
+
groupby: ["stage_id"]
|
|
3884
|
+
},
|
|
3855
3885
|
width_context
|
|
3856
|
-
}
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
kwargs: {
|
|
3862
|
-
domain: [["stage_id.fold", "=", false]],
|
|
3863
|
-
fields: ["color:sum"],
|
|
3864
|
-
groupby: ["stage_id"]
|
|
3865
|
-
},
|
|
3866
|
-
width_context
|
|
3867
|
-
};
|
|
3868
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
3869
|
-
headers: {
|
|
3870
|
-
"Content-Type": "application/json"
|
|
3871
|
-
}
|
|
3872
|
-
});
|
|
3886
|
+
};
|
|
3887
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
3888
|
+
headers: {
|
|
3889
|
+
"Content-Type": "application/json"
|
|
3890
|
+
}
|
|
3873
3891
|
});
|
|
3874
3892
|
},
|
|
3875
|
-
getProgressBar(
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3893
|
+
async getProgressBar({
|
|
3894
|
+
field,
|
|
3895
|
+
color,
|
|
3896
|
+
model,
|
|
3897
|
+
width_context
|
|
3898
|
+
}) {
|
|
3899
|
+
const env2 = getEnv();
|
|
3900
|
+
const jsonDataView = {
|
|
3879
3901
|
model,
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
domain: [],
|
|
3888
|
-
group_by: "stage_id",
|
|
3889
|
-
progress_bar: {
|
|
3890
|
-
colors: color,
|
|
3891
|
-
field
|
|
3892
|
-
}
|
|
3893
|
-
},
|
|
3894
|
-
width_context
|
|
3895
|
-
};
|
|
3896
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
3897
|
-
headers: {
|
|
3898
|
-
"Content-Type": "application/json"
|
|
3902
|
+
method: "read_progress_bar",
|
|
3903
|
+
kwargs: {
|
|
3904
|
+
domain: [],
|
|
3905
|
+
group_by: "stage_id",
|
|
3906
|
+
progress_bar: {
|
|
3907
|
+
colors: color,
|
|
3908
|
+
field
|
|
3899
3909
|
}
|
|
3900
|
-
}
|
|
3910
|
+
},
|
|
3911
|
+
width_context
|
|
3912
|
+
};
|
|
3913
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
3914
|
+
headers: {
|
|
3915
|
+
"Content-Type": "application/json"
|
|
3916
|
+
}
|
|
3901
3917
|
});
|
|
3902
3918
|
}
|
|
3903
3919
|
};
|
|
@@ -3906,285 +3922,259 @@ var kanban_service_default = KanbanServices;
|
|
|
3906
3922
|
// src/services/model-service/index.ts
|
|
3907
3923
|
var OBJECT_POSITION = 2;
|
|
3908
3924
|
var ModelService = {
|
|
3909
|
-
getListMyBankAccount(
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
}
|
|
3930
|
-
});
|
|
3925
|
+
async getListMyBankAccount({
|
|
3926
|
+
domain,
|
|
3927
|
+
spectification,
|
|
3928
|
+
model
|
|
3929
|
+
}) {
|
|
3930
|
+
const env2 = getEnv();
|
|
3931
|
+
const jsonData = {
|
|
3932
|
+
model,
|
|
3933
|
+
method: "web_search_read",
|
|
3934
|
+
kwargs: {
|
|
3935
|
+
specification: spectification,
|
|
3936
|
+
domain,
|
|
3937
|
+
limit: 100,
|
|
3938
|
+
offset: 0
|
|
3939
|
+
}
|
|
3940
|
+
};
|
|
3941
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3942
|
+
headers: {
|
|
3943
|
+
"Content-Type": "application/json"
|
|
3944
|
+
}
|
|
3931
3945
|
});
|
|
3932
3946
|
},
|
|
3933
|
-
getCurrency() {
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
}
|
|
3953
|
-
});
|
|
3947
|
+
async getCurrency() {
|
|
3948
|
+
const env2 = getEnv();
|
|
3949
|
+
const jsonData = {
|
|
3950
|
+
model: "res.currency",
|
|
3951
|
+
method: "web_search_read",
|
|
3952
|
+
kwargs: {
|
|
3953
|
+
specification: {
|
|
3954
|
+
icon_url: {},
|
|
3955
|
+
name: {}
|
|
3956
|
+
},
|
|
3957
|
+
domain: [["active", "=", true]],
|
|
3958
|
+
limit: 100,
|
|
3959
|
+
offset: 0
|
|
3960
|
+
}
|
|
3961
|
+
};
|
|
3962
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3963
|
+
headers: {
|
|
3964
|
+
"Content-Type": "application/json"
|
|
3965
|
+
}
|
|
3954
3966
|
});
|
|
3955
3967
|
},
|
|
3956
|
-
getConversionRate() {
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
sell: {}
|
|
3970
|
-
}
|
|
3968
|
+
async getConversionRate() {
|
|
3969
|
+
const env2 = getEnv();
|
|
3970
|
+
const jsonData = {
|
|
3971
|
+
model: "res.currency",
|
|
3972
|
+
method: "web_search_read",
|
|
3973
|
+
kwargs: {
|
|
3974
|
+
specification: {
|
|
3975
|
+
name: {},
|
|
3976
|
+
icon_url: {},
|
|
3977
|
+
rate_ids: {
|
|
3978
|
+
fields: {
|
|
3979
|
+
company_rate: {},
|
|
3980
|
+
sell: {}
|
|
3971
3981
|
}
|
|
3972
|
-
}
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
}
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
}
|
|
3982
|
+
}
|
|
3983
|
+
},
|
|
3984
|
+
domain: [["active", "=", true]],
|
|
3985
|
+
limit: 100,
|
|
3986
|
+
offset: 0
|
|
3987
|
+
}
|
|
3988
|
+
};
|
|
3989
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3990
|
+
headers: {
|
|
3991
|
+
"Content-Type": "application/json"
|
|
3992
|
+
}
|
|
3983
3993
|
});
|
|
3984
|
-
},
|
|
3985
|
-
getAll(
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
});
|
|
3994
|
+
},
|
|
3995
|
+
async getAll({ data }) {
|
|
3996
|
+
const env2 = getEnv();
|
|
3997
|
+
const jsonReadGroup = data.type == "calendar" ? { fields: data?.fields } : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
3998
|
+
fields: data.fields,
|
|
3999
|
+
groupby: data.groupby
|
|
4000
|
+
} : {
|
|
4001
|
+
count_limit: 10001,
|
|
4002
|
+
order: data.sort,
|
|
4003
|
+
specification: data.specification
|
|
4004
|
+
};
|
|
4005
|
+
const jsonData = {
|
|
4006
|
+
model: String(data.model),
|
|
4007
|
+
method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
|
|
4008
|
+
ids: data.ids,
|
|
4009
|
+
with_context: data.context,
|
|
4010
|
+
kwargs: {
|
|
4011
|
+
domain: data.domain,
|
|
4012
|
+
limit: data.limit,
|
|
4013
|
+
offset: data.offset,
|
|
4014
|
+
...jsonReadGroup
|
|
4015
|
+
}
|
|
4016
|
+
};
|
|
4017
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4018
|
+
headers: {
|
|
4019
|
+
"Content-Type": "application/json"
|
|
4020
|
+
}
|
|
4012
4021
|
});
|
|
4013
4022
|
},
|
|
4014
|
-
getListCalendar(
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4023
|
+
async getListCalendar({ data }) {
|
|
4024
|
+
const env2 = getEnv();
|
|
4025
|
+
const jsonReadGroup = data.type == "calendar" ? data?.fields : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
4026
|
+
fields: data.fields,
|
|
4027
|
+
groupby: data.groupby
|
|
4028
|
+
} : {
|
|
4029
|
+
count_limit: 10001,
|
|
4030
|
+
order: data.sort,
|
|
4031
|
+
specification: data.specification
|
|
4032
|
+
};
|
|
4033
|
+
const jsonData = {
|
|
4034
|
+
model: String(data.model),
|
|
4035
|
+
method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
|
|
4036
|
+
ids: data.ids,
|
|
4037
|
+
with_context: data.context,
|
|
4038
|
+
kwargs: {
|
|
4039
|
+
domain: data.domain,
|
|
4040
|
+
limit: data.limit,
|
|
4041
|
+
offset: data.offset,
|
|
4018
4042
|
fields: data.fields,
|
|
4019
|
-
|
|
4020
|
-
}
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
model: String(data.model),
|
|
4027
|
-
method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
|
|
4028
|
-
ids: data.ids,
|
|
4029
|
-
with_context: data.context,
|
|
4030
|
-
kwargs: __spreadValues({
|
|
4031
|
-
domain: data.domain,
|
|
4032
|
-
limit: data.limit,
|
|
4033
|
-
offset: data.offset,
|
|
4034
|
-
fields: data.fields
|
|
4035
|
-
}, jsonReadGroup)
|
|
4036
|
-
};
|
|
4037
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4038
|
-
headers: {
|
|
4039
|
-
"Content-Type": "application/json"
|
|
4040
|
-
}
|
|
4041
|
-
});
|
|
4043
|
+
...jsonReadGroup
|
|
4044
|
+
}
|
|
4045
|
+
};
|
|
4046
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4047
|
+
headers: {
|
|
4048
|
+
"Content-Type": "application/json"
|
|
4049
|
+
}
|
|
4042
4050
|
});
|
|
4043
4051
|
},
|
|
4044
|
-
getList(
|
|
4045
|
-
|
|
4052
|
+
async getList({
|
|
4053
|
+
model,
|
|
4054
|
+
ids = [],
|
|
4055
|
+
specification = {},
|
|
4056
|
+
domain = [],
|
|
4057
|
+
offset,
|
|
4058
|
+
order,
|
|
4059
|
+
context = {},
|
|
4060
|
+
limit = 10
|
|
4061
|
+
}) {
|
|
4062
|
+
const env2 = getEnv();
|
|
4063
|
+
const jsonData = {
|
|
4046
4064
|
model,
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
kwargs: {
|
|
4063
|
-
specification,
|
|
4064
|
-
domain,
|
|
4065
|
-
limit,
|
|
4066
|
-
offset,
|
|
4067
|
-
order
|
|
4068
|
-
}
|
|
4069
|
-
};
|
|
4070
|
-
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
4071
|
-
headers: {
|
|
4072
|
-
"Content-Type": "application/json"
|
|
4073
|
-
}
|
|
4074
|
-
});
|
|
4065
|
+
method: "web_search_read" /* WEB_SEARCH_READ */,
|
|
4066
|
+
ids,
|
|
4067
|
+
with_context: context,
|
|
4068
|
+
kwargs: {
|
|
4069
|
+
specification,
|
|
4070
|
+
domain,
|
|
4071
|
+
limit,
|
|
4072
|
+
offset,
|
|
4073
|
+
order
|
|
4074
|
+
}
|
|
4075
|
+
};
|
|
4076
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4077
|
+
headers: {
|
|
4078
|
+
"Content-Type": "application/json"
|
|
4079
|
+
}
|
|
4075
4080
|
});
|
|
4076
4081
|
},
|
|
4077
|
-
getDetail(
|
|
4078
|
-
|
|
4079
|
-
|
|
4082
|
+
async getDetail({
|
|
4083
|
+
ids = [],
|
|
4084
|
+
model,
|
|
4085
|
+
specification,
|
|
4086
|
+
context
|
|
4087
|
+
}) {
|
|
4088
|
+
const env2 = getEnv();
|
|
4089
|
+
const jsonData = {
|
|
4080
4090
|
model,
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
specification
|
|
4093
|
-
}
|
|
4094
|
-
};
|
|
4095
|
-
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
4096
|
-
headers: {
|
|
4097
|
-
"Content-Type": "application/json"
|
|
4098
|
-
}
|
|
4099
|
-
});
|
|
4091
|
+
method: "web_read" /* WEB_READ */,
|
|
4092
|
+
ids,
|
|
4093
|
+
with_context: context,
|
|
4094
|
+
kwargs: {
|
|
4095
|
+
specification
|
|
4096
|
+
}
|
|
4097
|
+
};
|
|
4098
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4099
|
+
headers: {
|
|
4100
|
+
"Content-Type": "application/json"
|
|
4101
|
+
}
|
|
4100
4102
|
});
|
|
4101
4103
|
},
|
|
4102
|
-
save(
|
|
4103
|
-
|
|
4104
|
+
async save({
|
|
4105
|
+
model,
|
|
4106
|
+
ids = [],
|
|
4107
|
+
data = {},
|
|
4108
|
+
specification = {},
|
|
4109
|
+
context = {},
|
|
4110
|
+
path
|
|
4111
|
+
}) {
|
|
4112
|
+
const env2 = getEnv();
|
|
4113
|
+
const jsonData = {
|
|
4104
4114
|
model,
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
ids,
|
|
4118
|
-
kwargs: {
|
|
4119
|
-
vals: data,
|
|
4120
|
-
specification
|
|
4121
|
-
}
|
|
4122
|
-
};
|
|
4123
|
-
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post(path != null ? path : "/call" /* CALL_PATH */, jsonData, {
|
|
4124
|
-
headers: {
|
|
4125
|
-
"Content-Type": "application/json"
|
|
4126
|
-
}
|
|
4127
|
-
});
|
|
4115
|
+
method: "web_save" /* WEB_SAVE */,
|
|
4116
|
+
with_context: context,
|
|
4117
|
+
ids,
|
|
4118
|
+
kwargs: {
|
|
4119
|
+
vals: data,
|
|
4120
|
+
specification
|
|
4121
|
+
}
|
|
4122
|
+
};
|
|
4123
|
+
return env2?.requests?.post(path ?? "/call" /* CALL_PATH */, jsonData, {
|
|
4124
|
+
headers: {
|
|
4125
|
+
"Content-Type": "application/json"
|
|
4126
|
+
}
|
|
4128
4127
|
});
|
|
4129
4128
|
},
|
|
4130
|
-
delete(
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
"Content-Type": "application/json"
|
|
4142
|
-
}
|
|
4143
|
-
});
|
|
4129
|
+
async delete({ ids = [], model }) {
|
|
4130
|
+
const env2 = getEnv();
|
|
4131
|
+
const jsonData = {
|
|
4132
|
+
model,
|
|
4133
|
+
method: "unlink" /* UNLINK */,
|
|
4134
|
+
ids
|
|
4135
|
+
};
|
|
4136
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4137
|
+
headers: {
|
|
4138
|
+
"Content-Type": "application/json"
|
|
4139
|
+
}
|
|
4144
4140
|
});
|
|
4145
4141
|
},
|
|
4146
|
-
onChange(
|
|
4147
|
-
|
|
4148
|
-
|
|
4142
|
+
async onChange({
|
|
4143
|
+
ids = [],
|
|
4144
|
+
model,
|
|
4145
|
+
object,
|
|
4146
|
+
specification,
|
|
4147
|
+
context,
|
|
4148
|
+
fieldChange
|
|
4149
|
+
}) {
|
|
4150
|
+
const env2 = getEnv();
|
|
4151
|
+
const jsonData = {
|
|
4149
4152
|
model,
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
context,
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
object ? object : {},
|
|
4164
|
-
fieldChange ? fieldChange : [],
|
|
4165
|
-
specification
|
|
4166
|
-
]
|
|
4167
|
-
};
|
|
4168
|
-
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
4169
|
-
headers: {
|
|
4170
|
-
"Content-Type": "application/json"
|
|
4171
|
-
}
|
|
4172
|
-
});
|
|
4153
|
+
method: "onchange" /* ONCHANGE */,
|
|
4154
|
+
ids,
|
|
4155
|
+
with_context: context,
|
|
4156
|
+
args: [
|
|
4157
|
+
object ? object : {},
|
|
4158
|
+
fieldChange ? fieldChange : [],
|
|
4159
|
+
specification
|
|
4160
|
+
]
|
|
4161
|
+
};
|
|
4162
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4163
|
+
headers: {
|
|
4164
|
+
"Content-Type": "application/json"
|
|
4165
|
+
}
|
|
4173
4166
|
});
|
|
4174
4167
|
},
|
|
4175
|
-
getListFieldsOnchange(
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
"Content-Type": "application/json"
|
|
4186
|
-
}
|
|
4187
|
-
});
|
|
4168
|
+
async getListFieldsOnchange({ model }) {
|
|
4169
|
+
const env2 = getEnv();
|
|
4170
|
+
const jsonData = {
|
|
4171
|
+
model,
|
|
4172
|
+
method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
|
|
4173
|
+
};
|
|
4174
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4175
|
+
headers: {
|
|
4176
|
+
"Content-Type": "application/json"
|
|
4177
|
+
}
|
|
4188
4178
|
});
|
|
4189
4179
|
},
|
|
4190
4180
|
parseORMOdoo(data) {
|
|
@@ -4198,14 +4188,13 @@ var ModelService = {
|
|
|
4198
4188
|
data[key] = "/";
|
|
4199
4189
|
}
|
|
4200
4190
|
}
|
|
4201
|
-
return
|
|
4191
|
+
return { ...data };
|
|
4202
4192
|
},
|
|
4203
4193
|
toDataJS(data, viewData, model) {
|
|
4204
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
4205
4194
|
for (const key in data) {
|
|
4206
4195
|
if (data[key] === false) {
|
|
4207
4196
|
if (viewData && model) {
|
|
4208
|
-
if (
|
|
4197
|
+
if (viewData?.models?.[model]?.[key]?.type !== "boolean" /* BOOLEAN */) {
|
|
4209
4198
|
data[key] = null;
|
|
4210
4199
|
}
|
|
4211
4200
|
} else {
|
|
@@ -4215,13 +4204,12 @@ var ModelService = {
|
|
|
4215
4204
|
data[key] = "Draft";
|
|
4216
4205
|
} else if (data[key] !== false) {
|
|
4217
4206
|
if (model !== void 0) {
|
|
4218
|
-
if (
|
|
4219
|
-
data[key] = (
|
|
4220
|
-
|
|
4221
|
-
const relation = (_c2 = (_b2 = (_a2 = viewData == null ? void 0 : viewData.models) == null ? void 0 : _a2[model]) == null ? void 0 : _b2[key]) == null ? void 0 : _c2.relation;
|
|
4207
|
+
if (viewData?.models?.[model]?.[key]?.type === "one2many" /* ONE2MANY */ || viewData?.models?.[model]?.[key]?.type === "many2many" /* MANY2MANY */) {
|
|
4208
|
+
data[key] = (data[key] ??= [])?.map((item) => {
|
|
4209
|
+
const relation = viewData?.models?.[model]?.[key]?.relation;
|
|
4222
4210
|
if (relation !== void 0) {
|
|
4223
|
-
if (
|
|
4224
|
-
if (
|
|
4211
|
+
if (viewData?.models?.[relation]) {
|
|
4212
|
+
if (item?.length >= 3) {
|
|
4225
4213
|
return ModelService.toDataJS(
|
|
4226
4214
|
item[OBJECT_POSITION],
|
|
4227
4215
|
viewData,
|
|
@@ -4231,7 +4219,7 @@ var ModelService = {
|
|
|
4231
4219
|
return ModelService.toDataJS(item, viewData, relation);
|
|
4232
4220
|
}
|
|
4233
4221
|
} else {
|
|
4234
|
-
if (
|
|
4222
|
+
if (item?.length >= 3) {
|
|
4235
4223
|
return item[OBJECT_POSITION];
|
|
4236
4224
|
} else {
|
|
4237
4225
|
return item;
|
|
@@ -4243,556 +4231,514 @@ var ModelService = {
|
|
|
4243
4231
|
}
|
|
4244
4232
|
}
|
|
4245
4233
|
}
|
|
4246
|
-
return
|
|
4234
|
+
return { ...data };
|
|
4247
4235
|
}
|
|
4248
4236
|
};
|
|
4249
4237
|
var model_service_default = ModelService;
|
|
4250
4238
|
|
|
4251
4239
|
// src/services/user-service/index.ts
|
|
4252
4240
|
var UserService = {
|
|
4253
|
-
getProfile(path) {
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
}
|
|
4260
|
-
});
|
|
4241
|
+
async getProfile(path) {
|
|
4242
|
+
const env2 = getEnv();
|
|
4243
|
+
return env2.requests.get(path ?? "/userinfo" /* PROFILE_PATH */, {
|
|
4244
|
+
headers: {
|
|
4245
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
4246
|
+
}
|
|
4261
4247
|
});
|
|
4262
4248
|
},
|
|
4263
|
-
getUser(
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
display_name: {}
|
|
4289
|
-
}
|
|
4249
|
+
async getUser({ context, id }) {
|
|
4250
|
+
const env2 = getEnv();
|
|
4251
|
+
const jsonData = {
|
|
4252
|
+
model: "res.users",
|
|
4253
|
+
method: "web_read",
|
|
4254
|
+
ids: [id],
|
|
4255
|
+
with_context: context,
|
|
4256
|
+
kwargs: {
|
|
4257
|
+
specification: {
|
|
4258
|
+
display_name: {},
|
|
4259
|
+
image_1920: {},
|
|
4260
|
+
name: {},
|
|
4261
|
+
login: {},
|
|
4262
|
+
email: {},
|
|
4263
|
+
password: {},
|
|
4264
|
+
visible_group_id: {
|
|
4265
|
+
fields: {
|
|
4266
|
+
id: {},
|
|
4267
|
+
display_name: {}
|
|
4268
|
+
}
|
|
4269
|
+
},
|
|
4270
|
+
company_id: {
|
|
4271
|
+
fields: {
|
|
4272
|
+
id: {},
|
|
4273
|
+
display_name: {}
|
|
4290
4274
|
}
|
|
4291
4275
|
}
|
|
4292
4276
|
}
|
|
4293
|
-
}
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
}
|
|
4277
|
+
}
|
|
4278
|
+
};
|
|
4279
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4280
|
+
headers: {
|
|
4281
|
+
"Content-Type": "application/json"
|
|
4282
|
+
}
|
|
4299
4283
|
});
|
|
4300
4284
|
},
|
|
4301
|
-
switchUserLocale:
|
|
4302
|
-
var _a;
|
|
4285
|
+
switchUserLocale: async ({ id, values }) => {
|
|
4303
4286
|
const env2 = getEnv();
|
|
4304
4287
|
const jsonData = {
|
|
4305
4288
|
model: "res.users",
|
|
4306
4289
|
domain: [["id", "=", id]],
|
|
4307
4290
|
values
|
|
4308
4291
|
};
|
|
4309
|
-
return env2
|
|
4292
|
+
return env2?.requests.post(UriConstants?.CREATE_UPDATE_PATH, jsonData, {
|
|
4310
4293
|
headers: {
|
|
4311
4294
|
"Content-Type": "application/json"
|
|
4312
4295
|
}
|
|
4313
4296
|
});
|
|
4314
|
-
}
|
|
4297
|
+
}
|
|
4315
4298
|
};
|
|
4316
4299
|
var user_service_default = UserService;
|
|
4317
4300
|
|
|
4318
4301
|
// src/services/view-service/index.ts
|
|
4319
4302
|
var ViewService = {
|
|
4320
|
-
getView(
|
|
4321
|
-
|
|
4303
|
+
async getView({
|
|
4304
|
+
model,
|
|
4305
|
+
views,
|
|
4306
|
+
context = {},
|
|
4307
|
+
options = {},
|
|
4308
|
+
aid
|
|
4309
|
+
}) {
|
|
4310
|
+
const env2 = getEnv();
|
|
4311
|
+
const defaultOptions = {
|
|
4312
|
+
load_filters: true,
|
|
4313
|
+
toolbar: true,
|
|
4314
|
+
action_id: aid
|
|
4315
|
+
};
|
|
4316
|
+
const jsonDataView = {
|
|
4322
4317
|
model,
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
};
|
|
4335
|
-
const jsonDataView = {
|
|
4336
|
-
model,
|
|
4337
|
-
method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
|
|
4338
|
-
kwargs: {
|
|
4339
|
-
views,
|
|
4340
|
-
options: __spreadValues(__spreadValues({}, options), defaultOptions)
|
|
4341
|
-
},
|
|
4342
|
-
with_context: context
|
|
4343
|
-
};
|
|
4344
|
-
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
4345
|
-
headers: {
|
|
4346
|
-
"Content-Type": "application/json"
|
|
4347
|
-
}
|
|
4348
|
-
});
|
|
4318
|
+
method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
|
|
4319
|
+
kwargs: {
|
|
4320
|
+
views,
|
|
4321
|
+
options: { ...options, ...defaultOptions }
|
|
4322
|
+
},
|
|
4323
|
+
with_context: context
|
|
4324
|
+
};
|
|
4325
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
4326
|
+
headers: {
|
|
4327
|
+
"Content-Type": "application/json"
|
|
4328
|
+
}
|
|
4349
4329
|
});
|
|
4350
4330
|
},
|
|
4351
|
-
getMenu(context) {
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4331
|
+
async getMenu(context) {
|
|
4332
|
+
const env2 = getEnv();
|
|
4333
|
+
const jsonData = {
|
|
4334
|
+
model: "ir.ui.menu" /* MENU */,
|
|
4335
|
+
method: "web_search_read" /* WEB_SEARCH_READ */,
|
|
4336
|
+
ids: [],
|
|
4337
|
+
with_context: context,
|
|
4338
|
+
kwargs: {
|
|
4339
|
+
specification: {
|
|
4340
|
+
active: {},
|
|
4341
|
+
name: {},
|
|
4342
|
+
is_display: {},
|
|
4343
|
+
sequence: {},
|
|
4344
|
+
complete_name: {},
|
|
4345
|
+
action: {
|
|
4346
|
+
fields: {
|
|
4347
|
+
display_name: {},
|
|
4348
|
+
type: {},
|
|
4349
|
+
binding_view_types: {}
|
|
4350
|
+
// res_model: {},
|
|
4351
|
+
}
|
|
4352
|
+
},
|
|
4353
|
+
url_icon: {},
|
|
4354
|
+
web_icon: {},
|
|
4355
|
+
web_icon_data: {},
|
|
4356
|
+
groups_id: {
|
|
4357
|
+
fields: {
|
|
4358
|
+
full_name: {}
|
|
4374
4359
|
},
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4360
|
+
limit: 40,
|
|
4361
|
+
order: ""
|
|
4362
|
+
},
|
|
4363
|
+
display_name: {},
|
|
4364
|
+
child_id: {
|
|
4365
|
+
fields: {
|
|
4366
|
+
active: {},
|
|
4367
|
+
name: {},
|
|
4368
|
+
is_display: {},
|
|
4369
|
+
sequence: {},
|
|
4370
|
+
complete_name: {},
|
|
4371
|
+
action: {
|
|
4372
|
+
fields: {
|
|
4373
|
+
display_name: {},
|
|
4374
|
+
type: {},
|
|
4375
|
+
binding_view_types: {}
|
|
4376
|
+
// res_model: {},
|
|
4377
|
+
}
|
|
4381
4378
|
},
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
active: {},
|
|
4389
|
-
name: {},
|
|
4390
|
-
is_display: {},
|
|
4391
|
-
sequence: {},
|
|
4392
|
-
complete_name: {},
|
|
4393
|
-
action: {
|
|
4394
|
-
fields: {
|
|
4395
|
-
display_name: {},
|
|
4396
|
-
type: {},
|
|
4397
|
-
binding_view_types: {}
|
|
4398
|
-
// res_model: {},
|
|
4399
|
-
}
|
|
4379
|
+
url_icon: {},
|
|
4380
|
+
web_icon: {},
|
|
4381
|
+
web_icon_data: {},
|
|
4382
|
+
groups_id: {
|
|
4383
|
+
fields: {
|
|
4384
|
+
full_name: {}
|
|
4400
4385
|
},
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4386
|
+
limit: 40,
|
|
4387
|
+
order: ""
|
|
4388
|
+
},
|
|
4389
|
+
display_name: {},
|
|
4390
|
+
child_id: {
|
|
4391
|
+
fields: {
|
|
4392
|
+
active: {},
|
|
4393
|
+
name: {},
|
|
4394
|
+
is_display: {},
|
|
4395
|
+
sequence: {},
|
|
4396
|
+
complete_name: {},
|
|
4397
|
+
action: {
|
|
4398
|
+
fields: {
|
|
4399
|
+
display_name: {},
|
|
4400
|
+
type: {},
|
|
4401
|
+
binding_view_types: {}
|
|
4402
|
+
// res_model: {},
|
|
4403
|
+
}
|
|
4407
4404
|
},
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
active: {},
|
|
4415
|
-
name: {},
|
|
4416
|
-
is_display: {},
|
|
4417
|
-
sequence: {},
|
|
4418
|
-
complete_name: {},
|
|
4419
|
-
action: {
|
|
4420
|
-
fields: {
|
|
4421
|
-
display_name: {},
|
|
4422
|
-
type: {},
|
|
4423
|
-
binding_view_types: {}
|
|
4424
|
-
// res_model: {},
|
|
4425
|
-
}
|
|
4405
|
+
url_icon: {},
|
|
4406
|
+
web_icon: {},
|
|
4407
|
+
web_icon_data: {},
|
|
4408
|
+
groups_id: {
|
|
4409
|
+
fields: {
|
|
4410
|
+
full_name: {}
|
|
4426
4411
|
},
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4412
|
+
limit: 40,
|
|
4413
|
+
order: ""
|
|
4414
|
+
},
|
|
4415
|
+
display_name: {},
|
|
4416
|
+
child_id: {
|
|
4417
|
+
fields: {
|
|
4418
|
+
active: {},
|
|
4419
|
+
name: {},
|
|
4420
|
+
is_display: {},
|
|
4421
|
+
sequence: {},
|
|
4422
|
+
complete_name: {},
|
|
4423
|
+
action: {
|
|
4424
|
+
fields: {
|
|
4425
|
+
display_name: {},
|
|
4426
|
+
type: {},
|
|
4427
|
+
binding_view_types: {}
|
|
4428
|
+
// res_model: {},
|
|
4429
|
+
}
|
|
4433
4430
|
},
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
active: {},
|
|
4441
|
-
name: {},
|
|
4442
|
-
is_display: {},
|
|
4443
|
-
sequence: {},
|
|
4444
|
-
complete_name: {},
|
|
4445
|
-
action: {
|
|
4446
|
-
fields: {
|
|
4447
|
-
display_name: {},
|
|
4448
|
-
type: {},
|
|
4449
|
-
binding_view_types: {}
|
|
4450
|
-
// res_model: {},
|
|
4451
|
-
}
|
|
4452
|
-
},
|
|
4453
|
-
url_icon: {},
|
|
4454
|
-
web_icon: {},
|
|
4455
|
-
web_icon_data: {},
|
|
4456
|
-
groups_id: {
|
|
4457
|
-
fields: {
|
|
4458
|
-
full_name: {}
|
|
4459
|
-
},
|
|
4460
|
-
limit: 40,
|
|
4461
|
-
order: ""
|
|
4431
|
+
url_icon: {},
|
|
4432
|
+
web_icon: {},
|
|
4433
|
+
web_icon_data: {},
|
|
4434
|
+
groups_id: {
|
|
4435
|
+
fields: {
|
|
4436
|
+
full_name: {}
|
|
4462
4437
|
},
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
fields: {},
|
|
4466
|
-
limit: 40,
|
|
4467
|
-
order: ""
|
|
4468
|
-
}
|
|
4438
|
+
limit: 40,
|
|
4439
|
+
order: ""
|
|
4469
4440
|
},
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
"
|
|
4494
|
-
|
|
4495
|
-
|
|
4441
|
+
display_name: {},
|
|
4442
|
+
child_id: {
|
|
4443
|
+
fields: {},
|
|
4444
|
+
limit: 40,
|
|
4445
|
+
order: ""
|
|
4446
|
+
}
|
|
4447
|
+
},
|
|
4448
|
+
limit: 40,
|
|
4449
|
+
order: ""
|
|
4450
|
+
}
|
|
4451
|
+
},
|
|
4452
|
+
limit: 40,
|
|
4453
|
+
order: ""
|
|
4454
|
+
}
|
|
4455
|
+
},
|
|
4456
|
+
limit: 40,
|
|
4457
|
+
order: ""
|
|
4458
|
+
}
|
|
4459
|
+
},
|
|
4460
|
+
domain: [
|
|
4461
|
+
"&",
|
|
4462
|
+
["is_display", "=", true],
|
|
4463
|
+
"&",
|
|
4464
|
+
["active", "=", true],
|
|
4465
|
+
["parent_id", "=", false]
|
|
4466
|
+
]
|
|
4467
|
+
}
|
|
4468
|
+
};
|
|
4469
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4470
|
+
headers: {
|
|
4471
|
+
"Content-Type": "application/json"
|
|
4472
|
+
}
|
|
4496
4473
|
});
|
|
4497
4474
|
},
|
|
4498
|
-
getActionDetail(aid, context) {
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
groups_id: {},
|
|
4518
|
-
search_view_id: {}
|
|
4519
|
-
}
|
|
4520
|
-
}
|
|
4521
|
-
};
|
|
4522
|
-
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
4523
|
-
headers: {
|
|
4524
|
-
"Content-Type": "application/json"
|
|
4475
|
+
async getActionDetail(aid, context) {
|
|
4476
|
+
const env2 = getEnv();
|
|
4477
|
+
const jsonData = {
|
|
4478
|
+
model: "ir.actions.act_window" /* WINDOW_ACTION */,
|
|
4479
|
+
method: "web_read" /* WEB_READ */,
|
|
4480
|
+
ids: [aid],
|
|
4481
|
+
with_context: context,
|
|
4482
|
+
kwargs: {
|
|
4483
|
+
specification: {
|
|
4484
|
+
id: {},
|
|
4485
|
+
name: {},
|
|
4486
|
+
res_model: {},
|
|
4487
|
+
views: {},
|
|
4488
|
+
view_mode: {},
|
|
4489
|
+
mobile_view_mode: {},
|
|
4490
|
+
domain: {},
|
|
4491
|
+
context: {},
|
|
4492
|
+
groups_id: {},
|
|
4493
|
+
search_view_id: {}
|
|
4525
4494
|
}
|
|
4526
|
-
}
|
|
4495
|
+
}
|
|
4496
|
+
};
|
|
4497
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4498
|
+
headers: {
|
|
4499
|
+
"Content-Type": "application/json"
|
|
4500
|
+
}
|
|
4527
4501
|
});
|
|
4528
4502
|
},
|
|
4529
|
-
getResequence(
|
|
4530
|
-
|
|
4503
|
+
async getResequence({
|
|
4504
|
+
model,
|
|
4505
|
+
ids,
|
|
4506
|
+
context,
|
|
4507
|
+
offset
|
|
4508
|
+
}) {
|
|
4509
|
+
const env2 = getEnv();
|
|
4510
|
+
const jsonData = {
|
|
4531
4511
|
model,
|
|
4512
|
+
with_context: context,
|
|
4532
4513
|
ids,
|
|
4533
|
-
|
|
4534
|
-
offset
|
|
4535
|
-
}
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
ids,
|
|
4541
|
-
field: "sequence"
|
|
4542
|
-
}, offset > 0 ? { offset } : {});
|
|
4543
|
-
return env2 == null ? void 0 : env2.requests.post("/web/dataset/resequence", jsonData, {
|
|
4544
|
-
headers: {
|
|
4545
|
-
"Content-Type": "application/json"
|
|
4546
|
-
}
|
|
4547
|
-
});
|
|
4548
|
-
});
|
|
4549
|
-
},
|
|
4550
|
-
getSelectionItem(_0) {
|
|
4551
|
-
return __async(this, arguments, function* ({ data }) {
|
|
4552
|
-
var _a;
|
|
4553
|
-
const env2 = getEnv();
|
|
4554
|
-
const jsonData = {
|
|
4555
|
-
model: data.model,
|
|
4556
|
-
ids: [],
|
|
4557
|
-
method: "get_data_select",
|
|
4558
|
-
with_context: data.context,
|
|
4559
|
-
kwargs: {
|
|
4560
|
-
count_limit: 10001,
|
|
4561
|
-
domain: data.domain ? data.domain : [],
|
|
4562
|
-
offset: 0,
|
|
4563
|
-
order: "",
|
|
4564
|
-
specification: (_a = data == null ? void 0 : data.specification) != null ? _a : {
|
|
4565
|
-
id: {},
|
|
4566
|
-
name: {},
|
|
4567
|
-
display_name: {}
|
|
4568
|
-
}
|
|
4569
|
-
}
|
|
4570
|
-
};
|
|
4571
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4572
|
-
headers: {
|
|
4573
|
-
"Content-Type": "application/json"
|
|
4574
|
-
}
|
|
4575
|
-
});
|
|
4514
|
+
field: "sequence",
|
|
4515
|
+
...offset > 0 ? { offset } : {}
|
|
4516
|
+
};
|
|
4517
|
+
return env2?.requests.post("/web/dataset/resequence", jsonData, {
|
|
4518
|
+
headers: {
|
|
4519
|
+
"Content-Type": "application/json"
|
|
4520
|
+
}
|
|
4576
4521
|
});
|
|
4577
4522
|
},
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4523
|
+
async getSelectionItem({ data }) {
|
|
4524
|
+
const env2 = getEnv();
|
|
4525
|
+
const jsonData = {
|
|
4526
|
+
model: data.model,
|
|
4527
|
+
ids: [],
|
|
4528
|
+
method: "get_data_select",
|
|
4529
|
+
with_context: data.context,
|
|
4530
|
+
kwargs: {
|
|
4531
|
+
count_limit: 10001,
|
|
4532
|
+
domain: data.domain ? data.domain : [],
|
|
4533
|
+
offset: 0,
|
|
4534
|
+
order: "",
|
|
4535
|
+
specification: data?.specification ?? {
|
|
4536
|
+
id: {},
|
|
4537
|
+
name: {},
|
|
4538
|
+
display_name: {}
|
|
4588
4539
|
}
|
|
4589
|
-
|
|
4540
|
+
}
|
|
4541
|
+
};
|
|
4542
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4543
|
+
headers: {
|
|
4544
|
+
"Content-Type": "application/json"
|
|
4545
|
+
}
|
|
4590
4546
|
});
|
|
4591
4547
|
},
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4548
|
+
async loadMessages() {
|
|
4549
|
+
const env2 = getEnv();
|
|
4550
|
+
return env2.requests.post(
|
|
4551
|
+
"/load_message_failures" /* LOAD_MESSAGE */,
|
|
4552
|
+
{},
|
|
4553
|
+
{
|
|
4598
4554
|
headers: {
|
|
4599
4555
|
"Content-Type": "application/json"
|
|
4600
4556
|
}
|
|
4601
|
-
}
|
|
4557
|
+
}
|
|
4558
|
+
);
|
|
4559
|
+
},
|
|
4560
|
+
async getVersion() {
|
|
4561
|
+
const env2 = getEnv();
|
|
4562
|
+
return env2?.requests.get("", {
|
|
4563
|
+
headers: {
|
|
4564
|
+
"Content-Type": "application/json"
|
|
4565
|
+
}
|
|
4602
4566
|
});
|
|
4603
4567
|
},
|
|
4604
|
-
get2FAMethods(
|
|
4605
|
-
|
|
4568
|
+
async get2FAMethods({
|
|
4569
|
+
method,
|
|
4570
|
+
with_context
|
|
4571
|
+
}) {
|
|
4572
|
+
const env2 = getEnv();
|
|
4573
|
+
const jsonData = {
|
|
4606
4574
|
method,
|
|
4607
4575
|
with_context
|
|
4608
|
-
}
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
};
|
|
4614
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4615
|
-
headers: {
|
|
4616
|
-
"Content-Type": "application/json"
|
|
4617
|
-
}
|
|
4618
|
-
});
|
|
4576
|
+
};
|
|
4577
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4578
|
+
headers: {
|
|
4579
|
+
"Content-Type": "application/json"
|
|
4580
|
+
}
|
|
4619
4581
|
});
|
|
4620
4582
|
},
|
|
4621
|
-
verify2FA(
|
|
4622
|
-
|
|
4583
|
+
async verify2FA({
|
|
4584
|
+
method,
|
|
4585
|
+
with_context,
|
|
4586
|
+
code,
|
|
4587
|
+
device,
|
|
4588
|
+
location
|
|
4589
|
+
}) {
|
|
4590
|
+
const env2 = getEnv();
|
|
4591
|
+
const jsonData = {
|
|
4623
4592
|
method,
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
},
|
|
4639
|
-
with_context
|
|
4640
|
-
};
|
|
4641
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4642
|
-
headers: {
|
|
4643
|
-
"Content-Type": "application/json"
|
|
4644
|
-
},
|
|
4645
|
-
withCredentials: true
|
|
4646
|
-
});
|
|
4593
|
+
kwargs: {
|
|
4594
|
+
vals: {
|
|
4595
|
+
code,
|
|
4596
|
+
device,
|
|
4597
|
+
location
|
|
4598
|
+
}
|
|
4599
|
+
},
|
|
4600
|
+
with_context
|
|
4601
|
+
};
|
|
4602
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4603
|
+
headers: {
|
|
4604
|
+
"Content-Type": "application/json"
|
|
4605
|
+
},
|
|
4606
|
+
withCredentials: true
|
|
4647
4607
|
});
|
|
4648
4608
|
},
|
|
4649
|
-
signInSSO(
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4609
|
+
async signInSSO({
|
|
4610
|
+
redirect_uri,
|
|
4611
|
+
state,
|
|
4612
|
+
client_id,
|
|
4613
|
+
response_type,
|
|
4614
|
+
path
|
|
4615
|
+
}) {
|
|
4616
|
+
const env2 = getEnv();
|
|
4617
|
+
const params = new URLSearchParams({
|
|
4654
4618
|
response_type,
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
}
|
|
4664
|
-
|
|
4665
|
-
return env2 == null ? void 0 : env2.requests.get(url, {
|
|
4666
|
-
headers: {
|
|
4667
|
-
"Content-Type": "application/json"
|
|
4668
|
-
},
|
|
4669
|
-
withCredentials: true
|
|
4670
|
-
});
|
|
4619
|
+
client_id,
|
|
4620
|
+
redirect_uri,
|
|
4621
|
+
state
|
|
4622
|
+
});
|
|
4623
|
+
const url = `${path}?${params.toString()}`;
|
|
4624
|
+
return env2?.requests.get(url, {
|
|
4625
|
+
headers: {
|
|
4626
|
+
"Content-Type": "application/json"
|
|
4627
|
+
},
|
|
4628
|
+
withCredentials: true
|
|
4671
4629
|
});
|
|
4672
4630
|
},
|
|
4673
|
-
grantAccess(
|
|
4674
|
-
|
|
4631
|
+
async grantAccess({
|
|
4632
|
+
redirect_uri,
|
|
4633
|
+
state,
|
|
4634
|
+
client_id,
|
|
4635
|
+
scopes
|
|
4636
|
+
}) {
|
|
4637
|
+
const env2 = getEnv();
|
|
4638
|
+
const jsonData = {
|
|
4675
4639
|
redirect_uri,
|
|
4676
4640
|
state,
|
|
4677
4641
|
client_id,
|
|
4678
4642
|
scopes
|
|
4679
|
-
}
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
scopes
|
|
4686
|
-
};
|
|
4687
|
-
return env2 == null ? void 0 : env2.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
|
|
4688
|
-
headers: {
|
|
4689
|
-
"Content-Type": "application/json"
|
|
4690
|
-
},
|
|
4691
|
-
withCredentials: true
|
|
4692
|
-
});
|
|
4643
|
+
};
|
|
4644
|
+
return env2?.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
|
|
4645
|
+
headers: {
|
|
4646
|
+
"Content-Type": "application/json"
|
|
4647
|
+
},
|
|
4648
|
+
withCredentials: true
|
|
4693
4649
|
});
|
|
4694
4650
|
},
|
|
4695
|
-
getFieldsViewSecurity(
|
|
4696
|
-
|
|
4651
|
+
async getFieldsViewSecurity({
|
|
4652
|
+
method,
|
|
4653
|
+
token,
|
|
4654
|
+
views
|
|
4655
|
+
}) {
|
|
4656
|
+
const env2 = getEnv();
|
|
4657
|
+
const jsonData = {
|
|
4697
4658
|
method,
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
}
|
|
4710
|
-
};
|
|
4711
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4712
|
-
headers: {
|
|
4713
|
-
"Content-Type": "application/json"
|
|
4714
|
-
}
|
|
4715
|
-
});
|
|
4659
|
+
kwargs: {
|
|
4660
|
+
views
|
|
4661
|
+
},
|
|
4662
|
+
with_context: {
|
|
4663
|
+
token
|
|
4664
|
+
}
|
|
4665
|
+
};
|
|
4666
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4667
|
+
headers: {
|
|
4668
|
+
"Content-Type": "application/json"
|
|
4669
|
+
}
|
|
4716
4670
|
});
|
|
4717
4671
|
},
|
|
4718
|
-
settingsWebRead2fa(
|
|
4719
|
-
|
|
4672
|
+
async settingsWebRead2fa({
|
|
4673
|
+
method,
|
|
4674
|
+
model,
|
|
4675
|
+
kwargs,
|
|
4676
|
+
token
|
|
4677
|
+
}) {
|
|
4678
|
+
const env2 = getEnv();
|
|
4679
|
+
const jsonData = {
|
|
4720
4680
|
method,
|
|
4721
4681
|
model,
|
|
4722
4682
|
kwargs,
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
token
|
|
4732
|
-
}
|
|
4733
|
-
};
|
|
4734
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4735
|
-
headers: {
|
|
4736
|
-
"Content-Type": "application/json"
|
|
4737
|
-
}
|
|
4738
|
-
});
|
|
4683
|
+
with_context: {
|
|
4684
|
+
token
|
|
4685
|
+
}
|
|
4686
|
+
};
|
|
4687
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4688
|
+
headers: {
|
|
4689
|
+
"Content-Type": "application/json"
|
|
4690
|
+
}
|
|
4739
4691
|
});
|
|
4740
4692
|
},
|
|
4741
|
-
requestSetupTotp(
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
}
|
|
4754
|
-
});
|
|
4693
|
+
async requestSetupTotp({ method, token }) {
|
|
4694
|
+
const env2 = getEnv();
|
|
4695
|
+
const jsonData = {
|
|
4696
|
+
method,
|
|
4697
|
+
with_context: {
|
|
4698
|
+
token
|
|
4699
|
+
}
|
|
4700
|
+
};
|
|
4701
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4702
|
+
headers: {
|
|
4703
|
+
"Content-Type": "application/json"
|
|
4704
|
+
}
|
|
4755
4705
|
});
|
|
4756
4706
|
},
|
|
4757
|
-
verifyTotp(
|
|
4758
|
-
|
|
4707
|
+
async verifyTotp({
|
|
4708
|
+
method,
|
|
4709
|
+
action_token,
|
|
4710
|
+
code
|
|
4711
|
+
}) {
|
|
4712
|
+
const env2 = getEnv();
|
|
4713
|
+
const jsonData = {
|
|
4759
4714
|
method,
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
const env2 = getEnv();
|
|
4764
|
-
const jsonData = {
|
|
4765
|
-
method,
|
|
4766
|
-
kwargs: {
|
|
4767
|
-
vals: {
|
|
4768
|
-
code
|
|
4769
|
-
}
|
|
4770
|
-
},
|
|
4771
|
-
with_context: {
|
|
4772
|
-
action_token
|
|
4773
|
-
}
|
|
4774
|
-
};
|
|
4775
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4776
|
-
headers: {
|
|
4777
|
-
"Content-Type": "application/json"
|
|
4715
|
+
kwargs: {
|
|
4716
|
+
vals: {
|
|
4717
|
+
code
|
|
4778
4718
|
}
|
|
4779
|
-
}
|
|
4719
|
+
},
|
|
4720
|
+
with_context: {
|
|
4721
|
+
action_token
|
|
4722
|
+
}
|
|
4723
|
+
};
|
|
4724
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4725
|
+
headers: {
|
|
4726
|
+
"Content-Type": "application/json"
|
|
4727
|
+
}
|
|
4780
4728
|
});
|
|
4781
4729
|
},
|
|
4782
|
-
removeTotpSetUp(
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
}
|
|
4795
|
-
});
|
|
4730
|
+
async removeTotpSetUp({ method, token }) {
|
|
4731
|
+
const env2 = getEnv();
|
|
4732
|
+
const jsonData = {
|
|
4733
|
+
method,
|
|
4734
|
+
with_context: {
|
|
4735
|
+
token
|
|
4736
|
+
}
|
|
4737
|
+
};
|
|
4738
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4739
|
+
headers: {
|
|
4740
|
+
"Content-Type": "application/json"
|
|
4741
|
+
}
|
|
4796
4742
|
});
|
|
4797
4743
|
}
|
|
4798
4744
|
};
|
|
@@ -4800,7 +4746,7 @@ var view_service_default = ViewService;
|
|
|
4800
4746
|
|
|
4801
4747
|
// src/hooks/auth/use-forgot-password.ts
|
|
4802
4748
|
var useForgotPassword = () => {
|
|
4803
|
-
return useMutation({
|
|
4749
|
+
return (0, import_react_query.useMutation)({
|
|
4804
4750
|
mutationFn: (email) => {
|
|
4805
4751
|
return auth_service_default.forgotPassword(email);
|
|
4806
4752
|
}
|
|
@@ -4809,9 +4755,9 @@ var useForgotPassword = () => {
|
|
|
4809
4755
|
var use_forgot_password_default = useForgotPassword;
|
|
4810
4756
|
|
|
4811
4757
|
// src/hooks/auth/use-forgotpassword-sso.ts
|
|
4812
|
-
|
|
4758
|
+
var import_react_query2 = require("@tanstack/react-query");
|
|
4813
4759
|
var useForgotPasswordSSO = () => {
|
|
4814
|
-
return
|
|
4760
|
+
return (0, import_react_query2.useMutation)({
|
|
4815
4761
|
mutationFn: ({
|
|
4816
4762
|
email,
|
|
4817
4763
|
with_context,
|
|
@@ -4824,20 +4770,20 @@ var useForgotPasswordSSO = () => {
|
|
|
4824
4770
|
var use_forgotpassword_sso_default = useForgotPasswordSSO;
|
|
4825
4771
|
|
|
4826
4772
|
// src/hooks/auth/use-get-provider.ts
|
|
4827
|
-
|
|
4773
|
+
var import_react_query3 = require("@tanstack/react-query");
|
|
4828
4774
|
var useGetProvider = () => {
|
|
4829
|
-
return
|
|
4775
|
+
return (0, import_react_query3.useMutation)({
|
|
4830
4776
|
mutationFn: (data) => {
|
|
4831
|
-
return auth_service_default.getProviders(data
|
|
4777
|
+
return auth_service_default.getProviders(data?.db);
|
|
4832
4778
|
}
|
|
4833
4779
|
});
|
|
4834
4780
|
};
|
|
4835
4781
|
var use_get_provider_default = useGetProvider;
|
|
4836
4782
|
|
|
4837
4783
|
// src/hooks/auth/use-isvalid-token.ts
|
|
4838
|
-
|
|
4784
|
+
var import_react_query4 = require("@tanstack/react-query");
|
|
4839
4785
|
var useIsValidToken = () => {
|
|
4840
|
-
return
|
|
4786
|
+
return (0, import_react_query4.useMutation)({
|
|
4841
4787
|
mutationFn: (token) => {
|
|
4842
4788
|
return auth_service_default.isValidToken(token);
|
|
4843
4789
|
}
|
|
@@ -4846,9 +4792,9 @@ var useIsValidToken = () => {
|
|
|
4846
4792
|
var use_isvalid_token_default = useIsValidToken;
|
|
4847
4793
|
|
|
4848
4794
|
// src/hooks/auth/use-login-credential.ts
|
|
4849
|
-
|
|
4795
|
+
var import_react_query5 = require("@tanstack/react-query");
|
|
4850
4796
|
var useLoginCredential = () => {
|
|
4851
|
-
return
|
|
4797
|
+
return (0, import_react_query5.useMutation)({
|
|
4852
4798
|
mutationFn: (data) => {
|
|
4853
4799
|
return auth_service_default.login(data);
|
|
4854
4800
|
}
|
|
@@ -4857,9 +4803,9 @@ var useLoginCredential = () => {
|
|
|
4857
4803
|
var use_login_credential_default = useLoginCredential;
|
|
4858
4804
|
|
|
4859
4805
|
// src/hooks/auth/use-login-socical.ts
|
|
4860
|
-
|
|
4806
|
+
var import_react_query6 = require("@tanstack/react-query");
|
|
4861
4807
|
var useLoginSocial = () => {
|
|
4862
|
-
return
|
|
4808
|
+
return (0, import_react_query6.useMutation)({
|
|
4863
4809
|
mutationFn: (data) => {
|
|
4864
4810
|
return auth_service_default.loginSocial(data);
|
|
4865
4811
|
}
|
|
@@ -4868,9 +4814,9 @@ var useLoginSocial = () => {
|
|
|
4868
4814
|
var use_login_socical_default = useLoginSocial;
|
|
4869
4815
|
|
|
4870
4816
|
// src/hooks/auth/use-reset-password.ts
|
|
4871
|
-
|
|
4817
|
+
var import_react_query7 = require("@tanstack/react-query");
|
|
4872
4818
|
var useResetPassword = () => {
|
|
4873
|
-
return
|
|
4819
|
+
return (0, import_react_query7.useMutation)({
|
|
4874
4820
|
mutationFn: (request) => {
|
|
4875
4821
|
return auth_service_default.resetPassword(request.data, request.token);
|
|
4876
4822
|
}
|
|
@@ -4879,9 +4825,9 @@ var useResetPassword = () => {
|
|
|
4879
4825
|
var use_reset_password_default = useResetPassword;
|
|
4880
4826
|
|
|
4881
4827
|
// src/hooks/auth/use-reset-password-sso.ts
|
|
4882
|
-
|
|
4828
|
+
var import_react_query8 = require("@tanstack/react-query");
|
|
4883
4829
|
var useResetPasswordSSO = () => {
|
|
4884
|
-
return
|
|
4830
|
+
return (0, import_react_query8.useMutation)({
|
|
4885
4831
|
mutationFn: ({
|
|
4886
4832
|
method,
|
|
4887
4833
|
password,
|
|
@@ -4898,9 +4844,9 @@ var useResetPasswordSSO = () => {
|
|
|
4898
4844
|
var use_reset_password_sso_default = useResetPasswordSSO;
|
|
4899
4845
|
|
|
4900
4846
|
// src/hooks/auth/use-update-password.ts
|
|
4901
|
-
|
|
4847
|
+
var import_react_query9 = require("@tanstack/react-query");
|
|
4902
4848
|
var useUpdatePassword = () => {
|
|
4903
|
-
return
|
|
4849
|
+
return (0, import_react_query9.useMutation)({
|
|
4904
4850
|
mutationFn: (request) => {
|
|
4905
4851
|
return auth_service_default.updatePassword(request.data, request.token);
|
|
4906
4852
|
}
|
|
@@ -4909,9 +4855,9 @@ var useUpdatePassword = () => {
|
|
|
4909
4855
|
var use_update_password_default = useUpdatePassword;
|
|
4910
4856
|
|
|
4911
4857
|
// src/hooks/auth/use-logout.ts
|
|
4912
|
-
|
|
4858
|
+
var import_react_query10 = require("@tanstack/react-query");
|
|
4913
4859
|
var useLogout = () => {
|
|
4914
|
-
return
|
|
4860
|
+
return (0, import_react_query10.useMutation)({
|
|
4915
4861
|
mutationFn: (data) => {
|
|
4916
4862
|
return auth_service_default.logout(data);
|
|
4917
4863
|
}
|
|
@@ -4920,9 +4866,9 @@ var useLogout = () => {
|
|
|
4920
4866
|
var use_logout_default = useLogout;
|
|
4921
4867
|
|
|
4922
4868
|
// src/hooks/auth/use-get-access-by-code.ts
|
|
4923
|
-
|
|
4869
|
+
var import_react_query11 = require("@tanstack/react-query");
|
|
4924
4870
|
var useGetAccessByCode = () => {
|
|
4925
|
-
return
|
|
4871
|
+
return (0, import_react_query11.useMutation)({
|
|
4926
4872
|
mutationFn: ({ code }) => {
|
|
4927
4873
|
return auth_service_default.getAccessByCode(code);
|
|
4928
4874
|
}
|
|
@@ -4930,26 +4876,40 @@ var useGetAccessByCode = () => {
|
|
|
4930
4876
|
};
|
|
4931
4877
|
var use_get_access_by_code_default = useGetAccessByCode;
|
|
4932
4878
|
|
|
4879
|
+
// src/hooks/auth/use-validate-action-token.ts
|
|
4880
|
+
var import_react_query12 = require("@tanstack/react-query");
|
|
4881
|
+
var useValidateActionToken = () => {
|
|
4882
|
+
return (0, import_react_query12.useMutation)({
|
|
4883
|
+
mutationFn: ({
|
|
4884
|
+
actionToken,
|
|
4885
|
+
path
|
|
4886
|
+
}) => {
|
|
4887
|
+
return auth_service_default.isValidActionToken(actionToken, path);
|
|
4888
|
+
}
|
|
4889
|
+
});
|
|
4890
|
+
};
|
|
4891
|
+
var use_validate_action_token_default = useValidateActionToken;
|
|
4892
|
+
|
|
4933
4893
|
// src/hooks/company/use-get-company-info.ts
|
|
4934
|
-
|
|
4894
|
+
var import_react_query13 = require("@tanstack/react-query");
|
|
4935
4895
|
var useGetCompanyInfo = () => {
|
|
4936
|
-
return
|
|
4896
|
+
return (0, import_react_query13.useMutation)({
|
|
4937
4897
|
mutationFn: (id) => company_service_default.getInfoCompany(id)
|
|
4938
4898
|
});
|
|
4939
4899
|
};
|
|
4940
4900
|
var use_get_company_info_default = useGetCompanyInfo;
|
|
4941
4901
|
|
|
4942
4902
|
// src/hooks/company/use-get-current-company.ts
|
|
4943
|
-
|
|
4903
|
+
var import_react_query14 = require("@tanstack/react-query");
|
|
4944
4904
|
var useGetCurrentCompany = () => {
|
|
4945
|
-
return
|
|
4905
|
+
return (0, import_react_query14.useMutation)({
|
|
4946
4906
|
mutationFn: () => company_service_default.getCurrentCompany()
|
|
4947
4907
|
});
|
|
4948
4908
|
};
|
|
4949
4909
|
var use_get_current_company_default = useGetCurrentCompany;
|
|
4950
4910
|
|
|
4951
4911
|
// src/hooks/company/use-get-list-company.ts
|
|
4952
|
-
|
|
4912
|
+
var import_react_query15 = require("@tanstack/react-query");
|
|
4953
4913
|
var useGetListCompany = (companyIDs = []) => {
|
|
4954
4914
|
const companySpec = {
|
|
4955
4915
|
id: {},
|
|
@@ -4960,7 +4920,7 @@ var useGetListCompany = (companyIDs = []) => {
|
|
|
4960
4920
|
ids: companyIDs,
|
|
4961
4921
|
specification: companySpec
|
|
4962
4922
|
};
|
|
4963
|
-
return useQuery({
|
|
4923
|
+
return (0, import_react_query15.useQuery)({
|
|
4964
4924
|
queryKey: ["list_company" /* LIST_COMPANY */, companyIDs],
|
|
4965
4925
|
queryFn: () => model_service_default.getList(getListParams),
|
|
4966
4926
|
refetchOnWindowFocus: false
|
|
@@ -4969,9 +4929,9 @@ var useGetListCompany = (companyIDs = []) => {
|
|
|
4969
4929
|
var use_get_list_company_default = useGetListCompany;
|
|
4970
4930
|
|
|
4971
4931
|
// src/hooks/excel/use-export-excel.ts
|
|
4972
|
-
|
|
4932
|
+
var import_react_query16 = require("@tanstack/react-query");
|
|
4973
4933
|
var useExportExcel = () => {
|
|
4974
|
-
return
|
|
4934
|
+
return (0, import_react_query16.useMutation)({
|
|
4975
4935
|
mutationFn: ({
|
|
4976
4936
|
model,
|
|
4977
4937
|
domain,
|
|
@@ -4996,9 +4956,9 @@ var useExportExcel = () => {
|
|
|
4996
4956
|
var use_export_excel_default = useExportExcel;
|
|
4997
4957
|
|
|
4998
4958
|
// src/hooks/excel/use-get-field-export.ts
|
|
4999
|
-
|
|
4959
|
+
var import_react_query17 = require("@tanstack/react-query");
|
|
5000
4960
|
var useGetFieldExport = () => {
|
|
5001
|
-
return
|
|
4961
|
+
return (0, import_react_query17.useMutation)({
|
|
5002
4962
|
mutationFn: ({
|
|
5003
4963
|
ids,
|
|
5004
4964
|
model,
|
|
@@ -5027,9 +4987,9 @@ var useGetFieldExport = () => {
|
|
|
5027
4987
|
var use_get_field_export_default = useGetFieldExport;
|
|
5028
4988
|
|
|
5029
4989
|
// src/hooks/excel/use-get-file-excel.ts
|
|
5030
|
-
|
|
4990
|
+
var import_react_query18 = require("@tanstack/react-query");
|
|
5031
4991
|
var useGetFileExcel = ({ model }) => {
|
|
5032
|
-
return
|
|
4992
|
+
return (0, import_react_query18.useQuery)({
|
|
5033
4993
|
queryKey: [],
|
|
5034
4994
|
queryFn: () => excel_service_default.getFileExcel({
|
|
5035
4995
|
model
|
|
@@ -5045,9 +5005,9 @@ var useGetFileExcel = ({ model }) => {
|
|
|
5045
5005
|
var use_get_file_excel_default = useGetFileExcel;
|
|
5046
5006
|
|
|
5047
5007
|
// src/hooks/excel/use-parse-preview.ts
|
|
5048
|
-
|
|
5008
|
+
var import_react_query19 = require("@tanstack/react-query");
|
|
5049
5009
|
var useParsePreview = () => {
|
|
5050
|
-
return
|
|
5010
|
+
return (0, import_react_query19.useMutation)({
|
|
5051
5011
|
mutationFn: ({
|
|
5052
5012
|
id,
|
|
5053
5013
|
selectedSheet,
|
|
@@ -5064,9 +5024,9 @@ var useParsePreview = () => {
|
|
|
5064
5024
|
var use_parse_preview_default = useParsePreview;
|
|
5065
5025
|
|
|
5066
5026
|
// src/hooks/excel/use-upload-file.ts
|
|
5067
|
-
|
|
5027
|
+
var import_react_query20 = require("@tanstack/react-query");
|
|
5068
5028
|
var useUploadFile = () => {
|
|
5069
|
-
return
|
|
5029
|
+
return (0, import_react_query20.useMutation)({
|
|
5070
5030
|
mutationFn: ({ formData }) => excel_service_default.uploadFile({
|
|
5071
5031
|
formData
|
|
5072
5032
|
})
|
|
@@ -5075,9 +5035,9 @@ var useUploadFile = () => {
|
|
|
5075
5035
|
var use_upload_file_default = useUploadFile;
|
|
5076
5036
|
|
|
5077
5037
|
// src/hooks/excel/use-upload-id-file.ts
|
|
5078
|
-
|
|
5038
|
+
var import_react_query21 = require("@tanstack/react-query");
|
|
5079
5039
|
var useUploadIdFile = () => {
|
|
5080
|
-
return
|
|
5040
|
+
return (0, import_react_query21.useMutation)({
|
|
5081
5041
|
mutationFn: ({ formData }) => excel_service_default.uploadIdFile({
|
|
5082
5042
|
formData
|
|
5083
5043
|
})
|
|
@@ -5086,9 +5046,9 @@ var useUploadIdFile = () => {
|
|
|
5086
5046
|
var use_upload_id_file_default = useUploadIdFile;
|
|
5087
5047
|
|
|
5088
5048
|
// src/hooks/excel/uss-execute-import.ts
|
|
5089
|
-
|
|
5049
|
+
var import_react_query22 = require("@tanstack/react-query");
|
|
5090
5050
|
var useExecuteImport = () => {
|
|
5091
|
-
return
|
|
5051
|
+
return (0, import_react_query22.useMutation)({
|
|
5092
5052
|
mutationFn: ({
|
|
5093
5053
|
fields,
|
|
5094
5054
|
columns,
|
|
@@ -5109,9 +5069,9 @@ var useExecuteImport = () => {
|
|
|
5109
5069
|
var uss_execute_import_default = useExecuteImport;
|
|
5110
5070
|
|
|
5111
5071
|
// src/hooks/form/use-change-status.ts
|
|
5112
|
-
|
|
5072
|
+
var import_react_query23 = require("@tanstack/react-query");
|
|
5113
5073
|
var useChangeStatus = () => {
|
|
5114
|
-
return
|
|
5074
|
+
return (0, import_react_query23.useMutation)({
|
|
5115
5075
|
mutationFn: ({ data }) => {
|
|
5116
5076
|
return form_service_default.changeStatus({
|
|
5117
5077
|
data
|
|
@@ -5122,9 +5082,9 @@ var useChangeStatus = () => {
|
|
|
5122
5082
|
var use_change_status_default = useChangeStatus;
|
|
5123
5083
|
|
|
5124
5084
|
// src/hooks/form/use-delete-comment.ts
|
|
5125
|
-
|
|
5085
|
+
var import_react_query24 = require("@tanstack/react-query");
|
|
5126
5086
|
var useDeleteComment = () => {
|
|
5127
|
-
return
|
|
5087
|
+
return (0, import_react_query24.useMutation)({
|
|
5128
5088
|
mutationFn: ({ data }) => form_service_default.deleteComment({
|
|
5129
5089
|
data
|
|
5130
5090
|
})
|
|
@@ -5133,9 +5093,9 @@ var useDeleteComment = () => {
|
|
|
5133
5093
|
var use_delete_comment_default = useDeleteComment;
|
|
5134
5094
|
|
|
5135
5095
|
// src/hooks/form/use-get-comment.ts
|
|
5136
|
-
|
|
5096
|
+
var import_react_query25 = require("@tanstack/react-query");
|
|
5137
5097
|
var useGetComment = ({ data, queryKey }) => {
|
|
5138
|
-
return
|
|
5098
|
+
return (0, import_react_query25.useQuery)({
|
|
5139
5099
|
queryKey,
|
|
5140
5100
|
queryFn: () => form_service_default.getComment({ data }).then((res) => {
|
|
5141
5101
|
if (res) {
|
|
@@ -5149,13 +5109,13 @@ var useGetComment = ({ data, queryKey }) => {
|
|
|
5149
5109
|
var use_get_comment_default = useGetComment;
|
|
5150
5110
|
|
|
5151
5111
|
// src/hooks/form/use-get-form-view.ts
|
|
5152
|
-
|
|
5112
|
+
var import_react_query26 = require("@tanstack/react-query");
|
|
5153
5113
|
var useGetFormView = ({
|
|
5154
5114
|
data,
|
|
5155
5115
|
queryKey,
|
|
5156
5116
|
enabled
|
|
5157
5117
|
}) => {
|
|
5158
|
-
return
|
|
5118
|
+
return (0, import_react_query26.useQuery)({
|
|
5159
5119
|
queryKey,
|
|
5160
5120
|
queryFn: () => form_service_default.getFormView({ data }).then((res) => {
|
|
5161
5121
|
if (res) {
|
|
@@ -5169,13 +5129,13 @@ var useGetFormView = ({
|
|
|
5169
5129
|
var use_get_form_view_default = useGetFormView;
|
|
5170
5130
|
|
|
5171
5131
|
// src/hooks/form/use-get-image.ts
|
|
5172
|
-
|
|
5132
|
+
var import_react_query27 = require("@tanstack/react-query");
|
|
5173
5133
|
var useGetImage = ({
|
|
5174
5134
|
data,
|
|
5175
5135
|
queryKey,
|
|
5176
5136
|
src
|
|
5177
5137
|
}) => {
|
|
5178
|
-
return
|
|
5138
|
+
return (0, import_react_query27.useQuery)({
|
|
5179
5139
|
queryKey,
|
|
5180
5140
|
queryFn: () => form_service_default.getImage({ data }).then((res) => {
|
|
5181
5141
|
if (res) {
|
|
@@ -5189,9 +5149,9 @@ var useGetImage = ({
|
|
|
5189
5149
|
var use_get_image_default = useGetImage;
|
|
5190
5150
|
|
|
5191
5151
|
// src/hooks/form/use-send-comment.ts
|
|
5192
|
-
|
|
5152
|
+
var import_react_query28 = require("@tanstack/react-query");
|
|
5193
5153
|
var useSendComment = () => {
|
|
5194
|
-
return
|
|
5154
|
+
return (0, import_react_query28.useMutation)({
|
|
5195
5155
|
mutationFn: ({ data }) => form_service_default.sentComment({
|
|
5196
5156
|
data
|
|
5197
5157
|
})
|
|
@@ -5200,9 +5160,9 @@ var useSendComment = () => {
|
|
|
5200
5160
|
var use_send_comment_default = useSendComment;
|
|
5201
5161
|
|
|
5202
5162
|
// src/hooks/form/use-upload-image.ts
|
|
5203
|
-
|
|
5163
|
+
var import_react_query29 = require("@tanstack/react-query");
|
|
5204
5164
|
var useUploadImage = () => {
|
|
5205
|
-
return
|
|
5165
|
+
return (0, import_react_query29.useMutation)({
|
|
5206
5166
|
mutationFn: ({ data }) => form_service_default.uploadImage({
|
|
5207
5167
|
data
|
|
5208
5168
|
})
|
|
@@ -5211,18 +5171,18 @@ var useUploadImage = () => {
|
|
|
5211
5171
|
var use_upload_image_default = useUploadImage;
|
|
5212
5172
|
|
|
5213
5173
|
// src/hooks/model/use-delete.ts
|
|
5214
|
-
|
|
5174
|
+
var import_react_query30 = require("@tanstack/react-query");
|
|
5215
5175
|
var useDelete = () => {
|
|
5216
|
-
return
|
|
5176
|
+
return (0, import_react_query30.useMutation)({
|
|
5217
5177
|
mutationFn: ({ ids, model }) => model_service_default.delete({ ids, model })
|
|
5218
5178
|
});
|
|
5219
5179
|
};
|
|
5220
5180
|
var use_delete_default = useDelete;
|
|
5221
5181
|
|
|
5222
5182
|
// src/hooks/model/use-get-all.ts
|
|
5223
|
-
|
|
5183
|
+
var import_react_query31 = require("@tanstack/react-query");
|
|
5224
5184
|
var useGetAll = ({ data, queryKey, viewResponse }) => {
|
|
5225
|
-
return
|
|
5185
|
+
return (0, import_react_query31.useQuery)({
|
|
5226
5186
|
queryKey,
|
|
5227
5187
|
queryFn: () => model_service_default.getAll({ data }).then((res) => {
|
|
5228
5188
|
if (res) {
|
|
@@ -5237,9 +5197,9 @@ var useGetAll = ({ data, queryKey, viewResponse }) => {
|
|
|
5237
5197
|
var use_get_all_default = useGetAll;
|
|
5238
5198
|
|
|
5239
5199
|
// src/hooks/model/use-get-conversion-rate.ts
|
|
5240
|
-
|
|
5200
|
+
var import_react_query32 = require("@tanstack/react-query");
|
|
5241
5201
|
var useGetConversionRate = () => {
|
|
5242
|
-
return
|
|
5202
|
+
return (0, import_react_query32.useQuery)({
|
|
5243
5203
|
queryKey: ["currency-rate"],
|
|
5244
5204
|
queryFn: () => model_service_default.getConversionRate().then((res) => {
|
|
5245
5205
|
if (res) {
|
|
@@ -5252,9 +5212,9 @@ var useGetConversionRate = () => {
|
|
|
5252
5212
|
var use_get_conversion_rate_default = useGetConversionRate;
|
|
5253
5213
|
|
|
5254
5214
|
// src/hooks/model/use-get-currency.ts
|
|
5255
|
-
|
|
5215
|
+
var import_react_query33 = require("@tanstack/react-query");
|
|
5256
5216
|
var useGetCurrency = () => {
|
|
5257
|
-
return
|
|
5217
|
+
return (0, import_react_query33.useQuery)({
|
|
5258
5218
|
queryKey: ["currency"],
|
|
5259
5219
|
queryFn: () => model_service_default.getCurrency().then((res) => {
|
|
5260
5220
|
if (res) {
|
|
@@ -5267,9 +5227,9 @@ var useGetCurrency = () => {
|
|
|
5267
5227
|
var use_get_currency_default = useGetCurrency;
|
|
5268
5228
|
|
|
5269
5229
|
// src/hooks/model/use-get-detail.ts
|
|
5270
|
-
|
|
5230
|
+
var import_react_query34 = require("@tanstack/react-query");
|
|
5271
5231
|
var useGetDetail = () => {
|
|
5272
|
-
return
|
|
5232
|
+
return (0, import_react_query34.useMutation)({
|
|
5273
5233
|
mutationFn: ({
|
|
5274
5234
|
model,
|
|
5275
5235
|
ids,
|
|
@@ -5286,9 +5246,9 @@ var useGetDetail = () => {
|
|
|
5286
5246
|
var use_get_detail_default = useGetDetail;
|
|
5287
5247
|
|
|
5288
5248
|
// src/hooks/model/use-get-field-onchange.ts
|
|
5289
|
-
|
|
5249
|
+
var import_react_query35 = require("@tanstack/react-query");
|
|
5290
5250
|
var useGetFieldOnChange = ({ model }) => {
|
|
5291
|
-
return
|
|
5251
|
+
return (0, import_react_query35.useQuery)({
|
|
5292
5252
|
queryKey: [`field-onchange-${model}`, model],
|
|
5293
5253
|
queryFn: () => model_service_default.getListFieldsOnchange({
|
|
5294
5254
|
model
|
|
@@ -5304,13 +5264,13 @@ var useGetFieldOnChange = ({ model }) => {
|
|
|
5304
5264
|
var use_get_field_onchange_default = useGetFieldOnChange;
|
|
5305
5265
|
|
|
5306
5266
|
// src/hooks/model/use-get-list-my-bank-account.ts
|
|
5307
|
-
|
|
5267
|
+
var import_react_query36 = require("@tanstack/react-query");
|
|
5308
5268
|
var useGetListMyBankAccount = ({
|
|
5309
5269
|
domain,
|
|
5310
5270
|
spectification,
|
|
5311
5271
|
model
|
|
5312
5272
|
}) => {
|
|
5313
|
-
return
|
|
5273
|
+
return (0, import_react_query36.useQuery)({
|
|
5314
5274
|
queryKey: ["bank-account", model, domain],
|
|
5315
5275
|
queryFn: () => model_service_default.getListMyBankAccount({
|
|
5316
5276
|
domain,
|
|
@@ -5328,6 +5288,10 @@ var use_get_list_my_bank_account_default = useGetListMyBankAccount;
|
|
|
5328
5288
|
|
|
5329
5289
|
// src/models/base-model/index.ts
|
|
5330
5290
|
var BaseModel = class {
|
|
5291
|
+
name;
|
|
5292
|
+
view;
|
|
5293
|
+
actContext;
|
|
5294
|
+
fields;
|
|
5331
5295
|
constructor(init) {
|
|
5332
5296
|
this.name = init.name;
|
|
5333
5297
|
this.view = init.view;
|
|
@@ -5342,22 +5306,21 @@ var BaseModel = class {
|
|
|
5342
5306
|
modelRoot
|
|
5343
5307
|
}) {
|
|
5344
5308
|
if (Array.isArray(fields)) {
|
|
5345
|
-
let spec =
|
|
5309
|
+
let spec = { ...specification };
|
|
5346
5310
|
fields.forEach((field) => {
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
const
|
|
5352
|
-
const modelRelation = modelsData == null ? void 0 : modelsData[relation];
|
|
5311
|
+
if (!field?.type_co || field?.name && field?.type_co === "field" /* FIELD */) {
|
|
5312
|
+
if (modelsData?.[model]?.[field?.name]) {
|
|
5313
|
+
if (modelsData?.[model]?.[field?.name]?.type === "one2many" /* ONE2MANY */ || modelsData?.[model]?.[field?.name]?.type === "many2many" /* MANY2MANY */) {
|
|
5314
|
+
const relation = modelsData?.[model]?.[field?.name]?.relation;
|
|
5315
|
+
const modelRelation = modelsData?.[relation];
|
|
5353
5316
|
if (modelRelation) {
|
|
5354
|
-
spec[field
|
|
5317
|
+
spec[field?.name] = {
|
|
5355
5318
|
fields: {}
|
|
5356
5319
|
};
|
|
5357
5320
|
if (modelRoot && modelRoot === relation) {
|
|
5358
|
-
spec[field
|
|
5321
|
+
spec[field?.name].fields = { id: {} };
|
|
5359
5322
|
} else {
|
|
5360
|
-
spec[field
|
|
5323
|
+
spec[field?.name].fields = this.getSpecificationByFields({
|
|
5361
5324
|
fields: Object.values(modelRelation),
|
|
5362
5325
|
specification: {},
|
|
5363
5326
|
modelsData,
|
|
@@ -5366,42 +5329,45 @@ var BaseModel = class {
|
|
|
5366
5329
|
});
|
|
5367
5330
|
}
|
|
5368
5331
|
} else {
|
|
5369
|
-
spec[field
|
|
5332
|
+
spec[field?.name] = {
|
|
5370
5333
|
fields: {
|
|
5371
5334
|
id: {},
|
|
5372
5335
|
display_name: {}
|
|
5373
5336
|
}
|
|
5374
5337
|
};
|
|
5375
5338
|
}
|
|
5376
|
-
} else if (
|
|
5377
|
-
spec[field
|
|
5378
|
-
fields:
|
|
5339
|
+
} else if (modelsData?.[model]?.[field?.name]?.type === "many2one" /* MANY2ONE */) {
|
|
5340
|
+
spec[field?.name] = {
|
|
5341
|
+
fields: {
|
|
5379
5342
|
id: {},
|
|
5380
|
-
display_name: {}
|
|
5381
|
-
|
|
5343
|
+
display_name: {},
|
|
5344
|
+
...WIDGETAVATAR[field?.widget] ? { image_256: {} } : {},
|
|
5345
|
+
...field?.name === "currency_id" && fields?.find((item) => item?.widget === "monetary") ? { symbol: {} } : {},
|
|
5346
|
+
...field?.widget === "many2many_binary" ? { mimetype: {} } : {}
|
|
5347
|
+
}
|
|
5382
5348
|
};
|
|
5383
5349
|
} else {
|
|
5384
|
-
spec[field
|
|
5350
|
+
spec[field?.name] = {};
|
|
5385
5351
|
}
|
|
5386
5352
|
}
|
|
5387
|
-
} else if (
|
|
5353
|
+
} else if (field?.type_co === "group" /* GROUP */ || field?.type_co === "div" /* DIV */ || field?.type_co === "span" /* SPAN */) {
|
|
5388
5354
|
const specGroup = this.getSpecificationByFields({
|
|
5389
|
-
fields: field
|
|
5355
|
+
fields: field?.fields,
|
|
5390
5356
|
specification: spec,
|
|
5391
5357
|
modelsData,
|
|
5392
5358
|
model
|
|
5393
5359
|
});
|
|
5394
|
-
spec =
|
|
5395
|
-
} else if (
|
|
5396
|
-
const relation =
|
|
5360
|
+
spec = { ...spec, ...specGroup };
|
|
5361
|
+
} else if (field?.type_co === "tree" /* TREE */ || field?.type_co === "list" /* LIST */) {
|
|
5362
|
+
const relation = modelsData?.[model]?.[field?.name]?.relation;
|
|
5397
5363
|
const specTreee = this.getSpecificationByFields({
|
|
5398
|
-
fields: field
|
|
5364
|
+
fields: field?.fields,
|
|
5399
5365
|
specification: {},
|
|
5400
5366
|
modelsData,
|
|
5401
5367
|
model: relation,
|
|
5402
5368
|
modelRoot: model
|
|
5403
5369
|
});
|
|
5404
|
-
spec =
|
|
5370
|
+
spec = { ...spec, [field?.name]: { fields: specTreee } };
|
|
5405
5371
|
}
|
|
5406
5372
|
});
|
|
5407
5373
|
return spec;
|
|
@@ -5410,19 +5376,16 @@ var BaseModel = class {
|
|
|
5410
5376
|
}
|
|
5411
5377
|
}
|
|
5412
5378
|
getTreeProps() {
|
|
5413
|
-
|
|
5414
|
-
const props = ((_b = (_a = this.view) == null ? void 0 : _a.views) == null ? void 0 : _b.list) || {};
|
|
5379
|
+
const props = this.view?.views?.list || {};
|
|
5415
5380
|
return props;
|
|
5416
5381
|
}
|
|
5417
5382
|
getTreeFields() {
|
|
5418
|
-
|
|
5419
|
-
const fields = ((_c = (_b = (_a = this.view) == null ? void 0 : _a.views) == null ? void 0 : _b.list) == null ? void 0 : _c.fields) || [];
|
|
5383
|
+
const fields = this.view?.views?.list?.fields || [];
|
|
5420
5384
|
return fields;
|
|
5421
5385
|
}
|
|
5422
5386
|
getSpecification() {
|
|
5423
|
-
var _a;
|
|
5424
5387
|
const specInit = {};
|
|
5425
|
-
const modelData =
|
|
5388
|
+
const modelData = this.view?.models || {};
|
|
5426
5389
|
const specification = this.getSpecificationByFields({
|
|
5427
5390
|
fields: this.fields,
|
|
5428
5391
|
specification: specInit,
|
|
@@ -5438,7 +5401,7 @@ var base_model_default = BaseModel;
|
|
|
5438
5401
|
// src/hooks/model/use-model.ts
|
|
5439
5402
|
var useModel = () => {
|
|
5440
5403
|
const initModel = (modelData) => {
|
|
5441
|
-
switch (modelData
|
|
5404
|
+
switch (modelData?.name) {
|
|
5442
5405
|
default:
|
|
5443
5406
|
return new base_model_default(modelData);
|
|
5444
5407
|
}
|
|
@@ -5459,9 +5422,9 @@ var useOdooDataTransform = () => {
|
|
|
5459
5422
|
var use_odoo_data_transform_default = useOdooDataTransform;
|
|
5460
5423
|
|
|
5461
5424
|
// src/hooks/model/use-onchange-form.ts
|
|
5462
|
-
|
|
5425
|
+
var import_react_query37 = require("@tanstack/react-query");
|
|
5463
5426
|
var useOnChangeForm = () => {
|
|
5464
|
-
return
|
|
5427
|
+
return (0, import_react_query37.useMutation)({
|
|
5465
5428
|
mutationFn: ({
|
|
5466
5429
|
ids,
|
|
5467
5430
|
model,
|
|
@@ -5482,9 +5445,9 @@ var useOnChangeForm = () => {
|
|
|
5482
5445
|
var use_onchange_form_default = useOnChangeForm;
|
|
5483
5446
|
|
|
5484
5447
|
// src/hooks/model/use-save.ts
|
|
5485
|
-
|
|
5448
|
+
var import_react_query38 = require("@tanstack/react-query");
|
|
5486
5449
|
var useSave = () => {
|
|
5487
|
-
return
|
|
5450
|
+
return (0, import_react_query38.useMutation)({
|
|
5488
5451
|
mutationFn: ({
|
|
5489
5452
|
ids,
|
|
5490
5453
|
model,
|
|
@@ -5498,18 +5461,18 @@ var useSave = () => {
|
|
|
5498
5461
|
var use_save_default = useSave;
|
|
5499
5462
|
|
|
5500
5463
|
// src/hooks/user/use-get-profile.ts
|
|
5501
|
-
|
|
5464
|
+
var import_react_query39 = require("@tanstack/react-query");
|
|
5502
5465
|
var useGetProfile = (path) => {
|
|
5503
|
-
return
|
|
5466
|
+
return (0, import_react_query39.useMutation)({
|
|
5504
5467
|
mutationFn: () => user_service_default.getProfile(path)
|
|
5505
5468
|
});
|
|
5506
5469
|
};
|
|
5507
5470
|
var use_get_profile_default = useGetProfile;
|
|
5508
5471
|
|
|
5509
5472
|
// src/hooks/user/use-get-user.ts
|
|
5510
|
-
|
|
5473
|
+
var import_react_query40 = require("@tanstack/react-query");
|
|
5511
5474
|
var useGetUser = () => {
|
|
5512
|
-
return
|
|
5475
|
+
return (0, import_react_query40.useMutation)({
|
|
5513
5476
|
mutationFn: ({ id, context }) => user_service_default.getUser({
|
|
5514
5477
|
id,
|
|
5515
5478
|
context
|
|
@@ -5519,9 +5482,9 @@ var useGetUser = () => {
|
|
|
5519
5482
|
var use_get_user_default = useGetUser;
|
|
5520
5483
|
|
|
5521
5484
|
// src/hooks/user/use-switch-locale.ts
|
|
5522
|
-
|
|
5485
|
+
var import_react_query41 = require("@tanstack/react-query");
|
|
5523
5486
|
var useSwitchLocale = () => {
|
|
5524
|
-
return
|
|
5487
|
+
return (0, import_react_query41.useMutation)({
|
|
5525
5488
|
mutationFn: ({ data }) => {
|
|
5526
5489
|
return user_service_default.switchUserLocale({
|
|
5527
5490
|
id: data.id,
|
|
@@ -5533,9 +5496,9 @@ var useSwitchLocale = () => {
|
|
|
5533
5496
|
var use_switch_locale_default = useSwitchLocale;
|
|
5534
5497
|
|
|
5535
5498
|
// src/hooks/view/use-button.ts
|
|
5536
|
-
|
|
5499
|
+
var import_react_query42 = require("@tanstack/react-query");
|
|
5537
5500
|
var useButton = () => {
|
|
5538
|
-
return
|
|
5501
|
+
return (0, import_react_query42.useMutation)({
|
|
5539
5502
|
mutationFn: ({
|
|
5540
5503
|
model,
|
|
5541
5504
|
ids,
|
|
@@ -5555,9 +5518,9 @@ var useButton = () => {
|
|
|
5555
5518
|
var use_button_default = useButton;
|
|
5556
5519
|
|
|
5557
5520
|
// src/hooks/view/use-duplicate-record.ts
|
|
5558
|
-
|
|
5521
|
+
var import_react_query43 = require("@tanstack/react-query");
|
|
5559
5522
|
var useDuplicateRecord = () => {
|
|
5560
|
-
return
|
|
5523
|
+
return (0, import_react_query43.useMutation)({
|
|
5561
5524
|
mutationFn: ({
|
|
5562
5525
|
id,
|
|
5563
5526
|
model,
|
|
@@ -5572,7 +5535,7 @@ var useDuplicateRecord = () => {
|
|
|
5572
5535
|
var use_duplicate_record_default = useDuplicateRecord;
|
|
5573
5536
|
|
|
5574
5537
|
// src/hooks/view/use-get-action-detail.ts
|
|
5575
|
-
|
|
5538
|
+
var import_react_query44 = require("@tanstack/react-query");
|
|
5576
5539
|
var useGetActionDetail = ({
|
|
5577
5540
|
aid,
|
|
5578
5541
|
context,
|
|
@@ -5583,22 +5546,22 @@ var useGetActionDetail = ({
|
|
|
5583
5546
|
}) => {
|
|
5584
5547
|
const data = {
|
|
5585
5548
|
id,
|
|
5586
|
-
model: model
|
|
5549
|
+
model: model ?? "",
|
|
5587
5550
|
context
|
|
5588
5551
|
};
|
|
5589
|
-
return
|
|
5552
|
+
return (0, import_react_query44.useQuery)({
|
|
5590
5553
|
queryKey,
|
|
5591
|
-
queryFn: () =>
|
|
5554
|
+
queryFn: async () => {
|
|
5592
5555
|
if (aid) {
|
|
5593
|
-
const res =
|
|
5556
|
+
const res = await view_service_default.getActionDetail(aid, context);
|
|
5594
5557
|
if (res && res.length > 0) {
|
|
5595
5558
|
return res[0];
|
|
5596
5559
|
}
|
|
5597
5560
|
} else {
|
|
5598
|
-
const res =
|
|
5561
|
+
const res = await form_service_default.getFormView({ data });
|
|
5599
5562
|
return res;
|
|
5600
5563
|
}
|
|
5601
|
-
}
|
|
5564
|
+
},
|
|
5602
5565
|
enabled,
|
|
5603
5566
|
refetchOnWindowFocus: false,
|
|
5604
5567
|
staleTime: Infinity
|
|
@@ -5607,9 +5570,9 @@ var useGetActionDetail = ({
|
|
|
5607
5570
|
var use_get_action_detail_default = useGetActionDetail;
|
|
5608
5571
|
|
|
5609
5572
|
// src/hooks/view/use-get-calendar.ts
|
|
5610
|
-
|
|
5573
|
+
var import_react_query45 = require("@tanstack/react-query");
|
|
5611
5574
|
var useGetCalendar = (listDataProps, queryKey, enabled) => {
|
|
5612
|
-
return
|
|
5575
|
+
return (0, import_react_query45.useQuery)({
|
|
5613
5576
|
queryKey,
|
|
5614
5577
|
queryFn: () => model_service_default.getListCalendar({ data: listDataProps }).then((res) => {
|
|
5615
5578
|
if (res) {
|
|
@@ -5625,12 +5588,12 @@ var useGetCalendar = (listDataProps, queryKey, enabled) => {
|
|
|
5625
5588
|
var use_get_calendar_default = useGetCalendar;
|
|
5626
5589
|
|
|
5627
5590
|
// src/hooks/view/use-get-groups.ts
|
|
5628
|
-
|
|
5591
|
+
var import_react_query46 = require("@tanstack/react-query");
|
|
5629
5592
|
var useGetGroups = ({
|
|
5630
5593
|
model,
|
|
5631
5594
|
width_context
|
|
5632
5595
|
}) => {
|
|
5633
|
-
return
|
|
5596
|
+
return (0, import_react_query46.useQuery)({
|
|
5634
5597
|
queryKey: [model, width_context],
|
|
5635
5598
|
queryFn: () => kanban_service_default.getGroups({
|
|
5636
5599
|
model,
|
|
@@ -5647,9 +5610,9 @@ var useGetGroups = ({
|
|
|
5647
5610
|
var use_get_groups_default = useGetGroups;
|
|
5648
5611
|
|
|
5649
5612
|
// src/hooks/view/use-get-list-data.ts
|
|
5650
|
-
|
|
5613
|
+
var import_react_query47 = require("@tanstack/react-query");
|
|
5651
5614
|
var useGetListData = (listDataProps, queryKey, enabled) => {
|
|
5652
|
-
return
|
|
5615
|
+
return (0, import_react_query47.useQuery)({
|
|
5653
5616
|
queryKey,
|
|
5654
5617
|
queryFn: () => model_service_default.getAll({ data: listDataProps }).then((res) => {
|
|
5655
5618
|
if (res) {
|
|
@@ -5665,14 +5628,13 @@ var useGetListData = (listDataProps, queryKey, enabled) => {
|
|
|
5665
5628
|
var use_get_list_data_default = useGetListData;
|
|
5666
5629
|
|
|
5667
5630
|
// src/hooks/view/use-get-menu.ts
|
|
5668
|
-
|
|
5631
|
+
var import_react_query48 = require("@tanstack/react-query");
|
|
5669
5632
|
var useGetMenu = (context, enabled) => {
|
|
5670
|
-
return
|
|
5633
|
+
return (0, import_react_query48.useQuery)({
|
|
5671
5634
|
queryKey: ["menus" /* MENU */, context],
|
|
5672
5635
|
queryFn: () => view_service_default.getMenu(context).then((res) => {
|
|
5673
|
-
|
|
5674
|
-
|
|
5675
|
-
return res == null ? void 0 : res.records;
|
|
5636
|
+
if (res && res?.records && res?.records?.length > 0) {
|
|
5637
|
+
return res?.records;
|
|
5676
5638
|
}
|
|
5677
5639
|
return [];
|
|
5678
5640
|
}),
|
|
@@ -5684,9 +5646,9 @@ var useGetMenu = (context, enabled) => {
|
|
|
5684
5646
|
var use_get_menu_default = useGetMenu;
|
|
5685
5647
|
|
|
5686
5648
|
// src/hooks/view/use-get-print-report.ts
|
|
5687
|
-
|
|
5649
|
+
var import_react_query49 = require("@tanstack/react-query");
|
|
5688
5650
|
var useGetPrintReport = () => {
|
|
5689
|
-
return
|
|
5651
|
+
return (0, import_react_query49.useMutation)({
|
|
5690
5652
|
mutationFn: ({ id }) => action_service_default.getPrintReportName({
|
|
5691
5653
|
id
|
|
5692
5654
|
})
|
|
@@ -5695,14 +5657,14 @@ var useGetPrintReport = () => {
|
|
|
5695
5657
|
var use_get_print_report_default = useGetPrintReport;
|
|
5696
5658
|
|
|
5697
5659
|
// src/hooks/view/use-get-progress-bar.ts
|
|
5698
|
-
|
|
5660
|
+
var import_react_query50 = require("@tanstack/react-query");
|
|
5699
5661
|
var useGetProGressBar = ({
|
|
5700
5662
|
field,
|
|
5701
5663
|
color,
|
|
5702
5664
|
model,
|
|
5703
5665
|
width_context
|
|
5704
5666
|
}) => {
|
|
5705
|
-
return
|
|
5667
|
+
return (0, import_react_query50.useQuery)({
|
|
5706
5668
|
queryKey: [],
|
|
5707
5669
|
queryFn: () => kanban_service_default.getProgressBar({
|
|
5708
5670
|
field,
|
|
@@ -5721,13 +5683,13 @@ var useGetProGressBar = ({
|
|
|
5721
5683
|
var use_get_progress_bar_default = useGetProGressBar;
|
|
5722
5684
|
|
|
5723
5685
|
// src/hooks/view/use-get-selection.ts
|
|
5724
|
-
|
|
5686
|
+
var import_react_query51 = require("@tanstack/react-query");
|
|
5725
5687
|
var useGetSelection = ({
|
|
5726
5688
|
data,
|
|
5727
5689
|
queryKey,
|
|
5728
5690
|
enabled
|
|
5729
5691
|
}) => {
|
|
5730
|
-
return
|
|
5692
|
+
return (0, import_react_query51.useQuery)({
|
|
5731
5693
|
queryKey,
|
|
5732
5694
|
queryFn: () => view_service_default.getSelectionItem({ data }),
|
|
5733
5695
|
enabled,
|
|
@@ -5737,9 +5699,9 @@ var useGetSelection = ({
|
|
|
5737
5699
|
var use_get_selection_default = useGetSelection;
|
|
5738
5700
|
|
|
5739
5701
|
// src/hooks/view/use-get-view.ts
|
|
5740
|
-
|
|
5702
|
+
var import_react_query52 = require("@tanstack/react-query");
|
|
5741
5703
|
var useGetView = (viewParams, actData) => {
|
|
5742
|
-
return
|
|
5704
|
+
return (0, import_react_query52.useQuery)({
|
|
5743
5705
|
queryKey: ["get_view_by_action" /* GET_VIEW_BY_ACTION */, viewParams],
|
|
5744
5706
|
queryFn: () => view_service_default.getView(viewParams),
|
|
5745
5707
|
enabled: !!actData,
|
|
@@ -5750,9 +5712,9 @@ var useGetView = (viewParams, actData) => {
|
|
|
5750
5712
|
var use_get_view_default = useGetView;
|
|
5751
5713
|
|
|
5752
5714
|
// src/hooks/view/use-load-action.ts
|
|
5753
|
-
|
|
5715
|
+
var import_react_query53 = require("@tanstack/react-query");
|
|
5754
5716
|
var useLoadAction = () => {
|
|
5755
|
-
return
|
|
5717
|
+
return (0, import_react_query53.useMutation)({
|
|
5756
5718
|
mutationFn: ({
|
|
5757
5719
|
idAction,
|
|
5758
5720
|
context
|
|
@@ -5767,9 +5729,9 @@ var useLoadAction = () => {
|
|
|
5767
5729
|
var use_load_action_default = useLoadAction;
|
|
5768
5730
|
|
|
5769
5731
|
// src/hooks/view/use-load-message.ts
|
|
5770
|
-
|
|
5732
|
+
var import_react_query54 = require("@tanstack/react-query");
|
|
5771
5733
|
var useLoadMessage = () => {
|
|
5772
|
-
return
|
|
5734
|
+
return (0, import_react_query54.useQuery)({
|
|
5773
5735
|
queryKey: [`load-message-failure`],
|
|
5774
5736
|
queryFn: () => view_service_default.loadMessages(),
|
|
5775
5737
|
refetchOnWindowFocus: false
|
|
@@ -5778,9 +5740,9 @@ var useLoadMessage = () => {
|
|
|
5778
5740
|
var use_load_message_default = useLoadMessage;
|
|
5779
5741
|
|
|
5780
5742
|
// src/hooks/view/use-print.ts
|
|
5781
|
-
|
|
5743
|
+
var import_react_query55 = require("@tanstack/react-query");
|
|
5782
5744
|
var usePrint = () => {
|
|
5783
|
-
return
|
|
5745
|
+
return (0, import_react_query55.useMutation)({
|
|
5784
5746
|
mutationFn: ({ id, report, db }) => action_service_default.print({
|
|
5785
5747
|
id,
|
|
5786
5748
|
report,
|
|
@@ -5791,9 +5753,9 @@ var usePrint = () => {
|
|
|
5791
5753
|
var use_print_default = usePrint;
|
|
5792
5754
|
|
|
5793
5755
|
// src/hooks/view/use-remove-row.ts
|
|
5794
|
-
|
|
5756
|
+
var import_react_query56 = require("@tanstack/react-query");
|
|
5795
5757
|
var useRemoveRow = () => {
|
|
5796
|
-
return
|
|
5758
|
+
return (0, import_react_query56.useMutation)({
|
|
5797
5759
|
mutationFn: ({
|
|
5798
5760
|
model,
|
|
5799
5761
|
ids,
|
|
@@ -5808,9 +5770,9 @@ var useRemoveRow = () => {
|
|
|
5808
5770
|
var use_remove_row_default = useRemoveRow;
|
|
5809
5771
|
|
|
5810
5772
|
// src/hooks/view/use-resequence.ts
|
|
5811
|
-
|
|
5773
|
+
var import_react_query57 = require("@tanstack/react-query");
|
|
5812
5774
|
var useGetResequence = (model, resIds, context, offset) => {
|
|
5813
|
-
return
|
|
5775
|
+
return (0, import_react_query57.useQuery)({
|
|
5814
5776
|
queryKey: [],
|
|
5815
5777
|
queryFn: () => view_service_default.getResequence({
|
|
5816
5778
|
model,
|
|
@@ -5825,9 +5787,9 @@ var useGetResequence = (model, resIds, context, offset) => {
|
|
|
5825
5787
|
var use_resequence_default = useGetResequence;
|
|
5826
5788
|
|
|
5827
5789
|
// src/hooks/view/use-run-action.ts
|
|
5828
|
-
|
|
5790
|
+
var import_react_query58 = require("@tanstack/react-query");
|
|
5829
5791
|
var useRunAction = () => {
|
|
5830
|
-
return
|
|
5792
|
+
return (0, import_react_query58.useMutation)({
|
|
5831
5793
|
mutationFn: ({
|
|
5832
5794
|
idAction,
|
|
5833
5795
|
context
|
|
@@ -5840,9 +5802,9 @@ var useRunAction = () => {
|
|
|
5840
5802
|
var use_run_action_default = useRunAction;
|
|
5841
5803
|
|
|
5842
5804
|
// src/hooks/view/use-signin-sso.ts
|
|
5843
|
-
|
|
5805
|
+
var import_react_query59 = require("@tanstack/react-query");
|
|
5844
5806
|
var useSignInSSO = () => {
|
|
5845
|
-
return
|
|
5807
|
+
return (0, import_react_query59.useMutation)({
|
|
5846
5808
|
mutationFn: ({
|
|
5847
5809
|
redirect_uri,
|
|
5848
5810
|
state,
|
|
@@ -5863,9 +5825,9 @@ var useSignInSSO = () => {
|
|
|
5863
5825
|
var use_signin_sso_default = useSignInSSO;
|
|
5864
5826
|
|
|
5865
5827
|
// src/hooks/view/use-verify-2FA.ts
|
|
5866
|
-
|
|
5828
|
+
var import_react_query60 = require("@tanstack/react-query");
|
|
5867
5829
|
var useVerify2FA = () => {
|
|
5868
|
-
return
|
|
5830
|
+
return (0, import_react_query60.useMutation)({
|
|
5869
5831
|
mutationFn: ({
|
|
5870
5832
|
method,
|
|
5871
5833
|
with_context,
|
|
@@ -5886,9 +5848,9 @@ var useVerify2FA = () => {
|
|
|
5886
5848
|
var use_verify_2FA_default = useVerify2FA;
|
|
5887
5849
|
|
|
5888
5850
|
// src/hooks/view/uset-get-2FA-method.ts
|
|
5889
|
-
|
|
5851
|
+
var import_react_query61 = require("@tanstack/react-query");
|
|
5890
5852
|
var useGet2FAMethods = () => {
|
|
5891
|
-
return
|
|
5853
|
+
return (0, import_react_query61.useMutation)({
|
|
5892
5854
|
mutationFn: ({
|
|
5893
5855
|
method,
|
|
5894
5856
|
with_context
|
|
@@ -5903,9 +5865,9 @@ var useGet2FAMethods = () => {
|
|
|
5903
5865
|
var uset_get_2FA_method_default = useGet2FAMethods;
|
|
5904
5866
|
|
|
5905
5867
|
// src/hooks/view/use-get-fields-view-security.ts
|
|
5906
|
-
|
|
5868
|
+
var import_react_query62 = require("@tanstack/react-query");
|
|
5907
5869
|
var useGetFieldsViewSecurity = () => {
|
|
5908
|
-
return
|
|
5870
|
+
return (0, import_react_query62.useMutation)({
|
|
5909
5871
|
mutationFn: ({
|
|
5910
5872
|
method,
|
|
5911
5873
|
token,
|
|
@@ -5922,9 +5884,9 @@ var useGetFieldsViewSecurity = () => {
|
|
|
5922
5884
|
var use_get_fields_view_security_default = useGetFieldsViewSecurity;
|
|
5923
5885
|
|
|
5924
5886
|
// src/hooks/view/use-grant-access.ts
|
|
5925
|
-
|
|
5887
|
+
var import_react_query63 = require("@tanstack/react-query");
|
|
5926
5888
|
var useGrantAccess = () => {
|
|
5927
|
-
return
|
|
5889
|
+
return (0, import_react_query63.useMutation)({
|
|
5928
5890
|
mutationFn: ({
|
|
5929
5891
|
redirect_uri,
|
|
5930
5892
|
state,
|
|
@@ -5943,9 +5905,9 @@ var useGrantAccess = () => {
|
|
|
5943
5905
|
var use_grant_access_default = useGrantAccess;
|
|
5944
5906
|
|
|
5945
5907
|
// src/hooks/view/use-remove-totp-setup.ts
|
|
5946
|
-
|
|
5908
|
+
var import_react_query64 = require("@tanstack/react-query");
|
|
5947
5909
|
var useRemoveTotpSetup = () => {
|
|
5948
|
-
return
|
|
5910
|
+
return (0, import_react_query64.useMutation)({
|
|
5949
5911
|
mutationFn: ({ method, token }) => {
|
|
5950
5912
|
return view_service_default.removeTotpSetUp({
|
|
5951
5913
|
method,
|
|
@@ -5957,9 +5919,9 @@ var useRemoveTotpSetup = () => {
|
|
|
5957
5919
|
var use_remove_totp_setup_default = useRemoveTotpSetup;
|
|
5958
5920
|
|
|
5959
5921
|
// src/hooks/view/use-request-setup-totp.ts
|
|
5960
|
-
|
|
5922
|
+
var import_react_query65 = require("@tanstack/react-query");
|
|
5961
5923
|
var useRequestSetupTotp = () => {
|
|
5962
|
-
return
|
|
5924
|
+
return (0, import_react_query65.useMutation)({
|
|
5963
5925
|
mutationFn: ({ method, token }) => {
|
|
5964
5926
|
return view_service_default.requestSetupTotp({
|
|
5965
5927
|
method,
|
|
@@ -5971,9 +5933,9 @@ var useRequestSetupTotp = () => {
|
|
|
5971
5933
|
var use_request_setup_totp_default = useRequestSetupTotp;
|
|
5972
5934
|
|
|
5973
5935
|
// src/hooks/view/use-settings-web-read-2fa.ts
|
|
5974
|
-
|
|
5936
|
+
var import_react_query66 = require("@tanstack/react-query");
|
|
5975
5937
|
var useSettingsWebRead2fa = () => {
|
|
5976
|
-
return
|
|
5938
|
+
return (0, import_react_query66.useMutation)({
|
|
5977
5939
|
mutationFn: ({
|
|
5978
5940
|
method,
|
|
5979
5941
|
token,
|
|
@@ -5992,9 +5954,9 @@ var useSettingsWebRead2fa = () => {
|
|
|
5992
5954
|
var use_settings_web_read_2fa_default = useSettingsWebRead2fa;
|
|
5993
5955
|
|
|
5994
5956
|
// src/hooks/view/use-verify-totp.ts
|
|
5995
|
-
|
|
5957
|
+
var import_react_query67 = require("@tanstack/react-query");
|
|
5996
5958
|
var useVerifyTotp = () => {
|
|
5997
|
-
return
|
|
5959
|
+
return (0, import_react_query67.useMutation)({
|
|
5998
5960
|
mutationFn: ({
|
|
5999
5961
|
method,
|
|
6000
5962
|
action_token,
|
|
@@ -6009,73 +5971,75 @@ var useVerifyTotp = () => {
|
|
|
6009
5971
|
});
|
|
6010
5972
|
};
|
|
6011
5973
|
var use_verify_totp_default = useVerifyTotp;
|
|
6012
|
-
export
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
5974
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
5975
|
+
0 && (module.exports = {
|
|
5976
|
+
useButton,
|
|
5977
|
+
useChangeStatus,
|
|
5978
|
+
useDelete,
|
|
5979
|
+
useDeleteComment,
|
|
5980
|
+
useDuplicateRecord,
|
|
5981
|
+
useExecuteImport,
|
|
5982
|
+
useExportExcel,
|
|
5983
|
+
useForgotPassword,
|
|
5984
|
+
useForgotPasswordSSO,
|
|
5985
|
+
useGet2FAMethods,
|
|
5986
|
+
useGetAccessByCode,
|
|
5987
|
+
useGetActionDetail,
|
|
5988
|
+
useGetAll,
|
|
5989
|
+
useGetCalendar,
|
|
5990
|
+
useGetComment,
|
|
5991
|
+
useGetCompanyInfo,
|
|
5992
|
+
useGetConversionRate,
|
|
5993
|
+
useGetCurrency,
|
|
5994
|
+
useGetCurrentCompany,
|
|
5995
|
+
useGetDetail,
|
|
5996
|
+
useGetFieldExport,
|
|
5997
|
+
useGetFieldOnChange,
|
|
5998
|
+
useGetFieldsViewSecurity,
|
|
5999
|
+
useGetFileExcel,
|
|
6000
|
+
useGetFormView,
|
|
6001
|
+
useGetGroups,
|
|
6002
|
+
useGetImage,
|
|
6003
|
+
useGetListCompany,
|
|
6004
|
+
useGetListData,
|
|
6005
|
+
useGetListMyBankAccount,
|
|
6006
|
+
useGetMenu,
|
|
6007
|
+
useGetPrintReport,
|
|
6008
|
+
useGetProGressBar,
|
|
6009
|
+
useGetProfile,
|
|
6010
|
+
useGetProvider,
|
|
6011
|
+
useGetResequence,
|
|
6012
|
+
useGetSelection,
|
|
6013
|
+
useGetUser,
|
|
6014
|
+
useGetView,
|
|
6015
|
+
useGrantAccess,
|
|
6016
|
+
useIsValidToken,
|
|
6017
|
+
useLoadAction,
|
|
6018
|
+
useLoadMessage,
|
|
6019
|
+
useLoginCredential,
|
|
6020
|
+
useLoginSocial,
|
|
6021
|
+
useLogout,
|
|
6022
|
+
useModel,
|
|
6023
|
+
useOdooDataTransform,
|
|
6024
|
+
useOnChangeForm,
|
|
6025
|
+
useParsePreview,
|
|
6026
|
+
usePrint,
|
|
6027
|
+
useRemoveRow,
|
|
6028
|
+
useRemoveTotpSetup,
|
|
6029
|
+
useRequestSetupTotp,
|
|
6030
|
+
useResetPassword,
|
|
6031
|
+
useResetPasswordSSO,
|
|
6032
|
+
useRunAction,
|
|
6033
|
+
useSave,
|
|
6034
|
+
useSendComment,
|
|
6035
|
+
useSettingsWebRead2fa,
|
|
6036
|
+
useSignInSSO,
|
|
6037
|
+
useSwitchLocale,
|
|
6038
|
+
useUpdatePassword,
|
|
6039
|
+
useUploadFile,
|
|
6040
|
+
useUploadIdFile,
|
|
6041
|
+
useUploadImage,
|
|
6042
|
+
useValidateActionToken,
|
|
6043
|
+
useVerify2FA,
|
|
6044
|
+
useVerifyTotp
|
|
6045
|
+
});
|