/** Portable key-authenticated console calls for RUNTIME code (capability * misses today). The CLI's cloudFetch adds user sessions, refresh, and disk * state on top — Node-only concerns that used to ride into Worker bundles * whenever runtime code borrowed it. Keep this module free of node builtins * and CLI imports; the portability gate bundles it. */ import { resolveCloudBaseUrl, type CloudUrlOptions } from "./core/index.js"; /** Base-URL resolution lives in core, beside the env read it wraps: the CLI * resolves the same origin from the same inputs and may not reach this * Node-facing module to do it. Named here because this is where it is used. */ export { resolveCloudBaseUrl, type CloudUrlOptions }; export interface CloudKeyFetchOptions extends CloudUrlOptions { /** The key is always seam-supplied (adapter rule): callers pass it * explicitly — this module never falls back to the environment for it. */ apiKey: string; method?: string; body?: unknown; fetchImpl?: typeof fetch; signal?: AbortSignal; /** How a non-2xx becomes an error. Unset, it stays the plain status-carrying * Error the fire-and-forget senders retry on (`batched-uploader` reads * `.status`). A caller whose failure a DEVELOPER has to read passes * `raiseCloudError`, which preserves the console's own message and docs link * as a VendoError — without it an honest 400 reaches the wire as a plain * Error, fails `isVendoError`, and is answered "Internal Vendo error". */ raise?: (response: Response) => Promise; } /** POST/GET a console API path with seam-supplied bearer key auth. The * console's shared auth middleware upserts deployment inventory and meters * usage from the identity headers on real service calls * (deployment-identity.ts). */ export declare function cloudKeyFetch(path: string, options: CloudKeyFetchOptions): Promise;