@hizollo/osu-api 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -578,6 +578,7 @@ declare abstract class BaseScore {
578
578
  readonly rank: ScoreRank;
579
579
  readonly mode: GameMode;
580
580
  readonly beatmapId: string;
581
+ readonly accuracy: number;
581
582
  constructor(client: Client, data: APIScore, other: BeatmapScoreOtherInfo);
582
583
  getPlayer(options?: Omit<GetUserRequestOptions, "user" | "type">): Promise<User | undefined>;
583
584
  getBeatmap(): Promise<Beatmap>;
@@ -682,4 +683,13 @@ declare abstract class URLBuilder {
682
683
  static scoreURL(mode: GameMode, scoreId: string): string;
683
684
  }
684
685
 
685
- export { APIBasicScore, APIBeatmap, APIBeatmapScore, APIGetBeatmapsRequestOptions, APIGetMatchRequestOptions, APIGetReplayRequestOptions, APIGetScoresRequestOptions, APIGetUserBestRequestOptions, APIGetUserRecentRequestOptions, APIGetUserRequestOptions, APIMatch, APIMatchData, APIMatchGameData, APIMatchNotFound, APIMatchScore, APIReplay, APIScore, APIUser, APIUserBestPerformanceScore, APIUserEvent, APIUserRecentPlayedScore, BaseManager, BaseScore, Beatmap, BeatmapApprovedState, BeatmapDiffculty, BeatmapGenre, BeatmapLanguage, BeatmapManager, BeatmapObjectCount, BeatmapScore, BeatmapScoreOtherInfo, Beatmapset, Client, ClientOptions, FetchUserBannerOptions, GameMode, GetBeatmapsRequestOptions, GetMatchRequestOptions, GetReplayRequestOptions, GetScoreRequestOptions, GetUserBestRequestOptions, GetUserRecentRequestOptions, GetUserRequestOptions, Match, MatchGame, MatchManager, MatchScore, MatchScoringType, MatchTeamType, Mods, ModsBitField, ModsResolvable, OsuApiRequestOptions, Replay, ReplayManager, RequestOptions, ScoreManager, ScoreRank, ScoreStatistics, Team, URLBuilder, User, UserEvent, UserManager, UserRequestType, UserScoreRankCount };
686
+ declare abstract class AccuracyCalculator {
687
+ static standard(count300: number, count100: number, count50: number, countMiss: number): number;
688
+ static taiko(count300: number, count100: number, countMiss: number): number;
689
+ static catch(count300: number, count100: number, count50: number, countKatu: number, countMiss: number): number;
690
+ static mania(count300: number, count100: number, count50: number, countKatu: number, countGeki: number, countMiss: number): number;
691
+ static maniaV2(count300: number, count100: number, count50: number, countKatu: number, countGeki: number, countMiss: number): number;
692
+ static calculate(score: BaseScore, v2?: boolean): number;
693
+ }
694
+
695
+ export { APIBasicScore, APIBeatmap, APIBeatmapScore, APIGetBeatmapsRequestOptions, APIGetMatchRequestOptions, APIGetReplayRequestOptions, APIGetScoresRequestOptions, APIGetUserBestRequestOptions, APIGetUserRecentRequestOptions, APIGetUserRequestOptions, APIMatch, APIMatchData, APIMatchGameData, APIMatchNotFound, APIMatchScore, APIReplay, APIScore, APIUser, APIUserBestPerformanceScore, APIUserEvent, APIUserRecentPlayedScore, AccuracyCalculator, BaseManager, BaseScore, Beatmap, BeatmapApprovedState, BeatmapDiffculty, BeatmapGenre, BeatmapLanguage, BeatmapManager, BeatmapObjectCount, BeatmapScore, BeatmapScoreOtherInfo, Beatmapset, Client, ClientOptions, FetchUserBannerOptions, GameMode, GetBeatmapsRequestOptions, GetMatchRequestOptions, GetReplayRequestOptions, GetScoreRequestOptions, GetUserBestRequestOptions, GetUserRecentRequestOptions, GetUserRequestOptions, Match, MatchGame, MatchManager, MatchScore, MatchScoringType, MatchTeamType, Mods, ModsBitField, ModsResolvable, OsuApiRequestOptions, Replay, ReplayManager, RequestOptions, ScoreManager, ScoreRank, ScoreStatistics, Team, URLBuilder, User, UserEvent, UserManager, UserRequestType, UserScoreRankCount };
package/dist/index.js CHANGED
@@ -27,6 +27,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
27
27
  // index.ts
28
28
  var osu_api_exports = {};
29
29
  __export(osu_api_exports, {
30
+ AccuracyCalculator: () => AccuracyCalculator,
30
31
  BaseManager: () => BaseManager,
31
32
  BaseScore: () => BaseScore,
32
33
  Beatmap: () => Beatmap,
@@ -310,6 +311,82 @@ ModsBitField.KeyMod = Mods.Key1 | Mods.Key2 | Mods.Key3 | Mods.Key4 | Mods.Key5
310
311
  ModsBitField.FreeModAllowed = Mods.NoFail | Mods.Easy | Mods.Hidden | Mods.HardRock | Mods.SuddenDeath | Mods.Flashlight | Mods.FadeIn | Mods.Relax | Mods.AutoPilot | Mods.SpunOut | _ModsBitField.KeyMod;
311
312
  ModsBitField.ScoreIncreaseMods = Mods.Hidden | Mods.HardRock | Mods.DoubleTime | Mods.Flashlight | Mods.FadeIn;
312
313
 
314
+ // src/utils/AccuracyCalculator.ts
315
+ var AccuracyCalculator = class {
316
+ static standard(count300, count100, count50, countMiss) {
317
+ const max = count300 + count100 + count50 + countMiss;
318
+ if (!max)
319
+ return 0;
320
+ return (count300 * 300 + count100 * 100 + count50 * 50) / (max * 300);
321
+ }
322
+ static taiko(count300, count100, countMiss) {
323
+ const max = count300 + count100 + countMiss;
324
+ if (!max)
325
+ return 0;
326
+ return (count300 + count100 * 0.5) / max;
327
+ }
328
+ static catch(count300, count100, count50, countKatu, countMiss) {
329
+ const max = count300 + count100 + count50 + countKatu + countMiss;
330
+ if (!max)
331
+ return 0;
332
+ return (count300 + count100 + count50) / max;
333
+ }
334
+ static mania(count300, count100, count50, countKatu, countGeki, countMiss) {
335
+ const max = count300 + count100 + count50 + countKatu + countGeki + countMiss;
336
+ if (!max)
337
+ return 0;
338
+ return (300 * countGeki + 300 * count300 + 200 * countKatu + 100 * count100 + 50 * count50) / (max * 300);
339
+ }
340
+ static maniaV2(count300, count100, count50, countKatu, countGeki, countMiss) {
341
+ const max = count300 + count100 + count50 + countKatu + countGeki + countMiss;
342
+ if (!max)
343
+ return 0;
344
+ return (305 * countGeki + 300 * count300 + 200 * countKatu + 100 * count100 + 50 * count50) / (max * 305);
345
+ }
346
+ static calculate(score, v2 = false) {
347
+ const { statistics } = score;
348
+ switch (score.mode) {
349
+ case 0 /* Standard */:
350
+ return AccuracyCalculator.standard(
351
+ statistics.count300,
352
+ statistics.count100,
353
+ statistics.count50,
354
+ statistics.countMiss
355
+ );
356
+ case 1 /* Taiko */:
357
+ return AccuracyCalculator.taiko(
358
+ statistics.count300,
359
+ statistics.count100,
360
+ statistics.countMiss
361
+ );
362
+ case 2 /* Catch */:
363
+ return AccuracyCalculator.catch(
364
+ statistics.count300,
365
+ statistics.count100,
366
+ statistics.count50,
367
+ statistics.countKatu,
368
+ statistics.countMiss
369
+ );
370
+ case 3 /* Mania */:
371
+ return v2 ? AccuracyCalculator.maniaV2(
372
+ statistics.count300,
373
+ statistics.count100,
374
+ statistics.count50,
375
+ statistics.countKatu,
376
+ statistics.countGeki,
377
+ statistics.countMiss
378
+ ) : AccuracyCalculator.mania(
379
+ statistics.count300,
380
+ statistics.count100,
381
+ statistics.count50,
382
+ statistics.countKatu,
383
+ statistics.countGeki,
384
+ statistics.countMiss
385
+ );
386
+ }
387
+ }
388
+ };
389
+
313
390
  // src/structures/BaseScore.ts
314
391
  var BaseScore = class {
315
392
  constructor(client, data, other) {
@@ -334,6 +411,7 @@ var BaseScore = class {
334
411
  } else {
335
412
  this.beatmapId = other.mapId;
336
413
  }
414
+ this.accuracy = AccuracyCalculator.calculate(this);
337
415
  }
338
416
  async getPlayer(options = {}) {
339
417
  const candidates = await this.client.users.getUser({
@@ -826,6 +904,7 @@ var Client = class {
826
904
  };
827
905
  // Annotate the CommonJS export names for ESM import in node:
828
906
  0 && (module.exports = {
907
+ AccuracyCalculator,
829
908
  BaseManager,
830
909
  BaseScore,
831
910
  Beatmap,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../index.ts","../src/Client.ts","../src/managers/UserManager.ts","../src/types/enums.ts","../src/utils/URLBuilder.ts","../src/structures/ModsBitField.ts","../src/structures/BaseScore.ts","../src/structures/BeatmapScore.ts","../src/structures/UserEvent.ts","../src/structures/User.ts","../src/managers/BaseManager.ts","../src/utils/toSqlDate.ts","../src/structures/Beatmapset.ts","../src/structures/Beatmap.ts","../src/managers/BeatmapManager.ts","../src/managers/ScoreManager.ts","../src/structures/Replay.ts","../src/managers/ReplayManager.ts","../src/structures/MatchScore.ts","../src/structures/MatchGame.ts","../src/structures/Match.ts","../src/managers/MatchManager.ts"],"sourcesContent":["export * from './src/Client';\n\nexport * from './src/managers/BaseManager';\nexport * from './src/managers/UserManager';\nexport * from './src/managers/BeatmapManager';\nexport * from './src/managers/ScoreManager';\nexport * from './src/managers/ReplayManager';\nexport * from './src/managers/MatchManager';\n\nexport * from './src/structures/ModsBitField';\nexport * from './src/structures/User';\nexport * from './src/structures/UserEvent';\nexport * from './src/structures/Beatmap';\nexport * from './src/structures/Beatmapset';\nexport * from './src/structures/BaseScore';\nexport * from './src/structures/BeatmapScore';\nexport * from './src/structures/MatchScore';\nexport * from './src/structures/Replay';\nexport * from './src/structures/Match';\nexport * from './src/structures/MatchGame';\n\nexport * from './src/utils/URLBuilder';\n\nexport * from './src/types/interfaces';\nexport * from './src/types/osuApiTypes';\nexport * from './src/types/enums';","import type { ClientOptions, OsuApiRequestOptions, RequestOptions } from './types/interfaces';\nimport request from 'superagent';\nimport { UserManager } from './managers/UserManager'\nimport { BeatmapManager } from './managers/BeatmapManager';\nimport { ScoreManager } from './managers/ScoreManager';\nimport { ReplayManager } from './managers/ReplayManager';\nimport { MatchManager } from './managers/MatchManager';\n\nexport class Client {\n private apiKey: string;\n public users: UserManager;\n public beatmaps: BeatmapManager;\n public scores: ScoreManager;\n public replays: ReplayManager;\n public matches: MatchManager;\n constructor(options: ClientOptions) {\n this.apiKey = options.apiKey;\n this.users = new UserManager(this);\n this.beatmaps = new BeatmapManager(this);\n this.scores = new ScoreManager(this);\n this.replays = new ReplayManager(this);\n this.matches = new MatchManager(this);\n }\n\n public async request<T extends OsuApiRequestOptions>(options: RequestOptions<T>) {\n if (!options?.path) throw new Error('MISSING_PATH');\n const response = await request.get(`https://osu.ppy.sh/api/${options.path}`)\n .query({ k: this.apiKey })\n .query(options.queries);\n\n return response.body;\n }\n}","import type { APIGetUserBestRequestOptions, APIGetUserRecentRequestOptions, APIGetUserRequestOptions, FetchUserBannerOptions, GetUserBestRequestOptions, GetUserRecentRequestOptions, GetUserRequestOptions } from \"../types/interfaces\";\nimport type { APIUser, APIUserBestPerformanceScore, APIUserRecentPlayedScore } from \"../types/osuApiTypes\";\nimport request from 'superagent';\nimport { URLBuilder } from \"../utils/URLBuilder\";\nimport { BeatmapScore } from \"../structures/BeatmapScore\";\nimport { User } from \"../structures/User\";\nimport { BaseManager } from \"./BaseManager\";\n\nexport class UserManager extends BaseManager {\n public async getUser(options: GetUserRequestOptions) {\n const queries = {\n u: options.user,\n m: options.gameMode,\n type: options.type,\n event_days: options.eventDays\n }\n\n const res = await this.client.request<APIGetUserRequestOptions>({\n path: 'get_user',\n queries\n }) as Array<APIUser>;\n\n return res.map(v => new User(this.client, v));\n }\n\n public async fetchBanner({ id }: FetchUserBannerOptions) {\n const context = await request.get(`https://osu.ppy.sh/users/${id}`);\n const banner_regex = new RegExp(`https:\\\\\\\\\\\\/\\\\\\\\\\\\/assets\\\\.ppy\\\\.sh\\\\\\\\\\\\/user-profile-covers\\\\\\\\\\\\\\/${id}\\\\\\\\\\\\/(?<hash>[0-9a-z]*?)\\\\.(?<ext>.*?)&`, 'gm');\n const banner = banner_regex.exec(context.text);\n\n if (banner) {\n const url = URLBuilder.banner(id, banner?.groups?.hash!, banner?.groups?.ext!);\n return url;\n }\n const default_banner_regex = new RegExp('https:\\\\\\\\\\\\/\\\\\\\\\\\\/osu\\\\.ppy\\\\.sh\\\\\\\\\\\\/images\\\\\\\\\\\\/headers\\\\\\\\\\\\/profile-covers\\\\\\\\\\\\/c(?<id>\\\\d)\\\\.(?<ext>.*?)&', 'gm');\n const defaultBanner = default_banner_regex.exec(context.text);\n const url = URLBuilder.defaultBanner(defaultBanner?.groups?.id!, defaultBanner?.groups?.ext!);\n return url;\n }\n\n public async getUserBest(options: GetUserBestRequestOptions) {\n const queries = {\n u: options.user,\n m: options.mode,\n type: options.type,\n limit: options.limit\n }\n\n const res = await this.client.request<APIGetUserBestRequestOptions>({\n path: 'get_user_best',\n queries\n }) as Array<APIUserBestPerformanceScore>;\n\n return res.map(v => new BeatmapScore(this.client, v, { mode: options.mode }));\n }\n\n public async getUserRecent(options: GetUserRecentRequestOptions) {\n const queries = {\n u: options.user,\n m: options.mode,\n type: options.type,\n limit: options.limit\n }\n\n const res = await this.client.request<APIGetUserRecentRequestOptions>({\n path: 'get_user_recent',\n queries\n }) as Array<APIUserRecentPlayedScore>;\n\n return res.map(v => new BeatmapScore(this.client, v, { mode: options.mode }));\n }\n\n}","export enum GameMode {\n Standard, Taiko, Catch, Mania\n}\n\nexport enum UserRequestType {\n String = 'string', \n Id = 'id'\n}\n\nexport const Mods = {\n None :0n,\n NoFail :1n << 0n,\n Easy :1n << 1n,\n TouchDevice :1n << 2n,\n Hidden :1n << 3n,\n HardRock :1n << 4n,\n SuddenDeath :1n << 5n,\n DoubleTime :1n << 6n,\n Relax :1n << 7n,\n HalfTime :1n << 8n,\n Nightcore :1n << 9n,\n Flashlight :1n << 10n,\n Autoplay :1n << 11n,\n SpunOut :1n << 12n,\n AutoPilot :1n << 13n,\n Perfect :1n << 14n,\n Key4 :1n << 15n,\n Key5 :1n << 16n,\n Key6 :1n << 17n,\n Key7 :1n << 18n,\n Key8 :1n << 19n,\n FadeIn :1n << 20n,\n Random :1n << 21n,\n Cinema :1n << 22n,\n Target :1n << 23n,\n Key9 :1n << 24n,\n KeyCoop :1n << 25n,\n Key1 :1n << 26n,\n Key3 :1n << 27n,\n Key2 :1n << 28n,\n ScoreV2 :1n << 29n,\n Mirror :1n << 30n,\n}\n\nexport enum BeatmapApprovedState {\n Graveyard = -2,\n WIP,\n Pending,\n Ranked,\n Approved,\n Qualified,\n Loved\n}\n\nexport enum BeatmapGenre {\n Any, Unspecified, VideoGame, Anime, Rock, Pop, Other, Novelty,\n HipHop = 9, Electronic, Metal, Classic, Folk, Jazz\n}\n\nexport enum BeatmapLanguage {\n Any, Unspecified, English, Japanese, Chinese,\n Instrumental, Korean, French, German, Swedish,\n Spanish, Italian, Russian, Polish, Other\n}\n\nexport enum ScoreRank {\n XH, X, SH, S, A, B, C, D, F\n}\n\nexport enum MatchScoringType {\n Score, Accuracy, Combo, ScoreV2\n}\n\nexport enum MatchTeamType {\n HeadToHead, TagCoop, TeamVs, TagTeamVs\n}\n\nexport enum Team {\n None, Blue, Red\n}","import { GameMode } from \"../types/enums\";\n\nexport abstract class URLBuilder {\n private static gameModeToURLPattern(mode: GameMode) {\n switch(mode) {\n case GameMode.Standard: return 'osu';\n case GameMode.Taiko: return 'taiko';\n case GameMode.Catch: return 'fruits';\n case GameMode.Mania: return 'mania';\n default: throw new Error('INVALID_GAMEMODE');\n }\n }\n\n public static avatar(id: string) {\n return `https://a.ppy.sh/${id}`;\n }\n\n public static profile(idOrName: string) {\n return `https://osu.ppy.sh/users/${idOrName}`;\n }\n\n public static banner(userId: string, hash: string, ext: string) {\n return `https://assets.ppy.sh/user-profile-covers/${userId}/${hash}.${ext}`;\n }\n\n public static defaultBanner(id: string, ext: string) {\n return `https://osu.ppy.sh/images/headers/profile-covers/c${id}.${ext}`;\n }\n\n public static beatmapsetURL(beatmapsetId: string) {\n return `https://osu.ppy.sh/beatmapsets/${beatmapsetId}`;\n }\n\n public static beatmapURL(beatmapsetId: string, beatmapId: string, mode: GameMode) {\n const m = URLBuilder.gameModeToURLPattern(mode);\n return `https://osu.ppy.sh/beatmapsets/${beatmapsetId}#${m}/${beatmapId}`;\n }\n\n public static beatmapCoverImage(beatmapsetId: string) {\n return `https://assets.ppy.sh/beatmaps/${beatmapsetId}/covers/cover.jpg`;\n }\n\n public static beatmapCoverThumbnail(beatmapsetId: string) {\n return `https://b.ppy.sh/thumb/${beatmapsetId}l.jpg`;\n }\n\n public static scoreURL(mode: GameMode, scoreId: string) {\n const m = URLBuilder.gameModeToURLPattern(mode);\n return `https://osu.ppy.sh/scores/${m}/${scoreId}`;\n }\n}","import { Mods } from \"../types/enums\";\n\nexport type ModsResolvable = number | string | bigint | ModsBitField | Array<ModsResolvable>;\n\nexport class ModsBitField {\n static Flags = Mods;\n static KeyMod = \n Mods.Key1 | Mods.Key2 | Mods.Key3 | Mods.Key4 | Mods.Key5 |\n Mods.Key6 | Mods.Key7 | Mods.Key8 | Mods.Key9 | Mods.KeyCoop;\n static FreeModAllowed = \n Mods.NoFail | Mods.Easy | Mods.Hidden | Mods.HardRock | Mods.SuddenDeath | \n Mods.Flashlight | Mods.FadeIn | Mods.Relax | Mods.AutoPilot | Mods.SpunOut | \n ModsBitField.KeyMod;\n static ScoreIncreaseMods = \n Mods.Hidden | Mods.HardRock | Mods.DoubleTime | Mods.Flashlight | Mods.FadeIn;\n\n public bitfield: bigint;\n constructor(bits: ModsResolvable = 0n) {\n this.bitfield = ModsBitField.resolve(bits);\n }\n\n public any(bit: ModsResolvable) {\n return (this.bitfield & ModsBitField.resolve(bit)) !== 0n;\n }\n\n public equals(bit: ModsResolvable) {\n return this.bitfield === ModsBitField.resolve(bit);\n }\n\n public has(bit: ModsResolvable) {\n bit = ModsBitField.resolve(bit);\n return (this.bitfield & bit) === bit;\n }\n\n public add(...bits: Array<ModsResolvable>) {\n let total: bigint = 0n;\n for (const bit of bits) {\n total |= ModsBitField.resolve(bit);\n }\n this.bitfield |= total;\n\n return this;\n }\n\n public remove(...bits: ModsResolvable[]) {\n let total: bigint = 0n;\n for (const bit of bits) {\n total |= ModsBitField.resolve(bit);\n }\n this.bitfield &= ~total;\n\n return this;\n }\n\n public toArray() {\n return Object.keys(ModsBitField.Flags).filter(bit => this.has(bit));\n }\n\n public serialize() {\n const serialized: { [key: string]: boolean } = {};\n for (const [flag, bit] of Object.entries(ModsBitField.Flags)) {\n serialized[flag as keyof typeof ModsBitField.Flags] = this.has(bit);\n }\n return serialized;\n }\n\n public isNone() {\n return this.bitfield === 0n;\n }\n\n public valueOf() {\n return this.bitfield;\n }\n\n public static resolve(bit: ModsResolvable): bigint {\n if (Array.isArray(bit)) {\n return bit.map(ModsBitField.resolve).reduce((acc, now) => acc | now, 0n);\n }\n if (bit instanceof ModsBitField) {\n return bit.bitfield;\n }\n if (typeof bit === 'number') return BigInt(bit);\n if (typeof bit === 'string') {\n if (!isNaN(+bit)) return BigInt(bit);\n const a: bigint | undefined = ModsBitField.Flags[bit as keyof typeof ModsBitField.Flags];\n if (typeof a === 'undefined') throw new Error('INVALID_BITFIELD');\n return a;\n }\n return bit;\n }\n}","import type { Client } from \"../Client\";\nimport type { APIBasicScore, APIBeatmapScore, APIMatchScore, APIUserBestPerformanceScore, APIUserRecentPlayedScore } from \"../types/osuApiTypes\";\nimport type { BeatmapScoreOtherInfo, GetUserRequestOptions, ScoreStatistics } from \"../types/interfaces\";\nimport type { User } from \"./User\";\nimport { GameMode, ScoreRank, UserRequestType } from \"../types/enums\";\nimport { ModsBitField } from \"./ModsBitField\";\n\nexport type APIScore = \n APIBasicScore |\n APIUserRecentPlayedScore |\n APIUserBestPerformanceScore | \n APIBeatmapScore |\n APIMatchScore;\n\nexport abstract class BaseScore {\n public readonly client: Client;\n public readonly score: number;\n public readonly maxCombo: number;\n public readonly statistics: ScoreStatistics;\n public readonly perfect: boolean;\n public readonly enabledMods: ModsBitField;\n public readonly userId: string;\n public readonly rank: ScoreRank;\n public readonly mode: GameMode;\n public readonly beatmapId: string;\n constructor(client: Client, data: APIScore, other: BeatmapScoreOtherInfo) {\n this.client = client;\n this.score = +data.score;\n this.maxCombo = +data.maxcombo;\n this.statistics = {\n count50: +data.count50,\n count100: +data.count100,\n count300: +data.count300,\n countMiss: +data.countmiss,\n countKatu: +data.countkatu,\n countGeki: +data.countgeki\n }\n this.perfect = !!+data.perfect;\n this.enabledMods = new ModsBitField(data.enabled_mods);\n this.userId = data.user_id;\n this.rank = ScoreRank[data.rank];\n this.mode = other.mode ?? GameMode.Standard;\n\n if ('beatmap_id' in data) {\n this.beatmapId = data.beatmap_id;\n } else {\n this.beatmapId = other.mapId!;\n }\n }\n\n public async getPlayer(options: Omit<GetUserRequestOptions, \"user\" | \"type\"> = {}): Promise<User | undefined> {\n const candidates = await this.client.users.getUser({\n user: this.userId,\n type: UserRequestType.Id,\n ...options\n });\n\n return candidates[0];\n }\n\n public async getBeatmap() {\n const candidates = await this.client.beatmaps.getBeatmaps({\n beatmapId: this.beatmapId,\n mode: this.mode,\n });\n\n return candidates[0];\n }\n\n public getReplay() {\n return this.client.replays.getReplay({\n beatmapId: this.beatmapId,\n user: this.userId,\n type: UserRequestType.Id\n })\n }\n}","import type { Client } from \"../Client\";\nimport type { BeatmapScoreOtherInfo } from \"../types/interfaces\";\nimport type { APIBeatmapScore, APIUserBestPerformanceScore, APIUserRecentPlayedScore } from \"../types/osuApiTypes\";\nimport { URLBuilder } from \"../utils/URLBuilder\";\nimport { BaseScore } from \"./BaseScore\";\n\nexport class BeatmapScore extends BaseScore {\n public readonly date: Date;\n public readonly scoreId: string | null = null;\n public readonly username: string | null = null;\n public readonly pp: number | null = null;\n public readonly replayAvailable: boolean | null = null;\n\n constructor(client: Client, data: APIBeatmapScore, other: BeatmapScoreOtherInfo);\n constructor(client: Client, data: APIUserBestPerformanceScore, other: BeatmapScoreOtherInfo);\n constructor(client: Client, data: APIUserRecentPlayedScore, other: BeatmapScoreOtherInfo);\n\n constructor(\n client: Client, \n data: APIBeatmapScore | APIUserBestPerformanceScore | APIUserRecentPlayedScore, \n other: BeatmapScoreOtherInfo\n ) {\n super(client, data, other);\n\n this.date = new Date(data.date);\n \n if ('score_id' in data) {\n this.scoreId = data.score_id;\n }\n\n if ('username' in data) {\n this.username = data.username;\n }\n\n if ('pp' in data) {\n this.pp = +data.pp;\n }\n\n if ('replay_available' in data) {\n this.replayAvailable = !!+data.replay_available;\n }\n }\n\n public scoreURL() {\n if (!this.scoreId) return null;\n return URLBuilder.scoreURL(this.mode, this.scoreId);\n }\n\n}","import type { User } from './User';\nimport type { APIUserEvent } from \"../types/osuApiTypes\";\nimport type { Beatmap } from './Beatmap';\n\nexport class UserEvent {\n public readonly user: User;\n public readonly displayHtml: string;\n public readonly beatmapId: string;\n public readonly beatmapsetId: string;\n public readonly date: Date;\n public readonly epicfactor: number;\n constructor(user: User, data: APIUserEvent) {\n this.user = user;\n this.displayHtml = data.display_html;\n this.beatmapId = data.beatmap_id;\n this.beatmapsetId = data.beatmapset_id;\n this.date = new Date(data.date);\n this.epicfactor = +data.epicfactor;\n }\n\n public async getBeatmap(): Promise<Beatmap | undefined> {\n const candidates = await this.user.client.beatmaps.getBeatmaps({\n beatmapId: this.beatmapId,\n beatmapsetId: this.beatmapsetId,\n });\n\n return candidates[0];\n }\n\n public async getBeatmapset() {\n const beatmap = await this.getBeatmap();\n return beatmap?.getBeatmapset();\n }\n}","import type { UserScoreRankCount, GetUserBestRequestOptions, GetUserRecentRequestOptions } from \"../types/interfaces\";\nimport type { APIUser } from \"../types/osuApiTypes\";\nimport type { Client } from \"../Client\";\nimport { UserEvent } from \"./UserEvent\";\nimport { URLBuilder } from \"../utils/URLBuilder\";\nimport { UserRequestType } from \"../types/enums\";\n\nexport class User {\n public readonly client: Client;\n\n // User Data\n public readonly id: string;\n public readonly username: string;\n public readonly joinDate: Date;\n public readonly playcount: number;\n public readonly level: number;\n public readonly country: string;\n public readonly playtime: number;\n public readonly events: Array<UserEvent>;\n public banner: string | null;\n\n // User Score\n public readonly count300: number;\n public readonly count100: number;\n public readonly count50: number;\n public readonly rankedScore: number;\n public readonly totalScore: number;\n public readonly rank: number;\n public readonly countryRank: number;\n public readonly pp: number;\n public readonly accuracy: number;\n public readonly scoreRankCount: UserScoreRankCount;\n\n constructor(client: Client, data: APIUser) {\n this.client = client;\n this.id = data.user_id;\n this.username = data.username;\n this.joinDate = new Date(data.join_date);\n this.count300 = +data.count300;\n this.count100 = +data.count100;\n this.count50 = +data.count50;\n this.playcount = +data.playcount;\n this.playtime = +data.total_seconds_played;\n this.rankedScore = +data.ranked_score;\n this.totalScore = +data.total_score;\n this.rank = +data.pp_rank;\n this.level = +data.level;\n this.pp = +data.pp_raw;\n this.accuracy = +data.accuracy;\n this.scoreRankCount = {\n ss: +data.count_rank_ss,\n ssh: +data.count_rank_ssh,\n s: +data.count_rank_s,\n sh: +data.count_rank_sh,\n a: +data.count_rank_a\n };\n this.country = data.country;\n this.countryRank = +data.pp_country_rank;\n this.events = data.events.map(v => new UserEvent(this, v));\n\n this.banner = null;\n }\n\n public avatarURL() {\n return URLBuilder.avatar(this.id);\n }\n\n public profileURL() {\n return URLBuilder.profile(this.id);\n }\n\n public async fetchBanner(force: boolean = false) {\n if (!force && this.banner) return this.banner;\n const url = await this.client.users.fetchBanner({ id: this.id });\n return this.banner = url;\n }\n\n public getBest(options: Omit<GetUserBestRequestOptions, \"user\" | \"type\"> = {}) {\n return this.client.users.getUserBest({\n user: this.id,\n type: UserRequestType.Id,\n ...options\n });\n\n }\n\n public getRecent(options: Omit<GetUserRecentRequestOptions, \"user\" | \"type\"> = {}) {\n return this.client.users.getUserRecent({\n user: this.id,\n type: UserRequestType.Id,\n ...options\n });\n }\n}","import type { Client } from \"../Client\";\n\nexport abstract class BaseManager {\n public readonly client: Client;\n constructor(client: Client) {\n this.client = client;\n }\n}","export function toSqlDate(date: Date) {\n return date.toISOString().slice(0, 19).replace('T', ' ');\n}","import type { Client } from '../Client';\nimport type { BeatmapApprovedState, BeatmapGenre, BeatmapLanguage } from '../types/enums';\nimport type { Beatmap } from './Beatmap';\nimport type { User } from './User';\nimport { UserRequestType } from '../types/enums';\nimport { URLBuilder } from '../utils/URLBuilder';\n\nexport class Beatmapset {\n public readonly client: Client;\n public readonly beatmaps: Array<Beatmap>;\n public readonly id: string;\n public readonly approvedState: BeatmapApprovedState;\n public readonly length: number;\n public readonly submitDate: Date;\n public readonly approvedDate: Date | null;\n public readonly lastUpdate: Date;\n public readonly artist: string;\n public readonly title: string;\n public readonly creator: string;\n public readonly creatorId: string;\n public readonly source: string;\n public readonly tags: string[];\n public readonly genre: BeatmapGenre;\n public readonly language: BeatmapLanguage;\n public readonly favoriteCount: number;\n public readonly rating: number;\n public readonly downloadUnavailable: boolean;\n public readonly audioUnavailable: boolean;\n constructor(client: Client, data: Beatmap, maps: Array<Beatmap>) {\n this.client = client;\n this.beatmaps = maps;\n this.id = data.beatmapsetId;\n this.approvedState = data.approvedState;\n this.length = data.totalLength;\n this.submitDate = data.submitDate;\n this.approvedDate = data.approvedDate;\n this.lastUpdate = data.lastUpdate;\n this.artist = data.artist;\n this.title = data.title;\n this.creator = data.creator;\n this.creatorId = data.creatorId;\n this.source = data.source;\n this.tags = data.tags.slice();\n this.genre = data.genre;\n this.language = data.language;\n this.favoriteCount = data.favoriteCount;\n this.rating = data.rating;\n this.downloadUnavailable = data.downloadUnavailable;\n this.audioUnavailable = data.audioUnavailable;\n }\n\n public beatmapsetURL() {\n return URLBuilder.beatmapsetURL(this.id);\n }\n \n public coverImageURL() {\n return URLBuilder.beatmapCoverImage(this.id);\n }\n \n public coverThumbnailURL() {\n return URLBuilder.beatmapCoverThumbnail(this.id);\n }\n \n public async getCreator(): Promise<User | undefined> {\n const candidates = await this.client.users.getUser({\n user: this.creatorId,\n type: UserRequestType.Id\n });\n\n return candidates[0];\n }\n}","import type { Client } from \"../Client\";\nimport type { BeatmapDiffculty, BeatmapObjectCount } from \"../types/interfaces\";\nimport type { APIBeatmap } from \"../types/osuApiTypes\";\nimport type { User } from \"./User\";\nimport { BeatmapApprovedState, BeatmapGenre, BeatmapLanguage, GameMode, UserRequestType } from \"../types/enums\";\nimport { URLBuilder } from \"../utils/URLBuilder\";\nimport { Beatmapset } from \"./Beatmapset\";\n\nexport class Beatmap {\n public readonly id: string;\n public readonly beatmapsetId: string;\n public readonly approvedState: BeatmapApprovedState;\n public readonly totalLength: number;\n public readonly hitLength: number;\n public readonly diffcultyName: string;\n public readonly hash: string;\n public readonly difficulty: BeatmapDiffculty;\n public readonly mode: GameMode;\n public readonly objectCount: BeatmapObjectCount;\n public readonly submitDate: Date;\n public readonly approvedDate: Date | null;\n public readonly lastUpdate: Date;\n public readonly artist: string;\n public readonly title: string;\n public readonly creator: string;\n public readonly creatorId: string;\n public readonly bpm: number;\n public readonly source: string;\n public readonly tags: string[];\n public readonly genre: BeatmapGenre;\n public readonly language: BeatmapLanguage;\n public readonly favoriteCount: number;\n public readonly rating: number;\n public readonly downloadUnavailable: boolean;\n public readonly audioUnavailable: boolean;\n public readonly playcount: number;\n public readonly passcount: number;\n public readonly maxCombo: number | null;\n constructor(public readonly client: Client, data: APIBeatmap) {\n this.id = data.beatmap_id;\n this.beatmapsetId = data.beatmapset_id;\n this.approvedState = +data.approved;\n this.totalLength = +data.total_length;\n this.hitLength = +data.hit_length;\n this.diffcultyName = data.version;\n this.hash = data.file_md5;\n this.difficulty = {\n ApproachRate: +data.diff_approach,\n CircleSize: +data.diff_size,\n OverallDifficulty: +data.diff_overall,\n HPDrainRate: +data.diff_drain,\n aim: +(data.diff_aim ?? 0),\n speed: +(data.diff_speed ?? 0),\n rating: +(data.difficultyrating ?? 0)\n }\n this.mode = +data.mode;\n this.objectCount = {\n circle: +data.count_normal,\n slider: +data.count_slider,\n spinner: +data.count_spinner\n }\n this.submitDate = new Date(data.submit_date);\n if (!data.approved_date) {\n this.approvedDate = null;\n } else {\n this.approvedDate = new Date(data.approved_date);\n }\n this.lastUpdate = new Date(data.last_update);\n this.artist = data.artist;\n this.title = data.title;\n this.creator = data.creator;\n this.creatorId = data.creator_id;\n this.bpm = +data.bpm;\n this.source = data.source;\n this.tags = data.tags.split(' ');\n this.genre = +data.genre_id;\n this.language = +data.language_id;\n this.favoriteCount = +data.favourite_count;\n this.rating = +data.rating;\n this.downloadUnavailable = !!+data.download_unavailable;\n this.audioUnavailable = !!+data.audio_unavailable;\n this.playcount = +data.playcount;\n this.passcount = +data.passcount;\n if (data.max_combo) {\n this.maxCombo = +data.max_combo;\n } else {\n this.maxCombo = null;\n }\n }\n\n public beatmapsetURL() {\n return URLBuilder.beatmapsetURL(this.beatmapsetId);\n }\n\n public beatmapURL() {\n return URLBuilder.beatmapURL(this.beatmapsetId, this.id, this.mode);\n }\n \n public coverImageURL() {\n return URLBuilder.beatmapCoverImage(this.beatmapsetId);\n }\n \n public coverThumbnailURL() {\n return URLBuilder.beatmapCoverThumbnail(this.beatmapsetId);\n }\n \n public async getCreator(): Promise<User | undefined> {\n const candidates = await this.client.users.getUser({\n user: this.creatorId,\n type: UserRequestType.Id\n });\n\n return candidates[0];\n }\n\n public async getBeatmapset() {\n const set = await this.client.beatmaps.getBeatmaps({\n beatmapsetId: this.beatmapsetId\n });\n \n return new Beatmapset(this.client, this, set);\n }\n\n}","import type { APIGetBeatmapsRequestOptions, GetBeatmapsRequestOptions } from \"../types/interfaces\";\nimport type { APIBeatmap } from \"../types/osuApiTypes\";\nimport { toSqlDate } from '../utils/toSqlDate';\nimport { ModsBitField } from \"../structures/ModsBitField\";\nimport { Beatmap } from \"../structures/Beatmap\";\nimport { BaseManager } from \"./BaseManager\";\n\nexport class BeatmapManager extends BaseManager {\n public async getBeatmaps(options: GetBeatmapsRequestOptions = {}) {\n const queries = {\n since: options.since && toSqlDate(options.since),\n s: options.beatmapsetId,\n b: options.beatmapId,\n u: options.user,\n type: options.type,\n m: options.mode,\n a: options.showConverted,\n h: options.hash,\n limit: options.limit,\n mods: ModsBitField.resolve(options.mods ?? 0)\n }\n\n const res = await this.client.request<APIGetBeatmapsRequestOptions>({\n path: 'get_beatmaps',\n queries\n }) as Array<APIBeatmap>;\n\n return res.map(v => new Beatmap(this.client, v));\n }\n}","import type { APIGetScoresRequestOptions, GetScoreRequestOptions } from \"../types/interfaces\";\nimport type { APIBeatmapScore } from \"../types/osuApiTypes\";\nimport { ModsBitField } from \"../structures/ModsBitField\";\nimport { BeatmapScore } from \"../structures/BeatmapScore\";\nimport { BaseManager } from \"./BaseManager\";\n\nexport class ScoreManager extends BaseManager {\n public async getScores(options: GetScoreRequestOptions) {\n const mods = options.mods == undefined \n ? undefined : ModsBitField.resolve(options.mods);\n const queries = {\n b: options.beatmapId,\n u: options.user,\n m: options.mode,\n mods: mods,\n type: options.type,\n limit: options.limit\n }\n\n const res = await this.client.request<APIGetScoresRequestOptions>({\n path: 'get_scores',\n queries\n }) as Array<APIBeatmapScore>;\n\n return res.map(v => new BeatmapScore(this.client, v, { mapId: options.beatmapId, mode: options.mode }));\n }\n}","import type { Client } from \"../Client\";\nimport type { APIReplay } from \"../types/osuApiTypes\";\nimport { Buffer } from 'node:buffer'\n\nexport class Replay {\n public readonly client: Client;\n public readonly content: string;\n public readonly stream: Buffer;\n constructor(client: Client, data: APIReplay) {\n this.client = client;\n this.content = data.content;\n this.stream = Buffer.from(this.content, 'base64');\n }\n}","import type { APIGetReplayRequestOptions, GetReplayRequestOptions } from \"../types/interfaces\";\nimport type { APIReplay } from \"../types/osuApiTypes\";\nimport { ModsBitField } from \"../structures/ModsBitField\";\nimport { Replay } from \"../structures/Replay\";\nimport { BaseManager } from \"./BaseManager\";\n\nexport class ReplayManager extends BaseManager {\n public async getReplay(options: GetReplayRequestOptions) {\n if ((!options.beatmapId || !options.user) && !options.scoreId) {\n throw new Error('You should provide either beatmapId and user or scordId to get replay')\n }\n const mods = options.mods == undefined \n ? undefined : ModsBitField.resolve(options.mods);\n const queries = {\n b: options.beatmapId,\n u: options.user,\n m: options.mode,\n s: options.scoreId,\n type: options.type,\n mods: mods\n }\n\n const res = await this.client.request<APIGetReplayRequestOptions>({\n path: 'get_replay',\n queries\n }) as APIReplay;\n\n return new Replay(this.client, res);\n }\n}","import type { Client } from \"../Client\";\nimport type { Team } from \"../types/enums\";\nimport type { BeatmapScoreOtherInfo } from \"../types/interfaces\";\nimport type { APIMatchScore } from \"../types/osuApiTypes\";\nimport { BaseScore } from \"./BaseScore\";\n\nexport class MatchScore extends BaseScore {\n public readonly slot: number;\n public readonly team: Team;\n public readonly pass: boolean;\n constructor(client: Client, data: APIMatchScore, other: BeatmapScoreOtherInfo) {\n super(client, data, other);\n this.slot = +data.slot;\n this.team = +data.team;\n this.pass = !!+data.pass;\n }\n}","import type { Client } from \"../Client\";\nimport type { GameMode, MatchScoringType, Team } from \"../types/enums\";\nimport type { APIMatchGameData } from \"../types/osuApiTypes\";\nimport type { Beatmap } from \"./Beatmap\";\nimport type { Match } from \"./Match\";\nimport { MatchScore } from \"./MatchScore\";\nimport { ModsBitField } from \"./ModsBitField\";\n\nexport class MatchGame {\n public readonly client: Client;\n public readonly match: Match;\n public readonly id: string;\n public readonly startAt: Date;\n public readonly endAt: Date;\n public readonly beatmapId: string;\n public readonly mode: GameMode;\n public readonly matchType: number;\n public readonly scoringType: MatchScoringType;\n public readonly teamType: Team;\n public readonly mods: ModsBitField;\n public readonly scores: Array<MatchScore>;\n constructor(match: Match, data: APIMatchGameData) {\n this.client = match.client;\n this.match = match;\n this.id = data.game_id;\n this.startAt = new Date(data.start_time);\n this.endAt = new Date(data.end_time);\n this.beatmapId = data.beatmap_id;\n this.mode = +data.play_mode;\n this.matchType = +data.match_type;\n this.scoringType = +data.scoring_type;\n this.teamType = +data.team_type;\n this.mods = new ModsBitField(data.mods);\n this.scores = data.scores.map(score => new MatchScore(this.client, score, {\n mode: +data.play_mode,\n mapId: data.beatmap_id\n }));\n }\n\n public async getBeatmap(): Promise<Beatmap | undefined> {\n const candidates = await this.client.beatmaps.getBeatmaps({\n beatmapId: this.beatmapId\n });\n return candidates[0];\n }\n}","import type { APIMatch } from \"../types/osuApiTypes\";\nimport type { Client } from \"../Client\";\nimport { MatchGame } from \"./MatchGame\";\n\nexport class Match {\n public readonly client: Client;\n public readonly id: string;\n public readonly name: string;\n public readonly startAt: Date;\n public readonly endAt: Date | null;\n public readonly games: Array<MatchGame>\n constructor(client: Client, data: APIMatch) {\n this.client = client;\n\n const { match, games } = data;\n this.id = match.match_id;\n this.name = match.name;\n this.startAt = new Date(match.start_time);\n if (match.end_time) {\n this.endAt = new Date(match.end_time);\n } else {\n this.endAt = null;\n }\n\n this.games = games.map(data => new MatchGame(this, data));\n\n }\n}","import { BaseManager } from \"./BaseManager\";\nimport type { GetMatchRequestOptions } from \"../types/interfaces\";\nimport type { APIMatch, APIMatchNotFound } from \"../types/osuApiTypes\";\nimport { Match } from \"../structures/Match\";\n\nexport class MatchManager extends BaseManager {\n public async getMatch(options: GetMatchRequestOptions) {\n const queries = {\n mp: options.matchId\n }\n const res = await this.client.request({\n path: 'get_match',\n queries\n }) as APIMatch | APIMatchNotFound;\n\n if (res.match === 0) { return null; }\n return new Match(this.client, res);\n }\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,IAAAA,qBAAoB;;;ACCpB,wBAAoB;;;ACFb,IAAK,WAAL,kBAAKC,cAAL;AACH,EAAAA,oBAAA;AAAU,EAAAA,oBAAA;AAAO,EAAAA,oBAAA;AAAO,EAAAA,oBAAA;AADhB,SAAAA;AAAA,GAAA;AAIL,IAAK,kBAAL,kBAAKC,qBAAL;AACH,EAAAA,iBAAA,YAAS;AACT,EAAAA,iBAAA,QAAK;AAFG,SAAAA;AAAA,GAAA;AAKL,IAAM,OAAO;AAAA,EAChB,MAAgB;AAAA,EAChB,QAAgB,MAAM;AAAA,EACtB,MAAgB,MAAM;AAAA,EACtB,aAAgB,MAAM;AAAA,EACtB,QAAgB,MAAM;AAAA,EACtB,UAAgB,MAAM;AAAA,EACtB,aAAgB,MAAM;AAAA,EACtB,YAAgB,MAAM;AAAA,EACtB,OAAgB,MAAM;AAAA,EACtB,UAAgB,MAAM;AAAA,EACtB,WAAgB,MAAM;AAAA,EACtB,YAAgB,MAAM;AAAA,EACtB,UAAgB,MAAM;AAAA,EACtB,SAAgB,MAAM;AAAA,EACtB,WAAgB,MAAM;AAAA,EACtB,SAAgB,MAAM;AAAA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AAI;AACvC,SAAK,SAAS,IAAI,aAAa,IAAI;AACnC,SAAK,UAAU,IAAI,cAAc,IAAI;AACrC,SAAK,UAAU,IAAI,aAAa,IAAI;AAAA,EACxC;AAAA,EAEA,MAAa,QAAwC,SAA4B;AAC7E,QAAI,CAAC,SAAS;AAAM,YAAM,IAAI,MAAM,cAAc;AAClD,UAAM,WAAW,MAAM,mBAAAC,QAAQ,IAAI,0BAA0B,QAAQ,MAAM,EACtE,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,EACxB,MAAM,QAAQ,OAAO;AAE1B,WAAO,SAAS;AAAA,EACpB;AACJ;","names":["import_superagent","GameMode","UserRequestType","BeatmapApprovedState","BeatmapGenre","BeatmapLanguage","ScoreRank","MatchScoringType","MatchTeamType","Team","request","url","data","request"]}
1
+ {"version":3,"sources":["../index.ts","../src/Client.ts","../src/managers/UserManager.ts","../src/types/enums.ts","../src/utils/URLBuilder.ts","../src/structures/ModsBitField.ts","../src/utils/AccuracyCalculator.ts","../src/structures/BaseScore.ts","../src/structures/BeatmapScore.ts","../src/structures/UserEvent.ts","../src/structures/User.ts","../src/managers/BaseManager.ts","../src/utils/toSqlDate.ts","../src/structures/Beatmapset.ts","../src/structures/Beatmap.ts","../src/managers/BeatmapManager.ts","../src/managers/ScoreManager.ts","../src/structures/Replay.ts","../src/managers/ReplayManager.ts","../src/structures/MatchScore.ts","../src/structures/MatchGame.ts","../src/structures/Match.ts","../src/managers/MatchManager.ts"],"sourcesContent":["export * from './src/Client';\n\nexport * from './src/managers/BaseManager';\nexport * from './src/managers/UserManager';\nexport * from './src/managers/BeatmapManager';\nexport * from './src/managers/ScoreManager';\nexport * from './src/managers/ReplayManager';\nexport * from './src/managers/MatchManager';\n\nexport * from './src/structures/ModsBitField';\nexport * from './src/structures/User';\nexport * from './src/structures/UserEvent';\nexport * from './src/structures/Beatmap';\nexport * from './src/structures/Beatmapset';\nexport * from './src/structures/BaseScore';\nexport * from './src/structures/BeatmapScore';\nexport * from './src/structures/MatchScore';\nexport * from './src/structures/Replay';\nexport * from './src/structures/Match';\nexport * from './src/structures/MatchGame';\n\nexport * from './src/utils/URLBuilder';\nexport * from './src/utils/AccuracyCalculator'\n\nexport * from './src/types/interfaces';\nexport * from './src/types/osuApiTypes';\nexport * from './src/types/enums';","import type { ClientOptions, OsuApiRequestOptions, RequestOptions } from './types/interfaces';\nimport request from 'superagent';\nimport { UserManager } from './managers/UserManager'\nimport { BeatmapManager } from './managers/BeatmapManager';\nimport { ScoreManager } from './managers/ScoreManager';\nimport { ReplayManager } from './managers/ReplayManager';\nimport { MatchManager } from './managers/MatchManager';\n\nexport class Client {\n private apiKey: string;\n public users: UserManager;\n public beatmaps: BeatmapManager;\n public scores: ScoreManager;\n public replays: ReplayManager;\n public matches: MatchManager;\n constructor(options: ClientOptions) {\n this.apiKey = options.apiKey;\n this.users = new UserManager(this);\n this.beatmaps = new BeatmapManager(this);\n this.scores = new ScoreManager(this);\n this.replays = new ReplayManager(this);\n this.matches = new MatchManager(this);\n }\n\n public async request<T extends OsuApiRequestOptions>(options: RequestOptions<T>) {\n if (!options?.path) throw new Error('MISSING_PATH');\n const response = await request.get(`https://osu.ppy.sh/api/${options.path}`)\n .query({ k: this.apiKey })\n .query(options.queries);\n\n return response.body;\n }\n}","import type { APIGetUserBestRequestOptions, APIGetUserRecentRequestOptions, APIGetUserRequestOptions, FetchUserBannerOptions, GetUserBestRequestOptions, GetUserRecentRequestOptions, GetUserRequestOptions } from \"../types/interfaces\";\nimport type { APIUser, APIUserBestPerformanceScore, APIUserRecentPlayedScore } from \"../types/osuApiTypes\";\nimport request from 'superagent';\nimport { URLBuilder } from \"../utils/URLBuilder\";\nimport { BeatmapScore } from \"../structures/BeatmapScore\";\nimport { User } from \"../structures/User\";\nimport { BaseManager } from \"./BaseManager\";\n\nexport class UserManager extends BaseManager {\n public async getUser(options: GetUserRequestOptions) {\n const queries = {\n u: options.user,\n m: options.gameMode,\n type: options.type,\n event_days: options.eventDays\n }\n\n const res = await this.client.request<APIGetUserRequestOptions>({\n path: 'get_user',\n queries\n }) as Array<APIUser>;\n\n return res.map(v => new User(this.client, v));\n }\n\n public async fetchBanner({ id }: FetchUserBannerOptions) {\n const context = await request.get(`https://osu.ppy.sh/users/${id}`);\n const banner_regex = new RegExp(`https:\\\\\\\\\\\\/\\\\\\\\\\\\/assets\\\\.ppy\\\\.sh\\\\\\\\\\\\/user-profile-covers\\\\\\\\\\\\\\/${id}\\\\\\\\\\\\/(?<hash>[0-9a-z]*?)\\\\.(?<ext>.*?)&`, 'gm');\n const banner = banner_regex.exec(context.text);\n\n if (banner) {\n const url = URLBuilder.banner(id, banner?.groups?.hash!, banner?.groups?.ext!);\n return url;\n }\n const default_banner_regex = new RegExp('https:\\\\\\\\\\\\/\\\\\\\\\\\\/osu\\\\.ppy\\\\.sh\\\\\\\\\\\\/images\\\\\\\\\\\\/headers\\\\\\\\\\\\/profile-covers\\\\\\\\\\\\/c(?<id>\\\\d)\\\\.(?<ext>.*?)&', 'gm');\n const defaultBanner = default_banner_regex.exec(context.text);\n const url = URLBuilder.defaultBanner(defaultBanner?.groups?.id!, defaultBanner?.groups?.ext!);\n return url;\n }\n\n public async getUserBest(options: GetUserBestRequestOptions) {\n const queries = {\n u: options.user,\n m: options.mode,\n type: options.type,\n limit: options.limit\n }\n\n const res = await this.client.request<APIGetUserBestRequestOptions>({\n path: 'get_user_best',\n queries\n }) as Array<APIUserBestPerformanceScore>;\n\n return res.map(v => new BeatmapScore(this.client, v, { mode: options.mode }));\n }\n\n public async getUserRecent(options: GetUserRecentRequestOptions) {\n const queries = {\n u: options.user,\n m: options.mode,\n type: options.type,\n limit: options.limit\n }\n\n const res = await this.client.request<APIGetUserRecentRequestOptions>({\n path: 'get_user_recent',\n queries\n }) as Array<APIUserRecentPlayedScore>;\n\n return res.map(v => new BeatmapScore(this.client, v, { mode: options.mode }));\n }\n\n}","export enum GameMode {\n Standard, Taiko, Catch, Mania\n}\n\nexport enum UserRequestType {\n String = 'string', \n Id = 'id'\n}\n\nexport const Mods = {\n None :0n,\n NoFail :1n << 0n,\n Easy :1n << 1n,\n TouchDevice :1n << 2n,\n Hidden :1n << 3n,\n HardRock :1n << 4n,\n SuddenDeath :1n << 5n,\n DoubleTime :1n << 6n,\n Relax :1n << 7n,\n HalfTime :1n << 8n,\n Nightcore :1n << 9n,\n Flashlight :1n << 10n,\n Autoplay :1n << 11n,\n SpunOut :1n << 12n,\n AutoPilot :1n << 13n,\n Perfect :1n << 14n,\n Key4 :1n << 15n,\n Key5 :1n << 16n,\n Key6 :1n << 17n,\n Key7 :1n << 18n,\n Key8 :1n << 19n,\n FadeIn :1n << 20n,\n Random :1n << 21n,\n Cinema :1n << 22n,\n Target :1n << 23n,\n Key9 :1n << 24n,\n KeyCoop :1n << 25n,\n Key1 :1n << 26n,\n Key3 :1n << 27n,\n Key2 :1n << 28n,\n ScoreV2 :1n << 29n,\n Mirror :1n << 30n,\n}\n\nexport enum BeatmapApprovedState {\n Graveyard = -2,\n WIP,\n Pending,\n Ranked,\n Approved,\n Qualified,\n Loved\n}\n\nexport enum BeatmapGenre {\n Any, Unspecified, VideoGame, Anime, Rock, Pop, Other, Novelty,\n HipHop = 9, Electronic, Metal, Classic, Folk, Jazz\n}\n\nexport enum BeatmapLanguage {\n Any, Unspecified, English, Japanese, Chinese,\n Instrumental, Korean, French, German, Swedish,\n Spanish, Italian, Russian, Polish, Other\n}\n\nexport enum ScoreRank {\n XH, X, SH, S, A, B, C, D, F\n}\n\nexport enum MatchScoringType {\n Score, Accuracy, Combo, ScoreV2\n}\n\nexport enum MatchTeamType {\n HeadToHead, TagCoop, TeamVs, TagTeamVs\n}\n\nexport enum Team {\n None, Blue, Red\n}","import { GameMode } from \"../types/enums\";\n\nexport abstract class URLBuilder {\n private static gameModeToURLPattern(mode: GameMode) {\n switch(mode) {\n case GameMode.Standard: return 'osu';\n case GameMode.Taiko: return 'taiko';\n case GameMode.Catch: return 'fruits';\n case GameMode.Mania: return 'mania';\n default: throw new Error('INVALID_GAMEMODE');\n }\n }\n\n public static avatar(id: string) {\n return `https://a.ppy.sh/${id}`;\n }\n\n public static profile(idOrName: string) {\n return `https://osu.ppy.sh/users/${idOrName}`;\n }\n\n public static banner(userId: string, hash: string, ext: string) {\n return `https://assets.ppy.sh/user-profile-covers/${userId}/${hash}.${ext}`;\n }\n\n public static defaultBanner(id: string, ext: string) {\n return `https://osu.ppy.sh/images/headers/profile-covers/c${id}.${ext}`;\n }\n\n public static beatmapsetURL(beatmapsetId: string) {\n return `https://osu.ppy.sh/beatmapsets/${beatmapsetId}`;\n }\n\n public static beatmapURL(beatmapsetId: string, beatmapId: string, mode: GameMode) {\n const m = URLBuilder.gameModeToURLPattern(mode);\n return `https://osu.ppy.sh/beatmapsets/${beatmapsetId}#${m}/${beatmapId}`;\n }\n\n public static beatmapCoverImage(beatmapsetId: string) {\n return `https://assets.ppy.sh/beatmaps/${beatmapsetId}/covers/cover.jpg`;\n }\n\n public static beatmapCoverThumbnail(beatmapsetId: string) {\n return `https://b.ppy.sh/thumb/${beatmapsetId}l.jpg`;\n }\n\n public static scoreURL(mode: GameMode, scoreId: string) {\n const m = URLBuilder.gameModeToURLPattern(mode);\n return `https://osu.ppy.sh/scores/${m}/${scoreId}`;\n }\n}","import { Mods } from \"../types/enums\";\n\nexport type ModsResolvable = number | string | bigint | ModsBitField | Array<ModsResolvable>;\n\nexport class ModsBitField {\n static Flags = Mods;\n static KeyMod = \n Mods.Key1 | Mods.Key2 | Mods.Key3 | Mods.Key4 | Mods.Key5 |\n Mods.Key6 | Mods.Key7 | Mods.Key8 | Mods.Key9 | Mods.KeyCoop;\n static FreeModAllowed = \n Mods.NoFail | Mods.Easy | Mods.Hidden | Mods.HardRock | Mods.SuddenDeath | \n Mods.Flashlight | Mods.FadeIn | Mods.Relax | Mods.AutoPilot | Mods.SpunOut | \n ModsBitField.KeyMod;\n static ScoreIncreaseMods = \n Mods.Hidden | Mods.HardRock | Mods.DoubleTime | Mods.Flashlight | Mods.FadeIn;\n\n public bitfield: bigint;\n constructor(bits: ModsResolvable = 0n) {\n this.bitfield = ModsBitField.resolve(bits);\n }\n\n public any(bit: ModsResolvable) {\n return (this.bitfield & ModsBitField.resolve(bit)) !== 0n;\n }\n\n public equals(bit: ModsResolvable) {\n return this.bitfield === ModsBitField.resolve(bit);\n }\n\n public has(bit: ModsResolvable) {\n bit = ModsBitField.resolve(bit);\n return (this.bitfield & bit) === bit;\n }\n\n public add(...bits: Array<ModsResolvable>) {\n let total: bigint = 0n;\n for (const bit of bits) {\n total |= ModsBitField.resolve(bit);\n }\n this.bitfield |= total;\n\n return this;\n }\n\n public remove(...bits: ModsResolvable[]) {\n let total: bigint = 0n;\n for (const bit of bits) {\n total |= ModsBitField.resolve(bit);\n }\n this.bitfield &= ~total;\n\n return this;\n }\n\n public toArray() {\n return Object.keys(ModsBitField.Flags).filter(bit => this.has(bit));\n }\n\n public serialize() {\n const serialized: { [key: string]: boolean } = {};\n for (const [flag, bit] of Object.entries(ModsBitField.Flags)) {\n serialized[flag as keyof typeof ModsBitField.Flags] = this.has(bit);\n }\n return serialized;\n }\n\n public isNone() {\n return this.bitfield === 0n;\n }\n\n public valueOf() {\n return this.bitfield;\n }\n\n public static resolve(bit: ModsResolvable): bigint {\n if (Array.isArray(bit)) {\n return bit.map(ModsBitField.resolve).reduce((acc, now) => acc | now, 0n);\n }\n if (bit instanceof ModsBitField) {\n return bit.bitfield;\n }\n if (typeof bit === 'number') return BigInt(bit);\n if (typeof bit === 'string') {\n if (!isNaN(+bit)) return BigInt(bit);\n const a: bigint | undefined = ModsBitField.Flags[bit as keyof typeof ModsBitField.Flags];\n if (typeof a === 'undefined') throw new Error('INVALID_BITFIELD');\n return a;\n }\n return bit;\n }\n}","import type { BaseScore } from '../structures/BaseScore';\nimport { GameMode } from '../types/enums';\n\nexport abstract class AccuracyCalculator {\n\n\tpublic static standard(count300: number, count100: number, count50: number, countMiss: number) {\n\t\tconst max = count300 + count100 + count50 + countMiss;\n\t\tif (!max) return 0;\n\n\t\treturn (count300 * 300 + count100 * 100 + count50 * 50) / (max * 300);\n\t}\n\n\tpublic static taiko(count300: number, count100: number, countMiss: number) {\n\t\tconst max = count300 + count100 + countMiss;\n\t\tif (!max) return 0;\n\n\t\treturn (count300 + count100 * 0.5) / max;\n\t}\n\n\tpublic static catch(count300: number, count100: number, count50: number, countKatu: number, countMiss: number) {\n\t\tconst max = count300 + count100 + count50 + countKatu + countMiss;\n\t\tif (!max) return 0;\n\n\t\treturn (count300 + count100 + count50) / max\n\t}\n\n\tpublic static mania(count300: number, count100: number, count50: number, countKatu: number, countGeki: number, countMiss: number) {\n\t\tconst max = count300 + count100 + count50 + countKatu + countGeki + countMiss;\n\t\tif (!max) return 0;\n\n\t\treturn (300 * countGeki + 300 * count300 + 200 * countKatu + 100 * count100 + 50 * count50) / (max * 300);\n\t}\n\n\tpublic static maniaV2(count300: number, count100: number, count50: number, countKatu: number, countGeki: number, countMiss: number) {\n\t\tconst max = count300 + count100 + count50 + countKatu + countGeki + countMiss;\n\t\tif (!max) return 0;\n\n\t\treturn (305 * countGeki + 300 * count300 + 200 * countKatu + 100 * count100 + 50 * count50) / (max * 305);\n\t}\n\n\tpublic static calculate(score: BaseScore, v2: boolean = false) {\n\t\tconst { statistics } = score;\n\t\tswitch(score.mode) {\n\t\t\tcase GameMode.Standard:\n\t\t\t\treturn AccuracyCalculator.standard(\n\t\t\t\t\t\tstatistics.count300, \n\t\t\t\t\t\tstatistics.count100, \n\t\t\t\t\t\tstatistics.count50,\n\t\t\t\t\t\tstatistics.countMiss\n\t\t\t\t\t);\n\t\t\tcase GameMode.Taiko:\n\t\t\t\treturn AccuracyCalculator.taiko(\n\t\t\t\t\t\tstatistics.count300, \n\t\t\t\t\t\tstatistics.count100,\n\t\t\t\t\t\tstatistics.countMiss\n\t\t\t\t\t);\n\t\t\tcase GameMode.Catch:\n\t\t\t\treturn AccuracyCalculator.catch(\n\t\t\t\t\t\tstatistics.count300, \n\t\t\t\t\t\tstatistics.count100, \n\t\t\t\t\t\tstatistics.count50,\n\t\t\t\t\t\tstatistics.countKatu,\n\t\t\t\t\t\tstatistics.countMiss\n\t\t\t\t\t);\n\t\t\tcase GameMode.Mania:\n\t\t\t\treturn v2 ?\n\t\t\t\t\tAccuracyCalculator.maniaV2(\n\t\t\t\t\t\tstatistics.count300, \n\t\t\t\t\t\tstatistics.count100, \n\t\t\t\t\t\tstatistics.count50,\n\t\t\t\t\t\tstatistics.countKatu,\n\t\t\t\t\t\tstatistics.countGeki,\n\t\t\t\t\t\tstatistics.countMiss\n\t\t\t\t\t) : \n\t\t\t\t\tAccuracyCalculator.mania(\n\t\t\t\t\t\tstatistics.count300, \n\t\t\t\t\t\tstatistics.count100, \n\t\t\t\t\t\tstatistics.count50,\n\t\t\t\t\t\tstatistics.countKatu,\n\t\t\t\t\t\tstatistics.countGeki,\n\t\t\t\t\t\tstatistics.countMiss\n\t\t\t\t\t);\n\t\t}\n\t}\n}","import type { Client } from \"../Client\";\nimport type { APIBasicScore, APIBeatmapScore, APIMatchScore, APIUserBestPerformanceScore, APIUserRecentPlayedScore } from \"../types/osuApiTypes\";\nimport type { BeatmapScoreOtherInfo, GetUserRequestOptions, ScoreStatistics } from \"../types/interfaces\";\nimport type { User } from \"./User\";\nimport { GameMode, ScoreRank, UserRequestType } from \"../types/enums\";\nimport { ModsBitField } from \"./ModsBitField\";\nimport { AccuracyCalculator } from \"../utils/AccuracyCalculator\";\n\nexport type APIScore = \n APIBasicScore |\n APIUserRecentPlayedScore |\n APIUserBestPerformanceScore | \n APIBeatmapScore |\n APIMatchScore;\n\nexport abstract class BaseScore {\n public readonly client: Client;\n public readonly score: number;\n public readonly maxCombo: number;\n public readonly statistics: ScoreStatistics;\n public readonly perfect: boolean;\n public readonly enabledMods: ModsBitField;\n public readonly userId: string;\n public readonly rank: ScoreRank;\n public readonly mode: GameMode;\n public readonly beatmapId: string;\n public readonly accuracy: number;\n constructor(client: Client, data: APIScore, other: BeatmapScoreOtherInfo) {\n this.client = client;\n this.score = +data.score;\n this.maxCombo = +data.maxcombo;\n this.statistics = {\n count50: +data.count50,\n count100: +data.count100,\n count300: +data.count300,\n countMiss: +data.countmiss,\n countKatu: +data.countkatu,\n countGeki: +data.countgeki\n }\n this.perfect = !!+data.perfect;\n this.enabledMods = new ModsBitField(data.enabled_mods);\n this.userId = data.user_id;\n this.rank = ScoreRank[data.rank];\n this.mode = other.mode ?? GameMode.Standard;\n\n if ('beatmap_id' in data) {\n this.beatmapId = data.beatmap_id;\n } else {\n this.beatmapId = other.mapId!;\n }\n\n this.accuracy = AccuracyCalculator.calculate(this);\n }\n\n public async getPlayer(options: Omit<GetUserRequestOptions, \"user\" | \"type\"> = {}): Promise<User | undefined> {\n const candidates = await this.client.users.getUser({\n user: this.userId,\n type: UserRequestType.Id,\n ...options\n });\n\n return candidates[0];\n }\n\n public async getBeatmap() {\n const candidates = await this.client.beatmaps.getBeatmaps({\n beatmapId: this.beatmapId,\n mode: this.mode,\n });\n\n return candidates[0];\n }\n\n public getReplay() {\n return this.client.replays.getReplay({\n beatmapId: this.beatmapId,\n user: this.userId,\n type: UserRequestType.Id\n })\n }\n}","import type { Client } from \"../Client\";\nimport type { BeatmapScoreOtherInfo } from \"../types/interfaces\";\nimport type { APIBeatmapScore, APIUserBestPerformanceScore, APIUserRecentPlayedScore } from \"../types/osuApiTypes\";\nimport { URLBuilder } from \"../utils/URLBuilder\";\nimport { BaseScore } from \"./BaseScore\";\n\nexport class BeatmapScore extends BaseScore {\n public readonly date: Date;\n public readonly scoreId: string | null = null;\n public readonly username: string | null = null;\n public readonly pp: number | null = null;\n public readonly replayAvailable: boolean | null = null;\n\n constructor(client: Client, data: APIBeatmapScore, other: BeatmapScoreOtherInfo);\n constructor(client: Client, data: APIUserBestPerformanceScore, other: BeatmapScoreOtherInfo);\n constructor(client: Client, data: APIUserRecentPlayedScore, other: BeatmapScoreOtherInfo);\n\n constructor(\n client: Client, \n data: APIBeatmapScore | APIUserBestPerformanceScore | APIUserRecentPlayedScore, \n other: BeatmapScoreOtherInfo\n ) {\n super(client, data, other);\n\n this.date = new Date(data.date);\n \n if ('score_id' in data) {\n this.scoreId = data.score_id;\n }\n\n if ('username' in data) {\n this.username = data.username;\n }\n\n if ('pp' in data) {\n this.pp = +data.pp;\n }\n\n if ('replay_available' in data) {\n this.replayAvailable = !!+data.replay_available;\n }\n }\n\n public scoreURL() {\n if (!this.scoreId) return null;\n return URLBuilder.scoreURL(this.mode, this.scoreId);\n }\n\n}","import type { User } from './User';\nimport type { APIUserEvent } from \"../types/osuApiTypes\";\nimport type { Beatmap } from './Beatmap';\n\nexport class UserEvent {\n public readonly user: User;\n public readonly displayHtml: string;\n public readonly beatmapId: string;\n public readonly beatmapsetId: string;\n public readonly date: Date;\n public readonly epicfactor: number;\n constructor(user: User, data: APIUserEvent) {\n this.user = user;\n this.displayHtml = data.display_html;\n this.beatmapId = data.beatmap_id;\n this.beatmapsetId = data.beatmapset_id;\n this.date = new Date(data.date);\n this.epicfactor = +data.epicfactor;\n }\n\n public async getBeatmap(): Promise<Beatmap | undefined> {\n const candidates = await this.user.client.beatmaps.getBeatmaps({\n beatmapId: this.beatmapId,\n beatmapsetId: this.beatmapsetId,\n });\n\n return candidates[0];\n }\n\n public async getBeatmapset() {\n const beatmap = await this.getBeatmap();\n return beatmap?.getBeatmapset();\n }\n}","import type { UserScoreRankCount, GetUserBestRequestOptions, GetUserRecentRequestOptions } from \"../types/interfaces\";\nimport type { APIUser } from \"../types/osuApiTypes\";\nimport type { Client } from \"../Client\";\nimport { UserEvent } from \"./UserEvent\";\nimport { URLBuilder } from \"../utils/URLBuilder\";\nimport { UserRequestType } from \"../types/enums\";\n\nexport class User {\n public readonly client: Client;\n\n // User Data\n public readonly id: string;\n public readonly username: string;\n public readonly joinDate: Date;\n public readonly playcount: number;\n public readonly level: number;\n public readonly country: string;\n public readonly playtime: number;\n public readonly events: Array<UserEvent>;\n public banner: string | null;\n\n // User Score\n public readonly count300: number;\n public readonly count100: number;\n public readonly count50: number;\n public readonly rankedScore: number;\n public readonly totalScore: number;\n public readonly rank: number;\n public readonly countryRank: number;\n public readonly pp: number;\n public readonly accuracy: number;\n public readonly scoreRankCount: UserScoreRankCount;\n\n constructor(client: Client, data: APIUser) {\n this.client = client;\n this.id = data.user_id;\n this.username = data.username;\n this.joinDate = new Date(data.join_date);\n this.count300 = +data.count300;\n this.count100 = +data.count100;\n this.count50 = +data.count50;\n this.playcount = +data.playcount;\n this.playtime = +data.total_seconds_played;\n this.rankedScore = +data.ranked_score;\n this.totalScore = +data.total_score;\n this.rank = +data.pp_rank;\n this.level = +data.level;\n this.pp = +data.pp_raw;\n this.accuracy = +data.accuracy;\n this.scoreRankCount = {\n ss: +data.count_rank_ss,\n ssh: +data.count_rank_ssh,\n s: +data.count_rank_s,\n sh: +data.count_rank_sh,\n a: +data.count_rank_a\n };\n this.country = data.country;\n this.countryRank = +data.pp_country_rank;\n this.events = data.events.map(v => new UserEvent(this, v));\n\n this.banner = null;\n }\n\n public avatarURL() {\n return URLBuilder.avatar(this.id);\n }\n\n public profileURL() {\n return URLBuilder.profile(this.id);\n }\n\n public async fetchBanner(force: boolean = false) {\n if (!force && this.banner) return this.banner;\n const url = await this.client.users.fetchBanner({ id: this.id });\n return this.banner = url;\n }\n\n public getBest(options: Omit<GetUserBestRequestOptions, \"user\" | \"type\"> = {}) {\n return this.client.users.getUserBest({\n user: this.id,\n type: UserRequestType.Id,\n ...options\n });\n\n }\n\n public getRecent(options: Omit<GetUserRecentRequestOptions, \"user\" | \"type\"> = {}) {\n return this.client.users.getUserRecent({\n user: this.id,\n type: UserRequestType.Id,\n ...options\n });\n }\n}","import type { Client } from \"../Client\";\n\nexport abstract class BaseManager {\n public readonly client: Client;\n constructor(client: Client) {\n this.client = client;\n }\n}","export function toSqlDate(date: Date) {\n return date.toISOString().slice(0, 19).replace('T', ' ');\n}","import type { Client } from '../Client';\nimport type { BeatmapApprovedState, BeatmapGenre, BeatmapLanguage } from '../types/enums';\nimport type { Beatmap } from './Beatmap';\nimport type { User } from './User';\nimport { UserRequestType } from '../types/enums';\nimport { URLBuilder } from '../utils/URLBuilder';\n\nexport class Beatmapset {\n public readonly client: Client;\n public readonly beatmaps: Array<Beatmap>;\n public readonly id: string;\n public readonly approvedState: BeatmapApprovedState;\n public readonly length: number;\n public readonly submitDate: Date;\n public readonly approvedDate: Date | null;\n public readonly lastUpdate: Date;\n public readonly artist: string;\n public readonly title: string;\n public readonly creator: string;\n public readonly creatorId: string;\n public readonly source: string;\n public readonly tags: string[];\n public readonly genre: BeatmapGenre;\n public readonly language: BeatmapLanguage;\n public readonly favoriteCount: number;\n public readonly rating: number;\n public readonly downloadUnavailable: boolean;\n public readonly audioUnavailable: boolean;\n constructor(client: Client, data: Beatmap, maps: Array<Beatmap>) {\n this.client = client;\n this.beatmaps = maps;\n this.id = data.beatmapsetId;\n this.approvedState = data.approvedState;\n this.length = data.totalLength;\n this.submitDate = data.submitDate;\n this.approvedDate = data.approvedDate;\n this.lastUpdate = data.lastUpdate;\n this.artist = data.artist;\n this.title = data.title;\n this.creator = data.creator;\n this.creatorId = data.creatorId;\n this.source = data.source;\n this.tags = data.tags.slice();\n this.genre = data.genre;\n this.language = data.language;\n this.favoriteCount = data.favoriteCount;\n this.rating = data.rating;\n this.downloadUnavailable = data.downloadUnavailable;\n this.audioUnavailable = data.audioUnavailable;\n }\n\n public beatmapsetURL() {\n return URLBuilder.beatmapsetURL(this.id);\n }\n \n public coverImageURL() {\n return URLBuilder.beatmapCoverImage(this.id);\n }\n \n public coverThumbnailURL() {\n return URLBuilder.beatmapCoverThumbnail(this.id);\n }\n \n public async getCreator(): Promise<User | undefined> {\n const candidates = await this.client.users.getUser({\n user: this.creatorId,\n type: UserRequestType.Id\n });\n\n return candidates[0];\n }\n}","import type { Client } from \"../Client\";\nimport type { BeatmapDiffculty, BeatmapObjectCount } from \"../types/interfaces\";\nimport type { APIBeatmap } from \"../types/osuApiTypes\";\nimport type { User } from \"./User\";\nimport { BeatmapApprovedState, BeatmapGenre, BeatmapLanguage, GameMode, UserRequestType } from \"../types/enums\";\nimport { URLBuilder } from \"../utils/URLBuilder\";\nimport { Beatmapset } from \"./Beatmapset\";\n\nexport class Beatmap {\n public readonly id: string;\n public readonly beatmapsetId: string;\n public readonly approvedState: BeatmapApprovedState;\n public readonly totalLength: number;\n public readonly hitLength: number;\n public readonly diffcultyName: string;\n public readonly hash: string;\n public readonly difficulty: BeatmapDiffculty;\n public readonly mode: GameMode;\n public readonly objectCount: BeatmapObjectCount;\n public readonly submitDate: Date;\n public readonly approvedDate: Date | null;\n public readonly lastUpdate: Date;\n public readonly artist: string;\n public readonly title: string;\n public readonly creator: string;\n public readonly creatorId: string;\n public readonly bpm: number;\n public readonly source: string;\n public readonly tags: string[];\n public readonly genre: BeatmapGenre;\n public readonly language: BeatmapLanguage;\n public readonly favoriteCount: number;\n public readonly rating: number;\n public readonly downloadUnavailable: boolean;\n public readonly audioUnavailable: boolean;\n public readonly playcount: number;\n public readonly passcount: number;\n public readonly maxCombo: number | null;\n constructor(public readonly client: Client, data: APIBeatmap) {\n this.id = data.beatmap_id;\n this.beatmapsetId = data.beatmapset_id;\n this.approvedState = +data.approved;\n this.totalLength = +data.total_length;\n this.hitLength = +data.hit_length;\n this.diffcultyName = data.version;\n this.hash = data.file_md5;\n this.difficulty = {\n ApproachRate: +data.diff_approach,\n CircleSize: +data.diff_size,\n OverallDifficulty: +data.diff_overall,\n HPDrainRate: +data.diff_drain,\n aim: +(data.diff_aim ?? 0),\n speed: +(data.diff_speed ?? 0),\n rating: +(data.difficultyrating ?? 0)\n }\n this.mode = +data.mode;\n this.objectCount = {\n circle: +data.count_normal,\n slider: +data.count_slider,\n spinner: +data.count_spinner\n }\n this.submitDate = new Date(data.submit_date);\n if (!data.approved_date) {\n this.approvedDate = null;\n } else {\n this.approvedDate = new Date(data.approved_date);\n }\n this.lastUpdate = new Date(data.last_update);\n this.artist = data.artist;\n this.title = data.title;\n this.creator = data.creator;\n this.creatorId = data.creator_id;\n this.bpm = +data.bpm;\n this.source = data.source;\n this.tags = data.tags.split(' ');\n this.genre = +data.genre_id;\n this.language = +data.language_id;\n this.favoriteCount = +data.favourite_count;\n this.rating = +data.rating;\n this.downloadUnavailable = !!+data.download_unavailable;\n this.audioUnavailable = !!+data.audio_unavailable;\n this.playcount = +data.playcount;\n this.passcount = +data.passcount;\n if (data.max_combo) {\n this.maxCombo = +data.max_combo;\n } else {\n this.maxCombo = null;\n }\n }\n\n public beatmapsetURL() {\n return URLBuilder.beatmapsetURL(this.beatmapsetId);\n }\n\n public beatmapURL() {\n return URLBuilder.beatmapURL(this.beatmapsetId, this.id, this.mode);\n }\n \n public coverImageURL() {\n return URLBuilder.beatmapCoverImage(this.beatmapsetId);\n }\n \n public coverThumbnailURL() {\n return URLBuilder.beatmapCoverThumbnail(this.beatmapsetId);\n }\n \n public async getCreator(): Promise<User | undefined> {\n const candidates = await this.client.users.getUser({\n user: this.creatorId,\n type: UserRequestType.Id\n });\n\n return candidates[0];\n }\n\n public async getBeatmapset() {\n const set = await this.client.beatmaps.getBeatmaps({\n beatmapsetId: this.beatmapsetId\n });\n \n return new Beatmapset(this.client, this, set);\n }\n\n}","import type { APIGetBeatmapsRequestOptions, GetBeatmapsRequestOptions } from \"../types/interfaces\";\nimport type { APIBeatmap } from \"../types/osuApiTypes\";\nimport { toSqlDate } from '../utils/toSqlDate';\nimport { ModsBitField } from \"../structures/ModsBitField\";\nimport { Beatmap } from \"../structures/Beatmap\";\nimport { BaseManager } from \"./BaseManager\";\n\nexport class BeatmapManager extends BaseManager {\n public async getBeatmaps(options: GetBeatmapsRequestOptions = {}) {\n const queries = {\n since: options.since && toSqlDate(options.since),\n s: options.beatmapsetId,\n b: options.beatmapId,\n u: options.user,\n type: options.type,\n m: options.mode,\n a: options.showConverted,\n h: options.hash,\n limit: options.limit,\n mods: ModsBitField.resolve(options.mods ?? 0)\n }\n\n const res = await this.client.request<APIGetBeatmapsRequestOptions>({\n path: 'get_beatmaps',\n queries\n }) as Array<APIBeatmap>;\n\n return res.map(v => new Beatmap(this.client, v));\n }\n}","import type { APIGetScoresRequestOptions, GetScoreRequestOptions } from \"../types/interfaces\";\nimport type { APIBeatmapScore } from \"../types/osuApiTypes\";\nimport { ModsBitField } from \"../structures/ModsBitField\";\nimport { BeatmapScore } from \"../structures/BeatmapScore\";\nimport { BaseManager } from \"./BaseManager\";\n\nexport class ScoreManager extends BaseManager {\n public async getScores(options: GetScoreRequestOptions) {\n const mods = options.mods == undefined \n ? undefined : ModsBitField.resolve(options.mods);\n const queries = {\n b: options.beatmapId,\n u: options.user,\n m: options.mode,\n mods: mods,\n type: options.type,\n limit: options.limit\n }\n\n const res = await this.client.request<APIGetScoresRequestOptions>({\n path: 'get_scores',\n queries\n }) as Array<APIBeatmapScore>;\n\n return res.map(v => new BeatmapScore(this.client, v, { mapId: options.beatmapId, mode: options.mode }));\n }\n}","import type { Client } from \"../Client\";\nimport type { APIReplay } from \"../types/osuApiTypes\";\nimport { Buffer } from 'node:buffer'\n\nexport class Replay {\n public readonly client: Client;\n public readonly content: string;\n public readonly stream: Buffer;\n constructor(client: Client, data: APIReplay) {\n this.client = client;\n this.content = data.content;\n this.stream = Buffer.from(this.content, 'base64');\n }\n}","import type { APIGetReplayRequestOptions, GetReplayRequestOptions } from \"../types/interfaces\";\nimport type { APIReplay } from \"../types/osuApiTypes\";\nimport { ModsBitField } from \"../structures/ModsBitField\";\nimport { Replay } from \"../structures/Replay\";\nimport { BaseManager } from \"./BaseManager\";\n\nexport class ReplayManager extends BaseManager {\n public async getReplay(options: GetReplayRequestOptions) {\n if ((!options.beatmapId || !options.user) && !options.scoreId) {\n throw new Error('You should provide either beatmapId and user or scordId to get replay')\n }\n const mods = options.mods == undefined \n ? undefined : ModsBitField.resolve(options.mods);\n const queries = {\n b: options.beatmapId,\n u: options.user,\n m: options.mode,\n s: options.scoreId,\n type: options.type,\n mods: mods\n }\n\n const res = await this.client.request<APIGetReplayRequestOptions>({\n path: 'get_replay',\n queries\n }) as APIReplay;\n\n return new Replay(this.client, res);\n }\n}","import type { Client } from \"../Client\";\nimport type { Team } from \"../types/enums\";\nimport type { BeatmapScoreOtherInfo } from \"../types/interfaces\";\nimport type { APIMatchScore } from \"../types/osuApiTypes\";\nimport { BaseScore } from \"./BaseScore\";\n\nexport class MatchScore extends BaseScore {\n public readonly slot: number;\n public readonly team: Team;\n public readonly pass: boolean;\n constructor(client: Client, data: APIMatchScore, other: BeatmapScoreOtherInfo) {\n super(client, data, other);\n this.slot = +data.slot;\n this.team = +data.team;\n this.pass = !!+data.pass;\n }\n}","import type { Client } from \"../Client\";\nimport type { GameMode, MatchScoringType, Team } from \"../types/enums\";\nimport type { APIMatchGameData } from \"../types/osuApiTypes\";\nimport type { Beatmap } from \"./Beatmap\";\nimport type { Match } from \"./Match\";\nimport { MatchScore } from \"./MatchScore\";\nimport { ModsBitField } from \"./ModsBitField\";\n\nexport class MatchGame {\n public readonly client: Client;\n public readonly match: Match;\n public readonly id: string;\n public readonly startAt: Date;\n public readonly endAt: Date;\n public readonly beatmapId: string;\n public readonly mode: GameMode;\n public readonly matchType: number;\n public readonly scoringType: MatchScoringType;\n public readonly teamType: Team;\n public readonly mods: ModsBitField;\n public readonly scores: Array<MatchScore>;\n constructor(match: Match, data: APIMatchGameData) {\n this.client = match.client;\n this.match = match;\n this.id = data.game_id;\n this.startAt = new Date(data.start_time);\n this.endAt = new Date(data.end_time);\n this.beatmapId = data.beatmap_id;\n this.mode = +data.play_mode;\n this.matchType = +data.match_type;\n this.scoringType = +data.scoring_type;\n this.teamType = +data.team_type;\n this.mods = new ModsBitField(data.mods);\n this.scores = data.scores.map(score => new MatchScore(this.client, score, {\n mode: +data.play_mode,\n mapId: data.beatmap_id\n }));\n }\n\n public async getBeatmap(): Promise<Beatmap | undefined> {\n const candidates = await this.client.beatmaps.getBeatmaps({\n beatmapId: this.beatmapId\n });\n return candidates[0];\n }\n}","import type { APIMatch } from \"../types/osuApiTypes\";\nimport type { Client } from \"../Client\";\nimport { MatchGame } from \"./MatchGame\";\n\nexport class Match {\n public readonly client: Client;\n public readonly id: string;\n public readonly name: string;\n public readonly startAt: Date;\n public readonly endAt: Date | null;\n public readonly games: Array<MatchGame>\n constructor(client: Client, data: APIMatch) {\n this.client = client;\n\n const { match, games } = data;\n this.id = match.match_id;\n this.name = match.name;\n this.startAt = new Date(match.start_time);\n if (match.end_time) {\n this.endAt = new Date(match.end_time);\n } else {\n this.endAt = null;\n }\n\n this.games = games.map(data => new MatchGame(this, data));\n\n }\n}","import { BaseManager } from \"./BaseManager\";\nimport type { GetMatchRequestOptions } from \"../types/interfaces\";\nimport type { APIMatch, APIMatchNotFound } from \"../types/osuApiTypes\";\nimport { Match } from \"../structures/Match\";\n\nexport class MatchManager extends BaseManager {\n public async getMatch(options: GetMatchRequestOptions) {\n const queries = {\n mp: options.matchId\n }\n const res = await this.client.request({\n path: 'get_match',\n queries\n }) as APIMatch | APIMatchNotFound;\n\n if (res.match === 0) { return null; }\n return new Match(this.client, res);\n }\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,IAAAA,qBAAoB;;;ACCpB,wBAAoB;;;ACFb,IAAK,WAAL,kBAAKC,cAAL;AACH,EAAAA,oBAAA;AAAU,EAAAA,oBAAA;AAAO,EAAAA,oBAAA;AAAO,EAAAA,oBAAA;AADhB,SAAAA;AAAA,GAAA;AAIL,IAAK,kBAAL,kBAAKC,qBAAL;AACH,EAAAA,iBAAA,YAAS;AACT,EAAAA,iBAAA,QAAK;AAFG,SAAAA;AAAA,GAAA;AAKL,IAAM,OAAO;AAAA,EAChB,MAAgB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KAAK,OAAO,CAAC,EACxB,MAAM,QAAQ,OAAO;AAE1B,WAAO,SAAS;AAAA,EACpB;AACJ;","names":["import_superagent","GameMode","UserRequestType","BeatmapApprovedState","BeatmapGenre","BeatmapLanguage","ScoreRank","MatchScoringType","MatchTeamType","Team","request","url","data","request"]}
package/dist/index.mjs CHANGED
@@ -249,6 +249,82 @@ ModsBitField.KeyMod = Mods.Key1 | Mods.Key2 | Mods.Key3 | Mods.Key4 | Mods.Key5
249
249
  ModsBitField.FreeModAllowed = Mods.NoFail | Mods.Easy | Mods.Hidden | Mods.HardRock | Mods.SuddenDeath | Mods.Flashlight | Mods.FadeIn | Mods.Relax | Mods.AutoPilot | Mods.SpunOut | _ModsBitField.KeyMod;
250
250
  ModsBitField.ScoreIncreaseMods = Mods.Hidden | Mods.HardRock | Mods.DoubleTime | Mods.Flashlight | Mods.FadeIn;
251
251
 
252
+ // src/utils/AccuracyCalculator.ts
253
+ var AccuracyCalculator = class {
254
+ static standard(count300, count100, count50, countMiss) {
255
+ const max = count300 + count100 + count50 + countMiss;
256
+ if (!max)
257
+ return 0;
258
+ return (count300 * 300 + count100 * 100 + count50 * 50) / (max * 300);
259
+ }
260
+ static taiko(count300, count100, countMiss) {
261
+ const max = count300 + count100 + countMiss;
262
+ if (!max)
263
+ return 0;
264
+ return (count300 + count100 * 0.5) / max;
265
+ }
266
+ static catch(count300, count100, count50, countKatu, countMiss) {
267
+ const max = count300 + count100 + count50 + countKatu + countMiss;
268
+ if (!max)
269
+ return 0;
270
+ return (count300 + count100 + count50) / max;
271
+ }
272
+ static mania(count300, count100, count50, countKatu, countGeki, countMiss) {
273
+ const max = count300 + count100 + count50 + countKatu + countGeki + countMiss;
274
+ if (!max)
275
+ return 0;
276
+ return (300 * countGeki + 300 * count300 + 200 * countKatu + 100 * count100 + 50 * count50) / (max * 300);
277
+ }
278
+ static maniaV2(count300, count100, count50, countKatu, countGeki, countMiss) {
279
+ const max = count300 + count100 + count50 + countKatu + countGeki + countMiss;
280
+ if (!max)
281
+ return 0;
282
+ return (305 * countGeki + 300 * count300 + 200 * countKatu + 100 * count100 + 50 * count50) / (max * 305);
283
+ }
284
+ static calculate(score, v2 = false) {
285
+ const { statistics } = score;
286
+ switch (score.mode) {
287
+ case 0 /* Standard */:
288
+ return AccuracyCalculator.standard(
289
+ statistics.count300,
290
+ statistics.count100,
291
+ statistics.count50,
292
+ statistics.countMiss
293
+ );
294
+ case 1 /* Taiko */:
295
+ return AccuracyCalculator.taiko(
296
+ statistics.count300,
297
+ statistics.count100,
298
+ statistics.countMiss
299
+ );
300
+ case 2 /* Catch */:
301
+ return AccuracyCalculator.catch(
302
+ statistics.count300,
303
+ statistics.count100,
304
+ statistics.count50,
305
+ statistics.countKatu,
306
+ statistics.countMiss
307
+ );
308
+ case 3 /* Mania */:
309
+ return v2 ? AccuracyCalculator.maniaV2(
310
+ statistics.count300,
311
+ statistics.count100,
312
+ statistics.count50,
313
+ statistics.countKatu,
314
+ statistics.countGeki,
315
+ statistics.countMiss
316
+ ) : AccuracyCalculator.mania(
317
+ statistics.count300,
318
+ statistics.count100,
319
+ statistics.count50,
320
+ statistics.countKatu,
321
+ statistics.countGeki,
322
+ statistics.countMiss
323
+ );
324
+ }
325
+ }
326
+ };
327
+
252
328
  // src/structures/BaseScore.ts
253
329
  var BaseScore = class {
254
330
  constructor(client, data, other) {
@@ -273,6 +349,7 @@ var BaseScore = class {
273
349
  } else {
274
350
  this.beatmapId = other.mapId;
275
351
  }
352
+ this.accuracy = AccuracyCalculator.calculate(this);
276
353
  }
277
354
  async getPlayer(options = {}) {
278
355
  const candidates = await this.client.users.getUser({
@@ -764,6 +841,7 @@ var Client = class {
764
841
  }
765
842
  };
766
843
  export {
844
+ AccuracyCalculator,
767
845
  BaseManager,
768
846
  BaseScore,
769
847
  Beatmap,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Client.ts","../src/managers/UserManager.ts","../src/types/enums.ts","../src/utils/URLBuilder.ts","../src/structures/ModsBitField.ts","../src/structures/BaseScore.ts","../src/structures/BeatmapScore.ts","../src/structures/UserEvent.ts","../src/structures/User.ts","../src/managers/BaseManager.ts","../src/utils/toSqlDate.ts","../src/structures/Beatmapset.ts","../src/structures/Beatmap.ts","../src/managers/BeatmapManager.ts","../src/managers/ScoreManager.ts","../src/structures/Replay.ts","../src/managers/ReplayManager.ts","../src/structures/MatchScore.ts","../src/structures/MatchGame.ts","../src/structures/Match.ts","../src/managers/MatchManager.ts"],"sourcesContent":["import type { ClientOptions, OsuApiRequestOptions, RequestOptions } from './types/interfaces';\nimport request from 'superagent';\nimport { UserManager } from './managers/UserManager'\nimport { BeatmapManager } from './managers/BeatmapManager';\nimport { ScoreManager } from './managers/ScoreManager';\nimport { ReplayManager } from './managers/ReplayManager';\nimport { MatchManager } from './managers/MatchManager';\n\nexport class Client {\n private apiKey: string;\n public users: UserManager;\n public beatmaps: BeatmapManager;\n public scores: ScoreManager;\n public replays: ReplayManager;\n public matches: MatchManager;\n constructor(options: ClientOptions) {\n this.apiKey = options.apiKey;\n this.users = new UserManager(this);\n this.beatmaps = new BeatmapManager(this);\n this.scores = new ScoreManager(this);\n this.replays = new ReplayManager(this);\n this.matches = new MatchManager(this);\n }\n\n public async request<T extends OsuApiRequestOptions>(options: RequestOptions<T>) {\n if (!options?.path) throw new Error('MISSING_PATH');\n const response = await request.get(`https://osu.ppy.sh/api/${options.path}`)\n .query({ k: this.apiKey })\n .query(options.queries);\n\n return response.body;\n }\n}","import type { APIGetUserBestRequestOptions, APIGetUserRecentRequestOptions, APIGetUserRequestOptions, FetchUserBannerOptions, GetUserBestRequestOptions, GetUserRecentRequestOptions, GetUserRequestOptions } from \"../types/interfaces\";\nimport type { APIUser, APIUserBestPerformanceScore, APIUserRecentPlayedScore } from \"../types/osuApiTypes\";\nimport request from 'superagent';\nimport { URLBuilder } from \"../utils/URLBuilder\";\nimport { BeatmapScore } from \"../structures/BeatmapScore\";\nimport { User } from \"../structures/User\";\nimport { BaseManager } from \"./BaseManager\";\n\nexport class UserManager extends BaseManager {\n public async getUser(options: GetUserRequestOptions) {\n const queries = {\n u: options.user,\n m: options.gameMode,\n type: options.type,\n event_days: options.eventDays\n }\n\n const res = await this.client.request<APIGetUserRequestOptions>({\n path: 'get_user',\n queries\n }) as Array<APIUser>;\n\n return res.map(v => new User(this.client, v));\n }\n\n public async fetchBanner({ id }: FetchUserBannerOptions) {\n const context = await request.get(`https://osu.ppy.sh/users/${id}`);\n const banner_regex = new RegExp(`https:\\\\\\\\\\\\/\\\\\\\\\\\\/assets\\\\.ppy\\\\.sh\\\\\\\\\\\\/user-profile-covers\\\\\\\\\\\\\\/${id}\\\\\\\\\\\\/(?<hash>[0-9a-z]*?)\\\\.(?<ext>.*?)&`, 'gm');\n const banner = banner_regex.exec(context.text);\n\n if (banner) {\n const url = URLBuilder.banner(id, banner?.groups?.hash!, banner?.groups?.ext!);\n return url;\n }\n const default_banner_regex = new RegExp('https:\\\\\\\\\\\\/\\\\\\\\\\\\/osu\\\\.ppy\\\\.sh\\\\\\\\\\\\/images\\\\\\\\\\\\/headers\\\\\\\\\\\\/profile-covers\\\\\\\\\\\\/c(?<id>\\\\d)\\\\.(?<ext>.*?)&', 'gm');\n const defaultBanner = default_banner_regex.exec(context.text);\n const url = URLBuilder.defaultBanner(defaultBanner?.groups?.id!, defaultBanner?.groups?.ext!);\n return url;\n }\n\n public async getUserBest(options: GetUserBestRequestOptions) {\n const queries = {\n u: options.user,\n m: options.mode,\n type: options.type,\n limit: options.limit\n }\n\n const res = await this.client.request<APIGetUserBestRequestOptions>({\n path: 'get_user_best',\n queries\n }) as Array<APIUserBestPerformanceScore>;\n\n return res.map(v => new BeatmapScore(this.client, v, { mode: options.mode }));\n }\n\n public async getUserRecent(options: GetUserRecentRequestOptions) {\n const queries = {\n u: options.user,\n m: options.mode,\n type: options.type,\n limit: options.limit\n }\n\n const res = await this.client.request<APIGetUserRecentRequestOptions>({\n path: 'get_user_recent',\n queries\n }) as Array<APIUserRecentPlayedScore>;\n\n return res.map(v => new BeatmapScore(this.client, v, { mode: options.mode }));\n }\n\n}","export enum GameMode {\n Standard, Taiko, Catch, Mania\n}\n\nexport enum UserRequestType {\n String = 'string', \n Id = 'id'\n}\n\nexport const Mods = {\n None :0n,\n NoFail :1n << 0n,\n Easy :1n << 1n,\n TouchDevice :1n << 2n,\n Hidden :1n << 3n,\n HardRock :1n << 4n,\n SuddenDeath :1n << 5n,\n DoubleTime :1n << 6n,\n Relax :1n << 7n,\n HalfTime :1n << 8n,\n Nightcore :1n << 9n,\n Flashlight :1n << 10n,\n Autoplay :1n << 11n,\n SpunOut :1n << 12n,\n AutoPilot :1n << 13n,\n Perfect :1n << 14n,\n Key4 :1n << 15n,\n Key5 :1n << 16n,\n Key6 :1n << 17n,\n Key7 :1n << 18n,\n Key8 :1n << 19n,\n FadeIn :1n << 20n,\n Random :1n << 21n,\n Cinema :1n << 22n,\n Target :1n << 23n,\n Key9 :1n << 24n,\n KeyCoop :1n << 25n,\n Key1 :1n << 26n,\n Key3 :1n << 27n,\n Key2 :1n << 28n,\n ScoreV2 :1n << 29n,\n Mirror :1n << 30n,\n}\n\nexport enum BeatmapApprovedState {\n Graveyard = -2,\n WIP,\n Pending,\n Ranked,\n Approved,\n Qualified,\n Loved\n}\n\nexport enum BeatmapGenre {\n Any, Unspecified, VideoGame, Anime, Rock, Pop, Other, Novelty,\n HipHop = 9, Electronic, Metal, Classic, Folk, Jazz\n}\n\nexport enum BeatmapLanguage {\n Any, Unspecified, English, Japanese, Chinese,\n Instrumental, Korean, French, German, Swedish,\n Spanish, Italian, Russian, Polish, Other\n}\n\nexport enum ScoreRank {\n XH, X, SH, S, A, B, C, D, F\n}\n\nexport enum MatchScoringType {\n Score, Accuracy, Combo, ScoreV2\n}\n\nexport enum MatchTeamType {\n HeadToHead, TagCoop, TeamVs, TagTeamVs\n}\n\nexport enum Team {\n None, Blue, Red\n}","import { GameMode } from \"../types/enums\";\n\nexport abstract class URLBuilder {\n private static gameModeToURLPattern(mode: GameMode) {\n switch(mode) {\n case GameMode.Standard: return 'osu';\n case GameMode.Taiko: return 'taiko';\n case GameMode.Catch: return 'fruits';\n case GameMode.Mania: return 'mania';\n default: throw new Error('INVALID_GAMEMODE');\n }\n }\n\n public static avatar(id: string) {\n return `https://a.ppy.sh/${id}`;\n }\n\n public static profile(idOrName: string) {\n return `https://osu.ppy.sh/users/${idOrName}`;\n }\n\n public static banner(userId: string, hash: string, ext: string) {\n return `https://assets.ppy.sh/user-profile-covers/${userId}/${hash}.${ext}`;\n }\n\n public static defaultBanner(id: string, ext: string) {\n return `https://osu.ppy.sh/images/headers/profile-covers/c${id}.${ext}`;\n }\n\n public static beatmapsetURL(beatmapsetId: string) {\n return `https://osu.ppy.sh/beatmapsets/${beatmapsetId}`;\n }\n\n public static beatmapURL(beatmapsetId: string, beatmapId: string, mode: GameMode) {\n const m = URLBuilder.gameModeToURLPattern(mode);\n return `https://osu.ppy.sh/beatmapsets/${beatmapsetId}#${m}/${beatmapId}`;\n }\n\n public static beatmapCoverImage(beatmapsetId: string) {\n return `https://assets.ppy.sh/beatmaps/${beatmapsetId}/covers/cover.jpg`;\n }\n\n public static beatmapCoverThumbnail(beatmapsetId: string) {\n return `https://b.ppy.sh/thumb/${beatmapsetId}l.jpg`;\n }\n\n public static scoreURL(mode: GameMode, scoreId: string) {\n const m = URLBuilder.gameModeToURLPattern(mode);\n return `https://osu.ppy.sh/scores/${m}/${scoreId}`;\n }\n}","import { Mods } from \"../types/enums\";\n\nexport type ModsResolvable = number | string | bigint | ModsBitField | Array<ModsResolvable>;\n\nexport class ModsBitField {\n static Flags = Mods;\n static KeyMod = \n Mods.Key1 | Mods.Key2 | Mods.Key3 | Mods.Key4 | Mods.Key5 |\n Mods.Key6 | Mods.Key7 | Mods.Key8 | Mods.Key9 | Mods.KeyCoop;\n static FreeModAllowed = \n Mods.NoFail | Mods.Easy | Mods.Hidden | Mods.HardRock | Mods.SuddenDeath | \n Mods.Flashlight | Mods.FadeIn | Mods.Relax | Mods.AutoPilot | Mods.SpunOut | \n ModsBitField.KeyMod;\n static ScoreIncreaseMods = \n Mods.Hidden | Mods.HardRock | Mods.DoubleTime | Mods.Flashlight | Mods.FadeIn;\n\n public bitfield: bigint;\n constructor(bits: ModsResolvable = 0n) {\n this.bitfield = ModsBitField.resolve(bits);\n }\n\n public any(bit: ModsResolvable) {\n return (this.bitfield & ModsBitField.resolve(bit)) !== 0n;\n }\n\n public equals(bit: ModsResolvable) {\n return this.bitfield === ModsBitField.resolve(bit);\n }\n\n public has(bit: ModsResolvable) {\n bit = ModsBitField.resolve(bit);\n return (this.bitfield & bit) === bit;\n }\n\n public add(...bits: Array<ModsResolvable>) {\n let total: bigint = 0n;\n for (const bit of bits) {\n total |= ModsBitField.resolve(bit);\n }\n this.bitfield |= total;\n\n return this;\n }\n\n public remove(...bits: ModsResolvable[]) {\n let total: bigint = 0n;\n for (const bit of bits) {\n total |= ModsBitField.resolve(bit);\n }\n this.bitfield &= ~total;\n\n return this;\n }\n\n public toArray() {\n return Object.keys(ModsBitField.Flags).filter(bit => this.has(bit));\n }\n\n public serialize() {\n const serialized: { [key: string]: boolean } = {};\n for (const [flag, bit] of Object.entries(ModsBitField.Flags)) {\n serialized[flag as keyof typeof ModsBitField.Flags] = this.has(bit);\n }\n return serialized;\n }\n\n public isNone() {\n return this.bitfield === 0n;\n }\n\n public valueOf() {\n return this.bitfield;\n }\n\n public static resolve(bit: ModsResolvable): bigint {\n if (Array.isArray(bit)) {\n return bit.map(ModsBitField.resolve).reduce((acc, now) => acc | now, 0n);\n }\n if (bit instanceof ModsBitField) {\n return bit.bitfield;\n }\n if (typeof bit === 'number') return BigInt(bit);\n if (typeof bit === 'string') {\n if (!isNaN(+bit)) return BigInt(bit);\n const a: bigint | undefined = ModsBitField.Flags[bit as keyof typeof ModsBitField.Flags];\n if (typeof a === 'undefined') throw new Error('INVALID_BITFIELD');\n return a;\n }\n return bit;\n }\n}","import type { Client } from \"../Client\";\nimport type { APIBasicScore, APIBeatmapScore, APIMatchScore, APIUserBestPerformanceScore, APIUserRecentPlayedScore } from \"../types/osuApiTypes\";\nimport type { BeatmapScoreOtherInfo, GetUserRequestOptions, ScoreStatistics } from \"../types/interfaces\";\nimport type { User } from \"./User\";\nimport { GameMode, ScoreRank, UserRequestType } from \"../types/enums\";\nimport { ModsBitField } from \"./ModsBitField\";\n\nexport type APIScore = \n APIBasicScore |\n APIUserRecentPlayedScore |\n APIUserBestPerformanceScore | \n APIBeatmapScore |\n APIMatchScore;\n\nexport abstract class BaseScore {\n public readonly client: Client;\n public readonly score: number;\n public readonly maxCombo: number;\n public readonly statistics: ScoreStatistics;\n public readonly perfect: boolean;\n public readonly enabledMods: ModsBitField;\n public readonly userId: string;\n public readonly rank: ScoreRank;\n public readonly mode: GameMode;\n public readonly beatmapId: string;\n constructor(client: Client, data: APIScore, other: BeatmapScoreOtherInfo) {\n this.client = client;\n this.score = +data.score;\n this.maxCombo = +data.maxcombo;\n this.statistics = {\n count50: +data.count50,\n count100: +data.count100,\n count300: +data.count300,\n countMiss: +data.countmiss,\n countKatu: +data.countkatu,\n countGeki: +data.countgeki\n }\n this.perfect = !!+data.perfect;\n this.enabledMods = new ModsBitField(data.enabled_mods);\n this.userId = data.user_id;\n this.rank = ScoreRank[data.rank];\n this.mode = other.mode ?? GameMode.Standard;\n\n if ('beatmap_id' in data) {\n this.beatmapId = data.beatmap_id;\n } else {\n this.beatmapId = other.mapId!;\n }\n }\n\n public async getPlayer(options: Omit<GetUserRequestOptions, \"user\" | \"type\"> = {}): Promise<User | undefined> {\n const candidates = await this.client.users.getUser({\n user: this.userId,\n type: UserRequestType.Id,\n ...options\n });\n\n return candidates[0];\n }\n\n public async getBeatmap() {\n const candidates = await this.client.beatmaps.getBeatmaps({\n beatmapId: this.beatmapId,\n mode: this.mode,\n });\n\n return candidates[0];\n }\n\n public getReplay() {\n return this.client.replays.getReplay({\n beatmapId: this.beatmapId,\n user: this.userId,\n type: UserRequestType.Id\n })\n }\n}","import type { Client } from \"../Client\";\nimport type { BeatmapScoreOtherInfo } from \"../types/interfaces\";\nimport type { APIBeatmapScore, APIUserBestPerformanceScore, APIUserRecentPlayedScore } from \"../types/osuApiTypes\";\nimport { URLBuilder } from \"../utils/URLBuilder\";\nimport { BaseScore } from \"./BaseScore\";\n\nexport class BeatmapScore extends BaseScore {\n public readonly date: Date;\n public readonly scoreId: string | null = null;\n public readonly username: string | null = null;\n public readonly pp: number | null = null;\n public readonly replayAvailable: boolean | null = null;\n\n constructor(client: Client, data: APIBeatmapScore, other: BeatmapScoreOtherInfo);\n constructor(client: Client, data: APIUserBestPerformanceScore, other: BeatmapScoreOtherInfo);\n constructor(client: Client, data: APIUserRecentPlayedScore, other: BeatmapScoreOtherInfo);\n\n constructor(\n client: Client, \n data: APIBeatmapScore | APIUserBestPerformanceScore | APIUserRecentPlayedScore, \n other: BeatmapScoreOtherInfo\n ) {\n super(client, data, other);\n\n this.date = new Date(data.date);\n \n if ('score_id' in data) {\n this.scoreId = data.score_id;\n }\n\n if ('username' in data) {\n this.username = data.username;\n }\n\n if ('pp' in data) {\n this.pp = +data.pp;\n }\n\n if ('replay_available' in data) {\n this.replayAvailable = !!+data.replay_available;\n }\n }\n\n public scoreURL() {\n if (!this.scoreId) return null;\n return URLBuilder.scoreURL(this.mode, this.scoreId);\n }\n\n}","import type { User } from './User';\nimport type { APIUserEvent } from \"../types/osuApiTypes\";\nimport type { Beatmap } from './Beatmap';\n\nexport class UserEvent {\n public readonly user: User;\n public readonly displayHtml: string;\n public readonly beatmapId: string;\n public readonly beatmapsetId: string;\n public readonly date: Date;\n public readonly epicfactor: number;\n constructor(user: User, data: APIUserEvent) {\n this.user = user;\n this.displayHtml = data.display_html;\n this.beatmapId = data.beatmap_id;\n this.beatmapsetId = data.beatmapset_id;\n this.date = new Date(data.date);\n this.epicfactor = +data.epicfactor;\n }\n\n public async getBeatmap(): Promise<Beatmap | undefined> {\n const candidates = await this.user.client.beatmaps.getBeatmaps({\n beatmapId: this.beatmapId,\n beatmapsetId: this.beatmapsetId,\n });\n\n return candidates[0];\n }\n\n public async getBeatmapset() {\n const beatmap = await this.getBeatmap();\n return beatmap?.getBeatmapset();\n }\n}","import type { UserScoreRankCount, GetUserBestRequestOptions, GetUserRecentRequestOptions } from \"../types/interfaces\";\nimport type { APIUser } from \"../types/osuApiTypes\";\nimport type { Client } from \"../Client\";\nimport { UserEvent } from \"./UserEvent\";\nimport { URLBuilder } from \"../utils/URLBuilder\";\nimport { UserRequestType } from \"../types/enums\";\n\nexport class User {\n public readonly client: Client;\n\n // User Data\n public readonly id: string;\n public readonly username: string;\n public readonly joinDate: Date;\n public readonly playcount: number;\n public readonly level: number;\n public readonly country: string;\n public readonly playtime: number;\n public readonly events: Array<UserEvent>;\n public banner: string | null;\n\n // User Score\n public readonly count300: number;\n public readonly count100: number;\n public readonly count50: number;\n public readonly rankedScore: number;\n public readonly totalScore: number;\n public readonly rank: number;\n public readonly countryRank: number;\n public readonly pp: number;\n public readonly accuracy: number;\n public readonly scoreRankCount: UserScoreRankCount;\n\n constructor(client: Client, data: APIUser) {\n this.client = client;\n this.id = data.user_id;\n this.username = data.username;\n this.joinDate = new Date(data.join_date);\n this.count300 = +data.count300;\n this.count100 = +data.count100;\n this.count50 = +data.count50;\n this.playcount = +data.playcount;\n this.playtime = +data.total_seconds_played;\n this.rankedScore = +data.ranked_score;\n this.totalScore = +data.total_score;\n this.rank = +data.pp_rank;\n this.level = +data.level;\n this.pp = +data.pp_raw;\n this.accuracy = +data.accuracy;\n this.scoreRankCount = {\n ss: +data.count_rank_ss,\n ssh: +data.count_rank_ssh,\n s: +data.count_rank_s,\n sh: +data.count_rank_sh,\n a: +data.count_rank_a\n };\n this.country = data.country;\n this.countryRank = +data.pp_country_rank;\n this.events = data.events.map(v => new UserEvent(this, v));\n\n this.banner = null;\n }\n\n public avatarURL() {\n return URLBuilder.avatar(this.id);\n }\n\n public profileURL() {\n return URLBuilder.profile(this.id);\n }\n\n public async fetchBanner(force: boolean = false) {\n if (!force && this.banner) return this.banner;\n const url = await this.client.users.fetchBanner({ id: this.id });\n return this.banner = url;\n }\n\n public getBest(options: Omit<GetUserBestRequestOptions, \"user\" | \"type\"> = {}) {\n return this.client.users.getUserBest({\n user: this.id,\n type: UserRequestType.Id,\n ...options\n });\n\n }\n\n public getRecent(options: Omit<GetUserRecentRequestOptions, \"user\" | \"type\"> = {}) {\n return this.client.users.getUserRecent({\n user: this.id,\n type: UserRequestType.Id,\n ...options\n });\n }\n}","import type { Client } from \"../Client\";\n\nexport abstract class BaseManager {\n public readonly client: Client;\n constructor(client: Client) {\n this.client = client;\n }\n}","export function toSqlDate(date: Date) {\n return date.toISOString().slice(0, 19).replace('T', ' ');\n}","import type { Client } from '../Client';\nimport type { BeatmapApprovedState, BeatmapGenre, BeatmapLanguage } from '../types/enums';\nimport type { Beatmap } from './Beatmap';\nimport type { User } from './User';\nimport { UserRequestType } from '../types/enums';\nimport { URLBuilder } from '../utils/URLBuilder';\n\nexport class Beatmapset {\n public readonly client: Client;\n public readonly beatmaps: Array<Beatmap>;\n public readonly id: string;\n public readonly approvedState: BeatmapApprovedState;\n public readonly length: number;\n public readonly submitDate: Date;\n public readonly approvedDate: Date | null;\n public readonly lastUpdate: Date;\n public readonly artist: string;\n public readonly title: string;\n public readonly creator: string;\n public readonly creatorId: string;\n public readonly source: string;\n public readonly tags: string[];\n public readonly genre: BeatmapGenre;\n public readonly language: BeatmapLanguage;\n public readonly favoriteCount: number;\n public readonly rating: number;\n public readonly downloadUnavailable: boolean;\n public readonly audioUnavailable: boolean;\n constructor(client: Client, data: Beatmap, maps: Array<Beatmap>) {\n this.client = client;\n this.beatmaps = maps;\n this.id = data.beatmapsetId;\n this.approvedState = data.approvedState;\n this.length = data.totalLength;\n this.submitDate = data.submitDate;\n this.approvedDate = data.approvedDate;\n this.lastUpdate = data.lastUpdate;\n this.artist = data.artist;\n this.title = data.title;\n this.creator = data.creator;\n this.creatorId = data.creatorId;\n this.source = data.source;\n this.tags = data.tags.slice();\n this.genre = data.genre;\n this.language = data.language;\n this.favoriteCount = data.favoriteCount;\n this.rating = data.rating;\n this.downloadUnavailable = data.downloadUnavailable;\n this.audioUnavailable = data.audioUnavailable;\n }\n\n public beatmapsetURL() {\n return URLBuilder.beatmapsetURL(this.id);\n }\n \n public coverImageURL() {\n return URLBuilder.beatmapCoverImage(this.id);\n }\n \n public coverThumbnailURL() {\n return URLBuilder.beatmapCoverThumbnail(this.id);\n }\n \n public async getCreator(): Promise<User | undefined> {\n const candidates = await this.client.users.getUser({\n user: this.creatorId,\n type: UserRequestType.Id\n });\n\n return candidates[0];\n }\n}","import type { Client } from \"../Client\";\nimport type { BeatmapDiffculty, BeatmapObjectCount } from \"../types/interfaces\";\nimport type { APIBeatmap } from \"../types/osuApiTypes\";\nimport type { User } from \"./User\";\nimport { BeatmapApprovedState, BeatmapGenre, BeatmapLanguage, GameMode, UserRequestType } from \"../types/enums\";\nimport { URLBuilder } from \"../utils/URLBuilder\";\nimport { Beatmapset } from \"./Beatmapset\";\n\nexport class Beatmap {\n public readonly id: string;\n public readonly beatmapsetId: string;\n public readonly approvedState: BeatmapApprovedState;\n public readonly totalLength: number;\n public readonly hitLength: number;\n public readonly diffcultyName: string;\n public readonly hash: string;\n public readonly difficulty: BeatmapDiffculty;\n public readonly mode: GameMode;\n public readonly objectCount: BeatmapObjectCount;\n public readonly submitDate: Date;\n public readonly approvedDate: Date | null;\n public readonly lastUpdate: Date;\n public readonly artist: string;\n public readonly title: string;\n public readonly creator: string;\n public readonly creatorId: string;\n public readonly bpm: number;\n public readonly source: string;\n public readonly tags: string[];\n public readonly genre: BeatmapGenre;\n public readonly language: BeatmapLanguage;\n public readonly favoriteCount: number;\n public readonly rating: number;\n public readonly downloadUnavailable: boolean;\n public readonly audioUnavailable: boolean;\n public readonly playcount: number;\n public readonly passcount: number;\n public readonly maxCombo: number | null;\n constructor(public readonly client: Client, data: APIBeatmap) {\n this.id = data.beatmap_id;\n this.beatmapsetId = data.beatmapset_id;\n this.approvedState = +data.approved;\n this.totalLength = +data.total_length;\n this.hitLength = +data.hit_length;\n this.diffcultyName = data.version;\n this.hash = data.file_md5;\n this.difficulty = {\n ApproachRate: +data.diff_approach,\n CircleSize: +data.diff_size,\n OverallDifficulty: +data.diff_overall,\n HPDrainRate: +data.diff_drain,\n aim: +(data.diff_aim ?? 0),\n speed: +(data.diff_speed ?? 0),\n rating: +(data.difficultyrating ?? 0)\n }\n this.mode = +data.mode;\n this.objectCount = {\n circle: +data.count_normal,\n slider: +data.count_slider,\n spinner: +data.count_spinner\n }\n this.submitDate = new Date(data.submit_date);\n if (!data.approved_date) {\n this.approvedDate = null;\n } else {\n this.approvedDate = new Date(data.approved_date);\n }\n this.lastUpdate = new Date(data.last_update);\n this.artist = data.artist;\n this.title = data.title;\n this.creator = data.creator;\n this.creatorId = data.creator_id;\n this.bpm = +data.bpm;\n this.source = data.source;\n this.tags = data.tags.split(' ');\n this.genre = +data.genre_id;\n this.language = +data.language_id;\n this.favoriteCount = +data.favourite_count;\n this.rating = +data.rating;\n this.downloadUnavailable = !!+data.download_unavailable;\n this.audioUnavailable = !!+data.audio_unavailable;\n this.playcount = +data.playcount;\n this.passcount = +data.passcount;\n if (data.max_combo) {\n this.maxCombo = +data.max_combo;\n } else {\n this.maxCombo = null;\n }\n }\n\n public beatmapsetURL() {\n return URLBuilder.beatmapsetURL(this.beatmapsetId);\n }\n\n public beatmapURL() {\n return URLBuilder.beatmapURL(this.beatmapsetId, this.id, this.mode);\n }\n \n public coverImageURL() {\n return URLBuilder.beatmapCoverImage(this.beatmapsetId);\n }\n \n public coverThumbnailURL() {\n return URLBuilder.beatmapCoverThumbnail(this.beatmapsetId);\n }\n \n public async getCreator(): Promise<User | undefined> {\n const candidates = await this.client.users.getUser({\n user: this.creatorId,\n type: UserRequestType.Id\n });\n\n return candidates[0];\n }\n\n public async getBeatmapset() {\n const set = await this.client.beatmaps.getBeatmaps({\n beatmapsetId: this.beatmapsetId\n });\n \n return new Beatmapset(this.client, this, set);\n }\n\n}","import type { APIGetBeatmapsRequestOptions, GetBeatmapsRequestOptions } from \"../types/interfaces\";\nimport type { APIBeatmap } from \"../types/osuApiTypes\";\nimport { toSqlDate } from '../utils/toSqlDate';\nimport { ModsBitField } from \"../structures/ModsBitField\";\nimport { Beatmap } from \"../structures/Beatmap\";\nimport { BaseManager } from \"./BaseManager\";\n\nexport class BeatmapManager extends BaseManager {\n public async getBeatmaps(options: GetBeatmapsRequestOptions = {}) {\n const queries = {\n since: options.since && toSqlDate(options.since),\n s: options.beatmapsetId,\n b: options.beatmapId,\n u: options.user,\n type: options.type,\n m: options.mode,\n a: options.showConverted,\n h: options.hash,\n limit: options.limit,\n mods: ModsBitField.resolve(options.mods ?? 0)\n }\n\n const res = await this.client.request<APIGetBeatmapsRequestOptions>({\n path: 'get_beatmaps',\n queries\n }) as Array<APIBeatmap>;\n\n return res.map(v => new Beatmap(this.client, v));\n }\n}","import type { APIGetScoresRequestOptions, GetScoreRequestOptions } from \"../types/interfaces\";\nimport type { APIBeatmapScore } from \"../types/osuApiTypes\";\nimport { ModsBitField } from \"../structures/ModsBitField\";\nimport { BeatmapScore } from \"../structures/BeatmapScore\";\nimport { BaseManager } from \"./BaseManager\";\n\nexport class ScoreManager extends BaseManager {\n public async getScores(options: GetScoreRequestOptions) {\n const mods = options.mods == undefined \n ? undefined : ModsBitField.resolve(options.mods);\n const queries = {\n b: options.beatmapId,\n u: options.user,\n m: options.mode,\n mods: mods,\n type: options.type,\n limit: options.limit\n }\n\n const res = await this.client.request<APIGetScoresRequestOptions>({\n path: 'get_scores',\n queries\n }) as Array<APIBeatmapScore>;\n\n return res.map(v => new BeatmapScore(this.client, v, { mapId: options.beatmapId, mode: options.mode }));\n }\n}","import type { Client } from \"../Client\";\nimport type { APIReplay } from \"../types/osuApiTypes\";\nimport { Buffer } from 'node:buffer'\n\nexport class Replay {\n public readonly client: Client;\n public readonly content: string;\n public readonly stream: Buffer;\n constructor(client: Client, data: APIReplay) {\n this.client = client;\n this.content = data.content;\n this.stream = Buffer.from(this.content, 'base64');\n }\n}","import type { APIGetReplayRequestOptions, GetReplayRequestOptions } from \"../types/interfaces\";\nimport type { APIReplay } from \"../types/osuApiTypes\";\nimport { ModsBitField } from \"../structures/ModsBitField\";\nimport { Replay } from \"../structures/Replay\";\nimport { BaseManager } from \"./BaseManager\";\n\nexport class ReplayManager extends BaseManager {\n public async getReplay(options: GetReplayRequestOptions) {\n if ((!options.beatmapId || !options.user) && !options.scoreId) {\n throw new Error('You should provide either beatmapId and user or scordId to get replay')\n }\n const mods = options.mods == undefined \n ? undefined : ModsBitField.resolve(options.mods);\n const queries = {\n b: options.beatmapId,\n u: options.user,\n m: options.mode,\n s: options.scoreId,\n type: options.type,\n mods: mods\n }\n\n const res = await this.client.request<APIGetReplayRequestOptions>({\n path: 'get_replay',\n queries\n }) as APIReplay;\n\n return new Replay(this.client, res);\n }\n}","import type { Client } from \"../Client\";\nimport type { Team } from \"../types/enums\";\nimport type { BeatmapScoreOtherInfo } from \"../types/interfaces\";\nimport type { APIMatchScore } from \"../types/osuApiTypes\";\nimport { BaseScore } from \"./BaseScore\";\n\nexport class MatchScore extends BaseScore {\n public readonly slot: number;\n public readonly team: Team;\n public readonly pass: boolean;\n constructor(client: Client, data: APIMatchScore, other: BeatmapScoreOtherInfo) {\n super(client, data, other);\n this.slot = +data.slot;\n this.team = +data.team;\n this.pass = !!+data.pass;\n }\n}","import type { Client } from \"../Client\";\nimport type { GameMode, MatchScoringType, Team } from \"../types/enums\";\nimport type { APIMatchGameData } from \"../types/osuApiTypes\";\nimport type { Beatmap } from \"./Beatmap\";\nimport type { Match } from \"./Match\";\nimport { MatchScore } from \"./MatchScore\";\nimport { ModsBitField } from \"./ModsBitField\";\n\nexport class MatchGame {\n public readonly client: Client;\n public readonly match: Match;\n public readonly id: string;\n public readonly startAt: Date;\n public readonly endAt: Date;\n public readonly beatmapId: string;\n public readonly mode: GameMode;\n public readonly matchType: number;\n public readonly scoringType: MatchScoringType;\n public readonly teamType: Team;\n public readonly mods: ModsBitField;\n public readonly scores: Array<MatchScore>;\n constructor(match: Match, data: APIMatchGameData) {\n this.client = match.client;\n this.match = match;\n this.id = data.game_id;\n this.startAt = new Date(data.start_time);\n this.endAt = new Date(data.end_time);\n this.beatmapId = data.beatmap_id;\n this.mode = +data.play_mode;\n this.matchType = +data.match_type;\n this.scoringType = +data.scoring_type;\n this.teamType = +data.team_type;\n this.mods = new ModsBitField(data.mods);\n this.scores = data.scores.map(score => new MatchScore(this.client, score, {\n mode: +data.play_mode,\n mapId: data.beatmap_id\n }));\n }\n\n public async getBeatmap(): Promise<Beatmap | undefined> {\n const candidates = await this.client.beatmaps.getBeatmaps({\n beatmapId: this.beatmapId\n });\n return candidates[0];\n }\n}","import type { APIMatch } from \"../types/osuApiTypes\";\nimport type { Client } from \"../Client\";\nimport { MatchGame } from \"./MatchGame\";\n\nexport class Match {\n public readonly client: Client;\n public readonly id: string;\n public readonly name: string;\n public readonly startAt: Date;\n public readonly endAt: Date | null;\n public readonly games: Array<MatchGame>\n constructor(client: Client, data: APIMatch) {\n this.client = client;\n\n const { match, games } = data;\n this.id = match.match_id;\n this.name = match.name;\n this.startAt = new Date(match.start_time);\n if (match.end_time) {\n this.endAt = new Date(match.end_time);\n } else {\n this.endAt = null;\n }\n\n this.games = games.map(data => new MatchGame(this, data));\n\n }\n}","import { BaseManager } from \"./BaseManager\";\nimport type { GetMatchRequestOptions } from \"../types/interfaces\";\nimport type { APIMatch, APIMatchNotFound } from \"../types/osuApiTypes\";\nimport { Match } from \"../structures/Match\";\n\nexport class MatchManager extends BaseManager {\n public async getMatch(options: GetMatchRequestOptions) {\n const queries = {\n mp: options.matchId\n }\n const res = await this.client.request({\n path: 'get_match',\n queries\n }) as APIMatch | APIMatchNotFound;\n\n if (res.match === 0) { return null; }\n return new Match(this.client, res);\n }\n}"],"mappings":";AACA,OAAOA,cAAa;;;ACCpB,OAAO,aAAa;;;ACFb,IAAK,W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QAAQ,IAAI,KAAK,MAAM,QAAQ;AAAA,IACxC,OAAO;AACH,WAAK,QAAQ;AAAA,IACjB;AAEA,SAAK,QAAQ,MAAM,IAAI,CAAAC,UAAQ,IAAI,UAAU,MAAMA,KAAI,CAAC;AAAA,EAE5D;AACJ;;;ACtBO,IAAM,eAAN,cAA2B,YAAY;AAAA,EAC1C,MAAa,SAAS,SAAiC;AACnD,UAAM,UAAU;AAAA,MACZ,IAAI,QAAQ;AAAA,IAChB;AACA,UAAM,MAAM,MAAM,KAAK,OAAO,QAAQ;AAAA,MAClC,MAAM;AAAA,MACN;AAAA,IACJ,CAAC;AAED,QAAI,IAAI,UAAU,GAAG;AAAE,aAAO;AAAA,IAAM;AACpC,WAAO,IAAI,MAAM,KAAK,QAAQ,GAAG;AAAA,EACrC;AACJ;;;ApBVO,IAAM,SAAN,MAAa;AAAA,EAOhB,YAAY,SAAwB;AAChC,SAAK,SAAS,QAAQ;AACtB,SAAK,QAAQ,IAAI,YAAY,IAAI;AACjC,SAAK,WAAW,IAAI,eAAe,IAAI;AACvC,SAAK,SAAS,IAAI,aAAa,IAAI;AACnC,SAAK,UAAU,IAAI,cAAc,IAAI;AACrC,SAAK,UAAU,IAAI,aAAa,IAAI;AAAA,EACxC;AAAA,EAEA,MAAa,QAAwC,SAA4B;AAC7E,QAAI,CAAC,SAAS;AAAM,YAAM,IAAI,MAAM,cAAc;AAClD,UAAM,WAAW,MAAMC,SAAQ,IAAI,0BAA0B,QAAQ,MAAM,EACtE,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,EACxB,MAAM,QAAQ,OAAO;AAE1B,WAAO,SAAS;AAAA,EACpB;AACJ;","names":["request","GameMode","UserRequestType","BeatmapApprovedState","BeatmapGenre","BeatmapLanguage","ScoreRank","MatchScoringType","MatchTeamType","Team","url","data","request"]}
1
+ {"version":3,"sources":["../src/Client.ts","../src/managers/UserManager.ts","../src/types/enums.ts","../src/utils/URLBuilder.ts","../src/structures/ModsBitField.ts","../src/utils/AccuracyCalculator.ts","../src/structures/BaseScore.ts","../src/structures/BeatmapScore.ts","../src/structures/UserEvent.ts","../src/structures/User.ts","../src/managers/BaseManager.ts","../src/utils/toSqlDate.ts","../src/structures/Beatmapset.ts","../src/structures/Beatmap.ts","../src/managers/BeatmapManager.ts","../src/managers/ScoreManager.ts","../src/structures/Replay.ts","../src/managers/ReplayManager.ts","../src/structures/MatchScore.ts","../src/structures/MatchGame.ts","../src/structures/Match.ts","../src/managers/MatchManager.ts"],"sourcesContent":["import type { ClientOptions, OsuApiRequestOptions, RequestOptions } from './types/interfaces';\nimport request from 'superagent';\nimport { UserManager } from './managers/UserManager'\nimport { BeatmapManager } from './managers/BeatmapManager';\nimport { ScoreManager } from './managers/ScoreManager';\nimport { ReplayManager } from './managers/ReplayManager';\nimport { MatchManager } from './managers/MatchManager';\n\nexport class Client {\n private apiKey: string;\n public users: UserManager;\n public beatmaps: BeatmapManager;\n public scores: ScoreManager;\n public replays: ReplayManager;\n public matches: MatchManager;\n constructor(options: ClientOptions) {\n this.apiKey = options.apiKey;\n this.users = new UserManager(this);\n this.beatmaps = new BeatmapManager(this);\n this.scores = new ScoreManager(this);\n this.replays = new ReplayManager(this);\n this.matches = new MatchManager(this);\n }\n\n public async request<T extends OsuApiRequestOptions>(options: RequestOptions<T>) {\n if (!options?.path) throw new Error('MISSING_PATH');\n const response = await request.get(`https://osu.ppy.sh/api/${options.path}`)\n .query({ k: this.apiKey })\n .query(options.queries);\n\n return response.body;\n }\n}","import type { APIGetUserBestRequestOptions, APIGetUserRecentRequestOptions, APIGetUserRequestOptions, FetchUserBannerOptions, GetUserBestRequestOptions, GetUserRecentRequestOptions, GetUserRequestOptions } from \"../types/interfaces\";\nimport type { APIUser, APIUserBestPerformanceScore, APIUserRecentPlayedScore } from \"../types/osuApiTypes\";\nimport request from 'superagent';\nimport { URLBuilder } from \"../utils/URLBuilder\";\nimport { BeatmapScore } from \"../structures/BeatmapScore\";\nimport { User } from \"../structures/User\";\nimport { BaseManager } from \"./BaseManager\";\n\nexport class UserManager extends BaseManager {\n public async getUser(options: GetUserRequestOptions) {\n const queries = {\n u: options.user,\n m: options.gameMode,\n type: options.type,\n event_days: options.eventDays\n }\n\n const res = await this.client.request<APIGetUserRequestOptions>({\n path: 'get_user',\n queries\n }) as Array<APIUser>;\n\n return res.map(v => new User(this.client, v));\n }\n\n public async fetchBanner({ id }: FetchUserBannerOptions) {\n const context = await request.get(`https://osu.ppy.sh/users/${id}`);\n const banner_regex = new RegExp(`https:\\\\\\\\\\\\/\\\\\\\\\\\\/assets\\\\.ppy\\\\.sh\\\\\\\\\\\\/user-profile-covers\\\\\\\\\\\\\\/${id}\\\\\\\\\\\\/(?<hash>[0-9a-z]*?)\\\\.(?<ext>.*?)&`, 'gm');\n const banner = banner_regex.exec(context.text);\n\n if (banner) {\n const url = URLBuilder.banner(id, banner?.groups?.hash!, banner?.groups?.ext!);\n return url;\n }\n const default_banner_regex = new RegExp('https:\\\\\\\\\\\\/\\\\\\\\\\\\/osu\\\\.ppy\\\\.sh\\\\\\\\\\\\/images\\\\\\\\\\\\/headers\\\\\\\\\\\\/profile-covers\\\\\\\\\\\\/c(?<id>\\\\d)\\\\.(?<ext>.*?)&', 'gm');\n const defaultBanner = default_banner_regex.exec(context.text);\n const url = URLBuilder.defaultBanner(defaultBanner?.groups?.id!, defaultBanner?.groups?.ext!);\n return url;\n }\n\n public async getUserBest(options: GetUserBestRequestOptions) {\n const queries = {\n u: options.user,\n m: options.mode,\n type: options.type,\n limit: options.limit\n }\n\n const res = await this.client.request<APIGetUserBestRequestOptions>({\n path: 'get_user_best',\n queries\n }) as Array<APIUserBestPerformanceScore>;\n\n return res.map(v => new BeatmapScore(this.client, v, { mode: options.mode }));\n }\n\n public async getUserRecent(options: GetUserRecentRequestOptions) {\n const queries = {\n u: options.user,\n m: options.mode,\n type: options.type,\n limit: options.limit\n }\n\n const res = await this.client.request<APIGetUserRecentRequestOptions>({\n path: 'get_user_recent',\n queries\n }) as Array<APIUserRecentPlayedScore>;\n\n return res.map(v => new BeatmapScore(this.client, v, { mode: options.mode }));\n }\n\n}","export enum GameMode {\n Standard, Taiko, Catch, Mania\n}\n\nexport enum UserRequestType {\n String = 'string', \n Id = 'id'\n}\n\nexport const Mods = {\n None :0n,\n NoFail :1n << 0n,\n Easy :1n << 1n,\n TouchDevice :1n << 2n,\n Hidden :1n << 3n,\n HardRock :1n << 4n,\n SuddenDeath :1n << 5n,\n DoubleTime :1n << 6n,\n Relax :1n << 7n,\n HalfTime :1n << 8n,\n Nightcore :1n << 9n,\n Flashlight :1n << 10n,\n Autoplay :1n << 11n,\n SpunOut :1n << 12n,\n AutoPilot :1n << 13n,\n Perfect :1n << 14n,\n Key4 :1n << 15n,\n Key5 :1n << 16n,\n Key6 :1n << 17n,\n Key7 :1n << 18n,\n Key8 :1n << 19n,\n FadeIn :1n << 20n,\n Random :1n << 21n,\n Cinema :1n << 22n,\n Target :1n << 23n,\n Key9 :1n << 24n,\n KeyCoop :1n << 25n,\n Key1 :1n << 26n,\n Key3 :1n << 27n,\n Key2 :1n << 28n,\n ScoreV2 :1n << 29n,\n Mirror :1n << 30n,\n}\n\nexport enum BeatmapApprovedState {\n Graveyard = -2,\n WIP,\n Pending,\n Ranked,\n Approved,\n Qualified,\n Loved\n}\n\nexport enum BeatmapGenre {\n Any, Unspecified, VideoGame, Anime, Rock, Pop, Other, Novelty,\n HipHop = 9, Electronic, Metal, Classic, Folk, Jazz\n}\n\nexport enum BeatmapLanguage {\n Any, Unspecified, English, Japanese, Chinese,\n Instrumental, Korean, French, German, Swedish,\n Spanish, Italian, Russian, Polish, Other\n}\n\nexport enum ScoreRank {\n XH, X, SH, S, A, B, C, D, F\n}\n\nexport enum MatchScoringType {\n Score, Accuracy, Combo, ScoreV2\n}\n\nexport enum MatchTeamType {\n HeadToHead, TagCoop, TeamVs, TagTeamVs\n}\n\nexport enum Team {\n None, Blue, Red\n}","import { GameMode } from \"../types/enums\";\n\nexport abstract class URLBuilder {\n private static gameModeToURLPattern(mode: GameMode) {\n switch(mode) {\n case GameMode.Standard: return 'osu';\n case GameMode.Taiko: return 'taiko';\n case GameMode.Catch: return 'fruits';\n case GameMode.Mania: return 'mania';\n default: throw new Error('INVALID_GAMEMODE');\n }\n }\n\n public static avatar(id: string) {\n return `https://a.ppy.sh/${id}`;\n }\n\n public static profile(idOrName: string) {\n return `https://osu.ppy.sh/users/${idOrName}`;\n }\n\n public static banner(userId: string, hash: string, ext: string) {\n return `https://assets.ppy.sh/user-profile-covers/${userId}/${hash}.${ext}`;\n }\n\n public static defaultBanner(id: string, ext: string) {\n return `https://osu.ppy.sh/images/headers/profile-covers/c${id}.${ext}`;\n }\n\n public static beatmapsetURL(beatmapsetId: string) {\n return `https://osu.ppy.sh/beatmapsets/${beatmapsetId}`;\n }\n\n public static beatmapURL(beatmapsetId: string, beatmapId: string, mode: GameMode) {\n const m = URLBuilder.gameModeToURLPattern(mode);\n return `https://osu.ppy.sh/beatmapsets/${beatmapsetId}#${m}/${beatmapId}`;\n }\n\n public static beatmapCoverImage(beatmapsetId: string) {\n return `https://assets.ppy.sh/beatmaps/${beatmapsetId}/covers/cover.jpg`;\n }\n\n public static beatmapCoverThumbnail(beatmapsetId: string) {\n return `https://b.ppy.sh/thumb/${beatmapsetId}l.jpg`;\n }\n\n public static scoreURL(mode: GameMode, scoreId: string) {\n const m = URLBuilder.gameModeToURLPattern(mode);\n return `https://osu.ppy.sh/scores/${m}/${scoreId}`;\n }\n}","import { Mods } from \"../types/enums\";\n\nexport type ModsResolvable = number | string | bigint | ModsBitField | Array<ModsResolvable>;\n\nexport class ModsBitField {\n static Flags = Mods;\n static KeyMod = \n Mods.Key1 | Mods.Key2 | Mods.Key3 | Mods.Key4 | Mods.Key5 |\n Mods.Key6 | Mods.Key7 | Mods.Key8 | Mods.Key9 | Mods.KeyCoop;\n static FreeModAllowed = \n Mods.NoFail | Mods.Easy | Mods.Hidden | Mods.HardRock | Mods.SuddenDeath | \n Mods.Flashlight | Mods.FadeIn | Mods.Relax | Mods.AutoPilot | Mods.SpunOut | \n ModsBitField.KeyMod;\n static ScoreIncreaseMods = \n Mods.Hidden | Mods.HardRock | Mods.DoubleTime | Mods.Flashlight | Mods.FadeIn;\n\n public bitfield: bigint;\n constructor(bits: ModsResolvable = 0n) {\n this.bitfield = ModsBitField.resolve(bits);\n }\n\n public any(bit: ModsResolvable) {\n return (this.bitfield & ModsBitField.resolve(bit)) !== 0n;\n }\n\n public equals(bit: ModsResolvable) {\n return this.bitfield === ModsBitField.resolve(bit);\n }\n\n public has(bit: ModsResolvable) {\n bit = ModsBitField.resolve(bit);\n return (this.bitfield & bit) === bit;\n }\n\n public add(...bits: Array<ModsResolvable>) {\n let total: bigint = 0n;\n for (const bit of bits) {\n total |= ModsBitField.resolve(bit);\n }\n this.bitfield |= total;\n\n return this;\n }\n\n public remove(...bits: ModsResolvable[]) {\n let total: bigint = 0n;\n for (const bit of bits) {\n total |= ModsBitField.resolve(bit);\n }\n this.bitfield &= ~total;\n\n return this;\n }\n\n public toArray() {\n return Object.keys(ModsBitField.Flags).filter(bit => this.has(bit));\n }\n\n public serialize() {\n const serialized: { [key: string]: boolean } = {};\n for (const [flag, bit] of Object.entries(ModsBitField.Flags)) {\n serialized[flag as keyof typeof ModsBitField.Flags] = this.has(bit);\n }\n return serialized;\n }\n\n public isNone() {\n return this.bitfield === 0n;\n }\n\n public valueOf() {\n return this.bitfield;\n }\n\n public static resolve(bit: ModsResolvable): bigint {\n if (Array.isArray(bit)) {\n return bit.map(ModsBitField.resolve).reduce((acc, now) => acc | now, 0n);\n }\n if (bit instanceof ModsBitField) {\n return bit.bitfield;\n }\n if (typeof bit === 'number') return BigInt(bit);\n if (typeof bit === 'string') {\n if (!isNaN(+bit)) return BigInt(bit);\n const a: bigint | undefined = ModsBitField.Flags[bit as keyof typeof ModsBitField.Flags];\n if (typeof a === 'undefined') throw new Error('INVALID_BITFIELD');\n return a;\n }\n return bit;\n }\n}","import type { BaseScore } from '../structures/BaseScore';\nimport { GameMode } from '../types/enums';\n\nexport abstract class AccuracyCalculator {\n\n\tpublic static standard(count300: number, count100: number, count50: number, countMiss: number) {\n\t\tconst max = count300 + count100 + count50 + countMiss;\n\t\tif (!max) return 0;\n\n\t\treturn (count300 * 300 + count100 * 100 + count50 * 50) / (max * 300);\n\t}\n\n\tpublic static taiko(count300: number, count100: number, countMiss: number) {\n\t\tconst max = count300 + count100 + countMiss;\n\t\tif (!max) return 0;\n\n\t\treturn (count300 + count100 * 0.5) / max;\n\t}\n\n\tpublic static catch(count300: number, count100: number, count50: number, countKatu: number, countMiss: number) {\n\t\tconst max = count300 + count100 + count50 + countKatu + countMiss;\n\t\tif (!max) return 0;\n\n\t\treturn (count300 + count100 + count50) / max\n\t}\n\n\tpublic static mania(count300: number, count100: number, count50: number, countKatu: number, countGeki: number, countMiss: number) {\n\t\tconst max = count300 + count100 + count50 + countKatu + countGeki + countMiss;\n\t\tif (!max) return 0;\n\n\t\treturn (300 * countGeki + 300 * count300 + 200 * countKatu + 100 * count100 + 50 * count50) / (max * 300);\n\t}\n\n\tpublic static maniaV2(count300: number, count100: number, count50: number, countKatu: number, countGeki: number, countMiss: number) {\n\t\tconst max = count300 + count100 + count50 + countKatu + countGeki + countMiss;\n\t\tif (!max) return 0;\n\n\t\treturn (305 * countGeki + 300 * count300 + 200 * countKatu + 100 * count100 + 50 * count50) / (max * 305);\n\t}\n\n\tpublic static calculate(score: BaseScore, v2: boolean = false) {\n\t\tconst { statistics } = score;\n\t\tswitch(score.mode) {\n\t\t\tcase GameMode.Standard:\n\t\t\t\treturn AccuracyCalculator.standard(\n\t\t\t\t\t\tstatistics.count300, \n\t\t\t\t\t\tstatistics.count100, \n\t\t\t\t\t\tstatistics.count50,\n\t\t\t\t\t\tstatistics.countMiss\n\t\t\t\t\t);\n\t\t\tcase GameMode.Taiko:\n\t\t\t\treturn AccuracyCalculator.taiko(\n\t\t\t\t\t\tstatistics.count300, \n\t\t\t\t\t\tstatistics.count100,\n\t\t\t\t\t\tstatistics.countMiss\n\t\t\t\t\t);\n\t\t\tcase GameMode.Catch:\n\t\t\t\treturn AccuracyCalculator.catch(\n\t\t\t\t\t\tstatistics.count300, \n\t\t\t\t\t\tstatistics.count100, \n\t\t\t\t\t\tstatistics.count50,\n\t\t\t\t\t\tstatistics.countKatu,\n\t\t\t\t\t\tstatistics.countMiss\n\t\t\t\t\t);\n\t\t\tcase GameMode.Mania:\n\t\t\t\treturn v2 ?\n\t\t\t\t\tAccuracyCalculator.maniaV2(\n\t\t\t\t\t\tstatistics.count300, \n\t\t\t\t\t\tstatistics.count100, \n\t\t\t\t\t\tstatistics.count50,\n\t\t\t\t\t\tstatistics.countKatu,\n\t\t\t\t\t\tstatistics.countGeki,\n\t\t\t\t\t\tstatistics.countMiss\n\t\t\t\t\t) : \n\t\t\t\t\tAccuracyCalculator.mania(\n\t\t\t\t\t\tstatistics.count300, \n\t\t\t\t\t\tstatistics.count100, \n\t\t\t\t\t\tstatistics.count50,\n\t\t\t\t\t\tstatistics.countKatu,\n\t\t\t\t\t\tstatistics.countGeki,\n\t\t\t\t\t\tstatistics.countMiss\n\t\t\t\t\t);\n\t\t}\n\t}\n}","import type { Client } from \"../Client\";\nimport type { APIBasicScore, APIBeatmapScore, APIMatchScore, APIUserBestPerformanceScore, APIUserRecentPlayedScore } from \"../types/osuApiTypes\";\nimport type { BeatmapScoreOtherInfo, GetUserRequestOptions, ScoreStatistics } from \"../types/interfaces\";\nimport type { User } from \"./User\";\nimport { GameMode, ScoreRank, UserRequestType } from \"../types/enums\";\nimport { ModsBitField } from \"./ModsBitField\";\nimport { AccuracyCalculator } from \"../utils/AccuracyCalculator\";\n\nexport type APIScore = \n APIBasicScore |\n APIUserRecentPlayedScore |\n APIUserBestPerformanceScore | \n APIBeatmapScore |\n APIMatchScore;\n\nexport abstract class BaseScore {\n public readonly client: Client;\n public readonly score: number;\n public readonly maxCombo: number;\n public readonly statistics: ScoreStatistics;\n public readonly perfect: boolean;\n public readonly enabledMods: ModsBitField;\n public readonly userId: string;\n public readonly rank: ScoreRank;\n public readonly mode: GameMode;\n public readonly beatmapId: string;\n public readonly accuracy: number;\n constructor(client: Client, data: APIScore, other: BeatmapScoreOtherInfo) {\n this.client = client;\n this.score = +data.score;\n this.maxCombo = +data.maxcombo;\n this.statistics = {\n count50: +data.count50,\n count100: +data.count100,\n count300: +data.count300,\n countMiss: +data.countmiss,\n countKatu: +data.countkatu,\n countGeki: +data.countgeki\n }\n this.perfect = !!+data.perfect;\n this.enabledMods = new ModsBitField(data.enabled_mods);\n this.userId = data.user_id;\n this.rank = ScoreRank[data.rank];\n this.mode = other.mode ?? GameMode.Standard;\n\n if ('beatmap_id' in data) {\n this.beatmapId = data.beatmap_id;\n } else {\n this.beatmapId = other.mapId!;\n }\n\n this.accuracy = AccuracyCalculator.calculate(this);\n }\n\n public async getPlayer(options: Omit<GetUserRequestOptions, \"user\" | \"type\"> = {}): Promise<User | undefined> {\n const candidates = await this.client.users.getUser({\n user: this.userId,\n type: UserRequestType.Id,\n ...options\n });\n\n return candidates[0];\n }\n\n public async getBeatmap() {\n const candidates = await this.client.beatmaps.getBeatmaps({\n beatmapId: this.beatmapId,\n mode: this.mode,\n });\n\n return candidates[0];\n }\n\n public getReplay() {\n return this.client.replays.getReplay({\n beatmapId: this.beatmapId,\n user: this.userId,\n type: UserRequestType.Id\n })\n }\n}","import type { Client } from \"../Client\";\nimport type { BeatmapScoreOtherInfo } from \"../types/interfaces\";\nimport type { APIBeatmapScore, APIUserBestPerformanceScore, APIUserRecentPlayedScore } from \"../types/osuApiTypes\";\nimport { URLBuilder } from \"../utils/URLBuilder\";\nimport { BaseScore } from \"./BaseScore\";\n\nexport class BeatmapScore extends BaseScore {\n public readonly date: Date;\n public readonly scoreId: string | null = null;\n public readonly username: string | null = null;\n public readonly pp: number | null = null;\n public readonly replayAvailable: boolean | null = null;\n\n constructor(client: Client, data: APIBeatmapScore, other: BeatmapScoreOtherInfo);\n constructor(client: Client, data: APIUserBestPerformanceScore, other: BeatmapScoreOtherInfo);\n constructor(client: Client, data: APIUserRecentPlayedScore, other: BeatmapScoreOtherInfo);\n\n constructor(\n client: Client, \n data: APIBeatmapScore | APIUserBestPerformanceScore | APIUserRecentPlayedScore, \n other: BeatmapScoreOtherInfo\n ) {\n super(client, data, other);\n\n this.date = new Date(data.date);\n \n if ('score_id' in data) {\n this.scoreId = data.score_id;\n }\n\n if ('username' in data) {\n this.username = data.username;\n }\n\n if ('pp' in data) {\n this.pp = +data.pp;\n }\n\n if ('replay_available' in data) {\n this.replayAvailable = !!+data.replay_available;\n }\n }\n\n public scoreURL() {\n if (!this.scoreId) return null;\n return URLBuilder.scoreURL(this.mode, this.scoreId);\n }\n\n}","import type { User } from './User';\nimport type { APIUserEvent } from \"../types/osuApiTypes\";\nimport type { Beatmap } from './Beatmap';\n\nexport class UserEvent {\n public readonly user: User;\n public readonly displayHtml: string;\n public readonly beatmapId: string;\n public readonly beatmapsetId: string;\n public readonly date: Date;\n public readonly epicfactor: number;\n constructor(user: User, data: APIUserEvent) {\n this.user = user;\n this.displayHtml = data.display_html;\n this.beatmapId = data.beatmap_id;\n this.beatmapsetId = data.beatmapset_id;\n this.date = new Date(data.date);\n this.epicfactor = +data.epicfactor;\n }\n\n public async getBeatmap(): Promise<Beatmap | undefined> {\n const candidates = await this.user.client.beatmaps.getBeatmaps({\n beatmapId: this.beatmapId,\n beatmapsetId: this.beatmapsetId,\n });\n\n return candidates[0];\n }\n\n public async getBeatmapset() {\n const beatmap = await this.getBeatmap();\n return beatmap?.getBeatmapset();\n }\n}","import type { UserScoreRankCount, GetUserBestRequestOptions, GetUserRecentRequestOptions } from \"../types/interfaces\";\nimport type { APIUser } from \"../types/osuApiTypes\";\nimport type { Client } from \"../Client\";\nimport { UserEvent } from \"./UserEvent\";\nimport { URLBuilder } from \"../utils/URLBuilder\";\nimport { UserRequestType } from \"../types/enums\";\n\nexport class User {\n public readonly client: Client;\n\n // User Data\n public readonly id: string;\n public readonly username: string;\n public readonly joinDate: Date;\n public readonly playcount: number;\n public readonly level: number;\n public readonly country: string;\n public readonly playtime: number;\n public readonly events: Array<UserEvent>;\n public banner: string | null;\n\n // User Score\n public readonly count300: number;\n public readonly count100: number;\n public readonly count50: number;\n public readonly rankedScore: number;\n public readonly totalScore: number;\n public readonly rank: number;\n public readonly countryRank: number;\n public readonly pp: number;\n public readonly accuracy: number;\n public readonly scoreRankCount: UserScoreRankCount;\n\n constructor(client: Client, data: APIUser) {\n this.client = client;\n this.id = data.user_id;\n this.username = data.username;\n this.joinDate = new Date(data.join_date);\n this.count300 = +data.count300;\n this.count100 = +data.count100;\n this.count50 = +data.count50;\n this.playcount = +data.playcount;\n this.playtime = +data.total_seconds_played;\n this.rankedScore = +data.ranked_score;\n this.totalScore = +data.total_score;\n this.rank = +data.pp_rank;\n this.level = +data.level;\n this.pp = +data.pp_raw;\n this.accuracy = +data.accuracy;\n this.scoreRankCount = {\n ss: +data.count_rank_ss,\n ssh: +data.count_rank_ssh,\n s: +data.count_rank_s,\n sh: +data.count_rank_sh,\n a: +data.count_rank_a\n };\n this.country = data.country;\n this.countryRank = +data.pp_country_rank;\n this.events = data.events.map(v => new UserEvent(this, v));\n\n this.banner = null;\n }\n\n public avatarURL() {\n return URLBuilder.avatar(this.id);\n }\n\n public profileURL() {\n return URLBuilder.profile(this.id);\n }\n\n public async fetchBanner(force: boolean = false) {\n if (!force && this.banner) return this.banner;\n const url = await this.client.users.fetchBanner({ id: this.id });\n return this.banner = url;\n }\n\n public getBest(options: Omit<GetUserBestRequestOptions, \"user\" | \"type\"> = {}) {\n return this.client.users.getUserBest({\n user: this.id,\n type: UserRequestType.Id,\n ...options\n });\n\n }\n\n public getRecent(options: Omit<GetUserRecentRequestOptions, \"user\" | \"type\"> = {}) {\n return this.client.users.getUserRecent({\n user: this.id,\n type: UserRequestType.Id,\n ...options\n });\n }\n}","import type { Client } from \"../Client\";\n\nexport abstract class BaseManager {\n public readonly client: Client;\n constructor(client: Client) {\n this.client = client;\n }\n}","export function toSqlDate(date: Date) {\n return date.toISOString().slice(0, 19).replace('T', ' ');\n}","import type { Client } from '../Client';\nimport type { BeatmapApprovedState, BeatmapGenre, BeatmapLanguage } from '../types/enums';\nimport type { Beatmap } from './Beatmap';\nimport type { User } from './User';\nimport { UserRequestType } from '../types/enums';\nimport { URLBuilder } from '../utils/URLBuilder';\n\nexport class Beatmapset {\n public readonly client: Client;\n public readonly beatmaps: Array<Beatmap>;\n public readonly id: string;\n public readonly approvedState: BeatmapApprovedState;\n public readonly length: number;\n public readonly submitDate: Date;\n public readonly approvedDate: Date | null;\n public readonly lastUpdate: Date;\n public readonly artist: string;\n public readonly title: string;\n public readonly creator: string;\n public readonly creatorId: string;\n public readonly source: string;\n public readonly tags: string[];\n public readonly genre: BeatmapGenre;\n public readonly language: BeatmapLanguage;\n public readonly favoriteCount: number;\n public readonly rating: number;\n public readonly downloadUnavailable: boolean;\n public readonly audioUnavailable: boolean;\n constructor(client: Client, data: Beatmap, maps: Array<Beatmap>) {\n this.client = client;\n this.beatmaps = maps;\n this.id = data.beatmapsetId;\n this.approvedState = data.approvedState;\n this.length = data.totalLength;\n this.submitDate = data.submitDate;\n this.approvedDate = data.approvedDate;\n this.lastUpdate = data.lastUpdate;\n this.artist = data.artist;\n this.title = data.title;\n this.creator = data.creator;\n this.creatorId = data.creatorId;\n this.source = data.source;\n this.tags = data.tags.slice();\n this.genre = data.genre;\n this.language = data.language;\n this.favoriteCount = data.favoriteCount;\n this.rating = data.rating;\n this.downloadUnavailable = data.downloadUnavailable;\n this.audioUnavailable = data.audioUnavailable;\n }\n\n public beatmapsetURL() {\n return URLBuilder.beatmapsetURL(this.id);\n }\n \n public coverImageURL() {\n return URLBuilder.beatmapCoverImage(this.id);\n }\n \n public coverThumbnailURL() {\n return URLBuilder.beatmapCoverThumbnail(this.id);\n }\n \n public async getCreator(): Promise<User | undefined> {\n const candidates = await this.client.users.getUser({\n user: this.creatorId,\n type: UserRequestType.Id\n });\n\n return candidates[0];\n }\n}","import type { Client } from \"../Client\";\nimport type { BeatmapDiffculty, BeatmapObjectCount } from \"../types/interfaces\";\nimport type { APIBeatmap } from \"../types/osuApiTypes\";\nimport type { User } from \"./User\";\nimport { BeatmapApprovedState, BeatmapGenre, BeatmapLanguage, GameMode, UserRequestType } from \"../types/enums\";\nimport { URLBuilder } from \"../utils/URLBuilder\";\nimport { Beatmapset } from \"./Beatmapset\";\n\nexport class Beatmap {\n public readonly id: string;\n public readonly beatmapsetId: string;\n public readonly approvedState: BeatmapApprovedState;\n public readonly totalLength: number;\n public readonly hitLength: number;\n public readonly diffcultyName: string;\n public readonly hash: string;\n public readonly difficulty: BeatmapDiffculty;\n public readonly mode: GameMode;\n public readonly objectCount: BeatmapObjectCount;\n public readonly submitDate: Date;\n public readonly approvedDate: Date | null;\n public readonly lastUpdate: Date;\n public readonly artist: string;\n public readonly title: string;\n public readonly creator: string;\n public readonly creatorId: string;\n public readonly bpm: number;\n public readonly source: string;\n public readonly tags: string[];\n public readonly genre: BeatmapGenre;\n public readonly language: BeatmapLanguage;\n public readonly favoriteCount: number;\n public readonly rating: number;\n public readonly downloadUnavailable: boolean;\n public readonly audioUnavailable: boolean;\n public readonly playcount: number;\n public readonly passcount: number;\n public readonly maxCombo: number | null;\n constructor(public readonly client: Client, data: APIBeatmap) {\n this.id = data.beatmap_id;\n this.beatmapsetId = data.beatmapset_id;\n this.approvedState = +data.approved;\n this.totalLength = +data.total_length;\n this.hitLength = +data.hit_length;\n this.diffcultyName = data.version;\n this.hash = data.file_md5;\n this.difficulty = {\n ApproachRate: +data.diff_approach,\n CircleSize: +data.diff_size,\n OverallDifficulty: +data.diff_overall,\n HPDrainRate: +data.diff_drain,\n aim: +(data.diff_aim ?? 0),\n speed: +(data.diff_speed ?? 0),\n rating: +(data.difficultyrating ?? 0)\n }\n this.mode = +data.mode;\n this.objectCount = {\n circle: +data.count_normal,\n slider: +data.count_slider,\n spinner: +data.count_spinner\n }\n this.submitDate = new Date(data.submit_date);\n if (!data.approved_date) {\n this.approvedDate = null;\n } else {\n this.approvedDate = new Date(data.approved_date);\n }\n this.lastUpdate = new Date(data.last_update);\n this.artist = data.artist;\n this.title = data.title;\n this.creator = data.creator;\n this.creatorId = data.creator_id;\n this.bpm = +data.bpm;\n this.source = data.source;\n this.tags = data.tags.split(' ');\n this.genre = +data.genre_id;\n this.language = +data.language_id;\n this.favoriteCount = +data.favourite_count;\n this.rating = +data.rating;\n this.downloadUnavailable = !!+data.download_unavailable;\n this.audioUnavailable = !!+data.audio_unavailable;\n this.playcount = +data.playcount;\n this.passcount = +data.passcount;\n if (data.max_combo) {\n this.maxCombo = +data.max_combo;\n } else {\n this.maxCombo = null;\n }\n }\n\n public beatmapsetURL() {\n return URLBuilder.beatmapsetURL(this.beatmapsetId);\n }\n\n public beatmapURL() {\n return URLBuilder.beatmapURL(this.beatmapsetId, this.id, this.mode);\n }\n \n public coverImageURL() {\n return URLBuilder.beatmapCoverImage(this.beatmapsetId);\n }\n \n public coverThumbnailURL() {\n return URLBuilder.beatmapCoverThumbnail(this.beatmapsetId);\n }\n \n public async getCreator(): Promise<User | undefined> {\n const candidates = await this.client.users.getUser({\n user: this.creatorId,\n type: UserRequestType.Id\n });\n\n return candidates[0];\n }\n\n public async getBeatmapset() {\n const set = await this.client.beatmaps.getBeatmaps({\n beatmapsetId: this.beatmapsetId\n });\n \n return new Beatmapset(this.client, this, set);\n }\n\n}","import type { APIGetBeatmapsRequestOptions, GetBeatmapsRequestOptions } from \"../types/interfaces\";\nimport type { APIBeatmap } from \"../types/osuApiTypes\";\nimport { toSqlDate } from '../utils/toSqlDate';\nimport { ModsBitField } from \"../structures/ModsBitField\";\nimport { Beatmap } from \"../structures/Beatmap\";\nimport { BaseManager } from \"./BaseManager\";\n\nexport class BeatmapManager extends BaseManager {\n public async getBeatmaps(options: GetBeatmapsRequestOptions = {}) {\n const queries = {\n since: options.since && toSqlDate(options.since),\n s: options.beatmapsetId,\n b: options.beatmapId,\n u: options.user,\n type: options.type,\n m: options.mode,\n a: options.showConverted,\n h: options.hash,\n limit: options.limit,\n mods: ModsBitField.resolve(options.mods ?? 0)\n }\n\n const res = await this.client.request<APIGetBeatmapsRequestOptions>({\n path: 'get_beatmaps',\n queries\n }) as Array<APIBeatmap>;\n\n return res.map(v => new Beatmap(this.client, v));\n }\n}","import type { APIGetScoresRequestOptions, GetScoreRequestOptions } from \"../types/interfaces\";\nimport type { APIBeatmapScore } from \"../types/osuApiTypes\";\nimport { ModsBitField } from \"../structures/ModsBitField\";\nimport { BeatmapScore } from \"../structures/BeatmapScore\";\nimport { BaseManager } from \"./BaseManager\";\n\nexport class ScoreManager extends BaseManager {\n public async getScores(options: GetScoreRequestOptions) {\n const mods = options.mods == undefined \n ? undefined : ModsBitField.resolve(options.mods);\n const queries = {\n b: options.beatmapId,\n u: options.user,\n m: options.mode,\n mods: mods,\n type: options.type,\n limit: options.limit\n }\n\n const res = await this.client.request<APIGetScoresRequestOptions>({\n path: 'get_scores',\n queries\n }) as Array<APIBeatmapScore>;\n\n return res.map(v => new BeatmapScore(this.client, v, { mapId: options.beatmapId, mode: options.mode }));\n }\n}","import type { Client } from \"../Client\";\nimport type { APIReplay } from \"../types/osuApiTypes\";\nimport { Buffer } from 'node:buffer'\n\nexport class Replay {\n public readonly client: Client;\n public readonly content: string;\n public readonly stream: Buffer;\n constructor(client: Client, data: APIReplay) {\n this.client = client;\n this.content = data.content;\n this.stream = Buffer.from(this.content, 'base64');\n }\n}","import type { APIGetReplayRequestOptions, GetReplayRequestOptions } from \"../types/interfaces\";\nimport type { APIReplay } from \"../types/osuApiTypes\";\nimport { ModsBitField } from \"../structures/ModsBitField\";\nimport { Replay } from \"../structures/Replay\";\nimport { BaseManager } from \"./BaseManager\";\n\nexport class ReplayManager extends BaseManager {\n public async getReplay(options: GetReplayRequestOptions) {\n if ((!options.beatmapId || !options.user) && !options.scoreId) {\n throw new Error('You should provide either beatmapId and user or scordId to get replay')\n }\n const mods = options.mods == undefined \n ? undefined : ModsBitField.resolve(options.mods);\n const queries = {\n b: options.beatmapId,\n u: options.user,\n m: options.mode,\n s: options.scoreId,\n type: options.type,\n mods: mods\n }\n\n const res = await this.client.request<APIGetReplayRequestOptions>({\n path: 'get_replay',\n queries\n }) as APIReplay;\n\n return new Replay(this.client, res);\n }\n}","import type { Client } from \"../Client\";\nimport type { Team } from \"../types/enums\";\nimport type { BeatmapScoreOtherInfo } from \"../types/interfaces\";\nimport type { APIMatchScore } from \"../types/osuApiTypes\";\nimport { BaseScore } from \"./BaseScore\";\n\nexport class MatchScore extends BaseScore {\n public readonly slot: number;\n public readonly team: Team;\n public readonly pass: boolean;\n constructor(client: Client, data: APIMatchScore, other: BeatmapScoreOtherInfo) {\n super(client, data, other);\n this.slot = +data.slot;\n this.team = +data.team;\n this.pass = !!+data.pass;\n }\n}","import type { Client } from \"../Client\";\nimport type { GameMode, MatchScoringType, Team } from \"../types/enums\";\nimport type { APIMatchGameData } from \"../types/osuApiTypes\";\nimport type { Beatmap } from \"./Beatmap\";\nimport type { Match } from \"./Match\";\nimport { MatchScore } from \"./MatchScore\";\nimport { ModsBitField } from \"./ModsBitField\";\n\nexport class MatchGame {\n public readonly client: Client;\n public readonly match: Match;\n public readonly id: string;\n public readonly startAt: Date;\n public readonly endAt: Date;\n public readonly beatmapId: string;\n public readonly mode: GameMode;\n public readonly matchType: number;\n public readonly scoringType: MatchScoringType;\n public readonly teamType: Team;\n public readonly mods: ModsBitField;\n public readonly scores: Array<MatchScore>;\n constructor(match: Match, data: APIMatchGameData) {\n this.client = match.client;\n this.match = match;\n this.id = data.game_id;\n this.startAt = new Date(data.start_time);\n this.endAt = new Date(data.end_time);\n this.beatmapId = data.beatmap_id;\n this.mode = +data.play_mode;\n this.matchType = +data.match_type;\n this.scoringType = +data.scoring_type;\n this.teamType = +data.team_type;\n this.mods = new ModsBitField(data.mods);\n this.scores = data.scores.map(score => new MatchScore(this.client, score, {\n mode: +data.play_mode,\n mapId: data.beatmap_id\n }));\n }\n\n public async getBeatmap(): Promise<Beatmap | undefined> {\n const candidates = await this.client.beatmaps.getBeatmaps({\n beatmapId: this.beatmapId\n });\n return candidates[0];\n }\n}","import type { APIMatch } from \"../types/osuApiTypes\";\nimport type { Client } from \"../Client\";\nimport { MatchGame } from \"./MatchGame\";\n\nexport class Match {\n public readonly client: Client;\n public readonly id: string;\n public readonly name: string;\n public readonly startAt: Date;\n public readonly endAt: Date | null;\n public readonly games: Array<MatchGame>\n constructor(client: Client, data: APIMatch) {\n this.client = client;\n\n const { match, games } = data;\n this.id = match.match_id;\n this.name = match.name;\n this.startAt = new Date(match.start_time);\n if (match.end_time) {\n this.endAt = new Date(match.end_time);\n } else {\n this.endAt = null;\n }\n\n this.games = games.map(data => new MatchGame(this, data));\n\n }\n}","import { BaseManager } from \"./BaseManager\";\nimport type { GetMatchRequestOptions } from \"../types/interfaces\";\nimport type { APIMatch, APIMatchNotFound } from \"../types/osuApiTypes\";\nimport { Match } from \"../structures/Match\";\n\nexport class MatchManager extends BaseManager {\n public async getMatch(options: GetMatchRequestOptions) {\n const queries = {\n mp: options.matchId\n }\n const res = await this.client.request({\n path: 'get_match',\n queries\n }) as APIMatch | APIMatchNotFound;\n\n if (res.match === 0) { return null; }\n return new Match(this.client, res);\n }\n}"],"mappings":";AACA,OAAOA,cAAa;;;ACCpB,OAAO,aAAa;;;ACFb,IAAK,WAAL,kBAAKC,cAAL;AACH,EAAAA,oBAAA;AAAU,EAAAA,oBAAA;AAAO,EAAAA,oBAAA;AAAO,EAAAA,oBAAA;AADhB,SAAAA;AAAA,GAAA;AAIL,IAAK,kBAAL,kBAAKC,qBAAL;AACH,EAAAA,iBAAA,YAAS;AACT,EAAAA,iBAAA,QAAK;AAFG,SAAAA;AAAA,GAAA;AAKL,IAAM,OAAO;AAAA,EAChB,MAAgB;AAAA,EAChB,QAAgB,MAAM;AAAA,EACtB,MAAgB,MAAM;AAAA,EACtB,aAAgB,MAAM;AAAA,EACtB,QAAgB,MAAM;AA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atmapGenre","BeatmapLanguage","ScoreRank","MatchScoringType","MatchTeamType","Team","url","data","request"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hizollo/osu-api",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "A Node.js library for interacting with osu!api, written in TypeScript.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",