@fctc/interface-logic 1.5.8 → 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.mts +0 -1
- package/dist/configs.d.ts +0 -1
- package/dist/configs.js +103 -116
- package/dist/configs.mjs +102 -117
- package/dist/constants.js +1 -0
- package/dist/environment.d.mts +1 -4
- package/dist/environment.d.ts +1 -4
- package/dist/environment.js +141 -159
- package/dist/environment.mjs +140 -162
- package/dist/hooks.d.mts +6 -1
- package/dist/hooks.d.ts +6 -1
- package/dist/hooks.js +1568 -1704
- package/dist/hooks.mjs +1522 -1663
- package/dist/provider.d.mts +1 -1
- package/dist/provider.d.ts +1 -1
- package/dist/provider.js +527 -583
- package/dist/provider.mjs +526 -586
- package/dist/services.d.mts +1 -0
- package/dist/services.d.ts +1 -0
- package/dist/services.js +1387 -1541
- package/dist/services.mjs +1386 -1544
- package/dist/store.d.mts +155 -127
- package/dist/store.d.ts +155 -127
- package/dist/store.js +4 -15
- package/dist/store.mjs +3 -18
- package/dist/types.js +1 -0
- package/dist/utils.d.mts +2 -2
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +95 -116
- package/dist/utils.mjs +94 -119
- package/package.json +81 -82
package/dist/provider.mjs
CHANGED
|
@@ -1,44 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __pow = Math.pow;
|
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
-
var __spreadValues = (a, b) => {
|
|
10
|
-
for (var prop in b || (b = {}))
|
|
11
|
-
if (__hasOwnProp.call(b, prop))
|
|
12
|
-
__defNormalProp(a, prop, b[prop]);
|
|
13
|
-
if (__getOwnPropSymbols)
|
|
14
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
-
if (__propIsEnum.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
}
|
|
18
|
-
return a;
|
|
19
|
-
};
|
|
20
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
-
var __async = (__this, __arguments, generator) => {
|
|
22
|
-
return new Promise((resolve, reject) => {
|
|
23
|
-
var fulfilled = (value) => {
|
|
24
|
-
try {
|
|
25
|
-
step(generator.next(value));
|
|
26
|
-
} catch (e) {
|
|
27
|
-
reject(e);
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
var rejected = (value) => {
|
|
31
|
-
try {
|
|
32
|
-
step(generator.throw(value));
|
|
33
|
-
} catch (e) {
|
|
34
|
-
reject(e);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
38
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
|
|
42
1
|
// src/provider/react-query-provider.tsx
|
|
43
2
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
44
3
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -87,6 +46,8 @@ var initialState2 = {
|
|
|
87
46
|
requests: null,
|
|
88
47
|
companies: [],
|
|
89
48
|
user: {},
|
|
49
|
+
db: "",
|
|
50
|
+
refreshTokenEndpoint: "",
|
|
90
51
|
config: null,
|
|
91
52
|
envFile: null,
|
|
92
53
|
defaultCompany: {
|
|
@@ -250,7 +211,7 @@ var headerSlice = createSlice5({
|
|
|
250
211
|
},
|
|
251
212
|
reducers: {
|
|
252
213
|
setHeader: (state, action) => {
|
|
253
|
-
state.value =
|
|
214
|
+
state.value = { ...state.value, ...action.payload };
|
|
254
215
|
},
|
|
255
216
|
setAllowedCompanyIds: (state, action) => {
|
|
256
217
|
state.value.allowedCompanyIds = action.payload;
|
|
@@ -1774,6 +1735,22 @@ var PyRelativeDelta = class _PyRelativeDelta {
|
|
|
1774
1735
|
this.microsecond = params.microsecond;
|
|
1775
1736
|
this.weekday = params.weekday;
|
|
1776
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;
|
|
1777
1754
|
negate() {
|
|
1778
1755
|
return new _PyRelativeDelta(this, -1);
|
|
1779
1756
|
}
|
|
@@ -1888,7 +1865,7 @@ function execOnIterable(iterable, func) {
|
|
|
1888
1865
|
if (typeof iterable === "object" && !Array.isArray(iterable) && !(iterable instanceof Set)) {
|
|
1889
1866
|
iterable = Object.keys(iterable);
|
|
1890
1867
|
}
|
|
1891
|
-
if (typeof
|
|
1868
|
+
if (typeof iterable?.[Symbol.iterator] !== "function") {
|
|
1892
1869
|
throw new EvaluationError("value not iterable");
|
|
1893
1870
|
}
|
|
1894
1871
|
return func(iterable);
|
|
@@ -2211,7 +2188,7 @@ function applyBinaryOp(ast, context) {
|
|
|
2211
2188
|
}
|
|
2212
2189
|
return Math.floor(left / right);
|
|
2213
2190
|
case "**":
|
|
2214
|
-
return
|
|
2191
|
+
return left ** right;
|
|
2215
2192
|
case "==":
|
|
2216
2193
|
return isEqual(left, right);
|
|
2217
2194
|
case "<>":
|
|
@@ -2333,7 +2310,7 @@ function evaluate(ast, context = {}) {
|
|
|
2333
2310
|
const dicts = /* @__PURE__ */ new Set();
|
|
2334
2311
|
let pyContext;
|
|
2335
2312
|
const evalContext = Object.create(context);
|
|
2336
|
-
if (!
|
|
2313
|
+
if (!evalContext?.context) {
|
|
2337
2314
|
Object.defineProperty(evalContext, "context", {
|
|
2338
2315
|
get() {
|
|
2339
2316
|
if (!pyContext) {
|
|
@@ -2344,18 +2321,17 @@ function evaluate(ast, context = {}) {
|
|
|
2344
2321
|
});
|
|
2345
2322
|
}
|
|
2346
2323
|
function _innerEvaluate(ast2) {
|
|
2347
|
-
|
|
2348
|
-
switch (ast2 == null ? void 0 : ast2.type) {
|
|
2324
|
+
switch (ast2?.type) {
|
|
2349
2325
|
case 0:
|
|
2350
2326
|
// Number
|
|
2351
2327
|
case 1:
|
|
2352
2328
|
return ast2.value;
|
|
2353
2329
|
case 5:
|
|
2354
2330
|
if (ast2.value in evalContext) {
|
|
2355
|
-
if (typeof evalContext[ast2.value] === "object" &&
|
|
2356
|
-
return
|
|
2331
|
+
if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
|
|
2332
|
+
return evalContext[ast2.value]?.id;
|
|
2357
2333
|
}
|
|
2358
|
-
return
|
|
2334
|
+
return evalContext[ast2.value] ?? false;
|
|
2359
2335
|
} else if (ast2.value in BUILTINS) {
|
|
2360
2336
|
return BUILTINS[ast2.value];
|
|
2361
2337
|
} else {
|
|
@@ -2392,7 +2368,7 @@ function evaluate(ast, context = {}) {
|
|
|
2392
2368
|
const args = ast2.args.map(_evaluate);
|
|
2393
2369
|
const kwargs = {};
|
|
2394
2370
|
for (const kwarg in ast2.kwargs) {
|
|
2395
|
-
kwargs[kwarg] = _evaluate(ast2
|
|
2371
|
+
kwargs[kwarg] = _evaluate(ast2?.kwargs[kwarg]);
|
|
2396
2372
|
}
|
|
2397
2373
|
if (fnValue === PyDate || fnValue === PyDateTime || fnValue === PyTime || fnValue === PyRelativeDelta || fnValue === PyTimeDelta) {
|
|
2398
2374
|
return fnValue.create(...args, kwargs);
|
|
@@ -2471,25 +2447,9 @@ function escapeRegExp(str) {
|
|
|
2471
2447
|
var InvalidDomainError = class extends Error {
|
|
2472
2448
|
};
|
|
2473
2449
|
var Domain = class _Domain {
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
return new _Domain(descr.toString());
|
|
2478
|
-
} else {
|
|
2479
|
-
let rawAST;
|
|
2480
|
-
try {
|
|
2481
|
-
rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
|
|
2482
|
-
} catch (error) {
|
|
2483
|
-
throw new InvalidDomainError(
|
|
2484
|
-
`Invalid domain representation: ${descr}`,
|
|
2485
|
-
{
|
|
2486
|
-
cause: error
|
|
2487
|
-
}
|
|
2488
|
-
);
|
|
2489
|
-
}
|
|
2490
|
-
this.ast = normalizeDomainAST(rawAST);
|
|
2491
|
-
}
|
|
2492
|
-
}
|
|
2450
|
+
ast = { type: -1, value: null };
|
|
2451
|
+
static TRUE;
|
|
2452
|
+
static FALSE;
|
|
2493
2453
|
static combine(domains, operator) {
|
|
2494
2454
|
if (domains.length === 0) {
|
|
2495
2455
|
return new _Domain([]);
|
|
@@ -2568,6 +2528,24 @@ var Domain = class _Domain {
|
|
|
2568
2528
|
processLeaf(d.ast.value, 0, "&", newDomain);
|
|
2569
2529
|
return newDomain;
|
|
2570
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
|
+
}
|
|
2571
2549
|
contains(record) {
|
|
2572
2550
|
const expr = evaluate(this.ast, record);
|
|
2573
2551
|
return matchDomain(record, expr);
|
|
@@ -2586,7 +2564,7 @@ var Domain = class _Domain {
|
|
|
2586
2564
|
return evaluatedAsList;
|
|
2587
2565
|
}
|
|
2588
2566
|
return this.toString();
|
|
2589
|
-
} catch
|
|
2567
|
+
} catch {
|
|
2590
2568
|
return this.toString();
|
|
2591
2569
|
}
|
|
2592
2570
|
}
|
|
@@ -2809,22 +2787,22 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
|
|
|
2809
2787
|
|
|
2810
2788
|
// src/utils/storage/local-storage.ts
|
|
2811
2789
|
var localStorageUtils = () => {
|
|
2812
|
-
const setToken = (access_token) =>
|
|
2790
|
+
const setToken = async (access_token) => {
|
|
2813
2791
|
localStorage.setItem("accessToken", access_token);
|
|
2814
|
-
}
|
|
2815
|
-
const setRefreshToken = (refresh_token) =>
|
|
2792
|
+
};
|
|
2793
|
+
const setRefreshToken = async (refresh_token) => {
|
|
2816
2794
|
localStorage.setItem("refreshToken", refresh_token);
|
|
2817
|
-
}
|
|
2818
|
-
const getAccessToken = () =>
|
|
2795
|
+
};
|
|
2796
|
+
const getAccessToken = async () => {
|
|
2819
2797
|
return localStorage.getItem("accessToken");
|
|
2820
|
-
}
|
|
2821
|
-
const getRefreshToken = () =>
|
|
2798
|
+
};
|
|
2799
|
+
const getRefreshToken = async () => {
|
|
2822
2800
|
return localStorage.getItem("refreshToken");
|
|
2823
|
-
}
|
|
2824
|
-
const clearToken = () =>
|
|
2801
|
+
};
|
|
2802
|
+
const clearToken = async () => {
|
|
2825
2803
|
localStorage.removeItem("accessToken");
|
|
2826
2804
|
localStorage.removeItem("refreshToken");
|
|
2827
|
-
}
|
|
2805
|
+
};
|
|
2828
2806
|
return {
|
|
2829
2807
|
setToken,
|
|
2830
2808
|
setRefreshToken,
|
|
@@ -2836,9 +2814,9 @@ var localStorageUtils = () => {
|
|
|
2836
2814
|
|
|
2837
2815
|
// src/utils/storage/session-storage.ts
|
|
2838
2816
|
var sessionStorageUtils = () => {
|
|
2839
|
-
const getBrowserSession = () =>
|
|
2817
|
+
const getBrowserSession = async () => {
|
|
2840
2818
|
return sessionStorage.getItem("browserSession");
|
|
2841
|
-
}
|
|
2819
|
+
};
|
|
2842
2820
|
return {
|
|
2843
2821
|
getBrowserSession
|
|
2844
2822
|
};
|
|
@@ -2847,14 +2825,13 @@ var sessionStorageUtils = () => {
|
|
|
2847
2825
|
// src/configs/axios-client.ts
|
|
2848
2826
|
var axiosClient = {
|
|
2849
2827
|
init(config) {
|
|
2850
|
-
|
|
2851
|
-
const
|
|
2852
|
-
const sessionStorage2 = (_b = config.sessionStorageUtils) != null ? _b : sessionStorageUtils();
|
|
2828
|
+
const localStorage2 = config.localStorageUtils ?? localStorageUtils();
|
|
2829
|
+
const sessionStorage2 = config.sessionStorageUtils ?? sessionStorageUtils();
|
|
2853
2830
|
const db = config.db;
|
|
2854
2831
|
let isRefreshing = false;
|
|
2855
2832
|
let failedQueue = [];
|
|
2856
2833
|
const processQueue = (error, token = null) => {
|
|
2857
|
-
failedQueue
|
|
2834
|
+
failedQueue?.forEach((prom) => {
|
|
2858
2835
|
if (error) {
|
|
2859
2836
|
prom.reject(error);
|
|
2860
2837
|
} else {
|
|
@@ -2869,38 +2846,33 @@ var axiosClient = {
|
|
|
2869
2846
|
timeout: 5e4,
|
|
2870
2847
|
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
2871
2848
|
});
|
|
2872
|
-
instance.interceptors.request.use(
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
if (token) {
|
|
2877
|
-
config2.headers["Authorization"] = "Bearer " + token;
|
|
2878
|
-
}
|
|
2879
|
-
return config2;
|
|
2880
|
-
}),
|
|
2881
|
-
(error) => {
|
|
2882
|
-
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;
|
|
2883
2853
|
}
|
|
2884
|
-
|
|
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);
|
|
2885
2859
|
instance.interceptors.response.use(
|
|
2886
2860
|
(response) => {
|
|
2887
2861
|
return handleResponse(response);
|
|
2888
2862
|
},
|
|
2889
|
-
(error) =>
|
|
2890
|
-
|
|
2891
|
-
const handleError3 = (error2) => __async(null, null, function* () {
|
|
2892
|
-
var _a3;
|
|
2863
|
+
async (error) => {
|
|
2864
|
+
const handleError3 = async (error2) => {
|
|
2893
2865
|
if (!error2.response) {
|
|
2894
2866
|
return error2;
|
|
2895
2867
|
}
|
|
2896
2868
|
const { data } = error2.response;
|
|
2897
|
-
if (data && data.code === 400 && ["invalid_grant"].includes(
|
|
2898
|
-
|
|
2869
|
+
if (data && data.code === 400 && ["invalid_grant"].includes(data.data?.error)) {
|
|
2870
|
+
await clearAuthToken();
|
|
2899
2871
|
}
|
|
2900
2872
|
return data;
|
|
2901
|
-
}
|
|
2873
|
+
};
|
|
2902
2874
|
const originalRequest = error.config;
|
|
2903
|
-
if ((
|
|
2875
|
+
if ((error.response?.status === 403 || error.response?.status === 401 || error.response?.status === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
|
|
2904
2876
|
error.response.data.code
|
|
2905
2877
|
)) {
|
|
2906
2878
|
if (isRefreshing) {
|
|
@@ -2913,19 +2885,18 @@ var axiosClient = {
|
|
|
2913
2885
|
token
|
|
2914
2886
|
);
|
|
2915
2887
|
return instance.request(originalRequest);
|
|
2916
|
-
}).catch((err) =>
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
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();
|
|
2920
2891
|
}
|
|
2921
|
-
})
|
|
2892
|
+
});
|
|
2922
2893
|
}
|
|
2923
|
-
const browserSession =
|
|
2924
|
-
const refreshToken =
|
|
2925
|
-
const accessTokenExp =
|
|
2894
|
+
const browserSession = await sessionStorage2.getBrowserSession();
|
|
2895
|
+
const refreshToken = await localStorage2.getRefreshToken();
|
|
2896
|
+
const accessTokenExp = await localStorage2.getAccessToken();
|
|
2926
2897
|
isRefreshing = true;
|
|
2927
2898
|
if (!refreshToken && (!browserSession || browserSession == "unActive")) {
|
|
2928
|
-
|
|
2899
|
+
await clearAuthToken();
|
|
2929
2900
|
} else {
|
|
2930
2901
|
const payload = Object.fromEntries(
|
|
2931
2902
|
Object.entries({
|
|
@@ -2936,9 +2907,8 @@ var axiosClient = {
|
|
|
2936
2907
|
}).filter(([_, value]) => !!value)
|
|
2937
2908
|
);
|
|
2938
2909
|
return new Promise(function(resolve) {
|
|
2939
|
-
var _a3;
|
|
2940
2910
|
axios.post(
|
|
2941
|
-
`${config.baseUrl}${
|
|
2911
|
+
`${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
|
|
2942
2912
|
payload,
|
|
2943
2913
|
{
|
|
2944
2914
|
headers: {
|
|
@@ -2946,10 +2916,10 @@ var axiosClient = {
|
|
|
2946
2916
|
Authorization: `Bearer ${accessTokenExp}`
|
|
2947
2917
|
}
|
|
2948
2918
|
}
|
|
2949
|
-
).then((res) =>
|
|
2919
|
+
).then(async (res) => {
|
|
2950
2920
|
const data = res.data;
|
|
2951
|
-
|
|
2952
|
-
|
|
2921
|
+
await localStorage2.setToken(data.access_token);
|
|
2922
|
+
await localStorage2.setRefreshToken(data.refresh_token);
|
|
2953
2923
|
axios.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
|
|
2954
2924
|
originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
|
|
2955
2925
|
originalRequest.data = updateTokenParamInOriginalRequest(
|
|
@@ -2958,26 +2928,25 @@ var axiosClient = {
|
|
|
2958
2928
|
);
|
|
2959
2929
|
processQueue(null, data.access_token);
|
|
2960
2930
|
resolve(instance.request(originalRequest));
|
|
2961
|
-
})
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
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();
|
|
2965
2934
|
}
|
|
2966
2935
|
if (err && err.response) {
|
|
2967
|
-
const { error_code } =
|
|
2936
|
+
const { error_code } = err.response?.data || {};
|
|
2968
2937
|
if (error_code === "AUTHEN_FAIL") {
|
|
2969
|
-
|
|
2938
|
+
await clearAuthToken();
|
|
2970
2939
|
}
|
|
2971
2940
|
}
|
|
2972
2941
|
processQueue(err, null);
|
|
2973
|
-
})
|
|
2942
|
+
}).finally(() => {
|
|
2974
2943
|
isRefreshing = false;
|
|
2975
2944
|
});
|
|
2976
2945
|
});
|
|
2977
2946
|
}
|
|
2978
2947
|
}
|
|
2979
|
-
return Promise.reject(
|
|
2980
|
-
}
|
|
2948
|
+
return Promise.reject(await handleError3(error));
|
|
2949
|
+
}
|
|
2981
2950
|
);
|
|
2982
2951
|
const handleResponse = (res) => {
|
|
2983
2952
|
if (res && res.data) {
|
|
@@ -2986,7 +2955,6 @@ var axiosClient = {
|
|
|
2986
2955
|
return res;
|
|
2987
2956
|
};
|
|
2988
2957
|
const handleError2 = (error) => {
|
|
2989
|
-
var _a2, _b2, _c;
|
|
2990
2958
|
if (error.isAxiosError && error.code === "ECONNABORTED") {
|
|
2991
2959
|
console.error("Request Timeout Error:", error);
|
|
2992
2960
|
return "Request Timeout Error";
|
|
@@ -2994,17 +2962,17 @@ var axiosClient = {
|
|
|
2994
2962
|
console.error("Network Error:", error);
|
|
2995
2963
|
return "Network Error";
|
|
2996
2964
|
} else {
|
|
2997
|
-
console.error("Other Error:", error
|
|
2998
|
-
const errorMessage =
|
|
2999
|
-
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 };
|
|
3000
2968
|
}
|
|
3001
2969
|
};
|
|
3002
|
-
const clearAuthToken = () =>
|
|
3003
|
-
|
|
2970
|
+
const clearAuthToken = async () => {
|
|
2971
|
+
await localStorage2.clearToken();
|
|
3004
2972
|
if (typeof window !== "undefined") {
|
|
3005
2973
|
window.location.href = `/login`;
|
|
3006
2974
|
}
|
|
3007
|
-
}
|
|
2975
|
+
};
|
|
3008
2976
|
function formatUrl(url, db2) {
|
|
3009
2977
|
return url + (db2 ? "?db=" + db2 : "");
|
|
3010
2978
|
}
|
|
@@ -3029,550 +2997,523 @@ var axiosClient = {
|
|
|
3029
2997
|
|
|
3030
2998
|
// src/environment/EnvStore.ts
|
|
3031
2999
|
var EnvStore = class {
|
|
3032
|
-
|
|
3033
|
-
|
|
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) {
|
|
3034
3012
|
this.localStorageUtils = localStorageUtils2;
|
|
3035
3013
|
this.sessionStorageUtils = sessionStorageUtils2;
|
|
3036
3014
|
this.setup();
|
|
3037
3015
|
}
|
|
3038
3016
|
setup() {
|
|
3039
|
-
const env2 =
|
|
3040
|
-
this.baseUrl = env2
|
|
3041
|
-
this.requests = env2
|
|
3042
|
-
this.context = env2
|
|
3043
|
-
this.defaultCompany = env2
|
|
3044
|
-
this.config = env2
|
|
3045
|
-
this.companies =
|
|
3046
|
-
this.user = env2
|
|
3047
|
-
this.db = env2
|
|
3048
|
-
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;
|
|
3049
3027
|
}
|
|
3050
3028
|
setupEnv(envConfig) {
|
|
3051
|
-
const dispatch =
|
|
3052
|
-
const env2 =
|
|
3029
|
+
const dispatch = envStore.dispatch;
|
|
3030
|
+
const env2 = {
|
|
3031
|
+
...envConfig,
|
|
3053
3032
|
localStorageUtils: this.localStorageUtils,
|
|
3054
3033
|
sessionStorageUtils: this.sessionStorageUtils
|
|
3055
|
-
}
|
|
3034
|
+
};
|
|
3056
3035
|
const requests = axiosClient.init(env2);
|
|
3057
|
-
dispatch(setEnv(
|
|
3036
|
+
dispatch(setEnv({ ...env2, requests }));
|
|
3058
3037
|
this.setup();
|
|
3059
3038
|
}
|
|
3060
3039
|
setUid(uid) {
|
|
3061
|
-
const dispatch =
|
|
3040
|
+
const dispatch = envStore.dispatch;
|
|
3062
3041
|
dispatch(setUid(uid));
|
|
3063
3042
|
this.setup();
|
|
3064
3043
|
}
|
|
3065
3044
|
setLang(lang) {
|
|
3066
|
-
const dispatch =
|
|
3045
|
+
const dispatch = envStore.dispatch;
|
|
3067
3046
|
dispatch(setLang(lang));
|
|
3068
3047
|
this.setup();
|
|
3069
3048
|
}
|
|
3070
3049
|
setAllowCompanies(allowCompanies) {
|
|
3071
|
-
const dispatch =
|
|
3050
|
+
const dispatch = envStore.dispatch;
|
|
3072
3051
|
dispatch(setAllowCompanies(allowCompanies));
|
|
3073
3052
|
this.setup();
|
|
3074
3053
|
}
|
|
3075
3054
|
setCompanies(companies) {
|
|
3076
|
-
const dispatch =
|
|
3055
|
+
const dispatch = envStore.dispatch;
|
|
3077
3056
|
dispatch(setCompanies(companies));
|
|
3078
3057
|
this.setup();
|
|
3079
3058
|
}
|
|
3080
3059
|
setDefaultCompany(company) {
|
|
3081
|
-
const dispatch =
|
|
3060
|
+
const dispatch = envStore.dispatch;
|
|
3082
3061
|
dispatch(setDefaultCompany(company));
|
|
3083
3062
|
this.setup();
|
|
3084
3063
|
}
|
|
3085
3064
|
setUserInfo(userInfo) {
|
|
3086
|
-
const dispatch =
|
|
3065
|
+
const dispatch = envStore.dispatch;
|
|
3087
3066
|
dispatch(setUser(userInfo));
|
|
3088
3067
|
this.setup();
|
|
3089
3068
|
}
|
|
3090
3069
|
};
|
|
3091
3070
|
var env = null;
|
|
3092
3071
|
function getEnv() {
|
|
3093
|
-
if (!env)
|
|
3094
|
-
env = new EnvStore(envStore, localStorageUtils(), sessionStorageUtils());
|
|
3072
|
+
if (!env) env = new EnvStore(localStorageUtils(), sessionStorageUtils());
|
|
3095
3073
|
return env;
|
|
3096
3074
|
}
|
|
3097
3075
|
|
|
3098
3076
|
// src/services/view-service/index.ts
|
|
3099
3077
|
var ViewService = {
|
|
3100
|
-
getView(
|
|
3101
|
-
|
|
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 = {
|
|
3102
3092
|
model,
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
};
|
|
3115
|
-
const jsonDataView = {
|
|
3116
|
-
model,
|
|
3117
|
-
method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
|
|
3118
|
-
kwargs: {
|
|
3119
|
-
views,
|
|
3120
|
-
options: __spreadValues(__spreadValues({}, options), defaultOptions)
|
|
3121
|
-
},
|
|
3122
|
-
with_context: context
|
|
3123
|
-
};
|
|
3124
|
-
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
3125
|
-
headers: {
|
|
3126
|
-
"Content-Type": "application/json"
|
|
3127
|
-
}
|
|
3128
|
-
});
|
|
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
|
+
}
|
|
3129
3104
|
});
|
|
3130
3105
|
},
|
|
3131
|
-
getMenu(context) {
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
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: {}
|
|
3154
3134
|
},
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
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
|
+
}
|
|
3161
3153
|
},
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
active: {},
|
|
3169
|
-
name: {},
|
|
3170
|
-
is_display: {},
|
|
3171
|
-
sequence: {},
|
|
3172
|
-
complete_name: {},
|
|
3173
|
-
action: {
|
|
3174
|
-
fields: {
|
|
3175
|
-
display_name: {},
|
|
3176
|
-
type: {},
|
|
3177
|
-
binding_view_types: {}
|
|
3178
|
-
// res_model: {},
|
|
3179
|
-
}
|
|
3154
|
+
url_icon: {},
|
|
3155
|
+
web_icon: {},
|
|
3156
|
+
web_icon_data: {},
|
|
3157
|
+
groups_id: {
|
|
3158
|
+
fields: {
|
|
3159
|
+
full_name: {}
|
|
3180
3160
|
},
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
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
|
+
}
|
|
3187
3179
|
},
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
active: {},
|
|
3195
|
-
name: {},
|
|
3196
|
-
is_display: {},
|
|
3197
|
-
sequence: {},
|
|
3198
|
-
complete_name: {},
|
|
3199
|
-
action: {
|
|
3200
|
-
fields: {
|
|
3201
|
-
display_name: {},
|
|
3202
|
-
type: {},
|
|
3203
|
-
binding_view_types: {}
|
|
3204
|
-
// res_model: {},
|
|
3205
|
-
}
|
|
3180
|
+
url_icon: {},
|
|
3181
|
+
web_icon: {},
|
|
3182
|
+
web_icon_data: {},
|
|
3183
|
+
groups_id: {
|
|
3184
|
+
fields: {
|
|
3185
|
+
full_name: {}
|
|
3206
3186
|
},
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
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
|
+
}
|
|
3213
3205
|
},
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
active: {},
|
|
3221
|
-
name: {},
|
|
3222
|
-
is_display: {},
|
|
3223
|
-
sequence: {},
|
|
3224
|
-
complete_name: {},
|
|
3225
|
-
action: {
|
|
3226
|
-
fields: {
|
|
3227
|
-
display_name: {},
|
|
3228
|
-
type: {},
|
|
3229
|
-
binding_view_types: {}
|
|
3230
|
-
// res_model: {},
|
|
3231
|
-
}
|
|
3232
|
-
},
|
|
3233
|
-
url_icon: {},
|
|
3234
|
-
web_icon: {},
|
|
3235
|
-
web_icon_data: {},
|
|
3236
|
-
groups_id: {
|
|
3237
|
-
fields: {
|
|
3238
|
-
full_name: {}
|
|
3239
|
-
},
|
|
3240
|
-
limit: 40,
|
|
3241
|
-
order: ""
|
|
3206
|
+
url_icon: {},
|
|
3207
|
+
web_icon: {},
|
|
3208
|
+
web_icon_data: {},
|
|
3209
|
+
groups_id: {
|
|
3210
|
+
fields: {
|
|
3211
|
+
full_name: {}
|
|
3242
3212
|
},
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
fields: {},
|
|
3246
|
-
limit: 40,
|
|
3247
|
-
order: ""
|
|
3248
|
-
}
|
|
3213
|
+
limit: 40,
|
|
3214
|
+
order: ""
|
|
3249
3215
|
},
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
"
|
|
3274
|
-
|
|
3275
|
-
|
|
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
|
+
}
|
|
3276
3248
|
});
|
|
3277
3249
|
},
|
|
3278
|
-
getActionDetail(aid, context) {
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
groups_id: {},
|
|
3298
|
-
search_view_id: {}
|
|
3299
|
-
}
|
|
3300
|
-
}
|
|
3301
|
-
};
|
|
3302
|
-
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
3303
|
-
headers: {
|
|
3304
|
-
"Content-Type": "application/json"
|
|
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: {}
|
|
3305
3269
|
}
|
|
3306
|
-
}
|
|
3270
|
+
}
|
|
3271
|
+
};
|
|
3272
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
3273
|
+
headers: {
|
|
3274
|
+
"Content-Type": "application/json"
|
|
3275
|
+
}
|
|
3307
3276
|
});
|
|
3308
3277
|
},
|
|
3309
|
-
getResequence(
|
|
3310
|
-
|
|
3278
|
+
async getResequence({
|
|
3279
|
+
model,
|
|
3280
|
+
ids,
|
|
3281
|
+
context,
|
|
3282
|
+
offset
|
|
3283
|
+
}) {
|
|
3284
|
+
const env2 = getEnv();
|
|
3285
|
+
const jsonData = {
|
|
3311
3286
|
model,
|
|
3287
|
+
with_context: context,
|
|
3312
3288
|
ids,
|
|
3313
|
-
|
|
3314
|
-
offset
|
|
3315
|
-
}
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
ids,
|
|
3321
|
-
field: "sequence"
|
|
3322
|
-
}, offset > 0 ? { offset } : {});
|
|
3323
|
-
return env2 == null ? void 0 : env2.requests.post("/web/dataset/resequence", jsonData, {
|
|
3324
|
-
headers: {
|
|
3325
|
-
"Content-Type": "application/json"
|
|
3326
|
-
}
|
|
3327
|
-
});
|
|
3328
|
-
});
|
|
3329
|
-
},
|
|
3330
|
-
getSelectionItem(_0) {
|
|
3331
|
-
return __async(this, arguments, function* ({ data }) {
|
|
3332
|
-
var _a;
|
|
3333
|
-
const env2 = getEnv();
|
|
3334
|
-
const jsonData = {
|
|
3335
|
-
model: data.model,
|
|
3336
|
-
ids: [],
|
|
3337
|
-
method: "get_data_select",
|
|
3338
|
-
with_context: data.context,
|
|
3339
|
-
kwargs: {
|
|
3340
|
-
count_limit: 10001,
|
|
3341
|
-
domain: data.domain ? data.domain : [],
|
|
3342
|
-
offset: 0,
|
|
3343
|
-
order: "",
|
|
3344
|
-
specification: (_a = data == null ? void 0 : data.specification) != null ? _a : {
|
|
3345
|
-
id: {},
|
|
3346
|
-
name: {},
|
|
3347
|
-
display_name: {}
|
|
3348
|
-
}
|
|
3349
|
-
}
|
|
3350
|
-
};
|
|
3351
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3352
|
-
headers: {
|
|
3353
|
-
"Content-Type": "application/json"
|
|
3354
|
-
}
|
|
3355
|
-
});
|
|
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
|
+
}
|
|
3356
3296
|
});
|
|
3357
3297
|
},
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
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: {}
|
|
3368
3314
|
}
|
|
3369
|
-
|
|
3315
|
+
}
|
|
3316
|
+
};
|
|
3317
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3318
|
+
headers: {
|
|
3319
|
+
"Content-Type": "application/json"
|
|
3320
|
+
}
|
|
3370
3321
|
});
|
|
3371
3322
|
},
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3323
|
+
async loadMessages() {
|
|
3324
|
+
const env2 = getEnv();
|
|
3325
|
+
return env2.requests.post(
|
|
3326
|
+
"/load_message_failures" /* LOAD_MESSAGE */,
|
|
3327
|
+
{},
|
|
3328
|
+
{
|
|
3378
3329
|
headers: {
|
|
3379
3330
|
"Content-Type": "application/json"
|
|
3380
3331
|
}
|
|
3381
|
-
}
|
|
3332
|
+
}
|
|
3333
|
+
);
|
|
3334
|
+
},
|
|
3335
|
+
async getVersion() {
|
|
3336
|
+
const env2 = getEnv();
|
|
3337
|
+
return env2?.requests.get("", {
|
|
3338
|
+
headers: {
|
|
3339
|
+
"Content-Type": "application/json"
|
|
3340
|
+
}
|
|
3382
3341
|
});
|
|
3383
3342
|
},
|
|
3384
|
-
get2FAMethods(
|
|
3385
|
-
|
|
3343
|
+
async get2FAMethods({
|
|
3344
|
+
method,
|
|
3345
|
+
with_context
|
|
3346
|
+
}) {
|
|
3347
|
+
const env2 = getEnv();
|
|
3348
|
+
const jsonData = {
|
|
3386
3349
|
method,
|
|
3387
3350
|
with_context
|
|
3388
|
-
}
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
};
|
|
3394
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3395
|
-
headers: {
|
|
3396
|
-
"Content-Type": "application/json"
|
|
3397
|
-
}
|
|
3398
|
-
});
|
|
3351
|
+
};
|
|
3352
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3353
|
+
headers: {
|
|
3354
|
+
"Content-Type": "application/json"
|
|
3355
|
+
}
|
|
3399
3356
|
});
|
|
3400
3357
|
},
|
|
3401
|
-
verify2FA(
|
|
3402
|
-
|
|
3358
|
+
async verify2FA({
|
|
3359
|
+
method,
|
|
3360
|
+
with_context,
|
|
3361
|
+
code,
|
|
3362
|
+
device,
|
|
3363
|
+
location
|
|
3364
|
+
}) {
|
|
3365
|
+
const env2 = getEnv();
|
|
3366
|
+
const jsonData = {
|
|
3403
3367
|
method,
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
},
|
|
3419
|
-
with_context
|
|
3420
|
-
};
|
|
3421
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3422
|
-
headers: {
|
|
3423
|
-
"Content-Type": "application/json"
|
|
3424
|
-
},
|
|
3425
|
-
withCredentials: true
|
|
3426
|
-
});
|
|
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
|
|
3427
3382
|
});
|
|
3428
3383
|
},
|
|
3429
|
-
signInSSO(
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
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({
|
|
3434
3393
|
response_type,
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
}
|
|
3444
|
-
|
|
3445
|
-
return env2 == null ? void 0 : env2.requests.get(url, {
|
|
3446
|
-
headers: {
|
|
3447
|
-
"Content-Type": "application/json"
|
|
3448
|
-
},
|
|
3449
|
-
withCredentials: true
|
|
3450
|
-
});
|
|
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
|
|
3451
3404
|
});
|
|
3452
3405
|
},
|
|
3453
|
-
grantAccess(
|
|
3454
|
-
|
|
3406
|
+
async grantAccess({
|
|
3407
|
+
redirect_uri,
|
|
3408
|
+
state,
|
|
3409
|
+
client_id,
|
|
3410
|
+
scopes
|
|
3411
|
+
}) {
|
|
3412
|
+
const env2 = getEnv();
|
|
3413
|
+
const jsonData = {
|
|
3455
3414
|
redirect_uri,
|
|
3456
3415
|
state,
|
|
3457
3416
|
client_id,
|
|
3458
3417
|
scopes
|
|
3459
|
-
}
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
scopes
|
|
3466
|
-
};
|
|
3467
|
-
return env2 == null ? void 0 : env2.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
|
|
3468
|
-
headers: {
|
|
3469
|
-
"Content-Type": "application/json"
|
|
3470
|
-
},
|
|
3471
|
-
withCredentials: true
|
|
3472
|
-
});
|
|
3418
|
+
};
|
|
3419
|
+
return env2?.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
|
|
3420
|
+
headers: {
|
|
3421
|
+
"Content-Type": "application/json"
|
|
3422
|
+
},
|
|
3423
|
+
withCredentials: true
|
|
3473
3424
|
});
|
|
3474
3425
|
},
|
|
3475
|
-
getFieldsViewSecurity(
|
|
3476
|
-
|
|
3426
|
+
async getFieldsViewSecurity({
|
|
3427
|
+
method,
|
|
3428
|
+
token,
|
|
3429
|
+
views
|
|
3430
|
+
}) {
|
|
3431
|
+
const env2 = getEnv();
|
|
3432
|
+
const jsonData = {
|
|
3477
3433
|
method,
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
}
|
|
3490
|
-
};
|
|
3491
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3492
|
-
headers: {
|
|
3493
|
-
"Content-Type": "application/json"
|
|
3494
|
-
}
|
|
3495
|
-
});
|
|
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
|
+
}
|
|
3496
3445
|
});
|
|
3497
3446
|
},
|
|
3498
|
-
settingsWebRead2fa(
|
|
3499
|
-
|
|
3447
|
+
async settingsWebRead2fa({
|
|
3448
|
+
method,
|
|
3449
|
+
model,
|
|
3450
|
+
kwargs,
|
|
3451
|
+
token
|
|
3452
|
+
}) {
|
|
3453
|
+
const env2 = getEnv();
|
|
3454
|
+
const jsonData = {
|
|
3500
3455
|
method,
|
|
3501
3456
|
model,
|
|
3502
3457
|
kwargs,
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
token
|
|
3512
|
-
}
|
|
3513
|
-
};
|
|
3514
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3515
|
-
headers: {
|
|
3516
|
-
"Content-Type": "application/json"
|
|
3517
|
-
}
|
|
3518
|
-
});
|
|
3458
|
+
with_context: {
|
|
3459
|
+
token
|
|
3460
|
+
}
|
|
3461
|
+
};
|
|
3462
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3463
|
+
headers: {
|
|
3464
|
+
"Content-Type": "application/json"
|
|
3465
|
+
}
|
|
3519
3466
|
});
|
|
3520
3467
|
},
|
|
3521
|
-
requestSetupTotp(
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
}
|
|
3534
|
-
});
|
|
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
|
+
}
|
|
3535
3480
|
});
|
|
3536
3481
|
},
|
|
3537
|
-
verifyTotp(
|
|
3538
|
-
|
|
3482
|
+
async verifyTotp({
|
|
3483
|
+
method,
|
|
3484
|
+
action_token,
|
|
3485
|
+
code
|
|
3486
|
+
}) {
|
|
3487
|
+
const env2 = getEnv();
|
|
3488
|
+
const jsonData = {
|
|
3539
3489
|
method,
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
const env2 = getEnv();
|
|
3544
|
-
const jsonData = {
|
|
3545
|
-
method,
|
|
3546
|
-
kwargs: {
|
|
3547
|
-
vals: {
|
|
3548
|
-
code
|
|
3549
|
-
}
|
|
3550
|
-
},
|
|
3551
|
-
with_context: {
|
|
3552
|
-
action_token
|
|
3490
|
+
kwargs: {
|
|
3491
|
+
vals: {
|
|
3492
|
+
code
|
|
3553
3493
|
}
|
|
3554
|
-
}
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
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
|
+
}
|
|
3560
3503
|
});
|
|
3561
3504
|
},
|
|
3562
|
-
removeTotpSetUp(
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
}
|
|
3575
|
-
});
|
|
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
|
+
}
|
|
3576
3517
|
});
|
|
3577
3518
|
}
|
|
3578
3519
|
};
|
|
@@ -3588,18 +3529,17 @@ var VersionGate = ({ children }) => {
|
|
|
3588
3529
|
queryClient.clear();
|
|
3589
3530
|
localStorage.removeItem("__api_version__");
|
|
3590
3531
|
};
|
|
3591
|
-
const validateVersion = () =>
|
|
3592
|
-
const serverVersion =
|
|
3593
|
-
console.log("serverVersion", serverVersion);
|
|
3532
|
+
const validateVersion = async () => {
|
|
3533
|
+
const serverVersion = await view_service_default.getVersion();
|
|
3594
3534
|
const cached = localStorage.getItem("__api_version__");
|
|
3595
|
-
if (cached !==
|
|
3535
|
+
if (cached !== serverVersion?.api_version) {
|
|
3596
3536
|
clearVersion();
|
|
3597
|
-
localStorage.setItem("__api_version__", serverVersion
|
|
3537
|
+
localStorage.setItem("__api_version__", serverVersion?.api_version);
|
|
3598
3538
|
} else {
|
|
3599
|
-
console.log("Api version:", serverVersion
|
|
3539
|
+
console.log("Api version:", serverVersion?.api_version);
|
|
3600
3540
|
}
|
|
3601
3541
|
setReady(true);
|
|
3602
|
-
}
|
|
3542
|
+
};
|
|
3603
3543
|
validateVersion();
|
|
3604
3544
|
if (typeof window !== "undefined") {
|
|
3605
3545
|
const onKey = (e) => {
|