Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/ding113/claude-code-hub
/ functions
Functions
6,623 in github.com/ding113/claude-code-hub
⨍
Functions
6,623
◇
Types & classes
1,237
↓ 33 callers
Function
makeEndpoint
(input: { id: number; vendorId: number; providerType: ProviderType; url: string; lastProbeLatencyMs?
tests/unit/proxy/proxy-forwarder-retry-limit.test.ts:103
↓ 32 callers
Function
createSession
({ originalModel, redirectedModel, requestUrl, requestMessage, }: { originalModel?: string | null;
tests/unit/proxy/session.test.ts:75
↓ 32 callers
Function
searchParams
(params: Record<string, unknown>)
src/lib/api-client/v1/actions/_compat.ts:36
↓ 31 callers
Function
createAdvancedFilter
( operations: FilterOperation[], overrides: Partial<RequestFilter> = {} )
tests/unit/request-filter-advanced.test.ts:36
↓ 31 callers
Function
createThenableQuery
(result: T)
tests/unit/repository/system-config-update-missing-columns.test.ts:3
↓ 31 callers
Function
editProvider
( providerId: number, data: { name?: string; url?: string; key?: string; is_enabled?: bool
src/actions/providers.ts:735
↓ 31 callers
Function
isClientAllowedDetailed
( session: ProxySession, allowedClients: string[], blockedClients?: string[] )
src/app/v1/_lib/proxy/client-detector.ts:252
↓ 31 callers
Function
matchClientPattern
(session: ProxySession, pattern: string)
src/app/v1/_lib/proxy/client-detector.ts:172
↓ 31 callers
Function
renderWithIntl
(node: ReactNode)
src/app/[locale]/dashboard/logs/_components/error-details-dialog.test.tsx:367
↓ 31 callers
Method
send
(session: ProxySession)
src/app/v1/_lib/proxy/forwarder.ts:1148
↓ 30 callers
Function
checkProviderGroupMatch
* 检查供应商分组是否匹配用户分组(支持多分组逗号分隔) * * @param providerGroupTag - 供应商的 groupTag 字段(可为 null 或逗号分隔的多标签) * @param userGroups - 用户/密钥的分组配置(逗号分隔的多分组) * @retur
src/app/v1/_lib/proxy/provider-selector.ts:54
↓ 30 callers
Function
handler
(e: MediaQueryListEvent)
src/lib/hooks/use-media-query.ts:14
↓ 30 callers
Function
renderSection
({ state = createMockState(), mode = "create", }: { state?: ProviderFormState; mode?: "create" | "edit
tests/unit/settings/providers/options-section.test.tsx:183
↓ 29 callers
Function
createStreamingResponse
(params: { label: string; firstChunkDelayMs: number; controller: AbortController; })
tests/unit/proxy/proxy-forwarder-hedge-first-byte.test.ts:245
↓ 29 callers
Function
expectSuccess
* 期望 API 调用成功 * * 验证: * - HTTP 状态码为 200 * - 响应格式为 {ok: true, data: ...}(data 可能为 null) * * @returns data 字段的内容(可能为 null) * * @example * const
tests/e2e/users-keys-complete.test.ts:107
↓ 29 callers
Function
makeMockPrice
( modelName: string, priceData: Partial<ModelPriceData>, source: "litellm" | "manual" = "manual" )
tests/unit/actions/model-prices.test.ts:66
↓ 28 callers
Method
buildError
( status: number, message: string, errorType?: string, details?: Record<string, unknown>,
src/app/v1/_lib/proxy/responses.ts:2
↓ 28 callers
Function
computeVendorKey
(input: { providerUrl: string; websiteUrl?: string | null; })
src/repository/provider-endpoints.ts:168
↓ 28 callers
Function
createMockSession
( userAgent: string | undefined, allowedClients: string[] = [], blockedClients: string[] = [] )
tests/unit/proxy/client-guard.test.ts:22
↓ 28 callers
Function
executeProviderTest
(config: ProviderTestConfig)
src/lib/provider-testing/test-service.ts:345
↓ 28 callers
Function
expectBuiltUrl
(baseUrl: string, requestPath: string, expectedUrl: string)
tests/unit/app/v1/url.test.ts:14
↓ 28 callers
Method
handle
(session: ProxySession, error: unknown)
src/app/v1/_lib/proxy/error-handler.ts:170
↓ 28 callers
Function
inferOwner
(modelId: string)
src/app/v1/_lib/models/available-models.ts:183
↓ 28 callers
Function
isFakeStreamingEligible
( clientRequestedModel: string, providerGroupTag: string | null | undefined, whitelist: ReadonlyArray<Fa
src/app/v1/_lib/proxy/fake-streaming/eligibility.ts:18
↓ 28 callers
Function
makeEndpoint
(overrides: Partial<ProviderEndpoint>)
tests/unit/lib/provider-endpoints/endpoint-selector.test.ts:4
↓ 28 callers
Method
off
( event: string, layerOrHandler: string | ((...args: unknown[]) => void), handler?: (...args
src/components/ui/__tests__/map.test.tsx:266
↓ 28 callers
Method
shouldPersistSessionDebugArtifacts
()
src/app/v1/_lib/proxy/session.ts:422
↓ 28 callers
Function
tryResponsesWebsocketUpstream
(options: { provider: Provider; upstreamUrl: string; upstreamHeaders: Headers | Record<string, string>;
src/app/v1/_lib/responses-ws/upstream-adapter.ts:334
↓ 27 callers
Function
createInitialState
( mode: FormMode, provider?: ProviderDisplay, cloneProvider?: ProviderDisplay, preset?: { name?: s
src/app/[locale]/settings/providers/_components/forms/provider-form/provider-form-context.tsx:126
↓ 27 callers
Method
getCurrentCost
* 获取当前消费(用于响应头和前端展示) * 优先使用 Redis,失败时降级到数据库查询
src/lib/rate-limit/service.ts:1091
↓ 27 callers
Function
previewProviderBatchPatch
( input: unknown )
src/actions/providers.ts:1955
↓ 27 callers
Method
run
(session: ProxySession)
src/app/v1/_lib/proxy/guard-pipeline.ts:49
↓ 27 callers
Method
shutdown
* Shutdown the pool and close all agents
src/lib/proxy-agent/agent-pool.ts:164
↓ 26 callers
Function
extractActualResponseModel
( kind: ExtractKind, bodyText: string | null | undefined )
src/app/v1/_lib/proxy/actual-response-model.ts:76
↓ 26 callers
Function
extractClientIp
( source: HeadersLike, config: IpExtractionConfig = DEFAULT_IP_EXTRACTION_CONFIG )
src/lib/ip/extract-client-ip.ts:90
↓ 26 callers
Function
getCircuitState
(providerId: number)
src/lib/circuit-breaker.ts:677
↓ 26 callers
Function
isPlainObject
* Check if a value is a plain object
src/lib/utils/message-redaction.ts:13
↓ 26 callers
Function
parseString
(value: unknown)
src/app/v1/_lib/proxy/openai-image-compat.ts:157
↓ 26 callers
Method
pickRandomProvider
( session?: ProxySession, excludeIds: number[] = [] // 排除已失败的供应商 )
src/app/v1/_lib/proxy/provider-selector.ts:716
↓ 26 callers
Function
redactUrlCredentials
(url: string | null | undefined)
src/lib/api/v1/_shared/redaction.ts:39
↓ 26 callers
Function
renderWithProviders
(node: ReactNode)
tests/unit/settings/providers/provider-endpoints-table.test.tsx:107
↓ 26 callers
Function
undoProviderPatch
( input: unknown )
src/actions/providers.ts:2237
↓ 25 callers
Function
bucket
( state: PublicStatusTimelineBucket["state"], pct: number | null, index: number )
tests/unit/app/status/fill-display-timeline.test.ts:5
↓ 25 callers
Function
callActionsRoute
( ...args: Parameters<typeof import("../test-utils")["callActionsRoute"]> )
tests/api/my-usage-readonly.test.ts:17
↓ 25 callers
Function
decideCacheHitRateAnomalies
( input: CacheHitRateAlertDecisionInput )
src/lib/cache-hit-rate-alert/decision.ts:194
↓ 25 callers
Method
eval
(script: string, numKeys: number, ...args: string[])
src/lib/public-status/config-snapshot.ts:99
↓ 25 callers
Function
flushMicrotasks
()
src/components/ui/__tests__/map.test.tsx:414
↓ 25 callers
Function
saveSystemSettings
(formData: { // 所有字段均为可选,支持部分更新 siteTitle?: string; allowGlobalUsageView?: boolean; currencyDisplay?:
src/actions/system-config.ts:53
↓ 24 callers
Function
calculateRequestCostBreakdown
( usage: UsageMetrics, priceData: ModelPriceData, context1mAppliedOrOptions: boolean | RequestCostBreakd
src/lib/utils/cost-calculation.ts:372
↓ 24 callers
Function
createSession
({ userAgent, headers, }: { userAgent: string | null; headers: Headers; })
tests/unit/proxy/proxy-forwarder.test.ts:11
↓ 24 callers
Function
inferUpstreamErrorStatusCodeFromText
( text: string )
src/lib/utils/upstream-error-detection.ts:179
↓ 24 callers
Function
makeProvider
(id: number, overrides: Record<string, unknown> = {})
tests/unit/actions/providers-apply-engine.test.ts:89
↓ 24 callers
Method
trackCost
* 累加消费(请求结束后调用) * 5h 使用滚动窗口(ZSET),daily 根据模式选择滚动/固定窗口,周/月使用固定窗口(STRING)
src/lib/rate-limit/service.ts:916
↓ 23 callers
Method
applyForProvider
(session: ProxySession)
src/lib/request-filter-engine.ts:502
↓ 23 callers
Function
buildLeaseKey
( entityType: LeaseEntityTypeType, entityId: number, window: LeaseWindowType, resetMode?: DailyResetMo
src/lib/rate-limit/lease.ts:56
↓ 23 callers
Function
completeCodexSessionIdentifiers
( args: CompleteArgs )
src/app/v1/_lib/codex/session-completer.ts:216
↓ 23 callers
Function
createChainMock
(resolvedData: unknown[])
tests/unit/repository/leaderboard-provider-metrics.test.ts:12
↓ 23 callers
Function
createSession
(clientAbortSignal: AbortSignal | null = null)
tests/unit/proxy/proxy-forwarder-hedge-first-byte.test.ts:194
↓ 23 callers
Function
formatProviderTimeline
( chain: ProviderChainItem[], t: (key: string, values?: Record<string, string | number>) => string )
src/lib/utils/provider-chain-formatter.ts:482
↓ 23 callers
Function
getResetInfo
(period: TimePeriod, resetTime = "00:00")
src/lib/rate-limit/time-utils.ts:192
↓ 23 callers
Function
loadMessages
(locale: string = "en")
tests/unit/settings/prices/test-messages.ts:68
↓ 23 callers
Method
toDecimalPlaces
()
tests/unit/repository/overview-timezone-parentheses.test.ts:121
↓ 23 callers
Method
transform
(chunk, controller)
src/app/v1/_lib/proxy/response-fixer/index.ts:420
↓ 22 callers
Function
buildHeaders
(session: ProxySession, provider: Provider)
tests/unit/proxy/proxy-forwarder.test.ts:101
↓ 22 callers
Function
codexProvider
()
src/app/v1/_lib/responses-ws/__tests__/upstream-adapter.test.ts:45
↓ 22 callers
Function
createProvider
( id: number, providerType: string, overrides: Partial<Provider> = {} )
tests/unit/proxy/provider-selector-format-compatibility.test.ts:27
↓ 22 callers
Function
findUserById
(id: number)
src/repository/user.ts:413
↓ 22 callers
Function
formatDate
( date: Date | number | string, formatString: string, locale: string = "zh-CN", timezone?: string )
src/lib/utils/date-format.ts:45
↓ 22 callers
Function
getConfidenceLevel
( count: number, thresholds: { low: number; medium: number; high: number } )
tests/unit/dashboard/availability/confidence-badge.test.tsx:13
↓ 22 callers
Function
hasPrefix
(pathname: string, prefix: string)
src/app/v1/_lib/proxy/endpoint-family-catalog.ts:18
↓ 22 callers
Function
makeCodexRequestBody
(overrides?: Record<string, unknown>)
tests/unit/codex/session-completer.test.ts:23
↓ 22 callers
Function
redactRequestBody
(body: unknown)
src/lib/utils/message-redaction.ts:193
↓ 22 callers
Function
renderWithProviders
(node: ReactNode)
tests/unit/user-dialogs.test.tsx:212
↓ 21 callers
Method
apply
@deprecated Use applyGlobal() instead
src/lib/request-filter-engine.ts:548
↓ 21 callers
Function
buildPublicStatusManifestKey
(input: { configVersion: string; intervalMinutes: number; rangeHours: number; prefix?: string; })
src/lib/public-status/redis-contract.ts:95
↓ 21 callers
Function
callActionsRoute
(options: ActionsRouteCallOptions)
tests/test-utils.ts:35
↓ 21 callers
Function
collectSseBody
(response: Response)
src/app/v1/_lib/responses-ws/__tests__/upstream-adapter.test.ts:61
↓ 21 callers
Function
createAdminSession
()
tests/unit/actions/admin-user-insights.test.ts:33
↓ 21 callers
Function
createSessionWithProvider
( providerId: number, groupTag: string | null = null )
tests/unit/request-filter-binding.test.ts:125
↓ 21 callers
Method
detect
* 检测错误消息是否匹配任何规则(同步版本) * * 注意:如果规则未初始化,会记录警告并返回 false * 推荐使用 detectAsync() 以确保规则已加载 * * 检测顺序(性能优先): * 1. 包含匹配(最快,O(n*m)) * 2. 精确匹
src/lib/error-rule-detector.ts:379
↓ 21 callers
Method
fix
(input: Uint8Array)
src/app/v1/_lib/proxy/response-fixer/sse-fixer.ts:200
↓ 21 callers
Function
getAdminSession
()
src/actions/provider-endpoints.ts:156
↓ 21 callers
Method
getEndpointPolicy
()
src/app/v1/_lib/proxy/session.ts:756
↓ 21 callers
Function
getSessionDisplayStatus
(session: SessionStatusInput)
src/lib/session-status.ts:47
↓ 21 callers
Function
isProviderActiveNow
( startTime: string | null, endTime: string | null, timezone: string, now: Date = new Date() )
src/lib/utils/provider-schedule.ts:24
↓ 21 callers
Function
render
(node: React.ReactNode)
tests/unit/settings/providers/form-tab-nav.test.tsx:53
↓ 21 callers
Function
scanPattern
(redis: Redis, pattern: string, count = 100)
src/lib/redis/scan-helper.ts:17
↓ 21 callers
Function
setAuthCookie
(token?: string)
tests/unit/auth/admin-token-opaque-fallback.test.ts:60
↓ 21 callers
Function
updateMessageRequestDetails
( id: number, details: { statusCode?: number; inputTokens?: number; outputTokens?: number;
src/repository/message.ts:464
↓ 21 callers
Function
validateOpenAIImageRequest
(options: { pathname: string; body: Record<string, unknown>; imageRequestMetadata?: OpenAIImageRequestMe
src/app/v1/_lib/proxy/openai-image-compat.ts:1002
↓ 20 callers
Function
createSession
(overrides?: { user?: Partial<{ id: number; rpm: number | null; dailyQuota: number | nul
tests/unit/proxy/rate-limit-guard.test.ts:54
↓ 20 callers
Function
decodeRequestBody
( input: ArrayBuffer | Uint8Array, contentEncoding: string | null | undefined, options?: DecodeRequestBo
src/app/v1/_lib/proxy/request-body-codec.ts:162
↓ 20 callers
Method
decrementLeaseBudget
* Decrement lease budget after a request completes * * This should be called after the request is processed to deduct * the actual cost from
src/lib/rate-limit/service.ts:1816
↓ 20 callers
Method
destroy
()
src/lib/request-filter-engine.ts:330
↓ 20 callers
Function
emitChange
(fieldOrBatch: string | Record<string, any>, value?: any)
src/app/[locale]/dashboard/_components/user/forms/user-edit-section.tsx:178
↓ 20 callers
Function
fail
(code: ValidationFailureCode, reason: string)
src/app/v1/_lib/proxy/fake-streaming/response-validator.ts:370
↓ 20 callers
Function
formatZodError
(error: z.ZodError)
src/lib/utils/zod-i18n.ts:154
↓ 20 callers
Method
getContext1mApplied
()
src/app/v1/_lib/proxy/session.ts:383
↓ 20 callers
Function
getErrorMessageServer
( locale: string, code: ErrorCode | string, params?: Record<string, string | number> )
src/lib/utils/error-messages.ts:197
↓ 20 callers
Method
getOriginalModel
* 获取原始模型(用户请求的,用于计费) * 如果没有发生重定向,返回当前模型
src/app/v1/_lib/proxy/session.ts:737
← previous
next →
101–200 of 6,623, ranked by callers