summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-07-15 12:50:53 +0200
committerRory& <root@rory.gay>2026-07-15 12:50:53 +0200
commit06ea966591a2d35b82d54bbb6666adbe0e11632b (patch)
tree92bd191866454e174533d76a825247549c7a9e1e /src
parentRemove APIMemberArray (diff)
downloadserver-ts-06ea966591a2d35b82d54bbb6666adbe0e11632b.tar.xz
Remove APIBackupCodesArray
Diffstat (limited to 'src')
-rw-r--r--src/api/routes/users/@me/mfa/codes-verification.ts2
-rw-r--r--src/api/routes/users/@me/mfa/codes.ts2
-rw-r--r--src/schemas/responses/BackupCodesResponses.ts (renamed from src/schemas/responses/BackupCodesChallengeResponse.ts)11
-rw-r--r--src/schemas/responses/TypedResponses.ts3
-rw-r--r--src/schemas/responses/index.ts2
5 files changed, 13 insertions, 7 deletions
diff --git a/src/api/routes/users/@me/mfa/codes-verification.ts b/src/api/routes/users/@me/mfa/codes-verification.ts

index 2fd1dd32..d84aa26a 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 969ff78f..73cde9d4 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
index ab6e4129..feccd728 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 <https://www.gnu.org/licenses/>. */ -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 2cf9d6f8..2055d6af 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 95fce7bd..e5b3f641 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";