@pinta365/blizzard_api 0.7.0 → 0.8.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 (62) hide show
  1. package/README.md +40 -4
  2. package/esm/mod.d.ts +4 -2
  3. package/esm/mod.js +2 -0
  4. package/esm/src/client.d.ts +9 -1
  5. package/esm/src/client.js +2 -0
  6. package/esm/src/generated/wow_forever_api.d.ts +939 -0
  7. package/esm/src/generated/wow_forever_api.js +2 -0
  8. package/esm/src/shared/context.d.ts +13 -2
  9. package/esm/src/shared/context.js +24 -9
  10. package/esm/src/shared/types.d.ts +1 -1
  11. package/esm/src/wow/game_data/achievement.d.ts +4 -0
  12. package/esm/src/wow/game_data/item.d.ts +29 -6
  13. package/esm/src/wow/game_data/mount.d.ts +2 -1
  14. package/esm/src/wow/game_data/reputations.d.ts +7 -1
  15. package/esm/src/wow/game_data/talent.d.ts +6 -2
  16. package/esm/src/wow/profile/account_profile.d.ts +2 -1
  17. package/esm/src/wow/profile/character_statistics.d.ts +4 -0
  18. package/esm/src/wow_forever/account.d.ts +42 -0
  19. package/esm/src/wow_forever/account.js +24 -0
  20. package/esm/src/wow_forever/character.d.ts +336 -0
  21. package/esm/src/wow_forever/character.js +269 -0
  22. package/esm/src/wow_forever/game_data.d.ts +196 -0
  23. package/esm/src/wow_forever/game_data.js +166 -0
  24. package/esm/src/wow_forever/guild.d.ts +88 -0
  25. package/esm/src/wow_forever/guild.js +57 -0
  26. package/esm/src/wow_forever/index.d.ts +39 -0
  27. package/esm/src/wow_forever/index.js +45 -0
  28. package/esm/src/wow_forever/ruleset.d.ts +32 -0
  29. package/esm/src/wow_forever/ruleset.js +30 -0
  30. package/esm/src/wow_forever/types.d.ts +5 -0
  31. package/esm/src/wow_forever/types.js +1 -0
  32. package/package.json +5 -1
  33. package/script/mod.d.ts +4 -2
  34. package/script/mod.js +3 -1
  35. package/script/src/client.d.ts +9 -1
  36. package/script/src/client.js +2 -0
  37. package/script/src/generated/wow_forever_api.d.ts +939 -0
  38. package/script/src/generated/wow_forever_api.js +3 -0
  39. package/script/src/shared/context.d.ts +13 -2
  40. package/script/src/shared/context.js +24 -9
  41. package/script/src/shared/types.d.ts +1 -1
  42. package/script/src/wow/game_data/achievement.d.ts +4 -0
  43. package/script/src/wow/game_data/item.d.ts +29 -6
  44. package/script/src/wow/game_data/mount.d.ts +2 -1
  45. package/script/src/wow/game_data/reputations.d.ts +7 -1
  46. package/script/src/wow/game_data/talent.d.ts +6 -2
  47. package/script/src/wow/profile/account_profile.d.ts +2 -1
  48. package/script/src/wow/profile/character_statistics.d.ts +4 -0
  49. package/script/src/wow_forever/account.d.ts +42 -0
  50. package/script/src/wow_forever/account.js +28 -0
  51. package/script/src/wow_forever/character.d.ts +336 -0
  52. package/script/src/wow_forever/character.js +296 -0
  53. package/script/src/wow_forever/game_data.d.ts +196 -0
  54. package/script/src/wow_forever/game_data.js +185 -0
  55. package/script/src/wow_forever/guild.d.ts +88 -0
  56. package/script/src/wow_forever/guild.js +63 -0
  57. package/script/src/wow_forever/index.d.ts +39 -0
  58. package/script/src/wow_forever/index.js +180 -0
  59. package/script/src/wow_forever/ruleset.d.ts +32 -0
  60. package/script/src/wow_forever/ruleset.js +34 -0
  61. package/script/src/wow_forever/types.d.ts +5 -0
  62. package/script/src/wow_forever/types.js +2 -0
