import { a as parseQuery, c as handleError, i as parseBody, n as ParseResult, o as apiError, r as isParseError, s as apiSuccess, t as OptionsRepository } from "../options-B5K8QEV1.mjs"; import { t as Database } from "../types-BCOU_CXE.mjs"; import { Ht as StorageCollection, Ut as StorageCollectionConfig } from "../types-XJPFqvc1.mjs"; import { Kysely } from "kysely"; //#region src/api/setup-complete.d.ts /** * Finalize setup after the first admin user is created. * * Reads the setup_state option (written by the setup wizard's step 1), * persists site_title and site_tagline, then marks setup complete. * * Safe to call multiple times — checks setup_complete first and no-ops * if already done. */ declare function finalizeSetup(db: Kysely): Promise; //#endregion //#region src/api/auth-storage.d.ts /** * Get storage collections for an auth provider. * * Returns a record of `StorageCollection` instances, one per declared * collection in the provider's `storage` config. Data is stored in the * shared `_plugin_storage` table under the namespace `auth:`. * * @example * ```ts * const storage = getAuthProviderStorage(emdash.db, "atproto", { * states: { indexes: [] }, * sessions: { indexes: [] }, * }); * const session = await storage.sessions.get(sessionId); * ``` */ declare function getAuthProviderStorage(db: Kysely, providerId: string, storageConfig: Record): Record; //#endregion //#region src/api/public-url.d.ts /** * Public URL helpers for reverse-proxy deployments. * * Behind a TLS-terminating proxy the internal request URL * (`http://localhost:4321`) differs from the browser-facing origin * (`https://mysite.example.com`). These pure helpers resolve the * correct public origin from config, falling back to the request URL. * * Workers-safe: no Node.js imports. */ /** Minimal config shape — avoids importing the full EmDashConfig type tree. */ interface SiteUrlConfig { siteUrl?: string; } /** * Return the public-facing origin for the site. * * Resolution order: * 1. `config.siteUrl` (set in astro.config.mjs, origin-normalized at startup) * 2. `EMDASH_SITE_URL` or `SITE_URL` env var (resolved at runtime for containers) * 3. `url.origin` (internal request URL — correct when no proxy) * * @param url The request URL (`new URL(request.url)` or `Astro.url`) * @param config The EmDash config (from `locals.emdash?.config`) * @returns Origin string, e.g. `"https://mysite.example.com"` */ declare function getPublicOrigin(url: URL, config?: SiteUrlConfig): string; //#endregion export { OptionsRepository, type ParseResult, apiError, apiSuccess, finalizeSetup, getAuthProviderStorage, getPublicOrigin, handleError, isParseError, parseBody, parseQuery }; //# sourceMappingURL=route-utils.d.mts.map