diff --git a/src/api/routes/collectibles-categories.ts b/src/api/routes/collectibles-categories.ts new file mode 100644 index 00000000..87e79f55 --- /dev/null +++ b/src/api/routes/collectibles-categories.ts @@ -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 . +*/ + +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; diff --git a/src/api/routes/collectibles-shop.ts b/src/api/routes/collectibles-shop.ts new file mode 100644 index 00000000..118c2c0f --- /dev/null +++ b/src/api/routes/collectibles-shop.ts @@ -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 . +*/ + +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; diff --git a/src/api/routes/users/@me/collectibles-marketing.ts b/src/api/routes/users/@me/collectibles-marketing.ts new file mode 100644 index 00000000..e0443101 --- /dev/null +++ b/src/api/routes/users/@me/collectibles-marketing.ts @@ -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 . +*/ + +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; diff --git a/src/api/routes/users/@me/collectibles-purchases.ts b/src/api/routes/users/@me/collectibles-purchases.ts new file mode 100644 index 00000000..5c134505 --- /dev/null +++ b/src/api/routes/users/@me/collectibles-purchases.ts @@ -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 . +*/ + +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;