@valpro-labs/valorant-api 1.0.3 → 1.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.
@@ -1,5 +1,5 @@
1
1
  import { BaseEndpoint, ValorantApiConfig } from './BaseEndpoint';
2
- import { SeasonResponse, SeasonsResponse } from '../schemas';
2
+ import { SeasonResponse, SeasonsResponse, CompetitiveSeasonResponse, CompetitiveSeasonsResponse } from '../schemas';
3
3
  declare class SeasonsEndpoints extends BaseEndpoint {
4
4
  constructor(config?: ValorantApiConfig);
5
5
  /**
@@ -13,5 +13,16 @@ declare class SeasonsEndpoints extends BaseEndpoint {
13
13
  * @returns Promise<SeasonResponse>
14
14
  */
15
15
  getSeasonByUuidV1(uuid: string): Promise<SeasonResponse>;
16
+ /**
17
+ * Get all competitive seasons
18
+ * @returns Promise<CompetitiveSeasonsResponse>
19
+ */
20
+ getCompetitiveSeasonsV1(): Promise<CompetitiveSeasonsResponse>;
21
+ /**
22
+ * Get competitive season by UUID
23
+ * @param uuid Competitive Season UUID
24
+ * @returns Promise<CompetitiveSeasonResponse>
25
+ */
26
+ getCompetitiveSeasonByUuidV1(uuid: string): Promise<CompetitiveSeasonResponse>;
16
27
  }
17
28
  export { SeasonsEndpoints };
@@ -21,5 +21,20 @@ class SeasonsEndpoints extends BaseEndpoint_1.BaseEndpoint {
21
21
  async getSeasonByUuidV1(uuid) {
22
22
  return this.requestValorantApi(`v1/seasons/${uuid}`);
23
23
  }
24
+ /**
25
+ * Get all competitive seasons
26
+ * @returns Promise<CompetitiveSeasonsResponse>
27
+ */
28
+ async getCompetitiveSeasonsV1() {
29
+ return this.requestValorantApi('v1/seasons/competitive');
30
+ }
31
+ /**
32
+ * Get competitive season by UUID
33
+ * @param uuid Competitive Season UUID
34
+ * @returns Promise<CompetitiveSeasonResponse>
35
+ */
36
+ async getCompetitiveSeasonByUuidV1(uuid) {
37
+ return this.requestValorantApi(`v1/seasons/competitive/${uuid}`);
38
+ }
24
39
  }
25
40
  exports.SeasonsEndpoints = SeasonsEndpoints;
@@ -21,3 +21,46 @@ export declare const SeasonsSchema: z.ZodArray<z.ZodObject<{
21
21
  assetPath: z.ZodString;
22
22
  }, z.core.$strip>>;
23
23
  export type SeasonsResponse = z.infer<typeof SeasonsSchema>;
