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