@fctc/interface-logic 1.5.8 → 1.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/hooks.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/hooks/auth/use-forgot-password.ts
43
2
  import { useMutation } from "@tanstack/react-query";
44
3
 
@@ -1163,6 +1122,22 @@ var PyRelativeDelta = class _PyRelativeDelta {
1163
1122
  this.microsecond = params.microsecond;
1164
1123
  this.weekday = params.weekday;
1165
1124
  }
1125
+ years;
1126
+ months;
1127
+ days;
1128
+ hours;
1129
+ minutes;
1130
+ seconds;
1131
+ microseconds;
1132
+ leapDays;
1133
+ year;
1134
+ month;
1135
+ day;
1136
+ hour;
1137
+ minute;
1138
+ second;
1139
+ microsecond;
1140
+ weekday;
1166
1141
  negate() {
1167
1142
  return new _PyRelativeDelta(this, -1);
1168
1143
  }
@@ -1277,7 +1252,7 @@ function execOnIterable(iterable, func) {
1277
1252
  if (typeof iterable === "object" && !Array.isArray(iterable) && !(iterable instanceof Set)) {
1278
1253
  iterable = Object.keys(iterable);
1279
1254
  }
1280
- if (typeof (iterable == null ? void 0 : iterable[Symbol.iterator]) !== "function") {
1255
+ if (typeof iterable?.[Symbol.iterator] !== "function") {
1281
1256
  throw new EvaluationError("value not iterable");
1282
1257
  }
1283
1258
  return func(iterable);
@@ -1600,7 +1575,7 @@ function applyBinaryOp(ast, context) {
1600
1575
  }
1601
1576
  return Math.floor(left / right);
1602
1577
  case "**":
1603
- return __pow(left, right);
1578
+ return left ** right;
1604
1579
  case "==":
1605
1580
  return isEqual(left, right);
1606
1581
  case "<>":
@@ -1722,7 +1697,7 @@ function evaluate(ast, context = {}) {
1722
1697
  const dicts = /* @__PURE__ */ new Set();
1723
1698
  let pyContext;
1724
1699
  const evalContext = Object.create(context);
1725
- if (!(evalContext == null ? void 0 : evalContext.context)) {
1700
+ if (!evalContext?.context) {
1726
1701
  Object.defineProperty(evalContext, "context", {
1727
1702
  get() {
1728
1703
  if (!pyContext) {
@@ -1733,18 +1708,17 @@ function evaluate(ast, context = {}) {
1733
1708
  });
1734
1709
  }
1735
1710
  function _innerEvaluate(ast2) {
1736
- var _a, _b, _c;
1737
- switch (ast2 == null ? void 0 : ast2.type) {
1711
+ switch (ast2?.type) {
1738
1712
  case 0:
1739
1713
  // Number
1740
1714
  case 1:
1741
1715
  return ast2.value;
1742
1716
  case 5:
1743
1717
  if (ast2.value in evalContext) {
1744
- if (typeof evalContext[ast2.value] === "object" && ((_a = evalContext[ast2.value]) == null ? void 0 : _a.id)) {
1745
- return (_b = evalContext[ast2.value]) == null ? void 0 : _b.id;
1718
+ if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
1719
+ return evalContext[ast2.value]?.id;
1746
1720
  }
1747
- return (_c = evalContext[ast2.value]) != null ? _c : false;
1721
+ return evalContext[ast2.value] ?? false;
1748
1722
  } else if (ast2.value in BUILTINS) {
1749
1723
  return BUILTINS[ast2.value];
1750
1724
  } else {
@@ -1781,7 +1755,7 @@ function evaluate(ast, context = {}) {
1781
1755
  const args = ast2.args.map(_evaluate);
1782
1756
  const kwargs = {};
1783
1757
  for (const kwarg in ast2.kwargs) {
1784
- kwargs[kwarg] = _evaluate(ast2 == null ? void 0 : ast2.kwargs[kwarg]);
1758
+ kwargs[kwarg] = _evaluate(ast2?.kwargs[kwarg]);
1785
1759
  }
1786
1760
  if (fnValue === PyDate || fnValue === PyDateTime || fnValue === PyTime || fnValue === PyRelativeDelta || fnValue === PyTimeDelta) {
1787
1761
  return fnValue.create(...args, kwargs);
@@ -1860,25 +1834,9 @@ function escapeRegExp(str) {
1860
1834
  var InvalidDomainError = class extends Error {
1861
1835
  };
1862
1836
  var Domain = class _Domain {
1863
- constructor(descr = []) {
1864
- this.ast = { type: -1, value: null };
1865
- if (descr instanceof _Domain) {
1866
- return new _Domain(descr.toString());
1867
- } else {
1868
- let rawAST;
1869
- try {
1870
- rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
1871
- } catch (error) {
1872
- throw new InvalidDomainError(
1873
- `Invalid domain representation: ${descr}`,
1874
- {
1875
- cause: error
1876
- }
1877
- );
1878
- }
1879
- this.ast = normalizeDomainAST(rawAST);
1880
- }
1881
- }
1837
+ ast = { type: -1, value: null };
1838
+ static TRUE;
1839
+ static FALSE;
1882
1840
  static combine(domains, operator) {
1883
1841
  if (domains.length === 0) {
1884
1842
  return new _Domain([]);
@@ -1957,6 +1915,24 @@ var Domain = class _Domain {
1957
1915
  processLeaf(d.ast.value, 0, "&", newDomain);
1958
1916
  return newDomain;
1959
1917
  }
1918
+ constructor(descr = []) {
1919
+ if (descr instanceof _Domain) {
1920
+ return new _Domain(descr.toString());
1921
+ } else {
1922
+ let rawAST;
1923
+ try {
1924
+ rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
1925
+ } catch (error) {
1926
+ throw new InvalidDomainError(
1927
+ `Invalid domain representation: ${descr}`,
1928
+ {
1929
+ cause: error
1930
+ }
1931
+ );
1932
+ }
1933
+ this.ast = normalizeDomainAST(rawAST);
1934
+ }
1935
+ }
1960
1936
  contains(record) {
1961
1937
  const expr = evaluate(this.ast, record);
1962
1938
  return matchDomain(record, expr);
@@ -1975,7 +1951,7 @@ var Domain = class _Domain {
1975
1951
  return evaluatedAsList;
1976
1952
  }
1977
1953
  return this.toString();
1978
- } catch (e) {
1954
+ } catch {
1979
1955
  return this.toString();
1980
1956
  }
1981
1957
  }
@@ -2218,22 +2194,22 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
2218
2194
 
2219
2195
  // src/utils/storage/local-storage.ts
2220
2196
  var localStorageUtils = () => {
2221
- const setToken = (access_token) => __async(null, null, function* () {
2197
+ const setToken = async (access_token) => {
2222
2198
  localStorage.setItem("accessToken", access_token);
2223
- });
2224
- const setRefreshToken = (refresh_token) => __async(null, null, function* () {
2199
+ };
2200
+ const setRefreshToken = async (refresh_token) => {
2225
2201
  localStorage.setItem("refreshToken", refresh_token);
2226
- });
2227
- const getAccessToken = () => __async(null, null, function* () {
2202
+ };
2203
+ const getAccessToken = async () => {
2228
2204
  return localStorage.getItem("accessToken");
2229
- });
2230
- const getRefreshToken = () => __async(null, null, function* () {
2205
+ };
2206
+ const getRefreshToken = async () => {
2231
2207
  return localStorage.getItem("refreshToken");
2232
- });
2233
- const clearToken = () => __async(null, null, function* () {
2208
+ };
2209
+ const clearToken = async () => {
2234
2210
  localStorage.removeItem("accessToken");
2235
2211
  localStorage.removeItem("refreshToken");
2236
- });
2212
+ };
2237
2213
  return {
2238
2214
  setToken,
2239
2215
  setRefreshToken,
@@ -2245,9 +2221,9 @@ var localStorageUtils = () => {
2245
2221
 
2246
2222
  // src/utils/storage/session-storage.ts
2247
2223
  var sessionStorageUtils = () => {
2248
- const getBrowserSession = () => __async(null, null, function* () {
2224
+ const getBrowserSession = async () => {
2249
2225
  return sessionStorage.getItem("browserSession");
2250
- });
2226
+ };
2251
2227
  return {
2252
2228
  getBrowserSession
2253
2229
  };
@@ -2256,14 +2232,13 @@ var sessionStorageUtils = () => {
2256
2232
  // src/configs/axios-client.ts
2257
2233
  var axiosClient = {
2258
2234
  init(config) {
2259
- var _a, _b;
2260
- const localStorage2 = (_a = config.localStorageUtils) != null ? _a : localStorageUtils();
2261
- const sessionStorage2 = (_b = config.sessionStorageUtils) != null ? _b : sessionStorageUtils();
2235
+ const localStorage2 = config.localStorageUtils ?? localStorageUtils();
2236
+ const sessionStorage2 = config.sessionStorageUtils ?? sessionStorageUtils();
2262
2237
  const db = config.db;
2263
2238
  let isRefreshing = false;
2264
2239
  let failedQueue = [];
2265
2240
  const processQueue = (error, token = null) => {
2266
- failedQueue == null ? void 0 : failedQueue.forEach((prom) => {
2241
+ failedQueue?.forEach((prom) => {
2267
2242
  if (error) {
2268
2243
  prom.reject(error);
2269
2244
  } else {
@@ -2278,38 +2253,33 @@ var axiosClient = {
2278
2253
  timeout: 5e4,
2279
2254
  paramsSerializer: (params) => new URLSearchParams(params).toString()
2280
2255
  });
2281
- instance.interceptors.request.use(
2282
- (config2) => __async(null, null, function* () {
2283
- const useRefreshToken = config2.useRefreshToken;
2284
- const token = useRefreshToken ? yield localStorage2.getRefreshToken() : yield localStorage2.getAccessToken();
2285
- if (token) {
2286
- config2.headers["Authorization"] = "Bearer " + token;
2287
- }
2288
- return config2;
2289
- }),
2290
- (error) => {
2291
- Promise.reject(error);
2256
+ instance.interceptors.request.use(async (config2) => {
2257
+ const { useRefreshToken, useActionToken, actionToken } = config2;
2258
+ if (useActionToken && actionToken) {
2259
+ config2.headers["Action-Token"] = actionToken;
2292
2260
  }
2293
- );
2261
+ const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
2262
+ const token = await getToken?.();
2263
+ if (token) config2.headers["Authorization"] = `Bearer ${token}`;
2264
+ return config2;
2265
+ }, Promise.reject);
2294
2266
  instance.interceptors.response.use(
2295
2267
  (response) => {
2296
2268
  return handleResponse(response);
2297
2269
  },
2298
- (error) => __async(null, null, function* () {
2299
- var _a2, _b2, _c;
2300
- const handleError3 = (error2) => __async(null, null, function* () {
2301
- var _a3;
2270
+ async (error) => {
2271
+ const handleError3 = async (error2) => {
2302
2272
  if (!error2.response) {
2303
2273
  return error2;
2304
2274
  }
2305
2275
  const { data } = error2.response;
2306
- if (data && data.code === 400 && ["invalid_grant"].includes((_a3 = data.data) == null ? void 0 : _a3.error)) {
2307
- yield clearAuthToken();
2276
+ if (data && data.code === 400 && ["invalid_grant"].includes(data.data?.error)) {
2277
+ await clearAuthToken();
2308
2278
  }
2309
2279
  return data;
2310
- });
2280
+ };
2311
2281
  const originalRequest = error.config;
2312
- 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(
2282
+ if ((error.response?.status === 403 || error.response?.status === 401 || error.response?.status === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
2313
2283
  error.response.data.code
2314
2284
  )) {
2315
2285
  if (isRefreshing) {
@@ -2322,19 +2292,18 @@ var axiosClient = {
2322
2292
  token
2323
2293
  );
2324
2294
  return instance.request(originalRequest);
2325
- }).catch((err) => __async(null, null, function* () {
2326
- var _a3, _b3;
2327
- 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)) {
2328
- yield clearAuthToken();
2295
+ }).catch(async (err) => {
2296
+ if ((err.response?.status === 400 || err.response?.status === 401) && ["invalid_grant"].includes(err.response.data.error)) {
2297
+ await clearAuthToken();
2329
2298
  }
2330
- }));
2299
+ });
2331
2300
  }
2332
- const browserSession = yield sessionStorage2.getBrowserSession();
2333
- const refreshToken = yield localStorage2.getRefreshToken();
2334
- const accessTokenExp = yield localStorage2.getAccessToken();
2301
+ const browserSession = await sessionStorage2.getBrowserSession();
2302
+ const refreshToken = await localStorage2.getRefreshToken();
2303
+ const accessTokenExp = await localStorage2.getAccessToken();
2335
2304
  isRefreshing = true;
2336
2305
  if (!refreshToken && (!browserSession || browserSession == "unActive")) {
2337
- yield clearAuthToken();
2306
+ await clearAuthToken();
2338
2307
  } else {
2339
2308
  const payload = Object.fromEntries(
2340
2309
  Object.entries({
@@ -2345,9 +2314,8 @@ var axiosClient = {
2345
2314
  }).filter(([_, value]) => !!value)
2346
2315
  );
2347
2316
  return new Promise(function(resolve) {
2348
- var _a3;
2349
2317
  axios.post(
2350
- `${config.baseUrl}${(_a3 = config.refreshTokenEndpoint) != null ? _a3 : "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2318
+ `${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2351
2319
  payload,
2352
2320
  {
2353
2321
  headers: {
@@ -2355,10 +2323,10 @@ var axiosClient = {
2355
2323
  Authorization: `Bearer ${accessTokenExp}`
2356
2324
  }
2357
2325
  }
2358
- ).then((res) => __async(null, null, function* () {
2326
+ ).then(async (res) => {
2359
2327
  const data = res.data;
2360
- yield localStorage2.setToken(data.access_token);
2361
- yield localStorage2.setRefreshToken(data.refresh_token);
2328
+ await localStorage2.setToken(data.access_token);
2329
+ await localStorage2.setRefreshToken(data.refresh_token);
2362
2330
  axios.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
2363
2331
  originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
2364
2332
  originalRequest.data = updateTokenParamInOriginalRequest(
@@ -2367,26 +2335,25 @@ var axiosClient = {
2367
2335
  );
2368
2336
  processQueue(null, data.access_token);
2369
2337
  resolve(instance.request(originalRequest));
2370
- })).catch((err) => __async(null, null, function* () {
2371
- var _a4;
2372
- 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") {
2373
- yield clearAuthToken();
2338
+ }).catch(async (err) => {
2339
+ 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") {
2340
+ await clearAuthToken();
2374
2341
  }
2375
2342
  if (err && err.response) {
2376
- const { error_code } = ((_a4 = err.response) == null ? void 0 : _a4.data) || {};
2343
+ const { error_code } = err.response?.data || {};
2377
2344
  if (error_code === "AUTHEN_FAIL") {
2378
- yield clearAuthToken();
2345
+ await clearAuthToken();
2379
2346
  }
2380
2347
  }
2381
2348
  processQueue(err, null);
2382
- })).finally(() => {
2349
+ }).finally(() => {
2383
2350
  isRefreshing = false;
2384
2351
  });
2385
2352
  });
2386
2353
  }
2387
2354
  }
2388
- return Promise.reject(yield handleError3(error));
2389
- })
2355
+ return Promise.reject(await handleError3(error));
2356
+ }
2390
2357
  );
2391
2358
  const handleResponse = (res) => {
2392
2359
  if (res && res.data) {
@@ -2395,7 +2362,6 @@ var axiosClient = {
2395
2362
  return res;
2396
2363
  };
2397
2364
  const handleError2 = (error) => {
2398
- var _a2, _b2, _c;
2399
2365
  if (error.isAxiosError && error.code === "ECONNABORTED") {
2400
2366
  console.error("Request Timeout Error:", error);
2401
2367
  return "Request Timeout Error";
@@ -2403,17 +2369,17 @@ var axiosClient = {
2403
2369
  console.error("Network Error:", error);
2404
2370
  return "Network Error";
2405
2371
  } else {
2406
- console.error("Other Error:", error == null ? void 0 : error.response);
2407
- const errorMessage = ((_b2 = (_a2 = error == null ? void 0 : error.response) == null ? void 0 : _a2.data) == null ? void 0 : _b2.message) || "An error occurred";
2408
- return { message: errorMessage, status: (_c = error == null ? void 0 : error.response) == null ? void 0 : _c.status };
2372
+ console.error("Other Error:", error?.response);
2373
+ const errorMessage = error?.response?.data?.message || "An error occurred";
2374
+ return { message: errorMessage, status: error?.response?.status };
2409
2375
  }
2410
2376
  };
2411
- const clearAuthToken = () => __async(null, null, function* () {
2412
- yield localStorage2.clearToken();
2377
+ const clearAuthToken = async () => {
2378
+ await localStorage2.clearToken();
2413
2379
  if (typeof window !== "undefined") {
2414
2380
  window.location.href = `/login`;
2415
2381
  }
2416
- });
2382
+ };
2417
2383
  function formatUrl(url, db2) {
2418
2384
  return url + (db2 ? "?db=" + db2 : "");
2419
2385
  }
@@ -2463,6 +2429,8 @@ var initialState2 = {
2463
2429
  requests: null,
2464
2430
  companies: [],
2465
2431
  user: {},
2432
+ db: "",
2433
+ refreshTokenEndpoint: "",
2466
2434
  config: null,
2467
2435
  envFile: null,
2468
2436
  defaultCompany: {
@@ -2626,7 +2594,7 @@ var headerSlice = createSlice5({
2626
2594
  },
2627
2595
  reducers: {
2628
2596
  setHeader: (state, action) => {
2629
- state.value = __spreadValues(__spreadValues({}, state.value), action.payload);
2597
+ state.value = { ...state.value, ...action.payload };
2630
2598
  },
2631
2599
  setAllowedCompanyIds: (state, action) => {
2632
2600
  state.value.allowedCompanyIds = action.payload;
@@ -3052,130 +3020,114 @@ var envStore = configureStore({
3052
3020
 
3053
3021
  // src/environment/EnvStore.ts
3054
3022
  var EnvStore = class {
3055
- constructor(envStore2, localStorageUtils2, sessionStorageUtils2) {
3056
- this.envStore = envStore2;
3023
+ baseUrl;
3024
+ requests;
3025
+ context;
3026
+ defaultCompany;
3027
+ config;
3028
+ companies;
3029
+ user;
3030
+ db;
3031
+ localStorageUtils;
3032
+ sessionStorageUtils;
3033
+ refreshTokenEndpoint;
3034
+ constructor(localStorageUtils2, sessionStorageUtils2) {
3057
3035
  this.localStorageUtils = localStorageUtils2;
3058
3036
  this.sessionStorageUtils = sessionStorageUtils2;
3059
3037
  this.setup();
3060
3038
  }
3061
3039
  setup() {
3062
- const env2 = this.envStore.getState().env;
3063
- this.baseUrl = env2 == null ? void 0 : env2.baseUrl;
3064
- this.requests = env2 == null ? void 0 : env2.requests;
3065
- this.context = env2 == null ? void 0 : env2.context;
3066
- this.defaultCompany = env2 == null ? void 0 : env2.defaultCompany;
3067
- this.config = env2 == null ? void 0 : env2.config;
3068
- this.companies = (env2 == null ? void 0 : env2.companies) || [];
3069
- this.user = env2 == null ? void 0 : env2.user;
3070
- this.db = env2 == null ? void 0 : env2.db;
3071
- this.refreshTokenEndpoint = env2 == null ? void 0 : env2.refreshTokenEndpoint;
3040
+ const env2 = envStore.getState().env;
3041
+ this.baseUrl = env2?.baseUrl;
3042
+ this.requests = env2?.requests;
3043
+ this.context = env2?.context;
3044
+ this.defaultCompany = env2?.defaultCompany;
3045
+ this.config = env2?.config;
3046
+ this.companies = env2?.companies || [];
3047
+ this.user = env2?.user;
3048
+ this.db = env2?.db;
3049
+ this.refreshTokenEndpoint = env2?.refreshTokenEndpoint;
3072
3050
  }
3073
3051
  setupEnv(envConfig) {
3074
- const dispatch = this.envStore.dispatch;
3075
- const env2 = __spreadProps(__spreadValues({}, envConfig), {
3052
+ const dispatch = envStore.dispatch;
3053
+ const env2 = {
3054
+ ...envConfig,
3076
3055
  localStorageUtils: this.localStorageUtils,
3077
3056
  sessionStorageUtils: this.sessionStorageUtils
3078
- });
3057
+ };
3079
3058
  const requests = axiosClient.init(env2);
3080
- dispatch(setEnv(__spreadProps(__spreadValues({}, env2), { requests })));
3059
+ dispatch(setEnv({ ...env2, requests }));
3081
3060
  this.setup();
3082
3061
  }
3083
3062
  setUid(uid) {
3084
- const dispatch = this.envStore.dispatch;
3063
+ const dispatch = envStore.dispatch;
3085
3064
  dispatch(setUid(uid));
3086
3065
  this.setup();
3087
3066
  }
3088
3067
  setLang(lang) {
3089
- const dispatch = this.envStore.dispatch;
3068
+ const dispatch = envStore.dispatch;
3090
3069
  dispatch(setLang(lang));
3091
3070
  this.setup();
3092
3071
  }
3093
3072
  setAllowCompanies(allowCompanies) {
3094
- const dispatch = this.envStore.dispatch;
3073
+ const dispatch = envStore.dispatch;
3095
3074
  dispatch(setAllowCompanies(allowCompanies));
3096
3075
  this.setup();
3097
3076
  }
3098
3077
  setCompanies(companies) {
3099
- const dispatch = this.envStore.dispatch;
3078
+ const dispatch = envStore.dispatch;
3100
3079
  dispatch(setCompanies(companies));
3101
3080
  this.setup();
3102
3081
  }
3103
3082
  setDefaultCompany(company) {
3104
- const dispatch = this.envStore.dispatch;
3083
+ const dispatch = envStore.dispatch;
3105
3084
  dispatch(setDefaultCompany(company));
3106
3085
  this.setup();
3107
3086
  }
3108
3087
  setUserInfo(userInfo) {
3109
- const dispatch = this.envStore.dispatch;
3088
+ const dispatch = envStore.dispatch;
3110
3089
  dispatch(setUser(userInfo));
3111
3090
  this.setup();
3112
3091
  }
3113
3092
  };
3114
3093
  var env = null;
3115
3094
  function getEnv() {
3116
- if (!env)
3117
- env = new EnvStore(envStore, localStorageUtils(), sessionStorageUtils());
3095
+ if (!env) env = new EnvStore(localStorageUtils(), sessionStorageUtils());
3118
3096
  return env;
3119
3097
  }
3120
3098
 
3121
3099
  // src/services/action-service/index.ts
3122
3100
  var ActionService = {
3123
3101
  // Load Action
3124
- loadAction(_0) {
3125
- return __async(this, arguments, function* ({
3126
- idAction,
3127
- context
3128
- }) {
3129
- const env2 = getEnv();
3130
- const jsonData = {
3131
- action_id: idAction,
3132
- with_context: __spreadValues({}, context)
3133
- };
3134
- return env2.requests.post(`${"/load_action" /* LOAD_ACTION */}`, jsonData, {
3135
- headers: {
3136
- "Content-Type": "application/json"
3137
- }
3138
- });
3139
- });
3140
- },
3141
- // Call Button
3142
- callButton(_0) {
3143
- return __async(this, arguments, function* ({
3144
- model,
3145
- ids = [],
3146
- context,
3147
- method
3148
- }) {
3149
- try {
3150
- const env2 = getEnv();
3151
- const jsonData = {
3152
- model,
3153
- method,
3154
- ids,
3155
- with_context: context
3156
- };
3157
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3158
- headers: {
3159
- "Content-Type": "application/json"
3160
- }
3161
- });
3162
- } catch (error) {
3163
- console.error("Error when calling button action:", error);
3164
- throw error;
3102
+ async loadAction({
3103
+ idAction,
3104
+ context
3105
+ }) {
3106
+ const env2 = getEnv();
3107
+ const jsonData = {
3108
+ action_id: idAction,
3109
+ with_context: {
3110
+ ...context
3111
+ }
3112
+ };
3113
+ return env2.requests.post(`${"/load_action" /* LOAD_ACTION */}`, jsonData, {
3114
+ headers: {
3115
+ "Content-Type": "application/json"
3165
3116
  }
3166
3117
  });
3167
3118
  },
3168
- // remove Row
3169
- removeRows(_0) {
3170
- return __async(this, arguments, function* ({
3171
- model,
3172
- ids,
3173
- context
3174
- }) {
3119
+ // Call Button
3120
+ async callButton({
3121
+ model,
3122
+ ids = [],
3123
+ context,
3124
+ method
3125
+ }) {
3126
+ try {
3175
3127
  const env2 = getEnv();
3176
3128
  const jsonData = {
3177
3129
  model,
3178
- method: "unlink",
3130
+ method,
3179
3131
  ids,
3180
3132
  with_context: context
3181
3133
  };
@@ -3184,96 +3136,112 @@ var ActionService = {
3184
3136
  "Content-Type": "application/json"
3185
3137
  }
3186
3138
  });
3139
+ } catch (error) {
3140
+ console.error("Error when calling button action:", error);
3141
+ throw error;
3142
+ }
3143
+ },
3144
+ // remove Row
3145
+ async removeRows({
3146
+ model,
3147
+ ids,
3148
+ context
3149
+ }) {
3150
+ const env2 = getEnv();
3151
+ const jsonData = {
3152
+ model,
3153
+ method: "unlink",
3154
+ ids,
3155
+ with_context: context
3156
+ };
3157
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3158
+ headers: {
3159
+ "Content-Type": "application/json"
3160
+ }
3187
3161
  });
3188
3162
  },
3189
3163
  // Duplicate Model
3190
- duplicateRecord(_0) {
3191
- return __async(this, arguments, function* ({
3164
+ async duplicateRecord({
3165
+ model,
3166
+ id,
3167
+ context
3168
+ }) {
3169
+ const env2 = getEnv();
3170
+ const jsonData = {
3192
3171
  model,
3193
- id,
3194
- context
3195
- }) {
3196
- const env2 = getEnv();
3197
- const jsonData = {
3198
- model,
3199
- method: "copy",
3200
- ids: id,
3201
- with_context: context
3202
- };
3203
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3204
- headers: {
3205
- "Content-Type": "application/json"
3206
- }
3207
- });
3172
+ method: "copy",
3173
+ ids: id,
3174
+ with_context: context
3175
+ };
3176
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3177
+ headers: {
3178
+ "Content-Type": "application/json"
3179
+ }
3208
3180
  });
3209
3181
  },
3210
3182
  // Get Print Report
3211
- getPrintReportName(_0) {
3212
- return __async(this, arguments, function* ({ id }) {
3213
- const env2 = getEnv();
3214
- const jsonData = {
3215
- model: "ir.actions.report",
3216
- method: "web_read",
3217
- id,
3218
- kwargs: {
3219
- specification: {
3220
- report_name: {}
3221
- }
3222
- }
3223
- };
3224
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3225
- headers: {
3226
- "Content-Type": "application/json"
3183
+ async getPrintReportName({ id }) {
3184
+ const env2 = getEnv();
3185
+ const jsonData = {
3186
+ model: "ir.actions.report",
3187
+ method: "web_read",
3188
+ id,
3189
+ kwargs: {
3190
+ specification: {
3191
+ report_name: {}
3227
3192
  }
3228
- });
3193
+ }
3194
+ };
3195
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3196
+ headers: {
3197
+ "Content-Type": "application/json"
3198
+ }
3229
3199
  });
3230
3200
  },
3231
3201
  //Save Print Invoice
3232
- print(_0) {
3233
- return __async(this, arguments, function* ({ id, report, db }) {
3234
- const env2 = getEnv();
3235
- const jsonData = {
3236
- report,
3237
- id,
3238
- type: "pdf",
3239
- file_response: true,
3240
- db
3241
- };
3242
- const queryString = toQueryString(jsonData);
3243
- const urlWithParams = `${"/report" /* REPORT_PATH */}?${queryString}`;
3244
- return env2.requests.get(urlWithParams, {
3245
- headers: {
3246
- "Content-Type": "application/json"
3247
- },
3248
- responseType: "arraybuffer"
3249
- });
3202
+ async print({ id, report, db }) {
3203
+ const env2 = getEnv();
3204
+ const jsonData = {
3205
+ report,
3206
+ id,
3207
+ type: "pdf",
3208
+ file_response: true,
3209
+ db
3210
+ };
3211
+ const queryString = toQueryString(jsonData);
3212
+ const urlWithParams = `${"/report" /* REPORT_PATH */}?${queryString}`;
3213
+ return env2.requests.get(urlWithParams, {
3214
+ headers: {
3215
+ "Content-Type": "application/json"
3216
+ },
3217
+ responseType: "arraybuffer"
3250
3218
  });
3251
3219
  },
3252
3220
  //Run Action
3253
- runAction(_0) {
3254
- return __async(this, arguments, function* ({
3255
- idAction,
3256
- context
3257
- }) {
3258
- const env2 = getEnv();
3259
- const jsonData = {
3260
- action_id: idAction,
3261
- with_context: __spreadValues({}, context)
3262
- // context: {
3263
- // lang: 'en_US',
3264
- // tz: 'Asia/Saigon',
3265
- // uid: 2,
3266
- // allowed_company_ids: [1],
3267
- // active_id: Array.isArray(idDetail) ? idDetail[0] : idDetail,
3268
- // active_ids: Array.isArray(idDetail) ? [...idDetail] : idDetail,
3269
- // active_model: model,
3270
- // },
3271
- };
3272
- return env2.requests.post(`${"/run_action" /* RUN_ACTION_PATH */}`, jsonData, {
3273
- headers: {
3274
- "Content-Type": "application/json"
3275
- }
3276
- });
3221
+ async runAction({
3222
+ idAction,
3223
+ context
3224
+ }) {
3225
+ const env2 = getEnv();
3226
+ const jsonData = {
3227
+ action_id: idAction,
3228
+ with_context: {
3229
+ ...context
3230
+ }
3231
+ // context: {
3232
+ // lang: 'en_US',
3233
+ // tz: 'Asia/Saigon',
3234
+ // uid: 2,
3235
+ // allowed_company_ids: [1],
3236
+ // active_id: Array.isArray(idDetail) ? idDetail[0] : idDetail,
3237
+ // active_ids: Array.isArray(idDetail) ? [...idDetail] : idDetail,
3238
+ // active_model: model,
3239
+ // },
3240
+ };
3241
+ return env2.requests.post(`${"/run_action" /* RUN_ACTION_PATH */}`, jsonData, {
3242
+ headers: {
3243
+ "Content-Type": "application/json"
3244
+ }
3277
3245
  });
3278
3246
  }
3279
3247
  };
@@ -3281,623 +3249,567 @@ var action_service_default = ActionService;
3281
3249
 
3282
3250
  // src/services/auth-service/index.ts
3283
3251
  var AuthService = {
3284
- login(body) {
3285
- return __async(this, null, function* () {
3286
- var _a, _b, _c, _d;
3287
- const env2 = getEnv();
3288
- const payload = Object.fromEntries(
3289
- Object.entries({
3290
- username: body.email,
3291
- password: body.password,
3292
- grant_type: ((_a = env2 == null ? void 0 : env2.config) == null ? void 0 : _a.grantType) || "",
3293
- client_id: ((_b = env2 == null ? void 0 : env2.config) == null ? void 0 : _b.clientId) || "",
3294
- client_secret: ((_c = env2 == null ? void 0 : env2.config) == null ? void 0 : _c.clientSecret) || ""
3295
- }).filter(([_, value]) => !!value)
3296
- );
3297
- const encodedData = new URLSearchParams(payload).toString();
3298
- return (_d = env2 == null ? void 0 : env2.requests) == null ? void 0 : _d.post(body.path, encodedData, {
3299
- headers: {
3300
- "Content-Type": "application/x-www-form-urlencoded"
3301
- }
3302
- });
3252
+ async login(body) {
3253
+ const env2 = getEnv();
3254
+ const payload = Object.fromEntries(
3255
+ Object.entries({
3256
+ username: body.email,
3257
+ password: body.password,
3258
+ grant_type: env2?.config?.grantType || "",
3259
+ client_id: env2?.config?.clientId || "",
3260
+ client_secret: env2?.config?.clientSecret || ""
3261
+ }).filter(([_, value]) => !!value)
3262
+ );
3263
+ const encodedData = new URLSearchParams(payload).toString();
3264
+ return env2?.requests?.post(body.path, encodedData, {
3265
+ headers: {
3266
+ "Content-Type": "application/x-www-form-urlencoded"
3267
+ }
3303
3268
  });
3304
3269
  },
3305
- forgotPassword(email) {
3306
- return __async(this, null, function* () {
3307
- var _a;
3308
- const env2 = getEnv();
3309
- const bodyData = {
3310
- login: email,
3311
- url: `${window.location.origin}/reset-password`
3312
- };
3313
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/reset_password" /* RESET_PASSWORD_PATH */, bodyData, {
3314
- headers: {
3315
- "Content-Type": "application/json"
3316
- }
3317
- });
3270
+ async forgotPassword(email) {
3271
+ const env2 = getEnv();
3272
+ const bodyData = {
3273
+ login: email,
3274
+ url: `${window.location.origin}/reset-password`
3275
+ };
3276
+ return env2?.requests?.post("/reset_password" /* RESET_PASSWORD_PATH */, bodyData, {
3277
+ headers: {
3278
+ "Content-Type": "application/json"
3279
+ }
3318
3280
  });
3319
3281
  },
3320
- forgotPasswordSSO(_0) {
3321
- return __async(this, arguments, function* ({
3322
- email,
3323
- with_context,
3324
- method
3325
- }) {
3326
- var _a;
3327
- const env2 = getEnv();
3328
- const body = {
3329
- method,
3330
- kwargs: {
3331
- vals: {
3332
- email
3333
- }
3334
- },
3335
- with_context
3336
- };
3337
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, body, {
3338
- headers: {
3339
- "Content-Type": "application/json"
3282
+ async forgotPasswordSSO({
3283
+ email,
3284
+ with_context,
3285
+ method
3286
+ }) {
3287
+ const env2 = getEnv();
3288
+ const body = {
3289
+ method,
3290
+ kwargs: {
3291
+ vals: {
3292
+ email
3340
3293
  }
3341
- });
3294
+ },
3295
+ with_context
3296
+ };
3297
+ return env2?.requests?.post("/call" /* CALL_PATH */, body, {
3298
+ headers: {
3299
+ "Content-Type": "application/json"
3300
+ }
3342
3301
  });
3343
3302
  },
3344
- resetPassword(data, token) {
3345
- return __async(this, null, function* () {
3346
- var _a;
3347
- const env2 = getEnv();
3348
- const bodyData = {
3349
- token,
3350
- password: data.password,
3351
- new_password: data.confirmPassword
3352
- };
3353
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/change_password" /* CHANGE_PASSWORD_PATH */, bodyData, {
3354
- headers: {
3355
- "Content-Type": "application/json"
3356
- }
3357
- });
3303
+ async resetPassword(data, token) {
3304
+ const env2 = getEnv();
3305
+ const bodyData = {
3306
+ token,
3307
+ password: data.password,
3308
+ new_password: data.confirmPassword
3309
+ };
3310
+ return env2?.requests?.post("/change_password" /* CHANGE_PASSWORD_PATH */, bodyData, {
3311
+ headers: {
3312
+ "Content-Type": "application/json"
3313
+ }
3358
3314
  });
3359
3315
  },
3360
- resetPasswordSSO(_0) {
3361
- return __async(this, arguments, function* ({
3316
+ async resetPasswordSSO({
3317
+ method,
3318
+ password,
3319
+ with_context
3320
+ }) {
3321
+ const env2 = getEnv();
3322
+ const bodyData = {
3362
3323
  method,
3363
- password,
3324
+ kwargs: {
3325
+ vals: {
3326
+ password
3327
+ }
3328
+ },
3364
3329
  with_context
3365
- }) {
3366
- var _a;
3367
- const env2 = getEnv();
3368
- const bodyData = {
3369
- method,
3370
- kwargs: {
3371
- vals: {
3372
- password
3373
- }
3330
+ };
3331
+ return env2?.requests?.post("/call" /* CALL_PATH */, bodyData, {
3332
+ headers: {
3333
+ "Content-Type": "application/json"
3334
+ }
3335
+ });
3336
+ },
3337
+ async updatePassword(data, token) {
3338
+ const env2 = getEnv();
3339
+ const bodyData = {
3340
+ token,
3341
+ old_password: data.oldPassword,
3342
+ new_password: data.newPassword
3343
+ };
3344
+ return env2?.requests?.post("/change_password_parent" /* UPDATE_PASSWORD_PATH */, bodyData, {
3345
+ headers: {
3346
+ "Content-Type": "application/json"
3347
+ }
3348
+ });
3349
+ },
3350
+ async isValidToken(token) {
3351
+ const env2 = getEnv();
3352
+ const bodyData = {
3353
+ token
3354
+ };
3355
+ return env2?.requests?.post("/check_token" /* TOKEN */, bodyData, {
3356
+ headers: {
3357
+ "Content-Type": "application/json"
3358
+ }
3359
+ });
3360
+ },
3361
+ async isValidActionToken(actionToken, path) {
3362
+ const env2 = getEnv();
3363
+ return env2?.requests?.post(
3364
+ path,
3365
+ {},
3366
+ {
3367
+ headers: {
3368
+ "Content-Type": "application/json"
3374
3369
  },
3375
- with_context
3376
- };
3377
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, bodyData, {
3370
+ useActionToken: true,
3371
+ actionToken
3372
+ }
3373
+ );
3374
+ },
3375
+ async loginSocial({
3376
+ db,
3377
+ state,
3378
+ access_token
3379
+ }) {
3380
+ const env2 = getEnv();
3381
+ return env2?.requests?.post(
3382
+ "/token/generate" /* GENTOKEN_SOCIAL */,
3383
+ { state, access_token },
3384
+ {
3378
3385
  headers: {
3379
3386
  "Content-Type": "application/json"
3380
3387
  }
3381
- });
3382
- });
3388
+ }
3389
+ );
3383
3390
  },
3384
- updatePassword(data, token) {
3385
- return __async(this, null, function* () {
3386
- var _a;
3387
- const env2 = getEnv();
3388
- const bodyData = {
3389
- token,
3390
- old_password: data.oldPassword,
3391
- new_password: data.newPassword
3392
- };
3393
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/change_password_parent" /* UPDATE_PASSWORD_PATH */, bodyData, {
3391
+ async getProviders(db) {
3392
+ const env2 = getEnv();
3393
+ return env2?.requests?.get("/oauth/providers", { params: { db } });
3394
+ },
3395
+ async getAccessByCode(code) {
3396
+ const env2 = getEnv();
3397
+ const data = new URLSearchParams();
3398
+ data.append("code", code);
3399
+ data.append("grant_type", "authorization_code");
3400
+ data.append("client_id", env2?.config?.clientId || "");
3401
+ data.append("redirect_uri", env2?.config?.redirectUri || "");
3402
+ return env2?.requests?.post(
3403
+ `${env2?.baseUrl?.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
3404
+ data,
3405
+ {
3394
3406
  headers: {
3395
- "Content-Type": "application/json"
3407
+ "Content-Type": "application/x-www-form-urlencoded"
3396
3408
  }
3397
- });
3398
- });
3409
+ }
3410
+ );
3399
3411
  },
3400
- isValidToken(token) {
3401
- return __async(this, null, function* () {
3402
- var _a;
3403
- const env2 = getEnv();
3404
- const bodyData = {
3405
- token
3406
- };
3407
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/check_token" /* TOKEN */, bodyData, {
3412
+ async logout(data) {
3413
+ const env2 = getEnv();
3414
+ console.log(data);
3415
+ return env2?.requests?.post(
3416
+ "/logout" /* LOGOUT */,
3417
+ {},
3418
+ {
3408
3419
  headers: {
3409
3420
  "Content-Type": "application/json"
3410
- }
3411
- });
3421
+ },
3422
+ withCredentials: true,
3423
+ useRefreshToken: true
3424
+ }
3425
+ );
3426
+ }
3427
+ };
3428
+ var auth_service_default = AuthService;
3429
+
3430
+ // src/services/company-service/index.ts
3431
+ var CompanyService = {
3432
+ async getCurrentCompany() {
3433
+ const env2 = getEnv();
3434
+ return await env2.requests.get("/company" /* COMPANY_PATH */, {
3435
+ headers: {
3436
+ "Content-Type": "application/json"
3437
+ }
3412
3438
  });
3413
3439
  },
3414
- loginSocial(_0) {
3415
- return __async(this, arguments, function* ({
3416
- db,
3417
- state,
3418
- access_token
3419
- }) {
3420
- var _a;
3421
- const env2 = getEnv();
3422
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post(
3423
- "/token/generate" /* GENTOKEN_SOCIAL */,
3424
- { state, access_token },
3425
- {
3426
- headers: {
3427
- "Content-Type": "application/json"
3428
- }
3440
+ async getInfoCompany(id) {
3441
+ const env2 = getEnv();
3442
+ const jsonData = {
3443
+ ids: [id],
3444
+ model: "res.company" /* COMPANY */,
3445
+ method: "web_read" /* WEB_READ */,
3446
+ kwargs: {
3447
+ specification: {
3448
+ primary_color: {},
3449
+ secondary_color: {},
3450
+ logo: {},
3451
+ display_name: {},
3452
+ secondary_logo: {}
3429
3453
  }
3430
- );
3454
+ }
3455
+ };
3456
+ return await env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3457
+ headers: {
3458
+ "Content-Type": "application/json"
3459
+ }
3460
+ });
3461
+ }
3462
+ };
3463
+ var company_service_default = CompanyService;
3464
+
3465
+ // src/services/excel-service/index.ts
3466
+ var ExcelService = {
3467
+ async uploadFile({ formData }) {
3468
+ const env2 = getEnv();
3469
+ return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
3470
+ headers: {
3471
+ "Content-Type": "multipart/form-data"
3472
+ }
3431
3473
  });
3432
3474
  },
3433
- getProviders(db) {
3434
- return __async(this, null, function* () {
3435
- var _a;
3436
- const env2 = getEnv();
3437
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.get("/oauth/providers", { params: { db } });
3475
+ async uploadIdFile({ formData }) {
3476
+ const env2 = getEnv();
3477
+ return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
3478
+ headers: {
3479
+ "Content-Type": "multipart/form-data"
3480
+ }
3438
3481
  });
3439
3482
  },
3440
- getAccessByCode(code) {
3441
- return __async(this, null, function* () {
3442
- var _a, _b, _c, _d;
3443
- const env2 = getEnv();
3444
- const data = new URLSearchParams();
3445
- data.append("code", code);
3446
- data.append("grant_type", "authorization_code");
3447
- data.append("client_id", ((_a = env2 == null ? void 0 : env2.config) == null ? void 0 : _a.clientId) || "");
3448
- data.append("redirect_uri", ((_b = env2 == null ? void 0 : env2.config) == null ? void 0 : _b.redirectUri) || "");
3449
- return (_d = env2 == null ? void 0 : env2.requests) == null ? void 0 : _d.post(
3450
- `${(_c = env2 == null ? void 0 : env2.baseUrl) == null ? void 0 : _c.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
3451
- data,
3452
- {
3453
- headers: {
3454
- "Content-Type": "application/x-www-form-urlencoded"
3455
- }
3483
+ async parsePreview({
3484
+ id,
3485
+ selectedSheet,
3486
+ isHeader,
3487
+ context
3488
+ }) {
3489
+ const env2 = getEnv();
3490
+ const jsonData = {
3491
+ model: "base_import.import" /* BASE_IMPORT */,
3492
+ method: "parse_preview",
3493
+ ids: [id],
3494
+ kwargs: {
3495
+ options: {
3496
+ import_skip_records: [],
3497
+ import_set_empty_fields: [],
3498
+ fallback_values: {},
3499
+ name_create_enabled_fields: {},
3500
+ encoding: "",
3501
+ separator: "",
3502
+ quoting: '"',
3503
+ date_format: "",
3504
+ datetime_format: "",
3505
+ float_thousand_separator: ",",
3506
+ float_decimal_separator: ".",
3507
+ advanced: true,
3508
+ has_headers: isHeader,
3509
+ keep_matches: false,
3510
+ limit: 2e3,
3511
+ sheets: [],
3512
+ sheet: selectedSheet,
3513
+ skip: 0,
3514
+ tracking_disable: true
3456
3515
  }
3457
- );
3516
+ },
3517
+ with_context: context
3518
+ };
3519
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3520
+ headers: {
3521
+ "Content-Type": "multipart/form-data"
3522
+ }
3458
3523
  });
3459
3524
  },
3460
- logout(data) {
3461
- return __async(this, null, function* () {
3462
- var _a;
3463
- const env2 = getEnv();
3464
- console.log(data);
3465
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post(
3466
- "/logout" /* LOGOUT */,
3467
- {},
3468
- {
3469
- headers: {
3470
- "Content-Type": "application/json"
3471
- },
3472
- withCredentials: true,
3473
- useRefreshToken: true
3474
- }
3475
- );
3525
+ async executeImport({
3526
+ columns,
3527
+ fields,
3528
+ idFile,
3529
+ options,
3530
+ dryrun,
3531
+ context
3532
+ }) {
3533
+ const env2 = getEnv();
3534
+ const jsonData = {
3535
+ model: "base_import.import" /* BASE_IMPORT */,
3536
+ method: "execute_import",
3537
+ ids: [idFile],
3538
+ kwargs: {
3539
+ fields,
3540
+ columns,
3541
+ options,
3542
+ dryrun
3543
+ },
3544
+ with_context: context
3545
+ };
3546
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3547
+ headers: {
3548
+ "Content-Type": "multipart/form-data"
3549
+ }
3476
3550
  });
3551
+ },
3552
+ async getFileExcel({ model }) {
3553
+ const env2 = getEnv();
3554
+ const jsonData = {
3555
+ model,
3556
+ method: "get_import_templates" /* GET_IMPORT */,
3557
+ args: []
3558
+ };
3559
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData);
3560
+ },
3561
+ async getFieldExport({
3562
+ ids,
3563
+ model,
3564
+ isShow,
3565
+ parentField,
3566
+ fieldType,
3567
+ parentName,
3568
+ prefix,
3569
+ name,
3570
+ context,
3571
+ importCompat
3572
+ }) {
3573
+ const env2 = getEnv();
3574
+ const jsonData = {
3575
+ model,
3576
+ import_compat: importCompat,
3577
+ domain: [["id", "in", ids]],
3578
+ with_context: context
3579
+ };
3580
+ if (isShow) {
3581
+ jsonData.parent_field = parentField;
3582
+ jsonData.parent_field_type = fieldType;
3583
+ jsonData.parent_name = parentName;
3584
+ jsonData.name = name;
3585
+ jsonData.prefix = prefix;
3586
+ jsonData.exclude = [null];
3587
+ }
3588
+ return env2.requests.post("/export/get_fields", jsonData);
3589
+ },
3590
+ async exportExcel({
3591
+ model,
3592
+ domain,
3593
+ ids,
3594
+ fields,
3595
+ type,
3596
+ importCompat,
3597
+ context,
3598
+ groupby
3599
+ }) {
3600
+ const env2 = getEnv();
3601
+ const jsonData = {
3602
+ model,
3603
+ domain,
3604
+ ids,
3605
+ import_compat: importCompat,
3606
+ fields,
3607
+ with_context: context,
3608
+ groupby: groupby ?? []
3609
+ };
3610
+ return env2.requests.post_excel(`/export/${type}`, jsonData);
3477
3611
  }
3478
3612
  };
3479
- var auth_service_default = AuthService;
3613
+ var excel_service_default = ExcelService;
3480
3614
 
3481
- // src/services/company-service/index.ts
3482
- var CompanyService = {
3483
- getCurrentCompany() {
3484
- return __async(this, null, function* () {
3615
+ // src/services/form-service/index.ts
3616
+ var FormService = {
3617
+ async getComment({ data }) {
3618
+ try {
3485
3619
  const env2 = getEnv();
3486
- return yield env2.requests.get("/company" /* COMPANY_PATH */, {
3620
+ const jsonData = {
3621
+ thread_id: data.thread_id,
3622
+ thread_model: data.thread_model,
3623
+ limit: 100,
3624
+ with_context: {
3625
+ lang: data.lang
3626
+ }
3627
+ };
3628
+ return env2.requests.post("/chatter/thread/messages" /* GET_MESSAGE */, jsonData, {
3487
3629
  headers: {
3488
3630
  "Content-Type": "application/json"
3489
3631
  }
3490
3632
  });
3491
- });
3633
+ } catch (error) {
3634
+ console.error("Error when sending message:", error);
3635
+ throw error;
3636
+ }
3492
3637
  },
3493
- getInfoCompany(id) {
3494
- return __async(this, null, function* () {
3495
- var _a;
3638
+ async sentComment({ data }) {
3639
+ try {
3496
3640
  const env2 = getEnv();
3497
3641
  const jsonData = {
3498
- ids: [id],
3499
- model: "res.company" /* COMPANY */,
3500
- method: "web_read" /* WEB_READ */,
3501
- kwargs: {
3502
- specification: {
3503
- primary_color: {},
3504
- secondary_color: {},
3505
- logo: {},
3506
- display_name: {},
3507
- secondary_logo: {}
3508
- }
3509
- }
3642
+ context: {
3643
+ tz: "Asia/Saigon",
3644
+ uid: 2,
3645
+ allowed_company_ids: [1],
3646
+ mail_post_autofollow: false,
3647
+ temporary_id: 142183.01
3648
+ },
3649
+ post_data: {
3650
+ body: data.message,
3651
+ message_type: "comment",
3652
+ attachment_ids: data.attachment_ids,
3653
+ attachment_tokens: [],
3654
+ subtype_xmlid: data.subtype
3655
+ },
3656
+ thread_id: Number(data.thread_id),
3657
+ thread_model: data.thread_model
3510
3658
  };
3511
- return yield (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
3659
+ return env2.requests.post("/chatter/message/post" /* SENT_MESSAGE */, jsonData, {
3512
3660
  headers: {
3513
3661
  "Content-Type": "application/json"
3514
3662
  }
3515
3663
  });
3516
- });
3517
- }
3518
- };
3519
- var company_service_default = CompanyService;
3520
-
3521
- // src/services/excel-service/index.ts
3522
- var ExcelService = {
3523
- uploadFile(_0) {
3524
- return __async(this, arguments, function* ({ formData }) {
3664
+ } catch (error) {
3665
+ console.error("Error when sent message:", error);
3666
+ throw error;
3667
+ }
3668
+ },
3669
+ async deleteComment({ data }) {
3670
+ try {
3525
3671
  const env2 = getEnv();
3526
- return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
3672
+ const jsonData = {
3673
+ attachment_ids: [],
3674
+ attachment_tokens: [],
3675
+ body: "",
3676
+ message_id: data.message_id
3677
+ };
3678
+ return env2.requests.post("/chatter/message/update_content" /* DELETE_MESSAGE */, jsonData, {
3527
3679
  headers: {
3528
- "Content-Type": "multipart/form-data"
3680
+ "Content-Type": "application/json"
3529
3681
  }
3530
3682
  });
3531
- });
3683
+ } catch (error) {
3684
+ console.error("Error when sent message:", error);
3685
+ throw error;
3686
+ }
3532
3687
  },
3533
- uploadIdFile(_0) {
3534
- return __async(this, arguments, function* ({ formData }) {
3688
+ async getImage({ data }) {
3689
+ try {
3535
3690
  const env2 = getEnv();
3536
- return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
3537
- headers: {
3538
- "Content-Type": "multipart/form-data"
3691
+ return env2.requests.get(
3692
+ `${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
3693
+ {
3694
+ headers: {
3695
+ "Content-Type": "application/json"
3696
+ }
3539
3697
  }
3540
- });
3541
- });
3698
+ );
3699
+ } catch (error) {
3700
+ console.error("Error when sent message:", error);
3701
+ throw error;
3702
+ }
3542
3703
  },
3543
- parsePreview(_0) {
3544
- return __async(this, arguments, function* ({
3545
- id,
3546
- selectedSheet,
3547
- isHeader,
3548
- context
3549
- }) {
3704
+ async uploadImage({ data }) {
3705
+ try {
3550
3706
  const env2 = getEnv();
3551
- const jsonData = {
3552
- model: "base_import.import" /* BASE_IMPORT */,
3553
- method: "parse_preview",
3554
- ids: [id],
3555
- kwargs: {
3556
- options: {
3557
- import_skip_records: [],
3558
- import_set_empty_fields: [],
3559
- fallback_values: {},
3560
- name_create_enabled_fields: {},
3561
- encoding: "",
3562
- separator: "",
3563
- quoting: '"',
3564
- date_format: "",
3565
- datetime_format: "",
3566
- float_thousand_separator: ",",
3567
- float_decimal_separator: ".",
3568
- advanced: true,
3569
- has_headers: isHeader,
3570
- keep_matches: false,
3571
- limit: 2e3,
3572
- sheets: [],
3573
- sheet: selectedSheet,
3574
- skip: 0,
3575
- tracking_disable: true
3576
- }
3577
- },
3578
- with_context: context
3579
- };
3580
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3707
+ return env2.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
3581
3708
  headers: {
3582
3709
  "Content-Type": "multipart/form-data"
3583
3710
  }
3584
3711
  });
3585
- });
3712
+ } catch (error) {
3713
+ console.error("Error when sent message:", error);
3714
+ throw error;
3715
+ }
3586
3716
  },
3587
- executeImport(_0) {
3588
- return __async(this, arguments, function* ({
3589
- columns,
3590
- fields,
3591
- idFile,
3592
- options,
3593
- dryrun,
3594
- context
3595
- }) {
3717
+ async getFormView({ data }) {
3718
+ try {
3596
3719
  const env2 = getEnv();
3597
3720
  const jsonData = {
3598
- model: "base_import.import" /* BASE_IMPORT */,
3599
- method: "execute_import",
3600
- ids: [idFile],
3601
- kwargs: {
3602
- fields,
3603
- columns,
3604
- options,
3605
- dryrun
3606
- },
3607
- with_context: context
3721
+ model: data.model,
3722
+ method: "get_formview_action",
3723
+ ids: data.id ? [data.id] : [],
3724
+ with_context: data.context
3608
3725
  };
3609
3726
  return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3610
3727
  headers: {
3611
- "Content-Type": "multipart/form-data"
3728
+ "Content-Type": "application/json"
3612
3729
  }
3613
3730
  });
3614
- });
3731
+ } catch (error) {
3732
+ console.error("Error when fetching form view:", error);
3733
+ throw error;
3734
+ }
3615
3735
  },
3616
- getFileExcel(_0) {
3617
- return __async(this, arguments, function* ({ model }) {
3618
- const env2 = getEnv();
3619
- const jsonData = {
3620
- model,
3621
- method: "get_import_templates" /* GET_IMPORT */,
3622
- args: []
3623
- };
3624
- return env2.requests.post("/call" /* CALL_PATH */, jsonData);
3736
+ async changeStatus({ data }) {
3737
+ const env2 = getEnv();
3738
+ const vals = {
3739
+ [data.name]: data.stage_id
3740
+ };
3741
+ const jsonData = {
3742
+ model: data.model,
3743
+ method: "web_save",
3744
+ with_context: {
3745
+ lang: data.lang,
3746
+ allowed_company_ids: [1],
3747
+ uid: 2,
3748
+ search_default_my_ticket: true,
3749
+ search_default_is_open: true
3750
+ },
3751
+ ids: [data.id],
3752
+ kwargs: {
3753
+ vals,
3754
+ specification: {}
3755
+ }
3756
+ };
3757
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3758
+ headers: {
3759
+ "Content-Type": "application/json"
3760
+ }
3625
3761
  });
3626
- },
3627
- getFieldExport(_0) {
3628
- return __async(this, arguments, function* ({
3629
- ids,
3762
+ }
3763
+ };
3764
+ var form_service_default = FormService;
3765
+
3766
+ // src/services/kanban-service/index.ts
3767
+ var KanbanServices = {
3768
+ async getGroups({
3769
+ model,
3770
+ width_context
3771
+ }) {
3772
+ const env2 = getEnv();
3773
+ const jsonDataView = {
3630
3774
  model,
3631
- isShow,
3632
- parentField,
3633
- fieldType,
3634
- parentName,
3635
- prefix,
3636
- name,
3637
- context,
3638
- importCompat
3639
- }) {
3640
- const env2 = getEnv();
3641
- const jsonData = {
3642
- model,
3643
- import_compat: importCompat,
3644
- domain: [["id", "in", ids]],
3645
- with_context: context
3646
- };
3647
- if (isShow) {
3648
- jsonData.parent_field = parentField;
3649
- jsonData.parent_field_type = fieldType;
3650
- jsonData.parent_name = parentName;
3651
- jsonData.name = name;
3652
- jsonData.prefix = prefix;
3653
- jsonData.exclude = [null];
3654
- }
3655
- return env2.requests.post("/export/get_fields", jsonData);
3656
- });
3657
- },
3658
- exportExcel(_0) {
3659
- return __async(this, arguments, function* ({
3660
- model,
3661
- domain,
3662
- ids,
3663
- fields,
3664
- type,
3665
- importCompat,
3666
- context,
3667
- groupby
3668
- }) {
3669
- const env2 = getEnv();
3670
- const jsonData = {
3671
- model,
3672
- domain,
3673
- ids,
3674
- import_compat: importCompat,
3675
- fields,
3676
- with_context: context,
3677
- groupby: groupby != null ? groupby : []
3678
- };
3679
- return env2.requests.post_excel(`/export/${type}`, jsonData);
3680
- });
3681
- }
3682
- };
3683
- var excel_service_default = ExcelService;
3684
-
3685
- // src/services/form-service/index.ts
3686
- var FormService = {
3687
- getComment(_0) {
3688
- return __async(this, arguments, function* ({ data }) {
3689
- try {
3690
- const env2 = getEnv();
3691
- const jsonData = {
3692
- thread_id: data.thread_id,
3693
- thread_model: data.thread_model,
3694
- limit: 100,
3695
- with_context: {
3696
- lang: data.lang
3697
- }
3698
- };
3699
- return env2.requests.post("/chatter/thread/messages" /* GET_MESSAGE */, jsonData, {
3700
- headers: {
3701
- "Content-Type": "application/json"
3702
- }
3703
- });
3704
- } catch (error) {
3705
- console.error("Error when sending message:", error);
3706
- throw error;
3707
- }
3708
- });
3709
- },
3710
- sentComment(_0) {
3711
- return __async(this, arguments, function* ({ data }) {
3712
- try {
3713
- const env2 = getEnv();
3714
- const jsonData = {
3715
- context: {
3716
- tz: "Asia/Saigon",
3717
- uid: 2,
3718
- allowed_company_ids: [1],
3719
- mail_post_autofollow: false,
3720
- temporary_id: 142183.01
3721
- },
3722
- post_data: {
3723
- body: data.message,
3724
- message_type: "comment",
3725
- attachment_ids: data.attachment_ids,
3726
- attachment_tokens: [],
3727
- subtype_xmlid: data.subtype
3728
- },
3729
- thread_id: Number(data.thread_id),
3730
- thread_model: data.thread_model
3731
- };
3732
- return env2.requests.post("/chatter/message/post" /* SENT_MESSAGE */, jsonData, {
3733
- headers: {
3734
- "Content-Type": "application/json"
3735
- }
3736
- });
3737
- } catch (error) {
3738
- console.error("Error when sent message:", error);
3739
- throw error;
3740
- }
3741
- });
3742
- },
3743
- deleteComment(_0) {
3744
- return __async(this, arguments, function* ({ data }) {
3745
- try {
3746
- const env2 = getEnv();
3747
- const jsonData = {
3748
- attachment_ids: [],
3749
- attachment_tokens: [],
3750
- body: "",
3751
- message_id: data.message_id
3752
- };
3753
- return env2.requests.post("/chatter/message/update_content" /* DELETE_MESSAGE */, jsonData, {
3754
- headers: {
3755
- "Content-Type": "application/json"
3756
- }
3757
- });
3758
- } catch (error) {
3759
- console.error("Error when sent message:", error);
3760
- throw error;
3761
- }
3762
- });
3763
- },
3764
- getImage(_0) {
3765
- return __async(this, arguments, function* ({ data }) {
3766
- try {
3767
- const env2 = getEnv();
3768
- return env2.requests.get(
3769
- `${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
3770
- {
3771
- headers: {
3772
- "Content-Type": "application/json"
3773
- }
3774
- }
3775
- );
3776
- } catch (error) {
3777
- console.error("Error when sent message:", error);
3778
- throw error;
3779
- }
3780
- });
3781
- },
3782
- uploadImage(_0) {
3783
- return __async(this, arguments, function* ({ data }) {
3784
- try {
3785
- const env2 = getEnv();
3786
- return env2.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
3787
- headers: {
3788
- "Content-Type": "multipart/form-data"
3789
- }
3790
- });
3791
- } catch (error) {
3792
- console.error("Error when sent message:", error);
3793
- throw error;
3794
- }
3795
- });
3796
- },
3797
- getFormView(_0) {
3798
- return __async(this, arguments, function* ({ data }) {
3799
- try {
3800
- const env2 = getEnv();
3801
- const jsonData = {
3802
- model: data.model,
3803
- method: "get_formview_action",
3804
- ids: data.id ? [data.id] : [],
3805
- with_context: data.context
3806
- };
3807
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3808
- headers: {
3809
- "Content-Type": "application/json"
3810
- }
3811
- });
3812
- } catch (error) {
3813
- console.error("Error when fetching form view:", error);
3814
- throw error;
3775
+ method: "web_read_group",
3776
+ kwargs: {
3777
+ domain: [["stage_id.fold", "=", false]],
3778
+ fields: ["color:sum"],
3779
+ groupby: ["stage_id"]
3780
+ },
3781
+ width_context
3782
+ };
3783
+ return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
3784
+ headers: {
3785
+ "Content-Type": "application/json"
3815
3786
  }
3816
3787
  });
3817
3788
  },
3818
- changeStatus(_0) {
3819
- return __async(this, arguments, function* ({ data }) {
3820
- const env2 = getEnv();
3821
- const vals = {
3822
- [data.name]: data.stage_id
3823
- };
3824
- const jsonData = {
3825
- model: data.model,
3826
- method: "web_save",
3827
- with_context: {
3828
- lang: data.lang,
3829
- allowed_company_ids: [1],
3830
- uid: 2,
3831
- search_default_my_ticket: true,
3832
- search_default_is_open: true
3833
- },
3834
- ids: [data.id],
3835
- kwargs: {
3836
- vals,
3837
- specification: {}
3838
- }
3839
- };
3840
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3841
- headers: {
3842
- "Content-Type": "application/json"
3843
- }
3844
- });
3845
- });
3846
- }
3847
- };
3848
- var form_service_default = FormService;
3849
-
3850
- // src/services/kanban-service/index.ts
3851
- var KanbanServices = {
3852
- getGroups(_0) {
3853
- return __async(this, arguments, function* ({
3789
+ async getProgressBar({
3790
+ field,
3791
+ color,
3792
+ model,
3793
+ width_context
3794
+ }) {
3795
+ const env2 = getEnv();
3796
+ const jsonDataView = {
3854
3797
  model,
3855
- width_context
3856
- }) {
3857
- const env2 = getEnv();
3858
- const jsonDataView = {
3859
- model,
3860
- method: "web_read_group",
3861
- kwargs: {
3862
- domain: [["stage_id.fold", "=", false]],
3863
- fields: ["color:sum"],
3864
- groupby: ["stage_id"]
3865
- },
3866
- width_context
3867
- };
3868
- return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
3869
- headers: {
3870
- "Content-Type": "application/json"
3798
+ method: "read_progress_bar",
3799
+ kwargs: {
3800
+ domain: [],
3801
+ group_by: "stage_id",
3802
+ progress_bar: {
3803
+ colors: color,
3804
+ field
3871
3805
  }
3872
- });
3873
- });
3874
- },
3875
- getProgressBar(_0) {
3876
- return __async(this, arguments, function* ({
3877
- field,
3878
- color,
3879
- model,
3806
+ },
3880
3807
  width_context
3881
- }) {
3882
- const env2 = getEnv();
3883
- const jsonDataView = {
3884
- model,
3885
- method: "read_progress_bar",
3886
- kwargs: {
3887
- domain: [],
3888
- group_by: "stage_id",
3889
- progress_bar: {
3890
- colors: color,
3891
- field
3892
- }
3893
- },
3894
- width_context
3895
- };
3896
- return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
3897
- headers: {
3898
- "Content-Type": "application/json"
3899
- }
3900
- });
3808
+ };
3809
+ return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
3810
+ headers: {
3811
+ "Content-Type": "application/json"
3812
+ }
3901
3813
  });
3902
3814
  }
3903
3815
  };
@@ -3906,285 +3818,259 @@ var kanban_service_default = KanbanServices;
3906
3818
  // src/services/model-service/index.ts
3907
3819
  var OBJECT_POSITION = 2;
3908
3820
  var ModelService = {
3909
- getListMyBankAccount(_0) {
3910
- return __async(this, arguments, function* ({
3911
- domain,
3912
- spectification,
3913
- model
3914
- }) {
3915
- const env2 = getEnv();
3916
- const jsonData = {
3917
- model,
3918
- method: "web_search_read",
3919
- kwargs: {
3920
- specification: spectification,
3921
- domain,
3922
- limit: 100,
3923
- offset: 0
3924
- }
3925
- };
3926
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3927
- headers: {
3928
- "Content-Type": "application/json"
3929
- }
3930
- });
3821
+ async getListMyBankAccount({
3822
+ domain,
3823
+ spectification,
3824
+ model
3825
+ }) {
3826
+ const env2 = getEnv();
3827
+ const jsonData = {
3828
+ model,
3829
+ method: "web_search_read",
3830
+ kwargs: {
3831
+ specification: spectification,
3832
+ domain,
3833
+ limit: 100,
3834
+ offset: 0
3835
+ }
3836
+ };
3837
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3838
+ headers: {
3839
+ "Content-Type": "application/json"
3840
+ }
3931
3841
  });
3932
3842
  },
3933
- getCurrency() {
3934
- return __async(this, null, function* () {
3935
- const env2 = getEnv();
3936
- const jsonData = {
3937
- model: "res.currency",
3938
- method: "web_search_read",
3939
- kwargs: {
3940
- specification: {
3941
- icon_url: {},
3942
- name: {}
3943
- },
3944
- domain: [["active", "=", true]],
3945
- limit: 100,
3946
- offset: 0
3947
- }
3948
- };
3949
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3950
- headers: {
3951
- "Content-Type": "application/json"
3952
- }
3953
- });
3843
+ async getCurrency() {
3844
+ const env2 = getEnv();
3845
+ const jsonData = {
3846
+ model: "res.currency",
3847
+ method: "web_search_read",
3848
+ kwargs: {
3849
+ specification: {
3850
+ icon_url: {},
3851
+ name: {}
3852
+ },
3853
+ domain: [["active", "=", true]],
3854
+ limit: 100,
3855
+ offset: 0
3856
+ }
3857
+ };
3858
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3859
+ headers: {
3860
+ "Content-Type": "application/json"
3861
+ }
3954
3862
  });
3955
3863
  },
3956
- getConversionRate() {
3957
- return __async(this, null, function* () {
3958
- const env2 = getEnv();
3959
- const jsonData = {
3960
- model: "res.currency",
3961
- method: "web_search_read",
3962
- kwargs: {
3963
- specification: {
3964
- name: {},
3965
- icon_url: {},
3966
- rate_ids: {
3967
- fields: {
3968
- company_rate: {},
3969
- sell: {}
3970
- }
3864
+ async getConversionRate() {
3865
+ const env2 = getEnv();
3866
+ const jsonData = {
3867
+ model: "res.currency",
3868
+ method: "web_search_read",
3869
+ kwargs: {
3870
+ specification: {
3871
+ name: {},
3872
+ icon_url: {},
3873
+ rate_ids: {
3874
+ fields: {
3875
+ company_rate: {},
3876
+ sell: {}
3971
3877
  }
3972
- },
3973
- domain: [["active", "=", true]],
3974
- limit: 100,
3975
- offset: 0
3976
- }
3977
- };
3978
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3979
- headers: {
3980
- "Content-Type": "application/json"
3981
- }
3982
- });
3878
+ }
3879
+ },
3880
+ domain: [["active", "=", true]],
3881
+ limit: 100,
3882
+ offset: 0
3883
+ }
3884
+ };
3885
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3886
+ headers: {
3887
+ "Content-Type": "application/json"
3888
+ }
3983
3889
  });
3984
3890
  },
3985
- getAll(_0) {
3986
- return __async(this, arguments, function* ({ data }) {
3987
- const env2 = getEnv();
3988
- 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] ? {
3989
- fields: data.fields,
3990
- groupby: data.groupby
3991
- } : {
3992
- count_limit: 10001,
3993
- order: data.sort,
3994
- specification: data.specification
3995
- };
3996
- const jsonData = {
3997
- model: String(data.model),
3998
- method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
3999
- ids: data.ids,
4000
- with_context: data.context,
4001
- kwargs: __spreadValues({
4002
- domain: data.domain,
4003
- limit: data.limit,
4004
- offset: data.offset
4005
- }, jsonReadGroup)
4006
- };
4007
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4008
- headers: {
4009
- "Content-Type": "application/json"
4010
- }
4011
- });
3891
+ async getAll({ data }) {
3892
+ const env2 = getEnv();
3893
+ const jsonReadGroup = data.type == "calendar" ? { fields: data?.fields } : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
3894
+ fields: data.fields,
3895
+ groupby: data.groupby
3896
+ } : {
3897
+ count_limit: 10001,
3898
+ order: data.sort,
3899
+ specification: data.specification
3900
+ };
3901
+ const jsonData = {
3902
+ model: String(data.model),
3903
+ method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
3904
+ ids: data.ids,
3905
+ with_context: data.context,
3906
+ kwargs: {
3907
+ domain: data.domain,
3908
+ limit: data.limit,
3909
+ offset: data.offset,
3910
+ ...jsonReadGroup
3911
+ }
3912
+ };
3913
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3914
+ headers: {
3915
+ "Content-Type": "application/json"
3916
+ }
4012
3917
  });
4013
3918
  },
4014
- getListCalendar(_0) {
4015
- return __async(this, arguments, function* ({ data }) {
4016
- const env2 = getEnv();
4017
- 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] ? {
3919
+ async getListCalendar({ data }) {
3920
+ const env2 = getEnv();
3921
+ const jsonReadGroup = data.type == "calendar" ? data?.fields : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
3922
+ fields: data.fields,
3923
+ groupby: data.groupby
3924
+ } : {
3925
+ count_limit: 10001,
3926
+ order: data.sort,
3927
+ specification: data.specification
3928
+ };
3929
+ const jsonData = {
3930
+ model: String(data.model),
3931
+ method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
3932
+ ids: data.ids,
3933
+ with_context: data.context,
3934
+ kwargs: {
3935
+ domain: data.domain,
3936
+ limit: data.limit,
3937
+ offset: data.offset,
4018
3938
  fields: data.fields,
4019
- groupby: data.groupby
4020
- } : {
4021
- count_limit: 10001,
4022
- order: data.sort,
4023
- specification: data.specification
4024
- };
4025
- const jsonData = {
4026
- model: String(data.model),
4027
- method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
4028
- ids: data.ids,
4029
- with_context: data.context,
4030
- kwargs: __spreadValues({
4031
- domain: data.domain,
4032
- limit: data.limit,
4033
- offset: data.offset,
4034
- fields: data.fields
4035
- }, jsonReadGroup)
4036
- };
4037
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4038
- headers: {
4039
- "Content-Type": "application/json"
4040
- }
4041
- });
3939
+ ...jsonReadGroup
3940
+ }
3941
+ };
3942
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3943
+ headers: {
3944
+ "Content-Type": "application/json"
3945
+ }
4042
3946
  });
4043
3947
  },
4044
- getList(_0) {
4045
- return __async(this, arguments, function* ({
3948
+ async getList({
3949
+ model,
3950
+ ids = [],
3951
+ specification = {},
3952
+ domain = [],
3953
+ offset,
3954
+ order,
3955
+ context = {},
3956
+ limit = 10
3957
+ }) {
3958
+ const env2 = getEnv();
3959
+ const jsonData = {
4046
3960
  model,
4047
- ids = [],
4048
- specification = {},
4049
- domain = [],
4050
- offset,
4051
- order,
4052
- context = {},
4053
- limit = 10
4054
- }) {
4055
- var _a;
4056
- const env2 = getEnv();
4057
- const jsonData = {
4058
- model,
4059
- method: "web_search_read" /* WEB_SEARCH_READ */,
4060
- ids,
4061
- with_context: context,
4062
- kwargs: {
4063
- specification,
4064
- domain,
4065
- limit,
4066
- offset,
4067
- order
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
- });
3961
+ method: "web_search_read" /* WEB_SEARCH_READ */,
3962
+ ids,
3963
+ with_context: context,
3964
+ kwargs: {
3965
+ specification,
3966
+ domain,
3967
+ limit,
3968
+ offset,
3969
+ order
3970
+ }
3971
+ };
3972
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3973
+ headers: {
3974
+ "Content-Type": "application/json"
3975
+ }
4075
3976
  });
4076
3977
  },
4077
- getDetail(_0) {
4078
- return __async(this, arguments, function* ({
4079
- ids = [],
3978
+ async getDetail({
3979
+ ids = [],
3980
+ model,
3981
+ specification,
3982
+ context
3983
+ }) {
3984
+ const env2 = getEnv();
3985
+ const jsonData = {
4080
3986
  model,
4081
- specification,
4082
- context
4083
- }) {
4084
- var _a;
4085
- const env2 = getEnv();
4086
- const jsonData = {
4087
- model,
4088
- method: "web_read" /* WEB_READ */,
4089
- ids,
4090
- with_context: context,
4091
- kwargs: {
4092
- specification
4093
- }
4094
- };
4095
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4096
- headers: {
4097
- "Content-Type": "application/json"
4098
- }
4099
- });
3987
+ method: "web_read" /* WEB_READ */,
3988
+ ids,
3989
+ with_context: context,
3990
+ kwargs: {
3991
+ specification
3992
+ }
3993
+ };
3994
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3995
+ headers: {
3996
+ "Content-Type": "application/json"
3997
+ }
4100
3998
  });
4101
3999
  },
4102
- save(_0) {
4103
- return __async(this, arguments, function* ({
4000
+ async save({
4001
+ model,
4002
+ ids = [],
4003
+ data = {},
4004
+ specification = {},
4005
+ context = {},
4006
+ path
4007
+ }) {
4008
+ const env2 = getEnv();
4009
+ const jsonData = {
4104
4010
  model,
4105
- ids = [],
4106
- data = {},
4107
- specification = {},
4108
- context = {},
4109
- path
4110
- }) {
4111
- var _a;
4112
- const env2 = getEnv();
4113
- const jsonData = {
4114
- model,
4115
- method: "web_save" /* WEB_SAVE */,
4116
- with_context: context,
4117
- ids,
4118
- kwargs: {
4119
- vals: data,
4120
- specification
4121
- }
4122
- };
4123
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post(path != null ? path : "/call" /* CALL_PATH */, jsonData, {
4124
- headers: {
4125
- "Content-Type": "application/json"
4126
- }
4127
- });
4011
+ method: "web_save" /* WEB_SAVE */,
4012
+ with_context: context,
4013
+ ids,
4014
+ kwargs: {
4015
+ vals: data,
4016
+ specification
4017
+ }
4018
+ };
4019
+ return env2?.requests?.post(path ?? "/call" /* CALL_PATH */, jsonData, {
4020
+ headers: {
4021
+ "Content-Type": "application/json"
4022
+ }
4128
4023
  });
4129
4024
  },
4130
- delete(_0) {
4131
- return __async(this, arguments, function* ({ ids = [], model }) {
4132
- var _a;
4133
- const env2 = getEnv();
4134
- const jsonData = {
4135
- model,
4136
- method: "unlink" /* UNLINK */,
4137
- ids
4138
- };
4139
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4140
- headers: {
4141
- "Content-Type": "application/json"
4142
- }
4143
- });
4025
+ async delete({ ids = [], model }) {
4026
+ const env2 = getEnv();
4027
+ const jsonData = {
4028
+ model,
4029
+ method: "unlink" /* UNLINK */,
4030
+ ids
4031
+ };
4032
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4033
+ headers: {
4034
+ "Content-Type": "application/json"
4035
+ }
4144
4036
  });
4145
4037
  },
4146
- onChange(_0) {
4147
- return __async(this, arguments, function* ({
4148
- ids = [],
4038
+ async onChange({
4039
+ ids = [],
4040
+ model,
4041
+ object,
4042
+ specification,
4043
+ context,
4044
+ fieldChange
4045
+ }) {
4046
+ const env2 = getEnv();
4047
+ const jsonData = {
4149
4048
  model,
4150
- object,
4151
- specification,
4152
- context,
4153
- fieldChange
4154
- }) {
4155
- var _a;
4156
- const env2 = getEnv();
4157
- const jsonData = {
4158
- model,
4159
- method: "onchange" /* ONCHANGE */,
4160
- ids,
4161
- with_context: context,
4162
- args: [
4163
- object ? object : {},
4164
- fieldChange ? fieldChange : [],
4165
- specification
4166
- ]
4167
- };
4168
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4169
- headers: {
4170
- "Content-Type": "application/json"
4171
- }
4172
- });
4049
+ method: "onchange" /* ONCHANGE */,
4050
+ ids,
4051
+ with_context: context,
4052
+ args: [
4053
+ object ? object : {},
4054
+ fieldChange ? fieldChange : [],
4055
+ specification
4056
+ ]
4057
+ };
4058
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4059
+ headers: {
4060
+ "Content-Type": "application/json"
4061
+ }
4173
4062
  });
4174
- },
4175
- getListFieldsOnchange(_0) {
4176
- return __async(this, arguments, function* ({ model }) {
4177
- var _a;
4178
- const env2 = getEnv();
4179
- const jsonData = {
4180
- model,
4181
- method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
4182
- };
4183
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4184
- headers: {
4185
- "Content-Type": "application/json"
4186
- }
4187
- });
4063
+ },
4064
+ async getListFieldsOnchange({ model }) {
4065
+ const env2 = getEnv();
4066
+ const jsonData = {
4067
+ model,
4068
+ method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
4069
+ };
4070
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4071
+ headers: {
4072
+ "Content-Type": "application/json"
4073
+ }
4188
4074
  });
4189
4075
  },
4190
4076
  parseORMOdoo(data) {
@@ -4198,14 +4084,13 @@ var ModelService = {
4198
4084
  data[key] = "/";
4199
4085
  }
4200
4086
  }
4201
- return __spreadValues({}, data);
4087
+ return { ...data };
4202
4088
  },
4203
4089
  toDataJS(data, viewData, model) {
4204
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
4205
4090
  for (const key in data) {
4206
4091
  if (data[key] === false) {
4207
4092
  if (viewData && model) {
4208
- 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 */) {
4093
+ if (viewData?.models?.[model]?.[key]?.type !== "boolean" /* BOOLEAN */) {
4209
4094
  data[key] = null;
4210
4095
  }
4211
4096
  } else {
@@ -4215,13 +4100,12 @@ var ModelService = {
4215
4100
  data[key] = "Draft";
4216
4101
  } else if (data[key] !== false) {
4217
4102
  if (model !== void 0) {
4218
- 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 */) {
4219
- data[key] = (_k = (_j = data[key]) != null ? _j : data[key] = []) == null ? void 0 : _k.map((item) => {
4220
- var _a2, _b2, _c2, _d2;
4221
- 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;
4103
+ if (viewData?.models?.[model]?.[key]?.type === "one2many" /* ONE2MANY */ || viewData?.models?.[model]?.[key]?.type === "many2many" /* MANY2MANY */) {
4104
+ data[key] = (data[key] ??= [])?.map((item) => {
4105
+ const relation = viewData?.models?.[model]?.[key]?.relation;
4222
4106
  if (relation !== void 0) {
4223
- if ((_d2 = viewData == null ? void 0 : viewData.models) == null ? void 0 : _d2[relation]) {
4224
- if ((item == null ? void 0 : item.length) >= 3) {
4107
+ if (viewData?.models?.[relation]) {
4108
+ if (item?.length >= 3) {
4225
4109
  return ModelService.toDataJS(
4226
4110
  item[OBJECT_POSITION],
4227
4111
  viewData,
@@ -4231,7 +4115,7 @@ var ModelService = {
4231
4115
  return ModelService.toDataJS(item, viewData, relation);
4232
4116
  }
4233
4117
  } else {
4234
- if ((item == null ? void 0 : item.length) >= 3) {
4118
+ if (item?.length >= 3) {
4235
4119
  return item[OBJECT_POSITION];
4236
4120
  } else {
4237
4121
  return item;
@@ -4243,556 +4127,514 @@ var ModelService = {
4243
4127
  }
4244
4128
  }
4245
4129
  }
4246
- return __spreadValues({}, data);
4130
+ return { ...data };
4247
4131
  }
4248
4132
  };
4249
4133
  var model_service_default = ModelService;
4250
4134
 
4251
4135
  // src/services/user-service/index.ts
4252
4136
  var UserService = {
4253
- getProfile(path) {
4254
- return __async(this, null, function* () {
4255
- const env2 = getEnv();
4256
- return env2.requests.get(path != null ? path : "/userinfo" /* PROFILE_PATH */, {
4257
- headers: {
4258
- "Content-Type": "application/x-www-form-urlencoded"
4259
- }
4260
- });
4137
+ async getProfile(path) {
4138
+ const env2 = getEnv();
4139
+ return env2.requests.get(path ?? "/userinfo" /* PROFILE_PATH */, {
4140
+ headers: {
4141
+ "Content-Type": "application/x-www-form-urlencoded"
4142
+ }
4261
4143
  });
4262
4144
  },
4263
- getUser(_0) {
4264
- return __async(this, arguments, function* ({ context, id }) {
4265
- const env2 = getEnv();
4266
- const jsonData = {
4267
- model: "res.users",
4268
- method: "web_read",
4269
- ids: [id],
4270
- with_context: context,
4271
- kwargs: {
4272
- specification: {
4273
- display_name: {},
4274
- image_1920: {},
4275
- name: {},
4276
- login: {},
4277
- email: {},
4278
- password: {},
4279
- visible_group_id: {
4280
- fields: {
4281
- id: {},
4282
- display_name: {}
4283
- }
4284
- },
4285
- company_id: {
4286
- fields: {
4287
- id: {},
4288
- display_name: {}
4289
- }
4145
+ async getUser({ context, id }) {
4146
+ const env2 = getEnv();
4147
+ const jsonData = {
4148
+ model: "res.users",
4149
+ method: "web_read",
4150
+ ids: [id],
4151
+ with_context: context,
4152
+ kwargs: {
4153
+ specification: {
4154
+ display_name: {},
4155
+ image_1920: {},
4156
+ name: {},
4157
+ login: {},
4158
+ email: {},
4159
+ password: {},
4160
+ visible_group_id: {
4161
+ fields: {
4162
+ id: {},
4163
+ display_name: {}
4164
+ }
4165
+ },
4166
+ company_id: {
4167
+ fields: {
4168
+ id: {},
4169
+ display_name: {}
4290
4170
  }
4291
4171
  }
4292
4172
  }
4293
- };
4294
- return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4295
- headers: {
4296
- "Content-Type": "application/json"
4297
- }
4298
- });
4173
+ }
4174
+ };
4175
+ return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4176
+ headers: {
4177
+ "Content-Type": "application/json"
4178
+ }
4299
4179
  });
4300
4180
  },
4301
- switchUserLocale: (_0) => __async(null, [_0], function* ({ id, values }) {
4302
- var _a;
4181
+ switchUserLocale: async ({ id, values }) => {
4303
4182
  const env2 = getEnv();
4304
4183
  const jsonData = {
4305
4184
  model: "res.users",
4306
4185
  domain: [["id", "=", id]],
4307
4186
  values
4308
4187
  };
4309
- return env2 == null ? void 0 : env2.requests.post((_a = UriConstants) == null ? void 0 : _a.CREATE_UPDATE_PATH, jsonData, {
4188
+ return env2?.requests.post(UriConstants?.CREATE_UPDATE_PATH, jsonData, {
4310
4189
  headers: {
4311
4190
  "Content-Type": "application/json"
4312
4191
  }
4313
4192
  });
4314
- })
4193
+ }
4315
4194
  };
4316
4195
  var user_service_default = UserService;
4317
4196
 
4318
4197
  // src/services/view-service/index.ts
4319
4198
  var ViewService = {
4320
- getView(_0) {
4321
- return __async(this, arguments, function* ({
4199
+ async getView({
4200
+ model,
4201
+ views,
4202
+ context = {},
4203
+ options = {},
4204
+ aid
4205
+ }) {
4206
+ const env2 = getEnv();
4207
+ const defaultOptions = {
4208
+ load_filters: true,
4209
+ toolbar: true,
4210
+ action_id: aid
4211
+ };
4212
+ const jsonDataView = {
4322
4213
  model,
4323
- views,
4324
- context = {},
4325
- options = {},
4326
- aid
4327
- }) {
4328
- var _a;
4329
- const env2 = getEnv();
4330
- const defaultOptions = {
4331
- load_filters: true,
4332
- toolbar: true,
4333
- action_id: aid
4334
- };
4335
- const jsonDataView = {
4336
- model,
4337
- method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
4338
- kwargs: {
4339
- views,
4340
- options: __spreadValues(__spreadValues({}, options), defaultOptions)
4341
- },
4342
- with_context: context
4343
- };
4344
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonDataView, {
4345
- headers: {
4346
- "Content-Type": "application/json"
4347
- }
4348
- });
4214
+ method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
4215
+ kwargs: {
4216
+ views,
4217
+ options: { ...options, ...defaultOptions }
4218
+ },
4219
+ with_context: context
4220
+ };
4221
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonDataView, {
4222
+ headers: {
4223
+ "Content-Type": "application/json"
4224
+ }
4349
4225
  });
4350
4226
  },
4351
- getMenu(context) {
4352
- return __async(this, null, function* () {
4353
- var _a;
4354
- const env2 = getEnv();
4355
- const jsonData = {
4356
- model: "ir.ui.menu" /* MENU */,
4357
- method: "web_search_read" /* WEB_SEARCH_READ */,
4358
- ids: [],
4359
- with_context: context,
4360
- kwargs: {
4361
- specification: {
4362
- active: {},
4363
- name: {},
4364
- is_display: {},
4365
- sequence: {},
4366
- complete_name: {},
4367
- action: {
4368
- fields: {
4369
- display_name: {},
4370
- type: {},
4371
- binding_view_types: {}
4372
- // res_model: {},
4373
- }
4227
+ async getMenu(context) {
4228
+ const env2 = getEnv();
4229
+ const jsonData = {
4230
+ model: "ir.ui.menu" /* MENU */,
4231
+ method: "web_search_read" /* WEB_SEARCH_READ */,
4232
+ ids: [],
4233
+ with_context: context,
4234
+ kwargs: {
4235
+ specification: {
4236
+ active: {},
4237
+ name: {},
4238
+ is_display: {},
4239
+ sequence: {},
4240
+ complete_name: {},
4241
+ action: {
4242
+ fields: {
4243
+ display_name: {},
4244
+ type: {},
4245
+ binding_view_types: {}
4246
+ // res_model: {},
4247
+ }
4248
+ },
4249
+ url_icon: {},
4250
+ web_icon: {},
4251
+ web_icon_data: {},
4252
+ groups_id: {
4253
+ fields: {
4254
+ full_name: {}
4374
4255
  },
4375
- url_icon: {},
4376
- web_icon: {},
4377
- web_icon_data: {},
4378
- groups_id: {
4379
- fields: {
4380
- full_name: {}
4256
+ limit: 40,
4257
+ order: ""
4258
+ },
4259
+ display_name: {},
4260
+ child_id: {
4261
+ fields: {
4262
+ active: {},
4263
+ name: {},
4264
+ is_display: {},
4265
+ sequence: {},
4266
+ complete_name: {},
4267
+ action: {
4268
+ fields: {
4269
+ display_name: {},
4270
+ type: {},
4271
+ binding_view_types: {}
4272
+ // res_model: {},
4273
+ }
4381
4274
  },
4382
- limit: 40,
4383
- order: ""
4384
- },
4385
- display_name: {},
4386
- child_id: {
4387
- fields: {
4388
- active: {},
4389
- name: {},
4390
- is_display: {},
4391
- sequence: {},
4392
- complete_name: {},
4393
- action: {
4394
- fields: {
4395
- display_name: {},
4396
- type: {},
4397
- binding_view_types: {}
4398
- // res_model: {},
4399
- }
4275
+ url_icon: {},
4276
+ web_icon: {},
4277
+ web_icon_data: {},
4278
+ groups_id: {
4279
+ fields: {
4280
+ full_name: {}
4400
4281
  },
4401
- url_icon: {},
4402
- web_icon: {},
4403
- web_icon_data: {},
4404
- groups_id: {
4405
- fields: {
4406
- full_name: {}
4282
+ limit: 40,
4283
+ order: ""
4284
+ },
4285
+ display_name: {},
4286
+ child_id: {
4287
+ fields: {
4288
+ active: {},
4289
+ name: {},
4290
+ is_display: {},
4291
+ sequence: {},
4292
+ complete_name: {},
4293
+ action: {
4294
+ fields: {
4295
+ display_name: {},
4296
+ type: {},
4297
+ binding_view_types: {}
4298
+ // res_model: {},
4299
+ }
4407
4300
  },
4408
- limit: 40,
4409
- order: ""
4410
- },
4411
- display_name: {},
4412
- child_id: {
4413
- fields: {
4414
- active: {},
4415
- name: {},
4416
- is_display: {},
4417
- sequence: {},
4418
- complete_name: {},
4419
- action: {
4420
- fields: {
4421
- display_name: {},
4422
- type: {},
4423
- binding_view_types: {}
4424
- // res_model: {},
4425
- }
4301
+ url_icon: {},
4302
+ web_icon: {},
4303
+ web_icon_data: {},
4304
+ groups_id: {
4305
+ fields: {
4306
+ full_name: {}
4426
4307
  },
4427
- url_icon: {},
4428
- web_icon: {},
4429
- web_icon_data: {},
4430
- groups_id: {
4431
- fields: {
4432
- full_name: {}
4308
+ limit: 40,
4309
+ order: ""
4310
+ },
4311
+ display_name: {},
4312
+ child_id: {
4313
+ fields: {
4314
+ active: {},
4315
+ name: {},
4316
+ is_display: {},
4317
+ sequence: {},
4318
+ complete_name: {},
4319
+ action: {
4320
+ fields: {
4321
+ display_name: {},
4322
+ type: {},
4323
+ binding_view_types: {}
4324
+ // res_model: {},
4325
+ }
4433
4326
  },
4434
- limit: 40,
4435
- order: ""
4436
- },
4437
- display_name: {},
4438
- child_id: {
4439
- fields: {
4440
- active: {},
4441
- name: {},
4442
- is_display: {},
4443
- sequence: {},
4444
- complete_name: {},
4445
- action: {
4446
- fields: {
4447
- display_name: {},
4448
- type: {},
4449
- binding_view_types: {}
4450
- // res_model: {},
4451
- }
4452
- },
4453
- url_icon: {},
4454
- web_icon: {},
4455
- web_icon_data: {},
4456
- groups_id: {
4457
- fields: {
4458
- full_name: {}
4459
- },
4460
- limit: 40,
4461
- order: ""
4327
+ url_icon: {},
4328
+ web_icon: {},
4329
+ web_icon_data: {},
4330
+ groups_id: {
4331
+ fields: {
4332
+ full_name: {}
4462
4333
  },
4463
- display_name: {},
4464
- child_id: {
4465
- fields: {},
4466
- limit: 40,
4467
- order: ""
4468
- }
4334
+ limit: 40,
4335
+ order: ""
4469
4336
  },
4470
- limit: 40,
4471
- order: ""
4472
- }
4473
- },
4474
- limit: 40,
4475
- order: ""
4476
- }
4477
- },
4478
- limit: 40,
4479
- order: ""
4480
- }
4481
- },
4482
- domain: [
4483
- "&",
4484
- ["is_display", "=", true],
4485
- "&",
4486
- ["active", "=", true],
4487
- ["parent_id", "=", false]
4488
- ]
4489
- }
4490
- };
4491
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4492
- headers: {
4493
- "Content-Type": "application/json"
4494
- }
4495
- });
4337
+ display_name: {},
4338
+ child_id: {
4339
+ fields: {},
4340
+ limit: 40,
4341
+ order: ""
4342
+ }
4343
+ },
4344
+ limit: 40,
4345
+ order: ""
4346
+ }
4347
+ },
4348
+ limit: 40,
4349
+ order: ""
4350
+ }
4351
+ },
4352
+ limit: 40,
4353
+ order: ""
4354
+ }
4355
+ },
4356
+ domain: [
4357
+ "&",
4358
+ ["is_display", "=", true],
4359
+ "&",
4360
+ ["active", "=", true],
4361
+ ["parent_id", "=", false]
4362
+ ]
4363
+ }
4364
+ };
4365
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4366
+ headers: {
4367
+ "Content-Type": "application/json"
4368
+ }
4496
4369
  });
4497
4370
  },
4498
- getActionDetail(aid, context) {
4499
- return __async(this, null, function* () {
4500
- var _a;
4501
- const env2 = getEnv();
4502
- const jsonData = {
4503
- model: "ir.actions.act_window" /* WINDOW_ACTION */,
4504
- method: "web_read" /* WEB_READ */,
4505
- ids: [aid],
4506
- with_context: context,
4507
- kwargs: {
4508
- specification: {
4509
- id: {},
4510
- name: {},
4511
- res_model: {},
4512
- views: {},
4513
- view_mode: {},
4514
- mobile_view_mode: {},
4515
- domain: {},
4516
- context: {},
4517
- groups_id: {},
4518
- search_view_id: {}
4519
- }
4520
- }
4521
- };
4522
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
4523
- headers: {
4524
- "Content-Type": "application/json"
4371
+ async getActionDetail(aid, context) {
4372
+ const env2 = getEnv();
4373
+ const jsonData = {
4374
+ model: "ir.actions.act_window" /* WINDOW_ACTION */,
4375
+ method: "web_read" /* WEB_READ */,
4376
+ ids: [aid],
4377
+ with_context: context,
4378
+ kwargs: {
4379
+ specification: {
4380
+ id: {},
4381
+ name: {},
4382
+ res_model: {},
4383
+ views: {},
4384
+ view_mode: {},
4385
+ mobile_view_mode: {},
4386
+ domain: {},
4387
+ context: {},
4388
+ groups_id: {},
4389
+ search_view_id: {}
4525
4390
  }
4526
- });
4391
+ }
4392
+ };
4393
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
4394
+ headers: {
4395
+ "Content-Type": "application/json"
4396
+ }
4527
4397
  });
4528
4398
  },
4529
- getResequence(_0) {
4530
- return __async(this, arguments, function* ({
4399
+ async getResequence({
4400
+ model,
4401
+ ids,
4402
+ context,
4403
+ offset
4404
+ }) {
4405
+ const env2 = getEnv();
4406
+ const jsonData = {
4531
4407
  model,
4408
+ with_context: context,
4532
4409
  ids,
4533
- context,
4534
- offset
4535
- }) {
4536
- const env2 = getEnv();
4537
- const jsonData = __spreadValues({
4538
- model,
4539
- with_context: context,
4540
- ids,
4541
- field: "sequence"
4542
- }, offset > 0 ? { offset } : {});
4543
- return env2 == null ? void 0 : env2.requests.post("/web/dataset/resequence", jsonData, {
4544
- headers: {
4545
- "Content-Type": "application/json"
4546
- }
4547
- });
4548
- });
4549
- },
4550
- getSelectionItem(_0) {
4551
- return __async(this, arguments, function* ({ data }) {
4552
- var _a;
4553
- const env2 = getEnv();
4554
- const jsonData = {
4555
- model: data.model,
4556
- ids: [],
4557
- method: "get_data_select",
4558
- with_context: data.context,
4559
- kwargs: {
4560
- count_limit: 10001,
4561
- domain: data.domain ? data.domain : [],
4562
- offset: 0,
4563
- order: "",
4564
- specification: (_a = data == null ? void 0 : data.specification) != null ? _a : {
4565
- id: {},
4566
- name: {},
4567
- display_name: {}
4568
- }
4569
- }
4570
- };
4571
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4572
- headers: {
4573
- "Content-Type": "application/json"
4574
- }
4575
- });
4410
+ field: "sequence",
4411
+ ...offset > 0 ? { offset } : {}
4412
+ };
4413
+ return env2?.requests.post("/web/dataset/resequence", jsonData, {
4414
+ headers: {
4415
+ "Content-Type": "application/json"
4416
+ }
4576
4417
  });
4577
4418
  },
4578
- loadMessages() {
4579
- return __async(this, null, function* () {
4580
- const env2 = getEnv();
4581
- return env2.requests.post(
4582
- "/load_message_failures" /* LOAD_MESSAGE */,
4583
- {},
4584
- {
4585
- headers: {
4586
- "Content-Type": "application/json"
4587
- }
4419
+ async getSelectionItem({ data }) {
4420
+ const env2 = getEnv();
4421
+ const jsonData = {
4422
+ model: data.model,
4423
+ ids: [],
4424
+ method: "get_data_select",
4425
+ with_context: data.context,
4426
+ kwargs: {
4427
+ count_limit: 10001,
4428
+ domain: data.domain ? data.domain : [],
4429
+ offset: 0,
4430
+ order: "",
4431
+ specification: data?.specification ?? {
4432
+ id: {},
4433
+ name: {},
4434
+ display_name: {}
4588
4435
  }
4589
- );
4436
+ }
4437
+ };
4438
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4439
+ headers: {
4440
+ "Content-Type": "application/json"
4441
+ }
4590
4442
  });
4591
4443
  },
4592
- getVersion() {
4593
- return __async(this, null, function* () {
4594
- var _a;
4595
- const env2 = getEnv();
4596
- console.log("env?.requests", env2, env2 == null ? void 0 : env2.requests);
4597
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.get("", {
4444
+ async loadMessages() {
4445
+ const env2 = getEnv();
4446
+ return env2.requests.post(
4447
+ "/load_message_failures" /* LOAD_MESSAGE */,
4448
+ {},
4449
+ {
4598
4450
  headers: {
4599
4451
  "Content-Type": "application/json"
4600
4452
  }
4601
- });
4453
+ }
4454
+ );
4455
+ },
4456
+ async getVersion() {
4457
+ const env2 = getEnv();
4458
+ return env2?.requests.get("", {
4459
+ headers: {
4460
+ "Content-Type": "application/json"
4461
+ }
4602
4462
  });
4603
4463
  },
4604
- get2FAMethods(_0) {
4605
- return __async(this, arguments, function* ({
4464
+ async get2FAMethods({
4465
+ method,
4466
+ with_context
4467
+ }) {
4468
+ const env2 = getEnv();
4469
+ const jsonData = {
4606
4470
  method,
4607
4471
  with_context
4608
- }) {
4609
- const env2 = getEnv();
4610
- const jsonData = {
4611
- method,
4612
- with_context
4613
- };
4614
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4615
- headers: {
4616
- "Content-Type": "application/json"
4617
- }
4618
- });
4472
+ };
4473
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4474
+ headers: {
4475
+ "Content-Type": "application/json"
4476
+ }
4619
4477
  });
4620
4478
  },
4621
- verify2FA(_0) {
4622
- return __async(this, arguments, function* ({
4479
+ async verify2FA({
4480
+ method,
4481
+ with_context,
4482
+ code,
4483
+ device,
4484
+ location
4485
+ }) {
4486
+ const env2 = getEnv();
4487
+ const jsonData = {
4623
4488
  method,
4624
- with_context,
4625
- code,
4626
- device,
4627
- location
4628
- }) {
4629
- const env2 = getEnv();
4630
- const jsonData = {
4631
- method,
4632
- kwargs: {
4633
- vals: {
4634
- code,
4635
- device,
4636
- location
4637
- }
4638
- },
4639
- with_context
4640
- };
4641
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4642
- headers: {
4643
- "Content-Type": "application/json"
4644
- },
4645
- withCredentials: true
4646
- });
4489
+ kwargs: {
4490
+ vals: {
4491
+ code,
4492
+ device,
4493
+ location
4494
+ }
4495
+ },
4496
+ with_context
4497
+ };
4498
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4499
+ headers: {
4500
+ "Content-Type": "application/json"
4501
+ },
4502
+ withCredentials: true
4647
4503
  });
4648
4504
  },
4649
- signInSSO(_0) {
4650
- return __async(this, arguments, function* ({
4651
- redirect_uri,
4652
- state,
4653
- client_id,
4505
+ async signInSSO({
4506
+ redirect_uri,
4507
+ state,
4508
+ client_id,
4509
+ response_type,
4510
+ path
4511
+ }) {
4512
+ const env2 = getEnv();
4513
+ const params = new URLSearchParams({
4654
4514
  response_type,
4655
- path
4656
- }) {
4657
- const env2 = getEnv();
4658
- const params = new URLSearchParams({
4659
- response_type,
4660
- client_id,
4661
- redirect_uri,
4662
- state
4663
- });
4664
- const url = `${path}?${params.toString()}`;
4665
- return env2 == null ? void 0 : env2.requests.get(url, {
4666
- headers: {
4667
- "Content-Type": "application/json"
4668
- },
4669
- withCredentials: true
4670
- });
4515
+ client_id,
4516
+ redirect_uri,
4517
+ state
4518
+ });
4519
+ const url = `${path}?${params.toString()}`;
4520
+ return env2?.requests.get(url, {
4521
+ headers: {
4522
+ "Content-Type": "application/json"
4523
+ },
4524
+ withCredentials: true
4671
4525
  });
4672
4526
  },
4673
- grantAccess(_0) {
4674
- return __async(this, arguments, function* ({
4527
+ async grantAccess({
4528
+ redirect_uri,
4529
+ state,
4530
+ client_id,
4531
+ scopes
4532
+ }) {
4533
+ const env2 = getEnv();
4534
+ const jsonData = {
4675
4535
  redirect_uri,
4676
4536
  state,
4677
4537
  client_id,
4678
4538
  scopes
4679
- }) {
4680
- const env2 = getEnv();
4681
- const jsonData = {
4682
- redirect_uri,
4683
- state,
4684
- client_id,
4685
- scopes
4686
- };
4687
- return env2 == null ? void 0 : env2.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
4688
- headers: {
4689
- "Content-Type": "application/json"
4690
- },
4691
- withCredentials: true
4692
- });
4539
+ };
4540
+ return env2?.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
4541
+ headers: {
4542
+ "Content-Type": "application/json"
4543
+ },
4544
+ withCredentials: true
4693
4545
  });
4694
4546
  },
4695
- getFieldsViewSecurity(_0) {
4696
- return __async(this, arguments, function* ({
4547
+ async getFieldsViewSecurity({
4548
+ method,
4549
+ token,
4550
+ views
4551
+ }) {
4552
+ const env2 = getEnv();
4553
+ const jsonData = {
4697
4554
  method,
4698
- token,
4699
- views
4700
- }) {
4701
- const env2 = getEnv();
4702
- const jsonData = {
4703
- method,
4704
- kwargs: {
4705
- views
4706
- },
4707
- with_context: {
4708
- token
4709
- }
4710
- };
4711
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4712
- headers: {
4713
- "Content-Type": "application/json"
4714
- }
4715
- });
4555
+ kwargs: {
4556
+ views
4557
+ },
4558
+ with_context: {
4559
+ token
4560
+ }
4561
+ };
4562
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4563
+ headers: {
4564
+ "Content-Type": "application/json"
4565
+ }
4716
4566
  });
4717
4567
  },
4718
- settingsWebRead2fa(_0) {
4719
- return __async(this, arguments, function* ({
4568
+ async settingsWebRead2fa({
4569
+ method,
4570
+ model,
4571
+ kwargs,
4572
+ token
4573
+ }) {
4574
+ const env2 = getEnv();
4575
+ const jsonData = {
4720
4576
  method,
4721
4577
  model,
4722
4578
  kwargs,
4723
- token
4724
- }) {
4725
- const env2 = getEnv();
4726
- const jsonData = {
4727
- method,
4728
- model,
4729
- kwargs,
4730
- with_context: {
4731
- token
4732
- }
4733
- };
4734
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4735
- headers: {
4736
- "Content-Type": "application/json"
4737
- }
4738
- });
4579
+ with_context: {
4580
+ token
4581
+ }
4582
+ };
4583
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4584
+ headers: {
4585
+ "Content-Type": "application/json"
4586
+ }
4739
4587
  });
4740
4588
  },
4741
- requestSetupTotp(_0) {
4742
- return __async(this, arguments, function* ({ method, token }) {
4743
- const env2 = getEnv();
4744
- const jsonData = {
4745
- method,
4746
- with_context: {
4747
- token
4748
- }
4749
- };
4750
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4751
- headers: {
4752
- "Content-Type": "application/json"
4753
- }
4754
- });
4589
+ async requestSetupTotp({ method, token }) {
4590
+ const env2 = getEnv();
4591
+ const jsonData = {
4592
+ method,
4593
+ with_context: {
4594
+ token
4595
+ }
4596
+ };
4597
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4598
+ headers: {
4599
+ "Content-Type": "application/json"
4600
+ }
4755
4601
  });
4756
4602
  },
4757
- verifyTotp(_0) {
4758
- return __async(this, arguments, function* ({
4603
+ async verifyTotp({
4604
+ method,
4605
+ action_token,
4606
+ code
4607
+ }) {
4608
+ const env2 = getEnv();
4609
+ const jsonData = {
4759
4610
  method,
4760
- action_token,
4761
- code
4762
- }) {
4763
- const env2 = getEnv();
4764
- const jsonData = {
4765
- method,
4766
- kwargs: {
4767
- vals: {
4768
- code
4769
- }
4770
- },
4771
- with_context: {
4772
- action_token
4773
- }
4774
- };
4775
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4776
- headers: {
4777
- "Content-Type": "application/json"
4611
+ kwargs: {
4612
+ vals: {
4613
+ code
4778
4614
  }
4779
- });
4615
+ },
4616
+ with_context: {
4617
+ action_token
4618
+ }
4619
+ };
4620
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4621
+ headers: {
4622
+ "Content-Type": "application/json"
4623
+ }
4780
4624
  });
4781
4625
  },
4782
- removeTotpSetUp(_0) {
4783
- return __async(this, arguments, function* ({ method, token }) {
4784
- const env2 = getEnv();
4785
- const jsonData = {
4786
- method,
4787
- with_context: {
4788
- token
4789
- }
4790
- };
4791
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
4792
- headers: {
4793
- "Content-Type": "application/json"
4794
- }
4795
- });
4626
+ async removeTotpSetUp({ method, token }) {
4627
+ const env2 = getEnv();
4628
+ const jsonData = {
4629
+ method,
4630
+ with_context: {
4631
+ token
4632
+ }
4633
+ };
4634
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
4635
+ headers: {
4636
+ "Content-Type": "application/json"
4637
+ }
4796
4638
  });
4797
4639
  }
4798
4640
  };
@@ -4828,7 +4670,7 @@ import { useMutation as useMutation3 } from "@tanstack/react-query";
4828
4670
  var useGetProvider = () => {
4829
4671
  return useMutation3({
4830
4672
  mutationFn: (data) => {
4831
- return auth_service_default.getProviders(data == null ? void 0 : data.db);
4673
+ return auth_service_default.getProviders(data?.db);
4832
4674
  }
4833
4675
  });
4834
4676
  };
@@ -4930,19 +4772,33 @@ var useGetAccessByCode = () => {
4930
4772
  };
4931
4773
  var use_get_access_by_code_default = useGetAccessByCode;
4932
4774
 
4933
- // src/hooks/company/use-get-company-info.ts
4775
+ // src/hooks/auth/use-validate-action-token.ts
4934
4776
  import { useMutation as useMutation12 } from "@tanstack/react-query";
4935
- var useGetCompanyInfo = () => {
4777
+ var useValidateActionToken = () => {
4936
4778
  return useMutation12({
4779
+ mutationFn: ({
4780
+ actionToken,
4781
+ path
4782
+ }) => {
4783
+ return auth_service_default.isValidActionToken(actionToken, path);
4784
+ }
4785
+ });
4786
+ };
4787
+ var use_validate_action_token_default = useValidateActionToken;
4788
+
4789
+ // src/hooks/company/use-get-company-info.ts
4790
+ import { useMutation as useMutation13 } from "@tanstack/react-query";
4791
+ var useGetCompanyInfo = () => {
4792
+ return useMutation13({
4937
4793
  mutationFn: (id) => company_service_default.getInfoCompany(id)
4938
4794
  });
4939
4795
  };
4940
4796
  var use_get_company_info_default = useGetCompanyInfo;
4941
4797
 
4942
4798
  // src/hooks/company/use-get-current-company.ts
4943
- import { useMutation as useMutation13 } from "@tanstack/react-query";
4799
+ import { useMutation as useMutation14 } from "@tanstack/react-query";
4944
4800
  var useGetCurrentCompany = () => {
4945
- return useMutation13({
4801
+ return useMutation14({
4946
4802
  mutationFn: () => company_service_default.getCurrentCompany()
4947
4803
  });
4948
4804
  };
@@ -4969,9 +4825,9 @@ var useGetListCompany = (companyIDs = []) => {
4969
4825
  var use_get_list_company_default = useGetListCompany;
4970
4826
 
4971
4827
  // src/hooks/excel/use-export-excel.ts
4972
- import { useMutation as useMutation14 } from "@tanstack/react-query";
4828
+ import { useMutation as useMutation15 } from "@tanstack/react-query";
4973
4829
  var useExportExcel = () => {
4974
- return useMutation14({
4830
+ return useMutation15({
4975
4831
  mutationFn: ({
4976
4832
  model,
4977
4833
  domain,
@@ -4996,9 +4852,9 @@ var useExportExcel = () => {
4996
4852
  var use_export_excel_default = useExportExcel;
4997
4853
 
4998
4854
  // src/hooks/excel/use-get-field-export.ts
4999
- import { useMutation as useMutation15 } from "@tanstack/react-query";
4855
+ import { useMutation as useMutation16 } from "@tanstack/react-query";
5000
4856
  var useGetFieldExport = () => {
5001
- return useMutation15({
4857
+ return useMutation16({
5002
4858
  mutationFn: ({
5003
4859
  ids,
5004
4860
  model,
@@ -5045,9 +4901,9 @@ var useGetFileExcel = ({ model }) => {
5045
4901
  var use_get_file_excel_default = useGetFileExcel;
5046
4902
 
5047
4903
  // src/hooks/excel/use-parse-preview.ts
5048
- import { useMutation as useMutation16 } from "@tanstack/react-query";
4904
+ import { useMutation as useMutation17 } from "@tanstack/react-query";
5049
4905
  var useParsePreview = () => {
5050
- return useMutation16({
4906
+ return useMutation17({
5051
4907
  mutationFn: ({
5052
4908
  id,
5053
4909
  selectedSheet,
@@ -5064,9 +4920,9 @@ var useParsePreview = () => {
5064
4920
  var use_parse_preview_default = useParsePreview;
5065
4921
 
5066
4922
  // src/hooks/excel/use-upload-file.ts
5067
- import { useMutation as useMutation17 } from "@tanstack/react-query";
4923
+ import { useMutation as useMutation18 } from "@tanstack/react-query";
5068
4924
  var useUploadFile = () => {
5069
- return useMutation17({
4925
+ return useMutation18({
5070
4926
  mutationFn: ({ formData }) => excel_service_default.uploadFile({
5071
4927
  formData
5072
4928
  })
@@ -5075,9 +4931,9 @@ var useUploadFile = () => {
5075
4931
  var use_upload_file_default = useUploadFile;
5076
4932
 
5077
4933
  // src/hooks/excel/use-upload-id-file.ts
5078
- import { useMutation as useMutation18 } from "@tanstack/react-query";
4934
+ import { useMutation as useMutation19 } from "@tanstack/react-query";
5079
4935
  var useUploadIdFile = () => {
5080
- return useMutation18({
4936
+ return useMutation19({
5081
4937
  mutationFn: ({ formData }) => excel_service_default.uploadIdFile({
5082
4938
  formData
5083
4939
  })
@@ -5086,9 +4942,9 @@ var useUploadIdFile = () => {
5086
4942
  var use_upload_id_file_default = useUploadIdFile;
5087
4943
 
5088
4944
  // src/hooks/excel/uss-execute-import.ts
5089
- import { useMutation as useMutation19 } from "@tanstack/react-query";
4945
+ import { useMutation as useMutation20 } from "@tanstack/react-query";
5090
4946
  var useExecuteImport = () => {
5091
- return useMutation19({
4947
+ return useMutation20({
5092
4948
  mutationFn: ({
5093
4949
  fields,
5094
4950
  columns,
@@ -5109,9 +4965,9 @@ var useExecuteImport = () => {
5109
4965
  var uss_execute_import_default = useExecuteImport;
5110
4966
 
5111
4967
  // src/hooks/form/use-change-status.ts
5112
- import { useMutation as useMutation20 } from "@tanstack/react-query";
4968
+ import { useMutation as useMutation21 } from "@tanstack/react-query";
5113
4969
  var useChangeStatus = () => {
5114
- return useMutation20({
4970
+ return useMutation21({
5115
4971
  mutationFn: ({ data }) => {
5116
4972
  return form_service_default.changeStatus({
5117
4973
  data
@@ -5122,9 +4978,9 @@ var useChangeStatus = () => {
5122
4978
  var use_change_status_default = useChangeStatus;
5123
4979
 
5124
4980
  // src/hooks/form/use-delete-comment.ts
5125
- import { useMutation as useMutation21 } from "@tanstack/react-query";
4981
+ import { useMutation as useMutation22 } from "@tanstack/react-query";
5126
4982
  var useDeleteComment = () => {
5127
- return useMutation21({
4983
+ return useMutation22({
5128
4984
  mutationFn: ({ data }) => form_service_default.deleteComment({
5129
4985
  data
5130
4986
  })
@@ -5189,9 +5045,9 @@ var useGetImage = ({
5189
5045
  var use_get_image_default = useGetImage;
5190
5046
 
5191
5047
  // src/hooks/form/use-send-comment.ts
5192
- import { useMutation as useMutation22 } from "@tanstack/react-query";
5048
+ import { useMutation as useMutation23 } from "@tanstack/react-query";
5193
5049
  var useSendComment = () => {
5194
- return useMutation22({
5050
+ return useMutation23({
5195
5051
  mutationFn: ({ data }) => form_service_default.sentComment({
5196
5052
  data
5197
5053
  })
@@ -5200,9 +5056,9 @@ var useSendComment = () => {
5200
5056
  var use_send_comment_default = useSendComment;
5201
5057
 
5202
5058
  // src/hooks/form/use-upload-image.ts
5203
- import { useMutation as useMutation23 } from "@tanstack/react-query";
5059
+ import { useMutation as useMutation24 } from "@tanstack/react-query";
5204
5060
  var useUploadImage = () => {
5205
- return useMutation23({
5061
+ return useMutation24({
5206
5062
  mutationFn: ({ data }) => form_service_default.uploadImage({
5207
5063
  data
5208
5064
  })
@@ -5211,9 +5067,9 @@ var useUploadImage = () => {
5211
5067
  var use_upload_image_default = useUploadImage;
5212
5068
 
5213
5069
  // src/hooks/model/use-delete.ts
5214
- import { useMutation as useMutation24 } from "@tanstack/react-query";
5070
+ import { useMutation as useMutation25 } from "@tanstack/react-query";
5215
5071
  var useDelete = () => {
5216
- return useMutation24({
5072
+ return useMutation25({
5217
5073
  mutationFn: ({ ids, model }) => model_service_default.delete({ ids, model })
5218
5074
  });
5219
5075
  };
@@ -5267,9 +5123,9 @@ var useGetCurrency = () => {
5267
5123
  var use_get_currency_default = useGetCurrency;
5268
5124
 
5269
5125
  // src/hooks/model/use-get-detail.ts
5270
- import { useMutation as useMutation25 } from "@tanstack/react-query";
5126
+ import { useMutation as useMutation26 } from "@tanstack/react-query";
5271
5127
  var useGetDetail = () => {
5272
- return useMutation25({
5128
+ return useMutation26({
5273
5129
  mutationFn: ({
5274
5130
  model,
5275
5131
  ids,
@@ -5328,6 +5184,10 @@ var use_get_list_my_bank_account_default = useGetListMyBankAccount;
5328
5184
 
5329
5185
  // src/models/base-model/index.ts
5330
5186
  var BaseModel = class {
5187
+ name;
5188
+ view;
5189
+ actContext;
5190
+ fields;
5331
5191
  constructor(init) {
5332
5192
  this.name = init.name;
5333
5193
  this.view = init.view;
@@ -5342,22 +5202,21 @@ var BaseModel = class {
5342
5202
  modelRoot
5343
5203
  }) {
5344
5204
  if (Array.isArray(fields)) {
5345
- let spec = __spreadValues({}, specification);
5205
+ let spec = { ...specification };
5346
5206
  fields.forEach((field) => {
5347
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
5348
- if (!(field == null ? void 0 : field.type_co) || (field == null ? void 0 : field.name) && (field == null ? void 0 : field.type_co) === "field" /* FIELD */) {
5349
- if ((_a = modelsData == null ? void 0 : modelsData[model]) == null ? void 0 : _a[field == null ? void 0 : field.name]) {
5350
- if (((_c = (_b = modelsData == null ? void 0 : modelsData[model]) == null ? void 0 : _b[field == null ? void 0 : field.name]) == null ? void 0 : _c.type) === "one2many" /* ONE2MANY */ || ((_e = (_d = modelsData == null ? void 0 : modelsData[model]) == null ? void 0 : _d[field == null ? void 0 : field.name]) == null ? void 0 : _e.type) === "many2many" /* MANY2MANY */) {
5351
- const relation = (_g = (_f = modelsData == null ? void 0 : modelsData[model]) == null ? void 0 : _f[field == null ? void 0 : field.name]) == null ? void 0 : _g.relation;
5352
- const modelRelation = modelsData == null ? void 0 : modelsData[relation];
5207
+ if (!field?.type_co || field?.name && field?.type_co === "field" /* FIELD */) {
5208
+ if (modelsData?.[model]?.[field?.name]) {
5209
+ if (modelsData?.[model]?.[field?.name]?.type === "one2many" /* ONE2MANY */ || modelsData?.[model]?.[field?.name]?.type === "many2many" /* MANY2MANY */) {
5210
+ const relation = modelsData?.[model]?.[field?.name]?.relation;
5211
+ const modelRelation = modelsData?.[relation];
5353
5212
  if (modelRelation) {
5354
- spec[field == null ? void 0 : field.name] = {
5213
+ spec[field?.name] = {
5355
5214
  fields: {}
5356
5215
  };
5357
5216
  if (modelRoot && modelRoot === relation) {
5358
- spec[field == null ? void 0 : field.name].fields = { id: {} };
5217
+ spec[field?.name].fields = { id: {} };
5359
5218
  } else {
5360
- spec[field == null ? void 0 : field.name].fields = this.getSpecificationByFields({
5219
+ spec[field?.name].fields = this.getSpecificationByFields({
5361
5220
  fields: Object.values(modelRelation),
5362
5221
  specification: {},
5363
5222
  modelsData,
@@ -5366,42 +5225,45 @@ var BaseModel = class {
5366
5225
  });
5367
5226
  }
5368
5227
  } else {
5369
- spec[field == null ? void 0 : field.name] = {
5228
+ spec[field?.name] = {
5370
5229
  fields: {
5371
5230
  id: {},
5372
5231
  display_name: {}
5373
5232
  }
5374
5233
  };
5375
5234
  }
5376
- } else if (((_i = (_h = modelsData == null ? void 0 : modelsData[model]) == null ? void 0 : _h[field == null ? void 0 : field.name]) == null ? void 0 : _i.type) === "many2one" /* MANY2ONE */) {
5377
- spec[field == null ? void 0 : field.name] = {
5378
- fields: __spreadValues(__spreadValues(__spreadValues({
5235
+ } else if (modelsData?.[model]?.[field?.name]?.type === "many2one" /* MANY2ONE */) {
5236
+ spec[field?.name] = {
5237
+ fields: {
5379
5238
  id: {},
5380
- display_name: {}
5381
- }, WIDGETAVATAR[field == null ? void 0 : field.widget] ? { image_256: {} } : {}), (field == null ? void 0 : field.name) === "currency_id" && (fields == null ? void 0 : fields.find((item) => (item == null ? void 0 : item.widget) === "monetary")) ? { symbol: {} } : {}), (field == null ? void 0 : field.widget) === "many2many_binary" ? { mimetype: {} } : {})
5239
+ display_name: {},
5240
+ ...WIDGETAVATAR[field?.widget] ? { image_256: {} } : {},
5241
+ ...field?.name === "currency_id" && fields?.find((item) => item?.widget === "monetary") ? { symbol: {} } : {},
5242
+ ...field?.widget === "many2many_binary" ? { mimetype: {} } : {}
5243
+ }
5382
5244
  };
5383
5245
  } else {
5384
- spec[field == null ? void 0 : field.name] = {};
5246
+ spec[field?.name] = {};
5385
5247
  }
5386
5248
  }
5387
- } else if ((field == null ? void 0 : field.type_co) === "group" /* GROUP */ || (field == null ? void 0 : field.type_co) === "div" /* DIV */ || (field == null ? void 0 : field.type_co) === "span" /* SPAN */) {
5249
+ } else if (field?.type_co === "group" /* GROUP */ || field?.type_co === "div" /* DIV */ || field?.type_co === "span" /* SPAN */) {
5388
5250
  const specGroup = this.getSpecificationByFields({
5389
- fields: field == null ? void 0 : field.fields,
5251
+ fields: field?.fields,
5390
5252
  specification: spec,
5391
5253
  modelsData,
5392
5254
  model
5393
5255
  });
5394
- spec = __spreadValues(__spreadValues({}, spec), specGroup);
5395
- } else if ((field == null ? void 0 : field.type_co) === "tree" /* TREE */ || (field == null ? void 0 : field.type_co) === "list" /* LIST */) {
5396
- const relation = (_k = (_j = modelsData == null ? void 0 : modelsData[model]) == null ? void 0 : _j[field == null ? void 0 : field.name]) == null ? void 0 : _k.relation;
5256
+ spec = { ...spec, ...specGroup };
5257
+ } else if (field?.type_co === "tree" /* TREE */ || field?.type_co === "list" /* LIST */) {
5258
+ const relation = modelsData?.[model]?.[field?.name]?.relation;
5397
5259
  const specTreee = this.getSpecificationByFields({
5398
- fields: field == null ? void 0 : field.fields,
5260
+ fields: field?.fields,
5399
5261
  specification: {},
5400
5262
  modelsData,
5401
5263
  model: relation,
5402
5264
  modelRoot: model
5403
5265
  });
5404
- spec = __spreadProps(__spreadValues({}, spec), { [field == null ? void 0 : field.name]: { fields: specTreee } });
5266
+ spec = { ...spec, [field?.name]: { fields: specTreee } };
5405
5267
  }
5406
5268
  });
5407
5269
  return spec;
@@ -5410,19 +5272,16 @@ var BaseModel = class {
5410
5272
  }
5411
5273
  }
5412
5274
  getTreeProps() {
5413
- var _a, _b;
5414
- const props = ((_b = (_a = this.view) == null ? void 0 : _a.views) == null ? void 0 : _b.list) || {};
5275
+ const props = this.view?.views?.list || {};
5415
5276
  return props;
5416
5277
  }
5417
5278
  getTreeFields() {
5418
- var _a, _b, _c;
5419
- const fields = ((_c = (_b = (_a = this.view) == null ? void 0 : _a.views) == null ? void 0 : _b.list) == null ? void 0 : _c.fields) || [];
5279
+ const fields = this.view?.views?.list?.fields || [];
5420
5280
  return fields;
5421
5281
  }
5422
5282
  getSpecification() {
5423
- var _a;
5424
5283
  const specInit = {};
5425
- const modelData = ((_a = this.view) == null ? void 0 : _a.models) || {};
5284
+ const modelData = this.view?.models || {};
5426
5285
  const specification = this.getSpecificationByFields({
5427
5286
  fields: this.fields,
5428
5287
  specification: specInit,
@@ -5438,7 +5297,7 @@ var base_model_default = BaseModel;
5438
5297
  // src/hooks/model/use-model.ts
5439
5298
  var useModel = () => {
5440
5299
  const initModel = (modelData) => {
5441
- switch (modelData == null ? void 0 : modelData.name) {
5300
+ switch (modelData?.name) {
5442
5301
  default:
5443
5302
  return new base_model_default(modelData);
5444
5303
  }
@@ -5459,9 +5318,9 @@ var useOdooDataTransform = () => {
5459
5318
  var use_odoo_data_transform_default = useOdooDataTransform;
5460
5319
 
5461
5320
  // src/hooks/model/use-onchange-form.ts
5462
- import { useMutation as useMutation26 } from "@tanstack/react-query";
5321
+ import { useMutation as useMutation27 } from "@tanstack/react-query";
5463
5322
  var useOnChangeForm = () => {
5464
- return useMutation26({
5323
+ return useMutation27({
5465
5324
  mutationFn: ({
5466
5325
  ids,
5467
5326
  model,
@@ -5482,9 +5341,9 @@ var useOnChangeForm = () => {
5482
5341
  var use_onchange_form_default = useOnChangeForm;
5483
5342
 
5484
5343
  // src/hooks/model/use-save.ts
5485
- import { useMutation as useMutation27 } from "@tanstack/react-query";
5344
+ import { useMutation as useMutation28 } from "@tanstack/react-query";
5486
5345
  var useSave = () => {
5487
- return useMutation27({
5346
+ return useMutation28({
5488
5347
  mutationFn: ({
5489
5348
  ids,
5490
5349
  model,
@@ -5498,18 +5357,18 @@ var useSave = () => {
5498
5357
  var use_save_default = useSave;
5499
5358
 
5500
5359
  // src/hooks/user/use-get-profile.ts
5501
- import { useMutation as useMutation28 } from "@tanstack/react-query";
5360
+ import { useMutation as useMutation29 } from "@tanstack/react-query";
5502
5361
  var useGetProfile = (path) => {
5503
- return useMutation28({
5362
+ return useMutation29({
5504
5363
  mutationFn: () => user_service_default.getProfile(path)
5505
5364
  });
5506
5365
  };
5507
5366
  var use_get_profile_default = useGetProfile;
5508
5367
 
5509
5368
  // src/hooks/user/use-get-user.ts
5510
- import { useMutation as useMutation29 } from "@tanstack/react-query";
5369
+ import { useMutation as useMutation30 } from "@tanstack/react-query";
5511
5370
  var useGetUser = () => {
5512
- return useMutation29({
5371
+ return useMutation30({
5513
5372
  mutationFn: ({ id, context }) => user_service_default.getUser({
5514
5373
  id,
5515
5374
  context
@@ -5519,9 +5378,9 @@ var useGetUser = () => {
5519
5378
  var use_get_user_default = useGetUser;
5520
5379
 
5521
5380
  // src/hooks/user/use-switch-locale.ts
5522
- import { useMutation as useMutation30 } from "@tanstack/react-query";
5381
+ import { useMutation as useMutation31 } from "@tanstack/react-query";
5523
5382
  var useSwitchLocale = () => {
5524
- return useMutation30({
5383
+ return useMutation31({
5525
5384
  mutationFn: ({ data }) => {
5526
5385
  return user_service_default.switchUserLocale({
5527
5386
  id: data.id,
@@ -5533,9 +5392,9 @@ var useSwitchLocale = () => {
5533
5392
  var use_switch_locale_default = useSwitchLocale;
5534
5393
 
5535
5394
  // src/hooks/view/use-button.ts
5536
- import { useMutation as useMutation31 } from "@tanstack/react-query";
5395
+ import { useMutation as useMutation32 } from "@tanstack/react-query";
5537
5396
  var useButton = () => {
5538
- return useMutation31({
5397
+ return useMutation32({
5539
5398
  mutationFn: ({
5540
5399
  model,
5541
5400
  ids,
@@ -5555,9 +5414,9 @@ var useButton = () => {
5555
5414
  var use_button_default = useButton;
5556
5415
 
5557
5416
  // src/hooks/view/use-duplicate-record.ts
5558
- import { useMutation as useMutation32 } from "@tanstack/react-query";
5417
+ import { useMutation as useMutation33 } from "@tanstack/react-query";
5559
5418
  var useDuplicateRecord = () => {
5560
- return useMutation32({
5419
+ return useMutation33({
5561
5420
  mutationFn: ({
5562
5421
  id,
5563
5422
  model,
@@ -5583,22 +5442,22 @@ var useGetActionDetail = ({
5583
5442
  }) => {
5584
5443
  const data = {
5585
5444
  id,
5586
- model: model != null ? model : "",
5445
+ model: model ?? "",
5587
5446
  context
5588
5447
  };
5589
5448
  return useQuery11({
5590
5449
  queryKey,
5591
- queryFn: () => __async(null, null, function* () {
5450
+ queryFn: async () => {
5592
5451
  if (aid) {
5593
- const res = yield view_service_default.getActionDetail(aid, context);
5452
+ const res = await view_service_default.getActionDetail(aid, context);
5594
5453
  if (res && res.length > 0) {
5595
5454
  return res[0];
5596
5455
  }
5597
5456
  } else {
5598
- const res = yield form_service_default.getFormView({ data });
5457
+ const res = await form_service_default.getFormView({ data });
5599
5458
  return res;
5600
5459
  }
5601
- }),
5460
+ },
5602
5461
  enabled,
5603
5462
  refetchOnWindowFocus: false,
5604
5463
  staleTime: Infinity
@@ -5670,9 +5529,8 @@ var useGetMenu = (context, enabled) => {
5670
5529
  return useQuery15({
5671
5530
  queryKey: ["menus" /* MENU */, context],
5672
5531
  queryFn: () => view_service_default.getMenu(context).then((res) => {
5673
- var _a;
5674
- if (res && (res == null ? void 0 : res.records) && ((_a = res == null ? void 0 : res.records) == null ? void 0 : _a.length) > 0) {
5675
- return res == null ? void 0 : res.records;
5532
+ if (res && res?.records && res?.records?.length > 0) {
5533
+ return res?.records;
5676
5534
  }
5677
5535
  return [];
5678
5536
  }),
@@ -5684,9 +5542,9 @@ var useGetMenu = (context, enabled) => {
5684
5542
  var use_get_menu_default = useGetMenu;
5685
5543
 
5686
5544
  // src/hooks/view/use-get-print-report.ts
5687
- import { useMutation as useMutation33 } from "@tanstack/react-query";
5545
+ import { useMutation as useMutation34 } from "@tanstack/react-query";
5688
5546
  var useGetPrintReport = () => {
5689
- return useMutation33({
5547
+ return useMutation34({
5690
5548
  mutationFn: ({ id }) => action_service_default.getPrintReportName({
5691
5549
  id
5692
5550
  })
@@ -5750,9 +5608,9 @@ var useGetView = (viewParams, actData) => {
5750
5608
  var use_get_view_default = useGetView;
5751
5609
 
5752
5610
  // src/hooks/view/use-load-action.ts
5753
- import { useMutation as useMutation34 } from "@tanstack/react-query";
5611
+ import { useMutation as useMutation35 } from "@tanstack/react-query";
5754
5612
  var useLoadAction = () => {
5755
- return useMutation34({
5613
+ return useMutation35({
5756
5614
  mutationFn: ({
5757
5615
  idAction,
5758
5616
  context
@@ -5778,9 +5636,9 @@ var useLoadMessage = () => {
5778
5636
  var use_load_message_default = useLoadMessage;
5779
5637
 
5780
5638
  // src/hooks/view/use-print.ts
5781
- import { useMutation as useMutation35 } from "@tanstack/react-query";
5639
+ import { useMutation as useMutation36 } from "@tanstack/react-query";
5782
5640
  var usePrint = () => {
5783
- return useMutation35({
5641
+ return useMutation36({
5784
5642
  mutationFn: ({ id, report, db }) => action_service_default.print({
5785
5643
  id,
5786
5644
  report,
@@ -5791,9 +5649,9 @@ var usePrint = () => {
5791
5649
  var use_print_default = usePrint;
5792
5650
 
5793
5651
  // src/hooks/view/use-remove-row.ts
5794
- import { useMutation as useMutation36 } from "@tanstack/react-query";
5652
+ import { useMutation as useMutation37 } from "@tanstack/react-query";
5795
5653
  var useRemoveRow = () => {
5796
- return useMutation36({
5654
+ return useMutation37({
5797
5655
  mutationFn: ({
5798
5656
  model,
5799
5657
  ids,
@@ -5825,9 +5683,9 @@ var useGetResequence = (model, resIds, context, offset) => {
5825
5683
  var use_resequence_default = useGetResequence;
5826
5684
 
5827
5685
  // src/hooks/view/use-run-action.ts
5828
- import { useMutation as useMutation37 } from "@tanstack/react-query";
5686
+ import { useMutation as useMutation38 } from "@tanstack/react-query";
5829
5687
  var useRunAction = () => {
5830
- return useMutation37({
5688
+ return useMutation38({
5831
5689
  mutationFn: ({
5832
5690
  idAction,
5833
5691
  context
@@ -5840,9 +5698,9 @@ var useRunAction = () => {
5840
5698
  var use_run_action_default = useRunAction;
5841
5699
 
5842
5700
  // src/hooks/view/use-signin-sso.ts
5843
- import { useMutation as useMutation38 } from "@tanstack/react-query";
5701
+ import { useMutation as useMutation39 } from "@tanstack/react-query";
5844
5702
  var useSignInSSO = () => {
5845
- return useMutation38({
5703
+ return useMutation39({
5846
5704
  mutationFn: ({
5847
5705
  redirect_uri,
5848
5706
  state,
@@ -5863,9 +5721,9 @@ var useSignInSSO = () => {
5863
5721
  var use_signin_sso_default = useSignInSSO;
5864
5722
 
5865
5723
  // src/hooks/view/use-verify-2FA.ts
5866
- import { useMutation as useMutation39 } from "@tanstack/react-query";
5724
+ import { useMutation as useMutation40 } from "@tanstack/react-query";
5867
5725
  var useVerify2FA = () => {
5868
- return useMutation39({
5726
+ return useMutation40({
5869
5727
  mutationFn: ({
5870
5728
  method,
5871
5729
  with_context,
@@ -5886,9 +5744,9 @@ var useVerify2FA = () => {
5886
5744
  var use_verify_2FA_default = useVerify2FA;
5887
5745
 
5888
5746
  // src/hooks/view/uset-get-2FA-method.ts
5889
- import { useMutation as useMutation40 } from "@tanstack/react-query";
5747
+ import { useMutation as useMutation41 } from "@tanstack/react-query";
5890
5748
  var useGet2FAMethods = () => {
5891
- return useMutation40({
5749
+ return useMutation41({
5892
5750
  mutationFn: ({
5893
5751
  method,
5894
5752
  with_context
@@ -5903,9 +5761,9 @@ var useGet2FAMethods = () => {
5903
5761
  var uset_get_2FA_method_default = useGet2FAMethods;
5904
5762
 
5905
5763
  // src/hooks/view/use-get-fields-view-security.ts
5906
- import { useMutation as useMutation41 } from "@tanstack/react-query";
5764
+ import { useMutation as useMutation42 } from "@tanstack/react-query";
5907
5765
  var useGetFieldsViewSecurity = () => {
5908
- return useMutation41({
5766
+ return useMutation42({
5909
5767
  mutationFn: ({
5910
5768
  method,
5911
5769
  token,
@@ -5922,9 +5780,9 @@ var useGetFieldsViewSecurity = () => {
5922
5780
  var use_get_fields_view_security_default = useGetFieldsViewSecurity;
5923
5781
 
5924
5782
  // src/hooks/view/use-grant-access.ts
5925
- import { useMutation as useMutation42 } from "@tanstack/react-query";
5783
+ import { useMutation as useMutation43 } from "@tanstack/react-query";
5926
5784
  var useGrantAccess = () => {
5927
- return useMutation42({
5785
+ return useMutation43({
5928
5786
  mutationFn: ({
5929
5787
  redirect_uri,
5930
5788
  state,
@@ -5943,9 +5801,9 @@ var useGrantAccess = () => {
5943
5801
  var use_grant_access_default = useGrantAccess;
5944
5802
 
5945
5803
  // src/hooks/view/use-remove-totp-setup.ts
5946
- import { useMutation as useMutation43 } from "@tanstack/react-query";
5804
+ import { useMutation as useMutation44 } from "@tanstack/react-query";
5947
5805
  var useRemoveTotpSetup = () => {
5948
- return useMutation43({
5806
+ return useMutation44({
5949
5807
  mutationFn: ({ method, token }) => {
5950
5808
  return view_service_default.removeTotpSetUp({
5951
5809
  method,
@@ -5957,9 +5815,9 @@ var useRemoveTotpSetup = () => {
5957
5815
  var use_remove_totp_setup_default = useRemoveTotpSetup;
5958
5816
 
5959
5817
  // src/hooks/view/use-request-setup-totp.ts
5960
- import { useMutation as useMutation44 } from "@tanstack/react-query";
5818
+ import { useMutation as useMutation45 } from "@tanstack/react-query";
5961
5819
  var useRequestSetupTotp = () => {
5962
- return useMutation44({
5820
+ return useMutation45({
5963
5821
  mutationFn: ({ method, token }) => {
5964
5822
  return view_service_default.requestSetupTotp({
5965
5823
  method,
@@ -5971,9 +5829,9 @@ var useRequestSetupTotp = () => {
5971
5829
  var use_request_setup_totp_default = useRequestSetupTotp;
5972
5830
 
5973
5831
  // src/hooks/view/use-settings-web-read-2fa.ts
5974
- import { useMutation as useMutation45 } from "@tanstack/react-query";
5832
+ import { useMutation as useMutation46 } from "@tanstack/react-query";
5975
5833
  var useSettingsWebRead2fa = () => {
5976
- return useMutation45({
5834
+ return useMutation46({
5977
5835
  mutationFn: ({
5978
5836
  method,
5979
5837
  token,
@@ -5992,9 +5850,9 @@ var useSettingsWebRead2fa = () => {
5992
5850
  var use_settings_web_read_2fa_default = useSettingsWebRead2fa;
5993
5851
 
5994
5852
  // src/hooks/view/use-verify-totp.ts
5995
- import { useMutation as useMutation46 } from "@tanstack/react-query";
5853
+ import { useMutation as useMutation47 } from "@tanstack/react-query";
5996
5854
  var useVerifyTotp = () => {
5997
- return useMutation46({
5855
+ return useMutation47({
5998
5856
  mutationFn: ({
5999
5857
  method,
6000
5858
  action_token,
@@ -6076,6 +5934,7 @@ export {
6076
5934
  use_upload_file_default as useUploadFile,
6077
5935
  use_upload_id_file_default as useUploadIdFile,
6078
5936
  use_upload_image_default as useUploadImage,
5937
+ use_validate_action_token_default as useValidateActionToken,
6079
5938
  use_verify_2FA_default as useVerify2FA,
6080
5939
  use_verify_totp_default as useVerifyTotp
6081
5940
  };