import { APIResource } from "../../core/resource.js"; import * as RealtimeAPI from "./realtime.js"; import { Realtime, RealtimeAuthParams, RealtimeAuthResponse, RealtimeCredentialsResponse } from "./realtime.js"; import { APIPromise } from "../../core/api-promise.js"; import { RequestOptions } from "../../internal/request-options.js"; export declare class Cli extends APIResource { realtime: RealtimeAPI.Realtime; /** * Generates a new CLI session with a random 6-character code. This endpoint is the * first step in the CLI authentication flow, creating a session that can later be * linked to a user account. The generated code is displayed to the user in the CLI * and should be entered in the web interface to complete authentication. * Optionally accepts a scope ('project' or 'user') and a source string. */ createSession(body?: CliCreateSessionParams | null | undefined, options?: RequestOptions): APIPromise; /** * Retrieves the current state of a CLI session using either the session ID (UUID) * or the 6-character code. This endpoint is used by both the CLI client to check * if the session has been linked, and by the web interface to display session * details before linking. */ getSession(query: CliGetSessionParams, options?: RequestOptions): APIPromise; } export interface CliCreateSessionResponse { /** * Unique identifier for the CLI session. UUID v4 format used for tracking and * retrieval. */ id: string; /** * The 6-character hexadecimal code used for CLI login */ code: string; /** * The ISO timestamp when the session expires */ expiresAt: string; /** * The key scope for this session */ scope: 'project' | 'user'; /** * The current status of the session */ status: 'pending' | 'linked'; } export interface CliGetSessionResponse { /** * The unique identifier for the CLI session */ id: string; /** * Information about the linked account, if any. Null if the session status is * "pending". */ account: CliGetSessionResponse.Account | null; /** * The API key for the linked account */ api_key: string | null; /** * The 6-character hexadecimal code used for CLI login */ code: string; /** * The ISO timestamp when the session expires */ expiresAt: string; /** * The key scope for this session */ scope: 'project' | 'user' | null; /** * The current status of the session */ status: 'pending' | 'linked'; } export declare namespace CliGetSessionResponse { /** * Information about the linked account, if any. Null if the session status is * "pending". */ interface Account { /** * The ID of the linked account */ id: string; /** * The email address of the linked account */ email: string; /** * The display name of the linked account */ name: string; } } export interface CliCreateSessionParams { /** * Key scope. 'project' (default) returns a project-level API key; 'user' returns a * user-level API key valid across projects. */ scope?: 'project' | 'user'; /** * Free-form string describing the source, e.g. 'Johns MacBook (darwin, v1.2.3)' */ source?: string; } export interface CliGetSessionParams { /** * CLI session ID (UUID format) or 6-character code to check. Both formats are * supported for flexibility in client implementations. */ id: string; } export declare namespace Cli { export { type CliCreateSessionResponse as CliCreateSessionResponse, type CliGetSessionResponse as CliGetSessionResponse, type CliCreateSessionParams as CliCreateSessionParams, type CliGetSessionParams as CliGetSessionParams, }; export { Realtime as Realtime, type RealtimeAuthResponse as RealtimeAuthResponse, type RealtimeCredentialsResponse as RealtimeCredentialsResponse, type RealtimeAuthParams as RealtimeAuthParams, }; } //# sourceMappingURL=cli.d.ts.map