2.0.0 • Published 2 years ago

warcord v2.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

WarCord

This is a package to simplify use of Wargaming API.

BUILD NPM_DOWNLOADS NPM_LICENSE NPM_VERSION PULL_REQUESTS

NPM

Initial Files:

const { WarCord } = require('warcord')
const warcord = new WarCord('your-app-id')

Useful Links

Credits

World of Tanks

World of Tanks Blitz

World of WarShips

World of Tanks Console

WOTCClan

Kind: global class

wotcClan.search(options) ⇒ Promise.<(Array.<WOTCClanSearch>|void)>

Method returns partial list of clans in alphabetical order by clan name or tag.

Kind: instance method of WOTCClan
Returns: Promise.<(Array.<WOTCClanSearch>|void)> - Array of clans.

ParamTypeDescription
optionsObjectOptions Object

Properties

NameTypeDefaultDescription
options.languageAcceptedLangs | stringLocalization language.
options.limitnumber100Number of returned entries (fewer can be returned, but not more than 100). If the limit sent exceeds 100, a limit of 100 is applied (by default).
options.searchstringPart of name or tag for clan search. Minimum 2 characters

wotcClan.get(clan_id, options) ⇒ Promise.<(WOTCClanGet|void)>

Method returns detailed clan information.

Kind: instance method of WOTCClan
Returns: Promise.<(WOTCClanGet|void)> - Clan data.

ParamTypeDescription
clan_idClan ID
optionsObjectOptions Object

Properties

NameTypeDescription
options.languageAcceptedLangs | stringLocalization language.
options.membersbooleanReturn with the members info.

WOWSClans

Kind: global class

wowsClans.get(clanID) ⇒ Promise.<(WOWSClansResolve|null)>

Get a clan in World of WarShips.

Kind: instance method of WOWSClans
Returns: Promise.<(WOWSClansResolve|null)> - Clan data.

ParamTypeDescription
clanIDnumber | stringID of clan.

wowsClans.search(clanNameOrTag) ⇒ Promise.<(WOWSClansSearchResolve|null)>

Get a array with clans data of respective name.

Kind: instance method of WOWSClans
Returns: Promise.<(WOWSClansSearchResolve|null)> - Array with clan data.

ParamTypeDescription
clanNameOrTagstringName or Tag of clan.

WOTBClan

Kind: global class

wotbClan.get(clanID) ⇒ Promise.<(WOTBClanResolve|null)>

Get a clan in World of Tanks Blitz.

Kind: instance method of WOTBClan
Returns: Promise.<(WOTBClanResolve|null)> - Clan data.

ParamTypeDescription
clanIDstring | numberID of clan.

Example

...
const clan = await <Warcord>.blitz.clan.get('ID of Clan')

wotbClan.search(clanNameOrTag) ⇒ Promise.<(Array.<ClanSearchBlitz>|null)>

Get the ID's and Name of the putted name.

Kind: instance method of WOTBClan
Returns: Promise.<(Array.<ClanSearchBlitz>|null)> - The clan ID's and Name.

ParamTypeDescription
clanNameOrTagstringID or Tag of the clan.

Example

...
const searchingClan = await <Warcord>.blitz.clan.search('Name or Tag of Clan')
//this returns an array of the clans found

const clan = await <Warcord>.blitz.clan.get(searchingClan[0].clan_id)
//this returns the first clan data.

WOTClan

Kind: global class

wotClan.get(clanID, options) ⇒ Promise.<(WOTClanResolve|null)>

Get a clan in World of Tanks.

Kind: instance method of WOTClan
Returns: Promise.<(WOTClanResolve|null)> - Clan data.

ParamTypeDescription
clanIDstringID of clan.
optionsObjectOptions Object.

Properties

NameTypeDescription
options.realmAllRealmsThe realm of query.

Example

...
const clan = await <Warcord>.wot.clan.get('ID of Clan')

wotClan.search(clanNameOrTag, options) ⇒ Promise.<(Array.<WOTClanSearchResolve>|null)>

Get a array with clans data of respective name.

Kind: instance method of WOTClan
Returns: Promise.<(Array.<WOTClanSearchResolve>|null)> - Array with clan data.

