@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
package/dist/services.js
CHANGED
|
@@ -1,43 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
1
3
|
var __defProp = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var __spreadValues = (a, b) => {
|
|
10
|
-
for (var prop in b || (b = {}))
|
|
11
|
-
if (__hasOwnProp.call(b, prop))
|
|
12
|
-
__defNormalProp(a, prop, b[prop]);
|
|
13
|
-
if (__getOwnPropSymbols)
|
|
14
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
-
if (__propIsEnum.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
}
|
|
18
|
-
return a;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
11
|
};
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
reject(e);
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
var rejected = (value) => {
|
|
31
|
-
try {
|
|
32
|
-
step(generator.throw(value));
|
|
33
|
-
} catch (e) {
|
|
34
|
-
reject(e);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
38
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
39
|
-
});
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
40
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/services.ts
|
|
31
|
+
var services_exports = {};
|
|
32
|
+
__export(services_exports, {
|
|
33
|
+
ActionService: () => action_service_default,
|
|
34
|
+
AuthService: () => auth_service_default,
|
|
35
|
+
CompanyService: () => company_service_default,
|
|
36
|
+
ExcelService: () => excel_service_default,
|
|
37
|
+
FormService: () => form_service_default,
|
|
38
|
+
KanbanService: () => kanban_service_default,
|
|
39
|
+
ModelService: () => model_service_default,
|
|
40
|
+
UserService: () => user_service_default,
|
|
41
|
+
ViewService: () => view_service_default
|
|
42
|
+
});
|
|
43
|
+
module.exports = __toCommonJS(services_exports);
|
|
41
44
|
|
|
42
45
|
// src/constants/api/uri-constant.ts
|
|
43
46
|
var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
@@ -70,10 +73,10 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
|
70
73
|
})(UriConstants || {});
|
|
71
74
|
|
|
72
75
|
// src/configs/axios-client.ts
|
|
73
|
-
|
|
76
|
+
var import_axios = __toESM(require("axios"));
|
|
74
77
|
|
|
75
78
|
// src/utils/format.ts
|
|
76
|
-
|
|
79
|
+
var import_moment = __toESM(require("moment"));
|
|
77
80
|
|
|
78
81
|
// src/utils/domain/py_tokenizer.ts
|
|
79
82
|
var TokenizerError = class extends Error {
|
|
@@ -1153,6 +1156,22 @@ var PyRelativeDelta = class _PyRelativeDelta {
|
|
|
1153
1156
|
this.microsecond = params.microsecond;
|
|
1154
1157
|
this.weekday = params.weekday;
|
|
1155
1158
|
}
|
|
1159
|
+
years;
|
|
1160
|
+
months;
|
|
1161
|
+
days;
|
|
1162
|
+
hours;
|
|
1163
|
+
minutes;
|
|
1164
|
+
seconds;
|
|
1165
|
+
microseconds;
|
|
1166
|
+
leapDays;
|
|
1167
|
+
year;
|
|
1168
|
+
month;
|
|
1169
|
+
day;
|
|
1170
|
+
hour;
|
|
1171
|
+
minute;
|
|
1172
|
+
second;
|
|
1173
|
+
microsecond;
|
|
1174
|
+
weekday;
|
|
1156
1175
|
negate() {
|
|
1157
1176
|
return new _PyRelativeDelta(this, -1);
|
|
1158
1177
|
}
|
|
@@ -1267,7 +1286,7 @@ function execOnIterable(iterable, func) {
|
|
|
1267
1286
|
if (typeof iterable === "object" && !Array.isArray(iterable) && !(iterable instanceof Set)) {
|
|
1268
1287
|
iterable = Object.keys(iterable);
|
|
1269
1288
|
}
|
|
1270
|
-
if (typeof
|
|
1289
|
+
if (typeof iterable?.[Symbol.iterator] !== "function") {
|
|
1271
1290
|
throw new EvaluationError("value not iterable");
|
|
1272
1291
|
}
|
|
1273
1292
|
return func(iterable);
|
|
@@ -1590,7 +1609,7 @@ function applyBinaryOp(ast, context) {
|
|
|
1590
1609
|
}
|
|
1591
1610
|
return Math.floor(left / right);
|
|
1592
1611
|
case "**":
|
|
1593
|
-
return
|
|
1612
|
+
return left ** right;
|
|
1594
1613
|
case "==":
|
|
1595
1614
|
return isEqual(left, right);
|
|
1596
1615
|
case "<>":
|
|
@@ -1712,7 +1731,7 @@ function evaluate(ast, context = {}) {
|
|
|
1712
1731
|
const dicts = /* @__PURE__ */ new Set();
|
|
1713
1732
|
let pyContext;
|
|
1714
1733
|
const evalContext = Object.create(context);
|
|
1715
|
-
if (!
|
|
1734
|
+
if (!evalContext?.context) {
|
|
1716
1735
|
Object.defineProperty(evalContext, "context", {
|
|
1717
1736
|
get() {
|
|
1718
1737
|
if (!pyContext) {
|
|
@@ -1723,18 +1742,17 @@ function evaluate(ast, context = {}) {
|
|
|
1723
1742
|
});
|
|
1724
1743
|
}
|
|
1725
1744
|
function _innerEvaluate(ast2) {
|
|
1726
|
-
|
|
1727
|
-
switch (ast2 == null ? void 0 : ast2.type) {
|
|
1745
|
+
switch (ast2?.type) {
|
|
1728
1746
|
case 0:
|
|
1729
1747
|
// Number
|
|
1730
1748
|
case 1:
|
|
1731
1749
|
return ast2.value;
|
|
1732
1750
|
case 5:
|
|
1733
1751
|
if (ast2.value in evalContext) {
|
|
1734
|
-
if (typeof evalContext[ast2.value] === "object" &&
|
|
1735
|
-
return
|
|
1752
|
+
if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
|
|
1753
|
+
return evalContext[ast2.value]?.id;
|
|
1736
1754
|
}
|
|
1737
|
-
return
|
|
1755
|
+
return evalContext[ast2.value] ?? false;
|
|
1738
1756
|
} else if (ast2.value in BUILTINS) {
|
|
1739
1757
|
return BUILTINS[ast2.value];
|
|
1740
1758
|
} else {
|
|
@@ -1771,7 +1789,7 @@ function evaluate(ast, context = {}) {
|
|
|
1771
1789
|
const args = ast2.args.map(_evaluate);
|
|
1772
1790
|
const kwargs = {};
|
|
1773
1791
|
for (const kwarg in ast2.kwargs) {
|
|
1774
|
-
kwargs[kwarg] = _evaluate(ast2
|
|
1792
|
+
kwargs[kwarg] = _evaluate(ast2?.kwargs[kwarg]);
|
|
1775
1793
|
}
|
|
1776
1794
|
if (fnValue === PyDate || fnValue === PyDateTime || fnValue === PyTime || fnValue === PyRelativeDelta || fnValue === PyTimeDelta) {
|
|
1777
1795
|
return fnValue.create(...args, kwargs);
|
|
@@ -1850,25 +1868,9 @@ function escapeRegExp(str) {
|
|
|
1850
1868
|
var InvalidDomainError = class extends Error {
|
|
1851
1869
|
};
|
|
1852
1870
|
var Domain = class _Domain {
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
return new _Domain(descr.toString());
|
|
1857
|
-
} else {
|
|
1858
|
-
let rawAST;
|
|
1859
|
-
try {
|
|
1860
|
-
rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
|
|
1861
|
-
} catch (error) {
|
|
1862
|
-
throw new InvalidDomainError(
|
|
1863
|
-
`Invalid domain representation: ${descr}`,
|
|
1864
|
-
{
|
|
1865
|
-
cause: error
|
|
1866
|
-
}
|
|
1867
|
-
);
|
|
1868
|
-
}
|
|
1869
|
-
this.ast = normalizeDomainAST(rawAST);
|
|
1870
|
-
}
|
|
1871
|
-
}
|
|
1871
|
+
ast = { type: -1, value: null };
|
|
1872
|
+
static TRUE;
|
|
1873
|
+
static FALSE;
|
|
1872
1874
|
static combine(domains, operator) {
|
|
1873
1875
|
if (domains.length === 0) {
|
|
1874
1876
|
return new _Domain([]);
|
|
@@ -1947,6 +1949,24 @@ var Domain = class _Domain {
|
|
|
1947
1949
|
processLeaf(d.ast.value, 0, "&", newDomain);
|
|
1948
1950
|
return newDomain;
|
|
1949
1951
|
}
|
|
1952
|
+
constructor(descr = []) {
|
|
1953
|
+
if (descr instanceof _Domain) {
|
|
1954
|
+
return new _Domain(descr.toString());
|
|
1955
|
+
} else {
|
|
1956
|
+
let rawAST;
|
|
1957
|
+
try {
|
|
1958
|
+
rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
|
|
1959
|
+
} catch (error) {
|
|
1960
|
+
throw new InvalidDomainError(
|
|
1961
|
+
`Invalid domain representation: ${descr}`,
|
|
1962
|
+
{
|
|
1963
|
+
cause: error
|
|
1964
|
+
}
|
|
1965
|
+
);
|
|
1966
|
+
}
|
|
1967
|
+
this.ast = normalizeDomainAST(rawAST);
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1950
1970
|
contains(record) {
|
|
1951
1971
|
const expr = evaluate(this.ast, record);
|
|
1952
1972
|
return matchDomain(record, expr);
|
|
@@ -1965,7 +1985,7 @@ var Domain = class _Domain {
|
|
|
1965
1985
|
return evaluatedAsList;
|
|
1966
1986
|
}
|
|
1967
1987
|
return this.toString();
|
|
1968
|
-
} catch
|
|
1988
|
+
} catch {
|
|
1969
1989
|
return this.toString();
|
|
1970
1990
|
}
|
|
1971
1991
|
}
|
|
@@ -2165,7 +2185,7 @@ function matchDomain(record, domain) {
|
|
|
2165
2185
|
}
|
|
2166
2186
|
|
|
2167
2187
|
// src/utils/function.ts
|
|
2168
|
-
|
|
2188
|
+
var import_react = require("react");
|
|
2169
2189
|
var toQueryString = (params) => {
|
|
2170
2190
|
return Object.keys(params).map(
|
|
2171
2191
|
(key) => encodeURIComponent(key) + "=" + encodeURIComponent(params[key].toString())
|
|
@@ -2193,22 +2213,22 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
|
|
|
2193
2213
|
|
|
2194
2214
|
// src/utils/storage/local-storage.ts
|
|
2195
2215
|
var localStorageUtils = () => {
|
|
2196
|
-
const setToken = (access_token) =>
|
|
2216
|
+
const setToken = async (access_token) => {
|
|
2197
2217
|
localStorage.setItem("accessToken", access_token);
|
|
2198
|
-
}
|
|
2199
|
-
const setRefreshToken = (refresh_token) =>
|
|
2218
|
+
};
|
|
2219
|
+
const setRefreshToken = async (refresh_token) => {
|
|
2200
2220
|
localStorage.setItem("refreshToken", refresh_token);
|
|
2201
|
-
}
|
|
2202
|
-
const getAccessToken = () =>
|
|
2221
|
+
};
|
|
2222
|
+
const getAccessToken = async () => {
|
|
2203
2223
|
return localStorage.getItem("accessToken");
|
|
2204
|
-
}
|
|
2205
|
-
const getRefreshToken = () =>
|
|
2224
|
+
};
|
|
2225
|
+
const getRefreshToken = async () => {
|
|
2206
2226
|
return localStorage.getItem("refreshToken");
|
|
2207
|
-
}
|
|
2208
|
-
const clearToken = () =>
|
|
2227
|
+
};
|
|
2228
|
+
const clearToken = async () => {
|
|
2209
2229
|
localStorage.removeItem("accessToken");
|
|
2210
2230
|
localStorage.removeItem("refreshToken");
|
|
2211
|
-
}
|
|
2231
|
+
};
|
|
2212
2232
|
return {
|
|
2213
2233
|
setToken,
|
|
2214
2234
|
setRefreshToken,
|
|
@@ -2220,9 +2240,9 @@ var localStorageUtils = () => {
|
|
|
2220
2240
|
|
|
2221
2241
|
// src/utils/storage/session-storage.ts
|
|
2222
2242
|
var sessionStorageUtils = () => {
|
|
2223
|
-
const getBrowserSession = () =>
|
|
2243
|
+
const getBrowserSession = async () => {
|
|
2224
2244
|
return sessionStorage.getItem("browserSession");
|
|
2225
|
-
}
|
|
2245
|
+
};
|
|
2226
2246
|
return {
|
|
2227
2247
|
getBrowserSession
|
|
2228
2248
|
};
|
|
@@ -2231,14 +2251,13 @@ var sessionStorageUtils = () => {
|
|
|
2231
2251
|
// src/configs/axios-client.ts
|
|
2232
2252
|
var axiosClient = {
|
|
2233
2253
|
init(config) {
|
|
2234
|
-
|
|
2235
|
-
const
|
|
2236
|
-
const sessionStorage2 = (_b = config.sessionStorageUtils) != null ? _b : sessionStorageUtils();
|
|
2254
|
+
const localStorage2 = config.localStorageUtils ?? localStorageUtils();
|
|
2255
|
+
const sessionStorage2 = config.sessionStorageUtils ?? sessionStorageUtils();
|
|
2237
2256
|
const db = config.db;
|
|
2238
2257
|
let isRefreshing = false;
|
|
2239
2258
|
let failedQueue = [];
|
|
2240
2259
|
const processQueue = (error, token = null) => {
|
|
2241
|
-
failedQueue
|
|
2260
|
+
failedQueue?.forEach((prom) => {
|
|
2242
2261
|
if (error) {
|
|
2243
2262
|
prom.reject(error);
|
|
2244
2263
|
} else {
|
|
@@ -2247,21 +2266,21 @@ var axiosClient = {
|
|
|
2247
2266
|
});
|
|
2248
2267
|
failedQueue = [];
|
|
2249
2268
|
};
|
|
2250
|
-
const instance =
|
|
2251
|
-
adapter:
|
|
2269
|
+
const instance = import_axios.default.create({
|
|
2270
|
+
adapter: import_axios.default.defaults.adapter,
|
|
2252
2271
|
baseURL: config.baseUrl,
|
|
2253
2272
|
timeout: 5e4,
|
|
2254
2273
|
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
2255
2274
|
});
|
|
2256
2275
|
instance.interceptors.request.use(
|
|
2257
|
-
(config2) =>
|
|
2276
|
+
async (config2) => {
|
|
2258
2277
|
const useRefreshToken = config2.useRefreshToken;
|
|
2259
|
-
const token = useRefreshToken ?
|
|
2278
|
+
const token = useRefreshToken ? await localStorage2.getRefreshToken() : await localStorage2.getAccessToken();
|
|
2260
2279
|
if (token) {
|
|
2261
2280
|
config2.headers["Authorization"] = "Bearer " + token;
|
|
2262
2281
|
}
|
|
2263
2282
|
return config2;
|
|
2264
|
-
}
|
|
2283
|
+
},
|
|
2265
2284
|
(error) => {
|
|
2266
2285
|
Promise.reject(error);
|
|
2267
2286
|
}
|
|
@@ -2270,21 +2289,19 @@ var axiosClient = {
|
|
|
2270
2289
|
(response) => {
|
|
2271
2290
|
return handleResponse(response);
|
|
2272
2291
|
},
|
|
2273
|
-
(error) =>
|
|
2274
|
-
|
|
2275
|
-
const handleError3 = (error2) => __async(null, null, function* () {
|
|
2276
|
-
var _a3;
|
|
2292
|
+
async (error) => {
|
|
2293
|
+
const handleError3 = async (error2) => {
|
|
2277
2294
|
if (!error2.response) {
|
|
2278
2295
|
return error2;
|
|
2279
2296
|
}
|
|
2280
2297
|
const { data } = error2.response;
|
|
2281
|
-
if (data && data.code === 400 && ["invalid_grant"].includes(
|
|
2282
|
-
|
|
2298
|
+
if (data && data.code === 400 && ["invalid_grant"].includes(data.data?.error)) {
|
|
2299
|
+
await clearAuthToken();
|
|
2283
2300
|
}
|
|
2284
2301
|
return data;
|
|
2285
|
-
}
|
|
2302
|
+
};
|
|
2286
2303
|
const originalRequest = error.config;
|
|
2287
|
-
if ((
|
|
2304
|
+
if ((error.response?.status === 403 || error.response?.status === 401 || error.response?.status === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
|
|
2288
2305
|
error.response.data.code
|
|
2289
2306
|
)) {
|
|
2290
2307
|
if (isRefreshing) {
|
|
@@ -2297,19 +2314,18 @@ var axiosClient = {
|
|
|
2297
2314
|
token
|
|
2298
2315
|
);
|
|
2299
2316
|
return instance.request(originalRequest);
|
|
2300
|
-
}).catch((err) =>
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
yield clearAuthToken();
|
|
2317
|
+
}).catch(async (err) => {
|
|
2318
|
+
if ((err.response?.status === 400 || err.response?.status === 401) && ["invalid_grant"].includes(err.response.data.error)) {
|
|
2319
|
+
await clearAuthToken();
|
|
2304
2320
|
}
|
|
2305
|
-
})
|
|
2321
|
+
});
|
|
2306
2322
|
}
|
|
2307
|
-
const browserSession =
|
|
2308
|
-
const refreshToken =
|
|
2309
|
-
const accessTokenExp =
|
|
2323
|
+
const browserSession = await sessionStorage2.getBrowserSession();
|
|
2324
|
+
const refreshToken = await localStorage2.getRefreshToken();
|
|
2325
|
+
const accessTokenExp = await localStorage2.getAccessToken();
|
|
2310
2326
|
isRefreshing = true;
|
|
2311
2327
|
if (!refreshToken && (!browserSession || browserSession == "unActive")) {
|
|
2312
|
-
|
|
2328
|
+
await clearAuthToken();
|
|
2313
2329
|
} else {
|
|
2314
2330
|
const payload = Object.fromEntries(
|
|
2315
2331
|
Object.entries({
|
|
@@ -2320,9 +2336,8 @@ var axiosClient = {
|
|
|
2320
2336
|
}).filter(([_, value]) => !!value)
|
|
2321
2337
|
);
|
|
2322
2338
|
return new Promise(function(resolve) {
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
`${config.baseUrl}${(_a3 = config.refreshTokenEndpoint) != null ? _a3 : "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
|
|
2339
|
+
import_axios.default.post(
|
|
2340
|
+
`${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
|
|
2326
2341
|
payload,
|
|
2327
2342
|
{
|
|
2328
2343
|
headers: {
|
|
@@ -2330,11 +2345,11 @@ var axiosClient = {
|
|
|
2330
2345
|
Authorization: `Bearer ${accessTokenExp}`
|
|
2331
2346
|
}
|
|
2332
2347
|
}
|
|
2333
|
-
).then((res) =>
|
|
2348
|
+
).then(async (res) => {
|
|
2334
2349
|
const data = res.data;
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2350
|
+
await localStorage2.setToken(data.access_token);
|
|
2351
|
+
await localStorage2.setRefreshToken(data.refresh_token);
|
|
2352
|
+
import_axios.default.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
|
|
2338
2353
|
originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
|
|
2339
2354
|
originalRequest.data = updateTokenParamInOriginalRequest(
|
|
2340
2355
|
originalRequest,
|
|
@@ -2342,26 +2357,25 @@ var axiosClient = {
|
|
|
2342
2357
|
);
|
|
2343
2358
|
processQueue(null, data.access_token);
|
|
2344
2359
|
resolve(instance.request(originalRequest));
|
|
2345
|
-
})
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
yield clearAuthToken();
|
|
2360
|
+
}).catch(async (err) => {
|
|
2361
|
+
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") {
|
|
2362
|
+
await clearAuthToken();
|
|
2349
2363
|
}
|
|
2350
2364
|
if (err && err.response) {
|
|
2351
|
-
const { error_code } =
|
|
2365
|
+
const { error_code } = err.response?.data || {};
|
|
2352
2366
|
if (error_code === "AUTHEN_FAIL") {
|
|
2353
|
-
|
|
2367
|
+
await clearAuthToken();
|
|
2354
2368
|
}
|
|
2355
2369
|
}
|
|
2356
2370
|
processQueue(err, null);
|
|
2357
|
-
})
|
|
2371
|
+
}).finally(() => {
|
|
2358
2372
|
isRefreshing = false;
|
|
2359
2373
|
});
|
|
2360
2374
|
});
|
|
2361
2375
|
}
|
|
2362
2376
|
}
|
|
2363
|
-
return Promise.reject(
|
|
2364
|
-
}
|
|
2377
|
+
return Promise.reject(await handleError3(error));
|
|
2378
|
+
}
|
|
2365
2379
|
);
|
|
2366
2380
|
const handleResponse = (res) => {
|
|
2367
2381
|
if (res && res.data) {
|
|
@@ -2370,7 +2384,6 @@ var axiosClient = {
|
|
|
2370
2384
|
return res;
|
|
2371
2385
|
};
|
|
2372
2386
|
const handleError2 = (error) => {
|
|
2373
|
-
var _a2, _b2, _c;
|
|
2374
2387
|
if (error.isAxiosError && error.code === "ECONNABORTED") {
|
|
2375
2388
|
console.error("Request Timeout Error:", error);
|
|
2376
2389
|
return "Request Timeout Error";
|
|
@@ -2378,17 +2391,17 @@ var axiosClient = {
|
|
|
2378
2391
|
console.error("Network Error:", error);
|
|
2379
2392
|
return "Network Error";
|
|
2380
2393
|
} else {
|
|
2381
|
-
console.error("Other Error:", error
|
|
2382
|
-
const errorMessage =
|
|
2383
|
-
return { message: errorMessage, status:
|
|
2394
|
+
console.error("Other Error:", error?.response);
|
|
2395
|
+
const errorMessage = error?.response?.data?.message || "An error occurred";
|
|
2396
|
+
return { message: errorMessage, status: error?.response?.status };
|
|
2384
2397
|
}
|
|
2385
2398
|
};
|
|
2386
|
-
const clearAuthToken = () =>
|
|
2387
|
-
|
|
2399
|
+
const clearAuthToken = async () => {
|
|
2400
|
+
await localStorage2.clearToken();
|
|
2388
2401
|
if (typeof window !== "undefined") {
|
|
2389
2402
|
window.location.href = `/login`;
|
|
2390
2403
|
}
|
|
2391
|
-
}
|
|
2404
|
+
};
|
|
2392
2405
|
function formatUrl(url, db2) {
|
|
2393
2406
|
return url + (db2 ? "?db=" + db2 : "");
|
|
2394
2407
|
}
|
|
@@ -2412,14 +2425,14 @@ var axiosClient = {
|
|
|
2412
2425
|
};
|
|
2413
2426
|
|
|
2414
2427
|
// src/store/index.ts
|
|
2415
|
-
|
|
2428
|
+
var import_react_redux = require("react-redux");
|
|
2416
2429
|
|
|
2417
2430
|
// src/store/reducers/breadcrums-slice/index.ts
|
|
2418
|
-
|
|
2431
|
+
var import_toolkit = require("@reduxjs/toolkit");
|
|
2419
2432
|
var initialState = {
|
|
2420
2433
|
breadCrumbs: []
|
|
2421
2434
|
};
|
|
2422
|
-
var breadcrumbsSlice = createSlice({
|
|
2435
|
+
var breadcrumbsSlice = (0, import_toolkit.createSlice)({
|
|
2423
2436
|
name: "breadcrumbs",
|
|
2424
2437
|
initialState,
|
|
2425
2438
|
reducers: {
|
|
@@ -2432,7 +2445,7 @@ var { setBreadCrumbs } = breadcrumbsSlice.actions;
|
|
|
2432
2445
|
var breadcrums_slice_default = breadcrumbsSlice.reducer;
|
|
2433
2446
|
|
|
2434
2447
|
// src/store/reducers/env-slice/index.ts
|
|
2435
|
-
|
|
2448
|
+
var import_toolkit2 = require("@reduxjs/toolkit");
|
|
2436
2449
|
var initialState2 = {
|
|
2437
2450
|
baseUrl: "",
|
|
2438
2451
|
requests: null,
|
|
@@ -2453,7 +2466,7 @@ var initialState2 = {
|
|
|
2453
2466
|
tz: "Asia/Saigon"
|
|
2454
2467
|
}
|
|
2455
2468
|
};
|
|
2456
|
-
var envSlice =
|
|
2469
|
+
var envSlice = (0, import_toolkit2.createSlice)({
|
|
2457
2470
|
name: "env",
|
|
2458
2471
|
initialState: initialState2,
|
|
2459
2472
|
reducers: {
|
|
@@ -2500,7 +2513,7 @@ var {
|
|
|
2500
2513
|
var env_slice_default = envSlice.reducer;
|
|
2501
2514
|
|
|
2502
2515
|
// src/store/reducers/excel-slice/index.ts
|
|
2503
|
-
|
|
2516
|
+
var import_toolkit3 = require("@reduxjs/toolkit");
|
|
2504
2517
|
var initialState3 = {
|
|
2505
2518
|
dataParse: null,
|
|
2506
2519
|
idFile: null,
|
|
@@ -2509,7 +2522,7 @@ var initialState3 = {
|
|
|
2509
2522
|
selectedFile: null,
|
|
2510
2523
|
errorData: null
|
|
2511
2524
|
};
|
|
2512
|
-
var excelSlice =
|
|
2525
|
+
var excelSlice = (0, import_toolkit3.createSlice)({
|
|
2513
2526
|
name: "excel",
|
|
2514
2527
|
initialState: initialState3,
|
|
2515
2528
|
reducers: {
|
|
@@ -2544,7 +2557,7 @@ var {
|
|
|
2544
2557
|
var excel_slice_default = excelSlice.reducer;
|
|
2545
2558
|
|
|
2546
2559
|
// src/store/reducers/form-slice/index.ts
|
|
2547
|
-
|
|
2560
|
+
var import_toolkit4 = require("@reduxjs/toolkit");
|
|
2548
2561
|
var initialState4 = {
|
|
2549
2562
|
viewDataStore: {},
|
|
2550
2563
|
isShowingModalDetail: false,
|
|
@@ -2554,7 +2567,7 @@ var initialState4 = {
|
|
|
2554
2567
|
listSubject: {},
|
|
2555
2568
|
dataUser: {}
|
|
2556
2569
|
};
|
|
2557
|
-
var formSlice =
|
|
2570
|
+
var formSlice = (0, import_toolkit4.createSlice)({
|
|
2558
2571
|
name: "form",
|
|
2559
2572
|
initialState: initialState4,
|
|
2560
2573
|
reducers: {
|
|
@@ -2593,15 +2606,15 @@ var {
|
|
|
2593
2606
|
var form_slice_default = formSlice.reducer;
|
|
2594
2607
|
|
|
2595
2608
|
// src/store/reducers/header-slice/index.ts
|
|
2596
|
-
|
|
2597
|
-
var headerSlice =
|
|
2609
|
+
var import_toolkit5 = require("@reduxjs/toolkit");
|
|
2610
|
+
var headerSlice = (0, import_toolkit5.createSlice)({
|
|
2598
2611
|
name: "header",
|
|
2599
2612
|
initialState: {
|
|
2600
2613
|
value: { allowedCompanyIds: [] }
|
|
2601
2614
|
},
|
|
2602
2615
|
reducers: {
|
|
2603
2616
|
setHeader: (state, action) => {
|
|
2604
|
-
state.value =
|
|
2617
|
+
state.value = { ...state.value, ...action.payload };
|
|
2605
2618
|
},
|
|
2606
2619
|
setAllowedCompanyIds: (state, action) => {
|
|
2607
2620
|
state.value.allowedCompanyIds = action.payload;
|
|
@@ -2612,7 +2625,7 @@ var { setAllowedCompanyIds, setHeader } = headerSlice.actions;
|
|
|
2612
2625
|
var header_slice_default = headerSlice.reducer;
|
|
2613
2626
|
|
|
2614
2627
|
// src/store/reducers/list-slice/index.ts
|
|
2615
|
-
|
|
2628
|
+
var import_toolkit6 = require("@reduxjs/toolkit");
|
|
2616
2629
|
var initialState5 = {
|
|
2617
2630
|
pageLimit: 10,
|
|
2618
2631
|
fields: {},
|
|
@@ -2626,7 +2639,7 @@ var initialState5 = {
|
|
|
2626
2639
|
page: 0,
|
|
2627
2640
|
domainTable: []
|
|
2628
2641
|
};
|
|
2629
|
-
var listSlice =
|
|
2642
|
+
var listSlice = (0, import_toolkit6.createSlice)({
|
|
2630
2643
|
name: "list",
|
|
2631
2644
|
initialState: initialState5,
|
|
2632
2645
|
reducers: {
|
|
@@ -2677,13 +2690,13 @@ var {
|
|
|
2677
2690
|
var list_slice_default = listSlice.reducer;
|
|
2678
2691
|
|
|
2679
2692
|
// src/store/reducers/login-slice/index.ts
|
|
2680
|
-
|
|
2693
|
+
var import_toolkit7 = require("@reduxjs/toolkit");
|
|
2681
2694
|
var initialState6 = {
|
|
2682
2695
|
db: "",
|
|
2683
2696
|
redirectTo: "/",
|
|
2684
2697
|
forgotPasswordUrl: "/"
|
|
2685
2698
|
};
|
|
2686
|
-
var loginSlice =
|
|
2699
|
+
var loginSlice = (0, import_toolkit7.createSlice)({
|
|
2687
2700
|
name: "login",
|
|
2688
2701
|
initialState: initialState6,
|
|
2689
2702
|
reducers: {
|
|
@@ -2702,14 +2715,14 @@ var { setDb, setRedirectTo, setForgotPasswordUrl } = loginSlice.actions;
|
|
|
2702
2715
|
var login_slice_default = loginSlice.reducer;
|
|
2703
2716
|
|
|
2704
2717
|
// src/store/reducers/navbar-slice/index.ts
|
|
2705
|
-
|
|
2718
|
+
var import_toolkit8 = require("@reduxjs/toolkit");
|
|
2706
2719
|
var initialState7 = {
|
|
2707
2720
|
menuFocus: {},
|
|
2708
2721
|
menuAction: {},
|
|
2709
2722
|
navbarWidth: 250,
|
|
2710
2723
|
menuList: []
|
|
2711
2724
|
};
|
|
2712
|
-
var navbarSlice =
|
|
2725
|
+
var navbarSlice = (0, import_toolkit8.createSlice)({
|
|
2713
2726
|
name: "navbar",
|
|
2714
2727
|
initialState: initialState7,
|
|
2715
2728
|
reducers: {
|
|
@@ -2731,11 +2744,11 @@ var { setMenuFocus, setMenuFocusAction, setNavbarWidth, setMenuList } = navbarSl
|
|
|
2731
2744
|
var navbar_slice_default = navbarSlice.reducer;
|
|
2732
2745
|
|
|
2733
2746
|
// src/store/reducers/profile-slice/index.ts
|
|
2734
|
-
|
|
2747
|
+
var import_toolkit9 = require("@reduxjs/toolkit");
|
|
2735
2748
|
var initialState8 = {
|
|
2736
2749
|
profile: {}
|
|
2737
2750
|
};
|
|
2738
|
-
var profileSlice =
|
|
2751
|
+
var profileSlice = (0, import_toolkit9.createSlice)({
|
|
2739
2752
|
name: "profile",
|
|
2740
2753
|
initialState: initialState8,
|
|
2741
2754
|
reducers: {
|
|
@@ -2748,7 +2761,7 @@ var { setProfile } = profileSlice.actions;
|
|
|
2748
2761
|
var profile_slice_default = profileSlice.reducer;
|
|
2749
2762
|
|
|
2750
2763
|
// src/store/reducers/search-slice/index.ts
|
|
2751
|
-
|
|
2764
|
+
var import_toolkit10 = require("@reduxjs/toolkit");
|
|
2752
2765
|
var initialState9 = {
|
|
2753
2766
|
groupByDomain: null,
|
|
2754
2767
|
searchBy: [],
|
|
@@ -2760,7 +2773,7 @@ var initialState9 = {
|
|
|
2760
2773
|
filterBy: [],
|
|
2761
2774
|
groupBy: []
|
|
2762
2775
|
};
|
|
2763
|
-
var searchSlice =
|
|
2776
|
+
var searchSlice = (0, import_toolkit10.createSlice)({
|
|
2764
2777
|
name: "search",
|
|
2765
2778
|
initialState: initialState9,
|
|
2766
2779
|
reducers: {
|
|
@@ -2834,7 +2847,7 @@ var {
|
|
|
2834
2847
|
var search_slice_default = searchSlice.reducer;
|
|
2835
2848
|
|
|
2836
2849
|
// src/store/store.ts
|
|
2837
|
-
|
|
2850
|
+
var import_toolkit11 = require("@reduxjs/toolkit");
|
|
2838
2851
|
|
|
2839
2852
|
// node_modules/redux/dist/redux.mjs
|
|
2840
2853
|
function formatProdErrorMessage(code) {
|
|
@@ -3018,7 +3031,7 @@ var rootReducer = combineReducers({
|
|
|
3018
3031
|
excel: excel_slice_default,
|
|
3019
3032
|
profile: profile_slice_default
|
|
3020
3033
|
});
|
|
3021
|
-
var envStore = configureStore({
|
|
3034
|
+
var envStore = (0, import_toolkit11.configureStore)({
|
|
3022
3035
|
reducer: rootReducer,
|
|
3023
3036
|
middleware: (getDefaultMiddleware) => getDefaultMiddleware({
|
|
3024
3037
|
serializableCheck: false
|
|
@@ -3026,7 +3039,20 @@ var envStore = configureStore({
|
|
|
3026
3039
|
});
|
|
3027
3040
|
|
|
3028
3041
|
// src/environment/EnvStore.ts
|
|
3029
|
-
var
|
|
3042
|
+
var EnvStore = class _EnvStore {
|
|
3043
|
+
static instance = null;
|
|
3044
|
+
envStore;
|
|
3045
|
+
baseUrl;
|
|
3046
|
+
requests;
|
|
3047
|
+
context;
|
|
3048
|
+
defaultCompany;
|
|
3049
|
+
config;
|
|
3050
|
+
companies;
|
|
3051
|
+
user;
|
|
3052
|
+
db;
|
|
3053
|
+
localStorageUtils;
|
|
3054
|
+
sessionStorageUtils;
|
|
3055
|
+
refreshTokenEndpoint;
|
|
3030
3056
|
constructor(envStore2, localStorageUtils2, sessionStorageUtils2) {
|
|
3031
3057
|
this.envStore = envStore2;
|
|
3032
3058
|
this.localStorageUtils = localStorageUtils2;
|
|
@@ -3045,25 +3071,26 @@ var _EnvStore = class _EnvStore {
|
|
|
3045
3071
|
}
|
|
3046
3072
|
setup() {
|
|
3047
3073
|
const env = this.envStore.getState().env;
|
|
3048
|
-
this.baseUrl = env
|
|
3049
|
-
this.requests = env
|
|
3050
|
-
this.context = env
|
|
3051
|
-
this.defaultCompany = env
|
|
3052
|
-
this.config = env
|
|
3053
|
-
this.companies =
|
|
3054
|
-
this.user = env
|
|
3055
|
-
this.db = env
|
|
3056
|
-
this.refreshTokenEndpoint = env
|
|
3074
|
+
this.baseUrl = env?.baseUrl;
|
|
3075
|
+
this.requests = env?.requests;
|
|
3076
|
+
this.context = env?.context;
|
|
3077
|
+
this.defaultCompany = env?.defaultCompany;
|
|
3078
|
+
this.config = env?.config;
|
|
3079
|
+
this.companies = env?.companies || [];
|
|
3080
|
+
this.user = env?.user;
|
|
3081
|
+
this.db = env?.db;
|
|
3082
|
+
this.refreshTokenEndpoint = env?.refreshTokenEndpoint;
|
|
3057
3083
|
console.log("Env setup:", this);
|
|
3058
3084
|
}
|
|
3059
3085
|
setupEnv(envConfig) {
|
|
3060
3086
|
const dispatch = this.envStore.dispatch;
|
|
3061
|
-
const env =
|
|
3087
|
+
const env = {
|
|
3088
|
+
...envConfig,
|
|
3062
3089
|
localStorageUtils: this.localStorageUtils,
|
|
3063
3090
|
sessionStorageUtils: this.sessionStorageUtils
|
|
3064
|
-
}
|
|
3091
|
+
};
|
|
3065
3092
|
const requests = axiosClient.init(env);
|
|
3066
|
-
dispatch(setEnv(
|
|
3093
|
+
dispatch(setEnv({ ...env, requests }));
|
|
3067
3094
|
this.setup();
|
|
3068
3095
|
}
|
|
3069
3096
|
setUid(uid) {
|
|
@@ -3097,8 +3124,6 @@ var _EnvStore = class _EnvStore {
|
|
|
3097
3124
|
this.setup();
|
|
3098
3125
|
}
|
|
3099
3126
|
};
|
|
3100
|
-
_EnvStore.instance = null;
|
|
3101
|
-
var EnvStore = _EnvStore;
|
|
3102
3127
|
function getEnv() {
|
|
3103
3128
|
const instance = EnvStore.getInstance(envStore);
|
|
3104
3129
|
if (!instance) {
|
|
@@ -3110,61 +3135,35 @@ function getEnv() {
|
|
|
3110
3135
|
// src/services/action-service/index.ts
|
|
3111
3136
|
var ActionService = {
|
|
3112
3137
|
// Load Action
|
|
3113
|
-
loadAction(
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
}
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
});
|
|
3128
|
-
});
|
|
3129
|
-
},
|
|
3130
|
-
// Call Button
|
|
3131
|
-
callButton(_0) {
|
|
3132
|
-
return __async(this, arguments, function* ({
|
|
3133
|
-
model,
|
|
3134
|
-
ids = [],
|
|
3135
|
-
context,
|
|
3136
|
-
method
|
|
3137
|
-
}) {
|
|
3138
|
-
try {
|
|
3139
|
-
const env = getEnv();
|
|
3140
|
-
const jsonData = {
|
|
3141
|
-
model,
|
|
3142
|
-
method,
|
|
3143
|
-
ids,
|
|
3144
|
-
with_context: context
|
|
3145
|
-
};
|
|
3146
|
-
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3147
|
-
headers: {
|
|
3148
|
-
"Content-Type": "application/json"
|
|
3149
|
-
}
|
|
3150
|
-
});
|
|
3151
|
-
} catch (error) {
|
|
3152
|
-
console.error("Error when calling button action:", error);
|
|
3153
|
-
throw error;
|
|
3138
|
+
async loadAction({
|
|
3139
|
+
idAction,
|
|
3140
|
+
context
|
|
3141
|
+
}) {
|
|
3142
|
+
const env = getEnv();
|
|
3143
|
+
const jsonData = {
|
|
3144
|
+
action_id: idAction,
|
|
3145
|
+
with_context: {
|
|
3146
|
+
...context
|
|
3147
|
+
}
|
|
3148
|
+
};
|
|
3149
|
+
return env.requests.post(`${"/load_action" /* LOAD_ACTION */}`, jsonData, {
|
|
3150
|
+
headers: {
|
|
3151
|
+
"Content-Type": "application/json"
|
|
3154
3152
|
}
|
|
3155
3153
|
});
|
|
3156
3154
|
},
|
|
3157
|
-
//
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3155
|
+
// Call Button
|
|
3156
|
+
async callButton({
|
|
3157
|
+
model,
|
|
3158
|
+
ids = [],
|
|
3159
|
+
context,
|
|
3160
|
+
method
|
|
3161
|
+
}) {
|
|
3162
|
+
try {
|
|
3164
3163
|
const env = getEnv();
|
|
3165
3164
|
const jsonData = {
|
|
3166
3165
|
model,
|
|
3167
|
-
method
|
|
3166
|
+
method,
|
|
3168
3167
|
ids,
|
|
3169
3168
|
with_context: context
|
|
3170
3169
|
};
|
|
@@ -3173,96 +3172,112 @@ var ActionService = {
|
|
|
3173
3172
|
"Content-Type": "application/json"
|
|
3174
3173
|
}
|
|
3175
3174
|
});
|
|
3175
|
+
} catch (error) {
|
|
3176
|
+
console.error("Error when calling button action:", error);
|
|
3177
|
+
throw error;
|
|
3178
|
+
}
|
|
3179
|
+
},
|
|
3180
|
+
// remove Row
|
|
3181
|
+
async removeRows({
|
|
3182
|
+
model,
|
|
3183
|
+
ids,
|
|
3184
|
+
context
|
|
3185
|
+
}) {
|
|
3186
|
+
const env = getEnv();
|
|
3187
|
+
const jsonData = {
|
|
3188
|
+
model,
|
|
3189
|
+
method: "unlink",
|
|
3190
|
+
ids,
|
|
3191
|
+
with_context: context
|
|
3192
|
+
};
|
|
3193
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3194
|
+
headers: {
|
|
3195
|
+
"Content-Type": "application/json"
|
|
3196
|
+
}
|
|
3176
3197
|
});
|
|
3177
3198
|
},
|
|
3178
3199
|
// Duplicate Model
|
|
3179
|
-
duplicateRecord(
|
|
3180
|
-
|
|
3200
|
+
async duplicateRecord({
|
|
3201
|
+
model,
|
|
3202
|
+
id,
|
|
3203
|
+
context
|
|
3204
|
+
}) {
|
|
3205
|
+
const env = getEnv();
|
|
3206
|
+
const jsonData = {
|
|
3181
3207
|
model,
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
with_context: context
|
|
3191
|
-
};
|
|
3192
|
-
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3193
|
-
headers: {
|
|
3194
|
-
"Content-Type": "application/json"
|
|
3195
|
-
}
|
|
3196
|
-
});
|
|
3208
|
+
method: "copy",
|
|
3209
|
+
ids: id,
|
|
3210
|
+
with_context: context
|
|
3211
|
+
};
|
|
3212
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3213
|
+
headers: {
|
|
3214
|
+
"Content-Type": "application/json"
|
|
3215
|
+
}
|
|
3197
3216
|
});
|
|
3198
3217
|
},
|
|
3199
3218
|
// Get Print Report
|
|
3200
|
-
getPrintReportName(
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
report_name: {}
|
|
3210
|
-
}
|
|
3211
|
-
}
|
|
3212
|
-
};
|
|
3213
|
-
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3214
|
-
headers: {
|
|
3215
|
-
"Content-Type": "application/json"
|
|
3219
|
+
async getPrintReportName({ id }) {
|
|
3220
|
+
const env = getEnv();
|
|
3221
|
+
const jsonData = {
|
|
3222
|
+
model: "ir.actions.report",
|
|
3223
|
+
method: "web_read",
|
|
3224
|
+
id,
|
|
3225
|
+
kwargs: {
|
|
3226
|
+
specification: {
|
|
3227
|
+
report_name: {}
|
|
3216
3228
|
}
|
|
3217
|
-
}
|
|
3229
|
+
}
|
|
3230
|
+
};
|
|
3231
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3232
|
+
headers: {
|
|
3233
|
+
"Content-Type": "application/json"
|
|
3234
|
+
}
|
|
3218
3235
|
});
|
|
3219
3236
|
},
|
|
3220
3237
|
//Save Print Invoice
|
|
3221
|
-
print(
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
responseType: "arraybuffer"
|
|
3238
|
-
});
|
|
3238
|
+
async print({ id, report, db }) {
|
|
3239
|
+
const env = getEnv();
|
|
3240
|
+
const jsonData = {
|
|
3241
|
+
report,
|
|
3242
|
+
id,
|
|
3243
|
+
type: "pdf",
|
|
3244
|
+
file_response: true,
|
|
3245
|
+
db
|
|
3246
|
+
};
|
|
3247
|
+
const queryString = toQueryString(jsonData);
|
|
3248
|
+
const urlWithParams = `${"/report" /* REPORT_PATH */}?${queryString}`;
|
|
3249
|
+
return env.requests.get(urlWithParams, {
|
|
3250
|
+
headers: {
|
|
3251
|
+
"Content-Type": "application/json"
|
|
3252
|
+
},
|
|
3253
|
+
responseType: "arraybuffer"
|
|
3239
3254
|
});
|
|
3240
3255
|
},
|
|
3241
3256
|
//Run Action
|
|
3242
|
-
runAction(
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
}
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
}
|
|
3257
|
+
async runAction({
|
|
3258
|
+
idAction,
|
|
3259
|
+
context
|
|
3260
|
+
}) {
|
|
3261
|
+
const env = getEnv();
|
|
3262
|
+
const jsonData = {
|
|
3263
|
+
action_id: idAction,
|
|
3264
|
+
with_context: {
|
|
3265
|
+
...context
|
|
3266
|
+
}
|
|
3267
|
+
// context: {
|
|
3268
|
+
// lang: 'en_US',
|
|
3269
|
+
// tz: 'Asia/Saigon',
|
|
3270
|
+
// uid: 2,
|
|
3271
|
+
// allowed_company_ids: [1],
|
|
3272
|
+
// active_id: Array.isArray(idDetail) ? idDetail[0] : idDetail,
|
|
3273
|
+
// active_ids: Array.isArray(idDetail) ? [...idDetail] : idDetail,
|
|
3274
|
+
// active_model: model,
|
|
3275
|
+
// },
|
|
3276
|
+
};
|
|
3277
|
+
return env.requests.post(`${"/run_action" /* RUN_ACTION_PATH */}`, jsonData, {
|
|
3278
|
+
headers: {
|
|
3279
|
+
"Content-Type": "application/json"
|
|
3280
|
+
}
|
|
3266
3281
|
});
|
|
3267
3282
|
}
|
|
3268
3283
|
};
|
|
@@ -3270,238 +3285,200 @@ var action_service_default = ActionService;
|
|
|
3270
3285
|
|
|
3271
3286
|
// src/services/auth-service/index.ts
|
|
3272
3287
|
var AuthService = {
|
|
3273
|
-
login(body) {
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
3290
|
-
}
|
|
3291
|
-
});
|
|
3288
|
+
async login(body) {
|
|
3289
|
+
const env = getEnv();
|
|
3290
|
+
const payload = Object.fromEntries(
|
|
3291
|
+
Object.entries({
|
|
3292
|
+
username: body.email,
|
|
3293
|
+
password: body.password,
|
|
3294
|
+
grant_type: env?.config?.grantType || "",
|
|
3295
|
+
client_id: env?.config?.clientId || "",
|
|
3296
|
+
client_secret: env?.config?.clientSecret || ""
|
|
3297
|
+
}).filter(([_, value]) => !!value)
|
|
3298
|
+
);
|
|
3299
|
+
const encodedData = new URLSearchParams(payload).toString();
|
|
3300
|
+
return env?.requests?.post(body.path, encodedData, {
|
|
3301
|
+
headers: {
|
|
3302
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
3303
|
+
}
|
|
3292
3304
|
});
|
|
3293
3305
|
},
|
|
3294
|
-
forgotPassword(email) {
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
"Content-Type": "application/json"
|
|
3305
|
-
}
|
|
3306
|
-
});
|
|
3306
|
+
async forgotPassword(email) {
|
|
3307
|
+
const env = getEnv();
|
|
3308
|
+
const bodyData = {
|
|
3309
|
+
login: email,
|
|
3310
|
+
url: `${window.location.origin}/reset-password`
|
|
3311
|
+
};
|
|
3312
|
+
return env?.requests?.post("/reset_password" /* RESET_PASSWORD_PATH */, bodyData, {
|
|
3313
|
+
headers: {
|
|
3314
|
+
"Content-Type": "application/json"
|
|
3315
|
+
}
|
|
3307
3316
|
});
|
|
3308
3317
|
},
|
|
3309
|
-
forgotPasswordSSO(
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
vals: {
|
|
3321
|
-
email
|
|
3322
|
-
}
|
|
3323
|
-
},
|
|
3324
|
-
with_context
|
|
3325
|
-
};
|
|
3326
|
-
return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, body, {
|
|
3327
|
-
headers: {
|
|
3328
|
-
"Content-Type": "application/json"
|
|
3318
|
+
async forgotPasswordSSO({
|
|
3319
|
+
email,
|
|
3320
|
+
with_context,
|
|
3321
|
+
method
|
|
3322
|
+
}) {
|
|
3323
|
+
const env = getEnv();
|
|
3324
|
+
const body = {
|
|
3325
|
+
method,
|
|
3326
|
+
kwargs: {
|
|
3327
|
+
vals: {
|
|
3328
|
+
email
|
|
3329
3329
|
}
|
|
3330
|
-
}
|
|
3330
|
+
},
|
|
3331
|
+
with_context
|
|
3332
|
+
};
|
|
3333
|
+
return env?.requests?.post("/call" /* CALL_PATH */, body, {
|
|
3334
|
+
headers: {
|
|
3335
|
+
"Content-Type": "application/json"
|
|
3336
|
+
}
|
|
3331
3337
|
});
|
|
3332
3338
|
},
|
|
3333
|
-
resetPassword(data, token) {
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
"Content-Type": "application/json"
|
|
3345
|
-
}
|
|
3346
|
-
});
|
|
3339
|
+
async resetPassword(data, token) {
|
|
3340
|
+
const env = getEnv();
|
|
3341
|
+
const bodyData = {
|
|
3342
|
+
token,
|
|
3343
|
+
password: data.password,
|
|
3344
|
+
new_password: data.confirmPassword
|
|
3345
|
+
};
|
|
3346
|
+
return env?.requests?.post("/change_password" /* CHANGE_PASSWORD_PATH */, bodyData, {
|
|
3347
|
+
headers: {
|
|
3348
|
+
"Content-Type": "application/json"
|
|
3349
|
+
}
|
|
3347
3350
|
});
|
|
3348
3351
|
},
|
|
3349
|
-
resetPasswordSSO(
|
|
3350
|
-
|
|
3352
|
+
async resetPasswordSSO({
|
|
3353
|
+
method,
|
|
3354
|
+
password,
|
|
3355
|
+
with_context
|
|
3356
|
+
}) {
|
|
3357
|
+
const env = getEnv();
|
|
3358
|
+
const bodyData = {
|
|
3351
3359
|
method,
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
var _a;
|
|
3356
|
-
const env = getEnv();
|
|
3357
|
-
const bodyData = {
|
|
3358
|
-
method,
|
|
3359
|
-
kwargs: {
|
|
3360
|
-
vals: {
|
|
3361
|
-
password
|
|
3362
|
-
}
|
|
3363
|
-
},
|
|
3364
|
-
with_context
|
|
3365
|
-
};
|
|
3366
|
-
return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, bodyData, {
|
|
3367
|
-
headers: {
|
|
3368
|
-
"Content-Type": "application/json"
|
|
3360
|
+
kwargs: {
|
|
3361
|
+
vals: {
|
|
3362
|
+
password
|
|
3369
3363
|
}
|
|
3370
|
-
}
|
|
3364
|
+
},
|
|
3365
|
+
with_context
|
|
3366
|
+
};
|
|
3367
|
+
return env?.requests?.post("/call" /* CALL_PATH */, bodyData, {
|
|
3368
|
+
headers: {
|
|
3369
|
+
"Content-Type": "application/json"
|
|
3370
|
+
}
|
|
3371
3371
|
});
|
|
3372
3372
|
},
|
|
3373
|
-
updatePassword(data, token) {
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
"Content-Type": "application/json"
|
|
3385
|
-
}
|
|
3386
|
-
});
|
|
3373
|
+
async updatePassword(data, token) {
|
|
3374
|
+
const env = getEnv();
|
|
3375
|
+
const bodyData = {
|
|
3376
|
+
token,
|
|
3377
|
+
old_password: data.oldPassword,
|
|
3378
|
+
new_password: data.newPassword
|
|
3379
|
+
};
|
|
3380
|
+
return env?.requests?.post("/change_password_parent" /* UPDATE_PASSWORD_PATH */, bodyData, {
|
|
3381
|
+
headers: {
|
|
3382
|
+
"Content-Type": "application/json"
|
|
3383
|
+
}
|
|
3387
3384
|
});
|
|
3388
3385
|
},
|
|
3389
|
-
isValidToken(token) {
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
"Content-Type": "application/json"
|
|
3399
|
-
}
|
|
3400
|
-
});
|
|
3386
|
+
async isValidToken(token) {
|
|
3387
|
+
const env = getEnv();
|
|
3388
|
+
const bodyData = {
|
|
3389
|
+
token
|
|
3390
|
+
};
|
|
3391
|
+
return env?.requests?.post("/check_token" /* TOKEN */, bodyData, {
|
|
3392
|
+
headers: {
|
|
3393
|
+
"Content-Type": "application/json"
|
|
3394
|
+
}
|
|
3401
3395
|
});
|
|
3402
3396
|
},
|
|
3403
|
-
loginSocial(
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
{
|
|
3414
|
-
|
|
3415
|
-
headers: {
|
|
3416
|
-
"Content-Type": "application/json"
|
|
3417
|
-
}
|
|
3397
|
+
async loginSocial({
|
|
3398
|
+
db,
|
|
3399
|
+
state,
|
|
3400
|
+
access_token
|
|
3401
|
+
}) {
|
|
3402
|
+
const env = getEnv();
|
|
3403
|
+
return env?.requests?.post(
|
|
3404
|
+
"/token/generate" /* GENTOKEN_SOCIAL */,
|
|
3405
|
+
{ state, access_token },
|
|
3406
|
+
{
|
|
3407
|
+
headers: {
|
|
3408
|
+
"Content-Type": "application/json"
|
|
3418
3409
|
}
|
|
3419
|
-
|
|
3420
|
-
|
|
3410
|
+
}
|
|
3411
|
+
);
|
|
3421
3412
|
},
|
|
3422
|
-
getProviders(db) {
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
const env = getEnv();
|
|
3426
|
-
return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.get("/oauth/providers", { params: { db } });
|
|
3427
|
-
});
|
|
3413
|
+
async getProviders(db) {
|
|
3414
|
+
const env = getEnv();
|
|
3415
|
+
return env?.requests?.get("/oauth/providers", { params: { db } });
|
|
3428
3416
|
},
|
|
3429
|
-
getAccessByCode(code) {
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
headers: {
|
|
3443
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
3444
|
-
}
|
|
3417
|
+
async getAccessByCode(code) {
|
|
3418
|
+
const env = getEnv();
|
|
3419
|
+
const data = new URLSearchParams();
|
|
3420
|
+
data.append("code", code);
|
|
3421
|
+
data.append("grant_type", "authorization_code");
|
|
3422
|
+
data.append("client_id", env?.config?.clientId || "");
|
|
3423
|
+
data.append("redirect_uri", env?.config?.redirectUri || "");
|
|
3424
|
+
return env?.requests?.post(
|
|
3425
|
+
`${env?.baseUrl?.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
|
|
3426
|
+
data,
|
|
3427
|
+
{
|
|
3428
|
+
headers: {
|
|
3429
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
3445
3430
|
}
|
|
3446
|
-
|
|
3447
|
-
|
|
3431
|
+
}
|
|
3432
|
+
);
|
|
3448
3433
|
},
|
|
3449
|
-
logout(data) {
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
{
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
}
|
|
3464
|
-
);
|
|
3465
|
-
});
|
|
3434
|
+
async logout(data) {
|
|
3435
|
+
const env = getEnv();
|
|
3436
|
+
console.log(data);
|
|
3437
|
+
return env?.requests?.post(
|
|
3438
|
+
"/logout" /* LOGOUT */,
|
|
3439
|
+
{},
|
|
3440
|
+
{
|
|
3441
|
+
headers: {
|
|
3442
|
+
"Content-Type": "application/json"
|
|
3443
|
+
},
|
|
3444
|
+
withCredentials: true,
|
|
3445
|
+
useRefreshToken: true
|
|
3446
|
+
}
|
|
3447
|
+
);
|
|
3466
3448
|
}
|
|
3467
3449
|
};
|
|
3468
3450
|
var auth_service_default = AuthService;
|
|
3469
3451
|
|
|
3470
3452
|
// src/services/company-service/index.ts
|
|
3471
3453
|
var CompanyService = {
|
|
3472
|
-
getCurrentCompany() {
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
}
|
|
3479
|
-
});
|
|
3454
|
+
async getCurrentCompany() {
|
|
3455
|
+
const env = getEnv();
|
|
3456
|
+
return await env.requests.get("/company" /* COMPANY_PATH */, {
|
|
3457
|
+
headers: {
|
|
3458
|
+
"Content-Type": "application/json"
|
|
3459
|
+
}
|
|
3480
3460
|
});
|
|
3481
3461
|
},
|
|
3482
|
-
getInfoCompany(id) {
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
display_name: {},
|
|
3496
|
-
secondary_logo: {}
|
|
3497
|
-
}
|
|
3498
|
-
}
|
|
3499
|
-
};
|
|
3500
|
-
return yield (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
3501
|
-
headers: {
|
|
3502
|
-
"Content-Type": "application/json"
|
|
3462
|
+
async getInfoCompany(id) {
|
|
3463
|
+
const env = getEnv();
|
|
3464
|
+
const jsonData = {
|
|
3465
|
+
ids: [id],
|
|
3466
|
+
model: "res.company" /* COMPANY */,
|
|
3467
|
+
method: "web_read" /* WEB_READ */,
|
|
3468
|
+
kwargs: {
|
|
3469
|
+
specification: {
|
|
3470
|
+
primary_color: {},
|
|
3471
|
+
secondary_color: {},
|
|
3472
|
+
logo: {},
|
|
3473
|
+
display_name: {},
|
|
3474
|
+
secondary_logo: {}
|
|
3503
3475
|
}
|
|
3504
|
-
}
|
|
3476
|
+
}
|
|
3477
|
+
};
|
|
3478
|
+
return await env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
3479
|
+
headers: {
|
|
3480
|
+
"Content-Type": "application/json"
|
|
3481
|
+
}
|
|
3505
3482
|
});
|
|
3506
3483
|
}
|
|
3507
3484
|
};
|
|
@@ -3509,671 +3486,613 @@ var company_service_default = CompanyService;
|
|
|
3509
3486
|
|
|
3510
3487
|
// src/services/excel-service/index.ts
|
|
3511
3488
|
var ExcelService = {
|
|
3512
|
-
uploadFile(
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
}
|
|
3519
|
-
});
|
|
3489
|
+
async uploadFile({ formData }) {
|
|
3490
|
+
const env = getEnv();
|
|
3491
|
+
return env.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
|
|
3492
|
+
headers: {
|
|
3493
|
+
"Content-Type": "multipart/form-data"
|
|
3494
|
+
}
|
|
3520
3495
|
});
|
|
3521
3496
|
},
|
|
3522
|
-
uploadIdFile(
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
}
|
|
3529
|
-
});
|
|
3497
|
+
async uploadIdFile({ formData }) {
|
|
3498
|
+
const env = getEnv();
|
|
3499
|
+
return env.requests.post(`${"/upload/file" /* UPLOAD_FILE_PATH */}`, formData, {
|
|
3500
|
+
headers: {
|
|
3501
|
+
"Content-Type": "multipart/form-data"
|
|
3502
|
+
}
|
|
3530
3503
|
});
|
|
3531
3504
|
},
|
|
3532
|
-
parsePreview(
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
tracking_disable: true
|
|
3565
|
-
}
|
|
3566
|
-
},
|
|
3567
|
-
with_context: context
|
|
3568
|
-
};
|
|
3569
|
-
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3570
|
-
headers: {
|
|
3571
|
-
"Content-Type": "multipart/form-data"
|
|
3505
|
+
async parsePreview({
|
|
3506
|
+
id,
|
|
3507
|
+
selectedSheet,
|
|
3508
|
+
isHeader,
|
|
3509
|
+
context
|
|
3510
|
+
}) {
|
|
3511
|
+
const env = getEnv();
|
|
3512
|
+
const jsonData = {
|
|
3513
|
+
model: "base_import.import" /* BASE_IMPORT */,
|
|
3514
|
+
method: "parse_preview",
|
|
3515
|
+
ids: [id],
|
|
3516
|
+
kwargs: {
|
|
3517
|
+
options: {
|
|
3518
|
+
import_skip_records: [],
|
|
3519
|
+
import_set_empty_fields: [],
|
|
3520
|
+
fallback_values: {},
|
|
3521
|
+
name_create_enabled_fields: {},
|
|
3522
|
+
encoding: "",
|
|
3523
|
+
separator: "",
|
|
3524
|
+
quoting: '"',
|
|
3525
|
+
date_format: "",
|
|
3526
|
+
datetime_format: "",
|
|
3527
|
+
float_thousand_separator: ",",
|
|
3528
|
+
float_decimal_separator: ".",
|
|
3529
|
+
advanced: true,
|
|
3530
|
+
has_headers: isHeader,
|
|
3531
|
+
keep_matches: false,
|
|
3532
|
+
limit: 2e3,
|
|
3533
|
+
sheets: [],
|
|
3534
|
+
sheet: selectedSheet,
|
|
3535
|
+
skip: 0,
|
|
3536
|
+
tracking_disable: true
|
|
3572
3537
|
}
|
|
3573
|
-
}
|
|
3538
|
+
},
|
|
3539
|
+
with_context: context
|
|
3540
|
+
};
|
|
3541
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3542
|
+
headers: {
|
|
3543
|
+
"Content-Type": "multipart/form-data"
|
|
3544
|
+
}
|
|
3574
3545
|
});
|
|
3575
3546
|
},
|
|
3576
|
-
executeImport(
|
|
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
|
-
});
|
|
3547
|
+
async executeImport({
|
|
3548
|
+
columns,
|
|
3549
|
+
fields,
|
|
3550
|
+
idFile,
|
|
3551
|
+
options,
|
|
3552
|
+
dryrun,
|
|
3553
|
+
context
|
|
3554
|
+
}) {
|
|
3555
|
+
const env = getEnv();
|
|
3556
|
+
const jsonData = {
|
|
3557
|
+
model: "base_import.import" /* BASE_IMPORT */,
|
|
3558
|
+
method: "execute_import",
|
|
3559
|
+
ids: [idFile],
|
|
3560
|
+
kwargs: {
|
|
3561
|
+
fields,
|
|
3562
|
+
columns,
|
|
3563
|
+
options,
|
|
3564
|
+
dryrun
|
|
3565
|
+
},
|
|
3566
|
+
with_context: context
|
|
3567
|
+
};
|
|
3568
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3569
|
+
headers: {
|
|
3570
|
+
"Content-Type": "multipart/form-data"
|
|
3571
|
+
}
|
|
3603
3572
|
});
|
|
3604
3573
|
},
|
|
3605
|
-
getFileExcel(
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
return env.requests.post("/call" /* CALL_PATH */, jsonData);
|
|
3614
|
-
});
|
|
3574
|
+
async getFileExcel({ model }) {
|
|
3575
|
+
const env = getEnv();
|
|
3576
|
+
const jsonData = {
|
|
3577
|
+
model,
|
|
3578
|
+
method: "get_import_templates" /* GET_IMPORT */,
|
|
3579
|
+
args: []
|
|
3580
|
+
};
|
|
3581
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData);
|
|
3615
3582
|
},
|
|
3616
|
-
getFieldExport(
|
|
3617
|
-
|
|
3618
|
-
|
|
3583
|
+
async getFieldExport({
|
|
3584
|
+
ids,
|
|
3585
|
+
model,
|
|
3586
|
+
isShow,
|
|
3587
|
+
parentField,
|
|
3588
|
+
fieldType,
|
|
3589
|
+
parentName,
|
|
3590
|
+
prefix,
|
|
3591
|
+
name,
|
|
3592
|
+
context,
|
|
3593
|
+
importCompat
|
|
3594
|
+
}) {
|
|
3595
|
+
const env = getEnv();
|
|
3596
|
+
const jsonData = {
|
|
3619
3597
|
model,
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
domain: [["id", "in", ids]],
|
|
3634
|
-
with_context: context
|
|
3635
|
-
};
|
|
3636
|
-
if (isShow) {
|
|
3637
|
-
jsonData.parent_field = parentField;
|
|
3638
|
-
jsonData.parent_field_type = fieldType;
|
|
3639
|
-
jsonData.parent_name = parentName;
|
|
3640
|
-
jsonData.name = name;
|
|
3641
|
-
jsonData.prefix = prefix;
|
|
3642
|
-
jsonData.exclude = [null];
|
|
3643
|
-
}
|
|
3644
|
-
return env.requests.post("/export/get_fields", jsonData);
|
|
3645
|
-
});
|
|
3598
|
+
import_compat: importCompat,
|
|
3599
|
+
domain: [["id", "in", ids]],
|
|
3600
|
+
with_context: context
|
|
3601
|
+
};
|
|
3602
|
+
if (isShow) {
|
|
3603
|
+
jsonData.parent_field = parentField;
|
|
3604
|
+
jsonData.parent_field_type = fieldType;
|
|
3605
|
+
jsonData.parent_name = parentName;
|
|
3606
|
+
jsonData.name = name;
|
|
3607
|
+
jsonData.prefix = prefix;
|
|
3608
|
+
jsonData.exclude = [null];
|
|
3609
|
+
}
|
|
3610
|
+
return env.requests.post("/export/get_fields", jsonData);
|
|
3646
3611
|
},
|
|
3647
|
-
exportExcel(
|
|
3648
|
-
|
|
3612
|
+
async exportExcel({
|
|
3613
|
+
model,
|
|
3614
|
+
domain,
|
|
3615
|
+
ids,
|
|
3616
|
+
fields,
|
|
3617
|
+
type,
|
|
3618
|
+
importCompat,
|
|
3619
|
+
context,
|
|
3620
|
+
groupby
|
|
3621
|
+
}) {
|
|
3622
|
+
const env = getEnv();
|
|
3623
|
+
const jsonData = {
|
|
3649
3624
|
model,
|
|
3650
3625
|
domain,
|
|
3651
3626
|
ids,
|
|
3627
|
+
import_compat: importCompat,
|
|
3652
3628
|
fields,
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
}) {
|
|
3658
|
-
const env = getEnv();
|
|
3659
|
-
const jsonData = {
|
|
3660
|
-
model,
|
|
3661
|
-
domain,
|
|
3662
|
-
ids,
|
|
3663
|
-
import_compat: importCompat,
|
|
3664
|
-
fields,
|
|
3665
|
-
with_context: context,
|
|
3666
|
-
groupby: groupby != null ? groupby : []
|
|
3667
|
-
};
|
|
3668
|
-
return env.requests.post_excel(`/export/${type}`, jsonData);
|
|
3669
|
-
});
|
|
3629
|
+
with_context: context,
|
|
3630
|
+
groupby: groupby ?? []
|
|
3631
|
+
};
|
|
3632
|
+
return env.requests.post_excel(`/export/${type}`, jsonData);
|
|
3670
3633
|
}
|
|
3671
3634
|
};
|
|
3672
3635
|
var excel_service_default = ExcelService;
|
|
3673
3636
|
|
|
3674
3637
|
// src/services/form-service/index.ts
|
|
3675
3638
|
var FormService = {
|
|
3676
|
-
getComment(
|
|
3677
|
-
|
|
3678
|
-
try {
|
|
3679
|
-
const env = getEnv();
|
|
3680
|
-
const jsonData = {
|
|
3681
|
-
thread_id: data.thread_id,
|
|
3682
|
-
thread_model: data.thread_model,
|
|
3683
|
-
limit: 100,
|
|
3684
|
-
with_context: {
|
|
3685
|
-
lang: data.lang
|
|
3686
|
-
}
|
|
3687
|
-
};
|
|
3688
|
-
return env.requests.post("/chatter/thread/messages" /* GET_MESSAGE */, jsonData, {
|
|
3689
|
-
headers: {
|
|
3690
|
-
"Content-Type": "application/json"
|
|
3691
|
-
}
|
|
3692
|
-
});
|
|
3693
|
-
} catch (error) {
|
|
3694
|
-
console.error("Error when sending message:", error);
|
|
3695
|
-
throw error;
|
|
3696
|
-
}
|
|
3697
|
-
});
|
|
3698
|
-
},
|
|
3699
|
-
sentComment(_0) {
|
|
3700
|
-
return __async(this, arguments, function* ({ data }) {
|
|
3701
|
-
try {
|
|
3702
|
-
const env = getEnv();
|
|
3703
|
-
const jsonData = {
|
|
3704
|
-
context: {
|
|
3705
|
-
tz: "Asia/Saigon",
|
|
3706
|
-
uid: 2,
|
|
3707
|
-
allowed_company_ids: [1],
|
|
3708
|
-
mail_post_autofollow: false,
|
|
3709
|
-
temporary_id: 142183.01
|
|
3710
|
-
},
|
|
3711
|
-
post_data: {
|
|
3712
|
-
body: data.message,
|
|
3713
|
-
message_type: "comment",
|
|
3714
|
-
attachment_ids: data.attachment_ids,
|
|
3715
|
-
attachment_tokens: [],
|
|
3716
|
-
subtype_xmlid: data.subtype
|
|
3717
|
-
},
|
|
3718
|
-
thread_id: Number(data.thread_id),
|
|
3719
|
-
thread_model: data.thread_model
|
|
3720
|
-
};
|
|
3721
|
-
return env.requests.post("/chatter/message/post" /* SENT_MESSAGE */, jsonData, {
|
|
3722
|
-
headers: {
|
|
3723
|
-
"Content-Type": "application/json"
|
|
3724
|
-
}
|
|
3725
|
-
});
|
|
3726
|
-
} catch (error) {
|
|
3727
|
-
console.error("Error when sent message:", error);
|
|
3728
|
-
throw error;
|
|
3729
|
-
}
|
|
3730
|
-
});
|
|
3731
|
-
},
|
|
3732
|
-
deleteComment(_0) {
|
|
3733
|
-
return __async(this, arguments, function* ({ data }) {
|
|
3734
|
-
try {
|
|
3735
|
-
const env = getEnv();
|
|
3736
|
-
const jsonData = {
|
|
3737
|
-
attachment_ids: [],
|
|
3738
|
-
attachment_tokens: [],
|
|
3739
|
-
body: "",
|
|
3740
|
-
message_id: data.message_id
|
|
3741
|
-
};
|
|
3742
|
-
return env.requests.post("/chatter/message/update_content" /* DELETE_MESSAGE */, jsonData, {
|
|
3743
|
-
headers: {
|
|
3744
|
-
"Content-Type": "application/json"
|
|
3745
|
-
}
|
|
3746
|
-
});
|
|
3747
|
-
} catch (error) {
|
|
3748
|
-
console.error("Error when sent message:", error);
|
|
3749
|
-
throw error;
|
|
3750
|
-
}
|
|
3751
|
-
});
|
|
3752
|
-
},
|
|
3753
|
-
getImage(_0) {
|
|
3754
|
-
return __async(this, arguments, function* ({ data }) {
|
|
3755
|
-
try {
|
|
3756
|
-
const env = getEnv();
|
|
3757
|
-
return env.requests.get(
|
|
3758
|
-
`${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
|
|
3759
|
-
{
|
|
3760
|
-
headers: {
|
|
3761
|
-
"Content-Type": "application/json"
|
|
3762
|
-
}
|
|
3763
|
-
}
|
|
3764
|
-
);
|
|
3765
|
-
} catch (error) {
|
|
3766
|
-
console.error("Error when sent message:", error);
|
|
3767
|
-
throw error;
|
|
3768
|
-
}
|
|
3769
|
-
});
|
|
3770
|
-
},
|
|
3771
|
-
uploadImage(_0) {
|
|
3772
|
-
return __async(this, arguments, function* ({ data }) {
|
|
3773
|
-
try {
|
|
3774
|
-
const env = getEnv();
|
|
3775
|
-
return env.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
|
|
3776
|
-
headers: {
|
|
3777
|
-
"Content-Type": "multipart/form-data"
|
|
3778
|
-
}
|
|
3779
|
-
});
|
|
3780
|
-
} catch (error) {
|
|
3781
|
-
console.error("Error when sent message:", error);
|
|
3782
|
-
throw error;
|
|
3783
|
-
}
|
|
3784
|
-
});
|
|
3785
|
-
},
|
|
3786
|
-
getFormView(_0) {
|
|
3787
|
-
return __async(this, arguments, function* ({ data }) {
|
|
3788
|
-
try {
|
|
3789
|
-
const env = getEnv();
|
|
3790
|
-
const jsonData = {
|
|
3791
|
-
model: data.model,
|
|
3792
|
-
method: "get_formview_action",
|
|
3793
|
-
ids: data.id ? [data.id] : [],
|
|
3794
|
-
with_context: data.context
|
|
3795
|
-
};
|
|
3796
|
-
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3797
|
-
headers: {
|
|
3798
|
-
"Content-Type": "application/json"
|
|
3799
|
-
}
|
|
3800
|
-
});
|
|
3801
|
-
} catch (error) {
|
|
3802
|
-
console.error("Error when fetching form view:", error);
|
|
3803
|
-
throw error;
|
|
3804
|
-
}
|
|
3805
|
-
});
|
|
3806
|
-
},
|
|
3807
|
-
changeStatus(_0) {
|
|
3808
|
-
return __async(this, arguments, function* ({ data }) {
|
|
3639
|
+
async getComment({ data }) {
|
|
3640
|
+
try {
|
|
3809
3641
|
const env = getEnv();
|
|
3810
|
-
const vals = {
|
|
3811
|
-
[data.name]: data.stage_id
|
|
3812
|
-
};
|
|
3813
3642
|
const jsonData = {
|
|
3814
|
-
|
|
3815
|
-
|
|
3643
|
+
thread_id: data.thread_id,
|
|
3644
|
+
thread_model: data.thread_model,
|
|
3645
|
+
limit: 100,
|
|
3816
3646
|
with_context: {
|
|
3817
|
-
lang: data.lang
|
|
3818
|
-
allowed_company_ids: [1],
|
|
3819
|
-
uid: 2,
|
|
3820
|
-
search_default_my_ticket: true,
|
|
3821
|
-
search_default_is_open: true
|
|
3822
|
-
},
|
|
3823
|
-
ids: [data.id],
|
|
3824
|
-
kwargs: {
|
|
3825
|
-
vals,
|
|
3826
|
-
specification: {}
|
|
3647
|
+
lang: data.lang
|
|
3827
3648
|
}
|
|
3828
3649
|
};
|
|
3829
|
-
return env.requests.post("/
|
|
3650
|
+
return env.requests.post("/chatter/thread/messages" /* GET_MESSAGE */, jsonData, {
|
|
3830
3651
|
headers: {
|
|
3831
3652
|
"Content-Type": "application/json"
|
|
3832
3653
|
}
|
|
3833
3654
|
});
|
|
3834
|
-
})
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
getGroups(_0) {
|
|
3842
|
-
return __async(this, arguments, function* ({
|
|
3843
|
-
model,
|
|
3844
|
-
width_context
|
|
3845
|
-
}) {
|
|
3655
|
+
} catch (error) {
|
|
3656
|
+
console.error("Error when sending message:", error);
|
|
3657
|
+
throw error;
|
|
3658
|
+
}
|
|
3659
|
+
},
|
|
3660
|
+
async sentComment({ data }) {
|
|
3661
|
+
try {
|
|
3846
3662
|
const env = getEnv();
|
|
3847
|
-
const
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3663
|
+
const jsonData = {
|
|
3664
|
+
context: {
|
|
3665
|
+
tz: "Asia/Saigon",
|
|
3666
|
+
uid: 2,
|
|
3667
|
+
allowed_company_ids: [1],
|
|
3668
|
+
mail_post_autofollow: false,
|
|
3669
|
+
temporary_id: 142183.01
|
|
3670
|
+
},
|
|
3671
|
+
post_data: {
|
|
3672
|
+
body: data.message,
|
|
3673
|
+
message_type: "comment",
|
|
3674
|
+
attachment_ids: data.attachment_ids,
|
|
3675
|
+
attachment_tokens: [],
|
|
3676
|
+
subtype_xmlid: data.subtype
|
|
3854
3677
|
},
|
|
3855
|
-
|
|
3678
|
+
thread_id: Number(data.thread_id),
|
|
3679
|
+
thread_model: data.thread_model
|
|
3856
3680
|
};
|
|
3857
|
-
return env.requests.post("/
|
|
3681
|
+
return env.requests.post("/chatter/message/post" /* SENT_MESSAGE */, jsonData, {
|
|
3858
3682
|
headers: {
|
|
3859
3683
|
"Content-Type": "application/json"
|
|
3860
3684
|
}
|
|
3861
3685
|
});
|
|
3862
|
-
})
|
|
3686
|
+
} catch (error) {
|
|
3687
|
+
console.error("Error when sent message:", error);
|
|
3688
|
+
throw error;
|
|
3689
|
+
}
|
|
3863
3690
|
},
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
field,
|
|
3867
|
-
color,
|
|
3868
|
-
model,
|
|
3869
|
-
width_context
|
|
3870
|
-
}) {
|
|
3691
|
+
async deleteComment({ data }) {
|
|
3692
|
+
try {
|
|
3871
3693
|
const env = getEnv();
|
|
3872
|
-
const
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
group_by: "stage_id",
|
|
3878
|
-
progress_bar: {
|
|
3879
|
-
colors: color,
|
|
3880
|
-
field
|
|
3881
|
-
}
|
|
3882
|
-
},
|
|
3883
|
-
width_context
|
|
3694
|
+
const jsonData = {
|
|
3695
|
+
attachment_ids: [],
|
|
3696
|
+
attachment_tokens: [],
|
|
3697
|
+
body: "",
|
|
3698
|
+
message_id: data.message_id
|
|
3884
3699
|
};
|
|
3885
|
-
return env.requests.post("/
|
|
3700
|
+
return env.requests.post("/chatter/message/update_content" /* DELETE_MESSAGE */, jsonData, {
|
|
3886
3701
|
headers: {
|
|
3887
3702
|
"Content-Type": "application/json"
|
|
3888
3703
|
}
|
|
3889
3704
|
});
|
|
3890
|
-
})
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
var ModelService = {
|
|
3898
|
-
getListMyBankAccount(_0) {
|
|
3899
|
-
return __async(this, arguments, function* ({
|
|
3900
|
-
domain,
|
|
3901
|
-
spectification,
|
|
3902
|
-
model
|
|
3903
|
-
}) {
|
|
3705
|
+
} catch (error) {
|
|
3706
|
+
console.error("Error when sent message:", error);
|
|
3707
|
+
throw error;
|
|
3708
|
+
}
|
|
3709
|
+
},
|
|
3710
|
+
async getImage({ data }) {
|
|
3711
|
+
try {
|
|
3904
3712
|
const env = getEnv();
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
limit: 100,
|
|
3912
|
-
offset: 0
|
|
3913
|
-
}
|
|
3914
|
-
};
|
|
3915
|
-
return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3916
|
-
headers: {
|
|
3917
|
-
"Content-Type": "application/json"
|
|
3713
|
+
return env.requests.get(
|
|
3714
|
+
`${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
|
|
3715
|
+
{
|
|
3716
|
+
headers: {
|
|
3717
|
+
"Content-Type": "application/json"
|
|
3718
|
+
}
|
|
3918
3719
|
}
|
|
3919
|
-
|
|
3920
|
-
})
|
|
3720
|
+
);
|
|
3721
|
+
} catch (error) {
|
|
3722
|
+
console.error("Error when sent message:", error);
|
|
3723
|
+
throw error;
|
|
3724
|
+
}
|
|
3921
3725
|
},
|
|
3922
|
-
|
|
3923
|
-
|
|
3726
|
+
async uploadImage({ data }) {
|
|
3727
|
+
try {
|
|
3924
3728
|
const env = getEnv();
|
|
3925
|
-
|
|
3926
|
-
model: "res.currency",
|
|
3927
|
-
method: "web_search_read",
|
|
3928
|
-
kwargs: {
|
|
3929
|
-
specification: {
|
|
3930
|
-
icon_url: {},
|
|
3931
|
-
name: {}
|
|
3932
|
-
},
|
|
3933
|
-
domain: [["active", "=", true]],
|
|
3934
|
-
limit: 100,
|
|
3935
|
-
offset: 0
|
|
3936
|
-
}
|
|
3937
|
-
};
|
|
3938
|
-
return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3729
|
+
return env.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, data, {
|
|
3939
3730
|
headers: {
|
|
3940
|
-
"Content-Type": "
|
|
3731
|
+
"Content-Type": "multipart/form-data"
|
|
3941
3732
|
}
|
|
3942
3733
|
});
|
|
3943
|
-
})
|
|
3734
|
+
} catch (error) {
|
|
3735
|
+
console.error("Error when sent message:", error);
|
|
3736
|
+
throw error;
|
|
3737
|
+
}
|
|
3944
3738
|
},
|
|
3945
|
-
|
|
3946
|
-
|
|
3739
|
+
async getFormView({ data }) {
|
|
3740
|
+
try {
|
|
3947
3741
|
const env = getEnv();
|
|
3948
3742
|
const jsonData = {
|
|
3949
|
-
model:
|
|
3950
|
-
method: "
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
name: {},
|
|
3954
|
-
icon_url: {},
|
|
3955
|
-
rate_ids: {
|
|
3956
|
-
fields: {
|
|
3957
|
-
company_rate: {},
|
|
3958
|
-
sell: {}
|
|
3959
|
-
}
|
|
3960
|
-
}
|
|
3961
|
-
},
|
|
3962
|
-
domain: [["active", "=", true]],
|
|
3963
|
-
limit: 100,
|
|
3964
|
-
offset: 0
|
|
3965
|
-
}
|
|
3743
|
+
model: data.model,
|
|
3744
|
+
method: "get_formview_action",
|
|
3745
|
+
ids: data.id ? [data.id] : [],
|
|
3746
|
+
with_context: data.context
|
|
3966
3747
|
};
|
|
3967
|
-
return env
|
|
3748
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3968
3749
|
headers: {
|
|
3969
3750
|
"Content-Type": "application/json"
|
|
3970
3751
|
}
|
|
3971
3752
|
});
|
|
3753
|
+
} catch (error) {
|
|
3754
|
+
console.error("Error when fetching form view:", error);
|
|
3755
|
+
throw error;
|
|
3756
|
+
}
|
|
3757
|
+
},
|
|
3758
|
+
async changeStatus({ data }) {
|
|
3759
|
+
const env = getEnv();
|
|
3760
|
+
const vals = {
|
|
3761
|
+
[data.name]: data.stage_id
|
|
3762
|
+
};
|
|
3763
|
+
const jsonData = {
|
|
3764
|
+
model: data.model,
|
|
3765
|
+
method: "web_save",
|
|
3766
|
+
with_context: {
|
|
3767
|
+
lang: data.lang,
|
|
3768
|
+
allowed_company_ids: [1],
|
|
3769
|
+
uid: 2,
|
|
3770
|
+
search_default_my_ticket: true,
|
|
3771
|
+
search_default_is_open: true
|
|
3772
|
+
},
|
|
3773
|
+
ids: [data.id],
|
|
3774
|
+
kwargs: {
|
|
3775
|
+
vals,
|
|
3776
|
+
specification: {}
|
|
3777
|
+
}
|
|
3778
|
+
};
|
|
3779
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3780
|
+
headers: {
|
|
3781
|
+
"Content-Type": "application/json"
|
|
3782
|
+
}
|
|
3783
|
+
});
|
|
3784
|
+
}
|
|
3785
|
+
};
|
|
3786
|
+
var form_service_default = FormService;
|
|
3787
|
+
|
|
3788
|
+
// src/services/kanban-service/index.ts
|
|
3789
|
+
var KanbanServices = {
|
|
3790
|
+
async getGroups({
|
|
3791
|
+
model,
|
|
3792
|
+
width_context
|
|
3793
|
+
}) {
|
|
3794
|
+
const env = getEnv();
|
|
3795
|
+
const jsonDataView = {
|
|
3796
|
+
model,
|
|
3797
|
+
method: "web_read_group",
|
|
3798
|
+
kwargs: {
|
|
3799
|
+
domain: [["stage_id.fold", "=", false]],
|
|
3800
|
+
fields: ["color:sum"],
|
|
3801
|
+
groupby: ["stage_id"]
|
|
3802
|
+
},
|
|
3803
|
+
width_context
|
|
3804
|
+
};
|
|
3805
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
3806
|
+
headers: {
|
|
3807
|
+
"Content-Type": "application/json"
|
|
3808
|
+
}
|
|
3972
3809
|
});
|
|
3973
3810
|
},
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
kwargs: __spreadValues({
|
|
3991
|
-
domain: data.domain,
|
|
3992
|
-
limit: data.limit,
|
|
3993
|
-
offset: data.offset
|
|
3994
|
-
}, jsonReadGroup)
|
|
3995
|
-
};
|
|
3996
|
-
return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3997
|
-
headers: {
|
|
3998
|
-
"Content-Type": "application/json"
|
|
3811
|
+
async getProgressBar({
|
|
3812
|
+
field,
|
|
3813
|
+
color,
|
|
3814
|
+
model,
|
|
3815
|
+
width_context
|
|
3816
|
+
}) {
|
|
3817
|
+
const env = getEnv();
|
|
3818
|
+
const jsonDataView = {
|
|
3819
|
+
model,
|
|
3820
|
+
method: "read_progress_bar",
|
|
3821
|
+
kwargs: {
|
|
3822
|
+
domain: [],
|
|
3823
|
+
group_by: "stage_id",
|
|
3824
|
+
progress_bar: {
|
|
3825
|
+
colors: color,
|
|
3826
|
+
field
|
|
3999
3827
|
}
|
|
4000
|
-
}
|
|
3828
|
+
},
|
|
3829
|
+
width_context
|
|
3830
|
+
};
|
|
3831
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
3832
|
+
headers: {
|
|
3833
|
+
"Content-Type": "application/json"
|
|
3834
|
+
}
|
|
3835
|
+
});
|
|
3836
|
+
}
|
|
3837
|
+
};
|
|
3838
|
+
var kanban_service_default = KanbanServices;
|
|
3839
|
+
|
|
3840
|
+
// src/services/model-service/index.ts
|
|
3841
|
+
var OBJECT_POSITION = 2;
|
|
3842
|
+
var ModelService = {
|
|
3843
|
+
async getListMyBankAccount({
|
|
3844
|
+
domain,
|
|
3845
|
+
spectification,
|
|
3846
|
+
model
|
|
3847
|
+
}) {
|
|
3848
|
+
const env = getEnv();
|
|
3849
|
+
const jsonData = {
|
|
3850
|
+
model,
|
|
3851
|
+
method: "web_search_read",
|
|
3852
|
+
kwargs: {
|
|
3853
|
+
specification: spectification,
|
|
3854
|
+
domain,
|
|
3855
|
+
limit: 100,
|
|
3856
|
+
offset: 0
|
|
3857
|
+
}
|
|
3858
|
+
};
|
|
3859
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3860
|
+
headers: {
|
|
3861
|
+
"Content-Type": "application/json"
|
|
3862
|
+
}
|
|
4001
3863
|
});
|
|
4002
3864
|
},
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
3865
|
+
async getCurrency() {
|
|
3866
|
+
const env = getEnv();
|
|
3867
|
+
const jsonData = {
|
|
3868
|
+
model: "res.currency",
|
|
3869
|
+
method: "web_search_read",
|
|
3870
|
+
kwargs: {
|
|
3871
|
+
specification: {
|
|
3872
|
+
icon_url: {},
|
|
3873
|
+
name: {}
|
|
3874
|
+
},
|
|
3875
|
+
domain: [["active", "=", true]],
|
|
3876
|
+
limit: 100,
|
|
3877
|
+
offset: 0
|
|
3878
|
+
}
|
|
3879
|
+
};
|
|
3880
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3881
|
+
headers: {
|
|
3882
|
+
"Content-Type": "application/json"
|
|
3883
|
+
}
|
|
3884
|
+
});
|
|
3885
|
+
},
|
|
3886
|
+
async getConversionRate() {
|
|
3887
|
+
const env = getEnv();
|
|
3888
|
+
const jsonData = {
|
|
3889
|
+
model: "res.currency",
|
|
3890
|
+
method: "web_search_read",
|
|
3891
|
+
kwargs: {
|
|
3892
|
+
specification: {
|
|
3893
|
+
name: {},
|
|
3894
|
+
icon_url: {},
|
|
3895
|
+
rate_ids: {
|
|
3896
|
+
fields: {
|
|
3897
|
+
company_rate: {},
|
|
3898
|
+
sell: {}
|
|
3899
|
+
}
|
|
3900
|
+
}
|
|
3901
|
+
},
|
|
3902
|
+
domain: [["active", "=", true]],
|
|
3903
|
+
limit: 100,
|
|
3904
|
+
offset: 0
|
|
3905
|
+
}
|
|
3906
|
+
};
|
|
3907
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3908
|
+
headers: {
|
|
3909
|
+
"Content-Type": "application/json"
|
|
3910
|
+
}
|
|
3911
|
+
});
|
|
3912
|
+
},
|
|
3913
|
+
async getAll({ data }) {
|
|
3914
|
+
const env = getEnv();
|
|
3915
|
+
const jsonReadGroup = data.type == "calendar" ? { fields: data?.fields } : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
3916
|
+
fields: data.fields,
|
|
3917
|
+
groupby: data.groupby
|
|
3918
|
+
} : {
|
|
3919
|
+
count_limit: 10001,
|
|
3920
|
+
order: data.sort,
|
|
3921
|
+
specification: data.specification
|
|
3922
|
+
};
|
|
3923
|
+
const jsonData = {
|
|
3924
|
+
model: String(data.model),
|
|
3925
|
+
method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
|
|
3926
|
+
ids: data.ids,
|
|
3927
|
+
with_context: data.context,
|
|
3928
|
+
kwargs: {
|
|
3929
|
+
domain: data.domain,
|
|
3930
|
+
limit: data.limit,
|
|
3931
|
+
offset: data.offset,
|
|
3932
|
+
...jsonReadGroup
|
|
3933
|
+
}
|
|
3934
|
+
};
|
|
3935
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3936
|
+
headers: {
|
|
3937
|
+
"Content-Type": "application/json"
|
|
3938
|
+
}
|
|
3939
|
+
});
|
|
3940
|
+
},
|
|
3941
|
+
async getListCalendar({ data }) {
|
|
3942
|
+
const env = getEnv();
|
|
3943
|
+
const jsonReadGroup = data.type == "calendar" ? data?.fields : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
3944
|
+
fields: data.fields,
|
|
3945
|
+
groupby: data.groupby
|
|
3946
|
+
} : {
|
|
3947
|
+
count_limit: 10001,
|
|
3948
|
+
order: data.sort,
|
|
3949
|
+
specification: data.specification
|
|
3950
|
+
};
|
|
3951
|
+
const jsonData = {
|
|
3952
|
+
model: String(data.model),
|
|
3953
|
+
method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
|
|
3954
|
+
ids: data.ids,
|
|
3955
|
+
with_context: data.context,
|
|
3956
|
+
kwargs: {
|
|
3957
|
+
domain: data.domain,
|
|
3958
|
+
limit: data.limit,
|
|
3959
|
+
offset: data.offset,
|
|
4007
3960
|
fields: data.fields,
|
|
4008
|
-
|
|
4009
|
-
}
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
model: String(data.model),
|
|
4016
|
-
method: data.type == "calendar" ? "search_read" : jsonReadGroup.fields && jsonReadGroup.groupby ? "web_read_group" : "web_search_read",
|
|
4017
|
-
ids: data.ids,
|
|
4018
|
-
with_context: data.context,
|
|
4019
|
-
kwargs: __spreadValues({
|
|
4020
|
-
domain: data.domain,
|
|
4021
|
-
limit: data.limit,
|
|
4022
|
-
offset: data.offset,
|
|
4023
|
-
fields: data.fields
|
|
4024
|
-
}, jsonReadGroup)
|
|
4025
|
-
};
|
|
4026
|
-
return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4027
|
-
headers: {
|
|
4028
|
-
"Content-Type": "application/json"
|
|
4029
|
-
}
|
|
4030
|
-
});
|
|
3961
|
+
...jsonReadGroup
|
|
3962
|
+
}
|
|
3963
|
+
};
|
|
3964
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3965
|
+
headers: {
|
|
3966
|
+
"Content-Type": "application/json"
|
|
3967
|
+
}
|
|
4031
3968
|
});
|
|
4032
3969
|
},
|
|
4033
|
-
getList(
|
|
4034
|
-
|
|
3970
|
+
async getList({
|
|
3971
|
+
model,
|
|
3972
|
+
ids = [],
|
|
3973
|
+
specification = {},
|
|
3974
|
+
domain = [],
|
|
3975
|
+
offset,
|
|
3976
|
+
order,
|
|
3977
|
+
context = {},
|
|
3978
|
+
limit = 10
|
|
3979
|
+
}) {
|
|
3980
|
+
const env = getEnv();
|
|
3981
|
+
const jsonData = {
|
|
4035
3982
|
model,
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
kwargs: {
|
|
4052
|
-
specification,
|
|
4053
|
-
domain,
|
|
4054
|
-
limit,
|
|
4055
|
-
offset,
|
|
4056
|
-
order
|
|
4057
|
-
}
|
|
4058
|
-
};
|
|
4059
|
-
return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
4060
|
-
headers: {
|
|
4061
|
-
"Content-Type": "application/json"
|
|
4062
|
-
}
|
|
4063
|
-
});
|
|
3983
|
+
method: "web_search_read" /* WEB_SEARCH_READ */,
|
|
3984
|
+
ids,
|
|
3985
|
+
with_context: context,
|
|
3986
|
+
kwargs: {
|
|
3987
|
+
specification,
|
|
3988
|
+
domain,
|
|
3989
|
+
limit,
|
|
3990
|
+
offset,
|
|
3991
|
+
order
|
|
3992
|
+
}
|
|
3993
|
+
};
|
|
3994
|
+
return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
3995
|
+
headers: {
|
|
3996
|
+
"Content-Type": "application/json"
|
|
3997
|
+
}
|
|
4064
3998
|
});
|
|
4065
3999
|
},
|
|
4066
|
-
getDetail(
|
|
4067
|
-
|
|
4068
|
-
|
|
4000
|
+
async getDetail({
|
|
4001
|
+
ids = [],
|
|
4002
|
+
model,
|
|
4003
|
+
specification,
|
|
4004
|
+
context
|
|
4005
|
+
}) {
|
|
4006
|
+
const env = getEnv();
|
|
4007
|
+
const jsonData = {
|
|
4069
4008
|
model,
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
specification
|
|
4082
|
-
}
|
|
4083
|
-
};
|
|
4084
|
-
return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
4085
|
-
headers: {
|
|
4086
|
-
"Content-Type": "application/json"
|
|
4087
|
-
}
|
|
4088
|
-
});
|
|
4009
|
+
method: "web_read" /* WEB_READ */,
|
|
4010
|
+
ids,
|
|
4011
|
+
with_context: context,
|
|
4012
|
+
kwargs: {
|
|
4013
|
+
specification
|
|
4014
|
+
}
|
|
4015
|
+
};
|
|
4016
|
+
return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4017
|
+
headers: {
|
|
4018
|
+
"Content-Type": "application/json"
|
|
4019
|
+
}
|
|
4089
4020
|
});
|
|
4090
4021
|
},
|
|
4091
|
-
save(
|
|
4092
|
-
|
|
4022
|
+
async save({
|
|
4023
|
+
model,
|
|
4024
|
+
ids = [],
|
|
4025
|
+
data = {},
|
|
4026
|
+
specification = {},
|
|
4027
|
+
context = {},
|
|
4028
|
+
path
|
|
4029
|
+
}) {
|
|
4030
|
+
const env = getEnv();
|
|
4031
|
+
const jsonData = {
|
|
4093
4032
|
model,
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
ids,
|
|
4107
|
-
kwargs: {
|
|
4108
|
-
vals: data,
|
|
4109
|
-
specification
|
|
4110
|
-
}
|
|
4111
|
-
};
|
|
4112
|
-
return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post(path != null ? path : "/call" /* CALL_PATH */, jsonData, {
|
|
4113
|
-
headers: {
|
|
4114
|
-
"Content-Type": "application/json"
|
|
4115
|
-
}
|
|
4116
|
-
});
|
|
4033
|
+
method: "web_save" /* WEB_SAVE */,
|
|
4034
|
+
with_context: context,
|
|
4035
|
+
ids,
|
|
4036
|
+
kwargs: {
|
|
4037
|
+
vals: data,
|
|
4038
|
+
specification
|
|
4039
|
+
}
|
|
4040
|
+
};
|
|
4041
|
+
return env?.requests?.post(path ?? "/call" /* CALL_PATH */, jsonData, {
|
|
4042
|
+
headers: {
|
|
4043
|
+
"Content-Type": "application/json"
|
|
4044
|
+
}
|
|
4117
4045
|
});
|
|
4118
4046
|
},
|
|
4119
|
-
delete(
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
"Content-Type": "application/json"
|
|
4131
|
-
}
|
|
4132
|
-
});
|
|
4047
|
+
async delete({ ids = [], model }) {
|
|
4048
|
+
const env = getEnv();
|
|
4049
|
+
const jsonData = {
|
|
4050
|
+
model,
|
|
4051
|
+
method: "unlink" /* UNLINK */,
|
|
4052
|
+
ids
|
|
4053
|
+
};
|
|
4054
|
+
return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4055
|
+
headers: {
|
|
4056
|
+
"Content-Type": "application/json"
|
|
4057
|
+
}
|
|
4133
4058
|
});
|
|
4134
4059
|
},
|
|
4135
|
-
onChange(
|
|
4136
|
-
|
|
4137
|
-
|
|
4060
|
+
async onChange({
|
|
4061
|
+
ids = [],
|
|
4062
|
+
model,
|
|
4063
|
+
object,
|
|
4064
|
+
specification,
|
|
4065
|
+
context,
|
|
4066
|
+
fieldChange
|
|
4067
|
+
}) {
|
|
4068
|
+
const env = getEnv();
|
|
4069
|
+
const jsonData = {
|
|
4138
4070
|
model,
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
context,
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
object ? object : {},
|
|
4153
|
-
fieldChange ? fieldChange : [],
|
|
4154
|
-
specification
|
|
4155
|
-
]
|
|
4156
|
-
};
|
|
4157
|
-
return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
4158
|
-
headers: {
|
|
4159
|
-
"Content-Type": "application/json"
|
|
4160
|
-
}
|
|
4161
|
-
});
|
|
4071
|
+
method: "onchange" /* ONCHANGE */,
|
|
4072
|
+
ids,
|
|
4073
|
+
with_context: context,
|
|
4074
|
+
args: [
|
|
4075
|
+
object ? object : {},
|
|
4076
|
+
fieldChange ? fieldChange : [],
|
|
4077
|
+
specification
|
|
4078
|
+
]
|
|
4079
|
+
};
|
|
4080
|
+
return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4081
|
+
headers: {
|
|
4082
|
+
"Content-Type": "application/json"
|
|
4083
|
+
}
|
|
4162
4084
|
});
|
|
4163
4085
|
},
|
|
4164
|
-
getListFieldsOnchange(
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
"Content-Type": "application/json"
|
|
4175
|
-
}
|
|
4176
|
-
});
|
|
4086
|
+
async getListFieldsOnchange({ model }) {
|
|
4087
|
+
const env = getEnv();
|
|
4088
|
+
const jsonData = {
|
|
4089
|
+
model,
|
|
4090
|
+
method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
|
|
4091
|
+
};
|
|
4092
|
+
return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4093
|
+
headers: {
|
|
4094
|
+
"Content-Type": "application/json"
|
|
4095
|
+
}
|
|
4177
4096
|
});
|
|
4178
4097
|
},
|
|
4179
4098
|
parseORMOdoo(data) {
|
|
@@ -4187,14 +4106,13 @@ var ModelService = {
|
|
|
4187
4106
|
data[key] = "/";
|
|
4188
4107
|
}
|
|
4189
4108
|
}
|
|
4190
|
-
return
|
|
4109
|
+
return { ...data };
|
|
4191
4110
|
},
|
|
4192
4111
|
toDataJS(data, viewData, model) {
|
|
4193
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
4194
4112
|
for (const key in data) {
|
|
4195
4113
|
if (data[key] === false) {
|
|
4196
4114
|
if (viewData && model) {
|
|
4197
|
-
if (
|
|
4115
|
+
if (viewData?.models?.[model]?.[key]?.type !== "boolean" /* BOOLEAN */) {
|
|
4198
4116
|
data[key] = null;
|
|
4199
4117
|
}
|
|
4200
4118
|
} else {
|
|
@@ -4204,13 +4122,12 @@ var ModelService = {
|
|
|
4204
4122
|
data[key] = "Draft";
|
|
4205
4123
|
} else if (data[key] !== false) {
|
|
4206
4124
|
if (model !== void 0) {
|
|
4207
|
-
if (
|
|
4208
|
-
data[key] = (
|
|
4209
|
-
|
|
4210
|
-
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;
|
|
4125
|
+
if (viewData?.models?.[model]?.[key]?.type === "one2many" /* ONE2MANY */ || viewData?.models?.[model]?.[key]?.type === "many2many" /* MANY2MANY */) {
|
|
4126
|
+
data[key] = (data[key] ??= [])?.map((item) => {
|
|
4127
|
+
const relation = viewData?.models?.[model]?.[key]?.relation;
|
|
4211
4128
|
if (relation !== void 0) {
|
|
4212
|
-
if (
|
|
4213
|
-
if (
|
|
4129
|
+
if (viewData?.models?.[relation]) {
|
|
4130
|
+
if (item?.length >= 3) {
|
|
4214
4131
|
return ModelService.toDataJS(
|
|
4215
4132
|
item[OBJECT_POSITION],
|
|
4216
4133
|
viewData,
|
|
@@ -4220,7 +4137,7 @@ var ModelService = {
|
|
|
4220
4137
|
return ModelService.toDataJS(item, viewData, relation);
|
|
4221
4138
|
}
|
|
4222
4139
|
} else {
|
|
4223
|
-
if (
|
|
4140
|
+
if (item?.length >= 3) {
|
|
4224
4141
|
return item[OBJECT_POSITION];
|
|
4225
4142
|
} else {
|
|
4226
4143
|
return item;
|
|
@@ -4232,568 +4149,528 @@ var ModelService = {
|
|
|
4232
4149
|
}
|
|
4233
4150
|
}
|
|
4234
4151
|
}
|
|
4235
|
-
return
|
|
4152
|
+
return { ...data };
|
|
4236
4153
|
}
|
|
4237
4154
|
};
|
|
4238
4155
|
var model_service_default = ModelService;
|
|
4239
4156
|
|
|
4240
4157
|
// src/services/user-service/index.ts
|
|
4241
4158
|
var UserService = {
|
|
4242
|
-
getProfile(path) {
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
}
|
|
4249
|
-
});
|
|
4159
|
+
async getProfile(path) {
|
|
4160
|
+
const env = getEnv();
|
|
4161
|
+
return env.requests.get(path ?? "/userinfo" /* PROFILE_PATH */, {
|
|
4162
|
+
headers: {
|
|
4163
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
4164
|
+
}
|
|
4250
4165
|
});
|
|
4251
4166
|
},
|
|
4252
|
-
getUser(
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
display_name: {}
|
|
4278
|
-
}
|
|
4167
|
+
async getUser({ context, id }) {
|
|
4168
|
+
const env = getEnv();
|
|
4169
|
+
const jsonData = {
|
|
4170
|
+
model: "res.users",
|
|
4171
|
+
method: "web_read",
|
|
4172
|
+
ids: [id],
|
|
4173
|
+
with_context: context,
|
|
4174
|
+
kwargs: {
|
|
4175
|
+
specification: {
|
|
4176
|
+
display_name: {},
|
|
4177
|
+
image_1920: {},
|
|
4178
|
+
name: {},
|
|
4179
|
+
login: {},
|
|
4180
|
+
email: {},
|
|
4181
|
+
password: {},
|
|
4182
|
+
visible_group_id: {
|
|
4183
|
+
fields: {
|
|
4184
|
+
id: {},
|
|
4185
|
+
display_name: {}
|
|
4186
|
+
}
|
|
4187
|
+
},
|
|
4188
|
+
company_id: {
|
|
4189
|
+
fields: {
|
|
4190
|
+
id: {},
|
|
4191
|
+
display_name: {}
|
|
4279
4192
|
}
|
|
4280
4193
|
}
|
|
4281
4194
|
}
|
|
4282
|
-
}
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
}
|
|
4195
|
+
}
|
|
4196
|
+
};
|
|
4197
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4198
|
+
headers: {
|
|
4199
|
+
"Content-Type": "application/json"
|
|
4200
|
+
}
|
|
4288
4201
|
});
|
|
4289
4202
|
},
|
|
4290
|
-
switchUserLocale:
|
|
4291
|
-
var _a;
|
|
4203
|
+
switchUserLocale: async ({ id, values }) => {
|
|
4292
4204
|
const env = getEnv();
|
|
4293
4205
|
const jsonData = {
|
|
4294
4206
|
model: "res.users",
|
|
4295
4207
|
domain: [["id", "=", id]],
|
|
4296
4208
|
values
|
|
4297
4209
|
};
|
|
4298
|
-
return env
|
|
4210
|
+
return env?.requests.post(UriConstants?.CREATE_UPDATE_PATH, jsonData, {
|
|
4299
4211
|
headers: {
|
|
4300
4212
|
"Content-Type": "application/json"
|
|
4301
4213
|
}
|
|
4302
4214
|
});
|
|
4303
|
-
}
|
|
4215
|
+
}
|
|
4304
4216
|
};
|
|
4305
4217
|
var user_service_default = UserService;
|
|
4306
4218
|
|
|
4307
4219
|
// src/services/view-service/index.ts
|
|
4308
4220
|
var ViewService = {
|
|
4309
|
-
getView(
|
|
4310
|
-
|
|
4221
|
+
async getView({
|
|
4222
|
+
model,
|
|
4223
|
+
views,
|
|
4224
|
+
context = {},
|
|
4225
|
+
options = {},
|
|
4226
|
+
aid
|
|
4227
|
+
}) {
|
|
4228
|
+
const env = getEnv();
|
|
4229
|
+
const defaultOptions = {
|
|
4230
|
+
load_filters: true,
|
|
4231
|
+
toolbar: true,
|
|
4232
|
+
action_id: aid
|
|
4233
|
+
};
|
|
4234
|
+
const jsonDataView = {
|
|
4311
4235
|
model,
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
};
|
|
4324
|
-
const jsonDataView = {
|
|
4325
|
-
model,
|
|
4326
|
-
method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
|
|
4327
|
-
kwargs: {
|
|
4328
|
-
views,
|
|
4329
|
-
options: __spreadValues(__spreadValues({}, options), defaultOptions)
|
|
4330
|
-
},
|
|
4331
|
-
with_context: context
|
|
4332
|
-
};
|
|
4333
|
-
return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
4334
|
-
headers: {
|
|
4335
|
-
"Content-Type": "application/json"
|
|
4336
|
-
}
|
|
4337
|
-
});
|
|
4236
|
+
method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
|
|
4237
|
+
kwargs: {
|
|
4238
|
+
views,
|
|
4239
|
+
options: { ...options, ...defaultOptions }
|
|
4240
|
+
},
|
|
4241
|
+
with_context: context
|
|
4242
|
+
};
|
|
4243
|
+
return env?.requests?.post("/call" /* CALL_PATH */, jsonDataView, {
|
|
4244
|
+
headers: {
|
|
4245
|
+
"Content-Type": "application/json"
|
|
4246
|
+
}
|
|
4338
4247
|
});
|
|
4339
4248
|
},
|
|
4340
|
-
getMenu(context) {
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4249
|
+
async getMenu(context) {
|
|
4250
|
+
const env = getEnv();
|
|
4251
|
+
const jsonData = {
|
|
4252
|
+
model: "ir.ui.menu" /* MENU */,
|
|
4253
|
+
method: "web_search_read" /* WEB_SEARCH_READ */,
|
|
4254
|
+
ids: [],
|
|
4255
|
+
with_context: context,
|
|
4256
|
+
kwargs: {
|
|
4257
|
+
specification: {
|
|
4258
|
+
active: {},
|
|
4259
|
+
name: {},
|
|
4260
|
+
is_display: {},
|
|
4261
|
+
sequence: {},
|
|
4262
|
+
complete_name: {},
|
|
4263
|
+
action: {
|
|
4264
|
+
fields: {
|
|
4265
|
+
display_name: {},
|
|
4266
|
+
type: {},
|
|
4267
|
+
binding_view_types: {}
|
|
4268
|
+
// res_model: {},
|
|
4269
|
+
}
|
|
4270
|
+
},
|
|
4271
|
+
url_icon: {},
|
|
4272
|
+
web_icon: {},
|
|
4273
|
+
web_icon_data: {},
|
|
4274
|
+
groups_id: {
|
|
4275
|
+
fields: {
|
|
4276
|
+
full_name: {}
|
|
4363
4277
|
},
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4278
|
+
limit: 40,
|
|
4279
|
+
order: ""
|
|
4280
|
+
},
|
|
4281
|
+
display_name: {},
|
|
4282
|
+
child_id: {
|
|
4283
|
+
fields: {
|
|
4284
|
+
active: {},
|
|
4285
|
+
name: {},
|
|
4286
|
+
is_display: {},
|
|
4287
|
+
sequence: {},
|
|
4288
|
+
complete_name: {},
|
|
4289
|
+
action: {
|
|
4290
|
+
fields: {
|
|
4291
|
+
display_name: {},
|
|
4292
|
+
type: {},
|
|
4293
|
+
binding_view_types: {}
|
|
4294
|
+
// res_model: {},
|
|
4295
|
+
}
|
|
4370
4296
|
},
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
active: {},
|
|
4378
|
-
name: {},
|
|
4379
|
-
is_display: {},
|
|
4380
|
-
sequence: {},
|
|
4381
|
-
complete_name: {},
|
|
4382
|
-
action: {
|
|
4383
|
-
fields: {
|
|
4384
|
-
display_name: {},
|
|
4385
|
-
type: {},
|
|
4386
|
-
binding_view_types: {}
|
|
4387
|
-
// res_model: {},
|
|
4388
|
-
}
|
|
4297
|
+
url_icon: {},
|
|
4298
|
+
web_icon: {},
|
|
4299
|
+
web_icon_data: {},
|
|
4300
|
+
groups_id: {
|
|
4301
|
+
fields: {
|
|
4302
|
+
full_name: {}
|
|
4389
4303
|
},
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4304
|
+
limit: 40,
|
|
4305
|
+
order: ""
|
|
4306
|
+
},
|
|
4307
|
+
display_name: {},
|
|
4308
|
+
child_id: {
|
|
4309
|
+
fields: {
|
|
4310
|
+
active: {},
|
|
4311
|
+
name: {},
|
|
4312
|
+
is_display: {},
|
|
4313
|
+
sequence: {},
|
|
4314
|
+
complete_name: {},
|
|
4315
|
+
action: {
|
|
4316
|
+
fields: {
|
|
4317
|
+
display_name: {},
|
|
4318
|
+
type: {},
|
|
4319
|
+
binding_view_types: {}
|
|
4320
|
+
// res_model: {},
|
|
4321
|
+
}
|
|
4396
4322
|
},
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
active: {},
|
|
4404
|
-
name: {},
|
|
4405
|
-
is_display: {},
|
|
4406
|
-
sequence: {},
|
|
4407
|
-
complete_name: {},
|
|
4408
|
-
action: {
|
|
4409
|
-
fields: {
|
|
4410
|
-
display_name: {},
|
|
4411
|
-
type: {},
|
|
4412
|
-
binding_view_types: {}
|
|
4413
|
-
// res_model: {},
|
|
4414
|
-
}
|
|
4323
|
+
url_icon: {},
|
|
4324
|
+
web_icon: {},
|
|
4325
|
+
web_icon_data: {},
|
|
4326
|
+
groups_id: {
|
|
4327
|
+
fields: {
|
|
4328
|
+
full_name: {}
|
|
4415
4329
|
},
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4330
|
+
limit: 40,
|
|
4331
|
+
order: ""
|
|
4332
|
+
},
|
|
4333
|
+
display_name: {},
|
|
4334
|
+
child_id: {
|
|
4335
|
+
fields: {
|
|
4336
|
+
active: {},
|
|
4337
|
+
name: {},
|
|
4338
|
+
is_display: {},
|
|
4339
|
+
sequence: {},
|
|
4340
|
+
complete_name: {},
|
|
4341
|
+
action: {
|
|
4342
|
+
fields: {
|
|
4343
|
+
display_name: {},
|
|
4344
|
+
type: {},
|
|
4345
|
+
binding_view_types: {}
|
|
4346
|
+
// res_model: {},
|
|
4347
|
+
}
|
|
4422
4348
|
},
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
active: {},
|
|
4430
|
-
name: {},
|
|
4431
|
-
is_display: {},
|
|
4432
|
-
sequence: {},
|
|
4433
|
-
complete_name: {},
|
|
4434
|
-
action: {
|
|
4435
|
-
fields: {
|
|
4436
|
-
display_name: {},
|
|
4437
|
-
type: {},
|
|
4438
|
-
binding_view_types: {}
|
|
4439
|
-
// res_model: {},
|
|
4440
|
-
}
|
|
4441
|
-
},
|
|
4442
|
-
url_icon: {},
|
|
4443
|
-
web_icon: {},
|
|
4444
|
-
web_icon_data: {},
|
|
4445
|
-
groups_id: {
|
|
4446
|
-
fields: {
|
|
4447
|
-
full_name: {}
|
|
4448
|
-
},
|
|
4449
|
-
limit: 40,
|
|
4450
|
-
order: ""
|
|
4349
|
+
url_icon: {},
|
|
4350
|
+
web_icon: {},
|
|
4351
|
+
web_icon_data: {},
|
|
4352
|
+
groups_id: {
|
|
4353
|
+
fields: {
|
|
4354
|
+
full_name: {}
|
|
4451
4355
|
},
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
fields: {},
|
|
4455
|
-
limit: 40,
|
|
4456
|
-
order: ""
|
|
4457
|
-
}
|
|
4356
|
+
limit: 40,
|
|
4357
|
+
order: ""
|
|
4458
4358
|
},
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
"
|
|
4483
|
-
|
|
4484
|
-
|
|
4359
|
+
display_name: {},
|
|
4360
|
+
child_id: {
|
|
4361
|
+
fields: {},
|
|
4362
|
+
limit: 40,
|
|
4363
|
+
order: ""
|
|
4364
|
+
}
|
|
4365
|
+
},
|
|
4366
|
+
limit: 40,
|
|
4367
|
+
order: ""
|
|
4368
|
+
}
|
|
4369
|
+
},
|
|
4370
|
+
limit: 40,
|
|
4371
|
+
order: ""
|
|
4372
|
+
}
|
|
4373
|
+
},
|
|
4374
|
+
limit: 40,
|
|
4375
|
+
order: ""
|
|
4376
|
+
}
|
|
4377
|
+
},
|
|
4378
|
+
domain: [
|
|
4379
|
+
"&",
|
|
4380
|
+
["is_display", "=", true],
|
|
4381
|
+
"&",
|
|
4382
|
+
["active", "=", true],
|
|
4383
|
+
["parent_id", "=", false]
|
|
4384
|
+
]
|
|
4385
|
+
}
|
|
4386
|
+
};
|
|
4387
|
+
return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4388
|
+
headers: {
|
|
4389
|
+
"Content-Type": "application/json"
|
|
4390
|
+
}
|
|
4485
4391
|
});
|
|
4486
4392
|
},
|
|
4487
|
-
getActionDetail(aid, context) {
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
groups_id: {},
|
|
4507
|
-
search_view_id: {}
|
|
4508
|
-
}
|
|
4509
|
-
}
|
|
4510
|
-
};
|
|
4511
|
-
return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
|
|
4512
|
-
headers: {
|
|
4513
|
-
"Content-Type": "application/json"
|
|
4393
|
+
async getActionDetail(aid, context) {
|
|
4394
|
+
const env = getEnv();
|
|
4395
|
+
const jsonData = {
|
|
4396
|
+
model: "ir.actions.act_window" /* WINDOW_ACTION */,
|
|
4397
|
+
method: "web_read" /* WEB_READ */,
|
|
4398
|
+
ids: [aid],
|
|
4399
|
+
with_context: context,
|
|
4400
|
+
kwargs: {
|
|
4401
|
+
specification: {
|
|
4402
|
+
id: {},
|
|
4403
|
+
name: {},
|
|
4404
|
+
res_model: {},
|
|
4405
|
+
views: {},
|
|
4406
|
+
view_mode: {},
|
|
4407
|
+
mobile_view_mode: {},
|
|
4408
|
+
domain: {},
|
|
4409
|
+
context: {},
|
|
4410
|
+
groups_id: {},
|
|
4411
|
+
search_view_id: {}
|
|
4514
4412
|
}
|
|
4515
|
-
}
|
|
4413
|
+
}
|
|
4414
|
+
};
|
|
4415
|
+
return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
|
|
4416
|
+
headers: {
|
|
4417
|
+
"Content-Type": "application/json"
|
|
4418
|
+
}
|
|
4516
4419
|
});
|
|
4517
4420
|
},
|
|
4518
|
-
getResequence(
|
|
4519
|
-
|
|
4421
|
+
async getResequence({
|
|
4422
|
+
model,
|
|
4423
|
+
ids,
|
|
4424
|
+
context,
|
|
4425
|
+
offset
|
|
4426
|
+
}) {
|
|
4427
|
+
const env = getEnv();
|
|
4428
|
+
const jsonData = {
|
|
4520
4429
|
model,
|
|
4430
|
+
with_context: context,
|
|
4521
4431
|
ids,
|
|
4522
|
-
|
|
4523
|
-
offset
|
|
4524
|
-
}
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
ids,
|
|
4530
|
-
field: "sequence"
|
|
4531
|
-
}, offset > 0 ? { offset } : {});
|
|
4532
|
-
return env == null ? void 0 : env.requests.post("/web/dataset/resequence", jsonData, {
|
|
4533
|
-
headers: {
|
|
4534
|
-
"Content-Type": "application/json"
|
|
4535
|
-
}
|
|
4536
|
-
});
|
|
4537
|
-
});
|
|
4538
|
-
},
|
|
4539
|
-
getSelectionItem(_0) {
|
|
4540
|
-
return __async(this, arguments, function* ({ data }) {
|
|
4541
|
-
var _a;
|
|
4542
|
-
const env = getEnv();
|
|
4543
|
-
const jsonData = {
|
|
4544
|
-
model: data.model,
|
|
4545
|
-
ids: [],
|
|
4546
|
-
method: "get_data_select",
|
|
4547
|
-
with_context: data.context,
|
|
4548
|
-
kwargs: {
|
|
4549
|
-
count_limit: 10001,
|
|
4550
|
-
domain: data.domain ? data.domain : [],
|
|
4551
|
-
offset: 0,
|
|
4552
|
-
order: "",
|
|
4553
|
-
specification: (_a = data == null ? void 0 : data.specification) != null ? _a : {
|
|
4554
|
-
id: {},
|
|
4555
|
-
name: {},
|
|
4556
|
-
display_name: {}
|
|
4557
|
-
}
|
|
4558
|
-
}
|
|
4559
|
-
};
|
|
4560
|
-
return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4561
|
-
headers: {
|
|
4562
|
-
"Content-Type": "application/json"
|
|
4563
|
-
}
|
|
4564
|
-
});
|
|
4432
|
+
field: "sequence",
|
|
4433
|
+
...offset > 0 ? { offset } : {}
|
|
4434
|
+
};
|
|
4435
|
+
return env?.requests.post("/web/dataset/resequence", jsonData, {
|
|
4436
|
+
headers: {
|
|
4437
|
+
"Content-Type": "application/json"
|
|
4438
|
+
}
|
|
4565
4439
|
});
|
|
4566
4440
|
},
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4441
|
+
async getSelectionItem({ data }) {
|
|
4442
|
+
const env = getEnv();
|
|
4443
|
+
const jsonData = {
|
|
4444
|
+
model: data.model,
|
|
4445
|
+
ids: [],
|
|
4446
|
+
method: "get_data_select",
|
|
4447
|
+
with_context: data.context,
|
|
4448
|
+
kwargs: {
|
|
4449
|
+
count_limit: 10001,
|
|
4450
|
+
domain: data.domain ? data.domain : [],
|
|
4451
|
+
offset: 0,
|
|
4452
|
+
order: "",
|
|
4453
|
+
specification: data?.specification ?? {
|
|
4454
|
+
id: {},
|
|
4455
|
+
name: {},
|
|
4456
|
+
display_name: {}
|
|
4577
4457
|
}
|
|
4578
|
-
|
|
4458
|
+
}
|
|
4459
|
+
};
|
|
4460
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4461
|
+
headers: {
|
|
4462
|
+
"Content-Type": "application/json"
|
|
4463
|
+
}
|
|
4579
4464
|
});
|
|
4580
4465
|
},
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4466
|
+
async loadMessages() {
|
|
4467
|
+
const env = getEnv();
|
|
4468
|
+
return env.requests.post(
|
|
4469
|
+
"/load_message_failures" /* LOAD_MESSAGE */,
|
|
4470
|
+
{},
|
|
4471
|
+
{
|
|
4587
4472
|
headers: {
|
|
4588
4473
|
"Content-Type": "application/json"
|
|
4589
4474
|
}
|
|
4590
|
-
}
|
|
4475
|
+
}
|
|
4476
|
+
);
|
|
4477
|
+
},
|
|
4478
|
+
async getVersion() {
|
|
4479
|
+
const env = getEnv();
|
|
4480
|
+
console.log("env?.requests", env, env?.requests);
|
|
4481
|
+
return env?.requests?.get("", {
|
|
4482
|
+
headers: {
|
|
4483
|
+
"Content-Type": "application/json"
|
|
4484
|
+
}
|
|
4591
4485
|
});
|
|
4592
4486
|
},
|
|
4593
|
-
get2FAMethods(
|
|
4594
|
-
|
|
4487
|
+
async get2FAMethods({
|
|
4488
|
+
method,
|
|
4489
|
+
with_context
|
|
4490
|
+
}) {
|
|
4491
|
+
const env = getEnv();
|
|
4492
|
+
const jsonData = {
|
|
4595
4493
|
method,
|
|
4596
4494
|
with_context
|
|
4597
|
-
}
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
};
|
|
4603
|
-
return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4604
|
-
headers: {
|
|
4605
|
-
"Content-Type": "application/json"
|
|
4606
|
-
}
|
|
4607
|
-
});
|
|
4495
|
+
};
|
|
4496
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4497
|
+
headers: {
|
|
4498
|
+
"Content-Type": "application/json"
|
|
4499
|
+
}
|
|
4608
4500
|
});
|
|
4609
4501
|
},
|
|
4610
|
-
verify2FA(
|
|
4611
|
-
|
|
4502
|
+
async verify2FA({
|
|
4503
|
+
method,
|
|
4504
|
+
with_context,
|
|
4505
|
+
code,
|
|
4506
|
+
device,
|
|
4507
|
+
location
|
|
4508
|
+
}) {
|
|
4509
|
+
const env = getEnv();
|
|
4510
|
+
const jsonData = {
|
|
4612
4511
|
method,
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
},
|
|
4628
|
-
with_context
|
|
4629
|
-
};
|
|
4630
|
-
return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4631
|
-
headers: {
|
|
4632
|
-
"Content-Type": "application/json"
|
|
4633
|
-
},
|
|
4634
|
-
withCredentials: true
|
|
4635
|
-
});
|
|
4512
|
+
kwargs: {
|
|
4513
|
+
vals: {
|
|
4514
|
+
code,
|
|
4515
|
+
device,
|
|
4516
|
+
location
|
|
4517
|
+
}
|
|
4518
|
+
},
|
|
4519
|
+
with_context
|
|
4520
|
+
};
|
|
4521
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4522
|
+
headers: {
|
|
4523
|
+
"Content-Type": "application/json"
|
|
4524
|
+
},
|
|
4525
|
+
withCredentials: true
|
|
4636
4526
|
});
|
|
4637
4527
|
},
|
|
4638
|
-
signInSSO(
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4528
|
+
async signInSSO({
|
|
4529
|
+
redirect_uri,
|
|
4530
|
+
state,
|
|
4531
|
+
client_id,
|
|
4532
|
+
response_type,
|
|
4533
|
+
path
|
|
4534
|
+
}) {
|
|
4535
|
+
const env = getEnv();
|
|
4536
|
+
const params = new URLSearchParams({
|
|
4643
4537
|
response_type,
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
}
|
|
4653
|
-
|
|
4654
|
-
return env == null ? void 0 : env.requests.get(url, {
|
|
4655
|
-
headers: {
|
|
4656
|
-
"Content-Type": "application/json"
|
|
4657
|
-
},
|
|
4658
|
-
withCredentials: true
|
|
4659
|
-
});
|
|
4538
|
+
client_id,
|
|
4539
|
+
redirect_uri,
|
|
4540
|
+
state
|
|
4541
|
+
});
|
|
4542
|
+
const url = `${path}?${params.toString()}`;
|
|
4543
|
+
return env?.requests.get(url, {
|
|
4544
|
+
headers: {
|
|
4545
|
+
"Content-Type": "application/json"
|
|
4546
|
+
},
|
|
4547
|
+
withCredentials: true
|
|
4660
4548
|
});
|
|
4661
4549
|
},
|
|
4662
|
-
grantAccess(
|
|
4663
|
-
|
|
4550
|
+
async grantAccess({
|
|
4551
|
+
redirect_uri,
|
|
4552
|
+
state,
|
|
4553
|
+
client_id,
|
|
4554
|
+
scopes
|
|
4555
|
+
}) {
|
|
4556
|
+
const env = getEnv();
|
|
4557
|
+
const jsonData = {
|
|
4664
4558
|
redirect_uri,
|
|
4665
4559
|
state,
|
|
4666
4560
|
client_id,
|
|
4667
4561
|
scopes
|
|
4668
|
-
}
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
scopes
|
|
4675
|
-
};
|
|
4676
|
-
return env == null ? void 0 : env.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
|
|
4677
|
-
headers: {
|
|
4678
|
-
"Content-Type": "application/json"
|
|
4679
|
-
},
|
|
4680
|
-
withCredentials: true
|
|
4681
|
-
});
|
|
4562
|
+
};
|
|
4563
|
+
return env?.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
|
|
4564
|
+
headers: {
|
|
4565
|
+
"Content-Type": "application/json"
|
|
4566
|
+
},
|
|
4567
|
+
withCredentials: true
|
|
4682
4568
|
});
|
|
4683
4569
|
},
|
|
4684
|
-
getFieldsViewSecurity(
|
|
4685
|
-
|
|
4570
|
+
async getFieldsViewSecurity({
|
|
4571
|
+
method,
|
|
4572
|
+
token,
|
|
4573
|
+
views
|
|
4574
|
+
}) {
|
|
4575
|
+
const env = getEnv();
|
|
4576
|
+
const jsonData = {
|
|
4686
4577
|
method,
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
}
|
|
4699
|
-
};
|
|
4700
|
-
return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4701
|
-
headers: {
|
|
4702
|
-
"Content-Type": "application/json"
|
|
4703
|
-
}
|
|
4704
|
-
});
|
|
4578
|
+
kwargs: {
|
|
4579
|
+
views
|
|
4580
|
+
},
|
|
4581
|
+
with_context: {
|
|
4582
|
+
token
|
|
4583
|
+
}
|
|
4584
|
+
};
|
|
4585
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4586
|
+
headers: {
|
|
4587
|
+
"Content-Type": "application/json"
|
|
4588
|
+
}
|
|
4705
4589
|
});
|
|
4706
4590
|
},
|
|
4707
|
-
settingsWebRead2fa(
|
|
4708
|
-
|
|
4591
|
+
async settingsWebRead2fa({
|
|
4592
|
+
method,
|
|
4593
|
+
model,
|
|
4594
|
+
kwargs,
|
|
4595
|
+
token
|
|
4596
|
+
}) {
|
|
4597
|
+
const env = getEnv();
|
|
4598
|
+
const jsonData = {
|
|
4709
4599
|
method,
|
|
4710
4600
|
model,
|
|
4711
4601
|
kwargs,
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
token
|
|
4721
|
-
}
|
|
4722
|
-
};
|
|
4723
|
-
return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4724
|
-
headers: {
|
|
4725
|
-
"Content-Type": "application/json"
|
|
4726
|
-
}
|
|
4727
|
-
});
|
|
4602
|
+
with_context: {
|
|
4603
|
+
token
|
|
4604
|
+
}
|
|
4605
|
+
};
|
|
4606
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4607
|
+
headers: {
|
|
4608
|
+
"Content-Type": "application/json"
|
|
4609
|
+
}
|
|
4728
4610
|
});
|
|
4729
4611
|
},
|
|
4730
|
-
requestSetupTotp(
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
}
|
|
4743
|
-
});
|
|
4612
|
+
async requestSetupTotp({ method, token }) {
|
|
4613
|
+
const env = getEnv();
|
|
4614
|
+
const jsonData = {
|
|
4615
|
+
method,
|
|
4616
|
+
with_context: {
|
|
4617
|
+
token
|
|
4618
|
+
}
|
|
4619
|
+
};
|
|
4620
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4621
|
+
headers: {
|
|
4622
|
+
"Content-Type": "application/json"
|
|
4623
|
+
}
|
|
4744
4624
|
});
|
|
4745
4625
|
},
|
|
4746
|
-
verifyTotp(
|
|
4747
|
-
|
|
4626
|
+
async verifyTotp({
|
|
4627
|
+
method,
|
|
4628
|
+
action_token,
|
|
4629
|
+
code
|
|
4630
|
+
}) {
|
|
4631
|
+
const env = getEnv();
|
|
4632
|
+
const jsonData = {
|
|
4748
4633
|
method,
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
const env = getEnv();
|
|
4753
|
-
const jsonData = {
|
|
4754
|
-
method,
|
|
4755
|
-
kwargs: {
|
|
4756
|
-
vals: {
|
|
4757
|
-
code
|
|
4758
|
-
}
|
|
4759
|
-
},
|
|
4760
|
-
with_context: {
|
|
4761
|
-
action_token
|
|
4762
|
-
}
|
|
4763
|
-
};
|
|
4764
|
-
return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4765
|
-
headers: {
|
|
4766
|
-
"Content-Type": "application/json"
|
|
4634
|
+
kwargs: {
|
|
4635
|
+
vals: {
|
|
4636
|
+
code
|
|
4767
4637
|
}
|
|
4768
|
-
}
|
|
4638
|
+
},
|
|
4639
|
+
with_context: {
|
|
4640
|
+
action_token
|
|
4641
|
+
}
|
|
4642
|
+
};
|
|
4643
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4644
|
+
headers: {
|
|
4645
|
+
"Content-Type": "application/json"
|
|
4646
|
+
}
|
|
4769
4647
|
});
|
|
4770
4648
|
},
|
|
4771
|
-
removeTotpSetUp(
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
}
|
|
4784
|
-
});
|
|
4649
|
+
async removeTotpSetUp({ method, token }) {
|
|
4650
|
+
const env = getEnv();
|
|
4651
|
+
const jsonData = {
|
|
4652
|
+
method,
|
|
4653
|
+
with_context: {
|
|
4654
|
+
token
|
|
4655
|
+
}
|
|
4656
|
+
};
|
|
4657
|
+
return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
4658
|
+
headers: {
|
|
4659
|
+
"Content-Type": "application/json"
|
|
4660
|
+
}
|
|
4785
4661
|
});
|
|
4786
4662
|
}
|
|
4787
4663
|
};
|
|
4788
4664
|
var view_service_default = ViewService;
|
|
4789
|
-
export
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4665
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
4666
|
+
0 && (module.exports = {
|
|
4667
|
+
ActionService,
|
|
4668
|
+
AuthService,
|
|
4669
|
+
CompanyService,
|
|
4670
|
+
ExcelService,
|
|
4671
|
+
FormService,
|
|
4672
|
+
KanbanService,
|
|
4673
|
+
ModelService,
|
|
4674
|
+
UserService,
|
|
4675
|
+
ViewService
|
|
4676
|
+
});
|