@valpro-labs/valorant-api 1.1.0 → 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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valpro-labs/valorant-api",
3
- "version": "1.1.0",
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": {