@pinta365/blizzard_api 0.3.6 → 0.3.9
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 +1 -0
- package/esm/mod.d.ts +4 -2
- package/esm/mod.js +4 -2
- package/package.json +1 -1
- package/script/mod.d.ts +4 -2
- package/script/mod.js +8 -1
- package/esm/src/hearthstone/game_data/card_backs.d.ts +0 -22
- package/esm/src/hearthstone/game_data/card_backs.js +0 -23
- package/esm/src/hearthstone/game_data/cards.d.ts +0 -37
- package/esm/src/hearthstone/game_data/cards.js +0 -27
- package/esm/src/hearthstone/game_data/decks.d.ts +0 -88
- package/esm/src/hearthstone/game_data/decks.js +0 -14
- package/esm/src/hearthstone/game_data/metadata.d.ts +0 -95
- package/esm/src/hearthstone/game_data/metadata.js +0 -12
- package/esm/src/hearthstone/index.d.ts +0 -4
- package/esm/src/hearthstone/index.js +0 -4
- package/esm/src/hearthstone/search.d.ts +0 -20
- package/esm/src/hearthstone/search.js +0 -29
- package/esm/src/shared/auth.d.ts +0 -24
- package/esm/src/shared/auth.js +0 -58
- package/esm/src/shared/config.d.ts +0 -40
- package/esm/src/shared/config.js +0 -48
- package/esm/src/shared/errors.d.ts +0 -44
- package/esm/src/shared/errors.js +0 -83
- package/esm/src/shared/index.d.ts +0 -4
- package/esm/src/shared/index.js +0 -3
- package/esm/src/shared/request.d.ts +0 -13
- package/esm/src/shared/request.js +0 -43
- package/esm/src/shared/types.d.ts +0 -120
- package/esm/src/shared/types.js +0 -2
- package/esm/src/starcraft2/game_data/league.d.ts +0 -32
- package/esm/src/starcraft2/game_data/league.js +0 -21
- package/esm/src/starcraft2/index.d.ts +0 -1
- package/esm/src/starcraft2/index.js +0 -1
- package/esm/src/wow/game_data/achievement.d.ts +0 -84
- package/esm/src/wow/game_data/achievement.js +0 -69
- package/esm/src/wow/game_data/auction_house.d.ts +0 -64
- package/esm/src/wow/game_data/auction_house.js +0 -34
- package/esm/src/wow/game_data/azerite_essence.d.ts +0 -49
- package/esm/src/wow/game_data/azerite_essence.js +0 -49
- package/esm/src/wow/game_data/connected_realm.d.ts +0 -54
- package/esm/src/wow/game_data/connected_realm.js +0 -36
- package/esm/src/wow/game_data/covenant.d.ts +0 -108
- package/esm/src/wow/game_data/covenant.js +0 -89
- package/esm/src/wow/game_data/creature.d.ts +0 -97
- package/esm/src/wow/game_data/creature.js +0 -100
- package/esm/src/wow/game_data/guild_crest.d.ts +0 -55
- package/esm/src/wow/game_data/guild_crest.js +0 -39
- package/esm/src/wow/game_data/heirloom.d.ts +0 -79
- package/esm/src/wow/game_data/heirloom.js +0 -26
- package/esm/src/wow/game_data/item.d.ts +0 -166
- package/esm/src/wow/game_data/item.js +0 -101
- package/esm/src/wow/game_data/journal.d.ts +0 -121
- package/esm/src/wow/game_data/journal.js +0 -99
- package/esm/src/wow/game_data/keystone_affix.d.ts +0 -34
- package/esm/src/wow/game_data/keystone_affix.js +0 -39
- package/esm/src/wow/game_data/media_search.d.ts +0 -8
- package/esm/src/wow/game_data/media_search.js +0 -10
- package/esm/src/wow/game_data/modified_crafting.d.ts +0 -56
- package/esm/src/wow/game_data/modified_crafting.js +0 -63
- package/esm/src/wow/game_data/mount.d.ts +0 -30
- package/esm/src/wow/game_data/mount.js +0 -30
- package/esm/src/wow/game_data/mythic_keystone_dungeon.d.ts +0 -91
- package/esm/src/wow/game_data/mythic_keystone_dungeon.js +0 -88
- package/esm/src/wow/game_data/mythic_keystone_leaderboard.d.ts +0 -58
- package/esm/src/wow/game_data/mythic_keystone_leaderboard.js +0 -29
- package/esm/src/wow/game_data/mythic_raid_leaderboard.d.ts +0 -31
- package/esm/src/wow/game_data/mythic_raid_leaderboard.js +0 -15
- package/esm/src/wow/game_data/pet.d.ts +0 -91
- package/esm/src/wow/game_data/pet.js +0 -77
- package/esm/src/wow/game_data/playable_class.d.ts +0 -57
- package/esm/src/wow/game_data/playable_class.js +0 -52
- package/esm/src/wow/game_data/playable_race.d.ts +0 -29
- package/esm/src/wow/game_data/playable_race.js +0 -26
- package/esm/src/wow/game_data/power_type.d.ts +0 -21
- package/esm/src/wow/game_data/power_type.js +0 -26
- package/esm/src/wow/game_data/profession.d.ts +0 -85
- package/esm/src/wow/game_data/profession.js +0 -79
- package/esm/src/wow/game_data/pvp_season.d.ts +0 -99
- package/esm/src/wow/game_data/pvp_season.js +0 -66
- package/esm/src/wow/game_data/pvp_tier.d.ts +0 -40
- package/esm/src/wow/game_data/pvp_tier.js +0 -39
- package/esm/src/wow/game_data/quest.d.ts +0 -114
- package/esm/src/wow/game_data/quest.js +0 -101
- package/esm/src/wow/game_data/realm.d.ts +0 -42
- package/esm/src/wow/game_data/realm.js +0 -36
- package/esm/src/wow/game_data/region.d.ts +0 -24
- package/esm/src/wow/game_data/region.js +0 -26
- package/esm/src/wow/game_data/reputations.d.ts +0 -50
- package/esm/src/wow/game_data/reputations.js +0 -51
- package/esm/src/wow/game_data/spell.d.ts +0 -33
- package/esm/src/wow/game_data/spell.js +0 -37
- package/esm/src/wow/game_data/talent.d.ts +0 -129
- package/esm/src/wow/game_data/talent.js +0 -90
- package/esm/src/wow/game_data/tech_talent.d.ts +0 -70
- package/esm/src/wow/game_data/tech_talent.js +0 -64
- package/esm/src/wow/game_data/title.d.ts +0 -25
- package/esm/src/wow/game_data/title.js +0 -26
- package/esm/src/wow/game_data/token.d.ts +0 -16
- package/esm/src/wow/game_data/token.js +0 -19
- package/esm/src/wow/game_data/toy.d.ts +0 -24
- package/esm/src/wow/game_data/toy.js +0 -26
- package/esm/src/wow/index.d.ts +0 -53
- package/esm/src/wow/index.js +0 -55
- package/esm/src/wow/profile/character_achievements.d.ts +0 -87
- package/esm/src/wow/profile/character_achievements.js +0 -29
- package/esm/src/wow/profile/character_appearance.d.ts +0 -75
- package/esm/src/wow/profile/character_appearance.js +0 -15
- package/esm/src/wow/profile/character_collections.d.ts +0 -92
- package/esm/src/wow/profile/character_collections.js +0 -71
- package/esm/src/wow/profile/character_encounters.d.ts +0 -77
- package/esm/src/wow/profile/character_encounters.js +0 -43
- package/esm/src/wow/profile/character_equipment.d.ts +0 -132
- package/esm/src/wow/profile/character_equipment.js +0 -15
- package/esm/src/wow/profile/character_hunter_pets.d.ts +0 -21
- package/esm/src/wow/profile/character_hunter_pets.js +0 -15
- package/esm/src/wow/profile/character_media.d.ts +0 -13
- package/esm/src/wow/profile/character_media.js +0 -15
- package/esm/src/wow/profile/character_mythic_keystone_profile.d.ts +0 -58
- package/esm/src/wow/profile/character_mythic_keystone_profile.js +0 -32
- package/esm/src/wow/profile/character_professions.d.ts +0 -26
- package/esm/src/wow/profile/character_professions.js +0 -15
- package/esm/src/wow/profile/character_profile.d.ts +0 -82
- package/esm/src/wow/profile/character_profile.js +0 -40
- package/esm/src/wow/profile/character_pvp.d.ts +0 -51
- package/esm/src/wow/profile/character_pvp.js +0 -30
- package/esm/src/wow/profile/character_quests.d.ts +0 -28
- package/esm/src/wow/profile/character_quests.js +0 -29
- package/esm/src/wow/profile/character_reputations.d.ts +0 -22
- package/esm/src/wow/profile/character_reputations.js +0 -15
- package/esm/src/wow/profile/character_soulbinds.d.ts +0 -30
- package/esm/src/wow/profile/character_soulbinds.js +0 -15
- package/esm/src/wow/profile/character_specializations.d.ts +0 -44
- package/esm/src/wow/profile/character_specializations.js +0 -15
- package/esm/src/wow/profile/character_statistics.d.ts +0 -116
- package/esm/src/wow/profile/character_statistics.js +0 -15
- package/esm/src/wow/profile/character_titles.d.ts +0 -13
- package/esm/src/wow/profile/character_titles.js +0 -15
- package/esm/src/wow/profile/guild.d.ts +0 -117
- package/esm/src/wow/profile/guild.js +0 -57
- package/esm/src/wow/search.d.ts +0 -21
- package/esm/src/wow/search.js +0 -30
- package/script/src/hearthstone/game_data/card_backs.d.ts +0 -22
- package/script/src/hearthstone/game_data/card_backs.js +0 -28
- package/script/src/hearthstone/game_data/cards.d.ts +0 -37
- package/script/src/hearthstone/game_data/cards.js +0 -32
- package/script/src/hearthstone/game_data/decks.d.ts +0 -88
- package/script/src/hearthstone/game_data/decks.js +0 -18
- package/script/src/hearthstone/game_data/metadata.d.ts +0 -95
- package/script/src/hearthstone/game_data/metadata.js +0 -16
- package/script/src/hearthstone/index.d.ts +0 -4
- package/script/src/hearthstone/index.js +0 -13
- package/script/src/hearthstone/search.d.ts +0 -20
- package/script/src/hearthstone/search.js +0 -33
- package/script/src/shared/auth.d.ts +0 -24
- package/script/src/shared/auth.js +0 -63
- package/script/src/shared/config.d.ts +0 -40
- package/script/src/shared/config.js +0 -55
- package/script/src/shared/errors.d.ts +0 -44
- package/script/src/shared/errors.js +0 -91
- package/script/src/shared/index.d.ts +0 -4
- package/script/src/shared/index.js +0 -9
- package/script/src/shared/request.d.ts +0 -13
- package/script/src/shared/request.js +0 -47
- package/script/src/shared/types.d.ts +0 -120
- package/script/src/shared/types.js +0 -3
- package/script/src/starcraft2/game_data/league.d.ts +0 -32
- package/script/src/starcraft2/game_data/league.js +0 -25
- package/script/src/starcraft2/index.d.ts +0 -1
- package/script/src/starcraft2/index.js +0 -5
- package/script/src/wow/game_data/achievement.d.ts +0 -84
- package/script/src/wow/game_data/achievement.js +0 -77
- package/script/src/wow/game_data/auction_house.d.ts +0 -64
- package/script/src/wow/game_data/auction_house.js +0 -39
- package/script/src/wow/game_data/azerite_essence.d.ts +0 -49
- package/script/src/wow/game_data/azerite_essence.js +0 -56
- package/script/src/wow/game_data/connected_realm.d.ts +0 -54
- package/script/src/wow/game_data/connected_realm.js +0 -42
- package/script/src/wow/game_data/covenant.d.ts +0 -108
- package/script/src/wow/game_data/covenant.js +0 -99
- package/script/src/wow/game_data/creature.d.ts +0 -97
- package/script/src/wow/game_data/creature.js +0 -111
- package/script/src/wow/game_data/guild_crest.d.ts +0 -55
- package/script/src/wow/game_data/guild_crest.js +0 -45
- package/script/src/wow/game_data/heirloom.d.ts +0 -79
- package/script/src/wow/game_data/heirloom.js +0 -31
- package/script/src/wow/game_data/item.d.ts +0 -166
- package/script/src/wow/game_data/item.js +0 -112
- package/script/src/wow/game_data/journal.d.ts +0 -121
- package/script/src/wow/game_data/journal.js +0 -110
- package/script/src/wow/game_data/keystone_affix.d.ts +0 -34
- package/script/src/wow/game_data/keystone_affix.js +0 -45
- package/script/src/wow/game_data/media_search.d.ts +0 -8
- package/script/src/wow/game_data/media_search.js +0 -14
- package/script/src/wow/game_data/modified_crafting.d.ts +0 -56
- package/script/src/wow/game_data/modified_crafting.js +0 -71
- package/script/src/wow/game_data/mount.d.ts +0 -30
- package/script/src/wow/game_data/mount.js +0 -36
- package/script/src/wow/game_data/mythic_keystone_dungeon.d.ts +0 -91
- package/script/src/wow/game_data/mythic_keystone_dungeon.js +0 -98
- package/script/src/wow/game_data/mythic_keystone_leaderboard.d.ts +0 -58
- package/script/src/wow/game_data/mythic_keystone_leaderboard.js +0 -34
- package/script/src/wow/game_data/mythic_raid_leaderboard.d.ts +0 -31
- package/script/src/wow/game_data/mythic_raid_leaderboard.js +0 -19
- package/script/src/wow/game_data/pet.d.ts +0 -91
- package/script/src/wow/game_data/pet.js +0 -86
- package/script/src/wow/game_data/playable_class.d.ts +0 -57
- package/script/src/wow/game_data/playable_class.js +0 -59
- package/script/src/wow/game_data/playable_race.d.ts +0 -29
- package/script/src/wow/game_data/playable_race.js +0 -31
- package/script/src/wow/game_data/power_type.d.ts +0 -21
- package/script/src/wow/game_data/power_type.js +0 -31
- package/script/src/wow/game_data/profession.d.ts +0 -85
- package/script/src/wow/game_data/profession.js +0 -88
- package/script/src/wow/game_data/pvp_season.d.ts +0 -99
- package/script/src/wow/game_data/pvp_season.js +0 -74
- package/script/src/wow/game_data/pvp_tier.d.ts +0 -40
- package/script/src/wow/game_data/pvp_tier.js +0 -45
- package/script/src/wow/game_data/quest.d.ts +0 -114
- package/script/src/wow/game_data/quest.js +0 -112
- package/script/src/wow/game_data/realm.d.ts +0 -42
- package/script/src/wow/game_data/realm.js +0 -42
- package/script/src/wow/game_data/region.d.ts +0 -24
- package/script/src/wow/game_data/region.js +0 -31
- package/script/src/wow/game_data/reputations.d.ts +0 -50
- package/script/src/wow/game_data/reputations.js +0 -58
- package/script/src/wow/game_data/spell.d.ts +0 -33
- package/script/src/wow/game_data/spell.js +0 -43
- package/script/src/wow/game_data/talent.d.ts +0 -129
- package/script/src/wow/game_data/talent.js +0 -100
- package/script/src/wow/game_data/tech_talent.d.ts +0 -70
- package/script/src/wow/game_data/tech_talent.js +0 -72
- package/script/src/wow/game_data/title.d.ts +0 -25
- package/script/src/wow/game_data/title.js +0 -31
- package/script/src/wow/game_data/token.d.ts +0 -16
- package/script/src/wow/game_data/token.js +0 -23
- package/script/src/wow/game_data/toy.d.ts +0 -24
- package/script/src/wow/game_data/toy.js +0 -31
- package/script/src/wow/index.d.ts +0 -53
- package/script/src/wow/index.js +0 -228
- package/script/src/wow/profile/character_achievements.d.ts +0 -87
- package/script/src/wow/profile/character_achievements.js +0 -34
- package/script/src/wow/profile/character_appearance.d.ts +0 -75
- package/script/src/wow/profile/character_appearance.js +0 -19
- package/script/src/wow/profile/character_collections.d.ts +0 -92
- package/script/src/wow/profile/character_collections.js +0 -79
- package/script/src/wow/profile/character_encounters.d.ts +0 -77
- package/script/src/wow/profile/character_encounters.js +0 -49
- package/script/src/wow/profile/character_equipment.d.ts +0 -132
- package/script/src/wow/profile/character_equipment.js +0 -19
- package/script/src/wow/profile/character_hunter_pets.d.ts +0 -21
- package/script/src/wow/profile/character_hunter_pets.js +0 -19
- package/script/src/wow/profile/character_media.d.ts +0 -13
- package/script/src/wow/profile/character_media.js +0 -19
- package/script/src/wow/profile/character_mythic_keystone_profile.d.ts +0 -58
- package/script/src/wow/profile/character_mythic_keystone_profile.js +0 -37
- package/script/src/wow/profile/character_professions.d.ts +0 -26
- package/script/src/wow/profile/character_professions.js +0 -19
- package/script/src/wow/profile/character_profile.d.ts +0 -82
- package/script/src/wow/profile/character_profile.js +0 -45
- package/script/src/wow/profile/character_pvp.d.ts +0 -51
- package/script/src/wow/profile/character_pvp.js +0 -35
- package/script/src/wow/profile/character_quests.d.ts +0 -28
- package/script/src/wow/profile/character_quests.js +0 -34
- package/script/src/wow/profile/character_reputations.d.ts +0 -22
- package/script/src/wow/profile/character_reputations.js +0 -19
- package/script/src/wow/profile/character_soulbinds.d.ts +0 -30
- package/script/src/wow/profile/character_soulbinds.js +0 -19
- package/script/src/wow/profile/character_specializations.d.ts +0 -44
- package/script/src/wow/profile/character_specializations.js +0 -19
- package/script/src/wow/profile/character_statistics.d.ts +0 -116
- package/script/src/wow/profile/character_statistics.js +0 -19
- package/script/src/wow/profile/character_titles.d.ts +0 -13
- package/script/src/wow/profile/character_titles.js +0 -19
- package/script/src/wow/profile/guild.d.ts +0 -117
- package/script/src/wow/profile/guild.js +0 -64
- package/script/src/wow/search.d.ts +0 -21
- package/script/src/wow/search.js +0 -34
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import type { Character, Href, KeyId, KeyNameId, LinkSelfHref, LocalizedString, TypeName } from "../../shared/index.js";
|
|
2
|
-
export interface Rgba {
|
|
3
|
-
r: number;
|
|
4
|
-
g: number;
|
|
5
|
-
b: number;
|
|
6
|
-
a: number;
|
|
7
|
-
}
|
|
8
|
-
export interface CrestAsset {
|
|
9
|
-
id?: number;
|
|
10
|
-
media?: KeyId;
|
|
11
|
-
color: {
|
|
12
|
-
id: number;
|
|
13
|
-
rgba: Rgba;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export interface Guild extends LinkSelfHref {
|
|
17
|
-
key?: Href;
|
|
18
|
-
id: number;
|
|
19
|
-
name: string;
|
|
20
|
-
faction: TypeName;
|
|
21
|
-
achievement_points?: number;
|
|
22
|
-
member_count?: number;
|
|
23
|
-
realm: {
|
|
24
|
-
key: Href;
|
|
25
|
-
name: LocalizedString;
|
|
26
|
-
id: number;
|
|
27
|
-
slug: string;
|
|
28
|
-
};
|
|
29
|
-
crest?: {
|
|
30
|
-
emblem: CrestAsset;
|
|
31
|
-
border: CrestAsset;
|
|
32
|
-
background: CrestAsset;
|
|
33
|
-
};
|
|
34
|
-
roster?: Href;
|
|
35
|
-
achievements?: Href;
|
|
36
|
-
created_timestamp?: number;
|
|
37
|
-
activity?: Href;
|
|
38
|
-
name_search: string;
|
|
39
|
-
}
|
|
40
|
-
export interface GuildActivity extends LinkSelfHref {
|
|
41
|
-
guild: Guild;
|
|
42
|
-
activities: {
|
|
43
|
-
character_achievement: {
|
|
44
|
-
character: Character;
|
|
45
|
-
achievement: KeyNameId;
|
|
46
|
-
};
|
|
47
|
-
activity: {
|
|
48
|
-
type: string;
|
|
49
|
-
};
|
|
50
|
-
timestamp: number;
|
|
51
|
-
}[];
|
|
52
|
-
}
|
|
53
|
-
export interface Critiera {
|
|
54
|
-
id: number;
|
|
55
|
-
amount?: number;
|
|
56
|
-
is_completed: boolean;
|
|
57
|
-
child_criteria?: Critiera[];
|
|
58
|
-
}
|
|
59
|
-
export interface GuildAchievements extends LinkSelfHref {
|
|
60
|
-
guild: Guild;
|
|
61
|
-
total_quantity: number;
|
|
62
|
-
total_points: number;
|
|
63
|
-
achievements: {
|
|
64
|
-
id: number;
|
|
65
|
-
achievement: KeyNameId;
|
|
66
|
-
criteria: Critiera;
|
|
67
|
-
completed_timestamp: number;
|
|
68
|
-
}[];
|
|
69
|
-
category_progress: {
|
|
70
|
-
category: KeyNameId;
|
|
71
|
-
quantity: number;
|
|
72
|
-
points: number;
|
|
73
|
-
}[];
|
|
74
|
-
recent_events: {
|
|
75
|
-
achievement: KeyNameId;
|
|
76
|
-
timestamp: number;
|
|
77
|
-
}[];
|
|
78
|
-
}
|
|
79
|
-
export interface GuildRoster extends LinkSelfHref {
|
|
80
|
-
guild: Guild;
|
|
81
|
-
members: {
|
|
82
|
-
character: Character;
|
|
83
|
-
rank: number;
|
|
84
|
-
}[];
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Returns a single guild by its name and realm.
|
|
88
|
-
*
|
|
89
|
-
* @param realmSlug - The slug of the realm.
|
|
90
|
-
* @param nameSlug - The slug of the guild.
|
|
91
|
-
* @returns A promise that resolves to an object representing a single guild by its name and realm.
|
|
92
|
-
*/
|
|
93
|
-
export declare function guild(realmSlug: string, nameSlug: string): Promise<Guild>;
|
|
94
|
-
/**
|
|
95
|
-
* Returns a single guild's activity by name and realm.
|
|
96
|
-
*
|
|
97
|
-
* @param realmSlug - The slug of the realm.
|
|
98
|
-
* @param nameSlug - The slug of the guild.
|
|
99
|
-
* @returns A promise that resolves to an object representing a single guild's activity by its name and realm.
|
|
100
|
-
*/
|
|
101
|
-
export declare function guildActivity(realmSlug: string, nameSlug: string): Promise<GuildActivity>;
|
|
102
|
-
/**
|
|
103
|
-
* Returns a single guild's achievements by name and realm.
|
|
104
|
-
*
|
|
105
|
-
* @param realmSlug - The slug of the realm.
|
|
106
|
-
* @param nameSlug - The slug of the guild.
|
|
107
|
-
* @returns A promise that resolves to an object representing a single guild's achievements by its name and realm.
|
|
108
|
-
*/
|
|
109
|
-
export declare function guildAchievements(realmSlug: string, nameSlug: string): Promise<GuildAchievements>;
|
|
110
|
-
/**
|
|
111
|
-
* Returns a single guild's roster by its name and realm.
|
|
112
|
-
*
|
|
113
|
-
* @param realmSlug - The slug of the realm.
|
|
114
|
-
* @param nameSlug - The slug of the guild.
|
|
115
|
-
* @returns A promise that resolves to an object representing a single guild's roster by its name and realm.
|
|
116
|
-
*/
|
|
117
|
-
export declare function guildRoster(realmSlug: string, nameSlug: string): Promise<GuildRoster>;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { request } from "../../shared/index.js";
|
|
2
|
-
/**
|
|
3
|
-
* Returns a single guild by its name and realm.
|
|
4
|
-
*
|
|
5
|
-
* @param realmSlug - The slug of the realm.
|
|
6
|
-
* @param nameSlug - The slug of the guild.
|
|
7
|
-
* @returns A promise that resolves to an object representing a single guild by its name and realm.
|
|
8
|
-
*/
|
|
9
|
-
export async function guild(realmSlug, nameSlug) {
|
|
10
|
-
return await request({
|
|
11
|
-
method: "GET",
|
|
12
|
-
url: `/data/wow/guild/${realmSlug}/${nameSlug}`,
|
|
13
|
-
namespace: "profile",
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Returns a single guild's activity by name and realm.
|
|
18
|
-
*
|
|
19
|
-
* @param realmSlug - The slug of the realm.
|
|
20
|
-
* @param nameSlug - The slug of the guild.
|
|
21
|
-
* @returns A promise that resolves to an object representing a single guild's activity by its name and realm.
|
|
22
|
-
*/
|
|
23
|
-
export async function guildActivity(realmSlug, nameSlug) {
|
|
24
|
-
return await request({
|
|
25
|
-
method: "GET",
|
|
26
|
-
url: `/data/wow/guild/${realmSlug}/${nameSlug}/activity`,
|
|
27
|
-
namespace: "profile",
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Returns a single guild's achievements by name and realm.
|
|
32
|
-
*
|
|
33
|
-
* @param realmSlug - The slug of the realm.
|
|
34
|
-
* @param nameSlug - The slug of the guild.
|
|
35
|
-
* @returns A promise that resolves to an object representing a single guild's achievements by its name and realm.
|
|
36
|
-
*/
|
|
37
|
-
export async function guildAchievements(realmSlug, nameSlug) {
|
|
38
|
-
return await request({
|
|
39
|
-
method: "GET",
|
|
40
|
-
url: `/data/wow/guild/${realmSlug}/${nameSlug}/achievements`,
|
|
41
|
-
namespace: "profile",
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Returns a single guild's roster by its name and realm.
|
|
46
|
-
*
|
|
47
|
-
* @param realmSlug - The slug of the realm.
|
|
48
|
-
* @param nameSlug - The slug of the guild.
|
|
49
|
-
* @returns A promise that resolves to an object representing a single guild's roster by its name and realm.
|
|
50
|
-
*/
|
|
51
|
-
export async function guildRoster(realmSlug, nameSlug) {
|
|
52
|
-
return await request({
|
|
53
|
-
method: "GET",
|
|
54
|
-
url: `/data/wow/guild/${realmSlug}/${nameSlug}/roster`,
|
|
55
|
-
namespace: "profile",
|
|
56
|
-
});
|
|
57
|
-
}
|
package/esm/src/wow/search.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Namespaces } from "../shared/index.js";
|
|
2
|
-
export interface SearchParameters {
|
|
3
|
-
searchFields?: Record<string | symbol, string | number>;
|
|
4
|
-
orderBy?: string;
|
|
5
|
-
page?: number;
|
|
6
|
-
pageSize?: number;
|
|
7
|
-
}
|
|
8
|
-
export interface Search {
|
|
9
|
-
page: number;
|
|
10
|
-
pageSize: number;
|
|
11
|
-
maxPageSize: number;
|
|
12
|
-
pageCount: number;
|
|
13
|
-
results: unknown[];
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Performs a search.
|
|
17
|
-
*
|
|
18
|
-
* @param SearchParameters - Object containing search parameters.
|
|
19
|
-
* @returns A promise that resolves to an object representing details about the search.
|
|
20
|
-
*/
|
|
21
|
-
export declare function search(url: string, namespace: Namespaces, searchParameters: SearchParameters): Promise<Search>;
|
package/esm/src/wow/search.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { request } from "../shared/index.js";
|
|
2
|
-
/**
|
|
3
|
-
* Performs a search.
|
|
4
|
-
*
|
|
5
|
-
* @param SearchParameters - Object containing search parameters.
|
|
6
|
-
* @returns A promise that resolves to an object representing details about the search.
|
|
7
|
-
*/
|
|
8
|
-
export async function search(url, namespace, searchParameters) {
|
|
9
|
-
const searchFields = searchParameters.searchFields
|
|
10
|
-
? Object.fromEntries(Object.entries(searchParameters.searchFields).map(([key, value]) => [key, value.toString()]))
|
|
11
|
-
: undefined;
|
|
12
|
-
const qs = {
|
|
13
|
-
...searchFields,
|
|
14
|
-
};
|
|
15
|
-
if (searchParameters.orderBy) {
|
|
16
|
-
qs.orderby = searchParameters.orderBy;
|
|
17
|
-
}
|
|
18
|
-
if (searchParameters.page !== undefined) {
|
|
19
|
-
qs._page = searchParameters.page;
|
|
20
|
-
}
|
|
21
|
-
if (searchParameters.pageSize !== undefined) {
|
|
22
|
-
qs._pageSize = searchParameters.pageSize;
|
|
23
|
-
}
|
|
24
|
-
return await request({
|
|
25
|
-
method: "GET",
|
|
26
|
-
url: `/data/wow/search${url}`,
|
|
27
|
-
qs,
|
|
28
|
-
namespace,
|
|
29
|
-
});
|
|
30
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { LocalizedString } from "../../shared/index.js";
|
|
2
|
-
import type { Search, SearchParameters } from "../search.js";
|
|
3
|
-
export interface Cardback {
|
|
4
|
-
id: number;
|
|
5
|
-
sortCategory: number;
|
|
6
|
-
text: LocalizedString;
|
|
7
|
-
name: LocalizedString;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Returns an up-to-date list of all card backs matching the search criteria.
|
|
11
|
-
*
|
|
12
|
-
* @param SearchParameters - Object containing search parameters.
|
|
13
|
-
* @returns A promise that resolves to an object representing an up-to-date list of all card backs matching the search criteria.
|
|
14
|
-
*/
|
|
15
|
-
export declare function searchCardbacks(searchParameters: SearchParameters): Promise<Search>;
|
|
16
|
-
/**
|
|
17
|
-
* Returns the card back with an ID or slug that matches the one you specify.
|
|
18
|
-
*
|
|
19
|
-
* @param idorslug - The unique identifier for the card back by slug.
|
|
20
|
-
* @returns A promise that resolves to an object representing details about a card back.
|
|
21
|
-
*/
|
|
22
|
-
export declare function fetchCardback(idorslug: string): Promise<Cardback>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchCardback = exports.searchCardbacks = void 0;
|
|
4
|
-
const index_js_1 = require("../../shared/index.js");
|
|
5
|
-
const search_js_1 = require("../search.js");
|
|
6
|
-
/**
|
|
7
|
-
* Returns an up-to-date list of all card backs matching the search criteria.
|
|
8
|
-
*
|
|
9
|
-
* @param SearchParameters - Object containing search parameters.
|
|
10
|
-
* @returns A promise that resolves to an object representing an up-to-date list of all card backs matching the search criteria.
|
|
11
|
-
*/
|
|
12
|
-
async function searchCardbacks(searchParameters) {
|
|
13
|
-
return await (0, search_js_1.search)("/cardback", searchParameters);
|
|
14
|
-
}
|
|
15
|
-
exports.searchCardbacks = searchCardbacks;
|
|
16
|
-
/**
|
|
17
|
-
* Returns the card back with an ID or slug that matches the one you specify.
|
|
18
|
-
*
|
|
19
|
-
* @param idorslug - The unique identifier for the card back by slug.
|
|
20
|
-
* @returns A promise that resolves to an object representing details about a card back.
|
|
21
|
-
*/
|
|
22
|
-
async function fetchCardback(idorslug) {
|
|
23
|
-
return await (0, index_js_1.request)({
|
|
24
|
-
method: "GET",
|
|
25
|
-
url: `/hearthstone/cardback/${idorslug}`,
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
exports.fetchCardback = fetchCardback;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { LocalizedString } from "../../shared/index.js";
|
|
2
|
-
import type { Search, SearchParameters } from "../search.js";
|
|
3
|
-
export interface Card {
|
|
4
|
-
id: number;
|
|
5
|
-
collectible: number;
|
|
6
|
-
slug: string;
|
|
7
|
-
classId: number;
|
|
8
|
-
multiClassIds: number[];
|
|
9
|
-
cardTypeId: number;
|
|
10
|
-
cardSetId: number;
|
|
11
|
-
rarityId: number;
|
|
12
|
-
artistName: string;
|
|
13
|
-
health: number;
|
|
14
|
-
attack: number;
|
|
15
|
-
manaCost: number;
|
|
16
|
-
name: LocalizedString;
|
|
17
|
-
text: LocalizedString;
|
|
18
|
-
image: string;
|
|
19
|
-
imageGold: string;
|
|
20
|
-
flavorText: LocalizedString;
|
|
21
|
-
cropImage: string;
|
|
22
|
-
keywordIds: number[];
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Returns an up-to-date list of all cards matching the search criteria.
|
|
26
|
-
*
|
|
27
|
-
* @param SearchParameters - Object containing search parameters.
|
|
28
|
-
* @returns A promise that resolves to an object representing an up-to-date list of all cards matching the search criteria.
|
|
29
|
-
*/
|
|
30
|
-
export declare function searchCards(searchParameters: SearchParameters): Promise<Search>;
|
|
31
|
-
/**
|
|
32
|
-
* Returns the card with an ID or slug that matches the one you specify.
|
|
33
|
-
*
|
|
34
|
-
* @param idorslug - The unique identifier for the card by slug.
|
|
35
|
-
* @returns A promise that resolves to an object representing details about a card.
|
|
36
|
-
*/
|
|
37
|
-
export declare function fetchCard(idorslug: string, gameMode?: string): Promise<Card>;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchCard = exports.searchCards = void 0;
|
|
4
|
-
const index_js_1 = require("../../shared/index.js");
|
|
5
|
-
const search_js_1 = require("../search.js");
|
|
6
|
-
/**
|
|
7
|
-
* Returns an up-to-date list of all cards matching the search criteria.
|
|
8
|
-
*
|
|
9
|
-
* @param SearchParameters - Object containing search parameters.
|
|
10
|
-
* @returns A promise that resolves to an object representing an up-to-date list of all cards matching the search criteria.
|
|
11
|
-
*/
|
|
12
|
-
async function searchCards(searchParameters) {
|
|
13
|
-
return await (0, search_js_1.search)("/cards", searchParameters);
|
|
14
|
-
}
|
|
15
|
-
exports.searchCards = searchCards;
|
|
16
|
-
/**
|
|
17
|
-
* Returns the card with an ID or slug that matches the one you specify.
|
|
18
|
-
*
|
|
19
|
-
* @param idorslug - The unique identifier for the card by slug.
|
|
20
|
-
* @returns A promise that resolves to an object representing details about a card.
|
|
21
|
-
*/
|
|
22
|
-
async function fetchCard(idorslug, gameMode) {
|
|
23
|
-
const reqOptions = {
|
|
24
|
-
method: "GET",
|
|
25
|
-
url: `/hearthstone/cards/${idorslug}`,
|
|
26
|
-
};
|
|
27
|
-
if (gameMode) {
|
|
28
|
-
reqOptions["qs"] = { gameMode };
|
|
29
|
-
}
|
|
30
|
-
return await (0, index_js_1.request)(reqOptions);
|
|
31
|
-
}
|
|
32
|
-
exports.fetchCard = fetchCard;
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import type { LocalizedString } from "../../shared/index.js";
|
|
2
|
-
export interface Options {
|
|
3
|
-
code?: string;
|
|
4
|
-
ids?: string;
|
|
5
|
-
hero?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface Deck {
|
|
8
|
-
deckCode: string;
|
|
9
|
-
version: number;
|
|
10
|
-
format: string;
|
|
11
|
-
hero: {
|
|
12
|
-
id: number;
|
|
13
|
-
collectible: number;
|
|
14
|
-
slug: string;
|
|
15
|
-
classId: number;
|
|
16
|
-
multiClassIds: number[];
|
|
17
|
-
cardTypeId: number;
|
|
18
|
-
cardSetId: number;
|
|
19
|
-
rarityId: number;
|
|
20
|
-
artistName: string;
|
|
21
|
-
health: number;
|
|
22
|
-
manaCost: number;
|
|
23
|
-
name: LocalizedString;
|
|
24
|
-
text: LocalizedString;
|
|
25
|
-
image: string;
|
|
26
|
-
imageGold: string;
|
|
27
|
-
flavorText: LocalizedString;
|
|
28
|
-
cropImage: string;
|
|
29
|
-
childIds: number[];
|
|
30
|
-
};
|
|
31
|
-
heroPower: {
|
|
32
|
-
id: number;
|
|
33
|
-
collectible: number;
|
|
34
|
-
slug: string;
|
|
35
|
-
classId: number;
|
|
36
|
-
multiClassIds: number[];
|
|
37
|
-
cardTypeId: number;
|
|
38
|
-
cardSetId: number;
|
|
39
|
-
rarityId: number;
|
|
40
|
-
artistName: null;
|
|
41
|
-
manaCost: number;
|
|
42
|
-
name: LocalizedString;
|
|
43
|
-
text: LocalizedString;
|
|
44
|
-
image: string;
|
|
45
|
-
imageGold: string;
|
|
46
|
-
flavorText: LocalizedString;
|
|
47
|
-
cropImage: string;
|
|
48
|
-
parentId: number;
|
|
49
|
-
};
|
|
50
|
-
class: {
|
|
51
|
-
slug: string;
|
|
52
|
-
id: number;
|
|
53
|
-
name: LocalizedString;
|
|
54
|
-
};
|
|
55
|
-
cards: {
|
|
56
|
-
id: number;
|
|
57
|
-
collectible: number;
|
|
58
|
-
slug: string;
|
|
59
|
-
classId: number;
|
|
60
|
-
multiClassIds: number[];
|
|
61
|
-
cardTypeId: number;
|
|
62
|
-
cardSetId: number;
|
|
63
|
-
rarityId: number;
|
|
64
|
-
artistName: string;
|
|
65
|
-
health: number;
|
|
66
|
-
attack: number;
|
|
67
|
-
manaCost: number;
|
|
68
|
-
name: LocalizedString;
|
|
69
|
-
text: LocalizedString;
|
|
70
|
-
image: string;
|
|
71
|
-
imageGold: string;
|
|
72
|
-
flavorText: LocalizedString;
|
|
73
|
-
cropImage: string;
|
|
74
|
-
copyOfCardId: number;
|
|
75
|
-
duels: {
|
|
76
|
-
relevant: boolean;
|
|
77
|
-
constructed: boolean;
|
|
78
|
-
};
|
|
79
|
-
}[];
|
|
80
|
-
cardCount: number;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Returns the card with an ID or slug that matches the one you specify.
|
|
84
|
-
*
|
|
85
|
-
* @param options - find parameters fort the search.
|
|
86
|
-
* @returns A promise that resolves to an object representing details about a card.
|
|
87
|
-
*/
|
|
88
|
-
export declare function fetchDeck(options?: Options): Promise<Deck>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchDeck = void 0;
|
|
4
|
-
const index_js_1 = require("../../shared/index.js");
|
|
5
|
-
/**
|
|
6
|
-
* Returns the card with an ID or slug that matches the one you specify.
|
|
7
|
-
*
|
|
8
|
-
* @param options - find parameters fort the search.
|
|
9
|
-
* @returns A promise that resolves to an object representing details about a card.
|
|
10
|
-
*/
|
|
11
|
-
async function fetchDeck(options) {
|
|
12
|
-
return await (0, index_js_1.request)({
|
|
13
|
-
method: "GET",
|
|
14
|
-
url: `/hearthstone/deck`,
|
|
15
|
-
qs: options,
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
exports.fetchDeck = fetchDeck;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import type { LocalizedString } from "../../shared/index.js";
|
|
2
|
-
export interface Metadata {
|
|
3
|
-
sets: {
|
|
4
|
-
id: number;
|
|
5
|
-
name: LocalizedString;
|
|
6
|
-
slug: string;
|
|
7
|
-
aliasSetIds?: number[];
|
|
8
|
-
type: string;
|
|
9
|
-
collectibleCount: number;
|
|
10
|
-
collectibleRevealedCount: number;
|
|
11
|
-
nonCollectibleCount: number;
|
|
12
|
-
nonCollectibleRevealedCount: number;
|
|
13
|
-
}[];
|
|
14
|
-
setGroups: {
|
|
15
|
-
slug: string;
|
|
16
|
-
year?: number;
|
|
17
|
-
svg?: string;
|
|
18
|
-
cardSets: string[];
|
|
19
|
-
name: LocalizedString;
|
|
20
|
-
standard?: boolean;
|
|
21
|
-
yearRange?: string;
|
|
22
|
-
icon?: string;
|
|
23
|
-
}[];
|
|
24
|
-
gameModes: {
|
|
25
|
-
slug: string;
|
|
26
|
-
id: number;
|
|
27
|
-
name: LocalizedString;
|
|
28
|
-
}[];
|
|
29
|
-
arenaIds: number[];
|
|
30
|
-
types: {
|
|
31
|
-
slug: string;
|
|
32
|
-
id: number;
|
|
33
|
-
name: LocalizedString;
|
|
34
|
-
gameModes: number[];
|
|
35
|
-
}[];
|
|
36
|
-
rarities: {
|
|
37
|
-
slug: string;
|
|
38
|
-
id: number;
|
|
39
|
-
craftingCost: number[];
|
|
40
|
-
dustValue: number[];
|
|
41
|
-
name: LocalizedString;
|
|
42
|
-
}[];
|
|
43
|
-
classes: {
|
|
44
|
-
slug: string;
|
|
45
|
-
id: number;
|
|
46
|
-
name: LocalizedString;
|
|
47
|
-
cardId?: number;
|
|
48
|
-
heroPowerCardId?: number;
|
|
49
|
-
alternateHeroCardIds?: number[];
|
|
50
|
-
}[];
|
|
51
|
-
minionTypes: {
|
|
52
|
-
slug: string;
|
|
53
|
-
id: number;
|
|
54
|
-
name: LocalizedString;
|
|
55
|
-
gameModes: number[];
|
|
56
|
-
}[];
|
|
57
|
-
spellSchools: {
|
|
58
|
-
slug: string;
|
|
59
|
-
id: number;
|
|
60
|
-
name: LocalizedString;
|
|
61
|
-
}[];
|
|
62
|
-
mercenaryRoles: {
|
|
63
|
-
slug: string;
|
|
64
|
-
id: number;
|
|
65
|
-
name: LocalizedString;
|
|
66
|
-
}[];
|
|
67
|
-
mercenaryFactions: {
|
|
68
|
-
slug: string;
|
|
69
|
-
id: number;
|
|
70
|
-
name: LocalizedString;
|
|
71
|
-
}[];
|
|
72
|
-
keywords: {
|
|
73
|
-
id: number;
|
|
74
|
-
slug: string;
|
|
75
|
-
name: LocalizedString;
|
|
76
|
-
refText: LocalizedString;
|
|
77
|
-
text: LocalizedString;
|
|
78
|
-
gameModes: number[];
|
|
79
|
-
}[];
|
|
80
|
-
filterableFields: string[];
|
|
81
|
-
numericFields: string[];
|
|
82
|
-
cardBackCategories: {
|
|
83
|
-
slug: string;
|
|
84
|
-
id: number;
|
|
85
|
-
name: LocalizedString;
|
|
86
|
-
}[];
|
|
87
|
-
}
|
|
88
|
-
type MetaTypes = "sets" | "setGroups" | "types" | "rarities" | "classes" | "minionTypes" | "keywords";
|
|
89
|
-
/**
|
|
90
|
-
* Returns information about the categorization of cards. Metadata includes the card set, set group (for example, Standard or Year of the Dragon), rarity, class, card type, minion type, and keywords.
|
|
91
|
-
*
|
|
92
|
-
* @returns A promise that resolves to an object representing the Metadata.
|
|
93
|
-
*/
|
|
94
|
-
export declare function metadata(type: MetaTypes): Promise<Partial<Metadata>>;
|
|
95
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.metadata = void 0;
|
|
4
|
-
const index_js_1 = require("../../shared/index.js");
|
|
5
|
-
/**
|
|
6
|
-
* Returns information about the categorization of cards. Metadata includes the card set, set group (for example, Standard or Year of the Dragon), rarity, class, card type, minion type, and keywords.
|
|
7
|
-
*
|
|
8
|
-
* @returns A promise that resolves to an object representing the Metadata.
|
|
9
|
-
*/
|
|
10
|
-
async function metadata(type) {
|
|
11
|
-
return await (0, index_js_1.request)({
|
|
12
|
-
method: "GET",
|
|
13
|
-
url: `/hearthstone/metadata/${type}`,
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
exports.metadata = metadata;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.metadata = exports.fetchDeck = exports.searchCardbacks = exports.fetchCardback = exports.searchCards = exports.fetchCard = void 0;
|
|
4
|
-
var cards_js_1 = require("./game_data/cards.js");
|
|
5
|
-
Object.defineProperty(exports, "fetchCard", { enumerable: true, get: function () { return cards_js_1.fetchCard; } });
|
|
6
|
-
Object.defineProperty(exports, "searchCards", { enumerable: true, get: function () { return cards_js_1.searchCards; } });
|
|
7
|
-
var card_backs_js_1 = require("./game_data/card_backs.js");
|
|
8
|
-
Object.defineProperty(exports, "fetchCardback", { enumerable: true, get: function () { return card_backs_js_1.fetchCardback; } });
|
|
9
|
-
Object.defineProperty(exports, "searchCardbacks", { enumerable: true, get: function () { return card_backs_js_1.searchCardbacks; } });
|
|
10
|
-
var decks_js_1 = require("./game_data/decks.js");
|
|
11
|
-
Object.defineProperty(exports, "fetchDeck", { enumerable: true, get: function () { return decks_js_1.fetchDeck; } });
|
|
12
|
-
var metadata_js_1 = require("./game_data/metadata.js");
|
|
13
|
-
Object.defineProperty(exports, "metadata", { enumerable: true, get: function () { return metadata_js_1.metadata; } });
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface SearchParameters {
|
|
2
|
-
searchFields?: Record<string | symbol, string | number>;
|
|
3
|
-
page?: number;
|
|
4
|
-
pageSize?: number;
|
|
5
|
-
sort?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface Search {
|
|
8
|
-
page: number;
|
|
9
|
-
pageSize: number;
|
|
10
|
-
maxPageSize: number;
|
|
11
|
-
pageCount: number;
|
|
12
|
-
results: unknown[];
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Performs a search.
|
|
16
|
-
*
|
|
17
|
-
* @param SearchParameters - Object containing search parameters.
|
|
18
|
-
* @returns A promise that resolves to an object representing details about the search.
|
|
19
|
-
*/
|
|
20
|
-
export declare function search(url: string, searchParameters: SearchParameters): Promise<Search>;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.search = void 0;
|
|
4
|
-
const index_js_1 = require("../shared/index.js");
|
|
5
|
-
/**
|
|
6
|
-
* Performs a search.
|
|
7
|
-
*
|
|
8
|
-
* @param SearchParameters - Object containing search parameters.
|
|
9
|
-
* @returns A promise that resolves to an object representing details about the search.
|
|
10
|
-
*/
|
|
11
|
-
async function search(url, searchParameters) {
|
|
12
|
-
const searchFields = searchParameters.searchFields
|
|
13
|
-
? Object.fromEntries(Object.entries(searchParameters.searchFields).map(([key, value]) => [key, value.toString()]))
|
|
14
|
-
: undefined;
|
|
15
|
-
const qs = {
|
|
16
|
-
...searchFields,
|
|
17
|
-
};
|
|
18
|
-
if (searchParameters.sort) {
|
|
19
|
-
qs.sort = searchParameters.sort;
|
|
20
|
-
}
|
|
21
|
-
if (searchParameters.page !== undefined) {
|
|
22
|
-
qs.page = searchParameters.page;
|
|
23
|
-
}
|
|
24
|
-
if (searchParameters.pageSize !== undefined) {
|
|
25
|
-
qs.pageSize = searchParameters.pageSize;
|
|
26
|
-
}
|
|
27
|
-
return await (0, index_js_1.request)({
|
|
28
|
-
method: "GET",
|
|
29
|
-
url: `/hearthstone${url}`,
|
|
30
|
-
qs,
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
exports.search = search;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents the configuration data for authentication.
|
|
3
|
-
* @property {string} accessToken - The current access token.
|
|
4
|
-
* @property {number} tokenExpiration - The expiration timestamp of the access token (in milliseconds).
|
|
5
|
-
*/
|
|
6
|
-
export interface AuthConfig {
|
|
7
|
-
accessToken: string;
|
|
8
|
-
tokenExpiration: number;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Retrieves the global authentication configuration.
|
|
12
|
-
* @returns {AuthConfig} The authentication configuration object.
|
|
13
|
-
*/
|
|
14
|
-
export declare function getauthConfig(): AuthConfig;
|
|
15
|
-
/**
|
|
16
|
-
* Handles authentication and obtains an access token if needed.
|
|
17
|
-
* @param {boolean} forceNewToken - If true, forces the retrieval of a new token, ignoring any existing one.
|
|
18
|
-
* @returns {Promise<string>} Returns the access token (string).
|
|
19
|
-
* @throws {MissingRegionError} If the region is not configured.
|
|
20
|
-
* @throws {MissingClientIdError} If the client ID is not configured.
|
|
21
|
-
* @throws {MissingClientSecretError} If the client secret is not configured.
|
|
22
|
-
* @throws {AuthenticationError} If there is a problem during the authentication process.
|
|
23
|
-
*/
|
|
24
|
-
export declare function authenticate(forceNewToken?: boolean): Promise<string>;
|