"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const express_1 = require("express");
const auth_1 = require("../modules/auth");
const auth_2 = __importDefault(require("./auth"));
const oauth_1 = __importDefault(require("./oauth"));
const delegation_1 = __importDefault(require("./delegation"));
const tasks_1 = __importDefault(require("./tasks"));
const escalations_1 = __importDefault(require("./escalations"));
const workflows_1 = __importDefault(require("./workflows"));
const exports_1 = __importDefault(require("./exports"));
const users_1 = __importDefault(require("./users"));
const roles_1 = __importDefault(require("./roles"));
const dba_1 = __importDefault(require("./dba"));
const maintenance_1 = __importDefault(require("./maintenance"));
const mcp_1 = __importDefault(require("./mcp"));
const insight_1 = __importDefault(require("./insight"));
const yaml_workflows_1 = __importDefault(require("./yaml-workflows"));
const settings_1 = __importDefault(require("./settings"));
const pipelines_1 = __importDefault(require("./pipelines"));
const namespaces_1 = __importDefault(require("./namespaces"));
const files_1 = __importDefault(require("./files"));
const file_browser_1 = __importDefault(require("./file-browser"));
const controlplane_1 = __importDefault(require("./controlplane"));
const bot_accounts_1 = __importDefault(require("./bot-accounts"));
const docs_1 = __importDefault(require("./docs"));
const workflow_sets_1 = __importDefault(require("./workflow-sets"));
const knowledge_1 = __importDefault(require("./knowledge"));
const agents_1 = __importDefault(require("./agents"));
const capabilities_1 = __importDefault(require("./capabilities"));
const topics_1 = __importDefault(require("./topics"));
const nats_credentials_1 = __importDefault(require("./nats-credentials"));
const router = (0, express_1.Router)();
// Public routes (no auth required — they handle their own auth)
router.use('/auth', auth_2.default);
router.use('/auth/oauth', oauth_1.default);
router.use('/delegation', delegation_1.default);
router.use('/files', files_1.default);
router.use('/settings', settings_1.default);
// Apply auth to all API routes
router.use(auth_1.requireAuth);
router.use('/nats-credentials', nats_credentials_1.default);
router.use('/tasks', tasks_1.default);
router.use('/escalations', escalations_1.default);
router.use('/workflows', workflows_1.default);
router.use('/workflow-states', exports_1.default);
router.use('/config/maintenance', maintenance_1.default);
router.use('/users', users_1.default);
router.use('/roles', roles_1.default);
router.use('/dba', dba_1.default);
router.use('/mcp', mcp_1.default);
router.use('/insight', insight_1.default);
router.use('/yaml-workflows', yaml_workflows_1.default);
router.use('/pipelines', pipelines_1.default);
router.use('/mcp-runs', pipelines_1.default); // backward-compat alias
router.use('/namespaces', namespaces_1.default);
router.use('/file-browser', file_browser_1.default);
router.use('/controlplane', controlplane_1.default);
router.use('/bot-accounts', bot_accounts_1.default);
router.use('/docs', docs_1.default);
router.use('/workflow-sets', workflow_sets_1.default);
router.use('/knowledge', knowledge_1.default);
router.use('/agents', agents_1.default);
router.use('/capabilities', capabilities_1.default);
router.use('/topics', topics_1.default);
exports.default = router;
