- Released 0.10.1 features
broken as shown here: #79
- Add
apiURLPrefix
to config, which allows developers to set a URL for testing or update the URL when necessary (if lib hasn't been updated)
- (BREAKING) TypeScript: Rename all types named 'SomeObjectDto' -> 'SomeObjectDTO' to be consistent
- TypeScript: Add new DDragon typings
Fixes:
- Fix TS support by removing random DDragonRequest import in
index.d.ts
entry point
Removals:
- Deprecate position ranking-related endpoints as per Riot's instructions. Stay on v0.9.9 if you need time
Feats:
- Upgrade package.json requirements for
dotenv
,supports-color
, andlru-cache
Notes:
After releasing, I noticed that TS support is messed up because of a random JavaScript import, probably from my editor. This will be fixed in v0.9.11
.
Feats:
- Add
/lol/league/v4/entries/by-summoner/{encryptedSummonerId}
- Add
/lol/league/v4/entries/{queue}/{tier}/{division}
- Add typings for above
- Update DDragon endpoints to return
KaynDDragonRequest<any>
, which has basic typings
Notes:
- Did not remove other June 17th endpoints yet
Feats:
- Add
/lol/league/v4/positional-rank-queues
- Add
/lol/league/v4/positions/{positionalQueue}/{tier}/{division}/{position}/{page}
Fix:
- Remove no longer necessary deprecation warning
Fixes:
- Replace all V3 namespaces with V4 namespaces (while keeping the V4 namespaces)*
- Update typings
Notes:
- All previous namespaces now use the V4 namespaces, which means it won't break your code
- e.g.
kayn.Summoner
callskayn.SummonerV4
, andkayn.SummonerV4
still calls the V4 API
- e.g.
Fixes:
- Move V4 warning to
initLogger
- Hide "creating sync rate limiter" with updated
riot-ratelimiter-tmp
- Revert rate limiter dependency (downgrade) for now due to this issue
- Upgrade riot-rate-limiter fork
- Fixes hanging issue: Colorfulstan/RiotRateLimiter-node#13
- Also removes the "Creating sync ratelimiter..." messages that are meant for debug mode
- Update deprecation warning to 1/28/2019
- Upgrade TypeScript to latest (v3.2.2) and fix bindings for the upgrade
- Fix DDragonRequest case where a cache is not used and the version is unspecified / implicit
- Add
TournamentV4
andTournamentStubV4
- Add TypeScript bindings for V4 endpoints and finish up incomplete METHOD_NAMES
- Add
ChampionMasteriesV4
,LeagueV4
,MatchV4
,SpectatorV4
,SummonerV4
,ThirdPartyCodeV4
- No types
- No
TournamentStubV4
,TournamentV4
The above will be added in the next version! Just need to release the core endpoints first for everyone. :)
All the V3 endpoints still work until the deprecation date. Riot did not change the field names of accountId
and id
, even though they are encrypted, which makes the developer do less work fortunately.
I think the easiest thing most developers can do is updating all their summoner V3 objects to V4:
https://github.com/cnguy/kayn/blob/v4/examples/async.await/helper-for-updating-summoner-to-v4.js
This code uses a mock database to update a bunch of random summoners to V4, with their regions intact. Your database objects may be shaped differently, but the flow is probably somewhat similar.
- Updated the following packages:
debug
,dotenv
,superstruct
Does not affect kayn
in any noticeable way
- Add deprecation warnings regarding V3 endpoints on initialization
- Remove deprecated champion endpoints
- Add new namespace
Champion.Rotation
I made a mistake when I implemented the champion rotation endpoint. It's part of the champion endpoints and so it should have been under the Champion
namespace instead. However, I'll keep both for now since this isn't really a big deal.
- Types
- Regenerate dto typings (champion and static data dtos are removed)
- Remove extra champion endpoint typings and add
Champion.Rotation
typing
- Fixed bug regarding interaction between implicit versioning and helper methods such as
kayn.DDragon.Champion.listDataById()
- Add automatic version handling that works off your default region
- Add automatic version handling that can be extracted from the region passed to
region()
- Remove Static-related code from type definitions
- Throw an error if no
version
is provided toDDragon
data
methods (listing champions, runes,etc). This should help out users in case if they don't read all the docs
- Remove all static endpoints
- Add various new endpoints
DDragon.Champion.getDataById(championName: string)
DDragon.Champion.getDataByIdWithParentAsId(championName: string)
DDragon.Champion.listDataById()
DDragon.Champion.listDataByIdWithParentAsId()
DDragon.Champion.listFullDataById()
DDragon.Champion.listFullDataByIdWithParentAsId()
Given:
{
...
"data": {
...
"Aatrox": {
...
"id": "Aatrox",
"key": "266"
}
}
}
someFunctionDataById
changes the shape to:
{
...
"data": {
...
"Aatrox": {
...
"id": "266",
"key": "Aatrox"
}
}
}
while someFunctionDataByIdWithParentAsId
changes the shape to:
{
...
"data": {
...
"226": {
...
"id": "266",
"key": "Aatrox"
}
}
}
These functions are cached differently from the actual HTTP functions too.
- Add ChampionRotationEndpoint (no types yet; cache supported)
- Add deprecation warnings to ChampionEndpoint (get/list)
- Fix DDragon logging issues
- Add default
locale
option that can be passed to config - Add following DDragon methods, along with caching and debugging:
- Champion
- get
- list
- listFull
- Item
- list
- Language
- list
- LanguageString
- list
- Map
- list
- ProfileIcon
- list
- Realm
- list
- RunesReforged
- list
- SummonerSpell
- list
- Version
- list
- Champion
Things not handled yet:
Optional version via automatic versoin grabbing. Should respect cache optionsNot possible because regions can have different versions?- Tarball tgz or link (not sure what the use case is yet)
- Rune (do we need this anymore)
- Mastery (do we need this anymore)
- TS types (will be added in subsequent releases)
- cdn/Images? ddragon provides img urls too (is this necessary)
- Add deprecation warnings to static endpoint methods.
- (breaking) Make force-quitting application on 403 configurable.
Also set the default behavior from
true
tofalse
.
- Move typings into scope (some of the typings were declared outside of the actual 'kayn' module).
- Strengthen some typings while cleaning up others.
- (non-breaking) Replace Matchlist.Recent implementation with regular matchlist query.
- Allow more redis options by just passing the user-defined object straight into redis.createClient().
- Fixed BasicJSCache setting of expiry timers. I used seconds instead of milliseconds.
- Add lru-cache.
- kayn's errors now have an additional prop called 'error' that has the rest of the error object besides statusCode and url.
- Add static RunesReforged, RunePathsReforged, and TarballLinks endpoints, along with the type definitions.
- Add API deprecation endpoint to 'getting recent matchlist*. However, even after this officially gets deprecated on April 27th, 2018, the function will still be implemented via the 'get matchlist' endpoint.
- Add
cacheOptions.timeToLives.{useDefault, byGroup, byMethod}
.
- Remove Leagues.by.summoner related code.
- An error object as shown below is now returned instead of a single number.
{
statusCode: 42, // the error code
url: '', // the debug URL (works with and without showKey)
}
More information will be provided in the future if there is demand. The URL is quite important for debugging if the users do not want to run debug commands and see other debugging information (even if namespaced very specifically), so I'm releasing this first.
Migration
This part is simple. If you're in an environment where destructuring is supported, simply destructure the parameter while renaming the parameter to statusCode
.
oldErrorHandler(myCode) { /* do something with code */ }
// should become
newErrorHandler({ statusCode }) { /* statusCode is same as the parameter in `oldErrorHandler` */ }
// To then grab the URL for quick checking, you can then do:
finalErrorHandler({ statusCode, url }) {}
// Otherwise, if you can't destructure, just declare the variable you need at the top by accessing the object.
myOldErrorHandler(error) {
const myErrorCodeNumber = error.statusCode
/*
a lot of code blahblahblah
*/
const oldCodeThatHandlesError = doSomething(myErrorCodeNumber)
}
- Add
regionNoThrow
method. This is similar to.region()
except it does not throw and simply falls back to default on error (.region() falls back in this manner too).
- Loggers should not show key unless showKey=true.
- Move riot-ratelimiter fork dependency from GitHub to npm for obvious reasons. This is temporary!! TournamentStub/Tournament requests shouldn't throw JSON errors anymore, and existing methods should still work.
- Update TypeScript definitions via
yarn swagger
. Basically, the Tournament Params for summoner ids/participants were removed and replaced with a simple number array.
- Add CurrentGame to index.d.ts.
- index.d.ts Kayn class => KaynClass to avoid duplicate name error.
- make config optional.
- Add full DTOs using Swagger and Tournament-related methods.
- Add Match tournament related methods (Match.Tournament.get and Match.Tournament.listMatchIDs).
- Add tournament endpoints.
- Add logging config on init.
- Make logging outcoming requests more explicit (e.g. [GET], [POST]).
- Bad tournament endpoint implementations.
- Add
debug
for proper logging.
- Remove babel-polyfill, forcing users to use node with default async/await support (which might be recommended anyways?). I pretty much just have 1 async/await line, but who knows when I'll have more, so might as well get this fixed now.
- Upgrade riotratelimiter-node.
- Fixed
undefined
Redis setex() error when users did not pass in a TTL for a method and called that method.kayn
should simply not attempt to cache if the ttl is not > 0.
- Add ThirdPartyCode to TypeScript and remove Runes
- Remove Runes/Masteries endpoints
- Add Third Party Code endpoint
- Fix tests broken in 0.4.3 via DEEP merge. This makes the config always explicit as well. Read the commit message for more information.
- Skipped by accident. X)
- Add basic config validation
config.cache isn't checked, but everything else in the config is checked via superstruct.
- Promisify flushCache.
- Update
riot-ratelimiter
dependency.
- FIXED RedisCache [option Option] bug (setex).
- Add flushCache, check README#Caching
- Add burst functionality
requestOptions: {
shouldRetry: true,
burst: true,
}
- Encode Summoner.by.name values
- Fix the TypeScript METHOD_NAMES export
- This isn't backward compatible, but it's fine.
League.by.id
has been changed toLeague.by.uuid
. Now takes a string instead of an int of course.
- Minor TypeScript fixes
- Add basic TypeScript support
- Update dependencies
- RiotRateLimiter node from 0.0.7 to 0.0.9
- Use babel-present-env instead of babel-preset-es2015
- Implement
/lol/match/v3/matchlists/by-account/{accountId}
through Matchlist.recent(summonerID: int) - Implements
/lol/league/v3/leagues/{leagueID}
through League.by.id(leagueID: int)
Initial release