@fctc/interface-logic 1.5.5 → 1.5.7

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