MCPcopy Create free account

hub / github.com/Rfym21/Qwen2API / functions

Functions346 in github.com/Rfym21/Qwen2API

↓ 1 callersMethodformatMessage
* 格式化日志消息 * @param {string} level - 日志级别 * @param {string} message - 日志消息 * @param {string} module - 模块名 * @param {string} emoji - Emoji标签
src/utils/logger.js:131
↓ 1 callersFunctionformatSingleMessage
(message)
src/utils/chat-helpers.js:275
↓ 1 callersMethodformatTimestamp
* 格式化时间戳 * @returns {string}
src/utils/logger.js:111
↓ 1 callersFunctiongenerateBatchTaskId
()
src/routes/accounts.js:24
↓ 1 callersFunctiongenerateCodeChallenge
* 使用 SHA-256 从代码验证器生成代码挑战 * @param {string} codeVerifier - 代码验证器字符串 * @returns {string} 代码挑战字符串
src/utils/cli.manager.js:18
↓ 1 callersFunctiongenerateCodeVerifier
* 为 PKCE 生成随机代码验证器 * @returns {string} 43-128个字符的随机字符串
src/utils/cli.manager.js:9
↓ 1 callersFunctiongenerateDeviceId
()
src/utils/cookie-generator.js:268
↓ 1 callersFunctiongeneratePKCEPair
* 生成 PKCE 代码验证器和挑战对 * @returns {Object} 包含 code_verifier 和 code_challenge 的对象
src/utils/cli.manager.js:28
↓ 1 callersMethodgetAccountByEmail
* 根据邮箱获取账户对象 * @param {string} email - 邮箱地址 * @returns {Object|null} 账户对象或 null
src/utils/account-rotator.js:74
↓ 1 callersFunctiongetAccountCliState
(account, rotatorRecord = {}, now = Date.now())
src/utils/cli-support.js:3
↓ 1 callersMethodgetCache
(signature)
src/utils/img-caches.js:49
↓ 1 callersFunctiongetCliBaseUrl
()
src/utils/proxy-helper.js:92
↓ 1 callersFunctiongetDefaultModelByChatType
(chatType)
src/models/models-map.js:94
↓ 1 callersMethodgetHealthStats
* 获取账户健康状态统计 * @returns {Object} 健康状态统计
src/utils/account.js:671
↓ 1 callersFunctiongetMediaDescriptor
(item)
src/utils/chat-helpers.js:82
↓ 1 callersFunctiongetOrCreateAgent
(url)
src/utils/proxy-helper.js:44
↓ 1 callersFunctiongetSimpleFileType
(mimeType)
src/utils/upload.js:43
↓ 1 callersMethodgetTodayKey
* Public helper: today's YYYY-MM-DD key in Node process local TZ. * Paired with the _getYesterdayKey used inside _resetDailyCounters. * The
src/utils/account.js:347
↓ 1 callersMethodgetTokenHealthStats
* 获取健康的令牌统计信息 * @param {Array} accounts - 账户列表 * @returns {Object} 统计信息
src/utils/token-manager.js:213
↓ 1 callersMethodgetTokenRemainingHours
* 获取令牌剩余有效时间(小时) * @param {string} token - JWT令牌 * @returns {number} 剩余小时数,-1表示无效令牌
src/utils/token-manager.js:116
↓ 1 callersFunctionhandleAnthropicNonStream
(res, ctx, upstream)
src/controllers/anthropic.js:589
↓ 1 callersFunctionhandleAnthropicStream
(res, ctx, upstream)
src/controllers/anthropic.js:369
↓ 1 callersFunctionhandleImageVideoCompletion
(req, res)
src/controllers/chat.image.video.js:1479
↓ 1 callersFunctionhandleNonStreamResponse
(res, response, enable_thinking, enable_web_search, model, requestBody = null, options = {})
src/controllers/chat.js:505
↓ 1 callersFunctionhandleStreamResponse
(res, response, enable_thinking, enable_web_search, requestBody = null, options = {})
src/controllers/chat.js:100
↓ 1 callersMethodinitCliAccount
* 初始化 CLI 账户 * @param {string} access_token - 访问令牌 * @param {Object} [account] - Qwen 账户对象(用于解析账号级代理) * @returns {Promise<Object>} 账户信息
src/utils/cli.manager.js:259
↓ 1 callersMethodinitLogDirectory
* 初始化日志目录
src/utils/logger.js:88
↓ 1 callersFunctioninitSsxmodManager
* 初始化 SSXMOD 管理器 * 启动时生成一次 Cookie,并设置定时刷新
src/utils/ssxmod-manager.js:43
↓ 1 callersMethodinitiateDeviceFlow
* 启动 OAuth 设备授权流程 * @param {Object} [account] - Qwen 账户对象(用于解析账号级代理) * @returns {Promise<Object>} 包含设备代码、验证URL和代码验证器的对象
src/utils/cli.manager.js:67
↓ 1 callersFunctioninvalidateProxyAgent
(url)
src/utils/proxy-helper.js:68
↓ 1 callersFunctionisCacheExpired
()
src/models/models-map.js:14
↓ 1 callersFunctionisInjectedSystemPart
(part)
src/controllers/cli.chat.js:93
↓ 1 callersMethodloadAccountTokens
* 加载账户令牌数据 * @returns {Promise<void>}
src/utils/account.js:131
↓ 1 callersMethodloadAccounts
* 加载所有账户数据 * @returns {Promise<Array>} 账户列表
src/utils/data-persistence.js:26
↓ 1 callersMethodloadSettings
* 加载运行时设置(chat retry config 等) * 在 'none' 模式下返回 {}, 因为没有可写存储 * @returns {Promise<Object>} 设置对象 (空对象表示尚未存储任何值)
src/utils/data-persistence.js:76
↓ 1 callersMethodlogin
* 用户登录获取令牌 * @param {string} email - 邮箱 * @param {string} password - 密码 * @param {Object} [account] - 账户对象(用于解析账号级代理;为空时回退到全局 PROXY_URL
src/utils/token-manager.js:32
↓ 1 callersFunctionlzwCompress
(data, bits, charFunc)
src/utils/cookie-generator.js:19
↓ 1 callersFunctionmaskAccountToken
(token)
src/routes/accounts.js:280
↓ 1 callersFunctionnormalizeAnthropicSystem
(system)
src/controllers/anthropic.js:48
↓ 1 callersFunctionnormalizeAnthropicToolChoice
(toolChoice)
src/controllers/anthropic.js:82
↓ 1 callersFunctionnormalizeAnthropicTools
(tools)
src/controllers/anthropic.js:65
↓ 1 callersFunctionnormalizeInlineMediaItem
(value, mediaType)
src/controllers/chat.image.video.js:773
↓ 1 callersFunctionparseApiKeys
()
src/config/index.js:8
↓ 1 callersFunctionparseBatchAccountsText
(accountsText)
src/routes/accounts.js:44
↓ 1 callersFunctionparseRealData
(realData)
src/utils/cookie-generator.js:276
↓ 1 callersFunctionpreprocessCliRequestBody
(rawBody)
src/controllers/cli.chat.js:245
↓ 1 callersFunctionprocessBatchAccountItem
(task, account)
src/routes/accounts.js:185
↓ 1 callersFunctionprocessFields
(fields)
src/utils/cookie-generator.js:281
↓ 1 callersFunctionprocessOriginalLogic
(messages, thinking_config, chat_type, imgCacheManager)
src/utils/chat-helpers.js:415
↓ 1 callersFunctionprocessSSEPayload
(dataContent)
src/controllers/chat.js:257
↓ 1 callersFunctionpruneCliPayload
(value)
src/controllers/cli.chat.js:47
↓ 1 callersFunctionpushUnique
(list, value)
src/controllers/chat.image.video.js:1083
↓ 1 callersFunctionreadImageUpstreamResult
(responseStream)
src/controllers/chat.image.video.js:947
↓ 1 callersFunctionreadStreamBody
* 读取流响应体为文本 * @param {*} stream - 响应流 * @returns {Promise<string>} 文本结果
src/controllers/cli.chat.js:181
↓ 1 callersMethodrecordError
* 记录账户错误(仅用于 UI warn 指示,不影响 cooldown) * HTTP 4xx/5xx 走这里——上游主动拒绝,账户本身有效,不应进入 cooldown * @param {string} email - 邮箱地址 * @param {string|number}
src/utils/account-rotator.js:130
↓ 1 callersMethodrefreshAccessToken
* 刷新访问令牌 * @param {Object} CliAccount - 账户信息 * @param {Object} [account] - Qwen 账户对象(用于解析账号级代理) * @returns {Promise<Object>} 账户信息
src/utils/cli.manager.js:296
↓ 1 callersFunctionrefreshCookies
* 刷新 SSXMOD Cookie
src/utils/ssxmod-manager.js:25
↓ 1 callersMethodremoveAccount
* 移除账户 * @param {string} email - 邮箱地址 * @returns {Promise<boolean>} 移除是否成功
src/utils/account.js:932
↓ 1 callersFunctionrequestStsToken
(filename, filesize, filetypeSimple, authToken, retryCount = 0, account)
src/utils/upload.js:72
↓ 1 callersMethodreset
* 重置所有统计数据
src/utils/account-rotator.js:294
↓ 1 callersFunctionresolveImageResultContentUrl
(responseData, chatID, token)
src/controllers/chat.image.video.js:1128
↓ 1 callersFunctionresolveProxyUrl
(account)
src/utils/proxy-helper.js:32
↓ 1 callersFunctionresolveVideoResultContentUrl
(responseStream, token, chatID)
src/controllers/chat.image.video.js:1166
↓ 1 callersMethodrotateLogFile
* 日志文件轮转 * @param {string} logFile - 日志文件路径
src/utils/logger.js:182
↓ 1 callersMethodsaveAccountStats
* 调度 per-account daily stats 持久化(debounce 5 秒) * 高频 accumulateStats 调用合并为单次 I/O——重复调用替换上一个 timer * dataSaveMode='none' 时不写盘,返回 false * @param
src/utils/data-persistence.js:300
↓ 1 callersFunctionsaveAccounts
(email, password, token, expires, proxy = null)
src/utils/setting.js:18
↓ 1 callersMethodsaveAllAccounts
* 批量保存账户数据 * @param {Array} accounts - 账户列表 * @returns {Promise<boolean>} 保存是否成功
src/utils/data-persistence.js:141
↓ 1 callersMethodshouldLog
* 检查日志级别是否应该输出 * @param {string} level - 日志级别 * @returns {boolean}
src/utils/logger.js:103
↓ 1 callersFunctionsliceArgsJson
(argsJson, chunkSize = 32)
src/controllers/anthropic.js:339
↓ 1 callersFunctionsplitSafeText
(text)
src/utils/tool-prompt.js:278
↓ 1 callersMethodupdateAccountProxy
* 更新账户的代理 URL * 同时使旧 URL 对应的 agent 失效(释放底层 socket) * @param {string} email - 邮箱 * @param {string|null} proxy - 新代理 URL,空字符串/null 表示清除
src/utils/account.js:881
↓ 1 callersFunctionuploadMultipartMediaFile
(file, mediaType)
src/controllers/chat.image.video.js:750
↓ 1 callersFunctionuploadToOssWithSts
(fileBuffer, stsCredentials, ossInfo, fileContentTypeFull, retryCount = 0)
src/utils/upload.js:188
↓ 1 callersFunctionverifyRedisCommandChannel
(client)
src/utils/redis.js:79
↓ 1 callersFunctionwaitForRedisReady
(client)
src/utils/redis.js:124
↓ 1 callersFunctionwriteReasoningDelta
(text)
src/controllers/chat.js:158
↓ 1 callersMethodwriteToFile
* 写入日志文件 * @param {string} message - 日志消息
src/utils/logger.js:162
Method_resetCliRequestNumbers
* 重置CLI请求次数(向后兼容别名) * @private
src/utils/account.js:370
Method_saveUpdatedAccounts
* 保存更新后的账户数据 * @param {Array} updatedAccounts - 更新后的账户列表 * @private
src/utils/account.js:543
FunctionadminKeyVerify
(req, res, next)
src/middlewares/authorization.js:43
FunctionapiKeyVerify
(req, res, next)
src/middlewares/authorization.js:26
FunctionapplyProxyToAxiosConfig
(requestConfig = {}, account)
src/utils/proxy-helper.js:101
Methodauth
(message, module = '', data = null)
src/utils/logger.js:291
MethodbatchRefreshTokens
* 批量刷新即将过期的令牌 * @param {Array} accounts - 账户列表 * @param {number} thresholdHours - 过期阈值(小时) * @param {Function} onEachRefresh - 每次刷新成功后的
src/utils/token-manager.js:166
Methodchat
(message, module = '', data = null)
src/utils/logger.js:299
FunctioncheckKeyExists
(key = 'headers')
src/utils/redis.js:527
FunctioncompressToolDefinition
(tool)
src/utils/tool-prompt.js:61
Methodconstructor
()
src/utils/data-persistence.js:15
Methodconstructor
(options = {})
src/utils/logger.js:9
Methodconstructor
()
src/utils/account-rotator.js:8
Methodconstructor
()
src/utils/token-manager.js:11
Methodconstructor
()
src/utils/img-caches.js:7
Methodconstructor
()
src/utils/account.js:81
Methoddatabase
(message, module = '', data = null)
src/utils/logger.js:287
Methoddebug
(message, module = '', emoji = '', data = null)
src/utils/logger.js:262
Functiondel
(key)
src/utils/redis.js:611
FunctiondeleteAccount
(email)
src/utils/setting.js:47
MethoddeleteAccount
* 删除账户(向后兼容) * @param {string} email - 邮箱地址 * @returns {boolean} 删除是否成功
src/utils/account.js:959
Functionexists
(key)
src/utils/redis.js:591
FunctionextractVideoTaskIDFromPayload
(payload)
src/controllers/chat.image.video.js:545
← previousnext →201–300 of 346, ranked by callers