uva-wrapper 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bun.lock +781 -0
- package/dist/account/index.d.ts +8 -0
- package/dist/account/index.js +13 -0
- package/dist/account/v1/getAccount.d.ts +16 -0
- package/dist/account/v1/getAccount.js +18 -0
- package/dist/account/v1/getAccountByPuuid.d.ts +16 -0
- package/dist/account/v1/getAccountByPuuid.js +18 -0
- package/dist/account/v1/index.d.ts +19 -0
- package/dist/account/v1/index.js +43 -0
- package/dist/account/v2/getAccount.d.ts +12 -0
- package/dist/account/v2/getAccount.js +18 -0
- package/dist/account/v2/getAccountByPuuid.d.ts +12 -0
- package/dist/account/v2/getAccountByPuuid.js +18 -0
- package/dist/account/v2/index.d.ts +19 -0
- package/dist/account/v2/index.js +43 -0
- package/dist/constants/api.const.d.ts +1 -0
- package/dist/constants/api.const.js +4 -0
- package/dist/crosshair/index.d.ts +6 -0
- package/dist/crosshair/index.js +11 -0
- package/dist/crosshair/v1/generateCrosshairImage.d.ts +1 -0
- package/dist/crosshair/v1/generateCrosshairImage.js +18 -0
- package/dist/crosshair/v1/index.d.ts +10 -0
- package/dist/crosshair/v1/index.js +29 -0
- package/dist/esports/index.d.ts +6 -0
- package/dist/esports/index.js +11 -0
- package/dist/esports/v1/getEsportsSchedule.d.ts +35 -0
- package/dist/esports/v1/getEsportsSchedule.js +18 -0
- package/dist/esports/v1/index.d.ts +11 -0
- package/dist/esports/v1/index.js +30 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +43 -0
- package/dist/leaderboard/index.d.ts +10 -0
- package/dist/leaderboard/index.js +15 -0
- package/dist/leaderboard/v1/getLeaderboard.d.ts +3 -0
- package/dist/leaderboard/v1/getLeaderboard.js +18 -0
- package/dist/leaderboard/v1/index.d.ts +13 -0
- package/dist/leaderboard/v1/index.js +32 -0
- package/dist/leaderboard/v2/getLeaderboard.d.ts +24 -0
- package/dist/leaderboard/v2/getLeaderboard.js +18 -0
- package/dist/leaderboard/v2/index.d.ts +14 -0
- package/dist/leaderboard/v2/index.js +33 -0
- package/dist/leaderboard/v3/getLeaderboard.d.ts +34 -0
- package/dist/leaderboard/v3/getLeaderboard.js +18 -0
- package/dist/leaderboard/v3/index.d.ts +23 -0
- package/dist/leaderboard/v3/index.js +35 -0
- package/dist/lib/request-handler.d.ts +4 -0
- package/dist/lib/request-handler.js +24 -0
- package/dist/match-details/index.d.ts +8 -0
- package/dist/match-details/index.js +13 -0
- package/dist/match-details/v2/getMatchDetails.d.ts +483 -0
- package/dist/match-details/v2/getMatchDetails.js +18 -0
- package/dist/match-details/v2/index.d.ts +10 -0
- package/dist/match-details/v2/index.js +29 -0
- package/dist/match-details/v4/getMatchDetails.d.ts +280 -0
- package/dist/match-details/v4/getMatchDetails.js +18 -0
- package/dist/match-details/v4/index.d.ts +11 -0
- package/dist/match-details/v4/index.js +30 -0
- package/dist/matches/index.d.ts +8 -0
- package/dist/matches/index.js +13 -0
- package/dist/matches/v3/getMatchesByName.d.ts +482 -0
- package/dist/matches/v3/getMatchesByName.js +22 -0
- package/dist/matches/v3/getMatchesByPuuid.d.ts +482 -0
- package/dist/matches/v3/getMatchesByPuuid.js +22 -0
- package/dist/matches/v3/index.d.ts +25 -0
- package/dist/matches/v3/index.js +49 -0
- package/dist/matches/v4/getMatchesByName.d.ts +280 -0
- package/dist/matches/v4/getMatchesByName.js +23 -0
- package/dist/matches/v4/getMatchesByPuuid.d.ts +280 -0
- package/dist/matches/v4/getMatchesByPuuid.js +23 -0
- package/dist/matches/v4/index.d.ts +29 -0
- package/dist/matches/v4/index.js +53 -0
- package/dist/misc/index.d.ts +6 -0
- package/dist/misc/index.js +11 -0
- package/dist/misc/v1/getContent.d.ts +124 -0
- package/dist/misc/v1/getContent.js +18 -0
- package/dist/misc/v1/getGameVersion.d.ts +10 -0
- package/dist/misc/v1/getGameVersion.js +18 -0
- package/dist/misc/v1/getQueueStatus.d.ts +48 -0
- package/dist/misc/v1/getQueueStatus.js +18 -0
- package/dist/misc/v1/getRawRiotAPIData.d.ts +1 -0
- package/dist/misc/v1/getRawRiotAPIData.js +21 -0
- package/dist/misc/v1/getStatus.d.ts +53 -0
- package/dist/misc/v1/getStatus.js +18 -0
- package/dist/misc/v1/getWebsiteContent.d.ts +11 -0
- package/dist/misc/v1/getWebsiteContent.js +18 -0
- package/dist/misc/v1/getWebsiteEntryById.d.ts +11 -0
- package/dist/misc/v1/getWebsiteEntryById.js +18 -0
- package/dist/misc/v1/index.d.ts +52 -0
- package/dist/misc/v1/index.js +101 -0
- package/dist/mmr/index.d.ts +10 -0
- package/dist/mmr/index.js +15 -0
- package/dist/mmr/v1/getMMRByName.d.ts +17 -0
- package/dist/mmr/v1/getMMRByName.js +18 -0
- package/dist/mmr/v1/getMMRByPuuid.d.ts +17 -0
- package/dist/mmr/v1/getMMRByPuuid.js +18 -0
- package/dist/mmr/v1/index.d.ts +19 -0
- package/dist/mmr/v1/index.js +43 -0
- package/dist/mmr/v2/getMMRByName.d.ts +28 -0
- package/dist/mmr/v2/getMMRByName.js +18 -0
- package/dist/mmr/v2/getMMRByPuuid.d.ts +28 -0
- package/dist/mmr/v2/getMMRByPuuid.js +18 -0
- package/dist/mmr/v2/index.d.ts +19 -0
- package/dist/mmr/v2/index.js +43 -0
- package/dist/mmr/v3/getMMRByName.d.ts +63 -0
- package/dist/mmr/v3/getMMRByName.js +18 -0
- package/dist/mmr/v3/getMMRByPuuid.d.ts +63 -0
- package/dist/mmr/v3/getMMRByPuuid.js +18 -0
- package/dist/mmr/v3/index.d.ts +21 -0
- package/dist/mmr/v3/index.js +45 -0
- package/dist/mmr-history/index.d.ts +8 -0
- package/dist/mmr-history/index.js +13 -0
- package/dist/mmr-history/v1/getMMRHistoryByName.d.ts +26 -0
- package/dist/mmr-history/v1/getMMRHistoryByName.js +18 -0
- package/dist/mmr-history/v1/getMMRHistoryByPuuid.d.ts +26 -0
- package/dist/mmr-history/v1/getMMRHistoryByPuuid.js +18 -0
- package/dist/mmr-history/v1/index.d.ts +25 -0
- package/dist/mmr-history/v1/index.js +43 -0
- package/dist/mmr-history/v2/getMMRHistoryByName.d.ts +29 -0
- package/dist/mmr-history/v2/getMMRHistoryByName.js +18 -0
- package/dist/mmr-history/v2/getMMRHistoryByPuuid.d.ts +29 -0
- package/dist/mmr-history/v2/getMMRHistoryByPuuid.js +18 -0
- package/dist/mmr-history/v2/index.d.ts +21 -0
- package/dist/mmr-history/v2/index.js +45 -0
- package/dist/premier/index.d.ts +6 -0
- package/dist/premier/index.js +11 -0
- package/dist/premier/v1/getPremierTeamById.d.ts +33 -0
- package/dist/premier/v1/getPremierTeamById.js +18 -0
- package/dist/premier/v1/getPremierTeamByName.d.ts +33 -0
- package/dist/premier/v1/getPremierTeamByName.js +18 -0
- package/dist/premier/v1/index.d.ts +30 -0
- package/dist/premier/v1/index.js +59 -0
- package/dist/premier/v1/searchPremierTeams.d.ts +23 -0
- package/dist/premier/v1/searchPremierTeams.js +18 -0
- package/dist/premier-history/index.d.ts +6 -0
- package/dist/premier-history/index.js +11 -0
- package/dist/premier-history/v1/getPremierTeamHistoryById.d.ts +17 -0
- package/dist/premier-history/v1/getPremierTeamHistoryById.js +18 -0
- package/dist/premier-history/v1/getPremierTeamHistoryByName.d.ts +17 -0
- package/dist/premier-history/v1/getPremierTeamHistoryByName.js +18 -0
- package/dist/premier-history/v1/index.d.ts +19 -0
- package/dist/premier-history/v1/index.js +43 -0
- package/dist/premier-leaderboard/index.d.ts +6 -0
- package/dist/premier-leaderboard/index.js +11 -0
- package/dist/premier-leaderboard/v1/getPremierLeaderboard.d.ts +23 -0
- package/dist/premier-leaderboard/v1/getPremierLeaderboard.js +18 -0
- package/dist/premier-leaderboard/v1/index.d.ts +13 -0
- package/dist/premier-leaderboard/v1/index.js +32 -0
- package/dist/premium/index.d.ts +6 -0
- package/dist/premium/index.js +11 -0
- package/dist/premium/v1/addPremiumWebhookUser.d.ts +19 -0
- package/dist/premium/v1/addPremiumWebhookUser.js +21 -0
- package/dist/premium/v1/deletePremiumWebhookUser.d.ts +4 -0
- package/dist/premium/v1/deletePremiumWebhookUser.js +18 -0
- package/dist/premium/v1/getPremiumWebhookSettings.d.ts +1 -0
- package/dist/premium/v1/getPremiumWebhookSettings.js +18 -0
- package/dist/premium/v1/index.d.ts +34 -0
- package/dist/premium/v1/index.js +66 -0
- package/dist/premium/v1/updatePremiumWebhookUser.d.ts +1 -0
- package/dist/premium/v1/updatePremiumWebhookUser.js +18 -0
- package/dist/store/getFeaturedStoreItems.d.ts +53 -0
- package/dist/store/getFeaturedStoreItems.js +18 -0
- package/dist/store/getStoreOffers.d.ts +30 -0
- package/dist/store/getStoreOffers.js +18 -0
- package/dist/store/index.d.ts +16 -0
- package/dist/store/index.js +40 -0
- package/dist/stored-matches/index.d.ts +6 -0
- package/dist/stored-matches/index.js +11 -0
- package/dist/stored-matches/v1/getStoredMatchesByName.d.ts +56 -0
- package/dist/stored-matches/v1/getStoredMatchesByName.js +18 -0
- package/dist/stored-matches/v1/getStoredMatchesByPuuid.d.ts +56 -0
- package/dist/stored-matches/v1/getStoredMatchesByPuuid.js +18 -0
- package/dist/stored-matches/v1/index.d.ts +41 -0
- package/dist/stored-matches/v1/index.js +49 -0
- package/dist/stored-mmr-history/index.d.ts +8 -0
- package/dist/stored-mmr-history/index.js +13 -0
- package/dist/stored-mmr-history/v1/getStoredMMRHistoryByName.d.ts +28 -0
- package/dist/stored-mmr-history/v1/getStoredMMRHistoryByName.js +18 -0
- package/dist/stored-mmr-history/v1/getStoredMMRHistoryByPuuid.d.ts +28 -0
- package/dist/stored-mmr-history/v1/getStoredMMRHistoryByPuuid.js +18 -0
- package/dist/stored-mmr-history/v1/index.d.ts +37 -0
- package/dist/stored-mmr-history/v1/index.js +45 -0
- package/dist/stored-mmr-history/v2/getStoredMMRHistoryByName.d.ts +30 -0
- package/dist/stored-mmr-history/v2/getStoredMMRHistoryByName.js +18 -0
- package/dist/stored-mmr-history/v2/getStoredMMRHistoryByPuuid.d.ts +30 -0
- package/dist/stored-mmr-history/v2/getStoredMMRHistoryByPuuid.js +18 -0
- package/dist/stored-mmr-history/v2/index.d.ts +39 -0
- package/dist/stored-mmr-history/v2/index.js +47 -0
- package/dist/types/response.type.d.ts +15 -0
- package/dist/types/response.type.js +2 -0
- package/dist/vlr/index.d.ts +6 -0
- package/dist/vlr/index.js +11 -0
- package/dist/vlr/v2/getVlrEsportsEvents.d.ts +14 -0
- package/dist/vlr/v2/getVlrEsportsEvents.js +18 -0
- package/dist/vlr/v2/getVlrEventMatches.d.ts +14 -0
- package/dist/vlr/v2/getVlrEventMatches.js +18 -0
- package/dist/vlr/v2/getVlrMatchDetails.d.ts +157 -0
- package/dist/vlr/v2/getVlrMatchDetails.js +18 -0
- package/dist/vlr/v2/getVlrPlayer.d.ts +64 -0
- package/dist/vlr/v2/getVlrPlayer.js +18 -0
- package/dist/vlr/v2/getVlrPlayerMatches.d.ts +22 -0
- package/dist/vlr/v2/getVlrPlayerMatches.js +20 -0
- package/dist/vlr/v2/getVlrTeam.d.ts +39 -0
- package/dist/vlr/v2/getVlrTeam.js +18 -0
- package/dist/vlr/v2/getVlrTeamMatches.d.ts +20 -0
- package/dist/vlr/v2/getVlrTeamMatches.js +20 -0
- package/dist/vlr/v2/getVlrTeamTransactions.d.ts +14 -0
- package/dist/vlr/v2/getVlrTeamTransactions.js +18 -0
- package/dist/vlr/v2/index.d.ts +57 -0
- package/dist/vlr/v2/index.js +111 -0
- package/package.json +36 -0
- package/src/account/index.ts +12 -0
- package/src/account/v1/getAccount.ts +31 -0
- package/src/account/v1/getAccountByPuuid.ts +30 -0
- package/src/account/v1/index.ts +27 -0
- package/src/account/v2/getAccount.ts +27 -0
- package/src/account/v2/getAccountByPuuid.ts +26 -0
- package/src/account/v2/index.ts +27 -0
- package/src/constants/api.const.ts +1 -0
- package/src/crosshair/index.ts +9 -0
- package/src/crosshair/v1/generateCrosshairImage.ts +10 -0
- package/src/crosshair/v1/index.ts +14 -0
- package/src/esports/index.ts +9 -0
- package/src/esports/v1/getEsportsSchedule.ts +49 -0
- package/src/esports/v1/index.ts +15 -0
- package/src/index.ts +57 -0
- package/src/leaderboard/index.ts +15 -0
- package/src/leaderboard/v1/getLeaderboard.ts +17 -0
- package/src/leaderboard/v1/index.ts +17 -0
- package/src/leaderboard/v2/getLeaderboard.ts +40 -0
- package/src/leaderboard/v2/index.ts +31 -0
- package/src/leaderboard/v3/getLeaderboard.ts +57 -0
- package/src/leaderboard/v3/index.ts +37 -0
- package/src/lib/request-handler.ts +29 -0
- package/src/match-details/index.ts +12 -0
- package/src/match-details/v2/getMatchDetails.ts +495 -0
- package/src/match-details/v2/index.ts +14 -0
- package/src/match-details/v4/getMatchDetails.ts +294 -0
- package/src/match-details/v4/index.ts +15 -0
- package/src/matches/index.ts +12 -0
- package/src/matches/v3/getMatchesByName.ts +508 -0
- package/src/matches/v3/getMatchesByPuuid.ts +507 -0
- package/src/matches/v3/index.ts +61 -0
- package/src/matches/v4/getMatchesByName.ts +305 -0
- package/src/matches/v4/getMatchesByPuuid.ts +304 -0
- package/src/matches/v4/index.ts +73 -0
- package/src/misc/index.ts +9 -0
- package/src/misc/v1/getContent.ts +133 -0
- package/src/misc/v1/getGameVersion.ts +19 -0
- package/src/misc/v1/getQueueStatus.ts +57 -0
- package/src/misc/v1/getRawRiotAPIData.ts +20 -0
- package/src/misc/v1/getStatus.ts +62 -0
- package/src/misc/v1/getWebsiteContent.ts +24 -0
- package/src/misc/v1/getWebsiteEntryById.ts +24 -0
- package/src/misc/v1/index.ts +93 -0
- package/src/mmr/index.ts +15 -0
- package/src/mmr/v1/getMMRByName.ts +31 -0
- package/src/mmr/v1/getMMRByPuuid.ts +30 -0
- package/src/mmr/v1/index.ts +27 -0
- package/src/mmr/v2/getMMRByName.ts +42 -0
- package/src/mmr/v2/getMMRByPuuid.ts +41 -0
- package/src/mmr/v2/index.ts +27 -0
- package/src/mmr/v3/getMMRByName.ts +72 -0
- package/src/mmr/v3/getMMRByPuuid.ts +71 -0
- package/src/mmr/v3/index.ts +34 -0
- package/src/mmr-history/index.ts +12 -0
- package/src/mmr-history/v1/getMMRHistoryByName.ts +42 -0
- package/src/mmr-history/v1/getMMRHistoryByPuuid.ts +41 -0
- package/src/mmr-history/v1/index.ts +27 -0
- package/src/mmr-history/v2/getMMRHistoryByName.ts +44 -0
- package/src/mmr-history/v2/getMMRHistoryByPuuid.ts +43 -0
- package/src/mmr-history/v2/index.ts +45 -0
- package/src/premier/index.ts +9 -0
- package/src/premier/v1/getPremierTeamById.ts +47 -0
- package/src/premier/v1/getPremierTeamByName.ts +48 -0
- package/src/premier/v1/index.ts +53 -0
- package/src/premier/v1/searchPremierTeams.ts +39 -0
- package/src/premier-history/index.ts +9 -0
- package/src/premier-history/v1/getPremierTeamHistoryById.ts +31 -0
- package/src/premier-history/v1/getPremierTeamHistoryByName.ts +32 -0
- package/src/premier-history/v1/index.ts +27 -0
- package/src/premier-leaderboard/index.ts +9 -0
- package/src/premier-leaderboard/v1/getPremierLeaderboard.ts +38 -0
- package/src/premier-leaderboard/v1/index.ts +28 -0
- package/src/premium/index.ts +9 -0
- package/src/premium/v1/addPremiumWebhookUser.ts +37 -0
- package/src/premium/v1/deletePremiumWebhookUser.ts +14 -0
- package/src/premium/v1/getPremiumWebhookSettings.ts +10 -0
- package/src/premium/v1/index.ts +61 -0
- package/src/premium/v1/updatePremiumWebhookUser.ts +14 -0
- package/src/store/getFeaturedStoreItems.ts +65 -0
- package/src/store/getStoreOffers.ts +39 -0
- package/src/store/index.ts +24 -0
- package/src/stored-matches/index.ts +9 -0
- package/src/stored-matches/v1/getStoredMatchesByName.ts +79 -0
- package/src/stored-matches/v1/getStoredMatchesByPuuid.ts +78 -0
- package/src/stored-matches/v1/index.ts +61 -0
- package/src/stored-mmr-history/index.ts +12 -0
- package/src/stored-mmr-history/v1/getStoredMMRHistoryByName.ts +48 -0
- package/src/stored-mmr-history/v1/getStoredMMRHistoryByPuuid.ts +47 -0
- package/src/stored-mmr-history/v1/index.ts +40 -0
- package/src/stored-mmr-history/v2/getStoredMMRHistoryByName.ts +51 -0
- package/src/stored-mmr-history/v2/getStoredMMRHistoryByPuuid.ts +50 -0
- package/src/stored-mmr-history/v2/index.ts +55 -0
- package/src/types/response.type.ts +10 -0
- package/src/vlr/index.ts +9 -0
- package/src/vlr/v2/getVlrEsportsEvents.ts +40 -0
- package/src/vlr/v2/getVlrEventMatches.ts +23 -0
- package/src/vlr/v2/getVlrMatchDetails.ts +167 -0
- package/src/vlr/v2/getVlrPlayer.ts +78 -0
- package/src/vlr/v2/getVlrPlayerMatches.ts +36 -0
- package/src/vlr/v2/getVlrTeam.ts +49 -0
- package/src/vlr/v2/getVlrTeamMatches.ts +34 -0
- package/src/vlr/v2/getVlrTeamTransactions.ts +24 -0
- package/src/vlr/v2/index.ts +104 -0
- package/tsconfig.json +13 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { v1_AccountCategory } from "./v1";
|
|
2
|
+
import { v2_AccountCategory } from "./v2";
|
|
3
|
+
|
|
4
|
+
export class AccountCategory {
|
|
5
|
+
constructor(public apiKey: string) {
|
|
6
|
+
this.v1 = new v1_AccountCategory(this.apiKey);
|
|
7
|
+
this.v2 = new v2_AccountCategory(this.apiKey);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
v1: v1_AccountCategory;
|
|
11
|
+
v2: v2_AccountCategory;
|
|
12
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { doApiRequest } from "../../lib/request-handler";
|
|
2
|
+
|
|
3
|
+
export async function v1_getAccount(
|
|
4
|
+
apiKey: string,
|
|
5
|
+
name: string,
|
|
6
|
+
tag: string,
|
|
7
|
+
force?: boolean,
|
|
8
|
+
) {
|
|
9
|
+
return await doApiRequest<v1_getAccount_ResponseData>(
|
|
10
|
+
apiKey,
|
|
11
|
+
`/valorant/v1/account/${name}/${tag}`,
|
|
12
|
+
{ force: force ? (force ? "true" : "false") : undefined },
|
|
13
|
+
{ method: "GET" },
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface v1_getAccount_ResponseData {
|
|
18
|
+
account_level: number;
|
|
19
|
+
card: {
|
|
20
|
+
id: string;
|
|
21
|
+
large: string;
|
|
22
|
+
small: string;
|
|
23
|
+
wide: string;
|
|
24
|
+
};
|
|
25
|
+
last_update: string;
|
|
26
|
+
last_update_raw: number;
|
|
27
|
+
name: string;
|
|
28
|
+
puuid: string;
|
|
29
|
+
region: string;
|
|
30
|
+
tag: string;
|
|
31
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { doApiRequest } from "../../lib/request-handler";
|
|
2
|
+
|
|
3
|
+
export async function v1_getAccountByPuuid(
|
|
4
|
+
apiKey: string,
|
|
5
|
+
puuid: string,
|
|
6
|
+
force?: boolean,
|
|
7
|
+
) {
|
|
8
|
+
return doApiRequest<v1_getAccountByPuuid_ResponseData>(
|
|
9
|
+
apiKey,
|
|
10
|
+
`/valorant/v1/by-puuid/account/${puuid}`,
|
|
11
|
+
{ force: force ? (force ? "true" : "false") : undefined },
|
|
12
|
+
{ method: "GET" },
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface v1_getAccountByPuuid_ResponseData {
|
|
17
|
+
account_level: number;
|
|
18
|
+
card: {
|
|
19
|
+
id: string;
|
|
20
|
+
large: string;
|
|
21
|
+
small: string;
|
|
22
|
+
wide: string;
|
|
23
|
+
};
|
|
24
|
+
last_update: string;
|
|
25
|
+
last_update_raw: number;
|
|
26
|
+
name: string;
|
|
27
|
+
puuid: string;
|
|
28
|
+
region: string;
|
|
29
|
+
tag: string;
|
|
30
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { v1_getAccount } from "./getAccount";
|
|
2
|
+
import { v1_getAccountByPuuid } from "./getAccountByPuuid";
|
|
3
|
+
|
|
4
|
+
export class v1_AccountCategory {
|
|
5
|
+
constructor(private readonly apiKey: string) {}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @link https://docs.henrikdev.xyz/api-reference/valorant/get-account-by-puuid-v1
|
|
9
|
+
* @param puuid Player UUID
|
|
10
|
+
* @param force Bypass cache and refresh (optional)
|
|
11
|
+
* @returns Account data retrieved successfully
|
|
12
|
+
*/
|
|
13
|
+
async getByPuuid(puuid: string, force?: boolean) {
|
|
14
|
+
return await v1_getAccountByPuuid(this.apiKey, puuid, force);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @link https://docs.henrikdev.xyz/api-reference/valorant/get-account-v1
|
|
19
|
+
* @param name Riot ID name
|
|
20
|
+
* @param tag Riot ID tag
|
|
21
|
+
* @param force Bypass cache and refresh (optional)
|
|
22
|
+
* @returns Account data retrieved successfully
|
|
23
|
+
*/
|
|
24
|
+
async get(name: string, tag: string, force?: boolean) {
|
|
25
|
+
return await v1_getAccount(this.apiKey, name, tag, force);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { doApiRequest } from "../../lib/request-handler";
|
|
2
|
+
|
|
3
|
+
export async function v2_getAccount(
|
|
4
|
+
apiKey: string,
|
|
5
|
+
name: string,
|
|
6
|
+
tag: string,
|
|
7
|
+
force?: boolean,
|
|
8
|
+
) {
|
|
9
|
+
return await doApiRequest<v2_getAccount_ResponseData>(
|
|
10
|
+
apiKey,
|
|
11
|
+
`/valorant/v2/account/${name}/${tag}`,
|
|
12
|
+
{ force: force ? (force ? "true" : "false") : undefined },
|
|
13
|
+
{ method: "GET" },
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface v2_getAccount_ResponseData {
|
|
18
|
+
account_level: number;
|
|
19
|
+
card: string;
|
|
20
|
+
name: string;
|
|
21
|
+
platforms: string[];
|
|
22
|
+
puuid: string;
|
|
23
|
+
region: string;
|
|
24
|
+
tag: string;
|
|
25
|
+
title: string;
|
|
26
|
+
updated_at: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { doApiRequest } from "../../lib/request-handler";
|
|
2
|
+
|
|
3
|
+
export async function v2_getAccountByPuuid(
|
|
4
|
+
apiKey: string,
|
|
5
|
+
puuid: string,
|
|
6
|
+
force?: boolean,
|
|
7
|
+
) {
|
|
8
|
+
return doApiRequest<v2_getAccountByPuuid_ResponseData>(
|
|
9
|
+
apiKey,
|
|
10
|
+
`/valorant/v2/by-puuid/account/${puuid}`,
|
|
11
|
+
{ force: force ? (force ? "true" : "false") : undefined },
|
|
12
|
+
{ method: "GET" },
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface v2_getAccountByPuuid_ResponseData {
|
|
17
|
+
account_level: number;
|
|
18
|
+
card: string;
|
|
19
|
+
name: string;
|
|
20
|
+
platforms: string[];
|
|
21
|
+
puuid: string;
|
|
22
|
+
region: string;
|
|
23
|
+
tag: string;
|
|
24
|
+
title: string;
|
|
25
|
+
updated_at: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { v2_getAccount } from "./getAccount";
|
|
2
|
+
import { v2_getAccountByPuuid } from "./getAccountByPuuid";
|
|
3
|
+
|
|
4
|
+
export class v2_AccountCategory {
|
|
5
|
+
constructor(private readonly apiKey: string) {}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @link https://docs.henrikdev.xyz/api-reference/valorant/get-account-v2
|
|
9
|
+
* @param name Riot ID name
|
|
10
|
+
* @param tag Riot ID tag
|
|
11
|
+
* @param force Bypass cache and refresh (optional)
|
|
12
|
+
* @returns Account data retrieved successfully
|
|
13
|
+
*/
|
|
14
|
+
async get(name: string, tag: string, force?: boolean) {
|
|
15
|
+
return await v2_getAccount(this.apiKey, name, tag, force);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @link https://docs.henrikdev.xyz/api-reference/valorant/get-account-by-puuid-v2
|
|
20
|
+
* @param puuid Player UUID
|
|
21
|
+
* @param force Bypass cache and refresh (optional)
|
|
22
|
+
* @returns Account data retrieved successfully
|
|
23
|
+
*/
|
|
24
|
+
async getByPuuid(puuid: string, force?: boolean) {
|
|
25
|
+
return await v2_getAccountByPuuid(this.apiKey, puuid, force);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const apiURL = "https://api.henrikdev.xyz";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { v1_generateCrosshairImage } from "./generateCrosshairImage";
|
|
2
|
+
|
|
3
|
+
export class v1_CrosshairCategory {
|
|
4
|
+
constructor(private readonly apiKey: string) {}
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @link https://docs.henrikdev.xyz/api-reference/valorant/generate-crosshair-image-v1
|
|
8
|
+
* @param id Crosshair code
|
|
9
|
+
* @returns Crosshair image generated successfully
|
|
10
|
+
*/
|
|
11
|
+
async generateImage(id?: string) {
|
|
12
|
+
return await v1_generateCrosshairImage(this.apiKey, id);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { doApiRequest } from "../../lib/request-handler";
|
|
2
|
+
|
|
3
|
+
export async function v1_getEsportsSchedule(
|
|
4
|
+
apiKey: string,
|
|
5
|
+
region?: string,
|
|
6
|
+
league?: string,
|
|
7
|
+
) {
|
|
8
|
+
return await doApiRequest<v1_getEsportsSchedule_ResponseData[]>(
|
|
9
|
+
apiKey,
|
|
10
|
+
"/valorant/v1/esports/schedule",
|
|
11
|
+
{ region, league },
|
|
12
|
+
{ method: "GET" },
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface v1_getEsportsSchedule_ResponseData {
|
|
17
|
+
date: string;
|
|
18
|
+
league: {
|
|
19
|
+
icon: string;
|
|
20
|
+
identifier: string;
|
|
21
|
+
name: string;
|
|
22
|
+
region: string;
|
|
23
|
+
};
|
|
24
|
+
match: {
|
|
25
|
+
game_type: {
|
|
26
|
+
count: number;
|
|
27
|
+
type: string;
|
|
28
|
+
};
|
|
29
|
+
teams: {
|
|
30
|
+
code: string;
|
|
31
|
+
game_wins: number;
|
|
32
|
+
has_won: boolean;
|
|
33
|
+
icon: string;
|
|
34
|
+
name: string;
|
|
35
|
+
record: {
|
|
36
|
+
losses: number;
|
|
37
|
+
wins: number;
|
|
38
|
+
};
|
|
39
|
+
}[];
|
|
40
|
+
id: string;
|
|
41
|
+
};
|
|
42
|
+
state: string;
|
|
43
|
+
tournament: {
|
|
44
|
+
name: string;
|
|
45
|
+
season: string;
|
|
46
|
+
};
|
|
47
|
+
type: string;
|
|
48
|
+
vod: string;
|
|
49
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { v1_getEsportsSchedule } from "./getEsportsSchedule";
|
|
2
|
+
|
|
3
|
+
export class v1_EsportsCategory {
|
|
4
|
+
constructor(private readonly apiKey: string) {}
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @link https://docs.henrikdev.xyz/api-reference/valorant/get-esports-schedule-v1
|
|
8
|
+
* @param region
|
|
9
|
+
* @param league
|
|
10
|
+
* @returns Esports schedule retrieved successfully
|
|
11
|
+
*/
|
|
12
|
+
async getSchedule(region?: string, league?: string) {
|
|
13
|
+
return await v1_getEsportsSchedule(this.apiKey, region, league);
|
|
14
|
+
}
|
|
15
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { AccountCategory } from "./account";
|
|
2
|
+
import { CrosshairCategory } from "./crosshair";
|
|
3
|
+
import { EsportsCategory } from "./esports";
|
|
4
|
+
import { LeaderboardCategory } from "./leaderboard";
|
|
5
|
+
import { MatchDetailsCategory } from "./match-details";
|
|
6
|
+
import { MatchesCategory } from "./matches";
|
|
7
|
+
import { MiscCategory } from "./misc";
|
|
8
|
+
import { MMRCategory } from "./mmr";
|
|
9
|
+
import { MMRHistoryCategory } from "./mmr-history";
|
|
10
|
+
import { PremierCategory } from "./premier";
|
|
11
|
+
import { PremierHistoryCategory } from "./premier-history";
|
|
12
|
+
import { PremierLeaderboardCategory } from "./premier-leaderboard";
|
|
13
|
+
import { PremiumCategory } from "./premium";
|
|
14
|
+
import { StoreCategory } from "./store";
|
|
15
|
+
import { StoredMatchesCategory } from "./stored-matches";
|
|
16
|
+
import { StoredMMRHistoryCategory } from "./stored-mmr-history";
|
|
17
|
+
import { VlrCategory } from "./vlr";
|
|
18
|
+
|
|
19
|
+
export class UnofficialValorantAPI {
|
|
20
|
+
constructor(private readonly apiKey: string) {
|
|
21
|
+
this.Account = new AccountCategory(this.apiKey);
|
|
22
|
+
this.Crosshair = new CrosshairCategory(this.apiKey);
|
|
23
|
+
this.Esports = new EsportsCategory(this.apiKey);
|
|
24
|
+
this.Leaderboard = new LeaderboardCategory(this.apiKey);
|
|
25
|
+
this.Match_Details = new MatchDetailsCategory(this.apiKey);
|
|
26
|
+
this.Matches = new MatchesCategory(this.apiKey);
|
|
27
|
+
this.Misc = new MiscCategory(this.apiKey);
|
|
28
|
+
this.MMR = new MMRCategory(this.apiKey);
|
|
29
|
+
this.MMR_History = new MMRHistoryCategory(this.apiKey);
|
|
30
|
+
this.Premier = new PremierCategory(this.apiKey);
|
|
31
|
+
this.Premier_History = new PremierHistoryCategory(this.apiKey);
|
|
32
|
+
this.Premier_Leaderboard = new PremierLeaderboardCategory(this.apiKey);
|
|
33
|
+
this.Premium = new PremiumCategory(this.apiKey);
|
|
34
|
+
this.Store = new StoreCategory(this.apiKey);
|
|
35
|
+
this.Stored_Matches = new StoredMatchesCategory(this.apiKey);
|
|
36
|
+
this.Stored_MMR_History = new StoredMMRHistoryCategory(this.apiKey);
|
|
37
|
+
this.Vlr = new VlrCategory(this.apiKey);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
Account: AccountCategory;
|
|
41
|
+
Crosshair: CrosshairCategory;
|
|
42
|
+
Esports: EsportsCategory;
|
|
43
|
+
Leaderboard: LeaderboardCategory;
|
|
44
|
+
Match_Details: MatchDetailsCategory;
|
|
45
|
+
Matches: MatchesCategory;
|
|
46
|
+
Misc: MiscCategory;
|
|
47
|
+
MMR: MMRCategory;
|
|
48
|
+
MMR_History: MMRHistoryCategory;
|
|
49
|
+
Premier: PremierCategory;
|
|
50
|
+
Premier_History: PremierHistoryCategory;
|
|
51
|
+
Premier_Leaderboard: PremierLeaderboardCategory;
|
|
52
|
+
Premium: PremiumCategory;
|
|
53
|
+
Store: StoreCategory;
|
|
54
|
+
Stored_Matches: StoredMatchesCategory;
|
|
55
|
+
Stored_MMR_History: StoredMMRHistoryCategory;
|
|
56
|
+
Vlr: VlrCategory;
|
|
57
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { v1_LeaderboardCategory } from "./v1";
|
|
2
|
+
import { v2_LeaderboardCategory } from "./v2";
|
|
3
|
+
import { v3_LeaderboardCategory } from "./v3";
|
|
4
|
+
|
|
5
|
+
export class LeaderboardCategory {
|
|
6
|
+
constructor(private readonly apiKey: string) {
|
|
7
|
+
this.v1 = new v1_LeaderboardCategory(this.apiKey);
|
|
8
|
+
this.v2 = new v2_LeaderboardCategory(this.apiKey);
|
|
9
|
+
this.v3 = new v3_LeaderboardCategory(this.apiKey);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
v1: v1_LeaderboardCategory;
|
|
13
|
+
v2: v2_LeaderboardCategory;
|
|
14
|
+
v3: v3_LeaderboardCategory;
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { doApiRequest } from "../../lib/request-handler";
|
|
2
|
+
|
|
3
|
+
export async function v1_getLeaderboard(
|
|
4
|
+
apiKey: string,
|
|
5
|
+
affinity: string,
|
|
6
|
+
season?: string,
|
|
7
|
+
name?: string,
|
|
8
|
+
tag?: string,
|
|
9
|
+
) {
|
|
10
|
+
return await doApiRequest<unknown>(
|
|
11
|
+
apiKey,
|
|
12
|
+
`/valorant/v1/leaderboard/${affinity}`,
|
|
13
|
+
{ season, name, tag },
|
|
14
|
+
{ method: "GET" },
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
export interface v1_getLeaderboard_ResponseData {}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { v1_getLeaderboard } from "./getLeaderboard";
|
|
2
|
+
|
|
3
|
+
export class v1_LeaderboardCategory {
|
|
4
|
+
constructor(private readonly apiKey: string) {}
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @link https://docs.henrikdev.xyz/api-reference/valorant/get-leaderboard-v1
|
|
8
|
+
* @param affinity Region/affinity (e.g., na, eu, ap, kr)
|
|
9
|
+
* @param season Season ID (optional)
|
|
10
|
+
* @param name Player name to search for (optional)
|
|
11
|
+
* @param tag Player tag to search for (optional)
|
|
12
|
+
* @returns Leaderboard retrieved successfully
|
|
13
|
+
*/
|
|
14
|
+
async get(affinity: string, season?: string, name?: string, tag?: string) {
|
|
15
|
+
return await v1_getLeaderboard(this.apiKey, affinity, season, name, tag);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { doApiRequest } from "../../lib/request-handler";
|
|
2
|
+
import { DefaultErrorsResponse } from "../../types/response.type";
|
|
3
|
+
|
|
4
|
+
export async function v2_getLeaderboard(
|
|
5
|
+
apiKey: string,
|
|
6
|
+
affinity: string,
|
|
7
|
+
season?: string,
|
|
8
|
+
name?: string,
|
|
9
|
+
tag?: string,
|
|
10
|
+
puuid?: string,
|
|
11
|
+
) {
|
|
12
|
+
return (await doApiRequest(
|
|
13
|
+
apiKey,
|
|
14
|
+
`/valorant/v2/leaderboard/${affinity}`,
|
|
15
|
+
{ season, name, tag, puuid },
|
|
16
|
+
{ method: "GET" },
|
|
17
|
+
)) as v2_getLeaderboard_ResponseData | DefaultErrorsResponse;
|
|
18
|
+
}
|
|
19
|
+
export interface v2_getLeaderboard_ResponseData {
|
|
20
|
+
immortal_1_threshold: number;
|
|
21
|
+
immortal_2_threshold: number;
|
|
22
|
+
immortal_3_threshold: number;
|
|
23
|
+
last_update: number;
|
|
24
|
+
next_update: number;
|
|
25
|
+
players: {
|
|
26
|
+
IsAnonymized: boolean;
|
|
27
|
+
IsBanned: boolean;
|
|
28
|
+
PlayerCardID: string;
|
|
29
|
+
TitleID: string;
|
|
30
|
+
competitiveTier: number;
|
|
31
|
+
gameName: string;
|
|
32
|
+
leaderboardRank: number;
|
|
33
|
+
numberOfWins: number;
|
|
34
|
+
rankedRating: number;
|
|
35
|
+
tagLine: string;
|
|
36
|
+
puuid: string | null;
|
|
37
|
+
}[];
|
|
38
|
+
radiant_threshold: number;
|
|
39
|
+
total_players: number;
|
|
40
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { v2_getLeaderboard } from "./getLeaderboard";
|
|
2
|
+
|
|
3
|
+
export class v2_LeaderboardCategory {
|
|
4
|
+
constructor(private readonly apiKey: string) {}
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @link https://docs.henrikdev.xyz/api-reference/valorant/get-leaderboard-v2
|
|
8
|
+
* @param affinity Region/affinity (e.g., na, eu, ap, kr)
|
|
9
|
+
* @param season Season ID (optional)
|
|
10
|
+
* @param name Player name to search for (optional)
|
|
11
|
+
* @param tag Player tag to search for (optional)
|
|
12
|
+
* @param puuid Player UUID to search for (optional)
|
|
13
|
+
* @returns Leaderboard retrieved successfully
|
|
14
|
+
*/
|
|
15
|
+
async get(
|
|
16
|
+
affinity: string,
|
|
17
|
+
season?: string,
|
|
18
|
+
name?: string,
|
|
19
|
+
tag?: string,
|
|
20
|
+
puuid?: string,
|
|
21
|
+
) {
|
|
22
|
+
return await v2_getLeaderboard(
|
|
23
|
+
this.apiKey,
|
|
24
|
+
affinity,
|
|
25
|
+
season,
|
|
26
|
+
name,
|
|
27
|
+
tag,
|
|
28
|
+
puuid,
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { doApiRequest } from "../../lib/request-handler";
|
|
2
|
+
import {
|
|
3
|
+
DefaultApiResponse,
|
|
4
|
+
DefaultErrorsResponse,
|
|
5
|
+
} from "../../types/response.type";
|
|
6
|
+
|
|
7
|
+
export async function v3_getLeaderboard(
|
|
8
|
+
apiKey: string,
|
|
9
|
+
affinity: string,
|
|
10
|
+
platform: string,
|
|
11
|
+
season?: string,
|
|
12
|
+
size?: number,
|
|
13
|
+
page?: number,
|
|
14
|
+
name?: string,
|
|
15
|
+
tag?: string,
|
|
16
|
+
) {
|
|
17
|
+
return (await doApiRequest(
|
|
18
|
+
apiKey,
|
|
19
|
+
`/valorant/v3/leaderboard/${affinity}/${platform}`,
|
|
20
|
+
{ season, size: size?.toString(), page: page?.toString(), name, tag },
|
|
21
|
+
{ method: "GET" },
|
|
22
|
+
)) as
|
|
23
|
+
| (DefaultApiResponse<v3_getLeaderboard_ResponseData> & {
|
|
24
|
+
results: {
|
|
25
|
+
after: number;
|
|
26
|
+
before: number;
|
|
27
|
+
returned: number;
|
|
28
|
+
total: number;
|
|
29
|
+
};
|
|
30
|
+
})
|
|
31
|
+
| DefaultErrorsResponse;
|
|
32
|
+
}
|
|
33
|
+
export interface v3_getLeaderboard_ResponseData {
|
|
34
|
+
players: {
|
|
35
|
+
card: string;
|
|
36
|
+
is_anonymized: boolean;
|
|
37
|
+
is_banned: boolean;
|
|
38
|
+
leaderboard_rank: number;
|
|
39
|
+
name: string;
|
|
40
|
+
rr: number;
|
|
41
|
+
tag: string;
|
|
42
|
+
tier: number;
|
|
43
|
+
title: string;
|
|
44
|
+
updated_at: string;
|
|
45
|
+
wins: number;
|
|
46
|
+
puuid: string | null;
|
|
47
|
+
}[];
|
|
48
|
+
thresholds: {
|
|
49
|
+
start_index: number;
|
|
50
|
+
threshold: number;
|
|
51
|
+
tier: {
|
|
52
|
+
id: number;
|
|
53
|
+
name: string;
|
|
54
|
+
};
|
|
55
|
+
}[];
|
|
56
|
+
updated_at: string;
|
|
57
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { v3_getLeaderboard } from "./getLeaderboard";
|
|
2
|
+
|
|
3
|
+
export class v3_LeaderboardCategory {
|
|
4
|
+
constructor(private readonly apiKey: string) {}
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @link https://docs.henrikdev.xyz/api-reference/valorant/get-leaderboard-v3
|
|
8
|
+
* @param affinity Region/affinity (e.g., na, eu, ap, kr)
|
|
9
|
+
* @param platform Platform (pc, console)
|
|
10
|
+
* @param season Season ID (optional)
|
|
11
|
+
* @param size Number of results per page (optional)
|
|
12
|
+
* @param page Page number (optional)
|
|
13
|
+
* @param name Player name to search for (optional)
|
|
14
|
+
* @param tag Player tag to search for (optional)
|
|
15
|
+
* @returns Leaderboard retrieved successfully
|
|
16
|
+
*/
|
|
17
|
+
async get(
|
|
18
|
+
affinity: string,
|
|
19
|
+
platform: string,
|
|
20
|
+
season?: string,
|
|
21
|
+
size?: number,
|
|
22
|
+
page?: number,
|
|
23
|
+
name?: string,
|
|
24
|
+
tag?: string,
|
|
25
|
+
) {
|
|
26
|
+
return await v3_getLeaderboard(
|
|
27
|
+
this.apiKey,
|
|
28
|
+
affinity,
|
|
29
|
+
platform,
|
|
30
|
+
season,
|
|
31
|
+
size,
|
|
32
|
+
page,
|
|
33
|
+
name,
|
|
34
|
+
tag,
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { apiURL } from "../constants/api.const";
|
|
2
|
+
import {
|
|
3
|
+
DefaultApiResponse,
|
|
4
|
+
DefaultErrorsResponse,
|
|
5
|
+
} from "../types/response.type";
|
|
6
|
+
|
|
7
|
+
export async function doApiRequest<T>(
|
|
8
|
+
apiKey: string,
|
|
9
|
+
url: string,
|
|
10
|
+
query?: Record<string, string | undefined>,
|
|
11
|
+
init?: RequestInit & { method: "GET" | "POST" | "PUT" | "DELETE" },
|
|
12
|
+
): Promise<DefaultApiResponse<T> | DefaultErrorsResponse> {
|
|
13
|
+
return await fetch(
|
|
14
|
+
apiURL + url + Object.entries(query || {}).length
|
|
15
|
+
? "?"
|
|
16
|
+
: "" +
|
|
17
|
+
Object.entries(query || {})
|
|
18
|
+
.filter((e) => typeof e[1] === "string")
|
|
19
|
+
.map((e) => e[0] + "=" + e[1]!.toString())
|
|
20
|
+
.join("&"),
|
|
21
|
+
{
|
|
22
|
+
...init,
|
|
23
|
+
headers: {
|
|
24
|
+
...init?.headers,
|
|
25
|
+
Authorization: apiKey,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
).then((res) => res.json());
|
|
29
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { v2_MatchDetailsCategory } from "./v2";
|
|
2
|
+
import { v4_MatchDetailsCategory } from "./v4";
|
|
3
|
+
|
|
4
|
+
export class MatchDetailsCategory {
|
|
5
|
+
constructor(private readonly apiKey: string) {
|
|
6
|
+
this.v2 = new v2_MatchDetailsCategory(this.apiKey);
|
|
7
|
+
this.v4 = new v4_MatchDetailsCategory(this.apiKey);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
v2: v2_MatchDetailsCategory;
|
|
11
|
+
v4: v4_MatchDetailsCategory;
|
|
12
|
+
}
|