@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.
- package/dist/{configs.d.cts → configs.d.mts} +1 -1
- package/dist/configs.js +140 -115
- package/dist/{configs.cjs → configs.mjs} +105 -152
- package/dist/constants.js +41 -2
- package/dist/{constants.cjs → constants.mjs} +2 -40
- package/dist/environment.js +190 -170
- package/dist/{environment.cjs → environment.mjs} +156 -210
- package/dist/{hooks.d.cts → hooks.d.mts} +1 -1
- package/dist/hooks.js +1730 -1792
- package/dist/{hooks.cjs → hooks.mjs} +1631 -1897
- package/dist/{provider.d.cts → provider.d.mts} +1 -1
- package/dist/provider.d.ts +1 -1
- package/dist/provider.js +594 -610
- package/dist/{provider.cjs → provider.mjs} +560 -650
- package/dist/{services.d.cts → services.d.mts} +1 -1
- package/dist/services.js +1439 -1562
- package/dist/{services.cjs → services.mjs} +1399 -1608
- package/dist/{store.d.cts → store.d.mts} +127 -127
- package/dist/store.d.ts +127 -127
- package/dist/store.js +129 -41
- package/dist/{store.cjs → store.mjs} +28 -146
- package/dist/{types.d.cts → types.d.mts} +1 -1
- package/dist/types.js +18 -0
- package/dist/types.mjs +0 -0
- package/dist/{utils.d.cts → utils.d.mts} +2 -2
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +176 -135
- package/dist/{utils.cjs → utils.mjs} +115 -202
- package/package.json +1 -2
- package/dist/types.cjs +0 -17
- /package/dist/{constants.d.cts → constants.d.mts} +0 -0
- /package/dist/{environment.d.cts → environment.d.mts} +0 -0
- /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
|
-
|
|
78
|
-
|
|
2
|
+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
79
4
|
var ReactQueryProvider = ({ children }) => {
|
|
80
|
-
const queryClient = new
|
|
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__ */
|
|
16
|
+
return /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children });
|
|
92
17
|
};
|
|
93
18
|
|
|
94
19
|
// src/provider/redux-provider.tsx
|
|
95
|
-
|
|
20
|
+
import { Provider } from "react-redux";
|
|
96
21
|
|
|
97
22
|
// src/store/index.ts
|
|
98
|
-
|
|
23
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
99
24
|
|
|
100
25
|
// src/store/reducers/breadcrums-slice/index.ts
|
|
101
|
-
|
|
26
|
+
import { createSlice } from "@reduxjs/toolkit";
|
|
102
27
|
var initialState = {
|
|
103
28
|
breadCrumbs: []
|
|
104
29
|
};
|
|
105
|
-
var breadcrumbsSlice =
|
|
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
|
-
|
|
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 = (
|
|
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
|
-
|
|
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 = (
|
|
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
|
-
|
|
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 = (
|
|
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
|
-
|
|
280
|
-
var headerSlice = (
|
|
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 =
|
|
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
|
-
|
|
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 = (
|
|
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
|
-
|
|
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 = (
|
|
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
|
-
|
|
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 = (
|
|
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
|
-
|
|
342
|
+
import { createSlice as createSlice9 } from "@reduxjs/toolkit";
|
|
418
343
|
var initialState8 = {
|
|
419
344
|
profile: {}
|
|
420
345
|
};
|
|
421
|
-
var profileSlice = (
|
|
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
|
-
|
|
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 = (
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
637
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
713
638
|
var ReduxProvider = ({ children }) => {
|
|
714
|
-
return /* @__PURE__ */ (
|
|
639
|
+
return /* @__PURE__ */ jsx2(Provider, { store: envStore, children });
|
|
715
640
|
};
|
|
716
641
|
|
|
717
642
|
// src/provider/main-provider.tsx
|
|
718
|
-
|
|
643
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
719
644
|
var MainProvider = ({ children }) => {
|
|
720
|
-
return /* @__PURE__ */ (
|
|
645
|
+
return /* @__PURE__ */ jsx3(ReduxProvider, { children: /* @__PURE__ */ jsx3(ReactQueryProvider, { children }) });
|
|
721
646
|
};
|
|
722
647
|
|
|
723
648
|
// src/provider/version-gate-provider.tsx
|
|
724
|
-
|
|
725
|
-
|
|
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
|
-
|
|
653
|
+
import axios from "axios";
|
|
729
654
|
|
|
730
655
|
// src/utils/format.ts
|
|
731
|
-
|
|
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
|
|
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
|
|
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 (!
|
|
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
|
-
|
|
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" &&
|
|
2390
|
-
return
|
|
2329
|
+
if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
|
|
2330
|
+
return evalContext[ast2.value]?.id;
|
|
2391
2331
|
}
|
|
2392
|
-
return
|
|
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
|
|
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
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
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
|
|
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
|
-
|
|
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) =>
|
|
2788
|
+
const setToken = async (access_token) => {
|
|
2847
2789
|
localStorage.setItem("accessToken", access_token);
|
|
2848
|
-
}
|
|
2849
|
-
const setRefreshToken = (refresh_token) =>
|
|
2790
|
+
};
|
|
2791
|
+
const setRefreshToken = async (refresh_token) => {
|
|
2850
2792
|
localStorage.setItem("refreshToken", refresh_token);
|
|
2851
|
-
}
|
|
2852
|
-
const getAccessToken = () =>
|
|
2793
|
+
};
|
|
2794
|
+
const getAccessToken = async () => {
|
|
2853
2795
|
return localStorage.getItem("accessToken");
|
|
2854
|
-
}
|
|
2855
|
-
const getRefreshToken = () =>
|
|
2796
|
+
};
|
|
2797
|
+
const getRefreshToken = async () => {
|
|
2856
2798
|
return localStorage.getItem("refreshToken");
|
|
2857
|
-
}
|
|
2858
|
-
const clearToken = () =>
|
|
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 = () =>
|
|
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
|
-
|
|
2885
|
-
const
|
|
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
|
|
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 =
|
|
2901
|
-
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) =>
|
|
2848
|
+
async (config2) => {
|
|
2908
2849
|
const useRefreshToken = config2.useRefreshToken;
|
|
2909
|
-
const token = useRefreshToken ?
|
|
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) =>
|
|
2924
|
-
|
|
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(
|
|
2932
|
-
|
|
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 ((
|
|
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) =>
|
|
2951
|
-
|
|
2952
|
-
|
|
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 =
|
|
2958
|
-
const refreshToken =
|
|
2959
|
-
const accessTokenExp =
|
|
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
|
-
|
|
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
|
-
|
|
2974
|
-
|
|
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) =>
|
|
2920
|
+
).then(async (res) => {
|
|
2984
2921
|
const data = res.data;
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
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
|
-
})
|
|
2996
|
-
|
|
2997
|
-
|
|
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 } =
|
|
2937
|
+
const { error_code } = err.response?.data || {};
|
|
3002
2938
|
if (error_code === "AUTHEN_FAIL") {
|
|
3003
|
-
|
|
2939
|
+
await clearAuthToken();
|
|
3004
2940
|
}
|
|
3005
2941
|
}
|
|
3006
2942
|
processQueue(err, null);
|
|
3007
|
-
})
|
|
2943
|
+
}).finally(() => {
|
|
3008
2944
|
isRefreshing = false;
|
|
3009
2945
|
});
|
|
3010
2946
|
});
|
|
3011
2947
|
}
|
|
3012
2948
|
}
|
|
3013
|
-
return Promise.reject(
|
|
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
|
|
3032
|
-
const errorMessage =
|
|
3033
|
-
return { message: errorMessage, 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 = () =>
|
|
3037
|
-
|
|
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
|
|
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
|
|
3085
|
-
this.requests = env
|
|
3086
|
-
this.context = env
|
|
3087
|
-
this.defaultCompany = env
|
|
3088
|
-
this.config = env
|
|
3089
|
-
this.companies =
|
|
3090
|
-
this.user = env
|
|
3091
|
-
this.db = env
|
|
3092
|
-
this.refreshTokenEndpoint = env
|
|
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 =
|
|
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(
|
|
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(
|
|
3149
|
-
|
|
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
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
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
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
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
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
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
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
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
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
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
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
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
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
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
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
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
|
-
|
|
3282
|
-
|
|
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
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
"
|
|
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
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
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
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
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(
|
|
3358
|
-
|
|
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
|
-
|
|
3362
|
-
offset
|
|
3363
|
-
}
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
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
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
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
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
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(
|
|
3433
|
-
|
|
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
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
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(
|
|
3450
|
-
|
|
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
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
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(
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
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
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
}
|
|
3492
|
-
|
|
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(
|
|
3502
|
-
|
|
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
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
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(
|
|
3524
|
-
|
|
3444
|
+
async getFieldsViewSecurity({
|
|
3445
|
+
method,
|
|
3446
|
+
token,
|
|
3447
|
+
views
|
|
3448
|
+
}) {
|
|
3449
|
+
const env = getEnv();
|
|
3450
|
+
const jsonData = {
|
|
3525
3451
|
method,
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
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(
|
|
3547
|
-
|
|
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
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
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(
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
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(
|
|
3586
|
-
|
|
3500
|
+
async verifyTotp({
|
|
3501
|
+
method,
|
|
3502
|
+
action_token,
|
|
3503
|
+
code
|
|
3504
|
+
}) {
|
|
3505
|
+
const env = getEnv();
|
|
3506
|
+
const jsonData = {
|
|
3587
3507
|
method,
|
|
3588
|
-
|
|
3589
|
-
|
|
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
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
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(
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
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
|
-
|
|
3541
|
+
import { Fragment, jsx as jsx4 } from "react/jsx-runtime";
|
|
3631
3542
|
var VersionGate = ({ children }) => {
|
|
3632
|
-
const queryClient =
|
|
3633
|
-
const [ready, setReady] = (
|
|
3634
|
-
(
|
|
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 = () =>
|
|
3640
|
-
const serverVersion =
|
|
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 !==
|
|
3554
|
+
if (cached !== serverVersion?.api_version) {
|
|
3644
3555
|
clearVersion();
|
|
3645
|
-
localStorage.setItem("__api_version__", serverVersion
|
|
3556
|
+
localStorage.setItem("__api_version__", serverVersion?.api_version);
|
|
3646
3557
|
} else {
|
|
3647
|
-
console.log("Api version:", serverVersion
|
|
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__ */ (
|
|
3573
|
+
return ready ? /* @__PURE__ */ jsx4(Fragment, { children }) : null;
|
|
3663
3574
|
};
|
|
3664
|
-
|
|
3665
|
-
0 && (module.exports = {
|
|
3575
|
+
export {
|
|
3666
3576
|
MainProvider,
|
|
3667
3577
|
ReactQueryProvider,
|
|
3668
3578
|
VersionGate
|
|
3669
|
-
}
|
|
3579
|
+
};
|