@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/dist/index.js ADDED
@@ -0,0 +1,606 @@
1
+ // ../wow/src/base.ts
2
+ var base = "/data/wow";
3
+ var mediaBase = `${base}/media`;
4
+ var searchBase = `${base}/search`;
5
+
6
+ // src/auction-house/auction-house.ts
7
+ var classicAuctionHouseApi = {
8
+ /**
9
+ * Returns an index of auction houses for a connected realm.
10
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
11
+ * @param connectedRealmId The ID of the connected realm.
12
+ * @returns The auction house index. See {@link AuctionHouseIndexResponse}.
13
+ */
14
+ auctionHouseIndex: (namespace, connectedRealmId) => {
15
+ return {
16
+ path: `${base}/connected-realm/${connectedRealmId}/auctions/index`,
17
+ namespace
18
+ };
19
+ },
20
+ /**
21
+ * Returns all active auctions for a specific auction house on a connected realm.
22
+ *
23
+ * Auction house data updates at a set interval. The value was initially set at 1 hour; however, it might change over time without notice.
24
+ *
25
+ * 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.
26
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
27
+ * @param connectedRealmId The ID of the connected realm.
28
+ * @param auctionHouseId The ID of the auction house.
29
+ * @returns The auction house data. See {@link AuctionsResponse}.
30
+ */
31
+ auctions: (namespace, connectedRealmId, auctionHouseId) => {
32
+ return {
33
+ path: `${base}/connected-realm/${connectedRealmId}/auctions/${auctionHouseId}`,
34
+ namespace
35
+ };
36
+ }
37
+ };
38
+
39
+ // src/connected-realm/connected-realm.ts
40
+ var classicConnectedRealmApi = {
41
+ /**
42
+ * Returns an index of connected realms.
43
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
44
+ * @returns The connected realm index. See {@link ConnectedRealmIndexResponse}.
45
+ */
46
+ connectedRealmIndex: (namespace) => {
47
+ return {
48
+ path: `${base}/connected-realm/index`,
49
+ namespace
50
+ };
51
+ },
52
+ /**
53
+ * Returns a connected realm by ID.
54
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
55
+ * @param connectedRealmId The connected realm ID.
56
+ * @returns The connected realm. See {@link ConnectedRealmResponse}.
57
+ */
58
+ connectedRealm: (namespace, connectedRealmId) => {
59
+ return {
60
+ path: `${base}/connected-realm/${connectedRealmId}`,
61
+ namespace
62
+ };
63
+ },
64
+ /**
65
+ * Performs a search of connected realms.
66
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
67
+ * @param options The search parameters. See {@link ConnectedRealmSearchParameters}.
68
+ * @returns The search results. See {@link SearchResponse} & {@link ConnectedRealmSearchResponseItem}.
69
+ */
70
+ connectedRealmSearch: (namespace, options) => {
71
+ return {
72
+ namespace,
73
+ parameters: {
74
+ _page: options._page,
75
+ orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby,
76
+ "status.type": options["status.type"],
77
+ "realms.timezone": options["realms.timezone"]
78
+ },
79
+ path: `${base}/search/connected-realm`
80
+ };
81
+ }
82
+ };
83
+
84
+ // src/creature/creature.ts
85
+ var classicCreatureApi = {
86
+ /**
87
+ * Returns a creature by ID.
88
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
89
+ * @param creatureId The creature ID.
90
+ * @returns The creature. See {@link CreatureResponse}.
91
+ */
92
+ creature: (namespace, creatureId) => {
93
+ return {
94
+ path: `${base}/creature/${creatureId}`,
95
+ namespace
96
+ };
97
+ },
98
+ /**
99
+ * Returns media for a creature display by ID.
100
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
101
+ * @param creatureDisplayId The creature display ID.
102
+ * @returns The creature display media. See {@link CreatureDisplayMediaResponse}.
103
+ */
104
+ creatureDisplayMedia: (namespace, creatureDisplayId) => {
105
+ return {
106
+ path: `${mediaBase}/creature-display/${creatureDisplayId}`,
107
+ namespace
108
+ };
109
+ },
110
+ /**
111
+ * Returns a creature family by ID.
112
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
113
+ * @param creatureFamilyId The creature family ID.
114
+ * @returns The creature family. See {@link CreatureFamilyResponse}.
115
+ */
116
+ creatureFamily: (namespace, creatureFamilyId) => {
117
+ return {
118
+ path: `${base}/creature-family/${creatureFamilyId}`,
119
+ namespace
120
+ };
121
+ },
122
+ /**
123
+ * Returns an index of creature families.
124
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
125
+ * @returns The creature family index. See {@link CreatureFamilyIndexResponse}.
126
+ */
127
+ creatureFamilyIndex: (namespace) => {
128
+ return {
129
+ path: `${base}/creature-family/index`,
130
+ namespace
131
+ };
132
+ },
133
+ /**
134
+ * Returns media for a creature family by ID.
135
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
136
+ * @param creatureFamilyId The creature family ID.
137
+ * @returns The creature family media. See {@link CreatureFamilyMediaResponse}.
138
+ */
139
+ creatureFamilyMedia: (namespace, creatureFamilyId) => {
140
+ return {
141
+ path: `${mediaBase}/creature-family/${creatureFamilyId}`,
142
+ namespace
143
+ };
144
+ },
145
+ /**
146
+ * Returns a creature type by ID.
147
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
148
+ * @param creatureTypeId The creature type ID.
149
+ * @returns The creature type. See {@link CreatureTypeResponse}.
150
+ */
151
+ creatureType: (namespace, creatureTypeId) => {
152
+ return {
153
+ path: `${base}/creature-type/${creatureTypeId}`,
154
+ namespace
155
+ };
156
+ },
157
+ /**
158
+ * Returns an index of creature types.
159
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
160
+ * @returns The creature type index. See {@link CreatureTypeIndexResponse}.
161
+ */
162
+ creatureTypeIndex: (namespace) => {
163
+ return {
164
+ path: `${base}/creature-type/index`,
165
+ namespace
166
+ };
167
+ },
168
+ /**
169
+ * Performs a search of creatures.
170
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
171
+ * @param options The creature search parameters. See {@link CreatureSearchParameters}.
172
+ * @returns The creature search results. See {@link SearchResponse} & {@link CreatureSearchResponseItem}.
173
+ */
174
+ creatureSearch: (namespace, options) => {
175
+ return {
176
+ namespace,
177
+ parameters: {
178
+ _page: options._page,
179
+ orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby,
180
+ [`name.${options.locale}`]: options.name
181
+ },
182
+ path: `${searchBase}/creature`
183
+ };
184
+ }
185
+ };
186
+
187
+ // src/guild-crest/guild-crest.ts
188
+ var classicGuildCrestApi = {
189
+ /**
190
+ * Returns an index of guild crest media.
191
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
192
+ * @returns The guild crest components index. See {@link GuildCrestComponentsIndexResponse}.
193
+ */
194
+ guildCrestComponentsIndex: (namespace) => {
195
+ return {
196
+ path: `${base}/guild-crest/index`,
197
+ namespace
198
+ };
199
+ },
200
+ /**
201
+ * Returns media for a guild crest border by ID.
202
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
203
+ * @param borderId The guild crest border ID.
204
+ * @returns The guild crest border. See {@link GuildCrestBorderEmblemResponse}.
205
+ */
206
+ guildCrestBorder: (namespace, borderId) => {
207
+ return {
208
+ path: `${mediaBase}/guild-crest/border/${borderId}`,
209
+ namespace
210
+ };
211
+ },
212
+ /**
213
+ * Returns media for a guild crest emblem by ID.
214
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
215
+ * @param emblemId The guild crest emblem ID.
216
+ * @returns The guild crest emblem. See {@link GuildCrestBorderEmblemResponse}.
217
+ */
218
+ guildCrestEmblem: (namespace, emblemId) => {
219
+ return {
220
+ path: `${mediaBase}/guild-crest/emblem/${emblemId}`,
221
+ namespace
222
+ };
223
+ }
224
+ };
225
+
226
+ // src/item/item.ts
227
+ var classicItemApi = {
228
+ /**
229
+ * Get an item class index.
230
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
231
+ * @returns The item class index. See {@link ItemClassIndexResponse}.
232
+ */
233
+ itemClassIndex: (namespace) => {
234
+ return {
235
+ path: `${base}/item-class/index`,
236
+ namespace
237
+ };
238
+ },
239
+ /**
240
+ * Get an item class by ID.
241
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
242
+ * @param itemClassId The item class ID.
243
+ * @returns The item class. See {@link ItemClassResponse}.
244
+ */
245
+ itemClass: (namespace, itemClassId) => {
246
+ return {
247
+ namespace,
248
+ path: `${base}/item-class/${itemClassId}`
249
+ };
250
+ },
251
+ /**
252
+ * Get an item subclass by ID.
253
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
254
+ * @param itemClassId The item class ID.
255
+ * @param itemSubclassId The item subclass ID.
256
+ * @returns The item subclass. See {@link ItemSubClassResponse}.
257
+ */
258
+ itemSubClass: (namespace, itemClassId, itemSubclassId) => {
259
+ return {
260
+ namespace,
261
+ path: `${base}/item-class/${itemClassId}/item-subclass/${itemSubclassId}`
262
+ };
263
+ },
264
+ /**
265
+ * Get an item by ID.
266
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
267
+ * @param itemId The item ID.
268
+ * @returns The item. See {@link ItemResponse}.
269
+ */
270
+ item: (namespace, itemId) => {
271
+ return {
272
+ namespace,
273
+ path: `${base}/item/${itemId}`
274
+ };
275
+ },
276
+ /**
277
+ * Get item media by ID.
278
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
279
+ * @param itemId The item ID.
280
+ * @returns The item media. See {@link ItemMediaResponse}.
281
+ */
282
+ itemMedia: (namespace, itemId) => {
283
+ return {
284
+ namespace,
285
+ path: `${mediaBase}/item/${itemId}`
286
+ };
287
+ },
288
+ /**
289
+ * Search for items.
290
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
291
+ * @param options The search parameters. See {@link ItemSearchParameters}.
292
+ * @returns The search results. See {@link SearchResponse}.
293
+ */
294
+ itemSearch: (namespace, options) => {
295
+ return {
296
+ namespace,
297
+ parameters: {
298
+ _page: options._page,
299
+ orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby,
300
+ [`name.${options.locale}`]: options.name
301
+ },
302
+ path: `${searchBase}/item`
303
+ };
304
+ }
305
+ };
306
+
307
+ // src/media-search/media-search.ts
308
+ var classicMediaSearchApi = {
309
+ /**
310
+ * Search for media.
311
+ * @param options The search parameters. See {@link MediaSearchParameters}.
312
+ * @returns The search results. See {@link SearchResponse}.
313
+ */
314
+ mediaSearch: (namespace, options) => {
315
+ return {
316
+ namespace,
317
+ parameters: {
318
+ _page: options._page,
319
+ orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby,
320
+ tags: options.tags
321
+ },
322
+ path: `${searchBase}/media`
323
+ };
324
+ }
325
+ };
326
+
327
+ // src/playable-class/playable-class.ts
328
+ var classicPlayableClassApi = {
329
+ /**
330
+ * Get a playable class by ID.
331
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
332
+ * @param playableClassId The playable class ID.
333
+ * @returns The playable class. See {@link PlayableClassResponse}.
334
+ */
335
+ playableClass: (namespace, playableClassId) => {
336
+ return {
337
+ namespace,
338
+ path: `${base}/playable-class/${playableClassId}`
339
+ };
340
+ },
341
+ /**
342
+ * Get a playable class index.
343
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
344
+ * @returns The playable class index. See {@link PlayableClassIndexResponse}.
345
+ */
346
+ playableClassIndex: (namespace) => {
347
+ return {
348
+ namespace,
349
+ path: `${base}/playable-class/index`
350
+ };
351
+ },
352
+ /**
353
+ * Get playable class media by ID.
354
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
355
+ * @param playableClassId The playable class ID.
356
+ * @returns The playable class media. See {@link PlayableClassMediaResponse}.
357
+ */
358
+ playableClassMedia: (namespace, playableClassId) => {
359
+ return {
360
+ namespace,
361
+ path: `${mediaBase}/playable-class/${playableClassId}`
362
+ };
363
+ }
364
+ };
365
+
366
+ // src/playable-race/playable-race.ts
367
+ var classicPlayableRaceApi = {
368
+ /**
369
+ * Get a playable race by ID.
370
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
371
+ * @param playableRaceId The playable race ID.
372
+ * @returns The playable race. See {@link PlayableRaceResponse}.
373
+ */
374
+ playableRace: (namespace, playableRaceId) => {
375
+ return {
376
+ namespace,
377
+ path: `${base}/playable-race/${playableRaceId}`
378
+ };
379
+ },
380
+ /**
381
+ * Get a playable race index.
382
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
383
+ * @returns The playable race index. See {@link PlayableRaceIndexResponse}.
384
+ */
385
+ playableRaceIndex: (namespace) => {
386
+ return {
387
+ namespace,
388
+ path: `${base}/playable-race/index`
389
+ };
390
+ }
391
+ };
392
+
393
+ // src/power-type/power-type.ts
394
+ var classicPowerTypeApi = {
395
+ /**
396
+ * Get a power type by ID.
397
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
398
+ * @param powerTypeId The power type ID.
399
+ * @returns The power type. See {@link PowerTypeResponse}.
400
+ */
401
+ powerType: (namespace, powerTypeId) => {
402
+ return {
403
+ namespace,
404
+ path: `${base}/power-type/${powerTypeId}`
405
+ };
406
+ },
407
+ /**
408
+ * Get a power type index.
409
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
410
+ * @returns The power type index. See {@link PowerTypeIndexResponse}.
411
+ */
412
+ powerTypeIndex: (namespace) => {
413
+ return {
414
+ namespace,
415
+ path: `${base}/power-type/index`
416
+ };
417
+ }
418
+ };
419
+
420
+ // src/pvp-season/pvp-season.ts
421
+ var classicPvpSeasonApi = {
422
+ /**
423
+ * Get a PvP season index.
424
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
425
+ * @returns The PvP season index. See {@link PvpSeasonIndexResponse}.
426
+ */
427
+ pvpSeasonIndex: (namespace) => {
428
+ return {
429
+ namespace,
430
+ path: `${base}/pvp-season/index`
431
+ };
432
+ },
433
+ /**
434
+ * Get a PvP season by ID.
435
+ * @param pvpSeasonId The PvP season ID.
436
+ * @returns The PvP season. See {@link PvpSeasonResponse}.
437
+ */
438
+ pvpSeason: (namespace, pvpSeasonId) => {
439
+ return {
440
+ namespace,
441
+ path: `${base}/pvp-season/${pvpSeasonId}`
442
+ };
443
+ },
444
+ /**
445
+ * Returns an index of PvP Regions.
446
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
447
+ */
448
+ pvpRegionIndex: (namespace) => {
449
+ return {
450
+ namespace,
451
+ path: `${base}/pvp-region/index`
452
+ };
453
+ },
454
+ /**
455
+ * Returns an index of PvP Seasons in a PvP region.
456
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
457
+ * @param pvpRegionId The PvP region ID.
458
+ * @returns The PvP season index. See {@link PvpSeasonIndexResponse}.
459
+ */
460
+ pvpRegionalSeasonIndex: (namespace, pvpRegionId) => {
461
+ return {
462
+ namespace,
463
+ path: `${base}/pvp-region/${pvpRegionId}/pvp-season/index`
464
+ };
465
+ },
466
+ /**
467
+ * Returns a PvP season by region ID and season ID.
468
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
469
+ * @param pvpRegionId The PvP region ID.
470
+ * @param pvpSeasonId The PvP season ID.
471
+ */
472
+ pvpRegionalSeason: (namespace, pvpRegionId, pvpSeasonId) => {
473
+ return {
474
+ namespace,
475
+ path: `${base}/pvp-region/${pvpRegionId}/pvp-season/${pvpSeasonId}`
476
+ };
477
+ },
478
+ /**
479
+ * Returns an index of PvP leaderboards for a PvP season in a given PvP region.
480
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
481
+ * @param pvpRegionId The PvP region ID.
482
+ * @param pvpSeasonId The PvP season ID.
483
+ */
484
+ pvpLeaderboardIndex: (namespace, pvpRegionId, pvpSeasonId) => {
485
+ return {
486
+ namespace,
487
+ path: `${base}/pvp-region/${pvpRegionId}/pvp-season/${pvpSeasonId}/pvp-leaderboard/index`
488
+ };
489
+ },
490
+ /**
491
+ * Get a PvP leaderboard by PvP season ID and bracket.
492
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
493
+ * @param pvpRegionId The PvP region ID.
494
+ * @param pvpSeasonId The PvP season ID.
495
+ * @param pvpBracket The PvP bracket.
496
+ */
497
+ pvpLeaderboard: (namespace, pvpRegionId, pvpSeasonId, pvpBracket) => {
498
+ return {
499
+ namespace,
500
+ path: `${base}/pvp-region/${pvpRegionId}/pvp-season/${pvpSeasonId}/pvp-leaderboard/${pvpBracket}`
501
+ };
502
+ },
503
+ /**
504
+ * Returns an index of PvP rewards for a PvP season in a given PvP region.
505
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
506
+ * @param pvpRegionId The PvP region ID.
507
+ * @param pvpSeasonId The PvP season ID.
508
+ */
509
+ pvpRewardsIndex: (namespace, pvpRegionId, pvpSeasonId) => {
510
+ return {
511
+ namespace,
512
+ path: `${base}/pvp-region/${pvpRegionId}/pvp-season/${pvpSeasonId}/pvp-reward/index`
513
+ };
514
+ }
515
+ };
516
+
517
+ // src/realm/realm.ts
518
+ var classicRealmApi = {
519
+ /**
520
+ * Get a realm by slug.
521
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
522
+ * @param realmSlug The realm slug.
523
+ * @returns The realm. See {@link RealmResponse}.
524
+ */
525
+ realm: (namespace, realmSlug) => {
526
+ return {
527
+ path: `${base}/realm/${realmSlug}`,
528
+ namespace
529
+ };
530
+ },
531
+ /**
532
+ * Get a realm index.
533
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
534
+ * @returns The realm index. See {@link RealmIndexResponse}.
535
+ */
536
+ realmIndex: (namespace) => {
537
+ return {
538
+ path: `${base}/realm/index`,
539
+ namespace
540
+ };
541
+ },
542
+ /**
543
+ * Search for realms.
544
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
545
+ * @param options The search parameters. See {@link RealmSearchParameters}.
546
+ * @returns The search results. See {@link SearchResponse}.
547
+ */
548
+ realmSearch: (namespace, options) => {
549
+ return {
550
+ namespace,
551
+ parameters: {
552
+ _page: options._page,
553
+ orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby,
554
+ timezone: options.timezone
555
+ },
556
+ path: `${searchBase}/realm`
557
+ };
558
+ }
559
+ };
560
+
561
+ // src/region/region.ts
562
+ var classicRegionApi = {
563
+ /**
564
+ * Get a region by ID.
565
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
566
+ * @param regionId The region ID.
567
+ * @returns The region. See {@link RegionResponse}.
568
+ */
569
+ region: (namespace, regionId) => {
570
+ return {
571
+ path: `${base}/region/${regionId}`,
572
+ namespace
573
+ };
574
+ },
575
+ /**
576
+ * Get a region index.
577
+ * @param namespace The namespace to use. See {@link BlizzardNamespaces}.
578
+ * @returns The region index. See {@link RegionIndexResponse}.
579
+ */
580
+ regionIndex: (namespace) => {
581
+ return {
582
+ path: `${base}/region/index`,
583
+ namespace
584
+ };
585
+ }
586
+ };
587
+
588
+ // src/index.ts
589
+ var classicWow = {
590
+ ...classicAuctionHouseApi,
591
+ ...classicConnectedRealmApi,
592
+ ...classicCreatureApi,
593
+ ...classicGuildCrestApi,
594
+ ...classicItemApi,
595
+ ...classicMediaSearchApi,
596
+ ...classicPlayableClassApi,
597
+ ...classicPlayableRaceApi,
598
+ ...classicPowerTypeApi,
599
+ ...classicPvpSeasonApi,
600
+ ...classicRealmApi,
601
+ ...classicRegionApi
602
+ };
603
+ export {
604
+ classicWow
605
+ };
606
+ //# sourceMappingURL=index.js.map