mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 13:59:16 +01:00
refactor(api): ♻️ Move from @hono/zod-openapi to hono-openapi
hono-openapi is easier to work with and generates better OpenAPI definitions
This commit is contained in:
parent
0576aff972
commit
58342e86e1
240 changed files with 9494 additions and 9575 deletions
|
|
@ -1,4 +1,3 @@
|
|||
import type { z } from "@hono/zod-openapi";
|
||||
import type {
|
||||
Application as ApplicationSchema,
|
||||
CredentialApplication,
|
||||
|
|
@ -13,6 +12,7 @@ import {
|
|||
eq,
|
||||
inArray,
|
||||
} from "drizzle-orm";
|
||||
import type { z } from "zod";
|
||||
import { BaseInterface } from "./base.ts";
|
||||
|
||||
type ApplicationType = InferSelectModel<typeof Applications>;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import { emojiValidatorWithColons, emojiValidatorWithIdentifiers } from "@/api";
|
||||
import { proxyUrl } from "@/response";
|
||||
import type { z } from "@hono/zod-openapi";
|
||||
import type { CustomEmoji } from "@versia/client/schemas";
|
||||
import type { CustomEmojiExtension } from "@versia/federation/types";
|
||||
import { type Instance, Media, db } from "@versia/kit/db";
|
||||
|
|
@ -15,6 +14,7 @@ import {
|
|||
inArray,
|
||||
isNull,
|
||||
} from "drizzle-orm";
|
||||
import type { z } from "zod";
|
||||
import { BaseInterface } from "./base.ts";
|
||||
|
||||
type EmojiType = InferSelectModel<typeof Emojis> & {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import { join } from "node:path";
|
||||
import { mimeLookup } from "@/content_types.ts";
|
||||
import { proxyUrl } from "@/response";
|
||||
import type { z } from "@hono/zod-openapi";
|
||||
import type { Attachment as AttachmentSchema } from "@versia/client/schemas";
|
||||
import type { ContentFormat } from "@versia/federation/types";
|
||||
import { db } from "@versia/kit/db";
|
||||
|
|
@ -16,6 +15,7 @@ import {
|
|||
inArray,
|
||||
} from "drizzle-orm";
|
||||
import sharp from "sharp";
|
||||
import type { z } from "zod";
|
||||
import { MediaBackendType } from "~/classes/config/schema.ts";
|
||||
import { config } from "~/config.ts";
|
||||
import { ApiError } from "../errors/api-error.ts";
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import { idValidator } from "@/api";
|
|||
import { mergeAndDeduplicate } from "@/lib.ts";
|
||||
import { sanitizedHtmlStrip } from "@/sanitization";
|
||||
import { sentry } from "@/sentry";
|
||||
import type { z } from "@hono/zod-openapi";
|
||||
import { getLogger } from "@logtape/logtape";
|
||||
import type { Status, Status as StatusSchema } from "@versia/client/schemas";
|
||||
import { EntityValidator } from "@versia/federation";
|
||||
|
|
@ -32,6 +31,7 @@ import {
|
|||
} from "drizzle-orm";
|
||||
import { htmlToText } from "html-to-text";
|
||||
import { createRegExp, exactly, global } from "magic-regexp";
|
||||
import type { z } from "zod";
|
||||
import {
|
||||
contentToHtml,
|
||||
findManyNotes,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import type { z } from "@hono/zod-openapi";
|
||||
import type { Notification as NotificationSchema } from "@versia/client/schemas";
|
||||
import { Note, User, db } from "@versia/kit/db";
|
||||
import { Notifications } from "@versia/kit/tables";
|
||||
|
|
@ -10,6 +9,7 @@ import {
|
|||
eq,
|
||||
inArray,
|
||||
} from "drizzle-orm";
|
||||
import type { z } from "zod";
|
||||
import {
|
||||
transformOutputToUserWithRelations,
|
||||
userExtrasTemplate,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import type { z } from "@hono/zod-openapi";
|
||||
import type { WebPushSubscription as WebPushSubscriptionSchema } from "@versia/client/schemas";
|
||||
import { type Token, type User, db } from "@versia/kit/db";
|
||||
import { PushSubscriptions, Tokens } from "@versia/kit/tables";
|
||||
|
|
@ -10,6 +9,7 @@ import {
|
|||
eq,
|
||||
inArray,
|
||||
} from "drizzle-orm";
|
||||
import type { z } from "zod";
|
||||
import { BaseInterface } from "./base.ts";
|
||||
|
||||
type PushSubscriptionType = InferSelectModel<typeof PushSubscriptions>;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import { z } from "@hono/zod-openapi";
|
||||
import type { Relationship as RelationshipSchema } from "@versia/client/schemas";
|
||||
import { db } from "@versia/kit/db";
|
||||
import { Relationships } from "@versia/kit/tables";
|
||||
|
|
@ -11,6 +10,7 @@ import {
|
|||
eq,
|
||||
inArray,
|
||||
} from "drizzle-orm";
|
||||
import { z } from "zod";
|
||||
import { BaseInterface } from "./base.ts";
|
||||
import type { User } from "./user.ts";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import { proxyUrl } from "@/response";
|
||||
import type { z } from "@hono/zod-openapi";
|
||||
import type { Role as RoleSchema } from "@versia/client/schemas";
|
||||
import type { RolePermission } from "@versia/client/schemas";
|
||||
import { db } from "@versia/kit/db";
|
||||
|
|
@ -13,6 +12,7 @@ import {
|
|||
eq,
|
||||
inArray,
|
||||
} from "drizzle-orm";
|
||||
import type { z } from "zod";
|
||||
import { config } from "~/config.ts";
|
||||
import { BaseInterface } from "./base.ts";
|
||||
type RoleType = InferSelectModel<typeof Roles>;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import type { z } from "@hono/zod-openapi";
|
||||
import type { Token as TokenSchema } from "@versia/client/schemas";
|
||||
import { type Application, User, db } from "@versia/kit/db";
|
||||
import { Tokens } from "@versia/kit/tables";
|
||||
|
|
@ -10,6 +9,7 @@ import {
|
|||
eq,
|
||||
inArray,
|
||||
} from "drizzle-orm";
|
||||
import type { z } from "zod";
|
||||
import { BaseInterface } from "./base.ts";
|
||||
|
||||
type TokenType = InferSelectModel<typeof Tokens> & {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import { getBestContentType } from "@/content_types";
|
|||
import { randomString } from "@/math";
|
||||
import { proxyUrl } from "@/response";
|
||||
import { sentry } from "@/sentry";
|
||||
import type { z } from "@hono/zod-openapi";
|
||||
import { getLogger } from "@logtape/logtape";
|
||||
import type {
|
||||
Account,
|
||||
|
|
@ -50,6 +49,7 @@ import {
|
|||
sql,
|
||||
} from "drizzle-orm";
|
||||
import { htmlToText } from "html-to-text";
|
||||
import type { z } from "zod";
|
||||
import { findManyUsers } from "~/classes/functions/user";
|
||||
import { searchManager } from "~/classes/search/search-manager";
|
||||
import { config } from "~/config.ts";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue