@fctc/interface-logic 1.5.2 → 1.5.4

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,10 +1,28 @@
1
1
  "use strict";
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
+ var __defProps = Object.defineProperties;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
7
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
9
  var __getProtoOf = Object.getPrototypeOf;
7
10
  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));
8
26
  var __export = (target, all) => {
9
27
  for (var name in all)
10
28
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -26,6 +44,26 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
44
  mod
27
45
  ));
28
46
  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
+ };
29
67
 
30
68
  // src/services.ts
31
69
  var services_exports = {};
@@ -1156,22 +1194,6 @@ var PyRelativeDelta = class _PyRelativeDelta {
1156
1194
  this.microsecond = params.microsecond;
1157
1195
  this.weekday = params.weekday;
1158
1196
  }
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;
1175
1197
  negate() {
1176
1198
  return new _PyRelativeDelta(this, -1);
1177
1199
  }
@@ -1286,7 +1308,7 @@ function execOnIterable(iterable, func) {
1286
1308
  if (typeof iterable === "object" && !Array.isArray(iterable) && !(iterable instanceof Set)) {
1287
1309
  iterable = Object.keys(iterable);
1288
1310
  }
1289
- if (typeof iterable?.[Symbol.iterator] !== "function") {
1311
+ if (typeof (iterable == null ? void 0 : iterable[Symbol.iterator]) !== "function") {
1290
1312
  throw new EvaluationError("value not iterable");
1291
1313
  }
1292
1314
  return func(iterable);
@@ -1609,7 +1631,7 @@ function applyBinaryOp(ast, context) {
1609
1631
  }
1610
1632
  return Math.floor(left / right);
1611
1633
  case "**":
1612
- return left ** right;
1634
+ return __pow(left, right);
1613
1635
  case "==":
1614
1636
  return isEqual(left, right);
1615
1637
  case "<>":
@@ -1731,7 +1753,7 @@ function evaluate(ast, context = {}) {
1731
1753
  const dicts = /* @__PURE__ */ new Set();
1732
1754
  let pyContext;
1733
1755
  const evalContext = Object.create(context);
1734
- if (!evalContext?.context) {
1756
+ if (!(evalContext == null ? void 0 : evalContext.context)) {
1735
1757
  Object.defineProperty(evalContext, "context", {
1736
1758
  get() {
1737
1759
  if (!pyContext) {
@@ -1742,17 +1764,18 @@ function evaluate(ast, context = {}) {
1742
1764
  });
1743
1765
  }
1744
1766
  function _innerEvaluate(ast2) {
1745
- switch (ast2?.type) {
1767
+ var _a, _b, _c;
1768
+ switch (ast2 == null ? void 0 : ast2.type) {
1746
1769
  case 0:
1747
1770
  // Number
1748
1771
  case 1:
1749
1772
  return ast2.value;
1750
1773
  case 5:
1751
1774
  if (ast2.value in evalContext) {
1752
- if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
1753
- return evalContext[ast2.value]?.id;
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;
1754
1777
  }
1755
- return evalContext[ast2.value] ?? false;
1778
+ return (_c = evalContext[ast2.value]) != null ? _c : false;
1756
1779
  } else if (ast2.value in BUILTINS) {
1757
1780
  return BUILTINS[ast2.value];
1758
1781
  } else {
@@ -1789,7 +1812,7 @@ function evaluate(ast, context = {}) {
1789
1812
  const args = ast2.args.map(_evaluate);
1790
1813
  const kwargs = {};
1791
1814
  for (const kwarg in ast2.kwargs) {
1792
- kwargs[kwarg] = _evaluate(ast2?.kwargs[kwarg]);
1815
+ kwargs[kwarg] = _evaluate(ast2 == null ? void 0 : ast2.kwargs[kwarg]);
1793
1816
  }
1794
1817
  if (fnValue === PyDate || fnValue === PyDateTime || fnValue === PyTime || fnValue === PyRelativeDelta || fnValue === PyTimeDelta) {
1795
1818
  return fnValue.create(...args, kwargs);
@@ -1868,9 +1891,25 @@ function escapeRegExp(str) {
1868
1891
  var InvalidDomainError = class extends Error {
1869
1892
  };
1870
1893
  var Domain = class _Domain {
1871
- ast = { type: -1, value: null };
1872
- static TRUE;
1873
- static FALSE;
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
+ }
1874
1913
  static combine(domains, operator) {
1875
1914
  if (domains.length === 0) {
1876
1915
  return new _Domain([]);
@@ -1949,24 +1988,6 @@ var Domain = class _Domain {
1949
1988
  processLeaf(d.ast.value, 0, "&", newDomain);
1950
1989
  return newDomain;
1951
1990
  }
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
- }
1970
1991
  contains(record) {
1971
1992
  const expr = evaluate(this.ast, record);
1972
1993
  return matchDomain(record, expr);
@@ -1985,7 +2006,7 @@ var Domain = class _Domain {
1985
2006
  return evaluatedAsList;
1986
2007
  }
1987
2008
  return this.toString();
1988
- } catch {
2009
+ } catch (e) {
1989
2010
  return this.toString();
1990
2011
  }
1991
2012
  }
@@ -2213,22 +2234,22 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
2213
2234
 
2214
2235
  // src/utils/storage/local-storage.ts
2215
2236
  var localStorageUtils = () => {
2216
- const setToken = async (access_token) => {
2237
+ const setToken = (access_token) => __async(null, null, function* () {
2217
2238
  localStorage.setItem("accessToken", access_token);
2218
- };
2219
- const setRefreshToken = async (refresh_token) => {
2239
+ });
2240
+ const setRefreshToken = (refresh_token) => __async(null, null, function* () {
2220
2241
  localStorage.setItem("refreshToken", refresh_token);
2221
- };
2222
- const getAccessToken = async () => {
2242
+ });
2243
+ const getAccessToken = () => __async(null, null, function* () {
2223
2244
  return localStorage.getItem("accessToken");
2224
- };
2225
- const getRefreshToken = async () => {
2245
+ });
2246
+ const getRefreshToken = () => __async(null, null, function* () {
2226
2247
  return localStorage.getItem("refreshToken");
2227
- };
2228
- const clearToken = async () => {
2248
+ });
2249
+ const clearToken = () => __async(null, null, function* () {
2229
2250
  localStorage.removeItem("accessToken");
2230
2251
  localStorage.removeItem("refreshToken");
2231
- };
2252
+ });
2232
2253
  return {
2233
2254
  setToken,
2234
2255
  setRefreshToken,
@@ -2240,9 +2261,9 @@ var localStorageUtils = () => {
2240
2261
 
2241
2262
  // src/utils/storage/session-storage.ts
2242
2263
  var sessionStorageUtils = () => {
2243
- const getBrowserSession = async () => {
2264
+ const getBrowserSession = () => __async(null, null, function* () {
2244
2265
  return sessionStorage.getItem("browserSession");
2245
- };
2266
+ });
2246
2267
  return {
2247
2268
  getBrowserSession
2248
2269
  };
@@ -2251,13 +2272,14 @@ var sessionStorageUtils = () => {
2251
2272
  // src/configs/axios-client.ts
2252
2273
  var axiosClient = {
2253
2274
  init(config) {
2254
- const localStorage2 = config.localStorageUtils ?? localStorageUtils();
2255
- const sessionStorage2 = config.sessionStorageUtils ?? sessionStorageUtils();
2275
+ var _a, _b;
2276
+ const localStorage2 = (_a = config.localStorageUtils) != null ? _a : localStorageUtils();
2277
+ const sessionStorage2 = (_b = config.sessionStorageUtils) != null ? _b : sessionStorageUtils();
2256
2278
  const db = config.db;
2257
2279
  let isRefreshing = false;
2258
2280
  let failedQueue = [];
2259
2281
  const processQueue = (error, token = null) => {
2260
- failedQueue?.forEach((prom) => {
2282
+ failedQueue == null ? void 0 : failedQueue.forEach((prom) => {
2261
2283
  if (error) {
2262
2284
  prom.reject(error);
2263
2285
  } else {
@@ -2273,14 +2295,14 @@ var axiosClient = {
2273
2295
  paramsSerializer: (params) => new URLSearchParams(params).toString()
2274
2296
  });
2275
2297
  instance.interceptors.request.use(
2276
- async (config2) => {
2298
+ (config2) => __async(null, null, function* () {
2277
2299
  const useRefreshToken = config2.useRefreshToken;
2278
- const token = useRefreshToken ? await localStorage2.getRefreshToken() : await localStorage2.getAccessToken();
2300
+ const token = useRefreshToken ? yield localStorage2.getRefreshToken() : yield localStorage2.getAccessToken();
2279
2301
  if (token) {
2280
2302
  config2.headers["Authorization"] = "Bearer " + token;
2281
2303
  }
2282
2304
  return config2;
2283
- },
2305
+ }),
2284
2306
  (error) => {
2285
2307
  Promise.reject(error);
2286
2308
  }
@@ -2289,19 +2311,21 @@ var axiosClient = {
2289
2311
  (response) => {
2290
2312
  return handleResponse(response);
2291
2313
  },
2292
- async (error) => {
2293
- const handleError3 = async (error2) => {
2314
+ (error) => __async(null, null, function* () {
2315
+ var _a2, _b2, _c;
2316
+ const handleError3 = (error2) => __async(null, null, function* () {
2317
+ var _a3;
2294
2318
  if (!error2.response) {
2295
2319
  return error2;
2296
2320
  }
2297
2321
  const { data } = error2.response;
2298
- if (data && data.code === 400 && ["invalid_grant"].includes(data.data?.error)) {
2299
- await clearAuthToken();
2322
+ if (data && data.code === 400 && ["invalid_grant"].includes((_a3 = data.data) == null ? void 0 : _a3.error)) {
2323
+ yield clearAuthToken();
2300
2324
  }
2301
2325
  return data;
2302
- };
2326
+ });
2303
2327
  const originalRequest = error.config;
2304
- if ((error.response?.status === 403 || error.response?.status === 401 || error.response?.status === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
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(
2305
2329
  error.response.data.code
2306
2330
  )) {
2307
2331
  if (isRefreshing) {
@@ -2314,18 +2338,19 @@ var axiosClient = {
2314
2338
  token
2315
2339
  );
2316
2340
  return instance.request(originalRequest);
2317
- }).catch(async (err) => {
2318
- if ((err.response?.status === 400 || err.response?.status === 401) && ["invalid_grant"].includes(err.response.data.error)) {
2319
- await clearAuthToken();
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();
2320
2345
  }
2321
- });
2346
+ }));
2322
2347
  }
2323
- const browserSession = await sessionStorage2.getBrowserSession();
2324
- const refreshToken = await localStorage2.getRefreshToken();
2325
- const accessTokenExp = await localStorage2.getAccessToken();
2348
+ const browserSession = yield sessionStorage2.getBrowserSession();
2349
+ const refreshToken = yield localStorage2.getRefreshToken();
2350
+ const accessTokenExp = yield localStorage2.getAccessToken();
2326
2351
  isRefreshing = true;
2327
2352
  if (!refreshToken && (!browserSession || browserSession == "unActive")) {
2328
- await clearAuthToken();
2353
+ yield clearAuthToken();
2329
2354
  } else {
2330
2355
  const payload = Object.fromEntries(
2331
2356
  Object.entries({
@@ -2336,8 +2361,9 @@ var axiosClient = {
2336
2361
  }).filter(([_, value]) => !!value)
2337
2362
  );
2338
2363
  return new Promise(function(resolve) {
2364
+ var _a3;
2339
2365
  import_axios.default.post(
2340
- `${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2366
+ `${config.baseUrl}${(_a3 = config.refreshTokenEndpoint) != null ? _a3 : "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2341
2367
  payload,
2342
2368
  {
2343
2369
  headers: {
@@ -2345,10 +2371,10 @@ var axiosClient = {
2345
2371
  Authorization: `Bearer ${accessTokenExp}`
2346
2372
  }
2347
2373
  }
2348
- ).then(async (res) => {
2374
+ ).then((res) => __async(null, null, function* () {
2349
2375
  const data = res.data;
2350
- await localStorage2.setToken(data.access_token);
2351
- await localStorage2.setRefreshToken(data.refresh_token);
2376
+ yield localStorage2.setToken(data.access_token);
2377
+ yield localStorage2.setRefreshToken(data.refresh_token);
2352
2378
  import_axios.default.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
2353
2379
  originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
2354
2380
  originalRequest.data = updateTokenParamInOriginalRequest(
@@ -2357,25 +2383,26 @@ var axiosClient = {
2357
2383
  );
2358
2384
  processQueue(null, data.access_token);
2359
2385
  resolve(instance.request(originalRequest));
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();
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();
2363
2390
  }
2364
2391
  if (err && err.response) {
2365
- const { error_code } = err.response?.data || {};
2392
+ const { error_code } = ((_a4 = err.response) == null ? void 0 : _a4.data) || {};
2366
2393
  if (error_code === "AUTHEN_FAIL") {
2367
- await clearAuthToken();
2394
+ yield clearAuthToken();
2368
2395
  }
2369
2396
  }
2370
2397
  processQueue(err, null);
2371
- }).finally(() => {
2398
+ })).finally(() => {
2372
2399
  isRefreshing = false;
2373
2400
  });
2374
2401
  });
2375
2402
  }
2376
2403
  }
2377
- return Promise.reject(await handleError3(error));
2378
- }
2404
+ return Promise.reject(yield handleError3(error));
2405
+ })
2379
2406
  );
2380
2407
  const handleResponse = (res) => {
2381
2408
  if (res && res.data) {
@@ -2384,6 +2411,7 @@ var axiosClient = {
2384
2411
  return res;
2385
2412
  };
2386
2413
  const handleError2 = (error) => {
2414
+ var _a2, _b2, _c;
2387
2415
  if (error.isAxiosError && error.code === "ECONNABORTED") {
2388
2416
  console.error("Request Timeout Error:", error);
2389
2417
  return "Request Timeout Error";
@@ -2391,17 +2419,17 @@ var axiosClient = {
2391
2419
  console.error("Network Error:", error);
2392
2420
  return "Network Error";
2393
2421
  } else {
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 };
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 };
2397
2425
  }
2398
2426
  };
2399
- const clearAuthToken = async () => {
2400
- await localStorage2.clearToken();
2427
+ const clearAuthToken = () => __async(null, null, function* () {
2428
+ yield localStorage2.clearToken();
2401
2429
  if (typeof window !== "undefined") {
2402
2430
  window.location.href = `/login`;
2403
2431
  }
2404
- };
2432
+ });
2405
2433
  function formatUrl(url, db2) {
2406
2434
  return url + (db2 ? "?db=" + db2 : "");
2407
2435
  }
@@ -2614,7 +2642,7 @@ var headerSlice = (0, import_toolkit5.createSlice)({
2614
2642
  },
2615
2643
  reducers: {
2616
2644
  setHeader: (state, action) => {
2617
- state.value = { ...state.value, ...action.payload };
2645
+ state.value = __spreadValues(__spreadValues({}, state.value), action.payload);
2618
2646
  },
2619
2647
  setAllowedCompanyIds: (state, action) => {
2620
2648
  state.value.allowedCompanyIds = action.payload;
@@ -3040,18 +3068,6 @@ var envStore = (0, import_toolkit11.configureStore)({
3040
3068
 
3041
3069
  // src/environment/EnvStore.ts
3042
3070
  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;
3055
3071
  constructor(envStore2, localStorageUtils2, sessionStorageUtils2) {
3056
3072
  this.envStore = envStore2;
3057
3073
  this.localStorageUtils = localStorageUtils2;
@@ -3060,25 +3076,24 @@ var EnvStore = class {
3060
3076
  }
3061
3077
  setup() {
3062
3078
  const env2 = this.envStore.getState().env;
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;
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;
3072
3088
  }
3073
3089
  setupEnv(envConfig) {
3074
3090
  const dispatch = this.envStore.dispatch;
3075
- const env2 = {
3076
- ...envConfig,
3091
+ const env2 = __spreadProps(__spreadValues({}, envConfig), {
3077
3092
  localStorageUtils: this.localStorageUtils,
3078
3093
  sessionStorageUtils: this.sessionStorageUtils
3079
- };
3094
+ });
3080
3095
  const requests = axiosClient.init(env2);
3081
- dispatch(setEnv({ ...env2, requests }));
3096
+ dispatch(setEnv(__spreadProps(__spreadValues({}, env2), { requests })));
3082
3097
  this.setup();
3083
3098
  }
3084
3099
  setUid(uid) {
@@ -3122,35 +3137,61 @@ function getEnv() {
3122
3137
  // src/services/action-service/index.ts
3123
3138
  var ActionService = {
3124
3139
  // Load Action
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"
3139
- }
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
+ });
3140
3155
  });
3141
3156
  },
3142
3157
  // Call Button
3143
- async callButton({
3144
- model,
3145
- ids = [],
3146
- context,
3147
- method
3148
- }) {
3149
- try {
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;
3181
+ }
3182
+ });
3183
+ },
3184
+ // remove Row
3185
+ removeRows(_0) {
3186
+ return __async(this, arguments, function* ({
3187
+ model,
3188
+ ids,
3189
+ context
3190
+ }) {
3150
3191
  const env2 = getEnv();
3151
3192
  const jsonData = {
3152
3193
  model,
3153
- method,
3194
+ method: "unlink",
3154
3195
  ids,
3155
3196
  with_context: context
3156
3197
  };
@@ -3159,112 +3200,96 @@ var ActionService = {
3159
3200
  "Content-Type": "application/json"
3160
3201
  }
3161
3202
  });
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
- }
3184
3203
  });
3185
3204
  },
3186
3205
  // Duplicate Model
3187
- async duplicateRecord({
3188
- model,
3189
- id,
3190
- context
3191
- }) {
3192
- const env2 = getEnv();
3193
- const jsonData = {
3206
+ duplicateRecord(_0) {
3207
+ return __async(this, arguments, function* ({
3194
3208
  model,
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
- }
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
+ });
3203
3224
  });
3204
3225
  },
3205
3226
  // Get Print Report
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: {}
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
+ }
3215
3238
  }
3216
- }
3217
- };
3218
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3219
- headers: {
3220
- "Content-Type": "application/json"
3221
- }
3239
+ };
3240
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3241
+ headers: {
3242
+ "Content-Type": "application/json"
3243
+ }
3244
+ });
3222
3245
  });
3223
3246
  },
3224
3247
  //Save Print Invoice
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"
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
+ });
3241
3266
  });
3242
3267
  },
3243
3268
  //Run Action
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
- }
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
+ });
3268
3293
  });
3269
3294
  }
3270
3295
  };
@@ -3272,814 +3297,910 @@ var action_service_default = ActionService;
3272
3297
 
3273
3298
  // src/services/auth-service/index.ts
3274
3299
  var AuthService = {
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
- }
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
+ });
3291
3319
  });
