@blizzard-api/d3 0.1.0 → 0.1.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 +18 -14
- package/dist/index.cjs +37 -78
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +213 -213
- package/dist/index.d.ts +213 -213
- package/dist/index.js +13 -32
- package/dist/index.js.map +1 -1
- package/package.json +6 -4
package/dist/index.js
CHANGED
|
@@ -78,13 +78,6 @@ function eraLeaderboard(id, leaderboard) {
|
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
// src/item/item.ts
|
|
82
|
-
function item(itemSlugAndId) {
|
|
83
|
-
return {
|
|
84
|
-
path: `${base}/item/${itemSlugAndId}`
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
|
|
88
81
|
// src/item-type/item-type.ts
|
|
89
82
|
function itemTypeIndex() {
|
|
90
83
|
return {
|
|
@@ -97,6 +90,13 @@ function itemType(itemTypeSlug) {
|
|
|
97
90
|
};
|
|
98
91
|
}
|
|
99
92
|
|
|
93
|
+
// src/item/item.ts
|
|
94
|
+
function item(itemSlugAndId) {
|
|
95
|
+
return {
|
|
96
|
+
path: `${base}/item/${itemSlugAndId}`
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
100
|
// src/profile/profile.ts
|
|
101
101
|
function account(battleTag) {
|
|
102
102
|
return {
|
|
@@ -138,39 +138,20 @@ var d3 = {
|
|
|
138
138
|
//Item
|
|
139
139
|
item,
|
|
140
140
|
//Profile
|
|
141
|
-
account,
|
|
142
|
-
accountHero,
|
|
143
|
-
accountHeroItems,
|
|
144
|
-
accountHeroFollowerItems,
|
|
145
|
-
//Game Data
|
|
146
|
-
seasonIndex,
|
|
147
|
-
season,
|
|
148
|
-
seasonLeaderboard,
|
|
149
|
-
eraIndex,
|
|
150
|
-
era,
|
|
151
|
-
eraLeaderboard
|
|
152
|
-
};
|
|
153
|
-
export {
|
|
154
141
|
account,
|
|
155
142
|
accountHero,
|
|
156
143
|
accountHeroFollowerItems,
|
|
157
144
|
accountHeroItems,
|
|
158
|
-
|
|
159
|
-
actIndex,
|
|
160
|
-
artisan,
|
|
161
|
-
characterClass,
|
|
162
|
-
d3,
|
|
145
|
+
//Game Data
|
|
163
146
|
era,
|
|
164
147
|
eraIndex,
|
|
165
148
|
eraLeaderboard,
|
|
166
|
-
follower,
|
|
167
|
-
item,
|
|
168
|
-
itemType,
|
|
169
|
-
itemTypeIndex,
|
|
170
|
-
recipe,
|
|
171
149
|
season,
|
|
172
150
|
seasonIndex,
|
|
173
|
-
seasonLeaderboard
|
|
174
|
-
skill
|
|
151
|
+
seasonLeaderboard
|
|
175
152
|
};
|
|
153
|
+
var src_default = d3;
|
|
154
|
+
|
|
155
|
+
export { account, accountHero, accountHeroFollowerItems, accountHeroItems, act, actIndex, artisan, characterClass, d3, src_default as default, era, eraIndex, eraLeaderboard, follower, item, itemType, itemTypeIndex, recipe, season, seasonIndex, seasonLeaderboard, skill };
|
|
156
|
+
//# sourceMappingURL=out.js.map
|
|
176
157
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/base.ts","../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/item.ts","../src/item
|
|
1
|
+
{"version":3,"sources":["../src/base.ts","../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"],"names":[],"mappings":";AAAO,IAAM,OAAO;AAEb,IAAM,cAAc;AAGpB,IAAM,eAAe;;;ACDrB,SAAS,IAAI,OAAsC;AACxD,SAAO;AAAA,IACL,MAAM,GAA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D;AACF;;;ACzCO,SAAS,gBAAwD;AACtE,SAAO;AAAA,IACL,MAAM,GAAG,IAAI;AAAA,EACf;AACF;AAEO,SAAS,SAAS,cAAyD;AAChF,SAAO;AAAA,IACL,MAAM,GAAG,IAAI,cAAc,YAAY;AAAA,EACzC;AACF;;;ACVO,SAAS,KAAK,eAA+C;AAClE,SAAO;AAAA,IACL,MAAM,GAAG,IAAI,SAAS,aAAa;AAAA,EACrC;AACF;;;ACJO,SAAS,QAAQ,WAA8C;AACpE,SAAO;AAAA,IACL,MAAM,GAAG,WAAW,IAAI,SAAS;AAAA,EACnC;AACF;AAEO,SAAS,YAAY,WAAmB,QAA+C;AAC5F,SAAO;AAAA,IACL,MAAM,GAAG,WAAW,IAAI,SAAS,SAAS,MAAM;AAAA,EAClD;AACF;AAEO,SAAS,iBAAiB,WAAmB,QAA+C;AACjG,SAAO;AAAA,IACL,MAAM,GAAG,WAAW,IAAI,SAAS,SAAS,MAAM;AAAA,EAClD;AACF;AAEO,SAAS,yBACd,WACA,QAC4C;AAC5C,SAAO;AAAA,IACL,MAAM,GAAG,WAAW,IAAI,SAAS,SAAS,MAAM;AAAA,EAClD;AACF;;;ACpBO,IAAM,KAAK;AAAA;AAAA,EAEhB;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AACA,IAAO,cAAQ","sourcesContent":["export const base = 'd3/data';\r\n\r\nexport const profileBase = `d3/profile`;\r\n\r\n//Why is the game data APIs base root the reverse of the regular base?\r\nexport const gameDataBase = `data/d3`;\r\n\r\n/**\r\n * Base interface for Blizzard API responses.\r\n */\r\nexport interface ResponseBase {\r\n _links: {\r\n self: {\r\n href: string;\r\n };\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { base } from '../base';\r\nimport type { ActIndexResponse, ActResponse } from './types';\r\n\r\nexport function act(actId: number): Resource<ActResponse> {\r\n return {\r\n path: `${base}/act/${actId}`,\r\n };\r\n}\r\n\r\nexport function actIndex(): Resource<ActIndexResponse> {\r\n return {\r\n path: `${base}/act`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { base } from '../base';\r\nimport type { ArtisanResponse, RecipeResponse } from './types';\r\n\r\nexport function artisan(artisanSlug: string): Resource<ArtisanResponse> {\r\n return {\r\n path: `${base}/artisan/${artisanSlug}`,\r\n };\r\n}\r\n\r\nexport function recipe(artisanSlug: string, recipeSlug: string): Resource<RecipeResponse> {\r\n return {\r\n path: `${base}/artisan/${artisanSlug}/recipe/${recipeSlug}`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { base } from '../base';\r\nimport type { CharacterClassResponse, SkillResponse } from './types';\r\n\r\nexport function characterClass(characterClassSlug: string): Resource<CharacterClassResponse> {\r\n return {\r\n path: `${base}/character-class/${characterClassSlug}`,\r\n };\r\n}\r\n\r\nexport function skill(characterClassSlug: string, skillSlug: string): Resource<SkillResponse> {\r\n return {\r\n path: `${base}/hero/${characterClassSlug}/skill/${skillSlug}`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { base } from '../base';\r\nimport type { FollowerResponse } from './types';\r\n\r\nexport function follower(followerSlug: string): Resource<FollowerResponse> {\r\n return {\r\n path: `${base}/follower/${followerSlug}`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { gameDataBase } from '../base';\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\nexport function seasonIndex(): Resource<SeasonIndexResponse> {\r\n return {\r\n path: `${gameDataBase}/season`,\r\n };\r\n}\r\n\r\nexport function season(id: number): Resource<SeasonResponse> {\r\n return {\r\n path: `${gameDataBase}/season/${id}`,\r\n };\r\n}\r\n\r\nexport function seasonLeaderboard(id: number, leaderboard: string): Resource<SeasonLeaderboardResponse> {\r\n return {\r\n path: `${gameDataBase}/season/${id}/leaderboard/${leaderboard}`,\r\n };\r\n}\r\n\r\nexport function eraIndex(): Resource<EraIndexResponse> {\r\n return {\r\n path: `${gameDataBase}/era`,\r\n };\r\n}\r\n\r\nexport function era(id: number): Resource<EraResponse> {\r\n return {\r\n path: `${gameDataBase}/era/${id}`,\r\n };\r\n}\r\n\r\nexport function eraLeaderboard(id: number, leaderboard: string): Resource<EraLeaderboardResponse> {\r\n return {\r\n path: `${gameDataBase}/era/${id}/leaderboard/${leaderboard}`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { base } from '../base';\r\nimport type { ItemTypeIndexResponse, ItemTypeResponse } from './types';\r\n\r\nexport function itemTypeIndex(): Resource<Array<ItemTypeIndexResponse>> {\r\n return {\r\n path: `${base}/item-type`,\r\n };\r\n}\r\n\r\nexport function itemType(itemTypeSlug: string): Resource<Array<ItemTypeResponse>> {\r\n return {\r\n path: `${base}/item-type/${itemTypeSlug}`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { base } from '../base';\r\nimport type { ItemResponse } from './types';\r\n\r\nexport function item(itemSlugAndId: string): Resource<ItemResponse> {\r\n return {\r\n path: `${base}/item/${itemSlugAndId}`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { profileBase } from '../base';\r\nimport type { AccountHeroFollowerItemsResponse, AccountHeroResponse, AccountResponse } from './types';\r\n\r\nexport function account(battleTag: string): Resource<AccountResponse> {\r\n return {\r\n path: `${profileBase}/${battleTag}`,\r\n };\r\n}\r\n\r\nexport function accountHero(battleTag: string, heroId: number): Resource<AccountHeroResponse> {\r\n return {\r\n path: `${profileBase}/${battleTag}/hero/${heroId}`,\r\n };\r\n}\r\n\r\nexport function accountHeroItems(battleTag: string, heroId: number): Resource<AccountHeroResponse> {\r\n return {\r\n path: `${profileBase}/${battleTag}/hero/${heroId}/items`,\r\n };\r\n}\r\n\r\nexport function accountHeroFollowerItems(\r\n battleTag: string,\r\n heroId: number,\r\n): Resource<AccountHeroFollowerItemsResponse> {\r\n return {\r\n path: `${profileBase}/${battleTag}/hero/${heroId}/follower-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\nexport const 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\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 Type\r\nexport * from './item-type/item-type';\r\nexport type * from './item-type/types';\r\n//Item\r\nexport * from './item/item';\r\nexport type * from './item/types';\r\n//Profile\r\nexport * from './profile/profile';\r\nexport type * from './profile/types';\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blizzard-api/d3",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Putro",
|
|
6
6
|
"description": "A series of helpers to interact with the Diablo 3 Blizzard API",
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
"engines": {
|
|
10
10
|
"node": "^18.18 || ^20.9 || ^21.1 || ^22"
|
|
11
11
|
},
|
|
12
|
-
"main": "./dist/index.
|
|
12
|
+
"main": "./dist/index.cjs",
|
|
13
|
+
"module": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
13
15
|
"exports": {
|
|
14
16
|
"import": {
|
|
15
17
|
"types": "./dist/index.d.ts",
|
|
@@ -36,10 +38,10 @@
|
|
|
36
38
|
],
|
|
37
39
|
"dependencies": {},
|
|
38
40
|
"peerDependencies": {
|
|
39
|
-
"@blizzard-api/core": "1.1.
|
|
41
|
+
"@blizzard-api/core": "1.1.1"
|
|
40
42
|
},
|
|
41
43
|
"devDependencies": {
|
|
42
|
-
"@blizzard-api/core": "1.1.
|
|
44
|
+
"@blizzard-api/core": "1.1.1"
|
|
43
45
|
},
|
|
44
46
|
"scripts": {
|
|
45
47
|
"build": "tsup",
|