@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.js
CHANGED
|
@@ -1,28 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
|
-
var __defProps = Object.defineProperties;
|
|
5
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
10
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
-
var __pow = Math.pow;
|
|
13
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
14
|
-
var __spreadValues = (a, b) => {
|
|
15
|
-
for (var prop in b || (b = {}))
|
|
16
|
-
if (__hasOwnProp.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
if (__getOwnPropSymbols)
|
|
19
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
20
|
-
if (__propIsEnum.call(b, prop))
|
|
21
|
-
__defNormalProp(a, prop, b[prop]);
|
|
22
|
-
}
|
|
23
|
-
return a;
|
|
24
|
-
};
|
|
25
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
26
8
|
var __export = (target, all) => {
|
|
27
9
|
for (var name in all)
|
|
28
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -44,26 +26,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
44
26
|
mod
|
|
45
27
|
));
|
|
46
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
47
|
-
var __async = (__this, __arguments, generator) => {
|
|
48
|
-
return new Promise((resolve, reject) => {
|
|
49
|
-
var fulfilled = (value) => {
|
|
50
|
-
try {
|
|
51
|
-
step(generator.next(value));
|
|
52
|
-
} catch (e) {
|
|
53
|
-
reject(e);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
var rejected = (value) => {
|
|
57
|
-
try {
|
|
58
|
-
step(generator.throw(value));
|
|
59
|
-
} catch (e) {
|
|
60
|
-
reject(e);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
64
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
29
|
|
|
68
30
|
// src/provider.ts
|
|
69
31
|
var provider_exports = {};
|
|
@@ -285,7 +247,7 @@ var headerSlice = (0, import_toolkit5.createSlice)({
|
|
|
285
247
|
},
|
|
286
248
|
reducers: {
|
|
287
249
|
setHeader: (state, action) => {
|
|
288
|
-
state.value =
|
|
250
|
+
state.value = { ...state.value, ...action.payload };
|
|
289
251
|
},
|
|
290
252
|
setAllowedCompanyIds: (state, action) => {
|
|
291
253
|
state.value.allowedCompanyIds = action.payload;
|
|
@@ -1809,6 +1771,22 @@ var PyRelativeDelta = class _PyRelativeDelta {
|
|
|
1809
1771
|
this.microsecond = params.microsecond;
|
|
1810
1772
|
this.weekday = params.weekday;
|
|
1811
1773
|
}
|
|
1774
|
+
years;
|
|
1775
|
+
months;
|
|
1776
|
+
days;
|
|
1777
|
+
hours;
|
|
1778
|
+
minutes;
|
|
1779
|
+
seconds;
|
|
1780
|
+
microseconds;
|
|
1781
|
+
leapDays;
|
|
1782
|
+
year;
|
|
1783
|
+
month;
|
|
1784
|
+
day;
|
|
1785
|
+
hour;
|
|
1786
|
+
minute;
|
|
1787
|
+
second;
|
|
1788
|
+
microsecond;
|
|
1789
|
+
weekday;
|
|
1812
1790
|
negate() {
|
|
1813
1791
|
return new _PyRelativeDelta(this, -1);
|
|
1814
1792
|
}
|
|
@@ -1923,7 +1901,7 @@ function execOnIterable(iterable, func) {
|
|
|
1923
1901
|
if (typeof iterable === "object" && !Array.isArray(iterable) && !(iterable instanceof Set)) {
|
|
1924
1902
|
iterable = Object.keys(iterable);
|
|
1925
1903
|
}
|
|
1926
|
-
if (typeof
|
|
1904
|
+
if (typeof iterable?.[Symbol.iterator] !== "function") {
|
|
1927
1905
|
throw new EvaluationError("value not iterable");
|
|
1928
1906
|
}
|
|
1929
1907
|
return func(iterable);
|
|
@@ -2246,7 +2224,7 @@ function applyBinaryOp(ast, context) {
|
|
|
2246
2224
|
}
|
|
2247
2225
|
return Math.floor(left / right);
|
|
2248
2226
|
case "**":
|
|
2249
|
-
return
|
|
2227
|
+
return left ** right;
|
|
2250
2228
|
case "==":
|
|
2251
2229
|
return isEqual(left, right);
|
|
2252
2230
|
case "<>":
|
|
@@ -2368,7 +2346,7 @@ function evaluate(ast, context = {}) {
|
|
|
2368
2346
|
const dicts = /* @__PURE__ */ new Set();
|
|
2369
2347
|
let pyContext;
|
|
2370
2348
|
const evalContext = Object.create(context);
|
|
2371
|
-
if (!
|
|
2349
|
+
if (!evalContext?.context) {
|
|
2372
2350
|
Object.defineProperty(evalContext, "context", {
|
|
2373
2351
|
get() {
|
|
2374
2352
|
if (!pyContext) {
|
|
@@ -2379,18 +2357,17 @@ function evaluate(ast, context = {}) {
|
|
|
2379
2357
|
});
|
|
2380
2358
|
}
|
|
2381
2359
|
function _innerEvaluate(ast2) {
|
|
2382
|
-
|
|
2383
|
-
switch (ast2 == null ? void 0 : ast2.type) {
|
|
2360
|
+
switch (ast2?.type) {
|
|
2384
2361
|
case 0:
|
|
2385
2362
|
// Number
|
|
2386
2363
|
case 1:
|
|
2387
2364
|
return ast2.value;
|
|
2388
2365
|
case 5:
|
|
2389
2366
|
if (ast2.value in evalContext) {
|
|
2390
|
-
if (typeof evalContext[ast2.value] === "object" &&
|
|
2391
|
-
return
|
|
2367
|
+
if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
|
|
2368
|
+
return evalContext[ast2.value]?.id;
|
|
2392
2369
|
}
|
|
2393
|
-
return
|
|
2370
|
+
return evalContext[ast2.value] ?? false;
|
|
2394
2371
|
} else if (ast2.value in BUILTINS) {
|
|
2395
2372
|
return BUILTINS[ast2.value];
|
|
2396
2373
|
} else {
|
|
@@ -2427,7 +2404,7 @@ function evaluate(ast, context = {}) {
|
|
|
2427
2404
|
const args = ast2.args.map(_evaluate);
|
|
2428
2405
|
const kwargs = {};
|
|
2429
2406
|
for (const kwarg in ast2.kwargs) {
|
|
2430
|
-
kwargs[kwarg] = _evaluate(ast2
|
|
2407
|
+
kwargs[kwarg] = _evaluate(ast2?.kwargs[kwarg]);
|
|
2431
2408
|
}
|
|
2432
2409
|
if (fnValue === PyDate || fnValue === PyDateTime || fnValue === PyTime || fnValue === PyRelativeDelta || fnValue === PyTimeDelta) {
|
|
2433
2410
|
return fnValue.create(...args, kwargs);
|
|
@@ -2506,25 +2483,9 @@ function escapeRegExp(str) {
|
|
|
2506
2483
|
var InvalidDomainError = class extends Error {
|
|
2507
2484
|
};
|
|
2508
2485
|
var Domain = class _Domain {
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
return new _Domain(descr.toString());
|
|
2513
|
-
} else {
|
|
2514
|
-
let rawAST;
|
|
2515
|
-
try {
|
|
2516
|
-
rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
|
|
2517
|
-
} catch (error) {
|
|
2518
|
-
throw new InvalidDomainError(
|
|
2519
|
-
`Invalid domain representation: ${descr}`,
|
|
2520
|
-
{
|
|
2521
|
-
cause: error
|
|
2522
|
-
}
|
|
2523
|
-
);
|
|
2524
|
-
}
|
|
2525
|
-
this.ast = normalizeDomainAST(rawAST);
|
|
2526
|
-
}
|
|
2527
|
-
}
|
|
2486
|
+
ast = { type: -1, value: null };
|
|
2487
|
+
static TRUE;
|
|
2488
|
+
static FALSE;
|
|
2528
2489
|
static combine(domains, operator) {
|
|
2529
2490
|
if (domains.length === 0) {
|
|
2530
2491
|
return new _Domain([]);
|
|
@@ -2603,6 +2564,24 @@ var Domain = class _Domain {
|
|
|
2603
2564
|
processLeaf(d.ast.value, 0, "&", newDomain);
|
|
2604
2565
|
return newDomain;
|
|
2605
2566
|
}
|
|
2567
|
+
constructor(descr = []) {
|
|
2568
|
+
if (descr instanceof _Domain) {
|
|
2569
|
+
return new _Domain(descr.toString());
|
|
2570
|
+
} else {
|
|
2571
|
+
let rawAST;
|
|
2572
|
+
try {
|
|
2573
|
+
rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
|
|
2574
|
+
} catch (error) {
|
|
2575
|
+
throw new InvalidDomainError(
|
|
2576
|
+
`Invalid domain representation: ${descr}`,
|
|
2577
|
+
{
|
|
2578
|
+
cause: error
|
|
2579
|
+
}
|
|
2580
|
+
);
|
|
2581
|
+
}
|
|
2582
|
+
this.ast = normalizeDomainAST(rawAST);
|
|
2583
|
+
}
|
|
2584
|
+
}
|
|
2606
2585
|
contains(record) {
|
|
2607
2586
|
const expr = evaluate(this.ast, record);
|
|
2608
2587
|
return matchDomain(record, expr);
|
|
@@ -2621,7 +2600,7 @@ var Domain = class _Domain {
|
|
|
2621
2600
|
return evaluatedAsList;
|
|
2622
2601
|
}
|
|
2623
2602
|
return this.toString();
|
|
2624
|
-
} catch
|
|
2603
|
+
} catch {
|
|
2625
2604
|
return this.toString();
|
|
2626
2605
|
}
|
|
2627
2606
|
}
|
|
@@ -2844,22 +2823,22 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
|
|
|
2844
2823
|
|
|
2845
2824
|
// src/utils/storage/local-storage.ts
|
|
2846
2825
|
var localStorageUtils = () => {
|
|
2847
|
-
const setToken = (access_token) =>
|
|
2826
|
+
const setToken = async (access_token) => {
|
|
2848
2827
|
localStorage.setItem("accessToken", access_token);
|
|
2849
|
-
}
|
|
2850
|
-
const setRefreshToken = (refresh_token) =>
|
|
2828
|
+
};
|
|
2829
|
+
const setRefreshToken = async (refresh_token) => {
|
|
2851
2830
|
localStorage.setItem("refreshToken", refresh_token);
|
|
2852
|
-
}
|
|
2853
|
-
const getAccessToken = () =>
|
|
2831
|
+
};
|
|
2832
|
+
const getAccessToken = async () => {
|
|
2854
2833
|
return localStorage.getItem("accessToken");
|
|
2855
|
-
}
|
|
2856
|
-
const getRefreshToken = () =>
|
|
2834
|
+
};
|
|
2835
|
+
const getRefreshToken = async () => {
|
|
2857
2836
|
return localStorage.getItem("refreshToken");
|
|
2858
|
-
}
|
|
2859
|
-
const clearToken = () =>
|
|
2837
|
+
};
|
|
2838
|
+
const clearToken = async () => {
|
|
2860
2839
|
localStorage.removeItem("accessToken");
|
|
2861
2840
|
localStorage.removeItem("refreshToken");
|
|
2862
|
-
}
|
|
2841
|
+
};
|
|
2863
2842
|
return {
|
|
2864
2843
|
setToken,
|
|
2865
2844
|
setRefreshToken,
|
|
@@ -2871,9 +2850,9 @@ var localStorageUtils = () => {
|
|
|
2871
2850
|
|
|
2872
2851
|
// src/utils/storage/session-storage.ts
|
|
2873
2852
|
var sessionStorageUtils = () => {
|
|
2874
|
-
const getBrowserSession = () =>
|
|
2853
|
+
const getBrowserSession = async () => {
|
|
2875
2854
|
return sessionStorage.getItem("browserSession");
|
|
2876
|
-
}
|
|
2855
|
+
};
|
|
2877
2856
|
return {
|
|
2878
2857
|
getBrowserSession
|
|
2879
2858
|
};
|
|
@@ -2882,14 +2861,13 @@ var sessionStorageUtils = () => {
|
|
|
2882
2861
|
// src/configs/axios-client.ts
|
|
2883
2862
|
var axiosClient = {
|
|
2884
2863
|
init(config) {
|
|
2885
|
-
|
|
2886
|
-
const
|
|
2887
|
-
const sessionStorage2 = (_b = config.sessionStorageUtils) != null ? _b : sessionStorageUtils();
|
|
2864
|
+
const localStorage2 = config.localStorageUtils ?? localStorageUtils();
|
|
2865
|
+
const sessionStorage2 = config.sessionStorageUtils ?? sessionStorageUtils();
|
|
2888
2866
|
const db = config.db;
|
|
2889
2867
|
let isRefreshing = false;
|
|
2890
2868
|
let failedQueue = [];
|
|
2891
2869
|
const processQueue = (error, token = null) => {
|
|
2892
|
-
failedQueue
|
|
2870
|
+
failedQueue?.forEach((prom) => {
|
|
2893
2871
|
if (error) {
|
|
2894
2872
|
prom.reject(error);
|
|
2895
2873
|
} else {
|
|
@@ -2905,14 +2883,14 @@ var axiosClient = {
|
|
|
2905
2883
|
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
2906
2884
|
});
|
|
2907
2885
|
instance.interceptors.request.use(
|
|
2908
|
-
(config2) =>
|
|
2886
|
+
async (config2) => {
|
|
2909
2887
|
const useRefreshToken = config2.useRefreshToken;
|
|
2910
|
-
const token = useRefreshToken ?
|
|
2888
|
+
const token = useRefreshToken ? await localStorage2.getRefreshToken() : await localStorage2.getAccessToken();
|
|
2911
2889
|
if (token) {
|
|
2912
2890
|
config2.headers["Authorization"] = "Bearer " + token;
|
|
2913
2891
|
}
|
|
2914
2892
|
return config2;
|
|
2915
|
-
}
|
|
2893
|
+
},
|
|
2916
2894
|
(error) => {
|
|
2917
2895
|
Promise.reject(error);
|
|
2918
2896
|
}
|
|
@@ -2921,21 +2899,19 @@ var axiosClient = {
|
|
|
2921
2899
|
(response) => {
|
|
2922
2900
|
return handleResponse(response);
|
|
2923
2901
|
},
|
|
2924
|
-
(error) =>
|
|
2925
|
-
|
|
2926
|
-
const handleError3 = (error2) => __async(null, null, function* () {
|
|
2927
|
-
var _a3;
|
|
2902
|
+
async (error) => {
|
|
2903
|
+
const handleError3 = async (error2) => {
|
|
2928
2904
|
if (!error2.response) {
|
|
2929
2905
|
return error2;
|
|
2930
2906
|
}
|
|
2931
2907
|
const { data } = error2.response;
|
|
2932
|
-
if (data && data.code === 400 && ["invalid_grant"].includes(
|
|
2933
|
-
|
|
2908
|
+
if (data && data.code === 400 && ["invalid_grant"].includes(data.data?.error)) {
|
|
2909
|
+
await clearAuthToken();
|
|
2934
2910
|
}
|
|
2935
2911
|
return data;
|
|
2936
|
-
}
|
|
2912
|
+
};
|
|
2937
2913
|
const originalRequest = error.config;
|
|
2938
|
-
if ((
|
|
2914
|
+
if ((error.response?.status === 403 || error.response?.status === 401 || error.response?.status === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
|
|
2939
2915
|
error.response.data.code
|
|
2940
2916
|
)) {
|
|
2941
2917
|
if (isRefreshing) {
|
|
@@ -2948,19 +2924,18 @@ var axiosClient = {
|
|
|
2948
2924
|
token
|
|
2949
2925
|
);
|
|
2950
2926
|
return instance.request(originalRequest);
|
|
2951
|
-
}).catch((err) =>
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
yield clearAuthToken();
|
|
2927
|
+
}).catch(async (err) => {
|
|
2928
|
+
if ((err.response?.status === 400 || err.response?.status === 401) && ["invalid_grant"].includes(err.response.data.error)) {
|
|
2929
|
+
await clearAuthToken();
|
|
2955
2930
|
}
|
|
2956
|
-
})
|
|
2931
|
+
});
|
|
2957
2932
|
}
|
|
2958
|
-
const browserSession =
|
|
2959
|
-
const refreshToken =
|
|
2960
|
-
const accessTokenExp =
|
|
2933
|
+
const browserSession = await sessionStorage2.getBrowserSession();
|
|
2934
|
+
const refreshToken = await localStorage2.getRefreshToken();
|
|
2935
|
+
const accessTokenExp = await localStorage2.getAccessToken();
|
|
2961
2936
|
isRefreshing = true;
|
|
2962
2937
|
if (!refreshToken && (!browserSession || browserSession == "unActive")) {
|
|
2963
|
-
|
|
2938
|
+
await clearAuthToken();
|
|
2964
2939
|
} else {
|
|
2965
2940
|
const payload = Object.fromEntries(
|
|
2966
2941
|
Object.entries({
|
|
@@ -2971,9 +2946,8 @@ var axiosClient = {
|
|
|
2971
2946
|
}).filter(([_, value]) => !!value)
|
|
2972
2947
|
);
|
|
2973
2948
|
return new Promise(function(resolve) {
|
|
2974
|
-
var _a3;
|
|
2975
2949
|
import_axios.default.post(
|
|
2976
|
-
`${config.baseUrl}${
|
|
2950
|
+
`${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
|
|
2977
2951
|
payload,
|
|
2978
2952
|
{
|
|
2979
2953
|
headers: {
|
|
@@ -2981,10 +2955,10 @@ var axiosClient = {
|
|
|
2981
2955
|
Authorization: `Bearer ${accessTokenExp}`
|
|
2982
2956
|
}
|
|
2983
2957
|
}
|
|
2984
|
-
).then((res) =>
|
|
2958
|
+
).then(async (res) => {
|
|
2985
2959
|
const data = res.data;
|
|
2986
|
-
|
|
2987
|
-
|
|
2960
|
+
await localStorage2.setToken(data.access_token);
|
|
2961
|
+
await localStorage2.setRefreshToken(data.refresh_token);
|
|
2988
2962
|
import_axios.default.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
|
|
2989
2963
|
originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
|
|
2990
2964
|
originalRequest.data = updateTokenParamInOriginalRequest(
|
|
@@ -2993,26 +2967,25 @@ var axiosClient = {
|
|
|
2993
2967
|
);
|
|
2994
2968
|
processQueue(null, data.access_token);
|
|
2995
2969
|
resolve(instance.request(originalRequest));
|
|
2996
|
-
})
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
yield clearAuthToken();
|
|
2970
|
+
}).catch(async (err) => {
|
|
2971
|
+
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") {
|
|
2972
|
+
await clearAuthToken();
|
|
3000
2973
|
}
|
|
3001
2974
|
if (err && err.response) {
|
|
3002
|
-
const { error_code } =
|
|
2975
|
+
const { error_code } = err.response?.data || {};
|
|
3003
2976
|
if (error_code === "AUTHEN_FAIL") {
|
|
3004
|
-
|
|
2977
|
+
await clearAuthToken();
|
|
3005
2978
|
}
|
|
3006
2979
|
}
|
|
3007
2980
|
processQueue(err, null);
|
|
3008
|
-
})
|
|
2981
|
+
}).finally(() => {
|
|
3009
2982
|
isRefreshing = false;
|
|
3010
2983
|
});
|
|
3011
2984
|
});
|
|
3012
2985
|
}
|
|
3013
2986
|
}
|
|
3014
|
-
return Promise.reject(
|
|
3015
|
-
}
|
|
2987
|
+
return Promise.reject(await handleError3(error));
|
|
2988
|
+
}
|
|
3016
2989
|
);
|
|
3017
2990
|
const handleResponse = (res) => {
|
|
3018
2991
|
if (res && res.data) {
|
|
@@ -3021,7 +2994,6 @@ var axiosClient = {
|
|
|
3021
2994
|
return res;
|
|
3022
2995
|
};
|
|
3023
2996
|
const handleError2 = (error) => {
|
|
3024
|
-
var _a2, _b2, _c;
|
|
3025
2997
|
if (error.isAxiosError && error.code === "ECONNABORTED") {
|
|
3026
2998
|
console.error("Request Timeout Error:", error);
|
|
3027
2999
|
return "Request Timeout Error";
|
|
@@ -3029,17 +3001,17 @@ var axiosClient = {
|
|
|
3029
3001
|
console.error("Network Error:", error);
|
|
3030
3002
|
return "Network Error";
|
|
3031
3003
|
} else {
|
|
3032
|
-
console.error("Other Error:", error
|
|
3033
|
-
const errorMessage =
|
|
3034
|
-
return { message: errorMessage, status:
|
|
3004
|
+
console.error("Other Error:", error?.response);
|
|
3005
|
+
const errorMessage = error?.response?.data?.message || "An error occurred";
|
|
3006
|
+
return { message: errorMessage, status: error?.response?.status };
|
|
3035
3007
|
}
|
|
3036
3008
|
};
|
|
3037
|
-
const clearAuthToken = () =>
|
|
3038
|
-
|
|
3009
|
+
const clearAuthToken = async () => {
|
|
3010
|
+
await localStorage2.clearToken();
|
|
3039
3011
|
if (typeof window !== "undefined") {
|
|
3040
3012
|
window.location.href = `/login`;
|
|
3041
3013
|
}
|
|
3042
|
-
}
|
|
3014
|
+
};
|
|
3043
3015
|
function formatUrl(url, db2) {
|
|
3044
3016
|
return url + (db2 ? "?db=" + db2 : "");
|
|
3045
3017
|
}
|
|
@@ -3064,6 +3036,18 @@ var axiosClient = {
|
|
|
3064
3036
|
|
|
3065
3037
|
// src/environment/EnvStore.ts
|
|
3066
3038
|
var EnvStore = class {
|
|
3039
|
+
envStore;
|
|
3040
|
+
baseUrl;
|
|
3041
|
+
requests;
|
|
3042
|
+
context;
|
|
3043
|
+
defaultCompany;
|
|
3044
|
+
config;
|
|
3045
|
+
companies;
|
|
3046
|
+
user;
|
|
3047
|
+
db;
|
|
3048
|
+
localStorageUtils;
|
|
3049
|
+
sessionStorageUtils;
|
|
3050
|
+
refreshTokenEndpoint;
|
|
3067
3051
|
constructor(envStore2, localStorageUtils2, sessionStorageUtils2) {
|
|
3068
3052
|
this.envStore = envStore2;
|
|
3069
3053
|
this.localStorageUtils = localStorageUtils2;
|
|
@@ -3072,24 +3056,25 @@ var EnvStore = class {
|
|
|
3072
3056
|
}
|
|
3073
3057
|
setup() {
|
|
3074
3058
|
const env2 = this.envStore.getState().env;
|
|
3075
|
-
this.baseUrl = env2
|
|
3076
|
-
this.requests = env2
|
|
3077
|
-
this.context = env2
|
|
3078
|
-
this.defaultCompany = env2
|
|
3079
|
-
this.config = env2
|
|
3080
|
-
this.companies =
|
|
3081
|
-
this.user = env2
|
|
3082
|
-
this.db = env2
|
|
3083
|
-
this.refreshTokenEndpoint = env2
|
|
3059
|
+
this.baseUrl = env2?.baseUrl;
|
|
3060
|
+
this.requests = env2?.requests;
|
|
3061
|
+
this.context = env2?.context;
|
|
3062
|
+
this.defaultCompany = env2?.defaultCompany;
|
|
3063
|
+
this.config = env2?.config;
|
|
3064
|
+
this.companies = env2?.companies || [];
|
|
3065
|
+
this.user = env2?.user;
|
|
3066
|
+
this.db = env2?.db;
|
|
3067
|
+
this.refreshTokenEndpoint = env2?.refreshTokenEndpoint;
|
|
3084
3068
|
}
|
|
3085
3069
|
setupEnv(envConfig) {
|
|
3086
3070
|
const dispatch = this.envStore.dispatch;
|
|
3087
|
-
const env2 =
|
|
3071
|
+
const env2 = {
|
|
3072
|
+
...envConfig,
|
|
3088
3073
|
localStorageUtils: this.localStorageUtils,
|
|
3089
3074
|
sessionStorageUtils: this.sessionStorageUtils
|
|
3090
|
-
}
|
|
3075
|
+
};
|
|
3091
3076
|
const requests = axiosClient.init(env2);
|
|
3092
|
-
dispatch(setEnv(
|
|
3077
|
+
dispatch(setEnv({ ...env2, requests }));
|
|
3093
3078
|
this.setup();
|
|
3094
3079
|
}
|
|
3095
3080
|
setUid(uid) {
|
|
@@ -3132,482 +3117,445 @@ function getEnv() {
|
|
|
3132
3117
|
|
|
3133
3118
|
// src/services/view-service/index.ts
|
|
3134
3119
|
var ViewService = {
|
|
3135
|
-
getView(
|
|
3136
|
-
|
|
3120
|
+
async getView({
|
|
3121
|
+
model,
|
|
3122
|
+
views,
|
|
3123
|
+
context = {},
|
|
3124
|
+
options = {},
|
|
3125
|
+
aid
|
|
3126
|
+
}) {
|
|
3127
|
+
const env2 = getEnv();
|
|
3128
|
+
const defaultOptions = {
|
|
3129
|
+
load_filters: true,
|
|
3130
|
+
toolbar: true,
|
|
3131
|
+
action_id: aid
|
|
3132
|
+
};
|
|
3133
|
+
const jsonDataView = {
|
|
3137
3134
|
model,
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
};
|
|
3150
|
-
const jsonDataView = {
|
|
3151
|
-
model,
|
|
3152
|
-
method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
|
|
3153
|
-
kwargs: {
|
|
3154
|
-
views,
|
|
3155
|
-
options: __spreadValues(__spreadValues({}, options), defaultOptions)
|
|
3156
|
-
},
|
|
3157
|
-
with_context: context
|
|
3158
|
-
};
|
|
3159
|
-
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
3160
|
-
headers: {
|
|
3161
|
-
"Content-Type": "application/json"
|
|
3162
|
-
}
|
|
3163
|
-
});
|
|
3135
|
+
method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
|
|
3136
|
+
kwargs: {
|
|
3137
|
+
views,
|
|
3138
|
+
options: { ...options, ...defaultOptions }
|
|
3139
|
+
},
|
|
3140
|
+
with_context: context
|
|
3141
|
+
};
|
|
3142
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
3143
|
+
headers: {
|
|
3144
|
+
"Content-Type": "application/json"
|
|
3145
|
+
}
|
|
3164
3146
|
});
|
|
3165
3147
|
},
|
|
3166
|
-
getMenu(context) {
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3148
|
+
async getMenu(context) {
|
|
3149
|
+
const env2 = getEnv();
|
|
3150
|
+
const jsonData = {
|
|
3151
|
+
model: "ir.ui.menu" /* MENU */,
|
|
3152
|
+
method: "web_search_read" /* WEB_SEARCH_READ */,
|
|
3153
|
+
ids: [],
|
|
3154
|
+
with_context: context,
|
|
3155
|
+
kwargs: {
|
|
3156
|
+
specification: {
|
|
3157
|
+
active: {},
|
|
3158
|
+
name: {},
|
|
3159
|
+
is_display: {},
|
|
3160
|
+
sequence: {},
|
|
3161
|
+
complete_name: {},
|
|
3162
|
+
action: {
|
|
3163
|
+
fields: {
|
|
3164
|
+
display_name: {},
|
|
3165
|
+
type: {},
|
|
3166
|
+
binding_view_types: {}
|
|
3167
|
+
// res_model: {},
|
|
3168
|
+
}
|
|
3169
|
+
},
|
|
3170
|
+
url_icon: {},
|
|
3171
|
+
web_icon: {},
|
|
3172
|
+
web_icon_data: {},
|
|
3173
|
+
groups_id: {
|
|
3174
|
+
fields: {
|
|
3175
|
+
full_name: {}
|
|
3189
3176
|
},
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3177
|
+
limit: 40,
|
|
3178
|
+
order: ""
|
|
3179
|
+
},
|
|
3180
|
+
display_name: {},
|
|
3181
|
+
child_id: {
|
|
3182
|
+
fields: {
|
|
3183
|
+
active: {},
|
|
3184
|
+
name: {},
|
|
3185
|
+
is_display: {},
|
|
3186
|
+
sequence: {},
|
|
3187
|
+
complete_name: {},
|
|
3188
|
+
action: {
|
|
3189
|
+
fields: {
|
|
3190
|
+
display_name: {},
|
|
3191
|
+
type: {},
|
|
3192
|
+
binding_view_types: {}
|
|
3193
|
+
// res_model: {},
|
|
3194
|
+
}
|
|
3196
3195
|
},
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
active: {},
|
|
3204
|
-
name: {},
|
|
3205
|
-
is_display: {},
|
|
3206
|
-
sequence: {},
|
|
3207
|
-
complete_name: {},
|
|
3208
|
-
action: {
|
|
3209
|
-
fields: {
|
|
3210
|
-
display_name: {},
|
|
3211
|
-
type: {},
|
|
3212
|
-
binding_view_types: {}
|
|
3213
|
-
// res_model: {},
|
|
3214
|
-
}
|
|
3196
|
+
url_icon: {},
|
|
3197
|
+
web_icon: {},
|
|
3198
|
+
web_icon_data: {},
|
|
3199
|
+
groups_id: {
|
|
3200
|
+
fields: {
|
|
3201
|
+
full_name: {}
|
|
3215
3202
|
},
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3203
|
+
limit: 40,
|
|
3204
|
+
order: ""
|
|
3205
|
+
},
|
|
3206
|
+
display_name: {},
|
|
3207
|
+
child_id: {
|
|
3208
|
+
fields: {
|
|
3209
|
+
active: {},
|
|
3210
|
+
name: {},
|
|
3211
|
+
is_display: {},
|
|
3212
|
+
sequence: {},
|
|
3213
|
+
complete_name: {},
|
|
3214
|
+
action: {
|
|
3215
|
+
fields: {
|
|
3216
|
+
display_name: {},
|
|
3217
|
+
type: {},
|
|
3218
|
+
binding_view_types: {}
|
|
3219
|
+
// res_model: {},
|
|
3220
|
+
}
|
|
3222
3221
|
},
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
active: {},
|
|
3230
|
-
name: {},
|
|
3231
|
-
is_display: {},
|
|
3232
|
-
sequence: {},
|
|
3233
|
-
complete_name: {},
|
|
3234
|
-
action: {
|
|
3235
|
-
fields: {
|
|
3236
|
-
display_name: {},
|
|
3237
|
-
type: {},
|
|
3238
|
-
binding_view_types: {}
|
|
3239
|
-
// res_model: {},
|
|
3240
|
-
}
|
|
3222
|
+
url_icon: {},
|
|
3223
|
+
web_icon: {},
|
|
3224
|
+
web_icon_data: {},
|
|
3225
|
+
groups_id: {
|
|
3226
|
+
fields: {
|
|
3227
|
+
full_name: {}
|
|
3241
3228
|
},
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3229
|
+
limit: 40,
|
|
3230
|
+
order: ""
|
|
3231
|
+
},
|
|
3232
|
+
display_name: {},
|
|
3233
|
+
child_id: {
|
|
3234
|
+
fields: {
|
|
3235
|
+
active: {},
|
|
3236
|
+
name: {},
|
|
3237
|
+
is_display: {},
|
|
3238
|
+
sequence: {},
|
|
3239
|
+
complete_name: {},
|
|
3240
|
+
action: {
|
|
3241
|
+
fields: {
|
|
3242
|
+
display_name: {},
|
|
3243
|
+
type: {},
|
|
3244
|
+
binding_view_types: {}
|
|
3245
|
+
// res_model: {},
|
|
3246
|
+
}
|
|
3248
3247
|
},
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
active: {},
|
|
3256
|
-
name: {},
|
|
3257
|
-
is_display: {},
|
|
3258
|
-
sequence: {},
|
|
3259
|
-
complete_name: {},
|
|
3260
|
-
action: {
|
|
3261
|
-
fields: {
|
|
3262
|
-
display_name: {},
|
|
3263
|
-
type: {},
|
|
3264
|
-
binding_view_types: {}
|
|
3265
|
-
// res_model: {},
|
|
3266
|
-
}
|
|
3267
|
-
},
|
|
3268
|
-
url_icon: {},
|
|
3269
|
-
web_icon: {},
|
|
3270
|
-
web_icon_data: {},
|
|
3271
|
-
groups_id: {
|
|
3272
|
-
fields: {
|
|
3273
|
-
full_name: {}
|
|
3274
|
-
},
|
|
3275
|
-
limit: 40,
|
|
3276
|
-
order: ""
|
|
3248
|
+
url_icon: {},
|
|
3249
|
+
web_icon: {},
|
|
3250
|
+
web_icon_data: {},
|
|
3251
|
+
groups_id: {
|
|
3252
|
+
fields: {
|
|
3253
|
+
full_name: {}
|
|
3277
3254
|
},
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
fields: {},
|
|
3281
|
-
limit: 40,
|
|
3282
|
-
order: ""
|
|
3283
|
-
}
|
|
3255
|
+
limit: 40,
|
|
3256
|
+
order: ""
|
|
3284
3257
|
},
|
|
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
|
-
|
|
3310
|
-
|
|
3258
|
+
display_name: {},
|
|
3259
|
+
child_id: {
|
|
3260
|
+
fields: {},
|
|
3261
|
+
limit: 40,
|
|
3262
|
+
order: ""
|
|
3263
|
+
}
|
|
3264
|
+
},
|
|
3265
|
+
limit: 40,
|
|
3266
|
+
order: ""
|
|
3267
|
+
}
|
|
3268
|
+
},
|
|
3269
|
+
limit: 40,
|
|
3270
|
+
order: ""
|
|
3271
|
+
}
|
|
3272
|
+
},
|
|
3273
|
+
limit: 40,
|
|
3274
|
+
order: ""
|
|
3275
|
+
}
|
|
3276
|
+
},
|
|
3277
|
+
domain: [
|
|
3278
|
+
"&",
|
|
3279
|
+
["is_display", "=", true],
|
|
3280
|
+
"&",
|
|
3281
|
+
["active", "=", true],
|
|
3282
|
+
["parent_id", "=", false]
|
|
3283
|
+
]
|
|
3284
|
+
}
|
|
3285
|
+
};
|
|
3286
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
3287
|
+
headers: {
|
|
3288
|
+
"Content-Type": "application/json"
|
|
3289
|
+
}
|
|
3311
3290
|
});
|
|
3312
3291
|
},
|
|
3313
|
-
getActionDetail(aid, context) {
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
groups_id: {},
|
|
3333
|
-
search_view_id: {}
|
|
3334
|
-
}
|
|
3292
|
+
async getActionDetail(aid, context) {
|
|
3293
|
+
const env2 = getEnv();
|
|
3294
|
+
const jsonData = {
|
|
3295
|
+
model: "ir.actions.act_window" /* WINDOW_ACTION */,
|
|
3296
|
+
method: "web_read" /* WEB_READ */,
|
|
3297
|
+
ids: [aid],
|
|
3298
|
+
with_context: context,
|
|
3299
|
+
kwargs: {
|
|
3300
|
+
specification: {
|
|
3301
|
+
id: {},
|
|
3302
|
+
name: {},
|
|
3303
|
+
res_model: {},
|
|
3304
|
+
views: {},
|
|
3305
|
+
view_mode: {},
|
|
3306
|
+
mobile_view_mode: {},
|
|
3307
|
+
domain: {},
|
|
3308
|
+
context: {},
|
|
3309
|
+
groups_id: {},
|
|
3310
|
+
search_view_id: {}
|
|
3335
3311
|
}
|
|
3336
|
-
}
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
}
|
|
3312
|
+
}
|
|
3313
|
+
};
|
|
3314
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
3315
|
+
headers: {
|
|
3316
|
+
"Content-Type": "application/json"
|
|
3317
|
+
}
|
|
3342
3318
|
});
|
|
3343
3319
|
},
|
|
3344
|
-
getResequence(
|
|
3345
|
-
|
|
3320
|
+
async getResequence({
|
|
3321
|
+
model,
|
|
3322
|
+
ids,
|
|
3323
|
+
context,
|
|
3324
|
+
offset
|
|
3325
|
+
}) {
|
|
3326
|
+
const env2 = getEnv();
|
|
3327
|
+
const jsonData = {
|
|
3346
3328
|
model,
|
|
3329
|
+
with_context: context,
|
|
3347
3330
|
ids,
|
|
3348
|
-
|
|
3349
|
-
offset
|
|
3350
|
-
}
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
ids,
|
|
3356
|
-
field: "sequence"
|
|
3357
|
-
}, offset > 0 ? { offset } : {});
|
|
3358
|
-
return env2 == null ? void 0 : env2.requests.post("/web/dataset/resequence", jsonData, {
|
|
3359
|
-
headers: {
|
|
3360
|
-
"Content-Type": "application/json"
|
|
3361
|
-
}
|
|
3362
|
-
});
|
|
3363
|
-
});
|
|
3364
|
-
},
|
|
3365
|
-
getSelectionItem(_0) {
|
|
3366
|
-
return __async(this, arguments, function* ({ data }) {
|
|
3367
|
-
var _a;
|
|
3368
|
-
const env2 = getEnv();
|
|
3369
|
-
const jsonData = {
|
|
3370
|
-
model: data.model,
|
|
3371
|
-
ids: [],
|
|
3372
|
-
method: "get_data_select",
|
|
3373
|
-
with_context: data.context,
|
|
3374
|
-
kwargs: {
|
|
3375
|
-
count_limit: 10001,
|
|
3376
|
-
domain: data.domain ? data.domain : [],
|
|
3377
|
-
offset: 0,
|
|
3378
|
-
order: "",
|
|
3379
|
-
specification: (_a = data == null ? void 0 : data.specification) != null ? _a : {
|
|
3380
|
-
id: {},
|
|
3381
|
-
name: {},
|
|
3382
|
-
display_name: {}
|
|
3383
|
-
}
|
|
3384
|
-
}
|
|
3385
|
-
};
|
|
3386
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3387
|
-
headers: {
|
|
3388
|
-
"Content-Type": "application/json"
|
|
3389
|
-
}
|
|
3390
|
-
});
|
|
3331
|
+
field: "sequence",
|
|
3332
|
+
...offset > 0 ? { offset } : {}
|
|
3333
|
+
};
|
|
3334
|
+
return env2?.requests.post("/web/dataset/resequence", jsonData, {
|
|
3335
|
+
headers: {
|
|
3336
|
+
"Content-Type": "application/json"
|
|
3337
|
+
}
|
|
3391
3338
|
});
|
|
3392
3339
|
},
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3340
|
+
async getSelectionItem({ data }) {
|
|
3341
|
+
const env2 = getEnv();
|
|
3342
|
+
const jsonData = {
|
|
3343
|
+
model: data.model,
|
|
3344
|
+
ids: [],
|
|
3345
|
+
method: "get_data_select",
|
|
3346
|
+
with_context: data.context,
|
|
3347
|
+
kwargs: {
|
|
3348
|
+
count_limit: 10001,
|
|
3349
|
+
domain: data.domain ? data.domain : [],
|
|
3350
|
+
offset: 0,
|
|
3351
|
+
order: "",
|
|
3352
|
+
specification: data?.specification ?? {
|
|
3353
|
+
id: {},
|
|
3354
|
+
name: {},
|
|
3355
|
+
display_name: {}
|
|
3403
3356
|
}
|
|
3404
|
-
|
|
3357
|
+
}
|
|
3358
|
+
};
|
|
3359
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3360
|
+
headers: {
|
|
3361
|
+
"Content-Type": "application/json"
|
|
3362
|
+
}
|
|
3405
3363
|
});
|
|
3406
3364
|
},
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3365
|
+
async loadMessages() {
|
|
3366
|
+
const env2 = getEnv();
|
|
3367
|
+
return env2.requests.post(
|
|
3368
|
+
"/load_message_failures" /* LOAD_MESSAGE */,
|
|
3369
|
+
{},
|
|
3370
|
+
{
|
|
3413
3371
|
headers: {
|
|
3414
3372
|
"Content-Type": "application/json"
|
|
3415
3373
|
}
|
|
3416
|
-
}
|
|
3374
|
+
}
|
|
3375
|
+
);
|
|
3376
|
+
},
|
|
3377
|
+
async getVersion() {
|
|
3378
|
+
const env2 = getEnv();
|
|
3379
|
+
return env2?.requests.get("", {
|
|
3380
|
+
headers: {
|
|
3381
|
+
"Content-Type": "application/json"
|
|
3382
|
+
}
|
|
3417
3383
|
});
|
|
3418
3384
|
},
|
|
3419
|
-
get2FAMethods(
|
|
3420
|
-
|
|
3385
|
+
async get2FAMethods({
|
|
3386
|
+
method,
|
|
3387
|
+
with_context
|
|
3388
|
+
}) {
|
|
3389
|
+
const env2 = getEnv();
|
|
3390
|
+
const jsonData = {
|
|
3421
3391
|
method,
|
|
3422
3392
|
with_context
|
|
3423
|
-
}
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
};
|
|
3429
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3430
|
-
headers: {
|
|
3431
|
-
"Content-Type": "application/json"
|
|
3432
|
-
}
|
|
3433
|
-
});
|
|
3393
|
+
};
|
|
3394
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3395
|
+
headers: {
|
|
3396
|
+
"Content-Type": "application/json"
|
|
3397
|
+
}
|
|
3434
3398
|
});
|
|
3435
3399
|
},
|
|
3436
|
-
verify2FA(
|
|
3437
|
-
|
|
3400
|
+
async verify2FA({
|
|
3401
|
+
method,
|
|
3402
|
+
with_context,
|
|
3403
|
+
code,
|
|
3404
|
+
device,
|
|
3405
|
+
location
|
|
3406
|
+
}) {
|
|
3407
|
+
const env2 = getEnv();
|
|
3408
|
+
const jsonData = {
|
|
3438
3409
|
method,
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
},
|
|
3454
|
-
with_context
|
|
3455
|
-
};
|
|
3456
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3457
|
-
headers: {
|
|
3458
|
-
"Content-Type": "application/json"
|
|
3459
|
-
},
|
|
3460
|
-
withCredentials: true
|
|
3461
|
-
});
|
|
3410
|
+
kwargs: {
|
|
3411
|
+
vals: {
|
|
3412
|
+
code,
|
|
3413
|
+
device,
|
|
3414
|
+
location
|
|
3415
|
+
}
|
|
3416
|
+
},
|
|
3417
|
+
with_context
|
|
3418
|
+
};
|
|
3419
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3420
|
+
headers: {
|
|
3421
|
+
"Content-Type": "application/json"
|
|
3422
|
+
},
|
|
3423
|
+
withCredentials: true
|
|
3462
3424
|
});
|
|
3463
3425
|
},
|
|
3464
|
-
signInSSO(
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3426
|
+
async signInSSO({
|
|
3427
|
+
redirect_uri,
|
|
3428
|
+
state,
|
|
3429
|
+
client_id,
|
|
3430
|
+
response_type,
|
|
3431
|
+
path
|
|
3432
|
+
}) {
|
|
3433
|
+
const env2 = getEnv();
|
|
3434
|
+
const params = new URLSearchParams({
|
|
3469
3435
|
response_type,
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
}
|
|
3479
|
-
|
|
3480
|
-
return env2 == null ? void 0 : env2.requests.get(url, {
|
|
3481
|
-
headers: {
|
|
3482
|
-
"Content-Type": "application/json"
|
|
3483
|
-
},
|
|
3484
|
-
withCredentials: true
|
|
3485
|
-
});
|
|
3436
|
+
client_id,
|
|
3437
|
+
redirect_uri,
|
|
3438
|
+
state
|
|
3439
|
+
});
|
|
3440
|
+
const url = `${path}?${params.toString()}`;
|
|
3441
|
+
return env2?.requests.get(url, {
|
|
3442
|
+
headers: {
|
|
3443
|
+
"Content-Type": "application/json"
|
|
3444
|
+
},
|
|
3445
|
+
withCredentials: true
|
|
3486
3446
|
});
|
|
3487
3447
|
},
|
|
3488
|
-
grantAccess(
|
|
3489
|
-
|
|
3448
|
+
async grantAccess({
|
|
3449
|
+
redirect_uri,
|
|
3450
|
+
state,
|
|
3451
|
+
client_id,
|
|
3452
|
+
scopes
|
|
3453
|
+
}) {
|
|
3454
|
+
const env2 = getEnv();
|
|
3455
|
+
const jsonData = {
|
|
3490
3456
|
redirect_uri,
|
|
3491
3457
|
state,
|
|
3492
3458
|
client_id,
|
|
3493
3459
|
scopes
|
|
3494
|
-
}
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
scopes
|
|
3501
|
-
};
|
|
3502
|
-
return env2 == null ? void 0 : env2.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
|
|
3503
|
-
headers: {
|
|
3504
|
-
"Content-Type": "application/json"
|
|
3505
|
-
},
|
|
3506
|
-
withCredentials: true
|
|
3507
|
-
});
|
|
3460
|
+
};
|
|
3461
|
+
return env2?.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
|
|
3462
|
+
headers: {
|
|
3463
|
+
"Content-Type": "application/json"
|
|
3464
|
+
},
|
|
3465
|
+
withCredentials: true
|
|
3508
3466
|
});
|
|
3509
3467
|
},
|
|
3510
|
-
getFieldsViewSecurity(
|
|
3511
|
-
|
|
3468
|
+
async getFieldsViewSecurity({
|
|
3469
|
+
method,
|
|
3470
|
+
token,
|
|
3471
|
+
views
|
|
3472
|
+
}) {
|
|
3473
|
+
const env2 = getEnv();
|
|
3474
|
+
const jsonData = {
|
|
3512
3475
|
method,
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
}
|
|
3525
|
-
};
|
|
3526
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3527
|
-
headers: {
|
|
3528
|
-
"Content-Type": "application/json"
|
|
3529
|
-
}
|
|
3530
|
-
});
|
|
3476
|
+
kwargs: {
|
|
3477
|
+
views
|
|
3478
|
+
},
|
|
3479
|
+
with_context: {
|
|
3480
|
+
token
|
|
3481
|
+
}
|
|
3482
|
+
};
|
|
3483
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3484
|
+
headers: {
|
|
3485
|
+
"Content-Type": "application/json"
|
|
3486
|
+
}
|
|
3531
3487
|
});
|
|
3532
3488
|
},
|
|
3533
|
-
settingsWebRead2fa(
|
|
3534
|
-
|
|
3489
|
+
async settingsWebRead2fa({
|
|
3490
|
+
method,
|
|
3491
|
+
model,
|
|
3492
|
+
kwargs,
|
|
3493
|
+
token
|
|
3494
|
+
}) {
|
|
3495
|
+
const env2 = getEnv();
|
|
3496
|
+
const jsonData = {
|
|
3535
3497
|
method,
|
|
3536
3498
|
model,
|
|
3537
3499
|
kwargs,
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
token
|
|
3547
|
-
}
|
|
3548
|
-
};
|
|
3549
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3550
|
-
headers: {
|
|
3551
|
-
"Content-Type": "application/json"
|
|
3552
|
-
}
|
|
3553
|
-
});
|
|
3500
|
+
with_context: {
|
|
3501
|
+
token
|
|
3502
|
+
}
|
|
3503
|
+
};
|
|
3504
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3505
|
+
headers: {
|
|
3506
|
+
"Content-Type": "application/json"
|
|
3507
|
+
}
|
|
3554
3508
|
});
|
|
3555
3509
|
},
|
|
3556
|
-
requestSetupTotp(
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
}
|
|
3569
|
-
});
|
|
3510
|
+
async requestSetupTotp({ method, token }) {
|
|
3511
|
+
const env2 = getEnv();
|
|
3512
|
+
const jsonData = {
|
|
3513
|
+
method,
|
|
3514
|
+
with_context: {
|
|
3515
|
+
token
|
|
3516
|
+
}
|
|
3517
|
+
};
|
|
3518
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3519
|
+
headers: {
|
|
3520
|
+
"Content-Type": "application/json"
|
|
3521
|
+
}
|
|
3570
3522
|
});
|
|
3571
3523
|
},
|
|
3572
|
-
verifyTotp(
|
|
3573
|
-
|
|
3524
|
+
async verifyTotp({
|
|
3525
|
+
method,
|
|
3526
|
+
action_token,
|
|
3527
|
+
code
|
|
3528
|
+
}) {
|
|
3529
|
+
const env2 = getEnv();
|
|
3530
|
+
const jsonData = {
|
|
3574
3531
|
method,
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
const env2 = getEnv();
|
|
3579
|
-
const jsonData = {
|
|
3580
|
-
method,
|
|
3581
|
-
kwargs: {
|
|
3582
|
-
vals: {
|
|
3583
|
-
code
|
|
3584
|
-
}
|
|
3585
|
-
},
|
|
3586
|
-
with_context: {
|
|
3587
|
-
action_token
|
|
3532
|
+
kwargs: {
|
|
3533
|
+
vals: {
|
|
3534
|
+
code
|
|
3588
3535
|
}
|
|
3589
|
-
}
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3536
|
+
},
|
|
3537
|
+
with_context: {
|
|
3538
|
+
action_token
|
|
3539
|
+
}
|
|
3540
|
+
};
|
|
3541
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3542
|
+
headers: {
|
|
3543
|
+
"Content-Type": "application/json"
|
|
3544
|
+
}
|
|
3595
3545
|
});
|
|
3596
3546
|
},
|
|
3597
|
-
removeTotpSetUp(
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
}
|
|
3610
|
-
});
|
|
3547
|
+
async removeTotpSetUp({ method, token }) {
|
|
3548
|
+
const env2 = getEnv();
|
|
3549
|
+
const jsonData = {
|
|
3550
|
+
method,
|
|
3551
|
+
with_context: {
|
|
3552
|
+
token
|
|
3553
|
+
}
|
|
3554
|
+
};
|
|
3555
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3556
|
+
headers: {
|
|
3557
|
+
"Content-Type": "application/json"
|
|
3558
|
+
}
|
|
3611
3559
|
});
|
|
3612
3560
|
}
|
|
3613
3561
|
};
|
|
@@ -3623,18 +3571,17 @@ var VersionGate = ({ children }) => {
|
|
|
3623
3571
|
queryClient.clear();
|
|
3624
3572
|
localStorage.removeItem("__api_version__");
|
|
3625
3573
|
};
|
|
3626
|
-
const validateVersion = () =>
|
|
3627
|
-
const serverVersion =
|
|
3628
|
-
console.log("serverVersion", serverVersion);
|
|
3574
|
+
const validateVersion = async () => {
|
|
3575
|
+
const serverVersion = await view_service_default.getVersion();
|
|
3629
3576
|
const cached = localStorage.getItem("__api_version__");
|
|
3630
|
-
if (cached !==
|
|
3577
|
+
if (cached !== serverVersion?.api_version) {
|
|
3631
3578
|
clearVersion();
|
|
3632
|
-
localStorage.setItem("__api_version__", serverVersion
|
|
3579
|
+
localStorage.setItem("__api_version__", serverVersion?.api_version);
|
|
3633
3580
|
} else {
|
|
3634
|
-
console.log("Api version:", serverVersion
|
|
3581
|
+
console.log("Api version:", serverVersion?.api_version);
|
|
3635
3582
|
}
|
|
3636
3583
|
setReady(true);
|
|
3637
|
-
}
|
|
3584
|
+
};
|
|
3638
3585
|
validateVersion();
|
|
3639
3586
|
if (typeof window !== "undefined") {
|
|
3640
3587
|
const onKey = (e) => {
|