junlarsen/league-connect
:electric_plug: Node.js HTTP/1.1, HTTP/2.0 and WebSocket interface to the League of Legends Client APIs
Query for the LeagueClientUx/RiotClient process is now done through Get-CimInstance instead of the deprecated WMIC. Thanks @Nerdsie (from #54)
Authentication is now possible through the RiotClient process. Available with an optional `name` field in the authenticate options. Thanks @andrewchae (from #51)
The league-connect authentication workflow will now use the official self-signed certificate provided by Riot. The certificates can be controlled through various options as outlined in the documentation. Thanks to @themaxdavitt for this feature in #44
The package didn't re-export the type definitions from its dependencies which meant that TypeScript users had to install `@types/ws` and `@types/node-fetch` themselves.
After detecting a client re-connect we didn't queue the listener again which meant the listener would stop working. Thanks to @zhaoyeming for finding this bug!
The ternary operator for inserting the body into the request was inverted so it was always undefined (lol) this has been fixed.
✨ Added
- `request<T>` will now properly return a `Response<T>` whose .json() method will return a `T` (typescript)
- `authenticate` now has options to `awaitConnection`, searching until a LeagueClientUx process has been found.
- Running the library on a platform the game doesn't support will now throw an `InvalidPlatformError` upon calls to `authenticate`
- `LeagueClient` is a new LeagueClientUx process lifecycle listener, detecting client shutdowns and startups
🐛 Fixes
- Fixed a bug where LeagueWebSocket's subscriptions would attach twice upon registration
- Removed unnecessary `fs-extra` dependency
💥 Breaking Changes
- These changes are not major, but it will end up breaking edge case usage.
- `Credentials`, the type returned from `authenticate` no longer returns the HTTP protocol used or the process name. These can always be assumed to be `"https"` and `"LeagueClientUx"`.
- This is because the new implementation uses the process command line arguments to retrieve password/port instead of the lockfile process. (see https://www.hextechdocs.dev/lol/lcuapi/6.getting-started-with-the-lcu-api#getting-the-port-number-and-the-password)
- LeagueWebSocket no longer has a `getListeners()` method, instead, the `subscriptions` property is now public.
- The property is no longer an object, the implementation now uses a `Map`.
✨ Added
- `LeagueClient` implementation for listening for client shutdown/startup
- `authenticate` will now return the PID of the LeagueClientUx process
Previously, the compiled typescript code wouldn't be pushed to npm. This has been fixed.
This release makes some internal code quality improvements as well as adding basic unit tests.
The initial release of the connector. Accidentally pushed wrong readmes to NPM which is why there's a version jump.
✨ Added
- `request<T>` will now properly return a `Response<T>` whose `.json()` method will return a `T`.
- `authenticate` now has options to `awaitConnection`, searching until a LeagueClientUx has been found.
- Running the library in an environment which the LeagueClient cannot run on will now throw a `InvalidPlatformError` upon calls to `authenticate`.
🐛 Fixes
- Fixed a bug where LeagueWebSocket's subscriptions would attach twice upon registration
- Removed unnecessary `fs-extra` dependency
💥 Breaking Changes
- `Credentials` interface no longer returns HTTP protocol, process pid or process name.
- This is because the new implementation uses the process command line arguments to retrieve password/port instead of the lockfile process. (see https://www.hextechdocs.dev/lol/lcuapi/6.getting-started-with-the-lcu-api#getting-the-port-number-and-the-password)
- LeagueWebSocket no longer has a `getListeners()` method, instead, the `subscriptions` property is a public.
- The properly is no longer an object, the implementation now uses a Map.
📋 Changes
- `connect()` renamed to `auth()`
- `getWebSocket` renamed to `connect()`
- `sendRequest` renamed to `request`
- Subscription to events via custom WebSocket
- `LeagueWebSocket.subscribe`
- `LeagueWebSocket.unsubscribe`
Rewritten entire library in typescript
