diff --git a/src/methods/resources/index.ts b/src/methods/resources/index.ts index 237e6ca82..531eb0ceb 100644 --- a/src/methods/resources/index.ts +++ b/src/methods/resources/index.ts @@ -7,6 +7,7 @@ import type { ResourcesAchievementsResponse, ResourcesChallengesResponse, ResourcesGamesResponse, + ResourcesPacksResponse, ResourcesQuestsResponse, } from "../../types/AugmentedTypes"; @@ -79,6 +80,24 @@ export class Resources extends Method { */ public guilds: GuildsResources = new GuildsResources(this.client); + /** + * Returns the active resource packs used with content for the latest + * versions of Minecraft, including download URLs. + * @example + * ```typescript + * const packs = await client.resources.packs(); + * ``` + * @category API + */ + public async packs(): Promise< + ResultObject + > { + return getResultObject( + await this.client.call("resources/packs"), + ["success"], + ); + } + /** * Returns all the quests for each gamemode on the Hypixel network. * @example diff --git a/src/types/Augmented/Resources/Packs.ts b/src/types/Augmented/Resources/Packs.ts new file mode 100644 index 000000000..781e258dc --- /dev/null +++ b/src/types/Augmented/Resources/Packs.ts @@ -0,0 +1,16 @@ +/** + * The swagger schema for /v2/resources/packs only provides an example, so the + * pack shape is typed here from the documented example fields. + */ +export interface ResourcePackVersion { + packFormat: number; + hash: string; + url: string; +} + +export interface ResourcePack { + id: string; + lastUpdated: number; + deployId: string; + versions: ResourcePackVersion[]; +} diff --git a/src/types/Augmented/SkyBlock/Auction.ts b/src/types/Augmented/SkyBlock/Auction.ts index 812bf91fa..d3e1690fa 100644 --- a/src/types/Augmented/SkyBlock/Auction.ts +++ b/src/types/Augmented/SkyBlock/Auction.ts @@ -1,5 +1,12 @@ import { Components } from "../../api"; -export type SkyBlockAuction = Components.Schemas.SkyBlockAuction & { +export type SkyBlockAuction = Omit< + Components.Schemas.SkyBlockAuction, + "item_bytes" +> & { bin?: boolean; + categories?: string[]; + item_uuid?: string; + last_updated?: number; + item_bytes?: string; }; diff --git a/src/types/Augmented/SkyBlock/Profile.ts b/src/types/Augmented/SkyBlock/Profile.ts index 1e9e2c47c..de1f4a303 100644 --- a/src/types/Augmented/SkyBlock/Profile.ts +++ b/src/types/Augmented/SkyBlock/Profile.ts @@ -9,6 +9,7 @@ export type SkyBlockProfile = Omit< members: { [key: string]: SkyBlockProfileMember; }; + created_at?: number; community_upgrades?: { created_at?: number; currently_upgrading: { diff --git a/src/types/Augmented/SkyBlock/ProfileMember.ts b/src/types/Augmented/SkyBlock/ProfileMember.ts index 5c2544f68..4074fc86f 100644 --- a/src/types/Augmented/SkyBlock/ProfileMember.ts +++ b/src/types/Augmented/SkyBlock/ProfileMember.ts @@ -1430,7 +1430,7 @@ export type SkyBlockProfileMemberForagingCore = { daily_trees_cut?: number; daily_gifts?: number; daily_log_cut_day?: number; - daily_log_cut?: unknown[]; + daily_log_cut?: string[]; forests_whispers?: number; forests_whispers_spent?: number; current_daily_effect?: string; @@ -1441,6 +1441,7 @@ export type SkyBlockProfileMemberForagingCore = { [key: `${number}`]: | { spent?: number; + spent_non_refundable?: number; } | undefined; }; @@ -1449,6 +1450,7 @@ export type SkyBlockProfileMemberForagingCore = { [key: `${number}`]: | { spent?: number; + spent_non_refundable?: number; } | undefined; }; @@ -1458,11 +1460,13 @@ export type SkyBlockProfileMemberForagingCore = { [key: `${number}`]: | { spent?: number; + spent_non_refundable?: number; } | undefined; } | undefined; }; + [key: string]: string | number | boolean | unknown; }; export type SkyBlockProfileMemberShards = { diff --git a/src/types/AugmentedTypes.ts b/src/types/AugmentedTypes.ts index d9eb64675..855c0c0dc 100644 --- a/src/types/AugmentedTypes.ts +++ b/src/types/AugmentedTypes.ts @@ -3,6 +3,7 @@ */ import type { Components, Paths } from "./api"; +import type { ResourcePack } from "./Augmented/Resources/Packs"; import type { Guild } from "./Augmented/Guild"; import type { Player } from "./Augmented/Player"; import type { @@ -63,6 +64,11 @@ export type ResourcesVanityCompanionsResponse = export type ResourcesVanityPetsResponse = Paths.V2ResourcesVanityPets.Get.Responses.$200 & Record; +export type ResourcesPacksResponse = Paths.V2ResourcesPacks.Get.Responses.$200 & + Record & { + packs: ResourcePack[]; + }; + export type ResourcesSkyblockBingoResponse = Paths.V2ResourcesSkyblockBingo.Get.Responses.$200 & Record; @@ -117,7 +123,10 @@ export type ResourcesSkyblockElectionResponse = current: ElectionCurrent | null; }; -export type SkyBlockItem = Omit & { +export type SkyBlockItem = Omit< + Components.Schemas.SkyBlockItem, + "tier" | "skin" +> & { tier?: | "COMMON" | "UNCOMMON" @@ -129,6 +138,13 @@ export type SkyBlockItem = Omit & { | "SPECIAL" | "VERY_SPECIAL" | "UNOBTAINABLE"; + category?: string; + durability?: number; + npc_sell_price?: number; + skin?: { + value: string; + signature: string; + }; }; export type ResourcesSkyblockItemsResponse = Omit< diff --git a/src/types/api.ts b/src/types/api.ts index 97d14ce7f..434e05c45 100644 --- a/src/types/api.ts +++ b/src/types/api.ts @@ -873,6 +873,16 @@ export declare namespace Paths { } } } + namespace V2ResourcesPacks { + namespace Get { + namespace Responses { + export interface $200 { + success?: boolean; + packs?: unknown[]; + } + } + } + } namespace V2ResourcesQuests { namespace Get { namespace Responses { @@ -1391,8 +1401,6 @@ export declare namespace Paths { success?: boolean; items?: unknown; } - export type $403 = Components.Responses.InvalidKey; - export type $429 = Components.Responses.RateLimited; } } }