MCPcopy Create free account

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

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

↓ 4 callersMethodgetSigninSummary
()
webui/src/lib/api.ts:649
↓ 4 callersFunctiongetTypeBadge
(type: number)
webui/src/app/(main)/admin/regcodes/page.tsx:634
↓ 4 callersFunctiongitRepositoryState
(ctx context.Context, cwd string)
internal/api/system_update.go:225
↓ 4 callersFunctionhandleBgChange
(field: keyof BackgroundConfig, value: string)
webui/src/app/(main)/settings/appearance/page.tsx:185
↓ 4 callersMethodhandleCreateInviteCode
(w http.ResponseWriter, r *http.Request, _ Params)
internal/api/invite_handlers.go:60
↓ 4 callersFunctionhandleOpenEdit
(item: any)
webui/src/app/(main)/bangumi/page.tsx:157
↓ 4 callersMethodhandleUnbindEmby
(w http.ResponseWriter, r *http.Request, _ Params)
internal/api/handlers.go:420
↓ 4 callersFunctionhasAuditAction
(app *App, action string)
internal/api/developer_sandbox_test.go:757
↓ 4 callersFunctionhashAPIKey
(key string)
internal/api/app.go:1459
↓ 4 callersFunctionint64Value
(payload map[string]any, key string, fallback int64)
internal/api/announcement_handlers.go:90
↓ 4 callersFunctioninviteChildCanDeleteEmbyAndDetach
(child store.User, now int64)
internal/api/invite_handlers.go:289
↓ 4 callersFunctioninviteChildEmbyExpired
(child store.User, now int64)
internal/api/invite_handlers.go:285
↓ 4 callersFunctionisAbortError
(error: unknown)
webui/src/app/(main)/media/page.tsx:113
↓ 4 callersFunctionisPermanentDateValue
(date: string | Date | number | null | undefined)
webui/src/lib/utils.ts:34
↓ 4 callersFunctionisPositiveNumericID
(id string)
internal/api/media_service.go:63
↓ 4 callersMethodissueEmailCode
issueEmailCode 校验邮箱、限流、冷却,生成并投递验证码、落库。返回 (verificationID, httpStatus, errCode, message),成功时 errCode 为空、status=200。 校验顺序为先廉价校验(格式/名单)后限流后冷却,最后才发信,避免无谓投
internal/api/email_verify_service.go:124
↓ 4 callersMethodlimiter
()
internal/api/app.go:131
↓ 4 callersFunctionlocalizedEntry
(locale: TextLocale, row: DeveloperJSDocEntry)
webui/src/components/developer-js-docs-panel.tsx:896
↓ 4 callersFunctionnormalizeBackgroundImageValue
(raw?: string | null)
webui/src/lib/safe-url.ts:78
↓ 4 callersFunctionnormalizeTMDBMediaType
(mediaType string)
internal/api/media_service.go:72
↓ 4 callersFunctionopenStore
(ctx context.Context, cfg config.Config)
cmd/twilight/main.go:344
↓ 4 callersFunctionpad
(n: number)
webui/src/app/(main)/admin/announcements/page.tsx:99
↓ 4 callersFunctionpickEnv
(...keys: string[])
webui/src/app/layout.tsx:23
↓ 4 callersFunctionquickStatus
(ticket: Ticket, status: string)
webui/src/app/(main)/admin/tickets/page.tsx:141
↓ 4 callersFunctionrawToString
(raw any)
internal/config/config.go:1167
↓ 4 callersMethodreconcileSchedulerRunState
(jobID string, running bool, now time.Time)
internal/api/scheduler_handlers.go:228
↓ 4 callersMethodregcodeDTO
(code store.RegCode)
internal/api/business.go:584
↓ 4 callersFunctionregcodeStatus
(code store.RegCode)
internal/api/business.go:516
↓ 4 callersFunctionregcodeTypeName
(codeType int)
internal/api/business.go:503
↓ 4 callersMethodreloadConfigIfChanged
()
internal/api/app.go:520
↓ 4 callersFunctionremainingUseSlots
(used, limit int)
internal/api/business.go:148
↓ 4 callersFunctionrenderInline
(text: string, keyPrefix: string)
webui/src/lib/safe-render.tsx:30
↓ 4 callersFunctionreplaceNotifPlaceholders
replaceNotifPlaceholders 替换通知模板中的占位符。
internal/api/auth_handlers.go:584
↓ 4 callersFunctionrowID
()
webui/src/app/(main)/admin/telegram/commands/page.tsx:58
↓ 4 callersFunctionrunGitOutput
(ctx context.Context, cwd string, timeout time.Duration, args ...string)
internal/api/system_update.go:250
↓ 4 callersFunctionrunUpdateCommand
(ctx context.Context, cwd string, args []string, timeout time.Duration)
internal/api/system_update.go:202
↓ 4 callersFunctionsameStringSlice
sameStringSlice 判断两个 string 切片在元素 + 顺序意义上完全相同。 reload 时仅当 CORS 配置实际变化才重跑 validateCORSOriginsStartup, 避免每次 hot reload 都刷一条 Info 日志。
internal/api/app.go:1053
↓ 4 callersMethodschedulerDefaultRuntimeParams
(jobID string)
internal/api/scheduler_handlers.go:143
↓ 4 callersMethodschedulerDefaultTriggerSpec
(jobID string)
internal/api/scheduler_daemon.go:391
↓ 4 callersFunctionschedulerJobExists
(jobID string)
internal/api/business.go:1440
↓ 4 callersFunctionsigninCurrencyName
(cfg config.Config)
internal/api/signin_handlers.go:152
↓ 4 callersFunctionstrconv36
(v int64)
internal/store/store.go:4447
↓ 4 callersMethodtelegramEditPanel
(ctx context.Context, panel telegramPanelContext)
internal/api/telegram_inline.go:482
↓ 4 callersMethodtelegramGroupUserPanelTextForChat
(ctx context.Context, chatID int64, u store.User)
internal/api/telegram_inline.go:505
↓ 4 callersFunctiontelegramInlineKeyboard
(rows [][]telegramInlineButton)
internal/api/telegram_inline.go:984
↓ 4 callersFunctiontelegramRetryAfterFromError
telegramRetryAfterFromError 从 telegram 错误字符串里反解出 retry_after 秒数。 找不到时第二个返回值 false,调用方走原有 fallback 行为。
internal/api/telegram.go:530
↓ 4 callersMethodtelegramRunJSCustomCommandWithContext
(ctx context.Context, code string, c telegramCommandCtx, privateChat bool)
internal/api/telegram_js_commands.go:116
↓ 4 callersFunctionticketHasAttachment
(ticket store.Ticket, filename string)
internal/api/ticket_handlers.go:534
↓ 4 callersFunctiontoBool
(value any)
internal/api/business.go:1002
↓ 4 callersFunctiontomlSectionFieldFromLine
历史说明:早期存在一个 values 维度的 restoreConfigSecretSentinels(在解析后的 map 上还原哨兵),但 raw TOML PUT 走的是文本路径(saveConfigContent 接收原始 TOML 字符串,不经过 values 往返),因此哨兵还原必须在文本
internal/api/config_admin.go:75
↓ 4 callersFunctionusedCount
(code: Regcode)
webui/src/app/(main)/admin/regcodes/page.tsx:689
↓ 4 callersMethoduserCanSelfUnbindEmby
(u store.User)
internal/api/business.go:262
↓ 4 callersFunctionuserKey
(u: EmbyAuditUser, index: number)
webui/src/components/admin/emby-device-audit-panel.tsx:82
↓ 4 callersFunctionusersSummary
(users []store.User)
internal/api/admin_extra.go:1045
↓ 4 callersFunctionvalidRegcodeTargetUsername
(username string)
internal/api/regcode_handlers.go:254
↓ 4 callersMethodvalidatedEmbyEndpoint
validatedEmbyEndpoint 校验 cfg.EmbyURL 后返回拼接好的目标 URL。任何 不可信 scheme(非 http/https)、空 host、解析为 loopback / link-local / 私有 / 元数据 IP 的目标会立即报错,避免 admin 误配 / 被
internal/api/emby_client.go:38
↓ 4 callersFunctionvalueOrNil
(ok bool, value bool)
internal/api/telegram_js_commands.go:1628
↓ 4 callersFunctionwriteFileAtomicSync
writeFileAtomicSync 把 data 原子地写入 path:tmp 写完先 fsync 文件, 关闭后 rename,再 fsync 父目录。任一步失败清理 tmp 后返回 error。 saveLocked / BackupWithNote / writeBackupNote /
internal/store/store.go:1537
↓ 4 callersFunctionwriteJSONWithCode
writeJSONWithCode 在 writeJSON 基础上允许传入业务级 error_code(见 errcode.go)。 当 errorCode 为空时回落到按 HTTP status 自动推导(defaultErrorCode)。
internal/api/response.go:24
↓ 3 callersMethodAddPlaybackRecord
(record PlaybackRecord)
internal/store/playback.go:7
↓ 3 callersMethodAddRuntimeLog
(entry RuntimeLogEntry, limit int)
internal/store/runtime_log.go:42
↓ 3 callersMethodAuditLogCount
AuditLogCount 返回当前审计日志总数。
internal/store/store.go:4317
↓ 3 callersMethodCleanupExpiredEmailVerifications
CleanupExpiredEmailVerifications 清理过期验证码,由调度任务周期调用。
internal/store/email_verification.go:175
↓ 3 callersMethodConsumeRebindRequest
ConsumeRebindRequest marks an approved rebind request as "used" so it cannot be reused to bypass force-bind policy again. Called after the user succes
internal/store/store.go:3920
↓ 3 callersMethodCreateAPIKey
(k APIKey)
internal/store/store.go:2488
↓ 3 callersMethodCreateRebindRequest
(req RebindRequest)
internal/store/store.go:3824
↓ 3 callersMethodDel
(ctx context.Context, key string)
internal/redis/redis.go:112
↓ 3 callersMethodDeveloperJSPreset
(id int64)
internal/store/store.go:2952
↓ 3 callersMethodLastSchedulerRunByType
LastSchedulerRunByType 返回 (jobID, runType) 命中的最新一条 SchedulerRun(按 StartedAt 取大者,处理乱序记录)。该方法**不**走 SchedulerRuns 的 20 条窗 口——cron_daily 任务的"今天是否已经自动跑过"判
internal/store/scheduler.go:175
↓ 3 callersMethodLoadSnapshot
(data []byte)
internal/store/store.go:1333
↓ 3 callersMethodMarkTelegramRosterLeft
(chatID string, telegramID int64, status string)
internal/store/store.go:3998
↓ 3 callersFunctionOpenPostgres
(ctx context.Context, dsn string)
internal/store/store.go:544
↓ 3 callersFunctionResolveBackupPath
(dir, name string)
internal/store/store.go:1600
↓ 3 callersMethodReviewRebindRequest
(id, reviewerUID int64, status, note string)
internal/store/store.go:3872
↓ 3 callersMethodRuntimeLogStats
()
internal/store/runtime_log.go:173
↓ 3 callersMethodSetEX
(ctx context.Context, key string, seconds int, value string)
internal/redis/redis.go:107
↓ 3 callersMethodSetSchedulerSchedule
(jobID string, spec map[string]any, custom bool)
internal/store/scheduler.go:197
↓ 3 callersMethodSignin
最多保留 730 条签到记录(约 2 年),超出的旧记录自动裁剪
internal/store/signin.go:8
↓ 3 callersMethodSnapshot
()
internal/store/store.go:1261
↓ 3 callersMethodUpdateAPIKey
(uid, id int64, fn func(*APIKey) error)
internal/store/store.go:2550
↓ 3 callersMethodUpsertAnnouncement
(a Announcement)
internal/store/store.go:2858
↓ 3 callersMethodadminUpdateAnnouncement
(id: number, payload: { title?: string; content?: string; level?: 'info' | 'notice' | 'warning' |
webui/src/lib/api.ts:2335
↓ 3 callersFunctionapiRequest
( endpoint: string, options: RequestInit = {}, extra: ApiRequestExtraOptions = {}, )
webui/src/lib/api-request.ts:267
↓ 3 callersMethodargString
argString 把 Args 拼成单个查询字符串(多关键词以空格分隔), 等价于过去 strings.Join(fields[1:], " ") 的写法。
internal/api/telegram_commands.go:43
↓ 3 callersFunctionclampRuntimeLogReadLimit
(limit int)
internal/store/runtime_log.go:282
↓ 3 callersFunctionclientFilterValue
(name: string)
webui/src/components/admin/emby-device-audit-panel.tsx:56
↓ 3 callersFunctioncloneZapFields
(fields []zapcore.Field)
internal/api/runtime_logs.go:358
↓ 3 callersFunctioncloseDepthPrompt
(value: string | null)
webui/src/app/(main)/admin/invite/page.tsx:209
↓ 3 callersMethodcompleteEmbyRegistration
(embyUsername: string, embyPassword: string)
webui/src/lib/api.ts:493
↓ 3 callersMethodconfigure
(st *store.Store, limit int)
internal/api/runtime_logs.go:69
↓ 3 callersMethodconfiguredServerIconPath
()
internal/api/handlers.go:1354
↓ 3 callersMethodconfirmBindCodeAtomic
(code string, telegramID int64, telegramUsername string, now int64)
internal/api/telegram_bind_status.go:150
↓ 3 callersFunctionconstantTimeStringEqual
constantTimeStringEqual 在 ConstantTimeCompare 基础上消除 length-mismatch 提前 return 0 引入的 timing oracle:先把两侧 zero-pad 到相同长度再比对, 然后 AND 上长度等价位。即便攻击者通过响应时延区分"
internal/api/bangumi_webhook.go:148
↓ 3 callersFunctioncountOf
(result: DatabaseMigrationResult | null, key: string)
webui/src/app/(main)/admin/database/page.tsx:57
↓ 3 callersFunctiondatabaseBackupInfo
(path string)
internal/api/database_admin.go:417
↓ 3 callersMethoddatabaseMismatchWarning
()
internal/api/storage_guard.go:59
↓ 3 callersMethoddeleteUserScoped
* 扩展用户删除:支持邀请树级联,且三种 mode 均可级联。 * - mode = with_emby:本地 + Emby * - mode = local_only:仅本地(保留 Emby) * - mode = emby_only:仅 Emby(保留本地与树关系) *
webui/src/lib/api.ts:2469
↓ 3 callersMethoddeveloperJSCreateAnnouncement
developerJSCreateAnnouncement mirrors handleCreateAnnouncement: admin-gated, preview-aware and audited. Render mode is normalized to the safe subset.
internal/api/telegram_js_generators.go:347
↓ 3 callersMethoddeveloperJSGenerateInviteCode
developerJSGenerateInviteCode mirrors handleCreateInviteCode for admins, honoring the InviteEnabled feature gate, day caps, collision detection, previ
internal/api/telegram_js_generators.go:242
↓ 3 callersMethoddeveloperJSGenerateRegcode
developerJSGenerateRegcode mirrors handleCreateRegcodes: admin-gated, validated, collision-checked, preview-aware (dry-run) and audited. Returns a res
internal/api/telegram_js_generators.go:87
← previousnext →401–500 of 2,686, ranked by callers