"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.init = void 0;
const express_1 = __importDefault(require("express"));
const app_1 = require("./app");
const config_1 = require("./config");
const VersionResource = __importStar(require("./resources/versionResource"));
const StatisticsResource = __importStar(require("./resources/statisticsResource"));
const FrontendResource = __importStar(require("./resources/frontendResource"));
const NodeResource = __importStar(require("./resources/nodeResource"));
const MonitoringResource = __importStar(require("./resources/monitoringResource"));
const TaskResource = __importStar(require("./resources/taskResource"));
const MailResource = __importStar(require("./resources/mailResource"));
function init() {
    const router = express_1.default.Router();
    router.post('/', FrontendResource.render);
    router.get('/api/version', VersionResource.get);
    router.post('/api/node', NodeResource.create);
    router.put('/api/node/:token', NodeResource.update);
    router.delete('/api/node/:token', NodeResource.remove);
    router.get('/api/node/:token', NodeResource.get);
    router.put('/api/monitoring/confirm/:token', MonitoringResource.confirm);
    router.put('/api/monitoring/disable/:token', MonitoringResource.disable);
    router.get('/internal/api/statistics', StatisticsResource.get);
    router.get('/internal/api/tasks', TaskResource.getAll);
    router.put('/internal/api/tasks/run/:id', TaskResource.run);
    router.put('/internal/api/tasks/enable/:id', TaskResource.enable);
    router.put('/internal/api/tasks/disable/:id', TaskResource.disable);
    router.get('/internal/api/monitoring', MonitoringResource.getAll);
    router.get('/internal/api/mails', MailResource.getAll);
    router.get('/internal/api/mails/:id', MailResource.get);
    router.delete('/internal/api/mails/:id', MailResource.remove);
    router.put('/internal/api/mails/reset/:id', MailResource.resetFailures);
    router.put('/internal/api/nodes/:token', NodeResource.update);
    router.delete('/internal/api/nodes/:token', NodeResource.remove);
    router.get('/internal/api/nodes', NodeResource.getAll);
    router.get('/internal/api/nodes/:token', NodeResource.get);
    app_1.app.use(config_1.config.server.rootPath, router);
}
exports.init = init;
//# sourceMappingURL=router.js.map