import { Auth, AuthDescription, AuthError, AuthEvent, AuthIdentity, AuthUser, CreateAuthUserInput, ParseWebhookInput, ResolveTokenInput, WebhookDashboardInfo } from "@theholocron/cli"; import { ClerkClient, ClerkClientOptions, createClerkClient } from "@theholocron/clerk-client"; //#region src/auth.d.ts declare const resolveToken: (input?: ResolveTokenInput) => string; //#endregion //#region src/capabilities/auth.d.ts type ClerkAuthOptions = Record; declare class ClerkAuth implements Auth { private readonly client; readonly key: "auth"; readonly providerName = "clerk"; constructor(client: () => ClerkClient, _opts?: ClerkAuthOptions); describe(): Promise; whoami(): Promise; ensureWebhookApp(): Promise<{ alreadyExists: boolean; }>; getWebhookDashboardUrl(): Promise; createUser(input: CreateAuthUserInput): Promise; } //#endregion //#region src/parse-webhook.d.ts declare function parseWebhook(input: ParseWebhookInput): Promise; //#endregion //#region src/verify-token.d.ts /** * `verifyToken` — plugin-level export used by `holocron auth set` + * `holocron auth check`. Hits Clerk's `/v1/instance` endpoint, which * requires a valid secret key and returns instance metadata (id, * environment_type, etc.). Invalid keys → 401. * * Clerk doesn't have a traditional user-oriented whoami — the "authed * entity" is your Clerk INSTANCE, not a user. `/v1/instance` is the * canonical "is this secret key valid?" endpoint. */ interface VerifyTokenSuccess { ok: true; subject: string; } interface VerifyTokenFailure { ok: false; message: string; } type VerifyTokenResult = VerifyTokenSuccess | VerifyTokenFailure; interface VerifyTokenOptions { baseUrl?: string; fetch?: typeof fetch; } declare function verifyToken(token: string, opts?: VerifyTokenOptions): Promise; //#endregion //#region src/index.d.ts interface ClerkPluginOptions extends ResolveTokenInput { /** Override base URL for tests. */ baseUrl?: string; /** Override `fetch` for tests. */ fetch?: typeof fetch; } interface PluginContext { options: ClerkPluginOptions; client: () => ClerkClient; } declare function createContext(options?: ClerkPluginOptions): PluginContext; declare function auth(ctx: PluginContext): Auth; declare function createPlugin(options?: ClerkPluginOptions): { name: string; capabilities: { auth: () => Auth; }; }; /** * One-line hint printed by `holocron auth set clerk` when no token * is supplied or the supplied token is rejected. Points operators at * the Clerk dashboard's API Keys section — MUST be the SECRET key * (sk_test_* / sk_live_*), not the publishable key. */ declare const AUTH_HINT: string; //#endregion export { AUTH_HINT, AuthError, ClerkAuth, type ClerkClientOptions, ClerkPluginOptions, PluginContext, type ResolveTokenInput, type VerifyTokenFailure, type VerifyTokenResult, type VerifyTokenSuccess, auth, createClerkClient, createContext, createPlugin, parseWebhook, resolveToken, verifyToken };