@@ -0,0 +1,5 @@
1
+ export type { ForeverAccountCharacter, ForeverAccountProfileSummary, ForeverAccountTransmogsCollection, } from "./account.js";
2
+ export type { ForeverAchievementCategories, ForeverHeirlooms, ForeverItemAppearanceSearch, ForeverItemAppearanceSearchResult, ForeverJournalEncounters, ForeverJournalExpansions, ForeverJournalInstances, ForeverMount, ForeverPet, ForeverPetAbilities, ForeverPlayableSpecialization, ForeverPlayableSpecializations, ForeverProfessionRecipie, ForeverQuest, ForeverReputationFaction, ForeverTalentTree, ForeverTalentTrees, ForeverTitle, } from "./game_data.js";
3
+ export type { ForeverCharacterAchievementStatistics, ForeverCharacterAchievementSummary, ForeverCharacterAppearanceSummary, ForeverCharacterCollectionHeirlooms, ForeverCharacterCollectionMounts, ForeverCharacterCollectionPets, ForeverCharacterCollectionToys, ForeverCharacterCollectionTransmogs, ForeverCharacterCollectionTypes, ForeverCharacterCompletedQuests, ForeverCharacterEncounterDungeons, ForeverCharacterEncounterRaids, ForeverCharacterEncounters, ForeverCharacterEquipment, ForeverCharacterMedia, ForeverCharacterMythicKeystoneProfile, ForeverCharacterProfessions, ForeverCharacterProfile, ForeverCharacterProfileStatus, ForeverCharacterPvpSummary, ForeverCharacterQuests, ForeverCharacterRef, ForeverCharacterReputations, ForeverCharacterSpecializations, ForeverCharacterStatistics, ForeverCharacterTalent, ForeverCharacterTitles, WithForeverCharacter, } from "./character.js";
4
+ export type { ForeverRuleset, ForeverRulesets } from "./ruleset.js";
5
+ export type { ForeverGuild, ForeverGuildAchievements, ForeverGuildActivity, ForeverGuildRef, ForeverGuildRoster, ForeverGuildRosterMemberCharacter, } from "./guild.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.7.0",
3
+ "version": "0.8.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",
@@ -36,6 +36,10 @@
36
36
  "import": "./esm/src/wow_classic/types.js",
37
37
  "require": "./script/src/wow_classic/types.js"
38
38
  },
