@blizzard-api/classic-wow 1.1.1 → 1.1.3

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 CHANGED
@@ -14,34 +14,39 @@ You can get paths, namespaces, parameters and more for a specific endpoint by ca
14
14
 
15
15
  ```ts
16
16
  import { classicWow } from "@blizzard-api/classic-wow"
17
+ //or
18
+ import classicWow from "@blizzard-api/classic-wow"
17
19
 
18
20
  const powerType = classicWow.powerType("static-classic", 123);
19
- ^ { path: string, namespace: string }
21
+ ^ { path: string, namespace?: string, parameters?: Record<string, never> }
20
22
  ```
21
23
 
24
+ If you don't want to use the exported classicWow object, you can also access the functions directly:
25
+
26
+ ```ts
27
+ import { powerType } from "@blizzard-api/classic-wow"
28
+
29
+ const powerTypeEndpoint = powerType("static-classic", 123);
30
+ ^ { path: string, namespace?: string, parameters?: Record<string, never> }
31
+ ```
32
+
33
+ ### Types
34
+
22
35
  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
36
 
24
37
  ```ts
25
38
  import type { PowerTypeResponse } from '@blizzard-api/classic-wow';
26
39
  ```
27
40
 
28
- If you simply want to use the existing object, you can use the helper from `@blizzard-api/core` like so:
41
+ If you simply want to use the existing object, you can use the helper, `ExtractResourceType`, from `@blizzard-api/core` like so:
29
42
 
30
43
  ```ts
31
44
  import { classicWow } from "@blizzard-api/classic-wow"
45
+ import type { ExtractResourceType } from "@blizzard-api/core";
32
46
 
33
47
  const powerType = classicWow.powerType("static-classic", 123);
34
- ^ { path: string, namespace: string }
35
- type PowerTypeResponse = ExtractResourceType<typeof powerType>;
36
- ```
37
-
38
- If you don't want to use the exported classicWow object, you can also access the functions directly:
39
-
40
- ```ts
41
- import { powerType } from "@blizzard-api/wow"
48
+ ^ { path: string, namespace?: string, parameters?: Record<string, never> }
42
49
 
43
- const powerType = powerType("static-classic", 123);
44
- ^ { path: string, namespace: string }
45
50
  type PowerTypeResponse = ExtractResourceType<typeof powerType>;
46
51
  ```
47
52
 
@@ -56,11 +61,11 @@ Because there are multiple classic flavours of the game, each endpoint will take
56
61
  | World of Warcraft Classic (Era) | static-classic1x-{region} | dynamic-classic1x-{region} | profile-classic1x-{region} |
57
62
  | Wrath of the Lich King Classic (Progression) | static-classic-{region} | dynamic-classic-{region} | profile-classic-{region} |
58
63
 
59
- ## Types
64
+ ## Notes on Types
60
65
 
61
66
  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.
62
67
 
63
- ### Client
68
+ ## Client
64
69
 
65
70
  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.
66
71
 
package/dist/index.cjs CHANGED
@@ -1,71 +1,6 @@
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);
1
+ 'use strict';
19
2
 
20
- // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
23
- auctionHouseIndex: () => auctionHouseIndex,
24
- auctions: () => auctions,
25
- classicWow: () => classicWow,
26
- connectedRealm: () => connectedRealm,
27
- connectedRealmIndex: () => connectedRealmIndex,
28
- connectedRealmSearch: () => connectedRealmSearch,
29
- creature: () => creature,
30
- creatureDisplayMedia: () => creatureDisplayMedia,
31
- creatureFamily: () => creatureFamily,
32
- creatureFamilyIndex: () => creatureFamilyIndex,
33
- creatureFamilyMedia: () => creatureFamilyMedia,
34
- creatureSearch: () => creatureSearch,
35
- creatureType: () => creatureType,
36
- creatureTypeIndex: () => creatureTypeIndex,
37
- guildCrestBorder: () => guildCrestBorder,
38
- guildCrestComponentsIndex: () => guildCrestComponentsIndex,
39
- guildCrestEmblem: () => guildCrestEmblem,
40
- item: () => item,
41
- itemClass: () => itemClass,
42
- itemClassIndex: () => itemClassIndex,
43
- itemMedia: () => itemMedia,
44
- itemSearch: () => itemSearch,
45
- itemSubClass: () => itemSubClass,
46
- mediaSearch: () => mediaSearch,
47
- playableClass: () => playableClass,
48
- playableClassIndex: () => playableClassIndex,
49
- playableClassMedia: () => playableClassMedia,
50
- playableRace: () => playableRace,
51
- playableRaceIndex: () => playableRaceIndex,
52
- powerType: () => powerType,
53
- powerTypeIndex: () => powerTypeIndex,
54
- pvpLeaderboard: () => pvpLeaderboard,
55
- pvpLeaderboardIndex: () => pvpLeaderboardIndex,
56
- pvpRegionIndex: () => pvpRegionIndex,
57
- pvpRegionalSeason: () => pvpRegionalSeason,
58
- pvpRegionalSeasonIndex: () => pvpRegionalSeasonIndex,
59
- pvpRewardsIndex: () => pvpRewardsIndex,
60
- pvpSeason: () => pvpSeason,
61
- pvpSeasonIndex: () => pvpSeasonIndex,
62
- realm: () => realm,
63
- realmIndex: () => realmIndex,
64
- realmSearch: () => realmSearch,
65
- region: () => region,
66
- regionIndex: () => regionIndex
67
- });
68
- module.exports = __toCommonJS(src_exports);
3
+ Object.defineProperty(exports, '__esModule', { value: true });
69
4
 
