mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor: 🚚 Move more utilities into packages
This commit is contained in:
parent
5cae547f8d
commit
3798e170d0
140 changed files with 913 additions and 735 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { RolePermission } from "@versia/client/schemas";
|
||||
import { auth, handleZodError, jsonOrForm } from "@versia/kit/api";
|
||||
import { Application, Token, User } from "@versia/kit/db";
|
||||
import { randomUUIDv7 } from "bun";
|
||||
import { describeRoute } from "hono-openapi";
|
||||
|
|
@ -6,7 +7,6 @@ import { validator } from "hono-openapi/zod";
|
|||
import { type JWTPayload, jwtVerify, SignJWT } from "jose";
|
||||
import { JOSEError } from "jose/errors";
|
||||
import { z } from "zod";
|
||||
import { auth, handleZodError, jsonOrForm } from "@/api";
|
||||
import { randomString } from "@/math";
|
||||
import { errorRedirect, errors } from "../errors.ts";
|
||||
import type { PluginType } from "../index.ts";
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { auth } from "@versia/kit/api";
|
||||
import { describeRoute } from "hono-openapi";
|
||||
import { resolver } from "hono-openapi/zod";
|
||||
import { exportJWK } from "jose";
|
||||
import { z } from "zod";
|
||||
import { auth } from "@/api";
|
||||
import type { PluginType } from "../index.ts";
|
||||
|
||||
export default (plugin: PluginType): void => {
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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 => {
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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 => {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import { RolePermission } from "@versia/client/schemas";
|
||||
import { ApiError } from "@versia/kit";
|
||||
import { auth, handleZodError } from "@versia/kit/api";
|
||||
import { db } from "@versia/kit/db";
|
||||
import { OpenIdAccounts } from "@versia/kit/tables";
|
||||
import { and, eq, type SQL } from "drizzle-orm";
|
||||
import { describeRoute } from "hono-openapi";
|
||||
import { resolver, validator } from "hono-openapi/zod";
|
||||
import { z } from "zod";
|
||||
import { auth, handleZodError } from "@/api";
|
||||
import type { PluginType } from "~/plugins/openid";
|
||||
|
||||
export default (plugin: PluginType): void => {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { RolePermission } from "@versia/client/schemas";
|
||||
import { ApiError } from "@versia/kit";
|
||||
import { auth, 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 {
|
|||
generateRandomCodeVerifier,
|
||||
} from "oauth4webapi";
|
||||
import { z } from "zod";
|
||||
import { auth, handleZodError } from "@/api";
|
||||
import type { PluginType } from "../../index.ts";
|
||||
import { oauthDiscoveryRequest, oauthRedirectUri } from "../../utils.ts";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue