// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { Flow, FlowBody, FlowMessage, GrpcSchema, ModelPayload, SavedQuery } from "./gen_models"; export type ActionInvocation = { "scope": "global", action: GlobalAction, }; export type ActionMetadata = { label: string, defaultHotkey: string | null, }; export type AddGrpcSchemaRequest = { /** * `api.example.com`, `localhost:50051`, `*.example.com` or `*`. */ hostPattern: string, /** * `.proto` files, and directories they import from. */ protoPaths: Array, }; export type AppIconRequest = { /** * A flow's `clientPath`. */ path: string, }; export type CaStatus = { /** * macOS trusts this app's CA, so HTTPS flows can be decrypted. */ trusted: boolean, /** * A certificate named "Yaak Proxy CA" is in a keychain: this one, or an older one. */ installed: boolean, certPath: string, }; export type CaStatusRequest = Record; export type CaTrustRequest = Record; export type ClearFlowsRequest = Record; /** * The app behind a client connection. */ export type ClientApp = { pid: number, /** * The app's name ("Google Chrome"), or the executable's for a process outside an app ("curl"). */ name: string, /** * The outermost `.app` bundle's CFBundleIdentifier, if any. */ bundleId: string | null, /** * The outermost `.app` bundle's path, or the executable's path when there is no bundle. */ path: string, /** * The working directory of a process outside an app, as it was when first looked up. */ cwd: string | null, }; export type CountSavedQueriesRequest = { hideSystem?: boolean, }; export type CreateSavedQueryRequest = { name: string, query: string, }; export type DecodeGrpcMessageRequest = { flowId: string, seq: number, /** * Decode without a schema even when one is found. */ schemaless?: boolean, }; /** * A captured gRPC message as JSON. */ export type DecodedGrpcMessage = { /** * Pretty JSON: the message's fields by name with a schema; without one, an array of its * fields as `{ field, wireType, value }`, a length-delimited one with its guesses (`string`, * `message`, `bytes` in base64). */ json: string, /** * The message type decoded with: `package.HelloReply`. None when schemaless. */ messageType: string | null, /** * The schema decoded with. None when schemaless. */ schema: GrpcSchema | null, /** * Why it decoded schemaless, or what to know about the decode. */ note: string | null, }; /** * What HTTPS is decrypted: the user's entries in order, then the built-in exclusions not * removed. A connection is decrypted when a positive entry matches it and no exclusion does. */ export type DecryptList = { entries: Array, }; /** * The decrypt list changed, here or through the control API. */ export type DecryptListChangedPayload = { list: DecryptList, }; /** * One entry of the decrypt list, as the app shows it. */ export type DecryptListEntry = { /** * As stored: `host:*.example.com`, `app:Google Chrome`, `!host:*.apple.com`, `*`. */ entry: string, /** * Shipped with the app: an exclusion of Apple's services or a pinned app's hosts. */ builtIn: boolean, }; export type DeleteSavedQueryRequest = { id: string, }; export type DropReason = "hop_by_hop" | "set_by_sending" | "body_decoded"; export type DroppedHeader = { name: string, value: string, reason: DropReason, }; /** * Entries to add after the user's own and to remove, applied to the list as it is when the * change lands. Each is normalized first. */ export type EditDecryptListRequest = { add: Array, remove: Array, }; export type ExportHarRequest = { /** * The file to write. */ path: string, /** * These flows, or else every flow the filter covers. */ ids?: Array, filter?: FlowFilter, }; export type FilterBodyRequest = { flowId: string, which: FlowBody, /** * JSONPath, or XPath for an XML or HTML body. */ expression: string, /** * The language the viewer detected from the body. Without it, the Content-Type decides. */ language?: FilterLanguage, }; export type FilterBodyResponse = { content: string, error: string | null, }; export type FilterLanguage = "jsonpath" | "xpath"; /** * Which flows a listing or a HAR export covers: a search, and a page of it. */ export type FlowFilter = { /** * A search in the query language (`crate::query`): `stripe @status:4xx`, * `@host:*.github.com -@is:system`. None or blank covers every flow. */ query?: string, /** * Leaves out macOS's own daemons, as hiding System does, unless the query says * `@is:system` itself. */ hideSystem?: boolean, /** * At most this many flows, the newest. */ limit?: number, /** * Only flows recorded after the flow with this id, for following new traffic. Flows are * recorded when they end, so a slow one that started earlier still comes through. */ after?: string, /** * Only flows older than the flow with this id, by start and then id, for paging back * through older traffic. */ before?: string, /** * The order to list in, the list's column sort: each key in turn, then by start and id, * oldest first. Empty lists newest first, as without it. With keys, `before` does not * apply; `cursor` pages instead. */ sort?: Array, /** * Only flows after these values in `sort`'s order, for paging through a sort: the `cursor` * of the page before, the sort values of its last flow as it was read, so a change to that * flow since does not move where the next page starts. */ cursor?: Array, }; /** * One key of a sort. */ export type FlowSortKey = { column: SortColumn | `field:${string}`, descending: boolean, }; export type FlowsClearedPayload = Record; /** * Flows deleted to keep captured traffic under the keep-traffic cap, the oldest first. */ export type FlowsRemovedPayload = { ids: Array, }; export type FolderSummary = { id: string, name: string, /** * The folder this one is in, if any. */ folderId: string | null, }; export type FormatBodyRequest = { text: string, }; export type GetDecryptListRequest = Record; export type GetFlowBodyRequest = { flowId: string, which: FlowBody, }; export type GetFlowBodyResponse = { /** * The body decoded with its Content-Encoding, at most the capture limit of it, in base64. * When it fails to decode, the bytes as they were on the wire instead. */ data: string, /** * The body is incomplete: cut on the wire, or decoded past the capture limit. */ truncated: boolean, /** * Bytes stored for the body, as they were on the wire. */ storedSize: number, /** * Why the body failed to decode, in which case `data` is as it was on the wire. */ decodeError?: string, /** * What to know about the body beyond its bytes, as that a WebSocket has none. */ note?: string, }; export type GetMessagePayloadRequest = { flowId: string, seq: number, }; export type GetMessagePayloadResponse = { /** * The payload as stored (unmasked, inflated, decompressed), in base64. */ data: string, /** * It is cut at the capture limit. */ truncated: boolean, }; export type GetProxyStateRequest = Record; export type GetProxyStateResponse = { state: ProxyState, /** * The port the engine is bound to, while it runs. */ port: number | null, /** * The port the engine starts on. */ configuredPort: number, /** * Flows are stored. Paused, traffic still passes through, unrecorded. */ recording: boolean, /** * The system proxy turns on as the engine starts. */ systemProxyAtLaunch: boolean, /** * The HTTP versions offered to clients. */ httpVersion: HttpVersion, /** * Bytes of each body stored per flow. */ captureBodyLimit: number, /** * Captured traffic is cleared at launch or kept between launches. */ traffic: TrafficRetention, /** * The most captured traffic kept, in bytes, or null to keep everything. Applies only * while traffic is kept. */ keepTrafficBytes: number | null, /** * Why the engine last failed to start, until it starts. */ startError: string | null, /** * How far encrypting traffic stored before encryption has got, from 0 to 1, while it * runs. The engine starts once it is done. */ encrypting: number | null, /** * Captured traffic cannot be read: its key is unavailable, or it is being encrypted. */ locked: ProxyLock | null, /** * Another process that owns the engine, such as the CLI daemon. While one does, this app * cannot start its own, and new flows reach it only through the database. */ otherOwner: OtherOwner | null, }; export type GetStorageSizeRequest = Record; export type GetStorageSizeResponse = { /** * The databases' used pages, as the keep-traffic cap counts them; locked, their files' * sizes on disk. */ bytes: number, }; export type GlobalAction = "recording_toggle" | "flows_clear"; export type HelperRegisterRequest = Record; export type HelperState = "unavailable" | "not_registered" | "requires_approval" | "enabled" | "not_found"; export type HelperUnregisterRequest = Record; /** * The HTTP versions offered to clients in intercepted HTTPS. Upstream, the engine speaks * whichever the server picks either way. */ export type HttpVersion = "auto" | "http1Only"; export type ListActionsRequest = Record; export type ListActionsResponse = { actions: Array<[ActionInvocation, ActionMetadata]>, }; export type ListFlowsResponse = { /** * Newest first. */ flows: Array, /** * Flows in the database, whatever the filter. */ total: number, /** * Flows the filter covers, whatever the limit, when it narrows to fewer than all of them. */ matching: number | null, /** * Sorted, the next page's `cursor`: the last flow's sort values, as read. None without a * sort or a flow. */ cursor: Array | null, }; export type ListGrpcSchemasRequest = Record; export type ListMessagesRequest = { flowId: string, /** * Only messages after this `seq`, for following a stream as it grows. */ afterSeq?: number, /** * At most this many, the first after `afterSeq`. */ limit?: number, }; export type ListMessagesResponse = { /** * In order, by `seq`. */ messages: Array, /** * Messages the flow has in all. */ total: number, }; export type ListSavedQueriesRequest = Record; export type ListSeenRequest = Record; export type ListWorkspacesRequest = Record; export type ListWorkspacesResponse = { /** * Yaak has run on this machine. Without it there is nothing to save into. */ yaakFound: boolean, workspaces: Array, }; /** * Which of some flows a search covers, for flows whose events were matched against another. */ export type MatchFlowsRequest = { filter: FlowFilter, ids: Array, }; /** * A message of a streaming flow was recorded. */ export type MessagePayload = { message: FlowMessage, }; export type OpenTerminalRequest = { /** * Environment variables the shell starts with, by name: `HTTPS_PROXY`. */ vars: Array<[string, string]>, }; export type OtherOwner = { owner: Owner, pid: number, startedAt: string, /** * The engine's port while it runs. */ proxyPort: number | null, }; /** * The process that runs the engine. */ export type Owner = "app" | "cli"; export type PreviewSaveRequest = { flowId: string, }; /** * Why captured traffic cannot be read, for the window's locked state. */ export type ProxyLock = { /** * What every refused read says. */ message: string, /** * The keychain would not give up the key, or has not been asked yet, so allowing Yaak * Proxy in Keychain Access is the way out. */ keychain: boolean, }; export type ProxySetting = { enabled: boolean, server: string, port: number, }; export type ProxyState = "running" | "stopped"; export type ProxyStatePayload = { state: ProxyState, }; /** * A term the query cannot run, which then matches nothing. `start` and `end` count UTF-16 * code units, as JavaScript does. */ export type QueryDiagnostic = { kind: QueryDiagnosticKind, path: string, start: number, end: number, }; /** * What is wrong with a term, for the search box to mark. */ export type QueryDiagnosticKind = "unknownField" | "invalidValue" | "notYet"; export type QuerySchemaRequest = Record; /** * The search's fields, for the search box's highlighting and completion. */ export type QuerySchemaResponse = { schema: import("@yaakapp-internal/query").Schema, }; export type QueryValuesRequest = { /** * A field's path: `host`, `header` for header names, `header.accept` for a header's values. */ path: string, }; export type ReflectGrpcHostRequest = { /** * `host` or `host:port`, over TLS on 443 unless a port is given, or either after * `http://` to ask without TLS. */ host: string, }; export type RemoveGrpcSchemaRequest = { id: string, }; export type RenameSavedQueryRequest = { id: string, name: string, }; export type ResetCapturedDataRequest = Record; export type RpcEventSchema = { decrypt_list_changed: DecryptListChangedPayload, flows_cleared: FlowsClearedPayload, flows_removed: FlowsRemovedPayload, message_write: MessagePayload, model_write: ModelPayload, proxy_state_changed: ProxyStatePayload, saved_queries_changed: SavedQueriesChangedPayload, }; export type RpcSchema = { execute_action: [ActionInvocation, boolean], format_body: [FormatBodyRequest, string], get_decrypt_list: [GetDecryptListRequest, DecryptList], get_message_payload: [GetMessagePayloadRequest, GetMessagePayloadResponse], list_actions: [ListActionsRequest, ListActionsResponse], list_flows: [FlowFilter, ListFlowsResponse], query_schema: [QuerySchemaRequest, QuerySchemaResponse], validate_query: [ValidateQueryRequest, Array], watch_query: [WatchQueryRequest, boolean], list_saved_queries: [ListSavedQueriesRequest, Array], create_saved_query: [CreateSavedQueryRequest, SavedQuery], rename_saved_query: [RenameSavedQueryRequest, SavedQuery], delete_saved_query: [DeleteSavedQueryRequest, boolean], list_grpc_schemas: [ListGrpcSchemasRequest, Array], list_messages: [ListMessagesRequest, ListMessagesResponse], remove_grpc_schema: [RemoveGrpcSchemaRequest, boolean], set_recording: [SetRecordingRequest, boolean], set_system_proxy_at_launch: [SetSystemProxyAtLaunchRequest, boolean], set_http_version: [SetHttpVersionRequest, HttpVersion], set_capture_body_limit: [SetCaptureBodyLimitRequest, number], set_traffic: [SetTrafficRequest, TrafficRetention], set_keep_traffic: [SetKeepTrafficRequest, number | null], add_grpc_schema: [AddGrpcSchemaRequest, GrpcSchema], app_icon: [AppIconRequest, string | null], ca_status: [CaStatusRequest, CaStatus], ca_trust: [CaTrustRequest, CaStatus], clear_flows: [ClearFlowsRequest, number], decode_grpc_message: [DecodeGrpcMessageRequest, DecodedGrpcMessage], export_har: [ExportHarRequest, number], filter_body: [FilterBodyRequest, FilterBodyResponse], get_flow_body: [GetFlowBodyRequest, GetFlowBodyResponse], get_proxy_state: [GetProxyStateRequest, GetProxyStateResponse], helper_register: [HelperRegisterRequest, SystemProxyStatus], helper_unregister: [HelperUnregisterRequest, SystemProxyStatus], edit_decrypt_list: [EditDecryptListRequest, DecryptList], list_seen: [ListSeenRequest, SeenTargets], set_decrypt_list: [SetDecryptListRequest, DecryptList], list_workspaces: [ListWorkspacesRequest, ListWorkspacesResponse], preview_save: [PreviewSaveRequest, SavePreview], reflect_grpc_host: [ReflectGrpcHostRequest, GrpcSchema], save_flow: [SaveFlowToYaakRequest, SavedFlow], save_flow_body: [SaveFlowBodyRequest, SaveFlowBodyResponse], system_proxy_set: [SystemProxySetRequest, SystemProxyStatus], system_proxy_status: [SystemProxyStatusRequest, SystemProxyStatus], take_over: [TakeOverRequest, boolean], set_port: [SetPortRequest, number], get_storage_size: [GetStorageSizeRequest, GetStorageSizeResponse], reset_captured_data: [ResetCapturedDataRequest, boolean], open_terminal: [OpenTerminalRequest, boolean], query_values: [QueryValuesRequest, Array], match_flows: [MatchFlowsRequest, Array], count_saved_queries: [CountSavedQueriesRequest, Array], }; export type SaveFlowBodyRequest = { flowId: string, which: FlowBody, /** * The file to write. */ path: string, }; export type SaveFlowBodyResponse = { /** * Bytes written. */ size: number, /** * What was written is incomplete, as `GetFlowBodyResponse.truncated` is. */ truncated: boolean, /** * The body failed to decode, so the file has it as it was on the wire. */ raw: boolean, }; export type SaveFlowToYaakRequest = { flowId: string, workspaceId: string, folderId?: string, /** * None or blank leaves the request unnamed, and Yaak shows its URL. */ name?: string, }; /** * What saving a flow as a Yaak request writes, for the save dialog. */ export type SavePreview = { method: string, url: string, /** * The URL as saved, its query split out into parameters, which Yaak shows for an unnamed * request. */ requestUrl: string, /** * The saved body type, which Yaak shows for an unnamed GraphQL request with no URL. */ bodyType: string | null, /** * Headers Yaak sets itself or that only meant something to the proxy. */ droppedHeaders: Array, /** * Headers saved as captured, Authorization among them. */ keptHeaders: number, /** * The body as it is saved: "JSON", "form URL-encoded with 7 fields". None without a body. */ body: string | null, /** * What does not carry over exactly, one sentence each. */ warnings: Array, /** * An Authorization header is saved in plain text. */ authorization: boolean, }; export type SavedFlow = { requestId: string, name: string, }; export type SavedQueriesChangedPayload = Record; /** * How many flows a saved query covers. */ export type SavedQueryCount = { id: string, count: number, }; export type SeenApp = { name: string, bundleId: string | null, }; /** * The hosts and apps flows have gone to and come from, for the decrypt list's suggestions. */ export type SeenTargets = { /** * Hosts as the sidebar names them, with a port other than the scheme's: most recent first. */ hosts: Array, /** * Apps by name and bundle id, most recent first. */ apps: Array, }; export type ServiceProxy = { /** * The network service, as System Settings names it: "Wi-Fi", "USB 10/100/1000 LAN". */ name: string, /** * What stays the same when the service is renamed: its device ("en0"), or its hardware * port when it has none. Absent when `networksetup` lists neither. */ id?: string, http: ProxySetting, https: ProxySetting, }; export type SetCaptureBodyLimitRequest = { bytes: number, }; export type SetDecryptListRequest = { /** * Every entry, in order, as typed: a bare hostname is a `host:` entry. A built-in * exclusion left out is removed. */ entries: Array, }; export type SetHttpVersionRequest = { httpVersion: HttpVersion, }; export type SetKeepTrafficRequest = { /** * Null keeps everything. */ bytes: number | null, }; export type SetPortRequest = { port: number, }; export type SetRecordingRequest = { enabled: boolean, }; export type SetSystemProxyAtLaunchRequest = { enabled: boolean, }; export type SetTrafficRequest = { traffic: TrafficRetention, }; /** * A column the list sorts by. */ export type SortColumn = "number" | "app" | "method" | "host" | "path" | "query" | "status" | "type" | "size" | "requestSize" | "time" | "latency" | "started" | "remote" | "version" | "tls" | "operation"; /** * One of a flow's sort values, as the database sorted it. */ export type SortValue = number | string; /** * How a change gets administrator rights. */ export type SystemProxyBackend = "helper" | "admin_prompt" | "sudo"; export type SystemProxySetRequest = { enabled: boolean, }; export type SystemProxyStatus = { /** * Every enabled network service sends HTTP and HTTPS to `127.0.0.1:`. */ enabled: boolean, /** * The port checked against. */ port: number, services: Array, backend: SystemProxyBackend, /** * The privileged helper's registration, which decides the backend. */ helper: HelperState, /** * This platform has a system proxy the app can set. */ supported: boolean, }; export type SystemProxyStatusRequest = Record; export type TakeOverRequest = Record; /** * What happens to captured traffic between launches. */ export type TrafficRetention = "clearOnLaunch" | "keep"; export type ValidateQueryRequest = { query: string, }; /** * The search the app shows, which flows written from now on are matched against, their events * naming `key`. No query stops it. */ export type WatchQueryRequest = { key: string, query?: string, hideSystem?: boolean, }; export type WorkspaceSummary = { id: string, name: string, folders: Array, };