@delopay/sdk 0.20.1 → 0.21.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.cjs CHANGED
@@ -1967,6 +1967,35 @@ var Users = class {
1967
1967
  query: params
1968
1968
  });
1969
1969
  }
1970
+ /**
1971
+ * List the authenticated user's currently-active dashboard sessions
1972
+ * (one row per minted login JWT that hasn't been revoked or expired).
1973
+ *
1974
+ * The row matching the JWT making this call has `is_current: true`,
1975
+ * which is what lets the dashboard render a "This device" tag.
1976
+ *
1977
+ * `GET /user/me/sessions`. Requires a logged-in JWT. Returns an empty
1978
+ * list when a Delopay admin is impersonating a non-admin merchant
1979
+ * (same guard as `listLoginActivity`).
1980
+ */
1981
+ async listActiveSessions() {
1982
+ return this.request("GET", "/user/me/sessions");
1983
+ }
1984
+ /**
1985
+ * Disconnect one of the authenticated user's sessions. The matching
1986
+ * JWT is rejected on its next request — fast-path via Redis, fall back
1987
+ * to the persistent `revoked_at` column.
1988
+ *
1989
+ * Idempotent: revoking an already-revoked or unknown id returns 404,
1990
+ * which the caller can treat as success for retry purposes. Revoking
1991
+ * a session id that belongs to a different user also returns 404 —
1992
+ * the response intentionally doesn't leak whether the id exists.
1993
+ *
1994
+ * `POST /user/me/sessions/{sessionId}/revoke`.
1995
+ */
1996
+ async revokeSession(sessionId) {
1997
+ return this.request("POST", `/user/me/sessions/${encodeURIComponent(sessionId)}/revoke`);
1998
+ }
1970
1999
  async getDetails() {
1971
2000
  return this.request("GET", "/user");
1972
2001
  }