@wise-old-man/utils 3.3.15 → 4.0.1

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/es/index.mjs CHANGED
@@ -1,8 +1,3 @@
1
- var config = {
2
- defaultUserAgent: `WiseOldMan JS Client v${process.env.npm_package_version}`,
3
- baseAPIUrl: 'https://api.wiseoldman.net/v2'
4
- };
5
-
6
1
  /******************************************************************************
7
2
  Copyright (c) Microsoft Corporation.
8
3
 
@@ -196,750 +191,141 @@ class BaseAPIClient {
196
191
  }
197
192
  }
198
193
 
199
- class DeltasClient extends BaseAPIClient {
194
+ class CompetitionsClient extends BaseAPIClient {
200
195
  /**
201
- * Fetches the current top leaderboard for a specific metric, period, playerType, playerBuild and country.
202
- * @returns A list of deltas, with their respective players, values and dates included.
196
+ * Searches for competitions that match a title, type, metric and status filter.
197
+ * @returns A list of competitions.
203
198
  */
204
- getDeltaLeaderboard(filter) {
205
- return this.getRequest('/deltas/leaderboard', filter);
199
+ searchCompetitions(filter, pagination) {
200
+ return this.getRequest('/competitions', Object.assign(Object.assign({}, filter), pagination));
206
201
  }
207
- }
208
-
209
- class GroupsClient extends BaseAPIClient {
210
202
  /**
211
- * Searches for groups that match a partial name.
212
- * @returns A list of groups.
203
+ * Fetches the competition's full details, including all the participants and their progress.
204
+ * @returns A competition with a list of participants.
213
205
  */
214
- searchGroups(name, pagination) {
215
- return this.getRequest('/groups', Object.assign({ name }, pagination));
206
+ getCompetitionDetails(id, previewMetric) {
207
+ return this.getRequest(`/competitions/${id}`, { metric: previewMetric });
216
208
  }
217
209
  /**
218
- * Fetches a group's details, including a list of membership objects.
219
- * @returns A group details object.
210
+ * Fetches the competition's participant list in CSV format.
211
+ * @returns A string containing the CSV content.
220
212
  */
221
- getGroupDetails(id) {
222
- return this.getRequest(`/groups/${id}`);
213
+ getCompetitionDetailsCSV(id, params) {
214
+ return this.getText(`/competitions/${id}/csv`, Object.assign({ metric: params.previewMetric }, params));
223
215
  }
224
216
  /**
225
- * Creates a new group.
226
- * @returns The newly created group, and the verification code that authorizes future changes to it.
217
+ * Fetches all the values (exp, kc, etc) in chronological order within the bounds
218
+ * of the competition, for the top 5 participants.
219
+ * @returns A list of competition progress objects, including the player and their value history over time.
227
220
  */
228
- createGroup(payload) {
229
- return this.postRequest('/groups', payload);
221
+ getCompetitionTopHistory(id, previewMetric) {
222
+ return this.getRequest(`/competitions/${id}/top-history`, {
223
+ metric: previewMetric
224
+ });
230
225
  }
231
226
  /**
232
- * Edits an existing group.
233
- * @returns The updated group.
227
+ * Creates a new competition.
228
+ * @returns The newly created competition, and the verification code that authorizes future changes to it.
234
229
  */
235
- editGroup(id, payload, verificationCode) {
236
- return this.putRequest(`/groups/${id}`, Object.assign(Object.assign({}, payload), { verificationCode }));
230
+ createCompetition(payload) {
231
+ return this.postRequest('/competitions', payload);
237
232
  }
238
233
  /**
239
- * Deletes an existing group.
240
- * @returns A confirmation message.
234
+ * Edits an existing competition.
235
+ * @returns The updated competition.
241
236
  */
242
- deleteGroup(id, verificationCode) {
243
- return this.deleteRequest(`/groups/${id}`, { verificationCode });
237
+ editCompetition(id, payload, verificationCode) {
238
+ return this.putRequest(`/competitions/${id}`, Object.assign(Object.assign({}, payload), { verificationCode }));
244
239
  }
245
240
  /**
246
- * Adds all (valid) given usernames (and roles) to a group, ignoring duplicates.
247
- * @returns The number of members added and a confirmation message.
241
+ * Deletes an existing competition.
242
+ * @returns A confirmation message.
248
243
  */
249
- addMembers(id, members, verificationCode) {
250
- return this.postRequest(`/groups/${id}/members`, {
251
- verificationCode,
252
- members
253
- });
244
+ deleteCompetition(id, verificationCode) {
245
+ return this.deleteRequest(`/competitions/${id}`, { verificationCode });
254
246
  }
255
247
  /**
256
- * Remove all given usernames from a group, ignoring usernames that aren't members.
257
- * @returns The number of members removed and a confirmation message.
248
+ * Adds all (valid) given participants to a competition, ignoring duplicates.
249
+ * @returns The number of participants added and a confirmation message.
258
250
  */
259
- removeMembers(id, usernames, verificationCode) {
260
- return this.deleteRequest(`/groups/${id}/members`, {
251
+ addParticipants(id, participants, verificationCode) {
252
+ return this.postRequest(`/competitions/${id}/participants`, {
261
253
  verificationCode,
262
- members: usernames
254
+ participants
263
255
  });
264
256
  }
265
257
  /**
266
- * Changes a player's role in a given group.
267
- * @returns The updated membership, with player included.
268
- */
269
- changeRole(id, payload, verificationCode) {
270
- return this.putRequest(`/groups/${id}/role`, Object.assign(Object.assign({}, payload), { verificationCode }));
271
- }
272
- /**
273
- * Adds an "update" request to the queue, for each outdated group member.
274
- * @returns The number of players to be updated and a confirmation message.
258
+ * Remove all given usernames from a competition, ignoring usernames that aren't competing.
259
+ * @returns The number of participants removed and a confirmation message.
275
260
  */
276
- updateAll(id, verificationCode) {
277
- return this.postRequest(`/groups/${id}/update-all`, {
278
- verificationCode
261
+ removeParticipants(id, participants, verificationCode) {
262
+ return this.deleteRequest(`/competitions/${id}/participants`, {
263
+ verificationCode,
264
+ participants
279
265
  });
280
266
  }
281
267
  /**
282
- * Fetches all of the groups's competitions
283
- * @returns A list of competitions.
284
- */
285
- getGroupCompetitions(id, pagination) {
286
- return this.getRequest(`/groups/${id}/competitions`, Object.assign({}, pagination));
287
- }
288
- getGroupGains(id, filter, pagination) {
289
- return this.getRequest(`/groups/${id}/gained`, Object.assign(Object.assign({}, pagination), filter));
290
- }
291
- /**
292
- * Fetches a group members' latest achievements.
293
- * @returns A list of achievements.
294
- */
295
- getGroupAchievements(id, pagination) {
296
- return this.getRequest(`/groups/${id}/achievements`, Object.assign({}, pagination));
297
- }
298
- /**
299
- * Fetches a group's record leaderboard for a specific metric and period.
300
- * @returns A list of records, including their respective players.
301
- */
302
- getGroupRecords(id, filter, pagination) {
303
- return this.getRequest(`/groups/${id}/records`, Object.assign(Object.assign({}, pagination), filter));
304
- }
305
- /**
306
- * Fetches a group's hiscores for a specific metric.
307
- * @returns A list of hiscores entries (value, rank), including their respective players.
308
- */
309
- getGroupHiscores(id, metric, pagination) {
310
- return this.getRequest(`/groups/${id}/hiscores`, Object.assign(Object.assign({}, pagination), { metric }));
311
- }
312
- /**
313
- * Fetches a group members' latest name changes.
314
- * @returns A list of name change (approved) requests.
315
- */
316
- getGroupNameChanges(id, pagination) {
317
- return this.getRequest(`/groups/${id}/name-changes`, Object.assign({}, pagination));
318
- }
319
- /**
320
- * Fetches a group's general statistics.
321
- * @returns An object with a few statistic values and an average stats snapshot.
268
+ * Adds all (valid) given teams to a team competition, ignoring duplicates.
269
+ * @returns The number of participants added and a confirmation message.
322
270
  */
323
- getGroupStatistics(id) {
324
- return this.getRequest(`/groups/${id}/statistics`);
271
+ addTeams(id, teams, verificationCode) {
272
+ return this.postRequest(`/competitions/${id}/teams`, {
273
+ verificationCode,
274
+ teams
275
+ });
325
276
  }
326
277
  /**
327
- * Fetches a group's activity.
328
- * @returns A list of a group's (join, leave and role changed) activity.
278
+ * Remove all given team names from a competition, ignoring names that don't exist.
279
+ * @returns The number of participants removed and a confirmation message.
329
280
  */
330
- getGroupActivity(id, pagination) {
331
- return this.getRequest(`/groups/${id}/activity`, Object.assign({}, pagination));
281
+ removeTeams(id, teamNames, verificationCode) {
282
+ return this.deleteRequest(`/competitions/${id}/teams`, {
283
+ verificationCode,
284
+ teamNames
285
+ });
332
286
  }
333
287
  /**
334
- * Fetches the groups's member list in CSV format.
335
- * @returns A string containing the CSV content.
288
+ * Adds an "update" request to the queue, for each outdated competition participant.
289
+ * @returns The number of players to be updated and a confirmation message.
336
290
  */
337
- getMembersCSV(id) {
338
- return this.getText(`/groups/${id}/csv`);
291
+ updateAll(id, verificationCode) {
292
+ return this.postRequest(`/competitions/${id}/update-all`, {
293
+ verificationCode
294
+ });
339
295
  }
340
296
  }
341
297
 
342
- class PlayersClient extends BaseAPIClient {
343
- /**
344
- * Searches players by partial username.
345
- * @returns A list of players.
346
- */
347
- searchPlayers(partialUsername, pagination) {
348
- return this.getRequest('/players/search', Object.assign({ username: partialUsername }, pagination));
349
- }
350
- /**
351
- * Updates/tracks a player.
352
- * @returns The player's new details, including the latest snapshot.
353
- */
354
- updatePlayer(username) {
355
- return this.postRequest(`/players/${username}`);
356
- }
357
- /**
358
- * Asserts (and attempts to fix, if necessary) a player's game-mode type.
359
- * @returns The updated player, and an indication of whether the type was changed.
360
- */
361
- assertPlayerType(username) {
362
- return this.postRequest(`/players/${username}/assert-type`);
363
- }
364
- /**
365
- * Fetches a player's details.
366
- * @returns The player's details, including the latest snapshot.
367
- */
368
- getPlayerDetails(username) {
369
- return this.getRequest(`/players/${username}`);
370
- }
371
- /**
372
- * Fetches a player's details by ID.
373
- * @returns The player's details, including the latest snapshot.
374
- */
375
- getPlayerDetailsById(id) {
376
- return this.getRequest(`/players/id/${id}`);
377
- }
378
- /**
379
- * Fetches a player's current achievements.
380
- * @returns A list of achievements.
381
- */
382
- getPlayerAchievements(username) {
383
- return this.getRequest(`/players/${username}/achievements`);
384
- }
385
- /**
386
- * Fetches a player's current achievement progress.
387
- * @returns A list of achievements (completed or otherwise), with their respective relative/absolute progress percentage.
388
- */
389
- getPlayerAchievementProgress(username) {
390
- return this.getRequest(`/players/${username}/achievements/progress`);
391
- }
392
- /**
393
- * Fetches all of the player's competition participations.
394
- * @returns A list of participations, with the respective competition included.
395
- */
396
- getPlayerCompetitions(username, filter, pagination) {
397
- return this.getRequest(`/players/${username}/competitions`, Object.assign(Object.assign({}, filter), pagination));
398
- }
399
- /**
400
- * Fetches all of the player's competition participations' standings.
401
- * @returns A list of participations, with the respective competition, rank and progress included.
402
- */
403
- getPlayerCompetitionStandings(username, filter) {
404
- return this.getRequest(`/players/${username}/competitions/standings`, filter);
405
- }
406
- /**
407
- * Fetches all of the player's group memberships.
408
- * @returns A list of memberships, with the respective group included.
409
- */
410
- getPlayerGroups(username, pagination) {
411
- return this.getRequest(`/players/${username}/groups`, pagination);
412
- }
298
+ class DeltasClient extends BaseAPIClient {
413
299
  /**
414
- * Fetches a player's gains, for a specific period or time range, as a [metric: data] map.
415
- * @returns A map of each metric's gained data.
300
+ * Fetches the current top leaderboard for a specific metric, period, playerType, playerBuild and country.
301
+ * @returns A list of deltas, with their respective players, values and dates included.
416
302
  */
417
- getPlayerGains(username, options) {
418
- return this.getRequest(`/players/${username}/gained`, options);
419
- }
420
- /**
421
- * Fetches all of the player's records.
422
- * @returns A list of records.
423
- */
424
- getPlayerRecords(username, options) {
425
- return this.getRequest(`/players/${username}/records`, options);
426
- }
427
- /**
428
- * Fetches all of the player's past snapshots.
429
- * @returns A list of snapshots.
430
- */
431
- getPlayerSnapshots(username, filter, pagination) {
432
- return this.getRequest(`/players/${username}/snapshots`, Object.assign(Object.assign({}, filter), pagination));
433
- }
434
- /**
435
- * Fetches all of the player's past snapshots' timeline.
436
- * @returns A list of timeseries data (value, rank, date)
437
- */
438
- getPlayerSnapshotTimeline(username, metric, options) {
439
- return this.getRequest(`/players/${username}/snapshots/timeline`, Object.assign(Object.assign({}, options), { metric }));
440
- }
441
- /**
442
- * Fetches all of the player's approved name changes.
443
- * @returns A list of name changes.
444
- */
445
- getPlayerNames(username) {
446
- return this.getRequest(`/players/${username}/names`);
447
- }
448
- /**
449
- * Fetches all of archived players that previously held this username.
450
- * @returns A list of player archives.
451
- */
452
- getPlayerArchives(username) {
453
- return this.getRequest(`/players/${username}/archives`);
303
+ getDeltaLeaderboard(filter) {
304
+ return this.getRequest('/deltas/leaderboard', filter);
454
305
  }
455
306
  }
456
307
 
457
- class RecordsClient extends BaseAPIClient {
458
- /**
459
- * Fetches the current records leaderboard for a specific metric, period, playerType, playerBuild and country.
460
- * @returns A list of records, with their respective players, dates and values included.
461
- */
462
- getRecordLeaderboard(filter) {
463
- return this.getRequest('/records/leaderboard', filter);
464
- }
465
- }
308
+ var CompetitionCSVTableType;
309
+ (function (CompetitionCSVTableType) {
310
+ CompetitionCSVTableType["TEAM"] = "team";
311
+ CompetitionCSVTableType["TEAMS"] = "teams";
312
+ CompetitionCSVTableType["PARTICIPANTS"] = "participants";
313
+ })(CompetitionCSVTableType || (CompetitionCSVTableType = {}));
314
+
315
+ var CompetitionStatus;
316
+ (function (CompetitionStatus) {
317
+ CompetitionStatus["UPCOMING"] = "upcoming";
318
+ CompetitionStatus["ONGOING"] = "ongoing";
319
+ CompetitionStatus["FINISHED"] = "finished";
320
+ })(CompetitionStatus || (CompetitionStatus = {}));
321
+ const COMPETITION_STATUSES = Object.values(CompetitionStatus);
466
322
 
467
- /**
468
- * Prisma currently seems to ignore the @map() in enum declarations.
469
- *
470
- * So by declaring this enum in the schema file:
471
- *
472
- * enum NameChangeStatus {
473
- * PENDING @map('pending')
474
- * DENIED @map('denied')
475
- * APPROVED @map('approved')
476
- * }
477
- *
478
- * you would expect the prisma client to then generate the following object:
479
- *
480
- * const NameChangeStatus = {
481
- * PENDING: 'pending',
482
- * DENIED: 'denied',
483
- * APPROVED: 'approved',
484
- * }
485
- *
486
- * but unfortunately, the mapping is only used for queries, and the actual esulting object is this:
487
- *
488
- * const NameChangeStatus = {
489
- * PENDING: 'PENDING',
490
- * DENIED: 'DENIED',
491
- * APPROVED: 'APPROVED',
492
- * }
493
- *
494
- * And because I'd hate having to call enum values in lowercase, like:
495
- * NameChangeStatus.pending
496
- * Metric.king_black_dragon
497
- * Period.day
498
- *
499
- * I'd rather do some mapping to ensure I have the best of both worlds,
500
- * lowercase database values, but with uppercase in code.
501
- * With the mappings below, we can now use prisma enums by calling them with uppercase, like:
502
- *
503
- * NameChangeStatus.PENDING
504
- * Metric.KING_BLACK_DRAGON
505
- * Period.DAY
506
- *
507
- */
508
- const Skill = {
509
- OVERALL: 'overall',
510
- ATTACK: 'attack',
511
- DEFENCE: 'defence',
512
- STRENGTH: 'strength',
513
- HITPOINTS: 'hitpoints',
514
- RANGED: 'ranged',
515
- PRAYER: 'prayer',
516
- MAGIC: 'magic',
517
- COOKING: 'cooking',
518
- WOODCUTTING: 'woodcutting',
519
- FLETCHING: 'fletching',
520
- FISHING: 'fishing',
521
- FIREMAKING: 'firemaking',
522
- CRAFTING: 'crafting',
523
- SMITHING: 'smithing',
524
- MINING: 'mining',
525
- HERBLORE: 'herblore',
526
- AGILITY: 'agility',
527
- THIEVING: 'thieving',
528
- SLAYER: 'slayer',
529
- FARMING: 'farming',
530
- RUNECRAFTING: 'runecrafting',
531
- HUNTER: 'hunter',
532
- CONSTRUCTION: 'construction'
533
- };
534
- const Activity = {
535
- LEAGUE_POINTS: 'league_points',
536
- BOUNTY_HUNTER_HUNTER: 'bounty_hunter_hunter',
537
- BOUNTY_HUNTER_ROGUE: 'bounty_hunter_rogue',
538
- CLUE_SCROLLS_ALL: 'clue_scrolls_all',
539
- CLUE_SCROLLS_BEGINNER: 'clue_scrolls_beginner',
540
- CLUE_SCROLLS_EASY: 'clue_scrolls_easy',
541
- CLUE_SCROLLS_MEDIUM: 'clue_scrolls_medium',
542
- CLUE_SCROLLS_HARD: 'clue_scrolls_hard',
543
- CLUE_SCROLLS_ELITE: 'clue_scrolls_elite',
544
- CLUE_SCROLLS_MASTER: 'clue_scrolls_master',
545
- LAST_MAN_STANDING: 'last_man_standing',
546
- PVP_ARENA: 'pvp_arena',
547
- SOUL_WARS_ZEAL: 'soul_wars_zeal',
548
- GUARDIANS_OF_THE_RIFT: 'guardians_of_the_rift',
549
- COLOSSEUM_GLORY: 'colosseum_glory',
550
- COLLECTIONS_LOGGED: 'collections_logged'
551
- };
552
- const Boss = {
553
- ABYSSAL_SIRE: 'abyssal_sire',
554
- ALCHEMICAL_HYDRA: 'alchemical_hydra',
555
- AMOXLIATL: 'amoxliatl',
556
- ARAXXOR: 'araxxor',
557
- ARTIO: 'artio',
558
- BARROWS_CHESTS: 'barrows_chests',
559
- BRYOPHYTA: 'bryophyta',
560
- CALLISTO: 'callisto',
561
- CALVARION: 'calvarion',
562
- CERBERUS: 'cerberus',
563
- CHAMBERS_OF_XERIC: 'chambers_of_xeric',
564
- CHAMBERS_OF_XERIC_CM: 'chambers_of_xeric_challenge_mode',
565
- CHAOS_ELEMENTAL: 'chaos_elemental',
566
- CHAOS_FANATIC: 'chaos_fanatic',
567
- COMMANDER_ZILYANA: 'commander_zilyana',
568
- CORPOREAL_BEAST: 'corporeal_beast',
569
- CRAZY_ARCHAEOLOGIST: 'crazy_archaeologist',
570
- DAGANNOTH_PRIME: 'dagannoth_prime',
571
- DAGANNOTH_REX: 'dagannoth_rex',
572
- DAGANNOTH_SUPREME: 'dagannoth_supreme',
573
- DERANGED_ARCHAEOLOGIST: 'deranged_archaeologist',
574
- DOOM_OF_MOKHAIOTL: 'doom_of_mokhaiotl',
575
- DUKE_SUCELLUS: 'duke_sucellus',
576
- GENERAL_GRAARDOR: 'general_graardor',
577
- GIANT_MOLE: 'giant_mole',
578
- GROTESQUE_GUARDIANS: 'grotesque_guardians',
579
- HESPORI: 'hespori',
580
- KALPHITE_QUEEN: 'kalphite_queen',
581
- KING_BLACK_DRAGON: 'king_black_dragon',
582
- KRAKEN: 'kraken',
583
- KREEARRA: 'kreearra',
584
- KRIL_TSUTSAROTH: 'kril_tsutsaroth',
585
- LUNAR_CHESTS: 'lunar_chests',
586
- MIMIC: 'mimic',
587
- NEX: 'nex',
588
- NIGHTMARE: 'nightmare',
589
- PHOSANIS_NIGHTMARE: 'phosanis_nightmare',
590
- OBOR: 'obor',
591
- PHANTOM_MUSPAH: 'phantom_muspah',
592
- SARACHNIS: 'sarachnis',
593
- SCORPIA: 'scorpia',
594
- SCURRIUS: 'scurrius',
595
- SKOTIZO: 'skotizo',
596
- SOL_HEREDIT: 'sol_heredit',
597
- SPINDEL: 'spindel',
598
- TEMPOROSS: 'tempoross',
599
- THE_GAUNTLET: 'the_gauntlet',
600
- THE_CORRUPTED_GAUNTLET: 'the_corrupted_gauntlet',
601
- THE_HUEYCOATL: 'the_hueycoatl',
602
- THE_LEVIATHAN: 'the_leviathan',
603
- THE_ROYAL_TITANS: 'the_royal_titans',
604
- THE_WHISPERER: 'the_whisperer',
605
- THEATRE_OF_BLOOD: 'theatre_of_blood',
606
- THEATRE_OF_BLOOD_HARD_MODE: 'theatre_of_blood_hard_mode',
607
- THERMONUCLEAR_SMOKE_DEVIL: 'thermonuclear_smoke_devil',
608
- TOMBS_OF_AMASCUT: 'tombs_of_amascut',
609
- TOMBS_OF_AMASCUT_EXPERT: 'tombs_of_amascut_expert',
610
- TZKAL_ZUK: 'tzkal_zuk',
611
- TZTOK_JAD: 'tztok_jad',
612
- VARDORVIS: 'vardorvis',
613
- VENENATIS: 'venenatis',
614
- VETION: 'vetion',
615
- VORKATH: 'vorkath',
616
- WINTERTODT: 'wintertodt',
617
- YAMA: 'yama',
618
- ZALCANO: 'zalcano',
619
- ZULRAH: 'zulrah'
620
- };
621
- const ComputedMetric = {
622
- EHP: 'ehp',
623
- EHB: 'ehb'
624
- };
625
- const Metric = Object.assign(Object.assign(Object.assign(Object.assign({}, Skill), Activity), Boss), ComputedMetric);
626
- const NameChangeStatus = {
627
- PENDING: 'pending',
628
- DENIED: 'denied',
629
- APPROVED: 'approved'
630
- };
631
- const Period = {
632
- FIVE_MIN: 'five_min',
633
- DAY: 'day',
634
- WEEK: 'week',
635
- MONTH: 'month',
636
- YEAR: 'year'
637
- };
638
- const PlayerType = {
639
- UNKNOWN: 'unknown',
640
- REGULAR: 'regular',
641
- IRONMAN: 'ironman',
642
- HARDCORE: 'hardcore',
643
- ULTIMATE: 'ultimate'
644
- };
645
- const PlayerAnnotationType = {
646
- OPT_OUT: 'opt_out',
647
- OPT_OUT_GROUPS: 'opt_out_groups',
648
- OPT_OUT_COMPETITIONS: 'opt_out_competitions',
649
- BLOCKED: 'blocked',
650
- FAKE_F2P: 'fake_f2p'
651
- };
652
- const PlayerBuild = {
653
- MAIN: 'main',
654
- F2P: 'f2p',
655
- F2P_LVL3: 'f2p_lvl3',
656
- LVL3: 'lvl3',
657
- ZERKER: 'zerker',
658
- DEF1: 'def1',
659
- HP10: 'hp10'
660
- };
661
- const PlayerStatus = {
662
- ACTIVE: 'active',
663
- UNRANKED: 'unranked',
664
- FLAGGED: 'flagged',
665
- ARCHIVED: 'archived',
666
- BANNED: 'banned'
667
- };
668
323
  const CompetitionType = {
669
324
  CLASSIC: 'classic',
670
325
  TEAM: 'team'
671
326
  };
672
- const GroupRole = {
673
- ACHIEVER: 'achiever',
674
- ADAMANT: 'adamant',
675
- ADEPT: 'adept',
676
- ADMINISTRATOR: 'administrator',
677
- ADMIRAL: 'admiral',
678
- ADVENTURER: 'adventurer',
679
- AIR: 'air',
680
- ANCHOR: 'anchor',
681
- APOTHECARY: 'apothecary',
682
- ARCHER: 'archer',
683
- ARMADYLEAN: 'armadylean',
684
- ARTILLERY: 'artillery',
685
- ARTISAN: 'artisan',
686
- ASGARNIAN: 'asgarnian',
687
- ASSASSIN: 'assassin',
688
- ASSISTANT: 'assistant',
689
- ASTRAL: 'astral',
690
- ATHLETE: 'athlete',
691
- ATTACKER: 'attacker',
692
- BANDIT: 'bandit',
693
- BANDOSIAN: 'bandosian',
694
- BARBARIAN: 'barbarian',
695
- BATTLEMAGE: 'battlemage',
696
- BEAST: 'beast',
697
- BERSERKER: 'berserker',
698
- BLISTERWOOD: 'blisterwood',
699
- BLOOD: 'blood',
700
- BLUE: 'blue',
701
- BOB: 'bob',
702
- BODY: 'body',
703
- BRASSICAN: 'brassican',
704
- BRAWLER: 'brawler',
705
- BRIGADIER: 'brigadier',
706
- BRIGAND: 'brigand',
707
- BRONZE: 'bronze',
708
- BRUISER: 'bruiser',
709
- BULWARK: 'bulwark',
710
- BURGLAR: 'burglar',
711
- BURNT: 'burnt',
712
- CADET: 'cadet',
713
- CAPTAIN: 'captain',
714
- CARRY: 'carry',
715
- CHAMPION: 'champion',
716
- CHAOS: 'chaos',
717
- CLERIC: 'cleric',
718
- COLLECTOR: 'collector',
719
- COLONEL: 'colonel',
720
- COMMANDER: 'commander',
721
- COMPETITOR: 'competitor',
722
- COMPLETIONIST: 'completionist',
723
- CONSTRUCTOR: 'constructor',
724
- COOK: 'cook',
725
- COORDINATOR: 'coordinator',
726
- CORPORAL: 'corporal',
727
- COSMIC: 'cosmic',
728
- COUNCILLOR: 'councillor',
729
- CRAFTER: 'crafter',
730
- CREW: 'crew',
731
- CRUSADER: 'crusader',
732
- CUTPURSE: 'cutpurse',
733
- DEATH: 'death',
734
- DEFENDER: 'defender',
735
- DEFILER: 'defiler',
736
- DEPUTY_OWNER: 'deputy_owner',
737
- DESTROYER: 'destroyer',
738
- DIAMOND: 'diamond',
739
- DISEASED: 'diseased',
740
- DOCTOR: 'doctor',
741
- DOGSBODY: 'dogsbody',
742
- DRAGON: 'dragon',
743
- DRAGONSTONE: 'dragonstone',
744
- DRUID: 'druid',
745
- DUELLIST: 'duellist',
746
- EARTH: 'earth',
747
- ELITE: 'elite',
748
- EMERALD: 'emerald',
749
- ENFORCER: 'enforcer',
750
- EPIC: 'epic',
751
- EXECUTIVE: 'executive',
752
- EXPERT: 'expert',
753
- EXPLORER: 'explorer',
754
- FARMER: 'farmer',
755
- FEEDER: 'feeder',
756
- FIGHTER: 'fighter',
757
- FIRE: 'fire',
758
- FIREMAKER: 'firemaker',
759
- FIRESTARTER: 'firestarter',
760
- FISHER: 'fisher',
761
- FLETCHER: 'fletcher',
762
- FORAGER: 'forager',
763
- FREMENNIK: 'fremennik',
764
- GAMER: 'gamer',
765
- GATHERER: 'gatherer',
766
- GENERAL: 'general',
767
- GNOME_CHILD: 'gnome_child',
768
- GNOME_ELDER: 'gnome_elder',
769
- GOBLIN: 'goblin',
770
- GOLD: 'gold',
771
- GOON: 'goon',
772
- GREEN: 'green',
773
- GREY: 'grey',
774
- GUARDIAN: 'guardian',
775
- GUTHIXIAN: 'guthixian',
776
- HARPOON: 'harpoon',
777
- HEALER: 'healer',
778
- HELLCAT: 'hellcat',
779
- HELPER: 'helper',
780
- HERBOLOGIST: 'herbologist',
781
- HERO: 'hero',
782
- HOLY: 'holy',
783
- HOARDER: 'hoarder',
784
- HUNTER: 'hunter',
785
- IGNITOR: 'ignitor',
786
- ILLUSIONIST: 'illusionist',
787
- IMP: 'imp',
788
- INFANTRY: 'infantry',
789
- INQUISITOR: 'inquisitor',
790
- IRON: 'iron',
791
- JADE: 'jade',
792
- JUSTICIAR: 'justiciar',
793
- KANDARIN: 'kandarin',
794
- KARAMJAN: 'karamjan',
795
- KHARIDIAN: 'kharidian',
796
- KITTEN: 'kitten',
797
- KNIGHT: 'knight',
798
- LABOURER: 'labourer',
799
- LAW: 'law',
800
- LEADER: 'leader',
801
- LEARNER: 'learner',
802
- LEGACY: 'legacy',
803
- LEGEND: 'legend',
804
- LEGIONNAIRE: 'legionnaire',
805
- LIEUTENANT: 'lieutenant',
806
- LOOTER: 'looter',
807
- LUMBERJACK: 'lumberjack',
808
- MAGIC: 'magic',
809
- MAGICIAN: 'magician',
810
- MAJOR: 'major',
811
- MAPLE: 'maple',
812
- MARSHAL: 'marshal',
813
- MASTER: 'master',
814
- MAXED: 'maxed',
815
- MEDIATOR: 'mediator',
816
- MEDIC: 'medic',
817
- MENTOR: 'mentor',
818
- MEMBER: 'member',
819
- MERCHANT: 'merchant',
820
- MIND: 'mind',
821
- MINER: 'miner',
822
- MINION: 'minion',
823
- MISTHALINIAN: 'misthalinian',
824
- MITHRIL: 'mithril',
825
- MODERATOR: 'moderator',
826
- MONARCH: 'monarch',
827
- MORYTANIAN: 'morytanian',
828
- MYSTIC: 'mystic',
829
- MYTH: 'myth',
830
- NATURAL: 'natural',
831
- NATURE: 'nature',
832
- NECROMANCER: 'necromancer',
833
- NINJA: 'ninja',
834
- NOBLE: 'noble',
835
- NOVICE: 'novice',
836
- NURSE: 'nurse',
837
- OAK: 'oak',
838
- OFFICER: 'officer',
839
- ONYX: 'onyx',
840
- OPAL: 'opal',
841
- ORACLE: 'oracle',
842
- ORANGE: 'orange',
843
- OWNER: 'owner',
844
- PAGE: 'page',
845
- PALADIN: 'paladin',
846
- PAWN: 'pawn',
847
- PILGRIM: 'pilgrim',
848
- PINE: 'pine',
849
- PINK: 'pink',
850
- PREFECT: 'prefect',
851
- PRIEST: 'priest',
852
- PRIVATE: 'private',
853
- PRODIGY: 'prodigy',
854
- PROSELYTE: 'proselyte',
855
- PROSPECTOR: 'prospector',
856
- PROTECTOR: 'protector',
857
- PURE: 'pure',
858
- PURPLE: 'purple',
859
- PYROMANCER: 'pyromancer',
860
- QUESTER: 'quester',
861
- RACER: 'racer',
862
- RAIDER: 'raider',
863
- RANGER: 'ranger',
864
- RECORD_CHASER: 'record_chaser',
865
- RECRUIT: 'recruit',
866
- RECRUITER: 'recruiter',
867
- RED_TOPAZ: 'red_topaz',
868
- RED: 'red',
869
- ROGUE: 'rogue',
870
- RUBY: 'ruby',
871
- RUNE: 'rune',
872
- RUNECRAFTER: 'runecrafter',
873
- SAGE: 'sage',
874
- SAPPHIRE: 'sapphire',
875
- SARADOMINIST: 'saradominist',
876
- SAVIOUR: 'saviour',
877
- SCAVENGER: 'scavenger',
878
- SCHOLAR: 'scholar',
879
- SCOURGE: 'scourge',
880
- SCOUT: 'scout',
881
- SCRIBE: 'scribe',
882
- SEER: 'seer',
883
- SENATOR: 'senator',
884
- SENTRY: 'sentry',
885
- SERENIST: 'serenist',
886
- SERGEANT: 'sergeant',
887
- SHAMAN: 'shaman',
888
- SHERIFF: 'sheriff',
889
- SHORT_GREEN_GUY: 'short_green_guy',
890
- SKILLER: 'skiller',
891
- SKULLED: 'skulled',
892
- SLAYER: 'slayer',
893
- SMITER: 'smiter',
894
- SMITH: 'smith',
895
- SMUGGLER: 'smuggler',
896
- SNIPER: 'sniper',
897
- SOUL: 'soul',
898
- SPECIALIST: 'specialist',
899
- SPEED_RUNNER: 'speed_runner',
900
- SPELLCASTER: 'spellcaster',
901
- SQUIRE: 'squire',
902
- STAFF: 'staff',
903
- STEEL: 'steel',
904
- STRIDER: 'strider',
905
- STRIKER: 'striker',
906
- SUMMONER: 'summoner',
907
- SUPERIOR: 'superior',
908
- SUPERVISOR: 'supervisor',
909
- TEACHER: 'teacher',
910
- TEMPLAR: 'templar',
911
- THERAPIST: 'therapist',
912
- THIEF: 'thief',
913
- TIRANNIAN: 'tirannian',
914
- TRIALIST: 'trialist',
915
- TRICKSTER: 'trickster',
916
- TZKAL: 'tzkal',
917
- TZTOK: 'tztok',
918
- UNHOLY: 'unholy',
919
- VAGRANT: 'vagrant',
920
- VANGUARD: 'vanguard',
921
- WALKER: 'walker',
922
- WANDERER: 'wanderer',
923
- WARDEN: 'warden',
924
- WARLOCK: 'warlock',
925
- WARRIOR: 'warrior',
926
- WATER: 'water',
927
- WILD: 'wild',
928
- WILLOW: 'willow',
929
- WILY: 'wily',
930
- WINTUMBER: 'wintumber',
931
- WITCH: 'witch',
932
- WIZARD: 'wizard',
933
- WORKER: 'worker',
934
- WRATH: 'wrath',
935
- XERICIAN: 'xerician',
936
- YELLOW: 'yellow',
937
- YEW: 'yew',
938
- ZAMORAKIAN: 'zamorakian',
939
- ZAROSIAN: 'zarosian',
940
- ZEALOT: 'zealot',
941
- ZENYTE: 'zenyte'
942
- };
327
+ const COMPETITION_TYPES = Object.values(CompetitionType);
328
+
943
329
  const Country = {
944
330
  AD: 'AD',
945
331
  AE: 'AE',
@@ -1194,41 +580,832 @@ const Country = {
1194
580
  ZM: 'ZM',
1195
581
  ZW: 'ZW'
1196
582
  };
1197
- const ActivityType = {
1198
- JOINED: 'joined',
1199
- LEFT: 'left',
1200
- CHANGED_ROLE: 'changed_role'
1201
- };
583
+ const COUNTRY_CODES = Object.values(Country);
584
+
585
+ var EfficiencyAlgorithmType;
586
+ (function (EfficiencyAlgorithmType) {
587
+ EfficiencyAlgorithmType["MAIN"] = "main";
588
+ EfficiencyAlgorithmType["IRONMAN"] = "ironman";
589
+ EfficiencyAlgorithmType["ULTIMATE"] = "ultimate";
590
+ EfficiencyAlgorithmType["LVL3"] = "lvl3";
591
+ EfficiencyAlgorithmType["F2P"] = "f2p";
592
+ EfficiencyAlgorithmType["F2P_LVL3"] = "f2p_lvl3";
593
+ EfficiencyAlgorithmType["F2P_IRONMAN"] = "f2p_ironman";
594
+ EfficiencyAlgorithmType["F2P_LVL3_IRONMAN"] = "f2p_lvl3_ironman";
595
+ EfficiencyAlgorithmType["DEF1"] = "def1";
596
+ })(EfficiencyAlgorithmType || (EfficiencyAlgorithmType = {}));
597
+
598
+ const GroupRole = {
599
+ ACHIEVER: 'achiever',
600
+ ADAMANT: 'adamant',
601
+ ADEPT: 'adept',
602
+ ADMINISTRATOR: 'administrator',
603
+ ADMIRAL: 'admiral',
604
+ ADVENTURER: 'adventurer',
605
+ AIR: 'air',
606
+ ANCHOR: 'anchor',
607
+ APOTHECARY: 'apothecary',
608
+ ARCHER: 'archer',
609
+ ARMADYLEAN: 'armadylean',
610
+ ARTILLERY: 'artillery',
611
+ ARTISAN: 'artisan',
612
+ ASGARNIAN: 'asgarnian',
613
+ ASSASSIN: 'assassin',
614
+ ASSISTANT: 'assistant',
615
+ ASTRAL: 'astral',
616
+ ATHLETE: 'athlete',
617
+ ATTACKER: 'attacker',
618
+ BANDIT: 'bandit',
619
+ BANDOSIAN: 'bandosian',
620
+ BARBARIAN: 'barbarian',
621
+ BATTLEMAGE: 'battlemage',
622
+ BEAST: 'beast',
623
+ BERSERKER: 'berserker',
624
+ BLISTERWOOD: 'blisterwood',
625
+ BLOOD: 'blood',
626
+ BLUE: 'blue',
627
+ BOB: 'bob',
628
+ BODY: 'body',
629
+ BRASSICAN: 'brassican',
630
+ BRAWLER: 'brawler',
631
+ BRIGADIER: 'brigadier',
632
+ BRIGAND: 'brigand',
633
+ BRONZE: 'bronze',
634
+ BRUISER: 'bruiser',
635
+ BULWARK: 'bulwark',
636
+ BURGLAR: 'burglar',
637
+ BURNT: 'burnt',
638
+ CADET: 'cadet',
639
+ CAPTAIN: 'captain',
640
+ CARRY: 'carry',
641
+ CHAMPION: 'champion',
642
+ CHAOS: 'chaos',
643
+ CLERIC: 'cleric',
644
+ COLLECTOR: 'collector',
645
+ COLONEL: 'colonel',
646
+ COMMANDER: 'commander',
647
+ COMPETITOR: 'competitor',
648
+ COMPLETIONIST: 'completionist',
649
+ CONSTRUCTOR: 'constructor',
650
+ COOK: 'cook',
651
+ COORDINATOR: 'coordinator',
652
+ CORPORAL: 'corporal',
653
+ COSMIC: 'cosmic',
654
+ COUNCILLOR: 'councillor',
655
+ CRAFTER: 'crafter',
656
+ CREW: 'crew',
657
+ CRUSADER: 'crusader',
658
+ CUTPURSE: 'cutpurse',
659
+ DEATH: 'death',
660
+ DEFENDER: 'defender',
661
+ DEFILER: 'defiler',
662
+ DEPUTY_OWNER: 'deputy_owner',
663
+ DESTROYER: 'destroyer',
664
+ DIAMOND: 'diamond',
665
+ DISEASED: 'diseased',
666
+ DOCTOR: 'doctor',
667
+ DOGSBODY: 'dogsbody',
668
+ DRAGON: 'dragon',
669
+ DRAGONSTONE: 'dragonstone',
670
+ DRUID: 'druid',
671
+ DUELLIST: 'duellist',
672
+ EARTH: 'earth',
673
+ ELITE: 'elite',
674
+ EMERALD: 'emerald',
675
+ ENFORCER: 'enforcer',
676
+ EPIC: 'epic',
677
+ EXECUTIVE: 'executive',
678
+ EXPERT: 'expert',
679
+ EXPLORER: 'explorer',
680
+ FARMER: 'farmer',
681
+ FEEDER: 'feeder',
682
+ FIGHTER: 'fighter',
683
+ FIRE: 'fire',
684
+ FIREMAKER: 'firemaker',
685
+ FIRESTARTER: 'firestarter',
686
+ FISHER: 'fisher',
687
+ FLETCHER: 'fletcher',
688
+ FORAGER: 'forager',
689
+ FREMENNIK: 'fremennik',
690
+ GAMER: 'gamer',
691
+ GATHERER: 'gatherer',
692
+ GENERAL: 'general',
693
+ GNOME_CHILD: 'gnome_child',
694
+ GNOME_ELDER: 'gnome_elder',
695
+ GOBLIN: 'goblin',
696
+ GOLD: 'gold',
697
+ GOON: 'goon',
698
+ GREEN: 'green',
699
+ GREY: 'grey',
700
+ GUARDIAN: 'guardian',
701
+ GUTHIXIAN: 'guthixian',
702
+ HARPOON: 'harpoon',
703
+ HEALER: 'healer',
704
+ HELLCAT: 'hellcat',
705
+ HELPER: 'helper',
706
+ HERBOLOGIST: 'herbologist',
707
+ HERO: 'hero',
708
+ HOLY: 'holy',
709
+ HOARDER: 'hoarder',
710
+ HUNTER: 'hunter',
711
+ IGNITOR: 'ignitor',
712
+ ILLUSIONIST: 'illusionist',
713
+ IMP: 'imp',
714
+ INFANTRY: 'infantry',
715
+ INQUISITOR: 'inquisitor',
716
+ IRON: 'iron',
717
+ JADE: 'jade',
718
+ JUSTICIAR: 'justiciar',
719
+ KANDARIN: 'kandarin',
720
+ KARAMJAN: 'karamjan',
721
+ KHARIDIAN: 'kharidian',
722
+ KITTEN: 'kitten',
723
+ KNIGHT: 'knight',
724
+ LABOURER: 'labourer',
725
+ LAW: 'law',
726
+ LEADER: 'leader',
727
+ LEARNER: 'learner',
728
+ LEGACY: 'legacy',
729
+ LEGEND: 'legend',
730
+ LEGIONNAIRE: 'legionnaire',
731
+ LIEUTENANT: 'lieutenant',
732
+ LOOTER: 'looter',
733
+ LUMBERJACK: 'lumberjack',
734
+ MAGIC: 'magic',
735
+ MAGICIAN: 'magician',
736
+ MAJOR: 'major',
737
+ MAPLE: 'maple',
738
+ MARSHAL: 'marshal',
739
+ MASTER: 'master',
740
+ MAXED: 'maxed',
741
+ MEDIATOR: 'mediator',
742
+ MEDIC: 'medic',
743
+ MENTOR: 'mentor',
744
+ MEMBER: 'member',
745
+ MERCHANT: 'merchant',
746
+ MIND: 'mind',
747
+ MINER: 'miner',
748
+ MINION: 'minion',
749
+ MISTHALINIAN: 'misthalinian',
750
+ MITHRIL: 'mithril',
751
+ MODERATOR: 'moderator',
752
+ MONARCH: 'monarch',
753
+ MORYTANIAN: 'morytanian',
754
+ MYSTIC: 'mystic',
755
+ MYTH: 'myth',
756
+ NATURAL: 'natural',
757
+ NATURE: 'nature',
758
+ NECROMANCER: 'necromancer',
759
+ NINJA: 'ninja',
760
+ NOBLE: 'noble',
761
+ NOVICE: 'novice',
762
+ NURSE: 'nurse',
763
+ OAK: 'oak',
764
+ OFFICER: 'officer',
765
+ ONYX: 'onyx',
766
+ OPAL: 'opal',
767
+ ORACLE: 'oracle',
768
+ ORANGE: 'orange',
769
+ OWNER: 'owner',
770
+ PAGE: 'page',
771
+ PALADIN: 'paladin',
772
+ PAWN: 'pawn',
773
+ PILGRIM: 'pilgrim',
774
+ PINE: 'pine',
775
+ PINK: 'pink',
776
+ PREFECT: 'prefect',
777
+ PRIEST: 'priest',
778
+ PRIVATE: 'private',
779
+ PRODIGY: 'prodigy',
780
+ PROSELYTE: 'proselyte',
781
+ PROSPECTOR: 'prospector',
782
+ PROTECTOR: 'protector',
783
+ PURE: 'pure',
784
+ PURPLE: 'purple',
785
+ PYROMANCER: 'pyromancer',
786
+ QUESTER: 'quester',
787
+ RACER: 'racer',
788
+ RAIDER: 'raider',
789
+ RANGER: 'ranger',
790
+ RECORD_CHASER: 'record_chaser',
791
+ RECRUIT: 'recruit',
792
+ RECRUITER: 'recruiter',
793
+ RED_TOPAZ: 'red_topaz',
794
+ RED: 'red',
795
+ ROGUE: 'rogue',
796
+ RUBY: 'ruby',
797
+ RUNE: 'rune',
798
+ RUNECRAFTER: 'runecrafter',
799
+ SAGE: 'sage',
800
+ SAPPHIRE: 'sapphire',
801
+ SARADOMINIST: 'saradominist',
802
+ SAVIOUR: 'saviour',
803
+ SCAVENGER: 'scavenger',
804
+ SCHOLAR: 'scholar',
805
+ SCOURGE: 'scourge',
806
+ SCOUT: 'scout',
807
+ SCRIBE: 'scribe',
808
+ SEER: 'seer',
809
+ SENATOR: 'senator',
810
+ SENTRY: 'sentry',
811
+ SERENIST: 'serenist',
812
+ SERGEANT: 'sergeant',
813
+ SHAMAN: 'shaman',
814
+ SHERIFF: 'sheriff',
815
+ SHORT_GREEN_GUY: 'short_green_guy',
816
+ SKILLER: 'skiller',
817
+ SKULLED: 'skulled',
818
+ SLAYER: 'slayer',
819
+ SMITER: 'smiter',
820
+ SMITH: 'smith',
821
+ SMUGGLER: 'smuggler',
822
+ SNIPER: 'sniper',
823
+ SOUL: 'soul',
824
+ SPECIALIST: 'specialist',
825
+ SPEED_RUNNER: 'speed_runner',
826
+ SPELLCASTER: 'spellcaster',
827
+ SQUIRE: 'squire',
828
+ STAFF: 'staff',
829
+ STEEL: 'steel',
830
+ STRIDER: 'strider',
831
+ STRIKER: 'striker',
832
+ SUMMONER: 'summoner',
833
+ SUPERIOR: 'superior',
834
+ SUPERVISOR: 'supervisor',
835
+ TEACHER: 'teacher',
836
+ TEMPLAR: 'templar',
837
+ THERAPIST: 'therapist',
838
+ THIEF: 'thief',
839
+ TIRANNIAN: 'tirannian',
840
+ TRIALIST: 'trialist',
841
+ TRICKSTER: 'trickster',
842
+ TZKAL: 'tzkal',
843
+ TZTOK: 'tztok',
844
+ UNHOLY: 'unholy',
845
+ VAGRANT: 'vagrant',
846
+ VANGUARD: 'vanguard',
847
+ WALKER: 'walker',
848
+ WANDERER: 'wanderer',
849
+ WARDEN: 'warden',
850
+ WARLOCK: 'warlock',
851
+ WARRIOR: 'warrior',
852
+ WATER: 'water',
853
+ WILD: 'wild',
854
+ WILLOW: 'willow',
855
+ WILY: 'wily',
856
+ WINTUMBER: 'wintumber',
857
+ WITCH: 'witch',
858
+ WIZARD: 'wizard',
859
+ WORKER: 'worker',
860
+ WRATH: 'wrath',
861
+ XERICIAN: 'xerician',
862
+ YELLOW: 'yellow',
863
+ YEW: 'yew',
864
+ ZAMORAKIAN: 'zamorakian',
865
+ ZAROSIAN: 'zarosian',
866
+ ZEALOT: 'zealot',
867
+ ZENYTE: 'zenyte'
868
+ };
869
+ const GROUP_ROLES = Object.values(GroupRole);
870
+
871
+ const MemberActivityType = {
872
+ JOINED: 'joined',
873
+ LEFT: 'left',
874
+ CHANGED_ROLE: 'changed_role'
875
+ };
876
+
877
+ var MetricMeasure;
878
+ (function (MetricMeasure) {
879
+ MetricMeasure["EXPERIENCE"] = "experience";
880
+ MetricMeasure["KILLS"] = "kills";
881
+ MetricMeasure["SCORE"] = "score";
882
+ MetricMeasure["VALUE"] = "value";
883
+ })(MetricMeasure || (MetricMeasure = {}));
884
+
885
+ var MetricType;
886
+ (function (MetricType) {
887
+ MetricType["SKILL"] = "skill";
888
+ MetricType["BOSS"] = "boss";
889
+ MetricType["ACTIVITY"] = "activity";
890
+ MetricType["COMPUTED"] = "computed";
891
+ })(MetricType || (MetricType = {}));
892
+
893
+ const Skill = {
894
+ OVERALL: 'overall',
895
+ ATTACK: 'attack',
896
+ DEFENCE: 'defence',
897
+ STRENGTH: 'strength',
898
+ HITPOINTS: 'hitpoints',
899
+ RANGED: 'ranged',
900
+ PRAYER: 'prayer',
901
+ MAGIC: 'magic',
902
+ COOKING: 'cooking',
903
+ WOODCUTTING: 'woodcutting',
904
+ FLETCHING: 'fletching',
905
+ FISHING: 'fishing',
906
+ FIREMAKING: 'firemaking',
907
+ CRAFTING: 'crafting',
908
+ SMITHING: 'smithing',
909
+ MINING: 'mining',
910
+ HERBLORE: 'herblore',
911
+ AGILITY: 'agility',
912
+ THIEVING: 'thieving',
913
+ SLAYER: 'slayer',
914
+ FARMING: 'farming',
915
+ RUNECRAFTING: 'runecrafting',
916
+ HUNTER: 'hunter',
917
+ CONSTRUCTION: 'construction'
918
+ };
919
+ const Activity = {
920
+ LEAGUE_POINTS: 'league_points',
921
+ BOUNTY_HUNTER_HUNTER: 'bounty_hunter_hunter',
922
+ BOUNTY_HUNTER_ROGUE: 'bounty_hunter_rogue',
923
+ CLUE_SCROLLS_ALL: 'clue_scrolls_all',
924
+ CLUE_SCROLLS_BEGINNER: 'clue_scrolls_beginner',
925
+ CLUE_SCROLLS_EASY: 'clue_scrolls_easy',
926
+ CLUE_SCROLLS_MEDIUM: 'clue_scrolls_medium',
927
+ CLUE_SCROLLS_HARD: 'clue_scrolls_hard',
928
+ CLUE_SCROLLS_ELITE: 'clue_scrolls_elite',
929
+ CLUE_SCROLLS_MASTER: 'clue_scrolls_master',
930
+ LAST_MAN_STANDING: 'last_man_standing',
931
+ PVP_ARENA: 'pvp_arena',
932
+ SOUL_WARS_ZEAL: 'soul_wars_zeal',
933
+ GUARDIANS_OF_THE_RIFT: 'guardians_of_the_rift',
934
+ COLOSSEUM_GLORY: 'colosseum_glory',
935
+ COLLECTIONS_LOGGED: 'collections_logged'
936
+ };
937
+ const Boss = {
938
+ ABYSSAL_SIRE: 'abyssal_sire',
939
+ ALCHEMICAL_HYDRA: 'alchemical_hydra',
940
+ AMOXLIATL: 'amoxliatl',
941
+ ARAXXOR: 'araxxor',
942
+ ARTIO: 'artio',
943
+ BARROWS_CHESTS: 'barrows_chests',
944
+ BRYOPHYTA: 'bryophyta',
945
+ CALLISTO: 'callisto',
946
+ CALVARION: 'calvarion',
947
+ CERBERUS: 'cerberus',
948
+ CHAMBERS_OF_XERIC: 'chambers_of_xeric',
949
+ CHAMBERS_OF_XERIC_CM: 'chambers_of_xeric_challenge_mode',
950
+ CHAOS_ELEMENTAL: 'chaos_elemental',
951
+ CHAOS_FANATIC: 'chaos_fanatic',
952
+ COMMANDER_ZILYANA: 'commander_zilyana',
953
+ CORPOREAL_BEAST: 'corporeal_beast',
954
+ CRAZY_ARCHAEOLOGIST: 'crazy_archaeologist',
955
+ DAGANNOTH_PRIME: 'dagannoth_prime',
956
+ DAGANNOTH_REX: 'dagannoth_rex',
957
+ DAGANNOTH_SUPREME: 'dagannoth_supreme',
958
+ DERANGED_ARCHAEOLOGIST: 'deranged_archaeologist',
959
+ DOOM_OF_MOKHAIOTL: 'doom_of_mokhaiotl',
960
+ DUKE_SUCELLUS: 'duke_sucellus',
961
+ GENERAL_GRAARDOR: 'general_graardor',
962
+ GIANT_MOLE: 'giant_mole',
963
+ GROTESQUE_GUARDIANS: 'grotesque_guardians',
964
+ HESPORI: 'hespori',
965
+ KALPHITE_QUEEN: 'kalphite_queen',
966
+ KING_BLACK_DRAGON: 'king_black_dragon',
967
+ KRAKEN: 'kraken',
968
+ KREEARRA: 'kreearra',
969
+ KRIL_TSUTSAROTH: 'kril_tsutsaroth',
970
+ LUNAR_CHESTS: 'lunar_chests',
971
+ MIMIC: 'mimic',
972
+ NEX: 'nex',
973
+ NIGHTMARE: 'nightmare',
974
+ PHOSANIS_NIGHTMARE: 'phosanis_nightmare',
975
+ OBOR: 'obor',
976
+ PHANTOM_MUSPAH: 'phantom_muspah',
977
+ SARACHNIS: 'sarachnis',
978
+ SCORPIA: 'scorpia',
979
+ SCURRIUS: 'scurrius',
980
+ SKOTIZO: 'skotizo',
981
+ SOL_HEREDIT: 'sol_heredit',
982
+ SPINDEL: 'spindel',
983
+ TEMPOROSS: 'tempoross',
984
+ THE_GAUNTLET: 'the_gauntlet',
985
+ THE_CORRUPTED_GAUNTLET: 'the_corrupted_gauntlet',
986
+ THE_HUEYCOATL: 'the_hueycoatl',
987
+ THE_LEVIATHAN: 'the_leviathan',
988
+ THE_ROYAL_TITANS: 'the_royal_titans',
989
+ THE_WHISPERER: 'the_whisperer',
990
+ THEATRE_OF_BLOOD: 'theatre_of_blood',
991
+ THEATRE_OF_BLOOD_HARD_MODE: 'theatre_of_blood_hard_mode',
992
+ THERMONUCLEAR_SMOKE_DEVIL: 'thermonuclear_smoke_devil',
993
+ TOMBS_OF_AMASCUT: 'tombs_of_amascut',
994
+ TOMBS_OF_AMASCUT_EXPERT: 'tombs_of_amascut_expert',
995
+ TZKAL_ZUK: 'tzkal_zuk',
996
+ TZTOK_JAD: 'tztok_jad',
997
+ VARDORVIS: 'vardorvis',
998
+ VENENATIS: 'venenatis',
999
+ VETION: 'vetion',
1000
+ VORKATH: 'vorkath',
1001
+ WINTERTODT: 'wintertodt',
1002
+ YAMA: 'yama',
1003
+ ZALCANO: 'zalcano',
1004
+ ZULRAH: 'zulrah'
1005
+ };
1006
+ const ComputedMetric = {
1007
+ EHP: 'ehp',
1008
+ EHB: 'ehb'
1009
+ };
1010
+ const Metric = Object.assign(Object.assign(Object.assign(Object.assign({}, Skill), Activity), Boss), ComputedMetric);
1011
+ const METRICS = Object.values(Metric);
1012
+ const SKILLS = Object.values(Skill);
1013
+ const BOSSES = Object.values(Boss);
1014
+ const ACTIVITIES = Object.values(Activity);
1015
+ const COMPUTED_METRICS = Object.values(ComputedMetric);
1016
+
1017
+ const NameChangeStatus = {
1018
+ PENDING: 'pending',
1019
+ DENIED: 'denied',
1020
+ APPROVED: 'approved'
1021
+ };
1022
+
1023
+ const Period = {
1024
+ FIVE_MIN: 'five_min',
1025
+ DAY: 'day',
1026
+ WEEK: 'week',
1027
+ MONTH: 'month',
1028
+ YEAR: 'year'
1029
+ };
1030
+ const PERIODS = Object.values(Period);
1031
+
1032
+ const PlayerAnnotationType = {
1033
+ OPT_OUT: 'opt_out',
1034
+ OPT_OUT_GROUPS: 'opt_out_groups',
1035
+ OPT_OUT_COMPETITIONS: 'opt_out_competitions',
1036
+ BLOCKED: 'blocked',
1037
+ FAKE_F2P: 'fake_f2p'
1038
+ };
1039
+
1040
+ const PlayerBuild = {
1041
+ MAIN: 'main',
1042
+ F2P: 'f2p',
1043
+ F2P_LVL3: 'f2p_lvl3',
1044
+ LVL3: 'lvl3',
1045
+ ZERKER: 'zerker',
1046
+ DEF1: 'def1',
1047
+ HP10: 'hp10'
1048
+ };
1049
+ const PLAYER_BUILDS = Object.values(PlayerBuild);
1050
+
1051
+ const PlayerStatus = {
1052
+ ACTIVE: 'active',
1053
+ UNRANKED: 'unranked',
1054
+ FLAGGED: 'flagged',
1055
+ ARCHIVED: 'archived',
1056
+ BANNED: 'banned'
1057
+ };
1058
+ const PLAYER_STATUSES = Object.values(PlayerStatus);
1059
+
1060
+ const PlayerType = {
1061
+ UNKNOWN: 'unknown',
1062
+ REGULAR: 'regular',
1063
+ IRONMAN: 'ironman',
1064
+ HARDCORE: 'hardcore',
1065
+ ULTIMATE: 'ultimate'
1066
+ };
1067
+ const PLAYER_TYPES = Object.values(PlayerType);
1068
+
1069
+ class EfficiencyClient extends BaseAPIClient {
1070
+ /**
1071
+ * Fetches the current efficiency leaderboard for a specific efficiency metric, playerType, playerBuild and country.
1072
+ * @returns A list of players.
1073
+ */
1074
+ getEfficiencyLeaderboards(filter, pagination) {
1075
+ return this.getRequest('/efficiency/leaderboard', Object.assign(Object.assign({}, filter), pagination));
1076
+ }
1077
+ /**
1078
+ * Fetches the top EHP (Efficient Hours Played) rates.
1079
+ * @returns A list of skilling methods and their bonus exp ratios.
1080
+ */
1081
+ getEHPRates(algorithmType) {
1082
+ return this.getRequest('/efficiency/rates', {
1083
+ metric: Metric.EHP,
1084
+ type: algorithmType
1085
+ });
1086
+ }
1087
+ /**
1088
+ * Fetches the top EHB (Efficient Hours Bossed) rates.
1089
+ * @returns A list of bosses and their respective "per-hour" kill rates.
1090
+ */
1091
+ getEHBRates(algorithmType) {
1092
+ return this.getRequest('/efficiency/rates', {
1093
+ metric: Metric.EHB,
1094
+ type: algorithmType
1095
+ });
1096
+ }
1097
+ }
1098
+
1099
+ class GroupsClient extends BaseAPIClient {
1100
+ /**
1101
+ * Searches for groups that match a partial name.
1102
+ * @returns A list of groups.
1103
+ */
1104
+ searchGroups(name, pagination) {
1105
+ return this.getRequest('/groups', Object.assign({ name }, pagination));
1106
+ }
1107
+ /**
1108
+ * Fetches a group's details, including a list of membership objects.
1109
+ * @returns A group details object.
1110
+ */
1111
+ getGroupDetails(id) {
1112
+ return this.getRequest(`/groups/${id}`);
1113
+ }
1114
+ /**
1115
+ * Creates a new group.
1116
+ * @returns The newly created group, and the verification code that authorizes future changes to it.
1117
+ */
1118
+ createGroup(payload) {
1119
+ return this.postRequest('/groups', payload);
1120
+ }
1121
+ /**
1122
+ * Edits an existing group.
1123
+ * @returns The updated group.
1124
+ */
1125
+ editGroup(id, payload, verificationCode) {
1126
+ return this.putRequest(`/groups/${id}`, Object.assign(Object.assign({}, payload), { verificationCode }));
1127
+ }
1128
+ /**
1129
+ * Deletes an existing group.
1130
+ * @returns A confirmation message.
1131
+ */
1132
+ deleteGroup(id, verificationCode) {
1133
+ return this.deleteRequest(`/groups/${id}`, { verificationCode });
1134
+ }
1135
+ /**
1136
+ * Adds all (valid) given usernames (and roles) to a group, ignoring duplicates.
1137
+ * @returns The number of members added and a confirmation message.
1138
+ */
1139
+ addMembers(id, members, verificationCode) {
1140
+ return this.postRequest(`/groups/${id}/members`, {
1141
+ verificationCode,
1142
+ members
1143
+ });
1144
+ }
1145
+ /**
1146
+ * Remove all given usernames from a group, ignoring usernames that aren't members.
1147
+ * @returns The number of members removed and a confirmation message.
1148
+ */
1149
+ removeMembers(id, usernames, verificationCode) {
1150
+ return this.deleteRequest(`/groups/${id}/members`, {
1151
+ verificationCode,
1152
+ members: usernames
1153
+ });
1154
+ }
1155
+ /**
1156
+ * Changes a player's role in a given group.
1157
+ * @returns The updated membership, with player included.
1158
+ */
1159
+ changeRole(id, payload, verificationCode) {
1160
+ return this.putRequest(`/groups/${id}/role`, Object.assign(Object.assign({}, payload), { verificationCode }));
1161
+ }
1162
+ /**
1163
+ * Adds an "update" request to the queue, for each outdated group member.
1164
+ * @returns The number of players to be updated and a confirmation message.
1165
+ */
1166
+ updateAll(id, verificationCode) {
1167
+ return this.postRequest(`/groups/${id}/update-all`, {
1168
+ verificationCode
1169
+ });
1170
+ }
1171
+ /**
1172
+ * Fetches all of the groups's competitions
1173
+ * @returns A list of competitions.
1174
+ */
1175
+ getGroupCompetitions(id, pagination) {
1176
+ return this.getRequest(`/groups/${id}/competitions`, Object.assign({}, pagination));
1177
+ }
1178
+ getGroupGains(id, filter, pagination) {
1179
+ return this.getRequest(`/groups/${id}/gained`, Object.assign(Object.assign({}, pagination), filter));
1180
+ }
1181
+ /**
1182
+ * Fetches a group members' latest achievements.
1183
+ * @returns A list of achievements.
1184
+ */
1185
+ getGroupAchievements(id, pagination) {
1186
+ return this.getRequest(`/groups/${id}/achievements`, Object.assign({}, pagination));
1187
+ }
1188
+ /**
1189
+ * Fetches a group's record leaderboard for a specific metric and period.
1190
+ * @returns A list of records, including their respective players.
1191
+ */
1192
+ getGroupRecords(id, filter, pagination) {
1193
+ return this.getRequest(`/groups/${id}/records`, Object.assign(Object.assign({}, pagination), filter));
1194
+ }
1195
+ /**
1196
+ * Fetches a group's hiscores for a specific metric.
1197
+ * @returns A list of hiscores entries (value, rank), including their respective players.
1198
+ */
1199
+ getGroupHiscores(id, metric, pagination) {
1200
+ return this.getRequest(`/groups/${id}/hiscores`, Object.assign(Object.assign({}, pagination), { metric }));
1201
+ }
1202
+ /**
1203
+ * Fetches a group members' latest name changes.
1204
+ * @returns A list of name change (approved) requests.
1205
+ */
1206
+ getGroupNameChanges(id, pagination) {
1207
+ return this.getRequest(`/groups/${id}/name-changes`, Object.assign({}, pagination));
1208
+ }
1209
+ /**
1210
+ * Fetches a group's general statistics.
1211
+ * @returns An object with a few statistic values and an average stats snapshot.
1212
+ */
1213
+ getGroupStatistics(id) {
1214
+ return this.getRequest(`/groups/${id}/statistics`);
1215
+ }
1216
+ /**
1217
+ * Fetches a group's activity.
1218
+ * @returns A list of a group's (join, leave and role changed) activity.
1219
+ */
1220
+ getGroupActivity(id, pagination) {
1221
+ return this.getRequest(`/groups/${id}/activity`, Object.assign({}, pagination));
1222
+ }
1223
+ /**
1224
+ * Fetches the groups's member list in CSV format.
1225
+ * @returns A string containing the CSV content.
1226
+ */
1227
+ getMembersCSV(id) {
1228
+ return this.getText(`/groups/${id}/csv`);
1229
+ }
1230
+ }
1202
1231
 
1203
- var CompetitionStatus;
1204
- (function (CompetitionStatus) {
1205
- CompetitionStatus["UPCOMING"] = "upcoming";
1206
- CompetitionStatus["ONGOING"] = "ongoing";
1207
- CompetitionStatus["FINISHED"] = "finished";
1208
- })(CompetitionStatus || (CompetitionStatus = {}));
1209
- var CompetitionCSVTableType;
1210
- (function (CompetitionCSVTableType) {
1211
- CompetitionCSVTableType["TEAM"] = "team";
1212
- CompetitionCSVTableType["TEAMS"] = "teams";
1213
- CompetitionCSVTableType["PARTICIPANTS"] = "participants";
1214
- })(CompetitionCSVTableType || (CompetitionCSVTableType = {}));
1215
- const CompetitionTypeProps = {
1216
- [CompetitionType.CLASSIC]: { name: 'Classic' },
1217
- [CompetitionType.TEAM]: { name: 'Team' }
1232
+ class NameChangesClient extends BaseAPIClient {
1233
+ /**
1234
+ * Searches for name changes that match a name and/or status filter.
1235
+ * @returns A list of name changes.
1236
+ */
1237
+ searchNameChanges(filter, pagination) {
1238
+ return this.getRequest('/names', Object.assign(Object.assign({}, filter), pagination));
1239
+ }
1240
+ /**
1241
+ * Submits a name change request between two usernames (old and new).
1242
+ * @returns A pending name change request, to be reviewed and resolved at a later date.
1243
+ */
1244
+ submitNameChange(oldName, newName) {
1245
+ return this.postRequest('/names', { oldName, newName });
1246
+ }
1247
+ }
1248
+
1249
+ class PlayersClient extends BaseAPIClient {
1250
+ /**
1251
+ * Searches players by partial username.
1252
+ * @returns A list of players.
1253
+ */
1254
+ searchPlayers(partialUsername, pagination) {
1255
+ return this.getRequest('/players/search', Object.assign({ username: partialUsername }, pagination));
1256
+ }
1257
+ /**
1258
+ * Updates/tracks a player.
1259
+ * @returns The player's new details, including the latest snapshot.
1260
+ */
1261
+ updatePlayer(username) {
1262
+ return this.postRequest(`/players/${username}`);
1263
+ }
1264
+ /**
1265
+ * Asserts (and attempts to fix, if necessary) a player's game-mode type.
1266
+ * @returns The updated player, and an indication of whether the type was changed.
1267
+ */
1268
+ assertPlayerType(username) {
1269
+ return this.postRequest(`/players/${username}/assert-type`);
1270
+ }
1271
+ /**
1272
+ * Fetches a player's details.
1273
+ * @returns The player's details, including the latest snapshot.
1274
+ */
1275
+ getPlayerDetails(username) {
1276
+ return this.getRequest(`/players/${username}`);
1277
+ }
1278
+ /**
1279
+ * Fetches a player's details by ID.
1280
+ * @returns The player's details, including the latest snapshot.
1281
+ */
1282
+ getPlayerDetailsById(id) {
1283
+ return this.getRequest(`/players/id/${id}`);
1284
+ }
1285
+ /**
1286
+ * Fetches a player's current achievements.
1287
+ * @returns A list of achievements.
1288
+ */
1289
+ getPlayerAchievements(username) {
1290
+ return this.getRequest(`/players/${username}/achievements`);
1291
+ }
1292
+ /**
1293
+ * Fetches a player's current achievement progress.
1294
+ * @returns A list of achievements (completed or otherwise), with their respective relative/absolute progress percentage.
1295
+ */
1296
+ getPlayerAchievementProgress(username) {
1297
+ return this.getRequest(`/players/${username}/achievements/progress`);
1298
+ }
1299
+ /**
1300
+ * Fetches all of the player's competition participations.
1301
+ * @returns A list of participations, with the respective competition included.
1302
+ */
1303
+ getPlayerCompetitions(username, filter, pagination) {
1304
+ return this.getRequest(`/players/${username}/competitions`, Object.assign(Object.assign({}, filter), pagination));
1305
+ }
1306
+ /**
1307
+ * Fetches all of the player's competition participations' standings.
1308
+ * @returns A list of participations, with the respective competition, rank and progress included.
1309
+ */
1310
+ getPlayerCompetitionStandings(username, filter) {
1311
+ return this.getRequest(`/players/${username}/competitions/standings`, filter);
1312
+ }
1313
+ /**
1314
+ * Fetches all of the player's group memberships.
1315
+ * @returns A list of memberships, with the respective group included.
1316
+ */
1317
+ getPlayerGroups(username, pagination) {
1318
+ return this.getRequest(`/players/${username}/groups`, pagination);
1319
+ }
1320
+ /**
1321
+ * Fetches a player's gains, for a specific period or time range, as a [metric: data] map.
1322
+ * @returns A map of each metric's gained data.
1323
+ */
1324
+ getPlayerGains(username, options) {
1325
+ return this.getRequest(`/players/${username}/gained`, options);
1326
+ }
1327
+ /**
1328
+ * Fetches all of the player's records.
1329
+ * @returns A list of records.
1330
+ */
1331
+ getPlayerRecords(username, options) {
1332
+ return this.getRequest(`/players/${username}/records`, options);
1333
+ }
1334
+ /**
1335
+ * Fetches all of the player's past snapshots.
1336
+ * @returns A list of snapshots.
1337
+ */
1338
+ getPlayerSnapshots(username, filter, pagination) {
1339
+ return this.getRequest(`/players/${username}/snapshots`, Object.assign(Object.assign({}, filter), pagination));
1340
+ }
1341
+ /**
1342
+ * Fetches all of the player's past snapshots' timeline.
1343
+ * @returns A list of timeseries data (value, rank, date)
1344
+ */
1345
+ getPlayerSnapshotTimeline(username, metric, options) {
1346
+ return this.getRequest(`/players/${username}/snapshots/timeline`, Object.assign(Object.assign({}, options), { metric }));
1347
+ }
1348
+ /**
1349
+ * Fetches all of the player's approved name changes.
1350
+ * @returns A list of name changes.
1351
+ */
1352
+ getPlayerNames(username) {
1353
+ return this.getRequest(`/players/${username}/names`);
1354
+ }
1355
+ /**
1356
+ * Fetches all of archived players that previously held this username.
1357
+ * @returns A list of player archives.
1358
+ */
1359
+ getPlayerArchives(username) {
1360
+ return this.getRequest(`/players/${username}/archives`);
1361
+ }
1362
+ }
1363
+
1364
+ class RecordsClient extends BaseAPIClient {
1365
+ /**
1366
+ * Fetches the current records leaderboard for a specific metric, period, playerType, playerBuild and country.
1367
+ * @returns A list of records, with their respective players, dates and values included.
1368
+ */
1369
+ getRecordLeaderboard(filter) {
1370
+ return this.getRequest('/records/leaderboard', filter);
1371
+ }
1372
+ }
1373
+
1374
+ var config = {
1375
+ defaultUserAgent: `WiseOldMan JS Client v${process.env.npm_package_version}`,
1376
+ baseAPIUrl: 'https://api.wiseoldman.net/v2'
1218
1377
  };
1378
+
1379
+ class WOMClient extends BaseAPIClient {
1380
+ constructor(options) {
1381
+ const baseApiUrl = (options === null || options === void 0 ? void 0 : options.baseAPIUrl) || config.baseAPIUrl;
1382
+ const headers = {
1383
+ 'x-user-agent': (options === null || options === void 0 ? void 0 : options.userAgent) || config.defaultUserAgent
1384
+ };
1385
+ if (options === null || options === void 0 ? void 0 : options.apiKey) {
1386
+ headers['x-api-key'] = options.apiKey;
1387
+ }
1388
+ super(headers, baseApiUrl);
1389
+ this.deltas = new DeltasClient(headers, baseApiUrl);
1390
+ this.groups = new GroupsClient(headers, baseApiUrl);
1391
+ this.players = new PlayersClient(headers, baseApiUrl);
1392
+ this.records = new RecordsClient(headers, baseApiUrl);
1393
+ this.efficiency = new EfficiencyClient(headers, baseApiUrl);
1394
+ this.nameChanges = new NameChangesClient(headers, baseApiUrl);
1395
+ this.competitions = new CompetitionsClient(headers, baseApiUrl);
1396
+ }
1397
+ }
1398
+
1219
1399
  const CompetitionStatusProps = {
1220
1400
  [CompetitionStatus.UPCOMING]: { name: 'Upcoming' },
1221
1401
  [CompetitionStatus.ONGOING]: { name: 'Ongoing' },
1222
1402
  [CompetitionStatus.FINISHED]: { name: 'Finished' }
1223
1403
  };
1224
- const COMPETITION_TYPES = Object.values(CompetitionType);
1225
- const COMPETITION_STATUSES = Object.values(CompetitionStatus);
1226
- function isCompetitionType(typeString) {
1227
- return typeString in CompetitionTypeProps;
1228
- }
1229
- function isCompetitionStatus(statusString) {
1230
- return statusString in CompetitionStatusProps;
1231
- }
1404
+
1405
+ const CompetitionTypeProps = {
1406
+ [CompetitionType.CLASSIC]: { name: 'Classic' },
1407
+ [CompetitionType.TEAM]: { name: 'Team' }
1408
+ };
1232
1409
 
1233
1410
  const CountryProps = {
1234
1411
  [Country.AD]: { code: 'AD', name: 'Andorra' },
@@ -1484,11 +1661,6 @@ const CountryProps = {
1484
1661
  [Country.ZM]: { code: 'ZM', name: 'Zambia' },
1485
1662
  [Country.ZW]: { code: 'ZW', name: 'Zimbabwe' }
1486
1663
  };
1487
- const COUNTRY_CODES = Object.values(Country);
1488
- const COMMON_ALIASES = [
1489
- { commonIdentifier: 'UK', trueIdentifier: 'GB' },
1490
- { commonIdentifier: 'USA', trueIdentifier: 'US' }
1491
- ];
1492
1664
  function isCountry(countryCodeString) {
1493
1665
  return countryCodeString in CountryProps;
1494
1666
  }
@@ -1501,6 +1673,10 @@ function findCountryByName(countryName) {
1501
1673
  function findCountryByCode(countryCode) {
1502
1674
  return Object.values(CountryProps).find(c => c.code === replaceCommonAliases(countryCode.toUpperCase()));
1503
1675
  }
1676
+ const COMMON_ALIASES = [
1677
+ { commonIdentifier: 'UK', trueIdentifier: 'GB' },
1678
+ { commonIdentifier: 'USA', trueIdentifier: 'US' }
1679
+ ];
1504
1680
  function replaceCommonAliases(countryCode) {
1505
1681
  var _a;
1506
1682
  if (!countryCode)
@@ -1565,24 +1741,7 @@ function getCombatLevel(attack, strength, defence, ranged, magic, hitpoints, pra
1565
1741
  return Math.floor(baseCombat + Math.max(meleeCombat, rangeCombat, mageCombat));
1566
1742
  }
1567
1743
 
1568
- function mapValues(obj, callback) {
1569
- const clone = {};
1570
- Object.keys(obj).forEach(k => {
1571
- const key = k;
1572
- clone[key] = callback(obj[key], key, obj);
1573
- });
1574
- return clone;
1575
- }
1576
-
1577
- const GROUP_ROLES = Object.values(GroupRole);
1578
- const PRIVELEGED_GROUP_ROLES = [
1579
- GroupRole.ADMINISTRATOR,
1580
- GroupRole.OWNER,
1581
- GroupRole.LEADER,
1582
- GroupRole.DEPUTY_OWNER,
1583
- GroupRole.MODERATOR
1584
- ];
1585
- const GroupRoleProps = mapValues({
1744
+ const GroupRoleProps = {
1586
1745
  [GroupRole.ACHIEVER]: { name: 'Achiever' },
1587
1746
  [GroupRole.ADAMANT]: { name: 'Adamant' },
1588
1747
  [GroupRole.ADEPT]: { name: 'Adept' },
@@ -1852,33 +2011,27 @@ const GroupRoleProps = mapValues({
1852
2011
  [GroupRole.ZAROSIAN]: { name: 'Zarosian' },
1853
2012
  [GroupRole.ZEALOT]: { name: 'Zealot' },
1854
2013
  [GroupRole.ZENYTE]: { name: 'Zenyte' }
1855
- }, (props, key) => (Object.assign(Object.assign({}, props), { isPriveleged: PRIVELEGED_GROUP_ROLES.includes(key) })));
1856
- function findGroupRole(roleName) {
1857
- for (const [key, value] of Object.entries(GroupRoleProps)) {
1858
- if (value.name.toUpperCase() === roleName.toUpperCase()) {
1859
- return key;
1860
- }
1861
- }
1862
- return null;
1863
- }
2014
+ };
1864
2015
  function isGroupRole(roleString) {
1865
2016
  return roleString in GroupRoleProps;
1866
2017
  }
1867
-
1868
- var MetricType;
1869
- (function (MetricType) {
1870
- MetricType["SKILL"] = "skill";
1871
- MetricType["BOSS"] = "boss";
1872
- MetricType["ACTIVITY"] = "activity";
1873
- MetricType["COMPUTED"] = "computed";
1874
- })(MetricType || (MetricType = {}));
1875
- var MetricMeasure;
1876
- (function (MetricMeasure) {
1877
- MetricMeasure["EXPERIENCE"] = "experience";
1878
- MetricMeasure["KILLS"] = "kills";
1879
- MetricMeasure["SCORE"] = "score";
1880
- MetricMeasure["VALUE"] = "value";
1881
- })(MetricMeasure || (MetricMeasure = {}));
2018
+ const PRIVILEGED_GROUP_ROLES = [
2019
+ GroupRole.ADMINISTRATOR,
2020
+ GroupRole.OWNER,
2021
+ GroupRole.LEADER,
2022
+ GroupRole.DEPUTY_OWNER,
2023
+ GroupRole.MODERATOR
2024
+ ];
2025
+
2026
+ function mapValues(obj, callback) {
2027
+ const clone = {};
2028
+ Object.keys(obj).forEach(k => {
2029
+ const key = k;
2030
+ clone[key] = callback(obj[key], key, obj);
2031
+ });
2032
+ return clone;
2033
+ }
2034
+
1882
2035
  const SkillProps = mapValues({
1883
2036
  [Skill.OVERALL]: { name: 'Overall' },
1884
2037
  [Skill.ATTACK]: { name: 'Attack', isCombat: true },
@@ -1997,23 +2150,11 @@ const ComputedMetricProps = mapValues({
1997
2150
  [ComputedMetric.EHB]: { name: 'EHB' }
1998
2151
  }, props => (Object.assign(Object.assign({}, props), { type: MetricType.COMPUTED, measure: MetricMeasure.VALUE })));
1999
2152
  const MetricProps = Object.assign(Object.assign(Object.assign(Object.assign({}, SkillProps), BossProps), ActivityProps), ComputedMetricProps);
2000
- const METRICS = Object.values(Metric);
2001
- const SKILLS = Object.values(Skill);
2002
- const BOSSES = Object.values(Boss);
2003
- const ACTIVITIES = Object.values(Activity);
2004
- const COMPUTED_METRICS = Object.values(ComputedMetric);
2005
2153
  const REAL_SKILLS = SKILLS.filter(s => s !== Skill.OVERALL);
2006
2154
  const F2P_BOSSES = BOSSES.filter(b => !MetricProps[b].isMembers);
2007
2155
  const MEMBER_SKILLS = SKILLS.filter(s => MetricProps[s].isMembers);
2008
2156
  const COMBAT_SKILLS = SKILLS.filter(s => MetricProps[s].isCombat);
2009
2157
  const REAL_METRICS = [...SKILLS, ...BOSSES, ...ACTIVITIES];
2010
- function findMetric(metricName) {
2011
- for (const [key, value] of Object.entries(MetricProps)) {
2012
- if (value.name.toUpperCase() === metricName.toUpperCase())
2013
- return key;
2014
- }
2015
- return null;
2016
- }
2017
2158
  function isMetric(metric) {
2018
2159
  return metric in MetricProps;
2019
2160
  }
@@ -2029,28 +2170,6 @@ function isBoss(metric) {
2029
2170
  function isComputedMetric(metric) {
2030
2171
  return metric in ComputedMetricProps;
2031
2172
  }
2032
- function getMetricRankKey(metric) {
2033
- return `${metric}Rank`;
2034
- }
2035
- // Maybe someday I'll be good enough with TS to restrict the return type to the input metric type
2036
- function getMetricValueKey(metric) {
2037
- if (isSkill(metric)) {
2038
- return `${metric}Experience`;
2039
- }
2040
- if (isBoss(metric)) {
2041
- return `${metric}Kills`;
2042
- }
2043
- if (isActivity(metric)) {
2044
- return `${metric}Score`;
2045
- }
2046
- return `${metric}Value`;
2047
- }
2048
- function getMetricMeasure(metric) {
2049
- return MetricProps[metric].measure;
2050
- }
2051
- function getMetricName(metric) {
2052
- return MetricProps[metric].name;
2053
- }
2054
2173
  function getMinimumValue(metric) {
2055
2174
  return isBoss(metric) || isActivity(metric) ? MetricProps[metric].minimumValue : 1;
2056
2175
  }
@@ -2062,7 +2181,6 @@ function getParentEfficiencyMetric(metric) {
2062
2181
  return null;
2063
2182
  }
2064
2183
 
2065
- const CUSTOM_PERIOD_REGEX = /(\d+y)?(\d+m)?(\d+w)?(\d+d)?(\d+h)?/;
2066
2184
  const PeriodProps = {
2067
2185
  [Period.FIVE_MIN]: { name: '5 Min', milliseconds: 300000 },
2068
2186
  [Period.DAY]: { name: 'Day', milliseconds: 86400000 },
@@ -2070,52 +2188,10 @@ const PeriodProps = {
2070
2188
  [Period.MONTH]: { name: 'Month', milliseconds: 2678400000 },
2071
2189
  [Period.YEAR]: { name: 'Year', milliseconds: 31556926000 }
2072
2190
  };
2073
- const PERIODS = Object.values(Period);
2074
- function findPeriod(periodName) {
2075
- for (const [key, value] of Object.entries(PeriodProps)) {
2076
- if (value.name.toUpperCase() === periodName.toUpperCase())
2077
- return key;
2078
- }
2079
- return null;
2080
- }
2081
2191
  function isPeriod(periodString) {
2082
2192
  return periodString in PeriodProps;
2083
2193
  }
2084
- function parsePeriodExpression(periodExpression) {
2085
- const fixed = periodExpression.toLowerCase();
2086
- if (isPeriod(fixed)) {
2087
- return {
2088
- expression: fixed,
2089
- durationMs: PeriodProps[fixed].milliseconds
2090
- };
2091
- }
2092
- const result = fixed.match(CUSTOM_PERIOD_REGEX);
2093
- if (!result || result.length === 0 || result[0] !== fixed)
2094
- return null;
2095
- const years = result[1] ? parseInt(result[1].replace(/\D/g, '')) : 0;
2096
- const months = result[2] ? parseInt(result[2].replace(/\D/g, '')) : 0;
2097
- const weeks = result[3] ? parseInt(result[3].replace(/\D/g, '')) : 0;
2098
- const days = result[4] ? parseInt(result[4].replace(/\D/g, '')) : 0;
2099
- const hours = result[5] ? parseInt(result[5].replace(/\D/g, '')) : 0;
2100
- const yearsMs = years * PeriodProps[Period.YEAR].milliseconds;
2101
- const monthsMs = months * PeriodProps[Period.MONTH].milliseconds;
2102
- const weeksMs = weeks * PeriodProps[Period.WEEK].milliseconds;
2103
- const daysMs = days * PeriodProps[Period.DAY].milliseconds;
2104
- const hoursMs = hours * (PeriodProps[Period.DAY].milliseconds / 24);
2105
- const totalMs = yearsMs + monthsMs + weeksMs + daysMs + hoursMs;
2106
- return {
2107
- expression: result[0],
2108
- durationMs: totalMs
2109
- };
2110
- }
2111
2194
 
2112
- const PlayerTypeProps = {
2113
- [PlayerType.UNKNOWN]: { name: 'Unknown' },
2114
- [PlayerType.REGULAR]: { name: 'Regular' },
2115
- [PlayerType.IRONMAN]: { name: 'Ironman' },
2116
- [PlayerType.HARDCORE]: { name: 'Hardcore' },
2117
- [PlayerType.ULTIMATE]: { name: 'Ultimate' }
2118
- };
2119
2195
  const PlayerBuildProps = {
2120
2196
  [PlayerBuild.MAIN]: { name: 'Main' },
2121
2197
  [PlayerBuild.F2P]: { name: 'F2P' },
@@ -2125,6 +2201,10 @@ const PlayerBuildProps = {
2125
2201
  [PlayerBuild.DEF1]: { name: '1 Defence Pure' },
2126
2202
  [PlayerBuild.HP10]: { name: '10 Hitpoints Pure' }
2127
2203
  };
2204
+ function isPlayerBuild(buildString) {
2205
+ return buildString in PlayerBuildProps;
2206
+ }
2207
+
2128
2208
  const PlayerStatusProps = {
2129
2209
  [PlayerStatus.ACTIVE]: { name: 'Active' },
2130
2210
  [PlayerStatus.UNRANKED]: { name: 'Unranked' },
@@ -2132,257 +2212,19 @@ const PlayerStatusProps = {
2132
2212
  [PlayerStatus.ARCHIVED]: { name: 'Archived' },
2133
2213
  [PlayerStatus.BANNED]: { name: 'Banned' }
2134
2214
  };
2135
- const PLAYER_TYPES = Object.values(PlayerType);
2136
- const PLAYER_BUILDS = Object.values(PlayerBuild);
2137
- const PLAYER_STATUSES = Object.values(PlayerStatus);
2138
- function isPlayerType(typeString) {
2139
- return typeString in PlayerTypeProps;
2140
- }
2141
- function isPlayerBuild(buildString) {
2142
- return buildString in PlayerBuildProps;
2143
- }
2144
2215
  function isPlayerStatus(statusString) {
2145
2216
  return statusString in PlayerStatusProps;
2146
2217
  }
2147
- function findPlayerType(typeName) {
2148
- for (const [key, value] of Object.entries(PlayerTypeProps)) {
2149
- if (value.name.toUpperCase() === typeName.toUpperCase())
2150
- return key;
2151
- }
2152
- return null;
2153
- }
2154
- function findPlayerBuild(buildName) {
2155
- for (const [key, value] of Object.entries(PlayerBuildProps)) {
2156
- if (value.name.toUpperCase() === buildName.toUpperCase())
2157
- return key;
2158
- }
2159
- return null;
2160
- }
2161
-
2162
- function formatNumber(num, withLetters = false, decimalPrecision = 2) {
2163
- if (num === undefined || num === null)
2164
- return -1;
2165
- // If number is float
2166
- if (num % 1 !== 0) {
2167
- return (Math.round(num * 100) / 100).toLocaleString('en-US');
2168
- }
2169
- if ((num < 10000 && num > -10000) || !withLetters) {
2170
- return num.toLocaleString('en-US');
2171
- }
2172
- // < 100k
2173
- if (num < 100000 && num > -100000) {
2174
- // If has no decimals, return as whole number instead (10.00k => 10k)
2175
- if ((num / 1000) % 1 === 0)
2176
- return `${num / 1000}k`;
2177
- return `${(num / 1000).toFixed(decimalPrecision)}k`;
2178
- }
2179
- // < 10 million
2180
- if (num < 10000000 && num > -10000000) {
2181
- return `${Math.round(num / 1000)}k`;
2182
- }
2183
- // < 1 billion
2184
- if (num < 1000000000 && num > -1000000000) {
2185
- // If has no decimals, return as whole number instead (10.00m => 10m)
2186
- if ((num / 1000000) % 1 === 0)
2187
- return `${num / 1000000}m`;
2188
- return `${(num / 1000000).toFixed(decimalPrecision)}m`;
2189
- }
2190
- // If has no decimals, return as whole number instead (10.00b => 10b)
2191
- if ((num / 1000000000) % 1 === 0)
2192
- return `${num / 1000000000}b`;
2193
- return `${(num / 1000000000).toFixed(decimalPrecision)}b`;
2194
- }
2195
- function padNumber(value) {
2196
- if (!value)
2197
- return '00';
2198
- return value < 10 ? `0${value}` : value.toString();
2199
- }
2200
- function round(num, cases) {
2201
- return Math.round(num * Math.pow(10, cases)) / Math.pow(10, cases);
2202
- }
2203
-
2204
- var EfficiencyAlgorithmType;
2205
- (function (EfficiencyAlgorithmType) {
2206
- EfficiencyAlgorithmType["MAIN"] = "main";
2207
- EfficiencyAlgorithmType["IRONMAN"] = "ironman";
2208
- EfficiencyAlgorithmType["ULTIMATE"] = "ultimate";
2209
- EfficiencyAlgorithmType["LVL3"] = "lvl3";
2210
- EfficiencyAlgorithmType["F2P"] = "f2p";
2211
- EfficiencyAlgorithmType["F2P_LVL3"] = "f2p_lvl3";
2212
- EfficiencyAlgorithmType["F2P_IRONMAN"] = "f2p_ironman";
2213
- EfficiencyAlgorithmType["F2P_LVL3_IRONMAN"] = "f2p_lvl3_ironman";
2214
- EfficiencyAlgorithmType["DEF1"] = "def1";
2215
- })(EfficiencyAlgorithmType || (EfficiencyAlgorithmType = {}));
2216
-
2217
- class EfficiencyClient extends BaseAPIClient {
2218
- /**
2219
- * Fetches the current efficiency leaderboard for a specific efficiency metric, playerType, playerBuild and country.
2220
- * @returns A list of players.
2221
- */
2222
- getEfficiencyLeaderboards(filter, pagination) {
2223
- return this.getRequest('/efficiency/leaderboard', Object.assign(Object.assign({}, filter), pagination));
2224
- }
2225
- /**
2226
- * Fetches the top EHP (Efficient Hours Played) rates.
2227
- * @returns A list of skilling methods and their bonus exp ratios.
2228
- */
2229
- getEHPRates(algorithmType) {
2230
- return this.getRequest('/efficiency/rates', {
2231
- metric: Metric.EHP,
2232
- type: algorithmType
2233
- });
2234
- }
2235
- /**
2236
- * Fetches the top EHB (Efficient Hours Bossed) rates.
2237
- * @returns A list of bosses and their respective "per-hour" kill rates.
2238
- */
2239
- getEHBRates(algorithmType) {
2240
- return this.getRequest('/efficiency/rates', {
2241
- metric: Metric.EHB,
2242
- type: algorithmType
2243
- });
2244
- }
2245
- }
2246
-
2247
- class NameChangesClient extends BaseAPIClient {
2248
- /**
2249
- * Searches for name changes that match a name and/or status filter.
2250
- * @returns A list of name changes.
2251
- */
2252
- searchNameChanges(filter, pagination) {
2253
- return this.getRequest('/names', Object.assign(Object.assign({}, filter), pagination));
2254
- }
2255
- /**
2256
- * Submits a name change request between two usernames (old and new).
2257
- * @returns A pending name change request, to be reviewed and resolved at a later date.
2258
- */
2259
- submitNameChange(oldName, newName) {
2260
- return this.postRequest('/names', { oldName, newName });
2261
- }
2262
- }
2263
-
2264
- class CompetitionsClient extends BaseAPIClient {
2265
- /**
2266
- * Searches for competitions that match a title, type, metric and status filter.
2267
- * @returns A list of competitions.
2268
- */
2269
- searchCompetitions(filter, pagination) {
2270
- return this.getRequest('/competitions', Object.assign(Object.assign({}, filter), pagination));
2271
- }
2272
- /**
2273
- * Fetches the competition's full details, including all the participants and their progress.
2274
- * @returns A competition with a list of participants.
2275
- */
2276
- getCompetitionDetails(id, previewMetric) {
2277
- return this.getRequest(`/competitions/${id}`, { metric: previewMetric });
2278
- }
2279
- /**
2280
- * Fetches the competition's participant list in CSV format.
2281
- * @returns A string containing the CSV content.
2282
- */
2283
- getCompetitionDetailsCSV(id, params) {
2284
- return this.getText(`/competitions/${id}/csv`, Object.assign({ metric: params.previewMetric }, params));
2285
- }
2286
- /**
2287
- * Fetches all the values (exp, kc, etc) in chronological order within the bounds
2288
- * of the competition, for the top 5 participants.
2289
- * @returns A list of competition progress objects, including the player and their value history over time.
2290
- */
2291
- getCompetitionTopHistory(id, previewMetric) {
2292
- return this.getRequest(`/competitions/${id}/top-history`, {
2293
- metric: previewMetric
2294
- });
2295
- }
2296
- /**
2297
- * Creates a new competition.
2298
- * @returns The newly created competition, and the verification code that authorizes future changes to it.
2299
- */
2300
- createCompetition(payload) {
2301
- return this.postRequest('/competitions', payload);
2302
- }
2303
- /**
2304
- * Edits an existing competition.
2305
- * @returns The updated competition.
2306
- */
2307
- editCompetition(id, payload, verificationCode) {
2308
- return this.putRequest(`/competitions/${id}`, Object.assign(Object.assign({}, payload), { verificationCode }));
2309
- }
2310
- /**
2311
- * Deletes an existing competition.
2312
- * @returns A confirmation message.
2313
- */
2314
- deleteCompetition(id, verificationCode) {
2315
- return this.deleteRequest(`/competitions/${id}`, { verificationCode });
2316
- }
2317
- /**
2318
- * Adds all (valid) given participants to a competition, ignoring duplicates.
2319
- * @returns The number of participants added and a confirmation message.
2320
- */
2321
- addParticipants(id, participants, verificationCode) {
2322
- return this.postRequest(`/competitions/${id}/participants`, {
2323
- verificationCode,
2324
- participants
2325
- });
2326
- }
2327
- /**
2328
- * Remove all given usernames from a competition, ignoring usernames that aren't competing.
2329
- * @returns The number of participants removed and a confirmation message.
2330
- */
2331
- removeParticipants(id, participants, verificationCode) {
2332
- return this.deleteRequest(`/competitions/${id}/participants`, {
2333
- verificationCode,
2334
- participants
2335
- });
2336
- }
2337
- /**
2338
- * Adds all (valid) given teams to a team competition, ignoring duplicates.
2339
- * @returns The number of participants added and a confirmation message.
2340
- */
2341
- addTeams(id, teams, verificationCode) {
2342
- return this.postRequest(`/competitions/${id}/teams`, {
2343
- verificationCode,
2344
- teams
2345
- });
2346
- }
2347
- /**
2348
- * Remove all given team names from a competition, ignoring names that don't exist.
2349
- * @returns The number of participants removed and a confirmation message.
2350
- */
2351
- removeTeams(id, teamNames, verificationCode) {
2352
- return this.deleteRequest(`/competitions/${id}/teams`, {
2353
- verificationCode,
2354
- teamNames
2355
- });
2356
- }
2357
- /**
2358
- * Adds an "update" request to the queue, for each outdated competition participant.
2359
- * @returns The number of players to be updated and a confirmation message.
2360
- */
2361
- updateAll(id, verificationCode) {
2362
- return this.postRequest(`/competitions/${id}/update-all`, {
2363
- verificationCode
2364
- });
2365
- }
2366
- }
2367
2218
 
2368
- class WOMClient extends BaseAPIClient {
2369
- constructor(options) {
2370
- const baseApiUrl = (options === null || options === void 0 ? void 0 : options.baseAPIUrl) || config.baseAPIUrl;
2371
- const headers = {
2372
- 'x-user-agent': (options === null || options === void 0 ? void 0 : options.userAgent) || config.defaultUserAgent
2373
- };
2374
- if (options === null || options === void 0 ? void 0 : options.apiKey) {
2375
- headers['x-api-key'] = options.apiKey;
2376
- }
2377
- super(headers, baseApiUrl);
2378
- this.deltas = new DeltasClient(headers, baseApiUrl);
2379
- this.groups = new GroupsClient(headers, baseApiUrl);
2380
- this.players = new PlayersClient(headers, baseApiUrl);
2381
- this.records = new RecordsClient(headers, baseApiUrl);
2382
- this.efficiency = new EfficiencyClient(headers, baseApiUrl);
2383
- this.nameChanges = new NameChangesClient(headers, baseApiUrl);
2384
- this.competitions = new CompetitionsClient(headers, baseApiUrl);
2385
- }
2219
+ const PlayerTypeProps = {
2220
+ [PlayerType.UNKNOWN]: { name: 'Unknown' },
2221
+ [PlayerType.REGULAR]: { name: 'Regular' },
2222
+ [PlayerType.IRONMAN]: { name: 'Ironman' },
2223
+ [PlayerType.HARDCORE]: { name: 'Hardcore' },
2224
+ [PlayerType.ULTIMATE]: { name: 'Ultimate' }
2225
+ };
2226
+ function isPlayerType(typeString) {
2227
+ return typeString in PlayerTypeProps;
2386
2228
  }
2387
2229
 
2388
- export { ACTIVITIES, Activity, ActivityType, BOSSES, Boss, CAPPED_MAX_TOTAL_XP, COMBAT_SKILLS, COMPETITION_STATUSES, COMPETITION_TYPES, COMPUTED_METRICS, COUNTRY_CODES, CompetitionCSVTableType, CompetitionStatus, CompetitionStatusProps, CompetitionType, CompetitionTypeProps, ComputedMetric, Country, CountryProps, EfficiencyAlgorithmType, F2P_BOSSES, GROUP_ROLES, GroupRole, GroupRoleProps, MAX_LEVEL, MAX_SKILL_EXP, MAX_VIRTUAL_LEVEL, MEMBER_SKILLS, METRICS, Metric, MetricMeasure, MetricProps, MetricType, NameChangeStatus, PERIODS, PLAYER_BUILDS, PLAYER_STATUSES, PLAYER_TYPES, PRIVELEGED_GROUP_ROLES, Period, PeriodProps, PlayerAnnotationType, PlayerBuild, PlayerBuildProps, PlayerStatus, PlayerStatusProps, PlayerType, PlayerTypeProps, REAL_METRICS, REAL_SKILLS, SKILLS, SKILL_EXP_AT_99, Skill, WOMClient, findCountry, findCountryByCode, findCountryByName, findGroupRole, findMetric, findPeriod, findPlayerBuild, findPlayerType, formatNumber, getCombatLevel, getExpForLevel, getLevel, getMetricMeasure, getMetricName, getMetricRankKey, getMetricValueKey, getMinimumValue, getParentEfficiencyMetric, isActivity, isBoss, isCompetitionStatus, isCompetitionType, isComputedMetric, isCountry, isGroupRole, isMetric, isPeriod, isPlayerBuild, isPlayerStatus, isPlayerType, isSkill, padNumber, parsePeriodExpression, round };
2230
+ export { ACTIVITIES, Activity, ActivityProps, BOSSES, Boss, BossProps, CAPPED_MAX_TOTAL_XP, COMBAT_SKILLS, COMPETITION_STATUSES, COMPETITION_TYPES, COMPUTED_METRICS, COUNTRY_CODES, CompetitionCSVTableType, CompetitionStatus, CompetitionStatusProps, CompetitionType, CompetitionTypeProps, ComputedMetric, ComputedMetricProps, Country, CountryProps, EfficiencyAlgorithmType, F2P_BOSSES, GROUP_ROLES, GroupRole, GroupRoleProps, MAX_LEVEL, MAX_SKILL_EXP, MAX_VIRTUAL_LEVEL, MEMBER_SKILLS, METRICS, MemberActivityType, Metric, MetricMeasure, MetricProps, MetricType, NameChangeStatus, PERIODS, PLAYER_BUILDS, PLAYER_STATUSES, PLAYER_TYPES, PRIVILEGED_GROUP_ROLES, Period, PeriodProps, PlayerAnnotationType, PlayerBuild, PlayerBuildProps, PlayerStatus, PlayerStatusProps, PlayerType, PlayerTypeProps, REAL_METRICS, REAL_SKILLS, SKILLS, SKILL_EXP_AT_99, Skill, SkillProps, WOMClient, findCountry, findCountryByCode, findCountryByName, getCombatLevel, getExpForLevel, getLevel, getMinimumValue, getParentEfficiencyMetric, isActivity, isBoss, isComputedMetric, isCountry, isGroupRole, isMetric, isPeriod, isPlayerBuild, isPlayerStatus, isPlayerType, isSkill };