Team Ai
Apppublic

devin15/cursor2api-rust

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
constant.rs73 linesDownload Raw Back to app
1macro_rules! def_pub_const {2    ($name:ident, $value:expr) => {3        pub const $name: &'static str = $value;4    };5}6 7def_pub_const!(PKG_VERSION, env!("CARGO_PKG_VERSION"));8// def_pub_const!(PKG_NAME, env!("CARGO_PKG_NAME"));9// def_pub_const!(PKG_DESCRIPTION, env!("CARGO_PKG_DESCRIPTION"));10// def_pub_const!(PKG_AUTHORS, env!("CARGO_PKG_AUTHORS"));11// def_pub_const!(PKG_REPOSITORY, env!("CARGO_PKG_REPOSITORY"));12 13def_pub_const!(EMPTY_STRING, "");14 15def_pub_const!(ROUTE_ROOT_PATH, "/");16def_pub_const!(ROUTE_HEALTH_PATH, "/health");17def_pub_const!(ROUTE_GET_HASH, "/get-hash");18def_pub_const!(ROUTE_GET_CHECKSUM, "/get-checksum");19def_pub_const!(ROUTE_GET_TIMESTAMP_HEADER, "/get-tsheader");20def_pub_const!(ROUTE_USER_INFO_PATH, "/userinfo");21def_pub_const!(ROUTE_API_PATH, "/api");22def_pub_const!(ROUTE_LOGS_PATH, "/logs");23def_pub_const!(ROUTE_CONFIG_PATH, "/config");24def_pub_const!(ROUTE_TOKENINFO_PATH, "/tokeninfo");25def_pub_const!(ROUTE_GET_TOKENINFO_PATH, "/get-tokeninfo");26def_pub_const!(ROUTE_UPDATE_TOKENINFO_PATH, "/update-tokeninfo");27def_pub_const!(ROUTE_ENV_EXAMPLE_PATH, "/env-example");28def_pub_const!(ROUTE_STATIC_PATH, "/static/:path");29def_pub_const!(ROUTE_SHARED_STYLES_PATH, "/static/shared-styles.css");30def_pub_const!(ROUTE_SHARED_JS_PATH, "/static/shared.js");31def_pub_const!(ROUTE_ABOUT_PATH, "/about");32def_pub_const!(ROUTE_README_PATH, "/readme");33def_pub_const!(ROUTE_BASIC_CALIBRATION_PATH, "/basic-calibration");34 35def_pub_const!(DEFAULT_TOKEN_FILE_NAME, ".token");36def_pub_const!(DEFAULT_TOKEN_LIST_FILE_NAME, ".token-list");37 38def_pub_const!(STATUS_PENDING, "pending");39def_pub_const!(STATUS_SUCCESS, "success");40def_pub_const!(STATUS_FAILED, "failed");41 42def_pub_const!(HEADER_NAME_GHOST_MODE, "x-ghost-mode");43 44def_pub_const!(TRUE, "true");45def_pub_const!(FALSE, "false");46 47// def_pub_const!(CONTENT_TYPE_PROTO, "application/proto");48def_pub_const!(CONTENT_TYPE_CONNECT_PROTO, "application/connect+proto");49def_pub_const!(CONTENT_TYPE_TEXT_HTML_WITH_UTF8, "text/html;charset=utf-8");50def_pub_const!(CONTENT_TYPE_TEXT_PLAIN_WITH_UTF8, "text/plain;charset=utf-8");51def_pub_const!(CONTENT_TYPE_TEXT_CSS_WITH_UTF8, "text/css;charset=utf-8");52def_pub_const!(CONTENT_TYPE_TEXT_JS_WITH_UTF8, "text/javascript;charset=utf-8");53 54def_pub_const!(AUTHORIZATION_BEARER_PREFIX, "Bearer ");55 56def_pub_const!(CURSOR_API2_HOST, "api2.cursor.sh");57def_pub_const!(CURSOR_HOST, "www.cursor.com");58def_pub_const!(CURSOR_SETTINGS_URL, "https://www.cursor.com/settings");59 60def_pub_const!(OBJECT_CHAT_COMPLETION, "chat.completion");61def_pub_const!(OBJECT_CHAT_COMPLETION_CHUNK, "chat.completion.chunk");62 63// def_pub_const!(CURSOR_API2_STREAM_CHAT, "StreamChat");64// def_pub_const!(CURSOR_API2_GET_USER_INFO, "GetUserInfo");65 66def_pub_const!(FINISH_REASON_STOP, "stop");67 68def_pub_const!(ERR_UPDATE_CONFIG, "无法更新配置");69def_pub_const!(ERR_RESET_CONFIG, "无法重置配置");70def_pub_const!(ERR_INVALID_PATH, "无效的路径");71 72// def_pub_const!(ERR_CHECKSUM_NO_GOOD, "checksum no good");73