@arkstack/auth 0.17.26 → 0.18.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
@@ -441,6 +441,9 @@ type IssuedSmsCode = {
441
441
  expiresAt: Date;
442
442
  purpose: SmsCodePurpose;
443
443
  };
444
+ type TwoFactorUser = User$1 & {
445
+ phone?: string | null;
446
+ };
444
447
  //#endregion
445
448
  //#region src/TwoFactor.d.ts
446
449
  declare class TwoFactor {
@@ -528,6 +531,7 @@ declare class TwoFactor {
528
531
  /**
529
532
  * Generate one-time recovery codes shown when 2FA is enabled.
530
533
  *
534
+ * @param count
531
535
  * @returns An array of recovery codes.
532
536
  */
533
537
  static generateBackupCodes(count?: number): string[];
@@ -631,4 +635,4 @@ declare class AuthenticationException extends Exception {
631
635
  errors(): Record<string, any> | undefined;
632
636
  }
633
637
  //#endregion
634
- export { Auth, AuthContract, AuthSession, AuthenticationException, DeviceAgentPayload, IssuedSmsCode, PersonalAccessToken, SessionDevice, SessionDeviceInfo, SmsCodePurpose, TwoFactor, TwoFactorMethod, TwoFactorSetup, TwoFactorStatus, User, UserTwoFactor, auth };
638
+ export { Auth, AuthContract, AuthSession, AuthenticationException, DeviceAgentPayload, IssuedSmsCode, PersonalAccessToken, SessionDevice, SessionDeviceInfo, SmsCodePurpose, TwoFactor, TwoFactorMethod, TwoFactorSetup, TwoFactorStatus, TwoFactorUser, User, UserTwoFactor, auth };
package/dist/index.js CHANGED
@@ -592,7 +592,7 @@ const auth = (secret) => Auth.make(secret);
592
592
  var TwoFactor = class TwoFactor {
593
593
  static smsCodeTtlMinutes = Number(env("TWO_FACTOR_SMS_TTL_MINUTES", 10)) || 10;
594
594
  static async getModel() {
595
- return await getModel("UserTwoFactor");
595
+ return getModel("UserTwoFactor");
596
596
  }
597
597
  static async getRecord(userId) {
598
598
  return await (await this.getModel()).query().where({ userId }).first();
@@ -723,6 +723,7 @@ var TwoFactor = class TwoFactor {
723
723
  /**
724
724
  * Generate one-time recovery codes shown when 2FA is enabled.
725
725
  *
726
+ * @param count
726
727
  * @returns An array of recovery codes.
727
728
  */
728
729
  static generateBackupCodes(count = 8) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkstack/auth",
3
- "version": "0.17.26",
3
+ "version": "0.18.0",
4
4
  "type": "module",
5
5
  "description": "Authentication module for Arkstack, providing core authentication and identity features.",
6
6
  "homepage": "https://arkstack.toneflix.net/guide/auth",
@@ -40,12 +40,12 @@
40
40
  "jose": "^6.2.3",
41
41
  "otpauth": "^9.5.1",
42
42
  "ua-parser-js": "^2.0.9",
43
- "@arkstack/common": "^0.17.26",
44
- "@arkstack/http": "^0.17.26"
43
+ "@arkstack/common": "^0.18.0",
44
+ "@arkstack/http": "^0.18.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@h3ravel/support": "^2.2.7",
48
- "@arkstack/database": "^0.17.26"
48
+ "@arkstack/database": "^0.18.0"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "tsdown --config-loader unrun",