3292
3320
  },
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
- }
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
+ });
3303
3334
  });
3304
3335
  },
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
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"
3316
3356
  }
3317
- },
3318
- with_context
3319
- };
3320
- return env2?.requests?.post("/call" /* CALL_PATH */, body, {
3321
- headers: {
3322
- "Content-Type": "application/json"
3323
- }
3357
+ });
3324
3358
  });
3325
3359
  },
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
- }
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
+ });
3337
3374
  });
3338
3375
  },
3339
- async resetPasswordSSO({
3340
- method,
3341
- password,
3342
- with_context
3343
- }) {
3344
- const env2 = getEnv();
3345
- const bodyData = {
3376
+ resetPasswordSSO(_0) {
3377
+ return __async(this, arguments, function* ({
3346
3378
  method,
3347
- kwargs: {
3348
- vals: {
3349
- password
3350
- }
3351
- },
3379
+ password,
3352
3380
  with_context
3353
- };
3354
- return env2?.requests?.post("/call" /* CALL_PATH */, bodyData, {
3355
- headers: {
3356
- "Content-Type": "application/json"
3357
- }
3358
- });
3359
- },
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
- }
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"
3396
+ }
3397
+ });
3382
3398
  });
3383
3399
  },
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
- {
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, {
3394
3410
  headers: {
3395
3411
  "Content-Type": "application/json"
3396
3412
  }
3397
- }
3398
- );
3399
- },
3400
- async getProviders(db) {
3401
- const env2 = getEnv();
3402
- return env2?.requests?.get("/oauth/providers", { params: { db } });
3403
- },
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"
3417
- }
3418
- }
3419
- );
3413
+ });
3414
+ });
3420
3415
  },
