@service_laboratory/auth 4.0.3 → 4.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,11 +1,9 @@
1
1
  import { Axios } from 'axios';
2
2
  import { AxiosResponse } from 'axios';
3
+ import { Context } from 'react';
3
4
  import { Derived } from '@tanstack/store';
4
5
  import { JSX } from 'react/jsx-runtime';
5
- import { JSXElementConstructor } from 'react';
6
- import { ReactElement } from 'react';
7
6
  import { ReactNode } from 'react';
8
- import { ReactPortal } from 'react';
9
7
  import { Store } from '@tanstack/store';
10
8
  import { UseFormReturn } from 'react-hook-form';
11
9
  import * as z from 'zod';
@@ -50,6 +48,15 @@ export declare class Auth {
50
48
  _clearAuthData: () => void;
51
49
  }
52
50
 
51
+ export declare const AuthContext: Context< {
52
+ auth: Auth | null;
53
+ }>;
54
+
55
+ export declare const AuthContextProvider: ({ auth, children }: {
56
+ auth: Auth;
57
+ children: ReactNode;
58
+ }) => JSX.Element | null;
59
+
53
60
  export declare const authE2EConfig: {
54
61
  loginForm: {
55
62
  emailInput: string;
@@ -78,11 +85,6 @@ export declare const authE2EConfig: {
78
85
  };
79
86
  };
80
87
 
81
- export declare const AuthWrapper: ({ auth, children, }: {
82
- auth: Auth;
83
- children: ReactNode;
84
- }) => 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;
85
-
86
88
  declare interface ConfirmPasswordFormProps {
87
89
  submit: ({ code, password }: {
88
90
  code: string;
@@ -99,7 +101,7 @@ declare interface ConfirmResetPasswordRequest {
99
101
  password: string;
100
102
  }
101
103
 
102
- export declare const DevPanel: ({ reset, processing, }: {
104
+ export declare const DevPanel: ({ reset, processing }: {
103
105
  reset: () => void;
104
106
  processing: boolean;
105
107
  }) => JSX.Element;
@@ -252,6 +254,56 @@ export declare const locale: {
252
254
  };
253
255
  };
254
256
  en: {
257
+ confirmResetPasswordForm: {
258
+ form: {
259
+ title: string;
260
+ description: string;
261
+ submitButtonLabel: string;
262
+ passwordInputLabel: string;
263
+ authCodeInputLabel: string;
264
+ confirmPasswordLabel: string;
265
+ loginLinkMessage: string;
266
+ loginLink: string;
267
+ };
268
+ success: {
269
+ notifications: {
270
+ confirmResetPasswordSuccess: string;
271
+ };
272
+ };
273
+ errors: {
274
+ fields: {
275
+ passwordToSmall: string;
276
+ };
277
+ notifications: {
278
+ wrongAuthCode: string;
279
+ unknownError: string;
280
+ unknownErrorDescription: string;
281
+ };
282
+ };
283
+ };
284
+ startResetPasswordForm: {
285
+ form: {
286
+ title: string;
287
+ description: string;
288
+ submitButtonLabel: string;
289
+ emailLabel: string;
290
+ resetPasswordDescription: string;
291
+ loginLinkMessage: string;
292
+ loginLink: string;
293
+ };
294
+ success: {
295
+ notifications: {
296
+ startResetPasswordSuccess: string;
297
+ };
298
+ };
299
+ errors: {
300
+ notifications: {
301
+ emailNotFound: string;
302
+ unknownError: string;
303
+ unknownErrorDescription: string;
304
+ };
305
+ };
306
+ };
255
307
  verifyEmailForm: {
256
308
  form: {
257
309
  title: string;
@@ -291,6 +343,8 @@ export declare const locale: {
291
343
  userIsNotEnabled: string;
292
344
  emailNotVerified: string;
293
345
  invalidPassword: string;
346
+ unknownError: string;
347
+ unknownErrorDescription: string;
294
348
  };
295
349
  };
296
350
  success: {
@@ -333,10 +387,7 @@ declare interface LoginFormProps {
333
387
  email: string;
334
388
  password: string;
335
389
  }) => void;
336
- i18n: any;
337
390
  form: any;
338
- resetPasswordLinkComponent?: () => ReactNode;
339
- signUpLinkComponent?: () => ReactNode;
340
391
  }
341
392
 
342
393
  declare interface LoginRequest {
@@ -415,7 +466,7 @@ export declare const useLoginForm: ({ auth, i18n }: {
415
466
  submit: (values: {
416
467
  email: string;
417
468
  password: string;
418
- }) => void;
469
+ }) => Promise<void>;
419
470
  };
420
471
 
421
472
  export declare const useSignUpForm: ({ auth, i18n }: {