@fctc/interface-logic 1.7.2 → 1.7.3

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