@osu-tournament-rating/otr-api-client
Version:
Client code for interacting with the o!TR API
1,373 lines • 114 kB
TypeScript
import { CreateAxiosDefaults } from 'axios';
import type { AxiosInstance, AxiosResponse, CancelToken } from 'axios';
export declare abstract class OtrApiWrapperBase {
protected configuration: IOtrApiWrapperConfiguration;
constructor(configuration?: IOtrApiWrapperConfiguration);
protected getBaseUrl(..._: any[]): string;
/**
* Exposes the underlying axios client for configuration
*/
configureClient(configure: (instance: AxiosInstance) => Promise<void> | void): Promise<void>;
}
/**
* Request parameters available for use when requesting {@link AdminNotesWrapper.prototype.createNote | api/v1/[entity]/[entityId]/notes}
*/
export type AdminNotesCreateNoteRequestParams = {
/**
* (required) Entity id
*/
entityId: number;
/**
* (required) Type of entity to target for admin note actions
*/
entity: AdminNoteRouteTarget;
/**
* (required) Content of the admin note
*/
body: string;
};
/**
* Request parameters available for use when requesting {@link AdminNotesWrapper.prototype.listNotes | api/v1/[entity]/[entityId]/notes}
*/
export type AdminNotesListNotesRequestParams = {
/**
* (required) Entity id
*/
entityId: number;
/**
* (required) Type of entity to target for admin note actions
*/
entity: AdminNoteRouteTarget;
};
/**
* Request parameters available for use when requesting {@link AdminNotesWrapper.prototype.updateNote | api/v1/[entity]/notes/[noteId]}
*/
export type AdminNotesUpdateNoteRequestParams = {
/**
* (required) Admin note id
*/
noteId: number;
/**
* (required) Type of entity to target for admin note actions
*/
entity: AdminNoteRouteTarget;
/**
* (required) New content of the admin note
*/
body: string;
};
/**
* Request parameters available for use when requesting {@link AdminNotesWrapper.prototype.deleteNote | api/v1/[entity]/notes/[noteId]}
*/
export type AdminNotesDeleteNoteRequestParams = {
/**
* (required) Admin note id
*/
noteId: number;
/**
* (required) Type of entity to target for admin note actions
*/
entity: AdminNoteRouteTarget;
};
export declare class AdminNotesWrapper extends OtrApiWrapperBase {
protected instance: AxiosInstance;
protected baseUrl: string;
protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
constructor(configuration: IOtrApiWrapperConfiguration);
/**
* Create an admin note for an entity
*
* Requires Authorization:
*
* Claim(s): admin
* @param params Request parameters (see {@link AdminNotesCreateNoteRequestParams})
* @return Returns the created admin note
*/
createNote(params: AdminNotesCreateNoteRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<AdminNoteDTO>>;
protected processCreateNote(response: AxiosResponse): Promise<OtrApiResponse<AdminNoteDTO>>;
/**
* List admin notes for an entity
*
* Requires Authorization:
*
* Claim(s): user, client
* @param params Request parameters (see {@link AdminNotesListNotesRequestParams})
* @return Returns all admin notes for the entity
*/
listNotes(params: AdminNotesListNotesRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<AdminNoteDTO[]>>;
protected processListNotes(response: AxiosResponse): Promise<OtrApiResponse<AdminNoteDTO[]>>;
/**
* Update an admin note
*
* Requires Authorization:
*
* Claim(s): admin
* @param params Request parameters (see {@link AdminNotesUpdateNoteRequestParams})
* @return Returns the updated admin note
*/
updateNote(params: AdminNotesUpdateNoteRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<AdminNoteDTO>>;
protected processUpdateNote(response: AxiosResponse): Promise<OtrApiResponse<AdminNoteDTO>>;
/**
* Delete an admin note
*
* Requires Authorization:
*
* Claim(s): admin
* @param params Request parameters (see {@link AdminNotesDeleteNoteRequestParams})
* @return The admin note was deleted
*/
deleteNote(params: AdminNotesDeleteNoteRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<void>>;
protected processDeleteNote(response: AxiosResponse): Promise<OtrApiResponse<void>>;
}
/**
* Request parameters available for use when requesting {@link AuditWrapper.prototype.getEntityAudits | api/v1/audit/entity/[entityType]/[entityId]}
*/
export type AuditGetEntityAuditsRequestParams = {
/**
* (required) The type of entity to get audits for
*/
entityType: AuditEntityType;
/**
* (required) The ID of the entity to get audits for
*/
entityId: number;
};
/**
* Request parameters available for use when requesting {@link AuditWrapper.prototype.getUserAudits | api/v1/audit/user/[userId]}
*/
export type AuditGetUserAuditsRequestParams = {
/**
* (required) The ID of the user to get audits for
*/
userId: number;
};
export declare class AuditWrapper extends OtrApiWrapperBase {
protected instance: AxiosInstance;
protected baseUrl: string;
protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
constructor(configuration: IOtrApiWrapperConfiguration);
/**
* Get audits for a specific entity
*
* Requires Authorization:
*
* Claim(s): admin
* @param params Request parameters (see {@link AuditGetEntityAuditsRequestParams})
* @return Returns a list of audits for the specified entity
*/
getEntityAudits(params: AuditGetEntityAuditsRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<AuditDTO[]>>;
protected processGetEntityAudits(response: AxiosResponse): Promise<OtrApiResponse<AuditDTO[]>>;
/**
* Get audits performed by a specific user
*
* Requires Authorization:
*
* Claim(s): admin
* @param params Request parameters (see {@link AuditGetUserAuditsRequestParams})
* @return Returns a list of audits performed by the specified user
*/
getUserAudits(params: AuditGetUserAuditsRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<AuditDTO[]>>;
protected processGetUserAudits(response: AxiosResponse): Promise<OtrApiResponse<AuditDTO[]>>;
}
/**
* Request parameters available for use when requesting {@link AuthWrapper.prototype.login | api/v1/auth/login}
*/
export type AuthLoginRequestParams = {
/**
* (optional) Redirects the client to the given uri after login
*/
redirectUri?: string | undefined;
};
/**
* Request parameters available for use when requesting {@link AuthWrapper.prototype.logout | api/v1/auth/logout}
*/
export type AuthLogoutRequestParams = {
/**
* (optional) Redirects the client to the given uri after logout
*/
redirectUri?: string | undefined;
};
/**
* Request parameters available for use when requesting {@link AuthWrapper.prototype.authenticateClient | api/v1/auth/token}
*/
export type AuthAuthenticateClientRequestParams = {
/**
* (required) Client id
*/
clientId: number;
/**
* (required) Client secret
*/
clientSecret: string;
};
export declare class AuthWrapper extends OtrApiWrapperBase {
protected instance: AxiosInstance;
protected baseUrl: string;
protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
constructor(configuration: IOtrApiWrapperConfiguration);
/**
* Logs in to o!TR
* @param params Request parameters (see {@link AuthLoginRequestParams})
* @return OK
*/
login(params: AuthLoginRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<void>>;
protected processLogin(response: AxiosResponse): Promise<OtrApiResponse<void>>;
/**
* Logs out from o!TR
* @param params Request parameters (see {@link AuthLogoutRequestParams})
* @return OK
*/
logout(params: AuthLogoutRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<void>>;
protected processLogout(response: AxiosResponse): Promise<OtrApiResponse<void>>;
/**
* Authenticate using client credentials
* @param params Request parameters (see {@link AuthAuthenticateClientRequestParams})
* @return Returns client access credentials
*/
authenticateClient(params: AuthAuthenticateClientRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<AccessCredentialsDTO>>;
protected processAuthenticateClient(response: AxiosResponse): Promise<OtrApiResponse<AccessCredentialsDTO>>;
}
/**
* Request parameters available for use when requesting {@link BeatmapsWrapper.prototype.get | api/v1/beatmaps/[key]}
*/
export type BeatmapsGetRequestParams = {
/**
* (required) Search key (id or osu! id)
*/
key: number;
};
export declare class BeatmapsWrapper extends OtrApiWrapperBase {
protected instance: AxiosInstance;
protected baseUrl: string;
protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
constructor(configuration: IOtrApiWrapperConfiguration);
/**
* List all beatmaps
*
* Requires Authorization:
*
* Claim(s): admin
* @return Returns all beatmaps
*/
list(cancelToken?: CancelToken): Promise<OtrApiResponse<BeatmapDTO[]>>;
protected processList(response: AxiosResponse): Promise<OtrApiResponse<BeatmapDTO[]>>;
/**
* Get a beatmap
*
* Get a beatmap searching first by id, then by osu! id
*
* Requires Authorization:
*
* Claim(s): admin
* @param params Request parameters (see {@link BeatmapsGetRequestParams})
* @return Returns a beatmap
*/
get(params: BeatmapsGetRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<BeatmapDTO>>;
protected processGet(response: AxiosResponse): Promise<OtrApiResponse<BeatmapDTO>>;
}
/**
* Request parameters available for use when requesting {@link ClientsWrapper.prototype.patchRateLimit | api/v1/clients/[id]/ratelimit}
*/
export type ClientsPatchRateLimitRequestParams = {
/**
* (required) Client id
*/
id: number;
/**
* (required) The new rate limit for the client
*/
body: number;
};
export declare class ClientsWrapper extends OtrApiWrapperBase {
protected instance: AxiosInstance;
protected baseUrl: string;
protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
constructor(configuration: IOtrApiWrapperConfiguration);
/**
* Create a new OAuth client
*
* Client secret is only returned from creation.
* The user will have to reset the secret if they lose access.
*
* Requires Authorization:
*
* Claim(s): user
* @return Returns created client credentials
*/
create(cancelToken?: CancelToken): Promise<OtrApiResponse<OAuthClientCreatedDTO>>;
protected processCreate(response: AxiosResponse): Promise<OtrApiResponse<OAuthClientCreatedDTO>>;
/**
* Set the rate limit for a client
*
* Requires Authorization:
*
* Claim(s): admin
* @param params Request parameters (see {@link ClientsPatchRateLimitRequestParams})
* @return Returns the updated client
*/
patchRateLimit(params: ClientsPatchRateLimitRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<OAuthClientDTO>>;
protected processPatchRateLimit(response: AxiosResponse): Promise<OtrApiResponse<OAuthClientDTO>>;
}
export declare class DiagnosticsWrapper extends OtrApiWrapperBase {
protected instance: AxiosInstance;
protected baseUrl: string;
protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
constructor(configuration: IOtrApiWrapperConfiguration);
/**
* Allows clients to determine if the server is running
* @return The server is running
*/
ping(cancelToken?: CancelToken): Promise<OtrApiResponse<void>>;
protected processPing(response: AxiosResponse): Promise<OtrApiResponse<void>>;
}
/**
* Request parameters available for use when requesting {@link FilteringWrapper.prototype.filter | api/v1/filtering}
*/
export type FilteringFilterRequestParams = {
/**
* (required) The filtering request
*/
body: FilteringRequestDTO;
};
/**
* Request parameters available for use when requesting {@link FilteringWrapper.prototype.getFilterReport | api/v1/filtering/[id]}
*/
export type FilteringGetFilterReportRequestParams = {
/**
* (required) The filter report ID
*/
id: number;
};
export declare class FilteringWrapper extends OtrApiWrapperBase {
protected instance: AxiosInstance;
protected baseUrl: string;
protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
constructor(configuration: IOtrApiWrapperConfiguration);
/**
* Filter a list of users based on the criteria as described in
* API.DTOs.FilteringResultDTO
*
* Requires Authorization:
*
* Claim(s): user, client
* @param params Request parameters (see {@link FilteringFilterRequestParams})
* @return The filtering result
*/
filter(params: FilteringFilterRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<FilteringResultDTO>>;
protected processFilter(response: AxiosResponse): Promise<OtrApiResponse<FilteringResultDTO>>;
/**
* Get a stored filter report by ID
* @param params Request parameters (see {@link FilteringGetFilterReportRequestParams})
* @return The filter report
*/
getFilterReport(params: FilteringGetFilterReportRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<FilterReportDTO>>;
protected processGetFilterReport(response: AxiosResponse): Promise<OtrApiResponse<FilterReportDTO>>;
}
/**
* Request parameters available for use when requesting {@link GamesWrapper.prototype.get | api/v1/games/[id]}
*/
export type GamesGetRequestParams = {
id: number;
/**
* (optional) Whether the game's scores must be verified
*/
verified?: boolean | undefined;
};
/**
* Request parameters available for use when requesting {@link GamesWrapper.prototype.update | api/v1/games/[id]}
*/
export type GamesUpdateRequestParams = {
/**
* (required) Game id
*/
id: number;
/**
* (optional) JsonPatch data
*/
body?: Operation[] | undefined;
};
/**
* Request parameters available for use when requesting {@link GamesWrapper.prototype.delete | api/v1/games/[id]}
*/
export type GamesDeleteRequestParams = {
/**
* (required) Game id
*/
id: number;
};
/**
* Request parameters available for use when requesting {@link GamesWrapper.prototype.mergeScores | api/v1/games/[id]:merge}
*/
export type GamesMergeScoresRequestParams = {
/**
* (required) Id of the game to merge scores into
*/
id: number;
/**
* (optional) Game ids whose scores will be merged into the target game
*/
body?: number[] | undefined;
};
export declare class GamesWrapper extends OtrApiWrapperBase {
protected instance: AxiosInstance;
protected baseUrl: string;
protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
constructor(configuration: IOtrApiWrapperConfiguration);
/**
* Get a game
*
* Requires Authorization:
*
* Claim(s): user, client
* @param params Request parameters (see {@link GamesGetRequestParams})
* @return Returns a game
*/
get(params: GamesGetRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<GameDTO>>;
protected processGet(response: AxiosResponse): Promise<OtrApiResponse<GameDTO>>;
/**
* Amend game data
*
* Requires Authorization:
*
* Claim(s): admin
* @param params Request parameters (see {@link GamesUpdateRequestParams})
* @return Returns the updated game
*/
update(params: GamesUpdateRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<GameDTO>>;
protected processUpdate(response: AxiosResponse): Promise<OtrApiResponse<GameDTO>>;
/**
* Delete a game
*
* Requires Authorization:
*
* Claim(s): admin
* @param params Request parameters (see {@link GamesDeleteRequestParams})
* @return The game was deleted successfully
*/
delete(params: GamesDeleteRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<void>>;
protected processDelete(response: AxiosResponse): Promise<OtrApiResponse<void>>;
/**
* Merge scores from source games into a target game. The source games must be from the same match
* and have the same beatmap as the target game. After successful merging, the source games are deleted.
*
* Requires Authorization:
*
* Claim(s): admin
* @param params Request parameters (see {@link GamesMergeScoresRequestParams})
* @return State of the game after merging
*/
mergeScores(params: GamesMergeScoresRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<GameDTO>>;
protected processMergeScores(response: AxiosResponse): Promise<OtrApiResponse<GameDTO>>;
}
/**
* Request parameters available for use when requesting {@link GameScoresWrapper.prototype.get | api/v1/gamescores/[id]}
*/
export type GameScoresGetRequestParams = {
id: number;
};
/**
* Request parameters available for use when requesting {@link GameScoresWrapper.prototype.update | api/v1/gamescores/[id]}
*/
export type GameScoresUpdateRequestParams = {
/**
* (required) Score id
*/
id: number;
/**
* (optional) JsonPatch data
*/
body?: Operation[] | undefined;
};
/**
* Request parameters available for use when requesting {@link GameScoresWrapper.prototype.delete | api/v1/gamescores/[id]}
*/
export type GameScoresDeleteRequestParams = {
/**
* (required) Score id
*/
id: number;
};
export declare class GameScoresWrapper extends OtrApiWrapperBase {
protected instance: AxiosInstance;
protected baseUrl: string;
protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
constructor(configuration: IOtrApiWrapperConfiguration);
/**
* Get a score
*
* Requires Authorization:
*
* Claim(s): admin
* @param params Request parameters (see {@link GameScoresGetRequestParams})
* @return Returns the score
*/
get(params: GameScoresGetRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<GameScoreDTO>>;
protected processGet(response: AxiosResponse): Promise<OtrApiResponse<GameScoreDTO>>;
/**
* Amend score data
*
* Requires Authorization:
*
* Claim(s): admin
* @param params Request parameters (see {@link GameScoresUpdateRequestParams})
* @return Returns the updated score
*/
update(params: GameScoresUpdateRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<GameScoreDTO>>;
protected processUpdate(response: AxiosResponse): Promise<OtrApiResponse<GameScoreDTO>>;
/**
* Delete a score
*
* Requires Authorization:
*
* Claim(s): admin
* @param params Request parameters (see {@link GameScoresDeleteRequestParams})
* @return The score was deleted successfully
*/
delete(params: GameScoresDeleteRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<void>>;
protected processDelete(response: AxiosResponse): Promise<OtrApiResponse<void>>;
}
/**
* Request parameters available for use when requesting {@link LeaderboardsWrapper.prototype.get | api/v1/leaderboards}
*/
export type LeaderboardsGetRequestParams = {
/**
* (optional)
*/
page?: number | undefined;
/**
* (optional)
*/
pageSize?: number | undefined;
/**
* (optional) Ruleset for leaderboard data
*/
ruleset?: Ruleset | undefined;
/**
* (optional) ISO country code (Leaderboard will be global if not provided)
*/
country?: string | undefined;
/**
* (optional) osu! rank floor (The "better" inclusive rank bound.
* If given, only players with a rank greater than or equal to this value will be included)
*/
minOsuRank?: number | undefined;
/**
* (optional) osu! rank ceiling (The "worse" inclusive rank bound.
* If given, only players with a rank less than or equal to this value will be included)
*/
maxOsuRank?: number | undefined;
/**
* (optional) Rating floor (The "worse" inclusive rating bound.
* If given, only players with a rating greater than or equal to this value will be included)
*/
minRating?: number | undefined;
/**
* (optional) Rating ceiling (The "better" inclusive rating bound.
* If given, only players with a rating less than or equal to this value will be included)
*/
maxRating?: number | undefined;
/**
* (optional) Minimum number of matches played
*/
minMatches?: number | undefined;
/**
* (optional) Maximum number of matches played
*/
maxMatches?: number | undefined;
/**
* (optional) Minimum win rate
*/
minWinRate?: number | undefined;
/**
* (optional) Maximum win rate
*/
maxWinRate?: number | undefined;
/**
* (optional) Explicitly include bronze players
*/
bronze?: boolean | undefined;
/**
* (optional) Explicitly include silver players
*/
silver?: boolean | undefined;
/**
* (optional) Explicitly include gold players
*/
gold?: boolean | undefined;
/**
* (optional) Explicitly include platinum players
*/
platinum?: boolean | undefined;
/**
* (optional) Explicitly include emerald players
*/
emerald?: boolean | undefined;
/**
* (optional) Explicitly include diamond players
*/
diamond?: boolean | undefined;
/**
* (optional) Explicitly include master players
*/
master?: boolean | undefined;
/**
* (optional) Explicitly include grandmaster players
*/
grandmaster?: boolean | undefined;
/**
* (optional) Explicitly include elite grandmaster players
*/
eliteGrandmaster?: boolean | undefined;
};
export declare class LeaderboardsWrapper extends OtrApiWrapperBase {
protected instance: AxiosInstance;
protected baseUrl: string;
protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
constructor(configuration: IOtrApiWrapperConfiguration);
/**
* Get a leaderboard of players which fit an optional request query
* @param params Request parameters (see {@link LeaderboardsGetRequestParams})
* @return Returns the leaderboard
*/
get(params: LeaderboardsGetRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<LeaderboardDTO>>;
protected processGet(response: AxiosResponse): Promise<OtrApiResponse<LeaderboardDTO>>;
}
/**
* Request parameters available for use when requesting {@link MatchesWrapper.prototype.list | api/v1/matches}
*/
export type MatchesListRequestParams = {
page: number;
pageSize: number;
/**
* (optional) Filters results for only matches played in a specified ruleset
*/
ruleset?: Ruleset | undefined;
/**
* (optional) Filters results for only matches with a partially matching name (case insensitive)
*/
name?: string | undefined;
/**
* (optional) Filters results for only matches that occurred on or after a specified date
*/
dateMin?: Date | undefined;
/**
* (optional) Filters results for only matches that occurred on or before a specified date
*/
dateMax?: Date | undefined;
/**
* (optional) Filters results for only matches with a specified verification status
*/
verificationStatus?: VerificationStatus | undefined;
/**
* (optional) Filters results for only matches with a specified rejection reason
*/
rejectionReason?: MatchRejectionReason | undefined;
/**
* (optional) Filters results for only matches with a specified processing status
*/
processingStatus?: MatchProcessingStatus | undefined;
/**
* (optional) Filters results for only matches submitted by a user with a specified id
*/
submittedBy?: number | undefined;
/**
* (optional) Filters results for only matches verified by a user with a specified id
*/
verifiedBy?: number | undefined;
/**
* (optional) The key used to sort results by
*/
sort?: MatchQuerySortType | undefined;
/**
* (optional) Whether the results are sorted in descending order by the API.DTOs.MatchRequestQueryDTO.Sort
*/
descending?: boolean | undefined;
};
/**
* Request parameters available for use when requesting {@link MatchesWrapper.prototype.get | api/v1/matches/[id]}
*/
export type MatchesGetRequestParams = {
/**
* (required) Match id
*/
id: number;
};
/**
* Request parameters available for use when requesting {@link MatchesWrapper.prototype.update | api/v1/matches/[id]}
*/
export type MatchesUpdateRequestParams = {
/**
* (required) Match id
*/
id: number;
/**
* (optional) JsonPatch data
*/
body?: Operation[] | undefined;
};
/**
* Request parameters available for use when requesting {@link MatchesWrapper.prototype.delete | api/v1/matches/[id]}
*/
export type MatchesDeleteRequestParams = {
/**
* (required) Match id
*/
id: number;
};
/**
* Request parameters available for use when requesting {@link MatchesWrapper.prototype.merge | api/v1/matches/[id]:merge}
*/
export type MatchesMergeRequestParams = {
/**
* (required) Id of the match to link games to
*/
id: number;
/**
* (optional) Match ids to unlink games from before deletion
*/
body?: number[] | undefined;
};
/**
* Request parameters available for use when requesting {@link MatchesWrapper.prototype.deletePlayerScores | api/v1/matches/[id]/player/[playerId]}
*/
export type MatchesDeletePlayerScoresRequestParams = {
/**
* (required) Match id
*/
id: number;
/**
* (required) Player id
*/
playerId: number;
};
export declare class MatchesWrapper extends OtrApiWrapperBase {
protected instance: AxiosInstance;
protected baseUrl: string;
protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
constructor(configuration: IOtrApiWrapperConfiguration);
/**
* Get all matches which fit an optional request query
*
* Will not include game data
*
* Requires Authorization:
*
* Claim(s): user, client
* @param params Request parameters (see {@link MatchesListRequestParams})
* @return Returns all matches which fit the request query
*/
list(params: MatchesListRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<MatchDTO[]>>;
protected processList(response: AxiosResponse): Promise<OtrApiResponse<MatchDTO[]>>;
/**
* Get a match
*
* Requires Authorization:
*
* Claim(s): user, client
* @param params Request parameters (see {@link MatchesGetRequestParams})
* @return Returns a match
*/
get(params: MatchesGetRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<MatchDTO>>;
protected processGet(response: AxiosResponse): Promise<OtrApiResponse<MatchDTO>>;
/**
* Amend match data
*
* Requires Authorization:
*
* Claim(s): admin
* @param params Request parameters (see {@link MatchesUpdateRequestParams})
* @return Returns the updated match
*/
update(params: MatchesUpdateRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<MatchDTO>>;
protected processUpdate(response: AxiosResponse): Promise<OtrApiResponse<MatchDTO>>;
/**
* Delete a match
*
* Requires Authorization:
*
* Claim(s): admin
* @param params Request parameters (see {@link MatchesDeleteRequestParams})
* @return The match was deleted successfully
*/
delete(params: MatchesDeleteRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<void>>;
protected processDelete(response: AxiosResponse): Promise<OtrApiResponse<void>>;
/**
* Links games from provided matches into a single match id before deleting
* the provided matches
*
* Requires Authorization:
*
* Claim(s): admin
* @param params Request parameters (see {@link MatchesMergeRequestParams})
* @return State of the match after merging
*/
merge(params: MatchesMergeRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<MatchDTO>>;
protected processMerge(response: AxiosResponse): Promise<OtrApiResponse<MatchDTO>>;
/**
* Delete all scores belonging to a player for a given match
*
* Requires Authorization:
*
* Claim(s): admin
* @param params Request parameters (see {@link MatchesDeletePlayerScoresRequestParams})
* @return Returns the number of scores deleted
*/
deletePlayerScores(params: MatchesDeletePlayerScoresRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<number>>;
protected processDeletePlayerScores(response: AxiosResponse): Promise<OtrApiResponse<number>>;
}
/**
* Request parameters available for use when requesting {@link MeWrapper.prototype.getStats | api/v1/me/stats}
*/
export type MeGetStatsRequestParams = {
/**
* (optional) Ruleset to filter for
*/
ruleset?: Ruleset | undefined;
/**
* (optional) Filter from earliest date
*/
dateMin?: Date | undefined;
/**
* (optional) Filter to latest date
*/
dateMax?: Date | undefined;
};
/**
* Request parameters available for use when requesting {@link MeWrapper.prototype.getTournaments | api/v1/me/tournaments}
*/
export type MeGetTournamentsRequestParams = {
/**
* (optional) Ruleset to filter for
*/
ruleset?: Ruleset | undefined;
/**
* (optional) Filter from earliest date
*/
dateMin?: Date | undefined;
/**
* (optional) Filter to latest date
*/
dateMax?: Date | undefined;
};
/**
* Request parameters available for use when requesting {@link MeWrapper.prototype.updateRuleset | api/v1/me/settings/ruleset}
*/
export type MeUpdateRulesetRequestParams = {
body: Ruleset;
};
export declare class MeWrapper extends OtrApiWrapperBase {
protected instance: AxiosInstance;
protected baseUrl: string;
protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
constructor(configuration: IOtrApiWrapperConfiguration);
/**
* Get the currently logged in user
*
* Requires Authorization:
*
* Claim(s): user
* @return Returns the currently logged in user
*/
get(cancelToken?: CancelToken): Promise<OtrApiResponse<UserDTO>>;
protected processGet(response: AxiosResponse): Promise<OtrApiResponse<UserDTO>>;
/**
* Get player stats for the currently logged in user
*
* If no ruleset is provided, the player's default is used. Common.Enums.Ruleset.Osu is used as a fallback.
* If a ruleset is provided but the player has no data for it, all optional fields of the response will be null.
* API.DTOs.PlayerDashboardStatsDTO.PlayerInfo will always be populated as long as a player is found.
* If no date range is provided, gets all stats without considering date
*
* Requires Authorization:
*
* Claim(s): user
* @param params Request parameters (see {@link MeGetStatsRequestParams})
* @return Returns the currently logged in user's player stats
*/
getStats(params: MeGetStatsRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<PlayerDashboardStatsDTO>>;
protected processGetStats(response: AxiosResponse): Promise<OtrApiResponse<PlayerDashboardStatsDTO>>;
/**
* Get all tournaments the currently logged in user has participated in
*
* If no ruleset is provided, returns tournaments from all rulesets.
* If no date range is provided, gets all tournaments without date filtering.
*
* Requires Authorization:
*
* Claim(s): user
* @param params Request parameters (see {@link MeGetTournamentsRequestParams})
* @return Returns a collection of tournaments
*/
getTournaments(params: MeGetTournamentsRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<TournamentCompactDTO[]>>;
protected processGetTournaments(response: AxiosResponse): Promise<OtrApiResponse<TournamentCompactDTO[]>>;
/**
* Update the ruleset for the currently logged in user
*
* Requires Authorization:
*
* Claim(s): user
* @param params Request parameters (see {@link MeUpdateRulesetRequestParams})
* @return The operation was successful
*/
updateRuleset(params: MeUpdateRulesetRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<void>>;
protected processUpdateRuleset(response: AxiosResponse): Promise<OtrApiResponse<void>>;
/**
* Sync the ruleset of the currently logged in user to their osu! ruleset
*
* Requires Authorization:
*
* Claim(s): user
* @return The operation was successful
*/
syncRuleset(cancelToken?: CancelToken): Promise<OtrApiResponse<void>>;
protected processSyncRuleset(response: AxiosResponse): Promise<OtrApiResponse<void>>;
}
export declare class PlatformStatsWrapper extends OtrApiWrapperBase {
protected instance: AxiosInstance;
protected baseUrl: string;
protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
constructor(configuration: IOtrApiWrapperConfiguration);
/**
* Get various platform-wide stats
*
* Requires Authorization:
*
* Claim(s): user
* @return Returns various platform-wide stats
*/
get(cancelToken?: CancelToken): Promise<OtrApiResponse<PlatformStatsDTO>>;
protected processGet(response: AxiosResponse): Promise<OtrApiResponse<PlatformStatsDTO>>;
}
/**
* Request parameters available for use when requesting {@link PlayersWrapper.prototype.get | api/v1/players/[key]}
*/
export type PlayersGetRequestParams = {
/**
* (required) Search key (id, osu! id, or osu! username)
*/
key: string;
};
/**
* Request parameters available for use when requesting {@link PlayersWrapper.prototype.getStats | api/v1/players/[key]/stats}
*/
export type PlayersGetStatsRequestParams = {
/**
* (required) Search key
*/
key: string;
/**
* (optional) Ruleset to filter for
*/
ruleset?: Ruleset | undefined;
/**
* (optional) Filter from earliest date
*/
dateMin?: Date | undefined;
/**
* (optional) Filter to latest date
*/
dateMax?: Date | undefined;
};
/**
* Request parameters available for use when requesting {@link PlayersWrapper.prototype.getTournaments | api/v1/players/[key]/tournaments}
*/
export type PlayersGetTournamentsRequestParams = {
/**
* (required) Search key (id, osu! id, or osu! username)
*/
key: string;
/**
* (optional) Ruleset to filter for
*/
ruleset?: Ruleset | undefined;
/**
* (optional) Filter from earliest date
*/
dateMin?: Date | undefined;
/**
* (optional) Filter to latest date
*/
dateMax?: Date | undefined;
};
export declare class PlayersWrapper extends OtrApiWrapperBase {
protected instance: AxiosInstance;
protected baseUrl: string;
protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
constructor(configuration: IOtrApiWrapperConfiguration);
/**
* Get a player
*
* Get a player searching first by id, then by osu! id, then osu! username
*
* Requires Authorization:
*
* Claim(s): user, client
* @param params Request parameters (see {@link PlayersGetRequestParams})
* @return Returns a player
*/
get(params: PlayersGetRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<PlayerCompactDTO>>;
protected processGet(response: AxiosResponse): Promise<OtrApiResponse<PlayerCompactDTO>>;
/**
* Get a player's stats
*
* Gets player by versatile search.
* If no ruleset is provided, the player's default is used. Common.Enums.Ruleset.Osu is used as a fallback.
* If a ruleset is provided but the player has no data for it, all optional fields of the response will be null.
* API.DTOs.PlayerDashboardStatsDTO.PlayerInfo will always be populated as long as a player is found.
* If no date range is provided, gets all stats without considering date
*
* Requires Authorization:
*
* Claim(s): user, client
* @param params Request parameters (see {@link PlayersGetStatsRequestParams})
* @return Returns a player's stats
*/
getStats(params: PlayersGetStatsRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<PlayerDashboardStatsDTO>>;
protected processGetStats(response: AxiosResponse): Promise<OtrApiResponse<PlayerDashboardStatsDTO>>;
/**
* Get all tournaments a player has participated in
*
* Gets tournaments for a player by versatile search.
* If no ruleset is provided, returns tournaments from all rulesets.
* If no date range is provided, gets all tournaments without date filtering.
*
* Requires Authorization:
*
* Claim(s): user, client
* @param params Request parameters (see {@link PlayersGetTournamentsRequestParams})
* @return Returns a collection of tournaments
*/
getTournaments(params: PlayersGetTournamentsRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<TournamentCompactDTO[]>>;
protected processGetTournaments(response: AxiosResponse): Promise<OtrApiResponse<TournamentCompactDTO[]>>;
}
/**
* Request parameters available for use when requesting {@link SearchWrapper.prototype.search | api/v1/search}
*/
export type SearchSearchRequestParams = {
/**
* (required) Search key
*/
searchKey: string;
};
export declare class SearchWrapper extends OtrApiWrapperBase {
protected instance: AxiosInstance;
protected baseUrl: string;
protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
constructor(configuration: IOtrApiWrapperConfiguration);
/**
* Search for tournaments, matches, and users
*
* Search uses partial matching on: tournament name and abbreviation, match name, and player name
*
* Requires Authorization:
*
* Claim(s): user, client
* @param params Request parameters (see {@link SearchSearchRequestParams})
* @return Returns a list of tournaments, matches, and usernames matching the given search key
*/
search(params: SearchSearchRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<SearchResponseCollectionDTO>>;
protected processSearch(response: AxiosResponse): Promise<OtrApiResponse<SearchResponseCollectionDTO>>;
}
/**
* Request parameters available for use when requesting {@link TournamentsWrapper.prototype.delete | api/v1/tournaments/[id]}
*/
export type TournamentsDeleteRequestParams = {
/**
* (required) Tournament id
*/
id: number;
};
/**
* Request parameters available for use when requesting {@link TournamentsWrapper.prototype.get | api/v1/tournaments/[id]}
*/
export type TournamentsGetRequestParams = {
/**
* (required) Tournament id
*/
id: number;
};
/**
* Request parameters available for use when requesting {@link TournamentsWrapper.prototype.update | api/v1/tournaments/[id]}
*/
export type TournamentsUpdateRequestParams = {
/**
* (required) Tournament id
*/
id: number;
/**
* (optional) JsonPatch data
*/
body?: Operation[] | undefined;
};
/**
* Request parameters available for use when requesting {@link TournamentsWrapper.prototype.acceptPreVerificationStatuses | api/v1/tournaments/[id]:accept-pre-verification-statuses}
*/
export type TournamentsAcceptPreVerificationStatusesRequestParams = {
/**
* (required) Tournament id
*/
id: number;
};
/**
* Request parameters available for use when requesting {@link TournamentsWrapper.prototype.rerunAutomationChecks | api/v1/tournaments/[id]:reset-automation-statuses}
*/
export type TournamentsRerunAutomationChecksRequestParams = {
/**
* (required) Tournament id
*/
id: number;
/**
* (optional) Whether to overwrite data which has already been Verified or Rejected
*/
force?: boolean | undefined;
};
/**
* Request parameters available for use when requesting {@link TournamentsWrapper.prototype.insertBeatmaps | api/v1/tournaments/[id]/beatmaps}
*/
export type TournamentsInsertBeatmapsRequestParams = {
/**
* (required) Tournament id
*/
id: number;
/**
* (optional) A collection of osu! beatmap ids
*/
body?: number[] | undefined;
};
/**
* Request parameters available for use when requesting {@link TournamentsWrapper.prototype.deleteBeatmaps | api/v1/tournaments/[id]/beatmaps}
*/
export type TournamentsDeleteBeatmapsRequestParams = {
/**
* (required) Tournament id
*/
id: number;
/**
* (optional) An optional collection of specific beatmap ids to remove from the pooled beatmaps collection
*/
body?: number[] | undefined;
};
/**
* Request parameters available for use when requesting {@link TournamentsWrapper.prototype.getBeatmaps | api/v1/tournaments/[id]/beatmaps}
*/
export type TournamentsGetBeatmapsRequestParams = {
/**
* (required) Tournament id
*/
id: number;
};
/**
* Request parameters available for use when requesting {@link TournamentsWrapper.prototype.list | api/v1/tournaments}
*/
export type TournamentsListRequestParams = {
page: number;
pageSize: number;
/**
* (optional) Filters results for only tournaments that are verified
*/
verified?: boolean | undefined;
/**
* (optional) Filters results for only tournaments played in a specified ruleset
*/
ruleset?: Ruleset | undefined;
/**
* (optional) Filters results for only tournaments with a partially matching name or abbreviation (case insensitive)
*/
searchQuery?: string | undefined;
/**
* (optional) Filters results for only tournaments that occurred on or after a specified date
*/
dateMin?: Date | undefined;
/**
* (optional) Filters results for only tournaments that occurred on or before a specified date
*/
dateMax?: Date | undefined;
/**
* (optional) Filters results for only tournaments with a specified verification status
*/
verificationStatus?: VerificationStatus | undefined;
/**
* (optional) Filters results for only tournaments with a specified rejection reason
*/
rejectionReason?: TournamentRejectionReason | undefined;
/**
* (optional) Filters results for only tournaments with a specified processing status
*/
processingStatus?: TournamentProcessingStatus | undefined;
/**
* (optional) Filters results for only tournaments submitted by a user with a specified id
*/
submittedBy?: number | undefined;
/**
* (optional) Filters results for only tournaments verified by a user with a specified id
*/
verifiedBy?: number | undefined;
/**
* (optional) Filters results for only tournaments played with a specified lobby size
*/
lobbySize?: number | undefined;
/**
* (optional) The key used to sort results by
*/
sort?: TournamentQuerySortType | undefined;
/**
* (optional) Whether the results are sorted in descending order by the API.DTOs.TournamentRequestQueryDTO.Sort
*/
descending?: boolean | undefined;
};
/**
* Request parameters available for use when requesting {@link TournamentsWrapper.prototype.create | api/v1/tournaments}
*/
export type TournamentsCreateRequestParams = {
/**
* (required) Tournament submission data
*/
body: TournamentSubmissionDTO;
};
/**
* Request parameters available for use when requesting {@link TournamentsWrapper.prototype.listMatches | api/v1/tournaments/[id]/matches}
*/
export type TournamentsListMatchesRequestParams = {
/**
* (required) Tournament id
*/
id: number;
};
export declare class TournamentsWrapper extends OtrApiWrapperBase {
protected instance: AxiosInstance;
protected baseUrl: string;
protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
constructor(configuration: IOtrApiWrapperConfiguration);
/**
* Delete a tournament
*
* Requires Authorization:
*
* Claim(s): admin
* @param params Request parameters (see {@link TournamentsDeleteRequestParams})
* @return The tournament was deleted successfully
*/
delete(params: TournamentsDeleteRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<void>>;
protected processDelete(response: AxiosResponse): Promise<OtrApiResponse<void>>;
/**
* Get a tournament
*
* Requires Authorization:
*
* Claim(s): user, client
* @param params Request parameters (see {@link TournamentsGetRequestParams})
* @return Returns a tournament
*/
get(params: TournamentsGetRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<TournamentDTO>>;
protected processGet(response: AxiosResponse): Promise<OtrApiResponse<TournamentDTO>>;
/**
* Amend tournament data
*
* Requires Authorization:
*
* Claim(s): admin
* @param params Request parameters (see {@link TournamentsUpdateRequestParams})
* @return Returns the updated tournament
*/
update(params: TournamentsUpdateRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<TournamentCompactDTO>>;
protected processUpdate(response: AxiosResponse): Promise<OtrApiResponse<TournamentCompactDTO>>;
/**
* Mark pre-rejected items as rejected, marks pre-verified
* items as verified. Applies for the tournament and all children.
*
* Requires Authorization:
*
* Claim(s): admin
* @param params Request parameters (see {@link TournamentsAcceptPreVerificationStatusesRequestParams})
* @return All items were updated successfully
*/
acceptPreVerificationStatuses(params: TournamentsAcceptPreVerificationStatusesRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<TournamentDTO>>;
protected processAcceptPreVerificationStatuses(response: AxiosResponse): Promise<OtrApiResponse<TournamentDTO>>;
/**
* Rerun automation checks for a tournament
*
* Requires Authorization:
*
* Claim(s): admin
* @param params Request parameters (see {@link TournamentsRerunAutomationChecksRequestParams})
* @return The entities were updated successfully
*/
rerunAutomationChecks(params: TournamentsRerunAutomationChecksRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<void>>;
protected processRerunAutomationChecks(response: AxiosResponse): Promise<OtrApiResponse<void>>;
/**
* Add beatmaps to a tournament by osu! id
*
* Requires Authorization:
*
* Claim(s): admin
* @param params Request parameters (see {@link TournamentsInsertBeatmapsRequestParams})
* @return The beatmaps were added successfully
*/
insertBeatmaps(params: TournamentsInsertBeatmapsRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<void>>;
protected processInsertBeatmaps(response: AxiosResponse): Promise<OtrApiResponse<void>>;
/**
* Delete all pooled beatmaps from a tournament. This does not alter the beatmaps table. This only
* deletes the mapping between a tournament and a pooled beatmap.
*
* Requires Authorization:
*
* Claim(s): admin
* @param params Request parameters (see {@link TournamentsDeleteBeatmapsRequestParams})
* @return All beatmaps were successfully removed
*/
deleteBeatmaps(params: TournamentsDeleteBeatmapsRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<void>>;
protected processDeleteBeatmaps(response: AxiosResponse): Promise<OtrApiResponse<void>>;
/**
* Get all beatmaps pooled by a tournament
*
* Requires Authorization:
*
* Claim(s): user, client
* @param params Request parameters (see {@link TournamentsGetBeatmapsRequestParams})
* @return Returns a collection of pooled beatmaps
*/
getBeatmaps(params: TournamentsGetBeatmapsRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<BeatmapDTO[]>>;
protected processGetBeatmaps(response: AxiosResponse): Promise<OtrApiResponse<BeatmapDTO[]>>;
/**
* Get all tournaments which fit an optional request query
*
* Results will not include match data
* @param params Request parameters (see {@link TournamentsListRequestParams})
* @return Returns all tournaments which fit the request query
*/
list(params: TournamentsListRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<TournamentDTO[]>>;
protected processList(response: AxiosResponse): Promise<OtrApiResponse<TournamentDTO[]>>;
/**
* Submit a tournament
*
* Requires Authorization:
*
* Claim(s): user
* @param params Request parameters (see {@link TournamentsCreateRequestParams})
* @return Returns location information for the created tournament
*/
create(params: TournamentsCreateRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<TournamentCreatedResultDTO>>;
protected processCreate(response: AxiosResponse): Promise<OtrApiResponse<TournamentCreatedResultDTO>>;
/**
* List all matches from a tournament
*
* Requires Authorization:
*
* Claim(s): user, client
* @param params Request parameters (see {@link TournamentsListMatchesRequestParams})
* @return Returns all matches from a tournament
*/
listMatches(params: TournamentsListMatchesRequestParams, cancelToken?: CancelToken): Promise<OtrApiResponse<MatchDTO[]>>;
protected processListMatches(response: AxiosResponse): Promise<OtrApiResponse<MatchDTO[]>>;
}
/**
* Request parameters available for use when requesting {@link UsersWrapper.prototype.get | api/v1/users/[id]}
*/
export type UsersGetRequestParams = {
/**
* (required) User id
*/
id: number;
};
/**
* Request para