diff --git a/.eslintignore b/.eslintignore index b512c09..db707b7 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,2 @@ -node_modules \ No newline at end of file +node_modules +eslint.config.mjs \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 16d5c48..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "root": true, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 2020, // Allows for the parsing of modern ECMAScript features - "sourceType": "module" // Allows for the use of imports - }, - "plugins": ["@typescript-eslint", "prettier"], - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:prettier/recommended" - ], - "rules": { - "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": ["error"] - } -} diff --git a/__tests__/e2e/match_v5.test.ts b/__tests__/e2e/match_v5.test.ts index 379b28c..ba1876d 100644 --- a/__tests__/e2e/match_v5.test.ts +++ b/__tests__/e2e/match_v5.test.ts @@ -4,6 +4,7 @@ import { PlatformId, RiotAPI } from "../../src/index"; jest.unmock("@fightmegg/riot-rate-limiter"); const riotAPIKey = process.env.X_RIOT_API_KEY || ""; +const puuid = process.env.PUUID || ""; describe("E2E", () => { describe("Match V5", () => { @@ -12,8 +13,7 @@ describe("E2E", () => { const resp = await rAPI.matchV5.getIdsByPuuid({ cluster: PlatformId.EUROPE, - puuid: - "8bJQbDi6uFIgefQA6Y79yxff_1bCHNopb1eHlq3p7Ic2oeXgYTvNnfGahtWyJ6qqAue3uK6wiZmMWQ", + puuid, params: { start: 0, count: 5, @@ -27,8 +27,7 @@ describe("E2E", () => { const matchIds = await rAPI.matchV5.getIdsByPuuid({ cluster: PlatformId.EUROPE, - puuid: - "8bJQbDi6uFIgefQA6Y79yxff_1bCHNopb1eHlq3p7Ic2oeXgYTvNnfGahtWyJ6qqAue3uK6wiZmMWQ", + puuid, params: { start: 0, count: 5, @@ -67,8 +66,7 @@ describe("E2E", () => { const matchIds = await rAPI.matchV5.getIdsByPuuid({ cluster: PlatformId.EUROPE, - puuid: - "8bJQbDi6uFIgefQA6Y79yxff_1bCHNopb1eHlq3p7Ic2oeXgYTvNnfGahtWyJ6qqAue3uK6wiZmMWQ", + puuid, params: { start: 0, count: 5, diff --git a/__tests__/e2e/summoner.test.ts b/__tests__/e2e/summoner.test.ts index cc9aff7..a9ca98f 100644 --- a/__tests__/e2e/summoner.test.ts +++ b/__tests__/e2e/summoner.test.ts @@ -4,22 +4,22 @@ import "jest-extended"; import { PlatformId, RiotAPI } from "../../src/index"; const riotAPIKey = process.env.X_RIOT_API_KEY || ""; +const puuid = process.env.PUUID || ""; describe("E2E", () => { describe("Summoner", () => { - test("getBySummonerName", async () => { + test("getByPUUID", async () => { const rAPI = new RiotAPI(riotAPIKey); - const resp = await rAPI.summoner.getBySummonerName({ + const resp = await rAPI.summoner.getByPUUID({ region: PlatformId.EUW1, - summonerName: "Demos Kratos", + puuid, }); - expect(resp.name).toEqual("Demos Kratos"); + expect(resp.puuid).toEqual(puuid); expect(resp).toContainAllKeys([ "id", "accountId", "puuid", - "name", "profileIconId", "revisionDate", "summonerLevel", diff --git a/__tests__/unit/cache.test.ts b/__tests__/unit/cache.test.ts index 2129262..36a792e 100644 --- a/__tests__/unit/cache.test.ts +++ b/__tests__/unit/cache.test.ts @@ -64,7 +64,7 @@ describe("Cache", () => { describe("RedisCache", () => { let redCache: RedisCache; - let mockedRedis = jest.mocked(Redis); + const mockedRedis = jest.mocked(Redis); beforeEach(() => { jest.clearAllMocks(); diff --git a/__tests__/unit/index.test.ts b/__tests__/unit/index.test.ts index 759c969..af0b9c9 100644 --- a/__tests__/unit/index.test.ts +++ b/__tests__/unit/index.test.ts @@ -81,19 +81,19 @@ describe("RiotAPI", () => { test("should call rrl.execute with URL & default options", async () => { const rAPI = new RiotAPI("1234"); const mockExecute = rAPI.riotRateLimiter.execute as jest.Mock; - mockExecute.mockResolvedValue({ name: "Demos Kratos" }); + mockExecute.mockResolvedValue({ puuid: "1234" }); await expect( rAPI.request( PlatformId.EUW1, - RiotAPITypes.METHOD_KEY.SUMMONER.GET_BY_SUMMONER_NAME, - { summonerName: "Demos" } + RiotAPITypes.METHOD_KEY.SUMMONER.GET_BY_PUUID, + { puuid: "1234" } ) - ).resolves.toEqual({ name: "Demos Kratos" }); + ).resolves.toEqual({ puuid: "1234" }); expect(mockExecute).toHaveBeenCalledWith( { - url: "https://euw1.api.riotgames.com/lol/summoner/v4/summoners/by-name/Demos", + url: "https://euw1.api.riotgames.com/lol/summoner/v4/summoners/by-puuid/1234", options: { body: undefined, headers: { "X-Riot-Token": "1234" }, @@ -111,14 +111,14 @@ describe("RiotAPI", () => { await rAPI.request( PlatformId.EUW1, - RiotAPITypes.METHOD_KEY.SUMMONER.GET_BY_SUMMONER_NAME, - { summonerName: "Demos" }, - { id: "10", params: { name: "kratos" } } + RiotAPITypes.METHOD_KEY.SUMMONER.GET_BY_PUUID, + { puuid: "1234" }, + { id: "10", params: { name: "5678" } } ); expect(mockExecute).toHaveBeenCalledWith( { - url: "https://euw1.api.riotgames.com/lol/summoner/v4/summoners/by-name/Demos?name=kratos", + url: "https://euw1.api.riotgames.com/lol/summoner/v4/summoners/by-puuid/1234?name=5678", options: expect.anything(), }, { @@ -133,16 +133,16 @@ describe("RiotAPI", () => { await rAPI.request( PlatformId.EUW1, - RiotAPITypes.METHOD_KEY.SUMMONER.GET_BY_SUMMONER_NAME, - { summonerName: "Demos" }, - { id: "10", body: { name: "kratos" }, method: "POST" } + RiotAPITypes.METHOD_KEY.SUMMONER.GET_BY_PUUID, + { puuid: "1234" }, + { id: "10", body: { name: "5678" }, method: "POST" } ); expect(mockExecute).toHaveBeenCalledWith( { - url: "https://euw1.api.riotgames.com/lol/summoner/v4/summoners/by-name/Demos", + url: "https://euw1.api.riotgames.com/lol/summoner/v4/summoners/by-puuid/1234", options: { - body: JSON.stringify({ name: "kratos" }), + body: JSON.stringify({ name: "5678" }), method: "POST", headers: expect.anything(), }, @@ -159,11 +159,11 @@ describe("RiotAPI", () => { await rAPI.request( PlatformId.EUW1, - RiotAPITypes.METHOD_KEY.SUMMONER.GET_BY_SUMMONER_NAME, - { summonerName: "Demos" }, + RiotAPITypes.METHOD_KEY.SUMMONER.GET_BY_PUUID, + { puuid: "1234" }, { id: "10", - body: { name: "kratos" }, + body: { name: "5678" }, method: "POST", headers: { Authorization: "me" }, } @@ -171,9 +171,9 @@ describe("RiotAPI", () => { expect(mockExecute).toHaveBeenCalledWith( { - url: "https://euw1.api.riotgames.com/lol/summoner/v4/summoners/by-name/Demos", + url: "https://euw1.api.riotgames.com/lol/summoner/v4/summoners/by-puuid/1234", options: { - body: JSON.stringify({ name: "kratos" }), + body: JSON.stringify({ name: "5678" }), method: "POST", headers: { Authorization: "me", @@ -192,8 +192,8 @@ describe("RiotAPI", () => { await rAPI.request( PlatformId.EUW1, - RiotAPITypes.METHOD_KEY.SUMMONER.GET_BY_SUMMONER_NAME, - { summonerName: "Demos" }, + RiotAPITypes.METHOD_KEY.SUMMONER.GET_BY_PUUID, + { puuid: "1234" }, { id: "10", priority: 0, expiration: 10 } ); @@ -210,26 +210,26 @@ describe("RiotAPI", () => { cacheType: "local", ttls: { byMethod: { - [RiotAPITypes.METHOD_KEY.SUMMONER.GET_BY_SUMMONER_NAME]: 10, + [RiotAPITypes.METHOD_KEY.SUMMONER.GET_BY_PUUID]: 10, }, }, }, }); const mockExecute = rAPI.riotRateLimiter.execute as jest.Mock; const mockCacheGet = (rAPI.cache?.get as jest.Mock) ?? jest.fn(); - mockCacheGet.mockResolvedValue({ name: "Demos Kratos" }); + mockCacheGet.mockResolvedValue({ puuid: "1234" }); await expect( rAPI.request( PlatformId.EUW1, - RiotAPITypes.METHOD_KEY.SUMMONER.GET_BY_SUMMONER_NAME, - { summonerName: "Demos" } + RiotAPITypes.METHOD_KEY.SUMMONER.GET_BY_PUUID, + { puuid: "1234" } ) - ).resolves.toEqual({ name: "Demos Kratos" }); + ).resolves.toEqual({ puuid: "1234" }); expect(mockExecute).not.toHaveBeenCalled(); expect(mockCacheGet).toHaveBeenCalledWith( - "https://euw1.api.riotgames.com/lol/summoner/v4/summoners/by-name/Demos" + "https://euw1.api.riotgames.com/lol/summoner/v4/summoners/by-puuid/1234" ); }); @@ -239,7 +239,7 @@ describe("RiotAPI", () => { cacheType: "local", ttls: { byMethod: { - [RiotAPITypes.METHOD_KEY.SUMMONER.GET_BY_SUMMONER_NAME]: 10, + [RiotAPITypes.METHOD_KEY.SUMMONER.GET_BY_PUUID]: 10, }, }, }, @@ -253,13 +253,13 @@ describe("RiotAPI", () => { await rAPI.request( PlatformId.EUW1, - RiotAPITypes.METHOD_KEY.SUMMONER.GET_BY_SUMMONER_NAME, - { summonerName: "Demos" } + RiotAPITypes.METHOD_KEY.SUMMONER.GET_BY_PUUID, + { puuid: "1234" } ); expect(mockCacheGet).toHaveBeenCalled(); expect(mockCacheSet).toHaveBeenCalledWith( - "https://euw1.api.riotgames.com/lol/summoner/v4/summoners/by-name/Demos", + "https://euw1.api.riotgames.com/lol/summoner/v4/summoners/by-puuid/1234", { name: "Demos Kratos" }, 10 ); @@ -406,16 +406,6 @@ describe("RiotAPI", () => { describe("clash", () => { test.each([ - [ - "getPlayersByPUUID", - { region: PlatformId.EUW1, puuid: "2" }, - [ - PlatformId.EUW1, - RiotAPITypes.METHOD_KEY.CLASH.GET_PLAYERS_BY_PUUID, - { puuid: "2" }, - { id: "euw1.clash.getPlayersByPUUID.2" }, - ], - ], [ "getPlayersBySummonerId", { region: PlatformId.EUW1, summonerId: "1" }, @@ -822,98 +812,6 @@ describe("RiotAPI", () => { ); }); - describe("match", () => { - test.each([ - [ - "getIdsByTournamentCode", - { - region: PlatformId.EUW1, - tournamentCode: "11", - }, - [ - PlatformId.EUW1, - RiotAPITypes.METHOD_KEY.MATCH.GET_IDS_BY_TOURNAMENT_CODE, - { tournamentCode: "11" }, - { - id: "euw1.match.getIdsByTournamentCode.11", - }, - ], - ], - [ - "getById", - { - region: PlatformId.EUW1, - matchId: 1, - }, - [ - PlatformId.EUW1, - RiotAPITypes.METHOD_KEY.MATCH.GET_MATCH_BY_ID, - { matchId: 1 }, - { - id: "euw1.match.getById.1", - }, - ], - ], - [ - "getByIdAndTournamentCode", - { - region: PlatformId.EUW1, - matchId: 1, - tournamentCode: "11", - }, - [ - PlatformId.EUW1, - RiotAPITypes.METHOD_KEY.MATCH.GET_MATCH_BY_ID_AND_TOURNAMENT_CODE, - { matchId: 1, tournamentCode: "11" }, - { - id: "euw1.match.getByIdAndTournamentCode.1.11", - }, - ], - ], - [ - "getMatchlistByAccount", - { - region: PlatformId.EUW1, - accountId: 1, - params: { champion: 1 }, - }, - [ - PlatformId.EUW1, - RiotAPITypes.METHOD_KEY.MATCH.GET_MATCHLIST_BY_ACCOUNT, - { accountId: 1 }, - { - id: "euw1.match.getMatchlistByAccount.1", - params: { champion: 1 }, - }, - ], - ], - [ - "getTimelineById", - { - region: PlatformId.EUW1, - matchId: 1, - }, - [ - PlatformId.EUW1, - RiotAPITypes.METHOD_KEY.MATCH.GET_TIMELINE_BY_MATCH_ID, - { matchId: 1 }, - { - id: "euw1.match.getTimelineById.1", - }, - ], - ], - ])( - "%s - calls request with correct params", - async (name, input, params) => { - const rAPI = new RiotAPI("1234"); - rAPI.request = jest.fn().mockResolvedValue(null); - - await getKeyValue(rAPI.match)(name as any)(input as any); - expect(rAPI.request).toHaveBeenCalledWith(...params); - } - ); - }); - describe("match_v5", () => { test.each([ [ @@ -1079,21 +977,6 @@ describe("RiotAPI", () => { }, ], ], - [ - "getBySummonerName", - { - region: PlatformId.EUW1, - summonerName: "Demos", - }, - [ - PlatformId.EUW1, - RiotAPITypes.METHOD_KEY.SUMMONER.GET_BY_SUMMONER_NAME, - { summonerName: "Demos" }, - { - id: "euw1.summoner.getBySummonerName.Demos", - }, - ], - ], [ "getByPUUID", { @@ -1341,21 +1224,6 @@ describe("RiotAPI", () => { }, ], ], - [ - "getBySummonerName", - { - region: PlatformId.EUW1, - summonerName: "Demos", - }, - [ - PlatformId.EUW1, - RiotAPITypes.METHOD_KEY.TFT_SUMMONER.GET_BY_SUMMONER_NAME, - { summonerName: "Demos" }, - { - id: "euw1.tftSummoner.getBySummonerName.Demos", - }, - ], - ], [ "getByAccessToken", { @@ -1414,230 +1282,6 @@ describe("RiotAPI", () => { ); }); - describe("thirdPartyCode", () => { - test.each([ - [ - "getBySummonerId", - { - region: PlatformId.EUW1, - summonerId: "1", - }, - [ - PlatformId.EUW1, - RiotAPITypes.METHOD_KEY.THIRD_PARTY_CODE.GET_BY_SUMMONER_ID, - { summonerId: "1" }, - { - id: "euw1.thirdPartyCode.getBySummonerId.1", - }, - ], - ], - ])( - "%s - calls request with correct params", - async (name, input, params) => { - const rAPI = new RiotAPI("1234"); - rAPI.request = jest.fn().mockResolvedValue(null); - - await getKeyValue(rAPI.thirdPartyCode)(name as any)(input as any); - expect(rAPI.request).toHaveBeenCalledWith(...params); - } - ); - }); - - describe("tournamentStub", () => { - test.each([ - [ - "createCodes", - { - params: { tournamentId: 22, count: 1 }, - body: { mapType: RiotAPITypes.Tournament.MAPTYPE.SUMMONERS_RIFT }, - }, - [ - PlatformId.AMERICAS, - RiotAPITypes.METHOD_KEY.TOURNAMENT_STUB.POST_CREATE_CODES, - {}, - { - id: "americas.tournamentStub.createCodes.22", - params: { tournamentId: 22, count: 1 }, - method: "POST", - body: { mapType: RiotAPITypes.Tournament.MAPTYPE.SUMMONERS_RIFT }, - }, - ], - ], - [ - "getLobbyEventsByTournamentCode", - { - tournamentCode: "1", - }, - [ - PlatformId.AMERICAS, - RiotAPITypes.METHOD_KEY.TOURNAMENT_STUB - .GET_LOBBY_EVENTS_BY_TOURNAMENT_CODE, - { tournamentCode: "1" }, - { - id: "americas.tournamentStub.getLobbyEventsByTournamentCode.1", - }, - ], - ], - [ - "createProvider", - { - body: { region: PlatformId.EUW1 }, - }, - [ - PlatformId.AMERICAS, - RiotAPITypes.METHOD_KEY.TOURNAMENT_STUB.POST_CREATE_PROVIDER, - {}, - { - id: "americas.tournamentStub.createProvider", - method: "POST", - body: { region: PlatformId.EUW1 }, - }, - ], - ], - [ - "createTournament", - { - body: { name: "test" }, - }, - [ - PlatformId.AMERICAS, - RiotAPITypes.METHOD_KEY.TOURNAMENT_STUB.POST_CREATE_TOURNAMENT, - {}, - { - id: "americas.tournamentStub.createTournament", - method: "POST", - body: { name: "test" }, - }, - ], - ], - ])( - "%s - calls request with correct params", - async (name, input, params) => { - const rAPI = new RiotAPI("1234"); - rAPI.request = jest.fn().mockResolvedValue(null); - - await getKeyValue(rAPI.tournamentStub)(name as any)(input as any); - expect(rAPI.request).toHaveBeenCalledWith(...params); - } - ); - }); - - describe("tournament", () => { - test.each([ - [ - "createCodes", - { - params: { tournamentId: 22, count: 1 }, - body: { mapType: RiotAPITypes.Tournament.MAPTYPE.SUMMONERS_RIFT }, - }, - [ - PlatformId.AMERICAS, - RiotAPITypes.METHOD_KEY.TOURNAMENT.POST_CREATE_CODES, - {}, - { - id: "americas.tournament.createCodes.22", - params: { tournamentId: 22, count: 1 }, - method: "POST", - body: { mapType: RiotAPITypes.Tournament.MAPTYPE.SUMMONERS_RIFT }, - priority: 0, - }, - ], - ], - [ - "getByTournamentCode", - { - tournamentCode: "1", - }, - [ - PlatformId.AMERICAS, - RiotAPITypes.METHOD_KEY.TOURNAMENT.GET_TOURNAMENT_BY_CODE, - { tournamentCode: "1" }, - { - id: "americas.tournament.getByTournamentCode.1", - priority: 0, - }, - ], - ], - [ - "updateByTournamentCode", - { - tournamentCode: "1", - body: { mapType: RiotAPITypes.Tournament.MAPTYPE.SUMMONERS_RIFT }, - }, - [ - PlatformId.AMERICAS, - RiotAPITypes.METHOD_KEY.TOURNAMENT.GET_TOURNAMENT_BY_CODE, - { tournamentCode: "1" }, - { - id: "americas.tournament.updateByTournamentCode.1", - method: "POST", - body: { mapType: RiotAPITypes.Tournament.MAPTYPE.SUMMONERS_RIFT }, - priority: 0, - }, - ], - ], - [ - "getLobbyEventsByTournamentCode", - { - tournamentCode: "1", - }, - [ - PlatformId.AMERICAS, - RiotAPITypes.METHOD_KEY.TOURNAMENT - .GET_LOBBY_EVENTS_BY_TOURNAMENT_CODE, - { tournamentCode: "1" }, - { - id: "americas.tournament.getLobbyEventsByTournamentCode.1", - priority: 0, - }, - ], - ], - [ - "createProvider", - { - body: { region: PlatformId.EUW1 }, - }, - [ - PlatformId.AMERICAS, - RiotAPITypes.METHOD_KEY.TOURNAMENT.POST_CREATE_PROVIDER, - {}, - { - id: "americas.tournament.createProvider", - method: "POST", - body: { region: PlatformId.EUW1 }, - priority: 0, - }, - ], - ], - [ - "createTournament", - { - body: { name: "test" }, - }, - [ - PlatformId.AMERICAS, - RiotAPITypes.METHOD_KEY.TOURNAMENT.POST_CREATE_TOURNAMENT, - {}, - { - id: "americas.tournament.createTournament", - method: "POST", - body: { name: "test" }, - priority: 0, - }, - ], - ], - ])( - "%s - calls request with correct params", - async (name, input, params) => { - const rAPI = new RiotAPI("1234"); - rAPI.request = jest.fn().mockResolvedValue(null); - - await getKeyValue(rAPI.tournament)(name as any)(input as any); - expect(rAPI.request).toHaveBeenCalledWith(...params); - } - ); - }); - describe("tournamentStub_V5", () => { test.each([ [ diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..d397600 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,29 @@ +import eslint from "@eslint/js"; +import tseslint from "typescript-eslint"; +import prettierConfig from "eslint-config-prettier"; + +export default tseslint.config( + eslint.configs.recommended, + ...tseslint.configs.recommendedTypeChecked, + prettierConfig, + { + languageOptions: { + parserOptions: { + project: true, + tsconfigRootDir: import.meta.dirname, + }, + }, + rules: { + "@typescript-eslint/no-unsafe-assignment": "warn", + "@typescript-eslint/no-explicit-any": "warn", + "@typescript-eslint/no-unsafe-member-access": "warn", + "@typescript-eslint/no-unsafe-return": "warn", + "@typescript-eslint/no-unsafe-argument": "warn", + "@typescript-eslint/no-unsafe-call": "warn", + "@typescript-eslint/no-namespace": "off", + "@typescript-eslint/require-await": "warn", + "@typescript-eslint/restrict-template-expressions": "warn", + "@typescript-eslint/no-base-to-string": "warn", + }, + } +); diff --git a/jest.config.ts b/jest.config.ts index 30f07e0..69213d7 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -1,6 +1,8 @@ import type { Config } from "@jest/types"; process.env.RIOT_LOL_API_KEY = "661771"; +process.env.PUUID = + "8bJQbDi6uFIgefQA6Y79yxff_1bCHNopb1eHlq3p7Ic2oeXgYTvNnfGahtWyJ6qqAue3uK6wiZmMWQ"; const config: Config.InitialOptions = { verbose: true, diff --git a/package-lock.json b/package-lock.json index 0372856..3b897e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,18 +9,18 @@ "version": "1.0.0", "license": "MIT", "dependencies": { - "@fightmegg/riot-rate-limiter": "^0.0.21", + "@fightmegg/riot-rate-limiter": "^0.0.22", "debug": "^4.3.4", - "ioredis": "^5.3.2", + "ioredis": "^5.4.1", "node-fetch": "^2.6.1", - "path-to-regexp": "^6.2.1" + "path-to-regexp": "^6.2.2" }, "devDependencies": { + "@eslint/js": "^8.57.0", + "@types/debug": "^4.1.12", "@types/jest": "^29.5.12", - "@types/node": "^20.11.24", + "@types/node": "^20.12.12", "@types/node-fetch": "^2.6.11", - "@typescript-eslint/eslint-plugin": "^7.1.0", - "@typescript-eslint/parser": "^7.1.0", "bottleneck": "^2.19.5", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", @@ -32,7 +32,8 @@ "prettier": "^3.2.5", "ts-jest": "^29.1.2", "ts-node": "^10.9.2", - "typescript": "^5.3.3" + "typescript": "^5.4.5", + "typescript-eslint": "^7.9.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -768,9 +769,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.9.1.tgz", - "integrity": "sha512-Y27x+MBLjXa+0JWDhykM3+JE+il3kHKAEqabfEWq3SDhZjLYb6/BHL/JKFnH3fe207JaXkyDo685Oc2Glt6ifA==", + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -809,15 +810,15 @@ } }, "node_modules/@fightmegg/riot-rate-limiter": { - "version": "0.0.21", - "resolved": "https://registry.npmjs.org/@fightmegg/riot-rate-limiter/-/riot-rate-limiter-0.0.21.tgz", - "integrity": "sha512-bO9cm+DeofRw6yRQ9XxaOonZyQYoaUyDMiGPNsunXSujO2ol9y5SQ/7olY+2jDlnrZshIlEL7CIiy7w3/4vf1A==", + "version": "0.0.22", + "resolved": "https://registry.npmjs.org/@fightmegg/riot-rate-limiter/-/riot-rate-limiter-0.0.22.tgz", + "integrity": "sha512-Ctr229opEyKaqtOIoNO11HDcfpIC0KGrFbkCakgr0ibQxJAVqFfstAFpksIcsh5K0E/RZc5C6WcBsy+0x19AMw==", "dependencies": { "bottleneck": "^2.19.5", "debug": "^4.3.4", - "ioredis": "^5.3.2", + "ioredis": "^5.4.1", "node-fetch": "^2.6.12", - "path-to-regexp": "^6.2.1" + "path-to-regexp": "^6.2.2" } }, "node_modules/@humanwhocodes/config-array": { @@ -1456,6 +1457,15 @@ "@babel/types": "^7.20.7" } }, + "node_modules/@types/debug": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", + "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", + "dev": true, + "dependencies": { + "@types/ms": "*" + } + }, "node_modules/@types/graceful-fs": { "version": "4.1.7", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.7.tgz", @@ -1509,16 +1519,16 @@ "pretty-format": "^29.0.0" } }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "node_modules/@types/ms": { + "version": "0.7.34", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz", + "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==", "dev": true }, "node_modules/@types/node": { - "version": "20.11.24", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", - "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "version": "20.12.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.12.tgz", + "integrity": "sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -1534,12 +1544,6 @@ "form-data": "^4.0.0" } }, - "node_modules/@types/semver": { - "version": "7.5.8", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", - "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", - "dev": true - }, "node_modules/@types/stack-utils": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", @@ -1562,25 +1566,23 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.1.0.tgz", - "integrity": "sha512-j6vT/kCulhG5wBmGtstKeiVr1rdXE4nk+DT1k6trYkwlrvW9eOF5ZbgKnd/YR6PcM4uTEXa0h6Fcvf6X7Dxl0w==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.9.0.tgz", + "integrity": "sha512-6e+X0X3sFe/G/54aC3jt0txuMTURqLyekmEHViqyA2VnxhLMpvA6nqmcjIy+Cr9tLDHPssA74BP5Mx9HQIxBEA==", "dev": true, "dependencies": { - "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "7.1.0", - "@typescript-eslint/type-utils": "7.1.0", - "@typescript-eslint/utils": "7.1.0", - "@typescript-eslint/visitor-keys": "7.1.0", - "debug": "^4.3.4", + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "7.9.0", + "@typescript-eslint/type-utils": "7.9.0", + "@typescript-eslint/utils": "7.9.0", + "@typescript-eslint/visitor-keys": "7.9.0", "graphemer": "^1.4.0", - "ignore": "^5.2.4", + "ignore": "^5.3.1", "natural-compare": "^1.4.0", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -1597,19 +1599,19 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.1.0.tgz", - "integrity": "sha512-V1EknKUubZ1gWFjiOZhDSNToOjs63/9O0puCgGS8aDOgpZY326fzFu15QAUjwaXzRZjf/qdsdBrckYdv9YxB8w==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.9.0.tgz", + "integrity": "sha512-qHMJfkL5qvgQB2aLvhUSXxbK7OLnDkwPzFalg458pxQgfxKDfT1ZDbHQM/I6mDIf/svlMkj21kzKuQ2ixJlatQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "7.1.0", - "@typescript-eslint/types": "7.1.0", - "@typescript-eslint/typescript-estree": "7.1.0", - "@typescript-eslint/visitor-keys": "7.1.0", + "@typescript-eslint/scope-manager": "7.9.0", + "@typescript-eslint/types": "7.9.0", + "@typescript-eslint/typescript-estree": "7.9.0", + "@typescript-eslint/visitor-keys": "7.9.0", "debug": "^4.3.4" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -1625,16 +1627,16 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.1.0.tgz", - "integrity": "sha512-6TmN4OJiohHfoOdGZ3huuLhpiUgOGTpgXNUPJgeZOZR3DnIpdSgtt83RS35OYNNXxM4TScVlpVKC9jyQSETR1A==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.9.0.tgz", + "integrity": "sha512-ZwPK4DeCDxr3GJltRz5iZejPFAAr4Wk3+2WIBaj1L5PYK5RgxExu/Y68FFVclN0y6GGwH8q+KgKRCvaTmFBbgQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.1.0", - "@typescript-eslint/visitor-keys": "7.1.0" + "@typescript-eslint/types": "7.9.0", + "@typescript-eslint/visitor-keys": "7.9.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -1642,18 +1644,18 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.1.0.tgz", - "integrity": "sha512-UZIhv8G+5b5skkcuhgvxYWHjk7FW7/JP5lPASMEUoliAPwIH/rxoUSQPia2cuOj9AmDZmwUl1usKm85t5VUMew==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.9.0.tgz", + "integrity": "sha512-6Qy8dfut0PFrFRAZsGzuLoM4hre4gjzWJB6sUvdunCYZsYemTkzZNwF1rnGea326PHPT3zn5Lmg32M/xfJfByA==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "7.1.0", - "@typescript-eslint/utils": "7.1.0", + "@typescript-eslint/typescript-estree": "7.9.0", + "@typescript-eslint/utils": "7.9.0", "debug": "^4.3.4", - "ts-api-utils": "^1.0.1" + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -1669,12 +1671,12 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.1.0.tgz", - "integrity": "sha512-qTWjWieJ1tRJkxgZYXx6WUYtWlBc48YRxgY2JN1aGeVpkhmnopq+SUC8UEVGNXIvWH7XyuTjwALfG6bFEgCkQA==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.9.0.tgz", + "integrity": "sha512-oZQD9HEWQanl9UfsbGVcZ2cGaR0YT5476xfWE0oE5kQa2sNK2frxOlkeacLOTh9po4AlUT5rtkGyYM5kew0z5w==", "dev": true, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -1682,22 +1684,22 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.1.0.tgz", - "integrity": "sha512-k7MyrbD6E463CBbSpcOnwa8oXRdHzH1WiVzOipK3L5KSML92ZKgUBrTlehdi7PEIMT8k0bQixHUGXggPAlKnOQ==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.9.0.tgz", + "integrity": "sha512-zBCMCkrb2YjpKV3LA0ZJubtKCDxLttxfdGmwZvTqqWevUPN0FZvSI26FalGFFUZU/9YQK/A4xcQF9o/VVaCKAg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.1.0", - "@typescript-eslint/visitor-keys": "7.1.0", + "@typescript-eslint/types": "7.9.0", + "@typescript-eslint/visitor-keys": "7.9.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", - "minimatch": "9.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -1719,9 +1721,9 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -1734,21 +1736,18 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.1.0.tgz", - "integrity": "sha512-WUFba6PZC5OCGEmbweGpnNJytJiLG7ZvDBJJoUcX4qZYf1mGZ97mO2Mps6O2efxJcJdRNpqweCistDbZMwIVHw==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.9.0.tgz", + "integrity": "sha512-5KVRQCzZajmT4Ep+NEgjXCvjuypVvYHUW7RHlXzNPuak2oWpVoD1jf5xCP0dPAuNIchjC7uQyvbdaSTFaLqSdA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.12", - "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "7.1.0", - "@typescript-eslint/types": "7.1.0", - "@typescript-eslint/typescript-estree": "7.1.0", - "semver": "^7.5.4" + "@typescript-eslint/scope-manager": "7.9.0", + "@typescript-eslint/types": "7.9.0", + "@typescript-eslint/typescript-estree": "7.9.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -1759,16 +1758,16 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.1.0.tgz", - "integrity": "sha512-FhUqNWluiGNzlvnDZiXad4mZRhtghdoKW6e98GoEOYSu5cND+E39rG5KwJMUzeENwm1ztYBRqof8wMLP+wNPIA==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.9.0.tgz", + "integrity": "sha512-iESPx2TNLDNGQLyjKhUvIKprlP49XNEK+MvIf9nIO7ZZaZdbnfWKHnXAgufpxqfA0YryH8XToi4+CjBgVnFTSQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.1.0", - "eslint-visitor-keys": "^3.4.1" + "@typescript-eslint/types": "7.9.0", + "eslint-visitor-keys": "^3.4.3" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -3068,9 +3067,9 @@ } }, "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "dev": true, "engines": { "node": ">= 4" @@ -3137,9 +3136,9 @@ "dev": true }, "node_modules/ioredis": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.3.2.tgz", - "integrity": "sha512-1DKMMzlIHM02eBBVOFQ1+AolGjs6+xEcM4PDL7NqOS6szq7H9jSaEkIUH6/a5Hl241LzW6JLSiAbNvTQjUupUA==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.4.1.tgz", + "integrity": "sha512-2YZsvl7jopIa1gaePkeMtd9rAcSjOOjPtpcLlOeusyO+XH2SK5ZcT+UCrElPP+WVIInh2TzeI4XW9ENaSLVVHA==", "dependencies": { "@ioredis/commands": "^1.1.1", "cluster-key-slot": "^1.1.0", @@ -4072,18 +4071,6 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/make-dir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", @@ -4412,9 +4399,9 @@ "dev": true }, "node_modules/path-to-regexp": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz", - "integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==" + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.2.tgz", + "integrity": "sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==" }, "node_modules/path-type": { "version": "4.0.0", @@ -4784,13 +4771,10 @@ } }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -5056,9 +5040,9 @@ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, "node_modules/ts-api-utils": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.2.1.tgz", - "integrity": "sha512-RIYA36cJn2WiH9Hy77hdF9r7oEwxAtB/TS9/S4Qd90Ap4z5FSiin5zEiTL44OII1Y3IIlEvxwxFUVgrHSZ/UpA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", "dev": true, "engines": { "node": ">=16" @@ -5193,9 +5177,9 @@ } }, "node_modules/typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -5205,6 +5189,32 @@ "node": ">=14.17" } }, + "node_modules/typescript-eslint": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-7.9.0.tgz", + "integrity": "sha512-7iTn9c10teHHCys5Ud/yaJntXZrjt3h2mrx3feJGBOLgQkF3TB1X89Xs3aVQ/GgdXRAXpk2bPTdpRwHP4YkUow==", + "dev": true, + "dependencies": { + "@typescript-eslint/eslint-plugin": "7.9.0", + "@typescript-eslint/parser": "7.9.0", + "@typescript-eslint/utils": "7.9.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", @@ -5368,12 +5378,6 @@ "node": ">=10" } }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", diff --git a/package.json b/package.json index bf8e6f1..3a4ee13 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "test": "jest __tests__/unit", "version": "npm run build", "build": "tsc && tsc -p ./tsconfig.cjs.json", - "lint": "eslint ./src/ --ext .ts --quiet", + "lint": "eslint ./src/", "prettier": "prettier ./src/**/*.ts --check" }, "repository": { @@ -30,18 +30,18 @@ }, "homepage": "https://github.com/fightmegg/riot-api#readme", "dependencies": { - "@fightmegg/riot-rate-limiter": "^0.0.21", + "@fightmegg/riot-rate-limiter": "^0.0.22", "debug": "^4.3.4", - "ioredis": "^5.3.2", + "ioredis": "^5.4.1", "node-fetch": "^2.6.1", - "path-to-regexp": "^6.2.1" + "path-to-regexp": "^6.2.2" }, "devDependencies": { + "@eslint/js": "^8.57.0", + "@types/debug": "^4.1.12", "@types/jest": "^29.5.12", - "@types/node": "^20.11.24", + "@types/node": "^20.12.12", "@types/node-fetch": "^2.6.11", - "@typescript-eslint/eslint-plugin": "^7.1.0", - "@typescript-eslint/parser": "^7.1.0", "bottleneck": "^2.19.5", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", @@ -53,6 +53,7 @@ "prettier": "^3.2.5", "ts-jest": "^29.1.2", "ts-node": "^10.9.2", - "typescript": "^5.3.3" + "typescript": "^5.4.5", + "typescript-eslint": "^7.9.0" } } diff --git a/src/@types/index.ts b/src/@types/index.ts index cf1bf6c..3646785 100644 --- a/src/@types/index.ts +++ b/src/@types/index.ts @@ -144,7 +144,6 @@ export namespace RiotAPITypes { export const GET_CHAMPION_ROTATIONS = "CHAMPION.GET_CHAMPION_ROTATIONS"; } export namespace CLASH { - export const GET_PLAYERS_BY_PUUID = "CLASH.GET_PLAYERS_BY_PUUID"; export const GET_PLAYERS_BY_SUMMONER = "CLASH.GET_PLAYERS_BY_SUMMONER"; export const GET_TEAM = "CLASH.GET_TEAM"; export const GET_TOURNAMENTS = "CLASH.GET_TOURNAMENTS"; @@ -193,15 +192,7 @@ export namespace RiotAPITypes { export namespace LOR_RANKED { export const GET_MASTER_TIER = "LOR_RANKED.GET_MASTER_TIER"; } - export namespace MATCH { - export const GET_IDS_BY_TOURNAMENT_CODE = - "MATCH.GET_IDS_BY_TOURNAMENT_CODE"; - export const GET_MATCH_BY_ID = "MATCH.GET_MATCH_BY_ID"; - export const GET_MATCH_BY_ID_AND_TOURNAMENT_CODE = - "MATCH.GET_MATCH_BY_ID_AND_TOURNAMENT_CODE"; - export const GET_MATCHLIST_BY_ACCOUNT = "MATCH.GET_MATCHLIST_BY_ACCOUNT"; - export const GET_TIMELINE_BY_MATCH_ID = "MATCH.GET_TIMELINE_BY_MATCH_ID"; - } + export namespace MATCH_V5 { export const GET_IDS_BY_PUUID = "MATCH_V5.GET_IDS_BY_PUUID"; export const GET_MATCH_BY_ID = "MATCH_V5.GET_MATCH_BY_ID"; @@ -216,7 +207,6 @@ export namespace RiotAPITypes { export namespace SUMMONER { export const GET_BY_RSO_PUUID = "SUMMONER.GET_BY_RSO_PUUID"; export const GET_BY_ACCOUNT_ID = "SUMMONER.GET_BY_ACCOUNT_ID"; - export const GET_BY_SUMMONER_NAME = "SUMMONER.GET_BY_SUMMONER_NAME"; export const GET_BY_PUUID = "SUMMONER.GET_BY_PUUID"; export const GET_BY_SUMMONER_ID = "SUMMONER.GET_BY_SUMMONER_ID"; export const GET_BY_ACCESS_TOKEN = "SUMMONER.GET_BY_ACCESS_TOKEN"; @@ -238,23 +228,10 @@ export namespace RiotAPITypes { } export namespace TFT_SUMMONER { export const GET_BY_ACCOUNT_ID = "TFT_SUMMONER.GET_BY_ACCOUNT_ID"; - export const GET_BY_SUMMONER_NAME = "TFT_SUMMONER.GET_BY_SUMMONER_NAME"; export const GET_BY_ACCESS_TOKEN = "TFT_SUMMONER.GET_BY_ACCESS_TOKEN"; export const GET_BY_PUUID = "TFT_SUMMONER.GET_BY_PUUID"; export const GET_BY_SUMMONER_ID = "TFT_SUMMONER.GET_BY_SUMMONER_ID"; } - export namespace THIRD_PARTY_CODE { - export const GET_BY_SUMMONER_ID = "THIRD_PARTY_CODE.GET_BY_SUMMONER_ID"; - } - export namespace TOURNAMENT_STUB { - export const POST_CREATE_CODES = "TOURNAMENT_STUB.POST_CREATE_CODES"; - export const GET_LOBBY_EVENTS_BY_TOURNAMENT_CODE = - "TOURNAMENT_STUB.GET_LOBBY_EVENTS_BY_TOURNAMENT_CODE"; - export const POST_CREATE_PROVIDER = - "TOURNAMENT_STUB.POST_CREATE_PROVIDER"; - export const POST_CREATE_TOURNAMENT = - "TOURNAMENT_STUB.POST_CREATE_TOURNAMENT"; - } export namespace TOURNAMENT_STUB_V5 { export const POST_CREATE_CODES = "TOURNAMENT_STUB_V5.POST_CREATE_CODES"; @@ -268,16 +245,6 @@ export namespace RiotAPITypes { "TOURNAMENT_STUB_V5.POST_CREATE_TOURNAMENT"; } - export namespace TOURNAMENT { - export const POST_CREATE_CODES = "TOURNAMENT.POST_CREATE_CODES"; - export const GET_TOURNAMENT_BY_CODE = "TOURNAMENT.GET_TOURNAMENT_BY_CODE"; - export const PUT_TOURNAMENT_CODE = "TOURNAMENT.PUT_TOURNAMENT_CODE"; - export const GET_LOBBY_EVENTS_BY_TOURNAMENT_CODE = - "TOURNAMENT.GET_LOBBY_EVENTS_BY_TOURNAMENT_CODE"; - export const POST_CREATE_PROVIDER = "TOURNAMENT.POST_CREATE_PROVIDER"; - export const POST_CREATE_TOURNAMENT = "TOURNAMENT.POST_CREATE_TOURNAMENT"; - } - export namespace TOURNAMENT_V5 { export const POST_CREATE_CODES = "TOURNAMENT_V5.POST_CREATE_CODES"; export const GET_TOURNAMENT_BY_CODE = @@ -533,8 +500,8 @@ export namespace RiotAPITypes { deck_id: string; deck_code: string; factions: string[]; - game_outcome: "win" | "loss" | string; - order_of_play: 1 | 2 | number; + game_outcome: string; + order_of_play: number; } export interface MatchDTO { metadata: { @@ -2331,7 +2298,7 @@ export namespace RiotAPITypes { cooldown: number[]; cooldownBurn: string; cost: number[]; - datavalues: {}; + datavalues: object; effect: number[][]; effectBurn: string[]; vars: { @@ -2568,7 +2535,7 @@ export namespace RiotAPITypes { cooldown: number[]; cooldownBurn: string; cost: number[]; - datavalues: {}; + datavalues: object; effect: number[][]; effectBurn: string[]; vars: { diff --git a/src/index.ts b/src/index.ts index 65ca903..4b93eaa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -11,8 +11,9 @@ import qs from "querystring"; import { RiotAPITypes, Leaves } from "./@types"; import { MemoryCache, RedisCache } from "./cache"; import { DDragon } from "./ddragon"; +import debug from "debug"; -const debugCache = require("debug")("riotapi:cache"); +const debugCache = debug("riotapi:cache"); const createHost = compile(HOST, { encode: encodeURIComponent }); @@ -297,19 +298,6 @@ export class RiotAPI { get clash() { return { - getPlayersByPUUID: ({ - region, - puuid, - }: { - region: RiotAPITypes.LoLRegion; - puuid: string; - }): Promise => - this.request( - region, - RiotAPITypes.METHOD_KEY.CLASH.GET_PLAYERS_BY_PUUID, - { puuid }, - { id: `${region}.clash.getPlayersByPUUID.${puuid}` } - ), getPlayersBySummonerId: ({ region, summonerId, @@ -703,95 +691,6 @@ export class RiotAPI { }; } - get match() { - return { - getIdsByTournamentCode: ({ - region, - tournamentCode, - }: { - region: RiotAPITypes.LoLRegion; - tournamentCode: string; - }): Promise => - this.request( - region, - RiotAPITypes.METHOD_KEY.MATCH.GET_IDS_BY_TOURNAMENT_CODE, - { tournamentCode }, - { id: `${region}.match.getIdsByTournamentCode.${tournamentCode}` } - ), - getById: ({ - region, - matchId, - }: { - region: RiotAPITypes.LoLRegion; - matchId: number; - }): Promise => - this.request( - region, - RiotAPITypes.METHOD_KEY.MATCH.GET_MATCH_BY_ID, - { matchId }, - { id: `${region}.match.getById.${matchId}` } - ), - getByIdAndTournamentCode: ({ - region, - matchId, - tournamentCode, - }: { - region: RiotAPITypes.LoLRegion; - matchId: number; - tournamentCode: string; - }): Promise => - this.request( - region, - RiotAPITypes.METHOD_KEY.MATCH.GET_MATCH_BY_ID_AND_TOURNAMENT_CODE, - { matchId, tournamentCode }, - { - id: `${region}.match.getByIdAndTournamentCode.${matchId}.${tournamentCode}`, - } - ), - getMatchlistByAccount: ({ - region, - accountId, - params, - }: { - region: RiotAPITypes.LoLRegion; - accountId: string; - params?: { - champion?: number[]; - queue?: number[]; - season?: number[]; - endTime?: number; - beginTime?: number; - endIndex?: number; - beginIndex?: number; - }; - }): Promise => - this.request( - region, - RiotAPITypes.METHOD_KEY.MATCH.GET_MATCHLIST_BY_ACCOUNT, - { accountId }, - { - id: `${region}.match.getMatchlistByAccount.${accountId}`, - params, - } - ), - getTimelineById: ({ - region, - matchId, - }: { - region: RiotAPITypes.LoLRegion; - matchId: number; - }): Promise => - this.request( - region, - RiotAPITypes.METHOD_KEY.MATCH.GET_TIMELINE_BY_MATCH_ID, - { matchId }, - { - id: `${region}.match.getTimelineById.${matchId}`, - } - ), - }; - } - get matchV5() { return { getIdsByPuuid: ({ @@ -909,19 +808,6 @@ export class RiotAPI { { accountId }, { id: `${region}.summoner.getByAccountId.${accountId}` } ), - getBySummonerName: ({ - region, - summonerName, - }: { - region: RiotAPITypes.LoLRegion; - summonerName: string; - }): Promise => - this.request( - region, - RiotAPITypes.METHOD_KEY.SUMMONER.GET_BY_SUMMONER_NAME, - { summonerName }, - { id: `${region}.summoner.getBySummonerName.${summonerName}` } - ), getByPUUID: ({ region, puuid, @@ -1119,19 +1005,6 @@ export class RiotAPI { { accountId }, { id: `${region}.tftSummoner.getByAccountId.${accountId}` } ), - getBySummonerName: ({ - region, - summonerName, - }: { - region: RiotAPITypes.LoLRegion; - summonerName: string; - }): Promise => - this.request( - region, - RiotAPITypes.METHOD_KEY.TFT_SUMMONER.GET_BY_SUMMONER_NAME, - { summonerName }, - { id: `${region}.tftSummoner.getBySummonerName.${summonerName}` } - ), getByAccessToken: ({ region, accessToken, @@ -1177,201 +1050,6 @@ export class RiotAPI { }; } - get thirdPartyCode() { - return { - getBySummonerId: ({ - region, - summonerId, - }: { - region: RiotAPITypes.LoLRegion; - summonerId: string; - }): Promise => - this.request( - region, - RiotAPITypes.METHOD_KEY.THIRD_PARTY_CODE.GET_BY_SUMMONER_ID, - { summonerId }, - { id: `${region}.thirdPartyCode.getBySummonerId.${summonerId}` } - ), - }; - } - - get tournamentStub() { - return { - createCodes: ({ - params, - body, - }: { - params: { - count: number; - tournamentId: number; - }; - body: RiotAPITypes.Tournament.TournamentCodeParametersDTO; - }): Promise => - this.request( - PlatformId.AMERICAS, - RiotAPITypes.METHOD_KEY.TOURNAMENT_STUB.POST_CREATE_CODES, - {}, - { - id: `${PlatformId.AMERICAS}.tournamentStub.createCodes.${params.tournamentId}`, - params, - body, - method: "POST", - } - ), - getLobbyEventsByTournamentCode: ({ - tournamentCode, - }: { - tournamentCode: string; - }): Promise => - this.request( - PlatformId.AMERICAS, - RiotAPITypes.METHOD_KEY.TOURNAMENT_STUB - .GET_LOBBY_EVENTS_BY_TOURNAMENT_CODE, - { tournamentCode }, - { - id: `${PlatformId.AMERICAS}.tournamentStub.getLobbyEventsByTournamentCode.${tournamentCode}`, - } - ), - createProvider: ({ - body, - }: { - body: RiotAPITypes.Tournament.ProviderRegistrationParametersDTO; - }): Promise => - this.request( - PlatformId.AMERICAS, - RiotAPITypes.METHOD_KEY.TOURNAMENT_STUB.POST_CREATE_PROVIDER, - {}, - { - id: `${PlatformId.AMERICAS}.tournamentStub.createProvider`, - - body, - method: "POST", - } - ), - createTournament: ({ - body, - }: { - body: RiotAPITypes.Tournament.TournamentRegistrationParametersDTO; - }): Promise => - this.request( - PlatformId.AMERICAS, - RiotAPITypes.METHOD_KEY.TOURNAMENT_STUB.POST_CREATE_TOURNAMENT, - {}, - { - id: `${PlatformId.AMERICAS}.tournamentStub.createTournament`, - body, - method: "POST", - } - ), - }; - } - - get tournament() { - return { - createCodes: ({ - params, - body, - }: { - params: { - count: number; - tournamentId: number; - }; - body: RiotAPITypes.Tournament.TournamentCodeParametersDTO; - }): Promise => - this.request( - PlatformId.AMERICAS, - RiotAPITypes.METHOD_KEY.TOURNAMENT.POST_CREATE_CODES, - {}, - { - id: `${PlatformId.AMERICAS}.tournament.createCodes.${params.tournamentId}`, - priority: 0, - params, - body, - method: "POST", - } - ), - getByTournamentCode: ({ - tournamentCode, - }: { - tournamentCode: string; - }): Promise => - this.request( - PlatformId.AMERICAS, - RiotAPITypes.METHOD_KEY.TOURNAMENT.GET_TOURNAMENT_BY_CODE, - { tournamentCode }, - { - id: `${PlatformId.AMERICAS}.tournament.getByTournamentCode.${tournamentCode}`, - priority: 0, - } - ), - updateByTournamentCode: ({ - tournamentCode, - body, - }: { - tournamentCode: string; - body: RiotAPITypes.Tournament.TournamentCodeUpdateParametersDTO; - }): Promise => - this.request( - PlatformId.AMERICAS, - RiotAPITypes.METHOD_KEY.TOURNAMENT.GET_TOURNAMENT_BY_CODE, - { tournamentCode }, - { - id: `${PlatformId.AMERICAS}.tournament.updateByTournamentCode.${tournamentCode}`, - priority: 0, - body, - method: "POST", - } - ), - getLobbyEventsByTournamentCode: ({ - tournamentCode, - }: { - tournamentCode: string; - }): Promise => - this.request( - PlatformId.AMERICAS, - RiotAPITypes.METHOD_KEY.TOURNAMENT - .GET_LOBBY_EVENTS_BY_TOURNAMENT_CODE, - { tournamentCode }, - { - id: `${PlatformId.AMERICAS}.tournament.getLobbyEventsByTournamentCode.${tournamentCode}`, - priority: 0, - } - ), - createProvider: ({ - body, - }: { - body: RiotAPITypes.Tournament.ProviderRegistrationParametersDTO; - }): Promise => - this.request( - PlatformId.AMERICAS, - RiotAPITypes.METHOD_KEY.TOURNAMENT.POST_CREATE_PROVIDER, - {}, - { - id: `${PlatformId.AMERICAS}.tournament.createProvider`, - priority: 0, - body, - method: "POST", - } - ), - createTournament: ({ - body, - }: { - body: RiotAPITypes.Tournament.TournamentRegistrationParametersDTO; - }): Promise => - this.request( - PlatformId.AMERICAS, - RiotAPITypes.METHOD_KEY.TOURNAMENT.POST_CREATE_TOURNAMENT, - {}, - { - id: `${PlatformId.AMERICAS}.tournament.createTournament`, - priority: 0, - body, - method: "POST", - } - ), - }; - } - get tournamentStubV5() { return { createCodes: ({