3421
- async logout(data) {
3422
- const env2 = getEnv();
3423
- console.log(data);
3424
- return env2?.requests?.post(
3425
- "/logout" /* LOGOUT */,
3426
- {},
3427
- {
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, {
3428
3424
  headers: {
3429
3425
  "Content-Type": "application/json"
3430
- },
3431
- withCredentials: true,
3432
- useRefreshToken: true
3433
- }
3434
- );
3435
- }
3436
- };
3437
- var auth_service_default = AuthService;
3438
-
3439
- // src/services/company-service/index.ts
3440
- var CompanyService = {
3441
- async getCurrentCompany() {
3442
- const env2 = getEnv();
3443
- return await env2.requests.get("/company" /* COMPANY_PATH */, {
3444
- headers: {
3445
- "Content-Type": "application/json"
3446
- }
3426
+ }
3427
+ });
3447
3428
  });
3448
3429
  },
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: {}
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
+ }
3462
3445
  }
3463
- }
3464
- };
3465
- return await env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3466
- headers: {
3467
- "Content-Type": "application/json"
3468
- }
3469
- });
3470
- }
3471
- };
3472
- var company_service_default = CompanyService;
3473
-
3474
- // src/services/excel-service/index.ts
3475
- var ExcelService = {
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
- }
3446
+ );
3482
3447
  });
