2024-09-16 15:29:09 +02:00
|
|
|
import type { SocketAddress } from "bun";
|
2025-03-29 03:30:06 +01:00
|
|
|
import type { Hono } from "hono";
|
2024-12-18 20:42:40 +01:00
|
|
|
import type { RouterRoute } from "hono/types";
|
2025-03-29 03:30:06 +01:00
|
|
|
import type { z } from "zod";
|
2025-02-15 02:47:29 +01:00
|
|
|
import type { ConfigSchema } from "~/classes/config/schema";
|
2024-11-03 17:45:21 +01:00
|
|
|
import type { AuthData } from "~/classes/functions/user";
|
2025-04-08 21:54:55 +02:00
|
|
|
import type * as VersiaEntities from "~/packages/sdk/entities";
|
2024-05-07 05:13:37 +02:00
|
|
|
|
|
|
|
|
export type HttpVerb = "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "OPTIONS";
|
|
|
|
|
|
2024-08-27 17:20:36 +02:00
|
|
|
export type HonoEnv = {
|
|
|
|
|
Variables: {
|
2025-02-15 02:47:29 +01:00
|
|
|
config: z.infer<typeof ConfigSchema>;
|
2024-11-03 17:45:21 +01:00
|
|
|
auth: AuthData;
|
2024-08-27 17:20:36 +02:00
|
|
|
};
|
2024-09-16 15:29:09 +02:00
|
|
|
Bindings: {
|
|
|
|
|
ip?: SocketAddress | null;
|
|
|
|
|
};
|
2024-08-27 17:20:36 +02:00
|
|
|
};
|
|
|
|
|
|
2024-06-13 04:26:43 +02:00
|
|
|
export interface ApiRouteExports {
|
2025-03-29 03:30:06 +01:00
|
|
|
default: (app: Hono<HonoEnv>) => RouterRoute;
|
2024-05-07 05:13:37 +02:00
|
|
|
}
|
2024-08-26 19:06:49 +02:00
|
|
|
|
|
|
|
|
export type KnownEntity =
|
2025-04-08 16:01:10 +02:00
|
|
|
| VersiaEntities.Note
|
|
|
|
|
| VersiaEntities.InstanceMetadata
|
|
|
|
|
| VersiaEntities.User
|
|
|
|
|
| VersiaEntities.Follow
|
|
|
|
|
| VersiaEntities.FollowAccept
|
|
|
|
|
| VersiaEntities.FollowReject
|
|
|
|
|
| VersiaEntities.Unfollow
|
|
|
|
|
| VersiaEntities.Delete
|
2025-05-02 12:48:47 +02:00
|
|
|
| VersiaEntities.Like
|
|
|
|
|
| VersiaEntities.Share;
|