@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
@@ -1,83 +1,8 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
- var __getProtoOf = Object.getPrototypeOf;
9
- var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
- var __pow = Math.pow;
12
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
- var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {}))
15
- if (__hasOwnProp.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- if (__getOwnPropSymbols)
18
- for (var prop of __getOwnPropSymbols(b)) {
19
- if (__propIsEnum.call(b, prop))
20
- __defNormalProp(a, prop, b[prop]);
21
- }
22
- return a;
23
- };
24
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
- var __export = (target, all) => {
26
- for (var name in all)
27
- __defProp(target, name, { get: all[name], enumerable: true });
28
- };
29
- var __copyProps = (to, from, except, desc) => {
30
- if (from && typeof from === "object" || typeof from === "function") {
31
- for (let key of __getOwnPropNames(from))
32
- if (!__hasOwnProp.call(to, key) && key !== except)
33
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
34
- }
35
- return to;
36
- };
37
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
38
- // If the importer is in node compatibility mode or this is not an ESM
39
- // file that has been converted to a CommonJS file using a Babel-
40
- // compatible transform (i.e. "__esModule" has not been set), then set
41
- // "default" to the CommonJS "module.exports" for node compatibility.
42
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
43
- mod
44
- ));
45
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
46
- var __async = (__this, __arguments, generator) => {
47
- return new Promise((resolve, reject) => {
48
- var fulfilled = (value) => {
49
- try {
50
- step(generator.next(value));
51
- } catch (e) {
52
- reject(e);
53
- }
54
- };
55
- var rejected = (value) => {
56
- try {
57
- step(generator.throw(value));
58
- } catch (e) {
59
- reject(e);
60
- }
61
- };
62
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
63
- step((generator = generator.apply(__this, __arguments)).next());
64
- });
65
- };
66
-
67
- // src/provider.ts
68
- var provider_exports = {};
69
- __export(provider_exports, {
70
- MainProvider: () => MainProvider,
71
- ReactQueryProvider: () => ReactQueryProvider,
72
- VersionGate: () => VersionGate
73
- });
74
- module.exports = __toCommonJS(provider_exports);
75
-
76
1
  // src/provider/react-query-provider.tsx
77
- var import_react_query = require("@tanstack/react-query");
78
- var import_jsx_runtime = require("react/jsx-runtime");
2
+ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
3
+ import { jsx } from "react/jsx-runtime";
79
4
  var ReactQueryProvider = ({ children }) => {
80
- const queryClient = new import_react_query.QueryClient({
5
+ const queryClient = new QueryClient({
81
6
  defaultOptions: {
82
7
  queries: {
83
8
  // placeholderData: keepPreviousData,
@@ -88,21 +13,21 @@ var ReactQueryProvider = ({ children }) => {
88
13
  }
89
14
  }
90
15
  });
91
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_query.QueryClientProvider, { client: queryClient, children });
16
+ return /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children });
92
17
  };
93
18
 
94
19
  // src/provider/redux-provider.tsx
95
- var import_react_redux2 = require("react-redux");
20
+ import { Provider } from "react-redux";
96
21
 
97
22
  // src/store/index.ts
98
- var import_react_redux = require("react-redux");
23
+ import { useDispatch, useSelector } from "react-redux";
99
24
 
100
25
  // src/store/reducers/breadcrums-slice/index.ts
101
- var import_toolkit = require("@reduxjs/toolkit");
26
+ import { createSlice } from "@reduxjs/toolkit";
102
27
  var initialState = {
103
28
  breadCrumbs: []
104
29
  };
