mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
49 lines
1 KiB
TypeScript
49 lines
1 KiB
TypeScript
import type { OpenAPIHono } from "@hono/zod-openapi";
|
|
import { z } from "@hono/zod-openapi";
|
|
import type {
|
|
Delete,
|
|
Follow,
|
|
FollowAccept,
|
|
FollowReject,
|
|
InstanceMetadata,
|
|
LikeExtension,
|
|
Note,
|
|
Unfollow,
|
|
User,
|
|
} from "@versia/federation/types";
|
|
import type { SocketAddress } from "bun";
|
|
import type { RouterRoute } from "hono/types";
|
|
import type { AuthData } from "~/classes/functions/user";
|
|
import type { Config } from "~/packages/config-manager";
|
|
|
|
export type HttpVerb = "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "OPTIONS";
|
|
|
|
export const ErrorSchema = z.object({
|
|
error: z.string(),
|
|
});
|
|
|
|
export type HonoEnv = {
|
|
Variables: {
|
|
config: Config;
|
|
auth: AuthData;
|
|
};
|
|
Bindings: {
|
|
ip?: SocketAddress | null;
|
|
};
|
|
};
|
|
|
|
export interface ApiRouteExports {
|
|
default: (app: OpenAPIHono<HonoEnv>) => RouterRoute;
|
|
}
|
|
|
|
export type KnownEntity =
|
|
| Note
|
|
| InstanceMetadata
|
|
| User
|
|
| Follow
|
|
| FollowAccept
|
|
| FollowReject
|
|
| Unfollow
|
|
| Delete
|
|
| LikeExtension;
|