Every table a function queries, its own helpers included, read or written. Calls to other repositories are listed apart, their tables are on their own page.
- Tables
- AllTeamMemberApiTokenBadgeBadgeManagerBanLogBuildGroupMemberLFGPostModNotePendingTrophyPendingTrophyApprovalPlusTierSpecialTrophyOwnerSplatoonPlayerTeamMemberTournamentBadgeOwnerTournamentStreamerTournamentTeamMemberTrophyTrophyOwnerUnvalidatedUserSubmittedImageUserUserFriendCodeUserReport
- Calls
- BadgeRepositoryBuildRepositoryXRankPlacementRepositoryTrophyRepository
- Imports
- no other modules
- Used by
- 1 loader3 actions1 script3 other
Functions & values
For a user switching Discord accounts: moves the new account's data onto the old user and deletes the new one. Resolves to null on success, or an error message if validation fails.
export function migrate(args: { newUserId: number; oldUserId: number })Unit tests (4)
functionreplacePlusTiers
:388 Replaces every PlusTier row, also refreshing the build sort values derived from them.
export function replacePlusTiers(
plusTiers: Array<{ userId: number; plusTier: number }>,
)Unit tests (2)
functionmakeVideoAdderByUserId
no JSDoc:406 export function makeVideoAdderByUserId(userId: number)
functionmakeArtistByUserId
no JSDoc:414 export function makeArtistByUserId(userId: number)
functionmakeTournamentOrganizerByUserId
no JSDoc:422 export function makeTournamentOrganizerByUserId(userId: number)
functionmakeApiAccesserByUserId
no JSDoc:430 export function makeApiAccesserByUserId(userId: number)
functionlinkUserAndPlayer
no JSDoc:438 export async function linkUserAndPlayer({
userId,
playerId,
}: {
userId: number;
playerId: number;
})functionforcePatron
no JSDoc:464 export async function forcePatron(args: {
id: number;
patronTier: Tables["User"]["patronTier"];
patronStartedAt: Date;
patronExpiresAt: Date;
})functionfindAllBannedUsers
no JSDoc:481 export async function findAllBannedUsers()
Unit tests (5)
Bans the user, logging it unless it's an automatic ban. Revokes their API tokens.
export function banUser({
userId,
banned,
bannedReason,
bannedByUserId,
}: {
userId: number;
banned: 1 | Date;
bannedReason: string | null;
/** null means an automatic ban. */
bannedByUserId: number | null;
})Unit tests (7)
functionunbanUser
no JSDoc:537 export function unbanUser({
userId,
unbannedByUserId,
}: {
userId: number;
unbannedByUserId: number;
})Unit tests (4)
functionaddModNote
no JSDoc:567 export function addModNote(
args: Omit<TablesInsertable["ModNote"], "authorId">,
)
functionfindModNoteById
no JSDoc:576 export function findModNoteById(id: number)
functiondeleteModNote
no JSDoc:584 export function deleteModNote(id: number)
- Tables
- ExternalStreamUserSubmittedImage
- Calls
- no other repositories
- Imports
- no other modules
- Used by
- 1 loader1 action1 routine1 script1 other
Functions & values
Inserts an admin-curated external stream.
export function insert(
args: Pick<
TablesInsertable["ExternalStream"],
"name" | "url" | "avatarImgId" | "startsAt"
>,
)
Deletes an external stream by its id.
export function deleteById(id: number)
All external streams, soonest first.
export function findAll()
Streams started under 6h ago or upcoming.
export function findAllForSidebar()
Deletes streams that started over 24h ago.
export function deleteOld()
- Tables
- ModAuditLog
- Calls
- no other repositories
- Imports
- Seasons
- Used by
- 1 loader1 repository1 script1 other
Functions & values
Logs a text written by the acting user, in the caller's transaction.
export function insert(
{ type, text }: { type: ModAuditLogType; text: string },
trx: Transaction<DB>,
)functionfindSeasonByUserId
:23 Texts of the type the user wrote during the season, newest first.
export function findSeasonByUserId({
userId,
season,
type,
}: {
userId: number;
season: number;
type: ModAuditLogType;
})Unit tests (3)