@fctc/interface-logic 1.5.3 → 1.5.5
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.js +96 -107
- package/dist/configs.mjs +96 -108
- package/dist/environment.js +122 -137
- package/dist/environment.mjs +122 -140
- package/dist/hooks.js +1396 -1559
- package/dist/hooks.mjs +1396 -1562
- package/dist/provider.d.mts +3 -4
- package/dist/provider.d.ts +3 -4
- package/dist/provider.js +509 -562
- package/dist/provider.mjs +509 -565
- package/dist/services.js +1359 -1524
- package/dist/services.mjs +1355 -1523
- package/dist/store.js +5 -19
- package/dist/store.mjs +5 -22
- package/dist/utils.js +94 -116
- package/dist/utils.mjs +94 -119
- package/package.json +11 -22
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";
|
|
@@ -250,7 +209,7 @@ var headerSlice = createSlice5({
|
|
|
250
209
|
},
|
|
251
210
|
reducers: {
|
|
252
211
|
setHeader: (state, action) => {
|
|
253
|
-
state.value =
|
|
212
|
+
state.value = { ...state.value, ...action.payload };
|
|
254
213
|
},
|
|
255
214
|
setAllowedCompanyIds: (state, action) => {
|
|
256
215
|
state.value.allowedCompanyIds = action.payload;
|
|
@@ -1774,6 +1733,22 @@ var PyRelativeDelta = class _PyRelativeDelta {
|
|
|
1774
1733
|
this.microsecond = params.microsecond;
|
|
1775
1734
|
this.weekday = params.weekday;
|
|
1776
1735
|
}
|
|
1736
|
+
years;
|
|
1737
|
+
months;
|
|
1738
|
+
days;
|
|
1739
|
+
hours;
|
|
1740
|
+
minutes;
|
|
1741
|
+
seconds;
|
|
1742
|
+
microseconds;
|
|
1743
|
+
leapDays;
|
|
1744
|
+
year;
|
|
1745
|
+
month;
|
|
1746
|
+
day;
|
|
1747
|
+
hour;
|
|
1748
|
+
minute;
|
|
1749
|
+
second;
|
|
1750
|
+
microsecond;
|
|
1751
|
+
weekday;
|
|
1777
1752
|
negate() {
|
|
1778
1753
|
return new _PyRelativeDelta(this, -1);
|
|
1779
1754
|
}
|
|
@@ -1888,7 +1863,7 @@ function execOnIterable(iterable, func) {
|
|
|
1888
1863
|
if (typeof iterable === "object" && !Array.isArray(iterable) && !(iterable instanceof Set)) {
|
|
1889
1864
|
iterable = Object.keys(iterable);
|
|
1890
1865
|
}
|
|
1891
|
-
if (typeof
|
|
1866
|
+
if (typeof iterable?.[Symbol.iterator] !== "function") {
|
|
1892
1867
|
throw new EvaluationError("value not iterable");
|
|
1893
1868
|
}
|
|
1894
1869
|
return func(iterable);
|
|
@@ -2211,7 +2186,7 @@ function applyBinaryOp(ast, context) {
|
|
|
2211
2186
|
}
|
|
2212
2187
|
return Math.floor(left / right);
|
|
2213
2188
|
case "**":
|
|
2214
|
-
return
|
|
2189
|
+
return left ** right;
|
|
2215
2190
|
case "==":
|
|
2216
2191
|
return isEqual(left, right);
|
|
2217
2192
|
case "<>":
|
|
@@ -2333,7 +2308,7 @@ function evaluate(ast, context = {}) {
|
|
|
2333
2308
|
const dicts = /* @__PURE__ */ new Set();
|
|
2334
2309
|
let pyContext;
|
|
2335
2310
|
const evalContext = Object.create(context);
|
|
2336
|
-
if (!
|
|
2311
|
+
if (!evalContext?.context) {
|
|
2337
2312
|
Object.defineProperty(evalContext, "context", {
|
|
2338
2313
|
get() {
|
|
2339
2314
|
if (!pyContext) {
|
|
@@ -2344,18 +2319,17 @@ function evaluate(ast, context = {}) {
|
|
|
2344
2319
|
});
|
|
2345
2320
|
}
|
|
2346
2321
|
function _innerEvaluate(ast2) {
|
|
2347
|
-
|
|
2348
|
-
switch (ast2 == null ? void 0 : ast2.type) {
|
|
2322
|
+
switch (ast2?.type) {
|
|
2349
2323
|
case 0:
|
|
2350
2324
|
// Number
|
|
2351
2325
|
case 1:
|
|
2352
2326
|
return ast2.value;
|
|
2353
2327
|
case 5:
|
|
2354
2328
|
if (ast2.value in evalContext) {
|
|
2355
|
-
if (typeof evalContext[ast2.value] === "object" &&
|
|
2356
|
-
return
|
|
2329
|
+
if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
|
|
2330
|
+
return evalContext[ast2.value]?.id;
|
|
2357
2331
|
}
|
|
2358
|
-
return
|
|
2332
|
+
return evalContext[ast2.value] ?? false;
|
|
2359
2333
|
} else if (ast2.value in BUILTINS) {
|
|
2360
2334
|
return BUILTINS[ast2.value];
|
|
2361
2335
|
} else {
|
|
@@ -2392,7 +2366,7 @@ function evaluate(ast, context = {}) {
|
|
|
2392
2366
|
const args = ast2.args.map(_evaluate);
|
|
2393
2367
|
const kwargs = {};
|
|
2394
2368
|
for (const kwarg in ast2.kwargs) {
|
|
2395
|
-
kwargs[kwarg] = _evaluate(ast2
|
|
2369
|
+
kwargs[kwarg] = _evaluate(ast2?.kwargs[kwarg]);
|
|
2396
2370
|
}
|
|
2397
2371
|
if (fnValue === PyDate || fnValue === PyDateTime || fnValue === PyTime || fnValue === PyRelativeDelta || fnValue === PyTimeDelta) {
|
|
2398
2372
|
return fnValue.create(...args, kwargs);
|
|
@@ -2471,25 +2445,9 @@ function escapeRegExp(str) {
|
|
|
2471
2445
|
var InvalidDomainError = class extends Error {
|
|
2472
2446
|
};
|
|
2473
2447
|
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
|
-
}
|
|
2448
|
+
ast = { type: -1, value: null };
|
|
2449
|
+
static TRUE;
|
|
2450
|
+
static FALSE;
|
|
2493
2451
|
static combine(domains, operator) {
|
|
2494
2452
|
if (domains.length === 0) {
|
|
2495
2453
|
return new _Domain([]);
|
|
@@ -2568,6 +2526,24 @@ var Domain = class _Domain {
|
|
|
2568
2526
|
processLeaf(d.ast.value, 0, "&", newDomain);
|
|
2569
2527
|
return newDomain;
|
|
2570
2528
|
}
|
|
2529
|
+
constructor(descr = []) {
|
|
2530
|
+
if (descr instanceof _Domain) {
|
|
2531
|
+
return new _Domain(descr.toString());
|
|
2532
|
+
} else {
|
|
2533
|
+
let rawAST;
|
|
2534
|
+
try {
|
|
2535
|
+
rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
|
|
2536
|
+
} catch (error) {
|
|
2537
|
+
throw new InvalidDomainError(
|
|
2538
|
+
`Invalid domain representation: ${descr}`,
|
|
2539
|
+
{
|
|
2540
|
+
cause: error
|
|
2541
|
+
}
|
|
2542
|
+
);
|
|
2543
|
+
}
|
|
2544
|
+
this.ast = normalizeDomainAST(rawAST);
|
|
2545
|
+
}
|
|
2546
|
+
}
|
|
2571
2547
|
contains(record) {
|
|
2572
2548
|
const expr = evaluate(this.ast, record);
|
|
2573
2549
|
return matchDomain(record, expr);
|
|
@@ -2586,7 +2562,7 @@ var Domain = class _Domain {
|
|
|
2586
2562
|
return evaluatedAsList;
|
|
2587
2563
|
}
|
|
2588
2564
|
return this.toString();
|
|
2589
|
-
} catch
|
|
2565
|
+
} catch {
|
|
2590
2566
|
return this.toString();
|
|
2591
2567
|
}
|
|
2592
2568
|
}
|
|
@@ -2809,22 +2785,22 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
|
|
|
2809
2785
|
|
|
2810
2786
|
// src/utils/storage/local-storage.ts
|
|
2811
2787
|
var localStorageUtils = () => {
|
|
2812
|
-
const setToken = (access_token) =>
|
|
2788
|
+
const setToken = async (access_token) => {
|
|
2813
2789
|
localStorage.setItem("accessToken", access_token);
|
|
2814
|
-
}
|
|
2815
|
-
const setRefreshToken = (refresh_token) =>
|
|
2790
|
+
};
|
|
2791
|
+
const setRefreshToken = async (refresh_token) => {
|
|
2816
2792
|
localStorage.setItem("refreshToken", refresh_token);
|
|
2817
|
-
}
|
|
2818
|
-
const getAccessToken = () =>
|
|
2793
|
+
};
|
|
2794
|
+
const getAccessToken = async () => {
|
|
2819
2795
|
return localStorage.getItem("accessToken");
|
|
2820
|
-
}
|
|
2821
|
-
const getRefreshToken = () =>
|
|
2796
|
+
};
|
|
2797
|
+
const getRefreshToken = async () => {
|
|
2822
2798
|
return localStorage.getItem("refreshToken");
|
|
2823
|
-
}
|
|
2824
|
-
const clearToken = () =>
|
|
2799
|
+
};
|
|
2800
|
+
const clearToken = async () => {
|
|
2825
2801
|
localStorage.removeItem("accessToken");
|
|
2826
2802
|
localStorage.removeItem("refreshToken");
|
|
2827
|
-
}
|
|
2803
|
+
};
|
|
2828
2804
|
return {
|
|
2829
2805
|
setToken,
|
|
2830
2806
|
setRefreshToken,
|
|
@@ -2836,9 +2812,9 @@ var localStorageUtils = () => {
|
|
|
2836
2812
|
|
|
2837
2813
|
// src/utils/storage/session-storage.ts
|
|
2838
2814
|
var sessionStorageUtils = () => {
|
|
2839
|
-
const getBrowserSession = () =>
|
|
2815
|
+
const getBrowserSession = async () => {
|
|
2840
2816
|
return sessionStorage.getItem("browserSession");
|
|
2841
|
-
}
|
|
2817
|
+
};
|
|
2842
2818
|
return {
|
|
2843
2819
|
getBrowserSession
|
|
2844
2820
|
};
|
|
@@ -2847,14 +2823,13 @@ var sessionStorageUtils = () => {
|
|
|
2847
2823
|
// src/configs/axios-client.ts
|
|
2848
2824
|
var axiosClient = {
|
|
2849
2825
|
init(config) {
|
|
2850
|
-
|
|
2851
|
-
const
|
|
2852
|
-
const sessionStorage2 = (_b = config.sessionStorageUtils) != null ? _b : sessionStorageUtils();
|
|
2826
|
+
const localStorage2 = config.localStorageUtils ?? localStorageUtils();
|
|
2827
|
+
const sessionStorage2 = config.sessionStorageUtils ?? sessionStorageUtils();
|
|
2853
2828
|
const db = config.db;
|
|
2854
2829
|
let isRefreshing = false;
|
|
2855
2830
|
let failedQueue = [];
|
|
2856
2831
|
const processQueue = (error, token = null) => {
|
|
2857
|
-
failedQueue
|
|
2832
|
+
failedQueue?.forEach((prom) => {
|
|
2858
2833
|
if (error) {
|
|
2859
2834
|
prom.reject(error);
|
|
2860
2835
|
} else {
|
|
@@ -2870,14 +2845,14 @@ var axiosClient = {
|
|
|
2870
2845
|
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
2871
2846
|
});
|
|
2872
2847
|
instance.interceptors.request.use(
|
|
2873
|
-
(config2) =>
|
|
2848
|
+
async (config2) => {
|
|
2874
2849
|
const useRefreshToken = config2.useRefreshToken;
|
|
2875
|
-
const token = useRefreshToken ?
|
|
2850
|
+
const token = useRefreshToken ? await localStorage2.getRefreshToken() : await localStorage2.getAccessToken();
|
|
2876
2851
|
if (token) {
|
|
2877
2852
|
config2.headers["Authorization"] = "Bearer " + token;
|
|
2878
2853
|
}
|
|
2879
2854
|
return config2;
|
|
2880
|
-
}
|
|
2855
|
+
},
|
|
2881
2856
|
(error) => {
|
|
2882
2857
|
Promise.reject(error);
|
|
2883
2858
|
}
|
|
@@ -2886,21 +2861,19 @@ var axiosClient = {
|
|
|
2886
2861
|
(response) => {
|
|
2887
2862
|
return handleResponse(response);
|
|
2888
2863
|
},
|
|
2889
|
-
(error) =>
|
|
2890
|
-
|
|
2891
|
-
const handleError3 = (error2) => __async(null, null, function* () {
|
|
2892
|
-
var _a3;
|
|
2864
|
+
async (error) => {
|
|
2865
|
+
const handleError3 = async (error2) => {
|
|
2893
2866
|
if (!error2.response) {
|
|
2894
2867
|
return error2;
|
|
2895
2868
|
}
|
|
2896
2869
|
const { data } = error2.response;
|
|
2897
|
-
if (data && data.code === 400 && ["invalid_grant"].includes(
|
|
2898
|
-
|
|
2870
|
+
if (data && data.code === 400 && ["invalid_grant"].includes(data.data?.error)) {
|
|
2871
|
+
await clearAuthToken();
|
|
2899
2872
|
}
|
|
2900
2873
|
return data;
|
|
2901
|
-
}
|
|
2874
|
+
};
|
|
2902
2875
|
const originalRequest = error.config;
|
|
2903
|
-
if ((
|
|
2876
|
+
if ((error.response?.status === 403 || error.response?.status === 401 || error.response?.status === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
|
|
2904
2877
|
error.response.data.code
|
|
2905
2878
|
)) {
|
|
2906
2879
|
if (isRefreshing) {
|
|
@@ -2913,19 +2886,18 @@ var axiosClient = {
|
|
|
2913
2886
|
token
|
|
2914
2887
|
);
|
|
2915
2888
|
return instance.request(originalRequest);
|
|
2916
|
-
}).catch((err) =>
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
yield clearAuthToken();
|
|
2889
|
+
}).catch(async (err) => {
|
|
2890
|
+
if ((err.response?.status === 400 || err.response?.status === 401) && ["invalid_grant"].includes(err.response.data.error)) {
|
|
2891
|
+
await clearAuthToken();
|
|
2920
2892
|
}
|
|
2921
|
-
})
|
|
2893
|
+
});
|
|
2922
2894
|
}
|
|
2923
|
-
const browserSession =
|
|
2924
|
-
const refreshToken =
|
|
2925
|
-
const accessTokenExp =
|
|
2895
|
+
const browserSession = await sessionStorage2.getBrowserSession();
|
|
2896
|
+
const refreshToken = await localStorage2.getRefreshToken();
|
|
2897
|
+
const accessTokenExp = await localStorage2.getAccessToken();
|
|
2926
2898
|
isRefreshing = true;
|
|
2927
2899
|
if (!refreshToken && (!browserSession || browserSession == "unActive")) {
|
|
2928
|
-
|
|
2900
|
+
await clearAuthToken();
|
|
2929
2901
|
} else {
|
|
2930
2902
|
const payload = Object.fromEntries(
|
|
2931
2903
|
Object.entries({
|
|
@@ -2936,9 +2908,8 @@ var axiosClient = {
|
|
|
2936
2908
|
}).filter(([_, value]) => !!value)
|
|
2937
2909
|
);
|
|
2938
2910
|
return new Promise(function(resolve) {
|
|
2939
|
-
var _a3;
|
|
2940
2911
|
axios.post(
|
|
2941
|
-
`${config.baseUrl}${
|
|
2912
|
+
`${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
|
|
2942
2913
|
payload,
|
|
2943
2914
|
{
|
|
2944
2915
|
headers: {
|
|
@@ -2946,10 +2917,10 @@ var axiosClient = {
|
|
|
2946
2917
|
Authorization: `Bearer ${accessTokenExp}`
|
|
2947
2918
|
}
|
|
2948
2919
|
}
|
|
2949
|
-
).then((res) =>
|
|
2920
|
+
).then(async (res) => {
|
|
2950
2921
|
const data = res.data;
|
|
2951
|
-
|
|
2952
|
-
|
|
2922
|
+
await localStorage2.setToken(data.access_token);
|
|
2923
|
+
await localStorage2.setRefreshToken(data.refresh_token);
|
|
2953
2924
|
axios.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
|
|
2954
2925
|
originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
|
|
2955
2926
|
originalRequest.data = updateTokenParamInOriginalRequest(
|
|
@@ -2958,26 +2929,25 @@ var axiosClient = {
|
|
|
2958
2929
|
);
|
|
2959
2930
|
processQueue(null, data.access_token);
|
|
2960
2931
|
resolve(instance.request(originalRequest));
|
|
2961
|
-
})
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
yield clearAuthToken();
|
|
2932
|
+
}).catch(async (err) => {
|
|
2933
|
+
if (err && (err?.error_code === "AUTHEN_FAIL" || err?.error_code === "TOKEN_EXPIRED" || err?.error_code === "TOKEN_INCORRECT" || err?.code === "ERR_BAD_REQUEST") || err?.error_code === "ERR_2FA_006") {
|
|
2934
|
+
await clearAuthToken();
|
|
2965
2935
|
}
|
|
2966
2936
|
if (err && err.response) {
|
|
2967
|
-
const { error_code } =
|
|
2937
|
+
const { error_code } = err.response?.data || {};
|
|
2968
2938
|
if (error_code === "AUTHEN_FAIL") {
|
|
2969
|
-
|
|
2939
|
+
await clearAuthToken();
|
|
2970
2940
|
}
|
|
2971
2941
|
}
|
|
2972
2942
|
processQueue(err, null);
|
|
2973
|
-
})
|
|
2943
|
+
}).finally(() => {
|
|
2974
2944
|
isRefreshing = false;
|
|
2975
2945
|
});
|
|
2976
2946
|
});
|
|
2977
2947
|
}
|
|
2978
2948
|
}
|
|
2979
|
-
return Promise.reject(
|
|
2980
|
-
}
|
|
2949
|
+
return Promise.reject(await handleError3(error));
|
|
2950
|
+
}
|
|
2981
2951
|
);
|
|
2982
2952
|
const handleResponse = (res) => {
|
|
2983
2953
|
if (res && res.data) {
|
|
@@ -2986,7 +2956,6 @@ var axiosClient = {
|
|
|
2986
2956
|
return res;
|
|
2987
2957
|
};
|
|
2988
2958
|
const handleError2 = (error) => {
|
|
2989
|
-
var _a2, _b2, _c;
|
|
2990
2959
|
if (error.isAxiosError && error.code === "ECONNABORTED") {
|
|
2991
2960
|
console.error("Request Timeout Error:", error);
|
|
2992
2961
|
return "Request Timeout Error";
|
|
@@ -2994,17 +2963,17 @@ var axiosClient = {
|
|
|
2994
2963
|
console.error("Network Error:", error);
|
|
2995
2964
|
return "Network Error";
|
|
2996
2965
|
} else {
|
|
2997
|
-
console.error("Other Error:", error
|
|
2998
|
-
const errorMessage =
|
|
2999
|
-
return { message: errorMessage, status:
|
|
2966
|
+
console.error("Other Error:", error?.response);
|
|
2967
|
+
const errorMessage = error?.response?.data?.message || "An error occurred";
|
|
2968
|
+
return { message: errorMessage, status: error?.response?.status };
|
|
3000
2969
|
}
|
|
3001
2970
|
};
|
|
3002
|
-
const clearAuthToken = () =>
|
|
3003
|
-
|
|
2971
|
+
const clearAuthToken = async () => {
|
|
2972
|
+
await localStorage2.clearToken();
|
|
3004
2973
|
if (typeof window !== "undefined") {
|
|
3005
2974
|
window.location.href = `/login`;
|
|
3006
2975
|
}
|
|
3007
|
-
}
|
|
2976
|
+
};
|
|
3008
2977
|
function formatUrl(url, db2) {
|
|
3009
2978
|
return url + (db2 ? "?db=" + db2 : "");
|
|
3010
2979
|
}
|
|
@@ -3029,6 +2998,18 @@ var axiosClient = {
|
|
|
3029
2998
|
|
|
3030
2999
|
// src/environment/EnvStore.ts
|
|
3031
3000
|
var EnvStore = class {
|
|
3001
|
+
envStore;
|
|
3002
|
+
baseUrl;
|
|
3003
|
+
requests;
|
|
3004
|
+
context;
|
|
3005
|
+
defaultCompany;
|
|
3006
|
+
config;
|
|
3007
|
+
companies;
|
|
3008
|
+
user;
|
|
3009
|
+
db;
|
|
3010
|
+
localStorageUtils;
|
|
3011
|
+
sessionStorageUtils;
|
|
3012
|
+
refreshTokenEndpoint;
|
|
3032
3013
|
constructor(envStore2, localStorageUtils2, sessionStorageUtils2) {
|
|
3033
3014
|
this.envStore = envStore2;
|
|
3034
3015
|
this.localStorageUtils = localStorageUtils2;
|
|
@@ -3037,24 +3018,25 @@ var EnvStore = class {
|
|
|
3037
3018
|
}
|
|
3038
3019
|
setup() {
|
|
3039
3020
|
const env2 = this.envStore.getState().env;
|
|
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
|
|
3021
|
+
this.baseUrl = env2?.baseUrl;
|
|
3022
|
+
this.requests = env2?.requests;
|
|
3023
|
+
this.context = env2?.context;
|
|
3024
|
+
this.defaultCompany = env2?.defaultCompany;
|
|
3025
|
+
this.config = env2?.config;
|
|
3026
|
+
this.companies = env2?.companies || [];
|
|
3027
|
+
this.user = env2?.user;
|
|
3028
|
+
this.db = env2?.db;
|
|
3029
|
+
this.refreshTokenEndpoint = env2?.refreshTokenEndpoint;
|
|
3049
3030
|
}
|
|
3050
3031
|
setupEnv(envConfig) {
|
|
3051
3032
|
const dispatch = this.envStore.dispatch;
|
|
3052
|
-
const env2 =
|
|
3033
|
+
const env2 = {
|
|
3034
|
+
...envConfig,
|
|
3053
3035
|
localStorageUtils: this.localStorageUtils,
|
|
3054
3036
|
sessionStorageUtils: this.sessionStorageUtils
|
|
3055
|
-
}
|
|
3037
|
+
};
|
|
3056
3038
|
const requests = axiosClient.init(env2);
|
|
3057
|
-
dispatch(setEnv(
|
|
3039
|
+
dispatch(setEnv({ ...env2, requests }));
|
|
3058
3040
|
this.setup();
|
|
3059
3041
|
}
|
|
3060
3042
|
setUid(uid) {
|
|
@@ -3097,482 +3079,445 @@ function getEnv() {
|
|
|
3097
3079
|
|
|
3098
3080
|
// src/services/view-service/index.ts
|
|
3099
3081
|
var ViewService = {
|
|
3100
|
-
getView(
|
|
3101
|
-
|
|
3082
|
+
async getView({
|
|
3083
|
+
model,
|
|
3084
|
+
views,
|
|
3085
|
+
context = {},
|
|
3086
|
+
options = {},
|
|
3087
|
+
aid
|
|
3088
|
+
}) {
|
|
3089
|
+
const env2 = getEnv();
|
|
3090
|
+
const defaultOptions = {
|
|
3091
|
+
load_filters: true,
|
|
3092
|
+
toolbar: true,
|
|
3093
|
+
action_id: aid
|
|
3094
|
+
};
|
|
3095
|
+
const jsonDataView = {
|
|
3102
3096
|
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
|
-
});
|
|
3097
|
+
method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
|
|
3098
|
+
kwargs: {
|
|
3099
|
+
views,
|
|
3100
|
+
options: { ...options, ...defaultOptions }
|
|
3101
|
+
},
|
|
3102
|
+
with_context: context
|
|
3103
|
+
};
|
|
3104
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
3105
|
+
headers: {
|
|
3106
|
+
"Content-Type": "application/json"
|
|
3107
|
+
}
|
|
3129
3108
|
});
|
|
3130
3109
|
},
|
|
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
|
-
|
|
3110
|
+
async getMenu(context) {
|
|
3111
|
+
const env2 = getEnv();
|
|
3112
|
+
const jsonData = {
|
|
3113
|
+
model: "ir.ui.menu" /* MENU */,
|
|
3114
|
+
method: "web_search_read" /* WEB_SEARCH_READ */,
|
|
3115
|
+
ids: [],
|
|
3116
|
+
with_context: context,
|
|
3117
|
+
kwargs: {
|
|
3118
|
+
specification: {
|
|
3119
|
+
active: {},
|
|
3120
|
+
name: {},
|
|
3121
|
+
is_display: {},
|
|
3122
|
+
sequence: {},
|
|
3123
|
+
complete_name: {},
|
|
3124
|
+
action: {
|
|
3125
|
+
fields: {
|
|
3126
|
+
display_name: {},
|
|
3127
|
+
type: {},
|
|
3128
|
+
binding_view_types: {}
|
|
3129
|
+
// res_model: {},
|
|
3130
|
+
}
|
|
3131
|
+
},
|
|
3132
|
+
url_icon: {},
|
|
3133
|
+
web_icon: {},
|
|
3134
|
+
web_icon_data: {},
|
|
3135
|
+
groups_id: {
|
|
3136
|
+
fields: {
|
|
3137
|
+
full_name: {}
|
|
3154
3138
|
},
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3139
|
+
limit: 40,
|
|
3140
|
+
order: ""
|
|
3141
|
+
},
|
|
3142
|
+
display_name: {},
|
|
3143
|
+
child_id: {
|
|
3144
|
+
fields: {
|
|
3145
|
+
active: {},
|
|
3146
|
+
name: {},
|
|
3147
|
+
is_display: {},
|
|
3148
|
+
sequence: {},
|
|
3149
|
+
complete_name: {},
|
|
3150
|
+
action: {
|
|
3151
|
+
fields: {
|
|
3152
|
+
display_name: {},
|
|
3153
|
+
type: {},
|
|
3154
|
+
binding_view_types: {}
|
|
3155
|
+
// res_model: {},
|
|
3156
|
+
}
|
|
3161
3157
|
},
|
|
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
|
-
}
|
|
3158
|
+
url_icon: {},
|
|
3159
|
+
web_icon: {},
|
|
3160
|
+
web_icon_data: {},
|
|
3161
|
+
groups_id: {
|
|
3162
|
+
fields: {
|
|
3163
|
+
full_name: {}
|
|
3180
3164
|
},
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3165
|
+
limit: 40,
|
|
3166
|
+
order: ""
|
|
3167
|
+
},
|
|
3168
|
+
display_name: {},
|
|
3169
|
+
child_id: {
|
|
3170
|
+
fields: {
|
|
3171
|
+
active: {},
|
|
3172
|
+
name: {},
|
|
3173
|
+
is_display: {},
|
|
3174
|
+
sequence: {},
|
|
3175
|
+
complete_name: {},
|
|
3176
|
+
action: {
|
|
3177
|
+
fields: {
|
|
3178
|
+
display_name: {},
|
|
3179
|
+
type: {},
|
|
3180
|
+
binding_view_types: {}
|
|
3181
|
+
// res_model: {},
|
|
3182
|
+
}
|
|
3187
3183
|
},
|
|
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
|
-
}
|
|
3184
|
+
url_icon: {},
|
|
3185
|
+
web_icon: {},
|
|
3186
|
+
web_icon_data: {},
|
|
3187
|
+
groups_id: {
|
|
3188
|
+
fields: {
|
|
3189
|
+
full_name: {}
|
|
3206
3190
|
},
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3191
|
+
limit: 40,
|
|
3192
|
+
order: ""
|
|
3193
|
+
},
|
|
3194
|
+
display_name: {},
|
|
3195
|
+
child_id: {
|
|
3196
|
+
fields: {
|
|
3197
|
+
active: {},
|
|
3198
|
+
name: {},
|
|
3199
|
+
is_display: {},
|
|
3200
|
+
sequence: {},
|
|
3201
|
+
complete_name: {},
|
|
3202
|
+
action: {
|
|
3203
|
+
fields: {
|
|
3204
|
+
display_name: {},
|
|
3205
|
+
type: {},
|
|
3206
|
+
binding_view_types: {}
|
|
3207
|
+
// res_model: {},
|
|
3208
|
+
}
|
|
3213
3209
|
},
|
|
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
|
-
}
|
|
3210
|
+
url_icon: {},
|
|
3211
|
+
web_icon: {},
|
|
3212
|
+
web_icon_data: {},
|
|
3213
|
+
groups_id: {
|
|
3214
|
+
fields: {
|
|
3215
|
+
full_name: {}
|
|
3232
3216
|
},
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
web_icon_data: {},
|
|
3236
|
-
groups_id: {
|
|
3237
|
-
fields: {
|
|
3238
|
-
full_name: {}
|
|
3239
|
-
},
|
|
3240
|
-
limit: 40,
|
|
3241
|
-
order: ""
|
|
3242
|
-
},
|
|
3243
|
-
display_name: {},
|
|
3244
|
-
child_id: {
|
|
3245
|
-
fields: {},
|
|
3246
|
-
limit: 40,
|
|
3247
|
-
order: ""
|
|
3248
|
-
}
|
|
3217
|
+
limit: 40,
|
|
3218
|
+
order: ""
|
|
3249
3219
|
},
|
|
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
|
-
|
|
3220
|
+
display_name: {},
|
|
3221
|
+
child_id: {
|
|
3222
|
+
fields: {},
|
|
3223
|
+
limit: 40,
|
|
3224
|
+
order: ""
|
|
3225
|
+
}
|
|
3226
|
+
},
|
|
3227
|
+
limit: 40,
|
|
3228
|
+
order: ""
|
|
3229
|
+
}
|
|
3230
|
+
},
|
|
3231
|
+
limit: 40,
|
|
3232
|
+
order: ""
|
|
3233
|
+
}
|
|
3234
|
+
},
|
|
3235
|
+
limit: 40,
|
|
3236
|
+
order: ""
|
|
3237
|
+
}
|
|
3238
|
+
},
|
|
3239
|
+
domain: [
|
|
3240
|
+
"&",
|
|
3241
|
+
["is_display", "=", true],
|
|
3242
|
+
"&",
|
|
3243
|
+
["active", "=", true],
|
|
3244
|
+
["parent_id", "=", false]
|
|
3245
|
+
]
|
|
3246
|
+
}
|
|
3247
|
+
};
|
|
3248
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
3249
|
+
headers: {
|
|
3250
|
+
"Content-Type": "application/json"
|
|
3251
|
+
}
|
|
3276
3252
|
});
|
|
3277
3253
|
},
|
|
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"
|
|
3254
|
+
async getActionDetail(aid, context) {
|
|
3255
|
+
const env2 = getEnv();
|
|
3256
|
+
const jsonData = {
|
|
3257
|
+
model: "ir.actions.act_window" /* WINDOW_ACTION */,
|
|
3258
|
+
method: "web_read" /* WEB_READ */,
|
|
3259
|
+
ids: [aid],
|
|
3260
|
+
with_context: context,
|
|
3261
|
+
kwargs: {
|
|
3262
|
+
specification: {
|
|
3263
|
+
id: {},
|
|
3264
|
+
name: {},
|
|
3265
|
+
res_model: {},
|
|
3266
|
+
views: {},
|
|
3267
|
+
view_mode: {},
|
|
3268
|
+
mobile_view_mode: {},
|
|
3269
|
+
domain: {},
|
|
3270
|
+
context: {},
|
|
3271
|
+
groups_id: {},
|
|
3272
|
+
search_view_id: {}
|
|
3305
3273
|
}
|
|
3306
|
-
}
|
|
3274
|
+
}
|
|
3275
|
+
};
|
|
3276
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
3277
|
+
headers: {
|
|
3278
|
+
"Content-Type": "application/json"
|
|
3279
|
+
}
|
|
3307
3280
|
});
|
|
3308
3281
|
},
|
|
3309
|
-
getResequence(
|
|
3310
|
-
|
|
3282
|
+
async getResequence({
|
|
3283
|
+
model,
|
|
3284
|
+
ids,
|
|
3285
|
+
context,
|
|
3286
|
+
offset
|
|
3287
|
+
}) {
|
|
3288
|
+
const env2 = getEnv();
|
|
3289
|
+
const jsonData = {
|
|
3311
3290
|
model,
|
|
3291
|
+
with_context: context,
|
|
3312
3292
|
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
|
-
});
|
|
3293
|
+
field: "sequence",
|
|
3294
|
+
...offset > 0 ? { offset } : {}
|
|
3295
|
+
};
|
|
3296
|
+
return env2?.requests.post("/web/dataset/resequence", jsonData, {
|
|
3297
|
+
headers: {
|
|
3298
|
+
"Content-Type": "application/json"
|
|
3299
|
+
}
|
|
3356
3300
|
});
|
|
3357
3301
|
},
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3302
|
+
async getSelectionItem({ data }) {
|
|
3303
|
+
const env2 = getEnv();
|
|
3304
|
+
const jsonData = {
|
|
3305
|
+
model: data.model,
|
|
3306
|
+
ids: [],
|
|
3307
|
+
method: "get_data_select",
|
|
3308
|
+
with_context: data.context,
|
|
3309
|
+
kwargs: {
|
|
3310
|
+
count_limit: 10001,
|
|
3311
|
+
domain: data.domain ? data.domain : [],
|
|
3312
|
+
offset: 0,
|
|
3313
|
+
order: "",
|
|
3314
|
+
specification: data?.specification ?? {
|
|
3315
|
+
id: {},
|
|
3316
|
+
name: {},
|
|
3317
|
+
display_name: {}
|
|
3368
3318
|
}
|
|
3369
|
-
|
|
3319
|
+
}
|
|
3320
|
+
};
|
|
3321
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3322
|
+
headers: {
|
|
3323
|
+
"Content-Type": "application/json"
|
|
3324
|
+
}
|
|
3370
3325
|
});
|
|
3371
3326
|
},
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3327
|
+
async loadMessages() {
|
|
3328
|
+
const env2 = getEnv();
|
|
3329
|
+
return env2.requests.post(
|
|
3330
|
+
"/load_message_failures" /* LOAD_MESSAGE */,
|
|
3331
|
+
{},
|
|
3332
|
+
{
|
|
3378
3333
|
headers: {
|
|
3379
3334
|
"Content-Type": "application/json"
|
|
3380
3335
|
}
|
|
3381
|
-
}
|
|
3336
|
+
}
|
|
3337
|
+
);
|
|
3338
|
+
},
|
|
3339
|
+
async getVersion() {
|
|
3340
|
+
const env2 = getEnv();
|
|
3341
|
+
return env2?.requests.get("", {
|
|
3342
|
+
headers: {
|
|
3343
|
+
"Content-Type": "application/json"
|
|
3344
|
+
}
|
|
3382
3345
|
});
|
|
3383
3346
|
},
|
|
3384
|
-
get2FAMethods(
|
|
3385
|
-
|
|
3347
|
+
async get2FAMethods({
|
|
3348
|
+
method,
|
|
3349
|
+
with_context
|
|
3350
|
+
}) {
|
|
3351
|
+
const env2 = getEnv();
|
|
3352
|
+
const jsonData = {
|
|
3386
3353
|
method,
|
|
3387
3354
|
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
|
-
});
|
|
3355
|
+
};
|
|
3356
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3357
|
+
headers: {
|
|
3358
|
+
"Content-Type": "application/json"
|
|
3359
|
+
}
|
|
3399
3360
|
});
|
|
3400
3361
|
},
|
|
3401
|
-
verify2FA(
|
|
3402
|
-
|
|
3362
|
+
async verify2FA({
|
|
3363
|
+
method,
|
|
3364
|
+
with_context,
|
|
3365
|
+
code,
|
|
3366
|
+
device,
|
|
3367
|
+
location
|
|
3368
|
+
}) {
|
|
3369
|
+
const env2 = getEnv();
|
|
3370
|
+
const jsonData = {
|
|
3403
3371
|
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
|
-
});
|
|
3372
|
+
kwargs: {
|
|
3373
|
+
vals: {
|
|
3374
|
+
code,
|
|
3375
|
+
device,
|
|
3376
|
+
location
|
|
3377
|
+
}
|
|
3378
|
+
},
|
|
3379
|
+
with_context
|
|
3380
|
+
};
|
|
3381
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3382
|
+
headers: {
|
|
3383
|
+
"Content-Type": "application/json"
|
|
3384
|
+
},
|
|
3385
|
+
withCredentials: true
|
|
3427
3386
|
});
|
|
3428
3387
|
},
|
|
3429
|
-
signInSSO(
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3388
|
+
async signInSSO({
|
|
3389
|
+
redirect_uri,
|
|
3390
|
+
state,
|
|
3391
|
+
client_id,
|
|
3392
|
+
response_type,
|
|
3393
|
+
path
|
|
3394
|
+
}) {
|
|
3395
|
+
const env2 = getEnv();
|
|
3396
|
+
const params = new URLSearchParams({
|
|
3434
3397
|
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
|
-
});
|
|
3398
|
+
client_id,
|
|
3399
|
+
redirect_uri,
|
|
3400
|
+
state
|
|
3401
|
+
});
|
|
3402
|
+
const url = `${path}?${params.toString()}`;
|
|
3403
|
+
return env2?.requests.get(url, {
|
|
3404
|
+
headers: {
|
|
3405
|
+
"Content-Type": "application/json"
|
|
3406
|
+
},
|
|
3407
|
+
withCredentials: true
|
|
3451
3408
|
});
|
|
3452
3409
|
},
|
|
3453
|
-
grantAccess(
|
|
3454
|
-
|
|
3410
|
+
async grantAccess({
|
|
3411
|
+
redirect_uri,
|
|
3412
|
+
state,
|
|
3413
|
+
client_id,
|
|
3414
|
+
scopes
|
|
3415
|
+
}) {
|
|
3416
|
+
const env2 = getEnv();
|
|
3417
|
+
const jsonData = {
|
|
3455
3418
|
redirect_uri,
|
|
3456
3419
|
state,
|
|
3457
3420
|
client_id,
|
|
3458
3421
|
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
|
-
});
|
|
3422
|
+
};
|
|
3423
|
+
return env2?.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
|
|
3424
|
+
headers: {
|
|
3425
|
+
"Content-Type": "application/json"
|
|
3426
|
+
},
|
|
3427
|
+
withCredentials: true
|
|
3473
3428
|
});
|
|
3474
3429
|
},
|
|
3475
|
-
getFieldsViewSecurity(
|
|
3476
|
-
|
|
3430
|
+
async getFieldsViewSecurity({
|
|
3431
|
+
method,
|
|
3432
|
+
token,
|
|
3433
|
+
views
|
|
3434
|
+
}) {
|
|
3435
|
+
const env2 = getEnv();
|
|
3436
|
+
const jsonData = {
|
|
3477
3437
|
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
|
-
});
|
|
3438
|
+
kwargs: {
|
|
3439
|
+
views
|
|
3440
|
+
},
|
|
3441
|
+
with_context: {
|
|
3442
|
+
token
|
|
3443
|
+
}
|
|
3444
|
+
};
|
|
3445
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3446
|
+
headers: {
|
|
3447
|
+
"Content-Type": "application/json"
|
|
3448
|
+
}
|
|
3496
3449
|
});
|
|
3497
3450
|
},
|
|
3498
|
-
settingsWebRead2fa(
|
|
3499
|
-
|
|
3451
|
+
async settingsWebRead2fa({
|
|
3452
|
+
method,
|
|
3453
|
+
model,
|
|
3454
|
+
kwargs,
|
|
3455
|
+
token
|
|
3456
|
+
}) {
|
|
3457
|
+
const env2 = getEnv();
|
|
3458
|
+
const jsonData = {
|
|
3500
3459
|
method,
|
|
3501
3460
|
model,
|
|
3502
3461
|
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
|
-
});
|
|
3462
|
+
with_context: {
|
|
3463
|
+
token
|
|
3464
|
+
}
|
|
3465
|
+
};
|
|
3466
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3467
|
+
headers: {
|
|
3468
|
+
"Content-Type": "application/json"
|
|
3469
|
+
}
|
|
3519
3470
|
});
|
|
3520
3471
|
},
|
|
3521
|
-
requestSetupTotp(
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
}
|
|
3534
|
-
});
|
|
3472
|
+
async requestSetupTotp({ method, token }) {
|
|
3473
|
+
const env2 = getEnv();
|
|
3474
|
+
const jsonData = {
|
|
3475
|
+
method,
|
|
3476
|
+
with_context: {
|
|
3477
|
+
token
|
|
3478
|
+
}
|
|
3479
|
+
};
|
|
3480
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3481
|
+
headers: {
|
|
3482
|
+
"Content-Type": "application/json"
|
|
3483
|
+
}
|
|
3535
3484
|
});
|
|
3536
3485
|
},
|
|
3537
|
-
verifyTotp(
|
|
3538
|
-
|
|
3486
|
+
async verifyTotp({
|
|
3487
|
+
method,
|
|
3488
|
+
action_token,
|
|
3489
|
+
code
|
|
3490
|
+
}) {
|
|
3491
|
+
const env2 = getEnv();
|
|
3492
|
+
const jsonData = {
|
|
3539
3493
|
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
|
|
3494
|
+
kwargs: {
|
|
3495
|
+
vals: {
|
|
3496
|
+
code
|
|
3553
3497
|
}
|
|
3554
|
-
}
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3498
|
+
},
|
|
3499
|
+
with_context: {
|
|
3500
|
+
action_token
|
|
3501
|
+
}
|
|
3502
|
+
};
|
|
3503
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3504
|
+
headers: {
|
|
3505
|
+
"Content-Type": "application/json"
|
|
3506
|
+
}
|
|
3560
3507
|
});
|
|
3561
3508
|
},
|
|
3562
|
-
removeTotpSetUp(
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
}
|
|
3575
|
-
});
|
|
3509
|
+
async removeTotpSetUp({ method, token }) {
|
|
3510
|
+
const env2 = getEnv();
|
|
3511
|
+
const jsonData = {
|
|
3512
|
+
method,
|
|
3513
|
+
with_context: {
|
|
3514
|
+
token
|
|
3515
|
+
}
|
|
3516
|
+
};
|
|
3517
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3518
|
+
headers: {
|
|
3519
|
+
"Content-Type": "application/json"
|
|
3520
|
+
}
|
|
3576
3521
|
});
|
|
3577
3522
|
}
|
|
3578
3523
|
};
|
|
@@ -3588,18 +3533,17 @@ var VersionGate = ({ children }) => {
|
|
|
3588
3533
|
queryClient.clear();
|
|
3589
3534
|
localStorage.removeItem("__api_version__");
|
|
3590
3535
|
};
|
|
3591
|
-
const validateVersion = () =>
|
|
3592
|
-
const serverVersion =
|
|
3593
|
-
console.log("serverVersion", serverVersion);
|
|
3536
|
+
const validateVersion = async () => {
|
|
3537
|
+
const serverVersion = await view_service_default.getVersion();
|
|
3594
3538
|
const cached = localStorage.getItem("__api_version__");
|
|
3595
|
-
if (cached !==
|
|
3539
|
+
if (cached !== serverVersion?.api_version) {
|
|
3596
3540
|
clearVersion();
|
|
3597
|
-
localStorage.setItem("__api_version__", serverVersion
|
|
3541
|
+
localStorage.setItem("__api_version__", serverVersion?.api_version);
|
|
3598
3542
|
} else {
|
|
3599
|
-
console.log("Api version:", serverVersion
|
|
3543
|
+
console.log("Api version:", serverVersion?.api_version);
|
|
3600
3544
|
}
|
|
3601
3545
|
setReady(true);
|
|
3602
|
-
}
|
|
3546
|
+
};
|
|
3603
3547
|
validateVersion();
|
|
3604
3548
|
if (typeof window !== "undefined") {
|
|
3605
3549
|
const onKey = (e) => {
|