"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.guardrailsRouter = void 0;
const express_1 = require("express");
const guardrails_1 = require("../controller/guardrails");
const permission_1 = require("../middlewares/permission");
const permissions_1 = require("../../util/config/permissions");
const router = (0, express_1.Router)();
router.post('/batch', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_READ), guardrails_1.GuardrailsController.batch);
router.get('/application-config', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_READ), guardrails_1.GuardrailsController.getApplicationGaurdRailConfig);
router.post('/save-results', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_WRITE), guardrails_1.GuardrailsController.saveResults);
router.get('/results', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_READ), guardrails_1.GuardrailsController.fetchResults);
router.get('/dashboard/total-requests', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_READ), guardrails_1.GuardrailsController.getTotalRequestsMetrics);
router.get('/dashboard/latency', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_READ), guardrails_1.GuardrailsController.getLatencyMetrics);
router.get('/dashboard/latency-histogram', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_READ), guardrails_1.GuardrailsController.getLatencyHistogramMetrics);
router.get('/dashboard/analysis', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_READ), guardrails_1.GuardrailsController.getAnalysisMetrics);
router.get('/dashboard/metrics', guardrails_1.GuardrailsController.getDashboardMetrics);
router.get('/dashboard/request-summary', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_READ), guardrails_1.GuardrailsController.getRequestSummaryMetrics);
router.get('/dashboard/latency-by-validator', 
/*  hasPermission(Permission.APPLICATION_READ), */
guardrails_1.GuardrailsController.getLatencyByValidatorMetrics);
router.get('/dashboard/validation-failures', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_READ), guardrails_1.GuardrailsController.getValidationFailures);
router.get('/dashboard/validation-failure-details', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_READ), guardrails_1.GuardrailsController.getValidationFailureDetails);
router.post('/dashboard/download/validation-failures', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_READ), guardrails_1.GuardrailsController.downloadValidationFailuresCSV);
exports.guardrailsRouter = router;
//# sourceMappingURL=guardrails.js.map