@fctc/interface-logic 1.5.2 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/configs.js +107 -96
- package/dist/configs.mjs +108 -96
- package/dist/environment.js +137 -122
- package/dist/environment.mjs +140 -122
- package/dist/hooks.js +1556 -1393
- package/dist/hooks.mjs +1559 -1393
- package/dist/provider.d.mts +4 -3
- package/dist/provider.d.ts +4 -3
- package/dist/provider.js +562 -509
- package/dist/provider.mjs +565 -509
- package/dist/services.js +1529 -1364
- package/dist/services.mjs +1524 -1356
- package/dist/store.js +19 -5
- package/dist/store.mjs +22 -5
- package/dist/utils.js +116 -94
- package/dist/utils.mjs +119 -94
- package/package.json +1 -1
package/dist/hooks.mjs
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __pow = Math.pow;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
+
var __async = (__this, __arguments, generator) => {
|
|
22
|
+
return new Promise((resolve, reject) => {
|
|
23
|
+
var fulfilled = (value) => {
|
|
24
|
+
try {
|
|
25
|
+
step(generator.next(value));
|
|
26
|
+
} catch (e) {
|
|
27
|
+
reject(e);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
var rejected = (value) => {
|
|
31
|
+
try {
|
|
32
|
+
step(generator.throw(value));
|
|
33
|
+
} catch (e) {
|
|
34
|
+
reject(e);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
38
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
|
|
1
42
|
// src/hooks/auth/use-forgot-password.ts
|
|
2
43
|
import { useMutation } from "@tanstack/react-query";
|
|
3
44
|
|
|
@@ -1122,22 +1163,6 @@ var PyRelativeDelta = class _PyRelativeDelta {
|
|
|
1122
1163
|
this.microsecond = params.microsecond;
|
|
1123
1164
|
this.weekday = params.weekday;
|
|
1124
1165
|
}
|
|
1125
|
-
years;
|
|
1126
|
-
months;
|
|
1127
|
-
days;
|
|
1128
|
-
hours;
|
|
1129
|
-
minutes;
|
|
1130
|
-
seconds;
|
|
1131
|
-
microseconds;
|
|
1132
|
-
leapDays;
|
|
1133
|
-
year;
|
|
1134
|
-
month;
|
|
1135
|
-
day;
|
|
1136
|
-
hour;
|
|
1137
|
-
minute;
|
|
1138
|
-
second;
|
|
1139
|
-
microsecond;
|
|
1140
|
-
weekday;
|
|
1141
1166
|
negate() {
|
|
1142
1167
|
return new _PyRelativeDelta(this, -1);
|
|
1143
1168
|
}
|
|
@@ -1252,7 +1277,7 @@ function execOnIterable(iterable, func) {
|
|
|
1252
1277
|
if (typeof iterable === "object" && !Array.isArray(iterable) && !(iterable instanceof Set)) {
|
|
1253
1278
|
iterable = Object.keys(iterable);
|
|
1254
1279
|
}
|
|
1255
|
-
if (typeof iterable
|
|
1280
|
+
if (typeof (iterable == null ? void 0 : iterable[Symbol.iterator]) !== "function") {
|
|
1256
1281
|
throw new EvaluationError("value not iterable");
|
|
1257
1282
|
}
|
|
1258
1283
|
return func(iterable);
|
|
@@ -1575,7 +1600,7 @@ function applyBinaryOp(ast, context) {
|
|
|
1575
1600
|
}
|
|
1576
1601
|
return Math.floor(left / right);
|
|
1577
1602
|
case "**":
|
|
1578
|
-
return left
|
|
1603
|
+
return __pow(left, right);
|
|
1579
1604
|
case "==":
|
|
1580
1605
|
return isEqual(left, right);
|
|
1581
1606
|
case "<>":
|
|
@@ -1697,7 +1722,7 @@ function evaluate(ast, context = {}) {
|
|
|
1697
1722
|
const dicts = /* @__PURE__ */ new Set();
|
|
1698
1723
|
let pyContext;
|
|
1699
1724
|
const evalContext = Object.create(context);
|
|
1700
|
-
if (!evalContext
|
|
1725
|
+
if (!(evalContext == null ? void 0 : evalContext.context)) {
|
|
1701
1726
|
Object.defineProperty(evalContext, "context", {
|
|
1702
1727
|
get() {
|
|
1703
1728
|
if (!pyContext) {
|
|
@@ -1708,17 +1733,18 @@ function evaluate(ast, context = {}) {
|
|
|
1708
1733
|
});
|
|
1709
1734
|
}
|
|
1710
1735
|
function _innerEvaluate(ast2) {
|
|
1711
|
-
|
|
1736
|
+
var _a, _b, _c;
|
|
1737
|
+
switch (ast2 == null ? void 0 : ast2.type) {
|
|
1712
1738
|
case 0:
|
|
1713
1739
|
// Number
|
|
1714
1740
|
case 1:
|
|
1715
1741
|
return ast2.value;
|
|
1716
1742
|
case 5:
|
|
1717
1743
|
if (ast2.value in evalContext) {
|
|
1718
|
-
if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]
|
|
1719
|
-
return evalContext[ast2.value]
|
|
1744
|
+
if (typeof evalContext[ast2.value] === "object" && ((_a = evalContext[ast2.value]) == null ? void 0 : _a.id)) {
|
|
1745
|
+
return (_b = evalContext[ast2.value]) == null ? void 0 : _b.id;
|
|
1720
1746
|
}
|
|
1721
|
-
return evalContext[ast2.value]
|
|
1747
|
+
return (_c = evalContext[ast2.value]) != null ? _c : false;
|
|
1722
1748
|
} else if (ast2.value in BUILTINS) {
|
|
1723
1749
|
return BUILTINS[ast2.value];
|
|
1724
1750
|
} else {
|
|
@@ -1755,7 +1781,7 @@ function evaluate(ast, context = {}) {
|
|
|
1755
1781
|
const args = ast2.args.map(_evaluate);
|
|
1756
1782
|
const kwargs = {};
|
|
1757
1783
|
for (const kwarg in ast2.kwargs) {
|
|
1758
|
-
kwargs[kwarg] = _evaluate(ast2
|
|
1784
|
+
kwargs[kwarg] = _evaluate(ast2 == null ? void 0 : ast2.kwargs[kwarg]);
|
|
1759
1785
|
}
|
|
1760
1786
|
if (fnValue === PyDate || fnValue === PyDateTime || fnValue === PyTime || fnValue === PyRelativeDelta || fnValue === PyTimeDelta) {
|
|
1761
1787
|
return fnValue.create(...args, kwargs);
|
|
@@ -1834,9 +1860,25 @@ function escapeRegExp(str) {
|
|
|
1834
1860
|
var InvalidDomainError = class extends Error {
|
|
1835
1861
|
};
|
|
1836
1862
|
var Domain = class _Domain {
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1863
|
+
constructor(descr = []) {
|
|
1864
|
+
this.ast = { type: -1, value: null };
|
|
1865
|
+
if (descr instanceof _Domain) {
|
|
1866
|
+
return new _Domain(descr.toString());
|
|
1867
|
+
} else {
|
|
1868
|
+
let rawAST;
|
|
1869
|
+
try {
|
|
1870
|
+
rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
|
|
1871
|
+
} catch (error) {
|
|
1872
|
+
throw new InvalidDomainError(
|
|
1873
|
+
`Invalid domain representation: ${descr}`,
|
|
1874
|
+
{
|
|
1875
|
+
cause: error
|
|
1876
|
+
}
|
|
1877
|
+
);
|
|
1878
|
+
}
|
|
1879
|
+
this.ast = normalizeDomainAST(rawAST);
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1840
1882
|
static combine(domains, operator) {
|
|
1841
1883
|
if (domains.length === 0) {
|
|
1842
1884
|
return new _Domain([]);
|
|
@@ -1915,24 +1957,6 @@ var Domain = class _Domain {
|
|
|
1915
1957
|
processLeaf(d.ast.value, 0, "&", newDomain);
|
|
1916
1958
|
return newDomain;
|
|
1917
1959
|
}
|
|
1918
|
-
constructor(descr = []) {
|
|
1919
|
-
if (descr instanceof _Domain) {
|
|
1920
|
-
return new _Domain(descr.toString());
|
|
1921
|
-
} else {
|
|
1922
|
-
let rawAST;
|
|
1923
|
-
try {
|
|
1924
|
-
rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
|
|
1925
|
-
} catch (error) {
|
|
1926
|
-
throw new InvalidDomainError(
|
|
1927
|
-
`Invalid domain representation: ${descr}`,
|
|
1928
|
-
{
|
|
1929
|
-
cause: error
|
|
1930
|
-
}
|
|
1931
|
-
);
|
|
1932
|
-
}
|
|
1933
|
-
this.ast = normalizeDomainAST(rawAST);
|
|
1934
|
-
}
|
|
1935
|
-
}
|
|
1936
1960
|
contains(record) {
|
|
1937
1961
|
const expr = evaluate(this.ast, record);
|
|
1938
1962
|
return matchDomain(record, expr);
|
|
@@ -1951,7 +1975,7 @@ var Domain = class _Domain {
|
|
|
1951
1975
|
return evaluatedAsList;
|
|
1952
1976
|
}
|
|
1953
1977
|
return this.toString();
|
|
1954
|
-
} catch {
|
|
1978
|
+
} catch (e) {
|
|
1955
1979
|
return this.toString();
|
|
1956
1980
|
}
|
|
1957
1981
|
}
|
|
@@ -2194,22 +2218,22 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
|
|
|
2194
2218
|
|
|
2195
2219
|
// src/utils/storage/local-storage.ts
|
|
2196
2220
|
var localStorageUtils = () => {
|
|
2197
|
-
const setToken =
|
|
2221
|
+
const setToken = (access_token) => __async(null, null, function* () {
|
|
2198
2222
|
localStorage.setItem("accessToken", access_token);
|
|
2199
|
-
};
|
|
2200
|
-
const setRefreshToken =
|
|
2223
|
+
});
|
|
2224
|
+
const setRefreshToken = (refresh_token) => __async(null, null, function* () {
|
|
2201
2225
|
localStorage.setItem("refreshToken", refresh_token);
|
|
2202
|
-
};
|
|
2203
|
-
const getAccessToken =
|
|
2226
|
+
});
|
|
2227
|
+
const getAccessToken = () => __async(null, null, function* () {
|
|
2204
2228
|
return localStorage.getItem("accessToken");
|
|
2205
|
-
};
|
|
2206
|
-
const getRefreshToken =
|
|
2229
|
+
});
|
|
2230
|
+
const getRefreshToken = () => __async(null, null, function* () {
|
|
2207
2231
|
return localStorage.getItem("refreshToken");
|
|
2208
|
-
};
|
|
2209
|
-
const clearToken =
|
|
2232
|
+
});
|
|
2233
|
+
const clearToken = () => __async(null, null, function* () {
|
|
2210
2234
|
localStorage.removeItem("accessToken");
|
|
2211
2235
|
localStorage.removeItem("refreshToken");
|
|
2212
|
-
};
|
|
2236
|
+
});
|
|
2213
2237
|
return {
|
|
2214
2238
|
setToken,
|
|
2215
2239
|
setRefreshToken,
|
|
@@ -2221,9 +2245,9 @@ var localStorageUtils = () => {
|
|
|
2221
2245
|
|
|
2222
2246
|
// src/utils/storage/session-storage.ts
|
|
2223
2247
|
var sessionStorageUtils = () => {
|
|
2224
|
-
const getBrowserSession =
|
|
2248
|
+
const getBrowserSession = () => __async(null, null, function* () {
|
|
2225
2249
|
return sessionStorage.getItem("browserSession");
|
|
2226
|
-
};
|
|
2250
|
+
});
|
|
2227
2251
|
return {
|
|
2228
2252
|
getBrowserSession
|
|
2229
2253
|
};
|
|
@@ -2232,13 +2256,14 @@ var sessionStorageUtils = () => {
|
|
|
2232
2256
|
// src/configs/axios-client.ts
|
|
2233
2257
|
var axiosClient = {
|
|
2234
2258
|
init(config) {
|
|
2235
|
-
|
|
2236
|
-
const
|
|
2259
|
+
var _a, _b;
|
|
2260
|
+
const localStorage2 = (_a = config.localStorageUtils) != null ? _a : localStorageUtils();
|
|
2261
|
+
const sessionStorage2 = (_b = config.sessionStorageUtils) != null ? _b : sessionStorageUtils();
|
|
2237
2262
|
const db = config.db;
|
|
2238
2263
|
let isRefreshing = false;
|
|
2239
2264
|
let failedQueue = [];
|
|
2240
2265
|
const processQueue = (error, token = null) => {
|
|
2241
|
-
failedQueue
|
|
2266
|
+
failedQueue == null ? void 0 : failedQueue.forEach((prom) => {
|
|
2242
2267
|
if (error) {
|
|
2243
2268
|
prom.reject(error);
|
|
2244
2269
|
} else {
|
|
@@ -2254,14 +2279,14 @@ var axiosClient = {
|
|
|
2254
2279
|
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
2255
2280
|
});
|
|
2256
2281
|
instance.interceptors.request.use(
|
|
2257
|
-
|
|
2282
|
+
(config2) => __async(null, null, function* () {
|
|
2258
2283
|
const useRefreshToken = config2.useRefreshToken;
|
|
2259
|
-
const token = useRefreshToken ?
|
|
2284
|
+
const token = useRefreshToken ? yield localStorage2.getRefreshToken() : yield localStorage2.getAccessToken();
|
|
2260
2285
|
if (token) {
|
|
2261
2286
|
config2.headers["Authorization"] = "Bearer " + token;
|
|
2262
2287
|
}
|
|
2263
2288
|
return config2;
|
|
2264
|
-
},
|
|
2289
|
+
}),
|
|
2265
2290
|
(error) => {
|
|
2266
2291
|
Promise.reject(error);
|
|
2267
2292
|
}
|
|
@@ -2270,19 +2295,21 @@ var axiosClient = {
|
|
|
2270
2295
|
(response) => {
|
|
2271
2296
|
return handleResponse(response);
|
|
2272
2297
|
},
|
|
2273
|
-
|
|
2274
|
-
|
|
2298
|
+
(error) => __async(null, null, function* () {
|
|
2299
|
+
var _a2, _b2, _c;
|
|
2300
|
+
const handleError3 = (error2) => __async(null, null, function* () {
|
|
2301
|
+
var _a3;
|
|
2275
2302
|
if (!error2.response) {
|
|
2276
2303
|
return error2;
|
|
2277
2304
|
}
|
|
2278
2305
|
const { data } = error2.response;
|
|
2279
|
-
if (data && data.code === 400 && ["invalid_grant"].includes(data.data
|
|
2280
|
-
|
|
2306
|
+
if (data && data.code === 400 && ["invalid_grant"].includes((_a3 = data.data) == null ? void 0 : _a3.error)) {
|
|
2307
|
+
yield clearAuthToken();
|
|
2281
2308
|
}
|
|
2282
2309
|
return data;
|
|
2283
|
-
};
|
|
2310
|
+
});
|
|
2284
2311
|
const originalRequest = error.config;
|
|
2285
|
-
if ((error.response
|
|
2312
|
+
if ((((_a2 = error.response) == null ? void 0 : _a2.status) === 403 || ((_b2 = error.response) == null ? void 0 : _b2.status) === 401 || ((_c = error.response) == null ? void 0 : _c.status) === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
|
|
2286
2313
|
error.response.data.code
|
|
2287
2314
|
)) {
|
|
2288
2315
|
if (isRefreshing) {
|
|
@@ -2295,18 +2322,19 @@ var axiosClient = {
|
|
|
2295
2322
|
token
|
|
2296
2323
|
);
|
|
2297
2324
|
return instance.request(originalRequest);
|
|
2298
|
-
}).catch(
|
|
2299
|
-
|
|
2300
|
-
|
|
2325
|
+
}).catch((err) => __async(null, null, function* () {
|
|
2326
|
+
var _a3, _b3;
|
|
2327
|
+
if ((((_a3 = err.response) == null ? void 0 : _a3.status) === 400 || ((_b3 = err.response) == null ? void 0 : _b3.status) === 401) && ["invalid_grant"].includes(err.response.data.error)) {
|
|
2328
|
+
yield clearAuthToken();
|
|
2301
2329
|
}
|
|
2302
|
-
});
|
|
2330
|
+
}));
|
|
2303
2331
|
}
|
|
2304
|
-
const browserSession =
|
|
2305
|
-
const refreshToken =
|
|
2306
|
-
const accessTokenExp =
|
|
2332
|
+
const browserSession = yield sessionStorage2.getBrowserSession();
|
|
2333
|
+
const refreshToken = yield localStorage2.getRefreshToken();
|
|
2334
|
+
const accessTokenExp = yield localStorage2.getAccessToken();
|
|
2307
2335
|
isRefreshing = true;
|
|
2308
2336
|
if (!refreshToken && (!browserSession || browserSession == "unActive")) {
|
|
2309
|
-
|
|
2337
|
+
yield clearAuthToken();
|
|
2310
2338
|
} else {
|
|
2311
2339
|
const payload = Object.fromEntries(
|
|
2312
2340
|
Object.entries({
|
|
@@ -2317,8 +2345,9 @@ var axiosClient = {
|
|
|
2317
2345
|
}).filter(([_, value]) => !!value)
|
|
2318
2346
|
);
|
|
2319
2347
|
return new Promise(function(resolve) {
|
|
2348
|
+
var _a3;
|
|
2320
2349
|
axios.post(
|
|
2321
|
-
`${config.baseUrl}${config.refreshTokenEndpoint
|
|
2350
|
+
`${config.baseUrl}${(_a3 = config.refreshTokenEndpoint) != null ? _a3 : "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
|
|
2322
2351
|
payload,
|
|
2323
2352
|
{
|
|
2324
2353
|
headers: {
|
|
@@ -2326,10 +2355,10 @@ var axiosClient = {
|
|
|
2326
2355
|
Authorization: `Bearer ${accessTokenExp}`
|
|
2327
2356
|
}
|
|
2328
2357
|
}
|
|
2329
|
-
).then(
|
|
2358
|
+
).then((res) => __async(null, null, function* () {
|
|
2330
2359
|
const data = res.data;
|
|
2331
|
-
|
|
2332
|
-
|
|
2360
|
+
yield localStorage2.setToken(data.access_token);
|
|
2361
|
+
yield localStorage2.setRefreshToken(data.refresh_token);
|
|
2333
2362
|
axios.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
|
|
2334
2363
|
originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
|
|
2335
2364
|
originalRequest.data = updateTokenParamInOriginalRequest(
|
|
@@ -2338,25 +2367,26 @@ var axiosClient = {
|
|
|
2338
2367
|
);
|
|
2339
2368
|
processQueue(null, data.access_token);
|
|
2340
2369
|
resolve(instance.request(originalRequest));
|
|
2341
|
-
}).catch(
|
|
2342
|
-
|
|
2343
|
-
|
|
2370
|
+
})).catch((err) => __async(null, null, function* () {
|
|
2371
|
+
var _a4;
|
|
2372
|
+
if (err && ((err == null ? void 0 : err.error_code) === "AUTHEN_FAIL" || (err == null ? void 0 : err.error_code) === "TOKEN_EXPIRED" || (err == null ? void 0 : err.error_code) === "TOKEN_INCORRECT" || (err == null ? void 0 : err.code) === "ERR_BAD_REQUEST") || (err == null ? void 0 : err.error_code) === "ERR_2FA_006") {
|
|
2373
|
+
yield clearAuthToken();
|
|
2344
2374
|
}
|
|
2345
2375
|
if (err && err.response) {
|
|
2346
|
-
const { error_code } = err.response
|
|
2376
|
+
const { error_code } = ((_a4 = err.response) == null ? void 0 : _a4.data) || {};
|
|
2347
2377
|
if (error_code === "AUTHEN_FAIL") {
|
|
2348
|
-
|
|
2378
|
+
yield clearAuthToken();
|
|
2349
2379
|
}
|
|
2350
2380
|
}
|
|
2351
2381
|
processQueue(err, null);
|
|
2352
|
-
}).finally(() => {
|
|
2382
|
+
})).finally(() => {
|
|
2353
2383
|
isRefreshing = false;
|
|
2354
2384
|
});
|
|
2355
2385
|
});
|
|
2356
2386
|
}
|
|
2357
2387
|
}
|
|
2358
|
-
return Promise.reject(
|
|
2359
|
-
}
|
|
2388
|
+
return Promise.reject(yield handleError3(error));
|
|
2389
|
+
})
|
|
2360
2390
|
);
|
|
2361
2391
|
const handleResponse = (res) => {
|
|
2362
2392
|
if (res && res.data) {
|
|
@@ -2365,6 +2395,7 @@ var axiosClient = {
|
|
|
2365
2395
|
return res;
|
|
2366
2396
|
};
|
|
2367
2397
|
const handleError2 = (error) => {
|
|
2398
|
+
var _a2, _b2, _c;
|
|
2368
2399
|
if (error.isAxiosError && error.code === "ECONNABORTED") {
|
|
2369
2400
|
console.error("Request Timeout Error:", error);
|
|
2370
2401
|
return "Request Timeout Error";
|
|
@@ -2372,17 +2403,17 @@ var axiosClient = {
|
|
|
2372
2403
|
console.error("Network Error:", error);
|
|
2373
2404
|
return "Network Error";
|
|
2374
2405
|
} else {
|
|
2375
|
-
console.error("Other Error:", error
|
|
2376
|
-
const errorMessage = error
|
|
2377
|
-
return { message: errorMessage, status: error
|
|
2406
|
+
console.error("Other Error:", error == null ? void 0 : error.response);
|
|
2407
|
+
const errorMessage = ((_b2 = (_a2 = error == null ? void 0 : error.response) == null ? void 0 : _a2.data) == null ? void 0 : _b2.message) || "An error occurred";
|
|
2408
|
+
return { message: errorMessage, status: (_c = error == null ? void 0 : error.response) == null ? void 0 : _c.status };
|
|
2378
2409
|
}
|
|
2379
2410
|
};
|
|
2380
|
-
const clearAuthToken =
|
|
2381
|
-
|
|
2411
|
+
const clearAuthToken = () => __async(null, null, function* () {
|
|
2412
|
+
yield localStorage2.clearToken();
|
|
2382
2413
|
if (typeof window !== "undefined") {
|
|
2383
2414
|
window.location.href = `/login`;
|
|
2384
2415
|
}
|
|
2385
|
-
};
|
|
2416
|
+
});
|
|
2386
2417
|
function formatUrl(url, db2) {
|
|
2387
2418
|
return url + (db2 ? "?db=" + db2 : "");
|
|
2388
2419
|
}
|
|
@@ -2595,7 +2626,7 @@ var headerSlice = createSlice5({
|
|
|
2595
2626
|
},
|
|
2596
2627
|
reducers: {
|
|
2597
2628
|
setHeader: (state, action) => {
|
|
2598
|
-
state.value = {
|
|
2629
|
+
state.value = __spreadValues(__spreadValues({}, state.value), action.payload);
|
|
2599
2630
|
},
|
|
2600
2631
|
setAllowedCompanyIds: (state, action) => {
|
|
2601
2632
|
state.value.allowedCompanyIds = action.payload;
|
|
@@ -3021,18 +3052,6 @@ var envStore = configureStore({
|
|
|
3021
3052
|
|
|
3022
3053
|
// src/environment/EnvStore.ts
|
|
3023
3054
|
var EnvStore = class {
|
|
3024
|
-
envStore;
|
|
3025
|
-
baseUrl;
|
|
3026
|
-
requests;
|
|
3027
|
-
context;
|
|
3028
|
-
defaultCompany;
|
|
3029
|
-
config;
|
|
3030
|
-
companies;
|
|
3031
|
-
user;
|
|
3032
|
-
db;
|
|
3033
|
-
localStorageUtils;
|
|
3034
|
-
sessionStorageUtils;
|
|
3035
|
-
refreshTokenEndpoint;
|
|
3036
3055
|
constructor(envStore2, localStorageUtils2, sessionStorageUtils2) {
|
|
3037
3056
|
this.envStore = envStore2;
|
|
3038
3057
|
this.localStorageUtils = localStorageUtils2;
|
|
@@ -3041,25 +3060,24 @@ var EnvStore = class {
|
|
|
3041
3060
|
}
|
|
3042
3061
|
setup() {
|
|
3043
3062
|
const env2 = this.envStore.getState().env;
|
|
3044
|
-
this.baseUrl = env2
|
|
3045
|
-
this.requests = env2
|
|
3046
|
-
this.context = env2
|
|
3047
|
-
this.defaultCompany = env2
|
|
3048
|
-
this.config = env2
|
|
3049
|
-
this.companies = env2
|
|
3050
|
-
this.user = env2
|
|
3051
|
-
this.db = env2
|
|
3052
|
-
this.refreshTokenEndpoint = env2
|
|
3063
|
+
this.baseUrl = env2 == null ? void 0 : env2.baseUrl;
|
|
3064
|
+
this.requests = env2 == null ? void 0 : env2.requests;
|
|
3065
|
+
this.context = env2 == null ? void 0 : env2.context;
|
|
3066
|
+
this.defaultCompany = env2 == null ? void 0 : env2.defaultCompany;
|
|
3067
|
+
this.config = env2 == null ? void 0 : env2.config;
|
|
3068
|
+
this.companies = (env2 == null ? void 0 : env2.companies) || [];
|
|
3069
|
+
this.user = env2 == null ? void 0 : env2.user;
|
|
3070
|
+
this.db = env2 == null ? void 0 : env2.db;
|
|
3071
|
+
this.refreshTokenEndpoint = env2 == null ? void 0 : env2.refreshTokenEndpoint;
|
|
3053
3072
|
}
|
|
3054
3073
|
setupEnv(envConfig) {
|
|
3055
3074
|
const dispatch = this.envStore.dispatch;
|
|
3056
|
-
const env2 = {
|
|
3057
|
-
...envConfig,
|
|
3075
|
+
const env2 = __spreadProps(__spreadValues({}, envConfig), {
|
|
3058
3076
|
localStorageUtils: this.localStorageUtils,
|
|
3059
3077
|
sessionStorageUtils: this.sessionStorageUtils
|
|
3060
|
-
};
|
|
3078
|
+
});
|
|
3061
3079
|
const requests = axiosClient.init(env2);
|
|
3062
|
-
dispatch(setEnv({
|
|
3080
|
+
dispatch(setEnv(__spreadProps(__spreadValues({}, env2), { requests })));
|
|
3063
3081
|
this.setup();
|
|
3064
3082
|
}
|
|
3065
3083
|
setUid(uid) {
|
|
@@ -3103,35 +3121,61 @@ function getEnv() {
|
|
|
3103
3121
|
// src/services/action-service/index.ts
|
|
3104
3122
|
var ActionService = {
|
|
3105
3123
|
// Load Action
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
}
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
}
|
|
3124
|
+
loadAction(_0) {
|
|
3125
|
+
return __async(this, arguments, function* ({
|
|
3126
|
+
idAction,
|
|
3127
|
+
context
|
|
3128
|
+
}) {
|
|
3129
|
+
const env2 = getEnv();
|
|
3130
|
+
const jsonData = {
|
|
3131
|
+
action_id: idAction,
|
|
3132
|
+
with_context: __spreadValues({}, context)
|
|
3133
|
+
};
|
|
3134
|
+
return env2.requests.post(`${"/load_action" /* LOAD_ACTION */}`, jsonData, {
|
|
3135
|
+
headers: {
|
|
3136
|
+
"Content-Type": "application/json"
|
|
3137
|
+
}
|
|
3138
|
+
});
|
|
3121
3139
|
});
|
|
3122
3140
|
},
|
|
3123
3141
|
// Call Button
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3142
|
+
callButton(_0) {
|
|
3143
|
+
return __async(this, arguments, function* ({
|
|
3144
|
+
model,
|
|
3145
|
+
ids = [],
|
|
3146
|
+
context,
|
|
3147
|
+
method
|
|
3148
|
+
}) {
|
|
3149
|
+
try {
|
|
3150
|
+
const env2 = getEnv();
|
|
3151
|
+
const jsonData = {
|
|
3152
|
+
model,
|
|
3153
|
+
method,
|
|
3154
|
+
ids,
|
|
3155
|
+
with_context: context
|
|
3156
|
+
};
|
|
3157
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3158
|
+
headers: {
|
|
3159
|
+
"Content-Type": "application/json"
|
|
3160
|
+
}
|
|
3161
|
+
});
|
|
3162
|
+
} catch (error) {
|
|
3163
|
+
console.error("Error when calling button action:", error);
|
|
3164
|
+
throw error;
|
|
3165
|
+
}
|
|
3166
|
+
});
|
|
3167
|
+
},
|
|
3168
|
+
// remove Row
|
|
3169
|
+
removeRows(_0) {
|
|
3170
|
+
return __async(this, arguments, function* ({
|
|
3171
|
+
model,
|
|
3172
|
+
ids,
|
|
3173
|
+
context
|
|
3174
|
+
}) {
|
|
3131
3175
|
const env2 = getEnv();
|
|
3132
3176
|
const jsonData = {
|
|
3133
3177
|
model,
|
|
3134
|
-
method,
|
|
3178
|
+
method: "unlink",
|
|
3135
3179
|
ids,
|
|
3136
3180
|
with_context: context
|
|
3137
3181
|
};
|
|
@@ -3140,112 +3184,96 @@ var ActionService = {
|
|
|
3140
3184
|
"Content-Type": "application/json"
|
|
3141
3185
|
}
|
|
3142
3186
|
});
|
|
3143
|
-
} catch (error) {
|
|
3144
|
-
console.error("Error when calling button action:", error);
|
|
3145
|
-
throw error;
|
|
3146
|
-
}
|
|
3147
|
-
},
|
|
3148
|
-
// remove Row
|
|
3149
|
-
async removeRows({
|
|
3150
|
-
model,
|
|
3151
|
-
ids,
|
|
3152
|
-
context
|
|
3153
|
-
}) {
|
|
3154
|
-
const env2 = getEnv();
|
|
3155
|
-
const jsonData = {
|
|
3156
|
-
model,
|
|
3157
|
-
method: "unlink",
|
|
3158
|
-
ids,
|
|
3159
|
-
with_context: context
|
|
3160
|
-
};
|
|
3161
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3162
|
-
headers: {
|
|
3163
|
-
"Content-Type": "application/json"
|
|
3164
|
-
}
|
|
3165
3187
|
});
|
|
3166
3188
|
},
|
|
3167
3189
|
// Duplicate Model
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
id,
|
|
3171
|
-
context
|
|
3172
|
-
}) {
|
|
3173
|
-
const env2 = getEnv();
|
|
3174
|
-
const jsonData = {
|
|
3190
|
+
duplicateRecord(_0) {
|
|
3191
|
+
return __async(this, arguments, function* ({
|
|
3175
3192
|
model,
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3193
|
+
id,
|
|
3194
|
+
context
|
|
3195
|
+
}) {
|
|
3196
|
+
const env2 = getEnv();
|
|
3197
|
+
const jsonData = {
|
|
3198
|
+
model,
|
|
3199
|
+
method: "copy",
|
|
3200
|
+
ids: id,
|
|
3201
|
+
with_context: context
|
|
3202
|
+
};
|
|
3203
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3204
|
+
headers: {
|
|
3205
|
+
"Content-Type": "application/json"
|
|
3206
|
+
}
|
|
3207
|
+
});
|
|
3184
3208
|
});
|
|
3185
3209
|
},
|
|
3186
3210
|
// Get Print Report
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3211
|
+
getPrintReportName(_0) {
|
|
3212
|
+
return __async(this, arguments, function* ({ id }) {
|
|
3213
|
+
const env2 = getEnv();
|
|
3214
|
+
const jsonData = {
|
|
3215
|
+
model: "ir.actions.report",
|
|
3216
|
+
method: "web_read",
|
|
3217
|
+
id,
|
|
3218
|
+
kwargs: {
|
|
3219
|
+
specification: {
|
|
3220
|
+
report_name: {}
|
|
3221
|
+
}
|
|
3196
3222
|
}
|
|
3197
|
-
}
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
}
|
|
3223
|
+
};
|
|
3224
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3225
|
+
headers: {
|
|
3226
|
+
"Content-Type": "application/json"
|
|
3227
|
+
}
|
|
3228
|
+
});
|
|
3203
3229
|
});
|
|
3204
3230
|
},
|
|
3205
3231
|
//Save Print Invoice
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3232
|
+
print(_0) {
|
|
3233
|
+
return __async(this, arguments, function* ({ id, report, db }) {
|
|
3234
|
+
const env2 = getEnv();
|
|
3235
|
+
const jsonData = {
|
|
3236
|
+
report,
|
|
3237
|
+
id,
|
|
3238
|
+
type: "pdf",
|
|
3239
|
+
file_response: true,
|
|
3240
|
+
db
|
|
3241
|
+
};
|
|
3242
|
+
const queryString = toQueryString(jsonData);
|
|
3243
|
+
const urlWithParams = `${"/report" /* REPORT_PATH */}?${queryString}`;
|
|
3244
|
+
return env2.requests.get(urlWithParams, {
|
|
3245
|
+
headers: {
|
|
3246
|
+
"Content-Type": "application/json"
|
|
3247
|
+
},
|
|
3248
|
+
responseType: "arraybuffer"
|
|
3249
|
+
});
|
|
3222
3250
|
});
|
|
3223
3251
|
},
|
|
3224
3252
|
//Run Action
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
}
|
|
3253
|
+
runAction(_0) {
|
|
3254
|
+
return __async(this, arguments, function* ({
|
|
3255
|
+
idAction,
|
|
3256
|
+
context
|
|
3257
|
+
}) {
|
|
3258
|
+
const env2 = getEnv();
|
|
3259
|
+
const jsonData = {
|
|
3260
|
+
action_id: idAction,
|
|
3261
|
+
with_context: __spreadValues({}, context)
|
|
3262
|
+
// context: {
|
|
3263
|
+
// lang: 'en_US',
|
|
3264
|
+
// tz: 'Asia/Saigon',
|
|
3265
|
+
// uid: 2,
|
|
3266
|
+
// allowed_company_ids: [1],
|
|
3267
|
+
// active_id: Array.isArray(idDetail) ? idDetail[0] : idDetail,
|
|
3268
|
+
// active_ids: Array.isArray(idDetail) ? [...idDetail] : idDetail,
|
|
3269
|
+
// active_model: model,
|
|
3270
|
+
// },
|
|
3271
|
+
};
|
|
3272
|
+
return env2.requests.post(`${"/run_action" /* RUN_ACTION_PATH */}`, jsonData, {
|
|
3273
|
+
headers: {
|
|
3274
|
+
"Content-Type": "application/json"
|
|
3275
|
+
}
|
|
3276
|
+
});
|
|
3249
3277
|
});
|
|
3250
3278
|
}
|
|
3251
3279
|
};
|
|
@@ -3253,200 +3281,238 @@ var action_service_default = ActionService;
|
|
|
3253
3281
|
|
|
3254
3282
|
// src/services/auth-service/index.ts
|
|
3255
3283
|
var AuthService = {
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3284
|
+
login(body) {
|
|
3285
|
+
return __async(this, null, function* () {
|
|
3286
|
+
var _a, _b, _c, _d;
|
|
3287
|
+
const env2 = getEnv();
|
|
3288
|
+
const payload = Object.fromEntries(
|
|
3289
|
+
Object.entries({
|
|
3290
|
+
username: body.email,
|
|
3291
|
+
password: body.password,
|
|
3292
|
+
grant_type: ((_a = env2 == null ? void 0 : env2.config) == null ? void 0 : _a.grantType) || "",
|
|
3293
|
+
client_id: ((_b = env2 == null ? void 0 : env2.config) == null ? void 0 : _b.clientId) || "",
|
|
3294
|
+
client_secret: ((_c = env2 == null ? void 0 : env2.config) == null ? void 0 : _c.clientSecret) || ""
|
|
3295
|
+
}).filter(([_, value]) => !!value)
|
|
3296
|
+
);
|
|
3297
|
+
const encodedData = new URLSearchParams(payload).toString();
|
|
3298
|
+
return (_d = env2 == null ? void 0 : env2.requests) == null ? void 0 : _d.post(body.path, encodedData, {
|
|
3299
|
+
headers: {
|
|
3300
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
3301
|
+
}
|
|
3302
|
+
});
|
|
3272
3303
|
});
|
|
3273
3304
|
},
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3305
|
+
forgotPassword(email) {
|
|
3306
|
+
return __async(this, null, function* () {
|
|
3307
|
+
var _a;
|
|
3308
|
+
const env2 = getEnv();
|
|
3309
|
+
const bodyData = {
|
|
3310
|
+
login: email,
|
|
3311
|
+
url: `${window.location.origin}/reset-password`
|
|
3312
|
+
};
|
|
3313
|
+
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/reset_password" /* RESET_PASSWORD_PATH */, bodyData, {
|
|
3314
|
+
headers: {
|
|
3315
|
+
"Content-Type": "application/json"
|
|
3316
|
+
}
|
|
3317
|
+
});
|
|
3284
3318
|
});
|
|
3285
3319
|
},
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3320
|
+
forgotPasswordSSO(_0) {
|
|
3321
|
+
return __async(this, arguments, function* ({
|
|
3322
|
+
email,
|
|
3323
|
+
with_context,
|
|
3324
|
+
method
|
|
3325
|
+
}) {
|
|
3326
|
+
var _a;
|
|
3327
|
+
const env2 = getEnv();
|
|
3328
|
+
const body = {
|
|
3329
|
+
method,
|
|
3330
|
+
kwargs: {
|
|
3331
|
+
vals: {
|
|
3332
|
+
email
|
|
3333
|
+
}
|
|
3334
|
+
},
|
|
3335
|
+
with_context
|
|
3336
|
+
};
|
|
3337
|
+
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, body, {
|
|
3338
|
+
headers: {
|
|
3339
|
+
"Content-Type": "application/json"
|
|
3297
3340
|
}
|
|
3298
|
-
}
|
|
3299
|
-
with_context
|
|
3300
|
-
};
|
|
3301
|
-
return env2?.requests?.post("/call" /* CALL_PATH */, body, {
|
|
3302
|
-
headers: {
|
|
3303
|
-
"Content-Type": "application/json"
|
|
3304
|
-
}
|
|
3341
|
+
});
|
|
3305
3342
|
});
|
|
3306
3343
|
},
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3344
|
+
resetPassword(data, token) {
|
|
3345
|
+
return __async(this, null, function* () {
|
|
3346
|
+
var _a;
|
|
3347
|
+
const env2 = getEnv();
|
|
3348
|
+
const bodyData = {
|
|
3349
|
+
token,
|
|
3350
|
+
password: data.password,
|
|
3351
|
+
new_password: data.confirmPassword
|
|
3352
|
+
};
|
|
3353
|
+
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/change_password" /* CHANGE_PASSWORD_PATH */, bodyData, {
|
|
3354
|
+
headers: {
|
|
3355
|
+
"Content-Type": "application/json"
|
|
3356
|
+
}
|
|
3357
|
+
});
|
|
3318
3358
|
});
|
|
3319
3359
|
},
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
password,
|
|
3323
|
-
with_context
|
|
3324
|
-
}) {
|
|
3325
|
-
const env2 = getEnv();
|
|
3326
|
-
const bodyData = {
|
|
3360
|
+
resetPasswordSSO(_0) {
|
|
3361
|
+
return __async(this, arguments, function* ({
|
|
3327
3362
|
method,
|
|
3328
|
-
|
|
3329
|
-
vals: {
|
|
3330
|
-
password
|
|
3331
|
-
}
|
|
3332
|
-
},
|
|
3363
|
+
password,
|
|
3333
3364
|
with_context
|
|
3334
|
-
}
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
}
|
|
3365
|
+
}) {
|
|
3366
|
+
var _a;
|
|
3367
|
+
const env2 = getEnv();
|
|
3368
|
+
const bodyData = {
|
|
3369
|
+
method,
|
|
3370
|
+
kwargs: {
|
|
3371
|
+
vals: {
|
|
3372
|
+
password
|
|
3373
|
+
}
|
|
3374
|
+
},
|
|
3375
|
+
with_context
|
|
3376
|
+
};
|
|
3377
|
+
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, bodyData, {
|
|
3378
|
+
headers: {
|
|
3379
|
+
"Content-Type": "application/json"
|
|
3380
|
+
}
|
|
3381
|
+
});
|
|
3352
3382
|
});
|
|
3353
3383
|
},
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
}
|
|
3384
|
+
updatePassword(data, token) {
|
|
3385
|
+
return __async(this, null, function* () {
|
|
3386
|
+
var _a;
|
|
3387
|
+
const env2 = getEnv();
|
|
3388
|
+
const bodyData = {
|
|
3389
|
+
token,
|
|
3390
|
+
old_password: data.oldPassword,
|
|
3391
|
+
new_password: data.newPassword
|
|
3392
|
+
};
|
|
3393
|
+
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/change_password_parent" /* UPDATE_PASSWORD_PATH */, bodyData, {
|
|
3394
|
+
headers: {
|
|
3395
|
+
"Content-Type": "application/json"
|
|
3396
|
+
}
|
|
3397
|
+
});
|
|
3363
3398
|
});
|
|
3364
3399
|
},
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
"/
|
|
3373
|
-
{ state, access_token },
|
|
3374
|
-
{
|
|
3400
|
+
isValidToken(token) {
|
|
3401
|
+
return __async(this, null, function* () {
|
|
3402
|
+
var _a;
|
|
3403
|
+
const env2 = getEnv();
|
|
3404
|
+
const bodyData = {
|
|
3405
|
+
token
|
|
3406
|
+
};
|
|
3407
|
+
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/check_token" /* TOKEN */, bodyData, {
|
|
3375
3408
|
headers: {
|
|
3376
3409
|
"Content-Type": "application/json"
|
|
3377
3410
|
}
|
|
3378
|
-
}
|
|
3379
|
-
);
|
|
3411
|
+
});
|
|
3412
|
+
});
|
|
3380
3413
|
},
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3414
|
+
loginSocial(_0) {
|
|
3415
|
+
return __async(this, arguments, function* ({
|
|
3416
|
+
db,
|
|
3417
|
+
state,
|
|
3418
|
+
access_token
|
|
3419
|
+
}) {
|
|
3420
|
+
var _a;
|
|
3421
|
+
const env2 = getEnv();
|
|
3422
|
+
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post(
|
|
3423
|
+
"/token/generate" /* GENTOKEN_SOCIAL */,
|
|
3424
|
+
{ state, access_token },
|
|
3425
|
+
{
|
|
3426
|
+
headers: {
|
|
3427
|
+
"Content-Type": "application/json"
|
|
3428
|
+
}
|
|
3429
|
+
}
|
|
3430
|
+
);
|
|
3431
|
+
});
|
|
3384
3432
|
},
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3433
|
+
getProviders(db) {
|
|
3434
|
+
return __async(this, null, function* () {
|
|
3435
|
+
var _a;
|
|
3436
|
+
const env2 = getEnv();
|
|
3437
|
+
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.get("/oauth/providers", { params: { db } });
|
|
3438
|
+
});
|
|
3439
|
+
},
|
|
3440
|
+
getAccessByCode(code) {
|
|
3441
|
+
return __async(this, null, function* () {
|
|
3442
|
+
var _a, _b, _c, _d;
|
|
3443
|
+
const env2 = getEnv();
|
|
3444
|
+
const data = new URLSearchParams();
|
|
3445
|
+
data.append("code", code);
|
|
3446
|
+
data.append("grant_type", "authorization_code");
|
|
3447
|
+
data.append("client_id", ((_a = env2 == null ? void 0 : env2.config) == null ? void 0 : _a.clientId) || "");
|
|
3448
|
+
data.append("redirect_uri", ((_b = env2 == null ? void 0 : env2.config) == null ? void 0 : _b.redirectUri) || "");
|
|
3449
|
+
return (_d = env2 == null ? void 0 : env2.requests) == null ? void 0 : _d.post(
|
|
3450
|
+
`${(_c = env2 == null ? void 0 : env2.baseUrl) == null ? void 0 : _c.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
|
|
3451
|
+
data,
|
|
3452
|
+
{
|
|
3453
|
+
headers: {
|
|
3454
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
3455
|
+
}
|
|
3398
3456
|
}
|
|
3399
|
-
|
|
3400
|
-
);
|
|
3457
|
+
);
|
|
3458
|
+
});
|
|
3401
3459
|
},
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3460
|
+
logout(data) {
|
|
3461
|
+
return __async(this, null, function* () {
|
|
3462
|
+
var _a;
|
|
3463
|
+
const env2 = getEnv();
|
|
3464
|
+
console.log(data);
|
|
3465
|
+
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post(
|
|
3466
|
+
"/logout" /* LOGOUT */,
|
|
3467
|
+
{},
|
|
3468
|
+
{
|
|
3469
|
+
headers: {
|
|
3470
|
+
"Content-Type": "application/json"
|
|
3471
|
+
},
|
|
3472
|
+
withCredentials: true,
|
|
3473
|
+
useRefreshToken: true
|
|
3474
|
+
}
|
|
3475
|
+
);
|
|
3476
|
+
});
|
|
3416
3477
|
}
|
|
3417
3478
|
};
|
|
3418
3479
|
var auth_service_default = AuthService;
|
|
3419
3480
|
|
|
3420
3481
|
// src/services/company-service/index.ts
|
|
3421
3482
|
var CompanyService = {
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3483
|
+
getCurrentCompany() {
|
|
3484
|
+
return __async(this, null, function* () {
|
|
3485
|
+
const env2 = getEnv();
|
|
3486
|
+
return yield env2.requests.get("/company" /* COMPANY_PATH */, {
|
|
3487
|
+
headers: {
|
|
3488
|
+
"Content-Type": "application/json"
|
|
3489
|
+
}
|
|
3490
|
+
});
|
|
3428
3491
|
});
|
|
3429
3492
|
},
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3493
|
+
getInfoCompany(id) {
|
|
3494
|
+
return __async(this, null, function* () {
|
|
3495
|
+
var _a;
|
|
3496
|
+
const env2 = getEnv();
|
|
3497
|
+
const jsonData = {
|
|
3498
|
+
ids: [id],
|
|
3499
|
+
model: "res.company" /* COMPANY */,
|
|
3500
|
+
method: "web_read" /* WEB_READ */,
|
|
3501
|
+
kwargs: {
|
|
3502
|
+
specification: {
|
|
3503
|
+
primary_color: {},
|
|
3504
|
+
secondary_color: {},
|
|
3505
|
+
logo: {},
|
|
3506
|
+
display_name: {},
|
|
3507
|
+
secondary_logo: {}
|
|
3508
|
+
}
|
|
3443
3509
|
}
|
|
3444
|
-
}
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
}
|
|
3510
|
+
};
|
|
3511
|
+
return yield (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
3512
|
+
headers: {
|
|
3513
|
+
"Content-Type": "application/json"
|
|
3514
|
+
}
|
|
3515
|
+
});
|
|
3450
3516
|
});
|
|
3451
3517
|
}
|
|
3452
3518
|
};
|
|
@@ -3454,300 +3520,328 @@ var company_service_default = CompanyService;
|
|
|
3454
3520
|
|
|
3455
3521
|
// src/services/excel-service/index.ts
|
|
3456
3522
|
var ExcelService = {
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
});
|
|
3464
|
-
},
|
|
3465
|
-
async uploadIdFile({ formData }) {
|
|
3466
|
-
const env2 = getEnv();
|
|
3467
|
-
return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
|
|
3468
|
-
headers: {
|
|
3469
|
-
"Content-Type": "multipart/form-data"
|
|
3470
|
-
}
|
|
3471
|
-
});
|
|
3472
|
-
},
|
|
3473
|
-
async parsePreview({
|
|
3474
|
-
id,
|
|
3475
|
-
selectedSheet,
|
|
3476
|
-
isHeader,
|
|
3477
|
-
context
|
|
3478
|
-
}) {
|
|
3479
|
-
const env2 = getEnv();
|
|
3480
|
-
const jsonData = {
|
|
3481
|
-
model: "base_import.import" /* BASE_IMPORT */,
|
|
3482
|
-
method: "parse_preview",
|
|
3483
|
-
ids: [id],
|
|
3484
|
-
kwargs: {
|
|
3485
|
-
options: {
|
|
3486
|
-
import_skip_records: [],
|
|
3487
|
-
import_set_empty_fields: [],
|
|
3488
|
-
fallback_values: {},
|
|
3489
|
-
name_create_enabled_fields: {},
|
|
3490
|
-
encoding: "",
|
|
3491
|
-
separator: "",
|
|
3492
|
-
quoting: '"',
|
|
3493
|
-
date_format: "",
|
|
3494
|
-
datetime_format: "",
|
|
3495
|
-
float_thousand_separator: ",",
|
|
3496
|
-
float_decimal_separator: ".",
|
|
3497
|
-
advanced: true,
|
|
3498
|
-
has_headers: isHeader,
|
|
3499
|
-
keep_matches: false,
|
|
3500
|
-
limit: 2e3,
|
|
3501
|
-
sheets: [],
|
|
3502
|
-
sheet: selectedSheet,
|
|
3503
|
-
skip: 0,
|
|
3504
|
-
tracking_disable: true
|
|
3523
|
+
uploadFile(_0) {
|
|
3524
|
+
return __async(this, arguments, function* ({ formData }) {
|
|
3525
|
+
const env2 = getEnv();
|
|
3526
|
+
return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
|
|
3527
|
+
headers: {
|
|
3528
|
+
"Content-Type": "multipart/form-data"
|
|
3505
3529
|
}
|
|
3506
|
-
}
|
|
3507
|
-
with_context: context
|
|
3508
|
-
};
|
|
3509
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3510
|
-
headers: {
|
|
3511
|
-
"Content-Type": "multipart/form-data"
|
|
3512
|
-
}
|
|
3530
|
+
});
|
|
3513
3531
|
});
|
|
3514
3532
|
},
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
const env2 = getEnv();
|
|
3524
|
-
const jsonData = {
|
|
3525
|
-
model: "base_import.import" /* BASE_IMPORT */,
|
|
3526
|
-
method: "execute_import",
|
|
3527
|
-
ids: [idFile],
|
|
3528
|
-
kwargs: {
|
|
3529
|
-
fields,
|
|
3530
|
-
columns,
|
|
3531
|
-
options,
|
|
3532
|
-
dryrun
|
|
3533
|
-
},
|
|
3534
|
-
with_context: context
|
|
3535
|
-
};
|
|
3536
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3537
|
-
headers: {
|
|
3538
|
-
"Content-Type": "multipart/form-data"
|
|
3539
|
-
}
|
|
3533
|
+
uploadIdFile(_0) {
|
|
3534
|
+
return __async(this, arguments, function* ({ formData }) {
|
|
3535
|
+
const env2 = getEnv();
|
|
3536
|
+
return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
|
|
3537
|
+
headers: {
|
|
3538
|
+
"Content-Type": "multipart/form-data"
|
|
3539
|
+
}
|
|
3540
|
+
});
|
|
3540
3541
|
});
|
|
3541
3542
|
},
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
}
|
|
3549
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonData);
|
|
3550
|
-
},
|
|
3551
|
-
async getFieldExport({
|
|
3552
|
-
ids,
|
|
3553
|
-
model,
|
|
3554
|
-
isShow,
|
|
3555
|
-
parentField,
|
|
3556
|
-
fieldType,
|
|
3557
|
-
parentName,
|
|
3558
|
-
prefix,
|
|
3559
|
-
name,
|
|
3560
|
-
context,
|
|
3561
|
-
importCompat
|
|
3562
|
-
}) {
|
|
3563
|
-
const env2 = getEnv();
|
|
3564
|
-
const jsonData = {
|
|
3565
|
-
model,
|
|
3566
|
-
import_compat: importCompat,
|
|
3567
|
-
domain: [["id", "in", ids]],
|
|
3568
|
-
with_context: context
|
|
3569
|
-
};
|
|
3570
|
-
if (isShow) {
|
|
3571
|
-
jsonData.parent_field = parentField;
|
|
3572
|
-
jsonData.parent_field_type = fieldType;
|
|
3573
|
-
jsonData.parent_name = parentName;
|
|
3574
|
-
jsonData.name = name;
|
|
3575
|
-
jsonData.prefix = prefix;
|
|
3576
|
-
jsonData.exclude = [null];
|
|
3577
|
-
}
|
|
3578
|
-
return env2.requests.post("/export/get_fields", jsonData);
|
|
3579
|
-
},
|
|
3580
|
-
async exportExcel({
|
|
3581
|
-
model,
|
|
3582
|
-
domain,
|
|
3583
|
-
ids,
|
|
3584
|
-
fields,
|
|
3585
|
-
type,
|
|
3586
|
-
importCompat,
|
|
3587
|
-
context,
|
|
3588
|
-
groupby
|
|
3589
|
-
}) {
|
|
3590
|
-
const env2 = getEnv();
|
|
3591
|
-
const jsonData = {
|
|
3592
|
-
model,
|
|
3593
|
-
domain,
|
|
3594
|
-
ids,
|
|
3595
|
-
import_compat: importCompat,
|
|
3596
|
-
fields,
|
|
3597
|
-
with_context: context,
|
|
3598
|
-
groupby: groupby ?? []
|
|
3599
|
-
};
|
|
3600
|
-
return env2.requests.post_excel(`/export/${type}`, jsonData);
|
|
3601
|
-
}
|
|
3602
|
-
};
|
|
3603
|
-
var excel_service_default = ExcelService;
|
|
3604
|
-
|
|
3605
|
-
// src/services/form-service/index.ts
|
|
3606
|
-
var FormService = {
|
|
3607
|
-
async getComment({ data }) {
|
|
3608
|
-
try {
|
|
3543
|
+
parsePreview(_0) {
|
|
3544
|
+
return __async(this, arguments, function* ({
|
|
3545
|
+
id,
|
|
3546
|
+
selectedSheet,
|
|
3547
|
+
isHeader,
|
|
3548
|
+
context
|
|
3549
|
+
}) {
|
|
3609
3550
|
const env2 = getEnv();
|
|
3610
3551
|
const jsonData = {
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3552
|
+
model: "base_import.import" /* BASE_IMPORT */,
|
|
3553
|
+
method: "parse_preview",
|
|
3554
|
+
ids: [id],
|
|
3555
|
+
kwargs: {
|
|
3556
|
+
options: {
|
|
3557
|
+
import_skip_records: [],
|
|
3558
|
+
import_set_empty_fields: [],
|
|
3559
|
+
fallback_values: {},
|
|
3560
|
+
name_create_enabled_fields: {},
|
|
3561
|
+
encoding: "",
|
|
3562
|
+
separator: "",
|
|
3563
|
+
quoting: '"',
|
|
3564
|
+
date_format: "",
|
|
3565
|
+
datetime_format: "",
|
|
3566
|
+
float_thousand_separator: ",",
|
|
3567
|
+
float_decimal_separator: ".",
|
|
3568
|
+
advanced: true,
|
|
3569
|
+
has_headers: isHeader,
|
|
3570
|
+
keep_matches: false,
|
|
3571
|
+
limit: 2e3,
|
|
3572
|
+
sheets: [],
|
|
3573
|
+
sheet: selectedSheet,
|
|
3574
|
+
skip: 0,
|
|
3575
|
+
tracking_disable: true
|
|
3576
|
+
}
|
|
3577
|
+
},
|
|
3578
|
+
with_context: context
|
|
3617
3579
|
};
|
|
3618
|
-
return env2.requests.post("/
|
|
3580
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3619
3581
|
headers: {
|
|
3620
|
-
"Content-Type": "
|
|
3582
|
+
"Content-Type": "multipart/form-data"
|
|
3621
3583
|
}
|
|
3622
3584
|
});
|
|
3623
|
-
}
|
|
3624
|
-
console.error("Error when sending message:", error);
|
|
3625
|
-
throw error;
|
|
3626
|
-
}
|
|
3585
|
+
});
|
|
3627
3586
|
},
|
|
3628
|
-
|
|
3629
|
-
|
|
3587
|
+
executeImport(_0) {
|
|
3588
|
+
return __async(this, arguments, function* ({
|
|
3589
|
+
columns,
|
|
3590
|
+
fields,
|
|
3591
|
+
idFile,
|
|
3592
|
+
options,
|
|
3593
|
+
dryrun,
|
|
3594
|
+
context
|
|
3595
|
+
}) {
|
|
3630
3596
|
const env2 = getEnv();
|
|
3631
3597
|
const jsonData = {
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3598
|
+
model: "base_import.import" /* BASE_IMPORT */,
|
|
3599
|
+
method: "execute_import",
|
|
3600
|
+
ids: [idFile],
|
|
3601
|
+
kwargs: {
|
|
3602
|
+
fields,
|
|
3603
|
+
columns,
|
|
3604
|
+
options,
|
|
3605
|
+
dryrun
|
|
3638
3606
|
},
|
|
3639
|
-
|
|
3640
|
-
body: data.message,
|
|
3641
|
-
message_type: "comment",
|
|
3642
|
-
attachment_ids: data.attachment_ids,
|
|
3643
|
-
attachment_tokens: [],
|
|
3644
|
-
subtype_xmlid: data.subtype
|
|
3645
|
-
},
|
|
3646
|
-
thread_id: Number(data.thread_id),
|
|
3647
|
-
thread_model: data.thread_model
|
|
3607
|
+
with_context: context
|
|
3648
3608
|
};
|
|
3649
|
-
return env2.requests.post("/
|
|
3609
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3650
3610
|
headers: {
|
|
3651
|
-
"Content-Type": "
|
|
3611
|
+
"Content-Type": "multipart/form-data"
|
|
3652
3612
|
}
|
|
3653
3613
|
});
|
|
3654
|
-
}
|
|
3655
|
-
console.error("Error when sent message:", error);
|
|
3656
|
-
throw error;
|
|
3657
|
-
}
|
|
3614
|
+
});
|
|
3658
3615
|
},
|
|
3659
|
-
|
|
3660
|
-
|
|
3616
|
+
getFileExcel(_0) {
|
|
3617
|
+
return __async(this, arguments, function* ({ model }) {
|
|
3661
3618
|
const env2 = getEnv();
|
|
3662
3619
|
const jsonData = {
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
message_id: data.message_id
|
|
3620
|
+
model,
|
|
3621
|
+
method: "get_import_templates" /* GET_IMPORT */,
|
|
3622
|
+
args: []
|
|
3667
3623
|
};
|
|
3668
|
-
return env2.requests.post("/
|
|
3669
|
-
|
|
3670
|
-
"Content-Type": "application/json"
|
|
3671
|
-
}
|
|
3672
|
-
});
|
|
3673
|
-
} catch (error) {
|
|
3674
|
-
console.error("Error when sent message:", error);
|
|
3675
|
-
throw error;
|
|
3676
|
-
}
|
|
3624
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData);
|
|
3625
|
+
});
|
|
3677
3626
|
},
|
|
3678
|
-
|
|
3679
|
-
|
|
3627
|
+
getFieldExport(_0) {
|
|
3628
|
+
return __async(this, arguments, function* ({
|
|
3629
|
+
ids,
|
|
3630
|
+
model,
|
|
3631
|
+
isShow,
|
|
3632
|
+
parentField,
|
|
3633
|
+
fieldType,
|
|
3634
|
+
parentName,
|
|
3635
|
+
prefix,
|
|
3636
|
+
name,
|
|
3637
|
+
context,
|
|
3638
|
+
importCompat
|
|
3639
|
+
}) {
|
|
3680
3640
|
const env2 = getEnv();
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3641
|
+
const jsonData = {
|
|
3642
|
+
model,
|
|
3643
|
+
import_compat: importCompat,
|
|
3644
|
+
domain: [["id", "in", ids]],
|
|
3645
|
+
with_context: context
|
|
3646
|
+
};
|
|
3647
|
+
if (isShow) {
|
|
3648
|
+
jsonData.parent_field = parentField;
|
|
3649
|
+
jsonData.parent_field_type = fieldType;
|
|
3650
|
+
jsonData.parent_name = parentName;
|
|
3651
|
+
jsonData.name = name;
|
|
3652
|
+
jsonData.prefix = prefix;
|
|
3653
|
+
jsonData.exclude = [null];
|
|
3654
|
+
}
|
|
3655
|
+
return env2.requests.post("/export/get_fields", jsonData);
|
|
3656
|
+
});
|
|
3657
|
+
},
|
|
3658
|
+
exportExcel(_0) {
|
|
3659
|
+
return __async(this, arguments, function* ({
|
|
3660
|
+
model,
|
|
3661
|
+
domain,
|
|
3662
|
+
ids,
|
|
3663
|
+
fields,
|
|
3664
|
+
type,
|
|
3665
|
+
importCompat,
|
|
3666
|
+
context,
|
|
3667
|
+
groupby
|
|
3668
|
+
}) {
|
|
3669
|
+
const env2 = getEnv();
|
|
3670
|
+
const jsonData = {
|
|
3671
|
+
model,
|
|
3672
|
+
domain,
|
|
3673
|
+
ids,
|
|
3674
|
+
import_compat: importCompat,
|
|
3675
|
+
fields,
|
|
3676
|
+
with_context: context,
|
|
3677
|
+
groupby: groupby != null ? groupby : []
|
|
3678
|
+
};
|
|
3679
|
+
return env2.requests.post_excel(`/export/${type}`, jsonData);
|
|
3680
|
+
});
|
|
3681
|
+
}
|
|
3682
|
+
};
|
|
3683
|
+
var excel_service_default = ExcelService;
|
|
3684
|
+
|
|
3685
|
+
// src/services/form-service/index.ts
|
|
3686
|
+
var FormService = {
|
|
3687
|
+
getComment(_0) {
|
|
3688
|
+
return __async(this, arguments, function* ({ data }) {
|
|
3689
|
+
try {
|
|
3690
|
+
const env2 = getEnv();
|
|
3691
|
+
const jsonData = {
|
|
3692
|
+
thread_id: data.thread_id,
|
|
3693
|
+
thread_model: data.thread_model,
|
|
3694
|
+
limit: 100,
|
|
3695
|
+
with_context: {
|
|
3696
|
+
lang: data.lang
|
|
3697
|
+
}
|
|
3698
|
+
};
|
|
3699
|
+
return env2.requests.post("/chatter/thread/messages" /* GET_MESSAGE */, jsonData, {
|
|
3684
3700
|
headers: {
|
|
3685
3701
|
"Content-Type": "application/json"
|
|
3686
3702
|
}
|
|
3687
|
-
}
|
|
3688
|
-
)
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
}
|
|
3703
|
+
});
|
|
3704
|
+
} catch (error) {
|
|
3705
|
+
console.error("Error when sending message:", error);
|
|
3706
|
+
throw error;
|
|
3707
|
+
}
|
|
3708
|
+
});
|
|
3693
3709
|
},
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3710
|
+
sentComment(_0) {
|
|
3711
|
+
return __async(this, arguments, function* ({ data }) {
|
|
3712
|
+
try {
|
|
3713
|
+
const env2 = getEnv();
|
|
3714
|
+
const jsonData = {
|
|
3715
|
+
context: {
|
|
3716
|
+
tz: "Asia/Saigon",
|
|
3717
|
+
uid: 2,
|
|
3718
|
+
allowed_company_ids: [1],
|
|
3719
|
+
mail_post_autofollow: false,
|
|
3720
|
+
temporary_id: 142183.01
|
|
3721
|
+
},
|
|
3722
|
+
post_data: {
|
|
3723
|
+
body: data.message,
|
|
3724
|
+
message_type: "comment",
|
|
3725
|
+
attachment_ids: data.attachment_ids,
|
|
3726
|
+
attachment_tokens: [],
|
|
3727
|
+
subtype_xmlid: data.subtype
|
|
3728
|
+
},
|
|
3729
|
+
thread_id: Number(data.thread_id),
|
|
3730
|
+
thread_model: data.thread_model
|
|
3731
|
+
};
|
|
3732
|
+
return env2.requests.post("/chatter/message/post" /* SENT_MESSAGE */, jsonData, {
|
|
3733
|
+
headers: {
|
|
3734
|
+
"Content-Type": "application/json"
|
|
3735
|
+
}
|
|
3736
|
+
});
|
|
3737
|
+
} catch (error) {
|
|
3738
|
+
console.error("Error when sent message:", error);
|
|
3739
|
+
throw error;
|
|
3740
|
+
}
|
|
3741
|
+
});
|
|
3706
3742
|
},
|
|
3707
|
-
|
|
3708
|
-
|
|
3743
|
+
deleteComment(_0) {
|
|
3744
|
+
return __async(this, arguments, function* ({ data }) {
|
|
3745
|
+
try {
|
|
3746
|
+
const env2 = getEnv();
|
|
3747
|
+
const jsonData = {
|
|
3748
|
+
attachment_ids: [],
|
|
3749
|
+
attachment_tokens: [],
|
|
3750
|
+
body: "",
|
|
3751
|
+
message_id: data.message_id
|
|
3752
|
+
};
|
|
3753
|
+
return env2.requests.post("/chatter/message/update_content" /* DELETE_MESSAGE */, jsonData, {
|
|
3754
|
+
headers: {
|
|
3755
|
+
"Content-Type": "application/json"
|
|
3756
|
+
}
|
|
3757
|
+
});
|
|
3758
|
+
} catch (error) {
|
|
3759
|
+
console.error("Error when sent message:", error);
|
|
3760
|
+
throw error;
|
|
3761
|
+
}
|
|
3762
|
+
});
|
|
3763
|
+
},
|
|
3764
|
+
getImage(_0) {
|
|
3765
|
+
return __async(this, arguments, function* ({ data }) {
|
|
3766
|
+
try {
|
|
3767
|
+
const env2 = getEnv();
|
|
3768
|
+
return env2.requests.get(
|
|
3769
|
+
`${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
|
|
3770
|
+
{
|
|
3771
|
+
headers: {
|
|
3772
|
+
"Content-Type": "application/json"
|
|
3773
|
+
}
|
|
3774
|
+
}
|
|
3775
|
+
);
|
|
3776
|
+
} catch (error) {
|
|
3777
|
+
console.error("Error when sent message:", error);
|
|
3778
|
+
throw error;
|
|
3779
|
+
}
|
|
3780
|
+
});
|
|
3781
|
+
},
|
|
3782
|
+
uploadImage(_0) {
|
|
3783
|
+
return __async(this, arguments, function* ({ data }) {
|
|
3784
|
+
try {
|
|
3785
|
+
const env2 = getEnv();
|
|
3786
|
+
return env2.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
|
|
3787
|
+
headers: {
|
|
3788
|
+
"Content-Type": "multipart/form-data"
|
|
3789
|
+
}
|
|
3790
|
+
});
|
|
3791
|
+
} catch (error) {
|
|
3792
|
+
console.error("Error when sent message:", error);
|
|
3793
|
+
throw error;
|
|
3794
|
+
}
|
|
3795
|
+
});
|
|
3796
|
+
},
|
|
3797
|
+
getFormView(_0) {
|
|
3798
|
+
return __async(this, arguments, function* ({ data }) {
|
|
3799
|
+
try {
|
|
3800
|
+
const env2 = getEnv();
|
|
3801
|
+
const jsonData = {
|
|
3802
|
+
model: data.model,
|
|
3803
|
+
method: "get_formview_action",
|
|
3804
|
+
ids: data.id ? [data.id] : [],
|
|
3805
|
+
with_context: data.context
|
|
3806
|
+
};
|
|
3807
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3808
|
+
headers: {
|
|
3809
|
+
"Content-Type": "application/json"
|
|
3810
|
+
}
|
|
3811
|
+
});
|
|
3812
|
+
} catch (error) {
|
|
3813
|
+
console.error("Error when fetching form view:", error);
|
|
3814
|
+
throw error;
|
|
3815
|
+
}
|
|
3816
|
+
});
|
|
3817
|
+
},
|
|
3818
|
+
changeStatus(_0) {
|
|
3819
|
+
return __async(this, arguments, function* ({ data }) {
|
|
3709
3820
|
const env2 = getEnv();
|
|
3821
|
+
const vals = {
|
|
3822
|
+
[data.name]: data.stage_id
|
|
3823
|
+
};
|
|
3710
3824
|
const jsonData = {
|
|
3711
3825
|
model: data.model,
|
|
3712
|
-
method: "
|
|
3713
|
-
|
|
3714
|
-
|
|
3826
|
+
method: "web_save",
|
|
3827
|
+
with_context: {
|
|
3828
|
+
lang: data.lang,
|
|
3829
|
+
allowed_company_ids: [1],
|
|
3830
|
+
uid: 2,
|
|
3831
|
+
search_default_my_ticket: true,
|
|
3832
|
+
search_default_is_open: true
|
|
3833
|
+
},
|
|
3834
|
+
ids: [data.id],
|
|
3835
|
+
kwargs: {
|
|
3836
|
+
vals,
|
|
3837
|
+
specification: {}
|
|
3838
|
+
}
|
|
3715
3839
|
};
|
|
3716
3840
|
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3717
3841
|
headers: {
|
|
3718
3842
|
"Content-Type": "application/json"
|
|
3719
3843
|
}
|
|
3720
3844
|
});
|
|
3721
|
-
} catch (error) {
|
|
3722
|
-
console.error("Error when fetching form view:", error);
|
|
3723
|
-
throw error;
|
|
3724
|
-
}
|
|
3725
|
-
},
|
|
3726
|
-
async changeStatus({ data }) {
|
|
3727
|
-
const env2 = getEnv();
|
|
3728
|
-
const vals = {
|
|
3729
|
-
[data.name]: data.stage_id
|
|
3730
|
-
};
|
|
3731
|
-
const jsonData = {
|
|
3732
|
-
model: data.model,
|
|
3733
|
-
method: "web_save",
|
|
3734
|
-
with_context: {
|
|
3735
|
-
lang: data.lang,
|
|
3736
|
-
allowed_company_ids: [1],
|
|
3737
|
-
uid: 2,
|
|
3738
|
-
search_default_my_ticket: true,
|
|
3739
|
-
search_default_is_open: true
|
|
3740
|
-
},
|
|
3741
|
-
ids: [data.id],
|
|
3742
|
-
kwargs: {
|
|
3743
|
-
vals,
|
|
3744
|
-
specification: {}
|
|
3745
|
-
}
|
|
3746
|
-
};
|
|
3747
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3748
|
-
headers: {
|
|
3749
|
-
"Content-Type": "application/json"
|
|
3750
|
-
}
|
|
3751
3845
|
});
|
|
3752
3846
|
}
|
|
3753
3847
|
};
|
|
@@ -3755,51 +3849,55 @@ var form_service_default = FormService;
|
|
|
3755
3849
|
|
|
3756
3850
|
// src/services/kanban-service/index.ts
|
|
3757
3851
|
var KanbanServices = {
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
width_context
|
|
3761
|
-
}) {
|
|
3762
|
-
const env2 = getEnv();
|
|
3763
|
-
const jsonDataView = {
|
|
3852
|
+
getGroups(_0) {
|
|
3853
|
+
return __async(this, arguments, function* ({
|
|
3764
3854
|
model,
|
|
3765
|
-
method: "web_read_group",
|
|
3766
|
-
kwargs: {
|
|
3767
|
-
domain: [["stage_id.fold", "=", false]],
|
|
3768
|
-
fields: ["color:sum"],
|
|
3769
|
-
groupby: ["stage_id"]
|
|
3770
|
-
},
|
|
3771
3855
|
width_context
|
|
3772
|
-
}
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3856
|
+
}) {
|
|
3857
|
+
const env2 = getEnv();
|
|
3858
|
+
const jsonDataView = {
|
|
3859
|
+
model,
|
|
3860
|
+
method: "web_read_group",
|
|
3861
|
+
kwargs: {
|
|
3862
|
+
domain: [["stage_id.fold", "=", false]],
|
|
3863
|
+
fields: ["color:sum"],
|
|
3864
|
+
groupby: ["stage_id"]
|
|
3865
|
+
},
|
|
3866
|
+
width_context
|
|
3867
|
+
};
|
|
3868
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
3869
|
+
headers: {
|
|
3870
|
+
"Content-Type": "application/json"
|
|
3871
|
+
}
|
|
3872
|
+
});
|
|
3777
3873
|
});
|
|
3778
3874
|
},
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
width_context
|
|
3784
|
-
}) {
|
|
3785
|
-
const env2 = getEnv();
|
|
3786
|
-
const jsonDataView = {
|
|
3875
|
+
getProgressBar(_0) {
|
|
3876
|
+
return __async(this, arguments, function* ({
|
|
3877
|
+
field,
|
|
3878
|
+
color,
|
|
3787
3879
|
model,
|
|
3788
|
-
method: "read_progress_bar",
|
|
3789
|
-
kwargs: {
|
|
3790
|
-
domain: [],
|
|
3791
|
-
group_by: "stage_id",
|
|
3792
|
-
progress_bar: {
|
|
3793
|
-
colors: color,
|
|
3794
|
-
field
|
|
3795
|
-
}
|
|
3796
|
-
},
|
|
3797
3880
|
width_context
|
|
3798
|
-
}
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3881
|
+
}) {
|
|
3882
|
+
const env2 = getEnv();
|
|
3883
|
+
const jsonDataView = {
|
|
3884
|
+
model,
|
|
3885
|
+
method: "read_progress_bar",
|
|
3886
|
+
kwargs: {
|
|
3887
|
+
domain: [],
|
|
3888
|
+
group_by: "stage_id",
|
|
3889
|
+
progress_bar: {
|
|
3890
|
+
colors: color,
|
|
3891
|
+
field
|
|
3892
|
+
}
|
|
3893
|
+
},
|
|
3894
|
+
width_context
|
|
3895
|
+
};
|
|
3896
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
3897
|
+
headers: {
|
|
3898
|
+
"Content-Type": "application/json"
|
|
3899
|
+
}
|
|
3900
|
+
});
|
|
3803
3901
|
});
|
|
3804
3902
|
}
|
|
3805
3903
|
};
|
|
@@ -3808,259 +3906,285 @@ var kanban_service_default = KanbanServices;
|
|
|
3808
3906
|
// src/services/model-service/index.ts
|
|
3809
3907
|
var OBJECT_POSITION = 2;
|
|
3810
3908
|
var ModelService = {
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3909
|
+
getListMyBankAccount(_0) {
|
|
3910
|
+
return __async(this, arguments, function* ({
|
|
3911
|
+
domain,
|
|
3912
|
+
spectification,
|
|
3913
|
+
model
|
|
3914
|
+
}) {
|
|
3915
|
+
const env2 = getEnv();
|
|
3916
|
+
const jsonData = {
|
|
3917
|
+
model,
|
|
3918
|
+
method: "web_search_read",
|
|
3919
|
+
kwargs: {
|
|
3920
|
+
specification: spectification,
|
|
3921
|
+
domain,
|
|
3922
|
+
limit: 100,
|
|
3923
|
+
offset: 0
|
|
3924
|
+
}
|
|
3925
|
+
};
|
|
3926
|
+
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3927
|
+
headers: {
|
|
3928
|
+
"Content-Type": "application/json"
|
|
3929
|
+
}
|
|
3930
|
+
});
|
|
3831
3931
|
});
|
|
3832
3932
|
},
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3933
|
+
getCurrency() {
|
|
3934
|
+
return __async(this, null, function* () {
|
|
3935
|
+
const env2 = getEnv();
|
|
3936
|
+
const jsonData = {
|
|
3937
|
+
model: "res.currency",
|
|
3938
|
+
method: "web_search_read",
|
|
3939
|
+
kwargs: {
|
|
3940
|
+
specification: {
|
|
3941
|
+
icon_url: {},
|
|
3942
|
+
name: {}
|
|
3943
|
+
},
|
|
3944
|
+
domain: [["active", "=", true]],
|
|
3945
|
+
limit: 100,
|
|
3946
|
+
offset: 0
|
|
3947
|
+
}
|
|
3948
|
+
};
|
|
3949
|
+
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3950
|
+
headers: {
|
|
3951
|
+
"Content-Type": "application/json"
|
|
3952
|
+
}
|
|
3953
|
+
});
|
|
3852
3954
|
});
|
|
3853
3955
|
},
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3956
|
+
getConversionRate() {
|
|
3957
|
+
return __async(this, null, function* () {
|
|
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: {}
|
|
3970
|
+
}
|
|
3867
3971
|
}
|
|
3868
|
-
}
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
}
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
}
|
|
3972
|
+
},
|
|
3973
|
+
domain: [["active", "=", true]],
|
|
3974
|
+
limit: 100,
|
|
3975
|
+
offset: 0
|
|
3976
|
+
}
|
|
3977
|
+
};
|
|
3978
|
+
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3979
|
+
headers: {
|
|
3980
|
+
"Content-Type": "application/json"
|
|
3981
|
+
}
|
|
3982
|
+
});
|
|
3879
3983
|
});
|
|
3880
3984
|
},
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
fields: data.fields
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3985
|
+
getAll(_0) {
|
|
3986
|
+
return __async(this, arguments, function* ({ data }) {
|
|
3987
|
+
const env2 = getEnv();
|
|
3988
|
+
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] ? {
|
|
3989
|
+
fields: data.fields,
|
|
3990
|
+
groupby: data.groupby
|
|
3991
|
+
} : {
|
|
3992
|
+
count_limit: 10001,
|
|
3993
|
+
order: data.sort,
|
|
3994
|
+
specification: data.specification
|
|
3995
|
+
};
|
|
3996
|
+
const jsonData = {
|
|
3997
|
+
model: String(data.model),
|
|
3998
|
+
method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
|
|
3999
|
+
ids: data.ids,
|
|
4000
|
+
with_context: data.context,
|
|
4001
|
+
kwargs: __spreadValues({
|
|
4002
|
+
domain: data.domain,
|
|
4003
|
+
limit: data.limit,
|
|
4004
|
+
offset: data.offset
|
|
4005
|
+
}, jsonReadGroup)
|
|
4006
|
+
};
|
|
4007
|
+
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4008
|
+
headers: {
|
|
4009
|
+
"Content-Type": "application/json"
|
|
4010
|
+
}
|
|
4011
|
+
});
|
|
3907
4012
|
});
|
|
3908
4013
|
},
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
fields: data.fields
|
|
3913
|
-
groupby: data.groupby
|
|
3914
|
-
} : {
|
|
3915
|
-
count_limit: 10001,
|
|
3916
|
-
order: data.sort,
|
|
3917
|
-
specification: data.specification
|
|
3918
|
-
};
|
|
3919
|
-
const jsonData = {
|
|
3920
|
-
model: String(data.model),
|
|
3921
|
-
method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
|
|
3922
|
-
ids: data.ids,
|
|
3923
|
-
with_context: data.context,
|
|
3924
|
-
kwargs: {
|
|
3925
|
-
domain: data.domain,
|
|
3926
|
-
limit: data.limit,
|
|
3927
|
-
offset: data.offset,
|
|
4014
|
+
getListCalendar(_0) {
|
|
4015
|
+
return __async(this, arguments, function* ({ data }) {
|
|
4016
|
+
const env2 = getEnv();
|
|
4017
|
+
const jsonReadGroup = data.type == "calendar" ? data == null ? void 0 : data.fields : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
3928
4018
|
fields: data.fields,
|
|
3929
|
-
|
|
3930
|
-
}
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
4019
|
+
groupby: data.groupby
|
|
4020
|
+
} : {
|
|
4021
|
+
count_limit: 10001,
|
|
4022
|
+
order: data.sort,
|
|
4023
|
+
specification: data.specification
|
|
4024
|
+
};
|
|
4025
|
+
const jsonData = {
|
|
4026
|
+
model: String(data.model),
|
|
4027
|
+
method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
|
|
4028
|
+
ids: data.ids,
|
|
4029
|
+
with_context: data.context,
|
|
4030
|
+
kwargs: __spreadValues({
|
|
4031
|
+
domain: data.domain,
|
|
4032
|
+
limit: data.limit,
|
|
4033
|
+
offset: data.offset,
|
|
4034
|
+
fields: data.fields
|
|
4035
|
+
}, jsonReadGroup)
|
|
4036
|
+
};
|
|
4037
|
+
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4038
|
+
headers: {
|
|
4039
|
+
"Content-Type": "application/json"
|
|
4040
|
+
}
|
|
4041
|
+
});
|
|
3936
4042
|
});
|
|
3937
4043
|
},
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
ids = [],
|
|
3941
|
-
specification = {},
|
|
3942
|
-
domain = [],
|
|
3943
|
-
offset,
|
|
3944
|
-
order,
|
|
3945
|
-
context = {},
|
|
3946
|
-
limit = 10
|
|
3947
|
-
}) {
|
|
3948
|
-
const env2 = getEnv();
|
|
3949
|
-
const jsonData = {
|
|
4044
|
+
getList(_0) {
|
|
4045
|
+
return __async(this, arguments, function* ({
|
|
3950
4046
|
model,
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
4047
|
+
ids = [],
|
|
4048
|
+
specification = {},
|
|
4049
|
+
domain = [],
|
|
4050
|
+
offset,
|
|
4051
|
+
order,
|
|
4052
|
+
context = {},
|
|
4053
|
+
limit = 10
|
|
4054
|
+
}) {
|
|
4055
|
+
var _a;
|
|
4056
|
+
const env2 = getEnv();
|
|
4057
|
+
const jsonData = {
|
|
4058
|
+
model,
|
|
4059
|
+
method: "web_search_read" /* WEB_SEARCH_READ */,
|
|
4060
|
+
ids,
|
|
4061
|
+
with_context: context,
|
|
4062
|
+
kwargs: {
|
|
4063
|
+
specification,
|
|
4064
|
+
domain,
|
|
4065
|
+
limit,
|
|
4066
|
+
offset,
|
|
4067
|
+
order
|
|
4068
|
+
}
|
|
4069
|
+
};
|
|
4070
|
+
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
4071
|
+
headers: {
|
|
4072
|
+
"Content-Type": "application/json"
|
|
4073
|
+
}
|
|
4074
|
+
});
|
|
3966
4075
|
});
|
|
3967
4076
|
},
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
specification,
|
|
3972
|
-
context
|
|
3973
|
-
}) {
|
|
3974
|
-
const env2 = getEnv();
|
|
3975
|
-
const jsonData = {
|
|
4077
|
+
getDetail(_0) {
|
|
4078
|
+
return __async(this, arguments, function* ({
|
|
4079
|
+
ids = [],
|
|
3976
4080
|
model,
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
4081
|
+
specification,
|
|
4082
|
+
context
|
|
4083
|
+
}) {
|
|
4084
|
+
var _a;
|
|
4085
|
+
const env2 = getEnv();
|
|
4086
|
+
const jsonData = {
|
|
4087
|
+
model,
|
|
4088
|
+
method: "web_read" /* WEB_READ */,
|
|
4089
|
+
ids,
|
|
4090
|
+
with_context: context,
|
|
4091
|
+
kwargs: {
|
|
4092
|
+
specification
|
|
4093
|
+
}
|
|
4094
|
+
};
|
|
4095
|
+
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
4096
|
+
headers: {
|
|
4097
|
+
"Content-Type": "application/json"
|
|
4098
|
+
}
|
|
4099
|
+
});
|
|
3988
4100
|
});
|
|
3989
4101
|
},
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
ids = [],
|
|
3993
|
-
data = {},
|
|
3994
|
-
specification = {},
|
|
3995
|
-
context = {},
|
|
3996
|
-
path
|
|
3997
|
-
}) {
|
|
3998
|
-
const env2 = getEnv();
|
|
3999
|
-
const jsonData = {
|
|
4102
|
+
save(_0) {
|
|
4103
|
+
return __async(this, arguments, function* ({
|
|
4000
4104
|
model,
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4105
|
+
ids = [],
|
|
4106
|
+
data = {},
|
|
4107
|
+
specification = {},
|
|
4108
|
+
context = {},
|
|
4109
|
+
path
|
|
4110
|
+
}) {
|
|
4111
|
+
var _a;
|
|
4112
|
+
const env2 = getEnv();
|
|
4113
|
+
const jsonData = {
|
|
4114
|
+
model,
|
|
4115
|
+
method: "web_save" /* WEB_SAVE */,
|
|
4116
|
+
with_context: context,
|
|
4117
|
+
ids,
|
|
4118
|
+
kwargs: {
|
|
4119
|
+
vals: data,
|
|
4120
|
+
specification
|
|
4121
|
+
}
|
|
4122
|
+
};
|
|
4123
|
+
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post(path != null ? path : "/call" /* CALL_PATH */, jsonData, {
|
|
4124
|
+
headers: {
|
|
4125
|
+
"Content-Type": "application/json"
|
|
4126
|
+
}
|
|
4127
|
+
});
|
|
4013
4128
|
});
|
|
4014
4129
|
},
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4130
|
+
delete(_0) {
|
|
4131
|
+
return __async(this, arguments, function* ({ ids = [], model }) {
|
|
4132
|
+
var _a;
|
|
4133
|
+
const env2 = getEnv();
|
|
4134
|
+
const jsonData = {
|
|
4135
|
+
model,
|
|
4136
|
+
method: "unlink" /* UNLINK */,
|
|
4137
|
+
ids
|
|
4138
|
+
};
|
|
4139
|
+
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
4140
|
+
headers: {
|
|
4141
|
+
"Content-Type": "application/json"
|
|
4142
|
+
}
|
|
4143
|
+
});
|
|
4026
4144
|
});
|
|
4027
4145
|
},
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
object,
|
|
4032
|
-
specification,
|
|
4033
|
-
context,
|
|
4034
|
-
fieldChange
|
|
4035
|
-
}) {
|
|
4036
|
-
const env2 = getEnv();
|
|
4037
|
-
const jsonData = {
|
|
4146
|
+
onChange(_0) {
|
|
4147
|
+
return __async(this, arguments, function* ({
|
|
4148
|
+
ids = [],
|
|
4038
4149
|
model,
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4150
|
+
object,
|
|
4151
|
+
specification,
|
|
4152
|
+
context,
|
|
4153
|
+
fieldChange
|
|
4154
|
+
}) {
|
|
4155
|
+
var _a;
|
|
4156
|
+
const env2 = getEnv();
|
|
4157
|
+
const jsonData = {
|
|
4158
|
+
model,
|
|
4159
|
+
method: "onchange" /* ONCHANGE */,
|
|
4160
|
+
ids,
|
|
4161
|
+
with_context: context,
|
|
4162
|
+
args: [
|
|
4163
|
+
object ? object : {},
|
|
4164
|
+
fieldChange ? fieldChange : [],
|
|
4165
|
+
specification
|
|
4166
|
+
]
|
|
4167
|
+
};
|
|
4168
|
+
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
4169
|
+
headers: {
|
|
4170
|
+
"Content-Type": "application/json"
|
|
4171
|
+
}
|
|
4172
|
+
});
|
|
4052
4173
|
});
|
|
4053
4174
|
},
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4175
|
+
getListFieldsOnchange(_0) {
|
|
4176
|
+
return __async(this, arguments, function* ({ model }) {
|
|
4177
|
+
var _a;
|
|
4178
|
+
const env2 = getEnv();
|
|
4179
|
+
const jsonData = {
|
|
4180
|
+
model,
|
|
4181
|
+
method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
|
|
4182
|
+
};
|
|
4183
|
+
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
4184
|
+
headers: {
|
|
4185
|
+
"Content-Type": "application/json"
|
|
4186
|
+
}
|
|
4187
|
+
});
|
|
4064
4188
|
});
|
|
4065
4189
|
},
|
|
4066
4190
|
parseORMOdoo(data) {
|
|
@@ -4074,13 +4198,14 @@ var ModelService = {
|
|
|
4074
4198
|
data[key] = "/";
|
|
4075
4199
|
}
|
|
4076
4200
|
}
|
|
4077
|
-
return {
|
|
4201
|
+
return __spreadValues({}, data);
|
|
4078
4202
|
},
|
|
4079
4203
|
toDataJS(data, viewData, model) {
|
|
4204
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
4080
4205
|
for (const key in data) {
|
|
4081
4206
|
if (data[key] === false) {
|
|
4082
4207
|
if (viewData && model) {
|
|
4083
|
-
if (viewData
|
|
4208
|
+
if (((_c = (_b = (_a = viewData == null ? void 0 : viewData.models) == null ? void 0 : _a[model]) == null ? void 0 : _b[key]) == null ? void 0 : _c.type) !== "boolean" /* BOOLEAN */) {
|
|
4084
4209
|
data[key] = null;
|
|
4085
4210
|
}
|
|
4086
4211
|
} else {
|
|
@@ -4090,12 +4215,13 @@ var ModelService = {
|
|
|
4090
4215
|
data[key] = "Draft";
|
|
4091
4216
|
} else if (data[key] !== false) {
|
|
4092
4217
|
if (model !== void 0) {
|
|
4093
|
-
if (viewData
|
|
4094
|
-
data[key] = (data[key]
|
|
4095
|
-
|
|
4218
|
+
if (((_f = (_e = (_d = viewData == null ? void 0 : viewData.models) == null ? void 0 : _d[model]) == null ? void 0 : _e[key]) == null ? void 0 : _f.type) === "one2many" /* ONE2MANY */ || ((_i = (_h = (_g = viewData == null ? void 0 : viewData.models) == null ? void 0 : _g[model]) == null ? void 0 : _h[key]) == null ? void 0 : _i.type) === "many2many" /* MANY2MANY */) {
|
|
4219
|
+
data[key] = (_k = (_j = data[key]) != null ? _j : data[key] = []) == null ? void 0 : _k.map((item) => {
|
|
4220
|
+
var _a2, _b2, _c2, _d2;
|
|
4221
|
+
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;
|
|
4096
4222
|
if (relation !== void 0) {
|
|
4097
|
-
if (viewData
|
|
4098
|
-
if (item
|
|
4223
|
+
if ((_d2 = viewData == null ? void 0 : viewData.models) == null ? void 0 : _d2[relation]) {
|
|
4224
|
+
if ((item == null ? void 0 : item.length) >= 3) {
|
|
4099
4225
|
return ModelService.toDataJS(
|
|
4100
4226
|
item[OBJECT_POSITION],
|
|
4101
4227
|
viewData,
|
|
@@ -4105,7 +4231,7 @@ var ModelService = {
|
|
|
4105
4231
|
return ModelService.toDataJS(item, viewData, relation);
|
|
4106
4232
|
}
|
|
4107
4233
|
} else {
|
|
4108
|
-
if (item
|
|
4234
|
+
if ((item == null ? void 0 : item.length) >= 3) {
|
|
4109
4235
|
return item[OBJECT_POSITION];
|
|
4110
4236
|
} else {
|
|
4111
4237
|
return item;
|
|
@@ -4117,514 +4243,556 @@ var ModelService = {
|
|
|
4117
4243
|
}
|
|
4118
4244
|
}
|
|
4119
4245
|
}
|
|
4120
|
-
return {
|
|
4246
|
+
return __spreadValues({}, data);
|
|
4121
4247
|
}
|
|
4122
4248
|
};
|
|
4123
4249
|
var model_service_default = ModelService;
|
|
4124
4250
|
|
|
4125
4251
|
// src/services/user-service/index.ts
|
|
4126
4252
|
var UserService = {
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4253
|
+
getProfile(path) {
|
|
4254
|
+
return __async(this, null, function* () {
|
|
4255
|
+
const env2 = getEnv();
|
|
4256
|
+
return env2.requests.get(path != null ? path : "/userinfo" /* PROFILE_PATH */, {
|
|
4257
|
+
headers: {
|
|
4258
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
4259
|
+
}
|
|
4260
|
+
});
|
|
4133
4261
|
});
|
|
4134
4262
|
},
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4263
|
+
getUser(_0) {
|
|
4264
|
+
return __async(this, arguments, function* ({ context, id }) {
|
|
4265
|
+
const env2 = getEnv();
|
|
4266
|
+
const jsonData = {
|
|
4267
|
+
model: "res.users",
|
|
4268
|
+
method: "web_read",
|
|
4269
|
+
ids: [id],
|
|
4270
|
+
with_context: context,
|
|
4271
|
+
kwargs: {
|
|
4272
|
+
specification: {
|
|
4273
|
+
display_name: {},
|
|
4274
|
+
image_1920: {},
|
|
4275
|
+
name: {},
|
|
4276
|
+
login: {},
|
|
4277
|
+
email: {},
|
|
4278
|
+
password: {},
|
|
4279
|
+
visible_group_id: {
|
|
4280
|
+
fields: {
|
|
4281
|
+
id: {},
|
|
4282
|
+
display_name: {}
|
|
4283
|
+
}
|
|
4284
|
+
},
|
|
4285
|
+
company_id: {
|
|
4286
|
+
fields: {
|
|
4287
|
+
id: {},
|
|
4288
|
+
display_name: {}
|
|
4289
|
+
}
|
|
4160
4290
|
}
|
|
4161
4291
|
}
|
|
4162
4292
|
}
|
|
4163
|
-
}
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
}
|
|
4293
|
+
};
|
|
4294
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4295
|
+
headers: {
|
|
4296
|
+
"Content-Type": "application/json"
|
|
4297
|
+
}
|
|
4298
|
+
});
|
|
4169
4299
|
});
|
|
4170
4300
|
},
|
|
4171
|
-
switchUserLocale:
|
|
4301
|
+
switchUserLocale: (_0) => __async(null, [_0], function* ({ id, values }) {
|
|
4302
|
+
var _a;
|
|
4172
4303
|
const env2 = getEnv();
|
|
4173
4304
|
const jsonData = {
|
|
4174
4305
|
model: "res.users",
|
|
4175
4306
|
domain: [["id", "=", id]],
|
|
4176
4307
|
values
|
|
4177
4308
|
};
|
|
4178
|
-
return env2
|
|
4309
|
+
return env2 == null ? void 0 : env2.requests.post((_a = UriConstants) == null ? void 0 : _a.CREATE_UPDATE_PATH, jsonData, {
|
|
4179
4310
|
headers: {
|
|
4180
4311
|
"Content-Type": "application/json"
|
|
4181
4312
|
}
|
|
4182
4313
|
});
|
|
4183
|
-
}
|
|
4314
|
+
})
|
|
4184
4315
|
};
|
|
4185
4316
|
var user_service_default = UserService;
|
|
4186
4317
|
|
|
4187
4318
|
// src/services/view-service/index.ts
|
|
4188
4319
|
var ViewService = {
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
views,
|
|
4192
|
-
context = {},
|
|
4193
|
-
options = {},
|
|
4194
|
-
aid
|
|
4195
|
-
}) {
|
|
4196
|
-
const env2 = getEnv();
|
|
4197
|
-
const defaultOptions = {
|
|
4198
|
-
load_filters: true,
|
|
4199
|
-
toolbar: true,
|
|
4200
|
-
action_id: aid
|
|
4201
|
-
};
|
|
4202
|
-
const jsonDataView = {
|
|
4320
|
+
getView(_0) {
|
|
4321
|
+
return __async(this, arguments, function* ({
|
|
4203
4322
|
model,
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4323
|
+
views,
|
|
4324
|
+
context = {},
|
|
4325
|
+
options = {},
|
|
4326
|
+
aid
|
|
4327
|
+
}) {
|
|
4328
|
+
var _a;
|
|
4329
|
+
const env2 = getEnv();
|
|
4330
|
+
const defaultOptions = {
|
|
4331
|
+
load_filters: true,
|
|
4332
|
+
toolbar: true,
|
|
4333
|
+
action_id: aid
|
|
4334
|
+
};
|
|
4335
|
+
const jsonDataView = {
|
|
4336
|
+
model,
|
|
4337
|
+
method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
|
|
4338
|
+
kwargs: {
|
|
4339
|
+
views,
|
|
4340
|
+
options: __spreadValues(__spreadValues({}, options), defaultOptions)
|
|
4341
|
+
},
|
|
4342
|
+
with_context: context
|
|
4343
|
+
};
|
|
4344
|
+
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
4345
|
+
headers: {
|
|
4346
|
+
"Content-Type": "application/json"
|
|
4347
|
+
}
|
|
4348
|
+
});
|
|
4215
4349
|
});
|
|
4216
4350
|
},
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
web_icon: {},
|
|
4241
|
-
web_icon_data: {},
|
|
4242
|
-
groups_id: {
|
|
4243
|
-
fields: {
|
|
4244
|
-
full_name: {}
|
|
4351
|
+
getMenu(context) {
|
|
4352
|
+
return __async(this, null, function* () {
|
|
4353
|
+
var _a;
|
|
4354
|
+
const env2 = getEnv();
|
|
4355
|
+
const jsonData = {
|
|
4356
|
+
model: "ir.ui.menu" /* MENU */,
|
|
4357
|
+
method: "web_search_read" /* WEB_SEARCH_READ */,
|
|
4358
|
+
ids: [],
|
|
4359
|
+
with_context: context,
|
|
4360
|
+
kwargs: {
|
|
4361
|
+
specification: {
|
|
4362
|
+
active: {},
|
|
4363
|
+
name: {},
|
|
4364
|
+
is_display: {},
|
|
4365
|
+
sequence: {},
|
|
4366
|
+
complete_name: {},
|
|
4367
|
+
action: {
|
|
4368
|
+
fields: {
|
|
4369
|
+
display_name: {},
|
|
4370
|
+
type: {},
|
|
4371
|
+
binding_view_types: {}
|
|
4372
|
+
// res_model: {},
|
|
4373
|
+
}
|
|
4245
4374
|
},
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
active: {},
|
|
4253
|
-
name: {},
|
|
4254
|
-
is_display: {},
|
|
4255
|
-
sequence: {},
|
|
4256
|
-
complete_name: {},
|
|
4257
|
-
action: {
|
|
4258
|
-
fields: {
|
|
4259
|
-
display_name: {},
|
|
4260
|
-
type: {},
|
|
4261
|
-
binding_view_types: {}
|
|
4262
|
-
// res_model: {},
|
|
4263
|
-
}
|
|
4375
|
+
url_icon: {},
|
|
4376
|
+
web_icon: {},
|
|
4377
|
+
web_icon_data: {},
|
|
4378
|
+
groups_id: {
|
|
4379
|
+
fields: {
|
|
4380
|
+
full_name: {}
|
|
4264
4381
|
},
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4382
|
+
limit: 40,
|
|
4383
|
+
order: ""
|
|
4384
|
+
},
|
|
4385
|
+
display_name: {},
|
|
4386
|
+
child_id: {
|
|
4387
|
+
fields: {
|
|
4388
|
+
active: {},
|
|
4389
|
+
name: {},
|
|
4390
|
+
is_display: {},
|
|
4391
|
+
sequence: {},
|
|
4392
|
+
complete_name: {},
|
|
4393
|
+
action: {
|
|
4394
|
+
fields: {
|
|
4395
|
+
display_name: {},
|
|
4396
|
+
type: {},
|
|
4397
|
+
binding_view_types: {}
|
|
4398
|
+
// res_model: {},
|
|
4399
|
+
}
|
|
4271
4400
|
},
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
active: {},
|
|
4279
|
-
name: {},
|
|
4280
|
-
is_display: {},
|
|
4281
|
-
sequence: {},
|
|
4282
|
-
complete_name: {},
|
|
4283
|
-
action: {
|
|
4284
|
-
fields: {
|
|
4285
|
-
display_name: {},
|
|
4286
|
-
type: {},
|
|
4287
|
-
binding_view_types: {}
|
|
4288
|
-
// res_model: {},
|
|
4289
|
-
}
|
|
4401
|
+
url_icon: {},
|
|
4402
|
+
web_icon: {},
|
|
4403
|
+
web_icon_data: {},
|
|
4404
|
+
groups_id: {
|
|
4405
|
+
fields: {
|
|
4406
|
+
full_name: {}
|
|
4290
4407
|
},
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4408
|
+
limit: 40,
|
|
4409
|
+
order: ""
|
|
4410
|
+
},
|
|
4411
|
+
display_name: {},
|
|
4412
|
+
child_id: {
|
|
4413
|
+
fields: {
|
|
4414
|
+
active: {},
|
|
4415
|
+
name: {},
|
|
4416
|
+
is_display: {},
|
|
4417
|
+
sequence: {},
|
|
4418
|
+
complete_name: {},
|
|
4419
|
+
action: {
|
|
4420
|
+
fields: {
|
|
4421
|
+
display_name: {},
|
|
4422
|
+
type: {},
|
|
4423
|
+
binding_view_types: {}
|
|
4424
|
+
// res_model: {},
|
|
4425
|
+
}
|
|
4297
4426
|
},
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
active: {},
|
|
4305
|
-
name: {},
|
|
4306
|
-
is_display: {},
|
|
4307
|
-
sequence: {},
|
|
4308
|
-
complete_name: {},
|
|
4309
|
-
action: {
|
|
4310
|
-
fields: {
|
|
4311
|
-
display_name: {},
|
|
4312
|
-
type: {},
|
|
4313
|
-
binding_view_types: {}
|
|
4314
|
-
// res_model: {},
|
|
4315
|
-
}
|
|
4427
|
+
url_icon: {},
|
|
4428
|
+
web_icon: {},
|
|
4429
|
+
web_icon_data: {},
|
|
4430
|
+
groups_id: {
|
|
4431
|
+
fields: {
|
|
4432
|
+
full_name: {}
|
|
4316
4433
|
},
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4434
|
+
limit: 40,
|
|
4435
|
+
order: ""
|
|
4436
|
+
},
|
|
4437
|
+
display_name: {},
|
|
4438
|
+
child_id: {
|
|
4439
|
+
fields: {
|
|
4440
|
+
active: {},
|
|
4441
|
+
name: {},
|
|
4442
|
+
is_display: {},
|
|
4443
|
+
sequence: {},
|
|
4444
|
+
complete_name: {},
|
|
4445
|
+
action: {
|
|
4446
|
+
fields: {
|
|
4447
|
+
display_name: {},
|
|
4448
|
+
type: {},
|
|
4449
|
+
binding_view_types: {}
|
|
4450
|
+
// res_model: {},
|
|
4451
|
+
}
|
|
4323
4452
|
},
|
|
4324
|
-
|
|
4325
|
-
|
|
4453
|
+
url_icon: {},
|
|
4454
|
+
web_icon: {},
|
|
4455
|
+
web_icon_data: {},
|
|
4456
|
+
groups_id: {
|
|
4457
|
+
fields: {
|
|
4458
|
+
full_name: {}
|
|
4459
|
+
},
|
|
4460
|
+
limit: 40,
|
|
4461
|
+
order: ""
|
|
4462
|
+
},
|
|
4463
|
+
display_name: {},
|
|
4464
|
+
child_id: {
|
|
4465
|
+
fields: {},
|
|
4466
|
+
limit: 40,
|
|
4467
|
+
order: ""
|
|
4468
|
+
}
|
|
4326
4469
|
},
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
}
|
|
4354
|
-
};
|
|
4355
|
-
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4356
|
-
headers: {
|
|
4357
|
-
"Content-Type": "application/json"
|
|
4358
|
-
}
|
|
4470
|
+
limit: 40,
|
|
4471
|
+
order: ""
|
|
4472
|
+
}
|
|
4473
|
+
},
|
|
4474
|
+
limit: 40,
|
|
4475
|
+
order: ""
|
|
4476
|
+
}
|
|
4477
|
+
},
|
|
4478
|
+
limit: 40,
|
|
4479
|
+
order: ""
|
|
4480
|
+
}
|
|
4481
|
+
},
|
|
4482
|
+
domain: [
|
|
4483
|
+
"&",
|
|
4484
|
+
["is_display", "=", true],
|
|
4485
|
+
"&",
|
|
4486
|
+
["active", "=", true],
|
|
4487
|
+
["parent_id", "=", false]
|
|
4488
|
+
]
|
|
4489
|
+
}
|
|
4490
|
+
};
|
|
4491
|
+
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
4492
|
+
headers: {
|
|
4493
|
+
"Content-Type": "application/json"
|
|
4494
|
+
}
|
|
4495
|
+
});
|
|
4359
4496
|
});
|
|
4360
4497
|
},
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4498
|
+
getActionDetail(aid, context) {
|
|
4499
|
+
return __async(this, null, function* () {
|
|
4500
|
+
var _a;
|
|
4501
|
+
const env2 = getEnv();
|
|
4502
|
+
const jsonData = {
|
|
4503
|
+
model: "ir.actions.act_window" /* WINDOW_ACTION */,
|
|
4504
|
+
method: "web_read" /* WEB_READ */,
|
|
4505
|
+
ids: [aid],
|
|
4506
|
+
with_context: context,
|
|
4507
|
+
kwargs: {
|
|
4508
|
+
specification: {
|
|
4509
|
+
id: {},
|
|
4510
|
+
name: {},
|
|
4511
|
+
res_model: {},
|
|
4512
|
+
views: {},
|
|
4513
|
+
view_mode: {},
|
|
4514
|
+
mobile_view_mode: {},
|
|
4515
|
+
domain: {},
|
|
4516
|
+
context: {},
|
|
4517
|
+
groups_id: {},
|
|
4518
|
+
search_view_id: {}
|
|
4519
|
+
}
|
|
4380
4520
|
}
|
|
4381
|
-
}
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
}
|
|
4521
|
+
};
|
|
4522
|
+
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
4523
|
+
headers: {
|
|
4524
|
+
"Content-Type": "application/json"
|
|
4525
|
+
}
|
|
4526
|
+
});
|
|
4387
4527
|
});
|
|
4388
4528
|
},
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
ids,
|
|
4392
|
-
context,
|
|
4393
|
-
offset
|
|
4394
|
-
}) {
|
|
4395
|
-
const env2 = getEnv();
|
|
4396
|
-
const jsonData = {
|
|
4529
|
+
getResequence(_0) {
|
|
4530
|
+
return __async(this, arguments, function* ({
|
|
4397
4531
|
model,
|
|
4398
|
-
with_context: context,
|
|
4399
4532
|
ids,
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
}
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4533
|
+
context,
|
|
4534
|
+
offset
|
|
4535
|
+
}) {
|
|
4536
|
+
const env2 = getEnv();
|
|
4537
|
+
const jsonData = __spreadValues({
|
|
4538
|
+
model,
|
|
4539
|
+
with_context: context,
|
|
4540
|
+
ids,
|
|
4541
|
+
field: "sequence"
|
|
4542
|
+
}, offset > 0 ? { offset } : {});
|
|
4543
|
+
return env2 == null ? void 0 : env2.requests.post("/web/dataset/resequence", jsonData, {
|
|
4544
|
+
headers: {
|
|
4545
|
+
"Content-Type": "application/json"
|
|
4546
|
+
}
|
|
4547
|
+
});
|
|
4407
4548
|
});
|
|
4408
4549
|
},
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4550
|
+
getSelectionItem(_0) {
|
|
4551
|
+
return __async(this, arguments, function* ({ data }) {
|
|
4552
|
+
var _a;
|
|
4553
|
+
const env2 = getEnv();
|
|
4554
|
+
const jsonData = {
|
|
4555
|
+
model: data.model,
|
|
4556
|
+
ids: [],
|
|
4557
|
+
method: "get_data_select",
|
|
4558
|
+
with_context: data.context,
|
|
4559
|
+
kwargs: {
|
|
4560
|
+
count_limit: 10001,
|
|
4561
|
+
domain: data.domain ? data.domain : [],
|
|
4562
|
+
offset: 0,
|
|
4563
|
+
order: "",
|
|
4564
|
+
specification: (_a = data == null ? void 0 : data.specification) != null ? _a : {
|
|
4565
|
+
id: {},
|
|
4566
|
+
name: {},
|
|
4567
|
+
display_name: {}
|
|
4568
|
+
}
|
|
4425
4569
|
}
|
|
4426
|
-
}
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
}
|
|
4570
|
+
};
|
|
4571
|
+
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4572
|
+
headers: {
|
|
4573
|
+
"Content-Type": "application/json"
|
|
4574
|
+
}
|
|
4575
|
+
});
|
|
4432
4576
|
});
|
|
4433
4577
|
},
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4578
|
+
loadMessages() {
|
|
4579
|
+
return __async(this, null, function* () {
|
|
4580
|
+
const env2 = getEnv();
|
|
4581
|
+
return env2.requests.post(
|
|
4582
|
+
"/load_message_failures" /* LOAD_MESSAGE */,
|
|
4583
|
+
{},
|
|
4584
|
+
{
|
|
4585
|
+
headers: {
|
|
4586
|
+
"Content-Type": "application/json"
|
|
4587
|
+
}
|
|
4588
|
+
}
|
|
4589
|
+
);
|
|
4590
|
+
});
|
|
4591
|
+
},
|
|
4592
|
+
getVersion() {
|
|
4593
|
+
return __async(this, null, function* () {
|
|
4594
|
+
var _a;
|
|
4595
|
+
const env2 = getEnv();
|
|
4596
|
+
console.log("env?.requests", env2, env2 == null ? void 0 : env2.requests);
|
|
4597
|
+
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.get("", {
|
|
4440
4598
|
headers: {
|
|
4441
4599
|
"Content-Type": "application/json"
|
|
4442
4600
|
}
|
|
4443
|
-
}
|
|
4444
|
-
);
|
|
4445
|
-
},
|
|
4446
|
-
async getVersion() {
|
|
4447
|
-
const env2 = getEnv();
|
|
4448
|
-
return env2?.requests.get("", {
|
|
4449
|
-
headers: {
|
|
4450
|
-
"Content-Type": "application/json"
|
|
4451
|
-
}
|
|
4601
|
+
});
|
|
4452
4602
|
});
|
|
4453
4603
|
},
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
with_context
|
|
4457
|
-
}) {
|
|
4458
|
-
const env2 = getEnv();
|
|
4459
|
-
const jsonData = {
|
|
4604
|
+
get2FAMethods(_0) {
|
|
4605
|
+
return __async(this, arguments, function* ({
|
|
4460
4606
|
method,
|
|
4461
4607
|
with_context
|
|
4462
|
-
}
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4608
|
+
}) {
|
|
4609
|
+
const env2 = getEnv();
|
|
4610
|
+
const jsonData = {
|
|
4611
|
+
method,
|
|
4612
|
+
with_context
|
|
4613
|
+
};
|
|
4614
|
+
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4615
|
+
headers: {
|
|
4616
|
+
"Content-Type": "application/json"
|
|
4617
|
+
}
|
|
4618
|
+
});
|
|
4467
4619
|
});
|
|
4468
4620
|
},
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
with_context,
|
|
4472
|
-
code,
|
|
4473
|
-
device,
|
|
4474
|
-
location
|
|
4475
|
-
}) {
|
|
4476
|
-
const env2 = getEnv();
|
|
4477
|
-
const jsonData = {
|
|
4621
|
+
verify2FA(_0) {
|
|
4622
|
+
return __async(this, arguments, function* ({
|
|
4478
4623
|
method,
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4624
|
+
with_context,
|
|
4625
|
+
code,
|
|
4626
|
+
device,
|
|
4627
|
+
location
|
|
4628
|
+
}) {
|
|
4629
|
+
const env2 = getEnv();
|
|
4630
|
+
const jsonData = {
|
|
4631
|
+
method,
|
|
4632
|
+
kwargs: {
|
|
4633
|
+
vals: {
|
|
4634
|
+
code,
|
|
4635
|
+
device,
|
|
4636
|
+
location
|
|
4637
|
+
}
|
|
4638
|
+
},
|
|
4639
|
+
with_context
|
|
4640
|
+
};
|
|
4641
|
+
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4642
|
+
headers: {
|
|
4643
|
+
"Content-Type": "application/json"
|
|
4644
|
+
},
|
|
4645
|
+
withCredentials: true
|
|
4646
|
+
});
|
|
4493
4647
|
});
|
|
4494
4648
|
},
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
state,
|
|
4498
|
-
client_id,
|
|
4499
|
-
response_type,
|
|
4500
|
-
path
|
|
4501
|
-
}) {
|
|
4502
|
-
const env2 = getEnv();
|
|
4503
|
-
const params = new URLSearchParams({
|
|
4504
|
-
response_type,
|
|
4505
|
-
client_id,
|
|
4649
|
+
signInSSO(_0) {
|
|
4650
|
+
return __async(this, arguments, function* ({
|
|
4506
4651
|
redirect_uri,
|
|
4507
|
-
state
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4652
|
+
state,
|
|
4653
|
+
client_id,
|
|
4654
|
+
response_type,
|
|
4655
|
+
path
|
|
4656
|
+
}) {
|
|
4657
|
+
const env2 = getEnv();
|
|
4658
|
+
const params = new URLSearchParams({
|
|
4659
|
+
response_type,
|
|
4660
|
+
client_id,
|
|
4661
|
+
redirect_uri,
|
|
4662
|
+
state
|
|
4663
|
+
});
|
|
4664
|
+
const url = `${path}?${params.toString()}`;
|
|
4665
|
+
return env2 == null ? void 0 : env2.requests.get(url, {
|
|
4666
|
+
headers: {
|
|
4667
|
+
"Content-Type": "application/json"
|
|
4668
|
+
},
|
|
4669
|
+
withCredentials: true
|
|
4670
|
+
});
|
|
4515
4671
|
});
|
|
4516
4672
|
},
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
state,
|
|
4520
|
-
client_id,
|
|
4521
|
-
scopes
|
|
4522
|
-
}) {
|
|
4523
|
-
const env2 = getEnv();
|
|
4524
|
-
const jsonData = {
|
|
4673
|
+
grantAccess(_0) {
|
|
4674
|
+
return __async(this, arguments, function* ({
|
|
4525
4675
|
redirect_uri,
|
|
4526
4676
|
state,
|
|
4527
4677
|
client_id,
|
|
4528
4678
|
scopes
|
|
4529
|
-
}
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4679
|
+
}) {
|
|
4680
|
+
const env2 = getEnv();
|
|
4681
|
+
const jsonData = {
|
|
4682
|
+
redirect_uri,
|
|
4683
|
+
state,
|
|
4684
|
+
client_id,
|
|
4685
|
+
scopes
|
|
4686
|
+
};
|
|
4687
|
+
return env2 == null ? void 0 : env2.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
|
|
4688
|
+
headers: {
|
|
4689
|
+
"Content-Type": "application/json"
|
|
4690
|
+
},
|
|
4691
|
+
withCredentials: true
|
|
4692
|
+
});
|
|
4535
4693
|
});
|
|
4536
4694
|
},
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
token,
|
|
4540
|
-
views
|
|
4541
|
-
}) {
|
|
4542
|
-
const env2 = getEnv();
|
|
4543
|
-
const jsonData = {
|
|
4695
|
+
getFieldsViewSecurity(_0) {
|
|
4696
|
+
return __async(this, arguments, function* ({
|
|
4544
4697
|
method,
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4698
|
+
token,
|
|
4699
|
+
views
|
|
4700
|
+
}) {
|
|
4701
|
+
const env2 = getEnv();
|
|
4702
|
+
const jsonData = {
|
|
4703
|
+
method,
|
|
4704
|
+
kwargs: {
|
|
4705
|
+
views
|
|
4706
|
+
},
|
|
4707
|
+
with_context: {
|
|
4708
|
+
token
|
|
4709
|
+
}
|
|
4710
|
+
};
|
|
4711
|
+
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4712
|
+
headers: {
|
|
4713
|
+
"Content-Type": "application/json"
|
|
4714
|
+
}
|
|
4715
|
+
});
|
|
4556
4716
|
});
|
|
4557
4717
|
},
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
model,
|
|
4561
|
-
kwargs,
|
|
4562
|
-
token
|
|
4563
|
-
}) {
|
|
4564
|
-
const env2 = getEnv();
|
|
4565
|
-
const jsonData = {
|
|
4718
|
+
settingsWebRead2fa(_0) {
|
|
4719
|
+
return __async(this, arguments, function* ({
|
|
4566
4720
|
method,
|
|
4567
4721
|
model,
|
|
4568
4722
|
kwargs,
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4723
|
+
token
|
|
4724
|
+
}) {
|
|
4725
|
+
const env2 = getEnv();
|
|
4726
|
+
const jsonData = {
|
|
4727
|
+
method,
|
|
4728
|
+
model,
|
|
4729
|
+
kwargs,
|
|
4730
|
+
with_context: {
|
|
4731
|
+
token
|
|
4732
|
+
}
|
|
4733
|
+
};
|
|
4734
|
+
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4735
|
+
headers: {
|
|
4736
|
+
"Content-Type": "application/json"
|
|
4737
|
+
}
|
|
4738
|
+
});
|
|
4577
4739
|
});
|
|
4578
4740
|
},
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4741
|
+
requestSetupTotp(_0) {
|
|
4742
|
+
return __async(this, arguments, function* ({ method, token }) {
|
|
4743
|
+
const env2 = getEnv();
|
|
4744
|
+
const jsonData = {
|
|
4745
|
+
method,
|
|
4746
|
+
with_context: {
|
|
4747
|
+
token
|
|
4748
|
+
}
|
|
4749
|
+
};
|
|
4750
|
+
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4751
|
+
headers: {
|
|
4752
|
+
"Content-Type": "application/json"
|
|
4753
|
+
}
|
|
4754
|
+
});
|
|
4591
4755
|
});
|
|
4592
4756
|
},
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
action_token,
|
|
4596
|
-
code
|
|
4597
|
-
}) {
|
|
4598
|
-
const env2 = getEnv();
|
|
4599
|
-
const jsonData = {
|
|
4757
|
+
verifyTotp(_0) {
|
|
4758
|
+
return __async(this, arguments, function* ({
|
|
4600
4759
|
method,
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4760
|
+
action_token,
|
|
4761
|
+
code
|
|
4762
|
+
}) {
|
|
4763
|
+
const env2 = getEnv();
|
|
4764
|
+
const jsonData = {
|
|
4765
|
+
method,
|
|
4766
|
+
kwargs: {
|
|
4767
|
+
vals: {
|
|
4768
|
+
code
|
|
4769
|
+
}
|
|
4770
|
+
},
|
|
4771
|
+
with_context: {
|
|
4772
|
+
action_token
|
|
4604
4773
|
}
|
|
4605
|
-
}
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
headers: {
|
|
4612
|
-
"Content-Type": "application/json"
|
|
4613
|
-
}
|
|
4774
|
+
};
|
|
4775
|
+
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4776
|
+
headers: {
|
|
4777
|
+
"Content-Type": "application/json"
|
|
4778
|
+
}
|
|
4779
|
+
});
|
|
4614
4780
|
});
|
|
4615
4781
|
},
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4782
|
+
removeTotpSetUp(_0) {
|
|
4783
|
+
return __async(this, arguments, function* ({ method, token }) {
|
|
4784
|
+
const env2 = getEnv();
|
|
4785
|
+
const jsonData = {
|
|
4786
|
+
method,
|
|
4787
|
+
with_context: {
|
|
4788
|
+
token
|
|
4789
|
+
}
|
|
4790
|
+
};
|
|
4791
|
+
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4792
|
+
headers: {
|
|
4793
|
+
"Content-Type": "application/json"
|
|
4794
|
+
}
|
|
4795
|
+
});
|
|
4628
4796
|
});
|
|
4629
4797
|
}
|
|
4630
4798
|
};
|
|
@@ -4660,7 +4828,7 @@ import { useMutation as useMutation3 } from "@tanstack/react-query";
|
|
|
4660
4828
|
var useGetProvider = () => {
|
|
4661
4829
|
return useMutation3({
|
|
4662
4830
|
mutationFn: (data) => {
|
|
4663
|
-
return auth_service_default.getProviders(data
|
|
4831
|
+
return auth_service_default.getProviders(data == null ? void 0 : data.db);
|
|
4664
4832
|
}
|
|
4665
4833
|
});
|
|
4666
4834
|
};
|
|
@@ -5160,10 +5328,6 @@ var use_get_list_my_bank_account_default = useGetListMyBankAccount;
|
|
|
5160
5328
|
|
|
5161
5329
|
// src/models/base-model/index.ts
|
|
5162
5330
|
var BaseModel = class {
|
|
5163
|
-
name;
|
|
5164
|
-
view;
|
|
5165
|
-
actContext;
|
|
5166
|
-
fields;
|
|
5167
5331
|
constructor(init) {
|
|
5168
5332
|
this.name = init.name;
|
|
5169
5333
|
this.view = init.view;
|
|
@@ -5178,21 +5342,22 @@ var BaseModel = class {
|
|
|
5178
5342
|
modelRoot
|
|
5179
5343
|
}) {
|
|
5180
5344
|
if (Array.isArray(fields)) {
|
|
5181
|
-
let spec = {
|
|
5345
|
+
let spec = __spreadValues({}, specification);
|
|
5182
5346
|
fields.forEach((field) => {
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
const
|
|
5347
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
5348
|
+
if (!(field == null ? void 0 : field.type_co) || (field == null ? void 0 : field.name) && (field == null ? void 0 : field.type_co) === "field" /* FIELD */) {
|
|
5349
|
+
if ((_a = modelsData == null ? void 0 : modelsData[model]) == null ? void 0 : _a[field == null ? void 0 : field.name]) {
|
|
5350
|
+
if (((_c = (_b = modelsData == null ? void 0 : modelsData[model]) == null ? void 0 : _b[field == null ? void 0 : field.name]) == null ? void 0 : _c.type) === "one2many" /* ONE2MANY */ || ((_e = (_d = modelsData == null ? void 0 : modelsData[model]) == null ? void 0 : _d[field == null ? void 0 : field.name]) == null ? void 0 : _e.type) === "many2many" /* MANY2MANY */) {
|
|
5351
|
+
const relation = (_g = (_f = modelsData == null ? void 0 : modelsData[model]) == null ? void 0 : _f[field == null ? void 0 : field.name]) == null ? void 0 : _g.relation;
|
|
5352
|
+
const modelRelation = modelsData == null ? void 0 : modelsData[relation];
|
|
5188
5353
|
if (modelRelation) {
|
|
5189
|
-
spec[field
|
|
5354
|
+
spec[field == null ? void 0 : field.name] = {
|
|
5190
5355
|
fields: {}
|
|
5191
5356
|
};
|
|
5192
5357
|
if (modelRoot && modelRoot === relation) {
|
|
5193
|
-
spec[field
|
|
5358
|
+
spec[field == null ? void 0 : field.name].fields = { id: {} };
|
|
5194
5359
|
} else {
|
|
5195
|
-
spec[field
|
|
5360
|
+
spec[field == null ? void 0 : field.name].fields = this.getSpecificationByFields({
|
|
5196
5361
|
fields: Object.values(modelRelation),
|
|
5197
5362
|
specification: {},
|
|
5198
5363
|
modelsData,
|
|
@@ -5201,45 +5366,42 @@ var BaseModel = class {
|
|
|
5201
5366
|
});
|
|
5202
5367
|
}
|
|
5203
5368
|
} else {
|
|
5204
|
-
spec[field
|
|
5369
|
+
spec[field == null ? void 0 : field.name] = {
|
|
5205
5370
|
fields: {
|
|
5206
5371
|
id: {},
|
|
5207
5372
|
display_name: {}
|
|
5208
5373
|
}
|
|
5209
5374
|
};
|
|
5210
5375
|
}
|
|
5211
|
-
} else if (modelsData
|
|
5212
|
-
spec[field
|
|
5213
|
-
fields: {
|
|
5376
|
+
} else if (((_i = (_h = modelsData == null ? void 0 : modelsData[model]) == null ? void 0 : _h[field == null ? void 0 : field.name]) == null ? void 0 : _i.type) === "many2one" /* MANY2ONE */) {
|
|
5377
|
+
spec[field == null ? void 0 : field.name] = {
|
|
5378
|
+
fields: __spreadValues(__spreadValues(__spreadValues({
|
|
5214
5379
|
id: {},
|
|
5215
|
-
display_name: {}
|
|
5216
|
-
|
|
5217
|
-
...field?.name === "currency_id" && fields?.find((item) => item?.widget === "monetary") ? { symbol: {} } : {},
|
|
5218
|
-
...field?.widget === "many2many_binary" ? { mimetype: {} } : {}
|
|
5219
|
-
}
|
|
5380
|
+
display_name: {}
|
|
5381
|
+
}, WIDGETAVATAR[field == null ? void 0 : field.widget] ? { image_256: {} } : {}), (field == null ? void 0 : field.name) === "currency_id" && (fields == null ? void 0 : fields.find((item) => (item == null ? void 0 : item.widget) === "monetary")) ? { symbol: {} } : {}), (field == null ? void 0 : field.widget) === "many2many_binary" ? { mimetype: {} } : {})
|
|
5220
5382
|
};
|
|
5221
5383
|
} else {
|
|
5222
|
-
spec[field
|
|
5384
|
+
spec[field == null ? void 0 : field.name] = {};
|
|
5223
5385
|
}
|
|
5224
5386
|
}
|
|
5225
|
-
} else if (field
|
|
5387
|
+
} else if ((field == null ? void 0 : field.type_co) === "group" /* GROUP */ || (field == null ? void 0 : field.type_co) === "div" /* DIV */ || (field == null ? void 0 : field.type_co) === "span" /* SPAN */) {
|
|
5226
5388
|
const specGroup = this.getSpecificationByFields({
|
|
5227
|
-
fields: field
|
|
5389
|
+
fields: field == null ? void 0 : field.fields,
|
|
5228
5390
|
specification: spec,
|
|
5229
5391
|
modelsData,
|
|
5230
5392
|
model
|
|
5231
5393
|
});
|
|
5232
|
-
spec = {
|
|
5233
|
-
} else if (field
|
|
5234
|
-
const relation = modelsData
|
|
5394
|
+
spec = __spreadValues(__spreadValues({}, spec), specGroup);
|
|
5395
|
+
} else if ((field == null ? void 0 : field.type_co) === "tree" /* TREE */ || (field == null ? void 0 : field.type_co) === "list" /* LIST */) {
|
|
5396
|
+
const relation = (_k = (_j = modelsData == null ? void 0 : modelsData[model]) == null ? void 0 : _j[field == null ? void 0 : field.name]) == null ? void 0 : _k.relation;
|
|
5235
5397
|
const specTreee = this.getSpecificationByFields({
|
|
5236
|
-
fields: field
|
|
5398
|
+
fields: field == null ? void 0 : field.fields,
|
|
5237
5399
|
specification: {},
|
|
5238
5400
|
modelsData,
|
|
5239
5401
|
model: relation,
|
|
5240
5402
|
modelRoot: model
|
|
5241
5403
|
});
|
|
5242
|
-
spec = {
|
|
5404
|
+
spec = __spreadProps(__spreadValues({}, spec), { [field == null ? void 0 : field.name]: { fields: specTreee } });
|
|
5243
5405
|
}
|
|
5244
5406
|
});
|
|
5245
5407
|
return spec;
|
|
@@ -5248,16 +5410,19 @@ var BaseModel = class {
|
|
|
5248
5410
|
}
|
|
5249
5411
|
}
|
|
5250
5412
|
getTreeProps() {
|
|
5251
|
-
|
|
5413
|
+
var _a, _b;
|
|
5414
|
+
const props = ((_b = (_a = this.view) == null ? void 0 : _a.views) == null ? void 0 : _b.list) || {};
|
|
5252
5415
|
return props;
|
|
5253
5416
|
}
|
|
5254
5417
|
getTreeFields() {
|
|
5255
|
-
|
|
5418
|
+
var _a, _b, _c;
|
|
5419
|
+
const fields = ((_c = (_b = (_a = this.view) == null ? void 0 : _a.views) == null ? void 0 : _b.list) == null ? void 0 : _c.fields) || [];
|
|
5256
5420
|
return fields;
|
|
5257
5421
|
}
|
|
5258
5422
|
getSpecification() {
|
|
5423
|
+
var _a;
|
|
5259
5424
|
const specInit = {};
|
|
5260
|
-
const modelData = this.view
|
|
5425
|
+
const modelData = ((_a = this.view) == null ? void 0 : _a.models) || {};
|
|
5261
5426
|
const specification = this.getSpecificationByFields({
|
|
5262
5427
|
fields: this.fields,
|
|
5263
5428
|
specification: specInit,
|
|
@@ -5273,7 +5438,7 @@ var base_model_default = BaseModel;
|
|
|
5273
5438
|
// src/hooks/model/use-model.ts
|
|
5274
5439
|
var useModel = () => {
|
|
5275
5440
|
const initModel = (modelData) => {
|
|
5276
|
-
switch (modelData
|
|
5441
|
+
switch (modelData == null ? void 0 : modelData.name) {
|
|
5277
5442
|
default:
|
|
5278
5443
|
return new base_model_default(modelData);
|
|
5279
5444
|
}
|
|
@@ -5418,22 +5583,22 @@ var useGetActionDetail = ({
|
|
|
5418
5583
|
}) => {
|
|
5419
5584
|
const data = {
|
|
5420
5585
|
id,
|
|
5421
|
-
model: model
|
|
5586
|
+
model: model != null ? model : "",
|
|
5422
5587
|
context
|
|
5423
5588
|
};
|
|
5424
5589
|
return useQuery11({
|
|
5425
5590
|
queryKey,
|
|
5426
|
-
queryFn:
|
|
5591
|
+
queryFn: () => __async(null, null, function* () {
|
|
5427
5592
|
if (aid) {
|
|
5428
|
-
const res =
|
|
5593
|
+
const res = yield view_service_default.getActionDetail(aid, context);
|
|
5429
5594
|
if (res && res.length > 0) {
|
|
5430
5595
|
return res[0];
|
|
5431
5596
|
}
|
|
5432
5597
|
} else {
|
|
5433
|
-
const res =
|
|
5598
|
+
const res = yield form_service_default.getFormView({ data });
|
|
5434
5599
|
return res;
|
|
5435
5600
|
}
|
|
5436
|
-
},
|
|
5601
|
+
}),
|
|
5437
5602
|
enabled,
|
|
5438
5603
|
refetchOnWindowFocus: false,
|
|
5439
5604
|
staleTime: Infinity
|
|
@@ -5505,8 +5670,9 @@ var useGetMenu = (context, enabled) => {
|
|
|
5505
5670
|
return useQuery15({
|
|
5506
5671
|
queryKey: ["menus" /* MENU */, context],
|
|
5507
5672
|
queryFn: () => view_service_default.getMenu(context).then((res) => {
|
|
5508
|
-
|
|
5509
|
-
|
|
5673
|
+
var _a;
|
|
5674
|
+
if (res && (res == null ? void 0 : res.records) && ((_a = res == null ? void 0 : res.records) == null ? void 0 : _a.length) > 0) {
|
|
5675
|
+
return res == null ? void 0 : res.records;
|
|
5510
5676
|
}
|
|
5511
5677
|
return [];
|
|
5512
5678
|
}),
|