From a567ca3f514b7671da5d523325751a8383885d2c Mon Sep 17 00:00:00 2001 From: Puyodead1 Date: Thu, 23 Mar 2023 10:40:37 -0400 Subject: auth routes --- src/api/routes/auth/generate-registration-tokens.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/api/routes/auth/generate-registration-tokens.ts') diff --git a/src/api/routes/auth/generate-registration-tokens.ts b/src/api/routes/auth/generate-registration-tokens.ts index 723875f8..48fe6421 100644 --- a/src/api/routes/auth/generate-registration-tokens.ts +++ b/src/api/routes/auth/generate-registration-tokens.ts @@ -16,7 +16,7 @@ along with this program. If not, see . */ -import { route, random } from "@spacebar/api"; +import { random, route } from "@spacebar/api"; import { Config, ValidRegistrationToken } from "@spacebar/util"; import { Request, Response, Router } from "express"; @@ -25,7 +25,10 @@ export default router; router.get( "/", - route({ right: "OPERATOR" }), + route({ + right: "OPERATOR", + responses: { 200: { body: "GenerateRegistrationTokensResponse" } }, + }), async (req: Request, res: Response) => { const count = req.query.count ? parseInt(req.query.count as string) : 1; const length = req.query.length -- cgit 1.5.1 From 787de501401cce38758a1fd60ac02bbc1fee40c1 Mon Sep 17 00:00:00 2001 From: Puyodead1 Date: Fri, 24 Mar 2023 19:04:51 -0400 Subject: backfill missing query params --- src/api/routes/auth/generate-registration-tokens.ts | 12 ++++++++++++ src/api/routes/channels/#channel_id/messages/index.ts | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'src/api/routes/auth/generate-registration-tokens.ts') diff --git a/src/api/routes/auth/generate-registration-tokens.ts b/src/api/routes/auth/generate-registration-tokens.ts index 48fe6421..80fdaed1 100644 --- a/src/api/routes/auth/generate-registration-tokens.ts +++ b/src/api/routes/auth/generate-registration-tokens.ts @@ -26,6 +26,18 @@ export default router; router.get( "/", route({ + query: { + count: { + type: "number", + description: + "The number of registration tokens to generate. Defaults to 1.", + }, + length: { + type: "number", + description: + "The length of each registration token. Defaults to 255.", + }, + }, right: "OPERATOR", responses: { 200: { body: "GenerateRegistrationTokensResponse" } }, }), diff --git a/src/api/routes/channels/#channel_id/messages/index.ts b/src/api/routes/channels/#channel_id/messages/index.ts index ddc42d28..3d6cc596 100644 --- a/src/api/routes/channels/#channel_id/messages/index.ts +++ b/src/api/routes/channels/#channel_id/messages/index.ts @@ -76,6 +76,22 @@ export function isTextChannel(type: ChannelType): boolean { router.get( "/", route({ + query: { + around: { + type: "string", + }, + before: { + type: "string", + }, + after: { + type: "string", + }, + limit: { + type: "number", + description: + "max number of messages to return (1-100). defaults to 50", + }, + }, responses: { 200: { body: "ChannelMessagesResponse", -- cgit 1.5.1