@yaelouuu/fortnite-api 1.2.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/README.md CHANGED
@@ -45,4 +45,4 @@ const season = await client.calendar.getCurrentSeason();
45
45
  ## Documentation
46
46
 
47
47
  Full API documentation (swagger): https://documentation.api-fortnite.com/documentation
48
- SDK documentation: https://api-fortnite.com/sdk-doc
48
+ SDK documentation: https://sdk.api-fortnite.com/
@@ -1,5 +1,5 @@
1
1
  import { FortniteAPI } from "../client";
2
- import { Leaderboard } from "../types";
2
+ import { Leaderboard, TournamentTrackerResponse, TournamentEligibilityResponse } from "../types";
3
3
  export declare class TournamentsResource {
4
4
  private client;
5
5
  constructor(client: FortniteAPI);
@@ -28,4 +28,22 @@ export declare class TournamentsResource {
28
28
  page?: number;
29
29
  leaderboardDef?: string;
30
30
  }): Promise<Leaderboard>;
31
+ /**
32
+ * Get tournament participation history for a player
33
+ * GET /tournament-tracker
34
+ * @param accountId - Epic Games Account ID
35
+ * @param fortniteToken - User's Fortnite access token (from OAuth flow)
36
+ */
37
+ getTracker(accountId: string, fortniteToken: string): Promise<TournamentTrackerResponse>;
38
+ /**
39
+ * Check if a player is eligible for major tournaments
40
+ * GET /tournament-eligibility
41
+ * @param accountId - Epic Games Account ID
42
+ * @param fortniteToken - User's Fortnite access token (from OAuth flow)
43
+ * @param options - Optional configuration for eligibility check
44
+ */
45
+ checkEligibility(accountId: string, fortniteToken: string, options?: {
46
+ days?: number;
47
+ requiredTournaments?: number;
48
+ }): Promise<TournamentEligibilityResponse>;
31
49
  }
@@ -42,5 +42,39 @@ class TournamentsResource {
42
42
  }).toString();
43
43
  return this.client.request(`/events/leaderboard?${query}`);
44
44
  }
45
+ /**
46
+ * Get tournament participation history for a player
47
+ * GET /tournament-tracker
48
+ * @param accountId - Epic Games Account ID
49
+ * @param fortniteToken - User's Fortnite access token (from OAuth flow)
50
+ */
51
+ async getTracker(accountId, fortniteToken) {
52
+ return this.client.request(`/tournament-tracker?accountId=${accountId}`, {
53
+ headers: {
54
+ "x-fortnite-token": fortniteToken,
55
+ },
56
+ });
57
+ }
58
+ /**
59
+ * Check if a player is eligible for major tournaments
60
+ * GET /tournament-eligibility
61
+ * @param accountId - Epic Games Account ID
62
+ * @param fortniteToken - User's Fortnite access token (from OAuth flow)
63
+ * @param options - Optional configuration for eligibility check
64
+ */
65
+ async checkEligibility(accountId, fortniteToken, options) {
66
+ const params = new URLSearchParams({ accountId });
67
+ if (options?.days) {
68
+ params.append("days", options.days.toString());
69
+ }
70
+ if (options?.requiredTournaments) {
71
+ params.append("requiredTournaments", options.requiredTournaments.toString());
72
+ }
73
+ return this.client.request(`/tournament-eligibility?${params.toString()}`, {
74
+ headers: {
75
+ "x-fortnite-token": fortniteToken,
76
+ },
77
+ });
78
+ }
45
79
  }
46
80
  exports.TournamentsResource = TournamentsResource;
@@ -106,3 +106,25 @@ export interface BatchParsingResponse {
106
106
  results?: ParsedReplayData[];
107
107
  error?: string;
108
108
  }
109
+ export interface TournamentTrackerEntry {
110
+ eventWindowId: string;
111
+ eventName: string;
112
+ eventId: string;
113
+ beginTime: string;
114
+ endTime: string;
115
+ region: string;
116
+ }
117
+ export interface TournamentTrackerResponse {
118
+ tournaments_played: TournamentTrackerEntry[];
119
+ total_count: number;
120
+ }
121
+ export interface TournamentEligibilityResponse {
122
+ eligible: boolean;
123
+ tournaments_played: number;
124
+ tournaments_required: number;
125
+ tournaments_remaining: number;
126
+ calculation_period_days: number;
127
+ oldest_tournament_date: string | null;
128
+ newest_tournament_date: string | null;
129
+ recent_tournaments: TournamentTrackerEntry[];
130
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaelouuu/fortnite-api",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "SDK for Fortnite Tournaments API by Royal Arena - Author : yaelouuu",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",