all repos — stealth-developers @ 95e72d9356e61cd3d759910b8e66630cf47add39

feat(api): somee fixes
vi did:web:vt3e.cat
Sat, 16 May 2026 05:58:33 +0100
commit

95e72d9356e61cd3d759910b8e66630cf47add39

parent

a92e81558dd6c256c58bdcd726a8ddeb0fd77746

M pkgs/api/src/responses.tspkgs/api/src/responses.ts

@@ -23,7 +23,7 @@ global: Statistic;

hourly: (Statistic & { hour: number })[]; }; -type LeaderboardStat = Statistic & { +export type LeaderboardStat = Statistic & { user: User; rank: number; };
M pkgs/api/src/types.tspkgs/api/src/types.ts

@@ -1,3 +1,5 @@

+export type DateString = string; + export type User = { id: string; name: string;

@@ -10,13 +12,14 @@ number: string;

status: "open" | "closed" | "archived"; closedBy: User | null; - closedAt: Date | null; + closedAt: DateString | null; /** the reason the ticket was opened if it was not opened by the subject */ topic: string | null; closeReason: string | null; privateReason: string | null; + openedAt: DateString; /** the user who opened the ticket, if it was not opened by the subject */ openedBy: User | null; /** the user who is the subject of the ticket, i.e. the reporter */

@@ -27,9 +30,9 @@ export type Message = {

id: number; messageId: string | null; - createdAt: Date; - updatedAt: Date | null; - deletedAt: Date | null; + createdAt: DateString; + updatedAt: DateString | null; + deletedAt: DateString | null; author: User; authorType: "user" | "staff" | "system";

@@ -52,5 +55,5 @@ bucket: string;

key: string; url: string; - uploadedAt: Date; + uploadedAt: DateString; };
M pkgs/bot/src/server/api.tspkgs/bot/src/server/api.ts

@@ -43,6 +43,6 @@ size: a.size,

bucket: a.bucket, key: a.key, url: a.url, - uploadedAt: new Date(a.uploadedAt), + uploadedAt: a.uploadedAt.toUTCString(), }; }
M pkgs/bot/src/server/discord.tspkgs/bot/src/server/discord.ts

@@ -61,7 +61,7 @@

return allTickets.map((ticket) => { const fallbackSubject: UserProfile = { id: ticket.authorId, - name: "Unknown User", + name: "Subject", avatarUrl: "", isModerator: false, };

@@ -71,12 +71,13 @@ number: String(ticket.id),

status: ticket.status as "open" | "closed" | "archived", closedBy: ticket.closedBy ? (cache.get(ticket.closedBy) ?? null) : null, - closedAt: ticket.closedAt ? new Date(ticket.closedAt) : null, + closedAt: ticket.closedAt?.toUTCString() || null, topic: ticket.topic, closeReason: ticket.closeReason, privateReason: ticket.privateReason, + openedAt: ticket.createdAt?.toUTCString(), openedBy: ticket.openedBy ? (cache.get(ticket.openedBy) ?? null) : null, subject: cache.get(ticket.authorId) ?? fallbackSubject, };
M pkgs/bot/src/server/index.tspkgs/bot/src/server/index.ts

@@ -227,9 +227,9 @@

return { id: message.id, messageId: message.messageId, - createdAt: new Date(message.createdAt), - updatedAt: message.editedAt ? new Date(message.editedAt) : null, - deletedAt: message.deletedAt ? new Date(message.deletedAt) : null, + createdAt: message.createdAt.toUTCString(), + updatedAt: message.editedAt ? message.editedAt?.toUTCString() : null, + deletedAt: message.deletedAt ? message.deletedAt?.toUTCString() : null, author: author as User, authorType: message.authorType as "user" | "staff" | "system", content: message.content,