@fctc/interface-logic 1.7.2 → 1.7.3

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