@fctc/interface-logic 1.10.5 → 1.10.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.
@@ -96,18 +96,4 @@ type GetSelectionType = {
96
96
  specification?: any;
97
97
  };
98
98
 
99
- type View = [number | boolean, string];
100
- type Option = {
101
- action_id?: number;
102
- load_filters?: boolean;
103
- toolbar?: boolean;
104
- };
105
- interface GetViewParams {
106
- model?: string;
107
- views?: View[];
108
- context?: Record<string, any>;
109
- options?: Option;
110
- aid?: number | string | null | boolean;
111
- }
112
-
113
- export type { ContextApi as C, DeleteParams as D, ForgotPasswordBody as F, GetSelectionType as G, LoginCredentialBody as L, OnChangeParams as O, ResetPasswordRequest as R, SocialTokenBody as S, UpdatePasswordRequest as U, ViewData as V, GetViewParams as a, GetListParams as b, GetDetailParams as c, SaveParams as d, GetAllParams as e, Specification as f, View as g, updatePasswordBody as u };
99
+ export type { ContextApi as C, DeleteParams as D, ForgotPasswordBody as F, GetSelectionType as G, LoginCredentialBody as L, OnChangeParams as O, ResetPasswordRequest as R, SocialTokenBody as S, UpdatePasswordRequest as U, ViewData as V, GetListParams as a, GetDetailParams as b, SaveParams as c, GetAllParams as d, Specification as e, updatePasswordBody as u };
@@ -96,18 +96,4 @@ type GetSelectionType = {
96
96
  specification?: any;
97
97
  };
98
98
 