ParamTypeDescription
clanNameOrTagstringName or Tag of clan.
optionsObjectOptions Object.

Properties

NameTypeDescription
options.realmAllRealmsThe realm of query.

Example

...
const searchingClan = await <Warcord>.wot.clan.search('Name or Tag of Clan')
//this returns an array of the clans found.

const clan = await <Warcord>.wot.clan.get(searchingClan[0].clan_id)
//this returns the first clan data.

wotClan.rating(clanID, options) ⇒ Object

Get the rating of an Clan.

Kind: instance method of WOTClan
Returns: Object - Clan rating.

ParamTypeDescription
clanIDstring | numberID of Clan.
optionsObjectOptions Object.

Properties

NameTypeDescription
options.realmAllRealmsThe realm of query.

Example

...
const ratingOfClan = await <Warcord>.wot.clan.rating('ID of Clan')

wotClan.member(memberID, options) ⇒ Promise.<(WOTMember|null)>

Get the clan member data.

Kind: instance method of WOTClan
Returns: Promise.<(WOTMember|null)> - Clan Member data.

ParamTypeDescription
memberIDstring | numberID of Clan Member.
optionsObjectOptions Object.

Properties

NameTypeDescription
options.realmAllRealmsThe realm of query.

Example

const memberOfClan = await <Warcord>.wot.clan.member('ID of Member')

WOWSEncyclopedia

Kind: global class

wowsEncyclopedia.get()

Deprecated

Kind: instance method of WOWSEncyclopedia

wowsEncyclopedia.find(ops) ⇒ Promise.<(Array.<WOWSLongPediaResolve>|Array.<WOWSPediaResolve>|null)>

Get a ship based on params.

Kind: instance method of WOWSEncyclopedia

ParamType
opsobject

Properties

NameTypeDefaultDescription
ops.nationstringThe nation of ship.
ops.typestringThe type of ship.
ops.optionsobjectOptions of query.
ops.options.limitnumber100The limit of ships finded.
ops.options.langstring"en"The Language of Texts.

Example

...
const getShip = await <WarCord>.wows.ship.find({ nation: 'japan', options: { lang: 'pt-br', limit: 100 } })

wowsEncyclopedia.shipParams(ship_id, options) ⇒ Promise.<(WOWSShipParams|null)>

Get the parameters of a ship

Kind: instance method of WOWSEncyclopedia
Returns: Promise.<(WOWSShipParams|null)> - Parameters of ships in all existing configurations.

ParamTypeDescription
ship_idShip ID
optionsObjectOptions Object

Properties

NameTypeDefaultDescription
options.artillery_idstring | numberMain Battery ID. If the module is not indicated, module of basic configuration is used.
options.dive_bomber_idstring | numberDive bombers' ID. If the module is not indicated, module of basic configuration is used.
options.engine_idstring | numberEngine ID. If the module is not indicated, module of basic configuration is used.
options.fighter_idstring | numberFighters' ID. If the module is not indicated, module of basic configuration is used.
options.fire_control_idstring | numberID of Gun Fire Control System. If the module is not indicated, module of basic configuration is used.
options.flight_control_idstring | numberID of Flight Control System. If the module is not indicated, module of basic configuration is used.
options.hull_idstring | numberHull ID. If the module is not indicated, module of basic configuration is used.
options.languagestring | number"en"Localization language.
options.torpedo_bomber_idstring | numberTorpedo bombers' ID. If the module is not indicated, module of basic configuration is used.
options.torpedoes_idstring | numberTorpedo tubes' ID. If the module is not indicated, module of basic configuration is used.

WOWSShip

Kind: global class

wowsShip.get(userID) ⇒ Promise.<(Array.<WOWSShipResolve>|null)>

Get the ships status of an user.

Kind: instance method of WOWSShip

ParamTypeDescription
userIDstringthe ID of user.

wowsShip.find(ops) ⇒ Promise.<(Array.<WOWSLongShipResolve>|Array.<WOWSShipResolve>|null)>

Get a ship based on params.

Kind: instance method of WOWSShip

ParamType
opsObject

Properties

NameTypeDefaultDescription
ops.nationstringThe nation of ship.
ops.stringstringThe type of ship.
ops.optionsObjectOptions of query.
ops.options.limitnumber100The limit of ships finded.
ops.options.langstring"en"The Language of Texts.

