@blizzard-api/classic-wow 0.1.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/README.md ADDED
@@ -0,0 +1,72 @@
1
+ # @blizzard-api/classic-wow
2
+
3
+ This package aims to make it easier for you to integrate with the Blizzard Battle.net API, specifically for World of Warcraft Classic.
4
+
5
+ ## Installation
6
+
7
+ ```sh
8
+ npm i @blizzard-api/core @blizzard-api/classic-wow
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ You can get paths, namespaces, parameters and more for a specific endpoint by calling it from the `classicWow` export.
14
+
15
+ ```ts
16
+ import { classicWow } from "@blizzard-api/classic-wow"
17
+
18
+ const achievement = classicWow.achievement(123);
19
+ ^ { path: string, namespace: string }
20
+ ```
21
+
22
+ If you need the response types, they are also exported with "Response" appended, so to get the response type from the above code, you can import it like this:
23
+
24
+ ```ts
25
+ import type { AchievementResponse } from '@blizzard-api/classic-wow';
26
+ ```
27
+
28
+ If you simply want to use the existing object, you can use the helper from `@blizzard-api/core` like so:
29
+
30
+ ```ts
31
+ import { classicWow } from "@blizzard-api/classic-wow"
32
+
33
+ const achievement = classicWow.achievement(123);
34
+ ^ { path: string, namespace: string }
35
+ type AchievementResponse = ExtractResourceType<typeof achievement>;
36
+ ```
37
+
38
+ ## Differences to @blizzard-api/wow
39
+
40
+ This package is specifically for World of Warcraft Classic, and as such, the endpoints and responses are different from the retail variants. If you are looking for the retail version of World of Warcraft, you should use `@blizzard-api/wow` instead.
41
+
42
+ Because there are multiple classic flavours of the game, each endpoint will take in a namespace argument where you will be able to specify which version of the game you want to query.
43
+
44
+ | Game Version | Static Namespace | Dynamic Namespace | Profile Namespace |
45
+ | -------------------------------------------- | ------------------------- | -------------------------- | -------------------------- |
46
+ | World of Warcraft Classic (Era) | static-classic1x-{region} | dynamic-classic1x-{region} | profile-classic1x-{region} |
47
+ | Wrath of the Lich King Classic (Progression) | static-classic-{region} | dynamic-classic-{region} | profile-classic-{region} |
48
+
49
+ ## Types
50
+
51
+ The types are manually created from using the Blizzard API documentation, and are as accurate as possible with smoke testing each endpoint. However, no-one is perfect so there is likely be some discrepancies. If you encounter any issues with the types from this package, please open an issue or a pull request.
52
+
53
+ ### Client
54
+
55
+ While this package is made to function on it's own, it performs even better when combined with `@blizzard-api/client` where you can easily request data combining the two libraries.
56
+
57
+ ```ts
58
+ import { createBlizzardApiClient } from '@blizzard-api/client';
59
+ import { classicWow } from '@blizzard-api/classic-wow';
60
+
61
+ const client = await createBlizzardApiClient({
62
+ key: 'environment.blizzardClientId',
63
+ secret: 'environment.blizzardClientSecret',
64
+ origin: 'eu',
65
+ });
66
+
67
+ //Response will automatically be typed with the appropriate values
68
+ const response = await client.sendRequest(classicWow.commodities());
69
+
70
+ console.log(response.data);
71
+ ^ typeof AuctionHouseCommoditiesResponse
72
+ ```
package/dist/index.cjs ADDED
@@ -0,0 +1,633 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ classicWow: () => classicWow
24
+ });
25
+ module.exports = __toCommonJS(src_exports);
26
+
27
+ // ../wow/src/base.ts
28
+ var base = "/data/wow";
29
+ var mediaBase = `${base}/media`;
30
+ var searchBase = `${base}/search`;
31
+
32
+ // src/auction-house/auction-house.ts
33
+ var classicAuctionHouseApi = {
34
+ /**
35
+ * Returns an index of auction houses for a connected realm.
36
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
37
+ * @param connectedRealmId The ID of the connected realm.
38
+ * @returns The auction house index. See {@link AuctionHouseIndexResponse}.
39
+ */
40
+ auctionHouseIndex: (namespace, connectedRealmId) => {
41
+ return {
42
+ path: `${base}/connected-realm/${connectedRealmId}/auctions/index`,
43
+ namespace
44
+ };
45
+ },
46
+ /**
47
+ * Returns all active auctions for a specific auction house on a connected realm.
48
+ *
49
+ * Auction house data updates at a set interval. The value was initially set at 1 hour; however, it might change over time without notice.
50
+ *
51
+ * Depending on the number of active auctions on the specified connected realm, the response from this endpoint may be rather large, sometimes exceeding 10 MB.
52
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
53
+ * @param connectedRealmId The ID of the connected realm.
54
+ * @param auctionHouseId The ID of the auction house.
55
+ * @returns The auction house data. See {@link AuctionsResponse}.
56
+ */
57
+ auctions: (namespace, connectedRealmId, auctionHouseId) => {
58
+ return {
59
+ path: `${base}/connected-realm/${connectedRealmId}/auctions/${auctionHouseId}`,
60
+ namespace
61
+ };
62
+ }
63
+ };
64
+
65
+ // src/connected-realm/connected-realm.ts
66
+ var classicConnectedRealmApi = {
67
+ /**
68
+ * Returns an index of connected realms.
69
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
70
+ * @returns The connected realm index. See {@link ConnectedRealmIndexResponse}.
71
+ */
72
+ connectedRealmIndex: (namespace) => {
73
+ return {
74
+ path: `${base}/connected-realm/index`,
75
+ namespace
76
+ };
77
+ },
78
+ /**
79
+ * Returns a connected realm by ID.
80
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
81
+ * @param connectedRealmId The connected realm ID.
82
+ * @returns The connected realm. See {@link ConnectedRealmResponse}.
83
+ */
84
+ connectedRealm: (namespace, connectedRealmId) => {
85
+ return {
86
+ path: `${base}/connected-realm/${connectedRealmId}`,
87
+ namespace
88
+ };
89
+ },
90
+ /**
91
+ * Performs a search of connected realms.
92
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
93
+ * @param options The search parameters. See {@link ConnectedRealmSearchParameters}.
94
+ * @returns The search results. See {@link SearchResponse} & {@link ConnectedRealmSearchResponseItem}.
95
+ */
96
+ connectedRealmSearch: (namespace, options) => {
97
+ return {
98
+ namespace,
99
+ parameters: {
100
+ _page: options._page,
101
+ orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby,
102
+ "status.type": options["status.type"],
103
+ "realms.timezone": options["realms.timezone"]
104
+ },
105
+ path: `${base}/search/connected-realm`
106
+ };
107
+ }
108
+ };
109
+
110
+ // src/creature/creature.ts
111
+ var classicCreatureApi = {
112
+ /**
113
+ * Returns a creature by ID.
114
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
115
+ * @param creatureId The creature ID.
116
+ * @returns The creature. See {@link CreatureResponse}.
117
+ */
118
+ creature: (namespace, creatureId) => {
119
+ return {
120
+ path: `${base}/creature/${creatureId}`,
121
+ namespace
122
+ };
123
+ },
124
+ /**
125
+ * Returns media for a creature display by ID.
126
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
127
+ * @param creatureDisplayId The creature display ID.
128
+ * @returns The creature display media. See {@link CreatureDisplayMediaResponse}.
129
+ */
130
+ creatureDisplayMedia: (namespace, creatureDisplayId) => {
131
+ return {
132
+ path: `${mediaBase}/creature-display/${creatureDisplayId}`,
133
+ namespace
134
+ };
135
+ },
136
+ /**
137
+ * Returns a creature family by ID.
138
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
139
+ * @param creatureFamilyId The creature family ID.
140
+ * @returns The creature family. See {@link CreatureFamilyResponse}.
141
+ */
142
+ creatureFamily: (namespace, creatureFamilyId) => {
143
+ return {
144
+ path: `${base}/creature-family/${creatureFamilyId}`,
145
+ namespace
146
+ };
147
+ },
148
+ /**
149
+ * Returns an index of creature families.
150
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
151
+ * @returns The creature family index. See {@link CreatureFamilyIndexResponse}.
152
+ */
153
+ creatureFamilyIndex: (namespace) => {
154
+ return {
155
+ path: `${base}/creature-family/index`,
156
+ namespace
157
+ };
158
+ },
159
+ /**
160
+ * Returns media for a creature family by ID.
161
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
162
+ * @param creatureFamilyId The creature family ID.
163
+ * @returns The creature family media. See {@link CreatureFamilyMediaResponse}.
164
+ */
165
+ creatureFamilyMedia: (namespace, creatureFamilyId) => {
166
+ return {
167
+ path: `${mediaBase}/creature-family/${creatureFamilyId}`,
168
+ namespace
169
+ };
170
+ },
171
+ /**
172
+ * Returns a creature type by ID.
173
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
174
+ * @param creatureTypeId The creature type ID.
175
+ * @returns The creature type. See {@link CreatureTypeResponse}.
176
+ */
177
+ creatureType: (namespace, creatureTypeId) => {
178
+ return {
179
+ path: `${base}/creature-type/${creatureTypeId}`,
180
+ namespace
181
+ };
182
+ },
183
+ /**
184
+ * Returns an index of creature types.
185
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
186
+ * @returns The creature type index. See {@link CreatureTypeIndexResponse}.
187
+ */
188
+ creatureTypeIndex: (namespace) => {
189
+ return {
190
+ path: `${base}/creature-type/index`,
191
+ namespace
192
+ };
193
+ },
194
+ /**
195
+ * Performs a search of creatures.
196
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
197
+ * @param options The creature search parameters. See {@link CreatureSearchParameters}.
198
+ * @returns The creature search results. See {@link SearchResponse} & {@link CreatureSearchResponseItem}.
199
+ */
200
+ creatureSearch: (namespace, options) => {
201
+ return {
202
+ namespace,
203
+ parameters: {
204
+ _page: options._page,
205
+ orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby,
206
+ [`name.${options.locale}`]: options.name
207
+ },
208
+ path: `${searchBase}/creature`
209
+ };
210
+ }
211
+ };
212
+
213
+ // src/guild-crest/guild-crest.ts
214
+ var classicGuildCrestApi = {
215
+ /**
216
+ * Returns an index of guild crest media.
217
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
218
+ * @returns The guild crest components index. See {@link GuildCrestComponentsIndexResponse}.
219
+ */
220
+ guildCrestComponentsIndex: (namespace) => {
221
+ return {
222
+ path: `${base}/guild-crest/index`,
223
+ namespace
224
+ };
225
+ },
226
+ /**
227
+ * Returns media for a guild crest border by ID.
228
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
229
+ * @param borderId The guild crest border ID.
230
+ * @returns The guild crest border. See {@link GuildCrestBorderEmblemResponse}.
231
+ */
232
+ guildCrestBorder: (namespace, borderId) => {
233
+ return {
234
+ path: `${mediaBase}/guild-crest/border/${borderId}`,
235
+ namespace
236
+ };
237
+ },
238
+ /**
239
+ * Returns media for a guild crest emblem by ID.
240
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
241
+ * @param emblemId The guild crest emblem ID.
242
+ * @returns The guild crest emblem. See {@link GuildCrestBorderEmblemResponse}.
243
+ */
244
+ guildCrestEmblem: (namespace, emblemId) => {
245
+ return {
246
+ path: `${mediaBase}/guild-crest/emblem/${emblemId}`,
247
+ namespace
248
+ };
249
+ }
250
+ };
251
+
252
+ // src/item/item.ts
253
+ var classicItemApi = {
254
+ /**
255
+ * Get an item class index.
256
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
257
+ * @returns The item class index. See {@link ItemClassIndexResponse}.
258
+ */
259
+ itemClassIndex: (namespace) => {
260
+ return {
261
+ path: `${base}/item-class/index`,
262
+ namespace
263
+ };
264
+ },
265
+ /**
266
+ * Get an item class by ID.
267
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
268
+ * @param itemClassId The item class ID.
269
+ * @returns The item class. See {@link ItemClassResponse}.
270
+ */
271
+ itemClass: (namespace, itemClassId) => {
272
+ return {
273
+ namespace,
274
+ path: `${base}/item-class/${itemClassId}`
275
+ };
276
+ },
277
+ /**
278
+ * Get an item subclass by ID.
279
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
280
+ * @param itemClassId The item class ID.
281
+ * @param itemSubclassId The item subclass ID.
282
+ * @returns The item subclass. See {@link ItemSubClassResponse}.
283
+ */
284
+ itemSubClass: (namespace, itemClassId, itemSubclassId) => {
285
+ return {
286
+ namespace,
287
+ path: `${base}/item-class/${itemClassId}/item-subclass/${itemSubclassId}`
288
+ };
289
+ },
290
+ /**
291
+ * Get an item by ID.
292
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
293
+ * @param itemId The item ID.
294
+ * @returns The item. See {@link ItemResponse}.
295
+ */
296
+ item: (namespace, itemId) => {
297
+ return {
298
+ namespace,
299
+ path: `${base}/item/${itemId}`
300
+ };
301
+ },
302
+ /**
303
+ * Get item media by ID.
304
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
305
+ * @param itemId The item ID.
306
+ * @returns The item media. See {@link ItemMediaResponse}.
307
+ */
308
+ itemMedia: (namespace, itemId) => {
309
+ return {
310
+ namespace,
311
+ path: `${mediaBase}/item/${itemId}`
312
+ };
313
+ },
314
+ /**
315
+ * Search for items.
316
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
317
+ * @param options The search parameters. See {@link ItemSearchParameters}.
318
+ * @returns The search results. See {@link SearchResponse}.
319
+ */
320
+ itemSearch: (namespace, options) => {
321
+ return {
322
+ namespace,
323
+ parameters: {
324
+ _page: options._page,
325
+ orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby,
326
+ [`name.${options.locale}`]: options.name
327
+ },
328
+ path: `${searchBase}/item`
329
+ };
330
+ }
331
+ };
332
+
333
+ // src/media-search/media-search.ts
334
+ var classicMediaSearchApi = {
335
+ /**
336
+ * Search for media.
337
+ * @param options The search parameters. See {@link MediaSearchParameters}.
338
+ * @returns The search results. See {@link SearchResponse}.
339
+ */
340
+ mediaSearch: (namespace, options) => {
341
+ return {
342
+ namespace,
343
+ parameters: {
344
+ _page: options._page,
345
+ orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby,
346
+ tags: options.tags
347
+ },
348
+ path: `${searchBase}/media`
349
+ };
350
+ }
351
+ };
352
+
353
+ // src/playable-class/playable-class.ts
354
+ var classicPlayableClassApi = {
355
+ /**
356
+ * Get a playable class by ID.
357
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
358
+ * @param playableClassId The playable class ID.
359
+ * @returns The playable class. See {@link PlayableClassResponse}.
360
+ */
361
+ playableClass: (namespace, playableClassId) => {
362
+ return {
363
+ namespace,
364
+ path: `${base}/playable-class/${playableClassId}`
365
+ };
366
+ },
367
+ /**
368
+ * Get a playable class index.
369
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
370
+ * @returns The playable class index. See {@link PlayableClassIndexResponse}.
371
+ */
372
+ playableClassIndex: (namespace) => {
373
+ return {
374
+ namespace,
375
+ path: `${base}/playable-class/index`
376
+ };
377
+ },
378
+ /**
379
+ * Get playable class media by ID.
380
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
381
+ * @param playableClassId The playable class ID.
382
+ * @returns The playable class media. See {@link PlayableClassMediaResponse}.
383
+ */
384
+ playableClassMedia: (namespace, playableClassId) => {
385
+ return {
386
+ namespace,
387
+ path: `${mediaBase}/playable-class/${playableClassId}`
388
+ };
389
+ }
390
+ };
391
+
392
+ // src/playable-race/playable-race.ts
393
+ var classicPlayableRaceApi = {
394
+ /**
395
+ * Get a playable race by ID.
396
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
397
+ * @param playableRaceId The playable race ID.
398
+ * @returns The playable race. See {@link PlayableRaceResponse}.
399
+ */
400
+ playableRace: (namespace, playableRaceId) => {
401
+ return {
402
+ namespace,
403
+ path: `${base}/playable-race/${playableRaceId}`
404
+ };
405
+ },
406
+ /**
407
+ * Get a playable race index.
408
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
409
+ * @returns The playable race index. See {@link PlayableRaceIndexResponse}.
410
+ */
411
+ playableRaceIndex: (namespace) => {
412
+ return {
413
+ namespace,
414
+ path: `${base}/playable-race/index`
415
+ };
416
+ }
417
+ };
418
+
419
+ // src/power-type/power-type.ts
420
+ var classicPowerTypeApi = {
421
+ /**
422
+ * Get a power type by ID.
423
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
424
+ * @param powerTypeId The power type ID.
425
+ * @returns The power type. See {@link PowerTypeResponse}.
426
+ */
427
+ powerType: (namespace, powerTypeId) => {
428
+ return {
429
+ namespace,
430
+ path: `${base}/power-type/${powerTypeId}`
431
+ };
432
+ },
433
+ /**
434
+ * Get a power type index.
435
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
436
+ * @returns The power type index. See {@link PowerTypeIndexResponse}.
437
+ */
438
+ powerTypeIndex: (namespace) => {
439
+ return {
440
+ namespace,
441
+ path: `${base}/power-type/index`
442
+ };
443
+ }
444
+ };
445
+
446
+ // src/pvp-season/pvp-season.ts
447
+ var classicPvpSeasonApi = {
448
+ /**
449
+ * Get a PvP season index.
450
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
451
+ * @returns The PvP season index. See {@link PvpSeasonIndexResponse}.
452
+ */
453
+ pvpSeasonIndex: (namespace) => {
454
+ return {
455
+ namespace,
456
+ path: `${base}/pvp-season/index`
457
+ };
458
+ },
459
+ /**
460
+ * Get a PvP season by ID.
461
+ * @param pvpSeasonId The PvP season ID.
462
+ * @returns The PvP season. See {@link PvpSeasonResponse}.
463
+ */
464
+ pvpSeason: (namespace, pvpSeasonId) => {
465
+ return {
466
+ namespace,
467
+ path: `${base}/pvp-season/${pvpSeasonId}`
468
+ };
469
+ },
470
+ /**
471
+ * Returns an index of PvP Regions.
472
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
473
+ */
474
+ pvpRegionIndex: (namespace) => {
475
+ return {
476
+ namespace,
477
+ path: `${base}/pvp-region/index`
478
+ };
479
+ },
480
+ /**
481
+ * Returns an index of PvP Seasons in a PvP region.
482
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
483
+ * @param pvpRegionId The PvP region ID.
484
+ * @returns The PvP season index. See {@link PvpSeasonIndexResponse}.
485
+ */
486
+ pvpRegionalSeasonIndex: (namespace, pvpRegionId) => {
487
+ return {
488
+ namespace,
489
+ path: `${base}/pvp-region/${pvpRegionId}/pvp-season/index`
490
+ };
491
+ },
492
+ /**
493
+ * Returns a PvP season by region ID and season ID.
494
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
495
+ * @param pvpRegionId The PvP region ID.
496
+ * @param pvpSeasonId The PvP season ID.
497
+ */
498
+ pvpRegionalSeason: (namespace, pvpRegionId, pvpSeasonId) => {
499
+ return {
500
+ namespace,
501
+ path: `${base}/pvp-region/${pvpRegionId}/pvp-season/${pvpSeasonId}`
502
+ };
503
+ },
504
+ /**
505
+ * Returns an index of PvP leaderboards for a PvP season in a given PvP region.
506
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
507
+ * @param pvpRegionId The PvP region ID.
508
+ * @param pvpSeasonId The PvP season ID.
509
+ */
510
+ pvpLeaderboardIndex: (namespace, pvpRegionId, pvpSeasonId) => {
511
+ return {
512
+ namespace,
513
+ path: `${base}/pvp-region/${pvpRegionId}/pvp-season/${pvpSeasonId}/pvp-leaderboard/index`
514
+ };
515
+ },
516
+ /**
517
+ * Get a PvP leaderboard by PvP season ID and bracket.
518
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
519
+ * @param pvpRegionId The PvP region ID.
520
+ * @param pvpSeasonId The PvP season ID.
521
+ * @param pvpBracket The PvP bracket.
522
+ */
523
+ pvpLeaderboard: (namespace, pvpRegionId, pvpSeasonId, pvpBracket) => {
524
+ return {
525
+ namespace,
526
+ path: `${base}/pvp-region/${pvpRegionId}/pvp-season/${pvpSeasonId}/pvp-leaderboard/${pvpBracket}`
527
+ };
528
+ },
529
+ /**
530
+ * Returns an index of PvP rewards for a PvP season in a given PvP region.
531
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
532
+ * @param pvpRegionId The PvP region ID.
533
+ * @param pvpSeasonId The PvP season ID.
534
+ */
535
+ pvpRewardsIndex: (namespace, pvpRegionId, pvpSeasonId) => {
536
+ return {
537
+ namespace,
538
+ path: `${base}/pvp-region/${pvpRegionId}/pvp-season/${pvpSeasonId}/pvp-reward/index`
539
+ };
540
+ }
541
+ };
542
+
543
+ // src/realm/realm.ts
544
+ var classicRealmApi = {
545
+ /**
546
+ * Get a realm by slug.
547
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
548
+ * @param realmSlug The realm slug.
549
+ * @returns The realm. See {@link RealmResponse}.
550
+ */
551
+ realm: (namespace, realmSlug) => {
552
+ return {
553
+ path: `${base}/realm/${realmSlug}`,
554
+ namespace
555
+ };
556
+ },
557
+ /**
558
+ * Get a realm index.
559
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
560
+ * @returns The realm index. See {@link RealmIndexResponse}.
561
+ */
562
+ realmIndex: (namespace) => {
563
+ return {
564
+ path: `${base}/realm/index`,
565
+ namespace
566
+ };
567
+ },
568
+ /**
569
+ * Search for realms.
570
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
571
+ * @param options The search parameters. See {@link RealmSearchParameters}.
572
+ * @returns The search results. See {@link SearchResponse}.
573
+ */
574
+ realmSearch: (namespace, options) => {
575
+ return {
576
+ namespace,
577
+ parameters: {
578
+ _page: options._page,
579
+ orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby,
580
+ timezone: options.timezone
581
+ },
582
+ path: `${searchBase}/realm`
583
+ };
584
+ }
585
+ };
586
+
587
+ // src/region/region.ts
588
+ var classicRegionApi = {
589
+ /**
590
+ * Get a region by ID.
591
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
592
+ * @param regionId The region ID.
593
+ * @returns The region. See {@link RegionResponse}.
594
+ */
595
+ region: (namespace, regionId) => {
596
+ return {
597
+ path: `${base}/region/${regionId}`,
598
+ namespace
599
+ };
600
+ },
601
+ /**
602
+ * Get a region index.
603
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
604
+ * @returns The region index. See {@link RegionIndexResponse}.
605
+ */
606
+ regionIndex: (namespace) => {
607
+ return {
608
+ path: `${base}/region/index`,
609
+ namespace
610
+ };
611
+ }
612
+ };
613
+
614
+ // src/index.ts
615
+ var classicWow = {
616
+ ...classicAuctionHouseApi,
617
+ ...classicConnectedRealmApi,
618
+ ...classicCreatureApi,
619
+ ...classicGuildCrestApi,
620
+ ...classicItemApi,
621
+ ...classicMediaSearchApi,
622
+ ...classicPlayableClassApi,
623
+ ...classicPlayableRaceApi,
624
+ ...classicPowerTypeApi,
625
+ ...classicPvpSeasonApi,
626
+ ...classicRealmApi,
627
+ ...classicRegionApi
628
+ };
629
+ // Annotate the CommonJS export names for ESM import in node:
630
+ 0 && (module.exports = {
631
+ classicWow
632
+ });
633
+ //# sourceMappingURL=index.cjs.map