99
- type View = [number | boolean, string];
100
- type Option = {
101
- action_id?: number;
102
- load_filters?: boolean;
103
- toolbar?: boolean;
104
- };
105
- interface GetViewParams {
106
- model?: string;
107
- views?: View[];
108
- context?: Record<string, any>;
109
- options?: Option;
110
- aid?: number | string | null | boolean;
111
- }
112
-
113
- export type { ContextApi as C, DeleteParams as D, ForgotPasswordBody as F, GetSelectionType as G, LoginCredentialBody as L, OnChangeParams as O, ResetPasswordRequest as R, SocialTokenBody as S, UpdatePasswordRequest as U, ViewData as V, GetViewParams as a, GetListParams as b, GetDetailParams as c, SaveParams as d, GetAllParams as e, Specification as f, View as g, updatePasswordBody as u };
99
+ export type { ContextApi as C, DeleteParams as D, ForgotPasswordBody as F, GetSelectionType as G, LoginCredentialBody as L, OnChangeParams as O, ResetPasswordRequest as R, SocialTokenBody as S, UpdatePasswordRequest as U, ViewData as V, GetListParams as a, GetDetailParams as b, SaveParams as c, GetAllParams as d, Specification as e, updatePasswordBody as u };
package/dist/hooks.d.mts CHANGED
@@ -1,230 +1,7 @@
1
+ export { u as useChangeStatus, a as useDelete, b as useDeleteComment, c as useExecuteImport, d as useExportExcel, e as useForgotPassword, f as useForgotPasswordSSO, O as useGetAccessByCode, g as useGetAll, h as useGetComment, i as useGetCompanyInfo, j as useGetConversionRate, k as useGetCurrency, l as useGetCurrentCompany, m as useGetDetail, n as useGetFieldExport, o as useGetFieldOnChange, p as useGetFileExcel, q as useGetFormView, r as useGetImage, s as useGetListCompany, t as useGetListMyBankAccount, v as useGetProfile, w as useGetProvider, x as useGetUser, y as useIsValidToken, z as useLoginCredential, A as useLoginSocial, P as useLogout, B as useModel, C as useOdooDataTransform, D as useOnChangeForm, E as useParsePreview, F as useResetPassword, G as useResetPasswordSSO, H as useSave, I as useSendComment, J as useSwitchLocale, K as useUpdatePassword, L as useUploadFile, M as useUploadIdFile, N as useUploadImage, Q as useValidateActionToken } from './use-switch-locale-BFEf9mtg.mjs';
1
2
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { L as LoginCredentialBody, S as SocialTokenBody, F as ForgotPasswordBody, u as updatePasswordBody, V as ViewData, C as ContextApi, G as GetSelectionType, a as GetViewParams } from './view-type-D8ukwj_2.mjs';
3
-
4
- declare const useForgotPassword: () => _tanstack_react_query.UseMutationResult<any, Error, string, unknown>;
5
-
6
- declare const useForgotPasswordSSO: () => _tanstack_react_query.UseMutationResult<any, Error, {
7
- email: string;
8
- with_context: any;
9
- method: string;
10
- }, unknown>;
11
-
12
- type ProviderPropsType = {
13
- db: string;
14
- };
15
- declare const useGetProvider: () => _tanstack_react_query.UseMutationResult<any, Error, ProviderPropsType, unknown>;
16
-
17
- declare const useIsValidToken: () => _tanstack_react_query.UseMutationResult<any, Error, string, unknown>;
18
-
19
- declare const useLoginCredential: () => _tanstack_react_query.UseMutationResult<any, Error, LoginCredentialBody, unknown>;
20
-
21
- declare const useLoginSocial: () => _tanstack_react_query.UseMutationResult<any, Error, SocialTokenBody, unknown>;
22
-
23
- declare const useResetPassword: () => _tanstack_react_query.UseMutationResult<any, Error, ForgotPasswordBody, unknown>;
24
-
25
- declare const useResetPasswordSSO: () => _tanstack_react_query.UseMutationResult<any, Error, {
26
- method: any;
27
- password: string;
28
- with_context: any;
29
- }, unknown>;
30
-
31
- declare const useUpdatePassword: () => _tanstack_react_query.UseMutationResult<any, Error, updatePasswordBody, unknown>;
32
-
33
- declare const useLogout: () => _tanstack_react_query.UseMutationResult<any, Error, string, unknown>;
34
-
35
- declare const useGetAccessByCode: () => _tanstack_react_query.UseMutationResult<any, Error, {
36
- code: string;
37
- }, unknown>;
38
-
39
- declare const useValidateActionToken: () => _tanstack_react_query.UseMutationResult<any, Error, {
40
- actionToken: string;
41
- path: string;
42
- }, unknown>;
43
-
44
- declare const useGetCompanyInfo: () => _tanstack_react_query.UseMutationResult<any, Error, number, unknown>;
45
-
46
- declare const useGetCurrentCompany: () => _tanstack_react_query.UseMutationResult<any, Error, void, unknown>;
47
-
48
- declare const useGetListCompany: (companyIDs?: number[]) => _tanstack_react_query.UseQueryResult<any, Error>;
49
-
50
- declare const useExportExcel: () => _tanstack_react_query.UseMutationResult<any, Error, {
51
- model: string;
52
- domain: any;
53
- ids: any;
54
- fields: any;
55
- type: any;
56
- importCompat: any;
57
- context: any;
58
- groupby: any;
59
- }, unknown>;
60
-
61
- declare const useGetFieldExport: () => _tanstack_react_query.UseMutationResult<any, Error, {
62
- ids: any;
63
- model: string;
64
- isShow?: boolean;
65
- parentField?: any;
66
- fieldType?: any;
67
- parentName?: any;
68
- prefix?: any;
69
- name?: any;
70
- context: any;
71
- importCompat?: any;
72
- }, unknown>;
73
-
74
- declare const useGetFileExcel: ({ model }: {
75
- model: string;
76
- }) => _tanstack_react_query.UseQueryResult<any, Error>;
77
-
78
- declare const useParsePreview: () => _tanstack_react_query.UseMutationResult<any, Error, {
79
- id: any;
80
- selectedSheet: any;
81
- isHeader: boolean;
82
- context: any;
83
- }, unknown>;
84
-
85
- declare const useUploadFile: () => _tanstack_react_query.UseMutationResult<any, Error, {
86
- formData: any;
87
- }, unknown>;
88
-
89
- declare const useUploadIdFile: () => _tanstack_react_query.UseMutationResult<any, Error, {
90
- formData: any;
91
- }, unknown>;
92
-
93
- declare const useExecuteImport: () => _tanstack_react_query.UseMutationResult<any, Error, {
94
- fields: any;
95
- columns: any;
96
- idFile: any;
97
- options: any;
98
- dryrun: any;
99
- context: any;
100
- }, unknown>;
101
-
102
- declare const useChangeStatus: () => _tanstack_react_query.UseMutationResult<any, Error, {
103
- data: any;
104
- }, unknown>;
105
-
106
- declare const useDeleteComment: () => _tanstack_react_query.UseMutationResult<any, Error, {
107
- data: any;
108
- }, unknown>;
109
-
110
- declare const useGetComment: ({ data, queryKey }: {
111
- data: any;
112
- queryKey: any;
113
- }) => _tanstack_react_query.UseQueryResult<any, Error>;
114
-
115
- type TFormView = {
116
- model: string;
117
- id?: number | null;
118
- context?: any;
119
- };
120
- declare const useGetFormView: ({ data, queryKey, enabled, }: {
121
- data: TFormView;
122
- queryKey?: any;
123
- enabled?: any;
124
- }) => _tanstack_react_query.UseQueryResult<any, Error>;
125
-
126
- declare const useGetImage: ({ data, queryKey, src, }: {
127
- data: any;
128
- queryKey: any;
129
- src: any;
130
- }) => _tanstack_react_query.UseQueryResult<any, Error>;
131
-
132
- declare const useSendComment: () => _tanstack_react_query.UseMutationResult<any, Error, {
133
- data: any;
134
- }, unknown>;
135
-
136
- declare const useUploadImage: () => _tanstack_react_query.UseMutationResult<any, Error, {
137
- data: any;
138
- }, unknown>;
139
-
140
- declare const useDelete: () => _tanstack_react_query.UseMutationResult<any, Error, {
141
- ids: any;
142
- model: string;
143
- }, unknown>;
144
-
145
- declare const useGetAll: ({ data, queryKey, viewResponse }: any) => _tanstack_react_query.UseQueryResult<any, Error>;
146
-
147
- declare const useGetConversionRate: () => _tanstack_react_query.UseQueryResult<any, Error>;
148
-
149
- declare const useGetCurrency: () => _tanstack_react_query.UseQueryResult<any, Error>;
150
-
151
- declare const useGetDetail: () => _tanstack_react_query.UseMutationResult<any, Error, {
152
- model?: string;
153
- ids: any;
154
- specification?: any;
155
- context?: any;
156
- }, unknown>;
157
-
158
- declare const useGetFieldOnChange: ({ model }: {
159
- model: string;
160
- }) => _tanstack_react_query.UseQueryResult<any, Error>;
161
-
162
- declare const useGetListMyBankAccount: ({ domain, spectification, model, }: {
163
- domain: any;
164
- spectification: any;
165
- model: string;
166
- }) => _tanstack_react_query.UseQueryResult<any, Error>;
167
-
168
- interface BaseModelInit {
169
- name: string;
170
- view: Record<string, any>;
171
- actContext?: Record<string, any>;
172
- fields?: any;
173
- }
174
-
175
- declare class BaseModel {
176
- name: string;
177
- view: Record<string, any>;
178
- actContext?: Record<string, any>;
179
- fields?: any;
180
- constructor(init: BaseModelInit);
181
- private getSpecificationByFields;
182
- getTreeProps(): Record<string, any>;
183
- getTreeFields(): Record<string, any>[];
184
- getSpecification(): Record<string, any>;
185
- }
186
-
187
- declare const useModel: () => {
188
- initModel: (modelData: BaseModelInit) => BaseModel;
189
- };
190
-
191
- declare const useOdooDataTransform: () => {
192
- toDataJS: (data: Record<string, any>, viewData?: ViewData, model?: string) => Record<string, any>;
193
- parseORM: (data: Record<string, any>) => Record<string, any>;
194
- };
195
-
196
- declare const useOnChangeForm: () => _tanstack_react_query.UseMutationResult<any, Error, {
197
- ids: any;
198
- model: string;
199
- specification: any;
200
- context: any;
201
- object: any;
202
- fieldChange?: any;
203
- }, unknown>;
204
-
205
- declare const useSave: () => _tanstack_react_query.UseMutationResult<any, Error, {
206
- ids: any;
207
- model: string;
208
- data: any;
209
- specification?: any;
210
- context: any;
211
- path?: string;
212
- }, unknown>;
213
-
214
- declare const useGetProfile: (path?: string) => _tanstack_react_query.UseMutationResult<any, Error, void, unknown>;
215
-
216
- declare const useGetUser: () => _tanstack_react_query.UseMutationResult<any, Error, {
217
- id: any;
218
- context: ContextApi;
219
- }, unknown>;
220
-
221
- type SwitchUserLocaleParams = {
222
- data: {
223
- id: number;
224
- values: any;
225
- };
226
- };
227
- declare const useSwitchLocale: () => _tanstack_react_query.UseMutationResult<any, Error, SwitchUserLocaleParams, unknown>;
3
+ import { C as ContextApi, G as GetSelectionType } from './api-type-DfAFCfCw.mjs';
4
+ import { G as GetViewParams } from './view-type-C6Eej-Ij.mjs';
228
5
 