24
+ export declare const CompetitiveSeasonBorderSchema: z.ZodObject<{
25
+ uuid: z.ZodString;
26
+ level: z.ZodNumber;
27
+ winsRequired: z.ZodNumber;
28
+ displayIcon: z.ZodNullable<z.ZodString>;
29
+ smallIcon: z.ZodNullable<z.ZodString>;
30
+ assetPath: z.ZodString;
31
+ }, z.core.$strip>;
32
+ export type CompetitiveSeasonBorderResponse = z.infer<typeof CompetitiveSeasonBorderSchema>;
33
+ export declare const CompetitiveSeasonSchema: z.ZodObject<{
34
+ uuid: z.ZodString;
35
+ startTime: z.ZodString;
36
+ endTime: z.ZodString;
37
+ seasonUuid: z.ZodString;
38
+ competitiveTiersUuid: z.ZodString;
39
+ borders: z.ZodNullable<z.ZodArray<z.ZodObject<{
40
+ uuid: z.ZodString;
41
+ level: z.ZodNumber;
42
+ winsRequired: z.ZodNumber;
43
+ displayIcon: z.ZodNullable<z.ZodString>;
44
+ smallIcon: z.ZodNullable<z.ZodString>;
45
+ assetPath: z.ZodString;
46
+ }, z.core.$strip>>>;
47
+ assetPath: z.ZodString;
48
+ }, z.core.$strip>;
49
+ export type CompetitiveSeasonResponse = z.infer<typeof CompetitiveSeasonSchema>;
50
+ export declare const CompetitiveSeasonsSchema: z.ZodArray<z.ZodObject<{
51
+ uuid: z.ZodString;
52
+ startTime: z.ZodString;
53
+ endTime: z.ZodString;
54
+ seasonUuid: z.ZodString;
55
+ competitiveTiersUuid: z.ZodString;
56
+ borders: z.ZodNullable<z.ZodArray<z.ZodObject<{
57
+ uuid: z.ZodString;
58
+ level: z.ZodNumber;
59
+ winsRequired: z.ZodNumber;
60
+ displayIcon: z.ZodNullable<z.ZodString>;
61
+ smallIcon: z.ZodNullable<z.ZodString>;
62
+ assetPath: z.ZodString;
63
+ }, z.core.$strip>>>;
64
+ assetPath: z.ZodString;
65
+ }, z.core.$strip>>;
66
+ export type CompetitiveSeasonsResponse = z.infer<typeof CompetitiveSeasonsSchema>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SeasonsSchema = exports.SeasonSchema = void 0;
3
+ exports.CompetitiveSeasonsSchema = exports.CompetitiveSeasonSchema = exports.CompetitiveSeasonBorderSchema = exports.SeasonsSchema = exports.SeasonSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.SeasonSchema = zod_1.z.object({
6
6
  uuid: zod_1.z.string().uuid(),
@@ -13,3 +13,21 @@ exports.SeasonSchema = zod_1.z.object({
13
13
  assetPath: zod_1.z.string(),
14
14
  });
15
15
  exports.SeasonsSchema = zod_1.z.array(exports.SeasonSchema);
16
+ exports.CompetitiveSeasonBorderSchema = zod_1.z.object({
17
+ uuid: zod_1.z.string().uuid(),
18
+ level: zod_1.z.number().int(),
19
+ winsRequired: zod_1.z.number().int(),
20
+ displayIcon: zod_1.z.string().nullable(),
21
+ smallIcon: zod_1.z.string().nullable(),
22
+ assetPath: zod_1.z.string(),
23
+ });
24
+ exports.CompetitiveSeasonSchema = zod_1.z.object({
25
+ uuid: zod_1.z.string().uuid(),
26
+ startTime: zod_1.z.string(),
27
+ endTime: zod_1.z.string(),
28
+ seasonUuid: zod_1.z.string().uuid(),
29
+ competitiveTiersUuid: zod_1.z.string().uuid(),
30
+ borders: zod_1.z.array(exports.CompetitiveSeasonBorderSchema).nullable(),
31
+ assetPath: zod_1.z.string(),
32
+ });
33
+ exports.CompetitiveSeasonsSchema = zod_1.z.array(exports.CompetitiveSeasonSchema);
@@ -92,10 +92,40 @@ export declare const ChromaSchema: z.ZodObject<{
92
92
  assetPath: z.ZodString;
93
93
  }, z.core.$strip>;
94
94
  export type ChromaResponse = z.infer<typeof ChromaSchema>;
95
+ export declare const LevelItemSchema: z.ZodEnum<{
96
+ "EEquippableSkinLevelItem::VFX": "EEquippableSkinLevelItem::VFX";
97
+ "EEquippableSkinLevelItem::Animation": "EEquippableSkinLevelItem::Animation";
98
+ "EEquippableSkinLevelItem::Finisher": "EEquippableSkinLevelItem::Finisher";
99
+ "EEquippableSkinLevelItem::Voiceover": "EEquippableSkinLevelItem::Voiceover";
100
+ "EEquippableSkinLevelItem::SoundEffects": "EEquippableSkinLevelItem::SoundEffects";
101
+ "EEquippableSkinLevelItem::FishAnimation": "EEquippableSkinLevelItem::FishAnimation";
102
+ "EEquippableSkinLevelItem::KillBanner": "EEquippableSkinLevelItem::KillBanner";
103
+ "EEquippableSkinLevelItem::TopFrag": "EEquippableSkinLevelItem::TopFrag";
104
+ "EEquippableSkinLevelItem::KillCounter": "EEquippableSkinLevelItem::KillCounter";
105
+ "EEquippableSkinLevelItem::InspectAndKill": "EEquippableSkinLevelItem::InspectAndKill";
106
+ "EEquippableSkinLevelItem::KillEffect": "EEquippableSkinLevelItem::KillEffect";
107
+ "EEquippableSkinLevelItem::AttackerDefenderSwap": "EEquippableSkinLevelItem::AttackerDefenderSwap";
108
+ "EEquippableSkinLevelItem::Randomizer": "EEquippableSkinLevelItem::Randomizer";
109
+ }>;
110
+ export type LevelItem = z.infer<typeof LevelItemSchema>;
95
111
  export declare const LevelSchema: z.ZodObject<{
96
112
  uuid: z.ZodString;
97
113
  displayName: z.ZodString;
98
- levelItem: z.ZodString;
114
+ levelItem: z.ZodNullable<z.ZodUnion<[z.ZodEnum<{
115
+ "EEquippableSkinLevelItem::VFX": "EEquippableSkinLevelItem::VFX";
116
+ "EEquippableSkinLevelItem::Animation": "EEquippableSkinLevelItem::Animation";
117
+ "EEquippableSkinLevelItem::Finisher": "EEquippableSkinLevelItem::Finisher";
118
+ "EEquippableSkinLevelItem::Voiceover": "EEquippableSkinLevelItem::Voiceover";
119
+ "EEquippableSkinLevelItem::SoundEffects": "EEquippableSkinLevelItem::SoundEffects";
120
+ "EEquippableSkinLevelItem::FishAnimation": "EEquippableSkinLevelItem::FishAnimation";
121
+ "EEquippableSkinLevelItem::KillBanner": "EEquippableSkinLevelItem::KillBanner";
122
+ "EEquippableSkinLevelItem::TopFrag": "EEquippableSkinLevelItem::TopFrag";
123
+ "EEquippableSkinLevelItem::KillCounter": "EEquippableSkinLevelItem::KillCounter";
124
+ "EEquippableSkinLevelItem::InspectAndKill": "EEquippableSkinLevelItem::InspectAndKill";
125
+ "EEquippableSkinLevelItem::KillEffect": "EEquippableSkinLevelItem::KillEffect";
126
+ "EEquippableSkinLevelItem::AttackerDefenderSwap": "EEquippableSkinLevelItem::AttackerDefenderSwap";
127
+ "EEquippableSkinLevelItem::Randomizer": "EEquippableSkinLevelItem::Randomizer";
128
+ }>, z.ZodString]>>;
99
129
  displayIcon: z.ZodString;
100
130
  streamedVideo: z.ZodString;
101
131
  assetPath: z.ZodString;
@@ -121,7 +151,21 @@ export declare const SkinSchema: z.ZodObject<{
121
151
  levels: z.ZodArray<z.ZodObject<{
122
152
  uuid: z.ZodString;
123
153
  displayName: z.ZodString;
124
- levelItem: z.ZodString;
154
+ levelItem: z.ZodNullable<z.ZodUnion<[z.ZodEnum<{
155
+ "EEquippableSkinLevelItem::VFX": "EEquippableSkinLevelItem::VFX";
156
+ "EEquippableSkinLevelItem::Animation": "EEquippableSkinLevelItem::Animation";
157
+ "EEquippableSkinLevelItem::Finisher": "EEquippableSkinLevelItem::Finisher";
158
+ "EEquippableSkinLevelItem::Voiceover": "EEquippableSkinLevelItem::Voiceover";
159
+ "EEquippableSkinLevelItem::SoundEffects": "EEquippableSkinLevelItem::SoundEffects";
160
+ "EEquippableSkinLevelItem::FishAnimation": "EEquippableSkinLevelItem::FishAnimation";
161
+ "EEquippableSkinLevelItem::KillBanner": "EEquippableSkinLevelItem::KillBanner";
162
+ "EEquippableSkinLevelItem::TopFrag": "EEquippableSkinLevelItem::TopFrag";
163
+ "EEquippableSkinLevelItem::KillCounter": "EEquippableSkinLevelItem::KillCounter";
164
+ "EEquippableSkinLevelItem::InspectAndKill": "EEquippableSkinLevelItem::InspectAndKill";
165
+ "EEquippableSkinLevelItem::KillEffect": "EEquippableSkinLevelItem::KillEffect";
166
+ "EEquippableSkinLevelItem::AttackerDefenderSwap": "EEquippableSkinLevelItem::AttackerDefenderSwap";
167
+ "EEquippableSkinLevelItem::Randomizer": "EEquippableSkinLevelItem::Randomizer";
168
+ }>, z.ZodString]>>;
125
169
  displayIcon: z.ZodString;
126
170
  streamedVideo: z.ZodString;
127
171
  assetPath: z.ZodString;
@@ -206,7 +250,21 @@ export declare const WeaponSchema: z.ZodObject<{
206
250
  levels: z.ZodArray<z.ZodObject<{
207
251
  uuid: z.ZodString;
208
252
  displayName: z.ZodString;
209
- levelItem: z.ZodString;
253
+ levelItem: z.ZodNullable<z.ZodUnion<[z.ZodEnum<{
254
+ "EEquippableSkinLevelItem::VFX": "EEquippableSkinLevelItem::VFX";
255
+ "EEquippableSkinLevelItem::Animation": "EEquippableSkinLevelItem::Animation";
256
+ "EEquippableSkinLevelItem::Finisher": "EEquippableSkinLevelItem::Finisher";
257
+ "EEquippableSkinLevelItem::Voiceover": "EEquippableSkinLevelItem::Voiceover";
258
+ "EEquippableSkinLevelItem::SoundEffects": "EEquippableSkinLevelItem::SoundEffects";
259
+ "EEquippableSkinLevelItem::FishAnimation": "EEquippableSkinLevelItem::FishAnimation";
260
+ "EEquippableSkinLevelItem::KillBanner": "EEquippableSkinLevelItem::KillBanner";
261
+ "EEquippableSkinLevelItem::TopFrag": "EEquippableSkinLevelItem::TopFrag";
262
+ "EEquippableSkinLevelItem::KillCounter": "EEquippableSkinLevelItem::KillCounter";
263
+ "EEquippableSkinLevelItem::InspectAndKill": "EEquippableSkinLevelItem::InspectAndKill";
264
+ "EEquippableSkinLevelItem::KillEffect": "EEquippableSkinLevelItem::KillEffect";
265
+ "EEquippableSkinLevelItem::AttackerDefenderSwap": "EEquippableSkinLevelItem::AttackerDefenderSwap";
266
+ "EEquippableSkinLevelItem::Randomizer": "EEquippableSkinLevelItem::Randomizer";
267
+ }>, z.ZodString]>>;
210
268
  displayIcon: z.ZodString;
211
269
  streamedVideo: z.ZodString;
212
270
  assetPath: z.ZodString;
@@ -292,7 +350,21 @@ export declare const WeaponsSchema: z.ZodArray<z.ZodObject<{
292
350
  levels: z.ZodArray<z.ZodObject<{
293
351
  uuid: z.ZodString;
294
352
  displayName: z.ZodString;
295
- levelItem: z.ZodString;
353
+ levelItem: z.ZodNullable<z.ZodUnion<[z.ZodEnum<{
354
+ "EEquippableSkinLevelItem::VFX": "EEquippableSkinLevelItem::VFX";
355
+ "EEquippableSkinLevelItem::Animation": "EEquippableSkinLevelItem::Animation";
356
+ "EEquippableSkinLevelItem::Finisher": "EEquippableSkinLevelItem::Finisher";
357
+ "EEquippableSkinLevelItem::Voiceover": "EEquippableSkinLevelItem::Voiceover";
358
+ "EEquippableSkinLevelItem::SoundEffects": "EEquippableSkinLevelItem::SoundEffects";
359
+ "EEquippableSkinLevelItem::FishAnimation": "EEquippableSkinLevelItem::FishAnimation";
360
+ "EEquippableSkinLevelItem::KillBanner": "EEquippableSkinLevelItem::KillBanner";
361
+ "EEquippableSkinLevelItem::TopFrag": "EEquippableSkinLevelItem::TopFrag";
362
+ "EEquippableSkinLevelItem::KillCounter": "EEquippableSkinLevelItem::KillCounter";
363
+ "EEquippableSkinLevelItem::InspectAndKill": "EEquippableSkinLevelItem::InspectAndKill";
364
+ "EEquippableSkinLevelItem::KillEffect": "EEquippableSkinLevelItem::KillEffect";
365
+ "EEquippableSkinLevelItem::AttackerDefenderSwap": "EEquippableSkinLevelItem::AttackerDefenderSwap";
366
+ "EEquippableSkinLevelItem::Randomizer": "EEquippableSkinLevelItem::Randomizer";
367
+ }>, z.ZodString]>>;
296
368
  displayIcon: z.ZodString;
297
369
  streamedVideo: z.ZodString;
298
370
  assetPath: z.ZodString;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WeaponsSchema = exports.WeaponSchema = exports.SkinSchema = exports.LevelSchema = exports.ChromaSchema = exports.ShopDataSchema = exports.GridPositionSchema = exports.WeaponStatsSchema = exports.DamageRangeSchema = exports.AirBurstStatsSchema = exports.AltShotgunStatsSchema = exports.AdsStatsSchema = void 0;
3
+ exports.WeaponsSchema = exports.WeaponSchema = exports.SkinSchema = exports.LevelSchema = exports.LevelItemSchema = exports.ChromaSchema = exports.ShopDataSchema = exports.GridPositionSchema = exports.WeaponStatsSchema = exports.DamageRangeSchema = exports.AirBurstStatsSchema = exports.AltShotgunStatsSchema = exports.AdsStatsSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const SharedSchemas_1 = require("./SharedSchemas");
6
6
  exports.AdsStatsSchema = zod_1.z.object({
@@ -67,10 +67,25 @@ exports.ChromaSchema = zod_1.z.object({
67
67
  streamedVideo: zod_1.z.string(),
68
68
  assetPath: zod_1.z.string(),
69
69
  });
70
+ exports.LevelItemSchema = zod_1.z.enum([
71
+ 'EEquippableSkinLevelItem::VFX',
72
+ 'EEquippableSkinLevelItem::Animation',
73
+ 'EEquippableSkinLevelItem::Finisher',
74
+ 'EEquippableSkinLevelItem::Voiceover',
75
+ 'EEquippableSkinLevelItem::SoundEffects',
76
+ 'EEquippableSkinLevelItem::FishAnimation',
77
+ 'EEquippableSkinLevelItem::KillBanner',
78
+ 'EEquippableSkinLevelItem::TopFrag',
79
+ 'EEquippableSkinLevelItem::KillCounter',
80
+ 'EEquippableSkinLevelItem::InspectAndKill',
81
+ 'EEquippableSkinLevelItem::KillEffect',
82
+ 'EEquippableSkinLevelItem::AttackerDefenderSwap',
83
+ 'EEquippableSkinLevelItem::Randomizer',
84
+ ]);
70
85
  exports.LevelSchema = zod_1.z.object({
71
86
  uuid: zod_1.z.string().uuid(),
72
87
  displayName: SharedSchemas_1.LocalizedStringSchema,
73
- levelItem: zod_1.z.string(),
88
+ levelItem: exports.LevelItemSchema.or(zod_1.z.string()).nullable(),
74
89
  displayIcon: zod_1.z.string(),
75
90
  streamedVideo: zod_1.z.string(),
76
91
  assetPath: zod_1.z.string(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valpro-labs/valorant-api",
3
- "version": "1.0.3",
3
+ "version": "1.2.0",
4
4
  "description": "A typed TypeScript client for Valorant-API",
5
5
  "homepage": "https://github.com/valpro-labs/valorant-api#readme",
6
6
  "bugs": {
@@ -14,7 +14,7 @@
14
14
  "keywords": [
15
15
  "valorant"
16
16
  ],
17
- "author": "rhy3h",
17
+ "author": "Ren-Hao Yeh",
18
18
  "files": [
19
19
  "dist"
20
20
  ],