@fctc/interface-logic 1.7.2 → 1.7.3

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