@fctc/interface-logic 1.5.3 → 1.5.5

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.
package/dist/services.js CHANGED
@@ -1,28 +1,10 @@
1
1
  "use strict";
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
- var __defProps = Object.defineProperties;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
6
  var __getProtoOf = Object.getPrototypeOf;
10
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
- var __pow = Math.pow;
13
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
14
- var __spreadValues = (a, b) => {
15
- for (var prop in b || (b = {}))
16
- if (__hasOwnProp.call(b, prop))
17
- __defNormalProp(a, prop, b[prop]);
18
- if (__getOwnPropSymbols)
19
- for (var prop of __getOwnPropSymbols(b)) {
20
- if (__propIsEnum.call(b, prop))
21
- __defNormalProp(a, prop, b[prop]);
22
- }
23
- return a;
24
- };
25
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
26
8
  var __export = (target, all) => {
27
9
  for (var name in all)
28
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -44,26 +26,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
44
26
  mod
45
27
  ));
46
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
47
- var __async = (__this, __arguments, generator) => {
48
- return new Promise((resolve, reject) => {
49
- var fulfilled = (value) => {
50
- try {
51
- step(generator.next(value));
52
- } catch (e) {
53
- reject(e);
54
- }
55
- };
56
- var rejected = (value) => {
57
- try {
58
- step(generator.throw(value));
59
- } catch (e) {
60
- reject(e);
61
- }
62
- };
63
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
64
- step((generator = generator.apply(__this, __arguments)).next());
65
- });
66
- };
67
29
 
68
30
  // src/services.ts
69
31
  var services_exports = {};
