@fctc/interface-logic 1.5.8 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/configs.d.mts +0 -1
- package/dist/configs.d.ts +0 -1
- package/dist/configs.js +103 -116
- package/dist/configs.mjs +102 -117
- package/dist/constants.js +1 -0
- package/dist/environment.d.mts +3 -20
- package/dist/environment.d.ts +3 -20
- package/dist/environment.js +142 -159
- package/dist/environment.mjs +141 -162
- package/dist/hooks.d.mts +6 -1
- package/dist/hooks.d.ts +6 -1
- package/dist/hooks.js +1569 -1704
- package/dist/hooks.mjs +1523 -1663
- package/dist/provider.d.mts +1 -1
- package/dist/provider.d.ts +1 -1
- package/dist/provider.js +528 -583
- package/dist/provider.mjs +527 -586
- package/dist/services.d.mts +1 -0
- package/dist/services.d.ts +1 -0
- package/dist/services.js +1388 -1541
- package/dist/services.mjs +1387 -1544
- package/dist/store.d.mts +155 -127
- package/dist/store.d.ts +155 -127
- package/dist/store.js +4 -15
- package/dist/store.mjs +3 -18
- package/dist/types.js +1 -0
- package/dist/utils.d.mts +2 -2
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +95 -116
- package/dist/utils.mjs +94 -119
- package/package.json +81 -82
package/dist/hooks.mjs
CHANGED
|
@@ -1,44 +1,3 @@
|
|
|
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
|
-
|
|
42
1
|
// src/hooks/auth/use-forgot-password.ts
|
|
43
2
|
import { useMutation } from "@tanstack/react-query";
|
|
44
3
|
|
|
@@ -1163,6 +1122,22 @@ var PyRelativeDelta = class _PyRelativeDelta {
|
|
|
1163
1122
|
this.microsecond = params.microsecond;
|
|
1164
1123
|
this.weekday = params.weekday;
|
|
1165
1124
|
}
|
|
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;
|
|
1166
1141
|
negate() {
|
|
1167
1142
|
return new _PyRelativeDelta(this, -1);
|
|
1168
1143
|
}
|
|
@@ -1277,7 +1252,7 @@ function execOnIterable(iterable, func) {
|
|
|
1277
1252
|
if (typeof iterable === "object" && !Array.isArray(iterable) && !(iterable instanceof Set)) {
|
|
1278
1253
|
iterable = Object.keys(iterable);
|
|
1279
1254
|
}
|
|
1280
|
-
if (typeof
|
|
1255
|
+
if (typeof iterable?.[Symbol.iterator] !== "function") {
|
|
1281
1256
|
throw new EvaluationError("value not iterable");
|
|
1282
1257
|
}
|
|
1283
1258
|
return func(iterable);
|
|
@@ -1600,7 +1575,7 @@ function applyBinaryOp(ast, context) {
|
|
|
1600
1575
|
}
|
|
1601
1576
|
return Math.floor(left / right);
|
|
1602
1577
|
case "**":
|
|
1603
|
-
return
|
|
1578
|
+
return left ** right;
|
|
1604
1579
|
case "==":
|
|
1605
1580
|
return isEqual(left, right);
|
|
1606
1581
|
case "<>":
|
|
@@ -1722,7 +1697,7 @@ function evaluate(ast, context = {}) {
|
|
|
1722
1697
|
const dicts = /* @__PURE__ */ new Set();
|
|
1723
1698
|
let pyContext;
|
|
1724
1699
|
const evalContext = Object.create(context);
|
|
1725
|
-
if (!
|
|
1700
|
+
if (!evalContext?.context) {
|
|
1726
1701
|
Object.defineProperty(evalContext, "context", {
|
|
1727
1702
|
get() {
|
|
1728
1703
|
if (!pyContext) {
|
|
@@ -1733,18 +1708,17 @@ function evaluate(ast, context = {}) {
|
|
|
1733
1708
|
});
|
|
1734
1709
|
}
|
|
1735
1710
|
function _innerEvaluate(ast2) {
|
|
1736
|
-
|
|
1737
|
-
switch (ast2 == null ? void 0 : ast2.type) {
|
|
1711
|
+
switch (ast2?.type) {
|
|
1738
1712
|
case 0:
|
|
1739
1713
|
// Number
|
|
1740
1714
|
case 1:
|
|
1741
1715
|
return ast2.value;
|
|
1742
1716
|
case 5:
|
|
1743
1717
|
if (ast2.value in evalContext) {
|
|
1744
|
-
if (typeof evalContext[ast2.value] === "object" &&
|
|
1745
|
-
return
|
|
1718
|
+
if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
|
|
1719
|
+
return evalContext[ast2.value]?.id;
|
|
1746
1720
|
}
|
|
1747
|
-
return
|
|
1721
|
+
return evalContext[ast2.value] ?? false;
|
|
1748
1722
|
} else if (ast2.value in BUILTINS) {
|
|
1749
1723
|
return BUILTINS[ast2.value];
|
|
1750
1724
|
} else {
|
|
@@ -1781,7 +1755,7 @@ function evaluate(ast, context = {}) {
|
|
|
1781
1755
|
const args = ast2.args.map(_evaluate);
|
|
1782
1756
|
const kwargs = {};
|
|
1783
1757
|
for (const kwarg in ast2.kwargs) {
|
|
1784
|
-
kwargs[kwarg] = _evaluate(ast2
|
|
1758
|
+
kwargs[kwarg] = _evaluate(ast2?.kwargs[kwarg]);
|
|
1785
1759
|
}
|
|
1786
1760
|
if (fnValue === PyDate || fnValue === PyDateTime || fnValue === PyTime || fnValue === PyRelativeDelta || fnValue === PyTimeDelta) {
|
|
1787
1761
|
return fnValue.create(...args, kwargs);
|
|
@@ -1860,25 +1834,9 @@ function escapeRegExp(str) {
|
|
|
1860
1834
|
var InvalidDomainError = class extends Error {
|
|
1861
1835
|
};
|
|
1862
1836
|
var Domain = class _Domain {
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
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
|
-
}
|
|
1837
|
+
ast = { type: -1, value: null };
|
|
1838
|
+
static TRUE;
|
|
1839
|
+
static FALSE;
|
|
1882
1840
|
static combine(domains, operator) {
|
|
1883
1841
|
if (domains.length === 0) {
|
|
1884
1842
|
return new _Domain([]);
|
|
@@ -1957,6 +1915,24 @@ var Domain = class _Domain {
|
|
|
1957
1915
|
processLeaf(d.ast.value, 0, "&", newDomain);
|
|
1958
1916
|
return newDomain;
|
|
1959
1917
|
}
|
|
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
|
+
}
|
|
1960
1936
|
contains(record) {
|
|
1961
1937
|
const expr = evaluate(this.ast, record);
|
|
1962
1938
|
return matchDomain(record, expr);
|
|
@@ -1975,7 +1951,7 @@ var Domain = class _Domain {
|
|
|
1975
1951
|
return evaluatedAsList;
|
|
1976
1952
|
}
|
|
1977
1953
|
return this.toString();
|
|
1978
|
-
} catch
|
|
1954
|
+
} catch {
|
|
1979
1955
|
return this.toString();
|
|
1980
1956
|
}
|
|
1981
1957
|
}
|
|
@@ -2218,22 +2194,22 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
|
|
|
2218
2194
|
|
|
2219
2195
|
// src/utils/storage/local-storage.ts
|
|
2220
2196
|
var localStorageUtils = () => {
|
|
2221
|
-
const setToken = (access_token) =>
|
|
2197
|
+
const setToken = async (access_token) => {
|
|
2222
2198
|
localStorage.setItem("accessToken", access_token);
|
|
2223
|
-
}
|
|
2224
|
-
const setRefreshToken = (refresh_token) =>
|
|
2199
|
+
};
|
|
2200
|
+
const setRefreshToken = async (refresh_token) => {
|
|
2225
2201
|
localStorage.setItem("refreshToken", refresh_token);
|
|
2226
|
-
}
|
|
2227
|
-
const getAccessToken = () =>
|
|
2202
|
+
};
|
|
2203
|
+
const getAccessToken = async () => {
|
|
2228
2204
|
return localStorage.getItem("accessToken");
|
|
2229
|
-
}
|
|
2230
|
-
const getRefreshToken = () =>
|
|
2205
|
+
};
|
|
2206
|
+
const getRefreshToken = async () => {
|
|
2231
2207
|
return localStorage.getItem("refreshToken");
|
|
2232
|
-
}
|
|
2233
|
-
const clearToken = () =>
|
|
2208
|
+
};
|
|
2209
|
+
const clearToken = async () => {
|
|
2234
2210
|
localStorage.removeItem("accessToken");
|
|
2235
2211
|
localStorage.removeItem("refreshToken");
|
|
2236
|
-
}
|
|
2212
|
+
};
|
|
2237
2213
|
return {
|
|
2238
2214
|
setToken,
|
|
2239
2215
|
setRefreshToken,
|
|
@@ -2245,9 +2221,9 @@ var localStorageUtils = () => {
|
|
|
2245
2221
|
|
|
2246
2222
|
// src/utils/storage/session-storage.ts
|
|
2247
2223
|
var sessionStorageUtils = () => {
|
|
2248
|
-
const getBrowserSession = () =>
|
|
2224
|
+
const getBrowserSession = async () => {
|
|
2249
2225
|
return sessionStorage.getItem("browserSession");
|
|
2250
|
-
}
|
|
2226
|
+
};
|
|
2251
2227
|
return {
|
|
2252
2228
|
getBrowserSession
|
|
2253
2229
|
};
|
|
@@ -2256,14 +2232,13 @@ var sessionStorageUtils = () => {
|
|
|
2256
2232
|
// src/configs/axios-client.ts
|
|
2257
2233
|
var axiosClient = {
|
|
2258
2234
|
init(config) {
|
|
2259
|
-
|
|
2260
|
-
const
|
|
2261
|
-
const sessionStorage2 = (_b = config.sessionStorageUtils) != null ? _b : sessionStorageUtils();
|
|
2235
|
+
const localStorage2 = config.localStorageUtils ?? localStorageUtils();
|
|
2236
|
+
const sessionStorage2 = config.sessionStorageUtils ?? sessionStorageUtils();
|
|
2262
2237
|
const db = config.db;
|
|
2263
2238
|
let isRefreshing = false;
|
|
2264
2239
|
let failedQueue = [];
|
|
2265
2240
|
const processQueue = (error, token = null) => {
|
|
2266
|
-
failedQueue
|
|
2241
|
+
failedQueue?.forEach((prom) => {
|
|
2267
2242
|
if (error) {
|
|
2268
2243
|
prom.reject(error);
|
|
2269
2244
|
} else {
|
|
@@ -2278,38 +2253,33 @@ var axiosClient = {
|
|
|
2278
2253
|
timeout: 5e4,
|
|
2279
2254
|
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
2280
2255
|
});
|
|
2281
|
-
instance.interceptors.request.use(
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
if (token) {
|
|
2286
|
-
config2.headers["Authorization"] = "Bearer " + token;
|
|
2287
|
-
}
|
|
2288
|
-
return config2;
|
|
2289
|
-
}),
|
|
2290
|
-
(error) => {
|
|
2291
|
-
Promise.reject(error);
|
|
2256
|
+
instance.interceptors.request.use(async (config2) => {
|
|
2257
|
+
const { useRefreshToken, useActionToken, actionToken } = config2;
|
|
2258
|
+
if (useActionToken && actionToken) {
|
|
2259
|
+
config2.headers["Action-Token"] = actionToken;
|
|
2292
2260
|
}
|
|
2293
|
-
|
|
2261
|
+
const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
|
|
2262
|
+
const token = await getToken?.();
|
|
2263
|
+
if (token) config2.headers["Authorization"] = `Bearer ${token}`;
|
|
2264
|
+
return config2;
|
|
2265
|
+
}, Promise.reject);
|
|
2294
2266
|
instance.interceptors.response.use(
|
|
2295
2267
|
(response) => {
|
|
2296
2268
|
return handleResponse(response);
|
|
2297
2269
|
},
|
|
2298
|
-
(error) =>
|
|
2299
|
-
|
|
2300
|
-
const handleError3 = (error2) => __async(null, null, function* () {
|
|
2301
|
-
var _a3;
|
|
2270
|
+
async (error) => {
|
|
2271
|
+
const handleError3 = async (error2) => {
|
|
2302
2272
|
if (!error2.response) {
|
|
2303
2273
|
return error2;
|
|
2304
2274
|
}
|
|
2305
2275
|
const { data } = error2.response;
|
|
2306
|
-
if (data && data.code === 400 && ["invalid_grant"].includes(
|
|
2307
|
-
|
|
2276
|
+
if (data && data.code === 400 && ["invalid_grant"].includes(data.data?.error)) {
|
|
2277
|
+
await clearAuthToken();
|
|
2308
2278
|
}
|
|
2309
2279
|
return data;
|
|
2310
|
-
}
|
|
2280
|
+
};
|
|
2311
2281
|
const originalRequest = error.config;
|
|
2312
|
-
if ((
|
|
2282
|
+
if ((error.response?.status === 403 || error.response?.status === 401 || error.response?.status === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
|
|
2313
2283
|
error.response.data.code
|
|
2314
2284
|
)) {
|
|
2315
2285
|
if (isRefreshing) {
|
|
@@ -2322,19 +2292,18 @@ var axiosClient = {
|
|
|
2322
2292
|
token
|
|
2323
2293
|
);
|
|
2324
2294
|
return instance.request(originalRequest);
|
|
2325
|
-
}).catch((err) =>
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
yield clearAuthToken();
|
|
2295
|
+
}).catch(async (err) => {
|
|
2296
|
+
if ((err.response?.status === 400 || err.response?.status === 401) && ["invalid_grant"].includes(err.response.data.error)) {
|
|
2297
|
+
await clearAuthToken();
|
|
2329
2298
|
}
|
|
2330
|
-
})
|
|
2299
|
+
});
|
|
2331
2300
|
}
|
|
2332
|
-
const browserSession =
|
|
2333
|
-
const refreshToken =
|
|
2334
|
-
const accessTokenExp =
|
|
2301
|
+
const browserSession = await sessionStorage2.getBrowserSession();
|
|
2302
|
+
const refreshToken = await localStorage2.getRefreshToken();
|
|
2303
|
+
const accessTokenExp = await localStorage2.getAccessToken();
|
|
2335
2304
|
isRefreshing = true;
|
|
2336
2305
|
if (!refreshToken && (!browserSession || browserSession == "unActive")) {
|
|
2337
|
-
|
|
2306
|
+
await clearAuthToken();
|
|
2338
2307
|
} else {
|
|
2339
2308
|
const payload = Object.fromEntries(
|
|
2340
2309
|
Object.entries({
|
|
@@ -2345,9 +2314,8 @@ var axiosClient = {
|
|
|
2345
2314
|
}).filter(([_, value]) => !!value)
|
|
2346
2315
|
);
|
|
2347
2316
|
return new Promise(function(resolve) {
|
|
2348
|
-
var _a3;
|
|
2349
2317
|
axios.post(
|
|
2350
|
-
`${config.baseUrl}${
|
|
2318
|
+
`${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
|
|
2351
2319
|
payload,
|
|
2352
2320
|
{
|
|
2353
2321
|
headers: {
|
|
@@ -2355,10 +2323,10 @@ var axiosClient = {
|
|
|
2355
2323
|
Authorization: `Bearer ${accessTokenExp}`
|
|
2356
2324
|
}
|
|
2357
2325
|
}
|
|
2358
|
-
).then((res) =>
|
|
2326
|
+
).then(async (res) => {
|
|
2359
2327
|
const data = res.data;
|
|
2360
|
-
|
|
2361
|
-
|
|
2328
|
+
await localStorage2.setToken(data.access_token);
|
|
2329
|
+
await localStorage2.setRefreshToken(data.refresh_token);
|
|
2362
2330
|
axios.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
|
|
2363
2331
|
originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
|
|
2364
2332
|
originalRequest.data = updateTokenParamInOriginalRequest(
|
|
@@ -2367,26 +2335,25 @@ var axiosClient = {
|
|
|
2367
2335
|
);
|
|
2368
2336
|
processQueue(null, data.access_token);
|
|
2369
2337
|
resolve(instance.request(originalRequest));
|
|
2370
|
-
})
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
yield clearAuthToken();
|
|
2338
|
+
}).catch(async (err) => {
|
|
2339
|
+
if (err && (err?.error_code === "AUTHEN_FAIL" || err?.error_code === "TOKEN_EXPIRED" || err?.error_code === "TOKEN_INCORRECT" || err?.code === "ERR_BAD_REQUEST") || err?.error_code === "ERR_2FA_006") {
|
|
2340
|
+
await clearAuthToken();
|
|
2374
2341
|
}
|
|
2375
2342
|
if (err && err.response) {
|
|
2376
|
-
const { error_code } =
|
|
2343
|
+
const { error_code } = err.response?.data || {};
|
|
2377
2344
|
if (error_code === "AUTHEN_FAIL") {
|
|
2378
|
-
|
|
2345
|
+
await clearAuthToken();
|
|
2379
2346
|
}
|
|
2380
2347
|
}
|
|
2381
2348
|
processQueue(err, null);
|
|
2382
|
-
})
|
|
2349
|
+
}).finally(() => {
|
|
2383
2350
|
isRefreshing = false;
|
|
2384
2351
|
});
|
|
2385
2352
|
});
|
|
2386
2353
|
}
|
|
2387
2354
|
}
|
|
2388
|
-
return Promise.reject(
|
|
2389
|
-
}
|
|
2355
|
+
return Promise.reject(await handleError3(error));
|
|
2356
|
+
}
|
|
2390
2357
|
);
|
|
2391
2358
|
const handleResponse = (res) => {
|
|
2392
2359
|
if (res && res.data) {
|
|
@@ -2395,7 +2362,6 @@ var axiosClient = {
|
|
|
2395
2362
|
return res;
|
|
2396
2363
|
};
|
|
2397
2364
|
const handleError2 = (error) => {
|
|
2398
|
-
var _a2, _b2, _c;
|
|
2399
2365
|
if (error.isAxiosError && error.code === "ECONNABORTED") {
|
|
2400
2366
|
console.error("Request Timeout Error:", error);
|
|
2401
2367
|
return "Request Timeout Error";
|
|
@@ -2403,17 +2369,17 @@ var axiosClient = {
|
|
|
2403
2369
|
console.error("Network Error:", error);
|
|
2404
2370
|
return "Network Error";
|
|
2405
2371
|
} else {
|
|
2406
|
-
console.error("Other Error:", error
|
|
2407
|
-
const errorMessage =
|
|
2408
|
-
return { message: errorMessage, status:
|
|
2372
|
+
console.error("Other Error:", error?.response);
|
|
2373
|
+
const errorMessage = error?.response?.data?.message || "An error occurred";
|
|
2374
|
+
return { message: errorMessage, status: error?.response?.status };
|
|
2409
2375
|
}
|
|
2410
2376
|
};
|
|
2411
|
-
const clearAuthToken = () =>
|
|
2412
|
-
|
|
2377
|
+
const clearAuthToken = async () => {
|
|
2378
|
+
await localStorage2.clearToken();
|
|
2413
2379
|
if (typeof window !== "undefined") {
|
|
2414
2380
|
window.location.href = `/login`;
|
|
2415
2381
|
}
|
|
2416
|
-
}
|
|
2382
|
+
};
|
|
2417
2383
|
function formatUrl(url, db2) {
|
|
2418
2384
|
return url + (db2 ? "?db=" + db2 : "");
|
|
2419
2385
|
}
|
|
@@ -2463,6 +2429,8 @@ var initialState2 = {
|
|
|
2463
2429
|
requests: null,
|
|
2464
2430
|
companies: [],
|
|
2465
2431
|
user: {},
|
|
2432
|
+
db: "",
|
|
2433
|
+
refreshTokenEndpoint: "",
|
|
2466
2434
|
config: null,
|
|
2467
2435
|
envFile: null,
|
|
2468
2436
|
defaultCompany: {
|
|
@@ -2626,7 +2594,7 @@ var headerSlice = createSlice5({
|
|
|
2626
2594
|
},
|
|
2627
2595
|
reducers: {
|
|
2628
2596
|
setHeader: (state, action) => {
|
|
2629
|
-
state.value =
|
|
2597
|
+
state.value = { ...state.value, ...action.payload };
|
|
2630
2598
|
},
|
|
2631
2599
|
setAllowedCompanyIds: (state, action) => {
|
|
2632
2600
|
state.value.allowedCompanyIds = action.payload;
|
|
@@ -3052,130 +3020,115 @@ var envStore = configureStore({
|
|
|
3052
3020
|
|
|
3053
3021
|
// src/environment/EnvStore.ts
|
|
3054
3022
|
var EnvStore = class {
|
|
3055
|
-
|
|
3056
|
-
|
|
3023
|
+
baseUrl;
|
|
3024
|
+
requests;
|
|
3025
|
+
context;
|
|
3026
|
+
defaultCompany;
|
|
3027
|
+
config;
|
|
3028
|
+
companies;
|
|
3029
|
+
user;
|
|
3030
|
+
db;
|
|
3031
|
+
localStorageUtils;
|
|
3032
|
+
sessionStorageUtils;
|
|
3033
|
+
refreshTokenEndpoint;
|
|
3034
|
+
constructor(localStorageUtils2, sessionStorageUtils2) {
|
|
3057
3035
|
this.localStorageUtils = localStorageUtils2;
|
|
3058
3036
|
this.sessionStorageUtils = sessionStorageUtils2;
|
|
3059
3037
|
this.setup();
|
|
3060
3038
|
}
|
|
3061
3039
|
setup() {
|
|
3062
|
-
const env2 =
|
|
3063
|
-
this.baseUrl = env2
|
|
3064
|
-
this.requests = env2
|
|
3065
|
-
this.context = env2
|
|
3066
|
-
this.defaultCompany = env2
|
|
3067
|
-
this.config = env2
|
|
3068
|
-
this.companies =
|
|
3069
|
-
this.user = env2
|
|
3070
|
-
this.db = env2
|
|
3071
|
-
this.refreshTokenEndpoint = env2
|
|
3040
|
+
const env2 = envStore.getState().env;
|
|
3041
|
+
this.baseUrl = env2?.baseUrl;
|
|
3042
|
+
this.requests = env2?.requests;
|
|
3043
|
+
this.context = env2?.context;
|
|
3044
|
+
this.defaultCompany = env2?.defaultCompany;
|
|
3045
|
+
this.config = env2?.config;
|
|
3046
|
+
this.companies = env2?.companies || [];
|
|
3047
|
+
this.user = env2?.user;
|
|
3048
|
+
this.db = env2?.db;
|
|
3049
|
+
this.refreshTokenEndpoint = env2?.refreshTokenEndpoint;
|
|
3050
|
+
console.log("env from interface-logic", env2);
|
|
3072
3051
|
}
|
|
3073
3052
|
setupEnv(envConfig) {
|
|
3074
|
-
const dispatch =
|
|
3075
|
-
const env2 =
|
|
3053
|
+
const dispatch = envStore.dispatch;
|
|
3054
|
+
const env2 = {
|
|
3055
|
+
...envConfig,
|
|
3076
3056
|
localStorageUtils: this.localStorageUtils,
|
|
3077
3057
|
sessionStorageUtils: this.sessionStorageUtils
|
|
3078
|
-
}
|
|
3058
|
+
};
|
|
3079
3059
|
const requests = axiosClient.init(env2);
|
|
3080
|
-
dispatch(setEnv(
|
|
3060
|
+
dispatch(setEnv({ ...env2, requests }));
|
|
3081
3061
|
this.setup();
|
|
3082
3062
|
}
|
|
3083
3063
|
setUid(uid) {
|
|
3084
|
-
const dispatch =
|
|
3064
|
+
const dispatch = envStore.dispatch;
|
|
3085
3065
|
dispatch(setUid(uid));
|
|
3086
3066
|
this.setup();
|
|
3087
3067
|
}
|
|
3088
3068
|
setLang(lang) {
|
|
3089
|
-
const dispatch =
|
|
3069
|
+
const dispatch = envStore.dispatch;
|
|
3090
3070
|
dispatch(setLang(lang));
|
|
3091
3071
|
this.setup();
|
|
3092
3072
|
}
|
|
3093
3073
|
setAllowCompanies(allowCompanies) {
|
|
3094
|
-
const dispatch =
|
|
3074
|
+
const dispatch = envStore.dispatch;
|
|
3095
3075
|
dispatch(setAllowCompanies(allowCompanies));
|
|
3096
3076
|
this.setup();
|
|
3097
3077
|
}
|
|
3098
3078
|
setCompanies(companies) {
|
|
3099
|
-
const dispatch =
|
|
3079
|
+
const dispatch = envStore.dispatch;
|
|
3100
3080
|
dispatch(setCompanies(companies));
|
|
3101
3081
|
this.setup();
|
|
3102
3082
|
}
|
|
3103
3083
|
setDefaultCompany(company) {
|
|
3104
|
-
const dispatch =
|
|
3084
|
+
const dispatch = envStore.dispatch;
|
|
3105
3085
|
dispatch(setDefaultCompany(company));
|
|
3106
3086
|
this.setup();
|
|
3107
3087
|
}
|
|
3108
3088
|
setUserInfo(userInfo) {
|
|
3109
|
-
const dispatch =
|
|
3089
|
+
const dispatch = envStore.dispatch;
|
|
3110
3090
|
dispatch(setUser(userInfo));
|
|
3111
3091
|
this.setup();
|
|
3112
3092
|
}
|
|
3113
3093
|
};
|
|
3114
3094
|
var env = null;
|
|
3115
3095
|
function getEnv() {
|
|
3116
|
-
if (!env)
|
|
3117
|
-
env = new EnvStore(envStore, localStorageUtils(), sessionStorageUtils());
|
|
3096
|
+
if (!env) env = new EnvStore(localStorageUtils(), sessionStorageUtils());
|
|
3118
3097
|
return env;
|
|
3119
3098
|
}
|
|
3120
3099
|
|
|
3121
3100
|
// src/services/action-service/index.ts
|
|
3122
3101
|
var ActionService = {
|
|
3123
3102
|
// Load Action
|
|
3124
|
-
loadAction(
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
}
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
});
|
|
3139
|
-
});
|
|
3140
|
-
},
|
|
3141
|
-
// Call Button
|
|
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;
|
|
3103
|
+
async loadAction({
|
|
3104
|
+
idAction,
|
|
3105
|
+
context
|
|
3106
|
+
}) {
|
|
3107
|
+
const env2 = getEnv();
|
|
3108
|
+
const jsonData = {
|
|
3109
|
+
action_id: idAction,
|
|
3110
|
+
with_context: {
|
|
3111
|
+
...context
|
|
3112
|
+
}
|
|
3113
|
+
};
|
|
3114
|
+
return env2.requests.post(`${"/load_action" /* LOAD_ACTION */}`, jsonData, {
|
|
3115
|
+
headers: {
|
|
3116
|
+
"Content-Type": "application/json"
|
|
3165
3117
|
}
|
|
3166
3118
|
});
|
|
3167
3119
|
},
|
|
3168
|
-
//
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3120
|
+
// Call Button
|
|
3121
|
+
async callButton({
|
|
3122
|
+
model,
|
|
3123
|
+
ids = [],
|
|
3124
|
+
context,
|
|
3125
|
+
method
|
|
3126
|
+
}) {
|
|
3127
|
+
try {
|
|
3175
3128
|
const env2 = getEnv();
|
|
3176
3129
|
const jsonData = {
|
|
3177
3130
|
model,
|
|
3178
|
-
method
|
|
3131
|
+
method,
|
|
3179
3132
|
ids,
|
|
3180
3133
|
with_context: context
|
|
3181
3134
|
};
|
|
@@ -3184,96 +3137,112 @@ var ActionService = {
|
|
|
3184
3137
|
"Content-Type": "application/json"
|
|
3185
3138
|
}
|
|
3186
3139
|
});
|
|
3140
|
+
} catch (error) {
|
|
3141
|
+
console.error("Error when calling button action:", error);
|
|
3142
|
+
throw error;
|
|
3143
|
+
}
|
|
3144
|
+
},
|
|
3145
|
+
// remove Row
|
|
3146
|
+
async removeRows({
|
|
3147
|
+
model,
|
|
3148
|
+
ids,
|
|
3149
|
+
context
|
|
3150
|
+
}) {
|
|
3151
|
+
const env2 = getEnv();
|
|
3152
|
+
const jsonData = {
|
|
3153
|
+
model,
|
|
3154
|
+
method: "unlink",
|
|
3155
|
+
ids,
|
|
3156
|
+
with_context: context
|
|
3157
|
+
};
|
|
3158
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3159
|
+
headers: {
|
|
3160
|
+
"Content-Type": "application/json"
|
|
3161
|
+
}
|
|
3187
3162
|
});
|
|
3188
3163
|
},
|
|
3189
3164
|
// Duplicate Model
|
|
3190
|
-
duplicateRecord(
|
|
3191
|
-
|
|
3165
|
+
async duplicateRecord({
|
|
3166
|
+
model,
|
|
3167
|
+
id,
|
|
3168
|
+
context
|
|
3169
|
+
}) {
|
|
3170
|
+
const env2 = getEnv();
|
|
3171
|
+
const jsonData = {
|
|
3192
3172
|
model,
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
with_context: context
|
|
3202
|
-
};
|
|
3203
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3204
|
-
headers: {
|
|
3205
|
-
"Content-Type": "application/json"
|
|
3206
|
-
}
|
|
3207
|
-
});
|
|
3173
|
+
method: "copy",
|
|
3174
|
+
ids: id,
|
|
3175
|
+
with_context: context
|
|
3176
|
+
};
|
|
3177
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3178
|
+
headers: {
|
|
3179
|
+
"Content-Type": "application/json"
|
|
3180
|
+
}
|
|
3208
3181
|
});
|
|
3209
3182
|
},
|
|
3210
3183
|
// Get Print Report
|
|
3211
|
-
getPrintReportName(
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
report_name: {}
|
|
3221
|
-
}
|
|
3222
|
-
}
|
|
3223
|
-
};
|
|
3224
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3225
|
-
headers: {
|
|
3226
|
-
"Content-Type": "application/json"
|
|
3184
|
+
async getPrintReportName({ id }) {
|
|
3185
|
+
const env2 = getEnv();
|
|
3186
|
+
const jsonData = {
|
|
3187
|
+
model: "ir.actions.report",
|
|
3188
|
+
method: "web_read",
|
|
3189
|
+
id,
|
|
3190
|
+
kwargs: {
|
|
3191
|
+
specification: {
|
|
3192
|
+
report_name: {}
|
|
3227
3193
|
}
|
|
3228
|
-
}
|
|
3194
|
+
}
|
|
3195
|
+
};
|
|
3196
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3197
|
+
headers: {
|
|
3198
|
+
"Content-Type": "application/json"
|
|
3199
|
+
}
|
|
3229
3200
|
});
|
|
3230
3201
|
},
|
|
3231
3202
|
//Save Print Invoice
|
|
3232
|
-
print(
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
responseType: "arraybuffer"
|
|
3249
|
-
});
|
|
3203
|
+
async print({ id, report, db }) {
|
|
3204
|
+
const env2 = getEnv();
|
|
3205
|
+
const jsonData = {
|
|
3206
|
+
report,
|
|
3207
|
+
id,
|
|
3208
|
+
type: "pdf",
|
|
3209
|
+
file_response: true,
|
|
3210
|
+
db
|
|
3211
|
+
};
|
|
3212
|
+
const queryString = toQueryString(jsonData);
|
|
3213
|
+
const urlWithParams = `${"/report" /* REPORT_PATH */}?${queryString}`;
|
|
3214
|
+
return env2.requests.get(urlWithParams, {
|
|
3215
|
+
headers: {
|
|
3216
|
+
"Content-Type": "application/json"
|
|
3217
|
+
},
|
|
3218
|
+
responseType: "arraybuffer"
|
|
3250
3219
|
});
|
|
3251
3220
|
},
|
|
3252
3221
|
//Run Action
|
|
3253
|
-
runAction(
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
}
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
}
|
|
3222
|
+
async runAction({
|
|
3223
|
+
idAction,
|
|
3224
|
+
context
|
|
3225
|
+
}) {
|
|
3226
|
+
const env2 = getEnv();
|
|
3227
|
+
const jsonData = {
|
|
3228
|
+
action_id: idAction,
|
|
3229
|
+
with_context: {
|
|
3230
|
+
...context
|
|
3231
|
+
}
|
|
3232
|
+
// context: {
|
|
3233
|
+
// lang: 'en_US',
|
|
3234
|
+
// tz: 'Asia/Saigon',
|
|
3235
|
+
// uid: 2,
|
|
3236
|
+
// allowed_company_ids: [1],
|
|
3237
|
+
// active_id: Array.isArray(idDetail) ? idDetail[0] : idDetail,
|
|
3238
|
+
// active_ids: Array.isArray(idDetail) ? [...idDetail] : idDetail,
|
|
3239
|
+
// active_model: model,
|
|
3240
|
+
// },
|
|
3241
|
+
};
|
|
3242
|
+
return env2.requests.post(`${"/run_action" /* RUN_ACTION_PATH */}`, jsonData, {
|
|
3243
|
+
headers: {
|
|
3244
|
+
"Content-Type": "application/json"
|
|
3245
|
+
}
|
|
3277
3246
|
});
|
|
3278
3247
|
}
|
|
3279
3248
|
};
|
|
@@ -3281,623 +3250,567 @@ var action_service_default = ActionService;
|
|
|
3281
3250
|
|
|
3282
3251
|
// src/services/auth-service/index.ts
|
|
3283
3252
|
var AuthService = {
|
|
3284
|
-
login(body) {
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
3301
|
-
}
|
|
3302
|
-
});
|
|
3253
|
+
async login(body) {
|
|
3254
|
+
const env2 = getEnv();
|
|
3255
|
+
const payload = Object.fromEntries(
|
|
3256
|
+
Object.entries({
|
|
3257
|
+
username: body.email,
|
|
3258
|
+
password: body.password,
|
|
3259
|
+
grant_type: env2?.config?.grantType || "",
|
|
3260
|
+
client_id: env2?.config?.clientId || "",
|
|
3261
|
+
client_secret: env2?.config?.clientSecret || ""
|
|
3262
|
+
}).filter(([_, value]) => !!value)
|
|
3263
|
+
);
|
|
3264
|
+
const encodedData = new URLSearchParams(payload).toString();
|
|
3265
|
+
return env2?.requests?.post(body.path, encodedData, {
|
|
3266
|
+
headers: {
|
|
3267
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
3268
|
+
}
|
|
3303
3269
|
});
|
|
3304
3270
|
},
|
|
3305
|
-
forgotPassword(email) {
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
"Content-Type": "application/json"
|
|
3316
|
-
}
|
|
3317
|
-
});
|
|
3271
|
+
async forgotPassword(email) {
|
|
3272
|
+
const env2 = getEnv();
|
|
3273
|
+
const bodyData = {
|
|
3274
|
+
login: email,
|
|
3275
|
+
url: `${window.location.origin}/reset-password`
|
|
3276
|
+
};
|
|
3277
|
+
return env2?.requests?.post("/reset_password" /* RESET_PASSWORD_PATH */, bodyData, {
|
|
3278
|
+
headers: {
|
|
3279
|
+
"Content-Type": "application/json"
|
|
3280
|
+
}
|
|
3318
3281
|
});
|
|
3319
3282
|
},
|
|
3320
|
-
forgotPasswordSSO(
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
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"
|
|
3283
|
+
async forgotPasswordSSO({
|
|
3284
|
+
email,
|
|
3285
|
+
with_context,
|
|
3286
|
+
method
|
|
3287
|
+
}) {
|
|
3288
|
+
const env2 = getEnv();
|
|
3289
|
+
const body = {
|
|
3290
|
+
method,
|
|
3291
|
+
kwargs: {
|
|
3292
|
+
vals: {
|
|
3293
|
+
email
|
|
3340
3294
|
}
|
|
3341
|
-
}
|
|
3295
|
+
},
|
|
3296
|
+
with_context
|
|
3297
|
+
};
|
|
3298
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, body, {
|
|
3299
|
+
headers: {
|
|
3300
|
+
"Content-Type": "application/json"
|
|
3301
|
+
}
|
|
3342
3302
|
});
|
|
3343
3303
|
},
|
|
3344
|
-
resetPassword(data, token) {
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
"Content-Type": "application/json"
|
|
3356
|
-
}
|
|
3357
|
-
});
|
|
3304
|
+
async resetPassword(data, token) {
|
|
3305
|
+
const env2 = getEnv();
|
|
3306
|
+
const bodyData = {
|
|
3307
|
+
token,
|
|
3308
|
+
password: data.password,
|
|
3309
|
+
new_password: data.confirmPassword
|
|
3310
|
+
};
|
|
3311
|
+
return env2?.requests?.post("/change_password" /* CHANGE_PASSWORD_PATH */, bodyData, {
|
|
3312
|
+
headers: {
|
|
3313
|
+
"Content-Type": "application/json"
|
|
3314
|
+
}
|
|
3358
3315
|
});
|
|
3359
3316
|
},
|
|
3360
|
-
resetPasswordSSO(
|
|
3361
|
-
|
|
3317
|
+
async resetPasswordSSO({
|
|
3318
|
+
method,
|
|
3319
|
+
password,
|
|
3320
|
+
with_context
|
|
3321
|
+
}) {
|
|
3322
|
+
const env2 = getEnv();
|
|
3323
|
+
const bodyData = {
|
|
3362
3324
|
method,
|
|
3363
|
-
|
|
3325
|
+
kwargs: {
|
|
3326
|
+
vals: {
|
|
3327
|
+
password
|
|
3328
|
+
}
|
|
3329
|
+
},
|
|
3364
3330
|
with_context
|
|
3365
|
-
}
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3331
|
+
};
|
|
3332
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, bodyData, {
|
|
3333
|
+
headers: {
|
|
3334
|
+
"Content-Type": "application/json"
|
|
3335
|
+
}
|
|
3336
|
+
});
|
|
3337
|
+
},
|
|
3338
|
+
async updatePassword(data, token) {
|
|
3339
|
+
const env2 = getEnv();
|
|
3340
|
+
const bodyData = {
|
|
3341
|
+
token,
|
|
3342
|
+
old_password: data.oldPassword,
|
|
3343
|
+
new_password: data.newPassword
|
|
3344
|
+
};
|
|
3345
|
+
return env2?.requests?.post("/change_password_parent" /* UPDATE_PASSWORD_PATH */, bodyData, {
|
|
3346
|
+
headers: {
|
|
3347
|
+
"Content-Type": "application/json"
|
|
3348
|
+
}
|
|
3349
|
+
});
|
|
3350
|
+
},
|
|
3351
|
+
async isValidToken(token) {
|
|
3352
|
+
const env2 = getEnv();
|
|
3353
|
+
const bodyData = {
|
|
3354
|
+
token
|
|
3355
|
+
};
|
|
3356
|
+
return env2?.requests?.post("/check_token" /* TOKEN */, bodyData, {
|
|
3357
|
+
headers: {
|
|
3358
|
+
"Content-Type": "application/json"
|
|
3359
|
+
}
|
|
3360
|
+
});
|
|
3361
|
+
},
|
|
3362
|
+
async isValidActionToken(actionToken, path) {
|
|
3363
|
+
const env2 = getEnv();
|
|
3364
|
+
return env2?.requests?.post(
|
|
3365
|
+
path,
|
|
3366
|
+
{},
|
|
3367
|
+
{
|
|
3368
|
+
headers: {
|
|
3369
|
+
"Content-Type": "application/json"
|
|
3374
3370
|
},
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3371
|
+
useActionToken: true,
|
|
3372
|
+
actionToken
|
|
3373
|
+
}
|
|
3374
|
+
);
|
|
3375
|
+
},
|
|
3376
|
+
async loginSocial({
|
|
3377
|
+
db,
|
|
3378
|
+
state,
|
|
3379
|
+
access_token
|
|
3380
|
+
}) {
|
|
3381
|
+
const env2 = getEnv();
|
|
3382
|
+
return env2?.requests?.post(
|
|
3383
|
+
"/token/generate" /* GENTOKEN_SOCIAL */,
|
|
3384
|
+
{ state, access_token },
|
|
3385
|
+
{
|
|
3378
3386
|
headers: {
|
|
3379
3387
|
"Content-Type": "application/json"
|
|
3380
3388
|
}
|
|
3381
|
-
}
|
|
3382
|
-
|
|
3389
|
+
}
|
|
3390
|
+
);
|
|
3383
3391
|
},
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3392
|
+
async getProviders(db) {
|
|
3393
|
+
const env2 = getEnv();
|
|
3394
|
+
return env2?.requests?.get("/oauth/providers", { params: { db } });
|
|
3395
|
+
},
|
|
3396
|
+
async getAccessByCode(code) {
|
|
3397
|
+
const env2 = getEnv();
|
|
3398
|
+
const data = new URLSearchParams();
|
|
3399
|
+
data.append("code", code);
|
|
3400
|
+
data.append("grant_type", "authorization_code");
|
|
3401
|
+
data.append("client_id", env2?.config?.clientId || "");
|
|
3402
|
+
data.append("redirect_uri", env2?.config?.redirectUri || "");
|
|
3403
|
+
return env2?.requests?.post(
|
|
3404
|
+
`${env2?.baseUrl?.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
|
|
3405
|
+
data,
|
|
3406
|
+
{
|
|
3394
3407
|
headers: {
|
|
3395
|
-
"Content-Type": "application/
|
|
3408
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
3396
3409
|
}
|
|
3397
|
-
}
|
|
3398
|
-
|
|
3410
|
+
}
|
|
3411
|
+
);
|
|
3399
3412
|
},
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/check_token" /* TOKEN */, bodyData, {
|
|
3413
|
+
async logout(data) {
|
|
3414
|
+
const env2 = getEnv();
|
|
3415
|
+
console.log(data);
|
|
3416
|
+
return env2?.requests?.post(
|
|
3417
|
+
"/logout" /* LOGOUT */,
|
|
3418
|
+
{},
|
|
3419
|
+
{
|
|
3408
3420
|
headers: {
|
|
3409
3421
|
"Content-Type": "application/json"
|
|
3410
|
-
}
|
|
3411
|
-
|
|
3422
|
+
},
|
|
3423
|
+
withCredentials: true,
|
|
3424
|
+
useRefreshToken: true
|
|
3425
|
+
}
|
|
3426
|
+
);
|
|
3427
|
+
}
|
|
3428
|
+
};
|
|
3429
|
+
var auth_service_default = AuthService;
|
|
3430
|
+
|
|
3431
|
+
// src/services/company-service/index.ts
|
|
3432
|
+
var CompanyService = {
|
|
3433
|
+
async getCurrentCompany() {
|
|
3434
|
+
const env2 = getEnv();
|
|
3435
|
+
return await env2.requests.get("/company" /* COMPANY_PATH */, {
|
|
3436
|
+
headers: {
|
|
3437
|
+
"Content-Type": "application/json"
|
|
3438
|
+
}
|
|
3412
3439
|
});
|
|
3413
3440
|
},
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
"Content-Type": "application/json"
|
|
3428
|
-
}
|
|
3441
|
+
async getInfoCompany(id) {
|
|
3442
|
+
const env2 = getEnv();
|
|
3443
|
+
const jsonData = {
|
|
3444
|
+
ids: [id],
|
|
3445
|
+
model: "res.company" /* COMPANY */,
|
|
3446
|
+
method: "web_read" /* WEB_READ */,
|
|
3447
|
+
kwargs: {
|
|
3448
|
+
specification: {
|
|
3449
|
+
primary_color: {},
|
|
3450
|
+
secondary_color: {},
|
|
3451
|
+
logo: {},
|
|
3452
|
+
display_name: {},
|
|
3453
|
+
secondary_logo: {}
|
|
3429
3454
|
}
|
|
3430
|
-
|
|
3455
|
+
}
|
|
3456
|
+
};
|
|
3457
|
+
return await env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
3458
|
+
headers: {
|
|
3459
|
+
"Content-Type": "application/json"
|
|
3460
|
+
}
|
|
3461
|
+
});
|
|
3462
|
+
}
|
|
3463
|
+
};
|
|
3464
|
+
var company_service_default = CompanyService;
|
|
3465
|
+
|
|
3466
|
+
// src/services/excel-service/index.ts
|
|
3467
|
+
var ExcelService = {
|
|
3468
|
+
async uploadFile({ formData }) {
|
|
3469
|
+
const env2 = getEnv();
|
|
3470
|
+
return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
|
|
3471
|
+
headers: {
|
|
3472
|
+
"Content-Type": "multipart/form-data"
|
|
3473
|
+
}
|
|
3431
3474
|
});
|
|
3432
3475
|
},
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3476
|
+
async uploadIdFile({ formData }) {
|
|
3477
|
+
const env2 = getEnv();
|
|
3478
|
+
return env2.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
|
|
3479
|
+
headers: {
|
|
3480
|
+
"Content-Type": "multipart/form-data"
|
|
3481
|
+
}
|
|
3438
3482
|
});
|
|
3439
3483
|
},
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
{
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
}
|
|
3484
|
+
async parsePreview({
|
|
3485
|
+
id,
|
|
3486
|
+
selectedSheet,
|
|
3487
|
+
isHeader,
|
|
3488
|
+
context
|
|
3489
|
+
}) {
|
|
3490
|
+
const env2 = getEnv();
|
|
3491
|
+
const jsonData = {
|
|
3492
|
+
model: "base_import.import" /* BASE_IMPORT */,
|
|
3493
|
+
method: "parse_preview",
|
|
3494
|
+
ids: [id],
|
|
3495
|
+
kwargs: {
|
|
3496
|
+
options: {
|
|
3497
|
+
import_skip_records: [],
|
|
3498
|
+
import_set_empty_fields: [],
|
|
3499
|
+
fallback_values: {},
|
|
3500
|
+
name_create_enabled_fields: {},
|
|
3501
|
+
encoding: "",
|
|
3502
|
+
separator: "",
|
|
3503
|
+
quoting: '"',
|
|
3504
|
+
date_format: "",
|
|
3505
|
+
datetime_format: "",
|
|
3506
|
+
float_thousand_separator: ",",
|
|
3507
|
+
float_decimal_separator: ".",
|
|
3508
|
+
advanced: true,
|
|
3509
|
+
has_headers: isHeader,
|
|
3510
|
+
keep_matches: false,
|
|
3511
|
+
limit: 2e3,
|
|
3512
|
+
sheets: [],
|
|
3513
|
+
sheet: selectedSheet,
|
|
3514
|
+
skip: 0,
|
|
3515
|
+
tracking_disable: true
|
|
3456
3516
|
}
|
|
3457
|
-
|
|
3517
|
+
},
|
|
3518
|
+
with_context: context
|
|
3519
|
+
};
|
|
3520
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3521
|
+
headers: {
|
|
3522
|
+
"Content-Type": "multipart/form-data"
|
|
3523
|
+
}
|
|
3458
3524
|
});
|
|
3459
3525
|
},
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3526
|
+
async executeImport({
|
|
3527
|
+
columns,
|
|
3528
|
+
fields,
|
|
3529
|
+
idFile,
|
|
3530
|
+
options,
|
|
3531
|
+
dryrun,
|
|
3532
|
+
context
|
|
3533
|
+
}) {
|
|
3534
|
+
const env2 = getEnv();
|
|
3535
|
+
const jsonData = {
|
|
3536
|
+
model: "base_import.import" /* BASE_IMPORT */,
|
|
3537
|
+
method: "execute_import",
|
|
3538
|
+
ids: [idFile],
|
|
3539
|
+
kwargs: {
|
|
3540
|
+
fields,
|
|
3541
|
+
columns,
|
|
3542
|
+
options,
|
|
3543
|
+
dryrun
|
|
3544
|
+
},
|
|
3545
|
+
with_context: context
|
|
3546
|
+
};
|
|
3547
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3548
|
+
headers: {
|
|
3549
|
+
"Content-Type": "multipart/form-data"
|
|
3550
|
+
}
|
|
3476
3551
|
});
|
|
3552
|
+
},
|
|
3553
|
+
async getFileExcel({ model }) {
|
|
3554
|
+
const env2 = getEnv();
|
|
3555
|
+
const jsonData = {
|
|
3556
|
+
model,
|
|
3557
|
+
method: "get_import_templates" /* GET_IMPORT */,
|
|
3558
|
+
args: []
|
|
3559
|
+
};
|
|
3560
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData);
|
|
3561
|
+
},
|
|
3562
|
+
async getFieldExport({
|
|
3563
|
+
ids,
|
|
3564
|
+
model,
|
|
3565
|
+
isShow,
|
|
3566
|
+
parentField,
|
|
3567
|
+
fieldType,
|
|
3568
|
+
parentName,
|
|
3569
|
+
prefix,
|
|
3570
|
+
name,
|
|
3571
|
+
context,
|
|
3572
|
+
importCompat
|
|
3573
|
+
}) {
|
|
3574
|
+
const env2 = getEnv();
|
|
3575
|
+
const jsonData = {
|
|
3576
|
+
model,
|
|
3577
|
+
import_compat: importCompat,
|
|
3578
|
+
domain: [["id", "in", ids]],
|
|
3579
|
+
with_context: context
|
|
3580
|
+
};
|
|
3581
|
+
if (isShow) {
|
|
3582
|
+
jsonData.parent_field = parentField;
|
|
3583
|
+
jsonData.parent_field_type = fieldType;
|
|
3584
|
+
jsonData.parent_name = parentName;
|
|
3585
|
+
jsonData.name = name;
|
|
3586
|
+
jsonData.prefix = prefix;
|
|
3587
|
+
jsonData.exclude = [null];
|
|
3588
|
+
}
|
|
3589
|
+
return env2.requests.post("/export/get_fields", jsonData);
|
|
3590
|
+
},
|
|
3591
|
+
async exportExcel({
|
|
3592
|
+
model,
|
|
3593
|
+
domain,
|
|
3594
|
+
ids,
|
|
3595
|
+
fields,
|
|
3596
|
+
type,
|
|
3597
|
+
importCompat,
|
|
3598
|
+
context,
|
|
3599
|
+
groupby
|
|
3600
|
+
}) {
|
|
3601
|
+
const env2 = getEnv();
|
|
3602
|
+
const jsonData = {
|
|
3603
|
+
model,
|
|
3604
|
+
domain,
|
|
3605
|
+
ids,
|
|
3606
|
+
import_compat: importCompat,
|
|
3607
|
+
fields,
|
|
3608
|
+
with_context: context,
|
|
3609
|
+
groupby: groupby ?? []
|
|
3610
|
+
};
|
|
3611
|
+
return env2.requests.post_excel(`/export/${type}`, jsonData);
|
|
3477
3612
|
}
|
|
3478
3613
|
};
|
|
3479
|
-
var
|
|
3614
|
+
var excel_service_default = ExcelService;
|
|
3480
3615
|
|
|
3481
|
-
// src/services/
|
|
3482
|
-
var
|
|
3483
|
-
|
|
3484
|
-
|
|
3616
|
+
// src/services/form-service/index.ts
|
|
3617
|
+
var FormService = {
|
|
3618
|
+
async getComment({ data }) {
|
|
3619
|
+
try {
|
|
3485
3620
|
const env2 = getEnv();
|
|
3486
|
-
|
|
3621
|
+
const jsonData = {
|
|
3622
|
+
thread_id: data.thread_id,
|
|
3623
|
+
thread_model: data.thread_model,
|
|
3624
|
+
limit: 100,
|
|
3625
|
+
with_context: {
|
|
3626
|
+
lang: data.lang
|
|
3627
|
+
}
|
|
3628
|
+
};
|
|
3629
|
+
return env2.requests.post("/chatter/thread/messages" /* GET_MESSAGE */, jsonData, {
|
|
3487
3630
|
headers: {
|
|
3488
3631
|
"Content-Type": "application/json"
|
|
3489
3632
|
}
|
|
3490
3633
|
});
|
|
3491
|
-
})
|
|
3634
|
+
} catch (error) {
|
|
3635
|
+
console.error("Error when sending message:", error);
|
|
3636
|
+
throw error;
|
|
3637
|
+
}
|
|
3492
3638
|
},
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
var _a;
|
|
3639
|
+
async sentComment({ data }) {
|
|
3640
|
+
try {
|
|
3496
3641
|
const env2 = getEnv();
|
|
3497
3642
|
const jsonData = {
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3643
|
+
context: {
|
|
3644
|
+
tz: "Asia/Saigon",
|
|
3645
|
+
uid: 2,
|
|
3646
|
+
allowed_company_ids: [1],
|
|
3647
|
+
mail_post_autofollow: false,
|
|
3648
|
+
temporary_id: 142183.01
|
|
3649
|
+
},
|
|
3650
|
+
post_data: {
|
|
3651
|
+
body: data.message,
|
|
3652
|
+
message_type: "comment",
|
|
3653
|
+
attachment_ids: data.attachment_ids,
|
|
3654
|
+
attachment_tokens: [],
|
|
3655
|
+
subtype_xmlid: data.subtype
|
|
3656
|
+
},
|
|
3657
|
+
thread_id: Number(data.thread_id),
|
|
3658
|
+
thread_model: data.thread_model
|
|
3510
3659
|
};
|
|
3511
|
-
return
|
|
3660
|
+
return env2.requests.post("/chatter/message/post" /* SENT_MESSAGE */, jsonData, {
|
|
3512
3661
|
headers: {
|
|
3513
3662
|
"Content-Type": "application/json"
|
|
3514
3663
|
}
|
|
3515
3664
|
});
|
|
3516
|
-
})
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
uploadFile(_0) {
|
|
3524
|
-
return __async(this, arguments, function* ({ formData }) {
|
|
3665
|
+
} catch (error) {
|
|
3666
|
+
console.error("Error when sent message:", error);
|
|
3667
|
+
throw error;
|
|
3668
|
+
}
|
|
3669
|
+
},
|
|
3670
|
+
async deleteComment({ data }) {
|
|
3671
|
+
try {
|
|
3525
3672
|
const env2 = getEnv();
|
|
3526
|
-
|
|
3673
|
+
const jsonData = {
|
|
3674
|
+
attachment_ids: [],
|
|
3675
|
+
attachment_tokens: [],
|
|
3676
|
+
body: "",
|
|
3677
|
+
message_id: data.message_id
|
|
3678
|
+
};
|
|
3679
|
+
return env2.requests.post("/chatter/message/update_content" /* DELETE_MESSAGE */, jsonData, {
|
|
3527
3680
|
headers: {
|
|
3528
|
-
"Content-Type": "
|
|
3681
|
+
"Content-Type": "application/json"
|
|
3529
3682
|
}
|
|
3530
3683
|
});
|
|
3531
|
-
})
|
|
3684
|
+
} catch (error) {
|
|
3685
|
+
console.error("Error when sent message:", error);
|
|
3686
|
+
throw error;
|
|
3687
|
+
}
|
|
3532
3688
|
},
|
|
3533
|
-
|
|
3534
|
-
|
|
3689
|
+
async getImage({ data }) {
|
|
3690
|
+
try {
|
|
3535
3691
|
const env2 = getEnv();
|
|
3536
|
-
return env2.requests.
|
|
3537
|
-
|
|
3538
|
-
|
|
3692
|
+
return env2.requests.get(
|
|
3693
|
+
`${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
|
|
3694
|
+
{
|
|
3695
|
+
headers: {
|
|
3696
|
+
"Content-Type": "application/json"
|
|
3697
|
+
}
|
|
3539
3698
|
}
|
|
3540
|
-
|
|
3541
|
-
})
|
|
3699
|
+
);
|
|
3700
|
+
} catch (error) {
|
|
3701
|
+
console.error("Error when sent message:", error);
|
|
3702
|
+
throw error;
|
|
3703
|
+
}
|
|
3542
3704
|
},
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
id,
|
|
3546
|
-
selectedSheet,
|
|
3547
|
-
isHeader,
|
|
3548
|
-
context
|
|
3549
|
-
}) {
|
|
3705
|
+
async uploadImage({ data }) {
|
|
3706
|
+
try {
|
|
3550
3707
|
const env2 = getEnv();
|
|
3551
|
-
|
|
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
|
|
3579
|
-
};
|
|
3580
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3708
|
+
return env2.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
|
|
3581
3709
|
headers: {
|
|
3582
3710
|
"Content-Type": "multipart/form-data"
|
|
3583
3711
|
}
|
|
3584
3712
|
});
|
|
3585
|
-
})
|
|
3713
|
+
} catch (error) {
|
|
3714
|
+
console.error("Error when sent message:", error);
|
|
3715
|
+
throw error;
|
|
3716
|
+
}
|
|
3586
3717
|
},
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
columns,
|
|
3590
|
-
fields,
|
|
3591
|
-
idFile,
|
|
3592
|
-
options,
|
|
3593
|
-
dryrun,
|
|
3594
|
-
context
|
|
3595
|
-
}) {
|
|
3718
|
+
async getFormView({ data }) {
|
|
3719
|
+
try {
|
|
3596
3720
|
const env2 = getEnv();
|
|
3597
3721
|
const jsonData = {
|
|
3598
|
-
model:
|
|
3599
|
-
method: "
|
|
3600
|
-
ids: [
|
|
3601
|
-
|
|
3602
|
-
fields,
|
|
3603
|
-
columns,
|
|
3604
|
-
options,
|
|
3605
|
-
dryrun
|
|
3606
|
-
},
|
|
3607
|
-
with_context: context
|
|
3722
|
+
model: data.model,
|
|
3723
|
+
method: "get_formview_action",
|
|
3724
|
+
ids: data.id ? [data.id] : [],
|
|
3725
|
+
with_context: data.context
|
|
3608
3726
|
};
|
|
3609
3727
|
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3610
3728
|
headers: {
|
|
3611
|
-
"Content-Type": "
|
|
3729
|
+
"Content-Type": "application/json"
|
|
3612
3730
|
}
|
|
3613
3731
|
});
|
|
3614
|
-
})
|
|
3732
|
+
} catch (error) {
|
|
3733
|
+
console.error("Error when fetching form view:", error);
|
|
3734
|
+
throw error;
|
|
3735
|
+
}
|
|
3615
3736
|
},
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3737
|
+
async changeStatus({ data }) {
|
|
3738
|
+
const env2 = getEnv();
|
|
3739
|
+
const vals = {
|
|
3740
|
+
[data.name]: data.stage_id
|
|
3741
|
+
};
|
|
3742
|
+
const jsonData = {
|
|
3743
|
+
model: data.model,
|
|
3744
|
+
method: "web_save",
|
|
3745
|
+
with_context: {
|
|
3746
|
+
lang: data.lang,
|
|
3747
|
+
allowed_company_ids: [1],
|
|
3748
|
+
uid: 2,
|
|
3749
|
+
search_default_my_ticket: true,
|
|
3750
|
+
search_default_is_open: true
|
|
3751
|
+
},
|
|
3752
|
+
ids: [data.id],
|
|
3753
|
+
kwargs: {
|
|
3754
|
+
vals,
|
|
3755
|
+
specification: {}
|
|
3756
|
+
}
|
|
3757
|
+
};
|
|
3758
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3759
|
+
headers: {
|
|
3760
|
+
"Content-Type": "application/json"
|
|
3761
|
+
}
|
|
3625
3762
|
});
|
|
3626
|
-
}
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3763
|
+
}
|
|
3764
|
+
};
|
|
3765
|
+
var form_service_default = FormService;
|
|
3766
|
+
|
|
3767
|
+
// src/services/kanban-service/index.ts
|
|
3768
|
+
var KanbanServices = {
|
|
3769
|
+
async getGroups({
|
|
3770
|
+
model,
|
|
3771
|
+
width_context
|
|
3772
|
+
}) {
|
|
3773
|
+
const env2 = getEnv();
|
|
3774
|
+
const jsonDataView = {
|
|
3630
3775
|
model,
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
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, {
|
|
3700
|
-
headers: {
|
|
3701
|
-
"Content-Type": "application/json"
|
|
3702
|
-
}
|
|
3703
|
-
});
|
|
3704
|
-
} catch (error) {
|
|
3705
|
-
console.error("Error when sending message:", error);
|
|
3706
|
-
throw error;
|
|
3707
|
-
}
|
|
3708
|
-
});
|
|
3709
|
-
},
|
|
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
|
-
});
|
|
3742
|
-
},
|
|
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;
|
|
3776
|
+
method: "web_read_group",
|
|
3777
|
+
kwargs: {
|
|
3778
|
+
domain: [["stage_id.fold", "=", false]],
|
|
3779
|
+
fields: ["color:sum"],
|
|
3780
|
+
groupby: ["stage_id"]
|
|
3781
|
+
},
|
|
3782
|
+
width_context
|
|
3783
|
+
};
|
|
3784
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
3785
|
+
headers: {
|
|
3786
|
+
"Content-Type": "application/json"
|
|
3815
3787
|
}
|
|
3816
3788
|
});
|
|
3817
3789
|
},
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
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
|
-
}
|
|
3839
|
-
};
|
|
3840
|
-
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3841
|
-
headers: {
|
|
3842
|
-
"Content-Type": "application/json"
|
|
3843
|
-
}
|
|
3844
|
-
});
|
|
3845
|
-
});
|
|
3846
|
-
}
|
|
3847
|
-
};
|
|
3848
|
-
var form_service_default = FormService;
|
|
3849
|
-
|
|
3850
|
-
// src/services/kanban-service/index.ts
|
|
3851
|
-
var KanbanServices = {
|
|
3852
|
-
getGroups(_0) {
|
|
3853
|
-
return __async(this, arguments, function* ({
|
|
3790
|
+
async getProgressBar({
|
|
3791
|
+
field,
|
|
3792
|
+
color,
|
|
3793
|
+
model,
|
|
3794
|
+
width_context
|
|
3795
|
+
}) {
|
|
3796
|
+
const env2 = getEnv();
|
|
3797
|
+
const jsonDataView = {
|
|
3854
3798
|
model,
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
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"
|
|
3799
|
+
method: "read_progress_bar",
|
|
3800
|
+
kwargs: {
|
|
3801
|
+
domain: [],
|
|
3802
|
+
group_by: "stage_id",
|
|
3803
|
+
progress_bar: {
|
|
3804
|
+
colors: color,
|
|
3805
|
+
field
|
|
3871
3806
|
}
|
|
3872
|
-
}
|
|
3873
|
-
});
|
|
3874
|
-
},
|
|
3875
|
-
getProgressBar(_0) {
|
|
3876
|
-
return __async(this, arguments, function* ({
|
|
3877
|
-
field,
|
|
3878
|
-
color,
|
|
3879
|
-
model,
|
|
3807
|
+
},
|
|
3880
3808
|
width_context
|
|
3881
|
-
}
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
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
|
-
});
|
|
3809
|
+
};
|
|
3810
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
3811
|
+
headers: {
|
|
3812
|
+
"Content-Type": "application/json"
|
|
3813
|
+
}
|
|
3901
3814
|
});
|
|
3902
3815
|
}
|
|
3903
3816
|
};
|
|
@@ -3906,285 +3819,259 @@ var kanban_service_default = KanbanServices;
|
|
|
3906
3819
|
// src/services/model-service/index.ts
|
|
3907
3820
|
var OBJECT_POSITION = 2;
|
|
3908
3821
|
var ModelService = {
|
|
3909
|
-
getListMyBankAccount(
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
}
|
|
3930
|
-
});
|
|
3822
|
+
async getListMyBankAccount({
|
|
3823
|
+
domain,
|
|
3824
|
+
spectification,
|
|
3825
|
+
model
|
|
3826
|
+
}) {
|
|
3827
|
+
const env2 = getEnv();
|
|
3828
|
+
const jsonData = {
|
|
3829
|
+
model,
|
|
3830
|
+
method: "web_search_read",
|
|
3831
|
+
kwargs: {
|
|
3832
|
+
specification: spectification,
|
|
3833
|
+
domain,
|
|
3834
|
+
limit: 100,
|
|
3835
|
+
offset: 0
|
|
3836
|
+
}
|
|
3837
|
+
};
|
|
3838
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3839
|
+
headers: {
|
|
3840
|
+
"Content-Type": "application/json"
|
|
3841
|
+
}
|
|
3931
3842
|
});
|
|
3932
3843
|
},
|
|
3933
|
-
getCurrency() {
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
}
|
|
3953
|
-
});
|
|
3844
|
+
async getCurrency() {
|
|
3845
|
+
const env2 = getEnv();
|
|
3846
|
+
const jsonData = {
|
|
3847
|
+
model: "res.currency",
|
|
3848
|
+
method: "web_search_read",
|
|
3849
|
+
kwargs: {
|
|
3850
|
+
specification: {
|
|
3851
|
+
icon_url: {},
|
|
3852
|
+
name: {}
|
|
3853
|
+
},
|
|
3854
|
+
domain: [["active", "=", true]],
|
|
3855
|
+
limit: 100,
|
|
3856
|
+
offset: 0
|
|
3857
|
+
}
|
|
3858
|
+
};
|
|
3859
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3860
|
+
headers: {
|
|
3861
|
+
"Content-Type": "application/json"
|
|
3862
|
+
}
|
|
3954
3863
|
});
|
|
3955
3864
|
},
|
|
3956
|
-
getConversionRate() {
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
sell: {}
|
|
3970
|
-
}
|
|
3865
|
+
async getConversionRate() {
|
|
3866
|
+
const env2 = getEnv();
|
|
3867
|
+
const jsonData = {
|
|
3868
|
+
model: "res.currency",
|
|
3869
|
+
method: "web_search_read",
|
|
3870
|
+
kwargs: {
|
|
3871
|
+
specification: {
|
|
3872
|
+
name: {},
|
|
3873
|
+
icon_url: {},
|
|
3874
|
+
rate_ids: {
|
|
3875
|
+
fields: {
|
|
3876
|
+
company_rate: {},
|
|
3877
|
+
sell: {}
|
|
3971
3878
|
}
|
|
3972
|
-
}
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
}
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
}
|
|
3879
|
+
}
|
|
3880
|
+
},
|
|
3881
|
+
domain: [["active", "=", true]],
|
|
3882
|
+
limit: 100,
|
|
3883
|
+
offset: 0
|
|
3884
|
+
}
|
|
3885
|
+
};
|
|
3886
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3887
|
+
headers: {
|
|
3888
|
+
"Content-Type": "application/json"
|
|
3889
|
+
}
|
|
3983
3890
|
});
|
|
3984
3891
|
},
|
|
3985
|
-
getAll(
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
});
|
|
3892
|
+
async getAll({ data }) {
|
|
3893
|
+
const env2 = getEnv();
|
|
3894
|
+
const jsonReadGroup = data.type == "calendar" ? { fields: data?.fields } : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
3895
|
+
fields: data.fields,
|
|
3896
|
+
groupby: data.groupby
|
|
3897
|
+
} : {
|
|
3898
|
+
count_limit: 10001,
|
|
3899
|
+
order: data.sort,
|
|
3900
|
+
specification: data.specification
|
|
3901
|
+
};
|
|
3902
|
+
const jsonData = {
|
|
3903
|
+
model: String(data.model),
|
|
3904
|
+
method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
|
|
3905
|
+
ids: data.ids,
|
|
3906
|
+
with_context: data.context,
|
|
3907
|
+
kwargs: {
|
|
3908
|
+
domain: data.domain,
|
|
3909
|
+
limit: data.limit,
|
|
3910
|
+
offset: data.offset,
|
|
3911
|
+
...jsonReadGroup
|
|
3912
|
+
}
|
|
3913
|
+
};
|
|
3914
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3915
|
+
headers: {
|
|
3916
|
+
"Content-Type": "application/json"
|
|
3917
|
+
}
|
|
4012
3918
|
});
|
|
4013
3919
|
},
|
|
4014
|
-
getListCalendar(
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
3920
|
+
async getListCalendar({ data }) {
|
|
3921
|
+
const env2 = getEnv();
|
|
3922
|
+
const jsonReadGroup = data.type == "calendar" ? data?.fields : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
3923
|
+
fields: data.fields,
|
|
3924
|
+
groupby: data.groupby
|
|
3925
|
+
} : {
|
|
3926
|
+
count_limit: 10001,
|
|
3927
|
+
order: data.sort,
|
|
3928
|
+
specification: data.specification
|
|
3929
|
+
};
|
|
3930
|
+
const jsonData = {
|
|
3931
|
+
model: String(data.model),
|
|
3932
|
+
method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
|
|
3933
|
+
ids: data.ids,
|
|
3934
|
+
with_context: data.context,
|
|
3935
|
+
kwargs: {
|
|
3936
|
+
domain: data.domain,
|
|
3937
|
+
limit: data.limit,
|
|
3938
|
+
offset: data.offset,
|
|
4018
3939
|
fields: data.fields,
|
|
4019
|
-
|
|
4020
|
-
}
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
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
|
-
});
|
|
3940
|
+
...jsonReadGroup
|
|
3941
|
+
}
|
|
3942
|
+
};
|
|
3943
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3944
|
+
headers: {
|
|
3945
|
+
"Content-Type": "application/json"
|
|
3946
|
+
}
|
|
4042
3947
|
});
|
|
4043
3948
|
},
|
|
4044
|
-
getList(
|
|
4045
|
-
|
|
3949
|
+
async getList({
|
|
3950
|
+
model,
|
|
3951
|
+
ids = [],
|
|
3952
|
+
specification = {},
|
|
3953
|
+
domain = [],
|
|
3954
|
+
offset,
|
|
3955
|
+
order,
|
|
3956
|
+
context = {},
|
|
3957
|
+
limit = 10
|
|
3958
|
+
}) {
|
|
3959
|
+
const env2 = getEnv();
|
|
3960
|
+
const jsonData = {
|
|
4046
3961
|
model,
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
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
|
-
});
|
|
3962
|
+
method: "web_search_read" /* WEB_SEARCH_READ */,
|
|
3963
|
+
ids,
|
|
3964
|
+
with_context: context,
|
|
3965
|
+
kwargs: {
|
|
3966
|
+
specification,
|
|
3967
|
+
domain,
|
|
3968
|
+
limit,
|
|
3969
|
+
offset,
|
|
3970
|
+
order
|
|
3971
|
+
}
|
|
3972
|
+
};
|
|
3973
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
3974
|
+
headers: {
|
|
3975
|
+
"Content-Type": "application/json"
|
|
3976
|
+
}
|
|
4075
3977
|
});
|
|
4076
3978
|
},
|
|
4077
|
-
getDetail(
|
|
4078
|
-
|
|
4079
|
-
|
|
3979
|
+
async getDetail({
|
|
3980
|
+
ids = [],
|
|
3981
|
+
model,
|
|
3982
|
+
specification,
|
|
3983
|
+
context
|
|
3984
|
+
}) {
|
|
3985
|
+
const env2 = getEnv();
|
|
3986
|
+
const jsonData = {
|
|
4080
3987
|
model,
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
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
|
+
method: "web_read" /* WEB_READ */,
|
|
3989
|
+
ids,
|
|
3990
|
+
with_context: context,
|
|
3991
|
+
kwargs: {
|
|
3992
|
+
specification
|
|
3993
|
+
}
|
|
3994
|
+
};
|
|
3995
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
3996
|
+
headers: {
|
|
3997
|
+
"Content-Type": "application/json"
|
|
3998
|
+
}
|
|
4100
3999
|
});
|
|
4101
4000
|
},
|
|
4102
|
-
save(
|
|
4103
|
-
|
|
4001
|
+
async save({
|
|
4002
|
+
model,
|
|
4003
|
+
ids = [],
|
|
4004
|
+
data = {},
|
|
4005
|
+
specification = {},
|
|
4006
|
+
context = {},
|
|
4007
|
+
path
|
|
4008
|
+
}) {
|
|
4009
|
+
const env2 = getEnv();
|
|
4010
|
+
const jsonData = {
|
|
4104
4011
|
model,
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
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
|
-
});
|
|
4012
|
+
method: "web_save" /* WEB_SAVE */,
|
|
4013
|
+
with_context: context,
|
|
4014
|
+
ids,
|
|
4015
|
+
kwargs: {
|
|
4016
|
+
vals: data,
|
|
4017
|
+
specification
|
|
4018
|
+
}
|
|
4019
|
+
};
|
|
4020
|
+
return env2?.requests?.post(path ?? "/call" /* CALL_PATH */, jsonData, {
|
|
4021
|
+
headers: {
|
|
4022
|
+
"Content-Type": "application/json"
|
|
4023
|
+
}
|
|
4128
4024
|
});
|
|
4129
4025
|
},
|
|
4130
|
-
delete(
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
"Content-Type": "application/json"
|
|
4142
|
-
}
|
|
4143
|
-
});
|
|
4026
|
+
async delete({ ids = [], model }) {
|
|
4027
|
+
const env2 = getEnv();
|
|
4028
|
+
const jsonData = {
|
|
4029
|
+
model,
|
|
4030
|
+
method: "unlink" /* UNLINK */,
|
|
4031
|
+
ids
|
|
4032
|
+
};
|
|
4033
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4034
|
+
headers: {
|
|
4035
|
+
"Content-Type": "application/json"
|
|
4036
|
+
}
|
|
4144
4037
|
});
|
|
4145
4038
|
},
|
|
4146
|
-
onChange(
|
|
4147
|
-
|
|
4148
|
-
|
|
4039
|
+
async onChange({
|
|
4040
|
+
ids = [],
|
|
4041
|
+
model,
|
|
4042
|
+
object,
|
|
4043
|
+
specification,
|
|
4044
|
+
context,
|
|
4045
|
+
fieldChange
|
|
4046
|
+
}) {
|
|
4047
|
+
const env2 = getEnv();
|
|
4048
|
+
const jsonData = {
|
|
4149
4049
|
model,
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
context,
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
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
|
-
});
|
|
4050
|
+
method: "onchange" /* ONCHANGE */,
|
|
4051
|
+
ids,
|
|
4052
|
+
with_context: context,
|
|
4053
|
+
args: [
|
|
4054
|
+
object ? object : {},
|
|
4055
|
+
fieldChange ? fieldChange : [],
|
|
4056
|
+
specification
|
|
4057
|
+
]
|
|
4058
|
+
};
|
|
4059
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4060
|
+
headers: {
|
|
4061
|
+
"Content-Type": "application/json"
|
|
4062
|
+
}
|
|
4173
4063
|
});
|
|
4174
|
-
},
|
|
4175
|
-
getListFieldsOnchange(
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
"Content-Type": "application/json"
|
|
4186
|
-
}
|
|
4187
|
-
});
|
|
4064
|
+
},
|
|
4065
|
+
async getListFieldsOnchange({ model }) {
|
|
4066
|
+
const env2 = getEnv();
|
|
4067
|
+
const jsonData = {
|
|
4068
|
+
model,
|
|
4069
|
+
method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
|
|
4070
|
+
};
|
|
4071
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4072
|
+
headers: {
|
|
4073
|
+
"Content-Type": "application/json"
|
|
4074
|
+
}
|
|
4188
4075
|
});
|
|
4189
4076
|
},
|
|
4190
4077
|
parseORMOdoo(data) {
|
|
@@ -4198,14 +4085,13 @@ var ModelService = {
|
|
|
4198
4085
|
data[key] = "/";
|
|
4199
4086
|
}
|
|
4200
4087
|
}
|
|
4201
|
-
return
|
|
4088
|
+
return { ...data };
|
|
4202
4089
|
},
|
|
4203
4090
|
toDataJS(data, viewData, model) {
|
|
4204
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
4205
4091
|
for (const key in data) {
|
|
4206
4092
|
if (data[key] === false) {
|
|
4207
4093
|
if (viewData && model) {
|
|
4208
|
-
if (
|
|
4094
|
+
if (viewData?.models?.[model]?.[key]?.type !== "boolean" /* BOOLEAN */) {
|
|
4209
4095
|
data[key] = null;
|
|
4210
4096
|
}
|
|
4211
4097
|
} else {
|
|
@@ -4215,13 +4101,12 @@ var ModelService = {
|
|
|
4215
4101
|
data[key] = "Draft";
|
|
4216
4102
|
} else if (data[key] !== false) {
|
|
4217
4103
|
if (model !== void 0) {
|
|
4218
|
-
if (
|
|
4219
|
-
data[key] = (
|
|
4220
|
-
|
|
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;
|
|
4104
|
+
if (viewData?.models?.[model]?.[key]?.type === "one2many" /* ONE2MANY */ || viewData?.models?.[model]?.[key]?.type === "many2many" /* MANY2MANY */) {
|
|
4105
|
+
data[key] = (data[key] ??= [])?.map((item) => {
|
|
4106
|
+
const relation = viewData?.models?.[model]?.[key]?.relation;
|
|
4222
4107
|
if (relation !== void 0) {
|
|
4223
|
-
if (
|
|
4224
|
-
if (
|
|
4108
|
+
if (viewData?.models?.[relation]) {
|
|
4109
|
+
if (item?.length >= 3) {
|
|
4225
4110
|
return ModelService.toDataJS(
|
|
4226
4111
|
item[OBJECT_POSITION],
|
|
4227
4112
|
viewData,
|
|
@@ -4231,7 +4116,7 @@ var ModelService = {
|
|
|
4231
4116
|
return ModelService.toDataJS(item, viewData, relation);
|
|
4232
4117
|
}
|
|
4233
4118
|
} else {
|
|
4234
|
-
if (
|
|
4119
|
+
if (item?.length >= 3) {
|
|
4235
4120
|
return item[OBJECT_POSITION];
|
|
4236
4121
|
} else {
|
|
4237
4122
|
return item;
|
|
@@ -4243,556 +4128,514 @@ var ModelService = {
|
|
|
4243
4128
|
}
|
|
4244
4129
|
}
|
|
4245
4130
|
}
|
|
4246
|
-
return
|
|
4131
|
+
return { ...data };
|
|
4247
4132
|
}
|
|
4248
4133
|
};
|
|
4249
4134
|
var model_service_default = ModelService;
|
|
4250
4135
|
|
|
4251
4136
|
// src/services/user-service/index.ts
|
|
4252
4137
|
var UserService = {
|
|
4253
|
-
getProfile(path) {
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
}
|
|
4260
|
-
});
|
|
4138
|
+
async getProfile(path) {
|
|
4139
|
+
const env2 = getEnv();
|
|
4140
|
+
return env2.requests.get(path ?? "/userinfo" /* PROFILE_PATH */, {
|
|
4141
|
+
headers: {
|
|
4142
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
4143
|
+
}
|
|
4261
4144
|
});
|
|
4262
4145
|
},
|
|
4263
|
-
getUser(
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
display_name: {}
|
|
4289
|
-
}
|
|
4146
|
+
async getUser({ context, id }) {
|
|
4147
|
+
const env2 = getEnv();
|
|
4148
|
+
const jsonData = {
|
|
4149
|
+
model: "res.users",
|
|
4150
|
+
method: "web_read",
|
|
4151
|
+
ids: [id],
|
|
4152
|
+
with_context: context,
|
|
4153
|
+
kwargs: {
|
|
4154
|
+
specification: {
|
|
4155
|
+
display_name: {},
|
|
4156
|
+
image_1920: {},
|
|
4157
|
+
name: {},
|
|
4158
|
+
login: {},
|
|
4159
|
+
email: {},
|
|
4160
|
+
password: {},
|
|
4161
|
+
visible_group_id: {
|
|
4162
|
+
fields: {
|
|
4163
|
+
id: {},
|
|
4164
|
+
display_name: {}
|
|
4165
|
+
}
|
|
4166
|
+
},
|
|
4167
|
+
company_id: {
|
|
4168
|
+
fields: {
|
|
4169
|
+
id: {},
|
|
4170
|
+
display_name: {}
|
|
4290
4171
|
}
|
|
4291
4172
|
}
|
|
4292
4173
|
}
|
|
4293
|
-
}
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
}
|
|
4174
|
+
}
|
|
4175
|
+
};
|
|
4176
|
+
return env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4177
|
+
headers: {
|
|
4178
|
+
"Content-Type": "application/json"
|
|
4179
|
+
}
|
|
4299
4180
|
});
|
|
4300
4181
|
},
|
|
4301
|
-
switchUserLocale:
|
|
4302
|
-
var _a;
|
|
4182
|
+
switchUserLocale: async ({ id, values }) => {
|
|
4303
4183
|
const env2 = getEnv();
|
|
4304
4184
|
const jsonData = {
|
|
4305
4185
|
model: "res.users",
|
|
4306
4186
|
domain: [["id", "=", id]],
|
|
4307
4187
|
values
|
|
4308
4188
|
};
|
|
4309
|
-
return env2
|
|
4189
|
+
return env2?.requests.post(UriConstants?.CREATE_UPDATE_PATH, jsonData, {
|
|
4310
4190
|
headers: {
|
|
4311
4191
|
"Content-Type": "application/json"
|
|
4312
4192
|
}
|
|
4313
4193
|
});
|
|
4314
|
-
}
|
|
4194
|
+
}
|
|
4315
4195
|
};
|
|
4316
4196
|
var user_service_default = UserService;
|
|
4317
4197
|
|
|
4318
4198
|
// src/services/view-service/index.ts
|
|
4319
4199
|
var ViewService = {
|
|
4320
|
-
getView(
|
|
4321
|
-
|
|
4200
|
+
async getView({
|
|
4201
|
+
model,
|
|
4202
|
+
views,
|
|
4203
|
+
context = {},
|
|
4204
|
+
options = {},
|
|
4205
|
+
aid
|
|
4206
|
+
}) {
|
|
4207
|
+
const env2 = getEnv();
|
|
4208
|
+
const defaultOptions = {
|
|
4209
|
+
load_filters: true,
|
|
4210
|
+
toolbar: true,
|
|
4211
|
+
action_id: aid
|
|
4212
|
+
};
|
|
4213
|
+
const jsonDataView = {
|
|
4322
4214
|
model,
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
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
|
+
method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
|
|
4216
|
+
kwargs: {
|
|
4217
|
+
views,
|
|
4218
|
+
options: { ...options, ...defaultOptions }
|
|
4219
|
+
},
|
|
4220
|
+
with_context: context
|
|
4221
|
+
};
|
|
4222
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
4223
|
+
headers: {
|
|
4224
|
+
"Content-Type": "application/json"
|
|
4225
|
+
}
|
|
4349
4226
|
});
|
|
4350
4227
|
},
|
|
4351
|
-
getMenu(context) {
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4228
|
+
async getMenu(context) {
|
|
4229
|
+
const env2 = getEnv();
|
|
4230
|
+
const jsonData = {
|
|
4231
|
+
model: "ir.ui.menu" /* MENU */,
|
|
4232
|
+
method: "web_search_read" /* WEB_SEARCH_READ */,
|
|
4233
|
+
ids: [],
|
|
4234
|
+
with_context: context,
|
|
4235
|
+
kwargs: {
|
|
4236
|
+
specification: {
|
|
4237
|
+
active: {},
|
|
4238
|
+
name: {},
|
|
4239
|
+
is_display: {},
|
|
4240
|
+
sequence: {},
|
|
4241
|
+
complete_name: {},
|
|
4242
|
+
action: {
|
|
4243
|
+
fields: {
|
|
4244
|
+
display_name: {},
|
|
4245
|
+
type: {},
|
|
4246
|
+
binding_view_types: {}
|
|
4247
|
+
// res_model: {},
|
|
4248
|
+
}
|
|
4249
|
+
},
|
|
4250
|
+
url_icon: {},
|
|
4251
|
+
web_icon: {},
|
|
4252
|
+
web_icon_data: {},
|
|
4253
|
+
groups_id: {
|
|
4254
|
+
fields: {
|
|
4255
|
+
full_name: {}
|
|
4374
4256
|
},
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4257
|
+
limit: 40,
|
|
4258
|
+
order: ""
|
|
4259
|
+
},
|
|
4260
|
+
display_name: {},
|
|
4261
|
+
child_id: {
|
|
4262
|
+
fields: {
|
|
4263
|
+
active: {},
|
|
4264
|
+
name: {},
|
|
4265
|
+
is_display: {},
|
|
4266
|
+
sequence: {},
|
|
4267
|
+
complete_name: {},
|
|
4268
|
+
action: {
|
|
4269
|
+
fields: {
|
|
4270
|
+
display_name: {},
|
|
4271
|
+
type: {},
|
|
4272
|
+
binding_view_types: {}
|
|
4273
|
+
// res_model: {},
|
|
4274
|
+
}
|
|
4381
4275
|
},
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
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
|
-
}
|
|
4276
|
+
url_icon: {},
|
|
4277
|
+
web_icon: {},
|
|
4278
|
+
web_icon_data: {},
|
|
4279
|
+
groups_id: {
|
|
4280
|
+
fields: {
|
|
4281
|
+
full_name: {}
|
|
4400
4282
|
},
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4283
|
+
limit: 40,
|
|
4284
|
+
order: ""
|
|
4285
|
+
},
|
|
4286
|
+
display_name: {},
|
|
4287
|
+
child_id: {
|
|
4288
|
+
fields: {
|
|
4289
|
+
active: {},
|
|
4290
|
+
name: {},
|
|
4291
|
+
is_display: {},
|
|
4292
|
+
sequence: {},
|
|
4293
|
+
complete_name: {},
|
|
4294
|
+
action: {
|
|
4295
|
+
fields: {
|
|
4296
|
+
display_name: {},
|
|
4297
|
+
type: {},
|
|
4298
|
+
binding_view_types: {}
|
|
4299
|
+
// res_model: {},
|
|
4300
|
+
}
|
|
4407
4301
|
},
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
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
|
-
}
|
|
4302
|
+
url_icon: {},
|
|
4303
|
+
web_icon: {},
|
|
4304
|
+
web_icon_data: {},
|
|
4305
|
+
groups_id: {
|
|
4306
|
+
fields: {
|
|
4307
|
+
full_name: {}
|
|
4426
4308
|
},
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4309
|
+
limit: 40,
|
|
4310
|
+
order: ""
|
|
4311
|
+
},
|
|
4312
|
+
display_name: {},
|
|
4313
|
+
child_id: {
|
|
4314
|
+
fields: {
|
|
4315
|
+
active: {},
|
|
4316
|
+
name: {},
|
|
4317
|
+
is_display: {},
|
|
4318
|
+
sequence: {},
|
|
4319
|
+
complete_name: {},
|
|
4320
|
+
action: {
|
|
4321
|
+
fields: {
|
|
4322
|
+
display_name: {},
|
|
4323
|
+
type: {},
|
|
4324
|
+
binding_view_types: {}
|
|
4325
|
+
// res_model: {},
|
|
4326
|
+
}
|
|
4433
4327
|
},
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
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
|
-
}
|
|
4452
|
-
},
|
|
4453
|
-
url_icon: {},
|
|
4454
|
-
web_icon: {},
|
|
4455
|
-
web_icon_data: {},
|
|
4456
|
-
groups_id: {
|
|
4457
|
-
fields: {
|
|
4458
|
-
full_name: {}
|
|
4459
|
-
},
|
|
4460
|
-
limit: 40,
|
|
4461
|
-
order: ""
|
|
4328
|
+
url_icon: {},
|
|
4329
|
+
web_icon: {},
|
|
4330
|
+
web_icon_data: {},
|
|
4331
|
+
groups_id: {
|
|
4332
|
+
fields: {
|
|
4333
|
+
full_name: {}
|
|
4462
4334
|
},
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
fields: {},
|
|
4466
|
-
limit: 40,
|
|
4467
|
-
order: ""
|
|
4468
|
-
}
|
|
4335
|
+
limit: 40,
|
|
4336
|
+
order: ""
|
|
4469
4337
|
},
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
"
|
|
4494
|
-
|
|
4495
|
-
|
|
4338
|
+
display_name: {},
|
|
4339
|
+
child_id: {
|
|
4340
|
+
fields: {},
|
|
4341
|
+
limit: 40,
|
|
4342
|
+
order: ""
|
|
4343
|
+
}
|
|
4344
|
+
},
|
|
4345
|
+
limit: 40,
|
|
4346
|
+
order: ""
|
|
4347
|
+
}
|
|
4348
|
+
},
|
|
4349
|
+
limit: 40,
|
|
4350
|
+
order: ""
|
|
4351
|
+
}
|
|
4352
|
+
},
|
|
4353
|
+
limit: 40,
|
|
4354
|
+
order: ""
|
|
4355
|
+
}
|
|
4356
|
+
},
|
|
4357
|
+
domain: [
|
|
4358
|
+
"&",
|
|
4359
|
+
["is_display", "=", true],
|
|
4360
|
+
"&",
|
|
4361
|
+
["active", "=", true],
|
|
4362
|
+
["parent_id", "=", false]
|
|
4363
|
+
]
|
|
4364
|
+
}
|
|
4365
|
+
};
|
|
4366
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4367
|
+
headers: {
|
|
4368
|
+
"Content-Type": "application/json"
|
|
4369
|
+
}
|
|
4496
4370
|
});
|
|
4497
4371
|
},
|
|
4498
|
-
getActionDetail(aid, context) {
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
groups_id: {},
|
|
4518
|
-
search_view_id: {}
|
|
4519
|
-
}
|
|
4520
|
-
}
|
|
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"
|
|
4372
|
+
async getActionDetail(aid, context) {
|
|
4373
|
+
const env2 = getEnv();
|
|
4374
|
+
const jsonData = {
|
|
4375
|
+
model: "ir.actions.act_window" /* WINDOW_ACTION */,
|
|
4376
|
+
method: "web_read" /* WEB_READ */,
|
|
4377
|
+
ids: [aid],
|
|
4378
|
+
with_context: context,
|
|
4379
|
+
kwargs: {
|
|
4380
|
+
specification: {
|
|
4381
|
+
id: {},
|
|
4382
|
+
name: {},
|
|
4383
|
+
res_model: {},
|
|
4384
|
+
views: {},
|
|
4385
|
+
view_mode: {},
|
|
4386
|
+
mobile_view_mode: {},
|
|
4387
|
+
domain: {},
|
|
4388
|
+
context: {},
|
|
4389
|
+
groups_id: {},
|
|
4390
|
+
search_view_id: {}
|
|
4525
4391
|
}
|
|
4526
|
-
}
|
|
4392
|
+
}
|
|
4393
|
+
};
|
|
4394
|
+
return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4395
|
+
headers: {
|
|
4396
|
+
"Content-Type": "application/json"
|
|
4397
|
+
}
|
|
4527
4398
|
});
|
|
4528
4399
|
},
|
|
4529
|
-
getResequence(
|
|
4530
|
-
|
|
4400
|
+
async getResequence({
|
|
4401
|
+
model,
|
|
4402
|
+
ids,
|
|
4403
|
+
context,
|
|
4404
|
+
offset
|
|
4405
|
+
}) {
|
|
4406
|
+
const env2 = getEnv();
|
|
4407
|
+
const jsonData = {
|
|
4531
4408
|
model,
|
|
4409
|
+
with_context: context,
|
|
4532
4410
|
ids,
|
|
4533
|
-
|
|
4534
|
-
offset
|
|
4535
|
-
}
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
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
|
-
});
|
|
4548
|
-
});
|
|
4549
|
-
},
|
|
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
|
-
}
|
|
4569
|
-
}
|
|
4570
|
-
};
|
|
4571
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4572
|
-
headers: {
|
|
4573
|
-
"Content-Type": "application/json"
|
|
4574
|
-
}
|
|
4575
|
-
});
|
|
4411
|
+
field: "sequence",
|
|
4412
|
+
...offset > 0 ? { offset } : {}
|
|
4413
|
+
};
|
|
4414
|
+
return env2?.requests.post("/web/dataset/resequence", jsonData, {
|
|
4415
|
+
headers: {
|
|
4416
|
+
"Content-Type": "application/json"
|
|
4417
|
+
}
|
|
4576
4418
|
});
|
|
4577
4419
|
},
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4420
|
+
async getSelectionItem({ data }) {
|
|
4421
|
+
const env2 = getEnv();
|
|
4422
|
+
const jsonData = {
|
|
4423
|
+
model: data.model,
|
|
4424
|
+
ids: [],
|
|
4425
|
+
method: "get_data_select",
|
|
4426
|
+
with_context: data.context,
|
|
4427
|
+
kwargs: {
|
|
4428
|
+
count_limit: 10001,
|
|
4429
|
+
domain: data.domain ? data.domain : [],
|
|
4430
|
+
offset: 0,
|
|
4431
|
+
order: "",
|
|
4432
|
+
specification: data?.specification ?? {
|
|
4433
|
+
id: {},
|
|
4434
|
+
name: {},
|
|
4435
|
+
display_name: {}
|
|
4588
4436
|
}
|
|
4589
|
-
|
|
4437
|
+
}
|
|
4438
|
+
};
|
|
4439
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4440
|
+
headers: {
|
|
4441
|
+
"Content-Type": "application/json"
|
|
4442
|
+
}
|
|
4590
4443
|
});
|
|
4591
4444
|
},
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4445
|
+
async loadMessages() {
|
|
4446
|
+
const env2 = getEnv();
|
|
4447
|
+
return env2.requests.post(
|
|
4448
|
+
"/load_message_failures" /* LOAD_MESSAGE */,
|
|
4449
|
+
{},
|
|
4450
|
+
{
|
|
4598
4451
|
headers: {
|
|
4599
4452
|
"Content-Type": "application/json"
|
|
4600
4453
|
}
|
|
4601
|
-
}
|
|
4454
|
+
}
|
|
4455
|
+
);
|
|
4456
|
+
},
|
|
4457
|
+
async getVersion() {
|
|
4458
|
+
const env2 = getEnv();
|
|
4459
|
+
return env2?.requests.get("", {
|
|
4460
|
+
headers: {
|
|
4461
|
+
"Content-Type": "application/json"
|
|
4462
|
+
}
|
|
4602
4463
|
});
|
|
4603
4464
|
},
|
|
4604
|
-
get2FAMethods(
|
|
4605
|
-
|
|
4465
|
+
async get2FAMethods({
|
|
4466
|
+
method,
|
|
4467
|
+
with_context
|
|
4468
|
+
}) {
|
|
4469
|
+
const env2 = getEnv();
|
|
4470
|
+
const jsonData = {
|
|
4606
4471
|
method,
|
|
4607
4472
|
with_context
|
|
4608
|
-
}
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
};
|
|
4614
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4615
|
-
headers: {
|
|
4616
|
-
"Content-Type": "application/json"
|
|
4617
|
-
}
|
|
4618
|
-
});
|
|
4473
|
+
};
|
|
4474
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4475
|
+
headers: {
|
|
4476
|
+
"Content-Type": "application/json"
|
|
4477
|
+
}
|
|
4619
4478
|
});
|
|
4620
4479
|
},
|
|
4621
|
-
verify2FA(
|
|
4622
|
-
|
|
4480
|
+
async verify2FA({
|
|
4481
|
+
method,
|
|
4482
|
+
with_context,
|
|
4483
|
+
code,
|
|
4484
|
+
device,
|
|
4485
|
+
location
|
|
4486
|
+
}) {
|
|
4487
|
+
const env2 = getEnv();
|
|
4488
|
+
const jsonData = {
|
|
4623
4489
|
method,
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
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
|
-
});
|
|
4490
|
+
kwargs: {
|
|
4491
|
+
vals: {
|
|
4492
|
+
code,
|
|
4493
|
+
device,
|
|
4494
|
+
location
|
|
4495
|
+
}
|
|
4496
|
+
},
|
|
4497
|
+
with_context
|
|
4498
|
+
};
|
|
4499
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4500
|
+
headers: {
|
|
4501
|
+
"Content-Type": "application/json"
|
|
4502
|
+
},
|
|
4503
|
+
withCredentials: true
|
|
4647
4504
|
});
|
|
4648
4505
|
},
|
|
4649
|
-
signInSSO(
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4506
|
+
async signInSSO({
|
|
4507
|
+
redirect_uri,
|
|
4508
|
+
state,
|
|
4509
|
+
client_id,
|
|
4510
|
+
response_type,
|
|
4511
|
+
path
|
|
4512
|
+
}) {
|
|
4513
|
+
const env2 = getEnv();
|
|
4514
|
+
const params = new URLSearchParams({
|
|
4654
4515
|
response_type,
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
}
|
|
4664
|
-
|
|
4665
|
-
return env2 == null ? void 0 : env2.requests.get(url, {
|
|
4666
|
-
headers: {
|
|
4667
|
-
"Content-Type": "application/json"
|
|
4668
|
-
},
|
|
4669
|
-
withCredentials: true
|
|
4670
|
-
});
|
|
4516
|
+
client_id,
|
|
4517
|
+
redirect_uri,
|
|
4518
|
+
state
|
|
4519
|
+
});
|
|
4520
|
+
const url = `${path}?${params.toString()}`;
|
|
4521
|
+
return env2?.requests.get(url, {
|
|
4522
|
+
headers: {
|
|
4523
|
+
"Content-Type": "application/json"
|
|
4524
|
+
},
|
|
4525
|
+
withCredentials: true
|
|
4671
4526
|
});
|
|
4672
4527
|
},
|
|
4673
|
-
grantAccess(
|
|
4674
|
-
|
|
4528
|
+
async grantAccess({
|
|
4529
|
+
redirect_uri,
|
|
4530
|
+
state,
|
|
4531
|
+
client_id,
|
|
4532
|
+
scopes
|
|
4533
|
+
}) {
|
|
4534
|
+
const env2 = getEnv();
|
|
4535
|
+
const jsonData = {
|
|
4675
4536
|
redirect_uri,
|
|
4676
4537
|
state,
|
|
4677
4538
|
client_id,
|
|
4678
4539
|
scopes
|
|
4679
|
-
}
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
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
|
-
});
|
|
4540
|
+
};
|
|
4541
|
+
return env2?.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
|
|
4542
|
+
headers: {
|
|
4543
|
+
"Content-Type": "application/json"
|
|
4544
|
+
},
|
|
4545
|
+
withCredentials: true
|
|
4693
4546
|
});
|
|
4694
4547
|
},
|
|
4695
|
-
getFieldsViewSecurity(
|
|
4696
|
-
|
|
4548
|
+
async getFieldsViewSecurity({
|
|
4549
|
+
method,
|
|
4550
|
+
token,
|
|
4551
|
+
views
|
|
4552
|
+
}) {
|
|
4553
|
+
const env2 = getEnv();
|
|
4554
|
+
const jsonData = {
|
|
4697
4555
|
method,
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
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
|
+
kwargs: {
|
|
4557
|
+
views
|
|
4558
|
+
},
|
|
4559
|
+
with_context: {
|
|
4560
|
+
token
|
|
4561
|
+
}
|
|
4562
|
+
};
|
|
4563
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4564
|
+
headers: {
|
|
4565
|
+
"Content-Type": "application/json"
|
|
4566
|
+
}
|
|
4716
4567
|
});
|
|
4717
4568
|
},
|
|
4718
|
-
settingsWebRead2fa(
|
|
4719
|
-
|
|
4569
|
+
async settingsWebRead2fa({
|
|
4570
|
+
method,
|
|
4571
|
+
model,
|
|
4572
|
+
kwargs,
|
|
4573
|
+
token
|
|
4574
|
+
}) {
|
|
4575
|
+
const env2 = getEnv();
|
|
4576
|
+
const jsonData = {
|
|
4720
4577
|
method,
|
|
4721
4578
|
model,
|
|
4722
4579
|
kwargs,
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
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
|
-
});
|
|
4580
|
+
with_context: {
|
|
4581
|
+
token
|
|
4582
|
+
}
|
|
4583
|
+
};
|
|
4584
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4585
|
+
headers: {
|
|
4586
|
+
"Content-Type": "application/json"
|
|
4587
|
+
}
|
|
4739
4588
|
});
|
|
4740
4589
|
},
|
|
4741
|
-
requestSetupTotp(
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
}
|
|
4754
|
-
});
|
|
4590
|
+
async requestSetupTotp({ method, token }) {
|
|
4591
|
+
const env2 = getEnv();
|
|
4592
|
+
const jsonData = {
|
|
4593
|
+
method,
|
|
4594
|
+
with_context: {
|
|
4595
|
+
token
|
|
4596
|
+
}
|
|
4597
|
+
};
|
|
4598
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4599
|
+
headers: {
|
|
4600
|
+
"Content-Type": "application/json"
|
|
4601
|
+
}
|
|
4755
4602
|
});
|
|
4756
4603
|
},
|
|
4757
|
-
verifyTotp(
|
|
4758
|
-
|
|
4604
|
+
async verifyTotp({
|
|
4605
|
+
method,
|
|
4606
|
+
action_token,
|
|
4607
|
+
code
|
|
4608
|
+
}) {
|
|
4609
|
+
const env2 = getEnv();
|
|
4610
|
+
const jsonData = {
|
|
4759
4611
|
method,
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
const env2 = getEnv();
|
|
4764
|
-
const jsonData = {
|
|
4765
|
-
method,
|
|
4766
|
-
kwargs: {
|
|
4767
|
-
vals: {
|
|
4768
|
-
code
|
|
4769
|
-
}
|
|
4770
|
-
},
|
|
4771
|
-
with_context: {
|
|
4772
|
-
action_token
|
|
4773
|
-
}
|
|
4774
|
-
};
|
|
4775
|
-
return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4776
|
-
headers: {
|
|
4777
|
-
"Content-Type": "application/json"
|
|
4612
|
+
kwargs: {
|
|
4613
|
+
vals: {
|
|
4614
|
+
code
|
|
4778
4615
|
}
|
|
4779
|
-
}
|
|
4616
|
+
},
|
|
4617
|
+
with_context: {
|
|
4618
|
+
action_token
|
|
4619
|
+
}
|
|
4620
|
+
};
|
|
4621
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4622
|
+
headers: {
|
|
4623
|
+
"Content-Type": "application/json"
|
|
4624
|
+
}
|
|
4780
4625
|
});
|
|
4781
4626
|
},
|
|
4782
|
-
removeTotpSetUp(
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
}
|
|
4795
|
-
});
|
|
4627
|
+
async removeTotpSetUp({ method, token }) {
|
|
4628
|
+
const env2 = getEnv();
|
|
4629
|
+
const jsonData = {
|
|
4630
|
+
method,
|
|
4631
|
+
with_context: {
|
|
4632
|
+
token
|
|
4633
|
+
}
|
|
4634
|
+
};
|
|
4635
|
+
return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4636
|
+
headers: {
|
|
4637
|
+
"Content-Type": "application/json"
|
|
4638
|
+
}
|
|
4796
4639
|
});
|
|
4797
4640
|
}
|
|
4798
4641
|
};
|
|
@@ -4828,7 +4671,7 @@ import { useMutation as useMutation3 } from "@tanstack/react-query";
|
|
|
4828
4671
|
var useGetProvider = () => {
|
|
4829
4672
|
return useMutation3({
|
|
4830
4673
|
mutationFn: (data) => {
|
|
4831
|
-
return auth_service_default.getProviders(data
|
|
4674
|
+
return auth_service_default.getProviders(data?.db);
|
|
4832
4675
|
}
|
|
4833
4676
|
});
|
|
4834
4677
|
};
|
|
@@ -4930,19 +4773,33 @@ var useGetAccessByCode = () => {
|
|
|
4930
4773
|
};
|
|
4931
4774
|
var use_get_access_by_code_default = useGetAccessByCode;
|
|
4932
4775
|
|
|
4933
|
-
// src/hooks/
|
|
4776
|
+
// src/hooks/auth/use-validate-action-token.ts
|
|
4934
4777
|
import { useMutation as useMutation12 } from "@tanstack/react-query";
|
|
4935
|
-
var
|
|
4778
|
+
var useValidateActionToken = () => {
|
|
4936
4779
|
return useMutation12({
|
|
4780
|
+
mutationFn: ({
|
|
4781
|
+
actionToken,
|
|
4782
|
+
path
|
|
4783
|
+
}) => {
|
|
4784
|
+
return auth_service_default.isValidActionToken(actionToken, path);
|
|
4785
|
+
}
|
|
4786
|
+
});
|
|
4787
|
+
};
|
|
4788
|
+
var use_validate_action_token_default = useValidateActionToken;
|
|
4789
|
+
|
|
4790
|
+
// src/hooks/company/use-get-company-info.ts
|
|
4791
|
+
import { useMutation as useMutation13 } from "@tanstack/react-query";
|
|
4792
|
+
var useGetCompanyInfo = () => {
|
|
4793
|
+
return useMutation13({
|
|
4937
4794
|
mutationFn: (id) => company_service_default.getInfoCompany(id)
|
|
4938
4795
|
});
|
|
4939
4796
|
};
|
|
4940
4797
|
var use_get_company_info_default = useGetCompanyInfo;
|
|
4941
4798
|
|
|
4942
4799
|
// src/hooks/company/use-get-current-company.ts
|
|
4943
|
-
import { useMutation as
|
|
4800
|
+
import { useMutation as useMutation14 } from "@tanstack/react-query";
|
|
4944
4801
|
var useGetCurrentCompany = () => {
|
|
4945
|
-
return
|
|
4802
|
+
return useMutation14({
|
|
4946
4803
|
mutationFn: () => company_service_default.getCurrentCompany()
|
|
4947
4804
|
});
|
|
4948
4805
|
};
|
|
@@ -4969,9 +4826,9 @@ var useGetListCompany = (companyIDs = []) => {
|
|
|
4969
4826
|
var use_get_list_company_default = useGetListCompany;
|
|
4970
4827
|
|
|
4971
4828
|
// src/hooks/excel/use-export-excel.ts
|
|
4972
|
-
import { useMutation as
|
|
4829
|
+
import { useMutation as useMutation15 } from "@tanstack/react-query";
|
|
4973
4830
|
var useExportExcel = () => {
|
|
4974
|
-
return
|
|
4831
|
+
return useMutation15({
|
|
4975
4832
|
mutationFn: ({
|
|
4976
4833
|
model,
|
|
4977
4834
|
domain,
|
|
@@ -4996,9 +4853,9 @@ var useExportExcel = () => {
|
|
|
4996
4853
|
var use_export_excel_default = useExportExcel;
|
|
4997
4854
|
|
|
4998
4855
|
// src/hooks/excel/use-get-field-export.ts
|
|
4999
|
-
import { useMutation as
|
|
4856
|
+
import { useMutation as useMutation16 } from "@tanstack/react-query";
|
|
5000
4857
|
var useGetFieldExport = () => {
|
|
5001
|
-
return
|
|
4858
|
+
return useMutation16({
|
|
5002
4859
|
mutationFn: ({
|
|
5003
4860
|
ids,
|
|
5004
4861
|
model,
|
|
@@ -5045,9 +4902,9 @@ var useGetFileExcel = ({ model }) => {
|
|
|
5045
4902
|
var use_get_file_excel_default = useGetFileExcel;
|
|
5046
4903
|
|
|
5047
4904
|
// src/hooks/excel/use-parse-preview.ts
|
|
5048
|
-
import { useMutation as
|
|
4905
|
+
import { useMutation as useMutation17 } from "@tanstack/react-query";
|
|
5049
4906
|
var useParsePreview = () => {
|
|
5050
|
-
return
|
|
4907
|
+
return useMutation17({
|
|
5051
4908
|
mutationFn: ({
|
|
5052
4909
|
id,
|
|
5053
4910
|
selectedSheet,
|
|
@@ -5064,9 +4921,9 @@ var useParsePreview = () => {
|
|
|
5064
4921
|
var use_parse_preview_default = useParsePreview;
|
|
5065
4922
|
|
|
5066
4923
|
// src/hooks/excel/use-upload-file.ts
|
|
5067
|
-
import { useMutation as
|
|
4924
|
+
import { useMutation as useMutation18 } from "@tanstack/react-query";
|
|
5068
4925
|
var useUploadFile = () => {
|
|
5069
|
-
return
|
|
4926
|
+
return useMutation18({
|
|
5070
4927
|
mutationFn: ({ formData }) => excel_service_default.uploadFile({
|
|
5071
4928
|
formData
|
|
5072
4929
|
})
|
|
@@ -5075,9 +4932,9 @@ var useUploadFile = () => {
|
|
|
5075
4932
|
var use_upload_file_default = useUploadFile;
|
|
5076
4933
|
|
|
5077
4934
|
// src/hooks/excel/use-upload-id-file.ts
|
|
5078
|
-
import { useMutation as
|
|
4935
|
+
import { useMutation as useMutation19 } from "@tanstack/react-query";
|
|
5079
4936
|
var useUploadIdFile = () => {
|
|
5080
|
-
return
|
|
4937
|
+
return useMutation19({
|
|
5081
4938
|
mutationFn: ({ formData }) => excel_service_default.uploadIdFile({
|
|
5082
4939
|
formData
|
|
5083
4940
|
})
|
|
@@ -5086,9 +4943,9 @@ var useUploadIdFile = () => {
|
|
|
5086
4943
|
var use_upload_id_file_default = useUploadIdFile;
|
|
5087
4944
|
|
|
5088
4945
|
// src/hooks/excel/uss-execute-import.ts
|
|
5089
|
-
import { useMutation as
|
|
4946
|
+
import { useMutation as useMutation20 } from "@tanstack/react-query";
|
|
5090
4947
|
var useExecuteImport = () => {
|
|
5091
|
-
return
|
|
4948
|
+
return useMutation20({
|
|
5092
4949
|
mutationFn: ({
|
|
5093
4950
|
fields,
|
|
5094
4951
|
columns,
|
|
@@ -5109,9 +4966,9 @@ var useExecuteImport = () => {
|
|
|
5109
4966
|
var uss_execute_import_default = useExecuteImport;
|
|
5110
4967
|
|
|
5111
4968
|
// src/hooks/form/use-change-status.ts
|
|
5112
|
-
import { useMutation as
|
|
4969
|
+
import { useMutation as useMutation21 } from "@tanstack/react-query";
|
|
5113
4970
|
var useChangeStatus = () => {
|
|
5114
|
-
return
|
|
4971
|
+
return useMutation21({
|
|
5115
4972
|
mutationFn: ({ data }) => {
|
|
5116
4973
|
return form_service_default.changeStatus({
|
|
5117
4974
|
data
|
|
@@ -5122,9 +4979,9 @@ var useChangeStatus = () => {
|
|
|
5122
4979
|
var use_change_status_default = useChangeStatus;
|
|
5123
4980
|
|
|
5124
4981
|
// src/hooks/form/use-delete-comment.ts
|
|
5125
|
-
import { useMutation as
|
|
4982
|
+
import { useMutation as useMutation22 } from "@tanstack/react-query";
|
|
5126
4983
|
var useDeleteComment = () => {
|
|
5127
|
-
return
|
|
4984
|
+
return useMutation22({
|
|
5128
4985
|
mutationFn: ({ data }) => form_service_default.deleteComment({
|
|
5129
4986
|
data
|
|
5130
4987
|
})
|
|
@@ -5189,9 +5046,9 @@ var useGetImage = ({
|
|
|
5189
5046
|
var use_get_image_default = useGetImage;
|
|
5190
5047
|
|
|
5191
5048
|
// src/hooks/form/use-send-comment.ts
|
|
5192
|
-
import { useMutation as
|
|
5049
|
+
import { useMutation as useMutation23 } from "@tanstack/react-query";
|
|
5193
5050
|
var useSendComment = () => {
|
|
5194
|
-
return
|
|
5051
|
+
return useMutation23({
|
|
5195
5052
|
mutationFn: ({ data }) => form_service_default.sentComment({
|
|
5196
5053
|
data
|
|
5197
5054
|
})
|
|
@@ -5200,9 +5057,9 @@ var useSendComment = () => {
|
|
|
5200
5057
|
var use_send_comment_default = useSendComment;
|
|
5201
5058
|
|
|
5202
5059
|
// src/hooks/form/use-upload-image.ts
|
|
5203
|
-
import { useMutation as
|
|
5060
|
+
import { useMutation as useMutation24 } from "@tanstack/react-query";
|
|
5204
5061
|
var useUploadImage = () => {
|
|
5205
|
-
return
|
|
5062
|
+
return useMutation24({
|
|
5206
5063
|
mutationFn: ({ data }) => form_service_default.uploadImage({
|
|
5207
5064
|
data
|
|
5208
5065
|
})
|
|
@@ -5211,9 +5068,9 @@ var useUploadImage = () => {
|
|
|
5211
5068
|
var use_upload_image_default = useUploadImage;
|
|
5212
5069
|
|
|
5213
5070
|
// src/hooks/model/use-delete.ts
|
|
5214
|
-
import { useMutation as
|
|
5071
|
+
import { useMutation as useMutation25 } from "@tanstack/react-query";
|
|
5215
5072
|
var useDelete = () => {
|
|
5216
|
-
return
|
|
5073
|
+
return useMutation25({
|
|
5217
5074
|
mutationFn: ({ ids, model }) => model_service_default.delete({ ids, model })
|
|
5218
5075
|
});
|
|
5219
5076
|
};
|
|
@@ -5267,9 +5124,9 @@ var useGetCurrency = () => {
|
|
|
5267
5124
|
var use_get_currency_default = useGetCurrency;
|
|
5268
5125
|
|
|
5269
5126
|
// src/hooks/model/use-get-detail.ts
|
|
5270
|
-
import { useMutation as
|
|
5127
|
+
import { useMutation as useMutation26 } from "@tanstack/react-query";
|
|
5271
5128
|
var useGetDetail = () => {
|
|
5272
|
-
return
|
|
5129
|
+
return useMutation26({
|
|
5273
5130
|
mutationFn: ({
|
|
5274
5131
|
model,
|
|
5275
5132
|
ids,
|
|
@@ -5328,6 +5185,10 @@ var use_get_list_my_bank_account_default = useGetListMyBankAccount;
|
|
|
5328
5185
|
|
|
5329
5186
|
// src/models/base-model/index.ts
|
|
5330
5187
|
var BaseModel = class {
|
|
5188
|
+
name;
|
|
5189
|
+
view;
|
|
5190
|
+
actContext;
|
|
5191
|
+
fields;
|
|
5331
5192
|
constructor(init) {
|
|
5332
5193
|
this.name = init.name;
|
|
5333
5194
|
this.view = init.view;
|
|
@@ -5342,22 +5203,21 @@ var BaseModel = class {
|
|
|
5342
5203
|
modelRoot
|
|
5343
5204
|
}) {
|
|
5344
5205
|
if (Array.isArray(fields)) {
|
|
5345
|
-
let spec =
|
|
5206
|
+
let spec = { ...specification };
|
|
5346
5207
|
fields.forEach((field) => {
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
const
|
|
5352
|
-
const modelRelation = modelsData == null ? void 0 : modelsData[relation];
|
|
5208
|
+
if (!field?.type_co || field?.name && field?.type_co === "field" /* FIELD */) {
|
|
5209
|
+
if (modelsData?.[model]?.[field?.name]) {
|
|
5210
|
+
if (modelsData?.[model]?.[field?.name]?.type === "one2many" /* ONE2MANY */ || modelsData?.[model]?.[field?.name]?.type === "many2many" /* MANY2MANY */) {
|
|
5211
|
+
const relation = modelsData?.[model]?.[field?.name]?.relation;
|
|
5212
|
+
const modelRelation = modelsData?.[relation];
|
|
5353
5213
|
if (modelRelation) {
|
|
5354
|
-
spec[field
|
|
5214
|
+
spec[field?.name] = {
|
|
5355
5215
|
fields: {}
|
|
5356
5216
|
};
|
|
5357
5217
|
if (modelRoot && modelRoot === relation) {
|
|
5358
|
-
spec[field
|
|
5218
|
+
spec[field?.name].fields = { id: {} };
|
|
5359
5219
|
} else {
|
|
5360
|
-
spec[field
|
|
5220
|
+
spec[field?.name].fields = this.getSpecificationByFields({
|
|
5361
5221
|
fields: Object.values(modelRelation),
|
|
5362
5222
|
specification: {},
|
|
5363
5223
|
modelsData,
|
|
@@ -5366,42 +5226,45 @@ var BaseModel = class {
|
|
|
5366
5226
|
});
|
|
5367
5227
|
}
|
|
5368
5228
|
} else {
|
|
5369
|
-
spec[field
|
|
5229
|
+
spec[field?.name] = {
|
|
5370
5230
|
fields: {
|
|
5371
5231
|
id: {},
|
|
5372
5232
|
display_name: {}
|
|
5373
5233
|
}
|
|
5374
5234
|
};
|
|
5375
5235
|
}
|
|
5376
|
-
} else if (
|
|
5377
|
-
spec[field
|
|
5378
|
-
fields:
|
|
5236
|
+
} else if (modelsData?.[model]?.[field?.name]?.type === "many2one" /* MANY2ONE */) {
|
|
5237
|
+
spec[field?.name] = {
|
|
5238
|
+
fields: {
|
|
5379
5239
|
id: {},
|
|
5380
|
-
display_name: {}
|
|
5381
|
-
|
|
5240
|
+
display_name: {},
|
|
5241
|
+
...WIDGETAVATAR[field?.widget] ? { image_256: {} } : {},
|
|
5242
|
+
...field?.name === "currency_id" && fields?.find((item) => item?.widget === "monetary") ? { symbol: {} } : {},
|
|
5243
|
+
...field?.widget === "many2many_binary" ? { mimetype: {} } : {}
|
|
5244
|
+
}
|
|
5382
5245
|
};
|
|
5383
5246
|
} else {
|
|
5384
|
-
spec[field
|
|
5247
|
+
spec[field?.name] = {};
|
|
5385
5248
|
}
|
|
5386
5249
|
}
|
|
5387
|
-
} else if (
|
|
5250
|
+
} else if (field?.type_co === "group" /* GROUP */ || field?.type_co === "div" /* DIV */ || field?.type_co === "span" /* SPAN */) {
|
|
5388
5251
|
const specGroup = this.getSpecificationByFields({
|
|
5389
|
-
fields: field
|
|
5252
|
+
fields: field?.fields,
|
|
5390
5253
|
specification: spec,
|
|
5391
5254
|
modelsData,
|
|
5392
5255
|
model
|
|
5393
5256
|
});
|
|
5394
|
-
spec =
|
|
5395
|
-
} else if (
|
|
5396
|
-
const relation =
|
|
5257
|
+
spec = { ...spec, ...specGroup };
|
|
5258
|
+
} else if (field?.type_co === "tree" /* TREE */ || field?.type_co === "list" /* LIST */) {
|
|
5259
|
+
const relation = modelsData?.[model]?.[field?.name]?.relation;
|
|
5397
5260
|
const specTreee = this.getSpecificationByFields({
|
|
5398
|
-
fields: field
|
|
5261
|
+
fields: field?.fields,
|
|
5399
5262
|
specification: {},
|
|
5400
5263
|
modelsData,
|
|
5401
5264
|
model: relation,
|
|
5402
5265
|
modelRoot: model
|
|
5403
5266
|
});
|
|
5404
|
-
spec =
|
|
5267
|
+
spec = { ...spec, [field?.name]: { fields: specTreee } };
|
|
5405
5268
|
}
|
|
5406
5269
|
});
|
|
5407
5270
|
return spec;
|
|
@@ -5410,19 +5273,16 @@ var BaseModel = class {
|
|
|
5410
5273
|
}
|
|
5411
5274
|
}
|
|
5412
5275
|
getTreeProps() {
|
|
5413
|
-
|
|
5414
|
-
const props = ((_b = (_a = this.view) == null ? void 0 : _a.views) == null ? void 0 : _b.list) || {};
|
|
5276
|
+
const props = this.view?.views?.list || {};
|
|
5415
5277
|
return props;
|
|
5416
5278
|
}
|
|
5417
5279
|
getTreeFields() {
|
|
5418
|
-
|
|
5419
|
-
const fields = ((_c = (_b = (_a = this.view) == null ? void 0 : _a.views) == null ? void 0 : _b.list) == null ? void 0 : _c.fields) || [];
|
|
5280
|
+
const fields = this.view?.views?.list?.fields || [];
|
|
5420
5281
|
return fields;
|
|
5421
5282
|
}
|
|
5422
5283
|
getSpecification() {
|
|
5423
|
-
var _a;
|
|
5424
5284
|
const specInit = {};
|
|
5425
|
-
const modelData =
|
|
5285
|
+
const modelData = this.view?.models || {};
|
|
5426
5286
|
const specification = this.getSpecificationByFields({
|
|
5427
5287
|
fields: this.fields,
|
|
5428
5288
|
specification: specInit,
|
|
@@ -5438,7 +5298,7 @@ var base_model_default = BaseModel;
|
|
|
5438
5298
|
// src/hooks/model/use-model.ts
|
|
5439
5299
|
var useModel = () => {
|
|
5440
5300
|
const initModel = (modelData) => {
|
|
5441
|
-
switch (modelData
|
|
5301
|
+
switch (modelData?.name) {
|
|
5442
5302
|
default:
|
|
5443
5303
|
return new base_model_default(modelData);
|
|
5444
5304
|
}
|
|
@@ -5459,9 +5319,9 @@ var useOdooDataTransform = () => {
|
|
|
5459
5319
|
var use_odoo_data_transform_default = useOdooDataTransform;
|
|
5460
5320
|
|
|
5461
5321
|
// src/hooks/model/use-onchange-form.ts
|
|
5462
|
-
import { useMutation as
|
|
5322
|
+
import { useMutation as useMutation27 } from "@tanstack/react-query";
|
|
5463
5323
|
var useOnChangeForm = () => {
|
|
5464
|
-
return
|
|
5324
|
+
return useMutation27({
|
|
5465
5325
|
mutationFn: ({
|
|
5466
5326
|
ids,
|
|
5467
5327
|
model,
|
|
@@ -5482,9 +5342,9 @@ var useOnChangeForm = () => {
|
|
|
5482
5342
|
var use_onchange_form_default = useOnChangeForm;
|
|
5483
5343
|
|
|
5484
5344
|
// src/hooks/model/use-save.ts
|
|
5485
|
-
import { useMutation as
|
|
5345
|
+
import { useMutation as useMutation28 } from "@tanstack/react-query";
|
|
5486
5346
|
var useSave = () => {
|
|
5487
|
-
return
|
|
5347
|
+
return useMutation28({
|
|
5488
5348
|
mutationFn: ({
|
|
5489
5349
|
ids,
|
|
5490
5350
|
model,
|
|
@@ -5498,18 +5358,18 @@ var useSave = () => {
|
|
|
5498
5358
|
var use_save_default = useSave;
|
|
5499
5359
|
|
|
5500
5360
|
// src/hooks/user/use-get-profile.ts
|
|
5501
|
-
import { useMutation as
|
|
5361
|
+
import { useMutation as useMutation29 } from "@tanstack/react-query";
|
|
5502
5362
|
var useGetProfile = (path) => {
|
|
5503
|
-
return
|
|
5363
|
+
return useMutation29({
|
|
5504
5364
|
mutationFn: () => user_service_default.getProfile(path)
|
|
5505
5365
|
});
|
|
5506
5366
|
};
|
|
5507
5367
|
var use_get_profile_default = useGetProfile;
|
|
5508
5368
|
|
|
5509
5369
|
// src/hooks/user/use-get-user.ts
|
|
5510
|
-
import { useMutation as
|
|
5370
|
+
import { useMutation as useMutation30 } from "@tanstack/react-query";
|
|
5511
5371
|
var useGetUser = () => {
|
|
5512
|
-
return
|
|
5372
|
+
return useMutation30({
|
|
5513
5373
|
mutationFn: ({ id, context }) => user_service_default.getUser({
|
|
5514
5374
|
id,
|
|
5515
5375
|
context
|
|
@@ -5519,9 +5379,9 @@ var useGetUser = () => {
|
|
|
5519
5379
|
var use_get_user_default = useGetUser;
|
|
5520
5380
|
|
|
5521
5381
|
// src/hooks/user/use-switch-locale.ts
|
|
5522
|
-
import { useMutation as
|
|
5382
|
+
import { useMutation as useMutation31 } from "@tanstack/react-query";
|
|
5523
5383
|
var useSwitchLocale = () => {
|
|
5524
|
-
return
|
|
5384
|
+
return useMutation31({
|
|
5525
5385
|
mutationFn: ({ data }) => {
|
|
5526
5386
|
return user_service_default.switchUserLocale({
|
|
5527
5387
|
id: data.id,
|
|
@@ -5533,9 +5393,9 @@ var useSwitchLocale = () => {
|
|
|
5533
5393
|
var use_switch_locale_default = useSwitchLocale;
|
|
5534
5394
|
|
|
5535
5395
|
// src/hooks/view/use-button.ts
|
|
5536
|
-
import { useMutation as
|
|
5396
|
+
import { useMutation as useMutation32 } from "@tanstack/react-query";
|
|
5537
5397
|
var useButton = () => {
|
|
5538
|
-
return
|
|
5398
|
+
return useMutation32({
|
|
5539
5399
|
mutationFn: ({
|
|
5540
5400
|
model,
|
|
5541
5401
|
ids,
|
|
@@ -5555,9 +5415,9 @@ var useButton = () => {
|
|
|
5555
5415
|
var use_button_default = useButton;
|
|
5556
5416
|
|
|
5557
5417
|
// src/hooks/view/use-duplicate-record.ts
|
|
5558
|
-
import { useMutation as
|
|
5418
|
+
import { useMutation as useMutation33 } from "@tanstack/react-query";
|
|
5559
5419
|
var useDuplicateRecord = () => {
|
|
5560
|
-
return
|
|
5420
|
+
return useMutation33({
|
|
5561
5421
|
mutationFn: ({
|
|
5562
5422
|
id,
|
|
5563
5423
|
model,
|
|
@@ -5583,22 +5443,22 @@ var useGetActionDetail = ({
|
|
|
5583
5443
|
}) => {
|
|
5584
5444
|
const data = {
|
|
5585
5445
|
id,
|
|
5586
|
-
model: model
|
|
5446
|
+
model: model ?? "",
|
|
5587
5447
|
context
|
|
5588
5448
|
};
|
|
5589
5449
|
return useQuery11({
|
|
5590
5450
|
queryKey,
|
|
5591
|
-
queryFn: () =>
|
|
5451
|
+
queryFn: async () => {
|
|
5592
5452
|
if (aid) {
|
|
5593
|
-
const res =
|
|
5453
|
+
const res = await view_service_default.getActionDetail(aid, context);
|
|
5594
5454
|
if (res && res.length > 0) {
|
|
5595
5455
|
return res[0];
|
|
5596
5456
|
}
|
|
5597
5457
|
} else {
|
|
5598
|
-
const res =
|
|
5458
|
+
const res = await form_service_default.getFormView({ data });
|
|
5599
5459
|
return res;
|
|
5600
5460
|
}
|
|
5601
|
-
}
|
|
5461
|
+
},
|
|
5602
5462
|
enabled,
|
|
5603
5463
|
refetchOnWindowFocus: false,
|
|
5604
5464
|
staleTime: Infinity
|
|
@@ -5670,9 +5530,8 @@ var useGetMenu = (context, enabled) => {
|
|
|
5670
5530
|
return useQuery15({
|
|
5671
5531
|
queryKey: ["menus" /* MENU */, context],
|
|
5672
5532
|
queryFn: () => view_service_default.getMenu(context).then((res) => {
|
|
5673
|
-
|
|
5674
|
-
|
|
5675
|
-
return res == null ? void 0 : res.records;
|
|
5533
|
+
if (res && res?.records && res?.records?.length > 0) {
|
|
5534
|
+
return res?.records;
|
|
5676
5535
|
}
|
|
5677
5536
|
return [];
|
|
5678
5537
|
}),
|
|
@@ -5684,9 +5543,9 @@ var useGetMenu = (context, enabled) => {
|
|
|
5684
5543
|
var use_get_menu_default = useGetMenu;
|
|
5685
5544
|
|
|
5686
5545
|
// src/hooks/view/use-get-print-report.ts
|
|
5687
|
-
import { useMutation as
|
|
5546
|
+
import { useMutation as useMutation34 } from "@tanstack/react-query";
|
|
5688
5547
|
var useGetPrintReport = () => {
|
|
5689
|
-
return
|
|
5548
|
+
return useMutation34({
|
|
5690
5549
|
mutationFn: ({ id }) => action_service_default.getPrintReportName({
|
|
5691
5550
|
id
|
|
5692
5551
|
})
|
|
@@ -5750,9 +5609,9 @@ var useGetView = (viewParams, actData) => {
|
|
|
5750
5609
|
var use_get_view_default = useGetView;
|
|
5751
5610
|
|
|
5752
5611
|
// src/hooks/view/use-load-action.ts
|
|
5753
|
-
import { useMutation as
|
|
5612
|
+
import { useMutation as useMutation35 } from "@tanstack/react-query";
|
|
5754
5613
|
var useLoadAction = () => {
|
|
5755
|
-
return
|
|
5614
|
+
return useMutation35({
|
|
5756
5615
|
mutationFn: ({
|
|
5757
5616
|
idAction,
|
|
5758
5617
|
context
|
|
@@ -5778,9 +5637,9 @@ var useLoadMessage = () => {
|
|
|
5778
5637
|
var use_load_message_default = useLoadMessage;
|
|
5779
5638
|
|
|
5780
5639
|
// src/hooks/view/use-print.ts
|
|
5781
|
-
import { useMutation as
|
|
5640
|
+
import { useMutation as useMutation36 } from "@tanstack/react-query";
|
|
5782
5641
|
var usePrint = () => {
|
|
5783
|
-
return
|
|
5642
|
+
return useMutation36({
|
|
5784
5643
|
mutationFn: ({ id, report, db }) => action_service_default.print({
|
|
5785
5644
|
id,
|
|
5786
5645
|
report,
|
|
@@ -5791,9 +5650,9 @@ var usePrint = () => {
|
|
|
5791
5650
|
var use_print_default = usePrint;
|
|
5792
5651
|
|
|
5793
5652
|
// src/hooks/view/use-remove-row.ts
|
|
5794
|
-
import { useMutation as
|
|
5653
|
+
import { useMutation as useMutation37 } from "@tanstack/react-query";
|
|
5795
5654
|
var useRemoveRow = () => {
|
|
5796
|
-
return
|
|
5655
|
+
return useMutation37({
|
|
5797
5656
|
mutationFn: ({
|
|
5798
5657
|
model,
|
|
5799
5658
|
ids,
|
|
@@ -5825,9 +5684,9 @@ var useGetResequence = (model, resIds, context, offset) => {
|
|
|
5825
5684
|
var use_resequence_default = useGetResequence;
|
|
5826
5685
|
|
|
5827
5686
|
// src/hooks/view/use-run-action.ts
|
|
5828
|
-
import { useMutation as
|
|
5687
|
+
import { useMutation as useMutation38 } from "@tanstack/react-query";
|
|
5829
5688
|
var useRunAction = () => {
|
|
5830
|
-
return
|
|
5689
|
+
return useMutation38({
|
|
5831
5690
|
mutationFn: ({
|
|
5832
5691
|
idAction,
|
|
5833
5692
|
context
|
|
@@ -5840,9 +5699,9 @@ var useRunAction = () => {
|
|
|
5840
5699
|
var use_run_action_default = useRunAction;
|
|
5841
5700
|
|
|
5842
5701
|
// src/hooks/view/use-signin-sso.ts
|
|
5843
|
-
import { useMutation as
|
|
5702
|
+
import { useMutation as useMutation39 } from "@tanstack/react-query";
|
|
5844
5703
|
var useSignInSSO = () => {
|
|
5845
|
-
return
|
|
5704
|
+
return useMutation39({
|
|
5846
5705
|
mutationFn: ({
|
|
5847
5706
|
redirect_uri,
|
|
5848
5707
|
state,
|
|
@@ -5863,9 +5722,9 @@ var useSignInSSO = () => {
|
|
|
5863
5722
|
var use_signin_sso_default = useSignInSSO;
|
|
5864
5723
|
|
|
5865
5724
|
// src/hooks/view/use-verify-2FA.ts
|
|
5866
|
-
import { useMutation as
|
|
5725
|
+
import { useMutation as useMutation40 } from "@tanstack/react-query";
|
|
5867
5726
|
var useVerify2FA = () => {
|
|
5868
|
-
return
|
|
5727
|
+
return useMutation40({
|
|
5869
5728
|
mutationFn: ({
|
|
5870
5729
|
method,
|
|
5871
5730
|
with_context,
|
|
@@ -5886,9 +5745,9 @@ var useVerify2FA = () => {
|
|
|
5886
5745
|
var use_verify_2FA_default = useVerify2FA;
|
|
5887
5746
|
|
|
5888
5747
|
// src/hooks/view/uset-get-2FA-method.ts
|
|
5889
|
-
import { useMutation as
|
|
5748
|
+
import { useMutation as useMutation41 } from "@tanstack/react-query";
|
|
5890
5749
|
var useGet2FAMethods = () => {
|
|
5891
|
-
return
|
|
5750
|
+
return useMutation41({
|
|
5892
5751
|
mutationFn: ({
|
|
5893
5752
|
method,
|
|
5894
5753
|
with_context
|
|
@@ -5903,9 +5762,9 @@ var useGet2FAMethods = () => {
|
|
|
5903
5762
|
var uset_get_2FA_method_default = useGet2FAMethods;
|
|
5904
5763
|
|
|
5905
5764
|
// src/hooks/view/use-get-fields-view-security.ts
|
|
5906
|
-
import { useMutation as
|
|
5765
|
+
import { useMutation as useMutation42 } from "@tanstack/react-query";
|
|
5907
5766
|
var useGetFieldsViewSecurity = () => {
|
|
5908
|
-
return
|
|
5767
|
+
return useMutation42({
|
|
5909
5768
|
mutationFn: ({
|
|
5910
5769
|
method,
|
|
5911
5770
|
token,
|
|
@@ -5922,9 +5781,9 @@ var useGetFieldsViewSecurity = () => {
|
|
|
5922
5781
|
var use_get_fields_view_security_default = useGetFieldsViewSecurity;
|
|
5923
5782
|
|
|
5924
5783
|
// src/hooks/view/use-grant-access.ts
|
|
5925
|
-
import { useMutation as
|
|
5784
|
+
import { useMutation as useMutation43 } from "@tanstack/react-query";
|
|
5926
5785
|
var useGrantAccess = () => {
|
|
5927
|
-
return
|
|
5786
|
+
return useMutation43({
|
|
5928
5787
|
mutationFn: ({
|
|
5929
5788
|
redirect_uri,
|
|
5930
5789
|
state,
|
|
@@ -5943,9 +5802,9 @@ var useGrantAccess = () => {
|
|
|
5943
5802
|
var use_grant_access_default = useGrantAccess;
|
|
5944
5803
|
|
|
5945
5804
|
// src/hooks/view/use-remove-totp-setup.ts
|
|
5946
|
-
import { useMutation as
|
|
5805
|
+
import { useMutation as useMutation44 } from "@tanstack/react-query";
|
|
5947
5806
|
var useRemoveTotpSetup = () => {
|
|
5948
|
-
return
|
|
5807
|
+
return useMutation44({
|
|
5949
5808
|
mutationFn: ({ method, token }) => {
|
|
5950
5809
|
return view_service_default.removeTotpSetUp({
|
|
5951
5810
|
method,
|
|
@@ -5957,9 +5816,9 @@ var useRemoveTotpSetup = () => {
|
|
|
5957
5816
|
var use_remove_totp_setup_default = useRemoveTotpSetup;
|
|
5958
5817
|
|
|
5959
5818
|
// src/hooks/view/use-request-setup-totp.ts
|
|
5960
|
-
import { useMutation as
|
|
5819
|
+
import { useMutation as useMutation45 } from "@tanstack/react-query";
|
|
5961
5820
|
var useRequestSetupTotp = () => {
|
|
5962
|
-
return
|
|
5821
|
+
return useMutation45({
|
|
5963
5822
|
mutationFn: ({ method, token }) => {
|
|
5964
5823
|
return view_service_default.requestSetupTotp({
|
|
5965
5824
|
method,
|
|
@@ -5971,9 +5830,9 @@ var useRequestSetupTotp = () => {
|
|
|
5971
5830
|
var use_request_setup_totp_default = useRequestSetupTotp;
|
|
5972
5831
|
|
|
5973
5832
|
// src/hooks/view/use-settings-web-read-2fa.ts
|
|
5974
|
-
import { useMutation as
|
|
5833
|
+
import { useMutation as useMutation46 } from "@tanstack/react-query";
|
|
5975
5834
|
var useSettingsWebRead2fa = () => {
|
|
5976
|
-
return
|
|
5835
|
+
return useMutation46({
|
|
5977
5836
|
mutationFn: ({
|
|
5978
5837
|
method,
|
|
5979
5838
|
token,
|
|
@@ -5992,9 +5851,9 @@ var useSettingsWebRead2fa = () => {
|
|
|
5992
5851
|
var use_settings_web_read_2fa_default = useSettingsWebRead2fa;
|
|
5993
5852
|
|
|
5994
5853
|
// src/hooks/view/use-verify-totp.ts
|
|
5995
|
-
import { useMutation as
|
|
5854
|
+
import { useMutation as useMutation47 } from "@tanstack/react-query";
|
|
5996
5855
|
var useVerifyTotp = () => {
|
|
5997
|
-
return
|
|
5856
|
+
return useMutation47({
|
|
5998
5857
|
mutationFn: ({
|
|
5999
5858
|
method,
|
|
6000
5859
|
action_token,
|
|
@@ -6076,6 +5935,7 @@ export {
|
|
|
6076
5935
|
use_upload_file_default as useUploadFile,
|
|
6077
5936
|
use_upload_id_file_default as useUploadIdFile,
|
|
6078
5937
|
use_upload_image_default as useUploadImage,
|
|
5938
|
+
use_validate_action_token_default as useValidateActionToken,
|
|
6079
5939
|
use_verify_2FA_default as useVerify2FA,
|
|
6080
5940
|
use_verify_totp_default as useVerifyTotp
|
|
6081
5941
|
};
|