refactor: 🚚 Move more utilities into packages

This commit is contained in:
Jesse Wierzbinski 2025-06-15 23:43:27 +02:00
parent 5cae547f8d
commit 3798e170d0
No known key found for this signature in database
140 changed files with 913 additions and 735 deletions

View file

@ -3,6 +3,7 @@ import {
RolePermission,
} from "@versia/client/schemas";
import { ApiError } from "@versia/kit";
import { handleZodError } from "@versia/kit/api";
import { db, Media, Token, User } from "@versia/kit/db";
import { OpenIdAccounts, Users } from "@versia/kit/tables";
import { randomUUIDv7 } from "bun";
@ -12,7 +13,6 @@ import { describeRoute } from "hono-openapi";
import { validator } from "hono-openapi/zod";
import { SignJWT } from "jose";
import { z } from "zod";
import { handleZodError } from "@/api";
import { randomString } from "@/math.ts";
import type { PluginType } from "../../index.ts";
import { automaticOidcFlow } from "../../utils.ts";

View file

@ -1,10 +1,10 @@
import { handleZodError, jsonOrForm } from "@versia/kit/api";
import { db, Token } from "@versia/kit/db";
import { Tokens } from "@versia/kit/tables";
import { and, eq } from "drizzle-orm";
import { describeRoute } from "hono-openapi";
import { resolver, validator } from "hono-openapi/zod";
import { z } from "zod";
import { handleZodError, jsonOrForm } from "@/api";
import type { PluginType } from "../../index.ts";
export default (plugin: PluginType): void => {

View file

@ -1,3 +1,4 @@
import { handleZodError } from "@versia/kit/api";
import { Application, db } from "@versia/kit/db";
import { OpenIdLoginFlows } from "@versia/kit/tables";
import { randomUUIDv7 } from "bun";
@ -10,7 +11,6 @@ import {
processDiscoveryResponse,
} from "oauth4webapi";
import { z } from "zod";
import { handleZodError } from "@/api.ts";
import type { PluginType } from "../../index.ts";
import { oauthRedirectUri } from "../../utils.ts";

View file

@ -1,10 +1,10 @@
import { handleZodError, jsonOrForm } from "@versia/kit/api";
import { Application, Token } from "@versia/kit/db";
import { Tokens } from "@versia/kit/tables";
import { and, eq } from "drizzle-orm";
import { describeRoute } from "hono-openapi";
import { resolver, validator } from "hono-openapi/zod";
import { z } from "zod";
import { handleZodError, jsonOrForm } from "@/api";
import type { PluginType } from "../../index.ts";
export default (plugin: PluginType): void => {