mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-04 07:25:35 +00:00
Clean up schemas/responses a bit
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export interface HubGuild {
|
||||
icon: string;
|
||||
id: string;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// TODO: remove entity import
|
||||
import { Emoji } from "@spacebar/util";
|
||||
|
||||
export interface EmojiSourceResponse {
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||
Copyright (C) 2023 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
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export interface GatewayBotResponse {
|
||||
url: string;
|
||||
shards: number;
|
||||
session_start_limit: {
|
||||
total: number;
|
||||
remaining: number;
|
||||
reset_after: number;
|
||||
max_concurrency: number;
|
||||
};
|
||||
}
|
||||
@@ -19,3 +19,13 @@
|
||||
export interface GatewayResponse {
|
||||
url: string;
|
||||
}
|
||||
|
||||
export interface GatewayBotResponse extends GatewayResponse {
|
||||
shards: number;
|
||||
session_start_limit: {
|
||||
total: number;
|
||||
remaining: number;
|
||||
reset_after: number;
|
||||
max_concurrency: number;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// TODO: remove import from util
|
||||
import { GuildWelcomeScreen } from "@spacebar/util";
|
||||
import { GuildUpdateSchema } from "@spacebar/schemas";
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// TODO: remove util import
|
||||
import { ClientStatus } from "@spacebar/util";
|
||||
|
||||
export interface GuildWidgetJsonResponse {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Snowflake } from "@spacebar/util";
|
||||
import { Snowflake } from "../Identifiers";
|
||||
|
||||
export interface GuildWidgetSettingsResponse {
|
||||
enabled: boolean;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// TODO: remove entity imports
|
||||
import { Emoji, Role, Sticker } from "@spacebar/util";
|
||||
import { GuildCreateResponse } from "@spacebar/schemas";
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// TODO: remove entity import
|
||||
import { Message } from "@spacebar/util";
|
||||
|
||||
export type PreloadMessagesResponseSchema = Message[];
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// TODO: is there a better alternative for this?
|
||||
import { JsonValue } from "@protobuf-ts/runtime";
|
||||
|
||||
export interface SettingsProtoResponse {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// TODO: remove entity import
|
||||
import { Team } from "@spacebar/util";
|
||||
|
||||
export type TeamListResponse = Team[];
|
||||
|
||||
@@ -16,11 +16,13 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// TODO: clean up util imports
|
||||
import { GeneralConfiguration, LimitsConfiguration } from "../../util/config/types";
|
||||
import { DmChannelDTO } from "../../util/dtos";
|
||||
import { Application, BackupCode, Categories, Channel, Emoji, Guild, Invite, Member, Message, Role, Sticker, StickerPack, Template, Webhook } from "@spacebar/util";
|
||||
// TODO: remove entity imports
|
||||
import { Application, BackupCode, Categories, Channel, Guild, Invite, Member, Message, Role, Template, Webhook } from "@spacebar/util";
|
||||
import { GuildVoiceRegion } from "./GuildVoiceRegionsResponse";
|
||||
import { GuildBansResponse, GuildCreateResponse, PrivateUser, PublicMember, PublicUser } from "@spacebar/schemas";
|
||||
import { GuildCreateResponse, PrivateUser, PublicMember, PublicUser } from "@spacebar/schemas";
|
||||
|
||||
// TODO: remove this entire file!
|
||||
// removes internal properties from the guild class
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// TODO: remove entity imports
|
||||
import { Badge, Member, User } from "@spacebar/util";
|
||||
import { PublicConnectedAccount, PublicMember, PublicUser } from "@spacebar/schemas";
|
||||
|
||||
|
||||
@@ -15,6 +15,13 @@
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import { User } from "@spacebar/util";
|
||||
|
||||
export type UserRelationsResponse = (Pick<User, "id"> & Pick<User, "username"> & Pick<User, "discriminator"> & Pick<User, "avatar"> & Pick<User, "public_flags">)[];
|
||||
export interface UserRelationResponse {
|
||||
id: string;
|
||||
username: string;
|
||||
discriminator: string;
|
||||
avatar?: string;
|
||||
public_flags: number;
|
||||
}
|
||||
|
||||
export type UserRelationsResponse = UserRelationResponse[];
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export interface WebAuthnCreateResponse {
|
||||
name: string;
|
||||
id: string;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export * from "./APIErrorOrCaptchaResponse";
|
||||
export * from "./APIErrorResponse";
|
||||
export * from "./AccountStandingResponse";
|
||||
@@ -28,7 +29,6 @@ export * from "./DmMessagesResponseSchema";
|
||||
export * from "./EmailDomainLookupResponse";
|
||||
export * from "./EmailDomainLookupVerifyCodeResponse";
|
||||
export * from "./EmojiSourceResponse";
|
||||
export * from "./GatewayBotResponse";
|
||||
export * from "./GatewayResponse";
|
||||
export * from "./GenerateRegistrationTokensResponse";
|
||||
export * from "./GuildBansResponse";
|
||||
|
||||
Reference in New Issue
Block a user