ngx-better-auth 0.5.2 → 0.7.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/README.md +12 -4
- package/fesm2022/ngx-better-auth.mjs +80 -85
- package/fesm2022/ngx-better-auth.mjs.map +1 -1
- package/index.d.ts +313 -303
- package/package.json +5 -5
package/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, EnvironmentProviders } from '@angular/core';
|
|
3
|
-
import * as better_auth from 'better-auth';
|
|
4
3
|
import { BetterAuthOptions } from 'better-auth';
|
|
5
|
-
import { Session, User } from 'better-auth/types';
|
|
6
4
|
import { SocialProviderList } from 'better-auth/social-providers';
|
|
7
5
|
import * as rxjs from 'rxjs';
|
|
8
6
|
import { Observable } from 'rxjs';
|
|
@@ -12,22 +10,121 @@ import { UrlTree, CanActivateFn } from '@angular/router';
|
|
|
12
10
|
declare const BETTER_AUTH_CONFIG_TOKEN: InjectionToken<BetterAuthOptions>;
|
|
13
11
|
declare function provideBetterAuth(options: BetterAuthOptions): EnvironmentProviders;
|
|
14
12
|
|
|
15
|
-
interface
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
interface Session {
|
|
14
|
+
userId: string;
|
|
15
|
+
expiresAt: Date;
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
token: string;
|
|
18
|
+
}
|
|
19
|
+
interface Session2 extends Session {
|
|
20
|
+
id: string;
|
|
21
|
+
impersonatedBy?: string;
|
|
22
|
+
ipAddress?: string | null;
|
|
23
|
+
userAgent?: string | null;
|
|
24
|
+
}
|
|
25
|
+
interface Session3 extends Session2 {
|
|
26
|
+
updatedAt: Date;
|
|
20
27
|
}
|
|
21
28
|
|
|
22
29
|
type Provider = SocialProviderList[number];
|
|
23
30
|
|
|
31
|
+
interface Account {
|
|
32
|
+
id: string;
|
|
33
|
+
provider: string;
|
|
34
|
+
createdAt: Date;
|
|
35
|
+
updatedAt: Date;
|
|
36
|
+
accountId: string;
|
|
37
|
+
scopes: string[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
interface User {
|
|
41
|
+
id: string;
|
|
42
|
+
email: string;
|
|
43
|
+
emailVerified: boolean;
|
|
44
|
+
name: string | null;
|
|
45
|
+
image?: string | null;
|
|
46
|
+
createdAt: Date;
|
|
47
|
+
updatedAt: Date;
|
|
48
|
+
[key: string]: any;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface RegisterPasskey {
|
|
52
|
+
attestation: string;
|
|
53
|
+
challenge: string;
|
|
54
|
+
extension: object;
|
|
55
|
+
timeout: number;
|
|
56
|
+
authenticatorSelection: {
|
|
57
|
+
authenticatorAttachment?: AuthenticatorAttachment;
|
|
58
|
+
requireResidentKey: boolean;
|
|
59
|
+
userVerification: UserVerificationRequirement;
|
|
60
|
+
};
|
|
61
|
+
excludeCredentials: {
|
|
62
|
+
id: string;
|
|
63
|
+
type: string;
|
|
64
|
+
transports: AuthenticatorTransport[];
|
|
65
|
+
}[];
|
|
66
|
+
rp: {
|
|
67
|
+
name: string;
|
|
68
|
+
id?: string;
|
|
69
|
+
};
|
|
70
|
+
user: {
|
|
71
|
+
id: string;
|
|
72
|
+
name: string;
|
|
73
|
+
displayName: string;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
interface Passkey {
|
|
77
|
+
backedUp: boolean;
|
|
78
|
+
counter: number;
|
|
79
|
+
credentialID: string;
|
|
80
|
+
deviceType: string;
|
|
81
|
+
publicKey: string;
|
|
82
|
+
userId: string;
|
|
83
|
+
aaguid?: string;
|
|
84
|
+
createdAt?: string;
|
|
85
|
+
id?: string;
|
|
86
|
+
name?: string;
|
|
87
|
+
transports?: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
interface Organization {
|
|
91
|
+
id?: string;
|
|
92
|
+
name: string;
|
|
93
|
+
created: Date;
|
|
94
|
+
logo: string;
|
|
95
|
+
metadata: Record<string, any>;
|
|
96
|
+
slug: string;
|
|
97
|
+
}
|
|
98
|
+
interface Invitation {
|
|
99
|
+
id?: string;
|
|
100
|
+
role?: string | string[];
|
|
101
|
+
email: string;
|
|
102
|
+
expiresAt: Date;
|
|
103
|
+
inviterId: string;
|
|
104
|
+
organizationId: string;
|
|
105
|
+
status: InvitationStatus;
|
|
106
|
+
}
|
|
107
|
+
type InvitationStatus = 'pending' | 'accepted' | 'rejected' | 'canceled';
|
|
108
|
+
interface Member {
|
|
109
|
+
createdAt: Date;
|
|
110
|
+
role: string | string[];
|
|
111
|
+
userId: string;
|
|
112
|
+
organizationId: string;
|
|
113
|
+
id?: string;
|
|
114
|
+
}
|
|
115
|
+
interface Member2 extends Omit<Member, 'createdAt'> {
|
|
116
|
+
}
|
|
117
|
+
|
|
24
118
|
declare class AuthService {
|
|
25
119
|
private readonly mainService;
|
|
26
120
|
private readonly client;
|
|
27
121
|
/**
|
|
28
122
|
* Current authenticated session
|
|
29
123
|
*/
|
|
30
|
-
readonly session: i0.WritableSignal<
|
|
124
|
+
readonly session: i0.WritableSignal<{
|
|
125
|
+
user: User;
|
|
126
|
+
session: Session3;
|
|
127
|
+
} | null>;
|
|
31
128
|
/**
|
|
32
129
|
* Whether there is an active session
|
|
33
130
|
*/
|
|
@@ -36,7 +133,10 @@ declare class AuthService {
|
|
|
36
133
|
* Observable stream of the session state. Emits only when the session is resolved (not pending).
|
|
37
134
|
* This is intended for guards and other async operations.
|
|
38
135
|
*/
|
|
39
|
-
readonly sessionState$: Observable<
|
|
136
|
+
readonly sessionState$: Observable<{
|
|
137
|
+
user: User;
|
|
138
|
+
session: Session3;
|
|
139
|
+
} | null>;
|
|
40
140
|
constructor();
|
|
41
141
|
/**
|
|
42
142
|
* Asynchronously checks if the user is authenticated.
|
|
@@ -45,25 +145,14 @@ declare class AuthService {
|
|
|
45
145
|
*/
|
|
46
146
|
isLoggedIn$(): Observable<boolean>;
|
|
47
147
|
private session$;
|
|
48
|
-
/**
|
|
49
|
-
* pass either email or username to sign in. Needs username plugin enabled to use username.
|
|
50
|
-
* @param data : { email?: string; username?: string; password: string; rememberMe?: boolean }
|
|
51
|
-
*/
|
|
52
|
-
signIn(data: {
|
|
53
|
-
login: string;
|
|
54
|
-
password: string;
|
|
55
|
-
rememberMe?: boolean;
|
|
56
|
-
}): Observable<AuthSession>;
|
|
57
148
|
signInEmail(data: {
|
|
58
149
|
email: string;
|
|
59
150
|
password: string;
|
|
60
151
|
rememberMe?: boolean;
|
|
61
|
-
}): Observable<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
rememberMe?: boolean;
|
|
66
|
-
}): Observable<AuthSession>;
|
|
152
|
+
}): Observable<{
|
|
153
|
+
user: User;
|
|
154
|
+
session: Session3;
|
|
155
|
+
}>;
|
|
67
156
|
/**
|
|
68
157
|
* Sign up a new user using email and password.
|
|
69
158
|
*
|
|
@@ -76,103 +165,46 @@ declare class AuthService {
|
|
|
76
165
|
password: string;
|
|
77
166
|
username: string;
|
|
78
167
|
displayUsername?: string;
|
|
79
|
-
}): Observable<
|
|
80
|
-
|
|
168
|
+
}): Observable<{
|
|
169
|
+
user: User;
|
|
170
|
+
session: Session3;
|
|
171
|
+
}>;
|
|
172
|
+
signInProvider(provider: Provider): Observable<{
|
|
173
|
+
user: User;
|
|
174
|
+
session: Session3;
|
|
175
|
+
}>;
|
|
81
176
|
signOut(): Observable<null>;
|
|
82
177
|
sendVerificationEmail(data: {
|
|
83
178
|
email: string;
|
|
84
179
|
callbackURL?: string;
|
|
85
180
|
}): Observable<{
|
|
86
|
-
|
|
87
|
-
status: boolean;
|
|
88
|
-
};
|
|
89
|
-
error: null;
|
|
90
|
-
} | {
|
|
91
|
-
data: null;
|
|
92
|
-
error: {
|
|
93
|
-
code?: string | undefined;
|
|
94
|
-
message?: string | undefined;
|
|
95
|
-
status: number;
|
|
96
|
-
statusText: string;
|
|
97
|
-
};
|
|
181
|
+
status: boolean;
|
|
98
182
|
}>;
|
|
99
183
|
requestPasswordReset(data: {
|
|
100
184
|
email: string;
|
|
101
185
|
redirectTo?: string;
|
|
102
186
|
}): Observable<{
|
|
103
|
-
|
|
104
|
-
status: boolean;
|
|
105
|
-
};
|
|
106
|
-
error: null;
|
|
107
|
-
} | {
|
|
108
|
-
data: null;
|
|
109
|
-
error: {
|
|
110
|
-
code?: string | undefined;
|
|
111
|
-
message?: string | undefined;
|
|
112
|
-
status: number;
|
|
113
|
-
statusText: string;
|
|
114
|
-
};
|
|
187
|
+
status: boolean;
|
|
115
188
|
}>;
|
|
116
189
|
resetPassword(data: {
|
|
117
190
|
newPassword: string;
|
|
118
191
|
token: string;
|
|
119
192
|
}): Observable<{
|
|
120
|
-
|
|
121
|
-
status: boolean;
|
|
122
|
-
};
|
|
123
|
-
error: null;
|
|
124
|
-
} | {
|
|
125
|
-
data: null;
|
|
126
|
-
error: {
|
|
127
|
-
code?: string | undefined;
|
|
128
|
-
message?: string | undefined;
|
|
129
|
-
status: number;
|
|
130
|
-
statusText: string;
|
|
131
|
-
};
|
|
193
|
+
status: boolean;
|
|
132
194
|
}>;
|
|
133
195
|
changePassword(data: {
|
|
134
196
|
currentPassword: string;
|
|
135
197
|
newPassword: string;
|
|
136
198
|
revokeOtherSessions?: boolean;
|
|
137
199
|
}): Observable<{
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
user: {
|
|
141
|
-
id: string;
|
|
142
|
-
email: string;
|
|
143
|
-
name: string;
|
|
144
|
-
image: string | null | undefined;
|
|
145
|
-
emailVerified: boolean;
|
|
146
|
-
createdAt: Date;
|
|
147
|
-
updatedAt: Date;
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
error: null;
|
|
151
|
-
} | {
|
|
152
|
-
data: null;
|
|
153
|
-
error: {
|
|
154
|
-
code?: string | undefined;
|
|
155
|
-
message?: string | undefined;
|
|
156
|
-
status: number;
|
|
157
|
-
statusText: string;
|
|
158
|
-
};
|
|
200
|
+
token: string;
|
|
201
|
+
user: User;
|
|
159
202
|
}>;
|
|
160
203
|
changeEmail(data: {
|
|
161
204
|
newEmail: string;
|
|
162
205
|
callbackURL?: string;
|
|
163
206
|
}): Observable<{
|
|
164
|
-
|
|
165
|
-
status: boolean;
|
|
166
|
-
};
|
|
167
|
-
error: null;
|
|
168
|
-
} | {
|
|
169
|
-
data: null;
|
|
170
|
-
error: {
|
|
171
|
-
code?: string | undefined;
|
|
172
|
-
message?: string | undefined;
|
|
173
|
-
status: number;
|
|
174
|
-
statusText: string;
|
|
175
|
-
};
|
|
207
|
+
status: boolean;
|
|
176
208
|
}>;
|
|
177
209
|
updateUser(data: {
|
|
178
210
|
name?: string;
|
|
@@ -180,41 +212,13 @@ declare class AuthService {
|
|
|
180
212
|
username?: string;
|
|
181
213
|
displayUsername?: string;
|
|
182
214
|
}): Observable<{
|
|
183
|
-
|
|
184
|
-
status: boolean;
|
|
185
|
-
};
|
|
186
|
-
error: null;
|
|
187
|
-
} | {
|
|
188
|
-
data: null;
|
|
189
|
-
error: {
|
|
190
|
-
code?: string | undefined;
|
|
191
|
-
message?: string | undefined;
|
|
192
|
-
status: number;
|
|
193
|
-
statusText: string;
|
|
194
|
-
};
|
|
215
|
+
status: boolean;
|
|
195
216
|
}>;
|
|
196
|
-
isUsernameAvailable(data: {
|
|
197
|
-
username: string;
|
|
198
|
-
}): Observable<unknown>;
|
|
199
217
|
deleteUser(data: {
|
|
200
218
|
callbackURL?: string;
|
|
201
219
|
token?: string;
|
|
202
220
|
password?: string;
|
|
203
|
-
}): Observable<
|
|
204
|
-
data: {
|
|
205
|
-
success: boolean;
|
|
206
|
-
message: string;
|
|
207
|
-
};
|
|
208
|
-
error: null;
|
|
209
|
-
} | {
|
|
210
|
-
data: null;
|
|
211
|
-
error: {
|
|
212
|
-
code?: string | undefined;
|
|
213
|
-
message?: string | undefined;
|
|
214
|
-
status: number;
|
|
215
|
-
statusText: string;
|
|
216
|
-
};
|
|
217
|
-
}>;
|
|
221
|
+
}): Observable<null>;
|
|
218
222
|
static ɵfac: i0.ɵɵFactoryDeclaration<AuthService, never>;
|
|
219
223
|
static ɵprov: i0.ɵɵInjectableDeclaration<AuthService>;
|
|
220
224
|
}
|
|
@@ -222,68 +226,17 @@ declare class AuthService {
|
|
|
222
226
|
declare class SessionService {
|
|
223
227
|
private readonly mainService;
|
|
224
228
|
private readonly client;
|
|
225
|
-
listSessions():
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
createdAt: Date;
|
|
231
|
-
updatedAt: Date;
|
|
232
|
-
token: string;
|
|
233
|
-
ipAddress?: string | null | undefined | undefined;
|
|
234
|
-
userAgent?: string | null | undefined | undefined;
|
|
235
|
-
}>[];
|
|
236
|
-
error: null;
|
|
237
|
-
} | {
|
|
238
|
-
data: null;
|
|
239
|
-
error: {
|
|
240
|
-
code?: string | undefined;
|
|
241
|
-
message?: string | undefined;
|
|
242
|
-
status: number;
|
|
243
|
-
statusText: string;
|
|
244
|
-
};
|
|
229
|
+
listSessions(): Observable<Session2[]>;
|
|
230
|
+
revokeSession(data: {
|
|
231
|
+
token: string;
|
|
232
|
+
}): Observable<{
|
|
233
|
+
success: boolean;
|
|
245
234
|
}>;
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
status: boolean;
|
|
249
|
-
};
|
|
250
|
-
error: null;
|
|
251
|
-
} | {
|
|
252
|
-
data: null;
|
|
253
|
-
error: {
|
|
254
|
-
code?: string | undefined;
|
|
255
|
-
message?: string | undefined;
|
|
256
|
-
status: number;
|
|
257
|
-
statusText: string;
|
|
258
|
-
};
|
|
235
|
+
revokeOtherSessions(): Observable<{
|
|
236
|
+
success: boolean;
|
|
259
237
|
}>;
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
status: boolean;
|
|
263
|
-
};
|
|
264
|
-
error: null;
|
|
265
|
-
} | {
|
|
266
|
-
data: null;
|
|
267
|
-
error: {
|
|
268
|
-
code?: string | undefined;
|
|
269
|
-
message?: string | undefined;
|
|
270
|
-
status: number;
|
|
271
|
-
statusText: string;
|
|
272
|
-
};
|
|
273
|
-
}>;
|
|
274
|
-
revokeAllSessions(): rxjs.Observable<{
|
|
275
|
-
data: {
|
|
276
|
-
status: boolean;
|
|
277
|
-
};
|
|
278
|
-
error: null;
|
|
279
|
-
} | {
|
|
280
|
-
data: null;
|
|
281
|
-
error: {
|
|
282
|
-
code?: string | undefined;
|
|
283
|
-
message?: string | undefined;
|
|
284
|
-
status: number;
|
|
285
|
-
statusText: string;
|
|
286
|
-
};
|
|
238
|
+
revokeAllSessions(): Observable<{
|
|
239
|
+
success: boolean;
|
|
287
240
|
}>;
|
|
288
241
|
static ɵfac: i0.ɵɵFactoryDeclaration<SessionService, never>;
|
|
289
242
|
static ɵprov: i0.ɵɵInjectableDeclaration<SessionService>;
|
|
@@ -292,25 +245,7 @@ declare class SessionService {
|
|
|
292
245
|
declare class AccountService {
|
|
293
246
|
private readonly mainService;
|
|
294
247
|
private readonly client;
|
|
295
|
-
listAccounts():
|
|
296
|
-
data: {
|
|
297
|
-
id: string;
|
|
298
|
-
provider: string;
|
|
299
|
-
createdAt: Date;
|
|
300
|
-
updatedAt: Date;
|
|
301
|
-
accountId: string;
|
|
302
|
-
scopes: string[];
|
|
303
|
-
}[];
|
|
304
|
-
error: null;
|
|
305
|
-
} | {
|
|
306
|
-
data: null;
|
|
307
|
-
error: {
|
|
308
|
-
code?: string | undefined;
|
|
309
|
-
message?: string | undefined;
|
|
310
|
-
status: number;
|
|
311
|
-
statusText: string;
|
|
312
|
-
};
|
|
313
|
-
}>;
|
|
248
|
+
listAccounts(): Observable<Account[]>;
|
|
314
249
|
linkSocial(data: {
|
|
315
250
|
provider: Provider;
|
|
316
251
|
callbackURL?: string;
|
|
@@ -321,37 +256,15 @@ declare class AccountService {
|
|
|
321
256
|
accessToken?: string;
|
|
322
257
|
refreshToken?: string;
|
|
323
258
|
};
|
|
324
|
-
}):
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
redirect: boolean;
|
|
328
|
-
};
|
|
329
|
-
error: null;
|
|
330
|
-
} | {
|
|
331
|
-
data: null;
|
|
332
|
-
error: {
|
|
333
|
-
code?: string | undefined;
|
|
334
|
-
message?: string | undefined;
|
|
335
|
-
status: number;
|
|
336
|
-
statusText: string;
|
|
337
|
-
};
|
|
259
|
+
}): Observable<{
|
|
260
|
+
url: string;
|
|
261
|
+
redirect: boolean;
|
|
338
262
|
}>;
|
|
339
263
|
unlinkAccount(data: {
|
|
340
264
|
providerId: Provider;
|
|
341
265
|
accountId: string;
|
|
342
|
-
}):
|
|
343
|
-
|
|
344
|
-
status: boolean;
|
|
345
|
-
};
|
|
346
|
-
error: null;
|
|
347
|
-
} | {
|
|
348
|
-
data: null;
|
|
349
|
-
error: {
|
|
350
|
-
code?: string | undefined;
|
|
351
|
-
message?: string | undefined;
|
|
352
|
-
status: number;
|
|
353
|
-
statusText: string;
|
|
354
|
-
};
|
|
266
|
+
}): Observable<{
|
|
267
|
+
status: boolean;
|
|
355
268
|
}>;
|
|
356
269
|
static ɵfac: i0.ɵɵFactoryDeclaration<AccountService, never>;
|
|
357
270
|
static ɵprov: i0.ɵɵInjectableDeclaration<AccountService>;
|
|
@@ -364,32 +277,50 @@ declare class TwoFactorService {
|
|
|
364
277
|
enable(data: {
|
|
365
278
|
password: string;
|
|
366
279
|
issuer?: string;
|
|
367
|
-
}):
|
|
280
|
+
}): Observable<{
|
|
281
|
+
totpURI: string;
|
|
282
|
+
backupCodes: string[];
|
|
283
|
+
}>;
|
|
368
284
|
disable(data: {
|
|
369
285
|
password: string;
|
|
370
|
-
}):
|
|
286
|
+
}): Observable<{
|
|
287
|
+
status: boolean;
|
|
288
|
+
}>;
|
|
371
289
|
getTotpUri(data: {
|
|
372
290
|
password: string;
|
|
373
|
-
}):
|
|
291
|
+
}): Observable<{
|
|
292
|
+
totpURI: string;
|
|
293
|
+
}>;
|
|
374
294
|
verifyTotp(data: {
|
|
375
295
|
code: string;
|
|
376
296
|
trustDevice?: boolean;
|
|
377
|
-
}):
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
297
|
+
}): Observable<{
|
|
298
|
+
status: boolean;
|
|
299
|
+
}>;
|
|
300
|
+
sendOtp(): Observable<{
|
|
301
|
+
status: boolean;
|
|
302
|
+
}>;
|
|
381
303
|
verifyOtp(data: {
|
|
382
304
|
code: string;
|
|
383
305
|
trustDevice?: boolean;
|
|
384
|
-
}):
|
|
306
|
+
}): Observable<{
|
|
307
|
+
token: string;
|
|
308
|
+
user: User;
|
|
309
|
+
}>;
|
|
385
310
|
generateBackupCodes(data: {
|
|
386
311
|
password: string;
|
|
387
|
-
}):
|
|
312
|
+
}): Observable<{
|
|
313
|
+
status: boolean;
|
|
314
|
+
backupCodes: string[];
|
|
315
|
+
}>;
|
|
388
316
|
verifyBackupCode(data: {
|
|
389
317
|
code: string;
|
|
390
318
|
disableSession?: boolean;
|
|
391
319
|
trustDevice?: boolean;
|
|
392
|
-
}):
|
|
320
|
+
}): Observable<{
|
|
321
|
+
user: User;
|
|
322
|
+
session: Session3;
|
|
323
|
+
}>;
|
|
393
324
|
static ɵfac: i0.ɵɵFactoryDeclaration<TwoFactorService, never>;
|
|
394
325
|
static ɵprov: i0.ɵɵInjectableDeclaration<TwoFactorService>;
|
|
395
326
|
}
|
|
@@ -400,16 +331,27 @@ declare class PasskeyService {
|
|
|
400
331
|
constructor();
|
|
401
332
|
addPasskey(data: {
|
|
402
333
|
name?: string;
|
|
403
|
-
authenticatorAttachment?:
|
|
404
|
-
}):
|
|
405
|
-
|
|
334
|
+
authenticatorAttachment?: AuthenticatorAttachment;
|
|
335
|
+
}): Observable<{
|
|
336
|
+
passkey: Passkey;
|
|
337
|
+
}>;
|
|
338
|
+
signIn(data: {
|
|
339
|
+
email: string;
|
|
340
|
+
autoFill?: boolean;
|
|
341
|
+
callbackURL?: string;
|
|
342
|
+
}): Observable<unknown>;
|
|
343
|
+
listUserPasskeys(): Observable<Passkey[]>;
|
|
406
344
|
deletePasskey(data: {
|
|
407
345
|
id: string;
|
|
408
|
-
}):
|
|
346
|
+
}): Observable<{
|
|
347
|
+
status: boolean;
|
|
348
|
+
}>;
|
|
409
349
|
updatePasskey(data: {
|
|
410
350
|
id: string;
|
|
411
351
|
name: string;
|
|
412
|
-
}):
|
|
352
|
+
}): Observable<{
|
|
353
|
+
passkey: Passkey;
|
|
354
|
+
}>;
|
|
413
355
|
static ɵfac: i0.ɵɵFactoryDeclaration<PasskeyService, never>;
|
|
414
356
|
static ɵprov: i0.ɵɵInjectableDeclaration<PasskeyService>;
|
|
415
357
|
}
|
|
@@ -427,7 +369,10 @@ declare class GenericOauthService {
|
|
|
427
369
|
disableRedirect?: boolean;
|
|
428
370
|
scopes?: string[];
|
|
429
371
|
requestSignUp?: boolean;
|
|
430
|
-
}): rxjs.Observable<
|
|
372
|
+
}): rxjs.Observable<{
|
|
373
|
+
user: ngx_better_auth.User;
|
|
374
|
+
session: ngx_better_auth.Session3;
|
|
375
|
+
}>;
|
|
431
376
|
link(data: {
|
|
432
377
|
providerId: string;
|
|
433
378
|
callbackURL: string;
|
|
@@ -444,7 +389,10 @@ declare class EmailOtpService {
|
|
|
444
389
|
signInEmailOtp(data: {
|
|
445
390
|
email: string;
|
|
446
391
|
otp: string;
|
|
447
|
-
}): rxjs.Observable<
|
|
392
|
+
}): rxjs.Observable<{
|
|
393
|
+
user: ngx_better_auth.User;
|
|
394
|
+
session: ngx_better_auth.Session3;
|
|
395
|
+
}>;
|
|
448
396
|
sendVerificationOtp(data: {
|
|
449
397
|
email: string;
|
|
450
398
|
type: 'sign-in' | 'email-verification' | 'forget-password';
|
|
@@ -507,45 +455,95 @@ declare class AdminService {
|
|
|
507
455
|
constructor();
|
|
508
456
|
setRole(data: {
|
|
509
457
|
userId: string;
|
|
510
|
-
role:
|
|
511
|
-
}):
|
|
512
|
-
|
|
458
|
+
role: string | string[];
|
|
459
|
+
}): Observable<{
|
|
460
|
+
user: User;
|
|
461
|
+
}>;
|
|
462
|
+
createUser(data: {
|
|
463
|
+
email: string;
|
|
464
|
+
password: string;
|
|
465
|
+
name: string;
|
|
466
|
+
role?: string | string[];
|
|
467
|
+
data?: Record<string, any>;
|
|
468
|
+
}): Observable<{
|
|
469
|
+
user: User;
|
|
470
|
+
}>;
|
|
471
|
+
updateUser(data: {
|
|
513
472
|
userId: string;
|
|
514
|
-
|
|
515
|
-
}):
|
|
473
|
+
data: Partial<User>;
|
|
474
|
+
}): Observable<{
|
|
475
|
+
user: User;
|
|
476
|
+
}>;
|
|
477
|
+
listUsers(data: {
|
|
478
|
+
searchValue?: string;
|
|
479
|
+
searchField?: 'email' | 'name';
|
|
480
|
+
searchOperator?: 'contains' | 'start_with' | 'end_with';
|
|
481
|
+
limit?: number;
|
|
482
|
+
offset?: number;
|
|
483
|
+
sortBy?: string;
|
|
484
|
+
sortDirection?: 'asc' | 'desc';
|
|
485
|
+
filterField?: string;
|
|
486
|
+
filterValue?: string | number | boolean;
|
|
487
|
+
filterOperator?: 'eq' | 'ne' | 'lt' | 'lte' | 'gt' | 'gte';
|
|
488
|
+
}): Observable<{
|
|
489
|
+
users: User[];
|
|
490
|
+
total: number;
|
|
491
|
+
limit: number;
|
|
492
|
+
offset: number;
|
|
493
|
+
}>;
|
|
494
|
+
listUserSessions(data: {
|
|
495
|
+
userId: string;
|
|
496
|
+
}): Observable<{
|
|
497
|
+
sessions: Session3[];
|
|
498
|
+
}>;
|
|
499
|
+
unbanUser(data: {
|
|
500
|
+
userId: string;
|
|
501
|
+
}): Observable<{
|
|
502
|
+
user: User;
|
|
503
|
+
}>;
|
|
516
504
|
banUser(data: {
|
|
517
505
|
userId: string;
|
|
518
506
|
banReason?: string;
|
|
519
507
|
banExpiresIn?: number;
|
|
520
|
-
}):
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
listUserSessions(data: {
|
|
508
|
+
}): Observable<{
|
|
509
|
+
user: User;
|
|
510
|
+
}>;
|
|
511
|
+
impersonateUser(data: {
|
|
525
512
|
userId: string;
|
|
526
|
-
}):
|
|
513
|
+
}): Observable<{
|
|
514
|
+
session: Session3;
|
|
515
|
+
user: User;
|
|
516
|
+
}>;
|
|
517
|
+
stopImpersonating(): Observable<unknown>;
|
|
527
518
|
revokeUserSession(data: {
|
|
528
519
|
sessionToken: string;
|
|
529
|
-
}):
|
|
520
|
+
}): Observable<{
|
|
521
|
+
success: boolean;
|
|
522
|
+
}>;
|
|
530
523
|
revokeUserSessions(data: {
|
|
531
524
|
userId: string;
|
|
532
|
-
}):
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
}): rxjs.Observable<unknown>;
|
|
536
|
-
stopImpersonating(): rxjs.Observable<unknown>;
|
|
525
|
+
}): Observable<{
|
|
526
|
+
success: boolean;
|
|
527
|
+
}>;
|
|
537
528
|
removeUser(data: {
|
|
538
529
|
userId: string;
|
|
539
|
-
}):
|
|
530
|
+
}): Observable<{
|
|
531
|
+
success: boolean;
|
|
532
|
+
}>;
|
|
533
|
+
setUserPassword(data: {
|
|
534
|
+
userId: string;
|
|
535
|
+
newPassword: string;
|
|
536
|
+
}): Observable<{
|
|
537
|
+
success: boolean;
|
|
538
|
+
}>;
|
|
540
539
|
hasPermission(data: {
|
|
541
540
|
userId?: string;
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
}): rxjs.Observable<unknown>;
|
|
541
|
+
permissions: Record<string, string[]>;
|
|
542
|
+
}): Observable<unknown>;
|
|
545
543
|
checkRolePermission(data: {
|
|
546
|
-
role:
|
|
547
|
-
|
|
548
|
-
}):
|
|
544
|
+
role: string;
|
|
545
|
+
permissions: Record<string, string[]>;
|
|
546
|
+
}): Observable<unknown>;
|
|
549
547
|
static ɵfac: i0.ɵɵFactoryDeclaration<AdminService, never>;
|
|
550
548
|
static ɵprov: i0.ɵɵInjectableDeclaration<AdminService>;
|
|
551
549
|
}
|
|
@@ -554,26 +552,26 @@ declare class OrganizationService {
|
|
|
554
552
|
private readonly mainService;
|
|
555
553
|
organization: any;
|
|
556
554
|
constructor();
|
|
557
|
-
|
|
555
|
+
create(data: {
|
|
558
556
|
name: string;
|
|
559
557
|
slug: string;
|
|
560
558
|
logo?: string;
|
|
561
559
|
metadata?: Record<string, any>;
|
|
562
560
|
keepCurrentActiveOrganization?: boolean;
|
|
563
|
-
}):
|
|
561
|
+
}): Observable<Organization>;
|
|
564
562
|
checkSlug(data: {
|
|
565
563
|
slug: string;
|
|
566
|
-
}):
|
|
567
|
-
list():
|
|
564
|
+
}): Observable<unknown>;
|
|
565
|
+
list(): Observable<Organization[]>;
|
|
568
566
|
setActive(data: {
|
|
569
|
-
organizationId?: string
|
|
567
|
+
organizationId?: string;
|
|
570
568
|
organizationSlug?: string;
|
|
571
|
-
}):
|
|
569
|
+
}): Observable<Organization>;
|
|
572
570
|
getFullOrganization(data: {
|
|
573
571
|
organizationId?: string;
|
|
574
572
|
organizationSlug?: string;
|
|
575
573
|
membersLimit?: number;
|
|
576
|
-
}):
|
|
574
|
+
}): Observable<Organization>;
|
|
577
575
|
update(data: {
|
|
578
576
|
data: {
|
|
579
577
|
name?: string;
|
|
@@ -582,33 +580,43 @@ declare class OrganizationService {
|
|
|
582
580
|
metadata?: Record<string, any>;
|
|
583
581
|
};
|
|
584
582
|
organizationId?: string;
|
|
585
|
-
}):
|
|
583
|
+
}): Observable<Organization>;
|
|
586
584
|
delete(data: {
|
|
587
585
|
organizationId: string;
|
|
588
|
-
}):
|
|
586
|
+
}): Observable<void>;
|
|
589
587
|
inviteMember(data: {
|
|
590
588
|
email: string;
|
|
591
589
|
role: string | string[];
|
|
592
590
|
organizationId?: string;
|
|
593
591
|
resend?: boolean;
|
|
594
592
|
teamId?: string;
|
|
595
|
-
}):
|
|
593
|
+
}): Observable<Invitation>;
|
|
596
594
|
acceptInvitation(data: {
|
|
597
595
|
invitationId: string;
|
|
598
|
-
}):
|
|
596
|
+
}): Observable<{
|
|
597
|
+
invitation: Invitation;
|
|
598
|
+
member: Member;
|
|
599
|
+
}>;
|
|
599
600
|
cancelInvitation(data: {
|
|
600
601
|
invitationId: string;
|
|
601
|
-
}):
|
|
602
|
+
}): Observable<void>;
|
|
602
603
|
rejectInvitation(data: {
|
|
603
604
|
invitationId: string;
|
|
604
|
-
}):
|
|
605
|
+
}): Observable<{
|
|
606
|
+
invitation: Invitation;
|
|
607
|
+
member: null;
|
|
608
|
+
}>;
|
|
605
609
|
getInvitation(data: {
|
|
606
610
|
id: string;
|
|
607
|
-
}):
|
|
611
|
+
}): Observable<{
|
|
612
|
+
organizationName: string;
|
|
613
|
+
organizationSlug: string;
|
|
614
|
+
inviterEmail: string;
|
|
615
|
+
} & Invitation>;
|
|
608
616
|
listInvitations(data: {
|
|
609
617
|
organizationId?: string;
|
|
610
|
-
}):
|
|
611
|
-
listUserInvitations():
|
|
618
|
+
}): Observable<Invitation[]>;
|
|
619
|
+
listUserInvitations(): Observable<Invitation[]>;
|
|
612
620
|
listMembers(data?: {
|
|
613
621
|
organizationId?: string;
|
|
614
622
|
limit?: number;
|
|
@@ -618,27 +626,29 @@ declare class OrganizationService {
|
|
|
618
626
|
filterField?: string;
|
|
619
627
|
filterOperator?: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin' | 'contains';
|
|
620
628
|
filterValue?: string;
|
|
621
|
-
}):
|
|
629
|
+
}): Observable<unknown>;
|
|
622
630
|
removeMember(data: {
|
|
623
631
|
memberIdOrEmail: string;
|
|
624
632
|
organizationId?: string;
|
|
625
|
-
}):
|
|
633
|
+
}): Observable<{
|
|
634
|
+
member: Member2;
|
|
635
|
+
}>;
|
|
626
636
|
updateMemberRoles(data: {
|
|
627
637
|
memberId: string;
|
|
628
638
|
role: string | string[];
|
|
629
639
|
organizationId?: string;
|
|
630
|
-
}):
|
|
631
|
-
getActiveMember():
|
|
640
|
+
}): Observable<unknown>;
|
|
641
|
+
getActiveMember(): Observable<Member2>;
|
|
632
642
|
leave(data: {
|
|
633
643
|
organizationId?: string;
|
|
634
|
-
}):
|
|
644
|
+
}): Observable<void>;
|
|
635
645
|
createTeam(data: {
|
|
636
646
|
name: string;
|
|
637
647
|
organizationId?: string;
|
|
638
|
-
}):
|
|
648
|
+
}): Observable<unknown>;
|
|
639
649
|
listTeams(data: {
|
|
640
650
|
organizationId?: string;
|
|
641
|
-
}):
|
|
651
|
+
}): Observable<unknown>;
|
|
642
652
|
updateTeam(data: {
|
|
643
653
|
teamId: string;
|
|
644
654
|
data: {
|
|
@@ -647,26 +657,26 @@ declare class OrganizationService {
|
|
|
647
657
|
createdAt?: Date;
|
|
648
658
|
updatedAt?: Date;
|
|
649
659
|
};
|
|
650
|
-
}):
|
|
660
|
+
}): Observable<unknown>;
|
|
651
661
|
removeTeam(data: {
|
|
652
662
|
teamId: string;
|
|
653
663
|
organizationId?: string;
|
|
654
|
-
}):
|
|
664
|
+
}): Observable<unknown>;
|
|
655
665
|
setActiveTeam(data: {
|
|
656
666
|
teamId?: string;
|
|
657
|
-
}):
|
|
658
|
-
listUsersTeams():
|
|
667
|
+
}): Observable<unknown>;
|
|
668
|
+
listUsersTeams(): Observable<unknown>;
|
|
659
669
|
listTeamMembers(data: {
|
|
660
670
|
teamId: string;
|
|
661
|
-
}):
|
|
671
|
+
}): Observable<unknown>;
|
|
662
672
|
addTeamMember(data: {
|
|
663
673
|
teamId: string;
|
|
664
674
|
userId: string;
|
|
665
|
-
}):
|
|
675
|
+
}): Observable<unknown>;
|
|
666
676
|
removeTeamMember(data: {
|
|
667
677
|
teamId: string;
|
|
668
678
|
userId: string;
|
|
669
|
-
}):
|
|
679
|
+
}): Observable<unknown>;
|
|
670
680
|
static ɵfac: i0.ɵɵFactoryDeclaration<OrganizationService, never>;
|
|
671
681
|
static ɵprov: i0.ɵɵInjectableDeclaration<OrganizationService>;
|
|
672
682
|
}
|
|
@@ -690,4 +700,4 @@ declare function canActivate(pipe: () => Observable<boolean | UrlTree> | Promise
|
|
|
690
700
|
};
|
|
691
701
|
|
|
692
702
|
export { AccountService, AdminService, AuthService, BETTER_AUTH_CONFIG_TOKEN, EmailOtpService, GenericOauthService, MagicLinkService, OneTapService, OrganizationService, PasskeyService, SessionService, TwoFactorService, canActivate, hasRole, provideBetterAuth, redirectLoggedInTo, redirectUnauthorizedTo };
|
|
693
|
-
export type {
|
|
703
|
+
export type { Account, Invitation, InvitationStatus, Member, Member2, Organization, Passkey, Provider, RegisterPasskey, Session, Session2, Session3, User };
|