@wise-old-man/utils 2.1.15 → 2.1.17
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/index.d.ts +36 -12
- package/dist/index.js +8 -15
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type Prisma_Base_Achievement = {
|
|
2
2
|
playerId: number
|
|
3
3
|
name: string
|
|
4
4
|
metric: Metric
|
|
@@ -23,7 +23,7 @@ export type Competition = {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
type Prisma_Base_Delta = {
|
|
27
27
|
id: number
|
|
28
28
|
playerId: number
|
|
29
29
|
period: Period
|
|
@@ -150,12 +150,13 @@ export type Membership = {
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
type Prisma_Base_NameChange = {
|
|
154
154
|
id: number
|
|
155
155
|
playerId: number
|
|
156
156
|
oldName: string
|
|
157
157
|
newName: string
|
|
158
158
|
status: NameChangeStatus
|
|
159
|
+
reviewContext: unknown | null
|
|
159
160
|
resolvedAt: Date | null
|
|
160
161
|
updatedAt: Date
|
|
161
162
|
createdAt: Date
|
|
@@ -173,7 +174,7 @@ export type Participation = {
|
|
|
173
174
|
}
|
|
174
175
|
|
|
175
176
|
|
|
176
|
-
|
|
177
|
+
type Prisma_Base_Player = {
|
|
177
178
|
id: number
|
|
178
179
|
username: string
|
|
179
180
|
displayName: string
|
|
@@ -202,7 +203,7 @@ export type PlayerArchive = {
|
|
|
202
203
|
}
|
|
203
204
|
|
|
204
205
|
|
|
205
|
-
|
|
206
|
+
type Prisma_Base_Record = {
|
|
206
207
|
id: number
|
|
207
208
|
playerId: number
|
|
208
209
|
period: Period
|
|
@@ -212,7 +213,7 @@ export type Prisma_Base_Record = {
|
|
|
212
213
|
}
|
|
213
214
|
|
|
214
215
|
|
|
215
|
-
|
|
216
|
+
type Prisma_Base_Snapshot = {
|
|
216
217
|
id: number
|
|
217
218
|
playerId: number
|
|
218
219
|
importedAt: Date | null
|
|
@@ -1237,6 +1238,9 @@ declare type Snapshot = Omit<Prisma_Base_Snapshot, 'overallExperience'> & {
|
|
|
1237
1238
|
declare type Player = Omit<Prisma_Base_Player, 'exp' | 'latestSnapshotId'> & {
|
|
1238
1239
|
exp: number;
|
|
1239
1240
|
};
|
|
1241
|
+
declare type NameChange = Omit<Prisma_Base_NameChange, 'reviewContext'> & {
|
|
1242
|
+
reviewContext: SkipContext | DenyContext | null;
|
|
1243
|
+
};
|
|
1240
1244
|
|
|
1241
1245
|
interface AchievementTemplate {
|
|
1242
1246
|
name: string;
|
|
@@ -1519,6 +1523,30 @@ interface EfficiencyAlgorithm {
|
|
|
1519
1523
|
}
|
|
1520
1524
|
declare type AlgorithmCache = MapOf<EfficiencyAlgorithmType, EfficiencyAlgorithm>;
|
|
1521
1525
|
|
|
1526
|
+
declare type DenyContext = {
|
|
1527
|
+
reason: 'manual_review';
|
|
1528
|
+
} | {
|
|
1529
|
+
reason: 'old_stats_cannot_be_found';
|
|
1530
|
+
} | {
|
|
1531
|
+
reason: 'new_name_not_on_the_hiscores';
|
|
1532
|
+
} | {
|
|
1533
|
+
reason: 'negative_gains';
|
|
1534
|
+
negativeGains: MapOf<Metric, number>;
|
|
1535
|
+
};
|
|
1536
|
+
declare type SkipContext = {
|
|
1537
|
+
reason: 'transition_period_too_long';
|
|
1538
|
+
maxHoursDiff: number;
|
|
1539
|
+
hoursDiff: number;
|
|
1540
|
+
} | {
|
|
1541
|
+
reason: 'excessive_gains';
|
|
1542
|
+
ehpDiff: number;
|
|
1543
|
+
ehbDiff: number;
|
|
1544
|
+
hoursDiff: number;
|
|
1545
|
+
} | {
|
|
1546
|
+
reason: 'total_level_too_low';
|
|
1547
|
+
minTotalLevel: number;
|
|
1548
|
+
totalLevel: number;
|
|
1549
|
+
};
|
|
1522
1550
|
declare type NameChangeDetails = {
|
|
1523
1551
|
nameChange: NameChange;
|
|
1524
1552
|
data?: {
|
|
@@ -1526,6 +1554,7 @@ declare type NameChangeDetails = {
|
|
|
1526
1554
|
isOldOnHiscores: boolean;
|
|
1527
1555
|
isNewTracked: boolean;
|
|
1528
1556
|
hasNegativeGains: boolean;
|
|
1557
|
+
negativeGains: MapOf<Metric, number> | null;
|
|
1529
1558
|
timeDiff: number;
|
|
1530
1559
|
hoursDiff: number;
|
|
1531
1560
|
ehpDiff: number;
|
|
@@ -2148,11 +2177,6 @@ declare class NameChangesClient extends BaseAPIClient {
|
|
|
2148
2177
|
* @returns A pending name change request, to be reviewed and resolved at a later date.
|
|
2149
2178
|
*/
|
|
2150
2179
|
submitNameChange(oldName: string, newName: string): Promise<NameChange>;
|
|
2151
|
-
/**
|
|
2152
|
-
* Gets details on a specific name change request.
|
|
2153
|
-
* @returns The name change request's details, which includes all data required to review.
|
|
2154
|
-
*/
|
|
2155
|
-
getNameChangeDetails(id: number): Promise<NameChangeDetails>;
|
|
2156
2180
|
}
|
|
2157
2181
|
|
|
2158
2182
|
declare class CompetitionsClient extends BaseAPIClient {
|
|
@@ -2230,4 +2254,4 @@ declare class WOMClient {
|
|
|
2230
2254
|
constructor(options?: WOMClientOptions);
|
|
2231
2255
|
}
|
|
2232
2256
|
|
|
2233
|
-
export { ACTIVITIES, Achievement, AchievementDefinition, AchievementProgress, AchievementTemplate, Activity, ActivityDelta, ActivityValue, ActivityValueWithPlayer, AlgorithmCache, AssertPlayerTypeResponse, BOSSES, Bonus, BonusType, Boss, BossDelta, BossMetaConfig, BossValue, BossValueWithPlayer, CAPPED_MAX_TOTAL_XP, CMLGroupData, COMBAT_SKILLS, COMPETITION_STATUSES, COMPETITION_TYPES, COMPUTED_METRICS, COUNTRY_CODES, ChangeMemberRolePayload, CompetitionDetails, CompetitionListItem, CompetitionStatus, CompetitionStatusProps, CompetitionType, CompetitionTypeProps, CompetitionWithParticipations, CompetitionsSearchFilter, ComputedMetric, ComputedMetricDelta, ComputedMetricValue, ComputedMetricValueWithPlayer, Country, CountryDetails, CountryProps, CreateCompetitionPayload, CreateCompetitionResponse, CreateGroupPayload, CreateGroupResponse, DeltaLeaderboardEntry, DeltaLeaderboardFilter, EditCompetitionPayload, EditGroupPayload, EfficiencyAlgorithm, EfficiencyAlgorithmType, EfficiencyAlgorithmTypeUnion, EfficiencyLeaderboardsFilter, EfficiencyMap, ExperienceMap, ExtendedAchievement, ExtendedAchievementWithPlayer, F2P_BOSSES, FlaggedPlayerReviewContext, FormattedSnapshot, GROUP_ROLES, GenericCountMessageResponse, GenericMessageResponse, GetGroupGainsFilter, GetPlayerGainsResponse, GroupDetails, GroupHiscoresActivityItem, GroupHiscoresBossItem, GroupHiscoresComputedMetricItem, GroupHiscoresEntry, GroupHiscoresSkillItem, GroupListItem, GroupMemberFragment, GroupRecordsFilter, GroupRole, GroupRoleProps, GroupStatistics, KillcountMap, MAX_LEVEL, MAX_SKILL_EXP, MAX_VIRTUAL_LEVEL, MEMBER_SKILLS, METRICS, MapOf, MeasuredDeltaProgress, MemberInput, MembershipWithGroup, MembershipWithPlayer, Metric, MetricLeaders, MetricMeasure, MetricProps, MetricType, MetricValueKey, MigrationDataSource, NameChangeDetails, NameChangeStatus, NameChangesSearchFilter, PERIODS, PLAYER_BUILDS, PLAYER_STATUSES, PLAYER_TYPES, PRIVELEGED_GROUP_ROLES, ParticipationWithCompetition, ParticipationWithCompetitionAndStandings, ParticipationWithPlayer, ParticipationWithPlayerAndProgress, Period, PeriodProps, Player, PlayerBuild, PlayerBuildProps, PlayerCompetitionStandingsFilter, PlayerCompetitionsFilter, PlayerDeltasArray, PlayerDeltasMap, PlayerDetails, PlayerRecordsFilter, PlayerStatus, PlayerStatusProps, PlayerType, PlayerTypeProps, REAL_SKILLS, Record, RecordLeaderboardEntry, RecordLeaderboardFilter, SKILLS, SKILL_EXP_AT_99, Skill, SkillDelta, SkillMetaConfig, SkillMetaMethod, SkillValue, SkillValueWithPlayer, Snapshot, SnapshotDataSource, SnapshotFragment, Team, TempleGroupData, TimeRangeFilter, 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, parseMetricAbbreviation, parsePeriodExpression, round };
|
|
2257
|
+
export { ACTIVITIES, Achievement, AchievementDefinition, AchievementProgress, AchievementTemplate, Activity, ActivityDelta, ActivityValue, ActivityValueWithPlayer, AlgorithmCache, AssertPlayerTypeResponse, BOSSES, Bonus, BonusType, Boss, BossDelta, BossMetaConfig, BossValue, BossValueWithPlayer, CAPPED_MAX_TOTAL_XP, CMLGroupData, COMBAT_SKILLS, COMPETITION_STATUSES, COMPETITION_TYPES, COMPUTED_METRICS, COUNTRY_CODES, ChangeMemberRolePayload, CompetitionDetails, CompetitionListItem, CompetitionStatus, CompetitionStatusProps, CompetitionType, CompetitionTypeProps, CompetitionWithParticipations, CompetitionsSearchFilter, ComputedMetric, ComputedMetricDelta, ComputedMetricValue, ComputedMetricValueWithPlayer, Country, CountryDetails, CountryProps, CreateCompetitionPayload, CreateCompetitionResponse, CreateGroupPayload, CreateGroupResponse, DeltaLeaderboardEntry, DeltaLeaderboardFilter, DenyContext, EditCompetitionPayload, EditGroupPayload, EfficiencyAlgorithm, EfficiencyAlgorithmType, EfficiencyAlgorithmTypeUnion, EfficiencyLeaderboardsFilter, EfficiencyMap, ExperienceMap, ExtendedAchievement, ExtendedAchievementWithPlayer, F2P_BOSSES, FlaggedPlayerReviewContext, FormattedSnapshot, GROUP_ROLES, GenericCountMessageResponse, GenericMessageResponse, GetGroupGainsFilter, GetPlayerGainsResponse, GroupDetails, GroupHiscoresActivityItem, GroupHiscoresBossItem, GroupHiscoresComputedMetricItem, GroupHiscoresEntry, GroupHiscoresSkillItem, GroupListItem, GroupMemberFragment, GroupRecordsFilter, GroupRole, GroupRoleProps, GroupStatistics, KillcountMap, MAX_LEVEL, MAX_SKILL_EXP, MAX_VIRTUAL_LEVEL, MEMBER_SKILLS, METRICS, MapOf, MeasuredDeltaProgress, MemberInput, MembershipWithGroup, MembershipWithPlayer, Metric, MetricLeaders, MetricMeasure, MetricProps, MetricType, MetricValueKey, MigrationDataSource, NameChange, NameChangeDetails, NameChangeStatus, NameChangesSearchFilter, PERIODS, PLAYER_BUILDS, PLAYER_STATUSES, PLAYER_TYPES, PRIVELEGED_GROUP_ROLES, ParticipationWithCompetition, ParticipationWithCompetitionAndStandings, ParticipationWithPlayer, ParticipationWithPlayerAndProgress, Period, PeriodProps, Player, PlayerBuild, PlayerBuildProps, PlayerCompetitionStandingsFilter, PlayerCompetitionsFilter, PlayerDeltasArray, PlayerDeltasMap, PlayerDetails, PlayerRecordsFilter, PlayerStatus, PlayerStatusProps, PlayerType, PlayerTypeProps, REAL_SKILLS, Record, RecordLeaderboardEntry, RecordLeaderboardFilter, SKILLS, SKILL_EXP_AT_99, Skill, SkillDelta, SkillMetaConfig, SkillMetaMethod, SkillValue, SkillValueWithPlayer, SkipContext, Snapshot, SnapshotDataSource, SnapshotFragment, Team, TempleGroupData, TimeRangeFilter, 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, parseMetricAbbreviation, parsePeriodExpression, round };
|
package/dist/index.js
CHANGED
|
@@ -1823,12 +1823,12 @@ const BossProps = lodash.mapValues({
|
|
|
1823
1823
|
[Boss.ALCHEMICAL_HYDRA]: { name: 'Alchemical Hydra' },
|
|
1824
1824
|
[Boss.ARTIO]: { name: 'Artio' },
|
|
1825
1825
|
[Boss.BARROWS_CHESTS]: { name: 'Barrows Chests' },
|
|
1826
|
-
[Boss.BRYOPHYTA]: { name: 'Bryophyta',
|
|
1826
|
+
[Boss.BRYOPHYTA]: { name: 'Bryophyta', isMembers: false },
|
|
1827
1827
|
[Boss.CALLISTO]: { name: 'Callisto' },
|
|
1828
1828
|
[Boss.CALVARION]: { name: "Calvar'ion" },
|
|
1829
1829
|
[Boss.CERBERUS]: { name: 'Cerberus' },
|
|
1830
1830
|
[Boss.CHAMBERS_OF_XERIC]: { name: 'Chambers Of Xeric' },
|
|
1831
|
-
[Boss.CHAMBERS_OF_XERIC_CM]: { name: 'Chambers Of Xeric (CM)'
|
|
1831
|
+
[Boss.CHAMBERS_OF_XERIC_CM]: { name: 'Chambers Of Xeric (CM)' },
|
|
1832
1832
|
[Boss.CHAOS_ELEMENTAL]: { name: 'Chaos Elemental' },
|
|
1833
1833
|
[Boss.CHAOS_FANATIC]: { name: 'Chaos Fanatic' },
|
|
1834
1834
|
[Boss.COMMANDER_ZILYANA]: { name: 'Commander Zilyana' },
|
|
@@ -1841,7 +1841,7 @@ const BossProps = lodash.mapValues({
|
|
|
1841
1841
|
[Boss.GENERAL_GRAARDOR]: { name: 'General Graardor' },
|
|
1842
1842
|
[Boss.GIANT_MOLE]: { name: 'Giant Mole' },
|
|
1843
1843
|
[Boss.GROTESQUE_GUARDIANS]: { name: 'Grotesque Guardians' },
|
|
1844
|
-
[Boss.HESPORI]: { name: 'Hespori'
|
|
1844
|
+
[Boss.HESPORI]: { name: 'Hespori' },
|
|
1845
1845
|
[Boss.KALPHITE_QUEEN]: { name: 'Kalphite Queen' },
|
|
1846
1846
|
[Boss.KING_BLACK_DRAGON]: { name: 'King Black Dragon' },
|
|
1847
1847
|
[Boss.KRAKEN]: { name: 'Kraken' },
|
|
@@ -1851,29 +1851,29 @@ const BossProps = lodash.mapValues({
|
|
|
1851
1851
|
[Boss.NEX]: { name: 'Nex' },
|
|
1852
1852
|
[Boss.NIGHTMARE]: { name: 'Nightmare' },
|
|
1853
1853
|
[Boss.PHOSANIS_NIGHTMARE]: { name: "Phosani's Nightmare" },
|
|
1854
|
-
[Boss.OBOR]: { name: 'Obor',
|
|
1854
|
+
[Boss.OBOR]: { name: 'Obor', isMembers: false },
|
|
1855
1855
|
[Boss.PHANTOM_MUSPAH]: { name: 'Phantom Muspah' },
|
|
1856
1856
|
[Boss.SARACHNIS]: { name: 'Sarachnis' },
|
|
1857
1857
|
[Boss.SCORPIA]: { name: 'Scorpia' },
|
|
1858
|
-
[Boss.SKOTIZO]: { name: 'Skotizo'
|
|
1858
|
+
[Boss.SKOTIZO]: { name: 'Skotizo' },
|
|
1859
1859
|
[Boss.SPINDEL]: { name: 'Spindel' },
|
|
1860
1860
|
[Boss.TEMPOROSS]: { name: 'Tempoross' },
|
|
1861
1861
|
[Boss.THE_GAUNTLET]: { name: 'The Gauntlet' },
|
|
1862
|
-
[Boss.THE_CORRUPTED_GAUNTLET]: { name: 'The Corrupted Gauntlet'
|
|
1862
|
+
[Boss.THE_CORRUPTED_GAUNTLET]: { name: 'The Corrupted Gauntlet' },
|
|
1863
1863
|
[Boss.THEATRE_OF_BLOOD]: { name: 'Theatre Of Blood' },
|
|
1864
1864
|
[Boss.THEATRE_OF_BLOOD_HARD_MODE]: { name: 'Theatre Of Blood (HM)' },
|
|
1865
1865
|
[Boss.THERMONUCLEAR_SMOKE_DEVIL]: { name: 'Thermonuclear Smoke Devil' },
|
|
1866
1866
|
[Boss.TOMBS_OF_AMASCUT]: { name: 'Tombs of Amascut' },
|
|
1867
1867
|
[Boss.TOMBS_OF_AMASCUT_EXPERT]: { name: 'Tombs of Amascut (Expert Mode)' },
|
|
1868
1868
|
[Boss.TZKAL_ZUK]: { name: 'TzKal-Zuk', minimumValue: 1 },
|
|
1869
|
-
[Boss.TZTOK_JAD]: { name: 'TzTok-Jad'
|
|
1869
|
+
[Boss.TZTOK_JAD]: { name: 'TzTok-Jad' },
|
|
1870
1870
|
[Boss.VENENATIS]: { name: 'Venenatis' },
|
|
1871
1871
|
[Boss.VETION]: { name: "Vet'ion" },
|
|
1872
1872
|
[Boss.VORKATH]: { name: 'Vorkath' },
|
|
1873
1873
|
[Boss.WINTERTODT]: { name: 'Wintertodt' },
|
|
1874
1874
|
[Boss.ZALCANO]: { name: 'Zalcano' },
|
|
1875
1875
|
[Boss.ZULRAH]: { name: 'Zulrah' }
|
|
1876
|
-
}, props => (Object.assign(Object.assign({}, props), { type: exports.MetricType.BOSS, measure: exports.MetricMeasure.KILLS, isMembers: 'isMembers' in props ? props.isMembers : true, minimumValue: 'minimumValue' in props ? props.minimumValue :
|
|
1876
|
+
}, props => (Object.assign(Object.assign({}, props), { type: exports.MetricType.BOSS, measure: exports.MetricMeasure.KILLS, isMembers: 'isMembers' in props ? props.isMembers : true, minimumValue: 'minimumValue' in props ? props.minimumValue : 5 })));
|
|
1877
1877
|
const ActivityProps = lodash.mapValues({
|
|
1878
1878
|
[Activity.LEAGUE_POINTS]: { name: 'League Points' },
|
|
1879
1879
|
[Activity.BOUNTY_HUNTER_HUNTER]: { name: 'Bounty Hunter (Hunter)' },
|
|
@@ -2413,13 +2413,6 @@ class NameChangesClient extends BaseAPIClient {
|
|
|
2413
2413
|
submitNameChange(oldName, newName) {
|
|
2414
2414
|
return this.postRequest('/names', { oldName, newName });
|
|
2415
2415
|
}
|
|
2416
|
-
/**
|
|
2417
|
-
* Gets details on a specific name change request.
|
|
2418
|
-
* @returns The name change request's details, which includes all data required to review.
|
|
2419
|
-
*/
|
|
2420
|
-
getNameChangeDetails(id) {
|
|
2421
|
-
return this.getRequest(`/names/${id}`);
|
|
2422
|
-
}
|
|
2423
2416
|
}
|
|
2424
2417
|
|
|
2425
2418
|
class CompetitionsClient extends BaseAPIClient {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise-old-man/utils",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.17",
|
|
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",
|