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