1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 20:52:42 +01:00

Add misc routes

This commit is contained in:
uurgothat 2021-09-30 17:57:51 +03:00
parent dbe61a225e
commit 9e07c72a72
14 changed files with 183 additions and 2 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;