mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor(api): 🔥 Remove old @versia/client version
This commit is contained in:
parent
54e282b03c
commit
8d1af1b0cd
121 changed files with 649 additions and 756 deletions
|
|
@ -2,8 +2,9 @@ import type { OpenAPIHono } from "@hono/zod-openapi";
|
|||
import { z } from "@hono/zod-openapi";
|
||||
import { zValidator } from "@hono/zod-validator";
|
||||
import { getLogger } from "@logtape/logtape";
|
||||
import type { RolePermission } from "@versia/client/schemas";
|
||||
import { Application, Emoji, Note, Token, User, db } from "@versia/kit/db";
|
||||
import { Challenges, type RolePermissions } from "@versia/kit/tables";
|
||||
import { Challenges } from "@versia/kit/tables";
|
||||
import { extractParams, verifySolution } from "altcha-lib";
|
||||
import chalk from "chalk";
|
||||
import { type SQL, eq } from "drizzle-orm";
|
||||
|
|
@ -185,7 +186,7 @@ export const handleZodError = (
|
|||
|
||||
const checkPermissions = (
|
||||
auth: AuthData | null,
|
||||
required: RolePermissions[],
|
||||
required: RolePermission[],
|
||||
): void => {
|
||||
const userPerms = auth?.user
|
||||
? auth.user.getAllPermissions()
|
||||
|
|
@ -291,7 +292,7 @@ type HonoEnvWithAuth = HonoEnv & {
|
|||
|
||||
export const auth = <AuthRequired extends boolean>(options: {
|
||||
auth: AuthRequired;
|
||||
permissions?: RolePermissions[];
|
||||
permissions?: RolePermission[];
|
||||
challenge?: boolean;
|
||||
scopes?: string[];
|
||||
// If authRequired is true, HonoEnv.Variables.auth.user will never be null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue