mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-15 01:01:20 +10:00
Rearchitecture for v0.4.0 (#197)
* feat: database redist support * feat: rearchitecture of database schemas, migration reset, and #180 * feat: import redists * fix: giantbomb logging bug * feat: partial user platform support + statusMessage -> message * feat: add user platform filters to store view * fix: sanitize svg uploads ... copilot suggested this I feel dirty. * feat: beginnings of platform & redist management * feat: add server side redist patching * fix: update drop-base commit * feat: import of custom platforms & file extensions * fix: redelete platform * fix: remove platform * feat: uninstall commands, new R UI * checkpoint: before migrating to nuxt v4 * update to nuxt 4 * fix: fixes for Nuxt v4 update * fix: remaining type issues * feat: initial feedback to import other kinds of versions * working commit * fix: lint * feat: redist import
This commit is contained in:
@ -1,20 +1,20 @@
|
||||
import { type } from "arktype";
|
||||
import { readDropValidatedBody, throwingArktype } from "~/server/arktype";
|
||||
import type { ClientCapabilities } from "~~/prisma/client/enums";
|
||||
import { readDropValidatedBody, throwingArktype } from "~~/server/arktype";
|
||||
import type {
|
||||
CapabilityConfiguration,
|
||||
InternalClientCapability,
|
||||
} from "~/server/internal/clients/capabilities";
|
||||
} from "~~/server/internal/clients/capabilities";
|
||||
import capabilityManager, {
|
||||
validCapabilities,
|
||||
} from "~/server/internal/clients/capabilities";
|
||||
import clientHandler, { AuthMode } from "~/server/internal/clients/handler";
|
||||
import { parsePlatform } from "~/server/internal/utils/parseplatform";
|
||||
} from "~~/server/internal/clients/capabilities";
|
||||
import clientHandler, { AuthModes } from "~~/server/internal/clients/handler";
|
||||
import { parsePlatform } from "~~/server/internal/utils/parseplatform";
|
||||
|
||||
const ClientAuthInitiate = type({
|
||||
name: "string",
|
||||
platform: "string",
|
||||
capabilities: "object",
|
||||
mode: type.valueOf(AuthMode).default(AuthMode.Callback),
|
||||
mode: type.enumerated(...AuthModes).default("callback"),
|
||||
}).configure(throwingArktype);
|
||||
|
||||
export default defineEventHandler(async (h3) => {
|
||||
@ -28,11 +28,11 @@ export default defineEventHandler(async (h3) => {
|
||||
if (!platform)
|
||||
throw createError({
|
||||
statusCode: 400,
|
||||
statusMessage: "Invalid or unsupported platform",
|
||||
message: "Invalid or unsupported platform",
|
||||
});
|
||||
|
||||
const capabilityIterable = Object.entries(capabilities) as Array<
|
||||
[InternalClientCapability, object]
|
||||
[ClientCapabilities, object]
|
||||
>;
|
||||
if (
|
||||
capabilityIterable.length > 0 &&
|
||||
@ -42,7 +42,7 @@ export default defineEventHandler(async (h3) => {
|
||||
)
|
||||
throw createError({
|
||||
statusCode: 400,
|
||||
statusMessage: "Invalid capabilities.",
|
||||
message: "Invalid capabilities.",
|
||||
});
|
||||
|
||||
if (
|
||||
@ -57,7 +57,7 @@ export default defineEventHandler(async (h3) => {
|
||||
)
|
||||
throw createError({
|
||||
statusCode: 400,
|
||||
statusMessage: "Invalid capability configuration.",
|
||||
message: "Invalid capability configuration.",
|
||||
});
|
||||
|
||||
const result = await clientHandler.initiate({
|
||||
|
||||
Reference in New Issue
Block a user