This commit is contained in:
Emma [it/its]@Rory&
2025-04-09 16:38:03 +02:00
committed by Rory&
parent 2a7051bdc8
commit 126a881f31
6 changed files with 18 additions and 14 deletions
+2
View File
@@ -4,3 +4,5 @@ node_modules
.github
.vscode
hashes.json
flake.lock
extra/admin-api
+4 -4
View File
@@ -21,10 +21,10 @@ We aim to reverse engineer and add additional features to the Discord backend, w
This repository contains:
- [Spacebar HTTP API Server](/src/api)
- [WebSocket Gateway Server](/src/gateway)
- [HTTP CDN Server](/src/cdn)
- [Utility and Database Models](/src/util)
- [Spacebar HTTP API Server](/src/api)
- [WebSocket Gateway Server](/src/gateway)
- [HTTP CDN Server](/src/cdn)
- [Utility and Database Models](/src/util)
## [Documentation](https://docs.spacebar.chat)
+1 -1
View File
@@ -61,7 +61,7 @@ declare global {
}
export class SpacebarServer extends Server {
public declare options: SpacebarServerOptions;
declare public options: SpacebarServerOptions;
constructor(opts?: Partial<SpacebarServerOptions>) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
+7 -7
View File
@@ -157,11 +157,13 @@ export async function ImageProxy(req: Request, res: Response) {
const buffer = Buffer.from(arrayBuffer);
if (sharp && sharpSupported.has(contentType)) {
resultBuffer = Buffer.from(await sharp
.default(buffer)
// Sharp doesn't support "scaleToFit"
.resize(width)
.toBuffer());
resultBuffer = Buffer.from(
await sharp
.default(buffer)
// Sharp doesn't support "scaleToFit"
.resize(width)
.toBuffer(),
);
} else if (Jimp && jimpSupported.has(contentType)) {
resultBuffer = await Jimp.read(buffer).then((image) => {
contentType = image.getMIME();
@@ -183,5 +185,3 @@ export async function ImageProxy(req: Request, res: Response) {
res.send(resultBuffer);
}
+3 -1
View File
@@ -49,7 +49,9 @@ router.post(
let user;
try {
const userTokenData = await checkToken(token, {select : ["email"]});
const userTokenData = await checkToken(token, {
select: ["email"],
});
user = userTokenData.user;
} catch {
throw FieldErrors({
+1 -1
View File
@@ -28,7 +28,7 @@ import { BodyParser } from "../api/middlewares/BodyParser";
export type CDNServerOptions = ServerOptions;
export class CDNServer extends Server {
public declare options: CDNServerOptions;
declare public options: CDNServerOptions;
constructor(options?: Partial<CDNServerOptions>) {
super(options);