refactor: remove useBaseFetch for @modrinth/api-client (#5596)

* Reapply "fix: start swapping useBaseFetch usages to api-client"

This reverts commit f4f33db7019ea861addb2c66c204d736800b7b6c.

* fix: bugs

* fix: analytics

* fix: lint
This commit is contained in:
Calum H.
2026-03-17 20:06:19 +00:00
committed by GitHub
parent 58c1e225c8
commit 87c86c7d0d
64 changed files with 2073 additions and 691 deletions

View File

@@ -41,7 +41,7 @@ export class ArchonServersV0Module extends AbstractModule {
/**
* Check stock availability for a region
* POST /modrinth/v0/stock
* POST /modrinth/v0/stock?region=:region
*/
public async checkStock(
region: string,
@@ -52,6 +52,23 @@ export class ArchonServersV0Module extends AbstractModule {
version: 'modrinth/v0',
method: 'POST',
body: request,
skipAuth: true,
})
}
/**
* Check stock availability (without region filter)
* POST /modrinth/v0/stock
*/
public async checkStockGlobal(
request: Archon.Servers.v0.StockRequest,
): Promise<Archon.Servers.v0.StockResponse> {
return this.client.request<Archon.Servers.v0.StockResponse>('/stock', {
api: 'archon',
version: 'modrinth/v0',
method: 'POST',
body: request,
skipAuth: true,
})
}

View File

@@ -39,6 +39,7 @@ export class ArchonServersV1Module extends AbstractModule {
api: 'archon',
version: 1,
method: 'GET',
skipAuth: true,
})
}