// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../core/resource'; import { APIPromise } from '../../core/api-promise'; import { RequestOptions } from '../../internal/request-options'; /** * CLI integration endpoints */ export class Realtime extends APIResource { /** * Authenticate CLI client access to a private-cli-{nanoId} Pusher channel */ auth(body: RealtimeAuthParams, options?: RequestOptions): APIPromise { return this._client.post('/api/v3.1/cli/realtime/auth', { body, ...options }); } /** * Get the Pusher key and project nanoId for the CLI realtime trigger channel. The * CLI subscribes to private-cli-{project_id}. */ credentials(options?: RequestOptions): APIPromise { return this._client.get('/api/v3.1/cli/realtime/credentials', options); } } export interface RealtimeAuthResponse { /** * The authentication string for Pusher */ auth: string; /** * Channel data for presence channels */ channel_data?: string; } export interface RealtimeCredentialsResponse { /** * The project nanoId associated with the API Key provided. Used as part of the CLI * channel name: private-cli-{project_id} */ project_id: string; /** * The Pusher cluster for subscribing to the trigger */ pusher_cluster: string; /** * The Pusher client key for subscribing to the trigger */ pusher_key: string; } export interface RealtimeAuthParams { /** * The channel name to authenticate for */ channel_name: string; /** * The socket ID for Pusher authentication */ socket_id: string; } export declare namespace Realtime { export { type RealtimeAuthResponse as RealtimeAuthResponse, type RealtimeCredentialsResponse as RealtimeCredentialsResponse, type RealtimeAuthParams as RealtimeAuthParams, }; }