MCPcopy Create free account

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

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

↓ 3 callersMethoddeveloperJSListUsers
(user *store.User, options any, logs *[]string)
internal/api/telegram_js_commands.go:1094
↓ 3 callersMethoddeveloperJSSetUserExpiry
(vm *goja.Runtime, actor *store.User, opts developerJSRunOptions, logs *[]string, uidValue goja.Value, expiryV
internal/api/telegram_js_commands.go:1224
↓ 3 callersMethoddeveloperJSUpdateUser
(vm *goja.Runtime, actor *store.User, opts developerJSRunOptions, logs *[]string, uidValue goja.Value, patch a
internal/api/telegram_js_commands.go:1330
↓ 3 callersFunctiondeviceKey
(uid int64, deviceID string)
internal/store/device.go:109
↓ 3 callersFunctiondoSubmit
()
webui/src/app/(auth)/register/page.tsx:330
↓ 3 callersFunctionemailCodeBody
(proof?: EmailCodeProof)
webui/src/lib/api.ts:108
↓ 3 callersMethodemailVerificationDTO
emailVerificationDTO 把一条在用验证码记录脱敏成管理员可见的审查 DTO: 永不下发 CodeHash(HMAC 摘要也不外泄),解析关联本地账号用户名,标注是否已过期。
internal/api/email_handlers.go:378
↓ 3 callersMethodemailVerificationRequired
emailVerificationRequired 表示该用户受强制约束但尚未验证邮箱,应被引导去验证、 并被价值型接口拒绝。
internal/api/email_verify_service.go:272
↓ 3 callersMethodembyAuthenticateByName
(ctx context.Context, username, password string)
internal/api/emby_client.go:130
↓ 3 callersMethodembyCapacityReached
(excludeUID int64)
internal/api/business.go:99
↓ 3 callersMethodembyHeaders
()
internal/api/emby_client.go:74
↓ 3 callersFunctionembyRemoteName
(user map[string]any)
internal/api/scheduler_runner.go:724
↓ 3 callersMethodembySetPassword
(ctx context.Context, userID, password string)
internal/api/emby.go:272
↓ 3 callersMethodembySetUserEnabled
(ctx context.Context, userID string, enabled bool)
internal/api/emby.go:345
↓ 3 callersFunctionembyShouldDisableForWebState
(u store.User)
internal/api/emby.go:392
↓ 3 callersFunctionescapeHtml
(value: string)
webui/src/components/js-code-editor.tsx:44
↓ 3 callersMethodexecuteSchedulerRun
(runCtx context.Context, run store.SchedulerRun, jobID, runType, trigger, requestPath string, started int64, p
internal/api/scheduler_daemon.go:208
↓ 3 callersFunctionfailWithCodeData
failWithCodeData 在 failWithCode 基础上允许返回 data(如 system_update 的 详细 results 列表)。其它路径请优先用 failWithCode;只有本身就需要把诊断 上下文一并下发的接口才使用本函数。
internal/api/response.go:113
↓ 3 callersFunctionformatBytes
(value?: number)
webui/src/app/(main)/admin/config/page.tsx:173
↓ 3 callersFunctionformatDuration
(startSec: number, endSec: number | null)
webui/src/app/(main)/admin/scheduler/page.tsx:63
↓ 3 callersFunctionformatIso
(value: string | null | undefined, locale: string)
webui/src/components/admin/emby-device-audit-panel.tsx:76
↓ 3 callersFunctionformatRunType
(t: TFunc, run?: SchedulerJobRun | null)
webui/src/app/(main)/admin/scheduler/page.tsx:103
↓ 3 callersFunctionformatTime
(unix: number)
webui/src/components/announcement-board.tsx:38
↓ 3 callersFunctionformatTime
(unix: number, locale: string)
webui/src/app/(main)/admin/announcements/page.tsx:91
↓ 3 callersFunctionformatUnix
(seconds: number | null | undefined, locale: string)
webui/src/app/(main)/admin/email/page.tsx:44
↓ 3 callersFunctionformatUnixTime
(value?: number)
webui/src/app/(main)/admin/database/page.tsx:52
↓ 3 callersMethodgetConfigSchema
()
webui/src/lib/api.ts:1281
↓ 3 callersMethodgetEmbyInfo
()
webui/src/lib/api.ts:779
↓ 3 callersMethodgetEmbyUrls
()
webui/src/lib/api.ts:615
↓ 3 callersMethodgetRuntimeLogs
(limit = 200, after?: number)
webui/src/lib/api.ts:1226
↓ 3 callersFunctionhandleOpenViewAll
(type: number, title: string)
webui/src/app/(main)/bangumi/page.tsx:147
↓ 3 callersMethodhandleSchedulerJobs
(w http.ResponseWriter, r *http.Request, _ Params)
internal/api/scheduler_handlers.go:30
↓ 3 callersFunctionhandleSyncBindings
(options: { uid?: number; currentFilter?: boolean } = {})
webui/src/app/(main)/admin/users/page.tsx:974
↓ 3 callersFunctionhexToRgb
(hex: string)
webui/src/lib/theme-custom.ts:66
↓ 3 callersFunctionhueToRgb
(t: number)
webui/src/lib/theme-custom.ts:53
↓ 3 callersFunctionint64Value
(value string, fallback int64)
internal/config/config.go:1415
↓ 3 callersMethodinviteCodeFormat
(explicit string)
internal/api/business.go:669
↓ 3 callersMethodinviteDescendantCount
(uid int64)
internal/api/business.go:1151
↓ 3 callersMethodinviteRootUID
(uid int64)
internal/api/business.go:1138
↓ 3 callersFunctionisActiveMediaStatus
(status string)
internal/store/store.go:4131
↓ 3 callersFunctionisCodeSelected
(code: string)
webui/src/app/(main)/admin/regcodes/page.tsx:531
↓ 3 callersFunctionisConfigValueChanged
(next: unknown, prev: unknown)
webui/src/app/(main)/admin/config/page.tsx:193
↓ 3 callersFunctionisSecretField
isSecretField 集中判定某个 section.field 是否应在响应里被遮蔽 / 在写入时被 preserve。configSectionDefs 已经声明了 Type=="secret",这里直接复用,避免在 多处重复维护"哪些字段是密钥"的清单。
internal/api/config_admin.go:33
↓ 3 callersFunctionisThrottleErrorCode
(code: string | undefined)
webui/src/lib/validators.ts:361
↓ 3 callersFunctionjobIsRunning
(job: SchedulerJobItem, running: Record<string, boolean>)
webui/src/app/(main)/admin/scheduler/page.tsx:599
↓ 3 callersMethodkey
()
scripts/check_docs_drift.go:67
↓ 3 callersFunctionloadViewAll
(type: number, offset: number, reset = false)
webui/src/app/(main)/bangumi/page.tsx:118
↓ 3 callersFunctionloginCookies
loginCookies 从已存在的账户登录,返回 session cookie 切片。 仅用于 inline 登录流程(不走注册 helper)。
internal/api/app_test.go:105
↓ 3 callersMethodmarkSchedulerRunTerminated
(runID int64)
internal/api/scheduler_daemon.go:514
↓ 3 callersMethodmatch
(method, requestPath string)
internal/api/app.go:671
↓ 3 callersMethodmediaDetail
(ctx context.Context, source, id, mediaType string)
internal/api/media_service.go:45
↓ 3 callersFunctionmediaRequestAdminDTO
(req store.MediaRequest, st *store.Store)
internal/api/business.go:475
↓ 3 callersFunctionmediaRequestExternalUrl
(req: MediaRequest)
webui/src/lib/media-external-url.ts:3
↓ 3 callersMethodmirrorEmbyDisabled
mirrorEmbyDisabled 仅在值变化时回写 EmbyDisabled,避免无谓写盘。
internal/api/emby.go:368
↓ 3 callersFunctionmustJSON
(value any)
internal/api/upload_handlers.go:158
↓ 3 callersFunctionnewSessionStoreWithDB
(ttl time.Duration, redisClient *redis.Client, st *store.Store)
internal/api/session.go:41
↓ 3 callersFunctionnormalizeBackupNote
(note string)
internal/store/store.go:1586
↓ 3 callersFunctionnormalizeCommand
(value: string)
webui/src/app/(main)/admin/telegram/commands/page.tsx:62
↓ 3 callersFunctionnormalizeHexColor
(value: string)
webui/src/components/theme-customizer.tsx:22
↓ 3 callersFunctionnormalizeHexColor
(value: unknown, fallback: string)
webui/src/lib/theme-custom.ts:35
↓ 3 callersFunctionnormalizeInventoryMediaType
(value string)
internal/api/emby_inventory.go:231
↓ 3 callersFunctionnormalizeLocale
(value?: string | null)
webui/src/lib/i18n.tsx:64
↓ 3 callersFunctionnormalizeLogLevel
(value string)
internal/config/config.go:1455
↓ 3 callersFunctionnormalizeMediaRequestStatus
(status?: string | null, mode: MediaRequestStatusMode = "user")
webui/src/lib/media-status.ts:21
↓ 3 callersFunctionnormalizeThemeCustom
(partial: Partial<ThemeCustom>)
webui/src/lib/theme-custom.ts:108
↓ 3 callersFunctionopenPreparedPostgres
(ctx context.Context, dsn string)
internal/store/store.go:750
↓ 3 callersFunctionparseEmbyTime
parseEmbyTime 解析 Emby 返回的时间戳(ISO8601,常见为带小数秒的 UTC,也可能带时区 偏移)。解析失败返回零值 + false,调用方据此跳过该条,不影响其余审查数据。
internal/api/emby_device_audit.go:31
↓ 3 callersFunctionparseLinesList
(parts []string)
internal/config/config.go:1605
↓ 3 callersFunctionparseRemoteIP
parseRemoteIP 从 Emby RemoteEndPoint 中提取纯 IP。Emby 的 RemoteEndPoint 常见 形态是 "IP:port"(IPv6 形如 "[::1]:port"),偶尔是裸 IP。旧实现把整段原样当作 IP 下发,结果前端 IP 列显示成 "1.2.3.
internal/api/emby_device_audit.go:49
↓ 3 callersMethodpersistTicketTypesFromStore
()
internal/api/ticket_handlers.go:693
↓ 3 callersFunctionpostJSONWithTimeout
(ctx context.Context, endpoint string, headers map[string]string, body any, dst any, timeout time.Duration)
internal/api/http_json_client.go:89
↓ 3 callersFunctionpublicAPIKey
(k store.APIKey, plain string)
internal/api/apikey_handlers.go:193
↓ 3 callersFunctionrawToStringList
(raw any)
internal/config/config.go:1290
↓ 3 callersMethodrebuildTelegramIDIndex
rebuildTelegramIDIndex 从当前 Users map 重建 telegramID → UID 索引。 在 Open / OpenPostgres 加载 state 后调用,无需持锁(调用方已持有写锁或尚未暴露引用)。
internal/store/store.go:2443
↓ 3 callersFunctionrefreshTypeMgmtTypes
()
webui/src/app/(main)/admin/tickets/page.tsx:76
↓ 3 callersFunctionregcodeDTO
(code store.RegCode)
internal/api/business.go:536
↓ 3 callersMethodremoveTicketAttachmentDir
removeTicketAttachmentDir 删除某工单的整个图片目录。删除失败仅记日志。
internal/api/ticket_handlers.go:307
↓ 3 callersFunctionrenderStatusItem
(flag: boolean | undefined, label: string)
webui/src/app/(main)/admin/test/page.tsx:96
↓ 3 callersFunctionrenderSummaryChips
(t: TFunc, summary: SchedulerJobRun["summary"])
webui/src/app/(main)/admin/scheduler/page.tsx:108
↓ 3 callersFunctionrequireAdminForUIDParam
requireAdminForUIDParam 用于"AuthUser / AuthAdmin 共用 handler,路径上有 :uid 时必须是 admin"的场景:在 :uid 存在但 caller 不是 admin 的情况下回 403。返回 (target uid, written 403);
internal/api/app.go:1497
↓ 3 callersFunctionrequireWebUIIntent
(w http.ResponseWriter, r *http.Request, intent string)
internal/api/app.go:909
↓ 3 callersFunctionresetEmailBind
()
webui/src/app/(main)/settings/page.tsx:160
↓ 3 callersMethodresponse
()
internal/api/telegram_bind_status.go:174
↓ 3 callersFunctionrewritePostgresDatabaseInDSN
(dsn, database string)
internal/store/store.go:628
↓ 3 callersFunctionsafeAnnouncementRenderMode
(mode string)
internal/api/announcement_handlers.go:81
↓ 3 callersFunctionsanitizeBackgroundCSSValue
(value string)
internal/api/upload_handlers.go:121
↓ 3 callersFunctionsanitizeExternalUrl
(url?: string | null)
webui/src/lib/safe-url.ts:15
↓ 3 callersMethodschedulerRuntimeParamsFromSchedule
(jobID string, stored map[string]any)
internal/api/scheduler_handlers.go:168
↓ 3 callersFunctionschedulerTriggerDisabled
(spec map[string]any)
internal/api/scheduler_daemon.go:351
↓ 3 callersFunctionsend
()
webui/src/components/email-code-input.tsx:38
↓ 3 callersMethodsendExpiryReminders
(ctx context.Context, days int)
internal/api/scheduler_runner.go:25
↓ 3 callersFunctionsensitiveLogKey
(key string)
internal/api/runtime_logs.go:454
↓ 3 callersFunctionsetCacheHeader
(w http.ResponseWriter)
internal/api/upload_handlers.go:584
↓ 3 callersFunctionsetupIntentHeaders
()
internal/api/setup_handlers_test.go:53
↓ 3 callersMethodsetupStatusData
()
internal/api/setup_handlers.go:145
↓ 3 callersFunctionsetupStatusFromRecorder
(t *testing.T, rrBody string)
internal/api/setup_handlers_test.go:60
↓ 3 callersFunctionsigninDailyMin
(cfg config.Config)
internal/api/signin_handlers.go:210
↓ 3 callersFunctionsigninRenewalPayload
(cfg config.Config, points int)
internal/api/signin_handlers.go:229
↓ 3 callersFunctionsmtpDeliver
smtpDeliver 用 go-mail 按加密方式投递一封纯文本邮件。所有参数显式传入,不依赖 全局配置;错误经 redactSensitiveText 脱敏后返回,避免把 SMTP 凭据 / 连接串泄露 到上层响应或日志。
internal/api/email_client.go:34
↓ 3 callersMethodsnapshotStateLocked
snapshotStateLocked 把当前 s.state 序列化再反序列化得到一份独立副本, 用于 mutateAndSaveLocked 的回滚。State 内大量 map/slice 是引用类型, 浅拷贝不能隔离后续修改;JSON 往返一次比 reflect.DeepCopy 简单且与 已
internal/store/store.go:1074
← previousnext →501–600 of 2,686, ranked by callers