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