@wardbox/whisper 0.2.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/LICENSE +21 -0
- package/README.md +42 -0
- package/dist/client-B7r2KpHz.js +838 -0
- package/dist/client-CxR21ld-.cjs +913 -0
- package/dist/client-DrrSDGBt.d.cts +181 -0
- package/dist/client-DrrSDGBt.d.cts.map +1 -0
- package/dist/client-Xu0AwrUw.d.ts +181 -0
- package/dist/client-Xu0AwrUw.d.ts.map +1 -0
- package/dist/core/index.cjs +15 -0
- package/dist/core/index.d.cts +208 -0
- package/dist/core/index.d.cts.map +1 -0
- package/dist/core/index.d.ts +208 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +2 -0
- package/dist/errors-7wdVIL5Y.d.cts +111 -0
- package/dist/errors-7wdVIL5Y.d.cts.map +1 -0
- package/dist/errors-DofVFslx.d.ts +111 -0
- package/dist/errors-DofVFslx.d.ts.map +1 -0
- package/dist/index.cjs +8 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/dist/lol/index.cjs +436 -0
- package/dist/lol/index.d.cts +7232 -0
- package/dist/lol/index.d.cts.map +1 -0
- package/dist/lol/index.d.ts +7232 -0
- package/dist/lol/index.d.ts.map +1 -0
- package/dist/lol/index.js +425 -0
- package/dist/lor/index.cjs +44 -0
- package/dist/lor/index.d.cts +159 -0
- package/dist/lor/index.d.cts.map +1 -0
- package/dist/lor/index.d.ts +159 -0
- package/dist/lor/index.d.ts.map +1 -0
- package/dist/lor/index.js +44 -0
- package/dist/riftbound/index.cjs +25 -0
- package/dist/riftbound/index.d.cts +97 -0
- package/dist/riftbound/index.d.cts.map +1 -0
- package/dist/riftbound/index.d.ts +97 -0
- package/dist/riftbound/index.d.ts.map +1 -0
- package/dist/riftbound/index.js +26 -0
- package/dist/riot/index.cjs +31 -0
- package/dist/riot/index.d.cts +101 -0
- package/dist/riot/index.d.cts.map +1 -0
- package/dist/riot/index.d.ts +101 -0
- package/dist/riot/index.d.ts.map +1 -0
- package/dist/riot/index.js +32 -0
- package/dist/tft/index.cjs +152 -0
- package/dist/tft/index.d.cts +581 -0
- package/dist/tft/index.d.cts.map +1 -0
- package/dist/tft/index.d.ts +581 -0
- package/dist/tft/index.d.ts.map +1 -0
- package/dist/tft/index.js +149 -0
- package/dist/val/index.cjs +166 -0
- package/dist/val/index.d.cts +952 -0
- package/dist/val/index.d.cts.map +1 -0
- package/dist/val/index.d.ts +952 -0
- package/dist/val/index.d.ts.map +1 -0
- package/dist/val/index.js +161 -0
- package/package.json +137 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { p as RegionalRoute, t as WhisperClient } from "../client-DrrSDGBt.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/types/generated/riot.d.ts
|
|
4
|
+
/** Riot account information linked to a Riot ID. */
|
|
5
|
+
interface Account {
|
|
6
|
+
/** In-game name component of the Riot ID. */
|
|
7
|
+
gameName: string;
|
|
8
|
+
/** Player Universally Unique Identifier (PUUID). */
|
|
9
|
+
puuid: string;
|
|
10
|
+
/** Tag component of the Riot ID (e.g., "NA1"). */
|
|
11
|
+
tagLine: string;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/types/overrides/riot-account.d.ts
|
|
15
|
+
/**
|
|
16
|
+
* Active shard information for a player in a specific game.
|
|
17
|
+
*
|
|
18
|
+
* Returned by account-v1.getByGame to determine which platform shard
|
|
19
|
+
* a player's game data is hosted on.
|
|
20
|
+
*/
|
|
21
|
+
interface ActiveShard {
|
|
22
|
+
/** Encrypted PUUID of the player */
|
|
23
|
+
puuid: string;
|
|
24
|
+
/** Game identifier (e.g., "val", "lor") */
|
|
25
|
+
game: string;
|
|
26
|
+
/** Active shard/platform for this player and game (e.g., "na", "eu") */
|
|
27
|
+
activeShard: string;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/riot/account-v1.d.ts
|
|
31
|
+
/**
|
|
32
|
+
* Riot Account API (v1).
|
|
33
|
+
*
|
|
34
|
+
* Shared across all Riot games. Look up accounts by PUUID or Riot ID,
|
|
35
|
+
* or query which shard a player is active on for a given game.
|
|
36
|
+
*
|
|
37
|
+
* All methods require a {@link RegionalRoute} (americas, europe, asia, sea).
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* import { accountV1 } from '@wardbox/whisper/riot';
|
|
42
|
+
*
|
|
43
|
+
* const account = await accountV1.getByRiotId(client, 'americas', 'PlayerName', 'NA1');
|
|
44
|
+
* console.log(account.puuid);
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
declare const accountV1: {
|
|
48
|
+
/**
|
|
49
|
+
* Get an account by PUUID.
|
|
50
|
+
*
|
|
51
|
+
* @param client - WhisperClient instance
|
|
52
|
+
* @param route - Regional routing value (e.g., 'americas', 'europe')
|
|
53
|
+
* @param puuid - Encrypted PUUID
|
|
54
|
+
* @returns Account data including gameName, tagLine, and puuid
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* const account = await accountV1.getByPuuid(client, 'americas', 'abc-123-def');
|
|
59
|
+
* console.log(account.gameName, account.tagLine);
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
readonly getByPuuid: (client: WhisperClient, route: RegionalRoute, puuid: string) => Promise<Account>;
|
|
63
|
+
/**
|
|
64
|
+
* Get an account by Riot ID (gameName + tagLine).
|
|
65
|
+
*
|
|
66
|
+
* @param client - WhisperClient instance
|
|
67
|
+
* @param route - Regional routing value (e.g., 'americas', 'europe')
|
|
68
|
+
* @param gameName - Riot ID game name
|
|
69
|
+
* @param tagLine - Riot ID tag line (e.g., "NA1")
|
|
70
|
+
* @returns Account data including gameName, tagLine, and puuid
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* const account = await accountV1.getByRiotId(client, 'americas', 'PlayerName', 'NA1');
|
|
75
|
+
* console.log(account.puuid);
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
readonly getByRiotId: (client: WhisperClient, route: RegionalRoute, gameName: string, tagLine: string) => Promise<Account>;
|
|
79
|
+
/**
|
|
80
|
+
* Get the active shard for a player in a specific game.
|
|
81
|
+
*
|
|
82
|
+
* Determines which platform shard hosts a player's data for a given game.
|
|
83
|
+
* Useful for routing subsequent requests to the correct shard.
|
|
84
|
+
*
|
|
85
|
+
* @param client - WhisperClient instance
|
|
86
|
+
* @param route - Regional routing value (e.g., 'americas', 'europe')
|
|
87
|
+
* @param game - Game identifier (e.g., "val", "lor")
|
|
88
|
+
* @param puuid - Encrypted PUUID
|
|
89
|
+
* @returns Active shard information for the player and game
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```typescript
|
|
93
|
+
* const shard = await accountV1.getByGame(client, 'americas', 'val', 'abc-123-def');
|
|
94
|
+
* console.log(shard.activeShard); // e.g., "na"
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
readonly getByGame: (client: WhisperClient, route: RegionalRoute, game: string, puuid: string) => Promise<ActiveShard>;
|
|
98
|
+
};
|
|
99
|
+
//#endregion
|
|
100
|
+
export { type Account, type ActiveShard, accountV1 };
|
|
101
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/types/generated/riot.ts","../../src/types/overrides/riot-account.ts","../../src/riot/account-v1.ts"],"mappings":";;;;UAIiB,OAAA;;EAEf,QAAA;EAFsB;EAItB,KAAA;EAJsB;EAMtB,OAAA;AAAA;;;;;;AANF;;;UCEiB,WAAA;EDAf;ECEA,KAAA;EDEA;ECAA,IAAA;EDAO;ECEP,WAAA;AAAA;;;;;;;;;;;;;;AANF;;;;;cCea,SAAA;EDTX;;;;;;ACSF;;;;;;;;EDTE,8BCwByB,aAAA,EAAa,KAAA,EAAS,aAAA,EAAa,KAAA,aAAkB,OAAA,CAAQ,OAAA;EA6B3E;;;;;;;;;;;;;;;EAAA,+BAJD,aAAA,EAAa,KAAA,EACd,aAAA,EAAa,QAAA,UACJ,OAAA,aAEf,OAAA,CAAQ,OAAA;;;;;;;;;;;;;;;;;;;+BA4BD,aAAA,EAAa,KAAA,EACd,aAAA,EAAa,IAAA,UACR,KAAA,aAEX,OAAA,CAAQ,WAAA;AAAA"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { p as RegionalRoute, t as WhisperClient } from "../client-Xu0AwrUw.js";
|
|
2
|
+
|
|
3
|
+
//#region src/types/generated/riot.d.ts
|
|
4
|
+
/** Riot account information linked to a Riot ID. */
|
|
5
|
+
interface Account {
|
|
6
|
+
/** In-game name component of the Riot ID. */
|
|
7
|
+
gameName: string;
|
|
8
|
+
/** Player Universally Unique Identifier (PUUID). */
|
|
9
|
+
puuid: string;
|
|
10
|
+
/** Tag component of the Riot ID (e.g., "NA1"). */
|
|
11
|
+
tagLine: string;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/types/overrides/riot-account.d.ts
|
|
15
|
+
/**
|
|
16
|
+
* Active shard information for a player in a specific game.
|
|
17
|
+
*
|
|
18
|
+
* Returned by account-v1.getByGame to determine which platform shard
|
|
19
|
+
* a player's game data is hosted on.
|
|
20
|
+
*/
|
|
21
|
+
interface ActiveShard {
|
|
22
|
+
/** Encrypted PUUID of the player */
|
|
23
|
+
puuid: string;
|
|
24
|
+
/** Game identifier (e.g., "val", "lor") */
|
|
25
|
+
game: string;
|
|
26
|
+
/** Active shard/platform for this player and game (e.g., "na", "eu") */
|
|
27
|
+
activeShard: string;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/riot/account-v1.d.ts
|
|
31
|
+
/**
|
|
32
|
+
* Riot Account API (v1).
|
|
33
|
+
*
|
|
34
|
+
* Shared across all Riot games. Look up accounts by PUUID or Riot ID,
|
|
35
|
+
* or query which shard a player is active on for a given game.
|
|
36
|
+
*
|
|
37
|
+
* All methods require a {@link RegionalRoute} (americas, europe, asia, sea).
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* import { accountV1 } from '@wardbox/whisper/riot';
|
|
42
|
+
*
|
|
43
|
+
* const account = await accountV1.getByRiotId(client, 'americas', 'PlayerName', 'NA1');
|
|
44
|
+
* console.log(account.puuid);
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
declare const accountV1: {
|
|
48
|
+
/**
|
|
49
|
+
* Get an account by PUUID.
|
|
50
|
+
*
|
|
51
|
+
* @param client - WhisperClient instance
|
|
52
|
+
* @param route - Regional routing value (e.g., 'americas', 'europe')
|
|
53
|
+
* @param puuid - Encrypted PUUID
|
|
54
|
+
* @returns Account data including gameName, tagLine, and puuid
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* const account = await accountV1.getByPuuid(client, 'americas', 'abc-123-def');
|
|
59
|
+
* console.log(account.gameName, account.tagLine);
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
readonly getByPuuid: (client: WhisperClient, route: RegionalRoute, puuid: string) => Promise<Account>;
|
|
63
|
+
/**
|
|
64
|
+
* Get an account by Riot ID (gameName + tagLine).
|
|
65
|
+
*
|
|
66
|
+
* @param client - WhisperClient instance
|
|
67
|
+
* @param route - Regional routing value (e.g., 'americas', 'europe')
|
|
68
|
+
* @param gameName - Riot ID game name
|
|
69
|
+
* @param tagLine - Riot ID tag line (e.g., "NA1")
|
|
70
|
+
* @returns Account data including gameName, tagLine, and puuid
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* const account = await accountV1.getByRiotId(client, 'americas', 'PlayerName', 'NA1');
|
|
75
|
+
* console.log(account.puuid);
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
readonly getByRiotId: (client: WhisperClient, route: RegionalRoute, gameName: string, tagLine: string) => Promise<Account>;
|
|
79
|
+
/**
|
|
80
|
+
* Get the active shard for a player in a specific game.
|
|
81
|
+
*
|
|
82
|
+
* Determines which platform shard hosts a player's data for a given game.
|
|
83
|
+
* Useful for routing subsequent requests to the correct shard.
|
|
84
|
+
*
|
|
85
|
+
* @param client - WhisperClient instance
|
|
86
|
+
* @param route - Regional routing value (e.g., 'americas', 'europe')
|
|
87
|
+
* @param game - Game identifier (e.g., "val", "lor")
|
|
88
|
+
* @param puuid - Encrypted PUUID
|
|
89
|
+
* @returns Active shard information for the player and game
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```typescript
|
|
93
|
+
* const shard = await accountV1.getByGame(client, 'americas', 'val', 'abc-123-def');
|
|
94
|
+
* console.log(shard.activeShard); // e.g., "na"
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
readonly getByGame: (client: WhisperClient, route: RegionalRoute, game: string, puuid: string) => Promise<ActiveShard>;
|
|
98
|
+
};
|
|
99
|
+
//#endregion
|
|
100
|
+
export { type Account, type ActiveShard, accountV1 };
|
|
101
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/types/generated/riot.ts","../../src/types/overrides/riot-account.ts","../../src/riot/account-v1.ts"],"mappings":";;;;UAIiB,OAAA;;EAEf,QAAA;EAFsB;EAItB,KAAA;EAJsB;EAMtB,OAAA;AAAA;;;;;;AANF;;;UCEiB,WAAA;EDAf;ECEA,KAAA;EDEA;ECAA,IAAA;EDAO;ECEP,WAAA;AAAA;;;;;;;;;;;;;;AANF;;;;;cCea,SAAA;EDTX;;;;;;ACSF;;;;;;;;EDTE,8BCwByB,aAAA,EAAa,KAAA,EAAS,aAAA,EAAa,KAAA,aAAkB,OAAA,CAAQ,OAAA;EA6B3E;;;;;;;;;;;;;;;EAAA,+BAJD,aAAA,EAAa,KAAA,EACd,aAAA,EAAa,QAAA,UACJ,OAAA,aAEf,OAAA,CAAQ,OAAA;;;;;;;;;;;;;;;;;;;+BA4BD,aAAA,EAAa,KAAA,EACd,aAAA,EAAa,IAAA,UACR,KAAA,aAEX,OAAA,CAAQ,WAAA;AAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region src/riot/account-v1.ts
|
|
2
|
+
/**
|
|
3
|
+
* Riot Account API (v1).
|
|
4
|
+
*
|
|
5
|
+
* Shared across all Riot games. Look up accounts by PUUID or Riot ID,
|
|
6
|
+
* or query which shard a player is active on for a given game.
|
|
7
|
+
*
|
|
8
|
+
* All methods require a {@link RegionalRoute} (americas, europe, asia, sea).
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { accountV1 } from '@wardbox/whisper/riot';
|
|
13
|
+
*
|
|
14
|
+
* const account = await accountV1.getByRiotId(client, 'americas', 'PlayerName', 'NA1');
|
|
15
|
+
* console.log(account.puuid);
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
const accountV1 = {
|
|
19
|
+
async getByPuuid(client, route, puuid) {
|
|
20
|
+
return (await client.request(route, `/riot/account/v1/accounts/by-puuid/${encodeURIComponent(puuid)}`, "account-v1.getByPuuid")).data;
|
|
21
|
+
},
|
|
22
|
+
async getByRiotId(client, route, gameName, tagLine) {
|
|
23
|
+
return (await client.request(route, `/riot/account/v1/accounts/by-riot-id/${encodeURIComponent(gameName)}/${encodeURIComponent(tagLine)}`, "account-v1.getByRiotId")).data;
|
|
24
|
+
},
|
|
25
|
+
async getByGame(client, route, game, puuid) {
|
|
26
|
+
return (await client.request(route, `/riot/account/v1/active-shards/by-game/${encodeURIComponent(game)}/by-puuid/${encodeURIComponent(puuid)}`, "account-v1.getByGame")).data;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { accountV1 };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/tft/spectator-tft-v5.ts
|
|
3
|
+
/**
|
|
4
|
+
* TFT Spectator API (v5).
|
|
5
|
+
*
|
|
6
|
+
* Access live TFT game data. Use this to check if a player is currently
|
|
7
|
+
* in a TFT game.
|
|
8
|
+
*
|
|
9
|
+
* All methods require a {@link PlatformRoute} (e.g., 'na1', 'euw1').
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { spectatorTftV5 } from '@wardbox/whisper/tft';
|
|
14
|
+
*
|
|
15
|
+
* const game = await spectatorTftV5.getCurrentGame(client, 'na1', puuid);
|
|
16
|
+
* console.log(`In TFT game on map ${game.mapId}`);
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
const spectatorTftV5 = { async getCurrentGame(client, route, puuid) {
|
|
20
|
+
return (await client.request(route, `/lol/spectator/tft/v5/active-games/by-puuid/${encodeURIComponent(puuid)}`, "spectator-tft-v5.getCurrentGame")).data;
|
|
21
|
+
} };
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/tft/tft-league-v1.ts
|
|
24
|
+
/**
|
|
25
|
+
* TFT League API (v1).
|
|
26
|
+
*
|
|
27
|
+
* Query TFT ranked league standings, entries by PUUID, and full league data
|
|
28
|
+
* for challenger/grandmaster/master tiers. Also includes top-rated ladder
|
|
29
|
+
* for Hyper Roll and Double Up queues.
|
|
30
|
+
*
|
|
31
|
+
* All methods require a {@link PlatformRoute} (e.g., 'na1', 'euw1').
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* import { tftLeagueV1 } from '@wardbox/whisper/tft';
|
|
36
|
+
*
|
|
37
|
+
* const challenger = await tftLeagueV1.getChallengerLeague(client, 'na1');
|
|
38
|
+
* console.log(challenger.entries.length);
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
const tftLeagueV1 = {
|
|
42
|
+
async getChallengerLeague(client, route, options) {
|
|
43
|
+
const params = options?.queue !== void 0 ? { queue: options.queue } : void 0;
|
|
44
|
+
return (await client.request(route, "/tft/league/v1/challenger", "tft-league-v1.getChallengerLeague", params ? { params } : void 0)).data;
|
|
45
|
+
},
|
|
46
|
+
async getGrandmasterLeague(client, route, options) {
|
|
47
|
+
const params = options?.queue !== void 0 ? { queue: options.queue } : void 0;
|
|
48
|
+
return (await client.request(route, "/tft/league/v1/grandmaster", "tft-league-v1.getGrandmasterLeague", params ? { params } : void 0)).data;
|
|
49
|
+
},
|
|
50
|
+
async getMasterLeague(client, route, options) {
|
|
51
|
+
const params = options?.queue !== void 0 ? { queue: options.queue } : void 0;
|
|
52
|
+
return (await client.request(route, "/tft/league/v1/master", "tft-league-v1.getMasterLeague", params ? { params } : void 0)).data;
|
|
53
|
+
},
|
|
54
|
+
async getLeagueEntriesByPuuid(client, route, puuid, options) {
|
|
55
|
+
const params = options?.queue !== void 0 ? { queue: options.queue } : void 0;
|
|
56
|
+
return (await client.request(route, `/tft/league/v1/by-puuid/${encodeURIComponent(puuid)}`, "tft-league-v1.getLeagueEntriesByPuuid", params ? { params } : void 0)).data;
|
|
57
|
+
},
|
|
58
|
+
async getLeagueEntries(client, route, tier, division, options) {
|
|
59
|
+
const params = {};
|
|
60
|
+
if (options) {
|
|
61
|
+
if (options.queue !== void 0) params.queue = options.queue;
|
|
62
|
+
if (options.page !== void 0) params.page = String(options.page);
|
|
63
|
+
}
|
|
64
|
+
return (await client.request(route, `/tft/league/v1/entries/${encodeURIComponent(tier)}/${encodeURIComponent(division)}`, "tft-league-v1.getLeagueEntries", Object.keys(params).length > 0 ? { params } : void 0)).data;
|
|
65
|
+
},
|
|
66
|
+
async getLeagueById(client, route, leagueId) {
|
|
67
|
+
return (await client.request(route, `/tft/league/v1/leagues/${encodeURIComponent(leagueId)}`, "tft-league-v1.getLeagueById")).data;
|
|
68
|
+
},
|
|
69
|
+
async getTopRatedLadder(client, route, queue) {
|
|
70
|
+
return (await client.request(route, `/tft/league/v1/rated-ladders/${encodeURIComponent(queue)}/top`, "tft-league-v1.getTopRatedLadder")).data;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/tft/tft-match-v1.ts
|
|
75
|
+
/**
|
|
76
|
+
* TFT Match API (v1).
|
|
77
|
+
*
|
|
78
|
+
* Retrieve TFT match history and match details by PUUID or match ID.
|
|
79
|
+
*
|
|
80
|
+
* All methods require a {@link RegionalRoute} (americas, europe, asia, sea).
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```typescript
|
|
84
|
+
* import { tftMatchV1 } from '@wardbox/whisper/tft';
|
|
85
|
+
*
|
|
86
|
+
* const matchIds = await tftMatchV1.getMatchIdsByPuuid(client, 'americas', 'puuid-123');
|
|
87
|
+
* const match = await tftMatchV1.getMatch(client, 'americas', matchIds[0]);
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
const tftMatchV1 = {
|
|
91
|
+
async getMatchIdsByPuuid(client, route, puuid, options) {
|
|
92
|
+
const params = {};
|
|
93
|
+
if (options) {
|
|
94
|
+
for (const [key, value] of Object.entries(options)) if (value !== void 0) params[key] = String(value);
|
|
95
|
+
}
|
|
96
|
+
return (await client.request(route, `/tft/match/v1/matches/by-puuid/${encodeURIComponent(puuid)}/ids`, "tft-match-v1.getMatchIdsByPuuid", Object.keys(params).length > 0 ? { params } : void 0)).data;
|
|
97
|
+
},
|
|
98
|
+
async getMatch(client, route, matchId) {
|
|
99
|
+
return (await client.request(route, `/tft/match/v1/matches/${encodeURIComponent(matchId)}`, "tft-match-v1.getMatch")).data;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/tft/tft-status-v1.ts
|
|
104
|
+
/**
|
|
105
|
+
* TFT Status API (v1).
|
|
106
|
+
*
|
|
107
|
+
* Retrieve TFT platform status information including incidents and maintenances.
|
|
108
|
+
*
|
|
109
|
+
* All methods require a {@link PlatformRoute} (e.g., 'na1', 'euw1').
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```typescript
|
|
113
|
+
* import { tftStatusV1 } from '@wardbox/whisper/tft';
|
|
114
|
+
*
|
|
115
|
+
* const status = await tftStatusV1.getPlatformData(client, 'na1');
|
|
116
|
+
* console.log(status.name, status.incidents.length);
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
const tftStatusV1 = { async getPlatformData(client, route) {
|
|
120
|
+
return (await client.request(route, "/tft/status/v1/platform-data", "tft-status-v1.getPlatformData")).data;
|
|
121
|
+
} };
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/tft/tft-summoner-v1.ts
|
|
124
|
+
/**
|
|
125
|
+
* TFT Summoner API (v1).
|
|
126
|
+
*
|
|
127
|
+
* Access TFT summoner data by PUUID or RSO access token.
|
|
128
|
+
*
|
|
129
|
+
* All methods require a {@link PlatformRoute} (e.g., 'na1', 'euw1').
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```typescript
|
|
133
|
+
* import { tftSummonerV1 } from '@wardbox/whisper/tft';
|
|
134
|
+
*
|
|
135
|
+
* const summoner = await tftSummonerV1.getByPuuid(client, 'na1', puuid);
|
|
136
|
+
* console.log(summoner.summonerLevel);
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
const tftSummonerV1 = {
|
|
140
|
+
async getByPuuid(client, route, puuid) {
|
|
141
|
+
return (await client.request(route, `/tft/summoner/v1/summoners/by-puuid/${encodeURIComponent(puuid)}`, "tft-summoner-v1.getByPuuid")).data;
|
|
142
|
+
},
|
|
143
|
+
async getByAccessToken(client, route, accessToken) {
|
|
144
|
+
return (await client.request(route, "/tft/summoner/v1/summoners/me", "tft-summoner-v1.getByAccessToken", { headers: { Authorization: `Bearer ${accessToken}` } })).data;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
//#endregion
|
|
148
|
+
exports.spectatorTftV5 = spectatorTftV5;
|
|
149
|
+
exports.tftLeagueV1 = tftLeagueV1;
|
|
150
|
+
exports.tftMatchV1 = tftMatchV1;
|
|
151
|
+
exports.tftStatusV1 = tftStatusV1;
|
|
152
|
+
exports.tftSummonerV1 = tftSummonerV1;
|