@delopay/sdk 0.20.0 → 0.21.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.
@@ -1881,6 +1881,55 @@ var Users = class {
1881
1881
  async signOut() {
1882
1882
  return this.request("POST", "/user/signout");
1883
1883
  }
1884
+ /**
1885
+ * Paginated login history for the authenticated user — IP, User-Agent,
1886
+ * country / city / lat-lon (when GeoIP is enabled in backend), success
1887
+ * and failure events with their reasons. Strictly scoped to the JWT
1888
+ * subject; a user can only see their own activity.
1889
+ *
1890
+ * `GET /user/me/login-activity`. Requires a logged-in JWT.
1891
+ *
1892
+ * The backend returns an empty page when a Delopay admin is impersonating
1893
+ * a non-admin merchant, so the admin's metadata never renders inside the
1894
+ * merchant dashboard.
1895
+ */
1896
+ async listLoginActivity(params) {
1897
+ if (params === void 0) {
1898
+ return this.request("GET", "/user/me/login-activity");
1899
+ }
1900
+ return this.request("GET", "/user/me/login-activity", {
1901
+ query: params
1902
+ });
1903
+ }
1904
+ /**
1905
+ * List the authenticated user's currently-active dashboard sessions
1906
+ * (one row per minted login JWT that hasn't been revoked or expired).
1907
+ *
1908
+ * The row matching the JWT making this call has `is_current: true`,
1909
+ * which is what lets the dashboard render a "This device" tag.
1910
+ *
1911
+ * `GET /user/me/sessions`. Requires a logged-in JWT. Returns an empty
1912
+ * list when a Delopay admin is impersonating a non-admin merchant
1913
+ * (same guard as `listLoginActivity`).
1914
+ */
1915
+ async listActiveSessions() {
1916
+ return this.request("GET", "/user/me/sessions");
1917
+ }
1918
+ /**
1919
+ * Disconnect one of the authenticated user's sessions. The matching
1920
+ * JWT is rejected on its next request — fast-path via Redis, fall back
1921
+ * to the persistent `revoked_at` column.
1922
+ *
1923
+ * Idempotent: revoking an already-revoked or unknown id returns 404,
1924
+ * which the caller can treat as success for retry purposes. Revoking
1925
+ * a session id that belongs to a different user also returns 404 —
1926
+ * the response intentionally doesn't leak whether the id exists.
1927
+ *
1928
+ * `POST /user/me/sessions/{sessionId}/revoke`.
1929
+ */
1930
+ async revokeSession(sessionId) {
1931
+ return this.request("POST", `/user/me/sessions/${encodeURIComponent(sessionId)}/revoke`);
1932
+ }
1884
1933
  async getDetails() {
1885
1934
  return this.request("GET", "/user");
1886
1935
  }
@@ -3559,4 +3608,4 @@ export {
3559
3608
  applyBrandingVariables,
3560
3609
  shadowFor
3561
3610
  };
3562
- //# sourceMappingURL=chunk-QGQR2OBR.js.map
3611
+ //# sourceMappingURL=chunk-EPZVT7EJ.js.map