diff options
author | uurgothat <cckhmck@gmail.com> | 2021-09-30 17:57:51 +0300 |
---|---|---|
committer | uurgothat <cckhmck@gmail.com> | 2021-09-30 17:57:51 +0300 |
commit | 9e07c72a72e60ca8c3c3e6270867accd32b56ece (patch) | |
tree | 730cedf62e5075fd3f3d165d3e1fcbb1a81b91db /api/src/routes | |
parent | Merge pull request #402 from Thesourtimes/master (diff) | |
download | server-9e07c72a72e60ca8c3c3e6270867accd32b56ece.tar.xz |
Add misc routes
Diffstat (limited to 'api/src/routes')
14 files changed, 183 insertions, 2 deletions
diff --git a/api/src/routes/applications/#id/entitlements.ts b/api/src/routes/applications/#id/entitlements.ts new file mode 100644 index 00000000..1152e500 --- /dev/null +++ b/api/src/routes/applications/#id/entitlements.ts @@ -0,0 +1,12 @@ +import { Router, Response, Request } from "express"; +import { route } from "@fosscord/api"; + +const router = Router(); + +router.get("/", route({}), (req: Request, res: Response) => { + // TODO: + //const { exclude_consumed } = req.query; + res.status(200).send([]); +}); + +export default router; diff --git a/api/src/routes/channels/#channel_id/messages/#message_id/crosspost.ts b/api/src/routes/channels/#channel_id/messages/#message_id/crosspost.ts index 6753e832..8174a61f 100644 --- a/api/src/routes/channels/#channel_id/messages/#message_id/crosspost.ts +++ b/api/src/routes/channels/#channel_id/messages/#message_id/crosspost.ts @@ -1,8 +1,31 @@ import { Router, Response, Request } from "express"; +import { route } from "@fosscord/api"; const router = Router(); -// TODO: -// router.post("/", (req: Request, res: Response) => {}); +router.post("/", route({ permission: "MANAGE_MESSAGES" }), (req: Request, res: Response) => { + // TODO: + //const { locale, primary_only } = req.query; + res.json({ + id: "", + type: 0, + content: "", + channel_id: "", + author: {id: "", + username: "", + avatar: "", + discriminator: "", public_flags: 64}, + attachments: [], + embeds: [], + mentions: [], + mention_roles: [], + pinned: false, + mention_everyone: false, + tts: false, + timestamp: "", + edited_timestamp: null, + flags: 1, components: []}).status(200); +}); export default router; + diff --git a/api/src/routes/discovery.ts b/api/src/routes/discovery.ts new file mode 100644 index 00000000..9e6e0164 --- /dev/null +++ b/api/src/routes/discovery.ts @@ -0,0 +1,12 @@ +import { Router, Response, Request } from "express"; +import { route } from "@fosscord/api"; + +const router = Router(); + +router.get("/categories", route({}), (req: Request, res: Response) => { + // TODO: + //const { locale, primary_only } = req.query; + res.json([]).status(200); +}); + +export default router; diff --git a/api/src/routes/stage-instances.ts b/api/src/routes/stage-instances.ts new file mode 100644 index 00000000..411e95bf --- /dev/null +++ b/api/src/routes/stage-instances.ts @@ -0,0 +1,11 @@ +import { Request, Response, Router } from "express"; +import { route } from "@fosscord/api"; + +const router: Router = Router(); + +router.get("/", route({}), async (req: Request, res: Response) => { + //TODO + res.json([]).status(200); +}); + +export default router; diff --git a/api/src/routes/store/applications/#id/index.ts b/api/src/routes/store/published-listings/applications.ts index 53b61c29..53b61c29 100644 --- a/api/src/routes/store/applications/#id/index.ts +++ b/api/src/routes/store/published-listings/applications.ts diff --git a/api/src/routes/store/published-listings/applications/#id/subscription-plans.ts b/api/src/routes/store/published-listings/applications/#id/subscription-plans.ts new file mode 100644 index 00000000..77f949d9 --- /dev/null +++ b/api/src/routes/store/published-listings/applications/#id/subscription-plans.ts @@ -0,0 +1,24 @@ +import { Request, Response, Router } from "express"; +import { route } from "@fosscord/api"; + +const router: Router = Router(); + +router.get("/", route({}), async (req: Request, res: Response) => { + //TODO + res.json([ + { + id: "", + name: "", + interval: 1, + interval_count: 1, + tax_inclusive: true, + sku_id: "", + fallback_price: 499, + fallback_currency: "eur", + currency: "eur", + price: 4199, + price_tier: null + }]).status(200); +}); + +export default router; diff --git a/api/src/routes/store/skus/#id/index.ts b/api/src/routes/store/published-listings/skus.ts index 53b61c29..53b61c29 100644 --- a/api/src/routes/store/skus/#id/index.ts +++ b/api/src/routes/store/published-listings/skus.ts diff --git a/api/src/routes/store/published-listings/skus/#id/subscription-plans.ts b/api/src/routes/store/published-listings/skus/#id/subscription-plans.ts new file mode 100644 index 00000000..77f949d9 --- /dev/null +++ b/api/src/routes/store/published-listings/skus/#id/subscription-plans.ts @@ -0,0 +1,24 @@ +import { Request, Response, Router } from "express"; +import { route } from "@fosscord/api"; + +const router: Router = Router(); + +router.get("/", route({}), async (req: Request, res: Response) => { + //TODO + res.json([ + { + id: "", + name: "", + interval: 1, + interval_count: 1, + tax_inclusive: true, + sku_id: "", + fallback_price: 499, + fallback_currency: "eur", + currency: "eur", + price: 4199, + price_tier: null + }]).status(200); +}); + +export default router; diff --git a/api/src/routes/users/@me/activities/statistics/applications.ts b/api/src/routes/users/@me/activities/statistics/applications.ts new file mode 100644 index 00000000..834be35c --- /dev/null +++ b/api/src/routes/users/@me/activities/statistics/applications.ts @@ -0,0 +1,11 @@ +import { Router, Response, Request } from "express"; +import { route } from "@fosscord/api"; + +const router = Router(); + +router.get("/", route({}), (req: Request, res: Response) => { + // TODO: + res.json([]).status(200) +}); + +export default router; diff --git a/api/src/routes/users/@me/billing/payment-sources.ts b/api/src/routes/users/@me/billing/payment-sources.ts new file mode 100644 index 00000000..834be35c --- /dev/null +++ b/api/src/routes/users/@me/billing/payment-sources.ts @@ -0,0 +1,11 @@ +import { Router, Response, Request } from "express"; +import { route } from "@fosscord/api"; + +const router = Router(); + +router.get("/", route({}), (req: Request, res: Response) => { + // TODO: + res.json([]).status(200) +}); + +export default router; diff --git a/api/src/routes/users/@me/email-settings.ts b/api/src/routes/users/@me/email-settings.ts new file mode 100644 index 00000000..2d961a0e --- /dev/null +++ b/api/src/routes/users/@me/email-settings.ts @@ -0,0 +1,19 @@ +import { Router, Response, Request } from "express"; +import { route } from "@fosscord/api"; + +const router = Router(); + +router.get("/", route({}), (req: Request, res: Response) => { + // TODO: + res.json({ + categories: { + social: true, + communication: true, + tips: false, + updates_and_announcements: false, + recommendations_and_events: false }, + initialized: false + }).status(200); +}); + +export default router; diff --git a/api/src/routes/users/@me/entitlements.ts b/api/src/routes/users/@me/entitlements.ts new file mode 100644 index 00000000..7be3634b --- /dev/null +++ b/api/src/routes/users/@me/entitlements.ts @@ -0,0 +1,12 @@ +import { Router, Response, Request } from "express"; +import { route } from "@fosscord/api"; + +const router = Router(); + +router.get("/gifts", route({}), (req: Request, res: Response) => { + // TODO: + //const { locale, primary_only } = req.query; + res.json([]).status(200); +}); + +export default router; diff --git a/api/src/routes/users/@me/guilds/premium/subscription-slots.ts b/api/src/routes/users/@me/guilds/premium/subscription-slots.ts new file mode 100644 index 00000000..b487a2ce --- /dev/null +++ b/api/src/routes/users/@me/guilds/premium/subscription-slots.ts @@ -0,0 +1,11 @@ +import { Router, Response, Request } from "express"; +import { route } from "@fosscord/api"; + +const router = Router(); + +router.get("/", route({}), (req: Request, res: Response) => { + // TODO: + res.json([]).status(200)); +}); + +export default router; diff --git a/api/src/routes/users/@me/notes.ts b/api/src/routes/users/@me/notes.ts new file mode 100644 index 00000000..235c2baf --- /dev/null +++ b/api/src/routes/users/@me/notes.ts @@ -0,0 +1,11 @@ +import { Request, Response, Router } from "express"; +import { route } from "@fosscord/api"; + +const router: Router = Router(); + +router.put("/", route({}), async (req: Request, res: Response) => { + //TODO + res.json({code: 0}).status(400); +}); + +export default router; |