@wise-old-man/utils 3.1.10 → 3.1.12

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 CHANGED
@@ -19,6 +19,15 @@ export type MemberActivity = {
19
19
  createdAt: Date;
20
20
  };
21
21
 
22
+ export type PlayerArchive = {
23
+ playerId: number;
24
+ previousUsername: string;
25
+ archiveUsername: string;
26
+ restoredUsername: string | null;
27
+ createdAt: Date;
28
+ restoredAt: Date | null;
29
+ };
30
+
22
31
  type Prisma_Base_GroupSocialLinks = {
23
32
  id: number;
24
33
  groupId: number;
@@ -1514,6 +1523,7 @@ declare type NameChangeWithPlayer = NameChange & {
1514
1523
 
1515
1524
  interface PlayerDetails extends Player {
1516
1525
  combatLevel: number;
1526
+ archive?: PlayerArchive;
1517
1527
  latestSnapshot: FormattedSnapshot;
1518
1528
  }
1519
1529
  interface FlaggedPlayerReviewContext {
@@ -1533,6 +1543,9 @@ interface FlaggedPlayerReviewContext {
1533
1543
  rejectedRank: number;
1534
1544
  };
1535
1545
  }
1546
+ declare type PlayerArchiveWithPlayer = PlayerArchive & {
1547
+ player: Player;
1548
+ };
1536
1549
 
1537
1550
  declare type RecordLeaderboardEntry = Record & {
1538
1551
  player: Player;
@@ -2130,6 +2143,11 @@ declare class PlayersClient extends BaseAPIClient {
2130
2143
  * @returns A list of name changes.
2131
2144
  */
2132
2145
  getPlayerNames(username: string): Promise<NameChange[]>;
2146
+ /**
2147
+ * Fetches all of archived players that previously held this username.
2148
+ * @returns A list of player archives.
2149
+ */
2150
+ getPlayerArchives(username: string): Promise<PlayerArchiveWithPlayer[]>;
2133
2151
  }
2134
2152
 
2135
2153
  declare class RecordsClient extends BaseAPIClient {
@@ -2251,4 +2269,4 @@ declare class WOMClient extends BaseAPIClient {
2251
2269
  constructor(options?: WOMClientOptions);
2252
2270
  }
2253
2271
 
2254
- export { ACTIVITIES, Achievement, AchievementDefinition, AchievementProgress, AchievementTemplate, Activity, ActivityDelta, ActivityType, ActivityValue, ActivityValueWithPlayer, 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, CompetitionCSVTableType, CompetitionDetails, CompetitionDetailsCSVParams, CompetitionListItem, CompetitionStatus, CompetitionStatusProps, CompetitionType, CompetitionTypeProps, CompetitionWithParticipations, CompetitionsSearchFilter, ComputedMetric, ComputedMetricDelta, ComputedMetricValue, ComputedMetricValueWithPlayer, Country, CountryDetails, CountryProps, CreateCompetitionPayload, CreateCompetitionResponse, CreateGroupPayload, CreateGroupResponse, DeltaGroupLeaderboardEntry, 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, MemberActivityWithPlayer, MemberInput, MemberJoinedEvent, MemberLeftEvent, MemberRoleChangeEvent, MembershipWithGroup, MembershipWithPlayer, Metric, MetricLeaders, MetricMeasure, MetricProps, MetricType, MetricValueKey, MigrationDataSource, NameChange, NameChangeDetails, NameChangeStatus, NameChangeWithPlayer, 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_METRICS, 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 };
2272
+ export { ACTIVITIES, Achievement, AchievementDefinition, AchievementProgress, AchievementTemplate, Activity, ActivityDelta, ActivityType, ActivityValue, ActivityValueWithPlayer, 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, CompetitionCSVTableType, CompetitionDetails, CompetitionDetailsCSVParams, CompetitionListItem, CompetitionStatus, CompetitionStatusProps, CompetitionType, CompetitionTypeProps, CompetitionWithParticipations, CompetitionsSearchFilter, ComputedMetric, ComputedMetricDelta, ComputedMetricValue, ComputedMetricValueWithPlayer, Country, CountryDetails, CountryProps, CreateCompetitionPayload, CreateCompetitionResponse, CreateGroupPayload, CreateGroupResponse, DeltaGroupLeaderboardEntry, 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, MemberActivityWithPlayer, MemberInput, MemberJoinedEvent, MemberLeftEvent, MemberRoleChangeEvent, MembershipWithGroup, MembershipWithPlayer, Metric, MetricLeaders, MetricMeasure, MetricProps, MetricType, MetricValueKey, MigrationDataSource, NameChange, NameChangeDetails, NameChangeStatus, NameChangeWithPlayer, NameChangesSearchFilter, PERIODS, PLAYER_BUILDS, PLAYER_STATUSES, PLAYER_TYPES, PRIVELEGED_GROUP_ROLES, ParticipationWithCompetition, ParticipationWithCompetitionAndStandings, ParticipationWithPlayer, ParticipationWithPlayerAndProgress, Period, PeriodProps, Player, PlayerArchiveWithPlayer, PlayerBuild, PlayerBuildProps, PlayerCompetitionStandingsFilter, PlayerCompetitionsFilter, PlayerDeltasArray, PlayerDeltasMap, PlayerDetails, PlayerRecordsFilter, PlayerStatus, PlayerStatusProps, PlayerType, PlayerTypeProps, REAL_METRICS, 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
@@ -463,6 +463,13 @@ class PlayersClient extends BaseAPIClient {
463
463
  getPlayerNames(username) {
464
464
  return this.getRequest(`/players/${username}/names`);
465
465
  }
466
+ /**
467
+ * Fetches all of archived players that previously held this username.
468
+ * @returns A list of player archives.
469
+ */
470
+ getPlayerArchives(username) {
471
+ return this.getRequest(`/players/${username}/archives`);
472
+ }
466
473
  }
467
474
 
468
475
  class RecordsClient extends BaseAPIClient {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise-old-man/utils",
3
- "version": "3.1.10",
3
+ "version": "3.1.12",
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",