[accounts] emoji

This commit is contained in:
Devin Zuczek
2026-09-09 11:31:48 -04:00
parent 261ff21e0d
commit 629a702403
5 changed files with 509 additions and 5 deletions
+20 -1
View File
@@ -75,7 +75,7 @@ export const AccountDto = z.object({
bannerImage: z.string().describe('Profile banner key — always "" (nothing sets it yet)'),
displayEmoji: z
.string()
.describe('Emoji beside the display name — always "" (nothing sets it yet)'),
.describe('Emoji beside the display name, set by PUT /account/me/emoji; "" when unset'),
isJunior: z.boolean(),
platforms: z.int().describe('PlatformType bitmask of linked platforms'),
personalPronouns: z.int().describe('Pronoun flags bitmask'),
@@ -139,6 +139,15 @@ export const ParentalControl = z.object({ accountId: z.int(), disallowInAppPurch
*/
export const PrivacySettings = z.object({ accountId: z.int(), isRecentHistoryVisible: z.boolean() })
/**
* `GET /emojiConfig/whitelistedEmojis` response — a BARE array of emoji, no envelope
* and no object around it (see `WHITELISTED_EMOJIS`).
*/
export const WhitelistedEmojis = z
.string()
.array()
.describe('The emoji a player may set as their displayEmoji, in picker order')
/** Root health check. */
export const HealthResponse = z.object({ service: z.literal('accounts'), status: z.literal('ok') })
@@ -230,6 +239,16 @@ export const BioRequest = z.object({
bio: z.string().refine(isValidBio).describe('Free text, max 255; empty is allowed'),
})
/**
* `PUT /account/me/emoji` form body. The value must be one of the emoji served by
* `GET /emojiConfig/whitelistedEmojis`; an empty value clears the current pick. Checked
* in the handler rather than here, because the check also CANONICALIZES the value
* (see `resolveWhitelistedEmoji`) and a schema can only accept or reject it.
*/
export const EmojiRequest = z.object({
displayEmoji: z.string().describe('A whitelisted emoji, or "" to clear'),
})
export const ProfileImageRequest = z.object({
imageName: z.string().describe('Avatar object key; empty is rejected (400)'),
})