@valpro-labs/valorant-api 1.1.0 → 1.3.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/dist/ValorantApi.d.ts +45 -0
- package/dist/ValorantApi.js +48 -0
- package/dist/endpoints/AgentsEndpoints.d.ts +13 -0
- package/dist/endpoints/AgentsEndpoints.js +13 -0
- package/dist/endpoints/BaseEndpoint.d.ts +22 -0
- package/dist/endpoints/BaseEndpoint.js +14 -0
- package/dist/endpoints/BuddiesEndpoints.d.ts +17 -0
- package/dist/endpoints/BuddiesEndpoints.js +17 -0
- package/dist/endpoints/BundlesEndpoints.d.ts +12 -0
- package/dist/endpoints/BundlesEndpoints.js +12 -0
- package/dist/endpoints/CeremoniesEndpoints.d.ts +20 -0
- package/dist/endpoints/CeremoniesEndpoints.js +28 -0
- package/dist/endpoints/CompetitiveTiersEndpoints.d.ts +12 -0
- package/dist/endpoints/CompetitiveTiersEndpoints.js +12 -0
- package/dist/endpoints/ContentTierEndpoints.d.ts +12 -0
- package/dist/endpoints/ContentTierEndpoints.js +12 -0
- package/dist/endpoints/ContractsEndpoints.d.ts +8 -5
- package/dist/endpoints/ContractsEndpoints.js +8 -5
- package/dist/endpoints/CurrenciesEndpoints.d.ts +12 -0
- package/dist/endpoints/CurrenciesEndpoints.js +12 -0
- package/dist/endpoints/EventsEndpoints.d.ts +8 -5
- package/dist/endpoints/EventsEndpoints.js +8 -5
- package/dist/endpoints/FlexEndpoints.d.ts +12 -0
- package/dist/endpoints/FlexEndpoints.js +12 -0
- package/dist/endpoints/GameModesEndpoints.d.ts +24 -1
- package/dist/endpoints/GameModesEndpoints.js +27 -0
- package/dist/endpoints/GearEndpoints.d.ts +20 -0
- package/dist/endpoints/GearEndpoints.js +28 -0
- package/dist/endpoints/LevelBordersEndpoints.d.ts +12 -0
- package/dist/endpoints/LevelBordersEndpoints.js +12 -0
- package/dist/endpoints/MapsEndpoints.d.ts +12 -0
- package/dist/endpoints/MapsEndpoints.js +12 -0
- package/dist/endpoints/MissionsEndpoints.d.ts +12 -0
- package/dist/endpoints/MissionsEndpoints.js +12 -0
- package/dist/endpoints/ObjectivesEndpoints.d.ts +12 -0
- package/dist/endpoints/ObjectivesEndpoints.js +12 -0
- package/dist/endpoints/PlayerCardsEndpoints.d.ts +12 -0
- package/dist/endpoints/PlayerCardsEndpoints.js +12 -0
- package/dist/endpoints/PlayerTitlesEndpoints.d.ts +12 -0
- package/dist/endpoints/PlayerTitlesEndpoints.js +12 -0
- package/dist/endpoints/SeasonsEndpoints.d.ts +20 -6
- package/dist/endpoints/SeasonsEndpoints.js +23 -5
- package/dist/endpoints/SpraysEndpoints.d.ts +19 -1
- package/dist/endpoints/SpraysEndpoints.js +20 -0
- package/dist/endpoints/ThemesEndpoints.d.ts +20 -0
- package/dist/endpoints/ThemesEndpoints.js +28 -0
- package/dist/endpoints/VersionEndpoint.d.ts +7 -0
- package/dist/endpoints/VersionEndpoint.js +7 -0
- package/dist/endpoints/WeaponsEndpoints.d.ts +36 -1
- package/dist/endpoints/WeaponsEndpoints.js +43 -0
- package/dist/endpoints/index.d.ts +3 -0
- package/dist/endpoints/index.js +3 -0
- package/dist/schemas/AgentSchemas.d.ts +14 -0
- package/dist/schemas/AgentSchemas.js +7 -0
- package/dist/schemas/BuddySchemas.d.ts +8 -0
- package/dist/schemas/BuddySchemas.js +4 -0
- package/dist/schemas/BundleSchemas.d.ts +6 -0
- package/dist/schemas/BundleSchemas.js +3 -0
- package/dist/schemas/CeremonySchemas.d.ts +17 -0
- package/dist/schemas/CeremonySchemas.js +12 -0
- package/dist/schemas/CompetitiveTierSchemas.d.ts +6 -0
- package/dist/schemas/CompetitiveTierSchemas.js +3 -0
- package/dist/schemas/ContentTierSchemas.d.ts +4 -0
- package/dist/schemas/ContentTierSchemas.js +2 -0
- package/dist/schemas/ContractSchemas.d.ts +12 -0
- package/dist/schemas/ContractSchemas.js +6 -0
- package/dist/schemas/CurrencySchemas.d.ts +4 -0
- package/dist/schemas/CurrencySchemas.js +2 -0
- package/dist/schemas/EventSchemas.d.ts +4 -0
- package/dist/schemas/EventSchemas.js +2 -0
- package/dist/schemas/FlexSchemas.d.ts +4 -0
- package/dist/schemas/FlexSchemas.js +2 -0
- package/dist/schemas/GameModeEquippableSchemas.d.ts +23 -0
- package/dist/schemas/GameModeEquippableSchemas.js +16 -0
- package/dist/schemas/GameModeSchemas.d.ts +8 -0
- package/dist/schemas/GameModeSchemas.js +4 -0
- package/dist/schemas/GearSchemas.d.ts +69 -0
- package/dist/schemas/GearSchemas.js +30 -0
- package/dist/schemas/LevelBorderSchemas.d.ts +4 -0
- package/dist/schemas/LevelBorderSchemas.js +2 -0
- package/dist/schemas/MapSchemas.d.ts +12 -0
- package/dist/schemas/MapSchemas.js +6 -0
- package/dist/schemas/MissionSchemas.d.ts +6 -0
- package/dist/schemas/MissionSchemas.js +3 -0
- package/dist/schemas/ObjectiveSchemas.d.ts +4 -0
- package/dist/schemas/ObjectiveSchemas.js +2 -0
- package/dist/schemas/PlayerCardSchemas.d.ts +4 -0
- package/dist/schemas/PlayerCardSchemas.js +2 -0
- package/dist/schemas/PlayerTitleSchemas.d.ts +4 -0
- package/dist/schemas/PlayerTitleSchemas.js +2 -0
- package/dist/schemas/SeasonSchemas.d.ts +53 -0
- package/dist/schemas/SeasonSchemas.js +24 -1
- package/dist/schemas/SharedSchemas.d.ts +2 -0
- package/dist/schemas/SharedSchemas.js +1 -0
- package/dist/schemas/SpraySchemas.d.ts +6 -0
- package/dist/schemas/SpraySchemas.js +3 -0
- package/dist/schemas/ThemeSchemas.d.ts +21 -0
- package/dist/schemas/ThemeSchemas.js +14 -0
- package/dist/schemas/VersionSchemas.d.ts +2 -0
- package/dist/schemas/VersionSchemas.js +1 -0
- package/dist/schemas/WeaponSchemas.d.ts +26 -0
- package/dist/schemas/WeaponSchemas.js +13 -0
- package/dist/schemas/index.d.ts +4 -0
- package/dist/schemas/index.js +4 -0
- package/package.json +1 -1
package/dist/ValorantApi.d.ts
CHANGED
|
@@ -19,27 +19,72 @@ import { GameModesEndpoints } from './endpoints/GameModesEndpoints';
|
|
|
19
19
|
import { ContractsEndpoints } from './endpoints/ContractsEndpoints';
|
|
20
20
|
import { EventsEndpoints } from './endpoints/EventsEndpoints';
|
|
21
21
|
import { SeasonsEndpoints } from './endpoints/SeasonsEndpoints';
|
|
22
|
+
import { CeremoniesEndpoints } from './endpoints/CeremoniesEndpoints';
|
|
23
|
+
import { GearEndpoints } from './endpoints/GearEndpoints';
|
|
24
|
+
import { ThemesEndpoints } from './endpoints/ThemesEndpoints';
|
|
25
|
+
/**
|
|
26
|
+
* Main client for the Valorant API.
|
|
27
|
+
* Provides access to all available API endpoints through dedicated endpoint properties.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* import { ValorantApi } from '@valpro-labs/valorant-api';
|
|
32
|
+
*
|
|
33
|
+
* const api = new ValorantApi({ language: 'en-US' });
|
|
34
|
+
* const agents = await api.agentsEndpoints.getAgentsV1();
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
22
37
|
declare class ValorantApi {
|
|
38
|
+
/** Endpoint for retrieving the current Valorant build version. */
|
|
23
39
|
versionEndpoint: VersionEndpoint;
|
|
40
|
+
/** Endpoints for retrieving map data. */
|
|
24
41
|
mapsEndpoints: MapsEndpoints;
|
|
42
|
+
/** Endpoints for retrieving agent data. */
|
|
25
43
|
agentsEndpoints: AgentsEndpoints;
|
|
44
|
+
/** Endpoints for retrieving weapon, skin, chroma, and level data. */
|
|
26
45
|
weaponsEndpoints: WeaponsEndpoints;
|
|
46
|
+
/** Endpoints for retrieving content tier (rarity) data. */
|
|
27
47
|
contentTierEndpoints: ContentTierEndpoints;
|
|
48
|
+
/** Endpoints for retrieving in-game currency data. */
|
|
28
49
|
currenciesEndpoints: CurrenciesEndpoints;
|
|
50
|
+
/** Endpoints for retrieving store bundle data. */
|
|
29
51
|
bundlesEndpoints: BundlesEndpoints;
|
|
52
|
+
/** Endpoints for retrieving mission data. */
|
|
30
53
|
missionsEndpoints: MissionsEndpoints;
|
|
54
|
+
/** Endpoints for retrieving objective data. */
|
|
31
55
|
objectivesEndpoints: ObjectivesEndpoints;
|
|
56
|
+
/** Endpoints for retrieving player card data. */
|
|
32
57
|
playerCardsEndpoints: PlayerCardsEndpoints;
|
|
58
|
+
/** Endpoints for retrieving player title data. */
|
|
33
59
|
playerTitlesEndpoints: PlayerTitlesEndpoints;
|
|
60
|
+
/** Endpoints for retrieving level border data. */
|
|
34
61
|
levelBordersEndpoints: LevelBordersEndpoints;
|
|
62
|
+
/** Endpoints for retrieving buddy (gun charm) data. */
|
|
35
63
|
buddiesEndpoints: BuddiesEndpoints;
|
|
64
|
+
/** Endpoints for retrieving spray data. */
|
|
36
65
|
spraysEndpoints: SpraysEndpoints;
|
|
66
|
+
/** Endpoints for retrieving competitive tier data. */
|
|
37
67
|
competitiveTiersEndpoints: CompetitiveTiersEndpoints;
|
|
68
|
+
/** Endpoints for retrieving flex data. */
|
|
38
69
|
flexEndpoints: FlexEndpoints;
|
|
70
|
+
/** Endpoints for retrieving game mode and equippable data. */
|
|
39
71
|
gameModesEndpoints: GameModesEndpoints;
|
|
72
|
+
/** Endpoints for retrieving contract data. */
|
|
40
73
|
contractsEndpoints: ContractsEndpoints;
|
|
74
|
+
/** Endpoints for retrieving event data. */
|
|
41
75
|
eventsEndpoints: EventsEndpoints;
|
|
76
|
+
/** Endpoints for retrieving season and competitive season data. */
|
|
42
77
|
seasonsEndpoints: SeasonsEndpoints;
|
|
78
|
+
/** Endpoints for retrieving ceremony data. */
|
|
79
|
+
ceremoniesEndpoints: CeremoniesEndpoints;
|
|
80
|
+
/** Endpoints for retrieving gear (armor) data. */
|
|
81
|
+
gearEndpoints: GearEndpoints;
|
|
82
|
+
/** Endpoints for retrieving theme data. */
|
|
83
|
+
themesEndpoints: ThemesEndpoints;
|
|
84
|
+
/**
|
|
85
|
+
* Creates a new Valorant API client.
|
|
86
|
+
* @param config - Optional configuration for the API client.
|
|
87
|
+
*/
|
|
43
88
|
constructor(config?: ValorantApiConfig);
|
|
44
89
|
}
|
|
45
90
|
export { ValorantApi };
|
package/dist/ValorantApi.js
CHANGED
|
@@ -21,27 +21,72 @@ const GameModesEndpoints_1 = require("./endpoints/GameModesEndpoints");
|
|
|
21
21
|
const ContractsEndpoints_1 = require("./endpoints/ContractsEndpoints");
|
|
22
22
|
const EventsEndpoints_1 = require("./endpoints/EventsEndpoints");
|
|
23
23
|
const SeasonsEndpoints_1 = require("./endpoints/SeasonsEndpoints");
|
|
24
|
+
const CeremoniesEndpoints_1 = require("./endpoints/CeremoniesEndpoints");
|
|
25
|
+
const GearEndpoints_1 = require("./endpoints/GearEndpoints");
|
|
26
|
+
const ThemesEndpoints_1 = require("./endpoints/ThemesEndpoints");
|
|
27
|
+
/**
|
|
28
|
+
* Main client for the Valorant API.
|
|
29
|
+
* Provides access to all available API endpoints through dedicated endpoint properties.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* import { ValorantApi } from '@valpro-labs/valorant-api';
|
|
34
|
+
*
|
|
35
|
+
* const api = new ValorantApi({ language: 'en-US' });
|
|
36
|
+
* const agents = await api.agentsEndpoints.getAgentsV1();
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
24
39
|
class ValorantApi {
|
|
40
|
+
/** Endpoint for retrieving the current Valorant build version. */
|
|
25
41
|
versionEndpoint;
|
|
42
|
+
/** Endpoints for retrieving map data. */
|
|
26
43
|
mapsEndpoints;
|
|
44
|
+
/** Endpoints for retrieving agent data. */
|
|
27
45
|
agentsEndpoints;
|
|
46
|
+
/** Endpoints for retrieving weapon, skin, chroma, and level data. */
|
|
28
47
|
weaponsEndpoints;
|
|
48
|
+
/** Endpoints for retrieving content tier (rarity) data. */
|
|
29
49
|
contentTierEndpoints;
|
|
50
|
+
/** Endpoints for retrieving in-game currency data. */
|
|
30
51
|
currenciesEndpoints;
|
|
52
|
+
/** Endpoints for retrieving store bundle data. */
|
|
31
53
|
bundlesEndpoints;
|
|
54
|
+
/** Endpoints for retrieving mission data. */
|
|
32
55
|
missionsEndpoints;
|
|
56
|
+
/** Endpoints for retrieving objective data. */
|
|
33
57
|
objectivesEndpoints;
|
|
58
|
+
/** Endpoints for retrieving player card data. */
|
|
34
59
|
playerCardsEndpoints;
|
|
60
|
+
/** Endpoints for retrieving player title data. */
|
|
35
61
|
playerTitlesEndpoints;
|
|
62
|
+
/** Endpoints for retrieving level border data. */
|
|
36
63
|
levelBordersEndpoints;
|
|
64
|
+
/** Endpoints for retrieving buddy (gun charm) data. */
|
|
37
65
|
buddiesEndpoints;
|
|
66
|
+
/** Endpoints for retrieving spray data. */
|
|
38
67
|
spraysEndpoints;
|
|
68
|
+
/** Endpoints for retrieving competitive tier data. */
|
|
39
69
|
competitiveTiersEndpoints;
|
|
70
|
+
/** Endpoints for retrieving flex data. */
|
|
40
71
|
flexEndpoints;
|
|
72
|
+
/** Endpoints for retrieving game mode and equippable data. */
|
|
41
73
|
gameModesEndpoints;
|
|
74
|
+
/** Endpoints for retrieving contract data. */
|
|
42
75
|
contractsEndpoints;
|
|
76
|
+
/** Endpoints for retrieving event data. */
|
|
43
77
|
eventsEndpoints;
|
|
78
|
+
/** Endpoints for retrieving season and competitive season data. */
|
|
44
79
|
seasonsEndpoints;
|
|
80
|
+
/** Endpoints for retrieving ceremony data. */
|
|
81
|
+
ceremoniesEndpoints;
|
|
82
|
+
/** Endpoints for retrieving gear (armor) data. */
|
|
83
|
+
gearEndpoints;
|
|
84
|
+
/** Endpoints for retrieving theme data. */
|
|
85
|
+
themesEndpoints;
|
|
86
|
+
/**
|
|
87
|
+
* Creates a new Valorant API client.
|
|
88
|
+
* @param config - Optional configuration for the API client.
|
|
89
|
+
*/
|
|
45
90
|
constructor(config) {
|
|
46
91
|
this.versionEndpoint = new VersionEndpoint_1.VersionEndpoint(config);
|
|
47
92
|
this.mapsEndpoints = new MapsEndpoints_1.MapsEndpoints(config);
|
|
@@ -63,6 +108,9 @@ class ValorantApi {
|
|
|
63
108
|
this.contractsEndpoints = new ContractsEndpoints_1.ContractsEndpoints(config);
|
|
64
109
|
this.eventsEndpoints = new EventsEndpoints_1.EventsEndpoints(config);
|
|
65
110
|
this.seasonsEndpoints = new SeasonsEndpoints_1.SeasonsEndpoints(config);
|
|
111
|
+
this.ceremoniesEndpoints = new CeremoniesEndpoints_1.CeremoniesEndpoints(config);
|
|
112
|
+
this.gearEndpoints = new GearEndpoints_1.GearEndpoints(config);
|
|
113
|
+
this.themesEndpoints = new ThemesEndpoints_1.ThemesEndpoints(config);
|
|
66
114
|
}
|
|
67
115
|
}
|
|
68
116
|
exports.ValorantApi = ValorantApi;
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import { BaseEndpoint, ValorantApiConfig } from './BaseEndpoint';
|
|
2
2
|
import { AgentResponse, AgentsResponse } from '../schemas';
|
|
3
|
+
/**
|
|
4
|
+
* Provides access to the Valorant API agents endpoints.
|
|
5
|
+
*/
|
|
3
6
|
declare class AgentsEndpoints extends BaseEndpoint {
|
|
4
7
|
constructor(config?: ValorantApiConfig);
|
|
8
|
+
/**
|
|
9
|
+
* Get all agents.
|
|
10
|
+
* @param isPlayableCharacter - Filter to only playable characters. Defaults to `true`.
|
|
11
|
+
* @returns An array of {@link AgentResponse} objects.
|
|
12
|
+
*/
|
|
5
13
|
getAgentsV1(isPlayableCharacter?: boolean): Promise<AgentsResponse>;
|
|
14
|
+
/**
|
|
15
|
+
* Get an agent by UUID.
|
|
16
|
+
* @param uuid - The UUID of the agent.
|
|
17
|
+
* @returns The {@link AgentResponse} matching the given UUID.
|
|
18
|
+
*/
|
|
6
19
|
getAgentsByUuidV1(uuid: string): Promise<AgentResponse>;
|
|
7
20
|
}
|
|
8
21
|
export { AgentsEndpoints };
|
|
@@ -2,10 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AgentsEndpoints = void 0;
|
|
4
4
|
const BaseEndpoint_1 = require("./BaseEndpoint");
|
|
5
|
+
/**
|
|
6
|
+
* Provides access to the Valorant API agents endpoints.
|
|
7
|
+
*/
|
|
5
8
|
class AgentsEndpoints extends BaseEndpoint_1.BaseEndpoint {
|
|
6
9
|
constructor(config) {
|
|
7
10
|
super(config);
|
|
8
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Get all agents.
|
|
14
|
+
* @param isPlayableCharacter - Filter to only playable characters. Defaults to `true`.
|
|
15
|
+
* @returns An array of {@link AgentResponse} objects.
|
|
16
|
+
*/
|
|
9
17
|
async getAgentsV1(isPlayableCharacter = true) {
|
|
10
18
|
let endpointUrl = 'v1/agents';
|
|
11
19
|
if (isPlayableCharacter) {
|
|
@@ -13,6 +21,11 @@ class AgentsEndpoints extends BaseEndpoint_1.BaseEndpoint {
|
|
|
13
21
|
}
|
|
14
22
|
return this.requestValorantApi(endpointUrl);
|
|
15
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Get an agent by UUID.
|
|
26
|
+
* @param uuid - The UUID of the agent.
|
|
27
|
+
* @returns The {@link AgentResponse} matching the given UUID.
|
|
28
|
+
*/
|
|
16
29
|
async getAgentsByUuidV1(uuid) {
|
|
17
30
|
return this.requestValorantApi(`v1/agents/${uuid}`);
|
|
18
31
|
}
|
|
@@ -1,10 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supported locale codes for the Valorant API.
|
|
3
|
+
* Controls the language of localized strings in API responses.
|
|
4
|
+
*/
|
|
1
5
|
export type ValorantLocale = 'ar-AE' | 'de-DE' | 'en-US' | 'es-ES' | 'es-MX' | 'fr-FR' | 'id-ID' | 'it-IT' | 'ja-JP' | 'ko-KR' | 'pl-PL' | 'pt-BR' | 'ru-RU' | 'th-TH' | 'tr-TR' | 'vi-VN' | 'zh-CN' | 'zh-TW';
|
|
6
|
+
/**
|
|
7
|
+
* Configuration options for the Valorant API client.
|
|
8
|
+
*/
|
|
2
9
|
export interface ValorantApiConfig {
|
|
10
|
+
/** The language/locale for API responses. Defaults to `'en-US'`. */
|
|
3
11
|
language?: ValorantLocale;
|
|
4
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Base class for all Valorant API endpoint classes.
|
|
15
|
+
* Provides shared HTTP request logic and locale configuration.
|
|
16
|
+
*/
|
|
5
17
|
declare class BaseEndpoint {
|
|
18
|
+
/** The configured locale for API requests. */
|
|
6
19
|
protected language: ValorantLocale;
|
|
20
|
+
/**
|
|
21
|
+
* @param config - Optional configuration for the API client.
|
|
22
|
+
*/
|
|
7
23
|
constructor(config?: ValorantApiConfig);
|
|
24
|
+
/**
|
|
25
|
+
* Sends a GET request to the Valorant API.
|
|
26
|
+
* @typeParam T - The expected shape of the response data.
|
|
27
|
+
* @param endpointUrl - The API endpoint path (e.g. `v1/agents`).
|
|
28
|
+
* @returns The parsed response data.
|
|
29
|
+
*/
|
|
8
30
|
requestValorantApi<T>(endpointUrl: string): Promise<T>;
|
|
9
31
|
}
|
|
10
32
|
export { BaseEndpoint };
|
|
@@ -5,11 +5,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.BaseEndpoint = void 0;
|
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
|
8
|
+
/**
|
|
9
|
+
* Base class for all Valorant API endpoint classes.
|
|
10
|
+
* Provides shared HTTP request logic and locale configuration.
|
|
11
|
+
*/
|
|
8
12
|
class BaseEndpoint {
|
|
13
|
+
/** The configured locale for API requests. */
|
|
9
14
|
language;
|
|
15
|
+
/**
|
|
16
|
+
* @param config - Optional configuration for the API client.
|
|
17
|
+
*/
|
|
10
18
|
constructor(config) {
|
|
11
19
|
this.language = config?.language || 'en-US';
|
|
12
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Sends a GET request to the Valorant API.
|
|
23
|
+
* @typeParam T - The expected shape of the response data.
|
|
24
|
+
* @param endpointUrl - The API endpoint path (e.g. `v1/agents`).
|
|
25
|
+
* @returns The parsed response data.
|
|
26
|
+
*/
|
|
13
27
|
async requestValorantApi(endpointUrl) {
|
|
14
28
|
const baseUrl = 'https://valorant-api.com/';
|
|
15
29
|
const url = new URL(endpointUrl, baseUrl);
|
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
import { BaseEndpoint, ValorantApiConfig } from './BaseEndpoint';
|
|
2
2
|
import { BuddyResponse, BuddiesResponse, BuddyLevelResponse } from '../schemas';
|
|
3
|
+
/**
|
|
4
|
+
* Provides access to the Valorant API buddies (gun charms) endpoints.
|
|
5
|
+
*/
|
|
3
6
|
declare class BuddiesEndpoints extends BaseEndpoint {
|
|
4
7
|
constructor(config?: ValorantApiConfig);
|
|
8
|
+
/**
|
|
9
|
+
* Get all buddies.
|
|
10
|
+
* @returns An array of {@link BuddyResponse} objects.
|
|
11
|
+
*/
|
|
5
12
|
getBuddiesV1(): Promise<BuddiesResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Get a buddy by UUID.
|
|
15
|
+
* @param uuid - The UUID of the buddy.
|
|
16
|
+
* @returns The {@link BuddyResponse} matching the given UUID.
|
|
17
|
+
*/
|
|
6
18
|
getBuddyByUuidV1(uuid: string): Promise<BuddyResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Get a buddy level by UUID.
|
|
21
|
+
* @param uuid - The UUID of the buddy level.
|
|
22
|
+
* @returns The {@link BuddyLevelResponse} matching the given UUID.
|
|
23
|
+
*/
|
|
7
24
|
getBuddyLevelByUuidV1(uuid: string): Promise<BuddyLevelResponse>;
|
|
8
25
|
}
|
|
9
26
|
export { BuddiesEndpoints };
|
|
@@ -2,16 +2,33 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BuddiesEndpoints = void 0;
|
|
4
4
|
const BaseEndpoint_1 = require("./BaseEndpoint");
|
|
5
|
+
/**
|
|
6
|
+
* Provides access to the Valorant API buddies (gun charms) endpoints.
|
|
7
|
+
*/
|
|
5
8
|
class BuddiesEndpoints extends BaseEndpoint_1.BaseEndpoint {
|
|
6
9
|
constructor(config) {
|
|
7
10
|
super(config);
|
|
8
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Get all buddies.
|
|
14
|
+
* @returns An array of {@link BuddyResponse} objects.
|
|
15
|
+
*/
|
|
9
16
|
async getBuddiesV1() {
|
|
10
17
|
return this.requestValorantApi('v1/buddies');
|
|
11
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Get a buddy by UUID.
|
|
21
|
+
* @param uuid - The UUID of the buddy.
|
|
22
|
+
* @returns The {@link BuddyResponse} matching the given UUID.
|
|
23
|
+
*/
|
|
12
24
|
async getBuddyByUuidV1(uuid) {
|
|
13
25
|
return this.requestValorantApi(`v1/buddies/${uuid}`);
|
|
14
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Get a buddy level by UUID.
|
|
29
|
+
* @param uuid - The UUID of the buddy level.
|
|
30
|
+
* @returns The {@link BuddyLevelResponse} matching the given UUID.
|
|
31
|
+
*/
|
|
15
32
|
async getBuddyLevelByUuidV1(uuid) {
|
|
16
33
|
return this.requestValorantApi(`v1/buddies/levels/${uuid}`);
|
|
17
34
|
}
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { BaseEndpoint, ValorantApiConfig } from './BaseEndpoint';
|
|
2
2
|
import { BundleResponse, BundlesResponse } from '../schemas';
|
|
3
|
+
/**
|
|
4
|
+
* Provides access to the Valorant API bundles endpoints.
|
|
5
|
+
*/
|
|
3
6
|
declare class BundlesEndpoints extends BaseEndpoint {
|
|
4
7
|
constructor(config?: ValorantApiConfig);
|
|
8
|
+
/**
|
|
9
|
+
* Get all store bundles.
|
|
10
|
+
* @returns An array of {@link BundleResponse} objects.
|
|
11
|
+
*/
|
|
5
12
|
getBundlesV1(): Promise<BundlesResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Get a store bundle by UUID.
|
|
15
|
+
* @param uuid - The UUID of the bundle.
|
|
16
|
+
* @returns The {@link BundleResponse} matching the given UUID.
|
|
17
|
+
*/
|
|
6
18
|
getBundleByUuidV1(uuid: string): Promise<BundleResponse>;
|
|
7
19
|
}
|
|
8
20
|
export { BundlesEndpoints };
|
|
@@ -2,13 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BundlesEndpoints = void 0;
|
|
4
4
|
const BaseEndpoint_1 = require("./BaseEndpoint");
|
|
5
|
+
/**
|
|
6
|
+
* Provides access to the Valorant API bundles endpoints.
|
|
7
|
+
*/
|
|
5
8
|
class BundlesEndpoints extends BaseEndpoint_1.BaseEndpoint {
|
|
6
9
|
constructor(config) {
|
|
7
10
|
super(config);
|
|
8
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Get all store bundles.
|
|
14
|
+
* @returns An array of {@link BundleResponse} objects.
|
|
15
|
+
*/
|
|
9
16
|
async getBundlesV1() {
|
|
10
17
|
return this.requestValorantApi('v1/bundles');
|
|
11
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Get a store bundle by UUID.
|
|
21
|
+
* @param uuid - The UUID of the bundle.
|
|
22
|
+
* @returns The {@link BundleResponse} matching the given UUID.
|
|
23
|
+
*/
|
|
12
24
|
async getBundleByUuidV1(uuid) {
|
|
13
25
|
return this.requestValorantApi(`v1/bundles/${uuid}`);
|
|
14
26
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseEndpoint, ValorantApiConfig } from './BaseEndpoint';
|
|
2
|
+
import { CeremonyResponse, CeremoniesResponse } from '../schemas';
|
|
3
|
+
/**
|
|
4
|
+
* Provides access to the Valorant API ceremonies endpoints.
|
|
5
|
+
*/
|
|
6
|
+
declare class CeremoniesEndpoints extends BaseEndpoint {
|
|
7
|
+
constructor(config?: ValorantApiConfig);
|
|
8
|
+
/**
|
|
9
|
+
* Get all ceremonies.
|
|
10
|
+
* @returns An array of {@link CeremonyResponse} objects.
|
|
11
|
+
*/
|
|
12
|
+
getCeremoniesV1(): Promise<CeremoniesResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Get a ceremony by UUID.
|
|
15
|
+
* @param uuid - The UUID of the ceremony.
|
|
16
|
+
* @returns The {@link CeremonyResponse} matching the given UUID.
|
|
17
|
+
*/
|
|
18
|
+
getCeremonyByUuidV1(uuid: string): Promise<CeremonyResponse>;
|
|
19
|
+
}
|
|
20
|
+
export { CeremoniesEndpoints };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CeremoniesEndpoints = void 0;
|
|
4
|
+
const BaseEndpoint_1 = require("./BaseEndpoint");
|
|
5
|
+
/**
|
|
6
|
+
* Provides access to the Valorant API ceremonies endpoints.
|
|
7
|
+
*/
|
|
8
|
+
class CeremoniesEndpoints extends BaseEndpoint_1.BaseEndpoint {
|
|
9
|
+
constructor(config) {
|
|
10
|
+
super(config);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Get all ceremonies.
|
|
14
|
+
* @returns An array of {@link CeremonyResponse} objects.
|
|
15
|
+
*/
|
|
16
|
+
async getCeremoniesV1() {
|
|
17
|
+
return this.requestValorantApi('v1/ceremonies');
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Get a ceremony by UUID.
|
|
21
|
+
* @param uuid - The UUID of the ceremony.
|
|
22
|
+
* @returns The {@link CeremonyResponse} matching the given UUID.
|
|
23
|
+
*/
|
|
24
|
+
async getCeremonyByUuidV1(uuid) {
|
|
25
|
+
return this.requestValorantApi(`v1/ceremonies/${uuid}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.CeremoniesEndpoints = CeremoniesEndpoints;
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { BaseEndpoint, ValorantApiConfig } from './BaseEndpoint';
|
|
2
2
|
import { CompetitiveTierSetResponse, CompetitiveTiersResponse } from '../schemas';
|
|
3
|
+
/**
|
|
4
|
+
* Provides access to the Valorant API competitive tiers endpoints.
|
|
5
|
+
*/
|
|
3
6
|
declare class CompetitiveTiersEndpoints extends BaseEndpoint {
|
|
4
7
|
constructor(config?: ValorantApiConfig);
|
|
8
|
+
/**
|
|
9
|
+
* Get all competitive tier sets.
|
|
10
|
+
* @returns An array of {@link CompetitiveTierSetResponse} objects.
|
|
11
|
+
*/
|
|
5
12
|
getCompetitiveTiersV1(): Promise<CompetitiveTiersResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Get a competitive tier set by UUID.
|
|
15
|
+
* @param uuid - The UUID of the competitive tier set.
|
|
16
|
+
* @returns The {@link CompetitiveTierSetResponse} matching the given UUID.
|
|
17
|
+
*/
|
|
6
18
|
getCompetitiveTiersByUuidV1(uuid: string): Promise<CompetitiveTierSetResponse>;
|
|
7
19
|
}
|
|
8
20
|
export { CompetitiveTiersEndpoints };
|
|
@@ -2,13 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CompetitiveTiersEndpoints = void 0;
|
|
4
4
|
const BaseEndpoint_1 = require("./BaseEndpoint");
|
|
5
|
+
/**
|
|
6
|
+
* Provides access to the Valorant API competitive tiers endpoints.
|
|
7
|
+
*/
|
|
5
8
|
class CompetitiveTiersEndpoints extends BaseEndpoint_1.BaseEndpoint {
|
|
6
9
|
constructor(config) {
|
|
7
10
|
super(config);
|
|
8
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Get all competitive tier sets.
|
|
14
|
+
* @returns An array of {@link CompetitiveTierSetResponse} objects.
|
|
15
|
+
*/
|
|
9
16
|
async getCompetitiveTiersV1() {
|
|
10
17
|
return this.requestValorantApi('v1/competitivetiers');
|
|
11
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Get a competitive tier set by UUID.
|
|
21
|
+
* @param uuid - The UUID of the competitive tier set.
|
|
22
|
+
* @returns The {@link CompetitiveTierSetResponse} matching the given UUID.
|
|
23
|
+
*/
|
|
12
24
|
async getCompetitiveTiersByUuidV1(uuid) {
|
|
13
25
|
return this.requestValorantApi(`v1/competitivetiers/${uuid}`);
|
|
14
26
|
}
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { BaseEndpoint, ValorantApiConfig } from './BaseEndpoint';
|
|
2
2
|
import { ContentTierResponse, ContentTiersResponse } from '../schemas';
|
|
3
|
+
/**
|
|
4
|
+
* Provides access to the Valorant API content tiers (rarities) endpoints.
|
|
5
|
+
*/
|
|
3
6
|
declare class ContentTierEndpoints extends BaseEndpoint {
|
|
4
7
|
constructor(config?: ValorantApiConfig);
|
|
8
|
+
/**
|
|
9
|
+
* Get all content tiers.
|
|
10
|
+
* @returns An array of {@link ContentTierResponse} objects.
|
|
11
|
+
*/
|
|
5
12
|
getContentTiersV1(): Promise<ContentTiersResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Get a content tier by UUID.
|
|
15
|
+
* @param uuid - The UUID of the content tier.
|
|
16
|
+
* @returns The {@link ContentTierResponse} matching the given UUID.
|
|
17
|
+
*/
|
|
6
18
|
getContentTierByUuidV1(uuid: string): Promise<ContentTierResponse>;
|
|
7
19
|
}
|
|
8
20
|
export { ContentTierEndpoints };
|
|
@@ -2,13 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ContentTierEndpoints = void 0;
|
|
4
4
|
const BaseEndpoint_1 = require("./BaseEndpoint");
|
|
5
|
+
/**
|
|
6
|
+
* Provides access to the Valorant API content tiers (rarities) endpoints.
|
|
7
|
+
*/
|
|
5
8
|
class ContentTierEndpoints extends BaseEndpoint_1.BaseEndpoint {
|
|
6
9
|
constructor(config) {
|
|
7
10
|
super(config);
|
|
8
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Get all content tiers.
|
|
14
|
+
* @returns An array of {@link ContentTierResponse} objects.
|
|
15
|
+
*/
|
|
9
16
|
async getContentTiersV1() {
|
|
10
17
|
return this.requestValorantApi('v1/contenttiers');
|
|
11
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Get a content tier by UUID.
|
|
21
|
+
* @param uuid - The UUID of the content tier.
|
|
22
|
+
* @returns The {@link ContentTierResponse} matching the given UUID.
|
|
23
|
+
*/
|
|
12
24
|
async getContentTierByUuidV1(uuid) {
|
|
13
25
|
return this.requestValorantApi(`v1/contenttiers/${uuid}`);
|
|
14
26
|
}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { BaseEndpoint, ValorantApiConfig } from './BaseEndpoint';
|
|
2
2
|
import { ContractResponse, ContractsResponse } from '../schemas';
|
|
3
|
+
/**
|
|
4
|
+
* Provides access to the Valorant API contracts endpoints.
|
|
5
|
+
*/
|
|
3
6
|
declare class ContractsEndpoints extends BaseEndpoint {
|
|
4
7
|
constructor(config?: ValorantApiConfig);
|
|
5
8
|
/**
|
|
6
|
-
* Get all contracts
|
|
7
|
-
* @returns
|
|
9
|
+
* Get all contracts.
|
|
10
|
+
* @returns An array of {@link ContractResponse} objects.
|
|
8
11
|
*/
|
|
9
12
|
getContractsV1(): Promise<ContractsResponse>;
|
|
10
13
|
/**
|
|
11
|
-
* Get contract by UUID
|
|
12
|
-
* @param uuid
|
|
13
|
-
* @returns
|
|
14
|
+
* Get a contract by UUID.
|
|
15
|
+
* @param uuid - The UUID of the contract.
|
|
16
|
+
* @returns The {@link ContractResponse} matching the given UUID.
|
|
14
17
|
*/
|
|
15
18
|
getContractByUuidV1(uuid: string): Promise<ContractResponse>;
|
|
16
19
|
}
|
|
@@ -3,21 +3,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ContractsEndpoints = void 0;
|
|
4
4
|
const BaseEndpoint_1 = require("./BaseEndpoint");
|
|
5
5
|
// Types already defined above
|
|
6
|
+
/**
|
|
7
|
+
* Provides access to the Valorant API contracts endpoints.
|
|
8
|
+
*/
|
|
6
9
|
class ContractsEndpoints extends BaseEndpoint_1.BaseEndpoint {
|
|
7
10
|
constructor(config) {
|
|
8
11
|
super(config);
|
|
9
12
|
}
|
|
10
13
|
/**
|
|
11
|
-
* Get all contracts
|
|
12
|
-
* @returns
|
|
14
|
+
* Get all contracts.
|
|
15
|
+
* @returns An array of {@link ContractResponse} objects.
|
|
13
16
|
*/
|
|
14
17
|
async getContractsV1() {
|
|
15
18
|
return this.requestValorantApi('v1/contracts');
|
|
16
19
|
}
|
|
17
20
|
/**
|
|
18
|
-
* Get contract by UUID
|
|
19
|
-
* @param uuid
|
|
20
|
-
* @returns
|
|
21
|
+
* Get a contract by UUID.
|
|
22
|
+
* @param uuid - The UUID of the contract.
|
|
23
|
+
* @returns The {@link ContractResponse} matching the given UUID.
|
|
21
24
|
*/
|
|
22
25
|
async getContractByUuidV1(uuid) {
|
|
23
26
|
return this.requestValorantApi(`v1/contracts/${uuid}`);
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { BaseEndpoint, ValorantApiConfig } from './BaseEndpoint';
|
|
2
2
|
import { CurrencyResponse, CurrenciesResponse } from '../schemas';
|
|
3
|
+
/**
|
|
4
|
+
* Provides access to the Valorant API currencies endpoints.
|
|
5
|
+
*/
|
|
3
6
|
declare class CurrenciesEndpoints extends BaseEndpoint {
|
|
4
7
|
constructor(config?: ValorantApiConfig);
|
|
8
|
+
/**
|
|
9
|
+
* Get all currencies.
|
|
10
|
+
* @returns An array of {@link CurrencyResponse} objects.
|
|
11
|
+
*/
|
|
5
12
|
getCurrenciesV1(): Promise<CurrenciesResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Get a currency by UUID.
|
|
15
|
+
* @param uuid - The UUID of the currency.
|
|
16
|
+
* @returns The {@link CurrencyResponse} matching the given UUID.
|
|
17
|
+
*/
|
|
6
18
|
getCurrencyByUuidV1(uuid: string): Promise<CurrencyResponse>;
|
|
7
19
|
}
|
|
8
20
|
export { CurrenciesEndpoints };
|
|
@@ -2,13 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CurrenciesEndpoints = void 0;
|
|
4
4
|
const BaseEndpoint_1 = require("./BaseEndpoint");
|
|
5
|
+
/**
|
|
6
|
+
* Provides access to the Valorant API currencies endpoints.
|
|
7
|
+
*/
|
|
5
8
|
class CurrenciesEndpoints extends BaseEndpoint_1.BaseEndpoint {
|
|
6
9
|
constructor(config) {
|
|
7
10
|
super(config);
|
|
8
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Get all currencies.
|
|
14
|
+
* @returns An array of {@link CurrencyResponse} objects.
|
|
15
|
+
*/
|
|
9
16
|
async getCurrenciesV1() {
|
|
10
17
|
return this.requestValorantApi('v1/currencies');
|
|
11
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Get a currency by UUID.
|
|
21
|
+
* @param uuid - The UUID of the currency.
|
|
22
|
+
* @returns The {@link CurrencyResponse} matching the given UUID.
|
|
23
|
+
*/
|
|
12
24
|
async getCurrencyByUuidV1(uuid) {
|
|
13
25
|
return this.requestValorantApi(`v1/currencies/${uuid}`);
|
|
14
26
|
}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { BaseEndpoint, ValorantApiConfig } from './BaseEndpoint';
|
|
2
2
|
import { EventResponse, EventsResponse } from '../schemas';
|
|
3
|
+
/**
|
|
4
|
+
* Provides access to the Valorant API events endpoints.
|
|
5
|
+
*/
|
|
3
6
|
declare class EventsEndpoints extends BaseEndpoint {
|
|
4
7
|
constructor(config?: ValorantApiConfig);
|
|
5
8
|
/**
|
|
6
|
-
* Get all events
|
|
7
|
-
* @returns
|
|
9
|
+
* Get all events.
|
|
10
|
+
* @returns An array of {@link EventResponse} objects.
|
|
8
11
|
*/
|
|
9
12
|
getEventsV1(): Promise<EventsResponse>;
|
|
10
13
|
/**
|
|
11
|
-
* Get event by UUID
|
|
12
|
-
* @param uuid
|
|
13
|
-
* @returns
|
|
14
|
+
* Get an event by its UUID.
|
|
15
|
+
* @param uuid - The UUID of the event.
|
|
16
|
+
* @returns The {@link EventResponse} matching the given UUID.
|
|
14
17
|
*/
|
|
15
18
|
getEventByUuidV1(uuid: string): Promise<EventResponse>;
|
|
16
19
|
}
|