229
6
  declare const useButton: () => _tanstack_react_query.UseMutationResult<any, Error, {
230
7
  model: string;
@@ -361,4 +138,4 @@ declare const useVerifyTotp: () => _tanstack_react_query.UseMutationResult<any,
361
138
  code: string;
362
139
  }, unknown>;
363
140
 
364
- export { useButton, useChangeStatus, useDelete, useDeleteComment, useDuplicateRecord, useExecuteImport, useExportExcel, useForgotPassword, useForgotPasswordSSO, useGet2FAMethods, useGetAccessByCode, useGetActionDetail, useGetAll, useGetCalendar, useGetComment, useGetCompanyInfo, useGetConversionRate, useGetCurrency, useGetCurrentCompany, useGetDetail, useGetFieldExport, useGetFieldOnChange, useGetFieldsViewSecurity, useGetFileExcel, useGetFormView, useGetGroups, useGetImage, useGetListCompany, useGetListData, useGetListMyBankAccount, useGetMenu, useGetPrintReport, useGetProGressBar, useGetProfile, useGetProvider, useGetResequence, useGetSelection, useGetUser, useGetView, useGrantAccess, useIsValidToken, useLoadAction, useLoadMessage, useLoginCredential, useLoginSocial, useLogout, useModel, useOdooDataTransform, useOnChangeForm, useParsePreview, usePrint, useRemoveRow, useRemoveTotpSetup, useRequestSetupTotp, useResetPassword, useResetPasswordSSO, useRunAction, useSave, useSendComment, useSettingsWebRead2fa, useSignInSSO, useSwitchLocale, useUpdatePassword, useUploadFile, useUploadIdFile, useUploadImage, useValidateActionToken, useVerify2FA, useVerifyTotp };
141
+ export { useButton, useDuplicateRecord, useGet2FAMethods, useGetActionDetail, useGetCalendar, useGetFieldsViewSecurity, useGetGroups, useGetListData, useGetMenu, useGetPrintReport, useGetProGressBar, useGetResequence, useGetSelection, useGetView, useGrantAccess, useLoadAction, useLoadMessage, usePrint, useRemoveRow, useRemoveTotpSetup, useRequestSetupTotp, useRunAction, useSettingsWebRead2fa, useSignInSSO, useVerify2FA, useVerifyTotp };
package/dist/hooks.d.ts CHANGED
@@ -1,230 +1,7 @@
1
+ export { u as useChangeStatus, a as useDelete, b as useDeleteComment, c as useExecuteImport, d as useExportExcel, e as useForgotPassword, f as useForgotPasswordSSO, O as useGetAccessByCode, g as useGetAll, h as useGetComment, i as useGetCompanyInfo, j as useGetConversionRate, k as useGetCurrency, l as useGetCurrentCompany, m as useGetDetail, n as useGetFieldExport, o as useGetFieldOnChange, p as useGetFileExcel, q as useGetFormView, r as useGetImage, s as useGetListCompany, t as useGetListMyBankAccount, v as useGetProfile, w as useGetProvider, x as useGetUser, y as useIsValidToken, z as useLoginCredential, A as useLoginSocial, P as useLogout, B as useModel, C as useOdooDataTransform, D as useOnChangeForm, E as useParsePreview, F as useResetPassword, G as useResetPasswordSSO, H as useSave, I as useSendComment, J as useSwitchLocale, K as useUpdatePassword, L as useUploadFile, M as useUploadIdFile, N as useUploadImage, Q as useValidateActionToken } from './use-switch-locale-y3Oki_i5.js';
1
2
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { L as LoginCredentialBody, S as SocialTokenBody, F as ForgotPasswordBody, u as updatePasswordBody, V as ViewData, C as ContextApi, G as GetSelectionType, a as GetViewParams } from './view-type-D8ukwj_2.js';
3
-
4
- declare const useForgotPassword: () => _tanstack_react_query.UseMutationResult<any, Error, string, unknown>;
5
-
6
- declare const useForgotPasswordSSO: () => _tanstack_react_query.UseMutationResult<any, Error, {
7
- email: string;
8
- with_context: any;
9
- method: string;
10
- }, unknown>;
11
-
12
- type ProviderPropsType = {
13
- db: string;
14
- };
15
- declare const useGetProvider: () => _tanstack_react_query.UseMutationResult<any, Error, ProviderPropsType, unknown>;
16
-
17
- declare const useIsValidToken: () => _tanstack_react_query.UseMutationResult<any, Error, string, unknown>;
18
-
19
- declare const useLoginCredential: () => _tanstack_react_query.UseMutationResult<any, Error, LoginCredentialBody, unknown>;
20
-
21
- declare const useLoginSocial: () => _tanstack_react_query.UseMutationResult<any, Error, SocialTokenBody, unknown>;
22
-
23
- declare const useResetPassword: () => _tanstack_react_query.UseMutationResult<any, Error, ForgotPasswordBody, unknown>;
24
-
25
- declare const useResetPasswordSSO: () => _tanstack_react_query.UseMutationResult<any, Error, {
26
- method: any;
27
- password: string;
28
- with_context: any;
29
- }, unknown>;
30
-
31
- declare const useUpdatePassword: () => _tanstack_react_query.UseMutationResult<any, Error, updatePasswordBody, unknown>;
32
-
33
- declare const useLogout: () => _tanstack_react_query.UseMutationResult<any, Error, string, unknown>;
34
-
35
- declare const useGetAccessByCode: () => _tanstack_react_query.UseMutationResult<any, Error, {
36
- code: string;
37
- }, unknown>;
38
-
39
- declare const useValidateActionToken: () => _tanstack_react_query.UseMutationResult<any, Error, {
40
- actionToken: string;
41
- path: string;
42
- }, unknown>;
43
-
44
- declare const useGetCompanyInfo: () => _tanstack_react_query.UseMutationResult<any, Error, number, unknown>;
45
-
46
- declare const useGetCurrentCompany: () => _tanstack_react_query.UseMutationResult<any, Error, void, unknown>;
47
-
48
- declare const useGetListCompany: (companyIDs?: number[]) => _tanstack_react_query.UseQueryResult<any, Error>;
49
-
50
- declare const useExportExcel: () => _tanstack_react_query.UseMutationResult<any, Error, {
51
- model: string;
52
- domain: any;
53
- ids: any;
54
- fields: any;
55
- type: any;
56
- importCompat: any;
57
- context: any;
58
- groupby: any;
59
- }, unknown>;
60
-
61
- declare const useGetFieldExport: () => _tanstack_react_query.UseMutationResult<any, Error, {
62
- ids: any;
63
- model: string;
64
- isShow?: boolean;
65
- parentField?: any;
66
- fieldType?: any;
67
- parentName?: any;
68
- prefix?: any;
69
- name?: any;
70
- context: any;
71
- importCompat?: any;
72
- }, unknown>;
73
-
74
- declare const useGetFileExcel: ({ model }: {
75
- model: string;
76
- }) => _tanstack_react_query.UseQueryResult<any, Error>;
77
-
78
- declare const useParsePreview: () => _tanstack_react_query.UseMutationResult<any, Error, {
79
- id: any;
80
- selectedSheet: any;
81
- isHeader: boolean;
82
- context: any;
83
- }, unknown>;
84
-
85
- declare const useUploadFile: () => _tanstack_react_query.UseMutationResult<any, Error, {
86
- formData: any;
87
- }, unknown>;
88
-
89
- declare const useUploadIdFile: () => _tanstack_react_query.UseMutationResult<any, Error, {
90
- formData: any;
91
- }, unknown>;
92
-
93
- declare const useExecuteImport: () => _tanstack_react_query.UseMutationResult<any, Error, {
94
- fields: any;
95
- columns: any;
96
- idFile: any;
97
- options: any;
98
- dryrun: any;
99
- context: any;
100
- }, unknown>;
101
-
102
- declare const useChangeStatus: () => _tanstack_react_query.UseMutationResult<any, Error, {
103
- data: any;
104
- }, unknown>;
105
-
106
- declare const useDeleteComment: () => _tanstack_react_query.UseMutationResult<any, Error, {
107
- data: any;
108
- }, unknown>;
109
-
110
- declare const useGetComment: ({ data, queryKey }: {
111
- data: any;
112
- queryKey: any;
113
- }) => _tanstack_react_query.UseQueryResult<any, Error>;
114
-
115
- type TFormView = {
116
- model: string;
117
- id?: number | null;
118
- context?: any;
119
- };
120
- declare const useGetFormView: ({ data, queryKey, enabled, }: {
121
- data: TFormView;
122
- queryKey?: any;
123
- enabled?: any;
124
- }) => _tanstack_react_query.UseQueryResult<any, Error>;
125
-
126
- declare const useGetImage: ({ data, queryKey, src, }: {
127
- data: any;
128
- queryKey: any;
129
- src: any;
130
- }) => _tanstack_react_query.UseQueryResult<any, Error>;
131
-
132
- declare const useSendComment: () => _tanstack_react_query.UseMutationResult<any, Error, {
133
- data: any;
134
- }, unknown>;
135
-
136
- declare const useUploadImage: () => _tanstack_react_query.UseMutationResult<any, Error, {
137
- data: any;
138
- }, unknown>;
139
-
140
- declare const useDelete: () => _tanstack_react_query.UseMutationResult<any, Error, {
141
- ids: any;
142
- model: string;
143
- }, unknown>;
144
-
145
- declare const useGetAll: ({ data, queryKey, viewResponse }: any) => _tanstack_react_query.UseQueryResult<any, Error>;
146
-
147
- declare const useGetConversionRate: () => _tanstack_react_query.UseQueryResult<any, Error>;
148
-
149
- declare const useGetCurrency: () => _tanstack_react_query.UseQueryResult<any, Error>;
150
-
151
- declare const useGetDetail: () => _tanstack_react_query.UseMutationResult<any, Error, {
152
- model?: string;
153
- ids: any;
154
- specification?: any;
155
- context?: any;
156
- }, unknown>;
157
-
158
- declare const useGetFieldOnChange: ({ model }: {
159
- model: string;
160
- }) => _tanstack_react_query.UseQueryResult<any, Error>;
161
-
162
- declare const useGetListMyBankAccount: ({ domain, spectification, model, }: {
163
- domain: any;
164
- spectification: any;
165
- model: string;
166
- }) => _tanstack_react_query.UseQueryResult<any, Error>;
167
-
168
- interface BaseModelInit {
169
- name: string;
170
- view: Record<string, any>;
171
- actContext?: Record<string, any>;
172
- fields?: any;
173
- }
174
-
175
- declare class BaseModel {
176
- name: string;
177
- view: Record<string, any>;
178
- actContext?: Record<string, any>;
179
- fields?: any;
180
- constructor(init: BaseModelInit);
181
- private getSpecificationByFields;
182
- getTreeProps(): Record<string, any>;
183
- getTreeFields(): Record<string, any>[];
184
- getSpecification(): Record<string, any>;
185
- }
186
-
187
- declare const useModel: () => {
188
- initModel: (modelData: BaseModelInit) => BaseModel;
189
- };
190
-
191
- declare const useOdooDataTransform: () => {
192
- toDataJS: (data: Record<string, any>, viewData?: ViewData, model?: string) => Record<string, any>;
193
- parseORM: (data: Record<string, any>) => Record<string, any>;
194
- };
195
-
196
- declare const useOnChangeForm: () => _tanstack_react_query.UseMutationResult<any, Error, {
197
- ids: any;
198
- model: string;
199
- specification: any;
200
- context: any;
201
- object: any;
202
- fieldChange?: any;
203
- }, unknown>;
204
-
205
- declare const useSave: () => _tanstack_react_query.UseMutationResult<any, Error, {
206
- ids: any;
207
- model: string;
208
- data: any;
209
- specification?: any;
210
- context: any;
211
- path?: string;
212
- }, unknown>;
213
-
214
- declare const useGetProfile: (path?: string) => _tanstack_react_query.UseMutationResult<any, Error, void, unknown>;
215
-
216
- declare const useGetUser: () => _tanstack_react_query.UseMutationResult<any, Error, {
217
- id: any;
218
- context: ContextApi;
219
- }, unknown>;
220
-
221
- type SwitchUserLocaleParams = {
222
- data: {
223
- id: number;
224
- values: any;
225
- };
226
- };
227
- declare const useSwitchLocale: () => _tanstack_react_query.UseMutationResult<any, Error, SwitchUserLocaleParams, unknown>;
3
+ import { C as ContextApi, G as GetSelectionType } from './api-type-DfAFCfCw.js';
4
+ import { G as GetViewParams } from './view-type-C6Eej-Ij.js';
228
5
 