WOTBTank

Kind: global class

wotbTank.get(tankID) ⇒ Promise.<(WOTBTankResolve|null)>

Get the tank by ID.

Kind: instance method of WOTBTank

ParamType
tankIDstring | number

WOTTank

Kind: global class

wotTank.find(type, nation, tier, options) ⇒ Promise.<(WOTTanksResolve|null)>

Get all tanks of parameters.

Kind: instance method of WOTTank
Returns: Promise.<(WOTTanksResolve|null)> - Returns all tanks finded.
Exemple: ...

const getTank = await .wot.tank.find('heavyTank')

ParamTypeDescription
typestringtype of tank.
nationWOTNationsThe nation of tank.
tierstringThe tier of tank.
optionsObjectThe options object.

Properties

NameTypeDefaultDescription
options.realmAllRealmsThe realm of query.
options.limitnumber100Limit of returned data.
options.langWOTLangsenThe language of Texts.

wotTank.get(tankID) ⇒ Promise.<(WOTTanksResolve|null)>

Get a tank by ID.

Kind: instance method of WOTTank
Returns: Promise.<(WOTTanksResolve|null)> - Object with Tank Data.

ParamTypeDescription
tankIDnumber | stringID of Tank.

Example

...
const tank = await .blitz.tank.get('ID of Tank')

WOTCTankopedia

Kind: global class

wotcTankopedia.search(options) ⇒ Promise.<(Array.<WOTCTank>|void)>

Method returns list of available vehicles.

Kind: instance method of WOTCTankopedia
Returns: Promise.<(Array.<WOTCTank>|void)> - An array with search data.

ParamDescription
optionsOptions Object

Properties

NameTypeDescription
options.languageAcceptedLangs | Array.<AcceptedLangs>Localization language.
options.nationAcceptedNations | Array.<AcceptedNations>Nation.
options.tank_idnumber | Array.<number>Vehicle ID.
options.tiernumber | Array.<number>Tier.

WOTBTournaments

Kind: global class

ParamTypeDefaultDescription
app_idstringThe ID of your WarGaming App.
realmstring"na"Server Location Not valid for World of Tanks Console (WOTC)..

wotbTournaments.find(options) ⇒ Promise.<(Array.<WOTBTournamentsSearch>|null)>

Search tournaments in API.

Kind: instance method of WOTBTournaments
Returns: Promise.<(Array.<WOTBTournamentsSearch>|null)> - The search data.

ParamTypeDescription
optionsObjectOptions Object

Properties

NameTypeDefaultDescription
options.languageAcceptedLanguagesWOTBTournaments | string"en"Localization language.
options.limitnumber10Number of returned entries. Min value is 1. Maximum value: 25.
options.searchstringFirst letters in tournament name for search. Minimum length: 2 characters. Maximum length: 50 characters.
options.statusStautsTournaments | Array.<StautsTournaments>Tournament status.

wotbTournaments.get(tourID, options) ⇒ Promise.<(WOTBTournamentsGet|null)>

Get a tournamente by ID.

Kind: instance method of WOTBTournaments
Returns: Promise.<(WOTBTournamentsGet|null)> - The tournament data.

ParamTypeDescription
tourIDstringTournament ID that can be retrieved from the find method.
optionsObjectThe Options Object

Properties

NameTypeDescription
options.languageAcceptedLanguagesWOTBTournaments | stringLocalization language.

wotbTournaments.getResult(tourID, options) ⇒ Promise.<(WOTBTourResult|null)>

Used to get the tournament result.

Kind: instance method of WOTBTournaments
Returns: Promise.<(WOTBTourResult|null)> - Tournament Result.

ParamTypeDescription
tourIDTournament ID that can be retrieved from the find method.
optionsObjectOptions Object

Properties

NameTypeDefaultDescription
languageAcceptedLanguagesWOTBTournamentsLocalization language.
limitnumber10Number of returned entries.
team_idstringTeam ID.

WOWSUser

Kind: global class

ParamTypeDefaultDescription
app_idstringThe ID of your WarGaming App.
realmstring"na"Server Location Not valid for World of Tanks Console (WOTC)..

