update to nuxt 4

This commit is contained in:
DecDuck
2025-09-20 11:20:49 +10:00
parent b4f9b77809
commit 2db8e753b7
313 changed files with 508 additions and 512 deletions

View File

@ -1,6 +1,6 @@
import type { EnumDictionary } from "../utils/types";
import prisma from "../db/database";
import { ClientCapabilities } from "~/prisma/client/enums";
import { ClientCapabilities } from "~~/prisma/client/enums";
// These values are technically mapped to the database,
// but Typescript/Prisma doesn't let me link them

View File

@ -1,8 +1,8 @@
import type { ClientModel, UserModel } from "~/prisma/client/models";
import type { ClientModel, UserModel } from "~~/prisma/client/models";
import type { EventHandlerRequest, H3Event } from "h3";
import droplet from "@drop-oss/droplet";
import prisma from "../db/database";
import { useCertificateAuthority } from "~/server/plugins/ca";
import { useCertificateAuthority } from "~~/server/plugins/ca";
export type EventHandlerFunction<T> = (
h3: H3Event<EventHandlerRequest>,
@ -23,7 +23,7 @@ export function defineClientEventHandler<T>(handler: EventHandlerFunction<T>) {
if (!header) throw createError({ statusCode: 403 });
const [method, ...parts] = header.split(" ");
let clientId: string;
let clientId: string | undefined;
switch (method) {
case "Debug": {
if (!import.meta.dev) throw createError({ statusCode: 403 });
@ -93,7 +93,7 @@ export function defineClientEventHandler<T>(handler: EventHandlerFunction<T>) {
async function fetchClient() {
const client = await prisma.client.findUnique({
where: { id: clientId },
where: { id: clientId! },
});
if (!client)
throw new Error(
@ -104,7 +104,7 @@ export function defineClientEventHandler<T>(handler: EventHandlerFunction<T>) {
async function fetchUser() {
const client = await prisma.client.findUnique({
where: { id: clientId },
where: { id: clientId! },
select: {
user: true,
},

View File

@ -1,7 +1,7 @@
import { randomUUID } from "node:crypto";
import prisma from "../db/database";
import type { HardwarePlatform } from "~/prisma/client/enums";
import { useCertificateAuthority } from "~/server/plugins/ca";
import type { HardwarePlatform } from "~~/prisma/client/enums";
import { useCertificateAuthority } from "~~/server/plugins/ca";
import type {
CapabilityConfiguration,
InternalClientCapability,