mirror of
https://github.com/modrinth/code.git
synced 2026-08-27 10:04:52 +00:00
refactor: remove useBaseFetch for @modrinth/api-client (#5596)
* Reapply "fix: start swapping useBaseFetch usages to api-client"
This reverts commit f4f33db701.
* fix: bugs
* fix: analytics
* fix: lint
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { AbstractModule } from '../../../core/abstract-module.js'
|
||||
import type { Labrinth } from '../types'
|
||||
|
||||
export class LabrinthPayoutsV3Module extends AbstractModule {
|
||||
public getModuleID(): string {
|
||||
return 'labrinth_payouts_v3'
|
||||
}
|
||||
|
||||
/**
|
||||
* Get platform revenue data.
|
||||
*
|
||||
* @param params - Optional start/end date filters
|
||||
* @returns Promise resolving to platform revenue data
|
||||
*/
|
||||
public async getPlatformRevenue(params?: {
|
||||
start?: string
|
||||
end?: string
|
||||
}): Promise<Labrinth.Payouts.v3.RevenueResponse> {
|
||||
return this.client.request<Labrinth.Payouts.v3.RevenueResponse>('/payout/platform_revenue', {
|
||||
api: 'labrinth',
|
||||
version: 3,
|
||||
method: 'GET',
|
||||
params: params as Record<string, string>,
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user