@nauth-toolkit/client-angular 0.1.53 → 0.1.55

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.
@@ -1,747 +0,0 @@
1
- import { NAuthClientConfig, AuthUser, AuthResponse, AuthEvent, NAuthClient, TokenResponse, ForgotPasswordResponse, ConfirmForgotPasswordResponse, UpdateProfileRequest, ChallengeResponse, GetSetupDataResponse, GetChallengeDataResponse, SocialProvider, SocialLoginOptions, SocialVerifyRequest, LinkedAccountsResponse, MFAStatus, MFADevice, AuditHistoryResponse, HttpAdapter, HttpRequest as HttpRequest$1, HttpResponse } from '@nauth-toolkit/client';
2
- export * from '@nauth-toolkit/client';
3
- import * as i0 from '@angular/core';
4
- import { InjectionToken, ModuleWithProviders } from '@angular/core';
5
- import * as rxjs from 'rxjs';
6
- import { Observable } from 'rxjs';
7
- import * as _angular_common_http from '@angular/common/http';
8
- import { HttpInterceptorFn, HttpRequest, HttpHandlerFn } from '@angular/common/http';
9
- import { CanActivateFn, Router, UrlTree } from '@angular/router';
10
-
11
- /**
12
- * Injection token for providing NAuthClientConfig in Angular apps.
13
- */
14
- declare const NAUTH_CLIENT_CONFIG: InjectionToken<NAuthClientConfig>;
15
-
16
- /**
17
- * Angular wrapper around NAuthClient that provides promise-based auth methods and reactive state.
18
- *
19
- * This service provides:
20
- * - Reactive state (currentUser$, isAuthenticated$, challenge$)
21
- * - All core auth methods as Promises (login, signup, logout, refresh)
22
- * - Profile management (getProfile, updateProfile, changePassword)
23
- * - Challenge flow methods (respondToChallenge, resendCode)
24
- * - MFA management (getMfaStatus, setupMfaDevice, etc.)
25
- * - Social authentication and account linking
26
- * - Device trust management
27
- * - Audit history
28
- *
29
- * @example
30
- * ```typescript
31
- * constructor(private auth: AuthService) {}
32
- *
33
- * // Reactive state
34
- * this.auth.currentUser$.subscribe(user => ...);
35
- * this.auth.isAuthenticated$.subscribe(isAuth => ...);
36
- *
37
- * // Auth operations with async/await
38
- * const response = await this.auth.login(email, password);
39
- *
40
- * // Profile management
41
- * await this.auth.changePassword(oldPassword, newPassword);
42
- * const user = await this.auth.updateProfile({ firstName: 'John' });
43
- *
44
- * // MFA operations
45
- * const status = await this.auth.getMfaStatus();
46
- * ```
47
- */
48
- declare class AuthService {
49
- private readonly client;
50
- private readonly config;
51
- private readonly currentUserSubject;
52
- private readonly isAuthenticatedSubject;
53
- private readonly challengeSubject;
54
- private readonly authEventsSubject;
55
- private initialized;
56
- /**
57
- * @param config - Injected client configuration
58
- *
59
- * Note: AngularHttpAdapter is automatically injected via Angular DI.
60
- * This ensures all requests go through Angular's HttpClient and interceptors.
61
- */
62
- constructor(config?: NAuthClientConfig);
63
- /**
64
- * Current user observable.
65
- */
66
- get currentUser$(): Observable<AuthUser | null>;
67
- /**
68
- * Authenticated state observable.
69
- */
70
- get isAuthenticated$(): Observable<boolean>;
71
- /**
72
- * Current challenge observable (for reactive challenge navigation).
73
- */
74
- get challenge$(): Observable<AuthResponse | null>;
75
- /**
76
- * Authentication events stream.
77
- * Emits all auth lifecycle events for custom logic, analytics, or UI updates.
78
- */
79
- get authEvents$(): Observable<AuthEvent>;
80
- /**
81
- * Successful authentication events stream.
82
- * Emits when user successfully authenticates (login, signup, social auth).
83
- */
84
- get authSuccess$(): Observable<AuthEvent>;
85
- /**
86
- * Authentication error events stream.
87
- * Emits when authentication fails (login error, OAuth error, etc.).
88
- */
89
- get authError$(): Observable<AuthEvent>;
90
- /**
91
- * Check if authenticated (sync, uses cached state).
92
- */
93
- isAuthenticated(): boolean;
94
- /**
95
- * Get current user (sync, uses cached state).
96
- */
97
- getCurrentUser(): AuthUser | null;
98
- /**
99
- * Get current challenge (sync).
100
- */
101
- getCurrentChallenge(): AuthResponse | null;
102
- /**
103
- * Login with identifier and password.
104
- *
105
- * @param identifier - User email or username
106
- * @param password - User password
107
- * @returns Promise with auth response or challenge
108
- *
109
- * @example
110
- * ```typescript
111
- * const response = await this.auth.login('user@example.com', 'password');
112
- * if (response.challengeName) {
113
- * // Handle challenge
114
- * } else {
115
- * // Login successful
116
- * }
117
- * ```
118
- */
119
- login(identifier: string, password: string): Promise<AuthResponse>;
120
- /**
121
- * Signup with credentials.
122
- *
123
- * @param payload - Signup request payload
124
- * @returns Promise with auth response or challenge
125
- *
126
- * @example
127
- * ```typescript
128
- * const response = await this.auth.signup({
129
- * email: 'new@example.com',
130
- * password: 'SecurePass123!',
131
- * firstName: 'John',
132
- * });
133
- * ```
134
- */
135
- signup(payload: Parameters<NAuthClient['signup']>[0]): Promise<AuthResponse>;
136
- /**
137
- * Logout current session.
138
- *
139
- * @param forgetDevice - If true, removes device trust
140
- *
141
- * @example
142
- * ```typescript
143
- * await this.auth.logout();
144
- * ```
145
- */
146
- logout(forgetDevice?: boolean): Promise<void>;
147
- /**
148
- * Logout all sessions.
149
- *
150
- * Revokes all active sessions for the current user across all devices.
151
- * Optionally revokes all trusted devices if forgetDevices is true.
152
- *
153
- * @param forgetDevices - If true, also revokes all trusted devices (default: false)
154
- * @returns Promise with number of sessions revoked
155
- *
156
- * @example
157
- * ```typescript
158
- * const result = await this.auth.logoutAll();
159
- * console.log(`Revoked ${result.revokedCount} sessions`);
160
- * ```
161
- */
162
- logoutAll(forgetDevices?: boolean): Promise<{
163
- revokedCount: number;
164
- }>;
165
- /**
166
- * Refresh tokens.
167
- *
168
- * @returns Promise with new tokens
169
- *
170
- * @example
171
- * ```typescript
172
- * const tokens = await this.auth.refresh();
173
- * ```
174
- */
175
- refresh(): Promise<TokenResponse>;
176
- /**
177
- * Request a password reset code (forgot password).
178
- *
179
- * @param identifier - User email, username, or phone
180
- * @returns Promise with password reset response
181
- *
182
- * @example
183
- * ```typescript
184
- * await this.auth.forgotPassword('user@example.com');
185
- * ```
186
- */
187
- forgotPassword(identifier: string): Promise<ForgotPasswordResponse>;
188
- /**
189
- * Confirm a password reset code and set a new password.
190
- *
191
- * @param identifier - User email, username, or phone
192
- * @param code - One-time reset code
193
- * @param newPassword - New password
194
- * @returns Promise with confirmation response
195
- *
196
- * @example
197
- * ```typescript
198
- * await this.auth.confirmForgotPassword('user@example.com', '123456', 'NewPass123!');
199
- * ```
200
- */
201
- confirmForgotPassword(identifier: string, code: string, newPassword: string): Promise<ConfirmForgotPasswordResponse>;
202
- /**
203
- * Change user password (requires current password).
204
- *
205
- * @param oldPassword - Current password
206
- * @param newPassword - New password (must meet requirements)
207
- * @returns Promise that resolves when password is changed
208
- *
209
- * @example
210
- * ```typescript
211
- * await this.auth.changePassword('oldPassword123', 'newSecurePassword456!');
212
- * ```
213
- */
214
- changePassword(oldPassword: string, newPassword: string): Promise<void>;
215
- /**
216
- * Request password change (must change on next login).
217
- *
218
- * @returns Promise that resolves when request is sent
219
- *
220
- * @example
221
- * ```typescript
222
- * await this.auth.requestPasswordChange();
223
- * ```
224
- */
225
- requestPasswordChange(): Promise<void>;
226
- /**
227
- * Get current user profile.
228
- *
229
- * @returns Promise of current user profile
230
- *
231
- * @example
232
- * ```typescript
233
- * const user = await this.auth.getProfile();
234
- * console.log('User profile:', user);
235
- * ```
236
- */
237
- getProfile(): Promise<AuthUser>;
238
- /**
239
- * Update user profile.
240
- *
241
- * @param updates - Profile fields to update
242
- * @returns Promise of updated user profile
243
- *
244
- * @example
245
- * ```typescript
246
- * const user = await this.auth.updateProfile({ firstName: 'John', lastName: 'Doe' });
247
- * console.log('Profile updated:', user);
248
- * ```
249
- */
250
- updateProfile(updates: UpdateProfileRequest): Promise<AuthUser>;
251
- /**
252
- * Respond to a challenge (VERIFY_EMAIL, VERIFY_PHONE, MFA_REQUIRED, etc.).
253
- *
254
- * @param response - Challenge response data
255
- * @returns Promise with auth response or next challenge
256
- *
257
- * @example
258
- * ```typescript
259
- * const result = await this.auth.respondToChallenge({
260
- * session: challengeSession,
261
- * type: 'VERIFY_EMAIL',
262
- * code: '123456',
263
- * });
264
- * ```
265
- */
266
- respondToChallenge(response: ChallengeResponse): Promise<AuthResponse>;
267
- /**
268
- * Resend challenge code.
269
- *
270
- * @param session - Challenge session token
271
- * @returns Promise with destination information
272
- *
273
- * @example
274
- * ```typescript
275
- * const result = await this.auth.resendCode(session);
276
- * console.log('Code sent to:', result.destination);
277
- * ```
278
- */
279
- resendCode(session: string): Promise<{
280
- destination: string;
281
- }>;
282
- /**
283
- * Get MFA setup data (for MFA_SETUP_REQUIRED challenge).
284
- *
285
- * Returns method-specific setup information:
286
- * - TOTP: { secret, qrCode, manualEntryKey }
287
- * - SMS: { maskedPhone }
288
- * - Email: { maskedEmail }
289
- * - Passkey: WebAuthn registration options
290
- *
291
- * @param session - Challenge session token
292
- * @param method - MFA method to set up
293
- * @returns Promise of setup data response
294
- *
295
- * @example
296
- * ```typescript
297
- * const setupData = await this.auth.getSetupData(session, 'totp');
298
- * console.log('QR Code:', setupData.setupData.qrCode);
299
- * ```
300
- */
301
- getSetupData(session: string, method: string): Promise<GetSetupDataResponse>;
302
- /**
303
- * Get MFA challenge data (for MFA_REQUIRED challenge - e.g., passkey options).
304
- *
305
- * @param session - Challenge session token
306
- * @param method - Challenge method
307
- * @returns Promise of challenge data response
308
- *
309
- * @example
310
- * ```typescript
311
- * const challengeData = await this.auth.getChallengeData(session, 'passkey');
312
- * ```
313
- */
314
- getChallengeData(session: string, method: string): Promise<GetChallengeDataResponse>;
315
- /**
316
- * Clear stored challenge (when navigating away from challenge flow).
317
- *
318
- * @returns Promise that resolves when challenge is cleared
319
- *
320
- * @example
321
- * ```typescript
322
- * await this.auth.clearChallenge();
323
- * ```
324
- */
325
- clearChallenge(): Promise<void>;
326
- /**
327
- * Initiate social OAuth login flow.
328
- * Redirects the browser to backend `/auth/social/:provider/redirect`.
329
- *
330
- * @param provider - Social provider ('google', 'apple', 'facebook')
331
- * @param options - Optional redirect options
332
- * @returns Promise that resolves when redirect starts
333
- *
334
- * @example
335
- * ```typescript
336
- * await this.auth.loginWithSocial('google', { returnTo: '/auth/callback' });
337
- * ```
338
- */
339
- loginWithSocial(provider: SocialProvider, options?: SocialLoginOptions): Promise<void>;
340
- /**
341
- * Exchange an exchangeToken (from redirect callback URL) into an AuthResponse.
342
- *
343
- * Used for `tokenDelivery: 'json'` or hybrid flows where the backend redirects back
344
- * with `exchangeToken` instead of setting cookies.
345
- *
346
- * @param exchangeToken - One-time exchange token from the callback URL
347
- * @returns Promise of AuthResponse
348
- *
349
- * @example
350
- * ```typescript
351
- * const response = await this.auth.exchangeSocialRedirect(exchangeToken);
352
- * ```
353
- */
354
- exchangeSocialRedirect(exchangeToken: string): Promise<AuthResponse>;
355
- /**
356
- * Verify native social token (mobile).
357
- *
358
- * @param request - Social verification request with provider and token
359
- * @returns Promise of AuthResponse
360
- *
361
- * @example
362
- * ```typescript
363
- * const result = await this.auth.verifyNativeSocial({
364
- * provider: 'google',
365
- * idToken: nativeIdToken,
366
- * });
367
- * ```
368
- */
369
- verifyNativeSocial(request: SocialVerifyRequest): Promise<AuthResponse>;
370
- /**
371
- * Get linked social accounts.
372
- *
373
- * @returns Promise of linked accounts response
374
- *
375
- * @example
376
- * ```typescript
377
- * const accounts = await this.auth.getLinkedAccounts();
378
- * console.log('Linked providers:', accounts.providers);
379
- * ```
380
- */
381
- getLinkedAccounts(): Promise<LinkedAccountsResponse>;
382
- /**
383
- * Link social account.
384
- *
385
- * @param provider - Social provider to link
386
- * @param code - OAuth authorization code
387
- * @param state - OAuth state parameter
388
- * @returns Promise with success message
389
- *
390
- * @example
391
- * ```typescript
392
- * await this.auth.linkSocialAccount('google', code, state);
393
- * ```
394
- */
395
- linkSocialAccount(provider: string, code: string, state: string): Promise<{
396
- message: string;
397
- }>;
398
- /**
399
- * Unlink social account.
400
- *
401
- * @param provider - Social provider to unlink
402
- * @returns Promise with success message
403
- *
404
- * @example
405
- * ```typescript
406
- * await this.auth.unlinkSocialAccount('google');
407
- * ```
408
- */
409
- unlinkSocialAccount(provider: string): Promise<{
410
- message: string;
411
- }>;
412
- /**
413
- * Get MFA status for the current user.
414
- *
415
- * @returns Promise of MFA status
416
- *
417
- * @example
418
- * ```typescript
419
- * const status = await this.auth.getMfaStatus();
420
- * console.log('MFA enabled:', status.enabled);
421
- * ```
422
- */
423
- getMfaStatus(): Promise<MFAStatus>;
424
- /**
425
- * Get MFA devices for the current user.
426
- *
427
- * @returns Promise of MFA devices array
428
- *
429
- * @example
430
- * ```typescript
431
- * const devices = await this.auth.getMfaDevices();
432
- * ```
433
- */
434
- getMfaDevices(): Promise<MFADevice[]>;
435
- /**
436
- * Setup MFA device (authenticated user).
437
- *
438
- * @param method - MFA method to set up
439
- * @returns Promise of setup data
440
- *
441
- * @example
442
- * ```typescript
443
- * const setupData = await this.auth.setupMfaDevice('totp');
444
- * ```
445
- */
446
- setupMfaDevice(method: string): Promise<unknown>;
447
- /**
448
- * Verify MFA setup (authenticated user).
449
- *
450
- * @param method - MFA method
451
- * @param setupData - Setup data from setupMfaDevice
452
- * @param deviceName - Optional device name
453
- * @returns Promise with device ID
454
- *
455
- * @example
456
- * ```typescript
457
- * const result = await this.auth.verifyMfaSetup('totp', { code: '123456' }, 'My Phone');
458
- * ```
459
- */
460
- verifyMfaSetup(method: string, setupData: Record<string, unknown>, deviceName?: string): Promise<{
461
- deviceId: number;
462
- }>;
463
- /**
464
- * Remove MFA device.
465
- *
466
- * @param method - MFA method to remove
467
- * @returns Promise with success message
468
- *
469
- * @example
470
- * ```typescript
471
- * await this.auth.removeMfaDevice('sms');
472
- * ```
473
- */
474
- removeMfaDevice(method: string): Promise<{
475
- message: string;
476
- }>;
477
- /**
478
- * Set preferred MFA method.
479
- *
480
- * @param method - Device method to set as preferred ('totp', 'sms', 'email', or 'passkey')
481
- * @returns Promise with success message
482
- *
483
- * @example
484
- * ```typescript
485
- * await this.auth.setPreferredMfaMethod('totp');
486
- * ```
487
- */
488
- setPreferredMfaMethod(method: 'totp' | 'sms' | 'email' | 'passkey'): Promise<{
489
- message: string;
490
- }>;
491
- /**
492
- * Generate backup codes.
493
- *
494
- * @returns Promise of backup codes array
495
- *
496
- * @example
497
- * ```typescript
498
- * const codes = await this.auth.generateBackupCodes();
499
- * console.log('Backup codes:', codes);
500
- * ```
501
- */
502
- generateBackupCodes(): Promise<string[]>;
503
- /**
504
- * Set MFA exemption (admin/test scenarios).
505
- *
506
- * @param exempt - Whether to exempt user from MFA
507
- * @param reason - Optional reason for exemption
508
- * @returns Promise that resolves when exemption is set
509
- *
510
- * @example
511
- * ```typescript
512
- * await this.auth.setMfaExemption(true, 'Test account');
513
- * ```
514
- */
515
- setMfaExemption(exempt: boolean, reason?: string): Promise<void>;
516
- /**
517
- * Trust current device.
518
- *
519
- * @returns Promise with device token
520
- *
521
- * @example
522
- * ```typescript
523
- * const result = await this.auth.trustDevice();
524
- * console.log('Device trusted:', result.deviceToken);
525
- * ```
526
- */
527
- trustDevice(): Promise<{
528
- deviceToken: string;
529
- }>;
530
- /**
531
- * Check if the current device is trusted.
532
- *
533
- * @returns Promise with trusted status
534
- *
535
- * @example
536
- * ```typescript
537
- * const result = await this.auth.isTrustedDevice();
538
- * if (result.trusted) {
539
- * console.log('This device is trusted');
540
- * }
541
- * ```
542
- */
543
- isTrustedDevice(): Promise<{
544
- trusted: boolean;
545
- }>;
546
- /**
547
- * Get paginated audit history for the current user.
548
- *
549
- * @param params - Query parameters for filtering and pagination
550
- * @returns Promise of audit history response
551
- *
552
- * @example
553
- * ```typescript
554
- * const history = await this.auth.getAuditHistory({
555
- * page: 1,
556
- * limit: 20,
557
- * eventType: 'LOGIN_SUCCESS'
558
- * });
559
- * console.log('Audit history:', history);
560
- * ```
561
- */
562
- getAuditHistory(params?: Record<string, string | number | boolean>): Promise<AuditHistoryResponse>;
563
- /**
564
- * Expose underlying NAuthClient for advanced scenarios.
565
- *
566
- * @deprecated All core functionality is now exposed directly on AuthService as Promises.
567
- * Use the direct methods on AuthService instead (e.g., `auth.changePassword()` instead of `auth.getClient().changePassword()`).
568
- * This method is kept for backward compatibility only and may be removed in a future version.
569
- *
570
- * @returns The underlying NAuthClient instance
571
- *
572
- * @example
573
- * ```typescript
574
- * // Deprecated - use direct methods instead
575
- * const status = await this.auth.getClient().getMfaStatus();
576
- *
577
- * // Preferred - use direct methods
578
- * const status = await this.auth.getMfaStatus();
579
- * ```
580
- */
581
- getClient(): NAuthClient;
582
- /**
583
- * Initialize by hydrating state from storage.
584
- * Called automatically on construction.
585
- */
586
- private initialize;
587
- /**
588
- * Update challenge state after auth response.
589
- */
590
- private updateChallengeState;
591
- static ɵfac: i0.ɵɵFactoryDeclaration<AuthService, [{ optional: true; }]>;
592
- static ɵprov: i0.ɵɵInjectableDeclaration<AuthService>;
593
- }
594
-
595
- /**
596
- * Angular HTTP interceptor for nauth-toolkit.
597
- *
598
- * Handles:
599
- * - Cookies mode: withCredentials + CSRF tokens + refresh via POST
600
- * - JSON mode: refresh via SDK, retry with new token
601
- */
602
- declare const authInterceptor: HttpInterceptorFn;
603
- /**
604
- * Class-based interceptor for NgModule compatibility.
605
- */
606
- declare class AuthInterceptor {
607
- intercept(req: HttpRequest<unknown>, next: HttpHandlerFn): rxjs.Observable<_angular_common_http.HttpEvent<unknown>>;
608
- }
609
-
610
- /**
611
- * Functional route guard for authentication (Angular 17+).
612
- *
613
- * Protects routes by checking if user is authenticated.
614
- * Redirects to login page if not authenticated.
615
- *
616
- * @param redirectTo - Path to redirect to if not authenticated (default: '/login')
617
- * @returns CanActivateFn guard function
618
- *
619
- * @example
620
- * ```typescript
621
- * // In route configuration
622
- * const routes: Routes = [
623
- * {
624
- * path: 'home',
625
- * component: HomeComponent,
626
- * canActivate: [authGuard()]
627
- * },
628
- * {
629
- * path: 'admin',
630
- * component: AdminComponent,
631
- * canActivate: [authGuard('/admin/login')]
632
- * }
633
- * ];
634
- * ```
635
- */
636
- declare function authGuard(redirectTo?: string): CanActivateFn;
637
- /**
638
- * Class-based authentication guard for NgModule compatibility.
639
- *
640
- * @example
641
- * ```typescript
642
- * // In route configuration (NgModule)
643
- * const routes: Routes = [
644
- * {
645
- * path: 'home',
646
- * component: HomeComponent,
647
- * canActivate: [AuthGuard]
648
- * }
649
- * ];
650
- *
651
- * // In module providers
652
- * @NgModule({
653
- * providers: [AuthGuard]
654
- * })
655
- * ```
656
- */
657
- declare class AuthGuard {
658
- private auth;
659
- private router;
660
- /**
661
- * @param auth - Authentication service
662
- * @param router - Angular router
663
- */
664
- constructor(auth: AuthService, router: Router);
665
- /**
666
- * Check if route can be activated.
667
- *
668
- * @returns True if authenticated, otherwise redirects to login
669
- */
670
- canActivate(): boolean | UrlTree;
671
- }
672
-
673
- /**
674
- * Social redirect callback route guard.
675
- *
676
- * This guard supports the redirect-first social flow where the backend redirects
677
- * back to the frontend with:
678
- * - `appState` (always optional)
679
- * - `exchangeToken` (present for json/hybrid flows, and for cookie flows that return a challenge)
680
- * - `error` / `error_description` (provider errors)
681
- *
682
- * Behavior:
683
- * - If `exchangeToken` exists: exchanges it via backend and redirects to success or challenge routes.
684
- * - If no `exchangeToken`: treat as cookie-success path and redirect to success route.
685
- * - If `error` exists: redirects to oauthError route.
686
- *
687
- * @example
688
- * ```typescript
689
- * import { socialRedirectCallbackGuard } from '@nauth-toolkit/client/angular';
690
- *
691
- * export const routes: Routes = [
692
- * { path: 'auth/callback', canActivate: [socialRedirectCallbackGuard], component: CallbackComponent },
693
- * ];
694
- * ```
695
- */
696
- declare const socialRedirectCallbackGuard: CanActivateFn;
697
-
698
- /**
699
- * NgModule wrapper to provide configuration and interceptor.
700
- */
701
- declare class NAuthModule {
702
- /**
703
- * Configure the module with client settings.
704
- *
705
- * @param config - Client configuration
706
- */
707
- static forRoot(config: NAuthClientConfig): ModuleWithProviders<NAuthModule>;
708
- static ɵfac: i0.ɵɵFactoryDeclaration<NAuthModule, never>;
709
- static ɵmod: i0.ɵɵNgModuleDeclaration<NAuthModule, never, never, never>;
710
- static ɵinj: i0.ɵɵInjectorDeclaration<NAuthModule>;
711
- }
712
-
713
- /**
714
- * HTTP adapter for Angular using HttpClient.
715
- *
716
- * This adapter:
717
- * - Uses Angular's HttpClient for all requests
718
- * - Works with Angular's HTTP interceptors (including authInterceptor)
719
- * - Auto-provided via Angular DI (providedIn: 'root')
720
- * - Converts HttpClient responses to HttpResponse format
721
- * - Converts HttpErrorResponse to NAuthClientError
722
- *
723
- * Users don't need to configure this manually - it's automatically
724
- * injected when using AuthService in Angular apps.
725
- *
726
- * @example
727
- * ```typescript
728
- * // Automatic usage (no manual setup needed)
729
- * // AuthService automatically injects AngularHttpAdapter
730
- * constructor(private auth: AuthService) {}
731
- * ```
732
- */
733
- declare class AngularHttpAdapter implements HttpAdapter {
734
- private readonly http;
735
- /**
736
- * Execute HTTP request using Angular's HttpClient.
737
- *
738
- * @param config - Request configuration
739
- * @returns Response with parsed data
740
- * @throws NAuthClientError if request fails
741
- */
742
- request<T>(config: HttpRequest$1): Promise<HttpResponse<T>>;
743
- static ɵfac: i0.ɵɵFactoryDeclaration<AngularHttpAdapter, never>;
744
- static ɵprov: i0.ɵɵInjectableDeclaration<AngularHttpAdapter>;
745
- }
746
-
747
- export { AngularHttpAdapter, AuthGuard, AuthInterceptor, AuthService, NAUTH_CLIENT_CONFIG, NAuthModule, authGuard, authInterceptor, socialRedirectCallbackGuard };