@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.
- package/fesm2022/daffodil-auth-driver-in-memory.mjs +356 -249
- package/fesm2022/daffodil-auth-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-auth-driver-magento-2.4.7.mjs +459 -0
- package/fesm2022/daffodil-auth-driver-magento-2.4.7.mjs.map +1 -0
- package/fesm2022/daffodil-auth-driver-magento-auto.mjs +7 -0
- package/fesm2022/daffodil-auth-driver-magento-auto.mjs.map +1 -0
- package/fesm2022/daffodil-auth-driver-testing.mjs +220 -126
- package/fesm2022/daffodil-auth-driver-testing.mjs.map +1 -1
- package/fesm2022/daffodil-auth-driver.mjs +99 -126
- package/fesm2022/daffodil-auth-driver.mjs.map +1 -1
- package/fesm2022/daffodil-auth-routing.mjs +392 -257
- package/fesm2022/daffodil-auth-routing.mjs.map +1 -1
- package/fesm2022/daffodil-auth-state-testing.mjs +209 -106
- package/fesm2022/daffodil-auth-state-testing.mjs.map +1 -1
- package/fesm2022/daffodil-auth-state.mjs +867 -852
- package/fesm2022/daffodil-auth-state.mjs.map +1 -1
- package/fesm2022/daffodil-auth-testing.mjs +132 -76
- package/fesm2022/daffodil-auth-testing.mjs.map +1 -1
- package/fesm2022/daffodil-auth.mjs +65 -57
- package/fesm2022/daffodil-auth.mjs.map +1 -1
- package/package.json +1 -1
- package/types/daffodil-auth-driver-in-memory.d.ts +62 -62
- package/types/daffodil-auth-driver-magento-2.4.7.d.ts +119 -0
- package/types/daffodil-auth-driver-magento-auto.d.ts +1 -0
- package/types/daffodil-auth-driver-testing.d.ts +37 -36
- package/types/daffodil-auth-driver.d.ts +93 -112
- package/types/daffodil-auth-routing.d.ts +100 -104
- package/types/daffodil-auth-state-testing.d.ts +44 -43
- package/types/daffodil-auth-state.d.ts +265 -306
- package/types/daffodil-auth-testing.d.ts +28 -33
- package/types/daffodil-auth.d.ts +51 -62
- package/fesm2022/daffodil-auth-driver-magento.mjs +0 -385
- package/fesm2022/daffodil-auth-driver-magento.mjs.map +0 -1
- package/types/daffodil-auth-driver-magento.d.ts +0 -135
|
@@ -1,424 +1,383 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { Action, ActionReducer, ActionReducerMap, MemoizedSelector, Store } from
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import * as i0 from
|
|
7
|
-
import { ModuleWithProviders } from
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
type DaffAuthActions = DaffAuthResetToUnauthenticated | DaffAuthStorageFailure | DaffAuthGuardLogout | DaffAuthServerSide | DaffAuthCheck | DaffAuthCheckSuccess | DaffAuthCheckFailure;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
type DaffAuthLoginActions<T extends DaffLoginInfo = DaffLoginInfo, U extends DaffAuthToken = DaffAuthToken> = DaffAuthLogin<T> | DaffAuthLoginSuccess<U> | DaffAuthLoginFailure | DaffAuthLogout | DaffAuthLogoutSuccess | DaffAuthLogoutFailure;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
type DaffAuthRegisterActions<T extends DaffAccountRegistration = DaffAccountRegistration> = DaffAuthRegister<T> | DaffAuthRegisterSuccess | DaffAuthRegisterFailure;
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
-
|
|
180
|
-
|
|
181
|
-
|
|
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
|
-
|
|
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
|
-
|
|
196
|
-
|
|
197
|
-
|
|
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
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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
|
-
|
|
223
|
-
|
|
224
|
-
|
|
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
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
236
|
-
type DaffAuthResetPasswordActions<T extends DaffAuthResetPasswordInfo = DaffAuthResetPasswordInfo> = DaffSendResetEmail | DaffSendResetEmailSuccess | DaffSendResetEmailFailure | DaffResetPassword<T> | DaffResetPasswordSuccess | DaffResetPasswordFailure | DaffResetPasswordLanding;
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
declare const
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
declare const
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
interface DaffAuthStateRootSlice {
|
|
275
|
-
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
interface
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
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
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
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
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
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
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
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
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
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
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
declare
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
export
|
|
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;
|