"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const express_1 = require("express");
const permissions_1 = require("../../util/config/permissions");
const compare_test_runs_1 = require("../controller/test-run/compare-test-runs");
const create_custom_provider_test_run_1 = require("../controller/test-run/create-custom-provider-test-run");
const create_test_run_1 = require("../controller/test-run/create-test-run");
const get_comparable_test_runs_1 = require("../controller/test-run/get-comparable-test-runs");
const get_result_details_1 = require("../controller/test-run/get-result-details");
const get_result_list_1 = require("../controller/test-run/get-result-list");
const get_test_run_dataset_records_1 = require("../controller/test-run/get-test-run-dataset-records");
const get_result_summary_1 = require("../controller/test-run/get-result-summary");
const get_security_config_names_1 = require("../controller/test-run/get-security-config-names");
const get_test_run_metric_analysis_1 = require("../controller/test-run/get-test-run-metric-analysis");
const get_test_run_audio_metric_analysis_1 = require("../controller/test-run/get-test-run-audio-metric-analysis");
const get_test_run_audio_metric_time_analysis_1 = require("../controller/test-run/get-test-run-audio-metric-time-analysis");
const update_shareable_report_1 = require("../controller/test-run/update-shareable-report");
const permission_1 = require("../middlewares/permission");
const testRunsRouter = (0, express_1.Router)();
testRunsRouter.get('/', (0, permission_1.hasPermission)(permissions_1.Permission.TEST_RUN_READ), get_result_summary_1.getTestRunSummary);
testRunsRouter.post('/', (0, permission_1.hasPermission)(permissions_1.Permission.TEST_RUN_WRITE), create_test_run_1.createTestRun);
testRunsRouter.post('/generateTestSuite', (0, permission_1.hasPermission)(permissions_1.Permission.TEST_RUN_WRITE), create_test_run_1.generateTestSuite);
// GET /list: optional `applicationIds` (comma-separated UUIDs) and legacy `applicationId` filter functional eval runs by application overlap.
testRunsRouter.get('/list', (0, permission_1.hasPermission)(permissions_1.Permission.TEST_RUN_READ), get_result_list_1.getTestRunList);
testRunsRouter.get('/security-config-names', (0, permission_1.hasPermission)(permissions_1.Permission.TEST_RUN_READ), get_security_config_names_1.getSecurityConfigNames);
testRunsRouter.get('/compare', (0, permission_1.hasPermission)(permissions_1.Permission.TEST_RUN_READ), compare_test_runs_1.compareTestRuns);
testRunsRouter.post('/custom-provider', (0, permission_1.hasPermission)(permissions_1.Permission.TEST_RUN_WRITE), create_custom_provider_test_run_1.createCustomProviderTestRun);
testRunsRouter.get('/:resultId', (0, permission_1.hasPermission)(permissions_1.Permission.TEST_RUN_READ), get_result_details_1.getTestRunDetails);
testRunsRouter.get('/write/:resultId', (0, permission_1.hasPermission)(permissions_1.Permission.TEST_RUN_READ), get_result_details_1.writeTestRunTable);
testRunsRouter.get('/:resultId/table', (0, permission_1.hasPermission)(permissions_1.Permission.TEST_RUN_READ), get_result_details_1.getTestRunTable);
testRunsRouter.get('/:resultId/comparable', (0, permission_1.hasPermission)(permissions_1.Permission.TEST_RUN_READ), get_comparable_test_runs_1.getComparableTestRuns);
testRunsRouter.get('/:testRunId/metrics/total', (0, permission_1.hasPermission)(permissions_1.Permission.TEST_RUN_READ), get_test_run_metric_analysis_1.getTestRunMetricAnalysisTotal);
testRunsRouter.get('/:testRunId/metrics/pass', (0, permission_1.hasPermission)(permissions_1.Permission.TEST_RUN_READ), get_test_run_metric_analysis_1.getTestRunMetricAnalysisPass);
testRunsRouter.get('/:testRunId/metrics/fail', (0, permission_1.hasPermission)(permissions_1.Permission.TEST_RUN_READ), get_test_run_metric_analysis_1.getTestRunMetricAnalysisFail);
testRunsRouter.patch('/:testRunId/shareable-report', (0, permission_1.hasPermission)(permissions_1.Permission.TEST_RUN_WRITE), update_shareable_report_1.updateShareableReport);
testRunsRouter.get('/:testRunId/audio-metrics/call-outcome-analysis/:metricName', (0, permission_1.hasPermission)(permissions_1.Permission.TEST_RUN_READ), get_test_run_audio_metric_analysis_1.getTestRunAudioMetricAnalysis);
testRunsRouter.get('/:testRunId/audio-metrics/avg-response-time/:metricName', (0, permission_1.hasPermission)(permissions_1.Permission.TEST_RUN_READ), get_test_run_audio_metric_time_analysis_1.getTestRunAudioMetricTimeAnalysis);
testRunsRouter.get('/:testRunId/dataset-records', (0, permission_1.hasPermission)(permissions_1.Permission.TEST_RUN_READ), get_test_run_dataset_records_1.getTestRunDatasetRecords);
exports.default = testRunsRouter;
//# sourceMappingURL=testRuns.js.map