@blizzard-api/d3 1.0.0 → 1.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/dist/index.d.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  import { Resource } from '@blizzard-api/core';
2
2
 
3
+ interface ActIndexResponse {
4
+ acts: Array<Act$1>;
5
+ }
3
6
  interface ActResponse {
4
7
  name: string;
5
8
  number: number;
6
9
  quests: Array<Quest>;
7
10
  slug: string;
8
11
  }
9
- interface ActIndexResponse {
10
- acts: Array<Act$1>;
11
- }
12
12
  interface Act$1 {
13
13
  name: string;
14
14
  number: number;
@@ -21,7 +21,16 @@ interface Quest {
21
21
  slug: string;
22
22
  }
23
23
 
24
+ /**
25
+ * Returns the act information for the specified act ID.
26
+ * @param actId The ID of the act.
27
+ * @returns The act resource. See {@link ActResponse}.
28
+ */
24
29
  declare function act(actId: number): Resource<ActResponse>;
30
+ /**
31
+ * Returns the index of acts.
32
+ * @returns The act index resource. See {@link ActIndexResponse}.
33
+ */
25
34
  declare function actIndex(): Resource<ActIndexResponse>;
26
35
 
27
36
  interface ArtisanResponse {
@@ -30,15 +39,7 @@ interface ArtisanResponse {
30
39
  slug: string;
31
40
  training: Training;
32
41
  }
33
- interface Training {
34
- tiers: Array<Tier>;
35
- }
36
- interface Tier {
37
- taughtRecipes: Array<Recipe>;
38
- tier: number;
39
- trainedRecipes: Array<Recipe>;
40
- }
41
- interface Recipe {
42
+ interface RecipeResponse {
42
43
  cost: number;
43
44
  id: string;
44
45
  itemProduced: Item$1;
@@ -57,7 +58,7 @@ interface Reagent$1 {
57
58
  item: Item$1;
58
59
  quantity: number;
59
60
  }
60
- interface RecipeResponse {
61
+ interface Recipe {
61
62
  cost: number;
62
63
  id: string;
63
64
  itemProduced: Item$1;
@@ -65,8 +66,27 @@ interface RecipeResponse {
65
66
  reagents: Array<Reagent$1>;
66
67
  slug: string;
67
68
  }
69
+ interface Tier {
70
+ taughtRecipes: Array<Recipe>;
71
+ tier: number;
72
+ trainedRecipes: Array<Recipe>;
73
+ }
74
+ interface Training {
75
+ tiers: Array<Tier>;
76
+ }
68
77
 
78
+ /**
79
+ * Returns the artisan information for the specified artisan slug.
80
+ * @param artisanSlug The slug of the artisan.
81
+ * @returns The artisan resource. See {@link ArtisanResponse}.
82
+ */
69
83
  declare function artisan(artisanSlug: string): Resource<ArtisanResponse>;
84
+ /**
85
+ * Returns the recipe information for the specified artisan and recipe slugs.
86
+ * @param artisanSlug The slug of the artisan.
87
+ * @param recipeSlug The slug of the recipe.
88
+ * @returns The recipe resource. See {@link RecipeResponse}.
89
+ */
70
90
  declare function recipe(artisanSlug: string, recipeSlug: string): Resource<RecipeResponse>;
71
91
 
72
92
  interface CharacterClassResponse {
@@ -78,9 +98,17 @@ interface CharacterClassResponse {
78
98
  skills: Record<'active' | 'passive', Array<Skill$2>>;
79
99
  slug: string;
80
100
  }
81
- interface SkillCategory {
101
+ interface SkillResponse {
102
+ runes: Array<Rune$1>;
103
+ skill: Skill$2;
104
+ }
105
+ interface Rune$1 {
106
+ description: string;
107
+ descriptionHtml: string;
108
+ level: number;
82
109
  name: string;
83
110
  slug: string;
111
+ type: string;
84
112
  }
85
113
  interface Skill$2 {
86
114
  description: string;
@@ -92,20 +120,23 @@ interface Skill$2 {
92
120
  slug: string;
93
121
  tooltipUrl: string;
94
122
  }
95
- interface SkillResponse {
96
- runes: Array<Rune$1>;
97
- skill: Skill$2;
98
- }
99
- interface Rune$1 {
100
- description: string;
101
- descriptionHtml: string;
102
- level: number;
123
+ interface SkillCategory {
103
124
  name: string;
104
125
  slug: string;
105
- type: string;
106
126
  }
107
127
 
128
+ /**
129
+ * Returns the character class information for the specified character class slug.
130
+ * @param characterClassSlug The slug of the character class.
131
+ * @returns The character class resource. See {@link CharacterClassResponse}.
132
+ */
108
133
  declare function characterClass(characterClassSlug: string): Resource<CharacterClassResponse>;
134
+ /**
135
+ * Returns the skill information for the specified character class and skill slugs.
136
+ * @param characterClassSlug The slug of the character class.
137
+ * @param skillSlug The slug of the skill.
138
+ * @returns The skill resource. See {@link SkillResponse}.
139
+ */
109
140
  declare function skill(characterClassSlug: string, skillSlug: string): Resource<SkillResponse>;
110
141
 
111
142
  interface FollowerResponse {
@@ -125,6 +156,11 @@ interface Skill$1 {
125
156
  tooltipUrl: string;
126
157
  }
127
158
 
159
+ /**
160
+ * Returns the follower information for the specified follower slug.
161
+ * @param followerSlug The slug of the follower.
162
+ * @returns The follower resource. See {@link FollowerResponse}.
163
+ */
128
164
  declare function follower(followerSlug: string): Resource<FollowerResponse>;
129
165
 
130
166
  /**
@@ -138,6 +174,32 @@ interface ResponseBase {
138
174
  };
139
175
  }
140
176
 
177
+ interface EraIndexResponse extends ResponseBase {
178
+ current_era: number;
179
+ era: Array<{
180
+ href: string;
181
+ }>;
182
+ generated_by: string;
183
+ last_update_time: string;
184
+ }
185
+ interface EraLeaderboardResponse extends ResponseBase {
186
+ column: Array<Column>;
187
+ era: number;
188
+ generated_by: string;
189
+ greater_rift: boolean;
190
+ greater_rift_solo_class: string;
191
+ key: string;
192
+ last_update_time: string;
193
+ row: Array<Row>;
194
+ title: string;
195
+ }
196
+ interface EraResponse extends ResponseBase {
197
+ era_id: number;
198
+ era_start_date: number;
199
+ generated_by: string;
200
+ last_update_time: string;
201
+ leaderboard: Array<EraLeaderboard>;
202
+ }
141
203
  interface SeasonIndexResponse extends ResponseBase {
142
204
  current_season: number;
143
205
  generated_by: string;
@@ -148,20 +210,6 @@ interface SeasonIndexResponse extends ResponseBase {
148
210
  service_current_season: number;
149
211
  service_season_state: string;
150
212
  }
151
- interface SeasonResponse extends ResponseBase {
152
- generated_by: string;
153
- last_update_time: string;
154
- leaderboard: Array<Leaderboard>;
155
- season_id: number;
156
- }
157
- interface Leaderboard {
158
- hardcore?: boolean;
159
- hero_class_string?: string;
160
- ladder: {
161
- href: string;
162
- };
163
- team_size?: number;
164
- }
165
213
  interface SeasonLeaderboardResponse extends ResponseBase {
166
214
  achievement_points: boolean;
167
215
  column: Array<Column>;
@@ -172,6 +220,12 @@ interface SeasonLeaderboardResponse extends ResponseBase {
172
220
  season: number;
173
221
  title: string;
174
222
  }
223
+ interface SeasonResponse extends ResponseBase {
224
+ generated_by: string;
225
+ last_update_time: string;
226
+ leaderboard: Array<Leaderboard>;
227
+ season_id: number;
228
+ }
175
229
  interface Column {
176
230
  hidden: boolean;
177
231
  id: LeaderboardId;
@@ -179,7 +233,26 @@ interface Column {
179
233
  order?: number;
180
234
  type: 'DATETIME' | 'NUMBER' | 'STRING';
181
235
  }
236
+ interface EraLeaderboard {
237
+ hardcore?: boolean;
238
+ hero_class_string?: string;
239
+ ladder: Self;
240
+ team_size: number;
241
+ }
242
+ interface Leaderboard {
243
+ hardcore?: boolean;
244
+ hero_class_string?: string;
245
+ ladder: {
246
+ href: string;
247
+ };
248
+ team_size?: number;
249
+ }
182
250
  type LeaderboardId = 'AchievementPoints' | 'BattleTag' | 'ClanName' | 'CompletedTime' | 'GameAccount' | 'HeroBattleTag' | 'HeroClanTag' | 'HeroClass' | 'HeroGender' | 'HeroId' | 'HeroLevel' | 'HeroVisualItems' | 'ParagonLevel' | 'Rank' | 'RiftLevel' | 'RiftTime';
251
+ interface Player {
252
+ accountId: number;
253
+ data: Array<RowData>;
254
+ key: string;
255
+ }
183
256
  interface Row {
184
257
  data: Array<RowData>;
185
258
  order: number;
@@ -191,54 +264,77 @@ interface RowData {
191
264
  string?: string;
192
265
  timestamp?: number;
193
266
  }
194
- interface Player {
195
- accountId: number;
196
- data: Array<RowData>;
197
- key: string;
198
- }
199
- interface EraIndexResponse extends ResponseBase {
200
- current_era: number;
201
- era: Array<{
202
- href: string;
203
- }>;
204
- generated_by: string;
205
- last_update_time: string;
206
- }
207
- interface EraResponse extends ResponseBase {
208
- era_id: number;
209
- era_start_date: number;
210
- generated_by: string;
211
- last_update_time: string;
212
- leaderboard: Array<EraLeaderboard>;
213
- }
214
267
  interface Self {
215
268
  href: string;
216
269
  }
217
- interface EraLeaderboard {
218
- hardcore?: boolean;
219
- hero_class_string?: string;
220
- ladder: Self;
221
- team_size: number;
222
- }
223
- interface EraLeaderboardResponse extends ResponseBase {
224
- column: Array<Column>;
225
- era: number;
226
- generated_by: string;
227
- greater_rift: boolean;
228
- greater_rift_solo_class: string;
229
- key: string;
230
- last_update_time: string;
231
- row: Array<Row>;
232
- title: string;
233
- }
234
270
 
235
- declare function seasonIndex(): Resource<SeasonIndexResponse>;
236
- declare function season(id: number): Resource<SeasonResponse>;
237
- declare function seasonLeaderboard(id: number, leaderboard: string): Resource<SeasonLeaderboardResponse>;
238
- declare function eraIndex(): Resource<EraIndexResponse>;
271
+ /**
272
+ * Returns the era information for the specified era ID.
273
+ * @param id The ID of the era.
274
+ * @returns The era resource. See {@link EraResponse}.
275
+ */
239
276
  declare function era(id: number): Resource<EraResponse>;
277
+ /**
278
+ * Returns the era index.
279
+ * @returns The era index resource. See {@link EraIndexResponse}.
280
+ */
281
+ declare function eraIndex(): Resource<EraIndexResponse>;
282
+ /**
283
+ * Returns the era leaderboard for the specified era ID and leaderboard.
284
+ * @param id The ID of the era.
285
+ * @param leaderboard The name of the leaderboard.
286
+ * @returns The era leaderboard resource. See {@link EraLeaderboardResponse}.
287
+ */
240
288
  declare function eraLeaderboard(id: number, leaderboard: string): Resource<EraLeaderboardResponse>;
289
+ /**
290
+ * Returns the season information for the specified season ID.
291
+ * @param id The ID of the season.
292
+ * @returns The season resource. See {@link SeasonResponse}.
293
+ */
294
+ declare function season(id: number): Resource<SeasonResponse>;
295
+ /**
296
+ * Returns the season index.
297
+ * @returns The season index resource. See {@link SeasonIndexResponse}.
298
+ */
299
+ declare function seasonIndex(): Resource<SeasonIndexResponse>;
300
+ /**
301
+ * Returns the season leaderboard for the specified season ID and leaderboard.
302
+ * @param id The ID of the season.
303
+ * @param leaderboard The name of the leaderboard.
304
+ * @returns The season leaderboard resource. See {@link SeasonLeaderboardResponse}.
305
+ */
306
+ declare function seasonLeaderboard(id: number, leaderboard: string): Resource<SeasonLeaderboardResponse>;
307
+
308
+ interface ItemTypeIndexResponse {
309
+ id: string;
310
+ name: string;
311
+ path: string;
312
+ }
313
+ interface ItemTypeResponse {
314
+ icon: string;
315
+ id: string;
316
+ name: string;
317
+ path: string;
318
+ slug: string;
319
+ }
320
+
321
+ /**
322
+ * Returns the item type information for the specified item type slug.
323
+ * @param itemTypeSlug The slug of the item type, example: "sword2h"
324
+ * @returns The item type resource. See {@link ItemTypeResponse}.
325
+ */
326
+ declare function itemType(itemTypeSlug: string): Resource<Array<ItemTypeResponse>>;
327
+ /**
328
+ * Returns the item type index.
329
+ * @returns The item type index resource. See {@link ItemTypeIndexResponse}.
330
+ */
331
+ declare function itemTypeIndex(): Resource<Array<ItemTypeIndexResponse>>;
241
332
 
333
+ interface Attributes$1 {
334
+ other: Array<unknown>;
335
+ primary: Array<Primary>;
336
+ secondary: Array<Primary>;
337
+ }
242
338
  interface ItemResponse {
243
339
  accountBound: boolean;
244
340
  attributes: Attributes$1;
@@ -263,11 +359,6 @@ interface ItemResponse {
263
359
  type: Type;
264
360
  typeName: string;
265
361
  }
266
- interface Attributes$1 {
267
- other: Array<unknown>;
268
- primary: Array<Primary>;
269
- secondary: Array<Primary>;
270
- }
271
362
  interface Primary {
272
363
  text: string;
273
364
  textHtml: string;
@@ -280,25 +371,70 @@ interface Type {
280
371
  twoHanded: boolean;
281
372
  }
282
373
 
374
+ /**
375
+ * Returns the item information for the specified item slug and ID.
376
+ * @param itemSlugAndId The slug and ID of the item, example: "corrupted-ashbringer-Unique_Sword_2H_104_x1".
377
+ * @returns The item resource. See {@link ItemResponse}.
378
+ */
283
379
  declare function item(itemSlugAndId: string): Resource<ItemResponse>;
284
380
 
285
- interface ItemTypeIndexResponse {
286
- id: string;
287
- name: string;
288
- path: string;
381
+ interface AccountHeroFollowerItemsResponse {
382
+ enchantress: Record<string, FollowerItem>;
383
+ scoundrel: Record<string, FollowerItem>;
384
+ templar: Record<string, FollowerItem>;
289
385
  }
290
- interface ItemTypeResponse {
386
+ interface AccountHeroItemsResponse {
387
+ accountBound: boolean;
388
+ armor: number;
389
+ attacksPerSecond: number;
390
+ attributes: Attributes;
391
+ attributesHtml: Attributes;
392
+ craftedBy?: CraftedBy;
393
+ damage?: string;
394
+ displayColor: DisplayColor;
395
+ dps?: string;
396
+ elementalType?: string;
397
+ flavorText: string;
398
+ gems?: Array<Gem>;
291
399
  icon: string;
292
400
  id: string;
401
+ isSeasonRequiredToDrop: boolean;
402
+ itemLevel: number;
403
+ maxDamage: number;
404
+ minDamage: number;
293
405
  name: string;
294
- path: string;
295
- slug: string;
406
+ openSockets: number;
407
+ requiredLevel: number;
408
+ seasonRequiredToDrop: number;
409
+ set?: Set;
410
+ slots: string;
411
+ stackSizeMax: number;
412
+ tooltipParams: string;
413
+ type: Record<string, boolean | string>;
414
+ typeName: string;
296
415
  }
297
-
298
- declare function itemTypeIndex(): Resource<Array<ItemTypeIndexResponse>>;
299
- declare function itemType(itemTypeSlug: string): Resource<Array<ItemTypeResponse>>;
300
-
301
- interface AccountResponse {
416
+ interface AccountHeroResponse {
417
+ alive: boolean;
418
+ class: string;
419
+ followers: Followers;
420
+ gender: number;
421
+ hardcore: boolean;
422
+ highestSoloRiftCompleted: number;
423
+ id: number;
424
+ items: Record<string, Item>;
425
+ kills: Kills;
426
+ lastUpdated: number;
427
+ legendaryPowers: Array<Item>;
428
+ level: number;
429
+ name: string;
430
+ paragonLevel: number;
431
+ progression: HeroProgression;
432
+ seasonal: boolean;
433
+ seasonCreated: number;
434
+ skills: Skills;
435
+ stats: Record<string, number>;
436
+ }
437
+ interface AccountResponse {
302
438
  battleTag: string;
303
439
  blacksmith: Artisan;
304
440
  blacksmithHardcore: Artisan;
@@ -326,191 +462,76 @@ interface AccountResponse {
326
462
  seasonalProfiles: Record<`season${number}`, Season>;
327
463
  timePlayed: TimePlayed;
328
464
  }
329
- interface Artisan {
330
- level: number;
331
- slug: 'blacksmith' | 'jeweler' | 'mystic';
332
- }
333
- interface Hero {
334
- class: string;
335
- classSlug: string;
336
- dead: boolean;
337
- gender: number;
338
- hardcore: boolean;
339
- id: number;
340
- kills: HeroKills;
341
- 'last-updated': number;
342
- level: number;
465
+ interface AccountHeroItem {
466
+ icon: string;
467
+ id: string;
343
468
  name: string;
344
- paragonLevel: number;
345
- seasonal: boolean;
346
- }
347
- interface HeroKills {
348
- elites: number;
469
+ path: string;
470
+ slug: string;
349
471
  }
350
472
  interface AccountResponseKills {
351
473
  elites: number;
352
474
  hardcoreMonsters: number;
353
475
  monsters: number;
354
476
  }
355
- interface Progression {
356
- act1: boolean;
357
- act2: boolean;
358
- act3: boolean;
359
- act4: boolean;
360
- act5: boolean;
361
- }
362
- interface Season {
363
- highestHardcoreLevel: number;
364
- kills: AccountResponseKills;
365
- paragonLevel: number;
366
- paragonLevelHardcore: number;
367
- seasonId: number;
368
- timePlayed: TimePlayed;
477
+ interface Act {
478
+ completed: boolean;
479
+ completedQuests: Array<CompletedQuest>;
369
480
  }
370
- interface TimePlayed {
371
- barbarian: number;
372
- crusader: number;
373
- 'demon-hunter': number;
374
- monk: number;
375
- necromancer: number;
376
- 'witch-doctor': number;
377
- wizard: number;
481
+ interface Active {
482
+ rune: Rune;
483
+ skill: Skill;
378
484
  }
379
- interface AccountHeroResponse {
380
- alive: boolean;
381
- class: string;
382
- followers: Followers;
383
- gender: number;
384
- hardcore: boolean;
385
- highestSoloRiftCompleted: number;
386
- id: number;
387
- items: Record<string, Item>;
388
- kills: Kills;
389
- lastUpdated: number;
390
- legendaryPowers: Array<Item>;
485
+ interface Artisan {
391
486
  level: number;
392
- name: string;
393
- paragonLevel: number;
394
- progression: HeroProgression;
395
- seasonal: boolean;
396
- seasonCreated: number;
397
- skills: Skills;
398
- stats: Record<string, number>;
487
+ slug: 'blacksmith' | 'jeweler' | 'mystic';
399
488
  }
400
- interface Followers {
401
- enchantress: Enchantress;
402
- scoundrel: Scoundrel;
403
- templar: Templar;
489
+ interface Attributes {
490
+ primary: Array<string>;
491
+ secondary?: Array<string>;
404
492
  }
405
- interface Enchantress {
406
- items: EnchantressItems;
407
- level: number;
408
- skills: Array<unknown>;
493
+ interface CompletedQuest {
494
+ name: string;
409
495
  slug: string;
410
- stats: Stats;
411
496
  }
412
- interface EnchantressItems {
413
- mainHand: Item;
414
- }
415
- interface Item {
416
- displayColor?: DisplayColor;
417
- dyeColor?: Item;
418
- icon: string;
497
+ interface CraftedBy {
498
+ cost: number;
419
499
  id: string;
500
+ itemProduced: ItemProduced;
420
501
  name: string;
421
- tooltipParams: string;
422
- }
423
- interface Stats {
424
- experienceBonus: number;
425
- goldFind: number;
426
- magicFind: number;
427
- }
428
- interface Scoundrel {
429
- items: Record<string, Item>;
430
- level: number;
431
- skills: Array<Skill>;
502
+ reagents: Array<Reagent>;
432
503
  slug: string;
433
- stats: Stats;
434
504
  }
435
- interface Skill {
436
- description: string;
437
- descriptionHtml: string;
438
- flavorText?: string;
505
+ type DisplayColor = 'blue' | 'green' | 'orange' | 'white' | 'yellow';
506
+ interface Dye {
439
507
  icon: string;
440
- level: number;
508
+ id: string;
441
509
  name: string;
442
- slug: string;
443
- tooltipUrl: string;
510
+ tooltipParams: string;
444
511
  }
445
- interface Templar {
446
- items: TemplarItems;
512
+ interface Enchantress {
513
+ items: EnchantressItems;
447
514
  level: number;
448
- skills: Array<Skill>;
515
+ skills: Array<unknown>;
449
516
  slug: string;
450
517
  stats: Stats;
451
518
  }
452
- interface TemplarItems {
453
- bracers: Item;
454
- feet: Item;
455
- hands: Item;
456
- head: Item;
519
+ interface EnchantressItems {
457
520
  mainHand: Item;
458
- offHand: Item;
459
- shoulders: Item;
460
- torso: Item;
461
- waist: Item;
462
- }
463
- interface Kills {
464
- elites: number;
465
- }
466
- interface HeroProgression {
467
- act1: Act;
468
- act2: Act;
469
- act3: Act;
470
- act4: Act;
471
- act5: Act;
472
- }
473
- interface Act {
474
- completed: boolean;
475
- completedQuests: Array<CompletedQuest>;
476
- }
477
- interface CompletedQuest {
478
- name: string;
479
- slug: string;
480
- }
481
- interface Skills {
482
- active: Array<Active>;
483
- passive: Array<Passive>;
484
- }
485
- interface Active {
486
- rune: Rune;
487
- skill: Skill;
488
- }
489
- interface Rune {
490
- description: string;
491
- descriptionHtml: string;
492
- level: number;
493
- name: string;
494
- slug: string;
495
- type: string;
496
- }
497
- interface Passive {
498
- skill: Skill;
499
521
  }
500
- type DisplayColor = 'blue' | 'green' | 'orange' | 'white' | 'yellow';
501
- interface AccountHeroItemsResponse {
522
+ interface FollowerItem {
502
523
  accountBound: boolean;
503
524
  armor: number;
504
525
  attacksPerSecond: number;
505
- attributes: Attributes;
506
- attributesHtml: Attributes;
526
+ attributes?: Attributes;
527
+ attributesHtml?: Attributes;
528
+ blockChance?: string;
507
529
  craftedBy?: CraftedBy;
508
530
  damage?: string;
509
- displayColor: DisplayColor;
531
+ displayColor: string;
510
532
  dps?: string;
511
- elementalType?: string;
512
- flavorText: string;
513
- gems?: Array<Gem>;
533
+ dye?: Dye;
534
+ flavorText?: string;
514
535
  icon: string;
515
536
  id: string;
516
537
  isSeasonRequiredToDrop: boolean;
@@ -528,40 +549,94 @@ interface AccountHeroItemsResponse {
528
549
  type: Record<string, boolean | string>;
529
550
  typeName: string;
530
551
  }
531
- interface Attributes {
532
- primary: Array<string>;
533
- secondary?: Array<string>;
552
+ interface Followers {
553
+ enchantress: Enchantress;
554
+ scoundrel: Scoundrel;
555
+ templar: Templar;
534
556
  }
535
- interface CraftedBy {
536
- cost: number;
557
+ interface Gem {
558
+ attributes: Array<string>;
559
+ isGem: boolean;
560
+ isJewel: boolean;
561
+ item: AccountHeroItem;
562
+ jewelRank?: number;
563
+ jewelSecondaryUnlockRank?: number;
564
+ }
565
+ interface Hero {
566
+ class: string;
567
+ classSlug: string;
568
+ dead: boolean;
569
+ gender: number;
570
+ hardcore: boolean;
571
+ id: number;
572
+ kills: HeroKills;
573
+ 'last-updated': number;
574
+ level: number;
575
+ name: string;
576
+ paragonLevel: number;
577
+ seasonal: boolean;
578
+ }
579
+ interface HeroKills {
580
+ elites: number;
581
+ }
582
+ interface HeroProgression {
583
+ act1: Act;
584
+ act2: Act;
585
+ act3: Act;
586
+ act4: Act;
587
+ act5: Act;
588
+ }
589
+ interface Item {
590
+ displayColor?: DisplayColor;
591
+ dyeColor?: Item;
592
+ icon: string;
537
593
  id: string;
538
- itemProduced: ItemProduced;
539
594
  name: string;
540
- reagents: Array<Reagent>;
541
- slug: string;
595
+ tooltipParams: string;
542
596
  }
543
597
  interface ItemProduced {
544
598
  id: string;
545
599
  path: string;
546
600
  }
601
+ interface Kills {
602
+ elites: number;
603
+ }
604
+ interface Passive {
605
+ skill: Skill;
606
+ }
607
+ interface Progression {
608
+ act1: boolean;
609
+ act2: boolean;
610
+ act3: boolean;
611
+ act4: boolean;
612
+ act5: boolean;
613
+ }
547
614
  interface Reagent {
548
615
  item: AccountHeroItem;
549
616
  quantity: number;
550
617
  }
551
- interface AccountHeroItem {
552
- icon: string;
553
- id: string;
618
+ interface Rune {
619
+ description: string;
620
+ descriptionHtml: string;
621
+ level: number;
554
622
  name: string;
555
- path: string;
556
623
  slug: string;
624
+ type: string;
557
625
  }
558
- interface Gem {
559
- attributes: Array<string>;
560
- isGem: boolean;
561
- isJewel: boolean;
562
- item: AccountHeroItem;
563
- jewelRank?: number;
564
- jewelSecondaryUnlockRank?: number;
626
+ interface Scoundrel {
627
+ items: Record<string, Item>;
628
+ level: number;
629
+ skills: Array<Skill>;
630
+ slug: string;
631
+ stats: Stats;
632
+ }
633
+ interface Season {
634
+ highestHardcoreLevel: number;
635
+ kills: AccountResponseKills;
636
+ paragonLevel: number;
637
+ paragonLevelHardcore: number;
638
+ seasonId: number;
639
+ timePlayed: TimePlayed;
565
640
  }
566
641
  interface Set {
567
642
  description: string;
@@ -569,52 +644,80 @@ interface Set {
569
644
  name: string;
570
645
  slug: string;
571
646
  }
572
- interface AccountHeroFollowerItemsResponse {
573
- enchantress: Record<string, FollowerItem>;
574
- scoundrel: Record<string, FollowerItem>;
575
- templar: Record<string, FollowerItem>;
576
- }
577
- interface FollowerItem {
578
- accountBound: boolean;
579
- armor: number;
580
- attacksPerSecond: number;
581
- attributes?: Attributes;
582
- attributesHtml?: Attributes;
583
- blockChance?: string;
584
- craftedBy?: CraftedBy;
585
- damage?: string;
586
- displayColor: string;
587
- dps?: string;
588
- dye?: Dye;
647
+ interface Skill {
648
+ description: string;
649
+ descriptionHtml: string;
589
650
  flavorText?: string;
590
651
  icon: string;
591
- id: string;
592
- isSeasonRequiredToDrop: boolean;
593
- itemLevel: number;
594
- maxDamage: number;
595
- minDamage: number;
652
+ level: number;
596
653
  name: string;
597
- openSockets: number;
598
- requiredLevel: number;
599
- seasonRequiredToDrop: number;
600
- set?: Set;
601
- slots: string;
602
- stackSizeMax: number;
603
- tooltipParams: string;
604
- type: Record<string, boolean | string>;
605
- typeName: string;
654
+ slug: string;
655
+ tooltipUrl: string;
606
656
  }
607
- interface Dye {
608
- icon: string;
609
- id: string;
610
- name: string;
611
- tooltipParams: string;
657
+ interface Skills {
658
+ active: Array<Active>;
659
+ passive: Array<Passive>;
660
+ }
661
+ interface Stats {
662
+ experienceBonus: number;
663
+ goldFind: number;
664
+ magicFind: number;
665
+ }
666
+ interface Templar {
667
+ items: TemplarItems;
668
+ level: number;
669
+ skills: Array<Skill>;
670
+ slug: string;
671
+ stats: Stats;
672
+ }
673
+ interface TemplarItems {
674
+ bracers: Item;
675
+ feet: Item;
676
+ hands: Item;
677
+ head: Item;
678
+ mainHand: Item;
679
+ offHand: Item;
680
+ shoulders: Item;
681
+ torso: Item;
682
+ waist: Item;
683
+ }
684
+ interface TimePlayed {
685
+ barbarian: number;
686
+ crusader: number;
687
+ 'demon-hunter': number;
688
+ monk: number;
689
+ necromancer: number;
690
+ 'witch-doctor': number;
691
+ wizard: number;
612
692
  }
613
693
 
694
+ /**
695
+ * Returns the account information for the specified battle tag.
696
+ * @param battleTag The battle tag of the account.
697
+ * @returns The account resource. See {@link AccountResponse}.
698
+ */
614
699
  declare function account(battleTag: string): Resource<AccountResponse>;
700
+ /**
701
+ * Returns the hero information for the specified battle tag and hero ID.
702
+ * @param battleTag The battle tag of the account.
703
+ * @param heroId The ID of the hero.
704
+ * @returns The hero resource. See {@link AccountHeroResponse}.
705
+ */
615
706
  declare function accountHero(battleTag: string, heroId: number): Resource<AccountHeroResponse>;
616
- declare function accountHeroItems(battleTag: string, heroId: number): Resource<AccountHeroResponse>;
707
+ /**
708
+ * Returns the follower items for the specified battle tag and hero ID.
709
+ * @param battleTag The battle tag of the account.
710
+ * @param heroId The ID of the hero.
711
+ * @returns The follower items resource. See {@link AccountHeroFollowerItemsResponse}.
712
+ */
617
713
  declare function accountHeroFollowerItems(battleTag: string, heroId: number): Resource<AccountHeroFollowerItemsResponse>;
714
+ /**
715
+ * Returns the items for the specified battle tag and hero ID.
716
+ * @param battleTag The battle tag of the account.
717
+ * @param heroId The ID of the hero.
718
+ * @returns The hero items resource. See {@link AccountHeroResponse}.
719
+ */
720
+ declare function accountHeroItems(battleTag: string, heroId: number): Resource<AccountHeroResponse>;
618
721
 
619
722
  declare const d3: {
620
723
  act: typeof act;
package/dist/index.js CHANGED
@@ -47,53 +47,53 @@ function follower(followerSlug) {
47
47
  }
48
48
 
49
49
  // src/game-data/game-data.ts
50
- function seasonIndex() {
50
+ function era(id) {
51
51
  return {
52
- path: `${gameDataBase}/season`
52
+ path: `${gameDataBase}/era/${id}`
53
53
  };
54
54
  }
55
- function season(id) {
55
+ function eraIndex() {
56
56
  return {
57
- path: `${gameDataBase}/season/${id}`
57
+ path: `${gameDataBase}/era`
58
58
  };
59
59
  }
60
- function seasonLeaderboard(id, leaderboard) {
60
+ function eraLeaderboard(id, leaderboard) {
61
61
  return {
62
- path: `${gameDataBase}/season/${id}/leaderboard/${leaderboard}`
62
+ path: `${gameDataBase}/era/${id}/leaderboard/${leaderboard}`
63
63
  };
64
64
  }
65
- function eraIndex() {
65
+ function season(id) {
66
66
  return {
67
- path: `${gameDataBase}/era`
67
+ path: `${gameDataBase}/season/${id}`
68
68
  };
69
69
  }
70
- function era(id) {
70
+ function seasonIndex() {
71
71
  return {
72
- path: `${gameDataBase}/era/${id}`
72
+ path: `${gameDataBase}/season`
73
73
  };
74
74
  }
75
- function eraLeaderboard(id, leaderboard) {
75
+ function seasonLeaderboard(id, leaderboard) {
76
76
  return {
77
- path: `${gameDataBase}/era/${id}/leaderboard/${leaderboard}`
77
+ path: `${gameDataBase}/season/${id}/leaderboard/${leaderboard}`
78
78
  };
79
79
  }
80
80
 
81
- // src/item/item.ts
82
- function item(itemSlugAndId) {
81
+ // src/item-type/item-type.ts
82
+ function itemType(itemTypeSlug) {
83
83
  return {
84
- path: `${base}/item/${itemSlugAndId}`
84
+ path: `${base}/item-type/${itemTypeSlug}`
85
85
  };
86
86
  }
87
-
88
- // src/item-type/item-type.ts
89
87
  function itemTypeIndex() {
90
88
  return {
91
89
  path: `${base}/item-type`
92
90
  };
93
91
  }
94
- function itemType(itemTypeSlug) {
92
+
93
+ // src/item/item.ts
94
+ function item(itemSlugAndId) {
95
95
  return {
96
- path: `${base}/item-type/${itemTypeSlug}`
96
+ path: `${base}/item/${itemSlugAndId}`
97
97
  };
98
98
  }
99
99
 
@@ -108,14 +108,14 @@ function accountHero(battleTag, heroId) {
108
108
  path: `${profileBase}/${battleTag}/hero/${heroId}`
109
109
  };
110
110
  }
111
- function accountHeroItems(battleTag, heroId) {
111
+ function accountHeroFollowerItems(battleTag, heroId) {
112
112
  return {
113
- path: `${profileBase}/${battleTag}/hero/${heroId}/items`
113
+ path: `${profileBase}/${battleTag}/hero/${heroId}/follower-items`
114
114
  };
115
115
  }
116
- function accountHeroFollowerItems(battleTag, heroId) {
116
+ function accountHeroItems(battleTag, heroId) {
117
117
  return {
118
- path: `${profileBase}/${battleTag}/hero/${heroId}/follower-items`
118
+ path: `${profileBase}/${battleTag}/hero/${heroId}/items`
119
119
  };
120
120
  }
121
121
 
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-type/item-type.ts","../src/profile/profile.ts","../src/index.ts"],"names":[],"mappings":";AAAO,IAAM,IAAO,GAAA,SAAA,CAAA;AAEb,IAAM,WAAc,GAAA,CAAA,UAAA,CAAA,CAAA;AAGpB,IAAM,YAAe,GAAA,CAAA,OAAA,CAAA,CAAA;;;ACDrB,SAAS,IAAI,KAAsC,EAAA;AACxD,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,CAAA,EAAG,IAAI,CAAA,KAAA,EAAQ,KAAK,CAAA,CAAA;AAAA,GAC5B,CAAA;AACF,CAAA;AAEO,SAAS,QAAuC,GAAA;AACrD,EAAO,OAAA;AAAA,IACL,IAAA,EAAM,GAAG,IAAI,CAAA,IAAA,CAAA;AAAA,GACf,CAAA;AACF,CAAA;;;ACVO,SAAS,QAAQ,WAAgD,EAAA;AACtE,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,CAAA,EAAG,IAAI,CAAA,SAAA,EAAY,WAAW,CAAA,CAAA;AAAA,GACtC,CAAA;AACF,CAAA;AAEO,SAAS,MAAA,CAAO,aAAqB,UAA8C,EAAA;AACxF,EAAO,OAAA;AAAA,IACL,MAAM,CAAG,EAAA,IAAI,CAAY,SAAA,EAAA,WAAW,WAAW,UAAU,CAAA,CAAA;AAAA,GAC3D,CAAA;AACF,CAAA;;;ACVO,SAAS,eAAe,kBAA8D,EAAA;AAC3F,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,CAAA,EAAG,IAAI,CAAA,iBAAA,EAAoB,kBAAkB,CAAA,CAAA;AAAA,GACrD,CAAA;AACF,CAAA;AAEO,SAAS,KAAA,CAAM,oBAA4B,SAA4C,EAAA;AAC5F,EAAO,OAAA;AAAA,IACL,MAAM,CAAG,EAAA,IAAI,CAAS,MAAA,EAAA,k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,EAEA,QAAA;AAAA,EACA,aAAA;AAAA;AAAA,EAEA,IAAA;AAAA;AAAA,EAEA,OAAA;AAAA,EACA,WAAA;AAAA,EACA,wBAAA;AAAA,EACA,gBAAA;AAAA;AAAA,EAEA,GAAA;AAAA,EACA,QAAA;AAAA,EACA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,WAAA;AAAA,EACA,iBAAA;AACF","file":"index.js","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 { 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 { 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 { 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 { item } from './item/item';\r\nimport { itemType, itemTypeIndex } from './item-type/item-type';\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 { d3 as 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\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"]}
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,IAAO,GAAA,SAAA,CAAA;AAEb,IAAM,WAAc,GAAA,CAAA,UAAA,CAAA,CAAA;AAGpB,IAAM,YAAe,GAAA,CAAA,OAAA,CAAA,CAAA;;;ACIrB,SAAS,IAAI,KAAsC,EAAA;AACxD,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,CAAA,EAAG,IAAI,CAAA,KAAA,EAAQ,KAAK,CAAA,CAAA;AAAA,GAC5B,CAAA;AACF,CAAA;AAMO,SAAS,QAAuC,GAAA;AACrD,EAAO,OAAA;AAAA,IACL,IAAA,EAAM,GAAG,IAAI,CAAA,IAAA,CAAA;AAAA,GACf,CAAA;AACF,CAAA;;;AC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,EAAA,SAAS,SAAS,MAAM,CAAA,CAAA;AAAA,GAClD,CAAA;AACF,CAAA;AAQO,SAAS,wBAAA,CACd,WACA,MAC4C,EAAA;AAC5C,EAAO,OAAA;AAAA,IACL,MAAM,CAAG,EAAA,WAAW,CAAI,CAAA,EAAA,SAAS,SAAS,MAAM,CAAA,eAAA,CAAA;AAAA,GAClD,CAAA;AACF,CAAA;AAQO,SAAS,gBAAA,CAAiB,WAAmB,MAA+C,EAAA;AACjG,EAAO,OAAA;AAAA,IACL,MAAM,CAAG,EAAA,WAAW,CAAI,CAAA,EAAA,SAAS,SAAS,MAAM,CAAA,MAAA,CAAA;AAAA,GAClD,CAAA;AACF,CAAA;;;AC3CA,IAAM,EAAK,GAAA;AAAA;AAAA,EAET,GAAA;AAAA,EACA,QAAA;AAAA;AAAA,EAEA,OAAA;AAAA,EACA,MAAA;AAAA;AAAA,EAEA,QAAA;AAAA;AAAA,EAEA,cAAA;AAAA,EACA,KAAA;AAAA;AAAA,EAEA,QAAA;AAAA,EACA,aAAA;AAAA;AAAA,EAEA,IAAA;AAAA;AAAA,EAEA,OAAA;AAAA,EACA,WAAA;AAAA,EACA,wBAAA;AAAA,EACA,gBAAA;AAAA;AAAA,EAEA,GAAA;AAAA,EACA,QAAA;AAAA,EACA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,WAAA;AAAA,EACA,iBAAA;AACF","file":"index.js","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\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: `${base}/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: `${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\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: `${base}/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: `${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\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: `${base}/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: `${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\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: `${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\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: `${gameDataBase}/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: `${gameDataBase}/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: `${gameDataBase}/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: `${gameDataBase}/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: `${gameDataBase}/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: `${gameDataBase}/season/${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\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: `${base}/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: `${base}/item-type`,\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\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: `${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\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: `${profileBase}/${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: `${profileBase}/${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: `${profileBase}/${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: `${profileBase}/${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 { d3, d3 as default };\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blizzard-api/d3",
3
- "version": "1.0.0",
3
+ "version": "1.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": "2.0.0"
37
+ "@blizzard-api/core": "2.0.2"
38
38
  },
39
39
  "devDependencies": {
40
- "@blizzard-api/core": "2.0.0"
40
+ "@blizzard-api/core": "2.0.2"
41
41
  },
42
42
  "scripts": {
43
43
  "build": "tsup",