refactor(database): 🚚 Only import ORM table data from @versia/kit

This commit is contained in:
Jesse Wierzbinski 2024-11-01 21:05:54 +01:00
parent 2f8b85a299
commit 7a73b8db91
No known key found for this signature in database
116 changed files with 193 additions and 202 deletions

View file

@ -2,7 +2,8 @@ import type { Context } from "@hono/hono";
import { createMiddleware } from "@hono/hono/factory";
import type { OpenAPIHono } from "@hono/zod-openapi";
import { getLogger } from "@logtape/logtape";
import { Application, type User } from "@versia/kit/db";
import { Application, type User, db } from "@versia/kit/db";
import { Challenges } from "@versia/kit/tables";
import { extractParams, verifySolution } from "altcha-lib";
import chalk from "chalk";
import { eq } from "drizzle-orm";
@ -24,8 +25,6 @@ import { parse } from "qs";
import type { z } from "zod";
import { fromZodError } from "zod-validation-error";
import { type AuthData, getFromHeader } from "~/classes/functions/user";
import { db } from "~/drizzle/db";
import { Challenges } from "~/drizzle/schema";
import { config } from "~/packages/config-manager/index.ts";
import type { ApiRouteMetadata, HonoEnv, HttpVerb } from "~/types/api";

View file

@ -1,7 +1,7 @@
import { db } from "@versia/kit/db";
import { Challenges } from "@versia/kit/tables";
import { createChallenge } from "altcha-lib";
import { sql } from "drizzle-orm";
import { db } from "~/drizzle/db";
import { Challenges } from "~/drizzle/schema";
import { config } from "~/packages/config-manager";
export const generateChallenge = async (

View file

@ -1,10 +1,10 @@
import type { db } from "@versia/kit/db";
import type {
Notification,
findManyNotifications,
} from "~/classes/functions/notification";
import type { Status, findManyNotes } from "~/classes/functions/status";
import type { UserType, findManyUsers } from "~/classes/functions/user";
import type { db } from "~/drizzle/db";
import { config } from "~/packages/config-manager/index.ts";
export async function fetchTimeline<T extends UserType | Status | Notification>(