mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor: ⬆️ Upgrade to Zod v4 and hono-openapi 0.5.0
This commit is contained in:
parent
add2429606
commit
24d4150da4
209 changed files with 1331 additions and 1622 deletions
|
|
@ -2,7 +2,7 @@ import type { ContentFormatSchema } from "@versia/sdk/schemas";
|
|||
import { config } from "@versia-server/config";
|
||||
import { htmlToText as htmlToTextLib } from "html-to-text";
|
||||
import { lookup } from "mime-types";
|
||||
import type { z } from "zod";
|
||||
import type { z } from "zod/v4";
|
||||
|
||||
export const getBestContentType = (
|
||||
content?: z.infer<typeof ContentFormatSchema> | null,
|
||||
|
|
|
|||
16
utils/rss.ts
16
utils/rss.ts
|
|
@ -70,11 +70,11 @@ export const getFeed = async (user: User, page = 0): Promise<Feed> => {
|
|||
url: image.getUrl().href,
|
||||
title:
|
||||
image.data.content[image.getPreferredMimeType()]
|
||||
.description ?? undefined,
|
||||
?.description ?? undefined,
|
||||
type: image.getPreferredMimeType(),
|
||||
length:
|
||||
image.data.content[image.getPreferredMimeType()]
|
||||
.size ?? undefined,
|
||||
?.size ?? undefined,
|
||||
}
|
||||
: undefined,
|
||||
video: video
|
||||
|
|
@ -82,14 +82,14 @@ export const getFeed = async (user: User, page = 0): Promise<Feed> => {
|
|||
url: video.getUrl().href,
|
||||
title:
|
||||
video.data.content[video.getPreferredMimeType()]
|
||||
.description ?? undefined,
|
||||
?.description ?? undefined,
|
||||
type: video.getPreferredMimeType(),
|
||||
duration:
|
||||
video.data.content[video.getPreferredMimeType()]
|
||||
.duration ?? undefined,
|
||||
?.duration ?? undefined,
|
||||
length:
|
||||
video.data.content[video.getPreferredMimeType()]
|
||||
.size ?? undefined,
|
||||
?.size ?? undefined,
|
||||
}
|
||||
: undefined,
|
||||
audio: audio
|
||||
|
|
@ -97,14 +97,14 @@ export const getFeed = async (user: User, page = 0): Promise<Feed> => {
|
|||
url: audio.getUrl().href,
|
||||
title:
|
||||
audio.data.content[audio.getPreferredMimeType()]
|
||||
.description ?? undefined,
|
||||
?.description ?? undefined,
|
||||
type: audio.getPreferredMimeType(),
|
||||
duration:
|
||||
audio.data.content[audio.getPreferredMimeType()]
|
||||
.duration ?? undefined,
|
||||
?.duration ?? undefined,
|
||||
length:
|
||||
audio.data.content[audio.getPreferredMimeType()]
|
||||
.size ?? undefined,
|
||||
?.size ?? undefined,
|
||||
}
|
||||
: undefined,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import type { ConfigSchema } from "@versia-server/config";
|
|||
import { debugResponse } from "@versia-server/kit/api";
|
||||
import { type Server, serve } from "bun";
|
||||
import type { Hono } from "hono";
|
||||
import type { z } from "zod";
|
||||
import type { z } from "zod/v4";
|
||||
import type { HonoEnv } from "~/types/api";
|
||||
|
||||
export const createServer = (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue