feat: add profile editing (bio, display name, stat visibility)

This commit is contained in:
2026-03-06 13:56:12 -08:00
committed by Naomi Carrigan
parent 32c13f73c4
commit 7e04daa073
11 changed files with 525 additions and 30 deletions
+4
View File
@@ -16,6 +16,8 @@ export type {
PublicProfileResponse,
SaveRequest,
SaveResponse,
UpdateProfileRequest,
UpdateProfileResponse,
} from "./interfaces/Api.js";
export type { Boss, BossStatus } from "./interfaces/Boss.js";
export type {
@@ -39,3 +41,5 @@ export type {
UpgradeTarget,
} from "./interfaces/Upgrade.js";
export type { Zone, ZoneStatus } from "./interfaces/Zone.js";
export type { ProfileSettings } from "./interfaces/ProfileSettings.js";
export { DEFAULT_PROFILE_SETTINGS } from "./interfaces/ProfileSettings.js";
+18
View File
@@ -1,5 +1,6 @@
import type { GameState } from "./GameState.js";
import type { Player } from "./Player.js";
import type { ProfileSettings } from "./ProfileSettings.js";
export interface AuthResponse {
token: string;
@@ -69,12 +70,29 @@ export interface PublicProfileResponse {
characterName: string;
username: string;
avatar: string | null;
bio: string;
profileSettings: ProfileSettings;
prestigeCount: number;
totalGoldEarned: number;
totalClicks: number;
createdAt: number;
}
export interface UpdateProfileRequest {
characterName: string;
bio: string;
profileSettings: ProfileSettings;
}
export interface UpdateProfileResponse {
characterName: string;
bio: string;
profileSettings: ProfileSettings;
}
export interface ApiError {
error: string;
}
// Re-export for convenience
export type { ProfileSettings };
@@ -0,0 +1,13 @@
export interface ProfileSettings {
showTotalGold: boolean;
showTotalClicks: boolean;
showPrestige: boolean;
showGuildFounded: boolean;
}
export const DEFAULT_PROFILE_SETTINGS: ProfileSettings = {
showTotalGold: true,
showTotalClicks: true,
showPrestige: true,
showGuildFounded: true,
};