diff --git a/bun.lockb b/bun.lockb index 36d6e366..db943cf3 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 7dd56137..c858261f 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,7 @@ "@oclif/core": "^4.0.19", "@sentry/bun": "^8.26.0", "@tufjs/canonical-json": "^2.0.0", - "@versia/federation": "^0.1.0-rc.0", + "@versia/federation": "^0.1.0-rc.1", "altcha-lib": "^0.5.1", "blurhash": "^2.0.5", "bullmq": "^5.12.10", diff --git a/server/api/users/:uuid/outbox/index.ts b/server/api/users/:uuid/outbox/index.ts index 22c40c20..1dbba9bb 100644 --- a/server/api/users/:uuid/outbox/index.ts +++ b/server/api/users/:uuid/outbox/index.ts @@ -1,6 +1,6 @@ import { apiRoute, applyConfig, handleZodError } from "@/api"; import { zValidator } from "@hono/zod-validator"; -import type { Entity } from "@versia/federation/types"; +import type { Collection } from "@versia/federation/types"; import { and, count, eq, inArray } from "drizzle-orm"; import { z } from "zod"; import { db } from "~/drizzle/db"; @@ -108,14 +108,9 @@ export default apiRoute((app) => ).toString() : null, items: notes.map((note) => note.toVersia()), - }; + } satisfies Collection; - const { headers } = await author.sign( - // @ts-expect-error To fix when I add collections to versia-api - json as Entity, - context.req.url, - "GET", - ); + const { headers } = await author.sign(json, context.req.url, "GET"); return context.json(json, 200, headers.toJSON()); }, diff --git a/types/api.ts b/types/api.ts index 75e023c3..6e644cea 100644 --- a/types/api.ts +++ b/types/api.ts @@ -1,6 +1,7 @@ import type { Hono } from "@hono/hono"; import type { RouterRoute } from "@hono/hono/types"; import type { + Collection, Delete, Follow, FollowAccept, @@ -61,4 +62,5 @@ export type KnownEntity = | FollowReject | Unfollow | Delete - | LikeExtension; + | LikeExtension + | Collection;