@fctc/interface-logic 1.5.5 → 1.5.7

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.
Files changed (33) hide show
  1. package/dist/{configs.mjs → configs.cjs} +152 -105
  2. package/dist/{configs.d.mts → configs.d.cts} +1 -1
  3. package/dist/configs.js +115 -140
  4. package/dist/{constants.mjs → constants.cjs} +40 -2
  5. package/dist/constants.js +2 -41
  6. package/dist/{environment.mjs → environment.cjs} +208 -154
  7. package/dist/environment.js +167 -189
  8. package/dist/{hooks.mjs → hooks.cjs} +1893 -1627
  9. package/dist/{hooks.d.mts → hooks.d.cts} +1 -1
  10. package/dist/hooks.js +1788 -1726
  11. package/dist/{provider.mjs → provider.cjs} +648 -557
  12. package/dist/{provider.d.mts → provider.d.cts} +4 -3
  13. package/dist/provider.d.ts +4 -3
  14. package/dist/provider.js +608 -591
  15. package/dist/{services.mjs → services.cjs} +1607 -1398
  16. package/dist/{services.d.mts → services.d.cts} +1 -1
  17. package/dist/services.js +1560 -1437
  18. package/dist/{store.mjs → store.cjs} +148 -30
  19. package/dist/{store.d.mts → store.d.cts} +127 -127
  20. package/dist/store.d.ts +127 -127
  21. package/dist/store.js +43 -131
  22. package/dist/types.cjs +17 -0
  23. package/dist/{types.d.mts → types.d.cts} +1 -1
  24. package/dist/types.js +0 -18
  25. package/dist/{utils.mjs → utils.cjs} +202 -115
  26. package/dist/{utils.d.mts → utils.d.cts} +2 -2
  27. package/dist/utils.d.ts +2 -2
  28. package/dist/utils.js +135 -176
  29. package/package.json +23 -11
  30. package/dist/types.mjs +0 -0
  31. /package/dist/{constants.d.mts → constants.d.cts} +0 -0
  32. /package/dist/{environment.d.mts → environment.d.cts} +0 -0
  33. /package/dist/{view-type-BGJfDe73.d.mts → view-type-BGJfDe73.d.cts} +0 -0
package/dist/provider.js CHANGED
@@ -1,46 +1,49 @@
1
- "use strict";
2
- var __create = Object.create;
3
1
  var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
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;
11
19
  };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
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
+ });
19
40
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/provider.ts
31
- var provider_exports = {};
32
- __export(provider_exports, {
33
- MainProvider: () => MainProvider,
34
- ReactQueryProvider: () => ReactQueryProvider,
35
- VersionGate: () => VersionGate
36
- });
37
- module.exports = __toCommonJS(provider_exports);
38
41
 
39
42
  // src/provider/react-query-provider.tsx
40
- var import_react_query = require("@tanstack/react-query");
41
- var import_jsx_runtime = require("react/jsx-runtime");
43
+ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
44
+ import { jsx } from "react/jsx-runtime";
42
45
  var ReactQueryProvider = ({ children }) => {
43
- const queryClient = new import_react_query.QueryClient({
46
+ const queryClient = new QueryClient({
44
47
  defaultOptions: {
45
48
  queries: {
46
49
  // placeholderData: keepPreviousData,
@@ -51,21 +54,21 @@ var ReactQueryProvider = ({ children }) => {
51
54
  }
52
55
  }
53
56
  });
54
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_query.QueryClientProvider, { client: queryClient, children });
57
+ return /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children });
55
58
  };
56
59
 
57
60
  // src/provider/redux-provider.tsx
58
- var import_react_redux2 = require("react-redux");
61
+ import { Provider } from "react-redux";
59
62
 
60
63
  // src/store/index.ts
61
- var import_react_redux = require("react-redux");
64
+ import { useDispatch, useSelector } from "react-redux";
62
65
 
63
66
  // src/store/reducers/breadcrums-slice/index.ts
64
- var import_toolkit = require("@reduxjs/toolkit");
67
+ import { createSlice } from "@reduxjs/toolkit";
65
68
  var initialState = {
66
69
  breadCrumbs: []
67
70
  };
