@pinta365/blizzard_api 0.4.0 → 0.6.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.
Files changed (423) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +153 -37
  3. package/esm/mod.d.ts +43 -6
  4. package/esm/mod.js +69 -6
  5. package/esm/src/client.d.ts +95 -0
  6. package/esm/src/client.js +52 -0
  7. package/esm/src/diablo3/community/act.d.ts +29 -0
  8. package/esm/src/diablo3/community/act.js +23 -0
  9. package/esm/src/diablo3/community/artisan.d.ts +50 -0
  10. package/esm/src/diablo3/community/artisan.js +25 -0
  11. package/esm/src/diablo3/community/follower.d.ts +25 -0
  12. package/esm/src/diablo3/community/follower.js +12 -0
  13. package/esm/src/diablo3/community/hero.d.ts +57 -0
  14. package/esm/src/diablo3/community/hero.js +25 -0
  15. package/esm/src/diablo3/community/item.d.ts +48 -0
  16. package/esm/src/diablo3/community/item.js +12 -0
  17. package/esm/src/diablo3/community/item_type.d.ts +26 -0
  18. package/esm/src/diablo3/community/item_type.js +23 -0
  19. package/esm/src/diablo3/community/profile.d.ts +352 -0
  20. package/esm/src/diablo3/community/profile.js +61 -0
  21. package/esm/src/diablo3/game_data/d3.d.ts +127 -0
  22. package/esm/src/diablo3/game_data/d3.js +72 -0
  23. package/esm/src/diablo3/index.d.ts +8 -0
  24. package/esm/src/diablo3/index.js +8 -0
  25. package/esm/src/diablo3/types.d.ts +8 -0
  26. package/esm/src/diablo3/types.js +1 -0
  27. package/esm/src/generated/diablo3_api.d.ts +156 -0
  28. package/esm/src/generated/diablo3_api.js +2 -0
  29. package/esm/src/generated/hearthstone_api.d.ts +51 -0
  30. package/esm/src/generated/hearthstone_api.js +2 -0
  31. package/esm/src/generated/sc2_api.d.ts +139 -0
  32. package/esm/src/generated/sc2_api.js +2 -0
  33. package/esm/src/generated/wow_api.d.ts +1482 -0
  34. package/esm/src/generated/wow_api.js +2 -0
  35. package/esm/src/generated/wow_classic_api.d.ts +555 -0
  36. package/esm/src/generated/wow_classic_api.js +2 -0
  37. package/esm/src/generated/wow_classic_era_api.d.ts +418 -0
  38. package/esm/src/generated/wow_classic_era_api.js +2 -0
  39. package/esm/src/hearthstone/game_data/card_backs.d.ts +31 -0
  40. package/esm/src/hearthstone/game_data/card_backs.js +22 -0
  41. package/esm/src/hearthstone/game_data/cards.d.ts +55 -0
  42. package/esm/src/hearthstone/game_data/cards.js +26 -0
  43. package/esm/src/hearthstone/game_data/decks.d.ts +29 -0
  44. package/esm/src/hearthstone/game_data/decks.js +13 -0
  45. package/esm/src/hearthstone/game_data/metadata.d.ts +82 -0
  46. package/esm/src/hearthstone/game_data/metadata.js +11 -0
  47. package/esm/src/hearthstone/index.d.ts +4 -0
  48. package/esm/src/hearthstone/index.js +4 -0
  49. package/esm/src/hearthstone/search.d.ts +21 -0
  50. package/esm/src/hearthstone/search.js +28 -0
  51. package/esm/src/hearthstone/types.d.ts +5 -0
  52. package/esm/src/hearthstone/types.js +1 -0
  53. package/esm/src/shared/bind.d.ts +14 -0
  54. package/esm/src/shared/bind.js +15 -0
  55. package/esm/src/shared/context.d.ts +163 -0
  56. package/esm/src/shared/context.js +304 -0
  57. package/esm/src/shared/errors.d.ts +53 -0
  58. package/esm/src/shared/errors.js +95 -0
  59. package/esm/src/shared/index.d.ts +4 -0
  60. package/esm/src/shared/index.js +2 -0
  61. package/esm/src/shared/types.d.ts +133 -0
  62. package/esm/src/shared/types.js +2 -0
  63. package/esm/src/starcraft2/community/account.d.ts +19 -0
  64. package/esm/src/starcraft2/community/account.js +15 -0
  65. package/esm/src/starcraft2/community/ladder.d.ts +29 -0
  66. package/esm/src/starcraft2/community/ladder.js +27 -0
  67. package/esm/src/starcraft2/community/legacy.d.ts +206 -0
  68. package/esm/src/starcraft2/community/legacy.js +83 -0
  69. package/esm/src/starcraft2/community/profile.d.ts +255 -0
  70. package/esm/src/starcraft2/community/profile.js +73 -0
  71. package/esm/src/starcraft2/game_data/league.d.ts +35 -0
  72. package/esm/src/starcraft2/game_data/league.js +20 -0
  73. package/esm/src/starcraft2/index.d.ts +5 -0
  74. package/esm/src/starcraft2/index.js +5 -0
  75. package/esm/src/starcraft2/types.d.ts +5 -0
  76. package/esm/src/starcraft2/types.js +1 -0
  77. package/esm/src/wow/game_data/achievement.d.ts +87 -0
  78. package/esm/src/wow/game_data/achievement.js +68 -0
  79. package/esm/src/wow/game_data/auction_house.d.ts +65 -0
  80. package/esm/src/wow/game_data/auction_house.js +33 -0
  81. package/esm/src/wow/game_data/azerite_essence.d.ts +50 -0
  82. package/esm/src/wow/game_data/azerite_essence.js +48 -0
  83. package/esm/src/wow/game_data/connected_realm.d.ts +62 -0
  84. package/esm/src/wow/game_data/connected_realm.js +35 -0
  85. package/esm/src/wow/game_data/covenant.d.ts +115 -0
  86. package/esm/src/wow/game_data/covenant.js +88 -0
  87. package/esm/src/wow/game_data/creature.d.ts +98 -0
  88. package/esm/src/wow/game_data/creature.js +99 -0
  89. package/esm/src/wow/game_data/guild_crest.d.ts +56 -0
  90. package/esm/src/wow/game_data/guild_crest.js +38 -0
  91. package/esm/src/wow/game_data/heirloom.d.ts +82 -0
  92. package/esm/src/wow/game_data/heirloom.js +25 -0
  93. package/esm/src/wow/game_data/housing.d.ts +111 -0
  94. package/esm/src/wow/game_data/housing.js +124 -0
  95. package/esm/src/wow/game_data/item.d.ts +183 -0
  96. package/esm/src/wow/game_data/item.js +100 -0
  97. package/esm/src/wow/game_data/item_appearance.d.ts +102 -0
  98. package/esm/src/wow/game_data/item_appearance.js +73 -0
  99. package/esm/src/wow/game_data/journal.d.ts +124 -0
  100. package/esm/src/wow/game_data/journal.js +98 -0
  101. package/esm/src/wow/game_data/keystone_affix.d.ts +39 -0
  102. package/esm/src/wow/game_data/keystone_affix.js +38 -0
  103. package/esm/src/wow/game_data/media_search.d.ts +9 -0
  104. package/esm/src/wow/game_data/media_search.js +10 -0
  105. package/esm/src/wow/game_data/modified_crafting.d.ts +65 -0
  106. package/esm/src/wow/game_data/modified_crafting.js +62 -0
  107. package/esm/src/wow/game_data/mount.d.ts +38 -0
  108. package/esm/src/wow/game_data/mount.js +35 -0
  109. package/esm/src/wow/game_data/mythic_keystone_dungeon.d.ts +92 -0
  110. package/esm/src/wow/game_data/mythic_keystone_dungeon.js +87 -0
  111. package/esm/src/wow/game_data/mythic_keystone_leaderboard.d.ts +70 -0
  112. package/esm/src/wow/game_data/mythic_keystone_leaderboard.js +28 -0
  113. package/esm/src/wow/game_data/mythic_raid_leaderboard.d.ts +36 -0
  114. package/esm/src/wow/game_data/mythic_raid_leaderboard.js +14 -0
  115. package/esm/src/wow/game_data/neighborhood.d.ts +36 -0
  116. package/esm/src/wow/game_data/neighborhood.js +38 -0
  117. package/esm/src/wow/game_data/pet.d.ts +93 -0
  118. package/esm/src/wow/game_data/pet.js +76 -0
  119. package/esm/src/wow/game_data/playable_class.d.ts +58 -0
  120. package/esm/src/wow/game_data/playable_class.js +51 -0
  121. package/esm/src/wow/game_data/playable_race.d.ts +31 -0
  122. package/esm/src/wow/game_data/playable_race.js +25 -0
  123. package/esm/src/wow/game_data/playable_specialization.d.ts +63 -0
  124. package/esm/src/wow/game_data/playable_specialization.js +38 -0
  125. package/esm/src/wow/game_data/power_type.d.ts +22 -0
  126. package/esm/src/wow/game_data/power_type.js +25 -0
  127. package/esm/src/wow/game_data/profession.d.ts +88 -0
  128. package/esm/src/wow/game_data/profession.js +78 -0
  129. package/esm/src/wow/game_data/pvp_season.d.ts +108 -0
  130. package/esm/src/wow/game_data/pvp_season.js +66 -0
  131. package/esm/src/wow/game_data/pvp_tier.d.ts +41 -0
  132. package/esm/src/wow/game_data/pvp_tier.js +38 -0
  133. package/esm/src/wow/game_data/quest.d.ts +116 -0
  134. package/esm/src/wow/game_data/quest.js +100 -0
  135. package/esm/src/wow/game_data/realm.d.ts +43 -0
  136. package/esm/src/wow/game_data/realm.js +35 -0
  137. package/esm/src/wow/game_data/region.d.ts +26 -0
  138. package/esm/src/wow/game_data/region.js +25 -0
  139. package/esm/src/wow/game_data/reputations.d.ts +57 -0
  140. package/esm/src/wow/game_data/reputations.js +50 -0
  141. package/esm/src/wow/game_data/spell.d.ts +34 -0
  142. package/esm/src/wow/game_data/spell.js +36 -0
  143. package/esm/src/wow/game_data/talent.d.ts +143 -0
  144. package/esm/src/wow/game_data/talent.js +89 -0
  145. package/esm/src/wow/game_data/tech_talent.d.ts +72 -0
  146. package/esm/src/wow/game_data/tech_talent.js +63 -0
  147. package/esm/src/wow/game_data/title.d.ts +33 -0
  148. package/esm/src/wow/game_data/title.js +25 -0
  149. package/esm/src/wow/game_data/token.d.ts +17 -0
  150. package/esm/src/wow/game_data/token.js +18 -0
  151. package/esm/src/wow/game_data/toy.d.ts +25 -0
  152. package/esm/src/wow/game_data/toy.js +25 -0
  153. package/esm/src/wow/index.d.ts +59 -0
  154. package/esm/src/wow/index.js +61 -0
  155. package/esm/src/wow/profile/account_profile.d.ts +185 -0
  156. package/esm/src/wow/profile/account_profile.js +132 -0
  157. package/esm/src/wow/profile/character_achievements.d.ts +88 -0
  158. package/esm/src/wow/profile/character_achievements.js +28 -0
  159. package/esm/src/wow/profile/character_appearance.d.ts +79 -0
  160. package/esm/src/wow/profile/character_appearance.js +14 -0
  161. package/esm/src/wow/profile/character_collections.d.ts +132 -0
  162. package/esm/src/wow/profile/character_collections.js +98 -0
  163. package/esm/src/wow/profile/character_encounters.d.ts +78 -0
  164. package/esm/src/wow/profile/character_encounters.js +42 -0
  165. package/esm/src/wow/profile/character_equipment.d.ts +177 -0
  166. package/esm/src/wow/profile/character_equipment.js +14 -0
  167. package/esm/src/wow/profile/character_house.d.ts +16 -0
  168. package/esm/src/wow/profile/character_house.js +17 -0
  169. package/esm/src/wow/profile/character_hunter_pets.d.ts +22 -0
  170. package/esm/src/wow/profile/character_hunter_pets.js +14 -0
  171. package/esm/src/wow/profile/character_media.d.ts +14 -0
  172. package/esm/src/wow/profile/character_media.js +14 -0
  173. package/esm/src/wow/profile/character_mythic_keystone_profile.d.ts +70 -0
  174. package/esm/src/wow/profile/character_mythic_keystone_profile.js +31 -0
  175. package/esm/src/wow/profile/character_professions.d.ts +29 -0
  176. package/esm/src/wow/profile/character_professions.js +14 -0
  177. package/esm/src/wow/profile/character_profile.d.ts +83 -0
  178. package/esm/src/wow/profile/character_profile.js +39 -0
  179. package/esm/src/wow/profile/character_pvp.d.ts +53 -0
  180. package/esm/src/wow/profile/character_pvp.js +29 -0
  181. package/esm/src/wow/profile/character_quests.d.ts +29 -0
  182. package/esm/src/wow/profile/character_quests.js +28 -0
  183. package/esm/src/wow/profile/character_reputations.d.ts +30 -0
  184. package/esm/src/wow/profile/character_reputations.js +14 -0
  185. package/esm/src/wow/profile/character_soulbinds.d.ts +31 -0
  186. package/esm/src/wow/profile/character_soulbinds.js +14 -0
  187. package/esm/src/wow/profile/character_specializations.d.ts +82 -0
  188. package/esm/src/wow/profile/character_specializations.js +14 -0
  189. package/esm/src/wow/profile/character_statistics.d.ts +104 -0
  190. package/esm/src/wow/profile/character_statistics.js +14 -0
  191. package/esm/src/wow/profile/character_titles.d.ts +14 -0
  192. package/esm/src/wow/profile/character_titles.js +14 -0
  193. package/esm/src/wow/profile/guild.d.ts +150 -0
  194. package/esm/src/wow/profile/guild.js +56 -0
  195. package/esm/src/wow/search.d.ts +23 -0
  196. package/esm/src/wow/search.js +29 -0
  197. package/esm/src/wow/types.d.ts +58 -0
  198. package/esm/src/wow/types.js +1 -0
  199. package/esm/src/wow_classic/auction_house.d.ts +41 -0
  200. package/esm/src/wow_classic/auction_house.js +31 -0
  201. package/esm/src/wow_classic/character_specializations.d.ts +45 -0
  202. package/esm/src/wow_classic/character_specializations.js +18 -0
  203. package/esm/src/wow_classic/era.d.ts +8 -0
  204. package/esm/src/wow_classic/era.js +10 -0
  205. package/esm/src/wow_classic/index.d.ts +15 -0
  206. package/esm/src/wow_classic/index.js +17 -0
  207. package/esm/src/wow_classic/profile_overrides.d.ts +125 -0
  208. package/esm/src/wow_classic/profile_overrides.js +111 -0
  209. package/esm/src/wow_classic/shared.d.ts +23 -0
  210. package/esm/src/wow_classic/shared.js +26 -0
  211. package/esm/src/wow_classic/types.d.ts +3 -0
  212. package/esm/src/wow_classic/types.js +1 -0
  213. package/package.json +23 -2
  214. package/script/mod.d.ts +43 -6
  215. package/script/mod.js +91 -21
  216. package/script/src/client.d.ts +95 -0
  217. package/script/src/client.js +89 -0
  218. package/script/src/diablo3/community/act.d.ts +29 -0
  219. package/script/src/diablo3/community/act.js +27 -0
  220. package/script/src/diablo3/community/artisan.d.ts +50 -0
  221. package/script/src/diablo3/community/artisan.js +29 -0
  222. package/script/src/diablo3/community/follower.d.ts +25 -0
  223. package/script/src/diablo3/community/follower.js +15 -0
  224. package/script/src/diablo3/community/hero.d.ts +57 -0
  225. package/script/src/diablo3/community/hero.js +29 -0
  226. package/script/src/diablo3/community/item.d.ts +48 -0
  227. package/script/src/diablo3/community/item.js +15 -0
  228. package/script/src/diablo3/community/item_type.d.ts +26 -0
  229. package/script/src/diablo3/community/item_type.js +27 -0
  230. package/script/src/diablo3/community/profile.d.ts +352 -0
  231. package/script/src/diablo3/community/profile.js +67 -0
  232. package/script/src/diablo3/game_data/d3.d.ts +127 -0
  233. package/script/src/diablo3/game_data/d3.js +80 -0
  234. package/script/src/diablo3/index.d.ts +8 -0
  235. package/script/src/diablo3/index.js +31 -0
  236. package/script/src/diablo3/types.d.ts +8 -0
  237. package/script/src/diablo3/types.js +2 -0
  238. package/script/src/generated/diablo3_api.d.ts +156 -0
  239. package/script/src/generated/diablo3_api.js +3 -0
  240. package/script/src/generated/hearthstone_api.d.ts +51 -0
  241. package/script/src/generated/hearthstone_api.js +3 -0
  242. package/script/src/generated/sc2_api.d.ts +139 -0
  243. package/script/src/generated/sc2_api.js +3 -0
  244. package/script/src/generated/wow_api.d.ts +1482 -0
  245. package/script/src/generated/wow_api.js +3 -0
  246. package/script/src/generated/wow_classic_api.d.ts +555 -0
  247. package/script/src/generated/wow_classic_api.js +3 -0
  248. package/script/src/generated/wow_classic_era_api.d.ts +418 -0
  249. package/script/src/generated/wow_classic_era_api.js +3 -0
  250. package/script/src/hearthstone/game_data/card_backs.d.ts +31 -0
  251. package/script/src/hearthstone/game_data/card_backs.js +26 -0
  252. package/script/src/hearthstone/game_data/cards.d.ts +55 -0
  253. package/script/src/hearthstone/game_data/cards.js +30 -0
  254. package/script/src/hearthstone/game_data/decks.d.ts +29 -0
  255. package/script/src/hearthstone/game_data/decks.js +16 -0
  256. package/script/src/hearthstone/game_data/metadata.d.ts +82 -0
  257. package/script/src/hearthstone/game_data/metadata.js +14 -0
  258. package/script/src/hearthstone/index.d.ts +4 -0
  259. package/script/src/hearthstone/index.js +13 -0
  260. package/script/src/hearthstone/search.d.ts +21 -0
  261. package/script/src/hearthstone/search.js +31 -0
  262. package/script/src/hearthstone/types.d.ts +5 -0
  263. package/script/src/hearthstone/types.js +2 -0
  264. package/script/src/shared/bind.d.ts +14 -0
  265. package/script/src/shared/bind.js +18 -0
  266. package/script/src/shared/context.d.ts +163 -0
  267. package/script/src/shared/context.js +312 -0
  268. package/script/src/shared/errors.d.ts +53 -0
  269. package/script/src/shared/errors.js +104 -0
  270. package/script/src/shared/index.d.ts +4 -0
  271. package/script/src/shared/index.js +10 -0
  272. package/script/src/shared/types.d.ts +133 -0
  273. package/script/src/shared/types.js +3 -0
  274. package/script/src/starcraft2/community/account.d.ts +19 -0
  275. package/script/src/starcraft2/community/account.js +18 -0
  276. package/script/src/starcraft2/community/ladder.d.ts +29 -0
  277. package/script/src/starcraft2/community/ladder.js +31 -0
  278. package/script/src/starcraft2/community/legacy.d.ts +206 -0
  279. package/script/src/starcraft2/community/legacy.js +91 -0
  280. package/script/src/starcraft2/community/profile.d.ts +255 -0
  281. package/script/src/starcraft2/community/profile.js +80 -0
  282. package/script/src/starcraft2/game_data/league.d.ts +35 -0
  283. package/script/src/starcraft2/game_data/league.js +23 -0
  284. package/script/src/starcraft2/index.d.ts +5 -0
  285. package/script/src/starcraft2/index.js +23 -0
  286. package/script/src/starcraft2/types.d.ts +5 -0
  287. package/script/src/starcraft2/types.js +2 -0
  288. package/script/src/wow/game_data/achievement.d.ts +87 -0
  289. package/script/src/wow/game_data/achievement.js +75 -0
  290. package/script/src/wow/game_data/auction_house.d.ts +65 -0
  291. package/script/src/wow/game_data/auction_house.js +37 -0
  292. package/script/src/wow/game_data/azerite_essence.d.ts +50 -0
  293. package/script/src/wow/game_data/azerite_essence.js +54 -0
  294. package/script/src/wow/game_data/connected_realm.d.ts +62 -0
  295. package/script/src/wow/game_data/connected_realm.js +40 -0
  296. package/script/src/wow/game_data/covenant.d.ts +115 -0
  297. package/script/src/wow/game_data/covenant.js +97 -0
  298. package/script/src/wow/game_data/creature.d.ts +98 -0
  299. package/script/src/wow/game_data/creature.js +109 -0
  300. package/script/src/wow/game_data/guild_crest.d.ts +56 -0
  301. package/script/src/wow/game_data/guild_crest.js +43 -0
  302. package/script/src/wow/game_data/heirloom.d.ts +82 -0
  303. package/script/src/wow/game_data/heirloom.js +29 -0
  304. package/script/src/wow/game_data/housing.d.ts +111 -0
  305. package/script/src/wow/game_data/housing.js +138 -0
  306. package/script/src/wow/game_data/item.d.ts +183 -0
  307. package/script/src/wow/game_data/item.js +110 -0
  308. package/script/src/wow/game_data/item_appearance.d.ts +102 -0
  309. package/script/src/wow/game_data/item_appearance.js +81 -0
  310. package/script/src/wow/game_data/journal.d.ts +124 -0
  311. package/script/src/wow/game_data/journal.js +108 -0
  312. package/script/src/wow/game_data/keystone_affix.d.ts +39 -0
  313. package/script/src/wow/game_data/keystone_affix.js +43 -0
  314. package/script/src/wow/game_data/media_search.d.ts +9 -0
  315. package/script/src/wow/game_data/media_search.js +13 -0
  316. package/script/src/wow/game_data/modified_crafting.d.ts +65 -0
  317. package/script/src/wow/game_data/modified_crafting.js +69 -0
  318. package/script/src/wow/game_data/mount.d.ts +38 -0
  319. package/script/src/wow/game_data/mount.js +40 -0
  320. package/script/src/wow/game_data/mythic_keystone_dungeon.d.ts +92 -0
  321. package/script/src/wow/game_data/mythic_keystone_dungeon.js +96 -0
  322. package/script/src/wow/game_data/mythic_keystone_leaderboard.d.ts +70 -0
  323. package/script/src/wow/game_data/mythic_keystone_leaderboard.js +32 -0
  324. package/script/src/wow/game_data/mythic_raid_leaderboard.d.ts +36 -0
  325. package/script/src/wow/game_data/mythic_raid_leaderboard.js +17 -0
  326. package/script/src/wow/game_data/neighborhood.d.ts +36 -0
  327. package/script/src/wow/game_data/neighborhood.js +43 -0
  328. package/script/src/wow/game_data/pet.d.ts +93 -0
  329. package/script/src/wow/game_data/pet.js +84 -0
  330. package/script/src/wow/game_data/playable_class.d.ts +58 -0
  331. package/script/src/wow/game_data/playable_class.js +57 -0
  332. package/script/src/wow/game_data/playable_race.d.ts +31 -0
  333. package/script/src/wow/game_data/playable_race.js +29 -0
  334. package/script/src/wow/game_data/playable_specialization.d.ts +63 -0
  335. package/script/src/wow/game_data/playable_specialization.js +43 -0
  336. package/script/src/wow/game_data/power_type.d.ts +22 -0
  337. package/script/src/wow/game_data/power_type.js +29 -0
  338. package/script/src/wow/game_data/profession.d.ts +88 -0
  339. package/script/src/wow/game_data/profession.js +86 -0
  340. package/script/src/wow/game_data/pvp_season.d.ts +108 -0
  341. package/script/src/wow/game_data/pvp_season.js +73 -0
  342. package/script/src/wow/game_data/pvp_tier.d.ts +41 -0
  343. package/script/src/wow/game_data/pvp_tier.js +43 -0
  344. package/script/src/wow/game_data/quest.d.ts +116 -0
  345. package/script/src/wow/game_data/quest.js +110 -0
  346. package/script/src/wow/game_data/realm.d.ts +43 -0
  347. package/script/src/wow/game_data/realm.js +40 -0
  348. package/script/src/wow/game_data/region.d.ts +26 -0
  349. package/script/src/wow/game_data/region.js +29 -0
  350. package/script/src/wow/game_data/reputations.d.ts +57 -0
  351. package/script/src/wow/game_data/reputations.js +56 -0
  352. package/script/src/wow/game_data/spell.d.ts +34 -0
  353. package/script/src/wow/game_data/spell.js +41 -0
  354. package/script/src/wow/game_data/talent.d.ts +143 -0
  355. package/script/src/wow/game_data/talent.js +98 -0
  356. package/script/src/wow/game_data/tech_talent.d.ts +72 -0
  357. package/script/src/wow/game_data/tech_talent.js +70 -0
  358. package/script/src/wow/game_data/title.d.ts +33 -0
  359. package/script/src/wow/game_data/title.js +29 -0
  360. package/script/src/wow/game_data/token.d.ts +17 -0
  361. package/script/src/wow/game_data/token.js +21 -0
  362. package/script/src/wow/game_data/toy.d.ts +25 -0
  363. package/script/src/wow/game_data/toy.js +29 -0
  364. package/script/src/wow/index.d.ts +59 -0
  365. package/script/src/wow/index.js +272 -0
  366. package/script/src/wow/profile/account_profile.d.ts +185 -0
  367. package/script/src/wow/profile/account_profile.js +143 -0
  368. package/script/src/wow/profile/character_achievements.d.ts +88 -0
  369. package/script/src/wow/profile/character_achievements.js +32 -0
  370. package/script/src/wow/profile/character_appearance.d.ts +79 -0
  371. package/script/src/wow/profile/character_appearance.js +17 -0
  372. package/script/src/wow/profile/character_collections.d.ts +132 -0
  373. package/script/src/wow/profile/character_collections.js +107 -0
  374. package/script/src/wow/profile/character_encounters.d.ts +78 -0
  375. package/script/src/wow/profile/character_encounters.js +47 -0
  376. package/script/src/wow/profile/character_equipment.d.ts +177 -0
  377. package/script/src/wow/profile/character_equipment.js +17 -0
  378. package/script/src/wow/profile/character_house.d.ts +16 -0
  379. package/script/src/wow/profile/character_house.js +20 -0
  380. package/script/src/wow/profile/character_hunter_pets.d.ts +22 -0
  381. package/script/src/wow/profile/character_hunter_pets.js +17 -0
  382. package/script/src/wow/profile/character_media.d.ts +14 -0
  383. package/script/src/wow/profile/character_media.js +17 -0
  384. package/script/src/wow/profile/character_mythic_keystone_profile.d.ts +70 -0
  385. package/script/src/wow/profile/character_mythic_keystone_profile.js +35 -0
  386. package/script/src/wow/profile/character_professions.d.ts +29 -0
  387. package/script/src/wow/profile/character_professions.js +17 -0
  388. package/script/src/wow/profile/character_profile.d.ts +83 -0
  389. package/script/src/wow/profile/character_profile.js +43 -0
  390. package/script/src/wow/profile/character_pvp.d.ts +53 -0
  391. package/script/src/wow/profile/character_pvp.js +33 -0
  392. package/script/src/wow/profile/character_quests.d.ts +29 -0
  393. package/script/src/wow/profile/character_quests.js +32 -0
  394. package/script/src/wow/profile/character_reputations.d.ts +30 -0
  395. package/script/src/wow/profile/character_reputations.js +17 -0
  396. package/script/src/wow/profile/character_soulbinds.d.ts +31 -0
  397. package/script/src/wow/profile/character_soulbinds.js +17 -0
  398. package/script/src/wow/profile/character_specializations.d.ts +82 -0
  399. package/script/src/wow/profile/character_specializations.js +17 -0
  400. package/script/src/wow/profile/character_statistics.d.ts +104 -0
  401. package/script/src/wow/profile/character_statistics.js +17 -0
  402. package/script/src/wow/profile/character_titles.d.ts +14 -0
  403. package/script/src/wow/profile/character_titles.js +17 -0
  404. package/script/src/wow/profile/guild.d.ts +150 -0
  405. package/script/src/wow/profile/guild.js +62 -0
  406. package/script/src/wow/search.d.ts +23 -0
  407. package/script/src/wow/search.js +32 -0
  408. package/script/src/wow/types.d.ts +58 -0
  409. package/script/src/wow/types.js +2 -0
  410. package/script/src/wow_classic/auction_house.d.ts +41 -0
  411. package/script/src/wow_classic/auction_house.js +35 -0
  412. package/script/src/wow_classic/character_specializations.d.ts +45 -0
  413. package/script/src/wow_classic/character_specializations.js +21 -0
  414. package/script/src/wow_classic/era.d.ts +8 -0
  415. package/script/src/wow_classic/era.js +30 -0
  416. package/script/src/wow_classic/index.d.ts +15 -0
  417. package/script/src/wow_classic/index.js +55 -0
  418. package/script/src/wow_classic/profile_overrides.d.ts +125 -0
  419. package/script/src/wow_classic/profile_overrides.js +123 -0
  420. package/script/src/wow_classic/shared.d.ts +23 -0
  421. package/script/src/wow_classic/shared.js +81 -0
  422. package/script/src/wow_classic/types.d.ts +3 -0
  423. package/script/src/wow_classic/types.js +2 -0
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Classic versions of Retail endpoints whose Classic responses lack fields that Retail always returns.
3
+ * Each one makes the same request as the Retail endpoint, but returns a type where those fields are optional,
4
+ * so the Retail types can keep them required.
5
+ * Verified against the live API (EU) on 2026-10-01.
6
+ */
7
+ import { achievementCategories as retailAchievementCategories } from "../wow/game_data/achievement.js";
8
+ import { commodities as retailCommodities } from "../wow/game_data/auction_house.js";
9
+ import { connectedRealm as retailConnectedRealm } from "../wow/game_data/connected_realm.js";
10
+ import { characterAchievementSummary as retailCharacterAchievementSummary } from "../wow/profile/character_achievements.js";
11
+ import { characterAppearanceSummary as retailCharacterAppearanceSummary } from "../wow/profile/character_appearance.js";
12
+ import { characterProfile as retailCharacterProfile } from "../wow/profile/character_profile.js";
13
+ import { characterPvpSummary as retailCharacterPvpSummary } from "../wow/profile/character_pvp.js";
14
+ import { characterSpecializations as retailCharacterSpecializations } from "../wow/profile/character_specializations.js";
15
+ import { characterStatistics as retailCharacterStatistics } from "../wow/profile/character_statistics.js";
16
+ import { guildAchievements as retailGuildAchievements } from "../wow/profile/guild.js";
17
+ /**
18
+ * Returns a profile summary for a character.
19
+ *
20
+ * @param realmSlug - The slug of the realm.
21
+ * @param characterName - The lowercase name of the character.
22
+ * @returns A promise that resolves to an object representing a profile summary for a character.
23
+ */
24
+ export async function characterProfile(ctx, realmSlug, characterName) {
25
+ return await retailCharacterProfile(ctx, realmSlug, characterName);
26
+ }
27
+ /**
28
+ * Returns a summary of a character's appearance settings.
29
+ *
30
+ * @param realmSlug - The slug of the realm.
31
+ * @param characterName - The lowercase name of the character.
32
+ * @returns A promise that resolves to an object representing a summary of a character's appearance settings.
33
+ */
34
+ export async function characterAppearanceSummary(ctx, realmSlug, characterName) {
35
+ return await retailCharacterAppearanceSummary(ctx, realmSlug, characterName);
36
+ }
37
+ /**
38
+ * Returns a PvP summary for a character.
39
+ *
40
+ * @param realmSlug - The slug of the realm.
41
+ * @param characterName - The lowercase name of the character.
42
+ * @returns A promise that resolves to an object representing a PvP summary for a character.
43
+ */
44
+ export async function characterPvpSummary(ctx, realmSlug, characterName) {
45
+ return await retailCharacterPvpSummary(ctx, realmSlug, characterName);
46
+ }
47
+ /**
48
+ * Returns a summary of the achievements a character has completed.
49
+ *
50
+ * @param realmSlug - The slug of the realm.
51
+ * @param characterName - The lowercase name of the character.
52
+ * @returns A promise that resolves to an object representing a summary of the achievements a character has completed.
53
+ */
54
+ export async function characterAchievementSummary(ctx, realmSlug, characterName) {
55
+ return await retailCharacterAchievementSummary(ctx, realmSlug, characterName);
56
+ }
57
+ /**
58
+ * Returns a statistics summary for a character.
59
+ *
60
+ * @param realmSlug - The slug of the realm.
61
+ * @param characterName - The lowercase name of the character.
62
+ * @returns A promise that resolves to an object representing a statistics summary for a character.
63
+ */
64
+ export async function characterStatistics(ctx, realmSlug, characterName) {
65
+ return await retailCharacterStatistics(ctx, realmSlug, characterName);
66
+ }
67
+ /**
68
+ * Returns a summary of a character's specializations.
69
+ *
70
+ * @param realmSlug - The slug of the realm.
71
+ * @param characterName - The lowercase name of the character.
72
+ * @returns A promise that resolves to an object representing a summary of a character's specializations.
73
+ */
74
+ export async function characterSpecializations(ctx, realmSlug, characterName) {
75
+ return await retailCharacterSpecializations(ctx, realmSlug, characterName);
76
+ }
77
+ /**
78
+ * Returns a single guild's achievements by name.
79
+ *
80
+ * @param realmSlug - The slug of the realm.
81
+ * @param nameSlug - The slug of the guild.
82
+ * @returns A promise that resolves to an object representing a guild's achievements.
83
+ */
84
+ export async function guildAchievements(ctx, realmSlug, nameSlug) {
85
+ return await retailGuildAchievements(ctx, realmSlug, nameSlug);
86
+ }
87
+ /**
88
+ * Returns a connected realm by ID.
89
+ *
90
+ * @param connectedRealmId - The ID of the connected realm.
91
+ * @returns A promise that resolves to an object representing details about a connected realm.
92
+ */
93
+ export async function connectedRealm(ctx, connectedRealmId) {
94
+ return await retailConnectedRealm(ctx, connectedRealmId);
95
+ }
96
+ /**
97
+ * Returns an index of achievement categories.
98
+ *
99
+ * @returns A promise that resolves to an object representing a list of the index of achievement categories.
100
+ */
101
+ export async function achievementCategories(ctx) {
102
+ return await retailAchievementCategories(ctx);
103
+ }
104
+ /**
105
+ * Returns all active auctions for commodity items for the entire game region.
106
+ *
107
+ * @returns A promise that resolves to an object representing the region's commodity auctions.
108
+ */
109
+ export async function commodities(ctx) {
110
+ return await retailCommodities(ctx);
111
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Endpoints that work for both Classic flavors (progression and Era). They are the Retail endpoint functions;
3
+ * the client binds them to a context whose namespaces carry the "classic" or "classic1x" variant.
4
+ * Verified against the live API (EU) on 2026-09-30.
5
+ */
6
+ export { achievement, achievementCategory, achievementMedia, achievements } from "../wow/game_data/achievement.js";
7
+ export { connectedRealms, searchConnectedRealm } from "../wow/game_data/connected_realm.js";
8
+ export { creature, creatureDisplayMedia, creatureFamilies, creatureFamily, creatureFamilyMedia, creatureType, creatureTypes, searchCreature, } from "../wow/game_data/creature.js";
9
+ export { guildCrestBorder, guildCrestEmblem, guildCrests } from "../wow/game_data/guild_crest.js";
10
+ export { item, itemClass, itemClasses, itemMedia, itemSubclass, searchItem } from "../wow/game_data/item.js";
11
+ export { searchMedia } from "../wow/game_data/media_search.js";
12
+ export { playableClass, playableClasses, playableClassMedia } from "../wow/game_data/playable_class.js";
13
+ export { playableRace, playableRaces } from "../wow/game_data/playable_race.js";
14
+ export { powerType, powerTypes } from "../wow/game_data/power_type.js";
15
+ export { realm, realms, searchRealm } from "../wow/game_data/realm.js";
16
+ export { region, regions } from "../wow/game_data/region.js";
17
+ export { characterEquipments } from "../wow/profile/character_equipment.js";
18
+ export { characterHunterPets } from "../wow/profile/character_hunter_pets.js";
19
+ export { characterMedia } from "../wow/profile/character_media.js";
20
+ export { characterProfileStatus } from "../wow/profile/character_profile.js";
21
+ export { characterReputations } from "../wow/profile/character_reputations.js";
22
+ export { guild, guildActivity, guildRoster } from "../wow/profile/guild.js";
23
+ export { achievementCategories, characterAppearanceSummary, characterProfile, characterPvpSummary, characterStatistics, connectedRealm, guildAchievements, } from "./profile_overrides.js";
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Endpoints that work for both Classic flavors (progression and Era). They are the Retail endpoint functions;
3
+ * the client binds them to a context whose namespaces carry the "classic" or "classic1x" variant.
4
+ * Verified against the live API (EU) on 2026-09-30.
5
+ */
6
+ // Game Data APIs
7
+ export { achievement, achievementCategory, achievementMedia, achievements } from "../wow/game_data/achievement.js";
8
+ export { connectedRealms, searchConnectedRealm } from "../wow/game_data/connected_realm.js";
9
+ export { creature, creatureDisplayMedia, creatureFamilies, creatureFamily, creatureFamilyMedia, creatureType, creatureTypes, searchCreature, } from "../wow/game_data/creature.js";
10
+ export { guildCrestBorder, guildCrestEmblem, guildCrests } from "../wow/game_data/guild_crest.js";
11
+ export { item, itemClass, itemClasses, itemMedia, itemSubclass, searchItem } from "../wow/game_data/item.js";
12
+ export { searchMedia } from "../wow/game_data/media_search.js";
13
+ export { playableClass, playableClasses, playableClassMedia } from "../wow/game_data/playable_class.js";
14
+ export { playableRace, playableRaces } from "../wow/game_data/playable_race.js";
15
+ export { powerType, powerTypes } from "../wow/game_data/power_type.js";
16
+ export { realm, realms, searchRealm } from "../wow/game_data/realm.js";
17
+ export { region, regions } from "../wow/game_data/region.js";
18
+ // Profile APIs
19
+ export { characterEquipments } from "../wow/profile/character_equipment.js";
20
+ export { characterHunterPets } from "../wow/profile/character_hunter_pets.js";
21
+ export { characterMedia } from "../wow/profile/character_media.js";
22
+ export { characterProfileStatus } from "../wow/profile/character_profile.js";
23
+ export { characterReputations } from "../wow/profile/character_reputations.js";
24
+ export { guild, guildActivity, guildRoster } from "../wow/profile/guild.js";
25
+ // Classic-typed versions of Retail endpoints (fields Retail always returns are optional here)
26
+ export { achievementCategories, characterAppearanceSummary, characterProfile, characterPvpSummary, characterStatistics, connectedRealm, guildAchievements, } from "./profile_overrides.js";
@@ -0,0 +1,3 @@
1
+ export type { AuctionHouseAuctions, AuctionHouses } from "./auction_house.js";
2
+ export type { ClassicEraCharacterSpecializations, ClassicEraTalent } from "./character_specializations.js";
3
+ export type { ClassicAchievementCategories, ClassicCharacterAchievementSummary, ClassicCharacterAppearanceSummary, ClassicCharacterProfile, ClassicCharacterPvpSummary, ClassicCharacterSpecializations, ClassicCharacterStatistics, ClassicCommodities, ClassicConnectedRealm, ClassicGuildAchievements, } from "./profile_overrides.js";
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinta365/blizzard_api",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "TS library to interact with the Blizzard Battle.net API. World of Warcraft, World of Warcraft Classic, StarCraft 2, Diablo 3, Hearthstone.",
5
5
  "keywords": [
6
6
  "blizzard",
@@ -27,10 +27,31 @@
27
27
  ".": {
28
28
  "import": "./esm/mod.js",
29
29
  "require": "./script/mod.js"
30
+ },
31
+ "./wow": {
32
+ "import": "./esm/src/wow/types.js",
33
+ "require": "./script/src/wow/types.js"
34
+ },
35
+ "./wow-classic": {
36
+ "import": "./esm/src/wow_classic/types.js",
37
+ "require": "./script/src/wow_classic/types.js"
38
+ },
39
+ "./hearthstone": {
40
+ "import": "./esm/src/hearthstone/types.js",
41
+ "require": "./script/src/hearthstone/types.js"
42
+ },
43
+ "./sc2": {
44
+ "import": "./esm/src/starcraft2/types.js",
45
+ "require": "./script/src/starcraft2/types.js"
46
+ },
47
+ "./diablo3": {
48
+ "import": "./esm/src/diablo3/types.js",
49
+ "require": "./script/src/diablo3/types.js"
30
50
  }
31
51
  },
52
+ "scripts": {},
32
53
  "devDependencies": {
33
54
  "@types/node": "^20.9.0"
34
55
  },
35
- "_generatedBy": "dnt@0.40.0"
56
+ "_generatedBy": "dnt@0.43.2"
36
57
  }
