Installations
npm install galeforce-tmp-sea
Developer Guide
Typescript
Yes
Module System
CommonJS
Min. Node Version
>=14.0
Node Version
18.14.1
NPM Version
9.3.1
Score
57.3
Supply Chain
96.8
Quality
72.2
Maintenance
100
Vulnerability
85.9
License
Releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (66.12%)
JavaScript (33.88%)
Developer
Download Statistics
Total Downloads
1,288
Last Day
7
Last Week
254
Last Month
828
Last Year
935
GitHub Statistics
41 Stars
183 Commits
9 Forks
2 Watching
4 Branches
2 Contributors
Bundle Size
4.01 MB
Minified
1.06 MB
Minified + Gzipped
Package Meta Information
Latest Version
0.6.1
Package Id
galeforce-tmp-sea@0.6.1
Unpacked Size
486.58 kB
Size
81.60 kB
File Count
391
NPM Version
9.3.1
Node Version
18.14.1
Publised On
21 Feb 2023
Total Downloads
Cumulative downloads
Total Downloads
1,288
Last day
-95.7%
7
Compared to previous day
Last week
-54.9%
254
Compared to previous week
Last month
8,180%
828
Compared to previous month
Last year
164.9%
935
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Galeforce
A customizable, promise-based, and command-oriented TypeScript library and fluent interface for the Riot Games API.
Features
- Full API support for all Riot games, Data Dragon (LoL and LoR), and the Live Client Data API
- Environment variable config integration for API keys and other values on both the desktop and platforms including Heroku
- Customizable rate limiting with Redis clustering support and automated retries
- Fully-typed DTOs and parameters for all endpoints
- Fluent interface for seamless method chaining
- Built-in, informative debugging using
debug
Automatically-generated documentation is available here, and code examples can be found the section below.
Table of Contents
Examples
If you're using ES6/TypeScript, simply add
1import GaleforceModule from 'galeforce'; 2 3const galeforce = new GaleforceModule(/* config */);
to use the library. Or, if you're using CommonJS and require()
, add Galeforce to your project like this:
1const GaleforceModule = require('galeforce'); 2 3const galeforce = new GaleforceModule(/* config */);
Get summoner data for a list of summoners
1const summoners = ['a', 'b', 'c']; 2const promises = summoners.map(summoner => galeforce.lol.summoner() 3 .region(galeforce.region.lol.NORTH_AMERICA) 4 .name(summoner) 5 .exec() 6); // list of request promises 7Promise.all(promises).then((result) => { 8 console.log(result); // [{ name: 'a', ... }, ...] 9});
Get list of recent matchId values for a given puuid
1const matchIds = await galeforce.lol.match.list() 2 .region(galeforce.region.riot.AMERICAS) 3 .puuid(puuid) 4 .exec();
Get match data using await
1const matchData = await galeforce.lol.match.match() 2 .region(galeforce.region.riot.AMERICAS) 3 .matchId(matchId) 4 .exec();
Get total number of mastery points for a summoner
1const totalMasteryPoints = (await galeforce.lol.mastery.list() 2 .region(galeforce.region.lol.NORTH_AMERICA) 3 .summonerId(summonerId) 4 .exec()) 5 .reduce((previous, current) => previous + current.championPoints, 0);
Guide
Actions
Each endpoint in the Galeforce library is an instance of an Action
containing the following methods:
.exec()
Executes the
Action
with the parameters set by methods such as.region()
,.summonerId()
, etc., returning a Promise.Example
1/* Gets Valorant platform and status data. */ 2galeforce.val.status() // Target the /val/status/v1/platform-data endpoint 3 .region(galeforce.region.val.NORTH_AMERICA) // See below for documentation. 4 .exec() // Sends a Valorant server status request to the val-status-v1 endpoint 5 .then((data) => { // Use the returned data 6 /* manipulate status data */ 7 });
.URL()
Returns the endpoint URL associated with the
Action
and its previously-set parameters.Example
1/* Gets the Data Dragon URL associated with the Galeforce icon. */ 2const galeforceURL = galeforce.lol.ddragon.item.art() // Fetch item icon art from Data Dragon 3 .version('11.9.1') // See the .<property>() section for documentation. Sets the version to retrieve data from. 4 .assetId(6671) // See below for documentation. Get the icon for the Galeforce item. 5 .URL(); // Get the encoded URL corresponding with the selected endpoint as a string. 6 7console.log(galeforceURL); // 'https://ddragon.leagueoflegends.com/cdn/11.9.1/img/item/6671.png'
.<property>()
Sets the property (
region
,summonerId
,puuid
, etc.) in the Action request payload. Different methods are exposed for each endpoint depending on the required path, query, and body parameters.Example
1/* Gets current game info for a specific summonerId. */ 2const currentGameInfo = await galeforce.lol.spectator.active() // Target the /lol/spectator/v4/active-games/by-summoner/{summonerId} endpoint 3 .region(galeforce.region.lol.NORTH_AMERICA) // Sets the request region to 'na1' (i.e., target the NA server) 4 .summonerId('summonerId') // Sets the request summonerId to 'summonerId' 5 .exec(); // See .exec() above.
.<property>()
methods may only be called once and are removed from the Action after being used.1/* Gets current game info for a specific summonerId. */ 2const currentGameInfo = await galeforce.lol.spectator.active() // Target the /lol/spectator/v4/active-games/by-summoner/{summonerId} endpoint 3 .region(galeforce.region.lol.NORTH_AMERICA) // Sets the request region to 'na1' (i.e., target the NA server) 4 .region(galeforce.region.lol.KOREA) // galeforce.lol.spectator.active(...).region(...).region is not a function
.set()
Sets multiple properties (
region
,summonerId
,puuid
, etc.) in the Action request payload simultaneously.Example
1/* Gets league entries for a given Teamfight Tactics ranked league. */ 2const TFTLeagueInfo = await galeforce.tft.league.entries() // Target the /tft/league/v1/entries/{tier}/{division} endpoint 3 .set({ // Set multiple Action payload properties simultaneously 4 region: galeforce.region.lol.NORTH_AMERICA, // Sets the request region to 'na1' (i.e., target the NA server) 5 tier: galeforce.tier.DIAMOND, // Sets the request tier to 'DIAMOND' (i.e., search for players in Diamond) 6 division: galeforce.division.IV, // Sets the request division to 'IV' (i.e., search for players in division IV of their tier) 7 }) 8 .exec(); // See .exec() above.
Using DTOs
Galeforce includes DTOs for all Riot API responses as TypeScript interfaces. Although all actions already return an object typed with the corresponding DTO, these can be accessed explicitly via GaleforceModule.dto
or as another export:
1import GaleforceModule from 'galeforce'; 2 3const summonerData: GaleforceModule.dto.SummonerDTO = ... 4// get summoner data
1import GaleforceModule, { dto } from 'galeforce'; 2 3const summonerData: dto.SummonerDTO = ... 4// get summoner data
Config structure
When initializing Galeforce, a config object (JSON) or a path to a YAML file may optionally be passed to the GaleforceModule()
constructor as an argument:
1const galeforce = new GaleforceModule(/* optional config file path or object */);
Omitting the config will prevent Galeforce from being able to interface with the Riot Games API (as no API key will be specified), although Data Dragon and the Live Client Data API will still be available.
Template string-like values (such as ${RIOT_KEY}
) will be evaluated using environment variables in process.env
. The configuration file may contain any of the following structure (all top-level fields are optional):
1riot-api: 2 key: 'RGAPI-???' # (string) Your Riot API key from https://developer.riotgames.com 3rate-limit: 4 type: 'bottleneck' # (string) The type of rate limiter Galeforce should use ('bottleneck', 'null') 5 cache: 6 type: ${CACHE_TYPE} # (string) What kind of cache to use ('redis', 'internal') 7 uri: ${CACHE_URI} # (string) The cache URI to connect to (required for 'redis' cache) 8 key-id: 'galeforce' # (string) The key ID to use for rate-limiting keys in the Redis cache 9 options: 10 intervals: # (key <seconds>: value <number of requests>) Manually-set local rate limits, applied per region 11 120: 100 12 1: 20 13 max-concurrent: null # (null | number) The maximum number of concurrent requests allowed. Setting to null allows unlimited concurrent requests. 14 min-time: 0 # (number) The minimum amount of time between consecutive requests 15 retry-count-after-429: 3 # (number) The number of retry attempts after an HTTP 429 error is received, delayed by response header 16debug: [] # A list containing any of 'action', 'payload', 'rate-limit', 'riot-api', '*' (all)
Documentation
See here for further documentation and a complete list of methods.
Disclaimer
Galeforce isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing League of Legends. League of Legends and Riot Games are trademarks or registered trademarks of Riot Games, Inc. League of Legends © Riot Games, Inc.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0
Reason
SAST tool detected but not run on all commits
Details
- Info: SAST configuration detected: CodeQL
- Warn: 0 commits out of 3 are checked with a SAST tool
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codecov.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/b-cho/galeforce/codecov.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codecov.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/b-cho/galeforce/codecov.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/b-cho/galeforce/codeql-analysis.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/b-cho/galeforce/codeql-analysis.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/b-cho/galeforce/codeql-analysis.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:67: update your workflow using https://app.stepsecurity.io/secureworkflow/b-cho/galeforce/codeql-analysis.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/b-cho/galeforce/nodejs.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/b-cho/galeforce/nodejs.yml/master?enable=pin
- Info: 0 out of 8 GitHub-owned GitHubAction dependencies pinned
- Info: 2 out of 2 npmCommand dependencies pinned
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/28 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/codecov.yml:1
- Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1
- Warn: no topLevel permission defined: .github/workflows/nodejs.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
Project has not signed or included provenance with any releases.
Details
- Warn: release artifact v0.6.0 not signed: https://api.github.com/repos/b-cho/galeforce/releases/87343089
- Warn: release artifact v0.6.0 does not have provenance: https://api.github.com/repos/b-cho/galeforce/releases/87343089
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
11 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc
- Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp
- Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-f9xv-q969-pqx4
Score
3.1
/10
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More