70
5
  // ../wow/src/base.ts
71
6
  var base = "/data/wow";
@@ -75,28 +10,28 @@ var searchBase = `${base}/search`;
75
10
  // src/auction-house/auction-house.ts
76
11
  function auctionHouseIndex(namespace, connectedRealmId) {
77
12
  return {
78
- path: `${base}/connected-realm/${connectedRealmId}/auctions/index`,
79
- namespace
13
+ namespace,
14
+ path: `${base}/connected-realm/${connectedRealmId}/auctions/index`
80
15
  };
81
16
  }
82
17
  function auctions(namespace, connectedRealmId, auctionHouseId) {
83
18
  return {
84
- path: `${base}/connected-realm/${connectedRealmId}/auctions/${auctionHouseId}`,
85
- namespace
19
+ namespace,
20
+ path: `${base}/connected-realm/${connectedRealmId}/auctions/${auctionHouseId}`
86
21
  };
87
22
  }
88
23
 
89
24
  // src/connected-realm/connected-realm.ts
90
25
  function connectedRealmIndex(namespace) {
91
26
  return {
92
- path: `${base}/connected-realm/index`,
93
- namespace
27
+ namespace,
28
+ path: `${base}/connected-realm/index`
94
29
  };
95
30
  }
96
31
  function connectedRealm(namespace, connectedRealmId) {
97
32
  return {
98
- path: `${base}/connected-realm/${connectedRealmId}`,
99
- namespace
33
+ namespace,
34
+ path: `${base}/connected-realm/${connectedRealmId}`
100
35
  };
101
36
  }
