@delopay/sdk 0.3.0 → 0.3.1

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.cts CHANGED
@@ -2984,6 +2984,15 @@ declare class Users {
2984
2984
  changePassword(params: ChangePasswordRequest): Promise<UserResponse>;
2985
2985
  rotatePassword(params: ResetPasswordRequest): Promise<UserResponse>;
2986
2986
  forgotPassword(params: ForgotPasswordRequest): Promise<Record<string, unknown>>;
2987
+ /**
2988
+ * Reset a user's password using the single-purpose JWT delivered by the
2989
+ * forgot-password email.
2990
+ *
2991
+ * The backend's `SinglePurposeJWTAuth` reads the token from the
2992
+ * `Authorization: Bearer …` header, not from the request body, so the
2993
+ * SDK lifts the `token` field out of `params` and sends it as the header.
2994
+ * Callers still pass `{ password, token }` — the shape is unchanged.
2995
+ */
2987
2996
  resetPassword(params: ResetPasswordRequest): Promise<Record<string, unknown>>;
2988
2997
  verifyEmail(params: Record<string, unknown>): Promise<AuthResponse>;
2989
2998
  sendVerificationEmail(params: ForgotPasswordRequest): Promise<Record<string, unknown>>;
package/dist/index.d.ts CHANGED
@@ -2984,6 +2984,15 @@ declare class Users {
2984
2984
  changePassword(params: ChangePasswordRequest): Promise<UserResponse>;
2985
2985
  rotatePassword(params: ResetPasswordRequest): Promise<UserResponse>;
2986
2986
  forgotPassword(params: ForgotPasswordRequest): Promise<Record<string, unknown>>;
2987
+ /**
2988
+ * Reset a user's password using the single-purpose JWT delivered by the
2989
+ * forgot-password email.
2990
+ *
2991
+ * The backend's `SinglePurposeJWTAuth` reads the token from the
2992
+ * `Authorization: Bearer …` header, not from the request body, so the
2993
+ * SDK lifts the `token` field out of `params` and sends it as the header.
2994
+ * Callers still pass `{ password, token }` — the shape is unchanged.
2995
+ */
2987
2996
  resetPassword(params: ResetPasswordRequest): Promise<Record<string, unknown>>;
2988
2997
  verifyEmail(params: Record<string, unknown>): Promise<AuthResponse>;
2989
2998
  sendVerificationEmail(params: ForgotPasswordRequest): Promise<Record<string, unknown>>;
package/dist/index.js CHANGED
@@ -2029,8 +2029,21 @@ var Users = class {
2029
2029
  async forgotPassword(params) {
2030
2030
  return this.request("POST", "/user/forgot_password", { body: params });
2031
2031
  }
2032
+ /**
2033
+ * Reset a user's password using the single-purpose JWT delivered by the
2034
+ * forgot-password email.
2035
+ *
2036
+ * The backend's `SinglePurposeJWTAuth` reads the token from the
2037
+ * `Authorization: Bearer …` header, not from the request body, so the
2038
+ * SDK lifts the `token` field out of `params` and sends it as the header.
2039
+ * Callers still pass `{ password, token }` — the shape is unchanged.
2040
+ */
2032
2041
  async resetPassword(params) {
2033
- return this.request("POST", "/user/reset_password", { body: params });
2042
+ const { token, password } = params;
2043
+ return this.request("POST", "/user/reset_password", {
2044
+ body: { password },
2045
+ headers: { Authorization: `Bearer ${token}` }
2046
+ });
2034
2047
  }
2035
2048
  async verifyEmail(params) {
2036
2049
  return this.request("POST", "/user/verify_email", { body: params });