@fctc/edu-logic-lib 1.1.4 → 1.1.6
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/hooks.d.mts +1 -12
- package/dist/hooks.d.ts +1 -12
- package/dist/hooks.js +0 -3091
- package/dist/hooks.mjs +0 -3086
- package/dist/index.d.mts +5 -8
- package/dist/index.d.ts +5 -8
- package/dist/index.js +969 -981
- package/dist/index.mjs +413 -424
- package/dist/services.d.mts +7 -8
- package/dist/services.d.ts +7 -8
- package/dist/store.d.mts +194 -194
- package/dist/store.d.ts +194 -194
- package/dist/types.d.mts +1 -2
- package/dist/types.d.ts +1 -2
- package/dist/{api-type-dNqOR_Yp.d.mts → view-type-BTzRpkT7.d.mts} +42 -1
- package/dist/{api-type-dNqOR_Yp.d.ts → view-type-BTzRpkT7.d.ts} +42 -1
- package/package.json +12 -12
- package/dist/view-type-BOk5F1Fj.d.mts +0 -42
- package/dist/view-type-BOk5F1Fj.d.ts +0 -42
package/dist/index.js
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var axios = require('axios');
|
|
3
4
|
var reactRedux = require('react-redux');
|
|
4
5
|
var toolkit = require('@reduxjs/toolkit');
|
|
5
|
-
var axios = require('axios');
|
|
6
|
-
var reactQuery = require('@tanstack/react-query');
|
|
7
6
|
var react = require('react');
|
|
7
|
+
var reactQuery = require('@tanstack/react-query');
|
|
8
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
9
|
|
|
10
10
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
|
|
12
12
|
var axios__default = /*#__PURE__*/_interopDefault(axios);
|
|
13
13
|
|
|
14
|
+
// src/config/axios-client.ts
|
|
15
|
+
|
|
14
16
|
// src/constants/api/key-constant.ts
|
|
15
17
|
var KeyConstants = /* @__PURE__ */ ((KeyConstants2) => {
|
|
16
18
|
KeyConstants2["PROFILE"] = "userinfo";
|
|
@@ -67,853 +69,855 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
|
67
69
|
return UriConstants2;
|
|
68
70
|
})(UriConstants || {});
|
|
69
71
|
|
|
70
|
-
// src/
|
|
71
|
-
var
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
FieldTypeConstants2["HTML"] = "html";
|
|
82
|
-
FieldTypeConstants2["MANY2ONE"] = "many2one";
|
|
83
|
-
FieldTypeConstants2["ONE2MANY"] = "one2many";
|
|
84
|
-
FieldTypeConstants2["MANY2MANY"] = "many2many";
|
|
85
|
-
FieldTypeConstants2["MONETARY"] = "monetary";
|
|
86
|
-
FieldTypeConstants2["REFERENCE"] = "reference";
|
|
87
|
-
FieldTypeConstants2["FUNCTION"] = "function";
|
|
88
|
-
FieldTypeConstants2["PROPERTY"] = "property";
|
|
89
|
-
return FieldTypeConstants2;
|
|
90
|
-
})(FieldTypeConstants || {});
|
|
91
|
-
|
|
92
|
-
// src/constants/method/method-type-constant.ts
|
|
93
|
-
var MethodType = /* @__PURE__ */ ((MethodType2) => {
|
|
94
|
-
MethodType2[MethodType2["CREATE"] = 0] = "CREATE";
|
|
95
|
-
MethodType2[MethodType2["UPDATE"] = 1] = "UPDATE";
|
|
96
|
-
MethodType2[MethodType2["DELETE"] = 2] = "DELETE";
|
|
97
|
-
MethodType2[MethodType2["UNLINK"] = 3] = "UNLINK";
|
|
98
|
-
MethodType2[MethodType2["NO_CHANGE"] = 4] = "NO_CHANGE";
|
|
99
|
-
return MethodType2;
|
|
100
|
-
})(MethodType || {});
|
|
101
|
-
|
|
102
|
-
// src/constants/model/model-constant.ts
|
|
103
|
-
var ModelConstants = /* @__PURE__ */ ((ModelConstants2) => {
|
|
104
|
-
ModelConstants2["MENU"] = "ir.ui.menu";
|
|
105
|
-
ModelConstants2["USER"] = "res.users";
|
|
106
|
-
ModelConstants2["COMPANY"] = "res.company";
|
|
107
|
-
ModelConstants2["WINDOW_ACTION"] = "ir.actions.act_window";
|
|
108
|
-
ModelConstants2["BASE_IMPORT"] = "base_import.import";
|
|
109
|
-
ModelConstants2["GET_IMPORT"] = "get_import_templates";
|
|
110
|
-
return ModelConstants2;
|
|
111
|
-
})(ModelConstants || {});
|
|
112
|
-
|
|
113
|
-
// src/constants/type/index.ts
|
|
114
|
-
var ComponentType = /* @__PURE__ */ ((ComponentType2) => {
|
|
115
|
-
ComponentType2["TREE"] = "tree";
|
|
116
|
-
ComponentType2["GROUP"] = "group";
|
|
117
|
-
ComponentType2["LIST"] = "list";
|
|
118
|
-
ComponentType2["FORM"] = "form";
|
|
119
|
-
ComponentType2["FIELD"] = "field";
|
|
120
|
-
ComponentType2["DIV"] = "div";
|
|
121
|
-
ComponentType2["SPAN"] = "span";
|
|
122
|
-
return ComponentType2;
|
|
123
|
-
})(ComponentType || {});
|
|
124
|
-
var SearchType = {
|
|
125
|
-
FILTER: "filter_by",
|
|
126
|
-
SEARCH: "search_by",
|
|
127
|
-
GROUP: "group_by"
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
// src/constants/widget/widget-avatar-constant.ts
|
|
131
|
-
var WIDGETAVATAR = /* @__PURE__ */ ((WIDGETAVATAR2) => {
|
|
132
|
-
WIDGETAVATAR2["many2one_avatar_user"] = "many2one_avatar_user";
|
|
133
|
-
WIDGETAVATAR2["many2many_avatar_user"] = "many2many_avatar_user";
|
|
134
|
-
return WIDGETAVATAR2;
|
|
135
|
-
})(WIDGETAVATAR || {});
|
|
136
|
-
|
|
137
|
-
// src/constants/widget/widget-color-constant.ts
|
|
138
|
-
var WIDGETCOLOR = /* @__PURE__ */ ((WIDGETCOLOR2) => {
|
|
139
|
-
WIDGETCOLOR2["many2many_tags"] = "many2many_tags";
|
|
140
|
-
WIDGETCOLOR2["helpdesk_sla_many2many_tags"] = "helpdesk_sla_many2many_tags";
|
|
141
|
-
return WIDGETCOLOR2;
|
|
142
|
-
})(WIDGETCOLOR || {});
|
|
143
|
-
|
|
144
|
-
// src/constants/widget/widget-status-constant.ts
|
|
145
|
-
var WIDGETSTATUS = /* @__PURE__ */ ((WIDGETSTATUS2) => {
|
|
146
|
-
WIDGETSTATUS2["sla_status_ids"] = "sla_status_ids";
|
|
147
|
-
return WIDGETSTATUS2;
|
|
148
|
-
})(WIDGETSTATUS || {});
|
|
149
|
-
var WIDGETNOSTRING = /* @__PURE__ */ ((WIDGETNOSTRING2) => {
|
|
150
|
-
WIDGETNOSTRING2["sla_status_ids"] = "sla_status_ids";
|
|
151
|
-
return WIDGETNOSTRING2;
|
|
152
|
-
})(WIDGETNOSTRING || {});
|
|
153
|
-
var initialState = {
|
|
154
|
-
baseUrl: "",
|
|
155
|
-
requests: null,
|
|
156
|
-
companies: [],
|
|
157
|
-
user: {},
|
|
158
|
-
envFile: null,
|
|
159
|
-
defaultCompany: {
|
|
160
|
-
id: null,
|
|
161
|
-
logo: "",
|
|
162
|
-
secondary_color: "",
|
|
163
|
-
primary_color: ""
|
|
164
|
-
},
|
|
165
|
-
context: {
|
|
166
|
-
uid: null,
|
|
167
|
-
allowed_company_ids: [],
|
|
168
|
-
lang: "vi_VN",
|
|
169
|
-
tz: "Asia/Saigon"
|
|
72
|
+
// src/config/axios-client.ts
|
|
73
|
+
var MAINT_KEY = "MAINTENANCE_ACTIVE";
|
|
74
|
+
var MAINT_AT = "MAINTENANCE_AT";
|
|
75
|
+
var MAINT_LAST_PATH = "MAINTENANCE_LAST_PATH";
|
|
76
|
+
var hasRedirectedToMaintenance = false;
|
|
77
|
+
function setMaintenanceFlags() {
|
|
78
|
+
if (typeof window === "undefined") return;
|
|
79
|
+
const { pathname, search } = window.location;
|
|
80
|
+
const lastPath = pathname + (search || "");
|
|
81
|
+
if (pathname !== "/maintenance" && !window.localStorage.getItem(MAINT_LAST_PATH)) {
|
|
82
|
+
window.localStorage.setItem(MAINT_LAST_PATH, lastPath);
|
|
170
83
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
state.context.lang = action.payload;
|
|
193
|
-
},
|
|
194
|
-
setUser: (state, action) => {
|
|
195
|
-
state.user = action.payload;
|
|
196
|
-
},
|
|
197
|
-
setEnvFile: (state, action) => {
|
|
198
|
-
state.envFile = action.payload;
|
|
84
|
+
window.localStorage.setItem(MAINT_KEY, "true");
|
|
85
|
+
window.localStorage.setItem(MAINT_AT, String(Date.now()));
|
|
86
|
+
}
|
|
87
|
+
async function clearMaintenanceAndExit(getToken, opts) {
|
|
88
|
+
if (typeof window === "undefined") return;
|
|
89
|
+
const forceLogin = opts?.forceLogin === true;
|
|
90
|
+
const clearTokenOnForce = opts?.clearTokenOnForce !== false;
|
|
91
|
+
window.localStorage.removeItem(MAINT_KEY);
|
|
92
|
+
window.localStorage.removeItem(MAINT_AT);
|
|
93
|
+
const lastPath = window.localStorage.getItem(MAINT_LAST_PATH);
|
|
94
|
+
window.localStorage.removeItem(MAINT_LAST_PATH);
|
|
95
|
+
try {
|
|
96
|
+
if (forceLogin) {
|
|
97
|
+
if (clearTokenOnForce) {
|
|
98
|
+
try {
|
|
99
|
+
await opts?.clearToken?.();
|
|
100
|
+
} catch {
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
window.location.replace("/login");
|
|
104
|
+
return;
|
|
199
105
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
setAllowCompanies,
|
|
207
|
-
setCompanies,
|
|
208
|
-
setDefaultCompany,
|
|
209
|
-
setUser,
|
|
210
|
-
setEnvFile
|
|
211
|
-
} = envSlice.actions;
|
|
212
|
-
var selectEnv = (state) => state.env;
|
|
213
|
-
var env_slice_default = envSlice.reducer;
|
|
214
|
-
var initialState2 = {
|
|
215
|
-
dataParse: null,
|
|
216
|
-
idFile: null,
|
|
217
|
-
isFileLoaded: false,
|
|
218
|
-
loadingImport: false,
|
|
219
|
-
selectedFile: null,
|
|
220
|
-
errorData: null
|
|
221
|
-
};
|
|
222
|
-
var excelSlice = toolkit.createSlice({
|
|
223
|
-
name: "excel",
|
|
224
|
-
initialState: initialState2,
|
|
225
|
-
reducers: {
|
|
226
|
-
setDataParse: (state, action) => {
|
|
227
|
-
state.dataParse = action.payload;
|
|
228
|
-
},
|
|
229
|
-
setIdFile: (state, action) => {
|
|
230
|
-
state.idFile = action.payload;
|
|
231
|
-
},
|
|
232
|
-
setIsFileLoaded: (state, action) => {
|
|
233
|
-
state.isFileLoaded = action.payload;
|
|
234
|
-
},
|
|
235
|
-
setLoadingImport: (state, action) => {
|
|
236
|
-
state.loadingImport = action.payload;
|
|
237
|
-
},
|
|
238
|
-
setSelectedFile: (state, action) => {
|
|
239
|
-
state.selectedFile = action.payload;
|
|
240
|
-
},
|
|
241
|
-
setErrorData: (state, action) => {
|
|
242
|
-
state.errorData = action.payload;
|
|
106
|
+
const token = await getToken();
|
|
107
|
+
if (token) {
|
|
108
|
+
const target = lastPath && lastPath !== "/maintenance" ? lastPath : "/";
|
|
109
|
+
window.location.replace(target);
|
|
110
|
+
} else {
|
|
111
|
+
window.location.replace("/login");
|
|
243
112
|
}
|
|
113
|
+
} catch {
|
|
114
|
+
window.location.replace("/login");
|
|
244
115
|
}
|
|
245
|
-
}
|
|
246
|
-
var {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
116
|
+
}
|
|
117
|
+
var axiosClient = {
|
|
118
|
+
init(config) {
|
|
119
|
+
const localStorage2 = config.localStorageUtils;
|
|
120
|
+
const sessionStorage = config.sessionStorageUtils;
|
|
121
|
+
const db = config.db;
|
|
122
|
+
let isRefreshing = false;
|
|
123
|
+
let failedQueue = [];
|
|
124
|
+
const processQueue = (error, token = null) => {
|
|
125
|
+
failedQueue?.forEach((prom) => {
|
|
126
|
+
if (error) {
|
|
127
|
+
prom.reject(error);
|
|
128
|
+
} else {
|
|
129
|
+
prom.resolve(token);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
failedQueue = [];
|
|
133
|
+
};
|
|
134
|
+
const instance = axios__default.default.create({
|
|
135
|
+
adapter: axios__default.default.defaults.adapter,
|
|
136
|
+
baseURL: config.baseUrl,
|
|
137
|
+
timeout: 5e4,
|
|
138
|
+
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
139
|
+
});
|
|
140
|
+
if (typeof window !== "undefined") {
|
|
141
|
+
const isMaint = window.localStorage.getItem(MAINT_KEY) === "true";
|
|
142
|
+
const onMaintenancePage = window.location.pathname === "/maintenance";
|
|
143
|
+
if (isMaint && !onMaintenancePage) {
|
|
144
|
+
hasRedirectedToMaintenance = true;
|
|
145
|
+
window.location.replace("/maintenance");
|
|
146
|
+
}
|
|
147
|
+
if (isMaint && onMaintenancePage) {
|
|
148
|
+
const healthUrl = config.healthUrl || `${(config.baseUrl || "").replace(/\/+$/, "")}/health`;
|
|
149
|
+
(async () => {
|
|
150
|
+
try {
|
|
151
|
+
await axios__default.default.get(healthUrl, { timeout: 8e3 });
|
|
152
|
+
await clearMaintenanceAndExit(() => localStorage2.getAccessToken(), {
|
|
153
|
+
forceLogin: true,
|
|
154
|
+
clearTokenOnForce: true,
|
|
155
|
+
clearToken: () => localStorage2.clearToken()
|
|
156
|
+
});
|
|
157
|
+
} catch {
|
|
158
|
+
}
|
|
159
|
+
})();
|
|
160
|
+
}
|
|
289
161
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
162
|
+
instance.interceptors.request.use(
|
|
163
|
+
async (configReq) => {
|
|
164
|
+
const token = await localStorage2.getAccessToken();
|
|
165
|
+
if (token) {
|
|
166
|
+
configReq.headers["Authorization"] = "Bearer " + token;
|
|
167
|
+
}
|
|
168
|
+
return configReq;
|
|
169
|
+
},
|
|
170
|
+
(error) => Promise.reject(error)
|
|
171
|
+
);
|
|
172
|
+
instance.interceptors.response.use(
|
|
173
|
+
(response) => {
|
|
174
|
+
if (typeof window !== "undefined") {
|
|
175
|
+
const isMaint = window.localStorage.getItem(MAINT_KEY) === "true";
|
|
176
|
+
const onMaintenancePage = window.location.pathname === "/maintenance";
|
|
177
|
+
if (isMaint && onMaintenancePage) {
|
|
178
|
+
(async () => {
|
|
179
|
+
await clearMaintenanceAndExit(
|
|
180
|
+
() => localStorage2.getAccessToken(),
|
|
181
|
+
{
|
|
182
|
+
forceLogin: true,
|
|
183
|
+
clearTokenOnForce: true,
|
|
184
|
+
clearToken: () => localStorage2.clearToken()
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
})();
|
|
188
|
+
} else if (isMaint) {
|
|
189
|
+
window.localStorage.removeItem(MAINT_KEY);
|
|
190
|
+
window.localStorage.removeItem(MAINT_AT);
|
|
191
|
+
window.localStorage.removeItem(MAINT_LAST_PATH);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return handleResponse(response);
|
|
195
|
+
},
|
|
196
|
+
async (error) => {
|
|
197
|
+
const status = error?.response?.status;
|
|
198
|
+
if (status === 503) {
|
|
199
|
+
if (typeof window !== "undefined") {
|
|
200
|
+
setMaintenanceFlags();
|
|
201
|
+
if (!hasRedirectedToMaintenance && window.location.pathname !== "/maintenance") {
|
|
202
|
+
hasRedirectedToMaintenance = true;
|
|
203
|
+
window.location.replace("/maintenance");
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return Promise.reject({
|
|
207
|
+
code: 503,
|
|
208
|
+
message: "SERVICE_UNAVAILABLE",
|
|
209
|
+
original: error?.response?.data
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
const handleError = async (err) => {
|
|
213
|
+
if (!err.response) {
|
|
214
|
+
return err;
|
|
215
|
+
}
|
|
216
|
+
const { data } = err.response;
|
|
217
|
+
if (data && data.code === 400 && ["invalid_grant"].includes(data.data?.error)) {
|
|
218
|
+
await clearAuthToken();
|
|
219
|
+
}
|
|
220
|
+
return data;
|
|
221
|
+
};
|
|
222
|
+
const originalRequest = error.config;
|
|
223
|
+
if ((error.response?.status === 403 || error.response?.status === 401 || error.response?.status === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401].includes(
|
|
224
|
+
error.response.data.code
|
|
225
|
+
)) {
|
|
226
|
+
if (isRefreshing) {
|
|
227
|
+
return new Promise(function(resolve, reject) {
|
|
228
|
+
failedQueue.push({ resolve, reject });
|
|
229
|
+
}).then((token) => {
|
|
230
|
+
originalRequest.headers["Authorization"] = "Bearer " + token;
|
|
231
|
+
return instance.request(originalRequest);
|
|
232
|
+
}).catch(async (err) => {
|
|
233
|
+
if ((err.response?.status === 400 || err.response?.status === 401) && ["invalid_grant"].includes(err.response.data.error)) {
|
|
234
|
+
await clearAuthToken();
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
const browserSession = await sessionStorage.getBrowserSession();
|
|
239
|
+
const refreshToken = await localStorage2.getRefreshToken();
|
|
240
|
+
const accessTokenExp = await localStorage2.getAccessToken();
|
|
241
|
+
isRefreshing = true;
|
|
242
|
+
if (!refreshToken && (!browserSession || browserSession == "unActive")) {
|
|
243
|
+
await clearAuthToken();
|
|
244
|
+
} else {
|
|
245
|
+
const payload = Object.fromEntries(
|
|
246
|
+
Object.entries({
|
|
247
|
+
refresh_token: refreshToken,
|
|
248
|
+
grant_type: "refresh_token",
|
|
249
|
+
client_id: config.config.clientId,
|
|
250
|
+
client_secret: config.config.clientSecret
|
|
251
|
+
}).filter(([_, value]) => !!value)
|
|
252
|
+
);
|
|
253
|
+
return new Promise(function(resolve) {
|
|
254
|
+
axios__default.default.post(
|
|
255
|
+
`${config.baseUrl}${"/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
|
|
256
|
+
payload,
|
|
257
|
+
{
|
|
258
|
+
headers: {
|
|
259
|
+
"Content-Type": "multipart/form-data",
|
|
260
|
+
Authorization: `Bearer ${accessTokenExp}`
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
).then(async (res) => {
|
|
264
|
+
const data = res.data;
|
|
265
|
+
await localStorage2.setToken(data.access_token);
|
|
266
|
+
await localStorage2.setRefreshToken(data.refresh_token);
|
|
267
|
+
axios__default.default.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
|
|
268
|
+
originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
|
|
269
|
+
processQueue(null, data.access_token);
|
|
270
|
+
resolve(instance.request(originalRequest));
|
|
271
|
+
}).catch(async (err) => {
|
|
272
|
+
if (err && (err?.error_code === "AUTHEN_FAIL" || err?.error_code === "TOKEN_EXPIRED" || err?.error_code === "TOKEN_INCORRECT" || err?.code === "ERR_BAD_REQUEST")) {
|
|
273
|
+
await clearAuthToken();
|
|
274
|
+
}
|
|
275
|
+
if (err && err.response) {
|
|
276
|
+
const { error_code } = err.response?.data || {};
|
|
277
|
+
if (error_code === "AUTHEN_FAIL") {
|
|
278
|
+
await clearAuthToken();
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
processQueue(err, null);
|
|
282
|
+
}).finally(() => {
|
|
283
|
+
isRefreshing = false;
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
return Promise.reject(await handleError(error));
|
|
289
|
+
}
|
|
290
|
+
);
|
|
291
|
+
const handleResponse = (res) => {
|
|
292
|
+
if (res && res.data) {
|
|
293
|
+
return res.data;
|
|
294
|
+
}
|
|
295
|
+
return res;
|
|
296
|
+
};
|
|
297
|
+
const clearAuthToken = async () => {
|
|
298
|
+
await localStorage2.clearToken();
|
|
299
|
+
if (typeof window !== "undefined") {
|
|
300
|
+
window.location.href = `/login`;
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
function formatUrl(url, db2) {
|
|
304
|
+
return url + (db2 ? "?db=" + db2 : "");
|
|
337
305
|
}
|
|
306
|
+
const responseBody = (response) => response;
|
|
307
|
+
const requests = {
|
|
308
|
+
get: (url, headers) => instance.get(formatUrl(url, db), headers).then(responseBody),
|
|
309
|
+
post: (url, body, headers) => instance.post(formatUrl(url, db), body, { headers }).then(responseBody),
|
|
310
|
+
post_excel: (url, body, headers) => instance.post(formatUrl(url, db), body, {
|
|
311
|
+
responseType: "arraybuffer",
|
|
312
|
+
headers: {
|
|
313
|
+
"Content-Type": typeof window !== "undefined" ? "application/json" : "application/javascript",
|
|
314
|
+
Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
315
|
+
}
|
|
316
|
+
}).then(responseBody),
|
|
317
|
+
put: (url, body, headers) => instance.put(formatUrl(url, db), body, headers).then(responseBody),
|
|
318
|
+
patch: (url, body) => instance.patch(formatUrl(url, db), body).then(responseBody),
|
|
319
|
+
delete: (url, body) => instance.delete(formatUrl(url, db), body).then(responseBody)
|
|
320
|
+
};
|
|
321
|
+
return requests;
|
|
338
322
|
}
|
|
339
|
-
});
|
|
340
|
-
var {
|
|
341
|
-
setPageLimit,
|
|
342
|
-
setFields,
|
|
343
|
-
setOrder,
|
|
344
|
-
setSelectedRowKeys,
|
|
345
|
-
setIndexRowTableModal,
|
|
346
|
-
setPage,
|
|
347
|
-
setDomainTable
|
|
348
|
-
} = listSlice.actions;
|
|
349
|
-
var selectList = (state) => state.list;
|
|
350
|
-
var list_slice_default = listSlice.reducer;
|
|
351
|
-
var initialState5 = {
|
|
352
|
-
menuList: []
|
|
353
323
|
};
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
324
|
+
|
|
325
|
+
// src/constants/field/field-type-constant.ts
|
|
326
|
+
var FieldTypeConstants = /* @__PURE__ */ ((FieldTypeConstants2) => {
|
|
327
|
+
FieldTypeConstants2["CHAR"] = "char";
|
|
328
|
+
FieldTypeConstants2["TEXT"] = "text";
|
|
329
|
+
FieldTypeConstants2["INTEGER"] = "integer";
|
|
330
|
+
FieldTypeConstants2["FLOAT"] = "float";
|
|
331
|
+
FieldTypeConstants2["BOOLEAN"] = "boolean";
|
|
332
|
+
FieldTypeConstants2["DATE"] = "date";
|
|
333
|
+
FieldTypeConstants2["DATETIME"] = "datetime";
|
|
334
|
+
FieldTypeConstants2["BINARY"] = "binary";
|
|
335
|
+
FieldTypeConstants2["SELECTION"] = "selection";
|
|
336
|
+
FieldTypeConstants2["HTML"] = "html";
|
|
337
|
+
FieldTypeConstants2["MANY2ONE"] = "many2one";
|
|
338
|
+
FieldTypeConstants2["ONE2MANY"] = "one2many";
|
|
339
|
+
FieldTypeConstants2["MANY2MANY"] = "many2many";
|
|
340
|
+
FieldTypeConstants2["MONETARY"] = "monetary";
|
|
341
|
+
FieldTypeConstants2["REFERENCE"] = "reference";
|
|
342
|
+
FieldTypeConstants2["FUNCTION"] = "function";
|
|
343
|
+
FieldTypeConstants2["PROPERTY"] = "property";
|
|
344
|
+
return FieldTypeConstants2;
|
|
345
|
+
})(FieldTypeConstants || {});
|
|
346
|
+
|
|
347
|
+
// src/constants/method/method-type-constant.ts
|
|
348
|
+
var MethodType = /* @__PURE__ */ ((MethodType2) => {
|
|
349
|
+
MethodType2[MethodType2["CREATE"] = 0] = "CREATE";
|
|
350
|
+
MethodType2[MethodType2["UPDATE"] = 1] = "UPDATE";
|
|
351
|
+
MethodType2[MethodType2["DELETE"] = 2] = "DELETE";
|
|
352
|
+
MethodType2[MethodType2["UNLINK"] = 3] = "UNLINK";
|
|
353
|
+
MethodType2[MethodType2["NO_CHANGE"] = 4] = "NO_CHANGE";
|
|
354
|
+
return MethodType2;
|
|
355
|
+
})(MethodType || {});
|
|
356
|
+
|
|
357
|
+
// src/constants/model/model-constant.ts
|
|
358
|
+
var ModelConstants = /* @__PURE__ */ ((ModelConstants2) => {
|
|
359
|
+
ModelConstants2["MENU"] = "ir.ui.menu";
|
|
360
|
+
ModelConstants2["USER"] = "res.users";
|
|
361
|
+
ModelConstants2["COMPANY"] = "res.company";
|
|
362
|
+
ModelConstants2["WINDOW_ACTION"] = "ir.actions.act_window";
|
|
363
|
+
ModelConstants2["BASE_IMPORT"] = "base_import.import";
|
|
364
|
+
ModelConstants2["GET_IMPORT"] = "get_import_templates";
|
|
365
|
+
return ModelConstants2;
|
|
366
|
+
})(ModelConstants || {});
|
|
367
|
+
|
|
368
|
+
// src/constants/type/index.ts
|
|
369
|
+
var ComponentType = /* @__PURE__ */ ((ComponentType2) => {
|
|
370
|
+
ComponentType2["TREE"] = "tree";
|
|
371
|
+
ComponentType2["GROUP"] = "group";
|
|
372
|
+
ComponentType2["LIST"] = "list";
|
|
373
|
+
ComponentType2["FORM"] = "form";
|
|
374
|
+
ComponentType2["FIELD"] = "field";
|
|
375
|
+
ComponentType2["DIV"] = "div";
|
|
376
|
+
ComponentType2["SPAN"] = "span";
|
|
377
|
+
return ComponentType2;
|
|
378
|
+
})(ComponentType || {});
|
|
379
|
+
var SearchType = {
|
|
380
|
+
FILTER: "filter_by",
|
|
381
|
+
SEARCH: "search_by",
|
|
382
|
+
GROUP: "group_by"
|
|
368
383
|
};
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
var
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
384
|
+
|
|
385
|
+
// src/constants/widget/widget-avatar-constant.ts
|
|
386
|
+
var WIDGETAVATAR = /* @__PURE__ */ ((WIDGETAVATAR2) => {
|
|
387
|
+
WIDGETAVATAR2["many2one_avatar_user"] = "many2one_avatar_user";
|
|
388
|
+
WIDGETAVATAR2["many2many_avatar_user"] = "many2many_avatar_user";
|
|
389
|
+
return WIDGETAVATAR2;
|
|
390
|
+
})(WIDGETAVATAR || {});
|
|
391
|
+
|
|
392
|
+
// src/constants/widget/widget-color-constant.ts
|
|
393
|
+
var WIDGETCOLOR = /* @__PURE__ */ ((WIDGETCOLOR2) => {
|
|
394
|
+
WIDGETCOLOR2["many2many_tags"] = "many2many_tags";
|
|
395
|
+
WIDGETCOLOR2["helpdesk_sla_many2many_tags"] = "helpdesk_sla_many2many_tags";
|
|
396
|
+
return WIDGETCOLOR2;
|
|
397
|
+
})(WIDGETCOLOR || {});
|
|
398
|
+
|
|
399
|
+
// src/constants/widget/widget-status-constant.ts
|
|
400
|
+
var WIDGETSTATUS = /* @__PURE__ */ ((WIDGETSTATUS2) => {
|
|
401
|
+
WIDGETSTATUS2["sla_status_ids"] = "sla_status_ids";
|
|
402
|
+
return WIDGETSTATUS2;
|
|
403
|
+
})(WIDGETSTATUS || {});
|
|
404
|
+
var WIDGETNOSTRING = /* @__PURE__ */ ((WIDGETNOSTRING2) => {
|
|
405
|
+
WIDGETNOSTRING2["sla_status_ids"] = "sla_status_ids";
|
|
406
|
+
return WIDGETNOSTRING2;
|
|
407
|
+
})(WIDGETNOSTRING || {});
|
|
408
|
+
var initialState = {
|
|
409
|
+
baseUrl: "",
|
|
410
|
+
requests: null,
|
|
411
|
+
companies: [],
|
|
412
|
+
user: {},
|
|
413
|
+
envFile: null,
|
|
414
|
+
defaultCompany: {
|
|
415
|
+
id: null,
|
|
416
|
+
logo: "",
|
|
417
|
+
secondary_color: "",
|
|
418
|
+
primary_color: ""
|
|
419
|
+
},
|
|
420
|
+
context: {
|
|
421
|
+
uid: null,
|
|
422
|
+
allowed_company_ids: [],
|
|
423
|
+
lang: "vi_VN",
|
|
424
|
+
tz: "Asia/Saigon"
|
|
425
|
+
}
|
|
393
426
|
};
|
|
394
|
-
var
|
|
395
|
-
name: "
|
|
396
|
-
initialState
|
|
427
|
+
var envSlice = toolkit.createSlice({
|
|
428
|
+
name: "env",
|
|
429
|
+
initialState,
|
|
397
430
|
reducers: {
|
|
398
|
-
|
|
399
|
-
state
|
|
400
|
-
},
|
|
401
|
-
setTableHead: (state, action) => {
|
|
402
|
-
state.tableHead = action.payload;
|
|
403
|
-
},
|
|
404
|
-
setSearchString: (state, action) => {
|
|
405
|
-
state.searchString = action.payload;
|
|
406
|
-
},
|
|
407
|
-
setHoveredIndexSearchList: (state, action) => {
|
|
408
|
-
state.hoveredIndexSearchList = action.payload;
|
|
409
|
-
},
|
|
410
|
-
setSelectedTags: (state, action) => {
|
|
411
|
-
state.selectedTags = action.payload;
|
|
412
|
-
},
|
|
413
|
-
setFirstDomain: (state, action) => {
|
|
414
|
-
state.firstDomain = action.payload;
|
|
415
|
-
},
|
|
416
|
-
setTypeFieldsSearch: (state, action) => {
|
|
417
|
-
state.typeFieldsSearch = action.payload;
|
|
431
|
+
setEnv: (state, action) => {
|
|
432
|
+
Object.assign(state, action.payload);
|
|
418
433
|
},
|
|
419
|
-
|
|
420
|
-
state.
|
|
434
|
+
setUid: (state, action) => {
|
|
435
|
+
state.context.uid = action.payload;
|
|
421
436
|
},
|
|
422
|
-
|
|
423
|
-
state.
|
|
437
|
+
setAllowCompanies: (state, action) => {
|
|
438
|
+
state.context.allowed_company_ids = action.payload;
|
|
424
439
|
},
|
|
425
|
-
|
|
426
|
-
state.
|
|
440
|
+
setCompanies: (state, action) => {
|
|
441
|
+
state.companies = action.payload;
|
|
427
442
|
},
|
|
428
|
-
|
|
429
|
-
state.
|
|
443
|
+
setDefaultCompany: (state, action) => {
|
|
444
|
+
state.defaultCompany = action.payload;
|
|
430
445
|
},
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
state.searchMap[action.payload.key] = [];
|
|
434
|
-
}
|
|
435
|
-
state.searchMap[action.payload.key].push(action.payload.value);
|
|
446
|
+
setLang: (state, action) => {
|
|
447
|
+
state.context.lang = action.payload;
|
|
436
448
|
},
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
const values = state.searchMap[key];
|
|
440
|
-
if (!values) return;
|
|
441
|
-
if (item) {
|
|
442
|
-
const filtered = values.filter((value) => value.name !== item.name);
|
|
443
|
-
if (filtered.length > 0) {
|
|
444
|
-
state.searchMap[key] = filtered;
|
|
445
|
-
} else {
|
|
446
|
-
delete state.searchMap[key];
|
|
447
|
-
}
|
|
448
|
-
} else {
|
|
449
|
-
delete state.searchMap[key];
|
|
450
|
-
}
|
|
449
|
+
setUser: (state, action) => {
|
|
450
|
+
state.user = action.payload;
|
|
451
451
|
},
|
|
452
|
-
|
|
453
|
-
state.
|
|
452
|
+
setEnvFile: (state, action) => {
|
|
453
|
+
state.envFile = action.payload;
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
456
|
});
|
|
457
457
|
var {
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
// node_modules/redux/dist/redux.mjs
|
|
478
|
-
function formatProdErrorMessage(code) {
|
|
479
|
-
return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;
|
|
480
|
-
}
|
|
481
|
-
var randomString = () => Math.random().toString(36).substring(7).split("").join(".");
|
|
482
|
-
var ActionTypes = {
|
|
483
|
-
INIT: `@@redux/INIT${/* @__PURE__ */ randomString()}`,
|
|
484
|
-
REPLACE: `@@redux/REPLACE${/* @__PURE__ */ randomString()}`,
|
|
485
|
-
PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`
|
|
458
|
+
setEnv,
|
|
459
|
+
setUid,
|
|
460
|
+
setLang,
|
|
461
|
+
setAllowCompanies,
|
|
462
|
+
setCompanies,
|
|
463
|
+
setDefaultCompany,
|
|
464
|
+
setUser,
|
|
465
|
+
setEnvFile
|
|
466
|
+
} = envSlice.actions;
|
|
467
|
+
var selectEnv = (state) => state.env;
|
|
468
|
+
var env_slice_default = envSlice.reducer;
|
|
469
|
+
var initialState2 = {
|
|
470
|
+
dataParse: null,
|
|
471
|
+
idFile: null,
|
|
472
|
+
isFileLoaded: false,
|
|
473
|
+
loadingImport: false,
|
|
474
|
+
selectedFile: null,
|
|
475
|
+
errorData: null
|
|
486
476
|
};
|
|
487
|
-
var
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
case "function": {
|
|
509
|
-
return type;
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
if (Array.isArray(val))
|
|
513
|
-
return "array";
|
|
514
|
-
if (isDate(val))
|
|
515
|
-
return "date";
|
|
516
|
-
if (isError(val))
|
|
517
|
-
return "error";
|
|
518
|
-
const constructorName = ctorName(val);
|
|
519
|
-
switch (constructorName) {
|
|
520
|
-
case "Symbol":
|
|
521
|
-
case "Promise":
|
|
522
|
-
case "WeakMap":
|
|
523
|
-
case "WeakSet":
|
|
524
|
-
case "Map":
|
|
525
|
-
case "Set":
|
|
526
|
-
return constructorName;
|
|
527
|
-
}
|
|
528
|
-
return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\s/g, "");
|
|
529
|
-
}
|
|
530
|
-
function ctorName(val) {
|
|
531
|
-
return typeof val.constructor === "function" ? val.constructor.name : null;
|
|
532
|
-
}
|
|
533
|
-
function isError(val) {
|
|
534
|
-
return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number";
|
|
535
|
-
}
|
|
536
|
-
function isDate(val) {
|
|
537
|
-
if (val instanceof Date)
|
|
538
|
-
return true;
|
|
539
|
-
return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function";
|
|
540
|
-
}
|
|
541
|
-
function kindOf(val) {
|
|
542
|
-
let typeOfVal = typeof val;
|
|
543
|
-
if (process.env.NODE_ENV !== "production") {
|
|
544
|
-
typeOfVal = miniKindOf(val);
|
|
545
|
-
}
|
|
546
|
-
return typeOfVal;
|
|
547
|
-
}
|
|
548
|
-
function warning(message) {
|
|
549
|
-
if (typeof console !== "undefined" && typeof console.error === "function") {
|
|
550
|
-
console.error(message);
|
|
551
|
-
}
|
|
552
|
-
try {
|
|
553
|
-
throw new Error(message);
|
|
554
|
-
} catch (e) {
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
|
|
558
|
-
const reducerKeys = Object.keys(reducers);
|
|
559
|
-
const argumentName = action && action.type === actionTypes_default.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer";
|
|
560
|
-
if (reducerKeys.length === 0) {
|
|
561
|
-
return "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";
|
|
562
|
-
}
|
|
563
|
-
if (!isPlainObject(inputState)) {
|
|
564
|
-
return `The ${argumentName} has unexpected type of "${kindOf(inputState)}". Expected argument to be an object with the following keys: "${reducerKeys.join('", "')}"`;
|
|
565
|
-
}
|
|
566
|
-
const unexpectedKeys = Object.keys(inputState).filter((key) => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]);
|
|
567
|
-
unexpectedKeys.forEach((key) => {
|
|
568
|
-
unexpectedKeyCache[key] = true;
|
|
569
|
-
});
|
|
570
|
-
if (action && action.type === actionTypes_default.REPLACE)
|
|
571
|
-
return;
|
|
572
|
-
if (unexpectedKeys.length > 0) {
|
|
573
|
-
return `Unexpected ${unexpectedKeys.length > 1 ? "keys" : "key"} "${unexpectedKeys.join('", "')}" found in ${argumentName}. Expected to find one of the known reducer keys instead: "${reducerKeys.join('", "')}". Unexpected keys will be ignored.`;
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
function assertReducerShape(reducers) {
|
|
577
|
-
Object.keys(reducers).forEach((key) => {
|
|
578
|
-
const reducer = reducers[key];
|
|
579
|
-
const initialState8 = reducer(void 0, {
|
|
580
|
-
type: actionTypes_default.INIT
|
|
581
|
-
});
|
|
582
|
-
if (typeof initialState8 === "undefined") {
|
|
583
|
-
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(12) : `The slice reducer for key "${key}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);
|
|
584
|
-
}
|
|
585
|
-
if (typeof reducer(void 0, {
|
|
586
|
-
type: actionTypes_default.PROBE_UNKNOWN_ACTION()
|
|
587
|
-
}) === "undefined") {
|
|
588
|
-
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(13) : `The slice reducer for key "${key}" returned undefined when probed with a random type. Don't try to handle '${actionTypes_default.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`);
|
|
589
|
-
}
|
|
590
|
-
});
|
|
591
|
-
}
|
|
592
|
-
function combineReducers(reducers) {
|
|
593
|
-
const reducerKeys = Object.keys(reducers);
|
|
594
|
-
const finalReducers = {};
|
|
595
|
-
for (let i = 0; i < reducerKeys.length; i++) {
|
|
596
|
-
const key = reducerKeys[i];
|
|
597
|
-
if (process.env.NODE_ENV !== "production") {
|
|
598
|
-
if (typeof reducers[key] === "undefined") {
|
|
599
|
-
warning(`No reducer provided for key "${key}"`);
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
if (typeof reducers[key] === "function") {
|
|
603
|
-
finalReducers[key] = reducers[key];
|
|
477
|
+
var excelSlice = toolkit.createSlice({
|
|
478
|
+
name: "excel",
|
|
479
|
+
initialState: initialState2,
|
|
480
|
+
reducers: {
|
|
481
|
+
setDataParse: (state, action) => {
|
|
482
|
+
state.dataParse = action.payload;
|
|
483
|
+
},
|
|
484
|
+
setIdFile: (state, action) => {
|
|
485
|
+
state.idFile = action.payload;
|
|
486
|
+
},
|
|
487
|
+
setIsFileLoaded: (state, action) => {
|
|
488
|
+
state.isFileLoaded = action.payload;
|
|
489
|
+
},
|
|
490
|
+
setLoadingImport: (state, action) => {
|
|
491
|
+
state.loadingImport = action.payload;
|
|
492
|
+
},
|
|
493
|
+
setSelectedFile: (state, action) => {
|
|
494
|
+
state.selectedFile = action.payload;
|
|
495
|
+
},
|
|
496
|
+
setErrorData: (state, action) => {
|
|
497
|
+
state.errorData = action.payload;
|
|
604
498
|
}
|
|
605
499
|
}
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
500
|
+
});
|
|
501
|
+
var {
|
|
502
|
+
setDataParse,
|
|
503
|
+
setIdFile,
|
|
504
|
+
setIsFileLoaded,
|
|
505
|
+
setLoadingImport,
|
|
506
|
+
setSelectedFile,
|
|
507
|
+
setErrorData
|
|
508
|
+
} = excelSlice.actions;
|
|
509
|
+
var selectExcel = (state) => state.excel;
|
|
510
|
+
var excel_slice_default = excelSlice.reducer;
|
|
511
|
+
var initialState3 = {
|
|
512
|
+
viewDataStore: {},
|
|
513
|
+
isShowingModalDetail: false,
|
|
514
|
+
isShowModalTranslate: false,
|
|
515
|
+
formSubmitComponent: {},
|
|
516
|
+
fieldTranslation: null,
|
|
517
|
+
listSubject: {},
|
|
518
|
+
dataUser: {}
|
|
519
|
+
};
|
|
520
|
+
var formSlice = toolkit.createSlice({
|
|
521
|
+
name: "form",
|
|
522
|
+
initialState: initialState3,
|
|
523
|
+
reducers: {
|
|
524
|
+
setViewDataStore: (state, action) => {
|
|
525
|
+
state.viewDataStore = action.payload;
|
|
526
|
+
},
|
|
527
|
+
setIsShowingModalDetail: (state, action) => {
|
|
528
|
+
state.isShowingModalDetail = action.payload;
|
|
529
|
+
},
|
|
530
|
+
setIsShowModalTranslate: (state, action) => {
|
|
531
|
+
state.isShowModalTranslate = action.payload;
|
|
532
|
+
},
|
|
533
|
+
setFormSubmitComponent: (state, action) => {
|
|
534
|
+
state.formSubmitComponent[action.payload.key] = action.payload.component;
|
|
535
|
+
},
|
|
536
|
+
setFieldTranslate: (state, action) => {
|
|
537
|
+
state.fieldTranslation = action.payload;
|
|
538
|
+
},
|
|
539
|
+
setListSubject: (state, action) => {
|
|
540
|
+
state.listSubject = action.payload;
|
|
541
|
+
},
|
|
542
|
+
setDataUser: (state, action) => {
|
|
543
|
+
state.dataUser = action.payload;
|
|
626
544
|
}
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
545
|
+
}
|
|
546
|
+
});
|
|
547
|
+
var {
|
|
548
|
+
setViewDataStore,
|
|
549
|
+
setIsShowingModalDetail,
|
|
550
|
+
setIsShowModalTranslate,
|
|
551
|
+
setFormSubmitComponent,
|
|
552
|
+
setFieldTranslate,
|
|
553
|
+
setListSubject,
|
|
554
|
+
setDataUser
|
|
555
|
+
} = formSlice.actions;
|
|
556
|
+
var selectForm = (state) => state.form;
|
|
557
|
+
var form_slice_default = formSlice.reducer;
|
|
558
|
+
var initialState4 = {
|
|
559
|
+
pageLimit: 10,
|
|
560
|
+
fields: {},
|
|
561
|
+
order: "",
|
|
562
|
+
selectedRowKeys: [],
|
|
563
|
+
indexRowTableModal: -2,
|
|
564
|
+
footerGroupTable: {},
|
|
565
|
+
page: 0,
|
|
566
|
+
domainTable: []
|
|
567
|
+
};
|
|
568
|
+
var listSlice = toolkit.createSlice({
|
|
569
|
+
name: "list",
|
|
570
|
+
initialState: initialState4,
|
|
571
|
+
reducers: {
|
|
572
|
+
setPageLimit: (state, action) => {
|
|
573
|
+
state.pageLimit = action.payload;
|
|
574
|
+
},
|
|
575
|
+
setFields: (state, action) => {
|
|
576
|
+
state.fields = action.payload;
|
|
577
|
+
},
|
|
578
|
+
setOrder: (state, action) => {
|
|
579
|
+
state.order = action.payload;
|
|
580
|
+
},
|
|
581
|
+
setSelectedRowKeys: (state, action) => {
|
|
582
|
+
state.selectedRowKeys = action.payload;
|
|
583
|
+
},
|
|
584
|
+
setIndexRowTableModal: (state, action) => {
|
|
585
|
+
state.indexRowTableModal = action.payload;
|
|
586
|
+
},
|
|
587
|
+
setPage: (state, action) => {
|
|
588
|
+
state.page = action.payload;
|
|
589
|
+
},
|
|
590
|
+
setDomainTable: (state, action) => {
|
|
591
|
+
state.domainTable = action.payload;
|
|
640
592
|
}
|
|
641
|
-
|
|
642
|
-
return hasChanged ? nextState : state;
|
|
643
|
-
};
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
// src/store/store.ts
|
|
647
|
-
var rootReducer = combineReducers({
|
|
648
|
-
env: env_slice_default,
|
|
649
|
-
navbar: navbar_slice_default,
|
|
650
|
-
list: list_slice_default,
|
|
651
|
-
search: search_slice_default,
|
|
652
|
-
form: form_slice_default,
|
|
653
|
-
excel: excel_slice_default,
|
|
654
|
-
profile: profile_slice_default
|
|
593
|
+
}
|
|
655
594
|
});
|
|
656
|
-
var
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
595
|
+
var {
|
|
596
|
+
setPageLimit,
|
|
597
|
+
setFields,
|
|
598
|
+
setOrder,
|
|
599
|
+
setSelectedRowKeys,
|
|
600
|
+
setIndexRowTableModal,
|
|
601
|
+
setPage,
|
|
602
|
+
setDomainTable
|
|
603
|
+
} = listSlice.actions;
|
|
604
|
+
var selectList = (state) => state.list;
|
|
605
|
+
var list_slice_default = listSlice.reducer;
|
|
606
|
+
var initialState5 = {
|
|
607
|
+
menuList: []
|
|
608
|
+
};
|
|
609
|
+
var navbarSlice = toolkit.createSlice({
|
|
610
|
+
name: "navbar",
|
|
611
|
+
initialState: initialState5,
|
|
612
|
+
reducers: {
|
|
613
|
+
setMenuList: (state, action) => {
|
|
614
|
+
state.menuList = action.payload;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
661
617
|
});
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
var
|
|
665
|
-
var
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
var
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
window.localStorage.setItem(MAINT_LAST_PATH, lastPath);
|
|
618
|
+
var { setMenuList } = navbarSlice.actions;
|
|
619
|
+
var selectNavbar = (state) => state.navbar;
|
|
620
|
+
var navbar_slice_default = navbarSlice.reducer;
|
|
621
|
+
var initialState6 = {
|
|
622
|
+
profile: {}
|
|
623
|
+
};
|
|
624
|
+
var profileSlice = toolkit.createSlice({
|
|
625
|
+
name: "profile",
|
|
626
|
+
initialState: initialState6,
|
|
627
|
+
reducers: {
|
|
628
|
+
setProfile: (state, action) => {
|
|
629
|
+
state.profile = action.payload;
|
|
630
|
+
}
|
|
676
631
|
}
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
632
|
+
});
|
|
633
|
+
var { setProfile } = profileSlice.actions;
|
|
634
|
+
var selectProfile = (state) => state.profile;
|
|
635
|
+
var profile_slice_default = profileSlice.reducer;
|
|
636
|
+
var initialState7 = {
|
|
637
|
+
groupByDomain: null,
|
|
638
|
+
tableHead: [],
|
|
639
|
+
searchString: "",
|
|
640
|
+
hoveredIndexSearchList: null,
|
|
641
|
+
selectedTags: [],
|
|
642
|
+
firstDomain: null,
|
|
643
|
+
searchMap: {},
|
|
644
|
+
typeFieldsSearch: "",
|
|
645
|
+
modelSearch: "",
|
|
646
|
+
filterBy: [],
|
|
647
|
+
groupBy: []
|
|
648
|
+
};
|
|
649
|
+
var searchSlice = toolkit.createSlice({
|
|
650
|
+
name: "search",
|
|
651
|
+
initialState: initialState7,
|
|
652
|
+
reducers: {
|
|
653
|
+
setGroupByDomain: (state, action) => {
|
|
654
|
+
state.groupByDomain = action.payload;
|
|
655
|
+
},
|
|
656
|
+
setTableHead: (state, action) => {
|
|
657
|
+
state.tableHead = action.payload;
|
|
658
|
+
},
|
|
659
|
+
setSearchString: (state, action) => {
|
|
660
|
+
state.searchString = action.payload;
|
|
661
|
+
},
|
|
662
|
+
setHoveredIndexSearchList: (state, action) => {
|
|
663
|
+
state.hoveredIndexSearchList = action.payload;
|
|
664
|
+
},
|
|
665
|
+
setSelectedTags: (state, action) => {
|
|
666
|
+
state.selectedTags = action.payload;
|
|
667
|
+
},
|
|
668
|
+
setFirstDomain: (state, action) => {
|
|
669
|
+
state.firstDomain = action.payload;
|
|
670
|
+
},
|
|
671
|
+
setTypeFieldsSearch: (state, action) => {
|
|
672
|
+
state.typeFieldsSearch = action.payload;
|
|
673
|
+
},
|
|
674
|
+
setModelSearch: (state, action) => {
|
|
675
|
+
state.modelSearch = action.payload;
|
|
676
|
+
},
|
|
677
|
+
setFilterBy: (state, action) => {
|
|
678
|
+
state.filterBy = action.payload;
|
|
679
|
+
},
|
|
680
|
+
setGroupBy: (state, action) => {
|
|
681
|
+
state.groupBy = action.payload;
|
|
682
|
+
},
|
|
683
|
+
setSearchMap: (state, action) => {
|
|
684
|
+
state.searchMap = action.payload;
|
|
685
|
+
},
|
|
686
|
+
updateSearchMap: (state, action) => {
|
|
687
|
+
if (!state.searchMap[action.payload.key]) {
|
|
688
|
+
state.searchMap[action.payload.key] = [];
|
|
695
689
|
}
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
} catch {
|
|
707
|
-
window.location.replace("/login");
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
var axiosClient = {
|
|
711
|
-
init(config) {
|
|
712
|
-
const localStorage2 = config.localStorageUtils;
|
|
713
|
-
const sessionStorage = config.sessionStorageUtils;
|
|
714
|
-
const db = config.db;
|
|
715
|
-
let isRefreshing = false;
|
|
716
|
-
let failedQueue = [];
|
|
717
|
-
const processQueue = (error, token = null) => {
|
|
718
|
-
failedQueue?.forEach((prom) => {
|
|
719
|
-
if (error) {
|
|
720
|
-
prom.reject(error);
|
|
690
|
+
state.searchMap[action.payload.key].push(action.payload.value);
|
|
691
|
+
},
|
|
692
|
+
removeKeyFromSearchMap: (state, action) => {
|
|
693
|
+
const { key, item } = action.payload;
|
|
694
|
+
const values = state.searchMap[key];
|
|
695
|
+
if (!values) return;
|
|
696
|
+
if (item) {
|
|
697
|
+
const filtered = values.filter((value) => value.name !== item.name);
|
|
698
|
+
if (filtered.length > 0) {
|
|
699
|
+
state.searchMap[key] = filtered;
|
|
721
700
|
} else {
|
|
722
|
-
|
|
701
|
+
delete state.searchMap[key];
|
|
723
702
|
}
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
};
|
|
727
|
-
const instance = axios__default.default.create({
|
|
728
|
-
adapter: axios__default.default.defaults.adapter,
|
|
729
|
-
baseURL: config.baseUrl,
|
|
730
|
-
timeout: 5e4,
|
|
731
|
-
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
732
|
-
});
|
|
733
|
-
if (typeof window !== "undefined") {
|
|
734
|
-
const isMaint = window.localStorage.getItem(MAINT_KEY) === "true";
|
|
735
|
-
const onMaintenancePage = window.location.pathname === "/maintenance";
|
|
736
|
-
if (isMaint && !onMaintenancePage) {
|
|
737
|
-
hasRedirectedToMaintenance = true;
|
|
738
|
-
window.location.replace("/maintenance");
|
|
739
|
-
}
|
|
740
|
-
if (isMaint && onMaintenancePage) {
|
|
741
|
-
const healthUrl = config.healthUrl || `${(config.baseUrl || "").replace(/\/+$/, "")}/health`;
|
|
742
|
-
(async () => {
|
|
743
|
-
try {
|
|
744
|
-
await axios__default.default.get(healthUrl, { timeout: 8e3 });
|
|
745
|
-
await clearMaintenanceAndExit(() => localStorage2.getAccessToken(), {
|
|
746
|
-
forceLogin: true,
|
|
747
|
-
clearTokenOnForce: true,
|
|
748
|
-
clearToken: () => localStorage2.clearToken()
|
|
749
|
-
});
|
|
750
|
-
} catch {
|
|
751
|
-
}
|
|
752
|
-
})();
|
|
703
|
+
} else {
|
|
704
|
+
delete state.searchMap[key];
|
|
753
705
|
}
|
|
706
|
+
},
|
|
707
|
+
clearSearchMap: (state) => {
|
|
708
|
+
state.searchMap = {};
|
|
754
709
|
}
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
710
|
+
}
|
|
711
|
+
});
|
|
712
|
+
var {
|
|
713
|
+
setGroupByDomain,
|
|
714
|
+
setSelectedTags,
|
|
715
|
+
setSearchString,
|
|
716
|
+
setHoveredIndexSearchList,
|
|
717
|
+
setFirstDomain,
|
|
718
|
+
setTableHead,
|
|
719
|
+
setFilterBy,
|
|
720
|
+
setTypeFieldsSearch,
|
|
721
|
+
setModelSearch,
|
|
722
|
+
setSearchMap,
|
|
723
|
+
updateSearchMap,
|
|
724
|
+
removeKeyFromSearchMap,
|
|
725
|
+
setGroupBy,
|
|
726
|
+
clearSearchMap
|
|
727
|
+
} = searchSlice.actions;
|
|
728
|
+
var selectSearch = (state) => state.search;
|
|
729
|
+
var selectSearchMap = (state) => state.search.searchMap;
|
|
730
|
+
var search_slice_default = searchSlice.reducer;
|
|
731
|
+
|
|
732
|
+
// node_modules/redux/dist/redux.mjs
|
|
733
|
+
function formatProdErrorMessage(code) {
|
|
734
|
+
return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;
|
|
735
|
+
}
|
|
736
|
+
var randomString = () => Math.random().toString(36).substring(7).split("").join(".");
|
|
737
|
+
var ActionTypes = {
|
|
738
|
+
INIT: `@@redux/INIT${/* @__PURE__ */ randomString()}`,
|
|
739
|
+
REPLACE: `@@redux/REPLACE${/* @__PURE__ */ randomString()}`,
|
|
740
|
+
PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`
|
|
741
|
+
};
|
|
742
|
+
var actionTypes_default = ActionTypes;
|
|
743
|
+
function isPlainObject(obj) {
|
|
744
|
+
if (typeof obj !== "object" || obj === null)
|
|
745
|
+
return false;
|
|
746
|
+
let proto = obj;
|
|
747
|
+
while (Object.getPrototypeOf(proto) !== null) {
|
|
748
|
+
proto = Object.getPrototypeOf(proto);
|
|
749
|
+
}
|
|
750
|
+
return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null;
|
|
751
|
+
}
|
|
752
|
+
function miniKindOf(val) {
|
|
753
|
+
if (val === void 0)
|
|
754
|
+
return "undefined";
|
|
755
|
+
if (val === null)
|
|
756
|
+
return "null";
|
|
757
|
+
const type = typeof val;
|
|
758
|
+
switch (type) {
|
|
759
|
+
case "boolean":
|
|
760
|
+
case "string":
|
|
761
|
+
case "number":
|
|
762
|
+
case "symbol":
|
|
763
|
+
case "function": {
|
|
764
|
+
return type;
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
if (Array.isArray(val))
|
|
768
|
+
return "array";
|
|
769
|
+
if (isDate(val))
|
|
770
|
+
return "date";
|
|
771
|
+
if (isError(val))
|
|
772
|
+
return "error";
|
|
773
|
+
const constructorName = ctorName(val);
|
|
774
|
+
switch (constructorName) {
|
|
775
|
+
case "Symbol":
|
|
776
|
+
case "Promise":
|
|
777
|
+
case "WeakMap":
|
|
778
|
+
case "WeakSet":
|
|
779
|
+
case "Map":
|
|
780
|
+
case "Set":
|
|
781
|
+
return constructorName;
|
|
782
|
+
}
|
|
783
|
+
return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\s/g, "");
|
|
784
|
+
}
|
|
785
|
+
function ctorName(val) {
|
|
786
|
+
return typeof val.constructor === "function" ? val.constructor.name : null;
|
|
787
|
+
}
|
|
788
|
+
function isError(val) {
|
|
789
|
+
return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number";
|
|
790
|
+
}
|
|
791
|
+
function isDate(val) {
|
|
792
|
+
if (val instanceof Date)
|
|
793
|
+
return true;
|
|
794
|
+
return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function";
|
|
795
|
+
}
|
|
796
|
+
function kindOf(val) {
|
|
797
|
+
let typeOfVal = typeof val;
|
|
798
|
+
if (process.env.NODE_ENV !== "production") {
|
|
799
|
+
typeOfVal = miniKindOf(val);
|
|
800
|
+
}
|
|
801
|
+
return typeOfVal;
|
|
802
|
+
}
|
|
803
|
+
function warning(message) {
|
|
804
|
+
if (typeof console !== "undefined" && typeof console.error === "function") {
|
|
805
|
+
console.error(message);
|
|
806
|
+
}
|
|
807
|
+
try {
|
|
808
|
+
throw new Error(message);
|
|
809
|
+
} catch (e) {
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
|
|
813
|
+
const reducerKeys = Object.keys(reducers);
|
|
814
|
+
const argumentName = action && action.type === actionTypes_default.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer";
|
|
815
|
+
if (reducerKeys.length === 0) {
|
|
816
|
+
return "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";
|
|
817
|
+
}
|
|
818
|
+
if (!isPlainObject(inputState)) {
|
|
819
|
+
return `The ${argumentName} has unexpected type of "${kindOf(inputState)}". Expected argument to be an object with the following keys: "${reducerKeys.join('", "')}"`;
|
|
820
|
+
}
|
|
821
|
+
const unexpectedKeys = Object.keys(inputState).filter((key) => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]);
|
|
822
|
+
unexpectedKeys.forEach((key) => {
|
|
823
|
+
unexpectedKeyCache[key] = true;
|
|
824
|
+
});
|
|
825
|
+
if (action && action.type === actionTypes_default.REPLACE)
|
|
826
|
+
return;
|
|
827
|
+
if (unexpectedKeys.length > 0) {
|
|
828
|
+
return `Unexpected ${unexpectedKeys.length > 1 ? "keys" : "key"} "${unexpectedKeys.join('", "')}" found in ${argumentName}. Expected to find one of the known reducer keys instead: "${reducerKeys.join('", "')}". Unexpected keys will be ignored.`;
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
function assertReducerShape(reducers) {
|
|
832
|
+
Object.keys(reducers).forEach((key) => {
|
|
833
|
+
const reducer = reducers[key];
|
|
834
|
+
const initialState8 = reducer(void 0, {
|
|
835
|
+
type: actionTypes_default.INIT
|
|
836
|
+
});
|
|
837
|
+
if (typeof initialState8 === "undefined") {
|
|
838
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(12) : `The slice reducer for key "${key}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);
|
|
839
|
+
}
|
|
840
|
+
if (typeof reducer(void 0, {
|
|
841
|
+
type: actionTypes_default.PROBE_UNKNOWN_ACTION()
|
|
842
|
+
}) === "undefined") {
|
|
843
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(13) : `The slice reducer for key "${key}" returned undefined when probed with a random type. Don't try to handle '${actionTypes_default.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`);
|
|
844
|
+
}
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
function combineReducers(reducers) {
|
|
848
|
+
const reducerKeys = Object.keys(reducers);
|
|
849
|
+
const finalReducers = {};
|
|
850
|
+
for (let i = 0; i < reducerKeys.length; i++) {
|
|
851
|
+
const key = reducerKeys[i];
|
|
852
|
+
if (process.env.NODE_ENV !== "production") {
|
|
853
|
+
if (typeof reducers[key] === "undefined") {
|
|
854
|
+
warning(`No reducer provided for key "${key}"`);
|
|
882
855
|
}
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
856
|
+
}
|
|
857
|
+
if (typeof reducers[key] === "function") {
|
|
858
|
+
finalReducers[key] = reducers[key];
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
const finalReducerKeys = Object.keys(finalReducers);
|
|
862
|
+
let unexpectedKeyCache;
|
|
863
|
+
if (process.env.NODE_ENV !== "production") {
|
|
864
|
+
unexpectedKeyCache = {};
|
|
865
|
+
}
|
|
866
|
+
let shapeAssertionError;
|
|
867
|
+
try {
|
|
868
|
+
assertReducerShape(finalReducers);
|
|
869
|
+
} catch (e) {
|
|
870
|
+
shapeAssertionError = e;
|
|
871
|
+
}
|
|
872
|
+
return function combination(state = {}, action) {
|
|
873
|
+
if (shapeAssertionError) {
|
|
874
|
+
throw shapeAssertionError;
|
|
875
|
+
}
|
|
876
|
+
if (process.env.NODE_ENV !== "production") {
|
|
877
|
+
const warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
|
|
878
|
+
if (warningMessage) {
|
|
879
|
+
warning(warningMessage);
|
|
887
880
|
}
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
const
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
881
|
+
}
|
|
882
|
+
let hasChanged = false;
|
|
883
|
+
const nextState = {};
|
|
884
|
+
for (let i = 0; i < finalReducerKeys.length; i++) {
|
|
885
|
+
const key = finalReducerKeys[i];
|
|
886
|
+
const reducer = finalReducers[key];
|
|
887
|
+
const previousStateForKey = state[key];
|
|
888
|
+
const nextStateForKey = reducer(previousStateForKey, action);
|
|
889
|
+
if (typeof nextStateForKey === "undefined") {
|
|
890
|
+
const actionType = action && action.type;
|
|
891
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(14) : `When called with an action of type ${actionType ? `"${String(actionType)}"` : "(unknown type)"}, the slice reducer for key "${key}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`);
|
|
894
892
|
}
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
return url + (db2 ? "?db=" + db2 : "");
|
|
893
|
+
nextState[key] = nextStateForKey;
|
|
894
|
+
hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
|
|
898
895
|
}
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
896
|
+
hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
|
|
897
|
+
return hasChanged ? nextState : state;
|
|
898
|
+
};
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
// src/store/store.ts
|
|
902
|
+
var rootReducer = combineReducers({
|
|
903
|
+
env: env_slice_default,
|
|
904
|
+
navbar: navbar_slice_default,
|
|
905
|
+
list: list_slice_default,
|
|
906
|
+
search: search_slice_default,
|
|
907
|
+
form: form_slice_default,
|
|
908
|
+
excel: excel_slice_default,
|
|
909
|
+
profile: profile_slice_default
|
|
910
|
+
});
|
|
911
|
+
var envStore = toolkit.configureStore({
|
|
912
|
+
reducer: rootReducer,
|
|
913
|
+
middleware: (getDefaultMiddleware) => getDefaultMiddleware({
|
|
914
|
+
serializableCheck: false
|
|
915
|
+
})
|
|
916
|
+
});
|
|
917
|
+
|
|
918
|
+
// src/store/index.ts
|
|
919
|
+
var useAppDispatch = reactRedux.useDispatch;
|
|
920
|
+
var useAppSelector = reactRedux.useSelector;
|
|
917
921
|
|
|
918
922
|
// src/environment/EnvStore.ts
|
|
919
923
|
var EnvStore = class {
|
|
@@ -971,31 +975,148 @@ var EnvStore = class {
|
|
|
971
975
|
dispatch(setAllowCompanies(allowCompanies));
|
|
972
976
|
this.setup();
|
|
973
977
|
}
|
|
974
|
-
setCompanies(companies) {
|
|
975
|
-
const dispatch = this.envStore.dispatch;
|
|
976
|
-
dispatch(setCompanies(companies));
|
|
977
|
-
this.setup();
|
|
978
|
+
setCompanies(companies) {
|
|
979
|
+
const dispatch = this.envStore.dispatch;
|
|
980
|
+
dispatch(setCompanies(companies));
|
|
981
|
+
this.setup();
|
|
982
|
+
}
|
|
983
|
+
setDefaultCompany(company) {
|
|
984
|
+
const dispatch = this.envStore.dispatch;
|
|
985
|
+
dispatch(setDefaultCompany(company));
|
|
986
|
+
this.setup();
|
|
987
|
+
}
|
|
988
|
+
setUserInfo(userInfo) {
|
|
989
|
+
const dispatch = this.envStore.dispatch;
|
|
990
|
+
dispatch(setUser(userInfo));
|
|
991
|
+
this.setup();
|
|
992
|
+
}
|
|
993
|
+
};
|
|
994
|
+
exports.env = null;
|
|
995
|
+
function initEnv({}) {
|
|
996
|
+
exports.env = new EnvStore(envStore);
|
|
997
|
+
return exports.env;
|
|
998
|
+
}
|
|
999
|
+
function getEnv() {
|
|
1000
|
+
if (!exports.env) exports.env = new EnvStore(envStore);
|
|
1001
|
+
return exports.env;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
// src/models/base-model/index.ts
|
|
1005
|
+
var BaseModel = class {
|
|
1006
|
+
name;
|
|
1007
|
+
view;
|
|
1008
|
+
actContext;
|
|
1009
|
+
fields;
|
|
1010
|
+
constructor(init) {
|
|
1011
|
+
this.name = init.name;
|
|
1012
|
+
this.view = init.view;
|
|
1013
|
+
this.actContext = init.actContext;
|
|
1014
|
+
this.fields = init.fields;
|
|
1015
|
+
}
|
|
1016
|
+
getSpecificationByFields({
|
|
1017
|
+
fields = [],
|
|
1018
|
+
specification = {},
|
|
1019
|
+
modelsData,
|
|
1020
|
+
model,
|
|
1021
|
+
modelRoot
|
|
1022
|
+
}) {
|
|
1023
|
+
if (Array.isArray(fields)) {
|
|
1024
|
+
let spec = { ...specification };
|
|
1025
|
+
fields.forEach((field) => {
|
|
1026
|
+
if (!field?.type_co || field?.name && field?.type_co === "field" /* FIELD */) {
|
|
1027
|
+
if (modelsData?.[model]?.[field?.name]) {
|
|
1028
|
+
if (modelsData?.[model]?.[field?.name]?.type === "one2many" /* ONE2MANY */ || modelsData?.[model]?.[field?.name]?.type === "many2many" /* MANY2MANY */) {
|
|
1029
|
+
const relation = modelsData?.[model]?.[field?.name]?.relation;
|
|
1030
|
+
const modelRelation = modelsData?.[relation];
|
|
1031
|
+
if (modelRelation) {
|
|
1032
|
+
spec[field?.name] = {
|
|
1033
|
+
fields: {}
|
|
1034
|
+
};
|
|
1035
|
+
if (modelRoot && modelRoot === relation) {
|
|
1036
|
+
spec[field?.name].fields = { id: {} };
|
|
1037
|
+
} else {
|
|
1038
|
+
spec[field?.name].fields = this.getSpecificationByFields({
|
|
1039
|
+
fields: Object.values(modelRelation),
|
|
1040
|
+
specification: {},
|
|
1041
|
+
modelsData,
|
|
1042
|
+
model: relation,
|
|
1043
|
+
modelRoot: model
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
1046
|
+
} else {
|
|
1047
|
+
spec[field?.name] = {
|
|
1048
|
+
fields: {
|
|
1049
|
+
id: {},
|
|
1050
|
+
display_name: {}
|
|
1051
|
+
}
|
|
1052
|
+
};
|
|
1053
|
+
}
|
|
1054
|
+
} else if (modelsData?.[model]?.[field?.name]?.type === "many2one" /* MANY2ONE */) {
|
|
1055
|
+
spec[field?.name] = {
|
|
1056
|
+
fields: {
|
|
1057
|
+
id: {},
|
|
1058
|
+
display_name: {},
|
|
1059
|
+
...WIDGETAVATAR[field?.widget] ? { image_256: {} } : {},
|
|
1060
|
+
...field?.name === "currency_id" && fields?.find((item) => item?.widget === "monetary") ? { symbol: {} } : {},
|
|
1061
|
+
...field?.widget === "many2many_binary" ? { mimetype: {} } : {}
|
|
1062
|
+
}
|
|
1063
|
+
};
|
|
1064
|
+
} else {
|
|
1065
|
+
spec[field?.name] = {};
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
} else if (field?.type_co === "group" /* GROUP */ || field?.type_co === "div" /* DIV */ || field?.type_co === "span" /* SPAN */) {
|
|
1069
|
+
const specGroup = this.getSpecificationByFields({
|
|
1070
|
+
fields: field?.fields,
|
|
1071
|
+
specification: spec,
|
|
1072
|
+
modelsData,
|
|
1073
|
+
model
|
|
1074
|
+
});
|
|
1075
|
+
spec = { ...spec, ...specGroup };
|
|
1076
|
+
} else if (field?.type_co === "tree" /* TREE */ || field?.type_co === "list" /* LIST */) {
|
|
1077
|
+
const relation = modelsData?.[model]?.[field?.name]?.relation;
|
|
1078
|
+
const specTreee = this.getSpecificationByFields({
|
|
1079
|
+
fields: field?.fields,
|
|
1080
|
+
specification: {},
|
|
1081
|
+
modelsData,
|
|
1082
|
+
model: relation,
|
|
1083
|
+
modelRoot: model
|
|
1084
|
+
});
|
|
1085
|
+
spec = {
|
|
1086
|
+
...spec,
|
|
1087
|
+
[field?.name]: {
|
|
1088
|
+
fields: { ...spec?.[field?.name]?.fields, ...specTreee }
|
|
1089
|
+
}
|
|
1090
|
+
};
|
|
1091
|
+
}
|
|
1092
|
+
});
|
|
1093
|
+
return spec;
|
|
1094
|
+
} else {
|
|
1095
|
+
console.warn("fields is not array");
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
getTreeProps() {
|
|
1099
|
+
const props = this.view?.views?.list || {};
|
|
1100
|
+
return props;
|
|
978
1101
|
}
|
|
979
|
-
|
|
980
|
-
const
|
|
981
|
-
|
|
982
|
-
this.setup();
|
|
1102
|
+
getTreeFields() {
|
|
1103
|
+
const fields = this.view?.views?.list?.fields || [];
|
|
1104
|
+
return fields;
|
|
983
1105
|
}
|
|
984
|
-
|
|
985
|
-
const
|
|
986
|
-
|
|
987
|
-
this.
|
|
1106
|
+
getSpecification() {
|
|
1107
|
+
const specInit = {};
|
|
1108
|
+
const modelData = this.view?.models || {};
|
|
1109
|
+
const specification = this.getSpecificationByFields({
|
|
1110
|
+
fields: this.fields,
|
|
1111
|
+
specification: specInit,
|
|
1112
|
+
modelsData: modelData,
|
|
1113
|
+
model: this.name,
|
|
1114
|
+
modelRoot: ""
|
|
1115
|
+
});
|
|
1116
|
+
return specification;
|
|
988
1117
|
}
|
|
989
1118
|
};
|
|
990
|
-
|
|
991
|
-
function initEnv({}) {
|
|
992
|
-
exports.env = new EnvStore(envStore);
|
|
993
|
-
return exports.env;
|
|
994
|
-
}
|
|
995
|
-
function getEnv() {
|
|
996
|
-
if (!exports.env) exports.env = new EnvStore(envStore);
|
|
997
|
-
return exports.env;
|
|
998
|
-
}
|
|
1119
|
+
var base_model_default = BaseModel;
|
|
999
1120
|
|
|
1000
1121
|
// src/utils/domain/py_tokenizer.ts
|
|
1001
1122
|
var TokenizerError = class extends Error {
|
|
@@ -4394,137 +4515,30 @@ var ViewService = {
|
|
|
4394
4515
|
};
|
|
4395
4516
|
var view_service_default = ViewService;
|
|
4396
4517
|
|
|
4397
|
-
// src/models/
|
|
4398
|
-
var
|
|
4399
|
-
name;
|
|
4400
|
-
view;
|
|
4401
|
-
actContext;
|
|
4402
|
-
fields;
|
|
4518
|
+
// src/models/company-model/index.ts
|
|
4519
|
+
var CompanyModel = class extends base_model_default {
|
|
4403
4520
|
constructor(init) {
|
|
4404
|
-
|
|
4405
|
-
this.view = init.view;
|
|
4406
|
-
this.actContext = init.actContext;
|
|
4407
|
-
this.fields = init.fields;
|
|
4521
|
+
super(init);
|
|
4408
4522
|
}
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
specification = {},
|
|
4412
|
-
modelsData,
|
|
4413
|
-
model,
|
|
4414
|
-
modelRoot
|
|
4415
|
-
}) {
|
|
4416
|
-
if (Array.isArray(fields)) {
|
|
4417
|
-
let spec = { ...specification };
|
|
4418
|
-
fields.forEach((field) => {
|
|
4419
|
-
if (!field?.type_co || field?.name && field?.type_co === "field" /* FIELD */) {
|
|
4420
|
-
if (modelsData?.[model]?.[field?.name]) {
|
|
4421
|
-
if (modelsData?.[model]?.[field?.name]?.type === "one2many" /* ONE2MANY */ || modelsData?.[model]?.[field?.name]?.type === "many2many" /* MANY2MANY */) {
|
|
4422
|
-
const relation = modelsData?.[model]?.[field?.name]?.relation;
|
|
4423
|
-
const modelRelation = modelsData?.[relation];
|
|
4424
|
-
if (modelRelation) {
|
|
4425
|
-
spec[field?.name] = {
|
|
4426
|
-
fields: {}
|
|
4427
|
-
};
|
|
4428
|
-
if (modelRoot && modelRoot === relation) {
|
|
4429
|
-
spec[field?.name].fields = { id: {} };
|
|
4430
|
-
} else {
|
|
4431
|
-
spec[field?.name].fields = this.getSpecificationByFields({
|
|
4432
|
-
fields: Object.values(modelRelation),
|
|
4433
|
-
specification: {},
|
|
4434
|
-
modelsData,
|
|
4435
|
-
model: relation,
|
|
4436
|
-
modelRoot: model
|
|
4437
|
-
});
|
|
4438
|
-
}
|
|
4439
|
-
} else {
|
|
4440
|
-
spec[field?.name] = {
|
|
4441
|
-
fields: {
|
|
4442
|
-
id: {},
|
|
4443
|
-
display_name: {}
|
|
4444
|
-
}
|
|
4445
|
-
};
|
|
4446
|
-
}
|
|
4447
|
-
} else if (modelsData?.[model]?.[field?.name]?.type === "many2one" /* MANY2ONE */) {
|
|
4448
|
-
spec[field?.name] = {
|
|
4449
|
-
fields: {
|
|
4450
|
-
id: {},
|
|
4451
|
-
display_name: {},
|
|
4452
|
-
...WIDGETAVATAR[field?.widget] ? { image_256: {} } : {},
|
|
4453
|
-
...field?.name === "currency_id" && fields?.find((item) => item?.widget === "monetary") ? { symbol: {} } : {},
|
|
4454
|
-
...field?.widget === "many2many_binary" ? { mimetype: {} } : {}
|
|
4455
|
-
}
|
|
4456
|
-
};
|
|
4457
|
-
} else {
|
|
4458
|
-
spec[field?.name] = {};
|
|
4459
|
-
}
|
|
4460
|
-
}
|
|
4461
|
-
} else if (field?.type_co === "group" /* GROUP */ || field?.type_co === "div" /* DIV */ || field?.type_co === "span" /* SPAN */) {
|
|
4462
|
-
const specGroup = this.getSpecificationByFields({
|
|
4463
|
-
fields: field?.fields,
|
|
4464
|
-
specification: spec,
|
|
4465
|
-
modelsData,
|
|
4466
|
-
model
|
|
4467
|
-
});
|
|
4468
|
-
spec = { ...spec, ...specGroup };
|
|
4469
|
-
} else if (field?.type_co === "tree" /* TREE */ || field?.type_co === "list" /* LIST */) {
|
|
4470
|
-
const relation = modelsData?.[model]?.[field?.name]?.relation;
|
|
4471
|
-
const specTreee = this.getSpecificationByFields({
|
|
4472
|
-
fields: field?.fields,
|
|
4473
|
-
specification: {},
|
|
4474
|
-
modelsData,
|
|
4475
|
-
model: relation,
|
|
4476
|
-
modelRoot: model
|
|
4477
|
-
});
|
|
4478
|
-
spec = {
|
|
4479
|
-
...spec,
|
|
4480
|
-
[field?.name]: {
|
|
4481
|
-
fields: { ...spec?.[field?.name]?.fields, ...specTreee }
|
|
4482
|
-
}
|
|
4483
|
-
};
|
|
4484
|
-
}
|
|
4485
|
-
});
|
|
4486
|
-
return spec;
|
|
4487
|
-
} else {
|
|
4488
|
-
console.warn("fields is not array");
|
|
4489
|
-
}
|
|
4523
|
+
async getCurrentCompany() {
|
|
4524
|
+
return await company_service_default.getCurrentCompany();
|
|
4490
4525
|
}
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
return props;
|
|
4526
|
+
async getUserCompany(id) {
|
|
4527
|
+
return await company_service_default.getInfoCompany(id);
|
|
4494
4528
|
}
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4529
|
+
};
|
|
4530
|
+
var company_model_default = CompanyModel;
|
|
4531
|
+
|
|
4532
|
+
// src/models/user-model/index.ts
|
|
4533
|
+
var UserModel = class extends base_model_default {
|
|
4534
|
+
constructor(init) {
|
|
4535
|
+
super(init);
|
|
4498
4536
|
}
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
const modelData = this.view?.models || {};
|
|
4502
|
-
const specification = this.getSpecificationByFields({
|
|
4503
|
-
fields: this.fields,
|
|
4504
|
-
specification: specInit,
|
|
4505
|
-
modelsData: modelData,
|
|
4506
|
-
model: this.name,
|
|
4507
|
-
modelRoot: ""
|
|
4508
|
-
});
|
|
4509
|
-
return specification;
|
|
4537
|
+
async getProfile() {
|
|
4538
|
+
return await user_service_default.getProfile();
|
|
4510
4539
|
}
|
|
4511
4540
|
};
|
|
4512
|
-
var
|
|
4513
|
-
function useButton() {
|
|
4514
|
-
return reactQuery.useMutation({
|
|
4515
|
-
mutationFn: ({
|
|
4516
|
-
model,
|
|
4517
|
-
ids,
|
|
4518
|
-
context,
|
|
4519
|
-
method
|
|
4520
|
-
}) => action_service_default.callButton({
|
|
4521
|
-
model,
|
|
4522
|
-
ids,
|
|
4523
|
-
context,
|
|
4524
|
-
method
|
|
4525
|
-
})
|
|
4526
|
-
});
|
|
4527
|
-
}
|
|
4541
|
+
var user_model_default = UserModel;
|
|
4528
4542
|
var ReactQueryProvider = ({ children }) => {
|
|
4529
4543
|
const [queryClient] = react.useState(
|
|
4530
4544
|
() => new reactQuery.QueryClient({
|
|
@@ -4579,31 +4593,6 @@ var VersionGate = ({ children }) => {
|
|
|
4579
4593
|
return ready ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children }) : null;
|
|
4580
4594
|
};
|
|
4581
4595
|
|
|
4582
|
-
// src/models/company-model/index.ts
|
|
4583
|
-
var CompanyModel = class extends base_model_default {
|
|
4584
|
-
constructor(init) {
|
|
4585
|
-
super(init);
|
|
4586
|
-
}
|
|
4587
|
-
async getCurrentCompany() {
|
|
4588
|
-
return await company_service_default.getCurrentCompany();
|
|
4589
|
-
}
|
|
4590
|
-
async getUserCompany(id) {
|
|
4591
|
-
return await company_service_default.getInfoCompany(id);
|
|
4592
|
-
}
|
|
4593
|
-
};
|
|
4594
|
-
var company_model_default = CompanyModel;
|
|
4595
|
-
|
|
4596
|
-
// src/models/user-model/index.ts
|
|
4597
|
-
var UserModel = class extends base_model_default {
|
|
4598
|
-
constructor(init) {
|
|
4599
|
-
super(init);
|
|
4600
|
-
}
|
|
4601
|
-
async getProfile() {
|
|
4602
|
-
return await user_service_default.getProfile();
|
|
4603
|
-
}
|
|
4604
|
-
};
|
|
4605
|
-
var user_model_default = UserModel;
|
|
4606
|
-
|
|
4607
4596
|
exports.ActionService = action_service_default;
|
|
4608
4597
|
exports.AuthService = auth_service_default;
|
|
4609
4598
|
exports.BaseModel = base_model_default;
|
|
@@ -4710,5 +4699,4 @@ exports.toQueryString = toQueryString;
|
|
|
4710
4699
|
exports.updateSearchMap = updateSearchMap;
|
|
4711
4700
|
exports.useAppDispatch = useAppDispatch;
|
|
4712
4701
|
exports.useAppSelector = useAppSelector;
|
|
4713
|
-
exports.useButton = useButton;
|
|
4714
4702
|
exports.useTabModel = useTabModel;
|