102
37
  function connectedRealmSearch(namespace, options) {
@@ -105,8 +40,8 @@ function connectedRealmSearch(namespace, options) {
105
40
  parameters: {
106
41
  _page: options._page,
107
42
  orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby,
108
- "status.type": options["status.type"],
109
- "realms.timezone": options["realms.timezone"]
43
+ "realms.timezone": options["realms.timezone"],
44
+ "status.type": options["status.type"]
110
45
  },
111
46
  path: `${base}/search/connected-realm`
112
47
  };
@@ -115,44 +50,44 @@ function connectedRealmSearch(namespace, options) {
115
50
  // src/creature/creature.ts
116
51
  function creature(namespace, creatureId) {
117
52
  return {
118
- path: `${base}/creature/${creatureId}`,
119
- namespace
53
+ namespace,
54
+ path: `${base}/creature/${creatureId}`
120
55
  };
121
56
  }
122
57
  function creatureDisplayMedia(namespace, creatureDisplayId) {
123
58
  return {
124
- path: `${mediaBase}/creature-display/${creatureDisplayId}`,
125
- namespace
59
+ namespace,
60
+ path: `${mediaBase}/creature-display/${creatureDisplayId}`
126
61
  };
127
62
  }
128
63
  function creatureFamily(namespace, creatureFamilyId) {
129
64
  return {
130
- path: `${base}/creature-family/${creatureFamilyId}`,
131
- namespace
65
+ namespace,
66
+ path: `${base}/creature-family/${creatureFamilyId}`
132
67
  };
133
68
  }
134
69
  function creatureFamilyIndex(namespace) {
135
70
  return {
136
- path: `${base}/creature-family/index`,
137
- namespace
71
+ namespace,
72
+ path: `${base}/creature-family/index`
138
73
  };
139
74
  }
140
75
  function creatureFamilyMedia(namespace, creatureFamilyId) {
141
76
  return {
142
- path: `${mediaBase}/creature-family/${creatureFamilyId}`,
143
- namespace
77
+ namespace,
78
+ path: `${mediaBase}/creature-family/${creatureFamilyId}`
144
79
  };
145
80
  }
146
81
  function creatureType(namespace, creatureTypeId) {
147
82
  return {
148
- path: `${base}/creature-type/${creatureTypeId}`,
149
- namespace
83
+ namespace,
84
+ path: `${base}/creature-type/${creatureTypeId}`
150
85
  };
151
86
  }
152
87
  function creatureTypeIndex(namespace) {
153
88
  return {
154
- path: `${base}/creature-type/index`,
155
- namespace
89
+ namespace,
90
+ path: `${base}/creature-type/index`
156
91
  };
157
92
  }
158
93
  function creatureSearch(namespace, options) {
@@ -160,8 +95,8 @@ function creatureSearch(namespace, options) {
160
95
  namespace,
161
96
  parameters: {
162
97
  _page: options._page,
163
- orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby,
164
- [`name.${options.locale}`]: options.name
98
+ [`name.${options.locale}`]: options.name,
99
+ orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby
165
100
  },
166
101
  path: `${searchBase}/creature`
167
102
  };
@@ -170,28 +105,28 @@ function creatureSearch(namespace, options) {
170
105
  // src/guild-crest/guild-crest.ts
171
106
  function guildCrestComponentsIndex(namespace) {
172
107
  return {
173
- path: `${base}/guild-crest/index`,
174
- namespace
108
+ namespace,
109
+ path: `${base}/guild-crest/index`
175
110
  };
176
111
  }
177
112
  function guildCrestBorder(namespace, borderId) {
178
113
  return {
179
- path: `${mediaBase}/guild-crest/border/${borderId}`,
180
- namespace
114
+ namespace,
115
+ path: `${mediaBase}/guild-crest/border/${borderId}`
181
116
  };
182
117
  }
183
118
  function guildCrestEmblem(namespace, emblemId) {
184
119
  return {
185
- path: `${mediaBase}/guild-crest/emblem/${emblemId}`,
186
- namespace
120
+ namespace,
121
+ path: `${mediaBase}/guild-crest/emblem/${emblemId}`
187
122
  };
188
123
  }
189
124
 
190
125
  // src/item/item.ts
191
126
  function itemClassIndex(namespace) {
192
127
  return {
193
- path: `${base}/item-class/index`,
194
- namespace
128
+ namespace,
129
+ path: `${base}/item-class/index`
195
130
  };
196
131
  }
197
132
  function itemClass(namespace, itemClassId) {
@@ -223,8 +158,8 @@ function itemSearch(namespace, options) {
223
158
  namespace,
224
159
  parameters: {
225
160
  _page: options._page,
226
- orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby,
227
- [`name.${options.locale}`]: options.name
161
+ [`name.${options.locale}`]: options.name,
162
+ orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby
228
163
  },
229
164
  path: `${searchBase}/item`
230
165
  };
@@ -344,14 +279,14 @@ function pvpRewardsIndex(namespace, pvpRegionId, pvpSeasonId) {
344
279
  // src/realm/realm.ts
345
280
  function realm(namespace, realmSlug) {
346
281
  return {
347
- path: `${base}/realm/${realmSlug}`,
348
- namespace
282
+ namespace,
283
+ path: `${base}/realm/${realmSlug}`
349
284
  };
350
285
  }
351
286
  function realmIndex(namespace) {
352
287
  return {
353
- path: `${base}/realm/index`,
354
- namespace
288
+ namespace,
289
+ path: `${base}/realm/index`
355
290
  };
356
291
  }
357
292
  function realmSearch(namespace, options) {
@@ -369,14 +304,14 @@ function realmSearch(namespace, options) {
369
304
  // src/region/region.ts
370
305
  function region(namespace, regionId) {
371
306
  return {
372
- path: `${base}/region/${regionId}`,
373
- namespace
307
+ namespace,
308
+ path: `${base}/region/${regionId}`
374
309
  };
375
310
  }
376
311
  function regionIndex(namespace) {
377
312
  return {
378
- path: `${base}/region/index`,
379
- namespace
313
+ namespace,
314
+ path: `${base}/region/index`
380
315
  };
381
316
  }
382
317
 
@@ -395,20 +330,20 @@ var classicWow = {
395
330
  creatureFamily,
396
331
  creatureFamilyIndex,
397
332
  creatureFamilyMedia,
333
+ creatureSearch,
398
334
  creatureType,
399
335
  creatureTypeIndex,
400
- creatureSearch,
401
336
  //Guild Crest
402
- guildCrestComponentsIndex,
403
337
  guildCrestBorder,
338
+ guildCrestComponentsIndex,
404
339
  guildCrestEmblem,
405
340
  //Item
406
- itemClassIndex,
407
- itemClass,
408
- itemSubClass,
409
341
  item,
342
+ itemClass,
343
+ itemClassIndex,
410
344
  itemMedia,
411
345
  itemSearch,
346
+ itemSubClass,
412
347
  //Media Search
413
348
  mediaSearch,
414
349
  //Playable Class
@@ -422,67 +357,68 @@ var classicWow = {
422
357
  powerType,
423
358
  powerTypeIndex,
424
359
  //Pvp Season
425
- pvpSeasonIndex,
426
- pvpSeason,
427
- pvpRegionIndex,
428
- pvpRegionalSeasonIndex,
429
- pvpRegionalSeason,
430
- pvpLeaderboardIndex,
431
- pvpLeaderboard,
432
- pvpRewardsIndex,
433
- //Realm
434
- realm,
435
- realmIndex,
436
- realmSearch,
437
- //Region
438
- region,
439
- regionIndex
440
- };
441
- // Annotate the CommonJS export names for ESM import in node:
442
- 0 && (module.exports = {
443
- auctionHouseIndex,
444
- auctions,
445
- classicWow,
446
- connectedRealm,
447
- connectedRealmIndex,
448
- connectedRealmSearch,
449
- creature,
450
- creatureDisplayMedia,
451
- creatureFamily,
452
- creatureFamilyIndex,
453
- creatureFamilyMedia,
454
- creatureSearch,
455
- creatureType,
456
- creatureTypeIndex,
457
- guildCrestBorder,
458
- guildCrestComponentsIndex,
459
- guildCrestEmblem,
460
- item,
461
- itemClass,
462
- itemClassIndex,
463
- itemMedia,
464
- itemSearch,
465
- itemSubClass,
466
- mediaSearch,
467
- playableClass,
468
- playableClassIndex,
469
- playableClassMedia,
470
- playableRace,
471
- playableRaceIndex,
472
- powerType,
473
- powerTypeIndex,
474
360
  pvpLeaderboard,
475
361
  pvpLeaderboardIndex,
476
- pvpRegionIndex,
477
362
  pvpRegionalSeason,
478
363
  pvpRegionalSeasonIndex,
364
+ pvpRegionIndex,
479
365
  pvpRewardsIndex,
480
366
  pvpSeason,
481
367
  pvpSeasonIndex,
368
+ //Realm
482
369
  realm,
483
370
  realmIndex,
484
371
  realmSearch,
372
+ //Region
485
373
  region,
486
374
  regionIndex
487
- });
375
+ };
376
+ var src_default = classicWow;
377
+
378
+ exports.auctionHouseIndex = auctionHouseIndex;
379
+ exports.auctions = auctions;
380
+ exports.classicWow = classicWow;
381
+ exports.connectedRealm = connectedRealm;
382
+ exports.connectedRealmIndex = connectedRealmIndex;
383
+ exports.connectedRealmSearch = connectedRealmSearch;
384
+ exports.creature = creature;
385
+ exports.creatureDisplayMedia = creatureDisplayMedia;
386
+ exports.creatureFamily = creatureFamily;
387
+ exports.creatureFamilyIndex = creatureFamilyIndex;
388
+ exports.creatureFamilyMedia = creatureFamilyMedia;
389
+ exports.creatureSearch = creatureSearch;
390
+ exports.creatureType = creatureType;
391
+ exports.creatureTypeIndex = creatureTypeIndex;
392
+ exports.default = src_default;
393
+ exports.guildCrestBorder = guildCrestBorder;
394
+ exports.guildCrestComponentsIndex = guildCrestComponentsIndex;
395
+ exports.guildCrestEmblem = guildCrestEmblem;
396
+ exports.item = item;
397
+ exports.itemClass = itemClass;
398
+ exports.itemClassIndex = itemClassIndex;
399
+ exports.itemMedia = itemMedia;
400
+ exports.itemSearch = itemSearch;
401
+ exports.itemSubClass = itemSubClass;
402
+ exports.mediaSearch = mediaSearch;
403
+ exports.playableClass = playableClass;
404
+ exports.playableClassIndex = playableClassIndex;
405
+ exports.playableClassMedia = playableClassMedia;
406
+ exports.playableRace = playableRace;
407
+ exports.playableRaceIndex = playableRaceIndex;
408
+ exports.powerType = powerType;
409
+ exports.powerTypeIndex = powerTypeIndex;
410
+ exports.pvpLeaderboard = pvpLeaderboard;
411
+ exports.pvpLeaderboardIndex = pvpLeaderboardIndex;
412
+ exports.pvpRegionIndex = pvpRegionIndex;
413
+ exports.pvpRegionalSeason = pvpRegionalSeason;
414
+ exports.pvpRegionalSeasonIndex = pvpRegionalSeasonIndex;
415
+ exports.pvpRewardsIndex = pvpRewardsIndex;
416
+ exports.pvpSeason = pvpSeason;
417
+ exports.pvpSeasonIndex = pvpSeasonIndex;
418
+ exports.realm = realm;
419
+ exports.realmIndex = realmIndex;
420
+ exports.realmSearch = realmSearch;
421
+ exports.region = region;
422
+ exports.regionIndex = regionIndex;
423
+ //# sourceMappingURL=out.js.map
488
424
  //# sourceMappingURL=index.cjs.map