@wise-old-man/utils 1.0.25 → 2.0.0-beta.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/.prettierrc +7 -0
- package/dist/index.js +2217 -0
- package/package.json +14 -16
- package/prisma-transform.js +35 -0
- package/rollup.config.js +24 -0
- package/src/client.ts +18 -0
- package/src/clients/DeltasClient.ts +23 -0
- package/src/clients/EfficiencyClient.ts +37 -0
- package/src/clients/PlayersClient.ts +136 -0
- package/src/clients/RecordsClient.ts +18 -0
- package/src/config.ts +4 -0
- package/src/index.ts +10 -0
- package/src/sandbox.ts +26 -0
- package/src/utils.ts +159 -0
- package/tsconfig.json +13 -0
- package/dist/lib/competitions.d.ts +0 -33
- package/dist/lib/competitions.js +0 -51
- package/dist/lib/competitions.js.map +0 -1
- package/dist/lib/countries.d.ts +0 -17
- package/dist/lib/countries.js +0 -278
- package/dist/lib/countries.js.map +0 -1
- package/dist/lib/experience.d.ts +0 -9
- package/dist/lib/experience.js +0 -69
- package/dist/lib/experience.js.map +0 -1
- package/dist/lib/groups.d.ts +0 -1622
- package/dist/lib/groups.js +0 -564
- package/dist/lib/groups.js.map +0 -1
- package/dist/lib/index.d.ts +0 -9
- package/dist/lib/index.js +0 -22
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/metrics.d.ts +0 -21470
- package/dist/lib/metrics.js +0 -540
- package/dist/lib/metrics.js.map +0 -1
- package/dist/lib/numbers.d.ts +0 -2
- package/dist/lib/numbers.js +0 -8
- package/dist/lib/numbers.js.map +0 -1
- package/dist/lib/periods.d.ts +0 -37
- package/dist/lib/periods.js +0 -66
- package/dist/lib/periods.js.map +0 -1
- package/dist/lib/players.d.ts +0 -59
- package/dist/lib/players.js +0 -72
- package/dist/lib/players.js.map +0 -1
- package/dist/lib/strings.d.ts +0 -3
- package/dist/lib/strings.js +0 -32
- package/dist/lib/strings.js.map +0 -1
package/dist/index.js
ADDED
|
@@ -0,0 +1,2217 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var axios = require('axios');
|
|
6
|
+
var dayjs = require('dayjs');
|
|
7
|
+
var customParseFormaPlugin = require('dayjs/plugin/customParseFormat');
|
|
8
|
+
var lodash = require('lodash');
|
|
9
|
+
|
|
10
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
+
|
|
12
|
+
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
13
|
+
var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
|
|
14
|
+
var customParseFormaPlugin__default = /*#__PURE__*/_interopDefaultLegacy(customParseFormaPlugin);
|
|
15
|
+
|
|
16
|
+
/******************************************************************************
|
|
17
|
+
Copyright (c) Microsoft Corporation.
|
|
18
|
+
|
|
19
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
20
|
+
purpose with or without fee is hereby granted.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
23
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
24
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
25
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
26
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
27
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
28
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
29
|
+
***************************************************************************** */
|
|
30
|
+
|
|
31
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
32
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
33
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
34
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
35
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
36
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
37
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
var config = {
|
|
42
|
+
// apiBaseUrl: 'http://localhost:5001'
|
|
43
|
+
apiBaseUrl: 'https://api.wiseoldman.net/v2'
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
dayjs__default["default"].extend(customParseFormaPlugin__default["default"]);
|
|
47
|
+
function traverseTransform(input, transformation) {
|
|
48
|
+
if (Array.isArray(input)) {
|
|
49
|
+
return input.map(item => traverseTransform(item, transformation));
|
|
50
|
+
}
|
|
51
|
+
if (input !== null && typeof input === 'object') {
|
|
52
|
+
return Object.fromEntries(Object.keys(input).map(key => [key, traverseTransform(input[key], transformation)]));
|
|
53
|
+
}
|
|
54
|
+
return transformation(input);
|
|
55
|
+
}
|
|
56
|
+
function isValidISODate(input) {
|
|
57
|
+
if (!input || typeof input !== 'string')
|
|
58
|
+
return false;
|
|
59
|
+
// DayJS has a bug with strict parsing with timezones https://github.com/iamkun/dayjs/issues/929
|
|
60
|
+
// So I'll just strip the "Z" timezone
|
|
61
|
+
return input.endsWith('Z') && dayjs__default["default"](input.slice(0, -1), 'YYYY-MM-DDTHH:mm:ss.SSS', true).isValid();
|
|
62
|
+
}
|
|
63
|
+
function transformDates(input) {
|
|
64
|
+
return traverseTransform(input, val => (isValidISODate(val) ? new Date(val) : val));
|
|
65
|
+
}
|
|
66
|
+
function handleError(requestURL, e) {
|
|
67
|
+
var _a;
|
|
68
|
+
if (!((_a = e.response) === null || _a === void 0 ? void 0 : _a.data))
|
|
69
|
+
return;
|
|
70
|
+
const data = e.response.data;
|
|
71
|
+
if (e.response.status === 400) {
|
|
72
|
+
throw new BadRequestError(requestURL, data.message, data.data);
|
|
73
|
+
}
|
|
74
|
+
if (e.response.status === 403) {
|
|
75
|
+
throw new ForbiddenError(requestURL, data.message);
|
|
76
|
+
}
|
|
77
|
+
if (e.response.status === 404) {
|
|
78
|
+
throw new NotFoundError(requestURL, data.message);
|
|
79
|
+
}
|
|
80
|
+
if (e.response.status === 429) {
|
|
81
|
+
throw new RateLimitError(requestURL, data.message);
|
|
82
|
+
}
|
|
83
|
+
if (e.response.status === 500) {
|
|
84
|
+
throw new InternalServerError(requestURL, data.message);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function sendPostRequest(path, body) {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
const requestURL = `${config.apiBaseUrl}${path}`;
|
|
90
|
+
return axios__default["default"]
|
|
91
|
+
.post(requestURL, body || {})
|
|
92
|
+
.then(response => transformDates(response.data))
|
|
93
|
+
.catch(e => {
|
|
94
|
+
if (axios__default["default"].isAxiosError(e))
|
|
95
|
+
handleError(requestURL, e);
|
|
96
|
+
throw e;
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function sendGetRequest(path, params) {
|
|
101
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
const requestURL = `${config.apiBaseUrl}${path}`;
|
|
103
|
+
return axios__default["default"]
|
|
104
|
+
.get(requestURL, { params })
|
|
105
|
+
.then(response => transformDates(response.data))
|
|
106
|
+
.catch(e => {
|
|
107
|
+
if (axios__default["default"].isAxiosError(e))
|
|
108
|
+
handleError(requestURL, e);
|
|
109
|
+
throw e;
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
class BadRequestError extends Error {
|
|
114
|
+
constructor(resource, message, data) {
|
|
115
|
+
super(message);
|
|
116
|
+
this.name = 'BadRequestError';
|
|
117
|
+
this.resource = resource;
|
|
118
|
+
this.statusCode = 400;
|
|
119
|
+
this.data = data;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
class ForbiddenError extends Error {
|
|
123
|
+
constructor(resource, message) {
|
|
124
|
+
super(message);
|
|
125
|
+
this.name = 'ForbiddenError';
|
|
126
|
+
this.resource = resource;
|
|
127
|
+
this.statusCode = 403;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
class NotFoundError extends Error {
|
|
131
|
+
constructor(resource, message) {
|
|
132
|
+
super(message);
|
|
133
|
+
this.name = 'NotFoundError';
|
|
134
|
+
this.resource = resource;
|
|
135
|
+
this.statusCode = 404;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
class RateLimitError extends Error {
|
|
139
|
+
constructor(resource, message) {
|
|
140
|
+
super(message);
|
|
141
|
+
this.name = 'RateLimitError';
|
|
142
|
+
this.resource = resource;
|
|
143
|
+
this.statusCode = 429;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
class InternalServerError extends Error {
|
|
147
|
+
constructor(resource, message) {
|
|
148
|
+
super(message);
|
|
149
|
+
this.name = 'InternalServerError';
|
|
150
|
+
this.resource = resource;
|
|
151
|
+
this.statusCode = 500;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function getPlayerURL(player) {
|
|
156
|
+
if (typeof player === 'string') {
|
|
157
|
+
return `/players/${player}`;
|
|
158
|
+
}
|
|
159
|
+
if (player.id) {
|
|
160
|
+
return `/players/id/${player.id}`;
|
|
161
|
+
}
|
|
162
|
+
return `/players/${player.username}`;
|
|
163
|
+
}
|
|
164
|
+
class PlayersClient {
|
|
165
|
+
searchPlayers(partialUsername, pagination) {
|
|
166
|
+
return sendGetRequest('/players/search', Object.assign({ username: partialUsername }, pagination));
|
|
167
|
+
}
|
|
168
|
+
updatePlayer(player) {
|
|
169
|
+
return sendPostRequest(getPlayerURL(player));
|
|
170
|
+
}
|
|
171
|
+
assertPlayerType(player) {
|
|
172
|
+
return sendPostRequest(`${getPlayerURL(player)}/assert-type`);
|
|
173
|
+
}
|
|
174
|
+
importPlayer(player) {
|
|
175
|
+
return sendPostRequest(`${getPlayerURL(player)}/import-history`);
|
|
176
|
+
}
|
|
177
|
+
getPlayerDetails(player) {
|
|
178
|
+
return sendGetRequest(getPlayerURL(player));
|
|
179
|
+
}
|
|
180
|
+
getPlayerAchievements(player) {
|
|
181
|
+
return sendGetRequest(`${getPlayerURL(player)}/achievements`);
|
|
182
|
+
}
|
|
183
|
+
getPlayerAchievementProgress(player) {
|
|
184
|
+
return sendGetRequest(`${getPlayerURL(player)}/achievements/progress`);
|
|
185
|
+
}
|
|
186
|
+
getPlayerCompetitions(player, pagination) {
|
|
187
|
+
return sendGetRequest(`${getPlayerURL(player)}/competitions`, pagination);
|
|
188
|
+
}
|
|
189
|
+
getPlayerGroups(player, pagination) {
|
|
190
|
+
return sendGetRequest(`${getPlayerURL(player)}/groups`, pagination);
|
|
191
|
+
}
|
|
192
|
+
getPlayerGains(player, options) {
|
|
193
|
+
return sendGetRequest(`${getPlayerURL(player)}/gained`, options);
|
|
194
|
+
}
|
|
195
|
+
getPlayerGainsAsArray(player, options) {
|
|
196
|
+
return sendGetRequest(`${getPlayerURL(player)}/gained`, Object.assign(Object.assign({}, options), { formatting: 'array' }));
|
|
197
|
+
}
|
|
198
|
+
getPlayerRecords(player, options) {
|
|
199
|
+
return sendGetRequest(`${getPlayerURL(player)}/records`, options);
|
|
200
|
+
}
|
|
201
|
+
getPlayerSnapshots(player, options) {
|
|
202
|
+
return sendGetRequest(`${getPlayerURL(player)}/snapshots`, options);
|
|
203
|
+
}
|
|
204
|
+
getPlayerNames(player) {
|
|
205
|
+
return sendGetRequest(`${getPlayerURL(player)}/names`);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
class RecordsClient {
|
|
210
|
+
getRecordLeaderboard(filter) {
|
|
211
|
+
return sendGetRequest('/records/leaderboard', filter);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
class DeltasClient {
|
|
216
|
+
getDeltaLeaderboard(filter) {
|
|
217
|
+
return sendGetRequest('/deltas/leaderboard', filter);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Prisma currently seems to ignore the @map() in enum declarations.
|
|
223
|
+
*
|
|
224
|
+
* So by declaring this enum in the schema file:
|
|
225
|
+
*
|
|
226
|
+
* enum NameChangeStatus {
|
|
227
|
+
* PENDING @map('pending')
|
|
228
|
+
* DENIED @map('denied')
|
|
229
|
+
* APPROVED @map('approved')
|
|
230
|
+
* }
|
|
231
|
+
*
|
|
232
|
+
* you would expect the prisma client to then generate the following object:
|
|
233
|
+
*
|
|
234
|
+
* const NameChangeStatus = {
|
|
235
|
+
* PENDING: 'pending',
|
|
236
|
+
* DENIED: 'denied',
|
|
237
|
+
* APPROVED: 'approved',
|
|
238
|
+
* }
|
|
239
|
+
*
|
|
240
|
+
* but unfortunately, the mapping is only used for queries, and the actual esulting object is this:
|
|
241
|
+
*
|
|
242
|
+
* const NameChangeStatus = {
|
|
243
|
+
* PENDING: 'PENDING',
|
|
244
|
+
* DENIED: 'DENIED',
|
|
245
|
+
* APPROVED: 'APPROVED',
|
|
246
|
+
* }
|
|
247
|
+
*
|
|
248
|
+
* And because I'd hate having to call enum values in lowercase, like:
|
|
249
|
+
* NameChangeStatus.pending
|
|
250
|
+
* Metric.king_black_dragon
|
|
251
|
+
* Period.day
|
|
252
|
+
*
|
|
253
|
+
* I'd rather do some mapping to ensure I have the best of both worlds,
|
|
254
|
+
* lowercase database values, but with uppercase in code.
|
|
255
|
+
* With the mappings below, we can now use prisma enums by calling them with uppercase, like:
|
|
256
|
+
*
|
|
257
|
+
* NameChangeStatus.PENDING
|
|
258
|
+
* Metric.KING_BLACK_DRAGON
|
|
259
|
+
* Period.DAY
|
|
260
|
+
*
|
|
261
|
+
*/
|
|
262
|
+
const Skill = {
|
|
263
|
+
OVERALL: 'overall',
|
|
264
|
+
ATTACK: 'attack',
|
|
265
|
+
DEFENCE: 'defence',
|
|
266
|
+
STRENGTH: 'strength',
|
|
267
|
+
HITPOINTS: 'hitpoints',
|
|
268
|
+
RANGED: 'ranged',
|
|
269
|
+
PRAYER: 'prayer',
|
|
270
|
+
MAGIC: 'magic',
|
|
271
|
+
COOKING: 'cooking',
|
|
272
|
+
WOODCUTTING: 'woodcutting',
|
|
273
|
+
FLETCHING: 'fletching',
|
|
274
|
+
FISHING: 'fishing',
|
|
275
|
+
FIREMAKING: 'firemaking',
|
|
276
|
+
CRAFTING: 'crafting',
|
|
277
|
+
SMITHING: 'smithing',
|
|
278
|
+
MINING: 'mining',
|
|
279
|
+
HERBLORE: 'herblore',
|
|
280
|
+
AGILITY: 'agility',
|
|
281
|
+
THIEVING: 'thieving',
|
|
282
|
+
SLAYER: 'slayer',
|
|
283
|
+
FARMING: 'farming',
|
|
284
|
+
RUNECRAFTING: 'runecrafting',
|
|
285
|
+
HUNTER: 'hunter',
|
|
286
|
+
CONSTRUCTION: 'construction'
|
|
287
|
+
};
|
|
288
|
+
const Activity = {
|
|
289
|
+
LEAGUE_POINTS: 'league_points',
|
|
290
|
+
BOUNTY_HUNTER_HUNTER: 'bounty_hunter_hunter',
|
|
291
|
+
BOUNTY_HUNTER_ROGUE: 'bounty_hunter_rogue',
|
|
292
|
+
CLUE_SCROLLS_ALL: 'clue_scrolls_all',
|
|
293
|
+
CLUE_SCROLLS_BEGINNER: 'clue_scrolls_beginner',
|
|
294
|
+
CLUE_SCROLLS_EASY: 'clue_scrolls_easy',
|
|
295
|
+
CLUE_SCROLLS_MEDIUM: 'clue_scrolls_medium',
|
|
296
|
+
CLUE_SCROLLS_HARD: 'clue_scrolls_hard',
|
|
297
|
+
CLUE_SCROLLS_ELITE: 'clue_scrolls_elite',
|
|
298
|
+
CLUE_SCROLLS_MASTER: 'clue_scrolls_master',
|
|
299
|
+
LAST_MAN_STANDING: 'last_man_standing',
|
|
300
|
+
PVP_ARENA: 'pvp_arena',
|
|
301
|
+
SOUL_WARS_ZEAL: 'soul_wars_zeal',
|
|
302
|
+
GUARDIANS_OF_THE_RIFT: 'guardians_of_the_rift'
|
|
303
|
+
};
|
|
304
|
+
const Boss = {
|
|
305
|
+
ABYSSAL_SIRE: 'abyssal_sire',
|
|
306
|
+
ALCHEMICAL_HYDRA: 'alchemical_hydra',
|
|
307
|
+
BARROWS_CHESTS: 'barrows_chests',
|
|
308
|
+
BRYOPHYTA: 'bryophyta',
|
|
309
|
+
CALLISTO: 'callisto',
|
|
310
|
+
CERBERUS: 'cerberus',
|
|
311
|
+
CHAMBERS_OF_XERIC: 'chambers_of_xeric',
|
|
312
|
+
CHAMBERS_OF_XERIC_CM: 'chambers_of_xeric_challenge_mode',
|
|
313
|
+
CHAOS_ELEMENTAL: 'chaos_elemental',
|
|
314
|
+
CHAOS_FANATIC: 'chaos_fanatic',
|
|
315
|
+
COMMANDER_ZILYANA: 'commander_zilyana',
|
|
316
|
+
CORPOREAL_BEAST: 'corporeal_beast',
|
|
317
|
+
CRAZY_ARCHAEOLOGIST: 'crazy_archaeologist',
|
|
318
|
+
DAGANNOTH_PRIME: 'dagannoth_prime',
|
|
319
|
+
DAGANNOTH_REX: 'dagannoth_rex',
|
|
320
|
+
DAGANNOTH_SUPREME: 'dagannoth_supreme',
|
|
321
|
+
DERANGED_ARCHAEOLOGIST: 'deranged_archaeologist',
|
|
322
|
+
GENERAL_GRAARDOR: 'general_graardor',
|
|
323
|
+
GIANT_MOLE: 'giant_mole',
|
|
324
|
+
GROTESQUE_GUARDIANS: 'grotesque_guardians',
|
|
325
|
+
HESPORI: 'hespori',
|
|
326
|
+
KALPHITE_QUEEN: 'kalphite_queen',
|
|
327
|
+
KING_BLACK_DRAGON: 'king_black_dragon',
|
|
328
|
+
KRAKEN: 'kraken',
|
|
329
|
+
KREEARRA: 'kreearra',
|
|
330
|
+
KRIL_TSUTSAROTH: 'kril_tsutsaroth',
|
|
331
|
+
MIMIC: 'mimic',
|
|
332
|
+
NEX: 'nex',
|
|
333
|
+
NIGHTMARE: 'nightmare',
|
|
334
|
+
PHOSANIS_NIGHTMARE: 'phosanis_nightmare',
|
|
335
|
+
OBOR: 'obor',
|
|
336
|
+
SARACHNIS: 'sarachnis',
|
|
337
|
+
SCORPIA: 'scorpia',
|
|
338
|
+
SKOTIZO: 'skotizo',
|
|
339
|
+
TEMPOROSS: 'tempoross',
|
|
340
|
+
THE_GAUNTLET: 'the_gauntlet',
|
|
341
|
+
THE_CORRUPTED_GAUNTLET: 'the_corrupted_gauntlet',
|
|
342
|
+
THEATRE_OF_BLOOD: 'theatre_of_blood',
|
|
343
|
+
THEATRE_OF_BLOOD_HARD_MODE: 'theatre_of_blood_hard_mode',
|
|
344
|
+
THERMONUCLEAR_SMOKE_DEVIL: 'thermonuclear_smoke_devil',
|
|
345
|
+
TZKAL_ZUK: 'tzkal_zuk',
|
|
346
|
+
TZTOK_JAD: 'tztok_jad',
|
|
347
|
+
VENENATIS: 'venenatis',
|
|
348
|
+
VETION: 'vetion',
|
|
349
|
+
VORKATH: 'vorkath',
|
|
350
|
+
WINTERTODT: 'wintertodt',
|
|
351
|
+
ZALCANO: 'zalcano',
|
|
352
|
+
ZULRAH: 'zulrah'
|
|
353
|
+
};
|
|
354
|
+
const Virtual = {
|
|
355
|
+
EHP: 'ehp',
|
|
356
|
+
EHB: 'ehb'
|
|
357
|
+
};
|
|
358
|
+
const Metric = Object.assign(Object.assign(Object.assign(Object.assign({}, Skill), Activity), Boss), Virtual);
|
|
359
|
+
const NameChangeStatus = {
|
|
360
|
+
PENDING: 'pending',
|
|
361
|
+
DENIED: 'denied',
|
|
362
|
+
APPROVED: 'approved'
|
|
363
|
+
};
|
|
364
|
+
const Period = {
|
|
365
|
+
FIVE_MIN: 'five_min',
|
|
366
|
+
DAY: 'day',
|
|
367
|
+
WEEK: 'week',
|
|
368
|
+
MONTH: 'month',
|
|
369
|
+
YEAR: 'year'
|
|
370
|
+
};
|
|
371
|
+
const PlayerType = {
|
|
372
|
+
UNKNOWN: 'unknown',
|
|
373
|
+
REGULAR: 'regular',
|
|
374
|
+
IRONMAN: 'ironman',
|
|
375
|
+
HARDCORE: 'hardcore',
|
|
376
|
+
ULTIMATE: 'ultimate'
|
|
377
|
+
};
|
|
378
|
+
const PlayerBuild = {
|
|
379
|
+
MAIN: 'main',
|
|
380
|
+
F2P: 'f2p',
|
|
381
|
+
LVL3: 'lvl3',
|
|
382
|
+
ZERKER: 'zerker',
|
|
383
|
+
DEF1: 'def1',
|
|
384
|
+
HP10: 'hp10'
|
|
385
|
+
};
|
|
386
|
+
const CompetitionType = {
|
|
387
|
+
CLASSIC: 'classic',
|
|
388
|
+
TEAM: 'team'
|
|
389
|
+
};
|
|
390
|
+
const GroupRole = {
|
|
391
|
+
ACHIEVER: 'achiever',
|
|
392
|
+
ADAMANT: 'adamant',
|
|
393
|
+
ADEPT: 'adept',
|
|
394
|
+
ADMINISTRATOR: 'administrator',
|
|
395
|
+
ADMIRAL: 'admiral',
|
|
396
|
+
ADVENTURER: 'adventurer',
|
|
397
|
+
AIR: 'air',
|
|
398
|
+
ANCHOR: 'anchor',
|
|
399
|
+
APOTHECARY: 'apothecary',
|
|
400
|
+
ARCHER: 'archer',
|
|
401
|
+
ARMADYLEAN: 'armadylean',
|
|
402
|
+
ARTILLERY: 'artillery',
|
|
403
|
+
ARTISAN: 'artisan',
|
|
404
|
+
ASGARNIAN: 'asgarnian',
|
|
405
|
+
ASSASSIN: 'assassin',
|
|
406
|
+
ASSISTANT: 'assistant',
|
|
407
|
+
ASTRAL: 'astral',
|
|
408
|
+
ATHLETE: 'athlete',
|
|
409
|
+
ATTACKER: 'attacker',
|
|
410
|
+
BANDIT: 'bandit',
|
|
411
|
+
BANDOSIAN: 'bandosian',
|
|
412
|
+
BARBARIAN: 'barbarian',
|
|
413
|
+
BATTLEMAGE: 'battlemage',
|
|
414
|
+
BEAST: 'beast',
|
|
415
|
+
BERSERKER: 'berserker',
|
|
416
|
+
BLISTERWOOD: 'blisterwood',
|
|
417
|
+
BLOOD: 'blood',
|
|
418
|
+
BLUE: 'blue',
|
|
419
|
+
BOB: 'bob',
|
|
420
|
+
BODY: 'body',
|
|
421
|
+
BRASSICAN: 'brassican',
|
|
422
|
+
BRAWLER: 'brawler',
|
|
423
|
+
BRIGADIER: 'brigadier',
|
|
424
|
+
BRIGAND: 'brigand',
|
|
425
|
+
BRONZE: 'bronze',
|
|
426
|
+
BRUISER: 'bruiser',
|
|
427
|
+
BULWARK: 'bulwark',
|
|
428
|
+
BURGLAR: 'burglar',
|
|
429
|
+
BURNT: 'burnt',
|
|
430
|
+
CADET: 'cadet',
|
|
431
|
+
CAPTAIN: 'captain',
|
|
432
|
+
CARRY: 'carry',
|
|
433
|
+
CHAMPION: 'champion',
|
|
434
|
+
CHAOS: 'chaos',
|
|
435
|
+
CLERIC: 'cleric',
|
|
436
|
+
COLLECTOR: 'collector',
|
|
437
|
+
COLONEL: 'colonel',
|
|
438
|
+
COMMANDER: 'commander',
|
|
439
|
+
COMPETITOR: 'competitor',
|
|
440
|
+
COMPLETIONIST: 'completionist',
|
|
441
|
+
CONSTRUCTOR: 'constructor',
|
|
442
|
+
COOK: 'cook',
|
|
443
|
+
COORDINATOR: 'coordinator',
|
|
444
|
+
CORPORAL: 'corporal',
|
|
445
|
+
COSMIC: 'cosmic',
|
|
446
|
+
COUNCILLOR: 'councillor',
|
|
447
|
+
CRAFTER: 'crafter',
|
|
448
|
+
CREW: 'crew',
|
|
449
|
+
CRUSADER: 'crusader',
|
|
450
|
+
CUTPURSE: 'cutpurse',
|
|
451
|
+
DEATH: 'death',
|
|
452
|
+
DEFENDER: 'defender',
|
|
453
|
+
DEFILER: 'defiler',
|
|
454
|
+
DEPUTY_OWNER: 'deputy_owner',
|
|
455
|
+
DESTROYER: 'destroyer',
|
|
456
|
+
DIAMOND: 'diamond',
|
|
457
|
+
DISEASED: 'diseased',
|
|
458
|
+
DOCTOR: 'doctor',
|
|
459
|
+
DOGSBODY: 'dogsbody',
|
|
460
|
+
DRAGON: 'dragon',
|
|
461
|
+
DRAGONSTONE: 'dragonstone',
|
|
462
|
+
DRUID: 'druid',
|
|
463
|
+
DUELLIST: 'duellist',
|
|
464
|
+
EARTH: 'earth',
|
|
465
|
+
ELITE: 'elite',
|
|
466
|
+
EMERALD: 'emerald',
|
|
467
|
+
ENFORCER: 'enforcer',
|
|
468
|
+
EPIC: 'epic',
|
|
469
|
+
EXECUTIVE: 'executive',
|
|
470
|
+
EXPERT: 'expert',
|
|
471
|
+
EXPLORER: 'explorer',
|
|
472
|
+
FARMER: 'farmer',
|
|
473
|
+
FEEDER: 'feeder',
|
|
474
|
+
FIGHTER: 'fighter',
|
|
475
|
+
FIRE: 'fire',
|
|
476
|
+
FIREMAKER: 'firemaker',
|
|
477
|
+
FIRESTARTER: 'firestarter',
|
|
478
|
+
FISHER: 'fisher',
|
|
479
|
+
FLETCHER: 'fletcher',
|
|
480
|
+
FORAGER: 'forager',
|
|
481
|
+
FREMENNIK: 'fremennik',
|
|
482
|
+
GAMER: 'gamer',
|
|
483
|
+
GATHERER: 'gatherer',
|
|
484
|
+
GENERAL: 'general',
|
|
485
|
+
GNOME_CHILD: 'gnome_child',
|
|
486
|
+
GNOME_ELDER: 'gnome_elder',
|
|
487
|
+
GOBLIN: 'goblin',
|
|
488
|
+
GOLD: 'gold',
|
|
489
|
+
GOON: 'goon',
|
|
490
|
+
GREEN: 'green',
|
|
491
|
+
GREY: 'grey',
|
|
492
|
+
GUARDIAN: 'guardian',
|
|
493
|
+
GUTHIXIAN: 'guthixian',
|
|
494
|
+
HARPOON: 'harpoon',
|
|
495
|
+
HEALER: 'healer',
|
|
496
|
+
HELLCAT: 'hellcat',
|
|
497
|
+
HELPER: 'helper',
|
|
498
|
+
HERBOLOGIST: 'herbologist',
|
|
499
|
+
HERO: 'hero',
|
|
500
|
+
HOLY: 'holy',
|
|
501
|
+
HOARDER: 'hoarder',
|
|
502
|
+
HUNTER: 'hunter',
|
|
503
|
+
IGNITOR: 'ignitor',
|
|
504
|
+
ILLUSIONIST: 'illusionist',
|
|
505
|
+
IMP: 'imp',
|
|
506
|
+
INFANTRY: 'infantry',
|
|
507
|
+
INQUISITOR: 'inquisitor',
|
|
508
|
+
IRON: 'iron',
|
|
509
|
+
JADE: 'jade',
|
|
510
|
+
JUSTICIAR: 'justiciar',
|
|
511
|
+
KANDARIN: 'kandarin',
|
|
512
|
+
KARAMJAN: 'karamjan',
|
|
513
|
+
KHARIDIAN: 'kharidian',
|
|
514
|
+
KITTEN: 'kitten',
|
|
515
|
+
KNIGHT: 'knight',
|
|
516
|
+
LABOURER: 'labourer',
|
|
517
|
+
LAW: 'law',
|
|
518
|
+
LEADER: 'leader',
|
|
519
|
+
LEARNER: 'learner',
|
|
520
|
+
LEGACY: 'legacy',
|
|
521
|
+
LEGEND: 'legend',
|
|
522
|
+
LEGIONNAIRE: 'legionnaire',
|
|
523
|
+
LIEUTENANT: 'lieutenant',
|
|
524
|
+
LOOTER: 'looter',
|
|
525
|
+
LUMBERJACK: 'lumberjack',
|
|
526
|
+
MAGIC: 'magic',
|
|
527
|
+
MAGICIAN: 'magician',
|
|
528
|
+
MAJOR: 'major',
|
|
529
|
+
MAPLE: 'maple',
|
|
530
|
+
MARSHAL: 'marshal',
|
|
531
|
+
MASTER: 'master',
|
|
532
|
+
MAXED: 'maxed',
|
|
533
|
+
MEDIATOR: 'mediator',
|
|
534
|
+
MEDIC: 'medic',
|
|
535
|
+
MENTOR: 'mentor',
|
|
536
|
+
MEMBER: 'member',
|
|
537
|
+
MERCHANT: 'merchant',
|
|
538
|
+
MIND: 'mind',
|
|
539
|
+
MINER: 'miner',
|
|
540
|
+
MINION: 'minion',
|
|
541
|
+
MISTHALINIAN: 'misthalinian',
|
|
542
|
+
MITHRIL: 'mithril',
|
|
543
|
+
MODERATOR: 'moderator',
|
|
544
|
+
MONARCH: 'monarch',
|
|
545
|
+
MORYTANIAN: 'morytanian',
|
|
546
|
+
MYSTIC: 'mystic',
|
|
547
|
+
MYTH: 'myth',
|
|
548
|
+
NATURAL: 'natural',
|
|
549
|
+
NATURE: 'nature',
|
|
550
|
+
NECROMANCER: 'necromancer',
|
|
551
|
+
NINJA: 'ninja',
|
|
552
|
+
NOBLE: 'noble',
|
|
553
|
+
NOVICE: 'novice',
|
|
554
|
+
NURSE: 'nurse',
|
|
555
|
+
OAK: 'oak',
|
|
556
|
+
OFFICER: 'officer',
|
|
557
|
+
ONYX: 'onyx',
|
|
558
|
+
OPAL: 'opal',
|
|
559
|
+
ORACLE: 'oracle',
|
|
560
|
+
ORANGE: 'orange',
|
|
561
|
+
OWNER: 'owner',
|
|
562
|
+
PAGE: 'page',
|
|
563
|
+
PALADIN: 'paladin',
|
|
564
|
+
PAWN: 'pawn',
|
|
565
|
+
PILGRIM: 'pilgrim',
|
|
566
|
+
PINE: 'pine',
|
|
567
|
+
PINK: 'pink',
|
|
568
|
+
PREFECT: 'prefect',
|
|
569
|
+
PRIEST: 'priest',
|
|
570
|
+
PRIVATE: 'private',
|
|
571
|
+
PRODIGY: 'prodigy',
|
|
572
|
+
PROSELYTE: 'proselyte',
|
|
573
|
+
PROSPECTOR: 'prospector',
|
|
574
|
+
PROTECTOR: 'protector',
|
|
575
|
+
PURE: 'pure',
|
|
576
|
+
PURPLE: 'purple',
|
|
577
|
+
PYROMANCER: 'pyromancer',
|
|
578
|
+
QUESTER: 'quester',
|
|
579
|
+
RACER: 'racer',
|
|
580
|
+
RAIDER: 'raider',
|
|
581
|
+
RANGER: 'ranger',
|
|
582
|
+
RECORD_CHASER: 'record_chaser',
|
|
583
|
+
RECRUIT: 'recruit',
|
|
584
|
+
RECRUITER: 'recruiter',
|
|
585
|
+
RED_TOPAZ: 'red_topaz',
|
|
586
|
+
RED: 'red',
|
|
587
|
+
ROGUE: 'rogue',
|
|
588
|
+
RUBY: 'ruby',
|
|
589
|
+
RUNE: 'rune',
|
|
590
|
+
RUNECRAFTER: 'runecrafter',
|
|
591
|
+
SAGE: 'sage',
|
|
592
|
+
SAPPHIRE: 'sapphire',
|
|
593
|
+
SARADOMINIST: 'saradominist',
|
|
594
|
+
SAVIOUR: 'saviour',
|
|
595
|
+
SCAVENGER: 'scavenger',
|
|
596
|
+
SCHOLAR: 'scholar',
|
|
597
|
+
SCOURGE: 'scourge',
|
|
598
|
+
SCOUT: 'scout',
|
|
599
|
+
SCRIBE: 'scribe',
|
|
600
|
+
SEER: 'seer',
|
|
601
|
+
SENATOR: 'senator',
|
|
602
|
+
SENTRY: 'sentry',
|
|
603
|
+
SERENIST: 'serenist',
|
|
604
|
+
SERGEANT: 'sergeant',
|
|
605
|
+
SHAMAN: 'shaman',
|
|
606
|
+
SHERIFF: 'sheriff',
|
|
607
|
+
SHORT_GREEN_GUY: 'short_green_guy',
|
|
608
|
+
SKILLER: 'skiller',
|
|
609
|
+
SKULLED: 'skulled',
|
|
610
|
+
SLAYER: 'slayer',
|
|
611
|
+
SMITER: 'smiter',
|
|
612
|
+
SMITH: 'smith',
|
|
613
|
+
SMUGGLER: 'smuggler',
|
|
614
|
+
SNIPER: 'sniper',
|
|
615
|
+
SOUL: 'soul',
|
|
616
|
+
SPECIALIST: 'specialist',
|
|
617
|
+
SPEED_RUNNER: 'speed_runner',
|
|
618
|
+
SPELLCASTER: 'spellcaster',
|
|
619
|
+
SQUIRE: 'squire',
|
|
620
|
+
STAFF: 'staff',
|
|
621
|
+
STEEL: 'steel',
|
|
622
|
+
STRIDER: 'strider',
|
|
623
|
+
STRIKER: 'striker',
|
|
624
|
+
SUMMONER: 'summoner',
|
|
625
|
+
SUPERIOR: 'superior',
|
|
626
|
+
SUPERVISOR: 'supervisor',
|
|
627
|
+
TEACHER: 'teacher',
|
|
628
|
+
TEMPLAR: 'templar',
|
|
629
|
+
THERAPIST: 'therapist',
|
|
630
|
+
THIEF: 'thief',
|
|
631
|
+
TIRANNIAN: 'tirannian',
|
|
632
|
+
TRIALIST: 'trialist',
|
|
633
|
+
TRICKSTER: 'trickster',
|
|
634
|
+
TZKAL: 'tzkal',
|
|
635
|
+
TZTOK: 'tztok',
|
|
636
|
+
UNHOLY: 'unholy',
|
|
637
|
+
VAGRANT: 'vagrant',
|
|
638
|
+
VANGUARD: 'vanguard',
|
|
639
|
+
WALKER: 'walker',
|
|
640
|
+
WANDERER: 'wanderer',
|
|
641
|
+
WARDEN: 'warden',
|
|
642
|
+
WARLOCK: 'warlock',
|
|
643
|
+
WARRIOR: 'warrior',
|
|
644
|
+
WATER: 'water',
|
|
645
|
+
WILD: 'wild',
|
|
646
|
+
WILLOW: 'willow',
|
|
647
|
+
WILY: 'wily',
|
|
648
|
+
WINTUMBER: 'wintumber',
|
|
649
|
+
WITCH: 'witch',
|
|
650
|
+
WIZARD: 'wizard',
|
|
651
|
+
WORKER: 'worker',
|
|
652
|
+
WRATH: 'wrath',
|
|
653
|
+
XERICIAN: 'xerician',
|
|
654
|
+
YELLOW: 'yellow',
|
|
655
|
+
YEW: 'yew',
|
|
656
|
+
ZAMORAKIAN: 'zamorakian',
|
|
657
|
+
ZAROSIAN: 'zarosian',
|
|
658
|
+
ZEALOT: 'zealot',
|
|
659
|
+
ZENYTE: 'zenyte'
|
|
660
|
+
};
|
|
661
|
+
const Country = {
|
|
662
|
+
AD: 'AD',
|
|
663
|
+
AE: 'AE',
|
|
664
|
+
AF: 'AF',
|
|
665
|
+
AG: 'AG',
|
|
666
|
+
AI: 'AI',
|
|
667
|
+
AL: 'AL',
|
|
668
|
+
AM: 'AM',
|
|
669
|
+
AO: 'AO',
|
|
670
|
+
AQ: 'AQ',
|
|
671
|
+
AR: 'AR',
|
|
672
|
+
AS: 'AS',
|
|
673
|
+
AT: 'AT',
|
|
674
|
+
AU: 'AU',
|
|
675
|
+
AW: 'AW',
|
|
676
|
+
AX: 'AX',
|
|
677
|
+
AZ: 'AZ',
|
|
678
|
+
BA: 'BA',
|
|
679
|
+
BB: 'BB',
|
|
680
|
+
BD: 'BD',
|
|
681
|
+
BE: 'BE',
|
|
682
|
+
BF: 'BF',
|
|
683
|
+
BG: 'BG',
|
|
684
|
+
BH: 'BH',
|
|
685
|
+
BI: 'BI',
|
|
686
|
+
BJ: 'BJ',
|
|
687
|
+
BL: 'BL',
|
|
688
|
+
BM: 'BM',
|
|
689
|
+
BN: 'BN',
|
|
690
|
+
BO: 'BO',
|
|
691
|
+
BQ: 'BQ',
|
|
692
|
+
BR: 'BR',
|
|
693
|
+
BS: 'BS',
|
|
694
|
+
BT: 'BT',
|
|
695
|
+
BV: 'BV',
|
|
696
|
+
BW: 'BW',
|
|
697
|
+
BY: 'BY',
|
|
698
|
+
BZ: 'BZ',
|
|
699
|
+
CA: 'CA',
|
|
700
|
+
CC: 'CC',
|
|
701
|
+
CD: 'CD',
|
|
702
|
+
CF: 'CF',
|
|
703
|
+
CG: 'CG',
|
|
704
|
+
CH: 'CH',
|
|
705
|
+
CI: 'CI',
|
|
706
|
+
CK: 'CK',
|
|
707
|
+
CL: 'CL',
|
|
708
|
+
CM: 'CM',
|
|
709
|
+
CN: 'CN',
|
|
710
|
+
CO: 'CO',
|
|
711
|
+
CR: 'CR',
|
|
712
|
+
CU: 'CU',
|
|
713
|
+
CV: 'CV',
|
|
714
|
+
CW: 'CW',
|
|
715
|
+
CX: 'CX',
|
|
716
|
+
CY: 'CY',
|
|
717
|
+
CZ: 'CZ',
|
|
718
|
+
DE: 'DE',
|
|
719
|
+
DJ: 'DJ',
|
|
720
|
+
DK: 'DK',
|
|
721
|
+
DM: 'DM',
|
|
722
|
+
DO: 'DO',
|
|
723
|
+
DZ: 'DZ',
|
|
724
|
+
EC: 'EC',
|
|
725
|
+
EE: 'EE',
|
|
726
|
+
EG: 'EG',
|
|
727
|
+
EH: 'EH',
|
|
728
|
+
ER: 'ER',
|
|
729
|
+
ES: 'ES',
|
|
730
|
+
ET: 'ET',
|
|
731
|
+
FI: 'FI',
|
|
732
|
+
FJ: 'FJ',
|
|
733
|
+
FK: 'FK',
|
|
734
|
+
FM: 'FM',
|
|
735
|
+
FO: 'FO',
|
|
736
|
+
FR: 'FR',
|
|
737
|
+
GA: 'GA',
|
|
738
|
+
GB: 'GB',
|
|
739
|
+
GD: 'GD',
|
|
740
|
+
GE: 'GE',
|
|
741
|
+
GF: 'GF',
|
|
742
|
+
GG: 'GG',
|
|
743
|
+
GH: 'GH',
|
|
744
|
+
GI: 'GI',
|
|
745
|
+
GL: 'GL',
|
|
746
|
+
GM: 'GM',
|
|
747
|
+
GN: 'GN',
|
|
748
|
+
GP: 'GP',
|
|
749
|
+
GQ: 'GQ',
|
|
750
|
+
GR: 'GR',
|
|
751
|
+
GS: 'GS',
|
|
752
|
+
GT: 'GT',
|
|
753
|
+
GU: 'GU',
|
|
754
|
+
GW: 'GW',
|
|
755
|
+
GY: 'GY',
|
|
756
|
+
HK: 'HK',
|
|
757
|
+
HM: 'HM',
|
|
758
|
+
HN: 'HN',
|
|
759
|
+
HR: 'HR',
|
|
760
|
+
HT: 'HT',
|
|
761
|
+
HU: 'HU',
|
|
762
|
+
ID: 'ID',
|
|
763
|
+
IE: 'IE',
|
|
764
|
+
IL: 'IL',
|
|
765
|
+
IM: 'IM',
|
|
766
|
+
IN: 'IN',
|
|
767
|
+
IO: 'IO',
|
|
768
|
+
IQ: 'IQ',
|
|
769
|
+
IR: 'IR',
|
|
770
|
+
IS: 'IS',
|
|
771
|
+
IT: 'IT',
|
|
772
|
+
JE: 'JE',
|
|
773
|
+
JM: 'JM',
|
|
774
|
+
JO: 'JO',
|
|
775
|
+
JP: 'JP',
|
|
776
|
+
KE: 'KE',
|
|
777
|
+
KG: 'KG',
|
|
778
|
+
KH: 'KH',
|
|
779
|
+
KI: 'KI',
|
|
780
|
+
KM: 'KM',
|
|
781
|
+
KN: 'KN',
|
|
782
|
+
KP: 'KP',
|
|
783
|
+
KR: 'KR',
|
|
784
|
+
KW: 'KW',
|
|
785
|
+
KY: 'KY',
|
|
786
|
+
KZ: 'KZ',
|
|
787
|
+
LA: 'LA',
|
|
788
|
+
LB: 'LB',
|
|
789
|
+
LC: 'LC',
|
|
790
|
+
LI: 'LI',
|
|
791
|
+
LK: 'LK',
|
|
792
|
+
LR: 'LR',
|
|
793
|
+
LS: 'LS',
|
|
794
|
+
LT: 'LT',
|
|
795
|
+
LU: 'LU',
|
|
796
|
+
LV: 'LV',
|
|
797
|
+
LY: 'LY',
|
|
798
|
+
MA: 'MA',
|
|
799
|
+
MC: 'MC',
|
|
800
|
+
MD: 'MD',
|
|
801
|
+
ME: 'ME',
|
|
802
|
+
MF: 'MF',
|
|
803
|
+
MG: 'MG',
|
|
804
|
+
MH: 'MH',
|
|
805
|
+
MK: 'MK',
|
|
806
|
+
ML: 'ML',
|
|
807
|
+
MM: 'MM',
|
|
808
|
+
MN: 'MN',
|
|
809
|
+
MO: 'MO',
|
|
810
|
+
MP: 'MP',
|
|
811
|
+
MQ: 'MQ',
|
|
812
|
+
MR: 'MR',
|
|
813
|
+
MS: 'MS',
|
|
814
|
+
MT: 'MT',
|
|
815
|
+
MU: 'MU',
|
|
816
|
+
MV: 'MV',
|
|
817
|
+
MW: 'MW',
|
|
818
|
+
MX: 'MX',
|
|
819
|
+
MY: 'MY',
|
|
820
|
+
MZ: 'MZ',
|
|
821
|
+
NA: 'NA',
|
|
822
|
+
NC: 'NC',
|
|
823
|
+
NE: 'NE',
|
|
824
|
+
NF: 'NF',
|
|
825
|
+
NG: 'NG',
|
|
826
|
+
NI: 'NI',
|
|
827
|
+
NL: 'NL',
|
|
828
|
+
NO: 'NO',
|
|
829
|
+
NP: 'NP',
|
|
830
|
+
NR: 'NR',
|
|
831
|
+
NU: 'NU',
|
|
832
|
+
NZ: 'NZ',
|
|
833
|
+
OM: 'OM',
|
|
834
|
+
PA: 'PA',
|
|
835
|
+
PE: 'PE',
|
|
836
|
+
PF: 'PF',
|
|
837
|
+
PG: 'PG',
|
|
838
|
+
PH: 'PH',
|
|
839
|
+
PK: 'PK',
|
|
840
|
+
PL: 'PL',
|
|
841
|
+
PM: 'PM',
|
|
842
|
+
PN: 'PN',
|
|
843
|
+
PR: 'PR',
|
|
844
|
+
PS: 'PS',
|
|
845
|
+
PT: 'PT',
|
|
846
|
+
PW: 'PW',
|
|
847
|
+
PY: 'PY',
|
|
848
|
+
QA: 'QA',
|
|
849
|
+
RE: 'RE',
|
|
850
|
+
RO: 'RO',
|
|
851
|
+
RS: 'RS',
|
|
852
|
+
RU: 'RU',
|
|
853
|
+
RW: 'RW',
|
|
854
|
+
SA: 'SA',
|
|
855
|
+
SB: 'SB',
|
|
856
|
+
SC: 'SC',
|
|
857
|
+
SD: 'SD',
|
|
858
|
+
SE: 'SE',
|
|
859
|
+
SG: 'SG',
|
|
860
|
+
SH: 'SH',
|
|
861
|
+
SI: 'SI',
|
|
862
|
+
SJ: 'SJ',
|
|
863
|
+
SK: 'SK',
|
|
864
|
+
SL: 'SL',
|
|
865
|
+
SM: 'SM',
|
|
866
|
+
SN: 'SN',
|
|
867
|
+
SO: 'SO',
|
|
868
|
+
SR: 'SR',
|
|
869
|
+
SS: 'SS',
|
|
870
|
+
ST: 'ST',
|
|
871
|
+
SV: 'SV',
|
|
872
|
+
SX: 'SX',
|
|
873
|
+
SY: 'SY',
|
|
874
|
+
SZ: 'SZ',
|
|
875
|
+
TC: 'TC',
|
|
876
|
+
TD: 'TD',
|
|
877
|
+
TF: 'TF',
|
|
878
|
+
TG: 'TG',
|
|
879
|
+
TH: 'TH',
|
|
880
|
+
TJ: 'TJ',
|
|
881
|
+
TK: 'TK',
|
|
882
|
+
TL: 'TL',
|
|
883
|
+
TM: 'TM',
|
|
884
|
+
TN: 'TN',
|
|
885
|
+
TO: 'TO',
|
|
886
|
+
TR: 'TR',
|
|
887
|
+
TT: 'TT',
|
|
888
|
+
TV: 'TV',
|
|
889
|
+
TW: 'TW',
|
|
890
|
+
TZ: 'TZ',
|
|
891
|
+
UA: 'UA',
|
|
892
|
+
UG: 'UG',
|
|
893
|
+
UM: 'UM',
|
|
894
|
+
US: 'US',
|
|
895
|
+
UY: 'UY',
|
|
896
|
+
UZ: 'UZ',
|
|
897
|
+
VA: 'VA',
|
|
898
|
+
VC: 'VC',
|
|
899
|
+
VE: 'VE',
|
|
900
|
+
VG: 'VG',
|
|
901
|
+
VI: 'VI',
|
|
902
|
+
VN: 'VN',
|
|
903
|
+
VU: 'VU',
|
|
904
|
+
WF: 'WF',
|
|
905
|
+
WS: 'WS',
|
|
906
|
+
YE: 'YE',
|
|
907
|
+
YT: 'YT',
|
|
908
|
+
ZA: 'ZA',
|
|
909
|
+
ZM: 'ZM',
|
|
910
|
+
ZW: 'ZW'
|
|
911
|
+
};
|
|
912
|
+
|
|
913
|
+
exports.CompetitionStatus = void 0;
|
|
914
|
+
(function (CompetitionStatus) {
|
|
915
|
+
CompetitionStatus["UPCOMING"] = "upcoming";
|
|
916
|
+
CompetitionStatus["ONGOING"] = "ongoing";
|
|
917
|
+
CompetitionStatus["FINISHED"] = "finished";
|
|
918
|
+
})(exports.CompetitionStatus || (exports.CompetitionStatus = {}));
|
|
919
|
+
const CompetitionTypeProps = {
|
|
920
|
+
[CompetitionType.CLASSIC]: { name: 'Classic' },
|
|
921
|
+
[CompetitionType.TEAM]: { name: 'Team' }
|
|
922
|
+
};
|
|
923
|
+
const CompetitionStatusProps = {
|
|
924
|
+
[exports.CompetitionStatus.UPCOMING]: { name: 'Upcoming' },
|
|
925
|
+
[exports.CompetitionStatus.ONGOING]: { name: 'Ongoing' },
|
|
926
|
+
[exports.CompetitionStatus.FINISHED]: { name: 'Finished' }
|
|
927
|
+
};
|
|
928
|
+
const COMPETITION_TYPES = Object.values(CompetitionType);
|
|
929
|
+
const COMPETITION_STATUSES = Object.values(exports.CompetitionStatus);
|
|
930
|
+
function findCompetitionType(typeName) {
|
|
931
|
+
for (const [key, value] of Object.entries(CompetitionTypeProps)) {
|
|
932
|
+
if (value.name === typeName)
|
|
933
|
+
return key;
|
|
934
|
+
}
|
|
935
|
+
return null;
|
|
936
|
+
}
|
|
937
|
+
function findCompetitionStatus(statusName) {
|
|
938
|
+
for (const [key, value] of Object.entries(CompetitionStatusProps)) {
|
|
939
|
+
if (value.name === statusName)
|
|
940
|
+
return key;
|
|
941
|
+
}
|
|
942
|
+
return null;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
const CountryProps = {
|
|
946
|
+
[Country.AD]: { code: 'AD', name: 'Andorra' },
|
|
947
|
+
[Country.AE]: { code: 'AE', name: 'United Arab Emirates' },
|
|
948
|
+
[Country.AF]: { code: 'AF', name: 'Afghanistan' },
|
|
949
|
+
[Country.AG]: { code: 'AG', name: 'Antigua and Barbuda' },
|
|
950
|
+
[Country.AI]: { code: 'AI', name: 'Anguilla' },
|
|
951
|
+
[Country.AL]: { code: 'AL', name: 'Albania' },
|
|
952
|
+
[Country.AM]: { code: 'AM', name: 'Armenia' },
|
|
953
|
+
[Country.AO]: { code: 'AO', name: 'Angola' },
|
|
954
|
+
[Country.AQ]: { code: 'AQ', name: 'Antarctica' },
|
|
955
|
+
[Country.AR]: { code: 'AR', name: 'Argentina' },
|
|
956
|
+
[Country.AS]: { code: 'AS', name: 'American Samoa' },
|
|
957
|
+
[Country.AT]: { code: 'AT', name: 'Austria' },
|
|
958
|
+
[Country.AU]: { code: 'AU', name: 'Australia' },
|
|
959
|
+
[Country.AW]: { code: 'AW', name: 'Aruba' },
|
|
960
|
+
[Country.AX]: { code: 'AX', name: 'Åland Islands' },
|
|
961
|
+
[Country.AZ]: { code: 'AZ', name: 'Azerbaijan' },
|
|
962
|
+
[Country.BA]: { code: 'BA', name: 'Bosnia and Herzegovina' },
|
|
963
|
+
[Country.BB]: { code: 'BB', name: 'Barbados' },
|
|
964
|
+
[Country.BD]: { code: 'BD', name: 'Bangladesh' },
|
|
965
|
+
[Country.BE]: { code: 'BE', name: 'Belgium' },
|
|
966
|
+
[Country.BF]: { code: 'BF', name: 'Burkina Faso' },
|
|
967
|
+
[Country.BG]: { code: 'BG', name: 'Bulgaria' },
|
|
968
|
+
[Country.BH]: { code: 'BH', name: 'Bahrain' },
|
|
969
|
+
[Country.BI]: { code: 'BI', name: 'Burundi' },
|
|
970
|
+
[Country.BJ]: { code: 'BJ', name: 'Benin' },
|
|
971
|
+
[Country.BL]: { code: 'BL', name: 'Saint Barthélemy' },
|
|
972
|
+
[Country.BM]: { code: 'BM', name: 'Bermuda' },
|
|
973
|
+
[Country.BN]: { code: 'BN', name: 'Brunei Darussalam' },
|
|
974
|
+
[Country.BO]: { code: 'BO', name: 'Bolivia' },
|
|
975
|
+
[Country.BQ]: { code: 'BQ', name: 'Bonaire' },
|
|
976
|
+
[Country.BR]: { code: 'BR', name: 'Brazil' },
|
|
977
|
+
[Country.BS]: { code: 'BS', name: 'Bahamas' },
|
|
978
|
+
[Country.BT]: { code: 'BT', name: 'Bhutan' },
|
|
979
|
+
[Country.BV]: { code: 'BV', name: 'Bouvet Island' },
|
|
980
|
+
[Country.BW]: { code: 'BW', name: 'Botswana' },
|
|
981
|
+
[Country.BY]: { code: 'BY', name: 'Belarus' },
|
|
982
|
+
[Country.BZ]: { code: 'BZ', name: 'Belize' },
|
|
983
|
+
[Country.CA]: { code: 'CA', name: 'Canada' },
|
|
984
|
+
[Country.CC]: { code: 'CC', name: 'Cocos (Keeling) Islands' },
|
|
985
|
+
[Country.CD]: { code: 'CD', name: 'Congo' },
|
|
986
|
+
[Country.CF]: { code: 'CF', name: 'Central African Republic' },
|
|
987
|
+
[Country.CG]: { code: 'CG', name: 'Congo' },
|
|
988
|
+
[Country.CH]: { code: 'CH', name: 'Switzerland' },
|
|
989
|
+
[Country.CI]: { code: 'CI', name: "Côte d'Ivoire" },
|
|
990
|
+
[Country.CK]: { code: 'CK', name: 'Cook Islands' },
|
|
991
|
+
[Country.CL]: { code: 'CL', name: 'Chile' },
|
|
992
|
+
[Country.CM]: { code: 'CM', name: 'Cameroon' },
|
|
993
|
+
[Country.CN]: { code: 'CN', name: 'China' },
|
|
994
|
+
[Country.CO]: { code: 'CO', name: 'Colombia' },
|
|
995
|
+
[Country.CR]: { code: 'CR', name: 'Costa Rica' },
|
|
996
|
+
[Country.CU]: { code: 'CU', name: 'Cuba' },
|
|
997
|
+
[Country.CV]: { code: 'CV', name: 'Cabo Verde' },
|
|
998
|
+
[Country.CW]: { code: 'CW', name: 'Curaçao' },
|
|
999
|
+
[Country.CX]: { code: 'CX', name: 'Christmas Island' },
|
|
1000
|
+
[Country.CY]: { code: 'CY', name: 'Cyprus' },
|
|
1001
|
+
[Country.CZ]: { code: 'CZ', name: 'Czechia' },
|
|
1002
|
+
[Country.DE]: { code: 'DE', name: 'Germany' },
|
|
1003
|
+
[Country.DJ]: { code: 'DJ', name: 'Djibouti' },
|
|
1004
|
+
[Country.DK]: { code: 'DK', name: 'Denmark' },
|
|
1005
|
+
[Country.DM]: { code: 'DM', name: 'Dominica' },
|
|
1006
|
+
[Country.DO]: { code: 'DO', name: 'Dominican Republic' },
|
|
1007
|
+
[Country.DZ]: { code: 'DZ', name: 'Algeria' },
|
|
1008
|
+
[Country.EC]: { code: 'EC', name: 'Ecuador' },
|
|
1009
|
+
[Country.EE]: { code: 'EE', name: 'Estonia' },
|
|
1010
|
+
[Country.EG]: { code: 'EG', name: 'Egypt' },
|
|
1011
|
+
[Country.EH]: { code: 'EH', name: 'Western Sahara' },
|
|
1012
|
+
[Country.ER]: { code: 'ER', name: 'Eritrea' },
|
|
1013
|
+
[Country.ES]: { code: 'ES', name: 'Spain' },
|
|
1014
|
+
[Country.ET]: { code: 'ET', name: 'Ethiopia' },
|
|
1015
|
+
[Country.FI]: { code: 'FI', name: 'Finland' },
|
|
1016
|
+
[Country.FJ]: { code: 'FJ', name: 'Fiji' },
|
|
1017
|
+
[Country.FK]: { code: 'FK', name: 'Falkland Islands (Malvinas)' },
|
|
1018
|
+
[Country.FM]: { code: 'FM', name: 'Micronesia (Federated States of)' },
|
|
1019
|
+
[Country.FO]: { code: 'FO', name: 'Faroe Islands' },
|
|
1020
|
+
[Country.FR]: { code: 'FR', name: 'France' },
|
|
1021
|
+
[Country.GA]: { code: 'GA', name: 'Gabon' },
|
|
1022
|
+
[Country.GB]: { code: 'GB', name: 'United Kingdom' },
|
|
1023
|
+
[Country.GD]: { code: 'GD', name: 'Grenada' },
|
|
1024
|
+
[Country.GE]: { code: 'GE', name: 'Georgia' },
|
|
1025
|
+
[Country.GF]: { code: 'GF', name: 'French Guiana' },
|
|
1026
|
+
[Country.GG]: { code: 'GG', name: 'Guernsey' },
|
|
1027
|
+
[Country.GH]: { code: 'GH', name: 'Ghana' },
|
|
1028
|
+
[Country.GI]: { code: 'GI', name: 'Gibraltar' },
|
|
1029
|
+
[Country.GL]: { code: 'GL', name: 'Greenland' },
|
|
1030
|
+
[Country.GM]: { code: 'GM', name: 'Gambia' },
|
|
1031
|
+
[Country.GN]: { code: 'GN', name: 'Guinea' },
|
|
1032
|
+
[Country.GP]: { code: 'GP', name: 'Guadeloupe' },
|
|
1033
|
+
[Country.GQ]: { code: 'GQ', name: 'Equatorial Guinea' },
|
|
1034
|
+
[Country.GR]: { code: 'GR', name: 'Greece' },
|
|
1035
|
+
[Country.GS]: { code: 'GS', name: 'South Georgia and the South Sandwich Islands' },
|
|
1036
|
+
[Country.GT]: { code: 'GT', name: 'Guatemala' },
|
|
1037
|
+
[Country.GU]: { code: 'GU', name: 'Guam' },
|
|
1038
|
+
[Country.GW]: { code: 'GW', name: 'Guinea-Bissau' },
|
|
1039
|
+
[Country.GY]: { code: 'GY', name: 'Guyana' },
|
|
1040
|
+
[Country.HK]: { code: 'HK', name: 'Hong Kong' },
|
|
1041
|
+
[Country.HM]: { code: 'HM', name: 'Heard Island and McDonald Islands' },
|
|
1042
|
+
[Country.HN]: { code: 'HN', name: 'Honduras' },
|
|
1043
|
+
[Country.HR]: { code: 'HR', name: 'Croatia' },
|
|
1044
|
+
[Country.HT]: { code: 'HT', name: 'Haiti' },
|
|
1045
|
+
[Country.HU]: { code: 'HU', name: 'Hungary' },
|
|
1046
|
+
[Country.ID]: { code: 'ID', name: 'Indonesia' },
|
|
1047
|
+
[Country.IE]: { code: 'IE', name: 'Ireland' },
|
|
1048
|
+
[Country.IL]: { code: 'IL', name: 'Israel' },
|
|
1049
|
+
[Country.IM]: { code: 'IM', name: 'Isle of Man' },
|
|
1050
|
+
[Country.IN]: { code: 'IN', name: 'India' },
|
|
1051
|
+
[Country.IO]: { code: 'IO', name: 'British Indian Ocean Territory' },
|
|
1052
|
+
[Country.IQ]: { code: 'IQ', name: 'Iraq' },
|
|
1053
|
+
[Country.IR]: { code: 'IR', name: 'Iran (Islamic Republic of)' },
|
|
1054
|
+
[Country.IS]: { code: 'IS', name: 'Iceland' },
|
|
1055
|
+
[Country.IT]: { code: 'IT', name: 'Italy' },
|
|
1056
|
+
[Country.JE]: { code: 'JE', name: 'Jersey' },
|
|
1057
|
+
[Country.JM]: { code: 'JM', name: 'Jamaica' },
|
|
1058
|
+
[Country.JO]: { code: 'JO', name: 'Jordan' },
|
|
1059
|
+
[Country.JP]: { code: 'JP', name: 'Japan' },
|
|
1060
|
+
[Country.KE]: { code: 'KE', name: 'Kenya' },
|
|
1061
|
+
[Country.KG]: { code: 'KG', name: 'Kyrgyzstan' },
|
|
1062
|
+
[Country.KH]: { code: 'KH', name: 'Cambodia' },
|
|
1063
|
+
[Country.KI]: { code: 'KI', name: 'Kiribati' },
|
|
1064
|
+
[Country.KM]: { code: 'KM', name: 'Comoros' },
|
|
1065
|
+
[Country.KN]: { code: 'KN', name: 'Saint Kitts and Nevis' },
|
|
1066
|
+
[Country.KP]: { code: 'KP', name: "Korea (Democratic People's Republic of)" },
|
|
1067
|
+
[Country.KR]: { code: 'KR', name: 'Korea' },
|
|
1068
|
+
[Country.KW]: { code: 'KW', name: 'Kuwait' },
|
|
1069
|
+
[Country.KY]: { code: 'KY', name: 'Cayman Islands' },
|
|
1070
|
+
[Country.KZ]: { code: 'KZ', name: 'Kazakhstan' },
|
|
1071
|
+
[Country.LA]: { code: 'LA', name: "Lao People's Democratic Republic" },
|
|
1072
|
+
[Country.LB]: { code: 'LB', name: 'Lebanon' },
|
|
1073
|
+
[Country.LC]: { code: 'LC', name: 'Saint Lucia' },
|
|
1074
|
+
[Country.LI]: { code: 'LI', name: 'Liechtenstein' },
|
|
1075
|
+
[Country.LK]: { code: 'LK', name: 'Sri Lanka' },
|
|
1076
|
+
[Country.LR]: { code: 'LR', name: 'Liberia' },
|
|
1077
|
+
[Country.LS]: { code: 'LS', name: 'Lesotho' },
|
|
1078
|
+
[Country.LT]: { code: 'LT', name: 'Lithuania' },
|
|
1079
|
+
[Country.LU]: { code: 'LU', name: 'Luxembourg' },
|
|
1080
|
+
[Country.LV]: { code: 'LV', name: 'Latvia' },
|
|
1081
|
+
[Country.LY]: { code: 'LY', name: 'Libya' },
|
|
1082
|
+
[Country.MA]: { code: 'MA', name: 'Morocco' },
|
|
1083
|
+
[Country.MC]: { code: 'MC', name: 'Monaco' },
|
|
1084
|
+
[Country.MD]: { code: 'MD', name: 'Moldova' },
|
|
1085
|
+
[Country.ME]: { code: 'ME', name: 'Montenegro' },
|
|
1086
|
+
[Country.MF]: { code: 'MF', name: 'Saint Martin (French part)' },
|
|
1087
|
+
[Country.MG]: { code: 'MG', name: 'Madagascar' },
|
|
1088
|
+
[Country.MH]: { code: 'MH', name: 'Marshall Islands' },
|
|
1089
|
+
[Country.MK]: { code: 'MK', name: 'North Macedonia' },
|
|
1090
|
+
[Country.ML]: { code: 'ML', name: 'Mali' },
|
|
1091
|
+
[Country.MM]: { code: 'MM', name: 'Myanmar' },
|
|
1092
|
+
[Country.MN]: { code: 'MN', name: 'Mongolia' },
|
|
1093
|
+
[Country.MO]: { code: 'MO', name: 'Macao' },
|
|
1094
|
+
[Country.MP]: { code: 'MP', name: 'Northern Mariana Islands' },
|
|
1095
|
+
[Country.MQ]: { code: 'MQ', name: 'Martinique' },
|
|
1096
|
+
[Country.MR]: { code: 'MR', name: 'Mauritania' },
|
|
1097
|
+
[Country.MS]: { code: 'MS', name: 'Montserrat' },
|
|
1098
|
+
[Country.MT]: { code: 'MT', name: 'Malta' },
|
|
1099
|
+
[Country.MU]: { code: 'MU', name: 'Mauritius' },
|
|
1100
|
+
[Country.MV]: { code: 'MV', name: 'Maldives' },
|
|
1101
|
+
[Country.MW]: { code: 'MW', name: 'Malawi' },
|
|
1102
|
+
[Country.MX]: { code: 'MX', name: 'Mexico' },
|
|
1103
|
+
[Country.MY]: { code: 'MY', name: 'Malaysia' },
|
|
1104
|
+
[Country.MZ]: { code: 'MZ', name: 'Mozambique' },
|
|
1105
|
+
[Country.NA]: { code: 'NA', name: 'Namibia' },
|
|
1106
|
+
[Country.NC]: { code: 'NC', name: 'New Caledonia' },
|
|
1107
|
+
[Country.NE]: { code: 'NE', name: 'Niger' },
|
|
1108
|
+
[Country.NF]: { code: 'NF', name: 'Norfolk Island' },
|
|
1109
|
+
[Country.NG]: { code: 'NG', name: 'Nigeria' },
|
|
1110
|
+
[Country.NI]: { code: 'NI', name: 'Nicaragua' },
|
|
1111
|
+
[Country.NL]: { code: 'NL', name: 'Netherlands' },
|
|
1112
|
+
[Country.NO]: { code: 'NO', name: 'Norway' },
|
|
1113
|
+
[Country.NP]: { code: 'NP', name: 'Nepal' },
|
|
1114
|
+
[Country.NR]: { code: 'NR', name: 'Nauru' },
|
|
1115
|
+
[Country.NU]: { code: 'NU', name: 'Niue' },
|
|
1116
|
+
[Country.NZ]: { code: 'NZ', name: 'New Zealand' },
|
|
1117
|
+
[Country.OM]: { code: 'OM', name: 'Oman' },
|
|
1118
|
+
[Country.PA]: { code: 'PA', name: 'Panama' },
|
|
1119
|
+
[Country.PE]: { code: 'PE', name: 'Peru' },
|
|
1120
|
+
[Country.PF]: { code: 'PF', name: 'French Polynesia' },
|
|
1121
|
+
[Country.PG]: { code: 'PG', name: 'Papua New Guinea' },
|
|
1122
|
+
[Country.PH]: { code: 'PH', name: 'Philippines' },
|
|
1123
|
+
[Country.PK]: { code: 'PK', name: 'Pakistan' },
|
|
1124
|
+
[Country.PL]: { code: 'PL', name: 'Poland' },
|
|
1125
|
+
[Country.PM]: { code: 'PM', name: 'Saint Pierre and Miquelon' },
|
|
1126
|
+
[Country.PN]: { code: 'PN', name: 'Pitcairn' },
|
|
1127
|
+
[Country.PR]: { code: 'PR', name: 'Puerto Rico' },
|
|
1128
|
+
[Country.PS]: { code: 'PS', name: 'Palestine' },
|
|
1129
|
+
[Country.PT]: { code: 'PT', name: 'Portugal' },
|
|
1130
|
+
[Country.PW]: { code: 'PW', name: 'Palau' },
|
|
1131
|
+
[Country.PY]: { code: 'PY', name: 'Paraguay' },
|
|
1132
|
+
[Country.QA]: { code: 'QA', name: 'Qatar' },
|
|
1133
|
+
[Country.RE]: { code: 'RE', name: 'Réunion' },
|
|
1134
|
+
[Country.RO]: { code: 'RO', name: 'Romania' },
|
|
1135
|
+
[Country.RS]: { code: 'RS', name: 'Serbia' },
|
|
1136
|
+
[Country.RU]: { code: 'RU', name: 'Russian Federation' },
|
|
1137
|
+
[Country.RW]: { code: 'RW', name: 'Rwanda' },
|
|
1138
|
+
[Country.SA]: { code: 'SA', name: 'Saudi Arabia' },
|
|
1139
|
+
[Country.SB]: { code: 'SB', name: 'Solomon Islands' },
|
|
1140
|
+
[Country.SC]: { code: 'SC', name: 'Seychelles' },
|
|
1141
|
+
[Country.SD]: { code: 'SD', name: 'Sudan' },
|
|
1142
|
+
[Country.SE]: { code: 'SE', name: 'Sweden' },
|
|
1143
|
+
[Country.SG]: { code: 'SG', name: 'Singapore' },
|
|
1144
|
+
[Country.SH]: { code: 'SH', name: 'Saint Helena' },
|
|
1145
|
+
[Country.SI]: { code: 'SI', name: 'Slovenia' },
|
|
1146
|
+
[Country.SJ]: { code: 'SJ', name: 'Svalbard and Jan Mayen' },
|
|
1147
|
+
[Country.SK]: { code: 'SK', name: 'Slovakia' },
|
|
1148
|
+
[Country.SL]: { code: 'SL', name: 'Sierra Leone' },
|
|
1149
|
+
[Country.SM]: { code: 'SM', name: 'San Marino' },
|
|
1150
|
+
[Country.SN]: { code: 'SN', name: 'Senegal' },
|
|
1151
|
+
[Country.SO]: { code: 'SO', name: 'Somalia' },
|
|
1152
|
+
[Country.SR]: { code: 'SR', name: 'Suriname' },
|
|
1153
|
+
[Country.SS]: { code: 'SS', name: 'South Sudan' },
|
|
1154
|
+
[Country.ST]: { code: 'ST', name: 'Sao Tome and Principe' },
|
|
1155
|
+
[Country.SV]: { code: 'SV', name: 'El Salvador' },
|
|
1156
|
+
[Country.SX]: { code: 'SX', name: 'Sint Maarten (Dutch part)' },
|
|
1157
|
+
[Country.SY]: { code: 'SY', name: 'Syrian Arab Republic' },
|
|
1158
|
+
[Country.SZ]: { code: 'SZ', name: 'Eswatini' },
|
|
1159
|
+
[Country.TC]: { code: 'TC', name: 'Turks and Caicos Islands' },
|
|
1160
|
+
[Country.TD]: { code: 'TD', name: 'Chad' },
|
|
1161
|
+
[Country.TF]: { code: 'TF', name: 'French Southern Territories' },
|
|
1162
|
+
[Country.TG]: { code: 'TG', name: 'Togo' },
|
|
1163
|
+
[Country.TH]: { code: 'TH', name: 'Thailand' },
|
|
1164
|
+
[Country.TJ]: { code: 'TJ', name: 'Tajikistan' },
|
|
1165
|
+
[Country.TK]: { code: 'TK', name: 'Tokelau' },
|
|
1166
|
+
[Country.TL]: { code: 'TL', name: 'Timor-Leste' },
|
|
1167
|
+
[Country.TM]: { code: 'TM', name: 'Turkmenistan' },
|
|
1168
|
+
[Country.TN]: { code: 'TN', name: 'Tunisia' },
|
|
1169
|
+
[Country.TO]: { code: 'TO', name: 'Tonga' },
|
|
1170
|
+
[Country.TR]: { code: 'TR', name: 'Turkey' },
|
|
1171
|
+
[Country.TT]: { code: 'TT', name: 'Trinidad and Tobago' },
|
|
1172
|
+
[Country.TV]: { code: 'TV', name: 'Tuvalu' },
|
|
1173
|
+
[Country.TW]: { code: 'TW', name: 'Taiwan' },
|
|
1174
|
+
[Country.TZ]: { code: 'TZ', name: 'Tanzania' },
|
|
1175
|
+
[Country.UA]: { code: 'UA', name: 'Ukraine' },
|
|
1176
|
+
[Country.UG]: { code: 'UG', name: 'Uganda' },
|
|
1177
|
+
[Country.UM]: { code: 'UM', name: 'United States Minor Outlying Islands' },
|
|
1178
|
+
[Country.US]: { code: 'US', name: 'United States of America' },
|
|
1179
|
+
[Country.UY]: { code: 'UY', name: 'Uruguay' },
|
|
1180
|
+
[Country.UZ]: { code: 'UZ', name: 'Uzbekistan' },
|
|
1181
|
+
[Country.VA]: { code: 'VA', name: 'Holy See' },
|
|
1182
|
+
[Country.VC]: { code: 'VC', name: 'Saint Vincent and the Grenadines' },
|
|
1183
|
+
[Country.VE]: { code: 'VE', name: 'Venezuela (Bolivarian Republic of)' },
|
|
1184
|
+
[Country.VG]: { code: 'VG', name: 'Virgin Islands (British)' },
|
|
1185
|
+
[Country.VI]: { code: 'VI', name: 'Virgin Islands (U.S.)' },
|
|
1186
|
+
[Country.VN]: { code: 'VN', name: 'Viet Nam' },
|
|
1187
|
+
[Country.VU]: { code: 'VU', name: 'Vanuatu' },
|
|
1188
|
+
[Country.WF]: { code: 'WF', name: 'Wallis and Futuna' },
|
|
1189
|
+
[Country.WS]: { code: 'WS', name: 'Samoa' },
|
|
1190
|
+
[Country.YE]: { code: 'YE', name: 'Yemen' },
|
|
1191
|
+
[Country.YT]: { code: 'YT', name: 'Mayotte' },
|
|
1192
|
+
[Country.ZA]: { code: 'ZA', name: 'South Africa' },
|
|
1193
|
+
[Country.ZM]: { code: 'ZM', name: 'Zambia' },
|
|
1194
|
+
[Country.ZW]: { code: 'ZW', name: 'Zimbabwe' }
|
|
1195
|
+
};
|
|
1196
|
+
const COUNTRY_CODES = Object.values(Country);
|
|
1197
|
+
const COMMON_ALIASES = [
|
|
1198
|
+
{ commonIdentifier: 'UK', trueIdentifier: 'GB' },
|
|
1199
|
+
{ commonIdentifier: 'USA', trueIdentifier: 'US' }
|
|
1200
|
+
];
|
|
1201
|
+
function findCountry(countryIdentifier) {
|
|
1202
|
+
return findCountryByCode(countryIdentifier) || findCountryByName(countryIdentifier);
|
|
1203
|
+
}
|
|
1204
|
+
function findCountryByName(countryName) {
|
|
1205
|
+
return Object.values(CountryProps).find(c => c.name.toUpperCase() === countryName.toUpperCase());
|
|
1206
|
+
}
|
|
1207
|
+
function findCountryByCode(countryCode) {
|
|
1208
|
+
return Object.values(CountryProps).find(c => c.code === replaceCommonAliases(countryCode.toUpperCase()));
|
|
1209
|
+
}
|
|
1210
|
+
function replaceCommonAliases(countryCode) {
|
|
1211
|
+
var _a;
|
|
1212
|
+
if (!countryCode)
|
|
1213
|
+
return null;
|
|
1214
|
+
return ((_a = COMMON_ALIASES.find(ca => ca.commonIdentifier === countryCode)) === null || _a === void 0 ? void 0 : _a.trueIdentifier) || countryCode;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
exports.MetricType = void 0;
|
|
1218
|
+
(function (MetricType) {
|
|
1219
|
+
MetricType["SKILL"] = "skill";
|
|
1220
|
+
MetricType["BOSS"] = "boss";
|
|
1221
|
+
MetricType["ACTIVITY"] = "activity";
|
|
1222
|
+
MetricType["VIRTUAL"] = "virtual";
|
|
1223
|
+
})(exports.MetricType || (exports.MetricType = {}));
|
|
1224
|
+
exports.MetricMeasure = void 0;
|
|
1225
|
+
(function (MetricMeasure) {
|
|
1226
|
+
MetricMeasure["EXPERIENCE"] = "experience";
|
|
1227
|
+
MetricMeasure["KILLS"] = "kills";
|
|
1228
|
+
MetricMeasure["SCORE"] = "score";
|
|
1229
|
+
MetricMeasure["VALUE"] = "value";
|
|
1230
|
+
})(exports.MetricMeasure || (exports.MetricMeasure = {}));
|
|
1231
|
+
const SkillProps = lodash.mapValues({
|
|
1232
|
+
[Skill.OVERALL]: { name: 'Overall', isCombat: false, isMembers: false },
|
|
1233
|
+
[Skill.ATTACK]: { name: 'Attack', isCombat: true, isMembers: false },
|
|
1234
|
+
[Skill.DEFENCE]: { name: 'Defence', isCombat: true, isMembers: false },
|
|
1235
|
+
[Skill.STRENGTH]: { name: 'Strength', isCombat: true, isMembers: false },
|
|
1236
|
+
[Skill.HITPOINTS]: { name: 'Hitpoints', isCombat: true, isMembers: false },
|
|
1237
|
+
[Skill.RANGED]: { name: 'Ranged', isCombat: true, isMembers: false },
|
|
1238
|
+
[Skill.PRAYER]: { name: 'Prayer', isCombat: true, isMembers: false },
|
|
1239
|
+
[Skill.MAGIC]: { name: 'Magic', isCombat: true, isMembers: false },
|
|
1240
|
+
[Skill.COOKING]: { name: 'Cooking', isCombat: false, isMembers: false },
|
|
1241
|
+
[Skill.WOODCUTTING]: { name: 'Woodcutting', isCombat: false, isMembers: false },
|
|
1242
|
+
[Skill.FLETCHING]: { name: 'Fletching', isCombat: false, isMembers: true },
|
|
1243
|
+
[Skill.FISHING]: { name: 'Fishing', isCombat: false, isMembers: false },
|
|
1244
|
+
[Skill.FIREMAKING]: { name: 'Firemaking', isCombat: false, isMembers: false },
|
|
1245
|
+
[Skill.CRAFTING]: { name: 'Crafting', isCombat: false, isMembers: false },
|
|
1246
|
+
[Skill.SMITHING]: { name: 'Smithing', isCombat: false, isMembers: false },
|
|
1247
|
+
[Skill.MINING]: { name: 'Mining', isCombat: false, isMembers: false },
|
|
1248
|
+
[Skill.HERBLORE]: { name: 'Herblore', isCombat: false, isMembers: true },
|
|
1249
|
+
[Skill.AGILITY]: { name: 'Agility', isCombat: false, isMembers: true },
|
|
1250
|
+
[Skill.THIEVING]: { name: 'Thieving', isCombat: false, isMembers: true },
|
|
1251
|
+
[Skill.SLAYER]: { name: 'Slayer', isCombat: false, isMembers: true },
|
|
1252
|
+
[Skill.FARMING]: { name: 'Farming', isCombat: false, isMembers: true },
|
|
1253
|
+
[Skill.RUNECRAFTING]: { name: 'Runecrafting', isCombat: false, isMembers: false },
|
|
1254
|
+
[Skill.HUNTER]: { name: 'Hunter', isCombat: false, isMembers: true },
|
|
1255
|
+
[Skill.CONSTRUCTION]: { name: 'Construction', isCombat: false, isMembers: false }
|
|
1256
|
+
}, props => (Object.assign(Object.assign({}, props), { type: exports.MetricType.SKILL, measure: exports.MetricMeasure.EXPERIENCE })));
|
|
1257
|
+
const BossProps = lodash.mapValues({
|
|
1258
|
+
[Boss.ABYSSAL_SIRE]: { name: 'Abyssal Sire', minimumKc: 50, isMembers: true },
|
|
1259
|
+
[Boss.ALCHEMICAL_HYDRA]: { name: 'Alchemical Hydra', minimumKc: 50, isMembers: true },
|
|
1260
|
+
[Boss.BARROWS_CHESTS]: { name: 'Barrows Chests', minimumKc: 50, isMembers: true },
|
|
1261
|
+
[Boss.BRYOPHYTA]: { name: 'Bryophyta', minimumKc: 5, isMembers: false },
|
|
1262
|
+
[Boss.CALLISTO]: { name: 'Callisto', minimumKc: 50, isMembers: true },
|
|
1263
|
+
[Boss.CERBERUS]: { name: 'Cerberus', minimumKc: 50, isMembers: true },
|
|
1264
|
+
[Boss.CHAMBERS_OF_XERIC]: { name: 'Chambers Of Xeric', minimumKc: 50, isMembers: true },
|
|
1265
|
+
[Boss.CHAMBERS_OF_XERIC_CM]: { name: 'Chambers Of Xeric (CM)', minimumKc: 5, isMembers: true },
|
|
1266
|
+
[Boss.CHAOS_ELEMENTAL]: { name: 'Chaos Elemental', minimumKc: 50, isMembers: true },
|
|
1267
|
+
[Boss.CHAOS_FANATIC]: { name: 'Chaos Fanatic', minimumKc: 50, isMembers: true },
|
|
1268
|
+
[Boss.COMMANDER_ZILYANA]: { name: 'Commander Zilyana', minimumKc: 50, isMembers: true },
|
|
1269
|
+
[Boss.CORPOREAL_BEAST]: { name: 'Corporeal Beast', minimumKc: 50, isMembers: true },
|
|
1270
|
+
[Boss.CRAZY_ARCHAEOLOGIST]: { name: 'Crazy Archaeologist', minimumKc: 50, isMembers: true },
|
|
1271
|
+
[Boss.DAGANNOTH_PRIME]: { name: 'Dagannoth Prime', minimumKc: 50, isMembers: true },
|
|
1272
|
+
[Boss.DAGANNOTH_REX]: { name: 'Dagannoth Rex', minimumKc: 50, isMembers: true },
|
|
1273
|
+
[Boss.DAGANNOTH_SUPREME]: { name: 'Dagannoth Supreme', minimumKc: 50, isMembers: true },
|
|
1274
|
+
[Boss.DERANGED_ARCHAEOLOGIST]: { name: 'Deranged Archaeologist', minimumKc: 50, isMembers: true },
|
|
1275
|
+
[Boss.GENERAL_GRAARDOR]: { name: 'General Graardor', minimumKc: 50, isMembers: true },
|
|
1276
|
+
[Boss.GIANT_MOLE]: { name: 'Giant Mole', minimumKc: 50, isMembers: true },
|
|
1277
|
+
[Boss.GROTESQUE_GUARDIANS]: { name: 'Grotesque Guardians', minimumKc: 50, isMembers: true },
|
|
1278
|
+
[Boss.HESPORI]: { name: 'Hespori', minimumKc: 5, isMembers: true },
|
|
1279
|
+
[Boss.KALPHITE_QUEEN]: { name: 'Kalphite Queen', minimumKc: 50, isMembers: true },
|
|
1280
|
+
[Boss.KING_BLACK_DRAGON]: { name: 'King Black Dragon', minimumKc: 50, isMembers: true },
|
|
1281
|
+
[Boss.KRAKEN]: { name: 'Kraken', minimumKc: 50, isMembers: true },
|
|
1282
|
+
[Boss.KREEARRA]: { name: "Kree'Arra", minimumKc: 50, isMembers: true },
|
|
1283
|
+
[Boss.KRIL_TSUTSAROTH]: { name: "K'ril Tsutsaroth", minimumKc: 50, isMembers: true },
|
|
1284
|
+
[Boss.MIMIC]: { name: 'Mimic', minimumKc: 1, isMembers: true },
|
|
1285
|
+
[Boss.NEX]: { name: 'Nex', minimumKc: 50, isMembers: true },
|
|
1286
|
+
[Boss.NIGHTMARE]: { name: 'Nightmare', minimumKc: 50, isMembers: true },
|
|
1287
|
+
[Boss.PHOSANIS_NIGHTMARE]: { name: "Phosani's Nightmare", minimumKc: 50, isMembers: true },
|
|
1288
|
+
[Boss.OBOR]: { name: 'Obor', minimumKc: 5, isMembers: false },
|
|
1289
|
+
[Boss.SARACHNIS]: { name: 'Sarachnis', minimumKc: 50, isMembers: true },
|
|
1290
|
+
[Boss.SKOTIZO]: { name: 'Skotizo', minimumKc: 5, isMembers: true },
|
|
1291
|
+
[Boss.SCORPIA]: { name: 'Scorpia', minimumKc: 50, isMembers: true },
|
|
1292
|
+
[Boss.TEMPOROSS]: { name: 'Tempoross', minimumKc: 50, isMembers: true },
|
|
1293
|
+
[Boss.THE_GAUNTLET]: { name: 'The Gauntlet', minimumKc: 50, isMembers: true },
|
|
1294
|
+
[Boss.THE_CORRUPTED_GAUNTLET]: { name: 'The Corrupted Gauntlet', minimumKc: 5, isMembers: true },
|
|
1295
|
+
[Boss.THEATRE_OF_BLOOD]: { name: 'Theatre Of Blood', minimumKc: 50, isMembers: true },
|
|
1296
|
+
[Boss.THEATRE_OF_BLOOD_HARD_MODE]: { name: 'Theatre Of Blood (HM)', minimumKc: 50, isMembers: true },
|
|
1297
|
+
[Boss.THERMONUCLEAR_SMOKE_DEVIL]: { name: 'Thermonuclear Smoke Devil', minimumKc: 50, isMembers: true },
|
|
1298
|
+
[Boss.TZKAL_ZUK]: { name: 'TzKal-Zuk', minimumKc: 1, isMembers: true },
|
|
1299
|
+
[Boss.TZTOK_JAD]: { name: 'TzTok-Jad', minimumKc: 5, isMembers: true },
|
|
1300
|
+
[Boss.VENENATIS]: { name: 'Venenatis', minimumKc: 50, isMembers: true },
|
|
1301
|
+
[Boss.VETION]: { name: "Vet'ion", minimumKc: 50, isMembers: true },
|
|
1302
|
+
[Boss.VORKATH]: { name: 'Vorkath', minimumKc: 50, isMembers: true },
|
|
1303
|
+
[Boss.WINTERTODT]: { name: 'Wintertodt', minimumKc: 50, isMembers: true },
|
|
1304
|
+
[Boss.ZALCANO]: { name: 'Zalcano', minimumKc: 50, isMembers: true },
|
|
1305
|
+
[Boss.ZULRAH]: { name: 'Zulrah', minimumKc: 50, isMembers: true }
|
|
1306
|
+
}, props => (Object.assign(Object.assign({}, props), { type: exports.MetricType.BOSS, measure: exports.MetricMeasure.KILLS })));
|
|
1307
|
+
const ActivityProps = lodash.mapValues({
|
|
1308
|
+
[Activity.LEAGUE_POINTS]: { name: 'League Points' },
|
|
1309
|
+
[Activity.BOUNTY_HUNTER_HUNTER]: { name: 'Bounty Hunter (Hunter)' },
|
|
1310
|
+
[Activity.BOUNTY_HUNTER_ROGUE]: { name: 'Bounty Hunter (Rogue)' },
|
|
1311
|
+
[Activity.CLUE_SCROLLS_ALL]: { name: 'Clue Scrolls (All)' },
|
|
1312
|
+
[Activity.CLUE_SCROLLS_BEGINNER]: { name: 'Clue Scrolls (Beginner)' },
|
|
1313
|
+
[Activity.CLUE_SCROLLS_EASY]: { name: 'Clue Scrolls (Easy)' },
|
|
1314
|
+
[Activity.CLUE_SCROLLS_MEDIUM]: { name: 'Clue Scrolls (Medium)' },
|
|
1315
|
+
[Activity.CLUE_SCROLLS_HARD]: { name: 'Clue Scrolls (Hard)' },
|
|
1316
|
+
[Activity.CLUE_SCROLLS_ELITE]: { name: 'Clue Scrolls (Elite)' },
|
|
1317
|
+
[Activity.CLUE_SCROLLS_MASTER]: { name: 'Clue Scrolls (Master)' },
|
|
1318
|
+
[Activity.LAST_MAN_STANDING]: { name: 'Last Man Standing' },
|
|
1319
|
+
[Activity.PVP_ARENA]: { name: 'PvP Arena' },
|
|
1320
|
+
[Activity.SOUL_WARS_ZEAL]: { name: 'Soul Wars Zeal' },
|
|
1321
|
+
[Activity.GUARDIANS_OF_THE_RIFT]: { name: 'Guardians of the Rift' }
|
|
1322
|
+
}, props => (Object.assign(Object.assign({}, props), { type: exports.MetricType.ACTIVITY, measure: exports.MetricMeasure.SCORE })));
|
|
1323
|
+
const VirtualProps = lodash.mapValues({
|
|
1324
|
+
[Virtual.EHP]: { name: 'EHP' },
|
|
1325
|
+
[Virtual.EHB]: { name: 'EHB' }
|
|
1326
|
+
}, props => (Object.assign(Object.assign({}, props), { type: exports.MetricType.VIRTUAL, measure: exports.MetricMeasure.VALUE })));
|
|
1327
|
+
const MetricProps = Object.assign(Object.assign(Object.assign(Object.assign({}, SkillProps), BossProps), ActivityProps), VirtualProps);
|
|
1328
|
+
const METRICS = Object.values(Metric);
|
|
1329
|
+
const SKILLS = Object.values(Skill);
|
|
1330
|
+
const BOSSES = Object.values(Boss);
|
|
1331
|
+
const ACTIVITIES = Object.values(Activity);
|
|
1332
|
+
const VIRTUALS = Object.values(Virtual);
|
|
1333
|
+
const REAL_SKILLS = SKILLS.filter(s => s !== Skill.OVERALL);
|
|
1334
|
+
const F2P_BOSSES = BOSSES.filter(b => !MetricProps[b].isMembers);
|
|
1335
|
+
const MEMBER_SKILLS = SKILLS.filter(s => MetricProps[s].isMembers);
|
|
1336
|
+
const COMBAT_SKILLS = SKILLS.filter(s => MetricProps[s].isCombat);
|
|
1337
|
+
function findMetric(metricName) {
|
|
1338
|
+
for (const [key, value] of Object.entries(MetricProps)) {
|
|
1339
|
+
if (value.name.toUpperCase() === metricName.toUpperCase())
|
|
1340
|
+
return key;
|
|
1341
|
+
}
|
|
1342
|
+
return null;
|
|
1343
|
+
}
|
|
1344
|
+
function isSkill(metric) {
|
|
1345
|
+
return metric in SkillProps;
|
|
1346
|
+
}
|
|
1347
|
+
function isActivity(metric) {
|
|
1348
|
+
return metric in ActivityProps;
|
|
1349
|
+
}
|
|
1350
|
+
function isBoss(metric) {
|
|
1351
|
+
return metric in BossProps;
|
|
1352
|
+
}
|
|
1353
|
+
function isVirtualMetric(metric) {
|
|
1354
|
+
return metric in VirtualProps;
|
|
1355
|
+
}
|
|
1356
|
+
function getMetricRankKey(metric) {
|
|
1357
|
+
return `${metric}Rank`;
|
|
1358
|
+
}
|
|
1359
|
+
function getMetricValueKey(metric) {
|
|
1360
|
+
return `${metric}${lodash.capitalize(MetricProps[metric].measure)}`;
|
|
1361
|
+
}
|
|
1362
|
+
function getMetricMeasure(metric) {
|
|
1363
|
+
return MetricProps[metric].measure;
|
|
1364
|
+
}
|
|
1365
|
+
function getMetricName(metric) {
|
|
1366
|
+
return MetricProps[metric].name;
|
|
1367
|
+
}
|
|
1368
|
+
function getMinimumBossKc(metric) {
|
|
1369
|
+
return isBoss(metric) ? MetricProps[metric].minimumKc : 0;
|
|
1370
|
+
}
|
|
1371
|
+
function getParentVirtualMetric(metric) {
|
|
1372
|
+
if (isBoss(metric))
|
|
1373
|
+
return Metric.EHB;
|
|
1374
|
+
if (isSkill(metric))
|
|
1375
|
+
return Metric.EHP;
|
|
1376
|
+
return null;
|
|
1377
|
+
}
|
|
1378
|
+
function parseMetricAbbreviation(abbreviation) {
|
|
1379
|
+
if (!abbreviation || abbreviation.length === 0) {
|
|
1380
|
+
return null;
|
|
1381
|
+
}
|
|
1382
|
+
switch (abbreviation.toLowerCase()) {
|
|
1383
|
+
// Bosses
|
|
1384
|
+
case 'sire':
|
|
1385
|
+
return Metric.ABYSSAL_SIRE;
|
|
1386
|
+
case 'hydra':
|
|
1387
|
+
return Metric.ALCHEMICAL_HYDRA;
|
|
1388
|
+
case 'barrows':
|
|
1389
|
+
return Metric.BARROWS_CHESTS;
|
|
1390
|
+
case 'bryo':
|
|
1391
|
+
return Metric.BRYOPHYTA;
|
|
1392
|
+
case 'cerb':
|
|
1393
|
+
return Metric.CERBERUS;
|
|
1394
|
+
case 'cox':
|
|
1395
|
+
case 'xeric':
|
|
1396
|
+
case 'chambers':
|
|
1397
|
+
case 'olm':
|
|
1398
|
+
case 'raids':
|
|
1399
|
+
return Metric.CHAMBERS_OF_XERIC;
|
|
1400
|
+
case 'cox-cm':
|
|
1401
|
+
case 'xeric-cm':
|
|
1402
|
+
case 'chambers-cm':
|
|
1403
|
+
case 'olm-cm':
|
|
1404
|
+
case 'raids-cm':
|
|
1405
|
+
return Metric.CHAMBERS_OF_XERIC_CM;
|
|
1406
|
+
case 'chaos-ele':
|
|
1407
|
+
return Metric.CHAOS_ELEMENTAL;
|
|
1408
|
+
case 'fanatic':
|
|
1409
|
+
return Metric.CHAOS_FANATIC;
|
|
1410
|
+
case 'sara':
|
|
1411
|
+
case 'saradomin':
|
|
1412
|
+
case 'zilyana':
|
|
1413
|
+
case 'zily':
|
|
1414
|
+
return Metric.COMMANDER_ZILYANA;
|
|
1415
|
+
case 'corp':
|
|
1416
|
+
return Metric.CORPOREAL_BEAST;
|
|
1417
|
+
case 'crazy-arch':
|
|
1418
|
+
return Metric.CRAZY_ARCHAEOLOGIST;
|
|
1419
|
+
case 'prime':
|
|
1420
|
+
return Metric.DAGANNOTH_PRIME;
|
|
1421
|
+
case 'rex':
|
|
1422
|
+
return Metric.DAGANNOTH_REX;
|
|
1423
|
+
case 'supreme':
|
|
1424
|
+
return Metric.DAGANNOTH_SUPREME;
|
|
1425
|
+
case 'deranged-arch':
|
|
1426
|
+
return Metric.DERANGED_ARCHAEOLOGIST;
|
|
1427
|
+
case 'bandos':
|
|
1428
|
+
case 'graardor':
|
|
1429
|
+
return Metric.GENERAL_GRAARDOR;
|
|
1430
|
+
case 'mole':
|
|
1431
|
+
return Metric.GIANT_MOLE;
|
|
1432
|
+
case 'dusk':
|
|
1433
|
+
case 'dawn':
|
|
1434
|
+
case 'gargs':
|
|
1435
|
+
case 'guardians':
|
|
1436
|
+
case 'ggs':
|
|
1437
|
+
return Metric.GROTESQUE_GUARDIANS;
|
|
1438
|
+
case 'kq':
|
|
1439
|
+
return Metric.KALPHITE_QUEEN;
|
|
1440
|
+
case 'kbd':
|
|
1441
|
+
return Metric.KING_BLACK_DRAGON;
|
|
1442
|
+
case 'kree':
|
|
1443
|
+
case 'kreearra':
|
|
1444
|
+
case 'armadyl':
|
|
1445
|
+
case 'arma':
|
|
1446
|
+
return Metric.KREEARRA;
|
|
1447
|
+
case 'zammy':
|
|
1448
|
+
case 'zamorak':
|
|
1449
|
+
case 'kril':
|
|
1450
|
+
case 'kril-tsutsaroth':
|
|
1451
|
+
return Metric.KRIL_TSUTSAROTH;
|
|
1452
|
+
case 'gaunt':
|
|
1453
|
+
case 'gauntlet':
|
|
1454
|
+
case 'the-gauntlet':
|
|
1455
|
+
return Metric.THE_GAUNTLET;
|
|
1456
|
+
case 'cgaunt':
|
|
1457
|
+
case 'cgauntlet':
|
|
1458
|
+
case 'corrupted':
|
|
1459
|
+
case 'corrupted-gauntlet':
|
|
1460
|
+
case 'the-corrupted-gauntlet':
|
|
1461
|
+
return Metric.THE_CORRUPTED_GAUNTLET;
|
|
1462
|
+
case 'tob':
|
|
1463
|
+
case 'theatre':
|
|
1464
|
+
case 'verzik':
|
|
1465
|
+
case 'tob-normal':
|
|
1466
|
+
return Metric.THEATRE_OF_BLOOD;
|
|
1467
|
+
case 'tob-hm':
|
|
1468
|
+
case 'tob-cm':
|
|
1469
|
+
case 'tob-hard-mode':
|
|
1470
|
+
case 'tob-hard':
|
|
1471
|
+
return Metric.THEATRE_OF_BLOOD_HARD_MODE;
|
|
1472
|
+
case 'nm':
|
|
1473
|
+
case 'tnm':
|
|
1474
|
+
case 'nmare':
|
|
1475
|
+
case 'the-nightmare':
|
|
1476
|
+
return Metric.NIGHTMARE;
|
|
1477
|
+
case 'pnm':
|
|
1478
|
+
case 'phosani':
|
|
1479
|
+
case 'phosanis':
|
|
1480
|
+
case 'phosani-nm':
|
|
1481
|
+
case 'phosani-nightmare':
|
|
1482
|
+
case 'phosanis nightmare':
|
|
1483
|
+
return Metric.PHOSANIS_NIGHTMARE;
|
|
1484
|
+
case 'thermy':
|
|
1485
|
+
case 'smoke-devil':
|
|
1486
|
+
return Metric.THERMONUCLEAR_SMOKE_DEVIL;
|
|
1487
|
+
case 'zuk':
|
|
1488
|
+
case 'inferno':
|
|
1489
|
+
return Metric.TZKAL_ZUK;
|
|
1490
|
+
case 'jad':
|
|
1491
|
+
case 'fight-caves':
|
|
1492
|
+
case 'fc':
|
|
1493
|
+
return Metric.TZTOK_JAD;
|
|
1494
|
+
case 'vork':
|
|
1495
|
+
case 'vorky':
|
|
1496
|
+
return Metric.VORKATH;
|
|
1497
|
+
case 'wt':
|
|
1498
|
+
return Metric.WINTERTODT;
|
|
1499
|
+
case 'snek':
|
|
1500
|
+
case 'zul':
|
|
1501
|
+
return Metric.ZULRAH;
|
|
1502
|
+
// Minigames and others
|
|
1503
|
+
case 'all-clues':
|
|
1504
|
+
case 'clues':
|
|
1505
|
+
return Metric.CLUE_SCROLLS_ALL;
|
|
1506
|
+
case 'beginner':
|
|
1507
|
+
case 'beginner-clues':
|
|
1508
|
+
case 'beg-clues':
|
|
1509
|
+
case 'beginners':
|
|
1510
|
+
return Metric.CLUE_SCROLLS_BEGINNER;
|
|
1511
|
+
case 'easy':
|
|
1512
|
+
case 'easy-clues':
|
|
1513
|
+
case 'easies':
|
|
1514
|
+
return Metric.CLUE_SCROLLS_EASY;
|
|
1515
|
+
case 'medium':
|
|
1516
|
+
case 'med':
|
|
1517
|
+
case 'meds':
|
|
1518
|
+
case 'medium-clues':
|
|
1519
|
+
case 'med-clues':
|
|
1520
|
+
case 'mediums':
|
|
1521
|
+
return Metric.CLUE_SCROLLS_MEDIUM;
|
|
1522
|
+
case 'hard':
|
|
1523
|
+
case 'hard-clues':
|
|
1524
|
+
case 'hards':
|
|
1525
|
+
return Metric.CLUE_SCROLLS_HARD;
|
|
1526
|
+
case 'elite':
|
|
1527
|
+
case 'elite-clues':
|
|
1528
|
+
case 'elites':
|
|
1529
|
+
return Metric.CLUE_SCROLLS_ELITE;
|
|
1530
|
+
case 'master':
|
|
1531
|
+
case 'master-clues':
|
|
1532
|
+
case 'masters':
|
|
1533
|
+
return Metric.CLUE_SCROLLS_MASTER;
|
|
1534
|
+
case 'lms':
|
|
1535
|
+
return Metric.LAST_MAN_STANDING;
|
|
1536
|
+
case 'league':
|
|
1537
|
+
case 'lp':
|
|
1538
|
+
case 'lps':
|
|
1539
|
+
return Metric.LEAGUE_POINTS;
|
|
1540
|
+
case 'sw':
|
|
1541
|
+
case 'zeal':
|
|
1542
|
+
case 'soul-wars':
|
|
1543
|
+
return Metric.SOUL_WARS_ZEAL;
|
|
1544
|
+
// Skills
|
|
1545
|
+
case 'runecraft':
|
|
1546
|
+
case 'rc':
|
|
1547
|
+
return Metric.RUNECRAFTING;
|
|
1548
|
+
case 'att':
|
|
1549
|
+
case 'atk':
|
|
1550
|
+
case 'attk':
|
|
1551
|
+
return Metric.ATTACK;
|
|
1552
|
+
case 'def':
|
|
1553
|
+
case 'defense':
|
|
1554
|
+
return Metric.DEFENCE;
|
|
1555
|
+
case 'str':
|
|
1556
|
+
return Metric.STRENGTH;
|
|
1557
|
+
case 'hp':
|
|
1558
|
+
return Metric.HITPOINTS;
|
|
1559
|
+
case 'range':
|
|
1560
|
+
return Metric.RANGED;
|
|
1561
|
+
case 'pray':
|
|
1562
|
+
return Metric.PRAYER;
|
|
1563
|
+
case 'mage':
|
|
1564
|
+
return Metric.MAGIC;
|
|
1565
|
+
case 'cook':
|
|
1566
|
+
return Metric.COOKING;
|
|
1567
|
+
case 'wc':
|
|
1568
|
+
return Metric.WOODCUTTING;
|
|
1569
|
+
case 'fletch':
|
|
1570
|
+
return Metric.FLETCHING;
|
|
1571
|
+
case 'fish':
|
|
1572
|
+
return Metric.FISHING;
|
|
1573
|
+
case 'fm':
|
|
1574
|
+
case 'burning':
|
|
1575
|
+
return Metric.FIREMAKING;
|
|
1576
|
+
case 'craft':
|
|
1577
|
+
return Metric.CRAFTING;
|
|
1578
|
+
case 'sm':
|
|
1579
|
+
case 'smith':
|
|
1580
|
+
return Metric.SMITHING;
|
|
1581
|
+
case 'mine':
|
|
1582
|
+
case 'smash':
|
|
1583
|
+
return Metric.MINING;
|
|
1584
|
+
case 'herb':
|
|
1585
|
+
return Metric.HERBLORE;
|
|
1586
|
+
case 'agi':
|
|
1587
|
+
case 'agil':
|
|
1588
|
+
return Metric.AGILITY;
|
|
1589
|
+
case 'thief':
|
|
1590
|
+
return Metric.THIEVING;
|
|
1591
|
+
case 'slay':
|
|
1592
|
+
return Metric.SLAYER;
|
|
1593
|
+
case 'farm':
|
|
1594
|
+
return Metric.FARMING;
|
|
1595
|
+
case 'hunt':
|
|
1596
|
+
case 'hunting':
|
|
1597
|
+
return Metric.HUNTER;
|
|
1598
|
+
case 'con':
|
|
1599
|
+
case 'cons':
|
|
1600
|
+
case 'const':
|
|
1601
|
+
return Metric.CONSTRUCTION;
|
|
1602
|
+
default:
|
|
1603
|
+
return abbreviation;
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
// Maximum effective skill level at 13,034,431 experience.
|
|
1608
|
+
const MAX_LEVEL = 99;
|
|
1609
|
+
// The maximum virtual skill level for any skill (200M experience).
|
|
1610
|
+
const MAX_VIRTUAL_LEVEL = 126;
|
|
1611
|
+
// The maximum skill experience (200M experience).
|
|
1612
|
+
const MAX_SKILL_EXP = 200000000;
|
|
1613
|
+
// The minimum skill exp for level 99
|
|
1614
|
+
const SKILL_EXP_AT_99 = 13034431;
|
|
1615
|
+
// The maximum skill at exactly 99 on all skills
|
|
1616
|
+
const CAPPED_MAX_TOTAL_XP = 23 * SKILL_EXP_AT_99;
|
|
1617
|
+
// Builds a lookup table for each level's required experience
|
|
1618
|
+
// exp = XP_FOR_LEVEL[level - 1] || 13m = XP_FOR_LEVEL[98]
|
|
1619
|
+
const XP_FOR_LEVEL = (function () {
|
|
1620
|
+
let xp = 0;
|
|
1621
|
+
const array = [];
|
|
1622
|
+
for (let level = 1; level <= MAX_VIRTUAL_LEVEL; ++level) {
|
|
1623
|
+
array[level - 1] = Math.floor(xp / 4);
|
|
1624
|
+
xp += Math.floor(level + 300 * Math.pow(2, level / 7));
|
|
1625
|
+
}
|
|
1626
|
+
return array;
|
|
1627
|
+
})();
|
|
1628
|
+
function getExpForLevel(level) {
|
|
1629
|
+
if (level < 1 || level > MAX_VIRTUAL_LEVEL)
|
|
1630
|
+
return 0;
|
|
1631
|
+
return XP_FOR_LEVEL[level - 1];
|
|
1632
|
+
}
|
|
1633
|
+
function getLevel(exp, virtual = false) {
|
|
1634
|
+
if (!exp || exp < 0) {
|
|
1635
|
+
return 1;
|
|
1636
|
+
}
|
|
1637
|
+
let low = 0;
|
|
1638
|
+
let high = virtual ? XP_FOR_LEVEL.length - 1 : 98;
|
|
1639
|
+
while (low <= high) {
|
|
1640
|
+
const mid = Math.floor(low + (high - low) / 2);
|
|
1641
|
+
const xpForLevel = XP_FOR_LEVEL[mid];
|
|
1642
|
+
if (exp < xpForLevel) {
|
|
1643
|
+
high = mid - 1;
|
|
1644
|
+
}
|
|
1645
|
+
else if (exp > xpForLevel) {
|
|
1646
|
+
low = mid + 1;
|
|
1647
|
+
}
|
|
1648
|
+
else {
|
|
1649
|
+
return mid + 1;
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
return high + 1;
|
|
1653
|
+
}
|
|
1654
|
+
function getCombatLevelFromExp(attack, strength, defence, ranged, magic, hitpoints, prayer) {
|
|
1655
|
+
if ([attack, strength, defence, ranged, magic, hitpoints, prayer].some(l => l === 0))
|
|
1656
|
+
return 0;
|
|
1657
|
+
const baseCombat = 0.25 * (defence + Math.max(hitpoints, 10) + Math.floor(prayer / 2));
|
|
1658
|
+
const meleeCombat = 0.325 * (attack + strength);
|
|
1659
|
+
const rangeCombat = 0.325 * Math.floor((3 * ranged) / 2);
|
|
1660
|
+
const mageCombat = 0.325 * Math.floor((3 * magic) / 2);
|
|
1661
|
+
return Math.floor(baseCombat + Math.max(meleeCombat, rangeCombat, mageCombat));
|
|
1662
|
+
}
|
|
1663
|
+
function getCombatLevel(snapshot) {
|
|
1664
|
+
if (!snapshot)
|
|
1665
|
+
return 3;
|
|
1666
|
+
return getCombatLevelFromExp(getLevel(snapshot.attackExperience), getLevel(snapshot.strengthExperience), getLevel(snapshot.defenceExperience), getLevel(snapshot.rangedExperience), getLevel(snapshot.magicExperience), getLevel(snapshot.hitpointsExperience), getLevel(snapshot.prayerExperience));
|
|
1667
|
+
}
|
|
1668
|
+
function get200msCount(snapshot) {
|
|
1669
|
+
return REAL_SKILLS.filter(s => snapshot[getMetricValueKey(s)] === MAX_SKILL_EXP).length;
|
|
1670
|
+
}
|
|
1671
|
+
function getMinimumExp(snapshot) {
|
|
1672
|
+
return REAL_SKILLS.map(s => Math.max(0, snapshot[getMetricValueKey(s)] || 0)).sort((a, b) => a - b)[0];
|
|
1673
|
+
}
|
|
1674
|
+
function getCappedExp(snapshot, max) {
|
|
1675
|
+
return REAL_SKILLS.map(s => Math.min(snapshot[getMetricValueKey(s)], max)).reduce((acc, cur) => acc + cur);
|
|
1676
|
+
}
|
|
1677
|
+
function getTotalLevel(snapshot) {
|
|
1678
|
+
return REAL_SKILLS.map(s => getLevel(snapshot[getMetricValueKey(s)])).reduce((acc, cur) => acc + cur);
|
|
1679
|
+
}
|
|
1680
|
+
function isF2p(snapshot) {
|
|
1681
|
+
const hasMemberStats = MEMBER_SKILLS.some(s => getLevel(snapshot[getMetricValueKey(s)]) > 1);
|
|
1682
|
+
const hasBossKc = BOSSES.filter(b => !F2P_BOSSES.includes(b)).some(b => snapshot[getMetricValueKey(b)] > 0);
|
|
1683
|
+
return !hasMemberStats && !hasBossKc;
|
|
1684
|
+
}
|
|
1685
|
+
function isLvl3(snapshot) {
|
|
1686
|
+
return getCombatLevel(snapshot) <= 3;
|
|
1687
|
+
}
|
|
1688
|
+
function is1Def(snapshot) {
|
|
1689
|
+
return getLevel(snapshot.defenceExperience) === 1;
|
|
1690
|
+
}
|
|
1691
|
+
function is10HP(snapshot) {
|
|
1692
|
+
return getCombatLevel(snapshot) > 3 && getLevel(snapshot.hitpointsExperience) === 10;
|
|
1693
|
+
}
|
|
1694
|
+
function isZerker(snapshot) {
|
|
1695
|
+
return getLevel(snapshot.defenceExperience) === 45;
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
const GROUP_ROLES = Object.values(GroupRole);
|
|
1699
|
+
const PRIVELEGED_GROUP_ROLES = [
|
|
1700
|
+
GroupRole.ADMINISTRATOR,
|
|
1701
|
+
GroupRole.DEPUTY_OWNER,
|
|
1702
|
+
GroupRole.LEADER,
|
|
1703
|
+
GroupRole.MODERATOR,
|
|
1704
|
+
GroupRole.OWNER
|
|
1705
|
+
];
|
|
1706
|
+
const GroupRoleProps = lodash.mapValues({
|
|
1707
|
+
[GroupRole.ACHIEVER]: { name: 'Achiever' },
|
|
1708
|
+
[GroupRole.ADAMANT]: { name: 'Adamant' },
|
|
1709
|
+
[GroupRole.ADEPT]: { name: 'Adept' },
|
|
1710
|
+
[GroupRole.ADMINISTRATOR]: { name: 'Administrator' },
|
|
1711
|
+
[GroupRole.ADMIRAL]: { name: 'Admiral' },
|
|
1712
|
+
[GroupRole.ADVENTURER]: { name: 'Adventurer' },
|
|
1713
|
+
[GroupRole.AIR]: { name: 'Air' },
|
|
1714
|
+
[GroupRole.ANCHOR]: { name: 'Anchor' },
|
|
1715
|
+
[GroupRole.APOTHECARY]: { name: 'Apothecary' },
|
|
1716
|
+
[GroupRole.ARCHER]: { name: 'Archer' },
|
|
1717
|
+
[GroupRole.ARMADYLEAN]: { name: 'Armadylean' },
|
|
1718
|
+
[GroupRole.ARTILLERY]: { name: 'Artillery' },
|
|
1719
|
+
[GroupRole.ARTISAN]: { name: 'Artisan' },
|
|
1720
|
+
[GroupRole.ASGARNIAN]: { name: 'Asgarnian' },
|
|
1721
|
+
[GroupRole.ASSASSIN]: { name: 'Assassin' },
|
|
1722
|
+
[GroupRole.ASSISTANT]: { name: 'Assistant' },
|
|
1723
|
+
[GroupRole.ASTRAL]: { name: 'Astral' },
|
|
1724
|
+
[GroupRole.ATHLETE]: { name: 'Athlete' },
|
|
1725
|
+
[GroupRole.ATTACKER]: { name: 'Attacker' },
|
|
1726
|
+
[GroupRole.BANDIT]: { name: 'Bandit' },
|
|
1727
|
+
[GroupRole.BANDOSIAN]: { name: 'Bandosian' },
|
|
1728
|
+
[GroupRole.BARBARIAN]: { name: 'Barbarian' },
|
|
1729
|
+
[GroupRole.BATTLEMAGE]: { name: 'Battlemage' },
|
|
1730
|
+
[GroupRole.BEAST]: { name: 'Beast' },
|
|
1731
|
+
[GroupRole.BERSERKER]: { name: 'Berserker' },
|
|
1732
|
+
[GroupRole.BLISTERWOOD]: { name: 'Blisterwood' },
|
|
1733
|
+
[GroupRole.BLOOD]: { name: 'Blood' },
|
|
1734
|
+
[GroupRole.BLUE]: { name: 'Blue' },
|
|
1735
|
+
[GroupRole.BOB]: { name: 'Bob' },
|
|
1736
|
+
[GroupRole.BODY]: { name: 'Body' },
|
|
1737
|
+
[GroupRole.BRASSICAN]: { name: 'Brassican' },
|
|
1738
|
+
[GroupRole.BRAWLER]: { name: 'Brawler' },
|
|
1739
|
+
[GroupRole.BRIGADIER]: { name: 'Brigadier' },
|
|
1740
|
+
[GroupRole.BRIGAND]: { name: 'Brigand' },
|
|
1741
|
+
[GroupRole.BRONZE]: { name: 'Bronze' },
|
|
1742
|
+
[GroupRole.BRUISER]: { name: 'Bruiser' },
|
|
1743
|
+
[GroupRole.BULWARK]: { name: 'Bulwark' },
|
|
1744
|
+
[GroupRole.BURGLAR]: { name: 'Burglar' },
|
|
1745
|
+
[GroupRole.BURNT]: { name: 'Burnt' },
|
|
1746
|
+
[GroupRole.CADET]: { name: 'Cadet' },
|
|
1747
|
+
[GroupRole.CAPTAIN]: { name: 'Captain' },
|
|
1748
|
+
[GroupRole.CARRY]: { name: 'Carry' },
|
|
1749
|
+
[GroupRole.CHAMPION]: { name: 'Champion' },
|
|
1750
|
+
[GroupRole.CHAOS]: { name: 'Chaos' },
|
|
1751
|
+
[GroupRole.CLERIC]: { name: 'Cleric' },
|
|
1752
|
+
[GroupRole.COLLECTOR]: { name: 'Collector' },
|
|
1753
|
+
[GroupRole.COLONEL]: { name: 'Colonel' },
|
|
1754
|
+
[GroupRole.COMMANDER]: { name: 'Commander' },
|
|
1755
|
+
[GroupRole.COMPETITOR]: { name: 'Competitor' },
|
|
1756
|
+
[GroupRole.COMPLETIONIST]: { name: 'Completionist' },
|
|
1757
|
+
[GroupRole.CONSTRUCTOR]: { name: 'Constructor' },
|
|
1758
|
+
[GroupRole.COOK]: { name: 'Cook' },
|
|
1759
|
+
[GroupRole.COORDINATOR]: { name: 'Coordinator' },
|
|
1760
|
+
[GroupRole.CORPORAL]: { name: 'Corporal' },
|
|
1761
|
+
[GroupRole.COSMIC]: { name: 'Cosmic' },
|
|
1762
|
+
[GroupRole.COUNCILLOR]: { name: 'Councillor' },
|
|
1763
|
+
[GroupRole.CRAFTER]: { name: 'Crafter' },
|
|
1764
|
+
[GroupRole.CREW]: { name: 'Crew' },
|
|
1765
|
+
[GroupRole.CRUSADER]: { name: 'Crusader' },
|
|
1766
|
+
[GroupRole.CUTPURSE]: { name: 'Cutpurse' },
|
|
1767
|
+
[GroupRole.DEATH]: { name: 'Death' },
|
|
1768
|
+
[GroupRole.DEFENDER]: { name: 'Defender' },
|
|
1769
|
+
[GroupRole.DEFILER]: { name: 'Defiler' },
|
|
1770
|
+
[GroupRole.DEPUTY_OWNER]: { name: 'Deputy Owner' },
|
|
1771
|
+
[GroupRole.DESTROYER]: { name: 'Destroyer' },
|
|
1772
|
+
[GroupRole.DIAMOND]: { name: 'Diamond' },
|
|
1773
|
+
[GroupRole.DISEASED]: { name: 'Diseased' },
|
|
1774
|
+
[GroupRole.DOCTOR]: { name: 'Doctor' },
|
|
1775
|
+
[GroupRole.DOGSBODY]: { name: 'Dogsbody' },
|
|
1776
|
+
[GroupRole.DRAGON]: { name: 'Dragon' },
|
|
1777
|
+
[GroupRole.DRAGONSTONE]: { name: 'Dragonstone' },
|
|
1778
|
+
[GroupRole.DRUID]: { name: 'Druid' },
|
|
1779
|
+
[GroupRole.DUELLIST]: { name: 'Duellist' },
|
|
1780
|
+
[GroupRole.EARTH]: { name: 'Earth' },
|
|
1781
|
+
[GroupRole.ELITE]: { name: 'Elite' },
|
|
1782
|
+
[GroupRole.EMERALD]: { name: 'Emerald' },
|
|
1783
|
+
[GroupRole.ENFORCER]: { name: 'Enforcer' },
|
|
1784
|
+
[GroupRole.EPIC]: { name: 'Epic' },
|
|
1785
|
+
[GroupRole.EXECUTIVE]: { name: 'Executive' },
|
|
1786
|
+
[GroupRole.EXPERT]: { name: 'Expert' },
|
|
1787
|
+
[GroupRole.EXPLORER]: { name: 'Explorer' },
|
|
1788
|
+
[GroupRole.FARMER]: { name: 'Farmer' },
|
|
1789
|
+
[GroupRole.FEEDER]: { name: 'Feeder' },
|
|
1790
|
+
[GroupRole.FIGHTER]: { name: 'Fighter' },
|
|
1791
|
+
[GroupRole.FIRE]: { name: 'Fire' },
|
|
1792
|
+
[GroupRole.FIREMAKER]: { name: 'Firemaker' },
|
|
1793
|
+
[GroupRole.FIRESTARTER]: { name: 'Firestarter' },
|
|
1794
|
+
[GroupRole.FISHER]: { name: 'Fisher' },
|
|
1795
|
+
[GroupRole.FLETCHER]: { name: 'Fletcher' },
|
|
1796
|
+
[GroupRole.FORAGER]: { name: 'Forager' },
|
|
1797
|
+
[GroupRole.FREMENNIK]: { name: 'Fremennik' },
|
|
1798
|
+
[GroupRole.GAMER]: { name: 'Gamer' },
|
|
1799
|
+
[GroupRole.GATHERER]: { name: 'Gatherer' },
|
|
1800
|
+
[GroupRole.GENERAL]: { name: 'General' },
|
|
1801
|
+
[GroupRole.GNOME_CHILD]: { name: 'Gnome Child' },
|
|
1802
|
+
[GroupRole.GNOME_ELDER]: { name: 'Gnome Elder' },
|
|
1803
|
+
[GroupRole.GOBLIN]: { name: 'Goblin' },
|
|
1804
|
+
[GroupRole.GOLD]: { name: 'Gold' },
|
|
1805
|
+
[GroupRole.GOON]: { name: 'Goon' },
|
|
1806
|
+
[GroupRole.GREEN]: { name: 'Green' },
|
|
1807
|
+
[GroupRole.GREY]: { name: 'Grey' },
|
|
1808
|
+
[GroupRole.GUARDIAN]: { name: 'Guardian' },
|
|
1809
|
+
[GroupRole.GUTHIXIAN]: { name: 'Guthixian' },
|
|
1810
|
+
[GroupRole.HARPOON]: { name: 'Harpoon' },
|
|
1811
|
+
[GroupRole.HEALER]: { name: 'Healer' },
|
|
1812
|
+
[GroupRole.HELLCAT]: { name: 'Hellcat' },
|
|
1813
|
+
[GroupRole.HELPER]: { name: 'Helper' },
|
|
1814
|
+
[GroupRole.HERBOLOGIST]: { name: 'Herbologist' },
|
|
1815
|
+
[GroupRole.HERO]: { name: 'Hero' },
|
|
1816
|
+
[GroupRole.HOLY]: { name: 'Holy' },
|
|
1817
|
+
[GroupRole.HOARDER]: { name: 'Hoarder' },
|
|
1818
|
+
[GroupRole.HUNTER]: { name: 'Hunter' },
|
|
1819
|
+
[GroupRole.IGNITOR]: { name: 'Ignitor' },
|
|
1820
|
+
[GroupRole.ILLUSIONIST]: { name: 'Illusionist' },
|
|
1821
|
+
[GroupRole.IMP]: { name: 'Imp' },
|
|
1822
|
+
[GroupRole.INFANTRY]: { name: 'Infantry' },
|
|
1823
|
+
[GroupRole.INQUISITOR]: { name: 'Inquisitor' },
|
|
1824
|
+
[GroupRole.IRON]: { name: 'Iron' },
|
|
1825
|
+
[GroupRole.JADE]: { name: 'Jade' },
|
|
1826
|
+
[GroupRole.JUSTICIAR]: { name: 'Justiciar' },
|
|
1827
|
+
[GroupRole.KANDARIN]: { name: 'Kandarin' },
|
|
1828
|
+
[GroupRole.KARAMJAN]: { name: 'Karamjan' },
|
|
1829
|
+
[GroupRole.KHARIDIAN]: { name: 'Kharidian' },
|
|
1830
|
+
[GroupRole.KITTEN]: { name: 'Kitten' },
|
|
1831
|
+
[GroupRole.KNIGHT]: { name: 'Knight' },
|
|
1832
|
+
[GroupRole.LABOURER]: { name: 'Labourer' },
|
|
1833
|
+
[GroupRole.LAW]: { name: 'Law' },
|
|
1834
|
+
[GroupRole.LEADER]: { name: 'Leader' },
|
|
1835
|
+
[GroupRole.LEARNER]: { name: 'Learner' },
|
|
1836
|
+
[GroupRole.LEGACY]: { name: 'Legacy' },
|
|
1837
|
+
[GroupRole.LEGEND]: { name: 'Legend' },
|
|
1838
|
+
[GroupRole.LEGIONNAIRE]: { name: 'Legionnaire' },
|
|
1839
|
+
[GroupRole.LIEUTENANT]: { name: 'Lieutenant' },
|
|
1840
|
+
[GroupRole.LOOTER]: { name: 'Looter' },
|
|
1841
|
+
[GroupRole.LUMBERJACK]: { name: 'Lumberjack' },
|
|
1842
|
+
[GroupRole.MAGIC]: { name: 'Magic' },
|
|
1843
|
+
[GroupRole.MAGICIAN]: { name: 'Magician' },
|
|
1844
|
+
[GroupRole.MAJOR]: { name: 'Major' },
|
|
1845
|
+
[GroupRole.MAPLE]: { name: 'Maple' },
|
|
1846
|
+
[GroupRole.MARSHAL]: { name: 'Marshal' },
|
|
1847
|
+
[GroupRole.MASTER]: { name: 'Master' },
|
|
1848
|
+
[GroupRole.MAXED]: { name: 'Maxed' },
|
|
1849
|
+
[GroupRole.MEDIATOR]: { name: 'Mediator' },
|
|
1850
|
+
[GroupRole.MEDIC]: { name: 'Medic' },
|
|
1851
|
+
[GroupRole.MENTOR]: { name: 'Mentor' },
|
|
1852
|
+
[GroupRole.MEMBER]: { name: 'Member' },
|
|
1853
|
+
[GroupRole.MERCHANT]: { name: 'Merchant' },
|
|
1854
|
+
[GroupRole.MIND]: { name: 'Mind' },
|
|
1855
|
+
[GroupRole.MINER]: { name: 'Miner' },
|
|
1856
|
+
[GroupRole.MINION]: { name: 'Minion' },
|
|
1857
|
+
[GroupRole.MISTHALINIAN]: { name: 'Misthalinian' },
|
|
1858
|
+
[GroupRole.MITHRIL]: { name: 'Mithril' },
|
|
1859
|
+
[GroupRole.MODERATOR]: { name: 'Moderator' },
|
|
1860
|
+
[GroupRole.MONARCH]: { name: 'Monarch' },
|
|
1861
|
+
[GroupRole.MORYTANIAN]: { name: 'Morytanian' },
|
|
1862
|
+
[GroupRole.MYSTIC]: { name: 'Mystic' },
|
|
1863
|
+
[GroupRole.MYTH]: { name: 'Myth' },
|
|
1864
|
+
[GroupRole.NATURAL]: { name: 'Natural' },
|
|
1865
|
+
[GroupRole.NATURE]: { name: 'Nature' },
|
|
1866
|
+
[GroupRole.NECROMANCER]: { name: 'Necromancer' },
|
|
1867
|
+
[GroupRole.NINJA]: { name: 'Ninja' },
|
|
1868
|
+
[GroupRole.NOBLE]: { name: 'Noble' },
|
|
1869
|
+
[GroupRole.NOVICE]: { name: 'Novice' },
|
|
1870
|
+
[GroupRole.NURSE]: { name: 'Nurse' },
|
|
1871
|
+
[GroupRole.OAK]: { name: 'Oak' },
|
|
1872
|
+
[GroupRole.OFFICER]: { name: 'Officer' },
|
|
1873
|
+
[GroupRole.ONYX]: { name: 'Onyx' },
|
|
1874
|
+
[GroupRole.OPAL]: { name: 'Opal' },
|
|
1875
|
+
[GroupRole.ORACLE]: { name: 'Oracle' },
|
|
1876
|
+
[GroupRole.ORANGE]: { name: 'Orange' },
|
|
1877
|
+
[GroupRole.OWNER]: { name: 'Owner' },
|
|
1878
|
+
[GroupRole.PAGE]: { name: 'Page' },
|
|
1879
|
+
[GroupRole.PALADIN]: { name: 'Paladin' },
|
|
1880
|
+
[GroupRole.PAWN]: { name: 'Pawn' },
|
|
1881
|
+
[GroupRole.PILGRIM]: { name: 'Pilgrim' },
|
|
1882
|
+
[GroupRole.PINE]: { name: 'Pine' },
|
|
1883
|
+
[GroupRole.PINK]: { name: 'Pink' },
|
|
1884
|
+
[GroupRole.PREFECT]: { name: 'Prefect' },
|
|
1885
|
+
[GroupRole.PRIEST]: { name: 'Priest' },
|
|
1886
|
+
[GroupRole.PRIVATE]: { name: 'Private' },
|
|
1887
|
+
[GroupRole.PRODIGY]: { name: 'Prodigy' },
|
|
1888
|
+
[GroupRole.PROSELYTE]: { name: 'Proselyte' },
|
|
1889
|
+
[GroupRole.PROSPECTOR]: { name: 'Prospector' },
|
|
1890
|
+
[GroupRole.PROTECTOR]: { name: 'Protector' },
|
|
1891
|
+
[GroupRole.PURE]: { name: 'Pure' },
|
|
1892
|
+
[GroupRole.PURPLE]: { name: 'Purple' },
|
|
1893
|
+
[GroupRole.PYROMANCER]: { name: 'Pyromancer' },
|
|
1894
|
+
[GroupRole.QUESTER]: { name: 'Quester' },
|
|
1895
|
+
[GroupRole.RACER]: { name: 'Racer' },
|
|
1896
|
+
[GroupRole.RAIDER]: { name: 'Raider' },
|
|
1897
|
+
[GroupRole.RANGER]: { name: 'Ranger' },
|
|
1898
|
+
[GroupRole.RECORD_CHASER]: { name: 'Record-Chaser' },
|
|
1899
|
+
[GroupRole.RECRUIT]: { name: 'Recruit' },
|
|
1900
|
+
[GroupRole.RECRUITER]: { name: 'Recruiter' },
|
|
1901
|
+
[GroupRole.RED_TOPAZ]: { name: 'Red Topaz' },
|
|
1902
|
+
[GroupRole.RED]: { name: 'Red' },
|
|
1903
|
+
[GroupRole.ROGUE]: { name: 'Rogue' },
|
|
1904
|
+
[GroupRole.RUBY]: { name: 'Ruby' },
|
|
1905
|
+
[GroupRole.RUNE]: { name: 'Rune' },
|
|
1906
|
+
[GroupRole.RUNECRAFTER]: { name: 'Runecrafter' },
|
|
1907
|
+
[GroupRole.SAGE]: { name: 'Sage' },
|
|
1908
|
+
[GroupRole.SAPPHIRE]: { name: 'Sapphire' },
|
|
1909
|
+
[GroupRole.SARADOMINIST]: { name: 'Saradominist' },
|
|
1910
|
+
[GroupRole.SAVIOUR]: { name: 'Saviour' },
|
|
1911
|
+
[GroupRole.SCAVENGER]: { name: 'Scavenger' },
|
|
1912
|
+
[GroupRole.SCHOLAR]: { name: 'Scholar' },
|
|
1913
|
+
[GroupRole.SCOURGE]: { name: 'Scourge' },
|
|
1914
|
+
[GroupRole.SCOUT]: { name: 'Scout' },
|
|
1915
|
+
[GroupRole.SCRIBE]: { name: 'Scribe' },
|
|
1916
|
+
[GroupRole.SEER]: { name: 'Seer' },
|
|
1917
|
+
[GroupRole.SENATOR]: { name: 'Senator' },
|
|
1918
|
+
[GroupRole.SENTRY]: { name: 'Sentry' },
|
|
1919
|
+
[GroupRole.SERENIST]: { name: 'Serenist' },
|
|
1920
|
+
[GroupRole.SERGEANT]: { name: 'Sergeant' },
|
|
1921
|
+
[GroupRole.SHAMAN]: { name: 'Shaman' },
|
|
1922
|
+
[GroupRole.SHERIFF]: { name: 'Sheriff' },
|
|
1923
|
+
[GroupRole.SHORT_GREEN_GUY]: { name: 'Short Green Guy' },
|
|
1924
|
+
[GroupRole.SKILLER]: { name: 'Skiller' },
|
|
1925
|
+
[GroupRole.SKULLED]: { name: 'Skulled' },
|
|
1926
|
+
[GroupRole.SLAYER]: { name: 'Slayer' },
|
|
1927
|
+
[GroupRole.SMITER]: { name: 'Smiter' },
|
|
1928
|
+
[GroupRole.SMITH]: { name: 'Smith' },
|
|
1929
|
+
[GroupRole.SMUGGLER]: { name: 'Smuggler' },
|
|
1930
|
+
[GroupRole.SNIPER]: { name: 'Sniper' },
|
|
1931
|
+
[GroupRole.SOUL]: { name: 'Soul' },
|
|
1932
|
+
[GroupRole.SPECIALIST]: { name: 'Specialist' },
|
|
1933
|
+
[GroupRole.SPEED_RUNNER]: { name: 'Speed-Runner' },
|
|
1934
|
+
[GroupRole.SPELLCASTER]: { name: 'Spellcaster' },
|
|
1935
|
+
[GroupRole.SQUIRE]: { name: 'Squire' },
|
|
1936
|
+
[GroupRole.STAFF]: { name: 'Staff' },
|
|
1937
|
+
[GroupRole.STEEL]: { name: 'Steel' },
|
|
1938
|
+
[GroupRole.STRIDER]: { name: 'Strider' },
|
|
1939
|
+
[GroupRole.STRIKER]: { name: 'Striker' },
|
|
1940
|
+
[GroupRole.SUMMONER]: { name: 'Summoner' },
|
|
1941
|
+
[GroupRole.SUPERIOR]: { name: 'Superior' },
|
|
1942
|
+
[GroupRole.SUPERVISOR]: { name: 'Supervisor' },
|
|
1943
|
+
[GroupRole.TEACHER]: { name: 'Teacher' },
|
|
1944
|
+
[GroupRole.TEMPLAR]: { name: 'Templar' },
|
|
1945
|
+
[GroupRole.THERAPIST]: { name: 'Therapist' },
|
|
1946
|
+
[GroupRole.THIEF]: { name: 'Thief' },
|
|
1947
|
+
[GroupRole.TIRANNIAN]: { name: 'Tirannian' },
|
|
1948
|
+
[GroupRole.TRIALIST]: { name: 'Trialist' },
|
|
1949
|
+
[GroupRole.TRICKSTER]: { name: 'Trickster' },
|
|
1950
|
+
[GroupRole.TZKAL]: { name: 'TzKal' },
|
|
1951
|
+
[GroupRole.TZTOK]: { name: 'TzTok' },
|
|
1952
|
+
[GroupRole.UNHOLY]: { name: 'Unholy' },
|
|
1953
|
+
[GroupRole.VAGRANT]: { name: 'Vagrant' },
|
|
1954
|
+
[GroupRole.VANGUARD]: { name: 'Vanguard' },
|
|
1955
|
+
[GroupRole.WALKER]: { name: 'Walker' },
|
|
1956
|
+
[GroupRole.WANDERER]: { name: 'Wanderer' },
|
|
1957
|
+
[GroupRole.WARDEN]: { name: 'Warden' },
|
|
1958
|
+
[GroupRole.WARLOCK]: { name: 'Warlock' },
|
|
1959
|
+
[GroupRole.WARRIOR]: { name: 'Warrior' },
|
|
1960
|
+
[GroupRole.WATER]: { name: 'Water' },
|
|
1961
|
+
[GroupRole.WILD]: { name: 'Wild' },
|
|
1962
|
+
[GroupRole.WILLOW]: { name: 'Willow' },
|
|
1963
|
+
[GroupRole.WILY]: { name: 'Wily' },
|
|
1964
|
+
[GroupRole.WINTUMBER]: { name: 'Wintumber' },
|
|
1965
|
+
[GroupRole.WITCH]: { name: 'Witch' },
|
|
1966
|
+
[GroupRole.WIZARD]: { name: 'Wizard' },
|
|
1967
|
+
[GroupRole.WORKER]: { name: 'Worker' },
|
|
1968
|
+
[GroupRole.WRATH]: { name: 'Wrath' },
|
|
1969
|
+
[GroupRole.XERICIAN]: { name: 'Xerician' },
|
|
1970
|
+
[GroupRole.YELLOW]: { name: 'Yellow' },
|
|
1971
|
+
[GroupRole.YEW]: { name: 'Yew' },
|
|
1972
|
+
[GroupRole.ZAMORAKIAN]: { name: 'Zamorakian' },
|
|
1973
|
+
[GroupRole.ZAROSIAN]: { name: 'Zarosian' },
|
|
1974
|
+
[GroupRole.ZEALOT]: { name: 'Zealot' },
|
|
1975
|
+
[GroupRole.ZENYTE]: { name: 'Zenyte' }
|
|
1976
|
+
}, (props, key) => (Object.assign(Object.assign({}, props), { isPriveleged: PRIVELEGED_GROUP_ROLES.includes(key) })));
|
|
1977
|
+
function findGroupRole(roleName) {
|
|
1978
|
+
for (const [key, value] of Object.entries(GroupRoleProps)) {
|
|
1979
|
+
if (value.name.toUpperCase() === roleName.toUpperCase()) {
|
|
1980
|
+
return key;
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
return null;
|
|
1984
|
+
}
|
|
1985
|
+
|
|
1986
|
+
const CUSTOM_PERIOD_REGEX = /(\d+y)?(\d+m)?(\d+w)?(\d+d)?(\d+h)?/;
|
|
1987
|
+
const PeriodProps = {
|
|
1988
|
+
[Period.FIVE_MIN]: { name: '5 Min', milliseconds: 300000 },
|
|
1989
|
+
[Period.DAY]: { name: 'Day', milliseconds: 86400000 },
|
|
1990
|
+
[Period.WEEK]: { name: 'Week', milliseconds: 604800000 },
|
|
1991
|
+
[Period.MONTH]: { name: 'Month', milliseconds: 2678400000 },
|
|
1992
|
+
[Period.YEAR]: { name: 'Year', milliseconds: 31556926000 }
|
|
1993
|
+
};
|
|
1994
|
+
const PERIODS = Object.values(Period);
|
|
1995
|
+
function findPeriod(periodName) {
|
|
1996
|
+
for (const [key, value] of Object.entries(PeriodProps)) {
|
|
1997
|
+
if (value.name.toUpperCase() === periodName.toUpperCase())
|
|
1998
|
+
return key;
|
|
1999
|
+
}
|
|
2000
|
+
return null;
|
|
2001
|
+
}
|
|
2002
|
+
function parsePeriodExpression(periodExpression) {
|
|
2003
|
+
const fixed = periodExpression.toLowerCase();
|
|
2004
|
+
if (PERIODS.includes(fixed)) {
|
|
2005
|
+
return {
|
|
2006
|
+
expression: fixed,
|
|
2007
|
+
durationMs: PeriodProps[fixed].milliseconds
|
|
2008
|
+
};
|
|
2009
|
+
}
|
|
2010
|
+
const result = fixed.match(CUSTOM_PERIOD_REGEX);
|
|
2011
|
+
if (!result || result.length === 0 || result[0] !== fixed)
|
|
2012
|
+
return null;
|
|
2013
|
+
const years = result[1] ? parseInt(result[1].replace(/\D/g, '')) : 0;
|
|
2014
|
+
const months = result[2] ? parseInt(result[2].replace(/\D/g, '')) : 0;
|
|
2015
|
+
const weeks = result[3] ? parseInt(result[3].replace(/\D/g, '')) : 0;
|
|
2016
|
+
const days = result[4] ? parseInt(result[4].replace(/\D/g, '')) : 0;
|
|
2017
|
+
const hours = result[5] ? parseInt(result[5].replace(/\D/g, '')) : 0;
|
|
2018
|
+
const yearsMs = years * PeriodProps[Period.YEAR].milliseconds;
|
|
2019
|
+
const monthsMs = months * PeriodProps[Period.MONTH].milliseconds;
|
|
2020
|
+
const weeksMs = weeks * PeriodProps[Period.WEEK].milliseconds;
|
|
2021
|
+
const daysMs = days * PeriodProps[Period.DAY].milliseconds;
|
|
2022
|
+
const hoursMs = hours * (PeriodProps[Period.DAY].milliseconds / 24);
|
|
2023
|
+
const totalMs = yearsMs + monthsMs + weeksMs + daysMs + hoursMs;
|
|
2024
|
+
return {
|
|
2025
|
+
expression: result[0],
|
|
2026
|
+
durationMs: totalMs
|
|
2027
|
+
};
|
|
2028
|
+
}
|
|
2029
|
+
|
|
2030
|
+
const PlayerTypeProps = {
|
|
2031
|
+
[PlayerType.UNKNOWN]: { name: 'Unknown' },
|
|
2032
|
+
[PlayerType.REGULAR]: { name: 'Regular' },
|
|
2033
|
+
[PlayerType.IRONMAN]: { name: 'Ironman' },
|
|
2034
|
+
[PlayerType.HARDCORE]: { name: 'Hardcore' },
|
|
2035
|
+
[PlayerType.ULTIMATE]: { name: 'Ultimate' }
|
|
2036
|
+
};
|
|
2037
|
+
const PlayerBuildProps = {
|
|
2038
|
+
[PlayerBuild.MAIN]: { name: 'Main' },
|
|
2039
|
+
[PlayerBuild.F2P]: { name: 'F2P' },
|
|
2040
|
+
[PlayerBuild.LVL3]: { name: 'Level 3' },
|
|
2041
|
+
[PlayerBuild.ZERKER]: { name: 'Zerker Pure' },
|
|
2042
|
+
[PlayerBuild.DEF1]: { name: '1 Defence Pure' },
|
|
2043
|
+
[PlayerBuild.HP10]: { name: '10 Hitpoints Pure' }
|
|
2044
|
+
};
|
|
2045
|
+
const PLAYER_TYPES = Object.values(PlayerType);
|
|
2046
|
+
const PLAYER_BUILDS = Object.values(PlayerBuild);
|
|
2047
|
+
function findPlayerType(typeName) {
|
|
2048
|
+
for (const [key, value] of Object.entries(PlayerTypeProps)) {
|
|
2049
|
+
if (value.name.toUpperCase() === typeName.toUpperCase())
|
|
2050
|
+
return key;
|
|
2051
|
+
}
|
|
2052
|
+
return null;
|
|
2053
|
+
}
|
|
2054
|
+
function findPlayerBuild(buildName) {
|
|
2055
|
+
for (const [key, value] of Object.entries(PlayerBuildProps)) {
|
|
2056
|
+
if (value.name.toUpperCase() === buildName.toUpperCase())
|
|
2057
|
+
return key;
|
|
2058
|
+
}
|
|
2059
|
+
return null;
|
|
2060
|
+
}
|
|
2061
|
+
|
|
2062
|
+
function formatNumber(num, withLetters = false) {
|
|
2063
|
+
if (num === undefined || num === null)
|
|
2064
|
+
return -1;
|
|
2065
|
+
// If number is float
|
|
2066
|
+
if (num % 1 !== 0) {
|
|
2067
|
+
return (Math.round(num * 100) / 100).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,');
|
|
2068
|
+
}
|
|
2069
|
+
if ((num < 10000 && num > -10000) || !withLetters) {
|
|
2070
|
+
return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,');
|
|
2071
|
+
}
|
|
2072
|
+
// < 10 million
|
|
2073
|
+
if (num < 10000000 && num > -10000000) {
|
|
2074
|
+
return `${Math.floor(num / 1000)}k`;
|
|
2075
|
+
}
|
|
2076
|
+
// < 1 billion
|
|
2077
|
+
if (num < 1000000000 && num > -1000000000) {
|
|
2078
|
+
return `${Math.round((num / 1000000 + Number.EPSILON) * 100) / 100}m`;
|
|
2079
|
+
}
|
|
2080
|
+
return `${Math.round((num / 1000000000 + Number.EPSILON) * 100) / 100}b`;
|
|
2081
|
+
}
|
|
2082
|
+
function padNumber(value) {
|
|
2083
|
+
if (!value)
|
|
2084
|
+
return '00';
|
|
2085
|
+
return value < 10 ? `0${value}` : value.toString();
|
|
2086
|
+
}
|
|
2087
|
+
function round(num, cases) {
|
|
2088
|
+
return Math.round(num * Math.pow(10, cases)) / Math.pow(10, cases);
|
|
2089
|
+
}
|
|
2090
|
+
|
|
2091
|
+
exports.BonusType = void 0;
|
|
2092
|
+
(function (BonusType) {
|
|
2093
|
+
BonusType[BonusType["START"] = 0] = "START";
|
|
2094
|
+
BonusType[BonusType["END"] = 1] = "END";
|
|
2095
|
+
})(exports.BonusType || (exports.BonusType = {}));
|
|
2096
|
+
exports.EfficiencyAlgorithmType = void 0;
|
|
2097
|
+
(function (EfficiencyAlgorithmType) {
|
|
2098
|
+
EfficiencyAlgorithmType["MAIN"] = "main";
|
|
2099
|
+
EfficiencyAlgorithmType["IRONMAN"] = "ironman";
|
|
2100
|
+
EfficiencyAlgorithmType["LVL3"] = "lvl3";
|
|
2101
|
+
EfficiencyAlgorithmType["F2P"] = "f2p";
|
|
2102
|
+
})(exports.EfficiencyAlgorithmType || (exports.EfficiencyAlgorithmType = {}));
|
|
2103
|
+
|
|
2104
|
+
exports.MigrationDataSource = void 0;
|
|
2105
|
+
(function (MigrationDataSource) {
|
|
2106
|
+
MigrationDataSource[MigrationDataSource["TEMPLE_OSRS"] = 0] = "TEMPLE_OSRS";
|
|
2107
|
+
MigrationDataSource[MigrationDataSource["CRYSTAL_MATH_LABS"] = 1] = "CRYSTAL_MATH_LABS";
|
|
2108
|
+
})(exports.MigrationDataSource || (exports.MigrationDataSource = {}));
|
|
2109
|
+
|
|
2110
|
+
exports.SnapshotDataSource = void 0;
|
|
2111
|
+
(function (SnapshotDataSource) {
|
|
2112
|
+
SnapshotDataSource[SnapshotDataSource["HISCORES"] = 0] = "HISCORES";
|
|
2113
|
+
SnapshotDataSource[SnapshotDataSource["CRYSTAL_MATH_LABS"] = 1] = "CRYSTAL_MATH_LABS";
|
|
2114
|
+
})(exports.SnapshotDataSource || (exports.SnapshotDataSource = {}));
|
|
2115
|
+
|
|
2116
|
+
class EfficiencyClient {
|
|
2117
|
+
getEfficiencyLeaderboards(filter, pagination) {
|
|
2118
|
+
return sendGetRequest('/efficiency/leaderboard', Object.assign(Object.assign({}, filter), pagination));
|
|
2119
|
+
}
|
|
2120
|
+
getEHPRates(algorithmType) {
|
|
2121
|
+
return sendGetRequest('/efficiency/rates', { metric: Metric.EHP, type: algorithmType });
|
|
2122
|
+
}
|
|
2123
|
+
getEHBRates(algorithmType) {
|
|
2124
|
+
return sendGetRequest('/efficiency/rates', { metric: Metric.EHB, type: algorithmType });
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
|
|
2128
|
+
class WOMClient {
|
|
2129
|
+
constructor() {
|
|
2130
|
+
this.players = new PlayersClient();
|
|
2131
|
+
this.records = new RecordsClient();
|
|
2132
|
+
this.deltas = new DeltasClient();
|
|
2133
|
+
this.efficiency = new EfficiencyClient();
|
|
2134
|
+
}
|
|
2135
|
+
}
|
|
2136
|
+
|
|
2137
|
+
exports.ACTIVITIES = ACTIVITIES;
|
|
2138
|
+
exports.Activity = Activity;
|
|
2139
|
+
exports.BOSSES = BOSSES;
|
|
2140
|
+
exports.Boss = Boss;
|
|
2141
|
+
exports.CAPPED_MAX_TOTAL_XP = CAPPED_MAX_TOTAL_XP;
|
|
2142
|
+
exports.COMBAT_SKILLS = COMBAT_SKILLS;
|
|
2143
|
+
exports.COMPETITION_STATUSES = COMPETITION_STATUSES;
|
|
2144
|
+
exports.COMPETITION_TYPES = COMPETITION_TYPES;
|
|
2145
|
+
exports.COUNTRY_CODES = COUNTRY_CODES;
|
|
2146
|
+
exports.CompetitionStatusProps = CompetitionStatusProps;
|
|
2147
|
+
exports.CompetitionType = CompetitionType;
|
|
2148
|
+
exports.CompetitionTypeProps = CompetitionTypeProps;
|
|
2149
|
+
exports.Country = Country;
|
|
2150
|
+
exports.CountryProps = CountryProps;
|
|
2151
|
+
exports.F2P_BOSSES = F2P_BOSSES;
|
|
2152
|
+
exports.GROUP_ROLES = GROUP_ROLES;
|
|
2153
|
+
exports.GroupRole = GroupRole;
|
|
2154
|
+
exports.GroupRoleProps = GroupRoleProps;
|
|
2155
|
+
exports.MAX_LEVEL = MAX_LEVEL;
|
|
2156
|
+
exports.MAX_SKILL_EXP = MAX_SKILL_EXP;
|
|
2157
|
+
exports.MAX_VIRTUAL_LEVEL = MAX_VIRTUAL_LEVEL;
|
|
2158
|
+
exports.MEMBER_SKILLS = MEMBER_SKILLS;
|
|
2159
|
+
exports.METRICS = METRICS;
|
|
2160
|
+
exports.Metric = Metric;
|
|
2161
|
+
exports.MetricProps = MetricProps;
|
|
2162
|
+
exports.NameChangeStatus = NameChangeStatus;
|
|
2163
|
+
exports.PERIODS = PERIODS;
|
|
2164
|
+
exports.PLAYER_BUILDS = PLAYER_BUILDS;
|
|
2165
|
+
exports.PLAYER_TYPES = PLAYER_TYPES;
|
|
2166
|
+
exports.PRIVELEGED_GROUP_ROLES = PRIVELEGED_GROUP_ROLES;
|
|
2167
|
+
exports.Period = Period;
|
|
2168
|
+
exports.PeriodProps = PeriodProps;
|
|
2169
|
+
exports.PlayerBuild = PlayerBuild;
|
|
2170
|
+
exports.PlayerBuildProps = PlayerBuildProps;
|
|
2171
|
+
exports.PlayerType = PlayerType;
|
|
2172
|
+
exports.PlayerTypeProps = PlayerTypeProps;
|
|
2173
|
+
exports.REAL_SKILLS = REAL_SKILLS;
|
|
2174
|
+
exports.SKILLS = SKILLS;
|
|
2175
|
+
exports.SKILL_EXP_AT_99 = SKILL_EXP_AT_99;
|
|
2176
|
+
exports.Skill = Skill;
|
|
2177
|
+
exports.VIRTUALS = VIRTUALS;
|
|
2178
|
+
exports.Virtual = Virtual;
|
|
2179
|
+
exports.WOMClient = WOMClient;
|
|
2180
|
+
exports.findCompetitionStatus = findCompetitionStatus;
|
|
2181
|
+
exports.findCompetitionType = findCompetitionType;
|
|
2182
|
+
exports.findCountry = findCountry;
|
|
2183
|
+
exports.findCountryByCode = findCountryByCode;
|
|
2184
|
+
exports.findCountryByName = findCountryByName;
|
|
2185
|
+
exports.findGroupRole = findGroupRole;
|
|
2186
|
+
exports.findMetric = findMetric;
|
|
2187
|
+
exports.findPeriod = findPeriod;
|
|
2188
|
+
exports.findPlayerBuild = findPlayerBuild;
|
|
2189
|
+
exports.findPlayerType = findPlayerType;
|
|
2190
|
+
exports.formatNumber = formatNumber;
|
|
2191
|
+
exports.get200msCount = get200msCount;
|
|
2192
|
+
exports.getCappedExp = getCappedExp;
|
|
2193
|
+
exports.getCombatLevel = getCombatLevel;
|
|
2194
|
+
exports.getCombatLevelFromExp = getCombatLevelFromExp;
|
|
2195
|
+
exports.getExpForLevel = getExpForLevel;
|
|
2196
|
+
exports.getLevel = getLevel;
|
|
2197
|
+
exports.getMetricMeasure = getMetricMeasure;
|
|
2198
|
+
exports.getMetricName = getMetricName;
|
|
2199
|
+
exports.getMetricRankKey = getMetricRankKey;
|
|
2200
|
+
exports.getMetricValueKey = getMetricValueKey;
|
|
2201
|
+
exports.getMinimumBossKc = getMinimumBossKc;
|
|
2202
|
+
exports.getMinimumExp = getMinimumExp;
|
|
2203
|
+
exports.getParentVirtualMetric = getParentVirtualMetric;
|
|
2204
|
+
exports.getTotalLevel = getTotalLevel;
|
|
2205
|
+
exports.is10HP = is10HP;
|
|
2206
|
+
exports.is1Def = is1Def;
|
|
2207
|
+
exports.isActivity = isActivity;
|
|
2208
|
+
exports.isBoss = isBoss;
|
|
2209
|
+
exports.isF2p = isF2p;
|
|
2210
|
+
exports.isLvl3 = isLvl3;
|
|
2211
|
+
exports.isSkill = isSkill;
|
|
2212
|
+
exports.isVirtualMetric = isVirtualMetric;
|
|
2213
|
+
exports.isZerker = isZerker;
|
|
2214
|
+
exports.padNumber = padNumber;
|
|
2215
|
+
exports.parseMetricAbbreviation = parseMetricAbbreviation;
|
|
2216
|
+
exports.parsePeriodExpression = parsePeriodExpression;
|
|
2217
|
+
exports.round = round;
|