39
+ "./wow-forever": {
40
+ "import": "./esm/src/wow_forever/types.js",
41
+ "require": "./script/src/wow_forever/types.js"
42
+ },
39
43
  "./hearthstone": {
40
44
  "import": "./esm/src/hearthstone/types.js",
41
45
  "require": "./script/src/hearthstone/types.js"
package/script/mod.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import type { AuthConfig, ClientConfig } from "./src/shared/index.js";
2
- import type { Diablo3Api, HearthstoneApi, Sc2Api, WowApi, WowClassicApi, WowClassicEraApi } from "./src/client.js";
2
+ import type { Diablo3Api, HearthstoneApi, Sc2Api, WowApi, WowClassicApi, WowClassicEraApi, WowForeverApi } from "./src/client.js";
3
3
  import * as errors from "./src/shared/errors.js";
4
4
  export { createClient } from "./src/client.js";
5
- export type { BlizzardClient, Diablo3Api, HearthstoneApi, Sc2Api, WowApi, WowClassicApi, WowClassicEraApi, } from "./src/client.js";
5
+ export type { BlizzardClient, Diablo3Api, HearthstoneApi, Sc2Api, WowApi, WowClassicApi, WowClassicEraApi, WowForeverApi, } from "./src/client.js";
6
6
  export type { AuthConfig, AuthorizeUrlOptions, ClientConfig, ExchangeCodeOptions, Locales, Namespaces, Regions, TokenResponse, } from "./src/shared/index.js";
7
7
  export { errors };
8
8
  /**
@@ -36,6 +36,8 @@ export declare const wow: WowApi;
36
36
  export declare const wowClassic: WowClassicApi;
37
37
  /** World of Warcraft Classic Era endpoints on the default client. */
38
38
  export declare const wowClassicEra: WowClassicEraApi;
39
+ /** World of Warcraft: Forever endpoints on the default client. */
40
+ export declare const wowForever: WowForeverApi;
39
41
  /** Hearthstone endpoints on the default client. */
40
42
  export declare const hearthstone: HearthstoneApi;
41
43
  /** StarCraft II endpoints on the default client. */
package/script/mod.js CHANGED
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.diablo3 = exports.sc2 = exports.hearthstone = exports.wowClassicEra = exports.wowClassic = exports.wow = exports.errors = exports.createClient = void 0;
36
+ exports.diablo3 = exports.sc2 = exports.hearthstone = exports.wowForever = exports.wowClassicEra = exports.wowClassic = exports.wow = exports.errors = exports.createClient = void 0;
37
37
  exports.setup = setup;
38
38
  exports.authenticate = authenticate;
39
39
  exports.getAccessToken = getAccessToken;
@@ -104,6 +104,8 @@ exports.wow = defaultClient.wow;
104
104
  exports.wowClassic = defaultClient.wowClassic;
105
105
  /** World of Warcraft Classic Era endpoints on the default client. */
106
106
  exports.wowClassicEra = defaultClient.wowClassicEra;
107
+ /** World of Warcraft: Forever endpoints on the default client. */
108
+ exports.wowForever = defaultClient.wowForever;
107
109
  /** Hearthstone endpoints on the default client. */
108
110
  exports.hearthstone = defaultClient.hearthstone;
109
111
  /** StarCraft II endpoints on the default client. */
@@ -4,22 +4,25 @@ import { type Bound } from "./shared/bind.js";
4
4
  import * as wowEndpoints from "./wow/index.js";
5
5
  import * as wowClassicEndpoints from "./wow_classic/index.js";
6
6
  import * as wowClassicEraEndpoints from "./wow_classic/era.js";
7
+ import * as wowForeverEndpoints from "./wow_forever/index.js";
7
8
  import * as hearthstoneEndpoints from "./hearthstone/index.js";
8
9
  import * as sc2Endpoints from "./starcraft2/index.js";
9
10
  import * as diablo3Endpoints from "./diablo3/index.js";
10
11
  import type { WowApi } from "./generated/wow_api.js";
11
12
  import type { WowClassicApi } from "./generated/wow_classic_api.js";
12
13
  import type { WowClassicEraApi } from "./generated/wow_classic_era_api.js";
14
+ import type { WowForeverApi } from "./generated/wow_forever_api.js";
13
15
  import type { HearthstoneApi } from "./generated/hearthstone_api.js";
14
16
  import type { Sc2Api } from "./generated/sc2_api.js";
15
17
  import type { Diablo3Api } from "./generated/diablo3_api.js";
16
- export type { Diablo3Api, HearthstoneApi, Sc2Api, WowApi, WowClassicApi, WowClassicEraApi };
18
+ export type { Diablo3Api, HearthstoneApi, Sc2Api, WowApi, WowClassicApi, WowClassicEraApi, WowForeverApi };
17
19
  type Exact<A, B> = [keyof A] extends [keyof B] ? ([keyof B] extends [keyof A] ? ([A] extends [B] ? true : false) : false) : false;
18
20
  type Assert<T extends true> = T;
19
21
  export type _GeneratedApisAreCurrent = [
20
22
  Assert<Exact<WowApi, Bound<typeof wowEndpoints>>>,
21
23
  Assert<Exact<WowClassicApi, Bound<typeof wowClassicEndpoints>>>,
22
24
  Assert<Exact<WowClassicEraApi, Bound<typeof wowClassicEraEndpoints>>>,
25
+ Assert<Exact<WowForeverApi, Bound<typeof wowForeverEndpoints>>>,
23
26
  Assert<Exact<HearthstoneApi, Bound<typeof hearthstoneEndpoints>>>,
24
27
  Assert<Exact<Sc2Api, Bound<typeof sc2Endpoints>>>,
25
28
  Assert<Exact<Diablo3Api, Bound<typeof diablo3Endpoints>>>
@@ -34,6 +37,11 @@ export interface BlizzardClient {
34
37
  readonly wowClassic: WowClassicApi;
35
38
  /** World of Warcraft Classic Era endpoints (Era, Season of Discovery, Hardcore, Anniversary). */
36
39
  readonly wowClassicEra: WowClassicEraApi;
40
+ /**
41
+ * World of Warcraft: Forever endpoints (game data and account profile). Before launch, set
42
+ * `foreverStaticVersion` in the client config for static game data.
43
+ */
44
+ readonly wowForever: WowForeverApi;
37
45
  /** Hearthstone endpoints. */
38
46
  readonly hearthstone: HearthstoneApi;
39
47
  /** StarCraft II endpoints. */
@@ -41,6 +41,7 @@ const bind_js_1 = require("./shared/bind.js");
41
41
  const wowEndpoints = __importStar(require("./wow/index.js"));
42
42
  const wowClassicEndpoints = __importStar(require("./wow_classic/index.js"));
43
43
  const wowClassicEraEndpoints = __importStar(require("./wow_classic/era.js"));
44
+ const wowForeverEndpoints = __importStar(require("./wow_forever/index.js"));
44
45
  const hearthstoneEndpoints = __importStar(require("./hearthstone/index.js"));
45
46
  const sc2Endpoints = __importStar(require("./starcraft2/index.js"));
46
47
  const diablo3Endpoints = __importStar(require("./diablo3/index.js"));
@@ -54,6 +55,7 @@ function clientFromContext(ctx) {
54
55
  wow: (0, bind_js_1.bindAll)(ctx, wowEndpoints),
55
56
  wowClassic: (0, bind_js_1.bindAll)(ctx.withNamespaceVariant("classic"), wowClassicEndpoints),
56
57
  wowClassicEra: (0, bind_js_1.bindAll)(ctx.withNamespaceVariant("classic1x"), wowClassicEraEndpoints),
58
+ wowForever: (0, bind_js_1.bindAll)(ctx.withNamespaceVariant("forever", (config) => config.foreverStaticVersion), wowForeverEndpoints),
57
59
  // bind() keeps metadata<T> generic at runtime; the mapped Bound type cannot, so use the generated interface.
58
60
  hearthstone: (0, bind_js_1.bindAll)(ctx, hearthstoneEndpoints),
59
61
  sc2: (0, bind_js_1.bindAll)(ctx, sc2Endpoints),