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