@fctc/interface-logic 1.5.7 → 1.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/{configs.d.cts → configs.d.mts} +1 -2
  2. package/dist/configs.d.ts +0 -1
  3. package/dist/configs.js +146 -124
  4. package/dist/{configs.cjs → configs.mjs} +111 -161
  5. package/dist/constants.js +41 -2
  6. package/dist/{constants.cjs → constants.mjs} +2 -40
  7. package/dist/{environment.d.cts → environment.d.mts} +1 -4
  8. package/dist/environment.d.ts +1 -4
  9. package/dist/environment.js +207 -189
  10. package/dist/{environment.cjs → environment.mjs} +172 -230
  11. package/dist/{hooks.d.cts → hooks.d.mts} +7 -2
  12. package/dist/hooks.d.ts +6 -1
  13. package/dist/hooks.js +1771 -1807
  14. package/dist/{hooks.cjs → hooks.mjs} +1674 -1915
  15. package/dist/{provider.d.cts → provider.d.mts} +1 -1
  16. package/dist/provider.d.ts +1 -1
  17. package/dist/provider.js +608 -629
  18. package/dist/{provider.cjs → provider.mjs} +574 -669
  19. package/dist/{services.d.cts → services.d.mts} +2 -1
  20. package/dist/services.d.ts +1 -0
  21. package/dist/services.js +1467 -1580
  22. package/dist/{services.cjs → services.mjs} +1428 -1627
  23. package/dist/{store.d.cts → store.d.mts} +155 -127
  24. package/dist/store.d.ts +155 -127
  25. package/dist/store.js +131 -41
  26. package/dist/{store.cjs → store.mjs} +30 -146
  27. package/dist/{types.d.cts → types.d.mts} +1 -1
  28. package/dist/types.js +18 -0
  29. package/dist/types.mjs +0 -0
  30. package/dist/{utils.d.cts → utils.d.mts} +2 -2
  31. package/dist/utils.d.ts +2 -2
  32. package/dist/utils.js +176 -135
  33. package/dist/{utils.cjs → utils.mjs} +115 -202
  34. package/package.json +81 -82
  35. package/dist/types.cjs +0 -17
  36. /package/dist/{constants.d.cts → constants.d.mts} +0 -0
  37. /package/dist/{view-type-BGJfDe73.d.cts → view-type-BGJfDe73.d.mts} +0 -0
@@ -1,84 +1,3 @@
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/services.ts
68
- var services_exports = {};
69
- __export(services_exports, {
70
- ActionService: () => action_service_default,
71
- AuthService: () => auth_service_default,
72
- CompanyService: () => company_service_default,
73
- ExcelService: () => excel_service_default,
74
- FormService: () => form_service_default,
75
- KanbanService: () => kanban_service_default,
76
- ModelService: () => model_service_default,
77
- UserService: () => user_service_default,
78
- ViewService: () => view_service_default
79
- });
80
- module.exports = __toCommonJS(services_exports);
81
-
82
1
  // src/constants/api/uri-constant.ts
83
2
  var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
84
3
  UriConstants2["AUTH_TOKEN_PATH"] = "/authentication/oauth2/token";
@@ -110,10 +29,10 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
110
29
  })(UriConstants || {});
111
30
 
112
31
  // src/configs/axios-client.ts
113
- var import_axios = __toESM(require("axios"), 1);
32
+ import axios from "axios";
114
33
 
115
34
  // src/utils/format.ts
116
- var import_moment = __toESM(require("moment"), 1);
35
+ import moment from "moment";
117
36
 
118
37
  // src/utils/domain/py_tokenizer.ts