105
- var breadcrumbsSlice = (0, import_toolkit.createSlice)({
30
+ var breadcrumbsSlice = createSlice({
106
31
  name: "breadcrumbs",
107
32
  initialState,
108
33
  reducers: {
@@ -115,7 +40,7 @@ var { setBreadCrumbs } = breadcrumbsSlice.actions;
115
40
  var breadcrums_slice_default = breadcrumbsSlice.reducer;
116
41
 
117
42
  // src/store/reducers/env-slice/index.ts
118
- var import_toolkit2 = require("@reduxjs/toolkit");
43
+ import { createSlice as createSlice2 } from "@reduxjs/toolkit";
119
44
  var initialState2 = {
120
45
  baseUrl: "",
121
46
  requests: null,
@@ -136,7 +61,7 @@ var initialState2 = {
136
61
  tz: "Asia/Saigon"
137
62
  }
138
63
  };
139
- var envSlice = (0, import_toolkit2.createSlice)({
64
+ var envSlice = createSlice2({
140
65
  name: "env",
141
66
  initialState: initialState2,
142
67
  reducers: {
@@ -183,7 +108,7 @@ var {
183
108
  var env_slice_default = envSlice.reducer;
184
109
 
185
110
  // src/store/reducers/excel-slice/index.ts
186
- var import_toolkit3 = require("@reduxjs/toolkit");
111
+ import { createSlice as createSlice3 } from "@reduxjs/toolkit";
187
112
  var initialState3 = {
188
113
  dataParse: null,
189
114
  idFile: null,
@@ -192,7 +117,7 @@ var initialState3 = {
192
117
  selectedFile: null,
193
118
  errorData: null
194
119
  };
195
- var excelSlice = (0, import_toolkit3.createSlice)({
120
+ var excelSlice = createSlice3({
196
121
  name: "excel",
197
122
  initialState: initialState3,
198
123
  reducers: {
@@ -227,7 +152,7 @@ var {
227
152
  var excel_slice_default = excelSlice.reducer;
228
153
 
229
154
  // src/store/reducers/form-slice/index.ts
230
- var import_toolkit4 = require("@reduxjs/toolkit");
155
+ import { createSlice as createSlice4 } from "@reduxjs/toolkit";
231
156
  var initialState4 = {
232
157
  viewDataStore: {},
233
158
  isShowingModalDetail: false,
@@ -237,7 +162,7 @@ var initialState4 = {
237
162
  listSubject: {},
238
163
  dataUser: {}
239
164
  };
240
- var formSlice = (0, import_toolkit4.createSlice)({
165
+ var formSlice = createSlice4({
241
166
  name: "form",
242
167
  initialState: initialState4,
243
168
  reducers: {
@@ -276,15 +201,15 @@ var {
276
201
  var form_slice_default = formSlice.reducer;
277
202
 
278
203
  // src/store/reducers/header-slice/index.ts
279
- var import_toolkit5 = require("@reduxjs/toolkit");
280
- var headerSlice = (0, import_toolkit5.createSlice)({
204
+ import { createSlice as createSlice5 } from "@reduxjs/toolkit";
205
+ var headerSlice = createSlice5({
281
206
  name: "header",
282
207
  initialState: {
283
208
  value: { allowedCompanyIds: [] }
284
209
  },
285
210
  reducers: {
286
211
  setHeader: (state, action) => {
287
- state.value = __spreadValues(__spreadValues({}, state.value), action.payload);
212
+ state.value = { ...state.value, ...action.payload };
288
213
  },
289
214
  setAllowedCompanyIds: (state, action) => {
290
215
  state.value.allowedCompanyIds = action.payload;
@@ -295,7 +220,7 @@ var { setAllowedCompanyIds, setHeader } = headerSlice.actions;
295
220
  var header_slice_default = headerSlice.reducer;
296
221
 
297
222
  // src/store/reducers/list-slice/index.ts
298
- var import_toolkit6 = require("@reduxjs/toolkit");
223
+ import { createSlice as createSlice6 } from "@reduxjs/toolkit";
299
224
  var initialState5 = {
300
225
  pageLimit: 10,
301
226
  fields: {},
@@ -309,7 +234,7 @@ var initialState5 = {
309
234
  page: 0,
310
235
  domainTable: []
311
236
  };
312
- var listSlice = (0, import_toolkit6.createSlice)({
237
+ var listSlice = createSlice6({
313
238
  name: "list",
314
239
  initialState: initialState5,
315
240
  reducers: {
@@ -360,13 +285,13 @@ var {
360
285
  var list_slice_default = listSlice.reducer;
361
286
 
362
287
  // src/store/reducers/login-slice/index.ts
363
- var import_toolkit7 = require("@reduxjs/toolkit");
288
+ import { createSlice as createSlice7 } from "@reduxjs/toolkit";
364
289
  var initialState6 = {
365
290
  db: "",
366
291
  redirectTo: "/",
367
292
  forgotPasswordUrl: "/"
368
293
  };
369
- var loginSlice = (0, import_toolkit7.createSlice)({
294
+ var loginSlice = createSlice7({
370
295
  name: "login",
371
296
  initialState: initialState6,
372
297
  reducers: {
@@ -385,14 +310,14 @@ var { setDb, setRedirectTo, setForgotPasswordUrl } = loginSlice.actions;
385
310
  var login_slice_default = loginSlice.reducer;
386
311
 
387
312
  // src/store/reducers/navbar-slice/index.ts
388
- var import_toolkit8 = require("@reduxjs/toolkit");
313
+ import { createSlice as createSlice8 } from "@reduxjs/toolkit";
389
314
  var initialState7 = {
390
315
  menuFocus: {},
391
316
  menuAction: {},
392
317
  navbarWidth: 250,
393
318
  menuList: []
394
319
  };
395
- var navbarSlice = (0, import_toolkit8.createSlice)({
320
+ var navbarSlice = createSlice8({
396
321
  name: "navbar",
397
322
  initialState: initialState7,
398
323
  reducers: {
@@ -414,11 +339,11 @@ var { setMenuFocus, setMenuFocusAction, setNavbarWidth, setMenuList } = navbarSl
414
339
  var navbar_slice_default = navbarSlice.reducer;
415
340
 
416
341
  // src/store/reducers/profile-slice/index.ts
417
- var import_toolkit9 = require("@reduxjs/toolkit");
342
+ import { createSlice as createSlice9 } from "@reduxjs/toolkit";
418
343
  var initialState8 = {
419
344
  profile: {}
420
345
  };
421
- var profileSlice = (0, import_toolkit9.createSlice)({
346
+ var profileSlice = createSlice9({
422
347
  name: "profile",
423
348
  initialState: initialState8,
424
349
  reducers: {
@@ -431,7 +356,7 @@ var { setProfile } = profileSlice.actions;
431
356
  var profile_slice_default = profileSlice.reducer;
432
357
 
433
358
  // src/store/reducers/search-slice/index.ts
434
- var import_toolkit10 = require("@reduxjs/toolkit");
359
+ import { createSlice as createSlice10 } from "@reduxjs/toolkit";
435
360
  var initialState9 = {
436
361
  groupByDomain: null,
437
362
  searchBy: [],
@@ -443,7 +368,7 @@ var initialState9 = {
443
368
  filterBy: [],
444
369
  groupBy: []
445
370
  };
446
- var searchSlice = (0, import_toolkit10.createSlice)({
371
+ var searchSlice = createSlice10({
447
372
  name: "search",
448
373
  initialState: initialState9,
449
374
  reducers: {
@@ -517,7 +442,7 @@ var {
517
442
  var search_slice_default = searchSlice.reducer;
518
443
 
519
444
  // src/store/store.ts
520
- var import_toolkit11 = require("@reduxjs/toolkit");
445
+ import { configureStore } from "@reduxjs/toolkit";
521
446
 
522
447
  // node_modules/redux/dist/redux.mjs
523
448
  function formatProdErrorMessage(code) {
@@ -701,7 +626,7 @@ var rootReducer = combineReducers({
701
626
  excel: excel_slice_default,
702
627
  profile: profile_slice_default
703
628
  });
704
- var envStore = (0, import_toolkit11.configureStore)({
629
+ var envStore = configureStore({
705
630
  reducer: rootReducer,
706
631
  middleware: (getDefaultMiddleware) => getDefaultMiddleware({
707
632
  serializableCheck: false
@@ -709,26 +634,26 @@ var envStore = (0, import_toolkit11.configureStore)({
709
634
  });
710
635
 
711
636
  // src/provider/redux-provider.tsx
712
- var import_jsx_runtime2 = require("react/jsx-runtime");
637
+ import { jsx as jsx2 } from "react/jsx-runtime";
713
638
  var ReduxProvider = ({ children }) => {
714
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_redux2.Provider, { store: envStore, children });
639
+ return /* @__PURE__ */ jsx2(Provider, { store: envStore, children });
715
640
  };
716
641
 
717
642
  // src/provider/main-provider.tsx
718
- var import_jsx_runtime3 = require("react/jsx-runtime");
643
+ import { jsx as jsx3 } from "react/jsx-runtime";
719
644
  var MainProvider = ({ children }) => {
720
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReduxProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReactQueryProvider, { children }) });
645
+ return /* @__PURE__ */ jsx3(ReduxProvider, { children: /* @__PURE__ */ jsx3(ReactQueryProvider, { children }) });
721
646
  };
722
647
 
723
648
  // src/provider/version-gate-provider.tsx
724
- var import_react2 = require("react");
725
- var import_react_query2 = require("@tanstack/react-query");
649
+ import { useEffect as useEffect2, useState as useState2 } from "react";
650
+ import { useQueryClient } from "@tanstack/react-query";
726
651
 
727
652
  // src/configs/axios-client.ts
728
- var import_axios = __toESM(require("axios"), 1);
653
+ import axios from "axios";
729
654
 
730
655
  // src/utils/format.ts
731
- var import_moment = __toESM(require("moment"), 1);
656
+ import moment from "moment";
732
657
 
733
658
  // src/utils/domain/py_tokenizer.ts
734
659
  var TokenizerError = class extends Error {
@@ -1808,6 +1733,22 @@ var PyRelativeDelta = class _PyRelativeDelta {
1808
1733
  this.microsecond = params.microsecond;
1809
1734
  this.weekday = params.weekday;
1810
1735
  }
1736
+ years;
1737
+ months;
1738
+ days;
1739
+ hours;
1740
+ minutes;
1741
+ seconds;
1742
+ microseconds;
1743
+ leapDays;
1744
+ year;
1745
+ month;
1746
+ day;
1747
+ hour;
1748
+ minute;
1749
+ second;
1750
+ microsecond;
1751
+ weekday;
1811
1752
  negate() {
1812
1753
  return new _PyRelativeDelta(this, -1);
1813
1754
  }
@@ -1922,7 +1863,7 @@ function execOnIterable(iterable, func) {
1922
1863
  if (typeof iterable === "object" && !Array.isArray(iterable) && !(iterable instanceof Set)) {
1923
1864
  iterable = Object.keys(iterable);
1924
1865
  }
1925
- if (typeof (iterable == null ? void 0 : iterable[Symbol.iterator]) !== "function") {
1866
+ if (typeof iterable?.[Symbol.iterator] !== "function") {
1926
1867
  throw new EvaluationError("value not iterable");
1927
1868
  }
1928
1869
  return func(iterable);
@@ -2245,7 +2186,7 @@ function applyBinaryOp(ast, context) {
2245
2186
  }
2246
2187
  return Math.floor(left / right);
2247
2188
  case "**":
2248
- return __pow(left, right);
2189
+ return left ** right;
2249
2190
  case "==":
2250
2191
  return isEqual(left, right);
2251
2192
  case "<>":
@@ -2367,7 +2308,7 @@ function evaluate(ast, context = {}) {
2367
2308
  const dicts = /* @__PURE__ */ new Set();
2368
2309
  let pyContext;
2369
2310
  const evalContext = Object.create(context);
2370
- if (!(evalContext == null ? void 0 : evalContext.context)) {
2311
+ if (!evalContext?.context) {
2371
2312
  Object.defineProperty(evalContext, "context", {
2372
2313
  get() {
2373
2314
  if (!pyContext) {
@@ -2378,18 +2319,17 @@ function evaluate(ast, context = {}) {
2378
2319
  });
2379
2320
  }
2380
2321
  function _innerEvaluate(ast2) {
2381
- var _a, _b, _c;
2382
- switch (ast2 == null ? void 0 : ast2.type) {
2322
+ switch (ast2?.type) {
2383
2323
  case 0:
2384
2324
  // Number
2385
2325
  case 1:
2386
2326
  return ast2.value;
2387
2327
  case 5:
2388
2328
  if (ast2.value in evalContext) {
2389
- if (typeof evalContext[ast2.value] === "object" && ((_a = evalContext[ast2.value]) == null ? void 0 : _a.id)) {
2390
- return (_b = evalContext[ast2.value]) == null ? void 0 : _b.id;
2329
+ if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
2330
+ return evalContext[ast2.value]?.id;
2391
2331
  }
2392
- return (_c = evalContext[ast2.value]) != null ? _c : false;
2332
+ return evalContext[ast2.value] ?? false;
2393
2333
  } else if (ast2.value in BUILTINS) {
2394
2334
  return BUILTINS[ast2.value];
2395
2335
  } else {
@@ -2426,7 +2366,7 @@ function evaluate(ast, context = {}) {
2426
2366
  const args = ast2.args.map(_evaluate);
2427
2367
  const kwargs = {};
2428
2368
  for (const kwarg in ast2.kwargs) {
2429
- kwargs[kwarg] = _evaluate(ast2 == null ? void 0 : ast2.kwargs[kwarg]);
2369
+ kwargs[kwarg] = _evaluate(ast2?.kwargs[kwarg]);
2430
2370
  }
2431
2371
  if (fnValue === PyDate || fnValue === PyDateTime || fnValue === PyTime || fnValue === PyRelativeDelta || fnValue === PyTimeDelta) {
2432
2372
  return fnValue.create(...args, kwargs);
@@ -2505,25 +2445,9 @@ function escapeRegExp(str) {
2505
2445
  var InvalidDomainError = class extends Error {
2506
2446
  };
2507
2447
  var Domain = class _Domain {
2508
- constructor(descr = []) {
2509
- this.ast = { type: -1, value: null };
2510
- if (descr instanceof _Domain) {
2511
- return new _Domain(descr.toString());
2512
- } else {
2513
- let rawAST;
2514
- try {
2515
- rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
2516
- } catch (error) {
2517
- throw new InvalidDomainError(
2518
- `Invalid domain representation: ${descr}`,
2519
- {
2520
- cause: error
2521
- }
2522
- );
2523
- }
2524
- this.ast = normalizeDomainAST(rawAST);
2525
- }
2526
- }
2448
+ ast = { type: -1, value: null };
2449
+ static TRUE;
2450
+ static FALSE;
2527
2451
  static combine(domains, operator) {
2528
2452
  if (domains.length === 0) {
2529
2453
  return new _Domain([]);
@@ -2602,6 +2526,24 @@ var Domain = class _Domain {
2602
2526
  processLeaf(d.ast.value, 0, "&", newDomain);
2603
2527
  return newDomain;
2604
2528
  }
2529
+ constructor(descr = []) {
2530
+ if (descr instanceof _Domain) {
2531
+ return new _Domain(descr.toString());
2532
+ } else {
2533
+ let rawAST;
2534
+ try {
2535
+ rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
2536
+ } catch (error) {
2537
+ throw new InvalidDomainError(
2538
+ `Invalid domain representation: ${descr}`,
2539
+ {
2540
+ cause: error
2541
+ }
2542
+ );
2543
+ }
2544
+ this.ast = normalizeDomainAST(rawAST);
2545
+ }
2546
+ }
2605
2547
  contains(record) {
2606
2548
  const expr = evaluate(this.ast, record);
2607
2549
  return matchDomain(record, expr);
@@ -2620,7 +2562,7 @@ var Domain = class _Domain {
2620
2562
  return evaluatedAsList;
2621
2563
  }
2622
2564
  return this.toString();
2623
- } catch (e) {
2565
+ } catch {
2624
2566
  return this.toString();
2625
2567
  }
2626
2568
  }
@@ -2820,7 +2762,7 @@ function matchDomain(record, domain) {
2820
2762
  }
2821
2763
 
2822
2764
  // src/utils/function.ts
2823
- var import_react = require("react");
2765
+ import { useEffect, useState } from "react";
2824
2766
  var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
2825
2767
  if (!originalRequest.data) return originalRequest.data;
2826
2768
  if (typeof originalRequest.data === "string") {
@@ -2843,22 +2785,22 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
2843
2785
 
2844
2786
  // src/utils/storage/local-storage.ts
2845
2787
  var localStorageUtils = () => {
2846
- const setToken = (access_token) => __async(null, null, function* () {
2788
+ const setToken = async (access_token) => {
2847
2789
  localStorage.setItem("accessToken", access_token);
2848
- });
2849
- const setRefreshToken = (refresh_token) => __async(null, null, function* () {
2790
+ };
2791
+ const setRefreshToken = async (refresh_token) => {
2850
2792
  localStorage.setItem("refreshToken", refresh_token);
2851
- });
2852
- const getAccessToken = () => __async(null, null, function* () {
2793
+ };
2794
+ const getAccessToken = async () => {
2853
2795
  return localStorage.getItem("accessToken");
2854
- });
2855
- const getRefreshToken = () => __async(null, null, function* () {
2796
+ };
2797
+ const getRefreshToken = async () => {
2856
2798
  return localStorage.getItem("refreshToken");
2857
- });
2858
- const clearToken = () => __async(null, null, function* () {
2799
+ };
2800
+ const clearToken = async () => {
2859
2801
  localStorage.removeItem("accessToken");
2860
2802
  localStorage.removeItem("refreshToken");
2861
- });
2803
+ };
2862
2804
  return {
2863
2805
  setToken,
2864
2806
  setRefreshToken,
@@ -2870,9 +2812,9 @@ var localStorageUtils = () => {
2870
2812
 
2871
2813
  // src/utils/storage/session-storage.ts
2872
2814
  var sessionStorageUtils = () => {
2873
- const getBrowserSession = () => __async(null, null, function* () {
2815
+ const getBrowserSession = async () => {
2874
2816
  return sessionStorage.getItem("browserSession");
2875
- });
2817
+ };
2876
2818
  return {
2877
2819
  getBrowserSession
2878
2820
  };
@@ -2881,14 +2823,13 @@ var sessionStorageUtils = () => {
2881
2823
  // src/configs/axios-client.ts
2882
2824
  var axiosClient = {
2883
2825
  init(config) {
2884
- var _a, _b;
2885
- const localStorage2 = (_a = config.localStorageUtils) != null ? _a : localStorageUtils();
2886
- const sessionStorage2 = (_b = config.sessionStorageUtils) != null ? _b : sessionStorageUtils();
2826
+ const localStorage2 = config.localStorageUtils ?? localStorageUtils();
2827
+ const sessionStorage2 = config.sessionStorageUtils ?? sessionStorageUtils();
2887
2828
  const db = config.db;
2888
2829
  let isRefreshing = false;
2889
2830
  let failedQueue = [];
2890
2831
  const processQueue = (error, token = null) => {
2891
- failedQueue == null ? void 0 : failedQueue.forEach((prom) => {
2832
+ failedQueue?.forEach((prom) => {
2892
2833
  if (error) {
2893
2834
  prom.reject(error);
2894
2835
  } else {
@@ -2897,21 +2838,21 @@ var axiosClient = {
2897
2838
  });
2898
2839
  failedQueue = [];
2899
2840
  };
2900
- const instance = import_axios.default.create({
2901
- adapter: import_axios.default.defaults.adapter,
2841
+ const instance = axios.create({
2842
+ adapter: axios.defaults.adapter,
2902
2843
  baseURL: config.baseUrl,
2903
2844
  timeout: 5e4,
2904
2845
  paramsSerializer: (params) => new URLSearchParams(params).toString()
2905
2846
  });
2906
2847
  instance.interceptors.request.use(
2907
- (config2) => __async(null, null, function* () {
2848
+ async (config2) => {
2908
2849
  const useRefreshToken = config2.useRefreshToken;
2909
- const token = useRefreshToken ? yield localStorage2.getRefreshToken() : yield localStorage2.getAccessToken();
2850
+ const token = useRefreshToken ? await localStorage2.getRefreshToken() : await localStorage2.getAccessToken();
2910
2851
  if (token) {
2911
2852
  config2.headers["Authorization"] = "Bearer " + token;
2912
2853
  }
2913
2854
  return config2;
2914
- }),
2855
+ },
2915
2856
  (error) => {
2916
2857
  Promise.reject(error);
2917
2858
  }
@@ -2920,21 +2861,19 @@ var axiosClient = {
2920
2861
  (response) => {
2921
2862
  return handleResponse(response);
2922
2863
  },
2923
- (error) => __async(null, null, function* () {
2924
- var _a2, _b2, _c;
2925
- const handleError3 = (error2) => __async(null, null, function* () {
2926
- var _a3;
2864
+ async (error) => {
2865
+ const handleError3 = async (error2) => {
2927
2866
  if (!error2.response) {
2928
2867
  return error2;
2929
2868
  }
2930
2869
  const { data } = error2.response;
2931
- if (data && data.code === 400 && ["invalid_grant"].includes((_a3 = data.data) == null ? void 0 : _a3.error)) {
2932
- yield clearAuthToken();
2870
+ if (data && data.code === 400 && ["invalid_grant"].includes(data.data?.error)) {
2871
+ await clearAuthToken();
2933
2872
  }
2934
2873
  return data;
2935
- });
2874
+ };
2936
2875
  const originalRequest = error.config;
2937
- 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(
2876
+ if ((error.response?.status === 403 || error.response?.status === 401 || error.response?.status === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
2938
2877
  error.response.data.code
2939
2878
  )) {
2940
2879
  if (isRefreshing) {
@@ -2947,19 +2886,18 @@ var axiosClient = {
2947
2886
  token
2948
2887
  );
2949
2888
  return instance.request(originalRequest);
2950
- }).catch((err) => __async(null, null, function* () {
2951
- var _a3, _b3;
2952
- 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)) {
2953
- yield clearAuthToken();
2889
+ }).catch(async (err) => {
2890
+ if ((err.response?.status === 400 || err.response?.status === 401) && ["invalid_grant"].includes(err.response.data.error)) {
2891
+ await clearAuthToken();
2954
2892
  }
2955
- }));
2893
+ });
2956
2894
  }
2957
- const browserSession = yield sessionStorage2.getBrowserSession();
2958
- const refreshToken = yield localStorage2.getRefreshToken();
2959
- const accessTokenExp = yield localStorage2.getAccessToken();
2895
+ const browserSession = await sessionStorage2.getBrowserSession();
2896
+ const refreshToken = await localStorage2.getRefreshToken();
2897
+ const accessTokenExp = await localStorage2.getAccessToken();
2960
2898
  isRefreshing = true;
2961
2899
  if (!refreshToken && (!browserSession || browserSession == "unActive")) {
2962
- yield clearAuthToken();
2900
+ await clearAuthToken();
2963
2901
  } else {
2964
2902
  const payload = Object.fromEntries(
2965
2903
  Object.entries({
@@ -2970,9 +2908,8 @@ var axiosClient = {
2970
2908
  }).filter(([_, value]) => !!value)
2971
2909
  );
2972
2910
  return new Promise(function(resolve) {
2973
- var _a3;
2974
- import_axios.default.post(
2975
- `${config.baseUrl}${(_a3 = config.refreshTokenEndpoint) != null ? _a3 : "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2911
+ axios.post(
2912
+ `${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2976
2913
  payload,
2977
2914
  {
2978
2915
  headers: {
@@ -2980,11 +2917,11 @@ var axiosClient = {
2980
2917
  Authorization: `Bearer ${accessTokenExp}`
2981
2918
  }
2982
2919
  }
2983
- ).then((res) => __async(null, null, function* () {
2920
+ ).then(async (res) => {
2984
2921
  const data = res.data;
2985
- yield localStorage2.setToken(data.access_token);
2986
- yield localStorage2.setRefreshToken(data.refresh_token);
2987
- import_axios.default.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
2922
+ await localStorage2.setToken(data.access_token);
2923
+ await localStorage2.setRefreshToken(data.refresh_token);
2924
+ axios.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
2988
2925
  originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
2989
2926
  originalRequest.data = updateTokenParamInOriginalRequest(
2990
2927
  originalRequest,
@@ -2992,26 +2929,25 @@ var axiosClient = {
2992
2929
  );
2993
2930
  processQueue(null, data.access_token);
2994
2931
  resolve(instance.request(originalRequest));
2995
- })).catch((err) => __async(null, null, function* () {
2996
- var _a4;
2997
- 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") {
2998
- yield clearAuthToken();
2932
+ }).catch(async (err) => {
2933
+ 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") {
2934
+ await clearAuthToken();
2999
2935
  }
3000
2936
  if (err && err.response) {
3001
- const { error_code } = ((_a4 = err.response) == null ? void 0 : _a4.data) || {};
2937
+ const { error_code } = err.response?.data || {};
3002
2938
  if (error_code === "AUTHEN_FAIL") {
3003
- yield clearAuthToken();
2939
+ await clearAuthToken();
3004
2940
  }
3005
2941
  }
3006
2942
  processQueue(err, null);
3007
- })).finally(() => {
2943
+ }).finally(() => {
3008
2944
  isRefreshing = false;
3009
2945
  });
3010
2946
  });
3011
2947
  }
3012
2948
  }
3013
- return Promise.reject(yield handleError3(error));
3014
- })
2949
+ return Promise.reject(await handleError3(error));
2950
+ }
3015
2951
  );
3016
2952
  const handleResponse = (res) => {
3017
2953
  if (res && res.data) {
@@ -3020,7 +2956,6 @@ var axiosClient = {
3020
2956
  return res;
3021
2957
  };
3022
2958
  const handleError2 = (error) => {
3023
- var _a2, _b2, _c;
3024
2959
  if (error.isAxiosError && error.code === "ECONNABORTED") {
3025
2960
  console.error("Request Timeout Error:", error);
3026
2961
  return "Request Timeout Error";
@@ -3028,17 +2963,17 @@ var axiosClient = {
3028
2963
  console.error("Network Error:", error);
3029
2964
  return "Network Error";
3030
2965
  } else {
3031
- console.error("Other Error:", error == null ? void 0 : error.response);
3032
- const errorMessage = ((_b2 = (_a2 = error == null ? void 0 : error.response) == null ? void 0 : _a2.data) == null ? void 0 : _b2.message) || "An error occurred";
3033
- return { message: errorMessage, status: (_c = error == null ? void 0 : error.response) == null ? void 0 : _c.status };
2966
+ console.error("Other Error:", error?.response);
2967
+ const errorMessage = error?.response?.data?.message || "An error occurred";
2968
+ return { message: errorMessage, status: error?.response?.status };
3034
2969
  }
3035
2970
  };
3036
- const clearAuthToken = () => __async(null, null, function* () {
3037
- yield localStorage2.clearToken();
2971
+ const clearAuthToken = async () => {
2972
+ await localStorage2.clearToken();
3038
2973
  if (typeof window !== "undefined") {
3039
2974
  window.location.href = `/login`;
3040
2975
  }
3041
- });
2976
+ };
3042
2977
  function formatUrl(url, db2) {
3043
2978
  return url + (db2 ? "?db=" + db2 : "");
3044
2979
  }
@@ -3062,7 +2997,20 @@ var axiosClient = {
3062
2997
  };
3063
2998
 
3064
2999
  // src/environment/EnvStore.ts
3065
- var _EnvStore = class _EnvStore {
3000
+ var EnvStore = class _EnvStore {
3001
+ static instance = null;
3002
+ envStore;
3003
+ baseUrl;
3004
+ requests;
3005
+ context;
3006
+ defaultCompany;
3007
+ config;
3008
+ companies;
3009
+ user;
3010
+ db;
3011
+ localStorageUtils;
3012
+ sessionStorageUtils;
3013
+ refreshTokenEndpoint;
3066
3014
  constructor(envStore2, localStorageUtils2, sessionStorageUtils2) {
3067
3015
  this.envStore = envStore2;
3068
3016
  this.localStorageUtils = localStorageUtils2;
@@ -3081,25 +3029,26 @@ var _EnvStore = class _EnvStore {
3081
3029
  }
3082
3030
  setup() {
3083
3031
  const env = this.envStore.getState().env;
3084
- this.baseUrl = env == null ? void 0 : env.baseUrl;
3085
- this.requests = env == null ? void 0 : env.requests;
3086
- this.context = env == null ? void 0 : env.context;
3087
- this.defaultCompany = env == null ? void 0 : env.defaultCompany;
3088
- this.config = env == null ? void 0 : env.config;
3089
- this.companies = (env == null ? void 0 : env.companies) || [];
3090
- this.user = env == null ? void 0 : env.user;
3091
- this.db = env == null ? void 0 : env.db;
3092
- this.refreshTokenEndpoint = env == null ? void 0 : env.refreshTokenEndpoint;
3032
+ this.baseUrl = env?.baseUrl;
3033
+ this.requests = env?.requests;
3034
+ this.context = env?.context;
3035
+ this.defaultCompany = env?.defaultCompany;
3036
+ this.config = env?.config;
3037
+ this.companies = env?.companies || [];
3038
+ this.user = env?.user;
3039
+ this.db = env?.db;
3040
+ this.refreshTokenEndpoint = env?.refreshTokenEndpoint;
3093
3041
  console.log("Env setup:", this);
3094
3042
  }
3095
3043
  setupEnv(envConfig) {
3096
3044
  const dispatch = this.envStore.dispatch;
3097
- const env = __spreadProps(__spreadValues({}, envConfig), {
3045
+ const env = {
3046
+ ...envConfig,
3098
3047
  localStorageUtils: this.localStorageUtils,
3099
3048
  sessionStorageUtils: this.sessionStorageUtils
3100
- });
3049
+ };
3101
3050
  const requests = axiosClient.init(env);
3102
- dispatch(setEnv(__spreadProps(__spreadValues({}, env), { requests })));
3051
+ dispatch(setEnv({ ...env, requests }));
3103
3052
  this.setup();
3104
3053
  }
3105
3054
  setUid(uid) {
@@ -3133,8 +3082,6 @@ var _EnvStore = class _EnvStore {
3133
3082
  this.setup();
3134
3083
  }
3135
3084
  };
3136
- _EnvStore.instance = null;
3137
- var EnvStore = _EnvStore;
3138
3085
  function getEnv() {
3139
3086
  const instance = EnvStore.getInstance(envStore);
3140
3087
  if (!instance) {
@@ -3145,509 +3092,473 @@ function getEnv() {
3145
3092
 
3146
3093
  // src/services/view-service/index.ts
3147
3094
  var ViewService = {
3148
- getView(_0) {
3149
- return __async(this, arguments, function* ({
3095
+ async getView({
3096
+ model,
3097
+ views,
3098
+ context = {},
3099
+ options = {},
3100
+ aid
3101
+ }) {
3102
+ const env = getEnv();
3103
+ const defaultOptions = {
3104
+ load_filters: true,
3105
+ toolbar: true,
3106
+ action_id: aid
3107
+ };
3108
+ const jsonDataView = {
3150
3109
  model,
3151
- views,
3152
- context = {},
3153
- options = {},
3154
- aid
3155
- }) {
3156
- var _a;
3157
- const env = getEnv();
3158
- const defaultOptions = {
3159
- load_filters: true,
3160
- toolbar: true,
3161
- action_id: aid
3162
- };
3163
- const jsonDataView = {
3164
- model,
3165
- method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
3166
- kwargs: {
3167
- views,
3168
- options: __spreadValues(__spreadValues({}, options), defaultOptions)
3169
- },
3170
- with_context: context
3171
- };
3172
- return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonDataView, {
3173
- headers: {
3174
- "Content-Type": "application/json"
3175
- }
3176
- });
3110
+ method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
3111
+ kwargs: {
3112
+ views,
3113
+ options: { ...options, ...defaultOptions }
3114
+ },
3115
+ with_context: context
3116
+ };
3117
+ return env?.requests?.post("/call" /* CALL_PATH */, jsonDataView, {
3118
+ headers: {
3119
+ "Content-Type": "application/json"
3120
+ }
3177
3121
  });
3178
3122
  },
3179
- getMenu(context) {
3180
- return __async(this, null, function* () {
3181
- var _a;
3182
- const env = getEnv();
3183
- const jsonData = {
3184
- model: "ir.ui.menu" /* MENU */,
3185
- method: "web_search_read" /* WEB_SEARCH_READ */,
3186
- ids: [],
3187
- with_context: context,
3188
- kwargs: {
3189
- specification: {
3190
- active: {},
3191
- name: {},
3192
- is_display: {},
3193
- sequence: {},
3194
- complete_name: {},
3195
- action: {
3196
- fields: {
3197
- display_name: {},
3198
- type: {},
3199
- binding_view_types: {}
3200
- // res_model: {},
3201
- }
3123
+ async getMenu(context) {
3124
+ const env = getEnv();
3125
+ const jsonData = {
3126
+ model: "ir.ui.menu" /* MENU */,
3127
+ method: "web_search_read" /* WEB_SEARCH_READ */,
3128
+ ids: [],
3129
+ with_context: context,
3130
+ kwargs: {
3131
+ specification: {
3132
+ active: {},
3133
+ name: {},
3134
+ is_display: {},
3135
+ sequence: {},
3136
+ complete_name: {},
3137
+ action: {
3138
+ fields: {
3139
+ display_name: {},
3140
+ type: {},
3141
+ binding_view_types: {}
3142
+ // res_model: {},
3143
+ }
3144
+ },
3145
+ url_icon: {},
3146
+ web_icon: {},
3147
+ web_icon_data: {},
3148
+ groups_id: {
3149
+ fields: {
3150
+ full_name: {}
3202
3151
  },
3203
- url_icon: {},
3204
- web_icon: {},
3205
- web_icon_data: {},
3206
- groups_id: {
3207
- fields: {
3208
- full_name: {}
3152
+ limit: 40,
3153
+ order: ""
3154
+ },
3155
+ display_name: {},
3156
+ child_id: {
3157
+ fields: {
3158
+ active: {},
3159
+ name: {},
3160
+ is_display: {},
3161
+ sequence: {},
3162
+ complete_name: {},
3163
+ action: {
3164
+ fields: {
3165
+ display_name: {},
3166
+ type: {},
3167
+ binding_view_types: {}
3168
+ // res_model: {},
3169
+ }
3209
3170
  },
3210
- limit: 40,
3211
- order: ""
3212
- },
3213
- display_name: {},
3214
- child_id: {
3215
- fields: {
3216
- active: {},
3217
- name: {},
3218
- is_display: {},
3219
- sequence: {},
3220
- complete_name: {},
3221
- action: {
3222
- fields: {
3223
- display_name: {},
3224
- type: {},
3225
- binding_view_types: {}
3226
- // res_model: {},
3227
- }
3171
+ url_icon: {},
3172
+ web_icon: {},
3173
+ web_icon_data: {},
3174
+ groups_id: {
3175
+ fields: {
3176
+ full_name: {}
3228
3177
  },
3229
- url_icon: {},
3230
- web_icon: {},
3231
- web_icon_data: {},
3232
- groups_id: {
3233
- fields: {
3234
- full_name: {}
3178
+ limit: 40,
3179
+ order: ""
3180
+ },
3181
+ display_name: {},
3182
+ child_id: {
3183
+ fields: {
3184
+ active: {},
3185
+ name: {},
3186
+ is_display: {},
3187
+ sequence: {},
3188
+ complete_name: {},
3189
+ action: {
3190
+ fields: {
3191
+ display_name: {},
3192
+ type: {},
3193
+ binding_view_types: {}
3194
+ // res_model: {},
3195
+ }
3235
3196
  },
3236
- limit: 40,
3237
- order: ""
3238
- },
3239
- display_name: {},
3240
- child_id: {
3241
- fields: {
3242
- active: {},
3243
- name: {},
3244
- is_display: {},
3245
- sequence: {},
3246
- complete_name: {},
3247
- action: {
3248
- fields: {
3249
- display_name: {},
3250
- type: {},
3251
- binding_view_types: {}
3252
- // res_model: {},
3253
- }
3197
+ url_icon: {},
3198
+ web_icon: {},
3199
+ web_icon_data: {},
3200
+ groups_id: {
3201
+ fields: {
3202
+ full_name: {}
3254
3203
  },
3255
- url_icon: {},
3256
- web_icon: {},
3257
- web_icon_data: {},
3258
- groups_id: {
3259
- fields: {
3260
- full_name: {}
3204
+ limit: 40,
3205
+ order: ""
3206
+ },
3207
+ display_name: {},
3208
+ child_id: {
3209
+ fields: {
3210
+ active: {},
3211
+ name: {},
3212
+ is_display: {},
3213
+ sequence: {},
3214
+ complete_name: {},
3215
+ action: {
3216
+ fields: {
3217
+ display_name: {},
3218
+ type: {},
3219
+ binding_view_types: {}
3220
+ // res_model: {},
3221
+ }
3261
3222
  },
3262
- limit: 40,
3263
- order: ""
3264
- },
3265
- display_name: {},
3266
- child_id: {
3267
- fields: {
3268
- active: {},
3269
- name: {},
3270
- is_display: {},
3271
- sequence: {},
3272
- complete_name: {},
3273
- action: {
3274
- fields: {
3275
- display_name: {},
3276
- type: {},
3277
- binding_view_types: {}
3278
- // res_model: {},
3279
- }
3223
+ url_icon: {},
3224
+ web_icon: {},
3225
+ web_icon_data: {},
3226
+ groups_id: {
3227
+ fields: {
3228
+ full_name: {}
3280
3229
  },
3281
- url_icon: {},
3282
- web_icon: {},
3283
- web_icon_data: {},
3284
- groups_id: {
3285
- fields: {
3286
- full_name: {}
3287
- },
3288
- limit: 40,
3289
- order: ""
3290
- },
3291
- display_name: {},
3292
- child_id: {
3293
- fields: {},
3294
- limit: 40,
3295
- order: ""
3296
- }
3230
+ limit: 40,
3231
+ order: ""
3297
3232
  },
3298
- limit: 40,
3299
- order: ""
3300
- }
3301
- },
3302
- limit: 40,
3303
- order: ""
3304
- }
3305
- },
3306
- limit: 40,
3307
- order: ""
3308
- }
3309
- },
3310
- domain: [
3311
- "&",
3312
- ["is_display", "=", true],
3313
- "&",
3314
- ["active", "=", true],
3315
- ["parent_id", "=", false]
3316
- ]
3317
- }
3318
- };
3319
- return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
3320
- headers: {
3321
- "Content-Type": "application/json"
3322
- }
3323
- });
3233
+ display_name: {},
3234
+ child_id: {
3235
+ fields: {},
3236
+ limit: 40,
3237
+ order: ""
3238
+ }
3239
+ },
3240
+ limit: 40,
3241
+ order: ""
3242
+ }
3243
+ },
3244
+ limit: 40,
3245
+ order: ""
3246
+ }
3247
+ },
3248
+ limit: 40,
3249
+ order: ""
3250
+ }
3251
+ },
3252
+ domain: [
3253
+ "&",
3254
+ ["is_display", "=", true],
3255
+ "&",
3256
+ ["active", "=", true],
3257
+ ["parent_id", "=", false]
3258
+ ]
3259
+ }
3260
+ };
3261
+ return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3262
+ headers: {
3263
+ "Content-Type": "application/json"
3264
+ }
3324
3265
  });
3325
3266
  },
3326
- getActionDetail(aid, context) {
3327
- return __async(this, null, function* () {
3328
- var _a;
3329
- const env = getEnv();
3330
- const jsonData = {
3331
- model: "ir.actions.act_window" /* WINDOW_ACTION */,
3332
- method: "web_read" /* WEB_READ */,
3333
- ids: [aid],
3334
- with_context: context,
3335
- kwargs: {
3336
- specification: {
3337
- id: {},
3338
- name: {},
3339
- res_model: {},
3340
- views: {},
3341
- view_mode: {},
3342
- mobile_view_mode: {},
3343
- domain: {},
3344
- context: {},
3345
- groups_id: {},
3346
- search_view_id: {}
3347
- }
3267
+ async getActionDetail(aid, context) {
3268
+ const env = getEnv();
3269
+ const jsonData = {
3270
+ model: "ir.actions.act_window" /* WINDOW_ACTION */,
3271
+ method: "web_read" /* WEB_READ */,
3272
+ ids: [aid],
3273
+ with_context: context,
3274
+ kwargs: {
3275
+ specification: {
3276
+ id: {},
3277
+ name: {},
3278
+ res_model: {},
3279
+ views: {},
3280
+ view_mode: {},
3281
+ mobile_view_mode: {},
3282
+ domain: {},
3283
+ context: {},
3284
+ groups_id: {},
3285
+ search_view_id: {}
3348
3286
  }
3349
- };
3350
- return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
3351
- headers: {
3352
- "Content-Type": "application/json"
3353
- }
3354
- });
3287
+ }
3288
+ };
3289
+ return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3290
+ headers: {
3291
+ "Content-Type": "application/json"
3292
+ }
3355
3293
  });
3356
3294
  },
3357
- getResequence(_0) {
3358
- return __async(this, arguments, function* ({
3295
+ async getResequence({
3296
+ model,
3297
+ ids,
3298
+ context,
3299
+ offset
3300
+ }) {
3301
+ const env = getEnv();
3302
+ const jsonData = {
3359
3303
  model,
3304
+ with_context: context,
3360
3305
  ids,
3361
- context,
3362
- offset
3363
- }) {
3364
- const env = getEnv();
3365
- const jsonData = __spreadValues({
3366
- model,
3367
- with_context: context,
3368
- ids,
3369
- field: "sequence"
3370
- }, offset > 0 ? { offset } : {});
3371
- return env == null ? void 0 : env.requests.post("/web/dataset/resequence", jsonData, {
3372
- headers: {
3373
- "Content-Type": "application/json"
3374
- }
3375
- });
3376
- });
3377
- },
3378
- getSelectionItem(_0) {
3379
- return __async(this, arguments, function* ({ data }) {
3380
- var _a;
3381
- const env = getEnv();
3382
- const jsonData = {
3383
- model: data.model,
3384
- ids: [],
3385
- method: "get_data_select",
3386
- with_context: data.context,
3387
- kwargs: {
3388
- count_limit: 10001,
3389
- domain: data.domain ? data.domain : [],
3390
- offset: 0,
3391
- order: "",
3392
- specification: (_a = data == null ? void 0 : data.specification) != null ? _a : {
3393
- id: {},
3394
- name: {},
3395
- display_name: {}
3396
- }
3397
- }
3398
- };
3399
- return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
3400
- headers: {
3401
- "Content-Type": "application/json"
3402
- }
3403
- });
3306
+ field: "sequence",
3307
+ ...offset > 0 ? { offset } : {}
3308
+ };
3309
+ return env?.requests.post("/web/dataset/resequence", jsonData, {
3310
+ headers: {
3311
+ "Content-Type": "application/json"
3312
+ }
3404
3313
  });
3405
3314
  },
3406
- loadMessages() {
3407
- return __async(this, null, function* () {
3408
- const env = getEnv();
3409
- return env.requests.post(
3410
- "/load_message_failures" /* LOAD_MESSAGE */,
3411
- {},
3412
- {
3413
- headers: {
3414
- "Content-Type": "application/json"
3415
- }
3315
+ async getSelectionItem({ data }) {
3316
+ const env = getEnv();
3317
+ const jsonData = {
3318
+ model: data.model,
3319
+ ids: [],
3320
+ method: "get_data_select",
3321
+ with_context: data.context,
3322
+ kwargs: {
3323
+ count_limit: 10001,
3324
+ domain: data.domain ? data.domain : [],
3325
+ offset: 0,
3326
+ order: "",
3327
+ specification: data?.specification ?? {
3328
+ id: {},
3329
+ name: {},
3330
+ display_name: {}
3416
3331
  }
3417
- );
3332
+ }
3333
+ };
3334
+ return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
3335
+ headers: {
3336
+ "Content-Type": "application/json"
3337
+ }
3418
3338
  });
3419
3339
  },
3420
- getVersion() {
3421
- return __async(this, null, function* () {
3422
- var _a;
3423
- const env = getEnv();
3424
- console.log("env?.requests", env, env == null ? void 0 : env.requests);
3425
- return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.get("", {
3340
+ async loadMessages() {
3341
+ const env = getEnv();
3342
+ return env.requests.post(
3343
+ "/load_message_failures" /* LOAD_MESSAGE */,
3344
+ {},
3345
+ {
3426
3346
  headers: {
3427
3347
  "Content-Type": "application/json"
3428
3348
  }
3429
- });
3349
+ }
3350
+ );
3351
+ },
3352
+ async getVersion() {
3353
+ const env = getEnv();
3354
+ console.log("env?.requests", env, env?.requests);
3355
+ return env?.requests?.get("", {
3356
+ headers: {
3357
+ "Content-Type": "application/json"
3358
+ }
3430
3359
  });
3431
3360
  },
3432
- get2FAMethods(_0) {
3433
- return __async(this, arguments, function* ({
3361
+ async get2FAMethods({
3362
+ method,
3363
+ with_context
3364
+ }) {
3365
+ const env = getEnv();
3366
+ const jsonData = {
3434
3367
  method,
3435
3368
  with_context
3436
- }) {
3437
- const env = getEnv();
3438
- const jsonData = {
3439
- method,
3440
- with_context
3441
- };
3442
- return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
3443
- headers: {
3444
- "Content-Type": "application/json"
3445
- }
3446
- });
3369
+ };
3370
+ return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
3371
+ headers: {
3372
+ "Content-Type": "application/json"
3373
+ }
3447
3374
  });
3448
3375
  },
3449
- verify2FA(_0) {
3450
- return __async(this, arguments, function* ({
3376
+ async verify2FA({
3377
+ method,
3378
+ with_context,
3379
+ code,
3380
+ device,
3381
+ location
3382
+ }) {
3383
+ const env = getEnv();
3384
+ const jsonData = {
3451
3385
  method,
3452
- with_context,
3453
- code,
3454
- device,
3455
- location
3456
- }) {
3457
- const env = getEnv();
3458
- const jsonData = {
3459
- method,
3460
- kwargs: {
3461
- vals: {
3462
- code,
3463
- device,
3464
- location
3465
- }
3466
- },
3467
- with_context
3468
- };
3469
- return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
3470
- headers: {
3471
- "Content-Type": "application/json"
3472
- },
3473
- withCredentials: true
3474
- });
3386
+ kwargs: {
3387
+ vals: {
3388
+ code,
3389
+ device,
3390
+ location
3391
+ }
3392
+ },
3393
+ with_context
3394
+ };
3395
+ return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
3396
+ headers: {
3397
+ "Content-Type": "application/json"
3398
+ },
3399
+ withCredentials: true
3475
3400
  });
3476
3401
  },
3477
- signInSSO(_0) {
3478
- return __async(this, arguments, function* ({
3479
- redirect_uri,
3480
- state,
3481
- client_id,
3402
+ async signInSSO({
3403
+ redirect_uri,
3404
+ state,
3405
+ client_id,
3406
+ response_type,
3407
+ path
3408
+ }) {
3409
+ const env = getEnv();
3410
+ const params = new URLSearchParams({
3482
3411
  response_type,
3483
- path
3484
- }) {
3485
- const env = getEnv();
3486
- const params = new URLSearchParams({
3487
- response_type,
3488
- client_id,
3489
- redirect_uri,
3490
- state
3491
- });
3492
- const url = `${path}?${params.toString()}`;
3493
- return env == null ? void 0 : env.requests.get(url, {
3494
- headers: {
3495
- "Content-Type": "application/json"
3496
- },
3497
- withCredentials: true
3498
- });
3412
+ client_id,
3413
+ redirect_uri,
3414
+ state
3415
+ });
3416
+ const url = `${path}?${params.toString()}`;
3417
+ return env?.requests.get(url, {
3418
+ headers: {
3419
+ "Content-Type": "application/json"
3420
+ },
3421
+ withCredentials: true
3499
3422
  });
3500
3423
  },
3501
- grantAccess(_0) {
3502
- return __async(this, arguments, function* ({
3424
+ async grantAccess({
3425
+ redirect_uri,
3426
+ state,
3427
+ client_id,
3428
+ scopes
3429
+ }) {
3430
+ const env = getEnv();
3431
+ const jsonData = {
3503
3432
  redirect_uri,
3504
3433
  state,
3505
3434
  client_id,
3506
3435
  scopes
3507
- }) {
3508
- const env = getEnv();
3509
- const jsonData = {
3510
- redirect_uri,
3511
- state,
3512
- client_id,
3513
- scopes
3514
- };
3515
- return env == null ? void 0 : env.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
3516
- headers: {
3517
- "Content-Type": "application/json"
3518
- },
3519
- withCredentials: true
3520
- });
3436
+ };
3437
+ return env?.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
3438
+ headers: {
3439
+ "Content-Type": "application/json"
3440
+ },
3441
+ withCredentials: true
3521
3442
  });
3522
3443
  },
3523
- getFieldsViewSecurity(_0) {
3524
- return __async(this, arguments, function* ({
3444
+ async getFieldsViewSecurity({
3445
+ method,
3446
+ token,
3447
+ views
3448
+ }) {
3449
+ const env = getEnv();
3450
+ const jsonData = {
3525
3451
  method,
3526
- token,
3527
- views
3528
- }) {
3529
- const env = getEnv();
3530
- const jsonData = {
3531
- method,
3532
- kwargs: {
3533
- views
3534
- },
3535
- with_context: {
3536
- token
3537
- }
3538
- };
3539
- return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
3540
- headers: {
3541
- "Content-Type": "application/json"
3542
- }
3543
- });
3452
+ kwargs: {
3453
+ views
3454
+ },
3455
+ with_context: {
3456
+ token
3457
+ }
3458
+ };
3459
+ return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
3460
+ headers: {
3461
+ "Content-Type": "application/json"
3462
+ }
3544
3463
  });
3545
3464
  },
3546
- settingsWebRead2fa(_0) {
3547
- return __async(this, arguments, function* ({
3465
+ async settingsWebRead2fa({
3466
+ method,
3467
+ model,
3468
+ kwargs,
3469
+ token
3470
+ }) {
3471
+ const env = getEnv();
3472
+ const jsonData = {
3548
3473
  method,
3549
3474
  model,
3550
3475
  kwargs,
3551
- token
3552
- }) {
3553
- const env = getEnv();
3554
- const jsonData = {
3555
- method,
3556
- model,
3557
- kwargs,
3558
- with_context: {
3559
- token
3560
- }
3561
- };
3562
- return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
3563
- headers: {
3564
- "Content-Type": "application/json"
3565
- }
3566
- });
3476
+ with_context: {
3477
+ token
3478
+ }
3479
+ };
3480
+ return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
3481
+ headers: {
3482
+ "Content-Type": "application/json"
3483
+ }
3567
3484
  });
3568
3485
  },
3569
- requestSetupTotp(_0) {
3570
- return __async(this, arguments, function* ({ method, token }) {
3571
- const env = getEnv();
3572
- const jsonData = {
3573
- method,
3574
- with_context: {
3575
- token
3576
- }
3577
- };
3578
- return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
3579
- headers: {
3580
- "Content-Type": "application/json"
3581
- }
3582
- });
3486
+ async requestSetupTotp({ method, token }) {
3487
+ const env = getEnv();
3488
+ const jsonData = {
3489
+ method,
3490
+ with_context: {
3491
+ token
3492
+ }
3493
+ };
3494
+ return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
3495
+ headers: {
3496
+ "Content-Type": "application/json"
3497
+ }
3583
3498
  });
3584
3499
  },
3585
- verifyTotp(_0) {
3586
- return __async(this, arguments, function* ({
3500
+ async verifyTotp({
3501
+ method,
3502
+ action_token,
3503
+ code
3504
+ }) {
3505
+ const env = getEnv();
3506
+ const jsonData = {
3587
3507
  method,
3588
- action_token,
3589
- code
3590
- }) {
3591
- const env = getEnv();
3592
- const jsonData = {
3593
- method,
3594
- kwargs: {
3595
- vals: {
3596
- code
3597
- }
3598
- },
3599
- with_context: {
3600
- action_token
3508
+ kwargs: {
3509
+ vals: {
3510
+ code
3601
3511
  }
3602
- };
3603
- return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
3604
- headers: {
3605
- "Content-Type": "application/json"
3606
- }
3607
- });
3512
+ },
3513
+ with_context: {
3514
+ action_token
3515
+ }
3516
+ };
3517
+ return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
3518
+ headers: {
3519
+ "Content-Type": "application/json"
3520
+ }
3608
3521
  });
3609
3522
  },
3610
- removeTotpSetUp(_0) {
3611
- return __async(this, arguments, function* ({ method, token }) {
3612
- const env = getEnv();
3613
- const jsonData = {
3614
- method,
3615
- with_context: {
3616
- token
3617
- }
3618
- };
3619
- return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
3620
- headers: {
3621
- "Content-Type": "application/json"
3622
- }
3623
- });
3523
+ async removeTotpSetUp({ method, token }) {
3524
+ const env = getEnv();
3525
+ const jsonData = {
3526
+ method,
3527
+ with_context: {
3528
+ token
3529
+ }
3530
+ };
3531
+ return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
3532
+ headers: {
3533
+ "Content-Type": "application/json"
3534
+ }
3624
3535
  });
3625
3536
  }
3626
3537
  };
3627
3538
  var view_service_default = ViewService;
3628
3539
 
3629
3540
  // src/provider/version-gate-provider.tsx
3630
- var import_jsx_runtime4 = require("react/jsx-runtime");
3541
+ import { Fragment, jsx as jsx4 } from "react/jsx-runtime";
3631
3542
  var VersionGate = ({ children }) => {
3632
- const queryClient = (0, import_react_query2.useQueryClient)();
3633
- const [ready, setReady] = (0, import_react2.useState)(false);
3634
- (0, import_react2.useEffect)(() => {
3543
+ const queryClient = useQueryClient();
3544
+ const [ready, setReady] = useState2(false);
3545
+ useEffect2(() => {
3635
3546
  const clearVersion = () => {
3636
3547
  queryClient.clear();
3637
3548
  localStorage.removeItem("__api_version__");
3638
3549
  };
3639
- const validateVersion = () => __async(null, null, function* () {
3640
- const serverVersion = yield view_service_default.getVersion();
3550
+ const validateVersion = async () => {
3551
+ const serverVersion = await view_service_default.getVersion();
3641
3552
  console.log("serverVersion", serverVersion);
3642
3553
  const cached = localStorage.getItem("__api_version__");
3643
- if (cached !== (serverVersion == null ? void 0 : serverVersion.api_version)) {
3554
+ if (cached !== serverVersion?.api_version) {
3644
3555
  clearVersion();
3645
- localStorage.setItem("__api_version__", serverVersion == null ? void 0 : serverVersion.api_version);
3556
+ localStorage.setItem("__api_version__", serverVersion?.api_version);
3646
3557
  } else {
3647
- console.log("Api version:", serverVersion == null ? void 0 : serverVersion.api_version);
3558
+ console.log("Api version:", serverVersion?.api_version);
3648
3559
  }
3649
3560
  setReady(true);
3650
- });
3561
+ };
3651
3562
  validateVersion();
3652
3563
  if (typeof window !== "undefined") {
3653
3564
  const onKey = (e) => {
@@ -3659,11 +3570,10 @@ var VersionGate = ({ children }) => {
3659
3570
  return () => window.removeEventListener("keydown", onKey);
3660
3571
  }
3661
3572
  }, [queryClient]);
3662
- return ready ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children }) : null;
3573
+ return ready ? /* @__PURE__ */ jsx4(Fragment, { children }) : null;
3663
3574
  };
3664
- // Annotate the CommonJS export names for ESM import in node:
3665
- 0 && (module.exports = {
3575
+ export {
3666
3576
  MainProvider,
3667
3577
  ReactQueryProvider,
3668
3578
  VersionGate
3669
- });
3579
+ };