package/script/mod.d.ts CHANGED
@@ -1,7 +1,44 @@
1
- import { authenticate, getAccessToken, getAuthConfig, requestHref, setup } from "./src/shared/index.js";
2
- import * as wow from "./src/wow/index.js";
3
- import * as wowClassic from "./src/wow_classic/index.js";
4
- import * as hearthstone from "./src/hearthstone/index.js";
5
- import * as sc2 from "./src/starcraft2/index.js";
1
+ import type { AuthConfig, ClientConfig } from "./src/shared/index.js";
2
+ import type { Diablo3Api, HearthstoneApi, Sc2Api, WowApi, WowClassicApi, WowClassicEraApi } from "./src/client.js";
6
3
  import * as errors from "./src/shared/errors.js";
7
- export { authenticate, errors, getAccessToken, getAuthConfig, hearthstone, requestHref, sc2, setup, wow, wowClassic };
4
+ export { createClient } from "./src/client.js";
5
+ export type { BlizzardClient, Diablo3Api, HearthstoneApi, Sc2Api, WowApi, WowClassicApi, WowClassicEraApi, } from "./src/client.js";
6
+ export type { AuthConfig, AuthorizeUrlOptions, ClientConfig, ExchangeCodeOptions, Locales, Namespaces, Regions, TokenResponse, } from "./src/shared/index.js";
7
+ export { errors };
8
+ /**
9
+ * Configures the default client used by the module-level API. Prefer createClient() for new code.
10
+ * @param {Partial<ClientConfig>} userConfig - Configuration properties to update.
11
+ * @throws {MissingRegionError | MissingClientIdError | MissingClientSecretError} If the resulting configuration is incomplete.
12
+ */
13
+ export declare function setup(userConfig: Partial<ClientConfig>): void;
14
+ /**
15
+ * Obtains a client credentials access token for the default client.
16
+ * @param {boolean} [forceNewToken] - If true, fetches a new token even if the cached one is valid.
17
+ */
18
+ export declare function authenticate(forceNewToken?: boolean): Promise<string>;
19
+ /**
20
+ * Returns the default client's current access token, or an empty string if not authenticated.
21
+ */
22
+ export declare function getAccessToken(): string;
23
+ /**
24
+ * Returns a copy of the default client's token state.
25
+ */
26
+ export declare function getAuthConfig(): AuthConfig;
27
+ /**
28
+ * Makes an authenticated request with the default client to a full href returned in an API response.
29
+ * @param {string} href - The full href URL.
30
+ * @param {Record<string, string | number>} [qs] - Optional query string parameters to append.
31
+ */
32
+ export declare function requestHref(href: string, qs?: Record<string, string | number>): Promise<unknown>;
33
+ /** World of Warcraft endpoints on the default client. */
34
+ export declare const wow: WowApi;
35
+ /** World of Warcraft Classic (progression) endpoints on the default client. */
36
+ export declare const wowClassic: WowClassicApi;
37
+ /** World of Warcraft Classic Era endpoints on the default client. */
38
+ export declare const wowClassicEra: WowClassicEraApi;
39
+ /** Hearthstone endpoints on the default client. */
40
+ export declare const hearthstone: HearthstoneApi;
41
+ /** StarCraft II endpoints on the default client. */
42
+ export declare const sc2: Sc2Api;
43
+ /** Diablo III endpoints on the default client. */
44
+ export declare const diablo3: Diablo3Api;
package/script/mod.js CHANGED
@@ -15,28 +15,98 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.wowClassic = exports.wow = exports.setup = exports.sc2 = exports.requestHref = exports.hearthstone = exports.getAuthConfig = exports.getAccessToken = exports.errors = exports.authenticate = void 0;
36
+ exports.diablo3 = exports.sc2 = exports.hearthstone = exports.wowClassicEra = exports.wowClassic = exports.wow = exports.errors = exports.createClient = void 0;
37
+ exports.setup = setup;
38
+ exports.authenticate = authenticate;
39
+ exports.getAccessToken = getAccessToken;
40
+ exports.getAuthConfig = getAuthConfig;
41
+ exports.requestHref = requestHref;
42
+ /**
43
+ * TS library for the Blizzard Battle.net API: World of Warcraft, World of Warcraft Classic, Hearthstone,
44
+ * StarCraft II and Diablo III.
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * import { createClient } from "@pinta365/blizzard-api";
49
+ *
50
+ * const client = createClient({ region: "eu", locale: "en_GB", clientId, clientSecret });
51
+ * const mount = await client.wow.mount(6);
52
+ * ```
53
+ *
54
+ * @module
55
+ */
27
56
  const index_js_1 = require("./src/shared/index.js");
