@delopay/sdk 0.22.0 → 0.24.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
@@ -2026,6 +2026,21 @@ var Users = class {
2026
2026
  async update(params) {
2027
2027
  return this.request("POST", "/user/update", { body: params });
2028
2028
  }
2029
+ /**
2030
+ * Permanently delete the caller's account. Requires a fresh password
2031
+ * (and a current 6-digit TOTP code if the user has TOTP enrolled). The
2032
+ * backend hard-deletes every `user_roles` row for the caller and soft-
2033
+ * deletes the user record itself (`is_active = false`, password / TOTP
2034
+ * wiped). On success all in-flight sessions are blacklisted, so the
2035
+ * caller should clear local credentials and route to the login page.
2036
+ *
2037
+ * Refuses (`InvalidDeleteOperation`) when the caller is the sole
2038
+ * owner-level admin of an org / merchant / profile — they must transfer
2039
+ * ownership first.
2040
+ */
2041
+ async deleteAccount(params) {
2042
+ return this.request("DELETE", "/user/account", { body: params });
2043
+ }
2029
2044
  async changePassword(params) {
2030
2045
  return this.request("POST", "/user/change_password", { body: params });
2031
2046
  }
@@ -2086,6 +2101,19 @@ var Users = class {
2086
2101
  async acceptInvitation(params) {
2087
2102
  return this.request("POST", "/user/user/invite/accept", { body: params });
2088
2103
  }
2104
+ /**
2105
+ * Accept an invitation via the email-link flow.
2106
+ *
2107
+ * Caller must already hold a `SinglePurposeToken` with
2108
+ * `purpose: accept_invitation_from_email` (obtained via `fromEmail` + any
2109
+ * required TOTP step) and have set it on the client via `setJwtToken`.
2110
+ * `body.token` must still be the original `EmailToken` from the
2111
+ * invite-link URL — the handler decodes it a second time to find the
2112
+ * invitee and the entity lineage.
2113
+ */
2114
+ async acceptInviteFromEmail(params) {
2115
+ return this.request("POST", "/user/accept_invite_from_email", { body: params });
2116
+ }
2089
2117
  /**
2090
2118
  * Start TOTP setup (or no-op if already set).
2091
2119
  *