From 1e5b898d9954eaa87d9c8ddaf8875eabe54a42e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-X=2E=20T=2E?= Date: Mon, 31 Aug 2026 18:04:39 -0400 Subject: [PATCH 1/5] feat: add hosting file archive actions --- packages/api-client/src/modules/index.ts | 2 + .../api-client/src/modules/kyros/files/v1.ts | 39 +++++++++ .../api-client/src/modules/kyros/types.ts | 11 +++ .../files-tab/components/FileNavbar.vue | 19 ++++ .../files-tab/components/FileTableRow.vue | 26 +++++- .../src/layouts/shared/files-tab/layout.vue | 9 ++ .../files-tab/providers/file-manager.ts | 3 + .../layouts/wrapped/hosting/manage/files.vue | 87 +++++++++++++++++-- 8 files changed, 187 insertions(+), 9 deletions(-) create mode 100644 packages/api-client/src/modules/kyros/files/v1.ts diff --git a/packages/api-client/src/modules/index.ts b/packages/api-client/src/modules/index.ts index 43792728bc..6740b7a674 100644 --- a/packages/api-client/src/modules/index.ts +++ b/packages/api-client/src/modules/index.ts @@ -16,6 +16,7 @@ import { ArchonTransfersInternalModule } from './archon/transfers/internal' import { ISO3166Module } from './iso3166' import { KyrosContentV1Module } from './kyros/content/v1' import { KyrosFilesV0Module } from './kyros/files/v0' +import { KyrosFilesV1Module } from './kyros/files/v1' import { KyrosLogsV1Module } from './kyros/logs/v1' import { KyrosUploadSessionsV1Module } from './kyros/upload-sessions/v1' import { LabrinthVersionsV2Module, LabrinthVersionsV3Module } from './labrinth' @@ -98,6 +99,7 @@ export const MODULE_REGISTRY = { launchermeta_manifest_v0: LauncherMetaManifestV0Module, kyros_content_v1: KyrosContentV1Module, kyros_files_v0: KyrosFilesV0Module, + kyros_files_v1: KyrosFilesV1Module, kyros_logs_v1: KyrosLogsV1Module, kyros_upload_sessions_v1: KyrosUploadSessionsV1Module, labrinth_affiliate_internal: LabrinthAffiliateInternalModule, diff --git a/packages/api-client/src/modules/kyros/files/v1.ts b/packages/api-client/src/modules/kyros/files/v1.ts new file mode 100644 index 0000000000..1885cb8c66 --- /dev/null +++ b/packages/api-client/src/modules/kyros/files/v1.ts @@ -0,0 +1,39 @@ +import { AbstractModule } from '../../../core/abstract-module' +import type { Kyros } from '../types' + +export class KyrosFilesV1Module extends AbstractModule { + public getModuleID(): string { + return 'kyros_files_v1' + } + + /** + * Download the complete filesystem for a world as a ZIP archive. + */ + public async downloadWorldZip(worldId: string): Promise { + return this.client.request(`/worlds/${worldId}/files/contents-zip`, { + api: '', + version: 'v1', + method: 'GET', + useNodeAuth: true, + }) + } + + /** + * Create a ZIP archive beside a directory in world storage. + */ + public async zipFolder( + worldId: string, + data: Kyros.Files.v1.ZipFolderRequest, + ): Promise { + return this.client.request( + `/worlds/${worldId}/files/zip`, + { + api: '', + version: 'v1', + method: 'POST', + body: data, + useNodeAuth: true, + }, + ) + } +} diff --git a/packages/api-client/src/modules/kyros/types.ts b/packages/api-client/src/modules/kyros/types.ts index b649ba645a..225c369e75 100644 --- a/packages/api-client/src/modules/kyros/types.ts +++ b/packages/api-client/src/modules/kyros/types.ts @@ -28,6 +28,17 @@ export namespace Kyros { } export namespace Files { + export namespace v1 { + export interface ZipFolderRequest { + path: string + } + + export interface FileMutationResponse { + source: string + destination: string + } + } + export namespace v0 { export interface DirectoryItem { name: string diff --git a/packages/ui/src/layouts/shared/files-tab/components/FileNavbar.vue b/packages/ui/src/layouts/shared/files-tab/components/FileNavbar.vue index cde35aa9df..796e5c632d 100644 --- a/packages/ui/src/layouts/shared/files-tab/components/FileNavbar.vue +++ b/packages/ui/src/layouts/shared/files-tab/components/FileNavbar.vue @@ -108,6 +108,17 @@ @update:model-value="$emit('update:searchQuery', $event)" /> + + +