@fctc/interface-logic 1.5.7 → 1.5.9

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