@fctc/interface-logic 1.7.1 → 1.7.2

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