@fctc/interface-logic 1.7.2 → 1.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{configs.d.cts → configs.d.mts} +1 -1
- package/dist/configs.js +140 -115
- package/dist/{configs.cjs → configs.mjs} +105 -152
- package/dist/constants.js +41 -2
- package/dist/{constants.cjs → constants.mjs} +2 -40
- package/dist/environment.js +190 -170
- package/dist/{environment.cjs → environment.mjs} +156 -210
- package/dist/{hooks.d.cts → hooks.d.mts} +1 -1
- package/dist/hooks.js +1730 -1792
- package/dist/{hooks.cjs → hooks.mjs} +1631 -1897
- package/dist/{provider.d.cts → provider.d.mts} +1 -1
- package/dist/provider.d.ts +1 -1
- package/dist/provider.js +594 -610
- package/dist/{provider.cjs → provider.mjs} +560 -650
- package/dist/{services.d.cts → services.d.mts} +1 -1
- package/dist/services.js +1439 -1562
- package/dist/{services.cjs → services.mjs} +1399 -1608
- package/dist/{store.d.cts → store.d.mts} +127 -127
- package/dist/store.d.ts +127 -127
- package/dist/store.js +129 -41
- package/dist/{store.cjs → store.mjs} +28 -146
- package/dist/{types.d.cts → types.d.mts} +1 -1
- package/dist/types.js +18 -0
- package/dist/types.mjs +0 -0
- package/dist/{utils.d.cts → utils.d.mts} +2 -2
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +176 -135
- package/dist/{utils.cjs → utils.mjs} +115 -202
- package/package.json +1 -2
- package/dist/types.cjs +0 -17
- /package/dist/{constants.d.cts → constants.d.mts} +0 -0
- /package/dist/{environment.d.cts → environment.d.mts} +0 -0
- /package/dist/{view-type-BGJfDe73.d.cts → view-type-BGJfDe73.d.mts} +0 -0
|
@@ -1,84 +1,3 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __pow = Math.pow;
|
|
12
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
-
var __spreadValues = (a, b) => {
|
|
14
|
-
for (var prop in b || (b = {}))
|
|
15
|
-
if (__hasOwnProp.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
if (__getOwnPropSymbols)
|
|
18
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
-
if (__propIsEnum.call(b, prop))
|
|
20
|
-
__defNormalProp(a, prop, b[prop]);
|
|
21
|
-
}
|
|
22
|
-
return a;
|
|
23
|
-
};
|
|
24
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
-
var __export = (target, all) => {
|
|
26
|
-
for (var name in all)
|
|
27
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
28
|
-
};
|
|
29
|
-
var __copyProps = (to, from, except, desc) => {
|
|
30
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
31
|
-
for (let key of __getOwnPropNames(from))
|
|
32
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
33
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
34
|
-
}
|
|
35
|
-
return to;
|
|
36
|
-
};
|
|
37
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
38
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
39
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
40
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
41
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
42
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
43
|
-
mod
|
|
44
|
-
));
|
|
45
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
46
|
-
var __async = (__this, __arguments, generator) => {
|
|
47
|
-
return new Promise((resolve, reject) => {
|
|
48
|
-
var fulfilled = (value) => {
|
|
49
|
-
try {
|
|
50
|
-
step(generator.next(value));
|
|
51
|
-
} catch (e) {
|
|
52
|
-
reject(e);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
var rejected = (value) => {
|
|
56
|
-
try {
|
|
57
|
-
step(generator.throw(value));
|
|
58
|
-
} catch (e) {
|
|
59
|
-
reject(e);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
63
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
// src/services.ts
|
|
68
|
-
var services_exports = {};
|
|
69
|
-
__export(services_exports, {
|
|
70
|
-
ActionService: () => action_service_default,
|
|
71
|
-
AuthService: () => auth_service_default,
|
|
72
|
-
CompanyService: () => company_service_default,
|
|
73
|
-
ExcelService: () => excel_service_default,
|
|
74
|
-
FormService: () => form_service_default,
|
|
75
|
-
KanbanService: () => kanban_service_default,
|
|
76
|
-
ModelService: () => model_service_default,
|
|
77
|
-
UserService: () => user_service_default,
|
|
78
|
-
ViewService: () => view_service_default
|
|
79
|
-
});
|
|
80
|
-
module.exports = __toCommonJS(services_exports);
|
|
81
|
-
|
|
82
1
|
// src/constants/api/uri-constant.ts
|
|
83
2
|
var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
84
3
|
UriConstants2["AUTH_TOKEN_PATH"] = "/authentication/oauth2/token";
|
|
@@ -110,10 +29,10 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
|
110
29
|
})(UriConstants || {});
|
|
111
30
|
|
|
112
31
|
// src/configs/axios-client.ts
|
|
113
|
-
|
|
32
|
+
import axios from "axios";
|
|
114
33
|
|
|
115
34
|
// src/utils/format.ts
|
|
116
|
-
|
|
35
|
+
import moment from "moment";
|
|
117
36
|
|
|
118
37
|
// src/utils/domain/py_tokenizer.ts
|
|
119
38
|
var TokenizerError = class extends Error {
|
|
@@ -1193,6 +1112,22 @@ var PyRelativeDelta = class _PyRelativeDelta {
|
|
|
1193
1112
|
this.microsecond = params.microsecond;
|
|
1194
1113
|
this.weekday = params.weekday;
|
|
1195
1114
|
}
|
|
1115
|
+
years;
|
|
1116
|
+
months;
|
|
1117
|
+
days;
|
|
1118
|
+
hours;
|
|
1119
|
+
minutes;
|
|
1120
|
+
seconds;
|
|
1121
|
+
microseconds;
|
|
1122
|
+
leapDays;
|
|
1123
|
+
year;
|
|
1124
|
+
month;
|
|
1125
|
+
day;
|
|
1126
|
+
hour;
|
|
1127
|
+
minute;
|
|
1128
|
+
second;
|
|
1129
|
+
microsecond;
|
|
1130
|
+
weekday;
|
|
1196
1131
|
negate() {
|
|
1197
1132
|
return new _PyRelativeDelta(this, -1);
|
|
1198
1133
|
}
|
|
@@ -1307,7 +1242,7 @@ function execOnIterable(iterable, func) {
|
|
|
1307
1242
|
if (typeof iterable === "object" && !Array.isArray(iterable) && !(iterable instanceof Set)) {
|
|
1308
1243
|
iterable = Object.keys(iterable);
|
|
1309
1244
|
}
|
|
1310
|
-
if (typeof
|
|
1245
|
+
if (typeof iterable?.[Symbol.iterator] !== "function") {
|
|
1311
1246
|
throw new EvaluationError("value not iterable");
|
|
1312
1247
|
}
|
|
1313
1248
|
return func(iterable);
|
|
@@ -1630,7 +1565,7 @@ function applyBinaryOp(ast, context) {
|
|
|
1630
1565
|
}
|
|
1631
1566
|
return Math.floor(left / right);
|
|
1632
1567
|
case "**":
|
|
1633
|
-
return
|
|
1568
|
+
return left ** right;
|
|
1634
1569
|
case "==":
|
|
1635
1570
|
return isEqual(left, right);
|
|
1636
1571
|
case "<>":
|
|
@@ -1752,7 +1687,7 @@ function evaluate(ast, context = {}) {
|
|
|
1752
1687
|
const dicts = /* @__PURE__ */ new Set();
|
|
1753
1688
|
let pyContext;
|
|
1754
1689
|
const evalContext = Object.create(context);
|
|
1755
|
-
if (!
|
|
1690
|
+
if (!evalContext?.context) {
|
|
1756
1691
|
Object.defineProperty(evalContext, "context", {
|
|
1757
1692
|
get() {
|
|
1758
1693
|
if (!pyContext) {
|
|
@@ -1763,18 +1698,17 @@ function evaluate(ast, context = {}) {
|
|
|
1763
1698
|
});
|
|
1764
1699
|
}
|
|
1765
1700
|
function _innerEvaluate(ast2) {
|
|
1766
|
-
|
|
1767
|
-
switch (ast2 == null ? void 0 : ast2.type) {
|
|
1701
|
+
switch (ast2?.type) {
|
|
1768
1702
|
case 0:
|
|
1769
1703
|
// Number
|
|
1770
1704
|
case 1:
|
|
1771
1705
|
return ast2.value;
|
|
1772
1706
|
case 5:
|
|
1773
1707
|
if (ast2.value in evalContext) {
|
|
1774
|
-
if (typeof evalContext[ast2.value] === "object" &&
|
|
1775
|
-
return
|
|
1708
|
+
if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
|
|
1709
|
+
return evalContext[ast2.value]?.id;
|
|
1776
1710
|
}
|
|
1777
|
-
return
|
|
1711
|
+
return evalContext[ast2.value] ?? false;
|
|
1778
1712
|
} else if (ast2.value in BUILTINS) {
|
|
1779
1713
|
return BUILTINS[ast2.value];
|
|
1780
1714
|
} else {
|
|
@@ -1811,7 +1745,7 @@ function evaluate(ast, context = {}) {
|
|
|
1811
1745
|
const args = ast2.args.map(_evaluate);
|
|
1812
1746
|
const kwargs = {};
|
|
1813
1747
|
for (const kwarg in ast2.kwargs) {
|
|
1814
|
-
kwargs[kwarg] = _evaluate(ast2
|
|
1748
|
+
kwargs[kwarg] = _evaluate(ast2?.kwargs[kwarg]);
|
|
1815
1749
|
}
|
|
1816
1750
|
if (fnValue === PyDate || fnValue === PyDateTime || fnValue === PyTime || fnValue === PyRelativeDelta || fnValue === PyTimeDelta) {
|
|
1817
1751
|
return fnValue.create(...args, kwargs);
|
|
@@ -1890,25 +1824,9 @@ function escapeRegExp(str) {
|
|
|
1890
1824
|
var InvalidDomainError = class extends Error {
|
|
1891
1825
|
};
|
|
1892
1826
|
var Domain = class _Domain {
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
return new _Domain(descr.toString());
|
|
1897
|
-
} else {
|
|
1898
|
-
let rawAST;
|
|
1899
|
-
try {
|
|
1900
|
-
rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
|
|
1901
|
-
} catch (error) {
|
|
1902
|
-
throw new InvalidDomainError(
|
|
1903
|
-
`Invalid domain representation: ${descr}`,
|
|
1904
|
-
{
|
|
1905
|
-
cause: error
|
|
1906
|
-
}
|
|
1907
|
-
);
|
|
1908
|
-
}
|
|
1909
|
-
this.ast = normalizeDomainAST(rawAST);
|
|
1910
|
-
}
|
|
1911
|
-
}
|
|
1827
|
+
ast = { type: -1, value: null };
|
|
1828
|
+
static TRUE;
|
|
1829
|
+
static FALSE;
|
|
1912
1830
|
static combine(domains, operator) {
|
|
1913
1831
|
if (domains.length === 0) {
|
|
1914
1832
|
return new _Domain([]);
|
|
@@ -1987,6 +1905,24 @@ var Domain = class _Domain {
|
|
|
1987
1905
|
processLeaf(d.ast.value, 0, "&", newDomain);
|
|
1988
1906
|
return newDomain;
|
|
1989
1907
|
}
|
|
1908
|
+
constructor(descr = []) {
|
|
1909
|
+
if (descr instanceof _Domain) {
|
|
1910
|
+
return new _Domain(descr.toString());
|
|
1911
|
+
} else {
|
|
1912
|
+
let rawAST;
|
|
1913
|
+
try {
|
|
1914
|
+
rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
|
|
1915
|
+
} catch (error) {
|
|
1916
|
+
throw new InvalidDomainError(
|
|
1917
|
+
`Invalid domain representation: ${descr}`,
|
|
1918
|
+
{
|
|
1919
|
+
cause: error
|
|
1920
|
+
}
|
|
1921
|
+
);
|
|
1922
|
+
}
|
|
1923
|
+
this.ast = normalizeDomainAST(rawAST);
|
|
1924
|
+
}
|
|
1925
|
+
}
|
|
1990
1926
|
contains(record) {
|
|
1991
1927
|
const expr = evaluate(this.ast, record);
|
|
1992
1928
|
return matchDomain(record, expr);
|
|
@@ -2005,7 +1941,7 @@ var Domain = class _Domain {
|
|
|
2005
1941
|
return evaluatedAsList;
|
|
2006
1942
|
}
|
|
2007
1943
|
return this.toString();
|
|
2008
|
-
} catch
|
|
1944
|
+
} catch {
|
|
2009
1945
|
return this.toString();
|
|
2010
1946
|
}
|
|
2011
1947
|
}
|
|
@@ -2205,7 +2141,7 @@ function matchDomain(record, domain) {
|
|
|
2205
2141
|
}
|
|
2206
2142
|
|
|
2207
2143
|
// src/utils/function.ts
|
|
2208
|
-
|
|
2144
|
+
import { useEffect, useState } from "react";
|
|
2209
2145
|
var toQueryString = (params) => {
|
|
2210
2146
|
return Object.keys(params).map(
|
|
2211
2147
|
(key) => encodeURIComponent(key) + "=" + encodeURIComponent(params[key].toString())
|
|
@@ -2233,22 +2169,22 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
|
|
|
2233
2169
|
|
|
2234
2170
|
// src/utils/storage/local-storage.ts
|
|
2235
2171
|
var localStorageUtils = () => {
|
|
2236
|
-
const setToken = (access_token) =>
|
|
2172
|
+
const setToken = async (access_token) => {
|
|
2237
2173
|
localStorage.setItem("accessToken", access_token);
|
|
2238
|
-
}
|
|
2239
|
-
const setRefreshToken = (refresh_token) =>
|
|
2174
|
+
};
|
|
2175
|
+
const setRefreshToken = async (refresh_token) => {
|
|
2240
2176
|
localStorage.setItem("refreshToken", refresh_token);
|
|
2241
|
-
}
|
|
2242
|
-
const getAccessToken = () =>
|
|
2177
|
+
};
|
|
2178
|
+
const getAccessToken = async () => {
|
|
2243
2179
|
return localStorage.getItem("accessToken");
|
|
2244
|
-
}
|
|
2245
|
-
const getRefreshToken = () =>
|
|
2180
|
+
};
|
|
2181
|
+
const getRefreshToken = async () => {
|
|
2246
2182
|
return localStorage.getItem("refreshToken");
|
|
2247
|
-
}
|
|
2248
|
-
const clearToken = () =>
|
|
2183
|
+
};
|
|
2184
|
+
const clearToken = async () => {
|
|
2249
2185
|
localStorage.removeItem("accessToken");
|
|
2250
2186
|
localStorage.removeItem("refreshToken");
|
|
2251
|
-
}
|
|
2187
|
+
};
|
|
2252
2188
|
return {
|
|
2253
2189
|
setToken,
|
|
2254
2190
|
setRefreshToken,
|
|
@@ -2260,9 +2196,9 @@ var localStorageUtils = () => {
|
|
|
2260
2196
|
|
|
2261
2197
|
// src/utils/storage/session-storage.ts
|
|
2262
2198
|
var sessionStorageUtils = () => {
|
|
2263
|
-
const getBrowserSession = () =>
|
|
2199
|
+
const getBrowserSession = async () => {
|
|
2264
2200
|
return sessionStorage.getItem("browserSession");
|
|
2265
|
-
}
|
|
2201
|
+
};
|
|
2266
2202
|
return {
|
|
2267
2203
|
getBrowserSession
|
|
2268
2204
|
};
|
|
@@ -2271,14 +2207,13 @@ var sessionStorageUtils = () => {
|
|
|
2271
2207
|
// src/configs/axios-client.ts
|
|
2272
2208
|
var axiosClient = {
|
|
2273
2209
|
init(config) {
|
|
2274
|
-
|
|
2275
|
-
const
|
|
2276
|
-
const sessionStorage2 = (_b = config.sessionStorageUtils) != null ? _b : sessionStorageUtils();
|
|
2210
|
+
const localStorage2 = config.localStorageUtils ?? localStorageUtils();
|
|
2211
|
+
const sessionStorage2 = config.sessionStorageUtils ?? sessionStorageUtils();
|
|
2277
2212
|
const db = config.db;
|
|
2278
2213
|
let isRefreshing = false;
|
|
2279
2214
|
let failedQueue = [];
|
|
2280
2215
|
const processQueue = (error, token = null) => {
|
|
2281
|
-
failedQueue
|
|
2216
|
+
failedQueue?.forEach((prom) => {
|
|
2282
2217
|
if (error) {
|
|
2283
2218
|
prom.reject(error);
|
|
2284
2219
|
} else {
|
|
@@ -2287,21 +2222,21 @@ var axiosClient = {
|
|
|
2287
2222
|
});
|
|
2288
2223
|
failedQueue = [];
|
|
2289
2224
|
};
|
|
2290
|
-
const instance =
|
|
2291
|
-
adapter:
|
|
2225
|
+
const instance = axios.create({
|
|
2226
|
+
adapter: axios.defaults.adapter,
|
|
2292
2227
|
baseURL: config.baseUrl,
|
|
2293
2228
|
timeout: 5e4,
|
|
2294
2229
|
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
2295
2230
|
});
|
|
2296
2231
|
instance.interceptors.request.use(
|
|
2297
|
-
(config2) =>
|
|
2232
|
+
async (config2) => {
|
|
2298
2233
|
const useRefreshToken = config2.useRefreshToken;
|
|
2299
|
-
const token = useRefreshToken ?
|
|
2234
|
+
const token = useRefreshToken ? await localStorage2.getRefreshToken() : await localStorage2.getAccessToken();
|
|
2300
2235
|
if (token) {
|
|
2301
2236
|
config2.headers["Authorization"] = "Bearer " + token;
|
|
2302
2237
|
}
|
|
2303
2238
|
return config2;
|
|
2304
|
-
}
|
|
2239
|
+
},
|
|
2305
2240
|
(error) => {
|
|
2306
2241
|
Promise.reject(error);
|
|
2307
2242
|
}
|
|
@@ -2310,21 +2245,19 @@ var axiosClient = {
|
|
|
2310
2245
|
(response) => {
|
|
2311
2246
|
return handleResponse(response);
|
|
2312
2247
|
},
|
|
2313
|
-
(error) =>
|
|
2314
|
-
|
|
2315
|
-
const handleError3 = (error2) => __async(null, null, function* () {
|
|
2316
|
-
var _a3;
|
|
2248
|
+
async (error) => {
|
|
2249
|
+
const handleError3 = async (error2) => {
|
|
2317
2250
|
if (!error2.response) {
|
|
2318
2251
|
return error2;
|
|
2319
2252
|
}
|
|
2320
2253
|
const { data } = error2.response;
|
|
2321
|
-
if (data && data.code === 400 && ["invalid_grant"].includes(
|
|
2322
|
-
|
|
2254
|
+
if (data && data.code === 400 && ["invalid_grant"].includes(data.data?.error)) {
|
|
2255
|
+
await clearAuthToken();
|
|
2323
2256
|
}
|
|
2324
2257
|
return data;
|
|
2325
|
-
}
|
|
2258
|
+
};
|
|
2326
2259
|
const originalRequest = error.config;
|
|
2327
|
-
if ((
|
|
2260
|
+
if ((error.response?.status === 403 || error.response?.status === 401 || error.response?.status === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
|
|
2328
2261
|
error.response.data.code
|
|
2329
2262
|
)) {
|
|
2330
2263
|
if (isRefreshing) {
|
|
@@ -2337,19 +2270,18 @@ var axiosClient = {
|
|
|
2337
2270
|
token
|
|
2338
2271
|
);
|
|
2339
2272
|
return instance.request(originalRequest);
|
|
2340
|
-
}).catch((err) =>
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
yield clearAuthToken();
|
|
2273
|
+
}).catch(async (err) => {
|
|
2274
|
+
if ((err.response?.status === 400 || err.response?.status === 401) && ["invalid_grant"].includes(err.response.data.error)) {
|
|
2275
|
+
await clearAuthToken();
|
|
2344
2276
|
}
|
|
2345
|
-
})
|
|
2277
|
+
});
|
|
2346
2278
|
}
|
|
2347
|
-
const browserSession =
|
|
2348
|
-
const refreshToken =
|
|
2349
|
-
const accessTokenExp =
|
|
2279
|
+
const browserSession = await sessionStorage2.getBrowserSession();
|
|
2280
|
+
const refreshToken = await localStorage2.getRefreshToken();
|
|
2281
|
+
const accessTokenExp = await localStorage2.getAccessToken();
|
|
2350
2282
|
isRefreshing = true;
|
|
2351
2283
|
if (!refreshToken && (!browserSession || browserSession == "unActive")) {
|
|
2352
|
-
|
|
2284
|
+
await clearAuthToken();
|
|
2353
2285
|
} else {
|
|
2354
2286
|
const payload = Object.fromEntries(
|
|
2355
2287
|
Object.entries({
|
|
@@ -2360,9 +2292,8 @@ var axiosClient = {
|
|
|
2360
2292
|
}).filter(([_, value]) => !!value)
|
|
2361
2293
|
);
|
|
2362
2294
|
return new Promise(function(resolve) {
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
`${config.baseUrl}${(_a3 = config.refreshTokenEndpoint) != null ? _a3 : "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
|
|
2295
|
+
axios.post(
|
|
2296
|
+
`${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
|
|
2366
2297
|
payload,
|
|
2367
2298
|
{
|
|
2368
2299
|
headers: {
|
|
@@ -2370,11 +2301,11 @@ var axiosClient = {
|
|
|
2370
2301
|
Authorization: `Bearer ${accessTokenExp}`
|
|
2371
2302
|
}
|
|
2372
2303
|
}
|
|
2373
|
-
).then((res) =>
|
|
2304
|
+
).then(async (res) => {
|
|
2374
2305
|
const data = res.data;
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2306
|
+
await localStorage2.setToken(data.access_token);
|
|
2307
|
+
await localStorage2.setRefreshToken(data.refresh_token);
|
|
2308
|
+
axios.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
|
|
2378
2309
|
originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
|
|
2379
2310
|
originalRequest.data = updateTokenParamInOriginalRequest(
|
|
2380
2311
|
originalRequest,
|
|
@@ -2382,26 +2313,25 @@ var axiosClient = {
|
|
|
2382
2313
|
);
|
|
2383
2314
|
processQueue(null, data.access_token);
|
|
2384
2315
|
resolve(instance.request(originalRequest));
|
|
2385
|
-
})
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
yield clearAuthToken();
|
|
2316
|
+
}).catch(async (err) => {
|
|
2317
|
+
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") {
|
|
2318
|
+
await clearAuthToken();
|
|
2389
2319
|
}
|
|
2390
2320
|
if (err && err.response) {
|
|
2391
|
-
const { error_code } =
|
|
2321
|
+
const { error_code } = err.response?.data || {};
|
|
2392
2322
|
if (error_code === "AUTHEN_FAIL") {
|
|
2393
|
-
|
|
2323
|
+
await clearAuthToken();
|
|
2394
2324
|
}
|
|
2395
2325
|
}
|
|
2396
2326
|
processQueue(err, null);
|
|
2397
|
-
})
|
|
2327
|
+
}).finally(() => {
|
|
2398
2328
|
isRefreshing = false;
|
|
2399
2329
|
});
|
|
2400
2330
|
});
|
|
2401
2331
|
}
|
|
2402
2332
|
}
|
|
2403
|
-
return Promise.reject(
|
|
2404
|
-
}
|
|
2333
|
+
return Promise.reject(await handleError3(error));
|
|
2334
|
+
}
|
|
2405
2335
|
);
|
|
2406
2336
|
const handleResponse = (res) => {
|
|
2407
2337
|
if (res && res.data) {
|
|
@@ -2410,7 +2340,6 @@ var axiosClient = {
|
|
|
2410
2340
|
return res;
|
|
2411
2341
|
};
|
|
2412
2342
|
const handleError2 = (error) => {
|
|
2413
|
-
var _a2, _b2, _c;
|
|
2414
2343
|
if (error.isAxiosError && error.code === "ECONNABORTED") {
|
|
2415
2344
|
console.error("Request Timeout Error:", error);
|
|
2416
2345
|
return "Request Timeout Error";
|
|
@@ -2418,17 +2347,17 @@ var axiosClient = {
|
|
|
2418
2347
|
console.error("Network Error:", error);
|
|
2419
2348
|
return "Network Error";
|
|
2420
2349
|
} else {
|
|
2421
|
-
console.error("Other Error:", error
|
|
2422
|
-
const errorMessage =
|
|
2423
|
-
return { message: errorMessage, status:
|
|
2350
|
+
console.error("Other Error:", error?.response);
|
|
2351
|
+
const errorMessage = error?.response?.data?.message || "An error occurred";
|
|
2352
|
+
return { message: errorMessage, status: error?.response?.status };
|
|
2424
2353
|
}
|
|
2425
2354
|
};
|
|
2426
|
-
const clearAuthToken = () =>
|
|
2427
|
-
|
|
2355
|
+
const clearAuthToken = async () => {
|
|
2356
|
+
await localStorage2.clearToken();
|
|
2428
2357
|
if (typeof window !== "undefined") {
|
|
2429
2358
|
window.location.href = `/login`;
|
|
2430
2359
|
}
|
|
2431
|
-
}
|
|
2360
|
+
};
|
|
2432
2361
|
function formatUrl(url, db2) {
|
|
2433
2362
|
return url + (db2 ? "?db=" + db2 : "");
|
|
2434
2363
|
}
|
|
@@ -2452,14 +2381,14 @@ var axiosClient = {
|
|
|
2452
2381
|
};
|
|
2453
2382
|
|
|
2454
2383
|
// src/store/index.ts
|
|
2455
|
-
|
|
2384
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
2456
2385
|
|
|
2457
2386
|
// src/store/reducers/breadcrums-slice/index.ts
|
|
2458
|
-
|
|
2387
|
+
import { createSlice } from "@reduxjs/toolkit";
|
|
2459
2388
|
var initialState = {
|
|
2460
2389
|
breadCrumbs: []
|
|
2461
2390
|
};
|
|
2462
|
-
var breadcrumbsSlice =
|
|
2391
|
+
var breadcrumbsSlice = createSlice({
|
|
2463
2392
|
name: "breadcrumbs",
|
|
2464
2393
|
initialState,
|
|
2465
2394
|
reducers: {
|
|
@@ -2472,7 +2401,7 @@ var { setBreadCrumbs } = breadcrumbsSlice.actions;
|
|
|
2472
2401
|
var breadcrums_slice_default = breadcrumbsSlice.reducer;
|
|
2473
2402
|
|
|
2474
2403
|
// src/store/reducers/env-slice/index.ts
|
|
2475
|
-
|
|
2404
|
+
import { createSlice as createSlice2 } from "@reduxjs/toolkit";
|
|
2476
2405
|
var initialState2 = {
|
|
2477
2406
|
baseUrl: "",
|
|
2478
2407
|
requests: null,
|
|
@@ -2493,7 +2422,7 @@ var initialState2 = {
|
|
|
2493
2422
|
tz: "Asia/Saigon"
|
|
2494
2423
|
}
|
|
2495
2424
|
};
|
|
2496
|
-
var envSlice = (
|
|
2425
|
+
var envSlice = createSlice2({
|
|
2497
2426
|
name: "env",
|
|
2498
2427
|
initialState: initialState2,
|
|
2499
2428
|
reducers: {
|
|
@@ -2540,7 +2469,7 @@ var {
|
|
|
2540
2469
|
var env_slice_default = envSlice.reducer;
|
|
2541
2470
|
|
|
2542
2471
|
// src/store/reducers/excel-slice/index.ts
|
|
2543
|
-
|
|
2472
|
+
import { createSlice as createSlice3 } from "@reduxjs/toolkit";
|
|
2544
2473
|
var initialState3 = {
|
|
2545
2474
|
dataParse: null,
|
|
2546
2475
|
idFile: null,
|
|
@@ -2549,7 +2478,7 @@ var initialState3 = {
|
|
|
2549
2478
|
selectedFile: null,
|
|
2550
2479
|
errorData: null
|
|
2551
2480
|
};
|
|
2552
|
-
var excelSlice = (
|
|
2481
|
+
var excelSlice = createSlice3({
|
|
2553
2482
|
name: "excel",
|
|
2554
2483
|
initialState: initialState3,
|
|
2555
2484
|
reducers: {
|
|
@@ -2584,7 +2513,7 @@ var {
|
|
|
2584
2513
|
var excel_slice_default = excelSlice.reducer;
|
|
2585
2514
|
|
|
2586
2515
|
// src/store/reducers/form-slice/index.ts
|
|
2587
|
-
|
|
2516
|
+
import { createSlice as createSlice4 } from "@reduxjs/toolkit";
|
|
2588
2517
|
var initialState4 = {
|
|
2589
2518
|
viewDataStore: {},
|
|
2590
2519
|
isShowingModalDetail: false,
|
|
@@ -2594,7 +2523,7 @@ var initialState4 = {
|
|
|
2594
2523
|
listSubject: {},
|
|
2595
2524
|
dataUser: {}
|
|
2596
2525
|
};
|
|
2597
|
-
var formSlice = (
|
|
2526
|
+
var formSlice = createSlice4({
|
|
2598
2527
|
name: "form",
|
|
2599
2528
|
initialState: initialState4,
|
|
2600
2529
|
reducers: {
|
|
@@ -2633,15 +2562,15 @@ var {
|
|
|
2633
2562
|
var form_slice_default = formSlice.reducer;
|
|
2634
2563
|
|
|
2635
2564
|
// src/store/reducers/header-slice/index.ts
|
|
2636
|
-
|
|
2637
|
-
var headerSlice = (
|
|
2565
|
+
import { createSlice as createSlice5 } from "@reduxjs/toolkit";
|
|
2566
|
+
var headerSlice = createSlice5({
|
|
2638
2567
|
name: "header",
|
|
2639
2568
|
initialState: {
|
|
2640
2569
|
value: { allowedCompanyIds: [] }
|
|
2641
2570
|
},
|
|
2642
2571
|
reducers: {
|
|
2643
2572
|
setHeader: (state, action) => {
|
|
2644
|
-
state.value =
|
|
2573
|
+
state.value = { ...state.value, ...action.payload };
|
|
2645
2574
|
},
|
|
2646
2575
|
setAllowedCompanyIds: (state, action) => {
|
|
2647
2576
|
state.value.allowedCompanyIds = action.payload;
|
|
@@ -2652,7 +2581,7 @@ var { setAllowedCompanyIds, setHeader } = headerSlice.actions;
|
|
|
2652
2581
|
var header_slice_default = headerSlice.reducer;
|
|
2653
2582
|
|
|
2654
2583
|
// src/store/reducers/list-slice/index.ts
|
|
2655
|
-
|
|
2584
|
+
import { createSlice as createSlice6 } from "@reduxjs/toolkit";
|
|
2656
2585
|
var initialState5 = {
|
|
2657
2586
|
pageLimit: 10,
|
|
2658
2587
|
fields: {},
|
|
@@ -2666,7 +2595,7 @@ var initialState5 = {
|
|
|
2666
2595
|
page: 0,
|
|
2667
2596
|
domainTable: []
|
|
2668
2597
|
};
|
|
2669
|
-
var listSlice = (
|
|
2598
|
+
var listSlice = createSlice6({
|
|
2670
2599
|
name: "list",
|
|
2671
2600
|
initialState: initialState5,
|
|
2672
2601
|
reducers: {
|
|
@@ -2717,13 +2646,13 @@ var {
|
|
|
2717
2646
|
var list_slice_default = listSlice.reducer;
|
|
2718
2647
|
|
|
2719
2648
|
// src/store/reducers/login-slice/index.ts
|
|
2720
|
-
|
|
2649
|
+
import { createSlice as createSlice7 } from "@reduxjs/toolkit";
|
|
2721
2650
|
var initialState6 = {
|
|
2722
2651
|
db: "",
|
|
2723
2652
|
redirectTo: "/",
|
|
2724
2653
|
forgotPasswordUrl: "/"
|
|
2725
2654
|
};
|
|
2726
|
-
var loginSlice = (
|
|
2655
|
+
var loginSlice = createSlice7({
|
|
2727
2656
|
name: "login",
|
|
2728
2657
|
initialState: initialState6,
|
|
2729
2658
|
reducers: {
|
|
@@ -2742,14 +2671,14 @@ var { setDb, setRedirectTo, setForgotPasswordUrl } = loginSlice.actions;
|
|
|
2742
2671
|
var login_slice_default = loginSlice.reducer;
|
|
2743
2672
|
|
|
2744
2673
|
// src/store/reducers/navbar-slice/index.ts
|
|
2745
|
-
|
|
2674
|
+
import { createSlice as createSlice8 } from "@reduxjs/toolkit";
|
|
2746
2675
|
var initialState7 = {
|
|
2747
2676
|
menuFocus: {},
|
|
2748
2677
|
menuAction: {},
|
|
2749
2678
|
navbarWidth: 250,
|
|
2750
2679
|
menuList: []
|
|
2751
2680
|
};
|
|
2752
|
-
var navbarSlice = (
|
|
2681
|
+
var navbarSlice = createSlice8({
|
|
2753
2682
|
name: "navbar",
|
|
2754
2683
|
initialState: initialState7,
|
|
2755
2684
|
reducers: {
|
|
@@ -2771,11 +2700,11 @@ var { setMenuFocus, setMenuFocusAction, setNavbarWidth, setMenuList } = navbarSl
|
|
|
2771
2700
|
var navbar_slice_default = navbarSlice.reducer;
|
|
2772
2701
|
|
|
2773
2702
|
// src/store/reducers/profile-slice/index.ts
|
|
2774
|
-
|
|
2703
|
+
import { createSlice as createSlice9 } from "@reduxjs/toolkit";
|
|
2775
2704
|
var initialState8 = {
|
|
2776
2705
|
profile: {}
|
|
2777
2706
|
};
|
|
2778
|
-
var profileSlice = (
|
|
2707
|
+
var profileSlice = createSlice9({
|
|
2779
2708
|
name: "profile",
|
|
2780
2709
|
initialState: initialState8,
|
|
2781
2710
|
reducers: {
|
|
@@ -2788,7 +2717,7 @@ var { setProfile } = profileSlice.actions;
|
|
|
2788
2717
|
var profile_slice_default = profileSlice.reducer;
|
|
2789
2718
|
|
|
2790
2719
|
// src/store/reducers/search-slice/index.ts
|
|
2791
|
-
|
|
2720
|
+
import { createSlice as createSlice10 } from "@reduxjs/toolkit";
|
|
2792
2721
|
var initialState9 = {
|
|
2793
2722
|
groupByDomain: null,
|
|
2794
2723
|
searchBy: [],
|
|
@@ -2800,7 +2729,7 @@ var initialState9 = {
|
|
|
2800
2729
|
filterBy: [],
|
|
2801
2730
|
groupBy: []
|
|
2802
2731
|
};
|
|
2803
|
-
var searchSlice = (
|
|
2732
|
+
var searchSlice = createSlice10({
|
|
2804
2733
|
name: "search",
|
|
2805
2734
|
initialState: initialState9,
|
|
2806
2735
|
reducers: {
|
|
@@ -2874,7 +2803,7 @@ var {
|
|
|
2874
2803
|
var search_slice_default = searchSlice.reducer;
|
|
2875
2804
|
|
|
2876
2805
|
// src/store/store.ts
|
|
2877
|
-
|
|
2806
|
+
import { configureStore } from "@reduxjs/toolkit";
|
|
2878
2807
|
|
|
2879
2808
|
// node_modules/redux/dist/redux.mjs
|
|
2880
2809
|
function formatProdErrorMessage(code) {
|
|
@@ -3058,7 +2987,7 @@ var rootReducer = combineReducers({
|
|
|
3058
2987
|
excel: excel_slice_default,
|
|
3059
2988
|
profile: profile_slice_default
|
|
3060
2989
|
});
|
|
3061
|
-
var envStore =
|
|
2990
|
+
var envStore = configureStore({
|
|
3062
2991
|
reducer: rootReducer,
|
|
3063
2992
|
middleware: (getDefaultMiddleware) => getDefaultMiddleware({
|
|
3064
2993
|
serializableCheck: false
|
|
@@ -3066,7 +2995,20 @@ var envStore = (0, import_toolkit11.configureStore)({
|
|
|
3066
2995
|
});
|
|
3067
2996
|
|
|
3068
2997
|
// src/environment/EnvStore.ts
|
|
3069
|
-
var
|
|
2998
|
+
var EnvStore = class _EnvStore {
|
|
2999
|
+
static instance = null;
|
|
3000
|
+
envStore;
|
|
3001
|
+
baseUrl;
|
|
3002
|
+
requests;
|
|
3003
|
+
context;
|
|
3004
|
+
defaultCompany;
|
|
3005
|
+
config;
|
|
3006
|
+
companies;
|
|
3007
|
+
user;
|
|
3008
|
+
db;
|
|
3009
|
+
localStorageUtils;
|
|
3010
|
+
sessionStorageUtils;
|
|
3011
|
+
refreshTokenEndpoint;
|
|
3070
3012
|
constructor(envStore2, localStorageUtils2, sessionStorageUtils2) {
|
|
3071
3013
|
this.envStore = envStore2;
|
|
3072
3014
|
this.localStorageUtils = localStorageUtils2;
|
|
@@ -3085,25 +3027,26 @@ var _EnvStore = class _EnvStore {
|
|
|
3085
3027
|
}
|
|
3086
3028
|
setup() {
|
|
3087
3029
|
const env = this.envStore.getState().env;
|
|
3088
|
-
this.baseUrl = env
|
|
3089
|
-
this.requests = env
|
|
3090
|
-
this.context = env
|
|
3091
|
-
this.defaultCompany = env
|
|
3092
|
-
this.config = env
|
|
3093
|
-
this.companies =
|
|
3094
|
-
this.user = env
|
|
3095
|
-
this.db = env
|
|
3096
|
-
this.refreshTokenEndpoint = env
|
|
3030
|
+
this.baseUrl = env?.baseUrl;
|
|
3031
|
+
this.requests = env?.requests;
|
|
3032
|
+
this.context = env?.context;
|
|
3033
|
+
this.defaultCompany = env?.defaultCompany;
|
|
3034
|
+
this.config = env?.config;
|
|
3035
|
+
this.companies = env?.companies || [];
|
|
3036
|
+
this.user = env?.user;
|
|
3037
|
+
this.db = env?.db;
|
|
3038
|
+
this.refreshTokenEndpoint = env?.refreshTokenEndpoint;
|
|
3097
3039
|
console.log("Env setup:", this);
|
|
3098
3040
|
}
|
|
3099
3041
|
setupEnv(envConfig) {
|
|
3100
3042
|
const dispatch = this.envStore.dispatch;
|
|
3101
|
-
const env =
|
|
3043
|
+
const env = {
|
|
3044
|
+
...envConfig,
|
|
3102
3045
|
localStorageUtils: this.localStorageUtils,
|
|
3103
3046
|
sessionStorageUtils: this.sessionStorageUtils
|
|
3104
|
-
}
|
|
3047
|
+
};
|
|
3105
3048
|
const requests = axiosClient.init(env);
|
|
3106
|
-
dispatch(setEnv(
|
|
3049
|
+
dispatch(setEnv({ ...env, requests }));
|
|
3107
3050
|
this.setup();
|
|
3108
3051
|
}
|
|
3109
3052
|
setUid(uid) {
|
|
@@ -3137,8 +3080,6 @@ var _EnvStore = class _EnvStore {
|
|
|
3137
3080
|
this.setup();
|
|
3138
3081
|
}
|
|
3139
3082
|
};
|
|
3140
|
-
_EnvStore.instance = null;
|
|
3141
|
-
var EnvStore = _EnvStore;
|
|
3142
3083
|
function getEnv() {
|
|
3143
3084
|
const instance = EnvStore.getInstance(envStore);
|
|
3144
3085
|
if (!instance) {
|
|
@@ -3150,61 +3091,35 @@ function getEnv() {
|
|
|
3150
3091
|
// src/services/action-service/index.ts
|
|
3151
3092
|
var ActionService = {
|
|
3152
3093
|
// Load Action
|
|
3153
|
-
loadAction(
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
}
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
});
|
|
3168
|
-
});
|
|
3169
|
-
},
|
|
3170
|
-
// Call Button
|
|
3171
|
-
callButton(_0) {
|
|
3172
|
-
return __async(this, arguments, function* ({
|
|
3173
|
-
model,
|
|
3174
|
-
ids = [],
|
|
3175
|
-
context,
|
|
3176
|
-
method
|
|
3177
|
-
}) {
|
|
3178
|
-
try {
|
|
3179
|
-
const env = getEnv();
|
|
3180
|
-
const jsonData = {
|
|
3181
|
-
model,
|
|
3182
|
-
method,
|
|
3183
|
-
ids,
|
|
3184
|
-
with_context: context
|
|
3185
|
-
};
|
|
3186
|
-
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3187
|
-
headers: {
|
|
3188
|
-
"Content-Type": "application/json"
|
|
3189
|
-
}
|
|
3190
|
-
});
|
|
3191
|
-
} catch (error) {
|
|
3192
|
-
console.error("Error when calling button action:", error);
|
|
3193
|
-
throw error;
|
|
3094
|
+
async loadAction({
|
|
3095
|
+
idAction,
|
|
3096
|
+
context
|
|
3097
|
+
}) {
|
|
3098
|
+
const env = getEnv();
|
|
3099
|
+
const jsonData = {
|
|
3100
|
+
action_id: idAction,
|
|
3101
|
+
with_context: {
|
|
3102
|
+
...context
|
|
3103
|
+
}
|
|
3104
|
+
};
|
|
3105
|
+
return env.requests.post(`${"/load_action" /* LOAD_ACTION */}`, jsonData, {
|
|
3106
|
+
headers: {
|
|
3107
|
+
"Content-Type": "application/json"
|
|
3194
3108
|
}
|
|
3195
3109
|
});
|
|
3196
3110
|
},
|
|
3197
|
-
//
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3111
|
+
// Call Button
|
|
3112
|
+
async callButton({
|
|
3113
|
+
model,
|
|
3114
|
+
ids = [],
|
|
3115
|
+
context,
|
|
3116
|
+
method
|
|
3117
|
+
}) {
|
|
3118
|
+
try {
|
|
3204
3119
|
const env = getEnv();
|
|
3205
3120
|
const jsonData = {
|
|
3206
3121
|
model,
|
|
3207
|
-
method
|
|
3122
|
+
method,
|
|
3208
3123
|
ids,
|
|
3209
3124
|
with_context: context
|
|
3210
3125
|
};
|
|
@@ -3213,96 +3128,112 @@ var ActionService = {
|
|
|
3213
3128
|
"Content-Type": "application/json"
|
|
3214
3129
|
}
|
|
3215
3130
|
});
|
|
3131
|
+
} catch (error) {
|
|
3132
|
+
console.error("Error when calling button action:", error);
|
|
3133
|
+
throw error;
|
|
3134
|
+
}
|
|
3135
|
+
},
|
|
3136
|
+
// remove Row
|
|
3137
|
+
async removeRows({
|
|
3138
|
+
model,
|
|
3139
|
+
ids,
|
|
3140
|
+
context
|
|
3141
|
+
}) {
|
|
3142
|
+
const env = getEnv();
|
|
3143
|
+
const jsonData = {
|
|
3144
|
+
model,
|
|
3145
|
+
method: "unlink",
|
|
3146
|
+
ids,
|
|
3147
|
+
with_context: context
|
|
3148
|
+
};
|
|
3149
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3150
|
+
headers: {
|
|
3151
|
+
"Content-Type": "application/json"
|
|
3152
|
+
}
|
|
3216
3153
|
});
|
|
3217
3154
|
},
|
|
3218
3155
|
// Duplicate Model
|
|
3219
|
-
duplicateRecord(
|
|
3220
|
-
|
|
3156
|
+
async duplicateRecord({
|
|
3157
|
+
model,
|
|
3158
|
+
id,
|
|
3159
|
+
context
|
|
3160
|
+
}) {
|
|
3161
|
+
const env = getEnv();
|
|
3162
|
+
const jsonData = {
|
|
3221
3163
|
model,
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
with_context: context
|
|
3231
|
-
};
|
|
3232
|
-
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3233
|
-
headers: {
|
|
3234
|
-
"Content-Type": "application/json"
|
|
3235
|
-
}
|
|
3236
|
-
});
|
|
3164
|
+
method: "copy",
|
|
3165
|
+
ids: id,
|
|
3166
|
+
with_context: context
|
|
3167
|
+
};
|
|
3168
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3169
|
+
headers: {
|
|
3170
|
+
"Content-Type": "application/json"
|
|
3171
|
+
}
|
|
3237
3172
|
});
|
|
3238
3173
|
},
|
|
3239
3174
|
// Get Print Report
|
|
3240
|
-
getPrintReportName(
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
report_name: {}
|
|
3250
|
-
}
|
|
3251
|
-
}
|
|
3252
|
-
};
|
|
3253
|
-
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3254
|
-
headers: {
|
|
3255
|
-
"Content-Type": "application/json"
|
|
3175
|
+
async getPrintReportName({ id }) {
|
|
3176
|
+
const env = getEnv();
|
|
3177
|
+
const jsonData = {
|
|
3178
|
+
model: "ir.actions.report",
|
|
3179
|
+
method: "web_read",
|
|
3180
|
+
id,
|
|
3181
|
+
kwargs: {
|
|
3182
|
+
specification: {
|
|
3183
|
+
report_name: {}
|
|
3256
3184
|
}
|
|
3257
|
-
}
|
|
3185
|
+
}
|
|
3186
|
+
};
|
|
3187
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3188
|
+
headers: {
|
|
3189
|
+
"Content-Type": "application/json"
|
|
3190
|
+
}
|
|
3258
3191
|
});
|
|
3259
3192
|
},
|
|
3260
3193
|
//Save Print Invoice
|
|
3261
|
-
print(
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
responseType: "arraybuffer"
|
|
3278
|
-
});
|
|
3194
|
+
async print({ id, report, db }) {
|
|
3195
|
+
const env = getEnv();
|
|
3196
|
+
const jsonData = {
|
|
3197
|
+
report,
|
|
3198
|
+
id,
|
|
3199
|
+
type: "pdf",
|
|
3200
|
+
file_response: true,
|
|
3201
|
+
db
|
|
3202
|
+
};
|
|
3203
|
+
const queryString = toQueryString(jsonData);
|
|
3204
|
+
const urlWithParams = `${"/report" /* REPORT_PATH */}?${queryString}`;
|
|
3205
|
+
return env.requests.get(urlWithParams, {
|
|
3206
|
+
headers: {
|
|
3207
|
+
"Content-Type": "application/json"
|
|
3208
|
+
},
|
|
3209
|
+
responseType: "arraybuffer"
|
|
3279
3210
|
});
|
|
3280
3211
|
},
|
|
3281
3212
|
//Run Action
|
|
3282
|
-
runAction(
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
}
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
}
|
|
3213
|
+
async runAction({
|
|
3214
|
+
idAction,
|
|
3215
|
+
context
|
|
3216
|
+
}) {
|
|
3217
|
+
const env = getEnv();
|
|
3218
|
+
const jsonData = {
|
|
3219
|
+
action_id: idAction,
|
|
3220
|
+
with_context: {
|
|
3221
|
+
...context
|
|
3222
|
+
}
|
|
3223
|
+
// context: {
|
|
3224
|
+
// lang: 'en_US',
|
|
3225
|
+
// tz: 'Asia/Saigon',
|
|
3226
|
+
// uid: 2,
|
|
3227
|
+
// allowed_company_ids: [1],
|
|
3228
|
+
// active_id: Array.isArray(idDetail) ? idDetail[0] : idDetail,
|
|
3229
|
+
// active_ids: Array.isArray(idDetail) ? [...idDetail] : idDetail,
|
|
3230
|
+
// active_model: model,
|
|
3231
|
+
// },
|
|
3232
|
+
};
|
|
3233
|
+
return env.requests.post(`${"/run_action" /* RUN_ACTION_PATH */}`, jsonData, {
|
|
3234
|
+
headers: {
|
|
3235
|
+
"Content-Type": "application/json"
|
|
3236
|
+
}
|
|
3306
3237
|
});
|
|
3307
3238
|
}
|
|
3308
3239
|
};
|
|
@@ -3310,238 +3241,200 @@ var action_service_default = ActionService;
|
|
|
3310
3241
|
|
|
3311
3242
|
// src/services/auth-service/index.ts
|
|
3312
3243
|
var AuthService = {
|
|
3313
|
-
login(body) {
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
3330
|
-
}
|
|
3331
|
-
});
|
|
3244
|
+
async login(body) {
|
|
3245
|
+
const env = getEnv();
|
|
3246
|
+
const payload = Object.fromEntries(
|
|
3247
|
+
Object.entries({
|
|
3248
|
+
username: body.email,
|
|
3249
|
+
password: body.password,
|
|
3250
|
+
grant_type: env?.config?.grantType || "",
|
|
3251
|
+
client_id: env?.config?.clientId || "",
|
|
3252
|
+
client_secret: env?.config?.clientSecret || ""
|
|
3253
|
+
}).filter(([_, value]) => !!value)
|
|
3254
|
+
);
|
|
3255
|
+
const encodedData = new URLSearchParams(payload).toString();
|
|
3256
|
+
return env?.requests?.post(body.path, encodedData, {
|
|
3257
|
+
headers: {
|
|
3258
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
3259
|
+
}
|
|
3332
3260
|
});
|
|
3333
3261
|
},
|
|
3334
|
-
forgotPassword(email) {
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
"Content-Type": "application/json"
|
|
3345
|
-
}
|
|
3346
|
-
});
|
|
3262
|
+
async forgotPassword(email) {
|
|
3263
|
+
const env = getEnv();
|
|
3264
|
+
const bodyData = {
|
|
3265
|
+
login: email,
|
|
3266
|
+
url: `${window.location.origin}/reset-password`
|
|
3267
|
+
};
|
|
3268
|
+
return env?.requests?.post("/reset_password" /* RESET_PASSWORD_PATH */, bodyData, {
|
|
3269
|
+
headers: {
|
|
3270
|
+
"Content-Type": "application/json"
|
|
3271
|
+
}
|
|
3347
3272
|
});
|
|
3348
3273
|
},
|
|
3349
|
-
forgotPasswordSSO(
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
vals: {
|
|
3361
|
-
email
|
|
3362
|
-
}
|
|
3363
|
-
},
|
|
3364
|
-
with_context
|
|
3365
|
-
};
|
|
3366
|
-
return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, body, {
|
|
3367
|
-
headers: {
|
|
3368
|
-
"Content-Type": "application/json"
|
|
3274
|
+
async forgotPasswordSSO({
|
|
3275
|
+
email,
|
|
3276
|
+
with_context,
|
|
3277
|
+
method
|
|
3278
|
+
}) {
|
|
3279
|
+
const env = getEnv();
|
|
3280
|
+
const body = {
|
|
3281
|
+
method,
|
|
3282
|
+
kwargs: {
|
|
3283
|
+
vals: {
|
|
3284
|
+
email
|
|
3369
3285
|
}
|
|
3370
|
-
}
|
|
3286
|
+
},
|
|
3287
|
+
with_context
|
|
3288
|
+
};
|
|
3289
|
+
return env?.requests?.post("/call" /* CALL_PATH */, body, {
|
|
3290
|
+
headers: {
|
|
3291
|
+
"Content-Type": "application/json"
|
|
3292
|
+
}
|
|
3371
3293
|
});
|
|
3372
3294
|
},
|
|
3373
|
-
resetPassword(data, token) {
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
"Content-Type": "application/json"
|
|
3385
|
-
}
|
|
3386
|
-
});
|
|
3295
|
+
async resetPassword(data, token) {
|
|
3296
|
+
const env = getEnv();
|
|
3297
|
+
const bodyData = {
|
|
3298
|
+
token,
|
|
3299
|
+
password: data.password,
|
|
3300
|
+
new_password: data.confirmPassword
|
|
3301
|
+
};
|
|
3302
|
+
return env?.requests?.post("/change_password" /* CHANGE_PASSWORD_PATH */, bodyData, {
|
|
3303
|
+
headers: {
|
|
3304
|
+
"Content-Type": "application/json"
|
|
3305
|
+
}
|
|
3387
3306
|
});
|
|
3388
3307
|
},
|
|
3389
|
-
resetPasswordSSO(
|
|
3390
|
-
|
|
3308
|
+
async resetPasswordSSO({
|
|
3309
|
+
method,
|
|
3310
|
+
password,
|
|
3311
|
+
with_context
|
|
3312
|
+
}) {
|
|
3313
|
+
const env = getEnv();
|
|
3314
|
+
const bodyData = {
|
|
3391
3315
|
method,
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
var _a;
|
|
3396
|
-
const env = getEnv();
|
|
3397
|
-
const bodyData = {
|
|
3398
|
-
method,
|
|
3399
|
-
kwargs: {
|
|
3400
|
-
vals: {
|
|
3401
|
-
password
|
|
3402
|
-
}
|
|
3403
|
-
},
|
|
3404
|
-
with_context
|
|
3405
|
-
};
|
|
3406
|
-
return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, bodyData, {
|
|
3407
|
-
headers: {
|
|
3408
|
-
"Content-Type": "application/json"
|
|
3316
|
+
kwargs: {
|
|
3317
|
+
vals: {
|
|
3318
|
+
password
|
|
3409
3319
|
}
|
|
3410
|
-
}
|
|
3320
|
+
},
|
|
3321
|
+
with_context
|
|
3322
|
+
};
|
|
3323
|
+
return env?.requests?.post("/call" /* CALL_PATH */, bodyData, {
|
|
3324
|
+
headers: {
|
|
3325
|
+
"Content-Type": "application/json"
|
|
3326
|
+
}
|
|
3411
3327
|
});
|
|
3412
3328
|
},
|
|
3413
|
-
updatePassword(data, token) {
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
"Content-Type": "application/json"
|
|
3425
|
-
}
|
|
3426
|
-
});
|
|
3329
|
+
async updatePassword(data, token) {
|
|
3330
|
+
const env = getEnv();
|
|
3331
|
+
const bodyData = {
|
|
3332
|
+
token,
|
|
3333
|
+
old_password: data.oldPassword,
|
|
3334
|
+
new_password: data.newPassword
|
|
3335
|
+
};
|
|
3336
|
+
return env?.requests?.post("/change_password_parent" /* UPDATE_PASSWORD_PATH */, bodyData, {
|
|
3337
|
+
headers: {
|
|
3338
|
+
"Content-Type": "application/json"
|
|
3339
|
+
}
|
|
3427
3340
|
});
|
|
3428
3341
|
},
|
|
3429
|
-
isValidToken(token) {
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
"Content-Type": "application/json"
|
|
3439
|
-
}
|
|
3440
|
-
});
|
|
3342
|
+
async isValidToken(token) {
|
|
3343
|
+
const env = getEnv();
|
|
3344
|
+
const bodyData = {
|
|
3345
|
+
token
|
|
3346
|
+
};
|
|
3347
|
+
return env?.requests?.post("/check_token" /* TOKEN */, bodyData, {
|
|
3348
|
+
headers: {
|
|
3349
|
+
"Content-Type": "application/json"
|
|
3350
|
+
}
|
|
3441
3351
|
});
|
|
3442
3352
|
},
|
|
3443
|
-
loginSocial(
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
{
|
|
3454
|
-
|
|
3455
|
-
headers: {
|
|
3456
|
-
"Content-Type": "application/json"
|
|
3457
|
-
}
|
|
3353
|
+
async loginSocial({
|
|
3354
|
+
db,
|
|
3355
|
+
state,
|
|
3356
|
+
access_token
|
|
3357
|
+
}) {
|
|
3358
|
+
const env = getEnv();
|
|
3359
|
+
return env?.requests?.post(
|
|
3360
|
+
"/token/generate" /* GENTOKEN_SOCIAL */,
|
|
3361
|
+
{ state, access_token },
|
|
3362
|
+
{
|
|
3363
|
+
headers: {
|
|
3364
|
+
"Content-Type": "application/json"
|
|
3458
3365
|
}
|
|
3459
|
-
|
|
3460
|
-
|
|
3366
|
+
}
|
|
3367
|
+
);
|
|
3461
3368
|
},
|
|
3462
|
-
getProviders(db) {
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
const env = getEnv();
|
|
3466
|
-
return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.get("/oauth/providers", { params: { db } });
|
|
3467
|
-
});
|
|
3369
|
+
async getProviders(db) {
|
|
3370
|
+
const env = getEnv();
|
|
3371
|
+
return env?.requests?.get("/oauth/providers", { params: { db } });
|
|
3468
3372
|
},
|
|
3469
|
-
getAccessByCode(code) {
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
headers: {
|
|
3483
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
3484
|
-
}
|
|
3373
|
+
async getAccessByCode(code) {
|
|
3374
|
+
const env = getEnv();
|
|
3375
|
+
const data = new URLSearchParams();
|
|
3376
|
+
data.append("code", code);
|
|
3377
|
+
data.append("grant_type", "authorization_code");
|
|
3378
|
+
data.append("client_id", env?.config?.clientId || "");
|
|
3379
|
+
data.append("redirect_uri", env?.config?.redirectUri || "");
|
|
3380
|
+
return env?.requests?.post(
|
|
3381
|
+
`${env?.baseUrl?.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
|
|
3382
|
+
data,
|
|
3383
|
+
{
|
|
3384
|
+
headers: {
|
|
3385
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
3485
3386
|
}
|
|
3486
|
-
|
|
3487
|
-
|
|
3387
|
+
}
|
|
3388
|
+
);
|
|
3488
3389
|
},
|
|
3489
|
-
logout(data) {
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
{
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
}
|
|
3504
|
-
);
|
|
3505
|
-
});
|
|
3390
|
+
async logout(data) {
|
|
3391
|
+
const env = getEnv();
|
|
3392
|
+
console.log(data);
|
|
3393
|
+
return env?.requests?.post(
|
|
3394
|
+
"/logout" /* LOGOUT */,
|
|
3395
|
+
{},
|
|
3396
|
+
{
|
|
3397
|
+
headers: {
|
|
3398
|
+
"Content-Type": "application/json"
|
|
3399
|
+
},
|
|
3400
|
+
withCredentials: true,
|
|
3401
|
+
useRefreshToken: true
|
|
3402
|
+
}
|
|
3403
|
+
);
|
|
3506
3404
|
}
|
|
3507
3405
|
};
|
|
3508
3406
|
var auth_service_default = AuthService;
|
|
3509
3407
|
|
|
3510
3408
|
// src/services/company-service/index.ts
|
|
3511
3409
|
var CompanyService = {
|
|
3512
|
-
getCurrentCompany() {
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
}
|
|
3519
|
-
});
|
|
3410
|
+
async getCurrentCompany() {
|
|
3411
|
+
const env = getEnv();
|
|
3412
|
+
return await env.requests.get("/company" /* COMPANY_PATH */, {
|
|
3413
|
+
headers: {
|
|
3414
|
+
"Content-Type": "application/json"
|
|
3415
|
+
}
|
|
3520
3416
|
});
|
|
3521
3417
|
},
|
|
3522
|
-
getInfoCompany(id) {
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
display_name: {},
|
|
3536
|
-
secondary_logo: {}
|
|
3537
|
-
}
|
|
3538
|
-
}
|
|
3539
|
-
};
|
|
3540
|
-
return yield (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
3541
|
-
headers: {
|
|
3542
|
-
"Content-Type": "application/json"
|
|
3418
|
+
async getInfoCompany(id) {
|
|
3419
|
+
const env = getEnv();
|
|
3420
|
+
const jsonData = {
|
|
3421
|
+
ids: [id],
|
|
3422
|
+
model: "res.company" /* COMPANY */,
|
|
3423
|
+
method: "web_read" /* WEB_READ */,
|
|
3424
|
+
kwargs: {
|
|
3425
|
+
specification: {
|
|
3426
|
+
primary_color: {},
|
|
3427
|
+
secondary_color: {},
|
|
3428
|
+
logo: {},
|
|
3429
|
+
display_name: {},
|
|
3430
|
+
secondary_logo: {}
|
|
3543
3431
|
}
|
|
3544
|
-
}
|
|
3432
|
+
}
|
|
3433
|
+
};
|
|
3434
|
+
return await env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
3435
|
+
headers: {
|
|
3436
|
+
"Content-Type": "application/json"
|
|
3437
|
+
}
|
|
3545
3438
|
});
|
|
3546
3439
|
}
|
|
3547
3440
|
};
|
|
@@ -3549,671 +3442,613 @@ var company_service_default = CompanyService;
|
|
|
3549
3442
|
|
|
3550
3443
|
// src/services/excel-service/index.ts
|
|
3551
3444
|
var ExcelService = {
|
|
3552
|
-
uploadFile(
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
}
|
|
3559
|
-
});
|
|
3445
|
+
async uploadFile({ formData }) {
|
|
3446
|
+
const env = getEnv();
|
|
3447
|
+
return env.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
|
|
3448
|
+
headers: {
|
|
3449
|
+
"Content-Type": "multipart/form-data"
|
|
3450
|
+
}
|
|
3560
3451
|
});
|
|
3561
3452
|
},
|
|
3562
|
-
uploadIdFile(
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
}
|
|
3569
|
-
});
|
|
3453
|
+
async uploadIdFile({ formData }) {
|
|
3454
|
+
const env = getEnv();
|
|
3455
|
+
return env.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
|
|
3456
|
+
headers: {
|
|
3457
|
+
"Content-Type": "multipart/form-data"
|
|
3458
|
+
}
|
|
3570
3459
|
});
|
|
3571
3460
|
},
|
|
3572
|
-
parsePreview(
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
tracking_disable: true
|
|
3605
|
-
}
|
|
3606
|
-
},
|
|
3607
|
-
with_context: context
|
|
3608
|
-
};
|
|
3609
|
-
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3610
|
-
headers: {
|
|
3611
|
-
"Content-Type": "multipart/form-data"
|
|
3461
|
+
async parsePreview({
|
|
3462
|
+
id,
|
|
3463
|
+
selectedSheet,
|
|
3464
|
+
isHeader,
|
|
3465
|
+
context
|
|
3466
|
+
}) {
|
|
3467
|
+
const env = getEnv();
|
|
3468
|
+
const jsonData = {
|
|
3469
|
+
model: "base_import.import" /* BASE_IMPORT */,
|
|
3470
|
+
method: "parse_preview",
|
|
3471
|
+
ids: [id],
|
|
3472
|
+
kwargs: {
|
|
3473
|
+
options: {
|
|
3474
|
+
import_skip_records: [],
|
|
3475
|
+
import_set_empty_fields: [],
|
|
3476
|
+
fallback_values: {},
|
|
3477
|
+
name_create_enabled_fields: {},
|
|
3478
|
+
encoding: "",
|
|
3479
|
+
separator: "",
|
|
3480
|
+
quoting: '"',
|
|
3481
|
+
date_format: "",
|
|
3482
|
+
datetime_format: "",
|
|
3483
|
+
float_thousand_separator: ",",
|
|
3484
|
+
float_decimal_separator: ".",
|
|
3485
|
+
advanced: true,
|
|
3486
|
+
has_headers: isHeader,
|
|
3487
|
+
keep_matches: false,
|
|
3488
|
+
limit: 2e3,
|
|
3489
|
+
sheets: [],
|
|
3490
|
+
sheet: selectedSheet,
|
|
3491
|
+
skip: 0,
|
|
3492
|
+
tracking_disable: true
|
|
3612
3493
|
}
|
|
3613
|
-
}
|
|
3494
|
+
},
|
|
3495
|
+
with_context: context
|
|
3496
|
+
};
|
|
3497
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3498
|
+
headers: {
|
|
3499
|
+
"Content-Type": "multipart/form-data"
|
|
3500
|
+
}
|
|
3614
3501
|
});
|
|
3615
3502
|
},
|
|
3616
|
-
executeImport(
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
}
|
|
3642
|
-
});
|
|
3503
|
+
async executeImport({
|
|
3504
|
+
columns,
|
|
3505
|
+
fields,
|
|
3506
|
+
idFile,
|
|
3507
|
+
options,
|
|
3508
|
+
dryrun,
|
|
3509
|
+
context
|
|
3510
|
+
}) {
|
|
3511
|
+
const env = getEnv();
|
|
3512
|
+
const jsonData = {
|
|
3513
|
+
model: "base_import.import" /* BASE_IMPORT */,
|
|
3514
|
+
method: "execute_import",
|
|
3515
|
+
ids: [idFile],
|
|
3516
|
+
kwargs: {
|
|
3517
|
+
fields,
|
|
3518
|
+
columns,
|
|
3519
|
+
options,
|
|
3520
|
+
dryrun
|
|
3521
|
+
},
|
|
3522
|
+
with_context: context
|
|
3523
|
+
};
|
|
3524
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3525
|
+
headers: {
|
|
3526
|
+
"Content-Type": "multipart/form-data"
|
|
3527
|
+
}
|
|
3643
3528
|
});
|
|
3644
3529
|
},
|
|
3645
|
-
getFileExcel(
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
return env.requests.post("/call" /* CALL_PATH */, jsonData);
|
|
3654
|
-
});
|
|
3530
|
+
async getFileExcel({ model }) {
|
|
3531
|
+
const env = getEnv();
|
|
3532
|
+
const jsonData = {
|
|
3533
|
+
model,
|
|
3534
|
+
method: "get_import_templates" /* GET_IMPORT */,
|
|
3535
|
+
args: []
|
|
3536
|
+
};
|
|
3537
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData);
|
|
3655
3538
|
},
|
|
3656
|
-
getFieldExport(
|
|
3657
|
-
|
|
3658
|
-
|
|
3539
|
+
async getFieldExport({
|
|
3540
|
+
ids,
|
|
3541
|
+
model,
|
|
3542
|
+
isShow,
|
|
3543
|
+
parentField,
|
|
3544
|
+
fieldType,
|
|
3545
|
+
parentName,
|
|
3546
|
+
prefix,
|
|
3547
|
+
name,
|
|
3548
|
+
context,
|
|
3549
|
+
importCompat
|
|
3550
|
+
}) {
|
|
3551
|
+
const env = getEnv();
|
|
3552
|
+
const jsonData = {
|
|
3659
3553
|
model,
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
domain: [["id", "in", ids]],
|
|
3674
|
-
with_context: context
|
|
3675
|
-
};
|
|
3676
|
-
if (isShow) {
|
|
3677
|
-
jsonData.parent_field = parentField;
|
|
3678
|
-
jsonData.parent_field_type = fieldType;
|
|
3679
|
-
jsonData.parent_name = parentName;
|
|
3680
|
-
jsonData.name = name;
|
|
3681
|
-
jsonData.prefix = prefix;
|
|
3682
|
-
jsonData.exclude = [null];
|
|
3683
|
-
}
|
|
3684
|
-
return env.requests.post("/export/get_fields", jsonData);
|
|
3685
|
-
});
|
|
3554
|
+
import_compat: importCompat,
|
|
3555
|
+
domain: [["id", "in", ids]],
|
|
3556
|
+
with_context: context
|
|
3557
|
+
};
|
|
3558
|
+
if (isShow) {
|
|
3559
|
+
jsonData.parent_field = parentField;
|
|
3560
|
+
jsonData.parent_field_type = fieldType;
|
|
3561
|
+
jsonData.parent_name = parentName;
|
|
3562
|
+
jsonData.name = name;
|
|
3563
|
+
jsonData.prefix = prefix;
|
|
3564
|
+
jsonData.exclude = [null];
|
|
3565
|
+
}
|
|
3566
|
+
return env.requests.post("/export/get_fields", jsonData);
|
|
3686
3567
|
},
|
|
3687
|
-
exportExcel(
|
|
3688
|
-
|
|
3568
|
+
async exportExcel({
|
|
3569
|
+
model,
|
|
3570
|
+
domain,
|
|
3571
|
+
ids,
|
|
3572
|
+
fields,
|
|
3573
|
+
type,
|
|
3574
|
+
importCompat,
|
|
3575
|
+
context,
|
|
3576
|
+
groupby
|
|
3577
|
+
}) {
|
|
3578
|
+
const env = getEnv();
|
|
3579
|
+
const jsonData = {
|
|
3689
3580
|
model,
|
|
3690
3581
|
domain,
|
|
3691
3582
|
ids,
|
|
3583
|
+
import_compat: importCompat,
|
|
3692
3584
|
fields,
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
}) {
|
|
3698
|
-
const env = getEnv();
|
|
3699
|
-
const jsonData = {
|
|
3700
|
-
model,
|
|
3701
|
-
domain,
|
|
3702
|
-
ids,
|
|
3703
|
-
import_compat: importCompat,
|
|
3704
|
-
fields,
|
|
3705
|
-
with_context: context,
|
|
3706
|
-
groupby: groupby != null ? groupby : []
|
|
3707
|
-
};
|
|
3708
|
-
return env.requests.post_excel(`/export/${type}`, jsonData);
|
|
3709
|
-
});
|
|
3585
|
+
with_context: context,
|
|
3586
|
+
groupby: groupby ?? []
|
|
3587
|
+
};
|
|
3588
|
+
return env.requests.post_excel(`/export/${type}`, jsonData);
|
|
3710
3589
|
}
|
|
3711
3590
|
};
|
|
3712
3591
|
var excel_service_default = ExcelService;
|
|
3713
3592
|
|
|
3714
3593
|
// src/services/form-service/index.ts
|
|
3715
3594
|
var FormService = {
|
|
3716
|
-
getComment(
|
|
3717
|
-
|
|
3718
|
-
try {
|
|
3719
|
-
const env = getEnv();
|
|
3720
|
-
const jsonData = {
|
|
3721
|
-
thread_id: data.thread_id,
|
|
3722
|
-
thread_model: data.thread_model,
|
|
3723
|
-
limit: 100,
|
|
3724
|
-
with_context: {
|
|
3725
|
-
lang: data.lang
|
|
3726
|
-
}
|
|
3727
|
-
};
|
|
3728
|
-
return env.requests.post("/chatter/thread/messages" /* GET_MESSAGE */, jsonData, {
|
|
3729
|
-
headers: {
|
|
3730
|
-
"Content-Type": "application/json"
|
|
3731
|
-
}
|
|
3732
|
-
});
|
|
3733
|
-
} catch (error) {
|
|
3734
|
-
console.error("Error when sending message:", error);
|
|
3735
|
-
throw error;
|
|
3736
|
-
}
|
|
3737
|
-
});
|
|
3738
|
-
},
|
|
3739
|
-
sentComment(_0) {
|
|
3740
|
-
return __async(this, arguments, function* ({ data }) {
|
|
3741
|
-
try {
|
|
3742
|
-
const env = getEnv();
|
|
3743
|
-
const jsonData = {
|
|
3744
|
-
context: {
|
|
3745
|
-
tz: "Asia/Saigon",
|
|
3746
|
-
uid: 2,
|
|
3747
|
-
allowed_company_ids: [1],
|
|
3748
|
-
mail_post_autofollow: false,
|
|
3749
|
-
temporary_id: 142183.01
|
|
3750
|
-
},
|
|
3751
|
-
post_data: {
|
|
3752
|
-
body: data.message,
|
|
3753
|
-
message_type: "comment",
|
|
3754
|
-
attachment_ids: data.attachment_ids,
|
|
3755
|
-
attachment_tokens: [],
|
|
3756
|
-
subtype_xmlid: data.subtype
|
|
3757
|
-
},
|
|
3758
|
-
thread_id: Number(data.thread_id),
|
|
3759
|
-
thread_model: data.thread_model
|
|
3760
|
-
};
|
|
3761
|
-
return env.requests.post("/chatter/message/post" /* SENT_MESSAGE */, jsonData, {
|
|
3762
|
-
headers: {
|
|
3763
|
-
"Content-Type": "application/json"
|
|
3764
|
-
}
|
|
3765
|
-
});
|
|
3766
|
-
} catch (error) {
|
|
3767
|
-
console.error("Error when sent message:", error);
|
|
3768
|
-
throw error;
|
|
3769
|
-
}
|
|
3770
|
-
});
|
|
3771
|
-
},
|
|
3772
|
-
deleteComment(_0) {
|
|
3773
|
-
return __async(this, arguments, function* ({ data }) {
|
|
3774
|
-
try {
|
|
3775
|
-
const env = getEnv();
|
|
3776
|
-
const jsonData = {
|
|
3777
|
-
attachment_ids: [],
|
|
3778
|
-
attachment_tokens: [],
|
|
3779
|
-
body: "",
|
|
3780
|
-
message_id: data.message_id
|
|
3781
|
-
};
|
|
3782
|
-
return env.requests.post("/chatter/message/update_content" /* DELETE_MESSAGE */, jsonData, {
|
|
3783
|
-
headers: {
|
|
3784
|
-
"Content-Type": "application/json"
|
|
3785
|
-
}
|
|
3786
|
-
});
|
|
3787
|
-
} catch (error) {
|
|
3788
|
-
console.error("Error when sent message:", error);
|
|
3789
|
-
throw error;
|
|
3790
|
-
}
|
|
3791
|
-
});
|
|
3792
|
-
},
|
|
3793
|
-
getImage(_0) {
|
|
3794
|
-
return __async(this, arguments, function* ({ data }) {
|
|
3795
|
-
try {
|
|
3796
|
-
const env = getEnv();
|
|
3797
|
-
return env.requests.get(
|
|
3798
|
-
`${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
|
|
3799
|
-
{
|
|
3800
|
-
headers: {
|
|
3801
|
-
"Content-Type": "application/json"
|
|
3802
|
-
}
|
|
3803
|
-
}
|
|
3804
|
-
);
|
|
3805
|
-
} catch (error) {
|
|
3806
|
-
console.error("Error when sent message:", error);
|
|
3807
|
-
throw error;
|
|
3808
|
-
}
|
|
3809
|
-
});
|
|
3810
|
-
},
|
|
3811
|
-
uploadImage(_0) {
|
|
3812
|
-
return __async(this, arguments, function* ({ data }) {
|
|
3813
|
-
try {
|
|
3814
|
-
const env = getEnv();
|
|
3815
|
-
return env.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
|
|
3816
|
-
headers: {
|
|
3817
|
-
"Content-Type": "multipart/form-data"
|
|
3818
|
-
}
|
|
3819
|
-
});
|
|
3820
|
-
} catch (error) {
|
|
3821
|
-
console.error("Error when sent message:", error);
|
|
3822
|
-
throw error;
|
|
3823
|
-
}
|
|
3824
|
-
});
|
|
3825
|
-
},
|
|
3826
|
-
getFormView(_0) {
|
|
3827
|
-
return __async(this, arguments, function* ({ data }) {
|
|
3828
|
-
try {
|
|
3829
|
-
const env = getEnv();
|
|
3830
|
-
const jsonData = {
|
|
3831
|
-
model: data.model,
|
|
3832
|
-
method: "get_formview_action",
|
|
3833
|
-
ids: data.id ? [data.id] : [],
|
|
3834
|
-
with_context: data.context
|
|
3835
|
-
};
|
|
3836
|
-
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3837
|
-
headers: {
|
|
3838
|
-
"Content-Type": "application/json"
|
|
3839
|
-
}
|
|
3840
|
-
});
|
|
3841
|
-
} catch (error) {
|
|
3842
|
-
console.error("Error when fetching form view:", error);
|
|
3843
|
-
throw error;
|
|
3844
|
-
}
|
|
3845
|
-
});
|
|
3846
|
-
},
|
|
3847
|
-
changeStatus(_0) {
|
|
3848
|
-
return __async(this, arguments, function* ({ data }) {
|
|
3595
|
+
async getComment({ data }) {
|
|
3596
|
+
try {
|
|
3849
3597
|
const env = getEnv();
|
|
3850
|
-
const vals = {
|
|
3851
|
-
[data.name]: data.stage_id
|
|
3852
|
-
};
|
|
3853
3598
|
const jsonData = {
|
|
3854
|
-
|
|
3855
|
-
|
|
3599
|
+
thread_id: data.thread_id,
|
|
3600
|
+
thread_model: data.thread_model,
|
|
3601
|
+
limit: 100,
|
|
3856
3602
|
with_context: {
|
|
3857
|
-
lang: data.lang
|
|
3858
|
-
allowed_company_ids: [1],
|
|
3859
|
-
uid: 2,
|
|
3860
|
-
search_default_my_ticket: true,
|
|
3861
|
-
search_default_is_open: true
|
|
3862
|
-
},
|
|
3863
|
-
ids: [data.id],
|
|
3864
|
-
kwargs: {
|
|
3865
|
-
vals,
|
|
3866
|
-
specification: {}
|
|
3603
|
+
lang: data.lang
|
|
3867
3604
|
}
|
|
3868
3605
|
};
|
|
3869
|
-
return env.requests.post("/
|
|
3606
|
+
return env.requests.post("/chatter/thread/messages" /* GET_MESSAGE */, jsonData, {
|
|
3870
3607
|
headers: {
|
|
3871
3608
|
"Content-Type": "application/json"
|
|
3872
3609
|
}
|
|
3873
3610
|
});
|
|
3874
|
-
})
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
getGroups(_0) {
|
|
3882
|
-
return __async(this, arguments, function* ({
|
|
3883
|
-
model,
|
|
3884
|
-
width_context
|
|
3885
|
-
}) {
|
|
3611
|
+
} catch (error) {
|
|
3612
|
+
console.error("Error when sending message:", error);
|
|
3613
|
+
throw error;
|
|
3614
|
+
}
|
|
3615
|
+
},
|
|
3616
|
+
async sentComment({ data }) {
|
|
3617
|
+
try {
|
|
3886
3618
|
const env = getEnv();
|
|
3887
|
-
const
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3619
|
+
const jsonData = {
|
|
3620
|
+
context: {
|
|
3621
|
+
tz: "Asia/Saigon",
|
|
3622
|
+
uid: 2,
|
|
3623
|
+
allowed_company_ids: [1],
|
|
3624
|
+
mail_post_autofollow: false,
|
|
3625
|
+
temporary_id: 142183.01
|
|
3626
|
+
},
|
|
3627
|
+
post_data: {
|
|
3628
|
+
body: data.message,
|
|
3629
|
+
message_type: "comment",
|
|
3630
|
+
attachment_ids: data.attachment_ids,
|
|
3631
|
+
attachment_tokens: [],
|
|
3632
|
+
subtype_xmlid: data.subtype
|
|
3894
3633
|
},
|
|
3895
|
-
|
|
3634
|
+
thread_id: Number(data.thread_id),
|
|
3635
|
+
thread_model: data.thread_model
|
|
3896
3636
|
};
|
|
3897
|
-
return env.requests.post("/
|
|
3637
|
+
return env.requests.post("/chatter/message/post" /* SENT_MESSAGE */, jsonData, {
|
|
3898
3638
|
headers: {
|
|
3899
3639
|
"Content-Type": "application/json"
|
|
3900
3640
|
}
|
|
3901
3641
|
});
|
|
3902
|
-
})
|
|
3642
|
+
} catch (error) {
|
|
3643
|
+
console.error("Error when sent message:", error);
|
|
3644
|
+
throw error;
|
|
3645
|
+
}
|
|
3903
3646
|
},
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
field,
|
|
3907
|
-
color,
|
|
3908
|
-
model,
|
|
3909
|
-
width_context
|
|
3910
|
-
}) {
|
|
3647
|
+
async deleteComment({ data }) {
|
|
3648
|
+
try {
|
|
3911
3649
|
const env = getEnv();
|
|
3912
|
-
const
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
group_by: "stage_id",
|
|
3918
|
-
progress_bar: {
|
|
3919
|
-
colors: color,
|
|
3920
|
-
field
|
|
3921
|
-
}
|
|
3922
|
-
},
|
|
3923
|
-
width_context
|
|
3650
|
+
const jsonData = {
|
|
3651
|
+
attachment_ids: [],
|
|
3652
|
+
attachment_tokens: [],
|
|
3653
|
+
body: "",
|
|
3654
|
+
message_id: data.message_id
|
|
3924
3655
|
};
|
|
3925
|
-
return env.requests.post("/
|
|
3656
|
+
return env.requests.post("/chatter/message/update_content" /* DELETE_MESSAGE */, jsonData, {
|
|
3926
3657
|
headers: {
|
|
3927
3658
|
"Content-Type": "application/json"
|
|
3928
3659
|
}
|
|
3929
3660
|
});
|
|
3930
|
-
})
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
var ModelService = {
|
|
3938
|
-
getListMyBankAccount(_0) {
|
|
3939
|
-
return __async(this, arguments, function* ({
|
|
3940
|
-
domain,
|
|
3941
|
-
spectification,
|
|
3942
|
-
model
|
|
3943
|
-
}) {
|
|
3661
|
+
} catch (error) {
|
|
3662
|
+
console.error("Error when sent message:", error);
|
|
3663
|
+
throw error;
|
|
3664
|
+
}
|
|
3665
|
+
},
|
|
3666
|
+
async getImage({ data }) {
|
|
3667
|
+
try {
|
|
3944
3668
|
const env = getEnv();
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
limit: 100,
|
|
3952
|
-
offset: 0
|
|
3953
|
-
}
|
|
3954
|
-
};
|
|
3955
|
-
return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3956
|
-
headers: {
|
|
3957
|
-
"Content-Type": "application/json"
|
|
3669
|
+
return env.requests.get(
|
|
3670
|
+
`${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
|
|
3671
|
+
{
|
|
3672
|
+
headers: {
|
|
3673
|
+
"Content-Type": "application/json"
|
|
3674
|
+
}
|
|
3958
3675
|
}
|
|
3959
|
-
|
|
3960
|
-
})
|
|
3676
|
+
);
|
|
3677
|
+
} catch (error) {
|
|
3678
|
+
console.error("Error when sent message:", error);
|
|
3679
|
+
throw error;
|
|
3680
|
+
}
|
|
3961
3681
|
},
|
|
3962
|
-
|
|
3963
|
-
|
|
3682
|
+
async uploadImage({ data }) {
|
|
3683
|
+
try {
|
|
3964
3684
|
const env = getEnv();
|
|
3965
|
-
|
|
3966
|
-
model: "res.currency",
|
|
3967
|
-
method: "web_search_read",
|
|
3968
|
-
kwargs: {
|
|
3969
|
-
specification: {
|
|
3970
|
-
icon_url: {},
|
|
3971
|
-
name: {}
|
|
3972
|
-
},
|
|
3973
|
-
domain: [["active", "=", true]],
|
|
3974
|
-
limit: 100,
|
|
3975
|
-
offset: 0
|
|
3976
|
-
}
|
|
3977
|
-
};
|
|
3978
|
-
return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3685
|
+
return env.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
|
|
3979
3686
|
headers: {
|
|
3980
|
-
"Content-Type": "
|
|
3687
|
+
"Content-Type": "multipart/form-data"
|
|
3981
3688
|
}
|
|
3982
3689
|
});
|
|
3983
|
-
})
|
|
3690
|
+
} catch (error) {
|
|
3691
|
+
console.error("Error when sent message:", error);
|
|
3692
|
+
throw error;
|
|
3693
|
+
}
|
|
3984
3694
|
},
|
|
3985
|
-
|
|
3986
|
-
|
|
3695
|
+
async getFormView({ data }) {
|
|
3696
|
+
try {
|
|
3987
3697
|
const env = getEnv();
|
|
3988
3698
|
const jsonData = {
|
|
3989
|
-
model:
|
|
3990
|
-
method: "
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
name: {},
|
|
3994
|
-
icon_url: {},
|
|
3995
|
-
rate_ids: {
|
|
3996
|
-
fields: {
|
|
3997
|
-
company_rate: {},
|
|
3998
|
-
sell: {}
|
|
3999
|
-
}
|
|
4000
|
-
}
|
|
4001
|
-
},
|
|
4002
|
-
domain: [["active", "=", true]],
|
|
4003
|
-
limit: 100,
|
|
4004
|
-
offset: 0
|
|
4005
|
-
}
|
|
3699
|
+
model: data.model,
|
|
3700
|
+
method: "get_formview_action",
|
|
3701
|
+
ids: data.id ? [data.id] : [],
|
|
3702
|
+
with_context: data.context
|
|
4006
3703
|
};
|
|
4007
|
-
return env
|
|
3704
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4008
3705
|
headers: {
|
|
4009
3706
|
"Content-Type": "application/json"
|
|
4010
3707
|
}
|
|
4011
3708
|
});
|
|
3709
|
+
} catch (error) {
|
|
3710
|
+
console.error("Error when fetching form view:", error);
|
|
3711
|
+
throw error;
|
|
3712
|
+
}
|
|
3713
|
+
},
|
|
3714
|
+
async changeStatus({ data }) {
|
|
3715
|
+
const env = getEnv();
|
|
3716
|
+
const vals = {
|
|
3717
|
+
[data.name]: data.stage_id
|
|
3718
|
+
};
|
|
3719
|
+
const jsonData = {
|
|
3720
|
+
model: data.model,
|
|
3721
|
+
method: "web_save",
|
|
3722
|
+
with_context: {
|
|
3723
|
+
lang: data.lang,
|
|
3724
|
+
allowed_company_ids: [1],
|
|
3725
|
+
uid: 2,
|
|
3726
|
+
search_default_my_ticket: true,
|
|
3727
|
+
search_default_is_open: true
|
|
3728
|
+
},
|
|
3729
|
+
ids: [data.id],
|
|
3730
|
+
kwargs: {
|
|
3731
|
+
vals,
|
|
3732
|
+
specification: {}
|
|
3733
|
+
}
|
|
3734
|
+
};
|
|
3735
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3736
|
+
headers: {
|
|
3737
|
+
"Content-Type": "application/json"
|
|
3738
|
+
}
|
|
3739
|
+
});
|
|
3740
|
+
}
|
|
3741
|
+
};
|
|
3742
|
+
var form_service_default = FormService;
|
|
3743
|
+
|
|
3744
|
+
// src/services/kanban-service/index.ts
|
|
3745
|
+
var KanbanServices = {
|
|
3746
|
+
async getGroups({
|
|
3747
|
+
model,
|
|
3748
|
+
width_context
|
|
3749
|
+
}) {
|
|
3750
|
+
const env = getEnv();
|
|
3751
|
+
const jsonDataView = {
|
|
3752
|
+
model,
|
|
3753
|
+
method: "web_read_group",
|
|
3754
|
+
kwargs: {
|
|
3755
|
+
domain: [["stage_id.fold", "=", false]],
|
|
3756
|
+
fields: ["color:sum"],
|
|
3757
|
+
groupby: ["stage_id"]
|
|
3758
|
+
},
|
|
3759
|
+
width_context
|
|
3760
|
+
};
|
|
3761
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
3762
|
+
headers: {
|
|
3763
|
+
"Content-Type": "application/json"
|
|
3764
|
+
}
|
|
4012
3765
|
});
|
|
4013
3766
|
},
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
kwargs: __spreadValues({
|
|
4031
|
-
domain: data.domain,
|
|
4032
|
-
limit: data.limit,
|
|
4033
|
-
offset: data.offset
|
|
4034
|
-
}, jsonReadGroup)
|
|
4035
|
-
};
|
|
4036
|
-
return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4037
|
-
headers: {
|
|
4038
|
-
"Content-Type": "application/json"
|
|
3767
|
+
async getProgressBar({
|
|
3768
|
+
field,
|
|
3769
|
+
color,
|
|
3770
|
+
model,
|
|
3771
|
+
width_context
|
|
3772
|
+
}) {
|
|
3773
|
+
const env = getEnv();
|
|
3774
|
+
const jsonDataView = {
|
|
3775
|
+
model,
|
|
3776
|
+
method: "read_progress_bar",
|
|
3777
|
+
kwargs: {
|
|
3778
|
+
domain: [],
|
|
3779
|
+
group_by: "stage_id",
|
|
3780
|
+
progress_bar: {
|
|
3781
|
+
colors: color,
|
|
3782
|
+
field
|
|
4039
3783
|
}
|
|
4040
|
-
}
|
|
3784
|
+
},
|
|
3785
|
+
width_context
|
|
3786
|
+
};
|
|
3787
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
3788
|
+
headers: {
|
|
3789
|
+
"Content-Type": "application/json"
|
|
3790
|
+
}
|
|
3791
|
+
});
|
|
3792
|
+
}
|
|
3793
|
+
};
|
|
3794
|
+
var kanban_service_default = KanbanServices;
|
|
3795
|
+
|
|
3796
|
+
// src/services/model-service/index.ts
|
|
3797
|
+
var OBJECT_POSITION = 2;
|
|
3798
|
+
var ModelService = {
|
|
3799
|
+
async getListMyBankAccount({
|
|
3800
|
+
domain,
|
|
3801
|
+
spectification,
|
|
3802
|
+
model
|
|
3803
|
+
}) {
|
|
3804
|
+
const env = getEnv();
|
|
3805
|
+
const jsonData = {
|
|
3806
|
+
model,
|
|
3807
|
+
method: "web_search_read",
|
|
3808
|
+
kwargs: {
|
|
3809
|
+
specification: spectification,
|
|
3810
|
+
domain,
|
|
3811
|
+
limit: 100,
|
|
3812
|
+
offset: 0
|
|
3813
|
+
}
|
|
3814
|
+
};
|
|
3815
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3816
|
+
headers: {
|
|
3817
|
+
"Content-Type": "application/json"
|
|
3818
|
+
}
|
|
4041
3819
|
});
|
|
4042
3820
|
},
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
3821
|
+
async getCurrency() {
|
|
3822
|
+
const env = getEnv();
|
|
3823
|
+
const jsonData = {
|
|
3824
|
+
model: "res.currency",
|
|
3825
|
+
method: "web_search_read",
|
|
3826
|
+
kwargs: {
|
|
3827
|
+
specification: {
|
|
3828
|
+
icon_url: {},
|
|
3829
|
+
name: {}
|
|
3830
|
+
},
|
|
3831
|
+
domain: [["active", "=", true]],
|
|
3832
|
+
limit: 100,
|
|
3833
|
+
offset: 0
|
|
3834
|
+
}
|
|
3835
|
+
};
|
|
3836
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3837
|
+
headers: {
|
|
3838
|
+
"Content-Type": "application/json"
|
|
3839
|
+
}
|
|
3840
|
+
});
|
|
3841
|
+
},
|
|
3842
|
+
async getConversionRate() {
|
|
3843
|
+
const env = getEnv();
|
|
3844
|
+
const jsonData = {
|
|
3845
|
+
model: "res.currency",
|
|
3846
|
+
method: "web_search_read",
|
|
3847
|
+
kwargs: {
|
|
3848
|
+
specification: {
|
|
3849
|
+
name: {},
|
|
3850
|
+
icon_url: {},
|
|
3851
|
+
rate_ids: {
|
|
3852
|
+
fields: {
|
|
3853
|
+
company_rate: {},
|
|
3854
|
+
sell: {}
|
|
3855
|
+
}
|
|
3856
|
+
}
|
|
3857
|
+
},
|
|
3858
|
+
domain: [["active", "=", true]],
|
|
3859
|
+
limit: 100,
|
|
3860
|
+
offset: 0
|
|
3861
|
+
}
|
|
3862
|
+
};
|
|
3863
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3864
|
+
headers: {
|
|
3865
|
+
"Content-Type": "application/json"
|
|
3866
|
+
}
|
|
3867
|
+
});
|
|
3868
|
+
},
|
|
3869
|
+
async getAll({ data }) {
|
|
3870
|
+
const env = getEnv();
|
|
3871
|
+
const jsonReadGroup = data.type == "calendar" ? { fields: data?.fields } : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
3872
|
+
fields: data.fields,
|
|
3873
|
+
groupby: data.groupby
|
|
3874
|
+
} : {
|
|
3875
|
+
count_limit: 10001,
|
|
3876
|
+
order: data.sort,
|
|
3877
|
+
specification: data.specification
|
|
3878
|
+
};
|
|
3879
|
+
const jsonData = {
|
|
3880
|
+
model: String(data.model),
|
|
3881
|
+
method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
|
|
3882
|
+
ids: data.ids,
|
|
3883
|
+
with_context: data.context,
|
|
3884
|
+
kwargs: {
|
|
3885
|
+
domain: data.domain,
|
|
3886
|
+
limit: data.limit,
|
|
3887
|
+
offset: data.offset,
|
|
3888
|
+
...jsonReadGroup
|
|
3889
|
+
}
|
|
3890
|
+
};
|
|
3891
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3892
|
+
headers: {
|
|
3893
|
+
"Content-Type": "application/json"
|
|
3894
|
+
}
|
|
3895
|
+
});
|
|
3896
|
+
},
|
|
3897
|
+
async getListCalendar({ data }) {
|
|
3898
|
+
const env = getEnv();
|
|
3899
|
+
const jsonReadGroup = data.type == "calendar" ? data?.fields : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
3900
|
+
fields: data.fields,
|
|
3901
|
+
groupby: data.groupby
|
|
3902
|
+
} : {
|
|
3903
|
+
count_limit: 10001,
|
|
3904
|
+
order: data.sort,
|
|
3905
|
+
specification: data.specification
|
|
3906
|
+
};
|
|
3907
|
+
const jsonData = {
|
|
3908
|
+
model: String(data.model),
|
|
3909
|
+
method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
|
|
3910
|
+
ids: data.ids,
|
|
3911
|
+
with_context: data.context,
|
|
3912
|
+
kwargs: {
|
|
3913
|
+
domain: data.domain,
|
|
3914
|
+
limit: data.limit,
|
|
3915
|
+
offset: data.offset,
|
|
4047
3916
|
fields: data.fields,
|
|
4048
|
-
|
|
4049
|
-
}
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
model: String(data.model),
|
|
4056
|
-
method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
|
|
4057
|
-
ids: data.ids,
|
|
4058
|
-
with_context: data.context,
|
|
4059
|
-
kwargs: __spreadValues({
|
|
4060
|
-
domain: data.domain,
|
|
4061
|
-
limit: data.limit,
|
|
4062
|
-
offset: data.offset,
|
|
4063
|
-
fields: data.fields
|
|
4064
|
-
}, jsonReadGroup)
|
|
4065
|
-
};
|
|
4066
|
-
return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4067
|
-
headers: {
|
|
4068
|
-
"Content-Type": "application/json"
|
|
4069
|
-
}
|
|
4070
|
-
});
|
|
3917
|
+
...jsonReadGroup
|
|
3918
|
+
}
|
|
3919
|
+
};
|
|
3920
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3921
|
+
headers: {
|
|
3922
|
+
"Content-Type": "application/json"
|
|
3923
|
+
}
|
|
4071
3924
|
});
|
|
4072
3925
|
},
|
|
4073
|
-
getList(
|
|
4074
|
-
|
|
3926
|
+
async getList({
|
|
3927
|
+
model,
|
|
3928
|
+
ids = [],
|
|
3929
|
+
specification = {},
|
|
3930
|
+
domain = [],
|
|
3931
|
+
offset,
|
|
3932
|
+
order,
|
|
3933
|
+
context = {},
|
|
3934
|
+
limit = 10
|
|
3935
|
+
}) {
|
|
3936
|
+
const env = getEnv();
|
|
3937
|
+
const jsonData = {
|
|
4075
3938
|
model,
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
kwargs: {
|
|
4092
|
-
specification,
|
|
4093
|
-
domain,
|
|
4094
|
-
limit,
|
|
4095
|
-
offset,
|
|
4096
|
-
order
|
|
4097
|
-
}
|
|
4098
|
-
};
|
|
4099
|
-
return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
4100
|
-
headers: {
|
|
4101
|
-
"Content-Type": "application/json"
|
|
4102
|
-
}
|
|
4103
|
-
});
|
|
3939
|
+
method: "web_search_read" /* WEB_SEARCH_READ */,
|
|
3940
|
+
ids,
|
|
3941
|
+
with_context: context,
|
|
3942
|
+
kwargs: {
|
|
3943
|
+
specification,
|
|
3944
|
+
domain,
|
|
3945
|
+
limit,
|
|
3946
|
+
offset,
|
|
3947
|
+
order
|
|
3948
|
+
}
|
|
3949
|
+
};
|
|
3950
|
+
return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
3951
|
+
headers: {
|
|
3952
|
+
"Content-Type": "application/json"
|
|
3953
|
+
}
|
|
4104
3954
|
});
|
|
4105
3955
|
},
|
|
4106
|
-
getDetail(
|
|
4107
|
-
|
|
4108
|
-
|
|
3956
|
+
async getDetail({
|
|
3957
|
+
ids = [],
|
|
3958
|
+
model,
|
|
3959
|
+
specification,
|
|
3960
|
+
context
|
|
3961
|
+
}) {
|
|
3962
|
+
const env = getEnv();
|
|
3963
|
+
const jsonData = {
|
|
4109
3964
|
model,
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
specification
|
|
4122
|
-
}
|
|
4123
|
-
};
|
|
4124
|
-
return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
4125
|
-
headers: {
|
|
4126
|
-
"Content-Type": "application/json"
|
|
4127
|
-
}
|
|
4128
|
-
});
|
|
3965
|
+
method: "web_read" /* WEB_READ */,
|
|
3966
|
+
ids,
|
|
3967
|
+
with_context: context,
|
|
3968
|
+
kwargs: {
|
|
3969
|
+
specification
|
|
3970
|
+
}
|
|
3971
|
+
};
|
|
3972
|
+
return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
3973
|
+
headers: {
|
|
3974
|
+
"Content-Type": "application/json"
|
|
3975
|
+
}
|
|
4129
3976
|
});
|
|
4130
3977
|
},
|
|
4131
|
-
save(
|
|
4132
|
-
|
|
3978
|
+
async save({
|
|
3979
|
+
model,
|
|
3980
|
+
ids = [],
|
|
3981
|
+
data = {},
|
|
3982
|
+
specification = {},
|
|
3983
|
+
context = {},
|
|
3984
|
+
path
|
|
3985
|
+
}) {
|
|
3986
|
+
const env = getEnv();
|
|
3987
|
+
const jsonData = {
|
|
4133
3988
|
model,
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
ids,
|
|
4147
|
-
kwargs: {
|
|
4148
|
-
vals: data,
|
|
4149
|
-
specification
|
|
4150
|
-
}
|
|
4151
|
-
};
|
|
4152
|
-
return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post(path != null ? path : "/call" /* CALL_PATH */, jsonData, {
|
|
4153
|
-
headers: {
|
|
4154
|
-
"Content-Type": "application/json"
|
|
4155
|
-
}
|
|
4156
|
-
});
|
|
3989
|
+
method: "web_save" /* WEB_SAVE */,
|
|
3990
|
+
with_context: context,
|
|
3991
|
+
ids,
|
|
3992
|
+
kwargs: {
|
|
3993
|
+
vals: data,
|
|
3994
|
+
specification
|
|
3995
|
+
}
|
|
3996
|
+
};
|
|
3997
|
+
return env?.requests?.post(path ?? "/call" /* CALL_PATH */, jsonData, {
|
|
3998
|
+
headers: {
|
|
3999
|
+
"Content-Type": "application/json"
|
|
4000
|
+
}
|
|
4157
4001
|
});
|
|
4158
4002
|
},
|
|
4159
|
-
delete(
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
"Content-Type": "application/json"
|
|
4171
|
-
}
|
|
4172
|
-
});
|
|
4003
|
+
async delete({ ids = [], model }) {
|
|
4004
|
+
const env = getEnv();
|
|
4005
|
+
const jsonData = {
|
|
4006
|
+
model,
|
|
4007
|
+
method: "unlink" /* UNLINK */,
|
|
4008
|
+
ids
|
|
4009
|
+
};
|
|
4010
|
+
return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4011
|
+
headers: {
|
|
4012
|
+
"Content-Type": "application/json"
|
|
4013
|
+
}
|
|
4173
4014
|
});
|
|
4174
4015
|
},
|
|
4175
|
-
onChange(
|
|
4176
|
-
|
|
4177
|
-
|
|
4016
|
+
async onChange({
|
|
4017
|
+
ids = [],
|
|
4018
|
+
model,
|
|
4019
|
+
object,
|
|
4020
|
+
specification,
|
|
4021
|
+
context,
|
|
4022
|
+
fieldChange
|
|
4023
|
+
}) {
|
|
4024
|
+
const env = getEnv();
|
|
4025
|
+
const jsonData = {
|
|
4178
4026
|
model,
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
context,
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
object ? object : {},
|
|
4193
|
-
fieldChange ? fieldChange : [],
|
|
4194
|
-
specification
|
|
4195
|
-
]
|
|
4196
|
-
};
|
|
4197
|
-
return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
4198
|
-
headers: {
|
|
4199
|
-
"Content-Type": "application/json"
|
|
4200
|
-
}
|
|
4201
|
-
});
|
|
4027
|
+
method: "onchange" /* ONCHANGE */,
|
|
4028
|
+
ids,
|
|
4029
|
+
with_context: context,
|
|
4030
|
+
args: [
|
|
4031
|
+
object ? object : {},
|
|
4032
|
+
fieldChange ? fieldChange : [],
|
|
4033
|
+
specification
|
|
4034
|
+
]
|
|
4035
|
+
};
|
|
4036
|
+
return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4037
|
+
headers: {
|
|
4038
|
+
"Content-Type": "application/json"
|
|
4039
|
+
}
|
|
4202
4040
|
});
|
|
4203
4041
|
},
|
|
4204
|
-
getListFieldsOnchange(
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
"Content-Type": "application/json"
|
|
4215
|
-
}
|
|
4216
|
-
});
|
|
4042
|
+
async getListFieldsOnchange({ model }) {
|
|
4043
|
+
const env = getEnv();
|
|
4044
|
+
const jsonData = {
|
|
4045
|
+
model,
|
|
4046
|
+
method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
|
|
4047
|
+
};
|
|
4048
|
+
return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4049
|
+
headers: {
|
|
4050
|
+
"Content-Type": "application/json"
|
|
4051
|
+
}
|
|
4217
4052
|
});
|
|
4218
4053
|
},
|
|
4219
4054
|
parseORMOdoo(data) {
|
|
@@ -4227,14 +4062,13 @@ var ModelService = {
|
|
|
4227
4062
|
data[key] = "/";
|
|
4228
4063
|
}
|
|
4229
4064
|
}
|
|
4230
|
-
return
|
|
4065
|
+
return { ...data };
|
|
4231
4066
|
},
|
|
4232
4067
|
toDataJS(data, viewData, model) {
|
|
4233
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
4234
4068
|
for (const key in data) {
|
|
4235
4069
|
if (data[key] === false) {
|
|
4236
4070
|
if (viewData && model) {
|
|
4237
|
-
if (
|
|
4071
|
+
if (viewData?.models?.[model]?.[key]?.type !== "boolean" /* BOOLEAN */) {
|
|
4238
4072
|
data[key] = null;
|
|
4239
4073
|
}
|
|
4240
4074
|
} else {
|
|
@@ -4244,13 +4078,12 @@ var ModelService = {
|
|
|
4244
4078
|
data[key] = "Draft";
|
|
4245
4079
|
} else if (data[key] !== false) {
|
|
4246
4080
|
if (model !== void 0) {
|
|
4247
|
-
if (
|
|
4248
|
-
data[key] = (
|
|
4249
|
-
|
|
4250
|
-
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;
|
|
4081
|
+
if (viewData?.models?.[model]?.[key]?.type === "one2many" /* ONE2MANY */ || viewData?.models?.[model]?.[key]?.type === "many2many" /* MANY2MANY */) {
|
|
4082
|
+
data[key] = (data[key] ??= [])?.map((item) => {
|
|
4083
|
+
const relation = viewData?.models?.[model]?.[key]?.relation;
|
|
4251
4084
|
if (relation !== void 0) {
|
|
4252
|
-
if (
|
|
4253
|
-
if (
|
|
4085
|
+
if (viewData?.models?.[relation]) {
|
|
4086
|
+
if (item?.length >= 3) {
|
|
4254
4087
|
return ModelService.toDataJS(
|
|
4255
4088
|
item[OBJECT_POSITION],
|
|
4256
4089
|
viewData,
|
|
@@ -4260,7 +4093,7 @@ var ModelService = {
|
|
|
4260
4093
|
return ModelService.toDataJS(item, viewData, relation);
|
|
4261
4094
|
}
|
|
4262
4095
|
} else {
|
|
4263
|
-
if (
|
|
4096
|
+
if (item?.length >= 3) {
|
|
4264
4097
|
return item[OBJECT_POSITION];
|
|
4265
4098
|
} else {
|
|
4266
4099
|
return item;
|
|
@@ -4272,569 +4105,527 @@ var ModelService = {
|
|
|
4272
4105
|
}
|
|
4273
4106
|
}
|
|
4274
4107
|
}
|
|
4275
|
-
return
|
|
4108
|
+
return { ...data };
|
|
4276
4109
|
}
|
|
4277
4110
|
};
|
|
4278
4111
|
var model_service_default = ModelService;
|
|
4279
4112
|
|
|
4280
4113
|
// src/services/user-service/index.ts
|
|
4281
4114
|
var UserService = {
|
|
4282
|
-
getProfile(path) {
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
}
|
|
4289
|
-
});
|
|
4115
|
+
async getProfile(path) {
|
|
4116
|
+
const env = getEnv();
|
|
4117
|
+
return env.requests.get(path ?? "/userinfo" /* PROFILE_PATH */, {
|
|
4118
|
+
headers: {
|
|
4119
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
4120
|
+
}
|
|
4290
4121
|
});
|
|
4291
4122
|
},
|
|
4292
|
-
getUser(
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
display_name: {}
|
|
4318
|
-
}
|
|
4123
|
+
async getUser({ context, id }) {
|
|
4124
|
+
const env = getEnv();
|
|
4125
|
+
const jsonData = {
|
|
4126
|
+
model: "res.users",
|
|
4127
|
+
method: "web_read",
|
|
4128
|
+
ids: [id],
|
|
4129
|
+
with_context: context,
|
|
4130
|
+
kwargs: {
|
|
4131
|
+
specification: {
|
|
4132
|
+
display_name: {},
|
|
4133
|
+
image_1920: {},
|
|
4134
|
+
name: {},
|
|
4135
|
+
login: {},
|
|
4136
|
+
email: {},
|
|
4137
|
+
password: {},
|
|
4138
|
+
visible_group_id: {
|
|
4139
|
+
fields: {
|
|
4140
|
+
id: {},
|
|
4141
|
+
display_name: {}
|
|
4142
|
+
}
|
|
4143
|
+
},
|
|
4144
|
+
company_id: {
|
|
4145
|
+
fields: {
|
|
4146
|
+
id: {},
|
|
4147
|
+
display_name: {}
|
|
4319
4148
|
}
|
|
4320
4149
|
}
|
|
4321
4150
|
}
|
|
4322
|
-
}
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
}
|
|
4151
|
+
}
|
|
4152
|
+
};
|
|
4153
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4154
|
+
headers: {
|
|
4155
|
+
"Content-Type": "application/json"
|
|
4156
|
+
}
|
|
4328
4157
|
});
|
|
4329
4158
|
},
|
|
4330
|
-
switchUserLocale:
|
|
4331
|
-
var _a;
|
|
4159
|
+
switchUserLocale: async ({ id, values }) => {
|
|
4332
4160
|
const env = getEnv();
|
|
4333
4161
|
const jsonData = {
|
|
4334
4162
|
model: "res.users",
|
|
4335
4163
|
domain: [["id", "=", id]],
|
|
4336
4164
|
values
|
|
4337
4165
|
};
|
|
4338
|
-
return env
|
|
4166
|
+
return env?.requests.post(UriConstants?.CREATE_UPDATE_PATH, jsonData, {
|
|
4339
4167
|
headers: {
|
|
4340
4168
|
"Content-Type": "application/json"
|
|
4341
4169
|
}
|
|
4342
4170
|
});
|
|
4343
|
-
}
|
|
4171
|
+
}
|
|
4344
4172
|
};
|
|
4345
4173
|
var user_service_default = UserService;
|
|
4346
4174
|
|
|
4347
4175
|
// src/services/view-service/index.ts
|
|
4348
4176
|
var ViewService = {
|
|
4349
|
-
getView(
|
|
4350
|
-
|
|
4177
|
+
async getView({
|
|
4178
|
+
model,
|
|
4179
|
+
views,
|
|
4180
|
+
context = {},
|
|
4181
|
+
options = {},
|
|
4182
|
+
aid
|
|
4183
|
+
}) {
|
|
4184
|
+
const env = getEnv();
|
|
4185
|
+
const defaultOptions = {
|
|
4186
|
+
load_filters: true,
|
|
4187
|
+
toolbar: true,
|
|
4188
|
+
action_id: aid
|
|
4189
|
+
};
|
|
4190
|
+
const jsonDataView = {
|
|
4351
4191
|
model,
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
};
|
|
4364
|
-
const jsonDataView = {
|
|
4365
|
-
model,
|
|
4366
|
-
method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
|
|
4367
|
-
kwargs: {
|
|
4368
|
-
views,
|
|
4369
|
-
options: __spreadValues(__spreadValues({}, options), defaultOptions)
|
|
4370
|
-
},
|
|
4371
|
-
with_context: context
|
|
4372
|
-
};
|
|
4373
|
-
return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
4374
|
-
headers: {
|
|
4375
|
-
"Content-Type": "application/json"
|
|
4376
|
-
}
|
|
4377
|
-
});
|
|
4192
|
+
method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
|
|
4193
|
+
kwargs: {
|
|
4194
|
+
views,
|
|
4195
|
+
options: { ...options, ...defaultOptions }
|
|
4196
|
+
},
|
|
4197
|
+
with_context: context
|
|
4198
|
+
};
|
|
4199
|
+
return env?.requests?.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
4200
|
+
headers: {
|
|
4201
|
+
"Content-Type": "application/json"
|
|
4202
|
+
}
|
|
4378
4203
|
});
|
|
4379
4204
|
},
|
|
4380
|
-
getMenu(context) {
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4205
|
+
async getMenu(context) {
|
|
4206
|
+
const env = getEnv();
|
|
4207
|
+
const jsonData = {
|
|
4208
|
+
model: "ir.ui.menu" /* MENU */,
|
|
4209
|
+
method: "web_search_read" /* WEB_SEARCH_READ */,
|
|
4210
|
+
ids: [],
|
|
4211
|
+
with_context: context,
|
|
4212
|
+
kwargs: {
|
|
4213
|
+
specification: {
|
|
4214
|
+
active: {},
|
|
4215
|
+
name: {},
|
|
4216
|
+
is_display: {},
|
|
4217
|
+
sequence: {},
|
|
4218
|
+
complete_name: {},
|
|
4219
|
+
action: {
|
|
4220
|
+
fields: {
|
|
4221
|
+
display_name: {},
|
|
4222
|
+
type: {},
|
|
4223
|
+
binding_view_types: {}
|
|
4224
|
+
// res_model: {},
|
|
4225
|
+
}
|
|
4226
|
+
},
|
|
4227
|
+
url_icon: {},
|
|
4228
|
+
web_icon: {},
|
|
4229
|
+
web_icon_data: {},
|
|
4230
|
+
groups_id: {
|
|
4231
|
+
fields: {
|
|
4232
|
+
full_name: {}
|
|
4403
4233
|
},
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4234
|
+
limit: 40,
|
|
4235
|
+
order: ""
|
|
4236
|
+
},
|
|
4237
|
+
display_name: {},
|
|
4238
|
+
child_id: {
|
|
4239
|
+
fields: {
|
|
4240
|
+
active: {},
|
|
4241
|
+
name: {},
|
|
4242
|
+
is_display: {},
|
|
4243
|
+
sequence: {},
|
|
4244
|
+
complete_name: {},
|
|
4245
|
+
action: {
|
|
4246
|
+
fields: {
|
|
4247
|
+
display_name: {},
|
|
4248
|
+
type: {},
|
|
4249
|
+
binding_view_types: {}
|
|
4250
|
+
// res_model: {},
|
|
4251
|
+
}
|
|
4410
4252
|
},
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
active: {},
|
|
4418
|
-
name: {},
|
|
4419
|
-
is_display: {},
|
|
4420
|
-
sequence: {},
|
|
4421
|
-
complete_name: {},
|
|
4422
|
-
action: {
|
|
4423
|
-
fields: {
|
|
4424
|
-
display_name: {},
|
|
4425
|
-
type: {},
|
|
4426
|
-
binding_view_types: {}
|
|
4427
|
-
// res_model: {},
|
|
4428
|
-
}
|
|
4253
|
+
url_icon: {},
|
|
4254
|
+
web_icon: {},
|
|
4255
|
+
web_icon_data: {},
|
|
4256
|
+
groups_id: {
|
|
4257
|
+
fields: {
|
|
4258
|
+
full_name: {}
|
|
4429
4259
|
},
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4260
|
+
limit: 40,
|
|
4261
|
+
order: ""
|
|
4262
|
+
},
|
|
4263
|
+
display_name: {},
|
|
4264
|
+
child_id: {
|
|
4265
|
+
fields: {
|
|
4266
|
+
active: {},
|
|
4267
|
+
name: {},
|
|
4268
|
+
is_display: {},
|
|
4269
|
+
sequence: {},
|
|
4270
|
+
complete_name: {},
|
|
4271
|
+
action: {
|
|
4272
|
+
fields: {
|
|
4273
|
+
display_name: {},
|
|
4274
|
+
type: {},
|
|
4275
|
+
binding_view_types: {}
|
|
4276
|
+
// res_model: {},
|
|
4277
|
+
}
|
|
4436
4278
|
},
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
active: {},
|
|
4444
|
-
name: {},
|
|
4445
|
-
is_display: {},
|
|
4446
|
-
sequence: {},
|
|
4447
|
-
complete_name: {},
|
|
4448
|
-
action: {
|
|
4449
|
-
fields: {
|
|
4450
|
-
display_name: {},
|
|
4451
|
-
type: {},
|
|
4452
|
-
binding_view_types: {}
|
|
4453
|
-
// res_model: {},
|
|
4454
|
-
}
|
|
4279
|
+
url_icon: {},
|
|
4280
|
+
web_icon: {},
|
|
4281
|
+
web_icon_data: {},
|
|
4282
|
+
groups_id: {
|
|
4283
|
+
fields: {
|
|
4284
|
+
full_name: {}
|
|
4455
4285
|
},
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4286
|
+
limit: 40,
|
|
4287
|
+
order: ""
|
|
4288
|
+
},
|
|
4289
|
+
display_name: {},
|
|
4290
|
+
child_id: {
|
|
4291
|
+
fields: {
|
|
4292
|
+
active: {},
|
|
4293
|
+
name: {},
|
|
4294
|
+
is_display: {},
|
|
4295
|
+
sequence: {},
|
|
4296
|
+
complete_name: {},
|
|
4297
|
+
action: {
|
|
4298
|
+
fields: {
|
|
4299
|
+
display_name: {},
|
|
4300
|
+
type: {},
|
|
4301
|
+
binding_view_types: {}
|
|
4302
|
+
// res_model: {},
|
|
4303
|
+
}
|
|
4462
4304
|
},
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
active: {},
|
|
4470
|
-
name: {},
|
|
4471
|
-
is_display: {},
|
|
4472
|
-
sequence: {},
|
|
4473
|
-
complete_name: {},
|
|
4474
|
-
action: {
|
|
4475
|
-
fields: {
|
|
4476
|
-
display_name: {},
|
|
4477
|
-
type: {},
|
|
4478
|
-
binding_view_types: {}
|
|
4479
|
-
// res_model: {},
|
|
4480
|
-
}
|
|
4481
|
-
},
|
|
4482
|
-
url_icon: {},
|
|
4483
|
-
web_icon: {},
|
|
4484
|
-
web_icon_data: {},
|
|
4485
|
-
groups_id: {
|
|
4486
|
-
fields: {
|
|
4487
|
-
full_name: {}
|
|
4488
|
-
},
|
|
4489
|
-
limit: 40,
|
|
4490
|
-
order: ""
|
|
4305
|
+
url_icon: {},
|
|
4306
|
+
web_icon: {},
|
|
4307
|
+
web_icon_data: {},
|
|
4308
|
+
groups_id: {
|
|
4309
|
+
fields: {
|
|
4310
|
+
full_name: {}
|
|
4491
4311
|
},
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
fields: {},
|
|
4495
|
-
limit: 40,
|
|
4496
|
-
order: ""
|
|
4497
|
-
}
|
|
4312
|
+
limit: 40,
|
|
4313
|
+
order: ""
|
|
4498
4314
|
},
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
"
|
|
4523
|
-
|
|
4524
|
-
|
|
4315
|
+
display_name: {},
|
|
4316
|
+
child_id: {
|
|
4317
|
+
fields: {},
|
|
4318
|
+
limit: 40,
|
|
4319
|
+
order: ""
|
|
4320
|
+
}
|
|
4321
|
+
},
|
|
4322
|
+
limit: 40,
|
|
4323
|
+
order: ""
|
|
4324
|
+
}
|
|
4325
|
+
},
|
|
4326
|
+
limit: 40,
|
|
4327
|
+
order: ""
|
|
4328
|
+
}
|
|
4329
|
+
},
|
|
4330
|
+
limit: 40,
|
|
4331
|
+
order: ""
|
|
4332
|
+
}
|
|
4333
|
+
},
|
|
4334
|
+
domain: [
|
|
4335
|
+
"&",
|
|
4336
|
+
["is_display", "=", true],
|
|
4337
|
+
"&",
|
|
4338
|
+
["active", "=", true],
|
|
4339
|
+
["parent_id", "=", false]
|
|
4340
|
+
]
|
|
4341
|
+
}
|
|
4342
|
+
};
|
|
4343
|
+
return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4344
|
+
headers: {
|
|
4345
|
+
"Content-Type": "application/json"
|
|
4346
|
+
}
|
|
4525
4347
|
});
|
|
4526
4348
|
},
|
|
4527
|
-
getActionDetail(aid, context) {
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
groups_id: {},
|
|
4547
|
-
search_view_id: {}
|
|
4548
|
-
}
|
|
4549
|
-
}
|
|
4550
|
-
};
|
|
4551
|
-
return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
4552
|
-
headers: {
|
|
4553
|
-
"Content-Type": "application/json"
|
|
4349
|
+
async getActionDetail(aid, context) {
|
|
4350
|
+
const env = getEnv();
|
|
4351
|
+
const jsonData = {
|
|
4352
|
+
model: "ir.actions.act_window" /* WINDOW_ACTION */,
|
|
4353
|
+
method: "web_read" /* WEB_READ */,
|
|
4354
|
+
ids: [aid],
|
|
4355
|
+
with_context: context,
|
|
4356
|
+
kwargs: {
|
|
4357
|
+
specification: {
|
|
4358
|
+
id: {},
|
|
4359
|
+
name: {},
|
|
4360
|
+
res_model: {},
|
|
4361
|
+
views: {},
|
|
4362
|
+
view_mode: {},
|
|
4363
|
+
mobile_view_mode: {},
|
|
4364
|
+
domain: {},
|
|
4365
|
+
context: {},
|
|
4366
|
+
groups_id: {},
|
|
4367
|
+
search_view_id: {}
|
|
4554
4368
|
}
|
|
4555
|
-
}
|
|
4369
|
+
}
|
|
4370
|
+
};
|
|
4371
|
+
return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4372
|
+
headers: {
|
|
4373
|
+
"Content-Type": "application/json"
|
|
4374
|
+
}
|
|
4556
4375
|
});
|
|
4557
4376
|
},
|
|
4558
|
-
getResequence(
|
|
4559
|
-
|
|
4377
|
+
async getResequence({
|
|
4378
|
+
model,
|
|
4379
|
+
ids,
|
|
4380
|
+
context,
|
|
4381
|
+
offset
|
|
4382
|
+
}) {
|
|
4383
|
+
const env = getEnv();
|
|
4384
|
+
const jsonData = {
|
|
4560
4385
|
model,
|
|
4386
|
+
with_context: context,
|
|
4561
4387
|
ids,
|
|
4562
|
-
|
|
4563
|
-
offset
|
|
4564
|
-
}
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
ids,
|
|
4570
|
-
field: "sequence"
|
|
4571
|
-
}, offset > 0 ? { offset } : {});
|
|
4572
|
-
return env == null ? void 0 : env.requests.post("/web/dataset/resequence", jsonData, {
|
|
4573
|
-
headers: {
|
|
4574
|
-
"Content-Type": "application/json"
|
|
4575
|
-
}
|
|
4576
|
-
});
|
|
4577
|
-
});
|
|
4578
|
-
},
|
|
4579
|
-
getSelectionItem(_0) {
|
|
4580
|
-
return __async(this, arguments, function* ({ data }) {
|
|
4581
|
-
var _a;
|
|
4582
|
-
const env = getEnv();
|
|
4583
|
-
const jsonData = {
|
|
4584
|
-
model: data.model,
|
|
4585
|
-
ids: [],
|
|
4586
|
-
method: "get_data_select",
|
|
4587
|
-
with_context: data.context,
|
|
4588
|
-
kwargs: {
|
|
4589
|
-
count_limit: 10001,
|
|
4590
|
-
domain: data.domain ? data.domain : [],
|
|
4591
|
-
offset: 0,
|
|
4592
|
-
order: "",
|
|
4593
|
-
specification: (_a = data == null ? void 0 : data.specification) != null ? _a : {
|
|
4594
|
-
id: {},
|
|
4595
|
-
name: {},
|
|
4596
|
-
display_name: {}
|
|
4597
|
-
}
|
|
4598
|
-
}
|
|
4599
|
-
};
|
|
4600
|
-
return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4601
|
-
headers: {
|
|
4602
|
-
"Content-Type": "application/json"
|
|
4603
|
-
}
|
|
4604
|
-
});
|
|
4388
|
+
field: "sequence",
|
|
4389
|
+
...offset > 0 ? { offset } : {}
|
|
4390
|
+
};
|
|
4391
|
+
return env?.requests.post("/web/dataset/resequence", jsonData, {
|
|
4392
|
+
headers: {
|
|
4393
|
+
"Content-Type": "application/json"
|
|
4394
|
+
}
|
|
4605
4395
|
});
|
|
4606
4396
|
},
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4397
|
+
async getSelectionItem({ data }) {
|
|
4398
|
+
const env = getEnv();
|
|
4399
|
+
const jsonData = {
|
|
4400
|
+
model: data.model,
|
|
4401
|
+
ids: [],
|
|
4402
|
+
method: "get_data_select",
|
|
4403
|
+
with_context: data.context,
|
|
4404
|
+
kwargs: {
|
|
4405
|
+
count_limit: 10001,
|
|
4406
|
+
domain: data.domain ? data.domain : [],
|
|
4407
|
+
offset: 0,
|
|
4408
|
+
order: "",
|
|
4409
|
+
specification: data?.specification ?? {
|
|
4410
|
+
id: {},
|
|
4411
|
+
name: {},
|
|
4412
|
+
display_name: {}
|
|
4617
4413
|
}
|
|
4618
|
-
|
|
4414
|
+
}
|
|
4415
|
+
};
|
|
4416
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4417
|
+
headers: {
|
|
4418
|
+
"Content-Type": "application/json"
|
|
4419
|
+
}
|
|
4619
4420
|
});
|
|
4620
4421
|
},
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4422
|
+
async loadMessages() {
|
|
4423
|
+
const env = getEnv();
|
|
4424
|
+
return env.requests.post(
|
|
4425
|
+
"/load_message_failures" /* LOAD_MESSAGE */,
|
|
4426
|
+
{},
|
|
4427
|
+
{
|
|
4627
4428
|
headers: {
|
|
4628
4429
|
"Content-Type": "application/json"
|
|
4629
4430
|
}
|
|
4630
|
-
}
|
|
4431
|
+
}
|
|
4432
|
+
);
|
|
4433
|
+
},
|
|
4434
|
+
async getVersion() {
|
|
4435
|
+
const env = getEnv();
|
|
4436
|
+
console.log("env?.requests", env, env?.requests);
|
|
4437
|
+
return env?.requests?.get("", {
|
|
4438
|
+
headers: {
|
|
4439
|
+
"Content-Type": "application/json"
|
|
4440
|
+
}
|
|
4631
4441
|
});
|
|
4632
4442
|
},
|
|
4633
|
-
get2FAMethods(
|
|
4634
|
-
|
|
4443
|
+
async get2FAMethods({
|
|
4444
|
+
method,
|
|
4445
|
+
with_context
|
|
4446
|
+
}) {
|
|
4447
|
+
const env = getEnv();
|
|
4448
|
+
const jsonData = {
|
|
4635
4449
|
method,
|
|
4636
4450
|
with_context
|
|
4637
|
-
}
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
};
|
|
4643
|
-
return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4644
|
-
headers: {
|
|
4645
|
-
"Content-Type": "application/json"
|
|
4646
|
-
}
|
|
4647
|
-
});
|
|
4451
|
+
};
|
|
4452
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4453
|
+
headers: {
|
|
4454
|
+
"Content-Type": "application/json"
|
|
4455
|
+
}
|
|
4648
4456
|
});
|
|
4649
4457
|
},
|
|
4650
|
-
verify2FA(
|
|
4651
|
-
|
|
4458
|
+
async verify2FA({
|
|
4459
|
+
method,
|
|
4460
|
+
with_context,
|
|
4461
|
+
code,
|
|
4462
|
+
device,
|
|
4463
|
+
location
|
|
4464
|
+
}) {
|
|
4465
|
+
const env = getEnv();
|
|
4466
|
+
const jsonData = {
|
|
4652
4467
|
method,
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
},
|
|
4668
|
-
with_context
|
|
4669
|
-
};
|
|
4670
|
-
return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4671
|
-
headers: {
|
|
4672
|
-
"Content-Type": "application/json"
|
|
4673
|
-
},
|
|
4674
|
-
withCredentials: true
|
|
4675
|
-
});
|
|
4468
|
+
kwargs: {
|
|
4469
|
+
vals: {
|
|
4470
|
+
code,
|
|
4471
|
+
device,
|
|
4472
|
+
location
|
|
4473
|
+
}
|
|
4474
|
+
},
|
|
4475
|
+
with_context
|
|
4476
|
+
};
|
|
4477
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4478
|
+
headers: {
|
|
4479
|
+
"Content-Type": "application/json"
|
|
4480
|
+
},
|
|
4481
|
+
withCredentials: true
|
|
4676
4482
|
});
|
|
4677
4483
|
},
|
|
4678
|
-
signInSSO(
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4484
|
+
async signInSSO({
|
|
4485
|
+
redirect_uri,
|
|
4486
|
+
state,
|
|
4487
|
+
client_id,
|
|
4488
|
+
response_type,
|
|
4489
|
+
path
|
|
4490
|
+
}) {
|
|
4491
|
+
const env = getEnv();
|
|
4492
|
+
const params = new URLSearchParams({
|
|
4683
4493
|
response_type,
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
}
|
|
4693
|
-
|
|
4694
|
-
return env == null ? void 0 : env.requests.get(url, {
|
|
4695
|
-
headers: {
|
|
4696
|
-
"Content-Type": "application/json"
|
|
4697
|
-
},
|
|
4698
|
-
withCredentials: true
|
|
4699
|
-
});
|
|
4494
|
+
client_id,
|
|
4495
|
+
redirect_uri,
|
|
4496
|
+
state
|
|
4497
|
+
});
|
|
4498
|
+
const url = `${path}?${params.toString()}`;
|
|
4499
|
+
return env?.requests.get(url, {
|
|
4500
|
+
headers: {
|
|
4501
|
+
"Content-Type": "application/json"
|
|
4502
|
+
},
|
|
4503
|
+
withCredentials: true
|
|
4700
4504
|
});
|
|
4701
4505
|
},
|
|
4702
|
-
grantAccess(
|
|
4703
|
-
|
|
4506
|
+
async grantAccess({
|
|
4507
|
+
redirect_uri,
|
|
4508
|
+
state,
|
|
4509
|
+
client_id,
|
|
4510
|
+
scopes
|
|
4511
|
+
}) {
|
|
4512
|
+
const env = getEnv();
|
|
4513
|
+
const jsonData = {
|
|
4704
4514
|
redirect_uri,
|
|
4705
4515
|
state,
|
|
4706
4516
|
client_id,
|
|
4707
4517
|
scopes
|
|
4708
|
-
}
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
scopes
|
|
4715
|
-
};
|
|
4716
|
-
return env == null ? void 0 : env.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
|
|
4717
|
-
headers: {
|
|
4718
|
-
"Content-Type": "application/json"
|
|
4719
|
-
},
|
|
4720
|
-
withCredentials: true
|
|
4721
|
-
});
|
|
4518
|
+
};
|
|
4519
|
+
return env?.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
|
|
4520
|
+
headers: {
|
|
4521
|
+
"Content-Type": "application/json"
|
|
4522
|
+
},
|
|
4523
|
+
withCredentials: true
|
|
4722
4524
|
});
|
|
4723
4525
|
},
|
|
4724
|
-
getFieldsViewSecurity(
|
|
4725
|
-
|
|
4526
|
+
async getFieldsViewSecurity({
|
|
4527
|
+
method,
|
|
4528
|
+
token,
|
|
4529
|
+
views
|
|
4530
|
+
}) {
|
|
4531
|
+
const env = getEnv();
|
|
4532
|
+
const jsonData = {
|
|
4726
4533
|
method,
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
}
|
|
4739
|
-
};
|
|
4740
|
-
return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4741
|
-
headers: {
|
|
4742
|
-
"Content-Type": "application/json"
|
|
4743
|
-
}
|
|
4744
|
-
});
|
|
4534
|
+
kwargs: {
|
|
4535
|
+
views
|
|
4536
|
+
},
|
|
4537
|
+
with_context: {
|
|
4538
|
+
token
|
|
4539
|
+
}
|
|
4540
|
+
};
|
|
4541
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4542
|
+
headers: {
|
|
4543
|
+
"Content-Type": "application/json"
|
|
4544
|
+
}
|
|
4745
4545
|
});
|
|
4746
4546
|
},
|
|
4747
|
-
settingsWebRead2fa(
|
|
4748
|
-
|
|
4547
|
+
async settingsWebRead2fa({
|
|
4548
|
+
method,
|
|
4549
|
+
model,
|
|
4550
|
+
kwargs,
|
|
4551
|
+
token
|
|
4552
|
+
}) {
|
|
4553
|
+
const env = getEnv();
|
|
4554
|
+
const jsonData = {
|
|
4749
4555
|
method,
|
|
4750
4556
|
model,
|
|
4751
4557
|
kwargs,
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
token
|
|
4761
|
-
}
|
|
4762
|
-
};
|
|
4763
|
-
return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4764
|
-
headers: {
|
|
4765
|
-
"Content-Type": "application/json"
|
|
4766
|
-
}
|
|
4767
|
-
});
|
|
4558
|
+
with_context: {
|
|
4559
|
+
token
|
|
4560
|
+
}
|
|
4561
|
+
};
|
|
4562
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4563
|
+
headers: {
|
|
4564
|
+
"Content-Type": "application/json"
|
|
4565
|
+
}
|
|
4768
4566
|
});
|
|
4769
4567
|
},
|
|
4770
|
-
requestSetupTotp(
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
}
|
|
4783
|
-
});
|
|
4568
|
+
async requestSetupTotp({ method, token }) {
|
|
4569
|
+
const env = getEnv();
|
|
4570
|
+
const jsonData = {
|
|
4571
|
+
method,
|
|
4572
|
+
with_context: {
|
|
4573
|
+
token
|
|
4574
|
+
}
|
|
4575
|
+
};
|
|
4576
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4577
|
+
headers: {
|
|
4578
|
+
"Content-Type": "application/json"
|
|
4579
|
+
}
|
|
4784
4580
|
});
|
|
4785
4581
|
},
|
|
4786
|
-
verifyTotp(
|
|
4787
|
-
|
|
4582
|
+
async verifyTotp({
|
|
4583
|
+
method,
|
|
4584
|
+
action_token,
|
|
4585
|
+
code
|
|
4586
|
+
}) {
|
|
4587
|
+
const env = getEnv();
|
|
4588
|
+
const jsonData = {
|
|
4788
4589
|
method,
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
const env = getEnv();
|
|
4793
|
-
const jsonData = {
|
|
4794
|
-
method,
|
|
4795
|
-
kwargs: {
|
|
4796
|
-
vals: {
|
|
4797
|
-
code
|
|
4798
|
-
}
|
|
4799
|
-
},
|
|
4800
|
-
with_context: {
|
|
4801
|
-
action_token
|
|
4802
|
-
}
|
|
4803
|
-
};
|
|
4804
|
-
return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4805
|
-
headers: {
|
|
4806
|
-
"Content-Type": "application/json"
|
|
4590
|
+
kwargs: {
|
|
4591
|
+
vals: {
|
|
4592
|
+
code
|
|
4807
4593
|
}
|
|
4808
|
-
}
|
|
4594
|
+
},
|
|
4595
|
+
with_context: {
|
|
4596
|
+
action_token
|
|
4597
|
+
}
|
|
4598
|
+
};
|
|
4599
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4600
|
+
headers: {
|
|
4601
|
+
"Content-Type": "application/json"
|
|
4602
|
+
}
|
|
4809
4603
|
});
|
|
4810
4604
|
},
|
|
4811
|
-
removeTotpSetUp(
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
}
|
|
4824
|
-
});
|
|
4605
|
+
async removeTotpSetUp({ method, token }) {
|
|
4606
|
+
const env = getEnv();
|
|
4607
|
+
const jsonData = {
|
|
4608
|
+
method,
|
|
4609
|
+
with_context: {
|
|
4610
|
+
token
|
|
4611
|
+
}
|
|
4612
|
+
};
|
|
4613
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4614
|
+
headers: {
|
|
4615
|
+
"Content-Type": "application/json"
|
|
4616
|
+
}
|
|
4825
4617
|
});
|
|
4826
4618
|
}
|
|
4827
4619
|
};
|
|
4828
4620
|
var view_service_default = ViewService;
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
});
|
|
4621
|
+
export {
|
|
4622
|
+
action_service_default as ActionService,
|
|
4623
|
+
auth_service_default as AuthService,
|
|
4624
|
+
company_service_default as CompanyService,
|
|
4625
|
+
excel_service_default as ExcelService,
|
|
4626
|
+
form_service_default as FormService,
|
|
4627
|
+
kanban_service_default as KanbanService,
|
|
4628
|
+
model_service_default as ModelService,
|
|
4629
|
+
user_service_default as UserService,
|
|
4630
|
+
view_service_default as ViewService
|
|
4631
|
+
};
|