@daffodil/auth 0.94.1 → 0.95.1

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,424 +1,383 @@
1
- import * as _ngrx_store from '@ngrx/store';
2
- import { Action, ActionReducer, ActionReducerMap, MemoizedSelector, Store } from '@ngrx/store';
3
- import * as _daffodil_core_state from '@daffodil/core/state';
4
- import { DaffStateError, DaffOperationState, DaffOperationStateSelectors, DaffStoreFacade, daffTransformErrorToStateError } from '@daffodil/core/state';
5
- import { DaffLoginInfo, DaffAuthToken, DaffAccountRegistration, DaffAuthResetPasswordInfo } from '@daffodil/auth';
6
- import * as i0 from '@angular/core';
7
- import { ModuleWithProviders } from '@angular/core';
8
- import { Observable } from 'rxjs';
9
- import * as i2 from '@ngrx/effects';
10
-
11
- declare enum DaffAuthActionTypes {
12
- ResetToUnauthenticatedAction = "[@daffodil/auth] Reset To Unauthenticated Action",
13
- AuthStorageFailureAction = "[@daffodil/auth] Auth Storage Failure Action",
14
- AuthGuardLogoutAction = "[@daffodil/auth] Auth Guard Logout Action",
15
- AuthServerSideAction = "[@daffodil/auth] Auth Server Side Action",
16
- AuthCheckAction = "[@daffodil/auth] Auth Check Action",
17
- AuthCheckSuccessAction = "[@daffodil/auth] Auth Check Success Action",
18
- AuthCheckFailureAction = "[@daffodil/auth] Auth Check Failure Action"
19
- }
20
- declare class DaffAuthResetToUnauthenticated implements Action {
21
- reason: Action['type'];
22
- readonly type = DaffAuthActionTypes.ResetToUnauthenticatedAction;
23
- constructor(reason: Action['type']);
24
- }
25
- declare class DaffAuthStorageFailure implements Action {
26
- errorMessage: DaffStateError;
27
- readonly type = DaffAuthActionTypes.AuthStorageFailureAction;
28
- constructor(errorMessage: DaffStateError);
29
- }
30
- declare class DaffAuthGuardLogout implements Action {
31
- errorMessage: DaffStateError;
32
- readonly type = DaffAuthActionTypes.AuthGuardLogoutAction;
33
- constructor(errorMessage: DaffStateError);
34
- }
35
- declare class DaffAuthServerSide implements Action {
36
- errorMessage: DaffStateError;
37
- readonly type = DaffAuthActionTypes.AuthServerSideAction;
38
- constructor(errorMessage: DaffStateError);
1
+ import * as i1 from "@ngrx/store";
2
+ import { Action, ActionReducer, ActionReducerMap, MemoizedSelector, Store } from "@ngrx/store";
3
+ import { DaffOperationState, DaffOperationStateSelectors, DaffStateError, DaffStoreFacade, daffTransformErrorToStateError } from "@daffodil/core/state";
4
+ import { DaffAccountRegistration, DaffAuthResetPasswordInfo, DaffAuthToken, DaffLoginInfo } from "@daffodil/auth";
5
+ import { Observable } from "rxjs";
6
+ import * as i0 from "@angular/core";
7
+ import { EnvironmentProviders, ModuleWithProviders } from "@angular/core";
8
+ import * as i2 from "@ngrx/effects";
9
+ export declare enum DaffAuthActionTypes {
10
+ ResetToUnauthenticatedAction = "[@daffodil/auth] Reset To Unauthenticated Action",
11
+ AuthStorageFailureAction = "[@daffodil/auth] Auth Storage Failure Action",
12
+ AuthGuardLogoutAction = "[@daffodil/auth] Auth Guard Logout Action",
13
+ AuthServerSideAction = "[@daffodil/auth] Auth Server Side Action",
14
+ AuthCheckAction = "[@daffodil/auth] Auth Check Action",
15
+ AuthCheckSuccessAction = "[@daffodil/auth] Auth Check Success Action",
16
+ AuthCheckFailureAction = "[@daffodil/auth] Auth Check Failure Action"
17
+ }
18
+ export declare class DaffAuthResetToUnauthenticated implements Action {
19
+ reason: Action['type'];
20
+ readonly type = DaffAuthActionTypes.ResetToUnauthenticatedAction;
21
+ constructor(reason: Action['type']);
22
+ }
23
+ export declare class DaffAuthStorageFailure implements Action {
24
+ errorMessage: DaffStateError;
25
+ readonly type = DaffAuthActionTypes.AuthStorageFailureAction;
26
+ constructor(errorMessage: DaffStateError);
27
+ }
28
+ export declare class DaffAuthGuardLogout implements Action {
29
+ errorMessage: DaffStateError;
30
+ readonly type = DaffAuthActionTypes.AuthGuardLogoutAction;
31
+ constructor(errorMessage: DaffStateError);
32
+ }
33
+ export declare class DaffAuthServerSide implements Action {
34
+ errorMessage: DaffStateError;
35
+ readonly type = DaffAuthActionTypes.AuthServerSideAction;
36
+ constructor(errorMessage: DaffStateError);
39
37
  }
40
38
  /**
41
39
  * An action triggered to initialize an auth check request.
42
40
  */
43
- declare class DaffAuthCheck implements Action {
44
- readonly type = DaffAuthActionTypes.AuthCheckAction;
41
+ export declare class DaffAuthCheck implements Action {
42
+ readonly type = DaffAuthActionTypes.AuthCheckAction;
45
43
  }
46
44
  /**
47
45
  * An action triggered upon a successful auth check.
48
46
  *
49
47
  * @param token - the customer access token
50
48
  */
51
- declare class DaffAuthCheckSuccess implements Action {
52
- readonly type = DaffAuthActionTypes.AuthCheckSuccessAction;
49
+ export declare class DaffAuthCheckSuccess implements Action {
50
+ readonly type = DaffAuthActionTypes.AuthCheckSuccessAction;
53
51
  }
54
52
  /**
55
53
  * An action triggered upon a failed auth check request.
56
54
  *
57
55
  * @param errorMessage - an error message
58
56
  */
59
- declare class DaffAuthCheckFailure implements Action {
60
- errorMessage: DaffStateError;
61
- readonly type = DaffAuthActionTypes.AuthCheckFailureAction;
62
- constructor(errorMessage: DaffStateError);
63
- }
64
- type DaffAuthActions = DaffAuthResetToUnauthenticated | DaffAuthStorageFailure | DaffAuthGuardLogout | DaffAuthServerSide | DaffAuthCheck | DaffAuthCheckSuccess | DaffAuthCheckFailure;
65
-
66
- declare enum DaffAuthLoginActionTypes {
67
- LoginAction = "[@daffodil/auth] Login Action",
68
- LoginSuccessAction = "[@daffodil/auth] Login Success Action",
69
- LoginFailureAction = "[@daffodil/auth] Login Failure Action",
70
- LogoutAction = "[@daffodil/auth] Logout Action",
71
- LogoutSuccessAction = "[@daffodil/auth] Logout Success Action",
72
- LogoutFailureAction = "[@daffodil/auth] Logout Failure Action"
57
+ export declare class DaffAuthCheckFailure implements Action {
58
+ errorMessage: DaffStateError;
59
+ readonly type = DaffAuthActionTypes.AuthCheckFailureAction;
60
+ constructor(errorMessage: DaffStateError);
61
+ }
62
+ export type DaffAuthActions = DaffAuthResetToUnauthenticated | DaffAuthStorageFailure | DaffAuthGuardLogout | DaffAuthServerSide | DaffAuthCheck | DaffAuthCheckSuccess | DaffAuthCheckFailure;
63
+ export declare enum DaffAuthLoginActionTypes {
64
+ LoginAction = "[@daffodil/auth] Login Action",
65
+ LoginSuccessAction = "[@daffodil/auth] Login Success Action",
66
+ LoginFailureAction = "[@daffodil/auth] Login Failure Action",
67
+ LogoutAction = "[@daffodil/auth] Logout Action",
68
+ LogoutSuccessAction = "[@daffodil/auth] Logout Success Action",
69
+ LogoutFailureAction = "[@daffodil/auth] Logout Failure Action"
73
70
  }
74
71
  /**
75
72
  * An action triggered to initialize a auth login request.
76
73
  */
77
- declare class DaffAuthLogin<T extends DaffLoginInfo = DaffLoginInfo> implements Action {
78
- loginInfo: T;
79
- readonly type = DaffAuthLoginActionTypes.LoginAction;
80
- constructor(loginInfo: T);
74
+ export declare class DaffAuthLogin<T extends DaffLoginInfo = DaffLoginInfo> implements Action {
75
+ loginInfo: T;
76
+ readonly type = DaffAuthLoginActionTypes.LoginAction;
77
+ constructor(loginInfo: T);
81
78
  }
82
79
  /**
83
80
  * An action triggered upon a successful auth login.
84
81
  *
85
82
  * @param token - the customer access token
86
83
  */
87
- declare class DaffAuthLoginSuccess<T extends DaffAuthToken = DaffAuthToken> implements Action {
88
- auth: T;
89
- readonly type = DaffAuthLoginActionTypes.LoginSuccessAction;
90
- constructor(auth: T);
84
+ export declare class DaffAuthLoginSuccess<T extends DaffAuthToken = DaffAuthToken> implements Action {
85
+ auth: T;
86
+ readonly type = DaffAuthLoginActionTypes.LoginSuccessAction;
87
+ constructor(auth: T);
91
88
  }
92
89
  /**
93
90
  * An action triggered upon a failed auth login request.
94
91
  *
95
92
  * @param errorMessage - an error message
96
93
  */
97
- declare class DaffAuthLoginFailure implements Action {
98
- errorMessage: DaffStateError;
99
- readonly type = DaffAuthLoginActionTypes.LoginFailureAction;
100
- constructor(errorMessage: DaffStateError);
94
+ export declare class DaffAuthLoginFailure implements Action {
95
+ errorMessage: DaffStateError;
96
+ readonly type = DaffAuthLoginActionTypes.LoginFailureAction;
97
+ constructor(errorMessage: DaffStateError);
101
98
  }
102
99
  /**
103
100
  * An action triggered to initialize a logout request.
104
101
  */
105
- declare class DaffAuthLogout implements Action {
106
- readonly type = DaffAuthLoginActionTypes.LogoutAction;
102
+ export declare class DaffAuthLogout implements Action {
103
+ readonly type = DaffAuthLoginActionTypes.LogoutAction;
107
104
  }
108
105
  /**
109
106
  * An action triggered upon a successful logout.
110
107
  *
111
108
  * @param token - the customer access token
112
109
  */
113
- declare class DaffAuthLogoutSuccess implements Action {
114
- readonly type = DaffAuthLoginActionTypes.LogoutSuccessAction;
110
+ export declare class DaffAuthLogoutSuccess implements Action {
111
+ readonly type = DaffAuthLoginActionTypes.LogoutSuccessAction;
115
112
  }
116
113
  /**
117
114
  * An action triggered upon a failed logout request.
118
115
  *
119
116
  * @param errorMessage - an error message
120
117
  */
121
- declare class DaffAuthLogoutFailure implements Action {
122
- errorMessage: DaffStateError;
123
- readonly type = DaffAuthLoginActionTypes.LogoutFailureAction;
124
- constructor(errorMessage: DaffStateError);
125
- }
126
- type DaffAuthLoginActions<T extends DaffLoginInfo = DaffLoginInfo, U extends DaffAuthToken = DaffAuthToken> = DaffAuthLogin<T> | DaffAuthLoginSuccess<U> | DaffAuthLoginFailure | DaffAuthLogout | DaffAuthLogoutSuccess | DaffAuthLogoutFailure;
127
-
128
- declare enum DaffAuthRegisterActionTypes {
129
- RegisterAction = "[@daffodil/auth] Register Action",
130
- RegisterSuccessAction = "[@daffodil/auth] Register Success Action",
131
- RegisterFailureAction = "[@daffodil/auth] Register Failure Action"
118
+ export declare class DaffAuthLogoutFailure implements Action {
119
+ errorMessage: DaffStateError;
120
+ readonly type = DaffAuthLoginActionTypes.LogoutFailureAction;
121
+ constructor(errorMessage: DaffStateError);
122
+ }
123
+ export type DaffAuthLoginActions<T extends DaffLoginInfo = DaffLoginInfo, U extends DaffAuthToken = DaffAuthToken> = DaffAuthLogin<T> | DaffAuthLoginSuccess<U> | DaffAuthLoginFailure | DaffAuthLogout | DaffAuthLogoutSuccess | DaffAuthLogoutFailure;
124
+ export declare enum DaffAuthRegisterActionTypes {
125
+ RegisterAction = "[@daffodil/auth] Register Action",
126
+ RegisterSuccessAction = "[@daffodil/auth] Register Success Action",
127
+ RegisterFailureAction = "[@daffodil/auth] Register Failure Action"
132
128
  }
133
129
  /**
134
130
  * An action triggered to initialize a auth register request.
135
131
  *
136
132
  * @param registration
137
133
  */
138
- declare class DaffAuthRegister<T extends DaffAccountRegistration = DaffAccountRegistration> implements Action {
139
- registration: T;
140
- autoLogin: boolean;
141
- readonly type = DaffAuthRegisterActionTypes.RegisterAction;
142
- constructor(registration: T, autoLogin?: boolean);
134
+ export declare class DaffAuthRegister<T extends DaffAccountRegistration = DaffAccountRegistration> implements Action {
135
+ registration: T;
136
+ autoLogin: boolean;
137
+ readonly type = DaffAuthRegisterActionTypes.RegisterAction;
138
+ constructor(registration: T, autoLogin?: boolean);
143
139
  }
144
140
  /**
145
141
  * An action triggered upon a successful auth register request.
146
142
  *
147
143
  * @param token - the customer access token
148
144
  */
149
- declare class DaffAuthRegisterSuccess implements Action {
150
- token?: string;
151
- readonly type = DaffAuthRegisterActionTypes.RegisterSuccessAction;
152
- constructor(token?: string);
145
+ export declare class DaffAuthRegisterSuccess implements Action {
146
+ token?: string;
147
+ readonly type = DaffAuthRegisterActionTypes.RegisterSuccessAction;
148
+ constructor(token?: string);
153
149
  }
154
150
  /**
155
151
  * An action triggered upon a failed auth request.
156
152
  *
157
153
  * @param errorMessage - an error message
158
154
  */
159
- declare class DaffAuthRegisterFailure implements Action {
160
- errorMessage: DaffStateError;
161
- readonly type = DaffAuthRegisterActionTypes.RegisterFailureAction;
162
- constructor(errorMessage: DaffStateError);
163
- }
164
- type DaffAuthRegisterActions<T extends DaffAccountRegistration = DaffAccountRegistration> = DaffAuthRegister<T> | DaffAuthRegisterSuccess | DaffAuthRegisterFailure;
165
-
166
- declare enum DaffAuthResetPasswordActionTypes {
167
- SendResetEmailAction = "[@daffodil/auth] Send Reset Email Action",
168
- SendResetEmailSuccessAction = "[@daffodil/auth] Send Reset Email Success Action",
169
- SendResetEmailFailureAction = "[@daffodil/auth] Send Reset Email Failure Action",
170
- ResetPasswordAction = "[@daffodil/auth] Reset Password Action",
171
- ResetPasswordSuccessAction = "[@daffodil/auth] Reset Password Success Action",
172
- ResetPasswordFailureAction = "[@daffodil/auth] Reset Password Failure Action",
173
- ResetPasswordLandingAction = "[@daffodil/auth] Reset Password Landing Action"
155
+ export declare class DaffAuthRegisterFailure implements Action {
156
+ errorMessage: DaffStateError;
157
+ readonly type = DaffAuthRegisterActionTypes.RegisterFailureAction;
158
+ constructor(errorMessage: DaffStateError);
159
+ }
160
+ export type DaffAuthRegisterActions<T extends DaffAccountRegistration = DaffAccountRegistration> = DaffAuthRegister<T> | DaffAuthRegisterSuccess | DaffAuthRegisterFailure;
161
+ export declare enum DaffAuthResetPasswordActionTypes {
162
+ SendResetEmailAction = "[@daffodil/auth] Send Reset Email Action",
163
+ SendResetEmailSuccessAction = "[@daffodil/auth] Send Reset Email Success Action",
164
+ SendResetEmailFailureAction = "[@daffodil/auth] Send Reset Email Failure Action",
165
+ ResetPasswordAction = "[@daffodil/auth] Reset Password Action",
166
+ ResetPasswordSuccessAction = "[@daffodil/auth] Reset Password Success Action",
167
+ ResetPasswordFailureAction = "[@daffodil/auth] Reset Password Failure Action",
168
+ ResetPasswordLandingAction = "[@daffodil/auth] Reset Password Landing Action"
174
169
  }
175
170
  /**
176
171
  * An action triggered to send the specified customer an email to reset their password.
177
172
  */
178
- declare class DaffSendResetEmail implements Action {
179
- email: string;
180
- readonly type = DaffAuthResetPasswordActionTypes.SendResetEmailAction;
181
- constructor(email: string);
173
+ export declare class DaffSendResetEmail implements Action {
174
+ email: string;
175
+ readonly type = DaffAuthResetPasswordActionTypes.SendResetEmailAction;
176
+ constructor(email: string);
182
177
  }
183
178
  /**
184
179
  * An action triggered upon a successfully sent reset password email.
185
180
  */
186
- declare class DaffSendResetEmailSuccess implements Action {
187
- readonly type = DaffAuthResetPasswordActionTypes.SendResetEmailSuccessAction;
181
+ export declare class DaffSendResetEmailSuccess implements Action {
182
+ readonly type = DaffAuthResetPasswordActionTypes.SendResetEmailSuccessAction;
188
183
  }
189
184
  /**
190
185
  * An action triggered upon a failure to send the reset password email.
191
186
  *
192
187
  * @param errorMessage - an error message
193
188
  */
194
- declare class DaffSendResetEmailFailure implements Action {
195
- errorMessage: DaffStateError;
196
- readonly type = DaffAuthResetPasswordActionTypes.SendResetEmailFailureAction;
197
- constructor(errorMessage: DaffStateError);
189
+ export declare class DaffSendResetEmailFailure implements Action {
190
+ errorMessage: DaffStateError;
191
+ readonly type = DaffAuthResetPasswordActionTypes.SendResetEmailFailureAction;
192
+ constructor(errorMessage: DaffStateError);
198
193
  }
199
194
  /**
200
195
  * An action triggered to initialize a logout request.
201
196
  */
202
- declare class DaffResetPassword<T extends DaffAuthResetPasswordInfo = DaffAuthResetPasswordInfo> implements Action {
203
- info: T;
204
- autoLogin: boolean;
205
- readonly type = DaffAuthResetPasswordActionTypes.ResetPasswordAction;
206
- constructor(info: T, autoLogin?: boolean);
197
+ export declare class DaffResetPassword<T extends DaffAuthResetPasswordInfo = DaffAuthResetPasswordInfo> implements Action {
198
+ info: T;
199
+ autoLogin: boolean;
200
+ readonly type = DaffAuthResetPasswordActionTypes.ResetPasswordAction;
201
+ constructor(info: T, autoLogin?: boolean);
207
202
  }
208
203
  /**
209
204
  * An action triggered upon a successful logout.
210
205
  */
211
- declare class DaffResetPasswordSuccess implements Action {
212
- token?: string;
213
- readonly type = DaffAuthResetPasswordActionTypes.ResetPasswordSuccessAction;
214
- constructor(token?: string);
206
+ export declare class DaffResetPasswordSuccess implements Action {
207
+ token?: string;
208
+ readonly type = DaffAuthResetPasswordActionTypes.ResetPasswordSuccessAction;
209
+ constructor(token?: string);
215
210
  }
216
211
  /**
217
212
  * An action triggered upon a failed logout request.
218
213
  *
219
214
  * @param errorMessage - an error message
220
215
  */
221
- declare class DaffResetPasswordFailure implements Action {
222
- errorMessage: DaffStateError;
223
- readonly type = DaffAuthResetPasswordActionTypes.ResetPasswordFailureAction;
224
- constructor(errorMessage: DaffStateError);
216
+ export declare class DaffResetPasswordFailure implements Action {
217
+ errorMessage: DaffStateError;
218
+ readonly type = DaffAuthResetPasswordActionTypes.ResetPasswordFailureAction;
219
+ constructor(errorMessage: DaffStateError);
225
220
  }
226
221
  /**
227
222
  * An action triggered upon the user navigating to the reset password page from the link in their email.
228
223
  *
229
224
  * @param token - The token with which the password can be reset
230
225
  */
231
- declare class DaffResetPasswordLanding implements Action {
232
- token: DaffAuthResetPasswordInfo['token'];
233
- readonly type = DaffAuthResetPasswordActionTypes.ResetPasswordLandingAction;
234
- constructor(token: DaffAuthResetPasswordInfo['token']);
235
- }
236
- type DaffAuthResetPasswordActions<T extends DaffAuthResetPasswordInfo = DaffAuthResetPasswordInfo> = DaffSendResetEmail | DaffSendResetEmailSuccess | DaffSendResetEmailFailure | DaffResetPassword<T> | DaffResetPasswordSuccess | DaffResetPasswordFailure | DaffResetPasswordLanding;
237
-
238
- interface DaffAuthReducerState extends DaffOperationState {
239
- loggedIn: boolean;
240
- }
241
-
242
- declare function daffAuthReducer(state: DaffAuthReducerState, action: DaffAuthActions | DaffAuthLoginActions | DaffAuthRegisterSuccess | DaffAuthResetPasswordActions): DaffAuthReducerState;
243
-
244
- declare const daffAuthInitialState: DaffAuthReducerState;
245
-
246
- type DaffAuthLoginReducerState = DaffOperationState;
247
-
248
- declare function daffAuthLoginReducer<T extends DaffLoginInfo, U extends DaffAuthToken>(state: _daffodil_core_state.DaffOperationState, action: DaffAuthLoginActions<T, U>): DaffAuthLoginReducerState;
249
-
250
- declare const daffAuthLoginInitialState: DaffAuthLoginReducerState;
251
-
252
- type DaffAuthRegisterReducerState = DaffOperationState;
253
-
254
- declare function daffAuthRegisterReducer<T extends DaffAccountRegistration>(state: _daffodil_core_state.DaffOperationState, action: DaffAuthRegisterActions<T>): DaffAuthRegisterReducerState;
255
-
256
- declare const daffAuthRegisterInitialState: DaffAuthRegisterReducerState;
257
-
258
- interface DaffAuthResetPasswordReducerState extends DaffOperationState {
259
- token: DaffAuthResetPasswordInfo['token'];
260
- }
261
-
262
- declare function daffAuthResetPasswordReducer<T extends DaffAuthResetPasswordInfo = DaffAuthResetPasswordInfo>(state: DaffAuthResetPasswordReducerState, action: DaffAuthResetPasswordActions<T>): DaffAuthResetPasswordReducerState;
263
-
264
- declare const daffAuthResetPasswordInitialState: DaffAuthResetPasswordReducerState;
265
-
266
- declare const DAFF_AUTH_STORE_FEATURE_KEY = "daffAuth";
267
-
268
- interface DaffAuthFeatureState {
269
- auth: DaffAuthReducerState;
270
- login: DaffAuthLoginReducerState;
271
- register: DaffAuthRegisterReducerState;
272
- resetPassword: DaffAuthResetPasswordReducerState;
273
- }
274
- interface DaffAuthStateRootSlice {
275
- [DAFF_AUTH_STORE_FEATURE_KEY]: DaffAuthFeatureState;
276
- }
277
-
278
- declare const DAFF_AUTH_EXTRA_REDUCERS: i0.InjectionToken<ActionReducer<DaffAuthFeatureState, _ngrx_store.Action<string>>[]>;
279
- declare const daffAuthProvideExtraReducers: <R extends ActionReducer<DaffAuthFeatureState, _ngrx_store.Action<string>> = ActionReducer<DaffAuthFeatureState, _ngrx_store.Action<string>>>(...values: R[]) => Array<i0.ValueProvider>;
280
-
281
- declare const daffAuthReducers: ActionReducerMap<DaffAuthFeatureState>;
282
-
283
- interface AuthSelectors extends DaffOperationStateSelectors<DaffAuthStateRootSlice, DaffAuthReducerState> {
284
- selectAuthState: MemoizedSelector<DaffAuthStateRootSlice, DaffAuthReducerState>;
285
- selectAuthLoggedIn: MemoizedSelector<DaffAuthStateRootSlice, boolean>;
286
- }
287
- declare const daffAuthSelectorFactory: () => AuthSelectors;
288
-
289
- interface DaffAuthLoginSelectors extends DaffOperationStateSelectors<DaffAuthStateRootSlice, DaffAuthLoginReducerState> {
290
- selectAuthLoginState: MemoizedSelector<DaffAuthStateRootSlice, DaffAuthLoginReducerState>;
291
- }
292
- declare const daffAuthLoginSelectorFactory: () => DaffAuthLoginSelectors;
293
-
294
- interface DaffAuthRegisterSelectors extends DaffOperationStateSelectors<DaffAuthStateRootSlice, DaffAuthRegisterReducerState> {
295
- selectAuthRegisterState: MemoizedSelector<DaffAuthStateRootSlice, DaffAuthRegisterReducerState>;
296
- }
297
- declare const daffAuthRegisterSelectorFactory: () => DaffAuthRegisterSelectors;
298
-
299
- interface DaffAuthResetPasswordSelectors extends DaffOperationStateSelectors<DaffAuthStateRootSlice, DaffAuthResetPasswordReducerState> {
300
- selectAuthResetPasswordState: MemoizedSelector<DaffAuthStateRootSlice, DaffAuthResetPasswordReducerState>;
301
- selectAuthResetPasswordToken: MemoizedSelector<DaffAuthStateRootSlice, DaffAuthResetPasswordInfo['token']>;
302
- }
303
- declare const daffAuthResetPasswordSelectorFactory: () => DaffAuthResetPasswordSelectors;
304
-
305
- interface DaffAuthSelectors extends DaffAuthRegisterSelectors, DaffAuthLoginSelectors, DaffAuthResetPasswordSelectors, AuthSelectors {
306
- selectAuthFeatureState: MemoizedSelector<Record<string, any>, DaffAuthFeatureState>;
307
- }
308
- declare const getDaffAuthSelectors: () => DaffAuthSelectors;
309
-
310
- interface DaffAuthFacadeInterface extends DaffStoreFacade<Action> {
311
- loading$: Observable<boolean>;
312
- errors$: Observable<DaffStateError[]>;
313
- /**
314
- * Whether the current user is logged in.
315
- */
316
- loggedIn$: Observable<boolean>;
317
- }
318
-
226
+ export declare class DaffResetPasswordLanding implements Action {
227
+ token: DaffAuthResetPasswordInfo['token'];
228
+ readonly type = DaffAuthResetPasswordActionTypes.ResetPasswordLandingAction;
229
+ constructor(token: DaffAuthResetPasswordInfo['token']);
230
+ }
231
+ export type DaffAuthResetPasswordActions<T extends DaffAuthResetPasswordInfo = DaffAuthResetPasswordInfo> = DaffSendResetEmail | DaffSendResetEmailSuccess | DaffSendResetEmailFailure | DaffResetPassword<T> | DaffResetPasswordSuccess | DaffResetPasswordFailure | DaffResetPasswordLanding;
232
+ export interface DaffAuthReducerState extends DaffOperationState {
233
+ loggedIn: boolean;
234
+ }
235
+ export declare function daffAuthReducer(state: DaffAuthReducerState, action: DaffAuthActions | DaffAuthLoginActions | DaffAuthRegisterSuccess | DaffAuthResetPasswordActions): DaffAuthReducerState;
236
+ export declare const daffAuthInitialState: DaffAuthReducerState;
237
+ export type DaffAuthLoginReducerState = DaffOperationState;
238
+ export declare function daffAuthLoginReducer<T extends DaffLoginInfo, U extends DaffAuthToken>(state: import("@daffodil/core/state").DaffOperationState, action: DaffAuthLoginActions<T, U>): DaffAuthLoginReducerState;
239
+ export declare const daffAuthLoginInitialState: DaffAuthLoginReducerState;
240
+ export type DaffAuthRegisterReducerState = DaffOperationState;
241
+ export declare function daffAuthRegisterReducer<T extends DaffAccountRegistration>(state: import("@daffodil/core/state").DaffOperationState, action: DaffAuthRegisterActions<T>): DaffAuthRegisterReducerState;
242
+ export declare const daffAuthRegisterInitialState: DaffAuthRegisterReducerState;
243
+ export interface DaffAuthResetPasswordReducerState extends DaffOperationState {
244
+ token: DaffAuthResetPasswordInfo['token'];
245
+ }
246
+ export declare function daffAuthResetPasswordReducer<T extends DaffAuthResetPasswordInfo = DaffAuthResetPasswordInfo>(state: DaffAuthResetPasswordReducerState, action: DaffAuthResetPasswordActions<T>): DaffAuthResetPasswordReducerState;
247
+ export declare const daffAuthResetPasswordInitialState: DaffAuthResetPasswordReducerState;
248
+ export declare const DAFF_AUTH_STORE_FEATURE_KEY = "daffAuth";
249
+ export interface DaffAuthFeatureState {
250
+ auth: DaffAuthReducerState;
251
+ login: DaffAuthLoginReducerState;
252
+ register: DaffAuthRegisterReducerState;
253
+ resetPassword: DaffAuthResetPasswordReducerState;
254
+ }
255
+ export interface DaffAuthStateRootSlice {
256
+ [DAFF_AUTH_STORE_FEATURE_KEY]: DaffAuthFeatureState;
257
+ }
258
+ export declare const DAFF_AUTH_EXTRA_REDUCERS: import("@angular/core").InjectionToken<ActionReducer<DaffAuthFeatureState, import("@ngrx/store").Action<string>>[]>, daffAuthProvideExtraReducers: <R extends ActionReducer<DaffAuthFeatureState, import("@ngrx/store").Action<string>> = ActionReducer<DaffAuthFeatureState, import("@ngrx/store").Action<string>>>(...values: R[]) => Array<import("@angular/core").ValueProvider>;
259
+ export declare const daffAuthReducers: ActionReducerMap<DaffAuthFeatureState>;
260
+ export interface AuthSelectors extends DaffOperationStateSelectors<DaffAuthStateRootSlice, DaffAuthReducerState> {
261
+ selectAuthState: MemoizedSelector<DaffAuthStateRootSlice, DaffAuthReducerState>;
262
+ selectAuthLoggedIn: MemoizedSelector<DaffAuthStateRootSlice, boolean>;
263
+ }
264
+ export declare const daffAuthSelectorFactory: () => AuthSelectors;
265
+ export interface DaffAuthLoginSelectors extends DaffOperationStateSelectors<DaffAuthStateRootSlice, DaffAuthLoginReducerState> {
266
+ selectAuthLoginState: MemoizedSelector<DaffAuthStateRootSlice, DaffAuthLoginReducerState>;
267
+ }
268
+ export declare const daffAuthLoginSelectorFactory: () => DaffAuthLoginSelectors;
269
+ export interface DaffAuthRegisterSelectors extends DaffOperationStateSelectors<DaffAuthStateRootSlice, DaffAuthRegisterReducerState> {
270
+ selectAuthRegisterState: MemoizedSelector<DaffAuthStateRootSlice, DaffAuthRegisterReducerState>;
271
+ }
272
+ export declare const daffAuthRegisterSelectorFactory: () => DaffAuthRegisterSelectors;
273
+ export interface DaffAuthResetPasswordSelectors extends DaffOperationStateSelectors<DaffAuthStateRootSlice, DaffAuthResetPasswordReducerState> {
274
+ selectAuthResetPasswordState: MemoizedSelector<DaffAuthStateRootSlice, DaffAuthResetPasswordReducerState>;
275
+ selectAuthResetPasswordToken: MemoizedSelector<DaffAuthStateRootSlice, DaffAuthResetPasswordInfo['token']>;
276
+ }
277
+ export declare const daffAuthResetPasswordSelectorFactory: () => DaffAuthResetPasswordSelectors;
278
+ export interface DaffAuthSelectors extends DaffAuthRegisterSelectors, DaffAuthLoginSelectors, DaffAuthResetPasswordSelectors, AuthSelectors {
279
+ selectAuthFeatureState: MemoizedSelector<Record<string, any>, DaffAuthFeatureState>;
280
+ }
281
+ export declare const getDaffAuthSelectors: () => DaffAuthSelectors;
282
+ export interface DaffAuthFacadeInterface extends DaffStoreFacade<Action> {
283
+ loading$: Observable<boolean>;
284
+ errors$: Observable<DaffStateError[]>;
285
+ /**
286
+ * Whether the current user is logged in.
287
+ */
288
+ loggedIn$: Observable<boolean>;
289
+ }
319
290
  /**
320
291
  * @inheritdoc
321
292
  */
322
- declare class DaffAuthFacade implements DaffAuthFacadeInterface {
323
- private store;
324
- loading$: Observable<boolean>;
325
- errors$: Observable<DaffStateError[]>;
326
- loggedIn$: Observable<boolean>;
327
- constructor(store: Store<DaffAuthStateRootSlice>);
328
- dispatch(action: Action): void;
329
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthFacade, never>;
330
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffAuthFacade>;
331
- }
332
-
333
- interface DaffAuthLoginFacadeInterface extends DaffStoreFacade<Action> {
334
- loading$: Observable<boolean>;
335
- errors$: Observable<DaffStateError[]>;
336
- }
337
-
293
+ export declare class DaffAuthFacade implements DaffAuthFacadeInterface {
294
+ private store;
295
+ loading$: Observable<boolean>;
296
+ errors$: Observable<DaffStateError[]>;
297
+ loggedIn$: Observable<boolean>;
298
+ constructor(store: Store<DaffAuthStateRootSlice>);
299
+ dispatch(action: Action): void;
300
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthFacade, never>;
301
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
302
+ }
303
+ export interface DaffAuthLoginFacadeInterface extends DaffStoreFacade<Action> {
304
+ loading$: Observable<boolean>;
305
+ errors$: Observable<DaffStateError[]>;
306
+ }
338
307
  /**
339
308
  * @inheritdoc
340
309
  */
341
- declare class DaffAuthLoginFacade implements DaffAuthLoginFacadeInterface {
342
- private store;
343
- loading$: Observable<boolean>;
344
- errors$: Observable<DaffStateError[]>;
345
- constructor(store: Store<DaffAuthStateRootSlice>);
346
- dispatch(action: Action): void;
347
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthLoginFacade, never>;
348
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffAuthLoginFacade>;
349
- }
350
-
351
- interface DaffAuthRegisterFacadeInterface extends DaffStoreFacade<Action> {
352
- loading$: Observable<boolean>;
353
- errors$: Observable<DaffStateError[]>;
354
- }
355
-
310
+ export declare class DaffAuthLoginFacade implements DaffAuthLoginFacadeInterface {
311
+ private store;
312
+ loading$: Observable<boolean>;
313
+ errors$: Observable<DaffStateError[]>;
314
+ constructor(store: Store<DaffAuthStateRootSlice>);
315
+ dispatch(action: Action): void;
316
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthLoginFacade, never>;
317
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
318
+ }
319
+ export interface DaffAuthRegisterFacadeInterface extends DaffStoreFacade<Action> {
320
+ loading$: Observable<boolean>;
321
+ errors$: Observable<DaffStateError[]>;
322
+ }
356
323
  /**
357
324
  * @inheritdoc
358
325
  */
359
- declare class DaffAuthRegisterFacade implements DaffAuthRegisterFacadeInterface {
360
- private store;
361
- loading$: Observable<boolean>;
362
- errors$: Observable<DaffStateError[]>;
363
- constructor(store: Store<DaffAuthStateRootSlice>);
364
- dispatch(action: Action): void;
365
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthRegisterFacade, never>;
366
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffAuthRegisterFacade>;
367
- }
368
-
369
- interface DaffAuthResetPasswordFacadeInterface extends DaffStoreFacade<Action> {
370
- token$: Observable<DaffAuthResetPasswordInfo['token']>;
371
- loading$: Observable<boolean>;
372
- errors$: Observable<DaffStateError[]>;
373
- }
374
-
326
+ export declare class DaffAuthRegisterFacade implements DaffAuthRegisterFacadeInterface {
327
+ private store;
328
+ loading$: Observable<boolean>;
329
+ errors$: Observable<DaffStateError[]>;
330
+ constructor(store: Store<DaffAuthStateRootSlice>);
331
+ dispatch(action: Action): void;
332
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthRegisterFacade, never>;
333
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
334
+ }
335
+ export interface DaffAuthResetPasswordFacadeInterface extends DaffStoreFacade<Action> {
336
+ token$: Observable<DaffAuthResetPasswordInfo['token']>;
337
+ loading$: Observable<boolean>;
338
+ errors$: Observable<DaffStateError[]>;
339
+ }
375
340
  /**
376
341
  * @inheritdoc
377
342
  */
378
- declare class DaffAuthResetPasswordFacade implements DaffAuthResetPasswordFacadeInterface {
379
- private store;
380
- token$: Observable<DaffAuthResetPasswordInfo['token']>;
381
- loading$: Observable<boolean>;
382
- errors$: Observable<DaffStateError[]>;
383
- constructor(store: Store<DaffAuthStateRootSlice>);
384
- dispatch(action: Action): void;
385
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthResetPasswordFacade, never>;
386
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffAuthResetPasswordFacade>;
387
- }
388
-
389
- interface DaffAuthStateConfig {
390
- /**
391
- * How often Daffodil will run the auth check.
392
- * Defaults to twenty minutes.
393
- */
394
- checkInterval: number;
395
- }
396
-
397
- declare const daffAuthStateDefaultConfig: DaffAuthStateConfig;
398
-
399
- declare const DAFF_AUTH_STATE_CONFIG: i0.InjectionToken<DaffAuthStateConfig>;
400
- declare const provideDaffAuthStateConfig: <R extends DaffAuthStateConfig = DaffAuthStateConfig>(config: Partial<R> | i0.InjectionToken<Partial<R>>) => i0.FactoryProvider;
401
-
343
+ export declare class DaffAuthResetPasswordFacade implements DaffAuthResetPasswordFacadeInterface {
344
+ private store;
345
+ token$: Observable<DaffAuthResetPasswordInfo['token']>;
346
+ loading$: Observable<boolean>;
347
+ errors$: Observable<DaffStateError[]>;
348
+ constructor(store: Store<DaffAuthStateRootSlice>);
349
+ dispatch(action: Action): void;
350
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthResetPasswordFacade, never>;
351
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
352
+ }
353
+ export interface DaffAuthStateConfig {
354
+ /**
355
+ * How often Daffodil will run the auth check.
356
+ * Defaults to twenty minutes.
357
+ */
358
+ checkInterval: number;
359
+ }
360
+ export declare const daffAuthStateDefaultConfig: DaffAuthStateConfig;
361
+ export declare const DAFF_AUTH_STATE_CONFIG: import("@angular/core").InjectionToken<DaffAuthStateConfig>, provideDaffAuthStateConfig: <R extends DaffAuthStateConfig = DaffAuthStateConfig>(config: Partial<R> | import("@angular/core").InjectionToken<Partial<R>>) => import("@angular/core").FactoryProvider;
402
362
  /**
403
363
  * A function that is called when the user is unauthenticated.
404
364
  * When a logged-in user is unauthenticated, various packages may perform cleanup tasks.
405
365
  * These hooks will be called in no particular order before the client driver state is reset.
406
366
  * Daffodil will wait for at least one emission from each hook before proceeding.
407
367
  */
408
- type DaffAuthUnauthenticatedHook = (trigger: Action['type']) => Observable<unknown>;
409
-
410
- declare const DAFF_AUTH_UNAUTHENTICATED_HOOKS: i0.InjectionToken<DaffAuthUnauthenticatedHook[]>;
411
- declare const daffAuthProvideUnauthenticatedHooks: <R extends DaffAuthUnauthenticatedHook = DaffAuthUnauthenticatedHook>(...values: R[]) => Array<i0.ValueProvider>;
412
-
413
- declare const DAFF_AUTH_ERROR_MATCHER: i0.InjectionToken<typeof daffTransformErrorToStateError>;
414
- declare const provideDaffAuthErrorMatcher: <R extends typeof daffTransformErrorToStateError = typeof daffTransformErrorToStateError>(value: R) => i0.ValueProvider;
415
-
416
- declare class DaffAuthStateModule {
417
- static withConfig(config?: Partial<DaffAuthStateConfig>): ModuleWithProviders<DaffAuthStateModule>;
418
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthStateModule, never>;
419
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffAuthStateModule, never, [typeof _ngrx_store.StoreFeatureModule, typeof i2.EffectsFeatureModule], never>;
420
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffAuthStateModule>;
421
- }
422
-
423
- export { DAFF_AUTH_ERROR_MATCHER, DAFF_AUTH_EXTRA_REDUCERS, DAFF_AUTH_STATE_CONFIG, DAFF_AUTH_STORE_FEATURE_KEY, DAFF_AUTH_UNAUTHENTICATED_HOOKS, DaffAuthActionTypes, DaffAuthCheck, DaffAuthCheckFailure, DaffAuthCheckSuccess, DaffAuthFacade, DaffAuthGuardLogout, DaffAuthLogin, DaffAuthLoginActionTypes, DaffAuthLoginFacade, DaffAuthLoginFailure, DaffAuthLoginSuccess, DaffAuthLogout, DaffAuthLogoutFailure, DaffAuthLogoutSuccess, DaffAuthRegister, DaffAuthRegisterActionTypes, DaffAuthRegisterFacade, DaffAuthRegisterFailure, DaffAuthRegisterSuccess, DaffAuthResetPasswordActionTypes, DaffAuthResetPasswordFacade, DaffAuthResetToUnauthenticated, DaffAuthServerSide, DaffAuthStateModule, DaffAuthStorageFailure, DaffResetPassword, DaffResetPasswordFailure, DaffResetPasswordLanding, DaffResetPasswordSuccess, DaffSendResetEmail, DaffSendResetEmailFailure, DaffSendResetEmailSuccess, daffAuthInitialState, daffAuthLoginInitialState, daffAuthLoginReducer, daffAuthLoginSelectorFactory, daffAuthProvideExtraReducers, daffAuthProvideUnauthenticatedHooks, daffAuthReducer, daffAuthReducers, daffAuthRegisterInitialState, daffAuthRegisterReducer, daffAuthRegisterSelectorFactory, daffAuthResetPasswordInitialState, daffAuthResetPasswordReducer, daffAuthResetPasswordSelectorFactory, daffAuthSelectorFactory, daffAuthStateDefaultConfig, getDaffAuthSelectors, provideDaffAuthErrorMatcher, provideDaffAuthStateConfig };
424
- export type { AuthSelectors, DaffAuthActions, DaffAuthFacadeInterface, DaffAuthFeatureState, DaffAuthLoginActions, DaffAuthLoginFacadeInterface, DaffAuthLoginReducerState, DaffAuthLoginSelectors, DaffAuthReducerState, DaffAuthRegisterActions, DaffAuthRegisterFacadeInterface, DaffAuthRegisterReducerState, DaffAuthRegisterSelectors, DaffAuthResetPasswordActions, DaffAuthResetPasswordFacadeInterface, DaffAuthResetPasswordReducerState, DaffAuthResetPasswordSelectors, DaffAuthSelectors, DaffAuthStateConfig, DaffAuthStateRootSlice, DaffAuthUnauthenticatedHook };
368
+ export type DaffAuthUnauthenticatedHook = (trigger: Action['type']) => Observable<unknown>;
369
+ export declare const DAFF_AUTH_UNAUTHENTICATED_HOOKS: import("@angular/core").InjectionToken<DaffAuthUnauthenticatedHook[]>, daffAuthProvideUnauthenticatedHooks: <R extends DaffAuthUnauthenticatedHook = DaffAuthUnauthenticatedHook>(...values: R[]) => Array<import("@angular/core").ValueProvider>;
370
+ export declare const DAFF_AUTH_ERROR_MATCHER: import("@angular/core").InjectionToken<typeof daffTransformErrorToStateError>, provideDaffAuthErrorMatcher: <R extends typeof daffTransformErrorToStateError = typeof daffTransformErrorToStateError>(value: R) => import("@angular/core").ValueProvider;
371
+ /**
372
+ * @deprecated in favor of {@link provideDaffAuthState} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
373
+ */
374
+ export declare class DaffAuthStateModule {
375
+ static withConfig(config?: Partial<DaffAuthStateConfig>): ModuleWithProviders<DaffAuthStateModule>;
376
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthStateModule, never>;
377
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffAuthStateModule, never, [typeof i1.StoreFeatureModule, typeof i2.EffectsFeatureModule], never>;
378
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffAuthStateModule>;
379
+ }
380
+ /**
381
+ * Provides the `@daffodil/auth/state` feature state and effects.
382
+ */
383
+ export declare const provideDaffAuthState: (config?: Partial<DaffAuthStateConfig>) => EnvironmentProviders;