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