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