import { o as LiteralString } from "./helper-BBvhhJRX.mjs"; import { AuthContext, BetterAuthOptions } from "@better-auth/core"; import { DBFieldAttributeConfig, DBFieldType } from "@better-auth/core/db"; import * as better_call8 from "better-call"; import { OpenAPIParameter, OpenAPISchemaType } from "better-call"; //#region src/plugins/open-api/generator.d.ts interface Path { get?: { tags?: string[]; operationId?: string; description?: string; security?: [{ bearerAuth: string[]; }]; parameters?: OpenAPIParameter[]; responses?: { [key in string]: { description?: string; content: { "application/json": { schema: { type?: OpenAPISchemaType; properties?: Record; required?: string[]; $ref?: string; }; }; }; } }; } | undefined; post?: { tags?: string[]; operationId?: string; description?: string; security?: [{ bearerAuth: string[]; }]; parameters?: OpenAPIParameter[]; requestBody?: { content: { "application/json": { schema: { type?: OpenAPISchemaType; properties?: Record; required?: string[]; $ref?: string; }; }; }; }; responses?: { [key in string]: { description?: string; content: { "application/json": { schema: { type?: OpenAPISchemaType; properties?: Record; required?: string[]; $ref?: string; }; }; }; } }; } | undefined; } type FieldSchema = { type: DBFieldType; default?: (DBFieldAttributeConfig["defaultValue"] | "Generated at runtime") | undefined; readOnly?: boolean | undefined; format?: string; }; type OpenAPIModelSchema = { type: "object"; properties: Record; required?: string[] | undefined; }; declare function generator(ctx: AuthContext, options: BetterAuthOptions): Promise<{ openapi: string; info: { title: string; description: string; version: string; }; components: { securitySchemes: { apiKeyCookie: { type: string; in: string; name: string; description: string; }; bearerAuth: { type: string; scheme: string; description: string; }; }; schemas: { [x: string]: OpenAPIModelSchema; }; }; security: { apiKeyCookie: never[]; bearerAuth: never[]; }[]; servers: { url: string; }[]; tags: { name: string; description: string; }[]; paths: Record; }>; //#endregion //#region src/plugins/open-api/index.d.ts type ScalarTheme = "alternate" | "default" | "moon" | "purple" | "solarized" | "bluePlanet" | "saturn" | "kepler" | "mars" | "deepSpace" | "laserwave" | "none"; interface OpenAPIOptions { /** * The path to the OpenAPI reference page * * keep in mind that this path will be appended to the base URL `/api/auth` path * by default, so if you set this to `/reference`, the full path will be `/api/auth/reference` * * @default "/reference" */ path?: LiteralString | undefined; /** * Disable the default reference page that is generated by Scalar * * @default false */ disableDefaultReference?: boolean | undefined; /** * Theme of the OpenAPI reference page. * * @default "default" */ theme?: ScalarTheme | undefined; /** * A 'nonce' string to be attached to inline scripts * for Content Security Policy (CSP) compliance. * @default undefined */ nonce?: string | undefined; } declare const openAPI: (options?: O | undefined) => { id: "open-api"; endpoints: { generateOpenAPISchema: better_call8.StrictEndpoint<"/open-api/generate-schema", { method: "GET"; } & { use: any[]; }, { openapi: string; info: { title: string; description: string; version: string; }; components: { securitySchemes: { apiKeyCookie: { type: string; in: string; name: string; description: string; }; bearerAuth: { type: string; scheme: string; description: string; }; }; schemas: { [x: string]: OpenAPIModelSchema; }; }; security: { apiKeyCookie: never[]; bearerAuth: never[]; }[]; servers: { url: string; }[]; tags: { name: string; description: string; }[]; paths: Record; }>; openAPIReference: better_call8.StrictEndpoint<"/reference", { method: "GET"; metadata: { isAction: false; }; } & { use: any[]; }, Response>; }; }; //#endregion export { Path as a, OpenAPIModelSchema as i, openAPI as n, generator as o, FieldSchema as r, OpenAPIOptions as t };