wowsUser.search(userName) ⇒ Promise.<(Array.<UserSearchResolve>|null)>

Search users with respective name.

Kind: instance method of WOWSUser
Returns: Promise.<(Array.<UserSearchResolve>|null)> - Object Array with users data.

ParamTypeDescription
userNamestringName of user.

wowsUser.get(userID) ⇒ Promise.<(WOWSUserResolve|null)>

Get an user by ID.

Kind: instance method of WOWSUser
Returns: Promise.<(WOWSUserResolve|null)> - Object of user data.

ParamTypeDescription
userIDnumber | stringID of user.

wowsUser.achievements(account_id, options) ⇒ Promise.<({battle: any, progress: any}|null)>

Get all achievements of an user.

Kind: instance method of WOWSUser
Returns: Promise.<({battle: any, progress: any}|null)> - The achievements of user.

ParamTypeDescription
account_idPlayer account ID.
optionsObjectOptions Object

Properties

NameTypeDescription
options.languageAcceptedLangsLocalization language.

wowsUser.shipStats(account_id) ⇒ Promise.<(Array.<WOWSPediaResolve>|null)>

Get the ships status of an user.

Kind: instance method of WOWSUser

ParamTypeDescription
account_idstringthe ID of user.

Example

...
const ships = await <Warcord>.wows.user.shipStats('ID of User')

WOTBUser

Kind: global class

wotbUser.get(userID) ⇒ Promise.<(WOTBUserResolve|null)>

Get the user data by ID.

Kind: instance method of WOTBUser

ParamType
userIDstring | number

Example

...
const user = await <Warcord>.blitz.user.get('Wargaming ID of User')

wotbUser.search(userName) ⇒ Promise.<(UserSearchResolve|null)>

Get all users with the putted name.

Kind: instance method of WOTBUser

ParamType
userNamestring

Example

...
const searchingUser = await <Warcord>.blitz.user.search('Wargaming NickName of User')
//this returns an array of the users found.

const user = await <Warcord>.blitz.user.get(searchingUser[0].id)
//this returns the first user data.

wotbUser.topTanks(userID) ⇒ Promise.<(WOTBTankTop|null)>

Get the best 5 tanks of an user.

Kind: instance method of WOTBUser

ParamType
userIDstring | number

Example

...
const tank = await <Warcord>.blitz.user.topTanks('Wargaming ID of User')

WOTUser

Kind: global class

wotUser.search(userName, options) ⇒ Promise.<(Array.<UserSearchResolve>|null)>

Search users with respective name.

Kind: instance method of WOTUser
Returns: Promise.<(Array.<UserSearchResolve>|null)> - Object Array with users data.

ParamTypeDescription
userNamestringName of user.
optionsObjectOptions Object.

Properties

NameTypeDescription
options.realmAllRealmsThe realm of query.

Example

...
const searchingUser = await <Warcord>.wot.user.search('Wargaming NickName of User')
//this returns an array of the users found.

const user = await <Warcord>.wot.user.get(searchingUser[0].id)
//this returns the first user data.

wotUser.get(userID, options) ⇒ Promise.<(WOTUserResolve|null)>

Get an user by ID.

Kind: instance method of WOTUser
Returns: Promise.<(WOTUserResolve|null)> - Object of user data.

ParamTypeDescription
userIDnumber | stringID of user.
optionsObjectOptions Object.

Properties

NameTypeDescription
options.realmAllRealmsThe realm of query.

Example

...
const user = await <Warcord>.wot.user.get('Wargaming ID of User')

wotUser.topTanks(userID, options) ⇒ Promise.<(Array.<WOTTopTanksResolve>|null)>

Get the 5 best tanks of user.

Kind: instance method of WOTUser
Returns: Promise.<(Array.<WOTTopTanksResolve>|null)> - Object Array with tanks data.

ParamTypeDescription
userIDnumber | stringID of user.
optionsObjectOptions Object.

Properties

NameTypeDescription
options.realmAllRealmsThe realm of query.

Example

...
const topTanks = await <Warcord>.wot.user.topTanks('Wargaming ID of User')
2.0.0

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.2.8

2 years ago

0.1.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago