mirror of
https://github.com/modrinth/code.git
synced 2026-08-25 00:55:25 +00:00
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:
co-authored by
Calum H.
parent
21508e0637
commit
7fa88e5d4d
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user