feat: impl delete world + move onboarding reset to server scope

This commit is contained in:
Calum H. (IMB11)
2026-06-26 17:09:22 +01:00
parent 2c1b8a2326
commit 2021c221cc
6 changed files with 350 additions and 104 deletions
@@ -79,6 +79,18 @@ export class ArchonServersV1Module extends AbstractModule {
})
}
/**
* Delete a world
* DELETE /v1/servers/:id/worlds/:wid
*/
public async deleteWorld(serverId: string, worldId: string): Promise<void> {
await this.client.request(`/servers/${serverId}/worlds/${worldId}`, {
api: 'archon',
version: 1,
method: 'DELETE',
})
}
/**
* End the intro flow for a server
* DELETE /v1/servers/:id/flows/intro
@@ -109,14 +121,19 @@ export class ArchonServersV1Module extends AbstractModule {
}
/**
* Reset a world to onboarding
* POST /v1/servers/:id/worlds/:wid/onboard
* Reset a server to onboarding
* POST /v1/servers/:id/onboard
*/
public async resetToOnboarding(serverId: string, worldId: string): Promise<void> {
await this.client.request(`/servers/${serverId}/worlds/${worldId}/onboard`, {
api: 'archon',
version: 1,
method: 'POST',
})
public async resetToOnboarding(
serverId: string,
): Promise<Archon.Servers.v1.ServerOnboardResponse> {
return this.client.request<Archon.Servers.v1.ServerOnboardResponse>(
`/servers/${serverId}/onboard`,
{
api: 'archon',
version: 1,
method: 'POST',
},
)
}
}
@@ -732,6 +732,10 @@ export namespace Archon {
worlds: WorldFull[]
}
export type ServerOnboardResponse = {
archived_worlds: string[]
}
export type ServerResources = {
cpu: number
memory_mb: number