/**
 * Admin API routes for generic webhook sources and trust management.
 *
 * Provides CRUD endpoints for managing generic webhook sources (create, list,
 * get, update, delete, enable, disable) and cross-repo trust relationships.
 *
 * All routes are protected by Bearer token authentication via the existing
 * admin auth middleware pattern from admin.ts.
 */
import { Hono } from 'hono';
import type pg from 'pg';
import type { GenericSourceManager } from '../webhook/generic-sources.js';
import type { TrustStore } from '../events/trust-store.js';
import type { TokenManager } from '../secrets/token-manager.js';
import type { RbacEnforcer, Role } from '../secrets/rbac.js';
import type { AppConfig } from '../config.js';
import type { ProviderRegistry } from '../provider-registry.js';
import type { SecretResolver } from '../secrets/secret-resolver.js';
/**
 * Dependencies for admin event routes.
 */
interface AdminEventRouteDeps {
    sourceManager: GenericSourceManager;
    trustStore: TrustStore;
    tokenManager: TokenManager;
    rbac: RbacEnforcer;
    /**
     * The in-process bundle registry. The POST /generic-sources handler
     * registers an internal / universal-git bundle into this registry
     * immediately after the source row lands in the DB, so the next
     * webhook against that source resolves the right normalizer without
     * waiting for an orchestrator restart.
     */
    providerRegistry: ProviderRegistry;
    /** Needed by `registerProviderBundleForSource` to gate internal-bundle
     *  registration on `canServeGenericProviderType` and read the
     *  `internalProviderRepoPath` / `internalProviderCloneUrl` config. */
    config: AppConfig;
    /** Required for universal-git source registration — `null` is allowed;
     *  rows with `git_config` are skipped + metric-bumped in that case. */
    secretResolver: SecretResolver | null;
    /**
     * Optional — when provided, the `POST /api/v1/admin/events/emit` route is
     * mounted so operators can INSERT into `kici_events` + `pg_notify` via HTTP.
     * Mirrors `emitKiciEventDirect` in `@kici-dev/shared` (direct-DB CLI mode).
     */
    pool?: pg.Pool;
}
/** Hono env type for admin event routes with context variables. */
type AdminEventEnv = {
    Variables: {
        role: Role;
        userId: string;
        routingKey: string | null;
    };
};
/**
 * Create admin API routes for generic webhook sources and trust management.
 *
 * @param deps - Admin event route dependencies
 * @returns Hono app with admin event routes mounted at /api/v1/admin/*
 */
export declare function createAdminEventRoutes(deps: AdminEventRouteDeps): Hono<AdminEventEnv>;
export {};
//# sourceMappingURL=admin-events.d.ts.map