import { Action } from '@ngrx/store' ; import { DaffLoginInfo , DaffAuthToken , DaffAccountRegistration , } from '@daffodil/auth' ; import { DaffStateError } from '@daffodil/core/state' ; export enum DaffAuthActionTypes { AuthGuardCheckAction = '[Daff-Auth] Auth Guard Check Action' , AuthGuardCheckCompletionAction = '[Daff-Auth] Auth Guard Check Completion Action' , AuthStorageFailureAction = '[Daff-Auth] Auth Storage Failure Action' , AuthLoginAction = '[Daff-Auth] Auth Login Action' , AuthLoginSuccessAction = '[Daff-Auth] Auth Login Success Action' , AuthLoginFailureAction = '[Daff-Auth] Auth Login Failure Action' , AuthLogoutAction = '[Daff-Auth] Auth Logout Action' , AuthLogoutSuccessAction = '[Daff-Auth] Auth Logout Success Action' , AuthLogoutFailureAction = '[Daff-Auth] Auth Logout Failure Action' , AuthCheckAction = '[Daff-Auth] Auth Check Action' , AuthCheckSuccessAction = '[Daff-Auth] Auth Check Success Action' , AuthCheckFailureAction = '[Daff-Auth] Auth Check Failure Action' , AuthRegisterAction = '[Daff-Auth] Auth Register Action' , AuthRegisterSuccessAction = '[Daff-Auth] Auth Register Success Action' , AuthRegisterFailureAction = '[Daff-Auth] Auth Register Failure Action' } /**
 * An action triggered by guards to initialize an auth check request.
 */ export class DaffAuthGuardCheck implements Action { readonly type = DaffAuthActionTypes . AuthGuardCheckAction ; } /**
 * An action triggered on the completion of a guard token check.
 */ export class DaffAuthGuardCheckCompletion implements Action { readonly type = DaffAuthActionTypes . AuthGuardCheckCompletionAction ; constructor ( public result ) { } } export class DaffAuthStorageFailure implements Action { readonly type = DaffAuthActionTypes . AuthStorageFailureAction ; constructor ( public errorMessage ) { } } /**
 * An action triggered to initialize a auth login request.
 */ export class DaffAuthLogin < T extends DaffLoginInfo > implements Action { readonly type = DaffAuthActionTypes . AuthLoginAction ; constructor ( public loginInfo ) { } } param token export class DaffAuthLoginSuccess < T extends DaffAuthToken = DaffAuthToken > implements Action { readonly type = DaffAuthActionTypes . AuthLoginSuccessAction ; constructor ( public auth ) { } } param errorMessage export class DaffAuthLoginFailure implements Action { readonly type = DaffAuthActionTypes . AuthLoginFailureAction ; constructor ( public errorMessage ) { } } /**
 * An action triggered to initialize a logout request.
 */ export class DaffAuthLogout implements Action { readonly type = DaffAuthActionTypes . AuthLogoutAction ; } param token export class DaffAuthLogoutSuccess implements Action { readonly type = DaffAuthActionTypes . AuthLogoutSuccessAction ; } param errorMessage export class DaffAuthLogoutFailure implements Action { readonly type = DaffAuthActionTypes . AuthLogoutFailureAction ; constructor ( public errorMessage ) { } } /**
 * An action triggered to initialize an auth check request.
 */ export class DaffAuthCheck implements Action { readonly type = DaffAuthActionTypes . AuthCheckAction ; } param token export class DaffAuthCheckSuccess implements Action { readonly type = DaffAuthActionTypes . AuthCheckSuccessAction ; } param errorMessage export class DaffAuthCheckFailure implements Action { readonly type = DaffAuthActionTypes . AuthCheckFailureAction ; constructor ( public errorMessage ) { } } param registration export class DaffAuthRegister < T extends DaffAccountRegistration > implements Action { readonly type = DaffAuthActionTypes . AuthRegisterAction ; constructor ( public registration ) { } } param token export class DaffAuthRegisterSuccess < T extends DaffLoginInfo > implements Action { readonly type = DaffAuthActionTypes . AuthRegisterSuccessAction ; constructor ( public loginInfo ) { } } param errorMessage export class DaffAuthRegisterFailure implements Action { readonly type = DaffAuthActionTypes . AuthRegisterFailureAction ; constructor ( public errorMessage ) { } } export type DaffAuthActions < T extends DaffLoginInfo , U extends DaffAuthToken , S extends DaffAccountRegistration > = DaffAuthGuardCheckCompletion | DaffAuthGuardCheck | DaffAuthStorageFailure | DaffAuthLogin < T > | DaffAuthLoginSuccess < U > | DaffAuthLoginFailure | DaffAuthLogout | DaffAuthLogoutSuccess | DaffAuthLogoutFailure | DaffAuthCheck | DaffAuthCheckSuccess | DaffAuthCheckFailure | DaffAuthRegister < S > | DaffAuthRegisterSuccess < T > | DaffAuthRegisterFailure ;