import { APIResource } from "../core/resource.js"; import { APIPromise } from "../core/api-promise.js"; import { RequestOptions } from "../internal/request-options.js"; export declare class AccessTokens extends APIResource { /** * Create a new client side access token with the specified configuration. */ create(body: AccessTokenCreateParams, options?: RequestOptions): APIPromise; /** * List all client side access tokens for the current account. This is only * available for cloud users. */ list(query?: AccessTokenListParams | null | undefined, options?: RequestOptions): APIPromise; /** * Delete a client side access token. */ delete(token: string, params?: AccessTokenDeleteParams | null | undefined, options?: RequestOptions): APIPromise; } export interface AccessTokenCreateResponse { token: string; expiresAt: string; hostname: string; policy: AccessTokenCreateResponse.Policy; } export declare namespace AccessTokenCreateResponse { interface Policy { data: Array; version: '1'; } namespace Policy { interface Data { id: string; access: Array<'read_messages' | 'write_messages' | 'read_agent' | 'write_agent'>; type: 'agent'; } } } export interface AccessTokenListResponse { hasNextPage: boolean; tokens: Array; } export declare namespace AccessTokenListResponse { interface Token { token: string; expiresAt: string; hostname: string; policy: Token.Policy; } namespace Token { interface Policy { data: Array; version: '1'; } namespace Policy { interface Data { id: string; access: Array<'read_messages' | 'write_messages' | 'read_agent' | 'write_agent'>; type: 'agent'; } } } } export type AccessTokenDeleteResponse = unknown; export interface AccessTokenCreateParams { /** * The hostname of the client side application. Please specify the full URL * including the protocol (http or https). */ hostname: string; policy: Array; /** * The expiration date of the token. If not provided, the token will expire in 5 * minutes */ expires_at?: string; } export declare namespace AccessTokenCreateParams { interface Policy { id: string; access: Array<'read_messages' | 'write_messages' | 'read_agent' | 'write_agent'>; type: 'agent'; } } export interface AccessTokenListParams { /** * The agent ID to filter tokens by. If provided, only tokens for this agent will * be returned. */ agentId?: string; /** * The number of tokens to return per page. Defaults to 10. */ limit?: number; /** * The offset for pagination. Defaults to 0. */ offset?: number; } export interface AccessTokenDeleteParams { body?: unknown; } export declare namespace AccessTokens { export { type AccessTokenCreateResponse as AccessTokenCreateResponse, type AccessTokenListResponse as AccessTokenListResponse, type AccessTokenDeleteResponse as AccessTokenDeleteResponse, type AccessTokenCreateParams as AccessTokenCreateParams, type AccessTokenListParams as AccessTokenListParams, type AccessTokenDeleteParams as AccessTokenDeleteParams, }; } //# sourceMappingURL=access-tokens.d.ts.map