lol-js
Version:
Node.js bindings for the Riot API, with caching and rate limiting
66 lines (58 loc) • 1.74 kB
JavaScript
// Generated by CoffeeScript 1.9.2
(function() {
var api, assert, ld, matchApi, pb;
assert = require('assert');
ld = require('lodash');
pb = require('promise-breaker');
matchApi = require('./match');
api = exports.api = {
fullname: "team-v2.4",
name: "team",
version: "v2.4"
};
exports.methods = {
getTeamsBySummoner: pb["break"](function(region, summonerIds) {
return this._riotMultiGet(region, {
caller: "getTeamsBySummoner",
baseUrl: (this._makeUrl(region, api)) + "/by-summoner",
ids: summonerIds,
getCacheParamsFn: (function(client, region, summonerId) {
return {
key: api.fullname + "-teamsForSummonerId-" + region + "-" + summonerId,
api: api,
region: region,
objectType: 'teamsForSummonerId',
params: {
summonerId: summonerId
}
};
}),
maxObjs: 10
});
}),
getTeams: pb["break"](function(region, teamIds) {
return this._riotMultiGet(region, {
caller: "getTeams",
baseUrl: "" + (this._makeUrl(region, api)),
ids: teamIds,
getCacheParamsFn: (function(client, region, teamId) {
return {
key: api.fullname + "-team-" + region + "-" + teamId,
api: api,
region: region,
objectType: 'team',
params: {
teamId: teamId
}
};
}),
maxObjs: 10
});
}),
getTeam: pb["break"](function(region, teamId) {
return this.getTeams(region, [teamId]).then(function(answer) {
return answer != null ? answer[teamId] : void 0;
});
})
};
}).call(this);