@hizollo/osu-api 0.0.0 → 1.2.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
@@ -99,6 +99,39 @@ declare const Mods: {
99
99
  ScoreV2: bigint;
100
100
  Mirror: bigint;
101
101
  };
102
+ declare const ModsAbbreviation: {
103
+ NoFail: string;
104
+ Easy: string;
105
+ TouchDevice: string;
106
+ Hidden: string;
107
+ HardRock: string;
108
+ SuddenDeath: string;
109
+ DoubleTime: string;
110
+ Relax: string;
111
+ HalfTime: string;
112
+ Nightcore: string;
113
+ Flashlight: string;
114
+ Autoplay: string;
115
+ SpunOut: string;
116
+ AutoPilot: string;
117
+ Perfect: string;
118
+ Key4: string;
119
+ Key5: string;
120
+ Key6: string;
121
+ Key7: string;
122
+ Key8: string;
123
+ FadeIn: string;
124
+ Random: string;
125
+ Cinema: string;
126
+ Target: string;
127
+ Key9: string;
128
+ KeyCoop: string;
129
+ Key1: string;
130
+ Key3: string;
131
+ Key2: string;
132
+ ScoreV2: string;
133
+ Mirror: string;
134
+ };
102
135
  declare enum BeatmapApprovedState {
103
136
  Graveyard = -2,
104
137
  WIP = -1,
@@ -273,7 +306,7 @@ interface APIGetUserBestRequestOptions extends OsuApiRequestOptions {
273
306
  type?: UserRequestType;
274
307
  limit?: number;
275
308
  }
276
- interface GetUserBestRequstOptions {
309
+ interface GetUserBestRequestOptions {
277
310
  user: string;
278
311
  mode?: GameMode;
279
312
  type?: UserRequestType;
@@ -522,6 +555,8 @@ declare class User {
522
555
  avatarURL(): string;
523
556
  profileURL(): string;
524
557
  fetchBanner(force?: boolean): Promise<string>;
558
+ getBest(options?: Omit<GetUserBestRequestOptions, "user" | "type">): Promise<BeatmapScore[]>;
559
+ getRecent(options?: Omit<GetUserRecentRequestOptions, "user" | "type">): Promise<BeatmapScore[]>;
525
560
  }
526
561
 
527
562
  declare class Beatmap {
@@ -576,6 +611,7 @@ declare abstract class BaseScore {
576
611
  readonly rank: ScoreRank;
577
612
  readonly mode: GameMode;
578
613
  readonly beatmapId: string;
614
+ readonly accuracy: number;
579
615
  constructor(client: Client, data: APIScore, other: BeatmapScoreOtherInfo);
580
616
  getPlayer(options?: Omit<GetUserRequestOptions, "user" | "type">): Promise<User | undefined>;
581
617
  getBeatmap(): Promise<Beatmap>;
@@ -602,7 +638,7 @@ declare abstract class BaseManager {
602
638
  declare class UserManager extends BaseManager {
603
639
  getUser(options: GetUserRequestOptions): Promise<User[]>;
604
640
  fetchBanner({ id }: FetchUserBannerOptions): Promise<string>;
605
- getUserBest(options: GetUserBestRequstOptions): Promise<BeatmapScore[]>;
641
+ getUserBest(options: GetUserBestRequestOptions): Promise<BeatmapScore[]>;
606
642
  getUserRecent(options: GetUserRecentRequestOptions): Promise<BeatmapScore[]>;
607
643
  }
608
644
 
@@ -680,4 +716,13 @@ declare abstract class URLBuilder {
680
716
  static scoreURL(mode: GameMode, scoreId: string): string;
681
717
  }
682
718
 
683
- 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, GetUserBestRequstOptions, 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 };
719
+ declare abstract class AccuracyCalculator {
720
+ static standard(count300: number, count100: number, count50: number, countMiss: number): number;
721
+ static taiko(count300: number, count100: number, countMiss: number): number;
722
+ static catch(count300: number, count100: number, count50: number, countKatu: number, countMiss: number): number;
723
+ static mania(count300: number, count100: number, count50: number, countKatu: number, countGeki: number, countMiss: number): number;
724
+ static maniaV2(count300: number, count100: number, count50: number, countKatu: number, countGeki: number, countMiss: number): number;
725
+ static calculate(score: BaseScore, v2?: boolean): number;
726
+ }
727
+
728
+ 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, ModsAbbreviation, 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,
@@ -45,6 +46,7 @@ __export(osu_api_exports, {
45
46
  MatchScoringType: () => MatchScoringType,
46
47
  MatchTeamType: () => MatchTeamType,
47
48
  Mods: () => Mods,
49
+ ModsAbbreviation: () => ModsAbbreviation,
48
50
  ModsBitField: () => ModsBitField,
49
51
  Replay: () => Replay,
50
52
  ReplayManager: () => ReplayManager,
@@ -60,10 +62,10 @@ __export(osu_api_exports, {
60
62
  module.exports = __toCommonJS(osu_api_exports);
61
63
 
62
64
  // src/Client.ts
63
- var request2 = __toESM(require("superagent"));
65
+ var import_superagent2 = __toESM(require("superagent"));
64
66
 
65
67
  // src/managers/UserManager.ts
66
- var request = __toESM(require("superagent"));
68
+ var import_superagent = __toESM(require("superagent"));
67
69
 
68
70
  // src/types/enums.ts
69
71
  var GameMode = /* @__PURE__ */ ((GameMode3) => {
@@ -112,6 +114,39 @@ var Mods = {
112
114
  ScoreV2: 1n << 29n,
113
115
  Mirror: 1n << 30n
114
116
  };
117
+ var ModsAbbreviation = {
118
+ NoFail: "NF",
119
+ Easy: "EZ",
120
+ TouchDevice: "TD",
121
+ Hidden: "HD",
122
+ HardRock: "HR",
123
+ SuddenDeath: "SD",
124
+ DoubleTime: "DT",
125
+ Relax: "RX",
126
+ HalfTime: "HT",
127
+ Nightcore: "NC",
128
+ Flashlight: "FL",
129
+ Autoplay: "AT",
130
+ SpunOut: "SO",
131
+ AutoPilot: "AP",
132
+ Perfect: "PF",
133
+ Key4: "4K",
134
+ Key5: "5K",
135
+ Key6: "6K",
136
+ Key7: "7K",
137
+ Key8: "8K",
138
+ FadeIn: "FI",
139
+ Random: "RD",
140
+ Cinema: "CM",
141
+ Target: "TP",
142
+ Key9: "9K",
143
+ KeyCoop: "CP",
144
+ Key1: "1K",
145
+ Key3: "3K",
146
+ Key2: "2K",
147
+ ScoreV2: "SV2",
148
+ Mirror: "MR"
149
+ };
115
150
  var BeatmapApprovedState = /* @__PURE__ */ ((BeatmapApprovedState3) => {
116
151
  BeatmapApprovedState3[BeatmapApprovedState3["Graveyard"] = -2] = "Graveyard";
117
152
  BeatmapApprovedState3[BeatmapApprovedState3["WIP"] = -1] = "WIP";
@@ -310,6 +345,82 @@ ModsBitField.KeyMod = Mods.Key1 | Mods.Key2 | Mods.Key3 | Mods.Key4 | Mods.Key5
310
345
  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
346
  ModsBitField.ScoreIncreaseMods = Mods.Hidden | Mods.HardRock | Mods.DoubleTime | Mods.Flashlight | Mods.FadeIn;
312
347
 
348
+ // src/utils/AccuracyCalculator.ts
349
+ var AccuracyCalculator = class {
350
+ static standard(count300, count100, count50, countMiss) {
351
+ const max = count300 + count100 + count50 + countMiss;
352
+ if (!max)
353
+ return 0;
354
+ return (count300 * 300 + count100 * 100 + count50 * 50) / (max * 300);
355
+ }
356
+ static taiko(count300, count100, countMiss) {
357
+ const max = count300 + count100 + countMiss;
358
+ if (!max)
359
+ return 0;
360
+ return (count300 + count100 * 0.5) / max;
361
+ }
362
+ static catch(count300, count100, count50, countKatu, countMiss) {
363
+ const max = count300 + count100 + count50 + countKatu + countMiss;
364
+ if (!max)
365
+ return 0;
366
+ return (count300 + count100 + count50) / max;
367
+ }
368
+ static mania(count300, count100, count50, countKatu, countGeki, countMiss) {
369
+ const max = count300 + count100 + count50 + countKatu + countGeki + countMiss;
370
+ if (!max)
371
+ return 0;
372
+ return (300 * countGeki + 300 * count300 + 200 * countKatu + 100 * count100 + 50 * count50) / (max * 300);
373
+ }
374
+ static maniaV2(count300, count100, count50, countKatu, countGeki, countMiss) {
375
+ const max = count300 + count100 + count50 + countKatu + countGeki + countMiss;
376
+ if (!max)
377
+ return 0;
378
+ return (305 * countGeki + 300 * count300 + 200 * countKatu + 100 * count100 + 50 * count50) / (max * 305);
379
+ }
380
+ static calculate(score, v2 = false) {
381
+ const { statistics } = score;
382
+ switch (score.mode) {
383
+ case 0 /* Standard */:
384
+ return AccuracyCalculator.standard(
385
+ statistics.count300,
386
+ statistics.count100,
387
+ statistics.count50,
388
+ statistics.countMiss
389
+ );
390
+ case 1 /* Taiko */:
391
+ return AccuracyCalculator.taiko(
392
+ statistics.count300,
393
+ statistics.count100,
394
+ statistics.countMiss
395
+ );
396
+ case 2 /* Catch */:
397
+ return AccuracyCalculator.catch(
398
+ statistics.count300,
399
+ statistics.count100,
400
+ statistics.count50,
401
+ statistics.countKatu,
402
+ statistics.countMiss
403
+ );
404
+ case 3 /* Mania */:
405
+ return v2 ? AccuracyCalculator.maniaV2(
406
+ statistics.count300,
407
+ statistics.count100,
408
+ statistics.count50,
409
+ statistics.countKatu,
410
+ statistics.countGeki,
411
+ statistics.countMiss
412
+ ) : AccuracyCalculator.mania(
413
+ statistics.count300,
414
+ statistics.count100,
415
+ statistics.count50,
416
+ statistics.countKatu,
417
+ statistics.countGeki,
418
+ statistics.countMiss
419
+ );
420
+ }
421
+ }
422
+ };
423
+
313
424
  // src/structures/BaseScore.ts
314
425
  var BaseScore = class {
315
426
  constructor(client, data, other) {
@@ -334,6 +445,7 @@ var BaseScore = class {
334
445
  } else {
335
446
  this.beatmapId = other.mapId;
336
447
  }
448
+ this.accuracy = AccuracyCalculator.calculate(this);
337
449
  }
338
450
  async getPlayer(options = {}) {
339
451
  const candidates = await this.client.users.getUser({
@@ -453,6 +565,20 @@ var User = class {
453
565
  const url = await this.client.users.fetchBanner({ id: this.id });
454
566
  return this.banner = url;
455
567
  }
568
+ getBest(options = {}) {
569
+ return this.client.users.getUserBest({
570
+ user: this.id,
571
+ type: "id" /* Id */,
572
+ ...options
573
+ });
574
+ }
575
+ getRecent(options = {}) {
576
+ return this.client.users.getUserRecent({
577
+ user: this.id,
578
+ type: "id" /* Id */,
579
+ ...options
580
+ });
581
+ }
456
582
  };
457
583
 
458
584
  // src/managers/BaseManager.ts
@@ -478,7 +604,7 @@ var UserManager = class extends BaseManager {
478
604
  return res.map((v) => new User(this.client, v));
479
605
  }
480
606
  async fetchBanner({ id }) {
481
- const context = await request.get(`https://osu.ppy.sh/users/${id}`);
607
+ const context = await import_superagent.default.get(`https://osu.ppy.sh/users/${id}`);
482
608
  const banner_regex = new RegExp(`https:\\\\\\/\\\\\\/assets\\.ppy\\.sh\\\\\\/user-profile-covers\\\\\\/${id}\\\\\\/(?<hash>[0-9a-z]*?)\\.(?<ext>.*?)&`, "gm");
483
609
  const banner = banner_regex.exec(context.text);
484
610
  if (banner) {
@@ -806,12 +932,13 @@ var Client = class {
806
932
  async request(options) {
807
933
  if (!options?.path)
808
934
  throw new Error("MISSING_PATH");
809
- const response = await request2.get(`https://osu.ppy.sh/api/${options.path}`).query({ k: this.apiKey }).query(options.queries);
935
+ const response = await import_superagent2.default.get(`https://osu.ppy.sh/api/${options.path}`).query({ k: this.apiKey }).query(options.queries);
810
936
  return response.body;
811
937
  }
812
938
  };
813
939
  // Annotate the CommonJS export names for ESM import in node:
814
940
  0 && (module.exports = {
941
+ AccuracyCalculator,
815
942
  BaseManager,
816
943
  BaseScore,
817
944
  Beatmap,
@@ -830,6 +957,7 @@ var Client = class {
830
957
  MatchScoringType,
831
958
  MatchTeamType,
832
959
  Mods,
960
+ ModsAbbreviation,
833
961
  ModsBitField,
834
962
  Replay,
835
963
  ReplayManager,
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 * as 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, GetUserBestRequstOptions, GetUserRecentRequestOptions, GetUserRequestOptions } from \"../types/interfaces\";\nimport type { APIUser, APIUserBestPerformanceScore, APIUserRecentPlayedScore } from \"../types/osuApiTypes\";\nimport * as 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: GetUserBestRequstOptions) {\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 } from \"../types/interfaces\";\nimport type { APIUser } from \"../types/osuApiTypes\";\nimport type { Client } from \"../Client\";\nimport { UserEvent } from \"./UserEvent\";\nimport { URLBuilder } from \"../utils/URLBuilder\";\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}","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 | APIMatchNot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MAAM,UAAU;AAChB,WAAK,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,MAAc,aAAI,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"]}
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 const ModsAbbreviation = {\n NoFail: 'NF',\n Easy: 'EZ',\n TouchDevice: 'TD',\n Hidden: 'HD', \n HardRock: 'HR',\n SuddenDeath: 'SD',\n DoubleTime: 'DT',\n Relax: 'RX',\n HalfTime: 'HT',\n Nightcore: 'NC',\n Flashlight: 'FL',\n Autoplay: 'AT', \n SpunOut: 'SO',\n AutoPilot: 'AP', \n Perfect: 'PF', \n Key4: '4K', \n Key5: '5K',\n Key6: '6K',\n Key7: '7K', \n Key8: '8K',\n FadeIn: 'FI',\n Random: 'RD', \n Cinema: 'CM',\n Target: 'TP',\n Key9: '9K',\n KeyCoop: 'CP',\n Key1: '1K', \n Key3: '3K', \n Key2: '2K', \n ScoreV2: 'SV2',\n Mirror: 'MR'\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;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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;;;ArBVO,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,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"]}
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  // src/Client.ts
2
- import * as request2 from "superagent";
2
+ import request2 from "superagent";
3
3
 
4
4
  // src/managers/UserManager.ts
5
- import * as request from "superagent";
5
+ import request from "superagent";
6
6
 
7
7
  // src/types/enums.ts
8
8
  var GameMode = /* @__PURE__ */ ((GameMode3) => {
@@ -51,6 +51,39 @@ var Mods = {
51
51
  ScoreV2: 1n << 29n,
52
52
  Mirror: 1n << 30n
53
53
  };
54
+ var ModsAbbreviation = {
55
+ NoFail: "NF",
56
+ Easy: "EZ",
57
+ TouchDevice: "TD",
58
+ Hidden: "HD",
59
+ HardRock: "HR",
60
+ SuddenDeath: "SD",
61
+ DoubleTime: "DT",
62
+ Relax: "RX",
63
+ HalfTime: "HT",
64
+ Nightcore: "NC",
65
+ Flashlight: "FL",
66
+ Autoplay: "AT",
67
+ SpunOut: "SO",
68
+ AutoPilot: "AP",
69
+ Perfect: "PF",
70
+ Key4: "4K",
71
+ Key5: "5K",
72
+ Key6: "6K",
73
+ Key7: "7K",
74
+ Key8: "8K",
75
+ FadeIn: "FI",
76
+ Random: "RD",
77
+ Cinema: "CM",
78
+ Target: "TP",
79
+ Key9: "9K",
80
+ KeyCoop: "CP",
81
+ Key1: "1K",
82
+ Key3: "3K",
83
+ Key2: "2K",
84
+ ScoreV2: "SV2",
85
+ Mirror: "MR"
86
+ };
54
87
  var BeatmapApprovedState = /* @__PURE__ */ ((BeatmapApprovedState3) => {
55
88
  BeatmapApprovedState3[BeatmapApprovedState3["Graveyard"] = -2] = "Graveyard";
56
89
  BeatmapApprovedState3[BeatmapApprovedState3["WIP"] = -1] = "WIP";
@@ -249,6 +282,82 @@ ModsBitField.KeyMod = Mods.Key1 | Mods.Key2 | Mods.Key3 | Mods.Key4 | Mods.Key5
249
282
  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
283
  ModsBitField.ScoreIncreaseMods = Mods.Hidden | Mods.HardRock | Mods.DoubleTime | Mods.Flashlight | Mods.FadeIn;
251
284
 
285
+ // src/utils/AccuracyCalculator.ts
286
+ var AccuracyCalculator = class {
287
+ static standard(count300, count100, count50, countMiss) {
288
+ const max = count300 + count100 + count50 + countMiss;
289
+ if (!max)
290
+ return 0;
291
+ return (count300 * 300 + count100 * 100 + count50 * 50) / (max * 300);
292
+ }
293
+ static taiko(count300, count100, countMiss) {
294
+ const max = count300 + count100 + countMiss;
295
+ if (!max)
296
+ return 0;
297
+ return (count300 + count100 * 0.5) / max;
298
+ }
299
+ static catch(count300, count100, count50, countKatu, countMiss) {
300
+ const max = count300 + count100 + count50 + countKatu + countMiss;
301
+ if (!max)
302
+ return 0;
303
+ return (count300 + count100 + count50) / max;
304
+ }
305
+ static mania(count300, count100, count50, countKatu, countGeki, countMiss) {
306
+ const max = count300 + count100 + count50 + countKatu + countGeki + countMiss;
307
+ if (!max)
308
+ return 0;
309
+ return (300 * countGeki + 300 * count300 + 200 * countKatu + 100 * count100 + 50 * count50) / (max * 300);
310
+ }
311
+ static maniaV2(count300, count100, count50, countKatu, countGeki, countMiss) {
312
+ const max = count300 + count100 + count50 + countKatu + countGeki + countMiss;
313
+ if (!max)
314
+ return 0;
315
+ return (305 * countGeki + 300 * count300 + 200 * countKatu + 100 * count100 + 50 * count50) / (max * 305);
316
+ }
317
+ static calculate(score, v2 = false) {
318
+ const { statistics } = score;
319
+ switch (score.mode) {
320
+ case 0 /* Standard */:
321
+ return AccuracyCalculator.standard(
322
+ statistics.count300,
323
+ statistics.count100,
324
+ statistics.count50,
325
+ statistics.countMiss
326
+ );
327
+ case 1 /* Taiko */:
328
+ return AccuracyCalculator.taiko(
329
+ statistics.count300,
330
+ statistics.count100,
331
+ statistics.countMiss
332
+ );
333
+ case 2 /* Catch */:
334
+ return AccuracyCalculator.catch(
335
+ statistics.count300,
336
+ statistics.count100,
337
+ statistics.count50,
338
+ statistics.countKatu,
339
+ statistics.countMiss
340
+ );
341
+ case 3 /* Mania */:
342
+ return v2 ? AccuracyCalculator.maniaV2(
343
+ statistics.count300,
344
+ statistics.count100,
345
+ statistics.count50,
346
+ statistics.countKatu,
347
+ statistics.countGeki,
348
+ statistics.countMiss
349
+ ) : AccuracyCalculator.mania(
350
+ statistics.count300,
351
+ statistics.count100,
352
+ statistics.count50,
353
+ statistics.countKatu,
354
+ statistics.countGeki,
355
+ statistics.countMiss
356
+ );
357
+ }
358
+ }
359
+ };
360
+
252
361
  // src/structures/BaseScore.ts
253
362
  var BaseScore = class {
254
363
  constructor(client, data, other) {
@@ -273,6 +382,7 @@ var BaseScore = class {
273
382
  } else {
274
383
  this.beatmapId = other.mapId;
275
384
  }
385
+ this.accuracy = AccuracyCalculator.calculate(this);
276
386
  }
277
387
  async getPlayer(options = {}) {
278
388
  const candidates = await this.client.users.getUser({
@@ -392,6 +502,20 @@ var User = class {
392
502
  const url = await this.client.users.fetchBanner({ id: this.id });
393
503
  return this.banner = url;
394
504
  }
505
+ getBest(options = {}) {
506
+ return this.client.users.getUserBest({
507
+ user: this.id,
508
+ type: "id" /* Id */,
509
+ ...options
510
+ });
511
+ }
512
+ getRecent(options = {}) {
513
+ return this.client.users.getUserRecent({
514
+ user: this.id,
515
+ type: "id" /* Id */,
516
+ ...options
517
+ });
518
+ }
395
519
  };
396
520
 
397
521
  // src/managers/BaseManager.ts
@@ -750,6 +874,7 @@ var Client = class {
750
874
  }
751
875
  };
752
876
  export {
877
+ AccuracyCalculator,
753
878
  BaseManager,
754
879
  BaseScore,
755
880
  Beatmap,
@@ -768,6 +893,7 @@ export {
768
893
  MatchScoringType,
769
894
  MatchTeamType,
770
895
  Mods,
896
+ ModsAbbreviation,
771
897
  ModsBitField,
772
898
  Replay,
773
899
  ReplayManager,
@@ -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 * as 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, GetUserBestRequstOptions, GetUserRecentRequestOptions, GetUserRequestOptions } from \"../types/interfaces\";\nimport type { APIUser, APIUserBestPerformanceScore, APIUserRecentPlayedScore } from \"../types/osuApiTypes\";\nimport * as 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: GetUserBestRequstOptions) {\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 } from \"../types/interfaces\";\nimport type { APIUser } from \"../types/osuApiTypes\";\nimport type { Client } from \"../Client\";\nimport { UserEvent } from \"./UserEvent\";\nimport { URLBuilder } from \"../utils/URLBuilder\";\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}","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,YAAYA,cAAa;;;ACCzB,YAAY,aAAa;;;ACFlB,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,EACtB,MAAgB,MAAM;AAAA,EACtB,MAAgB,MAAM;AAAA,EACtB,MAAgB,MAAM;AAAA,EACtB,MAAgB,MAAM;AAAA,EACtB,MAAgB,MAAM;AAAA,EACtB,QAAgB,MAAM;AAAA,EACtB,QAAgB,MAAM;AA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AAM;AAClB,SAAK,UAAU,IAAI,KAAK,MAAM,UAAU;AACxC,QAAI,MAAM,UAAU;AAChB,WAAK,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,MAAc,aAAI,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"]}
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 const ModsAbbreviation = {\n NoFail: 'NF',\n Easy: 'EZ',\n TouchDevice: 'TD',\n Hidden: 'HD', \n HardRock: 'HR',\n SuddenDeath: 'SD',\n DoubleTime: 'DT',\n Relax: 'RX',\n HalfTime: 'HT',\n Nightcore: 'NC',\n Flashlight: 'FL',\n Autoplay: 'AT', \n SpunOut: 'SO',\n AutoPilot: 'AP', \n Perfect: 'PF', \n Key4: '4K', \n Key5: '5K',\n Key6: '6K',\n Key7: '7K', \n Key8: '8K',\n FadeIn: 'FI',\n Random: 'RD', \n Cinema: 'CM',\n Target: 'TP',\n Key9: '9K',\n KeyCoop: 'CP',\n Key1: '1K', \n Key3: '3K', \n Key2: '2K', \n ScoreV2: 'SV2',\n Mirror: 'MR'\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;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,EACtB,MAAgB,MAAM;AAAA,EACtB,MAAgB,MAAM;AAAA,EACtB,MAAgB,MAAM;AAAA,EACtB,MAAgB,MAAM;AAAA,EACtB,MAAgB,MAAM;AAAA,EACtB,QAAgB,MAAM;AAAA,EACtB,QAAgB,MAAM;AAAA,EACtB,QAAgB,MAAM;AAAA,EACtB,QAAgB,MAAM;AAAA,EACtB,MAAgB,MAAM;AAAA,EACtB,SAAgB,MAAM;AAAA,EACtB,MAAgB,MAAM;AAAA,EACtB,MAAgB,MAAM;AAAA,EACtB,MAAgB,MAAM;AAAA,EACtB,SAAgB,MAAM;AAAA,EACtB,QAAgB,MAAM;AAC1B;AAE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AACxC,QAAI,MAAM,UAAU;AAChB,WAAK,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;;;ArBVO,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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hizollo/osu-api",
3
- "version": "0.0.0",
3
+ "version": "1.2.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",