3483
3448
  },
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
- }
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 } });
3490
3454
  });
3491
3455
  },
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
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
+ }
3524
3472
  }
3525
- },
3526
- with_context: context
3527
- };
3528
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3529
- headers: {
3530
- "Content-Type": "multipart/form-data"
3531
- }
3473
+ );
3532
3474
  });
3533
3475
  },
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
- }
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
+ );
3559
3492
  });
3560
- },
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);
3569
- },
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 = {
3584
- model,
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);
3598
- },
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 = {
3611
- model,
3612
- domain,
3613
- ids,
3614
- import_compat: importCompat,
3615
- fields,
3616
- with_context: context,
3617
- groupby: groupby ?? []
3618
- };
3619
- return env2.requests.post_excel(`/export/${type}`, jsonData);
3620
3493
  }
3621
3494
  };
3622
- var excel_service_default = ExcelService;
3495
+ var auth_service_default = AuthService;
3623
3496
 
3624
- // src/services/form-service/index.ts
3625
- var FormService = {
3626
- async getComment({ data }) {
3627
- try {
3497
+ // src/services/company-service/index.ts
3498
+ var CompanyService = {
3499
+ getCurrentCompany() {
3500
+ return __async(this, null, function* () {
3628
3501
  const env2 = getEnv();
3629
- const jsonData = {
3630
- thread_id: data.thread_id,
3631
- thread_model: data.thread_model,
3632
- limit: 100,
3633
- with_context: {
3634
- lang: data.lang
3635
- }
3636
- };
3637
- return env2.requests.post("/chatter/thread/messages" /* GET_MESSAGE */, jsonData, {
3502
+ return yield env2.requests.get("/company" /* COMPANY_PATH */, {
3638
3503
  headers: {
3639
3504
  "Content-Type": "application/json"
3640
3505
  }
3641
3506
  });
3642
- } catch (error) {
3643
- console.error("Error when sending message:", error);
3644
- throw error;
3645
- }
3507
+ });
3646
3508
  },
3647
- async sentComment({ data }) {
3648
- try {
3509
+ getInfoCompany(id) {
3510
+ return __async(this, null, function* () {
3511
+ var _a;
3649
3512
  const env2 = getEnv();
3650
3513
  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
3664
- },
3665
- thread_id: Number(data.thread_id),
3666
- thread_model: data.thread_model
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
+ }
3667
3526
  };
3668
- return env2.requests.post("/chatter/message/post" /* SENT_MESSAGE */, jsonData, {
3527
+ return yield (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
3669
3528
  headers: {
3670
3529
  "Content-Type": "application/json"
3671
3530
  }
3672
3531
  });
3673
- } catch (error) {
3674
- console.error("Error when sent message:", error);
3675
- throw error;
3676
- }
3677
- },
3678
- async deleteComment({ data }) {
3679
- try {
3532
+ });
3533
+ }
3534
+ };
3535
+ var company_service_default = CompanyService;
3536
+
3537
+ // src/services/excel-service/index.ts
3538
+ var ExcelService = {
3539
+ uploadFile(_0) {
3540
+ return __async(this, arguments, function* ({ formData }) {
3680
3541
  const env2 = getEnv();
3681
- const jsonData = {
3682
- attachment_ids: [],
3683
- attachment_tokens: [],
3684
- body: "",
3685
- message_id: data.message_id
3686
- };
3687
- return env2.requests.post("/chatter/message/update_content" /* DELETE_MESSAGE */, jsonData, {
3542
+ return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
3688
3543
  headers: {
3689
- "Content-Type": "application/json"
3544
+ "Content-Type": "multipart/form-data"
3690
3545
  }
3691
3546
  });
3692
- } catch (error) {
3693
- console.error("Error when sent message:", error);
3694
- throw error;
3695
- }
3547
+ });
3696
3548
  },
3697
- async getImage({ data }) {
3698
- try {
3549
+ uploadIdFile(_0) {
3550
+ return __async(this, arguments, function* ({ formData }) {
3699
3551
  const env2 = getEnv();
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
- }
3552
+ return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
3553
+ headers: {
3554
+ "Content-Type": "multipart/form-data"
3706
3555
  }
3707
- );
3708
- } catch (error) {
3709
- console.error("Error when sent message:", error);
3710
- throw error;
3711
- }
3556
+ });
3557
+ });
3712
3558
  },
3713
- async uploadImage({ data }) {
3714
- try {
3559
+ parsePreview(_0) {
3560
+ return __async(this, arguments, function* ({
3561
+ id,
3562
+ selectedSheet,
3563
+ isHeader,
3564
+ context
3565
+ }) {
3715
3566
  const env2 = getEnv();
3716
- return env2.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
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, {
3717
3597
  headers: {
3718
3598
  "Content-Type": "multipart/form-data"
3719
3599
  }
3720
3600
  });
3721
- } catch (error) {
3722
- console.error("Error when sent message:", error);
3723
- throw error;
3724
- }
3601
+ });
3725
3602
  },
3726
- async getFormView({ data }) {
3727
- try {
3603
+ executeImport(_0) {
3604
+ return __async(this, arguments, function* ({
3605
+ columns,
3606
+ fields,
3607
+ idFile,
3608
+ options,
3609
+ dryrun,
3610
+ context
3611
+ }) {
3728
3612
  const env2 = getEnv();
3729
3613
  const jsonData = {
3730
- model: data.model,
3731
- method: "get_formview_action",
3732
- ids: data.id ? [data.id] : [],
3733
- with_context: data.context
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
3734
3624
  };
3735
3625
  return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3736
3626
  headers: {
3737
- "Content-Type": "application/json"
3627
+ "Content-Type": "multipart/form-data"
3738
3628
  }
3739
3629
  });
3740
- } catch (error) {
3741
- console.error("Error when fetching form view:", error);
3742
- throw error;
3743
- }
3630
+ });
3744
3631
  },
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
- }
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);
3770
3641
  });
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 = {
3642
+ },
3643
+ getFieldExport(_0) {
3644
+ return __async(this, arguments, function* ({
3645
+ ids,
3783
3646
  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
- }
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);
3796
3672
  });
