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