@fctc/interface-logic 1.7.2 → 1.7.3

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