summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-03-17 02:36:54 +0100
committerRory& <root@rory.gay>2026-03-17 02:36:54 +0100
commitecea5540fa39a117055caa96c8b3d78b998da9e6 (patch)
tree40739e4f57389d8e26aa0f8fbeca29454a6d25f4 /src
parentColor coded logging for missing request/response schemas in openapi (diff)
downloadserver-ts-ecea5540fa39a117055caa96c8b3d78b998da9e6.tar.xz
Schemas for stickers
Diffstat (limited to 'src')
-rw-r--r--src/api/routes/guilds/#guild_id/stickers.ts2
-rw-r--r--src/api/routes/sticker-packs/index.ts2
-rw-r--r--src/schemas/api/guilds/Sticker.ts20
-rw-r--r--src/schemas/responses/TypedResponses.ts25
-rw-r--r--src/util/entities/Attachment.ts1
5 files changed, 22 insertions, 28 deletions
diff --git a/src/api/routes/guilds/#guild_id/stickers.ts b/src/api/routes/guilds/#guild_id/stickers.ts

index 857713de..aa3b76b1 100644 --- a/src/api/routes/guilds/#guild_id/stickers.ts +++ b/src/api/routes/guilds/#guild_id/stickers.ts
@@ -29,7 +29,7 @@ router.get( route({ responses: { 200: { - body: "APIStickerArray", + body: "StickersResponse", }, 403: { body: "APIErrorResponse", diff --git a/src/api/routes/sticker-packs/index.ts b/src/api/routes/sticker-packs/index.ts
index b5b08cfa..ce4f214d 100644 --- a/src/api/routes/sticker-packs/index.ts +++ b/src/api/routes/sticker-packs/index.ts
@@ -27,7 +27,7 @@ router.get( route({ responses: { 200: { - body: "APIStickerPackArray", + body: "StickersResponse", }, }, }), diff --git a/src/schemas/api/guilds/Sticker.ts b/src/schemas/api/guilds/Sticker.ts
index 116d72f9..212baadc 100644 --- a/src/schemas/api/guilds/Sticker.ts +++ b/src/schemas/api/guilds/Sticker.ts
@@ -1,3 +1,23 @@ +import { Snowflake } from "../../Identifiers"; +import { PartialUser } from "../users"; + +export type StickersResponse = StickerResponse[]; +export interface StickerResponse { + id: Snowflake; + pack_id?: Snowflake; + name: string; + description: string | null; + tags: string; + type: StickerType; + format_type: StickerFormatType; + available?: boolean; + guild_id?: Snowflake; + // Only filled for Get Guild Sticker(/s) + user?: PartialUser; + // Only filled in for sticker packs + sort_value?: number; +} + export enum StickerType { STANDARD = 1, GUILD = 2, diff --git a/src/schemas/responses/TypedResponses.ts b/src/schemas/responses/TypedResponses.ts
index 13143a9f..9d5d6121 100644 --- a/src/schemas/responses/TypedResponses.ts +++ b/src/schemas/responses/TypedResponses.ts
@@ -25,15 +25,10 @@ import { GuildBansResponse, GuildCreateResponse, PrivateUser, PublicMember, Publ // TODO: remove this entire file! // removes internal properties from the guild class export type APIGuild = Omit<Guild, "afk_channel" | "template" | "owner" | "public_updates_channel" | "rules_channel" | "system_channel" | "widget_channel">; - export type APIPublicUser = PublicUser; - export type APIPrivateUser = PrivateUser; - export type APIGuildArray = APIGuild[]; - export type APIDMChannelArray = DmChannelDTO[]; - export type APIBackupCodeArray = BackupCode[]; export interface UserUpdateResponse extends APIPrivateUser { @@ -41,29 +36,16 @@ export interface UserUpdateResponse extends APIPrivateUser { } export type ApplicationDetectableResponse = unknown[]; - export type ApplicationEntitlementsResponse = unknown[]; - export type ApplicationSkusResponse = unknown[]; - export type APIApplicationArray = Application[]; - export type APIBansArray = GuildBansResponse[]; - export type APIInviteArray = Invite[]; - export type APIMessageArray = Message[]; - export type APIWebhookArray = Webhook[]; - export type APIDiscoveryCategoryArray = Categories[]; - export type APIGeneralConfiguration = GeneralConfiguration; - export type APIChannelArray = Channel[]; - -export type APIEmojiArray = Emoji[]; - export type APIMemberArray = Member[]; export type APIPublicMember = PublicMember; @@ -72,17 +54,10 @@ export interface APIGuildWithJoinedAt extends GuildCreateResponse { } export type APIRoleArray = Role[]; - -export type APIStickerArray = Sticker[]; - export type APITemplateArray = Template[]; - export type APIGuildVoiceRegion = GuildVoiceRegion[]; - export type APILimitsConfiguration = LimitsConfiguration; -export type APIStickerPackArray = StickerPack[]; - export type APIConnectionsConfiguration = Record< string, { diff --git a/src/util/entities/Attachment.ts b/src/util/entities/Attachment.ts
index 9dc9c3ac..4dced10a 100644 --- a/src/util/entities/Attachment.ts +++ b/src/util/entities/Attachment.ts
@@ -17,7 +17,6 @@ */ import { BeforeRemove, Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm"; -import { URL } from "url"; import { deleteFile } from "../util"; import { BaseClass } from "./BaseClass"; import { getUrlSignature, NewUrlUserSignatureData, NewUrlSignatureData } from "../Signing";