mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 13:59:16 +01:00
refactor(federation): ♻️ Rewrite federation SDK
This commit is contained in:
parent
ad1dc13a51
commit
d638610361
72 changed files with 2137 additions and 738 deletions
|
|
@ -1,10 +1,10 @@
|
|||
import { apiRoute, handleZodError } from "@/api";
|
||||
import type { Entity } from "@versia/federation/types";
|
||||
import { describeRoute } from "hono-openapi";
|
||||
import { resolver, validator } from "hono-openapi/zod";
|
||||
import { z } from "zod";
|
||||
import { ApiError } from "~/classes/errors/api-error";
|
||||
import { InboxJobType, inboxQueue } from "~/classes/queues/inbox";
|
||||
import type { JSONObject } from "~/packages/federation/types";
|
||||
|
||||
export default apiRoute((app) =>
|
||||
app.post(
|
||||
|
|
@ -89,7 +89,7 @@ export default apiRoute((app) =>
|
|||
),
|
||||
validator("json", z.any(), handleZodError),
|
||||
async (context) => {
|
||||
const body: Entity = await context.req.valid("json");
|
||||
const body: JSONObject = await context.req.valid("json");
|
||||
|
||||
await inboxQueue.add(InboxJobType.ProcessEntity, {
|
||||
data: body,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue