@daffodil/auth 0.94.1-rc.0 → 0.95.0

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.
Files changed (34) hide show
  1. package/fesm2022/daffodil-auth-driver-in-memory.mjs +356 -249
  2. package/fesm2022/daffodil-auth-driver-in-memory.mjs.map +1 -1
  3. package/fesm2022/daffodil-auth-driver-magento-2.4.7.mjs +459 -0
  4. package/fesm2022/daffodil-auth-driver-magento-2.4.7.mjs.map +1 -0
  5. package/fesm2022/daffodil-auth-driver-magento-auto.mjs +7 -0
  6. package/fesm2022/daffodil-auth-driver-magento-auto.mjs.map +1 -0
  7. package/fesm2022/daffodil-auth-driver-testing.mjs +220 -126
  8. package/fesm2022/daffodil-auth-driver-testing.mjs.map +1 -1
  9. package/fesm2022/daffodil-auth-driver.mjs +99 -126
  10. package/fesm2022/daffodil-auth-driver.mjs.map +1 -1
  11. package/fesm2022/daffodil-auth-routing.mjs +392 -257
  12. package/fesm2022/daffodil-auth-routing.mjs.map +1 -1
  13. package/fesm2022/daffodil-auth-state-testing.mjs +209 -106
  14. package/fesm2022/daffodil-auth-state-testing.mjs.map +1 -1
  15. package/fesm2022/daffodil-auth-state.mjs +867 -852
  16. package/fesm2022/daffodil-auth-state.mjs.map +1 -1
  17. package/fesm2022/daffodil-auth-testing.mjs +132 -76
  18. package/fesm2022/daffodil-auth-testing.mjs.map +1 -1
  19. package/fesm2022/daffodil-auth.mjs +65 -57
  20. package/fesm2022/daffodil-auth.mjs.map +1 -1
  21. package/package.json +1 -1
  22. package/types/daffodil-auth-driver-in-memory.d.ts +62 -62
  23. package/types/daffodil-auth-driver-magento-2.4.7.d.ts +119 -0
  24. package/types/daffodil-auth-driver-magento-auto.d.ts +1 -0
  25. package/types/daffodil-auth-driver-testing.d.ts +37 -36
  26. package/types/daffodil-auth-driver.d.ts +93 -112
  27. package/types/daffodil-auth-routing.d.ts +100 -104
  28. package/types/daffodil-auth-state-testing.d.ts +44 -43
  29. package/types/daffodil-auth-state.d.ts +265 -306
  30. package/types/daffodil-auth-testing.d.ts +28 -33
  31. package/types/daffodil-auth.d.ts +51 -62
  32. package/fesm2022/daffodil-auth-driver-magento.mjs +0 -385
  33. package/fesm2022/daffodil-auth-driver-magento.mjs.map +0 -1
  34. package/types/daffodil-auth-driver-magento.d.ts +0 -135
@@ -1,135 +1,116 @@
1
- import * as _angular_core from '@angular/core';
2
- import { Observable } from 'rxjs';
3
- import { DaffLoginInfo, DaffAuthToken, DaffAccountRegistration, DaffAuthResetPasswordInfo, DaffAuthStorageService } from '@daffodil/auth';
4
- import { DaffInheritableError, DaffError } from '@daffodil/core';
5
-
6
- interface DaffAuthServiceInterface {
7
- /**
8
- * Checks the validity of an auth token.
9
- */
10
- check(): Observable<void>;
1
+ import { Observable } from "rxjs";
2
+ import { DaffAccountRegistration, DaffAuthResetPasswordInfo, DaffAuthStorageService, DaffAuthToken, DaffLoginInfo } from "@daffodil/auth";
3
+ import { DaffError, DaffInheritableError } from "@daffodil/core";
4
+ import * as i0 from "@angular/core";
5
+ export interface DaffAuthServiceInterface {
6
+ /**
7
+ * Checks the validity of an auth token.
8
+ */
9
+ check(): Observable<void>;
11
10
  }
12
- declare const DaffAuthDriver: _angular_core.InjectionToken<DaffAuthServiceInterface>;
13
- declare const provideDaffAuthDriver: <R extends DaffAuthServiceInterface = DaffAuthServiceInterface>(klass: _angular_core.Type<R>) => _angular_core.ExistingProvider;
14
-
15
- interface DaffLoginServiceInterface<TRequest extends DaffLoginInfo = DaffLoginInfo, TResponse extends DaffAuthToken = DaffAuthToken> {
16
- /**
17
- * Logs the user in.
18
- *
19
- * @returns An access token.
20
- */
21
- login(loginInfo: TRequest): Observable<TResponse>;
22
- /**
23
- * Logs the user out by revoking their access token.
24
- */
25
- logout(): Observable<void>;
11
+ export declare const DaffAuthDriver: import("@angular/core").InjectionToken<DaffAuthServiceInterface>, provideDaffAuthDriver: <R extends DaffAuthServiceInterface = DaffAuthServiceInterface>(klass: import("@angular/core").Type<R>) => import("@angular/core").ExistingProvider;
12
+ export interface DaffLoginServiceInterface<TRequest extends DaffLoginInfo = DaffLoginInfo, TResponse extends DaffAuthToken = DaffAuthToken> {
13
+ /**
14
+ * Logs the user in.
15
+ *
16
+ * @returns An access token.
17
+ */
18
+ login(loginInfo: TRequest): Observable<TResponse>;
19
+ /**
20
+ * Logs the user out by revoking their access token.
21
+ */
22
+ logout(): Observable<void>;
26
23
  }
27
- declare const DaffLoginDriver: _angular_core.InjectionToken<DaffLoginServiceInterface<DaffLoginInfo, DaffAuthToken>>;
28
- declare const provideDaffLoginDriver: <R extends DaffLoginServiceInterface<DaffLoginInfo, DaffAuthToken> = DaffLoginServiceInterface<DaffLoginInfo, DaffAuthToken>>(klass: _angular_core.Type<R>) => _angular_core.ExistingProvider;
29
-
30
- interface DaffRegisterServiceInterface<TRequest extends DaffAccountRegistration = DaffAccountRegistration> {
31
- /**
32
- * Registers an account for the specified customer and logs the customer in.
33
- *
34
- * @param registration The account registration info.
35
- * @return The authentication token.
36
- */
37
- register(registration: TRequest): Observable<string>;
38
- /**
39
- * Registers an account for the specified customer but does not log the customer in.
40
- *
41
- * @param registration The account registration info.
42
- */
43
- registerOnly(registration: TRequest): Observable<void>;
24
+ export declare const DaffLoginDriver: import("@angular/core").InjectionToken<DaffLoginServiceInterface<DaffLoginInfo, DaffAuthToken>>, provideDaffLoginDriver: <R extends DaffLoginServiceInterface<DaffLoginInfo, DaffAuthToken> = DaffLoginServiceInterface<DaffLoginInfo, DaffAuthToken>>(klass: import("@angular/core").Type<R>) => import("@angular/core").ExistingProvider;
25
+ export interface DaffRegisterServiceInterface<TRequest extends DaffAccountRegistration = DaffAccountRegistration> {
26
+ /**
27
+ * Registers an account for the specified customer and logs the customer in.
28
+ *
29
+ * @param registration The account registration info.
30
+ * @return The authentication token.
31
+ */
32
+ register(registration: TRequest): Observable<string>;
33
+ /**
34
+ * Registers an account for the specified customer but does not log the customer in.
35
+ *
36
+ * @param registration The account registration info.
37
+ */
38
+ registerOnly(registration: TRequest): Observable<void>;
44
39
  }
45
- declare const DaffRegisterDriver: _angular_core.InjectionToken<DaffRegisterServiceInterface<DaffAccountRegistration>>;
46
- declare const provideDaffRegisterDriver: <R extends DaffRegisterServiceInterface<DaffAccountRegistration> = DaffRegisterServiceInterface<DaffAccountRegistration>>(klass: _angular_core.Type<R>) => _angular_core.ExistingProvider;
47
-
48
- interface DaffResetPasswordServiceInterface<T extends DaffAuthResetPasswordInfo = DaffAuthResetPasswordInfo> {
49
- /**
50
- * Resets password for the specified customer and logs in.
51
- */
52
- resetPassword(info: T): Observable<string>;
53
- /**
54
- * Resets password for the specified customer.
55
- */
56
- resetPasswordOnly(info: T): Observable<void>;
57
- /**
58
- * Send a password reset email to the specified email address.
59
- */
60
- sendResetEmail(email: string): Observable<void>;
40
+ export declare const DaffRegisterDriver: import("@angular/core").InjectionToken<DaffRegisterServiceInterface<DaffAccountRegistration>>, provideDaffRegisterDriver: <R extends DaffRegisterServiceInterface<DaffAccountRegistration> = DaffRegisterServiceInterface<DaffAccountRegistration>>(klass: import("@angular/core").Type<R>) => import("@angular/core").ExistingProvider;
41
+ export interface DaffResetPasswordServiceInterface<T extends DaffAuthResetPasswordInfo = DaffAuthResetPasswordInfo> {
42
+ /**
43
+ * Resets password for the specified customer and logs in.
44
+ */
45
+ resetPassword(info: T): Observable<string>;
46
+ /**
47
+ * Resets password for the specified customer.
48
+ */
49
+ resetPasswordOnly(info: T): Observable<void>;
50
+ /**
51
+ * Send a password reset email to the specified email address.
52
+ */
53
+ sendResetEmail(email: string): Observable<void>;
61
54
  }
62
- declare const DaffResetPasswordDriver: _angular_core.InjectionToken<DaffResetPasswordServiceInterface<DaffAuthResetPasswordInfo>>;
63
- declare const provideDaffResetPasswordDriver: <R extends DaffResetPasswordServiceInterface<DaffAuthResetPasswordInfo> = DaffResetPasswordServiceInterface<DaffAuthResetPasswordInfo>>(klass: _angular_core.Type<R>) => _angular_core.ExistingProvider;
64
-
65
- declare class DaffUnauthorizedError extends DaffInheritableError implements DaffError {
66
- message: string;
67
- readonly code: string;
68
- constructor(message: string);
55
+ export declare const DaffResetPasswordDriver: import("@angular/core").InjectionToken<DaffResetPasswordServiceInterface<DaffAuthResetPasswordInfo>>, provideDaffResetPasswordDriver: <R extends DaffResetPasswordServiceInterface<DaffAuthResetPasswordInfo> = DaffResetPasswordServiceInterface<DaffAuthResetPasswordInfo>>(klass: import("@angular/core").Type<R>) => import("@angular/core").ExistingProvider;
56
+ export declare class DaffUnauthorizedError extends DaffInheritableError implements DaffError {
57
+ message: string;
58
+ readonly code: string;
59
+ constructor(message: string);
69
60
  }
70
-
71
- declare class DaffAuthenticationFailedError extends DaffInheritableError implements DaffError {
72
- message: string;
73
- readonly code: string;
74
- constructor(message: string);
61
+ export declare class DaffAuthenticationFailedError extends DaffInheritableError implements DaffError {
62
+ message: string;
63
+ readonly code: string;
64
+ constructor(message: string);
75
65
  }
76
-
77
66
  /**
78
67
  * An error thrown when registration failed.
79
68
  */
80
- declare class DaffRegistrationFailedError extends DaffInheritableError implements DaffError {
81
- message: string;
82
- readonly code: string;
83
- constructor(message: string);
69
+ export declare class DaffRegistrationFailedError extends DaffInheritableError implements DaffError {
70
+ message: string;
71
+ readonly code: string;
72
+ constructor(message: string);
84
73
  }
85
-
86
- declare class DaffAuthInvalidAPIResponseError extends DaffInheritableError implements DaffError {
87
- message: string;
88
- readonly code: string;
89
- constructor(message: string);
74
+ export declare class DaffAuthInvalidAPIResponseError extends DaffInheritableError implements DaffError {
75
+ message: string;
76
+ readonly code: string;
77
+ constructor(message: string);
90
78
  }
91
-
92
- declare enum DaffAuthDriverErrorCodes {
93
- AUTHENTICATION_FAILED = "DAFF_AUTH_AUTHENTICATION_FAILED",
94
- INVALID_API_RESPONSE = "DAFF_AUTH_INVALID_API_RESPONSE",
95
- REGISTRATION_FAILED = "DAFF_AUTH_REGISTRATION_FAILED",
96
- UNAUTHORIZED = "DAFF_AUTH_UNAUTHORIZED"
79
+ export declare enum DaffAuthDriverErrorCodes {
80
+ AUTHENTICATION_FAILED = "DAFF_AUTH_AUTHENTICATION_FAILED",
81
+ INVALID_API_RESPONSE = "DAFF_AUTH_INVALID_API_RESPONSE",
82
+ REGISTRATION_FAILED = "DAFF_AUTH_REGISTRATION_FAILED",
83
+ UNAUTHORIZED = "DAFF_AUTH_UNAUTHORIZED"
97
84
  }
98
-
99
85
  /**
100
86
  * A mapping from error codes to error class constructors.
101
87
  */
102
- declare const DaffAuthDriverErrorMap: {
103
- DAFF_AUTH_AUTHENTICATION_FAILED: typeof DaffAuthenticationFailedError;
104
- DAFF_AUTH_INVALID_API_RESPONSE: typeof DaffAuthInvalidAPIResponseError;
105
- DAFF_AUTH_REGISTRATION_FAILED: typeof DaffRegistrationFailedError;
106
- DAFF_AUTH_UNAUTHORIZED: typeof DaffUnauthorizedError;
88
+ export declare const DaffAuthDriverErrorMap: {
89
+ DAFF_AUTH_AUTHENTICATION_FAILED: typeof DaffAuthenticationFailedError;
90
+ DAFF_AUTH_INVALID_API_RESPONSE: typeof DaffAuthInvalidAPIResponseError;
91
+ DAFF_AUTH_REGISTRATION_FAILED: typeof DaffRegistrationFailedError;
92
+ DAFF_AUTH_UNAUTHORIZED: typeof DaffUnauthorizedError;
107
93
  };
108
-
109
- declare class DaffAuthDriverTokenCheck {
110
- private storage;
111
- private driver;
112
- constructor(storage: DaffAuthStorageService, driver: DaffAuthServiceInterface);
113
- /**
114
- * Checks if the auth token in storage is valid.
115
- * If there is not an auth token in storage, the driver is not called
116
- * and an error is immediately thrown.
117
- */
118
- check(): Observable<void>;
119
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<DaffAuthDriverTokenCheck, never>;
120
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<DaffAuthDriverTokenCheck>;
94
+ export declare class DaffAuthDriverTokenCheck {
95
+ private storage;
96
+ private driver;
97
+ constructor(storage: DaffAuthStorageService, driver: DaffAuthServiceInterface);
98
+ /**
99
+ * Checks if the auth token in storage is valid.
100
+ * If there is not an auth token in storage, the driver is not called
101
+ * and an error is immediately thrown.
102
+ */
103
+ check(): Observable<void>;
104
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthDriverTokenCheck, never>;
105
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
121
106
  }
122
-
123
107
  /**
124
108
  * The error codes that indicate that the user definitely should not be in an unauthenticated state
125
109
  * and if an auth token exists in storage, it is invalid.
126
110
  * These are contrasted to network failures and other sporadic and generic errors that aren't
127
111
  * a guarantee of the token's invalidity.
128
112
  */
129
- declare const DAFF_AUTH_UNAUTHENTICATED_ERROR_CODES: {
130
- DAFF_AUTH_UNAUTHORIZED: boolean;
131
- DAFF_AUTH_AUTHENTICATION_FAILED: boolean;
132
- };
133
-
134
- export { DAFF_AUTH_UNAUTHENTICATED_ERROR_CODES, DaffAuthDriver, DaffAuthDriverErrorCodes, DaffAuthDriverErrorMap, DaffAuthDriverTokenCheck, DaffAuthInvalidAPIResponseError, DaffAuthenticationFailedError, DaffLoginDriver, DaffRegisterDriver, DaffRegistrationFailedError, DaffResetPasswordDriver, DaffUnauthorizedError, provideDaffAuthDriver, provideDaffLoginDriver, provideDaffRegisterDriver, provideDaffResetPasswordDriver };
135
- export type { DaffAuthServiceInterface, DaffLoginServiceInterface, DaffRegisterServiceInterface, DaffResetPasswordServiceInterface };
113
+ export declare const DAFF_AUTH_UNAUTHENTICATED_ERROR_CODES: {
114
+ DAFF_AUTH_UNAUTHORIZED: boolean;
115
+ DAFF_AUTH_AUTHENTICATION_FAILED: boolean;
116
+ };
@@ -1,113 +1,109 @@
1
- import { Router, CanActivate, ActivatedRouteSnapshot, UrlTree, ActivatedRoute } from '@angular/router';
2
- import { Store } from '@ngrx/store';
3
- import { Observable } from 'rxjs';
4
- import { DaffAuthStorageService } from '@daffodil/auth';
5
- import { DaffAuthDriverTokenCheck } from '@daffodil/auth/driver';
6
- import { ErrorTransformer } from '@daffodil/core/state';
7
- import * as i0 from '@angular/core';
8
- import { ModuleWithProviders } from '@angular/core';
9
- import * as _daffodil_auth_routing from '@daffodil/auth/routing';
10
- import { DaffAuthFacade, DaffAuthUnauthenticatedHook } from '@daffodil/auth/state';
11
- import * as i1 from '@ngrx/effects';
12
-
13
- declare class MemberOnlyGuard {
14
- private tokenCheck;
15
- private storage;
16
- private router;
17
- private store;
18
- private errorMatcher;
19
- private redirectUrl;
20
- constructor(tokenCheck: DaffAuthDriverTokenCheck, storage: DaffAuthStorageService, router: Router, store: Store, errorMatcher: ErrorTransformer, redirectUrl: string);
21
- canActivate(): Observable<boolean>;
22
- private isAuthenticated;
23
- static ɵfac: i0.ɵɵFactoryDeclaration<MemberOnlyGuard, never>;
24
- static ɵprov: i0.ɵɵInjectableDeclaration<MemberOnlyGuard>;
1
+ import { ActivatedRoute, ActivatedRouteSnapshot, CanActivate, Router, UrlTree } from "@angular/router";
2
+ import { Store } from "@ngrx/store";
3
+ import { Observable } from "rxjs";
4
+ import { DaffAuthStorageService } from "@daffodil/auth";
5
+ import { DaffAuthDriverTokenCheck } from "@daffodil/auth/driver";
6
+ import { ErrorTransformer } from "@daffodil/core/state";
7
+ import * as i0 from "@angular/core";
8
+ import { EnvironmentProviders, ModuleWithProviders } from "@angular/core";
9
+ import { DaffAuthFacade, DaffAuthUnauthenticatedHook } from "@daffodil/auth/state";
10
+ import * as i1 from "@ngrx/effects";
11
+ export declare class MemberOnlyGuard {
12
+ private tokenCheck;
13
+ private storage;
14
+ private router;
15
+ private store;
16
+ private errorMatcher;
17
+ private redirectUrl;
18
+ constructor(tokenCheck: DaffAuthDriverTokenCheck, storage: DaffAuthStorageService, router: Router, store: Store, errorMatcher: ErrorTransformer, redirectUrl: string);
19
+ canActivate(): Observable<boolean>;
20
+ private isAuthenticated;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<MemberOnlyGuard, never>;
22
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
25
23
  }
26
-
27
- declare class GuestOnlyGuard {
28
- private tokenCheck;
29
- private storage;
30
- private router;
31
- private store;
32
- private errorMatcher;
33
- private redirectUrl;
34
- constructor(tokenCheck: DaffAuthDriverTokenCheck, storage: DaffAuthStorageService, router: Router, store: Store, errorMatcher: ErrorTransformer, redirectUrl: string);
35
- canActivate(): Observable<boolean>;
36
- private isUnauthenticated;
37
- static ɵfac: i0.ɵɵFactoryDeclaration<GuestOnlyGuard, never>;
38
- static ɵprov: i0.ɵɵInjectableDeclaration<GuestOnlyGuard>;
24
+ export declare class GuestOnlyGuard {
25
+ private tokenCheck;
26
+ private storage;
27
+ private router;
28
+ private store;
29
+ private errorMatcher;
30
+ private redirectUrl;
31
+ constructor(tokenCheck: DaffAuthDriverTokenCheck, storage: DaffAuthStorageService, router: Router, store: Store, errorMatcher: ErrorTransformer, redirectUrl: string);
32
+ canActivate(): Observable<boolean>;
33
+ private isUnauthenticated;
34
+ static ɵfac: i0.ɵɵFactoryDeclaration<GuestOnlyGuard, never>;
35
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
39
36
  }
40
-
41
- declare class DaffAuthResetPasswordGuard implements CanActivate {
42
- readonly facade: DaffAuthFacade;
43
- readonly config: _daffodil_auth_routing.DaffAuthRoutingConfig;
44
- readonly platformId: Object;
45
- readonly router: Router;
46
- canActivate(route: ActivatedRouteSnapshot): boolean | UrlTree;
47
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthResetPasswordGuard, never>;
48
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffAuthResetPasswordGuard>;
37
+ export declare class DaffAuthResetPasswordGuard implements CanActivate {
38
+ readonly facade: DaffAuthFacade;
39
+ readonly config: import("@daffodil/auth/routing").DaffAuthRoutingConfig;
40
+ readonly platformId: Object;
41
+ readonly router: Router;
42
+ canActivate(route: ActivatedRouteSnapshot): boolean | UrlTree;
43
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthResetPasswordGuard, never>;
44
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
49
45
  }
50
-
51
- declare const DaffAuthGuestOnlyGuardRedirectUrl: i0.InjectionToken<string>;
52
- declare const provideDaffAuthGuestOnlyGuardRedirectUrl: <R extends string = string>(value: R) => i0.ValueProvider;
53
-
54
- declare const DaffAuthMemberOnlyGuardRedirectUrl: i0.InjectionToken<string>;
55
- declare const provideDaffAuthMemberOnlyGuardRedirectUrl: <R extends string = string>(value: R) => i0.ValueProvider;
56
-
46
+ export declare const DaffAuthGuestOnlyGuardRedirectUrl: import("@angular/core").InjectionToken<string>, provideDaffAuthGuestOnlyGuardRedirectUrl: <R extends string = string>(value: R) => import("@angular/core").ValueProvider;
47
+ export declare const DaffAuthMemberOnlyGuardRedirectUrl: import("@angular/core").InjectionToken<string>, provideDaffAuthMemberOnlyGuardRedirectUrl: <R extends string = string>(value: R) => import("@angular/core").ValueProvider;
57
48
  /**
58
49
  * An interface for providing `@daffodil/auth/routing` with necessary config values.
59
50
  */
60
- interface DaffAuthRoutingConfig {
61
- /**
62
- * The name of the query param to which the reset password token will be set.
63
- */
64
- resetPasswordTokenParam: string;
65
- /**
66
- * The name of the query param from which the redirect URL will be fetched.
67
- * Defaults to `redirect`.
68
- */
69
- redirectUrlParam: string;
70
- /**
71
- * The path to which the user will be redirected when they are logged in and the auth token is stored.
72
- * Defaults to `'/'`.
73
- */
74
- authCompleteRedirectPath: string;
75
- /**
76
- * The path to which the user will be redirected when they are logged out.
77
- * Defaults to `'/'`.
78
- */
79
- logoutRedirectPath: string;
80
- /**
81
- * The path to which the user will be redirected when their auth token is present but invalid.
82
- * Defaults to `'/'`.
83
- */
84
- tokenExpirationRedirectPath: string;
85
- /**
86
- * The path to which the user will be redirected when the reset password guard blocks activation.
87
- * Defaults to `'/'`.
88
- */
89
- resetPasswordRedirectPath: string;
51
+ export interface DaffAuthRoutingConfig {
52
+ /**
53
+ * The name of the query param to which the reset password token will be set.
54
+ */
55
+ resetPasswordTokenParam: string;
56
+ /**
57
+ * The name of the query param from which the redirect URL will be fetched.
58
+ * Defaults to `redirect`.
59
+ */
60
+ redirectUrlParam: string;
61
+ /**
62
+ * The path to which the user will be redirected when they are logged in and the auth token is stored.
63
+ * Defaults to `'/'`.
64
+ */
65
+ authCompleteRedirectPath: string;
66
+ /**
67
+ * The path to which the user will be redirected when they are logged out.
68
+ * Defaults to `'/'`.
69
+ */
70
+ logoutRedirectPath: string;
71
+ /**
72
+ * The path to which the user will be redirected when their auth token is present but invalid.
73
+ * Defaults to `'/'`.
74
+ */
75
+ tokenExpirationRedirectPath: string;
76
+ /**
77
+ * The path to which the user will be redirected when the reset password guard blocks activation.
78
+ * Defaults to `'/'`.
79
+ */
80
+ resetPasswordRedirectPath: string;
90
81
  }
91
-
92
- declare const DAFF_AUTH_ROUTING_CONFIG_DEFAULT: DaffAuthRoutingConfig;
93
-
94
- declare const DAFF_AUTH_ROUTING_CONFIG: i0.InjectionToken<DaffAuthRoutingConfig>;
95
- declare const provideDaffAuthRoutingConfig: <R extends DaffAuthRoutingConfig = DaffAuthRoutingConfig>(config: Partial<R> | i0.InjectionToken<Partial<R>>) => i0.FactoryProvider;
96
-
97
- declare function daffAuthRoutingRedirectUnauthenticatedHookFactory(router: Router, route: ActivatedRoute, config: DaffAuthRoutingConfig): DaffAuthUnauthenticatedHook;
98
-
99
- declare class DaffAuthRoutingModule {
100
- static withConfig(config?: Partial<DaffAuthRoutingConfig>): ModuleWithProviders<DaffAuthRoutingModule>;
101
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthRoutingModule, never>;
102
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffAuthRoutingModule, never, never, never>;
103
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffAuthRoutingModule>;
82
+ export declare const DAFF_AUTH_ROUTING_CONFIG_DEFAULT: DaffAuthRoutingConfig;
83
+ export declare const DAFF_AUTH_ROUTING_CONFIG: import("@angular/core").InjectionToken<DaffAuthRoutingConfig>, provideDaffAuthRoutingConfig: <R extends DaffAuthRoutingConfig = DaffAuthRoutingConfig>(config: Partial<R> | import("@angular/core").InjectionToken<Partial<R>>) => import("@angular/core").FactoryProvider;
84
+ export declare function daffAuthRoutingRedirectUnauthenticatedHookFactory(router: Router, route: ActivatedRoute, config: DaffAuthRoutingConfig): DaffAuthUnauthenticatedHook;
85
+ /**
86
+ * @deprecated in favor of {@link provideDaffAuthRouting} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
87
+ */
88
+ export declare class DaffAuthRoutingModule {
89
+ static withConfig(config?: Partial<DaffAuthRoutingConfig>): ModuleWithProviders<DaffAuthRoutingModule>;
90
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthRoutingModule, never>;
91
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffAuthRoutingModule, never, never, never>;
92
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffAuthRoutingModule>;
104
93
  }
105
-
106
- declare class DaffAuthRoutingRedirectModule {
107
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthRoutingRedirectModule, never>;
108
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffAuthRoutingRedirectModule, never, [typeof i1.EffectsFeatureModule], never>;
109
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffAuthRoutingRedirectModule>;
94
+ /**
95
+ * @deprecated in favor of {@link provideDaffAuthRoutingRedirect} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
96
+ */
97
+ export declare class DaffAuthRoutingRedirectModule {
98
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthRoutingRedirectModule, never>;
99
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffAuthRoutingRedirectModule, never, [typeof i1.EffectsFeatureModule], never>;
100
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffAuthRoutingRedirectModule>;
110
101
  }
111
-
112
- export { DAFF_AUTH_ROUTING_CONFIG, DAFF_AUTH_ROUTING_CONFIG_DEFAULT, DaffAuthGuestOnlyGuardRedirectUrl, DaffAuthMemberOnlyGuardRedirectUrl, DaffAuthResetPasswordGuard, DaffAuthRoutingModule, DaffAuthRoutingRedirectModule, GuestOnlyGuard, MemberOnlyGuard, daffAuthRoutingRedirectUnauthenticatedHookFactory, provideDaffAuthGuestOnlyGuardRedirectUrl, provideDaffAuthMemberOnlyGuardRedirectUrl, provideDaffAuthRoutingConfig };
113
- export type { DaffAuthRoutingConfig };
102
+ /**
103
+ * Provides the `@daffodil/auth/routing` guards and config.
104
+ */
105
+ export declare const provideDaffAuthRouting: (config?: Partial<DaffAuthRoutingConfig>) => EnvironmentProviders;
106
+ /**
107
+ * Provides the `@daffodil/auth/routing` redirect effects and unauthenticated hook.
108
+ */
109
+ export declare const provideDaffAuthRoutingRedirect: () => EnvironmentProviders;
@@ -1,59 +1,60 @@
1
- import * as i0 from '@angular/core';
2
- import { Action } from '@ngrx/store';
3
- import { BehaviorSubject } from 'rxjs';
4
- import { DaffAuthFacadeInterface, DaffAuthLoginFacadeInterface, DaffAuthRegisterFacadeInterface, DaffAuthResetPasswordFacadeInterface } from '@daffodil/auth/state';
5
- import { DaffStateError } from '@daffodil/core/state';
6
-
7
- declare class DaffAuthStateTestingModule {
8
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthStateTestingModule, never>;
9
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffAuthStateTestingModule, never, never, never>;
10
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffAuthStateTestingModule>;
1
+ import * as i0 from "@angular/core";
2
+ import { EnvironmentProviders } from "@angular/core";
3
+ import { Action } from "@ngrx/store";
4
+ import { BehaviorSubject } from "rxjs";
5
+ import { DaffAuthFacadeInterface, DaffAuthLoginFacadeInterface, DaffAuthRegisterFacadeInterface, DaffAuthResetPasswordFacadeInterface } from "@daffodil/auth/state";
6
+ import { DaffStateError } from "@daffodil/core/state";
7
+ /**
8
+ * @deprecated in favor of {@link provideDaffAuthStateTesting} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
9
+ */
10
+ export declare class DaffAuthStateTestingModule {
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthStateTestingModule, never>;
12
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffAuthStateTestingModule, never, never, never>;
13
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffAuthStateTestingModule>;
11
14
  }
12
-
15
+ /**
16
+ * Provides the mock facades for the `@daffodil/auth/state` facades.
17
+ */
18
+ export declare const provideDaffAuthStateTesting: () => EnvironmentProviders;
13
19
  /**
14
20
  * @inheritdoc
15
21
  */
16
- declare class MockDaffAuthFacade implements DaffAuthFacadeInterface {
17
- loading$: BehaviorSubject<boolean>;
18
- errors$: BehaviorSubject<DaffStateError[]>;
19
- loggedIn$: BehaviorSubject<boolean>;
20
- dispatch(action: Action): void;
21
- static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffAuthFacade, never>;
22
- static ɵprov: i0.ɵɵInjectableDeclaration<MockDaffAuthFacade>;
22
+ export declare class MockDaffAuthFacade implements DaffAuthFacadeInterface {
23
+ loading$: BehaviorSubject<boolean>;
24
+ errors$: BehaviorSubject<DaffStateError[]>;
25
+ loggedIn$: BehaviorSubject<boolean>;
26
+ dispatch(action: Action): void;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffAuthFacade, never>;
28
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
23
29
  }
24
-
25
30
  /**
26
31
  * @inheritdoc
27
32
  */
28
- declare class MockDaffAuthLoginFacade implements DaffAuthLoginFacadeInterface {
29
- loading$: BehaviorSubject<boolean>;
30
- errors$: BehaviorSubject<DaffStateError[]>;
31
- dispatch(action: Action): void;
32
- static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffAuthLoginFacade, never>;
33
- static ɵprov: i0.ɵɵInjectableDeclaration<MockDaffAuthLoginFacade>;
33
+ export declare class MockDaffAuthLoginFacade implements DaffAuthLoginFacadeInterface {
34
+ loading$: BehaviorSubject<boolean>;
35
+ errors$: BehaviorSubject<DaffStateError[]>;
36
+ dispatch(action: Action): void;
37
+ static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffAuthLoginFacade, never>;
38
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
34
39
  }
35
-
36
40
  /**
37
41
  * @inheritdoc
38
42
  */
39
- declare class MockDaffAuthRegisterFacade implements DaffAuthRegisterFacadeInterface {
40
- loading$: BehaviorSubject<boolean>;
41
- errors$: BehaviorSubject<DaffStateError[]>;
42
- dispatch(action: Action): void;
43
- static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffAuthRegisterFacade, never>;
44
- static ɵprov: i0.ɵɵInjectableDeclaration<MockDaffAuthRegisterFacade>;
43
+ export declare class MockDaffAuthRegisterFacade implements DaffAuthRegisterFacadeInterface {
44
+ loading$: BehaviorSubject<boolean>;
45
+ errors$: BehaviorSubject<DaffStateError[]>;
46
+ dispatch(action: Action): void;
47
+ static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffAuthRegisterFacade, never>;
48
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
45
49
  }
46
-
47
50
  /**
48
51
  * @inheritdoc
49
52
  */
50
- declare class MockDaffAuthResetPasswordFacade implements DaffAuthResetPasswordFacadeInterface {
51
- token$: BehaviorSubject<string>;
52
- loading$: BehaviorSubject<boolean>;
53
- errors$: BehaviorSubject<DaffStateError[]>;
54
- dispatch(action: Action): void;
55
- static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffAuthResetPasswordFacade, never>;
56
- static ɵprov: i0.ɵɵInjectableDeclaration<MockDaffAuthResetPasswordFacade>;
57
- }
58
-
59
- export { DaffAuthStateTestingModule, MockDaffAuthFacade, MockDaffAuthLoginFacade, MockDaffAuthRegisterFacade, MockDaffAuthResetPasswordFacade };
53
+ export declare class MockDaffAuthResetPasswordFacade implements DaffAuthResetPasswordFacadeInterface {
54
+ token$: BehaviorSubject<string>;
55
+ loading$: BehaviorSubject<boolean>;
56
+ errors$: BehaviorSubject<DaffStateError[]>;
57
+ dispatch(action: Action): void;
58
+ static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffAuthResetPasswordFacade, never>;
59
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
60
+ }