"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.applicationsRouter = void 0;
const express_1 = require("express");
const permissions_1 = require("../../util/config/permissions");
const create_application_1 = require("../controller/application/create-application");
const delete_application_1 = require("../controller/application/delete-application");
const archive_application_1 = require("../controller/application/archive-application");
const get_application_details_1 = require("../controller/application/get-application-details");
const get_application_list_1 = require("../controller/application/get-application-list");
const get_application_list_with_monitoring_1 = require("../controller/application/get-application-list-with-monitoring");
const get_application_monitoring_details_1 = require("../controller/application/get-application-monitoring-details");
const get_application_test_runs_details_1 = require("../controller/application/get-application-test-runs-details");
const get_applications_count_1 = require("../controller/application/get-applications-count");
const get_project_applications_count_1 = require("../controller/application/get-project-applications-count");
const update_application_1 = require("../controller/application/update-application");
const permission_1 = require("../middlewares/permission");
const get_application_list_with_true_guard_1 = require("../controller/application/get-application-list-with-true-guard");
const validate_custom_ai_bundle_1 = require("../controller/application/validate-custom-ai-bundle");
const validate_custom_ai_stored_bundle_1 = require("../controller/application/validate-custom-ai-stored-bundle");
const upload_custom_ai_bundle_1 = require("../controller/application/upload-custom-ai-bundle");
const update_custom_ai_settings_1 = require("../controller/application/update-custom-ai-settings");
const get_custom_ai_context_1 = require("../controller/application/get-custom-ai-context");
const customAIApplicationUpload_1 = require("../middlewares/customAIApplicationUpload");
const router = (0, express_1.Router)();
router.get('/', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_READ), get_application_list_1.getApplicationList);
router.get('/count', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_READ), get_applications_count_1.getApplicationsCount);
router.get('/project/:projectId/count', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_READ), get_project_applications_count_1.getProjectApplicationsCount);
router.get('/details', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_READ), get_application_details_1.getApplicationDetails);
router.get('/test-runs', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_READ), get_application_test_runs_details_1.getApplicationTestRunsDetails);
router.get('/monitoring', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_READ), get_application_monitoring_details_1.getApplicationMonitoringDetails);
router.get('/guardrails', 
/* hasPermission(Permission.APPLICATION_READ), */
get_application_list_with_true_guard_1.getApplicationListWithTrueGuard);
router.get('/with-monitoring', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_READ), get_application_list_with_monitoring_1.getApplicationListWithMonitoring);
router.post('/', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_WRITE), create_application_1.createApplication);
router.post('/custom-ai/validate', customAIApplicationUpload_1.customAIApplicationUploadMiddleware, (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_WRITE), validate_custom_ai_bundle_1.validateCustomAIBundle);
router.post('/:applicationId/custom-ai/validate-stored', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_WRITE), validate_custom_ai_stored_bundle_1.validateCustomAIStoredBundle);
router.post('/:applicationId/custom-ai-bundle', customAIApplicationUpload_1.customAIApplicationUploadMiddleware, (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_WRITE), upload_custom_ai_bundle_1.uploadCustomAIBundle);
router.get('/:applicationId/custom-ai-context', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_READ), get_custom_ai_context_1.getCustomAIContext);
router.patch('/:applicationId/custom-ai-settings', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_WRITE), update_custom_ai_settings_1.updateCustomAISettings);
router.patch('/:applicationId', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_WRITE), update_application_1.updateApplication);
router.patch('/:applicationId/archive', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_WRITE), archive_application_1.archiveApplication);
router.delete('/:applicationId', (0, permission_1.hasPermission)(permissions_1.Permission.APPLICATION_WRITE), delete_application_1.deleteApplication);
exports.applicationsRouter = router;
//# sourceMappingURL=application.js.map