Add endpoint implementations

This commit is contained in:
Rory& 2025-07-14 18:34:32 +02:00
parent a82a66b9ce
commit 387722d017
4 changed files with 178 additions and 0 deletions

View File

@ -0,0 +1,40 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2025 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/>.
*/
import { route } from "@spacebar/api";
import { Request, Response, Router } from "express";
import { CollectiblesCategoriesResponse } from "@spacebar/util";
const router = Router();
router.get(
"/",
route({
responses: {
200: {
body: "CollectiblesCategoriesResponse",
},
204: {},
},
}),
(req: Request, res: Response) => {
res.send([] as CollectiblesCategoriesResponse);
},
);
export default router;

View File

@ -0,0 +1,43 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2025 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/>.
*/
import { route } from "@spacebar/api";
import { Request, Response, Router } from "express";
import { CollectiblesShopResponse } from "@spacebar/util";
const router = Router();
router.get(
"/",
route({
responses: {
200: {
body: "CollectiblesShopResponse",
},
204: {},
},
}),
(req: Request, res: Response) => {
res.send({
shop_blocks: [],
categories: [],
} as CollectiblesShopResponse);
},
);
export default router;

View File

@ -0,0 +1,49 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2025 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/>.
*/
import { route } from "@spacebar/api";
import { Request, Response, Router } from "express";
import { CollectiblesMarketingResponse } from "@spacebar/util";
const router = Router();
// Unsure what this endpoint does, it seems to only affect the visual style of the shop tab in home
router.get(
"/",
route({
responses: {
200: {
body: "CollectiblesMarketingResponse",
},
204: {},
401: {
body: "APIErrorResponse",
},
404: {
body: "APIErrorResponse",
},
},
}),
async (req: Request, res: Response) => {
res.send({
marketings: {},
} as CollectiblesMarketingResponse);
},
);
export default router;

View File

@ -0,0 +1,46 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2025 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/>.
*/
import { route } from "@spacebar/api";
import { Request, Response, Router } from "express";
const router = Router();
// Unsure what this endpoint does, it seems to only affect the visual style of the shop tab in home
router.get(
"/",
route({
responses: {
200: {
// body: "CollectiblesPurchasesResponse",
},
204: {},
401: {
body: "APIErrorResponse",
},
404: {
body: "APIErrorResponse",
},
},
}),
async (req: Request, res: Response) => {
res.send([]);
},
);
export default router;