mailsentry-auth 0.2.3 → 0.2.5

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.mts CHANGED
@@ -358,7 +358,7 @@ declare class CrossTabBehaviorHandler {
358
358
  * Get the action configuration for current route and event
359
359
  */
360
360
  static getAction(currentPageType: PageType, eventType: AuthEventType): {
361
- readonly action: NavigationAction.NONE;
361
+ readonly action: NavigationAction.RELOAD;
362
362
  } | {
363
363
  readonly action: NavigationAction.NONE;
364
364
  } | {
@@ -370,7 +370,7 @@ declare class CrossTabBehaviorHandler {
370
370
  } | {
371
371
  readonly action: NavigationAction.RELOAD;
372
372
  } | {
373
- readonly action: NavigationAction.RELOAD;
373
+ readonly action: NavigationAction.NONE;
374
374
  } | {
375
375
  readonly action: NavigationAction.NONE;
376
376
  } | {
@@ -555,6 +555,14 @@ declare class AuthService extends BaseService implements IAuthService {
555
555
  * Logout user
556
556
  */
557
557
  logout(): Promise<void>;
558
+ /**
559
+ * Send forgot password email
560
+ */
561
+ forgotPassword(email: string): Promise<void>;
562
+ /**
563
+ * Resend verification code
564
+ */
565
+ resendVerification(email: string): Promise<void>;
558
566
  }
559
567
 
560
568
  /**
@@ -568,6 +576,8 @@ declare const AUTH_ENDPOINTS: {
568
576
  readonly GET_USER_PROFILE: "/auth/user/profile";
569
577
  readonly GET_ME: "/auth/user/me";
570
578
  readonly LOGOUT: "/auth/logout";
579
+ readonly FORGOT_PASSWORD: "/auth/user/forget-password";
580
+ readonly RESEND_VERIFICATION: "/auth/user/generate-verification";
571
581
  };
572
582
  /**
573
583
  * Endpoint builder utility
@@ -581,6 +591,8 @@ declare class EndpointBuilder {
581
591
  readonly GET_USER_PROFILE: "/auth/user/profile";
582
592
  readonly GET_ME: "/auth/user/me";
583
593
  readonly LOGOUT: "/auth/logout";
594
+ readonly FORGOT_PASSWORD: "/auth/user/forget-password";
595
+ readonly RESEND_VERIFICATION: "/auth/user/generate-verification";
584
596
  };
585
597
  }
586
598
 
@@ -769,12 +781,11 @@ declare class LoggerFactory {
769
781
  */
770
782
  declare class AuthOrchestrator implements IAuthOrchestrator {
771
783
  private authService;
772
- private eventBus;
773
784
  private tokenManager;
774
785
  private userStorageManager;
775
786
  private errorHandler;
776
787
  private logger;
777
- constructor(authService: AuthService, eventBus: EventBus<AuthEvent>, tokenManager?: ITokenManager);
788
+ constructor(authService: AuthService, tokenManager?: ITokenManager);
778
789
  /**
779
790
  * Setup Chain of Responsibility for error handling
780
791
  */
@@ -830,6 +841,14 @@ declare class AuthOrchestrator implements IAuthOrchestrator {
830
841
  * Get detailed token information
831
842
  */
832
843
  getTokenInfo(): Promise<AuthActionResult>;
844
+ /**
845
+ * Handle forgot password flow
846
+ */
847
+ handleForgotPassword(email: string): Promise<AuthActionResult>;
848
+ /**
849
+ * Handle resend verification code
850
+ */
851
+ handleResendVerification(email: string): Promise<AuthActionResult>;
833
852
  }
834
853
  /**
835
854
  * Authentication Orchestrator Factory
@@ -843,7 +862,7 @@ declare class AuthOrchestratorFactory {
843
862
  /**
844
863
  * Create AuthOrchestrator with custom dependencies
845
864
  */
846
- static createWithDependencies(authService: AuthService, eventBus: EventBus<AuthEvent>, tokenManager?: ITokenManager): AuthOrchestrator;
865
+ static createWithDependencies(authService: AuthService, tokenManager?: ITokenManager): AuthOrchestrator;
847
866
  }
848
867
 
849
868
  /**
@@ -987,9 +1006,8 @@ interface PasswordStepProps extends BaseStepProps {
987
1006
  interface VerificationStepProps extends BaseStepProps {
988
1007
  email: string;
989
1008
  onSubmit: (verificationCode: string) => void | Promise<void>;
990
- onResendCode?: () => void;
1009
+ onResendCode?: () => void | Promise<void>;
991
1010
  codeLength?: number;
992
- showResendButton?: boolean;
993
1011
  }
994
1012
 
995
1013
  interface ForgotPasswordStepProps extends BaseStepProps {
@@ -1255,7 +1273,7 @@ declare const PageTypePatterns: {
1255
1273
  declare const CrossTabBehaviorConfig: {
1256
1274
  readonly "/login": {
1257
1275
  readonly "auth.logged_in": {
1258
- readonly action: NavigationAction.NONE;
1276
+ readonly action: NavigationAction.RELOAD;
1259
1277
  };
1260
1278
  readonly "auth.logged_out": {
1261
1279
  readonly action: NavigationAction.NONE;
@@ -1275,7 +1293,7 @@ declare const CrossTabBehaviorConfig: {
1275
1293
  readonly action: NavigationAction.RELOAD;
1276
1294
  };
1277
1295
  readonly "auth.email_verified": {
1278
- readonly action: NavigationAction.RELOAD;
1296
+ readonly action: NavigationAction.NONE;
1279
1297
  };
1280
1298
  readonly "auth.signin_required_modal": {
1281
1299
  readonly action: NavigationAction.NONE;
package/dist/index.d.ts CHANGED
@@ -358,7 +358,7 @@ declare class CrossTabBehaviorHandler {
358
358
  * Get the action configuration for current route and event
359
359
  */
360
360
  static getAction(currentPageType: PageType, eventType: AuthEventType): {
361
- readonly action: NavigationAction.NONE;
361
+ readonly action: NavigationAction.RELOAD;
362
362
  } | {
363
363
  readonly action: NavigationAction.NONE;
364
364
  } | {
@@ -370,7 +370,7 @@ declare class CrossTabBehaviorHandler {
370
370
  } | {
371
371
  readonly action: NavigationAction.RELOAD;
372
372
  } | {
373
- readonly action: NavigationAction.RELOAD;
373
+ readonly action: NavigationAction.NONE;
374
374
  } | {
375
375
  readonly action: NavigationAction.NONE;
376
376
  } | {
@@ -555,6 +555,14 @@ declare class AuthService extends BaseService implements IAuthService {
555
555
  * Logout user
556
556
  */
557
557
  logout(): Promise<void>;
558
+ /**
559
+ * Send forgot password email
560
+ */
561
+ forgotPassword(email: string): Promise<void>;
562
+ /**
563
+ * Resend verification code
564
+ */
565
+ resendVerification(email: string): Promise<void>;
558
566
  }
559
567
 
560
568
  /**
@@ -568,6 +576,8 @@ declare const AUTH_ENDPOINTS: {
568
576
  readonly GET_USER_PROFILE: "/auth/user/profile";
569
577
  readonly GET_ME: "/auth/user/me";
570
578
  readonly LOGOUT: "/auth/logout";
579
+ readonly FORGOT_PASSWORD: "/auth/user/forget-password";
580
+ readonly RESEND_VERIFICATION: "/auth/user/generate-verification";
571
581
  };
572
582
  /**
573
583
  * Endpoint builder utility
@@ -581,6 +591,8 @@ declare class EndpointBuilder {
581
591
  readonly GET_USER_PROFILE: "/auth/user/profile";
582
592
  readonly GET_ME: "/auth/user/me";
583
593
  readonly LOGOUT: "/auth/logout";
594
+ readonly FORGOT_PASSWORD: "/auth/user/forget-password";
595
+ readonly RESEND_VERIFICATION: "/auth/user/generate-verification";
584
596
  };
585
597
  }
586
598
 
@@ -769,12 +781,11 @@ declare class LoggerFactory {
769
781
  */
770
782
  declare class AuthOrchestrator implements IAuthOrchestrator {
771
783
  private authService;
772
- private eventBus;
773
784
  private tokenManager;
774
785
  private userStorageManager;
775
786
  private errorHandler;
776
787
  private logger;
777
- constructor(authService: AuthService, eventBus: EventBus<AuthEvent>, tokenManager?: ITokenManager);
788
+ constructor(authService: AuthService, tokenManager?: ITokenManager);
778
789
  /**
779
790
  * Setup Chain of Responsibility for error handling
780
791
  */
@@ -830,6 +841,14 @@ declare class AuthOrchestrator implements IAuthOrchestrator {
830
841
  * Get detailed token information
831
842
  */
832
843
  getTokenInfo(): Promise<AuthActionResult>;
844
+ /**
845
+ * Handle forgot password flow
846
+ */
847
+ handleForgotPassword(email: string): Promise<AuthActionResult>;
848
+ /**
849
+ * Handle resend verification code
850
+ */
851
+ handleResendVerification(email: string): Promise<AuthActionResult>;
833
852
  }
834
853
  /**
835
854
  * Authentication Orchestrator Factory
@@ -843,7 +862,7 @@ declare class AuthOrchestratorFactory {
843
862
  /**
844
863
  * Create AuthOrchestrator with custom dependencies
845
864
  */
846
- static createWithDependencies(authService: AuthService, eventBus: EventBus<AuthEvent>, tokenManager?: ITokenManager): AuthOrchestrator;
865
+ static createWithDependencies(authService: AuthService, tokenManager?: ITokenManager): AuthOrchestrator;
847
866
  }
848
867
 
849
868
  /**
@@ -987,9 +1006,8 @@ interface PasswordStepProps extends BaseStepProps {
987
1006
  interface VerificationStepProps extends BaseStepProps {
988
1007
  email: string;
989
1008
  onSubmit: (verificationCode: string) => void | Promise<void>;
990
- onResendCode?: () => void;
1009
+ onResendCode?: () => void | Promise<void>;
991
1010
  codeLength?: number;
992
- showResendButton?: boolean;
993
1011
  }
994
1012
 
995
1013
  interface ForgotPasswordStepProps extends BaseStepProps {
@@ -1255,7 +1273,7 @@ declare const PageTypePatterns: {
1255
1273
  declare const CrossTabBehaviorConfig: {
1256
1274
  readonly "/login": {
1257
1275
  readonly "auth.logged_in": {
1258
- readonly action: NavigationAction.NONE;
1276
+ readonly action: NavigationAction.RELOAD;
1259
1277
  };
1260
1278
  readonly "auth.logged_out": {
1261
1279
  readonly action: NavigationAction.NONE;
@@ -1275,7 +1293,7 @@ declare const CrossTabBehaviorConfig: {
1275
1293
  readonly action: NavigationAction.RELOAD;
1276
1294
  };
1277
1295
  readonly "auth.email_verified": {
1278
- readonly action: NavigationAction.RELOAD;
1296
+ readonly action: NavigationAction.NONE;
1279
1297
  };
1280
1298
  readonly "auth.signin_required_modal": {
1281
1299
  readonly action: NavigationAction.NONE;