@wise-old-man/utils 2.0.0-beta.1 → 2.0.0-beta.3

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +470 -128
  2. package/dist/index.js +864 -521
  3. package/package.json +4 -1
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type Achievement$1 = {
1
+ export type Prisma_Base_Achievement = {
2
2
  playerId: number
3
3
  name: string
4
4
  metric: Metric
@@ -22,7 +22,7 @@ export type Competition = {
22
22
  }
23
23
 
24
24
 
25
- export type Delta$1 = {
25
+ export type Prisma_Base_Delta = {
26
26
  id: number
27
27
  playerId: number
28
28
  period: Period
@@ -93,6 +93,8 @@ export type Delta$1 = {
93
93
  theatre_of_blood: number
94
94
  theatre_of_blood_hard_mode: number
95
95
  thermonuclear_smoke_devil: number
96
+ tombs_of_amascut: number
97
+ tombs_of_amascut_expert: number
96
98
  tzkal_zuk: number
97
99
  tztok_jad: number
98
100
  venenatis: number
@@ -166,7 +168,7 @@ export type Participation = {
166
168
  }
167
169
 
168
170
 
169
- export type Player$1 = {
171
+ export type Prisma_Base_Player = {
170
172
  id: number
171
173
  username: string
172
174
  displayName: string
@@ -186,7 +188,7 @@ export type Player$1 = {
186
188
  }
187
189
 
188
190
 
189
- export type Record$1 = {
191
+ export type Prisma_Base_Record = {
190
192
  id: number
191
193
  playerId: number
192
194
  period: Period
@@ -196,7 +198,7 @@ export type Record$1 = {
196
198
  }
197
199
 
198
200
 
199
- export type Snapshot$1 = {
201
+ export type Prisma_Base_Snapshot = {
200
202
  id: number
201
203
  playerId: number
202
204
  importedAt: Date | null
@@ -345,6 +347,10 @@ export type Snapshot$1 = {
345
347
  theatre_of_bloodKills: number
346
348
  thermonuclear_smoke_devilRank: number
347
349
  thermonuclear_smoke_devilKills: number
350
+ tombs_of_amascutRank: number
351
+ tombs_of_amascutKills: number
352
+ tombs_of_amascut_expertRank: number
353
+ tombs_of_amascut_expertKills: number
348
354
  tzkal_zukRank: number
349
355
  tzkal_zukKills: number
350
356
  tztok_jadRank: number
@@ -509,6 +515,8 @@ declare const Boss: {
509
515
  readonly THEATRE_OF_BLOOD: "theatre_of_blood";
510
516
  readonly THEATRE_OF_BLOOD_HARD_MODE: "theatre_of_blood_hard_mode";
511
517
  readonly THERMONUCLEAR_SMOKE_DEVIL: "thermonuclear_smoke_devil";
518
+ readonly TOMBS_OF_AMASCUT: "tombs_of_amascut";
519
+ readonly TOMBS_OF_AMASCUT_EXPERT: "tombs_of_amascut_expert";
512
520
  readonly TZKAL_ZUK: "tzkal_zuk";
513
521
  readonly TZTOK_JAD: "tztok_jad";
514
522
  readonly VENENATIS: "venenatis";
@@ -519,11 +527,11 @@ declare const Boss: {
519
527
  readonly ZULRAH: "zulrah";
520
528
  };
521
529
  declare type Boss = typeof Boss[keyof typeof Boss];
522
- declare const Virtual: {
530
+ declare const ComputedMetric: {
523
531
  readonly EHP: "ehp";
524
532
  readonly EHB: "ehb";
525
533
  };
526
- declare type Virtual = typeof Virtual[keyof typeof Virtual];
534
+ declare type ComputedMetric = typeof ComputedMetric[keyof typeof ComputedMetric];
527
535
  declare const Metric: {
528
536
  readonly EHP: "ehp";
529
537
  readonly EHB: "ehb";
@@ -567,6 +575,8 @@ declare const Metric: {
567
575
  readonly THEATRE_OF_BLOOD: "theatre_of_blood";
568
576
  readonly THEATRE_OF_BLOOD_HARD_MODE: "theatre_of_blood_hard_mode";
569
577
  readonly THERMONUCLEAR_SMOKE_DEVIL: "thermonuclear_smoke_devil";
578
+ readonly TOMBS_OF_AMASCUT: "tombs_of_amascut";
579
+ readonly TOMBS_OF_AMASCUT_EXPERT: "tombs_of_amascut_expert";
570
580
  readonly TZKAL_ZUK: "tzkal_zuk";
571
581
  readonly TZTOK_JAD: "tztok_jad";
572
582
  readonly VENENATIS: "venenatis";
@@ -1195,8 +1205,8 @@ declare const CompetitionTypeProps: CompetitionTypePropsMap;
1195
1205
  declare const CompetitionStatusProps: CompetitionStatusPropsMap;
1196
1206
  declare const COMPETITION_TYPES: ("classic" | "team")[];
1197
1207
  declare const COMPETITION_STATUSES: CompetitionStatus[];
1198
- declare function findCompetitionType(typeName: string): CompetitionType | null;
1199
- declare function findCompetitionStatus(statusName: string): CompetitionStatus | null;
1208
+ declare function isCompetitionType(typeString: string): typeString is CompetitionType;
1209
+ declare function isCompetitionStatus(statusString: string): statusString is CompetitionStatus;
1200
1210
 
1201
1211
  interface CountryDetails {
1202
1212
  code: Country;
@@ -1207,26 +1217,11 @@ declare type CountryPropsMap = {
1207
1217
  };
1208
1218
  declare const CountryProps: CountryPropsMap;
1209
1219
  declare const COUNTRY_CODES: ("AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AO" | "AQ" | "AR" | "AS" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FM" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GS" | "GT" | "GU" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MH" | "MK" | "ML" | "MM" | "MN" | "MO" | "MP" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PR" | "PS" | "PT" | "PW" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VI" | "VN" | "VU" | "WF" | "WS" | "YE" | "YT" | "ZA" | "ZM" | "ZW")[];
1220
+ declare function isCountry(countryCodeString: string): countryCodeString is Country;
1210
1221
  declare function findCountry(countryIdentifier: string): CountryDetails | undefined;
1211
1222
  declare function findCountryByName(countryName: string): CountryDetails | undefined;
1212
1223
  declare function findCountryByCode(countryCode: string): CountryDetails | undefined;
1213
1224
 
1214
- declare type Achievement = Omit<Achievement$1, 'threshold'> & {
1215
- threshold: number;
1216
- };
1217
- declare type Record = Omit<Record$1, 'value'> & {
1218
- value: number;
1219
- };
1220
- declare type Delta = Omit<Delta$1, 'overall'> & {
1221
- overall: number;
1222
- };
1223
- declare type Snapshot = Omit<Snapshot$1, 'overallExperience'> & {
1224
- overallExperience: number;
1225
- };
1226
- declare type Player = Omit<Player$1, 'exp'> & {
1227
- exp: number;
1228
- };
1229
-
1230
1225
  declare const MAX_LEVEL = 99;
1231
1226
  declare const MAX_VIRTUAL_LEVEL = 126;
1232
1227
  declare const MAX_SKILL_EXP = 200000000;
@@ -1234,17 +1229,7 @@ declare const SKILL_EXP_AT_99 = 13034431;
1234
1229
  declare const CAPPED_MAX_TOTAL_XP: number;
1235
1230
  declare function getExpForLevel(level: number): number;
1236
1231
  declare function getLevel(exp: number, virtual?: boolean): number;
1237
- declare function getCombatLevelFromExp(attack: number, strength: number, defence: number, ranged: number, magic: number, hitpoints: number, prayer: number): number;
1238
- declare function getCombatLevel(snapshot: Snapshot): number;
1239
- declare function get200msCount(snapshot: any): number;
1240
- declare function getMinimumExp(snapshot: Snapshot): number;
1241
- declare function getCappedExp(snapshot: Snapshot, max: number): number;
1242
- declare function getTotalLevel(snapshot: Snapshot): number;
1243
- declare function isF2p(snapshot: Snapshot): boolean;
1244
- declare function isLvl3(snapshot: Snapshot): boolean;
1245
- declare function is1Def(snapshot: Snapshot): boolean;
1246
- declare function is10HP(snapshot: Snapshot): boolean;
1247
- declare function isZerker(snapshot: Snapshot): boolean;
1232
+ declare function getCombatLevel(attack: number, strength: number, defence: number, ranged: number, magic: number, hitpoints: number, prayer: number): number;
1248
1233
 
1249
1234
  declare const GROUP_ROLES: ("magic" | "slayer" | "hunter" | "achiever" | "adamant" | "adept" | "administrator" | "admiral" | "adventurer" | "air" | "anchor" | "apothecary" | "archer" | "armadylean" | "artillery" | "artisan" | "asgarnian" | "assassin" | "assistant" | "astral" | "athlete" | "attacker" | "bandit" | "bandosian" | "barbarian" | "battlemage" | "beast" | "berserker" | "blisterwood" | "blood" | "blue" | "bob" | "body" | "brassican" | "brawler" | "brigadier" | "brigand" | "bronze" | "bruiser" | "bulwark" | "burglar" | "burnt" | "cadet" | "captain" | "carry" | "champion" | "chaos" | "cleric" | "collector" | "colonel" | "commander" | "competitor" | "completionist" | "constructor" | "cook" | "coordinator" | "corporal" | "cosmic" | "councillor" | "crafter" | "crew" | "crusader" | "cutpurse" | "death" | "defender" | "defiler" | "deputy_owner" | "destroyer" | "diamond" | "diseased" | "doctor" | "dogsbody" | "dragon" | "dragonstone" | "druid" | "duellist" | "earth" | "elite" | "emerald" | "enforcer" | "epic" | "executive" | "expert" | "explorer" | "farmer" | "feeder" | "fighter" | "fire" | "firemaker" | "firestarter" | "fisher" | "fletcher" | "forager" | "fremennik" | "gamer" | "gatherer" | "general" | "gnome_child" | "gnome_elder" | "goblin" | "gold" | "goon" | "green" | "grey" | "guardian" | "guthixian" | "harpoon" | "healer" | "hellcat" | "helper" | "herbologist" | "hero" | "holy" | "hoarder" | "ignitor" | "illusionist" | "imp" | "infantry" | "inquisitor" | "iron" | "jade" | "justiciar" | "kandarin" | "karamjan" | "kharidian" | "kitten" | "knight" | "labourer" | "law" | "leader" | "learner" | "legacy" | "legend" | "legionnaire" | "lieutenant" | "looter" | "lumberjack" | "magician" | "major" | "maple" | "marshal" | "master" | "maxed" | "mediator" | "medic" | "mentor" | "member" | "merchant" | "mind" | "miner" | "minion" | "misthalinian" | "mithril" | "moderator" | "monarch" | "morytanian" | "mystic" | "myth" | "natural" | "nature" | "necromancer" | "ninja" | "noble" | "novice" | "nurse" | "oak" | "officer" | "onyx" | "opal" | "oracle" | "orange" | "owner" | "page" | "paladin" | "pawn" | "pilgrim" | "pine" | "pink" | "prefect" | "priest" | "private" | "prodigy" | "proselyte" | "prospector" | "protector" | "pure" | "purple" | "pyromancer" | "quester" | "racer" | "raider" | "ranger" | "record_chaser" | "recruit" | "recruiter" | "red_topaz" | "red" | "rogue" | "ruby" | "rune" | "runecrafter" | "sage" | "sapphire" | "saradominist" | "saviour" | "scavenger" | "scholar" | "scourge" | "scout" | "scribe" | "seer" | "senator" | "sentry" | "serenist" | "sergeant" | "shaman" | "sheriff" | "short_green_guy" | "skiller" | "skulled" | "smiter" | "smith" | "smuggler" | "sniper" | "soul" | "specialist" | "speed_runner" | "spellcaster" | "squire" | "staff" | "steel" | "strider" | "striker" | "summoner" | "superior" | "supervisor" | "teacher" | "templar" | "therapist" | "thief" | "tirannian" | "trialist" | "trickster" | "tzkal" | "tztok" | "unholy" | "vagrant" | "vanguard" | "walker" | "wanderer" | "warden" | "warlock" | "warrior" | "water" | "wild" | "willow" | "wily" | "wintumber" | "witch" | "wizard" | "worker" | "wrath" | "xerician" | "yellow" | "yew" | "zamorakian" | "zarosian" | "zealot" | "zenyte")[];
1250
1235
  declare const PRIVELEGED_GROUP_ROLES: GroupRole[];
@@ -1256,12 +1241,13 @@ declare type GroupRolePropsMap = {
1256
1241
  };
1257
1242
  declare const GroupRoleProps: GroupRolePropsMap;
1258
1243
  declare function findGroupRole(roleName: string): GroupRole | null;
1244
+ declare function isGroupRole(roleString: string): roleString is GroupRole;
1259
1245
 
1260
1246
  declare enum MetricType {
1261
1247
  SKILL = "skill",
1262
1248
  BOSS = "boss",
1263
1249
  ACTIVITY = "activity",
1264
- VIRTUAL = "virtual"
1250
+ COMPUTED = "computed"
1265
1251
  }
1266
1252
  declare enum MetricMeasure {
1267
1253
  EXPERIENCE = "experience",
@@ -1283,14 +1269,14 @@ interface BossProperties {
1283
1269
  type: MetricType;
1284
1270
  measure: MetricMeasure;
1285
1271
  }
1286
- interface VirtualProperties {
1272
+ interface ComputedMetricProperties {
1287
1273
  name: string;
1288
1274
  type: MetricType;
1289
1275
  measure: MetricMeasure;
1290
1276
  }
1291
1277
  declare const MetricProps: {
1292
- ehp: VirtualProperties;
1293
- ehb: VirtualProperties;
1278
+ ehp: ComputedMetricProperties;
1279
+ ehb: ComputedMetricProperties;
1294
1280
  abyssal_sire: BossProperties;
1295
1281
  alchemical_hydra: BossProperties;
1296
1282
  barrows_chests: BossProperties;
@@ -1331,6 +1317,8 @@ declare const MetricProps: {
1331
1317
  theatre_of_blood: BossProperties;
1332
1318
  theatre_of_blood_hard_mode: BossProperties;
1333
1319
  thermonuclear_smoke_devil: BossProperties;
1320
+ tombs_of_amascut: BossProperties;
1321
+ tombs_of_amascut_expert: BossProperties;
1334
1322
  tzkal_zuk: BossProperties;
1335
1323
  tztok_jad: BossProperties;
1336
1324
  venenatis: BossProperties;
@@ -1366,24 +1354,25 @@ declare const MetricProps: {
1366
1354
  };
1367
1355
  declare const METRICS: string[];
1368
1356
  declare const SKILLS: ("overall" | "attack" | "defence" | "strength" | "hitpoints" | "ranged" | "prayer" | "magic" | "cooking" | "woodcutting" | "fletching" | "fishing" | "firemaking" | "crafting" | "smithing" | "mining" | "herblore" | "agility" | "thieving" | "slayer" | "farming" | "runecrafting" | "hunter" | "construction")[];
1369
- declare const BOSSES: ("abyssal_sire" | "alchemical_hydra" | "barrows_chests" | "bryophyta" | "callisto" | "cerberus" | "chambers_of_xeric" | "chambers_of_xeric_challenge_mode" | "chaos_elemental" | "chaos_fanatic" | "commander_zilyana" | "corporeal_beast" | "crazy_archaeologist" | "dagannoth_prime" | "dagannoth_rex" | "dagannoth_supreme" | "deranged_archaeologist" | "general_graardor" | "giant_mole" | "grotesque_guardians" | "hespori" | "kalphite_queen" | "king_black_dragon" | "kraken" | "kreearra" | "kril_tsutsaroth" | "mimic" | "nex" | "nightmare" | "phosanis_nightmare" | "obor" | "sarachnis" | "scorpia" | "skotizo" | "tempoross" | "the_gauntlet" | "the_corrupted_gauntlet" | "theatre_of_blood" | "theatre_of_blood_hard_mode" | "thermonuclear_smoke_devil" | "tzkal_zuk" | "tztok_jad" | "venenatis" | "vetion" | "vorkath" | "wintertodt" | "zalcano" | "zulrah")[];
1357
+ declare const BOSSES: ("abyssal_sire" | "alchemical_hydra" | "barrows_chests" | "bryophyta" | "callisto" | "cerberus" | "chambers_of_xeric" | "chambers_of_xeric_challenge_mode" | "chaos_elemental" | "chaos_fanatic" | "commander_zilyana" | "corporeal_beast" | "crazy_archaeologist" | "dagannoth_prime" | "dagannoth_rex" | "dagannoth_supreme" | "deranged_archaeologist" | "general_graardor" | "giant_mole" | "grotesque_guardians" | "hespori" | "kalphite_queen" | "king_black_dragon" | "kraken" | "kreearra" | "kril_tsutsaroth" | "mimic" | "nex" | "nightmare" | "phosanis_nightmare" | "obor" | "sarachnis" | "scorpia" | "skotizo" | "tempoross" | "the_gauntlet" | "the_corrupted_gauntlet" | "theatre_of_blood" | "theatre_of_blood_hard_mode" | "thermonuclear_smoke_devil" | "tombs_of_amascut" | "tombs_of_amascut_expert" | "tzkal_zuk" | "tztok_jad" | "venenatis" | "vetion" | "vorkath" | "wintertodt" | "zalcano" | "zulrah")[];
1370
1358
  declare const ACTIVITIES: string[];
1371
- declare const VIRTUALS: ("ehp" | "ehb")[];
1359
+ declare const COMPUTED_METRICS: ("ehp" | "ehb")[];
1372
1360
  declare const REAL_SKILLS: ("overall" | "attack" | "defence" | "strength" | "hitpoints" | "ranged" | "prayer" | "magic" | "cooking" | "woodcutting" | "fletching" | "fishing" | "firemaking" | "crafting" | "smithing" | "mining" | "herblore" | "agility" | "thieving" | "slayer" | "farming" | "runecrafting" | "hunter" | "construction")[];
1373
- declare const F2P_BOSSES: ("abyssal_sire" | "alchemical_hydra" | "barrows_chests" | "bryophyta" | "callisto" | "cerberus" | "chambers_of_xeric" | "chambers_of_xeric_challenge_mode" | "chaos_elemental" | "chaos_fanatic" | "commander_zilyana" | "corporeal_beast" | "crazy_archaeologist" | "dagannoth_prime" | "dagannoth_rex" | "dagannoth_supreme" | "deranged_archaeologist" | "general_graardor" | "giant_mole" | "grotesque_guardians" | "hespori" | "kalphite_queen" | "king_black_dragon" | "kraken" | "kreearra" | "kril_tsutsaroth" | "mimic" | "nex" | "nightmare" | "phosanis_nightmare" | "obor" | "sarachnis" | "scorpia" | "skotizo" | "tempoross" | "the_gauntlet" | "the_corrupted_gauntlet" | "theatre_of_blood" | "theatre_of_blood_hard_mode" | "thermonuclear_smoke_devil" | "tzkal_zuk" | "tztok_jad" | "venenatis" | "vetion" | "vorkath" | "wintertodt" | "zalcano" | "zulrah")[];
1361
+ declare const F2P_BOSSES: ("abyssal_sire" | "alchemical_hydra" | "barrows_chests" | "bryophyta" | "callisto" | "cerberus" | "chambers_of_xeric" | "chambers_of_xeric_challenge_mode" | "chaos_elemental" | "chaos_fanatic" | "commander_zilyana" | "corporeal_beast" | "crazy_archaeologist" | "dagannoth_prime" | "dagannoth_rex" | "dagannoth_supreme" | "deranged_archaeologist" | "general_graardor" | "giant_mole" | "grotesque_guardians" | "hespori" | "kalphite_queen" | "king_black_dragon" | "kraken" | "kreearra" | "kril_tsutsaroth" | "mimic" | "nex" | "nightmare" | "phosanis_nightmare" | "obor" | "sarachnis" | "scorpia" | "skotizo" | "tempoross" | "the_gauntlet" | "the_corrupted_gauntlet" | "theatre_of_blood" | "theatre_of_blood_hard_mode" | "thermonuclear_smoke_devil" | "tombs_of_amascut" | "tombs_of_amascut_expert" | "tzkal_zuk" | "tztok_jad" | "venenatis" | "vetion" | "vorkath" | "wintertodt" | "zalcano" | "zulrah")[];
1374
1362
  declare const MEMBER_SKILLS: ("overall" | "attack" | "defence" | "strength" | "hitpoints" | "ranged" | "prayer" | "magic" | "cooking" | "woodcutting" | "fletching" | "fishing" | "firemaking" | "crafting" | "smithing" | "mining" | "herblore" | "agility" | "thieving" | "slayer" | "farming" | "runecrafting" | "hunter" | "construction")[];
1375
1363
  declare const COMBAT_SKILLS: ("overall" | "attack" | "defence" | "strength" | "hitpoints" | "ranged" | "prayer" | "magic" | "cooking" | "woodcutting" | "fletching" | "fishing" | "firemaking" | "crafting" | "smithing" | "mining" | "herblore" | "agility" | "thieving" | "slayer" | "farming" | "runecrafting" | "hunter" | "construction")[];
1376
1364
  declare function findMetric(metricName: string): Metric | null;
1377
- declare function isSkill(metric: Metric): boolean;
1378
- declare function isActivity(metric: Metric): boolean;
1379
- declare function isBoss(metric: Metric): boolean;
1380
- declare function isVirtualMetric(metric: Metric): boolean;
1365
+ declare function isMetric(metricString: string): metricString is Metric;
1366
+ declare function isSkill(metric: Metric | string): metric is Skill;
1367
+ declare function isActivity(metric: Metric | string): metric is Activity;
1368
+ declare function isBoss(metric: Metric | string): metric is Boss;
1369
+ declare function isComputedMetric(metric: Metric | string): metric is ComputedMetric;
1381
1370
  declare function getMetricRankKey(metric: Metric): string;
1382
1371
  declare function getMetricValueKey(metric: Metric): string;
1383
1372
  declare function getMetricMeasure(metric: Metric): any;
1384
1373
  declare function getMetricName(metric: Metric): any;
1385
1374
  declare function getMinimumBossKc(metric: Metric): number;
1386
- declare function getParentVirtualMetric(metric: Metric): "ehp" | "ehb";
1375
+ declare function getParentEfficiencyMetric(metric: Metric): "ehp" | "ehb";
1387
1376
  declare function parseMetricAbbreviation(abbreviation: string): string | null;
1388
1377
 
1389
1378
  declare type PeriodPropsMap = {
@@ -1395,6 +1384,7 @@ declare type PeriodPropsMap = {
1395
1384
  declare const PeriodProps: PeriodPropsMap;
1396
1385
  declare const PERIODS: ("five_min" | "day" | "week" | "month" | "year")[];
1397
1386
  declare function findPeriod(periodName: string): Period | null;
1387
+ declare function isPeriod(periodString: string): periodString is Period;
1398
1388
  declare function parsePeriodExpression(periodExpression: string): {
1399
1389
  expression: string;
1400
1390
  durationMs: number;
@@ -1414,6 +1404,8 @@ declare const PlayerTypeProps: PlayerTypePropsMap;
1414
1404
  declare const PlayerBuildProps: PlayerBuildPropsMap;
1415
1405
  declare const PLAYER_TYPES: ("unknown" | "regular" | "ironman" | "hardcore" | "ultimate")[];
1416
1406
  declare const PLAYER_BUILDS: ("main" | "f2p" | "lvl3" | "zerker" | "def1" | "hp10")[];
1407
+ declare function isPlayerType(typeString: string): typeString is PlayerType;
1408
+ declare function isPlayerBuild(buildString: string): buildString is PlayerBuild;
1417
1409
  declare function findPlayerType(typeName: string): PlayerType | null;
1418
1410
  declare function findPlayerBuild(buildName: string): PlayerBuild | null;
1419
1411
 
@@ -1421,6 +1413,19 @@ declare function formatNumber(num: number, withLetters?: boolean): string | -1;
1421
1413
  declare function padNumber(value: number): string;
1422
1414
  declare function round(num: number, cases: number): number;
1423
1415
 
1416
+ declare type Achievement = Omit<Prisma_Base_Achievement, 'threshold'> & {
1417
+ threshold: number;
1418
+ };
1419
+ declare type Record = Omit<Prisma_Base_Record, 'value'> & {
1420
+ value: number;
1421
+ };
1422
+ declare type Snapshot = Omit<Prisma_Base_Snapshot, 'overallExperience'> & {
1423
+ overallExperience: number;
1424
+ };
1425
+ declare type Player = Omit<Prisma_Base_Player, 'exp'> & {
1426
+ exp: number;
1427
+ };
1428
+
1424
1429
  interface AchievementTemplate {
1425
1430
  name: string;
1426
1431
  metric: Metric;
@@ -1468,8 +1473,8 @@ interface ActivityDelta {
1468
1473
  rank: MeasuredDeltaProgress;
1469
1474
  score: MeasuredDeltaProgress;
1470
1475
  }
1471
- interface VirtualDelta {
1472
- metric: Virtual;
1476
+ interface ComputedMetricDelta {
1477
+ metric: ComputedMetric;
1473
1478
  rank: MeasuredDeltaProgress;
1474
1479
  value: MeasuredDeltaProgress;
1475
1480
  }
@@ -1477,7 +1482,7 @@ interface PlayerDeltasArray {
1477
1482
  skills: Array<SkillDelta>;
1478
1483
  bosses: Array<BossDelta>;
1479
1484
  activities: Array<ActivityDelta>;
1480
- virtuals: Array<VirtualDelta>;
1485
+ computed: Array<ComputedMetricDelta>;
1481
1486
  }
1482
1487
  interface PlayerDeltasMap {
1483
1488
  skills: {
@@ -1489,10 +1494,17 @@ interface PlayerDeltasMap {
1489
1494
  activities: {
1490
1495
  [activity in Activity]?: ActivityDelta;
1491
1496
  };
1492
- virtuals: {
1493
- [virtual in Virtual]?: VirtualDelta;
1497
+ computed: {
1498
+ [computedMetric in ComputedMetric]?: ComputedMetricDelta;
1494
1499
  };
1495
1500
  }
1501
+ interface DeltaLeaderboardEntry {
1502
+ player: Player;
1503
+ playerId: number;
1504
+ startDate: Date;
1505
+ endDate: Date;
1506
+ gained: number;
1507
+ }
1496
1508
 
1497
1509
  declare type SnapshotFragment = Omit<Snapshot, 'id'>;
1498
1510
  declare enum SnapshotDataSource {
@@ -1517,8 +1529,8 @@ interface ActivityValue {
1517
1529
  rank: number;
1518
1530
  score: number;
1519
1531
  }
1520
- interface VirtualValue {
1521
- metric: Virtual;
1532
+ interface ComputedMetricValue {
1533
+ metric: ComputedMetric;
1522
1534
  rank: number;
1523
1535
  value: number;
1524
1536
  }
@@ -1537,8 +1549,8 @@ interface FormattedSnapshot {
1537
1549
  activities: {
1538
1550
  [activity in Activity]?: ActivityValue;
1539
1551
  };
1540
- virtuals: {
1541
- [virtual in Virtual]?: VirtualValue;
1552
+ computed: {
1553
+ [computed in ComputedMetric]?: ComputedMetric;
1542
1554
  };
1543
1555
  };
1544
1556
  }
@@ -1559,26 +1571,26 @@ interface MemberInput {
1559
1571
  username: string;
1560
1572
  role: string | GroupRole;
1561
1573
  }
1562
- interface SkillHiscoresItem {
1574
+ interface GroupHiscoresSkillItem {
1563
1575
  rank: number;
1564
1576
  level: number;
1565
1577
  experience: number;
1566
1578
  }
1567
- interface BossHiscoresItem {
1579
+ interface GroupHiscoresBossItem {
1568
1580
  rank: number;
1569
1581
  kills: number;
1570
1582
  }
1571
- interface ActivityHiscoresItem {
1583
+ interface GroupHiscoresActivityItem {
1572
1584
  rank: number;
1573
1585
  score: number;
1574
1586
  }
1575
- interface VirtualHiscoresItem {
1587
+ interface GroupHiscoresComputedMetricItem {
1576
1588
  rank: number;
1577
1589
  value: number;
1578
1590
  }
1579
1591
  interface GroupHiscoresEntry {
1580
- membership: MembershipWithPlayer;
1581
- data: SkillHiscoresItem | BossHiscoresItem | ActivityHiscoresItem | VirtualHiscoresItem;
1592
+ player: Player;
1593
+ data: GroupHiscoresSkillItem | GroupHiscoresBossItem | GroupHiscoresActivityItem | GroupHiscoresComputedMetricItem;
1582
1594
  }
1583
1595
  interface GroupStatistics {
1584
1596
  maxedCombatCount: number;
@@ -1625,6 +1637,13 @@ interface Team {
1625
1637
  name: string;
1626
1638
  participants: string[];
1627
1639
  }
1640
+ declare type Top5ProgressResult = Array<{
1641
+ player: Player;
1642
+ history: Array<{
1643
+ value: number;
1644
+ date: Date;
1645
+ }>;
1646
+ }>;
1628
1647
 
1629
1648
  declare type ExperienceMap = {
1630
1649
  [skill in Skill]?: number;
@@ -1683,23 +1702,130 @@ declare type AlgorithmCache = {
1683
1702
  [a in EfficiencyAlgorithmType]: EfficiencyAlgorithm;
1684
1703
  };
1685
1704
 
1705
+ declare type NameChangeDetails = {
1706
+ nameChange: NameChange;
1707
+ data?: {
1708
+ isNewOnHiscores: boolean;
1709
+ isOldOnHiscores: boolean;
1710
+ isNewTracked: boolean;
1711
+ hasNegativeGains: boolean;
1712
+ timeDiff: number;
1713
+ hoursDiff: number;
1714
+ ehpDiff: number;
1715
+ ehbDiff: number;
1716
+ oldStats: FormattedSnapshot;
1717
+ newStats: FormattedSnapshot;
1718
+ };
1719
+ };
1720
+
1686
1721
  declare type PlayerResolvable = Partial<Pick<Player, 'id' | 'username'>>;
1687
1722
  interface PlayerDetails extends Player {
1688
1723
  combatLevel: number;
1689
1724
  latestSnapshot: FormattedSnapshot;
1690
1725
  }
1691
1726
 
1692
- declare type PaginationOptions = Partial<{
1693
- limit: number;
1694
- offset: number;
1695
- }>;
1727
+ declare type RecordLeaderboardEntry = Record & {
1728
+ player: Player;
1729
+ };
1696
1730
 
1731
+ interface GenericCountMessageResponse {
1732
+ count: number;
1733
+ message: string;
1734
+ }
1735
+ interface GenericMessageResponse {
1736
+ message: string;
1737
+ }
1697
1738
  declare type TimeRangeFilter = {
1698
1739
  period: Period | string;
1699
1740
  } | {
1700
1741
  startDate: Date;
1701
1742
  endDate: Date;
1702
1743
  };
1744
+ interface BasePlayerFilter {
1745
+ country?: Country;
1746
+ playerType?: PlayerType;
1747
+ playerBuild?: PlayerBuild;
1748
+ }
1749
+ /**
1750
+ * Groups Client Types
1751
+ */
1752
+ interface GroupMemberFragment {
1753
+ username: string;
1754
+ role?: GroupRole;
1755
+ }
1756
+ interface CreateGroupPayload {
1757
+ name: string;
1758
+ clanChat?: string;
1759
+ homeworld?: number;
1760
+ description?: string;
1761
+ members: Array<GroupMemberFragment>;
1762
+ }
1763
+ declare type EditGroupPayload = Partial<CreateGroupPayload>;
1764
+ interface CreateGroupResponse {
1765
+ group: GroupWithMemberships;
1766
+ verificationCode: string;
1767
+ }
1768
+ interface ChangeMemberRolePayload {
1769
+ username: string;
1770
+ role: GroupRole;
1771
+ }
1772
+ declare type GetGroupGainsFilter = {
1773
+ metric: Metric;
1774
+ } & TimeRangeFilter;
1775
+ interface GroupRecordsFilter {
1776
+ metric: Metric;
1777
+ period: Period;
1778
+ }
1779
+ /**
1780
+ * Competitions Client Types
1781
+ */
1782
+ interface CompetitionsSearchFilter {
1783
+ title?: string;
1784
+ metric?: Metric;
1785
+ type?: CompetitionType;
1786
+ status?: CompetitionStatus;
1787
+ }
1788
+ declare type CreateCompetitionPayload = {
1789
+ title: string;
1790
+ metric: Metric;
1791
+ startsAt: Date;
1792
+ endsAt: Date;
1793
+ groupId?: number;
1794
+ groupVerificationCode?: string;
1795
+ } & ({
1796
+ participants: string[];
1797
+ } | {
1798
+ teams: Team[];
1799
+ });
1800
+ declare type EditCompetitionPayload = {
1801
+ title?: string;
1802
+ metric?: Metric;
1803
+ startsAt?: Date;
1804
+ endsAt?: Date;
1805
+ participants?: string[];
1806
+ teams?: Team[];
1807
+ };
1808
+ declare type CreateCompetitionResponse = {
1809
+ competition: CompetitionWithParticipations;
1810
+ verificationCode: string;
1811
+ };
1812
+ /**
1813
+ * Name Changes Client Types
1814
+ */
1815
+ declare type NameChangesSearchFilter = {
1816
+ username?: string;
1817
+ status?: NameChangeStatus;
1818
+ };
1819
+ /**
1820
+ * Record Client Types
1821
+ */
1822
+ interface RecordLeaderboardFilter extends BasePlayerFilter {
1823
+ metric: Metric;
1824
+ period: Period | string;
1825
+ }
1826
+ /**
1827
+ * Player Client Types
1828
+ */
1703
1829
  interface PlayerRecordsFilter {
1704
1830
  period: Period | string;
1705
1831
  metric: Metric;
@@ -1708,92 +1834,308 @@ interface AssertPlayerTypeResponse {
1708
1834
  player: Player;
1709
1835
  changed: boolean;
1710
1836
  }
1711
- interface ImportPlayerResponse {
1712
- count: number;
1713
- message: string;
1714
- }
1715
- declare type SearchPlayersResponse = Player[];
1716
- declare type UpdatePlayerResponse = PlayerDetails;
1717
- declare type GetPlayerDetailsResponse = PlayerDetails;
1718
- declare type GetPlayerAchievementsResponse = ExtendedAchievement[];
1719
- declare type GetPlayerAchievementProgressResponse = AchievementProgress[];
1720
- declare type GetPlayerCompetitionsResponse = ParticipationWithCompetition[];
1721
- declare type GetPlayerGroupsResponse = MembershipWithGroup[];
1722
- declare type GetPlayerRecordsResponse = Record[];
1723
- declare type GetPlayerNamesResponse = NameChange[];
1724
- declare type GetPlayerSnapshotsResponse = FormattedSnapshot[];
1725
1837
  declare type GetPlayerGainsResponse<T extends PlayerDeltasArray | PlayerDeltasMap> = {
1726
1838
  startsAt: Date;
1727
1839
  endsAt: Date;
1728
1840
  data: T;
1729
1841
  };
1842
+ /**
1843
+ * Efficiency Client Types
1844
+ */
1845
+ declare type EfficiencyAlgorithmTypeUnion = `${EfficiencyAlgorithmType}`;
1846
+ interface EfficiencyLeaderboardsFilter extends BasePlayerFilter {
1847
+ metric: typeof Metric.EHP | typeof Metric.EHB | 'ehp+ehb';
1848
+ }
1849
+ /**
1850
+ * Delta Client Types
1851
+ */
1852
+ interface DeltaLeaderboardFilter extends BasePlayerFilter {
1853
+ metric: Metric;
1854
+ period: Period | string;
1855
+ }
1856
+
1857
+ declare class DeltasClient {
1858
+ /**
1859
+ * Fetches the current top leaderboard for a specific metric, period, playerType, playerBuild and country.
1860
+ * @returns A list of deltas, with their respective players, values and dates included.
1861
+ */
1862
+ getDeltaLeaderboard(filter: DeltaLeaderboardFilter): Promise<DeltaLeaderboardEntry[]>;
1863
+ }
1864
+
1865
+ declare type PaginationOptions = Partial<{
1866
+ limit: number;
1867
+ offset: number;
1868
+ }>;
1869
+
1870
+ declare class GroupsClient {
1871
+ /**
1872
+ * Searches for groups that match a partial name.
1873
+ * @returns A list of groups.
1874
+ */
1875
+ searchGroups(name: string, pagination?: PaginationOptions): Promise<GroupListItem[]>;
1876
+ /**
1877
+ * Fetches a group's details.
1878
+ * @returns A group details object.
1879
+ */
1880
+ getGroupDetails(id: number): Promise<GroupListItem>;
1881
+ /**
1882
+ * Fetches a group's entire members list.
1883
+ * @returns A list of memberships, with players included.
1884
+ */
1885
+ getGroupMembers(id: number): Promise<MembershipWithPlayer[]>;
1886
+ /**
1887
+ * Creates a new group.
1888
+ * @returns The newly created group, and the verification code that authorizes future changes to it.
1889
+ */
1890
+ createGroup(payload: CreateGroupPayload): Promise<CreateGroupResponse>;
1891
+ /**
1892
+ * Edits an existing group.
1893
+ * @returns The updated group.
1894
+ */
1895
+ editGroup(id: number, payload: EditGroupPayload, verificationCode: string): Promise<GroupWithMemberships>;
1896
+ /**
1897
+ * Deletes an existing group.
1898
+ * @returns A confirmation message.
1899
+ */
1900
+ deleteGroup(id: number, verificationCode: string): Promise<GenericMessageResponse>;
1901
+ /**
1902
+ * Adds all (valid) given usernames (and roles) to a group, ignoring duplicates.
1903
+ * @returns The number of members added and a confirmation message.
1904
+ */
1905
+ addMembers(id: number, members: GroupMemberFragment[], verificationCode: string): Promise<GenericCountMessageResponse>;
1906
+ /**
1907
+ * Remove all given usernames from a group, ignoring usernames that aren't members.
1908
+ * @returns The number of members removed and a confirmation message.
1909
+ */
1910
+ removeMembers(id: number, usernames: string[], verificationCode: string): Promise<GenericCountMessageResponse>;
1911
+ /**
1912
+ * Changes a player's role in a given group.
1913
+ * @returns The updated membership, with player included.
1914
+ */
1915
+ changeRole(id: number, payload: ChangeMemberRolePayload, verificationCode: string): Promise<MembershipWithPlayer>;
1916
+ /**
1917
+ * Adds an "update" request to the queue, for each outdated group member.
1918
+ * @returns The number of players to be updated and a confirmation message.
1919
+ */
1920
+ updateAll(id: number, verificationCode: string): Promise<GenericCountMessageResponse>;
1921
+ /**
1922
+ * Fetches all of the groups's competitions
1923
+ * @returns A list of competitions.
1924
+ */
1925
+ getGroupCompetitions(id: number, pagination?: PaginationOptions): Promise<CompetitionListItem[]>;
1926
+ getGroupGains(id: number, filter: GetGroupGainsFilter, pagination?: PaginationOptions): Promise<DeltaLeaderboardEntry[]>;
1927
+ /**
1928
+ * Fetches a group members' latest achievements.
1929
+ * @returns A list of achievements.
1930
+ */
1931
+ getGroupAchievements(id: number, pagination?: PaginationOptions): Promise<ExtendedAchievement[]>;
1932
+ /**
1933
+ * Fetches a group's record leaderboard for a specific metric and period.
1934
+ * @returns A list of records, including their respective players.
1935
+ */
1936
+ getGroupRecords(id: number, filter: GroupRecordsFilter, pagination?: PaginationOptions): Promise<RecordLeaderboardEntry[]>;
1937
+ /**
1938
+ * Fetches a group's hiscores for a specific metric.
1939
+ * @returns A list of hiscores entries (value, rank), including their respective players.
1940
+ */
1941
+ getGroupHiscores(id: number, metric: Metric, pagination?: PaginationOptions): Promise<GroupHiscoresEntry[]>;
1942
+ /**
1943
+ * Fetches a group members' latest name changes.
1944
+ * @returns A list of name change (approved) requests.
1945
+ */
1946
+ getGroupNameChanges(id: number, pagination?: PaginationOptions): Promise<NameChange[]>;
1947
+ /**
1948
+ * Fetches a group's general statistics.
1949
+ * @returns An object with a few statistic values and an average stats snapshot.
1950
+ */
1951
+ getGroupStatistics(id: number): Promise<GroupStatistics>;
1952
+ }
1953
+
1730
1954
  declare class PlayersClient {
1731
- searchPlayers(partialUsername: string, pagination?: PaginationOptions): Promise<SearchPlayersResponse>;
1955
+ /**
1956
+ * Searches players by partial username.
1957
+ * @returns A list of players.
1958
+ */
1959
+ searchPlayers(partialUsername: string, pagination?: PaginationOptions): Promise<Player[]>;
1960
+ /**
1961
+ * Updates/tracks a player.
1962
+ * @returns The player's new details, including the latest snapshot.
1963
+ */
1732
1964
  updatePlayer(player: PlayerResolvable): Promise<PlayerDetails>;
1965
+ /**
1966
+ * Asserts (and attempts to fix, if necessary) a player's game-mode type.
1967
+ * @returns The updated player, and an indication of whether the type was changed.
1968
+ */
1733
1969
  assertPlayerType(player: PlayerResolvable): Promise<AssertPlayerTypeResponse>;
1734
- importPlayer(player: PlayerResolvable): Promise<ImportPlayerResponse>;
1970
+ /**
1971
+ * Attempts to import a player's snapshot history from CrystalMathLabs.
1972
+ * @returns The number of snapshots that were imported.
1973
+ */
1974
+ importPlayer(player: PlayerResolvable): Promise<GenericCountMessageResponse>;
1975
+ /**
1976
+ * Fetches a player's details.
1977
+ * @returns The player's details, including the latest snapshot.
1978
+ */
1735
1979
  getPlayerDetails(player: PlayerResolvable): Promise<PlayerDetails>;
1736
- getPlayerAchievements(player: PlayerResolvable): Promise<GetPlayerAchievementsResponse>;
1737
- getPlayerAchievementProgress(player: PlayerResolvable): Promise<GetPlayerAchievementProgressResponse>;
1738
- getPlayerCompetitions(player: PlayerResolvable, pagination?: PaginationOptions): Promise<GetPlayerCompetitionsResponse>;
1739
- getPlayerGroups(player: PlayerResolvable, pagination?: PaginationOptions): Promise<GetPlayerGroupsResponse>;
1980
+ /**
1981
+ * Fetches a player's current achievements.
1982
+ * @returns A list of achievements.
1983
+ */
1984
+ getPlayerAchievements(player: PlayerResolvable): Promise<ExtendedAchievement[]>;
1985
+ /**
1986
+ * Fetches a player's current achievement progress.
1987
+ * @returns A list of achievements (completed or otherwise), with their respective relative/absolute progress percentage.
1988
+ */
1989
+ getPlayerAchievementProgress(player: PlayerResolvable): Promise<AchievementProgress[]>;
1990
+ /**
1991
+ * Fetches all of the player's competition participations.
1992
+ * @returns A list of participations, with the respective competition included.
1993
+ */
1994
+ getPlayerCompetitions(player: PlayerResolvable, pagination?: PaginationOptions): Promise<ParticipationWithCompetition[]>;
1995
+ /**
1996
+ * Fetches all of the player's group memberships.
1997
+ * @returns A list of memberships, with the respective group included.
1998
+ */
1999
+ getPlayerGroups(player: PlayerResolvable, pagination?: PaginationOptions): Promise<MembershipWithGroup[]>;
2000
+ /**
2001
+ * Fetches a player's gains, for a specific period or time range, as a [metric: data] map.
2002
+ * @returns A map of each metric's gained data.
2003
+ */
1740
2004
  getPlayerGains(player: PlayerResolvable, options: TimeRangeFilter): Promise<GetPlayerGainsResponse<PlayerDeltasMap>>;
2005
+ /**
2006
+ * Fetches a player's gains, for a specific period or time range, as an array.
2007
+ * @returns An array of each metric's gained data.
2008
+ */
1741
2009
  getPlayerGainsAsArray(player: PlayerResolvable, options: TimeRangeFilter): Promise<GetPlayerGainsResponse<PlayerDeltasArray>>;
1742
- getPlayerRecords(player: PlayerResolvable, options?: PlayerRecordsFilter): Promise<GetPlayerRecordsResponse>;
1743
- getPlayerSnapshots(player: PlayerResolvable, options?: TimeRangeFilter): Promise<GetPlayerSnapshotsResponse>;
1744
- getPlayerNames(player: PlayerResolvable): Promise<GetPlayerNamesResponse>;
2010
+ /**
2011
+ * Fetches all of the player's records.
2012
+ * @returns A list of records.
2013
+ */
2014
+ getPlayerRecords(player: PlayerResolvable, options?: PlayerRecordsFilter): Promise<Record[]>;
2015
+ /**
2016
+ * Fetches all of the player's past snapshots.
2017
+ * @returns A list of snapshots.
2018
+ */
2019
+ getPlayerSnapshots(player: PlayerResolvable, options?: TimeRangeFilter): Promise<FormattedSnapshot[]>;
2020
+ /**
2021
+ * Fetches all of the player's approved name changes.
2022
+ * @returns A list of name changes.
2023
+ */
2024
+ getPlayerNames(player: PlayerResolvable): Promise<NameChange[]>;
1745
2025
  }
1746
2026
 
1747
- interface RecordLeaderboardFilter {
1748
- metric: Metric;
1749
- period: Period | string;
1750
- country?: Country;
1751
- playerType?: PlayerType;
1752
- playerBuild?: PlayerBuild;
1753
- }
1754
- declare type GetRecordLeaderboardResponse = Array<Record & {
1755
- player: Player;
1756
- }>;
1757
2027
  declare class RecordsClient {
1758
- getRecordLeaderboard(filter: RecordLeaderboardFilter): Promise<GetRecordLeaderboardResponse>;
2028
+ /**
2029
+ * Fetches the current records leaderboard for a specific metric, period, playerType, playerBuild and country.
2030
+ * @returns A list of records, with their respective players, dates and values included.
2031
+ */
2032
+ getRecordLeaderboard(filter: RecordLeaderboardFilter): Promise<RecordLeaderboardEntry[]>;
1759
2033
  }
1760
2034
 
1761
- interface DeltaLeaderboardFilter {
1762
- metric: Metric;
1763
- period: Period | string;
1764
- country?: Country;
1765
- playerType?: PlayerType;
1766
- playerBuild?: PlayerBuild;
1767
- }
1768
- declare type GetDeltaLeaderboardResponse = Array<{
1769
- startDate: Date;
1770
- endDate: Date;
1771
- gained: number;
1772
- player: Player;
1773
- }>;
1774
- declare class DeltasClient {
1775
- getDeltaLeaderboard(filter: DeltaLeaderboardFilter): Promise<GetDeltaLeaderboardResponse>;
2035
+ declare class EfficiencyClient {
2036
+ /**
2037
+ * Fetches the current efficiency leaderboard for a specific efficiency metric, playerType, playerBuild and country.
2038
+ * @returns A list of players.
2039
+ */
2040
+ getEfficiencyLeaderboards(filter: EfficiencyLeaderboardsFilter, pagination?: PaginationOptions): Promise<Player[]>;
2041
+ /**
2042
+ * Fetches the top EHP (Efficient Hours Played) rates.
2043
+ * @returns A list of skilling methods and their bonus exp ratios.
2044
+ */
2045
+ getEHPRates(algorithmType: EfficiencyAlgorithmTypeUnion): Promise<SkillMetaConfig>;
2046
+ /**
2047
+ * Fetches the top EHB (Efficient Hours Bossed) rates.
2048
+ * @returns A list of bosses and their respective "per-hour" kill rates.
2049
+ */
2050
+ getEHBRates(algorithmType: EfficiencyAlgorithmTypeUnion): Promise<BossMetaConfig[]>;
1776
2051
  }
1777
2052
 
1778
- interface EfficiencyLeaderboardsFilter {
1779
- metric: typeof Metric.EHP | typeof Metric.EHB | 'ehp+ehb';
1780
- country?: Country;
1781
- playerType?: PlayerType;
1782
- playerBuild?: PlayerBuild;
2053
+ declare class NameChangesClient {
2054
+ /**
2055
+ * Searches for name changes that match a name and/or status filter.
2056
+ * @returns A list of name changes.
2057
+ */
2058
+ searchNameChanges(filter: NameChangesSearchFilter, pagination?: PaginationOptions): Promise<NameChange[]>;
2059
+ /**
2060
+ * Submits a name change request between two usernames (old and new).
2061
+ * @returns A pending name change request, to be reviewed and resolved at a later date.
2062
+ */
2063
+ submitNameChange(oldName: string, newName: string): Promise<NameChange>;
2064
+ /**
2065
+ * Gets details on a specific name change request.
2066
+ * @returns The name change request's details, which includes all data required to review.
2067
+ */
2068
+ getNameChangeDetails(id: number): Promise<NameChangeDetails>;
1783
2069
  }
1784
- declare type GetEfficiencyLeaderboardsResponse = Player[];
1785
- declare class EfficiencyClient {
1786
- getEfficiencyLeaderboards(filter: EfficiencyLeaderboardsFilter, pagination?: PaginationOptions): Promise<GetEfficiencyLeaderboardsResponse>;
1787
- getEHPRates(algorithmType: `${EfficiencyAlgorithmType}`): Promise<SkillMetaConfig>;
1788
- getEHBRates(algorithmType: `${EfficiencyAlgorithmType}`): Promise<BossMetaConfig[]>;
2070
+
2071
+ declare class CompetitionsClient {
2072
+ /**
2073
+ * Searches for competitions that match a title, type, metric and status filter.
2074
+ * @returns A list of competitions.
2075
+ */
2076
+ searchCompetitions(filter: CompetitionsSearchFilter, pagination?: PaginationOptions): Promise<CompetitionListItem[]>;
2077
+ /**
2078
+ * Fetches the competition's full details, including all the participants and their progress.
2079
+ * @returns A competition with a list of participants.
2080
+ */
2081
+ getCompetitionDetails(id: number, previewMetric?: Metric): Promise<CompetitionDetails>;
2082
+ /**
2083
+ * Fetches all the values (exp, kc, etc) in chronological order within the bounds
2084
+ * of the competition, for the top 5 participants.
2085
+ * @returns A list of competition progress objects, including the player and their value history over time.
2086
+ */
2087
+ getCompetitionTopHistory(id: number, previewMetric?: Metric): Promise<Top5ProgressResult>;
2088
+ /**
2089
+ * Creates a new competition.
2090
+ * @returns The newly created competition, and the verification code that authorizes future changes to it.
2091
+ */
2092
+ createCompetition(payload: CreateCompetitionPayload): Promise<CreateCompetitionResponse>;
2093
+ /**
2094
+ * Edits an existing competition.
2095
+ * @returns The updated competition.
2096
+ */
2097
+ editCompetition(id: number, payload: EditCompetitionPayload, verificationCode: string): Promise<CompetitionWithParticipations>;
2098
+ /**
2099
+ * Deletes an existing competition.
2100
+ * @returns A confirmation message.
2101
+ */
2102
+ deleteCompetition(id: number, verificationCode: string): Promise<GenericMessageResponse>;
2103
+ /**
2104
+ * Adds all (valid) given participants to a competition, ignoring duplicates.
2105
+ * @returns The number of participants added and a confirmation message.
2106
+ */
2107
+ addParticipants(id: number, participants: string[], verificationCode: string): Promise<GenericCountMessageResponse>;
2108
+ /**
2109
+ * Remove all given usernames from a competition, ignoring usernames that aren't competing.
2110
+ * @returns The number of participants removed and a confirmation message.
2111
+ */
2112
+ removeParticipants(id: number, participants: string[], verificationCode: string): Promise<GenericCountMessageResponse>;
2113
+ /**
2114
+ * Adds all (valid) given teams to a team competition, ignoring duplicates.
2115
+ * @returns The number of participants added and a confirmation message.
2116
+ */
2117
+ addTeams(id: number, teams: Team[], verificationCode: string): Promise<GenericCountMessageResponse>;
2118
+ /**
2119
+ * Remove all given team names from a competition, ignoring names that don't exist.
2120
+ * @returns The number of participants removed and a confirmation message.
2121
+ */
2122
+ removeTeams(id: number, teamNames: string[], verificationCode: string): Promise<GenericCountMessageResponse>;
2123
+ /**
2124
+ * Adds an "update" request to the queue, for each outdated competition participant.
2125
+ * @returns The number of players to be updated and a confirmation message.
2126
+ */
2127
+ updateAll(id: number, verificationCode: string): Promise<GenericCountMessageResponse>;
1789
2128
  }
1790
2129
 
1791
2130
  declare class WOMClient {
2131
+ deltas: DeltasClient;
2132
+ groups: GroupsClient;
1792
2133
  players: PlayersClient;
1793
2134
  records: RecordsClient;
1794
- deltas: DeltasClient;
1795
2135
  efficiency: EfficiencyClient;
2136
+ nameChanges: NameChangesClient;
2137
+ competitions: CompetitionsClient;
1796
2138
  constructor();
1797
2139
  }
1798
2140
 
1799
- export { ACTIVITIES, Achievement, AchievementDefinition, AchievementProgress, AchievementTemplate, Activity, ActivityDelta, ActivityValue, AlgorithmCache, AssertPlayerTypeResponse, BOSSES, Bonus, BonusType, Boss, BossDelta, BossMetaConfig, BossValue, CAPPED_MAX_TOTAL_XP, CMLGroupData, COMBAT_SKILLS, COMPETITION_STATUSES, COMPETITION_TYPES, COUNTRY_CODES, CompetitionDetails, CompetitionListItem, CompetitionStatus, CompetitionStatusProps, CompetitionType, CompetitionTypeProps, CompetitionWithParticipations, Country, CountryDetails, CountryProps, Delta, DeltaLeaderboardFilter, EfficiencyAlgorithm, EfficiencyAlgorithmType, EfficiencyLeaderboardsFilter, EfficiencyMap, ExperienceMap, ExtendedAchievement, F2P_BOSSES, FormattedSnapshot, GROUP_ROLES, GetDeltaLeaderboardResponse, GetEfficiencyLeaderboardsResponse, GetPlayerAchievementProgressResponse, GetPlayerAchievementsResponse, GetPlayerCompetitionsResponse, GetPlayerDetailsResponse, GetPlayerGainsResponse, GetPlayerGroupsResponse, GetPlayerNamesResponse, GetPlayerRecordsResponse, GetPlayerSnapshotsResponse, GetRecordLeaderboardResponse, GroupHiscoresEntry, GroupListItem, GroupRole, GroupRoleProps, GroupStatistics, GroupWithMemberships, ImportPlayerResponse, KillcountMap, MAX_LEVEL, MAX_SKILL_EXP, MAX_VIRTUAL_LEVEL, MEMBER_SKILLS, METRICS, MeasuredDeltaProgress, MemberInput, MembershipWithGroup, MembershipWithPlayer, Metric, MetricMeasure, MetricProps, MetricType, MigrationDataSource, NameChangeStatus, PERIODS, PLAYER_BUILDS, PLAYER_TYPES, PRIVELEGED_GROUP_ROLES, ParticipationWithCompetition, ParticipationWithPlayer, ParticipationWithPlayerAndProgress, Period, PeriodProps, Player, PlayerBuild, PlayerBuildProps, PlayerDeltasArray, PlayerDeltasMap, PlayerDetails, PlayerRecordsFilter, PlayerResolvable, PlayerType, PlayerTypeProps, REAL_SKILLS, Record, RecordLeaderboardFilter, SKILLS, SKILL_EXP_AT_99, SearchPlayersResponse, Skill, SkillDelta, SkillMetaConfig, SkillValue, Snapshot, SnapshotDataSource, SnapshotFragment, Team, TempleGroupData, TimeRangeFilter, UpdatePlayerResponse, VIRTUALS, Virtual, VirtualDelta, VirtualValue, WOMClient, findCompetitionStatus, findCompetitionType, findCountry, findCountryByCode, findCountryByName, findGroupRole, findMetric, findPeriod, findPlayerBuild, findPlayerType, formatNumber, get200msCount, getCappedExp, getCombatLevel, getCombatLevelFromExp, getExpForLevel, getLevel, getMetricMeasure, getMetricName, getMetricRankKey, getMetricValueKey, getMinimumBossKc, getMinimumExp, getParentVirtualMetric, getTotalLevel, is10HP, is1Def, isActivity, isBoss, isF2p, isLvl3, isSkill, isVirtualMetric, isZerker, padNumber, parseMetricAbbreviation, parsePeriodExpression, round };
2141
+ export { ACTIVITIES, Achievement, AchievementDefinition, AchievementProgress, AchievementTemplate, Activity, ActivityDelta, ActivityValue, AlgorithmCache, AssertPlayerTypeResponse, BOSSES, Bonus, BonusType, Boss, BossDelta, BossMetaConfig, BossValue, CAPPED_MAX_TOTAL_XP, CMLGroupData, COMBAT_SKILLS, COMPETITION_STATUSES, COMPETITION_TYPES, COMPUTED_METRICS, COUNTRY_CODES, ChangeMemberRolePayload, CompetitionDetails, CompetitionListItem, CompetitionStatus, CompetitionStatusProps, CompetitionType, CompetitionTypeProps, CompetitionWithParticipations, CompetitionsSearchFilter, ComputedMetric, ComputedMetricDelta, ComputedMetricValue, Country, CountryDetails, CountryProps, CreateCompetitionPayload, CreateCompetitionResponse, CreateGroupPayload, CreateGroupResponse, DeltaLeaderboardEntry, DeltaLeaderboardFilter, EditCompetitionPayload, EditGroupPayload, EfficiencyAlgorithm, EfficiencyAlgorithmType, EfficiencyAlgorithmTypeUnion, EfficiencyLeaderboardsFilter, EfficiencyMap, ExperienceMap, ExtendedAchievement, F2P_BOSSES, FormattedSnapshot, GROUP_ROLES, GenericCountMessageResponse, GenericMessageResponse, GetGroupGainsFilter, GetPlayerGainsResponse, GroupHiscoresActivityItem, GroupHiscoresBossItem, GroupHiscoresComputedMetricItem, GroupHiscoresEntry, GroupHiscoresSkillItem, GroupListItem, GroupMemberFragment, GroupRecordsFilter, GroupRole, GroupRoleProps, GroupStatistics, GroupWithMemberships, KillcountMap, MAX_LEVEL, MAX_SKILL_EXP, MAX_VIRTUAL_LEVEL, MEMBER_SKILLS, METRICS, MeasuredDeltaProgress, MemberInput, MembershipWithGroup, MembershipWithPlayer, Metric, MetricMeasure, MetricProps, MetricType, MigrationDataSource, NameChangeDetails, NameChangeStatus, NameChangesSearchFilter, PERIODS, PLAYER_BUILDS, PLAYER_TYPES, PRIVELEGED_GROUP_ROLES, ParticipationWithCompetition, ParticipationWithPlayer, ParticipationWithPlayerAndProgress, Period, PeriodProps, Player, PlayerBuild, PlayerBuildProps, PlayerDeltasArray, PlayerDeltasMap, PlayerDetails, PlayerRecordsFilter, PlayerResolvable, PlayerType, PlayerTypeProps, REAL_SKILLS, Record, RecordLeaderboardEntry, RecordLeaderboardFilter, SKILLS, SKILL_EXP_AT_99, Skill, SkillDelta, SkillMetaConfig, SkillValue, Snapshot, SnapshotDataSource, SnapshotFragment, Team, TempleGroupData, TimeRangeFilter, Top5ProgressResult, WOMClient, findCountry, findCountryByCode, findCountryByName, findGroupRole, findMetric, findPeriod, findPlayerBuild, findPlayerType, formatNumber, getCombatLevel, getExpForLevel, getLevel, getMetricMeasure, getMetricName, getMetricRankKey, getMetricValueKey, getMinimumBossKc, getParentEfficiencyMetric, isActivity, isBoss, isCompetitionStatus, isCompetitionType, isComputedMetric, isCountry, isGroupRole, isMetric, isPeriod, isPlayerBuild, isPlayerType, isSkill, padNumber, parseMetricAbbreviation, parsePeriodExpression, round };