@fctc/interface-logic 1.5.5 → 1.5.7

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