@fctc/interface-logic 1.7.5 → 1.7.7

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.mjs CHANGED
@@ -31,6 +31,626 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
31
31
  return UriConstants2;
32
32
  })(UriConstants || {});
33
33
 
34
+ // src/store/index.ts
35
+ import { useDispatch, useSelector } from "react-redux";
36
+
37
+ // src/store/reducers/breadcrums-slice/index.ts
38
+ import { createSlice } from "@reduxjs/toolkit";
39
+ var initialState = {
40
+ breadCrumbs: []
41
+ };
42
+ var breadcrumbsSlice = createSlice({
43
+ name: "breadcrumbs",
44
+ initialState,
45
+ reducers: {
46
+ setBreadCrumbs: (state, action) => {
47
+ state.breadCrumbs = [...state.breadCrumbs, action.payload];
48
+ }
49
+ }
50
+ });
51
+ var { setBreadCrumbs } = breadcrumbsSlice.actions;
52
+ var breadcrums_slice_default = breadcrumbsSlice.reducer;
53
+
54
+ // src/store/reducers/env-slice/index.ts
55
+ import { createSlice as createSlice2 } from "@reduxjs/toolkit";
56
+ var initialState2 = {
57
+ baseUrl: "",
58
+ companies: [],
59
+ user: {},
60
+ db: "",
61
+ refreshTokenEndpoint: "",
62
+ config: {
63
+ grantType: "",
64
+ clientId: "",
65
+ clientSecret: "",
66
+ redirectUri: ""
67
+ },
68
+ envFile: null,
69
+ defaultCompany: {
70
+ id: null,
71
+ logo: "",
72
+ secondary_color: "",
73
+ primary_color: ""
74
+ },
75
+ context: {
76
+ uid: null,
77
+ allowed_company_ids: [],
78
+ lang: "vi_VN",
79
+ tz: "Asia/Saigon"
80
+ }
81
+ };
82
+ var envSlice = createSlice2({
83
+ name: "env",
84
+ initialState: initialState2,
85
+ reducers: {
86
+ setEnv: (state, action) => {
87
+ Object.assign(state, action.payload);
88
+ },
89
+ setUid: (state, action) => {
90
+ state.context.uid = action.payload;
91
+ },
92
+ setAllowCompanies: (state, action) => {
93
+ state.context.allowed_company_ids = action.payload;
94
+ },
95
+ setCompanies: (state, action) => {
96
+ state.companies = action.payload;
97
+ },
98
+ setDefaultCompany: (state, action) => {
99
+ state.defaultCompany = action.payload;
100
+ },
101
+ setLang: (state, action) => {
102
+ state.context.lang = action.payload;
103
+ },
104
+ setUser: (state, action) => {
105
+ state.user = action.payload;
106
+ },
107
+ setConfig: (state, action) => {
108
+ state.config = action.payload;
109
+ },
110
+ setEnvFile: (state, action) => {
111
+ state.envFile = action.payload;
112
+ }
113
+ }
114
+ });
115
+ var {
116
+ setEnv,
117
+ setUid,
118
+ setLang,
119
+ setAllowCompanies,
120
+ setCompanies,
121
+ setDefaultCompany,
122
+ setUser,
123
+ setConfig,
124
+ setEnvFile
125
+ } = envSlice.actions;
126
+ var env_slice_default = envSlice.reducer;
127
+
128
+ // src/store/reducers/excel-slice/index.ts
129
+ import { createSlice as createSlice3 } from "@reduxjs/toolkit";
130
+ var initialState3 = {
131
+ dataParse: null,
132
+ idFile: null,
133
+ isFileLoaded: false,
134
+ loadingImport: false,
135
+ selectedFile: null,
136
+ errorData: null
137
+ };
138
+ var excelSlice = createSlice3({
139
+ name: "excel",
140
+ initialState: initialState3,
141
+ reducers: {
142
+ setDataParse: (state, action) => {
143
+ state.dataParse = action.payload;
144
+ },
145
+ setIdFile: (state, action) => {
146
+ state.idFile = action.payload;
147
+ },
148
+ setIsFileLoaded: (state, action) => {
149
+ state.isFileLoaded = action.payload;
150
+ },
151
+ setLoadingImport: (state, action) => {
152
+ state.loadingImport = action.payload;
153
+ },
154
+ setSelectedFile: (state, action) => {
155
+ state.selectedFile = action.payload;
156
+ },
157
+ setErrorData: (state, action) => {
158
+ state.errorData = action.payload;
159
+ }
160
+ }
161
+ });
162
+ var {
163
+ setDataParse,
164
+ setIdFile,
165
+ setIsFileLoaded,
166
+ setLoadingImport,
167
+ setSelectedFile,
168
+ setErrorData
169
+ } = excelSlice.actions;
170
+ var excel_slice_default = excelSlice.reducer;
171
+
172
+ // src/store/reducers/form-slice/index.ts
173
+ import { createSlice as createSlice4 } from "@reduxjs/toolkit";
174
+ var initialState4 = {
175
+ viewDataStore: {},
176
+ isShowingModalDetail: false,
177
+ isShowModalTranslate: false,
178
+ formSubmitComponent: {},
179
+ fieldTranslation: null,
180
+ listSubject: {},
181
+ dataUser: {}
182
+ };
183
+ var formSlice = createSlice4({
184
+ name: "form",
185
+ initialState: initialState4,
186
+ reducers: {
187
+ setViewDataStore: (state, action) => {
188
+ state.viewDataStore = action.payload;
189
+ },
190
+ setIsShowingModalDetail: (state, action) => {
191
+ state.isShowingModalDetail = action.payload;
192
+ },
193
+ setIsShowModalTranslate: (state, action) => {
194
+ state.isShowModalTranslate = action.payload;
195
+ },
196
+ setFormSubmitComponent: (state, action) => {
197
+ state.formSubmitComponent[action.payload.key] = action.payload.component;
198
+ },
199
+ setFieldTranslate: (state, action) => {
200
+ state.fieldTranslation = action.payload;
201
+ },
202
+ setListSubject: (state, action) => {
203
+ state.listSubject = action.payload;
204
+ },
205
+ setDataUser: (state, action) => {
206
+ state.dataUser = action.payload;
207
+ }
208
+ }
209
+ });
210
+ var {
211
+ setViewDataStore,
212
+ setIsShowingModalDetail,
213
+ setIsShowModalTranslate,
214
+ setFormSubmitComponent,
215
+ setFieldTranslate,
216
+ setListSubject,
217
+ setDataUser
218
+ } = formSlice.actions;
219
+ var form_slice_default = formSlice.reducer;
220
+
221
+ // src/store/reducers/header-slice/index.ts
222
+ import { createSlice as createSlice5 } from "@reduxjs/toolkit";
223
+ var headerSlice = createSlice5({
224
+ name: "header",
225
+ initialState: {
226
+ value: { allowedCompanyIds: [] }
227
+ },
228
+ reducers: {
229
+ setHeader: (state, action) => {
230
+ state.value = { ...state.value, ...action.payload };
231
+ },
232
+ setAllowedCompanyIds: (state, action) => {
233
+ state.value.allowedCompanyIds = action.payload;
234
+ }
235
+ }
236
+ });
237
+ var { setAllowedCompanyIds, setHeader } = headerSlice.actions;
238
+ var header_slice_default = headerSlice.reducer;
239
+
240
+ // src/store/reducers/list-slice/index.ts
241
+ import { createSlice as createSlice6 } from "@reduxjs/toolkit";
242
+ var initialState5 = {
243
+ pageLimit: 10,
244
+ fields: {},
245
+ order: "",
246
+ selectedRowKeys: [],
247
+ selectedRadioKey: 0,
248
+ indexRowTableModal: -2,
249
+ isUpdateTableModal: false,
250
+ footerGroupTable: {},
251
+ transferDetail: null,
252
+ page: 0,
253
+ domainTable: []
254
+ };
255
+ var listSlice = createSlice6({
256
+ name: "list",
257
+ initialState: initialState5,
258
+ reducers: {
259
+ setPageLimit: (state, action) => {
260
+ state.pageLimit = action.payload;
261
+ },
262
+ setFields: (state, action) => {
263
+ state.fields = action.payload;
264
+ },
265
+ setOrder: (state, action) => {
266
+ state.order = action.payload;
267
+ },
268
+ setSelectedRowKeys: (state, action) => {
269
+ state.selectedRowKeys = action.payload;
270
+ },
271
+ setSelectedRadioKey: (state, action) => {
272
+ state.selectedRadioKey = action.payload;
273
+ },
274
+ setIndexRowTableModal: (state, action) => {
275
+ state.indexRowTableModal = action.payload;
276
+ },
277
+ setTransferDetail: (state, action) => {
278
+ state.transferDetail = action.payload;
279
+ },
280
+ setIsUpdateTableModal: (state, action) => {
281
+ state.isUpdateTableModal = action.payload;
282
+ },
283
+ setPage: (state, action) => {
284
+ state.page = action.payload;
285
+ },
286
+ setDomainTable: (state, action) => {
287
+ state.domainTable = action.payload;
288
+ }
289
+ }
290
+ });
291
+ var {
292
+ setPageLimit,
293
+ setFields,
294
+ setOrder,
295
+ setSelectedRowKeys,
296
+ setIndexRowTableModal,
297
+ setIsUpdateTableModal,
298
+ setPage,
299
+ setSelectedRadioKey,
300
+ setTransferDetail,
301
+ setDomainTable
302
+ } = listSlice.actions;
303
+ var list_slice_default = listSlice.reducer;
304
+
305
+ // src/store/reducers/login-slice/index.ts
306
+ import { createSlice as createSlice7 } from "@reduxjs/toolkit";
307
+ var initialState6 = {
308
+ db: "",
309
+ redirectTo: "/",
310
+ forgotPasswordUrl: "/"
311
+ };
312
+ var loginSlice = createSlice7({
313
+ name: "login",
314
+ initialState: initialState6,
315
+ reducers: {
316
+ setDb: (state, action) => {
317
+ state.db = action.payload;
318
+ },
319
+ setRedirectTo: (state, action) => {
320
+ state.redirectTo = action.payload;
321
+ },
322
+ setForgotPasswordUrl: (state, action) => {
323
+ state.forgotPasswordUrl = action.payload;
324
+ }
325
+ }
326
+ });
327
+ var { setDb, setRedirectTo, setForgotPasswordUrl } = loginSlice.actions;
328
+ var login_slice_default = loginSlice.reducer;
329
+
330
+ // src/store/reducers/navbar-slice/index.ts
331
+ import { createSlice as createSlice8 } from "@reduxjs/toolkit";
332
+ var initialState7 = {
333
+ menuFocus: {},
334
+ menuAction: {},
335
+ navbarWidth: 250,
336
+ menuList: []
337
+ };
338
+ var navbarSlice = createSlice8({
339
+ name: "navbar",
340
+ initialState: initialState7,
341
+ reducers: {
342
+ setMenuFocus: (state, action) => {
343
+ state.menuFocus = action.payload;
344
+ },
345
+ setMenuFocusAction: (state, action) => {
346
+ state.menuAction = action.payload;
347
+ },
348
+ setNavbarWidth: (state, action) => {
349
+ state.navbarWidth = action.payload;
350
+ },
351
+ setMenuList: (state, action) => {
352
+ state.menuList = action.payload;
353
+ }
354
+ }
355
+ });
356
+ var { setMenuFocus, setMenuFocusAction, setNavbarWidth, setMenuList } = navbarSlice.actions;
357
+ var navbar_slice_default = navbarSlice.reducer;
358
+
359
+ // src/store/reducers/profile-slice/index.ts
360
+ import { createSlice as createSlice9 } from "@reduxjs/toolkit";
361
+ var initialState8 = {
362
+ profile: {}
363
+ };
364
+ var profileSlice = createSlice9({
365
+ name: "profile",
366
+ initialState: initialState8,
367
+ reducers: {
368
+ setProfile: (state, action) => {
369
+ state.profile = action.payload;
370
+ }
371
+ }
372
+ });
373
+ var { setProfile } = profileSlice.actions;
374
+ var profile_slice_default = profileSlice.reducer;
375
+
376
+ // src/store/reducers/search-slice/index.ts
377
+ import { createSlice as createSlice10 } from "@reduxjs/toolkit";
378
+ var initialState9 = {
379
+ groupByDomain: null,
380
+ searchBy: [],
381
+ searchString: "",
382
+ hoveredIndexSearchList: null,
383
+ selectedTags: [],
384
+ firstDomain: null,
385
+ searchMap: {},
386
+ filterBy: [],
387
+ groupBy: []
388
+ };
389
+ var searchSlice = createSlice10({
390
+ name: "search",
391
+ initialState: initialState9,
392
+ reducers: {
393
+ setGroupByDomain: (state, action) => {
394
+ state.groupByDomain = action.payload;
395
+ },
396
+ setSearchBy: (state, action) => {
397
+ state.searchBy = action.payload;
398
+ },
399
+ setSearchString: (state, action) => {
400
+ state.searchString = action.payload;
401
+ },
402
+ setHoveredIndexSearchList: (state, action) => {
403
+ state.hoveredIndexSearchList = action.payload;
404
+ },
405
+ setSelectedTags: (state, action) => {
406
+ state.selectedTags = action.payload;
407
+ },
408
+ setFirstDomain: (state, action) => {
409
+ state.firstDomain = action.payload;
410
+ },
411
+ setFilterBy: (state, action) => {
412
+ state.filterBy = action.payload;
413
+ },
414
+ setGroupBy: (state, action) => {
415
+ state.groupBy = action.payload;
416
+ },
417
+ setSearchMap: (state, action) => {
418
+ state.searchMap = action.payload;
419
+ },
420
+ updateSearchMap: (state, action) => {
421
+ if (!state.searchMap[action.payload.key]) {
422
+ state.searchMap[action.payload.key] = [];
423
+ }
424
+ state.searchMap[action.payload.key].push(action.payload.value);
425
+ },
426
+ removeKeyFromSearchMap: (state, action) => {
427
+ const { key, item } = action.payload;
428
+ const values = state.searchMap[key];
429
+ if (!values) return;
430
+ if (item) {
431
+ const filtered = values.filter((value) => value.name !== item.name);
432
+ if (filtered.length > 0) {
433
+ state.searchMap[key] = filtered;
434
+ } else {
435
+ delete state.searchMap[key];
436
+ }
437
+ } else {
438
+ delete state.searchMap[key];
439
+ }
440
+ },
441
+ clearSearchMap: (state) => {
442
+ state.searchMap = {};
443
+ }
444
+ }
445
+ });
446
+ var {
447
+ setGroupByDomain,
448
+ setSelectedTags,
449
+ setSearchString,
450
+ setHoveredIndexSearchList,
451
+ setFirstDomain,
452
+ setSearchBy,
453
+ setFilterBy,
454
+ setSearchMap,
455
+ updateSearchMap,
456
+ removeKeyFromSearchMap,
457
+ setGroupBy,
458
+ clearSearchMap
459
+ } = searchSlice.actions;
460
+ var search_slice_default = searchSlice.reducer;
461
+
462
+ // src/store/store.ts
463
+ import { configureStore } from "@reduxjs/toolkit";
464
+
465
+ // node_modules/redux/dist/redux.mjs
466
+ function formatProdErrorMessage(code) {
467
+ 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. `;
468
+ }
469
+ var randomString = () => Math.random().toString(36).substring(7).split("").join(".");
470
+ var ActionTypes = {
471
+ INIT: `@@redux/INIT${/* @__PURE__ */ randomString()}`,
472
+ REPLACE: `@@redux/REPLACE${/* @__PURE__ */ randomString()}`,
473
+ PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`
474
+ };
475
+ var actionTypes_default = ActionTypes;
476
+ function isPlainObject(obj) {
477
+ if (typeof obj !== "object" || obj === null)
478
+ return false;
479
+ let proto = obj;
480
+ while (Object.getPrototypeOf(proto) !== null) {
481
+ proto = Object.getPrototypeOf(proto);
482
+ }
483
+ return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null;
484
+ }
485
+ function miniKindOf(val) {
486
+ if (val === void 0)
487
+ return "undefined";
488
+ if (val === null)
489
+ return "null";
490
+ const type = typeof val;
491
+ switch (type) {
492
+ case "boolean":
493
+ case "string":
494
+ case "number":
495
+ case "symbol":
496
+ case "function": {
497
+ return type;
498
+ }
499
+ }
500
+ if (Array.isArray(val))
501
+ return "array";
502
+ if (isDate(val))
503
+ return "date";
504
+ if (isError(val))
505
+ return "error";
506
+ const constructorName = ctorName(val);
507
+ switch (constructorName) {
508
+ case "Symbol":
509
+ case "Promise":
510
+ case "WeakMap":
511
+ case "WeakSet":
512
+ case "Map":
513
+ case "Set":
514
+ return constructorName;
515
+ }
516
+ return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\s/g, "");
517
+ }
518
+ function ctorName(val) {
519
+ return typeof val.constructor === "function" ? val.constructor.name : null;
520
+ }
521
+ function isError(val) {
522
+ return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number";
523
+ }
524
+ function isDate(val) {
525
+ if (val instanceof Date)
526
+ return true;
527
+ return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function";
528
+ }
529
+ function kindOf(val) {
530
+ let typeOfVal = typeof val;
531
+ if (process.env.NODE_ENV !== "production") {
532
+ typeOfVal = miniKindOf(val);
533
+ }
534
+ return typeOfVal;
535
+ }
536
+ function warning(message) {
537
+ if (typeof console !== "undefined" && typeof console.error === "function") {
538
+ console.error(message);
539
+ }
540
+ try {
541
+ throw new Error(message);
542
+ } catch (e) {
543
+ }
544
+ }
545
+ function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
546
+ const reducerKeys = Object.keys(reducers);
547
+ const argumentName = action && action.type === actionTypes_default.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer";
548
+ if (reducerKeys.length === 0) {
549
+ return "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";
550
+ }
551
+ if (!isPlainObject(inputState)) {
552
+ return `The ${argumentName} has unexpected type of "${kindOf(inputState)}". Expected argument to be an object with the following keys: "${reducerKeys.join('", "')}"`;
553
+ }
554
+ const unexpectedKeys = Object.keys(inputState).filter((key) => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]);
555
+ unexpectedKeys.forEach((key) => {
556
+ unexpectedKeyCache[key] = true;
557
+ });
558
+ if (action && action.type === actionTypes_default.REPLACE)
559
+ return;
560
+ if (unexpectedKeys.length > 0) {
561
+ 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.`;
562
+ }
563
+ }
564
+ function assertReducerShape(reducers) {
565
+ Object.keys(reducers).forEach((key) => {
566
+ const reducer = reducers[key];
567
+ const initialState10 = reducer(void 0, {
568
+ type: actionTypes_default.INIT
569
+ });
570
+ if (typeof initialState10 === "undefined") {
571
+ 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.`);
572
+ }
573
+ if (typeof reducer(void 0, {
574
+ type: actionTypes_default.PROBE_UNKNOWN_ACTION()
575
+ }) === "undefined") {
576
+ 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.`);
577
+ }
578
+ });
579
+ }
580
+ function combineReducers(reducers) {
581
+ const reducerKeys = Object.keys(reducers);
582
+ const finalReducers = {};
583
+ for (let i = 0; i < reducerKeys.length; i++) {
584
+ const key = reducerKeys[i];
585
+ if (process.env.NODE_ENV !== "production") {
586
+ if (typeof reducers[key] === "undefined") {
587
+ warning(`No reducer provided for key "${key}"`);
588
+ }
589
+ }
590
+ if (typeof reducers[key] === "function") {
591
+ finalReducers[key] = reducers[key];
592
+ }
593
+ }
594
+ const finalReducerKeys = Object.keys(finalReducers);
595
+ let unexpectedKeyCache;
596
+ if (process.env.NODE_ENV !== "production") {
597
+ unexpectedKeyCache = {};
598
+ }
599
+ let shapeAssertionError;
600
+ try {
601
+ assertReducerShape(finalReducers);
602
+ } catch (e) {
603
+ shapeAssertionError = e;
604
+ }
605
+ return function combination(state = {}, action) {
606
+ if (shapeAssertionError) {
607
+ throw shapeAssertionError;
608
+ }
609
+ if (process.env.NODE_ENV !== "production") {
610
+ const warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
611
+ if (warningMessage) {
612
+ warning(warningMessage);
613
+ }
614
+ }
615
+ let hasChanged = false;
616
+ const nextState = {};
617
+ for (let i = 0; i < finalReducerKeys.length; i++) {
618
+ const key = finalReducerKeys[i];
619
+ const reducer = finalReducers[key];
620
+ const previousStateForKey = state[key];
621
+ const nextStateForKey = reducer(previousStateForKey, action);
622
+ if (typeof nextStateForKey === "undefined") {
623
+ const actionType = action && action.type;
624
+ 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.`);
625
+ }
626
+ nextState[key] = nextStateForKey;
627
+ hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
628
+ }
629
+ hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
630
+ return hasChanged ? nextState : state;
631
+ };
632
+ }
633
+
634
+ // src/store/store.ts
635
+ var rootReducer = combineReducers({
636
+ env: env_slice_default,
637
+ header: header_slice_default,
638
+ navbar: navbar_slice_default,
639
+ list: list_slice_default,
640
+ search: search_slice_default,
641
+ form: form_slice_default,
642
+ breadcrumbs: breadcrums_slice_default,
643
+ login: login_slice_default,
644
+ excel: excel_slice_default,
645
+ profile: profile_slice_default
646
+ });
647
+ var envStore = configureStore({
648
+ reducer: rootReducer,
649
+ middleware: (getDefaultMiddleware) => getDefaultMiddleware({
650
+ serializableCheck: false
651
+ })
652
+ });
653
+
34
654
  // src/configs/axios-client.ts