@@ -1194,6 +1156,22 @@ var PyRelativeDelta = class _PyRelativeDelta {
1194
1156
  this.microsecond = params.microsecond;
1195
1157
  this.weekday = params.weekday;
1196
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;
1197
1175
  negate() {
1198
1176
  return new _PyRelativeDelta(this, -1);
1199
1177
  }
@@ -1308,7 +1286,7 @@ function execOnIterable(iterable, func) {
1308
1286
  if (typeof iterable === "object" && !Array.isArray(iterable) && !(iterable instanceof Set)) {
1309
1287
  iterable = Object.keys(iterable);
1310
1288
  }
1311
- if (typeof (iterable == null ? void 0 : iterable[Symbol.iterator]) !== "function") {
1289
+ if (typeof iterable?.[Symbol.iterator] !== "function") {
1312
1290
  throw new EvaluationError("value not iterable");
1313
1291
  }
1314
1292
  return func(iterable);
@@ -1631,7 +1609,7 @@ function applyBinaryOp(ast, context) {
1631
1609
  }
1632
1610
  return Math.floor(left / right);
1633
1611
  case "**":
1634
- return __pow(left, right);
1612
+ return left ** right;
1635
1613
  case "==":
1636
1614
  return isEqual(left, right);
1637
1615
  case "<>":
@@ -1753,7 +1731,7 @@ function evaluate(ast, context = {}) {
1753
1731
  const dicts = /* @__PURE__ */ new Set();
1754
1732
  let pyContext;
1755
1733
  const evalContext = Object.create(context);
1756
- if (!(evalContext == null ? void 0 : evalContext.context)) {
1734
+ if (!evalContext?.context) {
1757
1735
  Object.defineProperty(evalContext, "context", {
1758
1736
  get() {
1759
1737
  if (!pyContext) {
@@ -1764,18 +1742,17 @@ function evaluate(ast, context = {}) {
1764
1742
  });
1765
1743
  }
1766
1744
  function _innerEvaluate(ast2) {
1767
- var _a, _b, _c;
1768
- switch (ast2 == null ? void 0 : ast2.type) {
1745
+ switch (ast2?.type) {
1769
1746
  case 0:
1770
1747
  // Number
1771
1748
  case 1:
1772
1749
  return ast2.value;
1773
1750
  case 5:
1774
1751
  if (ast2.value in evalContext) {
1775
- if (typeof evalContext[ast2.value] === "object" && ((_a = evalContext[ast2.value]) == null ? void 0 : _a.id)) {
1776
- 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;
1777
1754
  }
1778
- return (_c = evalContext[ast2.value]) != null ? _c : false;
1755
+ return evalContext[ast2.value] ?? false;
1779
1756
  } else if (ast2.value in BUILTINS) {
1780
1757
  return BUILTINS[ast2.value];
1781
1758
  } else {
@@ -1812,7 +1789,7 @@ function evaluate(ast, context = {}) {
1812
1789
  const args = ast2.args.map(_evaluate);
1813
1790
  const kwargs = {};
1814
1791
  for (const kwarg in ast2.kwargs) {
1815
- kwargs[kwarg] = _evaluate(ast2 == null ? void 0 : ast2.kwargs[kwarg]);
1792
+ kwargs[kwarg] = _evaluate(ast2?.kwargs[kwarg]);
1816
1793
  }
1817
1794
  if (fnValue === PyDate || fnValue === PyDateTime || fnValue === PyTime || fnValue === PyRelativeDelta || fnValue === PyTimeDelta) {
1818
1795
  return fnValue.create(...args, kwargs);
@@ -1891,25 +1868,9 @@ function escapeRegExp(str) {
1891
1868
  var InvalidDomainError = class extends Error {
1892
1869
  };
1893
1870
  var Domain = class _Domain {
1894
- constructor(descr = []) {
1895
- this.ast = { type: -1, value: null };
1896
- if (descr instanceof _Domain) {
1897
- return new _Domain(descr.toString());
1898
- } else {
1899
- let rawAST;
1900
- try {
1901
- rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
1902
- } catch (error) {
1903
- throw new InvalidDomainError(
1904
- `Invalid domain representation: ${descr}`,
1905
- {
1906
- cause: error
1907
- }
1908
- );
1909
- }
1910
- this.ast = normalizeDomainAST(rawAST);
1911
- }
1912
- }
1871
+ ast = { type: -1, value: null };
1872
+ static TRUE;
1873
+ static FALSE;
1913
1874
  static combine(domains, operator) {
1914
1875
  if (domains.length === 0) {
1915
1876
  return new _Domain([]);
@@ -1988,6 +1949,24 @@ var Domain = class _Domain {
1988
1949
  processLeaf(d.ast.value, 0, "&", newDomain);
1989
1950
  return newDomain;
1990
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
+ }
1991
1970
  contains(record) {
1992
1971
  const expr = evaluate(this.ast, record);
1993
1972
  return matchDomain(record, expr);
@@ -2006,7 +1985,7 @@ var Domain = class _Domain {
2006
1985
  return evaluatedAsList;
2007
1986
  }
2008
1987
  return this.toString();
2009
- } catch (e) {
1988
+ } catch {
2010
1989
  return this.toString();
2011
1990
  }
2012
1991
  }
@@ -2234,22 +2213,22 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
2234
2213
 
2235
2214
  // src/utils/storage/local-storage.ts
2236
2215
  var localStorageUtils = () => {
2237
- const setToken = (access_token) => __async(null, null, function* () {
2216
+ const setToken = async (access_token) => {
2238
2217
  localStorage.setItem("accessToken", access_token);
2239
- });
2240
- const setRefreshToken = (refresh_token) => __async(null, null, function* () {
2218
+ };
2219
+ const setRefreshToken = async (refresh_token) => {
2241
2220
  localStorage.setItem("refreshToken", refresh_token);
2242
- });
2243
- const getAccessToken = () => __async(null, null, function* () {
2221
+ };
2222
+ const getAccessToken = async () => {
2244
2223
  return localStorage.getItem("accessToken");
2245
- });
2246
- const getRefreshToken = () => __async(null, null, function* () {
2224
+ };
2225
+ const getRefreshToken = async () => {
2247
2226
  return localStorage.getItem("refreshToken");
2248
- });
2249
- const clearToken = () => __async(null, null, function* () {
2227
+ };
2228
+ const clearToken = async () => {
2250
2229
  localStorage.removeItem("accessToken");
2251
2230
  localStorage.removeItem("refreshToken");
2252
- });
2231
+ };
2253
2232
  return {
2254
2233
  setToken,
2255
2234
  setRefreshToken,
@@ -2261,9 +2240,9 @@ var localStorageUtils = () => {
2261
2240
 
2262
2241
  // src/utils/storage/session-storage.ts
2263
2242
  var sessionStorageUtils = () => {
2264
- const getBrowserSession = () => __async(null, null, function* () {
2243
+ const getBrowserSession = async () => {
2265
2244
  return sessionStorage.getItem("browserSession");
2266
- });
2245
+ };
2267
2246
  return {
2268
2247
  getBrowserSession
2269
2248
  };
@@ -2272,14 +2251,13 @@ var sessionStorageUtils = () => {
2272
2251
  // src/configs/axios-client.ts
2273
2252
  var axiosClient = {
2274
2253
  init(config) {
2275
- var _a, _b;
2276
- const localStorage2 = (_a = config.localStorageUtils) != null ? _a : localStorageUtils();
2277
- const sessionStorage2 = (_b = config.sessionStorageUtils) != null ? _b : sessionStorageUtils();
2254
+ const localStorage2 = config.localStorageUtils ?? localStorageUtils();
2255
+ const sessionStorage2 = config.sessionStorageUtils ?? sessionStorageUtils();
2278
2256
  const db = config.db;
2279
2257
  let isRefreshing = false;
2280
2258
  let failedQueue = [];
2281
2259
  const processQueue = (error, token = null) => {
2282
- failedQueue == null ? void 0 : failedQueue.forEach((prom) => {
2260
+ failedQueue?.forEach((prom) => {
2283
2261
  if (error) {
2284
2262
  prom.reject(error);
2285
2263
  } else {
@@ -2295,14 +2273,14 @@ var axiosClient = {
2295
2273
  paramsSerializer: (params) => new URLSearchParams(params).toString()
2296
2274
  });
2297
2275
  instance.interceptors.request.use(
2298
- (config2) => __async(null, null, function* () {
2276
+ async (config2) => {
2299
2277
  const useRefreshToken = config2.useRefreshToken;
2300
- const token = useRefreshToken ? yield localStorage2.getRefreshToken() : yield localStorage2.getAccessToken();
2278
+ const token = useRefreshToken ? await localStorage2.getRefreshToken() : await localStorage2.getAccessToken();
2301
2279
  if (token) {
2302
2280
  config2.headers["Authorization"] = "Bearer " + token;
2303
2281
  }
2304
2282
  return config2;
2305
- }),
2283
+ },
2306
2284
  (error) => {
2307
2285
  Promise.reject(error);
2308
2286
  }
@@ -2311,21 +2289,19 @@ var axiosClient = {
2311
2289
  (response) => {
2312
2290
  return handleResponse(response);
2313
2291
  },
2314
- (error) => __async(null, null, function* () {
2315
- var _a2, _b2, _c;
2316
- const handleError3 = (error2) => __async(null, null, function* () {
2317
- var _a3;
2292
+ async (error) => {
2293
+ const handleError3 = async (error2) => {
2318
2294
  if (!error2.response) {
2319
2295
  return error2;
2320
2296
  }
2321
2297
  const { data } = error2.response;
2322
- if (data && data.code === 400 && ["invalid_grant"].includes((_a3 = data.data) == null ? void 0 : _a3.error)) {
2323
- yield clearAuthToken();
2298
+ if (data && data.code === 400 && ["invalid_grant"].includes(data.data?.error)) {
2299
+ await clearAuthToken();
2324
2300
  }
2325
2301
  return data;
2326
- });
2302
+ };
2327
2303
  const originalRequest = error.config;
2328
- if ((((_a2 = error.response) == null ? void 0 : _a2.status) === 403 || ((_b2 = error.response) == null ? void 0 : _b2.status) === 401 || ((_c = error.response) == null ? void 0 : _c.status) === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
2304
+ if ((error.response?.status === 403 || error.response?.status === 401 || error.response?.status === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
2329
2305
  error.response.data.code
2330
2306
  )) {
2331
2307
  if (isRefreshing) {
@@ -2338,19 +2314,18 @@ var axiosClient = {
2338
2314
  token
2339
2315
  );
2340
2316
  return instance.request(originalRequest);
2341
- }).catch((err) => __async(null, null, function* () {
2342
- var _a3, _b3;
2343
- 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)) {
2344
- yield clearAuthToken();
2317
+ }).catch(async (err) => {
2318
+ if ((err.response?.status === 400 || err.response?.status === 401) && ["invalid_grant"].includes(err.response.data.error)) {
2319
+ await clearAuthToken();
2345
2320
  }
2346
- }));
2321
+ });
2347
2322
  }
2348
- const browserSession = yield sessionStorage2.getBrowserSession();
2349
- const refreshToken = yield localStorage2.getRefreshToken();
2350
- const accessTokenExp = yield localStorage2.getAccessToken();
2323
+ const browserSession = await sessionStorage2.getBrowserSession();
2324
+ const refreshToken = await localStorage2.getRefreshToken();
2325
+ const accessTokenExp = await localStorage2.getAccessToken();
2351
2326
  isRefreshing = true;
2352
2327
  if (!refreshToken && (!browserSession || browserSession == "unActive")) {
2353
- yield clearAuthToken();
2328
+ await clearAuthToken();
2354
2329
  } else {
2355
2330
  const payload = Object.fromEntries(
2356
2331
  Object.entries({
@@ -2361,9 +2336,8 @@ var axiosClient = {
2361
2336
  }).filter(([_, value]) => !!value)
2362
2337
  );
2363
2338
  return new Promise(function(resolve) {
2364
- var _a3;
2365
2339
  import_axios.default.post(
2366
- `${config.baseUrl}${(_a3 = config.refreshTokenEndpoint) != null ? _a3 : "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2340
+ `${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2367
2341
  payload,
2368
2342
  {
2369
2343
  headers: {
@@ -2371,10 +2345,10 @@ var axiosClient = {
2371
2345
  Authorization: `Bearer ${accessTokenExp}`
2372
2346
  }
2373
2347
  }
2374
- ).then((res) => __async(null, null, function* () {
2348
+ ).then(async (res) => {
2375
2349
  const data = res.data;
2376
- yield localStorage2.setToken(data.access_token);
2377
- yield localStorage2.setRefreshToken(data.refresh_token);
2350
+ await localStorage2.setToken(data.access_token);
2351
+ await localStorage2.setRefreshToken(data.refresh_token);
2378
2352
  import_axios.default.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
2379
2353
  originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
2380
2354
  originalRequest.data = updateTokenParamInOriginalRequest(
@@ -2383,26 +2357,25 @@ var axiosClient = {
2383
2357
  );
2384
2358
  processQueue(null, data.access_token);
2385
2359
  resolve(instance.request(originalRequest));
2386
- })).catch((err) => __async(null, null, function* () {
2387
- var _a4;
2388
- 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") {
2389
- yield clearAuthToken();
2360
+ }).catch(async (err) => {
2361
+ if (err && (err?.error_code === "AUTHEN_FAIL" || err?.error_code === "TOKEN_EXPIRED" || err?.error_code === "TOKEN_INCORRECT" || err?.code === "ERR_BAD_REQUEST") || err?.error_code === "ERR_2FA_006") {
2362
+ await clearAuthToken();
2390
2363
  }
2391
2364
  if (err && err.response) {
2392
- const { error_code } = ((_a4 = err.response) == null ? void 0 : _a4.data) || {};
2365
+ const { error_code } = err.response?.data || {};
2393
2366
  if (error_code === "AUTHEN_FAIL") {
2394
- yield clearAuthToken();
2367
+ await clearAuthToken();
2395
2368
  }
2396
2369
  }
2397
2370
  processQueue(err, null);
2398
- })).finally(() => {
2371
+ }).finally(() => {
2399
2372
  isRefreshing = false;
2400
2373
  });
2401
2374
  });
2402
2375
  }
2403
2376
  }
2404
- return Promise.reject(yield handleError3(error));
2405
- })
2377
+ return Promise.reject(await handleError3(error));
2378
+ }
2406
2379
  );
2407
2380
  const handleResponse = (res) => {
2408
2381
  if (res && res.data) {
@@ -2411,7 +2384,6 @@ var axiosClient = {
2411
2384
  return res;
2412
2385
  };
2413
2386
  const handleError2 = (error) => {
2414
- var _a2, _b2, _c;
2415
2387
  if (error.isAxiosError && error.code === "ECONNABORTED") {
2416
2388
  console.error("Request Timeout Error:", error);
2417
2389
  return "Request Timeout Error";
@@ -2419,17 +2391,17 @@ var axiosClient = {
2419
2391
  console.error("Network Error:", error);
2420
2392
  return "Network Error";
2421
2393
  } else {
2422
- console.error("Other Error:", error == null ? void 0 : error.response);
2423
- const errorMessage = ((_b2 = (_a2 = error == null ? void 0 : error.response) == null ? void 0 : _a2.data) == null ? void 0 : _b2.message) || "An error occurred";
2424
- return { message: errorMessage, status: (_c = error == null ? void 0 : error.response) == null ? void 0 : _c.status };
2394
+ console.error("Other Error:", error?.response);
2395
+ const errorMessage = error?.response?.data?.message || "An error occurred";
2396
+ return { message: errorMessage, status: error?.response?.status };
2425
2397
  }
2426
2398
  };
2427
- const clearAuthToken = () => __async(null, null, function* () {
2428
- yield localStorage2.clearToken();
2399
+ const clearAuthToken = async () => {
2400
+ await localStorage2.clearToken();
2429
2401
  if (typeof window !== "undefined") {
2430
2402
  window.location.href = `/login`;
2431
2403
  }
2432
- });
2404
+ };
2433
2405
  function formatUrl(url, db2) {
2434
2406
  return url + (db2 ? "?db=" + db2 : "");
2435
2407
  }
@@ -2642,7 +2614,7 @@ var headerSlice = (0, import_toolkit5.createSlice)({
2642
2614
  },
2643
2615
  reducers: {
2644
2616
  setHeader: (state, action) => {
2645
- state.value = __spreadValues(__spreadValues({}, state.value), action.payload);
2617
+ state.value = { ...state.value, ...action.payload };
2646
2618
  },
2647
2619
  setAllowedCompanyIds: (state, action) => {
2648
2620
  state.value.allowedCompanyIds = action.payload;
@@ -3068,6 +3040,18 @@ var envStore = (0, import_toolkit11.configureStore)({
3068
3040
 
3069
3041
  // src/environment/EnvStore.ts
3070
3042
  var EnvStore = class {
3043
+ envStore;
3044
+ baseUrl;
3045
+ requests;
3046
+ context;
3047
+ defaultCompany;
3048
+ config;
3049
+ companies;
3050
+ user;
3051
+ db;
3052
+ localStorageUtils;
3053
+ sessionStorageUtils;
3054
+ refreshTokenEndpoint;
3071
3055
  constructor(envStore2, localStorageUtils2, sessionStorageUtils2) {
3072
3056
  this.envStore = envStore2;
3073
3057
  this.localStorageUtils = localStorageUtils2;
@@ -3076,24 +3060,25 @@ var EnvStore = class {
3076
3060
  }
3077
3061
  setup() {
3078
3062
  const env2 = this.envStore.getState().env;
3079
- this.baseUrl = env2 == null ? void 0 : env2.baseUrl;
3080
- this.requests = env2 == null ? void 0 : env2.requests;
3081
- this.context = env2 == null ? void 0 : env2.context;
3082
- this.defaultCompany = env2 == null ? void 0 : env2.defaultCompany;
3083
- this.config = env2 == null ? void 0 : env2.config;
3084
- this.companies = (env2 == null ? void 0 : env2.companies) || [];
3085
- this.user = env2 == null ? void 0 : env2.user;
3086
- this.db = env2 == null ? void 0 : env2.db;
3087
- this.refreshTokenEndpoint = env2 == null ? void 0 : env2.refreshTokenEndpoint;
3063
+ this.baseUrl = env2?.baseUrl;
3064
+ this.requests = env2?.requests;
3065
+ this.context = env2?.context;
3066
+ this.defaultCompany = env2?.defaultCompany;
3067
+ this.config = env2?.config;
3068
+ this.companies = env2?.companies || [];
3069
+ this.user = env2?.user;
3070
+ this.db = env2?.db;
3071
+ this.refreshTokenEndpoint = env2?.refreshTokenEndpoint;
3088
3072
  }
3089
3073
  setupEnv(envConfig) {
3090
3074
  const dispatch = this.envStore.dispatch;
3091
- const env2 = __spreadProps(__spreadValues({}, envConfig), {
3075
+ const env2 = {
3076
+ ...envConfig,
3092
3077
  localStorageUtils: this.localStorageUtils,
3093
3078
  sessionStorageUtils: this.sessionStorageUtils
3094
- });
3079
+ };
3095
3080
  const requests = axiosClient.init(env2);
3096
- dispatch(setEnv(__spreadProps(__spreadValues({}, env2), { requests })));
3081
+ dispatch(setEnv({ ...env2, requests }));
3097
3082
  this.setup();
3098
3083
  }
3099
3084
  setUid(uid) {
@@ -3137,61 +3122,35 @@ function getEnv() {
3137
3122
  // src/services/action-service/index.ts
3138
3123
  var ActionService = {
3139
3124
  // Load Action
3140
- loadAction(_0) {
3141
- return __async(this, arguments, function* ({
3142
- idAction,
3143
- context
3144
- }) {
3145
- const env2 = getEnv();
3146
- const jsonData = {
3147
- action_id: idAction,
3148
- with_context: __spreadValues({}, context)
3149
- };
3150
- return env2.requests.post(`${"/load_action" /* LOAD_ACTION */}`, jsonData, {
3151
- headers: {
3152
- "Content-Type": "application/json"
3153
- }
3154
- });
3155
- });
3156
- },
3157
- // Call Button
3158
- callButton(_0) {
3159
- return __async(this, arguments, function* ({
3160
- model,
3161
- ids = [],
3162
- context,
3163
- method
3164
- }) {
3165
- try {
3166
- const env2 = getEnv();
3167
- const jsonData = {
3168
- model,
3169
- method,
3170
- ids,
3171
- with_context: context
3172
- };
3173
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3174
- headers: {
3175
- "Content-Type": "application/json"
3176
- }
3177
- });
3178
- } catch (error) {
3179
- console.error("Error when calling button action:", error);
3180
- throw error;
3125
+ async loadAction({
3126
+ idAction,
3127
+ context
3128
+ }) {
3129
+ const env2 = getEnv();
3130
+ const jsonData = {
3131
+ action_id: idAction,
3132
+ with_context: {
3133
+ ...context
3134
+ }
3135
+ };
3136
+ return env2.requests.post(`${"/load_action" /* LOAD_ACTION */}`, jsonData, {
3137
+ headers: {
3138
+ "Content-Type": "application/json"
3181
3139
  }
3182
3140
  });
3183
3141
  },
3184
- // remove Row
3185
- removeRows(_0) {
3186
- return __async(this, arguments, function* ({
3187
- model,
3188
- ids,
3189
- context
3190
- }) {
3142
+ // Call Button
3143
+ async callButton({
3144
+ model,
3145
+ ids = [],
3146
+ context,
3147
+ method
3148
+ }) {
3149
+ try {
3191
3150
  const env2 = getEnv();
3192
3151
  const jsonData = {
3193
3152
  model,
3194
- method: "unlink",
3153
+ method,
3195
3154
  ids,
3196
3155
  with_context: context
3197
3156
  };
@@ -3200,96 +3159,112 @@ var ActionService = {
3200
3159
  "Content-Type": "application/json"
3201
3160
  }
3202
3161
  });
3162
+ } catch (error) {
3163
+ console.error("Error when calling button action:", error);
3164
+ throw error;
3165
+ }
3166
+ },
3167
+ // remove Row
3168
+ async removeRows({
3169
+ model,
3170
+ ids,
3171
+ context
3172
+ }) {
3173
+ const env2 = getEnv();
3174
+ const jsonData = {
3175
+ model,
3176
+ method: "unlink",
3177
+ ids,
3178
+ with_context: context
3179
+ };
3180
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3181
+ headers: {
3182
+ "Content-Type": "application/json"
3183
+ }
3203
3184
  });
3204
3185
  },
3205
3186
  // Duplicate Model
3206
- duplicateRecord(_0) {
3207
- return __async(this, arguments, function* ({
3187
+ async duplicateRecord({
3188
+ model,
3189
+ id,
3190
+ context
3191
+ }) {
3192
+ const env2 = getEnv();
3193
+ const jsonData = {
3208
3194
  model,
3209
- id,
3210
- context
3211
- }) {
3212
- const env2 = getEnv();
3213
- const jsonData = {
3214
- model,
3215
- method: "copy",
3216
- ids: id,
3217
- with_context: context
3218
- };
3219
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3220
- headers: {
3221
- "Content-Type": "application/json"
3222
- }
3223
- });
3195
+ method: "copy",
3196
+ ids: id,
3197
+ with_context: context
3198
+ };
3199
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3200
+ headers: {
3201
+ "Content-Type": "application/json"
3202
+ }
3224
3203
  });
3225
3204
  },
3226
3205
  // Get Print Report
3227
- getPrintReportName(_0) {
3228
- return __async(this, arguments, function* ({ id }) {
3229
- const env2 = getEnv();
3230
- const jsonData = {
3231
- model: "ir.actions.report",
3232
- method: "web_read",
3233
- id,
3234
- kwargs: {
3235
- specification: {
3236
- report_name: {}
3237
- }
3238
- }
3239
- };
3240
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3241
- headers: {
3242
- "Content-Type": "application/json"
3206
+ async getPrintReportName({ id }) {
3207
+ const env2 = getEnv();
3208
+ const jsonData = {
3209
+ model: "ir.actions.report",
3210
+ method: "web_read",
3211
+ id,
3212
+ kwargs: {
3213
+ specification: {
3214
+ report_name: {}
3243
3215
  }
3244
- });
3216
+ }
3217
+ };
3218
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3219
+ headers: {
3220
+ "Content-Type": "application/json"
3221
+ }
3245
3222
  });
3246
3223
  },
3247
3224
  //Save Print Invoice
3248
- print(_0) {
3249
- return __async(this, arguments, function* ({ id, report, db }) {
3250
- const env2 = getEnv();
3251
- const jsonData = {
3252
- report,
3253
- id,
3254
- type: "pdf",
3255
- file_response: true,
3256
- db
3257
- };
3258
- const queryString = toQueryString(jsonData);
3259
- const urlWithParams = `${"/report" /* REPORT_PATH */}?${queryString}`;
3260
- return env2.requests.get(urlWithParams, {
3261
- headers: {
3262
- "Content-Type": "application/json"
3263
- },
3264
- responseType: "arraybuffer"
3265
- });
3225
+ async print({ id, report, db }) {
3226
+ const env2 = getEnv();
3227
+ const jsonData = {
3228
+ report,
3229
+ id,
3230
+ type: "pdf",
3231
+ file_response: true,
3232
+ db
3233
+ };
3234
+ const queryString = toQueryString(jsonData);
3235
+ const urlWithParams = `${"/report" /* REPORT_PATH */}?${queryString}`;
3236
+ return env2.requests.get(urlWithParams, {
3237
+ headers: {
3238
+ "Content-Type": "application/json"
3239
+ },
3240
+ responseType: "arraybuffer"
3266
3241
  });
3267
3242
  },
3268
3243
  //Run Action
3269
- runAction(_0) {
3270
- return __async(this, arguments, function* ({
3271
- idAction,
3272
- context
3273
- }) {
3274
- const env2 = getEnv();
3275
- const jsonData = {
3276
- action_id: idAction,
3277
- with_context: __spreadValues({}, context)
3278
- // context: {
3279
- // lang: 'en_US',
3280
- // tz: 'Asia/Saigon',
3281
- // uid: 2,
3282
- // allowed_company_ids: [1],
3283
- // active_id: Array.isArray(idDetail) ? idDetail[0] : idDetail,
3284
- // active_ids: Array.isArray(idDetail) ? [...idDetail] : idDetail,
3285
- // active_model: model,
3286
- // },
3287
- };
3288
- return env2.requests.post(`${"/run_action" /* RUN_ACTION_PATH */}`, jsonData, {
3289
- headers: {
3290
- "Content-Type": "application/json"
3291
- }
3292
- });
3244
+ async runAction({
3245
+ idAction,
3246
+ context
3247
+ }) {
3248
+ const env2 = getEnv();
3249
+ const jsonData = {
3250
+ action_id: idAction,
3251
+ with_context: {
3252
+ ...context
3253
+ }
3254
+ // context: {
3255
+ // lang: 'en_US',
3256
+ // tz: 'Asia/Saigon',
3257
+ // uid: 2,
3258
+ // allowed_company_ids: [1],
3259
+ // active_id: Array.isArray(idDetail) ? idDetail[0] : idDetail,
3260
+ // active_ids: Array.isArray(idDetail) ? [...idDetail] : idDetail,
3261
+ // active_model: model,
3262
+ // },
3263
+ };
3264
+ return env2.requests.post(`${"/run_action" /* RUN_ACTION_PATH */}`, jsonData, {
3265
+ headers: {
3266
+ "Content-Type": "application/json"
3267
+ }
3293
3268
  });
3294
3269
  }
3295
3270
  };
@@ -3297,238 +3272,200 @@ var action_service_default = ActionService;
3297
3272
 
3298
3273
  // src/services/auth-service/index.ts
3299
3274
  var AuthService = {
3300
- login(body) {
3301
- return __async(this, null, function* () {
3302
- var _a, _b, _c, _d;
3303
- const env2 = getEnv();
3304
- const payload = Object.fromEntries(
3305
- Object.entries({
3306
- username: body.email,
3307
- password: body.password,
3308
- grant_type: ((_a = env2 == null ? void 0 : env2.config) == null ? void 0 : _a.grantType) || "",
3309
- client_id: ((_b = env2 == null ? void 0 : env2.config) == null ? void 0 : _b.clientId) || "",
3310
- client_secret: ((_c = env2 == null ? void 0 : env2.config) == null ? void 0 : _c.clientSecret) || ""
3311
- }).filter(([_, value]) => !!value)
3312
- );
3313
- const encodedData = new URLSearchParams(payload).toString();
3314
- return (_d = env2 == null ? void 0 : env2.requests) == null ? void 0 : _d.post(body.path, encodedData, {
3315
- headers: {
3316
- "Content-Type": "application/x-www-form-urlencoded"
3317
- }
3318
- });
3275
+ async login(body) {
3276
+ const env2 = getEnv();
3277
+ const payload = Object.fromEntries(
3278
+ Object.entries({
3279
+ username: body.email,
3280
+ password: body.password,
3281
+ grant_type: env2?.config?.grantType || "",
3282
+ client_id: env2?.config?.clientId || "",
3283
+ client_secret: env2?.config?.clientSecret || ""
3284
+ }).filter(([_, value]) => !!value)
3285
+ );
3286
+ const encodedData = new URLSearchParams(payload).toString();
3287
+ return env2?.requests?.post(body.path, encodedData, {
3288
+ headers: {
3289
+ "Content-Type": "application/x-www-form-urlencoded"
3290
+ }
3319
3291
  });
3320
3292
  },
3321
- forgotPassword(email) {
3322
- return __async(this, null, function* () {
3323
- var _a;
3324
- const env2 = getEnv();
3325
- const bodyData = {
3326
- login: email,
3327
- url: `${window.location.origin}/reset-password`
3328
- };
3329
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/reset_password" /* RESET_PASSWORD_PATH */, bodyData, {
3330
- headers: {
3331
- "Content-Type": "application/json"
3332
- }
3333
- });
3293
+ async forgotPassword(email) {
3294
+ const env2 = getEnv();
3295
+ const bodyData = {
3296
+ login: email,
3297
+ url: `${window.location.origin}/reset-password`
3298
+ };
3299
+ return env2?.requests?.post("/reset_password" /* RESET_PASSWORD_PATH */, bodyData, {
3300
+ headers: {
3301
+ "Content-Type": "application/json"
3302
+ }
3334
3303
  });
3335
3304
  },
3336
- forgotPasswordSSO(_0) {
3337
- return __async(this, arguments, function* ({
3338
- email,
3339
- with_context,
3340
- method
3341
- }) {
3342
- var _a;
3343
- const env2 = getEnv();
3344
- const body = {
3345
- method,
3346
- kwargs: {
3347
- vals: {
3348
- email
3349
- }
3350
- },
3351
- with_context
3352
- };
3353
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, body, {
3354
- headers: {
3355
- "Content-Type": "application/json"
3305
+ async forgotPasswordSSO({
3306
+ email,
3307
+ with_context,
3308
+ method
3309
+ }) {
3310
+ const env2 = getEnv();
3311
+ const body = {
3312
+ method,
3313
+ kwargs: {
3314
+ vals: {
3315
+ email
3356
3316
  }
3357
- });
3317
+ },
3318
+ with_context
3319
+ };
3320
+ return env2?.requests?.post("/call" /* CALL_PATH */, body, {
3321
+ headers: {
3322
+ "Content-Type": "application/json"
3323
+ }
3358
3324
  });
3359
3325
  },
3360
- resetPassword(data, token) {
3361
- return __async(this, null, function* () {
3362
- var _a;
3363
- const env2 = getEnv();
3364
- const bodyData = {
3365
- token,
3366
- password: data.password,
3367
- new_password: data.confirmPassword
3368
- };
3369
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/change_password" /* CHANGE_PASSWORD_PATH */, bodyData, {
3370
- headers: {
3371
- "Content-Type": "application/json"
3372
- }
3373
- });
3326
+ async resetPassword(data, token) {
3327
+ const env2 = getEnv();
3328
+ const bodyData = {
3329
+ token,
3330
+ password: data.password,
3331
+ new_password: data.confirmPassword
3332
+ };
3333
+ return env2?.requests?.post("/change_password" /* CHANGE_PASSWORD_PATH */, bodyData, {
3334
+ headers: {
3335
+ "Content-Type": "application/json"
3336
+ }
3374
3337
  });
3375
3338
  },
3376
- resetPasswordSSO(_0) {
3377
- return __async(this, arguments, function* ({
3339
+ async resetPasswordSSO({
3340
+ method,
3341
+ password,
3342
+ with_context
3343
+ }) {
3344
+ const env2 = getEnv();
3345
+ const bodyData = {
3378
3346
  method,
3379
- password,
3380
- with_context
3381
- }) {
3382
- var _a;
3383
- const env2 = getEnv();
3384
- const bodyData = {
3385
- method,
3386
- kwargs: {
3387
- vals: {
3388
- password
3389
- }
3390
- },
3391
- with_context
3392
- };
3393
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, bodyData, {
3394
- headers: {
3395
- "Content-Type": "application/json"
3347
+ kwargs: {
3348
+ vals: {
3349
+ password
3396
3350
  }
3397
- });
3351
+ },
3352
+ with_context
3353
+ };
3354
+ return env2?.requests?.post("/call" /* CALL_PATH */, bodyData, {
3355
+ headers: {
3356
+ "Content-Type": "application/json"
3357
+ }
3398
3358
  });
3399
3359
  },
3400
- updatePassword(data, token) {
3401
- return __async(this, null, function* () {
3402
- var _a;
3403
- const env2 = getEnv();
3404
- const bodyData = {
3405
- token,
3406
- old_password: data.oldPassword,
3407
- new_password: data.newPassword
3408
- };
3409
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/change_password_parent" /* UPDATE_PASSWORD_PATH */, bodyData, {
3360
+ async updatePassword(data, token) {
3361
+ const env2 = getEnv();
3362
+ const bodyData = {
3363
+ token,
3364
+ old_password: data.oldPassword,
3365
+ new_password: data.newPassword
3366
+ };
3367
+ return env2?.requests?.post("/change_password_parent" /* UPDATE_PASSWORD_PATH */, bodyData, {
3368
+ headers: {
3369
+ "Content-Type": "application/json"
3370
+ }
3371
+ });
3372
+ },
3373
+ async isValidToken(token) {
3374
+ const env2 = getEnv();
3375
+ const bodyData = {
3376
+ token
3377
+ };
3378
+ return env2?.requests?.post("/check_token" /* TOKEN */, bodyData, {
3379
+ headers: {
3380
+ "Content-Type": "application/json"
3381
+ }
3382
+ });
3383
+ },
3384
+ async loginSocial({
3385
+ db,
3386
+ state,
3387
+ access_token
3388
+ }) {
3389
+ const env2 = getEnv();
3390
+ return env2?.requests?.post(
3391
+ "/token/generate" /* GENTOKEN_SOCIAL */,
3392
+ { state, access_token },
3393
+ {
3410
3394
  headers: {
3411
3395
  "Content-Type": "application/json"
3412
3396
  }
3413
- });
3414
- });
3415
- },
3416
- isValidToken(token) {
3417
- return __async(this, null, function* () {
3418
- var _a;
3419
- const env2 = getEnv();
3420
- const bodyData = {
3421
- token
3422
- };
3423
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/check_token" /* TOKEN */, bodyData, {
3424
- headers: {
3425
- "Content-Type": "application/json"
3426
- }
3427
- });
3428
- });
3429
- },
3430
- loginSocial(_0) {
3431
- return __async(this, arguments, function* ({
3432
- db,
3433
- state,
3434
- access_token
3435
- }) {
3436
- var _a;
3437
- const env2 = getEnv();
3438
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post(
3439
- "/token/generate" /* GENTOKEN_SOCIAL */,
3440
- { state, access_token },
3441
- {
3442
- headers: {
3443
- "Content-Type": "application/json"
3444
- }
3445
- }
3446
- );
3447
- });
3397
+ }
3398
+ );
3448
3399
  },
3449
- getProviders(db) {
3450
- return __async(this, null, function* () {
3451
- var _a;
3452
- const env2 = getEnv();
3453
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.get("/oauth/providers", { params: { db } });
3454
- });
3400
+ async getProviders(db) {
3401
+ const env2 = getEnv();
3402
+ return env2?.requests?.get("/oauth/providers", { params: { db } });
3455
3403
  },
3456
- getAccessByCode(code) {
3457
- return __async(this, null, function* () {
3458
- var _a, _b, _c, _d;
3459
- const env2 = getEnv();
3460
- const data = new URLSearchParams();
3461
- data.append("code", code);
3462
- data.append("grant_type", "authorization_code");
3463
- data.append("client_id", ((_a = env2 == null ? void 0 : env2.config) == null ? void 0 : _a.clientId) || "");
3464
- data.append("redirect_uri", ((_b = env2 == null ? void 0 : env2.config) == null ? void 0 : _b.redirectUri) || "");
3465
- return (_d = env2 == null ? void 0 : env2.requests) == null ? void 0 : _d.post(
3466
- `${(_c = env2 == null ? void 0 : env2.baseUrl) == null ? void 0 : _c.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
3467
- data,
3468
- {
3469
- headers: {
3470
- "Content-Type": "application/x-www-form-urlencoded"
3471
- }
3404
+ async getAccessByCode(code) {
3405
+ const env2 = getEnv();
3406
+ const data = new URLSearchParams();
3407
+ data.append("code", code);
3408
+ data.append("grant_type", "authorization_code");
3409
+ data.append("client_id", env2?.config?.clientId || "");
3410
+ data.append("redirect_uri", env2?.config?.redirectUri || "");
3411
+ return env2?.requests?.post(
3412
+ `${env2?.baseUrl?.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
3413
+ data,
3414
+ {
3415
+ headers: {
3416
+ "Content-Type": "application/x-www-form-urlencoded"
3472
3417
  }
3473
- );
3474
- });
3418
+ }
3419
+ );
3475
3420
  },
3476
- logout(data) {
3477
- return __async(this, null, function* () {
3478
- var _a;
3479
- const env2 = getEnv();
3480
- console.log(data);
3481
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post(
3482
- "/logout" /* LOGOUT */,
3483
- {},
3484
- {
3485
- headers: {
3486
- "Content-Type": "application/json"
3487
- },
3488
- withCredentials: true,
3489
- useRefreshToken: true
3490
- }
3491
- );
3492
- });
3421
+ async logout(data) {
3422
+ const env2 = getEnv();
3423
+ console.log(data);
3424
+ return env2?.requests?.post(
3425
+ "/logout" /* LOGOUT */,
3426
+ {},
3427
+ {
3428
+ headers: {
3429
+ "Content-Type": "application/json"
3430
+ },
3431
+ withCredentials: true,
3432
+ useRefreshToken: true
3433
+ }
3434
+ );
3493
3435
  }
3494
3436
  };
3495
3437
  var auth_service_default = AuthService;
3496
3438
 
3497
3439
  // src/services/company-service/index.ts
3498
3440
  var CompanyService = {
3499
- getCurrentCompany() {
3500
- return __async(this, null, function* () {
3501
- const env2 = getEnv();
3502
- return yield env2.requests.get("/company" /* COMPANY_PATH */, {
3503
- headers: {
3504
- "Content-Type": "application/json"
3505
- }
3506
- });
3441
+ async getCurrentCompany() {
3442
+ const env2 = getEnv();
3443
+ return await env2.requests.get("/company" /* COMPANY_PATH */, {
3444
+ headers: {
3445
+ "Content-Type": "application/json"
3446
+ }
3507
3447
  });
3508
3448
  },
3509
- getInfoCompany(id) {
3510
- return __async(this, null, function* () {
3511
- var _a;
3512
- const env2 = getEnv();
3513
- const jsonData = {
3514
- ids: [id],
3515
- model: "res.company" /* COMPANY */,
3516
- method: "web_read" /* WEB_READ */,
3517
- kwargs: {
3518
- specification: {
3519
- primary_color: {},
3520
- secondary_color: {},
3521
- logo: {},
3522
- display_name: {},
3523
- secondary_logo: {}
3524
- }
3525
- }
3526
- };
3527
- return yield (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
3528
- headers: {
3529
- "Content-Type": "application/json"
3449
+ async getInfoCompany(id) {
3450
+ const env2 = getEnv();
3451
+ const jsonData = {
3452
+ ids: [id],
3453
+ model: "res.company" /* COMPANY */,
3454
+ method: "web_read" /* WEB_READ */,
3455
+ kwargs: {
3456
+ specification: {
3457
+ primary_color: {},
3458
+ secondary_color: {},
3459
+ logo: {},
3460
+ display_name: {},
3461
+ secondary_logo: {}
3530
3462
  }
3531
- });
3463
+ }
3464
+ };
3465
+ return await env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3466
+ headers: {
3467
+ "Content-Type": "application/json"
3468
+ }
3532
3469
  });
3533
3470
  }
3534
3471
  };
@@ -3536,671 +3473,613 @@ var company_service_default = CompanyService;
3536
3473
 
3537
3474
  // src/services/excel-service/index.ts
3538
3475
  var ExcelService = {
3539
- uploadFile(_0) {
3540
- return __async(this, arguments, function* ({ formData }) {
3541
- const env2 = getEnv();
3542
- return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
3543
- headers: {
3544
- "Content-Type": "multipart/form-data"
3545
- }
3546
- });
3476
+ async uploadFile({ formData }) {
3477
+ const env2 = getEnv();
3478
+ return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
3479
+ headers: {
3480
+ "Content-Type": "multipart/form-data"
3481
+ }
3547
3482
  });
3548
3483
  },
3549
- uploadIdFile(_0) {
3550
- return __async(this, arguments, function* ({ formData }) {
3551
- const env2 = getEnv();
3552
- return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
3553
- headers: {
3554
- "Content-Type": "multipart/form-data"
3555
- }
3556
- });
3484
+ async uploadIdFile({ formData }) {
3485
+ const env2 = getEnv();
3486
+ return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
3487
+ headers: {
3488
+ "Content-Type": "multipart/form-data"
3489
+ }
3557
3490
  });
3558
3491
  },
3559
- parsePreview(_0) {
3560
- return __async(this, arguments, function* ({
3561
- id,
3562
- selectedSheet,
3563
- isHeader,
3564
- context
3565
- }) {
3566
- const env2 = getEnv();
3567
- const jsonData = {
3568
- model: "base_import.import" /* BASE_IMPORT */,
3569
- method: "parse_preview",
3570
- ids: [id],
3571
- kwargs: {
3572
- options: {
3573
- import_skip_records: [],
3574
- import_set_empty_fields: [],
3575
- fallback_values: {},
3576
- name_create_enabled_fields: {},
3577
- encoding: "",
3578
- separator: "",
3579
- quoting: '"',
3580
- date_format: "",
3581
- datetime_format: "",
3582
- float_thousand_separator: ",",
3583
- float_decimal_separator: ".",
3584
- advanced: true,
3585
- has_headers: isHeader,
3586
- keep_matches: false,
3587
- limit: 2e3,
3588
- sheets: [],
3589
- sheet: selectedSheet,
3590
- skip: 0,
3591
- tracking_disable: true
3592
- }
3593
- },
3594
- with_context: context
3595
- };
3596
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3597
- headers: {
3598
- "Content-Type": "multipart/form-data"
3492
+ async parsePreview({
3493
+ id,
3494
+ selectedSheet,
3495
+ isHeader,
3496
+ context
3497
+ }) {
3498
+ const env2 = getEnv();
3499
+ const jsonData = {
3500
+ model: "base_import.import" /* BASE_IMPORT */,
3501
+ method: "parse_preview",
3502
+ ids: [id],
3503
+ kwargs: {
3504
+ options: {
3505
+ import_skip_records: [],
3506
+ import_set_empty_fields: [],
3507
+ fallback_values: {},
3508
+ name_create_enabled_fields: {},
3509
+ encoding: "",
3510
+ separator: "",
3511
+ quoting: '"',
3512
+ date_format: "",
3513
+ datetime_format: "",
3514
+ float_thousand_separator: ",",
3515
+ float_decimal_separator: ".",
3516
+ advanced: true,
3517
+ has_headers: isHeader,
3518
+ keep_matches: false,
3519
+ limit: 2e3,
3520
+ sheets: [],
3521
+ sheet: selectedSheet,
3522
+ skip: 0,
3523
+ tracking_disable: true
3599
3524
  }
3600
- });
3525
+ },
3526
+ with_context: context
3527
+ };
3528
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3529
+ headers: {
3530
+ "Content-Type": "multipart/form-data"
3531
+ }
3601
3532
  });
3602
3533
  },
3603
- executeImport(_0) {
3604
- return __async(this, arguments, function* ({
3605
- columns,
3606
- fields,
3607
- idFile,
3608
- options,
3609
- dryrun,
3610
- context
3611
- }) {
3612
- const env2 = getEnv();
3613
- const jsonData = {
3614
- model: "base_import.import" /* BASE_IMPORT */,
3615
- method: "execute_import",
3616
- ids: [idFile],
3617
- kwargs: {
3618
- fields,
3619
- columns,
3620
- options,
3621
- dryrun
3622
- },
3623
- with_context: context
3624
- };
3625
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3626
- headers: {
3627
- "Content-Type": "multipart/form-data"
3628
- }
3629
- });
3534
+ async executeImport({
3535
+ columns,
3536
+ fields,
3537
+ idFile,
3538
+ options,
3539
+ dryrun,
3540
+ context
3541
+ }) {
3542
+ const env2 = getEnv();
3543
+ const jsonData = {
3544
+ model: "base_import.import" /* BASE_IMPORT */,
3545
+ method: "execute_import",
3546
+ ids: [idFile],
3547
+ kwargs: {
3548
+ fields,
3549
+ columns,
3550
+ options,
3551
+ dryrun
3552
+ },
3553
+ with_context: context
3554
+ };
3555
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3556
+ headers: {
3557
+ "Content-Type": "multipart/form-data"
3558
+ }
3630
3559
  });
3631
3560
  },
3632
- getFileExcel(_0) {
3633
- return __async(this, arguments, function* ({ model }) {
3634
- const env2 = getEnv();
3635
- const jsonData = {
3636
- model,
3637
- method: "get_import_templates" /* GET_IMPORT */,
3638
- args: []
3639
- };
3640
- return env2.requests.post("/call" /* CALL_PATH */, jsonData);
3641
- });
3561
+ async getFileExcel({ model }) {
3562
+ const env2 = getEnv();
3563
+ const jsonData = {
3564
+ model,
3565
+ method: "get_import_templates" /* GET_IMPORT */,
3566
+ args: []
3567
+ };
3568
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData);
3642
3569
  },
3643
- getFieldExport(_0) {
3644
- return __async(this, arguments, function* ({
3645
- ids,
3570
+ async getFieldExport({
3571
+ ids,
3572
+ model,
3573
+ isShow,
3574
+ parentField,
3575
+ fieldType,
3576
+ parentName,
3577
+ prefix,
3578
+ name,
3579
+ context,
3580
+ importCompat
3581
+ }) {
3582
+ const env2 = getEnv();
3583
+ const jsonData = {
3646
3584
  model,
3647
- isShow,
3648
- parentField,
3649
- fieldType,
3650
- parentName,
3651
- prefix,
3652
- name,
3653
- context,
3654
- importCompat
3655
- }) {
3656
- const env2 = getEnv();
3657
- const jsonData = {
3658
- model,
3659
- import_compat: importCompat,
3660
- domain: [["id", "in", ids]],
3661
- with_context: context
3662
- };
3663
- if (isShow) {
3664
- jsonData.parent_field = parentField;
3665
- jsonData.parent_field_type = fieldType;
3666
- jsonData.parent_name = parentName;
3667
- jsonData.name = name;
3668
- jsonData.prefix = prefix;
3669
- jsonData.exclude = [null];
3670
- }
3671
- return env2.requests.post("/export/get_fields", jsonData);
3672
- });
3585
+ import_compat: importCompat,
3586
+ domain: [["id", "in", ids]],
3587
+ with_context: context
3588
+ };
3589
+ if (isShow) {
3590
+ jsonData.parent_field = parentField;
3591
+ jsonData.parent_field_type = fieldType;
3592
+ jsonData.parent_name = parentName;
3593
+ jsonData.name = name;
3594
+ jsonData.prefix = prefix;
3595
+ jsonData.exclude = [null];
3596
+ }
3597
+ return env2.requests.post("/export/get_fields", jsonData);
3673
3598
  },
3674
- exportExcel(_0) {
3675
- return __async(this, arguments, function* ({
3599
+ async exportExcel({
3600
+ model,
3601
+ domain,
3602
+ ids,
3603
+ fields,
3604
+ type,
3605
+ importCompat,
3606
+ context,
3607
+ groupby
3608
+ }) {
3609
+ const env2 = getEnv();
3610
+ const jsonData = {
3676
3611
  model,
3677
3612
  domain,
3678
3613
  ids,
3614
+ import_compat: importCompat,
3679
3615
  fields,
3680
- type,
3681
- importCompat,
3682
- context,
3683
- groupby
3684
- }) {
3685
- const env2 = getEnv();
3686
- const jsonData = {
3687
- model,
3688
- domain,
3689
- ids,
3690
- import_compat: importCompat,
3691
- fields,
3692
- with_context: context,
3693
- groupby: groupby != null ? groupby : []
3694
- };
3695
- return env2.requests.post_excel(`/export/${type}`, jsonData);
3696
- });
3616
+ with_context: context,
3617
+ groupby: groupby ?? []
3618
+ };
3619
+ return env2.requests.post_excel(`/export/${type}`, jsonData);
3697
3620
  }
3698
3621
  };
3699
3622
  var excel_service_default = ExcelService;
3700
3623
 
3701
3624
  // src/services/form-service/index.ts
3702
3625
  var FormService = {
3703
- getComment(_0) {
3704
- return __async(this, arguments, function* ({ data }) {
3705
- try {
3706
- const env2 = getEnv();
3707
- const jsonData = {
3708
- thread_id: data.thread_id,
3709
- thread_model: data.thread_model,
3710
- limit: 100,
3711
- with_context: {
3712
- lang: data.lang
3713
- }
3714
- };
3715
- return env2.requests.post("/chatter/thread/messages" /* GET_MESSAGE */, jsonData, {
3716
- headers: {
3717
- "Content-Type": "application/json"
3718
- }
3719
- });
3720
- } catch (error) {
3721
- console.error("Error when sending message:", error);
3722
- throw error;
3723
- }
3724
- });
3725
- },
3726
- sentComment(_0) {
3727
- return __async(this, arguments, function* ({ data }) {
3728
- try {
3729
- const env2 = getEnv();
3730
- const jsonData = {
3731
- context: {
3732
- tz: "Asia/Saigon",
3733
- uid: 2,
3734
- allowed_company_ids: [1],
3735
- mail_post_autofollow: false,
3736
- temporary_id: 142183.01
3737
- },
3738
- post_data: {
3739
- body: data.message,
3740
- message_type: "comment",
3741
- attachment_ids: data.attachment_ids,
3742
- attachment_tokens: [],
3743
- subtype_xmlid: data.subtype
3744
- },
3745
- thread_id: Number(data.thread_id),
3746
- thread_model: data.thread_model
3747
- };
3748
- return env2.requests.post("/chatter/message/post" /* SENT_MESSAGE */, jsonData, {
3749
- headers: {
3750
- "Content-Type": "application/json"
3751
- }
3752
- });
3753
- } catch (error) {
3754
- console.error("Error when sent message:", error);
3755
- throw error;
3756
- }
3757
- });
3758
- },
3759
- deleteComment(_0) {
3760
- return __async(this, arguments, function* ({ data }) {
3761
- try {
3762
- const env2 = getEnv();
3763
- const jsonData = {
3764
- attachment_ids: [],
3765
- attachment_tokens: [],
3766
- body: "",
3767
- message_id: data.message_id
3768
- };
3769
- return env2.requests.post("/chatter/message/update_content" /* DELETE_MESSAGE */, jsonData, {
3770
- headers: {
3771
- "Content-Type": "application/json"
3772
- }
3773
- });
3774
- } catch (error) {
3775
- console.error("Error when sent message:", error);
3776
- throw error;
3777
- }
3778
- });
3779
- },
3780
- getImage(_0) {
3781
- return __async(this, arguments, function* ({ data }) {
3782
- try {
3783
- const env2 = getEnv();
3784
- return env2.requests.get(
3785
- `${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
3786
- {
3787
- headers: {
3788
- "Content-Type": "application/json"
3789
- }
3790
- }
3791
- );
3792
- } catch (error) {
3793
- console.error("Error when sent message:", error);
3794
- throw error;
3795
- }
3796
- });
3797
- },
3798
- uploadImage(_0) {
3799
- return __async(this, arguments, function* ({ data }) {
3800
- try {
3801
- const env2 = getEnv();
3802
- return env2.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
3803
- headers: {
3804
- "Content-Type": "multipart/form-data"
3805
- }
3806
- });
3807
- } catch (error) {
3808
- console.error("Error when sent message:", error);
3809
- throw error;
3810
- }
3811
- });
3812
- },
3813
- getFormView(_0) {
3814
- return __async(this, arguments, function* ({ data }) {
3815
- try {
3816
- const env2 = getEnv();
3817
- const jsonData = {
3818
- model: data.model,
3819
- method: "get_formview_action",
3820
- ids: data.id ? [data.id] : [],
3821
- with_context: data.context
3822
- };
3823
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3824
- headers: {
3825
- "Content-Type": "application/json"
3826
- }
3827
- });
3828
- } catch (error) {
3829
- console.error("Error when fetching form view:", error);
3830
- throw error;
3831
- }
3832
- });
3833
- },
3834
- changeStatus(_0) {
3835
- return __async(this, arguments, function* ({ data }) {
3626
+ async getComment({ data }) {
3627
+ try {
3836
3628
  const env2 = getEnv();
3837
- const vals = {
3838
- [data.name]: data.stage_id
3839
- };
3840
3629
  const jsonData = {
3841
- model: data.model,
3842
- method: "web_save",
3630
+ thread_id: data.thread_id,
3631
+ thread_model: data.thread_model,
3632
+ limit: 100,
3843
3633
  with_context: {
3844
- lang: data.lang,
3845
- allowed_company_ids: [1],
3846
- uid: 2,
3847
- search_default_my_ticket: true,
3848
- search_default_is_open: true
3849
- },
3850
- ids: [data.id],
3851
- kwargs: {
3852
- vals,
3853
- specification: {}
3634
+ lang: data.lang
3854
3635
  }
3855
3636
  };
3856
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3637
+ return env2.requests.post("/chatter/thread/messages" /* GET_MESSAGE */, jsonData, {
3857
3638
  headers: {
3858
3639
  "Content-Type": "application/json"
3859
3640
  }
3860
3641
  });
3861
- });
3862
- }
3863
- };
3864
- var form_service_default = FormService;
3865
-
3866
- // src/services/kanban-service/index.ts
3867
- var KanbanServices = {
3868
- getGroups(_0) {
3869
- return __async(this, arguments, function* ({
3870
- model,
3871
- width_context
3872
- }) {
3642
+ } catch (error) {
3643
+ console.error("Error when sending message:", error);
3644
+ throw error;
3645
+ }
3646
+ },
3647
+ async sentComment({ data }) {
3648
+ try {
3873
3649
  const env2 = getEnv();
3874
- const jsonDataView = {
3875
- model,
3876
- method: "web_read_group",
3877
- kwargs: {
3878
- domain: [["stage_id.fold", "=", false]],
3879
- fields: ["color:sum"],
3880
- groupby: ["stage_id"]
3650
+ const jsonData = {
3651
+ context: {
3652
+ tz: "Asia/Saigon",
3653
+ uid: 2,
3654
+ allowed_company_ids: [1],
3655
+ mail_post_autofollow: false,
3656
+ temporary_id: 142183.01
3657
+ },
3658
+ post_data: {
3659
+ body: data.message,
3660
+ message_type: "comment",
3661
+ attachment_ids: data.attachment_ids,
3662
+ attachment_tokens: [],
3663
+ subtype_xmlid: data.subtype
3881
3664
  },
3882
- width_context
3665
+ thread_id: Number(data.thread_id),
3666
+ thread_model: data.thread_model
3883
3667
  };
3884
- return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
3668
+ return env2.requests.post("/chatter/message/post" /* SENT_MESSAGE */, jsonData, {
3885
3669
  headers: {
3886
3670
  "Content-Type": "application/json"
3887
3671
  }
3888
3672
  });
3889
- });
3673
+ } catch (error) {
3674
+ console.error("Error when sent message:", error);
3675
+ throw error;
3676
+ }
3890
3677
  },
3891
- getProgressBar(_0) {
3892
- return __async(this, arguments, function* ({
3893
- field,
3894
- color,
3895
- model,
3896
- width_context
3897
- }) {
3678
+ async deleteComment({ data }) {
3679
+ try {
3898
3680
  const env2 = getEnv();
3899
- const jsonDataView = {
3900
- model,
3901
- method: "read_progress_bar",
3902
- kwargs: {
3903
- domain: [],
3904
- group_by: "stage_id",
3905
- progress_bar: {
3906
- colors: color,
3907
- field
3908
- }
3909
- },
3910
- width_context
3681
+ const jsonData = {
3682
+ attachment_ids: [],
3683
+ attachment_tokens: [],
3684
+ body: "",
3685
+ message_id: data.message_id
3911
3686
  };
3912
- return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
3687
+ return env2.requests.post("/chatter/message/update_content" /* DELETE_MESSAGE */, jsonData, {
3913
3688
  headers: {
3914
3689
  "Content-Type": "application/json"
3915
3690
  }
3916
3691
  });
3917
- });
3918
- }
3919
- };
3920
- var kanban_service_default = KanbanServices;
3921
-
3922
- // src/services/model-service/index.ts
3923
- var OBJECT_POSITION = 2;
3924
- var ModelService = {
3925
- getListMyBankAccount(_0) {
3926
- return __async(this, arguments, function* ({
3927
- domain,
3928
- spectification,
3929
- model
3930
- }) {
3692
+ } catch (error) {
3693
+ console.error("Error when sent message:", error);
3694
+ throw error;
3695
+ }
3696
+ },
3697
+ async getImage({ data }) {
3698
+ try {
3931
3699
  const env2 = getEnv();
3932
- const jsonData = {
3933
- model,
3934
- method: "web_search_read",
3935
- kwargs: {
3936
- specification: spectification,
3937
- domain,
3938
- limit: 100,
3939
- offset: 0
3940
- }
3941
- };
3942
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3943
- headers: {
3944
- "Content-Type": "application/json"
3700
+ return env2.requests.get(
3701
+ `${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
3702
+ {
3703
+ headers: {
3704
+ "Content-Type": "application/json"
3705
+ }
3945
3706
  }
3946
- });
3947
- });
3707
+ );
3708
+ } catch (error) {
3709
+ console.error("Error when sent message:", error);
3710
+ throw error;
3711
+ }
3948
3712
  },
3949
- getCurrency() {
3950
- return __async(this, null, function* () {
3713
+ async uploadImage({ data }) {
3714
+ try {
3951
3715
  const env2 = getEnv();
3952
- const jsonData = {
3953
- model: "res.currency",
3954
- method: "web_search_read",
3955
- kwargs: {
3956
- specification: {
3957
- icon_url: {},
3958
- name: {}
3959
- },
3960
- domain: [["active", "=", true]],
3961
- limit: 100,
3962
- offset: 0
3963
- }
3964
- };
3965
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3716
+ return env2.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
3966
3717
  headers: {
3967
- "Content-Type": "application/json"
3718
+ "Content-Type": "multipart/form-data"
3968
3719
  }
3969
3720
  });
3970
- });
3721
+ } catch (error) {
3722
+ console.error("Error when sent message:", error);
3723
+ throw error;
3724
+ }
3971
3725
  },
3972
- getConversionRate() {
3973
- return __async(this, null, function* () {
3726
+ async getFormView({ data }) {
3727
+ try {
3974
3728
  const env2 = getEnv();
3975
3729
  const jsonData = {
3976
- model: "res.currency",
3977
- method: "web_search_read",
3978
- kwargs: {
3979
- specification: {
3980
- name: {},
3981
- icon_url: {},
3982
- rate_ids: {
3983
- fields: {
3984
- company_rate: {},
3985
- sell: {}
3986
- }
3987
- }
3988
- },
3989
- domain: [["active", "=", true]],
3990
- limit: 100,
3991
- offset: 0
3992
- }
3730
+ model: data.model,
3731
+ method: "get_formview_action",
3732
+ ids: data.id ? [data.id] : [],
3733
+ with_context: data.context
3993
3734
  };
3994
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3735
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3995
3736
  headers: {
3996
3737
  "Content-Type": "application/json"
3997
3738
  }
3998
3739
  });
3740
+ } catch (error) {
3741
+ console.error("Error when fetching form view:", error);
3742
+ throw error;
3743
+ }
3744
+ },
3745
+ async changeStatus({ data }) {
3746
+ const env2 = getEnv();
3747
+ const vals = {
3748
+ [data.name]: data.stage_id
3749
+ };
3750
+ const jsonData = {
3751
+ model: data.model,
3752
+ method: "web_save",
3753
+ with_context: {
3754
+ lang: data.lang,
3755
+ allowed_company_ids: [1],
3756
+ uid: 2,
3757
+ search_default_my_ticket: true,
3758
+ search_default_is_open: true
3759
+ },
3760
+ ids: [data.id],
3761
+ kwargs: {
3762
+ vals,
3763
+ specification: {}
3764
+ }
3765
+ };
3766
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3767
+ headers: {
3768
+ "Content-Type": "application/json"
3769
+ }
3770
+ });
3771
+ }
3772
+ };
3773
+ var form_service_default = FormService;
3774
+
3775
+ // src/services/kanban-service/index.ts
3776
+ var KanbanServices = {
3777
+ async getGroups({
3778
+ model,
3779
+ width_context
3780
+ }) {
3781
+ const env2 = getEnv();
3782
+ const jsonDataView = {
3783
+ model,
3784
+ method: "web_read_group",
3785
+ kwargs: {
3786
+ domain: [["stage_id.fold", "=", false]],
3787
+ fields: ["color:sum"],
3788
+ groupby: ["stage_id"]
3789
+ },
3790
+ width_context
3791
+ };
3792
+ return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
3793
+ headers: {
3794
+ "Content-Type": "application/json"
3795
+ }
3999
3796
  });
4000
3797
  },
4001
- getAll(_0) {
4002
- return __async(this, arguments, function* ({ data }) {
4003
- const env2 = getEnv();
4004
- 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] ? {
4005
- fields: data.fields,
4006
- groupby: data.groupby
4007
- } : {
4008
- count_limit: 10001,
4009
- order: data.sort,
4010
- specification: data.specification
4011
- };
4012
- const jsonData = {
4013
- model: String(data.model),
4014
- method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
4015
- ids: data.ids,
4016
- with_context: data.context,
4017
- kwargs: __spreadValues({
4018
- domain: data.domain,
4019
- limit: data.limit,
4020
- offset: data.offset
4021
- }, jsonReadGroup)
4022
- };
4023
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4024
- headers: {
4025
- "Content-Type": "application/json"
3798
+ async getProgressBar({
3799
+ field,
3800
+ color,
3801
+ model,
3802
+ width_context
3803
+ }) {
3804
+ const env2 = getEnv();
3805
+ const jsonDataView = {
3806
+ model,
3807
+ method: "read_progress_bar",
3808
+ kwargs: {
3809
+ domain: [],
3810
+ group_by: "stage_id",
3811
+ progress_bar: {
3812
+ colors: color,
3813
+ field
4026
3814
  }
4027
- });
3815
+ },
3816
+ width_context
3817
+ };
3818
+ return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
3819
+ headers: {
3820
+ "Content-Type": "application/json"
3821
+ }
3822
+ });
3823
+ }
3824
+ };
3825
+ var kanban_service_default = KanbanServices;
3826
+
3827
+ // src/services/model-service/index.ts
3828
+ var OBJECT_POSITION = 2;
3829
+ var ModelService = {
3830
+ async getListMyBankAccount({
3831
+ domain,
3832
+ spectification,
3833
+ model
3834
+ }) {
3835
+ const env2 = getEnv();
3836
+ const jsonData = {
3837
+ model,
3838
+ method: "web_search_read",
3839
+ kwargs: {
3840
+ specification: spectification,
3841
+ domain,
3842
+ limit: 100,
3843
+ offset: 0
3844
+ }
3845
+ };
3846
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3847
+ headers: {
3848
+ "Content-Type": "application/json"
3849
+ }
4028
3850
  });
4029
3851
  },
4030
- getListCalendar(_0) {
4031
- return __async(this, arguments, function* ({ data }) {
4032
- const env2 = getEnv();
4033
- 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] ? {
3852
+ async getCurrency() {
3853
+ const env2 = getEnv();
3854
+ const jsonData = {
3855
+ model: "res.currency",
3856
+ method: "web_search_read",
3857
+ kwargs: {
3858
+ specification: {
3859
+ icon_url: {},
3860
+ name: {}
3861
+ },
3862
+ domain: [["active", "=", true]],
3863
+ limit: 100,
3864
+ offset: 0
3865
+ }
3866
+ };
3867
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3868
+ headers: {
3869
+ "Content-Type": "application/json"
3870
+ }
3871
+ });
3872
+ },
3873
+ async getConversionRate() {
3874
+ const env2 = getEnv();
3875
+ const jsonData = {
3876
+ model: "res.currency",
3877
+ method: "web_search_read",
3878
+ kwargs: {
3879
+ specification: {
3880
+ name: {},
3881
+ icon_url: {},
3882
+ rate_ids: {
3883
+ fields: {
3884
+ company_rate: {},
3885
+ sell: {}
3886
+ }
3887
+ }
3888
+ },
3889
+ domain: [["active", "=", true]],
3890
+ limit: 100,
3891
+ offset: 0
3892
+ }
3893
+ };
3894
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3895
+ headers: {
3896
+ "Content-Type": "application/json"
3897
+ }
3898
+ });
3899
+ },
3900
+ async getAll({ data }) {
3901
+ const env2 = getEnv();
3902
+ const jsonReadGroup = data.type == "calendar" ? { fields: data?.fields } : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
3903
+ fields: data.fields,
3904
+ groupby: data.groupby
3905
+ } : {
3906
+ count_limit: 10001,
3907
+ order: data.sort,
3908
+ specification: data.specification
3909
+ };
3910
+ const jsonData = {
3911
+ model: String(data.model),
3912
+ method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
3913
+ ids: data.ids,
3914
+ with_context: data.context,
3915
+ kwargs: {
3916
+ domain: data.domain,
3917
+ limit: data.limit,
3918
+ offset: data.offset,
3919
+ ...jsonReadGroup
3920
+ }
3921
+ };
3922
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3923
+ headers: {
3924
+ "Content-Type": "application/json"
3925
+ }
3926
+ });
3927
+ },
3928
+ async getListCalendar({ data }) {
3929
+ const env2 = getEnv();
3930
+ const jsonReadGroup = data.type == "calendar" ? data?.fields : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
3931
+ fields: data.fields,
3932
+ groupby: data.groupby
3933
+ } : {
3934
+ count_limit: 10001,
3935
+ order: data.sort,
3936
+ specification: data.specification
3937
+ };
3938
+ const jsonData = {
3939
+ model: String(data.model),
3940
+ method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
3941
+ ids: data.ids,
3942
+ with_context: data.context,
3943
+ kwargs: {
3944
+ domain: data.domain,
3945
+ limit: data.limit,
3946
+ offset: data.offset,
4034
3947
  fields: data.fields,
4035
- groupby: data.groupby
4036
- } : {
4037
- count_limit: 10001,
4038
- order: data.sort,
4039
- specification: data.specification
4040
- };
4041
- const jsonData = {
4042
- model: String(data.model),
4043
- method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
4044
- ids: data.ids,
4045
- with_context: data.context,
4046
- kwargs: __spreadValues({
4047
- domain: data.domain,
4048
- limit: data.limit,
4049
- offset: data.offset,
4050
- fields: data.fields
4051
- }, jsonReadGroup)
4052
- };
4053
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4054
- headers: {
4055
- "Content-Type": "application/json"
4056
- }
4057
- });
3948
+ ...jsonReadGroup
3949
+ }
3950
+ };
3951
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3952
+ headers: {
3953
+ "Content-Type": "application/json"
3954
+ }
4058
3955
  });
4059
3956
  },
4060
- getList(_0) {
4061
- return __async(this, arguments, function* ({
3957
+ async getList({
3958
+ model,
3959
+ ids = [],
3960
+ specification = {},
3961
+ domain = [],
3962
+ offset,
3963
+ order,
3964
+ context = {},
3965
+ limit = 10
3966
+ }) {
3967
+ const env2 = getEnv();
3968
+ const jsonData = {
4062
3969
  model,
4063
- ids = [],
4064
- specification = {},
4065
- domain = [],
4066
- offset,
4067
- order,
4068
- context = {},
4069
- limit = 10
4070
- }) {
4071
- var _a;
4072
- const env2 = getEnv();
4073
- const jsonData = {
4074
- model,
4075
- method: "web_search_read" /* WEB_SEARCH_READ */,
4076
- ids,
4077
- with_context: context,
4078
- kwargs: {
4079
- specification,
4080
- domain,
4081
- limit,
4082
- offset,
4083
- order
4084
- }
4085
- };
4086
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4087
- headers: {
4088
- "Content-Type": "application/json"
4089
- }
4090
- });
3970
+ method: "web_search_read" /* WEB_SEARCH_READ */,
3971
+ ids,
3972
+ with_context: context,
3973
+ kwargs: {
3974
+ specification,
3975
+ domain,
3976
+ limit,
3977
+ offset,
3978
+ order
3979
+ }
3980
+ };
3981
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3982
+ headers: {
3983
+ "Content-Type": "application/json"
3984
+ }
4091
3985
  });
4092
3986
  },
4093
- getDetail(_0) {
4094
- return __async(this, arguments, function* ({
4095
- ids = [],
3987
+ async getDetail({
3988
+ ids = [],
3989
+ model,
3990
+ specification,
3991
+ context
3992
+ }) {
3993
+ const env2 = getEnv();
3994
+ const jsonData = {
4096
3995
  model,
4097
- specification,
4098
- context
4099
- }) {
4100
- var _a;
4101
- const env2 = getEnv();
4102
- const jsonData = {
4103
- model,
4104
- method: "web_read" /* WEB_READ */,
4105
- ids,
4106
- with_context: context,
4107
- kwargs: {
4108
- specification
4109
- }
4110
- };
4111
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4112
- headers: {
4113
- "Content-Type": "application/json"
4114
- }
4115
- });
3996
+ method: "web_read" /* WEB_READ */,
3997
+ ids,
3998
+ with_context: context,
3999
+ kwargs: {
4000
+ specification
4001
+ }
4002
+ };
4003
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4004
+ headers: {
4005
+ "Content-Type": "application/json"
4006
+ }
4116
4007
  });
4117
4008
  },
4118
- save(_0) {
4119
- return __async(this, arguments, function* ({
4009
+ async save({
4010
+ model,
4011
+ ids = [],
4012
+ data = {},
4013
+ specification = {},
4014
+ context = {},
4015
+ path
4016
+ }) {
4017
+ const env2 = getEnv();
4018
+ const jsonData = {
4120
4019
  model,
4121
- ids = [],
4122
- data = {},
4123
- specification = {},
4124
- context = {},
4125
- path
4126
- }) {
4127
- var _a;
4128
- const env2 = getEnv();
4129
- const jsonData = {
4130
- model,
4131
- method: "web_save" /* WEB_SAVE */,
4132
- with_context: context,
4133
- ids,
4134
- kwargs: {
4135
- vals: data,
4136
- specification
4137
- }
4138
- };
4139
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post(path != null ? path : "/call" /* CALL_PATH */, jsonData, {
4140
- headers: {
4141
- "Content-Type": "application/json"
4142
- }
4143
- });
4020
+ method: "web_save" /* WEB_SAVE */,
4021
+ with_context: context,
4022
+ ids,
4023
+ kwargs: {
4024
+ vals: data,
4025
+ specification
4026
+ }
4027
+ };
4028
+ return env2?.requests?.post(path ?? "/call" /* CALL_PATH */, jsonData, {
4029
+ headers: {
4030
+ "Content-Type": "application/json"
4031
+ }
4144
4032
  });
4145
4033
  },
4146
- delete(_0) {
4147
- return __async(this, arguments, function* ({ ids = [], model }) {
4148
- var _a;
4149
- const env2 = getEnv();
4150
- const jsonData = {
4151
- model,
4152
- method: "unlink" /* UNLINK */,
4153
- ids
4154
- };
4155
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4156
- headers: {
4157
- "Content-Type": "application/json"
4158
- }
4159
- });
4034
+ async delete({ ids = [], model }) {
4035
+ const env2 = getEnv();
4036
+ const jsonData = {
4037
+ model,
4038
+ method: "unlink" /* UNLINK */,
4039
+ ids
4040
+ };
4041
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4042
+ headers: {
4043
+ "Content-Type": "application/json"
4044
+ }
4160
4045
  });
4161
4046
  },
4162
- onChange(_0) {
4163
- return __async(this, arguments, function* ({
4164
- ids = [],
4047
+ async onChange({
4048
+ ids = [],
4049
+ model,
4050
+ object,
4051
+ specification,
4052
+ context,
4053
+ fieldChange
4054
+ }) {
4055
+ const env2 = getEnv();
4056
+ const jsonData = {
4165
4057
  model,
4166
- object,
4167
- specification,
4168
- context,
4169
- fieldChange
4170
- }) {
4171
- var _a;
4172
- const env2 = getEnv();
4173
- const jsonData = {
4174
- model,
4175
- method: "onchange" /* ONCHANGE */,
4176
- ids,
4177
- with_context: context,
4178
- args: [
4179
- object ? object : {},
4180
- fieldChange ? fieldChange : [],
4181
- specification
4182
- ]
4183
- };
4184
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4185
- headers: {
4186
- "Content-Type": "application/json"
4187
- }
4188
- });
4058
+ method: "onchange" /* ONCHANGE */,
4059
+ ids,
4060
+ with_context: context,
4061
+ args: [
4062
+ object ? object : {},
4063
+ fieldChange ? fieldChange : [],
4064
+ specification
4065
+ ]
4066
+ };
4067
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4068
+ headers: {
4069
+ "Content-Type": "application/json"
4070
+ }
4189
4071
  });
4190
4072
  },
4191
- getListFieldsOnchange(_0) {
4192
- return __async(this, arguments, function* ({ model }) {
4193
- var _a;
4194
- const env2 = getEnv();
4195
- const jsonData = {
4196
- model,
4197
- method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
4198
- };
4199
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4200
- headers: {
4201
- "Content-Type": "application/json"
4202
- }
4203
- });
4073
+ async getListFieldsOnchange({ model }) {
4074
+ const env2 = getEnv();
4075
+ const jsonData = {
4076
+ model,
4077
+ method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
4078
+ };
4079
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4080
+ headers: {
4081
+ "Content-Type": "application/json"
4082
+ }
4204
4083
  });
4205
4084
  },
4206
4085
  parseORMOdoo(data) {
@@ -4214,14 +4093,13 @@ var ModelService = {
4214
4093
  data[key] = "/";
4215
4094
  }
4216
4095
  }
4217
- return __spreadValues({}, data);
4096
+ return { ...data };
4218
4097
  },
4219
4098
  toDataJS(data, viewData, model) {
4220
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
4221
4099
  for (const key in data) {
4222
4100
  if (data[key] === false) {
4223
4101
  if (viewData && model) {
4224
- 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 */) {
4102
+ if (viewData?.models?.[model]?.[key]?.type !== "boolean" /* BOOLEAN */) {
4225
4103
  data[key] = null;
4226
4104
  }
4227
4105
  } else {
@@ -4231,13 +4109,12 @@ var ModelService = {
4231
4109
  data[key] = "Draft";
4232
4110
  } else if (data[key] !== false) {
4233
4111
  if (model !== void 0) {
4234
- 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 */) {
4235
- data[key] = (_k = (_j = data[key]) != null ? _j : data[key] = []) == null ? void 0 : _k.map((item) => {
4236
- var _a2, _b2, _c2, _d2;
4237
- 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;
4112
+ if (viewData?.models?.[model]?.[key]?.type === "one2many" /* ONE2MANY */ || viewData?.models?.[model]?.[key]?.type === "many2many" /* MANY2MANY */) {
4113
+ data[key] = (data[key] ??= [])?.map((item) => {
4114
+ const relation = viewData?.models?.[model]?.[key]?.relation;
4238
4115
  if (relation !== void 0) {
4239
- if ((_d2 = viewData == null ? void 0 : viewData.models) == null ? void 0 : _d2[relation]) {
4240
- if ((item == null ? void 0 : item.length) >= 3) {
4116
+ if (viewData?.models?.[relation]) {
4117
+ if (item?.length >= 3) {
4241
4118
  return ModelService.toDataJS(
4242
4119
  item[OBJECT_POSITION],
4243
4120
  viewData,
@@ -4247,7 +4124,7 @@ var ModelService = {
4247
4124
  return ModelService.toDataJS(item, viewData, relation);
4248
4125
  }
4249
4126
  } else {
4250
- if ((item == null ? void 0 : item.length) >= 3) {
4127
+ if (item?.length >= 3) {
4251
4128
  return item[OBJECT_POSITION];
4252
4129
  } else {
4253
4130
  return item;
@@ -4259,556 +4136,514 @@ var ModelService = {
4259
4136
  }
4260
4137
  }
4261
4138
  }
4262
- return __spreadValues({}, data);
4139
+ return { ...data };
4263
4140
  }
4264
4141
  };
4265
4142
  var model_service_default = ModelService;
4266
4143
 
4267
4144
  // src/services/user-service/index.ts
4268
4145
  var UserService = {
4269
- getProfile(path) {
4270
- return __async(this, null, function* () {
4271
- const env2 = getEnv();
4272
- return env2.requests.get(path != null ? path : "/userinfo" /* PROFILE_PATH */, {
4273
- headers: {
4274
- "Content-Type": "application/x-www-form-urlencoded"
4275
- }
4276
- });
4277
- });
4278
- },
4279
- getUser(_0) {
4280
- return __async(this, arguments, function* ({ context, id }) {
4281
- const env2 = getEnv();
4282
- const jsonData = {
4283
- model: "res.users",
4284
- method: "web_read",
4285
- ids: [id],
4286
- with_context: context,
4287
- kwargs: {
4288
- specification: {
4289
- display_name: {},
4290
- image_1920: {},
4291
- name: {},
4292
- login: {},
4293
- email: {},
4294
- password: {},
4295
- visible_group_id: {
4296
- fields: {
4297
- id: {},
4298
- display_name: {}
4299
- }
4300
- },
4301
- company_id: {
4302
- fields: {
4303
- id: {},
4304
- display_name: {}
4305
- }
4146
+ async getProfile(path) {
4147
+ const env2 = getEnv();
4148
+ return env2?.requests?.get(path ?? "/userinfo" /* PROFILE_PATH */, {
4149
+ headers: {
4150
+ "Content-Type": "application/x-www-form-urlencoded"
4151
+ }
4152
+ });
4153
+ },
4154
+ async getUser({ context, id }) {
4155
+ const env2 = getEnv();
4156
+ const jsonData = {
4157
+ model: "res.users",
4158
+ method: "web_read",
4159
+ ids: [id],
4160
+ with_context: context,
4161
+ kwargs: {
4162
+ specification: {
4163
+ display_name: {},
4164
+ image_1920: {},
4165
+ name: {},
4166
+ login: {},
4167
+ email: {},
4168
+ password: {},
4169
+ visible_group_id: {
4170
+ fields: {
4171
+ id: {},
4172
+ display_name: {}
4173
+ }
4174
+ },
4175
+ company_id: {
4176
+ fields: {
4177
+ id: {},
4178
+ display_name: {}
4306
4179
  }
4307
4180
  }
4308
4181
  }
4309
- };
4310
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4311
- headers: {
4312
- "Content-Type": "application/json"
4313
- }
4314
- });
4182
+ }
4183
+ };
4184
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4185
+ headers: {
4186
+ "Content-Type": "application/json"
4187
+ }
4315
4188
  });
4316
4189
  },
4317
- switchUserLocale: (_0) => __async(null, [_0], function* ({ id, values }) {
4318
- var _a;
4190
+ switchUserLocale: async ({ id, values }) => {
4319
4191
  const env2 = getEnv();
4320
4192
  const jsonData = {
4321
4193
  model: "res.users",
4322
4194
  domain: [["id", "=", id]],
4323
4195
  values
4324
4196
  };
4325
- return env2 == null ? void 0 : env2.requests.post((_a = UriConstants) == null ? void 0 : _a.CREATE_UPDATE_PATH, jsonData, {
4197
+ return env2?.requests.post(UriConstants?.CREATE_UPDATE_PATH, jsonData, {
4326
4198
  headers: {
4327
4199
  "Content-Type": "application/json"
4328
4200
  }
4329
4201
  });
4330
- })
4202
+ }
4331
4203
  };
4332
4204
  var user_service_default = UserService;
4333
4205
 
4334
4206
  // src/services/view-service/index.ts
4335
4207
  var ViewService = {
4336
- getView(_0) {
4337
- return __async(this, arguments, function* ({
4208
+ async getView({
4209
+ model,
4210
+ views,
4211
+ context = {},
4212
+ options = {},
4213
+ aid
4214
+ }) {
4215
+ const env2 = getEnv();
4216
+ const defaultOptions = {
4217
+ load_filters: true,
4218
+ toolbar: true,
4219
+ action_id: aid
4220
+ };
4221
+ const jsonDataView = {
4338
4222
  model,
4339
- views,
4340
- context = {},
4341
- options = {},
4342
- aid
4343
- }) {
4344
- var _a;
4345
- const env2 = getEnv();
4346
- const defaultOptions = {
4347
- load_filters: true,
4348
- toolbar: true,
4349
- action_id: aid
4350
- };
4351
- const jsonDataView = {
4352
- model,
4353
- method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
4354
- kwargs: {
4355
- views,
4356
- options: __spreadValues(__spreadValues({}, options), defaultOptions)
4357
- },
4358
- with_context: context
4359
- };
4360
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonDataView, {
4361
- headers: {
4362
- "Content-Type": "application/json"
4363
- }
4364
- });
4223
+ method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
4224
+ kwargs: {
4225
+ views,
4226
+ options: { ...options, ...defaultOptions }
4227
+ },
4228
+ with_context: context
4229
+ };
4230
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonDataView, {
4231
+ headers: {
4232
+ "Content-Type": "application/json"
4233
+ }
4365
4234
  });
4366
4235
  },
4367
- getMenu(context) {
4368
- return __async(this, null, function* () {
4369
- var _a;
4370
- const env2 = getEnv();
4371
- const jsonData = {
4372
- model: "ir.ui.menu" /* MENU */,
4373
- method: "web_search_read" /* WEB_SEARCH_READ */,
4374
- ids: [],
4375
- with_context: context,
4376
- kwargs: {
4377
- specification: {
4378
- active: {},
4379
- name: {},
4380
- is_display: {},
4381
- sequence: {},
4382
- complete_name: {},
4383
- action: {
4384
- fields: {
4385
- display_name: {},
4386
- type: {},
4387
- binding_view_types: {}
4388
- // res_model: {},
4389
- }
4236
+ async getMenu(context) {
4237
+ const env2 = getEnv();
4238
+ const jsonData = {
4239
+ model: "ir.ui.menu" /* MENU */,
4240
+ method: "web_search_read" /* WEB_SEARCH_READ */,
4241
+ ids: [],
4242
+ with_context: context,
4243
+ kwargs: {
4244
+ specification: {
4245
+ active: {},
4246
+ name: {},
4247
+ is_display: {},
4248
+ sequence: {},
4249
+ complete_name: {},
4250
+ action: {
4251
+ fields: {
4252
+ display_name: {},
4253
+ type: {},
4254
+ binding_view_types: {}
4255
+ // res_model: {},
4256
+ }
4257
+ },
4258
+ url_icon: {},
4259
+ web_icon: {},
4260
+ web_icon_data: {},
4261
+ groups_id: {
4262
+ fields: {
4263
+ full_name: {}
4390
4264
  },
4391
- url_icon: {},
4392
- web_icon: {},
4393
- web_icon_data: {},
4394
- groups_id: {
4395
- fields: {
4396
- full_name: {}
4265
+ limit: 40,
4266
+ order: ""
4267
+ },
4268
+ display_name: {},
4269
+ child_id: {
4270
+ fields: {
4271
+ active: {},
4272
+ name: {},
4273
+ is_display: {},
4274
+ sequence: {},
4275
+ complete_name: {},
4276
+ action: {
4277
+ fields: {
4278
+ display_name: {},
4279
+ type: {},
4280
+ binding_view_types: {}
4281
+ // res_model: {},
4282
+ }
4397
4283
  },
4398
- limit: 40,
4399
- order: ""
4400
- },
4401
- display_name: {},
4402
- child_id: {
4403
- fields: {
4404
- active: {},
4405
- name: {},
4406
- is_display: {},
4407
- sequence: {},
4408
- complete_name: {},
4409
- action: {
4410
- fields: {
4411
- display_name: {},
4412
- type: {},
4413
- binding_view_types: {}
4414
- // res_model: {},
4415
- }
4284
+ url_icon: {},
4285
+ web_icon: {},
4286
+ web_icon_data: {},
4287
+ groups_id: {
4288
+ fields: {
4289
+ full_name: {}
4416
4290
  },
4417
- url_icon: {},
4418
- web_icon: {},
4419
- web_icon_data: {},
4420
- groups_id: {
4421
- fields: {
4422
- full_name: {}
4291
+ limit: 40,
4292
+ order: ""
4293
+ },
4294
+ display_name: {},
4295
+ child_id: {
4296
+ fields: {
4297
+ active: {},
4298
+ name: {},
4299
+ is_display: {},
4300
+ sequence: {},
4301
+ complete_name: {},
4302
+ action: {
4303
+ fields: {
4304
+ display_name: {},
4305
+ type: {},
4306
+ binding_view_types: {}
4307
+ // res_model: {},
4308
+ }
4423
4309
  },
4424
- limit: 40,
4425
- order: ""
4426
- },
4427
- display_name: {},
4428
- child_id: {
4429
- fields: {
4430
- active: {},
4431
- name: {},
4432
- is_display: {},
4433
- sequence: {},
4434
- complete_name: {},
4435
- action: {
4436
- fields: {
4437
- display_name: {},
4438
- type: {},
4439
- binding_view_types: {}
4440
- // res_model: {},
4441
- }
4310
+ url_icon: {},
4311
+ web_icon: {},
4312
+ web_icon_data: {},
4313
+ groups_id: {
4314
+ fields: {
4315
+ full_name: {}
4442
4316
  },
4443
- url_icon: {},
4444
- web_icon: {},
4445
- web_icon_data: {},
4446
- groups_id: {
4447
- fields: {
4448
- full_name: {}
4317
+ limit: 40,
4318
+ order: ""
4319
+ },
4320
+ display_name: {},
4321
+ child_id: {
4322
+ fields: {
4323
+ active: {},
4324
+ name: {},
4325
+ is_display: {},
4326
+ sequence: {},
4327
+ complete_name: {},
4328
+ action: {
4329
+ fields: {
4330
+ display_name: {},
4331
+ type: {},
4332
+ binding_view_types: {}
4333
+ // res_model: {},
4334
+ }
4449
4335
  },
4450
- limit: 40,
4451
- order: ""
4452
- },
4453
- display_name: {},
4454
- child_id: {
4455
- fields: {
4456
- active: {},
4457
- name: {},
4458
- is_display: {},
4459
- sequence: {},
4460
- complete_name: {},
4461
- action: {
4462
- fields: {
4463
- display_name: {},
4464
- type: {},
4465
- binding_view_types: {}
4466
- // res_model: {},
4467
- }
4336
+ url_icon: {},
4337
+ web_icon: {},
4338
+ web_icon_data: {},
4339
+ groups_id: {
4340
+ fields: {
4341
+ full_name: {}
4468
4342
  },
4469
- url_icon: {},
4470
- web_icon: {},
4471
- web_icon_data: {},
4472
- groups_id: {
4473
- fields: {
4474
- full_name: {}
4475
- },
4476
- limit: 40,
4477
- order: ""
4478
- },
4479
- display_name: {},
4480
- child_id: {
4481
- fields: {},
4482
- limit: 40,
4483
- order: ""
4484
- }
4343
+ limit: 40,
4344
+ order: ""
4485
4345
  },
4486
- limit: 40,
4487
- order: ""
4488
- }
4489
- },
4490
- limit: 40,
4491
- order: ""
4492
- }
4493
- },
4494
- limit: 40,
4495
- order: ""
4496
- }
4497
- },
4498
- domain: [
4499
- "&",
4500
- ["is_display", "=", true],
4501
- "&",
4502
- ["active", "=", true],
4503
- ["parent_id", "=", false]
4504
- ]
4505
- }
4506
- };
4507
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4508
- headers: {
4509
- "Content-Type": "application/json"
4510
- }
4511
- });
4346
+ display_name: {},
4347
+ child_id: {
4348
+ fields: {},
4349
+ limit: 40,
4350
+ order: ""
4351
+ }
4352
+ },
4353
+ limit: 40,
4354
+ order: ""
4355
+ }
4356
+ },
4357
+ limit: 40,
4358
+ order: ""
4359
+ }
4360
+ },
4361
+ limit: 40,
4362
+ order: ""
4363
+ }
4364
+ },
4365
+ domain: [
4366
+ "&",
4367
+ ["is_display", "=", true],
4368
+ "&",
4369
+ ["active", "=", true],
4370
+ ["parent_id", "=", false]
4371
+ ]
4372
+ }
4373
+ };
4374
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4375
+ headers: {
4376
+ "Content-Type": "application/json"
4377
+ }
4512
4378
  });
4513
4379
  },
4514
- getActionDetail(aid, context) {
4515
- return __async(this, null, function* () {
4516
- var _a;
4517
- const env2 = getEnv();
4518
- const jsonData = {
4519
- model: "ir.actions.act_window" /* WINDOW_ACTION */,
4520
- method: "web_read" /* WEB_READ */,
4521
- ids: [aid],
4522
- with_context: context,
4523
- kwargs: {
4524
- specification: {
4525
- id: {},
4526
- name: {},
4527
- res_model: {},
4528
- views: {},
4529
- view_mode: {},
4530
- mobile_view_mode: {},
4531
- domain: {},
4532
- context: {},
4533
- groups_id: {},
4534
- search_view_id: {}
4535
- }
4536
- }
4537
- };
4538
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4539
- headers: {
4540
- "Content-Type": "application/json"
4380
+ async getActionDetail(aid, context) {
4381
+ const env2 = getEnv();
4382
+ const jsonData = {
4383
+ model: "ir.actions.act_window" /* WINDOW_ACTION */,
4384
+ method: "web_read" /* WEB_READ */,
4385
+ ids: [aid],
4386
+ with_context: context,
4387
+ kwargs: {
4388
+ specification: {
4389
+ id: {},
4390
+ name: {},
4391
+ res_model: {},
4392
+ views: {},
4393
+ view_mode: {},
4394
+ mobile_view_mode: {},
4395
+ domain: {},
4396
+ context: {},
4397
+ groups_id: {},
4398
+ search_view_id: {}
4541
4399
  }
4542
- });
4400
+ }
4401
+ };
4402
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4403
+ headers: {
4404
+ "Content-Type": "application/json"
4405
+ }
4543
4406
  });
4544
4407
  },
4545
- getResequence(_0) {
4546
- return __async(this, arguments, function* ({
4408
+ async getResequence({
4409
+ model,
4410
+ ids,
4411
+ context,
4412
+ offset
4413
+ }) {
4414
+ const env2 = getEnv();
4415
+ const jsonData = {
4547
4416
  model,
4417
+ with_context: context,
4548
4418
  ids,
4549
- context,
4550
- offset
4551
- }) {
4552
- const env2 = getEnv();
4553
- const jsonData = __spreadValues({
4554
- model,
4555
- with_context: context,
4556
- ids,
4557
- field: "sequence"
4558
- }, offset > 0 ? { offset } : {});
4559
- return env2 == null ? void 0 : env2.requests.post("/web/dataset/resequence", jsonData, {
4560
- headers: {
4561
- "Content-Type": "application/json"
4562
- }
4563
- });
4564
- });
4565
- },
4566
- getSelectionItem(_0) {
4567
- return __async(this, arguments, function* ({ data }) {
4568
- var _a;
4569
- const env2 = getEnv();
4570
- const jsonData = {
4571
- model: data.model,
4572
- ids: [],
4573
- method: "get_data_select",
4574
- with_context: data.context,
4575
- kwargs: {
4576
- count_limit: 10001,
4577
- domain: data.domain ? data.domain : [],
4578
- offset: 0,
4579
- order: "",
4580
- specification: (_a = data == null ? void 0 : data.specification) != null ? _a : {
4581
- id: {},
4582
- name: {},
4583
- display_name: {}
4584
- }
4585
- }
4586
- };
4587
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4588
- headers: {
4589
- "Content-Type": "application/json"
4590
- }
4591
- });
4419
+ field: "sequence",
4420
+ ...offset > 0 ? { offset } : {}
4421
+ };
4422
+ return env2?.requests.post("/web/dataset/resequence", jsonData, {
4423
+ headers: {
4424
+ "Content-Type": "application/json"
4425
+ }
4592
4426
  });
4593
4427
  },
4594
- loadMessages() {
4595
- return __async(this, null, function* () {
4596
- const env2 = getEnv();
4597
- return env2.requests.post(
4598
- "/load_message_failures" /* LOAD_MESSAGE */,
4599
- {},
4600
- {
4601
- headers: {
4602
- "Content-Type": "application/json"
4603
- }
4428
+ async getSelectionItem({ data }) {
4429
+ const env2 = getEnv();
4430
+ const jsonData = {
4431
+ model: data.model,
4432
+ ids: [],
4433
+ method: "get_data_select",
4434
+ with_context: data.context,
4435
+ kwargs: {
4436
+ count_limit: 10001,
4437
+ domain: data.domain ? data.domain : [],
4438
+ offset: 0,
4439
+ order: "",
4440
+ specification: data?.specification ?? {
4441
+ id: {},
4442
+ name: {},
4443
+ display_name: {}
4604
4444
  }
4605
- );
4445
+ }
4446
+ };
4447
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4448
+ headers: {
4449
+ "Content-Type": "application/json"
4450
+ }
4606
4451
  });
4607
4452
  },
4608
- getVersion() {
4609
- return __async(this, null, function* () {
4610
- var _a;
4611
- const env2 = getEnv();
4612
- console.log("env?.requests", env2, env2 == null ? void 0 : env2.requests);
4613
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.get("", {
4453
+ async loadMessages() {
4454
+ const env2 = getEnv();
4455
+ return env2.requests.post(
4456
+ "/load_message_failures" /* LOAD_MESSAGE */,
4457
+ {},
4458
+ {
4614
4459
  headers: {
4615
4460
  "Content-Type": "application/json"
4616
4461
  }
4617
- });
4462
+ }
4463
+ );
4464
+ },
4465
+ async getVersion() {
4466
+ const env2 = getEnv();
4467
+ return env2?.requests.get("", {
4468
+ headers: {
4469
+ "Content-Type": "application/json"
4470
+ }
4618
4471
  });
4619
4472
  },
4620
- get2FAMethods(_0) {
4621
- return __async(this, arguments, function* ({
4473
+ async get2FAMethods({
4474
+ method,
4475
+ with_context
4476
+ }) {
4477
+ const env2 = getEnv();
4478
+ const jsonData = {
4622
4479
  method,
4623
4480
  with_context
4624
- }) {
4625
- const env2 = getEnv();
4626
- const jsonData = {
4627
- method,
4628
- with_context
4629
- };
4630
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4631
- headers: {
4632
- "Content-Type": "application/json"
4633
- }
4634
- });
4481
+ };
4482
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4483
+ headers: {
4484
+ "Content-Type": "application/json"
4485
+ }
4635
4486
  });
4636
4487
  },
4637
- verify2FA(_0) {
4638
- return __async(this, arguments, function* ({
4488
+ async verify2FA({
4489
+ method,
4490
+ with_context,
4491
+ code,
4492
+ device,
4493
+ location
4494
+ }) {
4495
+ const env2 = getEnv();
4496
+ const jsonData = {
4639
4497
  method,
4640
- with_context,
4641
- code,
4642
- device,
4643
- location
4644
- }) {
4645
- const env2 = getEnv();
4646
- const jsonData = {
4647
- method,
4648
- kwargs: {
4649
- vals: {
4650
- code,
4651
- device,
4652
- location
4653
- }
4654
- },
4655
- with_context
4656
- };
4657
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4658
- headers: {
4659
- "Content-Type": "application/json"
4660
- },
4661
- withCredentials: true
4662
- });
4498
+ kwargs: {
4499
+ vals: {
4500
+ code,
4501
+ device,
4502
+ location
4503
+ }
4504
+ },
4505
+ with_context
4506
+ };
4507
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4508
+ headers: {
4509
+ "Content-Type": "application/json"
4510
+ },
4511
+ withCredentials: true
4663
4512
  });
4664
4513
  },
4665
- signInSSO(_0) {
4666
- return __async(this, arguments, function* ({
4667
- redirect_uri,
4668
- state,
4669
- client_id,
4514
+ async signInSSO({
4515
+ redirect_uri,
4516
+ state,
4517
+ client_id,
4518
+ response_type,
4519
+ path
4520
+ }) {
4521
+ const env2 = getEnv();
4522
+ const params = new URLSearchParams({
4670
4523
  response_type,
4671
- path
4672
- }) {
4673
- const env2 = getEnv();
4674
- const params = new URLSearchParams({
4675
- response_type,
4676
- client_id,
4677
- redirect_uri,
4678
- state
4679
- });
4680
- const url = `${path}?${params.toString()}`;
4681
- return env2 == null ? void 0 : env2.requests.get(url, {
4682
- headers: {
4683
- "Content-Type": "application/json"
4684
- },
4685
- withCredentials: true
4686
- });
4524
+ client_id,
4525
+ redirect_uri,
4526
+ state
4527
+ });
4528
+ const url = `${path}?${params.toString()}`;
4529
+ return env2?.requests.get(url, {
4530
+ headers: {
4531
+ "Content-Type": "application/json"
4532
+ },
4533
+ withCredentials: true
4687
4534
  });
4688
4535
  },
4689
- grantAccess(_0) {
4690
- return __async(this, arguments, function* ({
4536
+ async grantAccess({
4537
+ redirect_uri,
4538
+ state,
4539
+ client_id,
4540
+ scopes
4541
+ }) {
4542
+ const env2 = getEnv();
4543
+ const jsonData = {
4691
4544
  redirect_uri,
4692
4545
  state,
4693
4546
  client_id,
4694
4547
  scopes
4695
- }) {
4696
- const env2 = getEnv();
4697
- const jsonData = {
4698
- redirect_uri,
4699
- state,
4700
- client_id,
4701
- scopes
4702
- };
4703
- return env2 == null ? void 0 : env2.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
4704
- headers: {
4705
- "Content-Type": "application/json"
4706
- },
4707
- withCredentials: true
4708
- });
4548
+ };
4549
+ return env2?.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
4550
+ headers: {
4551
+ "Content-Type": "application/json"
4552
+ },
4553
+ withCredentials: true
4709
4554
  });
4710
4555
  },
4711
- getFieldsViewSecurity(_0) {
4712
- return __async(this, arguments, function* ({
4556
+ async getFieldsViewSecurity({
4557
+ method,
4558
+ token,
4559
+ views
4560
+ }) {
4561
+ const env2 = getEnv();
4562
+ const jsonData = {
4713
4563
  method,
4714
- token,
4715
- views
4716
- }) {
4717
- const env2 = getEnv();
4718
- const jsonData = {
4719
- method,
4720
- kwargs: {
4721
- views
4722
- },
4723
- with_context: {
4724
- token
4725
- }
4726
- };
4727
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4728
- headers: {
4729
- "Content-Type": "application/json"
4730
- }
4731
- });
4564
+ kwargs: {
4565
+ views
4566
+ },
4567
+ with_context: {
4568
+ token
4569
+ }
4570
+ };
4571
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4572
+ headers: {
4573
+ "Content-Type": "application/json"
4574
+ }
4732
4575
  });
4733
4576
  },
4734
- settingsWebRead2fa(_0) {
4735
- return __async(this, arguments, function* ({
4577
+ async settingsWebRead2fa({
4578
+ method,
4579
+ model,
4580
+ kwargs,
4581
+ token
4582
+ }) {
4583
+ const env2 = getEnv();
4584
+ const jsonData = {
4736
4585
  method,
4737
4586
  model,
4738
4587
  kwargs,
4739
- token
4740
- }) {
4741
- const env2 = getEnv();
4742
- const jsonData = {
4743
- method,
4744
- model,
4745
- kwargs,
4746
- with_context: {
4747
- token
4748
- }
4749
- };
4750
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4751
- headers: {
4752
- "Content-Type": "application/json"
4753
- }
4754
- });
4588
+ with_context: {
4589
+ token
4590
+ }
4591
+ };
4592
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4593
+ headers: {
4594
+ "Content-Type": "application/json"
4595
+ }
4755
4596
  });
4756
4597
  },
4757
- requestSetupTotp(_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
- });
4598
+ async requestSetupTotp({ method, token }) {
4599
+ const env2 = getEnv();
4600
+ const jsonData = {
4601
+ method,
4602
+ with_context: {
4603
+ token
4604
+ }
4605
+ };
4606
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4607
+ headers: {
4608
+ "Content-Type": "application/json"
4609
+ }
4771
4610
  });
4772
4611
  },
4773
- verifyTotp(_0) {
4774
- return __async(this, arguments, function* ({
4612
+ async verifyTotp({
4613
+ method,
4614
+ action_token,
4615
+ code
4616
+ }) {
4617
+ const env2 = getEnv();
4618
+ const jsonData = {
4775
4619
  method,
4776
- action_token,
4777
- code
4778
- }) {
4779
- const env2 = getEnv();
4780
- const jsonData = {
4781
- method,
4782
- kwargs: {
4783
- vals: {
4784
- code
4785
- }
4786
- },
4787
- with_context: {
4788
- action_token
4789
- }
4790
- };
4791
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4792
- headers: {
4793
- "Content-Type": "application/json"
4620
+ kwargs: {
4621
+ vals: {
4622
+ code
4794
4623
  }
4795
- });
4624
+ },
4625
+ with_context: {
4626
+ action_token
4627
+ }
4628
+ };
4629
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4630
+ headers: {
4631
+ "Content-Type": "application/json"
4632
+ }
4796
4633
  });
4797
4634
  },
4798
- removeTotpSetUp(_0) {
4799
- return __async(this, arguments, function* ({ method, token }) {
4800
- const env2 = getEnv();
4801
- const jsonData = {
4802
- method,
4803
- with_context: {
4804
- token
4805
- }
4806
- };
4807
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4808
- headers: {
4809
- "Content-Type": "application/json"
4810
- }
4811
- });
4635
+ async removeTotpSetUp({ method, token }) {
4636
+ const env2 = getEnv();
4637
+ const jsonData = {
4638
+ method,
4639
+ with_context: {
4640
+ token
4641
+ }
4642
+ };
4643
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4644
+ headers: {
4645
+ "Content-Type": "application/json"
4646
+ }
4812
4647
  });
4813
4648
  }
4814
4649
  };