// 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 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; 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 = { /** * Part of the host, any case: `stripe` matches `api.stripe.com`. */ host?: string, /** * 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 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, }; export type GlobalAction = "proxy_start" | "proxy_stop" | "flows_clear"; 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, }; /** * The process that runs the engine. */ export type Owner = "app" | "cli"; 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], get_proxy_state: [GetProxyStateRequest, GetProxyStateResponse], list_actions: [ListActionsRequest, ListActionsResponse], list_flows: [FlowFilter, ListFlowsResponse], ca_status: [CaStatusRequest, CaStatus], ca_trust: [CaTrustRequest, CaStatus], clear_flows: [ClearFlowsRequest, number], filter_body: [FilterBodyRequest, FilterBodyResponse], get_flow_body: [GetFlowBodyRequest, GetFlowBodyResponse], system_proxy_set: [SystemProxySetRequest, SystemProxyStatus], system_proxy_status: [SystemProxyStatusRequest, SystemProxyStatus], }; export type ServiceProxy = { /** * The network service, as System Settings names it: "Wi-Fi", "USB 10/100/1000 LAN". */ name: string, http: ProxySetting, https: ProxySetting, }; /** * 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, /** * This platform has a system proxy the app can set. */ supported: boolean, }; export type SystemProxyStatusRequest = Record;