mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
docs(federation): 📝 Update SDK documentation
This commit is contained in:
parent
f79b0bc999
commit
45e5460975
67 changed files with 332 additions and 65 deletions
|
|
@ -2,13 +2,13 @@ import { apiRoute, handleZodError } from "@/api";
|
|||
import { Status as StatusSchema } from "@versia/client/schemas";
|
||||
import { Note } from "@versia/kit/db";
|
||||
import { Notes } from "@versia/kit/tables";
|
||||
import { NoteSchema } from "@versia/sdk/schemas";
|
||||
import { and, eq, inArray } from "drizzle-orm";
|
||||
import { describeRoute } from "hono-openapi";
|
||||
import { resolver, validator } from "hono-openapi/zod";
|
||||
import { z } from "zod";
|
||||
import { ApiError } from "~/classes/errors/api-error";
|
||||
import { config } from "~/config.ts";
|
||||
import { NoteSchema } from "~/packages/sdk/schemas";
|
||||
|
||||
export default apiRoute((app) =>
|
||||
app.get(
|
||||
|
|
|
|||
|
|
@ -2,14 +2,14 @@ import { apiRoute, handleZodError } from "@/api";
|
|||
import { Status as StatusSchema } from "@versia/client/schemas";
|
||||
import { Note, db } from "@versia/kit/db";
|
||||
import { Notes } from "@versia/kit/tables";
|
||||
import * as VersiaEntities from "@versia/sdk/entities";
|
||||
import { URICollectionSchema } from "@versia/sdk/schemas";
|
||||
import { and, eq, inArray } from "drizzle-orm";
|
||||
import { describeRoute } from "hono-openapi";
|
||||
import { resolver, validator } from "hono-openapi/zod";
|
||||
import { z } from "zod";
|
||||
import { ApiError } from "~/classes/errors/api-error";
|
||||
import { config } from "~/config.ts";
|
||||
import * as VersiaEntities from "~/packages/sdk/entities";
|
||||
import { URICollectionSchema } from "~/packages/sdk/schemas";
|
||||
|
||||
export default apiRoute((app) =>
|
||||
app.get(
|
||||
|
|
@ -94,7 +94,9 @@ export default apiRoute((app) =>
|
|||
last:
|
||||
replyCount > limit
|
||||
? new URL(
|
||||
`/notes/${note.id}/quotes?offset=${replyCount - limit}`,
|
||||
`/notes/${note.id}/quotes?offset=${
|
||||
replyCount - limit
|
||||
}`,
|
||||
config.http.base_url,
|
||||
)
|
||||
: new URL(
|
||||
|
|
@ -104,14 +106,18 @@ export default apiRoute((app) =>
|
|||
next:
|
||||
offset + limit < replyCount
|
||||
? new URL(
|
||||
`/notes/${note.id}/quotes?offset=${offset + limit}`,
|
||||
`/notes/${note.id}/quotes?offset=${
|
||||
offset + limit
|
||||
}`,
|
||||
config.http.base_url,
|
||||
)
|
||||
: null,
|
||||
previous:
|
||||
offset - limit >= 0
|
||||
? new URL(
|
||||
`/notes/${note.id}/quotes?offset=${offset - limit}`,
|
||||
`/notes/${note.id}/quotes?offset=${
|
||||
offset - limit
|
||||
}`,
|
||||
config.http.base_url,
|
||||
)
|
||||
: null,
|
||||
|
|
|
|||
|
|
@ -2,14 +2,14 @@ import { apiRoute, handleZodError } from "@/api";
|
|||
import { Status as StatusSchema } from "@versia/client/schemas";
|
||||
import { Note, db } from "@versia/kit/db";
|
||||
import { Notes } from "@versia/kit/tables";
|
||||
import * as VersiaEntities from "@versia/sdk/entities";
|
||||
import { URICollectionSchema } from "@versia/sdk/schemas";
|
||||
import { and, eq, inArray } from "drizzle-orm";
|
||||
import { describeRoute } from "hono-openapi";
|
||||
import { resolver, validator } from "hono-openapi/zod";
|
||||
import { z } from "zod";
|
||||
import { ApiError } from "~/classes/errors/api-error";
|
||||
import { config } from "~/config.ts";
|
||||
import * as VersiaEntities from "~/packages/sdk/entities";
|
||||
import { URICollectionSchema } from "~/packages/sdk/schemas";
|
||||
|
||||
export default apiRoute((app) =>
|
||||
app.get(
|
||||
|
|
@ -92,7 +92,9 @@ export default apiRoute((app) =>
|
|||
last:
|
||||
replyCount > limit
|
||||
? new URL(
|
||||
`/notes/${note.id}/replies?offset=${replyCount - limit}`,
|
||||
`/notes/${note.id}/replies?offset=${
|
||||
replyCount - limit
|
||||
}`,
|
||||
config.http.base_url,
|
||||
)
|
||||
: new URL(
|
||||
|
|
@ -102,14 +104,18 @@ export default apiRoute((app) =>
|
|||
next:
|
||||
offset + limit < replyCount
|
||||
? new URL(
|
||||
`/notes/${note.id}/replies?offset=${offset + limit}`,
|
||||
`/notes/${note.id}/replies?offset=${
|
||||
offset + limit
|
||||
}`,
|
||||
config.http.base_url,
|
||||
)
|
||||
: null,
|
||||
previous:
|
||||
offset - limit >= 0
|
||||
? new URL(
|
||||
`/notes/${note.id}/replies?offset=${offset - limit}`,
|
||||
`/notes/${note.id}/replies?offset=${
|
||||
offset - limit
|
||||
}`,
|
||||
config.http.base_url,
|
||||
)
|
||||
: null,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue