lazypock 0.15.0 → 0.16.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.cjs CHANGED
@@ -1556,6 +1556,85 @@ var CollectionService = class _CollectionService {
1556
1556
  authMethods(options) {
1557
1557
  return this.listAuthMethods(options);
1558
1558
  }
1559
+ // ── Email / Verification / Password Reset (PocketBase parity) ──
1560
+ /**
1561
+ * Send a password reset email to the given address (PocketBase
1562
+ * `requestPasswordReset`). The backend always answers 204 to avoid
1563
+ * revealing whether the address exists.
1564
+ */
1565
+ async requestPasswordReset(email, options) {
1566
+ await this.http.post(
1567
+ "/" + this.encodeId(this.collectionName) + "/request-password-reset",
1568
+ { email },
1569
+ options
1570
+ );
1571
+ return true;
1572
+ }
1573
+ /**
1574
+ * Confirm a password reset (PocketBase `confirmPasswordReset`).
1575
+ *
1576
+ * @param passwordResetToken The token emailed by `requestPasswordReset`.
1577
+ * @param password The new password (min 8 chars server-side).
1578
+ * @param passwordConfirm Must equal `password`.
1579
+ */
1580
+ async confirmPasswordReset(passwordResetToken, password, passwordConfirm, options) {
1581
+ await this.http.post(
1582
+ "/" + this.encodeId(this.collectionName) + "/confirm-password-reset",
1583
+ { token: passwordResetToken, password, passwordConfirm },
1584
+ options
1585
+ );
1586
+ return true;
1587
+ }
1588
+ /**
1589
+ * Send a verification email to the given address (PocketBase
1590
+ * `requestVerification`). The backend always answers 204 to avoid
1591
+ * revealing whether the address exists.
1592
+ */
1593
+ async requestVerification(email, options) {
1594
+ await this.http.post(
1595
+ "/" + this.encodeId(this.collectionName) + "/request-verification",
1596
+ { email },
1597
+ options
1598
+ );
1599
+ return true;
1600
+ }
1601
+ /**
1602
+ * Confirm an email verification (PocketBase `confirmVerification`).
1603
+ * Resolves with the verified auth record.
1604
+ */
1605
+ async confirmVerification(verificationToken, options) {
1606
+ const data = await this.http.post(
1607
+ "/" + this.encodeId(this.collectionName) + "/confirm-verification",
1608
+ { token: verificationToken },
1609
+ options
1610
+ );
1611
+ return data?.record ?? null;
1612
+ }
1613
+ /**
1614
+ * Send an email-change confirmation email to a new address (PocketBase
1615
+ * `requestEmailChange`). Requires an authenticated auth-collection user.
1616
+ */
1617
+ async requestEmailChange(newEmail, options) {
1618
+ await this.http.post(
1619
+ "/" + this.encodeId(this.collectionName) + "/request-email-change",
1620
+ { newEmail },
1621
+ options
1622
+ );
1623
+ return true;
1624
+ }
1625
+ /**
1626
+ * Confirm an email change (PocketBase `confirmEmailChange`). Requires the
1627
+ * currently authenticated user's password. Resolves with the updated auth
1628
+ * record.
1629
+ */
1630
+ async confirmEmailChange(emailChangeToken, password, options) {
1631
+ const data = await this.http.post(
1632
+ "/" + this.encodeId(this.collectionName) + "/confirm-email-change",
1633
+ { token: emailChangeToken, password },
1634
+ options
1635
+ );
1636
+ return data?.record ?? null;
1637
+ }
1559
1638
  /**
1560
1639
  * Sign in with an OAuth2 provider (PocketBase `authWithOAuth2` parity).
1561
1640
  *