@retroachievements/api 1.5.3 → 2.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.
- package/README.md +2 -2
- package/dist/achievement/getAchievementUnlocks.d.ts +1 -1
- package/dist/api.cjs +1 -1
- package/dist/api.cjs.map +1 -1
- package/dist/api.modern.js +1 -1
- package/dist/api.modern.js.map +1 -1
- package/dist/api.module.js +1 -1
- package/dist/api.module.js.map +1 -1
- package/dist/api.umd.js +1 -1
- package/dist/api.umd.js.map +1 -1
- package/dist/console/getConsoleIds.d.ts +15 -4
- package/dist/console/getGameList.d.ts +1 -1
- package/dist/console/models/fetched-system.model.d.ts +7 -0
- package/dist/console/models/get-console-ids-response.model.d.ts +2 -0
- package/dist/console/models/index.d.ts +1 -1
- package/dist/feed/getAchievementOfTheWeek.d.ts +1 -1
- package/dist/feed/getActiveClaims.d.ts +1 -1
- package/dist/feed/getTopTenUsers.d.ts +3 -3
- package/dist/feed/models/top-ten-users-entity.model.d.ts +1 -1
- package/dist/game/getAchievementCount.d.ts +1 -1
- package/dist/game/getAchievementDistribution.d.ts +1 -1
- package/dist/game/getGame.d.ts +1 -1
- package/dist/game/getGameExtended.d.ts +1 -1
- package/dist/game/getGameRankAndScore.d.ts +1 -1
- package/dist/game/getGameRating.d.ts +1 -1
- package/dist/ticket/getTicketData.d.ts +9 -9
- package/dist/user/getAchievementsEarnedBetween.d.ts +4 -4
- package/dist/user/getAchievementsEarnedOnDay.d.ts +4 -4
- package/dist/user/getGameInfoAndUserProgress.d.ts +9 -5
- package/dist/user/getUserAwards.d.ts +4 -4
- package/dist/user/getUserClaims.d.ts +4 -4
- package/dist/user/getUserCompletedGames.d.ts +4 -4
- package/dist/user/getUserCompletionProgress.d.ts +4 -4
- package/dist/user/getUserGameRankAndScore.d.ts +4 -4
- package/dist/user/getUserPoints.d.ts +4 -4
- package/dist/user/getUserProfile.d.ts +4 -4
- package/dist/user/getUserProgress.d.ts +4 -4
- package/dist/user/getUserRecentAchievements.d.ts +4 -4
- package/dist/user/getUserRecentlyPlayedGames.d.ts +4 -4
- package/dist/user/getUserSummary.d.ts +4 -4
- package/dist/user/models/game-info-and-user-progress.model.d.ts +2 -0
- package/dist/user/models/get-game-info-and-user-progress-response.model.d.ts +2 -0
- package/dist/utils/public/buildAuthorization.d.ts +1 -1
- package/dist/utils/public/models/auth-object.model.d.ts +2 -2
- package/package.json +6 -12
- package/src/__playground.ts +4 -4
- package/src/achievement/getAchievementUnlocks.test.ts +1 -1
- package/src/achievement/getAchievementUnlocks.ts +1 -1
- package/src/console/getConsoleIds.test.ts +15 -3
- package/src/console/getConsoleIds.ts +28 -6
- package/src/console/getGameList.test.ts +1 -1
- package/src/console/getGameList.ts +1 -1
- package/src/console/models/fetched-system.model.ts +7 -0
- package/src/console/models/get-console-ids-response.model.ts +2 -0
- package/src/console/models/index.ts +1 -1
- package/src/feed/getAchievementOfTheWeek.test.ts +2 -2
- package/src/feed/getAchievementOfTheWeek.ts +1 -1
- package/src/feed/getActiveClaims.test.ts +1 -1
- package/src/feed/getActiveClaims.ts +1 -1
- package/src/feed/getClaims.test.ts +1 -1
- package/src/feed/getTopTenUsers.test.ts +11 -11
- package/src/feed/getTopTenUsers.ts +4 -4
- package/src/feed/models/top-ten-users-entity.model.ts +1 -1
- package/src/game/getAchievementCount.test.ts +1 -1
- package/src/game/getAchievementCount.ts +1 -1
- package/src/game/getAchievementDistribution.test.ts +4 -4
- package/src/game/getAchievementDistribution.ts +1 -1
- package/src/game/getGame.test.ts +1 -1
- package/src/game/getGame.ts +1 -1
- package/src/game/getGameExtended.test.ts +1 -1
- package/src/game/getGameExtended.ts +1 -1
- package/src/game/getGameRankAndScore.test.ts +1 -1
- package/src/game/getGameRankAndScore.ts +1 -1
- package/src/game/getGameRating.test.ts +1 -1
- package/src/game/getGameRating.ts +1 -1
- package/src/ticket/getTicketData.test.ts +7 -7
- package/src/ticket/getTicketData.ts +13 -13
- package/src/user/getAchievementsEarnedBetween.test.ts +2 -2
- package/src/user/getAchievementsEarnedBetween.ts +6 -6
- package/src/user/getAchievementsEarnedOnDay.test.ts +2 -2
- package/src/user/getAchievementsEarnedOnDay.ts +6 -6
- package/src/user/getGameInfoAndUserProgress.test.ts +3 -3
- package/src/user/getGameInfoAndUserProgress.ts +22 -11
- package/src/user/getUserAwards.test.ts +2 -2
- package/src/user/getUserAwards.ts +6 -6
- package/src/user/getUserClaims.test.ts +2 -2
- package/src/user/getUserClaims.ts +6 -6
- package/src/user/getUserCompletedGames.test.ts +2 -2
- package/src/user/getUserCompletedGames.ts +6 -6
- package/src/user/getUserCompletionProgress.test.ts +2 -2
- package/src/user/getUserCompletionProgress.ts +6 -6
- package/src/user/getUserGameRankAndScore.test.ts +2 -2
- package/src/user/getUserGameRankAndScore.ts +6 -6
- package/src/user/getUserPoints.test.ts +2 -2
- package/src/user/getUserPoints.ts +6 -6
- package/src/user/getUserProfile.test.ts +2 -2
- package/src/user/getUserProfile.ts +6 -6
- package/src/user/getUserProgress.test.ts +2 -2
- package/src/user/getUserProgress.ts +6 -6
- package/src/user/getUserRecentAchievements.test.ts +2 -2
- package/src/user/getUserRecentAchievements.ts +6 -6
- package/src/user/getUserRecentlyPlayedGames.test.ts +2 -2
- package/src/user/getUserRecentlyPlayedGames.ts +6 -6
- package/src/user/getUserSummary.test.ts +4 -4
- package/src/user/getUserSummary.ts +6 -6
- package/src/user/models/game-info-and-user-progress.model.ts +8 -0
- package/src/user/models/get-game-info-and-user-progress-response.model.ts +8 -0
- package/src/utils/internal/buildRequestUrl.test.ts +2 -2
- package/src/utils/internal/buildRequestUrl.ts +1 -1
- package/src/utils/public/buildAuthorization.test.ts +3 -3
- package/src/utils/public/buildAuthorization.ts +4 -4
- package/src/utils/public/models/auth-object.model.ts +2 -2
- package/src/console/models/console-id.model.ts +0 -5
|
@@ -5,7 +5,7 @@ import type { GameExtended } from "./models";
|
|
|
5
5
|
* A call to this function will retrieve extended metadata
|
|
6
6
|
* about a game, targeted via its unique ID.
|
|
7
7
|
*
|
|
8
|
-
* @param authorization An object containing your
|
|
8
|
+
* @param authorization An object containing your username and webApiKey.
|
|
9
9
|
* This can be constructed with `buildAuthorization()`.
|
|
10
10
|
*
|
|
11
11
|
* @param payload.gameId The unique game ID. If you are unsure, open the
|
|
@@ -7,7 +7,7 @@ import type { GameRankAndScoreEntity } from "./models";
|
|
|
7
7
|
* points earners for a game. The game is targeted via
|
|
8
8
|
* its unique ID.
|
|
9
9
|
*
|
|
10
|
-
* @param authorization An object containing your
|
|
10
|
+
* @param authorization An object containing your username and webApiKey.
|
|
11
11
|
* This can be constructed with `buildAuthorization()`.
|
|
12
12
|
*
|
|
13
13
|
* @param payload.gameId The unique game ID. If you are unsure, open the
|
|
@@ -5,7 +5,7 @@ import type { GameRating } from "./models";
|
|
|
5
5
|
* A call to this function will retrieve metadata about
|
|
6
6
|
* how users have rated the game and its set.
|
|
7
7
|
*
|
|
8
|
-
* @param authorization An object containing your
|
|
8
|
+
* @param authorization An object containing your username and webApiKey.
|
|
9
9
|
* This can be constructed with `buildAuthorization()`.
|
|
10
10
|
*
|
|
11
11
|
* @param payload.gameId The unique game ID. If you are unsure, open the
|
|
@@ -8,7 +8,7 @@ import type { AchievementTicketStats, GameTicketStats, MostTicketedGames, Recent
|
|
|
8
8
|
* A call to this function will retrieve ticket metadata information
|
|
9
9
|
* about a single achievement ticket, targeted by its ticket ID.
|
|
10
10
|
*
|
|
11
|
-
* @param authorization An object containing your
|
|
11
|
+
* @param authorization An object containing your username and webApiKey.
|
|
12
12
|
* This can be constructed with `buildAuthorization()`.
|
|
13
13
|
*
|
|
14
14
|
* @param payload.ticketId The ID of the ticket to get information about.
|
|
@@ -30,7 +30,7 @@ export declare function getTicketData(authorization: AuthObject, payload: {
|
|
|
30
30
|
* A call to this function will retrieve ticket metadata information
|
|
31
31
|
* about the latest opened achievement tickets on RetroAchievements.
|
|
32
32
|
*
|
|
33
|
-
* @param authorization An object containing your
|
|
33
|
+
* @param authorization An object containing your username and webApiKey.
|
|
34
34
|
* This can be constructed with `buildAuthorization()`.
|
|
35
35
|
*
|
|
36
36
|
* @param payload.count Optional. Defaults to 10. Max is 100.
|
|
@@ -54,7 +54,7 @@ export declare function getTicketData(authorization: AuthObject, payload?: Parti
|
|
|
54
54
|
* A call to this function will retrieve the games on the site with
|
|
55
55
|
* the highest count of opened achievement tickets.
|
|
56
56
|
*
|
|
57
|
-
* @param authorization An object containing your
|
|
57
|
+
* @param authorization An object containing your username and webApiKey.
|
|
58
58
|
* This can be constructed with `buildAuthorization()`.
|
|
59
59
|
*
|
|
60
60
|
* @param payload.count Optional. Defaults to 10. Max is 100.
|
|
@@ -82,31 +82,31 @@ export declare function getTicketData(authorization: AuthObject, payload: {
|
|
|
82
82
|
* A call to this function will retrieve an achievement developer's
|
|
83
83
|
* ticket stats, targeted by that developer's username.
|
|
84
84
|
*
|
|
85
|
-
* @param authorization An object containing your
|
|
85
|
+
* @param authorization An object containing your username and webApiKey.
|
|
86
86
|
* This can be constructed with `buildAuthorization()`.
|
|
87
87
|
*
|
|
88
|
-
* @param payload.
|
|
88
|
+
* @param payload.username The developer's account username to retrieve
|
|
89
89
|
* ticket stats for.
|
|
90
90
|
*
|
|
91
91
|
* @example
|
|
92
92
|
* ```
|
|
93
93
|
* const ticketData = await getTicketData(
|
|
94
94
|
* authorization,
|
|
95
|
-
* {
|
|
95
|
+
* { username: "xelnia" }
|
|
96
96
|
* );
|
|
97
97
|
* ```
|
|
98
98
|
*
|
|
99
99
|
* @returns An achievement developer's ticket stats.
|
|
100
100
|
*/
|
|
101
101
|
export declare function getTicketData(authorization: AuthObject, payload: {
|
|
102
|
-
|
|
102
|
+
username: string;
|
|
103
103
|
}): Promise<UserTicketStats>;
|
|
104
104
|
/**
|
|
105
105
|
* A call to this function will retrieve a game's ticket stats, targeted
|
|
106
106
|
* by the game's ID. If you are unsure of a game's ID, visit its page
|
|
107
107
|
* on the RetroAchievements website and copy the number at the end of the URL.
|
|
108
108
|
*
|
|
109
|
-
* @param authorization An object containing your
|
|
109
|
+
* @param authorization An object containing your username and webApiKey.
|
|
110
110
|
* This can be constructed with `buildAuthorization()`.
|
|
111
111
|
*
|
|
112
112
|
* @param payload.gameId The game ID to fetch ticket stats for.
|
|
@@ -138,7 +138,7 @@ export declare function getTicketData(authorization: AuthObject, payload: {
|
|
|
138
138
|
* of an achievement's ID, open its page on the RetroAchievements
|
|
139
139
|
* website and copy the number at the end of the URL.
|
|
140
140
|
*
|
|
141
|
-
* @param authorization An object containing your
|
|
141
|
+
* @param authorization An object containing your username and webApiKey.
|
|
142
142
|
* This can be constructed with `buildAuthorization()`.
|
|
143
143
|
*
|
|
144
144
|
* @param payload.achievementId The ID of the achievement to fetch ticket
|
|
@@ -4,10 +4,10 @@ import type { DatedUserAchievement } from "./models";
|
|
|
4
4
|
* A call to this function will retrieve a list of achievements
|
|
5
5
|
* earned by a given user between two provided dates.
|
|
6
6
|
*
|
|
7
|
-
* @param authorization An object containing your
|
|
7
|
+
* @param authorization An object containing your username and webApiKey.
|
|
8
8
|
* This can be constructed with `buildAuthorization()`.
|
|
9
9
|
*
|
|
10
|
-
* @param payload.
|
|
10
|
+
* @param payload.username The user for which to retrieve the
|
|
11
11
|
* list of achievements for.
|
|
12
12
|
*
|
|
13
13
|
* @param payload.fromDate A Date object specifying when
|
|
@@ -21,7 +21,7 @@ import type { DatedUserAchievement } from "./models";
|
|
|
21
21
|
* const achievementsEarnedBetween = await getAchievementsEarnedBetween(
|
|
22
22
|
* authorization,
|
|
23
23
|
* {
|
|
24
|
-
*
|
|
24
|
+
* username: "xelnia",
|
|
25
25
|
* fromDate: new Date("2022-10-12"),
|
|
26
26
|
* toDate: new Date("2022-10-13")
|
|
27
27
|
* }
|
|
@@ -54,7 +54,7 @@ import type { DatedUserAchievement } from "./models";
|
|
|
54
54
|
* ```
|
|
55
55
|
*/
|
|
56
56
|
export declare const getAchievementsEarnedBetween: (authorization: AuthObject, payload: {
|
|
57
|
-
|
|
57
|
+
username: string;
|
|
58
58
|
fromDate: Date;
|
|
59
59
|
toDate: Date;
|
|
60
60
|
}) => Promise<DatedUserAchievement[]>;
|
|
@@ -4,10 +4,10 @@ import type { DatedUserAchievement } from "./models";
|
|
|
4
4
|
* A call to this function will retrieve a list of achievements
|
|
5
5
|
* earned by a given user on a specified date.
|
|
6
6
|
*
|
|
7
|
-
* @param authorization An object containing your
|
|
7
|
+
* @param authorization An object containing your username and webApiKey.
|
|
8
8
|
* This can be constructed with `buildAuthorization()`.
|
|
9
9
|
*
|
|
10
|
-
* @param payload.
|
|
10
|
+
* @param payload.username The user for which to retrieve the
|
|
11
11
|
* list of achievements for.
|
|
12
12
|
*
|
|
13
13
|
* @param payload.fromDate A Date object specifying when
|
|
@@ -21,7 +21,7 @@ import type { DatedUserAchievement } from "./models";
|
|
|
21
21
|
* const achievementsEarnedOnDay = await getAchievementsEarnedOnDay(
|
|
22
22
|
* authorization,
|
|
23
23
|
* {
|
|
24
|
-
*
|
|
24
|
+
* username: "xelnia",
|
|
25
25
|
* onDate: new Date("2022-10-13")
|
|
26
26
|
* }
|
|
27
27
|
* );
|
|
@@ -53,6 +53,6 @@ import type { DatedUserAchievement } from "./models";
|
|
|
53
53
|
* ```
|
|
54
54
|
*/
|
|
55
55
|
export declare const getAchievementsEarnedOnDay: (authorization: AuthObject, payload: {
|
|
56
|
-
|
|
56
|
+
username: string;
|
|
57
57
|
onDate: Date;
|
|
58
58
|
}) => Promise<DatedUserAchievement[]>;
|
|
@@ -6,7 +6,7 @@ import type { GameInfoAndUserProgress } from "./models";
|
|
|
6
6
|
* about a game, in addition to a user's progress about a game.
|
|
7
7
|
* This is targeted via a game's unique ID and a given username.
|
|
8
8
|
*
|
|
9
|
-
* @param authorization An object containing your
|
|
9
|
+
* @param authorization An object containing your username and webApiKey.
|
|
10
10
|
* This can be constructed with `buildAuthorization()`.
|
|
11
11
|
*
|
|
12
12
|
* @param payload.gameId The unique game ID. If you are unsure, open the
|
|
@@ -14,14 +14,17 @@ import type { GameInfoAndUserProgress } from "./models";
|
|
|
14
14
|
* URL is https://retroachievements.org/game/14402. We can see from the
|
|
15
15
|
* URL that the game ID is "14402".
|
|
16
16
|
*
|
|
17
|
-
* @param payload.
|
|
17
|
+
* @param payload.username The user for which to retrieve the
|
|
18
18
|
* game progress for.
|
|
19
19
|
*
|
|
20
|
+
* @param payload.shouldIncludeHighestAwardMetadata Include a "HighestAwardKind"
|
|
21
|
+
* and a "HighestAwardDate" for the given user and game ID.
|
|
22
|
+
*
|
|
20
23
|
* @example
|
|
21
24
|
* ```
|
|
22
25
|
* const gameInfoAndUserProgress = await getGameInfoAndUserProgress(
|
|
23
26
|
* authorization,
|
|
24
|
-
* { gameId: 14402,
|
|
27
|
+
* { gameId: 14402, username: "wv_pinball" }
|
|
25
28
|
* );
|
|
26
29
|
* ```
|
|
27
30
|
*
|
|
@@ -41,7 +44,7 @@ import type { GameInfoAndUserProgress } from "./models";
|
|
|
41
44
|
* publisher: "Activision",
|
|
42
45
|
* developer: "David Crane",
|
|
43
46
|
* genre: "Racing",
|
|
44
|
-
* released: 1980,
|
|
47
|
+
* released: "1980",
|
|
45
48
|
* isFinal: false,
|
|
46
49
|
* consoleName: "Atari 2600",
|
|
47
50
|
* richPresencePatch: "2b92fa1bf9635c303b3b7f8feea3ed3c",
|
|
@@ -77,5 +80,6 @@ import type { GameInfoAndUserProgress } from "./models";
|
|
|
77
80
|
*/
|
|
78
81
|
export declare const getGameInfoAndUserProgress: (authorization: AuthObject, payload: {
|
|
79
82
|
gameId: ID;
|
|
80
|
-
|
|
83
|
+
username: string;
|
|
84
|
+
shouldIncludeHighestAwardMetadata?: boolean;
|
|
81
85
|
}) => Promise<GameInfoAndUserProgress>;
|
|
@@ -4,16 +4,16 @@ import type { UserAwards } from "./models";
|
|
|
4
4
|
* A call to this function will retrieve metadata about the target user's
|
|
5
5
|
* site awards, via their username.
|
|
6
6
|
*
|
|
7
|
-
* @param authorization An object containing your
|
|
7
|
+
* @param authorization An object containing your username and webApiKey.
|
|
8
8
|
* This can be constructed with `buildAuthorization()`.
|
|
9
9
|
*
|
|
10
|
-
* @param payload.
|
|
10
|
+
* @param payload.username The user for which to retrieve the site awards for.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```
|
|
14
14
|
* const userAwards = await getUserAwards(
|
|
15
15
|
* authorization,
|
|
16
|
-
* {
|
|
16
|
+
* { username: "xelnia" }
|
|
17
17
|
* )
|
|
18
18
|
* ```
|
|
19
19
|
*
|
|
@@ -45,5 +45,5 @@ import type { UserAwards } from "./models";
|
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
47
47
|
export declare const getUserAwards: (authorization: AuthObject, payload: {
|
|
48
|
-
|
|
48
|
+
username: string;
|
|
49
49
|
}) => Promise<UserAwards>;
|
|
@@ -5,17 +5,17 @@ import type { UserClaims } from "./models";
|
|
|
5
5
|
* achievement set claims made over the lifetime of a given
|
|
6
6
|
* user, targeted by their username.
|
|
7
7
|
*
|
|
8
|
-
* @param authorization An object containing your
|
|
8
|
+
* @param authorization An object containing your username and webApiKey.
|
|
9
9
|
* This can be constructed with `buildAuthorization()`.
|
|
10
10
|
*
|
|
11
|
-
* @param payload.
|
|
11
|
+
* @param payload.username The user for which to retrieve the historical
|
|
12
12
|
* achievement set claims list for.
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
15
|
* ```
|
|
16
16
|
* const userClaims = await getUserClaims(
|
|
17
17
|
* authorization,
|
|
18
|
-
* {
|
|
18
|
+
* { username: "Jamiras" }
|
|
19
19
|
* );
|
|
20
20
|
* ```
|
|
21
21
|
*
|
|
@@ -23,5 +23,5 @@ import type { UserClaims } from "./models";
|
|
|
23
23
|
* made over the lifetime of the given user.
|
|
24
24
|
*/
|
|
25
25
|
export declare const getUserClaims: (authorization: AuthObject, payload: {
|
|
26
|
-
|
|
26
|
+
username: string;
|
|
27
27
|
}) => Promise<UserClaims>;
|
|
@@ -7,17 +7,17 @@ import type { UserCompletedGames } from "./models";
|
|
|
7
7
|
* one for the hardcore completion. These are designated by
|
|
8
8
|
* the `hardcoreMode` property on each completion object.
|
|
9
9
|
*
|
|
10
|
-
* @param authorization An object containing your
|
|
10
|
+
* @param authorization An object containing your username and webApiKey.
|
|
11
11
|
* This can be constructed with `buildAuthorization()`.
|
|
12
12
|
*
|
|
13
|
-
* @param payload.
|
|
13
|
+
* @param payload.username The user for which to retrieve the
|
|
14
14
|
* completion metadata for.
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
17
|
* ```
|
|
18
18
|
* const userCompletedGames = await getUserCompletedGames(
|
|
19
19
|
* authorization,
|
|
20
|
-
* {
|
|
20
|
+
* { username: "xelnia" }
|
|
21
21
|
* );
|
|
22
22
|
* ```
|
|
23
23
|
*
|
|
@@ -52,5 +52,5 @@ import type { UserCompletedGames } from "./models";
|
|
|
52
52
|
* ```
|
|
53
53
|
*/
|
|
54
54
|
export declare const getUserCompletedGames: (authorization: AuthObject, payload: {
|
|
55
|
-
|
|
55
|
+
username: string;
|
|
56
56
|
}) => Promise<UserCompletedGames>;
|
|
@@ -4,10 +4,10 @@ import type { UserCompletionProgress } from "./models";
|
|
|
4
4
|
* A call to this function will retrieve a given user's completion
|
|
5
5
|
* progress, targeted by their username.
|
|
6
6
|
*
|
|
7
|
-
* @param authorization An object containing your
|
|
7
|
+
* @param authorization An object containing your username and webApiKey.
|
|
8
8
|
* This can be constructed with `buildAuthorization()`.
|
|
9
9
|
*
|
|
10
|
-
* @param payload.
|
|
10
|
+
* @param payload.username The user for which to retrieve the progress for.
|
|
11
11
|
*
|
|
12
12
|
* @param payload.offset Defaults to 0. The number of entries to skip.
|
|
13
13
|
*
|
|
@@ -17,7 +17,7 @@ import type { UserCompletionProgress } from "./models";
|
|
|
17
17
|
* ```
|
|
18
18
|
* const userCompletionProgress = await getUserCompletionProgress(
|
|
19
19
|
* authorization,
|
|
20
|
-
* {
|
|
20
|
+
* { username: "xelnia" }
|
|
21
21
|
* );
|
|
22
22
|
* ```
|
|
23
23
|
*
|
|
@@ -45,7 +45,7 @@ import type { UserCompletionProgress } from "./models";
|
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
47
47
|
export declare const getUserCompletionProgress: (authorization: AuthObject, payload: {
|
|
48
|
-
|
|
48
|
+
username: string;
|
|
49
49
|
offset?: number;
|
|
50
50
|
count?: number;
|
|
51
51
|
}) => Promise<UserCompletionProgress>;
|
|
@@ -6,7 +6,7 @@ import type { UserGameRankAndScore } from "./models";
|
|
|
6
6
|
* how a particular user has performed/ranked on a particular
|
|
7
7
|
* game, targeted by game ID.
|
|
8
8
|
*
|
|
9
|
-
* @param authorization An object containing your
|
|
9
|
+
* @param authorization An object containing your username and webApiKey.
|
|
10
10
|
* This can be constructed with `buildAuthorization()`.
|
|
11
11
|
*
|
|
12
12
|
* @param payload.gameId The unique game ID. If you are unsure, open the
|
|
@@ -14,14 +14,14 @@ import type { UserGameRankAndScore } from "./models";
|
|
|
14
14
|
* URL is https://retroachievements.org/game/14402. We can see from the
|
|
15
15
|
* URL that the game ID is "14402".
|
|
16
16
|
*
|
|
17
|
-
* @param payload.
|
|
17
|
+
* @param payload.username The user for which to retrieve the
|
|
18
18
|
* game ranking metadata for.
|
|
19
19
|
*
|
|
20
20
|
* @example
|
|
21
21
|
* ```
|
|
22
22
|
* const userGameRankAndScore = await getUserGameRankAndScore(
|
|
23
23
|
* authorization,
|
|
24
|
-
* { gameId: 14402,
|
|
24
|
+
* { gameId: 14402, username: "xelnia" }
|
|
25
25
|
* );
|
|
26
26
|
* ```
|
|
27
27
|
*
|
|
@@ -41,5 +41,5 @@ import type { UserGameRankAndScore } from "./models";
|
|
|
41
41
|
*/
|
|
42
42
|
export declare const getUserGameRankAndScore: (authorization: AuthObject, payload: {
|
|
43
43
|
gameId: ID;
|
|
44
|
-
|
|
44
|
+
username: string;
|
|
45
45
|
}) => Promise<UserGameRankAndScore>;
|
|
@@ -4,16 +4,16 @@ import type { UserPoints } from "./models";
|
|
|
4
4
|
* A call to this function will retrieve a given user's hardcore
|
|
5
5
|
* and softcore points.
|
|
6
6
|
*
|
|
7
|
-
* @param authorization An object containing your
|
|
7
|
+
* @param authorization An object containing your username and webApiKey.
|
|
8
8
|
* This can be constructed with `buildAuthorization()`.
|
|
9
9
|
*
|
|
10
|
-
* @param payload.
|
|
10
|
+
* @param payload.username The user for which to retrieve the point totals for.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```
|
|
14
14
|
* const userPoints = await getUserPoints(
|
|
15
15
|
* authorization,
|
|
16
|
-
* {
|
|
16
|
+
* { username: "xelnia" }
|
|
17
17
|
* );
|
|
18
18
|
* ```
|
|
19
19
|
*
|
|
@@ -26,5 +26,5 @@ import type { UserPoints } from "./models";
|
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
28
|
export declare const getUserPoints: (authorization: AuthObject, payload: {
|
|
29
|
-
|
|
29
|
+
username: string;
|
|
30
30
|
}) => Promise<UserPoints>;
|
|
@@ -4,21 +4,21 @@ import type { UserProfile } from "./models";
|
|
|
4
4
|
* A call to this function will retrieve summary information about
|
|
5
5
|
* a given user, targeted by username.
|
|
6
6
|
*
|
|
7
|
-
* @param authorization An object containing your
|
|
7
|
+
* @param authorization An object containing your username and webApiKey.
|
|
8
8
|
* This can be constructed with `buildAuthorization()`.
|
|
9
9
|
*
|
|
10
|
-
* @param payload.
|
|
10
|
+
* @param payload.username The user for which to retrieve the summary for.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```
|
|
14
14
|
* const userSummary = await getUserProfile(
|
|
15
15
|
* authorization,
|
|
16
|
-
* {
|
|
16
|
+
* { username: "xelnia" }
|
|
17
17
|
* );
|
|
18
18
|
* ```
|
|
19
19
|
*
|
|
20
20
|
* @returns An object containing profile summary metadata about a target user.
|
|
21
21
|
*/
|
|
22
22
|
export declare const getUserProfile: (authorization: AuthObject, payload: {
|
|
23
|
-
|
|
23
|
+
username: string;
|
|
24
24
|
}) => Promise<UserProfile>;
|
|
@@ -5,10 +5,10 @@ import type { UserProgress } from "./models";
|
|
|
5
5
|
* A call to this function will retrieve a given user's
|
|
6
6
|
* progress on a given list of games, targeted by game ID.
|
|
7
7
|
*
|
|
8
|
-
* @param authorization An object containing your
|
|
8
|
+
* @param authorization An object containing your username and webApiKey.
|
|
9
9
|
* This can be constructed with `buildAuthorization()`.
|
|
10
10
|
*
|
|
11
|
-
* @param payload.
|
|
11
|
+
* @param payload.username The user for which to retrieve the progress for.
|
|
12
12
|
*
|
|
13
13
|
* @param payload.gameIds An array of RetroAchievements game IDs. If you aren't
|
|
14
14
|
* sure of the game ID, visit the game's page on the website and copy the number
|
|
@@ -18,7 +18,7 @@ import type { UserProgress } from "./models";
|
|
|
18
18
|
* ```
|
|
19
19
|
* const userProgress = await getUserProgress(
|
|
20
20
|
* authorization,
|
|
21
|
-
* {
|
|
21
|
+
* { username: "xelnia", gameIds: [1, 14402] }
|
|
22
22
|
* );
|
|
23
23
|
* ```
|
|
24
24
|
*
|
|
@@ -45,6 +45,6 @@ import type { UserProgress } from "./models";
|
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
47
47
|
export declare const getUserProgress: (authorization: AuthObject, payload: {
|
|
48
|
-
|
|
48
|
+
username: string;
|
|
49
49
|
gameIds: ID[];
|
|
50
50
|
}) => Promise<UserProgress>;
|
|
@@ -5,10 +5,10 @@ import type { UserRecentAchievement } from "./models";
|
|
|
5
5
|
* recently earned achievements, via their username. By default, it
|
|
6
6
|
* fetches achievements earned in the last hour.
|
|
7
7
|
*
|
|
8
|
-
* @param authorization An object containing your
|
|
8
|
+
* @param authorization An object containing your username and webApiKey.
|
|
9
9
|
* This can be constructed with `buildAuthorization()`.
|
|
10
10
|
*
|
|
11
|
-
* @param payload.
|
|
11
|
+
* @param payload.username The user for which to retrieve the recent achievements for.
|
|
12
12
|
*
|
|
13
13
|
* @param payload.recentMinutes Optional. Defaults to 60. How many minutes
|
|
14
14
|
* back to fetch for the given user.
|
|
@@ -17,7 +17,7 @@ import type { UserRecentAchievement } from "./models";
|
|
|
17
17
|
* ```
|
|
18
18
|
* const userRecentAchievements = await getUserRecentAchievements(
|
|
19
19
|
* authorization,
|
|
20
|
-
* {
|
|
20
|
+
* { username: "xelnia" }
|
|
21
21
|
* );
|
|
22
22
|
* ```
|
|
23
23
|
*
|
|
@@ -44,6 +44,6 @@ import type { UserRecentAchievement } from "./models";
|
|
|
44
44
|
* ```
|
|
45
45
|
*/
|
|
46
46
|
export declare const getUserRecentAchievements: (authorization: AuthObject, payload: {
|
|
47
|
-
|
|
47
|
+
username: string;
|
|
48
48
|
recentMinutes?: number;
|
|
49
49
|
}) => Promise<UserRecentAchievement[]>;
|
|
@@ -4,10 +4,10 @@ import type { UserRecentlyPlayedGames } from "./models";
|
|
|
4
4
|
* A call to this function will retrieve a list of a target user's
|
|
5
5
|
* recently played games, via their username.
|
|
6
6
|
*
|
|
7
|
-
* @param authorization An object containing your
|
|
7
|
+
* @param authorization An object containing your username and webApiKey.
|
|
8
8
|
* This can be constructed with `buildAuthorization()`.
|
|
9
9
|
*
|
|
10
|
-
* @param payload.
|
|
10
|
+
* @param payload.username The user for which to retrieve the summary for.
|
|
11
11
|
*
|
|
12
12
|
* @param payload.count Optional. Defaults to 10. Max is 50. How many
|
|
13
13
|
* recently played games for the user to retrieve.
|
|
@@ -19,7 +19,7 @@ import type { UserRecentlyPlayedGames } from "./models";
|
|
|
19
19
|
* ```
|
|
20
20
|
* const userRecentlyPlayedGames = await getUserRecentlyPlayedGames(
|
|
21
21
|
* authorization,
|
|
22
|
-
* {
|
|
22
|
+
* { username: "xelnia" }
|
|
23
23
|
* );
|
|
24
24
|
* ```
|
|
25
25
|
*
|
|
@@ -44,7 +44,7 @@ import type { UserRecentlyPlayedGames } from "./models";
|
|
|
44
44
|
* ```
|
|
45
45
|
*/
|
|
46
46
|
export declare const getUserRecentlyPlayedGames: (authorization: AuthObject, payload: {
|
|
47
|
-
|
|
47
|
+
username: string;
|
|
48
48
|
offset?: number;
|
|
49
49
|
count?: number;
|
|
50
50
|
}) => Promise<UserRecentlyPlayedGames>;
|
|
@@ -4,10 +4,10 @@ import type { UserSummary } from "./models";
|
|
|
4
4
|
* A call to this function will retrieve summary information about
|
|
5
5
|
* a given user, targeted by username.
|
|
6
6
|
*
|
|
7
|
-
* @param authorization An object containing your
|
|
7
|
+
* @param authorization An object containing your username and webApiKey.
|
|
8
8
|
* This can be constructed with `buildAuthorization()`.
|
|
9
9
|
*
|
|
10
|
-
* @param payload.
|
|
10
|
+
* @param payload.username The user for which to retrieve the summary for.
|
|
11
11
|
*
|
|
12
12
|
* @param payload.recentGamesCount Optional. The number of recent games to return.
|
|
13
13
|
* This defaults to 0.
|
|
@@ -19,14 +19,14 @@ import type { UserSummary } from "./models";
|
|
|
19
19
|
* ```
|
|
20
20
|
* const userSummary = await getUserSummary(
|
|
21
21
|
* authorization,
|
|
22
|
-
* {
|
|
22
|
+
* { username: "xelnia" }
|
|
23
23
|
* );
|
|
24
24
|
* ```
|
|
25
25
|
*
|
|
26
26
|
* @returns An object containing summary metadata about a target user.
|
|
27
27
|
*/
|
|
28
28
|
export declare const getUserSummary: (authorization: AuthObject, payload: {
|
|
29
|
-
|
|
29
|
+
username: string;
|
|
30
30
|
recentGamesCount?: number;
|
|
31
31
|
recentAchievementsCount?: number;
|
|
32
32
|
}) => Promise<UserSummary>;
|
|
@@ -9,4 +9,6 @@ export interface GameInfoAndUserProgress extends GameExtended {
|
|
|
9
9
|
numAwardedToUserHardcore: number;
|
|
10
10
|
userCompletion: string;
|
|
11
11
|
userCompletionHardcore: string;
|
|
12
|
+
highestAwardKind?: "mastered" | "completed" | "beaten-hardcore" | "beaten-softcore" | null;
|
|
13
|
+
highestAwardDate?: string;
|
|
12
14
|
}
|
|
@@ -10,5 +10,7 @@ export interface GetGameInfoAndUserProgressResponse extends GetGameExtendedRespo
|
|
|
10
10
|
NumAwardedToUserHardcore: number;
|
|
11
11
|
UserCompletion: string;
|
|
12
12
|
UserCompletionHardcore: string;
|
|
13
|
+
HighestAwardKind?: "mastered" | "completed" | "beaten-hardcore" | "beaten-softcore" | null;
|
|
14
|
+
HighestAwardDate?: string;
|
|
13
15
|
}
|
|
14
16
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Each RetroAchievements API call is uniquely authenticated
|
|
3
|
-
* using a
|
|
3
|
+
* using a username + API key combination. Your account's personal
|
|
4
4
|
* Web API Key can be found on the Settings page.
|
|
5
5
|
*/
|
|
6
6
|
export interface AuthObject {
|
|
@@ -9,7 +9,7 @@ export interface AuthObject {
|
|
|
9
9
|
* For example, https://retroachievements.org/user/Scott would have a value
|
|
10
10
|
* of "Scott".
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
username: string;
|
|
13
13
|
/**
|
|
14
14
|
* This can be found in the "Keys" section of your Settings page on the
|
|
15
15
|
* RetroAchievements.org website. This is a 32-digit alphanumeric key
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"raweb",
|
|
11
11
|
"retro gaming"
|
|
12
12
|
],
|
|
13
|
-
"version": "
|
|
13
|
+
"version": "2.0.0",
|
|
14
14
|
"typings": "dist/index.d.ts",
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dev": "esrun --watch src/__playground.ts",
|
|
33
33
|
"prebuild": "node src/set-version.js",
|
|
34
34
|
"build": "microbundle",
|
|
35
|
-
"prepare": "microbundle",
|
|
35
|
+
"prepare": "microbundle && husky install",
|
|
36
36
|
"format": "prettier --write . '**/*.{json,md,js,ts,tsx}'",
|
|
37
37
|
"format:write": "prettier --write . '**/*.{json,md,js,ts,tsx}'",
|
|
38
38
|
"format:check": "prettier --check . '**/*.{json,md,js,ts,tsx}'",
|
|
@@ -41,10 +41,9 @@
|
|
|
41
41
|
"test": "vitest run",
|
|
42
42
|
"test:watch": "vitest",
|
|
43
43
|
"test:coverage": "vitest run --coverage",
|
|
44
|
-
"verify": "
|
|
44
|
+
"verify": "pnpm format:check && pnpm lint && pnpm test:coverage && pnpm build",
|
|
45
45
|
"start": "microbundle watch"
|
|
46
46
|
},
|
|
47
|
-
"peerDependencies": {},
|
|
48
47
|
"devDependencies": {
|
|
49
48
|
"@commitlint/cli": "^17.4.2",
|
|
50
49
|
"@commitlint/config-conventional": "^17.4.2",
|
|
@@ -62,7 +61,7 @@
|
|
|
62
61
|
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
63
62
|
"eslint-plugin-sonarjs": "^0.23.0",
|
|
64
63
|
"eslint-plugin-unicorn": "^49.0.0",
|
|
65
|
-
"husky": "
|
|
64
|
+
"husky": "9.0.11",
|
|
66
65
|
"microbundle": "^0.15.1",
|
|
67
66
|
"msw": "^2.0.3",
|
|
68
67
|
"prettier": "2.8.3",
|
|
@@ -74,12 +73,6 @@
|
|
|
74
73
|
"vite": "^4.5.0",
|
|
75
74
|
"vitest": "^0.34.6"
|
|
76
75
|
},
|
|
77
|
-
"husky": {
|
|
78
|
-
"hooks": {
|
|
79
|
-
"pre-commit": "pretty-quick --staged && yarn lint",
|
|
80
|
-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
76
|
"config": {
|
|
84
77
|
"commitizen": {
|
|
85
78
|
"path": "./node_modules/cz-conventional-changelog"
|
|
@@ -102,5 +95,6 @@
|
|
|
102
95
|
"url": "https://github.com/RetroAchievements/api-js/issues"
|
|
103
96
|
},
|
|
104
97
|
"homepage": "https://github.com/RetroAchievements/api-js#readme",
|
|
105
|
-
"author": "RAWeb Team"
|
|
98
|
+
"author": "RAWeb Team",
|
|
99
|
+
"packageManager": "pnpm@9.1.1+sha256.9551e803dcb7a1839fdf5416153a844060c7bce013218ce823410532504ac10b"
|
|
106
100
|
}
|