@ejercito-fam/habbo-api 1.3.1 → 1.4.1
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/cjs/index.cjs +11 -8
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +11 -2
- package/dist/esm/index.d.ts +11 -2
- package/dist/esm/index.js +11 -8
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -98,6 +98,14 @@ var AchievementDataState = /* @__PURE__ */ ((AchievementDataState2) => {
|
|
|
98
98
|
AchievementDataState2["OffSeason"] = "OFF_SEASON";
|
|
99
99
|
return AchievementDataState2;
|
|
100
100
|
})(AchievementDataState || {});
|
|
101
|
+
|
|
102
|
+
// src/common.ts
|
|
103
|
+
function isNullish(value) {
|
|
104
|
+
return value == null;
|
|
105
|
+
}
|
|
106
|
+
__name(isNullish, "isNullish");
|
|
107
|
+
|
|
108
|
+
// src/routes/groups.ts
|
|
101
109
|
var GroupsAPI = class extends BaseAPI {
|
|
102
110
|
static {
|
|
103
111
|
__name(this, "GroupsAPI");
|
|
@@ -120,6 +128,9 @@ var GroupsAPI = class extends BaseAPI {
|
|
|
120
128
|
*/
|
|
121
129
|
getGroupMembers(id, options) {
|
|
122
130
|
const url = this.formatURL(`/api/public/groups/${id}/members`);
|
|
131
|
+
if (!isNullish(options?.pageIndex)) {
|
|
132
|
+
url.searchParams.append("pageIndex", options.pageIndex.toString());
|
|
133
|
+
}
|
|
123
134
|
return safeFetch.Json(this.fetch(url, options));
|
|
124
135
|
}
|
|
125
136
|
/**
|
|
@@ -225,14 +236,6 @@ var RoomsAPI = class extends BaseAPI {
|
|
|
225
236
|
return safeFetch.Json(this.fetch(url, options));
|
|
226
237
|
}
|
|
227
238
|
};
|
|
228
|
-
|
|
229
|
-
// src/common.ts
|
|
230
|
-
function isNullish(value) {
|
|
231
|
-
return value == null;
|
|
232
|
-
}
|
|
233
|
-
__name(isNullish, "isNullish");
|
|
234
|
-
|
|
235
|
-
// src/routes/users.ts
|
|
236
239
|
var UsersAPI = class extends BaseAPI {
|
|
237
240
|
static {
|
|
238
241
|
__name(this, "UsersAPI");
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/constants.ts","../../src/routes/base.ts","../../src/routes/achievements.ts","../../src/routes/groups.ts","../../src/routes/lists.ts","../../src/routes/marketplace.ts","../../src/routes/ping.ts","../../src/routes/rooms.ts","../../src/common.ts","../../src/routes/users.ts","../../src/habbo.ts"],"names":["HotelDomainTLD","safeFetch","Json","AchievementDataState","HabboGroupType"],"mappings":";;;;;;;;AAAY,IAAA,cAAA,qBAAAA,eAAL,KAAA;AACN,EAAAA,gBAAA,WAAY,CAAA,GAAA,SAAA;AACZ,EAAAA,gBAAA,QAAS,CAAA,GAAA,KAAA;AACT,EAAAA,gBAAA,OAAQ,CAAA,GAAA,KAAA;AACR,EAAAA,gBAAA,SAAU,CAAA,GAAA,KAAA;AACV,EAAAA,gBAAA,QAAS,CAAA,GAAA,KAAA;AACT,EAAAA,gBAAA,QAAS,CAAA,GAAA,KAAA;AACT,EAAAA,gBAAA,eAAgB,CAAA,GAAA,MAAA;AAChB,EAAAA,gBAAA,SAAU,CAAA,GAAA,KAAA;AACV,EAAAA,gBAAA,SAAU,CAAA,GAAA,KAAA;AACV,EAAAA,gBAAA,SAAU,CAAA,GAAA,SAAA;AAVC,EAAAA,OAAAA,eAAAA;AAAA,CAAA,EAAA,cAAA,IAAA,EAAA;AAaL,IAAM,cAAiB,GAAA;AAAA,EAC7B,SAAA,EAAW,oBAAoB,SAAwB,iBAAA,CAAA;AAAA,EACvD,MAAA,EAAQ,oBAAoB,KAAqB,cAAA,CAAA;AAAA,EACjD,KAAA,EAAO,oBAAoB,KAAoB,aAAA,CAAA;AAAA,EAC/C,OAAA,EAAS,oBAAoB,KAAsB,eAAA,CAAA;AAAA,EACnD,M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AAA,CAAA,IAAA,EAAA,OAAA,CAAA;AAAA;AAAA,EACF,YAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EAET,YAAY,OAAwB,EAAA;AAC1C,IAAM,MAAA,OAAA,GAAU,OAAS,EAAA,OAAA,IAAW,cAAe,CAAA,aAAA;AACnD,IAAM,MAAA,OAAA,GAAU,SAAS,OAAW,IAAA,IAAA;AAEpC,IAAA,IAAA,CAAK,YAAe,GAAA,IAAI,eAAgB,CAAA,OAAA,EAAS,OAAO,CAAA;AACxD,IAAA,IAAA,CAAK,MAAS,GAAA,IAAI,SAAU,CAAA,OAAA,EAAS,OAAO,CAAA;AAC5C,IAAA,IAAA,CAAK,KAAQ,GAAA,IAAI,QAAS,CAAA,OAAA,EAAS,OAAO,CAAA;AAC1C,IAAA,IAAA,CAAK,WAAc,GAAA,IAAI,cAAe,CAAA,OAAA,EAAS,OAAO,CAAA;AACtD,IAAA,IAAA,CAAK,IAAO,GAAA,IAAI,OAAQ,CAAA,OAAA,EAAS,OAAO,CAAA;AACxC,IAAA,IAAA,CAAK,KAAQ,GAAA,IAAI,QAAS,CAAA,OAAA,EAAS,OAAO,CAAA;AAC1C,IAAA,IAAA,CAAK,KAAQ,GAAA,IAAI,QAAS,CAAA,OAAA,EAAS,OAAO,CAAA;AAAA;AAE5C","file":"index.cjs","sourcesContent":["export enum HotelDomainTLD {\n\tBrazilian = '.com.br',\n\tDanish = '.dk',\n\tDutch = '.nl',\n\tFinnish = '.fi',\n\tFrench = '.fr',\n\tGerman = '.de',\n\tInternational = '.com',\n\tItalian = '.it',\n\tSpanish = '.es',\n\tTurkish = '.com.tr'\n}\n\nexport const HotelDomainURL = {\n\tBrazilian: `https://www.habbo${HotelDomainTLD.Brazilian}`,\n\tDanish: `https://www.habbo${HotelDomainTLD.Danish}`,\n\tDutch: `https://www.habbo${HotelDomainTLD.Dutch}`,\n\tFinnish: `https://www.habbo${HotelDomainTLD.Finnish}`,\n\tFrench: `https://www.habbo${HotelDomainTLD.French}`,\n\tGerman: `https://www.habbo${HotelDomainTLD.German}`,\n\tInternational: `https://www.habbo${HotelDomainTLD.International}`,\n\tItalian: `https://www.habbo${HotelDomainTLD.Italian}`,\n\tSpanish: `https://www.habbo${HotelDomainTLD.Spanish}`,\n\tTurkish: `https://www.habbo${HotelDomainTLD.Turkish}`\n} as const;\n","import { safeFetch, type FetchResult } from '@skyra/safe-fetch';\n\nexport abstract class BaseAPI {\n\tprotected readonly baseURL: string;\n\tprotected readonly timeout: number | null;\n\n\tpublic constructor(baseURL: string, timeout?: number | null | undefined) {\n\t\tthis.baseURL = baseURL;\n\t\tthis.timeout = timeout ?? null;\n\t}\n\n\tprotected formatURL(route: string): URL {\n\t\treturn new URL(route, this.baseURL);\n\t}\n\n\tprotected fetch(url: string | URL, options?: APIOptions): Promise<FetchResult<Response>> {\n\t\treturn safeFetch(url, { headers: { 'Content-Type': 'application/json' }, signal: this.#getSignalOrDefault(options) });\n\t}\n\n\t#getSignalOrDefault(options?: APIOptions): AbortSignal | null {\n\t\tif (typeof options === 'object' && options !== null) {\n\t\t\tif (typeof options.signal === 'number') return AbortSignal.timeout(options.signal);\n\t\t\tif (typeof options.signal === 'object' && options.signal !== null) return options.signal;\n\t\t}\n\n\t\tif (typeof this.timeout === 'number') return AbortSignal.timeout(this.timeout);\n\t\treturn null;\n\t}\n}\n\nexport interface APIOptions {\n\tsignal?: AbortSignal | number | null | undefined;\n}\n","import { Json, type FetchResult } from '@skyra/safe-fetch';\nimport { BaseAPI, type APIOptions } from './base.js';\nimport type { HabboUserId } from './users.js';\n\nexport class AchievementsAPI extends BaseAPI {\n\t/**\n\t * Get all achievements\n\t *\n\t * @param options - The options for the API call\n\t */\n\tpublic getAll(options?: APIOptions): Promise<FetchResult<Achievement[]>> {\n\t\tconst url = this.formatURL('/api/public/achievements');\n\t\treturn Json<Achievement[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get the achievements from a specified user ID\n\t *\n\t * @param id - The ID of the user\n\t * @param options - The options for the API call\n\t */\n\tpublic getByUserId(id: HabboUserId, options?: APIOptions): Promise<FetchResult<UserAchievement[]>> {\n\t\tconst url = this.formatURL(`/api/public/achievements/${id}`);\n\t\treturn Json<UserAchievement[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get the image URL for an achievement\n\t *\n\t * @param achievementName - The name of the achievement, retrieved from {@linkcode AchievementData.name}\n\t *\n\t * @unstable This feature is not documented, use at your own risk\n\t */\n\tpublic getImageURL(achievementName: string): URL {\n\t\treturn new URL(`https://images.habbo.com/c_images/album1584/${achievementName}.png`);\n\t}\n}\n\nexport interface Achievement {\n\tachievement: AchievementData;\n\tlevelRequirements: AchievementRequirements;\n}\n\nexport interface UserAchievement {\n\tachievement: AchievementData;\n\tlevel: number;\n\tscore: number;\n}\n\nexport interface AchievementData {\n\tid: number;\n\tname: string;\n\tcreationTime: `${bigint}-${bigint}-${bigint}`;\n\tstate: AchievementDataState;\n\tcategory: string;\n}\n\nexport enum AchievementDataState {\n\tEnabled = 'ENABLED',\n\tArchived = 'ARCHIVED',\n\tOffSeason = 'OFF_SEASON'\n}\n\nexport interface AchievementRequirements {\n\tlevel: number;\n\trequiredScore: number;\n}\n","import { Json, type FetchResult } from '@skyra/safe-fetch';\nimport { BaseAPI, type APIOptions } from './base.js';\nimport type { HabboRoomUniqueId } from './rooms.js';\n\nexport class GroupsAPI extends BaseAPI {\n\t/**\n\t * Get the data for a group given its identifier\n\t *\n\t * @param id - The ID of the group\n\t * @param options - The options for the API call\n\t */\n\tpublic getByUniqueId(id: HabboGroupId, options?: APIOptions): Promise<FetchResult<HabboGroup>> {\n\t\tconst url = this.formatURL(`/api/public/groups/${id}`);\n\t\treturn Json<HabboGroup>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get the members from a group given its identifier\n\t *\n\t * @param id - The ID of the group\n\t * @param options - The options for the API call\n\t */\n\tpublic getGroupMembers(id: HabboGroupId, options?: APIOptions): Promise<FetchResult<HabboGroupMember[]>> {\n\t\tconst url = this.formatURL(`/api/public/groups/${id}/members`);\n\t\treturn Json<HabboGroupMember[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get the image URL for a badge\n\t *\n\t * @param badgeCode - The badge's code, retrieved from {@linkcode HabboGroup.badgeCode}\n\t *\n\t * @unstable This feature is not documented, use at your own risk\n\t */\n\tpublic getGroupBadgeImageURL(badgeCode: string): URL {\n\t\treturn this.formatURL(`/habbo-imaging/badge/${badgeCode}`);\n\t}\n}\n\nexport type HabboGroupId = `g-hh${string}-${string};`\n\n/**\n * Represents a Habbo group.\n */\nexport interface HabboGroup {\n\t/**\n\t * The unique identifier of the group.\n\t */\n\tid: HabboGroupId;\n\n\t/**\n\t * The name of the group.\n\t */\n\tname: string;\n\n\t/**\n\t * The description of the group.\n\t */\n\tdescription: string;\n\n\t/**\n\t * The type of the group.\n\t */\n\ttype: HabboGroupType;\n\n\t/**\n\t * The ID of the room associated with the group, or null if no room is associated.\n\t */\n\troomId: HabboRoomUniqueId;\n\n\t/**\n\t * The badge code of the group.\n\t */\n\tbadgeCode: string;\n}\n\n/**\n * Enum representing the type of a Habbo group.\n */\nexport enum HabboGroupType {\n\t/**\n\t * A normal group (public).\n\t */\n\tNORMAL = 'NORMAL',\n\n\t/**\n\t * A favourite (exclusive) group.\n\t */\n\tFAVOURITE = 'EXCLUSIVE',\n\n\t/**\n\t * A private (closed) group.\n\t */\n\tPRIVATE = 'CLOSED'\n}\n\n/**\n * Represents a member of a Habbo group.\n */\nexport interface HabboGroupMember {\n\t/**\n\t * Indicates whether the member is online.\n\t */\n\tonline: boolean;\n\n\t/**\n\t * The gender of the member.\n\t */\n\tgender: 'm' | 'f';\n\n\t/**\n\t * The motto of the member.\n\t */\n\tmotto: string;\n\n\t/**\n\t * The figure of the member in the Habbo world.\n\t */\n\thabboFigure: string;\n\n\t/**\n\t * The date since the member joined the group.\n\t */\n\tmemberSince: string;\n\n\t/**\n\t * The unique identifier of the member.\n\t */\n\tuniqueId: string;\n\n\t/**\n\t * The name of the member.\n\t */\n\tname: string;\n\n\t/**\n\t * Indicates whether the member is an admin of the group.\n\t */\n\tisAdmin: boolean;\n}\n","import { type FetchResult } from '@skyra/safe-fetch';\nimport { BaseAPI, type APIOptions } from './base.js';\n\nexport class ListsAPI extends BaseAPI {\n\t/**\n\t * Get the hot looks from the hotel\n\t *\n\t * @param options - The options for the API call\n\t */\n\tpublic async getHotLooks(options: APIOptions): Promise<FetchResult<HabboHotLookList>> {\n\t\tconst url = this.formatURL('/api/public/lists/hotlooks');\n\t\tconst data = await this.fetch(url, options);\n\t\treturn data.map(async (result) => this.#parseHotLooksXML(await result.text())).intoPromise();\n\t}\n\n\t#parseHotLooksXML(data: string): HabboHotLookList {\n\t\tconst urlResult = /url=\"(.*)\"/.exec(data);\n\t\tif (urlResult === null) throw new SyntaxError('Could not read hot looks');\n\n\t\tconst url = urlResult[1];\n\t\tconst entries = [] as HabboHotLookListItem[];\n\t\tfor (const result of data.matchAll(/gender=\"(\\w)\" figure=\"(.+)\" hash=\"(.+)\"/g)) {\n\t\t\tentries.push({ gender: result[1] as 'f' | 'm', figure: result[2], hash: result[3] });\n\t\t}\n\n\t\tif (entries.length === 0) throw new SyntaxError('Could not read hot looks');\n\n\t\treturn { url, entries };\n\t}\n}\n\nexport interface HabboHotLookList {\n\turl: string;\n\tentries: HabboHotLookListItem[];\n}\n\nexport interface HabboHotLookListItem {\n\tgender: 'f' | 'm';\n\tfigure: string;\n\thash: string;\n}\n","import { Json, type FetchResult } from '@skyra/safe-fetch';\nimport { BaseAPI, type APIOptions } from './base.js';\n\nexport class MarketplaceAPI extends BaseAPI {\n\t/**\n\t * Get the marketplace stats for a room item\n\t *\n\t * @param roomItemName - The name of the room item\n\t * @param options - The options for the API call\n\t */\n\tpublic getRoomItemStats(roomItemName: string, options?: APIOptions): Promise<FetchResult<MarketplaceStats>> {\n\t\tconst url = this.formatURL(`/api/public/marketplace/stats/roomItem/${roomItemName}`);\n\t\treturn Json<MarketplaceStats>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get the marketplace stats for a wall item\n\t *\n\t * @param wallItemName - The name of the wall item\n\t * @param options - The options for the API call\n\t */\n\tpublic getWallItemStats(wallItemName: string, options?: APIOptions): Promise<FetchResult<MarketplaceStats>> {\n\t\tconst url = this.formatURL(`/api/public/marketplace/stats/wallItem/${wallItemName}`);\n\t\treturn Json<MarketplaceStats>(this.fetch(url, options));\n\t}\n}\n\nexport interface MarketplaceStats {\n\thistory: MarketplaceStatsHistory[];\n\tstatsDate: `${bigint}-${bigint}-${bigint}`;\n\tsoldItemCount: number;\n\tcreditSum: number;\n\taveragePrice: number;\n\ttotalOpenOffers: number;\n\thistoryLimitInDays: number;\n}\n\nexport interface MarketplaceStatsHistory {\n\tdayOffset: `${bigint}`;\n\taveragePrice: `${bigint}`;\n\ttotalSoldItems: `${bigint}`;\n\ttotalCreditSum: `${bigint}`;\n\ttotalOpenOffers: `${bigint}`;\n}\n","import { type APIOptions, BaseAPI } from './base.js';\n\nexport class PingAPI extends BaseAPI {\n\t/**\n\t * Pings Habbo, returning the measured time using {@linkcode performance.now()}\n\t *\n\t * @param options - The options for the API call\n\t */\n\tpublic async get(options?: APIOptions): Promise<number | null> {\n\t\tconst url = this.formatURL('/api/public/ping');\n\t\tconst now = performance.now();\n\t\treturn (await this.fetch(url, options)).match({\n\t\t\tok: () => performance.now() - now,\n\t\t\terr: () => null\n\t\t});\n\t}\n}\n","import { type FetchResult, Json } from '@skyra/safe-fetch';\nimport { type APIOptions, BaseAPI } from './base.js';\n\nexport class RoomsAPI extends BaseAPI {\n\t/**\n\t * Get a room by its ID\n\t *\n\t * @param roomId - The ID of the room\n\t * @param options - The options for the API call\n\t */\n\tpublic async getById(roomId: number, options?: APIOptions): Promise<FetchResult<HabboRoom>> {\n\t\tconst url = this.formatURL(`/api/public/rooms/${roomId}`);\n\t\treturn Json<HabboRoom>(this.fetch(url, options));\n\t}\n}\n\nexport interface HabboRoom {\n\tid: number;\n\tname: string;\n\tdescription: string;\n\tcreationTime: `${bigint}-${bigint}-${bigint}T${string}`;\n\thabboGroupId: string;\n\ttags: string[];\n\tmaximumVisitors: number;\n\tshowOwnerName: boolean;\n\townerName: string;\n\townerUniqueId: string;\n\tcategories: string[];\n\tthumbnailUrl: string;\n\timageUrl: string;\n\trating: number;\n\tuniqueId: HabboRoomUniqueId;\n}\n\nexport type HabboRoomUniqueId = `r-hh${string}-${string}`;\n","export function isNullish(value: unknown): value is null | undefined {\n\treturn value == null;\n}\n","import { Json, type FetchResult } from '@skyra/safe-fetch';\nimport { isNullish } from '../common.js';\nimport { BaseAPI, type APIOptions } from './base.js';\nimport { HabboGroupType } from './groups.js';\n\nexport class UsersAPI extends BaseAPI {\n\t/**\n\t * Get a user by its username\n\t *\n\t * @param username - The username to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getByUsername(username: string, options?: APIOptions): Promise<FetchResult<HabboUser>> {\n\t\tconst url = this.formatURL('/api/public/users');\n\t\turl.searchParams.set('name', username);\n\t\treturn Json<HabboUser>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user by its ID\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getByUniqueId(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUser>> {\n\t\tconst url = this.formatURL(`/api/public/users/${uniqueId}`);\n\t\treturn Json<HabboUser>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's friends\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getUserFriends(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUserFriend[]>> {\n\t\tconst url = this.formatURL(`/api/public/users/${uniqueId}/friends`);\n\t\treturn Json<HabboUserFriend[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's groups\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getUserGroups(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUserGroup[]>> {\n\t\tconst url = this.formatURL(`/api/public/users/${uniqueId}/groups`);\n\t\treturn Json<HabboUserGroup[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's rooms\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getUserRooms(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUserRoom[]>> {\n\t\tconst url = this.formatURL(`/api/public/users/${uniqueId}/rooms`);\n\t\treturn Json<HabboUserRoom[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's badges\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getUserBadges(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUserBadge[]>> {\n\t\tconst url = this.formatURL(`/api/public/users/${uniqueId}/badges`);\n\t\treturn Json<HabboUserBadge[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's profile\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getUserProfile(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUserProfile>> {\n\t\tconst url = this.formatURL(`/api/public/users/${uniqueId}/profile`);\n\t\treturn Json<HabboUserProfile>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's photos\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getUserPhotos(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUserPhotos[]>> {\n\t\tconst url = this.formatURL(`/extradata/public/users/${uniqueId}/photos`);\n\t\treturn Json<HabboUserPhotos[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's figure\n\t *\n\t * @param options - The options for the image\n\t */\n\tpublic getUserFigureImageURL(options: HabboFigureName | HabboFigureStatic): URL {\n\t\tconst url = this.formatURL('/habbo-imaging/avatarimage');\n\n\t\tif ('figure' in options && !isNullish(options.figure)) {\n\t\t\turl.searchParams.append('figure', options.figure);\n\t\t\tif (!isNullish(options.gender)) url.searchParams.append('gender', HabboFigureGender[options.gender]);\n\t\t} else if ('user' in options && !isNullish(options.user)) {\n\t\t\turl.searchParams.append('user', options.user);\n\t\t} else {\n\t\t\tthrow new Error('You must define `figure` or `user` in the options');\n\t\t}\n\n\t\tif (!isNullish(options.action)) {\n\t\t\tconst habboAction = HabboFigureAction[options.action];\n\t\t\turl.searchParams.append(\n\t\t\t\t'action',\n\t\t\t\tisNullish(options.hand) //\n\t\t\t\t\t? habboAction\n\t\t\t\t\t: `${habboAction}=${HabboFigureHand[options.hand]}`\n\t\t\t);\n\t\t}\n\t\tif (!isNullish(options.direction)) url.searchParams.append('direction', HabboFigureDirection[options.direction]);\n\t\tif (!isNullish(options.headDirection)) url.searchParams.append('head_direction', HabboFigureDirection[options.headDirection]);\n\t\tif (!isNullish(options.gesture)) url.searchParams.append('gesture', HabboFigureGesture[options.gesture]);\n\t\tif (!isNullish(options.size)) url.searchParams.append('size', HabboFigureSize[options.size]);\n\t\tif (!isNullish(options.headOnly)) url.searchParams.append('headonly', options.headOnly ? '1' : '0');\n\n\t\treturn url;\n\t}\n}\n\nexport type HabboUserId = `hh${string}-${string}`;\n\n/**\n * Represents a Habbo user.\n */\nexport interface HabboUser {\n\t/**\n\t * The unique identifier of the user.\n\t */\n\tuniqueId: HabboUserId;\n\t/**\n\t * The name of the user.\n\t */\n\tname: string;\n\t/**\n\t * The figure string of the user.\n\t */\n\tfigureString: string;\n\t/**\n\t * The motto of the user.\n\t */\n\tmotto: string;\n\t/**\n\t * Indicates whether the user is online.\n\t */\n\tonline: boolean;\n\t/**\n\t * The last access time of the user.\n\t */\n\tlastAccessTime: string;\n\t/**\n\t * The date when the user became a member.\n\t */\n\tmemberSince: string;\n\t/**\n\t * Indicates whether the user's profile is visible.\n\t */\n\tprofileVisible: boolean;\n\t/**\n\t * The current level of the user.\n\t */\n\tcurrentLevel: number;\n\t/**\n\t * The percentage of the current level completed by the user.\n\t */\n\tcurrentLevelCompletePercent: number;\n\t/**\n\t * The total experience points of the user.\n\t */\n\ttotalExperience: number;\n\t/**\n\t * The number of star gems the user has.\n\t */\n\tstarGemCount: number;\n\t/**\n\t * The badges selected by the user.\n\t */\n\tselectedBadges: HabboUserSelectedBadge[];\n}\n\n/**\n * Represents a room owned by a Habbo user.\n */\nexport interface HabboUserRoom {\n\t/**\n\t * The unique identifier of the room.\n\t */\n\tid: number;\n\t/**\n\t * The name of the room.\n\t */\n\tname: string;\n\t/**\n\t * The description of the room.\n\t */\n\tdescription: string;\n\t/**\n\t * The creation time of the room.\n\t */\n\tcreationTime: string;\n\t/**\n\t * The unique identifier of the Habbo group associated with the room.\n\t */\n\thabboGroupId: string;\n\t/**\n\t * The tags associated with the room.\n\t */\n\ttags: string[];\n\t/**\n\t * The maximum number of visitors allowed in the room.\n\t */\n\tmaximumVisitors: number;\n\t/**\n\t * Indicates whether the owner's name is shown.\n\t */\n\tshowOwnerName: boolean;\n\t/**\n\t * The name of the room owner.\n\t */\n\townerName: string;\n\t/**\n\t * The unique identifier of the room owner.\n\t */\n\townerUniqueId: string;\n\t/**\n\t * The categories associated with the room.\n\t */\n\tcategories: string[];\n\t/**\n\t * The URL of the room's thumbnail image.\n\t */\n\tthumbnailUrl: string;\n\t/**\n\t * The URL of the room's image.\n\t */\n\timageUrl: string;\n\t/**\n\t * The rating of the room.\n\t */\n\trating: number;\n\t/**\n\t * The unique identifier of the room.\n\t */\n\tuniqueId: string;\n}\n\n/**\n * Represents a group associated with a Habbo user.\n */\nexport interface HabboUserGroup {\n\t/**\n\t * Indicates whether the group is online.\n\t */\n\tonline: boolean;\n\t/**\n\t * The unique identifier of the group.\n\t */\n\tid: string;\n\t/**\n\t * The name of the group.\n\t */\n\tname: string;\n\t/**\n\t * The description of the group.\n\t */\n\tdescription: string;\n\t/**\n\t * The type of the group.\n\t */\n\ttype: HabboGroupType;\n\t/**\n\t * The unique identifier of the room associated with the group.\n\t */\n\troomId: string;\n\t/**\n\t * The badge code of the group.\n\t */\n\tbadgeCode: string;\n\t/**\n\t * The primary color of the group.\n\t */\n\tprimaryColour: string;\n\t/**\n\t * The secondary color of the group.\n\t */\n\tsecondaryColour: string;\n\t/**\n\t * Indicates whether the user is an admin of the group.\n\t */\n\tisAdmin: boolean;\n}\n\n/**\n * Represents a badge owned by a Habbo user.\n */\nexport interface HabboUserBadge {\n\t/**\n\t * The code of the badge.\n\t */\n\tcode: string;\n\t/**\n\t * The name of the badge.\n\t */\n\tname: string;\n\t/**\n\t * The description of the badge.\n\t */\n\tdescription: string;\n}\n\n/**\n * Represents a selected badge of a Habbo user.\n */\nexport interface HabboUserSelectedBadge extends HabboUserBadge {\n\t/**\n\t * The index of the badge.\n\t */\n\tbadgeIndex: number;\n}\n\n/**\n * Represents a friend of a Habbo user.\n */\nexport interface HabboUserFriend {\n\t/**\n\t * The unique identifier of the friend.\n\t */\n\tuniqueId: string;\n\t/**\n\t * The name of the friend.\n\t */\n\tname: string;\n\t/**\n\t * The figure string of the friend.\n\t */\n\tfigureString: string;\n\t/**\n\t * The motto of the friend.\n\t */\n\tmotto: string;\n\t/**\n\t * Indicates whether the friend is online.\n\t */\n\tonline: boolean;\n}\n\n/**\n * Represents the profile of a Habbo user.\n */\nexport interface HabboUserProfile {\n\t/**\n\t * The unique identifier of the user.\n\t */\n\tuniqueId: string;\n\t/**\n\t * The name of the user.\n\t */\n\tname: string;\n\t/**\n\t * The figure string of the user.\n\t */\n\tfigureString: string;\n\t/**\n\t * The motto of the user.\n\t */\n\tmotto: string;\n\t/**\n\t * Indicates whether the user is online.\n\t */\n\tonline: boolean;\n\t/**\n\t * The last access time of the user.\n\t */\n\tlastAccessTime: string;\n\t/**\n\t * The date when the user became a member.\n\t */\n\tmemberSince: string;\n\t/**\n\t * Indicates whether the user's profile is visible.\n\t */\n\tprofileVisible: boolean;\n\t/**\n\t * The current level of the user.\n\t */\n\tcurrentLevel: number;\n\t/**\n\t * The percentage of the current level completed by the user.\n\t */\n\tcurrentLevelCompletePercent: number;\n\t/**\n\t * The total experience points of the user.\n\t */\n\ttotalExperience: number;\n\t/**\n\t * The number of star gems the user has.\n\t */\n\tstarGemCount: number;\n\t/**\n\t * The badges selected by the user.\n\t */\n\tselectedBadges: HabboUserSelectedBadge[];\n\t/**\n\t * The groups the user is a member of.\n\t */\n\tgroups: HabboUserGroup[];\n\t/**\n\t * The badges owned by the user.\n\t */\n\tbadges: HabboUserBadge[];\n\t/**\n\t * The friends of the user.\n\t */\n\tfriends: HabboUserFriend[];\n\t/**\n\t * The rooms owned by the user.\n\t */\n\trooms: HabboUserRoom[];\n}\n\n/**\n * Represents photos associated with a Habbo user.\n */\nexport interface HabboUserPhotos {\n\t/**\n\t * The unique identifier of the room where the photo was taken.\n\t */\n\troom_id: number;\n\t/**\n\t * The unique identifier of the photo creator.\n\t */\n\tcreator_id: number;\n\t/**\n\t * The name of the photo creator.\n\t */\n\tcreator_name: string;\n\t/**\n\t * The time when the photo was taken.\n\t */\n\ttime: number;\n\t/**\n\t * The version of the photo.\n\t */\n\tversion: number;\n\t/**\n\t * The URL of the photo.\n\t */\n\turl: string;\n\t/**\n\t * The type of the photo.\n\t */\n\ttype: string;\n\t/**\n\t * The unique identifier of the photo creator.\n\t */\n\tcreator_uniqueId: string;\n\t/**\n\t * The tags associated with the photo.\n\t */\n\ttags: string[];\n\t/**\n\t * The URL of the photo preview.\n\t */\n\tpreviewUrl: string;\n\t/**\n\t * The unique identifier of the photo.\n\t */\n\tid: string;\n\t/**\n\t * The likes associated with the photo.\n\t */\n\tlikes: string[];\n}\n\nexport interface HabboFigureName extends HabboFigureBase {\n\t/**\n\t * The Habbo username.\n\t */\n\tuser: string;\n}\n\nexport interface HabboFigureStatic extends HabboFigureBase {\n\t/**\n\t * The Habbo figure to use.\n\t */\n\tfigure: string;\n\t/**\n\t * The Habbo's gender.\n\t */\n\tgender?: keyof typeof HabboFigureGender | undefined | null;\n}\n\nexport interface HabboFigureBase {\n\t/**\n\t * The action the user should perform.\n\t */\n\taction?: keyof typeof HabboFigureAction | undefined | null;\n\t/**\n\t * The hand item, will override {@linkcode HabboFigureBase.action} to `'crr'`.\n\t */\n\thand?: keyof typeof HabboFigureHand | undefined | null;\n\t/**\n\t * The Habbo's direction.\n\t */\n\tdirection?: keyof typeof HabboFigureDirection | undefined | null;\n\t/**\n\t * The Habbo's head direction.\n\t */\n\theadDirection?: keyof typeof HabboFigureDirection | undefined | null;\n\t/**\n\t * The gesture, if any.\n\t */\n\tgesture?: keyof typeof HabboFigureGesture | undefined | null;\n\t/**\n\t * The size of the character.\n\t */\n\tsize?: keyof typeof HabboFigureSize | undefined | null;\n\t/**\n\t * Whether or not to render only the head.\n\t */\n\theadOnly?: boolean | undefined | null;\n}\n\nexport const HabboFigureAction = {\n\t// Main Actions\n\tlay: 'lay',\n\tsit: 'sit',\n\trespect: 'respect',\n\twalk: 'wlk',\n\twave: 'wav',\n\tcarry: 'crr',\n\tdrink: 'drk',\n\tsign: 'sig',\n\tblow: 'blw',\n\tlaugh: 'laugh'\n} as const;\n\nexport const HabboFigureHand = {\n\tnothing: '0',\n\tcarrot: '2',\n\tcoffee: '6',\n\tcocktail: '667',\n\thabbo_cola: '5',\n\tice_cream: '3',\n\tjapanese_tea: '42',\n\tlove_potion: '9',\n\tradioactive: '44',\n\ttomato: '43',\n\twater: '1'\n} as const;\n\nexport const HabboFigureGesture = {\n\tnothing: 'nrm',\n\thappy: 'sml',\n\tsad: 'sad',\n\tangry: 'agr',\n\tsurprised: 'srp',\n\tsleeping: 'eyb',\n\tspeaking: 'spk'\n} as const;\n\nexport const HabboFigureSize = { small: 's', normal: 'm', large: 'l' } as const;\nexport const HabboFigureDirection = { nw: '0', w: '1', sw: '2', s: '3', se: '4', e: '5', ne: '6', n: '7' } as const;\nexport const HabboFigureGender = { male: 'M', female: 'F' } as const;\n\nexport const HabboFigureGestureKeys = Object.keys(HabboFigureGesture) as (keyof typeof HabboFigureGesture)[];\nexport const HabboFigureActionKeys = Object.keys(HabboFigureAction) as (keyof typeof HabboFigureAction)[];\nexport const HabboFigureHandKeys = Object.keys(HabboFigureHand) as (keyof typeof HabboFigureHand)[];\nexport const HabboFigureSizeKeys = Object.keys(HabboFigureSize) as (keyof typeof HabboFigureSize)[];\nexport const HabboFigureDirectionKeys = Object.keys(HabboFigureDirection) as (keyof typeof HabboFigureDirection)[];\nexport const HabboFigureGenderKeys = Object.keys(HabboFigureGender) as (keyof typeof HabboFigureGender)[];\n","import { HotelDomainURL } from './constants.js';\nimport { AchievementsAPI } from './routes/achievements.js';\nimport { GroupsAPI } from './routes/groups.js';\nimport { ListsAPI } from './routes/lists.js';\nimport { MarketplaceAPI } from './routes/marketplace.js';\nimport { PingAPI } from './routes/ping.js';\nimport { RoomsAPI } from './routes/rooms.js';\nimport { UsersAPI } from './routes/users.js';\n\nexport class Habbo {\n\tpublic readonly achievements: AchievementsAPI;\n\tpublic readonly groups: GroupsAPI;\n\tpublic readonly lists: ListsAPI;\n\tpublic readonly marketplace: MarketplaceAPI;\n\tpublic readonly ping: PingAPI;\n\tpublic readonly rooms: RoomsAPI;\n\tpublic readonly users: UsersAPI;\n\n\tpublic constructor(options?: HabboOptions) {\n\t\tconst baseURL = options?.baseURL ?? HotelDomainURL.International;\n\t\tconst timeout = options?.timeout ?? null;\n\n\t\tthis.achievements = new AchievementsAPI(baseURL, timeout);\n\t\tthis.groups = new GroupsAPI(baseURL, timeout);\n\t\tthis.lists = new ListsAPI(baseURL, timeout);\n\t\tthis.marketplace = new MarketplaceAPI(baseURL, timeout);\n\t\tthis.ping = new PingAPI(baseURL, timeout);\n\t\tthis.rooms = new RoomsAPI(baseURL, timeout);\n\t\tthis.users = new UsersAPI(baseURL, timeout);\n\t}\n}\n\nexport interface HabboOptions {\n\tbaseURL?: string | null | undefined;\n\ttimeout?: number | null | undefined;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/constants.ts","../../src/routes/base.ts","../../src/routes/achievements.ts","../../src/common.ts","../../src/routes/groups.ts","../../src/routes/lists.ts","../../src/routes/marketplace.ts","../../src/routes/ping.ts","../../src/routes/rooms.ts","../../src/routes/users.ts","../../src/habbo.ts"],"names":["HotelDomainTLD","safeFetch","Json","AchievementDataState","HabboGroupType"],"mappings":";;;;;;;;AAAY,IAAA,cAAA,qBAAAA,eAAL,KAAA;AACN,EAAAA,gBAAA,WAAY,CAAA,GAAA,SAAA;AACZ,EAAAA,gBAAA,QAAS,CAAA,GAAA,KAAA;AACT,EAAAA,gBAAA,OAAQ,CAAA,GAAA,KAAA;AACR,EAAAA,gBAAA,SAAU,CAAA,GAAA,KAAA;AACV,EAAAA,gBAAA,QAAS,CAAA,GAAA,KAAA;AACT,EAAAA,gBAAA,QAAS,CAAA,GAAA,KAAA;AACT,EAAAA,gBAAA,eAAgB,CAAA,GAAA,MAAA;AAChB,EAAAA,gBAAA,SAAU,CAAA,GAAA,KAAA;AACV,EAAAA,gBAAA,SAAU,CAAA,GAAA,KAAA;AACV,EAAAA,gBAAA,SAAU,CAAA,GAAA,SAAA;AAVC,EAAAA,OAAAA,eAAAA;AAAA,CAAA,EAAA,cAAA,IAAA,EAAA;AAaL,IAAM,cAAiB,GAAA;AAAA,EAC7B,SAAA,EAAW,oBAAoB,SAAwB,iBAAA,CAAA;AAAA,EACvD,MAAA,EAAQ,oBAAoB,KAAqB,cAAA,CAAA;AAAA,EACjD,KAAA,EAAO,oBAAoB,KAAoB,aAAA,CAAA;AAAA,EAC/C,OAAA,EAAS,oBAAoB,KAAsB,eAAA,CAAA;AAAA,EACnD,MAAA,EAAQ,oBAAoB,KAAqB,cAAA,CAAA;AAAA,EACjD,MAAA,EAAQ,oBAAoB,KAAqB,cAAA,CAAA;AAAA,EACjD,aAAA,EAAe,oBAAoB,MAA4B,qBAAA,CAAA;A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nB;AASmB,IAAA,MAAA,CAAA,IAAA,EAAA,OAAA,CAAA;AAAA;AAAA,EACF,YAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EAET,YAAY,OAAwB,EAAA;AAC1C,IAAM,MAAA,OAAA,GAAU,OAAS,EAAA,OAAA,IAAW,cAAe,CAAA,aAAA;AACnD,IAAM,MAAA,OAAA,GAAU,SAAS,OAAW,IAAA,IAAA;AAEpC,IAAA,IAAA,CAAK,YAAe,GAAA,IAAI,eAAgB,CAAA,OAAA,EAAS,OAAO,CAAA;AACxD,IAAA,IAAA,CAAK,MAAS,GAAA,IAAI,SAAU,CAAA,OAAA,EAAS,OAAO,CAAA;AAC5C,IAAA,IAAA,CAAK,KAAQ,GAAA,IAAI,QAAS,CAAA,OAAA,EAAS,OAAO,CAAA;AAC1C,IAAA,IAAA,CAAK,WAAc,GAAA,IAAI,cAAe,CAAA,OAAA,EAAS,OAAO,CAAA;AACtD,IAAA,IAAA,CAAK,IAAO,GAAA,IAAI,OAAQ,CAAA,OAAA,EAAS,OAAO,CAAA;AACxC,IAAA,IAAA,CAAK,KAAQ,GAAA,IAAI,QAAS,CAAA,OAAA,EAAS,OAAO,CAAA;AAC1C,IAAA,IAAA,CAAK,KAAQ,GAAA,IAAI,QAAS,CAAA,OAAA,EAAS,OAAO,CAAA;AAAA;AAE5C","file":"index.cjs","sourcesContent":["export enum HotelDomainTLD {\n\tBrazilian = '.com.br',\n\tDanish = '.dk',\n\tDutch = '.nl',\n\tFinnish = '.fi',\n\tFrench = '.fr',\n\tGerman = '.de',\n\tInternational = '.com',\n\tItalian = '.it',\n\tSpanish = '.es',\n\tTurkish = '.com.tr'\n}\n\nexport const HotelDomainURL = {\n\tBrazilian: `https://www.habbo${HotelDomainTLD.Brazilian}`,\n\tDanish: `https://www.habbo${HotelDomainTLD.Danish}`,\n\tDutch: `https://www.habbo${HotelDomainTLD.Dutch}`,\n\tFinnish: `https://www.habbo${HotelDomainTLD.Finnish}`,\n\tFrench: `https://www.habbo${HotelDomainTLD.French}`,\n\tGerman: `https://www.habbo${HotelDomainTLD.German}`,\n\tInternational: `https://www.habbo${HotelDomainTLD.International}`,\n\tItalian: `https://www.habbo${HotelDomainTLD.Italian}`,\n\tSpanish: `https://www.habbo${HotelDomainTLD.Spanish}`,\n\tTurkish: `https://www.habbo${HotelDomainTLD.Turkish}`\n} as const;\n","import { safeFetch, type FetchResult } from '@skyra/safe-fetch';\n\nexport abstract class BaseAPI {\n\tprotected readonly baseURL: string;\n\tprotected readonly timeout: number | null;\n\n\tpublic constructor(baseURL: string, timeout?: number | null | undefined) {\n\t\tthis.baseURL = baseURL;\n\t\tthis.timeout = timeout ?? null;\n\t}\n\n\tprotected formatURL(route: string): URL {\n\t\treturn new URL(route, this.baseURL);\n\t}\n\n\tprotected fetch(url: string | URL, options?: APIOptions): Promise<FetchResult<Response>> {\n\t\treturn safeFetch(url, { headers: { 'Content-Type': 'application/json' }, signal: this.#getSignalOrDefault(options) });\n\t}\n\n\t#getSignalOrDefault(options?: APIOptions): AbortSignal | null {\n\t\tif (typeof options === 'object' && options !== null) {\n\t\t\tif (typeof options.signal === 'number') return AbortSignal.timeout(options.signal);\n\t\t\tif (typeof options.signal === 'object' && options.signal !== null) return options.signal;\n\t\t}\n\n\t\tif (typeof this.timeout === 'number') return AbortSignal.timeout(this.timeout);\n\t\treturn null;\n\t}\n}\n\nexport interface APIOptions {\n\tsignal?: AbortSignal | number | null | undefined;\n}\n","import { Json, type FetchResult } from '@skyra/safe-fetch';\nimport { BaseAPI, type APIOptions } from './base.js';\nimport type { HabboUserId } from './users.js';\n\nexport class AchievementsAPI extends BaseAPI {\n\t/**\n\t * Get all achievements\n\t *\n\t * @param options - The options for the API call\n\t */\n\tpublic getAll(options?: APIOptions): Promise<FetchResult<Achievement[]>> {\n\t\tconst url = this.formatURL('/api/public/achievements');\n\t\treturn Json<Achievement[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get the achievements from a specified user ID\n\t *\n\t * @param id - The ID of the user\n\t * @param options - The options for the API call\n\t */\n\tpublic getByUserId(id: HabboUserId, options?: APIOptions): Promise<FetchResult<UserAchievement[]>> {\n\t\tconst url = this.formatURL(`/api/public/achievements/${id}`);\n\t\treturn Json<UserAchievement[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get the image URL for an achievement\n\t *\n\t * @param achievementName - The name of the achievement, retrieved from {@linkcode AchievementData.name}\n\t *\n\t * @unstable This feature is not documented, use at your own risk\n\t */\n\tpublic getImageURL(achievementName: string): URL {\n\t\treturn new URL(`https://images.habbo.com/c_images/album1584/${achievementName}.png`);\n\t}\n}\n\nexport interface Achievement {\n\tachievement: AchievementData;\n\tlevelRequirements: AchievementRequirements;\n}\n\nexport interface UserAchievement {\n\tachievement: AchievementData;\n\tlevel: number;\n\tscore: number;\n}\n\nexport interface AchievementData {\n\tid: number;\n\tname: string;\n\tcreationTime: `${bigint}-${bigint}-${bigint}`;\n\tstate: AchievementDataState;\n\tcategory: string;\n}\n\nexport enum AchievementDataState {\n\tEnabled = 'ENABLED',\n\tArchived = 'ARCHIVED',\n\tOffSeason = 'OFF_SEASON'\n}\n\nexport interface AchievementRequirements {\n\tlevel: number;\n\trequiredScore: number;\n}\n","export function isNullish(value: unknown): value is null | undefined {\n\treturn value == null;\n}\n","import { Json, type FetchResult } from '@skyra/safe-fetch';\nimport { isNullish } from '../common.js';\nimport { BaseAPI, type APIOptions } from './base.js';\nimport type { HabboRoomUniqueId } from './rooms.js';\n\nexport class GroupsAPI extends BaseAPI {\n\t/**\n\t * Get the data for a group given its identifier\n\t *\n\t * @param id - The ID of the group\n\t * @param options - The options for the API call\n\t */\n\tpublic getByUniqueId(id: HabboGroupId, options?: APIOptions): Promise<FetchResult<HabboGroup>> {\n\t\tconst url = this.formatURL(`/api/public/groups/${id}`);\n\t\treturn Json<HabboGroup>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get the members from a group given its identifier\n\t *\n\t * @param id - The ID of the group\n\t * @param options - The options for the API call\n\t */\n\tpublic getGroupMembers(id: HabboGroupId, options?: GetGroupMembersOptions): Promise<FetchResult<HabboGroupMember[]>> {\n\t\tconst url = this.formatURL(`/api/public/groups/${id}/members`);\n\t\tif (!isNullish(options?.pageIndex)) {\n\t\t\turl.searchParams.append('pageIndex', options.pageIndex.toString());\n\t\t}\n\n\t\treturn Json<HabboGroupMember[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get the image URL for a badge\n\t *\n\t * @param badgeCode - The badge's code, retrieved from {@linkcode HabboGroup.badgeCode}\n\t *\n\t * @unstable This feature is not documented, use at your own risk\n\t */\n\tpublic getGroupBadgeImageURL(badgeCode: string): URL {\n\t\treturn this.formatURL(`/habbo-imaging/badge/${badgeCode}`);\n\t}\n}\n\n/**\n * The options for {@linkcode GroupsAPI.getGroupMembers}.\n */\nexport interface GetGroupMembersOptions extends APIOptions {\n\t/**\n\t * The page index to look for, each page containing up to 1000 entries.\n\t */\n\tpageIndex?: number | null | undefined;\n}\n\nexport type HabboGroupId = `g-hh${string}-${string};`;\n\n/**\n * Represents a Habbo group.\n */\nexport interface HabboGroup {\n\t/**\n\t * The unique identifier of the group.\n\t */\n\tid: HabboGroupId;\n\n\t/**\n\t * The name of the group.\n\t */\n\tname: string;\n\n\t/**\n\t * The description of the group.\n\t */\n\tdescription: string;\n\n\t/**\n\t * The type of the group.\n\t */\n\ttype: HabboGroupType;\n\n\t/**\n\t * The ID of the room associated with the group, or null if no room is associated.\n\t */\n\troomId: HabboRoomUniqueId;\n\n\t/**\n\t * The badge code of the group.\n\t */\n\tbadgeCode: string;\n}\n\n/**\n * Enum representing the type of a Habbo group.\n */\nexport enum HabboGroupType {\n\t/**\n\t * A normal group (public).\n\t */\n\tNORMAL = 'NORMAL',\n\n\t/**\n\t * A favourite (exclusive) group.\n\t */\n\tFAVOURITE = 'EXCLUSIVE',\n\n\t/**\n\t * A private (closed) group.\n\t */\n\tPRIVATE = 'CLOSED'\n}\n\n/**\n * Represents a member of a Habbo group.\n */\nexport interface HabboGroupMember {\n\t/**\n\t * Indicates whether the member is online.\n\t */\n\tonline: boolean;\n\n\t/**\n\t * The gender of the member.\n\t */\n\tgender: 'm' | 'f';\n\n\t/**\n\t * The motto of the member.\n\t */\n\tmotto: string;\n\n\t/**\n\t * The figure of the member in the Habbo world.\n\t */\n\thabboFigure: string;\n\n\t/**\n\t * The date since the member joined the group.\n\t */\n\tmemberSince: string;\n\n\t/**\n\t * The unique identifier of the member.\n\t */\n\tuniqueId: string;\n\n\t/**\n\t * The name of the member.\n\t */\n\tname: string;\n\n\t/**\n\t * Indicates whether the member is an admin of the group.\n\t */\n\tisAdmin: boolean;\n}\n","import { type FetchResult } from '@skyra/safe-fetch';\nimport { BaseAPI, type APIOptions } from './base.js';\n\nexport class ListsAPI extends BaseAPI {\n\t/**\n\t * Get the hot looks from the hotel\n\t *\n\t * @param options - The options for the API call\n\t */\n\tpublic async getHotLooks(options: APIOptions): Promise<FetchResult<HabboHotLookList>> {\n\t\tconst url = this.formatURL('/api/public/lists/hotlooks');\n\t\tconst data = await this.fetch(url, options);\n\t\treturn data.map(async (result) => this.#parseHotLooksXML(await result.text())).intoPromise();\n\t}\n\n\t#parseHotLooksXML(data: string): HabboHotLookList {\n\t\tconst urlResult = /url=\"(.*)\"/.exec(data);\n\t\tif (urlResult === null) throw new SyntaxError('Could not read hot looks');\n\n\t\tconst url = urlResult[1];\n\t\tconst entries = [] as HabboHotLookListItem[];\n\t\tfor (const result of data.matchAll(/gender=\"(\\w)\" figure=\"(.+)\" hash=\"(.+)\"/g)) {\n\t\t\tentries.push({ gender: result[1] as 'f' | 'm', figure: result[2], hash: result[3] });\n\t\t}\n\n\t\tif (entries.length === 0) throw new SyntaxError('Could not read hot looks');\n\n\t\treturn { url, entries };\n\t}\n}\n\nexport interface HabboHotLookList {\n\turl: string;\n\tentries: HabboHotLookListItem[];\n}\n\nexport interface HabboHotLookListItem {\n\tgender: 'f' | 'm';\n\tfigure: string;\n\thash: string;\n}\n","import { Json, type FetchResult } from '@skyra/safe-fetch';\nimport { BaseAPI, type APIOptions } from './base.js';\n\nexport class MarketplaceAPI extends BaseAPI {\n\t/**\n\t * Get the marketplace stats for a room item\n\t *\n\t * @param roomItemName - The name of the room item\n\t * @param options - The options for the API call\n\t */\n\tpublic getRoomItemStats(roomItemName: string, options?: APIOptions): Promise<FetchResult<MarketplaceStats>> {\n\t\tconst url = this.formatURL(`/api/public/marketplace/stats/roomItem/${roomItemName}`);\n\t\treturn Json<MarketplaceStats>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get the marketplace stats for a wall item\n\t *\n\t * @param wallItemName - The name of the wall item\n\t * @param options - The options for the API call\n\t */\n\tpublic getWallItemStats(wallItemName: string, options?: APIOptions): Promise<FetchResult<MarketplaceStats>> {\n\t\tconst url = this.formatURL(`/api/public/marketplace/stats/wallItem/${wallItemName}`);\n\t\treturn Json<MarketplaceStats>(this.fetch(url, options));\n\t}\n}\n\nexport interface MarketplaceStats {\n\thistory: MarketplaceStatsHistory[];\n\tstatsDate: `${bigint}-${bigint}-${bigint}`;\n\tsoldItemCount: number;\n\tcreditSum: number;\n\taveragePrice: number;\n\ttotalOpenOffers: number;\n\thistoryLimitInDays: number;\n}\n\nexport interface MarketplaceStatsHistory {\n\tdayOffset: `${bigint}`;\n\taveragePrice: `${bigint}`;\n\ttotalSoldItems: `${bigint}`;\n\ttotalCreditSum: `${bigint}`;\n\ttotalOpenOffers: `${bigint}`;\n}\n","import { type APIOptions, BaseAPI } from './base.js';\n\nexport class PingAPI extends BaseAPI {\n\t/**\n\t * Pings Habbo, returning the measured time using {@linkcode performance.now()}\n\t *\n\t * @param options - The options for the API call\n\t */\n\tpublic async get(options?: APIOptions): Promise<number | null> {\n\t\tconst url = this.formatURL('/api/public/ping');\n\t\tconst now = performance.now();\n\t\treturn (await this.fetch(url, options)).match({\n\t\t\tok: () => performance.now() - now,\n\t\t\terr: () => null\n\t\t});\n\t}\n}\n","import { type FetchResult, Json } from '@skyra/safe-fetch';\nimport { type APIOptions, BaseAPI } from './base.js';\n\nexport class RoomsAPI extends BaseAPI {\n\t/**\n\t * Get a room by its ID\n\t *\n\t * @param roomId - The ID of the room\n\t * @param options - The options for the API call\n\t */\n\tpublic async getById(roomId: number, options?: APIOptions): Promise<FetchResult<HabboRoom>> {\n\t\tconst url = this.formatURL(`/api/public/rooms/${roomId}`);\n\t\treturn Json<HabboRoom>(this.fetch(url, options));\n\t}\n}\n\nexport interface HabboRoom {\n\tid: number;\n\tname: string;\n\tdescription: string;\n\tcreationTime: `${bigint}-${bigint}-${bigint}T${string}`;\n\thabboGroupId: string;\n\ttags: string[];\n\tmaximumVisitors: number;\n\tshowOwnerName: boolean;\n\townerName: string;\n\townerUniqueId: string;\n\tcategories: string[];\n\tthumbnailUrl: string;\n\timageUrl: string;\n\trating: number;\n\tuniqueId: HabboRoomUniqueId;\n}\n\nexport type HabboRoomUniqueId = `r-hh${string}-${string}`;\n","import { Json, type FetchResult } from '@skyra/safe-fetch';\nimport { isNullish } from '../common.js';\nimport { BaseAPI, type APIOptions } from './base.js';\nimport { HabboGroupType } from './groups.js';\n\nexport class UsersAPI extends BaseAPI {\n\t/**\n\t * Get a user by its username\n\t *\n\t * @param username - The username to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getByUsername(username: string, options?: APIOptions): Promise<FetchResult<HabboUser>> {\n\t\tconst url = this.formatURL('/api/public/users');\n\t\turl.searchParams.set('name', username);\n\t\treturn Json<HabboUser>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user by its ID\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getByUniqueId(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUser>> {\n\t\tconst url = this.formatURL(`/api/public/users/${uniqueId}`);\n\t\treturn Json<HabboUser>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's friends\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getUserFriends(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUserFriend[]>> {\n\t\tconst url = this.formatURL(`/api/public/users/${uniqueId}/friends`);\n\t\treturn Json<HabboUserFriend[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's groups\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getUserGroups(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUserGroup[]>> {\n\t\tconst url = this.formatURL(`/api/public/users/${uniqueId}/groups`);\n\t\treturn Json<HabboUserGroup[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's rooms\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getUserRooms(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUserRoom[]>> {\n\t\tconst url = this.formatURL(`/api/public/users/${uniqueId}/rooms`);\n\t\treturn Json<HabboUserRoom[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's badges\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getUserBadges(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUserBadge[]>> {\n\t\tconst url = this.formatURL(`/api/public/users/${uniqueId}/badges`);\n\t\treturn Json<HabboUserBadge[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's profile\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getUserProfile(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUserProfile>> {\n\t\tconst url = this.formatURL(`/api/public/users/${uniqueId}/profile`);\n\t\treturn Json<HabboUserProfile>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's photos\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getUserPhotos(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUserPhotos[]>> {\n\t\tconst url = this.formatURL(`/extradata/public/users/${uniqueId}/photos`);\n\t\treturn Json<HabboUserPhotos[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's figure\n\t *\n\t * @param options - The options for the image\n\t */\n\tpublic getUserFigureImageURL(options: HabboFigureName | HabboFigureStatic): URL {\n\t\tconst url = this.formatURL('/habbo-imaging/avatarimage');\n\n\t\tif ('figure' in options && !isNullish(options.figure)) {\n\t\t\turl.searchParams.append('figure', options.figure);\n\t\t\tif (!isNullish(options.gender)) url.searchParams.append('gender', HabboFigureGender[options.gender]);\n\t\t} else if ('user' in options && !isNullish(options.user)) {\n\t\t\turl.searchParams.append('user', options.user);\n\t\t} else {\n\t\t\tthrow new Error('You must define `figure` or `user` in the options');\n\t\t}\n\n\t\tif (!isNullish(options.action)) {\n\t\t\tconst habboAction = HabboFigureAction[options.action];\n\t\t\turl.searchParams.append(\n\t\t\t\t'action',\n\t\t\t\tisNullish(options.hand) //\n\t\t\t\t\t? habboAction\n\t\t\t\t\t: `${habboAction}=${HabboFigureHand[options.hand]}`\n\t\t\t);\n\t\t}\n\t\tif (!isNullish(options.direction)) url.searchParams.append('direction', HabboFigureDirection[options.direction]);\n\t\tif (!isNullish(options.headDirection)) url.searchParams.append('head_direction', HabboFigureDirection[options.headDirection]);\n\t\tif (!isNullish(options.gesture)) url.searchParams.append('gesture', HabboFigureGesture[options.gesture]);\n\t\tif (!isNullish(options.size)) url.searchParams.append('size', HabboFigureSize[options.size]);\n\t\tif (!isNullish(options.headOnly)) url.searchParams.append('headonly', options.headOnly ? '1' : '0');\n\n\t\treturn url;\n\t}\n}\n\nexport type HabboUserId = `hh${string}-${string}`;\n\n/**\n * Represents a Habbo user.\n */\nexport interface HabboUser {\n\t/**\n\t * The unique identifier of the user.\n\t */\n\tuniqueId: HabboUserId;\n\t/**\n\t * The name of the user.\n\t */\n\tname: string;\n\t/**\n\t * The figure string of the user.\n\t */\n\tfigureString: string;\n\t/**\n\t * The motto of the user.\n\t */\n\tmotto: string;\n\t/**\n\t * Indicates whether the user is online.\n\t */\n\tonline: boolean;\n\t/**\n\t * The last access time of the user.\n\t */\n\tlastAccessTime: string;\n\t/**\n\t * The date when the user became a member.\n\t */\n\tmemberSince: string;\n\t/**\n\t * Indicates whether the user's profile is visible.\n\t */\n\tprofileVisible: boolean;\n\t/**\n\t * The current level of the user.\n\t */\n\tcurrentLevel: number;\n\t/**\n\t * The percentage of the current level completed by the user.\n\t */\n\tcurrentLevelCompletePercent: number;\n\t/**\n\t * The total experience points of the user.\n\t */\n\ttotalExperience: number;\n\t/**\n\t * The number of star gems the user has.\n\t */\n\tstarGemCount: number;\n\t/**\n\t * The badges selected by the user.\n\t */\n\tselectedBadges: HabboUserSelectedBadge[];\n}\n\n/**\n * Represents a room owned by a Habbo user.\n */\nexport interface HabboUserRoom {\n\t/**\n\t * The unique identifier of the room.\n\t */\n\tid: number;\n\t/**\n\t * The name of the room.\n\t */\n\tname: string;\n\t/**\n\t * The description of the room.\n\t */\n\tdescription: string;\n\t/**\n\t * The creation time of the room.\n\t */\n\tcreationTime: string;\n\t/**\n\t * The unique identifier of the Habbo group associated with the room.\n\t */\n\thabboGroupId: string;\n\t/**\n\t * The tags associated with the room.\n\t */\n\ttags: string[];\n\t/**\n\t * The maximum number of visitors allowed in the room.\n\t */\n\tmaximumVisitors: number;\n\t/**\n\t * Indicates whether the owner's name is shown.\n\t */\n\tshowOwnerName: boolean;\n\t/**\n\t * The name of the room owner.\n\t */\n\townerName: string;\n\t/**\n\t * The unique identifier of the room owner.\n\t */\n\townerUniqueId: string;\n\t/**\n\t * The categories associated with the room.\n\t */\n\tcategories: string[];\n\t/**\n\t * The URL of the room's thumbnail image.\n\t */\n\tthumbnailUrl: string;\n\t/**\n\t * The URL of the room's image.\n\t */\n\timageUrl: string;\n\t/**\n\t * The rating of the room.\n\t */\n\trating: number;\n\t/**\n\t * The unique identifier of the room.\n\t */\n\tuniqueId: string;\n}\n\n/**\n * Represents a group associated with a Habbo user.\n */\nexport interface HabboUserGroup {\n\t/**\n\t * Indicates whether the group is online.\n\t */\n\tonline: boolean;\n\t/**\n\t * The unique identifier of the group.\n\t */\n\tid: string;\n\t/**\n\t * The name of the group.\n\t */\n\tname: string;\n\t/**\n\t * The description of the group.\n\t */\n\tdescription: string;\n\t/**\n\t * The type of the group.\n\t */\n\ttype: HabboGroupType;\n\t/**\n\t * The unique identifier of the room associated with the group.\n\t */\n\troomId: string;\n\t/**\n\t * The badge code of the group.\n\t */\n\tbadgeCode: string;\n\t/**\n\t * The primary color of the group.\n\t */\n\tprimaryColour: string;\n\t/**\n\t * The secondary color of the group.\n\t */\n\tsecondaryColour: string;\n\t/**\n\t * Indicates whether the user is an admin of the group.\n\t */\n\tisAdmin: boolean;\n}\n\n/**\n * Represents a badge owned by a Habbo user.\n */\nexport interface HabboUserBadge {\n\t/**\n\t * The code of the badge.\n\t */\n\tcode: string;\n\t/**\n\t * The name of the badge.\n\t */\n\tname: string;\n\t/**\n\t * The description of the badge.\n\t */\n\tdescription: string;\n}\n\n/**\n * Represents a selected badge of a Habbo user.\n */\nexport interface HabboUserSelectedBadge extends HabboUserBadge {\n\t/**\n\t * The index of the badge.\n\t */\n\tbadgeIndex: number;\n}\n\n/**\n * Represents a friend of a Habbo user.\n */\nexport interface HabboUserFriend {\n\t/**\n\t * The unique identifier of the friend.\n\t */\n\tuniqueId: string;\n\t/**\n\t * The name of the friend.\n\t */\n\tname: string;\n\t/**\n\t * The figure string of the friend.\n\t */\n\tfigureString: string;\n\t/**\n\t * The motto of the friend.\n\t */\n\tmotto: string;\n\t/**\n\t * Indicates whether the friend is online.\n\t */\n\tonline: boolean;\n}\n\n/**\n * Represents the profile of a Habbo user.\n */\nexport interface HabboUserProfile {\n\t/**\n\t * The unique identifier of the user.\n\t */\n\tuniqueId: string;\n\t/**\n\t * The name of the user.\n\t */\n\tname: string;\n\t/**\n\t * The figure string of the user.\n\t */\n\tfigureString: string;\n\t/**\n\t * The motto of the user.\n\t */\n\tmotto: string;\n\t/**\n\t * Indicates whether the user is online.\n\t */\n\tonline: boolean;\n\t/**\n\t * The last access time of the user.\n\t */\n\tlastAccessTime: string;\n\t/**\n\t * The date when the user became a member.\n\t */\n\tmemberSince: string;\n\t/**\n\t * Indicates whether the user's profile is visible.\n\t */\n\tprofileVisible: boolean;\n\t/**\n\t * The current level of the user.\n\t */\n\tcurrentLevel: number;\n\t/**\n\t * The percentage of the current level completed by the user.\n\t */\n\tcurrentLevelCompletePercent: number;\n\t/**\n\t * The total experience points of the user.\n\t */\n\ttotalExperience: number;\n\t/**\n\t * The number of star gems the user has.\n\t */\n\tstarGemCount: number;\n\t/**\n\t * The badges selected by the user.\n\t */\n\tselectedBadges: HabboUserSelectedBadge[];\n\t/**\n\t * The groups the user is a member of.\n\t */\n\tgroups: HabboUserGroup[];\n\t/**\n\t * The badges owned by the user.\n\t */\n\tbadges: HabboUserBadge[];\n\t/**\n\t * The friends of the user.\n\t */\n\tfriends: HabboUserFriend[];\n\t/**\n\t * The rooms owned by the user.\n\t */\n\trooms: HabboUserRoom[];\n}\n\n/**\n * Represents photos associated with a Habbo user.\n */\nexport interface HabboUserPhotos {\n\t/**\n\t * The unique identifier of the room where the photo was taken.\n\t */\n\troom_id: number;\n\t/**\n\t * The unique identifier of the photo creator.\n\t */\n\tcreator_id: number;\n\t/**\n\t * The name of the photo creator.\n\t */\n\tcreator_name: string;\n\t/**\n\t * The time when the photo was taken.\n\t */\n\ttime: number;\n\t/**\n\t * The version of the photo.\n\t */\n\tversion: number;\n\t/**\n\t * The URL of the photo.\n\t */\n\turl: string;\n\t/**\n\t * The type of the photo.\n\t */\n\ttype: string;\n\t/**\n\t * The unique identifier of the photo creator.\n\t */\n\tcreator_uniqueId: string;\n\t/**\n\t * The tags associated with the photo.\n\t */\n\ttags: string[];\n\t/**\n\t * The URL of the photo preview.\n\t */\n\tpreviewUrl: string;\n\t/**\n\t * The unique identifier of the photo.\n\t */\n\tid: string;\n\t/**\n\t * The likes associated with the photo.\n\t */\n\tlikes: string[];\n}\n\nexport interface HabboFigureName extends HabboFigureBase {\n\t/**\n\t * The Habbo username.\n\t */\n\tuser: string;\n}\n\nexport interface HabboFigureStatic extends HabboFigureBase {\n\t/**\n\t * The Habbo figure to use.\n\t */\n\tfigure: string;\n\t/**\n\t * The Habbo's gender.\n\t */\n\tgender?: keyof typeof HabboFigureGender | undefined | null;\n}\n\nexport interface HabboFigureBase {\n\t/**\n\t * The action the user should perform.\n\t */\n\taction?: keyof typeof HabboFigureAction | undefined | null;\n\t/**\n\t * The hand item, will override {@linkcode HabboFigureBase.action} to `'crr'`.\n\t */\n\thand?: keyof typeof HabboFigureHand | undefined | null;\n\t/**\n\t * The Habbo's direction.\n\t */\n\tdirection?: keyof typeof HabboFigureDirection | undefined | null;\n\t/**\n\t * The Habbo's head direction.\n\t */\n\theadDirection?: keyof typeof HabboFigureDirection | undefined | null;\n\t/**\n\t * The gesture, if any.\n\t */\n\tgesture?: keyof typeof HabboFigureGesture | undefined | null;\n\t/**\n\t * The size of the character.\n\t */\n\tsize?: keyof typeof HabboFigureSize | undefined | null;\n\t/**\n\t * Whether or not to render only the head.\n\t */\n\theadOnly?: boolean | undefined | null;\n}\n\nexport const HabboFigureAction = {\n\t// Main Actions\n\tlay: 'lay',\n\tsit: 'sit',\n\trespect: 'respect',\n\twalk: 'wlk',\n\twave: 'wav',\n\tcarry: 'crr',\n\tdrink: 'drk',\n\tsign: 'sig',\n\tblow: 'blw',\n\tlaugh: 'laugh'\n} as const;\n\nexport const HabboFigureHand = {\n\tnothing: '0',\n\tcarrot: '2',\n\tcoffee: '6',\n\tcocktail: '667',\n\thabbo_cola: '5',\n\tice_cream: '3',\n\tjapanese_tea: '42',\n\tlove_potion: '9',\n\tradioactive: '44',\n\ttomato: '43',\n\twater: '1'\n} as const;\n\nexport const HabboFigureGesture = {\n\tnothing: 'nrm',\n\thappy: 'sml',\n\tsad: 'sad',\n\tangry: 'agr',\n\tsurprised: 'srp',\n\tsleeping: 'eyb',\n\tspeaking: 'spk'\n} as const;\n\nexport const HabboFigureSize = { small: 's', normal: 'm', large: 'l' } as const;\nexport const HabboFigureDirection = { nw: '0', w: '1', sw: '2', s: '3', se: '4', e: '5', ne: '6', n: '7' } as const;\nexport const HabboFigureGender = { male: 'M', female: 'F' } as const;\n\nexport const HabboFigureGestureKeys = Object.keys(HabboFigureGesture) as (keyof typeof HabboFigureGesture)[];\nexport const HabboFigureActionKeys = Object.keys(HabboFigureAction) as (keyof typeof HabboFigureAction)[];\nexport const HabboFigureHandKeys = Object.keys(HabboFigureHand) as (keyof typeof HabboFigureHand)[];\nexport const HabboFigureSizeKeys = Object.keys(HabboFigureSize) as (keyof typeof HabboFigureSize)[];\nexport const HabboFigureDirectionKeys = Object.keys(HabboFigureDirection) as (keyof typeof HabboFigureDirection)[];\nexport const HabboFigureGenderKeys = Object.keys(HabboFigureGender) as (keyof typeof HabboFigureGender)[];\n","import { HotelDomainURL } from './constants.js';\nimport { AchievementsAPI } from './routes/achievements.js';\nimport { GroupsAPI } from './routes/groups.js';\nimport { ListsAPI } from './routes/lists.js';\nimport { MarketplaceAPI } from './routes/marketplace.js';\nimport { PingAPI } from './routes/ping.js';\nimport { RoomsAPI } from './routes/rooms.js';\nimport { UsersAPI } from './routes/users.js';\n\nexport class Habbo {\n\tpublic readonly achievements: AchievementsAPI;\n\tpublic readonly groups: GroupsAPI;\n\tpublic readonly lists: ListsAPI;\n\tpublic readonly marketplace: MarketplaceAPI;\n\tpublic readonly ping: PingAPI;\n\tpublic readonly rooms: RoomsAPI;\n\tpublic readonly users: UsersAPI;\n\n\tpublic constructor(options?: HabboOptions) {\n\t\tconst baseURL = options?.baseURL ?? HotelDomainURL.International;\n\t\tconst timeout = options?.timeout ?? null;\n\n\t\tthis.achievements = new AchievementsAPI(baseURL, timeout);\n\t\tthis.groups = new GroupsAPI(baseURL, timeout);\n\t\tthis.lists = new ListsAPI(baseURL, timeout);\n\t\tthis.marketplace = new MarketplaceAPI(baseURL, timeout);\n\t\tthis.ping = new PingAPI(baseURL, timeout);\n\t\tthis.rooms = new RoomsAPI(baseURL, timeout);\n\t\tthis.users = new UsersAPI(baseURL, timeout);\n\t}\n}\n\nexport interface HabboOptions {\n\tbaseURL?: string | null | undefined;\n\ttimeout?: number | null | undefined;\n}\n"]}
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -79,7 +79,7 @@ declare class GroupsAPI extends BaseAPI {
|
|
|
79
79
|
* @param id - The ID of the group
|
|
80
80
|
* @param options - The options for the API call
|
|
81
81
|
*/
|
|
82
|
-
getGroupMembers(id: HabboGroupId, options?:
|
|
82
|
+
getGroupMembers(id: HabboGroupId, options?: GetGroupMembersOptions): Promise<FetchResult<HabboGroupMember[]>>;
|
|
83
83
|
/**
|
|
84
84
|
* Get the image URL for a badge
|
|
85
85
|
*
|
|
@@ -89,6 +89,15 @@ declare class GroupsAPI extends BaseAPI {
|
|
|
89
89
|
*/
|
|
90
90
|
getGroupBadgeImageURL(badgeCode: string): URL;
|
|
91
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* The options for {@linkcode GroupsAPI.getGroupMembers}.
|
|
94
|
+
*/
|
|
95
|
+
interface GetGroupMembersOptions extends APIOptions {
|
|
96
|
+
/**
|
|
97
|
+
* The page index to look for, each page containing up to 1000 entries.
|
|
98
|
+
*/
|
|
99
|
+
pageIndex?: number | null | undefined;
|
|
100
|
+
}
|
|
92
101
|
type HabboGroupId = `g-hh${string}-${string};`;
|
|
93
102
|
/**
|
|
94
103
|
* Represents a Habbo group.
|
|
@@ -814,4 +823,4 @@ interface HabboOptions {
|
|
|
814
823
|
timeout?: number | null | undefined;
|
|
815
824
|
}
|
|
816
825
|
|
|
817
|
-
export { type Achievement, type AchievementData, AchievementDataState, type AchievementRequirements, AchievementsAPI, GroupsAPI, Habbo, HabboFigureAction, HabboFigureActionKeys, type HabboFigureBase, HabboFigureDirection, HabboFigureDirectionKeys, HabboFigureGender, HabboFigureGenderKeys, HabboFigureGesture, HabboFigureGestureKeys, HabboFigureHand, HabboFigureHandKeys, type HabboFigureName, HabboFigureSize, HabboFigureSizeKeys, type HabboFigureStatic, type HabboGroup, type HabboGroupId, type HabboGroupMember, HabboGroupType, type HabboHotLookList, type HabboHotLookListItem, type HabboOptions, type HabboRoom, type HabboRoomUniqueId, type HabboUser, type HabboUserBadge, type HabboUserFriend, type HabboUserGroup, type HabboUserId, type HabboUserPhotos, type HabboUserProfile, type HabboUserRoom, type HabboUserSelectedBadge, HotelDomainTLD, HotelDomainURL, ListsAPI, MarketplaceAPI, type MarketplaceStats, type MarketplaceStatsHistory, PingAPI, RoomsAPI, type UserAchievement, UsersAPI };
|
|
826
|
+
export { type Achievement, type AchievementData, AchievementDataState, type AchievementRequirements, AchievementsAPI, type GetGroupMembersOptions, GroupsAPI, Habbo, HabboFigureAction, HabboFigureActionKeys, type HabboFigureBase, HabboFigureDirection, HabboFigureDirectionKeys, HabboFigureGender, HabboFigureGenderKeys, HabboFigureGesture, HabboFigureGestureKeys, HabboFigureHand, HabboFigureHandKeys, type HabboFigureName, HabboFigureSize, HabboFigureSizeKeys, type HabboFigureStatic, type HabboGroup, type HabboGroupId, type HabboGroupMember, HabboGroupType, type HabboHotLookList, type HabboHotLookListItem, type HabboOptions, type HabboRoom, type HabboRoomUniqueId, type HabboUser, type HabboUserBadge, type HabboUserFriend, type HabboUserGroup, type HabboUserId, type HabboUserPhotos, type HabboUserProfile, type HabboUserRoom, type HabboUserSelectedBadge, HotelDomainTLD, HotelDomainURL, ListsAPI, MarketplaceAPI, type MarketplaceStats, type MarketplaceStatsHistory, PingAPI, RoomsAPI, type UserAchievement, UsersAPI };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -79,7 +79,7 @@ declare class GroupsAPI extends BaseAPI {
|
|
|
79
79
|
* @param id - The ID of the group
|
|
80
80
|
* @param options - The options for the API call
|
|
81
81
|
*/
|
|
82
|
-
getGroupMembers(id: HabboGroupId, options?:
|
|
82
|
+
getGroupMembers(id: HabboGroupId, options?: GetGroupMembersOptions): Promise<FetchResult<HabboGroupMember[]>>;
|
|
83
83
|
/**
|
|
84
84
|
* Get the image URL for a badge
|
|
85
85
|
*
|
|
@@ -89,6 +89,15 @@ declare class GroupsAPI extends BaseAPI {
|
|
|
89
89
|
*/
|
|
90
90
|
getGroupBadgeImageURL(badgeCode: string): URL;
|
|
91
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* The options for {@linkcode GroupsAPI.getGroupMembers}.
|
|
94
|
+
*/
|
|
95
|
+
interface GetGroupMembersOptions extends APIOptions {
|
|
96
|
+
/**
|
|
97
|
+
* The page index to look for, each page containing up to 1000 entries.
|
|
98
|
+
*/
|
|
99
|
+
pageIndex?: number | null | undefined;
|
|
100
|
+
}
|
|
92
101
|
type HabboGroupId = `g-hh${string}-${string};`;
|
|
93
102
|
/**
|
|
94
103
|
* Represents a Habbo group.
|
|
@@ -814,4 +823,4 @@ interface HabboOptions {
|
|
|
814
823
|
timeout?: number | null | undefined;
|
|
815
824
|
}
|
|
816
825
|
|
|
817
|
-
export { type Achievement, type AchievementData, AchievementDataState, type AchievementRequirements, AchievementsAPI, GroupsAPI, Habbo, HabboFigureAction, HabboFigureActionKeys, type HabboFigureBase, HabboFigureDirection, HabboFigureDirectionKeys, HabboFigureGender, HabboFigureGenderKeys, HabboFigureGesture, HabboFigureGestureKeys, HabboFigureHand, HabboFigureHandKeys, type HabboFigureName, HabboFigureSize, HabboFigureSizeKeys, type HabboFigureStatic, type HabboGroup, type HabboGroupId, type HabboGroupMember, HabboGroupType, type HabboHotLookList, type HabboHotLookListItem, type HabboOptions, type HabboRoom, type HabboRoomUniqueId, type HabboUser, type HabboUserBadge, type HabboUserFriend, type HabboUserGroup, type HabboUserId, type HabboUserPhotos, type HabboUserProfile, type HabboUserRoom, type HabboUserSelectedBadge, HotelDomainTLD, HotelDomainURL, ListsAPI, MarketplaceAPI, type MarketplaceStats, type MarketplaceStatsHistory, PingAPI, RoomsAPI, type UserAchievement, UsersAPI };
|
|
826
|
+
export { type Achievement, type AchievementData, AchievementDataState, type AchievementRequirements, AchievementsAPI, type GetGroupMembersOptions, GroupsAPI, Habbo, HabboFigureAction, HabboFigureActionKeys, type HabboFigureBase, HabboFigureDirection, HabboFigureDirectionKeys, HabboFigureGender, HabboFigureGenderKeys, HabboFigureGesture, HabboFigureGestureKeys, HabboFigureHand, HabboFigureHandKeys, type HabboFigureName, HabboFigureSize, HabboFigureSizeKeys, type HabboFigureStatic, type HabboGroup, type HabboGroupId, type HabboGroupMember, HabboGroupType, type HabboHotLookList, type HabboHotLookListItem, type HabboOptions, type HabboRoom, type HabboRoomUniqueId, type HabboUser, type HabboUserBadge, type HabboUserFriend, type HabboUserGroup, type HabboUserId, type HabboUserPhotos, type HabboUserProfile, type HabboUserRoom, type HabboUserSelectedBadge, HotelDomainTLD, HotelDomainURL, ListsAPI, MarketplaceAPI, type MarketplaceStats, type MarketplaceStatsHistory, PingAPI, RoomsAPI, type UserAchievement, UsersAPI };
|
package/dist/esm/index.js
CHANGED
|
@@ -96,6 +96,14 @@ var AchievementDataState = /* @__PURE__ */ ((AchievementDataState2) => {
|
|
|
96
96
|
AchievementDataState2["OffSeason"] = "OFF_SEASON";
|
|
97
97
|
return AchievementDataState2;
|
|
98
98
|
})(AchievementDataState || {});
|
|
99
|
+
|
|
100
|
+
// src/common.ts
|
|
101
|
+
function isNullish(value) {
|
|
102
|
+
return value == null;
|
|
103
|
+
}
|
|
104
|
+
__name(isNullish, "isNullish");
|
|
105
|
+
|
|
106
|
+
// src/routes/groups.ts
|
|
99
107
|
var GroupsAPI = class extends BaseAPI {
|
|
100
108
|
static {
|
|
101
109
|
__name(this, "GroupsAPI");
|
|
@@ -118,6 +126,9 @@ var GroupsAPI = class extends BaseAPI {
|
|
|
118
126
|
*/
|
|
119
127
|
getGroupMembers(id, options) {
|
|
120
128
|
const url = this.formatURL(`/api/public/groups/${id}/members`);
|
|
129
|
+
if (!isNullish(options?.pageIndex)) {
|
|
130
|
+
url.searchParams.append("pageIndex", options.pageIndex.toString());
|
|
131
|
+
}
|
|
121
132
|
return Json(this.fetch(url, options));
|
|
122
133
|
}
|
|
123
134
|
/**
|
|
@@ -223,14 +234,6 @@ var RoomsAPI = class extends BaseAPI {
|
|
|
223
234
|
return Json(this.fetch(url, options));
|
|
224
235
|
}
|
|
225
236
|
};
|
|
226
|
-
|
|
227
|
-
// src/common.ts
|
|
228
|
-
function isNullish(value) {
|
|
229
|
-
return value == null;
|
|
230
|
-
}
|
|
231
|
-
__name(isNullish, "isNullish");
|
|
232
|
-
|
|
233
|
-
// src/routes/users.ts
|
|
234
237
|
var UsersAPI = class extends BaseAPI {
|
|
235
238
|
static {
|
|
236
239
|
__name(this, "UsersAPI");
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/constants.ts","../../src/routes/base.ts","../../src/routes/achievements.ts","../../src/routes/groups.ts","../../src/routes/lists.ts","../../src/routes/marketplace.ts","../../src/routes/ping.ts","../../src/routes/rooms.ts","../../src/common.ts","../../src/routes/users.ts","../../src/habbo.ts"],"names":["HotelDomainTLD","AchievementDataState","Json","HabboGroupType"],"mappings":";;;;;;AAAY,IAAA,cAAA,qBAAAA,eAAL,KAAA;AACN,EAAAA,gBAAA,WAAY,CAAA,GAAA,SAAA;AACZ,EAAAA,gBAAA,QAAS,CAAA,GAAA,KAAA;AACT,EAAAA,gBAAA,OAAQ,CAAA,GAAA,KAAA;AACR,EAAAA,gBAAA,SAAU,CAAA,GAAA,KAAA;AACV,EAAAA,gBAAA,QAAS,CAAA,GAAA,KAAA;AACT,EAAAA,gBAAA,QAAS,CAAA,GAAA,KAAA;AACT,EAAAA,gBAAA,eAAgB,CAAA,GAAA,MAAA;AAChB,EAAAA,gBAAA,SAAU,C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KAAQ,GAAA,IAAI,QAAS,CAAA,OAAA,EAAS,OAAO,CAAA;AAAA;AAE5C","file":"index.js","sourcesContent":["export enum HotelDomainTLD {\n\tBrazilian = '.com.br',\n\tDanish = '.dk',\n\tDutch = '.nl',\n\tFinnish = '.fi',\n\tFrench = '.fr',\n\tGerman = '.de',\n\tInternational = '.com',\n\tItalian = '.it',\n\tSpanish = '.es',\n\tTurkish = '.com.tr'\n}\n\nexport const HotelDomainURL = {\n\tBrazilian: `https://www.habbo${HotelDomainTLD.Brazilian}`,\n\tDanish: `https://www.habbo${HotelDomainTLD.Danish}`,\n\tDutch: `https://www.habbo${HotelDomainTLD.Dutch}`,\n\tFinnish: `https://www.habbo${HotelDomainTLD.Finnish}`,\n\tFrench: `https://www.habbo${HotelDomainTLD.French}`,\n\tGerman: `https://www.habbo${HotelDomainTLD.German}`,\n\tInternational: `https://www.habbo${HotelDomainTLD.International}`,\n\tItalian: `https://www.habbo${HotelDomainTLD.Italian}`,\n\tSpanish: `https://www.habbo${HotelDomainTLD.Spanish}`,\n\tTurkish: `https://www.habbo${HotelDomainTLD.Turkish}`\n} as const;\n","import { safeFetch, type FetchResult } from '@skyra/safe-fetch';\n\nexport abstract class BaseAPI {\n\tprotected readonly baseURL: string;\n\tprotected readonly timeout: number | null;\n\n\tpublic constructor(baseURL: string, timeout?: number | null | undefined) {\n\t\tthis.baseURL = baseURL;\n\t\tthis.timeout = timeout ?? null;\n\t}\n\n\tprotected formatURL(route: string): URL {\n\t\treturn new URL(route, this.baseURL);\n\t}\n\n\tprotected fetch(url: string | URL, options?: APIOptions): Promise<FetchResult<Response>> {\n\t\treturn safeFetch(url, { headers: { 'Content-Type': 'application/json' }, signal: this.#getSignalOrDefault(options) });\n\t}\n\n\t#getSignalOrDefault(options?: APIOptions): AbortSignal | null {\n\t\tif (typeof options === 'object' && options !== null) {\n\t\t\tif (typeof options.signal === 'number') return AbortSignal.timeout(options.signal);\n\t\t\tif (typeof options.signal === 'object' && options.signal !== null) return options.signal;\n\t\t}\n\n\t\tif (typeof this.timeout === 'number') return AbortSignal.timeout(this.timeout);\n\t\treturn null;\n\t}\n}\n\nexport interface APIOptions {\n\tsignal?: AbortSignal | number | null | undefined;\n}\n","import { Json, type FetchResult } from '@skyra/safe-fetch';\nimport { BaseAPI, type APIOptions } from './base.js';\nimport type { HabboUserId } from './users.js';\n\nexport class AchievementsAPI extends BaseAPI {\n\t/**\n\t * Get all achievements\n\t *\n\t * @param options - The options for the API call\n\t */\n\tpublic getAll(options?: APIOptions): Promise<FetchResult<Achievement[]>> {\n\t\tconst url = this.formatURL('/api/public/achievements');\n\t\treturn Json<Achievement[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get the achievements from a specified user ID\n\t *\n\t * @param id - The ID of the user\n\t * @param options - The options for the API call\n\t */\n\tpublic getByUserId(id: HabboUserId, options?: APIOptions): Promise<FetchResult<UserAchievement[]>> {\n\t\tconst url = this.formatURL(`/api/public/achievements/${id}`);\n\t\treturn Json<UserAchievement[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get the image URL for an achievement\n\t *\n\t * @param achievementName - The name of the achievement, retrieved from {@linkcode AchievementData.name}\n\t *\n\t * @unstable This feature is not documented, use at your own risk\n\t */\n\tpublic getImageURL(achievementName: string): URL {\n\t\treturn new URL(`https://images.habbo.com/c_images/album1584/${achievementName}.png`);\n\t}\n}\n\nexport interface Achievement {\n\tachievement: AchievementData;\n\tlevelRequirements: AchievementRequirements;\n}\n\nexport interface UserAchievement {\n\tachievement: AchievementData;\n\tlevel: number;\n\tscore: number;\n}\n\nexport interface AchievementData {\n\tid: number;\n\tname: string;\n\tcreationTime: `${bigint}-${bigint}-${bigint}`;\n\tstate: AchievementDataState;\n\tcategory: string;\n}\n\nexport enum AchievementDataState {\n\tEnabled = 'ENABLED',\n\tArchived = 'ARCHIVED',\n\tOffSeason = 'OFF_SEASON'\n}\n\nexport interface AchievementRequirements {\n\tlevel: number;\n\trequiredScore: number;\n}\n","import { Json, type FetchResult } from '@skyra/safe-fetch';\nimport { BaseAPI, type APIOptions } from './base.js';\nimport type { HabboRoomUniqueId } from './rooms.js';\n\nexport class GroupsAPI extends BaseAPI {\n\t/**\n\t * Get the data for a group given its identifier\n\t *\n\t * @param id - The ID of the group\n\t * @param options - The options for the API call\n\t */\n\tpublic getByUniqueId(id: HabboGroupId, options?: APIOptions): Promise<FetchResult<HabboGroup>> {\n\t\tconst url = this.formatURL(`/api/public/groups/${id}`);\n\t\treturn Json<HabboGroup>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get the members from a group given its identifier\n\t *\n\t * @param id - The ID of the group\n\t * @param options - The options for the API call\n\t */\n\tpublic getGroupMembers(id: HabboGroupId, options?: APIOptions): Promise<FetchResult<HabboGroupMember[]>> {\n\t\tconst url = this.formatURL(`/api/public/groups/${id}/members`);\n\t\treturn Json<HabboGroupMember[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get the image URL for a badge\n\t *\n\t * @param badgeCode - The badge's code, retrieved from {@linkcode HabboGroup.badgeCode}\n\t *\n\t * @unstable This feature is not documented, use at your own risk\n\t */\n\tpublic getGroupBadgeImageURL(badgeCode: string): URL {\n\t\treturn this.formatURL(`/habbo-imaging/badge/${badgeCode}`);\n\t}\n}\n\nexport type HabboGroupId = `g-hh${string}-${string};`\n\n/**\n * Represents a Habbo group.\n */\nexport interface HabboGroup {\n\t/**\n\t * The unique identifier of the group.\n\t */\n\tid: HabboGroupId;\n\n\t/**\n\t * The name of the group.\n\t */\n\tname: string;\n\n\t/**\n\t * The description of the group.\n\t */\n\tdescription: string;\n\n\t/**\n\t * The type of the group.\n\t */\n\ttype: HabboGroupType;\n\n\t/**\n\t * The ID of the room associated with the group, or null if no room is associated.\n\t */\n\troomId: HabboRoomUniqueId;\n\n\t/**\n\t * The badge code of the group.\n\t */\n\tbadgeCode: string;\n}\n\n/**\n * Enum representing the type of a Habbo group.\n */\nexport enum HabboGroupType {\n\t/**\n\t * A normal group (public).\n\t */\n\tNORMAL = 'NORMAL',\n\n\t/**\n\t * A favourite (exclusive) group.\n\t */\n\tFAVOURITE = 'EXCLUSIVE',\n\n\t/**\n\t * A private (closed) group.\n\t */\n\tPRIVATE = 'CLOSED'\n}\n\n/**\n * Represents a member of a Habbo group.\n */\nexport interface HabboGroupMember {\n\t/**\n\t * Indicates whether the member is online.\n\t */\n\tonline: boolean;\n\n\t/**\n\t * The gender of the member.\n\t */\n\tgender: 'm' | 'f';\n\n\t/**\n\t * The motto of the member.\n\t */\n\tmotto: string;\n\n\t/**\n\t * The figure of the member in the Habbo world.\n\t */\n\thabboFigure: string;\n\n\t/**\n\t * The date since the member joined the group.\n\t */\n\tmemberSince: string;\n\n\t/**\n\t * The unique identifier of the member.\n\t */\n\tuniqueId: string;\n\n\t/**\n\t * The name of the member.\n\t */\n\tname: string;\n\n\t/**\n\t * Indicates whether the member is an admin of the group.\n\t */\n\tisAdmin: boolean;\n}\n","import { type FetchResult } from '@skyra/safe-fetch';\nimport { BaseAPI, type APIOptions } from './base.js';\n\nexport class ListsAPI extends BaseAPI {\n\t/**\n\t * Get the hot looks from the hotel\n\t *\n\t * @param options - The options for the API call\n\t */\n\tpublic async getHotLooks(options: APIOptions): Promise<FetchResult<HabboHotLookList>> {\n\t\tconst url = this.formatURL('/api/public/lists/hotlooks');\n\t\tconst data = await this.fetch(url, options);\n\t\treturn data.map(async (result) => this.#parseHotLooksXML(await result.text())).intoPromise();\n\t}\n\n\t#parseHotLooksXML(data: string): HabboHotLookList {\n\t\tconst urlResult = /url=\"(.*)\"/.exec(data);\n\t\tif (urlResult === null) throw new SyntaxError('Could not read hot looks');\n\n\t\tconst url = urlResult[1];\n\t\tconst entries = [] as HabboHotLookListItem[];\n\t\tfor (const result of data.matchAll(/gender=\"(\\w)\" figure=\"(.+)\" hash=\"(.+)\"/g)) {\n\t\t\tentries.push({ gender: result[1] as 'f' | 'm', figure: result[2], hash: result[3] });\n\t\t}\n\n\t\tif (entries.length === 0) throw new SyntaxError('Could not read hot looks');\n\n\t\treturn { url, entries };\n\t}\n}\n\nexport interface HabboHotLookList {\n\turl: string;\n\tentries: HabboHotLookListItem[];\n}\n\nexport interface HabboHotLookListItem {\n\tgender: 'f' | 'm';\n\tfigure: string;\n\thash: string;\n}\n","import { Json, type FetchResult } from '@skyra/safe-fetch';\nimport { BaseAPI, type APIOptions } from './base.js';\n\nexport class MarketplaceAPI extends BaseAPI {\n\t/**\n\t * Get the marketplace stats for a room item\n\t *\n\t * @param roomItemName - The name of the room item\n\t * @param options - The options for the API call\n\t */\n\tpublic getRoomItemStats(roomItemName: string, options?: APIOptions): Promise<FetchResult<MarketplaceStats>> {\n\t\tconst url = this.formatURL(`/api/public/marketplace/stats/roomItem/${roomItemName}`);\n\t\treturn Json<MarketplaceStats>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get the marketplace stats for a wall item\n\t *\n\t * @param wallItemName - The name of the wall item\n\t * @param options - The options for the API call\n\t */\n\tpublic getWallItemStats(wallItemName: string, options?: APIOptions): Promise<FetchResult<MarketplaceStats>> {\n\t\tconst url = this.formatURL(`/api/public/marketplace/stats/wallItem/${wallItemName}`);\n\t\treturn Json<MarketplaceStats>(this.fetch(url, options));\n\t}\n}\n\nexport interface MarketplaceStats {\n\thistory: MarketplaceStatsHistory[];\n\tstatsDate: `${bigint}-${bigint}-${bigint}`;\n\tsoldItemCount: number;\n\tcreditSum: number;\n\taveragePrice: number;\n\ttotalOpenOffers: number;\n\thistoryLimitInDays: number;\n}\n\nexport interface MarketplaceStatsHistory {\n\tdayOffset: `${bigint}`;\n\taveragePrice: `${bigint}`;\n\ttotalSoldItems: `${bigint}`;\n\ttotalCreditSum: `${bigint}`;\n\ttotalOpenOffers: `${bigint}`;\n}\n","import { type APIOptions, BaseAPI } from './base.js';\n\nexport class PingAPI extends BaseAPI {\n\t/**\n\t * Pings Habbo, returning the measured time using {@linkcode performance.now()}\n\t *\n\t * @param options - The options for the API call\n\t */\n\tpublic async get(options?: APIOptions): Promise<number | null> {\n\t\tconst url = this.formatURL('/api/public/ping');\n\t\tconst now = performance.now();\n\t\treturn (await this.fetch(url, options)).match({\n\t\t\tok: () => performance.now() - now,\n\t\t\terr: () => null\n\t\t});\n\t}\n}\n","import { type FetchResult, Json } from '@skyra/safe-fetch';\nimport { type APIOptions, BaseAPI } from './base.js';\n\nexport class RoomsAPI extends BaseAPI {\n\t/**\n\t * Get a room by its ID\n\t *\n\t * @param roomId - The ID of the room\n\t * @param options - The options for the API call\n\t */\n\tpublic async getById(roomId: number, options?: APIOptions): Promise<FetchResult<HabboRoom>> {\n\t\tconst url = this.formatURL(`/api/public/rooms/${roomId}`);\n\t\treturn Json<HabboRoom>(this.fetch(url, options));\n\t}\n}\n\nexport interface HabboRoom {\n\tid: number;\n\tname: string;\n\tdescription: string;\n\tcreationTime: `${bigint}-${bigint}-${bigint}T${string}`;\n\thabboGroupId: string;\n\ttags: string[];\n\tmaximumVisitors: number;\n\tshowOwnerName: boolean;\n\townerName: string;\n\townerUniqueId: string;\n\tcategories: string[];\n\tthumbnailUrl: string;\n\timageUrl: string;\n\trating: number;\n\tuniqueId: HabboRoomUniqueId;\n}\n\nexport type HabboRoomUniqueId = `r-hh${string}-${string}`;\n","export function isNullish(value: unknown): value is null | undefined {\n\treturn value == null;\n}\n","import { Json, type FetchResult } from '@skyra/safe-fetch';\nimport { isNullish } from '../common.js';\nimport { BaseAPI, type APIOptions } from './base.js';\nimport { HabboGroupType } from './groups.js';\n\nexport class UsersAPI extends BaseAPI {\n\t/**\n\t * Get a user by its username\n\t *\n\t * @param username - The username to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getByUsername(username: string, options?: APIOptions): Promise<FetchResult<HabboUser>> {\n\t\tconst url = this.formatURL('/api/public/users');\n\t\turl.searchParams.set('name', username);\n\t\treturn Json<HabboUser>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user by its ID\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getByUniqueId(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUser>> {\n\t\tconst url = this.formatURL(`/api/public/users/${uniqueId}`);\n\t\treturn Json<HabboUser>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's friends\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getUserFriends(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUserFriend[]>> {\n\t\tconst url = this.formatURL(`/api/public/users/${uniqueId}/friends`);\n\t\treturn Json<HabboUserFriend[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's groups\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getUserGroups(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUserGroup[]>> {\n\t\tconst url = this.formatURL(`/api/public/users/${uniqueId}/groups`);\n\t\treturn Json<HabboUserGroup[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's rooms\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getUserRooms(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUserRoom[]>> {\n\t\tconst url = this.formatURL(`/api/public/users/${uniqueId}/rooms`);\n\t\treturn Json<HabboUserRoom[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's badges\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getUserBadges(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUserBadge[]>> {\n\t\tconst url = this.formatURL(`/api/public/users/${uniqueId}/badges`);\n\t\treturn Json<HabboUserBadge[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's profile\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getUserProfile(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUserProfile>> {\n\t\tconst url = this.formatURL(`/api/public/users/${uniqueId}/profile`);\n\t\treturn Json<HabboUserProfile>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's photos\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getUserPhotos(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUserPhotos[]>> {\n\t\tconst url = this.formatURL(`/extradata/public/users/${uniqueId}/photos`);\n\t\treturn Json<HabboUserPhotos[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's figure\n\t *\n\t * @param options - The options for the image\n\t */\n\tpublic getUserFigureImageURL(options: HabboFigureName | HabboFigureStatic): URL {\n\t\tconst url = this.formatURL('/habbo-imaging/avatarimage');\n\n\t\tif ('figure' in options && !isNullish(options.figure)) {\n\t\t\turl.searchParams.append('figure', options.figure);\n\t\t\tif (!isNullish(options.gender)) url.searchParams.append('gender', HabboFigureGender[options.gender]);\n\t\t} else if ('user' in options && !isNullish(options.user)) {\n\t\t\turl.searchParams.append('user', options.user);\n\t\t} else {\n\t\t\tthrow new Error('You must define `figure` or `user` in the options');\n\t\t}\n\n\t\tif (!isNullish(options.action)) {\n\t\t\tconst habboAction = HabboFigureAction[options.action];\n\t\t\turl.searchParams.append(\n\t\t\t\t'action',\n\t\t\t\tisNullish(options.hand) //\n\t\t\t\t\t? habboAction\n\t\t\t\t\t: `${habboAction}=${HabboFigureHand[options.hand]}`\n\t\t\t);\n\t\t}\n\t\tif (!isNullish(options.direction)) url.searchParams.append('direction', HabboFigureDirection[options.direction]);\n\t\tif (!isNullish(options.headDirection)) url.searchParams.append('head_direction', HabboFigureDirection[options.headDirection]);\n\t\tif (!isNullish(options.gesture)) url.searchParams.append('gesture', HabboFigureGesture[options.gesture]);\n\t\tif (!isNullish(options.size)) url.searchParams.append('size', HabboFigureSize[options.size]);\n\t\tif (!isNullish(options.headOnly)) url.searchParams.append('headonly', options.headOnly ? '1' : '0');\n\n\t\treturn url;\n\t}\n}\n\nexport type HabboUserId = `hh${string}-${string}`;\n\n/**\n * Represents a Habbo user.\n */\nexport interface HabboUser {\n\t/**\n\t * The unique identifier of the user.\n\t */\n\tuniqueId: HabboUserId;\n\t/**\n\t * The name of the user.\n\t */\n\tname: string;\n\t/**\n\t * The figure string of the user.\n\t */\n\tfigureString: string;\n\t/**\n\t * The motto of the user.\n\t */\n\tmotto: string;\n\t/**\n\t * Indicates whether the user is online.\n\t */\n\tonline: boolean;\n\t/**\n\t * The last access time of the user.\n\t */\n\tlastAccessTime: string;\n\t/**\n\t * The date when the user became a member.\n\t */\n\tmemberSince: string;\n\t/**\n\t * Indicates whether the user's profile is visible.\n\t */\n\tprofileVisible: boolean;\n\t/**\n\t * The current level of the user.\n\t */\n\tcurrentLevel: number;\n\t/**\n\t * The percentage of the current level completed by the user.\n\t */\n\tcurrentLevelCompletePercent: number;\n\t/**\n\t * The total experience points of the user.\n\t */\n\ttotalExperience: number;\n\t/**\n\t * The number of star gems the user has.\n\t */\n\tstarGemCount: number;\n\t/**\n\t * The badges selected by the user.\n\t */\n\tselectedBadges: HabboUserSelectedBadge[];\n}\n\n/**\n * Represents a room owned by a Habbo user.\n */\nexport interface HabboUserRoom {\n\t/**\n\t * The unique identifier of the room.\n\t */\n\tid: number;\n\t/**\n\t * The name of the room.\n\t */\n\tname: string;\n\t/**\n\t * The description of the room.\n\t */\n\tdescription: string;\n\t/**\n\t * The creation time of the room.\n\t */\n\tcreationTime: string;\n\t/**\n\t * The unique identifier of the Habbo group associated with the room.\n\t */\n\thabboGroupId: string;\n\t/**\n\t * The tags associated with the room.\n\t */\n\ttags: string[];\n\t/**\n\t * The maximum number of visitors allowed in the room.\n\t */\n\tmaximumVisitors: number;\n\t/**\n\t * Indicates whether the owner's name is shown.\n\t */\n\tshowOwnerName: boolean;\n\t/**\n\t * The name of the room owner.\n\t */\n\townerName: string;\n\t/**\n\t * The unique identifier of the room owner.\n\t */\n\townerUniqueId: string;\n\t/**\n\t * The categories associated with the room.\n\t */\n\tcategories: string[];\n\t/**\n\t * The URL of the room's thumbnail image.\n\t */\n\tthumbnailUrl: string;\n\t/**\n\t * The URL of the room's image.\n\t */\n\timageUrl: string;\n\t/**\n\t * The rating of the room.\n\t */\n\trating: number;\n\t/**\n\t * The unique identifier of the room.\n\t */\n\tuniqueId: string;\n}\n\n/**\n * Represents a group associated with a Habbo user.\n */\nexport interface HabboUserGroup {\n\t/**\n\t * Indicates whether the group is online.\n\t */\n\tonline: boolean;\n\t/**\n\t * The unique identifier of the group.\n\t */\n\tid: string;\n\t/**\n\t * The name of the group.\n\t */\n\tname: string;\n\t/**\n\t * The description of the group.\n\t */\n\tdescription: string;\n\t/**\n\t * The type of the group.\n\t */\n\ttype: HabboGroupType;\n\t/**\n\t * The unique identifier of the room associated with the group.\n\t */\n\troomId: string;\n\t/**\n\t * The badge code of the group.\n\t */\n\tbadgeCode: string;\n\t/**\n\t * The primary color of the group.\n\t */\n\tprimaryColour: string;\n\t/**\n\t * The secondary color of the group.\n\t */\n\tsecondaryColour: string;\n\t/**\n\t * Indicates whether the user is an admin of the group.\n\t */\n\tisAdmin: boolean;\n}\n\n/**\n * Represents a badge owned by a Habbo user.\n */\nexport interface HabboUserBadge {\n\t/**\n\t * The code of the badge.\n\t */\n\tcode: string;\n\t/**\n\t * The name of the badge.\n\t */\n\tname: string;\n\t/**\n\t * The description of the badge.\n\t */\n\tdescription: string;\n}\n\n/**\n * Represents a selected badge of a Habbo user.\n */\nexport interface HabboUserSelectedBadge extends HabboUserBadge {\n\t/**\n\t * The index of the badge.\n\t */\n\tbadgeIndex: number;\n}\n\n/**\n * Represents a friend of a Habbo user.\n */\nexport interface HabboUserFriend {\n\t/**\n\t * The unique identifier of the friend.\n\t */\n\tuniqueId: string;\n\t/**\n\t * The name of the friend.\n\t */\n\tname: string;\n\t/**\n\t * The figure string of the friend.\n\t */\n\tfigureString: string;\n\t/**\n\t * The motto of the friend.\n\t */\n\tmotto: string;\n\t/**\n\t * Indicates whether the friend is online.\n\t */\n\tonline: boolean;\n}\n\n/**\n * Represents the profile of a Habbo user.\n */\nexport interface HabboUserProfile {\n\t/**\n\t * The unique identifier of the user.\n\t */\n\tuniqueId: string;\n\t/**\n\t * The name of the user.\n\t */\n\tname: string;\n\t/**\n\t * The figure string of the user.\n\t */\n\tfigureString: string;\n\t/**\n\t * The motto of the user.\n\t */\n\tmotto: string;\n\t/**\n\t * Indicates whether the user is online.\n\t */\n\tonline: boolean;\n\t/**\n\t * The last access time of the user.\n\t */\n\tlastAccessTime: string;\n\t/**\n\t * The date when the user became a member.\n\t */\n\tmemberSince: string;\n\t/**\n\t * Indicates whether the user's profile is visible.\n\t */\n\tprofileVisible: boolean;\n\t/**\n\t * The current level of the user.\n\t */\n\tcurrentLevel: number;\n\t/**\n\t * The percentage of the current level completed by the user.\n\t */\n\tcurrentLevelCompletePercent: number;\n\t/**\n\t * The total experience points of the user.\n\t */\n\ttotalExperience: number;\n\t/**\n\t * The number of star gems the user has.\n\t */\n\tstarGemCount: number;\n\t/**\n\t * The badges selected by the user.\n\t */\n\tselectedBadges: HabboUserSelectedBadge[];\n\t/**\n\t * The groups the user is a member of.\n\t */\n\tgroups: HabboUserGroup[];\n\t/**\n\t * The badges owned by the user.\n\t */\n\tbadges: HabboUserBadge[];\n\t/**\n\t * The friends of the user.\n\t */\n\tfriends: HabboUserFriend[];\n\t/**\n\t * The rooms owned by the user.\n\t */\n\trooms: HabboUserRoom[];\n}\n\n/**\n * Represents photos associated with a Habbo user.\n */\nexport interface HabboUserPhotos {\n\t/**\n\t * The unique identifier of the room where the photo was taken.\n\t */\n\troom_id: number;\n\t/**\n\t * The unique identifier of the photo creator.\n\t */\n\tcreator_id: number;\n\t/**\n\t * The name of the photo creator.\n\t */\n\tcreator_name: string;\n\t/**\n\t * The time when the photo was taken.\n\t */\n\ttime: number;\n\t/**\n\t * The version of the photo.\n\t */\n\tversion: number;\n\t/**\n\t * The URL of the photo.\n\t */\n\turl: string;\n\t/**\n\t * The type of the photo.\n\t */\n\ttype: string;\n\t/**\n\t * The unique identifier of the photo creator.\n\t */\n\tcreator_uniqueId: string;\n\t/**\n\t * The tags associated with the photo.\n\t */\n\ttags: string[];\n\t/**\n\t * The URL of the photo preview.\n\t */\n\tpreviewUrl: string;\n\t/**\n\t * The unique identifier of the photo.\n\t */\n\tid: string;\n\t/**\n\t * The likes associated with the photo.\n\t */\n\tlikes: string[];\n}\n\nexport interface HabboFigureName extends HabboFigureBase {\n\t/**\n\t * The Habbo username.\n\t */\n\tuser: string;\n}\n\nexport interface HabboFigureStatic extends HabboFigureBase {\n\t/**\n\t * The Habbo figure to use.\n\t */\n\tfigure: string;\n\t/**\n\t * The Habbo's gender.\n\t */\n\tgender?: keyof typeof HabboFigureGender | undefined | null;\n}\n\nexport interface HabboFigureBase {\n\t/**\n\t * The action the user should perform.\n\t */\n\taction?: keyof typeof HabboFigureAction | undefined | null;\n\t/**\n\t * The hand item, will override {@linkcode HabboFigureBase.action} to `'crr'`.\n\t */\n\thand?: keyof typeof HabboFigureHand | undefined | null;\n\t/**\n\t * The Habbo's direction.\n\t */\n\tdirection?: keyof typeof HabboFigureDirection | undefined | null;\n\t/**\n\t * The Habbo's head direction.\n\t */\n\theadDirection?: keyof typeof HabboFigureDirection | undefined | null;\n\t/**\n\t * The gesture, if any.\n\t */\n\tgesture?: keyof typeof HabboFigureGesture | undefined | null;\n\t/**\n\t * The size of the character.\n\t */\n\tsize?: keyof typeof HabboFigureSize | undefined | null;\n\t/**\n\t * Whether or not to render only the head.\n\t */\n\theadOnly?: boolean | undefined | null;\n}\n\nexport const HabboFigureAction = {\n\t// Main Actions\n\tlay: 'lay',\n\tsit: 'sit',\n\trespect: 'respect',\n\twalk: 'wlk',\n\twave: 'wav',\n\tcarry: 'crr',\n\tdrink: 'drk',\n\tsign: 'sig',\n\tblow: 'blw',\n\tlaugh: 'laugh'\n} as const;\n\nexport const HabboFigureHand = {\n\tnothing: '0',\n\tcarrot: '2',\n\tcoffee: '6',\n\tcocktail: '667',\n\thabbo_cola: '5',\n\tice_cream: '3',\n\tjapanese_tea: '42',\n\tlove_potion: '9',\n\tradioactive: '44',\n\ttomato: '43',\n\twater: '1'\n} as const;\n\nexport const HabboFigureGesture = {\n\tnothing: 'nrm',\n\thappy: 'sml',\n\tsad: 'sad',\n\tangry: 'agr',\n\tsurprised: 'srp',\n\tsleeping: 'eyb',\n\tspeaking: 'spk'\n} as const;\n\nexport const HabboFigureSize = { small: 's', normal: 'm', large: 'l' } as const;\nexport const HabboFigureDirection = { nw: '0', w: '1', sw: '2', s: '3', se: '4', e: '5', ne: '6', n: '7' } as const;\nexport const HabboFigureGender = { male: 'M', female: 'F' } as const;\n\nexport const HabboFigureGestureKeys = Object.keys(HabboFigureGesture) as (keyof typeof HabboFigureGesture)[];\nexport const HabboFigureActionKeys = Object.keys(HabboFigureAction) as (keyof typeof HabboFigureAction)[];\nexport const HabboFigureHandKeys = Object.keys(HabboFigureHand) as (keyof typeof HabboFigureHand)[];\nexport const HabboFigureSizeKeys = Object.keys(HabboFigureSize) as (keyof typeof HabboFigureSize)[];\nexport const HabboFigureDirectionKeys = Object.keys(HabboFigureDirection) as (keyof typeof HabboFigureDirection)[];\nexport const HabboFigureGenderKeys = Object.keys(HabboFigureGender) as (keyof typeof HabboFigureGender)[];\n","import { HotelDomainURL } from './constants.js';\nimport { AchievementsAPI } from './routes/achievements.js';\nimport { GroupsAPI } from './routes/groups.js';\nimport { ListsAPI } from './routes/lists.js';\nimport { MarketplaceAPI } from './routes/marketplace.js';\nimport { PingAPI } from './routes/ping.js';\nimport { RoomsAPI } from './routes/rooms.js';\nimport { UsersAPI } from './routes/users.js';\n\nexport class Habbo {\n\tpublic readonly achievements: AchievementsAPI;\n\tpublic readonly groups: GroupsAPI;\n\tpublic readonly lists: ListsAPI;\n\tpublic readonly marketplace: MarketplaceAPI;\n\tpublic readonly ping: PingAPI;\n\tpublic readonly rooms: RoomsAPI;\n\tpublic readonly users: UsersAPI;\n\n\tpublic constructor(options?: HabboOptions) {\n\t\tconst baseURL = options?.baseURL ?? HotelDomainURL.International;\n\t\tconst timeout = options?.timeout ?? null;\n\n\t\tthis.achievements = new AchievementsAPI(baseURL, timeout);\n\t\tthis.groups = new GroupsAPI(baseURL, timeout);\n\t\tthis.lists = new ListsAPI(baseURL, timeout);\n\t\tthis.marketplace = new MarketplaceAPI(baseURL, timeout);\n\t\tthis.ping = new PingAPI(baseURL, timeout);\n\t\tthis.rooms = new RoomsAPI(baseURL, timeout);\n\t\tthis.users = new UsersAPI(baseURL, timeout);\n\t}\n}\n\nexport interface HabboOptions {\n\tbaseURL?: string | null | undefined;\n\ttimeout?: number | null | undefined;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/constants.ts","../../src/routes/base.ts","../../src/routes/achievements.ts","../../src/common.ts","../../src/routes/groups.ts","../../src/routes/lists.ts","../../src/routes/marketplace.ts","../../src/routes/ping.ts","../../src/routes/rooms.ts","../../src/routes/users.ts","../../src/habbo.ts"],"names":["HotelDomainTLD","AchievementDataState","Json","HabboGroupType"],"mappings":";;;;;;AAAY,IAAA,cAAA,qBAAAA,eAAL,KAAA;AACN,EAAAA,gBAAA,WAAY,CAAA,GAAA,SAAA;AACZ,EAAAA,gBAAA,QAAS,CAAA,GAAA,KAAA;AACT,EAAAA,gBAAA,OAAQ,CAAA,GAAA,KAAA;AACR,EAAAA,gBAAA,SAAU,CAAA,GAAA,KAAA;AACV,EAAAA,gBAAA,QAAS,CAAA,GAAA,KAAA;AACT,EAAAA,gBAAA,QAAS,CAAA,GAAA,KAAA;AACT,EAAAA,gBAAA,eAAgB,CAAA,GAAA,MAAA;AAChB,EAAAA,gBAAA,SAAU,CAAA,GAAA,KAAA;AACV,EAAAA,gBAAA,SAAU,CAAA,GAAA,KAAA;AACV,EAAAA,gBAAA,SAAU,CAAA,GAAA,SAAA;AAVC,EAAAA,OAAAA,eAAAA;AAAA,CAAA,EAAA,cAAA,IAAA,EA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KAAQ,GAAA,IAAI,QAAS,CAAA,OAAA,EAAS,OAAO,CAAA;AAAA;AAE5C","file":"index.js","sourcesContent":["export enum HotelDomainTLD {\n\tBrazilian = '.com.br',\n\tDanish = '.dk',\n\tDutch = '.nl',\n\tFinnish = '.fi',\n\tFrench = '.fr',\n\tGerman = '.de',\n\tInternational = '.com',\n\tItalian = '.it',\n\tSpanish = '.es',\n\tTurkish = '.com.tr'\n}\n\nexport const HotelDomainURL = {\n\tBrazilian: `https://www.habbo${HotelDomainTLD.Brazilian}`,\n\tDanish: `https://www.habbo${HotelDomainTLD.Danish}`,\n\tDutch: `https://www.habbo${HotelDomainTLD.Dutch}`,\n\tFinnish: `https://www.habbo${HotelDomainTLD.Finnish}`,\n\tFrench: `https://www.habbo${HotelDomainTLD.French}`,\n\tGerman: `https://www.habbo${HotelDomainTLD.German}`,\n\tInternational: `https://www.habbo${HotelDomainTLD.International}`,\n\tItalian: `https://www.habbo${HotelDomainTLD.Italian}`,\n\tSpanish: `https://www.habbo${HotelDomainTLD.Spanish}`,\n\tTurkish: `https://www.habbo${HotelDomainTLD.Turkish}`\n} as const;\n","import { safeFetch, type FetchResult } from '@skyra/safe-fetch';\n\nexport abstract class BaseAPI {\n\tprotected readonly baseURL: string;\n\tprotected readonly timeout: number | null;\n\n\tpublic constructor(baseURL: string, timeout?: number | null | undefined) {\n\t\tthis.baseURL = baseURL;\n\t\tthis.timeout = timeout ?? null;\n\t}\n\n\tprotected formatURL(route: string): URL {\n\t\treturn new URL(route, this.baseURL);\n\t}\n\n\tprotected fetch(url: string | URL, options?: APIOptions): Promise<FetchResult<Response>> {\n\t\treturn safeFetch(url, { headers: { 'Content-Type': 'application/json' }, signal: this.#getSignalOrDefault(options) });\n\t}\n\n\t#getSignalOrDefault(options?: APIOptions): AbortSignal | null {\n\t\tif (typeof options === 'object' && options !== null) {\n\t\t\tif (typeof options.signal === 'number') return AbortSignal.timeout(options.signal);\n\t\t\tif (typeof options.signal === 'object' && options.signal !== null) return options.signal;\n\t\t}\n\n\t\tif (typeof this.timeout === 'number') return AbortSignal.timeout(this.timeout);\n\t\treturn null;\n\t}\n}\n\nexport interface APIOptions {\n\tsignal?: AbortSignal | number | null | undefined;\n}\n","import { Json, type FetchResult } from '@skyra/safe-fetch';\nimport { BaseAPI, type APIOptions } from './base.js';\nimport type { HabboUserId } from './users.js';\n\nexport class AchievementsAPI extends BaseAPI {\n\t/**\n\t * Get all achievements\n\t *\n\t * @param options - The options for the API call\n\t */\n\tpublic getAll(options?: APIOptions): Promise<FetchResult<Achievement[]>> {\n\t\tconst url = this.formatURL('/api/public/achievements');\n\t\treturn Json<Achievement[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get the achievements from a specified user ID\n\t *\n\t * @param id - The ID of the user\n\t * @param options - The options for the API call\n\t */\n\tpublic getByUserId(id: HabboUserId, options?: APIOptions): Promise<FetchResult<UserAchievement[]>> {\n\t\tconst url = this.formatURL(`/api/public/achievements/${id}`);\n\t\treturn Json<UserAchievement[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get the image URL for an achievement\n\t *\n\t * @param achievementName - The name of the achievement, retrieved from {@linkcode AchievementData.name}\n\t *\n\t * @unstable This feature is not documented, use at your own risk\n\t */\n\tpublic getImageURL(achievementName: string): URL {\n\t\treturn new URL(`https://images.habbo.com/c_images/album1584/${achievementName}.png`);\n\t}\n}\n\nexport interface Achievement {\n\tachievement: AchievementData;\n\tlevelRequirements: AchievementRequirements;\n}\n\nexport interface UserAchievement {\n\tachievement: AchievementData;\n\tlevel: number;\n\tscore: number;\n}\n\nexport interface AchievementData {\n\tid: number;\n\tname: string;\n\tcreationTime: `${bigint}-${bigint}-${bigint}`;\n\tstate: AchievementDataState;\n\tcategory: string;\n}\n\nexport enum AchievementDataState {\n\tEnabled = 'ENABLED',\n\tArchived = 'ARCHIVED',\n\tOffSeason = 'OFF_SEASON'\n}\n\nexport interface AchievementRequirements {\n\tlevel: number;\n\trequiredScore: number;\n}\n","export function isNullish(value: unknown): value is null | undefined {\n\treturn value == null;\n}\n","import { Json, type FetchResult } from '@skyra/safe-fetch';\nimport { isNullish } from '../common.js';\nimport { BaseAPI, type APIOptions } from './base.js';\nimport type { HabboRoomUniqueId } from './rooms.js';\n\nexport class GroupsAPI extends BaseAPI {\n\t/**\n\t * Get the data for a group given its identifier\n\t *\n\t * @param id - The ID of the group\n\t * @param options - The options for the API call\n\t */\n\tpublic getByUniqueId(id: HabboGroupId, options?: APIOptions): Promise<FetchResult<HabboGroup>> {\n\t\tconst url = this.formatURL(`/api/public/groups/${id}`);\n\t\treturn Json<HabboGroup>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get the members from a group given its identifier\n\t *\n\t * @param id - The ID of the group\n\t * @param options - The options for the API call\n\t */\n\tpublic getGroupMembers(id: HabboGroupId, options?: GetGroupMembersOptions): Promise<FetchResult<HabboGroupMember[]>> {\n\t\tconst url = this.formatURL(`/api/public/groups/${id}/members`);\n\t\tif (!isNullish(options?.pageIndex)) {\n\t\t\turl.searchParams.append('pageIndex', options.pageIndex.toString());\n\t\t}\n\n\t\treturn Json<HabboGroupMember[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get the image URL for a badge\n\t *\n\t * @param badgeCode - The badge's code, retrieved from {@linkcode HabboGroup.badgeCode}\n\t *\n\t * @unstable This feature is not documented, use at your own risk\n\t */\n\tpublic getGroupBadgeImageURL(badgeCode: string): URL {\n\t\treturn this.formatURL(`/habbo-imaging/badge/${badgeCode}`);\n\t}\n}\n\n/**\n * The options for {@linkcode GroupsAPI.getGroupMembers}.\n */\nexport interface GetGroupMembersOptions extends APIOptions {\n\t/**\n\t * The page index to look for, each page containing up to 1000 entries.\n\t */\n\tpageIndex?: number | null | undefined;\n}\n\nexport type HabboGroupId = `g-hh${string}-${string};`;\n\n/**\n * Represents a Habbo group.\n */\nexport interface HabboGroup {\n\t/**\n\t * The unique identifier of the group.\n\t */\n\tid: HabboGroupId;\n\n\t/**\n\t * The name of the group.\n\t */\n\tname: string;\n\n\t/**\n\t * The description of the group.\n\t */\n\tdescription: string;\n\n\t/**\n\t * The type of the group.\n\t */\n\ttype: HabboGroupType;\n\n\t/**\n\t * The ID of the room associated with the group, or null if no room is associated.\n\t */\n\troomId: HabboRoomUniqueId;\n\n\t/**\n\t * The badge code of the group.\n\t */\n\tbadgeCode: string;\n}\n\n/**\n * Enum representing the type of a Habbo group.\n */\nexport enum HabboGroupType {\n\t/**\n\t * A normal group (public).\n\t */\n\tNORMAL = 'NORMAL',\n\n\t/**\n\t * A favourite (exclusive) group.\n\t */\n\tFAVOURITE = 'EXCLUSIVE',\n\n\t/**\n\t * A private (closed) group.\n\t */\n\tPRIVATE = 'CLOSED'\n}\n\n/**\n * Represents a member of a Habbo group.\n */\nexport interface HabboGroupMember {\n\t/**\n\t * Indicates whether the member is online.\n\t */\n\tonline: boolean;\n\n\t/**\n\t * The gender of the member.\n\t */\n\tgender: 'm' | 'f';\n\n\t/**\n\t * The motto of the member.\n\t */\n\tmotto: string;\n\n\t/**\n\t * The figure of the member in the Habbo world.\n\t */\n\thabboFigure: string;\n\n\t/**\n\t * The date since the member joined the group.\n\t */\n\tmemberSince: string;\n\n\t/**\n\t * The unique identifier of the member.\n\t */\n\tuniqueId: string;\n\n\t/**\n\t * The name of the member.\n\t */\n\tname: string;\n\n\t/**\n\t * Indicates whether the member is an admin of the group.\n\t */\n\tisAdmin: boolean;\n}\n","import { type FetchResult } from '@skyra/safe-fetch';\nimport { BaseAPI, type APIOptions } from './base.js';\n\nexport class ListsAPI extends BaseAPI {\n\t/**\n\t * Get the hot looks from the hotel\n\t *\n\t * @param options - The options for the API call\n\t */\n\tpublic async getHotLooks(options: APIOptions): Promise<FetchResult<HabboHotLookList>> {\n\t\tconst url = this.formatURL('/api/public/lists/hotlooks');\n\t\tconst data = await this.fetch(url, options);\n\t\treturn data.map(async (result) => this.#parseHotLooksXML(await result.text())).intoPromise();\n\t}\n\n\t#parseHotLooksXML(data: string): HabboHotLookList {\n\t\tconst urlResult = /url=\"(.*)\"/.exec(data);\n\t\tif (urlResult === null) throw new SyntaxError('Could not read hot looks');\n\n\t\tconst url = urlResult[1];\n\t\tconst entries = [] as HabboHotLookListItem[];\n\t\tfor (const result of data.matchAll(/gender=\"(\\w)\" figure=\"(.+)\" hash=\"(.+)\"/g)) {\n\t\t\tentries.push({ gender: result[1] as 'f' | 'm', figure: result[2], hash: result[3] });\n\t\t}\n\n\t\tif (entries.length === 0) throw new SyntaxError('Could not read hot looks');\n\n\t\treturn { url, entries };\n\t}\n}\n\nexport interface HabboHotLookList {\n\turl: string;\n\tentries: HabboHotLookListItem[];\n}\n\nexport interface HabboHotLookListItem {\n\tgender: 'f' | 'm';\n\tfigure: string;\n\thash: string;\n}\n","import { Json, type FetchResult } from '@skyra/safe-fetch';\nimport { BaseAPI, type APIOptions } from './base.js';\n\nexport class MarketplaceAPI extends BaseAPI {\n\t/**\n\t * Get the marketplace stats for a room item\n\t *\n\t * @param roomItemName - The name of the room item\n\t * @param options - The options for the API call\n\t */\n\tpublic getRoomItemStats(roomItemName: string, options?: APIOptions): Promise<FetchResult<MarketplaceStats>> {\n\t\tconst url = this.formatURL(`/api/public/marketplace/stats/roomItem/${roomItemName}`);\n\t\treturn Json<MarketplaceStats>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get the marketplace stats for a wall item\n\t *\n\t * @param wallItemName - The name of the wall item\n\t * @param options - The options for the API call\n\t */\n\tpublic getWallItemStats(wallItemName: string, options?: APIOptions): Promise<FetchResult<MarketplaceStats>> {\n\t\tconst url = this.formatURL(`/api/public/marketplace/stats/wallItem/${wallItemName}`);\n\t\treturn Json<MarketplaceStats>(this.fetch(url, options));\n\t}\n}\n\nexport interface MarketplaceStats {\n\thistory: MarketplaceStatsHistory[];\n\tstatsDate: `${bigint}-${bigint}-${bigint}`;\n\tsoldItemCount: number;\n\tcreditSum: number;\n\taveragePrice: number;\n\ttotalOpenOffers: number;\n\thistoryLimitInDays: number;\n}\n\nexport interface MarketplaceStatsHistory {\n\tdayOffset: `${bigint}`;\n\taveragePrice: `${bigint}`;\n\ttotalSoldItems: `${bigint}`;\n\ttotalCreditSum: `${bigint}`;\n\ttotalOpenOffers: `${bigint}`;\n}\n","import { type APIOptions, BaseAPI } from './base.js';\n\nexport class PingAPI extends BaseAPI {\n\t/**\n\t * Pings Habbo, returning the measured time using {@linkcode performance.now()}\n\t *\n\t * @param options - The options for the API call\n\t */\n\tpublic async get(options?: APIOptions): Promise<number | null> {\n\t\tconst url = this.formatURL('/api/public/ping');\n\t\tconst now = performance.now();\n\t\treturn (await this.fetch(url, options)).match({\n\t\t\tok: () => performance.now() - now,\n\t\t\terr: () => null\n\t\t});\n\t}\n}\n","import { type FetchResult, Json } from '@skyra/safe-fetch';\nimport { type APIOptions, BaseAPI } from './base.js';\n\nexport class RoomsAPI extends BaseAPI {\n\t/**\n\t * Get a room by its ID\n\t *\n\t * @param roomId - The ID of the room\n\t * @param options - The options for the API call\n\t */\n\tpublic async getById(roomId: number, options?: APIOptions): Promise<FetchResult<HabboRoom>> {\n\t\tconst url = this.formatURL(`/api/public/rooms/${roomId}`);\n\t\treturn Json<HabboRoom>(this.fetch(url, options));\n\t}\n}\n\nexport interface HabboRoom {\n\tid: number;\n\tname: string;\n\tdescription: string;\n\tcreationTime: `${bigint}-${bigint}-${bigint}T${string}`;\n\thabboGroupId: string;\n\ttags: string[];\n\tmaximumVisitors: number;\n\tshowOwnerName: boolean;\n\townerName: string;\n\townerUniqueId: string;\n\tcategories: string[];\n\tthumbnailUrl: string;\n\timageUrl: string;\n\trating: number;\n\tuniqueId: HabboRoomUniqueId;\n}\n\nexport type HabboRoomUniqueId = `r-hh${string}-${string}`;\n","import { Json, type FetchResult } from '@skyra/safe-fetch';\nimport { isNullish } from '../common.js';\nimport { BaseAPI, type APIOptions } from './base.js';\nimport { HabboGroupType } from './groups.js';\n\nexport class UsersAPI extends BaseAPI {\n\t/**\n\t * Get a user by its username\n\t *\n\t * @param username - The username to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getByUsername(username: string, options?: APIOptions): Promise<FetchResult<HabboUser>> {\n\t\tconst url = this.formatURL('/api/public/users');\n\t\turl.searchParams.set('name', username);\n\t\treturn Json<HabboUser>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user by its ID\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getByUniqueId(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUser>> {\n\t\tconst url = this.formatURL(`/api/public/users/${uniqueId}`);\n\t\treturn Json<HabboUser>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's friends\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getUserFriends(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUserFriend[]>> {\n\t\tconst url = this.formatURL(`/api/public/users/${uniqueId}/friends`);\n\t\treturn Json<HabboUserFriend[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's groups\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getUserGroups(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUserGroup[]>> {\n\t\tconst url = this.formatURL(`/api/public/users/${uniqueId}/groups`);\n\t\treturn Json<HabboUserGroup[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's rooms\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getUserRooms(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUserRoom[]>> {\n\t\tconst url = this.formatURL(`/api/public/users/${uniqueId}/rooms`);\n\t\treturn Json<HabboUserRoom[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's badges\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getUserBadges(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUserBadge[]>> {\n\t\tconst url = this.formatURL(`/api/public/users/${uniqueId}/badges`);\n\t\treturn Json<HabboUserBadge[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's profile\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getUserProfile(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUserProfile>> {\n\t\tconst url = this.formatURL(`/api/public/users/${uniqueId}/profile`);\n\t\treturn Json<HabboUserProfile>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's photos\n\t *\n\t * @param uniqueId - The ID to search a Habbo user by\n\t * @param options - The options for the API call\n\t */\n\tpublic getUserPhotos(uniqueId: string, options?: APIOptions): Promise<FetchResult<HabboUserPhotos[]>> {\n\t\tconst url = this.formatURL(`/extradata/public/users/${uniqueId}/photos`);\n\t\treturn Json<HabboUserPhotos[]>(this.fetch(url, options));\n\t}\n\n\t/**\n\t * Get a user's figure\n\t *\n\t * @param options - The options for the image\n\t */\n\tpublic getUserFigureImageURL(options: HabboFigureName | HabboFigureStatic): URL {\n\t\tconst url = this.formatURL('/habbo-imaging/avatarimage');\n\n\t\tif ('figure' in options && !isNullish(options.figure)) {\n\t\t\turl.searchParams.append('figure', options.figure);\n\t\t\tif (!isNullish(options.gender)) url.searchParams.append('gender', HabboFigureGender[options.gender]);\n\t\t} else if ('user' in options && !isNullish(options.user)) {\n\t\t\turl.searchParams.append('user', options.user);\n\t\t} else {\n\t\t\tthrow new Error('You must define `figure` or `user` in the options');\n\t\t}\n\n\t\tif (!isNullish(options.action)) {\n\t\t\tconst habboAction = HabboFigureAction[options.action];\n\t\t\turl.searchParams.append(\n\t\t\t\t'action',\n\t\t\t\tisNullish(options.hand) //\n\t\t\t\t\t? habboAction\n\t\t\t\t\t: `${habboAction}=${HabboFigureHand[options.hand]}`\n\t\t\t);\n\t\t}\n\t\tif (!isNullish(options.direction)) url.searchParams.append('direction', HabboFigureDirection[options.direction]);\n\t\tif (!isNullish(options.headDirection)) url.searchParams.append('head_direction', HabboFigureDirection[options.headDirection]);\n\t\tif (!isNullish(options.gesture)) url.searchParams.append('gesture', HabboFigureGesture[options.gesture]);\n\t\tif (!isNullish(options.size)) url.searchParams.append('size', HabboFigureSize[options.size]);\n\t\tif (!isNullish(options.headOnly)) url.searchParams.append('headonly', options.headOnly ? '1' : '0');\n\n\t\treturn url;\n\t}\n}\n\nexport type HabboUserId = `hh${string}-${string}`;\n\n/**\n * Represents a Habbo user.\n */\nexport interface HabboUser {\n\t/**\n\t * The unique identifier of the user.\n\t */\n\tuniqueId: HabboUserId;\n\t/**\n\t * The name of the user.\n\t */\n\tname: string;\n\t/**\n\t * The figure string of the user.\n\t */\n\tfigureString: string;\n\t/**\n\t * The motto of the user.\n\t */\n\tmotto: string;\n\t/**\n\t * Indicates whether the user is online.\n\t */\n\tonline: boolean;\n\t/**\n\t * The last access time of the user.\n\t */\n\tlastAccessTime: string;\n\t/**\n\t * The date when the user became a member.\n\t */\n\tmemberSince: string;\n\t/**\n\t * Indicates whether the user's profile is visible.\n\t */\n\tprofileVisible: boolean;\n\t/**\n\t * The current level of the user.\n\t */\n\tcurrentLevel: number;\n\t/**\n\t * The percentage of the current level completed by the user.\n\t */\n\tcurrentLevelCompletePercent: number;\n\t/**\n\t * The total experience points of the user.\n\t */\n\ttotalExperience: number;\n\t/**\n\t * The number of star gems the user has.\n\t */\n\tstarGemCount: number;\n\t/**\n\t * The badges selected by the user.\n\t */\n\tselectedBadges: HabboUserSelectedBadge[];\n}\n\n/**\n * Represents a room owned by a Habbo user.\n */\nexport interface HabboUserRoom {\n\t/**\n\t * The unique identifier of the room.\n\t */\n\tid: number;\n\t/**\n\t * The name of the room.\n\t */\n\tname: string;\n\t/**\n\t * The description of the room.\n\t */\n\tdescription: string;\n\t/**\n\t * The creation time of the room.\n\t */\n\tcreationTime: string;\n\t/**\n\t * The unique identifier of the Habbo group associated with the room.\n\t */\n\thabboGroupId: string;\n\t/**\n\t * The tags associated with the room.\n\t */\n\ttags: string[];\n\t/**\n\t * The maximum number of visitors allowed in the room.\n\t */\n\tmaximumVisitors: number;\n\t/**\n\t * Indicates whether the owner's name is shown.\n\t */\n\tshowOwnerName: boolean;\n\t/**\n\t * The name of the room owner.\n\t */\n\townerName: string;\n\t/**\n\t * The unique identifier of the room owner.\n\t */\n\townerUniqueId: string;\n\t/**\n\t * The categories associated with the room.\n\t */\n\tcategories: string[];\n\t/**\n\t * The URL of the room's thumbnail image.\n\t */\n\tthumbnailUrl: string;\n\t/**\n\t * The URL of the room's image.\n\t */\n\timageUrl: string;\n\t/**\n\t * The rating of the room.\n\t */\n\trating: number;\n\t/**\n\t * The unique identifier of the room.\n\t */\n\tuniqueId: string;\n}\n\n/**\n * Represents a group associated with a Habbo user.\n */\nexport interface HabboUserGroup {\n\t/**\n\t * Indicates whether the group is online.\n\t */\n\tonline: boolean;\n\t/**\n\t * The unique identifier of the group.\n\t */\n\tid: string;\n\t/**\n\t * The name of the group.\n\t */\n\tname: string;\n\t/**\n\t * The description of the group.\n\t */\n\tdescription: string;\n\t/**\n\t * The type of the group.\n\t */\n\ttype: HabboGroupType;\n\t/**\n\t * The unique identifier of the room associated with the group.\n\t */\n\troomId: string;\n\t/**\n\t * The badge code of the group.\n\t */\n\tbadgeCode: string;\n\t/**\n\t * The primary color of the group.\n\t */\n\tprimaryColour: string;\n\t/**\n\t * The secondary color of the group.\n\t */\n\tsecondaryColour: string;\n\t/**\n\t * Indicates whether the user is an admin of the group.\n\t */\n\tisAdmin: boolean;\n}\n\n/**\n * Represents a badge owned by a Habbo user.\n */\nexport interface HabboUserBadge {\n\t/**\n\t * The code of the badge.\n\t */\n\tcode: string;\n\t/**\n\t * The name of the badge.\n\t */\n\tname: string;\n\t/**\n\t * The description of the badge.\n\t */\n\tdescription: string;\n}\n\n/**\n * Represents a selected badge of a Habbo user.\n */\nexport interface HabboUserSelectedBadge extends HabboUserBadge {\n\t/**\n\t * The index of the badge.\n\t */\n\tbadgeIndex: number;\n}\n\n/**\n * Represents a friend of a Habbo user.\n */\nexport interface HabboUserFriend {\n\t/**\n\t * The unique identifier of the friend.\n\t */\n\tuniqueId: string;\n\t/**\n\t * The name of the friend.\n\t */\n\tname: string;\n\t/**\n\t * The figure string of the friend.\n\t */\n\tfigureString: string;\n\t/**\n\t * The motto of the friend.\n\t */\n\tmotto: string;\n\t/**\n\t * Indicates whether the friend is online.\n\t */\n\tonline: boolean;\n}\n\n/**\n * Represents the profile of a Habbo user.\n */\nexport interface HabboUserProfile {\n\t/**\n\t * The unique identifier of the user.\n\t */\n\tuniqueId: string;\n\t/**\n\t * The name of the user.\n\t */\n\tname: string;\n\t/**\n\t * The figure string of the user.\n\t */\n\tfigureString: string;\n\t/**\n\t * The motto of the user.\n\t */\n\tmotto: string;\n\t/**\n\t * Indicates whether the user is online.\n\t */\n\tonline: boolean;\n\t/**\n\t * The last access time of the user.\n\t */\n\tlastAccessTime: string;\n\t/**\n\t * The date when the user became a member.\n\t */\n\tmemberSince: string;\n\t/**\n\t * Indicates whether the user's profile is visible.\n\t */\n\tprofileVisible: boolean;\n\t/**\n\t * The current level of the user.\n\t */\n\tcurrentLevel: number;\n\t/**\n\t * The percentage of the current level completed by the user.\n\t */\n\tcurrentLevelCompletePercent: number;\n\t/**\n\t * The total experience points of the user.\n\t */\n\ttotalExperience: number;\n\t/**\n\t * The number of star gems the user has.\n\t */\n\tstarGemCount: number;\n\t/**\n\t * The badges selected by the user.\n\t */\n\tselectedBadges: HabboUserSelectedBadge[];\n\t/**\n\t * The groups the user is a member of.\n\t */\n\tgroups: HabboUserGroup[];\n\t/**\n\t * The badges owned by the user.\n\t */\n\tbadges: HabboUserBadge[];\n\t/**\n\t * The friends of the user.\n\t */\n\tfriends: HabboUserFriend[];\n\t/**\n\t * The rooms owned by the user.\n\t */\n\trooms: HabboUserRoom[];\n}\n\n/**\n * Represents photos associated with a Habbo user.\n */\nexport interface HabboUserPhotos {\n\t/**\n\t * The unique identifier of the room where the photo was taken.\n\t */\n\troom_id: number;\n\t/**\n\t * The unique identifier of the photo creator.\n\t */\n\tcreator_id: number;\n\t/**\n\t * The name of the photo creator.\n\t */\n\tcreator_name: string;\n\t/**\n\t * The time when the photo was taken.\n\t */\n\ttime: number;\n\t/**\n\t * The version of the photo.\n\t */\n\tversion: number;\n\t/**\n\t * The URL of the photo.\n\t */\n\turl: string;\n\t/**\n\t * The type of the photo.\n\t */\n\ttype: string;\n\t/**\n\t * The unique identifier of the photo creator.\n\t */\n\tcreator_uniqueId: string;\n\t/**\n\t * The tags associated with the photo.\n\t */\n\ttags: string[];\n\t/**\n\t * The URL of the photo preview.\n\t */\n\tpreviewUrl: string;\n\t/**\n\t * The unique identifier of the photo.\n\t */\n\tid: string;\n\t/**\n\t * The likes associated with the photo.\n\t */\n\tlikes: string[];\n}\n\nexport interface HabboFigureName extends HabboFigureBase {\n\t/**\n\t * The Habbo username.\n\t */\n\tuser: string;\n}\n\nexport interface HabboFigureStatic extends HabboFigureBase {\n\t/**\n\t * The Habbo figure to use.\n\t */\n\tfigure: string;\n\t/**\n\t * The Habbo's gender.\n\t */\n\tgender?: keyof typeof HabboFigureGender | undefined | null;\n}\n\nexport interface HabboFigureBase {\n\t/**\n\t * The action the user should perform.\n\t */\n\taction?: keyof typeof HabboFigureAction | undefined | null;\n\t/**\n\t * The hand item, will override {@linkcode HabboFigureBase.action} to `'crr'`.\n\t */\n\thand?: keyof typeof HabboFigureHand | undefined | null;\n\t/**\n\t * The Habbo's direction.\n\t */\n\tdirection?: keyof typeof HabboFigureDirection | undefined | null;\n\t/**\n\t * The Habbo's head direction.\n\t */\n\theadDirection?: keyof typeof HabboFigureDirection | undefined | null;\n\t/**\n\t * The gesture, if any.\n\t */\n\tgesture?: keyof typeof HabboFigureGesture | undefined | null;\n\t/**\n\t * The size of the character.\n\t */\n\tsize?: keyof typeof HabboFigureSize | undefined | null;\n\t/**\n\t * Whether or not to render only the head.\n\t */\n\theadOnly?: boolean | undefined | null;\n}\n\nexport const HabboFigureAction = {\n\t// Main Actions\n\tlay: 'lay',\n\tsit: 'sit',\n\trespect: 'respect',\n\twalk: 'wlk',\n\twave: 'wav',\n\tcarry: 'crr',\n\tdrink: 'drk',\n\tsign: 'sig',\n\tblow: 'blw',\n\tlaugh: 'laugh'\n} as const;\n\nexport const HabboFigureHand = {\n\tnothing: '0',\n\tcarrot: '2',\n\tcoffee: '6',\n\tcocktail: '667',\n\thabbo_cola: '5',\n\tice_cream: '3',\n\tjapanese_tea: '42',\n\tlove_potion: '9',\n\tradioactive: '44',\n\ttomato: '43',\n\twater: '1'\n} as const;\n\nexport const HabboFigureGesture = {\n\tnothing: 'nrm',\n\thappy: 'sml',\n\tsad: 'sad',\n\tangry: 'agr',\n\tsurprised: 'srp',\n\tsleeping: 'eyb',\n\tspeaking: 'spk'\n} as const;\n\nexport const HabboFigureSize = { small: 's', normal: 'm', large: 'l' } as const;\nexport const HabboFigureDirection = { nw: '0', w: '1', sw: '2', s: '3', se: '4', e: '5', ne: '6', n: '7' } as const;\nexport const HabboFigureGender = { male: 'M', female: 'F' } as const;\n\nexport const HabboFigureGestureKeys = Object.keys(HabboFigureGesture) as (keyof typeof HabboFigureGesture)[];\nexport const HabboFigureActionKeys = Object.keys(HabboFigureAction) as (keyof typeof HabboFigureAction)[];\nexport const HabboFigureHandKeys = Object.keys(HabboFigureHand) as (keyof typeof HabboFigureHand)[];\nexport const HabboFigureSizeKeys = Object.keys(HabboFigureSize) as (keyof typeof HabboFigureSize)[];\nexport const HabboFigureDirectionKeys = Object.keys(HabboFigureDirection) as (keyof typeof HabboFigureDirection)[];\nexport const HabboFigureGenderKeys = Object.keys(HabboFigureGender) as (keyof typeof HabboFigureGender)[];\n","import { HotelDomainURL } from './constants.js';\nimport { AchievementsAPI } from './routes/achievements.js';\nimport { GroupsAPI } from './routes/groups.js';\nimport { ListsAPI } from './routes/lists.js';\nimport { MarketplaceAPI } from './routes/marketplace.js';\nimport { PingAPI } from './routes/ping.js';\nimport { RoomsAPI } from './routes/rooms.js';\nimport { UsersAPI } from './routes/users.js';\n\nexport class Habbo {\n\tpublic readonly achievements: AchievementsAPI;\n\tpublic readonly groups: GroupsAPI;\n\tpublic readonly lists: ListsAPI;\n\tpublic readonly marketplace: MarketplaceAPI;\n\tpublic readonly ping: PingAPI;\n\tpublic readonly rooms: RoomsAPI;\n\tpublic readonly users: UsersAPI;\n\n\tpublic constructor(options?: HabboOptions) {\n\t\tconst baseURL = options?.baseURL ?? HotelDomainURL.International;\n\t\tconst timeout = options?.timeout ?? null;\n\n\t\tthis.achievements = new AchievementsAPI(baseURL, timeout);\n\t\tthis.groups = new GroupsAPI(baseURL, timeout);\n\t\tthis.lists = new ListsAPI(baseURL, timeout);\n\t\tthis.marketplace = new MarketplaceAPI(baseURL, timeout);\n\t\tthis.ping = new PingAPI(baseURL, timeout);\n\t\tthis.rooms = new RoomsAPI(baseURL, timeout);\n\t\tthis.users = new UsersAPI(baseURL, timeout);\n\t}\n}\n\nexport interface HabboOptions {\n\tbaseURL?: string | null | undefined;\n\ttimeout?: number | null | undefined;\n}\n"]}
|