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