@fctc/interface-logic 1.5.3 → 1.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/configs.js +96 -107
- package/dist/configs.mjs +96 -108
- package/dist/environment.js +122 -137
- package/dist/environment.mjs +122 -140
- package/dist/hooks.js +1396 -1559
- package/dist/hooks.mjs +1396 -1562
- package/dist/provider.d.mts +3 -4
- package/dist/provider.d.ts +3 -4
- package/dist/provider.js +509 -562
- package/dist/provider.mjs +509 -565
- package/dist/services.js +1359 -1524
- package/dist/services.mjs +1355 -1523
- package/dist/store.js +5 -19
- package/dist/store.mjs +5 -22
- package/dist/utils.js +94 -116
- package/dist/utils.mjs +94 -119
- package/package.json +11 -22
package/dist/hooks.js
CHANGED
|
@@ -1,28 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
|
-
var __defProps = Object.defineProperties;
|
|
5
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
10
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
-
var __pow = Math.pow;
|
|
13
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
14
|
-
var __spreadValues = (a, b) => {
|
|
15
|
-
for (var prop in b || (b = {}))
|
|
16
|
-
if (__hasOwnProp.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
if (__getOwnPropSymbols)
|
|
19
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
20
|
-
if (__propIsEnum.call(b, prop))
|
|
21
|
-
__defNormalProp(a, prop, b[prop]);
|
|
22
|
-
}
|
|
23
|
-
return a;
|
|
24
|
-
};
|
|
25
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
26
8
|
var __export = (target, all) => {
|
|
27
9
|
for (var name in all)
|
|
28
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -44,26 +26,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
44
26
|
mod
|
|
45
27
|
));
|
|
46
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
47
|
-
var __async = (__this, __arguments, generator) => {
|
|
48
|
-
return new Promise((resolve, reject) => {
|
|
49
|
-
var fulfilled = (value) => {
|
|
50
|
-
try {
|
|
51
|
-
step(generator.next(value));
|
|
52
|
-
} catch (e) {
|
|
53
|
-
reject(e);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
var rejected = (value) => {
|
|
57
|
-
try {
|
|
58
|
-
step(generator.throw(value));
|
|
59
|
-
} catch (e) {
|
|
60
|
-
reject(e);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
64
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
29
|
|
|
68
30
|
// src/hooks.ts
|
|
69
31
|
var hooks_exports = {};
|
|
@@ -1263,6 +1225,22 @@ var PyRelativeDelta = class _PyRelativeDelta {
|
|
|
1263
1225
|
this.microsecond = params.microsecond;
|
|
1264
1226
|
this.weekday = params.weekday;
|
|
1265
1227
|
}
|
|
1228
|
+
years;
|
|
1229
|
+
months;
|
|
1230
|
+
days;
|
|
1231
|
+
hours;
|
|
1232
|
+
minutes;
|
|
1233
|
+
seconds;
|
|
1234
|
+
microseconds;
|
|
1235
|
+
leapDays;
|
|
1236
|
+
year;
|
|
1237
|
+
month;
|
|
1238
|
+
day;
|
|
1239
|
+
hour;
|
|
1240
|
+
minute;
|
|
1241
|
+
second;
|
|
1242
|
+
microsecond;
|
|
1243
|
+
weekday;
|
|
1266
1244
|
negate() {
|
|
1267
1245
|
return new _PyRelativeDelta(this, -1);
|
|
1268
1246
|
}
|
|
@@ -1377,7 +1355,7 @@ function execOnIterable(iterable, func) {
|
|
|
1377
1355
|
if (typeof iterable === "object" && !Array.isArray(iterable) && !(iterable instanceof Set)) {
|
|
1378
1356
|
iterable = Object.keys(iterable);
|
|
1379
1357
|
}
|
|
1380
|
-
if (typeof
|
|
1358
|
+
if (typeof iterable?.[Symbol.iterator] !== "function") {
|
|
1381
1359
|
throw new EvaluationError("value not iterable");
|
|
1382
1360
|
}
|
|
1383
1361
|
return func(iterable);
|
|
@@ -1700,7 +1678,7 @@ function applyBinaryOp(ast, context) {
|
|
|
1700
1678
|
}
|
|
1701
1679
|
return Math.floor(left / right);
|
|
1702
1680
|
case "**":
|
|
1703
|
-
return
|
|
1681
|
+
return left ** right;
|
|
1704
1682
|
case "==":
|
|
1705
1683
|
return isEqual(left, right);
|
|
1706
1684
|
case "<>":
|
|
@@ -1822,7 +1800,7 @@ function evaluate(ast, context = {}) {
|
|
|
1822
1800
|
const dicts = /* @__PURE__ */ new Set();
|
|
1823
1801
|
let pyContext;
|
|
1824
1802
|
const evalContext = Object.create(context);
|
|
1825
|
-
if (!
|
|
1803
|
+
if (!evalContext?.context) {
|
|
1826
1804
|
Object.defineProperty(evalContext, "context", {
|
|
1827
1805
|
get() {
|
|
1828
1806
|
if (!pyContext) {
|
|
@@ -1833,18 +1811,17 @@ function evaluate(ast, context = {}) {
|
|
|
1833
1811
|
});
|
|
1834
1812
|
}
|
|
1835
1813
|
function _innerEvaluate(ast2) {
|
|
1836
|
-
|
|
1837
|
-
switch (ast2 == null ? void 0 : ast2.type) {
|
|
1814
|
+
switch (ast2?.type) {
|
|
1838
1815
|
case 0:
|
|
1839
1816
|
// Number
|
|
1840
1817
|
case 1:
|
|
1841
1818
|
return ast2.value;
|
|
1842
1819
|
case 5:
|
|
1843
1820
|
if (ast2.value in evalContext) {
|
|
1844
|
-
if (typeof evalContext[ast2.value] === "object" &&
|
|
1845
|
-
return
|
|
1821
|
+
if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
|
|
1822
|
+
return evalContext[ast2.value]?.id;
|
|
1846
1823
|
}
|
|
1847
|
-
return
|
|
1824
|
+
return evalContext[ast2.value] ?? false;
|
|
1848
1825
|
} else if (ast2.value in BUILTINS) {
|
|
1849
1826
|
return BUILTINS[ast2.value];
|
|
1850
1827
|
} else {
|
|
@@ -1881,7 +1858,7 @@ function evaluate(ast, context = {}) {
|
|
|
1881
1858
|
const args = ast2.args.map(_evaluate);
|
|
1882
1859
|
const kwargs = {};
|
|
1883
1860
|
for (const kwarg in ast2.kwargs) {
|
|
1884
|
-
kwargs[kwarg] = _evaluate(ast2
|
|
1861
|
+
kwargs[kwarg] = _evaluate(ast2?.kwargs[kwarg]);
|
|
1885
1862
|
}
|
|
1886
1863
|
if (fnValue === PyDate || fnValue === PyDateTime || fnValue === PyTime || fnValue === PyRelativeDelta || fnValue === PyTimeDelta) {
|
|
1887
1864
|
return fnValue.create(...args, kwargs);
|
|
@@ -1960,25 +1937,9 @@ function escapeRegExp(str) {
|
|
|
1960
1937
|
var InvalidDomainError = class extends Error {
|
|
1961
1938
|
};
|
|
1962
1939
|
var Domain = class _Domain {
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
return new _Domain(descr.toString());
|
|
1967
|
-
} else {
|
|
1968
|
-
let rawAST;
|
|
1969
|
-
try {
|
|
1970
|
-
rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
|
|
1971
|
-
} catch (error) {
|
|
1972
|
-
throw new InvalidDomainError(
|
|
1973
|
-
`Invalid domain representation: ${descr}`,
|
|
1974
|
-
{
|
|
1975
|
-
cause: error
|
|
1976
|
-
}
|
|
1977
|
-
);
|
|
1978
|
-
}
|
|
1979
|
-
this.ast = normalizeDomainAST(rawAST);
|
|
1980
|
-
}
|
|
1981
|
-
}
|
|
1940
|
+
ast = { type: -1, value: null };
|
|
1941
|
+
static TRUE;
|
|
1942
|
+
static FALSE;
|
|
1982
1943
|
static combine(domains, operator) {
|
|
1983
1944
|
if (domains.length === 0) {
|
|
1984
1945
|
return new _Domain([]);
|
|
@@ -2057,6 +2018,24 @@ var Domain = class _Domain {
|
|
|
2057
2018
|
processLeaf(d.ast.value, 0, "&", newDomain);
|
|
2058
2019
|
return newDomain;
|
|
2059
2020
|
}
|
|
2021
|
+
constructor(descr = []) {
|
|
2022
|
+
if (descr instanceof _Domain) {
|
|
2023
|
+
return new _Domain(descr.toString());
|
|
2024
|
+
} else {
|
|
2025
|
+
let rawAST;
|
|
2026
|
+
try {
|
|
2027
|
+
rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
|
|
2028
|
+
} catch (error) {
|
|
2029
|
+
throw new InvalidDomainError(
|
|
2030
|
+
`Invalid domain representation: ${descr}`,
|
|
2031
|
+
{
|
|
2032
|
+
cause: error
|
|
2033
|
+
}
|
|
2034
|
+
);
|
|
2035
|
+
}
|
|
2036
|
+
this.ast = normalizeDomainAST(rawAST);
|
|
2037
|
+
}
|
|
2038
|
+
}
|
|
2060
2039
|
contains(record) {
|
|
2061
2040
|
const expr = evaluate(this.ast, record);
|
|
2062
2041
|
return matchDomain(record, expr);
|
|
@@ -2075,7 +2054,7 @@ var Domain = class _Domain {
|
|
|
2075
2054
|
return evaluatedAsList;
|
|
2076
2055
|
}
|
|
2077
2056
|
return this.toString();
|
|
2078
|
-
} catch
|
|
2057
|
+
} catch {
|
|
2079
2058
|
return this.toString();
|
|
2080
2059
|
}
|
|
2081
2060
|
}
|
|
@@ -2318,22 +2297,22 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
|
|
|
2318
2297
|
|
|
2319
2298
|
// src/utils/storage/local-storage.ts
|
|
2320
2299
|
var localStorageUtils = () => {
|
|
2321
|
-
const setToken = (access_token) =>
|
|
2300
|
+
const setToken = async (access_token) => {
|
|
2322
2301
|
localStorage.setItem("accessToken", access_token);
|
|
2323
|
-
}
|
|
2324
|
-
const setRefreshToken = (refresh_token) =>
|
|
2302
|
+
};
|
|
2303
|
+
const setRefreshToken = async (refresh_token) => {
|
|
2325
2304
|
localStorage.setItem("refreshToken", refresh_token);
|
|
2326
|
-
}
|
|
2327
|
-
const getAccessToken = () =>
|
|
2305
|
+
};
|
|
2306
|
+
const getAccessToken = async () => {
|
|
2328
2307
|
return localStorage.getItem("accessToken");
|
|
2329
|
-
}
|
|
2330
|
-
const getRefreshToken = () =>
|
|
2308
|
+
};
|
|
2309
|
+
const getRefreshToken = async () => {
|
|
2331
2310
|
return localStorage.getItem("refreshToken");
|
|
2332
|
-
}
|
|
2333
|
-
const clearToken = () =>
|
|
2311
|
+
};
|
|
2312
|
+
const clearToken = async () => {
|
|
2334
2313
|
localStorage.removeItem("accessToken");
|
|
2335
2314
|
localStorage.removeItem("refreshToken");
|
|
2336
|
-
}
|
|
2315
|
+
};
|
|
2337
2316
|
return {
|
|
2338
2317
|
setToken,
|
|
2339
2318
|
setRefreshToken,
|
|
@@ -2345,9 +2324,9 @@ var localStorageUtils = () => {
|
|
|
2345
2324
|
|
|
2346
2325
|
// src/utils/storage/session-storage.ts
|
|
2347
2326
|
var sessionStorageUtils = () => {
|
|
2348
|
-
const getBrowserSession = () =>
|
|
2327
|
+
const getBrowserSession = async () => {
|
|
2349
2328
|
return sessionStorage.getItem("browserSession");
|
|
2350
|
-
}
|
|
2329
|
+
};
|
|
2351
2330
|
return {
|
|
2352
2331
|
getBrowserSession
|
|
2353
2332
|
};
|
|
@@ -2356,14 +2335,13 @@ var sessionStorageUtils = () => {
|
|
|
2356
2335
|
// src/configs/axios-client.ts
|
|
2357
2336
|
var axiosClient = {
|
|
2358
2337
|
init(config) {
|
|
2359
|
-
|
|
2360
|
-
const
|
|
2361
|
-
const sessionStorage2 = (_b = config.sessionStorageUtils) != null ? _b : sessionStorageUtils();
|
|
2338
|
+
const localStorage2 = config.localStorageUtils ?? localStorageUtils();
|
|
2339
|
+
const sessionStorage2 = config.sessionStorageUtils ?? sessionStorageUtils();
|
|
2362
2340
|
const db = config.db;
|
|
2363
2341
|
let isRefreshing = false;
|
|
2364
2342
|
let failedQueue = [];
|
|
2365
2343
|
const processQueue = (error, token = null) => {
|
|
2366
|
-
failedQueue
|
|
2344
|
+
failedQueue?.forEach((prom) => {
|
|
2367
2345
|
if (error) {
|
|
2368
2346
|
prom.reject(error);
|
|
2369
2347
|
} else {
|
|
@@ -2379,14 +2357,14 @@ var axiosClient = {
|
|
|
2379
2357
|
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
2380
2358
|
});
|
|
2381
2359
|
instance.interceptors.request.use(
|
|
2382
|
-
(config2) =>
|
|
2360
|
+
async (config2) => {
|
|
2383
2361
|
const useRefreshToken = config2.useRefreshToken;
|
|
2384
|
-
const token = useRefreshToken ?
|
|
2362
|
+
const token = useRefreshToken ? await localStorage2.getRefreshToken() : await localStorage2.getAccessToken();
|
|
2385
2363
|
if (token) {
|
|
2386
2364
|
config2.headers["Authorization"] = "Bearer " + token;
|
|
2387
2365
|
}
|
|
2388
2366
|
return config2;
|
|
2389
|
-
}
|
|
2367
|
+
},
|
|
2390
2368
|
(error) => {
|
|
2391
2369
|
Promise.reject(error);
|
|
2392
2370
|
}
|
|
@@ -2395,21 +2373,19 @@ var axiosClient = {
|
|
|
2395
2373
|
(response) => {
|
|
2396
2374
|
return handleResponse(response);
|
|
2397
2375
|
},
|
|
2398
|
-
(error) =>
|
|
2399
|
-
|
|
2400
|
-
const handleError3 = (error2) => __async(null, null, function* () {
|
|
2401
|
-
var _a3;
|
|
2376
|
+
async (error) => {
|
|
2377
|
+
const handleError3 = async (error2) => {
|
|
2402
2378
|
if (!error2.response) {
|
|
2403
2379
|
return error2;
|
|
2404
2380
|
}
|
|
2405
2381
|
const { data } = error2.response;
|
|
2406
|
-
if (data && data.code === 400 && ["invalid_grant"].includes(
|
|
2407
|
-
|
|
2382
|
+
if (data && data.code === 400 && ["invalid_grant"].includes(data.data?.error)) {
|
|
2383
|
+
await clearAuthToken();
|
|
2408
2384
|
}
|
|
2409
2385
|
return data;
|
|
2410
|
-
}
|
|
2386
|
+
};
|
|
2411
2387
|
const originalRequest = error.config;
|
|
2412
|
-
if ((
|
|
2388
|
+
if ((error.response?.status === 403 || error.response?.status === 401 || error.response?.status === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
|
|
2413
2389
|
error.response.data.code
|
|
2414
2390
|
)) {
|
|
2415
2391
|
if (isRefreshing) {
|
|
@@ -2422,19 +2398,18 @@ var axiosClient = {
|
|
|
2422
2398
|
token
|
|
2423
2399
|
);
|
|
2424
2400
|
return instance.request(originalRequest);
|
|
2425
|
-
}).catch((err) =>
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
yield clearAuthToken();
|
|
2401
|
+
}).catch(async (err) => {
|
|
2402
|
+
if ((err.response?.status === 400 || err.response?.status === 401) && ["invalid_grant"].includes(err.response.data.error)) {
|
|
2403
|
+
await clearAuthToken();
|
|
2429
2404
|
}
|
|
2430
|
-
})
|
|
2405
|
+
});
|
|
2431
2406
|
}
|
|
2432
|
-
const browserSession =
|
|
2433
|
-
const refreshToken =
|
|
2434
|
-
const accessTokenExp =
|
|
2407
|
+
const browserSession = await sessionStorage2.getBrowserSession();
|
|
2408
|
+
const refreshToken = await localStorage2.getRefreshToken();
|
|
2409
|
+
const accessTokenExp = await localStorage2.getAccessToken();
|
|
2435
2410
|
isRefreshing = true;
|
|
2436
2411
|
if (!refreshToken && (!browserSession || browserSession == "unActive")) {
|
|
2437
|
-
|
|
2412
|
+
await clearAuthToken();
|
|
2438
2413
|
} else {
|
|
2439
2414
|
const payload = Object.fromEntries(
|
|
2440
2415
|
Object.entries({
|
|
@@ -2445,9 +2420,8 @@ var axiosClient = {
|
|
|
2445
2420
|
}).filter(([_, value]) => !!value)
|
|
2446
2421
|
);
|
|
2447
2422
|
return new Promise(function(resolve) {
|
|
2448
|
-
var _a3;
|
|
2449
2423
|
import_axios.default.post(
|
|
2450
|
-
`${config.baseUrl}${
|
|
2424
|
+
`${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
|
|
2451
2425
|
payload,
|
|
2452
2426
|
{
|
|
2453
2427
|
headers: {
|
|
@@ -2455,10 +2429,10 @@ var axiosClient = {
|
|
|
2455
2429
|
Authorization: `Bearer ${accessTokenExp}`
|
|
2456
2430
|
}
|
|
2457
2431
|
}
|
|
2458
|
-
).then((res) =>
|
|
2432
|
+
).then(async (res) => {
|
|
2459
2433
|
const data = res.data;
|
|
2460
|
-
|
|
2461
|
-
|
|
2434
|
+
await localStorage2.setToken(data.access_token);
|
|
2435
|
+
await localStorage2.setRefreshToken(data.refresh_token);
|
|
2462
2436
|
import_axios.default.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
|
|
2463
2437
|
originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
|
|
2464
2438
|
originalRequest.data = updateTokenParamInOriginalRequest(
|
|
@@ -2467,26 +2441,25 @@ var axiosClient = {
|
|
|
2467
2441
|
);
|
|
2468
2442
|
processQueue(null, data.access_token);
|
|
2469
2443
|
resolve(instance.request(originalRequest));
|
|
2470
|
-
})
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
yield clearAuthToken();
|
|
2444
|
+
}).catch(async (err) => {
|
|
2445
|
+
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") {
|
|
2446
|
+
await clearAuthToken();
|
|
2474
2447
|
}
|
|
2475
2448
|
if (err && err.response) {
|
|
2476
|
-
const { error_code } =
|
|
2449
|
+
const { error_code } = err.response?.data || {};
|
|
2477
2450
|
if (error_code === "AUTHEN_FAIL") {
|
|
2478
|
-
|
|
2451
|
+
await clearAuthToken();
|
|
2479
2452
|
}
|
|
2480
2453
|
}
|
|
2481
2454
|
processQueue(err, null);
|
|
2482
|
-
})
|
|
2455
|
+
}).finally(() => {
|
|
2483
2456
|
isRefreshing = false;
|
|
2484
2457
|
});
|
|
2485
2458
|
});
|
|
2486
2459
|
}
|
|
2487
2460
|
}
|
|
2488
|
-
return Promise.reject(
|
|
2489
|
-
}
|
|
2461
|
+
return Promise.reject(await handleError3(error));
|
|
2462
|
+
}
|
|
2490
2463
|
);
|
|
2491
2464
|
const handleResponse = (res) => {
|
|
2492
2465
|
if (res && res.data) {
|
|
@@ -2495,7 +2468,6 @@ var axiosClient = {
|
|
|
2495
2468
|
return res;
|
|
2496
2469
|
};
|
|
2497
2470
|
const handleError2 = (error) => {
|
|
2498
|
-
var _a2, _b2, _c;
|
|
2499
2471
|
if (error.isAxiosError && error.code === "ECONNABORTED") {
|
|
2500
2472
|
console.error("Request Timeout Error:", error);
|
|
2501
2473
|
return "Request Timeout Error";
|
|
@@ -2503,17 +2475,17 @@ var axiosClient = {
|
|
|
2503
2475
|
console.error("Network Error:", error);
|
|
2504
2476
|
return "Network Error";
|
|
2505
2477
|
} else {
|
|
2506
|
-
console.error("Other Error:", error
|
|
2507
|
-
const errorMessage =
|
|
2508
|
-
return { message: errorMessage, status:
|
|
2478
|
+
console.error("Other Error:", error?.response);
|
|
2479
|
+
const errorMessage = error?.response?.data?.message || "An error occurred";
|
|
2480
|
+
return { message: errorMessage, status: error?.response?.status };
|
|
2509
2481
|
}
|
|
2510
2482
|
};
|
|
2511
|
-
const clearAuthToken = () =>
|
|
2512
|
-
|
|
2483
|
+
const clearAuthToken = async () => {
|
|
2484
|
+
await localStorage2.clearToken();
|
|
2513
2485
|
if (typeof window !== "undefined") {
|
|
2514
2486
|
window.location.href = `/login`;
|
|
2515
2487
|
}
|
|
2516
|
-
}
|
|
2488
|
+
};
|
|
2517
2489
|
function formatUrl(url, db2) {
|
|
2518
2490
|
return url + (db2 ? "?db=" + db2 : "");
|
|
2519
2491
|
}
|
|
@@ -2726,7 +2698,7 @@ var headerSlice = (0, import_toolkit5.createSlice)({
|
|
|
2726
2698
|
},
|
|
2727
2699
|
reducers: {
|
|
2728
2700
|
setHeader: (state, action) => {
|
|
2729
|
-
state.value =
|
|
2701
|
+
state.value = { ...state.value, ...action.payload };
|
|
2730
2702
|
},
|
|
2731
2703
|
setAllowedCompanyIds: (state, action) => {
|
|
2732
2704
|
state.value.allowedCompanyIds = action.payload;
|
|
@@ -3152,6 +3124,18 @@ var envStore = (0, import_toolkit11.configureStore)({
|
|
|
3152
3124
|
|
|
3153
3125
|
// src/environment/EnvStore.ts
|
|
3154
3126
|
var EnvStore = class {
|
|
3127
|
+
envStore;
|
|
3128
|
+
baseUrl;
|
|
3129
|
+
requests;
|
|
3130
|
+
context;
|
|
3131
|
+
defaultCompany;
|
|
3132
|
+
config;
|
|
3133
|
+
companies;
|
|
3134
|
+
user;
|
|
3135
|
+
db;
|
|
3136
|
+
localStorageUtils;
|
|
3137
|
+
sessionStorageUtils;
|
|
3138
|
+
refreshTokenEndpoint;
|
|
3155
3139
|
constructor(envStore2, localStorageUtils2, sessionStorageUtils2) {
|
|
3156
3140
|
this.envStore = envStore2;
|
|
3157
3141
|
this.localStorageUtils = localStorageUtils2;
|
|
@@ -3160,24 +3144,25 @@ var EnvStore = class {
|
|
|
3160
3144
|
}
|
|
3161
3145
|
setup() {
|
|
3162
3146
|
const env2 = this.envStore.getState().env;
|
|
3163
|
-
this.baseUrl = env2
|
|
3164
|
-
this.requests = env2
|
|
3165
|
-
this.context = env2
|
|
3166
|
-
this.defaultCompany = env2
|
|
3167
|
-
this.config = env2
|
|
3168
|
-
this.companies =
|
|
3169
|
-
this.user = env2
|
|
3170
|
-
this.db = env2
|
|
3171
|
-
this.refreshTokenEndpoint = env2
|
|
3147
|
+
this.baseUrl = env2?.baseUrl;
|
|
3148
|
+
this.requests = env2?.requests;
|
|
3149
|
+
this.context = env2?.context;
|
|
3150
|
+
this.defaultCompany = env2?.defaultCompany;
|
|
3151
|
+
this.config = env2?.config;
|
|
3152
|
+
this.companies = env2?.companies || [];
|
|
3153
|
+
this.user = env2?.user;
|
|
3154
|
+
this.db = env2?.db;
|
|
3155
|
+
this.refreshTokenEndpoint = env2?.refreshTokenEndpoint;
|
|
3172
3156
|
}
|
|
3173
3157
|
setupEnv(envConfig) {
|
|
3174
3158
|
const dispatch = this.envStore.dispatch;
|
|
3175
|
-
const env2 =
|
|
3159
|
+
const env2 = {
|
|
3160
|
+
...envConfig,
|
|
3176
3161
|
localStorageUtils: this.localStorageUtils,
|
|
3177
3162
|
sessionStorageUtils: this.sessionStorageUtils
|
|
3178
|
-
}
|
|
3163
|
+
};
|
|
3179
3164
|
const requests = axiosClient.init(env2);
|
|
3180
|
-
dispatch(setEnv(
|
|
3165
|
+
dispatch(setEnv({ ...env2, requests }));
|
|
3181
3166
|
this.setup();
|
|
3182
3167
|
}
|
|
3183
3168
|
setUid(uid) {
|
|
@@ -3221,61 +3206,35 @@ function getEnv() {
|
|
|
3221
3206
|
// src/services/action-service/index.ts
|
|
3222
3207
|
var ActionService = {
|
|
3223
3208
|
// Load Action
|
|
3224
|
-
loadAction(
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
}
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
});
|
|
3239
|
-
});
|
|
3240
|
-
},
|
|
3241
|
-
// Call Button
|
|
3242
|
-
callButton(_0) {
|
|
3243
|
-
return __async(this, arguments, function* ({
|
|
3244
|
-
model,
|
|
3245
|
-
ids = [],
|
|
3246
|
-
context,
|
|
3247
|
-
method
|
|
3248
|
-
}) {
|
|
3249
|
-
try {
|
|
3250
|
-
const env2 = getEnv();
|
|
3251
|
-
const jsonData = {
|
|
3252
|
-
model,
|
|
3253
|
-
method,
|
|
3254
|
-
ids,
|
|
3255
|
-
with_context: context
|
|
3256
|
-
};
|
|
3257
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3258
|
-
headers: {
|
|
3259
|
-
"Content-Type": "application/json"
|
|
3260
|
-
}
|
|
3261
|
-
});
|
|
3262
|
-
} catch (error) {
|
|
3263
|
-
console.error("Error when calling button action:", error);
|
|
3264
|
-
throw error;
|
|
3209
|
+
async loadAction({
|
|
3210
|
+
idAction,
|
|
3211
|
+
context
|
|
3212
|
+
}) {
|
|
3213
|
+
const env2 = getEnv();
|
|
3214
|
+
const jsonData = {
|
|
3215
|
+
action_id: idAction,
|
|
3216
|
+
with_context: {
|
|
3217
|
+
...context
|
|
3218
|
+
}
|
|
3219
|
+
};
|
|
3220
|
+
return env2.requests.post(`${"/load_action" /* LOAD_ACTION */}`, jsonData, {
|
|
3221
|
+
headers: {
|
|
3222
|
+
"Content-Type": "application/json"
|
|
3265
3223
|
}
|
|
3266
3224
|
});
|
|
3267
3225
|
},
|
|
3268
|
-
//
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3226
|
+
// Call Button
|
|
3227
|
+
async callButton({
|
|
3228
|
+
model,
|
|
3229
|
+
ids = [],
|
|
3230
|
+
context,
|
|
3231
|
+
method
|
|
3232
|
+
}) {
|
|
3233
|
+
try {
|
|
3275
3234
|
const env2 = getEnv();
|
|
3276
3235
|
const jsonData = {
|
|
3277
3236
|
model,
|
|
3278
|
-
method
|
|
3237
|
+
method,
|
|
3279
3238
|
ids,
|
|
3280
3239
|
with_context: context
|
|
3281
3240
|
};
|
|
@@ -3284,96 +3243,112 @@ var ActionService = {
|
|
|
3284
3243
|
"Content-Type": "application/json"
|
|
3285
3244
|
}
|
|
3286
3245
|
});
|
|
3246
|
+
} catch (error) {
|
|
3247
|
+
console.error("Error when calling button action:", error);
|
|
3248
|
+
throw error;
|
|
3249
|
+
}
|
|
3250
|
+
},
|
|
3251
|
+
// remove Row
|
|
3252
|
+
async removeRows({
|
|
3253
|
+
model,
|
|
3254
|
+
ids,
|
|
3255
|
+
context
|
|
3256
|
+
}) {
|
|
3257
|
+
const env2 = getEnv();
|
|
3258
|
+
const jsonData = {
|
|
3259
|
+
model,
|
|
3260
|
+
method: "unlink",
|
|
3261
|
+
ids,
|
|
3262
|
+
with_context: context
|
|
3263
|
+
};
|
|
3264
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3265
|
+
headers: {
|
|
3266
|
+
"Content-Type": "application/json"
|
|
3267
|
+
}
|
|
3287
3268
|
});
|
|
3288
3269
|
},
|
|
3289
3270
|
// Duplicate Model
|
|
3290
|
-
duplicateRecord(
|
|
3291
|
-
|
|
3271
|
+
async duplicateRecord({
|
|
3272
|
+
model,
|
|
3273
|
+
id,
|
|
3274
|
+
context
|
|
3275
|
+
}) {
|
|
3276
|
+
const env2 = getEnv();
|
|
3277
|
+
const jsonData = {
|
|
3292
3278
|
model,
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
with_context: context
|
|
3302
|
-
};
|
|
3303
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3304
|
-
headers: {
|
|
3305
|
-
"Content-Type": "application/json"
|
|
3306
|
-
}
|
|
3307
|
-
});
|
|
3279
|
+
method: "copy",
|
|
3280
|
+
ids: id,
|
|
3281
|
+
with_context: context
|
|
3282
|
+
};
|
|
3283
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3284
|
+
headers: {
|
|
3285
|
+
"Content-Type": "application/json"
|
|
3286
|
+
}
|
|
3308
3287
|
});
|
|
3309
3288
|
},
|
|
3310
3289
|
// Get Print Report
|
|
3311
|
-
getPrintReportName(
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
report_name: {}
|
|
3321
|
-
}
|
|
3322
|
-
}
|
|
3323
|
-
};
|
|
3324
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3325
|
-
headers: {
|
|
3326
|
-
"Content-Type": "application/json"
|
|
3290
|
+
async getPrintReportName({ id }) {
|
|
3291
|
+
const env2 = getEnv();
|
|
3292
|
+
const jsonData = {
|
|
3293
|
+
model: "ir.actions.report",
|
|
3294
|
+
method: "web_read",
|
|
3295
|
+
id,
|
|
3296
|
+
kwargs: {
|
|
3297
|
+
specification: {
|
|
3298
|
+
report_name: {}
|
|
3327
3299
|
}
|
|
3328
|
-
}
|
|
3300
|
+
}
|
|
3301
|
+
};
|
|
3302
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3303
|
+
headers: {
|
|
3304
|
+
"Content-Type": "application/json"
|
|
3305
|
+
}
|
|
3329
3306
|
});
|
|
3330
3307
|
},
|
|
3331
3308
|
//Save Print Invoice
|
|
3332
|
-
print(
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
responseType: "arraybuffer"
|
|
3349
|
-
});
|
|
3309
|
+
async print({ id, report, db }) {
|
|
3310
|
+
const env2 = getEnv();
|
|
3311
|
+
const jsonData = {
|
|
3312
|
+
report,
|
|
3313
|
+
id,
|
|
3314
|
+
type: "pdf",
|
|
3315
|
+
file_response: true,
|
|
3316
|
+
db
|
|
3317
|
+
};
|
|
3318
|
+
const queryString = toQueryString(jsonData);
|
|
3319
|
+
const urlWithParams = `${"/report" /* REPORT_PATH */}?${queryString}`;
|
|
3320
|
+
return env2.requests.get(urlWithParams, {
|
|
3321
|
+
headers: {
|
|
3322
|
+
"Content-Type": "application/json"
|
|
3323
|
+
},
|
|
3324
|
+
responseType: "arraybuffer"
|
|
3350
3325
|
});
|
|
3351
3326
|
},
|
|
3352
3327
|
//Run Action
|
|
3353
|
-
runAction(
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
}
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
}
|
|
3328
|
+
async runAction({
|
|
3329
|
+
idAction,
|
|
3330
|
+
context
|
|
3331
|
+
}) {
|
|
3332
|
+
const env2 = getEnv();
|
|
3333
|
+
const jsonData = {
|
|
3334
|
+
action_id: idAction,
|
|
3335
|
+
with_context: {
|
|
3336
|
+
...context
|
|
3337
|
+
}
|
|
3338
|
+
// context: {
|
|
3339
|
+
// lang: 'en_US',
|
|
3340
|
+
// tz: 'Asia/Saigon',
|
|
3341
|
+
// uid: 2,
|
|
3342
|
+
// allowed_company_ids: [1],
|
|
3343
|
+
// active_id: Array.isArray(idDetail) ? idDetail[0] : idDetail,
|
|
3344
|
+
// active_ids: Array.isArray(idDetail) ? [...idDetail] : idDetail,
|
|
3345
|
+
// active_model: model,
|
|
3346
|
+
// },
|
|
3347
|
+
};
|
|
3348
|
+
return env2.requests.post(`${"/run_action" /* RUN_ACTION_PATH */}`, jsonData, {
|
|
3349
|
+
headers: {
|
|
3350
|
+
"Content-Type": "application/json"
|
|
3351
|
+
}
|
|
3377
3352
|
});
|
|
3378
3353
|
}
|
|
3379
3354
|
};
|
|
@@ -3381,238 +3356,200 @@ var action_service_default = ActionService;
|
|
|
3381
3356
|
|
|
3382
3357
|
// src/services/auth-service/index.ts
|
|
3383
3358
|
var AuthService = {
|
|
3384
|
-
login(body) {
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
3401
|
-
}
|
|
3402
|
-
});
|
|
3359
|
+
async login(body) {
|
|
3360
|
+
const env2 = getEnv();
|
|
3361
|
+
const payload = Object.fromEntries(
|
|
3362
|
+
Object.entries({
|
|
3363
|
+
username: body.email,
|
|
3364
|
+
password: body.password,
|
|
3365
|
+
grant_type: env2?.config?.grantType || "",
|
|
3366
|
+
client_id: env2?.config?.clientId || "",
|
|
3367
|
+
client_secret: env2?.config?.clientSecret || ""
|
|
3368
|
+
}).filter(([_, value]) => !!value)
|
|
3369
|
+
);
|
|
3370
|
+
const encodedData = new URLSearchParams(payload).toString();
|
|
3371
|
+
return env2?.requests?.post(body.path, encodedData, {
|
|
3372
|
+
headers: {
|
|
3373
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
3374
|
+
}
|
|
3403
3375
|
});
|
|
3404
3376
|
},
|
|
3405
|
-
forgotPassword(email) {
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
"Content-Type": "application/json"
|
|
3416
|
-
}
|
|
3417
|
-
});
|
|
3377
|
+
async forgotPassword(email) {
|
|
3378
|
+
const env2 = getEnv();
|
|
3379
|
+
const bodyData = {
|
|
3380
|
+
login: email,
|
|
3381
|
+
url: `${window.location.origin}/reset-password`
|
|
3382
|
+
};
|
|
3383
|
+
return env2?.requests?.post("/reset_password" /* RESET_PASSWORD_PATH */, bodyData, {
|
|
3384
|
+
headers: {
|
|
3385
|
+
"Content-Type": "application/json"
|
|
3386
|
+
}
|
|
3418
3387
|
});
|
|
3419
3388
|
},
|
|
3420
|
-
forgotPasswordSSO(
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
vals: {
|
|
3432
|
-
email
|
|
3433
|
-
}
|
|
3434
|
-
},
|
|
3435
|
-
with_context
|
|
3436
|
-
};
|
|
3437
|
-
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, body, {
|
|
3438
|
-
headers: {
|
|
3439
|
-
"Content-Type": "application/json"
|
|
3389
|
+
async forgotPasswordSSO({
|
|
3390
|
+
email,
|
|
3391
|
+
with_context,
|
|
3392
|
+
method
|
|
3393
|
+
}) {
|
|
3394
|
+
const env2 = getEnv();
|
|
3395
|
+
const body = {
|
|
3396
|
+
method,
|
|
3397
|
+
kwargs: {
|
|
3398
|
+
vals: {
|
|
3399
|
+
email
|
|
3440
3400
|
}
|
|
3441
|
-
}
|
|
3401
|
+
},
|
|
3402
|
+
with_context
|
|
3403
|
+
};
|
|
3404
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, body, {
|
|
3405
|
+
headers: {
|
|
3406
|
+
"Content-Type": "application/json"
|
|
3407
|
+
}
|
|
3442
3408
|
});
|
|
3443
3409
|
},
|
|
3444
|
-
resetPassword(data, token) {
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
"Content-Type": "application/json"
|
|
3456
|
-
}
|
|
3457
|
-
});
|
|
3410
|
+
async resetPassword(data, token) {
|
|
3411
|
+
const env2 = getEnv();
|
|
3412
|
+
const bodyData = {
|
|
3413
|
+
token,
|
|
3414
|
+
password: data.password,
|
|
3415
|
+
new_password: data.confirmPassword
|
|
3416
|
+
};
|
|
3417
|
+
return env2?.requests?.post("/change_password" /* CHANGE_PASSWORD_PATH */, bodyData, {
|
|
3418
|
+
headers: {
|
|
3419
|
+
"Content-Type": "application/json"
|
|
3420
|
+
}
|
|
3458
3421
|
});
|
|
3459
3422
|
},
|
|
3460
|
-
resetPasswordSSO(
|
|
3461
|
-
|
|
3423
|
+
async resetPasswordSSO({
|
|
3424
|
+
method,
|
|
3425
|
+
password,
|
|
3426
|
+
with_context
|
|
3427
|
+
}) {
|
|
3428
|
+
const env2 = getEnv();
|
|
3429
|
+
const bodyData = {
|
|
3462
3430
|
method,
|
|
3463
|
-
|
|
3431
|
+
kwargs: {
|
|
3432
|
+
vals: {
|
|
3433
|
+
password
|
|
3434
|
+
}
|
|
3435
|
+
},
|
|
3464
3436
|
with_context
|
|
3465
|
-
}
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
kwargs: {
|
|
3471
|
-
vals: {
|
|
3472
|
-
password
|
|
3473
|
-
}
|
|
3474
|
-
},
|
|
3475
|
-
with_context
|
|
3476
|
-
};
|
|
3477
|
-
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, bodyData, {
|
|
3478
|
-
headers: {
|
|
3479
|
-
"Content-Type": "application/json"
|
|
3480
|
-
}
|
|
3481
|
-
});
|
|
3437
|
+
};
|
|
3438
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, bodyData, {
|
|
3439
|
+
headers: {
|
|
3440
|
+
"Content-Type": "application/json"
|
|
3441
|
+
}
|
|
3482
3442
|
});
|
|
3483
3443
|
},
|
|
3484
|
-
updatePassword(data, token) {
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
"Content-Type": "application/json"
|
|
3496
|
-
}
|
|
3497
|
-
});
|
|
3444
|
+
async updatePassword(data, token) {
|
|
3445
|
+
const env2 = getEnv();
|
|
3446
|
+
const bodyData = {
|
|
3447
|
+
token,
|
|
3448
|
+
old_password: data.oldPassword,
|
|
3449
|
+
new_password: data.newPassword
|
|
3450
|
+
};
|
|
3451
|
+
return env2?.requests?.post("/change_password_parent" /* UPDATE_PASSWORD_PATH */, bodyData, {
|
|
3452
|
+
headers: {
|
|
3453
|
+
"Content-Type": "application/json"
|
|
3454
|
+
}
|
|
3498
3455
|
});
|
|
3499
3456
|
},
|
|
3500
|
-
isValidToken(token) {
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
"Content-Type": "application/json"
|
|
3510
|
-
}
|
|
3511
|
-
});
|
|
3457
|
+
async isValidToken(token) {
|
|
3458
|
+
const env2 = getEnv();
|
|
3459
|
+
const bodyData = {
|
|
3460
|
+
token
|
|
3461
|
+
};
|
|
3462
|
+
return env2?.requests?.post("/check_token" /* TOKEN */, bodyData, {
|
|
3463
|
+
headers: {
|
|
3464
|
+
"Content-Type": "application/json"
|
|
3465
|
+
}
|
|
3512
3466
|
});
|
|
3513
3467
|
},
|
|
3514
|
-
loginSocial(
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
{
|
|
3525
|
-
|
|
3526
|
-
headers: {
|
|
3527
|
-
"Content-Type": "application/json"
|
|
3528
|
-
}
|
|
3468
|
+
async loginSocial({
|
|
3469
|
+
db,
|
|
3470
|
+
state,
|
|
3471
|
+
access_token
|
|
3472
|
+
}) {
|
|
3473
|
+
const env2 = getEnv();
|
|
3474
|
+
return env2?.requests?.post(
|
|
3475
|
+
"/token/generate" /* GENTOKEN_SOCIAL */,
|
|
3476
|
+
{ state, access_token },
|
|
3477
|
+
{
|
|
3478
|
+
headers: {
|
|
3479
|
+
"Content-Type": "application/json"
|
|
3529
3480
|
}
|
|
3530
|
-
|
|
3531
|
-
|
|
3481
|
+
}
|
|
3482
|
+
);
|
|
3532
3483
|
},
|
|
3533
|
-
getProviders(db) {
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
const env2 = getEnv();
|
|
3537
|
-
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.get("/oauth/providers", { params: { db } });
|
|
3538
|
-
});
|
|
3484
|
+
async getProviders(db) {
|
|
3485
|
+
const env2 = getEnv();
|
|
3486
|
+
return env2?.requests?.get("/oauth/providers", { params: { db } });
|
|
3539
3487
|
},
|
|
3540
|
-
getAccessByCode(code) {
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
headers: {
|
|
3554
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
3555
|
-
}
|
|
3488
|
+
async getAccessByCode(code) {
|
|
3489
|
+
const env2 = getEnv();
|
|
3490
|
+
const data = new URLSearchParams();
|
|
3491
|
+
data.append("code", code);
|
|
3492
|
+
data.append("grant_type", "authorization_code");
|
|
3493
|
+
data.append("client_id", env2?.config?.clientId || "");
|
|
3494
|
+
data.append("redirect_uri", env2?.config?.redirectUri || "");
|
|
3495
|
+
return env2?.requests?.post(
|
|
3496
|
+
`${env2?.baseUrl?.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
|
|
3497
|
+
data,
|
|
3498
|
+
{
|
|
3499
|
+
headers: {
|
|
3500
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
3556
3501
|
}
|
|
3557
|
-
|
|
3558
|
-
|
|
3502
|
+
}
|
|
3503
|
+
);
|
|
3559
3504
|
},
|
|
3560
|
-
logout(data) {
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
{
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
}
|
|
3575
|
-
);
|
|
3576
|
-
});
|
|
3505
|
+
async logout(data) {
|
|
3506
|
+
const env2 = getEnv();
|
|
3507
|
+
console.log(data);
|
|
3508
|
+
return env2?.requests?.post(
|
|
3509
|
+
"/logout" /* LOGOUT */,
|
|
3510
|
+
{},
|
|
3511
|
+
{
|
|
3512
|
+
headers: {
|
|
3513
|
+
"Content-Type": "application/json"
|
|
3514
|
+
},
|
|
3515
|
+
withCredentials: true,
|
|
3516
|
+
useRefreshToken: true
|
|
3517
|
+
}
|
|
3518
|
+
);
|
|
3577
3519
|
}
|
|
3578
3520
|
};
|
|
3579
3521
|
var auth_service_default = AuthService;
|
|
3580
3522
|
|
|
3581
3523
|
// src/services/company-service/index.ts
|
|
3582
3524
|
var CompanyService = {
|
|
3583
|
-
getCurrentCompany() {
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
}
|
|
3590
|
-
});
|
|
3525
|
+
async getCurrentCompany() {
|
|
3526
|
+
const env2 = getEnv();
|
|
3527
|
+
return await env2.requests.get("/company" /* COMPANY_PATH */, {
|
|
3528
|
+
headers: {
|
|
3529
|
+
"Content-Type": "application/json"
|
|
3530
|
+
}
|
|
3591
3531
|
});
|
|
3592
3532
|
},
|
|
3593
|
-
getInfoCompany(id) {
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
display_name: {},
|
|
3607
|
-
secondary_logo: {}
|
|
3608
|
-
}
|
|
3609
|
-
}
|
|
3610
|
-
};
|
|
3611
|
-
return yield (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
3612
|
-
headers: {
|
|
3613
|
-
"Content-Type": "application/json"
|
|
3533
|
+
async getInfoCompany(id) {
|
|
3534
|
+
const env2 = getEnv();
|
|
3535
|
+
const jsonData = {
|
|
3536
|
+
ids: [id],
|
|
3537
|
+
model: "res.company" /* COMPANY */,
|
|
3538
|
+
method: "web_read" /* WEB_READ */,
|
|
3539
|
+
kwargs: {
|
|
3540
|
+
specification: {
|
|
3541
|
+
primary_color: {},
|
|
3542
|
+
secondary_color: {},
|
|
3543
|
+
logo: {},
|
|
3544
|
+
display_name: {},
|
|
3545
|
+
secondary_logo: {}
|
|
3614
3546
|
}
|
|
3615
|
-
}
|
|
3547
|
+
}
|
|
3548
|
+
};
|
|
3549
|
+
return await env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
3550
|
+
headers: {
|
|
3551
|
+
"Content-Type": "application/json"
|
|
3552
|
+
}
|
|
3616
3553
|
});
|
|
3617
3554
|
}
|
|
3618
3555
|
};
|
|
@@ -3620,328 +3557,300 @@ var company_service_default = CompanyService;
|
|
|
3620
3557
|
|
|
3621
3558
|
// src/services/excel-service/index.ts
|
|
3622
3559
|
var ExcelService = {
|
|
3623
|
-
uploadFile(
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
}
|
|
3630
|
-
});
|
|
3560
|
+
async uploadFile({ formData }) {
|
|
3561
|
+
const env2 = getEnv();
|
|
3562
|
+
return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
|
|
3563
|
+
headers: {
|
|
3564
|
+
"Content-Type": "multipart/form-data"
|
|
3565
|
+
}
|
|
3631
3566
|
});
|
|
3632
3567
|
},
|
|
3633
|
-
uploadIdFile(
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
}
|
|
3640
|
-
});
|
|
3568
|
+
async uploadIdFile({ formData }) {
|
|
3569
|
+
const env2 = getEnv();
|
|
3570
|
+
return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
|
|
3571
|
+
headers: {
|
|
3572
|
+
"Content-Type": "multipart/form-data"
|
|
3573
|
+
}
|
|
3641
3574
|
});
|
|
3642
3575
|
},
|
|
3643
|
-
parsePreview(
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
tracking_disable: true
|
|
3676
|
-
}
|
|
3677
|
-
},
|
|
3678
|
-
with_context: context
|
|
3679
|
-
};
|
|
3680
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3681
|
-
headers: {
|
|
3682
|
-
"Content-Type": "multipart/form-data"
|
|
3576
|
+
async parsePreview({
|
|
3577
|
+
id,
|
|
3578
|
+
selectedSheet,
|
|
3579
|
+
isHeader,
|
|
3580
|
+
context
|
|
3581
|
+
}) {
|
|
3582
|
+
const env2 = getEnv();
|
|
3583
|
+
const jsonData = {
|
|
3584
|
+
model: "base_import.import" /* BASE_IMPORT */,
|
|
3585
|
+
method: "parse_preview",
|
|
3586
|
+
ids: [id],
|
|
3587
|
+
kwargs: {
|
|
3588
|
+
options: {
|
|
3589
|
+
import_skip_records: [],
|
|
3590
|
+
import_set_empty_fields: [],
|
|
3591
|
+
fallback_values: {},
|
|
3592
|
+
name_create_enabled_fields: {},
|
|
3593
|
+
encoding: "",
|
|
3594
|
+
separator: "",
|
|
3595
|
+
quoting: '"',
|
|
3596
|
+
date_format: "",
|
|
3597
|
+
datetime_format: "",
|
|
3598
|
+
float_thousand_separator: ",",
|
|
3599
|
+
float_decimal_separator: ".",
|
|
3600
|
+
advanced: true,
|
|
3601
|
+
has_headers: isHeader,
|
|
3602
|
+
keep_matches: false,
|
|
3603
|
+
limit: 2e3,
|
|
3604
|
+
sheets: [],
|
|
3605
|
+
sheet: selectedSheet,
|
|
3606
|
+
skip: 0,
|
|
3607
|
+
tracking_disable: true
|
|
3683
3608
|
}
|
|
3684
|
-
}
|
|
3609
|
+
},
|
|
3610
|
+
with_context: context
|
|
3611
|
+
};
|
|
3612
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3613
|
+
headers: {
|
|
3614
|
+
"Content-Type": "multipart/form-data"
|
|
3615
|
+
}
|
|
3685
3616
|
});
|
|
3686
3617
|
},
|
|
3687
|
-
executeImport(
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
}
|
|
3713
|
-
});
|
|
3618
|
+
async executeImport({
|
|
3619
|
+
columns,
|
|
3620
|
+
fields,
|
|
3621
|
+
idFile,
|
|
3622
|
+
options,
|
|
3623
|
+
dryrun,
|
|
3624
|
+
context
|
|
3625
|
+
}) {
|
|
3626
|
+
const env2 = getEnv();
|
|
3627
|
+
const jsonData = {
|
|
3628
|
+
model: "base_import.import" /* BASE_IMPORT */,
|
|
3629
|
+
method: "execute_import",
|
|
3630
|
+
ids: [idFile],
|
|
3631
|
+
kwargs: {
|
|
3632
|
+
fields,
|
|
3633
|
+
columns,
|
|
3634
|
+
options,
|
|
3635
|
+
dryrun
|
|
3636
|
+
},
|
|
3637
|
+
with_context: context
|
|
3638
|
+
};
|
|
3639
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3640
|
+
headers: {
|
|
3641
|
+
"Content-Type": "multipart/form-data"
|
|
3642
|
+
}
|
|
3714
3643
|
});
|
|
3715
3644
|
},
|
|
3716
|
-
getFileExcel(
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonData);
|
|
3725
|
-
});
|
|
3645
|
+
async getFileExcel({ model }) {
|
|
3646
|
+
const env2 = getEnv();
|
|
3647
|
+
const jsonData = {
|
|
3648
|
+
model,
|
|
3649
|
+
method: "get_import_templates" /* GET_IMPORT */,
|
|
3650
|
+
args: []
|
|
3651
|
+
};
|
|
3652
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData);
|
|
3726
3653
|
},
|
|
3727
|
-
getFieldExport(
|
|
3728
|
-
|
|
3729
|
-
|
|
3654
|
+
async getFieldExport({
|
|
3655
|
+
ids,
|
|
3656
|
+
model,
|
|
3657
|
+
isShow,
|
|
3658
|
+
parentField,
|
|
3659
|
+
fieldType,
|
|
3660
|
+
parentName,
|
|
3661
|
+
prefix,
|
|
3662
|
+
name,
|
|
3663
|
+
context,
|
|
3664
|
+
importCompat
|
|
3665
|
+
}) {
|
|
3666
|
+
const env2 = getEnv();
|
|
3667
|
+
const jsonData = {
|
|
3730
3668
|
model,
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
domain: [["id", "in", ids]],
|
|
3745
|
-
with_context: context
|
|
3746
|
-
};
|
|
3747
|
-
if (isShow) {
|
|
3748
|
-
jsonData.parent_field = parentField;
|
|
3749
|
-
jsonData.parent_field_type = fieldType;
|
|
3750
|
-
jsonData.parent_name = parentName;
|
|
3751
|
-
jsonData.name = name;
|
|
3752
|
-
jsonData.prefix = prefix;
|
|
3753
|
-
jsonData.exclude = [null];
|
|
3754
|
-
}
|
|
3755
|
-
return env2.requests.post("/export/get_fields", jsonData);
|
|
3756
|
-
});
|
|
3669
|
+
import_compat: importCompat,
|
|
3670
|
+
domain: [["id", "in", ids]],
|
|
3671
|
+
with_context: context
|
|
3672
|
+
};
|
|
3673
|
+
if (isShow) {
|
|
3674
|
+
jsonData.parent_field = parentField;
|
|
3675
|
+
jsonData.parent_field_type = fieldType;
|
|
3676
|
+
jsonData.parent_name = parentName;
|
|
3677
|
+
jsonData.name = name;
|
|
3678
|
+
jsonData.prefix = prefix;
|
|
3679
|
+
jsonData.exclude = [null];
|
|
3680
|
+
}
|
|
3681
|
+
return env2.requests.post("/export/get_fields", jsonData);
|
|
3757
3682
|
},
|
|
3758
|
-
exportExcel(
|
|
3759
|
-
|
|
3683
|
+
async exportExcel({
|
|
3684
|
+
model,
|
|
3685
|
+
domain,
|
|
3686
|
+
ids,
|
|
3687
|
+
fields,
|
|
3688
|
+
type,
|
|
3689
|
+
importCompat,
|
|
3690
|
+
context,
|
|
3691
|
+
groupby
|
|
3692
|
+
}) {
|
|
3693
|
+
const env2 = getEnv();
|
|
3694
|
+
const jsonData = {
|
|
3760
3695
|
model,
|
|
3761
3696
|
domain,
|
|
3762
3697
|
ids,
|
|
3698
|
+
import_compat: importCompat,
|
|
3763
3699
|
fields,
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
}) {
|
|
3769
|
-
const env2 = getEnv();
|
|
3770
|
-
const jsonData = {
|
|
3771
|
-
model,
|
|
3772
|
-
domain,
|
|
3773
|
-
ids,
|
|
3774
|
-
import_compat: importCompat,
|
|
3775
|
-
fields,
|
|
3776
|
-
with_context: context,
|
|
3777
|
-
groupby: groupby != null ? groupby : []
|
|
3778
|
-
};
|
|
3779
|
-
return env2.requests.post_excel(`/export/${type}`, jsonData);
|
|
3780
|
-
});
|
|
3700
|
+
with_context: context,
|
|
3701
|
+
groupby: groupby ?? []
|
|
3702
|
+
};
|
|
3703
|
+
return env2.requests.post_excel(`/export/${type}`, jsonData);
|
|
3781
3704
|
}
|
|
3782
3705
|
};
|
|
3783
3706
|
var excel_service_default = ExcelService;
|
|
3784
3707
|
|
|
3785
3708
|
// src/services/form-service/index.ts
|
|
3786
3709
|
var FormService = {
|
|
3787
|
-
getComment(
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
}
|
|
3808
|
-
});
|
|
3809
|
-
},
|
|
3810
|
-
sentComment(_0) {
|
|
3811
|
-
return __async(this, arguments, function* ({ data }) {
|
|
3812
|
-
try {
|
|
3813
|
-
const env2 = getEnv();
|
|
3814
|
-
const jsonData = {
|
|
3815
|
-
context: {
|
|
3816
|
-
tz: "Asia/Saigon",
|
|
3817
|
-
uid: 2,
|
|
3818
|
-
allowed_company_ids: [1],
|
|
3819
|
-
mail_post_autofollow: false,
|
|
3820
|
-
temporary_id: 142183.01
|
|
3821
|
-
},
|
|
3822
|
-
post_data: {
|
|
3823
|
-
body: data.message,
|
|
3824
|
-
message_type: "comment",
|
|
3825
|
-
attachment_ids: data.attachment_ids,
|
|
3826
|
-
attachment_tokens: [],
|
|
3827
|
-
subtype_xmlid: data.subtype
|
|
3828
|
-
},
|
|
3829
|
-
thread_id: Number(data.thread_id),
|
|
3830
|
-
thread_model: data.thread_model
|
|
3831
|
-
};
|
|
3832
|
-
return env2.requests.post("/chatter/message/post" /* SENT_MESSAGE */, jsonData, {
|
|
3833
|
-
headers: {
|
|
3834
|
-
"Content-Type": "application/json"
|
|
3835
|
-
}
|
|
3836
|
-
});
|
|
3837
|
-
} catch (error) {
|
|
3838
|
-
console.error("Error when sent message:", error);
|
|
3839
|
-
throw error;
|
|
3840
|
-
}
|
|
3841
|
-
});
|
|
3710
|
+
async getComment({ data }) {
|
|
3711
|
+
try {
|
|
3712
|
+
const env2 = getEnv();
|
|
3713
|
+
const jsonData = {
|
|
3714
|
+
thread_id: data.thread_id,
|
|
3715
|
+
thread_model: data.thread_model,
|
|
3716
|
+
limit: 100,
|
|
3717
|
+
with_context: {
|
|
3718
|
+
lang: data.lang
|
|
3719
|
+
}
|
|
3720
|
+
};
|
|
3721
|
+
return env2.requests.post("/chatter/thread/messages" /* GET_MESSAGE */, jsonData, {
|
|
3722
|
+
headers: {
|
|
3723
|
+
"Content-Type": "application/json"
|
|
3724
|
+
}
|
|
3725
|
+
});
|
|
3726
|
+
} catch (error) {
|
|
3727
|
+
console.error("Error when sending message:", error);
|
|
3728
|
+
throw error;
|
|
3729
|
+
}
|
|
3842
3730
|
},
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3731
|
+
async sentComment({ data }) {
|
|
3732
|
+
try {
|
|
3733
|
+
const env2 = getEnv();
|
|
3734
|
+
const jsonData = {
|
|
3735
|
+
context: {
|
|
3736
|
+
tz: "Asia/Saigon",
|
|
3737
|
+
uid: 2,
|
|
3738
|
+
allowed_company_ids: [1],
|
|
3739
|
+
mail_post_autofollow: false,
|
|
3740
|
+
temporary_id: 142183.01
|
|
3741
|
+
},
|
|
3742
|
+
post_data: {
|
|
3743
|
+
body: data.message,
|
|
3744
|
+
message_type: "comment",
|
|
3745
|
+
attachment_ids: data.attachment_ids,
|
|
3849
3746
|
attachment_tokens: [],
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
getImage(_0) {
|
|
3865
|
-
return __async(this, arguments, function* ({ data }) {
|
|
3866
|
-
try {
|
|
3867
|
-
const env2 = getEnv();
|
|
3868
|
-
return env2.requests.get(
|
|
3869
|
-
`${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
|
|
3870
|
-
{
|
|
3871
|
-
headers: {
|
|
3872
|
-
"Content-Type": "application/json"
|
|
3873
|
-
}
|
|
3874
|
-
}
|
|
3875
|
-
);
|
|
3876
|
-
} catch (error) {
|
|
3877
|
-
console.error("Error when sent message:", error);
|
|
3878
|
-
throw error;
|
|
3879
|
-
}
|
|
3880
|
-
});
|
|
3747
|
+
subtype_xmlid: data.subtype
|
|
3748
|
+
},
|
|
3749
|
+
thread_id: Number(data.thread_id),
|
|
3750
|
+
thread_model: data.thread_model
|
|
3751
|
+
};
|
|
3752
|
+
return env2.requests.post("/chatter/message/post" /* SENT_MESSAGE */, jsonData, {
|
|
3753
|
+
headers: {
|
|
3754
|
+
"Content-Type": "application/json"
|
|
3755
|
+
}
|
|
3756
|
+
});
|
|
3757
|
+
} catch (error) {
|
|
3758
|
+
console.error("Error when sent message:", error);
|
|
3759
|
+
throw error;
|
|
3760
|
+
}
|
|
3881
3761
|
},
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3762
|
+
async deleteComment({ data }) {
|
|
3763
|
+
try {
|
|
3764
|
+
const env2 = getEnv();
|
|
3765
|
+
const jsonData = {
|
|
3766
|
+
attachment_ids: [],
|
|
3767
|
+
attachment_tokens: [],
|
|
3768
|
+
body: "",
|
|
3769
|
+
message_id: data.message_id
|
|
3770
|
+
};
|
|
3771
|
+
return env2.requests.post("/chatter/message/update_content" /* DELETE_MESSAGE */, jsonData, {
|
|
3772
|
+
headers: {
|
|
3773
|
+
"Content-Type": "application/json"
|
|
3774
|
+
}
|
|
3775
|
+
});
|
|
3776
|
+
} catch (error) {
|
|
3777
|
+
console.error("Error when sent message:", error);
|
|
3778
|
+
throw error;
|
|
3779
|
+
}
|
|
3896
3780
|
},
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
method: "get_formview_action",
|
|
3904
|
-
ids: data.id ? [data.id] : [],
|
|
3905
|
-
with_context: data.context
|
|
3906
|
-
};
|
|
3907
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3781
|
+
async getImage({ data }) {
|
|
3782
|
+
try {
|
|
3783
|
+
const env2 = getEnv();
|
|
3784
|
+
return env2.requests.get(
|
|
3785
|
+
`${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
|
|
3786
|
+
{
|
|
3908
3787
|
headers: {
|
|
3909
3788
|
"Content-Type": "application/json"
|
|
3910
3789
|
}
|
|
3911
|
-
}
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
}
|
|
3790
|
+
}
|
|
3791
|
+
);
|
|
3792
|
+
} catch (error) {
|
|
3793
|
+
console.error("Error when sent message:", error);
|
|
3794
|
+
throw error;
|
|
3795
|
+
}
|
|
3917
3796
|
},
|
|
3918
|
-
|
|
3919
|
-
|
|
3797
|
+
async uploadImage({ data }) {
|
|
3798
|
+
try {
|
|
3799
|
+
const env2 = getEnv();
|
|
3800
|
+
return env2.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
|
|
3801
|
+
headers: {
|
|
3802
|
+
"Content-Type": "multipart/form-data"
|
|
3803
|
+
}
|
|
3804
|
+
});
|
|
3805
|
+
} catch (error) {
|
|
3806
|
+
console.error("Error when sent message:", error);
|
|
3807
|
+
throw error;
|
|
3808
|
+
}
|
|
3809
|
+
},
|
|
3810
|
+
async getFormView({ data }) {
|
|
3811
|
+
try {
|
|
3920
3812
|
const env2 = getEnv();
|
|
3921
|
-
const vals = {
|
|
3922
|
-
[data.name]: data.stage_id
|
|
3923
|
-
};
|
|
3924
3813
|
const jsonData = {
|
|
3925
3814
|
model: data.model,
|
|
3926
|
-
method: "
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
allowed_company_ids: [1],
|
|
3930
|
-
uid: 2,
|
|
3931
|
-
search_default_my_ticket: true,
|
|
3932
|
-
search_default_is_open: true
|
|
3933
|
-
},
|
|
3934
|
-
ids: [data.id],
|
|
3935
|
-
kwargs: {
|
|
3936
|
-
vals,
|
|
3937
|
-
specification: {}
|
|
3938
|
-
}
|
|
3815
|
+
method: "get_formview_action",
|
|
3816
|
+
ids: data.id ? [data.id] : [],
|
|
3817
|
+
with_context: data.context
|
|
3939
3818
|
};
|
|
3940
3819
|
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3941
3820
|
headers: {
|
|
3942
3821
|
"Content-Type": "application/json"
|
|
3943
3822
|
}
|
|
3944
3823
|
});
|
|
3824
|
+
} catch (error) {
|
|
3825
|
+
console.error("Error when fetching form view:", error);
|
|
3826
|
+
throw error;
|
|
3827
|
+
}
|
|
3828
|
+
},
|
|
3829
|
+
async changeStatus({ data }) {
|
|
3830
|
+
const env2 = getEnv();
|
|
3831
|
+
const vals = {
|
|
3832
|
+
[data.name]: data.stage_id
|
|
3833
|
+
};
|
|
3834
|
+
const jsonData = {
|
|
3835
|
+
model: data.model,
|
|
3836
|
+
method: "web_save",
|
|
3837
|
+
with_context: {
|
|
3838
|
+
lang: data.lang,
|
|
3839
|
+
allowed_company_ids: [1],
|
|
3840
|
+
uid: 2,
|
|
3841
|
+
search_default_my_ticket: true,
|
|
3842
|
+
search_default_is_open: true
|
|
3843
|
+
},
|
|
3844
|
+
ids: [data.id],
|
|
3845
|
+
kwargs: {
|
|
3846
|
+
vals,
|
|
3847
|
+
specification: {}
|
|
3848
|
+
}
|
|
3849
|
+
};
|
|
3850
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3851
|
+
headers: {
|
|
3852
|
+
"Content-Type": "application/json"
|
|
3853
|
+
}
|
|
3945
3854
|
});
|
|
3946
3855
|
}
|
|
3947
3856
|
};
|
|
@@ -3949,55 +3858,51 @@ var form_service_default = FormService;
|
|
|
3949
3858
|
|
|
3950
3859
|
// src/services/kanban-service/index.ts
|
|
3951
3860
|
var KanbanServices = {
|
|
3952
|
-
getGroups(
|
|
3953
|
-
|
|
3861
|
+
async getGroups({
|
|
3862
|
+
model,
|
|
3863
|
+
width_context
|
|
3864
|
+
}) {
|
|
3865
|
+
const env2 = getEnv();
|
|
3866
|
+
const jsonDataView = {
|
|
3954
3867
|
model,
|
|
3868
|
+
method: "web_read_group",
|
|
3869
|
+
kwargs: {
|
|
3870
|
+
domain: [["stage_id.fold", "=", false]],
|
|
3871
|
+
fields: ["color:sum"],
|
|
3872
|
+
groupby: ["stage_id"]
|
|
3873
|
+
},
|
|
3955
3874
|
width_context
|
|
3956
|
-
}
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
kwargs: {
|
|
3962
|
-
domain: [["stage_id.fold", "=", false]],
|
|
3963
|
-
fields: ["color:sum"],
|
|
3964
|
-
groupby: ["stage_id"]
|
|
3965
|
-
},
|
|
3966
|
-
width_context
|
|
3967
|
-
};
|
|
3968
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
3969
|
-
headers: {
|
|
3970
|
-
"Content-Type": "application/json"
|
|
3971
|
-
}
|
|
3972
|
-
});
|
|
3875
|
+
};
|
|
3876
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
3877
|
+
headers: {
|
|
3878
|
+
"Content-Type": "application/json"
|
|
3879
|
+
}
|
|
3973
3880
|
});
|
|
3974
3881
|
},
|
|
3975
|
-
getProgressBar(
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3882
|
+
async getProgressBar({
|
|
3883
|
+
field,
|
|
3884
|
+
color,
|
|
3885
|
+
model,
|
|
3886
|
+
width_context
|
|
3887
|
+
}) {
|
|
3888
|
+
const env2 = getEnv();
|
|
3889
|
+
const jsonDataView = {
|
|
3979
3890
|
model,
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
domain: [],
|
|
3988
|
-
group_by: "stage_id",
|
|
3989
|
-
progress_bar: {
|
|
3990
|
-
colors: color,
|
|
3991
|
-
field
|
|
3992
|
-
}
|
|
3993
|
-
},
|
|
3994
|
-
width_context
|
|
3995
|
-
};
|
|
3996
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
3997
|
-
headers: {
|
|
3998
|
-
"Content-Type": "application/json"
|
|
3891
|
+
method: "read_progress_bar",
|
|
3892
|
+
kwargs: {
|
|
3893
|
+
domain: [],
|
|
3894
|
+
group_by: "stage_id",
|
|
3895
|
+
progress_bar: {
|
|
3896
|
+
colors: color,
|
|
3897
|
+
field
|
|
3999
3898
|
}
|
|
4000
|
-
}
|
|
3899
|
+
},
|
|
3900
|
+
width_context
|
|
3901
|
+
};
|
|
3902
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
3903
|
+
headers: {
|
|
3904
|
+
"Content-Type": "application/json"
|
|
3905
|
+
}
|
|
4001
3906
|
});
|
|
4002
3907
|
}
|
|
4003
3908
|
};
|
|
@@ -4006,285 +3911,259 @@ var kanban_service_default = KanbanServices;
|
|
|
4006
3911
|
// src/services/model-service/index.ts
|
|
4007
3912
|
var OBJECT_POSITION = 2;
|
|
4008
3913
|
var ModelService = {
|
|
4009
|
-
getListMyBankAccount(
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
}
|
|
4030
|
-
});
|
|
3914
|
+
async getListMyBankAccount({
|
|
3915
|
+
domain,
|
|
3916
|
+
spectification,
|
|
3917
|
+
model
|
|
3918
|
+
}) {
|
|
3919
|
+
const env2 = getEnv();
|
|
3920
|
+
const jsonData = {
|
|
3921
|
+
model,
|
|
3922
|
+
method: "web_search_read",
|
|
3923
|
+
kwargs: {
|
|
3924
|
+
specification: spectification,
|
|
3925
|
+
domain,
|
|
3926
|
+
limit: 100,
|
|
3927
|
+
offset: 0
|
|
3928
|
+
}
|
|
3929
|
+
};
|
|
3930
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3931
|
+
headers: {
|
|
3932
|
+
"Content-Type": "application/json"
|
|
3933
|
+
}
|
|
4031
3934
|
});
|
|
4032
3935
|
},
|
|
4033
|
-
getCurrency() {
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
}
|
|
4053
|
-
});
|
|
3936
|
+
async getCurrency() {
|
|
3937
|
+
const env2 = getEnv();
|
|
3938
|
+
const jsonData = {
|
|
3939
|
+
model: "res.currency",
|
|
3940
|
+
method: "web_search_read",
|
|
3941
|
+
kwargs: {
|
|
3942
|
+
specification: {
|
|
3943
|
+
icon_url: {},
|
|
3944
|
+
name: {}
|
|
3945
|
+
},
|
|
3946
|
+
domain: [["active", "=", true]],
|
|
3947
|
+
limit: 100,
|
|
3948
|
+
offset: 0
|
|
3949
|
+
}
|
|
3950
|
+
};
|
|
3951
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3952
|
+
headers: {
|
|
3953
|
+
"Content-Type": "application/json"
|
|
3954
|
+
}
|
|
4054
3955
|
});
|
|
4055
3956
|
},
|
|
4056
|
-
getConversionRate() {
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
sell: {}
|
|
4070
|
-
}
|
|
3957
|
+
async getConversionRate() {
|
|
3958
|
+
const env2 = getEnv();
|
|
3959
|
+
const jsonData = {
|
|
3960
|
+
model: "res.currency",
|
|
3961
|
+
method: "web_search_read",
|
|
3962
|
+
kwargs: {
|
|
3963
|
+
specification: {
|
|
3964
|
+
name: {},
|
|
3965
|
+
icon_url: {},
|
|
3966
|
+
rate_ids: {
|
|
3967
|
+
fields: {
|
|
3968
|
+
company_rate: {},
|
|
3969
|
+
sell: {}
|
|
4071
3970
|
}
|
|
4072
|
-
}
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
}
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
}
|
|
4083
|
-
});
|
|
4084
|
-
},
|
|
4085
|
-
getAll(_0) {
|
|
4086
|
-
return __async(this, arguments, function* ({ data }) {
|
|
4087
|
-
const env2 = getEnv();
|
|
4088
|
-
const jsonReadGroup = data.type == "calendar" ? { fields: data == null ? void 0 : data.fields } : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
4089
|
-
fields: data.fields,
|
|
4090
|
-
groupby: data.groupby
|
|
4091
|
-
} : {
|
|
4092
|
-
count_limit: 10001,
|
|
4093
|
-
order: data.sort,
|
|
4094
|
-
specification: data.specification
|
|
4095
|
-
};
|
|
4096
|
-
const jsonData = {
|
|
4097
|
-
model: String(data.model),
|
|
4098
|
-
method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
|
|
4099
|
-
ids: data.ids,
|
|
4100
|
-
with_context: data.context,
|
|
4101
|
-
kwargs: __spreadValues({
|
|
4102
|
-
domain: data.domain,
|
|
4103
|
-
limit: data.limit,
|
|
4104
|
-
offset: data.offset
|
|
4105
|
-
}, jsonReadGroup)
|
|
4106
|
-
};
|
|
4107
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4108
|
-
headers: {
|
|
4109
|
-
"Content-Type": "application/json"
|
|
4110
|
-
}
|
|
4111
|
-
});
|
|
3971
|
+
}
|
|
3972
|
+
},
|
|
3973
|
+
domain: [["active", "=", true]],
|
|
3974
|
+
limit: 100,
|
|
3975
|
+
offset: 0
|
|
3976
|
+
}
|
|
3977
|
+
};
|
|
3978
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3979
|
+
headers: {
|
|
3980
|
+
"Content-Type": "application/json"
|
|
3981
|
+
}
|
|
4112
3982
|
});
|
|
4113
3983
|
},
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
3984
|
+
async getAll({ data }) {
|
|
3985
|
+
const env2 = getEnv();
|
|
3986
|
+
const jsonReadGroup = data.type == "calendar" ? { fields: data?.fields } : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
3987
|
+
fields: data.fields,
|
|
3988
|
+
groupby: data.groupby
|
|
3989
|
+
} : {
|
|
3990
|
+
count_limit: 10001,
|
|
3991
|
+
order: data.sort,
|
|
3992
|
+
specification: data.specification
|
|
3993
|
+
};
|
|
3994
|
+
const jsonData = {
|
|
3995
|
+
model: String(data.model),
|
|
3996
|
+
method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
|
|
3997
|
+
ids: data.ids,
|
|
3998
|
+
with_context: data.context,
|
|
3999
|
+
kwargs: {
|
|
4000
|
+
domain: data.domain,
|
|
4001
|
+
limit: data.limit,
|
|
4002
|
+
offset: data.offset,
|
|
4003
|
+
...jsonReadGroup
|
|
4004
|
+
}
|
|
4005
|
+
};
|
|
4006
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4007
|
+
headers: {
|
|
4008
|
+
"Content-Type": "application/json"
|
|
4009
|
+
}
|
|
4010
|
+
});
|
|
4011
|
+
},
|
|
4012
|
+
async getListCalendar({ data }) {
|
|
4013
|
+
const env2 = getEnv();
|
|
4014
|
+
const jsonReadGroup = data.type == "calendar" ? data?.fields : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
4015
|
+
fields: data.fields,
|
|
4016
|
+
groupby: data.groupby
|
|
4017
|
+
} : {
|
|
4018
|
+
count_limit: 10001,
|
|
4019
|
+
order: data.sort,
|
|
4020
|
+
specification: data.specification
|
|
4021
|
+
};
|
|
4022
|
+
const jsonData = {
|
|
4023
|
+
model: String(data.model),
|
|
4024
|
+
method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
|
|
4025
|
+
ids: data.ids,
|
|
4026
|
+
with_context: data.context,
|
|
4027
|
+
kwargs: {
|
|
4028
|
+
domain: data.domain,
|
|
4029
|
+
limit: data.limit,
|
|
4030
|
+
offset: data.offset,
|
|
4118
4031
|
fields: data.fields,
|
|
4119
|
-
|
|
4120
|
-
}
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
model: String(data.model),
|
|
4127
|
-
method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
|
|
4128
|
-
ids: data.ids,
|
|
4129
|
-
with_context: data.context,
|
|
4130
|
-
kwargs: __spreadValues({
|
|
4131
|
-
domain: data.domain,
|
|
4132
|
-
limit: data.limit,
|
|
4133
|
-
offset: data.offset,
|
|
4134
|
-
fields: data.fields
|
|
4135
|
-
}, jsonReadGroup)
|
|
4136
|
-
};
|
|
4137
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4138
|
-
headers: {
|
|
4139
|
-
"Content-Type": "application/json"
|
|
4140
|
-
}
|
|
4141
|
-
});
|
|
4032
|
+
...jsonReadGroup
|
|
4033
|
+
}
|
|
4034
|
+
};
|
|
4035
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4036
|
+
headers: {
|
|
4037
|
+
"Content-Type": "application/json"
|
|
4038
|
+
}
|
|
4142
4039
|
});
|
|
4143
4040
|
},
|
|
4144
|
-
getList(
|
|
4145
|
-
|
|
4041
|
+
async getList({
|
|
4042
|
+
model,
|
|
4043
|
+
ids = [],
|
|
4044
|
+
specification = {},
|
|
4045
|
+
domain = [],
|
|
4046
|
+
offset,
|
|
4047
|
+
order,
|
|
4048
|
+
context = {},
|
|
4049
|
+
limit = 10
|
|
4050
|
+
}) {
|
|
4051
|
+
const env2 = getEnv();
|
|
4052
|
+
const jsonData = {
|
|
4146
4053
|
model,
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
kwargs: {
|
|
4163
|
-
specification,
|
|
4164
|
-
domain,
|
|
4165
|
-
limit,
|
|
4166
|
-
offset,
|
|
4167
|
-
order
|
|
4168
|
-
}
|
|
4169
|
-
};
|
|
4170
|
-
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
4171
|
-
headers: {
|
|
4172
|
-
"Content-Type": "application/json"
|
|
4173
|
-
}
|
|
4174
|
-
});
|
|
4054
|
+
method: "web_search_read" /* WEB_SEARCH_READ */,
|
|
4055
|
+
ids,
|
|
4056
|
+
with_context: context,
|
|
4057
|
+
kwargs: {
|
|
4058
|
+
specification,
|
|
4059
|
+
domain,
|
|
4060
|
+
limit,
|
|
4061
|
+
offset,
|
|
4062
|
+
order
|
|
4063
|
+
}
|
|
4064
|
+
};
|
|
4065
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4066
|
+
headers: {
|
|
4067
|
+
"Content-Type": "application/json"
|
|
4068
|
+
}
|
|
4175
4069
|
});
|
|
4176
4070
|
},
|
|
4177
|
-
getDetail(
|
|
4178
|
-
|
|
4179
|
-
|
|
4071
|
+
async getDetail({
|
|
4072
|
+
ids = [],
|
|
4073
|
+
model,
|
|
4074
|
+
specification,
|
|
4075
|
+
context
|
|
4076
|
+
}) {
|
|
4077
|
+
const env2 = getEnv();
|
|
4078
|
+
const jsonData = {
|
|
4180
4079
|
model,
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
specification
|
|
4193
|
-
}
|
|
4194
|
-
};
|
|
4195
|
-
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
4196
|
-
headers: {
|
|
4197
|
-
"Content-Type": "application/json"
|
|
4198
|
-
}
|
|
4199
|
-
});
|
|
4080
|
+
method: "web_read" /* WEB_READ */,
|
|
4081
|
+
ids,
|
|
4082
|
+
with_context: context,
|
|
4083
|
+
kwargs: {
|
|
4084
|
+
specification
|
|
4085
|
+
}
|
|
4086
|
+
};
|
|
4087
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4088
|
+
headers: {
|
|
4089
|
+
"Content-Type": "application/json"
|
|
4090
|
+
}
|
|
4200
4091
|
});
|
|
4201
4092
|
},
|
|
4202
|
-
save(
|
|
4203
|
-
|
|
4093
|
+
async save({
|
|
4094
|
+
model,
|
|
4095
|
+
ids = [],
|
|
4096
|
+
data = {},
|
|
4097
|
+
specification = {},
|
|
4098
|
+
context = {},
|
|
4099
|
+
path
|
|
4100
|
+
}) {
|
|
4101
|
+
const env2 = getEnv();
|
|
4102
|
+
const jsonData = {
|
|
4204
4103
|
model,
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
ids,
|
|
4218
|
-
kwargs: {
|
|
4219
|
-
vals: data,
|
|
4220
|
-
specification
|
|
4221
|
-
}
|
|
4222
|
-
};
|
|
4223
|
-
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post(path != null ? path : "/call" /* CALL_PATH */, jsonData, {
|
|
4224
|
-
headers: {
|
|
4225
|
-
"Content-Type": "application/json"
|
|
4226
|
-
}
|
|
4227
|
-
});
|
|
4104
|
+
method: "web_save" /* WEB_SAVE */,
|
|
4105
|
+
with_context: context,
|
|
4106
|
+
ids,
|
|
4107
|
+
kwargs: {
|
|
4108
|
+
vals: data,
|
|
4109
|
+
specification
|
|
4110
|
+
}
|
|
4111
|
+
};
|
|
4112
|
+
return env2?.requests?.post(path ?? "/call" /* CALL_PATH */, jsonData, {
|
|
4113
|
+
headers: {
|
|
4114
|
+
"Content-Type": "application/json"
|
|
4115
|
+
}
|
|
4228
4116
|
});
|
|
4229
4117
|
},
|
|
4230
|
-
delete(
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
"Content-Type": "application/json"
|
|
4242
|
-
}
|
|
4243
|
-
});
|
|
4118
|
+
async delete({ ids = [], model }) {
|
|
4119
|
+
const env2 = getEnv();
|
|
4120
|
+
const jsonData = {
|
|
4121
|
+
model,
|
|
4122
|
+
method: "unlink" /* UNLINK */,
|
|
4123
|
+
ids
|
|
4124
|
+
};
|
|
4125
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4126
|
+
headers: {
|
|
4127
|
+
"Content-Type": "application/json"
|
|
4128
|
+
}
|
|
4244
4129
|
});
|
|
4245
4130
|
},
|
|
4246
|
-
onChange(
|
|
4247
|
-
|
|
4248
|
-
|
|
4131
|
+
async onChange({
|
|
4132
|
+
ids = [],
|
|
4133
|
+
model,
|
|
4134
|
+
object,
|
|
4135
|
+
specification,
|
|
4136
|
+
context,
|
|
4137
|
+
fieldChange
|
|
4138
|
+
}) {
|
|
4139
|
+
const env2 = getEnv();
|
|
4140
|
+
const jsonData = {
|
|
4249
4141
|
model,
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
context,
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
object ? object : {},
|
|
4264
|
-
fieldChange ? fieldChange : [],
|
|
4265
|
-
specification
|
|
4266
|
-
]
|
|
4267
|
-
};
|
|
4268
|
-
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
4269
|
-
headers: {
|
|
4270
|
-
"Content-Type": "application/json"
|
|
4271
|
-
}
|
|
4272
|
-
});
|
|
4142
|
+
method: "onchange" /* ONCHANGE */,
|
|
4143
|
+
ids,
|
|
4144
|
+
with_context: context,
|
|
4145
|
+
args: [
|
|
4146
|
+
object ? object : {},
|
|
4147
|
+
fieldChange ? fieldChange : [],
|
|
4148
|
+
specification
|
|
4149
|
+
]
|
|
4150
|
+
};
|
|
4151
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4152
|
+
headers: {
|
|
4153
|
+
"Content-Type": "application/json"
|
|
4154
|
+
}
|
|
4273
4155
|
});
|
|
4274
4156
|
},
|
|
4275
|
-
getListFieldsOnchange(
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
"Content-Type": "application/json"
|
|
4286
|
-
}
|
|
4287
|
-
});
|
|
4157
|
+
async getListFieldsOnchange({ model }) {
|
|
4158
|
+
const env2 = getEnv();
|
|
4159
|
+
const jsonData = {
|
|
4160
|
+
model,
|
|
4161
|
+
method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
|
|
4162
|
+
};
|
|
4163
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4164
|
+
headers: {
|
|
4165
|
+
"Content-Type": "application/json"
|
|
4166
|
+
}
|
|
4288
4167
|
});
|
|
4289
4168
|
},
|
|
4290
4169
|
parseORMOdoo(data) {
|
|
@@ -4298,14 +4177,13 @@ var ModelService = {
|
|
|
4298
4177
|
data[key] = "/";
|
|
4299
4178
|
}
|
|
4300
4179
|
}
|
|
4301
|
-
return
|
|
4180
|
+
return { ...data };
|
|
4302
4181
|
},
|
|
4303
4182
|
toDataJS(data, viewData, model) {
|
|
4304
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
4305
4183
|
for (const key in data) {
|
|
4306
4184
|
if (data[key] === false) {
|
|
4307
4185
|
if (viewData && model) {
|
|
4308
|
-
if (
|
|
4186
|
+
if (viewData?.models?.[model]?.[key]?.type !== "boolean" /* BOOLEAN */) {
|
|
4309
4187
|
data[key] = null;
|
|
4310
4188
|
}
|
|
4311
4189
|
} else {
|
|
@@ -4315,13 +4193,12 @@ var ModelService = {
|
|
|
4315
4193
|
data[key] = "Draft";
|
|
4316
4194
|
} else if (data[key] !== false) {
|
|
4317
4195
|
if (model !== void 0) {
|
|
4318
|
-
if (
|
|
4319
|
-
data[key] = (
|
|
4320
|
-
|
|
4321
|
-
const relation = (_c2 = (_b2 = (_a2 = viewData == null ? void 0 : viewData.models) == null ? void 0 : _a2[model]) == null ? void 0 : _b2[key]) == null ? void 0 : _c2.relation;
|
|
4196
|
+
if (viewData?.models?.[model]?.[key]?.type === "one2many" /* ONE2MANY */ || viewData?.models?.[model]?.[key]?.type === "many2many" /* MANY2MANY */) {
|
|
4197
|
+
data[key] = (data[key] ??= [])?.map((item) => {
|
|
4198
|
+
const relation = viewData?.models?.[model]?.[key]?.relation;
|
|
4322
4199
|
if (relation !== void 0) {
|
|
4323
|
-
if (
|
|
4324
|
-
if (
|
|
4200
|
+
if (viewData?.models?.[relation]) {
|
|
4201
|
+
if (item?.length >= 3) {
|
|
4325
4202
|
return ModelService.toDataJS(
|
|
4326
4203
|
item[OBJECT_POSITION],
|
|
4327
4204
|
viewData,
|
|
@@ -4331,7 +4208,7 @@ var ModelService = {
|
|
|
4331
4208
|
return ModelService.toDataJS(item, viewData, relation);
|
|
4332
4209
|
}
|
|
4333
4210
|
} else {
|
|
4334
|
-
if (
|
|
4211
|
+
if (item?.length >= 3) {
|
|
4335
4212
|
return item[OBJECT_POSITION];
|
|
4336
4213
|
} else {
|
|
4337
4214
|
return item;
|
|
@@ -4343,556 +4220,514 @@ var ModelService = {
|
|
|
4343
4220
|
}
|
|
4344
4221
|
}
|
|
4345
4222
|
}
|
|
4346
|
-
return
|
|
4223
|
+
return { ...data };
|
|
4347
4224
|
}
|
|
4348
4225
|
};
|
|
4349
4226
|
var model_service_default = ModelService;
|
|
4350
4227
|
|
|
4351
4228
|
// src/services/user-service/index.ts
|
|
4352
4229
|
var UserService = {
|
|
4353
|
-
getProfile(path) {
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
}
|
|
4360
|
-
});
|
|
4230
|
+
async getProfile(path) {
|
|
4231
|
+
const env2 = getEnv();
|
|
4232
|
+
return env2?.requests?.get(path ?? "/userinfo" /* PROFILE_PATH */, {
|
|
4233
|
+
headers: {
|
|
4234
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
4235
|
+
}
|
|
4361
4236
|
});
|
|
4362
4237
|
},
|
|
4363
|
-
getUser(
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
display_name: {}
|
|
4389
|
-
}
|
|
4238
|
+
async getUser({ context, id }) {
|
|
4239
|
+
const env2 = getEnv();
|
|
4240
|
+
const jsonData = {
|
|
4241
|
+
model: "res.users",
|
|
4242
|
+
method: "web_read",
|
|
4243
|
+
ids: [id],
|
|
4244
|
+
with_context: context,
|
|
4245
|
+
kwargs: {
|
|
4246
|
+
specification: {
|
|
4247
|
+
display_name: {},
|
|
4248
|
+
image_1920: {},
|
|
4249
|
+
name: {},
|
|
4250
|
+
login: {},
|
|
4251
|
+
email: {},
|
|
4252
|
+
password: {},
|
|
4253
|
+
visible_group_id: {
|
|
4254
|
+
fields: {
|
|
4255
|
+
id: {},
|
|
4256
|
+
display_name: {}
|
|
4257
|
+
}
|
|
4258
|
+
},
|
|
4259
|
+
company_id: {
|
|
4260
|
+
fields: {
|
|
4261
|
+
id: {},
|
|
4262
|
+
display_name: {}
|
|
4390
4263
|
}
|
|
4391
4264
|
}
|
|
4392
4265
|
}
|
|
4393
|
-
}
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
}
|
|
4266
|
+
}
|
|
4267
|
+
};
|
|
4268
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4269
|
+
headers: {
|
|
4270
|
+
"Content-Type": "application/json"
|
|
4271
|
+
}
|
|
4399
4272
|
});
|
|
4400
4273
|
},
|
|
4401
|
-
switchUserLocale:
|
|
4402
|
-
var _a;
|
|
4274
|
+
switchUserLocale: async ({ id, values }) => {
|
|
4403
4275
|
const env2 = getEnv();
|
|
4404
4276
|
const jsonData = {
|
|
4405
4277
|
model: "res.users",
|
|
4406
4278
|
domain: [["id", "=", id]],
|
|
4407
4279
|
values
|
|
4408
4280
|
};
|
|
4409
|
-
return env2
|
|
4281
|
+
return env2?.requests.post(UriConstants?.CREATE_UPDATE_PATH, jsonData, {
|
|
4410
4282
|
headers: {
|
|
4411
4283
|
"Content-Type": "application/json"
|
|
4412
4284
|
}
|
|
4413
4285
|
});
|
|
4414
|
-
}
|
|
4286
|
+
}
|
|
4415
4287
|
};
|
|
4416
4288
|
var user_service_default = UserService;
|
|
4417
4289
|
|
|
4418
4290
|
// src/services/view-service/index.ts
|
|
4419
4291
|
var ViewService = {
|
|
4420
|
-
getView(
|
|
4421
|
-
|
|
4292
|
+
async getView({
|
|
4293
|
+
model,
|
|
4294
|
+
views,
|
|
4295
|
+
context = {},
|
|
4296
|
+
options = {},
|
|
4297
|
+
aid
|
|
4298
|
+
}) {
|
|
4299
|
+
const env2 = getEnv();
|
|
4300
|
+
const defaultOptions = {
|
|
4301
|
+
load_filters: true,
|
|
4302
|
+
toolbar: true,
|
|
4303
|
+
action_id: aid
|
|
4304
|
+
};
|
|
4305
|
+
const jsonDataView = {
|
|
4422
4306
|
model,
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
};
|
|
4435
|
-
const jsonDataView = {
|
|
4436
|
-
model,
|
|
4437
|
-
method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
|
|
4438
|
-
kwargs: {
|
|
4439
|
-
views,
|
|
4440
|
-
options: __spreadValues(__spreadValues({}, options), defaultOptions)
|
|
4441
|
-
},
|
|
4442
|
-
with_context: context
|
|
4443
|
-
};
|
|
4444
|
-
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
4445
|
-
headers: {
|
|
4446
|
-
"Content-Type": "application/json"
|
|
4447
|
-
}
|
|
4448
|
-
});
|
|
4307
|
+
method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
|
|
4308
|
+
kwargs: {
|
|
4309
|
+
views,
|
|
4310
|
+
options: { ...options, ...defaultOptions }
|
|
4311
|
+
},
|
|
4312
|
+
with_context: context
|
|
4313
|
+
};
|
|
4314
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
4315
|
+
headers: {
|
|
4316
|
+
"Content-Type": "application/json"
|
|
4317
|
+
}
|
|
4449
4318
|
});
|
|
4450
4319
|
},
|
|
4451
|
-
getMenu(context) {
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4320
|
+
async getMenu(context) {
|
|
4321
|
+
const env2 = getEnv();
|
|
4322
|
+
const jsonData = {
|
|
4323
|
+
model: "ir.ui.menu" /* MENU */,
|
|
4324
|
+
method: "web_search_read" /* WEB_SEARCH_READ */,
|
|
4325
|
+
ids: [],
|
|
4326
|
+
with_context: context,
|
|
4327
|
+
kwargs: {
|
|
4328
|
+
specification: {
|
|
4329
|
+
active: {},
|
|
4330
|
+
name: {},
|
|
4331
|
+
is_display: {},
|
|
4332
|
+
sequence: {},
|
|
4333
|
+
complete_name: {},
|
|
4334
|
+
action: {
|
|
4335
|
+
fields: {
|
|
4336
|
+
display_name: {},
|
|
4337
|
+
type: {},
|
|
4338
|
+
binding_view_types: {}
|
|
4339
|
+
// res_model: {},
|
|
4340
|
+
}
|
|
4341
|
+
},
|
|
4342
|
+
url_icon: {},
|
|
4343
|
+
web_icon: {},
|
|
4344
|
+
web_icon_data: {},
|
|
4345
|
+
groups_id: {
|
|
4346
|
+
fields: {
|
|
4347
|
+
full_name: {}
|
|
4474
4348
|
},
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4349
|
+
limit: 40,
|
|
4350
|
+
order: ""
|
|
4351
|
+
},
|
|
4352
|
+
display_name: {},
|
|
4353
|
+
child_id: {
|
|
4354
|
+
fields: {
|
|
4355
|
+
active: {},
|
|
4356
|
+
name: {},
|
|
4357
|
+
is_display: {},
|
|
4358
|
+
sequence: {},
|
|
4359
|
+
complete_name: {},
|
|
4360
|
+
action: {
|
|
4361
|
+
fields: {
|
|
4362
|
+
display_name: {},
|
|
4363
|
+
type: {},
|
|
4364
|
+
binding_view_types: {}
|
|
4365
|
+
// res_model: {},
|
|
4366
|
+
}
|
|
4481
4367
|
},
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
active: {},
|
|
4489
|
-
name: {},
|
|
4490
|
-
is_display: {},
|
|
4491
|
-
sequence: {},
|
|
4492
|
-
complete_name: {},
|
|
4493
|
-
action: {
|
|
4494
|
-
fields: {
|
|
4495
|
-
display_name: {},
|
|
4496
|
-
type: {},
|
|
4497
|
-
binding_view_types: {}
|
|
4498
|
-
// res_model: {},
|
|
4499
|
-
}
|
|
4368
|
+
url_icon: {},
|
|
4369
|
+
web_icon: {},
|
|
4370
|
+
web_icon_data: {},
|
|
4371
|
+
groups_id: {
|
|
4372
|
+
fields: {
|
|
4373
|
+
full_name: {}
|
|
4500
4374
|
},
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4375
|
+
limit: 40,
|
|
4376
|
+
order: ""
|
|
4377
|
+
},
|
|
4378
|
+
display_name: {},
|
|
4379
|
+
child_id: {
|
|
4380
|
+
fields: {
|
|
4381
|
+
active: {},
|
|
4382
|
+
name: {},
|
|
4383
|
+
is_display: {},
|
|
4384
|
+
sequence: {},
|
|
4385
|
+
complete_name: {},
|
|
4386
|
+
action: {
|
|
4387
|
+
fields: {
|
|
4388
|
+
display_name: {},
|
|
4389
|
+
type: {},
|
|
4390
|
+
binding_view_types: {}
|
|
4391
|
+
// res_model: {},
|
|
4392
|
+
}
|
|
4507
4393
|
},
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
active: {},
|
|
4515
|
-
name: {},
|
|
4516
|
-
is_display: {},
|
|
4517
|
-
sequence: {},
|
|
4518
|
-
complete_name: {},
|
|
4519
|
-
action: {
|
|
4520
|
-
fields: {
|
|
4521
|
-
display_name: {},
|
|
4522
|
-
type: {},
|
|
4523
|
-
binding_view_types: {}
|
|
4524
|
-
// res_model: {},
|
|
4525
|
-
}
|
|
4394
|
+
url_icon: {},
|
|
4395
|
+
web_icon: {},
|
|
4396
|
+
web_icon_data: {},
|
|
4397
|
+
groups_id: {
|
|
4398
|
+
fields: {
|
|
4399
|
+
full_name: {}
|
|
4526
4400
|
},
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4401
|
+
limit: 40,
|
|
4402
|
+
order: ""
|
|
4403
|
+
},
|
|
4404
|
+
display_name: {},
|
|
4405
|
+
child_id: {
|
|
4406
|
+
fields: {
|
|
4407
|
+
active: {},
|
|
4408
|
+
name: {},
|
|
4409
|
+
is_display: {},
|
|
4410
|
+
sequence: {},
|
|
4411
|
+
complete_name: {},
|
|
4412
|
+
action: {
|
|
4413
|
+
fields: {
|
|
4414
|
+
display_name: {},
|
|
4415
|
+
type: {},
|
|
4416
|
+
binding_view_types: {}
|
|
4417
|
+
// res_model: {},
|
|
4418
|
+
}
|
|
4533
4419
|
},
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
active: {},
|
|
4541
|
-
name: {},
|
|
4542
|
-
is_display: {},
|
|
4543
|
-
sequence: {},
|
|
4544
|
-
complete_name: {},
|
|
4545
|
-
action: {
|
|
4546
|
-
fields: {
|
|
4547
|
-
display_name: {},
|
|
4548
|
-
type: {},
|
|
4549
|
-
binding_view_types: {}
|
|
4550
|
-
// res_model: {},
|
|
4551
|
-
}
|
|
4420
|
+
url_icon: {},
|
|
4421
|
+
web_icon: {},
|
|
4422
|
+
web_icon_data: {},
|
|
4423
|
+
groups_id: {
|
|
4424
|
+
fields: {
|
|
4425
|
+
full_name: {}
|
|
4552
4426
|
},
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
web_icon_data: {},
|
|
4556
|
-
groups_id: {
|
|
4557
|
-
fields: {
|
|
4558
|
-
full_name: {}
|
|
4559
|
-
},
|
|
4560
|
-
limit: 40,
|
|
4561
|
-
order: ""
|
|
4562
|
-
},
|
|
4563
|
-
display_name: {},
|
|
4564
|
-
child_id: {
|
|
4565
|
-
fields: {},
|
|
4566
|
-
limit: 40,
|
|
4567
|
-
order: ""
|
|
4568
|
-
}
|
|
4427
|
+
limit: 40,
|
|
4428
|
+
order: ""
|
|
4569
4429
|
},
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
["parent_id", "=", false]
|
|
4588
|
-
]
|
|
4589
|
-
}
|
|
4590
|
-
};
|
|
4591
|
-
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
4592
|
-
headers: {
|
|
4593
|
-
"Content-Type": "application/json"
|
|
4594
|
-
}
|
|
4595
|
-
});
|
|
4596
|
-
});
|
|
4597
|
-
},
|
|
4598
|
-
getActionDetail(aid, context) {
|
|
4599
|
-
return __async(this, null, function* () {
|
|
4600
|
-
var _a;
|
|
4601
|
-
const env2 = getEnv();
|
|
4602
|
-
const jsonData = {
|
|
4603
|
-
model: "ir.actions.act_window" /* WINDOW_ACTION */,
|
|
4604
|
-
method: "web_read" /* WEB_READ */,
|
|
4605
|
-
ids: [aid],
|
|
4606
|
-
with_context: context,
|
|
4607
|
-
kwargs: {
|
|
4608
|
-
specification: {
|
|
4609
|
-
id: {},
|
|
4610
|
-
name: {},
|
|
4611
|
-
res_model: {},
|
|
4612
|
-
views: {},
|
|
4613
|
-
view_mode: {},
|
|
4614
|
-
mobile_view_mode: {},
|
|
4615
|
-
domain: {},
|
|
4616
|
-
context: {},
|
|
4617
|
-
groups_id: {},
|
|
4618
|
-
search_view_id: {}
|
|
4430
|
+
display_name: {},
|
|
4431
|
+
child_id: {
|
|
4432
|
+
fields: {},
|
|
4433
|
+
limit: 40,
|
|
4434
|
+
order: ""
|
|
4435
|
+
}
|
|
4436
|
+
},
|
|
4437
|
+
limit: 40,
|
|
4438
|
+
order: ""
|
|
4439
|
+
}
|
|
4440
|
+
},
|
|
4441
|
+
limit: 40,
|
|
4442
|
+
order: ""
|
|
4443
|
+
}
|
|
4444
|
+
},
|
|
4445
|
+
limit: 40,
|
|
4446
|
+
order: ""
|
|
4619
4447
|
}
|
|
4620
|
-
}
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
"
|
|
4625
|
-
|
|
4626
|
-
|
|
4448
|
+
},
|
|
4449
|
+
domain: [
|
|
4450
|
+
"&",
|
|
4451
|
+
["is_display", "=", true],
|
|
4452
|
+
"&",
|
|
4453
|
+
["active", "=", true],
|
|
4454
|
+
["parent_id", "=", false]
|
|
4455
|
+
]
|
|
4456
|
+
}
|
|
4457
|
+
};
|
|
4458
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4459
|
+
headers: {
|
|
4460
|
+
"Content-Type": "application/json"
|
|
4461
|
+
}
|
|
4627
4462
|
});
|
|
4628
4463
|
},
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4464
|
+
async getActionDetail(aid, context) {
|
|
4465
|
+
const env2 = getEnv();
|
|
4466
|
+
const jsonData = {
|
|
4467
|
+
model: "ir.actions.act_window" /* WINDOW_ACTION */,
|
|
4468
|
+
method: "web_read" /* WEB_READ */,
|
|
4469
|
+
ids: [aid],
|
|
4470
|
+
with_context: context,
|
|
4471
|
+
kwargs: {
|
|
4472
|
+
specification: {
|
|
4473
|
+
id: {},
|
|
4474
|
+
name: {},
|
|
4475
|
+
res_model: {},
|
|
4476
|
+
views: {},
|
|
4477
|
+
view_mode: {},
|
|
4478
|
+
mobile_view_mode: {},
|
|
4479
|
+
domain: {},
|
|
4480
|
+
context: {},
|
|
4481
|
+
groups_id: {},
|
|
4482
|
+
search_view_id: {}
|
|
4646
4483
|
}
|
|
4647
|
-
}
|
|
4484
|
+
}
|
|
4485
|
+
};
|
|
4486
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4487
|
+
headers: {
|
|
4488
|
+
"Content-Type": "application/json"
|
|
4489
|
+
}
|
|
4648
4490
|
});
|
|
4649
4491
|
},
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
}
|
|
4669
|
-
}
|
|
4670
|
-
};
|
|
4671
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4672
|
-
headers: {
|
|
4673
|
-
"Content-Type": "application/json"
|
|
4674
|
-
}
|
|
4675
|
-
});
|
|
4492
|
+
async getResequence({
|
|
4493
|
+
model,
|
|
4494
|
+
ids,
|
|
4495
|
+
context,
|
|
4496
|
+
offset
|
|
4497
|
+
}) {
|
|
4498
|
+
const env2 = getEnv();
|
|
4499
|
+
const jsonData = {
|
|
4500
|
+
model,
|
|
4501
|
+
with_context: context,
|
|
4502
|
+
ids,
|
|
4503
|
+
field: "sequence",
|
|
4504
|
+
...offset > 0 ? { offset } : {}
|
|
4505
|
+
};
|
|
4506
|
+
return env2?.requests.post("/web/dataset/resequence", jsonData, {
|
|
4507
|
+
headers: {
|
|
4508
|
+
"Content-Type": "application/json"
|
|
4509
|
+
}
|
|
4676
4510
|
});
|
|
4677
4511
|
},
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4512
|
+
async getSelectionItem({ data }) {
|
|
4513
|
+
const env2 = getEnv();
|
|
4514
|
+
const jsonData = {
|
|
4515
|
+
model: data.model,
|
|
4516
|
+
ids: [],
|
|
4517
|
+
method: "get_data_select",
|
|
4518
|
+
with_context: data.context,
|
|
4519
|
+
kwargs: {
|
|
4520
|
+
count_limit: 10001,
|
|
4521
|
+
domain: data.domain ? data.domain : [],
|
|
4522
|
+
offset: 0,
|
|
4523
|
+
order: "",
|
|
4524
|
+
specification: data?.specification ?? {
|
|
4525
|
+
id: {},
|
|
4526
|
+
name: {},
|
|
4527
|
+
display_name: {}
|
|
4688
4528
|
}
|
|
4689
|
-
|
|
4529
|
+
}
|
|
4530
|
+
};
|
|
4531
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4532
|
+
headers: {
|
|
4533
|
+
"Content-Type": "application/json"
|
|
4534
|
+
}
|
|
4690
4535
|
});
|
|
4691
4536
|
},
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4537
|
+
async loadMessages() {
|
|
4538
|
+
const env2 = getEnv();
|
|
4539
|
+
return env2.requests.post(
|
|
4540
|
+
"/load_message_failures" /* LOAD_MESSAGE */,
|
|
4541
|
+
{},
|
|
4542
|
+
{
|
|
4698
4543
|
headers: {
|
|
4699
4544
|
"Content-Type": "application/json"
|
|
4700
4545
|
}
|
|
4701
|
-
}
|
|
4546
|
+
}
|
|
4547
|
+
);
|
|
4548
|
+
},
|
|
4549
|
+
async getVersion() {
|
|
4550
|
+
const env2 = getEnv();
|
|
4551
|
+
return env2?.requests.get("", {
|
|
4552
|
+
headers: {
|
|
4553
|
+
"Content-Type": "application/json"
|
|
4554
|
+
}
|
|
4702
4555
|
});
|
|
4703
4556
|
},
|
|
4704
|
-
get2FAMethods(
|
|
4705
|
-
|
|
4557
|
+
async get2FAMethods({
|
|
4558
|
+
method,
|
|
4559
|
+
with_context
|
|
4560
|
+
}) {
|
|
4561
|
+
const env2 = getEnv();
|
|
4562
|
+
const jsonData = {
|
|
4706
4563
|
method,
|
|
4707
4564
|
with_context
|
|
4708
|
-
}
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
};
|
|
4714
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4715
|
-
headers: {
|
|
4716
|
-
"Content-Type": "application/json"
|
|
4717
|
-
}
|
|
4718
|
-
});
|
|
4565
|
+
};
|
|
4566
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4567
|
+
headers: {
|
|
4568
|
+
"Content-Type": "application/json"
|
|
4569
|
+
}
|
|
4719
4570
|
});
|
|
4720
4571
|
},
|
|
4721
|
-
verify2FA(
|
|
4722
|
-
|
|
4572
|
+
async verify2FA({
|
|
4573
|
+
method,
|
|
4574
|
+
with_context,
|
|
4575
|
+
code,
|
|
4576
|
+
device,
|
|
4577
|
+
location
|
|
4578
|
+
}) {
|
|
4579
|
+
const env2 = getEnv();
|
|
4580
|
+
const jsonData = {
|
|
4723
4581
|
method,
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
},
|
|
4739
|
-
with_context
|
|
4740
|
-
};
|
|
4741
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4742
|
-
headers: {
|
|
4743
|
-
"Content-Type": "application/json"
|
|
4744
|
-
},
|
|
4745
|
-
withCredentials: true
|
|
4746
|
-
});
|
|
4582
|
+
kwargs: {
|
|
4583
|
+
vals: {
|
|
4584
|
+
code,
|
|
4585
|
+
device,
|
|
4586
|
+
location
|
|
4587
|
+
}
|
|
4588
|
+
},
|
|
4589
|
+
with_context
|
|
4590
|
+
};
|
|
4591
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4592
|
+
headers: {
|
|
4593
|
+
"Content-Type": "application/json"
|
|
4594
|
+
},
|
|
4595
|
+
withCredentials: true
|
|
4747
4596
|
});
|
|
4748
4597
|
},
|
|
4749
|
-
signInSSO(
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4598
|
+
async signInSSO({
|
|
4599
|
+
redirect_uri,
|
|
4600
|
+
state,
|
|
4601
|
+
client_id,
|
|
4602
|
+
response_type,
|
|
4603
|
+
path
|
|
4604
|
+
}) {
|
|
4605
|
+
const env2 = getEnv();
|
|
4606
|
+
const params = new URLSearchParams({
|
|
4754
4607
|
response_type,
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
}
|
|
4764
|
-
|
|
4765
|
-
return env2 == null ? void 0 : env2.requests.get(url, {
|
|
4766
|
-
headers: {
|
|
4767
|
-
"Content-Type": "application/json"
|
|
4768
|
-
},
|
|
4769
|
-
withCredentials: true
|
|
4770
|
-
});
|
|
4608
|
+
client_id,
|
|
4609
|
+
redirect_uri,
|
|
4610
|
+
state
|
|
4611
|
+
});
|
|
4612
|
+
const url = `${path}?${params.toString()}`;
|
|
4613
|
+
return env2?.requests.get(url, {
|
|
4614
|
+
headers: {
|
|
4615
|
+
"Content-Type": "application/json"
|
|
4616
|
+
},
|
|
4617
|
+
withCredentials: true
|
|
4771
4618
|
});
|
|
4772
4619
|
},
|
|
4773
|
-
grantAccess(
|
|
4774
|
-
|
|
4620
|
+
async grantAccess({
|
|
4621
|
+
redirect_uri,
|
|
4622
|
+
state,
|
|
4623
|
+
client_id,
|
|
4624
|
+
scopes
|
|
4625
|
+
}) {
|
|
4626
|
+
const env2 = getEnv();
|
|
4627
|
+
const jsonData = {
|
|
4775
4628
|
redirect_uri,
|
|
4776
4629
|
state,
|
|
4777
4630
|
client_id,
|
|
4778
4631
|
scopes
|
|
4779
|
-
}
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
scopes
|
|
4786
|
-
};
|
|
4787
|
-
return env2 == null ? void 0 : env2.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
|
|
4788
|
-
headers: {
|
|
4789
|
-
"Content-Type": "application/json"
|
|
4790
|
-
},
|
|
4791
|
-
withCredentials: true
|
|
4792
|
-
});
|
|
4632
|
+
};
|
|
4633
|
+
return env2?.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
|
|
4634
|
+
headers: {
|
|
4635
|
+
"Content-Type": "application/json"
|
|
4636
|
+
},
|
|
4637
|
+
withCredentials: true
|
|
4793
4638
|
});
|
|
4794
4639
|
},
|
|
4795
|
-
getFieldsViewSecurity(
|
|
4796
|
-
|
|
4640
|
+
async getFieldsViewSecurity({
|
|
4641
|
+
method,
|
|
4642
|
+
token,
|
|
4643
|
+
views
|
|
4644
|
+
}) {
|
|
4645
|
+
const env2 = getEnv();
|
|
4646
|
+
const jsonData = {
|
|
4797
4647
|
method,
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
}
|
|
4810
|
-
};
|
|
4811
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4812
|
-
headers: {
|
|
4813
|
-
"Content-Type": "application/json"
|
|
4814
|
-
}
|
|
4815
|
-
});
|
|
4648
|
+
kwargs: {
|
|
4649
|
+
views
|
|
4650
|
+
},
|
|
4651
|
+
with_context: {
|
|
4652
|
+
token
|
|
4653
|
+
}
|
|
4654
|
+
};
|
|
4655
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4656
|
+
headers: {
|
|
4657
|
+
"Content-Type": "application/json"
|
|
4658
|
+
}
|
|
4816
4659
|
});
|
|
4817
4660
|
},
|
|
4818
|
-
settingsWebRead2fa(
|
|
4819
|
-
|
|
4661
|
+
async settingsWebRead2fa({
|
|
4662
|
+
method,
|
|
4663
|
+
model,
|
|
4664
|
+
kwargs,
|
|
4665
|
+
token
|
|
4666
|
+
}) {
|
|
4667
|
+
const env2 = getEnv();
|
|
4668
|
+
const jsonData = {
|
|
4820
4669
|
method,
|
|
4821
4670
|
model,
|
|
4822
4671
|
kwargs,
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
token
|
|
4832
|
-
}
|
|
4833
|
-
};
|
|
4834
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4835
|
-
headers: {
|
|
4836
|
-
"Content-Type": "application/json"
|
|
4837
|
-
}
|
|
4838
|
-
});
|
|
4672
|
+
with_context: {
|
|
4673
|
+
token
|
|
4674
|
+
}
|
|
4675
|
+
};
|
|
4676
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4677
|
+
headers: {
|
|
4678
|
+
"Content-Type": "application/json"
|
|
4679
|
+
}
|
|
4839
4680
|
});
|
|
4840
4681
|
},
|
|
4841
|
-
requestSetupTotp(
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
}
|
|
4854
|
-
});
|
|
4682
|
+
async requestSetupTotp({ method, token }) {
|
|
4683
|
+
const env2 = getEnv();
|
|
4684
|
+
const jsonData = {
|
|
4685
|
+
method,
|
|
4686
|
+
with_context: {
|
|
4687
|
+
token
|
|
4688
|
+
}
|
|
4689
|
+
};
|
|
4690
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4691
|
+
headers: {
|
|
4692
|
+
"Content-Type": "application/json"
|
|
4693
|
+
}
|
|
4855
4694
|
});
|
|
4856
4695
|
},
|
|
4857
|
-
verifyTotp(
|
|
4858
|
-
|
|
4696
|
+
async verifyTotp({
|
|
4697
|
+
method,
|
|
4698
|
+
action_token,
|
|
4699
|
+
code
|
|
4700
|
+
}) {
|
|
4701
|
+
const env2 = getEnv();
|
|
4702
|
+
const jsonData = {
|
|
4859
4703
|
method,
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
const env2 = getEnv();
|
|
4864
|
-
const jsonData = {
|
|
4865
|
-
method,
|
|
4866
|
-
kwargs: {
|
|
4867
|
-
vals: {
|
|
4868
|
-
code
|
|
4869
|
-
}
|
|
4870
|
-
},
|
|
4871
|
-
with_context: {
|
|
4872
|
-
action_token
|
|
4873
|
-
}
|
|
4874
|
-
};
|
|
4875
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4876
|
-
headers: {
|
|
4877
|
-
"Content-Type": "application/json"
|
|
4704
|
+
kwargs: {
|
|
4705
|
+
vals: {
|
|
4706
|
+
code
|
|
4878
4707
|
}
|
|
4879
|
-
}
|
|
4708
|
+
},
|
|
4709
|
+
with_context: {
|
|
4710
|
+
action_token
|
|
4711
|
+
}
|
|
4712
|
+
};
|
|
4713
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4714
|
+
headers: {
|
|
4715
|
+
"Content-Type": "application/json"
|
|
4716
|
+
}
|
|
4880
4717
|
});
|
|
4881
4718
|
},
|
|
4882
|
-
removeTotpSetUp(
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
}
|
|
4895
|
-
});
|
|
4719
|
+
async removeTotpSetUp({ method, token }) {
|
|
4720
|
+
const env2 = getEnv();
|
|
4721
|
+
const jsonData = {
|
|
4722
|
+
method,
|
|
4723
|
+
with_context: {
|
|
4724
|
+
token
|
|
4725
|
+
}
|
|
4726
|
+
};
|
|
4727
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4728
|
+
headers: {
|
|
4729
|
+
"Content-Type": "application/json"
|
|
4730
|
+
}
|
|
4896
4731
|
});
|
|
4897
4732
|
}
|
|
4898
4733
|
};
|
|
@@ -4928,7 +4763,7 @@ var import_react_query3 = require("@tanstack/react-query");
|
|
|
4928
4763
|
var useGetProvider = () => {
|
|
4929
4764
|
return (0, import_react_query3.useMutation)({
|
|
4930
4765
|
mutationFn: (data) => {
|
|
4931
|
-
return auth_service_default.getProviders(data
|
|
4766
|
+
return auth_service_default.getProviders(data?.db);
|
|
4932
4767
|
}
|
|
4933
4768
|
});
|
|
4934
4769
|
};
|
|
@@ -5428,6 +5263,10 @@ var use_get_list_my_bank_account_default = useGetListMyBankAccount;
|
|
|
5428
5263
|
|
|
5429
5264
|
// src/models/base-model/index.ts
|
|
5430
5265
|
var BaseModel = class {
|
|
5266
|
+
name;
|
|
5267
|
+
view;
|
|
5268
|
+
actContext;
|
|
5269
|
+
fields;
|
|
5431
5270
|
constructor(init) {
|
|
5432
5271
|
this.name = init.name;
|
|
5433
5272
|
this.view = init.view;
|
|
@@ -5442,22 +5281,21 @@ var BaseModel = class {
|
|
|
5442
5281
|
modelRoot
|
|
5443
5282
|
}) {
|
|
5444
5283
|
if (Array.isArray(fields)) {
|
|
5445
|
-
let spec =
|
|
5284
|
+
let spec = { ...specification };
|
|
5446
5285
|
fields.forEach((field) => {
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
const
|
|
5452
|
-
const modelRelation = modelsData == null ? void 0 : modelsData[relation];
|
|
5286
|
+
if (!field?.type_co || field?.name && field?.type_co === "field" /* FIELD */) {
|
|
5287
|
+
if (modelsData?.[model]?.[field?.name]) {
|
|
5288
|
+
if (modelsData?.[model]?.[field?.name]?.type === "one2many" /* ONE2MANY */ || modelsData?.[model]?.[field?.name]?.type === "many2many" /* MANY2MANY */) {
|
|
5289
|
+
const relation = modelsData?.[model]?.[field?.name]?.relation;
|
|
5290
|
+
const modelRelation = modelsData?.[relation];
|
|
5453
5291
|
if (modelRelation) {
|
|
5454
|
-
spec[field
|
|
5292
|
+
spec[field?.name] = {
|
|
5455
5293
|
fields: {}
|
|
5456
5294
|
};
|
|
5457
5295
|
if (modelRoot && modelRoot === relation) {
|
|
5458
|
-
spec[field
|
|
5296
|
+
spec[field?.name].fields = { id: {} };
|
|
5459
5297
|
} else {
|
|
5460
|
-
spec[field
|
|
5298
|
+
spec[field?.name].fields = this.getSpecificationByFields({
|
|
5461
5299
|
fields: Object.values(modelRelation),
|
|
5462
5300
|
specification: {},
|
|
5463
5301
|
modelsData,
|
|
@@ -5466,42 +5304,45 @@ var BaseModel = class {
|
|
|
5466
5304
|
});
|
|
5467
5305
|
}
|
|
5468
5306
|
} else {
|
|
5469
|
-
spec[field
|
|
5307
|
+
spec[field?.name] = {
|
|
5470
5308
|
fields: {
|
|
5471
5309
|
id: {},
|
|
5472
5310
|
display_name: {}
|
|
5473
5311
|
}
|
|
5474
5312
|
};
|
|
5475
5313
|
}
|
|
5476
|
-
} else if (
|
|
5477
|
-
spec[field
|
|
5478
|
-
fields:
|
|
5314
|
+
} else if (modelsData?.[model]?.[field?.name]?.type === "many2one" /* MANY2ONE */) {
|
|
5315
|
+
spec[field?.name] = {
|
|
5316
|
+
fields: {
|
|
5479
5317
|
id: {},
|
|
5480
|
-
display_name: {}
|
|
5481
|
-
|
|
5318
|
+
display_name: {},
|
|
5319
|
+
...WIDGETAVATAR[field?.widget] ? { image_256: {} } : {},
|
|
5320
|
+
...field?.name === "currency_id" && fields?.find((item) => item?.widget === "monetary") ? { symbol: {} } : {},
|
|
5321
|
+
...field?.widget === "many2many_binary" ? { mimetype: {} } : {}
|
|
5322
|
+
}
|
|
5482
5323
|
};
|
|
5483
5324
|
} else {
|
|
5484
|
-
spec[field
|
|
5325
|
+
spec[field?.name] = {};
|
|
5485
5326
|
}
|
|
5486
5327
|
}
|
|
5487
|
-
} else if (
|
|
5328
|
+
} else if (field?.type_co === "group" /* GROUP */ || field?.type_co === "div" /* DIV */ || field?.type_co === "span" /* SPAN */) {
|
|
5488
5329
|
const specGroup = this.getSpecificationByFields({
|
|
5489
|
-
fields: field
|
|
5330
|
+
fields: field?.fields,
|
|
5490
5331
|
specification: spec,
|
|
5491
5332
|
modelsData,
|
|
5492
5333
|
model
|
|
5493
5334
|
});
|
|
5494
|
-
spec =
|
|
5495
|
-
} else if (
|
|
5496
|
-
const relation =
|
|
5335
|
+
spec = { ...spec, ...specGroup };
|
|
5336
|
+
} else if (field?.type_co === "tree" /* TREE */ || field?.type_co === "list" /* LIST */) {
|
|
5337
|
+
const relation = modelsData?.[model]?.[field?.name]?.relation;
|
|
5497
5338
|
const specTreee = this.getSpecificationByFields({
|
|
5498
|
-
fields: field
|
|
5339
|
+
fields: field?.fields,
|
|
5499
5340
|
specification: {},
|
|
5500
5341
|
modelsData,
|
|
5501
5342
|
model: relation,
|
|
5502
5343
|
modelRoot: model
|
|
5503
5344
|
});
|
|
5504
|
-
spec =
|
|
5345
|
+
spec = { ...spec, [field?.name]: { fields: specTreee } };
|
|
5505
5346
|
}
|
|
5506
5347
|
});
|
|
5507
5348
|
return spec;
|
|
@@ -5510,19 +5351,16 @@ var BaseModel = class {
|
|
|
5510
5351
|
}
|
|
5511
5352
|
}
|
|
5512
5353
|
getTreeProps() {
|
|
5513
|
-
|
|
5514
|
-
const props = ((_b = (_a = this.view) == null ? void 0 : _a.views) == null ? void 0 : _b.list) || {};
|
|
5354
|
+
const props = this.view?.views?.list || {};
|
|
5515
5355
|
return props;
|
|
5516
5356
|
}
|
|
5517
5357
|
getTreeFields() {
|
|
5518
|
-
|
|
5519
|
-
const fields = ((_c = (_b = (_a = this.view) == null ? void 0 : _a.views) == null ? void 0 : _b.list) == null ? void 0 : _c.fields) || [];
|
|
5358
|
+
const fields = this.view?.views?.list?.fields || [];
|
|
5520
5359
|
return fields;
|
|
5521
5360
|
}
|
|
5522
5361
|
getSpecification() {
|
|
5523
|
-
var _a;
|
|
5524
5362
|
const specInit = {};
|
|
5525
|
-
const modelData =
|
|
5363
|
+
const modelData = this.view?.models || {};
|
|
5526
5364
|
const specification = this.getSpecificationByFields({
|
|
5527
5365
|
fields: this.fields,
|
|
5528
5366
|
specification: specInit,
|
|
@@ -5538,7 +5376,7 @@ var base_model_default = BaseModel;
|
|
|
5538
5376
|
// src/hooks/model/use-model.ts
|
|
5539
5377
|
var useModel = () => {
|
|
5540
5378
|
const initModel = (modelData) => {
|
|
5541
|
-
switch (modelData
|
|
5379
|
+
switch (modelData?.name) {
|
|
5542
5380
|
default:
|
|
5543
5381
|
return new base_model_default(modelData);
|
|
5544
5382
|
}
|
|
@@ -5683,22 +5521,22 @@ var useGetActionDetail = ({
|
|
|
5683
5521
|
}) => {
|
|
5684
5522
|
const data = {
|
|
5685
5523
|
id,
|
|
5686
|
-
model: model
|
|
5524
|
+
model: model ?? "",
|
|
5687
5525
|
context
|
|
5688
5526
|
};
|
|
5689
5527
|
return (0, import_react_query43.useQuery)({
|
|
5690
5528
|
queryKey,
|
|
5691
|
-
queryFn: () =>
|
|
5529
|
+
queryFn: async () => {
|
|
5692
5530
|
if (aid) {
|
|
5693
|
-
const res =
|
|
5531
|
+
const res = await view_service_default.getActionDetail(aid, context);
|
|
5694
5532
|
if (res && res.length > 0) {
|
|
5695
5533
|
return res[0];
|
|
5696
5534
|
}
|
|
5697
5535
|
} else {
|
|
5698
|
-
const res =
|
|
5536
|
+
const res = await form_service_default.getFormView({ data });
|
|
5699
5537
|
return res;
|
|
5700
5538
|
}
|
|
5701
|
-
}
|
|
5539
|
+
},
|
|
5702
5540
|
enabled,
|
|
5703
5541
|
refetchOnWindowFocus: false,
|
|
5704
5542
|
staleTime: Infinity
|
|
@@ -5770,9 +5608,8 @@ var useGetMenu = (context, enabled) => {
|
|
|
5770
5608
|
return (0, import_react_query47.useQuery)({
|
|
5771
5609
|
queryKey: ["menus" /* MENU */, context],
|
|
5772
5610
|
queryFn: () => view_service_default.getMenu(context).then((res) => {
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
return res == null ? void 0 : res.records;
|
|
5611
|
+
if (res && res?.records && res?.records?.length > 0) {
|
|
5612
|
+
return res?.records;
|
|
5776
5613
|
}
|
|
5777
5614
|
return [];
|
|
5778
5615
|
}),
|