diff --git a/assets/openapi.json b/assets/openapi.json index 91807e0bc..b96c1edd4 100644 Binary files a/assets/openapi.json and b/assets/openapi.json differ diff --git a/assets/schemas.json b/assets/schemas.json index 6b696fd48..1d31ca658 100644 Binary files a/assets/schemas.json and b/assets/schemas.json differ diff --git a/src/api/routes/users/@me/mfa/codes-verification.ts b/src/api/routes/users/@me/mfa/codes-verification.ts index 2fd1dd329..d84aa26a3 100644 --- a/src/api/routes/users/@me/mfa/codes-verification.ts +++ b/src/api/routes/users/@me/mfa/codes-verification.ts @@ -30,7 +30,7 @@ router.post( requestBody: "CodesVerificationSchema", responses: { 200: { - body: "APIBackupCodeArray", + body: "BackupCodeArray", }, 400: { body: "APIErrorResponse", diff --git a/src/api/routes/users/@me/mfa/codes.ts b/src/api/routes/users/@me/mfa/codes.ts index 969ff78fa..73cde9d4a 100644 --- a/src/api/routes/users/@me/mfa/codes.ts +++ b/src/api/routes/users/@me/mfa/codes.ts @@ -35,7 +35,7 @@ router.post( description: "This route is replaced with users/@me/mfa/codes-verification in newer clients", responses: { 200: { - body: "APIBackupCodeArray", + body: "BackupCodeArray", }, 400: { body: "APIErrorResponse", diff --git a/src/schemas/responses/BackupCodesChallengeResponse.ts b/src/schemas/responses/BackupCodesResponses.ts similarity index 78% rename from src/schemas/responses/BackupCodesChallengeResponse.ts rename to src/schemas/responses/BackupCodesResponses.ts index ab6e41295..feccd7281 100644 --- a/src/schemas/responses/BackupCodesChallengeResponse.ts +++ b/src/schemas/responses/BackupCodesResponses.ts @@ -1,6 +1,6 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. - Copyright (C) 2023 Spacebar and Spacebar Contributors + Copyright (C) 2026 Spacebar and Spacebar Contributors This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -16,7 +16,14 @@ along with this program. If not, see . */ -export interface BackupCodesChallengeResponse { +export interface BackupCodesResponses { nonce: string; regenerate_nonce: string; } + +export interface BackupCode { + code: string; + consumed: boolean; +} + +export type BackupCodeArray = BackupCode[]; diff --git a/src/schemas/responses/TypedResponses.ts b/src/schemas/responses/TypedResponses.ts index 2cf9d6f84..2055d6aff 100644 --- a/src/schemas/responses/TypedResponses.ts +++ b/src/schemas/responses/TypedResponses.ts @@ -30,7 +30,6 @@ 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 { newToken?: string; @@ -43,7 +42,6 @@ export type APIApplicationArray = Application[]; export type APIInviteArray = Invite[]; export type APIWebhookArray = Webhook[]; export type APIDiscoveryCategoryArray = Categories[]; -export type APIGeneralConfiguration = GeneralConfiguration; export type APIChannelArray = Channel[]; export interface APIGuildWithJoinedAt extends GuildCreateResponse { @@ -51,6 +49,7 @@ export interface APIGuildWithJoinedAt extends GuildCreateResponse { } export type APITemplateArray = Template[]; +export type APIGeneralConfiguration = GeneralConfiguration; export type APILimitsConfiguration = LimitsConfiguration; export type APIConnectionsConfiguration = Record< diff --git a/src/schemas/responses/index.ts b/src/schemas/responses/index.ts index 95fce7bdf..e5b3f6418 100644 --- a/src/schemas/responses/index.ts +++ b/src/schemas/responses/index.ts @@ -19,7 +19,7 @@ export * from "./APIErrorOrCaptchaResponse"; export * from "./APIErrorResponse"; export * from "./AccountStandingResponse"; -export * from "./BackupCodesChallengeResponse"; +export * from "./BackupCodesResponses"; export * from "./CaptchaRequiredResponse"; export * from "./CollectiblesCategoriesResponse"; export * from "./CollectiblesMarketingResponse";