3797
3673
  },
3798
- async getProgressBar({
3799
- field,
3800
- color,
3801
- model,
3802
- width_context
3803
- }) {
3804
- const env2 = getEnv();
3805
- const jsonDataView = {
3674
+ exportExcel(_0) {
3675
+ return __async(this, arguments, function* ({
3806
3676
  model,
3807
- method: "read_progress_bar",
3808
- kwargs: {
3809
- domain: [],
3810
- group_by: "stage_id",
3811
- progress_bar: {
3812
- colors: color,
3813
- field
3814
- }
3815
- },
3816
- width_context
3817
- };
3818
- return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
3819
- headers: {
3820
- "Content-Type": "application/json"
3821
- }
3677
+ domain,
3678
+ ids,
3679
+ 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);
3822
3696
  });
3823
3697
  }
3824
3698
  };
3825
- var kanban_service_default = KanbanServices;
3699
+ var excel_service_default = ExcelService;
3826
3700
 
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
3701
+ // src/services/form-service/index.ts
3702
+ 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;
3844
3723
  }
3845
- };
3846
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3847
- headers: {
3848
- "Content-Type": "application/json"
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;
3849
3756
  }
3850
3757
  });
3851
3758
  },
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"
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;
3870
3777
  }
3871
3778
  });
3872
3779
  },
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: {}
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"
3886
3789
  }
