@ejercito-fam/habbo-api 1.4.1 → 2.0.0
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 +44 -18
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +47 -2
- package/dist/esm/index.d.ts +47 -2
- package/dist/esm/index.js +44 -18
- package/dist/esm/index.js.map +1 -1
- package/package.json +55 -55
package/dist/cjs/index.cjs
CHANGED
|
@@ -44,9 +44,17 @@ var BaseAPI = class {
|
|
|
44
44
|
formatURL(route) {
|
|
45
45
|
return new URL(route, this.baseURL);
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
fetchGet(url, options) {
|
|
48
48
|
return safeFetch.safeFetch(url, { headers: { "Content-Type": "application/json" }, signal: this.#getSignalOrDefault(options) });
|
|
49
49
|
}
|
|
50
|
+
fetchPost(url, body, options) {
|
|
51
|
+
return safeFetch.safeFetch(url, {
|
|
52
|
+
method: "POST",
|
|
53
|
+
headers: { "Content-Type": "application/json" },
|
|
54
|
+
body: JSON.stringify(body),
|
|
55
|
+
signal: this.#getSignalOrDefault(options)
|
|
56
|
+
});
|
|
57
|
+
}
|
|
50
58
|
#getSignalOrDefault(options) {
|
|
51
59
|
if (typeof options === "object" && options !== null) {
|
|
52
60
|
if (typeof options.signal === "number") return AbortSignal.timeout(options.signal);
|
|
@@ -69,7 +77,7 @@ var AchievementsAPI = class extends BaseAPI {
|
|
|
69
77
|
*/
|
|
70
78
|
getAll(options) {
|
|
71
79
|
const url = this.formatURL("/api/public/achievements");
|
|
72
|
-
return safeFetch.Json(this.
|
|
80
|
+
return safeFetch.Json(this.fetchGet(url, options));
|
|
73
81
|
}
|
|
74
82
|
/**
|
|
75
83
|
* Get the achievements from a specified user ID
|
|
@@ -79,7 +87,7 @@ var AchievementsAPI = class extends BaseAPI {
|
|
|
79
87
|
*/
|
|
80
88
|
getByUserId(id, options) {
|
|
81
89
|
const url = this.formatURL(`/api/public/achievements/${id}`);
|
|
82
|
-
return safeFetch.Json(this.
|
|
90
|
+
return safeFetch.Json(this.fetchGet(url, options));
|
|
83
91
|
}
|
|
84
92
|
/**
|
|
85
93
|
* Get the image URL for an achievement
|
|
@@ -118,7 +126,7 @@ var GroupsAPI = class extends BaseAPI {
|
|
|
118
126
|
*/
|
|
119
127
|
getByUniqueId(id, options) {
|
|
120
128
|
const url = this.formatURL(`/api/public/groups/${id}`);
|
|
121
|
-
return safeFetch.Json(this.
|
|
129
|
+
return safeFetch.Json(this.fetchGet(url, options));
|
|
122
130
|
}
|
|
123
131
|
/**
|
|
124
132
|
* Get the members from a group given its identifier
|
|
@@ -131,7 +139,7 @@ var GroupsAPI = class extends BaseAPI {
|
|
|
131
139
|
if (!isNullish(options?.pageIndex)) {
|
|
132
140
|
url.searchParams.append("pageIndex", options.pageIndex.toString());
|
|
133
141
|
}
|
|
134
|
-
return safeFetch.Json(this.
|
|
142
|
+
return safeFetch.Json(this.fetchGet(url, options));
|
|
135
143
|
}
|
|
136
144
|
/**
|
|
137
145
|
* Get the image URL for a badge
|
|
@@ -161,7 +169,7 @@ var ListsAPI = class extends BaseAPI {
|
|
|
161
169
|
*/
|
|
162
170
|
async getHotLooks(options) {
|
|
163
171
|
const url = this.formatURL("/api/public/lists/hotlooks");
|
|
164
|
-
const data = await this.
|
|
172
|
+
const data = await this.fetchGet(url, options);
|
|
165
173
|
return data.map(async (result) => this.#parseHotLooksXML(await result.text())).intoPromise();
|
|
166
174
|
}
|
|
167
175
|
#parseHotLooksXML(data) {
|
|
@@ -183,22 +191,40 @@ var MarketplaceAPI = class extends BaseAPI {
|
|
|
183
191
|
/**
|
|
184
192
|
* Get the marketplace stats for a room item
|
|
185
193
|
*
|
|
194
|
+
* @deprecated This endpoint has been removed from the official API in favour
|
|
195
|
+
* of the newer {@linkcode MarketplaceAPI.getStats} endpoint, which can
|
|
196
|
+
* provide stats for up to 25 items per type in a single request.
|
|
197
|
+
*
|
|
186
198
|
* @param roomItemName - The name of the room item
|
|
187
199
|
* @param options - The options for the API call
|
|
188
200
|
*/
|
|
189
201
|
getRoomItemStats(roomItemName, options) {
|
|
190
202
|
const url = this.formatURL(`/api/public/marketplace/stats/roomItem/${roomItemName}`);
|
|
191
|
-
return safeFetch.Json(this.
|
|
203
|
+
return safeFetch.Json(this.fetchGet(url, options));
|
|
192
204
|
}
|
|
193
205
|
/**
|
|
194
206
|
* Get the marketplace stats for a wall item
|
|
195
207
|
*
|
|
208
|
+
* @deprecated This endpoint has been removed from the official API in favour
|
|
209
|
+
* of the newer {@linkcode MarketplaceAPI.getStats} endpoint, which can
|
|
210
|
+
* provide stats for up to 25 items per type in a single request.
|
|
211
|
+
*
|
|
196
212
|
* @param wallItemName - The name of the wall item
|
|
197
213
|
* @param options - The options for the API call
|
|
198
214
|
*/
|
|
199
215
|
getWallItemStats(wallItemName, options) {
|
|
200
216
|
const url = this.formatURL(`/api/public/marketplace/stats/wallItem/${wallItemName}`);
|
|
201
|
-
return safeFetch.Json(this.
|
|
217
|
+
return safeFetch.Json(this.fetchGet(url, options));
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Get the marketplace stats for up to 25 room and wall items at once
|
|
221
|
+
*
|
|
222
|
+
* @param data - The data for the stats request
|
|
223
|
+
* @param options - The options for the API call
|
|
224
|
+
*/
|
|
225
|
+
getStats(data, options) {
|
|
226
|
+
const url = this.formatURL("/api/public/marketplace/stats");
|
|
227
|
+
return safeFetch.Json(this.fetchPost(url, data, options));
|
|
202
228
|
}
|
|
203
229
|
};
|
|
204
230
|
|
|
@@ -215,7 +241,7 @@ var PingAPI = class extends BaseAPI {
|
|
|
215
241
|
async get(options) {
|
|
216
242
|
const url = this.formatURL("/api/public/ping");
|
|
217
243
|
const now = performance.now();
|
|
218
|
-
return (await this.
|
|
244
|
+
return (await this.fetchGet(url, options)).match({
|
|
219
245
|
ok: /* @__PURE__ */ __name(() => performance.now() - now, "ok"),
|
|
220
246
|
err: /* @__PURE__ */ __name(() => null, "err")
|
|
221
247
|
});
|
|
@@ -233,7 +259,7 @@ var RoomsAPI = class extends BaseAPI {
|
|
|
233
259
|
*/
|
|
234
260
|
async getById(roomId, options) {
|
|
235
261
|
const url = this.formatURL(`/api/public/rooms/${roomId}`);
|
|
236
|
-
return safeFetch.Json(this.
|
|
262
|
+
return safeFetch.Json(this.fetchGet(url, options));
|
|
237
263
|
}
|
|
238
264
|
};
|
|
239
265
|
var UsersAPI = class extends BaseAPI {
|
|
@@ -249,7 +275,7 @@ var UsersAPI = class extends BaseAPI {
|
|
|
249
275
|
getByUsername(username, options) {
|
|
250
276
|
const url = this.formatURL("/api/public/users");
|
|
251
277
|
url.searchParams.set("name", username);
|
|
252
|
-
return safeFetch.Json(this.
|
|
278
|
+
return safeFetch.Json(this.fetchGet(url, options));
|
|
253
279
|
}
|
|
254
280
|
/**
|
|
255
281
|
* Get a user by its ID
|
|
@@ -259,7 +285,7 @@ var UsersAPI = class extends BaseAPI {
|
|
|
259
285
|
*/
|
|
260
286
|
getByUniqueId(uniqueId, options) {
|
|
261
287
|
const url = this.formatURL(`/api/public/users/${uniqueId}`);
|
|
262
|
-
return safeFetch.Json(this.
|
|
288
|
+
return safeFetch.Json(this.fetchGet(url, options));
|
|
263
289
|
}
|
|
264
290
|
/**
|
|
265
291
|
* Get a user's friends
|
|
@@ -269,7 +295,7 @@ var UsersAPI = class extends BaseAPI {
|
|
|
269
295
|
*/
|
|
270
296
|
getUserFriends(uniqueId, options) {
|
|
271
297
|
const url = this.formatURL(`/api/public/users/${uniqueId}/friends`);
|
|
272
|
-
return safeFetch.Json(this.
|
|
298
|
+
return safeFetch.Json(this.fetchGet(url, options));
|
|
273
299
|
}
|
|
274
300
|
/**
|
|
275
301
|
* Get a user's groups
|
|
@@ -279,7 +305,7 @@ var UsersAPI = class extends BaseAPI {
|
|
|
279
305
|
*/
|
|
280
306
|
getUserGroups(uniqueId, options) {
|
|
281
307
|
const url = this.formatURL(`/api/public/users/${uniqueId}/groups`);
|
|
282
|
-
return safeFetch.Json(this.
|
|
308
|
+
return safeFetch.Json(this.fetchGet(url, options));
|
|
283
309
|
}
|
|
284
310
|
/**
|
|
285
311
|
* Get a user's rooms
|
|
@@ -289,7 +315,7 @@ var UsersAPI = class extends BaseAPI {
|
|
|
289
315
|
*/
|
|
290
316
|
getUserRooms(uniqueId, options) {
|
|
291
317
|
const url = this.formatURL(`/api/public/users/${uniqueId}/rooms`);
|
|
292
|
-
return safeFetch.Json(this.
|
|
318
|
+
return safeFetch.Json(this.fetchGet(url, options));
|
|
293
319
|
}
|
|
294
320
|
/**
|
|
295
321
|
* Get a user's badges
|
|
@@ -299,7 +325,7 @@ var UsersAPI = class extends BaseAPI {
|
|
|
299
325
|
*/
|
|
300
326
|
getUserBadges(uniqueId, options) {
|
|
301
327
|
const url = this.formatURL(`/api/public/users/${uniqueId}/badges`);
|
|
302
|
-
return safeFetch.Json(this.
|
|
328
|
+
return safeFetch.Json(this.fetchGet(url, options));
|
|
303
329
|
}
|
|
304
330
|
/**
|
|
305
331
|
* Get a user's profile
|
|
@@ -309,7 +335,7 @@ var UsersAPI = class extends BaseAPI {
|
|
|
309
335
|
*/
|
|
310
336
|
getUserProfile(uniqueId, options) {
|
|
311
337
|
const url = this.formatURL(`/api/public/users/${uniqueId}/profile`);
|
|
312
|
-
return safeFetch.Json(this.
|
|
338
|
+
return safeFetch.Json(this.fetchGet(url, options));
|
|
313
339
|
}
|
|
314
340
|
/**
|
|
315
341
|
* Get a user's photos
|
|
@@ -319,7 +345,7 @@ var UsersAPI = class extends BaseAPI {
|
|
|
319
345
|
*/
|
|
320
346
|
getUserPhotos(uniqueId, options) {
|
|
321
347
|
const url = this.formatURL(`/extradata/public/users/${uniqueId}/photos`);
|
|
322
|
-
return safeFetch.Json(this.
|
|
348
|
+
return safeFetch.Json(this.fetchGet(url, options));
|
|
323
349
|
}
|
|
324
350
|
/**
|
|
325
351
|
* Get a user's figure
|
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/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;AAAA,EAC/D,OAAA,E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A,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"]}
|
|
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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EpC,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 fetchGet(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\tprotected fetchPost(url: string | URL, body: object, options?: APIOptions): Promise<FetchResult<Response>> {\n\t\treturn safeFetch(url, {\n\t\t\tmethod: 'POST',\n\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\tbody: JSON.stringify(body),\n\t\t\tsignal: this.#getSignalOrDefault(options)\n\t\t});\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.fetchGet(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.fetchGet(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.fetchGet(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.fetchGet(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.fetchGet(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 * @deprecated This endpoint has been removed from the official API in favour\n\t * of the newer {@linkcode MarketplaceAPI.getStats} endpoint, which can\n\t * provide stats for up to 25 items per type in a single request.\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.fetchGet(url, options));\n\t}\n\n\t/**\n\t * Get the marketplace stats for a wall item\n\t *\n\t * @deprecated This endpoint has been removed from the official API in favour\n\t * of the newer {@linkcode MarketplaceAPI.getStats} endpoint, which can\n\t * provide stats for up to 25 items per type in a single request.\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.fetchGet(url, options));\n\t}\n\n\t/**\n\t * Get the marketplace stats for up to 25 room and wall items at once\n\t *\n\t * @param data - The data for the stats request\n\t * @param options - The options for the API call\n\t */\n\tpublic getStats(data: MarketplaceGetStats, options?: APIOptions) {\n\t\tconst url = this.formatURL('/api/public/marketplace/stats');\n\t\treturn Json<MarketplaceStats[]>(this.fetchPost(url, data, 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\nexport interface MarketplaceGetStats {\n\troomItems: string[];\n\twallItems: string[];\n}\n\nexport interface MarketplaceStatsResult {\n\tstatus: string;\n\troomItemData: MarketplaceStatsResultEntry[];\n\twallItemData: MarketplaceStatsResultEntry[];\n}\n\nexport interface MarketplaceStatsResultEntry {\n\titem: string;\n\textraData: null;\n\tstatsDate: Date;\n\thistory: MarketplaceStatsResultEntryHistory[];\n\tsoldItemCount: number;\n\tcreditSum: number;\n\taveragePrice: number;\n\ttotalOpenOffers: number;\n\tcurrentOpenOffers: number;\n\tcurrentPrice: number;\n\thistoryLimitInDays: number;\n}\n\nexport interface MarketplaceStatsResultEntryHistory {\n\tdayOffset: string;\n\taveragePrice: string;\n\ttotalSoldItems: string;\n\ttotalCreditSum: string;\n\ttotalOpenOffers: string;\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.fetchGet(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.fetchGet(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.fetchGet(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.fetchGet(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.fetchGet(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.fetchGet(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.fetchGet(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.fetchGet(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.fetchGet(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.fetchGet(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
|
@@ -31,7 +31,8 @@ declare abstract class BaseAPI {
|
|
|
31
31
|
protected readonly timeout: number | null;
|
|
32
32
|
constructor(baseURL: string, timeout?: number | null | undefined);
|
|
33
33
|
protected formatURL(route: string): URL;
|
|
34
|
-
protected
|
|
34
|
+
protected fetchGet(url: string | URL, options?: APIOptions): Promise<FetchResult<Response>>;
|
|
35
|
+
protected fetchPost(url: string | URL, body: object, options?: APIOptions): Promise<FetchResult<Response>>;
|
|
35
36
|
}
|
|
36
37
|
interface APIOptions {
|
|
37
38
|
signal?: AbortSignal | number | null | undefined;
|
|
@@ -770,6 +771,10 @@ declare class MarketplaceAPI extends BaseAPI {
|
|
|
770
771
|
/**
|
|
771
772
|
* Get the marketplace stats for a room item
|
|
772
773
|
*
|
|
774
|
+
* @deprecated This endpoint has been removed from the official API in favour
|
|
775
|
+
* of the newer {@linkcode MarketplaceAPI.getStats} endpoint, which can
|
|
776
|
+
* provide stats for up to 25 items per type in a single request.
|
|
777
|
+
*
|
|
773
778
|
* @param roomItemName - The name of the room item
|
|
774
779
|
* @param options - The options for the API call
|
|
775
780
|
*/
|
|
@@ -777,10 +782,21 @@ declare class MarketplaceAPI extends BaseAPI {
|
|
|
777
782
|
/**
|
|
778
783
|
* Get the marketplace stats for a wall item
|
|
779
784
|
*
|
|
785
|
+
* @deprecated This endpoint has been removed from the official API in favour
|
|
786
|
+
* of the newer {@linkcode MarketplaceAPI.getStats} endpoint, which can
|
|
787
|
+
* provide stats for up to 25 items per type in a single request.
|
|
788
|
+
*
|
|
780
789
|
* @param wallItemName - The name of the wall item
|
|
781
790
|
* @param options - The options for the API call
|
|
782
791
|
*/
|
|
783
792
|
getWallItemStats(wallItemName: string, options?: APIOptions): Promise<FetchResult<MarketplaceStats>>;
|
|
793
|
+
/**
|
|
794
|
+
* Get the marketplace stats for up to 25 room and wall items at once
|
|
795
|
+
*
|
|
796
|
+
* @param data - The data for the stats request
|
|
797
|
+
* @param options - The options for the API call
|
|
798
|
+
*/
|
|
799
|
+
getStats(data: MarketplaceGetStats, options?: APIOptions): Promise<FetchResult<MarketplaceStats[]>>;
|
|
784
800
|
}
|
|
785
801
|
interface MarketplaceStats {
|
|
786
802
|
history: MarketplaceStatsHistory[];
|
|
@@ -798,6 +814,35 @@ interface MarketplaceStatsHistory {
|
|
|
798
814
|
totalCreditSum: `${bigint}`;
|
|
799
815
|
totalOpenOffers: `${bigint}`;
|
|
800
816
|
}
|
|
817
|
+
interface MarketplaceGetStats {
|
|
818
|
+
roomItems: string[];
|
|
819
|
+
wallItems: string[];
|
|
820
|
+
}
|
|
821
|
+
interface MarketplaceStatsResult {
|
|
822
|
+
status: string;
|
|
823
|
+
roomItemData: MarketplaceStatsResultEntry[];
|
|
824
|
+
wallItemData: MarketplaceStatsResultEntry[];
|
|
825
|
+
}
|
|
826
|
+
interface MarketplaceStatsResultEntry {
|
|
827
|
+
item: string;
|
|
828
|
+
extraData: null;
|
|
829
|
+
statsDate: Date;
|
|
830
|
+
history: MarketplaceStatsResultEntryHistory[];
|
|
831
|
+
soldItemCount: number;
|
|
832
|
+
creditSum: number;
|
|
833
|
+
averagePrice: number;
|
|
834
|
+
totalOpenOffers: number;
|
|
835
|
+
currentOpenOffers: number;
|
|
836
|
+
currentPrice: number;
|
|
837
|
+
historyLimitInDays: number;
|
|
838
|
+
}
|
|
839
|
+
interface MarketplaceStatsResultEntryHistory {
|
|
840
|
+
dayOffset: string;
|
|
841
|
+
averagePrice: string;
|
|
842
|
+
totalSoldItems: string;
|
|
843
|
+
totalCreditSum: string;
|
|
844
|
+
totalOpenOffers: string;
|
|
845
|
+
}
|
|
801
846
|
|
|
802
847
|
declare class PingAPI extends BaseAPI {
|
|
803
848
|
/**
|
|
@@ -823,4 +868,4 @@ interface HabboOptions {
|
|
|
823
868
|
timeout?: number | null | undefined;
|
|
824
869
|
}
|
|
825
870
|
|
|
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 };
|
|
871
|
+
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 MarketplaceGetStats, type MarketplaceStats, type MarketplaceStatsHistory, type MarketplaceStatsResult, type MarketplaceStatsResultEntry, type MarketplaceStatsResultEntryHistory, PingAPI, RoomsAPI, type UserAchievement, UsersAPI };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -31,7 +31,8 @@ declare abstract class BaseAPI {
|
|
|
31
31
|
protected readonly timeout: number | null;
|
|
32
32
|
constructor(baseURL: string, timeout?: number | null | undefined);
|
|
33
33
|
protected formatURL(route: string): URL;
|
|
34
|
-
protected
|
|
34
|
+
protected fetchGet(url: string | URL, options?: APIOptions): Promise<FetchResult<Response>>;
|
|
35
|
+
protected fetchPost(url: string | URL, body: object, options?: APIOptions): Promise<FetchResult<Response>>;
|
|
35
36
|
}
|
|
36
37
|
interface APIOptions {
|
|
37
38
|
signal?: AbortSignal | number | null | undefined;
|
|
@@ -770,6 +771,10 @@ declare class MarketplaceAPI extends BaseAPI {
|
|
|
770
771
|
/**
|
|
771
772
|
* Get the marketplace stats for a room item
|
|
772
773
|
*
|
|
774
|
+
* @deprecated This endpoint has been removed from the official API in favour
|
|
775
|
+
* of the newer {@linkcode MarketplaceAPI.getStats} endpoint, which can
|
|
776
|
+
* provide stats for up to 25 items per type in a single request.
|
|
777
|
+
*
|
|
773
778
|
* @param roomItemName - The name of the room item
|
|
774
779
|
* @param options - The options for the API call
|
|
775
780
|
*/
|
|
@@ -777,10 +782,21 @@ declare class MarketplaceAPI extends BaseAPI {
|
|
|
777
782
|
/**
|
|
778
783
|
* Get the marketplace stats for a wall item
|
|
779
784
|
*
|
|
785
|
+
* @deprecated This endpoint has been removed from the official API in favour
|
|
786
|
+
* of the newer {@linkcode MarketplaceAPI.getStats} endpoint, which can
|
|
787
|
+
* provide stats for up to 25 items per type in a single request.
|
|
788
|
+
*
|
|
780
789
|
* @param wallItemName - The name of the wall item
|
|
781
790
|
* @param options - The options for the API call
|
|
782
791
|
*/
|
|
783
792
|
getWallItemStats(wallItemName: string, options?: APIOptions): Promise<FetchResult<MarketplaceStats>>;
|
|
793
|
+
/**
|
|
794
|
+
* Get the marketplace stats for up to 25 room and wall items at once
|
|
795
|
+
*
|
|
796
|
+
* @param data - The data for the stats request
|
|
797
|
+
* @param options - The options for the API call
|
|
798
|
+
*/
|
|
799
|
+
getStats(data: MarketplaceGetStats, options?: APIOptions): Promise<FetchResult<MarketplaceStats[]>>;
|
|
784
800
|
}
|
|
785
801
|
interface MarketplaceStats {
|
|
786
802
|
history: MarketplaceStatsHistory[];
|
|
@@ -798,6 +814,35 @@ interface MarketplaceStatsHistory {
|
|
|
798
814
|
totalCreditSum: `${bigint}`;
|
|
799
815
|
totalOpenOffers: `${bigint}`;
|
|
800
816
|
}
|
|
817
|
+
interface MarketplaceGetStats {
|
|
818
|
+
roomItems: string[];
|
|
819
|
+
wallItems: string[];
|
|
820
|
+
}
|
|
821
|
+
interface MarketplaceStatsResult {
|
|
822
|
+
status: string;
|
|
823
|
+
roomItemData: MarketplaceStatsResultEntry[];
|
|
824
|
+
wallItemData: MarketplaceStatsResultEntry[];
|
|
825
|
+
}
|
|
826
|
+
interface MarketplaceStatsResultEntry {
|
|
827
|
+
item: string;
|
|
828
|
+
extraData: null;
|
|
829
|
+
statsDate: Date;
|
|
830
|
+
history: MarketplaceStatsResultEntryHistory[];
|
|
831
|
+
soldItemCount: number;
|
|
832
|
+
creditSum: number;
|
|
833
|
+
averagePrice: number;
|
|
834
|
+
totalOpenOffers: number;
|
|
835
|
+
currentOpenOffers: number;
|
|
836
|
+
currentPrice: number;
|
|
837
|
+
historyLimitInDays: number;
|
|
838
|
+
}
|
|
839
|
+
interface MarketplaceStatsResultEntryHistory {
|
|
840
|
+
dayOffset: string;
|
|
841
|
+
averagePrice: string;
|
|
842
|
+
totalSoldItems: string;
|
|
843
|
+
totalCreditSum: string;
|
|
844
|
+
totalOpenOffers: string;
|
|
845
|
+
}
|
|
801
846
|
|
|
802
847
|
declare class PingAPI extends BaseAPI {
|
|
803
848
|
/**
|
|
@@ -823,4 +868,4 @@ interface HabboOptions {
|
|
|
823
868
|
timeout?: number | null | undefined;
|
|
824
869
|
}
|
|
825
870
|
|
|
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 };
|
|
871
|
+
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 MarketplaceGetStats, type MarketplaceStats, type MarketplaceStatsHistory, type MarketplaceStatsResult, type MarketplaceStatsResultEntry, type MarketplaceStatsResultEntryHistory, PingAPI, RoomsAPI, type UserAchievement, UsersAPI };
|
package/dist/esm/index.js
CHANGED
|
@@ -42,9 +42,17 @@ var BaseAPI = class {
|
|
|
42
42
|
formatURL(route) {
|
|
43
43
|
return new URL(route, this.baseURL);
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
fetchGet(url, options) {
|
|
46
46
|
return safeFetch(url, { headers: { "Content-Type": "application/json" }, signal: this.#getSignalOrDefault(options) });
|
|
47
47
|
}
|
|
48
|
+
fetchPost(url, body, options) {
|
|
49
|
+
return safeFetch(url, {
|
|
50
|
+
method: "POST",
|
|
51
|
+
headers: { "Content-Type": "application/json" },
|
|
52
|
+
body: JSON.stringify(body),
|
|
53
|
+
signal: this.#getSignalOrDefault(options)
|
|
54
|
+
});
|
|
55
|
+
}
|
|
48
56
|
#getSignalOrDefault(options) {
|
|
49
57
|
if (typeof options === "object" && options !== null) {
|
|
50
58
|
if (typeof options.signal === "number") return AbortSignal.timeout(options.signal);
|
|
@@ -67,7 +75,7 @@ var AchievementsAPI = class extends BaseAPI {
|
|
|
67
75
|
*/
|
|
68
76
|
getAll(options) {
|
|
69
77
|
const url = this.formatURL("/api/public/achievements");
|
|
70
|
-
return Json(this.
|
|
78
|
+
return Json(this.fetchGet(url, options));
|
|
71
79
|
}
|
|
72
80
|
/**
|
|
73
81
|
* Get the achievements from a specified user ID
|
|
@@ -77,7 +85,7 @@ var AchievementsAPI = class extends BaseAPI {
|
|
|
77
85
|
*/
|
|
78
86
|
getByUserId(id, options) {
|
|
79
87
|
const url = this.formatURL(`/api/public/achievements/${id}`);
|
|
80
|
-
return Json(this.
|
|
88
|
+
return Json(this.fetchGet(url, options));
|
|
81
89
|
}
|
|
82
90
|
/**
|
|
83
91
|
* Get the image URL for an achievement
|
|
@@ -116,7 +124,7 @@ var GroupsAPI = class extends BaseAPI {
|
|
|
116
124
|
*/
|
|
117
125
|
getByUniqueId(id, options) {
|
|
118
126
|
const url = this.formatURL(`/api/public/groups/${id}`);
|
|
119
|
-
return Json(this.
|
|
127
|
+
return Json(this.fetchGet(url, options));
|
|
120
128
|
}
|
|
121
129
|
/**
|
|
122
130
|
* Get the members from a group given its identifier
|
|
@@ -129,7 +137,7 @@ var GroupsAPI = class extends BaseAPI {
|
|
|
129
137
|
if (!isNullish(options?.pageIndex)) {
|
|
130
138
|
url.searchParams.append("pageIndex", options.pageIndex.toString());
|
|
131
139
|
}
|
|
132
|
-
return Json(this.
|
|
140
|
+
return Json(this.fetchGet(url, options));
|
|
133
141
|
}
|
|
134
142
|
/**
|
|
135
143
|
* Get the image URL for a badge
|
|
@@ -159,7 +167,7 @@ var ListsAPI = class extends BaseAPI {
|
|
|
159
167
|
*/
|
|
160
168
|
async getHotLooks(options) {
|
|
161
169
|
const url = this.formatURL("/api/public/lists/hotlooks");
|
|
162
|
-
const data = await this.
|
|
170
|
+
const data = await this.fetchGet(url, options);
|
|
163
171
|
return data.map(async (result) => this.#parseHotLooksXML(await result.text())).intoPromise();
|
|
164
172
|
}
|
|
165
173
|
#parseHotLooksXML(data) {
|
|
@@ -181,22 +189,40 @@ var MarketplaceAPI = class extends BaseAPI {
|
|
|
181
189
|
/**
|
|
182
190
|
* Get the marketplace stats for a room item
|
|
183
191
|
*
|
|
192
|
+
* @deprecated This endpoint has been removed from the official API in favour
|
|
193
|
+
* of the newer {@linkcode MarketplaceAPI.getStats} endpoint, which can
|
|
194
|
+
* provide stats for up to 25 items per type in a single request.
|
|
195
|
+
*
|
|
184
196
|
* @param roomItemName - The name of the room item
|
|
185
197
|
* @param options - The options for the API call
|
|
186
198
|
*/
|
|
187
199
|
getRoomItemStats(roomItemName, options) {
|
|
188
200
|
const url = this.formatURL(`/api/public/marketplace/stats/roomItem/${roomItemName}`);
|
|
189
|
-
return Json(this.
|
|
201
|
+
return Json(this.fetchGet(url, options));
|
|
190
202
|
}
|
|
191
203
|
/**
|
|
192
204
|
* Get the marketplace stats for a wall item
|
|
193
205
|
*
|
|
206
|
+
* @deprecated This endpoint has been removed from the official API in favour
|
|
207
|
+
* of the newer {@linkcode MarketplaceAPI.getStats} endpoint, which can
|
|
208
|
+
* provide stats for up to 25 items per type in a single request.
|
|
209
|
+
*
|
|
194
210
|
* @param wallItemName - The name of the wall item
|
|
195
211
|
* @param options - The options for the API call
|
|
196
212
|
*/
|
|
197
213
|
getWallItemStats(wallItemName, options) {
|
|
198
214
|
const url = this.formatURL(`/api/public/marketplace/stats/wallItem/${wallItemName}`);
|
|
199
|
-
return Json(this.
|
|
215
|
+
return Json(this.fetchGet(url, options));
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Get the marketplace stats for up to 25 room and wall items at once
|
|
219
|
+
*
|
|
220
|
+
* @param data - The data for the stats request
|
|
221
|
+
* @param options - The options for the API call
|
|
222
|
+
*/
|
|
223
|
+
getStats(data, options) {
|
|
224
|
+
const url = this.formatURL("/api/public/marketplace/stats");
|
|
225
|
+
return Json(this.fetchPost(url, data, options));
|
|
200
226
|
}
|
|
201
227
|
};
|
|
202
228
|
|
|
@@ -213,7 +239,7 @@ var PingAPI = class extends BaseAPI {
|
|
|
213
239
|
async get(options) {
|
|
214
240
|
const url = this.formatURL("/api/public/ping");
|
|
215
241
|
const now = performance.now();
|
|
216
|
-
return (await this.
|
|
242
|
+
return (await this.fetchGet(url, options)).match({
|
|
217
243
|
ok: /* @__PURE__ */ __name(() => performance.now() - now, "ok"),
|
|
218
244
|
err: /* @__PURE__ */ __name(() => null, "err")
|
|
219
245
|
});
|
|
@@ -231,7 +257,7 @@ var RoomsAPI = class extends BaseAPI {
|
|
|
231
257
|
*/
|
|
232
258
|
async getById(roomId, options) {
|
|
233
259
|
const url = this.formatURL(`/api/public/rooms/${roomId}`);
|
|
234
|
-
return Json(this.
|
|
260
|
+
return Json(this.fetchGet(url, options));
|
|
235
261
|
}
|
|
236
262
|
};
|
|
237
263
|
var UsersAPI = class extends BaseAPI {
|
|
@@ -247,7 +273,7 @@ var UsersAPI = class extends BaseAPI {
|
|
|
247
273
|
getByUsername(username, options) {
|
|
248
274
|
const url = this.formatURL("/api/public/users");
|
|
249
275
|
url.searchParams.set("name", username);
|
|
250
|
-
return Json(this.
|
|
276
|
+
return Json(this.fetchGet(url, options));
|
|
251
277
|
}
|
|
252
278
|
/**
|
|
253
279
|
* Get a user by its ID
|
|
@@ -257,7 +283,7 @@ var UsersAPI = class extends BaseAPI {
|
|
|
257
283
|
*/
|
|
258
284
|
getByUniqueId(uniqueId, options) {
|
|
259
285
|
const url = this.formatURL(`/api/public/users/${uniqueId}`);
|
|
260
|
-
return Json(this.
|
|
286
|
+
return Json(this.fetchGet(url, options));
|
|
261
287
|
}
|
|
262
288
|
/**
|
|
263
289
|
* Get a user's friends
|
|
@@ -267,7 +293,7 @@ var UsersAPI = class extends BaseAPI {
|
|
|
267
293
|
*/
|
|
268
294
|
getUserFriends(uniqueId, options) {
|
|
269
295
|
const url = this.formatURL(`/api/public/users/${uniqueId}/friends`);
|
|
270
|
-
return Json(this.
|
|
296
|
+
return Json(this.fetchGet(url, options));
|
|
271
297
|
}
|
|
272
298
|
/**
|
|
273
299
|
* Get a user's groups
|
|
@@ -277,7 +303,7 @@ var UsersAPI = class extends BaseAPI {
|
|
|
277
303
|
*/
|
|
278
304
|
getUserGroups(uniqueId, options) {
|
|
279
305
|
const url = this.formatURL(`/api/public/users/${uniqueId}/groups`);
|
|
280
|
-
return Json(this.
|
|
306
|
+
return Json(this.fetchGet(url, options));
|
|
281
307
|
}
|
|
282
308
|
/**
|
|
283
309
|
* Get a user's rooms
|
|
@@ -287,7 +313,7 @@ var UsersAPI = class extends BaseAPI {
|
|
|
287
313
|
*/
|
|
288
314
|
getUserRooms(uniqueId, options) {
|
|
289
315
|
const url = this.formatURL(`/api/public/users/${uniqueId}/rooms`);
|
|
290
|
-
return Json(this.
|
|
316
|
+
return Json(this.fetchGet(url, options));
|
|
291
317
|
}
|
|
292
318
|
/**
|
|
293
319
|
* Get a user's badges
|
|
@@ -297,7 +323,7 @@ var UsersAPI = class extends BaseAPI {
|
|
|
297
323
|
*/
|
|
298
324
|
getUserBadges(uniqueId, options) {
|
|
299
325
|
const url = this.formatURL(`/api/public/users/${uniqueId}/badges`);
|
|
300
|
-
return Json(this.
|
|
326
|
+
return Json(this.fetchGet(url, options));
|
|
301
327
|
}
|
|
302
328
|
/**
|
|
303
329
|
* Get a user's profile
|
|
@@ -307,7 +333,7 @@ var UsersAPI = class extends BaseAPI {
|
|
|
307
333
|
*/
|
|
308
334
|
getUserProfile(uniqueId, options) {
|
|
309
335
|
const url = this.formatURL(`/api/public/users/${uniqueId}/profile`);
|
|
310
|
-
return Json(this.
|
|
336
|
+
return Json(this.fetchGet(url, options));
|
|
311
337
|
}
|
|
312
338
|
/**
|
|
313
339
|
* Get a user's photos
|
|
@@ -317,7 +343,7 @@ var UsersAPI = class extends BaseAPI {
|
|
|
317
343
|
*/
|
|
318
344
|
getUserPhotos(uniqueId, options) {
|
|
319
345
|
const url = this.formatURL(`/extradata/public/users/${uniqueId}/photos`);
|
|
320
|
-
return Json(this.
|
|
346
|
+
return Json(this.fetchGet(url, options));
|
|
321
347
|
}
|
|
322
348
|
/**
|
|
323
349
|
* Get a user's figure
|
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/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,GA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AAS,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.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"]}
|
|
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,SAA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k',\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 fetchGet(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\tprotected fetchPost(url: string | URL, body: object, options?: APIOptions): Promise<FetchResult<Response>> {\n\t\treturn safeFetch(url, {\n\t\t\tmethod: 'POST',\n\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\tbody: JSON.stringify(body),\n\t\t\tsignal: this.#getSignalOrDefault(options)\n\t\t});\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.fetchGet(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.fetchGet(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.fetchGet(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.fetchGet(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.fetchGet(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 * @deprecated This endpoint has been removed from the official API in favour\n\t * of the newer {@linkcode MarketplaceAPI.getStats} endpoint, which can\n\t * provide stats for up to 25 items per type in a single request.\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.fetchGet(url, options));\n\t}\n\n\t/**\n\t * Get the marketplace stats for a wall item\n\t *\n\t * @deprecated This endpoint has been removed from the official API in favour\n\t * of the newer {@linkcode MarketplaceAPI.getStats} endpoint, which can\n\t * provide stats for up to 25 items per type in a single request.\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.fetchGet(url, options));\n\t}\n\n\t/**\n\t * Get the marketplace stats for up to 25 room and wall items at once\n\t *\n\t * @param data - The data for the stats request\n\t * @param options - The options for the API call\n\t */\n\tpublic getStats(data: MarketplaceGetStats, options?: APIOptions) {\n\t\tconst url = this.formatURL('/api/public/marketplace/stats');\n\t\treturn Json<MarketplaceStats[]>(this.fetchPost(url, data, 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\nexport interface MarketplaceGetStats {\n\troomItems: string[];\n\twallItems: string[];\n}\n\nexport interface MarketplaceStatsResult {\n\tstatus: string;\n\troomItemData: MarketplaceStatsResultEntry[];\n\twallItemData: MarketplaceStatsResultEntry[];\n}\n\nexport interface MarketplaceStatsResultEntry {\n\titem: string;\n\textraData: null;\n\tstatsDate: Date;\n\thistory: MarketplaceStatsResultEntryHistory[];\n\tsoldItemCount: number;\n\tcreditSum: number;\n\taveragePrice: number;\n\ttotalOpenOffers: number;\n\tcurrentOpenOffers: number;\n\tcurrentPrice: number;\n\thistoryLimitInDays: number;\n}\n\nexport interface MarketplaceStatsResultEntryHistory {\n\tdayOffset: string;\n\taveragePrice: string;\n\ttotalSoldItems: string;\n\ttotalCreditSum: string;\n\ttotalOpenOffers: string;\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.fetchGet(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.fetchGet(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.fetchGet(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.fetchGet(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.fetchGet(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.fetchGet(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.fetchGet(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.fetchGet(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.fetchGet(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.fetchGet(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/package.json
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
2
|
+
"name": "@ejercito-fam/habbo-api",
|
|
3
|
+
"description": "A typed Habbo API library",
|
|
4
|
+
"version": "2.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/cjs/index.cjs",
|
|
7
|
+
"module": "dist/esm/index.mjs",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"start": "node ./dist/main.js",
|
|
10
|
+
"build": "tsup",
|
|
11
|
+
"dev": "yarn build && yarn start",
|
|
12
|
+
"prepublishOnly": "yarn build"
|
|
13
|
+
},
|
|
14
|
+
"exports": {
|
|
15
|
+
"import": {
|
|
16
|
+
"types": "./dist/esm/index.d.ts",
|
|
17
|
+
"default": "./dist/esm/index.js"
|
|
18
|
+
},
|
|
19
|
+
"require": {
|
|
20
|
+
"types": "./dist/cjs/index.d.cts",
|
|
21
|
+
"default": "./dist/cjs/index.cjs"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist/"
|
|
26
|
+
],
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@skyra/safe-fetch": "^1.1.4"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@sapphire/eslint-config": "^5.0.6",
|
|
32
|
+
"@sapphire/prettier-config": "^2.0.0",
|
|
33
|
+
"@sapphire/ts-config": "^5.0.3",
|
|
34
|
+
"@types/node": "^22.19.17",
|
|
35
|
+
"@typescript-eslint/eslint-plugin": "^8.58.1",
|
|
36
|
+
"@typescript-eslint/parser": "^8.58.1",
|
|
37
|
+
"eslint": "^9.39.4",
|
|
38
|
+
"eslint-config-prettier": "^10.1.8",
|
|
39
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
40
|
+
"prettier": "^3.8.2",
|
|
41
|
+
"tsup": "^8.5.1",
|
|
42
|
+
"typescript": "^5.9.3"
|
|
43
|
+
},
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public"
|
|
46
|
+
},
|
|
47
|
+
"prettier": "@sapphire/prettier-config",
|
|
48
|
+
"eslintConfig": {
|
|
49
|
+
"extends": "@sapphire",
|
|
50
|
+
"ignorePatterns": [
|
|
51
|
+
"node_modules/",
|
|
52
|
+
"dist/"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
"packageManager": "yarn@4.13.0"
|
|
56
|
+
}
|