From 59fd065c54eb4a3c0fb7129b8c7ee4c16ad07322 Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 27 Mar 2022 11:48:04 -0500 Subject: [PATCH] add a few more tested players and fix everything --- src/responses/player.ts | 110 +++++++++++++++++++--- src/responses/skyblock/_profile.ts | 2 +- src/responses/skyblock/_profile_member.ts | 52 ++++++---- test/index.js | 18 ++++ 4 files changed, 149 insertions(+), 33 deletions(-) diff --git a/src/responses/player.ts b/src/responses/player.ts index 122f42f..fa47bb2 100644 --- a/src/responses/player.ts +++ b/src/responses/player.ts @@ -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 & { @@ -24,12 +44,20 @@ export interface PlayerDataResponse { dailyTwoKExp: number } quests: Record + testPass?: boolean + mostRecentlyTippedUuid?: string vanityFavorites?: string currentEmote?: string achievements: Record + transformation?: string housingMeta: Record voting: Record mcVersionRp: string + rewardConsumed?: boolean + vanityConvertedBoxToday?: number + vanityFirstConvertedBox?: number + [key: `${string}Cooldowns`]: Record + cooldowns?: Record> karma: number petConsumables: Record, [key: `levelingReward_${number}`]: boolean @@ -41,19 +69,28 @@ 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 + 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 @@ -61,27 +98,66 @@ export interface PlayerDataResponse { rewardHighScore: number petStats?: Record 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> spec_always_flying?: boolean userLanguage: string + monthlyRankColor?: 'AQUA' achievementSync: Record - parkourCheckpointBests: Record + tiered_achievement_menu_sort?: string + parkourCheckpointBests: Record> achievementPoints: number + battlePassGlowStatus?: boolean monthlycrates: Record<`${number}-${number}`, Record> - tourney?: Record> + tourney?: Tourneys gifts_grinch?: number - snowball_fight_intro_2019?: number + snowball_fight_intro_2019?: boolean achievementTotem?: any main2017Tutorial?: boolean [key: `levelUp_${string}`]: number @@ -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 + presents?: Record + }>> + [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 } } diff --git a/src/responses/skyblock/_profile.ts b/src/responses/skyblock/_profile.ts index b800fdb..e9c5346 100644 --- a/src/responses/skyblock/_profile.ts +++ b/src/responses/skyblock/_profile.ts @@ -36,5 +36,5 @@ export interface SkyBlockProfile { community_upgrades?: SkyBlockCommunityUpgrades last_save?: string banking?: SkyBlockBanking - game_mode?: 'bingo' + game_mode?: 'bingo' | 'island' } \ No newline at end of file diff --git a/src/responses/skyblock/_profile_member.ts b/src/responses/skyblock/_profile_member.ts index 94efaf1..77dc354 100644 --- a/src/responses/skyblock/_profile_member.ts +++ b/src/responses/skyblock/_profile_member.ts @@ -61,7 +61,7 @@ export interface SkyBlockObjective { completed_at: number } -export interface SkyBlockActiveEffect { +export interface SkyBlockPotionEffect { effect: string level: number modifiers: { @@ -113,8 +113,8 @@ export interface SkyBlockCrystalStatus { } export interface SkyBlockProfileMember { - last_save: number - inv_armor: Inventory + last_save?: number + inv_armor?: Inventory coop_invitation?: { timestamp: number /** @@ -122,9 +122,9 @@ export interface SkyBlockProfileMember { */ invited_by: string confirmed: boolean - confirmed_timestamp: number + confirmed_timestamp?: number } - first_join: number + first_join?: number first_join_hub?: number stats: Record objectives: Record & ({ @@ -133,7 +133,7 @@ export interface SkyBlockProfileMember { GOLD_INGOT: boolean } }) - tutorial: string[] + tutorial?: string[] quests: Record - 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 @@ -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<`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?: { @@ -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 | {}> @@ -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: { diff --git a/test/index.js b/test/index.js index da7effa..d612f1e 100644 --- a/test/index.js +++ b/test/index.js @@ -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 :)')