Export spacebar specific schemas

This commit is contained in:
Rory&
2026-09-22 07:35:18 +02:00
parent a1c922ebcc
commit 404da008ba
5 changed files with 28 additions and 5 deletions
Binary file not shown.
Binary file not shown.
+4 -5
View File
@@ -17,8 +17,7 @@
*/
import { Column, Entity, Index, JoinColumn, ManyToOne, RelationId } from "typeorm";
import { AvatarDecorationData } from "@spacebar/schemas";
import { PublicAvatarDecoration } from "@spacebar/schemas/api/spacebar/AvatarDecorations";
import { AvatarDecorationData, PublicAvatarDecorationResponse } from "@spacebar/schemas";
import { BaseClass } from "./BaseClass";
import { User } from "./User";
@@ -62,13 +61,13 @@ export class AvatarDecorations extends BaseClass {
} satisfies AvatarDecorationData;
}
toPublicAvatarDecoration(opts?: {available: boolean}): PublicAvatarDecoration {
toPublicAvatarDecoration(opts?: { available: boolean }): PublicAvatarDecorationResponse {
return {
id: this.id,
approved: this.approved,
uploader: this.uploader.toPartialUser(),
public: this.public,
available: opts?.available ?? this.public
} satisfies PublicAvatarDecoration;
available: opts?.available ?? this.public,
} satisfies PublicAvatarDecorationResponse;
}
}
+1
View File
@@ -23,4 +23,5 @@ export * from "./guilds";
export * from "./integrations";
export * from "./messages";
export * from "./reports";
export * from "./spacebar";
export * from "./users";
+23
View File
@@ -0,0 +1,23 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
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
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 * from "./AttachmentListResponse";
export * from "./AvatarDecorations";
export * from "./Integrations";
export * from "./Version";
export * from "./WellKnown";