cloudflare
Version:
The official TypeScript library for the Cloudflare API
152 lines • 3.77 kB
text/typescript
import { APIResource } from "../../../core/resource.mjs";
import { APIPromise } from "../../../core/api-promise.mjs";
import { RequestOptions } from "../../../internal/request-options.mjs";
export declare class BaseSession extends APIResource {
static readonly _key: readonly ['browserRendering', 'devtools', 'session'];
/**
* List active browser sessions.
*
* @example
* ```ts
* const sessions =
* await client.browserRendering.devtools.session.list({
* account_id: 'account_id',
* });
* ```
*/
list(params: SessionListParams, options?: RequestOptions): APIPromise<SessionListResponse>;
/**
* Get details for a specific browser session.
*
* @example
* ```ts
* const session =
* await client.browserRendering.devtools.session.get(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* { account_id: 'account_id' },
* );
* ```
*/
get(sessionID: string, params: SessionGetParams, options?: RequestOptions): APIPromise<SessionGetResponse | null>;
}
export declare class Session extends BaseSession {
}
export type SessionListResponse = Array<SessionListResponse.SessionListResponseItem>;
export declare namespace SessionListResponse {
interface SessionListResponseItem {
/**
* Session ID.
*/
sessionId: string;
/**
* Reason code for session closure.
*/
closeReason?: number;
/**
* Human-readable close reason.
*/
closeReasonText?: string;
/**
* Connection end time.
*/
connectionEndTime?: number;
/**
* Connection ID.
*/
connectionId?: string;
/**
* Connection start time.
*/
connectionStartTime?: number;
/**
* DevTools frontend URL.
*/
devtoolsFrontendUrl?: string;
/**
* Session end time.
*/
endTime?: number;
/**
* Last updated timestamp.
*/
lastUpdated?: number;
/**
* Session start time.
*/
startTime?: number;
/**
* WebSocket URL for debugging this target.
*/
webSocketDebuggerUrl?: string;
}
}
export interface SessionGetResponse {
/**
* Session ID.
*/
sessionId: string;
/**
* Reason code for session closure.
*/
closeReason?: number;
/**
* Human-readable close reason.
*/
closeReasonText?: string;
/**
* Connection end time.
*/
connectionEndTime?: number;
/**
* Connection ID.
*/
connectionId?: string;
/**
* Connection start time.
*/
connectionStartTime?: number;
/**
* DevTools frontend URL.
*/
devtoolsFrontendUrl?: string;
/**
* Session end time.
*/
endTime?: number;
/**
* Last updated timestamp.
*/
lastUpdated?: number;
/**
* Session start time.
*/
startTime?: number;
/**
* WebSocket URL for debugging this target.
*/
webSocketDebuggerUrl?: string;
}
export interface SessionListParams {
/**
* Path param: Account ID.
*/
account_id: string;
/**
* Query param
*/
limit?: number;
/**
* Query param
*/
offset?: number;
}
export interface SessionGetParams {
/**
* Account ID.
*/
account_id: string;
}
export declare namespace Session {
export { type SessionListResponse as SessionListResponse, type SessionGetResponse as SessionGetResponse, type SessionListParams as SessionListParams, type SessionGetParams as SessionGetParams, };
}
//# sourceMappingURL=session.d.mts.map