68
- var breadcrumbsSlice = (0, import_toolkit.createSlice)({
71
+ var breadcrumbsSlice = createSlice({
69
72
  name: "breadcrumbs",
70
73
  initialState,
71
74
  reducers: {
@@ -78,7 +81,7 @@ var { setBreadCrumbs } = breadcrumbsSlice.actions;
78
81
  var breadcrums_slice_default = breadcrumbsSlice.reducer;
79
82
 
80
83
  // src/store/reducers/env-slice/index.ts
81
- var import_toolkit2 = require("@reduxjs/toolkit");
84
+ import { createSlice as createSlice2 } from "@reduxjs/toolkit";
82
85
  var initialState2 = {
83
86
  baseUrl: "",
84
87
  requests: null,
@@ -99,7 +102,7 @@ var initialState2 = {
99
102
  tz: "Asia/Saigon"
100
103
  }
101
104
  };
102
- var envSlice = (0, import_toolkit2.createSlice)({
105
+ var envSlice = createSlice2({
103
106
  name: "env",
104
107
  initialState: initialState2,
105
108
  reducers: {
@@ -146,7 +149,7 @@ var {
146
149
  var env_slice_default = envSlice.reducer;
147
150
 
148
151
  // src/store/reducers/excel-slice/index.ts
149
- var import_toolkit3 = require("@reduxjs/toolkit");
152
+ import { createSlice as createSlice3 } from "@reduxjs/toolkit";
150
153
  var initialState3 = {
151
154
  dataParse: null,
152
155
  idFile: null,
@@ -155,7 +158,7 @@ var initialState3 = {
155
158
  selectedFile: null,
156
159
  errorData: null
157
160
  };
158
- var excelSlice = (0, import_toolkit3.createSlice)({
161
+ var excelSlice = createSlice3({
159
162
  name: "excel",
160
163
  initialState: initialState3,
161
164
  reducers: {
@@ -190,7 +193,7 @@ var {
190
193
  var excel_slice_default = excelSlice.reducer;
191
194
 
192
195
  // src/store/reducers/form-slice/index.ts
193
- var import_toolkit4 = require("@reduxjs/toolkit");
196
+ import { createSlice as createSlice4 } from "@reduxjs/toolkit";
194
197
  var initialState4 = {
195
198
  viewDataStore: {},
196
199
  isShowingModalDetail: false,
@@ -200,7 +203,7 @@ var initialState4 = {
200
203
  listSubject: {},
201
204
  dataUser: {}
202
205
  };
203
- var formSlice = (0, import_toolkit4.createSlice)({
206
+ var formSlice = createSlice4({
204
207
  name: "form",
205
208
  initialState: initialState4,
206
209
  reducers: {
@@ -239,15 +242,15 @@ var {
239
242
  var form_slice_default = formSlice.reducer;
240
243
 
241
244
  // src/store/reducers/header-slice/index.ts
242
- var import_toolkit5 = require("@reduxjs/toolkit");
243
- var headerSlice = (0, import_toolkit5.createSlice)({
245
+ import { createSlice as createSlice5 } from "@reduxjs/toolkit";
246
+ var headerSlice = createSlice5({
244
247
  name: "header",
245
248
  initialState: {
246
249
  value: { allowedCompanyIds: [] }
247
250
  },
248
251
  reducers: {
249
252
  setHeader: (state, action) => {
250
- state.value = { ...state.value, ...action.payload };
253
+ state.value = __spreadValues(__spreadValues({}, state.value), action.payload);
251
254
  },
252
255
  setAllowedCompanyIds: (state, action) => {
253
256
  state.value.allowedCompanyIds = action.payload;
@@ -258,7 +261,7 @@ var { setAllowedCompanyIds, setHeader } = headerSlice.actions;
258
261
  var header_slice_default = headerSlice.reducer;
259
262
 
260
263
  // src/store/reducers/list-slice/index.ts
261
- var import_toolkit6 = require("@reduxjs/toolkit");
264
+ import { createSlice as createSlice6 } from "@reduxjs/toolkit";
262
265
  var initialState5 = {
263
266
  pageLimit: 10,
264
267
  fields: {},
@@ -272,7 +275,7 @@ var initialState5 = {
272
275
  page: 0,
273
276
  domainTable: []
274
277
  };
275
- var listSlice = (0, import_toolkit6.createSlice)({
278
+ var listSlice = createSlice6({
276
279
  name: "list",
277
280
  initialState: initialState5,
278
281
  reducers: {
@@ -323,13 +326,13 @@ var {
323
326
  var list_slice_default = listSlice.reducer;
324
327
 
325
328
  // src/store/reducers/login-slice/index.ts
326
- var import_toolkit7 = require("@reduxjs/toolkit");
329
+ import { createSlice as createSlice7 } from "@reduxjs/toolkit";
327
330
  var initialState6 = {
328
331
  db: "",
329
332
  redirectTo: "/",
330
333
  forgotPasswordUrl: "/"
331
334
  };
332
- var loginSlice = (0, import_toolkit7.createSlice)({
335
+ var loginSlice = createSlice7({
333
336
  name: "login",
334
337
  initialState: initialState6,
335
338
  reducers: {
@@ -348,14 +351,14 @@ var { setDb, setRedirectTo, setForgotPasswordUrl } = loginSlice.actions;
348
351
  var login_slice_default = loginSlice.reducer;
349
352
 
350
353
  // src/store/reducers/navbar-slice/index.ts
351
- var import_toolkit8 = require("@reduxjs/toolkit");
354
+ import { createSlice as createSlice8 } from "@reduxjs/toolkit";
352
355
  var initialState7 = {
353
356
  menuFocus: {},
354
357
  menuAction: {},
355
358
  navbarWidth: 250,
356
359
  menuList: []
357
360
  };
358
- var navbarSlice = (0, import_toolkit8.createSlice)({
361
+ var navbarSlice = createSlice8({
359
362
  name: "navbar",
360
363
  initialState: initialState7,
361
364
  reducers: {
@@ -377,11 +380,11 @@ var { setMenuFocus, setMenuFocusAction, setNavbarWidth, setMenuList } = navbarSl
377
380
  var navbar_slice_default = navbarSlice.reducer;
378
381
 
379
382
  // src/store/reducers/profile-slice/index.ts
380
- var import_toolkit9 = require("@reduxjs/toolkit");
383
+ import { createSlice as createSlice9 } from "@reduxjs/toolkit";
381
384
  var initialState8 = {
382
385
  profile: {}
383
386
  };
384
- var profileSlice = (0, import_toolkit9.createSlice)({
387
+ var profileSlice = createSlice9({
385
388
  name: "profile",
386
389
  initialState: initialState8,
387
390
  reducers: {
@@ -394,7 +397,7 @@ var { setProfile } = profileSlice.actions;
394
397
  var profile_slice_default = profileSlice.reducer;
395
398
 
396
399
  // src/store/reducers/search-slice/index.ts
397
- var import_toolkit10 = require("@reduxjs/toolkit");
400
+ import { createSlice as createSlice10 } from "@reduxjs/toolkit";
398
401
  var initialState9 = {
399
402
  groupByDomain: null,
400
403
  searchBy: [],
@@ -406,7 +409,7 @@ var initialState9 = {
406
409
  filterBy: [],
407
410
  groupBy: []
408
411
  };
409
- var searchSlice = (0, import_toolkit10.createSlice)({
412
+ var searchSlice = createSlice10({
410
413
  name: "search",
411
414
  initialState: initialState9,
412
415
  reducers: {
@@ -480,7 +483,7 @@ var {
480
483
  var search_slice_default = searchSlice.reducer;
481
484
 
482
485
  // src/store/store.ts
483
- var import_toolkit11 = require("@reduxjs/toolkit");
486
+ import { configureStore } from "@reduxjs/toolkit";
484
487
 
485
488
  // node_modules/redux/dist/redux.mjs
486
489
  function formatProdErrorMessage(code) {
@@ -664,7 +667,7 @@ var rootReducer = combineReducers({
664
667
  excel: excel_slice_default,
665
668
  profile: profile_slice_default
666
669
  });
667
- var envStore = (0, import_toolkit11.configureStore)({
670
+ var envStore = configureStore({
668
671
  reducer: rootReducer,
669
672
  middleware: (getDefaultMiddleware) => getDefaultMiddleware({
670
673
  serializableCheck: false
@@ -672,26 +675,26 @@ var envStore = (0, import_toolkit11.configureStore)({
672
675
  });
673
676
 
674
677
  // src/provider/redux-provider.tsx
675
- var import_jsx_runtime2 = require("react/jsx-runtime");
678
+ import { jsx as jsx2 } from "react/jsx-runtime";
676
679
  var ReduxProvider = ({ children }) => {
677
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_redux2.Provider, { store: envStore, children });
680
+ return /* @__PURE__ */ jsx2(Provider, { store: envStore, children });
678
681
  };
679
682
 
680
683
  // src/provider/main-provider.tsx
681
- var import_jsx_runtime3 = require("react/jsx-runtime");
684
+ import { jsx as jsx3 } from "react/jsx-runtime";
682
685
  var MainProvider = ({ children }) => {
683
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReduxProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReactQueryProvider, { children }) });
686
+ return /* @__PURE__ */ jsx3(ReduxProvider, { children: /* @__PURE__ */ jsx3(ReactQueryProvider, { children }) });
684
687
  };
685
688
 
686
689
  // src/provider/version-gate-provider.tsx
687
- var import_react2 = require("react");
688
- var import_react_query2 = require("@tanstack/react-query");
690
+ import { useEffect as useEffect2, useState as useState2 } from "react";
691
+ import { useQueryClient } from "@tanstack/react-query";
689
692
 
690
693
  // src/configs/axios-client.ts
691
- var import_axios = __toESM(require("axios"));
694
+ import axios from "axios";
692
695
 
693
696
  // src/utils/format.ts
694
- var import_moment = __toESM(require("moment"));
697
+ import moment from "moment";
695
698
 
696
699
  // src/utils/domain/py_tokenizer.ts
697
700
  var TokenizerError = class extends Error {
@@ -1771,22 +1774,6 @@ var PyRelativeDelta = class _PyRelativeDelta {
1771
1774
  this.microsecond = params.microsecond;
1772
1775
  this.weekday = params.weekday;
1773
1776
  }
1774
- years;
1775
- months;
1776
- days;
1777
- hours;
1778
- minutes;
1779
- seconds;
1780
- microseconds;
1781
- leapDays;
1782
- year;
1783
- month;
1784
- day;
1785
- hour;
1786
- minute;
1787
- second;
1788
- microsecond;
1789
- weekday;
1790
1777
  negate() {
1791
1778
  return new _PyRelativeDelta(this, -1);
1792
1779
  }
@@ -1901,7 +1888,7 @@ function execOnIterable(iterable, func) {
1901
1888
  if (typeof iterable === "object" && !Array.isArray(iterable) && !(iterable instanceof Set)) {
1902
1889
  iterable = Object.keys(iterable);
1903
1890
  }
1904
- if (typeof iterable?.[Symbol.iterator] !== "function") {
1891
+ if (typeof (iterable == null ? void 0 : iterable[Symbol.iterator]) !== "function") {
1905
1892
  throw new EvaluationError("value not iterable");
1906
1893
  }
1907
1894
  return func(iterable);
@@ -2224,7 +2211,7 @@ function applyBinaryOp(ast, context) {
2224
2211
  }
2225
2212
  return Math.floor(left / right);
2226
2213
  case "**":
2227
- return left ** right;
2214
+ return __pow(left, right);
2228
2215
  case "==":
2229
2216
  return isEqual(left, right);
2230
2217
  case "<>":
@@ -2346,7 +2333,7 @@ function evaluate(ast, context = {}) {
2346
2333
  const dicts = /* @__PURE__ */ new Set();
2347
2334
  let pyContext;
2348
2335
  const evalContext = Object.create(context);
2349
- if (!evalContext?.context) {
2336
+ if (!(evalContext == null ? void 0 : evalContext.context)) {
2350
2337
  Object.defineProperty(evalContext, "context", {
2351
2338
  get() {
2352
2339
  if (!pyContext) {
@@ -2357,17 +2344,18 @@ function evaluate(ast, context = {}) {
2357
2344
  });
2358
2345
  }
2359
2346
  function _innerEvaluate(ast2) {
2360
- switch (ast2?.type) {
2347
+ var _a, _b, _c;
2348
+ switch (ast2 == null ? void 0 : ast2.type) {
2361
2349
  case 0:
2362
2350
  // Number
2363
2351
  case 1:
2364
2352
  return ast2.value;
2365
2353
  case 5:
2366
2354
  if (ast2.value in evalContext) {
2367
- if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
2368
- return evalContext[ast2.value]?.id;
2355
+ if (typeof evalContext[ast2.value] === "object" && ((_a = evalContext[ast2.value]) == null ? void 0 : _a.id)) {
2356
+ return (_b = evalContext[ast2.value]) == null ? void 0 : _b.id;
2369
2357
  }
2370
- return evalContext[ast2.value] ?? false;
2358
+ return (_c = evalContext[ast2.value]) != null ? _c : false;
2371
2359
  } else if (ast2.value in BUILTINS) {
2372
2360
  return BUILTINS[ast2.value];
2373
2361
  } else {
@@ -2404,7 +2392,7 @@ function evaluate(ast, context = {}) {
2404
2392
  const args = ast2.args.map(_evaluate);
2405
2393
  const kwargs = {};
2406
2394
  for (const kwarg in ast2.kwargs) {
2407
- kwargs[kwarg] = _evaluate(ast2?.kwargs[kwarg]);
2395
+ kwargs[kwarg] = _evaluate(ast2 == null ? void 0 : ast2.kwargs[kwarg]);
2408
2396
  }
2409
2397
  if (fnValue === PyDate || fnValue === PyDateTime || fnValue === PyTime || fnValue === PyRelativeDelta || fnValue === PyTimeDelta) {
2410
2398
  return fnValue.create(...args, kwargs);
@@ -2483,9 +2471,25 @@ function escapeRegExp(str) {
2483
2471
  var InvalidDomainError = class extends Error {
2484
2472
  };
2485
2473
  var Domain = class _Domain {
2486
- ast = { type: -1, value: null };
2487
- static TRUE;
2488
- static FALSE;
2474
+ constructor(descr = []) {
2475
+ this.ast = { type: -1, value: null };
2476
+ if (descr instanceof _Domain) {
2477
+ return new _Domain(descr.toString());
2478
+ } else {
2479
+ let rawAST;
2480
+ try {
2481
+ rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
2482
+ } catch (error) {
2483
+ throw new InvalidDomainError(
2484
+ `Invalid domain representation: ${descr}`,
2485
+ {
2486
+ cause: error
2487
+ }
2488
+ );
2489
+ }
2490
+ this.ast = normalizeDomainAST(rawAST);
2491
+ }
2492
+ }
2489
2493
  static combine(domains, operator) {
2490
2494
  if (domains.length === 0) {
2491
2495
  return new _Domain([]);
@@ -2564,24 +2568,6 @@ var Domain = class _Domain {
2564
2568
  processLeaf(d.ast.value, 0, "&", newDomain);
2565
2569
  return newDomain;
2566
2570
  }
2567
- constructor(descr = []) {
2568
- if (descr instanceof _Domain) {
2569
- return new _Domain(descr.toString());
2570
- } else {
2571
- let rawAST;
2572
- try {
2573
- rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
2574
- } catch (error) {
2575
- throw new InvalidDomainError(
2576
- `Invalid domain representation: ${descr}`,
2577
- {
2578
- cause: error
2579
- }
2580
- );
2581
- }
2582
- this.ast = normalizeDomainAST(rawAST);
2583
- }
2584
- }
2585
2571
  contains(record) {
2586
2572
  const expr = evaluate(this.ast, record);
2587
2573
  return matchDomain(record, expr);
@@ -2600,7 +2586,7 @@ var Domain = class _Domain {
2600
2586
  return evaluatedAsList;
2601
2587
  }
2602
2588
  return this.toString();
2603
- } catch {
2589
+ } catch (e) {
2604
2590
  return this.toString();
2605
2591
  }
2606
2592
  }
@@ -2800,7 +2786,7 @@ function matchDomain(record, domain) {
2800
2786
  }
2801
2787
 
2802
2788
  // src/utils/function.ts
2803
- var import_react = require("react");
2789
+ import { useEffect, useState } from "react";
2804
2790
  var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
2805
2791
  if (!originalRequest.data) return originalRequest.data;
2806
2792
  if (typeof originalRequest.data === "string") {
@@ -2823,22 +2809,22 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
2823
2809
 
2824
2810
  // src/utils/storage/local-storage.ts
2825
2811
  var localStorageUtils = () => {
2826
- const setToken = async (access_token) => {
2812
+ const setToken = (access_token) => __async(null, null, function* () {
2827
2813
  localStorage.setItem("accessToken", access_token);
2828
- };
2829
- const setRefreshToken = async (refresh_token) => {
2814
+ });
2815
+ const setRefreshToken = (refresh_token) => __async(null, null, function* () {
2830
2816
  localStorage.setItem("refreshToken", refresh_token);
2831
- };
2832
- const getAccessToken = async () => {
2817
+ });
2818
+ const getAccessToken = () => __async(null, null, function* () {
2833
2819
  return localStorage.getItem("accessToken");
2834
- };
2835
- const getRefreshToken = async () => {
2820
+ });
2821
+ const getRefreshToken = () => __async(null, null, function* () {
2836
2822
  return localStorage.getItem("refreshToken");
2837
- };
2838
- const clearToken = async () => {
2823
+ });
2824
+ const clearToken = () => __async(null, null, function* () {
2839
2825
  localStorage.removeItem("accessToken");
2840
2826
  localStorage.removeItem("refreshToken");
2841
- };
2827
+ });
2842
2828
  return {
2843
2829
  setToken,
2844
2830
  setRefreshToken,
@@ -2850,9 +2836,9 @@ var localStorageUtils = () => {
2850
2836
 
2851
2837
  // src/utils/storage/session-storage.ts
2852
2838
  var sessionStorageUtils = () => {
2853
- const getBrowserSession = async () => {
2839
+ const getBrowserSession = () => __async(null, null, function* () {
2854
2840
  return sessionStorage.getItem("browserSession");
2855
- };
2841
+ });
2856
2842
  return {
2857
2843
  getBrowserSession
2858
2844
  };
@@ -2861,13 +2847,14 @@ var sessionStorageUtils = () => {
2861
2847
  // src/configs/axios-client.ts
2862
2848
  var axiosClient = {
2863
2849
  init(config) {
2864
- const localStorage2 = config.localStorageUtils ?? localStorageUtils();
2865
- const sessionStorage2 = config.sessionStorageUtils ?? sessionStorageUtils();
2850
+ var _a, _b;
2851
+ const localStorage2 = (_a = config.localStorageUtils) != null ? _a : localStorageUtils();
2852
+ const sessionStorage2 = (_b = config.sessionStorageUtils) != null ? _b : sessionStorageUtils();
2866
2853
  const db = config.db;
2867
2854
  let isRefreshing = false;
2868
2855
  let failedQueue = [];
2869
2856
  const processQueue = (error, token = null) => {
2870
- failedQueue?.forEach((prom) => {
2857
+ failedQueue == null ? void 0 : failedQueue.forEach((prom) => {
2871
2858
  if (error) {
2872
2859
  prom.reject(error);
2873
2860
  } else {
@@ -2876,21 +2863,21 @@ var axiosClient = {
2876
2863
  });
2877
2864
  failedQueue = [];
2878
2865
  };
2879
- const instance = import_axios.default.create({
2880
- adapter: import_axios.default.defaults.adapter,
2866
+ const instance = axios.create({
2867
+ adapter: axios.defaults.adapter,
2881
2868
  baseURL: config.baseUrl,
2882
2869
  timeout: 5e4,
2883
2870
  paramsSerializer: (params) => new URLSearchParams(params).toString()
2884
2871
  });
2885
2872
  instance.interceptors.request.use(
2886
- async (config2) => {
2873
+ (config2) => __async(null, null, function* () {
2887
2874
  const useRefreshToken = config2.useRefreshToken;
2888
- const token = useRefreshToken ? await localStorage2.getRefreshToken() : await localStorage2.getAccessToken();
2875
+ const token = useRefreshToken ? yield localStorage2.getRefreshToken() : yield localStorage2.getAccessToken();
2889
2876
  if (token) {
2890
2877
  config2.headers["Authorization"] = "Bearer " + token;
2891
2878
  }
2892
2879
  return config2;
2893
- },
2880
+ }),
2894
2881
  (error) => {
2895
2882
  Promise.reject(error);
2896
2883
  }
@@ -2899,19 +2886,21 @@ var axiosClient = {
2899
2886
  (response) => {
2900
2887
  return handleResponse(response);
2901
2888
  },
2902
- async (error) => {
2903
- const handleError3 = async (error2) => {
2889
+ (error) => __async(null, null, function* () {
2890
+ var _a2, _b2, _c;
2891
+ const handleError3 = (error2) => __async(null, null, function* () {
2892
+ var _a3;
2904
2893
  if (!error2.response) {
2905
2894
  return error2;
2906
2895
  }
2907
2896
  const { data } = error2.response;
2908
- if (data && data.code === 400 && ["invalid_grant"].includes(data.data?.error)) {
2909
- await clearAuthToken();
2897
+ if (data && data.code === 400 && ["invalid_grant"].includes((_a3 = data.data) == null ? void 0 : _a3.error)) {
2898
+ yield clearAuthToken();
2910
2899
  }
2911
2900
  return data;
2912
- };
2901
+ });
2913
2902
  const originalRequest = error.config;
2914
- if ((error.response?.status === 403 || error.response?.status === 401 || error.response?.status === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
2903
+ 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(
2915
2904
  error.response.data.code
2916
2905
  )) {
2917
2906
  if (isRefreshing) {
@@ -2924,18 +2913,19 @@ var axiosClient = {
2924
2913
  token
2925
2914
  );
2926
2915
  return instance.request(originalRequest);
2927
- }).catch(async (err) => {
2928
- if ((err.response?.status === 400 || err.response?.status === 401) && ["invalid_grant"].includes(err.response.data.error)) {
2929
- await clearAuthToken();
2916
+ }).catch((err) => __async(null, null, function* () {
2917
+ var _a3, _b3;
2918
+ 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)) {
2919
+ yield clearAuthToken();
2930
2920
  }
2931
- });
2921
+ }));
2932
2922
  }
2933
- const browserSession = await sessionStorage2.getBrowserSession();
2934
- const refreshToken = await localStorage2.getRefreshToken();
2935
- const accessTokenExp = await localStorage2.getAccessToken();
2923
+ const browserSession = yield sessionStorage2.getBrowserSession();
2924
+ const refreshToken = yield localStorage2.getRefreshToken();
2925
+ const accessTokenExp = yield localStorage2.getAccessToken();
2936
2926
  isRefreshing = true;
2937
2927
  if (!refreshToken && (!browserSession || browserSession == "unActive")) {
2938
- await clearAuthToken();
2928
+ yield clearAuthToken();
2939
2929
  } else {
2940
2930
  const payload = Object.fromEntries(
2941
2931
  Object.entries({
@@ -2946,8 +2936,9 @@ var axiosClient = {
2946
2936
  }).filter(([_, value]) => !!value)
2947
2937
  );
2948
2938
  return new Promise(function(resolve) {
2949
- import_axios.default.post(
2950
- `${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2939
+ var _a3;
2940
+ axios.post(
2941
+ `${config.baseUrl}${(_a3 = config.refreshTokenEndpoint) != null ? _a3 : "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2951
2942
  payload,
2952
2943
  {
2953
2944
  headers: {
@@ -2955,11 +2946,11 @@ var axiosClient = {
2955
2946
  Authorization: `Bearer ${accessTokenExp}`
2956
2947
  }
2957
2948
  }
2958
- ).then(async (res) => {
2949
+ ).then((res) => __async(null, null, function* () {
2959
2950
  const data = res.data;
2960
- await localStorage2.setToken(data.access_token);
2961
- await localStorage2.setRefreshToken(data.refresh_token);
2962
- import_axios.default.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
2951
+ yield localStorage2.setToken(data.access_token);
2952
+ yield localStorage2.setRefreshToken(data.refresh_token);
2953
+ axios.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
2963
2954
  originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
2964
2955
  originalRequest.data = updateTokenParamInOriginalRequest(
2965
2956
  originalRequest,
@@ -2967,25 +2958,26 @@ var axiosClient = {
2967
2958
  );
2968
2959
  processQueue(null, data.access_token);
2969
2960
  resolve(instance.request(originalRequest));
2970
- }).catch(async (err) => {
2971
- 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") {
2972
- await clearAuthToken();
2961
+ })).catch((err) => __async(null, null, function* () {
2962
+ var _a4;
2963
+ 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") {
2964
+ yield clearAuthToken();
2973
2965
  }
2974
2966
  if (err && err.response) {
2975
- const { error_code } = err.response?.data || {};
2967
+ const { error_code } = ((_a4 = err.response) == null ? void 0 : _a4.data) || {};
2976
2968
  if (error_code === "AUTHEN_FAIL") {
2977
- await clearAuthToken();
2969
+ yield clearAuthToken();
2978
2970
  }
2979
2971
  }
2980
2972
  processQueue(err, null);
2981
- }).finally(() => {
2973
+ })).finally(() => {
2982
2974
  isRefreshing = false;
2983
2975
  });
2984
2976
  });
2985
2977
  }
2986
2978
  }
2987
- return Promise.reject(await handleError3(error));
2988
- }
2979
+ return Promise.reject(yield handleError3(error));
2980
+ })
2989
2981
  );
2990
2982
  const handleResponse = (res) => {
2991
2983
  if (res && res.data) {
@@ -2994,6 +2986,7 @@ var axiosClient = {
2994
2986
  return res;
2995
2987
  };
2996
2988
  const handleError2 = (error) => {
2989
+ var _a2, _b2, _c;
2997
2990
  if (error.isAxiosError && error.code === "ECONNABORTED") {
2998
2991
  console.error("Request Timeout Error:", error);
2999
2992
  return "Request Timeout Error";
@@ -3001,17 +2994,17 @@ var axiosClient = {
3001
2994
  console.error("Network Error:", error);
3002
2995
  return "Network Error";
3003
2996
  } else {
3004
- console.error("Other Error:", error?.response);
3005
- const errorMessage = error?.response?.data?.message || "An error occurred";
3006
- return { message: errorMessage, status: error?.response?.status };
2997
+ console.error("Other Error:", error == null ? void 0 : error.response);
2998
+ const errorMessage = ((_b2 = (_a2 = error == null ? void 0 : error.response) == null ? void 0 : _a2.data) == null ? void 0 : _b2.message) || "An error occurred";
2999
+ return { message: errorMessage, status: (_c = error == null ? void 0 : error.response) == null ? void 0 : _c.status };
3007
3000
  }
3008
3001
  };
3009
- const clearAuthToken = async () => {
3010
- await localStorage2.clearToken();
3002
+ const clearAuthToken = () => __async(null, null, function* () {
3003
+ yield localStorage2.clearToken();
3011
3004
  if (typeof window !== "undefined") {
3012
3005
  window.location.href = `/login`;
3013
3006
  }
3014
- };
3007
+ });
3015
3008
  function formatUrl(url, db2) {
3016
3009
  return url + (db2 ? "?db=" + db2 : "");
3017
3010
  }
@@ -3036,18 +3029,6 @@ var axiosClient = {
3036
3029
 
3037
3030
  // src/environment/EnvStore.ts
3038
3031
  var EnvStore = class {
3039
- envStore;
3040
- baseUrl;
3041
- requests;
3042
- context;
3043
- defaultCompany;
3044
- config;
3045
- companies;
3046
- user;
3047
- db;
3048
- localStorageUtils;
3049
- sessionStorageUtils;
3050
- refreshTokenEndpoint;
3051
3032
  constructor(envStore2, localStorageUtils2, sessionStorageUtils2) {
3052
3033
  this.envStore = envStore2;
3053
3034
  this.localStorageUtils = localStorageUtils2;
@@ -3056,25 +3037,24 @@ var EnvStore = class {
3056
3037
  }
3057
3038
  setup() {
3058
3039
  const env2 = this.envStore.getState().env;
3059
- this.baseUrl = env2?.baseUrl;
3060
- this.requests = env2?.requests;
3061
- this.context = env2?.context;
3062
- this.defaultCompany = env2?.defaultCompany;
3063
- this.config = env2?.config;
3064
- this.companies = env2?.companies || [];
3065
- this.user = env2?.user;
3066
- this.db = env2?.db;
3067
- this.refreshTokenEndpoint = env2?.refreshTokenEndpoint;
3040
+ this.baseUrl = env2 == null ? void 0 : env2.baseUrl;
3041
+ this.requests = env2 == null ? void 0 : env2.requests;
3042
+ this.context = env2 == null ? void 0 : env2.context;
3043
+ this.defaultCompany = env2 == null ? void 0 : env2.defaultCompany;
3044
+ this.config = env2 == null ? void 0 : env2.config;
3045
+ this.companies = (env2 == null ? void 0 : env2.companies) || [];
3046
+ this.user = env2 == null ? void 0 : env2.user;
3047
+ this.db = env2 == null ? void 0 : env2.db;
3048
+ this.refreshTokenEndpoint = env2 == null ? void 0 : env2.refreshTokenEndpoint;
3068
3049
  }
3069
3050
  setupEnv(envConfig) {
3070
3051
  const dispatch = this.envStore.dispatch;
3071
- const env2 = {
3072
- ...envConfig,
3052
+ const env2 = __spreadProps(__spreadValues({}, envConfig), {
3073
3053
  localStorageUtils: this.localStorageUtils,
3074
3054
  sessionStorageUtils: this.sessionStorageUtils
3075
- };
3055
+ });
3076
3056
  const requests = axiosClient.init(env2);
3077
- dispatch(setEnv({ ...env2, requests }));
3057
+ dispatch(setEnv(__spreadProps(__spreadValues({}, env2), { requests })));
3078
3058
  this.setup();
3079
3059
  }
3080
3060
  setUid(uid) {
@@ -3117,471 +3097,509 @@ function getEnv() {
3117
3097
 
3118
3098
  // src/services/view-service/index.ts
3119
3099
  var ViewService = {
3120
- async getView({
3121
- model,
3122
- views,
3123
- context = {},
3124
- options = {},
3125
- aid
3126
- }) {
3127
- const env2 = getEnv();
3128
- const defaultOptions = {
3129
- load_filters: true,
3130
- toolbar: true,
3131
- action_id: aid
3132
- };
3133
- const jsonDataView = {
3100
+ getView(_0) {
3101
+ return __async(this, arguments, function* ({
3134
3102
  model,
3135
- method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
3136
- kwargs: {
3137
- views,
3138
- options: { ...options, ...defaultOptions }
3139
- },
3140
- with_context: context
3141
- };
3142
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonDataView, {
3143
- headers: {
3144
- "Content-Type": "application/json"
3145
- }
3103
+ views,
3104
+ context = {},
3105
+ options = {},
3106
+ aid
3107
+ }) {
3108
+ var _a;
3109
+ const env2 = getEnv();
3110
+ const defaultOptions = {
3111
+ load_filters: true,
3112
+ toolbar: true,
3113
+ action_id: aid
3114
+ };
3115
+ const jsonDataView = {
3116
+ model,
3117
+ method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
3118
+ kwargs: {
3119
+ views,
3120
+ options: __spreadValues(__spreadValues({}, options), defaultOptions)
3121
+ },
3122
+ with_context: context
3123
+ };
3124
+ return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonDataView, {
3125
+ headers: {
3126
+ "Content-Type": "application/json"
3127
+ }
3128
+ });
3146
3129
  });
3147
3130
  },
3148
- async getMenu(context) {
3149
- const env2 = getEnv();
3150
- const jsonData = {
3151
- model: "ir.ui.menu" /* MENU */,
3152
- method: "web_search_read" /* WEB_SEARCH_READ */,
3153
- ids: [],
3154
- with_context: context,
3155
- kwargs: {
3156
- specification: {
3157
- active: {},
3158
- name: {},
3159
- is_display: {},
3160
- sequence: {},
3161
- complete_name: {},
3162
- action: {
3163
- fields: {
3164
- display_name: {},
3165
- type: {},
3166
- binding_view_types: {}
3167
- // res_model: {},
3168
- }
3169
- },
3170
- url_icon: {},
3171
- web_icon: {},
3172
- web_icon_data: {},
3173
- groups_id: {
3174
- fields: {
3175
- full_name: {}
3131
+ getMenu(context) {
3132
+ return __async(this, null, function* () {
3133
+ var _a;
3134
+ const env2 = getEnv();
3135
+ const jsonData = {
3136
+ model: "ir.ui.menu" /* MENU */,
3137
+ method: "web_search_read" /* WEB_SEARCH_READ */,
3138
+ ids: [],
3139
+ with_context: context,
3140
+ kwargs: {
3141
+ specification: {
3142
+ active: {},
3143
+ name: {},
3144
+ is_display: {},
3145
+ sequence: {},
3146
+ complete_name: {},
3147
+ action: {
3148
+ fields: {
3149
+ display_name: {},
3150
+ type: {},
3151
+ binding_view_types: {}
3152
+ // res_model: {},
3153
+ }
3176
3154
  },
3177
- limit: 40,
3178
- order: ""
3179
- },
3180
- display_name: {},
3181
- child_id: {
3182
- fields: {
3183
- active: {},
3184
- name: {},
3185
- is_display: {},
3186
- sequence: {},
3187
- complete_name: {},
3188
- action: {
3189
- fields: {
3190
- display_name: {},
3191
- type: {},
3192
- binding_view_types: {}
3193
- // res_model: {},
3194
- }
3155
+ url_icon: {},
3156
+ web_icon: {},
3157
+ web_icon_data: {},
3158
+ groups_id: {
3159
+ fields: {
3160
+ full_name: {}
3195
3161
  },
3196
- url_icon: {},
3197
- web_icon: {},
3198
- web_icon_data: {},
3199
- groups_id: {
3200
- fields: {
3201
- full_name: {}
3162
+ limit: 40,
3163
+ order: ""
3164
+ },
3165
+ display_name: {},
3166
+ child_id: {
3167
+ fields: {
3168
+ active: {},
3169
+ name: {},
3170
+ is_display: {},
3171
+ sequence: {},
3172
+ complete_name: {},
3173
+ action: {
3174
+ fields: {
3175
+ display_name: {},
3176
+ type: {},
3177
+ binding_view_types: {}
3178
+ // res_model: {},
3179
+ }
3202
3180
  },
3203
- limit: 40,
3204
- order: ""
3205
- },
3206
- display_name: {},
3207
- child_id: {
3208
- fields: {
3209
- active: {},
3210
- name: {},
3211
- is_display: {},
3212
- sequence: {},
3213
- complete_name: {},
3214
- action: {
3215
- fields: {
3216
- display_name: {},
3217
- type: {},
3218
- binding_view_types: {}
3219
- // res_model: {},
3220
- }
3181
+ url_icon: {},
3182
+ web_icon: {},
3183
+ web_icon_data: {},
3184
+ groups_id: {
3185
+ fields: {
3186
+ full_name: {}
3221
3187
  },
3222
- url_icon: {},
3223
- web_icon: {},
3224
- web_icon_data: {},
3225
- groups_id: {
3226
- fields: {
3227
- full_name: {}
3188
+ limit: 40,
3189
+ order: ""
3190
+ },
3191
+ display_name: {},
3192
+ child_id: {
3193
+ fields: {
3194
+ active: {},
3195
+ name: {},
3196
+ is_display: {},
3197
+ sequence: {},
3198
+ complete_name: {},
3199
+ action: {
3200
+ fields: {
3201
+ display_name: {},
3202
+ type: {},
3203
+ binding_view_types: {}
3204
+ // res_model: {},
3205
+ }
3228
3206
  },
3229
- limit: 40,
3230
- order: ""
3231
- },
3232
- display_name: {},
3233
- child_id: {
3234
- fields: {
3235
- active: {},
3236
- name: {},
3237
- is_display: {},
3238
- sequence: {},
3239
- complete_name: {},
3240
- action: {
3241
- fields: {
3242
- display_name: {},
3243
- type: {},
3244
- binding_view_types: {}
3245
- // res_model: {},
3246
- }
3207
+ url_icon: {},
3208
+ web_icon: {},
3209
+ web_icon_data: {},
3210
+ groups_id: {
3211
+ fields: {
3212
+ full_name: {}
3247
3213
  },
3248
- url_icon: {},
3249
- web_icon: {},
3250
- web_icon_data: {},
3251
- groups_id: {
3252
- fields: {
3253
- full_name: {}
3214
+ limit: 40,
3215
+ order: ""
3216
+ },
3217
+ display_name: {},
3218
+ child_id: {
3219
+ fields: {
3220
+ active: {},
3221
+ name: {},
3222
+ is_display: {},
3223
+ sequence: {},
3224
+ complete_name: {},
3225
+ action: {
3226
+ fields: {
3227
+ display_name: {},
3228
+ type: {},
3229
+ binding_view_types: {}
3230
+ // res_model: {},
3231
+ }
3232
+ },
3233
+ url_icon: {},
3234
+ web_icon: {},
3235
+ web_icon_data: {},
3236
+ groups_id: {
3237
+ fields: {
3238
+ full_name: {}
3239
+ },
3240
+ limit: 40,
3241
+ order: ""
3254
3242
  },
3255
- limit: 40,
3256
- order: ""
3243
+ display_name: {},
3244
+ child_id: {
3245
+ fields: {},
3246
+ limit: 40,
3247
+ order: ""
3248
+ }
3257
3249
  },
3258
- display_name: {},
3259
- child_id: {
3260
- fields: {},
3261
- limit: 40,
3262
- order: ""
3263
- }
3264
- },
3265
- limit: 40,
3266
- order: ""
3267
- }
3268
- },
3269
- limit: 40,
3270
- order: ""
3271
- }
3272
- },
3273
- limit: 40,
3274
- order: ""
3275
- }
3276
- },
3277
- domain: [
3278
- "&",
3279
- ["is_display", "=", true],
3280
- "&",
3281
- ["active", "=", true],
3282
- ["parent_id", "=", false]
3283
- ]
3284
- }
3285
- };
3286
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3287
- headers: {
3288
- "Content-Type": "application/json"
3289
- }
3250
+ limit: 40,
3251
+ order: ""
3252
+ }
3253
+ },
3254
+ limit: 40,
3255
+ order: ""
3256
+ }
3257
+ },
3258
+ limit: 40,
3259
+ order: ""
3260
+ }
3261
+ },
3262
+ domain: [
3263
+ "&",
3264
+ ["is_display", "=", true],
3265
+ "&",
3266
+ ["active", "=", true],
3267
+ ["parent_id", "=", false]
3268
+ ]
3269
+ }
3270
+ };
3271
+ return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
3272
+ headers: {
3273
+ "Content-Type": "application/json"
3274
+ }
3275
+ });
3290
3276
  });
3291
3277
  },
3292
- async getActionDetail(aid, context) {
3293
- const env2 = getEnv();
3294
- const jsonData = {
3295
- model: "ir.actions.act_window" /* WINDOW_ACTION */,
3296
- method: "web_read" /* WEB_READ */,
3297
- ids: [aid],
3298
- with_context: context,
3299
- kwargs: {
3300
- specification: {
3301
- id: {},
3302
- name: {},
3303
- res_model: {},
3304
- views: {},
3305
- view_mode: {},
3306
- mobile_view_mode: {},
3307
- domain: {},
3308
- context: {},
3309
- groups_id: {},
3310
- search_view_id: {}
3278
+ getActionDetail(aid, context) {
3279
+ return __async(this, null, function* () {
3280
+ var _a;
3281
+ const env2 = getEnv();
3282
+ const jsonData = {
3283
+ model: "ir.actions.act_window" /* WINDOW_ACTION */,
3284
+ method: "web_read" /* WEB_READ */,
3285
+ ids: [aid],
3286
+ with_context: context,
3287
+ kwargs: {
3288
+ specification: {
3289
+ id: {},
3290
+ name: {},
3291
+ res_model: {},
3292
+ views: {},
3293
+ view_mode: {},
3294
+ mobile_view_mode: {},
3295
+ domain: {},
3296
+ context: {},
3297
+ groups_id: {},
3298
+ search_view_id: {}
3299
+ }
3311
3300
  }
3312
- }
3313
- };
3314
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3315
- headers: {
3316
- "Content-Type": "application/json"
3317
- }
3301
+ };
3302
+ return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
3303
+ headers: {
3304
+ "Content-Type": "application/json"
3305
+ }
3306
+ });
3318
3307
  });
3319
3308
  },
3320
- async getResequence({
3321
- model,
3322
- ids,
3323
- context,
3324
- offset
3325
- }) {
3326
- const env2 = getEnv();
3327
- const jsonData = {
3309
+ getResequence(_0) {
3310
+ return __async(this, arguments, function* ({
3328
3311
  model,
3329
- with_context: context,
3330
3312
  ids,
3331
- field: "sequence",
3332
- ...offset > 0 ? { offset } : {}
3333
- };
3334
- return env2?.requests.post("/web/dataset/resequence", jsonData, {
3335
- headers: {
3336
- "Content-Type": "application/json"
3337
- }
3313
+ context,
3314
+ offset
3315
+ }) {
3316
+ const env2 = getEnv();
3317
+ const jsonData = __spreadValues({
3318
+ model,
3319
+ with_context: context,
3320
+ ids,
3321
+ field: "sequence"
3322
+ }, offset > 0 ? { offset } : {});
3323
+ return env2 == null ? void 0 : env2.requests.post("/web/dataset/resequence", jsonData, {
3324
+ headers: {
3325
+ "Content-Type": "application/json"
3326
+ }
3327
+ });
3338
3328
  });
3339
3329
  },
3340
- async getSelectionItem({ data }) {
3341
- const env2 = getEnv();
3342
- const jsonData = {
3343
- model: data.model,
3344
- ids: [],
3345
- method: "get_data_select",
3346
- with_context: data.context,
3347
- kwargs: {
3348
- count_limit: 10001,
3349
- domain: data.domain ? data.domain : [],
3350
- offset: 0,
3351
- order: "",
3352
- specification: data?.specification ?? {
3353
- id: {},
3354
- name: {},
3355
- display_name: {}
3330
+ getSelectionItem(_0) {
3331
+ return __async(this, arguments, function* ({ data }) {
3332
+ var _a;
3333
+ const env2 = getEnv();
3334
+ const jsonData = {
3335
+ model: data.model,
3336
+ ids: [],
3337
+ method: "get_data_select",
3338
+ with_context: data.context,
3339
+ kwargs: {
3340
+ count_limit: 10001,
3341
+ domain: data.domain ? data.domain : [],
3342
+ offset: 0,
3343
+ order: "",
3344
+ specification: (_a = data == null ? void 0 : data.specification) != null ? _a : {
3345
+ id: {},
3346
+ name: {},
3347
+ display_name: {}
3348
+ }
3356
3349
  }
3357
- }
3358
- };
3359
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3360
- headers: {
3361
- "Content-Type": "application/json"
3362
- }
3350
+ };
3351
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3352
+ headers: {
3353
+ "Content-Type": "application/json"
3354
+ }
3355
+ });
3363
3356
  });
3364
3357
  },
3365
- async loadMessages() {
3366
- const env2 = getEnv();
3367
- return env2.requests.post(
3368
- "/load_message_failures" /* LOAD_MESSAGE */,
3369
- {},
3370
- {
3358
+ loadMessages() {
3359
+ return __async(this, null, function* () {
3360
+ const env2 = getEnv();
3361
+ return env2.requests.post(
3362
+ "/load_message_failures" /* LOAD_MESSAGE */,
3363
+ {},
3364
+ {
3365
+ headers: {
3366
+ "Content-Type": "application/json"
3367
+ }
3368
+ }
3369
+ );
3370
+ });
3371
+ },
3372
+ getVersion() {
3373
+ return __async(this, null, function* () {
3374
+ var _a;
3375
+ const env2 = getEnv();
3376
+ console.log("env?.requests", env2, env2 == null ? void 0 : env2.requests);
3377
+ return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.get("", {
3371
3378
  headers: {
3372
3379
  "Content-Type": "application/json"
3373
3380
  }
3374
- }
3375
- );
3376
- },
3377
- async getVersion() {
3378
- const env2 = getEnv();
3379
- return env2?.requests.get("", {
3380
- headers: {
3381
- "Content-Type": "application/json"
3382
- }
3381
+ });
3383
3382
  });
3384
3383
  },
3385
- async get2FAMethods({
3386
- method,
3387
- with_context
3388
- }) {
3389
- const env2 = getEnv();
3390
- const jsonData = {
3384
+ get2FAMethods(_0) {
3385
+ return __async(this, arguments, function* ({
3391
3386
  method,
3392
3387
  with_context
3393
- };
3394
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3395
- headers: {
3396
- "Content-Type": "application/json"
3397
- }
3388
+ }) {
3389
+ const env2 = getEnv();
3390
+ const jsonData = {
3391
+ method,
3392
+ with_context
3393
+ };
3394
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3395
+ headers: {
3396
+ "Content-Type": "application/json"
3397
+ }
3398
+ });
3398
3399
  });
3399
3400
  },
3400
- async verify2FA({
3401
- method,
3402
- with_context,
3403
- code,
3404
- device,
3405
- location
3406
- }) {
3407
- const env2 = getEnv();
3408
- const jsonData = {
3401
+ verify2FA(_0) {
3402
+ return __async(this, arguments, function* ({
3409
3403
  method,
3410
- kwargs: {
3411
- vals: {
3412
- code,
3413
- device,
3414
- location
3415
- }
3416
- },
3417
- with_context
3418
- };
3419
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3420
- headers: {
3421
- "Content-Type": "application/json"
3422
- },
3423
- withCredentials: true
3404
+ with_context,
3405
+ code,
3406
+ device,
3407
+ location
3408
+ }) {
3409
+ const env2 = getEnv();
3410
+ const jsonData = {
3411
+ method,
3412
+ kwargs: {
3413
+ vals: {
3414
+ code,
3415
+ device,
3416
+ location
3417
+ }
3418
+ },
3419
+ with_context
3420
+ };
3421
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3422
+ headers: {
3423
+ "Content-Type": "application/json"
3424
+ },
3425
+ withCredentials: true
3426
+ });
3424
3427
  });
3425
3428
  },
3426
- async signInSSO({
3427
- redirect_uri,
3428
- state,
3429
- client_id,
3430
- response_type,
3431
- path
3432
- }) {
3433
- const env2 = getEnv();
3434
- const params = new URLSearchParams({
3435
- response_type,
3436
- client_id,
3429
+ signInSSO(_0) {
3430
+ return __async(this, arguments, function* ({
3437
3431
  redirect_uri,
3438
- state
3439
- });
3440
- const url = `${path}?${params.toString()}`;
3441
- return env2?.requests.get(url, {
3442
- headers: {
3443
- "Content-Type": "application/json"
3444
- },
3445
- withCredentials: true
3432
+ state,
3433
+ client_id,
3434
+ response_type,
3435
+ path
3436
+ }) {
3437
+ const env2 = getEnv();
3438
+ const params = new URLSearchParams({
3439
+ response_type,
3440
+ client_id,
3441
+ redirect_uri,
3442
+ state
3443
+ });
3444
+ const url = `${path}?${params.toString()}`;
3445
+ return env2 == null ? void 0 : env2.requests.get(url, {
3446
+ headers: {
3447
+ "Content-Type": "application/json"
3448
+ },
3449
+ withCredentials: true
3450
+ });
3446
3451
  });
3447
3452
  },
3448
- async grantAccess({
3449
- redirect_uri,
3450
- state,
3451
- client_id,
3452
- scopes
3453
- }) {
3454
- const env2 = getEnv();
3455
- const jsonData = {
3453
+ grantAccess(_0) {
3454
+ return __async(this, arguments, function* ({
3456
3455
  redirect_uri,
3457
3456
  state,
3458
3457
  client_id,
3459
3458
  scopes
3460
- };
3461
- return env2?.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
3462
- headers: {
3463
- "Content-Type": "application/json"
3464
- },
3465
- withCredentials: true
3459
+ }) {
3460
+ const env2 = getEnv();
3461
+ const jsonData = {
3462
+ redirect_uri,
3463
+ state,
3464
+ client_id,
3465
+ scopes
3466
+ };
3467
+ return env2 == null ? void 0 : env2.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
3468
+ headers: {
3469
+ "Content-Type": "application/json"
3470
+ },
3471
+ withCredentials: true
3472
+ });
3466
3473
  });
3467
3474
  },
3468
- async getFieldsViewSecurity({
3469
- method,
3470
- token,
3471
- views
3472
- }) {
3473
- const env2 = getEnv();
3474
- const jsonData = {
3475
+ getFieldsViewSecurity(_0) {
3476
+ return __async(this, arguments, function* ({
3475
3477
  method,
3476
- kwargs: {
3477
- views
3478
- },
3479
- with_context: {
3480
- token
3481
- }
3482
- };
3483
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3484
- headers: {
3485
- "Content-Type": "application/json"
3486
- }
3478
+ token,
3479
+ views
3480
+ }) {
3481
+ const env2 = getEnv();
3482
+ const jsonData = {
3483
+ method,
3484
+ kwargs: {
3485
+ views
3486
+ },
3487
+ with_context: {
3488
+ token
3489
+ }
3490
+ };
3491
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3492
+ headers: {
3493
+ "Content-Type": "application/json"
3494
+ }
3495
+ });
3487
3496
  });
3488
3497
  },
3489
- async settingsWebRead2fa({
3490
- method,
3491
- model,
3492
- kwargs,
3493
- token
3494
- }) {
3495
- const env2 = getEnv();
3496
- const jsonData = {
3498
+ settingsWebRead2fa(_0) {
3499
+ return __async(this, arguments, function* ({
3497
3500
  method,
3498
3501
  model,
3499
3502
  kwargs,
3500
- with_context: {
3501
- token
3502
- }
3503
- };
3504
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3505
- headers: {
3506
- "Content-Type": "application/json"
3507
- }
3503
+ token
3504
+ }) {
3505
+ const env2 = getEnv();
3506
+ const jsonData = {
3507
+ method,
3508
+ model,
3509
+ kwargs,
3510
+ with_context: {
3511
+ token
3512
+ }
3513
+ };
3514
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3515
+ headers: {
3516
+ "Content-Type": "application/json"
3517
+ }
3518
+ });
3508
3519
  });
3509
3520
  },
3510
- async requestSetupTotp({ method, token }) {
3511
- const env2 = getEnv();
3512
- const jsonData = {
3513
- method,
3514
- with_context: {
3515
- token
3516
- }
3517
- };
3518
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3519
- headers: {
3520
- "Content-Type": "application/json"
3521
- }
3521
+ requestSetupTotp(_0) {
3522
+ return __async(this, arguments, function* ({ method, token }) {
3523
+ const env2 = getEnv();
3524
+ const jsonData = {
3525
+ method,
3526
+ with_context: {
3527
+ token
3528
+ }
3529
+ };
3530
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3531
+ headers: {
3532
+ "Content-Type": "application/json"
3533
+ }
3534
+ });
3522
3535
  });
3523
3536
  },
3524
- async verifyTotp({
3525
- method,
3526
- action_token,
3527
- code
3528
- }) {
3529
- const env2 = getEnv();
3530
- const jsonData = {
3537
+ verifyTotp(_0) {
3538
+ return __async(this, arguments, function* ({
3531
3539
  method,
3532
- kwargs: {
3533
- vals: {
3534
- code
3540
+ action_token,
3541
+ code
3542
+ }) {
3543
+ const env2 = getEnv();
3544
+ const jsonData = {
3545
+ method,
3546
+ kwargs: {
3547
+ vals: {
3548
+ code
3549
+ }
3550
+ },
3551
+ with_context: {
3552
+ action_token
3535
3553
  }
3536
- },
3537
- with_context: {
3538
- action_token
3539
- }
3540
- };
3541
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3542
- headers: {
3543
- "Content-Type": "application/json"
3544
- }
3554
+ };
3555
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3556
+ headers: {
3557
+ "Content-Type": "application/json"
3558
+ }
3559
+ });
3545
3560
  });
3546
3561
  },
3547
- async removeTotpSetUp({ method, token }) {
3548
- const env2 = getEnv();
3549
- const jsonData = {
3550
- method,
3551
- with_context: {
3552
- token
3553
- }
3554
- };
3555
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3556
- headers: {
3557
- "Content-Type": "application/json"
3558
- }
3562
+ removeTotpSetUp(_0) {
3563
+ return __async(this, arguments, function* ({ method, token }) {
3564
+ const env2 = getEnv();
3565
+ const jsonData = {
3566
+ method,
3567
+ with_context: {
3568
+ token
3569
+ }
3570
+ };
3571
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3572
+ headers: {
3573
+ "Content-Type": "application/json"
3574
+ }
3575
+ });
3559
3576
  });
3560
3577
  }
3561
3578
  };
3562
3579
  var view_service_default = ViewService;
3563
3580
 
3564
3581
  // src/provider/version-gate-provider.tsx
3565
- var import_jsx_runtime4 = require("react/jsx-runtime");
3582
+ import { Fragment, jsx as jsx4 } from "react/jsx-runtime";
3566
3583
  var VersionGate = ({ children }) => {
3567
- const queryClient = (0, import_react_query2.useQueryClient)();
3568
- const [ready, setReady] = (0, import_react2.useState)(false);
3569
- (0, import_react2.useEffect)(() => {
3584
+ const queryClient = useQueryClient();
3585
+ const [ready, setReady] = useState2(false);
3586
+ useEffect2(() => {
3570
3587
  const clearVersion = () => {
3571
3588
  queryClient.clear();
3572
3589
  localStorage.removeItem("__api_version__");
3573
3590
  };
3574
- const validateVersion = async () => {
3575
- const serverVersion = await view_service_default.getVersion();
3591
+ const validateVersion = () => __async(null, null, function* () {
3592
+ const serverVersion = yield view_service_default.getVersion();
3593
+ console.log("serverVersion", serverVersion);
3576
3594
  const cached = localStorage.getItem("__api_version__");
3577
- if (cached !== serverVersion?.api_version) {
3595
+ if (cached !== (serverVersion == null ? void 0 : serverVersion.api_version)) {
3578
3596
  clearVersion();
3579
- localStorage.setItem("__api_version__", serverVersion?.api_version);
3597
+ localStorage.setItem("__api_version__", serverVersion == null ? void 0 : serverVersion.api_version);
3580
3598
  } else {
3581
- console.log("Api version:", serverVersion?.api_version);
3599
+ console.log("Api version:", serverVersion == null ? void 0 : serverVersion.api_version);
3582
3600
  }
3583
3601
  setReady(true);
3584
- };
3602
+ });
3585
3603
  validateVersion();
3586
3604
  if (typeof window !== "undefined") {
3587
3605
  const onKey = (e) => {
@@ -3593,11 +3611,10 @@ var VersionGate = ({ children }) => {
3593
3611
  return () => window.removeEventListener("keydown", onKey);
3594
3612
  }
3595
3613
  }, [queryClient]);
3596
- return ready ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children }) : null;
3614
+ return ready ? /* @__PURE__ */ jsx4(Fragment, { children }) : null;
3597
3615
  };
3598
- // Annotate the CommonJS export names for ESM import in node:
3599
- 0 && (module.exports = {
3616
+ export {
3600
3617
  MainProvider,
3601
3618
  ReactQueryProvider,
3602
3619
  VersionGate
3603
- });
3620
+ };