/** * The installation a client command acts on. `--tenant ` names a local Tenant. Without it, * `NYLORUN_RUNTIME_URL` with the key the API needs names a remote installation: * `NYLORUN_MANAGEMENT_KEY` for the Management API (`nylorun tenant`), `NYLORUN_SERVER_KEY` or an * identity provider's token in `NYLORUN_TOKEN` for the Runtime API (`NYLORUN_RUNTIME_URL` alone is * an app's, as for `createAdmin`). Otherwise the local * Tenant the Project link names, else the default one, while it runs (`runningTenantApi`: the * Project's keys while they authenticate, else the Host root's own). */ import { type ManagementClient } from "@nylorun/admin"; import { type StackDeps } from "../stack/commands.js"; export type Api = "management" | "runtime"; export interface Connection { /** How messages name it: `Tenant `, or the remote URL. */ label: string; url: string; /** A local Tenant (Docker on this machine), else a remote installation. */ local: boolean; /** The local Tenant's name. */ tenant?: string; applicationKey?: string; managementKey?: string; /** A trusted issuer's token (`NYLORUN_TOKEN`), sent in place of the application key. */ token?: string; } /** The remote installation the environment names for `api`, if it names one. */ export declare function remoteConnection(env: StackDeps["env"], api: Api): Connection | undefined; /** The installation to act on for `api` (module comment). */ export declare function connect(deps: StackDeps, api: Api, tenant?: string): Promise; /** The Management API client of `connection`, through `deps.fetch`. */ export declare function managementClient(deps: StackDeps, connection: Connection): ManagementClient; /** `error`'s message, ending in one full stop. */ export declare function messageOf(error: unknown): string;