@wise-old-man/utils 2.1.14 → 2.1.16
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 +1 -8
- 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
|
@@ -1873,7 +1873,7 @@ const BossProps = lodash.mapValues({
|
|
|
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 : 10 })));
|
|
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.16",
|
|
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",
|