35
655
  import axios from "axios";
36
656
 
@@ -2172,331 +2792,19 @@ var isBase64File = (str) => {
2172
2792
  return false;
2173
2793
  }
2174
2794
  };
2175
- var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
2176
- if (!originalRequest.data) return originalRequest.data;
2177
- if (typeof originalRequest.data === "string") {
2178
- try {
2179
- const parsedData = JSON.parse(originalRequest.data);
2180
- if (parsedData.with_context && typeof parsedData.with_context === "object") {
2181
- parsedData.with_context.token = newAccessToken;
2182
- }
2183
- return JSON.stringify(parsedData);
2184
- } catch (e) {
2185
- console.warn("Failed to parse originalRequest.data", e);
2186
- return originalRequest.data;
2187
- }
2188
- }
2189
- if (typeof originalRequest.data === "object" && originalRequest.data.with_context) {
2190
- originalRequest.data.with_context.token = newAccessToken;
2191
- }
2192
- return originalRequest.data;
2193
- };
2194
-
2195
- // src/utils/storage/local-storage.ts
2196
- var localStorageUtils = () => {
2197
- const setToken = async (access_token) => {
2198
- localStorage.setItem("accessToken", access_token);
2199
- };
2200
- const setRefreshToken = async (refresh_token) => {
2201
- localStorage.setItem("refreshToken", refresh_token);
2202
- };
2203
- const getAccessToken = async () => {
2204
- return localStorage.getItem("accessToken");
2205
- };
2206
- const getRefreshToken = async () => {
2207
- return localStorage.getItem("refreshToken");
2208
- };
2209
- const clearToken = async () => {
2210
- localStorage.removeItem("accessToken");
2211
- localStorage.removeItem("refreshToken");
2212
- };
2213
- return {
2214
- setToken,
2215
- setRefreshToken,
2216
- getAccessToken,
2217
- getRefreshToken,
2218
- clearToken
2219
- };
2220
- };
2221
-
2222
- // src/utils/storage/session-storage.ts
2223
- var sessionStorageUtils = () => {
2224
- const getBrowserSession = async () => {
2225
- return sessionStorage.getItem("browserSession");
2226
- };
2227
- return {
2228
- getBrowserSession
2229
- };
2230
- };
2231
-
2232
- // src/configs/axios-client.ts
2233
- var axiosClient = {
2234
- init(config) {
2235
- const localStorage2 = config.localStorageUtils ?? localStorageUtils();
2236
- const sessionStorage2 = config.sessionStorageUtils ?? sessionStorageUtils();
2237
- const db = config.db;
2238
- let isRefreshing = false;
2239
- let failedQueue = [];
2240
- const processQueue = (error, token = null) => {
2241
- failedQueue?.forEach((prom) => {
2242
- if (error) {
2243
- prom.reject(error);
2244
- } else {
2245
- prom.resolve(token);
2246
- }
2247
- });
2248
- failedQueue = [];
2249
- };
2250
- const instance = axios.create({
2251
- adapter: axios.defaults.adapter,
2252
- baseURL: config.baseUrl,
2253
- timeout: 5e4,
2254
- paramsSerializer: (params) => new URLSearchParams(params).toString()
2255
- });
2256
- instance.interceptors.request.use(
2257
- async (config2) => {
2258
- const useRefreshToken = config2.useRefreshToken;
2259
- const token = useRefreshToken ? await localStorage2.getRefreshToken() : await localStorage2.getAccessToken();
2260
- if (token) {
2261
- config2.headers["Authorization"] = "Bearer " + token;
2262
- }
2263
- return config2;
2264
- },
2265
- (error) => {
2266
- Promise.reject(error);
2267
- }
2268
- );
2269
- instance.interceptors.response.use(
2270
- (response) => {
2271
- return handleResponse(response);
2272
- },
2273
- async (error) => {
2274
- const handleError3 = async (error2) => {
2275
- if (!error2.response) {
2276
- return error2;
2277
- }
2278
- const { data } = error2.response;
2279
- if (data && data.code === 400 && ["invalid_grant"].includes(data.data?.error)) {
2280
- await clearAuthToken();
2281
- }
2282
- return data;
2283
- };
2284
- const originalRequest = error.config;
2285
- if ((error.response?.status === 403 || error.response?.status === 401 || error.response?.status === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
2286
- error.response.data.code
2287
- )) {
2288
- if (isRefreshing) {
2289
- return new Promise(function(resolve, reject) {
2290
- failedQueue.push({ resolve, reject });
2291
- }).then((token) => {
2292
- originalRequest.headers["Authorization"] = "Bearer " + token;
2293
- originalRequest.data = updateTokenParamInOriginalRequest(
2294
- originalRequest,
2295
- token
2296
- );
2297
- return instance.request(originalRequest);
2298
- }).catch(async (err) => {
2299
- if ((err.response?.status === 400 || err.response?.status === 401) && ["invalid_grant"].includes(err.response.data.error)) {
2300
- await clearAuthToken();
2301
- }
2302
- });
2303
- }
2304
- const browserSession = await sessionStorage2.getBrowserSession();
2305
- const refreshToken = await localStorage2.getRefreshToken();
2306
- const accessTokenExp = await localStorage2.getAccessToken();
2307
- isRefreshing = true;
2308
- if (!refreshToken && (!browserSession || browserSession == "unActive")) {
2309
- await clearAuthToken();
2310
- } else {
2311
- const payload = Object.fromEntries(
2312
- Object.entries({
2313
- refresh_token: refreshToken,
2314
- grant_type: "refresh_token",
2315
- client_id: config.config.clientId,
2316
- client_secret: config.config.clientSecret
2317
- }).filter(([_, value]) => !!value)
2318
- );
2319
- return new Promise(function(resolve) {
2320
- axios.post(
2321
- `${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2322
- payload,
2323
- {
2324
- headers: {
2325
- "Content-Type": config.refreshTokenEndpoint ? "application/x-www-form-urlencoded" : "multipart/form-data",
2326
- Authorization: `Bearer ${accessTokenExp}`
2327
- }
2328
- }
2329
- ).then(async (res) => {
2330
- const data = res.data;
2331
- await localStorage2.setToken(data.access_token);
2332
- await localStorage2.setRefreshToken(data.refresh_token);
2333
- axios.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
2334
- originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
2335
- originalRequest.data = updateTokenParamInOriginalRequest(
2336
- originalRequest,
2337
- data.access_token
2338
- );
2339
- processQueue(null, data.access_token);
2340
- resolve(instance.request(originalRequest));
2341
- }).catch(async (err) => {
2342
- if (err && (err?.error_code === "AUTHEN_FAIL" || err?.error_code === "TOKEN_EXPIRED" || err?.error_code === "TOKEN_INCORRECT" || err?.code === "ERR_BAD_REQUEST") || err?.error_code === "ERR_2FA_006") {
2343
- await clearAuthToken();
2344
- }
2345
- if (err && err.response) {
2346
- const { error_code } = err.response?.data || {};
2347
- if (error_code === "AUTHEN_FAIL") {
2348
- await clearAuthToken();
2349
- }
2350
- }
2351
- processQueue(err, null);
2352
- }).finally(() => {
2353
- isRefreshing = false;
2354
- });
2355
- });
2356
- }
2357
- }
2358
- return Promise.reject(await handleError3(error));
2359
- }
2360
- );
2361
- const handleResponse = (res) => {
2362
- if (res && res.data) {
2363
- return res.data;
2364
- }
2365
- return res;
2366
- };
2367
- const handleError2 = (error) => {
2368
- if (error.isAxiosError && error.code === "ECONNABORTED") {
2369
- console.error("Request Timeout Error:", error);
2370
- return "Request Timeout Error";
2371
- } else if (error.isAxiosError && !error.response) {
2372
- console.error("Network Error:", error);
2373
- return "Network Error";
2374
- } else {
2375
- console.error("Other Error:", error?.response);
2376
- const errorMessage = error?.response?.data?.message || "An error occurred";
2377
- return { message: errorMessage, status: error?.response?.status };
2378
- }
2379
- };
2380
- const clearAuthToken = async () => {
2381
- await localStorage2.clearToken();
2382
- if (typeof window !== "undefined") {
2383
- window.location.href = `/login`;
2384
- }
2385
- };
2386
- function formatUrl(url, db2) {
2387
- return url + (db2 ? "?db=" + db2 : "");
2388
- }
2389
- const responseBody = (response) => response;
2390
- const requests = {
2391
- get: (url, headers) => instance.get(formatUrl(url, db), headers).then(responseBody),
2392
- post: (url, body, headers) => instance.post(formatUrl(url, db), body, headers).then(responseBody),
2393
- post_excel: (url, body, headers) => instance.post(formatUrl(url, db), body, {
2394
- responseType: "arraybuffer",
2395
- headers: {
2396
- "Content-Type": typeof window !== "undefined" ? "application/json" : "application/javascript",
2397
- Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
2398
- }
2399
- }).then(responseBody),
2400
- put: (url, body, headers) => instance.put(formatUrl(url, db), body, headers).then(responseBody),
2401
- patch: (url, body) => instance.patch(formatUrl(url, db), body).then(responseBody),
2402
- delete: (url, body) => instance.delete(formatUrl(url, db), body).then(responseBody)
2403
- };
2404
- return requests;
2405
- }
2406
- };
2407
2795
 
2408
2796
  // src/environment/EnvStore.ts
2409
- var EnvStore = class _EnvStore {
2410
- static instance = null;
2411
- state = {};
2412
- localStorageUtils;
2413
- sessionStorageUtils;
2414
- constructor(localStorageUtils2, sessionStorageUtils2) {
2415
- this.localStorageUtils = localStorageUtils2;
2416
- this.sessionStorageUtils = sessionStorageUtils2;
2417
- }
2418
- static getInstance(localStorageUtils2, sessionStorageUtils2) {
2419
- if (!_EnvStore.instance) {
2420
- console.log("Creating new EnvStore instance");
2421
- _EnvStore.instance = new _EnvStore(localStorageUtils2, sessionStorageUtils2);
2422
- } else {
2423
- console.log("Returning existing EnvStore instance");
2424
- }
2425
- return _EnvStore.instance;
2426
- }
2427
- setupEnv(envConfig) {
2428
- this.state = {
2429
- ...this.state,
2430
- ...envConfig,
2431
- localStorageUtils: this.localStorageUtils,
2432
- sessionStorageUtils: this.sessionStorageUtils
2433
- };
2434
- console.log("Setting up env with config:", envConfig);
2435
- this.state.requests = axiosClient.init(this.state);
2436
- console.log("axiosClient.init result:", this.state.requests);
2437
- }
2438
- setUid(uid) {
2439
- this.state.uid = uid;
2440
- }
2441
- setLang(lang) {
2442
- this.state.lang = lang;
2443
- }
2444
- setAllowCompanies(allowCompanies) {
2445
- this.state.allowCompanies = allowCompanies;
2446
- }
2447
- setCompanies(companies) {
2448
- this.state.companies = companies;
2449
- }
2450
- setDefaultCompany(company) {
2451
- this.state.defaultCompany = company;
2452
- }
2453
- setUserInfo(userInfo) {
2454
- this.state.user = userInfo;
2455
- }
2456
- // Getters để truy cập trạng thái
2457
- get baseUrl() {
2458
- return this.state.baseUrl;
2459
- }
2460
- get requests() {
2461
- return this.state.requests;
2462
- }
2463
- get context() {
2464
- return this.state.context;
2465
- }
2466
- get defaultCompany() {
2467
- return this.state.defaultCompany;
2468
- }
2469
- get config() {
2470
- return this.state.config;
2471
- }
2472
- get companies() {
2473
- return this.state.companies;
2474
- }
2475
- get user() {
2476
- return this.state.user;
2477
- }
2478
- get db() {
2479
- return this.state.db;
2480
- }
2481
- get refreshTokenEndpoint() {
2482
- return this.state.refreshTokenEndpoint;
2483
- }
2484
- get uid() {
2485
- return this.state.uid;
2486
- }
2487
- get lang() {
2488
- return this.state.lang;
2489
- }
2490
- get allowCompanies() {
2491
- return this.state.allowCompanies;
2492
- }
2797
+ var requests = {
2798
+ get: async (url, headers) => ({}),
2799
+ post: async (url, body, headers) => ({}),
2800
+ post_excel: async (url, body, headers) => ({}),
2801
+ put: async (url, body, headers) => ({}),
2802
+ patch: async (url, body) => ({}),
2803
+ delete: async (url, body) => ({})
2493
2804
  };
2494
2805
  function getEnv() {
2495
- const instance = EnvStore.getInstance();
2496
- if (!instance) {
2497
- throw new Error("EnvStore has not been initialized \u2014 call initEnv() first");
2498
- }
2499
- return instance;
2806
+ const env = envStore.getState().env;
2807
+ return { ...env, requests };
2500
2808
  }
2501
2809
 
2502
2810
  // src/services/action-service/index.ts
@@ -2664,7 +2972,7 @@ var AuthService = {
2664
2972
  }).filter(([_, value]) => !!value)
2665
2973
  );
2666
2974
  const encodedData = new URLSearchParams(payload).toString();
2667
- return env?.requests?.post(body.path, encodedData, {
2975
+ return env?.requests?.post(body?.path ?? "", encodedData, {
2668
2976
  headers: {
2669
2977
  "Content-Type": "application/x-www-form-urlencoded"
2670
2978
  }
@@ -2761,6 +3069,20 @@ var AuthService = {
2761
3069
  }
2762
3070
  });
2763
3071
  },
3072
+ async isValidActionToken(actionToken, path) {
3073
+ const env = getEnv();
3074
+ return env?.requests?.post(
3075
+ path,
3076
+ {},
3077
+ {
3078
+ headers: {
3079
+ "Content-Type": "application/json"
3080
+ },
3081
+ useActionToken: true,
3082
+ actionToken
3083
+ }
3084
+ );
3085
+ },
2764
3086
  async loginSocial({
2765
3087
  db,
2766
3088
  state,
@@ -3525,7 +3847,7 @@ var model_service_default = ModelService;
3525
3847
  var UserService = {
3526
3848
  async getProfile(path) {
3527
3849
  const env = getEnv();
3528
- return env.requests.get(path ?? "/userinfo" /* PROFILE_PATH */, {
3850
+ return env?.requests?.get(path ?? "/userinfo" /* PROFILE_PATH */, {
3529
3851
  headers: {
3530
3852
  "Content-Type": "application/x-www-form-urlencoded"
3531
3853
  }
@@ -3844,8 +4166,7 @@ var ViewService = {
3844
4166
  },
3845
4167
  async getVersion() {
3846
4168
  const env = getEnv();
3847
- console.log("env?.requests", env, env?.requests);
3848
- return env?.requests?.get("", {
4169
+ return env?.requests.get("", {
3849
4170
  headers: {
3850
4171
  "Content-Type": "application/json"
3851
4172
  }
@@ -4162,19 +4483,33 @@ var useGetAccessByCode = () => {
4162
4483
  };
4163
4484
  var use_get_access_by_code_default = useGetAccessByCode;
4164
4485
 
4165
- // src/hooks/company/use-get-company-info.ts
4486
+ // src/hooks/auth/use-validate-action-token.ts
4166
4487
  import { useMutation as useMutation12 } from "@tanstack/react-query";
4167
- var useGetCompanyInfo = () => {
4488
+ var useValidateActionToken = () => {
4168
4489
  return useMutation12({
4490
+ mutationFn: ({
4491
+ actionToken,
4492
+ path
4493
+ }) => {
4494
+ return auth_service_default.isValidActionToken(actionToken, path);
4495
+ }
4496
+ });
4497
+ };
4498
+ var use_validate_action_token_default = useValidateActionToken;
4499
+
4500
+ // src/hooks/company/use-get-company-info.ts
4501
+ import { useMutation as useMutation13 } from "@tanstack/react-query";
4502
+ var useGetCompanyInfo = () => {
4503
+ return useMutation13({
4169
4504
  mutationFn: (id) => company_service_default.getInfoCompany(id)
4170
4505
  });
4171
4506
  };
4172
4507
  var use_get_company_info_default = useGetCompanyInfo;
4173
4508
 
4174
4509
  // src/hooks/company/use-get-current-company.ts
4175
- import { useMutation as useMutation13 } from "@tanstack/react-query";
4510
+ import { useMutation as useMutation14 } from "@tanstack/react-query";
4176
4511
  var useGetCurrentCompany = () => {
4177
- return useMutation13({
4512
+ return useMutation14({
4178
4513
  mutationFn: () => company_service_default.getCurrentCompany()
4179
4514
  });
4180
4515
  };
@@ -4201,9 +4536,9 @@ var useGetListCompany = (companyIDs = []) => {
4201
4536
  var use_get_list_company_default = useGetListCompany;
4202
4537
 
4203
4538
  // src/hooks/excel/use-export-excel.ts
4204
- import { useMutation as useMutation14 } from "@tanstack/react-query";
4539
+ import { useMutation as useMutation15 } from "@tanstack/react-query";
4205
4540
  var useExportExcel = () => {
4206
- return useMutation14({
4541
+ return useMutation15({
4207
4542
  mutationFn: ({
4208
4543
  model,
4209
4544
  domain,
@@ -4228,9 +4563,9 @@ var useExportExcel = () => {
4228
4563
  var use_export_excel_default = useExportExcel;
4229
4564
 
4230
4565
  // src/hooks/excel/use-get-field-export.ts
4231
- import { useMutation as useMutation15 } from "@tanstack/react-query";
4566
+ import { useMutation as useMutation16 } from "@tanstack/react-query";
4232
4567
  var useGetFieldExport = () => {
4233
- return useMutation15({
4568
+ return useMutation16({
4234
4569
  mutationFn: ({
4235
4570
  ids,
4236
4571
  model,
@@ -4277,9 +4612,9 @@ var useGetFileExcel = ({ model }) => {
4277
4612
  var use_get_file_excel_default = useGetFileExcel;
4278
4613
 
4279
4614
  // src/hooks/excel/use-parse-preview.ts
4280
- import { useMutation as useMutation16 } from "@tanstack/react-query";
4615
+ import { useMutation as useMutation17 } from "@tanstack/react-query";
4281
4616
  var useParsePreview = () => {
4282
- return useMutation16({
4617
+ return useMutation17({
4283
4618
  mutationFn: ({
4284
4619
  id,
4285
4620
  selectedSheet,
@@ -4296,9 +4631,9 @@ var useParsePreview = () => {
4296
4631
  var use_parse_preview_default = useParsePreview;
4297
4632
 
4298
4633
  // src/hooks/excel/use-upload-file.ts
4299
- import { useMutation as useMutation17 } from "@tanstack/react-query";
4634
+ import { useMutation as useMutation18 } from "@tanstack/react-query";
4300
4635
  var useUploadFile = () => {
4301
- return useMutation17({
4636
+ return useMutation18({
4302
4637
  mutationFn: ({ formData }) => excel_service_default.uploadFile({
4303
4638
  formData
4304
4639
  })
@@ -4307,9 +4642,9 @@ var useUploadFile = () => {
4307
4642
  var use_upload_file_default = useUploadFile;
4308
4643
 
4309
4644
  // src/hooks/excel/use-upload-id-file.ts
4310
- import { useMutation as useMutation18 } from "@tanstack/react-query";
4645
+ import { useMutation as useMutation19 } from "@tanstack/react-query";
4311
4646
  var useUploadIdFile = () => {
4312
- return useMutation18({
4647
+ return useMutation19({
4313
4648
  mutationFn: ({ formData }) => excel_service_default.uploadIdFile({
4314
4649
  formData
4315
4650
  })
@@ -4318,9 +4653,9 @@ var useUploadIdFile = () => {
4318
4653
  var use_upload_id_file_default = useUploadIdFile;
4319
4654
 
4320
4655
  // src/hooks/excel/uss-execute-import.ts
4321
- import { useMutation as useMutation19 } from "@tanstack/react-query";
4656
+ import { useMutation as useMutation20 } from "@tanstack/react-query";
4322
4657
  var useExecuteImport = () => {
4323
- return useMutation19({
4658
+ return useMutation20({
4324
4659
  mutationFn: ({
4325
4660
  fields,
4326
4661
  columns,
@@ -4341,9 +4676,9 @@ var useExecuteImport = () => {
4341
4676
  var uss_execute_import_default = useExecuteImport;
4342
4677
 
4343
4678
  // src/hooks/form/use-change-status.ts
4344
- import { useMutation as useMutation20 } from "@tanstack/react-query";
4679
+ import { useMutation as useMutation21 } from "@tanstack/react-query";
4345
4680
  var useChangeStatus = () => {
4346
- return useMutation20({
4681
+ return useMutation21({
4347
4682
  mutationFn: ({ data }) => {
4348
4683
  return form_service_default.changeStatus({
4349
4684
  data
@@ -4354,9 +4689,9 @@ var useChangeStatus = () => {
4354
4689
  var use_change_status_default = useChangeStatus;
4355
4690
 
4356
4691
  // src/hooks/form/use-delete-comment.ts
4357
- import { useMutation as useMutation21 } from "@tanstack/react-query";
4692
+ import { useMutation as useMutation22 } from "@tanstack/react-query";
4358
4693
  var useDeleteComment = () => {
4359
- return useMutation21({
4694
+ return useMutation22({
4360
4695
  mutationFn: ({ data }) => form_service_default.deleteComment({
4361
4696
  data
4362
4697
  })
@@ -4421,9 +4756,9 @@ var useGetImage = ({
4421
4756
  var use_get_image_default = useGetImage;
4422
4757
 
4423
4758
  // src/hooks/form/use-send-comment.ts
4424
- import { useMutation as useMutation22 } from "@tanstack/react-query";
4759
+ import { useMutation as useMutation23 } from "@tanstack/react-query";
4425
4760
  var useSendComment = () => {
4426
- return useMutation22({
4761
+ return useMutation23({
4427
4762
  mutationFn: ({ data }) => form_service_default.sentComment({
4428
4763
  data
4429
4764
  })
@@ -4432,9 +4767,9 @@ var useSendComment = () => {
4432
4767
  var use_send_comment_default = useSendComment;
4433
4768
 
4434
4769
  // src/hooks/form/use-upload-image.ts
4435
- import { useMutation as useMutation23 } from "@tanstack/react-query";
4770
+ import { useMutation as useMutation24 } from "@tanstack/react-query";
4436
4771
  var useUploadImage = () => {
4437
- return useMutation23({
4772
+ return useMutation24({
4438
4773
  mutationFn: ({ data }) => form_service_default.uploadImage({
4439
4774
  data
4440
4775
  })
@@ -4443,9 +4778,9 @@ var useUploadImage = () => {
4443
4778
  var use_upload_image_default = useUploadImage;
4444
4779
 
4445
4780
  // src/hooks/model/use-delete.ts
4446
- import { useMutation as useMutation24 } from "@tanstack/react-query";
4781
+ import { useMutation as useMutation25 } from "@tanstack/react-query";
4447
4782
  var useDelete = () => {
4448
- return useMutation24({
4783
+ return useMutation25({
4449
4784
  mutationFn: ({ ids, model }) => model_service_default.delete({ ids, model })
4450
4785
  });
4451
4786
  };
@@ -4499,9 +4834,9 @@ var useGetCurrency = () => {
4499
4834
  var use_get_currency_default = useGetCurrency;
4500
4835
 
4501
4836
  // src/hooks/model/use-get-detail.ts
4502
- import { useMutation as useMutation25 } from "@tanstack/react-query";
4837
+ import { useMutation as useMutation26 } from "@tanstack/react-query";
4503
4838
  var useGetDetail = () => {
4504
- return useMutation25({
4839
+ return useMutation26({
4505
4840
  mutationFn: ({
4506
4841
  model,
4507
4842
  ids,
@@ -4694,9 +5029,9 @@ var useOdooDataTransform = () => {
4694
5029
  var use_odoo_data_transform_default = useOdooDataTransform;
4695
5030
 
4696
5031
  // src/hooks/model/use-onchange-form.ts
4697
- import { useMutation as useMutation26 } from "@tanstack/react-query";
5032
+ import { useMutation as useMutation27 } from "@tanstack/react-query";
4698
5033
  var useOnChangeForm = () => {
4699
- return useMutation26({
5034
+ return useMutation27({
4700
5035
  mutationFn: ({
4701
5036
  ids,
4702
5037
  model,
@@ -4717,9 +5052,9 @@ var useOnChangeForm = () => {
4717
5052
  var use_onchange_form_default = useOnChangeForm;
4718
5053
 
4719
5054
  // src/hooks/model/use-save.ts
4720
- import { useMutation as useMutation27 } from "@tanstack/react-query";
5055
+ import { useMutation as useMutation28 } from "@tanstack/react-query";
4721
5056
  var useSave = () => {
4722
- return useMutation27({
5057
+ return useMutation28({
4723
5058
  mutationFn: ({
4724
5059
  ids,
4725
5060
  model,
@@ -4733,18 +5068,18 @@ var useSave = () => {
4733
5068
  var use_save_default = useSave;
4734
5069
 
4735
5070
  // src/hooks/user/use-get-profile.ts
4736
- import { useMutation as useMutation28 } from "@tanstack/react-query";
5071
+ import { useMutation as useMutation29 } from "@tanstack/react-query";
4737
5072
  var useGetProfile = (path) => {
4738
- return useMutation28({
5073
+ return useMutation29({
4739
5074
  mutationFn: () => user_service_default.getProfile(path)
4740
5075
  });
4741
5076
  };
4742
5077
  var use_get_profile_default = useGetProfile;
4743
5078
 
4744
5079
  // src/hooks/user/use-get-user.ts
4745
- import { useMutation as useMutation29 } from "@tanstack/react-query";
5080
+ import { useMutation as useMutation30 } from "@tanstack/react-query";
4746
5081
  var useGetUser = () => {
4747
- return useMutation29({
5082
+ return useMutation30({
4748
5083
  mutationFn: ({ id, context }) => user_service_default.getUser({
4749
5084
  id,
4750
5085
  context
@@ -4754,9 +5089,9 @@ var useGetUser = () => {
4754
5089
  var use_get_user_default = useGetUser;
4755
5090
 
4756
5091
  // src/hooks/user/use-switch-locale.ts
4757
- import { useMutation as useMutation30 } from "@tanstack/react-query";
5092
+ import { useMutation as useMutation31 } from "@tanstack/react-query";
4758
5093
  var useSwitchLocale = () => {
4759
- return useMutation30({
5094
+ return useMutation31({
4760
5095
  mutationFn: ({ data }) => {
4761
5096
  return user_service_default.switchUserLocale({
4762
5097
  id: data.id,
@@ -4768,9 +5103,9 @@ var useSwitchLocale = () => {
4768
5103
  var use_switch_locale_default = useSwitchLocale;
4769
5104
 
4770
5105
  // src/hooks/view/use-button.ts
4771
- import { useMutation as useMutation31 } from "@tanstack/react-query";
5106
+ import { useMutation as useMutation32 } from "@tanstack/react-query";
4772
5107
  var useButton = () => {
4773
- return useMutation31({
5108
+ return useMutation32({
4774
5109
  mutationFn: ({
4775
5110
  model,
4776
5111
  ids,
@@ -4790,9 +5125,9 @@ var useButton = () => {
4790
5125
  var use_button_default = useButton;
4791
5126
 
4792
5127
  // src/hooks/view/use-duplicate-record.ts
4793
- import { useMutation as useMutation32 } from "@tanstack/react-query";
5128
+ import { useMutation as useMutation33 } from "@tanstack/react-query";
4794
5129
  var useDuplicateRecord = () => {
4795
- return useMutation32({
5130
+ return useMutation33({
4796
5131
  mutationFn: ({
4797
5132
  id,
4798
5133
  model,
@@ -4918,9 +5253,9 @@ var useGetMenu = (context, enabled) => {
4918
5253
  var use_get_menu_default = useGetMenu;
4919
5254
 
4920
5255
  // src/hooks/view/use-get-print-report.ts
4921
- import { useMutation as useMutation33 } from "@tanstack/react-query";
5256
+ import { useMutation as useMutation34 } from "@tanstack/react-query";
4922
5257
  var useGetPrintReport = () => {
4923
- return useMutation33({
5258
+ return useMutation34({
4924
5259
  mutationFn: ({ id }) => action_service_default.getPrintReportName({
4925
5260
  id
4926
5261
  })
@@ -4984,9 +5319,9 @@ var useGetView = (viewParams, actData) => {
4984
5319
  var use_get_view_default = useGetView;
4985
5320
 
4986
5321
  // src/hooks/view/use-load-action.ts
4987
- import { useMutation as useMutation34 } from "@tanstack/react-query";
5322
+ import { useMutation as useMutation35 } from "@tanstack/react-query";
4988
5323
  var useLoadAction = () => {
4989
- return useMutation34({
5324
+ return useMutation35({
4990
5325
  mutationFn: ({
4991
5326
  idAction,
4992
5327
  context
@@ -5012,9 +5347,9 @@ var useLoadMessage = () => {
5012
5347
  var use_load_message_default = useLoadMessage;
5013
5348
 
5014
5349
  // src/hooks/view/use-print.ts
5015
- import { useMutation as useMutation35 } from "@tanstack/react-query";
5350
+ import { useMutation as useMutation36 } from "@tanstack/react-query";
5016
5351
  var usePrint = () => {
5017
- return useMutation35({
5352
+ return useMutation36({
5018
5353
  mutationFn: ({ id, report, db }) => action_service_default.print({
5019
5354
  id,
5020
5355
  report,
@@ -5025,9 +5360,9 @@ var usePrint = () => {
5025
5360
  var use_print_default = usePrint;
5026
5361
 
5027
5362
  // src/hooks/view/use-remove-row.ts
5028
- import { useMutation as useMutation36 } from "@tanstack/react-query";
5363
+ import { useMutation as useMutation37 } from "@tanstack/react-query";
5029
5364
  var useRemoveRow = () => {
5030
- return useMutation36({
5365
+ return useMutation37({
5031
5366
  mutationFn: ({
5032
5367
  model,
5033
5368
  ids,
@@ -5059,9 +5394,9 @@ var useGetResequence = (model, resIds, context, offset) => {
5059
5394
  var use_resequence_default = useGetResequence;
5060
5395
 
5061
5396
  // src/hooks/view/use-run-action.ts
5062
- import { useMutation as useMutation37 } from "@tanstack/react-query";
5397
+ import { useMutation as useMutation38 } from "@tanstack/react-query";
5063
5398
  var useRunAction = () => {
5064
- return useMutation37({
5399
+ return useMutation38({
5065
5400
  mutationFn: ({
5066
5401
  idAction,
5067
5402
  context
@@ -5074,9 +5409,9 @@ var useRunAction = () => {
5074
5409
  var use_run_action_default = useRunAction;
5075
5410
 
5076
5411
  // src/hooks/view/use-signin-sso.ts
5077
- import { useMutation as useMutation38 } from "@tanstack/react-query";
5412
+ import { useMutation as useMutation39 } from "@tanstack/react-query";
5078
5413
  var useSignInSSO = () => {
5079
- return useMutation38({
5414
+ return useMutation39({
5080
5415
  mutationFn: ({
5081
5416
  redirect_uri,
5082
5417
  state,
@@ -5097,9 +5432,9 @@ var useSignInSSO = () => {
5097
5432
  var use_signin_sso_default = useSignInSSO;
5098
5433
 
5099
5434
  // src/hooks/view/use-verify-2FA.ts
5100
- import { useMutation as useMutation39 } from "@tanstack/react-query";
5435
+ import { useMutation as useMutation40 } from "@tanstack/react-query";
5101
5436
  var useVerify2FA = () => {
5102
- return useMutation39({
5437
+ return useMutation40({
5103
5438
  mutationFn: ({
5104
5439
  method,
5105
5440
  with_context,
@@ -5120,9 +5455,9 @@ var useVerify2FA = () => {
5120
5455
  var use_verify_2FA_default = useVerify2FA;
5121
5456
 
5122
5457
  // src/hooks/view/uset-get-2FA-method.ts
5123
- import { useMutation as useMutation40 } from "@tanstack/react-query";
5458
+ import { useMutation as useMutation41 } from "@tanstack/react-query";
5124
5459
  var useGet2FAMethods = () => {
5125
- return useMutation40({
5460
+ return useMutation41({
5126
5461
  mutationFn: ({
5127
5462
  method,
5128
5463
  with_context
@@ -5137,9 +5472,9 @@ var useGet2FAMethods = () => {
5137
5472
  var uset_get_2FA_method_default = useGet2FAMethods;
5138
5473
 
5139
5474
  // src/hooks/view/use-get-fields-view-security.ts
5140
- import { useMutation as useMutation41 } from "@tanstack/react-query";
5475
+ import { useMutation as useMutation42 } from "@tanstack/react-query";
5141
5476
  var useGetFieldsViewSecurity = () => {
5142
- return useMutation41({
5477
+ return useMutation42({
5143
5478
  mutationFn: ({
5144
5479
  method,
5145
5480
  token,
@@ -5156,9 +5491,9 @@ var useGetFieldsViewSecurity = () => {
5156
5491
  var use_get_fields_view_security_default = useGetFieldsViewSecurity;
5157
5492
 
5158
5493
  // src/hooks/view/use-grant-access.ts
5159
- import { useMutation as useMutation42 } from "@tanstack/react-query";
5494
+ import { useMutation as useMutation43 } from "@tanstack/react-query";
5160
5495
  var useGrantAccess = () => {
5161
- return useMutation42({
5496
+ return useMutation43({
5162
5497
  mutationFn: ({
5163
5498
  redirect_uri,
5164
5499
  state,
@@ -5177,9 +5512,9 @@ var useGrantAccess = () => {
5177
5512
  var use_grant_access_default = useGrantAccess;
5178
5513
 
5179
5514
  // src/hooks/view/use-remove-totp-setup.ts
5180
- import { useMutation as useMutation43 } from "@tanstack/react-query";
5515
+ import { useMutation as useMutation44 } from "@tanstack/react-query";
5181
5516
  var useRemoveTotpSetup = () => {
5182
- return useMutation43({
5517
+ return useMutation44({
5183
5518
  mutationFn: ({ method, token }) => {
5184
5519
  return view_service_default.removeTotpSetUp({
5185
5520
  method,
@@ -5191,9 +5526,9 @@ var useRemoveTotpSetup = () => {
5191
5526
  var use_remove_totp_setup_default = useRemoveTotpSetup;
5192
5527
 
5193
5528
  // src/hooks/view/use-request-setup-totp.ts
5194
- import { useMutation as useMutation44 } from "@tanstack/react-query";
5529
+ import { useMutation as useMutation45 } from "@tanstack/react-query";
5195
5530
  var useRequestSetupTotp = () => {
5196
- return useMutation44({
5531
+ return useMutation45({
5197
5532
  mutationFn: ({ method, token }) => {
5198
5533
  return view_service_default.requestSetupTotp({
5199
5534
  method,
@@ -5205,9 +5540,9 @@ var useRequestSetupTotp = () => {
5205
5540
  var use_request_setup_totp_default = useRequestSetupTotp;
5206
5541
 
5207
5542
  // src/hooks/view/use-settings-web-read-2fa.ts
5208
- import { useMutation as useMutation45 } from "@tanstack/react-query";
5543
+ import { useMutation as useMutation46 } from "@tanstack/react-query";
5209
5544
  var useSettingsWebRead2fa = () => {
5210
- return useMutation45({
5545
+ return useMutation46({
5211
5546
  mutationFn: ({
5212
5547
  method,
5213
5548
  token,
@@ -5226,9 +5561,9 @@ var useSettingsWebRead2fa = () => {
5226
5561
  var use_settings_web_read_2fa_default = useSettingsWebRead2fa;
5227
5562
 
5228
5563
  // src/hooks/view/use-verify-totp.ts
5229
- import { useMutation as useMutation46 } from "@tanstack/react-query";
5564
+ import { useMutation as useMutation47 } from "@tanstack/react-query";
5230
5565
  var useVerifyTotp = () => {
5231
- return useMutation46({
5566
+ return useMutation47({
5232
5567
  mutationFn: ({
5233
5568
  method,
5234
5569
  action_token,
@@ -5310,6 +5645,7 @@ export {
5310
5645
  use_upload_file_default as useUploadFile,
5311
5646
  use_upload_id_file_default as useUploadIdFile,
5312
5647
  use_upload_image_default as useUploadImage,
5648
+ use_validate_action_token_default as useValidateActionToken,
5313
5649
  use_verify_2FA_default as useVerify2FA,
5314
5650
  use_verify_totp_default as useVerifyTotp
5315
5651
  };