3887
3790
  }
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"
3791
+ );
3792
+ } catch (error) {
3793
+ console.error("Error when sent message:", error);
3794
+ throw error;
3897
3795
  }
3898
3796
  });
3899
3797
  },
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"
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;
3925
3810
  }
3926
3811
  });
3927
3812
  },
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,
3947
- fields: data.fields,
3948
- ...jsonReadGroup
3949
- }
3950
- };
3951
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3952
- headers: {
3953
- "Content-Type": "application/json"
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;
3954
3831
  }
3955
3832
  });
3956
3833
  },
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 = {
3834
+ changeStatus(_0) {
3835
+ return __async(this, arguments, function* ({ data }) {
3836
+ const env2 = getEnv();
3837
+ const vals = {
3838
+ [data.name]: data.stage_id
3839
+ };
3840
+ const jsonData = {
3841
+ model: data.model,
3842
+ method: "web_save",
3843
+ 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: {}
3854
+ }
3855
+ };
3856
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3857
+ headers: {
3858
+ "Content-Type": "application/json"
3859
+ }
3860
+ });
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* ({
3969
3870
  model,
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
- }
3871
+ width_context
3872
+ }) {
3873
+ 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"]
3881
+ },
3882
+ width_context
3883
+ };
3884
+ return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
3885
+ headers: {
3886
+ "Content-Type": "application/json"
3887
+ }
3888
+ });
3985
3889
  });
3986
3890
  },
3987
- async getDetail({
3988
- ids = [],
3989
- model,
3990
- specification,
3991
- context
3992
- }) {
3993
- const env2 = getEnv();
3994
- const jsonData = {
3891
+ getProgressBar(_0) {
3892
+ return __async(this, arguments, function* ({
3893
+ field,
3894
+ color,
3995
3895
  model,
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
- }
3896
+ width_context
3897
+ }) {
3898
+ 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
3911
+ };
3912
+ return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
3913
+ headers: {
3914
+ "Content-Type": "application/json"
3915
+ }
3916
+ });
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
+ }) {
3931
+ 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"
3945
+ }
3946
+ });
4007
3947
  });
4008
3948
  },
4009
- async save({
4010
- model,
4011
- ids = [],
4012
- data = {},
4013
- specification = {},
4014
- context = {},
4015
- path
4016
- }) {
4017
- const env2 = getEnv();
4018
- const jsonData = {
3949
+ getCurrency() {
3950
+ return __async(this, null, function* () {
3951
+ 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, {
3966
+ headers: {
3967
+ "Content-Type": "application/json"
3968
+ }
3969
+ });
3970
+ });
3971
+ },
3972
+ getConversionRate() {
3973
+ return __async(this, null, function* () {
3974
+ const env2 = getEnv();
3975
+ 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
+ }
3993
+ };
3994
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3995
+ headers: {
3996
+ "Content-Type": "application/json"
3997
+ }
3998
+ });
3999
+ });
4000
+ },
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"
4026
+ }
4027
+ });
4028
+ });
4029
+ },
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] ? {
4034
+ 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
+ });
4058
+ });
4059
+ },
4060
+ getList(_0) {
4061
+ return __async(this, arguments, function* ({
4019
4062
  model,
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
- }
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
+ });
4032
4091
  });
4033
4092
  },
4034
- async delete({ ids = [], model }) {
4035
- const env2 = getEnv();
4036
- const jsonData = {
4093
+ getDetail(_0) {
4094
+ return __async(this, arguments, function* ({
4095
+ ids = [],
4037
4096
  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
- }
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
+ });
4045
4116
  });
4046
4117
  },
4047
- async onChange({
4048
- ids = [],
4049
- model,
4050
- object,
4051
- specification,
4052
- context,
4053
- fieldChange
4054
- }) {
4055
- const env2 = getEnv();
4056
- const jsonData = {
4118
+ save(_0) {
4119
+ return __async(this, arguments, function* ({
4057
4120
  model,
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
- }
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
+ });
4071
4144
  });
4072
4145
  },
