@sylphx/sdk 0.10.5 → 0.10.6

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
@@ -2007,10 +2007,14 @@ declare function verifyEmail(config: SylphxConfig, token: string): Promise<void>
2007
2007
  *
2008
2008
  * @example
2009
2009
  * ```typescript
2010
- * await forgotPassword(config, 'user@example.com')
2010
+ * await forgotPassword(config, 'user@example.com', {
2011
+ * redirectUrl: 'https://app.example.com/reset-password'
2012
+ * })
2011
2013
  * ```
2012
2014
  */
2013
- declare function forgotPassword(config: SylphxConfig, email: string): Promise<void>;
2015
+ declare function forgotPassword(config: SylphxConfig, email: string, options?: {
2016
+ redirectUrl?: string;
2017
+ }): Promise<void>;
2014
2018
  /**
2015
2019
  * Request a verification email resend.
2016
2020
  *
@@ -8504,15 +8508,13 @@ interface ProjectMetadata {
8504
8508
  readonly slug: string;
8505
8509
  readonly [key: string]: unknown;
8506
8510
  }
8507
- type ChallengeMethod = 'password' | 'email' | 'totp' | 'backup_code';
8511
+ type ChallengeMethod = 'password' | 'email' | 'totp' | 'backup';
8508
8512
  type ChallengeType = 'identity' | 'mfa';
8509
8513
  interface ChallengeVerifyInput {
8510
8514
  /** Verification method to use. */
8511
8515
  readonly method: ChallengeMethod;
8512
- /** Credential matching `method` (password, OTP, TOTP code, backup code). */
8513
- readonly credential: string;
8514
- /** Whether this challenge is for identity step-up or MFA gate (default: identity). */
8515
- readonly type?: ChallengeType;
8516
+ /** Verification value matching `method` (password, email code, TOTP code, backup code). */
8517
+ readonly value: string;
8516
8518
  }
8517
8519
  interface ChallengeVerifyResult {
8518
8520
  readonly verified: boolean;
@@ -8532,7 +8534,7 @@ declare function getProjectMetadata(config: SylphxConfig): Promise<ProjectMetada
8532
8534
  *
8533
8535
  * @example
8534
8536
  * ```typescript
8535
- * await verifyChallenge(config, { method: 'password', credential: pw })
8537
+ * await verifyChallenge(config, { method: 'password', value: pw })
8536
8538
  * ```
8537
8539
  */
8538
8540
  declare function verifyChallenge(config: SylphxConfig, input: ChallengeVerifyInput): Promise<ChallengeVerifyResult>;
package/dist/index.mjs CHANGED
@@ -5915,10 +5915,13 @@ async function verifyEmail(config, token) {
5915
5915
  body: { token }
5916
5916
  });
5917
5917
  }
5918
- async function forgotPassword(config, email) {
5918
+ async function forgotPassword(config, email, options = {}) {
5919
5919
  await callApi(config, "/auth/forgot-password", {
5920
5920
  method: "POST",
5921
- body: { email }
5921
+ body: {
5922
+ email,
5923
+ ...options.redirectUrl ? { redirectUrl: options.redirectUrl } : {}
5924
+ }
5922
5925
  });
5923
5926
  }
5924
5927
  async function resendVerificationEmail(config, email) {
@@ -5932,7 +5935,7 @@ async function resendVerificationEmail(config, email) {
5932
5935
  async function resetPassword(config, input) {
5933
5936
  await callApi(config, "/auth/reset-password", {
5934
5937
  method: "POST",
5935
- body: { token: input.token, newPassword: input.password }
5938
+ body: { token: input.token, password: input.password }
5936
5939
  });
5937
5940
  }
5938
5941
  async function getSession(config) {