@fctc/interface-logic 1.5.5 → 1.5.7

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.mjs → configs.cjs} +152 -105
  2. package/dist/{configs.d.mts → configs.d.cts} +1 -1
  3. package/dist/configs.js +115 -140
  4. package/dist/{constants.mjs → constants.cjs} +40 -2
  5. package/dist/constants.js +2 -41
  6. package/dist/{environment.mjs → environment.cjs} +208 -154
  7. package/dist/environment.js +167 -189
  8. package/dist/{hooks.mjs → hooks.cjs} +1893 -1627
  9. package/dist/{hooks.d.mts → hooks.d.cts} +1 -1
  10. package/dist/hooks.js +1788 -1726
  11. package/dist/{provider.mjs → provider.cjs} +648 -557
  12. package/dist/{provider.d.mts → provider.d.cts} +4 -3
  13. package/dist/provider.d.ts +4 -3
  14. package/dist/provider.js +608 -591
  15. package/dist/{services.mjs → services.cjs} +1607 -1398
  16. package/dist/{services.d.mts → services.d.cts} +1 -1
  17. package/dist/services.js +1560 -1437
  18. package/dist/{store.mjs → store.cjs} +148 -30
  19. package/dist/{store.d.mts → store.d.cts} +127 -127
  20. package/dist/store.d.ts +127 -127
  21. package/dist/store.js +43 -131
  22. package/dist/types.cjs +17 -0
  23. package/dist/{types.d.mts → types.d.cts} +1 -1
  24. package/dist/types.js +0 -18
  25. package/dist/{utils.mjs → utils.cjs} +202 -115
  26. package/dist/{utils.d.mts → utils.d.cts} +2 -2
  27. package/dist/utils.d.ts +2 -2
  28. package/dist/utils.js +135 -176
  29. package/package.json +23 -11
  30. package/dist/types.mjs +0 -0
  31. /package/dist/{constants.d.mts → constants.d.cts} +0 -0
  32. /package/dist/{environment.d.mts → environment.d.cts} +0 -0
  33. /package/dist/{view-type-BGJfDe73.d.mts → view-type-BGJfDe73.d.cts} +0 -0
@@ -1,5 +1,145 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
+ var __pow = Math.pow;
12
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
+ var __spreadValues = (a, b) => {
14
+ for (var prop in b || (b = {}))
15
+ if (__hasOwnProp.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ if (__getOwnPropSymbols)
18
+ for (var prop of __getOwnPropSymbols(b)) {
19
+ if (__propIsEnum.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
+ }
22
+ return a;
23
+ };
24
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
+ var __export = (target, all) => {
26
+ for (var name in all)
27
+ __defProp(target, name, { get: all[name], enumerable: true });
28
+ };
29
+ var __copyProps = (to, from, except, desc) => {
30
+ if (from && typeof from === "object" || typeof from === "function") {
31
+ for (let key of __getOwnPropNames(from))
32
+ if (!__hasOwnProp.call(to, key) && key !== except)
33
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
34
+ }
35
+ return to;
36
+ };
37
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
38
+ // If the importer is in node compatibility mode or this is not an ESM
39
+ // file that has been converted to a CommonJS file using a Babel-
40
+ // compatible transform (i.e. "__esModule" has not been set), then set
41
+ // "default" to the CommonJS "module.exports" for node compatibility.
42
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
43
+ mod
44
+ ));
45
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
46
+ var __async = (__this, __arguments, generator) => {
47
+ return new Promise((resolve, reject) => {
48
+ var fulfilled = (value) => {
49
+ try {
50
+ step(generator.next(value));
51
+ } catch (e) {
52
+ reject(e);
53
+ }
54
+ };
55
+ var rejected = (value) => {
56
+ try {
57
+ step(generator.throw(value));
58
+ } catch (e) {
59
+ reject(e);
60
+ }
61
+ };
62
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
63
+ step((generator = generator.apply(__this, __arguments)).next());
64
+ });
65
+ };
66
+
67
+ // src/hooks.ts
68
+ var hooks_exports = {};
69
+ __export(hooks_exports, {
70
+ useButton: () => use_button_default,
71
+ useChangeStatus: () => use_change_status_default,
72
+ useDelete: () => use_delete_default,
73
+ useDeleteComment: () => use_delete_comment_default,
74
+ useDuplicateRecord: () => use_duplicate_record_default,
75
+ useExecuteImport: () => uss_execute_import_default,
76
+ useExportExcel: () => use_export_excel_default,
77
+ useForgotPassword: () => use_forgot_password_default,
78
+ useForgotPasswordSSO: () => use_forgotpassword_sso_default,
79
+ useGet2FAMethods: () => uset_get_2FA_method_default,
80
+ useGetAccessByCode: () => use_get_access_by_code_default,
81
+ useGetActionDetail: () => use_get_action_detail_default,
82
+ useGetAll: () => use_get_all_default,
83
+ useGetCalendar: () => use_get_calendar_default,
84
+ useGetComment: () => use_get_comment_default,
85
+ useGetCompanyInfo: () => use_get_company_info_default,
86
+ useGetConversionRate: () => use_get_conversion_rate_default,
87
+ useGetCurrency: () => use_get_currency_default,
88
+ useGetCurrentCompany: () => use_get_current_company_default,
89
+ useGetDetail: () => use_get_detail_default,
90
+ useGetFieldExport: () => use_get_field_export_default,
91
+ useGetFieldOnChange: () => use_get_field_onchange_default,
92
+ useGetFieldsViewSecurity: () => use_get_fields_view_security_default,
93
+ useGetFileExcel: () => use_get_file_excel_default,
94
+ useGetFormView: () => use_get_form_view_default,
95
+ useGetGroups: () => use_get_groups_default,
96
+ useGetImage: () => use_get_image_default,
97
+ useGetListCompany: () => use_get_list_company_default,
98
+ useGetListData: () => use_get_list_data_default,
99
+ useGetListMyBankAccount: () => use_get_list_my_bank_account_default,
100
+ useGetMenu: () => use_get_menu_default,
101
+ useGetPrintReport: () => use_get_print_report_default,
102
+ useGetProGressBar: () => use_get_progress_bar_default,
103
+ useGetProfile: () => use_get_profile_default,
104
+ useGetProvider: () => use_get_provider_default,
105
+ useGetResequence: () => use_resequence_default,
106
+ useGetSelection: () => use_get_selection_default,
107
+ useGetUser: () => use_get_user_default,
108
+ useGetView: () => use_get_view_default,
109
+ useGrantAccess: () => use_grant_access_default,
110
+ useIsValidToken: () => use_isvalid_token_default,
111
+ useLoadAction: () => use_load_action_default,
112
+ useLoadMessage: () => use_load_message_default,
113
+ useLoginCredential: () => use_login_credential_default,
114
+ useLoginSocial: () => use_login_socical_default,
115
+ useLogout: () => use_logout_default,
116
+ useModel: () => use_model_default,
117
+ useOdooDataTransform: () => use_odoo_data_transform_default,
118
+ useOnChangeForm: () => use_onchange_form_default,
119
+ useParsePreview: () => use_parse_preview_default,
120
+ usePrint: () => use_print_default,
121
+ useRemoveRow: () => use_remove_row_default,
122
+ useRemoveTotpSetup: () => use_remove_totp_setup_default,
123
+ useRequestSetupTotp: () => use_request_setup_totp_default,
124
+ useResetPassword: () => use_reset_password_default,
125
+ useResetPasswordSSO: () => use_reset_password_sso_default,
126
+ useRunAction: () => use_run_action_default,
127
+ useSave: () => use_save_default,
128
+ useSendComment: () => use_send_comment_default,
129
+ useSettingsWebRead2fa: () => use_settings_web_read_2fa_default,
130
+ useSignInSSO: () => use_signin_sso_default,
131
+ useSwitchLocale: () => use_switch_locale_default,
132
+ useUpdatePassword: () => use_update_password_default,
133
+ useUploadFile: () => use_upload_file_default,
134
+ useUploadIdFile: () => use_upload_id_file_default,
135
+ useUploadImage: () => use_upload_image_default,
136
+ useVerify2FA: () => use_verify_2FA_default,
137
+ useVerifyTotp: () => use_verify_totp_default
138
+ });
139
+ module.exports = __toCommonJS(hooks_exports);
140
+
1
141
  // src/hooks/auth/use-forgot-password.ts
2
- import { useMutation } from "@tanstack/react-query";
142
+ var import_react_query = require("@tanstack/react-query");
3
143
 
4
144
  // src/constants/api/uri-constant.ts
5
145
  var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
@@ -32,10 +172,10 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
32
172
  })(UriConstants || {});
33
173
 
34
174
  // src/configs/axios-client.ts
35
- import axios from "axios";
175
+ var import_axios = __toESM(require("axios"), 1);
36
176
 
37
177
  // src/utils/format.ts
38
- import moment from "moment";
178
+ var import_moment = __toESM(require("moment"), 1);
39
179
 
40
180
  // src/constants/widget/widget-avatar-constant.ts
