aws-cdk
Version:
AWS CDK Toolkit CLI, the command line tool for CDK apps
32 lines (31 loc) • 1.06 kB
TypeScript
import type { IncomingMessage } from 'http';
import type { Agent } from 'https';
import type { TelemetrySchema } from './schema';
/**
* A batch of telemetry events, as the endpoint expects to receive it.
*/
export interface TelemetryBatch {
readonly events: TelemetrySchema[];
}
/**
* Options for a single delivery attempt.
*/
export interface PostTelemetryOptions {
/**
* Agent to make the request through, carrying proxy and CA configuration.
*
* @default - Node's default agent, i.e. a direct connection
*/
readonly agent?: Agent;
/**
* Abort the attempt if the request has not completed within this many milliseconds.
*/
readonly timeoutMs: number;
}
/**
* POST a batch of telemetry events, resolving with the endpoint's response.
*
* Rejects if the connection fails or the timeout expires, but NOT on an unsuccessful status code --
* inspect `statusCode` for that.
*/
export declare function postTelemetry(url: URL, batch: TelemetryBatch, options: PostTelemetryOptions): Promise<IncomingMessage>;