Authentication Polling and Typed Requests
Pre-release
Pre-release
This is a pre-release for 5.x.x which features properly typed http requests for TypeScript and an option for polling the authentication function until a LeagueClientUx process has been found.
Added
request<T>will now properly return aResponse<T>whose.json()method will return aT.authenticatenow has options toawaitConnection, searching until a LeagueClientUx has been found.- Running the library in an environment which the LeagueClient cannot run on will now throw a
InvalidPlatformErrorupon calls toauthenticate.
Fixes
- Fixed a bug where LeagueWebSocket's subscriptions would attach twice upon registration
- Removed unnecessary
fs-extradependency
Breaking Changes
Credentialsinterface 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, thesubscriptionsproperty is a public.- The properly is no longer an object, the implementation now uses a Map.