/**
 * This file was auto-generated by openapi-typescript.
 * Do not make direct changes to the file.
 */

export interface paths {
    "/api/integrations/connections/{connectionId}/console/capabilities": {
        parameters: {
            query?: never;
            header?: never;
            path?: never;
            cookie?: never;
        };
        /**
         * Report which console kinds a resource supports
         * @description Resolve what the connection's console driver can do with the addressed resource, against live state rather than a static table: whether a resource admits a terminal generally depends on its current status. Used by a client to decide whether to offer a terminal or a log tail before opening a socket, and which containers the user may choose between.
         */
        get: operations["getConsoleCapabilities"];
        put?: never;
        post?: never;
        delete?: never;
        options?: never;
        head?: never;
        patch?: never;
        trace?: never;
    };
    "/api/integrations/connections/{connectionId}/console/terminal": {
        parameters: {
            query?: never;
            header?: never;
            path?: never;
            cookie?: never;
        };
        /**
         * Open an interactive terminal over a WebSocket
         * @description Upgrade to a WebSocket carrying an interactive, TTY-backed shell in the target resource. Consume with a native WebSocket client, not a generated RTK hook.
         *     Everything that can fail with a useful HTTP status — an unknown target, an unsupported console kind, an exhausted per-user console budget — is settled before the upgrade, so those failures arrive as ordinary HTTP responses rather than as a socket that opens and immediately closes. The handshake enforces a same-origin check: it is authenticated by an ambient session cookie, so accepting any Origin would let any page the user visits open a shell as them.
         *     The console runs with the requesting user's own credential, so the target's native authorization (Kubernetes RBAC, for a kubernetes connection) governs it unchanged.
         *     See ConsoleControlMessage for the frame protocol.
         */
        get: operations["openTerminalConsole"];
        put?: never;
        post?: never;
        delete?: never;
        options?: never;
        head?: never;
        patch?: never;
        trace?: never;
    };
    "/api/integrations/connections/{connectionId}/console/logs": {
        parameters: {
            query?: never;
            header?: never;
            path?: never;
            cookie?: never;
        };
        /**
         * Stream a resource's logs over a WebSocket
         * @description Upgrade to a WebSocket carrying the target resource's log output. With `follow=true` the socket stays open until the client leaves; otherwise it closes once the available history has been sent. Consume with a native WebSocket client, not a generated RTK hook.
         *     The stream parameters below are fixed when the remote log stream is created and cannot be renegotiated on a live socket: changing any of them means opening a new console.
         *     See ConsoleControlMessage for the frame protocol.
         */
        get: operations["openLogConsole"];
        put?: never;
        post?: never;
        delete?: never;
        options?: never;
        head?: never;
        patch?: never;
        trace?: never;
    };
}
export type webhooks = Record<string, never>;
export interface components {
    schemas: {
        /**
         * @description The kinds of console a driver may support for a given target.
         * @enum {string}
         */
        ConsoleKind: "terminal" | "logs";
        /** @description Addresses the resource a console attaches to, within the universe of a single connection. The field names read Kubernetes-ish because that is the first driver, but each driver interprets them for itself: `namespace` is any parent scope, `container` is any sub-target within `name`. A driver ignores the fields it has no use for. */
        ConsoleTarget: {
            /** @description The driver-specific resource type, e.g. "pod". */
            resource: string;
            /** @description The parent scope of the resource, if it has one. */
            namespace?: string;
            /** @description Identifies the resource within its scope. */
            name: string;
            /** @description Selects a sub-target within the resource, if it has any. */
            container?: string;
        };
        /** @description What a driver can do with one specific target. Resolved against live state rather than a static table, because whether a target admits a terminal generally depends on its current status. */
        ConsoleCapabilities: {
            /** @description Whether an interactive terminal can be opened. */
            terminal: boolean;
            /** @description Whether a log stream can be opened. */
            logs: boolean;
            /** @description The addressable sub-targets, if the resource has any. */
            containers?: string[];
            /** @description The sub-target used when ConsoleTarget.container is empty. */
            defaultContainer?: string;
            /** @description Explains, for a human, why an unsupported console kind is unsupported — e.g. that the pod is not running. */
            reason?: string;
        };
        /**
         * @description Identifies a console control frame. `resize` travels client-to-server; the rest travel server-to-client. A receiver ignores an unknown or wrong-direction type, so a newer peer can send frames an older one does not know about without breaking the console.
         * @enum {string}
         */
        ConsoleControlType: "ready" | "resize" | "error" | "exit" | "eof";
        /**
         * @description The JSON payload of a console WebSocket's text frames.
         *     A console socket carries two interleaved channels, distinguished by WebSocket opcode rather than by an envelope field. Binary frames carry raw payload bytes: stdin keystrokes from the client (terminal consoles only), and stdout or log bytes to the client. Text frames carry one of these JSON control messages.
         *     Splitting on opcode keeps the hot path allocation-light and avoids base64-inflating every keystroke and every log line by a third. It is also required for correctness: terminal output is not valid UTF-8 in general — it carries escape sequences, and arbitrary octets from a program writing raw bytes — so a text frame could not carry it faithfully.
         *     Every console ends with exactly one terminal control frame (`error`, `exit`, or `eof`) before the socket is closed, so a client never has to infer why a stream stopped from the close code alone. The close code is 4000 when the console ended as intended and 4001 when it failed; both sit in the private-use range RFC 6455 §7.4.2 reserves for applications.
         *     Fields not relevant to a given `type` are omitted.
         */
        ConsoleControlMessage: {
            /**
             * @description Identifies a console control frame. `resize` travels client-to-server; the rest travel server-to-client. A receiver ignores an unknown or wrong-direction type, so a newer peer can send frames an older one does not know about without breaking the console.
             * @enum {string}
             */
            type: "ready" | "resize" | "error" | "exit" | "eof";
            /** @description Terminal width in character cells. Carried by `resize`. */
            cols?: number;
            /** @description Terminal height in character cells. Carried by `resize`. */
            rows?: number;
            /**
             * @description The resolved target capabilities. Carried by `ready`, which the server sends once, after it has attached to the target. It lets a client render the sub-target it actually attached to when the request left `container` unspecified.
             *     Deliberately left as a pointer in Go: `omitempty` does not elide an empty struct, so a value type would stamp an empty capabilities object onto every `error` and `exit` frame.
             */
            capabilities?: {
                /** @description Whether an interactive terminal can be opened. */
                terminal: boolean;
                /** @description Whether a log stream can be opened. */
                logs: boolean;
                /** @description The addressable sub-targets, if the resource has any. */
                containers?: string[];
                /** @description The sub-target used when ConsoleTarget.container is empty. */
                defaultContainer?: string;
                /** @description Explains, for a human, why an unsupported console kind is unsupported — e.g. that the pod is not running. */
                reason?: string;
            };
            /** @description The MeshKit error code of an `error` frame, e.g. "meshery-server-1447". Lets a client branch on the failure without parsing prose. */
            code?: string;
            /** @description The human-readable description of an `error` frame. */
            message?: string;
            /** @description The remote command's status. Carried by `exit`. */
            exitCode?: number;
        };
    };
    responses: {
        /** @description Invalid request body or request param */
        400: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "text/plain": string;
            };
        };
        /** @description Expired JWT token used or insufficient privilege */
        401: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "text/plain": string;
            };
        };
        /** @description Result not found */
        404: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "text/plain": string;
            };
        };
        /** @description Internal server error */
        500: {
            headers: {
                [name: string]: unknown;
            };
            content: {
                "text/plain": string;
            };
        };
    };
    parameters: {
        /** @description The connection whose resources the console addresses. */
        connectionId: string;
        /** @description The driver-specific resource type, e.g. `pod` for a kubernetes connection. */
        resource: string;
        /** @description The resource's name within its scope. */
        name: string;
        /** @description The resource's parent scope, where it has one. Required for namespaced Kubernetes resources. */
        namespace: string;
        /** @description A sub-target within the resource, e.g. a container within a pod. The driver's default sub-target is used when omitted. */
        container: string;
    };
    requestBodies: never;
    headers: never;
    pathItems: never;
}
export type $defs = Record<string, never>;
export interface operations {
    getConsoleCapabilities: {
        parameters: {
            query: {
                /** @description The driver-specific resource type, e.g. `pod` for a kubernetes connection. */
                resource: string;
                /** @description The resource's name within its scope. */
                name: string;
                /** @description The resource's parent scope, where it has one. Required for namespaced Kubernetes resources. */
                namespace?: string;
                /** @description A sub-target within the resource, e.g. a container within a pod. The driver's default sub-target is used when omitted. */
                container?: string;
            };
            header?: never;
            path: {
                /** @description The connection whose resources the console addresses. */
                connectionId: string;
            };
            cookie?: never;
        };
        requestBody?: never;
        responses: {
            /** @description The console kinds the target admits. */
            200: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "application/json": {
                        /** @description Whether an interactive terminal can be opened. */
                        terminal: boolean;
                        /** @description Whether a log stream can be opened. */
                        logs: boolean;
                        /** @description The addressable sub-targets, if the resource has any. */
                        containers?: string[];
                        /** @description The sub-target used when ConsoleTarget.container is empty. */
                        defaultContainer?: string;
                        /** @description Explains, for a human, why an unsupported console kind is unsupported — e.g. that the pod is not running. */
                        reason?: string;
                    };
                };
            };
            /** @description Invalid request body or request param */
            400: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "text/plain": string;
                };
            };
            /** @description Expired JWT token used or insufficient privilege */
            401: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "text/plain": string;
                };
            };
            /** @description Result not found */
            404: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "text/plain": string;
                };
            };
            /** @description Internal server error */
            500: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "text/plain": string;
                };
            };
        };
    };
    openTerminalConsole: {
        parameters: {
            query: {
                /** @description The driver-specific resource type, e.g. `pod` for a kubernetes connection. */
                resource: string;
                /** @description The resource's name within its scope. */
                name: string;
                /** @description The resource's parent scope, where it has one. Required for namespaced Kubernetes resources. */
                namespace?: string;
                /** @description A sub-target within the resource, e.g. a container within a pod. The driver's default sub-target is used when omitted. */
                container?: string;
                /** @description The argv to execute, one query parameter per element. When omitted the driver picks a sensible interactive shell for the target. */
                command?: string[];
            };
            header?: never;
            path: {
                /** @description The connection whose resources the console addresses. */
                connectionId: string;
            };
            cookie?: never;
        };
        requestBody?: never;
        responses: {
            /** @description Switching Protocols. The connection becomes a console WebSocket speaking the frame protocol on ConsoleControlMessage. */
            101: {
                headers: {
                    [name: string]: unknown;
                };
                content?: never;
            };
            /** @description Invalid request body or request param */
            400: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "text/plain": string;
                };
            };
            /** @description Expired JWT token used or insufficient privilege */
            401: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "text/plain": string;
                };
            };
            /** @description The WebSocket handshake carried an Origin that is neither the server's own nor in its configured allow-list. */
            403: {
                headers: {
                    [name: string]: unknown;
                };
                content?: never;
            };
            /** @description Result not found */
            404: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "text/plain": string;
                };
            };
            /** @description The user already holds the maximum number of concurrent consoles. */
            429: {
                headers: {
                    [name: string]: unknown;
                };
                content?: never;
            };
            /** @description Internal server error */
            500: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "text/plain": string;
                };
            };
        };
    };
    openLogConsole: {
        parameters: {
            query: {
                /** @description The driver-specific resource type, e.g. `pod` for a kubernetes connection. */
                resource: string;
                /** @description The resource's name within its scope. */
                name: string;
                /** @description The resource's parent scope, where it has one. Required for namespaced Kubernetes resources. */
                namespace?: string;
                /** @description A sub-target within the resource, e.g. a container within a pod. The driver's default sub-target is used when omitted. */
                container?: string;
                /** @description Keep the stream open and append new output as it is produced. */
                follow?: boolean;
                /** @description Return the logs of the target's prior instance, if any. */
                previous?: boolean;
                /** @description Prefix each line with an RFC 3339 timestamp. */
                timestamps?: boolean;
                /** @description Cap how many lines of history are replayed before following. Omit for no limit. */
                tailLines?: number;
                /** @description Bound history to output produced within the last N seconds. Omit for no bound; a value of 0 is treated as omitted. */
                sinceSeconds?: number;
            };
            header?: never;
            path: {
                /** @description The connection whose resources the console addresses. */
                connectionId: string;
            };
            cookie?: never;
        };
        requestBody?: never;
        responses: {
            /** @description Switching Protocols. The connection becomes a console WebSocket speaking the frame protocol on ConsoleControlMessage. */
            101: {
                headers: {
                    [name: string]: unknown;
                };
                content?: never;
            };
            /** @description Invalid request body or request param */
            400: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "text/plain": string;
                };
            };
            /** @description Expired JWT token used or insufficient privilege */
            401: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "text/plain": string;
                };
            };
            /** @description The WebSocket handshake carried an Origin that is neither the server's own nor in its configured allow-list. */
            403: {
                headers: {
                    [name: string]: unknown;
                };
                content?: never;
            };
            /** @description Result not found */
            404: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "text/plain": string;
                };
            };
            /** @description The user already holds the maximum number of concurrent consoles. */
            429: {
                headers: {
                    [name: string]: unknown;
                };
                content?: never;
            };
            /** @description Internal server error */
            500: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "text/plain": string;
                };
            };
        };
    };
}
