v2.0.0
Breaking Changes
- Use native fetch API instead of Axios.
- Remove input validations.
Client.beatmaps.lookupBeatmap
andClient.changelog.lookupChangelogBuild
methods now returnnull
if nothing is found on lookup. Prior to this, these methods would returnundefined
when there were no results.- Remove unused interface
GetBeatmapOptions
. (Not to be confused withGetBeatmapsOptions
, note the plural form of beatmap). - The following properties in
ModsEnum
have been renamed:K4
->4K
K5
->5K
K6
->6K
K7
->7K
K8
->8K
RN
->RD
TR
->TP
K1
->1K
K3
->3K
K2
->2K
Additions
- Provide the option to pass a polyfill for the fetch API for development environments that have a Node.js version below 18.
- Introduce error handling via the
OsuJSGeneralError
andOsuJSUnexpectedResponseError
classes andOsuJSError
type. - Token can now be revoked using
Client.revokeToken
. Has same functionality asAuth.revokeToken
. - Add links to documentation in JSDoc comments.
- Add osu! Lazer mods to
Mod
type. - New utility functions:
getModsEnum
: Converts an array of mods into its numerical representation.getEnumMods
: Converts a numerical representation of a mod or mod combination into an array of mods represented as strings.isOsuJSError
: Determines if a value is an error thrown by osu.js.
Patches
- Converted many types inferred from schemas into interfaces.