@valpro-labs/valorant-api 1.0.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.
Files changed (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +45 -0
  3. package/dist/ValorantApi.d.ts +45 -0
  4. package/dist/ValorantApi.js +68 -0
  5. package/dist/endpoints/AgentsEndpoints.d.ts +168 -0
  6. package/dist/endpoints/AgentsEndpoints.js +80 -0
  7. package/dist/endpoints/BaseEndpoint.d.ts +10 -0
  8. package/dist/endpoints/BaseEndpoint.js +21 -0
  9. package/dist/endpoints/BuddiesEndpoints.d.ts +53 -0
  10. package/dist/endpoints/BuddiesEndpoints.js +37 -0
  11. package/dist/endpoints/BundlesEndpoints.d.ts +36 -0
  12. package/dist/endpoints/BundlesEndpoints.js +31 -0
  13. package/dist/endpoints/CompetitiveTiersEndpoints.d.ts +57 -0
  14. package/dist/endpoints/CompetitiveTiersEndpoints.js +36 -0
  15. package/dist/endpoints/ContentTierEndpoints.d.ts +32 -0
  16. package/dist/endpoints/ContentTierEndpoints.js +29 -0
  17. package/dist/endpoints/ContractsEndpoints.d.ts +168 -0
  18. package/dist/endpoints/ContractsEndpoints.js +65 -0
  19. package/dist/endpoints/CurrenciesEndpoints.d.ts +28 -0
  20. package/dist/endpoints/CurrenciesEndpoints.js +27 -0
  21. package/dist/endpoints/EventsEndpoints.d.ts +35 -0
  22. package/dist/endpoints/EventsEndpoints.js +35 -0
  23. package/dist/endpoints/FlexEndpoints.d.ts +24 -0
  24. package/dist/endpoints/FlexEndpoints.js +26 -0
  25. package/dist/endpoints/GameModesEndpoints.d.ts +70 -0
  26. package/dist/endpoints/GameModesEndpoints.js +46 -0
  27. package/dist/endpoints/LevelBordersEndpoints.d.ts +28 -0
  28. package/dist/endpoints/LevelBordersEndpoints.js +27 -0
  29. package/dist/endpoints/MapsEndpoints.d.ts +127 -0
  30. package/dist/endpoints/MapsEndpoints.js +62 -0
  31. package/dist/endpoints/MissionsEndpoints.d.ts +45 -0
  32. package/dist/endpoints/MissionsEndpoints.js +35 -0
  33. package/dist/endpoints/ObjectivesEndpoints.d.ts +20 -0
  34. package/dist/endpoints/ObjectivesEndpoints.js +23 -0
  35. package/dist/endpoints/PlayerCardsEndpoints.d.ts +32 -0
  36. package/dist/endpoints/PlayerCardsEndpoints.js +29 -0
  37. package/dist/endpoints/PlayerTitlesEndpoints.d.ts +24 -0
  38. package/dist/endpoints/PlayerTitlesEndpoints.js +25 -0
  39. package/dist/endpoints/SeasonsEndpoints.d.ts +39 -0
  40. package/dist/endpoints/SeasonsEndpoints.js +37 -0
  41. package/dist/endpoints/SpraysEndpoints.d.ts +58 -0
  42. package/dist/endpoints/SpraysEndpoints.js +39 -0
  43. package/dist/endpoints/VersionEndpoint.d.ts +18 -0
  44. package/dist/endpoints/VersionEndpoint.js +24 -0
  45. package/dist/endpoints/WeaponsEndpoints.d.ts +309 -0
  46. package/dist/endpoints/WeaponsEndpoints.js +114 -0
  47. package/dist/index.d.ts +23 -0
  48. package/dist/index.js +39 -0
  49. package/dist/schemas/SharedSchemas.d.ts +3 -0
  50. package/dist/schemas/SharedSchemas.js +5 -0
  51. package/package.json +40 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 valpro-labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # Valorant-API (unofficial)
2
+
3
+ [![npm](https://img.shields.io/npm/v/@valpro-labs/valorant-api.svg)](https://www.npmjs.com/package/@valpro-labs/valorant-api)
4
+
5
+ A typed TypeScript client for [valorant-api.com](https://valorant-api.com/). This library provides easy access to Valorant game data with full TypeScript support.
6
+
7
+ ## Features
8
+
9
+ - **Full Type Safety**: All responses are typed for a better developer experience.
10
+ - **Zod Powered Types**: Use [Zod](https://zod.dev/) for robust schema definitions and type inference.
11
+ - **Comprehensive Coverage**: Supporting endpoints for Agents, Maps, Weapons, Contracts, and more.
12
+
13
+ - **Clean API**: Intuitive organizational structure for accessing different game resources.
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ npm install @valpro-labs/valorant-api
19
+ ```
20
+
21
+ ## Example
22
+
23
+ ```typescript
24
+ import { ValorantApi } from '@valpro-labs/valorant-api';
25
+
26
+ const valorantApi = new ValorantApi({ language: 'en-US' });
27
+
28
+ // Get all agents
29
+ const agents = await valorantApi.agentsEndpoints.getAgentsV1();
30
+
31
+ // Get version info
32
+ const version = await valorantApi.versionEndpoint.getVersionV1();
33
+ ```
34
+
35
+ ## Supported Endpoints
36
+
37
+ - Agents
38
+ - Maps
39
+ - Weapons & Skins
40
+ - Bundles
41
+ - Contracts
42
+ - Competitive Tiers
43
+ - And many more...
44
+
45
+ > **@valpro-labs/valorant-api** isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing Riot Games properties. Riot Games, and all associated properties are trademarks or registered trademarks of Riot Games, Inc..
@@ -0,0 +1,45 @@
1
+ import { ValorantApiConfig } from './endpoints/BaseEndpoint';
2
+ import { VersionEndpoint } from './endpoints/VersionEndpoint';
3
+ import { MapsEndpoints } from './endpoints/MapsEndpoints';
4
+ import { AgentsEndpoints } from './endpoints/AgentsEndpoints';
5
+ import { WeaponsEndpoints } from './endpoints/WeaponsEndpoints';
6
+ import { ContentTierEndpoints } from './endpoints/ContentTierEndpoints';
7
+ import { CurrenciesEndpoints } from './endpoints/CurrenciesEndpoints';
8
+ import { BundlesEndpoints } from './endpoints/BundlesEndpoints';
9
+ import { MissionsEndpoints } from './endpoints/MissionsEndpoints';
10
+ import { ObjectivesEndpoints } from './endpoints/ObjectivesEndpoints';
11
+ import { PlayerCardsEndpoints } from './endpoints/PlayerCardsEndpoints';
12
+ import { PlayerTitlesEndpoints } from './endpoints/PlayerTitlesEndpoints';
13
+ import { LevelBordersEndpoints } from './endpoints/LevelBordersEndpoints';
14
+ import { BuddiesEndpoints } from './endpoints/BuddiesEndpoints';
15
+ import { SpraysEndpoints } from './endpoints/SpraysEndpoints';
16
+ import { CompetitiveTiersEndpoints } from './endpoints/CompetitiveTiersEndpoints';
17
+ import { FlexEndpoints } from './endpoints/FlexEndpoints';
18
+ import { GameModesEndpoints } from './endpoints/GameModesEndpoints';
19
+ import { ContractsEndpoints } from './endpoints/ContractsEndpoints';
20
+ import { EventsEndpoints } from './endpoints/EventsEndpoints';
21
+ import { SeasonsEndpoints } from './endpoints/SeasonsEndpoints';
22
+ declare class ValorantApi {
23
+ versionEndpoint: VersionEndpoint;
24
+ mapsEndpoints: MapsEndpoints;
25
+ agentsEndpoints: AgentsEndpoints;
26
+ weaponsEndpoints: WeaponsEndpoints;
27
+ contentTierEndpoints: ContentTierEndpoints;
28
+ currenciesEndpoints: CurrenciesEndpoints;
29
+ bundlesEndpoints: BundlesEndpoints;
30
+ missionsEndpoints: MissionsEndpoints;
31
+ objectivesEndpoints: ObjectivesEndpoints;
32
+ playerCardsEndpoints: PlayerCardsEndpoints;
33
+ playerTitlesEndpoints: PlayerTitlesEndpoints;
34
+ levelBordersEndpoints: LevelBordersEndpoints;
35
+ buddiesEndpoints: BuddiesEndpoints;
36
+ spraysEndpoints: SpraysEndpoints;
37
+ competitiveTiersEndpoints: CompetitiveTiersEndpoints;
38
+ flexEndpoints: FlexEndpoints;
39
+ gameModesEndpoints: GameModesEndpoints;
40
+ contractsEndpoints: ContractsEndpoints;
41
+ eventsEndpoints: EventsEndpoints;
42
+ seasonsEndpoints: SeasonsEndpoints;
43
+ constructor(config?: ValorantApiConfig);
44
+ }
45
+ export { ValorantApi };
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ValorantApi = void 0;
4
+ const VersionEndpoint_1 = require("./endpoints/VersionEndpoint");
5
+ const MapsEndpoints_1 = require("./endpoints/MapsEndpoints");
6
+ const AgentsEndpoints_1 = require("./endpoints/AgentsEndpoints");
7
+ const WeaponsEndpoints_1 = require("./endpoints/WeaponsEndpoints");
8
+ const ContentTierEndpoints_1 = require("./endpoints/ContentTierEndpoints");
9
+ const CurrenciesEndpoints_1 = require("./endpoints/CurrenciesEndpoints");
10
+ const BundlesEndpoints_1 = require("./endpoints/BundlesEndpoints");
11
+ const MissionsEndpoints_1 = require("./endpoints/MissionsEndpoints");
12
+ const ObjectivesEndpoints_1 = require("./endpoints/ObjectivesEndpoints");
13
+ const PlayerCardsEndpoints_1 = require("./endpoints/PlayerCardsEndpoints");
14
+ const PlayerTitlesEndpoints_1 = require("./endpoints/PlayerTitlesEndpoints");
15
+ const LevelBordersEndpoints_1 = require("./endpoints/LevelBordersEndpoints");
16
+ const BuddiesEndpoints_1 = require("./endpoints/BuddiesEndpoints");
17
+ const SpraysEndpoints_1 = require("./endpoints/SpraysEndpoints");
18
+ const CompetitiveTiersEndpoints_1 = require("./endpoints/CompetitiveTiersEndpoints");
19
+ const FlexEndpoints_1 = require("./endpoints/FlexEndpoints");
20
+ const GameModesEndpoints_1 = require("./endpoints/GameModesEndpoints");
21
+ const ContractsEndpoints_1 = require("./endpoints/ContractsEndpoints");
22
+ const EventsEndpoints_1 = require("./endpoints/EventsEndpoints");
23
+ const SeasonsEndpoints_1 = require("./endpoints/SeasonsEndpoints");
24
+ class ValorantApi {
25
+ versionEndpoint;
26
+ mapsEndpoints;
27
+ agentsEndpoints;
28
+ weaponsEndpoints;
29
+ contentTierEndpoints;
30
+ currenciesEndpoints;
31
+ bundlesEndpoints;
32
+ missionsEndpoints;
33
+ objectivesEndpoints;
34
+ playerCardsEndpoints;
35
+ playerTitlesEndpoints;
36
+ levelBordersEndpoints;
37
+ buddiesEndpoints;
38
+ spraysEndpoints;
39
+ competitiveTiersEndpoints;
40
+ flexEndpoints;
41
+ gameModesEndpoints;
42
+ contractsEndpoints;
43
+ eventsEndpoints;
44
+ seasonsEndpoints;
45
+ constructor(config) {
46
+ this.versionEndpoint = new VersionEndpoint_1.VersionEndpoint(config);
47
+ this.mapsEndpoints = new MapsEndpoints_1.MapsEndpoints(config);
48
+ this.agentsEndpoints = new AgentsEndpoints_1.AgentsEndpoints(config);
49
+ this.weaponsEndpoints = new WeaponsEndpoints_1.WeaponsEndpoints(config);
50
+ this.contentTierEndpoints = new ContentTierEndpoints_1.ContentTierEndpoints(config);
51
+ this.currenciesEndpoints = new CurrenciesEndpoints_1.CurrenciesEndpoints(config);
52
+ this.bundlesEndpoints = new BundlesEndpoints_1.BundlesEndpoints(config);
53
+ this.missionsEndpoints = new MissionsEndpoints_1.MissionsEndpoints(config);
54
+ this.objectivesEndpoints = new ObjectivesEndpoints_1.ObjectivesEndpoints(config);
55
+ this.playerCardsEndpoints = new PlayerCardsEndpoints_1.PlayerCardsEndpoints(config);
56
+ this.playerTitlesEndpoints = new PlayerTitlesEndpoints_1.PlayerTitlesEndpoints(config);
57
+ this.levelBordersEndpoints = new LevelBordersEndpoints_1.LevelBordersEndpoints(config);
58
+ this.buddiesEndpoints = new BuddiesEndpoints_1.BuddiesEndpoints(config);
59
+ this.spraysEndpoints = new SpraysEndpoints_1.SpraysEndpoints(config);
60
+ this.competitiveTiersEndpoints = new CompetitiveTiersEndpoints_1.CompetitiveTiersEndpoints(config);
61
+ this.flexEndpoints = new FlexEndpoints_1.FlexEndpoints(config);
62
+ this.gameModesEndpoints = new GameModesEndpoints_1.GameModesEndpoints(config);
63
+ this.contractsEndpoints = new ContractsEndpoints_1.ContractsEndpoints(config);
64
+ this.eventsEndpoints = new EventsEndpoints_1.EventsEndpoints(config);
65
+ this.seasonsEndpoints = new SeasonsEndpoints_1.SeasonsEndpoints(config);
66
+ }
67
+ }
68
+ exports.ValorantApi = ValorantApi;
@@ -0,0 +1,168 @@
1
+ import { z } from 'zod';
2
+ import { BaseEndpoint, ValorantApiConfig } from './BaseEndpoint';
3
+ export declare const VoiceLineMediaSchema: z.ZodObject<{
4
+ id: z.ZodNumber;
5
+ wwise: z.ZodString;
6
+ wave: z.ZodString;
7
+ }, z.core.$strip>;
8
+ export type VoiceLineMediaResponse = z.infer<typeof VoiceLineMediaSchema>;
9
+ export declare const VoiceLineSchema: z.ZodObject<{
10
+ minDuration: z.ZodNumber;
11
+ maxDuration: z.ZodNumber;
12
+ mediaList: z.ZodArray<z.ZodObject<{
13
+ id: z.ZodNumber;
14
+ wwise: z.ZodString;
15
+ wave: z.ZodString;
16
+ }, z.core.$strip>>;
17
+ }, z.core.$strip>;
18
+ export type VoiceLineResponse = z.infer<typeof VoiceLineSchema>;
19
+ export declare const AbilitySchema: z.ZodObject<{
20
+ slot: z.ZodString;
21
+ displayName: z.ZodString;
22
+ description: z.ZodString;
23
+ displayIcon: z.ZodString;
24
+ voiceLine: z.ZodObject<{
25
+ minDuration: z.ZodNumber;
26
+ maxDuration: z.ZodNumber;
27
+ mediaList: z.ZodArray<z.ZodObject<{
28
+ id: z.ZodNumber;
29
+ wwise: z.ZodString;
30
+ wave: z.ZodString;
31
+ }, z.core.$strip>>;
32
+ }, z.core.$strip>;
33
+ }, z.core.$strip>;
34
+ export type AbilityResponse = z.infer<typeof AbilitySchema>;
35
+ export declare const RoleSchema: z.ZodObject<{
36
+ uuid: z.ZodString;
37
+ displayName: z.ZodString;
38
+ description: z.ZodString;
39
+ displayIcon: z.ZodString;
40
+ assetPath: z.ZodString;
41
+ }, z.core.$strip>;
42
+ export declare const RecruitmentDataSchema: z.ZodObject<{
43
+ counterId: z.ZodString;
44
+ milestoneId: z.ZodString;
45
+ milestoneThreshold: z.ZodNumber;
46
+ useLevelVpCostOverride: z.ZodBoolean;
47
+ levelVpCostOverride: z.ZodNumber;
48
+ startDate: z.ZodString;
49
+ endDate: z.ZodString;
50
+ }, z.core.$strip>;
51
+ export type RecruitmentDataResponse = z.infer<typeof RecruitmentDataSchema>;
52
+ export declare const AgentSchema: z.ZodObject<{
53
+ uuid: z.ZodString;
54
+ displayName: z.ZodString;
55
+ description: z.ZodString;
56
+ developerName: z.ZodString;
57
+ releaseDate: z.ZodString;
58
+ characterTags: z.ZodArray<z.ZodString>;
59
+ displayIcon: z.ZodString;
60
+ displayIconSmall: z.ZodString;
61
+ bustPortrait: z.ZodString;
62
+ fullPortrait: z.ZodString;
63
+ fullPortraitV2: z.ZodString;
64
+ killfeedPortrait: z.ZodString;
65
+ minimapPortrait: z.ZodString;
66
+ homeScreenPromoTileImage: z.ZodString;
67
+ background: z.ZodString;
68
+ backgroundGradientColors: z.ZodArray<z.ZodString>;
69
+ assetPath: z.ZodString;
70
+ isFullPortraitRightFacing: z.ZodBoolean;
71
+ isPlayableCharacter: z.ZodBoolean;
72
+ isAvailableForTest: z.ZodBoolean;
73
+ isBaseContent: z.ZodBoolean;
74
+ role: z.ZodObject<{
75
+ uuid: z.ZodString;
76
+ displayName: z.ZodString;
77
+ description: z.ZodString;
78
+ displayIcon: z.ZodString;
79
+ assetPath: z.ZodString;
80
+ }, z.core.$strip>;
81
+ recruitmentData: z.ZodObject<{
82
+ counterId: z.ZodString;
83
+ milestoneId: z.ZodString;
84
+ milestoneThreshold: z.ZodNumber;
85
+ useLevelVpCostOverride: z.ZodBoolean;
86
+ levelVpCostOverride: z.ZodNumber;
87
+ startDate: z.ZodString;
88
+ endDate: z.ZodString;
89
+ }, z.core.$strip>;
90
+ abilities: z.ZodArray<z.ZodObject<{
91
+ slot: z.ZodString;
92
+ displayName: z.ZodString;
93
+ description: z.ZodString;
94
+ displayIcon: z.ZodString;
95
+ voiceLine: z.ZodObject<{
96
+ minDuration: z.ZodNumber;
97
+ maxDuration: z.ZodNumber;
98
+ mediaList: z.ZodArray<z.ZodObject<{
99
+ id: z.ZodNumber;
100
+ wwise: z.ZodString;
101
+ wave: z.ZodString;
102
+ }, z.core.$strip>>;
103
+ }, z.core.$strip>;
104
+ }, z.core.$strip>>;
105
+ }, z.core.$strip>;
106
+ export declare const AgentsSchema: z.ZodArray<z.ZodObject<{
107
+ uuid: z.ZodString;
108
+ displayName: z.ZodString;
109
+ description: z.ZodString;
110
+ developerName: z.ZodString;
111
+ releaseDate: z.ZodString;
112
+ characterTags: z.ZodArray<z.ZodString>;
113
+ displayIcon: z.ZodString;
114
+ displayIconSmall: z.ZodString;
115
+ bustPortrait: z.ZodString;
116
+ fullPortrait: z.ZodString;
117
+ fullPortraitV2: z.ZodString;
118
+ killfeedPortrait: z.ZodString;
119
+ minimapPortrait: z.ZodString;
120
+ homeScreenPromoTileImage: z.ZodString;
121
+ background: z.ZodString;
122
+ backgroundGradientColors: z.ZodArray<z.ZodString>;
123
+ assetPath: z.ZodString;
124
+ isFullPortraitRightFacing: z.ZodBoolean;
125
+ isPlayableCharacter: z.ZodBoolean;
126
+ isAvailableForTest: z.ZodBoolean;
127
+ isBaseContent: z.ZodBoolean;
128
+ role: z.ZodObject<{
129
+ uuid: z.ZodString;
130
+ displayName: z.ZodString;
131
+ description: z.ZodString;
132
+ displayIcon: z.ZodString;
133
+ assetPath: z.ZodString;
134
+ }, z.core.$strip>;
135
+ recruitmentData: z.ZodObject<{
136
+ counterId: z.ZodString;
137
+ milestoneId: z.ZodString;
138
+ milestoneThreshold: z.ZodNumber;
139
+ useLevelVpCostOverride: z.ZodBoolean;
140
+ levelVpCostOverride: z.ZodNumber;
141
+ startDate: z.ZodString;
142
+ endDate: z.ZodString;
143
+ }, z.core.$strip>;
144
+ abilities: z.ZodArray<z.ZodObject<{
145
+ slot: z.ZodString;
146
+ displayName: z.ZodString;
147
+ description: z.ZodString;
148
+ displayIcon: z.ZodString;
149
+ voiceLine: z.ZodObject<{
150
+ minDuration: z.ZodNumber;
151
+ maxDuration: z.ZodNumber;
152
+ mediaList: z.ZodArray<z.ZodObject<{
153
+ id: z.ZodNumber;
154
+ wwise: z.ZodString;
155
+ wave: z.ZodString;
156
+ }, z.core.$strip>>;
157
+ }, z.core.$strip>;
158
+ }, z.core.$strip>>;
159
+ }, z.core.$strip>>;
160
+ export type RoleResponse = z.infer<typeof RoleSchema>;
161
+ export type AgentResponse = z.infer<typeof AgentSchema>;
162
+ export type AgentsResponse = z.infer<typeof AgentsSchema>;
163
+ declare class AgentsEndpoints extends BaseEndpoint {
164
+ constructor(config?: ValorantApiConfig);
165
+ getAgentsV1(isPlayableCharacter?: boolean): Promise<AgentsResponse>;
166
+ getAgentsByUuidV1(uuid: string): Promise<AgentResponse>;
167
+ }
168
+ export { AgentsEndpoints };
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AgentsEndpoints = exports.AgentsSchema = exports.AgentSchema = exports.RecruitmentDataSchema = exports.RoleSchema = exports.AbilitySchema = exports.VoiceLineSchema = exports.VoiceLineMediaSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const BaseEndpoint_1 = require("./BaseEndpoint");
6
+ const SharedSchemas_1 = require("../schemas/SharedSchemas");
7
+ exports.VoiceLineMediaSchema = zod_1.z.object({
8
+ id: zod_1.z.number().int(),
9
+ wwise: zod_1.z.string(),
10
+ wave: zod_1.z.string(),
11
+ });
12
+ exports.VoiceLineSchema = zod_1.z.object({
13
+ minDuration: zod_1.z.number(),
14
+ maxDuration: zod_1.z.number(),
15
+ mediaList: zod_1.z.array(exports.VoiceLineMediaSchema),
16
+ });
17
+ exports.AbilitySchema = zod_1.z.object({
18
+ slot: zod_1.z.string(),
19
+ displayName: SharedSchemas_1.LocalizedStringSchema,
20
+ description: SharedSchemas_1.LocalizedStringSchema,
21
+ displayIcon: zod_1.z.string(),
22
+ voiceLine: exports.VoiceLineSchema,
23
+ });
24
+ exports.RoleSchema = zod_1.z.object({
25
+ uuid: zod_1.z.string().uuid(),
26
+ displayName: SharedSchemas_1.LocalizedStringSchema,
27
+ description: SharedSchemas_1.LocalizedStringSchema,
28
+ displayIcon: zod_1.z.string(),
29
+ assetPath: zod_1.z.string(),
30
+ });
31
+ exports.RecruitmentDataSchema = zod_1.z.object({
32
+ counterId: zod_1.z.string().uuid(),
33
+ milestoneId: zod_1.z.string().uuid(),
34
+ milestoneThreshold: zod_1.z.number().int(),
35
+ useLevelVpCostOverride: zod_1.z.boolean(),
36
+ levelVpCostOverride: zod_1.z.number().int(),
37
+ startDate: zod_1.z.string().datetime(),
38
+ endDate: zod_1.z.string().datetime(),
39
+ });
40
+ exports.AgentSchema = zod_1.z.object({
41
+ uuid: zod_1.z.string().uuid(),
42
+ displayName: SharedSchemas_1.LocalizedStringSchema,
43
+ description: SharedSchemas_1.LocalizedStringSchema,
44
+ developerName: zod_1.z.string(),
45
+ releaseDate: zod_1.z.string().datetime(),
46
+ characterTags: zod_1.z.array(SharedSchemas_1.LocalizedStringSchema),
47
+ displayIcon: zod_1.z.string(),
48
+ displayIconSmall: zod_1.z.string(),
49
+ bustPortrait: zod_1.z.string(),
50
+ fullPortrait: zod_1.z.string(),
51
+ fullPortraitV2: zod_1.z.string(),
52
+ killfeedPortrait: zod_1.z.string(),
53
+ minimapPortrait: zod_1.z.string(),
54
+ homeScreenPromoTileImage: zod_1.z.string(),
55
+ background: zod_1.z.string(),
56
+ backgroundGradientColors: zod_1.z.array(zod_1.z.string()),
57
+ assetPath: zod_1.z.string(),
58
+ isFullPortraitRightFacing: zod_1.z.boolean(),
59
+ isPlayableCharacter: zod_1.z.boolean(),
60
+ isAvailableForTest: zod_1.z.boolean(),
61
+ isBaseContent: zod_1.z.boolean(),
62
+ role: exports.RoleSchema,
63
+ recruitmentData: exports.RecruitmentDataSchema,
64
+ abilities: zod_1.z.array(exports.AbilitySchema),
65
+ });
66
+ exports.AgentsSchema = zod_1.z.array(exports.AgentSchema);
67
+ class AgentsEndpoints extends BaseEndpoint_1.BaseEndpoint {
68
+ constructor(config) {
69
+ super(config);
70
+ }
71
+ async getAgentsV1(isPlayableCharacter = true) {
72
+ const url = new URL('v1/agents', 'https://valorant-api.com/');
73
+ url.searchParams.set('isPlayableCharacter', isPlayableCharacter.toString());
74
+ return this.requestValorantApi(url.toString());
75
+ }
76
+ async getAgentsByUuidV1(uuid) {
77
+ return this.requestValorantApi(`v1/agents/${uuid}`);
78
+ }
79
+ }
80
+ exports.AgentsEndpoints = AgentsEndpoints;
@@ -0,0 +1,10 @@
1
+ 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';
2
+ export interface ValorantApiConfig {
3
+ language?: ValorantLocale;
4
+ }
5
+ declare class BaseEndpoint {
6
+ protected language: ValorantLocale;
7
+ constructor(config?: ValorantApiConfig);
8
+ requestValorantApi<T>(endpointUrl: string): Promise<T>;
9
+ }
10
+ export { BaseEndpoint };
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.BaseEndpoint = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ class BaseEndpoint {
9
+ language;
10
+ constructor(config) {
11
+ this.language = config?.language || 'en-US';
12
+ }
13
+ async requestValorantApi(endpointUrl) {
14
+ const baseUrl = 'https://valorant-api.com/';
15
+ const url = new URL(endpointUrl, baseUrl);
16
+ url.searchParams.set('language', this.language);
17
+ const result = await axios_1.default.get(url.toString());
18
+ return result.data.data;
19
+ }
20
+ }
21
+ exports.BaseEndpoint = BaseEndpoint;
@@ -0,0 +1,53 @@
1
+ import { z } from 'zod';
2
+ import { BaseEndpoint, ValorantApiConfig } from './BaseEndpoint';
3
+ export declare const BuddyLevelSchema: z.ZodObject<{
4
+ uuid: z.ZodString;
5
+ displayName: z.ZodString;
6
+ displayIcon: z.ZodString;
7
+ assetPath: z.ZodString;
8
+ }, z.core.$strip>;
9
+ export declare const BuddySchema: z.ZodObject<{
10
+ uuid: z.ZodString;
11
+ displayName: z.ZodString;
12
+ isHiddenIfNotOwned: z.ZodBoolean;
13
+ themeUuid: z.ZodNullable<z.ZodString>;
14
+ displayIcon: z.ZodString;
15
+ assetPath: z.ZodString;
16
+ levels: z.ZodArray<z.ZodObject<{
17
+ uuid: z.ZodString;
18
+ displayName: z.ZodString;
19
+ displayIcon: z.ZodString;
20
+ assetPath: z.ZodString;
21
+ }, z.core.$strip>>;
22
+ }, z.core.$strip>;
23
+ export declare const BuddiesSchema: z.ZodArray<z.ZodObject<{
24
+ uuid: z.ZodString;
25
+ displayName: z.ZodString;
26
+ isHiddenIfNotOwned: z.ZodBoolean;
27
+ themeUuid: z.ZodNullable<z.ZodString>;
28
+ displayIcon: z.ZodString;
29
+ assetPath: z.ZodString;
30
+ levels: z.ZodArray<z.ZodObject<{
31
+ uuid: z.ZodString;
32
+ displayName: z.ZodString;
33
+ displayIcon: z.ZodString;
34
+ assetPath: z.ZodString;
35
+ }, z.core.$strip>>;
36
+ }, z.core.$strip>>;
37
+ export declare const BuddyLevelsSchema: z.ZodArray<z.ZodObject<{
38
+ uuid: z.ZodString;
39
+ displayName: z.ZodString;
40
+ displayIcon: z.ZodString;
41
+ assetPath: z.ZodString;
42
+ }, z.core.$strip>>;
43
+ export type BuddyResponse = z.infer<typeof BuddySchema>;
44
+ export type BuddiesResponse = z.infer<typeof BuddiesSchema>;
45
+ export type BuddyLevelResponse = z.infer<typeof BuddyLevelSchema>;
46
+ export type BuddyLevelsResponse = z.infer<typeof BuddyLevelsSchema>;
47
+ declare class BuddiesEndpoints extends BaseEndpoint {
48
+ constructor(config?: ValorantApiConfig);
49
+ getBuddiesV1(): Promise<BuddiesResponse>;
50
+ getBuddyByUuidV1(uuid: string): Promise<BuddyResponse>;
51
+ getBuddyLevelByUuidV1(uuid: string): Promise<BuddyLevelResponse>;
52
+ }
53
+ export { BuddiesEndpoints };
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BuddiesEndpoints = exports.BuddyLevelsSchema = exports.BuddiesSchema = exports.BuddySchema = exports.BuddyLevelSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const BaseEndpoint_1 = require("./BaseEndpoint");
6
+ exports.BuddyLevelSchema = zod_1.z.object({
7
+ uuid: zod_1.z.string().uuid(),
8
+ displayName: zod_1.z.string(),
9
+ displayIcon: zod_1.z.string(),
10
+ assetPath: zod_1.z.string(),
11
+ });
12
+ exports.BuddySchema = zod_1.z.object({
13
+ uuid: zod_1.z.string().uuid(),
14
+ displayName: zod_1.z.string(),
15
+ isHiddenIfNotOwned: zod_1.z.boolean(),
16
+ themeUuid: zod_1.z.string().uuid().nullable(),
17
+ displayIcon: zod_1.z.string(),
18
+ assetPath: zod_1.z.string(),
19
+ levels: zod_1.z.array(exports.BuddyLevelSchema),
20
+ });
21
+ exports.BuddiesSchema = zod_1.z.array(exports.BuddySchema);
22
+ exports.BuddyLevelsSchema = zod_1.z.array(exports.BuddyLevelSchema);
23
+ class BuddiesEndpoints extends BaseEndpoint_1.BaseEndpoint {
24
+ constructor(config) {
25
+ super(config);
26
+ }
27
+ async getBuddiesV1() {
28
+ return this.requestValorantApi('v1/buddies');
29
+ }
30
+ async getBuddyByUuidV1(uuid) {
31
+ return this.requestValorantApi(`v1/buddies/${uuid}`);
32
+ }
33
+ async getBuddyLevelByUuidV1(uuid) {
34
+ return this.requestValorantApi(`v1/buddies/levels/${uuid}`);
35
+ }
36
+ }
37
+ exports.BuddiesEndpoints = BuddiesEndpoints;
@@ -0,0 +1,36 @@
1
+ import { z } from 'zod';
2
+ import { BaseEndpoint, ValorantApiConfig } from './BaseEndpoint';
3
+ export declare const BundleSchema: z.ZodObject<{
4
+ uuid: z.ZodString;
5
+ displayName: z.ZodString;
6
+ displayNameSubtext: z.ZodString;
7
+ description: z.ZodString;
8
+ extraDescription: z.ZodString;
9
+ promoDescription: z.ZodString;
10
+ useBackgroundGradient: z.ZodBoolean;
11
+ displayIcon: z.ZodString;
12
+ displayIcon2: z.ZodString;
13
+ verticalPromoImage: z.ZodString;
14
+ assetPath: z.ZodString;
15
+ }, z.core.$strip>;
16
+ export declare const BundlesSchema: z.ZodArray<z.ZodObject<{
17
+ uuid: z.ZodString;
18
+ displayName: z.ZodString;
19
+ displayNameSubtext: z.ZodString;
20
+ description: z.ZodString;
21
+ extraDescription: z.ZodString;
22
+ promoDescription: z.ZodString;
23
+ useBackgroundGradient: z.ZodBoolean;
24
+ displayIcon: z.ZodString;
25
+ displayIcon2: z.ZodString;
26
+ verticalPromoImage: z.ZodString;
27
+ assetPath: z.ZodString;
28
+ }, z.core.$strip>>;
29
+ export type BundleResponse = z.infer<typeof BundleSchema>;
30
+ export type BundlesResponse = z.infer<typeof BundlesSchema>;
31
+ declare class BundlesEndpoints extends BaseEndpoint {
32
+ constructor(config?: ValorantApiConfig);
33
+ getBundlesV1(): Promise<BundlesResponse>;
34
+ getBundleByUuidV1(uuid: string): Promise<BundleResponse>;
35
+ }
36
+ export { BundlesEndpoints };
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BundlesEndpoints = exports.BundlesSchema = exports.BundleSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const BaseEndpoint_1 = require("./BaseEndpoint");
6
+ exports.BundleSchema = zod_1.z.object({
7
+ uuid: zod_1.z.string().uuid(),
8
+ displayName: zod_1.z.string(),
9
+ displayNameSubtext: zod_1.z.string(),
10
+ description: zod_1.z.string(),
11
+ extraDescription: zod_1.z.string(),
12
+ promoDescription: zod_1.z.string(),
13
+ useBackgroundGradient: zod_1.z.boolean(),
14
+ displayIcon: zod_1.z.string(),
15
+ displayIcon2: zod_1.z.string(),
16
+ verticalPromoImage: zod_1.z.string(),
17
+ assetPath: zod_1.z.string(),
18
+ });
19
+ exports.BundlesSchema = zod_1.z.array(exports.BundleSchema);
20
+ class BundlesEndpoints extends BaseEndpoint_1.BaseEndpoint {
21
+ constructor(config) {
22
+ super(config);
23
+ }
24
+ async getBundlesV1() {
25
+ return this.requestValorantApi('v1/bundles');
26
+ }
27
+ async getBundleByUuidV1(uuid) {
28
+ return this.requestValorantApi(`v1/bundles/${uuid}`);
29
+ }
30
+ }
31
+ exports.BundlesEndpoints = BundlesEndpoints;