@wise-old-man/utils 2.1.6 → 2.1.7

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
@@ -176,6 +176,7 @@ export type Prisma_Base_Player = {
176
176
  displayName: string
177
177
  type: PlayerType
178
178
  build: PlayerBuild
179
+ status: PlayerStatus
179
180
  country: Country | null
180
181
  flagged: boolean
181
182
  exp: bigint
@@ -191,6 +192,14 @@ export type Prisma_Base_Player = {
191
192
  }
192
193
 
193
194
 
195
+ export type PlayerArchive = {
196
+ playerId: number
197
+ previousUsername: string
198
+ archiveUsername: string
199
+ createdAt: Date
200
+ }
201
+
202
+
194
203
  export type Prisma_Base_Record = {
195
204
  id: number
196
205
  playerId: number
@@ -665,6 +674,13 @@ declare const PlayerBuild: {
665
674
  readonly HP10: "hp10";
666
675
  };
667
676
  declare type PlayerBuild = typeof PlayerBuild[keyof typeof PlayerBuild];
677
+ declare const PlayerStatus: {
678
+ readonly ACTIVE: "active";
679
+ readonly UNRANKED: "unranked";
680
+ readonly FLAGGED: "flagged";
681
+ readonly ARCHIVED: "archived";
682
+ };
683
+ declare type PlayerStatus = typeof PlayerStatus[keyof typeof PlayerStatus];
668
684
  declare const CompetitionType: {
669
685
  readonly CLASSIC: "classic";
670
686
  readonly TEAM: "team";
@@ -1510,6 +1526,23 @@ interface PlayerDetails extends Player {
1510
1526
  combatLevel: number;
1511
1527
  latestSnapshot: FormattedSnapshot;
1512
1528
  }
1529
+ interface FlaggedPlayerReviewContext {
1530
+ previous: FormattedSnapshot;
1531
+ rejected: FormattedSnapshot;
1532
+ negativeGains: boolean;
1533
+ excessiveGains: boolean;
1534
+ possibleRollback: boolean;
1535
+ excessiveGainsReversed: boolean;
1536
+ data: {
1537
+ stackableGainedRatio: number;
1538
+ previousEHP: number;
1539
+ previousEHB: number;
1540
+ previousRank: number;
1541
+ rejectedEHP: number;
1542
+ rejectedEHB: number;
1543
+ rejectedRank: number;
1544
+ };
1545
+ }
1513
1546
 
1514
1547
  declare type RecordLeaderboardEntry = Record & {
1515
1548
  player: Player;
@@ -1738,10 +1771,15 @@ declare const PlayerTypeProps: MapOf<PlayerType, {
1738
1771
  declare const PlayerBuildProps: MapOf<PlayerBuild, {
1739
1772
  name: string;
1740
1773
  }>;
1774
+ declare const PlayerStatusProps: MapOf<PlayerStatus, {
1775
+ name: string;
1776
+ }>;
1741
1777
  declare const PLAYER_TYPES: ("unknown" | "regular" | "ironman" | "hardcore" | "ultimate" | "fresh_start")[];
1742
1778
  declare const PLAYER_BUILDS: ("main" | "f2p" | "lvl3" | "zerker" | "def1" | "hp10")[];
1779
+ declare const PLAYER_STATUSES: ("active" | "unranked" | "flagged" | "archived")[];
1743
1780
  declare function isPlayerType(typeString: string): typeString is PlayerType;
1744
1781
  declare function isPlayerBuild(buildString: string): buildString is PlayerBuild;
1782
+ declare function isPlayerStatus(statusString: string): statusString is PlayerStatus;
1745
1783
  declare function findPlayerType(typeName: string): PlayerType | null;
1746
1784
  declare function findPlayerBuild(buildName: string): PlayerBuild | null;
1747
1785
 
@@ -2176,4 +2214,4 @@ declare class WOMClient {
2176
2214
  constructor(options?: WOMClientOptions);
2177
2215
  }
2178
2216
 
2179
- 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, 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_TYPES, PRIVELEGED_GROUP_ROLES, ParticipationWithCompetition, ParticipationWithCompetitionAndStandings, ParticipationWithPlayer, ParticipationWithPlayerAndProgress, Period, PeriodProps, Player, PlayerBuild, PlayerBuildProps, PlayerCompetitionStandingsFilter, PlayerCompetitionsFilter, PlayerDeltasArray, PlayerDeltasMap, PlayerDetails, PlayerRecordsFilter, 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, isPlayerType, isSkill, padNumber, parseMetricAbbreviation, parsePeriodExpression, round };
2217
+ 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 };
package/dist/index.js CHANGED
@@ -596,6 +596,12 @@ const PlayerBuild = {
596
596
  DEF1: 'def1',
597
597
  HP10: 'hp10'
598
598
  };
599
+ const PlayerStatus = {
600
+ ACTIVE: 'active',
601
+ UNRANKED: 'unranked',
602
+ FLAGGED: 'flagged',
603
+ ARCHIVED: 'archived'
604
+ };
599
605
  const CompetitionType = {
600
606
  CLASSIC: 'classic',
601
607
  TEAM: 'team'
@@ -2261,14 +2267,24 @@ const PlayerBuildProps = {
2261
2267
  [PlayerBuild.DEF1]: { name: '1 Defence Pure' },
2262
2268
  [PlayerBuild.HP10]: { name: '10 Hitpoints Pure' }
2263
2269
  };
2270
+ const PlayerStatusProps = {
2271
+ [PlayerStatus.ACTIVE]: { name: 'Active' },
2272
+ [PlayerStatus.UNRANKED]: { name: 'Unranked' },
2273
+ [PlayerStatus.FLAGGED]: { name: 'Flagged' },
2274
+ [PlayerStatus.ARCHIVED]: { name: 'Archived' }
2275
+ };
2264
2276
  const PLAYER_TYPES = Object.values(PlayerType);
2265
2277
  const PLAYER_BUILDS = Object.values(PlayerBuild);
2278
+ const PLAYER_STATUSES = Object.values(PlayerStatus);
2266
2279
  function isPlayerType(typeString) {
2267
2280
  return typeString in PlayerTypeProps;
2268
2281
  }
2269
2282
  function isPlayerBuild(buildString) {
2270
2283
  return buildString in PlayerBuildProps;
2271
2284
  }
2285
+ function isPlayerStatus(statusString) {
2286
+ return statusString in PlayerStatusProps;
2287
+ }
2272
2288
  function findPlayerType(typeName) {
2273
2289
  for (const [key, value] of Object.entries(PlayerTypeProps)) {
2274
2290
  if (value.name.toUpperCase() === typeName.toUpperCase())
@@ -2548,12 +2564,15 @@ exports.MetricProps = MetricProps;
2548
2564
  exports.NameChangeStatus = NameChangeStatus;
2549
2565
  exports.PERIODS = PERIODS;
2550
2566
  exports.PLAYER_BUILDS = PLAYER_BUILDS;
2567
+ exports.PLAYER_STATUSES = PLAYER_STATUSES;
2551
2568
  exports.PLAYER_TYPES = PLAYER_TYPES;
2552
2569
  exports.PRIVELEGED_GROUP_ROLES = PRIVELEGED_GROUP_ROLES;
2553
2570
  exports.Period = Period;
2554
2571
  exports.PeriodProps = PeriodProps;
2555
2572
  exports.PlayerBuild = PlayerBuild;
2556
2573
  exports.PlayerBuildProps = PlayerBuildProps;
2574
+ exports.PlayerStatus = PlayerStatus;
2575
+ exports.PlayerStatusProps = PlayerStatusProps;
2557
2576
  exports.PlayerType = PlayerType;
2558
2577
  exports.PlayerTypeProps = PlayerTypeProps;
2559
2578
  exports.REAL_SKILLS = REAL_SKILLS;
@@ -2589,6 +2608,7 @@ exports.isGroupRole = isGroupRole;
2589
2608
  exports.isMetric = isMetric;
2590
2609
  exports.isPeriod = isPeriod;
2591
2610
  exports.isPlayerBuild = isPlayerBuild;
2611
+ exports.isPlayerStatus = isPlayerStatus;
2592
2612
  exports.isPlayerType = isPlayerType;
2593
2613
  exports.isSkill = isSkill;
2594
2614
  exports.padNumber = padNumber;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise-old-man/utils",
3
- "version": "2.1.6",
3
+ "version": "2.1.7",
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",