@wise-old-man/utils 3.3.1 → 3.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +0 -264
- package/dist/es/index.js +1 -264
- package/dist/es/index.mjs +1 -264
- package/dist/index.d.ts +7 -30
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -423,13 +423,6 @@ class PlayersClient extends BaseAPIClient {
|
|
|
423
423
|
getPlayerGains(username, options) {
|
|
424
424
|
return this.getRequest(`/players/${username}/gained`, options);
|
|
425
425
|
}
|
|
426
|
-
/**
|
|
427
|
-
* Fetches a player's gains, for a specific period or time range, as an array.
|
|
428
|
-
* @returns An array of each metric's gained data.
|
|
429
|
-
*/
|
|
430
|
-
getPlayerGainsAsArray(username, options) {
|
|
431
|
-
return this.getRequest(`/players/${username}/gained`, Object.assign(Object.assign({}, options), { formatting: 'array' }));
|
|
432
|
-
}
|
|
433
426
|
/**
|
|
434
427
|
* Fetches all of the player's records.
|
|
435
428
|
* @returns A list of records.
|
|
@@ -2053,256 +2046,6 @@ function getParentEfficiencyMetric(metric) {
|
|
|
2053
2046
|
return Metric.EHP;
|
|
2054
2047
|
return null;
|
|
2055
2048
|
}
|
|
2056
|
-
function parseMetricAbbreviation(abbreviation) {
|
|
2057
|
-
if (!abbreviation || abbreviation.length === 0) {
|
|
2058
|
-
return null;
|
|
2059
|
-
}
|
|
2060
|
-
const fixedAbbreviation = abbreviation.toLowerCase();
|
|
2061
|
-
if (isMetric(fixedAbbreviation)) {
|
|
2062
|
-
return fixedAbbreviation;
|
|
2063
|
-
}
|
|
2064
|
-
switch (fixedAbbreviation) {
|
|
2065
|
-
// Bosses
|
|
2066
|
-
case 'sire':
|
|
2067
|
-
return Metric.ABYSSAL_SIRE;
|
|
2068
|
-
case 'hydra':
|
|
2069
|
-
return Metric.ALCHEMICAL_HYDRA;
|
|
2070
|
-
case 'barrows':
|
|
2071
|
-
return Metric.BARROWS_CHESTS;
|
|
2072
|
-
case 'bryo':
|
|
2073
|
-
return Metric.BRYOPHYTA;
|
|
2074
|
-
case 'cerb':
|
|
2075
|
-
return Metric.CERBERUS;
|
|
2076
|
-
case 'cox':
|
|
2077
|
-
case 'xeric':
|
|
2078
|
-
case 'chambers':
|
|
2079
|
-
case 'olm':
|
|
2080
|
-
case 'raids':
|
|
2081
|
-
return Metric.CHAMBERS_OF_XERIC;
|
|
2082
|
-
case 'cox-cm':
|
|
2083
|
-
case 'xeric-cm':
|
|
2084
|
-
case 'chambers-cm':
|
|
2085
|
-
case 'olm-cm':
|
|
2086
|
-
case 'raids-cm':
|
|
2087
|
-
return Metric.CHAMBERS_OF_XERIC_CM;
|
|
2088
|
-
case 'chaos-ele':
|
|
2089
|
-
return Metric.CHAOS_ELEMENTAL;
|
|
2090
|
-
case 'fanatic':
|
|
2091
|
-
return Metric.CHAOS_FANATIC;
|
|
2092
|
-
case 'sara':
|
|
2093
|
-
case 'saradomin':
|
|
2094
|
-
case 'zilyana':
|
|
2095
|
-
case 'zily':
|
|
2096
|
-
return Metric.COMMANDER_ZILYANA;
|
|
2097
|
-
case 'corp':
|
|
2098
|
-
return Metric.CORPOREAL_BEAST;
|
|
2099
|
-
case 'crazy-arch':
|
|
2100
|
-
return Metric.CRAZY_ARCHAEOLOGIST;
|
|
2101
|
-
case 'prime':
|
|
2102
|
-
return Metric.DAGANNOTH_PRIME;
|
|
2103
|
-
case 'rex':
|
|
2104
|
-
return Metric.DAGANNOTH_REX;
|
|
2105
|
-
case 'supreme':
|
|
2106
|
-
return Metric.DAGANNOTH_SUPREME;
|
|
2107
|
-
case 'deranged-arch':
|
|
2108
|
-
return Metric.DERANGED_ARCHAEOLOGIST;
|
|
2109
|
-
case 'bandos':
|
|
2110
|
-
case 'graardor':
|
|
2111
|
-
return Metric.GENERAL_GRAARDOR;
|
|
2112
|
-
case 'mole':
|
|
2113
|
-
return Metric.GIANT_MOLE;
|
|
2114
|
-
case 'dusk':
|
|
2115
|
-
case 'dawn':
|
|
2116
|
-
case 'gargs':
|
|
2117
|
-
case 'guardians':
|
|
2118
|
-
case 'ggs':
|
|
2119
|
-
return Metric.GROTESQUE_GUARDIANS;
|
|
2120
|
-
case 'phantom':
|
|
2121
|
-
case 'muspah':
|
|
2122
|
-
return Metric.PHANTOM_MUSPAH;
|
|
2123
|
-
case 'kq':
|
|
2124
|
-
return Metric.KALPHITE_QUEEN;
|
|
2125
|
-
case 'kbd':
|
|
2126
|
-
return Metric.KING_BLACK_DRAGON;
|
|
2127
|
-
case 'kree':
|
|
2128
|
-
case 'kreearra':
|
|
2129
|
-
case 'armadyl':
|
|
2130
|
-
case 'arma':
|
|
2131
|
-
return Metric.KREEARRA;
|
|
2132
|
-
case 'zammy':
|
|
2133
|
-
case 'zamorak':
|
|
2134
|
-
case 'kril':
|
|
2135
|
-
case 'kril-tsutsaroth':
|
|
2136
|
-
return Metric.KRIL_TSUTSAROTH;
|
|
2137
|
-
case 'gaunt':
|
|
2138
|
-
case 'gauntlet':
|
|
2139
|
-
case 'the-gauntlet':
|
|
2140
|
-
return Metric.THE_GAUNTLET;
|
|
2141
|
-
case 'cgaunt':
|
|
2142
|
-
case 'cgauntlet':
|
|
2143
|
-
case 'corrupted':
|
|
2144
|
-
case 'corrupted-gauntlet':
|
|
2145
|
-
case 'the-corrupted-gauntlet':
|
|
2146
|
-
return Metric.THE_CORRUPTED_GAUNTLET;
|
|
2147
|
-
case 'tob':
|
|
2148
|
-
case 'theatre':
|
|
2149
|
-
case 'verzik':
|
|
2150
|
-
case 'tob-normal':
|
|
2151
|
-
return Metric.THEATRE_OF_BLOOD;
|
|
2152
|
-
case 'tob-hm':
|
|
2153
|
-
case 'tob-cm':
|
|
2154
|
-
case 'tob-hard-mode':
|
|
2155
|
-
case 'tob-hard':
|
|
2156
|
-
return Metric.THEATRE_OF_BLOOD_HARD_MODE;
|
|
2157
|
-
case 'toa':
|
|
2158
|
-
case 'tombs':
|
|
2159
|
-
case 'amascut':
|
|
2160
|
-
return Metric.TOMBS_OF_AMASCUT;
|
|
2161
|
-
case 'toa-expert':
|
|
2162
|
-
case 'toa-hm':
|
|
2163
|
-
case 'tombs-expert':
|
|
2164
|
-
case 'tombs-hm':
|
|
2165
|
-
case 'amascut-expert':
|
|
2166
|
-
case 'amascut-hm':
|
|
2167
|
-
return Metric.TOMBS_OF_AMASCUT_EXPERT;
|
|
2168
|
-
case 'nm':
|
|
2169
|
-
case 'tnm':
|
|
2170
|
-
case 'nmare':
|
|
2171
|
-
case 'the-nightmare':
|
|
2172
|
-
return Metric.NIGHTMARE;
|
|
2173
|
-
case 'pnm':
|
|
2174
|
-
case 'phosani':
|
|
2175
|
-
case 'phosanis':
|
|
2176
|
-
case 'phosani-nm':
|
|
2177
|
-
case 'phosani-nightmare':
|
|
2178
|
-
case 'phosanis nightmare':
|
|
2179
|
-
return Metric.PHOSANIS_NIGHTMARE;
|
|
2180
|
-
case 'thermy':
|
|
2181
|
-
case 'smoke-devil':
|
|
2182
|
-
return Metric.THERMONUCLEAR_SMOKE_DEVIL;
|
|
2183
|
-
case 'zuk':
|
|
2184
|
-
case 'inferno':
|
|
2185
|
-
return Metric.TZKAL_ZUK;
|
|
2186
|
-
case 'jad':
|
|
2187
|
-
case 'fight-caves':
|
|
2188
|
-
case 'fc':
|
|
2189
|
-
return Metric.TZTOK_JAD;
|
|
2190
|
-
case 'vork':
|
|
2191
|
-
case 'vorky':
|
|
2192
|
-
return Metric.VORKATH;
|
|
2193
|
-
case 'wt':
|
|
2194
|
-
return Metric.WINTERTODT;
|
|
2195
|
-
case 'snek':
|
|
2196
|
-
case 'zul':
|
|
2197
|
-
return Metric.ZULRAH;
|
|
2198
|
-
// Minigames and others
|
|
2199
|
-
case 'all-clues':
|
|
2200
|
-
case 'clues':
|
|
2201
|
-
return Metric.CLUE_SCROLLS_ALL;
|
|
2202
|
-
case 'beginner':
|
|
2203
|
-
case 'beginner-clues':
|
|
2204
|
-
case 'beg-clues':
|
|
2205
|
-
case 'beginners':
|
|
2206
|
-
return Metric.CLUE_SCROLLS_BEGINNER;
|
|
2207
|
-
case 'easy':
|
|
2208
|
-
case 'easy-clues':
|
|
2209
|
-
case 'easies':
|
|
2210
|
-
return Metric.CLUE_SCROLLS_EASY;
|
|
2211
|
-
case 'medium':
|
|
2212
|
-
case 'med':
|
|
2213
|
-
case 'meds':
|
|
2214
|
-
case 'medium-clues':
|
|
2215
|
-
case 'med-clues':
|
|
2216
|
-
case 'mediums':
|
|
2217
|
-
return Metric.CLUE_SCROLLS_MEDIUM;
|
|
2218
|
-
case 'hard':
|
|
2219
|
-
case 'hard-clues':
|
|
2220
|
-
case 'hards':
|
|
2221
|
-
return Metric.CLUE_SCROLLS_HARD;
|
|
2222
|
-
case 'elite':
|
|
2223
|
-
case 'elite-clues':
|
|
2224
|
-
case 'elites':
|
|
2225
|
-
return Metric.CLUE_SCROLLS_ELITE;
|
|
2226
|
-
case 'master':
|
|
2227
|
-
case 'master-clues':
|
|
2228
|
-
case 'masters':
|
|
2229
|
-
return Metric.CLUE_SCROLLS_MASTER;
|
|
2230
|
-
case 'lms':
|
|
2231
|
-
return Metric.LAST_MAN_STANDING;
|
|
2232
|
-
case 'league':
|
|
2233
|
-
case 'lp':
|
|
2234
|
-
case 'lps':
|
|
2235
|
-
return Metric.LEAGUE_POINTS;
|
|
2236
|
-
case 'sw':
|
|
2237
|
-
case 'zeal':
|
|
2238
|
-
case 'soul-wars':
|
|
2239
|
-
return Metric.SOUL_WARS_ZEAL;
|
|
2240
|
-
case 'rifts-closed':
|
|
2241
|
-
case 'gotr':
|
|
2242
|
-
case 'rifts':
|
|
2243
|
-
return Metric.GUARDIANS_OF_THE_RIFT;
|
|
2244
|
-
// Skills
|
|
2245
|
-
case 'runecraft':
|
|
2246
|
-
case 'rc':
|
|
2247
|
-
return Metric.RUNECRAFTING;
|
|
2248
|
-
case 'att':
|
|
2249
|
-
case 'atk':
|
|
2250
|
-
case 'attk':
|
|
2251
|
-
return Metric.ATTACK;
|
|
2252
|
-
case 'def':
|
|
2253
|
-
case 'defense':
|
|
2254
|
-
return Metric.DEFENCE;
|
|
2255
|
-
case 'str':
|
|
2256
|
-
return Metric.STRENGTH;
|
|
2257
|
-
case 'hp':
|
|
2258
|
-
return Metric.HITPOINTS;
|
|
2259
|
-
case 'range':
|
|
2260
|
-
return Metric.RANGED;
|
|
2261
|
-
case 'pray':
|
|
2262
|
-
return Metric.PRAYER;
|
|
2263
|
-
case 'mage':
|
|
2264
|
-
return Metric.MAGIC;
|
|
2265
|
-
case 'cook':
|
|
2266
|
-
return Metric.COOKING;
|
|
2267
|
-
case 'wc':
|
|
2268
|
-
return Metric.WOODCUTTING;
|
|
2269
|
-
case 'fletch':
|
|
2270
|
-
return Metric.FLETCHING;
|
|
2271
|
-
case 'fish':
|
|
2272
|
-
return Metric.FISHING;
|
|
2273
|
-
case 'fm':
|
|
2274
|
-
case 'burning':
|
|
2275
|
-
return Metric.FIREMAKING;
|
|
2276
|
-
case 'craft':
|
|
2277
|
-
return Metric.CRAFTING;
|
|
2278
|
-
case 'sm':
|
|
2279
|
-
case 'smith':
|
|
2280
|
-
return Metric.SMITHING;
|
|
2281
|
-
case 'mine':
|
|
2282
|
-
case 'smash':
|
|
2283
|
-
return Metric.MINING;
|
|
2284
|
-
case 'herb':
|
|
2285
|
-
return Metric.HERBLORE;
|
|
2286
|
-
case 'agi':
|
|
2287
|
-
case 'agil':
|
|
2288
|
-
return Metric.AGILITY;
|
|
2289
|
-
case 'thief':
|
|
2290
|
-
return Metric.THIEVING;
|
|
2291
|
-
case 'slay':
|
|
2292
|
-
return Metric.SLAYER;
|
|
2293
|
-
case 'farm':
|
|
2294
|
-
return Metric.FARMING;
|
|
2295
|
-
case 'hunt':
|
|
2296
|
-
case 'hunting':
|
|
2297
|
-
return Metric.HUNTER;
|
|
2298
|
-
case 'con':
|
|
2299
|
-
case 'cons':
|
|
2300
|
-
case 'const':
|
|
2301
|
-
return Metric.CONSTRUCTION;
|
|
2302
|
-
default:
|
|
2303
|
-
return null;
|
|
2304
|
-
}
|
|
2305
|
-
}
|
|
2306
2049
|
|
|
2307
2050
|
const CUSTOM_PERIOD_REGEX = /(\d+y)?(\d+m)?(\d+w)?(\d+d)?(\d+h)?/;
|
|
2308
2051
|
const PeriodProps = {
|
|
@@ -2455,12 +2198,6 @@ exports.EfficiencyAlgorithmType = void 0;
|
|
|
2455
2198
|
EfficiencyAlgorithmType["F2P_LVL3_IRONMAN"] = "f2p_lvl3_ironman";
|
|
2456
2199
|
})(exports.EfficiencyAlgorithmType || (exports.EfficiencyAlgorithmType = {}));
|
|
2457
2200
|
|
|
2458
|
-
exports.MigrationDataSource = void 0;
|
|
2459
|
-
(function (MigrationDataSource) {
|
|
2460
|
-
MigrationDataSource[MigrationDataSource["TEMPLE_OSRS"] = 0] = "TEMPLE_OSRS";
|
|
2461
|
-
MigrationDataSource[MigrationDataSource["CRYSTAL_MATH_LABS"] = 1] = "CRYSTAL_MATH_LABS";
|
|
2462
|
-
})(exports.MigrationDataSource || (exports.MigrationDataSource = {}));
|
|
2463
|
-
|
|
2464
2201
|
class EfficiencyClient extends BaseAPIClient {
|
|
2465
2202
|
/**
|
|
2466
2203
|
* Fetches the current efficiency leaderboard for a specific efficiency metric, playerType, playerBuild and country.
|
|
@@ -2712,6 +2449,5 @@ exports.isPlayerStatus = isPlayerStatus;
|
|
|
2712
2449
|
exports.isPlayerType = isPlayerType;
|
|
2713
2450
|
exports.isSkill = isSkill;
|
|
2714
2451
|
exports.padNumber = padNumber;
|
|
2715
|
-
exports.parseMetricAbbreviation = parseMetricAbbreviation;
|
|
2716
2452
|
exports.parsePeriodExpression = parsePeriodExpression;
|
|
2717
2453
|
exports.round = round;
|
package/dist/es/index.js
CHANGED
|
@@ -421,13 +421,6 @@ class PlayersClient extends BaseAPIClient {
|
|
|
421
421
|
getPlayerGains(username, options) {
|
|
422
422
|
return this.getRequest(`/players/${username}/gained`, options);
|
|
423
423
|
}
|
|
424
|
-
/**
|
|
425
|
-
* Fetches a player's gains, for a specific period or time range, as an array.
|
|
426
|
-
* @returns An array of each metric's gained data.
|
|
427
|
-
*/
|
|
428
|
-
getPlayerGainsAsArray(username, options) {
|
|
429
|
-
return this.getRequest(`/players/${username}/gained`, Object.assign(Object.assign({}, options), { formatting: 'array' }));
|
|
430
|
-
}
|
|
431
424
|
/**
|
|
432
425
|
* Fetches all of the player's records.
|
|
433
426
|
* @returns A list of records.
|
|
@@ -2051,256 +2044,6 @@ function getParentEfficiencyMetric(metric) {
|
|
|
2051
2044
|
return Metric.EHP;
|
|
2052
2045
|
return null;
|
|
2053
2046
|
}
|
|
2054
|
-
function parseMetricAbbreviation(abbreviation) {
|
|
2055
|
-
if (!abbreviation || abbreviation.length === 0) {
|
|
2056
|
-
return null;
|
|
2057
|
-
}
|
|
2058
|
-
const fixedAbbreviation = abbreviation.toLowerCase();
|
|
2059
|
-
if (isMetric(fixedAbbreviation)) {
|
|
2060
|
-
return fixedAbbreviation;
|
|
2061
|
-
}
|
|
2062
|
-
switch (fixedAbbreviation) {
|
|
2063
|
-
// Bosses
|
|
2064
|
-
case 'sire':
|
|
2065
|
-
return Metric.ABYSSAL_SIRE;
|
|
2066
|
-
case 'hydra':
|
|
2067
|
-
return Metric.ALCHEMICAL_HYDRA;
|
|
2068
|
-
case 'barrows':
|
|
2069
|
-
return Metric.BARROWS_CHESTS;
|
|
2070
|
-
case 'bryo':
|
|
2071
|
-
return Metric.BRYOPHYTA;
|
|
2072
|
-
case 'cerb':
|
|
2073
|
-
return Metric.CERBERUS;
|
|
2074
|
-
case 'cox':
|
|
2075
|
-
case 'xeric':
|
|
2076
|
-
case 'chambers':
|
|
2077
|
-
case 'olm':
|
|
2078
|
-
case 'raids':
|
|
2079
|
-
return Metric.CHAMBERS_OF_XERIC;
|
|
2080
|
-
case 'cox-cm':
|
|
2081
|
-
case 'xeric-cm':
|
|
2082
|
-
case 'chambers-cm':
|
|
2083
|
-
case 'olm-cm':
|
|
2084
|
-
case 'raids-cm':
|
|
2085
|
-
return Metric.CHAMBERS_OF_XERIC_CM;
|
|
2086
|
-
case 'chaos-ele':
|
|
2087
|
-
return Metric.CHAOS_ELEMENTAL;
|
|
2088
|
-
case 'fanatic':
|
|
2089
|
-
return Metric.CHAOS_FANATIC;
|
|
2090
|
-
case 'sara':
|
|
2091
|
-
case 'saradomin':
|
|
2092
|
-
case 'zilyana':
|
|
2093
|
-
case 'zily':
|
|
2094
|
-
return Metric.COMMANDER_ZILYANA;
|
|
2095
|
-
case 'corp':
|
|
2096
|
-
return Metric.CORPOREAL_BEAST;
|
|
2097
|
-
case 'crazy-arch':
|
|
2098
|
-
return Metric.CRAZY_ARCHAEOLOGIST;
|
|
2099
|
-
case 'prime':
|
|
2100
|
-
return Metric.DAGANNOTH_PRIME;
|
|
2101
|
-
case 'rex':
|
|
2102
|
-
return Metric.DAGANNOTH_REX;
|
|
2103
|
-
case 'supreme':
|
|
2104
|
-
return Metric.DAGANNOTH_SUPREME;
|
|
2105
|
-
case 'deranged-arch':
|
|
2106
|
-
return Metric.DERANGED_ARCHAEOLOGIST;
|
|
2107
|
-
case 'bandos':
|
|
2108
|
-
case 'graardor':
|
|
2109
|
-
return Metric.GENERAL_GRAARDOR;
|
|
2110
|
-
case 'mole':
|
|
2111
|
-
return Metric.GIANT_MOLE;
|
|
2112
|
-
case 'dusk':
|
|
2113
|
-
case 'dawn':
|
|
2114
|
-
case 'gargs':
|
|
2115
|
-
case 'guardians':
|
|
2116
|
-
case 'ggs':
|
|
2117
|
-
return Metric.GROTESQUE_GUARDIANS;
|
|
2118
|
-
case 'phantom':
|
|
2119
|
-
case 'muspah':
|
|
2120
|
-
return Metric.PHANTOM_MUSPAH;
|
|
2121
|
-
case 'kq':
|
|
2122
|
-
return Metric.KALPHITE_QUEEN;
|
|
2123
|
-
case 'kbd':
|
|
2124
|
-
return Metric.KING_BLACK_DRAGON;
|
|
2125
|
-
case 'kree':
|
|
2126
|
-
case 'kreearra':
|
|
2127
|
-
case 'armadyl':
|
|
2128
|
-
case 'arma':
|
|
2129
|
-
return Metric.KREEARRA;
|
|
2130
|
-
case 'zammy':
|
|
2131
|
-
case 'zamorak':
|
|
2132
|
-
case 'kril':
|
|
2133
|
-
case 'kril-tsutsaroth':
|
|
2134
|
-
return Metric.KRIL_TSUTSAROTH;
|
|
2135
|
-
case 'gaunt':
|
|
2136
|
-
case 'gauntlet':
|
|
2137
|
-
case 'the-gauntlet':
|
|
2138
|
-
return Metric.THE_GAUNTLET;
|
|
2139
|
-
case 'cgaunt':
|
|
2140
|
-
case 'cgauntlet':
|
|
2141
|
-
case 'corrupted':
|
|
2142
|
-
case 'corrupted-gauntlet':
|
|
2143
|
-
case 'the-corrupted-gauntlet':
|
|
2144
|
-
return Metric.THE_CORRUPTED_GAUNTLET;
|
|
2145
|
-
case 'tob':
|
|
2146
|
-
case 'theatre':
|
|
2147
|
-
case 'verzik':
|
|
2148
|
-
case 'tob-normal':
|
|
2149
|
-
return Metric.THEATRE_OF_BLOOD;
|
|
2150
|
-
case 'tob-hm':
|
|
2151
|
-
case 'tob-cm':
|
|
2152
|
-
case 'tob-hard-mode':
|
|
2153
|
-
case 'tob-hard':
|
|
2154
|
-
return Metric.THEATRE_OF_BLOOD_HARD_MODE;
|
|
2155
|
-
case 'toa':
|
|
2156
|
-
case 'tombs':
|
|
2157
|
-
case 'amascut':
|
|
2158
|
-
return Metric.TOMBS_OF_AMASCUT;
|
|
2159
|
-
case 'toa-expert':
|
|
2160
|
-
case 'toa-hm':
|
|
2161
|
-
case 'tombs-expert':
|
|
2162
|
-
case 'tombs-hm':
|
|
2163
|
-
case 'amascut-expert':
|
|
2164
|
-
case 'amascut-hm':
|
|
2165
|
-
return Metric.TOMBS_OF_AMASCUT_EXPERT;
|
|
2166
|
-
case 'nm':
|
|
2167
|
-
case 'tnm':
|
|
2168
|
-
case 'nmare':
|
|
2169
|
-
case 'the-nightmare':
|
|
2170
|
-
return Metric.NIGHTMARE;
|
|
2171
|
-
case 'pnm':
|
|
2172
|
-
case 'phosani':
|
|
2173
|
-
case 'phosanis':
|
|
2174
|
-
case 'phosani-nm':
|
|
2175
|
-
case 'phosani-nightmare':
|
|
2176
|
-
case 'phosanis nightmare':
|
|
2177
|
-
return Metric.PHOSANIS_NIGHTMARE;
|
|
2178
|
-
case 'thermy':
|
|
2179
|
-
case 'smoke-devil':
|
|
2180
|
-
return Metric.THERMONUCLEAR_SMOKE_DEVIL;
|
|
2181
|
-
case 'zuk':
|
|
2182
|
-
case 'inferno':
|
|
2183
|
-
return Metric.TZKAL_ZUK;
|
|
2184
|
-
case 'jad':
|
|
2185
|
-
case 'fight-caves':
|
|
2186
|
-
case 'fc':
|
|
2187
|
-
return Metric.TZTOK_JAD;
|
|
2188
|
-
case 'vork':
|
|
2189
|
-
case 'vorky':
|
|
2190
|
-
return Metric.VORKATH;
|
|
2191
|
-
case 'wt':
|
|
2192
|
-
return Metric.WINTERTODT;
|
|
2193
|
-
case 'snek':
|
|
2194
|
-
case 'zul':
|
|
2195
|
-
return Metric.ZULRAH;
|
|
2196
|
-
// Minigames and others
|
|
2197
|
-
case 'all-clues':
|
|
2198
|
-
case 'clues':
|
|
2199
|
-
return Metric.CLUE_SCROLLS_ALL;
|
|
2200
|
-
case 'beginner':
|
|
2201
|
-
case 'beginner-clues':
|
|
2202
|
-
case 'beg-clues':
|
|
2203
|
-
case 'beginners':
|
|
2204
|
-
return Metric.CLUE_SCROLLS_BEGINNER;
|
|
2205
|
-
case 'easy':
|
|
2206
|
-
case 'easy-clues':
|
|
2207
|
-
case 'easies':
|
|
2208
|
-
return Metric.CLUE_SCROLLS_EASY;
|
|
2209
|
-
case 'medium':
|
|
2210
|
-
case 'med':
|
|
2211
|
-
case 'meds':
|
|
2212
|
-
case 'medium-clues':
|
|
2213
|
-
case 'med-clues':
|
|
2214
|
-
case 'mediums':
|
|
2215
|
-
return Metric.CLUE_SCROLLS_MEDIUM;
|
|
2216
|
-
case 'hard':
|
|
2217
|
-
case 'hard-clues':
|
|
2218
|
-
case 'hards':
|
|
2219
|
-
return Metric.CLUE_SCROLLS_HARD;
|
|
2220
|
-
case 'elite':
|
|
2221
|
-
case 'elite-clues':
|
|
2222
|
-
case 'elites':
|
|
2223
|
-
return Metric.CLUE_SCROLLS_ELITE;
|
|
2224
|
-
case 'master':
|
|
2225
|
-
case 'master-clues':
|
|
2226
|
-
case 'masters':
|
|
2227
|
-
return Metric.CLUE_SCROLLS_MASTER;
|
|
2228
|
-
case 'lms':
|
|
2229
|
-
return Metric.LAST_MAN_STANDING;
|
|
2230
|
-
case 'league':
|
|
2231
|
-
case 'lp':
|
|
2232
|
-
case 'lps':
|
|
2233
|
-
return Metric.LEAGUE_POINTS;
|
|
2234
|
-
case 'sw':
|
|
2235
|
-
case 'zeal':
|
|
2236
|
-
case 'soul-wars':
|
|
2237
|
-
return Metric.SOUL_WARS_ZEAL;
|
|
2238
|
-
case 'rifts-closed':
|
|
2239
|
-
case 'gotr':
|
|
2240
|
-
case 'rifts':
|
|
2241
|
-
return Metric.GUARDIANS_OF_THE_RIFT;
|
|
2242
|
-
// Skills
|
|
2243
|
-
case 'runecraft':
|
|
2244
|
-
case 'rc':
|
|
2245
|
-
return Metric.RUNECRAFTING;
|
|
2246
|
-
case 'att':
|
|
2247
|
-
case 'atk':
|
|
2248
|
-
case 'attk':
|
|
2249
|
-
return Metric.ATTACK;
|
|
2250
|
-
case 'def':
|
|
2251
|
-
case 'defense':
|
|
2252
|
-
return Metric.DEFENCE;
|
|
2253
|
-
case 'str':
|
|
2254
|
-
return Metric.STRENGTH;
|
|
2255
|
-
case 'hp':
|
|
2256
|
-
return Metric.HITPOINTS;
|
|
2257
|
-
case 'range':
|
|
2258
|
-
return Metric.RANGED;
|
|
2259
|
-
case 'pray':
|
|
2260
|
-
return Metric.PRAYER;
|
|
2261
|
-
case 'mage':
|
|
2262
|
-
return Metric.MAGIC;
|
|
2263
|
-
case 'cook':
|
|
2264
|
-
return Metric.COOKING;
|
|
2265
|
-
case 'wc':
|
|
2266
|
-
return Metric.WOODCUTTING;
|
|
2267
|
-
case 'fletch':
|
|
2268
|
-
return Metric.FLETCHING;
|
|
2269
|
-
case 'fish':
|
|
2270
|
-
return Metric.FISHING;
|
|
2271
|
-
case 'fm':
|
|
2272
|
-
case 'burning':
|
|
2273
|
-
return Metric.FIREMAKING;
|
|
2274
|
-
case 'craft':
|
|
2275
|
-
return Metric.CRAFTING;
|
|
2276
|
-
case 'sm':
|
|
2277
|
-
case 'smith':
|
|
2278
|
-
return Metric.SMITHING;
|
|
2279
|
-
case 'mine':
|
|
2280
|
-
case 'smash':
|
|
2281
|
-
return Metric.MINING;
|
|
2282
|
-
case 'herb':
|
|
2283
|
-
return Metric.HERBLORE;
|
|
2284
|
-
case 'agi':
|
|
2285
|
-
case 'agil':
|
|
2286
|
-
return Metric.AGILITY;
|
|
2287
|
-
case 'thief':
|
|
2288
|
-
return Metric.THIEVING;
|
|
2289
|
-
case 'slay':
|
|
2290
|
-
return Metric.SLAYER;
|
|
2291
|
-
case 'farm':
|
|
2292
|
-
return Metric.FARMING;
|
|
2293
|
-
case 'hunt':
|
|
2294
|
-
case 'hunting':
|
|
2295
|
-
return Metric.HUNTER;
|
|
2296
|
-
case 'con':
|
|
2297
|
-
case 'cons':
|
|
2298
|
-
case 'const':
|
|
2299
|
-
return Metric.CONSTRUCTION;
|
|
2300
|
-
default:
|
|
2301
|
-
return null;
|
|
2302
|
-
}
|
|
2303
|
-
}
|
|
2304
2047
|
|
|
2305
2048
|
const CUSTOM_PERIOD_REGEX = /(\d+y)?(\d+m)?(\d+w)?(\d+d)?(\d+h)?/;
|
|
2306
2049
|
const PeriodProps = {
|
|
@@ -2453,12 +2196,6 @@ var EfficiencyAlgorithmType;
|
|
|
2453
2196
|
EfficiencyAlgorithmType["F2P_LVL3_IRONMAN"] = "f2p_lvl3_ironman";
|
|
2454
2197
|
})(EfficiencyAlgorithmType || (EfficiencyAlgorithmType = {}));
|
|
2455
2198
|
|
|
2456
|
-
var MigrationDataSource;
|
|
2457
|
-
(function (MigrationDataSource) {
|
|
2458
|
-
MigrationDataSource[MigrationDataSource["TEMPLE_OSRS"] = 0] = "TEMPLE_OSRS";
|
|
2459
|
-
MigrationDataSource[MigrationDataSource["CRYSTAL_MATH_LABS"] = 1] = "CRYSTAL_MATH_LABS";
|
|
2460
|
-
})(MigrationDataSource || (MigrationDataSource = {}));
|
|
2461
|
-
|
|
2462
2199
|
class EfficiencyClient extends BaseAPIClient {
|
|
2463
2200
|
/**
|
|
2464
2201
|
* Fetches the current efficiency leaderboard for a specific efficiency metric, playerType, playerBuild and country.
|
|
@@ -2630,4 +2367,4 @@ class WOMClient extends BaseAPIClient {
|
|
|
2630
2367
|
}
|
|
2631
2368
|
}
|
|
2632
2369
|
|
|
2633
|
-
export { ACTIVITIES, Activity, ActivityType, BOSSES, Boss, CAPPED_MAX_TOTAL_XP, COMBAT_SKILLS, COMPETITION_STATUSES, COMPETITION_TYPES, COMPUTED_METRICS, COUNTRY_CODES, CompetitionCSVTableType, CompetitionStatus, CompetitionStatusProps, CompetitionType, CompetitionTypeProps, ComputedMetric, Country, CountryProps, EfficiencyAlgorithmType, F2P_BOSSES, GROUP_ROLES, GroupRole, GroupRoleProps, MAX_LEVEL, MAX_SKILL_EXP, MAX_VIRTUAL_LEVEL, MEMBER_SKILLS, METRICS, Metric, MetricMeasure, MetricProps, MetricType,
|
|
2370
|
+
export { ACTIVITIES, Activity, ActivityType, BOSSES, Boss, CAPPED_MAX_TOTAL_XP, COMBAT_SKILLS, COMPETITION_STATUSES, COMPETITION_TYPES, COMPUTED_METRICS, COUNTRY_CODES, CompetitionCSVTableType, CompetitionStatus, CompetitionStatusProps, CompetitionType, CompetitionTypeProps, ComputedMetric, Country, CountryProps, EfficiencyAlgorithmType, F2P_BOSSES, GROUP_ROLES, GroupRole, GroupRoleProps, MAX_LEVEL, MAX_SKILL_EXP, MAX_VIRTUAL_LEVEL, MEMBER_SKILLS, METRICS, Metric, MetricMeasure, MetricProps, MetricType, NameChangeStatus, PERIODS, PLAYER_BUILDS, PLAYER_STATUSES, PLAYER_TYPES, PRIVELEGED_GROUP_ROLES, Period, PeriodProps, PlayerBuild, PlayerBuildProps, PlayerStatus, PlayerStatusProps, PlayerType, PlayerTypeProps, REAL_METRICS, REAL_SKILLS, SKILLS, SKILL_EXP_AT_99, Skill, WOMClient, findCountry, findCountryByCode, findCountryByName, findGroupRole, findMetric, findPeriod, findPlayerBuild, findPlayerType, formatNumber, getCombatLevel, getExpForLevel, getLevel, getMetricMeasure, getMetricName, getMetricRankKey, getMetricValueKey, getMinimumValue, getParentEfficiencyMetric, isActivity, isBoss, isCompetitionStatus, isCompetitionType, isComputedMetric, isCountry, isGroupRole, isMetric, isPeriod, isPlayerBuild, isPlayerStatus, isPlayerType, isSkill, padNumber, parsePeriodExpression, round };
|
package/dist/es/index.mjs
CHANGED
|
@@ -421,13 +421,6 @@ class PlayersClient extends BaseAPIClient {
|
|
|
421
421
|
getPlayerGains(username, options) {
|
|
422
422
|
return this.getRequest(`/players/${username}/gained`, options);
|
|
423
423
|
}
|
|
424
|
-
/**
|
|
425
|
-
* Fetches a player's gains, for a specific period or time range, as an array.
|
|
426
|
-
* @returns An array of each metric's gained data.
|
|
427
|
-
*/
|
|
428
|
-
getPlayerGainsAsArray(username, options) {
|
|
429
|
-
return this.getRequest(`/players/${username}/gained`, Object.assign(Object.assign({}, options), { formatting: 'array' }));
|
|
430
|
-
}
|
|
431
424
|
/**
|
|
432
425
|
* Fetches all of the player's records.
|
|
433
426
|
* @returns A list of records.
|
|
@@ -2051,256 +2044,6 @@ function getParentEfficiencyMetric(metric) {
|
|
|
2051
2044
|
return Metric.EHP;
|
|
2052
2045
|
return null;
|
|
2053
2046
|
}
|
|
2054
|
-
function parseMetricAbbreviation(abbreviation) {
|
|
2055
|
-
if (!abbreviation || abbreviation.length === 0) {
|
|
2056
|
-
return null;
|
|
2057
|
-
}
|
|
2058
|
-
const fixedAbbreviation = abbreviation.toLowerCase();
|
|
2059
|
-
if (isMetric(fixedAbbreviation)) {
|
|
2060
|
-
return fixedAbbreviation;
|
|
2061
|
-
}
|
|
2062
|
-
switch (fixedAbbreviation) {
|
|
2063
|
-
// Bosses
|
|
2064
|
-
case 'sire':
|
|
2065
|
-
return Metric.ABYSSAL_SIRE;
|
|
2066
|
-
case 'hydra':
|
|
2067
|
-
return Metric.ALCHEMICAL_HYDRA;
|
|
2068
|
-
case 'barrows':
|
|
2069
|
-
return Metric.BARROWS_CHESTS;
|
|
2070
|
-
case 'bryo':
|
|
2071
|
-
return Metric.BRYOPHYTA;
|
|
2072
|
-
case 'cerb':
|
|
2073
|
-
return Metric.CERBERUS;
|
|
2074
|
-
case 'cox':
|
|
2075
|
-
case 'xeric':
|
|
2076
|
-
case 'chambers':
|
|
2077
|
-
case 'olm':
|
|
2078
|
-
case 'raids':
|
|
2079
|
-
return Metric.CHAMBERS_OF_XERIC;
|
|
2080
|
-
case 'cox-cm':
|
|
2081
|
-
case 'xeric-cm':
|
|
2082
|
-
case 'chambers-cm':
|
|
2083
|
-
case 'olm-cm':
|
|
2084
|
-
case 'raids-cm':
|
|
2085
|
-
return Metric.CHAMBERS_OF_XERIC_CM;
|
|
2086
|
-
case 'chaos-ele':
|
|
2087
|
-
return Metric.CHAOS_ELEMENTAL;
|
|
2088
|
-
case 'fanatic':
|
|
2089
|
-
return Metric.CHAOS_FANATIC;
|
|
2090
|
-
case 'sara':
|
|
2091
|
-
case 'saradomin':
|
|
2092
|
-
case 'zilyana':
|
|
2093
|
-
case 'zily':
|
|
2094
|
-
return Metric.COMMANDER_ZILYANA;
|
|
2095
|
-
case 'corp':
|
|
2096
|
-
return Metric.CORPOREAL_BEAST;
|
|
2097
|
-
case 'crazy-arch':
|
|
2098
|
-
return Metric.CRAZY_ARCHAEOLOGIST;
|
|
2099
|
-
case 'prime':
|
|
2100
|
-
return Metric.DAGANNOTH_PRIME;
|
|
2101
|
-
case 'rex':
|
|
2102
|
-
return Metric.DAGANNOTH_REX;
|
|
2103
|
-
case 'supreme':
|
|
2104
|
-
return Metric.DAGANNOTH_SUPREME;
|
|
2105
|
-
case 'deranged-arch':
|
|
2106
|
-
return Metric.DERANGED_ARCHAEOLOGIST;
|
|
2107
|
-
case 'bandos':
|
|
2108
|
-
case 'graardor':
|
|
2109
|
-
return Metric.GENERAL_GRAARDOR;
|
|
2110
|
-
case 'mole':
|
|
2111
|
-
return Metric.GIANT_MOLE;
|
|
2112
|
-
case 'dusk':
|
|
2113
|
-
case 'dawn':
|
|
2114
|
-
case 'gargs':
|
|
2115
|
-
case 'guardians':
|
|
2116
|
-
case 'ggs':
|
|
2117
|
-
return Metric.GROTESQUE_GUARDIANS;
|
|
2118
|
-
case 'phantom':
|
|
2119
|
-
case 'muspah':
|
|
2120
|
-
return Metric.PHANTOM_MUSPAH;
|
|
2121
|
-
case 'kq':
|
|
2122
|
-
return Metric.KALPHITE_QUEEN;
|
|
2123
|
-
case 'kbd':
|
|
2124
|
-
return Metric.KING_BLACK_DRAGON;
|
|
2125
|
-
case 'kree':
|
|
2126
|
-
case 'kreearra':
|
|
2127
|
-
case 'armadyl':
|
|
2128
|
-
case 'arma':
|
|
2129
|
-
return Metric.KREEARRA;
|
|
2130
|
-
case 'zammy':
|
|
2131
|
-
case 'zamorak':
|
|
2132
|
-
case 'kril':
|
|
2133
|
-
case 'kril-tsutsaroth':
|
|
2134
|
-
return Metric.KRIL_TSUTSAROTH;
|
|
2135
|
-
case 'gaunt':
|
|
2136
|
-
case 'gauntlet':
|
|
2137
|
-
case 'the-gauntlet':
|
|
2138
|
-
return Metric.THE_GAUNTLET;
|
|
2139
|
-
case 'cgaunt':
|
|
2140
|
-
case 'cgauntlet':
|
|
2141
|
-
case 'corrupted':
|
|
2142
|
-
case 'corrupted-gauntlet':
|
|
2143
|
-
case 'the-corrupted-gauntlet':
|
|
2144
|
-
return Metric.THE_CORRUPTED_GAUNTLET;
|
|
2145
|
-
case 'tob':
|
|
2146
|
-
case 'theatre':
|
|
2147
|
-
case 'verzik':
|
|
2148
|
-
case 'tob-normal':
|
|
2149
|
-
return Metric.THEATRE_OF_BLOOD;
|
|
2150
|
-
case 'tob-hm':
|
|
2151
|
-
case 'tob-cm':
|
|
2152
|
-
case 'tob-hard-mode':
|
|
2153
|
-
case 'tob-hard':
|
|
2154
|
-
return Metric.THEATRE_OF_BLOOD_HARD_MODE;
|
|
2155
|
-
case 'toa':
|
|
2156
|
-
case 'tombs':
|
|
2157
|
-
case 'amascut':
|
|
2158
|
-
return Metric.TOMBS_OF_AMASCUT;
|
|
2159
|
-
case 'toa-expert':
|
|
2160
|
-
case 'toa-hm':
|
|
2161
|
-
case 'tombs-expert':
|
|
2162
|
-
case 'tombs-hm':
|
|
2163
|
-
case 'amascut-expert':
|
|
2164
|
-
case 'amascut-hm':
|
|
2165
|
-
return Metric.TOMBS_OF_AMASCUT_EXPERT;
|
|
2166
|
-
case 'nm':
|
|
2167
|
-
case 'tnm':
|
|
2168
|
-
case 'nmare':
|
|
2169
|
-
case 'the-nightmare':
|
|
2170
|
-
return Metric.NIGHTMARE;
|
|
2171
|
-
case 'pnm':
|
|
2172
|
-
case 'phosani':
|
|
2173
|
-
case 'phosanis':
|
|
2174
|
-
case 'phosani-nm':
|
|
2175
|
-
case 'phosani-nightmare':
|
|
2176
|
-
case 'phosanis nightmare':
|
|
2177
|
-
return Metric.PHOSANIS_NIGHTMARE;
|
|
2178
|
-
case 'thermy':
|
|
2179
|
-
case 'smoke-devil':
|
|
2180
|
-
return Metric.THERMONUCLEAR_SMOKE_DEVIL;
|
|
2181
|
-
case 'zuk':
|
|
2182
|
-
case 'inferno':
|
|
2183
|
-
return Metric.TZKAL_ZUK;
|
|
2184
|
-
case 'jad':
|
|
2185
|
-
case 'fight-caves':
|
|
2186
|
-
case 'fc':
|
|
2187
|
-
return Metric.TZTOK_JAD;
|
|
2188
|
-
case 'vork':
|
|
2189
|
-
case 'vorky':
|
|
2190
|
-
return Metric.VORKATH;
|
|
2191
|
-
case 'wt':
|
|
2192
|
-
return Metric.WINTERTODT;
|
|
2193
|
-
case 'snek':
|
|
2194
|
-
case 'zul':
|
|
2195
|
-
return Metric.ZULRAH;
|
|
2196
|
-
// Minigames and others
|
|
2197
|
-
case 'all-clues':
|
|
2198
|
-
case 'clues':
|
|
2199
|
-
return Metric.CLUE_SCROLLS_ALL;
|
|
2200
|
-
case 'beginner':
|
|
2201
|
-
case 'beginner-clues':
|
|
2202
|
-
case 'beg-clues':
|
|
2203
|
-
case 'beginners':
|
|
2204
|
-
return Metric.CLUE_SCROLLS_BEGINNER;
|
|
2205
|
-
case 'easy':
|
|
2206
|
-
case 'easy-clues':
|
|
2207
|
-
case 'easies':
|
|
2208
|
-
return Metric.CLUE_SCROLLS_EASY;
|
|
2209
|
-
case 'medium':
|
|
2210
|
-
case 'med':
|
|
2211
|
-
case 'meds':
|
|
2212
|
-
case 'medium-clues':
|
|
2213
|
-
case 'med-clues':
|
|
2214
|
-
case 'mediums':
|
|
2215
|
-
return Metric.CLUE_SCROLLS_MEDIUM;
|
|
2216
|
-
case 'hard':
|
|
2217
|
-
case 'hard-clues':
|
|
2218
|
-
case 'hards':
|
|
2219
|
-
return Metric.CLUE_SCROLLS_HARD;
|
|
2220
|
-
case 'elite':
|
|
2221
|
-
case 'elite-clues':
|
|
2222
|
-
case 'elites':
|
|
2223
|
-
return Metric.CLUE_SCROLLS_ELITE;
|
|
2224
|
-
case 'master':
|
|
2225
|
-
case 'master-clues':
|
|
2226
|
-
case 'masters':
|
|
2227
|
-
return Metric.CLUE_SCROLLS_MASTER;
|
|
2228
|
-
case 'lms':
|
|
2229
|
-
return Metric.LAST_MAN_STANDING;
|
|
2230
|
-
case 'league':
|
|
2231
|
-
case 'lp':
|
|
2232
|
-
case 'lps':
|
|
2233
|
-
return Metric.LEAGUE_POINTS;
|
|
2234
|
-
case 'sw':
|
|
2235
|
-
case 'zeal':
|
|
2236
|
-
case 'soul-wars':
|
|
2237
|
-
return Metric.SOUL_WARS_ZEAL;
|
|
2238
|
-
case 'rifts-closed':
|
|
2239
|
-
case 'gotr':
|
|
2240
|
-
case 'rifts':
|
|
2241
|
-
return Metric.GUARDIANS_OF_THE_RIFT;
|
|
2242
|
-
// Skills
|
|
2243
|
-
case 'runecraft':
|
|
2244
|
-
case 'rc':
|
|
2245
|
-
return Metric.RUNECRAFTING;
|
|
2246
|
-
case 'att':
|
|
2247
|
-
case 'atk':
|
|
2248
|
-
case 'attk':
|
|
2249
|
-
return Metric.ATTACK;
|
|
2250
|
-
case 'def':
|
|
2251
|
-
case 'defense':
|
|
2252
|
-
return Metric.DEFENCE;
|
|
2253
|
-
case 'str':
|
|
2254
|
-
return Metric.STRENGTH;
|
|
2255
|
-
case 'hp':
|
|
2256
|
-
return Metric.HITPOINTS;
|
|
2257
|
-
case 'range':
|
|
2258
|
-
return Metric.RANGED;
|
|
2259
|
-
case 'pray':
|
|
2260
|
-
return Metric.PRAYER;
|
|
2261
|
-
case 'mage':
|
|
2262
|
-
return Metric.MAGIC;
|
|
2263
|
-
case 'cook':
|
|
2264
|
-
return Metric.COOKING;
|
|
2265
|
-
case 'wc':
|
|
2266
|
-
return Metric.WOODCUTTING;
|
|
2267
|
-
case 'fletch':
|
|
2268
|
-
return Metric.FLETCHING;
|
|
2269
|
-
case 'fish':
|
|
2270
|
-
return Metric.FISHING;
|
|
2271
|
-
case 'fm':
|
|
2272
|
-
case 'burning':
|
|
2273
|
-
return Metric.FIREMAKING;
|
|
2274
|
-
case 'craft':
|
|
2275
|
-
return Metric.CRAFTING;
|
|
2276
|
-
case 'sm':
|
|
2277
|
-
case 'smith':
|
|
2278
|
-
return Metric.SMITHING;
|
|
2279
|
-
case 'mine':
|
|
2280
|
-
case 'smash':
|
|
2281
|
-
return Metric.MINING;
|
|
2282
|
-
case 'herb':
|
|
2283
|
-
return Metric.HERBLORE;
|
|
2284
|
-
case 'agi':
|
|
2285
|
-
case 'agil':
|
|
2286
|
-
return Metric.AGILITY;
|
|
2287
|
-
case 'thief':
|
|
2288
|
-
return Metric.THIEVING;
|
|
2289
|
-
case 'slay':
|
|
2290
|
-
return Metric.SLAYER;
|
|
2291
|
-
case 'farm':
|
|
2292
|
-
return Metric.FARMING;
|
|
2293
|
-
case 'hunt':
|
|
2294
|
-
case 'hunting':
|
|
2295
|
-
return Metric.HUNTER;
|
|
2296
|
-
case 'con':
|
|
2297
|
-
case 'cons':
|
|
2298
|
-
case 'const':
|
|
2299
|
-
return Metric.CONSTRUCTION;
|
|
2300
|
-
default:
|
|
2301
|
-
return null;
|
|
2302
|
-
}
|
|
2303
|
-
}
|
|
2304
2047
|
|
|
2305
2048
|
const CUSTOM_PERIOD_REGEX = /(\d+y)?(\d+m)?(\d+w)?(\d+d)?(\d+h)?/;
|
|
2306
2049
|
const PeriodProps = {
|
|
@@ -2453,12 +2196,6 @@ var EfficiencyAlgorithmType;
|
|
|
2453
2196
|
EfficiencyAlgorithmType["F2P_LVL3_IRONMAN"] = "f2p_lvl3_ironman";
|
|
2454
2197
|
})(EfficiencyAlgorithmType || (EfficiencyAlgorithmType = {}));
|
|
2455
2198
|
|
|
2456
|
-
var MigrationDataSource;
|
|
2457
|
-
(function (MigrationDataSource) {
|
|
2458
|
-
MigrationDataSource[MigrationDataSource["TEMPLE_OSRS"] = 0] = "TEMPLE_OSRS";
|
|
2459
|
-
MigrationDataSource[MigrationDataSource["CRYSTAL_MATH_LABS"] = 1] = "CRYSTAL_MATH_LABS";
|
|
2460
|
-
})(MigrationDataSource || (MigrationDataSource = {}));
|
|
2461
|
-
|
|
2462
2199
|
class EfficiencyClient extends BaseAPIClient {
|
|
2463
2200
|
/**
|
|
2464
2201
|
* Fetches the current efficiency leaderboard for a specific efficiency metric, playerType, playerBuild and country.
|
|
@@ -2630,4 +2367,4 @@ class WOMClient extends BaseAPIClient {
|
|
|
2630
2367
|
}
|
|
2631
2368
|
}
|
|
2632
2369
|
|
|
2633
|
-
export { ACTIVITIES, Activity, ActivityType, BOSSES, Boss, CAPPED_MAX_TOTAL_XP, COMBAT_SKILLS, COMPETITION_STATUSES, COMPETITION_TYPES, COMPUTED_METRICS, COUNTRY_CODES, CompetitionCSVTableType, CompetitionStatus, CompetitionStatusProps, CompetitionType, CompetitionTypeProps, ComputedMetric, Country, CountryProps, EfficiencyAlgorithmType, F2P_BOSSES, GROUP_ROLES, GroupRole, GroupRoleProps, MAX_LEVEL, MAX_SKILL_EXP, MAX_VIRTUAL_LEVEL, MEMBER_SKILLS, METRICS, Metric, MetricMeasure, MetricProps, MetricType,
|
|
2370
|
+
export { ACTIVITIES, Activity, ActivityType, BOSSES, Boss, CAPPED_MAX_TOTAL_XP, COMBAT_SKILLS, COMPETITION_STATUSES, COMPETITION_TYPES, COMPUTED_METRICS, COUNTRY_CODES, CompetitionCSVTableType, CompetitionStatus, CompetitionStatusProps, CompetitionType, CompetitionTypeProps, ComputedMetric, Country, CountryProps, EfficiencyAlgorithmType, F2P_BOSSES, GROUP_ROLES, GroupRole, GroupRoleProps, MAX_LEVEL, MAX_SKILL_EXP, MAX_VIRTUAL_LEVEL, MEMBER_SKILLS, METRICS, Metric, MetricMeasure, MetricProps, MetricType, NameChangeStatus, PERIODS, PLAYER_BUILDS, PLAYER_STATUSES, PLAYER_TYPES, PRIVELEGED_GROUP_ROLES, Period, PeriodProps, PlayerBuild, PlayerBuildProps, PlayerStatus, PlayerStatusProps, PlayerType, PlayerTypeProps, REAL_METRICS, REAL_SKILLS, SKILLS, SKILL_EXP_AT_99, Skill, WOMClient, findCountry, findCountryByCode, findCountryByName, findGroupRole, findMetric, findPeriod, findPlayerBuild, findPlayerType, formatNumber, getCombatLevel, getExpForLevel, getLevel, getMetricMeasure, getMetricName, getMetricRankKey, getMetricValueKey, getMinimumValue, getParentEfficiencyMetric, isActivity, isBoss, isCompetitionStatus, isCompetitionType, isComputedMetric, isCountry, isGroupRole, isMetric, isPeriod, isPlayerBuild, isPlayerStatus, isPlayerType, isSkill, padNumber, parsePeriodExpression, round };
|
package/dist/index.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ export type Group = {
|
|
|
57
57
|
homeworld: number | null;
|
|
58
58
|
verified: boolean;
|
|
59
59
|
patron: boolean;
|
|
60
|
+
visible: boolean;
|
|
60
61
|
profileImage: string | null;
|
|
61
62
|
bannerImage: string | null;
|
|
62
63
|
score: number;
|
|
@@ -89,6 +90,7 @@ type Competition = {
|
|
|
89
90
|
endsAt: Date;
|
|
90
91
|
groupId: number | null;
|
|
91
92
|
score: number;
|
|
93
|
+
visible: boolean;
|
|
92
94
|
verificationHash: string;
|
|
93
95
|
createdAt: Date | null;
|
|
94
96
|
updatedAt: Date | null;
|
|
@@ -1245,12 +1247,6 @@ interface ComputedMetricDelta {
|
|
|
1245
1247
|
rank: MeasuredDeltaProgress;
|
|
1246
1248
|
value: MeasuredDeltaProgress;
|
|
1247
1249
|
}
|
|
1248
|
-
interface PlayerDeltasArray {
|
|
1249
|
-
skills: Array<SkillDelta>;
|
|
1250
|
-
bosses: Array<BossDelta>;
|
|
1251
|
-
activities: Array<ActivityDelta>;
|
|
1252
|
-
computed: Array<ComputedMetricDelta>;
|
|
1253
|
-
}
|
|
1254
1250
|
interface PlayerDeltasMap {
|
|
1255
1251
|
skills: MapOf<Skill, SkillDelta>;
|
|
1256
1252
|
bosses: MapOf<Boss, BossDelta>;
|
|
@@ -1376,19 +1372,6 @@ interface GroupStatistics {
|
|
|
1376
1372
|
averageStats: FormattedSnapshot;
|
|
1377
1373
|
metricLeaders: MetricLeaders;
|
|
1378
1374
|
}
|
|
1379
|
-
declare enum MigrationDataSource {
|
|
1380
|
-
TEMPLE_OSRS = 0,
|
|
1381
|
-
CRYSTAL_MATH_LABS = 1
|
|
1382
|
-
}
|
|
1383
|
-
interface CMLGroupData {
|
|
1384
|
-
name: string;
|
|
1385
|
-
members: string[];
|
|
1386
|
-
}
|
|
1387
|
-
interface TempleGroupData {
|
|
1388
|
-
name: string;
|
|
1389
|
-
members: string[];
|
|
1390
|
-
leaders: string[];
|
|
1391
|
-
}
|
|
1392
1375
|
type MemberRoleChangeEvent = Omit<MemberActivity, 'createdAt'>;
|
|
1393
1376
|
type MemberJoinedEvent = Omit<MemberActivity, 'createdAt' | 'previousRole'>;
|
|
1394
1377
|
type MemberLeftEvent = Omit<MemberActivity, 'createdAt' | 'previousRole'>;
|
|
@@ -1763,7 +1746,6 @@ declare function getMetricMeasure(metric: Metric): MetricMeasure;
|
|
|
1763
1746
|
declare function getMetricName(metric: Metric): string;
|
|
1764
1747
|
declare function getMinimumValue(metric: Metric): number;
|
|
1765
1748
|
declare function getParentEfficiencyMetric(metric: Metric): "ehp" | "ehb";
|
|
1766
|
-
declare function parseMetricAbbreviation(abbreviation: string): Metric | null;
|
|
1767
1749
|
|
|
1768
1750
|
type PeriodPropsMap = MapOf<Period, {
|
|
1769
1751
|
name: string;
|
|
@@ -1919,11 +1901,11 @@ interface AssertPlayerTypeResponse {
|
|
|
1919
1901
|
player: Player;
|
|
1920
1902
|
changed: boolean;
|
|
1921
1903
|
}
|
|
1922
|
-
|
|
1904
|
+
interface GetPlayerGainsResponse {
|
|
1923
1905
|
startsAt: Date;
|
|
1924
1906
|
endsAt: Date;
|
|
1925
|
-
data:
|
|
1926
|
-
}
|
|
1907
|
+
data: PlayerDeltasMap;
|
|
1908
|
+
}
|
|
1927
1909
|
/**
|
|
1928
1910
|
* Efficiency Client Types
|
|
1929
1911
|
*/
|
|
@@ -2111,12 +2093,7 @@ declare class PlayersClient extends BaseAPIClient {
|
|
|
2111
2093
|
* Fetches a player's gains, for a specific period or time range, as a [metric: data] map.
|
|
2112
2094
|
* @returns A map of each metric's gained data.
|
|
2113
2095
|
*/
|
|
2114
|
-
getPlayerGains(username: string, options: TimeRangeFilter): Promise<GetPlayerGainsResponse
|
|
2115
|
-
/**
|
|
2116
|
-
* Fetches a player's gains, for a specific period or time range, as an array.
|
|
2117
|
-
* @returns An array of each metric's gained data.
|
|
2118
|
-
*/
|
|
2119
|
-
getPlayerGainsAsArray(username: string, options: TimeRangeFilter): Promise<GetPlayerGainsResponse<PlayerDeltasArray>>;
|
|
2096
|
+
getPlayerGains(username: string, options: TimeRangeFilter): Promise<GetPlayerGainsResponse>;
|
|
2120
2097
|
/**
|
|
2121
2098
|
* Fetches all of the player's records.
|
|
2122
2099
|
* @returns A list of records.
|
|
@@ -2267,4 +2244,4 @@ declare class WOMClient extends BaseAPIClient {
|
|
|
2267
2244
|
constructor(options?: WOMClientOptions);
|
|
2268
2245
|
}
|
|
2269
2246
|
|
|
2270
|
-
export { ACTIVITIES, type Achievement, type AchievementDefinition, type AchievementProgress, type AchievementTemplate, Activity, type ActivityDelta, ActivityType, type ActivityValue, type AssertPlayerTypeResponse, BOSSES, type Bonus, Boss, type BossDelta, type BossMetaConfig, type BossValue, CAPPED_MAX_TOTAL_XP,
|
|
2247
|
+
export { ACTIVITIES, type Achievement, type AchievementDefinition, type AchievementProgress, type AchievementTemplate, Activity, type ActivityDelta, ActivityType, type ActivityValue, type AssertPlayerTypeResponse, BOSSES, type Bonus, Boss, type BossDelta, type BossMetaConfig, type BossValue, CAPPED_MAX_TOTAL_XP, COMBAT_SKILLS, COMPETITION_STATUSES, COMPETITION_TYPES, COMPUTED_METRICS, COUNTRY_CODES, type ChangeMemberRolePayload, CompetitionCSVTableType, type CompetitionDetails, type CompetitionDetailsCSVParams, type CompetitionListItem, CompetitionStatus, CompetitionStatusProps, CompetitionType, CompetitionTypeProps, type CompetitionWithParticipations, type CompetitionsSearchFilter, ComputedMetric, type ComputedMetricDelta, type ComputedMetricValue, Country, type CountryDetails, CountryProps, type CreateCompetitionPayload, type CreateCompetitionResponse, type CreateGroupPayload, type CreateGroupResponse, type DeltaGroupLeaderboardEntry, type DeltaLeaderboardEntry, type DeltaLeaderboardFilter, type DenyContext, type EditCompetitionPayload, type EditGroupPayload, EfficiencyAlgorithmType, type EfficiencyAlgorithmTypeUnion, type EfficiencyLeaderboardsFilter, type ExtendedAchievement, type ExtendedAchievementWithPlayer, F2P_BOSSES, type FlaggedPlayerReviewContext, type FormattedSnapshot, GROUP_ROLES, type GenericCountMessageResponse, type GenericMessageResponse, type GetGroupGainsFilter, type GetPlayerGainsResponse, type GroupDetails, type GroupHiscoresActivityItem, type GroupHiscoresBossItem, type GroupHiscoresComputedMetricItem, type GroupHiscoresEntry, type GroupHiscoresSkillItem, type GroupListItem, type GroupMemberFragment, type GroupRecordsFilter, GroupRole, GroupRoleProps, type GroupStatistics, MAX_LEVEL, MAX_SKILL_EXP, MAX_VIRTUAL_LEVEL, MEMBER_SKILLS, METRICS, type MapOf, type MeasuredDeltaProgress, type MemberActivityWithPlayer, type MemberInput, type MemberJoinedEvent, type MemberLeftEvent, type MemberRoleChangeEvent, type MembershipWithGroup, type MembershipWithPlayer, Metric, type MetricLeaders, MetricMeasure, MetricProps, MetricType, type MetricValueKey, type NameChange, type NameChangeDetails, NameChangeStatus, type NameChangeWithPlayer, type NameChangesSearchFilter, PERIODS, PLAYER_BUILDS, PLAYER_STATUSES, PLAYER_TYPES, PRIVELEGED_GROUP_ROLES, type ParticipationWithCompetition, type ParticipationWithCompetitionAndStandings, type ParticipationWithPlayer, type ParticipationWithPlayerAndProgress, Period, PeriodProps, type Player, type PlayerArchiveWithPlayer, PlayerBuild, PlayerBuildProps, type PlayerCompetitionStandingsFilter, type PlayerCompetitionsFilter, type PlayerDeltasMap, type PlayerDetails, type PlayerRecordsFilter, PlayerStatus, PlayerStatusProps, PlayerType, PlayerTypeProps, REAL_METRICS, REAL_SKILLS, type Record, type RecordLeaderboardEntry, type RecordLeaderboardFilter, SKILLS, SKILL_EXP_AT_99, Skill, type SkillDelta, type SkillMetaConfig, type SkillMetaMethod, type SkillValue, type SkipContext, type Snapshot, type SnapshotFragment, type Team, type TimeRangeFilter, type Top5ProgressResult, WOMClient, findCountry, findCountryByCode, findCountryByName, findGroupRole, findMetric, findPeriod, findPlayerBuild, findPlayerType, formatNumber, getCombatLevel, getExpForLevel, getLevel, getMetricMeasure, getMetricName, getMetricRankKey, getMetricValueKey, getMinimumValue, getParentEfficiencyMetric, isActivity, isBoss, isCompetitionStatus, isCompetitionType, isComputedMetric, isCountry, isGroupRole, isMetric, isPeriod, isPlayerBuild, isPlayerStatus, isPlayerType, isSkill, padNumber, parsePeriodExpression, round };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise-old-man/utils",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.3",
|
|
4
4
|
"description": "A JavaScript/TypeScript client that interfaces and consumes the Wise Old Man API, an API that tracks and measures players' progress in Old School Runescape.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wiseoldman",
|