@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/environment.mjs
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __pow = Math.pow;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
+
var __async = (__this, __arguments, generator) => {
|
|
22
|
+
return new Promise((resolve, reject) => {
|
|
23
|
+
var fulfilled = (value) => {
|
|
24
|
+
try {
|
|
25
|
+
step(generator.next(value));
|
|
26
|
+
} catch (e) {
|
|
27
|
+
reject(e);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
var rejected = (value) => {
|
|
31
|
+
try {
|
|
32
|
+
step(generator.throw(value));
|
|
33
|
+
} catch (e) {
|
|
34
|
+
reject(e);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
38
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
|
|
1
42
|
// src/configs/axios-client.ts
|
|
2
43
|
import axios from "axios";
|
|
3
44
|
|
|
@@ -1082,22 +1123,6 @@ var PyRelativeDelta = class _PyRelativeDelta {
|
|
|
1082
1123
|
this.microsecond = params.microsecond;
|
|
1083
1124
|
this.weekday = params.weekday;
|
|
1084
1125
|
}
|
|
1085
|
-
years;
|
|
1086
|
-
months;
|
|
1087
|
-
days;
|
|
1088
|
-
hours;
|
|
1089
|
-
minutes;
|
|
1090
|
-
seconds;
|
|
1091
|
-
microseconds;
|
|
1092
|
-
leapDays;
|
|
1093
|
-
year;
|
|
1094
|
-
month;
|
|
1095
|
-
day;
|
|
1096
|
-
hour;
|
|
1097
|
-
minute;
|
|
1098
|
-
second;
|
|
1099
|
-
microsecond;
|
|
1100
|
-
weekday;
|
|
1101
1126
|
negate() {
|
|
1102
1127
|
return new _PyRelativeDelta(this, -1);
|
|
1103
1128
|
}
|
|
@@ -1212,7 +1237,7 @@ function execOnIterable(iterable, func) {
|
|
|
1212
1237
|
if (typeof iterable === "object" && !Array.isArray(iterable) && !(iterable instanceof Set)) {
|
|
1213
1238
|
iterable = Object.keys(iterable);
|
|
1214
1239
|
}
|
|
1215
|
-
if (typeof iterable
|
|
1240
|
+
if (typeof (iterable == null ? void 0 : iterable[Symbol.iterator]) !== "function") {
|
|
1216
1241
|
throw new EvaluationError("value not iterable");
|
|
1217
1242
|
}
|
|
1218
1243
|
return func(iterable);
|
|
@@ -1535,7 +1560,7 @@ function applyBinaryOp(ast, context) {
|
|
|
1535
1560
|
}
|
|
1536
1561
|
return Math.floor(left / right);
|
|
1537
1562
|
case "**":
|
|
1538
|
-
return left
|
|
1563
|
+
return __pow(left, right);
|
|
1539
1564
|
case "==":
|
|
1540
1565
|
return isEqual(left, right);
|
|
1541
1566
|
case "<>":
|
|
@@ -1657,7 +1682,7 @@ function evaluate(ast, context = {}) {
|
|
|
1657
1682
|
const dicts = /* @__PURE__ */ new Set();
|
|
1658
1683
|
let pyContext;
|
|
1659
1684
|
const evalContext = Object.create(context);
|
|
1660
|
-
if (!evalContext
|
|
1685
|
+
if (!(evalContext == null ? void 0 : evalContext.context)) {
|
|
1661
1686
|
Object.defineProperty(evalContext, "context", {
|
|
1662
1687
|
get() {
|
|
1663
1688
|
if (!pyContext) {
|
|
@@ -1668,17 +1693,18 @@ function evaluate(ast, context = {}) {
|
|
|
1668
1693
|
});
|
|
1669
1694
|
}
|
|
1670
1695
|
function _innerEvaluate(ast2) {
|
|
1671
|
-
|
|
1696
|
+
var _a, _b, _c;
|
|
1697
|
+
switch (ast2 == null ? void 0 : ast2.type) {
|
|
1672
1698
|
case 0:
|
|
1673
1699
|
// Number
|
|
1674
1700
|
case 1:
|
|
1675
1701
|
return ast2.value;
|
|
1676
1702
|
case 5:
|
|
1677
1703
|
if (ast2.value in evalContext) {
|
|
1678
|
-
if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]
|
|
1679
|
-
return evalContext[ast2.value]
|
|
1704
|
+
if (typeof evalContext[ast2.value] === "object" && ((_a = evalContext[ast2.value]) == null ? void 0 : _a.id)) {
|
|
1705
|
+
return (_b = evalContext[ast2.value]) == null ? void 0 : _b.id;
|
|
1680
1706
|
}
|
|
1681
|
-
return evalContext[ast2.value]
|
|
1707
|
+
return (_c = evalContext[ast2.value]) != null ? _c : false;
|
|
1682
1708
|
} else if (ast2.value in BUILTINS) {
|
|
1683
1709
|
return BUILTINS[ast2.value];
|
|
1684
1710
|
} else {
|
|
@@ -1715,7 +1741,7 @@ function evaluate(ast, context = {}) {
|
|
|
1715
1741
|
const args = ast2.args.map(_evaluate);
|
|
1716
1742
|
const kwargs = {};
|
|
1717
1743
|
for (const kwarg in ast2.kwargs) {
|
|
1718
|
-
kwargs[kwarg] = _evaluate(ast2
|
|
1744
|
+
kwargs[kwarg] = _evaluate(ast2 == null ? void 0 : ast2.kwargs[kwarg]);
|
|
1719
1745
|
}
|
|
1720
1746
|
if (fnValue === PyDate || fnValue === PyDateTime || fnValue === PyTime || fnValue === PyRelativeDelta || fnValue === PyTimeDelta) {
|
|
1721
1747
|
return fnValue.create(...args, kwargs);
|
|
@@ -1794,9 +1820,25 @@ function escapeRegExp(str) {
|
|
|
1794
1820
|
var InvalidDomainError = class extends Error {
|
|
1795
1821
|
};
|
|
1796
1822
|
var Domain = class _Domain {
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1823
|
+
constructor(descr = []) {
|
|
1824
|
+
this.ast = { type: -1, value: null };
|
|
1825
|
+
if (descr instanceof _Domain) {
|
|
1826
|
+
return new _Domain(descr.toString());
|
|
1827
|
+
} else {
|
|
1828
|
+
let rawAST;
|
|
1829
|
+
try {
|
|
1830
|
+
rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
|
|
1831
|
+
} catch (error) {
|
|
1832
|
+
throw new InvalidDomainError(
|
|
1833
|
+
`Invalid domain representation: ${descr}`,
|
|
1834
|
+
{
|
|
1835
|
+
cause: error
|
|
1836
|
+
}
|
|
1837
|
+
);
|
|
1838
|
+
}
|
|
1839
|
+
this.ast = normalizeDomainAST(rawAST);
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1800
1842
|
static combine(domains, operator) {
|
|
1801
1843
|
if (domains.length === 0) {
|
|
1802
1844
|
return new _Domain([]);
|
|
@@ -1875,24 +1917,6 @@ var Domain = class _Domain {
|
|
|
1875
1917
|
processLeaf(d.ast.value, 0, "&", newDomain);
|
|
1876
1918
|
return newDomain;
|
|
1877
1919
|
}
|
|
1878
|
-
constructor(descr = []) {
|
|
1879
|
-
if (descr instanceof _Domain) {
|
|
1880
|
-
return new _Domain(descr.toString());
|
|
1881
|
-
} else {
|
|
1882
|
-
let rawAST;
|
|
1883
|
-
try {
|
|
1884
|
-
rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
|
|
1885
|
-
} catch (error) {
|
|
1886
|
-
throw new InvalidDomainError(
|
|
1887
|
-
`Invalid domain representation: ${descr}`,
|
|
1888
|
-
{
|
|
1889
|
-
cause: error
|
|
1890
|
-
}
|
|
1891
|
-
);
|
|
1892
|
-
}
|
|
1893
|
-
this.ast = normalizeDomainAST(rawAST);
|
|
1894
|
-
}
|
|
1895
|
-
}
|
|
1896
1920
|
contains(record) {
|
|
1897
1921
|
const expr = evaluate(this.ast, record);
|
|
1898
1922
|
return matchDomain(record, expr);
|
|
@@ -1911,7 +1935,7 @@ var Domain = class _Domain {
|
|
|
1911
1935
|
return evaluatedAsList;
|
|
1912
1936
|
}
|
|
1913
1937
|
return this.toString();
|
|
1914
|
-
} catch {
|
|
1938
|
+
} catch (e) {
|
|
1915
1939
|
return this.toString();
|
|
1916
1940
|
}
|
|
1917
1941
|
}
|
|
@@ -2134,22 +2158,22 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
|
|
|
2134
2158
|
|
|
2135
2159
|
// src/utils/storage/local-storage.ts
|
|
2136
2160
|
var localStorageUtils = () => {
|
|
2137
|
-
const setToken =
|
|
2161
|
+
const setToken = (access_token) => __async(null, null, function* () {
|
|
2138
2162
|
localStorage.setItem("accessToken", access_token);
|
|
2139
|
-
};
|
|
2140
|
-
const setRefreshToken =
|
|
2163
|
+
});
|
|
2164
|
+
const setRefreshToken = (refresh_token) => __async(null, null, function* () {
|
|
2141
2165
|
localStorage.setItem("refreshToken", refresh_token);
|
|
2142
|
-
};
|
|
2143
|
-
const getAccessToken =
|
|
2166
|
+
});
|
|
2167
|
+
const getAccessToken = () => __async(null, null, function* () {
|
|
2144
2168
|
return localStorage.getItem("accessToken");
|
|
2145
|
-
};
|
|
2146
|
-
const getRefreshToken =
|
|
2169
|
+
});
|
|
2170
|
+
const getRefreshToken = () => __async(null, null, function* () {
|
|
2147
2171
|
return localStorage.getItem("refreshToken");
|
|
2148
|
-
};
|
|
2149
|
-
const clearToken =
|
|
2172
|
+
});
|
|
2173
|
+
const clearToken = () => __async(null, null, function* () {
|
|
2150
2174
|
localStorage.removeItem("accessToken");
|
|
2151
2175
|
localStorage.removeItem("refreshToken");
|
|
2152
|
-
};
|
|
2176
|
+
});
|
|
2153
2177
|
return {
|
|
2154
2178
|
setToken,
|
|
2155
2179
|
setRefreshToken,
|
|
@@ -2161,9 +2185,9 @@ var localStorageUtils = () => {
|
|
|
2161
2185
|
|
|
2162
2186
|
// src/utils/storage/session-storage.ts
|
|
2163
2187
|
var sessionStorageUtils = () => {
|
|
2164
|
-
const getBrowserSession =
|
|
2188
|
+
const getBrowserSession = () => __async(null, null, function* () {
|
|
2165
2189
|
return sessionStorage.getItem("browserSession");
|
|
2166
|
-
};
|
|
2190
|
+
});
|
|
2167
2191
|
return {
|
|
2168
2192
|
getBrowserSession
|
|
2169
2193
|
};
|
|
@@ -2172,13 +2196,14 @@ var sessionStorageUtils = () => {
|
|
|
2172
2196
|
// src/configs/axios-client.ts
|
|
2173
2197
|
var axiosClient = {
|
|
2174
2198
|
init(config) {
|
|
2175
|
-
|
|
2176
|
-
const
|
|
2199
|
+
var _a, _b;
|
|
2200
|
+
const localStorage2 = (_a = config.localStorageUtils) != null ? _a : localStorageUtils();
|
|
2201
|
+
const sessionStorage2 = (_b = config.sessionStorageUtils) != null ? _b : sessionStorageUtils();
|
|
2177
2202
|
const db = config.db;
|
|
2178
2203
|
let isRefreshing = false;
|
|
2179
2204
|
let failedQueue = [];
|
|
2180
2205
|
const processQueue = (error, token = null) => {
|
|
2181
|
-
failedQueue
|
|
2206
|
+
failedQueue == null ? void 0 : failedQueue.forEach((prom) => {
|
|
2182
2207
|
if (error) {
|
|
2183
2208
|
prom.reject(error);
|
|
2184
2209
|
} else {
|
|
@@ -2194,14 +2219,14 @@ var axiosClient = {
|
|
|
2194
2219
|
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
2195
2220
|
});
|
|
2196
2221
|
instance.interceptors.request.use(
|
|
2197
|
-
|
|
2222
|
+
(config2) => __async(null, null, function* () {
|
|
2198
2223
|
const useRefreshToken = config2.useRefreshToken;
|
|
2199
|
-
const token = useRefreshToken ?
|
|
2224
|
+
const token = useRefreshToken ? yield localStorage2.getRefreshToken() : yield localStorage2.getAccessToken();
|
|
2200
2225
|
if (token) {
|
|
2201
2226
|
config2.headers["Authorization"] = "Bearer " + token;
|
|
2202
2227
|
}
|
|
2203
2228
|
return config2;
|
|
2204
|
-
},
|
|
2229
|
+
}),
|
|
2205
2230
|
(error) => {
|
|
2206
2231
|
Promise.reject(error);
|
|
2207
2232
|
}
|
|
@@ -2210,19 +2235,21 @@ var axiosClient = {
|
|
|
2210
2235
|
(response) => {
|
|
2211
2236
|
return handleResponse(response);
|
|
2212
2237
|
},
|
|
2213
|
-
|
|
2214
|
-
|
|
2238
|
+
(error) => __async(null, null, function* () {
|
|
2239
|
+
var _a2, _b2, _c;
|
|
2240
|
+
const handleError3 = (error2) => __async(null, null, function* () {
|
|
2241
|
+
var _a3;
|
|
2215
2242
|
if (!error2.response) {
|
|
2216
2243
|
return error2;
|
|
2217
2244
|
}
|
|
2218
2245
|
const { data } = error2.response;
|
|
2219
|
-
if (data && data.code === 400 && ["invalid_grant"].includes(data.data
|
|
2220
|
-
|
|
2246
|
+
if (data && data.code === 400 && ["invalid_grant"].includes((_a3 = data.data) == null ? void 0 : _a3.error)) {
|
|
2247
|
+
yield clearAuthToken();
|
|
2221
2248
|
}
|
|
2222
2249
|
return data;
|
|
2223
|
-
};
|
|
2250
|
+
});
|
|
2224
2251
|
const originalRequest = error.config;
|
|
2225
|
-
if ((error.response
|
|
2252
|
+
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(
|
|
2226
2253
|
error.response.data.code
|
|
2227
2254
|
)) {
|
|
2228
2255
|
if (isRefreshing) {
|
|
@@ -2235,18 +2262,19 @@ var axiosClient = {
|
|
|
2235
2262
|
token
|
|
2236
2263
|
);
|
|
2237
2264
|
return instance.request(originalRequest);
|
|
2238
|
-
}).catch(
|
|
2239
|
-
|
|
2240
|
-
|
|
2265
|
+
}).catch((err) => __async(null, null, function* () {
|
|
2266
|
+
var _a3, _b3;
|
|
2267
|
+
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)) {
|
|
2268
|
+
yield clearAuthToken();
|
|
2241
2269
|
}
|
|
2242
|
-
});
|
|
2270
|
+
}));
|
|
2243
2271
|
}
|
|
2244
|
-
const browserSession =
|
|
2245
|
-
const refreshToken =
|
|
2246
|
-
const accessTokenExp =
|
|
2272
|
+
const browserSession = yield sessionStorage2.getBrowserSession();
|
|
2273
|
+
const refreshToken = yield localStorage2.getRefreshToken();
|
|
2274
|
+
const accessTokenExp = yield localStorage2.getAccessToken();
|
|
2247
2275
|
isRefreshing = true;
|
|
2248
2276
|
if (!refreshToken && (!browserSession || browserSession == "unActive")) {
|
|
2249
|
-
|
|
2277
|
+
yield clearAuthToken();
|
|
2250
2278
|
} else {
|
|
2251
2279
|
const payload = Object.fromEntries(
|
|
2252
2280
|
Object.entries({
|
|
@@ -2257,8 +2285,9 @@ var axiosClient = {
|
|
|
2257
2285
|
}).filter(([_, value]) => !!value)
|
|
2258
2286
|
);
|
|
2259
2287
|
return new Promise(function(resolve) {
|
|
2288
|
+
var _a3;
|
|
2260
2289
|
axios.post(
|
|
2261
|
-
`${config.baseUrl}${config.refreshTokenEndpoint
|
|
2290
|
+
`${config.baseUrl}${(_a3 = config.refreshTokenEndpoint) != null ? _a3 : "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
|
|
2262
2291
|
payload,
|
|
2263
2292
|
{
|
|
2264
2293
|
headers: {
|
|
@@ -2266,10 +2295,10 @@ var axiosClient = {
|
|
|
2266
2295
|
Authorization: `Bearer ${accessTokenExp}`
|
|
2267
2296
|
}
|
|
2268
2297
|
}
|
|
2269
|
-
).then(
|
|
2298
|
+
).then((res) => __async(null, null, function* () {
|
|
2270
2299
|
const data = res.data;
|
|
2271
|
-
|
|
2272
|
-
|
|
2300
|
+
yield localStorage2.setToken(data.access_token);
|
|
2301
|
+
yield localStorage2.setRefreshToken(data.refresh_token);
|
|
2273
2302
|
axios.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
|
|
2274
2303
|
originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
|
|
2275
2304
|
originalRequest.data = updateTokenParamInOriginalRequest(
|
|
@@ -2278,25 +2307,26 @@ var axiosClient = {
|
|
|
2278
2307
|
);
|
|
2279
2308
|
processQueue(null, data.access_token);
|
|
2280
2309
|
resolve(instance.request(originalRequest));
|
|
2281
|
-
}).catch(
|
|
2282
|
-
|
|
2283
|
-
|
|
2310
|
+
})).catch((err) => __async(null, null, function* () {
|
|
2311
|
+
var _a4;
|
|
2312
|
+
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") {
|
|
2313
|
+
yield clearAuthToken();
|
|
2284
2314
|
}
|
|
2285
2315
|
if (err && err.response) {
|
|
2286
|
-
const { error_code } = err.response
|
|
2316
|
+
const { error_code } = ((_a4 = err.response) == null ? void 0 : _a4.data) || {};
|
|
2287
2317
|
if (error_code === "AUTHEN_FAIL") {
|
|
2288
|
-
|
|
2318
|
+
yield clearAuthToken();
|
|
2289
2319
|
}
|
|
2290
2320
|
}
|
|
2291
2321
|
processQueue(err, null);
|
|
2292
|
-
}).finally(() => {
|
|
2322
|
+
})).finally(() => {
|
|
2293
2323
|
isRefreshing = false;
|
|
2294
2324
|
});
|
|
2295
2325
|
});
|
|
2296
2326
|
}
|
|
2297
2327
|
}
|
|
2298
|
-
return Promise.reject(
|
|
2299
|
-
}
|
|
2328
|
+
return Promise.reject(yield handleError3(error));
|
|
2329
|
+
})
|
|
2300
2330
|
);
|
|
2301
2331
|
const handleResponse = (res) => {
|
|
2302
2332
|
if (res && res.data) {
|
|
@@ -2305,6 +2335,7 @@ var axiosClient = {
|
|
|
2305
2335
|
return res;
|
|
2306
2336
|
};
|
|
2307
2337
|
const handleError2 = (error) => {
|
|
2338
|
+
var _a2, _b2, _c;
|
|
2308
2339
|
if (error.isAxiosError && error.code === "ECONNABORTED") {
|
|
2309
2340
|
console.error("Request Timeout Error:", error);
|
|
2310
2341
|
return "Request Timeout Error";
|
|
@@ -2312,17 +2343,17 @@ var axiosClient = {
|
|
|
2312
2343
|
console.error("Network Error:", error);
|
|
2313
2344
|
return "Network Error";
|
|
2314
2345
|
} else {
|
|
2315
|
-
console.error("Other Error:", error
|
|
2316
|
-
const errorMessage = error
|
|
2317
|
-
return { message: errorMessage, status: error
|
|
2346
|
+
console.error("Other Error:", error == null ? void 0 : error.response);
|
|
2347
|
+
const errorMessage = ((_b2 = (_a2 = error == null ? void 0 : error.response) == null ? void 0 : _a2.data) == null ? void 0 : _b2.message) || "An error occurred";
|
|
2348
|
+
return { message: errorMessage, status: (_c = error == null ? void 0 : error.response) == null ? void 0 : _c.status };
|
|
2318
2349
|
}
|
|
2319
2350
|
};
|
|
2320
|
-
const clearAuthToken =
|
|
2321
|
-
|
|
2351
|
+
const clearAuthToken = () => __async(null, null, function* () {
|
|
2352
|
+
yield localStorage2.clearToken();
|
|
2322
2353
|
if (typeof window !== "undefined") {
|
|
2323
2354
|
window.location.href = `/login`;
|
|
2324
2355
|
}
|
|
2325
|
-
};
|
|
2356
|
+
});
|
|
2326
2357
|
function formatUrl(url, db2) {
|
|
2327
2358
|
return url + (db2 ? "?db=" + db2 : "");
|
|
2328
2359
|
}
|
|
@@ -2535,7 +2566,7 @@ var headerSlice = createSlice5({
|
|
|
2535
2566
|
},
|
|
2536
2567
|
reducers: {
|
|
2537
2568
|
setHeader: (state, action) => {
|
|
2538
|
-
state.value = {
|
|
2569
|
+
state.value = __spreadValues(__spreadValues({}, state.value), action.payload);
|
|
2539
2570
|
},
|
|
2540
2571
|
setAllowedCompanyIds: (state, action) => {
|
|
2541
2572
|
state.value.allowedCompanyIds = action.payload;
|
|
@@ -2961,18 +2992,6 @@ var envStore = configureStore({
|
|
|
2961
2992
|
|
|
2962
2993
|
// src/environment/EnvStore.ts
|
|
2963
2994
|
var EnvStore = class {
|
|
2964
|
-
envStore;
|
|
2965
|
-
baseUrl;
|
|
2966
|
-
requests;
|
|
2967
|
-
context;
|
|
2968
|
-
defaultCompany;
|
|
2969
|
-
config;
|
|
2970
|
-
companies;
|
|
2971
|
-
user;
|
|
2972
|
-
db;
|
|
2973
|
-
localStorageUtils;
|
|
2974
|
-
sessionStorageUtils;
|
|
2975
|
-
refreshTokenEndpoint;
|
|
2976
2995
|
constructor(envStore2, localStorageUtils2, sessionStorageUtils2) {
|
|
2977
2996
|
this.envStore = envStore2;
|
|
2978
2997
|
this.localStorageUtils = localStorageUtils2;
|
|
@@ -2981,25 +3000,24 @@ var EnvStore = class {
|
|
|
2981
3000
|
}
|
|
2982
3001
|
setup() {
|
|
2983
3002
|
const env2 = this.envStore.getState().env;
|
|
2984
|
-
this.baseUrl = env2
|
|
2985
|
-
this.requests = env2
|
|
2986
|
-
this.context = env2
|
|
2987
|
-
this.defaultCompany = env2
|
|
2988
|
-
this.config = env2
|
|
2989
|
-
this.companies = env2
|
|
2990
|
-
this.user = env2
|
|
2991
|
-
this.db = env2
|
|
2992
|
-
this.refreshTokenEndpoint = env2
|
|
3003
|
+
this.baseUrl = env2 == null ? void 0 : env2.baseUrl;
|
|
3004
|
+
this.requests = env2 == null ? void 0 : env2.requests;
|
|
3005
|
+
this.context = env2 == null ? void 0 : env2.context;
|
|
3006
|
+
this.defaultCompany = env2 == null ? void 0 : env2.defaultCompany;
|
|
3007
|
+
this.config = env2 == null ? void 0 : env2.config;
|
|
3008
|
+
this.companies = (env2 == null ? void 0 : env2.companies) || [];
|
|
3009
|
+
this.user = env2 == null ? void 0 : env2.user;
|
|
3010
|
+
this.db = env2 == null ? void 0 : env2.db;
|
|
3011
|
+
this.refreshTokenEndpoint = env2 == null ? void 0 : env2.refreshTokenEndpoint;
|
|
2993
3012
|
}
|
|
2994
3013
|
setupEnv(envConfig) {
|
|
2995
3014
|
const dispatch = this.envStore.dispatch;
|
|
2996
|
-
const env2 = {
|
|
2997
|
-
...envConfig,
|
|
3015
|
+
const env2 = __spreadProps(__spreadValues({}, envConfig), {
|
|
2998
3016
|
localStorageUtils: this.localStorageUtils,
|
|
2999
3017
|
sessionStorageUtils: this.sessionStorageUtils
|
|
3000
|
-
};
|
|
3018
|
+
});
|
|
3001
3019
|
const requests = axiosClient.init(env2);
|
|
3002
|
-
dispatch(setEnv({
|
|
3020
|
+
dispatch(setEnv(__spreadProps(__spreadValues({}, env2), { requests })));
|
|
3003
3021
|
this.setup();
|
|
3004
3022
|
}
|
|
3005
3023
|
setUid(uid) {
|