You've already forked AstralRinth
forked from didirus/AstralRinth
* feat: api-client module for content v0 * feat: delete unused components + modules + setting * feat: xhr uploading * feat: fs module -> api-client * feat: migrate files.vue to use tanstack * fix: mem leak + other issues * fix: build * feat: switch to monaco * fix: go back to using ace, but improve preloading + theme * fix: styling + dead attrs * feat: match figma * fix: padding * feat: files-new for ui page structure * feat: finalize files.vue * fix: lint * fix: qa * fix: dep * fix: lint * fix: lockfile merge * feat: icons on navtab * fix: surface alternating on table * fix: hover surface color --------- Signed-off-by: Calum H. <contact@cal.engineer> Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com>
57 lines
1.4 KiB
TypeScript
57 lines
1.4 KiB
TypeScript
import { AbstractModule } from '../../../core/abstract-module'
|
|
import type { Archon } from '../types'
|
|
|
|
export class ArchonContentV0Module extends AbstractModule {
|
|
public getModuleID(): string {
|
|
return 'archon_content_v0'
|
|
}
|
|
|
|
/** GET /modrinth/v0/servers/:server_id/mods */
|
|
public async list(serverId: string): Promise<Archon.Content.v0.Mod[]> {
|
|
return this.client.request<Archon.Content.v0.Mod[]>(`/servers/${serverId}/mods`, {
|
|
api: 'archon',
|
|
version: 'modrinth/v0',
|
|
method: 'GET',
|
|
})
|
|
}
|
|
|
|
/** POST /modrinth/v0/servers/:server_id/mods */
|
|
public async install(
|
|
serverId: string,
|
|
request: Archon.Content.v0.InstallModRequest,
|
|
): Promise<void> {
|
|
await this.client.request<void>(`/servers/${serverId}/mods`, {
|
|
api: 'archon',
|
|
version: 'modrinth/v0',
|
|
method: 'POST',
|
|
body: request,
|
|
})
|
|
}
|
|
|
|
/** POST /modrinth/v0/servers/:server_id/deleteMod */
|
|
public async delete(
|
|
serverId: string,
|
|
request: Archon.Content.v0.DeleteModRequest,
|
|
): Promise<void> {
|
|
await this.client.request<void>(`/servers/${serverId}/deleteMod`, {
|
|
api: 'archon',
|
|
version: 'modrinth/v0',
|
|
method: 'POST',
|
|
body: request,
|
|
})
|
|
}
|
|
|
|
/** POST /modrinth/v0/servers/:server_id/mods/update */
|
|
public async update(
|
|
serverId: string,
|
|
request: Archon.Content.v0.UpdateModRequest,
|
|
): Promise<void> {
|
|
await this.client.request<void>(`/servers/${serverId}/mods/update`, {
|
|
api: 'archon',
|
|
version: 'modrinth/v0',
|
|
method: 'POST',
|
|
body: request,
|
|
})
|
|
}
|
|
}
|