diff --git a/assets/openapi.json b/assets/openapi.json index 0e1b4fa4f..c1df06439 100644 Binary files a/assets/openapi.json and b/assets/openapi.json differ diff --git a/assets/schemas.json b/assets/schemas.json index 1458afdb2..a3fe6de9b 100644 Binary files a/assets/schemas.json and b/assets/schemas.json differ diff --git a/src/api/routes/guilds/#guild_id/stickers.ts b/src/api/routes/guilds/#guild_id/stickers.ts index 857713de2..aa3b76b1f 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 b5b08cfae..ce4f214d2 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 116d72f99..212baadc1 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 13143a9f9..9d5d6121d 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; - 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 9dc9c3ac0..4dced10a7 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";