41
181
  var WIDGETAVATAR = /* @__PURE__ */ ((WIDGETAVATAR2) => {
@@ -1122,22 +1262,6 @@ var PyRelativeDelta = class _PyRelativeDelta {
1122
1262
  this.microsecond = params.microsecond;
1123
1263
  this.weekday = params.weekday;
1124
1264
  }
1125
- years;
1126
- months;
1127
- days;
1128
- hours;
1129
- minutes;
1130
- seconds;
1131
- microseconds;
1132
- leapDays;
1133
- year;
1134
- month;
1135
- day;
1136
- hour;
1137
- minute;
1138
- second;
1139
- microsecond;
1140
- weekday;
1141
1265
  negate() {
1142
1266
  return new _PyRelativeDelta(this, -1);
1143
1267
  }
@@ -1252,7 +1376,7 @@ function execOnIterable(iterable, func) {
1252
1376
  if (typeof iterable === "object" && !Array.isArray(iterable) && !(iterable instanceof Set)) {
1253
1377
  iterable = Object.keys(iterable);
1254
1378
  }
1255
- if (typeof iterable?.[Symbol.iterator] !== "function") {
1379
+ if (typeof (iterable == null ? void 0 : iterable[Symbol.iterator]) !== "function") {
1256
1380
  throw new EvaluationError("value not iterable");
1257
1381
  }
1258
1382
  return func(iterable);
@@ -1575,7 +1699,7 @@ function applyBinaryOp(ast, context) {
1575
1699
  }
1576
1700
  return Math.floor(left / right);
1577
1701
  case "**":
1578
- return left ** right;
1702
+ return __pow(left, right);
1579
1703
  case "==":
1580
1704
  return isEqual(left, right);
1581
1705
  case "<>":
@@ -1697,7 +1821,7 @@ function evaluate(ast, context = {}) {
1697
1821
  const dicts = /* @__PURE__ */ new Set();
1698
1822
  let pyContext;
1699
1823
  const evalContext = Object.create(context);
1700
- if (!evalContext?.context) {
1824
+ if (!(evalContext == null ? void 0 : evalContext.context)) {
1701
1825
  Object.defineProperty(evalContext, "context", {
1702
1826
  get() {
1703
1827
  if (!pyContext) {
@@ -1708,17 +1832,18 @@ function evaluate(ast, context = {}) {
1708
1832
  });
1709
1833
  }
1710
1834
  function _innerEvaluate(ast2) {
1711
- switch (ast2?.type) {
1835
+ var _a, _b, _c;
1836
+ switch (ast2 == null ? void 0 : ast2.type) {
1712
1837
  case 0:
1713
1838
  // Number
1714
1839
  case 1:
1715
1840
  return ast2.value;
1716
1841
  case 5:
1717
1842
  if (ast2.value in evalContext) {
1718
- if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
1719
- return evalContext[ast2.value]?.id;
1843
+ if (typeof evalContext[ast2.value] === "object" && ((_a = evalContext[ast2.value]) == null ? void 0 : _a.id)) {
1844
+ return (_b = evalContext[ast2.value]) == null ? void 0 : _b.id;
1720
1845
  }
1721
- return evalContext[ast2.value] ?? false;
1846
+ return (_c = evalContext[ast2.value]) != null ? _c : false;
1722
1847
  } else if (ast2.value in BUILTINS) {
1723
1848
  return BUILTINS[ast2.value];
1724
1849
  } else {
@@ -1755,7 +1880,7 @@ function evaluate(ast, context = {}) {
1755
1880
  const args = ast2.args.map(_evaluate);
1756
1881
  const kwargs = {};
1757
1882
  for (const kwarg in ast2.kwargs) {
1758
- kwargs[kwarg] = _evaluate(ast2?.kwargs[kwarg]);
1883
+ kwargs[kwarg] = _evaluate(ast2 == null ? void 0 : ast2.kwargs[kwarg]);
1759
1884
  }
1760
1885
  if (fnValue === PyDate || fnValue === PyDateTime || fnValue === PyTime || fnValue === PyRelativeDelta || fnValue === PyTimeDelta) {
1761
1886
  return fnValue.create(...args, kwargs);
@@ -1834,9 +1959,25 @@ function escapeRegExp(str) {
1834
1959
  var InvalidDomainError = class extends Error {
1835
1960
  };
1836
1961
  var Domain = class _Domain {
1837
- ast = { type: -1, value: null };
1838
- static TRUE;
1839
- static FALSE;
1962
+ constructor(descr = []) {
1963
+ this.ast = { type: -1, value: null };
1964
+ if (descr instanceof _Domain) {
1965
+ return new _Domain(descr.toString());
1966
+ } else {
1967
+ let rawAST;
1968
+ try {
1969
+ rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
1970
+ } catch (error) {
1971
+ throw new InvalidDomainError(
1972
+ `Invalid domain representation: ${descr}`,
1973
+ {
1974
+ cause: error
1975
+ }
1976
+ );
1977
+ }
1978
+ this.ast = normalizeDomainAST(rawAST);
1979
+ }
1980
+ }
1840
1981
  static combine(domains, operator) {
1841
1982
  if (domains.length === 0) {
1842
1983
  return new _Domain([]);
@@ -1915,24 +2056,6 @@ var Domain = class _Domain {
1915
2056
  processLeaf(d.ast.value, 0, "&", newDomain);
1916
2057
  return newDomain;
1917
2058
  }
1918
- constructor(descr = []) {
1919
- if (descr instanceof _Domain) {
1920
- return new _Domain(descr.toString());
1921
- } else {
1922
- let rawAST;
1923
- try {
1924
- rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
1925
- } catch (error) {
1926
- throw new InvalidDomainError(
1927
- `Invalid domain representation: ${descr}`,
1928
- {
1929
- cause: error
1930
- }
1931
- );
1932
- }
1933
- this.ast = normalizeDomainAST(rawAST);
1934
- }
1935
- }
1936
2059
  contains(record) {
1937
2060
  const expr = evaluate(this.ast, record);
1938
2061
  return matchDomain(record, expr);
@@ -1951,7 +2074,7 @@ var Domain = class _Domain {
1951
2074
  return evaluatedAsList;
1952
2075
  }
1953
2076
  return this.toString();
1954
- } catch {
2077
+ } catch (e) {
1955
2078
  return this.toString();
1956
2079
  }
1957
2080
  }
@@ -2151,7 +2274,7 @@ function matchDomain(record, domain) {
2151
2274
  }
2152
2275
 
2153
2276
  // src/utils/function.ts
2154
- import { useEffect, useState } from "react";
2277
+ var import_react = require("react");
2155
2278
  var toQueryString = (params) => {
2156
2279
  return Object.keys(params).map(
2157
2280
  (key) => encodeURIComponent(key) + "=" + encodeURIComponent(params[key].toString())
@@ -2194,22 +2317,22 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
2194
2317
 
2195
2318
  // src/utils/storage/local-storage.ts
2196
2319
  var localStorageUtils = () => {
2197
- const setToken = async (access_token) => {
2320
+ const setToken = (access_token) => __async(null, null, function* () {
2198
2321
  localStorage.setItem("accessToken", access_token);
2199
- };
2200
- const setRefreshToken = async (refresh_token) => {
2322
+ });
2323
+ const setRefreshToken = (refresh_token) => __async(null, null, function* () {
2201
2324
  localStorage.setItem("refreshToken", refresh_token);
2202
- };
2203
- const getAccessToken = async () => {
2325
+ });
2326
+ const getAccessToken = () => __async(null, null, function* () {
2204
2327
  return localStorage.getItem("accessToken");
2205
- };
2206
- const getRefreshToken = async () => {
2328
+ });
2329
+ const getRefreshToken = () => __async(null, null, function* () {
2207
2330
  return localStorage.getItem("refreshToken");
2208
- };
2209
- const clearToken = async () => {
2331
+ });
2332
+ const clearToken = () => __async(null, null, function* () {
2210
2333
  localStorage.removeItem("accessToken");
2211
2334
  localStorage.removeItem("refreshToken");
2212
- };
2335
+ });
2213
2336
  return {
2214
2337
  setToken,
2215
2338
  setRefreshToken,
@@ -2221,9 +2344,9 @@ var localStorageUtils = () => {
2221
2344
 
2222
2345
  // src/utils/storage/session-storage.ts
2223
2346
  var sessionStorageUtils = () => {
2224
- const getBrowserSession = async () => {
2347
+ const getBrowserSession = () => __async(null, null, function* () {
2225
2348
  return sessionStorage.getItem("browserSession");
2226
- };
2349
+ });
2227
2350
  return {
2228
2351
  getBrowserSession
2229
2352
  };
@@ -2232,13 +2355,14 @@ var sessionStorageUtils = () => {
2232
2355
  // src/configs/axios-client.ts
2233
2356
  var axiosClient = {
2234
2357
  init(config) {
2235
- const localStorage2 = config.localStorageUtils ?? localStorageUtils();
2236
- const sessionStorage2 = config.sessionStorageUtils ?? sessionStorageUtils();
2358
+ var _a, _b;
2359
+ const localStorage2 = (_a = config.localStorageUtils) != null ? _a : localStorageUtils();
2360
+ const sessionStorage2 = (_b = config.sessionStorageUtils) != null ? _b : sessionStorageUtils();
2237
2361
  const db = config.db;
2238
2362
  let isRefreshing = false;
2239
2363
  let failedQueue = [];
2240
2364
  const processQueue = (error, token = null) => {
2241
- failedQueue?.forEach((prom) => {
2365
+ failedQueue == null ? void 0 : failedQueue.forEach((prom) => {
2242
2366
  if (error) {
2243
2367
  prom.reject(error);
2244
2368
  } else {
@@ -2247,21 +2371,21 @@ var axiosClient = {
2247
2371
  });
2248
2372
  failedQueue = [];
2249
2373
  };
2250
- const instance = axios.create({
2251
- adapter: axios.defaults.adapter,
2374
+ const instance = import_axios.default.create({
2375
+ adapter: import_axios.default.defaults.adapter,
2252
2376
  baseURL: config.baseUrl,
2253
2377
  timeout: 5e4,
2254
2378
  paramsSerializer: (params) => new URLSearchParams(params).toString()
2255
2379
  });
2256
2380
  instance.interceptors.request.use(
2257
- async (config2) => {
2381
+ (config2) => __async(null, null, function* () {
2258
2382
  const useRefreshToken = config2.useRefreshToken;
2259
- const token = useRefreshToken ? await localStorage2.getRefreshToken() : await localStorage2.getAccessToken();
2383
+ const token = useRefreshToken ? yield localStorage2.getRefreshToken() : yield localStorage2.getAccessToken();
2260
2384
  if (token) {
2261
2385
  config2.headers["Authorization"] = "Bearer " + token;
2262
2386
  }
2263
2387
  return config2;
2264
- },
2388
+ }),
2265
2389
  (error) => {
2266
2390
  Promise.reject(error);
2267
2391
  }
@@ -2270,19 +2394,21 @@ var axiosClient = {
2270
2394
  (response) => {
2271
2395
  return handleResponse(response);
2272
2396
  },
2273
- async (error) => {
2274
- const handleError3 = async (error2) => {
2397
+ (error) => __async(null, null, function* () {
2398
+ var _a2, _b2, _c;
2399
+ const handleError3 = (error2) => __async(null, null, function* () {
2400
+ var _a3;
2275
2401
  if (!error2.response) {
2276
2402
  return error2;
2277
2403
  }
2278
2404
  const { data } = error2.response;
2279
- if (data && data.code === 400 && ["invalid_grant"].includes(data.data?.error)) {
2280
- await clearAuthToken();
2405
+ if (data && data.code === 400 && ["invalid_grant"].includes((_a3 = data.data) == null ? void 0 : _a3.error)) {
2406
+ yield clearAuthToken();
2281
2407
  }
2282
2408
  return data;
2283
- };
2409
+ });
2284
2410
  const originalRequest = error.config;
2285
- if ((error.response?.status === 403 || error.response?.status === 401 || error.response?.status === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
2411
+ 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(
2286
2412
  error.response.data.code
2287
2413
  )) {
2288
2414
  if (isRefreshing) {
@@ -2295,18 +2421,19 @@ var axiosClient = {
2295
2421
  token
2296
2422
  );
2297
2423
  return instance.request(originalRequest);
2298
- }).catch(async (err) => {
2299
- if ((err.response?.status === 400 || err.response?.status === 401) && ["invalid_grant"].includes(err.response.data.error)) {
2300
- await clearAuthToken();
2424
+ }).catch((err) => __async(null, null, function* () {
2425
+ var _a3, _b3;
2426
+ 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)) {
2427
+ yield clearAuthToken();
2301
2428
  }
2302
- });
2429
+ }));
2303
2430
  }
2304
- const browserSession = await sessionStorage2.getBrowserSession();
2305
- const refreshToken = await localStorage2.getRefreshToken();
2306
- const accessTokenExp = await localStorage2.getAccessToken();
2431
+ const browserSession = yield sessionStorage2.getBrowserSession();
2432
+ const refreshToken = yield localStorage2.getRefreshToken();
2433
+ const accessTokenExp = yield localStorage2.getAccessToken();
2307
2434
  isRefreshing = true;
2308
2435
  if (!refreshToken && (!browserSession || browserSession == "unActive")) {
2309
- await clearAuthToken();
2436
+ yield clearAuthToken();
2310
2437
  } else {
2311
2438
  const payload = Object.fromEntries(
2312
2439
  Object.entries({
@@ -2317,8 +2444,9 @@ var axiosClient = {
2317
2444
  }).filter(([_, value]) => !!value)
2318
2445
  );
2319
2446
  return new Promise(function(resolve) {
2320
- axios.post(
2321
- `${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2447
+ var _a3;
2448
+ import_axios.default.post(
2449
+ `${config.baseUrl}${(_a3 = config.refreshTokenEndpoint) != null ? _a3 : "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2322
2450
  payload,
2323
2451
  {
2324
2452
  headers: {
@@ -2326,11 +2454,11 @@ var axiosClient = {
2326
2454
  Authorization: `Bearer ${accessTokenExp}`
2327
2455
  }
2328
2456
  }
2329
- ).then(async (res) => {
2457
+ ).then((res) => __async(null, null, function* () {
2330
2458
  const data = res.data;
2331
- await localStorage2.setToken(data.access_token);
2332
- await localStorage2.setRefreshToken(data.refresh_token);
2333
- axios.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
2459
+ yield localStorage2.setToken(data.access_token);
2460
+ yield localStorage2.setRefreshToken(data.refresh_token);
2461
+ import_axios.default.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
2334
2462
  originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
2335
2463
  originalRequest.data = updateTokenParamInOriginalRequest(
2336
2464
  originalRequest,
@@ -2338,25 +2466,26 @@ var axiosClient = {
2338
2466
  );
2339
2467
  processQueue(null, data.access_token);
2340
2468
  resolve(instance.request(originalRequest));
2341
- }).catch(async (err) => {
2342
- 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") {
2343
- await clearAuthToken();
2469
+ })).catch((err) => __async(null, null, function* () {
2470
+ var _a4;
2471
+ 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") {
2472
+ yield clearAuthToken();
2344
2473
  }
2345
2474
  if (err && err.response) {
2346
- const { error_code } = err.response?.data || {};
2475
+ const { error_code } = ((_a4 = err.response) == null ? void 0 : _a4.data) || {};
2347
2476
  if (error_code === "AUTHEN_FAIL") {
2348
- await clearAuthToken();
2477
+ yield clearAuthToken();
2349
2478
  }
2350
2479
  }
2351
2480
  processQueue(err, null);
2352
- }).finally(() => {
2481
+ })).finally(() => {
2353
2482
  isRefreshing = false;
2354
2483
  });
2355
2484
  });
2356
2485
  }
2357
2486
  }
2358
- return Promise.reject(await handleError3(error));
2359
- }
2487
+ return Promise.reject(yield handleError3(error));
2488
+ })
2360
2489
  );
2361
2490
  const handleResponse = (res) => {
2362
2491
  if (res && res.data) {
@@ -2365,6 +2494,7 @@ var axiosClient = {
2365
2494
  return res;
2366
2495
  };
2367
2496
  const handleError2 = (error) => {
2497
+ var _a2, _b2, _c;
2368
2498
  if (error.isAxiosError && error.code === "ECONNABORTED") {
2369
2499
  console.error("Request Timeout Error:", error);
2370
2500
  return "Request Timeout Error";
@@ -2372,17 +2502,17 @@ var axiosClient = {
2372
2502
  console.error("Network Error:", error);
2373
2503
  return "Network Error";
2374
2504
  } else {
2375
- console.error("Other Error:", error?.response);
2376
- const errorMessage = error?.response?.data?.message || "An error occurred";
2377
- return { message: errorMessage, status: error?.response?.status };
2505
+ console.error("Other Error:", error == null ? void 0 : error.response);
2506
+ const errorMessage = ((_b2 = (_a2 = error == null ? void 0 : error.response) == null ? void 0 : _a2.data) == null ? void 0 : _b2.message) || "An error occurred";
2507
+ return { message: errorMessage, status: (_c = error == null ? void 0 : error.response) == null ? void 0 : _c.status };
2378
2508
  }
2379
2509
  };
2380
- const clearAuthToken = async () => {
2381
- await localStorage2.clearToken();
2510
+ const clearAuthToken = () => __async(null, null, function* () {
2511
+ yield localStorage2.clearToken();
2382
2512
  if (typeof window !== "undefined") {
2383
2513
  window.location.href = `/login`;
2384
2514
  }
2385
- };
2515
+ });
2386
2516
  function formatUrl(url, db2) {
2387
2517
  return url + (db2 ? "?db=" + db2 : "");
2388
2518
  }
@@ -2406,14 +2536,14 @@ var axiosClient = {
2406
2536
  };
2407
2537
 
2408
2538
  // src/store/index.ts
2409
- import { useDispatch, useSelector } from "react-redux";
2539
+ var import_react_redux = require("react-redux");
2410
2540
 
2411
2541
  // src/store/reducers/breadcrums-slice/index.ts
2412
- import { createSlice } from "@reduxjs/toolkit";
2542
+ var import_toolkit = require("@reduxjs/toolkit");
2413
2543
  var initialState = {
2414
2544
  breadCrumbs: []
2415
2545
  };
2416
- var breadcrumbsSlice = createSlice({
2546
+ var breadcrumbsSlice = (0, import_toolkit.createSlice)({
2417
2547
  name: "breadcrumbs",
2418
2548
  initialState,
2419
2549
  reducers: {
@@ -2426,7 +2556,7 @@ var { setBreadCrumbs } = breadcrumbsSlice.actions;
2426
2556
  var breadcrums_slice_default = breadcrumbsSlice.reducer;
2427
2557
 
2428
2558
  // src/store/reducers/env-slice/index.ts
2429
- import { createSlice as createSlice2 } from "@reduxjs/toolkit";
2559
+ var import_toolkit2 = require("@reduxjs/toolkit");
2430
2560
  var initialState2 = {
2431
2561
  baseUrl: "",
2432
2562
  requests: null,
@@ -2447,7 +2577,7 @@ var initialState2 = {
2447
2577
  tz: "Asia/Saigon"
2448
2578
  }
2449
2579
  };
2450
- var envSlice = createSlice2({
2580
+ var envSlice = (0, import_toolkit2.createSlice)({
2451
2581
  name: "env",
2452
2582
  initialState: initialState2,
2453
2583
  reducers: {
@@ -2494,7 +2624,7 @@ var {
2494
2624
  var env_slice_default = envSlice.reducer;
2495
2625
 
2496
2626
  // src/store/reducers/excel-slice/index.ts
2497
- import { createSlice as createSlice3 } from "@reduxjs/toolkit";
2627
+ var import_toolkit3 = require("@reduxjs/toolkit");
2498
2628
  var initialState3 = {
2499
2629
  dataParse: null,
2500
2630
  idFile: null,
@@ -2503,7 +2633,7 @@ var initialState3 = {
2503
2633
  selectedFile: null,
2504
2634
  errorData: null
2505
2635
  };
2506
- var excelSlice = createSlice3({
2636
+ var excelSlice = (0, import_toolkit3.createSlice)({
2507
2637
  name: "excel",
2508
2638
  initialState: initialState3,
2509
2639
  reducers: {
@@ -2538,7 +2668,7 @@ var {
2538
2668
  var excel_slice_default = excelSlice.reducer;
2539
2669
 
2540
2670
  // src/store/reducers/form-slice/index.ts
2541
- import { createSlice as createSlice4 } from "@reduxjs/toolkit";
2671
+ var import_toolkit4 = require("@reduxjs/toolkit");
2542
2672
  var initialState4 = {
2543
2673
  viewDataStore: {},
2544
2674
  isShowingModalDetail: false,
@@ -2548,7 +2678,7 @@ var initialState4 = {
2548
2678
  listSubject: {},
2549
2679
  dataUser: {}
2550
2680
  };
2551
- var formSlice = createSlice4({
2681
+ var formSlice = (0, import_toolkit4.createSlice)({
2552
2682
  name: "form",
2553
2683
  initialState: initialState4,
2554
2684
  reducers: {
@@ -2587,15 +2717,15 @@ var {
2587
2717
  var form_slice_default = formSlice.reducer;
2588
2718
 
2589
2719
  // src/store/reducers/header-slice/index.ts
2590
- import { createSlice as createSlice5 } from "@reduxjs/toolkit";
2591
- var headerSlice = createSlice5({
2720
+ var import_toolkit5 = require("@reduxjs/toolkit");
2721
+ var headerSlice = (0, import_toolkit5.createSlice)({
2592
2722
  name: "header",
2593
2723
  initialState: {
2594
2724
  value: { allowedCompanyIds: [] }
2595
2725
  },
2596
2726
  reducers: {
2597
2727
  setHeader: (state, action) => {
2598
- state.value = { ...state.value, ...action.payload };
2728
+ state.value = __spreadValues(__spreadValues({}, state.value), action.payload);
2599
2729
  },
2600
2730
  setAllowedCompanyIds: (state, action) => {
2601
2731
  state.value.allowedCompanyIds = action.payload;
@@ -2606,7 +2736,7 @@ var { setAllowedCompanyIds, setHeader } = headerSlice.actions;
2606
2736
  var header_slice_default = headerSlice.reducer;
2607
2737
 
2608
2738
  // src/store/reducers/list-slice/index.ts
2609
- import { createSlice as createSlice6 } from "@reduxjs/toolkit";
2739
+ var import_toolkit6 = require("@reduxjs/toolkit");
2610
2740
  var initialState5 = {
2611
2741
  pageLimit: 10,
2612
2742
  fields: {},
@@ -2620,7 +2750,7 @@ var initialState5 = {
2620
2750
  page: 0,
2621
2751
  domainTable: []
2622
2752
  };
2623
- var listSlice = createSlice6({
2753
+ var listSlice = (0, import_toolkit6.createSlice)({
2624
2754
  name: "list",
2625
2755
  initialState: initialState5,
2626
2756
  reducers: {
@@ -2671,13 +2801,13 @@ var {
2671
2801
  var list_slice_default = listSlice.reducer;
2672
2802
 
2673
2803
  // src/store/reducers/login-slice/index.ts
2674
- import { createSlice as createSlice7 } from "@reduxjs/toolkit";
2804
+ var import_toolkit7 = require("@reduxjs/toolkit");
2675
2805
  var initialState6 = {
2676
2806
  db: "",
2677
2807
  redirectTo: "/",
2678
2808
  forgotPasswordUrl: "/"
2679
2809
  };
2680
- var loginSlice = createSlice7({
2810
+ var loginSlice = (0, import_toolkit7.createSlice)({
2681
2811
  name: "login",
2682
2812
  initialState: initialState6,
2683
2813
  reducers: {
@@ -2696,14 +2826,14 @@ var { setDb, setRedirectTo, setForgotPasswordUrl } = loginSlice.actions;
2696
2826
  var login_slice_default = loginSlice.reducer;
2697
2827
 
2698
2828
  // src/store/reducers/navbar-slice/index.ts
2699
- import { createSlice as createSlice8 } from "@reduxjs/toolkit";
2829
+ var import_toolkit8 = require("@reduxjs/toolkit");
2700
2830
  var initialState7 = {
2701
2831
  menuFocus: {},
2702
2832
  menuAction: {},
2703
2833
  navbarWidth: 250,
2704
2834
  menuList: []
2705
2835
  };
2706
- var navbarSlice = createSlice8({
2836
+ var navbarSlice = (0, import_toolkit8.createSlice)({
2707
2837
  name: "navbar",
2708
2838
  initialState: initialState7,
2709
2839
  reducers: {
@@ -2725,11 +2855,11 @@ var { setMenuFocus, setMenuFocusAction, setNavbarWidth, setMenuList } = navbarSl
2725
2855
  var navbar_slice_default = navbarSlice.reducer;
2726
2856
 
2727
2857
  // src/store/reducers/profile-slice/index.ts
2728
- import { createSlice as createSlice9 } from "@reduxjs/toolkit";
2858
+ var import_toolkit9 = require("@reduxjs/toolkit");
2729
2859
  var initialState8 = {
2730
2860
  profile: {}
2731
2861
  };
2732
- var profileSlice = createSlice9({
2862
+ var profileSlice = (0, import_toolkit9.createSlice)({
2733
2863
  name: "profile",
2734
2864
  initialState: initialState8,
2735
2865
  reducers: {
@@ -2742,7 +2872,7 @@ var { setProfile } = profileSlice.actions;
2742
2872
  var profile_slice_default = profileSlice.reducer;
2743
2873
 
2744
2874
  // src/store/reducers/search-slice/index.ts
2745
- import { createSlice as createSlice10 } from "@reduxjs/toolkit";
2875
+ var import_toolkit10 = require("@reduxjs/toolkit");
2746
2876
  var initialState9 = {
2747
2877
  groupByDomain: null,
2748
2878
  searchBy: [],
@@ -2754,7 +2884,7 @@ var initialState9 = {
2754
2884
  filterBy: [],
2755
2885
  groupBy: []
2756
2886
  };
2757
- var searchSlice = createSlice10({
2887
+ var searchSlice = (0, import_toolkit10.createSlice)({
2758
2888
  name: "search",
2759
2889
  initialState: initialState9,
2760
2890
  reducers: {
@@ -2828,7 +2958,7 @@ var {
2828
2958
  var search_slice_default = searchSlice.reducer;
2829
2959
 
2830
2960
  // src/store/store.ts
2831
- import { configureStore } from "@reduxjs/toolkit";
2961
+ var import_toolkit11 = require("@reduxjs/toolkit");
2832
2962
 
2833
2963
  // node_modules/redux/dist/redux.mjs
2834
2964
  function formatProdErrorMessage(code) {
@@ -3012,7 +3142,7 @@ var rootReducer = combineReducers({
3012
3142
  excel: excel_slice_default,
3013
3143
  profile: profile_slice_default
3014
3144
  });
3015
- var envStore = configureStore({
3145
+ var envStore = (0, import_toolkit11.configureStore)({
3016
3146
  reducer: rootReducer,
3017
3147
  middleware: (getDefaultMiddleware) => getDefaultMiddleware({
3018
3148
  serializableCheck: false
@@ -3021,18 +3151,6 @@ var envStore = configureStore({
3021
3151
 
3022
3152
  // src/environment/EnvStore.ts
3023
3153
  var EnvStore = class {
3024
- envStore;
3025
- baseUrl;
3026
- requests;
3027
- context;
3028
- defaultCompany;
3029
- config;
3030
- companies;
3031
- user;
3032
- db;
3033
- localStorageUtils;
3034
- sessionStorageUtils;
3035
- refreshTokenEndpoint;
3036
3154
  constructor(envStore2, localStorageUtils2, sessionStorageUtils2) {
3037
3155
  this.envStore = envStore2;
3038
3156
  this.localStorageUtils = localStorageUtils2;
@@ -3041,25 +3159,24 @@ var EnvStore = class {
3041
3159
  }
3042
3160
  setup() {
3043
3161
  const env2 = this.envStore.getState().env;
3044
- this.baseUrl = env2?.baseUrl;
3045
- this.requests = env2?.requests;
3046
- this.context = env2?.context;
3047
- this.defaultCompany = env2?.defaultCompany;
3048
- this.config = env2?.config;
3049
- this.companies = env2?.companies || [];
3050
- this.user = env2?.user;
3051
- this.db = env2?.db;
3052
- this.refreshTokenEndpoint = env2?.refreshTokenEndpoint;
3162
+ this.baseUrl = env2 == null ? void 0 : env2.baseUrl;
3163
+ this.requests = env2 == null ? void 0 : env2.requests;
3164
+ this.context = env2 == null ? void 0 : env2.context;
3165
+ this.defaultCompany = env2 == null ? void 0 : env2.defaultCompany;
3166
+ this.config = env2 == null ? void 0 : env2.config;
3167
+ this.companies = (env2 == null ? void 0 : env2.companies) || [];
3168
+ this.user = env2 == null ? void 0 : env2.user;
3169
+ this.db = env2 == null ? void 0 : env2.db;
3170
+ this.refreshTokenEndpoint = env2 == null ? void 0 : env2.refreshTokenEndpoint;
3053
3171
  }
3054
3172
  setupEnv(envConfig) {
3055
3173
  const dispatch = this.envStore.dispatch;
3056
- const env2 = {
3057
- ...envConfig,
3174
+ const env2 = __spreadProps(__spreadValues({}, envConfig), {
3058
3175
  localStorageUtils: this.localStorageUtils,
3059
3176
  sessionStorageUtils: this.sessionStorageUtils
3060
- };
3177
+ });
3061
3178
  const requests = axiosClient.init(env2);
3062
- dispatch(setEnv({ ...env2, requests }));
3179
+ dispatch(setEnv(__spreadProps(__spreadValues({}, env2), { requests })));
3063
3180
  this.setup();
3064
3181
  }
3065
3182
  setUid(uid) {
@@ -3103,35 +3220,61 @@ function getEnv() {
3103
3220
  // src/services/action-service/index.ts
3104
3221
  var ActionService = {
3105
3222
  // Load Action
3106
- async loadAction({
3107
- idAction,
3108
- context
3109
- }) {
3110
- const env2 = getEnv();
3111
- const jsonData = {
3112
- action_id: idAction,
3113
- with_context: {
3114
- ...context
3115
- }
3116
- };
3117
- return env2.requests.post(`${"/load_action" /* LOAD_ACTION */}`, jsonData, {
3118
- headers: {
3119
- "Content-Type": "application/json"
3120
- }
3223
+ loadAction(_0) {
3224
+ return __async(this, arguments, function* ({
3225
+ idAction,
3226
+ context
3227
+ }) {
3228
+ const env2 = getEnv();
3229
+ const jsonData = {
3230
+ action_id: idAction,
3231
+ with_context: __spreadValues({}, context)
3232
+ };
3233
+ return env2.requests.post(`${"/load_action" /* LOAD_ACTION */}`, jsonData, {
3234
+ headers: {
3235
+ "Content-Type": "application/json"
3236
+ }
3237
+ });
3121
3238
  });
3122
3239
  },
3123
3240
  // Call Button
3124
- async callButton({
3125
- model,
3126
- ids = [],
3127
- context,
3128
- method
3129
- }) {
3130
- try {
3241
+ callButton(_0) {
3242
+ return __async(this, arguments, function* ({
3243
+ model,
3244
+ ids = [],
3245
+ context,
3246
+ method
3247
+ }) {
3248
+ try {
3249
+ const env2 = getEnv();
3250
+ const jsonData = {
3251
+ model,
3252
+ method,
3253
+ ids,
3254
+ with_context: context
3255
+ };
3256
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3257
+ headers: {
3258
+ "Content-Type": "application/json"
3259
+ }
3260
+ });
3261
+ } catch (error) {
3262
+ console.error("Error when calling button action:", error);
3263
+ throw error;
3264
+ }
3265
+ });
3266
+ },
3267
+ // remove Row
3268
+ removeRows(_0) {
3269
+ return __async(this, arguments, function* ({
3270
+ model,
3271
+ ids,
3272
+ context
3273
+ }) {
3131
3274
  const env2 = getEnv();
3132
3275
  const jsonData = {
3133
3276
  model,
3134
- method,
3277
+ method: "unlink",
3135
3278
  ids,
3136
3279
  with_context: context
3137
3280
  };
@@ -3140,112 +3283,96 @@ var ActionService = {
3140
3283
  "Content-Type": "application/json"
3141
3284
  }
3142
3285
  });
3143
- } catch (error) {
3144
- console.error("Error when calling button action:", error);
3145
- throw error;
3146
- }
3147
- },
3148
- // remove Row
3149
- async removeRows({
3150
- model,
3151
- ids,
3152
- context
3153
- }) {
3154
- const env2 = getEnv();
3155
- const jsonData = {
3156
- model,
3157
- method: "unlink",
3158
- ids,
3159
- with_context: context
3160
- };
3161
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3162
- headers: {
3163
- "Content-Type": "application/json"
3164
- }
3165
3286
  });
3166
3287
  },
3167
3288
  // Duplicate Model
3168
- async duplicateRecord({
3169
- model,
3170
- id,
3171
- context
3172
- }) {
3173
- const env2 = getEnv();
3174
- const jsonData = {
3289
+ duplicateRecord(_0) {
3290
+ return __async(this, arguments, function* ({
3175
3291
  model,
3176
- method: "copy",
3177
- ids: id,
3178
- with_context: context
3179
- };
3180
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3181
- headers: {
3182
- "Content-Type": "application/json"
3183
- }
3292
+ id,
3293
+ context
3294
+ }) {
3295
+ const env2 = getEnv();
3296
+ const jsonData = {
3297
+ model,
3298
+ method: "copy",
3299
+ ids: id,
3300
+ with_context: context
3301
+ };
3302
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3303
+ headers: {
3304
+ "Content-Type": "application/json"
3305
+ }
3306
+ });
3184
3307
  });
3185
3308
  },
3186
3309
  // Get Print Report
3187
- async getPrintReportName({ id }) {
3188
- const env2 = getEnv();
3189
- const jsonData = {
3190
- model: "ir.actions.report",
3191
- method: "web_read",
3192
- id,
3193
- kwargs: {
3194
- specification: {
3195
- report_name: {}
3310
+ getPrintReportName(_0) {
3311
+ return __async(this, arguments, function* ({ id }) {
3312
+ const env2 = getEnv();
3313
+ const jsonData = {
3314
+ model: "ir.actions.report",
3315
+ method: "web_read",
3316
+ id,
3317
+ kwargs: {
3318
+ specification: {
3319
+ report_name: {}
3320
+ }
3196
3321
  }
3197
- }
3198
- };
3199
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3200
- headers: {
3201
- "Content-Type": "application/json"
3202
- }
3322
+ };
3323
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3324
+ headers: {
3325
+ "Content-Type": "application/json"
3326
+ }
3327
+ });
3203
3328
  });
3204
3329
  },
3205
3330
  //Save Print Invoice
3206
- async print({ id, report, db }) {
3207
- const env2 = getEnv();
3208
- const jsonData = {
3209
- report,
3210
- id,
3211
- type: "pdf",
3212
- file_response: true,
3213
- db
3214
- };
3215
- const queryString = toQueryString(jsonData);
3216
- const urlWithParams = `${"/report" /* REPORT_PATH */}?${queryString}`;
3217
- return env2.requests.get(urlWithParams, {
3218
- headers: {
3219
- "Content-Type": "application/json"
3220
- },
3221
- responseType: "arraybuffer"
3331
+ print(_0) {
3332
+ return __async(this, arguments, function* ({ id, report, db }) {
3333
+ const env2 = getEnv();
3334
+ const jsonData = {
3335
+ report,
3336
+ id,
3337
+ type: "pdf",
3338
+ file_response: true,
3339
+ db
3340
+ };
3341
+ const queryString = toQueryString(jsonData);
3342
+ const urlWithParams = `${"/report" /* REPORT_PATH */}?${queryString}`;
3343
+ return env2.requests.get(urlWithParams, {
3344
+ headers: {
3345
+ "Content-Type": "application/json"
3346
+ },
3347
+ responseType: "arraybuffer"
3348
+ });
3222
3349
  });
3223
3350
  },
3224
3351
  //Run Action
3225
- async runAction({
3226
- idAction,
3227
- context
3228
- }) {
3229
- const env2 = getEnv();
3230
- const jsonData = {
3231
- action_id: idAction,
3232
- with_context: {
3233
- ...context
3234
- }
3235
- // context: {
3236
- // lang: 'en_US',
3237
- // tz: 'Asia/Saigon',
3238
- // uid: 2,
3239
- // allowed_company_ids: [1],
3240
- // active_id: Array.isArray(idDetail) ? idDetail[0] : idDetail,
3241
- // active_ids: Array.isArray(idDetail) ? [...idDetail] : idDetail,
3242
- // active_model: model,
3243
- // },
3244
- };
3245
- return env2.requests.post(`${"/run_action" /* RUN_ACTION_PATH */}`, jsonData, {
3246
- headers: {
3247
- "Content-Type": "application/json"
3248
- }
3352
+ runAction(_0) {
3353
+ return __async(this, arguments, function* ({
3354
+ idAction,
3355
+ context
3356
+ }) {
3357
+ const env2 = getEnv();
3358
+ const jsonData = {
3359
+ action_id: idAction,
3360
+ with_context: __spreadValues({}, context)
3361
+ // context: {
3362
+ // lang: 'en_US',
3363
+ // tz: 'Asia/Saigon',
3364
+ // uid: 2,
3365
+ // allowed_company_ids: [1],
3366
+ // active_id: Array.isArray(idDetail) ? idDetail[0] : idDetail,
3367
+ // active_ids: Array.isArray(idDetail) ? [...idDetail] : idDetail,
3368
+ // active_model: model,
3369
+ // },
3370
+ };
3371
+ return env2.requests.post(`${"/run_action" /* RUN_ACTION_PATH */}`, jsonData, {
3372
+ headers: {
3373
+ "Content-Type": "application/json"
3374
+ }
3375
+ });
3249
3376
  });
3250
3377
  }
3251
3378
  };
@@ -3253,200 +3380,238 @@ var action_service_default = ActionService;
3253
3380
 
3254
3381
  // src/services/auth-service/index.ts
3255
3382
  var AuthService = {
3256
- async login(body) {
3257
- const env2 = getEnv();
3258
- const payload = Object.fromEntries(
3259
- Object.entries({
3260
- username: body.email,
3261
- password: body.password,
3262
- grant_type: env2?.config?.grantType || "",
3263
- client_id: env2?.config?.clientId || "",
3264
- client_secret: env2?.config?.clientSecret || ""
3265
- }).filter(([_, value]) => !!value)
3266
- );
3267
- const encodedData = new URLSearchParams(payload).toString();
3268
- return env2?.requests?.post(body.path, encodedData, {
3269
- headers: {
3270
- "Content-Type": "application/x-www-form-urlencoded"
3271
- }
3383
+ login(body) {
3384
+ return __async(this, null, function* () {
3385
+ var _a, _b, _c, _d;
3386
+ const env2 = getEnv();
3387
+ const payload = Object.fromEntries(
3388
+ Object.entries({
3389
+ username: body.email,
3390
+ password: body.password,
3391
+ grant_type: ((_a = env2 == null ? void 0 : env2.config) == null ? void 0 : _a.grantType) || "",
3392
+ client_id: ((_b = env2 == null ? void 0 : env2.config) == null ? void 0 : _b.clientId) || "",
3393
+ client_secret: ((_c = env2 == null ? void 0 : env2.config) == null ? void 0 : _c.clientSecret) || ""
3394
+ }).filter(([_, value]) => !!value)
3395
+ );
3396
+ const encodedData = new URLSearchParams(payload).toString();
3397
+ return (_d = env2 == null ? void 0 : env2.requests) == null ? void 0 : _d.post(body.path, encodedData, {
3398
+ headers: {
3399
+ "Content-Type": "application/x-www-form-urlencoded"
3400
+ }
3401
+ });
3272
3402
  });
3273
3403
  },
3274
- async forgotPassword(email) {
3275
- const env2 = getEnv();
3276
- const bodyData = {
3277
- login: email,
3278
- url: `${window.location.origin}/reset-password`
3279
- };
3280
- return env2?.requests?.post("/reset_password" /* RESET_PASSWORD_PATH */, bodyData, {
3281
- headers: {
3282
- "Content-Type": "application/json"
3283
- }
3404
+ forgotPassword(email) {
3405
+ return __async(this, null, function* () {
3406
+ var _a;
3407
+ const env2 = getEnv();
3408
+ const bodyData = {
3409
+ login: email,
3410
+ url: `${window.location.origin}/reset-password`
3411
+ };
3412
+ return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/reset_password" /* RESET_PASSWORD_PATH */, bodyData, {
3413
+ headers: {
3414
+ "Content-Type": "application/json"
3415
+ }
3416
+ });
3284
3417
  });
3285
3418
  },
3286
- async forgotPasswordSSO({
3287
- email,
3288
- with_context,
3289
- method
3290
- }) {
3291
- const env2 = getEnv();
3292
- const body = {
3293
- method,
3294
- kwargs: {
3295
- vals: {
3296
- email
3419
+ forgotPasswordSSO(_0) {
3420
+ return __async(this, arguments, function* ({
3421
+ email,
3422
+ with_context,
3423
+ method
3424
+ }) {
3425
+ var _a;
3426
+ const env2 = getEnv();
3427
+ const body = {
3428
+ method,
3429
+ kwargs: {
3430
+ vals: {
3431
+ email
3432
+ }
3433
+ },
3434
+ with_context
3435
+ };
3436
+ return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, body, {
3437
+ headers: {
3438
+ "Content-Type": "application/json"
3297
3439
  }
3298
- },
3299
- with_context
3300
- };
3301
- return env2?.requests?.post("/call" /* CALL_PATH */, body, {
3302
- headers: {
3303
- "Content-Type": "application/json"
3304
- }
3440
+ });
3305
3441
  });
3306
3442
  },
3307
- async resetPassword(data, token) {
3308
- const env2 = getEnv();
3309
- const bodyData = {
3310
- token,
3311
- password: data.password,
3312
- new_password: data.confirmPassword
3313
- };
3314
- return env2?.requests?.post("/change_password" /* CHANGE_PASSWORD_PATH */, bodyData, {
3315
- headers: {
3316
- "Content-Type": "application/json"
3317
- }
3443
+ resetPassword(data, token) {
3444
+ return __async(this, null, function* () {
3445
+ var _a;
3446
+ const env2 = getEnv();
3447
+ const bodyData = {
3448
+ token,
3449
+ password: data.password,
3450
+ new_password: data.confirmPassword
3451
+ };
3452
+ return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/change_password" /* CHANGE_PASSWORD_PATH */, bodyData, {
3453
+ headers: {
3454
+ "Content-Type": "application/json"
3455
+ }
3456
+ });
3318
3457
  });
3319
3458
  },
3320
- async resetPasswordSSO({
3321
- method,
3322
- password,
3323
- with_context
3324
- }) {
3325
- const env2 = getEnv();
3326
- const bodyData = {
3459
+ resetPasswordSSO(_0) {
3460
+ return __async(this, arguments, function* ({
3327
3461
  method,
3328
- kwargs: {
3329
- vals: {
3330
- password
3331
- }
3332
- },
3462
+ password,
3333
3463
  with_context
3334
- };
3335
- return env2?.requests?.post("/call" /* CALL_PATH */, bodyData, {
3336
- headers: {
3337
- "Content-Type": "application/json"
3338
- }
3339
- });
3340
- },
3341
- async updatePassword(data, token) {
3342
- const env2 = getEnv();
3343
- const bodyData = {
3344
- token,
3345
- old_password: data.oldPassword,
3346
- new_password: data.newPassword
3347
- };
3348
- return env2?.requests?.post("/change_password_parent" /* UPDATE_PASSWORD_PATH */, bodyData, {
3349
- headers: {
3350
- "Content-Type": "application/json"
3351
- }
3464
+ }) {
3465
+ var _a;
3466
+ const env2 = getEnv();
3467
+ const bodyData = {
3468
+ method,
3469
+ kwargs: {
3470
+ vals: {
3471
+ password
3472
+ }
3473
+ },
3474
+ with_context
3475
+ };
3476
+ return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, bodyData, {
3477
+ headers: {
3478
+ "Content-Type": "application/json"
3479
+ }
3480
+ });
3352
3481
  });
3353
3482
  },
3354
- async isValidToken(token) {
3355
- const env2 = getEnv();
3356
- const bodyData = {
3357
- token
3358
- };
3359
- return env2?.requests?.post("/check_token" /* TOKEN */, bodyData, {
3360
- headers: {
3361
- "Content-Type": "application/json"
3362
- }
3483
+ updatePassword(data, token) {
3484
+ return __async(this, null, function* () {
3485
+ var _a;
3486
+ const env2 = getEnv();
3487
+ const bodyData = {
3488
+ token,
3489
+ old_password: data.oldPassword,
3490
+ new_password: data.newPassword
3491
+ };
3492
+ return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/change_password_parent" /* UPDATE_PASSWORD_PATH */, bodyData, {
3493
+ headers: {
3494
+ "Content-Type": "application/json"
3495
+ }
3496
+ });
3363
3497
  });
3364
3498
  },
3365
- async loginSocial({
3366
- db,
3367
- state,
3368
- access_token
3369
- }) {
3370
- const env2 = getEnv();
3371
- return env2?.requests?.post(
3372
- "/token/generate" /* GENTOKEN_SOCIAL */,
3373
- { state, access_token },
3374
- {
3499
+ isValidToken(token) {
3500
+ return __async(this, null, function* () {
3501
+ var _a;
3502
+ const env2 = getEnv();
3503
+ const bodyData = {
3504
+ token
3505
+ };
3506
+ return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/check_token" /* TOKEN */, bodyData, {
3375
3507
  headers: {
3376
3508
  "Content-Type": "application/json"
3377
3509
  }
3378
- }
3379
- );
3510
+ });
3511
+ });
3380
3512
  },
3381
- async getProviders(db) {
3382
- const env2 = getEnv();
3383
- return env2?.requests?.get("/oauth/providers", { params: { db } });
3513
+ loginSocial(_0) {
3514
+ return __async(this, arguments, function* ({
3515
+ db,
3516
+ state,
3517
+ access_token
3518
+ }) {
3519
+ var _a;
3520
+ const env2 = getEnv();
3521
+ return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post(
3522
+ "/token/generate" /* GENTOKEN_SOCIAL */,
3523
+ { state, access_token },
3524
+ {
3525
+ headers: {
3526
+ "Content-Type": "application/json"
3527
+ }
3528
+ }
3529
+ );
3530
+ });
3384
3531
  },
3385
- async getAccessByCode(code) {
3386
- const env2 = getEnv();
3387
- const data = new URLSearchParams();
3388
- data.append("code", code);
3389
- data.append("grant_type", "authorization_code");
3390
- data.append("client_id", env2?.config?.clientId || "");
3391
- data.append("redirect_uri", env2?.config?.redirectUri || "");
3392
- return env2?.requests?.post(
3393
- `${env2?.baseUrl?.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
3394
- data,
3395
- {
3396
- headers: {
3397
- "Content-Type": "application/x-www-form-urlencoded"
3532
+ getProviders(db) {
3533
+ return __async(this, null, function* () {
3534
+ var _a;
3535
+ const env2 = getEnv();
3536
+ return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.get("/oauth/providers", { params: { db } });
3537
+ });
3538
+ },
3539
+ getAccessByCode(code) {
3540
+ return __async(this, null, function* () {
3541
+ var _a, _b, _c, _d;
3542
+ const env2 = getEnv();
3543
+ const data = new URLSearchParams();
3544
+ data.append("code", code);
3545
+ data.append("grant_type", "authorization_code");
3546
+ data.append("client_id", ((_a = env2 == null ? void 0 : env2.config) == null ? void 0 : _a.clientId) || "");
3547
+ data.append("redirect_uri", ((_b = env2 == null ? void 0 : env2.config) == null ? void 0 : _b.redirectUri) || "");
3548
+ return (_d = env2 == null ? void 0 : env2.requests) == null ? void 0 : _d.post(
3549
+ `${(_c = env2 == null ? void 0 : env2.baseUrl) == null ? void 0 : _c.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
3550
+ data,
3551
+ {
3552
+ headers: {
3553
+ "Content-Type": "application/x-www-form-urlencoded"
3554
+ }
3398
3555
  }
3399
- }
3400
- );
3556
+ );
3557
+ });
3401
3558
  },
3402
- async logout(data) {
3403
- const env2 = getEnv();
3404
- console.log(data);
3405
- return env2?.requests?.post(
3406
- "/logout" /* LOGOUT */,
3407
- {},
3408
- {
3409
- headers: {
3410
- "Content-Type": "application/json"
3411
- },
3412
- withCredentials: true,
3413
- useRefreshToken: true
3414
- }
3415
- );
3559
+ logout(data) {
3560
+ return __async(this, null, function* () {
3561
+ var _a;
3562
+ const env2 = getEnv();
3563
+ console.log(data);
3564
+ return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post(
3565
+ "/logout" /* LOGOUT */,
3566
+ {},
3567
+ {
3568
+ headers: {
3569
+ "Content-Type": "application/json"
3570
+ },
3571
+ withCredentials: true,
3572
+ useRefreshToken: true
3573
+ }
3574
+ );
3575
+ });
3416
3576
  }
3417
3577
  };
3418
3578
  var auth_service_default = AuthService;
3419
3579
 
3420
3580
  // src/services/company-service/index.ts
3421
3581
  var CompanyService = {
3422
- async getCurrentCompany() {
3423
- const env2 = getEnv();
3424
- return await env2.requests.get("/company" /* COMPANY_PATH */, {
3425
- headers: {
3426
- "Content-Type": "application/json"
3427
- }
3582
+ getCurrentCompany() {
3583
+ return __async(this, null, function* () {
3584
+ const env2 = getEnv();
3585
+ return yield env2.requests.get("/company" /* COMPANY_PATH */, {
3586
+ headers: {
3587
+ "Content-Type": "application/json"
3588
+ }
3589
+ });
3428
3590
  });
3429
3591
  },
3430
- async getInfoCompany(id) {
3431
- const env2 = getEnv();
3432
- const jsonData = {
3433
- ids: [id],
3434
- model: "res.company" /* COMPANY */,
3435
- method: "web_read" /* WEB_READ */,
3436
- kwargs: {
3437
- specification: {
3438
- primary_color: {},
3439
- secondary_color: {},
3440
- logo: {},
3441
- display_name: {},
3442
- secondary_logo: {}
3592
+ getInfoCompany(id) {
3593
+ return __async(this, null, function* () {
3594
+ var _a;
3595
+ const env2 = getEnv();
3596
+ const jsonData = {
3597
+ ids: [id],
3598
+ model: "res.company" /* COMPANY */,
3599
+ method: "web_read" /* WEB_READ */,
3600
+ kwargs: {
3601
+ specification: {
3602
+ primary_color: {},
3603
+ secondary_color: {},
3604
+ logo: {},
3605
+ display_name: {},
3606
+ secondary_logo: {}
3607
+ }
3443
3608
  }
3444
- }
3445
- };
3446
- return await env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3447
- headers: {
3448
- "Content-Type": "application/json"
3449
- }
3609
+ };
3610
+ return yield (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
3611
+ headers: {
3612
+ "Content-Type": "application/json"
3613
+ }
3614
+ });
3450
3615
  });
3451
3616
  }
3452
3617
  };
@@ -3454,300 +3619,328 @@ var company_service_default = CompanyService;
3454
3619
 
3455
3620
  // src/services/excel-service/index.ts
3456
3621
  var ExcelService = {
3457
- async uploadFile({ formData }) {
3458
- const env2 = getEnv();
3459
- return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
3460
- headers: {
3461
- "Content-Type": "multipart/form-data"
3462
- }
3463
- });
3464
- },
3465
- async uploadIdFile({ formData }) {
3466
- const env2 = getEnv();
3467
- return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
3468
- headers: {
3469
- "Content-Type": "multipart/form-data"
3470
- }
3471
- });
3472
- },
3473
- async parsePreview({
3474
- id,
3475
- selectedSheet,
3476
- isHeader,
3477
- context
3478
- }) {
3479
- const env2 = getEnv();
3480
- const jsonData = {
3481
- model: "base_import.import" /* BASE_IMPORT */,
3482
- method: "parse_preview",
3483
- ids: [id],
3484
- kwargs: {
3485
- options: {
3486
- import_skip_records: [],
3487
- import_set_empty_fields: [],
3488
- fallback_values: {},
3489
- name_create_enabled_fields: {},
3490
- encoding: "",
3491
- separator: "",
3492
- quoting: '"',
3493
- date_format: "",
3494
- datetime_format: "",
3495
- float_thousand_separator: ",",
3496
- float_decimal_separator: ".",
3497
- advanced: true,
3498
- has_headers: isHeader,
3499
- keep_matches: false,
3500
- limit: 2e3,
3501
- sheets: [],
3502
- sheet: selectedSheet,
3503
- skip: 0,
3504
- tracking_disable: true
3622
+ uploadFile(_0) {
3623
+ return __async(this, arguments, function* ({ formData }) {
3624
+ const env2 = getEnv();
3625
+ return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
3626
+ headers: {
3627
+ "Content-Type": "multipart/form-data"
3505
3628
  }
3506
- },
3507
- with_context: context
3508
- };
3509
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3510
- headers: {
3511
- "Content-Type": "multipart/form-data"
3512
- }
3629
+ });
3513
3630
  });
3514
3631
  },
3515
- async executeImport({
3516
- columns,
3517
- fields,
3518
- idFile,
3519
- options,
3520
- dryrun,
3521
- context
3522
- }) {
3523
- const env2 = getEnv();
3524
- const jsonData = {
3525
- model: "base_import.import" /* BASE_IMPORT */,
3526
- method: "execute_import",
3527
- ids: [idFile],
3528
- kwargs: {
3529
- fields,
3530
- columns,
3531
- options,
3532
- dryrun
3533
- },
3534
- with_context: context
3535
- };
3536
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3537
- headers: {
3538
- "Content-Type": "multipart/form-data"
3539
- }
3632
+ uploadIdFile(_0) {
3633
+ return __async(this, arguments, function* ({ formData }) {
3634
+ const env2 = getEnv();
3635
+ return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
3636
+ headers: {
3637
+ "Content-Type": "multipart/form-data"
3638
+ }
3639
+ });
3540
3640
  });
3541
3641
  },
3542
- async getFileExcel({ model }) {
3543
- const env2 = getEnv();
3544
- const jsonData = {
3545
- model,
3546
- method: "get_import_templates" /* GET_IMPORT */,
3547
- args: []
3548
- };
3549
- return env2.requests.post("/call" /* CALL_PATH */, jsonData);
3550
- },
3551
- async getFieldExport({
3552
- ids,
3553
- model,
3554
- isShow,
3555
- parentField,
3556
- fieldType,
3557
- parentName,
3558
- prefix,
3559
- name,
3560
- context,
3561
- importCompat
3562
- }) {
3563
- const env2 = getEnv();
3564
- const jsonData = {
3565
- model,
3566
- import_compat: importCompat,
3567
- domain: [["id", "in", ids]],
3568
- with_context: context
3569
- };
3570
- if (isShow) {
3571
- jsonData.parent_field = parentField;
3572
- jsonData.parent_field_type = fieldType;
3573
- jsonData.parent_name = parentName;
3574
- jsonData.name = name;
3575
- jsonData.prefix = prefix;
3576
- jsonData.exclude = [null];
3577
- }
3578
- return env2.requests.post("/export/get_fields", jsonData);
3579
- },
3580
- async exportExcel({
3581
- model,
3582
- domain,
3583
- ids,
3584
- fields,
3585
- type,
3586
- importCompat,
3587
- context,
3588
- groupby
3589
- }) {
3590
- const env2 = getEnv();
3591
- const jsonData = {
3592
- model,
3593
- domain,
3594
- ids,
3595
- import_compat: importCompat,
3596
- fields,
3597
- with_context: context,
3598
- groupby: groupby ?? []
3599
- };
3600
- return env2.requests.post_excel(`/export/${type}`, jsonData);
3601
- }
3602
- };
3603
- var excel_service_default = ExcelService;
3604
-
3605
- // src/services/form-service/index.ts
3606
- var FormService = {
3607
- async getComment({ data }) {
3608
- try {
3642
+ parsePreview(_0) {
3643
+ return __async(this, arguments, function* ({
3644
+ id,
3645
+ selectedSheet,
3646
+ isHeader,
3647
+ context
3648
+ }) {
3609
3649
  const env2 = getEnv();
3610
3650
  const jsonData = {
3611
- thread_id: data.thread_id,
3612
- thread_model: data.thread_model,
3613
- limit: 100,
3614
- with_context: {
3615
- lang: data.lang
3616
- }
3651
+ model: "base_import.import" /* BASE_IMPORT */,
3652
+ method: "parse_preview",
3653
+ ids: [id],
3654
+ kwargs: {
3655
+ options: {
3656
+ import_skip_records: [],
3657
+ import_set_empty_fields: [],
3658
+ fallback_values: {},
3659
+ name_create_enabled_fields: {},
3660
+ encoding: "",
3661
+ separator: "",
3662
+ quoting: '"',
3663
+ date_format: "",
3664
+ datetime_format: "",
3665
+ float_thousand_separator: ",",
3666
+ float_decimal_separator: ".",
3667
+ advanced: true,
3668
+ has_headers: isHeader,
3669
+ keep_matches: false,
3670
+ limit: 2e3,
3671
+ sheets: [],
3672
+ sheet: selectedSheet,
3673
+ skip: 0,
3674
+ tracking_disable: true
3675
+ }
3676
+ },
3677
+ with_context: context
3617
3678
  };
3618
- return env2.requests.post("/chatter/thread/messages" /* GET_MESSAGE */, jsonData, {
3679
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3619
3680
  headers: {
3620
- "Content-Type": "application/json"
3681
+ "Content-Type": "multipart/form-data"
3621
3682
  }
3622
3683
  });
3623
- } catch (error) {
3624
- console.error("Error when sending message:", error);
3625
- throw error;
3626
- }
3684
+ });
3627
3685
  },
3628
- async sentComment({ data }) {
3629
- try {
3686
+ executeImport(_0) {
3687
+ return __async(this, arguments, function* ({
3688
+ columns,
3689
+ fields,
3690
+ idFile,
3691
+ options,
3692
+ dryrun,
3693
+ context
3694
+ }) {
3630
3695
  const env2 = getEnv();
3631
3696
  const jsonData = {
3632
- context: {
3633
- tz: "Asia/Saigon",
3634
- uid: 2,
3635
- allowed_company_ids: [1],
3636
- mail_post_autofollow: false,
3637
- temporary_id: 142183.01
3697
+ model: "base_import.import" /* BASE_IMPORT */,
3698
+ method: "execute_import",
3699
+ ids: [idFile],
3700
+ kwargs: {
3701
+ fields,
3702
+ columns,
3703
+ options,
3704
+ dryrun
3638
3705
  },
3639
- post_data: {
3640
- body: data.message,
3641
- message_type: "comment",
3642
- attachment_ids: data.attachment_ids,
3643
- attachment_tokens: [],
3644
- subtype_xmlid: data.subtype
3645
- },
3646
- thread_id: Number(data.thread_id),
3647
- thread_model: data.thread_model
3706
+ with_context: context
3648
3707
  };
3649
- return env2.requests.post("/chatter/message/post" /* SENT_MESSAGE */, jsonData, {
3708
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3650
3709
  headers: {
3651
- "Content-Type": "application/json"
3710
+ "Content-Type": "multipart/form-data"
3652
3711
  }
3653
3712
  });
3654
- } catch (error) {
3655
- console.error("Error when sent message:", error);
3656
- throw error;
3657
- }
3713
+ });
3658
3714
  },
3659
- async deleteComment({ data }) {
3660
- try {
3715
+ getFileExcel(_0) {
3716
+ return __async(this, arguments, function* ({ model }) {
3661
3717
  const env2 = getEnv();
3662
3718
  const jsonData = {
3663
- attachment_ids: [],
3664
- attachment_tokens: [],
3665
- body: "",
3666
- message_id: data.message_id
3719
+ model,
3720
+ method: "get_import_templates" /* GET_IMPORT */,
3721
+ args: []
3667
3722
  };
3668
- return env2.requests.post("/chatter/message/update_content" /* DELETE_MESSAGE */, jsonData, {
3669
- headers: {
3670
- "Content-Type": "application/json"
3671
- }
3672
- });
3673
- } catch (error) {
3674
- console.error("Error when sent message:", error);
3675
- throw error;
3676
- }
3723
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData);
3724
+ });
3677
3725
  },
3678
- async getImage({ data }) {
3679
- try {
3726
+ getFieldExport(_0) {
3727
+ return __async(this, arguments, function* ({
3728
+ ids,
3729
+ model,
3730
+ isShow,
3731
+ parentField,
3732
+ fieldType,
3733
+ parentName,
3734
+ prefix,
3735
+ name,
3736
+ context,
3737
+ importCompat
3738
+ }) {
3680
3739
  const env2 = getEnv();
3681
- return env2.requests.get(
3682
- `${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
3683
- {
3740
+ const jsonData = {
3741
+ model,
3742
+ import_compat: importCompat,
3743
+ domain: [["id", "in", ids]],
3744
+ with_context: context
3745
+ };
3746
+ if (isShow) {
3747
+ jsonData.parent_field = parentField;
3748
+ jsonData.parent_field_type = fieldType;
3749
+ jsonData.parent_name = parentName;
3750
+ jsonData.name = name;
3751
+ jsonData.prefix = prefix;
3752
+ jsonData.exclude = [null];
3753
+ }
3754
+ return env2.requests.post("/export/get_fields", jsonData);
3755
+ });
3756
+ },
3757
+ exportExcel(_0) {
3758
+ return __async(this, arguments, function* ({
3759
+ model,
3760
+ domain,
3761
+ ids,
3762
+ fields,
3763
+ type,
3764
+ importCompat,
3765
+ context,
3766
+ groupby
3767
+ }) {
3768
+ const env2 = getEnv();
3769
+ const jsonData = {
3770
+ model,
3771
+ domain,
3772
+ ids,
3773
+ import_compat: importCompat,
3774
+ fields,
3775
+ with_context: context,
3776
+ groupby: groupby != null ? groupby : []
3777
+ };
3778
+ return env2.requests.post_excel(`/export/${type}`, jsonData);
3779
+ });
3780
+ }
3781
+ };
3782
+ var excel_service_default = ExcelService;
3783
+
3784
+ // src/services/form-service/index.ts
3785
+ var FormService = {
3786
+ getComment(_0) {
3787
+ return __async(this, arguments, function* ({ data }) {
3788
+ try {
3789
+ const env2 = getEnv();
3790
+ const jsonData = {
3791
+ thread_id: data.thread_id,
3792
+ thread_model: data.thread_model,
3793
+ limit: 100,
3794
+ with_context: {
3795
+ lang: data.lang
3796
+ }
3797
+ };
3798
+ return env2.requests.post("/chatter/thread/messages" /* GET_MESSAGE */, jsonData, {
3684
3799
  headers: {
3685
3800
  "Content-Type": "application/json"
3686
3801
  }
3687
- }
3688
- );
3689
- } catch (error) {
3690
- console.error("Error when sent message:", error);
3691
- throw error;
3692
- }
3802
+ });
3803
+ } catch (error) {
3804
+ console.error("Error when sending message:", error);
3805
+ throw error;
3806
+ }
3807
+ });
3693
3808
  },
3694
- async uploadImage({ data }) {
3695
- try {
3696
- const env2 = getEnv();
3697
- return env2.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
3698
- headers: {
3699
- "Content-Type": "multipart/form-data"
3700
- }
3701
- });
3702
- } catch (error) {
3703
- console.error("Error when sent message:", error);
3704
- throw error;
3705
- }
3809
+ sentComment(_0) {
3810
+ return __async(this, arguments, function* ({ data }) {
3811
+ try {
3812
+ const env2 = getEnv();
3813
+ const jsonData = {
3814
+ context: {
3815
+ tz: "Asia/Saigon",
3816
+ uid: 2,
3817
+ allowed_company_ids: [1],
3818
+ mail_post_autofollow: false,
3819
+ temporary_id: 142183.01
3820
+ },
3821
+ post_data: {
3822
+ body: data.message,
3823
+ message_type: "comment",
3824
+ attachment_ids: data.attachment_ids,
3825
+ attachment_tokens: [],
3826
+ subtype_xmlid: data.subtype
3827
+ },
3828
+ thread_id: Number(data.thread_id),
3829
+ thread_model: data.thread_model
3830
+ };
3831
+ return env2.requests.post("/chatter/message/post" /* SENT_MESSAGE */, jsonData, {
3832
+ headers: {
3833
+ "Content-Type": "application/json"
3834
+ }
3835
+ });
3836
+ } catch (error) {
3837
+ console.error("Error when sent message:", error);
3838
+ throw error;
3839
+ }
3840
+ });
3706
3841
  },
3707
- async getFormView({ data }) {
3708
- try {
3842
+ deleteComment(_0) {
3843
+ return __async(this, arguments, function* ({ data }) {
3844
+ try {
3845
+ const env2 = getEnv();
3846
+ const jsonData = {
3847
+ attachment_ids: [],
3848
+ attachment_tokens: [],
3849
+ body: "",
3850
+ message_id: data.message_id
3851
+ };
3852
+ return env2.requests.post("/chatter/message/update_content" /* DELETE_MESSAGE */, jsonData, {
3853
+ headers: {
3854
+ "Content-Type": "application/json"
3855
+ }
3856
+ });
3857
+ } catch (error) {
3858
+ console.error("Error when sent message:", error);
3859
+ throw error;
3860
+ }
3861
+ });
3862
+ },
3863
+ getImage(_0) {
3864
+ return __async(this, arguments, function* ({ data }) {
3865
+ try {
3866
+ const env2 = getEnv();
3867
+ return env2.requests.get(
3868
+ `${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
3869
+ {
3870
+ headers: {
3871
+ "Content-Type": "application/json"
3872
+ }
3873
+ }
3874
+ );
3875
+ } catch (error) {
3876
+ console.error("Error when sent message:", error);
3877
+ throw error;
3878
+ }
3879
+ });
3880
+ },
3881
+ uploadImage(_0) {
3882
+ return __async(this, arguments, function* ({ data }) {
3883
+ try {
3884
+ const env2 = getEnv();
3885
+ return env2.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
3886
+ headers: {
3887
+ "Content-Type": "multipart/form-data"
3888
+ }
3889
+ });
3890
+ } catch (error) {
3891
+ console.error("Error when sent message:", error);
3892
+ throw error;
3893
+ }
3894
+ });
3895
+ },
3896
+ getFormView(_0) {
3897
+ return __async(this, arguments, function* ({ data }) {
3898
+ try {
3899
+ const env2 = getEnv();
3900
+ const jsonData = {
3901
+ model: data.model,
3902
+ method: "get_formview_action",
3903
+ ids: data.id ? [data.id] : [],
3904
+ with_context: data.context
3905
+ };
3906
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3907
+ headers: {
3908
+ "Content-Type": "application/json"
3909
+ }
3910
+ });
3911
+ } catch (error) {
3912
+ console.error("Error when fetching form view:", error);
3913
+ throw error;
3914
+ }
3915
+ });
3916
+ },
3917
+ changeStatus(_0) {
3918
+ return __async(this, arguments, function* ({ data }) {
3709
3919
  const env2 = getEnv();
3920
+ const vals = {
3921
+ [data.name]: data.stage_id
3922
+ };
3710
3923
  const jsonData = {
3711
3924
  model: data.model,
3712
- method: "get_formview_action",
3713
- ids: data.id ? [data.id] : [],
3714
- with_context: data.context
3925
+ method: "web_save",
3926
+ with_context: {
3927
+ lang: data.lang,
3928
+ allowed_company_ids: [1],
3929
+ uid: 2,
3930
+ search_default_my_ticket: true,
3931
+ search_default_is_open: true
3932
+ },
3933
+ ids: [data.id],
3934
+ kwargs: {
3935
+ vals,
3936
+ specification: {}
3937
+ }
3715
3938
  };
3716
3939
  return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3717
3940
  headers: {
3718
3941
  "Content-Type": "application/json"
3719
3942
  }
3720
3943
  });
3721
- } catch (error) {
3722
- console.error("Error when fetching form view:", error);
3723
- throw error;
3724
- }
3725
- },
3726
- async changeStatus({ data }) {
3727
- const env2 = getEnv();
3728
- const vals = {
3729
- [data.name]: data.stage_id
3730
- };
3731
- const jsonData = {
3732
- model: data.model,
3733
- method: "web_save",
3734
- with_context: {
3735
- lang: data.lang,
3736
- allowed_company_ids: [1],
3737
- uid: 2,
3738
- search_default_my_ticket: true,
3739
- search_default_is_open: true
3740
- },
3741
- ids: [data.id],
3742
- kwargs: {
3743
- vals,
3744
- specification: {}
3745
- }
3746
- };
3747
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3748
- headers: {
3749
- "Content-Type": "application/json"
3750
- }
3751
3944
  });
3752
3945
  }
3753
3946
  };
@@ -3755,51 +3948,55 @@ var form_service_default = FormService;
3755
3948
 
3756
3949
  // src/services/kanban-service/index.ts
3757
3950
  var KanbanServices = {
3758
- async getGroups({
3759
- model,
3760
- width_context
3761
- }) {
3762
- const env2 = getEnv();
3763
- const jsonDataView = {
3951
+ getGroups(_0) {
3952
+ return __async(this, arguments, function* ({
3764
3953
  model,
3765
- method: "web_read_group",
3766
- kwargs: {
3767
- domain: [["stage_id.fold", "=", false]],
3768
- fields: ["color:sum"],
3769
- groupby: ["stage_id"]
3770
- },
3771
3954
  width_context
3772
- };
3773
- return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
3774
- headers: {
3775
- "Content-Type": "application/json"
3776
- }
3955
+ }) {
3956
+ const env2 = getEnv();
3957
+ const jsonDataView = {
3958
+ model,
3959
+ method: "web_read_group",
3960
+ kwargs: {
3961
+ domain: [["stage_id.fold", "=", false]],
3962
+ fields: ["color:sum"],
3963
+ groupby: ["stage_id"]
3964
+ },
3965
+ width_context
3966
+ };
3967
+ return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
3968
+ headers: {
3969
+ "Content-Type": "application/json"
3970
+ }
3971
+ });
3777
3972
  });
3778
3973
  },
3779
- async getProgressBar({
3780
- field,
3781
- color,
3782
- model,
3783
- width_context
3784
- }) {
3785
- const env2 = getEnv();
3786
- const jsonDataView = {
3974
+ getProgressBar(_0) {
3975
+ return __async(this, arguments, function* ({
3976
+ field,
3977
+ color,
3787
3978
  model,
3788
- method: "read_progress_bar",
3789
- kwargs: {
3790
- domain: [],
3791
- group_by: "stage_id",
3792
- progress_bar: {
3793
- colors: color,
3794
- field
3795
- }
3796
- },
3797
3979
  width_context
3798
- };
3799
- return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
3800
- headers: {
3801
- "Content-Type": "application/json"
3802
- }
3980
+ }) {
3981
+ const env2 = getEnv();
3982
+ const jsonDataView = {
3983
+ model,
3984
+ method: "read_progress_bar",
3985
+ kwargs: {
3986
+ domain: [],
3987
+ group_by: "stage_id",
3988
+ progress_bar: {
3989
+ colors: color,
3990
+ field
3991
+ }
3992
+ },
3993
+ width_context
3994
+ };
3995
+ return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
3996
+ headers: {
3997
+ "Content-Type": "application/json"
3998
+ }
3999
+ });
3803
4000
  });
3804
4001
  }
3805
4002
  };
@@ -3808,259 +4005,285 @@ var kanban_service_default = KanbanServices;
3808
4005
  // src/services/model-service/index.ts
3809
4006
  var OBJECT_POSITION = 2;
3810
4007
  var ModelService = {
3811
- async getListMyBankAccount({
3812
- domain,
3813
- spectification,
3814
- model
3815
- }) {
3816
- const env2 = getEnv();
3817
- const jsonData = {
3818
- model,
3819
- method: "web_search_read",
3820
- kwargs: {
3821
- specification: spectification,
3822
- domain,
3823
- limit: 100,
3824
- offset: 0
3825
- }
3826
- };
3827
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3828
- headers: {
3829
- "Content-Type": "application/json"
3830
- }
4008
+ getListMyBankAccount(_0) {
4009
+ return __async(this, arguments, function* ({
4010
+ domain,
4011
+ spectification,
4012
+ model
4013
+ }) {
4014
+ const env2 = getEnv();
4015
+ const jsonData = {
4016
+ model,
4017
+ method: "web_search_read",
4018
+ kwargs: {
4019
+ specification: spectification,
4020
+ domain,
4021
+ limit: 100,
4022
+ offset: 0
4023
+ }
4024
+ };
4025
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4026
+ headers: {
4027
+ "Content-Type": "application/json"
4028
+ }
4029
+ });
3831
4030
  });
3832
4031
  },
3833
- async getCurrency() {
3834
- const env2 = getEnv();
3835
- const jsonData = {
3836
- model: "res.currency",
3837
- method: "web_search_read",
3838
- kwargs: {
3839
- specification: {
3840
- icon_url: {},
3841
- name: {}
3842
- },
3843
- domain: [["active", "=", true]],
3844
- limit: 100,
3845
- offset: 0
3846
- }
3847
- };
3848
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3849
- headers: {
3850
- "Content-Type": "application/json"
3851
- }
4032
+ getCurrency() {
4033
+ return __async(this, null, function* () {
4034
+ const env2 = getEnv();
4035
+ const jsonData = {
4036
+ model: "res.currency",
4037
+ method: "web_search_read",
4038
+ kwargs: {
4039
+ specification: {
4040
+ icon_url: {},
4041
+ name: {}
4042
+ },
4043
+ domain: [["active", "=", true]],
4044
+ limit: 100,
4045
+ offset: 0
4046
+ }
4047
+ };
4048
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4049
+ headers: {
4050
+ "Content-Type": "application/json"
4051
+ }
4052
+ });
3852
4053
  });
3853
4054
  },
3854
- async getConversionRate() {
3855
- const env2 = getEnv();
3856
- const jsonData = {
3857
- model: "res.currency",
3858
- method: "web_search_read",
3859
- kwargs: {
3860
- specification: {
3861
- name: {},
3862
- icon_url: {},
3863
- rate_ids: {
3864
- fields: {
3865
- company_rate: {},
3866
- sell: {}
4055
+ getConversionRate() {
4056
+ return __async(this, null, function* () {
4057
+ const env2 = getEnv();
4058
+ const jsonData = {
4059
+ model: "res.currency",
4060
+ method: "web_search_read",
4061
+ kwargs: {
4062
+ specification: {
4063
+ name: {},
4064
+ icon_url: {},
4065
+ rate_ids: {
4066
+ fields: {
4067
+ company_rate: {},
4068
+ sell: {}
4069
+ }
3867
4070
  }
3868
- }
3869
- },
3870
- domain: [["active", "=", true]],
3871
- limit: 100,
3872
- offset: 0
3873
- }
3874
- };
3875
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3876
- headers: {
3877
- "Content-Type": "application/json"
3878
- }
3879
- });
3880
- },
3881
- async getAll({ data }) {
3882
- const env2 = getEnv();
3883
- const jsonReadGroup = data.type == "calendar" ? { fields: data?.fields } : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
3884
- fields: data.fields,
3885
- groupby: data.groupby
3886
- } : {
3887
- count_limit: 10001,
3888
- order: data.sort,
3889
- specification: data.specification
3890
- };
3891
- const jsonData = {
3892
- model: String(data.model),
3893
- method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
3894
- ids: data.ids,
3895
- with_context: data.context,
3896
- kwargs: {
3897
- domain: data.domain,
3898
- limit: data.limit,
3899
- offset: data.offset,
3900
- ...jsonReadGroup
3901
- }
3902
- };
3903
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3904
- headers: {
3905
- "Content-Type": "application/json"
3906
- }
4071
+ },
4072
+ domain: [["active", "=", true]],
4073
+ limit: 100,
4074
+ offset: 0
4075
+ }
4076
+ };
4077
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4078
+ headers: {
4079
+ "Content-Type": "application/json"
4080
+ }
4081
+ });
3907
4082
  });
3908
4083
  },
3909
- async getListCalendar({ data }) {
3910
- const env2 = getEnv();
3911
- const jsonReadGroup = data.type == "calendar" ? data?.fields : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
3912
- fields: data.fields,
3913
- groupby: data.groupby
3914
- } : {
3915
- count_limit: 10001,
3916
- order: data.sort,
3917
- specification: data.specification
3918
- };
3919
- const jsonData = {
3920
- model: String(data.model),
3921
- method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
3922
- ids: data.ids,
3923
- with_context: data.context,
3924
- kwargs: {
3925
- domain: data.domain,
3926
- limit: data.limit,
3927
- offset: data.offset,
4084
+ getAll(_0) {
4085
+ return __async(this, arguments, function* ({ data }) {
4086
+ const env2 = getEnv();
4087
+ 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] ? {
3928
4088
  fields: data.fields,
3929
- ...jsonReadGroup
3930
- }
3931
- };
3932
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3933
- headers: {
3934
- "Content-Type": "application/json"
3935
- }
4089
+ groupby: data.groupby
4090
+ } : {
4091
+ count_limit: 10001,
4092
+ order: data.sort,
4093
+ specification: data.specification
4094
+ };
4095
+ const jsonData = {
4096
+ model: String(data.model),
4097
+ method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
4098
+ ids: data.ids,
4099
+ with_context: data.context,
4100
+ kwargs: __spreadValues({
4101
+ domain: data.domain,
4102
+ limit: data.limit,
4103
+ offset: data.offset
4104
+ }, jsonReadGroup)
4105
+ };
4106
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4107
+ headers: {
4108
+ "Content-Type": "application/json"
4109
+ }
4110
+ });
3936
4111
  });
3937
4112
  },
3938
- async getList({
3939
- model,
3940
- ids = [],
3941
- specification = {},
3942
- domain = [],
3943
- offset,
3944
- order,
3945
- context = {},
3946
- limit = 10
3947
- }) {
3948
- const env2 = getEnv();
3949
- const jsonData = {
3950
- model,
3951
- method: "web_search_read" /* WEB_SEARCH_READ */,
3952
- ids,
3953
- with_context: context,
3954
- kwargs: {
3955
- specification,
3956
- domain,
3957
- limit,
3958
- offset,
3959
- order
3960
- }
3961
- };
3962
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3963
- headers: {
3964
- "Content-Type": "application/json"
3965
- }
4113
+ getListCalendar(_0) {
4114
+ return __async(this, arguments, function* ({ data }) {
4115
+ const env2 = getEnv();
4116
+ 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] ? {
4117
+ fields: data.fields,
4118
+ groupby: data.groupby
4119
+ } : {
4120
+ count_limit: 10001,
4121
+ order: data.sort,
4122
+ specification: data.specification
4123
+ };
4124
+ const jsonData = {
4125
+ model: String(data.model),
4126
+ method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
4127
+ ids: data.ids,
4128
+ with_context: data.context,
4129
+ kwargs: __spreadValues({
4130
+ domain: data.domain,
4131
+ limit: data.limit,
4132
+ offset: data.offset,
4133
+ fields: data.fields
4134
+ }, jsonReadGroup)
4135
+ };
4136
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4137
+ headers: {
4138
+ "Content-Type": "application/json"
4139
+ }
4140
+ });
3966
4141
  });
3967
4142
  },
3968
- async getDetail({
3969
- ids = [],
3970
- model,
3971
- specification,
3972
- context
3973
- }) {
3974
- const env2 = getEnv();
3975
- const jsonData = {
4143
+ getList(_0) {
4144
+ return __async(this, arguments, function* ({
3976
4145
  model,
3977
- method: "web_read" /* WEB_READ */,
3978
- ids,
3979
- with_context: context,
3980
- kwargs: {
3981
- specification
3982
- }
3983
- };
3984
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3985
- headers: {
3986
- "Content-Type": "application/json"
3987
- }
4146
+ ids = [],
4147
+ specification = {},
4148
+ domain = [],
4149
+ offset,
4150
+ order,
4151
+ context = {},
4152
+ limit = 10
4153
+ }) {
4154
+ var _a;
4155
+ const env2 = getEnv();
4156
+ const jsonData = {
4157
+ model,
4158
+ method: "web_search_read" /* WEB_SEARCH_READ */,
4159
+ ids,
4160
+ with_context: context,
4161
+ kwargs: {
4162
+ specification,
4163
+ domain,
4164
+ limit,
4165
+ offset,
4166
+ order
4167
+ }
4168
+ };
4169
+ return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4170
+ headers: {
4171
+ "Content-Type": "application/json"
4172
+ }
4173
+ });
3988
4174
  });
3989
4175
  },
3990
- async save({
3991
- model,
3992
- ids = [],
3993
- data = {},
3994
- specification = {},
3995
- context = {},
3996
- path
3997
- }) {
3998
- const env2 = getEnv();
3999
- const jsonData = {
4176
+ getDetail(_0) {
4177
+ return __async(this, arguments, function* ({
4178
+ ids = [],
4000
4179
  model,
4001
- method: "web_save" /* WEB_SAVE */,
4002
- with_context: context,
4003
- ids,
4004
- kwargs: {
4005
- vals: data,
4006
- specification
4007
- }
4008
- };
4009
- return env2?.requests?.post(path ?? "/call" /* CALL_PATH */, jsonData, {
4010
- headers: {
4011
- "Content-Type": "application/json"
4012
- }
4180
+ specification,
4181
+ context
4182
+ }) {
4183
+ var _a;
4184
+ const env2 = getEnv();
4185
+ const jsonData = {
4186
+ model,
4187
+ method: "web_read" /* WEB_READ */,
4188
+ ids,
4189
+ with_context: context,
4190
+ kwargs: {
4191
+ specification
4192
+ }
4193
+ };
4194
+ return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4195
+ headers: {
4196
+ "Content-Type": "application/json"
4197
+ }
4198
+ });
4013
4199
  });
4014
4200
  },
4015
- async delete({ ids = [], model }) {
4016
- const env2 = getEnv();
4017
- const jsonData = {
4201
+ save(_0) {
4202
+ return __async(this, arguments, function* ({
4018
4203
  model,
4019
- method: "unlink" /* UNLINK */,
4020
- ids
4021
- };
4022
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4023
- headers: {
4024
- "Content-Type": "application/json"
4025
- }
4204
+ ids = [],
4205
+ data = {},
4206
+ specification = {},
4207
+ context = {},
4208
+ path
4209
+ }) {
4210
+ var _a;
4211
+ const env2 = getEnv();
4212
+ const jsonData = {
4213
+ model,
4214
+ method: "web_save" /* WEB_SAVE */,
4215
+ with_context: context,
4216
+ ids,
4217
+ kwargs: {
4218
+ vals: data,
4219
+ specification
4220
+ }
4221
+ };
4222
+ return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post(path != null ? path : "/call" /* CALL_PATH */, jsonData, {
4223
+ headers: {
4224
+ "Content-Type": "application/json"
4225
+ }
4226
+ });
4026
4227
  });
4027
4228
  },
4028
- async onChange({
4029
- ids = [],
4030
- model,
4031
- object,
4032
- specification,
4033
- context,
4034
- fieldChange
4035
- }) {
4036
- const env2 = getEnv();
4037
- const jsonData = {
4038
- model,
4039
- method: "onchange" /* ONCHANGE */,
4040
- ids,
4041
- with_context: context,
4042
- args: [
4043
- object ? object : {},
4044
- fieldChange ? fieldChange : [],
4045
- specification
4046
- ]
4047
- };
4048
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4049
- headers: {
4050
- "Content-Type": "application/json"
4051
- }
4229
+ delete(_0) {
4230
+ return __async(this, arguments, function* ({ ids = [], model }) {
4231
+ var _a;
4232
+ const env2 = getEnv();
4233
+ const jsonData = {
4234
+ model,
4235
+ method: "unlink" /* UNLINK */,
4236
+ ids
4237
+ };
4238
+ return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4239
+ headers: {
4240
+ "Content-Type": "application/json"
4241
+ }
4242
+ });
4052
4243
  });
4053
4244
  },
4054
- async getListFieldsOnchange({ model }) {
4055
- const env2 = getEnv();
4056
- const jsonData = {
4245
+ onChange(_0) {
4246
+ return __async(this, arguments, function* ({
4247
+ ids = [],
4057
4248
  model,
4058
- method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
4059
- };
4060
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4061
- headers: {
4062
- "Content-Type": "application/json"
4063
- }
4249
+ object,
4250
+ specification,
4251
+ context,
4252
+ fieldChange
4253
+ }) {
4254
+ var _a;
4255
+ const env2 = getEnv();
4256
+ const jsonData = {
4257
+ model,
4258
+ method: "onchange" /* ONCHANGE */,
4259
+ ids,
4260
+ with_context: context,
4261
+ args: [
4262
+ object ? object : {},
4263
+ fieldChange ? fieldChange : [],
4264
+ specification
4265
+ ]
4266
+ };
4267
+ return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4268
+ headers: {
4269
+ "Content-Type": "application/json"
4270
+ }
4271
+ });
4272
+ });
4273
+ },
4274
+ getListFieldsOnchange(_0) {
4275
+ return __async(this, arguments, function* ({ model }) {
4276
+ var _a;
4277
+ const env2 = getEnv();
4278
+ const jsonData = {
4279
+ model,
4280
+ method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
4281
+ };
4282
+ return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4283
+ headers: {
4284
+ "Content-Type": "application/json"
4285
+ }
4286
+ });
4064
4287
  });
4065
4288
  },
4066
4289
  parseORMOdoo(data) {
@@ -4074,13 +4297,14 @@ var ModelService = {
4074
4297
  data[key] = "/";
4075
4298
  }
4076
4299
  }
4077
- return { ...data };
4300
+ return __spreadValues({}, data);
4078
4301
  },
4079
4302
  toDataJS(data, viewData, model) {
4303
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
4080
4304
  for (const key in data) {
4081
4305
  if (data[key] === false) {
4082
4306
  if (viewData && model) {
4083
- if (viewData?.models?.[model]?.[key]?.type !== "boolean" /* BOOLEAN */) {
4307
+ 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 */) {
4084
4308
  data[key] = null;
4085
4309
  }
4086
4310
  } else {
@@ -4090,12 +4314,13 @@ var ModelService = {
4090
4314
  data[key] = "Draft";
4091
4315
  } else if (data[key] !== false) {
4092
4316
  if (model !== void 0) {
4093
- if (viewData?.models?.[model]?.[key]?.type === "one2many" /* ONE2MANY */ || viewData?.models?.[model]?.[key]?.type === "many2many" /* MANY2MANY */) {
4094
- data[key] = (data[key] ??= [])?.map((item) => {
4095
- const relation = viewData?.models?.[model]?.[key]?.relation;
4317
+ 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 */) {
4318
+ data[key] = (_k = (_j = data[key]) != null ? _j : data[key] = []) == null ? void 0 : _k.map((item) => {
4319
+ var _a2, _b2, _c2, _d2;
4320
+ 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;
4096
4321
  if (relation !== void 0) {
4097
- if (viewData?.models?.[relation]) {
4098
- if (item?.length >= 3) {
4322
+ if ((_d2 = viewData == null ? void 0 : viewData.models) == null ? void 0 : _d2[relation]) {
4323
+ if ((item == null ? void 0 : item.length) >= 3) {
4099
4324
  return ModelService.toDataJS(
4100
4325
  item[OBJECT_POSITION],
4101
4326
  viewData,
@@ -4105,7 +4330,7 @@ var ModelService = {
4105
4330
  return ModelService.toDataJS(item, viewData, relation);
4106
4331
  }
4107
4332
  } else {
4108
- if (item?.length >= 3) {
4333
+ if ((item == null ? void 0 : item.length) >= 3) {
4109
4334
  return item[OBJECT_POSITION];
4110
4335
  } else {
4111
4336
  return item;
@@ -4117,514 +4342,556 @@ var ModelService = {
4117
4342
  }
4118
4343
  }
4119
4344
  }
4120
- return { ...data };
4345
+ return __spreadValues({}, data);
4121
4346
  }
4122
4347
  };
4123
4348
  var model_service_default = ModelService;
4124
4349
 
4125
4350
  // src/services/user-service/index.ts
4126
4351
  var UserService = {
4127
- async getProfile(path) {
4128
- const env2 = getEnv();
4129
- return env2?.requests?.get(path ?? "/userinfo" /* PROFILE_PATH */, {
4130
- headers: {
4131
- "Content-Type": "application/x-www-form-urlencoded"
4132
- }
4352
+ getProfile(path) {
4353
+ return __async(this, null, function* () {
4354
+ const env2 = getEnv();
4355
+ return env2.requests.get(path != null ? path : "/userinfo" /* PROFILE_PATH */, {
4356
+ headers: {
4357
+ "Content-Type": "application/x-www-form-urlencoded"
4358
+ }
4359
+ });
4133
4360
  });
4134
4361
  },
4135
- async getUser({ context, id }) {
4136
- const env2 = getEnv();
4137
- const jsonData = {
4138
- model: "res.users",
4139
- method: "web_read",
4140
- ids: [id],
4141
- with_context: context,
4142
- kwargs: {
4143
- specification: {
4144
- display_name: {},
4145
- image_1920: {},
4146
- name: {},
4147
- login: {},
4148
- email: {},
4149
- password: {},
4150
- visible_group_id: {
4151
- fields: {
4152
- id: {},
4153
- display_name: {}
4154
- }
4155
- },
4156
- company_id: {
4157
- fields: {
4158
- id: {},
4159
- display_name: {}
4362
+ getUser(_0) {
4363
+ return __async(this, arguments, function* ({ context, id }) {
4364
+ const env2 = getEnv();
4365
+ const jsonData = {
4366
+ model: "res.users",
4367
+ method: "web_read",
4368
+ ids: [id],
4369
+ with_context: context,
4370
+ kwargs: {
4371
+ specification: {
4372
+ display_name: {},
4373
+ image_1920: {},
4374
+ name: {},
4375
+ login: {},
4376
+ email: {},
4377
+ password: {},
4378
+ visible_group_id: {
4379
+ fields: {
4380
+ id: {},
4381
+ display_name: {}
4382
+ }
4383
+ },
4384
+ company_id: {
4385
+ fields: {
4386
+ id: {},
4387
+ display_name: {}
4388
+ }
4160
4389
  }
4161
4390
  }
4162
4391
  }
4163
- }
4164
- };
4165
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4166
- headers: {
4167
- "Content-Type": "application/json"
4168
- }
4392
+ };
4393
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4394
+ headers: {
4395
+ "Content-Type": "application/json"
4396
+ }
4397
+ });
4169
4398
  });
4170
4399
  },
4171
- switchUserLocale: async ({ id, values }) => {
4400
+ switchUserLocale: (_0) => __async(null, [_0], function* ({ id, values }) {
4401
+ var _a;
4172
4402
  const env2 = getEnv();
4173
4403
  const jsonData = {
4174
4404
  model: "res.users",
4175
4405
  domain: [["id", "=", id]],
4176
4406
  values
4177
4407
  };
4178
- return env2?.requests.post(UriConstants?.CREATE_UPDATE_PATH, jsonData, {
4408
+ return env2 == null ? void 0 : env2.requests.post((_a = UriConstants) == null ? void 0 : _a.CREATE_UPDATE_PATH, jsonData, {
4179
4409
  headers: {
4180
4410
  "Content-Type": "application/json"
4181
4411
  }
4182
4412
  });
4183
- }
4413
+ })
4184
4414
  };
4185
4415
  var user_service_default = UserService;
4186
4416
 
4187
4417
  // src/services/view-service/index.ts
4188
4418
  var ViewService = {
4189
- async getView({
4190
- model,
4191
- views,
4192
- context = {},
4193
- options = {},
4194
- aid
4195
- }) {
4196
- const env2 = getEnv();
4197
- const defaultOptions = {
4198
- load_filters: true,
4199
- toolbar: true,
4200
- action_id: aid
4201
- };
4202
- const jsonDataView = {
4419
+ getView(_0) {
4420
+ return __async(this, arguments, function* ({
4203
4421
  model,
4204
- method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
4205
- kwargs: {
4206
- views,
4207
- options: { ...options, ...defaultOptions }
4208
- },
4209
- with_context: context
4210
- };
4211
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonDataView, {
4212
- headers: {
4213
- "Content-Type": "application/json"
4214
- }
4422
+ views,
4423
+ context = {},
4424
+ options = {},
4425
+ aid
4426
+ }) {
4427
+ var _a;
4428
+ const env2 = getEnv();
4429
+ const defaultOptions = {
4430
+ load_filters: true,
4431
+ toolbar: true,
4432
+ action_id: aid
4433
+ };
4434
+ const jsonDataView = {
4435
+ model,
4436
+ method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
4437
+ kwargs: {
4438
+ views,
4439
+ options: __spreadValues(__spreadValues({}, options), defaultOptions)
4440
+ },
4441
+ with_context: context
4442
+ };
4443
+ return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonDataView, {
4444
+ headers: {
4445
+ "Content-Type": "application/json"
4446
+ }
4447
+ });
4215
4448
  });
4216
4449
  },
4217
- async getMenu(context) {
4218
- const env2 = getEnv();
4219
- const jsonData = {
4220
- model: "ir.ui.menu" /* MENU */,
4221
- method: "web_search_read" /* WEB_SEARCH_READ */,
4222
- ids: [],
4223
- with_context: context,
4224
- kwargs: {
4225
- specification: {
4226
- active: {},
4227
- name: {},
4228
- is_display: {},
4229
- sequence: {},
4230
- complete_name: {},
4231
- action: {
4232
- fields: {
4233
- display_name: {},
4234
- type: {},
4235
- binding_view_types: {}
4236
- // res_model: {},
4237
- }
4238
- },
4239
- url_icon: {},
4240
- web_icon: {},
4241
- web_icon_data: {},
4242
- groups_id: {
4243
- fields: {
4244
- full_name: {}
4450
+ getMenu(context) {
4451
+ return __async(this, null, function* () {
4452
+ var _a;
4453
+ const env2 = getEnv();
4454
+ const jsonData = {
4455
+ model: "ir.ui.menu" /* MENU */,
4456
+ method: "web_search_read" /* WEB_SEARCH_READ */,
4457
+ ids: [],
4458
+ with_context: context,
4459
+ kwargs: {
4460
+ specification: {
4461
+ active: {},
4462
+ name: {},
4463
+ is_display: {},
4464
+ sequence: {},
4465
+ complete_name: {},
4466
+ action: {
4467
+ fields: {
4468
+ display_name: {},
4469
+ type: {},
4470
+ binding_view_types: {}
4471
+ // res_model: {},
4472
+ }
4245
4473
  },
4246
- limit: 40,
4247
- order: ""
4248
- },
4249
- display_name: {},
4250
- child_id: {
4251
- fields: {
4252
- active: {},
4253
- name: {},
4254
- is_display: {},
4255
- sequence: {},
4256
- complete_name: {},
4257
- action: {
4258
- fields: {
4259
- display_name: {},
4260
- type: {},
4261
- binding_view_types: {}
4262
- // res_model: {},
4263
- }
4474
+ url_icon: {},
4475
+ web_icon: {},
4476
+ web_icon_data: {},
4477
+ groups_id: {
4478
+ fields: {
4479
+ full_name: {}
4264
4480
  },
4265
- url_icon: {},
4266
- web_icon: {},
4267
- web_icon_data: {},
4268
- groups_id: {
4269
- fields: {
4270
- full_name: {}
4481
+ limit: 40,
4482
+ order: ""
4483
+ },
4484
+ display_name: {},
4485
+ child_id: {
4486
+ fields: {
4487
+ active: {},
4488
+ name: {},
4489
+ is_display: {},
4490
+ sequence: {},
4491
+ complete_name: {},
4492
+ action: {
4493
+ fields: {
4494
+ display_name: {},
4495
+ type: {},
4496
+ binding_view_types: {}
4497
+ // res_model: {},
4498
+ }
4271
4499
  },
4272
- limit: 40,
4273
- order: ""
4274
- },
4275
- display_name: {},
4276
- child_id: {
4277
- fields: {
4278
- active: {},
4279
- name: {},
4280
- is_display: {},
4281
- sequence: {},
4282
- complete_name: {},
4283
- action: {
4284
- fields: {
4285
- display_name: {},
4286
- type: {},
4287
- binding_view_types: {}
4288
- // res_model: {},
4289
- }
4500
+ url_icon: {},
4501
+ web_icon: {},
4502
+ web_icon_data: {},
4503
+ groups_id: {
4504
+ fields: {
4505
+ full_name: {}
4290
4506
  },
4291
- url_icon: {},
4292
- web_icon: {},
4293
- web_icon_data: {},
4294
- groups_id: {
4295
- fields: {
4296
- full_name: {}
4507
+ limit: 40,
4508
+ order: ""
4509
+ },
4510
+ display_name: {},
4511
+ child_id: {
4512
+ fields: {
4513
+ active: {},
4514
+ name: {},
4515
+ is_display: {},
4516
+ sequence: {},
4517
+ complete_name: {},
4518
+ action: {
4519
+ fields: {
4520
+ display_name: {},
4521
+ type: {},
4522
+ binding_view_types: {}
4523
+ // res_model: {},
4524
+ }
4297
4525
  },
4298
- limit: 40,
4299
- order: ""
4300
- },
4301
- display_name: {},
4302
- child_id: {
4303
- fields: {
4304
- active: {},
4305
- name: {},
4306
- is_display: {},
4307
- sequence: {},
4308
- complete_name: {},
4309
- action: {
4310
- fields: {
4311
- display_name: {},
4312
- type: {},
4313
- binding_view_types: {}
4314
- // res_model: {},
4315
- }
4526
+ url_icon: {},
4527
+ web_icon: {},
4528
+ web_icon_data: {},
4529
+ groups_id: {
4530
+ fields: {
4531
+ full_name: {}
4316
4532
  },
4317
- url_icon: {},
4318
- web_icon: {},
4319
- web_icon_data: {},
4320
- groups_id: {
4321
- fields: {
4322
- full_name: {}
4533
+ limit: 40,
4534
+ order: ""
4535
+ },
4536
+ display_name: {},
4537
+ child_id: {
4538
+ fields: {
4539
+ active: {},
4540
+ name: {},
4541
+ is_display: {},
4542
+ sequence: {},
4543
+ complete_name: {},
4544
+ action: {
4545
+ fields: {
4546
+ display_name: {},
4547
+ type: {},
4548
+ binding_view_types: {}
4549
+ // res_model: {},
4550
+ }
4323
4551
  },
4324
- limit: 40,
4325
- order: ""
4552
+ url_icon: {},
4553
+ web_icon: {},
4554
+ web_icon_data: {},
4555
+ groups_id: {
4556
+ fields: {
4557
+ full_name: {}
4558
+ },
4559
+ limit: 40,
4560
+ order: ""
4561
+ },
4562
+ display_name: {},
4563
+ child_id: {
4564
+ fields: {},
4565
+ limit: 40,
4566
+ order: ""
4567
+ }
4326
4568
  },
4327
- display_name: {},
4328
- child_id: {
4329
- fields: {},
4330
- limit: 40,
4331
- order: ""
4332
- }
4333
- },
4334
- limit: 40,
4335
- order: ""
4336
- }
4337
- },
4338
- limit: 40,
4339
- order: ""
4340
- }
4341
- },
4342
- limit: 40,
4343
- order: ""
4344
- }
4345
- },
4346
- domain: [
4347
- "&",
4348
- ["is_display", "=", true],
4349
- "&",
4350
- ["active", "=", true],
4351
- ["parent_id", "=", false]
4352
- ]
4353
- }
4354
- };
4355
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4356
- headers: {
4357
- "Content-Type": "application/json"
4358
- }
4569
+ limit: 40,
4570
+ order: ""
4571
+ }
4572
+ },
4573
+ limit: 40,
4574
+ order: ""
4575
+ }
4576
+ },
4577
+ limit: 40,
4578
+ order: ""
4579
+ }
4580
+ },
4581
+ domain: [
4582
+ "&",
4583
+ ["is_display", "=", true],
4584
+ "&",
4585
+ ["active", "=", true],
4586
+ ["parent_id", "=", false]
4587
+ ]
4588
+ }
4589
+ };
4590
+ return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4591
+ headers: {
4592
+ "Content-Type": "application/json"
4593
+ }
4594
+ });
4359
4595
  });
4360
4596
  },
4361
- async getActionDetail(aid, context) {
4362
- const env2 = getEnv();
4363
- const jsonData = {
4364
- model: "ir.actions.act_window" /* WINDOW_ACTION */,
4365
- method: "web_read" /* WEB_READ */,
4366
- ids: [aid],
4367
- with_context: context,
4368
- kwargs: {
4369
- specification: {
4370
- id: {},
4371
- name: {},
4372
- res_model: {},
4373
- views: {},
4374
- view_mode: {},
4375
- mobile_view_mode: {},
4376
- domain: {},
4377
- context: {},
4378
- groups_id: {},
4379
- search_view_id: {}
4597
+ getActionDetail(aid, context) {
4598
+ return __async(this, null, function* () {
4599
+ var _a;
4600
+ const env2 = getEnv();
4601
+ const jsonData = {
4602
+ model: "ir.actions.act_window" /* WINDOW_ACTION */,
4603
+ method: "web_read" /* WEB_READ */,
4604
+ ids: [aid],
4605
+ with_context: context,
4606
+ kwargs: {
4607
+ specification: {
4608
+ id: {},
4609
+ name: {},
4610
+ res_model: {},
4611
+ views: {},
4612
+ view_mode: {},
4613
+ mobile_view_mode: {},
4614
+ domain: {},
4615
+ context: {},
4616
+ groups_id: {},
4617
+ search_view_id: {}
4618
+ }
4380
4619
  }
4381
- }
4382
- };
4383
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4384
- headers: {
4385
- "Content-Type": "application/json"
4386
- }
4620
+ };
4621
+ return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4622
+ headers: {
4623
+ "Content-Type": "application/json"
4624
+ }
4625
+ });
4387
4626
  });
4388
4627
  },
4389
- async getResequence({
4390
- model,
4391
- ids,
4392
- context,
4393
- offset
4394
- }) {
4395
- const env2 = getEnv();
4396
- const jsonData = {
4628
+ getResequence(_0) {
4629
+ return __async(this, arguments, function* ({
4397
4630
  model,
4398
- with_context: context,
4399
4631
  ids,
4400
- field: "sequence",
4401
- ...offset > 0 ? { offset } : {}
4402
- };
4403
- return env2?.requests.post("/web/dataset/resequence", jsonData, {
4404
- headers: {
4405
- "Content-Type": "application/json"
4406
- }
4632
+ context,
4633
+ offset
4634
+ }) {
4635
+ const env2 = getEnv();
4636
+ const jsonData = __spreadValues({
4637
+ model,
4638
+ with_context: context,
4639
+ ids,
4640
+ field: "sequence"
4641
+ }, offset > 0 ? { offset } : {});
4642
+ return env2 == null ? void 0 : env2.requests.post("/web/dataset/resequence", jsonData, {
4643
+ headers: {
4644
+ "Content-Type": "application/json"
4645
+ }
4646
+ });
4407
4647
  });
4408
4648
  },
4409
- async getSelectionItem({ data }) {
4410
- const env2 = getEnv();
4411
- const jsonData = {
4412
- model: data.model,
4413
- ids: [],
4414
- method: "get_data_select",
4415
- with_context: data.context,
4416
- kwargs: {
4417
- count_limit: 10001,
4418
- domain: data.domain ? data.domain : [],
4419
- offset: 0,
4420
- order: "",
4421
- specification: data?.specification ?? {
4422
- id: {},
4423
- name: {},
4424
- display_name: {}
4649
+ getSelectionItem(_0) {
4650
+ return __async(this, arguments, function* ({ data }) {
4651
+ var _a;
4652
+ const env2 = getEnv();
4653
+ const jsonData = {
4654
+ model: data.model,
4655
+ ids: [],
4656
+ method: "get_data_select",
4657
+ with_context: data.context,
4658
+ kwargs: {
4659
+ count_limit: 10001,
4660
+ domain: data.domain ? data.domain : [],
4661
+ offset: 0,
4662
+ order: "",
4663
+ specification: (_a = data == null ? void 0 : data.specification) != null ? _a : {
4664
+ id: {},
4665
+ name: {},
4666
+ display_name: {}
4667
+ }
4425
4668
  }
4426
- }
4427
- };
4428
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4429
- headers: {
4430
- "Content-Type": "application/json"
4431
- }
4669
+ };
4670
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4671
+ headers: {
4672
+ "Content-Type": "application/json"
4673
+ }
4674
+ });
4432
4675
  });
4433
4676
  },
4434
- async loadMessages() {
4435
- const env2 = getEnv();
4436
- return env2.requests.post(
4437
- "/load_message_failures" /* LOAD_MESSAGE */,
4438
- {},
4439
- {
4677
+ loadMessages() {
4678
+ return __async(this, null, function* () {
4679
+ const env2 = getEnv();
4680
+ return env2.requests.post(
4681
+ "/load_message_failures" /* LOAD_MESSAGE */,
4682
+ {},
4683
+ {
4684
+ headers: {
4685
+ "Content-Type": "application/json"
4686
+ }
4687
+ }
4688
+ );
4689
+ });
4690
+ },
4691
+ getVersion() {
4692
+ return __async(this, null, function* () {
4693
+ var _a;
4694
+ const env2 = getEnv();
4695
+ console.log("env?.requests", env2, env2 == null ? void 0 : env2.requests);
4696
+ return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.get("", {
4440
4697
  headers: {
4441
4698
  "Content-Type": "application/json"
4442
4699
  }
4443
- }
4444
- );
4445
- },
4446
- async getVersion() {
4447
- const env2 = getEnv();
4448
- return env2?.requests.get("", {
4449
- headers: {
4450
- "Content-Type": "application/json"
4451
- }
4700
+ });
4452
4701
  });
4453
4702
  },
4454
- async get2FAMethods({
4455
- method,
4456
- with_context
4457
- }) {
4458
- const env2 = getEnv();
4459
- const jsonData = {
4703
+ get2FAMethods(_0) {
4704
+ return __async(this, arguments, function* ({
4460
4705
  method,
4461
4706
  with_context
4462
- };
4463
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4464
- headers: {
4465
- "Content-Type": "application/json"
4466
- }
4707
+ }) {
4708
+ const env2 = getEnv();
4709
+ const jsonData = {
4710
+ method,
4711
+ with_context
4712
+ };
4713
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4714
+ headers: {
4715
+ "Content-Type": "application/json"
4716
+ }
4717
+ });
4467
4718
  });
4468
4719
  },
4469
- async verify2FA({
4470
- method,
4471
- with_context,
4472
- code,
4473
- device,
4474
- location
4475
- }) {
4476
- const env2 = getEnv();
4477
- const jsonData = {
4720
+ verify2FA(_0) {
4721
+ return __async(this, arguments, function* ({
4478
4722
  method,
4479
- kwargs: {
4480
- vals: {
4481
- code,
4482
- device,
4483
- location
4484
- }
4485
- },
4486
- with_context
4487
- };
4488
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4489
- headers: {
4490
- "Content-Type": "application/json"
4491
- },
4492
- withCredentials: true
4723
+ with_context,
4724
+ code,
4725
+ device,
4726
+ location
4727
+ }) {
4728
+ const env2 = getEnv();
4729
+ const jsonData = {
4730
+ method,
4731
+ kwargs: {
4732
+ vals: {
4733
+ code,
4734
+ device,
4735
+ location
4736
+ }
4737
+ },
4738
+ with_context
4739
+ };
4740
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4741
+ headers: {
4742
+ "Content-Type": "application/json"
4743
+ },
4744
+ withCredentials: true
4745
+ });
4493
4746
  });
4494
4747
  },
4495
- async signInSSO({
4496
- redirect_uri,
4497
- state,
4498
- client_id,
4499
- response_type,
4500
- path
4501
- }) {
4502
- const env2 = getEnv();
4503
- const params = new URLSearchParams({
4504
- response_type,
4505
- client_id,
4748
+ signInSSO(_0) {
4749
+ return __async(this, arguments, function* ({
4506
4750
  redirect_uri,
4507
- state
4508
- });
4509
- const url = `${path}?${params.toString()}`;
4510
- return env2?.requests.get(url, {
4511
- headers: {
4512
- "Content-Type": "application/json"
4513
- },
4514
- withCredentials: true
4751
+ state,
4752
+ client_id,
4753
+ response_type,
4754
+ path
4755
+ }) {
4756
+ const env2 = getEnv();
4757
+ const params = new URLSearchParams({
4758
+ response_type,
4759
+ client_id,
4760
+ redirect_uri,
4761
+ state
4762
+ });
4763
+ const url = `${path}?${params.toString()}`;
4764
+ return env2 == null ? void 0 : env2.requests.get(url, {
4765
+ headers: {
4766
+ "Content-Type": "application/json"
4767
+ },
4768
+ withCredentials: true
4769
+ });
4515
4770
  });
4516
4771
  },
4517
- async grantAccess({
4518
- redirect_uri,
4519
- state,
4520
- client_id,
4521
- scopes
4522
- }) {
4523
- const env2 = getEnv();
4524
- const jsonData = {
4772
+ grantAccess(_0) {
4773
+ return __async(this, arguments, function* ({
4525
4774
  redirect_uri,
4526
4775
  state,
4527
4776
  client_id,
4528
4777
  scopes
4529
- };
4530
- return env2?.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
4531
- headers: {
4532
- "Content-Type": "application/json"
4533
- },
4534
- withCredentials: true
4778
+ }) {
4779
+ const env2 = getEnv();
4780
+ const jsonData = {
4781
+ redirect_uri,
4782
+ state,
4783
+ client_id,
4784
+ scopes
4785
+ };
4786
+ return env2 == null ? void 0 : env2.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
4787
+ headers: {
4788
+ "Content-Type": "application/json"
4789
+ },
4790
+ withCredentials: true
4791
+ });
4535
4792
  });
4536
4793
  },
4537
- async getFieldsViewSecurity({
4538
- method,
4539
- token,
4540
- views
4541
- }) {
4542
- const env2 = getEnv();
4543
- const jsonData = {
4794
+ getFieldsViewSecurity(_0) {
4795
+ return __async(this, arguments, function* ({
4544
4796
  method,
4545
- kwargs: {
4546
- views
4547
- },
4548
- with_context: {
4549
- token
4550
- }
4551
- };
4552
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4553
- headers: {
4554
- "Content-Type": "application/json"
4555
- }
4797
+ token,
4798
+ views
4799
+ }) {
4800
+ const env2 = getEnv();
4801
+ const jsonData = {
4802
+ method,
4803
+ kwargs: {
4804
+ views
4805
+ },
4806
+ with_context: {
4807
+ token
4808
+ }
4809
+ };
4810
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4811
+ headers: {
4812
+ "Content-Type": "application/json"
4813
+ }
4814
+ });
4556
4815
  });
4557
4816
  },
4558
- async settingsWebRead2fa({
4559
- method,
4560
- model,
4561
- kwargs,
4562
- token
4563
- }) {
4564
- const env2 = getEnv();
4565
- const jsonData = {
4817
+ settingsWebRead2fa(_0) {
4818
+ return __async(this, arguments, function* ({
4566
4819
  method,
4567
4820
  model,
4568
4821
  kwargs,
4569
- with_context: {
4570
- token
4571
- }
4572
- };
4573
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4574
- headers: {
4575
- "Content-Type": "application/json"
4576
- }
4822
+ token
4823
+ }) {
4824
+ const env2 = getEnv();
4825
+ const jsonData = {
4826
+ method,
4827
+ model,
4828
+ kwargs,
4829
+ with_context: {
4830
+ token
4831
+ }
4832
+ };
4833
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4834
+ headers: {
4835
+ "Content-Type": "application/json"
4836
+ }
4837
+ });
4577
4838
  });
4578
4839
  },
4579
- async requestSetupTotp({ method, token }) {
4580
- const env2 = getEnv();
4581
- const jsonData = {
4582
- method,
4583
- with_context: {
4584
- token
4585
- }
4586
- };
4587
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4588
- headers: {
4589
- "Content-Type": "application/json"
4590
- }
4840
+ requestSetupTotp(_0) {
4841
+ return __async(this, arguments, function* ({ method, token }) {
4842
+ const env2 = getEnv();
4843
+ const jsonData = {
4844
+ method,
4845
+ with_context: {
4846
+ token
4847
+ }
4848
+ };
4849
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4850
+ headers: {
4851
+ "Content-Type": "application/json"
4852
+ }
4853
+ });
4591
4854
  });
4592
4855
  },
4593
- async verifyTotp({
4594
- method,
4595
- action_token,
4596
- code
4597
- }) {
4598
- const env2 = getEnv();
4599
- const jsonData = {
4856
+ verifyTotp(_0) {
4857
+ return __async(this, arguments, function* ({
4600
4858
  method,
4601
- kwargs: {
4602
- vals: {
4603
- code
4859
+ action_token,
4860
+ code
4861
+ }) {
4862
+ const env2 = getEnv();
4863
+ const jsonData = {
4864
+ method,
4865
+ kwargs: {
4866
+ vals: {
4867
+ code
4868
+ }
4869
+ },
4870
+ with_context: {
4871
+ action_token
4604
4872
  }
4605
- },
4606
- with_context: {
4607
- action_token
4608
- }
4609
- };
4610
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4611
- headers: {
4612
- "Content-Type": "application/json"
4613
- }
4873
+ };
4874
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4875
+ headers: {
4876
+ "Content-Type": "application/json"
4877
+ }
4878
+ });
4614
4879
  });
4615
4880
  },
4616
- async removeTotpSetUp({ method, token }) {
4617
- const env2 = getEnv();
4618
- const jsonData = {
4619
- method,
4620
- with_context: {
4621
- token
4622
- }
4623
- };
4624
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4625
- headers: {
4626
- "Content-Type": "application/json"
4627
- }
4881
+ removeTotpSetUp(_0) {
4882
+ return __async(this, arguments, function* ({ method, token }) {
4883
+ const env2 = getEnv();
4884
+ const jsonData = {
4885
+ method,
4886
+ with_context: {
4887
+ token
4888
+ }
4889
+ };
4890
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4891
+ headers: {
4892
+ "Content-Type": "application/json"
4893
+ }
4894
+ });
4628
4895
  });
4629
4896
  }
4630
4897
  };
@@ -4632,7 +4899,7 @@ var view_service_default = ViewService;
4632
4899
 
4633
4900
  // src/hooks/auth/use-forgot-password.ts
4634
4901
  var useForgotPassword = () => {
4635
- return useMutation({
4902
+ return (0, import_react_query.useMutation)({
4636
4903
  mutationFn: (email) => {
4637
4904
  return auth_service_default.forgotPassword(email);
4638
4905
  }
@@ -4641,9 +4908,9 @@ var useForgotPassword = () => {
4641
4908
  var use_forgot_password_default = useForgotPassword;
4642
4909
 
4643
4910
  // src/hooks/auth/use-forgotpassword-sso.ts
4644
- import { useMutation as useMutation2 } from "@tanstack/react-query";
4911
+ var import_react_query2 = require("@tanstack/react-query");
4645
4912
  var useForgotPasswordSSO = () => {
4646
- return useMutation2({
4913
+ return (0, import_react_query2.useMutation)({
4647
4914
  mutationFn: ({
4648
4915
  email,
4649
4916
  with_context,
@@ -4656,20 +4923,20 @@ var useForgotPasswordSSO = () => {
4656
4923
  var use_forgotpassword_sso_default = useForgotPasswordSSO;
4657
4924
 
4658
4925
  // src/hooks/auth/use-get-provider.ts
4659
- import { useMutation as useMutation3 } from "@tanstack/react-query";
4926
+ var import_react_query3 = require("@tanstack/react-query");
4660
4927
  var useGetProvider = () => {
4661
- return useMutation3({
4928
+ return (0, import_react_query3.useMutation)({
4662
4929
  mutationFn: (data) => {
4663
- return auth_service_default.getProviders(data?.db);
4930
+ return auth_service_default.getProviders(data == null ? void 0 : data.db);
4664
4931
  }
4665
4932
  });
4666
4933
  };
4667
4934
  var use_get_provider_default = useGetProvider;
4668
4935
 
4669
4936
  // src/hooks/auth/use-isvalid-token.ts
4670
- import { useMutation as useMutation4 } from "@tanstack/react-query";
4937
+ var import_react_query4 = require("@tanstack/react-query");
4671
4938
  var useIsValidToken = () => {
4672
- return useMutation4({
4939
+ return (0, import_react_query4.useMutation)({
4673
4940
  mutationFn: (token) => {
4674
4941
  return auth_service_default.isValidToken(token);
4675
4942
  }
@@ -4678,9 +4945,9 @@ var useIsValidToken = () => {
4678
4945
  var use_isvalid_token_default = useIsValidToken;
4679
4946
 
4680
4947
  // src/hooks/auth/use-login-credential.ts
4681
- import { useMutation as useMutation5 } from "@tanstack/react-query";
4948
+ var import_react_query5 = require("@tanstack/react-query");
4682
4949
  var useLoginCredential = () => {
4683
- return useMutation5({
4950
+ return (0, import_react_query5.useMutation)({
4684
4951
  mutationFn: (data) => {
4685
4952
  return auth_service_default.login(data);
4686
4953
  }
@@ -4689,9 +4956,9 @@ var useLoginCredential = () => {
4689
4956
  var use_login_credential_default = useLoginCredential;
4690
4957
 
4691
4958
  // src/hooks/auth/use-login-socical.ts
4692
- import { useMutation as useMutation6 } from "@tanstack/react-query";
4959
+ var import_react_query6 = require("@tanstack/react-query");
4693
4960
  var useLoginSocial = () => {
4694
- return useMutation6({
4961
+ return (0, import_react_query6.useMutation)({
4695
4962
  mutationFn: (data) => {
4696
4963
  return auth_service_default.loginSocial(data);
4697
4964
  }
@@ -4700,9 +4967,9 @@ var useLoginSocial = () => {
4700
4967
  var use_login_socical_default = useLoginSocial;
4701
4968
 
4702
4969
  // src/hooks/auth/use-reset-password.ts
4703
- import { useMutation as useMutation7 } from "@tanstack/react-query";
4970
+ var import_react_query7 = require("@tanstack/react-query");
4704
4971
  var useResetPassword = () => {
4705
- return useMutation7({
4972
+ return (0, import_react_query7.useMutation)({
4706
4973
  mutationFn: (request) => {
4707
4974
  return auth_service_default.resetPassword(request.data, request.token);
4708
4975
  }
@@ -4711,9 +4978,9 @@ var useResetPassword = () => {
4711
4978
  var use_reset_password_default = useResetPassword;
4712
4979
 
4713
4980
  // src/hooks/auth/use-reset-password-sso.ts
4714
- import { useMutation as useMutation8 } from "@tanstack/react-query";
4981
+ var import_react_query8 = require("@tanstack/react-query");
4715
4982
  var useResetPasswordSSO = () => {
4716
- return useMutation8({
4983
+ return (0, import_react_query8.useMutation)({
4717
4984
  mutationFn: ({
4718
4985
  method,
4719
4986
  password,
@@ -4730,9 +4997,9 @@ var useResetPasswordSSO = () => {
4730
4997
  var use_reset_password_sso_default = useResetPasswordSSO;
4731
4998
 
4732
4999
  // src/hooks/auth/use-update-password.ts
4733
- import { useMutation as useMutation9 } from "@tanstack/react-query";
5000
+ var import_react_query9 = require("@tanstack/react-query");
4734
5001
  var useUpdatePassword = () => {
4735
- return useMutation9({
5002
+ return (0, import_react_query9.useMutation)({
4736
5003
  mutationFn: (request) => {
4737
5004
  return auth_service_default.updatePassword(request.data, request.token);
4738
5005
  }
@@ -4741,9 +5008,9 @@ var useUpdatePassword = () => {
4741
5008
  var use_update_password_default = useUpdatePassword;
4742
5009
 
4743
5010
  // src/hooks/auth/use-logout.ts
4744
- import { useMutation as useMutation10 } from "@tanstack/react-query";
5011
+ var import_react_query10 = require("@tanstack/react-query");
4745
5012
  var useLogout = () => {
4746
- return useMutation10({
5013
+ return (0, import_react_query10.useMutation)({
4747
5014
  mutationFn: (data) => {
4748
5015
  return auth_service_default.logout(data);
4749
5016
  }
@@ -4752,9 +5019,9 @@ var useLogout = () => {
4752
5019
  var use_logout_default = useLogout;
4753
5020
 
4754
5021
  // src/hooks/auth/use-get-access-by-code.ts
4755
- import { useMutation as useMutation11 } from "@tanstack/react-query";
5022
+ var import_react_query11 = require("@tanstack/react-query");
4756
5023
  var useGetAccessByCode = () => {
4757
- return useMutation11({
5024
+ return (0, import_react_query11.useMutation)({
4758
5025
  mutationFn: ({ code }) => {
4759
5026
  return auth_service_default.getAccessByCode(code);
4760
5027
  }
@@ -4763,25 +5030,25 @@ var useGetAccessByCode = () => {
4763
5030
  var use_get_access_by_code_default = useGetAccessByCode;
4764
5031
 
4765
5032
  // src/hooks/company/use-get-company-info.ts
4766
- import { useMutation as useMutation12 } from "@tanstack/react-query";
5033
+ var import_react_query12 = require("@tanstack/react-query");
4767
5034
  var useGetCompanyInfo = () => {
4768
- return useMutation12({
5035
+ return (0, import_react_query12.useMutation)({
4769
5036
  mutationFn: (id) => company_service_default.getInfoCompany(id)
4770
5037
  });
4771
5038
  };
4772
5039
  var use_get_company_info_default = useGetCompanyInfo;
4773
5040
 
4774
5041
  // src/hooks/company/use-get-current-company.ts
4775
- import { useMutation as useMutation13 } from "@tanstack/react-query";
5042
+ var import_react_query13 = require("@tanstack/react-query");
4776
5043
  var useGetCurrentCompany = () => {
4777
- return useMutation13({
5044
+ return (0, import_react_query13.useMutation)({
4778
5045
  mutationFn: () => company_service_default.getCurrentCompany()
4779
5046
  });
4780
5047
  };
4781
5048
  var use_get_current_company_default = useGetCurrentCompany;
4782
5049
 
4783
5050
  // src/hooks/company/use-get-list-company.ts
4784
- import { useQuery } from "@tanstack/react-query";
5051
+ var import_react_query14 = require("@tanstack/react-query");
4785
5052
  var useGetListCompany = (companyIDs = []) => {
4786
5053
  const companySpec = {
4787
5054
  id: {},
@@ -4792,7 +5059,7 @@ var useGetListCompany = (companyIDs = []) => {
4792
5059
  ids: companyIDs,
4793
5060
  specification: companySpec
4794
5061
  };
4795
- return useQuery({
5062
+ return (0, import_react_query14.useQuery)({
4796
5063
  queryKey: ["list_company" /* LIST_COMPANY */, companyIDs],
4797
5064
  queryFn: () => model_service_default.getList(getListParams),
4798
5065
  refetchOnWindowFocus: false
@@ -4801,9 +5068,9 @@ var useGetListCompany = (companyIDs = []) => {
4801
5068
  var use_get_list_company_default = useGetListCompany;
4802
5069
 
4803
5070
  // src/hooks/excel/use-export-excel.ts
4804
- import { useMutation as useMutation14 } from "@tanstack/react-query";
5071
+ var import_react_query15 = require("@tanstack/react-query");
4805
5072
  var useExportExcel = () => {
4806
- return useMutation14({
5073
+ return (0, import_react_query15.useMutation)({
4807
5074
  mutationFn: ({
4808
5075
  model,
4809
5076
  domain,
@@ -4828,9 +5095,9 @@ var useExportExcel = () => {
4828
5095
  var use_export_excel_default = useExportExcel;
4829
5096
 
4830
5097
  // src/hooks/excel/use-get-field-export.ts
4831
- import { useMutation as useMutation15 } from "@tanstack/react-query";
5098
+ var import_react_query16 = require("@tanstack/react-query");
4832
5099
  var useGetFieldExport = () => {
4833
- return useMutation15({
5100
+ return (0, import_react_query16.useMutation)({
4834
5101
  mutationFn: ({
4835
5102
  ids,
4836
5103
  model,
@@ -4859,9 +5126,9 @@ var useGetFieldExport = () => {
4859
5126
  var use_get_field_export_default = useGetFieldExport;
4860
5127
 
4861
5128
  // src/hooks/excel/use-get-file-excel.ts
4862
- import { useQuery as useQuery2 } from "@tanstack/react-query";
5129
+ var import_react_query17 = require("@tanstack/react-query");
4863
5130
  var useGetFileExcel = ({ model }) => {
4864
- return useQuery2({
5131
+ return (0, import_react_query17.useQuery)({
4865
5132
  queryKey: [],
4866
5133
  queryFn: () => excel_service_default.getFileExcel({
4867
5134
  model
@@ -4877,9 +5144,9 @@ var useGetFileExcel = ({ model }) => {
4877
5144
  var use_get_file_excel_default = useGetFileExcel;
4878
5145
 
4879
5146
  // src/hooks/excel/use-parse-preview.ts
4880
- import { useMutation as useMutation16 } from "@tanstack/react-query";
5147
+ var import_react_query18 = require("@tanstack/react-query");
4881
5148
  var useParsePreview = () => {
4882
- return useMutation16({
5149
+ return (0, import_react_query18.useMutation)({
4883
5150
  mutationFn: ({
4884
5151
  id,
4885
5152
  selectedSheet,
@@ -4896,9 +5163,9 @@ var useParsePreview = () => {
4896
5163
  var use_parse_preview_default = useParsePreview;
4897
5164
 
4898
5165
  // src/hooks/excel/use-upload-file.ts
4899
- import { useMutation as useMutation17 } from "@tanstack/react-query";
5166
+ var import_react_query19 = require("@tanstack/react-query");
4900
5167
  var useUploadFile = () => {
4901
- return useMutation17({
5168
+ return (0, import_react_query19.useMutation)({
4902
5169
  mutationFn: ({ formData }) => excel_service_default.uploadFile({
4903
5170
  formData
4904
5171
  })
@@ -4907,9 +5174,9 @@ var useUploadFile = () => {
4907
5174
  var use_upload_file_default = useUploadFile;
4908
5175
 
4909
5176
  // src/hooks/excel/use-upload-id-file.ts
4910
- import { useMutation as useMutation18 } from "@tanstack/react-query";
5177
+ var import_react_query20 = require("@tanstack/react-query");
4911
5178
  var useUploadIdFile = () => {
4912
- return useMutation18({
5179
+ return (0, import_react_query20.useMutation)({
4913
5180
  mutationFn: ({ formData }) => excel_service_default.uploadIdFile({
4914
5181
  formData
4915
5182
  })
@@ -4918,9 +5185,9 @@ var useUploadIdFile = () => {
4918
5185
  var use_upload_id_file_default = useUploadIdFile;
4919
5186
 
4920
5187
  // src/hooks/excel/uss-execute-import.ts
4921
- import { useMutation as useMutation19 } from "@tanstack/react-query";
5188
+ var import_react_query21 = require("@tanstack/react-query");
4922
5189
  var useExecuteImport = () => {
4923
- return useMutation19({
5190
+ return (0, import_react_query21.useMutation)({
4924
5191
  mutationFn: ({
4925
5192
  fields,
4926
5193
  columns,
@@ -4941,9 +5208,9 @@ var useExecuteImport = () => {
4941
5208
  var uss_execute_import_default = useExecuteImport;
4942
5209
 
4943
5210
  // src/hooks/form/use-change-status.ts
4944
- import { useMutation as useMutation20 } from "@tanstack/react-query";
5211
+ var import_react_query22 = require("@tanstack/react-query");
4945
5212
  var useChangeStatus = () => {
4946
- return useMutation20({
5213
+ return (0, import_react_query22.useMutation)({
4947
5214
  mutationFn: ({ data }) => {
4948
5215
  return form_service_default.changeStatus({
4949
5216
  data
@@ -4954,9 +5221,9 @@ var useChangeStatus = () => {
4954
5221
  var use_change_status_default = useChangeStatus;
4955
5222
 
4956
5223
  // src/hooks/form/use-delete-comment.ts
4957
- import { useMutation as useMutation21 } from "@tanstack/react-query";
5224
+ var import_react_query23 = require("@tanstack/react-query");
4958
5225
  var useDeleteComment = () => {
4959
- return useMutation21({
5226
+ return (0, import_react_query23.useMutation)({
4960
5227
  mutationFn: ({ data }) => form_service_default.deleteComment({
4961
5228
  data
4962
5229
  })
@@ -4965,9 +5232,9 @@ var useDeleteComment = () => {
4965
5232
  var use_delete_comment_default = useDeleteComment;
4966
5233
 
4967
5234
  // src/hooks/form/use-get-comment.ts
4968
- import { useQuery as useQuery3 } from "@tanstack/react-query";
5235
+ var import_react_query24 = require("@tanstack/react-query");
4969
5236
  var useGetComment = ({ data, queryKey }) => {
4970
- return useQuery3({
5237
+ return (0, import_react_query24.useQuery)({
4971
5238
  queryKey,
4972
5239
  queryFn: () => form_service_default.getComment({ data }).then((res) => {
4973
5240
  if (res) {
@@ -4981,13 +5248,13 @@ var useGetComment = ({ data, queryKey }) => {
4981
5248
  var use_get_comment_default = useGetComment;
4982
5249
 
4983
5250
  // src/hooks/form/use-get-form-view.ts
4984
- import { useQuery as useQuery4 } from "@tanstack/react-query";
5251
+ var import_react_query25 = require("@tanstack/react-query");
4985
5252
  var useGetFormView = ({
4986
5253
  data,
4987
5254
  queryKey,
4988
5255
  enabled
4989
5256
  }) => {
4990
- return useQuery4({
5257
+ return (0, import_react_query25.useQuery)({
4991
5258
  queryKey,
4992
5259
  queryFn: () => form_service_default.getFormView({ data }).then((res) => {
4993
5260
  if (res) {
@@ -5001,13 +5268,13 @@ var useGetFormView = ({
5001
5268
  var use_get_form_view_default = useGetFormView;
5002
5269
 
5003
5270
  // src/hooks/form/use-get-image.ts
5004
- import { useQuery as useQuery5 } from "@tanstack/react-query";
5271
+ var import_react_query26 = require("@tanstack/react-query");
5005
5272
  var useGetImage = ({
5006
5273
  data,
5007
5274
  queryKey,
5008
5275
  src
5009
5276
  }) => {
5010
- return useQuery5({
5277
+ return (0, import_react_query26.useQuery)({
5011
5278
  queryKey,
5012
5279
  queryFn: () => form_service_default.getImage({ data }).then((res) => {
5013
5280
  if (res) {
@@ -5021,9 +5288,9 @@ var useGetImage = ({
5021
5288
  var use_get_image_default = useGetImage;
5022
5289
 
5023
5290
  // src/hooks/form/use-send-comment.ts
5024
- import { useMutation as useMutation22 } from "@tanstack/react-query";
5291
+ var import_react_query27 = require("@tanstack/react-query");
5025
5292
  var useSendComment = () => {
5026
- return useMutation22({
5293
+ return (0, import_react_query27.useMutation)({
5027
5294
  mutationFn: ({ data }) => form_service_default.sentComment({
5028
5295
  data
5029
5296
  })
@@ -5032,9 +5299,9 @@ var useSendComment = () => {
5032
5299
  var use_send_comment_default = useSendComment;
5033
5300
 
5034
5301
  // src/hooks/form/use-upload-image.ts
5035
- import { useMutation as useMutation23 } from "@tanstack/react-query";
5302
+ var import_react_query28 = require("@tanstack/react-query");
5036
5303
  var useUploadImage = () => {
5037
- return useMutation23({
5304
+ return (0, import_react_query28.useMutation)({
5038
5305
  mutationFn: ({ data }) => form_service_default.uploadImage({
5039
5306
  data
5040
5307
  })
@@ -5043,18 +5310,18 @@ var useUploadImage = () => {
5043
5310
  var use_upload_image_default = useUploadImage;
5044
5311
 
5045
5312
  // src/hooks/model/use-delete.ts
5046
- import { useMutation as useMutation24 } from "@tanstack/react-query";
5313
+ var import_react_query29 = require("@tanstack/react-query");
5047
5314
  var useDelete = () => {
5048
- return useMutation24({
5315
+ return (0, import_react_query29.useMutation)({
5049
5316
  mutationFn: ({ ids, model }) => model_service_default.delete({ ids, model })
5050
5317
  });
5051
5318
  };
5052
5319
  var use_delete_default = useDelete;
5053
5320
 
5054
5321
  // src/hooks/model/use-get-all.ts
5055
- import { useQuery as useQuery6 } from "@tanstack/react-query";
5322
+ var import_react_query30 = require("@tanstack/react-query");
5056
5323
  var useGetAll = ({ data, queryKey, viewResponse }) => {
5057
- return useQuery6({
5324
+ return (0, import_react_query30.useQuery)({
5058
5325
  queryKey,
5059
5326
  queryFn: () => model_service_default.getAll({ data }).then((res) => {
5060
5327
  if (res) {
@@ -5069,9 +5336,9 @@ var useGetAll = ({ data, queryKey, viewResponse }) => {
5069
5336
  var use_get_all_default = useGetAll;
5070
5337
 
5071
5338
  // src/hooks/model/use-get-conversion-rate.ts
5072
- import { useQuery as useQuery7 } from "@tanstack/react-query";
5339
+ var import_react_query31 = require("@tanstack/react-query");
5073
5340
  var useGetConversionRate = () => {
5074
- return useQuery7({
5341
+ return (0, import_react_query31.useQuery)({
5075
5342
  queryKey: ["currency-rate"],
5076
5343
  queryFn: () => model_service_default.getConversionRate().then((res) => {
5077
5344
  if (res) {
@@ -5084,9 +5351,9 @@ var useGetConversionRate = () => {
5084
5351
  var use_get_conversion_rate_default = useGetConversionRate;
5085
5352
 
5086
5353
  // src/hooks/model/use-get-currency.ts
5087
- import { useQuery as useQuery8 } from "@tanstack/react-query";
5354
+ var import_react_query32 = require("@tanstack/react-query");
5088
5355
  var useGetCurrency = () => {
5089
- return useQuery8({
5356
+ return (0, import_react_query32.useQuery)({
5090
5357
  queryKey: ["currency"],
5091
5358
  queryFn: () => model_service_default.getCurrency().then((res) => {
5092
5359
  if (res) {
@@ -5099,9 +5366,9 @@ var useGetCurrency = () => {
5099
5366
  var use_get_currency_default = useGetCurrency;
5100
5367
 
5101
5368
  // src/hooks/model/use-get-detail.ts
5102
- import { useMutation as useMutation25 } from "@tanstack/react-query";
5369
+ var import_react_query33 = require("@tanstack/react-query");
5103
5370
  var useGetDetail = () => {
5104
- return useMutation25({
5371
+ return (0, import_react_query33.useMutation)({
5105
5372
  mutationFn: ({
5106
5373
  model,
5107
5374
  ids,
@@ -5118,9 +5385,9 @@ var useGetDetail = () => {
5118
5385
  var use_get_detail_default = useGetDetail;
5119
5386
 
5120
5387
  // src/hooks/model/use-get-field-onchange.ts
5121
- import { useQuery as useQuery9 } from "@tanstack/react-query";
5388
+ var import_react_query34 = require("@tanstack/react-query");
5122
5389
  var useGetFieldOnChange = ({ model }) => {
5123
- return useQuery9({
5390
+ return (0, import_react_query34.useQuery)({
5124
5391
  queryKey: [`field-onchange-${model}`, model],
5125
5392
  queryFn: () => model_service_default.getListFieldsOnchange({
5126
5393
  model
@@ -5136,13 +5403,13 @@ var useGetFieldOnChange = ({ model }) => {
5136
5403
  var use_get_field_onchange_default = useGetFieldOnChange;
5137
5404
 
5138
5405
  // src/hooks/model/use-get-list-my-bank-account.ts
5139
- import { useQuery as useQuery10 } from "@tanstack/react-query";
5406
+ var import_react_query35 = require("@tanstack/react-query");
5140
5407
  var useGetListMyBankAccount = ({
5141
5408
  domain,
5142
5409
  spectification,
5143
5410
  model
5144
5411
  }) => {
5145
- return useQuery10({
5412
+ return (0, import_react_query35.useQuery)({
5146
5413
  queryKey: ["bank-account", model, domain],
5147
5414
  queryFn: () => model_service_default.getListMyBankAccount({
5148
5415
  domain,
@@ -5160,10 +5427,6 @@ var use_get_list_my_bank_account_default = useGetListMyBankAccount;
5160
5427
 
5161
5428
  // src/models/base-model/index.ts
5162
5429
  var BaseModel = class {
5163
- name;
5164
- view;
5165
- actContext;
5166
- fields;
5167
5430
  constructor(init) {
5168
5431
  this.name = init.name;
5169
5432
  this.view = init.view;
@@ -5178,21 +5441,22 @@ var BaseModel = class {
5178
5441
  modelRoot
5179
5442
  }) {
5180
5443
  if (Array.isArray(fields)) {
5181
- let spec = { ...specification };
5444
+ let spec = __spreadValues({}, specification);
5182
5445
  fields.forEach((field) => {
5183
- if (!field?.type_co || field?.name && field?.type_co === "field" /* FIELD */) {
5184
- if (modelsData?.[model]?.[field?.name]) {
5185
- if (modelsData?.[model]?.[field?.name]?.type === "one2many" /* ONE2MANY */ || modelsData?.[model]?.[field?.name]?.type === "many2many" /* MANY2MANY */) {
5186
- const relation = modelsData?.[model]?.[field?.name]?.relation;
5187
- const modelRelation = modelsData?.[relation];
5446
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
5447
+ if (!(field == null ? void 0 : field.type_co) || (field == null ? void 0 : field.name) && (field == null ? void 0 : field.type_co) === "field" /* FIELD */) {
5448
+ if ((_a = modelsData == null ? void 0 : modelsData[model]) == null ? void 0 : _a[field == null ? void 0 : field.name]) {
5449
+ 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 */) {
5450
+ 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;
5451
+ const modelRelation = modelsData == null ? void 0 : modelsData[relation];
5188
5452
  if (modelRelation) {
5189
- spec[field?.name] = {
5453
+ spec[field == null ? void 0 : field.name] = {
5190
5454
  fields: {}
5191
5455
  };
5192
5456
  if (modelRoot && modelRoot === relation) {
5193
- spec[field?.name].fields = { id: {} };
5457
+ spec[field == null ? void 0 : field.name].fields = { id: {} };
5194
5458
  } else {
5195
- spec[field?.name].fields = this.getSpecificationByFields({
5459
+ spec[field == null ? void 0 : field.name].fields = this.getSpecificationByFields({
5196
5460
  fields: Object.values(modelRelation),
5197
5461
  specification: {},
5198
5462
  modelsData,
@@ -5201,45 +5465,42 @@ var BaseModel = class {
5201
5465
  });
5202
5466
  }
5203
5467
  } else {
5204
- spec[field?.name] = {
5468
+ spec[field == null ? void 0 : field.name] = {
5205
5469
  fields: {
5206
5470
  id: {},
5207
5471
  display_name: {}
5208
5472
  }
5209
5473
  };
5210
5474
  }
5211
- } else if (modelsData?.[model]?.[field?.name]?.type === "many2one" /* MANY2ONE */) {
5212
- spec[field?.name] = {
5213
- fields: {
5475
+ } 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 */) {
5476
+ spec[field == null ? void 0 : field.name] = {
5477
+ fields: __spreadValues(__spreadValues(__spreadValues({
5214
5478
  id: {},
5215
- display_name: {},
5216
- ...WIDGETAVATAR[field?.widget] ? { image_256: {} } : {},
5217
- ...field?.name === "currency_id" && fields?.find((item) => item?.widget === "monetary") ? { symbol: {} } : {},
5218
- ...field?.widget === "many2many_binary" ? { mimetype: {} } : {}
5219
- }
5479
+ display_name: {}
5480
+ }, 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: {} } : {})
5220
5481
  };
5221
5482
  } else {
5222
- spec[field?.name] = {};
5483
+ spec[field == null ? void 0 : field.name] = {};
5223
5484
  }
5224
5485
  }
5225
- } else if (field?.type_co === "group" /* GROUP */ || field?.type_co === "div" /* DIV */ || field?.type_co === "span" /* SPAN */) {
5486
+ } 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 */) {
5226
5487
  const specGroup = this.getSpecificationByFields({
5227
- fields: field?.fields,
5488
+ fields: field == null ? void 0 : field.fields,
5228
5489
  specification: spec,
5229
5490
  modelsData,
5230
5491
  model
5231
5492
  });
5232
- spec = { ...spec, ...specGroup };
5233
- } else if (field?.type_co === "tree" /* TREE */ || field?.type_co === "list" /* LIST */) {
5234
- const relation = modelsData?.[model]?.[field?.name]?.relation;
5493
+ spec = __spreadValues(__spreadValues({}, spec), specGroup);
5494
+ } else if ((field == null ? void 0 : field.type_co) === "tree" /* TREE */ || (field == null ? void 0 : field.type_co) === "list" /* LIST */) {
5495
+ 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;
5235
5496
  const specTreee = this.getSpecificationByFields({
5236
- fields: field?.fields,
5497
+ fields: field == null ? void 0 : field.fields,
5237
5498
  specification: {},
5238
5499
  modelsData,
5239
5500
  model: relation,
5240
5501
  modelRoot: model
5241
5502
  });
5242
- spec = { ...spec, [field?.name]: { fields: specTreee } };
5503
+ spec = __spreadProps(__spreadValues({}, spec), { [field == null ? void 0 : field.name]: { fields: specTreee } });
5243
5504
  }
5244
5505
  });
5245
5506
  return spec;
@@ -5248,16 +5509,19 @@ var BaseModel = class {
5248
5509
  }
5249
5510
  }
5250
5511
  getTreeProps() {
5251
- const props = this.view?.views?.list || {};
5512
+ var _a, _b;
5513
+ const props = ((_b = (_a = this.view) == null ? void 0 : _a.views) == null ? void 0 : _b.list) || {};
5252
5514
  return props;
5253
5515
  }
5254
5516
  getTreeFields() {
5255
- const fields = this.view?.views?.list?.fields || [];
5517
+ var _a, _b, _c;
5518
+ const fields = ((_c = (_b = (_a = this.view) == null ? void 0 : _a.views) == null ? void 0 : _b.list) == null ? void 0 : _c.fields) || [];
5256
5519
  return fields;
5257
5520
  }
5258
5521
  getSpecification() {
5522
+ var _a;
5259
5523
  const specInit = {};
5260
- const modelData = this.view?.models || {};
5524
+ const modelData = ((_a = this.view) == null ? void 0 : _a.models) || {};
5261
5525
  const specification = this.getSpecificationByFields({
5262
5526
  fields: this.fields,
5263
5527
  specification: specInit,
@@ -5273,7 +5537,7 @@ var base_model_default = BaseModel;
5273
5537
  // src/hooks/model/use-model.ts
5274
5538
  var useModel = () => {
5275
5539
  const initModel = (modelData) => {
5276
- switch (modelData?.name) {
5540
+ switch (modelData == null ? void 0 : modelData.name) {
5277
5541
  default:
5278
5542
  return new base_model_default(modelData);
5279
5543
  }
@@ -5294,9 +5558,9 @@ var useOdooDataTransform = () => {
5294
5558
  var use_odoo_data_transform_default = useOdooDataTransform;
5295
5559
 
5296
5560
  // src/hooks/model/use-onchange-form.ts
5297
- import { useMutation as useMutation26 } from "@tanstack/react-query";
5561
+ var import_react_query36 = require("@tanstack/react-query");
5298
5562
  var useOnChangeForm = () => {
5299
- return useMutation26({
5563
+ return (0, import_react_query36.useMutation)({
5300
5564
  mutationFn: ({
5301
5565
  ids,
5302
5566
  model,
@@ -5317,9 +5581,9 @@ var useOnChangeForm = () => {
5317
5581
  var use_onchange_form_default = useOnChangeForm;
5318
5582
 
5319
5583
  // src/hooks/model/use-save.ts
5320
- import { useMutation as useMutation27 } from "@tanstack/react-query";
5584
+ var import_react_query37 = require("@tanstack/react-query");
5321
5585
  var useSave = () => {
5322
- return useMutation27({
5586
+ return (0, import_react_query37.useMutation)({
5323
5587
  mutationFn: ({
5324
5588
  ids,
5325
5589
  model,
@@ -5333,18 +5597,18 @@ var useSave = () => {
5333
5597
  var use_save_default = useSave;
5334
5598
 
5335
5599
  // src/hooks/user/use-get-profile.ts
5336
- import { useMutation as useMutation28 } from "@tanstack/react-query";
5600
+ var import_react_query38 = require("@tanstack/react-query");
5337
5601
  var useGetProfile = (path) => {
5338
- return useMutation28({
5602
+ return (0, import_react_query38.useMutation)({
5339
5603
  mutationFn: () => user_service_default.getProfile(path)
5340
5604
  });
5341
5605
  };
5342
5606
  var use_get_profile_default = useGetProfile;
5343
5607
 
5344
5608
  // src/hooks/user/use-get-user.ts
5345
- import { useMutation as useMutation29 } from "@tanstack/react-query";
5609
+ var import_react_query39 = require("@tanstack/react-query");
5346
5610
  var useGetUser = () => {
5347
- return useMutation29({
5611
+ return (0, import_react_query39.useMutation)({
5348
5612
  mutationFn: ({ id, context }) => user_service_default.getUser({
5349
5613
  id,
5350
5614
  context
@@ -5354,9 +5618,9 @@ var useGetUser = () => {
5354
5618
  var use_get_user_default = useGetUser;
5355
5619
 
5356
5620
  // src/hooks/user/use-switch-locale.ts
5357
- import { useMutation as useMutation30 } from "@tanstack/react-query";
5621
+ var import_react_query40 = require("@tanstack/react-query");
5358
5622
  var useSwitchLocale = () => {
5359
- return useMutation30({
5623
+ return (0, import_react_query40.useMutation)({
5360
5624
  mutationFn: ({ data }) => {
5361
5625
  return user_service_default.switchUserLocale({
5362
5626
  id: data.id,
@@ -5368,9 +5632,9 @@ var useSwitchLocale = () => {
5368
5632
  var use_switch_locale_default = useSwitchLocale;
5369
5633
 
5370
5634
  // src/hooks/view/use-button.ts
5371
- import { useMutation as useMutation31 } from "@tanstack/react-query";
5635
+ var import_react_query41 = require("@tanstack/react-query");
5372
5636
  var useButton = () => {
5373
- return useMutation31({
5637
+ return (0, import_react_query41.useMutation)({
5374
5638
  mutationFn: ({
5375
5639
  model,
5376
5640
  ids,
@@ -5390,9 +5654,9 @@ var useButton = () => {
5390
5654
  var use_button_default = useButton;
5391
5655
 
5392
5656
  // src/hooks/view/use-duplicate-record.ts
5393
- import { useMutation as useMutation32 } from "@tanstack/react-query";
5657
+ var import_react_query42 = require("@tanstack/react-query");
5394
5658
  var useDuplicateRecord = () => {
5395
- return useMutation32({
5659
+ return (0, import_react_query42.useMutation)({
5396
5660
  mutationFn: ({
5397
5661
  id,
5398
5662
  model,
@@ -5407,7 +5671,7 @@ var useDuplicateRecord = () => {
5407
5671
  var use_duplicate_record_default = useDuplicateRecord;
5408
5672
 
5409
5673
  // src/hooks/view/use-get-action-detail.ts
5410
- import { useQuery as useQuery11 } from "@tanstack/react-query";
5674
+ var import_react_query43 = require("@tanstack/react-query");
5411
5675
  var useGetActionDetail = ({
5412
5676
  aid,
5413
5677
  context,
@@ -5418,22 +5682,22 @@ var useGetActionDetail = ({
5418
5682
  }) => {
5419
5683
  const data = {
5420
5684
  id,
5421
- model: model ?? "",
5685
+ model: model != null ? model : "",
5422
5686
  context
5423
5687
  };
5424
- return useQuery11({
5688
+ return (0, import_react_query43.useQuery)({
5425
5689
  queryKey,
5426
- queryFn: async () => {
5690
+ queryFn: () => __async(null, null, function* () {
5427
5691
  if (aid) {
5428
- const res = await view_service_default.getActionDetail(aid, context);
5692
+ const res = yield view_service_default.getActionDetail(aid, context);
5429
5693
  if (res && res.length > 0) {
5430
5694
  return res[0];
5431
5695
  }
5432
5696
  } else {
5433
- const res = await form_service_default.getFormView({ data });
5697
+ const res = yield form_service_default.getFormView({ data });
5434
5698
  return res;
5435
5699
  }
5436
- },
5700
+ }),
5437
5701
  enabled,
5438
5702
  refetchOnWindowFocus: false,
5439
5703
  staleTime: Infinity
@@ -5442,9 +5706,9 @@ var useGetActionDetail = ({
5442
5706
  var use_get_action_detail_default = useGetActionDetail;
5443
5707
 
5444
5708
  // src/hooks/view/use-get-calendar.ts
5445
- import { useQuery as useQuery12 } from "@tanstack/react-query";
5709
+ var import_react_query44 = require("@tanstack/react-query");
5446
5710
  var useGetCalendar = (listDataProps, queryKey, enabled) => {
5447
- return useQuery12({
5711
+ return (0, import_react_query44.useQuery)({
5448
5712
  queryKey,
5449
5713
  queryFn: () => model_service_default.getListCalendar({ data: listDataProps }).then((res) => {
5450
5714
  if (res) {
@@ -5460,12 +5724,12 @@ var useGetCalendar = (listDataProps, queryKey, enabled) => {
5460
5724
  var use_get_calendar_default = useGetCalendar;
5461
5725
 
5462
5726
  // src/hooks/view/use-get-groups.ts
5463
- import { useQuery as useQuery13 } from "@tanstack/react-query";
5727
+ var import_react_query45 = require("@tanstack/react-query");
5464
5728
  var useGetGroups = ({
5465
5729
  model,
5466
5730
  width_context
5467
5731
  }) => {
5468
- return useQuery13({
5732
+ return (0, import_react_query45.useQuery)({
5469
5733
  queryKey: [model, width_context],
5470
5734
  queryFn: () => kanban_service_default.getGroups({
5471
5735
  model,
@@ -5482,9 +5746,9 @@ var useGetGroups = ({
5482
5746
  var use_get_groups_default = useGetGroups;
5483
5747
 
5484
5748
  // src/hooks/view/use-get-list-data.ts
5485
- import { useQuery as useQuery14 } from "@tanstack/react-query";
5749
+ var import_react_query46 = require("@tanstack/react-query");
5486
5750
  var useGetListData = (listDataProps, queryKey, enabled) => {
5487
- return useQuery14({
5751
+ return (0, import_react_query46.useQuery)({
5488
5752
  queryKey,
5489
5753
  queryFn: () => model_service_default.getAll({ data: listDataProps }).then((res) => {
5490
5754
  if (res) {
@@ -5500,13 +5764,14 @@ var useGetListData = (listDataProps, queryKey, enabled) => {
5500
5764
  var use_get_list_data_default = useGetListData;
5501
5765
 
5502
5766
  // src/hooks/view/use-get-menu.ts
5503
- import { useQuery as useQuery15 } from "@tanstack/react-query";
5767
+ var import_react_query47 = require("@tanstack/react-query");
5504
5768
  var useGetMenu = (context, enabled) => {
5505
- return useQuery15({
5769
+ return (0, import_react_query47.useQuery)({
5506
5770
  queryKey: ["menus" /* MENU */, context],
5507
5771
  queryFn: () => view_service_default.getMenu(context).then((res) => {
5508
- if (res && res?.records && res?.records?.length > 0) {
5509
- return res?.records;
5772
+ var _a;
5773
+ if (res && (res == null ? void 0 : res.records) && ((_a = res == null ? void 0 : res.records) == null ? void 0 : _a.length) > 0) {
5774
+ return res == null ? void 0 : res.records;
5510
5775
  }
5511
5776
  return [];
5512
5777
  }),
@@ -5518,9 +5783,9 @@ var useGetMenu = (context, enabled) => {
5518
5783
  var use_get_menu_default = useGetMenu;
5519
5784
 
5520
5785
  // src/hooks/view/use-get-print-report.ts
5521
- import { useMutation as useMutation33 } from "@tanstack/react-query";
5786
+ var import_react_query48 = require("@tanstack/react-query");
5522
5787
  var useGetPrintReport = () => {
5523
- return useMutation33({
5788
+ return (0, import_react_query48.useMutation)({
5524
5789
  mutationFn: ({ id }) => action_service_default.getPrintReportName({
5525
5790
  id
5526
5791
  })
@@ -5529,14 +5794,14 @@ var useGetPrintReport = () => {
5529
5794
  var use_get_print_report_default = useGetPrintReport;
5530
5795
 
5531
5796
  // src/hooks/view/use-get-progress-bar.ts
5532
- import { useQuery as useQuery16 } from "@tanstack/react-query";
5797
+ var import_react_query49 = require("@tanstack/react-query");
5533
5798
  var useGetProGressBar = ({
5534
5799
  field,
5535
5800
  color,
5536
5801
  model,
5537
5802
  width_context
5538
5803
  }) => {
5539
- return useQuery16({
5804
+ return (0, import_react_query49.useQuery)({
5540
5805
  queryKey: [],
5541
5806
  queryFn: () => kanban_service_default.getProgressBar({
5542
5807
  field,
@@ -5555,13 +5820,13 @@ var useGetProGressBar = ({
5555
5820
  var use_get_progress_bar_default = useGetProGressBar;
5556
5821
 
5557
5822
  // src/hooks/view/use-get-selection.ts
5558
- import { useQuery as useQuery17 } from "@tanstack/react-query";
5823
+ var import_react_query50 = require("@tanstack/react-query");
5559
5824
  var useGetSelection = ({
5560
5825
  data,
5561
5826
  queryKey,
5562
5827
  enabled
5563
5828
  }) => {
5564
- return useQuery17({
5829
+ return (0, import_react_query50.useQuery)({
5565
5830
  queryKey,
5566
5831
  queryFn: () => view_service_default.getSelectionItem({ data }),
5567
5832
  enabled,
@@ -5571,9 +5836,9 @@ var useGetSelection = ({
5571
5836
  var use_get_selection_default = useGetSelection;
5572
5837
 
5573
5838
  // src/hooks/view/use-get-view.ts
5574
- import { useQuery as useQuery18 } from "@tanstack/react-query";
5839
+ var import_react_query51 = require("@tanstack/react-query");
5575
5840
  var useGetView = (viewParams, actData) => {
5576
- return useQuery18({
5841
+ return (0, import_react_query51.useQuery)({
5577
5842
  queryKey: ["get_view_by_action" /* GET_VIEW_BY_ACTION */, viewParams],
5578
5843
  queryFn: () => view_service_default.getView(viewParams),
5579
5844
  enabled: !!actData,
@@ -5584,9 +5849,9 @@ var useGetView = (viewParams, actData) => {
5584
5849
  var use_get_view_default = useGetView;
5585
5850
 
5586
5851
  // src/hooks/view/use-load-action.ts
5587
- import { useMutation as useMutation34 } from "@tanstack/react-query";
5852
+ var import_react_query52 = require("@tanstack/react-query");
5588
5853
  var useLoadAction = () => {
5589
- return useMutation34({
5854
+ return (0, import_react_query52.useMutation)({
5590
5855
  mutationFn: ({
5591
5856
  idAction,
5592
5857
  context
@@ -5601,9 +5866,9 @@ var useLoadAction = () => {
5601
5866
  var use_load_action_default = useLoadAction;
5602
5867
 
5603
5868
  // src/hooks/view/use-load-message.ts
5604
- import { useQuery as useQuery19 } from "@tanstack/react-query";
5869
+ var import_react_query53 = require("@tanstack/react-query");
5605
5870
  var useLoadMessage = () => {
5606
- return useQuery19({
5871
+ return (0, import_react_query53.useQuery)({
5607
5872
  queryKey: [`load-message-failure`],
5608
5873
  queryFn: () => view_service_default.loadMessages(),
5609
5874
  refetchOnWindowFocus: false
@@ -5612,9 +5877,9 @@ var useLoadMessage = () => {
5612
5877
  var use_load_message_default = useLoadMessage;
5613
5878
 
5614
5879
  // src/hooks/view/use-print.ts
5615
- import { useMutation as useMutation35 } from "@tanstack/react-query";
5880
+ var import_react_query54 = require("@tanstack/react-query");
5616
5881
  var usePrint = () => {
5617
- return useMutation35({
5882
+ return (0, import_react_query54.useMutation)({
5618
5883
  mutationFn: ({ id, report, db }) => action_service_default.print({
5619
5884
  id,
5620
5885
  report,
@@ -5625,9 +5890,9 @@ var usePrint = () => {
5625
5890
  var use_print_default = usePrint;
5626
5891
 
5627
5892
  // src/hooks/view/use-remove-row.ts
5628
- import { useMutation as useMutation36 } from "@tanstack/react-query";
5893
+ var import_react_query55 = require("@tanstack/react-query");
5629
5894
  var useRemoveRow = () => {
5630
- return useMutation36({
5895
+ return (0, import_react_query55.useMutation)({
5631
5896
  mutationFn: ({
5632
5897
  model,
5633
5898
  ids,
@@ -5642,9 +5907,9 @@ var useRemoveRow = () => {
5642
5907
  var use_remove_row_default = useRemoveRow;
5643
5908
 
5644
5909
  // src/hooks/view/use-resequence.ts
5645
- import { useQuery as useQuery20 } from "@tanstack/react-query";
5910
+ var import_react_query56 = require("@tanstack/react-query");
5646
5911
  var useGetResequence = (model, resIds, context, offset) => {
5647
- return useQuery20({
5912
+ return (0, import_react_query56.useQuery)({
5648
5913
  queryKey: [],
5649
5914
  queryFn: () => view_service_default.getResequence({
5650
5915
  model,
@@ -5659,9 +5924,9 @@ var useGetResequence = (model, resIds, context, offset) => {
5659
5924
  var use_resequence_default = useGetResequence;
5660
5925
 
5661
5926
  // src/hooks/view/use-run-action.ts
5662
- import { useMutation as useMutation37 } from "@tanstack/react-query";
5927
+ var import_react_query57 = require("@tanstack/react-query");
5663
5928
  var useRunAction = () => {
5664
- return useMutation37({
5929
+ return (0, import_react_query57.useMutation)({
5665
5930
  mutationFn: ({
5666
5931
  idAction,
5667
5932
  context
@@ -5674,9 +5939,9 @@ var useRunAction = () => {
5674
5939
  var use_run_action_default = useRunAction;
5675
5940
 
5676
5941
  // src/hooks/view/use-signin-sso.ts
5677
- import { useMutation as useMutation38 } from "@tanstack/react-query";
5942
+ var import_react_query58 = require("@tanstack/react-query");
5678
5943
  var useSignInSSO = () => {
5679
- return useMutation38({
5944
+ return (0, import_react_query58.useMutation)({
5680
5945
  mutationFn: ({
5681
5946
  redirect_uri,
5682
5947
  state,
@@ -5697,9 +5962,9 @@ var useSignInSSO = () => {
5697
5962
  var use_signin_sso_default = useSignInSSO;
5698
5963
 
5699
5964
  // src/hooks/view/use-verify-2FA.ts
5700
- import { useMutation as useMutation39 } from "@tanstack/react-query";
5965
+ var import_react_query59 = require("@tanstack/react-query");
5701
5966
  var useVerify2FA = () => {
5702
- return useMutation39({
5967
+ return (0, import_react_query59.useMutation)({
5703
5968
  mutationFn: ({
5704
5969
  method,
5705
5970
  with_context,
@@ -5720,9 +5985,9 @@ var useVerify2FA = () => {
5720
5985
  var use_verify_2FA_default = useVerify2FA;
5721
5986
 
5722
5987
  // src/hooks/view/uset-get-2FA-method.ts
5723
- import { useMutation as useMutation40 } from "@tanstack/react-query";
5988
+ var import_react_query60 = require("@tanstack/react-query");
5724
5989
  var useGet2FAMethods = () => {
5725
- return useMutation40({
5990
+ return (0, import_react_query60.useMutation)({
5726
5991
  mutationFn: ({
5727
5992
  method,
5728
5993
  with_context
@@ -5737,9 +6002,9 @@ var useGet2FAMethods = () => {
5737
6002
  var uset_get_2FA_method_default = useGet2FAMethods;
5738
6003
 
5739
6004
  // src/hooks/view/use-get-fields-view-security.ts
5740
- import { useMutation as useMutation41 } from "@tanstack/react-query";
6005
+ var import_react_query61 = require("@tanstack/react-query");
5741
6006
  var useGetFieldsViewSecurity = () => {
5742
- return useMutation41({
6007
+ return (0, import_react_query61.useMutation)({
5743
6008
  mutationFn: ({
5744
6009
  method,
5745
6010
  token,
@@ -5756,9 +6021,9 @@ var useGetFieldsViewSecurity = () => {
5756
6021
  var use_get_fields_view_security_default = useGetFieldsViewSecurity;
5757
6022
 
5758
6023
  // src/hooks/view/use-grant-access.ts
5759
- import { useMutation as useMutation42 } from "@tanstack/react-query";
6024
+ var import_react_query62 = require("@tanstack/react-query");
5760
6025
  var useGrantAccess = () => {
5761
- return useMutation42({
6026
+ return (0, import_react_query62.useMutation)({
5762
6027
  mutationFn: ({
5763
6028
  redirect_uri,
5764
6029
  state,
@@ -5777,9 +6042,9 @@ var useGrantAccess = () => {
5777
6042
  var use_grant_access_default = useGrantAccess;
5778
6043
 
5779
6044
  // src/hooks/view/use-remove-totp-setup.ts
5780
- import { useMutation as useMutation43 } from "@tanstack/react-query";
6045
+ var import_react_query63 = require("@tanstack/react-query");
5781
6046
  var useRemoveTotpSetup = () => {
5782
- return useMutation43({
6047
+ return (0, import_react_query63.useMutation)({
5783
6048
  mutationFn: ({ method, token }) => {
5784
6049
  return view_service_default.removeTotpSetUp({
5785
6050
  method,
@@ -5791,9 +6056,9 @@ var useRemoveTotpSetup = () => {
5791
6056
  var use_remove_totp_setup_default = useRemoveTotpSetup;
5792
6057
 
5793
6058
  // src/hooks/view/use-request-setup-totp.ts
5794
- import { useMutation as useMutation44 } from "@tanstack/react-query";
6059
+ var import_react_query64 = require("@tanstack/react-query");
5795
6060
  var useRequestSetupTotp = () => {
5796
- return useMutation44({
6061
+ return (0, import_react_query64.useMutation)({
5797
6062
  mutationFn: ({ method, token }) => {
5798
6063
  return view_service_default.requestSetupTotp({
5799
6064
  method,
@@ -5805,9 +6070,9 @@ var useRequestSetupTotp = () => {
5805
6070
  var use_request_setup_totp_default = useRequestSetupTotp;
5806
6071
 
5807
6072
  // src/hooks/view/use-settings-web-read-2fa.ts
5808
- import { useMutation as useMutation45 } from "@tanstack/react-query";
6073
+ var import_react_query65 = require("@tanstack/react-query");
5809
6074
  var useSettingsWebRead2fa = () => {
5810
- return useMutation45({
6075
+ return (0, import_react_query65.useMutation)({
5811
6076
  mutationFn: ({
5812
6077
  method,
5813
6078
  token,
@@ -5826,9 +6091,9 @@ var useSettingsWebRead2fa = () => {
5826
6091
  var use_settings_web_read_2fa_default = useSettingsWebRead2fa;
5827
6092
 
5828
6093
  // src/hooks/view/use-verify-totp.ts
5829
- import { useMutation as useMutation46 } from "@tanstack/react-query";
6094
+ var import_react_query66 = require("@tanstack/react-query");
5830
6095
  var useVerifyTotp = () => {
5831
- return useMutation46({
6096
+ return (0, import_react_query66.useMutation)({
5832
6097
  mutationFn: ({
5833
6098
  method,
5834
6099
  action_token,
@@ -5843,73 +6108,74 @@ var useVerifyTotp = () => {
5843
6108
  });
5844
6109
  };
5845
6110
  var use_verify_totp_default = useVerifyTotp;
5846
- export {
5847
- use_button_default as useButton,
5848
- use_change_status_default as useChangeStatus,
5849
- use_delete_default as useDelete,
5850
- use_delete_comment_default as useDeleteComment,
5851
- use_duplicate_record_default as useDuplicateRecord,
5852
- uss_execute_import_default as useExecuteImport,
5853
- use_export_excel_default as useExportExcel,
5854
- use_forgot_password_default as useForgotPassword,
5855
- use_forgotpassword_sso_default as useForgotPasswordSSO,
5856
- uset_get_2FA_method_default as useGet2FAMethods,
5857
- use_get_access_by_code_default as useGetAccessByCode,
5858
- use_get_action_detail_default as useGetActionDetail,
5859
- use_get_all_default as useGetAll,
5860
- use_get_calendar_default as useGetCalendar,
5861
- use_get_comment_default as useGetComment,
5862
- use_get_company_info_default as useGetCompanyInfo,
5863
- use_get_conversion_rate_default as useGetConversionRate,
5864
- use_get_currency_default as useGetCurrency,
5865
- use_get_current_company_default as useGetCurrentCompany,
5866
- use_get_detail_default as useGetDetail,
5867
- use_get_field_export_default as useGetFieldExport,
5868
- use_get_field_onchange_default as useGetFieldOnChange,
5869
- use_get_fields_view_security_default as useGetFieldsViewSecurity,
5870
- use_get_file_excel_default as useGetFileExcel,
5871
- use_get_form_view_default as useGetFormView,
5872
- use_get_groups_default as useGetGroups,
5873
- use_get_image_default as useGetImage,
5874
- use_get_list_company_default as useGetListCompany,
5875
- use_get_list_data_default as useGetListData,
5876
- use_get_list_my_bank_account_default as useGetListMyBankAccount,
5877
- use_get_menu_default as useGetMenu,
5878
- use_get_print_report_default as useGetPrintReport,
5879
- use_get_progress_bar_default as useGetProGressBar,
5880
- use_get_profile_default as useGetProfile,
5881
- use_get_provider_default as useGetProvider,
5882
- use_resequence_default as useGetResequence,
5883
- use_get_selection_default as useGetSelection,
5884
- use_get_user_default as useGetUser,
5885
- use_get_view_default as useGetView,
5886
- use_grant_access_default as useGrantAccess,
5887
- use_isvalid_token_default as useIsValidToken,
5888
- use_load_action_default as useLoadAction,
5889
- use_load_message_default as useLoadMessage,
5890
- use_login_credential_default as useLoginCredential,
5891
- use_login_socical_default as useLoginSocial,
5892
- use_logout_default as useLogout,
5893
- use_model_default as useModel,
5894
- use_odoo_data_transform_default as useOdooDataTransform,
5895
- use_onchange_form_default as useOnChangeForm,
5896
- use_parse_preview_default as useParsePreview,
5897
- use_print_default as usePrint,
5898
- use_remove_row_default as useRemoveRow,
5899
- use_remove_totp_setup_default as useRemoveTotpSetup,
5900
- use_request_setup_totp_default as useRequestSetupTotp,
5901
- use_reset_password_default as useResetPassword,
5902
- use_reset_password_sso_default as useResetPasswordSSO,
5903
- use_run_action_default as useRunAction,
5904
- use_save_default as useSave,
5905
- use_send_comment_default as useSendComment,
5906
- use_settings_web_read_2fa_default as useSettingsWebRead2fa,
5907
- use_signin_sso_default as useSignInSSO,
5908
- use_switch_locale_default as useSwitchLocale,
5909
- use_update_password_default as useUpdatePassword,
5910
- use_upload_file_default as useUploadFile,
5911
- use_upload_id_file_default as useUploadIdFile,
5912
- use_upload_image_default as useUploadImage,
5913
- use_verify_2FA_default as useVerify2FA,
5914
- use_verify_totp_default as useVerifyTotp
5915
- };
6111
+ // Annotate the CommonJS export names for ESM import in node:
6112
+ 0 && (module.exports = {
6113
+ useButton,
6114
+ useChangeStatus,
6115
+ useDelete,
6116
+ useDeleteComment,
6117
+ useDuplicateRecord,
6118
+ useExecuteImport,
6119
+ useExportExcel,
6120
+ useForgotPassword,
6121
+ useForgotPasswordSSO,
6122
+ useGet2FAMethods,
6123
+ useGetAccessByCode,
6124
+ useGetActionDetail,
6125
+ useGetAll,
6126
+ useGetCalendar,
6127
+ useGetComment,
6128
+ useGetCompanyInfo,
6129
+ useGetConversionRate,
6130
+ useGetCurrency,
6131
+ useGetCurrentCompany,
6132
+ useGetDetail,
6133
+ useGetFieldExport,
6134
+ useGetFieldOnChange,
6135
+ useGetFieldsViewSecurity,
6136
+ useGetFileExcel,
6137
+ useGetFormView,
6138
+ useGetGroups,
6139
+ useGetImage,
6140
+ useGetListCompany,
6141
+ useGetListData,
6142
+ useGetListMyBankAccount,
6143
+ useGetMenu,
6144
+ useGetPrintReport,
6145
+ useGetProGressBar,
6146
+ useGetProfile,
6147
+ useGetProvider,
6148
+ useGetResequence,
6149
+ useGetSelection,
6150
+ useGetUser,
6151
+ useGetView,
6152
+ useGrantAccess,
6153
+ useIsValidToken,
6154
+ useLoadAction,
6155
+ useLoadMessage,
6156
+ useLoginCredential,
6157
+ useLoginSocial,
6158
+ useLogout,
6159
+ useModel,
6160
+ useOdooDataTransform,
6161
+ useOnChangeForm,
6162
+ useParsePreview,
6163
+ usePrint,
6164
+ useRemoveRow,
6165
+ useRemoveTotpSetup,
6166
+ useRequestSetupTotp,
6167
+ useResetPassword,
6168
+ useResetPasswordSSO,
6169
+ useRunAction,
6170
+ useSave,
6171
+ useSendComment,
6172
+ useSettingsWebRead2fa,
6173
+ useSignInSSO,
6174
+ useSwitchLocale,
6175
+ useUpdatePassword,
6176
+ useUploadFile,
6177
+ useUploadIdFile,
6178
+ useUploadImage,
6179
+ useVerify2FA,
6180
+ useVerifyTotp
6181
+ });