import { DoomApi, DoomApiScope } from "../../schemas/packageApi.mjs"; //#region src/services/testing/packageApi.d.ts /** * A package's HTTP surface, mounted the way a host mounts it. * * A package tests its routes by calling its Hono app directly, which proves the * routes but not the mount: the host serves them under * `/api/plugin/` and strips that prefix before the app sees the * request. A package whose routes are written absolute passes its own suite and * answers nothing in a running cockpit. * * This mounts the declared `DoomApi` the same way, so a test asks for the URL a * browser would ask for. Plain `Request` and `Response`; no HTTP framework and * no server. */ export interface MountPackageApiOptions { scope?: DoomApiScope; sessionId?: string; cwd?: string; } export interface MountedPackageApi { /** Where the host mounted it, for building a URL the way a client does. */ readonly mountPath: string; /** What the API reported to its host; a package that notices nothing leaves this empty. */ readonly notices: readonly string[]; /** * Fetches one path. * * The path is host-absolute, so it carries the mount the client would send: * `/api/plugin/workflow/runs/repo/blog-4`. A path outside the mount is a 404 * from this, exactly as it is from the host. */ fetch(path: string, init?: RequestInit): Promise; close(): void; } export declare function mountPackageApi(api: DoomApi, options?: MountPackageApiOptions): MountedPackageApi; //#endregion //# sourceMappingURL=packageApi.d.mts.map