/**
 * @module        console/routes/audit
 * @description   项目审计日志 REST —— 查询项目创建/修改/删除记录。
 * @layer         console
 */
import { Hono } from 'hono';
import { readAudit } from '../../core/auditLog.js';
export function createAuditRoute() {
    const app = new Hono();
    app.get('/', (c) => {
        const limitRaw = c.req.query('limit');
        const limit = limitRaw ? Number(limitRaw) : 500;
        const project = c.req.query('project') || undefined;
        const actionRaw = c.req.query('action');
        const action = actionRaw === 'create' || actionRaw === 'modify' || actionRaw === 'delete' ? actionRaw : undefined;
        return c.json({ data: readAudit({ limit, project, action }) });
    });
    return app;
}
//# sourceMappingURL=audit.js.map