feat(shared): reorder AppError constructor to (message, code, status), add singleton logger, retry and TTL cache utilities

This commit is contained in:
MythEclipse
2026-06-02 21:06:42 +07:00
parent 9045e7e347
commit 2d79d8aefd
50 changed files with 401 additions and 449 deletions
+1 -12
View File
@@ -1,12 +1 @@
export interface Guild {
id: string;
name: string;
icon: string | null;
}
export interface Channel {
id: string;
name: string;
type?: string;
parentId?: string | null;
}
export { Guild, Channel } from "../../shared/api/client";
+1 -17
View File
@@ -1,17 +1 @@
export type MediaMode = "music" | "screen";
export interface MediaItem {
id?: string;
source: string;
title: string;
mode?: MediaMode;
durationMs?: number | null;
thumbnailUrl?: string | null;
}
export interface MediaState {
playing: boolean;
musicVolume: number;
current: MediaItem | null;
queue: MediaItem[];
}
export { MediaMode, MediaItem, MediaState } from "../../shared/api/client";
@@ -14,6 +14,15 @@ export interface MessageMetadata {
embeds?: Array<{ title?: string; image?: string; thumbnail?: string }>;
}
export function parseMetadata(value: string | null): MessageMetadata {
if (!value) return {};
try {
return JSON.parse(value) as MessageMetadata;
} catch {
return {};
}
}
export interface MessageRecord {
id: string;
guild_id: string;
+1 -14
View File
@@ -1,14 +1 @@
export type DashboardTab = "live" | "messages" | "analytics";
export interface UIState {
selectedGuild?: string;
selectedVoiceGuild?: string;
selectedVoiceChannel?: string;
selectedTextGuild?: string;
selectedTextChannel?: string;
selectedAnalyticsGuild?: string;
selectedAnalyticsChannel?: string;
activeTab?: DashboardTab;
isListening?: boolean;
isStreaming?: boolean;
}
export { DashboardTab, UIState } from "../../shared/api/client";
+1 -14
View File
@@ -1,14 +1 @@
export interface VoiceStatus {
connected: boolean;
activeGuildId?: string | null;
activeChannelId?: string | null;
activeChannelName?: string | null;
}
export interface ActiveSpeaker {
id?: string;
userId?: string;
username: string;
avatar: string;
speaking: boolean;
}
export { VoiceStatus, ActiveSpeaker } from "../../shared/api/client";