119
38
  var TokenizerError = class extends Error {
@@ -1193,6 +1112,22 @@ var PyRelativeDelta = class _PyRelativeDelta {
1193
1112
  this.microsecond = params.microsecond;
1194
1113
  this.weekday = params.weekday;
1195
1114
  }
1115
+ years;
1116
+ months;
1117
+ days;
1118
+ hours;
1119
+ minutes;
1120
+ seconds;
1121
+ microseconds;
1122
+ leapDays;
1123
+ year;
1124
+ month;
1125
+ day;
1126
+ hour;
1127
+ minute;
1128
+ second;
1129
+ microsecond;
1130
+ weekday;
1196
1131
  negate() {
1197
1132
  return new _PyRelativeDelta(this, -1);
1198
1133
  }
@@ -1307,7 +1242,7 @@ function execOnIterable(iterable, func) {
1307
1242
  if (typeof iterable === "object" && !Array.isArray(iterable) && !(iterable instanceof Set)) {
1308
1243
  iterable = Object.keys(iterable);
1309
1244
  }
1310
- if (typeof (iterable == null ? void 0 : iterable[Symbol.iterator]) !== "function") {
1245
+ if (typeof iterable?.[Symbol.iterator] !== "function") {
1311
1246
  throw new EvaluationError("value not iterable");
1312
1247
  }
1313
1248
  return func(iterable);
@@ -1630,7 +1565,7 @@ function applyBinaryOp(ast, context) {
1630
1565
  }
1631
1566
  return Math.floor(left / right);
1632
1567
  case "**":
1633
- return __pow(left, right);
1568
+ return left ** right;
1634
1569
  case "==":
1635
1570
  return isEqual(left, right);
1636
1571
  case "<>":
@@ -1752,7 +1687,7 @@ function evaluate(ast, context = {}) {
1752
1687
  const dicts = /* @__PURE__ */ new Set();
1753
1688
  let pyContext;
1754
1689
  const evalContext = Object.create(context);
1755
- if (!(evalContext == null ? void 0 : evalContext.context)) {
1690
+ if (!evalContext?.context) {
1756
1691
  Object.defineProperty(evalContext, "context", {
1757
1692
  get() {
1758
1693
  if (!pyContext) {
@@ -1763,18 +1698,17 @@ function evaluate(ast, context = {}) {
1763
1698
  });
1764
1699
  }
1765
1700
  function _innerEvaluate(ast2) {
1766
- var _a, _b, _c;
1767
- switch (ast2 == null ? void 0 : ast2.type) {
1701
+ switch (ast2?.type) {
1768
1702
  case 0:
1769
1703
  // Number
1770
1704
  case 1:
1771
1705
  return ast2.value;
1772
1706
  case 5:
1773
1707
  if (ast2.value in evalContext) {
1774
- if (typeof evalContext[ast2.value] === "object" && ((_a = evalContext[ast2.value]) == null ? void 0 : _a.id)) {
1775
- return (_b = evalContext[ast2.value]) == null ? void 0 : _b.id;
1708
+ if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
1709
+ return evalContext[ast2.value]?.id;
1776
1710
  }
1777
- return (_c = evalContext[ast2.value]) != null ? _c : false;
1711
+ return evalContext[ast2.value] ?? false;
1778
1712
  } else if (ast2.value in BUILTINS) {
1779
1713
  return BUILTINS[ast2.value];
1780
1714
  } else {
@@ -1811,7 +1745,7 @@ function evaluate(ast, context = {}) {
1811
1745
  const args = ast2.args.map(_evaluate);
1812
1746
  const kwargs = {};
1813
1747
  for (const kwarg in ast2.kwargs) {
1814
- kwargs[kwarg] = _evaluate(ast2 == null ? void 0 : ast2.kwargs[kwarg]);
1748
+ kwargs[kwarg] = _evaluate(ast2?.kwargs[kwarg]);
1815
1749
  }
1816
1750
  if (fnValue === PyDate || fnValue === PyDateTime || fnValue === PyTime || fnValue === PyRelativeDelta || fnValue === PyTimeDelta) {
1817
1751
  return fnValue.create(...args, kwargs);
@@ -1890,25 +1824,9 @@ function escapeRegExp(str) {
1890
1824
  var InvalidDomainError = class extends Error {
1891
1825
  };
1892
1826
  var Domain = class _Domain {
1893
- constructor(descr = []) {
1894
- this.ast = { type: -1, value: null };
1895
- if (descr instanceof _Domain) {
1896
- return new _Domain(descr.toString());
1897
- } else {
1898
- let rawAST;
1899
- try {
1900
- rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
1901
- } catch (error) {
1902
- throw new InvalidDomainError(
1903
- `Invalid domain representation: ${descr}`,
1904
- {
1905
- cause: error
1906
- }
1907
- );
1908
- }
1909
- this.ast = normalizeDomainAST(rawAST);
1910
- }
1911
- }
1827
+ ast = { type: -1, value: null };
1828
+ static TRUE;
1829
+ static FALSE;
1912
1830
  static combine(domains, operator) {
1913
1831
  if (domains.length === 0) {
1914
1832
  return new _Domain([]);
@@ -1987,6 +1905,24 @@ var Domain = class _Domain {
1987
1905
  processLeaf(d.ast.value, 0, "&", newDomain);
1988
1906
  return newDomain;
1989
1907
  }
1908
+ constructor(descr = []) {
1909
+ if (descr instanceof _Domain) {
1910
+ return new _Domain(descr.toString());
1911
+ } else {
1912
+ let rawAST;
1913
+ try {
1914
+ rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
1915
+ } catch (error) {
1916
+ throw new InvalidDomainError(
1917
+ `Invalid domain representation: ${descr}`,
1918
+ {
1919
+ cause: error
1920
+ }
1921
+ );
1922
+ }
1923
+ this.ast = normalizeDomainAST(rawAST);
1924
+ }
1925
+ }
1990
1926
  contains(record) {
1991
1927
  const expr = evaluate(this.ast, record);
1992
1928
  return matchDomain(record, expr);
@@ -2005,7 +1941,7 @@ var Domain = class _Domain {
2005
1941
  return evaluatedAsList;
2006
1942
  }
2007
1943
  return this.toString();
2008
- } catch (e) {
1944
+ } catch {
2009
1945
  return this.toString();
2010
1946
  }
2011
1947
  }
@@ -2205,7 +2141,7 @@ function matchDomain(record, domain) {
2205
2141
  }
2206
2142
 
2207
2143
  // src/utils/function.ts
2208
- var import_react = require("react");
2144
+ import { useEffect, useState } from "react";
2209
2145
  var toQueryString = (params) => {
2210
2146
  return Object.keys(params).map(
2211
2147
  (key) => encodeURIComponent(key) + "=" + encodeURIComponent(params[key].toString())
@@ -2233,22 +2169,22 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
2233
2169
 
2234
2170
  // src/utils/storage/local-storage.ts
2235
2171
  var localStorageUtils = () => {
2236
- const setToken = (access_token) => __async(null, null, function* () {
2172
+ const setToken = async (access_token) => {
2237
2173
  localStorage.setItem("accessToken", access_token);
2238
- });
2239
- const setRefreshToken = (refresh_token) => __async(null, null, function* () {
2174
+ };
2175
+ const setRefreshToken = async (refresh_token) => {
2240
2176
  localStorage.setItem("refreshToken", refresh_token);
2241
- });
2242
- const getAccessToken = () => __async(null, null, function* () {
2177
+ };
2178
+ const getAccessToken = async () => {
2243
2179
  return localStorage.getItem("accessToken");
2244
- });
2245
- const getRefreshToken = () => __async(null, null, function* () {
2180
+ };
2181
+ const getRefreshToken = async () => {
2246
2182
  return localStorage.getItem("refreshToken");
2247
- });
2248
- const clearToken = () => __async(null, null, function* () {
2183
+ };
2184
+ const clearToken = async () => {
2249
2185
  localStorage.removeItem("accessToken");
2250
2186
  localStorage.removeItem("refreshToken");
2251
- });
2187
+ };
2252
2188
  return {
2253
2189
  setToken,
2254
2190
  setRefreshToken,
@@ -2260,9 +2196,9 @@ var localStorageUtils = () => {
2260
2196
 
2261
2197
  // src/utils/storage/session-storage.ts
2262
2198
  var sessionStorageUtils = () => {
2263
- const getBrowserSession = () => __async(null, null, function* () {
2199
+ const getBrowserSession = async () => {
2264
2200
  return sessionStorage.getItem("browserSession");
2265
- });
2201
+ };
2266
2202
  return {
2267
2203
  getBrowserSession
2268
2204
  };
@@ -2271,14 +2207,13 @@ var sessionStorageUtils = () => {
2271
2207
  // src/configs/axios-client.ts
2272
2208
  var axiosClient = {
2273
2209
  init(config) {
2274
- var _a, _b;
2275
- const localStorage2 = (_a = config.localStorageUtils) != null ? _a : localStorageUtils();
2276
- const sessionStorage2 = (_b = config.sessionStorageUtils) != null ? _b : sessionStorageUtils();
2210
+ const localStorage2 = config.localStorageUtils ?? localStorageUtils();
2211
+ const sessionStorage2 = config.sessionStorageUtils ?? sessionStorageUtils();
2277
2212
  const db = config.db;
2278
2213
  let isRefreshing = false;
2279
2214
  let failedQueue = [];
2280
2215
  const processQueue = (error, token = null) => {
2281
- failedQueue == null ? void 0 : failedQueue.forEach((prom) => {
2216
+ failedQueue?.forEach((prom) => {
2282
2217
  if (error) {
2283
2218
  prom.reject(error);
2284
2219
  } else {
@@ -2287,44 +2222,39 @@ var axiosClient = {
2287
2222
  });
2288
2223
  failedQueue = [];
2289
2224
  };
2290
- const instance = import_axios.default.create({
2291
- adapter: import_axios.default.defaults.adapter,
2225
+ const instance = axios.create({
2226
+ adapter: axios.defaults.adapter,
2292
2227
  baseURL: config.baseUrl,
2293
2228
  timeout: 5e4,
2294
2229
  paramsSerializer: (params) => new URLSearchParams(params).toString()
2295
2230
  });
2296
- instance.interceptors.request.use(
2297
- (config2) => __async(null, null, function* () {
2298
- const useRefreshToken = config2.useRefreshToken;
2299
- const token = useRefreshToken ? yield localStorage2.getRefreshToken() : yield localStorage2.getAccessToken();
2300
- if (token) {
2301
- config2.headers["Authorization"] = "Bearer " + token;
2302
- }
2303
- return config2;
2304
- }),
2305
- (error) => {
2306
- Promise.reject(error);
2231
+ instance.interceptors.request.use(async (config2) => {
2232
+ const { useRefreshToken, useActionToken, actionToken } = config2;
2233
+ if (useActionToken && actionToken) {
2234
+ config2.headers["Action-Token"] = actionToken;
2307
2235
  }
2308
- );
2236
+ const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
2237
+ const token = await getToken?.();
2238
+ if (token) config2.headers["Authorization"] = `Bearer ${token}`;
2239
+ return config2;
2240
+ }, Promise.reject);
2309
2241
  instance.interceptors.response.use(
2310
2242
  (response) => {
2311
2243
  return handleResponse(response);
2312
2244
  },
2313
- (error) => __async(null, null, function* () {
2314
- var _a2, _b2, _c;
2315
- const handleError3 = (error2) => __async(null, null, function* () {
2316
- var _a3;
2245
+ async (error) => {
2246
+ const handleError3 = async (error2) => {
2317
2247
  if (!error2.response) {
2318
2248
  return error2;
2319
2249
  }
2320
2250
  const { data } = error2.response;
2321
- if (data && data.code === 400 && ["invalid_grant"].includes((_a3 = data.data) == null ? void 0 : _a3.error)) {
2322
- yield clearAuthToken();
2251
+ if (data && data.code === 400 && ["invalid_grant"].includes(data.data?.error)) {
2252
+ await clearAuthToken();
2323
2253
  }
2324
2254
  return data;
2325
- });
2255
+ };
2326
2256
  const originalRequest = error.config;
2327
- 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(
2257
+ if ((error.response?.status === 403 || error.response?.status === 401 || error.response?.status === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
2328
2258
  error.response.data.code
2329
2259
  )) {
2330
2260
  if (isRefreshing) {
@@ -2337,19 +2267,18 @@ var axiosClient = {
2337
2267
  token
2338
2268
  );
2339
2269
  return instance.request(originalRequest);
2340
- }).catch((err) => __async(null, null, function* () {
2341
- var _a3, _b3;
2342
- 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)) {
2343
- yield clearAuthToken();
2270
+ }).catch(async (err) => {
2271
+ if ((err.response?.status === 400 || err.response?.status === 401) && ["invalid_grant"].includes(err.response.data.error)) {
2272
+ await clearAuthToken();
2344
2273
  }
2345
- }));
2274
+ });
2346
2275
  }
2347
- const browserSession = yield sessionStorage2.getBrowserSession();
2348
- const refreshToken = yield localStorage2.getRefreshToken();
2349
- const accessTokenExp = yield localStorage2.getAccessToken();
2276
+ const browserSession = await sessionStorage2.getBrowserSession();
2277
+ const refreshToken = await localStorage2.getRefreshToken();
2278
+ const accessTokenExp = await localStorage2.getAccessToken();
2350
2279
  isRefreshing = true;
2351
2280
  if (!refreshToken && (!browserSession || browserSession == "unActive")) {
2352
- yield clearAuthToken();
2281
+ await clearAuthToken();
2353
2282
  } else {
2354
2283
  const payload = Object.fromEntries(
2355
2284
  Object.entries({
@@ -2360,9 +2289,8 @@ var axiosClient = {
2360
2289
  }).filter(([_, value]) => !!value)
2361
2290
  );
2362
2291
  return new Promise(function(resolve) {
2363
- var _a3;
2364
- import_axios.default.post(
2365
- `${config.baseUrl}${(_a3 = config.refreshTokenEndpoint) != null ? _a3 : "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2292
+ axios.post(
2293
+ `${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2366
2294
  payload,
2367
2295
  {
2368
2296
  headers: {
@@ -2370,11 +2298,11 @@ var axiosClient = {
2370
2298
  Authorization: `Bearer ${accessTokenExp}`
2371
2299
  }
2372
2300
  }
2373
- ).then((res) => __async(null, null, function* () {
2301
+ ).then(async (res) => {
2374
2302
  const data = res.data;
2375
- yield localStorage2.setToken(data.access_token);
2376
- yield localStorage2.setRefreshToken(data.refresh_token);
2377
- import_axios.default.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
2303
+ await localStorage2.setToken(data.access_token);
2304
+ await localStorage2.setRefreshToken(data.refresh_token);
2305
+ axios.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
2378
2306
  originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
2379
2307
  originalRequest.data = updateTokenParamInOriginalRequest(
2380
2308
  originalRequest,
@@ -2382,26 +2310,25 @@ var axiosClient = {
2382
2310
  );
2383
2311
  processQueue(null, data.access_token);
2384
2312
  resolve(instance.request(originalRequest));
2385
- })).catch((err) => __async(null, null, function* () {
2386
- var _a4;
2387
- 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") {
2388
- yield clearAuthToken();
2313
+ }).catch(async (err) => {
2314
+ 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") {
2315
+ await clearAuthToken();
2389
2316
  }
2390
2317
  if (err && err.response) {
2391
- const { error_code } = ((_a4 = err.response) == null ? void 0 : _a4.data) || {};
2318
+ const { error_code } = err.response?.data || {};
2392
2319
  if (error_code === "AUTHEN_FAIL") {
2393
- yield clearAuthToken();
2320
+ await clearAuthToken();
2394
2321
  }
2395
2322
  }
2396
2323
  processQueue(err, null);
2397
- })).finally(() => {
2324
+ }).finally(() => {
2398
2325
  isRefreshing = false;
2399
2326
  });
2400
2327
  });
2401
2328
  }
2402
2329
  }
2403
- return Promise.reject(yield handleError3(error));
2404
- })
2330
+ return Promise.reject(await handleError3(error));
2331
+ }
2405
2332
  );
2406
2333
  const handleResponse = (res) => {
2407
2334
  if (res && res.data) {
@@ -2410,7 +2337,6 @@ var axiosClient = {
2410
2337
  return res;
2411
2338
  };
2412
2339
  const handleError2 = (error) => {
2413
- var _a2, _b2, _c;
2414
2340
  if (error.isAxiosError && error.code === "ECONNABORTED") {
2415
2341
  console.error("Request Timeout Error:", error);
2416
2342
  return "Request Timeout Error";
@@ -2418,17 +2344,17 @@ var axiosClient = {
2418
2344
  console.error("Network Error:", error);
2419
2345
  return "Network Error";
2420
2346
  } else {
2421
- console.error("Other Error:", error == null ? void 0 : error.response);
2422
- const errorMessage = ((_b2 = (_a2 = error == null ? void 0 : error.response) == null ? void 0 : _a2.data) == null ? void 0 : _b2.message) || "An error occurred";
2423
- return { message: errorMessage, status: (_c = error == null ? void 0 : error.response) == null ? void 0 : _c.status };
2347
+ console.error("Other Error:", error?.response);
2348
+ const errorMessage = error?.response?.data?.message || "An error occurred";
2349
+ return { message: errorMessage, status: error?.response?.status };
2424
2350
  }
2425
2351
  };
2426
- const clearAuthToken = () => __async(null, null, function* () {
2427
- yield localStorage2.clearToken();
2352
+ const clearAuthToken = async () => {
2353
+ await localStorage2.clearToken();
2428
2354
  if (typeof window !== "undefined") {
2429
2355
  window.location.href = `/login`;
2430
2356
  }
2431
- });
2357
+ };
2432
2358
  function formatUrl(url, db2) {
2433
2359
  return url + (db2 ? "?db=" + db2 : "");
2434
2360
  }
@@ -2452,14 +2378,14 @@ var axiosClient = {
2452
2378
  };
2453
2379
 
2454
2380
  // src/store/index.ts
2455
- var import_react_redux = require("react-redux");
2381
+ import { useDispatch, useSelector } from "react-redux";
2456
2382
 
2457
2383
  // src/store/reducers/breadcrums-slice/index.ts
2458
- var import_toolkit = require("@reduxjs/toolkit");
2384
+ import { createSlice } from "@reduxjs/toolkit";
2459
2385
  var initialState = {
2460
2386
  breadCrumbs: []
2461
2387
  };
2462
- var breadcrumbsSlice = (0, import_toolkit.createSlice)({
2388
+ var breadcrumbsSlice = createSlice({
2463
2389
  name: "breadcrumbs",
2464
2390
  initialState,
2465
2391
  reducers: {
@@ -2472,12 +2398,14 @@ var { setBreadCrumbs } = breadcrumbsSlice.actions;
2472
2398
  var breadcrums_slice_default = breadcrumbsSlice.reducer;
2473
2399
 
2474
2400
  // src/store/reducers/env-slice/index.ts
2475
- var import_toolkit2 = require("@reduxjs/toolkit");
2401
+ import { createSlice as createSlice2 } from "@reduxjs/toolkit";
2476
2402
  var initialState2 = {
2477
2403
  baseUrl: "",
2478
2404
  requests: null,
2479
2405
  companies: [],
2480
2406
  user: {},
2407
+ db: "",
2408
+ refreshTokenEndpoint: "",
2481
2409
  config: null,
2482
2410
  envFile: null,
2483
2411
  defaultCompany: {
@@ -2493,7 +2421,7 @@ var initialState2 = {
2493
2421
  tz: "Asia/Saigon"
2494
2422
  }
2495
2423
  };
2496
- var envSlice = (0, import_toolkit2.createSlice)({
2424
+ var envSlice = createSlice2({
2497
2425
  name: "env",
2498
2426
  initialState: initialState2,
2499
2427
  reducers: {
@@ -2540,7 +2468,7 @@ var {
2540
2468
  var env_slice_default = envSlice.reducer;
2541
2469
 
2542
2470
  // src/store/reducers/excel-slice/index.ts
2543
- var import_toolkit3 = require("@reduxjs/toolkit");
2471
+ import { createSlice as createSlice3 } from "@reduxjs/toolkit";
2544
2472
  var initialState3 = {
2545
2473
  dataParse: null,
2546
2474
  idFile: null,
@@ -2549,7 +2477,7 @@ var initialState3 = {
2549
2477
  selectedFile: null,
2550
2478
  errorData: null
2551
2479
  };
2552
- var excelSlice = (0, import_toolkit3.createSlice)({
2480
+ var excelSlice = createSlice3({
2553
2481
  name: "excel",
2554
2482
  initialState: initialState3,
2555
2483
  reducers: {
@@ -2584,7 +2512,7 @@ var {
2584
2512
  var excel_slice_default = excelSlice.reducer;
2585
2513
 
2586
2514
  // src/store/reducers/form-slice/index.ts
2587
- var import_toolkit4 = require("@reduxjs/toolkit");
2515
+ import { createSlice as createSlice4 } from "@reduxjs/toolkit";
2588
2516
  var initialState4 = {
2589
2517
  viewDataStore: {},
2590
2518
  isShowingModalDetail: false,
@@ -2594,7 +2522,7 @@ var initialState4 = {
2594
2522
  listSubject: {},
2595
2523
  dataUser: {}
2596
2524
  };
2597
- var formSlice = (0, import_toolkit4.createSlice)({
2525
+ var formSlice = createSlice4({
2598
2526
  name: "form",
2599
2527
  initialState: initialState4,
2600
2528
  reducers: {
@@ -2633,15 +2561,15 @@ var {
2633
2561
  var form_slice_default = formSlice.reducer;
2634
2562
 
2635
2563
  // src/store/reducers/header-slice/index.ts
2636
- var import_toolkit5 = require("@reduxjs/toolkit");
2637
- var headerSlice = (0, import_toolkit5.createSlice)({
2564
+ import { createSlice as createSlice5 } from "@reduxjs/toolkit";
2565
+ var headerSlice = createSlice5({
2638
2566
  name: "header",
2639
2567
  initialState: {
2640
2568
  value: { allowedCompanyIds: [] }
2641
2569
  },
2642
2570
  reducers: {
2643
2571
  setHeader: (state, action) => {
2644
- state.value = __spreadValues(__spreadValues({}, state.value), action.payload);
2572
+ state.value = { ...state.value, ...action.payload };
2645
2573
  },
2646
2574
  setAllowedCompanyIds: (state, action) => {
2647
2575
  state.value.allowedCompanyIds = action.payload;
@@ -2652,7 +2580,7 @@ var { setAllowedCompanyIds, setHeader } = headerSlice.actions;
2652
2580
  var header_slice_default = headerSlice.reducer;
2653
2581
 
2654
2582
  // src/store/reducers/list-slice/index.ts
2655
- var import_toolkit6 = require("@reduxjs/toolkit");
2583
+ import { createSlice as createSlice6 } from "@reduxjs/toolkit";
2656
2584
  var initialState5 = {
2657
2585
  pageLimit: 10,
2658
2586
  fields: {},
@@ -2666,7 +2594,7 @@ var initialState5 = {
2666
2594
  page: 0,
2667
2595
  domainTable: []
2668
2596
  };
2669
- var listSlice = (0, import_toolkit6.createSlice)({
2597
+ var listSlice = createSlice6({
2670
2598
  name: "list",
2671
2599
  initialState: initialState5,
2672
2600
  reducers: {
@@ -2717,13 +2645,13 @@ var {
2717
2645
  var list_slice_default = listSlice.reducer;
2718
2646
 
2719
2647
  // src/store/reducers/login-slice/index.ts
2720
- var import_toolkit7 = require("@reduxjs/toolkit");
2648
+ import { createSlice as createSlice7 } from "@reduxjs/toolkit";
2721
2649
  var initialState6 = {
2722
2650
  db: "",
2723
2651
  redirectTo: "/",
2724
2652
  forgotPasswordUrl: "/"
2725
2653
  };
2726
- var loginSlice = (0, import_toolkit7.createSlice)({
2654
+ var loginSlice = createSlice7({
2727
2655
  name: "login",
2728
2656
  initialState: initialState6,
2729
2657
  reducers: {
@@ -2742,14 +2670,14 @@ var { setDb, setRedirectTo, setForgotPasswordUrl } = loginSlice.actions;
2742
2670
  var login_slice_default = loginSlice.reducer;
2743
2671
 
2744
2672
  // src/store/reducers/navbar-slice/index.ts
2745
- var import_toolkit8 = require("@reduxjs/toolkit");
2673
+ import { createSlice as createSlice8 } from "@reduxjs/toolkit";
2746
2674
  var initialState7 = {
2747
2675
  menuFocus: {},
2748
2676
  menuAction: {},
2749
2677
  navbarWidth: 250,
2750
2678
  menuList: []
2751
2679
  };
2752
- var navbarSlice = (0, import_toolkit8.createSlice)({
2680
+ var navbarSlice = createSlice8({
2753
2681
  name: "navbar",
2754
2682
  initialState: initialState7,
2755
2683
  reducers: {
@@ -2771,11 +2699,11 @@ var { setMenuFocus, setMenuFocusAction, setNavbarWidth, setMenuList } = navbarSl
2771
2699
  var navbar_slice_default = navbarSlice.reducer;
2772
2700
 
2773
2701
  // src/store/reducers/profile-slice/index.ts
2774
- var import_toolkit9 = require("@reduxjs/toolkit");
2702
+ import { createSlice as createSlice9 } from "@reduxjs/toolkit";
2775
2703
  var initialState8 = {
2776
2704
  profile: {}
2777
2705
  };
2778
- var profileSlice = (0, import_toolkit9.createSlice)({
2706
+ var profileSlice = createSlice9({
2779
2707
  name: "profile",
2780
2708
  initialState: initialState8,
2781
2709
  reducers: {
@@ -2788,7 +2716,7 @@ var { setProfile } = profileSlice.actions;
2788
2716
  var profile_slice_default = profileSlice.reducer;
2789
2717
 
2790
2718
  // src/store/reducers/search-slice/index.ts
2791
- var import_toolkit10 = require("@reduxjs/toolkit");
2719
+ import { createSlice as createSlice10 } from "@reduxjs/toolkit";
2792
2720
  var initialState9 = {
2793
2721
  groupByDomain: null,
2794
2722
  searchBy: [],
@@ -2800,7 +2728,7 @@ var initialState9 = {
2800
2728
  filterBy: [],
2801
2729
  groupBy: []
2802
2730
  };
2803
- var searchSlice = (0, import_toolkit10.createSlice)({
2731
+ var searchSlice = createSlice10({
2804
2732
  name: "search",
2805
2733
  initialState: initialState9,
2806
2734
  reducers: {
@@ -2874,7 +2802,7 @@ var {
2874
2802
  var search_slice_default = searchSlice.reducer;
2875
2803
 
2876
2804
  // src/store/store.ts
2877
- var import_toolkit11 = require("@reduxjs/toolkit");
2805
+ import { configureStore } from "@reduxjs/toolkit";
2878
2806
 
2879
2807
  // node_modules/redux/dist/redux.mjs
2880
2808
  function formatProdErrorMessage(code) {
@@ -3058,7 +2986,7 @@ var rootReducer = combineReducers({
3058
2986
  excel: excel_slice_default,
3059
2987
  profile: profile_slice_default
3060
2988
  });
3061
- var envStore = (0, import_toolkit11.configureStore)({
2989
+ var envStore = configureStore({
3062
2990
  reducer: rootReducer,
3063
2991
  middleware: (getDefaultMiddleware) => getDefaultMiddleware({
3064
2992
  serializableCheck: false
@@ -3067,130 +2995,114 @@ var envStore = (0, import_toolkit11.configureStore)({
3067
2995
 
3068
2996
  // src/environment/EnvStore.ts
3069
2997
  var EnvStore = class {
3070
- constructor(envStore2, localStorageUtils2, sessionStorageUtils2) {
3071
- this.envStore = envStore2;
2998
+ baseUrl;
2999
+ requests;
3000
+ context;
3001
+ defaultCompany;
3002
+ config;
3003
+ companies;
3004
+ user;
3005
+ db;
3006
+ localStorageUtils;
3007
+ sessionStorageUtils;
3008
+ refreshTokenEndpoint;
3009
+ constructor(localStorageUtils2, sessionStorageUtils2) {
3072
3010
  this.localStorageUtils = localStorageUtils2;
3073
3011
  this.sessionStorageUtils = sessionStorageUtils2;
3074
3012
  this.setup();
3075
3013
  }
3076
3014
  setup() {
3077
- const env2 = this.envStore.getState().env;
3078
- this.baseUrl = env2 == null ? void 0 : env2.baseUrl;
3079
- this.requests = env2 == null ? void 0 : env2.requests;
3080
- this.context = env2 == null ? void 0 : env2.context;
3081
- this.defaultCompany = env2 == null ? void 0 : env2.defaultCompany;
3082
- this.config = env2 == null ? void 0 : env2.config;
3083
- this.companies = (env2 == null ? void 0 : env2.companies) || [];
3084
- this.user = env2 == null ? void 0 : env2.user;
3085
- this.db = env2 == null ? void 0 : env2.db;
3086
- this.refreshTokenEndpoint = env2 == null ? void 0 : env2.refreshTokenEndpoint;
3015
+ const env2 = envStore.getState().env;
3016
+ this.baseUrl = env2?.baseUrl;
3017
+ this.requests = env2?.requests;
3018
+ this.context = env2?.context;
3019
+ this.defaultCompany = env2?.defaultCompany;
3020
+ this.config = env2?.config;
3021
+ this.companies = env2?.companies || [];
3022
+ this.user = env2?.user;
3023
+ this.db = env2?.db;
3024
+ this.refreshTokenEndpoint = env2?.refreshTokenEndpoint;
3087
3025
  }
3088
3026
  setupEnv(envConfig) {
3089
- const dispatch = this.envStore.dispatch;
3090
- const env2 = __spreadProps(__spreadValues({}, envConfig), {
3027
+ const dispatch = envStore.dispatch;
3028
+ const env2 = {
3029
+ ...envConfig,
3091
3030
  localStorageUtils: this.localStorageUtils,
3092
3031
  sessionStorageUtils: this.sessionStorageUtils
3093
- });
3032
+ };
3094
3033
  const requests = axiosClient.init(env2);
3095
- dispatch(setEnv(__spreadProps(__spreadValues({}, env2), { requests })));
3034
+ dispatch(setEnv({ ...env2, requests }));
3096
3035
  this.setup();
3097
3036
  }
3098
3037
  setUid(uid) {
3099
- const dispatch = this.envStore.dispatch;
3038
+ const dispatch = envStore.dispatch;
3100
3039
  dispatch(setUid(uid));
3101
3040
  this.setup();
3102
3041
  }
3103
3042
  setLang(lang) {
3104
- const dispatch = this.envStore.dispatch;
3043
+ const dispatch = envStore.dispatch;
3105
3044
  dispatch(setLang(lang));
3106
3045
  this.setup();
3107
3046
  }
3108
3047
  setAllowCompanies(allowCompanies) {
3109
- const dispatch = this.envStore.dispatch;
3048
+ const dispatch = envStore.dispatch;
3110
3049
  dispatch(setAllowCompanies(allowCompanies));
3111
3050
  this.setup();
3112
3051
  }
3113
3052
  setCompanies(companies) {
3114
- const dispatch = this.envStore.dispatch;
3053
+ const dispatch = envStore.dispatch;
3115
3054
  dispatch(setCompanies(companies));
3116
3055
  this.setup();
3117
3056
  }
3118
3057
  setDefaultCompany(company) {
3119
- const dispatch = this.envStore.dispatch;
3058
+ const dispatch = envStore.dispatch;
3120
3059
  dispatch(setDefaultCompany(company));
3121
3060
  this.setup();
3122
3061
  }
3123
3062
  setUserInfo(userInfo) {
3124
- const dispatch = this.envStore.dispatch;
3063
+ const dispatch = envStore.dispatch;
3125
3064
  dispatch(setUser(userInfo));
3126
3065
  this.setup();
3127
3066
  }
3128
3067
  };
3129
3068
  var env = null;
3130
3069
  function getEnv() {
3131
- if (!env)
3132
- env = new EnvStore(envStore, localStorageUtils(), sessionStorageUtils());
3070
+ if (!env) env = new EnvStore(localStorageUtils(), sessionStorageUtils());
3133
3071
  return env;
3134
3072
  }
3135
3073
 
3136
3074
  // src/services/action-service/index.ts
3137
3075
  var ActionService = {
3138
3076
  // Load Action
3139
- loadAction(_0) {
3140
- return __async(this, arguments, function* ({
3141
- idAction,
3142
- context
3143
- }) {
3144
- const env2 = getEnv();
3145
- const jsonData = {
3146
- action_id: idAction,
3147
- with_context: __spreadValues({}, context)
3148
- };
3149
- return env2.requests.post(`${"/load_action" /* LOAD_ACTION */}`, jsonData, {
3150
- headers: {
3151
- "Content-Type": "application/json"
3152
- }
3153
- });
3154
- });
3155
- },
3156
- // Call Button
3157
- callButton(_0) {
3158
- return __async(this, arguments, function* ({
3159
- model,
3160
- ids = [],
3161
- context,
3162
- method
3163
- }) {
3164
- try {
3165
- const env2 = getEnv();
3166
- const jsonData = {
3167
- model,
3168
- method,
3169
- ids,
3170
- with_context: context
3171
- };
3172
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3173
- headers: {
3174
- "Content-Type": "application/json"
3175
- }
3176
- });
3177
- } catch (error) {
3178
- console.error("Error when calling button action:", error);
3179
- throw error;
3077
+ async loadAction({
3078
+ idAction,
3079
+ context
3080
+ }) {
3081
+ const env2 = getEnv();
3082
+ const jsonData = {
3083
+ action_id: idAction,
3084
+ with_context: {
3085
+ ...context
3086
+ }
3087
+ };
3088
+ return env2.requests.post(`${"/load_action" /* LOAD_ACTION */}`, jsonData, {
3089
+ headers: {
3090
+ "Content-Type": "application/json"
3180
3091
  }
3181
3092
  });
3182
3093
  },
3183
- // remove Row
3184
- removeRows(_0) {
3185
- return __async(this, arguments, function* ({
3186
- model,
3187
- ids,
3188
- context
3189
- }) {
3094
+ // Call Button
3095
+ async callButton({
3096
+ model,
3097
+ ids = [],
3098
+ context,
3099
+ method
3100
+ }) {
3101
+ try {
3190
3102
  const env2 = getEnv();
3191
3103
  const jsonData = {
3192
3104
  model,
3193
- method: "unlink",
3105
+ method,
3194
3106
  ids,
3195
3107
  with_context: context
3196
3108
  };
@@ -3199,96 +3111,112 @@ var ActionService = {
3199
3111
  "Content-Type": "application/json"
3200
3112
  }
3201
3113
  });
3114
+ } catch (error) {
3115
+ console.error("Error when calling button action:", error);
3116
+ throw error;
3117
+ }
3118
+ },
3119
+ // remove Row
3120
+ async removeRows({
3121
+ model,
3122
+ ids,
3123
+ context
3124
+ }) {
3125
+ const env2 = getEnv();
3126
+ const jsonData = {
3127
+ model,
3128
+ method: "unlink",
3129
+ ids,
3130
+ with_context: context
3131
+ };
3132
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3133
+ headers: {
3134
+ "Content-Type": "application/json"
3135
+ }
3202
3136
  });
3203
3137
  },
3204
3138
  // Duplicate Model
3205
- duplicateRecord(_0) {
3206
- return __async(this, arguments, function* ({
3139
+ async duplicateRecord({
3140
+ model,
3141
+ id,
3142
+ context
3143
+ }) {
3144
+ const env2 = getEnv();
3145
+ const jsonData = {
3207
3146
  model,
3208
- id,
3209
- context
3210
- }) {
3211
- const env2 = getEnv();
3212
- const jsonData = {
3213
- model,
3214
- method: "copy",
3215
- ids: id,
3216
- with_context: context
3217
- };
3218
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3219
- headers: {
3220
- "Content-Type": "application/json"
3221
- }
3222
- });
3147
+ method: "copy",
3148
+ ids: id,
3149
+ with_context: context
3150
+ };
3151
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3152
+ headers: {
3153
+ "Content-Type": "application/json"
3154
+ }
3223
3155
  });
3224
3156
  },
3225
3157
  // Get Print Report
3226
- getPrintReportName(_0) {
3227
- return __async(this, arguments, function* ({ id }) {
3228
- const env2 = getEnv();
3229
- const jsonData = {
3230
- model: "ir.actions.report",
3231
- method: "web_read",
3232
- id,
3233
- kwargs: {
3234
- specification: {
3235
- report_name: {}
3236
- }
3237
- }
3238
- };
3239
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3240
- headers: {
3241
- "Content-Type": "application/json"
3158
+ async getPrintReportName({ id }) {
3159
+ const env2 = getEnv();
3160
+ const jsonData = {
3161
+ model: "ir.actions.report",
3162
+ method: "web_read",
3163
+ id,
3164
+ kwargs: {
3165
+ specification: {
3166
+ report_name: {}
3242
3167
  }
3243
- });
3168
+ }
3169
+ };
3170
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3171
+ headers: {
3172
+ "Content-Type": "application/json"
3173
+ }
3244
3174
  });
3245
3175
  },
3246
3176
  //Save Print Invoice
3247
- print(_0) {
3248
- return __async(this, arguments, function* ({ id, report, db }) {
3249
- const env2 = getEnv();
3250
- const jsonData = {
3251
- report,
3252
- id,
3253
- type: "pdf",
3254
- file_response: true,
3255
- db
3256
- };
3257
- const queryString = toQueryString(jsonData);
3258
- const urlWithParams = `${"/report" /* REPORT_PATH */}?${queryString}`;
3259
- return env2.requests.get(urlWithParams, {
3260
- headers: {
3261
- "Content-Type": "application/json"
3262
- },
3263
- responseType: "arraybuffer"
3264
- });
3177
+ async print({ id, report, db }) {
3178
+ const env2 = getEnv();
3179
+ const jsonData = {
3180
+ report,
3181
+ id,
3182
+ type: "pdf",
3183
+ file_response: true,
3184
+ db
3185
+ };
3186
+ const queryString = toQueryString(jsonData);
3187
+ const urlWithParams = `${"/report" /* REPORT_PATH */}?${queryString}`;
3188
+ return env2.requests.get(urlWithParams, {
3189
+ headers: {
3190
+ "Content-Type": "application/json"
3191
+ },
3192
+ responseType: "arraybuffer"
3265
3193
  });
3266
3194
  },
3267
3195
  //Run Action
3268
- runAction(_0) {
3269
- return __async(this, arguments, function* ({
3270
- idAction,
3271
- context
3272
- }) {
3273
- const env2 = getEnv();
3274
- const jsonData = {
3275
- action_id: idAction,
3276
- with_context: __spreadValues({}, context)
3277
- // context: {
3278
- // lang: 'en_US',
3279
- // tz: 'Asia/Saigon',
3280
- // uid: 2,
3281
- // allowed_company_ids: [1],
3282
- // active_id: Array.isArray(idDetail) ? idDetail[0] : idDetail,
3283
- // active_ids: Array.isArray(idDetail) ? [...idDetail] : idDetail,
3284
- // active_model: model,
3285
- // },
3286
- };
3287
- return env2.requests.post(`${"/run_action" /* RUN_ACTION_PATH */}`, jsonData, {
3288
- headers: {
3289
- "Content-Type": "application/json"
3290
- }
3291
- });
3196
+ async runAction({
3197
+ idAction,
3198
+ context
3199
+ }) {
3200
+ const env2 = getEnv();
3201
+ const jsonData = {
3202
+ action_id: idAction,
3203
+ with_context: {
3204
+ ...context
3205
+ }
3206
+ // context: {
3207
+ // lang: 'en_US',
3208
+ // tz: 'Asia/Saigon',
3209
+ // uid: 2,
3210
+ // allowed_company_ids: [1],
3211
+ // active_id: Array.isArray(idDetail) ? idDetail[0] : idDetail,
3212
+ // active_ids: Array.isArray(idDetail) ? [...idDetail] : idDetail,
3213
+ // active_model: model,
3214
+ // },
3215
+ };
3216
+ return env2.requests.post(`${"/run_action" /* RUN_ACTION_PATH */}`, jsonData, {
3217
+ headers: {
3218
+ "Content-Type": "application/json"
3219
+ }
3292
3220
  });
3293
3221
  }
3294
3222
  };
@@ -3296,238 +3224,214 @@ var action_service_default = ActionService;
3296
3224
 
3297
3225
  // src/services/auth-service/index.ts
3298
3226
  var AuthService = {
3299
- login(body) {
3300
- return __async(this, null, function* () {
3301
- var _a, _b, _c, _d;
3302
- const env2 = getEnv();
3303
- const payload = Object.fromEntries(
3304
- Object.entries({
3305
- username: body.email,
3306
- password: body.password,
3307
- grant_type: ((_a = env2 == null ? void 0 : env2.config) == null ? void 0 : _a.grantType) || "",
3308
- client_id: ((_b = env2 == null ? void 0 : env2.config) == null ? void 0 : _b.clientId) || "",
3309
- client_secret: ((_c = env2 == null ? void 0 : env2.config) == null ? void 0 : _c.clientSecret) || ""
3310
- }).filter(([_, value]) => !!value)
3311
- );
3312
- const encodedData = new URLSearchParams(payload).toString();
3313
- return (_d = env2 == null ? void 0 : env2.requests) == null ? void 0 : _d.post(body.path, encodedData, {
3314
- headers: {
3315
- "Content-Type": "application/x-www-form-urlencoded"
3316
- }
3317
- });
3227
+ async login(body) {
3228
+ const env2 = getEnv();
3229
+ const payload = Object.fromEntries(
3230
+ Object.entries({
3231
+ username: body.email,
3232
+ password: body.password,
3233
+ grant_type: env2?.config?.grantType || "",
3234
+ client_id: env2?.config?.clientId || "",
3235
+ client_secret: env2?.config?.clientSecret || ""
3236
+ }).filter(([_, value]) => !!value)
3237
+ );
3238
+ const encodedData = new URLSearchParams(payload).toString();
3239
+ return env2?.requests?.post(body.path, encodedData, {
3240
+ headers: {
3241
+ "Content-Type": "application/x-www-form-urlencoded"
3242
+ }
3318
3243
  });
3319
3244
  },
3320
- forgotPassword(email) {
3321
- return __async(this, null, function* () {
3322
- var _a;
3323
- const env2 = getEnv();
3324
- const bodyData = {
3325
- login: email,
3326
- url: `${window.location.origin}/reset-password`
3327
- };
3328
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/reset_password" /* RESET_PASSWORD_PATH */, bodyData, {
3329
- headers: {
3330
- "Content-Type": "application/json"
3331
- }
3332
- });
3245
+ async forgotPassword(email) {
3246
+ const env2 = getEnv();
3247
+ const bodyData = {
3248
+ login: email,
3249
+ url: `${window.location.origin}/reset-password`
3250
+ };
3251
+ return env2?.requests?.post("/reset_password" /* RESET_PASSWORD_PATH */, bodyData, {
3252
+ headers: {
3253
+ "Content-Type": "application/json"
3254
+ }
3333
3255
  });
3334
3256
  },
3335
- forgotPasswordSSO(_0) {
3336
- return __async(this, arguments, function* ({
3337
- email,
3338
- with_context,
3339
- method
3340
- }) {
3341
- var _a;
3342
- const env2 = getEnv();
3343
- const body = {
3344
- method,
3345
- kwargs: {
3346
- vals: {
3347
- email
3348
- }
3349
- },
3350
- with_context
3351
- };
3352
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, body, {
3353
- headers: {
3354
- "Content-Type": "application/json"
3257
+ async forgotPasswordSSO({
3258
+ email,
3259
+ with_context,
3260
+ method
3261
+ }) {
3262
+ const env2 = getEnv();
3263
+ const body = {
3264
+ method,
3265
+ kwargs: {
3266
+ vals: {
3267
+ email
3355
3268
  }
3356
- });
3269
+ },
3270
+ with_context
3271
+ };
3272
+ return env2?.requests?.post("/call" /* CALL_PATH */, body, {
3273
+ headers: {
3274
+ "Content-Type": "application/json"
3275
+ }
3357
3276
  });
3358
3277
  },
3359
- resetPassword(data, token) {
3360
- return __async(this, null, function* () {
3361
- var _a;
3362
- const env2 = getEnv();
3363
- const bodyData = {
3364
- token,
3365
- password: data.password,
3366
- new_password: data.confirmPassword
3367
- };
3368
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/change_password" /* CHANGE_PASSWORD_PATH */, bodyData, {
3369
- headers: {
3370
- "Content-Type": "application/json"
3371
- }
3372
- });
3278
+ async resetPassword(data, token) {
3279
+ const env2 = getEnv();
3280
+ const bodyData = {
3281
+ token,
3282
+ password: data.password,
3283
+ new_password: data.confirmPassword
3284
+ };
3285
+ return env2?.requests?.post("/change_password" /* CHANGE_PASSWORD_PATH */, bodyData, {
3286
+ headers: {
3287
+ "Content-Type": "application/json"
3288
+ }
3373
3289
  });
3374
3290
  },
3375
- resetPasswordSSO(_0) {
3376
- return __async(this, arguments, function* ({
3291
+ async resetPasswordSSO({
3292
+ method,
3293
+ password,
3294
+ with_context
3295
+ }) {
3296
+ const env2 = getEnv();
3297
+ const bodyData = {
3377
3298
  method,
3378
- password,
3379
- with_context
3380
- }) {
3381
- var _a;
3382
- const env2 = getEnv();
3383
- const bodyData = {
3384
- method,
3385
- kwargs: {
3386
- vals: {
3387
- password
3388
- }
3389
- },
3390
- with_context
3391
- };
3392
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, bodyData, {
3393
- headers: {
3394
- "Content-Type": "application/json"
3395
- }
3396
- });
3397
- });
3398
- },
3399
- updatePassword(data, token) {
3400
- return __async(this, null, function* () {
3401
- var _a;
3402
- const env2 = getEnv();
3403
- const bodyData = {
3404
- token,
3405
- old_password: data.oldPassword,
3406
- new_password: data.newPassword
3407
- };
3408
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/change_password_parent" /* UPDATE_PASSWORD_PATH */, bodyData, {
3409
- headers: {
3410
- "Content-Type": "application/json"
3299
+ kwargs: {
3300
+ vals: {
3301
+ password
3411
3302
  }
3412
- });
3303
+ },
3304
+ with_context
3305
+ };
3306
+ return env2?.requests?.post("/call" /* CALL_PATH */, bodyData, {
3307
+ headers: {
3308
+ "Content-Type": "application/json"
3309
+ }
3413
3310
  });
3414
3311
  },
3415
- isValidToken(token) {
3416
- return __async(this, null, function* () {
3417
- var _a;
3418
- const env2 = getEnv();
3419
- const bodyData = {
3420
- token
3421
- };
3422
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/check_token" /* TOKEN */, bodyData, {
3423
- headers: {
3424
- "Content-Type": "application/json"
3425
- }
3426
- });
3312
+ async updatePassword(data, token) {
3313
+ const env2 = getEnv();
3314
+ const bodyData = {
3315
+ token,
3316
+ old_password: data.oldPassword,
3317
+ new_password: data.newPassword
3318
+ };
3319
+ return env2?.requests?.post("/change_password_parent" /* UPDATE_PASSWORD_PATH */, bodyData, {
3320
+ headers: {
3321
+ "Content-Type": "application/json"
3322
+ }
3427
3323
  });
3428
3324
  },
3429
- loginSocial(_0) {
3430
- return __async(this, arguments, function* ({
3431
- db,
3432
- state,
3433
- access_token
3434
- }) {
3435
- var _a;
3436
- const env2 = getEnv();
3437
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post(
3438
- "/token/generate" /* GENTOKEN_SOCIAL */,
3439
- { state, access_token },
3440
- {
3441
- headers: {
3442
- "Content-Type": "application/json"
3443
- }
3444
- }
3445
- );
3325
+ async isValidToken(token) {
3326
+ const env2 = getEnv();
3327
+ const bodyData = {
3328
+ token
3329
+ };
3330
+ return env2?.requests?.post("/check_token" /* TOKEN */, bodyData, {
3331
+ headers: {
3332
+ "Content-Type": "application/json"
3333
+ }
3446
3334
  });
3447
3335
  },
3448
- getProviders(db) {
3449
- return __async(this, null, function* () {
3450
- var _a;
3451
- const env2 = getEnv();
3452
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.get("/oauth/providers", { params: { db } });
3453
- });
3336
+ async isValidActionToken(actionToken, path) {
3337
+ const env2 = getEnv();
3338
+ return env2?.requests?.post(
3339
+ path,
3340
+ {},
3341
+ {
3342
+ headers: {
3343
+ "Content-Type": "application/json"
3344
+ },
3345
+ useActionToken: true,
3346
+ actionToken
3347
+ }
3348
+ );
3454
3349
  },
3455
- getAccessByCode(code) {
3456
- return __async(this, null, function* () {
3457
- var _a, _b, _c, _d;
3458
- const env2 = getEnv();
3459
- const data = new URLSearchParams();
3460
- data.append("code", code);
3461
- data.append("grant_type", "authorization_code");
3462
- data.append("client_id", ((_a = env2 == null ? void 0 : env2.config) == null ? void 0 : _a.clientId) || "");
3463
- data.append("redirect_uri", ((_b = env2 == null ? void 0 : env2.config) == null ? void 0 : _b.redirectUri) || "");
3464
- return (_d = env2 == null ? void 0 : env2.requests) == null ? void 0 : _d.post(
3465
- `${(_c = env2 == null ? void 0 : env2.baseUrl) == null ? void 0 : _c.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
3466
- data,
3467
- {
3468
- headers: {
3469
- "Content-Type": "application/x-www-form-urlencoded"
3470
- }
3350
+ async loginSocial({
3351
+ db,
3352
+ state,
3353
+ access_token
3354
+ }) {
3355
+ const env2 = getEnv();
3356
+ return env2?.requests?.post(
3357
+ "/token/generate" /* GENTOKEN_SOCIAL */,
3358
+ { state, access_token },
3359
+ {
3360
+ headers: {
3361
+ "Content-Type": "application/json"
3471
3362
  }
3472
- );
3473
- });
3363
+ }
3364
+ );
3474
3365
  },
3475
- logout(data) {
3476
- return __async(this, null, function* () {
3477
- var _a;
3478
- const env2 = getEnv();
3479
- console.log(data);
3480
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post(
3481
- "/logout" /* LOGOUT */,
3482
- {},
3483
- {
3484
- headers: {
3485
- "Content-Type": "application/json"
3486
- },
3487
- withCredentials: true,
3488
- useRefreshToken: true
3366
+ async getProviders(db) {
3367
+ const env2 = getEnv();
3368
+ return env2?.requests?.get("/oauth/providers", { params: { db } });
3369
+ },
3370
+ async getAccessByCode(code) {
3371
+ const env2 = getEnv();
3372
+ const data = new URLSearchParams();
3373
+ data.append("code", code);
3374
+ data.append("grant_type", "authorization_code");
3375
+ data.append("client_id", env2?.config?.clientId || "");
3376
+ data.append("redirect_uri", env2?.config?.redirectUri || "");
3377
+ return env2?.requests?.post(
3378
+ `${env2?.baseUrl?.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
3379
+ data,
3380
+ {
3381
+ headers: {
3382
+ "Content-Type": "application/x-www-form-urlencoded"
3489
3383
  }
3490
- );
3491
- });
3384
+ }
3385
+ );
3386
+ },
3387
+ async logout(data) {
3388
+ const env2 = getEnv();
3389
+ console.log(data);
3390
+ return env2?.requests?.post(
3391
+ "/logout" /* LOGOUT */,
3392
+ {},
3393
+ {
3394
+ headers: {
3395
+ "Content-Type": "application/json"
3396
+ },
3397
+ withCredentials: true,
3398
+ useRefreshToken: true
3399
+ }
3400
+ );
3492
3401
  }
3493
3402
  };
3494
3403
  var auth_service_default = AuthService;
3495
3404
 
3496
3405
  // src/services/company-service/index.ts
3497
3406
  var CompanyService = {
3498
- getCurrentCompany() {
3499
- return __async(this, null, function* () {
3500
- const env2 = getEnv();
3501
- return yield env2.requests.get("/company" /* COMPANY_PATH */, {
3502
- headers: {
3503
- "Content-Type": "application/json"
3504
- }
3505
- });
3407
+ async getCurrentCompany() {
3408
+ const env2 = getEnv();
3409
+ return await env2.requests.get("/company" /* COMPANY_PATH */, {
3410
+ headers: {
3411
+ "Content-Type": "application/json"
3412
+ }
3506
3413
  });
3507
3414
  },
3508
- getInfoCompany(id) {
3509
- return __async(this, null, function* () {
3510
- var _a;
3511
- const env2 = getEnv();
3512
- const jsonData = {
3513
- ids: [id],
3514
- model: "res.company" /* COMPANY */,
3515
- method: "web_read" /* WEB_READ */,
3516
- kwargs: {
3517
- specification: {
3518
- primary_color: {},
3519
- secondary_color: {},
3520
- logo: {},
3521
- display_name: {},
3522
- secondary_logo: {}
3523
- }
3524
- }
3525
- };
3526
- return yield (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
3527
- headers: {
3528
- "Content-Type": "application/json"
3415
+ async getInfoCompany(id) {
3416
+ const env2 = getEnv();
3417
+ const jsonData = {
3418
+ ids: [id],
3419
+ model: "res.company" /* COMPANY */,
3420
+ method: "web_read" /* WEB_READ */,
3421
+ kwargs: {
3422
+ specification: {
3423
+ primary_color: {},
3424
+ secondary_color: {},
3425
+ logo: {},
3426
+ display_name: {},
3427
+ secondary_logo: {}
3529
3428
  }
3530
- });
3429
+ }
3430
+ };
3431
+ return await env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3432
+ headers: {
3433
+ "Content-Type": "application/json"
3434
+ }
3531
3435
  });
3532
3436
  }
3533
3437
  };
@@ -3535,671 +3439,613 @@ var company_service_default = CompanyService;
3535
3439
 
3536
3440
  // src/services/excel-service/index.ts
3537
3441
  var ExcelService = {
3538
- uploadFile(_0) {
3539
- return __async(this, arguments, function* ({ formData }) {
3540
- const env2 = getEnv();
3541
- return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
3542
- headers: {
3543
- "Content-Type": "multipart/form-data"
3544
- }
3545
- });
3442
+ async uploadFile({ formData }) {
3443
+ const env2 = getEnv();
3444
+ return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
3445
+ headers: {
3446
+ "Content-Type": "multipart/form-data"
3447
+ }
3546
3448
  });
3547
3449
  },
3548
- uploadIdFile(_0) {
3549
- return __async(this, arguments, function* ({ formData }) {
3550
- const env2 = getEnv();
3551
- return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
3552
- headers: {
3553
- "Content-Type": "multipart/form-data"
3554
- }
3555
- });
3450
+ async uploadIdFile({ formData }) {
3451
+ const env2 = getEnv();
3452
+ return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
3453
+ headers: {
3454
+ "Content-Type": "multipart/form-data"
3455
+ }
3556
3456
  });
3557
3457
  },
3558
- parsePreview(_0) {
3559
- return __async(this, arguments, function* ({
3560
- id,
3561
- selectedSheet,
3562
- isHeader,
3563
- context
3564
- }) {
3565
- const env2 = getEnv();
3566
- const jsonData = {
3567
- model: "base_import.import" /* BASE_IMPORT */,
3568
- method: "parse_preview",
3569
- ids: [id],
3570
- kwargs: {
3571
- options: {
3572
- import_skip_records: [],
3573
- import_set_empty_fields: [],
3574
- fallback_values: {},
3575
- name_create_enabled_fields: {},
3576
- encoding: "",
3577
- separator: "",
3578
- quoting: '"',
3579
- date_format: "",
3580
- datetime_format: "",
3581
- float_thousand_separator: ",",
3582
- float_decimal_separator: ".",
3583
- advanced: true,
3584
- has_headers: isHeader,
3585
- keep_matches: false,
3586
- limit: 2e3,
3587
- sheets: [],
3588
- sheet: selectedSheet,
3589
- skip: 0,
3590
- tracking_disable: true
3591
- }
3592
- },
3593
- with_context: context
3594
- };
3595
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3596
- headers: {
3597
- "Content-Type": "multipart/form-data"
3458
+ async parsePreview({
3459
+ id,
3460
+ selectedSheet,
3461
+ isHeader,
3462
+ context
3463
+ }) {
3464
+ const env2 = getEnv();
3465
+ const jsonData = {
3466
+ model: "base_import.import" /* BASE_IMPORT */,
3467
+ method: "parse_preview",
3468
+ ids: [id],
3469
+ kwargs: {
3470
+ options: {
3471
+ import_skip_records: [],
3472
+ import_set_empty_fields: [],
3473
+ fallback_values: {},
3474
+ name_create_enabled_fields: {},
3475
+ encoding: "",
3476
+ separator: "",
3477
+ quoting: '"',
3478
+ date_format: "",
3479
+ datetime_format: "",
3480
+ float_thousand_separator: ",",
3481
+ float_decimal_separator: ".",
3482
+ advanced: true,
3483
+ has_headers: isHeader,
3484
+ keep_matches: false,
3485
+ limit: 2e3,
3486
+ sheets: [],
3487
+ sheet: selectedSheet,
3488
+ skip: 0,
3489
+ tracking_disable: true
3598
3490
  }
3599
- });
3491
+ },
3492
+ with_context: context
3493
+ };
3494
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3495
+ headers: {
3496
+ "Content-Type": "multipart/form-data"
3497
+ }
3600
3498
  });
3601
3499
  },
3602
- executeImport(_0) {
3603
- return __async(this, arguments, function* ({
3604
- columns,
3605
- fields,
3606
- idFile,
3607
- options,
3608
- dryrun,
3609
- context
3610
- }) {
3611
- const env2 = getEnv();
3612
- const jsonData = {
3613
- model: "base_import.import" /* BASE_IMPORT */,
3614
- method: "execute_import",
3615
- ids: [idFile],
3616
- kwargs: {
3617
- fields,
3618
- columns,
3619
- options,
3620
- dryrun
3621
- },
3622
- with_context: context
3623
- };
3624
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3625
- headers: {
3626
- "Content-Type": "multipart/form-data"
3627
- }
3628
- });
3500
+ async executeImport({
3501
+ columns,
3502
+ fields,
3503
+ idFile,
3504
+ options,
3505
+ dryrun,
3506
+ context
3507
+ }) {
3508
+ const env2 = getEnv();
3509
+ const jsonData = {
3510
+ model: "base_import.import" /* BASE_IMPORT */,
3511
+ method: "execute_import",
3512
+ ids: [idFile],
3513
+ kwargs: {
3514
+ fields,
3515
+ columns,
3516
+ options,
3517
+ dryrun
3518
+ },
3519
+ with_context: context
3520
+ };
3521
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3522
+ headers: {
3523
+ "Content-Type": "multipart/form-data"
3524
+ }
3629
3525
  });
3630
3526
  },
3631
- getFileExcel(_0) {
3632
- return __async(this, arguments, function* ({ model }) {
3633
- const env2 = getEnv();
3634
- const jsonData = {
3635
- model,
3636
- method: "get_import_templates" /* GET_IMPORT */,
3637
- args: []
3638
- };
3639
- return env2.requests.post("/call" /* CALL_PATH */, jsonData);
3640
- });
3527
+ async getFileExcel({ model }) {
3528
+ const env2 = getEnv();
3529
+ const jsonData = {
3530
+ model,
3531
+ method: "get_import_templates" /* GET_IMPORT */,
3532
+ args: []
3533
+ };
3534
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData);
3641
3535
  },
3642
- getFieldExport(_0) {
3643
- return __async(this, arguments, function* ({
3644
- ids,
3536
+ async getFieldExport({
3537
+ ids,
3538
+ model,
3539
+ isShow,
3540
+ parentField,
3541
+ fieldType,
3542
+ parentName,
3543
+ prefix,
3544
+ name,
3545
+ context,
3546
+ importCompat
3547
+ }) {
3548
+ const env2 = getEnv();
3549
+ const jsonData = {
3645
3550
  model,
3646
- isShow,
3647
- parentField,
3648
- fieldType,
3649
- parentName,
3650
- prefix,
3651
- name,
3652
- context,
3653
- importCompat
3654
- }) {
3655
- const env2 = getEnv();
3656
- const jsonData = {
3657
- model,
3658
- import_compat: importCompat,
3659
- domain: [["id", "in", ids]],
3660
- with_context: context
3661
- };
3662
- if (isShow) {
3663
- jsonData.parent_field = parentField;
3664
- jsonData.parent_field_type = fieldType;
3665
- jsonData.parent_name = parentName;
3666
- jsonData.name = name;
3667
- jsonData.prefix = prefix;
3668
- jsonData.exclude = [null];
3669
- }
3670
- return env2.requests.post("/export/get_fields", jsonData);
3671
- });
3551
+ import_compat: importCompat,
3552
+ domain: [["id", "in", ids]],
3553
+ with_context: context
3554
+ };
3555
+ if (isShow) {
3556
+ jsonData.parent_field = parentField;
3557
+ jsonData.parent_field_type = fieldType;
3558
+ jsonData.parent_name = parentName;
3559
+ jsonData.name = name;
3560
+ jsonData.prefix = prefix;
3561
+ jsonData.exclude = [null];
3562
+ }
3563
+ return env2.requests.post("/export/get_fields", jsonData);
3672
3564
  },
3673
- exportExcel(_0) {
3674
- return __async(this, arguments, function* ({
3565
+ async exportExcel({
3566
+ model,
3567
+ domain,
3568
+ ids,
3569
+ fields,
3570
+ type,
3571
+ importCompat,
3572
+ context,
3573
+ groupby
3574
+ }) {
3575
+ const env2 = getEnv();
3576
+ const jsonData = {
3675
3577
  model,
3676
3578
  domain,
3677
3579
  ids,
3580
+ import_compat: importCompat,
3678
3581
  fields,
3679
- type,
3680
- importCompat,
3681
- context,
3682
- groupby
3683
- }) {
3684
- const env2 = getEnv();
3685
- const jsonData = {
3686
- model,
3687
- domain,
3688
- ids,
3689
- import_compat: importCompat,
3690
- fields,
3691
- with_context: context,
3692
- groupby: groupby != null ? groupby : []
3693
- };
3694
- return env2.requests.post_excel(`/export/${type}`, jsonData);
3695
- });
3582
+ with_context: context,
3583
+ groupby: groupby ?? []
3584
+ };
3585
+ return env2.requests.post_excel(`/export/${type}`, jsonData);
3696
3586
  }
3697
3587
  };
3698
3588
  var excel_service_default = ExcelService;
3699
3589
 
3700
3590
  // src/services/form-service/index.ts
3701
3591
  var FormService = {
3702
- getComment(_0) {
3703
- return __async(this, arguments, function* ({ data }) {
3704
- try {
3705
- const env2 = getEnv();
3706
- const jsonData = {
3707
- thread_id: data.thread_id,
3708
- thread_model: data.thread_model,
3709
- limit: 100,
3710
- with_context: {
3711
- lang: data.lang
3712
- }
3713
- };
3714
- return env2.requests.post("/chatter/thread/messages" /* GET_MESSAGE */, jsonData, {
3715
- headers: {
3716
- "Content-Type": "application/json"
3717
- }
3718
- });
3719
- } catch (error) {
3720
- console.error("Error when sending message:", error);
3721
- throw error;
3722
- }
3723
- });
3724
- },
3725
- sentComment(_0) {
3726
- return __async(this, arguments, function* ({ data }) {
3727
- try {
3728
- const env2 = getEnv();
3729
- const jsonData = {
3730
- context: {
3731
- tz: "Asia/Saigon",
3732
- uid: 2,
3733
- allowed_company_ids: [1],
3734
- mail_post_autofollow: false,
3735
- temporary_id: 142183.01
3736
- },
3737
- post_data: {
3738
- body: data.message,
3739
- message_type: "comment",
3740
- attachment_ids: data.attachment_ids,
3741
- attachment_tokens: [],
3742
- subtype_xmlid: data.subtype
3743
- },
3744
- thread_id: Number(data.thread_id),
3745
- thread_model: data.thread_model
3746
- };
3747
- return env2.requests.post("/chatter/message/post" /* SENT_MESSAGE */, jsonData, {
3748
- headers: {
3749
- "Content-Type": "application/json"
3750
- }
3751
- });
3752
- } catch (error) {
3753
- console.error("Error when sent message:", error);
3754
- throw error;
3755
- }
3756
- });
3757
- },
3758
- deleteComment(_0) {
3759
- return __async(this, arguments, function* ({ data }) {
3760
- try {
3761
- const env2 = getEnv();
3762
- const jsonData = {
3763
- attachment_ids: [],
3764
- attachment_tokens: [],
3765
- body: "",
3766
- message_id: data.message_id
3767
- };
3768
- return env2.requests.post("/chatter/message/update_content" /* DELETE_MESSAGE */, jsonData, {
3769
- headers: {
3770
- "Content-Type": "application/json"
3771
- }
3772
- });
3773
- } catch (error) {
3774
- console.error("Error when sent message:", error);
3775
- throw error;
3776
- }
3777
- });
3778
- },
3779
- getImage(_0) {
3780
- return __async(this, arguments, function* ({ data }) {
3781
- try {
3782
- const env2 = getEnv();
3783
- return env2.requests.get(
3784
- `${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
3785
- {
3786
- headers: {
3787
- "Content-Type": "application/json"
3788
- }
3789
- }
3790
- );
3791
- } catch (error) {
3792
- console.error("Error when sent message:", error);
3793
- throw error;
3794
- }
3795
- });
3796
- },
3797
- uploadImage(_0) {
3798
- return __async(this, arguments, function* ({ data }) {
3799
- try {
3800
- const env2 = getEnv();
3801
- return env2.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
3802
- headers: {
3803
- "Content-Type": "multipart/form-data"
3804
- }
3805
- });
3806
- } catch (error) {
3807
- console.error("Error when sent message:", error);
3808
- throw error;
3809
- }
3810
- });
3811
- },
3812
- getFormView(_0) {
3813
- return __async(this, arguments, function* ({ data }) {
3814
- try {
3815
- const env2 = getEnv();
3816
- const jsonData = {
3817
- model: data.model,
3818
- method: "get_formview_action",
3819
- ids: data.id ? [data.id] : [],
3820
- with_context: data.context
3821
- };
3822
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3823
- headers: {
3824
- "Content-Type": "application/json"
3825
- }
3826
- });
3827
- } catch (error) {
3828
- console.error("Error when fetching form view:", error);
3829
- throw error;
3830
- }
3831
- });
3832
- },
3833
- changeStatus(_0) {
3834
- return __async(this, arguments, function* ({ data }) {
3592
+ async getComment({ data }) {
3593
+ try {
3835
3594
  const env2 = getEnv();
3836
- const vals = {
3837
- [data.name]: data.stage_id
3838
- };
3839
3595
  const jsonData = {
3840
- model: data.model,
3841
- method: "web_save",
3596
+ thread_id: data.thread_id,
3597
+ thread_model: data.thread_model,
3598
+ limit: 100,
3842
3599
  with_context: {
3843
- lang: data.lang,
3844
- allowed_company_ids: [1],
3845
- uid: 2,
3846
- search_default_my_ticket: true,
3847
- search_default_is_open: true
3848
- },
3849
- ids: [data.id],
3850
- kwargs: {
3851
- vals,
3852
- specification: {}
3600
+ lang: data.lang
3853
3601
  }
3854
3602
  };
3855
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3603
+ return env2.requests.post("/chatter/thread/messages" /* GET_MESSAGE */, jsonData, {
3856
3604
  headers: {
3857
3605
  "Content-Type": "application/json"
3858
3606
  }
3859
3607
  });
3860
- });
3861
- }
3862
- };
3863
- var form_service_default = FormService;
3864
-
3865
- // src/services/kanban-service/index.ts
3866
- var KanbanServices = {
3867
- getGroups(_0) {
3868
- return __async(this, arguments, function* ({
3869
- model,
3870
- width_context
3871
- }) {
3608
+ } catch (error) {
3609
+ console.error("Error when sending message:", error);
3610
+ throw error;
3611
+ }
3612
+ },
3613
+ async sentComment({ data }) {
3614
+ try {
3872
3615
  const env2 = getEnv();
3873
- const jsonDataView = {
3874
- model,
3875
- method: "web_read_group",
3876
- kwargs: {
3877
- domain: [["stage_id.fold", "=", false]],
3878
- fields: ["color:sum"],
3879
- groupby: ["stage_id"]
3616
+ const jsonData = {
3617
+ context: {
3618
+ tz: "Asia/Saigon",
3619
+ uid: 2,
3620
+ allowed_company_ids: [1],
3621
+ mail_post_autofollow: false,
3622
+ temporary_id: 142183.01
3623
+ },
3624
+ post_data: {
3625
+ body: data.message,
3626
+ message_type: "comment",
3627
+ attachment_ids: data.attachment_ids,
3628
+ attachment_tokens: [],
3629
+ subtype_xmlid: data.subtype
3880
3630
  },
3881
- width_context
3631
+ thread_id: Number(data.thread_id),
3632
+ thread_model: data.thread_model
3882
3633
  };
3883
- return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
3634
+ return env2.requests.post("/chatter/message/post" /* SENT_MESSAGE */, jsonData, {
3884
3635
  headers: {
3885
3636
  "Content-Type": "application/json"
3886
3637
  }
3887
3638
  });
3888
- });
3639
+ } catch (error) {
3640
+ console.error("Error when sent message:", error);
3641
+ throw error;
3642
+ }
3889
3643
  },
3890
- getProgressBar(_0) {
3891
- return __async(this, arguments, function* ({
3892
- field,
3893
- color,
3894
- model,
3895
- width_context
3896
- }) {
3897
- const env2 = getEnv();
3898
- const jsonDataView = {
3899
- model,
3900
- method: "read_progress_bar",
3901
- kwargs: {
3902
- domain: [],
3903
- group_by: "stage_id",
3904
- progress_bar: {
3905
- colors: color,
3906
- field
3907
- }
3908
- },
3909
- width_context
3910
- };
3911
- return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
3912
- headers: {
3913
- "Content-Type": "application/json"
3914
- }
3915
- });
3916
- });
3917
- }
3918
- };
3919
- var kanban_service_default = KanbanServices;
3920
-
3921
- // src/services/model-service/index.ts
3922
- var OBJECT_POSITION = 2;
3923
- var ModelService = {
3924
- getListMyBankAccount(_0) {
3925
- return __async(this, arguments, function* ({
3926
- domain,
3927
- spectification,
3928
- model
3929
- }) {
3644
+ async deleteComment({ data }) {
3645
+ try {
3930
3646
  const env2 = getEnv();
3931
3647
  const jsonData = {
3932
- model,
3933
- method: "web_search_read",
3934
- kwargs: {
3935
- specification: spectification,
3936
- domain,
3937
- limit: 100,
3938
- offset: 0
3939
- }
3648
+ attachment_ids: [],
3649
+ attachment_tokens: [],
3650
+ body: "",
3651
+ message_id: data.message_id
3940
3652
  };
3941
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3653
+ return env2.requests.post("/chatter/message/update_content" /* DELETE_MESSAGE */, jsonData, {
3942
3654
  headers: {
3943
3655
  "Content-Type": "application/json"
3944
3656
  }
3945
3657
  });
3946
- });
3658
+ } catch (error) {
3659
+ console.error("Error when sent message:", error);
3660
+ throw error;
3661
+ }
3947
3662
  },
3948
- getCurrency() {
3949
- return __async(this, null, function* () {
3663
+ async getImage({ data }) {
3664
+ try {
3950
3665
  const env2 = getEnv();
3951
- const jsonData = {
3952
- model: "res.currency",
3953
- method: "web_search_read",
3954
- kwargs: {
3955
- specification: {
3956
- icon_url: {},
3957
- name: {}
3958
- },
3959
- domain: [["active", "=", true]],
3960
- limit: 100,
3961
- offset: 0
3666
+ return env2.requests.get(
3667
+ `${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
3668
+ {
3669
+ headers: {
3670
+ "Content-Type": "application/json"
3671
+ }
3962
3672
  }
3963
- };
3964
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3673
+ );
3674
+ } catch (error) {
3675
+ console.error("Error when sent message:", error);
3676
+ throw error;
3677
+ }
3678
+ },
3679
+ async uploadImage({ data }) {
3680
+ try {
3681
+ const env2 = getEnv();
3682
+ return env2.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
3965
3683
  headers: {
3966
- "Content-Type": "application/json"
3684
+ "Content-Type": "multipart/form-data"
3967
3685
  }
3968
3686
  });
3969
- });
3687
+ } catch (error) {
3688
+ console.error("Error when sent message:", error);
3689
+ throw error;
3690
+ }
3970
3691
  },
3971
- getConversionRate() {
3972
- return __async(this, null, function* () {
3692
+ async getFormView({ data }) {
3693
+ try {
3973
3694
  const env2 = getEnv();
3974
3695
  const jsonData = {
3975
- model: "res.currency",
3976
- method: "web_search_read",
3977
- kwargs: {
3978
- specification: {
3979
- name: {},
3980
- icon_url: {},
3981
- rate_ids: {
3982
- fields: {
3983
- company_rate: {},
3984
- sell: {}
3985
- }
3986
- }
3987
- },
3988
- domain: [["active", "=", true]],
3989
- limit: 100,
3990
- offset: 0
3991
- }
3696
+ model: data.model,
3697
+ method: "get_formview_action",
3698
+ ids: data.id ? [data.id] : [],
3699
+ with_context: data.context
3992
3700
  };
3993
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3701
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3994
3702
  headers: {
3995
3703
  "Content-Type": "application/json"
3996
3704
  }
3997
3705
  });
3706
+ } catch (error) {
3707
+ console.error("Error when fetching form view:", error);
3708
+ throw error;
3709
+ }
3710
+ },
3711
+ async changeStatus({ data }) {
3712
+ const env2 = getEnv();
3713
+ const vals = {
3714
+ [data.name]: data.stage_id
3715
+ };
3716
+ const jsonData = {
3717
+ model: data.model,
3718
+ method: "web_save",
3719
+ with_context: {
3720
+ lang: data.lang,
3721
+ allowed_company_ids: [1],
3722
+ uid: 2,
3723
+ search_default_my_ticket: true,
3724
+ search_default_is_open: true
3725
+ },
3726
+ ids: [data.id],
3727
+ kwargs: {
3728
+ vals,
3729
+ specification: {}
3730
+ }
3731
+ };
3732
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3733
+ headers: {
3734
+ "Content-Type": "application/json"
3735
+ }
3736
+ });
3737
+ }
3738
+ };
3739
+ var form_service_default = FormService;
3740
+
3741
+ // src/services/kanban-service/index.ts
3742
+ var KanbanServices = {
3743
+ async getGroups({
3744
+ model,
3745
+ width_context
3746
+ }) {
3747
+ const env2 = getEnv();
3748
+ const jsonDataView = {
3749
+ model,
3750
+ method: "web_read_group",
3751
+ kwargs: {
3752
+ domain: [["stage_id.fold", "=", false]],
3753
+ fields: ["color:sum"],
3754
+ groupby: ["stage_id"]
3755
+ },
3756
+ width_context
3757
+ };
3758
+ return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
3759
+ headers: {
3760
+ "Content-Type": "application/json"
3761
+ }
3998
3762
  });
3999
3763
  },
4000
- getAll(_0) {
4001
- return __async(this, arguments, function* ({ data }) {
4002
- const env2 = getEnv();
4003
- 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] ? {
4004
- fields: data.fields,
4005
- groupby: data.groupby
4006
- } : {
4007
- count_limit: 10001,
4008
- order: data.sort,
4009
- specification: data.specification
4010
- };
4011
- const jsonData = {
4012
- model: String(data.model),
4013
- method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
4014
- ids: data.ids,
4015
- with_context: data.context,
4016
- kwargs: __spreadValues({
4017
- domain: data.domain,
4018
- limit: data.limit,
4019
- offset: data.offset
4020
- }, jsonReadGroup)
4021
- };
4022
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4023
- headers: {
4024
- "Content-Type": "application/json"
3764
+ async getProgressBar({
3765
+ field,
3766
+ color,
3767
+ model,
3768
+ width_context
3769
+ }) {
3770
+ const env2 = getEnv();
3771
+ const jsonDataView = {
3772
+ model,
3773
+ method: "read_progress_bar",
3774
+ kwargs: {
3775
+ domain: [],
3776
+ group_by: "stage_id",
3777
+ progress_bar: {
3778
+ colors: color,
3779
+ field
4025
3780
  }
4026
- });
3781
+ },
3782
+ width_context
3783
+ };
3784
+ return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
3785
+ headers: {
3786
+ "Content-Type": "application/json"
3787
+ }
3788
+ });
3789
+ }
3790
+ };
3791
+ var kanban_service_default = KanbanServices;
3792
+
3793
+ // src/services/model-service/index.ts
3794
+ var OBJECT_POSITION = 2;
3795
+ var ModelService = {
3796
+ async getListMyBankAccount({
3797
+ domain,
3798
+ spectification,
3799
+ model
3800
+ }) {
3801
+ const env2 = getEnv();
3802
+ const jsonData = {
3803
+ model,
3804
+ method: "web_search_read",
3805
+ kwargs: {
3806
+ specification: spectification,
3807
+ domain,
3808
+ limit: 100,
3809
+ offset: 0
3810
+ }
3811
+ };
3812
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3813
+ headers: {
3814
+ "Content-Type": "application/json"
3815
+ }
4027
3816
  });
4028
3817
  },
4029
- getListCalendar(_0) {
4030
- return __async(this, arguments, function* ({ data }) {
4031
- const env2 = getEnv();
4032
- 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] ? {
3818
+ async getCurrency() {
3819
+ const env2 = getEnv();
3820
+ const jsonData = {
3821
+ model: "res.currency",
3822
+ method: "web_search_read",
3823
+ kwargs: {
3824
+ specification: {
3825
+ icon_url: {},
3826
+ name: {}
3827
+ },
3828
+ domain: [["active", "=", true]],
3829
+ limit: 100,
3830
+ offset: 0
3831
+ }
3832
+ };
3833
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3834
+ headers: {
3835
+ "Content-Type": "application/json"
3836
+ }
3837
+ });
3838
+ },
3839
+ async getConversionRate() {
3840
+ const env2 = getEnv();
3841
+ const jsonData = {
3842
+ model: "res.currency",
3843
+ method: "web_search_read",
3844
+ kwargs: {
3845
+ specification: {
3846
+ name: {},
3847
+ icon_url: {},
3848
+ rate_ids: {
3849
+ fields: {
3850
+ company_rate: {},
3851
+ sell: {}
3852
+ }
3853
+ }
3854
+ },
3855
+ domain: [["active", "=", true]],
3856
+ limit: 100,
3857
+ offset: 0
3858
+ }
3859
+ };
3860
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3861
+ headers: {
3862
+ "Content-Type": "application/json"
3863
+ }
3864
+ });
3865
+ },
3866
+ async getAll({ data }) {
3867
+ const env2 = getEnv();
3868
+ const jsonReadGroup = data.type == "calendar" ? { fields: data?.fields } : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
3869
+ fields: data.fields,
3870
+ groupby: data.groupby
3871
+ } : {
3872
+ count_limit: 10001,
3873
+ order: data.sort,
3874
+ specification: data.specification
3875
+ };
3876
+ const jsonData = {
3877
+ model: String(data.model),
3878
+ method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
3879
+ ids: data.ids,
3880
+ with_context: data.context,
3881
+ kwargs: {
3882
+ domain: data.domain,
3883
+ limit: data.limit,
3884
+ offset: data.offset,
3885
+ ...jsonReadGroup
3886
+ }
3887
+ };
3888
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3889
+ headers: {
3890
+ "Content-Type": "application/json"
3891
+ }
3892
+ });
3893
+ },
3894
+ async getListCalendar({ data }) {
3895
+ const env2 = getEnv();
3896
+ const jsonReadGroup = data.type == "calendar" ? 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,
4033
3913
  fields: data.fields,
4034
- groupby: data.groupby
4035
- } : {
4036
- count_limit: 10001,
4037
- order: data.sort,
4038
- specification: data.specification
4039
- };
4040
- const jsonData = {
4041
- model: String(data.model),
4042
- method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
4043
- ids: data.ids,
4044
- with_context: data.context,
4045
- kwargs: __spreadValues({
4046
- domain: data.domain,
4047
- limit: data.limit,
4048
- offset: data.offset,
4049
- fields: data.fields
4050
- }, jsonReadGroup)
4051
- };
4052
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4053
- headers: {
4054
- "Content-Type": "application/json"
4055
- }
4056
- });
3914
+ ...jsonReadGroup
3915
+ }
3916
+ };
3917
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3918
+ headers: {
3919
+ "Content-Type": "application/json"
3920
+ }
4057
3921
  });
4058
3922
  },
4059
- getList(_0) {
4060
- return __async(this, arguments, function* ({
3923
+ async getList({
3924
+ model,
3925
+ ids = [],
3926
+ specification = {},
3927
+ domain = [],
3928
+ offset,
3929
+ order,
3930
+ context = {},
3931
+ limit = 10
3932
+ }) {
3933
+ const env2 = getEnv();
3934
+ const jsonData = {
4061
3935
  model,
4062
- ids = [],
4063
- specification = {},
4064
- domain = [],
4065
- offset,
4066
- order,
4067
- context = {},
4068
- limit = 10
4069
- }) {
4070
- var _a;
4071
- const env2 = getEnv();
4072
- const jsonData = {
4073
- model,
4074
- method: "web_search_read" /* WEB_SEARCH_READ */,
4075
- ids,
4076
- with_context: context,
4077
- kwargs: {
4078
- specification,
4079
- domain,
4080
- limit,
4081
- offset,
4082
- order
4083
- }
4084
- };
4085
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4086
- headers: {
4087
- "Content-Type": "application/json"
4088
- }
4089
- });
3936
+ method: "web_search_read" /* WEB_SEARCH_READ */,
3937
+ ids,
3938
+ with_context: context,
3939
+ kwargs: {
3940
+ specification,
3941
+ domain,
3942
+ limit,
3943
+ offset,
3944
+ order
3945
+ }
3946
+ };
3947
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3948
+ headers: {
3949
+ "Content-Type": "application/json"
3950
+ }
4090
3951
  });
4091
3952
  },
4092
- getDetail(_0) {
4093
- return __async(this, arguments, function* ({
4094
- ids = [],
3953
+ async getDetail({
3954
+ ids = [],
3955
+ model,
3956
+ specification,
3957
+ context
3958
+ }) {
3959
+ const env2 = getEnv();
3960
+ const jsonData = {
4095
3961
  model,
4096
- specification,
4097
- context
4098
- }) {
4099
- var _a;
4100
- const env2 = getEnv();
4101
- const jsonData = {
4102
- model,
4103
- method: "web_read" /* WEB_READ */,
4104
- ids,
4105
- with_context: context,
4106
- kwargs: {
4107
- specification
4108
- }
4109
- };
4110
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4111
- headers: {
4112
- "Content-Type": "application/json"
4113
- }
4114
- });
3962
+ method: "web_read" /* WEB_READ */,
3963
+ ids,
3964
+ with_context: context,
3965
+ kwargs: {
3966
+ specification
3967
+ }
3968
+ };
3969
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3970
+ headers: {
3971
+ "Content-Type": "application/json"
3972
+ }
4115
3973
  });
4116
3974
  },
4117
- save(_0) {
4118
- return __async(this, arguments, function* ({
3975
+ async save({
3976
+ model,
3977
+ ids = [],
3978
+ data = {},
3979
+ specification = {},
3980
+ context = {},
3981
+ path
3982
+ }) {
3983
+ const env2 = getEnv();
3984
+ const jsonData = {
4119
3985
  model,
4120
- ids = [],
4121
- data = {},
4122
- specification = {},
4123
- context = {},
4124
- path
4125
- }) {
4126
- var _a;
4127
- const env2 = getEnv();
4128
- const jsonData = {
4129
- model,
4130
- method: "web_save" /* WEB_SAVE */,
4131
- with_context: context,
4132
- ids,
4133
- kwargs: {
4134
- vals: data,
4135
- specification
4136
- }
4137
- };
4138
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post(path != null ? path : "/call" /* CALL_PATH */, jsonData, {
4139
- headers: {
4140
- "Content-Type": "application/json"
4141
- }
4142
- });
3986
+ method: "web_save" /* WEB_SAVE */,
3987
+ with_context: context,
3988
+ ids,
3989
+ kwargs: {
3990
+ vals: data,
3991
+ specification
3992
+ }
3993
+ };
3994
+ return env2?.requests?.post(path ?? "/call" /* CALL_PATH */, jsonData, {
3995
+ headers: {
3996
+ "Content-Type": "application/json"
3997
+ }
4143
3998
  });
4144
3999
  },
4145
- delete(_0) {
4146
- return __async(this, arguments, function* ({ ids = [], model }) {
4147
- var _a;
4148
- const env2 = getEnv();
4149
- const jsonData = {
4150
- model,
4151
- method: "unlink" /* UNLINK */,
4152
- ids
4153
- };
4154
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4155
- headers: {
4156
- "Content-Type": "application/json"
4157
- }
4158
- });
4000
+ async delete({ ids = [], model }) {
4001
+ const env2 = getEnv();
4002
+ const jsonData = {
4003
+ model,
4004
+ method: "unlink" /* UNLINK */,
4005
+ ids
4006
+ };
4007
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4008
+ headers: {
4009
+ "Content-Type": "application/json"
4010
+ }
4159
4011
  });
4160
4012
  },
4161
- onChange(_0) {
4162
- return __async(this, arguments, function* ({
4163
- ids = [],
4013
+ async onChange({
4014
+ ids = [],
4015
+ model,
4016
+ object,
4017
+ specification,
4018
+ context,
4019
+ fieldChange
4020
+ }) {
4021
+ const env2 = getEnv();
4022
+ const jsonData = {
4164
4023
  model,
4165
- object,
4166
- specification,
4167
- context,
4168
- fieldChange
4169
- }) {
4170
- var _a;
4171
- const env2 = getEnv();
4172
- const jsonData = {
4173
- model,
4174
- method: "onchange" /* ONCHANGE */,
4175
- ids,
4176
- with_context: context,
4177
- args: [
4178
- object ? object : {},
4179
- fieldChange ? fieldChange : [],
4180
- specification
4181
- ]
4182
- };
4183
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4184
- headers: {
4185
- "Content-Type": "application/json"
4186
- }
4187
- });
4024
+ method: "onchange" /* ONCHANGE */,
4025
+ ids,
4026
+ with_context: context,
4027
+ args: [
4028
+ object ? object : {},
4029
+ fieldChange ? fieldChange : [],
4030
+ specification
4031
+ ]
4032
+ };
4033
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4034
+ headers: {
4035
+ "Content-Type": "application/json"
4036
+ }
4188
4037
  });
4189
4038
  },
4190
- getListFieldsOnchange(_0) {
4191
- return __async(this, arguments, function* ({ model }) {
4192
- var _a;
4193
- const env2 = getEnv();
4194
- const jsonData = {
4195
- model,
4196
- method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
4197
- };
4198
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4199
- headers: {
4200
- "Content-Type": "application/json"
4201
- }
4202
- });
4039
+ async getListFieldsOnchange({ model }) {
4040
+ const env2 = getEnv();
4041
+ const jsonData = {
4042
+ model,
4043
+ method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
4044
+ };
4045
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4046
+ headers: {
4047
+ "Content-Type": "application/json"
4048
+ }
4203
4049
  });
4204
4050
  },
4205
4051
  parseORMOdoo(data) {
@@ -4213,14 +4059,13 @@ var ModelService = {
4213
4059
  data[key] = "/";
4214
4060
  }
4215
4061
  }
4216
- return __spreadValues({}, data);
4062
+ return { ...data };
4217
4063
  },
4218
4064
  toDataJS(data, viewData, model) {
4219
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
4220
4065
  for (const key in data) {
4221
4066
  if (data[key] === false) {
4222
4067
  if (viewData && model) {
4223
- 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 */) {
4068
+ if (viewData?.models?.[model]?.[key]?.type !== "boolean" /* BOOLEAN */) {
4224
4069
  data[key] = null;
4225
4070
  }
4226
4071
  } else {
@@ -4230,13 +4075,12 @@ var ModelService = {
4230
4075
  data[key] = "Draft";
4231
4076
  } else if (data[key] !== false) {
4232
4077
  if (model !== void 0) {
4233
- 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 */) {
4234
- data[key] = (_k = (_j = data[key]) != null ? _j : data[key] = []) == null ? void 0 : _k.map((item) => {
4235
- var _a2, _b2, _c2, _d2;
4236
- 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;
4078
+ if (viewData?.models?.[model]?.[key]?.type === "one2many" /* ONE2MANY */ || viewData?.models?.[model]?.[key]?.type === "many2many" /* MANY2MANY */) {
4079
+ data[key] = (data[key] ??= [])?.map((item) => {
4080
+ const relation = viewData?.models?.[model]?.[key]?.relation;
4237
4081
  if (relation !== void 0) {
4238
- if ((_d2 = viewData == null ? void 0 : viewData.models) == null ? void 0 : _d2[relation]) {
4239
- if ((item == null ? void 0 : item.length) >= 3) {
4082
+ if (viewData?.models?.[relation]) {
4083
+ if (item?.length >= 3) {
4240
4084
  return ModelService.toDataJS(
4241
4085
  item[OBJECT_POSITION],
4242
4086
  viewData,
@@ -4246,7 +4090,7 @@ var ModelService = {
4246
4090
  return ModelService.toDataJS(item, viewData, relation);
4247
4091
  }
4248
4092
  } else {
4249
- if ((item == null ? void 0 : item.length) >= 3) {
4093
+ if (item?.length >= 3) {
4250
4094
  return item[OBJECT_POSITION];
4251
4095
  } else {
4252
4096
  return item;
@@ -4258,569 +4102,526 @@ var ModelService = {
4258
4102
  }
4259
4103
  }
4260
4104
  }
4261
- return __spreadValues({}, data);
4105
+ return { ...data };
4262
4106
  }
4263
4107
  };
4264
4108
  var model_service_default = ModelService;
4265
4109
 
4266
4110
  // src/services/user-service/index.ts
4267
4111
  var UserService = {
4268
- getProfile(path) {
4269
- return __async(this, null, function* () {
4270
- const env2 = getEnv();
4271
- return env2.requests.get(path != null ? path : "/userinfo" /* PROFILE_PATH */, {
4272
- headers: {
4273
- "Content-Type": "application/x-www-form-urlencoded"
4274
- }
4275
- });
4112
+ async getProfile(path) {
4113
+ const env2 = getEnv();
4114
+ return env2.requests.get(path ?? "/userinfo" /* PROFILE_PATH */, {
4115
+ headers: {
4116
+ "Content-Type": "application/x-www-form-urlencoded"
4117
+ }
4276
4118
  });
4277
4119
  },
4278
- getUser(_0) {
4279
- return __async(this, arguments, function* ({ context, id }) {
4280
- const env2 = getEnv();
4281
- const jsonData = {
4282
- model: "res.users",
4283
- method: "web_read",
4284
- ids: [id],
4285
- with_context: context,
4286
- kwargs: {
4287
- specification: {
4288
- display_name: {},
4289
- image_1920: {},
4290
- name: {},
4291
- login: {},
4292
- email: {},
4293
- password: {},
4294
- visible_group_id: {
4295
- fields: {
4296
- id: {},
4297
- display_name: {}
4298
- }
4299
- },
4300
- company_id: {
4301
- fields: {
4302
- id: {},
4303
- display_name: {}
4304
- }
4120
+ async getUser({ context, id }) {
4121
+ const env2 = getEnv();
4122
+ const jsonData = {
4123
+ model: "res.users",
4124
+ method: "web_read",
4125
+ ids: [id],
4126
+ with_context: context,
4127
+ kwargs: {
4128
+ specification: {
4129
+ display_name: {},
4130
+ image_1920: {},
4131
+ name: {},
4132
+ login: {},
4133
+ email: {},
4134
+ password: {},
4135
+ visible_group_id: {
4136
+ fields: {
4137
+ id: {},
4138
+ display_name: {}
4139
+ }
4140
+ },
4141
+ company_id: {
4142
+ fields: {
4143
+ id: {},
4144
+ display_name: {}
4305
4145
  }
4306
4146
  }
4307
4147
  }
4308
- };
4309
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4310
- headers: {
4311
- "Content-Type": "application/json"
4312
- }
4313
- });
4148
+ }
4149
+ };
4150
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4151
+ headers: {
4152
+ "Content-Type": "application/json"
4153
+ }
4314
4154
  });
4315
4155
  },
4316
- switchUserLocale: (_0) => __async(null, [_0], function* ({ id, values }) {
4317
- var _a;
4156
+ switchUserLocale: async ({ id, values }) => {
4318
4157
  const env2 = getEnv();
4319
4158
  const jsonData = {
4320
4159
  model: "res.users",
4321
4160
  domain: [["id", "=", id]],
4322
4161
  values
4323
4162
  };
4324
- return env2 == null ? void 0 : env2.requests.post((_a = UriConstants) == null ? void 0 : _a.CREATE_UPDATE_PATH, jsonData, {
4163
+ return env2?.requests.post(UriConstants?.CREATE_UPDATE_PATH, jsonData, {
4325
4164
  headers: {
4326
4165
  "Content-Type": "application/json"
4327
4166
  }
4328
4167
  });
4329
- })
4168
+ }
4330
4169
  };
4331
4170
  var user_service_default = UserService;
4332
4171
 
4333
4172
  // src/services/view-service/index.ts
4334
4173
  var ViewService = {
4335
- getView(_0) {
4336
- return __async(this, arguments, function* ({
4174
+ async getView({
4175
+ model,
4176
+ views,
4177
+ context = {},
4178
+ options = {},
4179
+ aid
4180
+ }) {
4181
+ const env2 = getEnv();
4182
+ const defaultOptions = {
4183
+ load_filters: true,
4184
+ toolbar: true,
4185
+ action_id: aid
4186
+ };
4187
+ const jsonDataView = {
4337
4188
  model,
4338
- views,
4339
- context = {},
4340
- options = {},
4341
- aid
4342
- }) {
4343
- var _a;
4344
- const env2 = getEnv();
4345
- const defaultOptions = {
4346
- load_filters: true,
4347
- toolbar: true,
4348
- action_id: aid
4349
- };
4350
- const jsonDataView = {
4351
- model,
4352
- method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
4353
- kwargs: {
4354
- views,
4355
- options: __spreadValues(__spreadValues({}, options), defaultOptions)
4356
- },
4357
- with_context: context
4358
- };
4359
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonDataView, {
4360
- headers: {
4361
- "Content-Type": "application/json"
4362
- }
4363
- });
4189
+ method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
4190
+ kwargs: {
4191
+ views,
4192
+ options: { ...options, ...defaultOptions }
4193
+ },
4194
+ with_context: context
4195
+ };
4196
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonDataView, {
4197
+ headers: {
4198
+ "Content-Type": "application/json"
4199
+ }
4364
4200
  });
4365
4201
  },
4366
- getMenu(context) {
4367
- return __async(this, null, function* () {
4368
- var _a;
4369
- const env2 = getEnv();
4370
- const jsonData = {
4371
- model: "ir.ui.menu" /* MENU */,
4372
- method: "web_search_read" /* WEB_SEARCH_READ */,
4373
- ids: [],
4374
- with_context: context,
4375
- kwargs: {
4376
- specification: {
4377
- active: {},
4378
- name: {},
4379
- is_display: {},
4380
- sequence: {},
4381
- complete_name: {},
4382
- action: {
4383
- fields: {
4384
- display_name: {},
4385
- type: {},
4386
- binding_view_types: {}
4387
- // res_model: {},
4388
- }
4202
+ async getMenu(context) {
4203
+ const env2 = getEnv();
4204
+ const jsonData = {
4205
+ model: "ir.ui.menu" /* MENU */,
4206
+ method: "web_search_read" /* WEB_SEARCH_READ */,
4207
+ ids: [],
4208
+ with_context: context,
4209
+ kwargs: {
4210
+ specification: {
4211
+ active: {},
4212
+ name: {},
4213
+ is_display: {},
4214
+ sequence: {},
4215
+ complete_name: {},
4216
+ action: {
4217
+ fields: {
4218
+ display_name: {},
4219
+ type: {},
4220
+ binding_view_types: {}
4221
+ // res_model: {},
4222
+ }
4223
+ },
4224
+ url_icon: {},
4225
+ web_icon: {},
4226
+ web_icon_data: {},
4227
+ groups_id: {
4228
+ fields: {
4229
+ full_name: {}
4389
4230
  },
4390
- url_icon: {},
4391
- web_icon: {},
4392
- web_icon_data: {},
4393
- groups_id: {
4394
- fields: {
4395
- full_name: {}
4231
+ limit: 40,
4232
+ order: ""
4233
+ },
4234
+ display_name: {},
4235
+ child_id: {
4236
+ fields: {
4237
+ active: {},
4238
+ name: {},
4239
+ is_display: {},
4240
+ sequence: {},
4241
+ complete_name: {},
4242
+ action: {
4243
+ fields: {
4244
+ display_name: {},
4245
+ type: {},
4246
+ binding_view_types: {}
4247
+ // res_model: {},
4248
+ }
4396
4249
  },
4397
- limit: 40,
4398
- order: ""
4399
- },
4400
- display_name: {},
4401
- child_id: {
4402
- fields: {
4403
- active: {},
4404
- name: {},
4405
- is_display: {},
4406
- sequence: {},
4407
- complete_name: {},
4408
- action: {
4409
- fields: {
4410
- display_name: {},
4411
- type: {},
4412
- binding_view_types: {}
4413
- // res_model: {},
4414
- }
4250
+ url_icon: {},
4251
+ web_icon: {},
4252
+ web_icon_data: {},
4253
+ groups_id: {
4254
+ fields: {
4255
+ full_name: {}
4415
4256
  },
4416
- url_icon: {},
4417
- web_icon: {},
4418
- web_icon_data: {},
4419
- groups_id: {
4420
- fields: {
4421
- full_name: {}
4257
+ limit: 40,
4258
+ order: ""
4259
+ },
4260
+ display_name: {},
4261
+ child_id: {
4262
+ fields: {
4263
+ active: {},
4264
+ name: {},
4265
+ is_display: {},
4266
+ sequence: {},
4267
+ complete_name: {},
4268
+ action: {
4269
+ fields: {
4270
+ display_name: {},
4271
+ type: {},
4272
+ binding_view_types: {}
4273
+ // res_model: {},
4274
+ }
4422
4275
  },
4423
- limit: 40,
4424
- order: ""
4425
- },
4426
- display_name: {},
4427
- child_id: {
4428
- fields: {
4429
- active: {},
4430
- name: {},
4431
- is_display: {},
4432
- sequence: {},
4433
- complete_name: {},
4434
- action: {
4435
- fields: {
4436
- display_name: {},
4437
- type: {},
4438
- binding_view_types: {}
4439
- // res_model: {},
4440
- }
4276
+ url_icon: {},
4277
+ web_icon: {},
4278
+ web_icon_data: {},
4279
+ groups_id: {
4280
+ fields: {
4281
+ full_name: {}
4441
4282
  },
4442
- url_icon: {},
4443
- web_icon: {},
4444
- web_icon_data: {},
4445
- groups_id: {
4446
- fields: {
4447
- full_name: {}
4283
+ limit: 40,
4284
+ order: ""
4285
+ },
4286
+ display_name: {},
4287
+ child_id: {
4288
+ fields: {
4289
+ active: {},
4290
+ name: {},
4291
+ is_display: {},
4292
+ sequence: {},
4293
+ complete_name: {},
4294
+ action: {
4295
+ fields: {
4296
+ display_name: {},
4297
+ type: {},
4298
+ binding_view_types: {}
4299
+ // res_model: {},
4300
+ }
4448
4301
  },
4449
- limit: 40,
4450
- order: ""
4451
- },
4452
- display_name: {},
4453
- child_id: {
4454
- fields: {
4455
- active: {},
4456
- name: {},
4457
- is_display: {},
4458
- sequence: {},
4459
- complete_name: {},
4460
- action: {
4461
- fields: {
4462
- display_name: {},
4463
- type: {},
4464
- binding_view_types: {}
4465
- // res_model: {},
4466
- }
4302
+ url_icon: {},
4303
+ web_icon: {},
4304
+ web_icon_data: {},
4305
+ groups_id: {
4306
+ fields: {
4307
+ full_name: {}
4467
4308
  },
4468
- url_icon: {},
4469
- web_icon: {},
4470
- web_icon_data: {},
4471
- groups_id: {
4472
- fields: {
4473
- full_name: {}
4474
- },
4475
- limit: 40,
4476
- order: ""
4477
- },
4478
- display_name: {},
4479
- child_id: {
4480
- fields: {},
4481
- limit: 40,
4482
- order: ""
4483
- }
4309
+ limit: 40,
4310
+ order: ""
4484
4311
  },
4485
- limit: 40,
4486
- order: ""
4487
- }
4488
- },
4489
- limit: 40,
4490
- order: ""
4491
- }
4492
- },
4493
- limit: 40,
4494
- order: ""
4495
- }
4496
- },
4497
- domain: [
4498
- "&",
4499
- ["is_display", "=", true],
4500
- "&",
4501
- ["active", "=", true],
4502
- ["parent_id", "=", false]
4503
- ]
4504
- }
4505
- };
4506
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4507
- headers: {
4508
- "Content-Type": "application/json"
4509
- }
4510
- });
4312
+ display_name: {},
4313
+ child_id: {
4314
+ fields: {},
4315
+ limit: 40,
4316
+ order: ""
4317
+ }
4318
+ },
4319
+ limit: 40,
4320
+ order: ""
4321
+ }
4322
+ },
4323
+ limit: 40,
4324
+ order: ""
4325
+ }
4326
+ },
4327
+ limit: 40,
4328
+ order: ""
4329
+ }
4330
+ },
4331
+ domain: [
4332
+ "&",
4333
+ ["is_display", "=", true],
4334
+ "&",
4335
+ ["active", "=", true],
4336
+ ["parent_id", "=", false]
4337
+ ]
4338
+ }
4339
+ };
4340
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4341
+ headers: {
4342
+ "Content-Type": "application/json"
4343
+ }
4511
4344
  });
4512
4345
  },
4513
- getActionDetail(aid, context) {
4514
- return __async(this, null, function* () {
4515
- var _a;
4516
- const env2 = getEnv();
4517
- const jsonData = {
4518
- model: "ir.actions.act_window" /* WINDOW_ACTION */,
4519
- method: "web_read" /* WEB_READ */,
4520
- ids: [aid],
4521
- with_context: context,
4522
- kwargs: {
4523
- specification: {
4524
- id: {},
4525
- name: {},
4526
- res_model: {},
4527
- views: {},
4528
- view_mode: {},
4529
- mobile_view_mode: {},
4530
- domain: {},
4531
- context: {},
4532
- groups_id: {},
4533
- search_view_id: {}
4534
- }
4535
- }
4536
- };
4537
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4538
- headers: {
4539
- "Content-Type": "application/json"
4346
+ async getActionDetail(aid, context) {
4347
+ const env2 = getEnv();
4348
+ const jsonData = {
4349
+ model: "ir.actions.act_window" /* WINDOW_ACTION */,
4350
+ method: "web_read" /* WEB_READ */,
4351
+ ids: [aid],
4352
+ with_context: context,
4353
+ kwargs: {
4354
+ specification: {
4355
+ id: {},
4356
+ name: {},
4357
+ res_model: {},
4358
+ views: {},
4359
+ view_mode: {},
4360
+ mobile_view_mode: {},
4361
+ domain: {},
4362
+ context: {},
4363
+ groups_id: {},
4364
+ search_view_id: {}
4540
4365
  }
4541
- });
4366
+ }
4367
+ };
4368
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4369
+ headers: {
4370
+ "Content-Type": "application/json"
4371
+ }
4542
4372
  });
4543
4373
  },
4544
- getResequence(_0) {
4545
- return __async(this, arguments, function* ({
4374
+ async getResequence({
4375
+ model,
4376
+ ids,
4377
+ context,
4378
+ offset
4379
+ }) {
4380
+ const env2 = getEnv();
4381
+ const jsonData = {
4546
4382
  model,
4383
+ with_context: context,
4547
4384
  ids,
4548
- context,
4549
- offset
4550
- }) {
4551
- const env2 = getEnv();
4552
- const jsonData = __spreadValues({
4553
- model,
4554
- with_context: context,
4555
- ids,
4556
- field: "sequence"
4557
- }, offset > 0 ? { offset } : {});
4558
- return env2 == null ? void 0 : env2.requests.post("/web/dataset/resequence", jsonData, {
4559
- headers: {
4560
- "Content-Type": "application/json"
4561
- }
4562
- });
4563
- });
4564
- },
4565
- getSelectionItem(_0) {
4566
- return __async(this, arguments, function* ({ data }) {
4567
- var _a;
4568
- const env2 = getEnv();
4569
- const jsonData = {
4570
- model: data.model,
4571
- ids: [],
4572
- method: "get_data_select",
4573
- with_context: data.context,
4574
- kwargs: {
4575
- count_limit: 10001,
4576
- domain: data.domain ? data.domain : [],
4577
- offset: 0,
4578
- order: "",
4579
- specification: (_a = data == null ? void 0 : data.specification) != null ? _a : {
4580
- id: {},
4581
- name: {},
4582
- display_name: {}
4583
- }
4584
- }
4585
- };
4586
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4587
- headers: {
4588
- "Content-Type": "application/json"
4589
- }
4590
- });
4385
+ field: "sequence",
4386
+ ...offset > 0 ? { offset } : {}
4387
+ };
4388
+ return env2?.requests.post("/web/dataset/resequence", jsonData, {
4389
+ headers: {
4390
+ "Content-Type": "application/json"
4391
+ }
4591
4392
  });
4592
4393
  },
4593
- loadMessages() {
4594
- return __async(this, null, function* () {
4595
- const env2 = getEnv();
4596
- return env2.requests.post(
4597
- "/load_message_failures" /* LOAD_MESSAGE */,
4598
- {},
4599
- {
4600
- headers: {
4601
- "Content-Type": "application/json"
4602
- }
4394
+ async getSelectionItem({ data }) {
4395
+ const env2 = getEnv();
4396
+ const jsonData = {
4397
+ model: data.model,
4398
+ ids: [],
4399
+ method: "get_data_select",
4400
+ with_context: data.context,
4401
+ kwargs: {
4402
+ count_limit: 10001,
4403
+ domain: data.domain ? data.domain : [],
4404
+ offset: 0,
4405
+ order: "",
4406
+ specification: data?.specification ?? {
4407
+ id: {},
4408
+ name: {},
4409
+ display_name: {}
4603
4410
  }
4604
- );
4411
+ }
4412
+ };
4413
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4414
+ headers: {
4415
+ "Content-Type": "application/json"
4416
+ }
4605
4417
  });
4606
4418
  },
4607
- getVersion() {
4608
- return __async(this, null, function* () {
4609
- var _a;
4610
- const env2 = getEnv();
4611
- console.log("env?.requests", env2, env2 == null ? void 0 : env2.requests);
4612
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.get("", {
4419
+ async loadMessages() {
4420
+ const env2 = getEnv();
4421
+ return env2.requests.post(
4422
+ "/load_message_failures" /* LOAD_MESSAGE */,
4423
+ {},
4424
+ {
4613
4425
  headers: {
4614
4426
  "Content-Type": "application/json"
4615
4427
  }
4616
- });
4428
+ }
4429
+ );
4430
+ },
4431
+ async getVersion() {
4432
+ const env2 = getEnv();
4433
+ return env2?.requests.get("", {
4434
+ headers: {
4435
+ "Content-Type": "application/json"
4436
+ }
4617
4437
  });
4618
4438
  },
4619
- get2FAMethods(_0) {
4620
- return __async(this, arguments, function* ({
4439
+ async get2FAMethods({
4440
+ method,
4441
+ with_context
4442
+ }) {
4443
+ const env2 = getEnv();
4444
+ const jsonData = {
4621
4445
  method,
4622
4446
  with_context
4623
- }) {
4624
- const env2 = getEnv();
4625
- const jsonData = {
4626
- method,
4627
- with_context
4628
- };
4629
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4630
- headers: {
4631
- "Content-Type": "application/json"
4632
- }
4633
- });
4447
+ };
4448
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4449
+ headers: {
4450
+ "Content-Type": "application/json"
4451
+ }
4634
4452
  });
4635
4453
  },
4636
- verify2FA(_0) {
4637
- return __async(this, arguments, function* ({
4454
+ async verify2FA({
4455
+ method,
4456
+ with_context,
4457
+ code,
4458
+ device,
4459
+ location
4460
+ }) {
4461
+ const env2 = getEnv();
4462
+ const jsonData = {
4638
4463
  method,
4639
- with_context,
4640
- code,
4641
- device,
4642
- location
4643
- }) {
4644
- const env2 = getEnv();
4645
- const jsonData = {
4646
- method,
4647
- kwargs: {
4648
- vals: {
4649
- code,
4650
- device,
4651
- location
4652
- }
4653
- },
4654
- with_context
4655
- };
4656
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4657
- headers: {
4658
- "Content-Type": "application/json"
4659
- },
4660
- withCredentials: true
4661
- });
4464
+ kwargs: {
4465
+ vals: {
4466
+ code,
4467
+ device,
4468
+ location
4469
+ }
4470
+ },
4471
+ with_context
4472
+ };
4473
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4474
+ headers: {
4475
+ "Content-Type": "application/json"
4476
+ },
4477
+ withCredentials: true
4662
4478
  });
4663
4479
  },
4664
- signInSSO(_0) {
4665
- return __async(this, arguments, function* ({
4666
- redirect_uri,
4667
- state,
4668
- client_id,
4480
+ async signInSSO({
4481
+ redirect_uri,
4482
+ state,
4483
+ client_id,
4484
+ response_type,
4485
+ path
4486
+ }) {
4487
+ const env2 = getEnv();
4488
+ const params = new URLSearchParams({
4669
4489
  response_type,
4670
- path
4671
- }) {
4672
- const env2 = getEnv();
4673
- const params = new URLSearchParams({
4674
- response_type,
4675
- client_id,
4676
- redirect_uri,
4677
- state
4678
- });
4679
- const url = `${path}?${params.toString()}`;
4680
- return env2 == null ? void 0 : env2.requests.get(url, {
4681
- headers: {
4682
- "Content-Type": "application/json"
4683
- },
4684
- withCredentials: true
4685
- });
4490
+ client_id,
4491
+ redirect_uri,
4492
+ state
4493
+ });
4494
+ const url = `${path}?${params.toString()}`;
4495
+ return env2?.requests.get(url, {
4496
+ headers: {
4497
+ "Content-Type": "application/json"
4498
+ },
4499
+ withCredentials: true
4686
4500
  });
4687
4501
  },
4688
- grantAccess(_0) {
4689
- return __async(this, arguments, function* ({
4502
+ async grantAccess({
4503
+ redirect_uri,
4504
+ state,
4505
+ client_id,
4506
+ scopes
4507
+ }) {
4508
+ const env2 = getEnv();
4509
+ const jsonData = {
4690
4510
  redirect_uri,
4691
4511
  state,
4692
4512
  client_id,
4693
4513
  scopes
4694
- }) {
4695
- const env2 = getEnv();
4696
- const jsonData = {
4697
- redirect_uri,
4698
- state,
4699
- client_id,
4700
- scopes
4701
- };
4702
- return env2 == null ? void 0 : env2.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
4703
- headers: {
4704
- "Content-Type": "application/json"
4705
- },
4706
- withCredentials: true
4707
- });
4514
+ };
4515
+ return env2?.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
4516
+ headers: {
4517
+ "Content-Type": "application/json"
4518
+ },
4519
+ withCredentials: true
4708
4520
  });
4709
4521
  },
4710
- getFieldsViewSecurity(_0) {
4711
- return __async(this, arguments, function* ({
4522
+ async getFieldsViewSecurity({
4523
+ method,
4524
+ token,
4525
+ views
4526
+ }) {
4527
+ const env2 = getEnv();
4528
+ const jsonData = {
4712
4529
  method,
4713
- token,
4714
- views
4715
- }) {
4716
- const env2 = getEnv();
4717
- const jsonData = {
4718
- method,
4719
- kwargs: {
4720
- views
4721
- },
4722
- with_context: {
4723
- token
4724
- }
4725
- };
4726
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4727
- headers: {
4728
- "Content-Type": "application/json"
4729
- }
4730
- });
4530
+ kwargs: {
4531
+ views
4532
+ },
4533
+ with_context: {
4534
+ token
4535
+ }
4536
+ };
4537
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4538
+ headers: {
4539
+ "Content-Type": "application/json"
4540
+ }
4731
4541
  });
4732
4542
  },
4733
- settingsWebRead2fa(_0) {
4734
- return __async(this, arguments, function* ({
4543
+ async settingsWebRead2fa({
4544
+ method,
4545
+ model,
4546
+ kwargs,
4547
+ token
4548
+ }) {
4549
+ const env2 = getEnv();
4550
+ const jsonData = {
4735
4551
  method,
4736
4552
  model,
4737
4553
  kwargs,
4738
- token
4739
- }) {
4740
- const env2 = getEnv();
4741
- const jsonData = {
4742
- method,
4743
- model,
4744
- kwargs,
4745
- with_context: {
4746
- token
4747
- }
4748
- };
4749
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4750
- headers: {
4751
- "Content-Type": "application/json"
4752
- }
4753
- });
4554
+ with_context: {
4555
+ token
4556
+ }
4557
+ };
4558
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4559
+ headers: {
4560
+ "Content-Type": "application/json"
4561
+ }
4754
4562
  });
4755
4563
  },
4756
- requestSetupTotp(_0) {
4757
- return __async(this, arguments, function* ({ method, token }) {
4758
- const env2 = getEnv();
4759
- const jsonData = {
4760
- method,
4761
- with_context: {
4762
- token
4763
- }
4764
- };
4765
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4766
- headers: {
4767
- "Content-Type": "application/json"
4768
- }
4769
- });
4564
+ async requestSetupTotp({ method, token }) {
4565
+ const env2 = getEnv();
4566
+ const jsonData = {
4567
+ method,
4568
+ with_context: {
4569
+ token
4570
+ }
4571
+ };
4572
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4573
+ headers: {
4574
+ "Content-Type": "application/json"
4575
+ }
4770
4576
  });
4771
4577
  },
4772
- verifyTotp(_0) {
4773
- return __async(this, arguments, function* ({
4578
+ async verifyTotp({
4579
+ method,
4580
+ action_token,
4581
+ code
4582
+ }) {
4583
+ const env2 = getEnv();
4584
+ const jsonData = {
4774
4585
  method,
4775
- action_token,
4776
- code
4777
- }) {
4778
- const env2 = getEnv();
4779
- const jsonData = {
4780
- method,
4781
- kwargs: {
4782
- vals: {
4783
- code
4784
- }
4785
- },
4786
- with_context: {
4787
- action_token
4586
+ kwargs: {
4587
+ vals: {
4588
+ code
4788
4589
  }
4789
- };
4790
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4791
- headers: {
4792
- "Content-Type": "application/json"
4793
- }
4794
- });
4590
+ },
4591
+ with_context: {
4592
+ action_token
4593
+ }
4594
+ };
4595
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4596
+ headers: {
4597
+ "Content-Type": "application/json"
4598
+ }
4795
4599
  });
4796
4600
  },
4797
- removeTotpSetUp(_0) {
4798
- return __async(this, arguments, function* ({ method, token }) {
4799
- const env2 = getEnv();
4800
- const jsonData = {
4801
- method,
4802
- with_context: {
4803
- token
4804
- }
4805
- };
4806
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4807
- headers: {
4808
- "Content-Type": "application/json"
4809
- }
4810
- });
4601
+ async removeTotpSetUp({ method, token }) {
4602
+ const env2 = getEnv();
4603
+ const jsonData = {
4604
+ method,
4605
+ with_context: {
4606
+ token
4607
+ }
4608
+ };
4609
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4610
+ headers: {
4611
+ "Content-Type": "application/json"
4612
+ }
4811
4613
  });
4812
4614
  }
4813
4615
  };
4814
4616
  var view_service_default = ViewService;
4815
- // Annotate the CommonJS export names for ESM import in node:
4816
- 0 && (module.exports = {
4817
- ActionService,
4818
- AuthService,
4819
- CompanyService,
4820
- ExcelService,
4821
- FormService,
4822
- KanbanService,
4823
- ModelService,
4824
- UserService,
4825
- ViewService
4826
- });
4617
+ export {
4618
+ action_service_default as ActionService,
4619
+ auth_service_default as AuthService,
4620
+ company_service_default as CompanyService,
4621
+ excel_service_default as ExcelService,
4622
+ form_service_default as FormService,
4623
+ kanban_service_default as KanbanService,
4624
+ model_service_default as ModelService,
4625
+ user_service_default as UserService,
4626
+ view_service_default as ViewService
4627
+ };