4073
- async getListFieldsOnchange({ model }) {
4074
- const env2 = getEnv();
4075
- const jsonData = {
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
+ });
4160
+ });
4161
+ },
4162
+ onChange(_0) {
4163
+ return __async(this, arguments, function* ({
4164
+ ids = [],
4076
4165
  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
- }
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
+ });
4189
+ });
4190
+ },
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
+ });
4083
4204
  });
4084
4205
  },
4085
4206
  parseORMOdoo(data) {
@@ -4093,13 +4214,14 @@ var ModelService = {
4093
4214
  data[key] = "/";
4094
4215
  }
4095
4216
  }
4096
- return { ...data };
4217
+ return __spreadValues({}, data);
4097
4218
  },
4098
4219
  toDataJS(data, viewData, model) {
4220
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
4099
4221
  for (const key in data) {
4100
4222
  if (data[key] === false) {
4101
4223
  if (viewData && model) {
4102
- if (viewData?.models?.[model]?.[key]?.type !== "boolean" /* BOOLEAN */) {
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 */) {
4103
4225
  data[key] = null;
4104
4226
  }
4105
4227
  } else {
@@ -4109,12 +4231,13 @@ var ModelService = {
4109
4231
  data[key] = "Draft";
4110
4232
  } else if (data[key] !== false) {
4111
4233
  if (model !== void 0) {
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;
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;
4115
4238
  if (relation !== void 0) {
4116
- if (viewData?.models?.[relation]) {
4117
- if (item?.length >= 3) {
4239
+ if ((_d2 = viewData == null ? void 0 : viewData.models) == null ? void 0 : _d2[relation]) {
4240
+ if ((item == null ? void 0 : item.length) >= 3) {
4118
4241
  return ModelService.toDataJS(
4119
4242
  item[OBJECT_POSITION],
4120
4243
  viewData,
@@ -4124,7 +4247,7 @@ var ModelService = {
4124
4247
  return ModelService.toDataJS(item, viewData, relation);
4125
4248
  }
4126
4249
  } else {
4127
- if (item?.length >= 3) {
4250
+ if ((item == null ? void 0 : item.length) >= 3) {
4128
4251
  return item[OBJECT_POSITION];
4129
4252
  } else {
4130
4253
  return item;
@@ -4136,514 +4259,556 @@ var ModelService = {
4136
4259
  }
4137
4260
  }
4138
4261
  }
4139
- return { ...data };
4262
+ return __spreadValues({}, data);
4140
4263
  }
4141
4264
  };
4142
4265
  var model_service_default = ModelService;
4143
4266
 
4144
4267
  // src/services/user-service/index.ts
4145
4268
  var UserService = {
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
- }
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
+ });
4152
4277
  });
4153
4278
  },
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: {}
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
+ }
4179
4306
  }
4180
4307
  }
4181
4308
  }
4182
- }
4183
- };
4184
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4185
- headers: {
4186
- "Content-Type": "application/json"
4187
- }
4309
+ };
4310
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4311
+ headers: {
4312
+ "Content-Type": "application/json"
4313
+ }
4314
+ });
4188
4315
  });
4189
4316
  },
4190
- switchUserLocale: async ({ id, values }) => {
4317
+ switchUserLocale: (_0) => __async(null, [_0], function* ({ id, values }) {
4318
+ var _a;
4191
4319
  const env2 = getEnv();
4192
4320
  const jsonData = {
4193
4321
  model: "res.users",
4194
4322
  domain: [["id", "=", id]],
4195
4323
  values
4196
4324
  };
4197
- return env2?.requests.post(UriConstants?.CREATE_UPDATE_PATH, jsonData, {
4325
+ return env2 == null ? void 0 : env2.requests.post((_a = UriConstants) == null ? void 0 : _a.CREATE_UPDATE_PATH, jsonData, {
4198
4326
  headers: {
4199
4327
  "Content-Type": "application/json"
4200
4328
  }
4201
4329
  });
4202
- }
4330
+ })
4203
4331
  };
4204
4332
  var user_service_default = UserService;
4205
4333
 
4206
4334
  // src/services/view-service/index.ts
4207
4335
  var ViewService = {
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 = {
4336
+ getView(_0) {
4337
+ return __async(this, arguments, function* ({
4222
4338
  model,
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
- }
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
+ });
4234
4365
  });
4235
4366
  },
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: {}
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
+ }
4264
4390
  },
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
- }
4391
+ url_icon: {},
4392
+ web_icon: {},
4393
+ web_icon_data: {},
4394
+ groups_id: {
4395
+ fields: {
4396
+ full_name: {}
4283
4397
  },
4284
- url_icon: {},
4285
- web_icon: {},
4286
- web_icon_data: {},
4287
- groups_id: {
4288
- fields: {
4289
- full_name: {}
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
+ }
4290
4416
  },
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
- }
4417
+ url_icon: {},
4418
+ web_icon: {},
4419
+ web_icon_data: {},
4420
+ groups_id: {
4421
+ fields: {
4422
+ full_name: {}
4309
4423
  },
4310
- url_icon: {},
4311
- web_icon: {},
4312
- web_icon_data: {},
4313
- groups_id: {
4314
- fields: {
4315
- full_name: {}
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
+ }
4316
4442
  },
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
- }
4443
+ url_icon: {},
4444
+ web_icon: {},
4445
+ web_icon_data: {},
4446
+ groups_id: {
4447
+ fields: {
4448
+ full_name: {}
4335
4449
  },
4336
- url_icon: {},
4337
- web_icon: {},
4338
- web_icon_data: {},
4339
- groups_id: {
4340
- fields: {
4341
- full_name: {}
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
+ }
4342
4468
  },
4343
- limit: 40,
4344
- order: ""
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
+ }
4345
4485
  },
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
- }
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
+ });
4378
4512
  });