229
6
  declare const useButton: () => _tanstack_react_query.UseMutationResult<any, Error, {
230
7
  model: string;
@@ -361,4 +138,4 @@ declare const useVerifyTotp: () => _tanstack_react_query.UseMutationResult<any,
361
138
  code: string;
362
139
  }, unknown>;
363
140
 
364
- export { useButton, useChangeStatus, useDelete, useDeleteComment, useDuplicateRecord, useExecuteImport, useExportExcel, useForgotPassword, useForgotPasswordSSO, useGet2FAMethods, useGetAccessByCode, useGetActionDetail, useGetAll, useGetCalendar, useGetComment, useGetCompanyInfo, useGetConversionRate, useGetCurrency, useGetCurrentCompany, useGetDetail, useGetFieldExport, useGetFieldOnChange, useGetFieldsViewSecurity, useGetFileExcel, useGetFormView, useGetGroups, useGetImage, useGetListCompany, useGetListData, useGetListMyBankAccount, useGetMenu, useGetPrintReport, useGetProGressBar, useGetProfile, useGetProvider, useGetResequence, useGetSelection, useGetUser, useGetView, useGrantAccess, useIsValidToken, useLoadAction, useLoadMessage, useLoginCredential, useLoginSocial, useLogout, useModel, useOdooDataTransform, useOnChangeForm, useParsePreview, usePrint, useRemoveRow, useRemoveTotpSetup, useRequestSetupTotp, useResetPassword, useResetPasswordSSO, useRunAction, useSave, useSendComment, useSettingsWebRead2fa, useSignInSSO, useSwitchLocale, useUpdatePassword, useUploadFile, useUploadIdFile, useUploadImage, useValidateActionToken, useVerify2FA, useVerifyTotp };
141
+ export { useButton, useDuplicateRecord, useGet2FAMethods, useGetActionDetail, useGetCalendar, useGetFieldsViewSecurity, useGetGroups, useGetListData, useGetMenu, useGetPrintReport, useGetProGressBar, useGetResequence, useGetSelection, useGetView, useGrantAccess, useLoadAction, useLoadMessage, usePrint, useRemoveRow, useRemoveTotpSetup, useRequestSetupTotp, useRunAction, useSettingsWebRead2fa, useSignInSSO, useVerify2FA, useVerifyTotp };
package/dist/hooks.js CHANGED
@@ -4225,7 +4225,7 @@ var use_isvalid_token_default = useIsValidToken;
4225
4225
  var import_react_query7 = require("@tanstack/react-query");
