"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const expresskit_1 = require("@gravity-ui/expresskit");
const cluster_params_1 = require("./controllers/cluster-params");
const yt_api_1 = require("./controllers/yt-api");
const remote_copy_1 = require("./controllers/remote-copy");
const yt_proxy_api_1 = require("./controllers/yt-proxy-api");
const settings_1 = require("./controllers/settings");
const home_1 = require("./controllers/home");
const cluster_info_1 = require("./controllers/cluster-info");
const clusters_1 = require("./controllers/clusters");
const table_column_preset_1 = require("./controllers/table-column-preset");
const ping_1 = require("./controllers/ping");
const login_1 = require("./controllers/login");
const scheduling_pools_1 = require("./controllers/scheduling-pools");
const markdown_to_html_1 = require("./controllers/markdown-to-html");
const odin_proxy_api_1 = require("./controllers/odin-proxy-api");
const availability_1 = require("./controllers/availability");
const strawberry_api_1 = require("./controllers/strawberry-api");
const oauth_login_1 = require("./controllers/oauth-login");
const logout_1 = require("./controllers/logout");
const vcs_1 = require("./controllers/vcs");
const yt_tablet_errors_api_1 = require("./controllers/yt-tablet-errors-api");
const ai_chat_1 = require("./controllers/ai-chat");
const prometheus_view_range_1 = require("./controllers/prometheus/prometheus-view-range");
const prometheus_discover_values_1 = require("./controllers/prometheus/prometheus-discover-values");
const yt_access_log_api_1 = require("./controllers/yt-access-log-api");
const yt_accounts_usage_1 = require("./controllers/yt-accounts-usage");
const HOME_INDEX_TARGET = { handler: (0, home_1.homeIndexFactory)(), ui: true };
const routes = {
    'GET /:ytAuthCluster/change-password/': HOME_INDEX_TARGET,
    'GET /': HOME_INDEX_TARGET,
    'GET /ping': { handler: ping_1.ping, authPolicy: expresskit_1.AuthPolicy.disabled },
    'GET /api/cluster-info/:ytAuthCluster': { handler: cluster_info_1.handleClusterInfo },
    'GET /api/cluster-params/:ytAuthCluster': { handler: cluster_params_1.clusterParams },
    'GET /api/clusters/versions': { handler: clusters_1.clusterVersions },
    'GET /api/clusters/auth-status': { handler: clusters_1.clusterAuthStatus },
    'GET /api/pool-names/:ytAuthCluster': { handler: scheduling_pools_1.getClusterPools },
    'POST /api/yt/:ytAuthCluster/login': { handler: login_1.handleLogin, ui: true },
    'GET /api/yt/logout': { handler: logout_1.handleLogout, ui: true },
    'GET /oauth/login': { handler: oauth_login_1.oauthLogin, ui: true },
    'GET /api/oauth/callback': { handler: oauth_login_1.oauthCallback, ui: true },
    'GET /api/oauth/logout/callback': { handler: oauth_login_1.oauthLogout, ui: true },
    'POST /api/vcs/token': { handler: vcs_1.createToken },
    'DELETE /api/vcs/token': { handler: vcs_1.removeToken },
    'GET /api/vcs': { handler: vcs_1.getDirectoryContent },
    'GET /api/vcs/file': { handler: vcs_1.getFileContent },
    'GET /api/vcs/repositories': { handler: vcs_1.getRepositories },
    'GET /api/vcs/branches': { handler: vcs_1.getBranches },
    'GET /api/vcs/tokens-availability': { handler: vcs_1.getVcsTokensAvailability },
    'POST /api/yt/:ytAuthCluster/change-password': { handler: login_1.handleChangePassword, ui: true },
    'POST /api/remote-copy': { handler: remote_copy_1.handleRemoteCopy },
    'POST /api/markdown-to-html': { handler: markdown_to_html_1.markdownToHtmlHandler },
    'GET  /api/yt/:ytAuthCluster/api/:version/:command': { handler: yt_api_1.ytTvmApiHandler },
    'POST /api/yt/:ytAuthCluster/api/:version/:command': { handler: yt_api_1.ytTvmApiHandler },
    'PUT  /api/yt/:ytAuthCluster/api/:version/:command': { handler: yt_api_1.ytTvmApiHandler },
    'GET /api/yt-proxy/:ytAuthCluster/:command': { handler: yt_proxy_api_1.ytProxyApi },
    'GET /api/odin/proxy/:action/:ytAuthCluster?': { handler: odin_proxy_api_1.odinProxyApi },
    'GET /api/odin/clusters/availability': { handler: availability_1.getClustersAvailability },
    'POST /api/strawberry/:engine/:ytAuthCluster/:action': { handler: strawberry_api_1.strawberryProxyApi },
    'GET    /api/settings/:ytAuthCluster/:username': { handler: settings_1.settingsGet },
    'POST   /api/settings/:ytAuthCluster/:username': { handler: settings_1.settingsCreate },
    'GET    /api/settings/:ytAuthCluster/:username/:path': { handler: settings_1.settingsGetItem },
    'PUT    /api/settings/:ytAuthCluster/:username/:path': { handler: settings_1.settingsSetItem },
    'DELETE /api/settings/:ytAuthCluster/:username/:path': { handler: settings_1.settingsDeleteItem },
    'POST /api/:ytAuthCluster/prometheus/chart-data': { handler: prometheus_view_range_1.prometheusQueryRange },
    'POST /api/:ytAuthCluster/prometheus/discover-values': { handler: prometheus_discover_values_1.prometheusDiscoverValues },
    'GET  /api/table-column-preset/:ytAuthCluster/:hash': {
        handler: table_column_preset_1.tableColumnPresetGet,
    },
    'POST /api/table-column-preset/:ytAuthCluster': { handler: table_column_preset_1.tableColumnPresetSave },
    'POST /api/tablet-errors/:ytAuthCluster/:action': { handler: yt_tablet_errors_api_1.ytTabletErrorsApi },
    'POST /api/code-assistant/create-conversation': { handler: ai_chat_1.createConversation },
    'POST /api/code-assistant/send-message': { handler: ai_chat_1.sendMessage },
    'GET /api/code-assistant/conversations': { handler: ai_chat_1.getConversations },
    'GET /api/code-assistant/conversations/:conversationId/items': { handler: ai_chat_1.getConversationItems },
    'DELETE /api/code-assistant/conversations/:conversationId': { handler: ai_chat_1.deleteConversation },
    'POST /api/code-assistant/conversations/:conversationId/summarize-title': {
        handler: ai_chat_1.summarizeConversationTitle,
    },
    'GET /api/access-log/:ytAuthCluster/check-available': { handler: yt_access_log_api_1.ytAccesLogCheckAvailable },
    'GET /api/access-log/:ytAuthCluster/:action': { handler: yt_access_log_api_1.ytAccessLogApi },
    'POST /api/access-log/:ytAuthCluster/:action': { handler: yt_access_log_api_1.ytAccessLogApi },
    'GET /api/accounts-usage/:ytAuthCluster/check-available': {
        handler: yt_accounts_usage_1.ytAccountsUsageCheckAvailable,
    },
    'POST /api/accounts-usage/:ytAuthCluster/:action': { handler: yt_accounts_usage_1.ytAccountsUsageApi },
    'GET /:ytAuthCluster/': HOME_INDEX_TARGET,
    'GET /:ytAuthCluster/:page': HOME_INDEX_TARGET,
    'GET /:ytAuthCluster/:page/:tab': HOME_INDEX_TARGET,
    'GET /:ytAuthCluster/:page/:operation/:tab': HOME_INDEX_TARGET,
    'GET /:ytAuthCluster/:page/:operation/:job/:tab': HOME_INDEX_TARGET,
    'GET /:ytAuthCluster/:page/:computations/:computation/:partition/:id': HOME_INDEX_TARGET,
};
exports.default = routes;