28
- Object.defineProperty(exports, "authenticate", { enumerable: true, get: function () { return index_js_1.authenticate; } });
29
- Object.defineProperty(exports, "getAccessToken", { enumerable: true, get: function () { return index_js_1.getAccessToken; } });
30
- Object.defineProperty(exports, "getAuthConfig", { enumerable: true, get: function () { return index_js_1.getAuthConfig; } });
31
- Object.defineProperty(exports, "requestHref", { enumerable: true, get: function () { return index_js_1.requestHref; } });
32
- Object.defineProperty(exports, "setup", { enumerable: true, get: function () { return index_js_1.setup; } });
33
- const wow = __importStar(require("./src/wow/index.js"));
34
- exports.wow = wow;
35
- const wowClassic = __importStar(require("./src/wow_classic/index.js"));
36
- exports.wowClassic = wowClassic;
37
- const hearthstone = __importStar(require("./src/hearthstone/index.js"));
38
- exports.hearthstone = hearthstone;
39
- const sc2 = __importStar(require("./src/starcraft2/index.js"));
40
- exports.sc2 = sc2;
57
+ const client_js_1 = require("./src/client.js");
41
58
  const errors = __importStar(require("./src/shared/errors.js"));
42
59
  exports.errors = errors;
60
+ var client_js_2 = require("./src/client.js");
61
+ Object.defineProperty(exports, "createClient", { enumerable: true, get: function () { return client_js_2.createClient; } });
62
+ // Default client behind the module-level API (setup() + wow.*, hearthstone.*, ...).
63
+ const defaultContext = new index_js_1.ApiContext();
64
+ const defaultClient = (0, client_js_1.clientFromContext)(defaultContext);
65
+ /**
66
+ * Configures the default client used by the module-level API. Prefer createClient() for new code.
67
+ * @param {Partial<ClientConfig>} userConfig - Configuration properties to update.
68
+ * @throws {MissingRegionError | MissingClientIdError | MissingClientSecretError} If the resulting configuration is incomplete.
69
+ */
70
+ function setup(userConfig) {
71
+ defaultContext.configure(userConfig);
72
+ (0, index_js_1.assertConfig)({ ...defaultContext.config });
73
+ }
74
+ /**
75
+ * Obtains a client credentials access token for the default client.
76
+ * @param {boolean} [forceNewToken] - If true, fetches a new token even if the cached one is valid.
77
+ */
78
+ function authenticate(forceNewToken) {
79
+ return defaultContext.authenticate(forceNewToken);
80
+ }
81
+ /**
82
+ * Returns the default client's current access token, or an empty string if not authenticated.
83
+ */
84
+ function getAccessToken() {
85
+ return defaultContext.getAuthConfig().accessToken;
86
+ }
87
+ /**
88
+ * Returns a copy of the default client's token state.
89
+ */
90
+ function getAuthConfig() {
91
+ return defaultContext.getAuthConfig();
92
+ }
93
+ /**
94
+ * Makes an authenticated request with the default client to a full href returned in an API response.
95
+ * @param {string} href - The full href URL.
96
+ * @param {Record<string, string | number>} [qs] - Optional query string parameters to append.
97
+ */
98
+ function requestHref(href, qs) {
99
+ return defaultContext.requestHref(href, qs);
100
+ }
101
+ /** World of Warcraft endpoints on the default client. */
102
+ exports.wow = defaultClient.wow;
103
+ /** World of Warcraft Classic (progression) endpoints on the default client. */
104
+ exports.wowClassic = defaultClient.wowClassic;
105
+ /** World of Warcraft Classic Era endpoints on the default client. */
106
+ exports.wowClassicEra = defaultClient.wowClassicEra;
107
+ /** Hearthstone endpoints on the default client. */
108
+ exports.hearthstone = defaultClient.hearthstone;
109
+ /** StarCraft II endpoints on the default client. */
110
+ exports.sc2 = defaultClient.sc2;
111
+ /** Diablo III endpoints on the default client. */
112
+ exports.diablo3 = defaultClient.diablo3;
@@ -0,0 +1,95 @@
1
+ import { ApiContext } from "./shared/context.js";
2
+ import type { AuthConfig, AuthorizeUrlOptions, ClientConfig, ExchangeCodeOptions, TokenResponse } from "./shared/context.js";
3
+ import { type Bound } from "./shared/bind.js";
4
+ import * as wowEndpoints from "./wow/index.js";
5
+ import * as wowClassicEndpoints from "./wow_classic/index.js";
6
+ import * as wowClassicEraEndpoints from "./wow_classic/era.js";
7
+ import * as hearthstoneEndpoints from "./hearthstone/index.js";
8
+ import * as sc2Endpoints from "./starcraft2/index.js";
9
+ import * as diablo3Endpoints from "./diablo3/index.js";
10
+ import type { WowApi } from "./generated/wow_api.js";
11
+ import type { WowClassicApi } from "./generated/wow_classic_api.js";
12
+ import type { WowClassicEraApi } from "./generated/wow_classic_era_api.js";
13
+ import type { HearthstoneApi } from "./generated/hearthstone_api.js";
14
+ import type { Sc2Api } from "./generated/sc2_api.js";
15
+ import type { Diablo3Api } from "./generated/diablo3_api.js";
16
+ export type { Diablo3Api, HearthstoneApi, Sc2Api, WowApi, WowClassicApi, WowClassicEraApi };
17
+ type Exact<A, B> = [keyof A] extends [keyof B] ? ([keyof B] extends [keyof A] ? ([A] extends [B] ? true : false) : false) : false;
18
+ type Assert<T extends true> = T;
19
+ export type _GeneratedApisAreCurrent = [
20
+ Assert<Exact<WowApi, Bound<typeof wowEndpoints>>>,
21
+ Assert<Exact<WowClassicApi, Bound<typeof wowClassicEndpoints>>>,
22
+ Assert<Exact<WowClassicEraApi, Bound<typeof wowClassicEraEndpoints>>>,
23
+ Assert<Exact<HearthstoneApi, Bound<typeof hearthstoneEndpoints>>>,
24
+ Assert<Exact<Sc2Api, Bound<typeof sc2Endpoints>>>,
25
+ Assert<Exact<Diablo3Api, Bound<typeof diablo3Endpoints>>>
26
+ ];
27
+ /**
28
+ * A Blizzard API client with its own configuration and token state.
29
+ */
30
+ export interface BlizzardClient {
31
+ /** World of Warcraft endpoints. */
32
+ readonly wow: WowApi;
33
+ /** World of Warcraft Classic (progression, e.g. Mists of Pandaria Classic) endpoints. */
34
+ readonly wowClassic: WowClassicApi;
35
+ /** World of Warcraft Classic Era endpoints (Era, Season of Discovery, Hardcore, Anniversary). */
36
+ readonly wowClassicEra: WowClassicEraApi;
37
+ /** Hearthstone endpoints. */
38
+ readonly hearthstone: HearthstoneApi;
39
+ /** StarCraft II endpoints. */
40
+ readonly sc2: Sc2Api;
41
+ /** Diablo III endpoints. */
42
+ readonly diablo3: Diablo3Api;
43
+ /** The client configuration. */
44
+ readonly config: Readonly<Partial<ClientConfig>>;
45
+ /**
46
+ * Obtains a client credentials access token, reusing the cached one while it is valid.
47
+ * Requests authenticate automatically; calling this is optional.
48
+ * @param {boolean} [forceNewToken] - If true, fetches a new token even if the cached one is valid.
49
+ */
50
+ authenticate(forceNewToken?: boolean): Promise<string>;
51
+ /** Returns a copy of the client credentials token state. */
52
+ getAuthConfig(): AuthConfig;
53
+ /**
54
+ * Makes an authenticated request to a full href returned in an API response.
55
+ * @param {string} href - The full href URL.
56
+ * @param {Record<string, string | number>} [qs] - Optional query string parameters to append.
57
+ */
58
+ requestHref(href: string, qs?: Record<string, string | number>): Promise<unknown>;
59
+ /**
60
+ * Returns a client that uses the given user access token for user-scoped endpoints (e.g. the WoW account profile).
61
+ * It shares configuration and the client credentials token with this client, so it is cheap to create per request.
62
+ * @param {string} userToken - A user access token, e.g. `access_token` from exchangeCode().
63
+ */
64
+ forUser(userToken: string): BlizzardClient;
65
+ /**
66
+ * Builds the URL to send a user to for the authorization code flow.
67
+ * @param {AuthorizeUrlOptions} options - Redirect URI, scopes (e.g. ["wow.profile"]) and state.
68
+ */
69
+ authorizeUrl(options: AuthorizeUrlOptions): string;
70
+ /**
71
+ * Exchanges an authorization code for a user access token.
72
+ * @param {ExchangeCodeOptions} options - The code and the redirect URI used to obtain it.
73
+ */
74
+ exchangeCode(options: ExchangeCodeOptions): Promise<TokenResponse>;
75
+ }
76
+ /**
77
+ * Wraps a context in a client object.
78
+ * @param {ApiContext} ctx - The context to wrap.
79
+ * @returns {BlizzardClient} The client.
80
+ */
81
+ export declare function clientFromContext(ctx: ApiContext): BlizzardClient;
82
+ /**
83
+ * Creates a Blizzard API client with its own configuration and token state.
84
+ *
85
+ * @example
86
+ * ```ts
87
+ * const client = createClient({ region: "eu", locale: "en_GB", clientId, clientSecret });
88
+ * const mount = await client.wow.mount(6);
89
+ * ```
90
+ *
91
+ * @param {ClientConfig} config - Region, locale and OAuth client credentials.
92
+ * @returns {BlizzardClient} The client.
93
+ * @throws {MissingRegionError | MissingClientIdError | MissingClientSecretError} If the configuration is incomplete.
94
+ */
95
+ export declare function createClient(config: ClientConfig): BlizzardClient;
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.clientFromContext = clientFromContext;
37
+ exports.createClient = createClient;
38
+ //client.ts
39
+ const context_js_1 = require("./shared/context.js");
40
+ const bind_js_1 = require("./shared/bind.js");
41
+ const wowEndpoints = __importStar(require("./wow/index.js"));
42
+ const wowClassicEndpoints = __importStar(require("./wow_classic/index.js"));
43
+ const wowClassicEraEndpoints = __importStar(require("./wow_classic/era.js"));
44
+ const hearthstoneEndpoints = __importStar(require("./hearthstone/index.js"));
45
+ const sc2Endpoints = __importStar(require("./starcraft2/index.js"));
46
+ const diablo3Endpoints = __importStar(require("./diablo3/index.js"));
47
+ /**
48
+ * Wraps a context in a client object.
49
+ * @param {ApiContext} ctx - The context to wrap.
50
+ * @returns {BlizzardClient} The client.
51
+ */
52
+ function clientFromContext(ctx) {
53
+ return Object.freeze({
54
+ wow: (0, bind_js_1.bindAll)(ctx, wowEndpoints),
55
+ wowClassic: (0, bind_js_1.bindAll)(ctx.withNamespaceVariant("classic"), wowClassicEndpoints),
56
+ wowClassicEra: (0, bind_js_1.bindAll)(ctx.withNamespaceVariant("classic1x"), wowClassicEraEndpoints),
57
+ // bind() keeps metadata<T> generic at runtime; the mapped Bound type cannot, so use the generated interface.
58
+ hearthstone: (0, bind_js_1.bindAll)(ctx, hearthstoneEndpoints),
59
+ sc2: (0, bind_js_1.bindAll)(ctx, sc2Endpoints),
60
+ diablo3: (0, bind_js_1.bindAll)(ctx, diablo3Endpoints),
61
+ get config() {
62
+ return ctx.config;
63
+ },
64
+ authenticate: (forceNewToken) => ctx.authenticate(forceNewToken),
65
+ getAuthConfig: () => ctx.getAuthConfig(),
66
+ requestHref: (href, qs) => ctx.requestHref(href, qs),
67
+ forUser: (userToken) => clientFromContext(ctx.forUser(userToken)),
68
+ authorizeUrl: (options) => ctx.authorizeUrl(options),
69
+ exchangeCode: (options) => ctx.exchangeCode(options),
70
+ });
71
+ }
72
+ /**
73
+ * Creates a Blizzard API client with its own configuration and token state.
74
+ *
75
+ * @example
76
+ * ```ts
77
+ * const client = createClient({ region: "eu", locale: "en_GB", clientId, clientSecret });
78
+ * const mount = await client.wow.mount(6);
79
+ * ```
80
+ *
81
+ * @param {ClientConfig} config - Region, locale and OAuth client credentials.
82
+ * @returns {BlizzardClient} The client.
83
+ * @throws {MissingRegionError | MissingClientIdError | MissingClientSecretError} If the configuration is incomplete.
84
+ */
85
+ function createClient(config) {
86
+ const copy = { ...config };
87
+ (0, context_js_1.assertConfig)(copy);
88
+ return clientFromContext(new context_js_1.ApiContext(copy));
89
+ }
@@ -0,0 +1,29 @@
1
+ import type { ApiContext } from "../../shared/index.js";
2
+ interface Quest {
3
+ id: number;
4
+ name: string;
5
+ slug: string;
6
+ }
7
+ export interface Act {
8
+ slug: string;
9
+ number: number;
10
+ name: string;
11
+ quests: Quest[];
12
+ }
13
+ export interface Acts {
14
+ acts: Act[];
15
+ }
16
+ /**
17
+ * Returns an index of acts.
18
+ *
19
+ * @returns A promise that resolves to an object representing an index of acts.
20
+ */
21
+ export declare function acts(ctx: ApiContext): Promise<Acts>;
22
+ /**
23
+ * Returns a single act by ID.
24
+ *
25
+ * @param seasonId - The season for the leaderboard list.
26
+ * @returns A promise that resolves to an object representing the data for a single act by ID.
27
+ */
28
+ export declare function act(ctx: ApiContext, seasonId: number): Promise<Act>;
29
+ export {};
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.acts = acts;
4
+ exports.act = act;
5
+ /**
6
+ * Returns an index of acts.
7
+ *
8
+ * @returns A promise that resolves to an object representing an index of acts.
9
+ */
10
+ async function acts(ctx) {
11
+ return await ctx.request({
12
+ method: "GET",
13
+ url: "/d3/data/act/",
14
+ });
15
+ }
16
+ /**
17
+ * Returns a single act by ID.
18
+ *
19
+ * @param seasonId - The season for the leaderboard list.
20
+ * @returns A promise that resolves to an object representing the data for a single act by ID.
21
+ */
22
+ async function act(ctx, seasonId) {
23
+ return await ctx.request({
24
+ method: "GET",
25
+ url: `/d3/data/act/${seasonId}`,
26
+ });
27
+ }