// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { Flow, FlowBody, ModelPayload } from "./gen_models"; export type ActionInvocation = { "scope": "global", action: GlobalAction, }; export type ActionMetadata = { label: string, defaultHotkey: string | null, }; 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, }; export type DropReason = "hop_by_hop" | "set_by_sending" | "body_decoded"; export type DroppedHeader = { name: string, value: string, reason: DropReason, }; 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. Every field narrows it; none is all of them. */ export type FlowFilter = { /** * Search terms, any case, each of which must match the URL (host, path or query), the * method, the status (`404`, `40`, `4xx`) or the content type: `stripe post 4xx`. */ q?: string, /** * Part of the host, any case: `stripe` matches `api.stripe.com`. */ host?: string, /** * Only flows under one of these hosts or paths, as the app's sidebar names them: * `api.stripe.com` or `api.stripe.com/v1/charges`, with any port after the host. */ under?: Array, /** * Only flows from one of these apps, by bundle id, or by path for a process outside an * app bundle. */ app?: Array, /** * The method, any case. */ method?: string, /** * A status (`404`), a class of them (`4xx`), or `error` for flows that failed. */ status?: string, /** * 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, }; export type FlowsClearedPayload = Record; 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 GetFlowBodyRequest = { flowId: string, which: FlowBody, }; export type GetFlowBodyResponse = { /** * The body decoded with its Content-Encoding, at most the capture limit of it, in base64. */ 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, }; 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, /** * Why the engine last failed to start, until it starts. */ startError: string | 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 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, }; 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, }; 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, }; export type ProxySetting = { enabled: boolean, server: string, port: number, }; export type ProxyState = "running" | "stopped"; export type ProxyStatePayload = { state: ProxyState, }; export type RpcEventSchema = { flows_cleared: FlowsClearedPayload, model_write: ModelPayload, proxy_state_changed: ProxyStatePayload, }; export type RpcSchema = { execute_action: [ActionInvocation, boolean], format_body: [FormatBodyRequest, string], list_actions: [ListActionsRequest, ListActionsResponse], list_flows: [FlowFilter, ListFlowsResponse], set_recording: [SetRecordingRequest, boolean], set_system_proxy_at_launch: [SetSystemProxyAtLaunchRequest, boolean], set_http_version: [SetHttpVersionRequest, HttpVersion], app_icon: [AppIconRequest, string | null], ca_status: [CaStatusRequest, CaStatus], ca_trust: [CaTrustRequest, CaStatus], clear_flows: [ClearFlowsRequest, number], 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], list_workspaces: [ListWorkspacesRequest, ListWorkspacesResponse], preview_save: [PreviewSaveRequest, SavePreview], save_flow: [SaveFlowToYaakRequest, SavedFlow], system_proxy_set: [SystemProxySetRequest, SystemProxyStatus], system_proxy_status: [SystemProxyStatusRequest, SystemProxyStatus], take_over: [TakeOverRequest, 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 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 SetHttpVersionRequest = { httpVersion: HttpVersion, }; export type SetRecordingRequest = { enabled: boolean, }; export type SetSystemProxyAtLaunchRequest = { enabled: boolean, }; /** * 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; export type WorkspaceSummary = { id: string, name: string, folders: Array, };