@blizzard-api/d3 2.0.0 → 2.0.2
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 +75 -75
- package/dist/index.js +1 -10
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
# @blizzard-api/d3
|
|
2
|
-
|
|
3
|
-
This package aims to make it easier for you to integrate with the Blizzard Battle.net API, specifically for Diablo 3.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
npm i @blizzard-api/core @blizzard-api/d3
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
You can get paths, namespaces, parameters and more for a specific endpoint by calling it from the `d3` export.
|
|
14
|
-
|
|
15
|
-
```ts
|
|
16
|
-
import { d3 } from "@blizzard-api/d3"
|
|
17
|
-
//or
|
|
18
|
-
import d3 from "@blizzard-api/d3"
|
|
19
|
-
|
|
20
|
-
const achievement = d3.achievement(123);
|
|
21
|
-
^ { path: string, namespace?: string, parameters?: Record<string, never> }
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
If you don't want to use the exported d3 object, you can also access the functions directly:
|
|
25
|
-
|
|
26
|
-
```ts
|
|
27
|
-
import { achievement } from "@blizzard-api/d3"
|
|
28
|
-
|
|
29
|
-
const achi = achievement(123);
|
|
30
|
-
^ { path: string, namespace?: string, parameters?: Record<string, never> }
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### Types
|
|
34
|
-
|
|
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:
|
|
36
|
-
|
|
37
|
-
```ts
|
|
38
|
-
import type { AchievementResponse } from '@blizzard-api/d3';
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
If you simply want to use the existing object, you can use the helper, `ExtractResourceType`, from `@blizzard-api/core` like so:
|
|
42
|
-
|
|
43
|
-
```ts
|
|
44
|
-
import { d3 } from "@blizzard-api/d3"
|
|
45
|
-
|
|
46
|
-
const achievement = d3.achievement(123);
|
|
47
|
-
^ { path: string, namespace?: string, parameters?: Record<string, never> }
|
|
48
|
-
|
|
49
|
-
type AchievementResponse = ExtractResourceType<typeof achievement>;
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Notes on Types
|
|
53
|
-
|
|
54
|
-
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 to be some discrepancies. If you encounter any issues with the types from this package, please open an issue or a pull request.
|
|
55
|
-
|
|
56
|
-
### Client
|
|
57
|
-
|
|
58
|
-
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.
|
|
59
|
-
|
|
60
|
-
```ts
|
|
61
|
-
import { createBlizzardApiClient } from '@blizzard-api/client';
|
|
62
|
-
import { d3 } from '@blizzard-api/d3';
|
|
63
|
-
|
|
64
|
-
const client = await createBlizzardApiClient({
|
|
65
|
-
key: 'environment.blizzardClientId',
|
|
66
|
-
secret: 'environment.blizzardClientSecret',
|
|
67
|
-
origin: 'eu',
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
//Response will automatically be typed with the appropriate values
|
|
71
|
-
const response = await client.sendRequest(d3.commodities());
|
|
72
|
-
|
|
73
|
-
console.log(response);
|
|
74
|
-
^ typeof AuctionHouseCommoditiesResponse
|
|
75
|
-
```
|
|
1
|
+
# @blizzard-api/d3
|
|
2
|
+
|
|
3
|
+
This package aims to make it easier for you to integrate with the Blizzard Battle.net API, specifically for Diablo 3.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm i @blizzard-api/core @blizzard-api/d3
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
You can get paths, namespaces, parameters and more for a specific endpoint by calling it from the `d3` export.
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { d3 } from "@blizzard-api/d3"
|
|
17
|
+
//or
|
|
18
|
+
import d3 from "@blizzard-api/d3"
|
|
19
|
+
|
|
20
|
+
const achievement = d3.achievement(123);
|
|
21
|
+
^ { path: string, namespace?: string, parameters?: Record<string, never> }
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
If you don't want to use the exported d3 object, you can also access the functions directly:
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { achievement } from "@blizzard-api/d3"
|
|
28
|
+
|
|
29
|
+
const achi = achievement(123);
|
|
30
|
+
^ { path: string, namespace?: string, parameters?: Record<string, never> }
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Types
|
|
34
|
+
|
|
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:
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import type { AchievementResponse } from '@blizzard-api/d3';
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
If you simply want to use the existing object, you can use the helper, `ExtractResourceType`, from `@blizzard-api/core` like so:
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import { d3 } from "@blizzard-api/d3"
|
|
45
|
+
|
|
46
|
+
const achievement = d3.achievement(123);
|
|
47
|
+
^ { path: string, namespace?: string, parameters?: Record<string, never> }
|
|
48
|
+
|
|
49
|
+
type AchievementResponse = ExtractResourceType<typeof achievement>;
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Notes on Types
|
|
53
|
+
|
|
54
|
+
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 to be some discrepancies. If you encounter any issues with the types from this package, please open an issue or a pull request.
|
|
55
|
+
|
|
56
|
+
### Client
|
|
57
|
+
|
|
58
|
+
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.
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
import { createBlizzardApiClient } from '@blizzard-api/client';
|
|
62
|
+
import { d3 } from '@blizzard-api/d3';
|
|
63
|
+
|
|
64
|
+
const client = await createBlizzardApiClient({
|
|
65
|
+
key: 'environment.blizzardClientId',
|
|
66
|
+
secret: 'environment.blizzardClientSecret',
|
|
67
|
+
origin: 'eu',
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
//Response will automatically be typed with the appropriate values
|
|
71
|
+
const response = await client.sendRequest(d3.commodities());
|
|
72
|
+
|
|
73
|
+
console.log(response);
|
|
74
|
+
^ typeof AuctionHouseCommoditiesResponse
|
|
75
|
+
```
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { d3BasePath, d3GameDataBasePath, d3ProfileBasePath } from "@blizzard-api/core";
|
|
2
|
-
|
|
3
2
|
//#region src/act/act.ts
|
|
4
3
|
/**
|
|
5
4
|
* Returns the act information for the specified act ID.
|
|
@@ -16,7 +15,6 @@ function act(actId) {
|
|
|
16
15
|
function actIndex() {
|
|
17
16
|
return { path: `${d3BasePath}/act` };
|
|
18
17
|
}
|
|
19
|
-
|
|
20
18
|
//#endregion
|
|
21
19
|
//#region src/artisan-and-recipe/artisan-and-recipe.ts
|
|
22
20
|
/**
|
|
@@ -36,7 +34,6 @@ function artisan(artisanSlug) {
|
|
|
36
34
|
function recipe(artisanSlug, recipeSlug) {
|
|
37
35
|
return { path: `${d3BasePath}/artisan/${artisanSlug}/recipe/${recipeSlug}` };
|
|
38
36
|
}
|
|
39
|
-
|
|
40
37
|
//#endregion
|
|
41
38
|
//#region src/character-class-and-skill/character-class-and-skill.ts
|
|
42
39
|
/**
|
|
@@ -56,7 +53,6 @@ function characterClass(characterClassSlug) {
|
|
|
56
53
|
function skill(characterClassSlug, skillSlug) {
|
|
57
54
|
return { path: `${d3BasePath}/hero/${characterClassSlug}/skill/${skillSlug}` };
|
|
58
55
|
}
|
|
59
|
-
|
|
60
56
|
//#endregion
|
|
61
57
|
//#region src/follower/follower.ts
|
|
62
58
|
/**
|
|
@@ -67,7 +63,6 @@ function skill(characterClassSlug, skillSlug) {
|
|
|
67
63
|
function follower(followerSlug) {
|
|
68
64
|
return { path: `${d3BasePath}/follower/${followerSlug}` };
|
|
69
65
|
}
|
|
70
|
-
|
|
71
66
|
//#endregion
|
|
72
67
|
//#region src/game-data/game-data.ts
|
|
73
68
|
/**
|
|
@@ -118,7 +113,6 @@ function seasonIndex() {
|
|
|
118
113
|
function seasonLeaderboard(id, leaderboard) {
|
|
119
114
|
return { path: `${d3GameDataBasePath}/season/${id}/leaderboard/${leaderboard}` };
|
|
120
115
|
}
|
|
121
|
-
|
|
122
116
|
//#endregion
|
|
123
117
|
//#region src/item-type/item-type.ts
|
|
124
118
|
/**
|
|
@@ -136,7 +130,6 @@ function itemType(itemTypeSlug) {
|
|
|
136
130
|
function itemTypeIndex() {
|
|
137
131
|
return { path: `${d3BasePath}/item-type` };
|
|
138
132
|
}
|
|
139
|
-
|
|
140
133
|
//#endregion
|
|
141
134
|
//#region src/item/item.ts
|
|
142
135
|
/**
|
|
@@ -147,7 +140,6 @@ function itemTypeIndex() {
|
|
|
147
140
|
function item(itemSlugAndId) {
|
|
148
141
|
return { path: `${d3BasePath}/item/${itemSlugAndId}` };
|
|
149
142
|
}
|
|
150
|
-
|
|
151
143
|
//#endregion
|
|
152
144
|
//#region src/profile/profile.ts
|
|
153
145
|
/**
|
|
@@ -185,7 +177,6 @@ function accountHeroFollowerItems(battleTag, heroId) {
|
|
|
185
177
|
function accountHeroItems(battleTag, heroId) {
|
|
186
178
|
return { path: `${d3ProfileBasePath}/${encodeURIComponent(battleTag)}/hero/${heroId}/items` };
|
|
187
179
|
}
|
|
188
|
-
|
|
189
180
|
//#endregion
|
|
190
181
|
//#region src/index.ts
|
|
191
182
|
const d3 = {
|
|
@@ -210,7 +201,7 @@ const d3 = {
|
|
|
210
201
|
seasonIndex,
|
|
211
202
|
seasonLeaderboard
|
|
212
203
|
};
|
|
213
|
-
|
|
214
204
|
//#endregion
|
|
215
205
|
export { account, accountHero, accountHeroFollowerItems, accountHeroItems, act, actIndex, artisan, characterClass, d3, d3 as default, era, eraIndex, eraLeaderboard, follower, item, itemType, itemTypeIndex, recipe, season, seasonIndex, seasonLeaderboard, skill };
|
|
206
|
+
|
|
216
207
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/act/act.ts","../src/artisan-and-recipe/artisan-and-recipe.ts","../src/character-class-and-skill/character-class-and-skill.ts","../src/follower/follower.ts","../src/game-data/game-data.ts","../src/item-type/item-type.ts","../src/item/item.ts","../src/profile/profile.ts","../src/index.ts"],"sourcesContent":["import type { Resource } from '@blizzard-api/core';\r\nimport { d3BasePath } from '@blizzard-api/core';\r\nimport type { ActIndexResponse, ActResponse } from './types';\r\n\r\n/**\r\n * Returns the act information for the specified act ID.\r\n * @param actId The ID of the act.\r\n * @returns The act resource. See {@link ActResponse}.\r\n */\r\nexport function act(actId: number): Resource<ActResponse> {\r\n return {\r\n path: `${d3BasePath}/act/${actId}`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the index of acts.\r\n * @returns The act index resource. See {@link ActIndexResponse}.\r\n */\r\nexport function actIndex(): Resource<ActIndexResponse> {\r\n return {\r\n path: `${d3BasePath}/act`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { d3BasePath } from '@blizzard-api/core';\r\nimport type { ArtisanResponse, RecipeResponse } from './types';\r\n\r\n/**\r\n * Returns the artisan information for the specified artisan slug.\r\n * @param artisanSlug The slug of the artisan.\r\n * @returns The artisan resource. See {@link ArtisanResponse}.\r\n */\r\nexport function artisan(artisanSlug: string): Resource<ArtisanResponse> {\r\n return {\r\n path: `${d3BasePath}/artisan/${artisanSlug}`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the recipe information for the specified artisan and recipe slugs.\r\n * @param artisanSlug The slug of the artisan.\r\n * @param recipeSlug The slug of the recipe.\r\n * @returns The recipe resource. See {@link RecipeResponse}.\r\n */\r\nexport function recipe(artisanSlug: string, recipeSlug: string): Resource<RecipeResponse> {\r\n return {\r\n path: `${d3BasePath}/artisan/${artisanSlug}/recipe/${recipeSlug}`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { d3BasePath } from '@blizzard-api/core';\r\nimport type { CharacterClassResponse, SkillResponse } from './types';\r\n\r\n/**\r\n * Returns the character class information for the specified character class slug.\r\n * @param characterClassSlug The slug of the character class.\r\n * @returns The character class resource. See {@link CharacterClassResponse}.\r\n */\r\nexport function characterClass(characterClassSlug: string): Resource<CharacterClassResponse> {\r\n return {\r\n path: `${d3BasePath}/character-class/${characterClassSlug}`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the skill information for the specified character class and skill slugs.\r\n * @param characterClassSlug The slug of the character class.\r\n * @param skillSlug The slug of the skill.\r\n * @returns The skill resource. See {@link SkillResponse}.\r\n */\r\nexport function skill(characterClassSlug: string, skillSlug: string): Resource<SkillResponse> {\r\n return {\r\n path: `${d3BasePath}/hero/${characterClassSlug}/skill/${skillSlug}`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { d3BasePath } from '@blizzard-api/core';\r\nimport type { FollowerResponse } from './types';\r\n\r\n/**\r\n * Returns the follower information for the specified follower slug.\r\n * @param followerSlug The slug of the follower.\r\n * @returns The follower resource. See {@link FollowerResponse}.\r\n */\r\nexport function follower(followerSlug: string): Resource<FollowerResponse> {\r\n return {\r\n path: `${d3BasePath}/follower/${followerSlug}`,\r\n };\r\n}\r\n","import { d3GameDataBasePath } from '@blizzard-api/core';\r\nimport type { Resource } from '@blizzard-api/core';\r\nimport type {\r\n EraIndexResponse,\r\n EraLeaderboardResponse,\r\n EraResponse,\r\n SeasonIndexResponse,\r\n SeasonLeaderboardResponse,\r\n SeasonResponse,\r\n} from './types';\r\n\r\n/**\r\n * Returns the era information for the specified era ID.\r\n * @param id The ID of the era.\r\n * @returns The era resource. See {@link EraResponse}.\r\n */\r\nexport function era(id: number): Resource<EraResponse> {\r\n return {\r\n path: `${d3GameDataBasePath}/era/${id}`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the era index.\r\n * @returns The era index resource. See {@link EraIndexResponse}.\r\n */\r\nexport function eraIndex(): Resource<EraIndexResponse> {\r\n return {\r\n path: `${d3GameDataBasePath}/era`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the era leaderboard for the specified era ID and leaderboard.\r\n * @param id The ID of the era.\r\n * @param leaderboard The name of the leaderboard.\r\n * @returns The era leaderboard resource. See {@link EraLeaderboardResponse}.\r\n */\r\nexport function eraLeaderboard(id: number, leaderboard: string): Resource<EraLeaderboardResponse> {\r\n return {\r\n path: `${d3GameDataBasePath}/era/${id}/leaderboard/${leaderboard}`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the season information for the specified season ID.\r\n * @param id The ID of the season.\r\n * @returns The season resource. See {@link SeasonResponse}.\r\n */\r\nexport function season(id: number): Resource<SeasonResponse> {\r\n return {\r\n path: `${d3GameDataBasePath}/season/${id}`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the season index.\r\n * @returns The season index resource. See {@link SeasonIndexResponse}.\r\n */\r\nexport function seasonIndex(): Resource<SeasonIndexResponse> {\r\n return {\r\n path: `${d3GameDataBasePath}/season`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the season leaderboard for the specified season ID and leaderboard.\r\n * @param id The ID of the season.\r\n * @param leaderboard The name of the leaderboard.\r\n * @returns The season leaderboard resource. See {@link SeasonLeaderboardResponse}.\r\n */\r\nexport function seasonLeaderboard(id: number, leaderboard: string): Resource<SeasonLeaderboardResponse> {\r\n return {\r\n path: `${d3GameDataBasePath}/season/${id}/leaderboard/${leaderboard}`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { d3BasePath } from '@blizzard-api/core';\r\nimport type { ItemTypeIndexResponse, ItemTypeResponse } from './types';\r\n\r\n/**\r\n * Returns the item type information for the specified item type slug.\r\n * @param itemTypeSlug The slug of the item type, example: \"sword2h\"\r\n * @returns The item type resource. See {@link ItemTypeResponse}.\r\n */\r\nexport function itemType(itemTypeSlug: string): Resource<Array<ItemTypeResponse>> {\r\n return {\r\n path: `${d3BasePath}/item-type/${itemTypeSlug}`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the item type index.\r\n * @returns The item type index resource. See {@link ItemTypeIndexResponse}.\r\n */\r\nexport function itemTypeIndex(): Resource<Array<ItemTypeIndexResponse>> {\r\n return {\r\n path: `${d3BasePath}/item-type`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { d3BasePath } from '@blizzard-api/core';\r\nimport type { ItemResponse } from './types';\r\n\r\n/**\r\n * Returns the item information for the specified item slug and ID.\r\n * @param itemSlugAndId The slug and ID of the item, example: \"corrupted-ashbringer-Unique_Sword_2H_104_x1\".\r\n * @returns The item resource. See {@link ItemResponse}.\r\n */\r\nexport function item(itemSlugAndId: string): Resource<ItemResponse> {\r\n return {\r\n path: `${d3BasePath}/item/${itemSlugAndId}`,\r\n };\r\n}\r\n","import { d3ProfileBasePath } from '@blizzard-api/core';\r\nimport type { Resource } from '@blizzard-api/core';\r\nimport type { AccountHeroFollowerItemsResponse, AccountHeroResponse, AccountResponse } from './types';\r\n\r\n/**\r\n * Returns the account information for the specified battle tag.\r\n * @param battleTag The battle tag of the account.\r\n * @returns The account resource. See {@link AccountResponse}.\r\n */\r\nexport function account(battleTag: string): Resource<AccountResponse> {\r\n return {\r\n path: `${d3ProfileBasePath}/${encodeURIComponent(battleTag)}`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the hero information for the specified battle tag and hero ID.\r\n * @param battleTag The battle tag of the account.\r\n * @param heroId The ID of the hero.\r\n * @returns The hero resource. See {@link AccountHeroResponse}.\r\n */\r\nexport function accountHero(battleTag: string, heroId: number): Resource<AccountHeroResponse> {\r\n return {\r\n path: `${d3ProfileBasePath}/${encodeURIComponent(battleTag)}/hero/${heroId}`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the follower items for the specified battle tag and hero ID.\r\n * @param battleTag The battle tag of the account.\r\n * @param heroId The ID of the hero.\r\n * @returns The follower items resource. See {@link AccountHeroFollowerItemsResponse}.\r\n */\r\nexport function accountHeroFollowerItems(\r\n battleTag: string,\r\n heroId: number,\r\n): Resource<AccountHeroFollowerItemsResponse> {\r\n return {\r\n path: `${d3ProfileBasePath}/${encodeURIComponent(battleTag)}/hero/${heroId}/follower-items`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the items for the specified battle tag and hero ID.\r\n * @param battleTag The battle tag of the account.\r\n * @param heroId The ID of the hero.\r\n * @returns The hero items resource. See {@link AccountHeroResponse}.\r\n */\r\nexport function accountHeroItems(battleTag: string, heroId: number): Resource<AccountHeroResponse> {\r\n return {\r\n path: `${d3ProfileBasePath}/${encodeURIComponent(battleTag)}/hero/${heroId}/items`,\r\n };\r\n}\r\n","import { act, actIndex } from './act/act';\r\nimport { artisan, recipe } from './artisan-and-recipe/artisan-and-recipe';\r\nimport { characterClass, skill } from './character-class-and-skill/character-class-and-skill';\r\nimport { follower } from './follower/follower';\r\nimport { era, eraIndex, eraLeaderboard, season, seasonIndex, seasonLeaderboard } from './game-data/game-data';\r\nimport { itemType, itemTypeIndex } from './item-type/item-type';\r\nimport { item } from './item/item';\r\nimport { account, accountHero, accountHeroFollowerItems, accountHeroItems } from './profile/profile';\r\n\r\nconst d3 = {\r\n //Act\r\n act,\r\n actIndex,\r\n //Artisan and Recipe\r\n artisan,\r\n recipe,\r\n //Follower\r\n follower,\r\n //Character Class and Skill\r\n characterClass,\r\n skill,\r\n //Item Type\r\n itemType,\r\n itemTypeIndex,\r\n //Item\r\n item,\r\n //Profile\r\n account,\r\n accountHero,\r\n accountHeroFollowerItems,\r\n accountHeroItems,\r\n //Game Data\r\n era,\r\n eraIndex,\r\n eraLeaderboard,\r\n season,\r\n seasonIndex,\r\n seasonLeaderboard,\r\n};\r\nexport default d3;\r\nexport { d3 };\r\n\r\n//Act\r\nexport * from './act/act';\r\nexport type * from './act/types';\r\n//Artisan and Recipe\r\nexport * from './artisan-and-recipe/artisan-and-recipe';\r\nexport type * from './artisan-and-recipe/types';\r\n//Character Class and Skill\r\nexport * from './character-class-and-skill/character-class-and-skill';\r\nexport type * from './character-class-and-skill/types';\r\n//Follower\r\nexport * from './follower/follower';\r\nexport type * from './follower/types';\r\n//Game Data\r\nexport * from './game-data/game-data';\r\nexport type * from './game-data/types';\r\n//Item\r\nexport * from './item/item';\r\nexport type * from './item/types';\r\n//Item Type\r\nexport * from './item-type/item-type';\r\nexport type * from './item-type/types';\r\n//Profile\r\nexport * from './profile/profile';\r\nexport type * from './profile/types';\r\n"],"mappings":";;;;;;;;AASA,SAAgB,IAAI,OAAsC;AACxD,QAAO,EACL,MAAM,GAAG,WAAW,OAAO,SAC5B;;;;;;AAOH,SAAgB,WAAuC;AACrD,QAAO,EACL,MAAM,GAAG,WAAW,OACrB;;;;;;;;;;ACbH,SAAgB,QAAQ,aAAgD;AACtE,QAAO,EACL,MAAM,GAAG,WAAW,WAAW,eAChC;;;;;;;;AASH,SAAgB,OAAO,aAAqB,YAA8C;AACxF,QAAO,EACL,MAAM,GAAG,WAAW,WAAW,YAAY,UAAU,cACtD;;;;;;;;;;ACfH,SAAgB,eAAe,oBAA8D;AAC3F,QAAO,EACL,MAAM,GAAG,WAAW,mBAAmB,sBACxC;;;;;;;;AASH,SAAgB,MAAM,oBAA4B,WAA4C;AAC5F,QAAO,EACL,MAAM,GAAG,WAAW,QAAQ,mBAAmB,SAAS,aACzD;;;;;;;;;;ACfH,SAAgB,SAAS,cAAkD;AACzE,QAAO,EACL,MAAM,GAAG,WAAW,YAAY,gBACjC;;;;;;;;;;ACIH,SAAgB,IAAI,IAAmC;AACrD,QAAO,EACL,MAAM,GAAG,mBAAmB,OAAO,MACpC;;;;;;AAOH,SAAgB,WAAuC;AACrD,QAAO,EACL,MAAM,GAAG,mBAAmB,OAC7B;;;;;;;;AASH,SAAgB,eAAe,IAAY,aAAuD;AAChG,QAAO,EACL,MAAM,GAAG,mBAAmB,OAAO,GAAG,eAAe,eACtD;;;;;;;AAQH,SAAgB,OAAO,IAAsC;AAC3D,QAAO,EACL,MAAM,GAAG,mBAAmB,UAAU,MACvC;;;;;;AAOH,SAAgB,cAA6C;AAC3D,QAAO,EACL,MAAM,GAAG,mBAAmB,UAC7B;;;;;;;;AASH,SAAgB,kBAAkB,IAAY,aAA0D;AACtG,QAAO,EACL,MAAM,GAAG,mBAAmB,UAAU,GAAG,eAAe,eACzD;;;;;;;;;;ACjEH,SAAgB,SAAS,cAAyD;AAChF,QAAO,EACL,MAAM,GAAG,WAAW,aAAa,gBAClC;;;;;;AAOH,SAAgB,gBAAwD;AACtE,QAAO,EACL,MAAM,GAAG,WAAW,aACrB;;;;;;;;;;ACbH,SAAgB,KAAK,eAA+C;AAClE,QAAO,EACL,MAAM,GAAG,WAAW,QAAQ,iBAC7B;;;;;;;;;;ACHH,SAAgB,QAAQ,WAA8C;AACpE,QAAO,EACL,MAAM,GAAG,kBAAkB,GAAG,mBAAmB,UAAU,IAC5D;;;;;;;;AASH,SAAgB,YAAY,WAAmB,QAA+C;AAC5F,QAAO,EACL,MAAM,GAAG,kBAAkB,GAAG,mBAAmB,UAAU,CAAC,QAAQ,UACrE;;;;;;;;AASH,SAAgB,yBACd,WACA,QAC4C;AAC5C,QAAO,EACL,MAAM,GAAG,kBAAkB,GAAG,mBAAmB,UAAU,CAAC,QAAQ,OAAO,kBAC5E;;;;;;;;AASH,SAAgB,iBAAiB,WAAmB,QAA+C;AACjG,QAAO,EACL,MAAM,GAAG,kBAAkB,GAAG,mBAAmB,UAAU,CAAC,QAAQ,OAAO,SAC5E;;;;;AC1CH,MAAM,KAAK;CAET;CACA;CAEA;CACA;CAEA;CAEA;CACA;CAEA;CACA;CAEA;CAEA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CACD"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/act/act.ts","../src/artisan-and-recipe/artisan-and-recipe.ts","../src/character-class-and-skill/character-class-and-skill.ts","../src/follower/follower.ts","../src/game-data/game-data.ts","../src/item-type/item-type.ts","../src/item/item.ts","../src/profile/profile.ts","../src/index.ts"],"sourcesContent":["import type { Resource } from '@blizzard-api/core';\r\nimport { d3BasePath } from '@blizzard-api/core';\r\nimport type { ActIndexResponse, ActResponse } from './types';\r\n\r\n/**\r\n * Returns the act information for the specified act ID.\r\n * @param actId The ID of the act.\r\n * @returns The act resource. See {@link ActResponse}.\r\n */\r\nexport function act(actId: number): Resource<ActResponse> {\r\n return {\r\n path: `${d3BasePath}/act/${actId}`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the index of acts.\r\n * @returns The act index resource. See {@link ActIndexResponse}.\r\n */\r\nexport function actIndex(): Resource<ActIndexResponse> {\r\n return {\r\n path: `${d3BasePath}/act`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { d3BasePath } from '@blizzard-api/core';\r\nimport type { ArtisanResponse, RecipeResponse } from './types';\r\n\r\n/**\r\n * Returns the artisan information for the specified artisan slug.\r\n * @param artisanSlug The slug of the artisan.\r\n * @returns The artisan resource. See {@link ArtisanResponse}.\r\n */\r\nexport function artisan(artisanSlug: string): Resource<ArtisanResponse> {\r\n return {\r\n path: `${d3BasePath}/artisan/${artisanSlug}`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the recipe information for the specified artisan and recipe slugs.\r\n * @param artisanSlug The slug of the artisan.\r\n * @param recipeSlug The slug of the recipe.\r\n * @returns The recipe resource. See {@link RecipeResponse}.\r\n */\r\nexport function recipe(artisanSlug: string, recipeSlug: string): Resource<RecipeResponse> {\r\n return {\r\n path: `${d3BasePath}/artisan/${artisanSlug}/recipe/${recipeSlug}`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { d3BasePath } from '@blizzard-api/core';\r\nimport type { CharacterClassResponse, SkillResponse } from './types';\r\n\r\n/**\r\n * Returns the character class information for the specified character class slug.\r\n * @param characterClassSlug The slug of the character class.\r\n * @returns The character class resource. See {@link CharacterClassResponse}.\r\n */\r\nexport function characterClass(characterClassSlug: string): Resource<CharacterClassResponse> {\r\n return {\r\n path: `${d3BasePath}/character-class/${characterClassSlug}`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the skill information for the specified character class and skill slugs.\r\n * @param characterClassSlug The slug of the character class.\r\n * @param skillSlug The slug of the skill.\r\n * @returns The skill resource. See {@link SkillResponse}.\r\n */\r\nexport function skill(characterClassSlug: string, skillSlug: string): Resource<SkillResponse> {\r\n return {\r\n path: `${d3BasePath}/hero/${characterClassSlug}/skill/${skillSlug}`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { d3BasePath } from '@blizzard-api/core';\r\nimport type { FollowerResponse } from './types';\r\n\r\n/**\r\n * Returns the follower information for the specified follower slug.\r\n * @param followerSlug The slug of the follower.\r\n * @returns The follower resource. See {@link FollowerResponse}.\r\n */\r\nexport function follower(followerSlug: string): Resource<FollowerResponse> {\r\n return {\r\n path: `${d3BasePath}/follower/${followerSlug}`,\r\n };\r\n}\r\n","import { d3GameDataBasePath } from '@blizzard-api/core';\r\nimport type { Resource } from '@blizzard-api/core';\r\nimport type {\r\n EraIndexResponse,\r\n EraLeaderboardResponse,\r\n EraResponse,\r\n SeasonIndexResponse,\r\n SeasonLeaderboardResponse,\r\n SeasonResponse,\r\n} from './types';\r\n\r\n/**\r\n * Returns the era information for the specified era ID.\r\n * @param id The ID of the era.\r\n * @returns The era resource. See {@link EraResponse}.\r\n */\r\nexport function era(id: number): Resource<EraResponse> {\r\n return {\r\n path: `${d3GameDataBasePath}/era/${id}`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the era index.\r\n * @returns The era index resource. See {@link EraIndexResponse}.\r\n */\r\nexport function eraIndex(): Resource<EraIndexResponse> {\r\n return {\r\n path: `${d3GameDataBasePath}/era`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the era leaderboard for the specified era ID and leaderboard.\r\n * @param id The ID of the era.\r\n * @param leaderboard The name of the leaderboard.\r\n * @returns The era leaderboard resource. See {@link EraLeaderboardResponse}.\r\n */\r\nexport function eraLeaderboard(id: number, leaderboard: string): Resource<EraLeaderboardResponse> {\r\n return {\r\n path: `${d3GameDataBasePath}/era/${id}/leaderboard/${leaderboard}`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the season information for the specified season ID.\r\n * @param id The ID of the season.\r\n * @returns The season resource. See {@link SeasonResponse}.\r\n */\r\nexport function season(id: number): Resource<SeasonResponse> {\r\n return {\r\n path: `${d3GameDataBasePath}/season/${id}`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the season index.\r\n * @returns The season index resource. See {@link SeasonIndexResponse}.\r\n */\r\nexport function seasonIndex(): Resource<SeasonIndexResponse> {\r\n return {\r\n path: `${d3GameDataBasePath}/season`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the season leaderboard for the specified season ID and leaderboard.\r\n * @param id The ID of the season.\r\n * @param leaderboard The name of the leaderboard.\r\n * @returns The season leaderboard resource. See {@link SeasonLeaderboardResponse}.\r\n */\r\nexport function seasonLeaderboard(id: number, leaderboard: string): Resource<SeasonLeaderboardResponse> {\r\n return {\r\n path: `${d3GameDataBasePath}/season/${id}/leaderboard/${leaderboard}`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { d3BasePath } from '@blizzard-api/core';\r\nimport type { ItemTypeIndexResponse, ItemTypeResponse } from './types';\r\n\r\n/**\r\n * Returns the item type information for the specified item type slug.\r\n * @param itemTypeSlug The slug of the item type, example: \"sword2h\"\r\n * @returns The item type resource. See {@link ItemTypeResponse}.\r\n */\r\nexport function itemType(itemTypeSlug: string): Resource<Array<ItemTypeResponse>> {\r\n return {\r\n path: `${d3BasePath}/item-type/${itemTypeSlug}`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the item type index.\r\n * @returns The item type index resource. See {@link ItemTypeIndexResponse}.\r\n */\r\nexport function itemTypeIndex(): Resource<Array<ItemTypeIndexResponse>> {\r\n return {\r\n path: `${d3BasePath}/item-type`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { d3BasePath } from '@blizzard-api/core';\r\nimport type { ItemResponse } from './types';\r\n\r\n/**\r\n * Returns the item information for the specified item slug and ID.\r\n * @param itemSlugAndId The slug and ID of the item, example: \"corrupted-ashbringer-Unique_Sword_2H_104_x1\".\r\n * @returns The item resource. See {@link ItemResponse}.\r\n */\r\nexport function item(itemSlugAndId: string): Resource<ItemResponse> {\r\n return {\r\n path: `${d3BasePath}/item/${itemSlugAndId}`,\r\n };\r\n}\r\n","import { d3ProfileBasePath } from '@blizzard-api/core';\r\nimport type { Resource } from '@blizzard-api/core';\r\nimport type { AccountHeroFollowerItemsResponse, AccountHeroResponse, AccountResponse } from './types';\r\n\r\n/**\r\n * Returns the account information for the specified battle tag.\r\n * @param battleTag The battle tag of the account.\r\n * @returns The account resource. See {@link AccountResponse}.\r\n */\r\nexport function account(battleTag: string): Resource<AccountResponse> {\r\n return {\r\n path: `${d3ProfileBasePath}/${encodeURIComponent(battleTag)}`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the hero information for the specified battle tag and hero ID.\r\n * @param battleTag The battle tag of the account.\r\n * @param heroId The ID of the hero.\r\n * @returns The hero resource. See {@link AccountHeroResponse}.\r\n */\r\nexport function accountHero(battleTag: string, heroId: number): Resource<AccountHeroResponse> {\r\n return {\r\n path: `${d3ProfileBasePath}/${encodeURIComponent(battleTag)}/hero/${heroId}`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the follower items for the specified battle tag and hero ID.\r\n * @param battleTag The battle tag of the account.\r\n * @param heroId The ID of the hero.\r\n * @returns The follower items resource. See {@link AccountHeroFollowerItemsResponse}.\r\n */\r\nexport function accountHeroFollowerItems(\r\n battleTag: string,\r\n heroId: number,\r\n): Resource<AccountHeroFollowerItemsResponse> {\r\n return {\r\n path: `${d3ProfileBasePath}/${encodeURIComponent(battleTag)}/hero/${heroId}/follower-items`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the items for the specified battle tag and hero ID.\r\n * @param battleTag The battle tag of the account.\r\n * @param heroId The ID of the hero.\r\n * @returns The hero items resource. See {@link AccountHeroResponse}.\r\n */\r\nexport function accountHeroItems(battleTag: string, heroId: number): Resource<AccountHeroResponse> {\r\n return {\r\n path: `${d3ProfileBasePath}/${encodeURIComponent(battleTag)}/hero/${heroId}/items`,\r\n };\r\n}\r\n","import { act, actIndex } from './act/act';\r\nimport { artisan, recipe } from './artisan-and-recipe/artisan-and-recipe';\r\nimport { characterClass, skill } from './character-class-and-skill/character-class-and-skill';\r\nimport { follower } from './follower/follower';\r\nimport { era, eraIndex, eraLeaderboard, season, seasonIndex, seasonLeaderboard } from './game-data/game-data';\r\nimport { itemType, itemTypeIndex } from './item-type/item-type';\r\nimport { item } from './item/item';\r\nimport { account, accountHero, accountHeroFollowerItems, accountHeroItems } from './profile/profile';\r\n\r\nconst d3 = {\r\n //Act\r\n act,\r\n actIndex,\r\n //Artisan and Recipe\r\n artisan,\r\n recipe,\r\n //Follower\r\n follower,\r\n //Character Class and Skill\r\n characterClass,\r\n skill,\r\n //Item Type\r\n itemType,\r\n itemTypeIndex,\r\n //Item\r\n item,\r\n //Profile\r\n account,\r\n accountHero,\r\n accountHeroFollowerItems,\r\n accountHeroItems,\r\n //Game Data\r\n era,\r\n eraIndex,\r\n eraLeaderboard,\r\n season,\r\n seasonIndex,\r\n seasonLeaderboard,\r\n};\r\nexport default d3;\r\nexport { d3 };\r\n\r\n//Act\r\nexport * from './act/act';\r\nexport type * from './act/types';\r\n//Artisan and Recipe\r\nexport * from './artisan-and-recipe/artisan-and-recipe';\r\nexport type * from './artisan-and-recipe/types';\r\n//Character Class and Skill\r\nexport * from './character-class-and-skill/character-class-and-skill';\r\nexport type * from './character-class-and-skill/types';\r\n//Follower\r\nexport * from './follower/follower';\r\nexport type * from './follower/types';\r\n//Game Data\r\nexport * from './game-data/game-data';\r\nexport type * from './game-data/types';\r\n//Item\r\nexport * from './item/item';\r\nexport type * from './item/types';\r\n//Item Type\r\nexport * from './item-type/item-type';\r\nexport type * from './item-type/types';\r\n//Profile\r\nexport * from './profile/profile';\r\nexport type * from './profile/types';\r\n"],"mappings":";;;;;;;AASA,SAAgB,IAAI,OAAsC;AACxD,QAAO,EACL,MAAM,GAAG,WAAW,OAAO,SAC5B;;;;;;AAOH,SAAgB,WAAuC;AACrD,QAAO,EACL,MAAM,GAAG,WAAW,OACrB;;;;;;;;;ACbH,SAAgB,QAAQ,aAAgD;AACtE,QAAO,EACL,MAAM,GAAG,WAAW,WAAW,eAChC;;;;;;;;AASH,SAAgB,OAAO,aAAqB,YAA8C;AACxF,QAAO,EACL,MAAM,GAAG,WAAW,WAAW,YAAY,UAAU,cACtD;;;;;;;;;ACfH,SAAgB,eAAe,oBAA8D;AAC3F,QAAO,EACL,MAAM,GAAG,WAAW,mBAAmB,sBACxC;;;;;;;;AASH,SAAgB,MAAM,oBAA4B,WAA4C;AAC5F,QAAO,EACL,MAAM,GAAG,WAAW,QAAQ,mBAAmB,SAAS,aACzD;;;;;;;;;ACfH,SAAgB,SAAS,cAAkD;AACzE,QAAO,EACL,MAAM,GAAG,WAAW,YAAY,gBACjC;;;;;;;;;ACIH,SAAgB,IAAI,IAAmC;AACrD,QAAO,EACL,MAAM,GAAG,mBAAmB,OAAO,MACpC;;;;;;AAOH,SAAgB,WAAuC;AACrD,QAAO,EACL,MAAM,GAAG,mBAAmB,OAC7B;;;;;;;;AASH,SAAgB,eAAe,IAAY,aAAuD;AAChG,QAAO,EACL,MAAM,GAAG,mBAAmB,OAAO,GAAG,eAAe,eACtD;;;;;;;AAQH,SAAgB,OAAO,IAAsC;AAC3D,QAAO,EACL,MAAM,GAAG,mBAAmB,UAAU,MACvC;;;;;;AAOH,SAAgB,cAA6C;AAC3D,QAAO,EACL,MAAM,GAAG,mBAAmB,UAC7B;;;;;;;;AASH,SAAgB,kBAAkB,IAAY,aAA0D;AACtG,QAAO,EACL,MAAM,GAAG,mBAAmB,UAAU,GAAG,eAAe,eACzD;;;;;;;;;ACjEH,SAAgB,SAAS,cAAyD;AAChF,QAAO,EACL,MAAM,GAAG,WAAW,aAAa,gBAClC;;;;;;AAOH,SAAgB,gBAAwD;AACtE,QAAO,EACL,MAAM,GAAG,WAAW,aACrB;;;;;;;;;ACbH,SAAgB,KAAK,eAA+C;AAClE,QAAO,EACL,MAAM,GAAG,WAAW,QAAQ,iBAC7B;;;;;;;;;ACHH,SAAgB,QAAQ,WAA8C;AACpE,QAAO,EACL,MAAM,GAAG,kBAAkB,GAAG,mBAAmB,UAAU,IAC5D;;;;;;;;AASH,SAAgB,YAAY,WAAmB,QAA+C;AAC5F,QAAO,EACL,MAAM,GAAG,kBAAkB,GAAG,mBAAmB,UAAU,CAAC,QAAQ,UACrE;;;;;;;;AASH,SAAgB,yBACd,WACA,QAC4C;AAC5C,QAAO,EACL,MAAM,GAAG,kBAAkB,GAAG,mBAAmB,UAAU,CAAC,QAAQ,OAAO,kBAC5E;;;;;;;;AASH,SAAgB,iBAAiB,WAAmB,QAA+C;AACjG,QAAO,EACL,MAAM,GAAG,kBAAkB,GAAG,mBAAmB,UAAU,CAAC,QAAQ,OAAO,SAC5E;;;;AC1CH,MAAM,KAAK;CAET;CACA;CAEA;CACA;CAEA;CAEA;CACA;CAEA;CACA;CAEA;CAEA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blizzard-api/d3",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Putro",
|
|
6
6
|
"description": "A series of helpers to interact with the Diablo 3 Blizzard API",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@blizzard-api/core": "3.0.
|
|
37
|
+
"@blizzard-api/core": "3.0.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@blizzard-api/core": "3.0.
|
|
40
|
+
"@blizzard-api/core": "3.0.2"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "tsdown",
|