@fctc/interface-logic 1.5.4 → 1.5.5

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