@nauth-toolkit/client 0.1.89 → 0.1.91

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/dist/index.d.ts CHANGED
@@ -223,6 +223,9 @@ interface ForceChangePasswordResponse extends BaseChallengeResponse {
223
223
 
224
224
  /**
225
225
  * Full user profile returned from profile endpoints.
226
+ *
227
+ * Matches UserResponseDto structure from backend.
228
+ * Used for both user-level and admin-level responses.
226
229
  */
227
230
  interface AuthUser {
228
231
  sub: string;
@@ -233,8 +236,17 @@ interface AuthUser {
233
236
  phone?: string | null;
234
237
  isEmailVerified: boolean;
235
238
  isPhoneVerified: boolean;
236
- isActive?: boolean;
237
- mfaEnabled?: boolean;
239
+ isActive: boolean;
240
+ /**
241
+ * Account lock status
242
+ * Locked accounts cannot login until unlocked
243
+ */
244
+ isLocked: boolean;
245
+ mfaEnabled: boolean;
246
+ /**
247
+ * MFA exemption status (admin-granted bypass of MFA at login)
248
+ */
249
+ mfaExempt?: boolean;
238
250
  socialProviders?: string[] | null;
239
251
  hasPasswordHash: boolean;
240
252
  /**
@@ -244,8 +256,8 @@ interface AuthUser {
244
256
  * Use `hasPasswordHash` and `socialProviders` to determine what login methods the account supports.
245
257
  */
246
258
  sessionAuthMethod?: string | null;
247
- createdAt?: string | Date;
248
- updatedAt?: string | Date;
259
+ createdAt: string | Date;
260
+ updatedAt: string | Date;
249
261
  }
250
262
  /**
251
263
  * Profile update request.
@@ -322,7 +334,7 @@ type SocialProvider = 'google' | 'apple' | 'facebook';
322
334
  interface SocialLoginOptions {
323
335
  /**
324
336
  * Frontend route (recommended) or URL to redirect to after the backend callback completes.
325
- * Default: config.redirects.success || '/'
337
+ * Default: config.redirects.loginSuccess || config.redirects.success || '/'
326
338
  */
327
339
  returnTo?: string;
328
340
  /**
@@ -575,6 +587,45 @@ interface NAuthEndpoints {
575
587
  auditHistory: string;
576
588
  updateProfile: string;
577
589
  }
590
+ /**
591
+ * Admin endpoint paths for administrative operations.
592
+ */
593
+ interface NAuthAdminEndpoints {
594
+ /** POST /signup - Create user */
595
+ signup: string;
596
+ /** POST /signup-social - Import social user */
597
+ signupSocial: string;
598
+ /** GET /users - List users with filters */
599
+ getUsers: string;
600
+ /** GET /users/:sub - Get user by sub */
601
+ getUser: string;
602
+ /** DELETE /users/:sub - Delete user */
603
+ deleteUser: string;
604
+ /** POST /users/:sub/disable - Disable user account */
605
+ disableUser: string;
606
+ /** POST /users/:sub/enable - Enable user account */
607
+ enableUser: string;
608
+ /** POST /users/:sub/force-password-change - Force password change */
609
+ forcePasswordChange: string;
610
+ /** POST /set-password - Set password for user */
611
+ setPassword: string;
612
+ /** POST /reset-password/initiate - Initiate password reset */
613
+ resetPasswordInitiate: string;
614
+ /** GET /users/:sub/sessions - Get user sessions */
615
+ getUserSessions: string;
616
+ /** POST /users/:sub/logout-all - Logout all sessions */
617
+ logoutAll: string;
618
+ /** GET /users/:sub/mfa/status - Get MFA status */
619
+ getMfaStatus: string;
620
+ /** POST /mfa/preferred-method - Set preferred MFA method */
621
+ setPreferredMfaMethod: string;
622
+ /** POST /mfa/remove-devices - Remove MFA devices */
623
+ removeMfaDevices: string;
624
+ /** POST /mfa/exemption - Set MFA exemption */
625
+ setMfaExemption: string;
626
+ /** GET /audit/history - Get audit history */
627
+ getAuditHistory: string;
628
+ }
578
629
  /**
579
630
  * Context provided to onAuthResponse callback.
580
631
  */
@@ -585,6 +636,11 @@ interface AuthResponseContext {
585
636
  provider?: string;
586
637
  /** Whether this was triggered from a guard */
587
638
  fromGuard?: boolean;
639
+ /**
640
+ * OAuth appState from social redirect callback.
641
+ * Only present when source is 'social' and appState was provided in the OAuth flow.
642
+ */
643
+ appState?: string;
588
644
  }
589
645
  /**
590
646
  * MFA-specific route configuration.
@@ -604,10 +660,40 @@ interface MfaRoutesConfig {
604
660
  */
605
661
  interface NAuthRedirectsConfig {
606
662
  /**
607
- * URL to redirect to after successful authentication (login, signup, or OAuth).
663
+ * URL to redirect to after successful login (and most non-signup successes).
664
+ *
665
+ * Set to `null` to disable SDK auto-navigation.
666
+ * This is useful when you want to handle routing manually via framework adapters
667
+ * (e.g., Angular `authEvents$`) without using `onAuthResponse`.
668
+ *
608
669
  * @default '/'
609
670
  */
610
- success?: string;
671
+ loginSuccess?: string | null;
672
+ /**
673
+ * URL to redirect to after successful signup (when no challenge is returned).
674
+ *
675
+ * Notes:
676
+ * - Challenges (MFA, verify-email, etc.) still route to challenge pages.
677
+ * - After a challenge completes, the context source becomes `'challenge'`, so
678
+ * `loginSuccess` is used for the final success navigation.
679
+ *
680
+ * Set to `null` to disable SDK auto-navigation.
681
+ *
682
+ * @example Custom onboarding after signup
683
+ * ```typescript
684
+ * redirects: {
685
+ * loginSuccess: '/dashboard',
686
+ * signupSuccess: '/onboarding',
687
+ * }
688
+ * ```
689
+ */
690
+ signupSuccess?: string | null;
691
+ /**
692
+ * Legacy alias for `loginSuccess`.
693
+ *
694
+ * @deprecated Use `redirects.loginSuccess` instead.
695
+ */
696
+ success?: string | null;
611
697
  /**
612
698
  * URL to redirect to when session expires (refresh fails with 401).
613
699
  * @default '/login'
@@ -815,6 +901,47 @@ interface NAuthClientConfig {
815
901
  * ```
816
902
  */
817
903
  httpAdapter?: HttpAdapter;
904
+ /**
905
+ * Admin operations configuration (optional).
906
+ * If provided, enables client.admin.* methods.
907
+ *
908
+ * @example
909
+ * ```typescript
910
+ * const client = new NAuthClient({
911
+ * baseUrl: 'https://api.example.com/auth',
912
+ * tokenDelivery: 'cookies',
913
+ * admin: {
914
+ * pathPrefix: '/admin',
915
+ * endpoints: {
916
+ * getUsers: '/users/list', // Override specific endpoint
917
+ * },
918
+ * headers: {
919
+ * 'X-Admin-Context': 'dashboard',
920
+ * },
921
+ * },
922
+ * });
923
+ * ```
924
+ */
925
+ admin?: {
926
+ /**
927
+ * Path prefix for admin endpoints.
928
+ * Prepended to all admin endpoint paths.
929
+ * @default '/admin'
930
+ * @example '/admin' -> /auth/admin/users
931
+ */
932
+ pathPrefix?: string;
933
+ /**
934
+ * Custom admin endpoint overrides.
935
+ * Merged with default admin endpoints.
936
+ */
937
+ endpoints?: Partial<NAuthAdminEndpoints>;
938
+ /**
939
+ * Additional headers specific to admin requests.
940
+ * Merged with main client headers.
941
+ * @example { 'X-Admin-Role': 'super-admin' }
942
+ */
943
+ headers?: Record<string, string>;
944
+ };
818
945
  }
819
946
 
820
947
  /**
@@ -883,14 +1010,634 @@ interface AuthAuditEvent {
883
1010
  createdAt: string | Date;
884
1011
  }
885
1012
  /**
886
- * Paginated audit history response.
1013
+ * Paginated audit history response.
1014
+ */
1015
+ interface AuditHistoryResponse {
1016
+ data: AuthAuditEvent[];
1017
+ total: number;
1018
+ page: number;
1019
+ limit: number;
1020
+ totalPages: number;
1021
+ }
1022
+
1023
+ /**
1024
+ * Admin user creation request
1025
+ *
1026
+ * Allows administrators to create user accounts with override capabilities:
1027
+ * - Bypass email/phone verification requirements
1028
+ * - Force password change on first login
1029
+ * - Auto-generate secure passwords
1030
+ *
1031
+ * @example
1032
+ * ```typescript
1033
+ * // Create user with pre-verified email
1034
+ * const request: AdminSignupRequest = {
1035
+ * email: 'user@example.com',
1036
+ * password: 'SecurePass123!',
1037
+ * isEmailVerified: true,
1038
+ * mustChangePassword: false,
1039
+ * };
1040
+ *
1041
+ * // Create user with auto-generated password
1042
+ * const request: AdminSignupRequest = {
1043
+ * email: 'user@example.com',
1044
+ * generatePassword: true,
1045
+ * isEmailVerified: true,
1046
+ * mustChangePassword: true,
1047
+ * };
1048
+ * ```
1049
+ */
1050
+ interface AdminSignupRequest {
1051
+ /**
1052
+ * User email address
1053
+ */
1054
+ email: string;
1055
+ /**
1056
+ * User password
1057
+ * Required unless generatePassword is true
1058
+ */
1059
+ password?: string;
1060
+ /**
1061
+ * Optional username
1062
+ */
1063
+ username?: string;
1064
+ /**
1065
+ * Optional first name
1066
+ */
1067
+ firstName?: string;
1068
+ /**
1069
+ * Optional last name
1070
+ */
1071
+ lastName?: string;
1072
+ /**
1073
+ * Optional phone number (E.164 format)
1074
+ */
1075
+ phone?: string;
1076
+ /**
1077
+ * Optional metadata (custom fields)
1078
+ */
1079
+ metadata?: Record<string, unknown>;
1080
+ /**
1081
+ * Bypass email verification requirement
1082
+ * Default: false
1083
+ */
1084
+ isEmailVerified?: boolean;
1085
+ /**
1086
+ * Bypass phone verification requirement
1087
+ * Default: false
1088
+ */
1089
+ isPhoneVerified?: boolean;
1090
+ /**
1091
+ * Force password change on first login
1092
+ * Default: false
1093
+ */
1094
+ mustChangePassword?: boolean;
1095
+ /**
1096
+ * Auto-generate secure password
1097
+ * Default: false
1098
+ */
1099
+ generatePassword?: boolean;
1100
+ }
1101
+
1102
+ /**
1103
+ * Admin user creation response
1104
+ *
1105
+ * Returns the created user object (sanitized, excludes sensitive fields like passwordHash)
1106
+ * and optionally the generated password (only if generatePassword was true in the request).
1107
+ */
1108
+ interface AdminSignupResponse {
1109
+ /**
1110
+ * Created user object (same structure as AuthUser)
1111
+ */
1112
+ user: AuthUser;
1113
+ /**
1114
+ * Generated password (only present if generatePassword was true)
1115
+ * Security: This is returned once and never stored in plain text.
1116
+ */
1117
+ generatedPassword?: string;
1118
+ }
1119
+ /**
1120
+ * Admin social user import request
1121
+ *
1122
+ * Allows administrators to import existing social users from external platforms
1123
+ * (e.g., Cognito, Auth0) with social account linkage.
1124
+ *
1125
+ * @example
1126
+ * ```typescript
1127
+ * // Import social-only user from Cognito
1128
+ * const request: AdminSignupSocialRequest = {
1129
+ * email: 'user@example.com',
1130
+ * provider: 'google',
1131
+ * providerId: 'google_12345',
1132
+ * providerEmail: 'user@gmail.com',
1133
+ * socialMetadata: { sub: 'google_12345', given_name: 'John' },
1134
+ * };
1135
+ *
1136
+ * // Import hybrid user with password + social
1137
+ * const request: AdminSignupSocialRequest = {
1138
+ * email: 'user@example.com',
1139
+ * password: 'SecurePass123!',
1140
+ * provider: 'apple',
1141
+ * providerId: 'apple_67890',
1142
+ * };
1143
+ * ```
1144
+ */
1145
+ interface AdminSignupSocialRequest {
1146
+ /**
1147
+ * User email address
1148
+ */
1149
+ email: string;
1150
+ /**
1151
+ * Social provider name
1152
+ */
1153
+ provider: 'google' | 'apple' | 'facebook';
1154
+ /**
1155
+ * Provider's unique user identifier
1156
+ */
1157
+ providerId: string;
1158
+ /**
1159
+ * Provider's email address (optional)
1160
+ */
1161
+ providerEmail?: string;
1162
+ /**
1163
+ * Optional username
1164
+ */
1165
+ username?: string;
1166
+ /**
1167
+ * Optional first name
1168
+ */
1169
+ firstName?: string;
1170
+ /**
1171
+ * Optional last name
1172
+ */
1173
+ lastName?: string;
1174
+ /**
1175
+ * Optional phone number (E.164 format)
1176
+ */
1177
+ phone?: string;
1178
+ /**
1179
+ * Optional password for hybrid social+password accounts
1180
+ */
1181
+ password?: string;
1182
+ /**
1183
+ * Bypass phone verification requirement
1184
+ * Default: false
1185
+ */
1186
+ isPhoneVerified?: boolean;
1187
+ /**
1188
+ * Force password change on first login
1189
+ * Default: false
1190
+ */
1191
+ mustChangePassword?: boolean;
1192
+ /**
1193
+ * Raw OAuth profile data from provider
1194
+ */
1195
+ socialMetadata?: Record<string, unknown>;
1196
+ /**
1197
+ * Optional metadata (custom fields)
1198
+ */
1199
+ metadata?: Record<string, unknown>;
1200
+ }
1201
+ /**
1202
+ * Admin social user import response
1203
+ *
1204
+ * Returns the created user object and social account information for confirmation.
1205
+ */
1206
+ interface AdminSignupSocialResponse {
1207
+ /**
1208
+ * Created user object (same structure as AuthUser)
1209
+ */
1210
+ user: AuthUser;
1211
+ /**
1212
+ * Social account information
1213
+ */
1214
+ socialAccount: {
1215
+ /**
1216
+ * Social provider name
1217
+ */
1218
+ provider: string;
1219
+ /**
1220
+ * Provider's unique user identifier
1221
+ */
1222
+ providerId: string;
1223
+ /**
1224
+ * Provider's email address (if available)
1225
+ */
1226
+ providerEmail: string | null;
1227
+ };
1228
+ }
1229
+ /**
1230
+ * Date filter with operator support
1231
+ *
1232
+ * Supports gt (greater than), gte (greater than or equal), lt (less than),
1233
+ * lte (less than or equal), eq (equal) operators for date comparisons.
1234
+ */
1235
+ interface DateFilter {
1236
+ /**
1237
+ * Comparison operator
1238
+ */
1239
+ operator: 'gt' | 'gte' | 'lt' | 'lte' | 'eq';
1240
+ /**
1241
+ * Date value to compare against
1242
+ */
1243
+ value: Date | string;
1244
+ }
1245
+ /**
1246
+ * Get users request with filters
1247
+ *
1248
+ * Supports pagination, boolean filters, exact match filters,
1249
+ * date filters with operators, and flexible sorting.
1250
+ *
1251
+ * @example
1252
+ * ```typescript
1253
+ * const request: GetUsersRequest = {
1254
+ * page: 1,
1255
+ * limit: 20,
1256
+ * isEmailVerified: true,
1257
+ * hasSocialAuth: true,
1258
+ * createdAt: { operator: 'gte', value: new Date('2024-01-01') },
1259
+ * sortBy: 'email',
1260
+ * sortOrder: 'ASC',
1261
+ * };
1262
+ * ```
1263
+ */
1264
+ interface GetUsersRequest {
1265
+ /**
1266
+ * Page number (1-indexed)
1267
+ * Default: 1
1268
+ */
1269
+ page?: number;
1270
+ /**
1271
+ * Number of records per page
1272
+ * Default: 10, Max: 100
1273
+ */
1274
+ limit?: number;
1275
+ /**
1276
+ * Filter by email address (partial match)
1277
+ */
1278
+ email?: string;
1279
+ /**
1280
+ * Filter by phone number (partial match)
1281
+ */
1282
+ phone?: string;
1283
+ /**
1284
+ * Filter by email verification status
1285
+ */
1286
+ isEmailVerified?: boolean;
1287
+ /**
1288
+ * Filter by phone verification status
1289
+ */
1290
+ isPhoneVerified?: boolean;
1291
+ /**
1292
+ * Filter by social auth presence
1293
+ */
1294
+ hasSocialAuth?: boolean;
1295
+ /**
1296
+ * Filter by account lock status
1297
+ */
1298
+ isLocked?: boolean;
1299
+ /**
1300
+ * Filter by MFA enabled status
1301
+ */
1302
+ mfaEnabled?: boolean;
1303
+ /**
1304
+ * Filter by account creation date
1305
+ */
1306
+ createdAt?: DateFilter;
1307
+ /**
1308
+ * Filter by last update date
1309
+ */
1310
+ updatedAt?: DateFilter;
1311
+ /**
1312
+ * Field to sort by
1313
+ * Default: createdAt
1314
+ */
1315
+ sortBy?: 'email' | 'createdAt' | 'updatedAt' | 'username' | 'phone';
1316
+ /**
1317
+ * Sort order
1318
+ * Default: DESC
1319
+ */
1320
+ sortOrder?: 'ASC' | 'DESC';
1321
+ }
1322
+ /**
1323
+ * Get users response with pagination
1324
+ *
1325
+ * Uses AuthUser type - admin endpoints return the same sanitized user object as user endpoints.
1326
+ */
1327
+ interface GetUsersResponse {
1328
+ /**
1329
+ * Array of sanitized user objects (same as AuthUser)
1330
+ */
1331
+ users: AuthUser[];
1332
+ /**
1333
+ * Pagination metadata
1334
+ */
1335
+ pagination: {
1336
+ /**
1337
+ * Current page number
1338
+ */
1339
+ page: number;
1340
+ /**
1341
+ * Number of records per page
1342
+ */
1343
+ limit: number;
1344
+ /**
1345
+ * Total number of records matching the query
1346
+ */
1347
+ total: number;
1348
+ /**
1349
+ * Total number of pages
1350
+ */
1351
+ totalPages: number;
1352
+ };
1353
+ }
1354
+ /**
1355
+ * Delete user response
1356
+ *
1357
+ * Returns deletion confirmation with cascade cleanup information.
1358
+ */
1359
+ interface DeleteUserResponse {
1360
+ /**
1361
+ * Success indicator
1362
+ */
1363
+ success: boolean;
1364
+ /**
1365
+ * Deleted user ID
1366
+ */
1367
+ deletedUserId: string;
1368
+ /**
1369
+ * Number of related records deleted
1370
+ */
1371
+ deletedRecords: {
1372
+ /**
1373
+ * Number of sessions deleted
1374
+ */
1375
+ sessions: number;
1376
+ /**
1377
+ * Number of verification tokens deleted
1378
+ */
1379
+ verificationTokens: number;
1380
+ /**
1381
+ * Number of MFA devices deleted
1382
+ */
1383
+ mfaDevices: number;
1384
+ /**
1385
+ * Number of trusted devices deleted
1386
+ */
1387
+ trustedDevices: number;
1388
+ /**
1389
+ * Number of social accounts deleted
1390
+ */
1391
+ socialAccounts: number;
1392
+ /**
1393
+ * Number of login attempts deleted
1394
+ */
1395
+ loginAttempts: number;
1396
+ /**
1397
+ * Number of challenge sessions deleted
1398
+ */
1399
+ challengeSessions: number;
1400
+ /**
1401
+ * Number of audit logs deleted
1402
+ */
1403
+ auditLogs: number;
1404
+ };
1405
+ }
1406
+ /**
1407
+ * Disable user response
1408
+ *
1409
+ * Returns disable confirmation with updated user and revoked session count.
1410
+ */
1411
+ interface DisableUserResponse {
1412
+ /**
1413
+ * Success indicator
1414
+ */
1415
+ success: boolean;
1416
+ /**
1417
+ * Updated user object (same as AuthUser)
1418
+ */
1419
+ user: AuthUser;
1420
+ /**
1421
+ * Number of sessions revoked
1422
+ */
1423
+ revokedSessions: number;
1424
+ }
1425
+ /**
1426
+ * Enable user response
1427
+ *
1428
+ * Returns enable confirmation with updated user.
1429
+ */
1430
+ interface EnableUserResponse {
1431
+ /**
1432
+ * Success indicator
1433
+ */
1434
+ success: boolean;
1435
+ /**
1436
+ * Updated user object (same as AuthUser)
1437
+ */
1438
+ user: AuthUser;
1439
+ }
1440
+ /**
1441
+ * Admin password reset request
1442
+ *
1443
+ * Request for admin-initiated password reset workflow.
1444
+ * Allows resetting a user's password by sub (UUID).
1445
+ *
1446
+ * @example
1447
+ * ```typescript
1448
+ * // With link for consumer app custom UI
1449
+ * const request: AdminResetPasswordRequest = {
1450
+ * sub: 'a21b654c-2746-4168-acee-c175083a65cd',
1451
+ * baseUrl: 'https://myapp.com/reset-password',
1452
+ * deliveryMethod: 'email',
1453
+ * revokeSessions: true,
1454
+ * };
1455
+ *
1456
+ * // Code only (no link)
1457
+ * const request: AdminResetPasswordRequest = {
1458
+ * sub: 'a21b654c-2746-4168-acee-c175083a65cd',
1459
+ * deliveryMethod: 'email',
1460
+ * };
1461
+ * ```
1462
+ */
1463
+ interface AdminResetPasswordRequest {
1464
+ /**
1465
+ * User sub (UUID v4)
1466
+ */
1467
+ sub: string;
1468
+ /**
1469
+ * Delivery method for reset code
1470
+ * Default: 'email'
1471
+ */
1472
+ deliveryMethod?: 'email' | 'sms';
1473
+ /**
1474
+ * Base URL for building reset link
1475
+ * Optional: Allows consumer apps to build custom reset UI
1476
+ */
1477
+ baseUrl?: string;
1478
+ /**
1479
+ * Code expiry in seconds
1480
+ * Default: 3600 (1 hour)
1481
+ * Min: 300 (5 minutes), Max: 86400 (24 hours)
1482
+ */
1483
+ codeExpiresIn?: number;
1484
+ /**
1485
+ * Revoke all active sessions immediately (before sending email)
1486
+ * Default: false
1487
+ */
1488
+ revokeSessions?: boolean;
1489
+ /**
1490
+ * Reason for admin-initiated reset (for audit trail)
1491
+ * Max: 500 characters
1492
+ */
1493
+ reason?: string;
1494
+ }
1495
+ /**
1496
+ * Admin password reset response
1497
+ *
1498
+ * Response for admin-initiated password reset request.
1499
+ */
1500
+ interface AdminResetPasswordResponse {
1501
+ /**
1502
+ * Success indicator
1503
+ */
1504
+ success: boolean;
1505
+ /**
1506
+ * Masked destination where code was sent
1507
+ * Example: "u***r@example.com" | "***-***-5678"
1508
+ */
1509
+ destination?: string;
1510
+ /**
1511
+ * Delivery medium used
1512
+ */
1513
+ deliveryMedium?: 'email' | 'sms';
1514
+ /**
1515
+ * Code expiry in seconds
1516
+ */
1517
+ expiresIn?: number;
1518
+ /**
1519
+ * Number of sessions revoked (if revokeSessions was true)
1520
+ */
1521
+ sessionsRevoked?: number;
1522
+ }
1523
+ /**
1524
+ * Session information in user sessions response
1525
+ */
1526
+ interface UserSessionInfo {
1527
+ /**
1528
+ * Session ID
1529
+ */
1530
+ sessionId: string;
1531
+ /**
1532
+ * Device ID
1533
+ */
1534
+ deviceId: string | null;
1535
+ /**
1536
+ * Device name
1537
+ */
1538
+ deviceName: string | null;
1539
+ /**
1540
+ * Device type
1541
+ */
1542
+ deviceType: string | null;
1543
+ /**
1544
+ * Platform
1545
+ */
1546
+ platform: string | null;
1547
+ /**
1548
+ * Browser
1549
+ */
1550
+ browser: string | null;
1551
+ /**
1552
+ * IP address
1553
+ */
1554
+ ipAddress: string | null;
1555
+ /**
1556
+ * IP country
1557
+ */
1558
+ ipCountry: string | null;
1559
+ /**
1560
+ * IP city
1561
+ */
1562
+ ipCity: string | null;
1563
+ /**
1564
+ * Last activity timestamp
1565
+ */
1566
+ lastActivityAt: Date | string;
1567
+ /**
1568
+ * Session creation timestamp
1569
+ */
1570
+ createdAt: Date | string;
1571
+ /**
1572
+ * Session expiration timestamp
1573
+ */
1574
+ expiresAt: Date | string;
1575
+ /**
1576
+ * Whether session is remembered
1577
+ */
1578
+ isRemembered: boolean;
1579
+ /**
1580
+ * Whether this is the current session
1581
+ */
1582
+ isCurrent: boolean;
1583
+ /**
1584
+ * Authentication method used for this session
1585
+ * Examples: 'password', 'social', 'admin', 'admin-social'
1586
+ */
1587
+ authMethod: string | null;
1588
+ /**
1589
+ * OAuth provider name (only present for social logins)
1590
+ * Examples: 'google', 'facebook', 'github', 'apple'
1591
+ */
1592
+ authProvider: string | null;
1593
+ }
1594
+ /**
1595
+ * Get user sessions response
1596
+ */
1597
+ interface GetUserSessionsResponse {
1598
+ /**
1599
+ * Array of user sessions
1600
+ */
1601
+ sessions: UserSessionInfo[];
1602
+ }
1603
+ /**
1604
+ * Admin audit history request
1605
+ *
1606
+ * Request for getting user authentication history (admin-only).
1607
+ *
1608
+ * @example
1609
+ * ```typescript
1610
+ * const request: AdminAuditHistoryRequest = {
1611
+ * sub: 'user-uuid',
1612
+ * page: 1,
1613
+ * limit: 50,
1614
+ * eventType: 'LOGIN_SUCCESS',
1615
+ * eventStatus: 'SUCCESS',
1616
+ * };
1617
+ * ```
887
1618
  */
888
- interface AuditHistoryResponse {
889
- data: AuthAuditEvent[];
890
- total: number;
891
- page: number;
892
- limit: number;
893
- totalPages: number;
1619
+ interface AdminAuditHistoryRequest {
1620
+ /**
1621
+ * User's unique identifier (UUID v4)
1622
+ * Required for admin operations
1623
+ */
1624
+ sub: string;
1625
+ /**
1626
+ * Page number (1-indexed)
1627
+ */
1628
+ page?: number;
1629
+ /**
1630
+ * Number of records per page
1631
+ */
1632
+ limit?: number;
1633
+ /**
1634
+ * Filter by event type
1635
+ */
1636
+ eventType?: string;
1637
+ /**
1638
+ * Filter by event status
1639
+ */
1640
+ eventStatus?: string;
894
1641
  }
895
1642
 
896
1643
  /**
@@ -1177,11 +1924,20 @@ type ResolvedNAuthClientConfig = Omit<NAuthClientConfig, 'endpoints' | 'storage'
1177
1924
  };
1178
1925
  headers: Record<string, string>;
1179
1926
  timeout: number;
1927
+ admin?: {
1928
+ pathPrefix: string;
1929
+ endpoints: NAuthAdminEndpoints;
1930
+ headers: Record<string, string>;
1931
+ };
1180
1932
  };
1181
1933
  /**
1182
1934
  * Default endpoint paths matching backend controller.
1183
1935
  */
1184
1936
  declare const defaultEndpoints: NAuthEndpoints;
1937
+ /**
1938
+ * Default admin endpoint paths matching backend admin controller.
1939
+ */
1940
+ declare const defaultAdminEndpoints: NAuthAdminEndpoints;
1185
1941
  /**
1186
1942
  * Normalize user config with defaults.
1187
1943
  *
@@ -1233,7 +1989,8 @@ declare const resolveConfig: (config: NAuthClientConfig, defaultAdapter: HttpAda
1233
1989
  */
1234
1990
  declare class ChallengeRouter {
1235
1991
  private config;
1236
- constructor(config: ResolvedNAuthClientConfig);
1992
+ private oauthStorage;
1993
+ constructor(config: ResolvedNAuthClientConfig, oauthStorage: NAuthStorageAdapter);
1237
1994
  /**
1238
1995
  * Handle auth response - either call callback or auto-navigate.
1239
1996
  *
@@ -1241,6 +1998,18 @@ declare class ChallengeRouter {
1241
1998
  * @param context - Context about the auth operation
1242
1999
  */
1243
2000
  handleAuthResponse(response: AuthResponse, context: AuthResponseContext): Promise<void>;
2001
+ /**
2002
+ * Resolve the configured success URL based on context and explicit override keys.
2003
+ *
2004
+ * IMPORTANT:
2005
+ * - `null` explicitly disables auto-navigation (caller should rely on framework events / custom routing).
2006
+ * - `undefined` / missing keys fall back to other configured values or defaults.
2007
+ * - Falls back to legacy `redirects.success` when new keys are not set.
2008
+ *
2009
+ * @param context - Auth response context
2010
+ * @returns URL string, or null when auto-navigation is disabled
2011
+ */
2012
+ private resolveSuccessUrl;
1244
2013
  /**
1245
2014
  * Navigate to appropriate challenge route.
1246
2015
  *
@@ -1251,15 +2020,20 @@ declare class ChallengeRouter {
1251
2020
  * Navigate to success URL.
1252
2021
  *
1253
2022
  * @param queryParams - Optional query parameters to append to the success URL
2023
+ * @param context - Optional auth context for selecting the success route
1254
2024
  *
1255
2025
  * @example
1256
2026
  * ```typescript
1257
2027
  * await router.navigateToSuccess({ appState: 'invite-code-123' });
1258
2028
  * ```
1259
2029
  */
1260
- navigateToSuccess(queryParams?: Record<string, string>): Promise<void>;
2030
+ navigateToSuccess(queryParams?: Record<string, string | null | undefined>, context?: AuthResponseContext): Promise<void>;
1261
2031
  /**
1262
- * Retrieve stored OAuth appState from storage.
2032
+ * Retrieve stored OAuth appState from sessionStorage.
2033
+ *
2034
+ * NOTE: This method does NOT clear the storage. Only the public getLastOauthState() API clears it.
2035
+ * This allows the SDK to read appState for auto-navigation while still making it available to
2036
+ * consumers via the public API.
1263
2037
  *
1264
2038
  * @returns Query params object with appState if present, undefined otherwise
1265
2039
  */
@@ -1313,6 +2087,429 @@ declare class ChallengeRouter {
1313
2087
  getChallengeUrl(response: AuthResponse): string;
1314
2088
  }
1315
2089
 
2090
+ /**
2091
+ * Admin operations for user and system management.
2092
+ * Accessed via client.admin.*
2093
+ *
2094
+ * Provides admin-level operations including:
2095
+ * - User CRUD operations
2096
+ * - Password management (set, reset)
2097
+ * - Session management
2098
+ * - MFA management
2099
+ * - Audit history
2100
+ *
2101
+ * @example
2102
+ * ```typescript
2103
+ * const client = new NAuthClient({
2104
+ * baseUrl: 'https://api.example.com/auth',
2105
+ * tokenDelivery: 'cookies',
2106
+ * admin: {
2107
+ * pathPrefix: '/admin'
2108
+ * }
2109
+ * });
2110
+ *
2111
+ * // User management
2112
+ * const user = await client.admin.createUser({
2113
+ * email: 'user@example.com',
2114
+ * password: 'SecurePass123!',
2115
+ * isEmailVerified: true,
2116
+ * });
2117
+ *
2118
+ * // Get users with filters
2119
+ * const users = await client.admin.getUsers({
2120
+ * page: 1,
2121
+ * limit: 20,
2122
+ * mfaEnabled: false
2123
+ * });
2124
+ *
2125
+ * // Delete user (handles :sub path param)
2126
+ * await client.admin.deleteUser('user-uuid');
2127
+ * ```
2128
+ */
2129
+ declare class AdminOperations {
2130
+ private readonly config;
2131
+ private readonly adminEndpoints;
2132
+ private readonly adminPathPrefix;
2133
+ private readonly adminHeaders;
2134
+ /**
2135
+ * Create admin operations instance.
2136
+ *
2137
+ * @param config - Resolved client configuration
2138
+ */
2139
+ constructor(config: ResolvedNAuthClientConfig);
2140
+ /**
2141
+ * Create a new user (admin operation)
2142
+ *
2143
+ * Allows creating users with:
2144
+ * - Pre-verified email/phone
2145
+ * - Auto-generated passwords
2146
+ * - Force password change flag
2147
+ *
2148
+ * @param request - User creation request
2149
+ * @returns Created user and optional generated password
2150
+ * @throws {NAuthClientError} If creation fails
2151
+ *
2152
+ * @example
2153
+ * ```typescript
2154
+ * const result = await client.admin.createUser({
2155
+ * email: 'user@example.com',
2156
+ * password: 'SecurePass123!',
2157
+ * isEmailVerified: true,
2158
+ * });
2159
+ *
2160
+ * // With auto-generated password
2161
+ * const result = await client.admin.createUser({
2162
+ * email: 'user@example.com',
2163
+ * generatePassword: true,
2164
+ * mustChangePassword: true,
2165
+ * });
2166
+ * console.log('Generated password:', result.generatedPassword);
2167
+ * ```
2168
+ */
2169
+ createUser(request: AdminSignupRequest): Promise<AdminSignupResponse>;
2170
+ /**
2171
+ * Import social user (admin operation)
2172
+ *
2173
+ * Imports existing social users from external platforms (e.g., Cognito, Auth0)
2174
+ * with social account linkage.
2175
+ *
2176
+ * @param request - Social user import request
2177
+ * @returns Created user and social account info
2178
+ * @throws {NAuthClientError} If import fails
2179
+ *
2180
+ * @example
2181
+ * ```typescript
2182
+ * const result = await client.admin.importSocialUser({
2183
+ * email: 'user@example.com',
2184
+ * provider: 'google',
2185
+ * providerId: 'google_12345',
2186
+ * providerEmail: 'user@gmail.com',
2187
+ * });
2188
+ * ```
2189
+ */
2190
+ importSocialUser(request: AdminSignupSocialRequest): Promise<AdminSignupSocialResponse>;
2191
+ /**
2192
+ * Get users with filters and pagination
2193
+ *
2194
+ * @param params - Filter and pagination params
2195
+ * @returns Paginated user list
2196
+ * @throws {NAuthClientError} If request fails
2197
+ *
2198
+ * @example
2199
+ * ```typescript
2200
+ * const result = await client.admin.getUsers({
2201
+ * page: 1,
2202
+ * limit: 20,
2203
+ * isEmailVerified: true,
2204
+ * mfaEnabled: false,
2205
+ * sortBy: 'createdAt',
2206
+ * sortOrder: 'DESC',
2207
+ * });
2208
+ * ```
2209
+ */
2210
+ getUsers(params?: GetUsersRequest): Promise<GetUsersResponse>;
2211
+ /**
2212
+ * Get user by sub (UUID)
2213
+ *
2214
+ * @param sub - User UUID
2215
+ * @returns User object
2216
+ * @throws {NAuthClientError} If user not found
2217
+ *
2218
+ * @example
2219
+ * ```typescript
2220
+ * const user = await client.admin.getUser('a21b654c-2746-4168-acee-c175083a65cd');
2221
+ * ```
2222
+ */
2223
+ getUser(sub: string): Promise<AuthUser>;
2224
+ /**
2225
+ * Delete user with cascade cleanup
2226
+ *
2227
+ * @param sub - User UUID
2228
+ * @returns Deletion confirmation with cascade counts
2229
+ * @throws {NAuthClientError} If deletion fails
2230
+ *
2231
+ * @example
2232
+ * ```typescript
2233
+ * const result = await client.admin.deleteUser('user-uuid');
2234
+ * console.log('Deleted records:', result.deletedRecords);
2235
+ * ```
2236
+ */
2237
+ deleteUser(sub: string): Promise<DeleteUserResponse>;
2238
+ /**
2239
+ * Disable user account (permanent lock)
2240
+ *
2241
+ * @param sub - User UUID
2242
+ * @param reason - Optional reason for disabling
2243
+ * @returns Disable confirmation with revoked session count
2244
+ * @throws {NAuthClientError} If operation fails
2245
+ *
2246
+ * @example
2247
+ * ```typescript
2248
+ * const result = await client.admin.disableUser(
2249
+ * 'user-uuid',
2250
+ * 'Account compromised'
2251
+ * );
2252
+ * console.log('Revoked sessions:', result.revokedSessions);
2253
+ * ```
2254
+ */
2255
+ disableUser(sub: string, reason?: string): Promise<DisableUserResponse>;
2256
+ /**
2257
+ * Enable (unlock) user account
2258
+ *
2259
+ * @param sub - User UUID
2260
+ * @returns Enable confirmation with updated user
2261
+ * @throws {NAuthClientError} If operation fails
2262
+ *
2263
+ * @example
2264
+ * ```typescript
2265
+ * const result = await client.admin.enableUser('user-uuid');
2266
+ * console.log('User enabled:', result.user);
2267
+ * ```
2268
+ */
2269
+ enableUser(sub: string): Promise<EnableUserResponse>;
2270
+ /**
2271
+ * Force password change on next login
2272
+ *
2273
+ * @param sub - User UUID
2274
+ * @returns Success confirmation
2275
+ * @throws {NAuthClientError} If operation fails
2276
+ *
2277
+ * @example
2278
+ * ```typescript
2279
+ * await client.admin.forcePasswordChange('user-uuid');
2280
+ * ```
2281
+ */
2282
+ forcePasswordChange(sub: string): Promise<{
2283
+ success: boolean;
2284
+ }>;
2285
+ /**
2286
+ * Set password for any user (admin operation)
2287
+ *
2288
+ * @param identifier - User email, username, or phone
2289
+ * @param newPassword - New password
2290
+ * @returns Success confirmation
2291
+ * @throws {NAuthClientError} If operation fails
2292
+ *
2293
+ * @example
2294
+ * ```typescript
2295
+ * await client.admin.setPassword('user@example.com', 'NewSecurePass123!');
2296
+ * ```
2297
+ */
2298
+ setPassword(identifier: string, newPassword: string): Promise<{
2299
+ success: boolean;
2300
+ }>;
2301
+ /**
2302
+ * Initiate password reset workflow (sends code/link to user)
2303
+ *
2304
+ * @param request - Password reset request
2305
+ * @returns Reset confirmation with delivery details
2306
+ * @throws {NAuthClientError} If operation fails
2307
+ *
2308
+ * @example
2309
+ * ```typescript
2310
+ * const result = await client.admin.initiatePasswordReset({
2311
+ * sub: 'user-uuid',
2312
+ * deliveryMethod: 'email',
2313
+ * baseUrl: 'https://myapp.com/reset-password',
2314
+ * reason: 'User requested password reset',
2315
+ * });
2316
+ * console.log('Code sent to:', result.destination);
2317
+ * ```
2318
+ */
2319
+ initiatePasswordReset(request: AdminResetPasswordRequest): Promise<AdminResetPasswordResponse>;
2320
+ /**
2321
+ * Get all sessions for a user
2322
+ *
2323
+ * @param sub - User UUID
2324
+ * @returns User sessions
2325
+ * @throws {NAuthClientError} If request fails
2326
+ *
2327
+ * @example
2328
+ * ```typescript
2329
+ * const result = await client.admin.getUserSessions('user-uuid');
2330
+ * console.log('Active sessions:', result.sessions);
2331
+ * ```
2332
+ */
2333
+ getUserSessions(sub: string): Promise<GetUserSessionsResponse>;
2334
+ /**
2335
+ * Logout all sessions for a user (admin-initiated)
2336
+ *
2337
+ * @param sub - User UUID
2338
+ * @param forgetDevices - If true, also revokes all trusted devices
2339
+ * @returns Number of sessions revoked
2340
+ * @throws {NAuthClientError} If operation fails
2341
+ *
2342
+ * @example
2343
+ * ```typescript
2344
+ * const result = await client.admin.logoutAllSessions('user-uuid', true);
2345
+ * console.log(`Revoked ${result.revokedCount} sessions`);
2346
+ * ```
2347
+ */
2348
+ logoutAllSessions(sub: string, forgetDevices?: boolean): Promise<{
2349
+ revokedCount: number;
2350
+ }>;
2351
+ /**
2352
+ * Get MFA status for a user
2353
+ *
2354
+ * @param sub - User UUID
2355
+ * @returns MFA status
2356
+ * @throws {NAuthClientError} If request fails
2357
+ *
2358
+ * @example
2359
+ * ```typescript
2360
+ * const status = await client.admin.getMfaStatus('user-uuid');
2361
+ * console.log('MFA enabled:', status.enabled);
2362
+ * ```
2363
+ */
2364
+ getMfaStatus(sub: string): Promise<MFAStatus>;
2365
+ /**
2366
+ * Set preferred MFA method for a user
2367
+ *
2368
+ * @param sub - User UUID
2369
+ * @param method - MFA method to set as preferred
2370
+ * @returns Success message
2371
+ * @throws {NAuthClientError} If operation fails
2372
+ *
2373
+ * @example
2374
+ * ```typescript
2375
+ * await client.admin.setPreferredMfaMethod('user-uuid', 'totp');
2376
+ * ```
2377
+ */
2378
+ setPreferredMfaMethod(sub: string, method: 'totp' | 'sms' | 'email' | 'passkey'): Promise<{
2379
+ message: string;
2380
+ }>;
2381
+ /**
2382
+ * Remove MFA devices for a user
2383
+ *
2384
+ * @param sub - User UUID
2385
+ * @param method - MFA method to remove
2386
+ * @returns Success message
2387
+ * @throws {NAuthClientError} If operation fails
2388
+ *
2389
+ * @example
2390
+ * ```typescript
2391
+ * await client.admin.removeMfaDevices('user-uuid', 'sms');
2392
+ * ```
2393
+ */
2394
+ removeMfaDevices(sub: string, method: 'totp' | 'sms' | 'email' | 'passkey'): Promise<{
2395
+ message: string;
2396
+ }>;
2397
+ /**
2398
+ * Grant or revoke MFA exemption for a user
2399
+ *
2400
+ * @param sub - User UUID
2401
+ * @param exempt - True to exempt from MFA, false to require
2402
+ * @param reason - Optional reason for exemption
2403
+ * @returns Success message
2404
+ * @throws {NAuthClientError} If operation fails
2405
+ *
2406
+ * @example
2407
+ * ```typescript
2408
+ * await client.admin.setMfaExemption('user-uuid', true, 'Service account');
2409
+ * ```
2410
+ */
2411
+ setMfaExemption(sub: string, exempt: boolean, reason?: string): Promise<{
2412
+ message: string;
2413
+ }>;
2414
+ /**
2415
+ * Get audit history for a user
2416
+ *
2417
+ * @param params - Audit history request params
2418
+ * @returns Paginated audit events
2419
+ * @throws {NAuthClientError} If request fails
2420
+ *
2421
+ * @example
2422
+ * ```typescript
2423
+ * const history = await client.admin.getAuditHistory({
2424
+ * sub: 'user-uuid',
2425
+ * page: 1,
2426
+ * limit: 50,
2427
+ * eventType: 'LOGIN_SUCCESS',
2428
+ * });
2429
+ * ```
2430
+ */
2431
+ getAuditHistory(params: AdminAuditHistoryRequest): Promise<AuditHistoryResponse>;
2432
+ /**
2433
+ * Build admin endpoint URL with path parameter replacement
2434
+ *
2435
+ * Path construction order:
2436
+ * 1. Start with endpoint: '/users/:sub'
2437
+ * 2. Replace params: '/users/uuid-123'
2438
+ * 3. Apply adminPathPrefix: '/admin/users/uuid-123'
2439
+ * 4. Apply authPathPrefix if exists: '/auth/admin/users/uuid-123'
2440
+ * 5. Combine with baseUrl: 'https://api.example.com/auth/admin/users/uuid-123'
2441
+ *
2442
+ * @param endpointPath - Endpoint path (may contain :sub, :provider, etc.)
2443
+ * @param pathParams - Path parameters to replace
2444
+ * @returns Full URL
2445
+ * @private
2446
+ */
2447
+ private buildAdminUrl;
2448
+ /**
2449
+ * Build query string from params object
2450
+ *
2451
+ * Handles:
2452
+ * - Simple values (string, number, boolean)
2453
+ * - Arrays (multiple values for same key)
2454
+ * - Nested objects (e.g., createdAt[operator], createdAt[value])
2455
+ * - Dates (converted to ISO string)
2456
+ *
2457
+ * @param params - Query parameters
2458
+ * @returns Query string (e.g., '?page=1&limit=20')
2459
+ * @private
2460
+ */
2461
+ private buildQueryString;
2462
+ /**
2463
+ * Build request headers for authentication
2464
+ *
2465
+ * @param auth - Whether to include authentication headers
2466
+ * @param method - HTTP method
2467
+ * @returns Headers object
2468
+ * @private
2469
+ */
2470
+ private buildHeaders;
2471
+ /**
2472
+ * Get CSRF token from cookie (browser only)
2473
+ *
2474
+ * @returns CSRF token or null
2475
+ * @private
2476
+ */
2477
+ private getCsrfToken;
2478
+ /**
2479
+ * Execute GET request
2480
+ *
2481
+ * @param path - Full URL path
2482
+ * @returns Response data
2483
+ * @private
2484
+ */
2485
+ private get;
2486
+ /**
2487
+ * Execute POST request
2488
+ *
2489
+ * @param path - Full URL path
2490
+ * @param body - Request body
2491
+ * @returns Response data
2492
+ * @private
2493
+ */
2494
+ private post;
2495
+ /**
2496
+ * Execute DELETE request
2497
+ *
2498
+ * @param path - Full URL path
2499
+ * @returns Response data
2500
+ * @private
2501
+ */
2502
+ private delete;
2503
+ /**
2504
+ * Handle HTTP errors and convert to NAuthClientError
2505
+ *
2506
+ * @param error - Error from HTTP adapter
2507
+ * @returns NAuthClientError
2508
+ * @private
2509
+ */
2510
+ private handleError;
2511
+ }
2512
+
1316
2513
  /**
1317
2514
  * Primary client for interacting with nauth-toolkit backend.
1318
2515
  */
@@ -1321,7 +2518,34 @@ declare class NAuthClient {
1321
2518
  private readonly tokenManager;
1322
2519
  private readonly eventEmitter;
1323
2520
  private readonly challengeRouter;
2521
+ private readonly oauthStorage;
1324
2522
  private currentUser;
2523
+ /**
2524
+ * Admin operations (available if admin config provided).
2525
+ *
2526
+ * Provides admin-level user management methods:
2527
+ * - User CRUD operations
2528
+ * - Password management
2529
+ * - Session management
2530
+ * - MFA management
2531
+ * - Audit history
2532
+ *
2533
+ * @example
2534
+ * ```typescript
2535
+ * const client = new NAuthClient({
2536
+ * baseUrl: 'https://api.example.com/auth',
2537
+ * tokenDelivery: 'cookies',
2538
+ * admin: {
2539
+ * pathPrefix: '/admin',
2540
+ * },
2541
+ * });
2542
+ *
2543
+ * // Use admin operations
2544
+ * const users = await client.admin.getUsers({ page: 1 });
2545
+ * await client.admin.deleteUser('user-uuid');
2546
+ * ```
2547
+ */
2548
+ readonly admin?: AdminOperations;
1325
2549
  /**
1326
2550
  * Create a new client instance.
1327
2551
  *
@@ -1777,6 +3001,8 @@ declare class NAuthClient {
1777
3001
  * when appState is present in the callback URL. The stored state can
1778
3002
  * be retrieved using getLastOauthState().
1779
3003
  *
3004
+ * Stores in sessionStorage (ephemeral) for better security.
3005
+ *
1780
3006
  * @param appState - OAuth appState value from callback URL
1781
3007
  *
1782
3008
  * @example
@@ -1793,6 +3019,7 @@ declare class NAuthClient {
1793
3019
  * applying invite codes, or tracking referral information.
1794
3020
  *
1795
3021
  * The state is automatically cleared after retrieval to prevent reuse.
3022
+ * Stored in sessionStorage (ephemeral) for better security.
1796
3023
  *
1797
3024
  * @returns The stored appState, or null if none exists
1798
3025
  *
@@ -1950,4 +3177,4 @@ declare class FetchAdapter implements HttpAdapter {
1950
3177
  request<T>(config: HttpRequest): Promise<HttpResponse<T>>;
1951
3178
  }
1952
3179
 
1953
- export { type AuditHistoryResponse, type AuthAuditEvent, type AuthAuditEventStatus, AuthAuditEventType, AuthChallenge, type AuthChallengeEvent, type AuthErrorEvent, type AuthEvent, type AuthEventListener, type AuthEventType, type AuthLoginEvent, type AuthLogoutEvent, type AuthRefreshEvent, type AuthResponse, type AuthResponseContext, type AuthSignupEvent, type AuthSuccessEvent, type AuthUser, type AuthUserSummary, type BackupCodesResponse, type BaseChallengeResponse, BrowserStorage, type ChallengeResponse, ChallengeRouter, type ChangePasswordRequest, type ConfirmForgotPasswordRequest, type ConfirmForgotPasswordResponse, EventEmitter, FetchAdapter, type ForceChangePasswordResponse, type ForgotPasswordRequest, type ForgotPasswordResponse, type GetChallengeDataRequest, type GetChallengeDataResponse, type GetSetupDataRequest, type GetSetupDataResponse, type HttpAdapter, type HttpRequest, type HttpResponse, InMemoryStorage, type LinkedAccountsResponse, type LoginRequest, type LogoutAllRequest, type LogoutRequest, type MFAChallengeMethod, type MFACodeResponse, type MFADevice, type MFADeviceMethod, type MFAMethod, type MFAPasskeyResponse, type MFASetupData, type MFASetupResponse, type MFAStatus, type MfaRoutesConfig, NAuthClient, type NAuthClientConfig, NAuthClientError, type NAuthEndpoints, type NAuthError, NAuthErrorCode, type NAuthRedirectsConfig, type NAuthStorageAdapter, type OAuthCallbackEvent, type OAuthCompletedEvent, type OAuthErrorEvent, type OAuthStartedEvent, type ResendCodeRequest, type ResetPasswordWithCodeRequest, type ResetPasswordWithCodeResponse, type ResolvedNAuthClientConfig, type SignupRequest, type SocialLoginOptions, type SocialProvider, type SocialVerifyRequest, type TokenDeliveryMode, type TokenResponse, type UpdateProfileRequest, type VerifyEmailResponse, type VerifyPhoneCodeResponse, type VerifyPhoneCollectResponse, defaultEndpoints, getChallengeInstructions, getMFAMethod, getMaskedDestination, isOTPChallenge, requiresPhoneCollection, resolveConfig };
3180
+ export { type AdminAuditHistoryRequest, AdminOperations, type AdminResetPasswordRequest, type AdminResetPasswordResponse, type AdminSignupRequest, type AdminSignupResponse, type AdminSignupSocialRequest, type AdminSignupSocialResponse, type AuditHistoryResponse, type AuthAuditEvent, type AuthAuditEventStatus, AuthAuditEventType, AuthChallenge, type AuthChallengeEvent, type AuthErrorEvent, type AuthEvent, type AuthEventListener, type AuthEventType, type AuthLoginEvent, type AuthLogoutEvent, type AuthRefreshEvent, type AuthResponse, type AuthResponseContext, type AuthSignupEvent, type AuthSuccessEvent, type AuthUser, type AuthUserSummary, type BackupCodesResponse, type BaseChallengeResponse, BrowserStorage, type ChallengeResponse, ChallengeRouter, type ChangePasswordRequest, type ConfirmForgotPasswordRequest, type ConfirmForgotPasswordResponse, type DateFilter, type DeleteUserResponse, type DisableUserResponse, type EnableUserResponse, EventEmitter, FetchAdapter, type ForceChangePasswordResponse, type ForgotPasswordRequest, type ForgotPasswordResponse, type GetChallengeDataRequest, type GetChallengeDataResponse, type GetSetupDataRequest, type GetSetupDataResponse, type GetUserSessionsResponse, type GetUsersRequest, type GetUsersResponse, type HttpAdapter, type HttpRequest, type HttpResponse, InMemoryStorage, type LinkedAccountsResponse, type LoginRequest, type LogoutAllRequest, type LogoutRequest, type MFAChallengeMethod, type MFACodeResponse, type MFADevice, type MFADeviceMethod, type MFAMethod, type MFAPasskeyResponse, type MFASetupData, type MFASetupResponse, type MFAStatus, type MfaRoutesConfig, type NAuthAdminEndpoints, NAuthClient, type NAuthClientConfig, NAuthClientError, type NAuthEndpoints, type NAuthError, NAuthErrorCode, type NAuthRedirectsConfig, type NAuthStorageAdapter, type OAuthCallbackEvent, type OAuthCompletedEvent, type OAuthErrorEvent, type OAuthStartedEvent, type ResendCodeRequest, type ResetPasswordWithCodeRequest, type ResetPasswordWithCodeResponse, type ResolvedNAuthClientConfig, type SignupRequest, type SocialLoginOptions, type SocialProvider, type SocialVerifyRequest, type TokenDeliveryMode, type TokenResponse, type UpdateProfileRequest, type UserSessionInfo, type VerifyEmailResponse, type VerifyPhoneCodeResponse, type VerifyPhoneCollectResponse, defaultAdminEndpoints, defaultEndpoints, getChallengeInstructions, getMFAMethod, getMaskedDestination, isOTPChallenge, requiresPhoneCollection, resolveConfig };