import { OpenAPIHono } from '@hono/zod-openapi'; import type { DatabaseInput } from '../db/binding.js'; import { type HookfishEventHandler } from '../events.js'; import { type BrokerContext } from '../oauth/middleware.js'; import type { BoundProviderSource } from '../provider-source.js'; type ConnectionRouteOptions = { returnTo?: string; trustedOrigins?: readonly string[]; onEvent?: HookfishEventHandler; }; export declare function createConnectionRoutes(resolveProviders: (bindings: Bindings) => Promise, database: DatabaseInput, options: ConnectionRouteOptions): OpenAPIHono, { "/client-metadata.json": { $get: { input: {}; output: { client_id: string; client_name: string; redirect_uris: string[]; grant_types: string[]; response_types: string[]; token_endpoint_auth_method: string; }; outputFormat: "json"; status: 200; }; }; } & { "/providers": { $get: { input: {}; output: { providers: { id: string; label: string; authentication: "secret" | "oauth"; input_schema: { fields: { name: string; label: string; type: "text" | "url" | "string_list"; target: "scopes" | "configuration" | "identity"; required: boolean; placeholder?: string | undefined; description?: string | undefined; }[]; }; }[]; }; outputFormat: "json"; status: 200; } | { input: {}; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 400; } | { input: {}; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 401; } | { input: {}; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 403; } | { input: {}; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 404; } | { input: {}; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 409; } | { input: {}; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 500; } | { input: {}; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 502; }; }; } & { "/access/:connection_path{.+}": { $post: { input: { param: { connection_path: string; }; } & { json: { configuration?: Record | undefined; scopes?: string[] | undefined; return_to?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 400; } | { input: { param: { connection_path: string; }; } & { json: { configuration?: Record | undefined; scopes?: string[] | undefined; return_to?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 401; } | { input: { param: { connection_path: string; }; } & { json: { configuration?: Record | undefined; scopes?: string[] | undefined; return_to?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 403; } | { input: { param: { connection_path: string; }; } & { json: { configuration?: Record | undefined; scopes?: string[] | undefined; return_to?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 404; } | { input: { param: { connection_path: string; }; } & { json: { configuration?: Record | undefined; scopes?: string[] | undefined; return_to?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 409; } | { input: { param: { connection_path: string; }; } & { json: { configuration?: Record | undefined; scopes?: string[] | undefined; return_to?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 500; } | { input: { param: { connection_path: string; }; } & { json: { configuration?: Record | undefined; scopes?: string[] | undefined; return_to?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 502; } | { input: { param: { connection_path: string; }; } & { json: { configuration?: Record | undefined; scopes?: string[] | undefined; return_to?: string | undefined; }; }; output: { path: string; secret: string; scopes: string[]; expires_at: string | null; refreshed: boolean; }; outputFormat: "json"; status: 200; }; }; } & { "/authorize/:connection_path{.+}": { $post: { input: { param: { connection_path: string; }; } & { json: { configuration?: Record | undefined; scopes?: string[] | undefined; return_to?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 400; } | { input: { param: { connection_path: string; }; } & { json: { configuration?: Record | undefined; scopes?: string[] | undefined; return_to?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 401; } | { input: { param: { connection_path: string; }; } & { json: { configuration?: Record | undefined; scopes?: string[] | undefined; return_to?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 403; } | { input: { param: { connection_path: string; }; } & { json: { configuration?: Record | undefined; scopes?: string[] | undefined; return_to?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 404; } | { input: { param: { connection_path: string; }; } & { json: { configuration?: Record | undefined; scopes?: string[] | undefined; return_to?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 409; } | { input: { param: { connection_path: string; }; } & { json: { configuration?: Record | undefined; scopes?: string[] | undefined; return_to?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 500; } | { input: { param: { connection_path: string; }; } & { json: { configuration?: Record | undefined; scopes?: string[] | undefined; return_to?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 502; }; }; } & { "/secret/:connection_path{.+}": { $put: { input: { param: { connection_path: string; }; } & { json: { secret: string; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 400; } | { input: { param: { connection_path: string; }; } & { json: { secret: string; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 401; } | { input: { param: { connection_path: string; }; } & { json: { secret: string; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 403; } | { input: { param: { connection_path: string; }; } & { json: { secret: string; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 404; } | { input: { param: { connection_path: string; }; } & { json: { secret: string; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 409; } | { input: { param: { connection_path: string; }; } & { json: { secret: string; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 500; } | { input: { param: { connection_path: string; }; } & { json: { secret: string; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 502; } | { input: { param: { connection_path: string; }; } & { json: { secret: string; }; }; output: { path: string; stored: true; }; outputFormat: "json"; status: 200; }; }; } & { "/": { $get: { input: { query: { namespace?: string | undefined; provider_id?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 400; } | { input: { query: { namespace?: string | undefined; provider_id?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 401; } | { input: { query: { namespace?: string | undefined; provider_id?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 403; } | { input: { query: { namespace?: string | undefined; provider_id?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 404; } | { input: { query: { namespace?: string | undefined; provider_id?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 409; } | { input: { query: { namespace?: string | undefined; provider_id?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 500; } | { input: { query: { namespace?: string | undefined; provider_id?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 502; } | { input: { query: { namespace?: string | undefined; provider_id?: string | undefined; }; }; output: { connections: { path: string; namespace: string; provider_id: string; configuration: { [x: string]: import("hono/utils/types").JSONValue; }; scopes: string[]; expires_at: string | null; external_account_id: string | null; external_account_label: string | null; metadata: { [x: string]: import("hono/utils/types").JSONValue; }; created_at: string; updated_at: string; }[]; }; outputFormat: "json"; status: 200; }; }; } & { "/entry/:connection_path{.+}": { $get: { input: { param: { connection_path: string; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 400; } | { input: { param: { connection_path: string; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 401; } | { input: { param: { connection_path: string; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 403; } | { input: { param: { connection_path: string; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 404; } | { input: { param: { connection_path: string; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 409; } | { input: { param: { connection_path: string; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 500; } | { input: { param: { connection_path: string; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 502; } | { input: { param: { connection_path: string; }; }; output: { connection: { path: string; namespace: string; provider_id: string; configuration: { [x: string]: import("hono/utils/types").JSONValue; }; scopes: string[]; expires_at: string | null; external_account_id: string | null; external_account_label: string | null; metadata: { [x: string]: import("hono/utils/types").JSONValue; }; created_at: string; updated_at: string; }; }; outputFormat: "json"; status: 200; }; }; } & { "/entry/:connection_path{.+}": { $delete: { input: { param: { connection_path: string; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 400; } | { input: { param: { connection_path: string; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 401; } | { input: { param: { connection_path: string; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 403; } | { input: { param: { connection_path: string; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 404; } | { input: { param: { connection_path: string; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 409; } | { input: { param: { connection_path: string; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 500; } | { input: { param: { connection_path: string; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 502; } | { input: { param: { connection_path: string; }; }; output: { deleted: boolean; revocation: "revoked" | "unsupported"; }; outputFormat: "json"; status: 200; }; }; } & { "/callback/:provider_id": { $get: { input: { param: { provider_id: string; }; } & { query: { code?: string | undefined; state?: string | undefined; error?: string | undefined; error_description?: string | undefined; iss?: string | undefined; }; }; output: Response; outputFormat: "json"; status: import("hono/utils/http-status").StatusCode; } | { input: { param: { provider_id: string; }; } & { query: { code?: string | undefined; state?: string | undefined; error?: string | undefined; error_description?: string | undefined; iss?: string | undefined; }; }; output: {}; outputFormat: string; status: 302; } | { input: { param: { provider_id: string; }; } & { query: { code?: string | undefined; state?: string | undefined; error?: string | undefined; error_description?: string | undefined; iss?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 400; } | { input: { param: { provider_id: string; }; } & { query: { code?: string | undefined; state?: string | undefined; error?: string | undefined; error_description?: string | undefined; iss?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 401; } | { input: { param: { provider_id: string; }; } & { query: { code?: string | undefined; state?: string | undefined; error?: string | undefined; error_description?: string | undefined; iss?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 403; } | { input: { param: { provider_id: string; }; } & { query: { code?: string | undefined; state?: string | undefined; error?: string | undefined; error_description?: string | undefined; iss?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 404; } | { input: { param: { provider_id: string; }; } & { query: { code?: string | undefined; state?: string | undefined; error?: string | undefined; error_description?: string | undefined; iss?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 409; } | { input: { param: { provider_id: string; }; } & { query: { code?: string | undefined; state?: string | undefined; error?: string | undefined; error_description?: string | undefined; iss?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 500; } | { input: { param: { provider_id: string; }; } & { query: { code?: string | undefined; state?: string | undefined; error?: string | undefined; error_description?: string | undefined; iss?: string | undefined; }; }; output: { error: { [x: string]: import("hono/utils/types").JSONValue; code: string; message: string; authorize_url?: string | undefined; expires_at?: string | undefined; }; }; outputFormat: "json"; status: 502; }; }; }, "/">; export {}; //# sourceMappingURL=connections.d.ts.map