mirror of
https://github.com/versia-pub/server.git
synced 2026-04-27 20:59:15 +02:00
refactor: 🔥 Remove dead code
This commit is contained in:
parent
592f7c0ac2
commit
7b05a34cce
36 changed files with 32 additions and 1692 deletions
20
types/api.ts
20
types/api.ts
|
|
@ -1,5 +1,10 @@
|
|||
export interface APIRouteMeta {
|
||||
allowedMethods: ("GET" | "POST" | "PUT" | "DELETE" | "PATCH")[];
|
||||
import type { Hono } from "hono";
|
||||
import type { RouterRoute } from "hono/types";
|
||||
import type { z } from "zod";
|
||||
|
||||
export type HttpVerb = "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "OPTIONS";
|
||||
export interface APIRouteMetadata {
|
||||
allowedMethods: HttpVerb[];
|
||||
ratelimits: {
|
||||
max: number;
|
||||
duration: number;
|
||||
|
|
@ -7,7 +12,16 @@ export interface APIRouteMeta {
|
|||
route: string;
|
||||
auth: {
|
||||
required: boolean;
|
||||
requiredOnMethods?: ("GET" | "POST" | "PUT" | "DELETE" | "PATCH")[];
|
||||
requiredOnMethods?: HttpVerb[];
|
||||
oauthPermissions?: string[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface APIRouteExports {
|
||||
meta: APIRouteMetadata;
|
||||
schemas?: {
|
||||
query?: z.AnyZodObject;
|
||||
body?: z.AnyZodObject;
|
||||
};
|
||||
default: (app: Hono) => RouterRoute;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue