feat: moderation modpack scan button (#6627)

* feat: moderation modpack scan button

* fix: ui

* fix: lint

---------

Co-authored-by: Calum H. (IMB11) <contact@cal.engineer>
This commit is contained in:
ThatGravyBoat
2026-07-06 13:19:39 +00:00
committed by GitHub
co-authored by Calum H.
parent 21508e0637
commit 7fa88e5d4d
5 changed files with 408 additions and 7 deletions
@@ -100,4 +100,21 @@ export class LabrinthAttributionInternalModule extends AbstractModule {
body,
})
}
/**
* Scan a file for attribution information.
* POST /_internal/attribution/file/{file_id}/scan
*
* @param fileId - The file ID to scan.
*/
public async scanFile(fileId: string): Promise<Labrinth.Attribution.Internal.FileScanResponse> {
return this.client.request<Labrinth.Attribution.Internal.FileScanResponse>(
`/attribution/file/${fileId}/scan`,
{
api: 'labrinth',
version: 'internal',
method: 'POST',
},
)
}
}
@@ -397,6 +397,12 @@ export namespace Labrinth {
sha1: string
project_id: string
}
export type FileScanResponse = {
new_attribution_groups: number
new_attribution_files: number
scanned_file_names: string[]
}
}
}
@@ -1333,6 +1339,7 @@ export namespace Labrinth {
}
export type VersionFile = {
id?: string
hashes: VersionFileHash
url: string
filename: string
@@ -1454,6 +1461,7 @@ export namespace Labrinth {
}
export interface VersionFile {
id?: string
hashes: VersionFileHash
url: string
filename: string