// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. export type Answer = { "answer": "preview", route: PreviewRoute, } | { "answer": "terminal", plan: TerminalPlan, /** * The member whose ticket opened it, lowercased; absent when the daemon runs without auth. */ member?: string, } | { "answer": "pong" }; /** * A PEM certificate chain and its PEM private key. */ export type Certificate = { certificate: string, privateKey: string, }; export type Endpoint = { host: string, port: number, }; /** * Everything Node sends netd. */ export type FromNode = { "kind": "hello", build: string, pid: number, generation?: number, } | { "kind": "listen", config: ListenConfig, } | { "kind": "certificate", certificate?: Certificate, } | { "kind": "tunnel", tunnel?: TunnelConfig, } | { "kind": "ask", id: number, question: NetdQuestion, } | { "kind": "answer", id: number, answer: Answer, } | { "kind": "refused", id: number, message: string, } | { "kind": "revoke", member?: string, } | { "kind": "watch", checkout: WatchedCheckout, } | { "kind": "unwatch", dir: string, }; /** * Every port netd binds, as Node's config names them; an absent one is not bound. */ export type ListenConfig = { daemon: Endpoint, preview?: Endpoint, loopback?: Endpoint, /** * The 12-hex id every public hostname ends in; without one, a label's prefix alone classifies it. */ sandboxId?: string, /** * Origins that may frame a preview besides the preview itself. */ frameAncestors: Array, /** * A preview path Node answers whatever its host resolves to. */ previewProbePath: string, }; export type NetdAnswer = { "answer": "sync", generations: Array, }; /** * Request headers only netd sets on what it forwards to Node; it strips them from everything arriving outside. * Exported as a literal type, so a Node constant naming one that drifts from this spelling fails to compile. */ export type NetdHeader = "x-intentic-preview" | "x-intentic-preview-unreachable" | "x-intentic-listener"; /** * A question Node asks netd. */ export type NetdQuestion = { "question": "sync", dirs: Array, }; /** * An answer Node renders whole when asked, for netd to write as it stands: a refusal page, or the probe's report. */ export type Page = { status: number, headers: { [key in string]: string }, body: string, }; /** * What becomes of a preview host's request, decided by Node once, when asked. */ export type PreviewRoute = { "to": "upstream", upstream: Upstream, } | { "to": "page", page: Page, } | { "to": "outbox" }; /** * A question netd asks Node. */ export type Question = { "question": "preview", host: string, probe: boolean, } | { "question": "terminal", query: string, } | { "question": "ping" }; export type Scheme = "http" | "https"; /** * What a terminal socket opens onto, as Node decided from its ticket, session name and working directory. */ export type TerminalPlan = { "plan": "session", name: string, createIn?: string, } | { "plan": "tail", path: string, } | { "plan": "exit", code: number, reason: string, } | { "plan": "refused", code: number, reason: string, }; /** * Everything netd sends Node. */ export type ToNode = { "kind": "ask", id: number, question: Question, } | { "kind": "answer", id: number, answer: NetdAnswer, } | { "kind": "refused", id: number, message: string, } | { "kind": "tunnel", connected: boolean, reason?: string, refused?: TunnelRefusal, } | { "kind": "hiddenLine", session: string, prompt: string, value: string, }; /** * The ingress tunnel's door, the reachability grant it presents there, and the daemon's transfer routes it announces * (`METHOD /path` each, as the daemon names them), which the edge sends down the bulk socket. */ export type TunnelConfig = { url: string, grant: string, bulk: Array, }; /** * Why netd stopped dialling the ingress at its usual pace, past an ordinary drop it redials at once. */ export type TunnelRefusal = { "refusal": "elsewhere", host: string, } | { "refusal": "deleted" }; /** * A local upstream a preview host relays to. */ export type Upstream = { host: string, port: number, scheme: Scheme, /** * Rewrites Host and Origin to `localhost:`, for an app that never agreed to its preview name. */ localhost: boolean, /** * Framed by the editor: `frame-ancestors` is set and `x-frame-options` dropped. */ frameable: boolean, }; /** * A checkout whose changes netd counts: its working tree, the git dir holding its index and HEAD, and the common * dir holding refs and excludes (the git dir itself for a repository's main checkout). */ export type WatchedCheckout = { dir: string, gitDir: string, commonDir: string, };