Changelog

2.5.0

  • Fix Client.beatmaps.getBeatmapAttributes returning mismatch from type definition.
  • Add UserStatisticsVariant interface.
  • Add variants property to UserStatistics.
  • Add include_variant_statistics property to GetUsersOptions.query.
  • Auth.clientCredentialsGrant now has an optional scopes paramater of type Scope[]. Defaults to ['public'].

2.4.0

  • Add support for the /beatmaps/{beatmap}/solo-scores endpoint via Client.beatmaps.getBeatmapTopNonLegacyScores.
  • Add GetBeatmapTopNonLegacyScoresOptions interface.
  • Add image@2x property to UserActiveTournamentBanner interface.
  • Add image@2x_url property to UserBadge interface.
  • Add count_100, count_300, count_50, count_miss, pp_exp and global_rank_exp properties to UserStatistics interface.
  • Add active_tournament_banners to UserExtended interface.

2.3.1

  • Fix the setAccessToken method in the Client class not setting the access token for the other classes it uses.

2.3.0

  • Add the ability to set the access token in the current client via Client.setAccessToken.

2.2.0

  • Add ruleset and ruleset_id properties to GetBeatmapAttributesOptions.body.
  • Update response type for Client.users.getSelf to include the session_verified property.
  • Add 'chat.read' and 'chat.write_manage' to Scope union type.
  • Add safeParse method to the Client class to optionally prevent the OsuJSUnexpectedResponseError error to be thrown in requests done to the current API.

2.1.0

  • Add best_id property to the Score interface.
  • The count_geki and count_katu properties in the ScoreStatistics interface are now marked as nullable.
  • Fix a bug with getEnumMods when passing NC and/or PF alongside other mods.
  • Add derivativeModsWithOriginal parameter to getModsEnum in case the developer wishes for NC to output the same enum value as DTNC and for PF to output the same enum value as SDPF if set to true.

2.0.2

  • getEnumMods now returns ['NC'] instead of ['DT', 'NC'] when input is 576 and returns ['PF'] instead of ['SD', 'PF'] when input is 16416.

2.0.1

  • global_rank and country_rank properties in UserStatistics interface are now marked as nullable.

2.0.0

  • Use native fetch API instead of Axios.
  • Provide the option to pass a polyfill for the fetch API for development environments that have a Node.js version below 18.
  • Remove input validations.
  • Client.beatmaps.lookupBeatmap and Client.changelog.lookupChangelogBuild methods now return null if nothing is found on lookup. Prior to this, these methods would return undefined when there were no results.
  • Converted many types inferred from schemas into interfaces.
  • Other minor changes to some interfaces and types.
  • Introduce error handling via the OsuJSGeneralError and OsuJSUnexpectedResponseError classes and OsuJSError type.
  • Token can now be revoked using Client.revokeToken. Has same functionality as Auth.revokeToken.
  • Add links to documentation in JSDoc comments.
  • Add osu! Lazer mods to Mod type.
  • Remove unused interface GetBeatmapOptions. (Not to be confused with GetBeatmapsOptions, note the plural form of beatmap).
  • 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.
  • 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

1.4.0

  • Add guest and nominated literals to UserBeatmapsType.

1.3.1

  • Fix the Cllient.user.getUser method not accepting a username as an input for user param.

1.3.0

  • Update JSDoc comments.
  • Rename type UserEventTypes to UserEventType.
  • Fix buildUrl.forumTopic returning the same output as buildUrl.forum.
  • Type for property offset for GetUserKodosuOptions, GetUserRecentScoresOptions, GetUserScoresOptions, GetUserBeatmapsOptions and GetUserRecentActivityOptions has been changed from string to number.

1.2.3

Remove unnecessary GetReplay export.

1.2.2

Fix buildUrl returning invalid URLs.

1.2.1

Fix CJS and ESM exports.

1.2.0

Move requestAuthorizationUrl method from AuthCodeGrant class to buildUrl constant and rename to authRequest.

1.1.0

Remove unnecessary accessToken parameter from AuthCodeGrant.refreshToken method.

1.0.2

Rename interface ForumPost property create_at to created_at (typo).

1.0.1

Support both ESM and CJS modules.

1.0.0

Initial release.

Notice that something is missing? Found a typo? Think something's incomplete? Or think that something can be explained better? Feel free to open a pull request or submit an issue on the library's Github repository .