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