@blizzard-api/hs 1.0.0 → 1.0.1
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 +83 -83
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { Locales, Resource } from '@blizzard-api/core';
|
|
2
2
|
|
|
3
|
+
type GameMode$1 = 'arena' | 'battlegrounds' | 'classic' | 'constructed' | 'duels' | 'mercenaries' | 'standard';
|
|
4
|
+
type SearchSortOption = `${SortOptions}:${SortDirection}`;
|
|
3
5
|
type SortDirection = 'asc' | 'desc';
|
|
4
6
|
type SortOptions = 'attack' | 'class' | 'dataAdded' | 'groupByClass' | 'health' | 'manaCost' | 'name';
|
|
5
|
-
type SearchSortOption = `${SortOptions}:${SortDirection}`;
|
|
6
|
-
type GameMode$1 = 'arena' | 'battlegrounds' | 'classic' | 'constructed' | 'duels' | 'mercenaries' | 'standard';
|
|
7
7
|
|
|
8
|
+
interface CardBackSearchParameters {
|
|
9
|
+
cardBackCategory?: 'achieve' | 'base' | 'blizzard' | 'esports' | 'events' | 'fireside' | 'game_license' | 'golden' | 'heroes' | 'legend' | 'pre_purchase' | 'promotion' | 'season';
|
|
10
|
+
locale?: Locales;
|
|
11
|
+
page?: number;
|
|
12
|
+
pageSize?: number;
|
|
13
|
+
sort?: SearchSortOption;
|
|
14
|
+
textFilter?: string;
|
|
15
|
+
}
|
|
8
16
|
interface CardBackSearchResponse {
|
|
9
17
|
cardBacks: Array<SingleCardBackSearchResponse>;
|
|
10
18
|
cardCount: number;
|
|
@@ -19,26 +27,64 @@ interface SingleCardBackSearchResponse {
|
|
|
19
27
|
sortCategory: number;
|
|
20
28
|
text: Record<Locales, string> | string;
|
|
21
29
|
}
|
|
22
|
-
interface CardBackSearchParameters {
|
|
23
|
-
cardBackCategory?: 'achieve' | 'base' | 'blizzard' | 'esports' | 'events' | 'fireside' | 'game_license' | 'golden' | 'heroes' | 'legend' | 'pre_purchase' | 'promotion' | 'season';
|
|
24
|
-
locale?: Locales;
|
|
25
|
-
page?: number;
|
|
26
|
-
pageSize?: number;
|
|
27
|
-
sort?: SearchSortOption;
|
|
28
|
-
textFilter?: string;
|
|
29
|
-
}
|
|
30
30
|
|
|
31
31
|
declare function cardBackSearch(options: CardBackSearchParameters): Resource<CardBackSearchResponse, CardBackSearchParameters>;
|
|
32
32
|
declare function fetchOneCardBack(id: string, locale?: Locales): Resource<SingleCardBackSearchResponse, {
|
|
33
33
|
locale?: Locales;
|
|
34
34
|
}>;
|
|
35
35
|
|
|
36
|
+
interface BlizzardCardSearchParameters extends BaseSearchParameters {
|
|
37
|
+
attack?: string;
|
|
38
|
+
defaultMercenary?: string;
|
|
39
|
+
health?: string;
|
|
40
|
+
mercenaryId?: string;
|
|
41
|
+
}
|
|
42
|
+
interface CardSearchParameters extends BaseSearchParameters {
|
|
43
|
+
attack?: Array<number> | number;
|
|
44
|
+
defaultMercenary?: Array<number> | number;
|
|
45
|
+
health?: Array<number> | number;
|
|
46
|
+
mercenaryId?: Array<number> | number;
|
|
47
|
+
}
|
|
36
48
|
interface CardSearchResponse {
|
|
37
49
|
cardCount: number;
|
|
38
50
|
cards: Array<Card$1>;
|
|
39
51
|
page: number;
|
|
40
52
|
pageCount: number;
|
|
41
53
|
}
|
|
54
|
+
interface FetchOneCardResponse {
|
|
55
|
+
artistName: string;
|
|
56
|
+
attack: number;
|
|
57
|
+
cardSetId: number;
|
|
58
|
+
cardTypeId: number;
|
|
59
|
+
classId: number;
|
|
60
|
+
collectible: number;
|
|
61
|
+
cropImage: string;
|
|
62
|
+
flavorText: Record<Locales, string> | string;
|
|
63
|
+
health: number;
|
|
64
|
+
id: number;
|
|
65
|
+
image: Record<Locales, string> | string;
|
|
66
|
+
imageGold: Record<Locales, string> | string;
|
|
67
|
+
isZilliaxCosmeticModule: boolean;
|
|
68
|
+
isZilliaxFunctionalModule: boolean;
|
|
69
|
+
keywordIds: Array<number>;
|
|
70
|
+
manaCost: number;
|
|
71
|
+
multiClassIds: Array<number>;
|
|
72
|
+
name: Record<Locales, string> | string;
|
|
73
|
+
rarityId: number;
|
|
74
|
+
slug: string;
|
|
75
|
+
text: Record<Locales, string> | string;
|
|
76
|
+
}
|
|
77
|
+
interface BaseSearchParameters {
|
|
78
|
+
gameMode?: GameMode$1;
|
|
79
|
+
locale?: Locales;
|
|
80
|
+
mercenaryRole?: string;
|
|
81
|
+
minionType?: string;
|
|
82
|
+
page?: number;
|
|
83
|
+
pageSize?: number;
|
|
84
|
+
sort?: 'attack:asc' | 'attack:desc' | 'health:asc' | 'health:desc' | 'name:asc' | 'name:desc' | 'tier:asc' | 'tier:desc';
|
|
85
|
+
textFilter?: string;
|
|
86
|
+
tier?: 1 | 2 | 3 | 4 | 5 | 6 | 'hero';
|
|
87
|
+
}
|
|
42
88
|
interface Card$1 {
|
|
43
89
|
artistName: null | string;
|
|
44
90
|
attack: number;
|
|
@@ -78,52 +124,6 @@ interface StatsByLevel {
|
|
|
78
124
|
attack: number;
|
|
79
125
|
health: number;
|
|
80
126
|
}
|
|
81
|
-
interface CardSearchParameters extends BaseSearchParameters {
|
|
82
|
-
attack?: Array<number> | number;
|
|
83
|
-
defaultMercenary?: Array<number> | number;
|
|
84
|
-
health?: Array<number> | number;
|
|
85
|
-
mercenaryId?: Array<number> | number;
|
|
86
|
-
}
|
|
87
|
-
interface BlizzardCardSearchParameters extends BaseSearchParameters {
|
|
88
|
-
attack?: string;
|
|
89
|
-
defaultMercenary?: string;
|
|
90
|
-
health?: string;
|
|
91
|
-
mercenaryId?: string;
|
|
92
|
-
}
|
|
93
|
-
interface BaseSearchParameters {
|
|
94
|
-
gameMode?: GameMode$1;
|
|
95
|
-
locale?: Locales;
|
|
96
|
-
mercenaryRole?: string;
|
|
97
|
-
minionType?: string;
|
|
98
|
-
page?: number;
|
|
99
|
-
pageSize?: number;
|
|
100
|
-
sort?: 'attack:asc' | 'attack:desc' | 'health:asc' | 'health:desc' | 'name:asc' | 'name:desc' | 'tier:asc' | 'tier:desc';
|
|
101
|
-
textFilter?: string;
|
|
102
|
-
tier?: 'hero' | 1 | 2 | 3 | 4 | 5 | 6;
|
|
103
|
-
}
|
|
104
|
-
interface FetchOneCardResponse {
|
|
105
|
-
artistName: string;
|
|
106
|
-
attack: number;
|
|
107
|
-
cardSetId: number;
|
|
108
|
-
cardTypeId: number;
|
|
109
|
-
classId: number;
|
|
110
|
-
collectible: number;
|
|
111
|
-
cropImage: string;
|
|
112
|
-
flavorText: Record<Locales, string> | string;
|
|
113
|
-
health: number;
|
|
114
|
-
id: number;
|
|
115
|
-
image: Record<Locales, string> | string;
|
|
116
|
-
imageGold: Record<Locales, string> | string;
|
|
117
|
-
isZilliaxCosmeticModule: boolean;
|
|
118
|
-
isZilliaxFunctionalModule: boolean;
|
|
119
|
-
keywordIds: Array<number>;
|
|
120
|
-
manaCost: number;
|
|
121
|
-
multiClassIds: Array<number>;
|
|
122
|
-
name: Record<Locales, string> | string;
|
|
123
|
-
rarityId: number;
|
|
124
|
-
slug: string;
|
|
125
|
-
text: Record<Locales, string> | string;
|
|
126
|
-
}
|
|
127
127
|
|
|
128
128
|
declare function cardSearch(options: CardSearchParameters): Resource<CardSearchResponse, BlizzardCardSearchParameters>;
|
|
129
129
|
declare function fetchOneCard(id: string, options?: {
|
|
@@ -134,12 +134,6 @@ declare function fetchOneCard(id: string, options?: {
|
|
|
134
134
|
locale?: Locales;
|
|
135
135
|
}>;
|
|
136
136
|
|
|
137
|
-
type DeckSearchParameters = {
|
|
138
|
-
code: string;
|
|
139
|
-
} | {
|
|
140
|
-
hero?: string;
|
|
141
|
-
ids: string;
|
|
142
|
-
};
|
|
143
137
|
interface DeckResponse {
|
|
144
138
|
cardCount: number;
|
|
145
139
|
cards: Array<Card>;
|
|
@@ -150,6 +144,12 @@ interface DeckResponse {
|
|
|
150
144
|
heroPower: Hero;
|
|
151
145
|
version: number;
|
|
152
146
|
}
|
|
147
|
+
type DeckSearchParameters = {
|
|
148
|
+
code: string;
|
|
149
|
+
} | {
|
|
150
|
+
hero?: string;
|
|
151
|
+
ids: string;
|
|
152
|
+
};
|
|
153
153
|
interface Card {
|
|
154
154
|
armor?: number;
|
|
155
155
|
artistName: string;
|
|
@@ -239,9 +239,15 @@ interface AllMetadataResponse {
|
|
|
239
239
|
spellSchools: Array<GameMode>;
|
|
240
240
|
types: Array<GameMode>;
|
|
241
241
|
}
|
|
242
|
-
interface
|
|
243
|
-
|
|
242
|
+
interface SpecificMetadataResponse extends NameId {
|
|
243
|
+
aliasSetIds?: Array<number>;
|
|
244
|
+
collectibleCount: number;
|
|
245
|
+
collectibleRevealedCount: number;
|
|
246
|
+
hyped: boolean;
|
|
247
|
+
nonCollectibleCount: number;
|
|
248
|
+
nonCollectibleRevealedCount: number;
|
|
244
249
|
slug: string;
|
|
250
|
+
type: SetType;
|
|
245
251
|
}
|
|
246
252
|
interface Class {
|
|
247
253
|
alternateHeroCardIds?: Array<number>;
|
|
@@ -251,6 +257,10 @@ interface Class {
|
|
|
251
257
|
name: string;
|
|
252
258
|
slug: string;
|
|
253
259
|
}
|
|
260
|
+
interface GameMode extends NameId {
|
|
261
|
+
gameModes?: Array<number>;
|
|
262
|
+
slug: string;
|
|
263
|
+
}
|
|
254
264
|
interface Keyword extends NameId {
|
|
255
265
|
gameModes: Array<number>;
|
|
256
266
|
refText: string;
|
|
@@ -262,17 +272,6 @@ interface Rarity extends NameId {
|
|
|
262
272
|
dustValue: Array<null | number>;
|
|
263
273
|
slug: string;
|
|
264
274
|
}
|
|
265
|
-
interface SetGroup {
|
|
266
|
-
cardSets: Array<string>;
|
|
267
|
-
icon?: string;
|
|
268
|
-
name: string;
|
|
269
|
-
slug: string;
|
|
270
|
-
standard?: boolean;
|
|
271
|
-
svg?: null | string;
|
|
272
|
-
year?: number;
|
|
273
|
-
yearRange?: string;
|
|
274
|
-
}
|
|
275
|
-
type SetType = '' | 'adventure' | 'base' | 'expansion';
|
|
276
275
|
interface Set extends NameId {
|
|
277
276
|
aliasSetIds?: Array<number>;
|
|
278
277
|
collectibleCount: number;
|
|
@@ -283,16 +282,17 @@ interface Set extends NameId {
|
|
|
283
282
|
slug: string;
|
|
284
283
|
type: SetType;
|
|
285
284
|
}
|
|
286
|
-
interface
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
hyped: boolean;
|
|
291
|
-
nonCollectibleCount: number;
|
|
292
|
-
nonCollectibleRevealedCount: number;
|
|
285
|
+
interface SetGroup {
|
|
286
|
+
cardSets: Array<string>;
|
|
287
|
+
icon?: string;
|
|
288
|
+
name: string;
|
|
293
289
|
slug: string;
|
|
294
|
-
|
|
290
|
+
standard?: boolean;
|
|
291
|
+
svg?: null | string;
|
|
292
|
+
year?: number;
|
|
293
|
+
yearRange?: string;
|
|
295
294
|
}
|
|
295
|
+
type SetType = '' | 'adventure' | 'base' | 'expansion';
|
|
296
296
|
|
|
297
297
|
declare function allMetadata(): Resource<AllMetadataResponse>;
|
|
298
298
|
declare function specificMetadata(type: 'classes' | 'keywords' | 'minionTypes' | 'rarities' | 'setGroups' | 'sets' | 'types'): Resource<SpecificMetadataResponse>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blizzard-api/hs",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Putro",
|
|
6
6
|
"description": "A series of helpers to interact with the Hearthstone Blizzard API",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@blizzard-api/core": "2.0.
|
|
35
|
+
"@blizzard-api/core": "2.0.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@blizzard-api/core": "2.0.
|
|
38
|
+
"@blizzard-api/core": "2.0.1"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "tsup",
|