4379
4513
  },
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: {}
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
+ }
4399
4536
  }
4400
- }
4401
- };
4402
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4403
- headers: {
4404
- "Content-Type": "application/json"
4405
- }
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"
4541
+ }
4542
+ });
4406
4543
  });
4407
4544
  },
4408
- async getResequence({
4409
- model,
4410
- ids,
4411
- context,
4412
- offset
4413
- }) {
4414
- const env2 = getEnv();
4415
- const jsonData = {
4545
+ getResequence(_0) {
4546
+ return __async(this, arguments, function* ({
4416
4547
  model,
4417
- with_context: context,
4418
4548
  ids,
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
- }
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
+ });
4426
4564
  });
4427
4565
  },
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: {}
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
+ }
4444
4585
  }
4445
- }
4446
- };
4447
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4448
- headers: {
4449
- "Content-Type": "application/json"
4450
- }
4586
+ };
4587
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4588
+ headers: {
4589
+ "Content-Type": "application/json"
4590
+ }
4591
+ });
4451
4592
  });
4452
4593
  },
4453
- async loadMessages() {
4454
- const env2 = getEnv();
4455
- return env2.requests.post(
4456
- "/load_message_failures" /* LOAD_MESSAGE */,
4457
- {},
4458
- {
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
+ }
4604
+ }
4605
+ );
4606
+ });
4607
+ },
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("", {
4459
4614
  headers: {
4460
4615
  "Content-Type": "application/json"
4461
4616
  }
4462
- }
4463
- );
4464
- },
4465
- async getVersion() {
4466
- const env2 = getEnv();
4467
- return env2?.requests.get("", {
4468
- headers: {
4469
- "Content-Type": "application/json"
4470
- }
4617
+ });
4471
4618
  });
4472
4619
  },
4473
- async get2FAMethods({
4474
- method,
4475
- with_context
4476
- }) {
4477
- const env2 = getEnv();
4478
- const jsonData = {
4620
+ get2FAMethods(_0) {
4621
+ return __async(this, arguments, function* ({
4479
4622
  method,
4480
4623
  with_context
4481
- };
4482
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4483
- headers: {
4484
- "Content-Type": "application/json"
4485
- }
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
+ });
4486
4635
  });
4487
4636
  },
4488
- async verify2FA({
4489
- method,
4490
- with_context,
4491
- code,
4492
- device,
4493
- location
4494
- }) {
4495
- const env2 = getEnv();
4496
- const jsonData = {
4637
+ verify2FA(_0) {
4638
+ return __async(this, arguments, function* ({
4497
4639
  method,
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
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
+ });
4512
4663
  });
4513
4664
  },
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({
4523
- response_type,
4524
- client_id,
4665
+ signInSSO(_0) {
4666
+ return __async(this, arguments, function* ({
4525
4667
  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
4668
+ state,
4669
+ client_id,
4670
+ 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
+ });
4534
4687
  });
4535
4688
  },
4536
- async grantAccess({
4537
- redirect_uri,
4538
- state,
4539
- client_id,
4540
- scopes
4541
- }) {
4542
- const env2 = getEnv();
4543
- const jsonData = {
4689
+ grantAccess(_0) {
4690
+ return __async(this, arguments, function* ({
4544
4691
  redirect_uri,
4545
4692
  state,
4546
4693
  client_id,
4547
4694
  scopes
4548
- };
4549
- return env2?.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
4550
- headers: {
4551
- "Content-Type": "application/json"
4552
- },
4553
- withCredentials: true
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
+ });
4554
4709
  });
4555
4710
  },
4556
- async getFieldsViewSecurity({
4557
- method,
4558
- token,
4559
- views
4560
- }) {
4561
- const env2 = getEnv();
4562
- const jsonData = {
4711
+ getFieldsViewSecurity(_0) {
4712
+ return __async(this, arguments, function* ({
4563
4713
  method,
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
- }
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
+ });
4575
4732
  });
4576
4733
  },
4577
- async settingsWebRead2fa({
4578
- method,
4579
- model,
4580
- kwargs,
4581
- token
4582
- }) {
4583
- const env2 = getEnv();
4584
- const jsonData = {
4734
+ settingsWebRead2fa(_0) {
4735
+ return __async(this, arguments, function* ({
4585
4736
  method,
4586
4737
  model,
4587
4738
  kwargs,
4588
- with_context: {
4589
- token
4590
- }
4591
- };
4592
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4593
- headers: {
4594
- "Content-Type": "application/json"
4595
- }
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
+ });
4596
4755
  });
4597
4756
  },
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
- }
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
+ });
4610
4771
  });
4611
4772
  },
4612
- async verifyTotp({
4613
- method,
4614
- action_token,
4615
- code
4616
- }) {
4617
- const env2 = getEnv();
4618
- const jsonData = {
4773
+ verifyTotp(_0) {
4774
+ return __async(this, arguments, function* ({
4619
4775
  method,
4620
- kwargs: {
4621
- vals: {
4622
- code
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
4623
4789
  }
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
- }
4790
+ };
4791
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4792
+ headers: {
4793
+ "Content-Type": "application/json"
4794
+ }
4795
+ });
4633
4796
  });
4634
4797
  },
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
- }
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
+ });
4647
4812
  });
4648
4813
  }
4649
4814
  };