Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/methods/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type {
ResourcesAchievementsResponse,
ResourcesChallengesResponse,
ResourcesGamesResponse,
ResourcesPacksResponse,
ResourcesQuestsResponse,
} from "../../types/AugmentedTypes";

Expand Down Expand Up @@ -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<ResourcesPacksResponse, ["success"]>
> {
return getResultObject(
await this.client.call<ResourcesPacksResponse>("resources/packs"),
["success"],
);
}

/**
* Returns all the quests for each gamemode on the Hypixel network.
* @example
Expand Down
16 changes: 16 additions & 0 deletions src/types/Augmented/Resources/Packs.ts
Original file line number Diff line number Diff line change
@@ -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[];
}
9 changes: 8 additions & 1 deletion src/types/Augmented/SkyBlock/Auction.ts
Original file line number Diff line number Diff line change
@@ -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;
};
1 change: 1 addition & 0 deletions src/types/Augmented/SkyBlock/Profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type SkyBlockProfile = Omit<
members: {
[key: string]: SkyBlockProfileMember;
};
created_at?: number;
community_upgrades?: {
created_at?: number;
currently_upgrading: {
Expand Down
6 changes: 5 additions & 1 deletion src/types/Augmented/SkyBlock/ProfileMember.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -1441,6 +1441,7 @@ export type SkyBlockProfileMemberForagingCore = {
[key: `${number}`]:
| {
spent?: number;
spent_non_refundable?: number;
}
| undefined;
};
Expand All @@ -1449,6 +1450,7 @@ export type SkyBlockProfileMemberForagingCore = {
[key: `${number}`]:
| {
spent?: number;
spent_non_refundable?: number;
}
| undefined;
};
Expand All @@ -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 = {
Expand Down
18 changes: 17 additions & 1 deletion src/types/AugmentedTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -63,6 +64,11 @@ export type ResourcesVanityCompanionsResponse =
export type ResourcesVanityPetsResponse =
Paths.V2ResourcesVanityPets.Get.Responses.$200 & Record<string, unknown>;

export type ResourcesPacksResponse = Paths.V2ResourcesPacks.Get.Responses.$200 &
Record<string, unknown> & {
packs: ResourcePack[];
};

export type ResourcesSkyblockBingoResponse =
Paths.V2ResourcesSkyblockBingo.Get.Responses.$200 & Record<string, unknown>;

Expand Down Expand Up @@ -117,7 +123,10 @@ export type ResourcesSkyblockElectionResponse =
current: ElectionCurrent | null;
};

export type SkyBlockItem = Omit<Components.Schemas.SkyBlockItem, "tier"> & {
export type SkyBlockItem = Omit<
Components.Schemas.SkyBlockItem,
"tier" | "skin"
> & {
tier?:
| "COMMON"
| "UNCOMMON"
Expand All @@ -129,6 +138,13 @@ export type SkyBlockItem = Omit<Components.Schemas.SkyBlockItem, "tier"> & {
| "SPECIAL"
| "VERY_SPECIAL"
| "UNOBTAINABLE";
category?: string;
durability?: number;
npc_sell_price?: number;
skin?: {
value: string;
signature: string;
};
};

export type ResourcesSkyblockItemsResponse = Omit<
Expand Down
12 changes: 10 additions & 2 deletions src/types/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -1391,8 +1401,6 @@ export declare namespace Paths {
success?: boolean;
items?: unknown;
}
export type $403 = Components.Responses.InvalidKey;
export type $429 = Components.Responses.RateLimited;
}
}
}
Expand Down
Loading