mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-15 17:21:13 +10:00
feat: import redists
This commit is contained in:
@ -84,6 +84,8 @@ export const systemACLDescriptions: ObjectFromList<typeof systemACLs> = {
|
||||
"import:game:read":
|
||||
"Fetch games to be imported, and search the metadata for games.",
|
||||
"import:game:new": "Import a game.",
|
||||
"import:redist:read": "Fetch redists to be imported.",
|
||||
"import:redist:new": "Import a redist.",
|
||||
|
||||
"tags:read": "Fetch all tags",
|
||||
"tags:create": "Create a tag",
|
||||
|
||||
@ -74,9 +74,10 @@ export const systemACLs = [
|
||||
|
||||
"import:version:read",
|
||||
"import:version:new",
|
||||
|
||||
"import:game:read",
|
||||
"import:game:new",
|
||||
"import:redist:read",
|
||||
"import:redist:new",
|
||||
|
||||
"user:read",
|
||||
"user:delete",
|
||||
|
||||
@ -336,7 +336,7 @@ class LibraryManager {
|
||||
nonce: `version-create-${gameId}-${versionPath}`,
|
||||
title: `'${game.mName}' ('${versionPath}') finished importing.`,
|
||||
description: `Drop finished importing version ${versionPath} for ${game.mName}.`,
|
||||
actions: [`View|/admin/library/${gameId}`],
|
||||
actions: [`View|/admin/library/g/${gameId}`],
|
||||
acls: ["system:import:version:read"],
|
||||
});
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import type { EventHandlerRequest, H3Event } from "h3";
|
||||
import type { Dump, Pull } from "../objects/transactional";
|
||||
import type { Dump, Pull, Register } from "../objects/transactional";
|
||||
import { ObjectTransactionalHandler } from "../objects/transactional";
|
||||
|
||||
export async function handleFileUpload(
|
||||
@ -7,7 +7,7 @@ export async function handleFileUpload(
|
||||
metadata: { [key: string]: string },
|
||||
permissions: Array<string>,
|
||||
max = -1,
|
||||
): Promise<[string[], { [key: string]: string }, Pull, Dump] | undefined> {
|
||||
): Promise<[string[], { [key: string]: string }, Pull, Dump, Register] | undefined> {
|
||||
const formData = await readMultipartFormData(h3);
|
||||
if (!formData) return undefined;
|
||||
const transactionalHandler = new ObjectTransactionalHandler();
|
||||
@ -28,5 +28,5 @@ export async function handleFileUpload(
|
||||
options[entry.name] = entry.data.toString("utf-8");
|
||||
}
|
||||
|
||||
return [ids, options, pull, dump];
|
||||
return [ids, options, pull, dump, add];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user