@service_laboratory/auth 2.0.24 → 2.0.26
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/index.d.ts +202 -15
- package/dist/index.js +3255 -2694
- package/dist/index.umd.cjs +17 -17
- package/package.json +40 -40
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,10 @@ import { Axios } from 'axios';
|
|
|
2
2
|
import { AxiosResponse } from 'axios';
|
|
3
3
|
import { Derived } from '@tanstack/store';
|
|
4
4
|
import { JSX } from 'react/jsx-runtime';
|
|
5
|
+
import { JSXElementConstructor } from 'react';
|
|
6
|
+
import { ReactElement } from 'react';
|
|
5
7
|
import { ReactNode } from 'react';
|
|
8
|
+
import { ReactPortal } from 'react';
|
|
6
9
|
import { Store } from '@tanstack/store';
|
|
7
10
|
|
|
8
11
|
declare interface AccountData {
|
|
@@ -20,20 +23,6 @@ export declare interface AccountUser {
|
|
|
20
23
|
is_email_verified: boolean;
|
|
21
24
|
}
|
|
22
25
|
|
|
23
|
-
export declare function ActivateAccountForm(props: ActivateAccountFormProps): JSX.Element;
|
|
24
|
-
|
|
25
|
-
declare interface ActivateAccountFormProps {
|
|
26
|
-
submit: ({ code }: {
|
|
27
|
-
code: string;
|
|
28
|
-
}) => void;
|
|
29
|
-
activateAccountTitle: string;
|
|
30
|
-
codeLabel: string;
|
|
31
|
-
activateAccountDescription: string;
|
|
32
|
-
submitButtonLabel: string;
|
|
33
|
-
form: any;
|
|
34
|
-
loginLinkComponent?: () => ReactNode;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
26
|
declare interface ActivateRequest {
|
|
38
27
|
code: string;
|
|
39
28
|
}
|
|
@@ -46,7 +35,7 @@ export declare class Auth {
|
|
|
46
35
|
load(): Promise<void>;
|
|
47
36
|
login(values: LoginRequest): Promise<any>;
|
|
48
37
|
signup(values: RegisterRequest): Promise<AxiosResponse<any, any, {}>>;
|
|
49
|
-
|
|
38
|
+
verifyEmail(values: ActivateRequest): Promise<void>;
|
|
50
39
|
logout(): void;
|
|
51
40
|
startResetPassword(values: StartResetPasswordRequest): Promise<AxiosResponse<any, any, {}>>;
|
|
52
41
|
resetPassword(values: ResetPasswordRequest): Promise<void>;
|
|
@@ -64,11 +53,195 @@ export declare const authE2EConfig: {
|
|
|
64
53
|
emailInput: string;
|
|
65
54
|
passwordInput: string;
|
|
66
55
|
submitButton: string;
|
|
56
|
+
signUpFormLink: string;
|
|
57
|
+
};
|
|
58
|
+
signupForm: {
|
|
59
|
+
emailInput: string;
|
|
60
|
+
passwordInput: string;
|
|
61
|
+
submitButton: string;
|
|
62
|
+
};
|
|
63
|
+
verifyEmailForm: {
|
|
64
|
+
authCodeInput: string;
|
|
65
|
+
submitButton: string;
|
|
67
66
|
};
|
|
68
67
|
};
|
|
69
68
|
|
|
69
|
+
export declare const AuthWrapper: ({ auth, children, }: {
|
|
70
|
+
auth: Auth;
|
|
71
|
+
children: ReactNode;
|
|
72
|
+
}) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | ReactPortal | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | JSX.Element | null | undefined;
|
|
73
|
+
|
|
70
74
|
export declare const isAdmin: Derived<boolean, readonly [Store<AccountData, (cb: AccountData) => AccountData>]>;
|
|
71
75
|
|
|
76
|
+
export declare const locale: {
|
|
77
|
+
notificationsErrorsMap: {
|
|
78
|
+
"User is not enabled": string;
|
|
79
|
+
"Email not verified": string;
|
|
80
|
+
"Email not found": string;
|
|
81
|
+
"Invalid password": string;
|
|
82
|
+
"Email is already used": string;
|
|
83
|
+
"Wrong verification code": string;
|
|
84
|
+
};
|
|
85
|
+
fieldsErrorsMap: {
|
|
86
|
+
"User is not enabled": string;
|
|
87
|
+
"Email not verified": string;
|
|
88
|
+
"Email not found": string;
|
|
89
|
+
"Invalid password": string;
|
|
90
|
+
"Email is already used": string;
|
|
91
|
+
};
|
|
92
|
+
ru: {
|
|
93
|
+
verifyEmailForm: {
|
|
94
|
+
form: {
|
|
95
|
+
title: string;
|
|
96
|
+
submitButtonLabel: string;
|
|
97
|
+
codeLabel: string;
|
|
98
|
+
verifyEmailDescription: string;
|
|
99
|
+
loginLinkMessage: string;
|
|
100
|
+
loginLink: string;
|
|
101
|
+
};
|
|
102
|
+
success: {
|
|
103
|
+
notifications: {
|
|
104
|
+
verifyEmailSuccess: string;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
errors: {
|
|
108
|
+
notifications: {
|
|
109
|
+
wrongAuthCode: string;
|
|
110
|
+
unknownError: string;
|
|
111
|
+
unknownErrorDescription: string;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
loginForm: {
|
|
116
|
+
form: {
|
|
117
|
+
title: string;
|
|
118
|
+
description: string;
|
|
119
|
+
emailLabel: string;
|
|
120
|
+
passwordLabel: string;
|
|
121
|
+
forgotPasswordMessage: string;
|
|
122
|
+
submitButtonLabel: string;
|
|
123
|
+
dontHaveAccountMessage: string;
|
|
124
|
+
dontHaveAccountLink: string;
|
|
125
|
+
};
|
|
126
|
+
errors: {
|
|
127
|
+
notifications: {
|
|
128
|
+
emailNotFound: string;
|
|
129
|
+
userIsNotEnabled: string;
|
|
130
|
+
emailNotVerified: string;
|
|
131
|
+
invalidPassword: string;
|
|
132
|
+
unknownError: string;
|
|
133
|
+
unknownErrorDescription: string;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
success: {
|
|
137
|
+
notifications: {
|
|
138
|
+
loginSuccess: string;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
signUpForm: {
|
|
143
|
+
form: {
|
|
144
|
+
title: string;
|
|
145
|
+
description: string;
|
|
146
|
+
emailLabel: string;
|
|
147
|
+
passwordLabel: string;
|
|
148
|
+
submitButtonLabel: string;
|
|
149
|
+
forgotPasswordMessage: string;
|
|
150
|
+
loginLinkMessage: string;
|
|
151
|
+
loginLink: string;
|
|
152
|
+
};
|
|
153
|
+
errors: {
|
|
154
|
+
notifications: {
|
|
155
|
+
unknownError: string;
|
|
156
|
+
unknownErrorDescription: string;
|
|
157
|
+
emailAlreadyExists: string;
|
|
158
|
+
};
|
|
159
|
+
fields: {
|
|
160
|
+
passwordToSmall: string;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
success: {
|
|
164
|
+
notifications: {
|
|
165
|
+
signUpSuccess: string;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
en: {
|
|
171
|
+
verifyEmailForm: {
|
|
172
|
+
form: {
|
|
173
|
+
title: string;
|
|
174
|
+
submitButtonLabel: string;
|
|
175
|
+
codeLabel: string;
|
|
176
|
+
verifyEmailDescription: string;
|
|
177
|
+
loginLinkMessage: string;
|
|
178
|
+
loginLink: string;
|
|
179
|
+
};
|
|
180
|
+
success: {
|
|
181
|
+
notifications: {
|
|
182
|
+
verifyEmailSuccess: string;
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
errors: {
|
|
186
|
+
notifications: {
|
|
187
|
+
wrongAuthCode: string;
|
|
188
|
+
unknownError: string;
|
|
189
|
+
unknownErrorDescription: string;
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
loginForm: {
|
|
194
|
+
form: {
|
|
195
|
+
title: string;
|
|
196
|
+
description: string;
|
|
197
|
+
emailLabel: string;
|
|
198
|
+
passwordLabel: string;
|
|
199
|
+
forgotPasswordMessage: string;
|
|
200
|
+
submitButtonLabel: string;
|
|
201
|
+
dontHaveAccountMessage: string;
|
|
202
|
+
dontHaveAccountLink: string;
|
|
203
|
+
};
|
|
204
|
+
errors: {
|
|
205
|
+
notifications: {
|
|
206
|
+
emailNotFound: string;
|
|
207
|
+
userIsNotEnabled: string;
|
|
208
|
+
emailNotVerified: string;
|
|
209
|
+
invalidPassword: string;
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
success: {
|
|
213
|
+
notifications: {
|
|
214
|
+
loginSuccess: string;
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
signUpForm: {
|
|
219
|
+
form: {
|
|
220
|
+
title: string;
|
|
221
|
+
description: string;
|
|
222
|
+
emailLabel: string;
|
|
223
|
+
passwordLabel: string;
|
|
224
|
+
submitButtonLabel: string;
|
|
225
|
+
forgotPasswordMessage: string;
|
|
226
|
+
loginLinkMessage: string;
|
|
227
|
+
loginLink: string;
|
|
228
|
+
};
|
|
229
|
+
errors: {
|
|
230
|
+
notifications: {
|
|
231
|
+
unknownError: string;
|
|
232
|
+
unknownErrorDescription: string;
|
|
233
|
+
emailAlreadyExists: string;
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
success: {
|
|
237
|
+
notifications: {
|
|
238
|
+
signUpSuccess: string;
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
|
|
72
245
|
export declare function LoginForm(props: LoginFormProps): JSX.Element;
|
|
73
246
|
|
|
74
247
|
declare interface LoginFormProps {
|
|
@@ -134,4 +307,18 @@ declare interface StartResetPasswordRequest {
|
|
|
134
307
|
email: string;
|
|
135
308
|
}
|
|
136
309
|
|
|
310
|
+
export declare function VerifyEmailForm(props: VerifyEmailFormProps): JSX.Element;
|
|
311
|
+
|
|
312
|
+
declare interface VerifyEmailFormProps {
|
|
313
|
+
submit: ({ code }: {
|
|
314
|
+
code: string;
|
|
315
|
+
}) => void;
|
|
316
|
+
verifyEmailTitle: string;
|
|
317
|
+
codeLabel: string;
|
|
318
|
+
verifyEmailDescription: string;
|
|
319
|
+
submitButtonLabel: string;
|
|
320
|
+
form: any;
|
|
321
|
+
loginLinkComponent?: () => ReactNode;
|
|
322
|
+
}
|
|
323
|
+
|
|
137
324
|
export { }
|