UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

93 lines • 2.98 kB
import { APIResource } from "../../../../core/resource.js"; import { APIPromise } from "../../../../core/api-promise.js"; import { RequestOptions } from "../../../../internal/request-options.js"; export declare class BaseTails extends APIResource { static readonly _key: readonly ['pages', 'projects', 'deployments', 'tails']; /** * Start a tail that receives logs and exception data. * * @example * ```ts * const tail = * await client.pages.projects.deployments.tails.create( * 'f64788e9-fccd-4d4a-a28a-cb84f88f6e12', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * project_name: 'this-is-my-project-01', * }, * ); * ``` */ create(deploymentID: string, params: TailCreateParams, options?: RequestOptions): APIPromise<TailCreateResponse>; /** * Deletes a tail from a Pages deployment. * * @example * ```ts * const tail = * await client.pages.projects.deployments.tails.delete( * '023e105f4ecef8ad9ca31a8372d0c353', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * project_name: 'this-is-my-project-01', * deployment_id: 'f64788e9-fccd-4d4a-a28a-cb84f88f6e12', * }, * ); * ``` */ delete(tailID: string, params: TailDeleteParams, options?: RequestOptions): APIPromise<TailDeleteResponse | null>; } export declare class Tails extends BaseTails { } /** * A tail session for streaming logs from a Pages deployment. */ export interface TailCreateResponse { /** * Identifier of the tail session. */ id: string; /** * Optional WebSocket URL to connect to for receiving tail events, when returned by * the tail service. */ url?: string; } export type TailDeleteResponse = unknown; export interface TailCreateParams { /** * Path param: Identifier. */ account_id: string; /** * Path param: Name of the Pages project. Must begin with a lowercase letter or * digit and contain only lowercase letters, digits, and hyphens. */ project_name: string; /** * Body param: Filters to apply to the tail session. */ filters?: Array<{ [key: string]: unknown; }>; } export interface TailDeleteParams { /** * Identifier. */ account_id: string; /** * Name of the Pages project. Must begin with a lowercase letter or digit and * contain only lowercase letters, digits, and hyphens. */ project_name: string; /** * UUID of the Pages deployment, as returned by deployment list or create * operations. */ deployment_id: string; } export declare namespace Tails { export { type TailCreateResponse as TailCreateResponse, type TailDeleteResponse as TailDeleteResponse, type TailCreateParams as TailCreateParams, type TailDeleteParams as TailDeleteParams, }; } //# sourceMappingURL=tails.d.ts.map