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