@absolutejs/auth 0.75.4 → 0.76.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/dist/index.d.ts CHANGED
@@ -1176,6 +1176,7 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
1176
1176
  200: {
1177
1177
  backupCodesRemaining: number;
1178
1178
  enabled: boolean;
1179
+ factors: import(".").MfaPublicFactor[];
1179
1180
  smsBackup: {
1180
1181
  enabled: boolean;
1181
1182
  phone: string | null;
@@ -1224,16 +1225,52 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
1224
1225
  error: never;
1225
1226
  };
1226
1227
  };
1228
+ } & {
1229
+ [x: string]: {
1230
+ factors: {
1231
+ ":factorId": {
1232
+ delete: {
1233
+ body: unknown;
1234
+ params: {
1235
+ factorId: string;
1236
+ };
1237
+ query: unknown;
1238
+ headers: unknown;
1239
+ response: {
1240
+ 401: "Recent authentication required" | "Authentication required";
1241
+ 404: "MFA factor not found";
1242
+ 200: {
1243
+ readonly status: "removed";
1244
+ };
1245
+ 422: {
1246
+ type: "validation";
1247
+ title: "Validation Error";
1248
+ status: 422;
1249
+ detail?: string;
1250
+ on: string;
1251
+ found?: unknown;
1252
+ property?: string;
1253
+ expected?: string;
1254
+ };
1255
+ };
1256
+ error: never;
1257
+ };
1258
+ };
1259
+ };
1260
+ };
1227
1261
  } & {
1228
1262
  [x: string]: {
1229
1263
  post: {
1230
- body: unknown;
1264
+ body: {
1265
+ label?: string | undefined;
1266
+ };
1231
1267
  params: {};
1232
1268
  query: unknown;
1233
1269
  headers: unknown;
1234
1270
  response: {
1235
1271
  401: "Recent authentication required" | "Authentication required";
1236
1272
  200: {
1273
+ readonly factorId: string;
1237
1274
  readonly secret: string;
1238
1275
  readonly uri: string;
1239
1276
  };
@@ -1255,6 +1292,7 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
1255
1292
  [x: string]: {
1256
1293
  post: {
1257
1294
  body: {
1295
+ factorId?: string | undefined;
1258
1296
  code: string;
1259
1297
  };
1260
1298
  params: {};
@@ -1284,6 +1322,7 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
1284
1322
  [x: string]: {
1285
1323
  post: {
1286
1324
  body: {
1325
+ label?: string | undefined;
1287
1326
  phone: string;
1288
1327
  };
1289
1328
  params: {};
@@ -1294,6 +1333,7 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
1294
1333
  401: "Recent authentication required" | "Authentication required";
1295
1334
  501: "SMS MFA is not configured";
1296
1335
  200: {
1336
+ readonly factorId: string;
1297
1337
  readonly phone: string;
1298
1338
  };
1299
1339
  422: {
@@ -1316,6 +1356,7 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
1316
1356
  [x: string]: {
1317
1357
  post: {
1318
1358
  body: {
1359
+ factorId?: string | undefined;
1319
1360
  code: string;
1320
1361
  };
1321
1362
  params: {};
@@ -1343,13 +1384,46 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
1343
1384
  error: never;
1344
1385
  };
1345
1386
  };
1387
+ } & {
1388
+ [x: string]: {
1389
+ get: {
1390
+ body: unknown;
1391
+ params: {};
1392
+ query: unknown;
1393
+ headers: unknown;
1394
+ response: {
1395
+ 401: "No MFA challenge in progress";
1396
+ 200: {
1397
+ backupCodesAvailable: boolean;
1398
+ factors: Array<{
1399
+ id: string;
1400
+ label: string;
1401
+ phone: string | null;
1402
+ type: "sms" | "totp";
1403
+ }>;
1404
+ };
1405
+ 422: {
1406
+ type: "validation";
1407
+ title: "Validation Error";
1408
+ status: 422;
1409
+ detail?: string;
1410
+ on: string;
1411
+ found?: unknown;
1412
+ property?: string;
1413
+ expected?: string;
1414
+ };
1415
+ };
1416
+ error: never;
1417
+ };
1418
+ };
1346
1419
  } & {
1347
1420
  [x: string]: {
1348
1421
  post: {
1349
1422
  body: {
1350
1423
  code?: string | undefined;
1351
1424
  action?: "verify" | "send" | undefined;
1352
- factor?: "sms" | undefined;
1425
+ factorId?: string | undefined;
1426
+ factor?: "sms" | "backup_codes" | "totp" | undefined;
1353
1427
  };
1354
1428
  params: {};
1355
1429
  query: unknown;
@@ -1358,6 +1432,8 @@ export declare const createAuthApplications: <UserType>(configuration: AuthConfi
1358
1432
  400: string;
1359
1433
  401: "SMS code expired" | "Too many attempts" | "SMS challenge is no longer active" | "No MFA challenge in progress" | "Invalid MFA code";
1360
1434
  200: {
1435
+ readonly factorId: string;
1436
+ readonly phone: string;
1361
1437
  readonly status: "sent";
1362
1438
  } | {
1363
1439
  readonly status: "authenticated";
@@ -3916,9 +3992,9 @@ export * from './mfa/types';
3916
3992
  export * from './verification/types';
3917
3993
  export { consumeBackupCode, generateBackupCodes } from './mfa/backupCodes';
3918
3994
  export { createMfaGate } from './mfa/gate';
3919
- export { mfaChallenge } from './mfa/challenge';
3995
+ export { mfaChallenge, type MfaChallengeOptions } from './mfa/challenge';
3920
3996
  export { mfaRoutes } from './mfa/routes';
3921
- export { mfaManagementRoutes, type MfaStatus } from './mfa/management';
3997
+ export { mfaManagementRoutes, type MfaPublicFactor, type MfaStatus } from './mfa/management';
3922
3998
  export { rotateMfaEncryptionKey } from './mfa/rotation';
3923
3999
  export type { MfaKeyRotationResult } from './mfa/rotation';
3924
4000
  export { mfaTotpRoutes } from './mfa/totp';