Files
yaak-mountain-loop/crates-proxy/yaak-proxy-lib/bindings/gen_models.ts
T

250 lines
6.9 KiB
TypeScript
Generated

// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { ModelChangeEvent } from "./ModelChangeEvent";
/**
* One proxied request and its response. The bodies are in `blobs.sqlite`, not the row; a
* stream's are its messages, and read back from them (`bodies::from_messages`).
*/
export type Flow = { id: string,
/**
* The flow's short handle, `#1429`: its rowid, which grows as flows are written and is kept
* across updates. Zero when read without it.
*/
number: number, createdAt: string, updatedAt: string, startedAt: string, method: string, url: string,
/**
* Version spoken by the client.
*/
clientHttpVersion: string,
/**
* Version spoken with the upstream server.
*/
upstreamHttpVersion: string | null, remoteAddr: string | null, status: number | null,
/**
* The response's Content-Type.
*/
contentType: string | null, requestHeaders: Array<ProxyHeader>, responseHeaders: Array<ProxyHeader>,
/**
* Bytes of the request body on the wire, captured or not.
*/
requestSize: number,
/**
* Bytes of the response body on the wire, captured or not.
*/
responseSize: number,
/**
* Only the first `capture_body_limit` bytes of the body are stored. For a body that is a
* stream's messages, a message was cut at the limit.
*/
requestTruncated: boolean,
/**
* Only the first `capture_body_limit` bytes of the body are stored. For a body that is a
* stream's messages, a message was cut at the limit.
*/
responseTruncated: boolean,
/**
* Milliseconds from `started_at` to the response headers.
*/
elapsedHeadersMs: number | null,
/**
* Milliseconds from `started_at` to the end of the response.
*/
elapsedMs: number | null,
/**
* Milliseconds from `started_at` to the TCP connection to the server, and to the end of
* its TLS handshake. Only for intercepted HTTPS on a connection opened for this flow.
*/
elapsedConnectMs: number | null, elapsedTlsMs: number | null,
/**
* Milliseconds from `started_at` to the request body being sent whole. None without one.
*/
elapsedRequestMs: number | null,
/**
* The client's end of its connection: `127.0.0.1:54321`.
*/
clientAddr: string | null,
/**
* The TLS negotiated with the server for intercepted HTTPS: `TLSv1.3`.
*/
upstreamTlsVersion: string | null,
/**
* `TLS13_AES_128_GCM_SHA256`.
*/
upstreamTlsCipher: string | null, error: string | null,
/**
* The client gave up before the response ended, by resetting its HTTP/2 stream or closing
* the connection. Not an error.
*/
cancelled: boolean,
/**
* The id of the Yaak request this flow was last saved as.
*/
savedRequestId: string | null,
/**
* The process that opened the client connection, where the platform can tell (macOS).
*/
clientPid: number | null,
/**
* Its app's name, or its executable's outside an app: "Google Chrome", "curl".
*/
clientName: string | null,
/**
* Its app's bundle id.
*/
clientBundleId: string | null,
/**
* Its app bundle's path, or its executable's outside an app.
*/
clientPath: string | null,
/**
* The working directory of a process outside an app, whose folder names it: `node` in
* `fieldwork`.
*/
clientCwd: string | null,
/**
* The flow carries a stream of messages, listed with `list_messages`. It is written as the
* stream opens and again as messages land; it is open until `elapsedMs`, `error` or
* `cancelled` is set.
*/
streamKind: StreamKind | null,
/**
* Messages recorded so far.
*/
messageCount: number,
/**
* A gRPC call's service, from its path: `package.Service`.
*/
grpcService: string | null,
/**
* A gRPC call's method, from its path.
*/
grpcMethod: string | null,
/**
* A gRPC call's status, from its trailers. Not 0 is a failed call.
*/
grpcStatus: number | null,
/**
* A gRPC call's `grpc-message`, decoded.
*/
grpcMessage: string | null,
/**
* An HTTPS connection passed through undecrypted, as the decrypt list leaves it out or its
* client rejected the proxy's certificate: method `CONNECT`, its URL the host, its sizes
* the bytes each way, and no headers or bodies. Open until `elapsedMs` or `error` is set.
*/
tunnelled: boolean, };
export type FlowBody = "request" | "response";
/**
* One message of a streaming flow. Its payload is fetched on its own.
*/
export type FlowMessage = { id: string, flowId: string,
/**
* Its place in the flow, from 0, in the order messages passed the proxy.
*/
seq: number, direction: MessageDirection, kind: MessageKind,
/**
* When it had passed the proxy whole.
*/
timestamp: string,
/**
* Bytes it took on the wire: the frames' payloads, the event's lines, the gRPC message
* without its prefix.
*/
size: number,
/**
* Bytes of payload stored: unmasked, reassembled, inflated or decompressed, and cut at the
* capture limit.
*/
storedSize: number,
/**
* The stored payload is cut short at the capture limit.
*/
truncated: boolean,
/**
* It was compressed on the wire (permessage-deflate, gRPC's compressed flag); the payload is
* stored decompressed unless `error` says otherwise.
*/
compressed: boolean,
/**
* Why the payload could not be decoded or stored.
*/
error: string | null, meta: MessageMeta,
/**
* The payload's start as text, when it is text.
*/
preview: string | null, };
/**
* Descriptors for decoding the gRPC calls to hosts that match `hostPattern`.
*/
export type GrpcSchema = { id: string, createdAt: string, updatedAt: string,
/**
* A host (`api.example.com`), a host and port (`localhost:50051`), any subdomain of one
* (`*.example.com`), or every host (`*`).
*/
hostPattern: string, source: GrpcSchemaSource,
/**
* The `.proto` files and include directories compiled, for a `files` schema.
*/
protoPaths: Array<string>,
/**
* The services the descriptors define, by full name.
*/
services: Array<string>, };
/**
* Where a schema's descriptors came from.
*/
export type GrpcSchemaSource = "files" | "reflection";
export type MessageDirection = "client" | "server";
export type MessageKind = "websocket_text" | "websocket_binary" | "websocket_ping" | "websocket_pong" | "websocket_close" | "sse_event" | "grpc_message" | "grpc_trailers";
/**
* What a kind of message carries beside its payload. Fields that do not apply are left out.
*/
export type MessageMeta = {
/**
* A WebSocket close frame's status code.
*/
closeCode?: number,
/**
* A WebSocket close frame's reason.
*/
closeReason?: string,
/**
* An SSE event's `event` field.
*/
event?: string,
/**
* An SSE event's `id` field.
*/
eventId?: string,
/**
* An SSE event's `retry` field, in milliseconds.
*/
retry?: number,
/**
* An SSE event's lines as they came, comments included, up to 4 KB.
*/
raw?: string,
/**
* gRPC trailers' `grpc-status`.
*/
grpcStatus?: number,
/**
* gRPC trailers' `grpc-message`, decoded.
*/
grpcMessage?: string, };
export type ModelPayload = { model: Flow, change: ModelChangeEvent, };
export type ProxyHeader = { name: string, value: string, };
/**
* The streaming protocol a flow carries.
*/
export type StreamKind = "websocket" | "sse" | "grpc" | "grpc_web";