2024-01-14 13:59:54 +00:00
|
|
|
import AccountEndpoint from './Endpoints/AccountEndpoint'
|
2020-10-04 15:30:04 +00:00
|
|
|
import LeagueEndpoint from './Endpoints/LeagueEndpoint'
|
|
|
|
|
import MatchEndpoint from './Endpoints/MatchEndpoint'
|
|
|
|
|
import MatchlistEndpoint from './Endpoints/MatchlistEndpoint'
|
|
|
|
|
import SummonerEndpoint from './Endpoints/SummonerEndpoint'
|
|
|
|
|
import SpectatorEndpoint from './Endpoints/SpectatorEndpoint'
|
|
|
|
|
import CDragonEndpoint from './Endpoints/CDragonEndpoint'
|
|
|
|
|
import { JaxConfig } from '../JaxConfig'
|
2020-10-10 20:39:13 +00:00
|
|
|
import RiotRateLimiter from 'riot-ratelimiter'
|
|
|
|
|
import { STRATEGY } from 'riot-ratelimiter/dist/RateLimiter'
|
2021-09-20 17:20:51 +00:00
|
|
|
import MatchV4Endpoint from './Endpoints/MatchV4Endpoint'
|
|
|
|
|
import MatchlistV4Endpoint from './Endpoints/MatchlistV4Endpoint'
|
2020-10-04 15:30:04 +00:00
|
|
|
|
|
|
|
|
export default class Jax {
|
|
|
|
|
public key: string
|
|
|
|
|
public limiter: RiotRateLimiter
|
|
|
|
|
public config: JaxConfig
|
2024-01-14 13:59:54 +00:00
|
|
|
public Account: AccountEndpoint
|
2020-10-04 15:30:04 +00:00
|
|
|
public League: LeagueEndpoint
|
|
|
|
|
public Match: MatchEndpoint
|
2021-09-20 17:20:51 +00:00
|
|
|
public MatchV4: MatchV4Endpoint
|
2020-10-04 15:30:04 +00:00
|
|
|
public Matchlist: MatchlistEndpoint
|
2021-09-20 17:20:51 +00:00
|
|
|
public MatchlistV4: MatchlistV4Endpoint
|
2020-10-04 15:30:04 +00:00
|
|
|
public Spectator: SpectatorEndpoint
|
|
|
|
|
public Summoner: SummonerEndpoint
|
|
|
|
|
public CDragon: CDragonEndpoint
|
|
|
|
|
|
2021-09-20 17:20:51 +00:00
|
|
|
constructor(config: JaxConfig) {
|
2020-10-04 15:30:04 +00:00
|
|
|
this.key = config.key
|
2020-10-10 20:39:13 +00:00
|
|
|
// this.limiter = new RiotRateLimiter({
|
|
|
|
|
// debug: true,
|
|
|
|
|
// retryCount: 0,
|
|
|
|
|
// })
|
2020-10-04 15:30:04 +00:00
|
|
|
this.limiter = new RiotRateLimiter({
|
2020-10-10 20:39:13 +00:00
|
|
|
debug: false,
|
|
|
|
|
strategy: STRATEGY.SPREAD,
|
2020-10-04 15:30:04 +00:00
|
|
|
})
|
|
|
|
|
this.config = config
|
|
|
|
|
|
2024-01-14 13:59:54 +00:00
|
|
|
this.Account = new AccountEndpoint(this.config, this.limiter)
|
2020-10-04 15:30:04 +00:00
|
|
|
this.League = new LeagueEndpoint(this.config, this.limiter)
|
|
|
|
|
this.Match = new MatchEndpoint(this.config, this.limiter)
|
2021-09-20 17:20:51 +00:00
|
|
|
this.MatchV4 = new MatchV4Endpoint(this.config, this.limiter)
|
2020-10-04 15:30:04 +00:00
|
|
|
this.Matchlist = new MatchlistEndpoint(this.config, this.limiter)
|
2021-09-20 17:20:51 +00:00
|
|
|
this.MatchlistV4 = new MatchlistV4Endpoint(this.config, this.limiter)
|
2020-10-04 15:30:04 +00:00
|
|
|
this.Spectator = new SpectatorEndpoint(this.config, this.limiter)
|
|
|
|
|
this.Summoner = new SummonerEndpoint(this.config, this.limiter)
|
|
|
|
|
this.CDragon = new CDragonEndpoint(this.config)
|
|
|
|
|
}
|
|
|
|
|
}
|