@rustrak/client 0.15.1 → 0.15.2

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.cjs CHANGED
@@ -741,6 +741,10 @@ var ssoLinkSchema = zod.z.object({
741
741
  var confirmSsoLinkRequestSchema = zod.z.object({
742
742
  password: zod.z.string().min(1)
743
743
  });
744
+ var changePasswordRequestSchema = zod.z.object({
745
+ current_password: zod.z.string().min(1),
746
+ new_password: zod.z.string().min(1)
747
+ });
744
748
 
745
749
  // src/errors.ts
746
750
  var FIELD_ERROR_CODES = [
@@ -1548,6 +1552,20 @@ var AuthResource = class extends BaseResource {
1548
1552
  userSchema
1549
1553
  );
1550
1554
  }
1555
+ /** Replaces the signed-in user's password, given the current one. */
1556
+ async changePassword(request) {
1557
+ const validatedInput = this.validateInput(
1558
+ request,
1559
+ changePasswordRequestSchema
1560
+ );
1561
+ if (!validatedInput.success) return validatedInput;
1562
+ return this.requestVoid(
1563
+ () => this.http.post("auth/me/password", {
1564
+ json: validatedInput.data,
1565
+ retry: 0
1566
+ })
1567
+ );
1568
+ }
1551
1569
  /**
1552
1570
  * Get the details of a pending invitation by its token (public endpoint)
1553
1571
  * Used by the accept-invitation page before the user has an account