4226
4226
 
4227
4227
  // src/services/auth-service/backup.ts
4228
- var import_react5 = require("react");
4228
+ var import_react6 = require("react");
4229
4229
 
4230
4230
  // src/provider/react-query-provider.tsx
4231
4231
  var import_react_query5 = require("@tanstack/react-query");
@@ -4869,40 +4869,24 @@ var import_jsx_runtime4 = require("react/jsx-runtime");
4869
4869
  // src/provider/env-provider.tsx
4870
4870
  var import_react4 = require("react");
4871
4871
  var import_jsx_runtime5 = require("react/jsx-runtime");
4872
- var initialEnvState = {
4873
- env: null,
4874
- baseUrl: "",
4875
- requests: null,
4876
- companies: [],
4877
- user: {},
4878
- config: null,
4879
- envFile: null,
4880
- defaultCompany: {
4881
- id: null,
4882
- logo: "",
4883
- secondary_color: "",
4884
- primary_color: ""
4885
- },
4886
- context: {
4887
- uid: null,
4888
- allowed_company_ids: [],
4889
- lang: "vi_VN",
4890
- tz: "Asia/Saigon"
4891
- }
4892
- };
4893
4872
  var EnvContext = (0, import_react4.createContext)(null);
4894
4873
  function useEnv() {
4895
4874
  const context = (0, import_react4.useContext)(EnvContext);
4896
4875
  if (!context) {
4897
- return initialEnvState;
4876
+ throw new Error("useEnv must be used within an EnvProvider");
4898
4877
  }
4899
4878
  return context;
4900
4879
  }
