MCPcopy Create free account

hub / github.com/Prejudice-Studio/Twilight / functions

Functions2,686 in github.com/Prejudice-Studio/Twilight

↓ 7 callersFunctionbatchResult
(total int)
internal/api/business.go:1394
↓ 7 callersMethodbatchUserUIDsFromPayload
(w http.ResponseWriter, payload map[string]any, maxExplicit, maxSelectedAll int, tooManyMessage string)
internal/api/batch_user_handlers.go:361
↓ 7 callersMethodclearDelAccountPending
(chatID, telegramID int64)
internal/api/telegram_bot.go:69
↓ 7 callersFunctionclearUserSelection
()
webui/src/app/(main)/admin/users/page.tsx:380
↓ 7 callersMethodconfigBackupDir
()
internal/api/config_admin.go:596
↓ 7 callersFunctioncsvSafe
csvSafe 中和 CSV 公式注入:Excel / WPS / LibreOffice 会把以 = + - @ 开头 (或以 Tab / CR / LF 起始)的单元格当作公式求值,恶意用户名 / 媒体标题 形如 "=HYPERLINK(...)"、"=1+2"、"+cmd" 在管理员打开导出文
internal/api/handlers.go:2771
↓ 7 callersMethodembyUserByID
(ctx context.Context, id string)
internal/api/emby.go:237
↓ 7 callersFunctiongenerateRegCode
(format string, codeType int, algorithm string, days int, index int, validity int64, useLimit int)
internal/api/business.go:703
↓ 7 callersFunctionpaginate
(items []T, page, perPage int)
internal/api/business.go:357
↓ 7 callersFunctionpostJSON
(ctx context.Context, endpoint string, headers map[string]string, body any, dst any)
internal/api/http_json_client.go:85
↓ 7 callersFunctionredactGitURL
(raw string)
internal/api/system_update.go:280
↓ 7 callersMethodrefreshTelegramUsername
refreshTelegramUsername 在收到任意来自已绑定用户的更新时被动刷新其存储的 Telegram 用户名。只有解析到绑定账号、且新用户名非空并与现存不同才写库,避免 无谓写盘;用户名为空(对方删了 @username)时保留旧值不清空,以免破坏指名码匹配。
internal/api/telegram_bot.go:299
↓ 7 callersMethodruntimeDatabaseMismatch
()
internal/api/storage_guard.go:24
↓ 7 callersFunctionsetupObject
(payload map[string]any, key string)
internal/api/setup_handlers.go:240
↓ 7 callersMethodtelegramDeletePanel
(token string)
internal/api/telegram_inline.go:235
↓ 7 callersMethodtelegramEditMessageText
(ctx context.Context, chatID, messageID int64, text string, replyMarkup any)
internal/api/telegram.go:187
↓ 7 callersMethodtelegramSavePanel
(panel telegramPanelContext)
internal/api/telegram_inline.go:132
↓ 7 callersMethodupdateMySettings
(data: { bgm_mode?: boolean; bgm_manage_mode?: boolean; bgm_token?: string; email?: string; notify_on_login_te
webui/src/lib/api.ts:296
↓ 7 callersMethoduserFromPath
userFromPath 抽掉"按 :uid path-param 加载用户,不存在则 404"的 重复模板。原先 handlers.go / upload_handlers.go / admin_extra.go / library_handlers.go 各处共有 9 个完全一样的 4 行片段:
internal/api/app.go:1370
↓ 7 callersFunctionuserLabel
(username?: string | null, uid?: number | null)
webui/src/app/(main)/admin/regcodes/page.tsx:695
↓ 6 callersMethodClose
()
internal/redis/redis.go:66
↓ 6 callersMethodEmailVerification
(id string)
internal/store/email_verification.go:155
↓ 6 callersMethodFindUserByEmbyID
(embyID string)
internal/store/store.go:1866
↓ 6 callersMethodListAuditLogs
ListAuditLogs 返回所有审计日志,最新在前。
internal/store/store.go:4241
↓ 6 callersMethodListBangumiSyncLogs
(uid int64, limit int)
internal/store/store.go:4342
↓ 6 callersMethodListTickets
(filter TicketFilter)
internal/store/store.go:3044
↓ 6 callersMethodLoginHistory
(uid int64, blockedOnly bool, since int64, limit int)
internal/store/login_log.go:27
↓ 6 callersFunctionResolveLeafFile
ResolveLeafFile 是 ResolveWithinRoot 的严格子集:要求 name 为单一文件名 (没有目录分隔符 / 没有 ..),且最终路径必须是普通文件、非符号链接, 可选地校验扩展名(lowercase,不含点 ".";空字符串表示不校验)。 用于备份恢复、上传资源访问等"必
internal/api/safepath.go:54
↓ 6 callersMethodSetDeveloperModeEnabled
(enabled bool)
internal/store/store.go:3318
↓ 6 callersMethodUpdateDevice
(uid int64, deviceID string, fn func(*Device))
internal/store/device.go:37
↓ 6 callersMethodUpsertTelegramRoster
(chatID string, telegramID int64, status string, isBot bool)
internal/store/store.go:3971
↓ 6 callersFunctionValidatePasswordStrength
ValidatePasswordStrength 与前端 password.ts:validatePasswordStrength 等价。 前端可在用户输入时给出可视化提示,后端必须用本函数兜底,否则可被绕过。
internal/validate/validate.go:54
↓ 6 callersFunctionVerifyPassword
(password, encoded string)
internal/security/password.go:47
↓ 6 callersFunctionaddDaysToExpiry
(current int64, days int, now time.Time)
internal/api/business.go:196
↓ 6 callersMethodbatchUserSelectionBody
(selection: number[] | BatchUserSelection)
webui/src/lib/api.ts:1065
↓ 6 callersFunctioncloneMap
(in map[string]any)
internal/api/business.go:1432
↓ 6 callersFunctiondefaultPermissions
()
internal/api/apikey_handlers.go:202
↓ 6 callersFunctiondescribeApiTarget
(endpoint: string, method: string)
webui/src/lib/api-request.ts:172
↓ 6 callersFunctiondeveloperJSAnySlice
(input any)
internal/api/telegram_js_commands.go:2133
↓ 6 callersFunctiondeveloperJSListOptions
developerJSListOptions parses { limit, offset } from an exported JS options object. limit is clamped to [1, max] with the given fallback; offset is cl
internal/api/telegram_js_commands.go:801
↓ 6 callersFunctiondeveloperJSMapString
(values map[string]any, key string)
internal/api/telegram_js_commands.go:1842
↓ 6 callersFunctiondeveloperJSPrivateIP
(ip net.IP)
internal/api/telegram_js_commands.go:2113
↓ 6 callersFunctiondeveloperJSStringSlice
(input any)
internal/api/telegram_js_commands.go:2165
↓ 6 callersFunctiondispatch
(action: Action)
webui/src/hooks/use-toast.ts:154
↓ 6 callersFunctionembyPolicy
(user map[string]any)
internal/api/admin_extra.go:1053
↓ 6 callersFunctionfilterRows
(rows: DeveloperJSDocEntry[], query: string, category?: string)
webui/src/components/developer-js-docs-panel.tsx:938
↓ 6 callersFunctioninspect
(name: string, settled: PromiseSettledResult<unknown>)
webui/src/app/(main)/dashboard/page.tsx:247
↓ 6 callersFunctionint64Slice
(value any)
internal/api/business.go:1373
↓ 6 callersMethodinviteDepth
(uid int64)
internal/api/business.go:1170
↓ 6 callersFunctionjobParamInt
(params map[string]any, key string, fallback int)
internal/api/scheduler_runner.go:773
↓ 6 callersMethodmaintainTelegramIDIndex
maintainTelegramIDIndex 在用户变更后增量维护 telegramID → UID 索引。 调用方须持有 s.mu 写锁。索引为空时自动从 state 重建。
internal/store/store.go:2455
↓ 6 callersFunctionnormalizeRegcodeTargetTelegramUsername
(username string)
internal/api/regcode_handlers.go:258
↓ 6 callersMethodpgDB
()
internal/api/session.go:104
↓ 6 callersFunctionpushText
()
webui/src/lib/safe-render.tsx:35
↓ 6 callersMethodredis
()
internal/api/app.go:138
↓ 6 callersFunctionrefreshAfterBatch
()
webui/src/app/(main)/admin/users/page.tsx:1229
↓ 6 callersFunctionregcodeUsedByUIDs
(code store.RegCode)
internal/api/business.go:622
↓ 6 callersMethodreloadConfig
()
internal/api/app.go:331
↓ 6 callersFunctionruntimeConfigPath
(path string)
cmd/twilight/main.go:415
↓ 6 callersFunctionselectedBatchTarget
()
webui/src/app/(main)/admin/users/page.tsx:405
↓ 6 callersMethodsetTelegramRuntimeStatus
(polling bool, err error)
internal/api/telegram.go:72
↓ 6 callersFunctionstripProtectedAdminConfig
(content string)
internal/api/config_admin.go:652
↓ 6 callersMethodtelegramDeleteMessage
(ctx context.Context, chatID, messageID int64)
internal/api/telegram.go:212
↓ 6 callersMethodtelegramIDTakenLocked
(telegramID, allowedUID int64)
internal/store/store.go:1683
↓ 6 callersMethodtelegramRunJSCustomCommandWithOptions
(code string, c telegramCommandCtx, privateChat bool, opts developerJSRunOptions)
internal/api/telegram_js_commands.go:120
↓ 6 callersMethodtelegramSanitizeError
(err error)
internal/api/telegram.go:139
↓ 6 callersMethodticketAttachmentDir
ticketAttachmentDir 返回某工单的图片目录绝对路径(约束在 uploads/tickets/<id> 内)。
internal/api/ticket_handlers.go:301
↓ 6 callersFunctionticketDTO
ticketDTO 把单个工单序列化为响应 map,并为每张附件补上可访问的 url 字段。
internal/api/ticket_handlers.go:567
↓ 6 callersFunctionuploadImageExtension
(contentType string)
internal/api/upload_handlers.go:326
↓ 6 callersMethoduserHasEmbyGrantHistory
(u store.User)
internal/api/business.go:258
↓ 6 callersFunctionvalidateOutboundBaseURL
validateOutboundBaseURL 用于所有出站远端服务(Emby / Bangumi / Telegram / TMDB)配置的 base URL 校验。返回 trim 右斜杠的规范化 base URL。 规则: - scheme 必须为 http 或 https; - host 不
internal/api/outbound_url.go:45
↓ 6 callersFunctionwrap
(cls: string, text: string)
webui/src/components/js-code-editor.tsx:59
↓ 5 callersMethodAddLoginLog
(log LoginLog)
internal/store/login_log.go:7
↓ 5 callersMethodAddViolationLog
AddViolationLog records a code violation attempt.
internal/store/store.go:4166
↓ 5 callersMethodBackupWithNote
(dir, note string)
internal/store/store.go:1413
↓ 5 callersMethodCreateMediaRequest
(r MediaRequest)
internal/store/store.go:2600
↓ 5 callersMethodFindActiveEmailVerification
FindActiveEmailVerification 返回匹配 (purpose,email) 且未过期的记录(用于登出态 找回:客户端只提交 email+code,没有 id;也用于发码前的重发冷却判定)。
internal/store/email_verification.go:71
↓ 5 callersMethodFlush
()
internal/api/app.go:186
↓ 5 callersMethodIsIPBlacklisted
(ip string)
internal/store/ip_blacklist.go:39
↓ 5 callersFunctionNewReader
(path string)
internal/config/reader.go:9
↓ 5 callersMethodRuntimeLogs
(limit int, after int64)
internal/store/runtime_log.go:118
↓ 5 callersMethodSave
()
internal/store/store.go:1064
↓ 5 callersMethodSchedulerSchedule
(jobID string)
internal/store/scheduler.go:264
↓ 5 callersMethodUpsertTicket
---- Tickets ----
internal/store/store.go:2989
↓ 5 callersFunctionapplyThemeCustom
(tc: ThemeCustom)
webui/src/lib/theme-custom.ts:158
↓ 5 callersFunctionclampRuntimeLogLimit
(limit int)
internal/store/runtime_log.go:292
↓ 5 callersFunctioncommandExists
(name string)
internal/api/system_update.go:312
↓ 5 callersFunctionconfigFileSignature
(path string)
internal/api/app.go:547
↓ 5 callersFunctioncopyToClipboard
(text: string)
webui/src/app/(main)/admin/regcodes/page.tsx:332
↓ 5 callersFunctiondefaultErrorCode
(status int, success bool)
internal/api/response.go:72
↓ 5 callersFunctiondescribeTriggerSpec
(t: TFunc, spec: SchedulerTriggerSpec | undefined | null)
webui/src/app/(main)/admin/scheduler/page.tsx:134
↓ 5 callersMethodemailGateActive
emailGateActive 判定某用户是否处于"强制邮箱验证"约束下:邮箱子系统可用 + force_bind 开启 + 角色为普通/白名单。管理员不被强制(仅前端提示)。
internal/api/email_verify_service.go:262
↓ 5 callersFunctiongetThemeCustom
()
webui/src/lib/theme-custom.ts:127
↓ 5 callersMethodhandleInviteUse
(w http.ResponseWriter, r *http.Request, _ Params)
internal/api/invite_handlers.go:342
↓ 5 callersMethodinvalidateConfigSchemaCache
()
webui/src/lib/api.ts:127
↓ 5 callersMethodinviteCodeDTO
(code store.InviteCode)
internal/api/business.go:1061
↓ 5 callersMethodissueSessionCookies
(w http.ResponseWriter, sessionToken string, expires time.Time)
internal/api/app.go:1113
↓ 5 callersFunctionjoinInt64
(values []int64)
internal/api/business.go:644
↓ 5 callersFunctionmaskEmail
maskEmail 在响应里对邮箱做局部遮蔽(保留首尾少量字符),用于发码后的回显, 避免在共享屏幕 / 日志里完整暴露邮箱。
internal/api/email_handlers.go:18
↓ 5 callersFunctionmediaRequestUserDTO
(req store.MediaRequest)
internal/api/business.go:440
← previousnext →201–300 of 2,686, ranked by callers