@yaelouuu/fortnite-api 6.0.0 → 6.1.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.
|
@@ -51,4 +51,9 @@ export declare class AccountResource {
|
|
|
51
51
|
* @param fortniteToken - Optional user Fortnite token
|
|
52
52
|
*/
|
|
53
53
|
getExternalAuth(accountId: string, platform: string, fortniteToken?: string): Promise<ExternalAuth>;
|
|
54
|
+
/**
|
|
55
|
+
* Resolve one or more Epic account IDs to their display names
|
|
56
|
+
* @param accountIds - Array of Epic Games account IDs (comma-separated, max 100)
|
|
57
|
+
*/
|
|
58
|
+
getDisplayNames(accountIds: string[]): Promise<Account[]>;
|
|
54
59
|
}
|
|
@@ -99,5 +99,13 @@ class AccountResource {
|
|
|
99
99
|
}
|
|
100
100
|
return this.client.request(`/account/${accountId}/externalAuths/${platform}`, { headers }, "v1");
|
|
101
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Resolve one or more Epic account IDs to their display names
|
|
104
|
+
* @param accountIds - Array of Epic Games account IDs (comma-separated, max 100)
|
|
105
|
+
*/
|
|
106
|
+
async getDisplayNames(accountIds) {
|
|
107
|
+
const ids = accountIds.join(",");
|
|
108
|
+
return this.client.request(`/account/displaynames?ids=${encodeURIComponent(ids)}`, {}, "v1");
|
|
109
|
+
}
|
|
102
110
|
}
|
|
103
111
|
exports.AccountResource = AccountResource;
|
|
@@ -1,27 +1,15 @@
|
|
|
1
1
|
import { FortniteAPI } from "../client";
|
|
2
|
-
import { Profile, ProfileStats } from "../types";
|
|
3
2
|
export declare class ProfilesResource {
|
|
4
3
|
private client;
|
|
5
4
|
constructor(client: FortniteAPI);
|
|
6
5
|
/**
|
|
7
|
-
* Get profile progress (
|
|
6
|
+
* Get profile progress (track progress, levels) by display name
|
|
8
7
|
* @param displayName - Epic Games display name
|
|
9
8
|
*/
|
|
10
9
|
getProgress(displayName: string): Promise<any>;
|
|
11
10
|
/**
|
|
12
|
-
* Get
|
|
11
|
+
* Get enriched ranked progress by display name (human-readable ranks, game modes, season dates)
|
|
13
12
|
* @param displayName - Epic Games display name
|
|
14
|
-
* @param timeWindow - Time period: "season" or "lifetime" (default: "lifetime")
|
|
15
13
|
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Get account info by ID
|
|
19
|
-
* @param accountId - Epic Games Account ID
|
|
20
|
-
*/
|
|
21
|
-
getAccount(accountId: string): Promise<Profile>;
|
|
22
|
-
/**
|
|
23
|
-
* Get multiple display names by account IDs
|
|
24
|
-
* @param accountIds - Array of account IDs (max 100)
|
|
25
|
-
*/
|
|
26
|
-
getDisplayNames(accountIds: string[]): Promise<Record<string, string>>;
|
|
14
|
+
getRanked(displayName: string): Promise<any>;
|
|
27
15
|
}
|
|
@@ -6,39 +6,18 @@ class ProfilesResource {
|
|
|
6
6
|
this.client = client;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
* Get profile progress (
|
|
9
|
+
* Get profile progress (track progress, levels) by display name
|
|
10
10
|
* @param displayName - Epic Games display name
|
|
11
11
|
*/
|
|
12
12
|
async getProgress(displayName) {
|
|
13
13
|
return this.client.request(`/profile/progress?displayName=${encodeURIComponent(displayName)}`);
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* Get
|
|
16
|
+
* Get enriched ranked progress by display name (human-readable ranks, game modes, season dates)
|
|
17
17
|
* @param displayName - Epic Games display name
|
|
18
|
-
* @param timeWindow - Time period: "season" or "lifetime" (default: "lifetime")
|
|
19
18
|
*/
|
|
20
|
-
async
|
|
21
|
-
|
|
22
|
-
displayName,
|
|
23
|
-
});
|
|
24
|
-
if (timeWindow)
|
|
25
|
-
params.set("timeWindow", timeWindow);
|
|
26
|
-
return this.client.request(`/profile/stats?${params.toString()}`);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Get account info by ID
|
|
30
|
-
* @param accountId - Epic Games Account ID
|
|
31
|
-
*/
|
|
32
|
-
async getAccount(accountId) {
|
|
33
|
-
return this.client.request(`/account/${accountId}`);
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Get multiple display names by account IDs
|
|
37
|
-
* @param accountIds - Array of account IDs (max 100)
|
|
38
|
-
*/
|
|
39
|
-
async getDisplayNames(accountIds) {
|
|
40
|
-
const ids = accountIds.join(",");
|
|
41
|
-
return this.client.request(`/displaynames/multiple?ids=${encodeURIComponent(ids)}`);
|
|
19
|
+
async getRanked(displayName) {
|
|
20
|
+
return this.client.request(`/profile/ranked?displayName=${encodeURIComponent(displayName)}`);
|
|
42
21
|
}
|
|
43
22
|
}
|
|
44
23
|
exports.ProfilesResource = ProfilesResource;
|