4901
4880
 
4881
+ // src/provider/service-provider.tsx
4882
+ var import_react5 = require("react");
4883
+ var import_jsx_runtime6 = require("react/jsx-runtime");
4884
+ var ServiceContext = (0, import_react5.createContext)(null);
4885
+
4902
4886
  // src/services/auth-service/backup.ts
4903
4887
  function useAuthService() {
4904
4888
  const { env: env2 } = useEnv();
4905
- const login = (0, import_react5.useCallback)(
4889
+ const login = (0, import_react6.useCallback)(
4906
4890
  async (body) => {
4907
4891
  const payload = Object.fromEntries(
4908
4892
  Object.entries({
@@ -4922,7 +4906,7 @@ function useAuthService() {
4922
4906
  },
4923
4907
  [env2]
4924
4908
  );
4925
- const forgotPassword = (0, import_react5.useCallback)(
4909
+ const forgotPassword = (0, import_react6.useCallback)(
4926
4910
  async (email) => {
4927
4911
  const bodyData = {
4928
4912
  login: email,
@@ -4936,7 +4920,7 @@ function useAuthService() {
4936
4920
  },
4937
4921
  [env2]
4938
4922
  );
4939
- const forgotPasswordSSO = (0, import_react5.useCallback)(
4923
+ const forgotPasswordSSO = (0, import_react6.useCallback)(
4940
4924
  async ({
4941
4925
  email,
4942
4926
  with_context,
@@ -4959,7 +4943,7 @@ function useAuthService() {
4959
4943
  },
4960
4944
  [env2]
4961
4945
  );
4962
- const resetPassword = (0, import_react5.useCallback)(
4946
+ const resetPassword = (0, import_react6.useCallback)(
4963
4947
  async (data, token) => {
4964
4948
  const bodyData = {
4965
4949
  token,
@@ -4974,7 +4958,7 @@ function useAuthService() {
4974
4958
  },
4975
4959
  [env2]
4976
4960
  );
4977
- const resetPasswordSSO = (0, import_react5.useCallback)(
4961
+ const resetPasswordSSO = (0, import_react6.useCallback)(
4978
4962
  async ({
4979
4963
  method,
4980
4964
  password,
@@ -4997,7 +4981,7 @@ function useAuthService() {
4997
4981
  },
4998
4982
  [env2]
4999
4983
  );
5000
- const updatePassword = (0, import_react5.useCallback)(
4984
+ const updatePassword = (0, import_react6.useCallback)(
5001
4985
  async (data, token) => {
5002
4986
  const bodyData = {
5003
4987
  token,
@@ -5012,7 +4996,7 @@ function useAuthService() {
5012
4996
  },
5013
4997
  [env2]
5014
4998
  );
5015
- const isValidToken = (0, import_react5.useCallback)(
4999
+ const isValidToken = (0, import_react6.useCallback)(
5016
5000
  async (token) => {
5017
5001
  const bodyData = {
5018
5002
  token
@@ -5025,7 +5009,7 @@ function useAuthService() {
5025
5009
  },
5026
5010
  [env2]
5027
5011
  );
5028
- const isValidActionToken = (0, import_react5.useCallback)(
5012
+ const isValidActionToken = (0, import_react6.useCallback)(
5029
5013
  async (actionToken, path) => {
5030
5014
  return env2?.requests?.post(
5031
5015
  path,
@@ -5041,7 +5025,7 @@ function useAuthService() {
5041
5025
  },
5042
5026
  [env2]
5043
5027
  );
5044
- const loginSocial = (0, import_react5.useCallback)(
5028
+ const loginSocial = (0, import_react6.useCallback)(
5045
5029
  async ({
5046
5030
  db,
5047
5031
  state,
@@ -5059,13 +5043,13 @@ function useAuthService() {
5059
5043
  },
5060
5044
  [env2]
5061
5045
  );
5062
- const getProviders = (0, import_react5.useCallback)(
5046
+ const getProviders = (0, import_react6.useCallback)(
5063
5047
  async (db) => {
5064
5048
  return env2?.requests?.get("/oauth/providers", { params: { db } });
5065
5049
  },
5066
5050
  [env2]
5067
5051
  );
5068
- const getAccessByCode = (0, import_react5.useCallback)(
5052
+ const getAccessByCode = (0, import_react6.useCallback)(
5069
5053
  async (code) => {
5070
5054
  const data = new URLSearchParams();
5071
5055
  data.append("code", code);
@@ -5084,7 +5068,7 @@ function useAuthService() {
5084
5068
  },
5085
5069
  [env2]
5086
5070
  );
5087
- const logout = (0, import_react5.useCallback)(
5071
+ const logout = (0, import_react6.useCallback)(
5088
5072
  async (data) => {
5089
5073
  console.log(data);
5090
5074
  return env2?.requests?.post(