cloudflare
Version:
The official TypeScript library for the Cloudflare API
24 lines • 1.16 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflare/resource';
import * as ActiveSessionsAPI from 'cloudflare/resources/zero-trust/access/users/active-sessions';
import { SinglePage } from 'cloudflare/pagination';
export class ActiveSessions extends APIResource {
/**
* Get active sessions for a single user.
*/
list(identifier, id, options) {
return this._client.getAPIList(`/accounts/${identifier}/access/users/${id}/active_sessions`, ActiveSessionListResponsesSinglePage, options);
}
/**
* Get an active session for a single user.
*/
get(identifier, id, nonce, options) {
return this._client.get(`/accounts/${identifier}/access/users/${id}/active_sessions/${nonce}`, options)._thenUnwrap((obj) => obj.result);
}
}
export class ActiveSessionListResponsesSinglePage extends SinglePage {
}
(function (ActiveSessions) {
ActiveSessions.ActiveSessionListResponsesSinglePage = ActiveSessionsAPI.ActiveSessionListResponsesSinglePage;
})(ActiveSessions || (ActiveSessions = {}));
//# sourceMappingURL=active-sessions.mjs.map