MCPcopy Create free account

hub / github.com/KunMoe/kun-galgame-patch / functions

Functions1,135 in github.com/KunMoe/kun-galgame-patch

↓ 3 callersFunctiongetEnvProd
getEnvProd returns the env var if set; otherwise it panics in prod mode (fail-fast — no silent dev-default fallback for things that must be configured
apps/api/pkg/config/config.go:190
↓ 3 callersFunctiongetMessageIDParam
(c fiber.Ctx)
apps/api/internal/chat/handler/handler.go:168
↓ 3 callersFunctiongetOAuthCookie
(name: string)
apps/web/app/shared/utils/pkce.ts:45
↓ 3 callersFunctionhikariOriginAllowed
(origin string)
apps/api/internal/middleware/cors.go:68
↓ 3 callersFunctionmapArtifactErr
mapArtifactErr translates artifact client sentinels into user-facing messages.
apps/api/internal/common/upload/service.go:266
↓ 3 callersFunctionnameOf
nameOf strips the "<category>/" prefix to recover the within-category name.
apps/api/internal/doc/service/service.go:444
↓ 3 callersMethodnotifyContentInteraction
notifyContentInteraction creates a "someone liked / favorited your content" notification. msgType distinguishes the interaction so the message center
apps/api/internal/patch/service/service.go:1682
↓ 3 callersFunctionptr
(v T)
apps/api/internal/common/upload/service.go:50
↓ 3 callersFunctionputToS3
( url: string, body: Blob, onProgress: (delta: number) => void )
apps/web/app/composables/useResourceUpload.ts:152
↓ 3 callersFunctionsetOAuthCookie
(name: string, value: string)
apps/web/app/shared/utils/pkce.ts:40
↓ 3 callersFunctionsetOpen
(value: boolean)
apps/web/app/composables/useKunDisclosure.ts:26
↓ 3 callersFunctionsetToSlice
(s map[string]bool)
apps/api/internal/patch/repository/repository.go:496
↓ 3 callersFunctiontoIso
(d: unknown)
apps/web/server/utils/kunSitemapSources.ts:55
↓ 3 callersFunctiontruncate
(s string, n int)
apps/api/pkg/imageclient/client.go:398
↓ 3 callersFunctiontruncate
(s string, n int)
apps/api/internal/auth/service/service.go:349
↓ 3 callersFunctionunwrap
(json: unknown)
apps/web/server/utils/kunSitemapSources.ts:52
↓ 3 callersFunctionwikiPathFromRequest
wikiPathFromRequest turns the incoming original URL into the Wiki path, preserving exact path/query encoding. c.OriginalURL() keeps the raw, undecoded
apps/api/internal/patch/handler/galgame_edit.go:40
↓ 3 callersFunctionwrite
(items: PatchPendingUpload[])
apps/web/app/composables/useResourceResumeUploads.ts:24
↓ 3 callersMethodwriteUserJSON
─── shared write helpers ──────────────────────────────
apps/api/internal/galgame/client/submission.go:403
↓ 3 callersFunctionwriteWikiNotificationRaw
(tx *gorm.DB, m *galgameClient.WikiMessage, text string)
apps/api/internal/infrastructure/cron/wiki_sync.go:246
↓ 2 callersFunctionCardFromBrief
CardFromBrief builds a GalgameCard from a Wiki brief alone (no local patch row). All moyu-side stats stay zero — used when enriching Wiki responses (t
apps/api/internal/galgame/enricher/enricher.go:539
↓ 2 callersMethodCompleteUpload
(ctx context.Context, uuid string, body CompleteUploadJSONRequestBody, reqEditors ...RequestEditorFn)
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:262
↓ 2 callersMethodCreateCommentNotification
(senderID int, comment *model.PatchComment)
apps/api/internal/patch/service/service.go:1579
↓ 2 callersMethodCreateMentionMessages
CreateMentionMessages notifies every @mentioned user. commentID is the comment carrying the mention, so the notification deep-links straight to it (/p
apps/api/internal/patch/service/service.go:1565
↓ 2 callersMethodDownload
Download returns a download URL (presigned GET, or a Worker URL for public artifacts on a site with a CDN base configured).
apps/api/pkg/artifactclient/client.go:242
↓ 2 callersMethodEnsureContributor
(userID, patchID int)
apps/api/internal/patch/repository/repository.go:413
↓ 2 callersMethodExtractMentionUserIDs
===== Mention detection ===== ExtractMentionUserIDs delegates to the markdown package so the regex used for notification routing matches exactly what
apps/api/internal/patch/service/service.go:1490
↓ 2 callersMethodFindFavorite
===== Favorites =====
apps/api/internal/patch/repository/repository.go:385
↓ 2 callersMethodFindFollow
===== Follow =====
apps/api/internal/user/repository/repository.go:139
↓ 2 callersMethodFindResourceFavorite
===== Resource Favorites (per-resource subscription) =====
apps/api/internal/patch/repository/repository.go:369
↓ 2 callersMethodFindRoomByLink
─── Room ─────────────────────────────────────────── FindRoomByLink looks up a room by its link.
apps/api/internal/chat/repository/repository.go:24
↓ 2 callersMethodFindUserByID
FindUserByID looks up the local user row by id. The id should equal OAuth.users.id (aligned by migrate-users) and is taken from oauth/userinfo's `id`
apps/api/internal/auth/repository/repository.go:24
↓ 2 callersMethodGetCommentPatchID
GetCommentPatchID returns the comment's owning patch.id so the handler can NSFW-gate it before serving the markdown body.
apps/api/internal/patch/service/service.go:803
↓ 2 callersFunctionGetRoles
GetRoles returns the OAuth roles for the current request, or an empty slice if no session is attached. Roles come from the access_token JWT roles clai
apps/api/internal/middleware/auth.go:298
↓ 2 callersMethodGetSetting
===== Settings ===== Source of truth is the site_setting table via settingService (durable + audited), NOT Redis. SetSetting records the acting admin
apps/api/internal/admin/service/service.go:208
↓ 2 callersMethodInitUpload
(ctx context.Context, body InitUploadJSONRequestBody, reqEditors ...RequestEditorFn)
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:251
↓ 2 callersMethodIsMember
IsMember reports whether a user is a member of a given room.
apps/api/internal/chat/repository/repository.go:76
↓ 2 callersMethodLookupPatchesByIDs
(ids []int)
apps/api/internal/galgame/enricher/enricher.go:277
↓ 2 callersMethodMainURL
MainURL builds the canonical CDN URL for the full image (`.webp`). Returns "" for empty / malformed hashes — caller can fall back to a placeholder.
apps/api/pkg/imageclient/client.go:366
↓ 2 callersFunctionNewCompleteUploadRequestWithBody
NewCompleteUploadRequestWithBody generates requests for CompleteUpload with any type of body
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:550
↓ 2 callersFunctionNewInitUploadRequestWithBody
NewInitUploadRequestWithBody generates requests for InitUpload with any type of body
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:442
↓ 2 callersFunctionParseCompleteUploadResp
ParseCompleteUploadResp parses an HTTP response from a CompleteUploadWithResponse call
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:1074
↓ 2 callersFunctionParseInitUploadResp
ParseInitUploadResp parses an HTTP response from a InitUploadWithResponse call
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:975
↓ 2 callersFunctionSanitize
Sanitize runs the shared allow-list over already-rendered HTML. Exposed so the render entry points (Render / RenderWithTOC) share one boundary.
apps/api/internal/infrastructure/markdown/sanitize.go:20
↓ 2 callersMethodSetSetting
(key string, enabled bool, adminUID int)
apps/api/internal/admin/service/service.go:212
↓ 2 callersMethodSubmitGalgame
===== Wiki submission proxies (docs/galgame_wiki/07-submission.md) ===== Each endpoint is a thin pass-through to Wiki: extract the user's access_toke
apps/api/internal/patch/handler/handler.go:944
↓ 2 callersMethodUpdateGalgame
UpdateGalgame PUT /api/v1/galgame/:gid Thin proxy over the Wiki Service's PUT /galgame/:gid. Two modes: - application/json -> forwards the JSON bod
apps/api/internal/patch/handler/handler.go:827
↓ 2 callersMethodapplyCommentSideEffects
applyCommentSideEffects runs the once-per-visible-comment bookkeeping: bump the patch's comment_count, award the owner +1 moemoepoint (unless they aut
apps/api/internal/patch/service/service.go:660
↓ 2 callersFunctionapplyFollowCountsTx
applyFollowCountsTx applies the +/-delta to following_count (follower) and follower_count (followee) within the given tx. GREATEST clamps at 0.
apps/api/internal/user/repository/repository.go:181
↓ 2 callersMethodattachCommentUsers
(ctx context.Context, cs []patchModel.PatchComment)
apps/api/internal/common/handler.go:61
↓ 2 callersMethodattachGalgameNames
attachGalgameNames batch-resolves the multilingual game name (from each game-scoped message's /patch/<id> link) and stamps msg.GalgameName, so the fro
apps/api/internal/message/handler/handler.go:48
↓ 2 callersMethodattachPatchSummaries
attachPatchSummaries stamps the `Patch` field on each resource and each comment in one Wiki batch call (name + banner come from the Wiki Service). Eit
apps/api/internal/user/service/service.go:59
↓ 2 callersMethodattachPatchSummaries
attachPatchSummaries fills the owning-galgame summary (name / banner / vndb_id) on comment / resource rows so the admin UI can show the game's NAME in
apps/api/internal/admin/handler/handler.go:68
↓ 2 callersMethodattachSenders
attachSenders batch-resolves sender briefs from OAuth /users/batch and stamps msg.Sender. Without this every message serialized with sender=nil, and t
apps/api/internal/message/handler/handler.go:104
↓ 2 callersFunctionbase64UrlEncode
(input: Uint8Array)
apps/web/app/shared/utils/pkce.ts:3
↓ 2 callersMethodbriefsToFollowItems
briefsToFollowItems is briefsToUserBasic + per-row is_followed stamp. One follow-set lookup covers the whole page.
apps/api/internal/user/service/service.go:202
↓ 2 callersFunctionbuildImageServiceURL
(hash: string, variant?: string)
apps/web/app/shared/utils/resolveBannerUrl.ts:41
↓ 2 callersMethodcheck
()
apps/api/internal/infrastructure/storage/s3.go:92
↓ 2 callersFunctionclearSessionCookie
clearSessionCookie wipes the kun_session cookie on the response. Used when we reject a request because the upstream OAuth refresh permanently failed -
apps/api/internal/middleware/auth.go:651
↓ 2 callersFunctionclose
()
apps/web/app/composables/useAuthModal.ts:18
↓ 2 callersMethodcomposeMe
composeMe merges the local user row with the OAuth brief (name/avatar/bio) into a MeResponse. If the OAuth /users/batch call fails we still return the
apps/api/internal/auth/handler/handler.go:219
↓ 2 callersFunctioncomposeSlug
composeSlug builds the stored "<category>/<name>" slug from its parts.
apps/api/internal/doc/service/service.go:439
↓ 2 callersMethodcreatePatchRow
createPatchRow is the shared register-a-carrier body for both entrypoints: idempotent dedup by id (= galgame_id), mirror the Wiki release_date, then o
apps/api/internal/patch/service/service.go:127
↓ 2 callersMethodcreatorApplicationReq
(req *http.Request)
apps/api/pkg/userclient/client.go:337
↓ 2 callersMethodcreatorEligibility
(ctx context.Context, userID int)
apps/api/internal/user/service/creator.go:34
↓ 2 callersFunctiondecodeJWTRoles
decodeJWTRoles extracts the `roles` claim from a JWT without verifying the signature. Safe here because the token came out of our Redis session (place
apps/api/internal/middleware/auth.go:446
↓ 2 callersFunctiondestroySpoilerAnimation
(spoilerEl: HTMLElement)
apps/web/app/composables/topic/useSpoilerContent.ts:39
↓ 2 callersMethoddoEnvelope
doEnvelope executes req, decodes the standard {code,message,data} envelope and returns the raw `data` (so the handler can re-wrap without an extra unm
apps/api/internal/galgame/client/editing.go:113
↓ 2 callersMethodenrichMessages
enrichMessages fills ContentHTML (rendered markdown), Reaction[] (with the reacting users' briefs) and QuoteMessage (the replied-to message preview) f
apps/api/internal/chat/handler/handler.go:79
↓ 2 callersFunctionensureLoaded
(accounts: Ref<KnownAccount[]>)
apps/web/app/composables/useKnownAccounts.ts:50
↓ 2 callersFunctionhandleAuthExpiry
(code: number)
apps/web/app/composables/useApi.ts:159
↓ 2 callersFunctionhikariFail
hikariFail writes the legacy error envelope ({success:false, data:null}).
apps/api/internal/common/handler.go:623
↓ 2 callersFunctionlcsDiff
(a: T[], b: T[], eq: (x: T, y: T) => boolean)
apps/web/app/utils/lcs-diff.ts:50
↓ 2 callersMethodlistMetadata
(docs []model.Doc)
apps/api/internal/doc/service/service.go:152
↓ 2 callersFunctionnewRenderContext
newRenderContext builds the parser context shared by Render / RenderWithTOC: CJK-friendly heading IDs plus (when a meta resolver is wired) the content
apps/api/internal/infrastructure/markdown/markdown.go:162
↓ 2 callersFunctionnum
(row: Record<string, unknown>, key: string)
apps/web/server/utils/kunSitemapSources.ts:63
↓ 2 callersMethodoauthPostJSON
oauthPostJSON POSTs JSON to the OAuth server and decodes the wrapped {code, message, data} envelope into out (when not nil). A non-zero envelope code
apps/api/internal/auth/service/service.go:286
↓ 2 callersFunctionparseDeleteReason
parseDeleteReason reads an OPTIONAL moderation reason from the request body ({"reason":"..."}) sent when a mod/admin deletes someone else's content fr
apps/api/internal/patch/handler/handler.go:410
↓ 2 callersFunctionparseDocDate
parseDocDate tolerantly parses a doc's display date (e.g. "2025-6-18"). Unparseable values return the zero time so they sort last.
apps/api/internal/doc/service/service.go:140
↓ 2 callersFunctionparseGalgameMultipart
parseGalgameMultipart is shared between SubmitGalgame and PatchGalgameDraft. Returns the JSON body, the file name / bytes / mime if present, or an App
apps/api/internal/patch/handler/handler.go:1220
↓ 2 callersFunctionparseRef
parseRef splits a "type:id" moemoepoint ref (e.g. "comment:42") into its kind and numeric id; id is 0 when absent / unparseable.
apps/api/internal/user/service/service.go:347
↓ 2 callersFunctionparseSet
(csv string)
apps/api/cmd/migrate/main.go:111
↓ 2 callersFunctionpayloadString
payloadString pulls a scalar string field out of the Wiki message payload JSON. Returns "" when missing or wrong-typed (no error — payload fields are
apps/api/internal/infrastructure/cron/wiki_sync.go:264
↓ 2 callersFunctionprepareAuthorizeUrl
( opts: AuthorizeOptions = {} )
apps/web/app/shared/utils/pkce.ts:77
↓ 2 callersMethodproxyUserOAuth
proxyUserOAuth is the shared helper for the display-layer proxies. Pulls access_token from session, forwards body + content-type to the OAuth endpoint
apps/api/internal/auth/handler/handler.go:196
↓ 2 callersFunctionputParts
( file: File, partSize: number, parts: InitPart[], baseCommittedBytes: number )
apps/web/app/composables/useResourceUpload.ts:194
↓ 2 callersFunctionrenewSlidingSession
renewSlidingSession implements the rolling half of the session-timeout model: while the user is active it slides the cookie + Redis TTL forward, so a
apps/api/internal/middleware/auth.go:398
↓ 2 callersFunctionresolveAvatarUrl
( user: AvatarSource | null | undefined, variant?: '100' )
apps/web/app/shared/utils/resolveAvatarUrl.ts:46
↓ 2 callersFunctionreverseMessages
(m []model.ChatMessage)
apps/api/internal/chat/repository/repository.go:184
↓ 2 callersFunctionstartOAuthLogin
( opts: AuthorizeOptions = {} )
apps/web/app/shared/utils/pkce.ts:120
↓ 2 callersFunctiontoUrls
( src: PagedSource, rows: Record<string, unknown>[] )
apps/web/server/utils/kunSitemapSources.ts:104
↓ 2 callersFunctiontruncate
(s string, n int)
apps/api/internal/middleware/auth.go:663
↓ 2 callersFunctionunionInts
unionInts merges several int slices into one deduped slice (order unimportant — used only for `WHERE id IN (...)` recompute targets).
apps/api/internal/admin/repository/repository.go:626
↓ 2 callersFunctionuploadTier
uploadTier resolves the caller's per-role upload allowance from the OAuth roles claim: admin/ren > moderator > creator > user. Each tier is distinct;
apps/api/internal/common/upload/handler.go:37
↓ 2 callersFunctionuseResourceResumeUploads
(galgameId: number)
apps/web/app/composables/useResourceResumeUploads.ts:10
↓ 2 callersFunctionvalidateStruct
(s any)
apps/api/pkg/utils/validate.go:27
↓ 2 callersMethodvariantPath
(hash, variant string)
apps/api/pkg/imageclient/client.go:376
↓ 2 callersFunctionwaitForRefreshedSession
waitForRefreshedSession is the lock-loser path. Another request holds the per-session refresh lock and is doing the OAuth round-trip; we poll Redis fo
apps/api/internal/middleware/auth.go:506
↓ 2 callersFunctionwriteJSONResp
(w http.ResponseWriter, v any)
apps/api/pkg/userclient/client_test.go:202
↓ 2 callersFunctionwriteMockJSON
(w http.ResponseWriter, v any)
apps/api/pkg/userclient/mock.go:116
← previousnext →101–200 of 1,135, ranked by callers