Skip to content
This repository has been archived by the owner on Oct 27, 2024. It is now read-only.

Commit

Permalink
add a few more tested players and fix everything
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-1 committed Mar 27, 2022
1 parent 77bcd34 commit 59fd065
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 33 deletions.
110 changes: 98 additions & 12 deletions src/responses/player.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
export interface Tourneys {
// we have to do this because typescript literals are greedy and games with underscores would fail
[key: `${string}_${number}` | `${string}_${string}_${number}` | `${string}_${string}_${string}_${number}`]: {
games_played?: number
playtime?: number
tributes_earned?: number
first_win?: number
first_game?: number
claimed_ranking_reward?: number
seenRPbook?: boolean
}
first_join_lobby?: number
total_tributes?: number
shop_sort?: 'oldest'
hide_purchased?: boolean
}

export interface PlayerDataResponse {
success: true
player: {
_id: string
achievementsOneTime: string[]
clock?: boolean
displayname: string
firstLogin: string
eulaCoins?: boolean
firstLogin: number
friendRequests?: string[]
knownAliases: string[]
knownAliasesLower: string[]
lastLogin: number
lastLogin?: number
networkExp: number
playername: string
stats: Record<string, any> & {
Expand All @@ -24,12 +44,20 @@ export interface PlayerDataResponse {
dailyTwoKExp: number
}
quests: Record<string, any>
testPass?: boolean
mostRecentlyTippedUuid?: string
vanityFavorites?: string
currentEmote?: string
achievements: Record<string, number>
transformation?: string
housingMeta: Record<string, any>
voting: Record<string, number>
mcVersionRp: string
rewardConsumed?: boolean
vanityConvertedBoxToday?: number
vanityFirstConvertedBox?: number
[key: `${string}Cooldowns`]: Record<string, boolean>
cooldowns?: Record<string, Record<string, number>>
karma: number
petConsumables: Record<string, number>,
[key: `levelingReward_${number}`]: boolean
Expand All @@ -41,47 +69,95 @@ export interface PlayerDataResponse {
timeTook: number
}[]>
lastAdsenseGenerateTime: number
lastLogout: number
lastClaimedReward?: number
lastLogout?: number
friendRequestsUuid: any[]
channel?: 'ALL'

collectibles_menu_sort?: string
onetime_achievement_menu_sort_completion_sort?: string
easter2021Cooldowns2?: Record<string, boolean>
anniversaryNPCVisited2021?: number[]
anniversaryNPCProgress2021?: number

packageRank?: string
newPackageRank?: string
monthlyPackageRank?: 'NONE' | string
mostRecentMonthlyPackageRank?: 'SUPERSTAR' | undefined
rank?: string
prefix?: string

[key: `levelup_${string}`]: number
currentPet?: string
network_update_book: number
petJourneyTimestamp?: number
network_update_book: string
totalRewards: number
totalDailyRewards: number
rewardStreak: number
rewardScore: number
rewardHighScore: number
petStats?: Record<string, any>
achievementRewardsNew: Record<`for_points_${number}00`, number>
onetime_achievement_menu_sort?: string
achievementTracking: any[]
adsense_tokens?: number
language?: string
flashingSalePopup?: number
flashingSalePoppedUp?: number
flashingSaleOpens?: number
flashingSaleClicks?: number
giftingMeta?: {
realBundlesReceived: 197,
bundlesReceived: 197,
giftsGiven: 629,
bundlesGiven: 127,
realBundlesGiven: 127,
milestones: string[]
}
fortuneBuff?: number
SANTA_QUEST_STARTED?: boolean
SANTA_FINISHED?: boolean
socialMedia?: {
prompt: boolean
YOUTUBE: string
links: {
DISCORD: string
HYPIXEL: string
DISCORD?: string
HYPIXEL?: string
TWITCH?: string
TWITTER?: string
/**
* Make sure to also check socialMedia.YOUTUBE
*/
YOUTUBE?: string
INSTAGRAM?: string
}
/**
* This was replaced with links.YOUTUBE, but this field is sometimes still used
*/
YOUTUBE: string
/**
* This was replaced with links.TWITTER, but this field is sometimes still used
*/
TWITTER: string
/**
* This was replaced with links.DISCORD, but this field is sometimes still used
*/
DISCORD: string

}
guildNotifications?: boolean
challenges: Record<string, Record<string, number>>
spec_always_flying?: boolean
userLanguage: string
monthlyRankColor?: 'AQUA'
achievementSync: Record<string, number>
parkourCheckpointBests: Record<string, number[]>
tiered_achievement_menu_sort?: string
parkourCheckpointBests: Record<string, Record<number, number>>
achievementPoints: number
battlePassGlowStatus?: boolean
monthlycrates: Record<`${number}-${number}`, Record<string, boolean>>
tourney?: Record<string, number | Record<string, { games_played: number }>>
tourney?: Tourneys
gifts_grinch?: number
snowball_fight_intro_2019?: number
snowball_fight_intro_2019?: boolean
achievementTotem?: any
main2017Tutorial?: boolean
[key: `levelUp_${string}`]: number
Expand All @@ -91,9 +167,19 @@ export interface PlayerDataResponse {
}
claimed_potato_talisman?: number
skyblock_free_cookie?: number
[key: `adventRewards${number}`]: Record<`day${number}`, number>
[key: `scorpius_bribe_${number}`]: number
disabledProjectileTrails?: boolean
currentClickEffect?: string
seasonal?: Record<string, Record<number, {
adventRewards?: Record<`day${number}`, number>
presents?: Record<string, true>
}>>
[key: `completed_christmas_quests_${number}`]: number
currentGadget?: string
claimed_century_cake?: number
[key: `adventRewards${number}` | `adventRewards_v2_${number}`]: Record<`day${number}`, number>
claimed_year143_cake?: number
mostRecentGameType: string
mostRecentGameType?: string
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/responses/skyblock/_profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ export interface SkyBlockProfile {
community_upgrades?: SkyBlockCommunityUpgrades
last_save?: string
banking?: SkyBlockBanking
game_mode?: 'bingo'
game_mode?: 'bingo' | 'island'
}
52 changes: 32 additions & 20 deletions src/responses/skyblock/_profile_member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export interface SkyBlockObjective {
completed_at: number
}

export interface SkyBlockActiveEffect {
export interface SkyBlockPotionEffect {
effect: string
level: number
modifiers: {
Expand Down Expand Up @@ -113,18 +113,18 @@ export interface SkyBlockCrystalStatus {
}

export interface SkyBlockProfileMember {
last_save: number
inv_armor: Inventory
last_save?: number
inv_armor?: Inventory
coop_invitation?: {
timestamp: number
/**
* The undashed UUID of the coop member who invited this member
*/
invited_by: string
confirmed: boolean
confirmed_timestamp: number
confirmed_timestamp?: number
}
first_join: number
first_join?: number
first_join_hub?: number
stats: Record<string, number>
objectives: Record<string, SkyBlockObjective> & ({
Expand All @@ -133,19 +133,19 @@ export interface SkyBlockProfileMember {
GOLD_INGOT: boolean
}
})
tutorial: string[]
tutorial?: string[]
quests: Record<string, {
status: 'ACTIVE' | 'COMPLETE'
activated_at: number
activated_at_sb: number
completed_at: number
completed_at_sb: number
}>
coin_purse: number
coin_purse?: number
last_death: number
crafted_generators?: string[]
visited_zones?: string[]
fairy_souls_collected: number
fairy_souls_collected?: number
fairy_souls?: number
fairy_exchanges?: number
fishing_treasure_caught?: number
Expand All @@ -159,14 +159,14 @@ export interface SkyBlockProfileMember {
tier: number
start_timestamp: number
completion_state: number
combat_xp: number
recent_mob_kills: {
combat_xp?: number
recent_mob_kills?: {
xp: number
timestamp: number
}[]
last_killed_mob_island: string
xp_on_last_follower_spawn: number
spawn_timestamp: number
last_killed_mob_island?: string
xp_on_last_follower_spawn?: number
spawn_timestamp?: number
kill_timestamp?: number
}
slayer_bosses?: Partial<Record<SkyBlockSlayerBosses, {
Expand Down Expand Up @@ -222,7 +222,7 @@ export interface SkyBlockProfileMember {
}
}
griffin?: {
burrows: {
burrows?: {
ts: number
x: number
y: number
Expand Down Expand Up @@ -258,15 +258,15 @@ export interface SkyBlockProfileMember {
}
perks?: {}
harp_quest?: {
selected_song: string
selected_song_epoch: number
selected_song?: string
selected_song_epoch?: number
claimed_talisman?: true
} & Record<`song_${string}_best_completion`, number>
& Record<`song_${string}_completions`, number>
& Record<`song_${string}_perfect_completions`, number>
fastest_target_practice?: number
active_effects: SkyBlockActiveEffect[]
paused_effects?: []
active_effects?: SkyBlockPotionEffect[]
paused_effects?: SkyBlockPotionEffect[]
disabled_potion_effects?: string[]
visited_modes?: string[]
temp_stat_buffs?: {
Expand All @@ -283,6 +283,11 @@ export interface SkyBlockProfileMember {
powder_mithril_total?: number
experience?: number
retroactive_tier2_token?: boolean

current_daily_effect?: string
/** This isn't a timestamp, but I don't know what it is */
current_daily_effect_last_changed?: number

tokens_spent?: number
powder_spent_mithril?: number
crystals?: Record<`${string}_crystal`, SkyBlockCrystalStatus | {}>
Expand All @@ -300,13 +305,20 @@ export interface SkyBlockProfileMember {
}
selected_pickaxe_ability?: string | null
last_reset?: number

daily_ores_mined_day_mithril_ore?: number
daily_ores_mined_mithril_ore?: number
powder_gemstone?: number
powder_gemstone_total?: number

daily_ores_mined_day_gemstone?: number
daily_ores_mined_gemstone?: number

powder_gemstone?: number
powder_gemstone_total?: number

powder_spent_gemstone?: number

daily_ores_mined_day?: number
daily_ores_mined?: number
}
forge?: {
forge_processes: {
Expand Down
18 changes: 18 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,24 @@ await testData('SkyBlockProfilesResponse', await request('skyblock/profiles', {
uuid: '26398ec782e5440cbcbb94c58b8b60a2',
key: process.env.API_KEY
}, true))
await testData('SkyBlockProfilesResponse', await request('skyblock/profiles', {
uuid: '16751f79c0b14e53a0b590d31fc1d80d',
key: process.env.API_KEY
}, true))
await testData('SkyBlockProfilesResponse', await request('skyblock/profiles', {
uuid: '974b2a9e0d6d41819dd18a05fb228965',
key: process.env.API_KEY
}, true))

await testData('SkyBlockProfileResponse', await request('skyblock/profile', {
profile: '64722047f9b34e69b67b76a62351eb05',
key: process.env.API_KEY
}, true))

await testData('PlayerDataResponse', await request('player', {
uuid: '16751f79c0b14e53a0b590d31fc1d80d',
key: process.env.API_KEY
}, true))

console.log('Passed :)')

0 comments on commit 59fd065

Please sign in to comment.