/** * `@sylphx/management` — pure-functional TypeScript SDK for the Sylphx * Management API. * * Shape (ADR-077 Rule B — no classes, no `this`, no inheritance): * * import { createClient, projects, databases } from '@sylphx/management' * * const client = createClient({ token: process.env.SYLPHX_TOKEN! }) * const list = await projects.list(client) * const db = await databases.create(client, { name: 'mydb', tier: 'standard', env: 'production', storageGb: 10 }) * * The `Client` returned by `createClient` is a frozen value-type carrying * only the transport primitives (token, URLs, User-Agent, optional fetch). * All business logic lives server-side (Effect-TS, ADR-058). Capability modules * (`projects`, `databases`, …) are flat namespaces of free async * functions that take `Client` as their first argument. No state is * held in the SDK; the same `Client` may be shared across any number * of parallel calls. * * Errors surface as `ApiError` with the upstream status + a best-effort * parsed body. Consumers treat them via `try/catch` or `.catch`; the * Effect-TS CLI wraps via `Effect.tryPromise` at its ApiService Layer. */ export interface ClientOptions { readonly token: string; /** Base URL for the API. Default: `https://api.sylphx.com`. */ readonly baseUrl?: string; /** User-Agent header value. Default: current beta package identity. */ readonly userAgent?: string; /** Optional transport override for server-side cookie forwarding or tests. */ readonly fetch?: typeof globalThis.fetch; /** * Optional organization selector for user-context Management API calls. * Multi-org operators use this to scope requests without minting a separate * OAuth token per org. */ readonly preferredOrgId?: string; } export interface Client { readonly token: string; readonly baseUrl: string; readonly apiBase: string; readonly userAgent: string; readonly fetch?: typeof globalThis.fetch; readonly preferredOrgId?: string; } export declare function createClient(opts: ClientOptions): Client; //# sourceMappingURL=client.d.ts.map