import * as z from 'zod/mini'; import * as Response from '../../internal/Response.js'; import type * as App from '../App.js'; /** Zod schemas owned by the admin API-keys handler. */ export declare namespace schema { /** Schemas for the createApiKey operation. */ namespace createApiKey { /** * Request body for minting a named key. The server sets `createdBy` from * the verified identity so it cannot be spoofed. */ const Body: z.ZodMiniObject<{ allowedIps: z.ZodMiniDefault>>>; billingActive: z.ZodMiniOptional>; environment: z.ZodMiniDefault>; projectId: z.ZodMiniOptional>; rateLimits: z.ZodMiniOptional, z.ZodMiniObject<{ limit: z.ZodMiniNumber; period: z.ZodMiniUnion, z.ZodMiniLiteral<"second">]>; }, z.core.$strip>>>; orgId: z.ZodMiniOptional>; expiresAt: z.ZodMiniOptional; name: z.ZodMiniPipe, z.ZodMiniTransform>; scopes: z.ZodMiniReadonly, z.ZodMiniUnion, z.ZodMiniTemplateLiteral<`zone:${number}:write`>]>]>>>; }, z.core.$strip>; /** Response: the record plus the one-time plaintext token. */ const Response: z.ZodMiniObject<{ allowedIps: z.ZodMiniDefault>>>; billingActive: z.ZodMiniOptional>; environment: z.ZodMiniDefault>; id: z.ZodMiniString; name: z.ZodMiniOptional>; orgId: z.ZodMiniString; projectId: z.ZodMiniOptional>; rateLimits: z.ZodMiniOptional, z.ZodMiniObject<{ limit: z.ZodMiniNumber; period: z.ZodMiniUnion, z.ZodMiniLiteral<"second">]>; }, z.core.$strip>>>; scopes: z.ZodMiniReadonly>>; createdAt: z.ZodMiniString; createdBy: z.ZodMiniOptional>; expiresAt: z.ZodMiniOptional>; tokenLast4: z.ZodMiniString; token: z.ZodMiniString; }, z.core.$strip>; } /** Schemas for the listApiKeys operation. */ namespace listApiKeys { /** Query parameters for listing keys. */ const Query: z.ZodMiniObject<{ orgId: z.ZodMiniOptional>; }, z.core.$strip>; /** Response body: a list of key records (metadata only — never tokens). */ const Response: z.ZodMiniObject<{ data: z.ZodMiniArray>>>; billingActive: z.ZodMiniOptional>; environment: z.ZodMiniDefault>; id: z.ZodMiniString; name: z.ZodMiniOptional>; orgId: z.ZodMiniString; projectId: z.ZodMiniOptional>; rateLimits: z.ZodMiniOptional, z.ZodMiniObject<{ limit: z.ZodMiniNumber; period: z.ZodMiniUnion, z.ZodMiniLiteral<"second">]>; }, z.core.$strip>>>; scopes: z.ZodMiniReadonly>>; createdAt: z.ZodMiniString; createdBy: z.ZodMiniOptional>; expiresAt: z.ZodMiniOptional>; tokenLast4: z.ZodMiniString; createdByLabel: z.ZodMiniNullable>; organizationName: z.ZodMiniNullable>; projectName: z.ZodMiniNullable>; }, z.core.$strip>>; }, z.core.$strip>; } /** Schemas for the updateApiKey operation. */ namespace updateApiKey { /** Request body updating a key; omitted fields keep their value. */ const Body: z.ZodMiniObject<{ allowedIps: z.ZodMiniOptional>>>; name: z.ZodMiniOptional, z.ZodMiniTransform>>; orgId: z.ZodMiniOptional>; projectId: z.ZodMiniOptional>; }, z.core.$strip>; /** Path parameters for updating a key. */ const Params: z.ZodMiniObject<{ id: z.ZodMiniString; }, z.core.$strip>; } /** Schemas for the backfillApiKeys operation. */ namespace backfillApiKeys { /** Result counts from the index rebuild. */ const Response: z.ZodMiniObject<{ indexed: z.ZodMiniNumber; scanned: z.ZodMiniNumber; }, z.core.$strip>; } /** Schemas for the revokeApiKey operation. */ namespace revokeApiKey { /** Path parameters for revoking a key. */ const Params: z.ZodMiniObject<{ id: z.ZodMiniString; }, z.core.$strip>; /** Response body for a successful revocation. */ const Response: z.ZodMiniObject<{ id: z.ZodMiniString; }, z.core.$strip>; } /** Schemas for the rotateApiKey operation. */ namespace rotateApiKey { /** Path parameters for rotating a key. */ const Params: z.ZodMiniObject<{ id: z.ZodMiniString; }, z.core.$strip>; /** Response: the replacement record plus its one-time plaintext token. */ const Response: z.ZodMiniObject<{ allowedIps: z.ZodMiniDefault>>>; billingActive: z.ZodMiniOptional>; environment: z.ZodMiniDefault>; id: z.ZodMiniString; name: z.ZodMiniOptional>; orgId: z.ZodMiniString; projectId: z.ZodMiniOptional>; rateLimits: z.ZodMiniOptional, z.ZodMiniObject<{ limit: z.ZodMiniNumber; period: z.ZodMiniUnion, z.ZodMiniLiteral<"second">]>; }, z.core.$strip>>>; scopes: z.ZodMiniReadonly>>; createdAt: z.ZodMiniString; createdBy: z.ZodMiniOptional>; expiresAt: z.ZodMiniOptional>; tokenLast4: z.ZodMiniString; token: z.ZodMiniString; }, z.core.$strip>; } } /** * Provisioning routes for API keys, backed by the app's KV state store: * * - `POST /` mints a key, recording `createdBy` from the verified identity and * returning the one-time token. * - `GET /` lists key records (metadata only), optionally filtered by `orgId`. * - `DELETE /:id` revokes a key by id (`404` if absent). * - `PATCH /:id` updates a key's allowlist, name, or project, or assigns its first organization. * - `POST /:id/rotate` mints a replacement with the source key's access and attribution. * - `POST /backfill` rebuilds the id and org index entries for every record. */ export declare function apiKeys(): import("hono/hono-base").HonoBase | undefined; orgId?: string | undefined; expiresAt?: string | undefined; name: string; scopes: readonly ("*" | "data:read" | "funding:read" | "funding:write" | "indexer:query" | "management:read" | "management:write" | "mpp:write" | "rpc-relay:read" | "rpc-relay:sponsor" | "webhooks:read" | "webhooks:write" | `zone:${number}:read` | `zone:${number}:write`)[]; }; }; } | { output: { error: { code: "not_found"; details?: readonly Response.error.Detail[] | undefined; message: string; }; requestId: string; }; outputFormat: "json"; status: 404; input: { json: { allowedIps?: readonly string[] | undefined; billingActive?: boolean | undefined; environment?: "production" | "sandbox" | undefined; projectId?: string | undefined; rateLimits?: Record | undefined; orgId?: string | undefined; expiresAt?: string | undefined; name: string; scopes: readonly ("*" | "data:read" | "funding:read" | "funding:write" | "indexer:query" | "management:read" | "management:write" | "mpp:write" | "rpc-relay:read" | "rpc-relay:sponsor" | "webhooks:read" | "webhooks:write" | `zone:${number}:read` | `zone:${number}:write`)[]; }; }; } | { output: { allowedIps: readonly string[]; billingActive?: boolean | undefined; environment: "production" | "sandbox"; id: string; name?: string | undefined; orgId: string; projectId?: string | undefined; rateLimits?: { [x: string]: { limit: number; period: "minute" | "second"; }; } | undefined; scopes: readonly string[]; createdAt: string; createdBy?: string | undefined; expiresAt?: string | undefined; tokenLast4: string; token: string; }; outputFormat: "json"; status: import("hono/utils/http-status").ContentfulStatusCode; input: { json: { allowedIps?: readonly string[] | undefined; billingActive?: boolean | undefined; environment?: "production" | "sandbox" | undefined; projectId?: string | undefined; rateLimits?: Record | undefined; orgId?: string | undefined; expiresAt?: string | undefined; name: string; scopes: readonly ("*" | "data:read" | "funding:read" | "funding:write" | "indexer:query" | "management:read" | "management:write" | "mpp:write" | "rpc-relay:read" | "rpc-relay:sponsor" | "webhooks:read" | "webhooks:write" | `zone:${number}:read` | `zone:${number}:write`)[]; }; }; }; }; } & { "/": { $get: { output: { data: { allowedIps: readonly string[]; billingActive?: boolean | undefined; environment: "production" | "sandbox"; id: string; name?: string | undefined; orgId: string; projectId?: string | undefined; rateLimits?: { [x: string]: { limit: number; period: "minute" | "second"; }; } | undefined; scopes: readonly string[]; createdAt: string; createdBy?: string | undefined; expiresAt?: string | undefined; tokenLast4: string; createdByLabel: string | null; organizationName: string | null; projectName: string | null; }[]; }; outputFormat: "json"; status: import("hono/utils/http-status").ContentfulStatusCode; input: { query?: { orgId?: string | string[]; } | undefined; }; }; }; } & { "/:id": { $delete: { output: { error: { code: "not_found"; details?: readonly Response.error.Detail[] | undefined; message: string; }; requestId: string; }; outputFormat: "json"; status: 404; input: { param: { id: string; }; }; } | { output: { id: string; }; outputFormat: "json"; status: import("hono/utils/http-status").ContentfulStatusCode; input: { param: { id: string; }; }; }; }; } & { "/:id/rotate": { $post: { output: { error: { code: "not_found"; details?: readonly Response.error.Detail[] | undefined; message: string; }; requestId: string; }; outputFormat: "json"; status: 404; input: { param: { id: string; }; }; } | { output: { allowedIps: readonly string[]; billingActive?: boolean | undefined; environment: "production" | "sandbox"; id: string; name?: string | undefined; orgId: string; projectId?: string | undefined; rateLimits?: { [x: string]: { limit: number; period: "minute" | "second"; }; } | undefined; scopes: readonly string[]; createdAt: string; createdBy?: string | undefined; expiresAt?: string | undefined; tokenLast4: string; token: string; }; outputFormat: "json"; status: 200; input: { param: { id: string; }; }; }; }; } & { "/:id": { $patch: { output: { error: { code: "not_found"; details?: readonly Response.error.Detail[] | undefined; message: string; }; requestId: string; }; outputFormat: "json"; status: 404; input: { param: { id: string; }; } & { json: { allowedIps?: readonly string[] | undefined; name?: string | undefined; orgId?: string | undefined; projectId?: string | undefined; }; }; } | { output: { error: { code: "organization_already_assigned"; details?: readonly Response.error.Detail[] | undefined; message: string; }; requestId: string; }; outputFormat: "json"; status: 409; input: { param: { id: string; }; } & { json: { allowedIps?: readonly string[] | undefined; name?: string | undefined; orgId?: string | undefined; projectId?: string | undefined; }; }; } | { output: { allowedIps: readonly string[]; billingActive?: boolean | undefined; environment: "production" | "sandbox"; id: string; name?: string | undefined; orgId: string; projectId?: string | undefined; rateLimits?: { [x: string]: { limit: number; period: "minute" | "second"; }; } | undefined; scopes: readonly string[]; createdAt: string; createdBy?: string | undefined; expiresAt?: string | undefined; tokenLast4: string; }; outputFormat: "json"; status: import("hono/utils/http-status").ContentfulStatusCode; input: { param: { id: string; }; } & { json: { allowedIps?: readonly string[] | undefined; name?: string | undefined; orgId?: string | undefined; projectId?: string | undefined; }; }; }; }; }, "/", "/:id">; //# sourceMappingURL=api-keys.d.ts.map