@retroachievements/api 1.0.0-rc.0 → 1.0.0-rc.2
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/dist/__playground.d.ts +2 -1
- package/dist/achievement/getAchievementUnlocks.d.ts +2 -1
- package/dist/achievement/models/achievement-unlock-entity.model.d.ts +23 -0
- package/dist/achievement/models/get-achievement-unlocks-response.model.d.ts +23 -1
- package/dist/api.cjs.development.js +597 -853
- package/dist/api.cjs.development.js.map +1 -1
- package/dist/api.cjs.production.min.js +1 -1
- package/dist/api.cjs.production.min.js.map +1 -1
- package/dist/api.esm.js +597 -853
- package/dist/api.esm.js.map +1 -1
- package/dist/console/getGameList.d.ts +2 -1
- package/dist/console/models/game-list.model.d.ts +1 -1
- package/dist/console/models/get-console-ids-response.model.d.ts +1 -1
- package/dist/console/models/get-game-list-response.model.d.ts +1 -1
- package/dist/feed/getTicketData.d.ts +4 -3
- package/dist/feed/models/get-active-claims-response.model.d.ts +1 -1
- package/dist/feed/models/get-top-ten-users-response.model.d.ts +1 -1
- package/dist/feed/models/most-ticketed-games.model.d.ts +1 -2
- package/dist/feed/models/top-ten-users.model.d.ts +1 -1
- package/dist/game/getAchievementCount.d.ts +2 -1
- package/dist/game/getAchievementDistribution.d.ts +2 -1
- package/dist/game/getGame.d.ts +2 -1
- package/dist/game/getGameExtended.d.ts +2 -1
- package/dist/game/getGameRankAndScore.d.ts +2 -1
- package/dist/game/getGameRating.d.ts +2 -1
- package/dist/game/models/get-achievement-distribution-response.model.d.ts +1 -1
- package/dist/game/models/get-game-rank-and-score-response.model.d.ts +1 -1
- package/dist/user/getAchievementsEarnedBetween.d.ts +19 -19
- package/dist/user/getGameInfoAndUserProgress.d.ts +2 -1
- package/dist/user/getUserClaims.d.ts +1 -1
- package/dist/user/getUserCompletedGames.d.ts +1 -1
- package/dist/user/getUserGameRankAndScore.d.ts +2 -1
- package/dist/user/getUserPoints.d.ts +1 -1
- package/dist/user/getUserProgress.d.ts +5 -4
- package/dist/user/models/dated-user-achievement.model.d.ts +1 -1
- package/dist/user/models/dated-user-achievements-response.model.d.ts +1 -1
- package/dist/user/models/game-info-and-user-progress.model.d.ts +1 -1
- package/dist/user/models/get-game-info-and-user-progress-response.model.d.ts +2 -2
- package/dist/user/models/get-user-completed-games-response.model.d.ts +1 -1
- package/dist/user/models/get-user-game-rank-and-score-response.model.d.ts +1 -1
- package/dist/user/models/get-user-progress-response.model.d.ts +1 -1
- package/dist/user/models/get-user-recently-played-games-response.model.d.ts +2 -1
- package/dist/user/models/user-claims-response.model.d.ts +1 -1
- package/dist/user/models/user-claims.model.d.ts +1 -1
- package/dist/user/models/user-completed-games.model.d.ts +2 -3
- package/dist/user/models/user-game-rank-and-score.model.d.ts +2 -3
- package/dist/user/models/user-progress.model.d.ts +2 -3
- package/dist/user/models/user-recently-played-games.model.d.ts +3 -3
- package/dist/user/models/user-summary.model.d.ts +5 -6
- package/dist/utils/internal/id.model.d.ts +1 -0
- package/dist/utils/internal/index.d.ts +1 -0
- package/package.json +32 -27
- package/src/__playground.ts +25 -12
- package/src/achievement/getAchievementUnlocks.test.ts +48 -16
- package/src/achievement/getAchievementUnlocks.ts +4 -3
- package/src/achievement/models/achievement-unlock-entity.model.ts +19 -0
- package/src/achievement/models/get-achievement-unlocks-response.model.ts +17 -1
- package/src/console/getGameList.ts +2 -2
- package/src/feed/getTicketData.ts +4 -3
- package/src/feed/models/most-ticketed-games.model.ts +1 -1
- package/src/game/getAchievementCount.ts +2 -1
- package/src/game/getAchievementDistribution.test.ts +2 -4
- package/src/game/getAchievementDistribution.ts +2 -1
- package/src/game/getGame.ts +2 -1
- package/src/game/getGameExtended.ts +2 -1
- package/src/game/getGameRankAndScore.ts +2 -1
- package/src/game/getGameRating.ts +2 -1
- package/src/user/getAchievementsEarnedBetween.ts +19 -19
- package/src/user/getGameInfoAndUserProgress.ts +2 -1
- package/src/user/getUserClaims.ts +1 -1
- package/src/user/getUserCompletedGames.ts +1 -1
- package/src/user/getUserGameRankAndScore.ts +2 -1
- package/src/user/getUserPoints.ts +1 -1
- package/src/user/getUserProgress.ts +5 -4
- package/src/user/getUserRecentlyPlayedGames.test.ts +4 -2
- package/src/user/getUserRecentlyPlayedGames.ts +2 -1
- package/src/user/models/get-user-recently-played-games-response.model.ts +1 -0
- package/src/user/models/user-completed-games.model.ts +1 -1
- package/src/user/models/user-game-rank-and-score.model.ts +1 -1
- package/src/user/models/user-progress.model.ts +1 -1
- package/src/user/models/user-recently-played-games.model.ts +2 -1
- package/src/user/models/user-summary.model.ts +5 -5
- package/src/utils/internal/id.model.ts +1 -0
- package/src/utils/internal/index.ts +1 -0
- package/src/utils/internal/serializeProperties.ts +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { TopTenUsersEntity } from "./top-ten-users-entity.model";
|
|
2
|
-
export
|
|
2
|
+
export type TopTenUsers = TopTenUsersEntity[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ID } from "../utils/internal";
|
|
1
2
|
import type { AuthObject } from "../utils/public";
|
|
2
3
|
import type { AchievementCount } from "./models";
|
|
3
4
|
/**
|
|
@@ -27,5 +28,5 @@ import type { AchievementCount } from "./models";
|
|
|
27
28
|
* ```
|
|
28
29
|
*/
|
|
29
30
|
export declare const getAchievementCount: (authorization: AuthObject, payload: {
|
|
30
|
-
gameId:
|
|
31
|
+
gameId: ID;
|
|
31
32
|
}) => Promise<AchievementCount>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ID } from "../utils/internal";
|
|
1
2
|
import type { AuthObject } from "../utils/public";
|
|
2
3
|
import type { AchievementDistributionFlags, GetAchievementDistributionResponse } from "./models";
|
|
3
4
|
/**
|
|
@@ -51,7 +52,7 @@ import type { AchievementDistributionFlags, GetAchievementDistributionResponse }
|
|
|
51
52
|
* ```
|
|
52
53
|
*/
|
|
53
54
|
export declare const getAchievementDistribution: (authorization: AuthObject, payload: {
|
|
54
|
-
gameId:
|
|
55
|
+
gameId: ID;
|
|
55
56
|
flags?: AchievementDistributionFlags;
|
|
56
57
|
hardcore?: boolean;
|
|
57
58
|
}) => Promise<GetAchievementDistributionResponse>;
|
package/dist/game/getGame.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ID } from "../utils/internal";
|
|
1
2
|
import type { AuthObject } from "../utils/public";
|
|
2
3
|
import type { Game } from "./models";
|
|
3
4
|
/**
|
|
@@ -44,5 +45,5 @@ import type { Game } from "./models";
|
|
|
44
45
|
* ```
|
|
45
46
|
*/
|
|
46
47
|
export declare const getGame: (authorization: AuthObject, payload: {
|
|
47
|
-
gameId:
|
|
48
|
+
gameId: ID;
|
|
48
49
|
}) => Promise<Game>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ID } from "../utils/internal";
|
|
1
2
|
import type { AuthObject } from "../utils/public";
|
|
2
3
|
import type { GameExtended } from "./models";
|
|
3
4
|
/**
|
|
@@ -64,5 +65,5 @@ import type { GameExtended } from "./models";
|
|
|
64
65
|
* ```
|
|
65
66
|
*/
|
|
66
67
|
export declare const getGameExtended: (authorization: AuthObject, payload: {
|
|
67
|
-
gameId:
|
|
68
|
+
gameId: ID;
|
|
68
69
|
}) => Promise<GameExtended>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ID } from "../utils/internal";
|
|
1
2
|
import type { AuthObject } from "../utils/public";
|
|
2
3
|
import type { GameRankAndScoreEntity } from "./models";
|
|
3
4
|
/**
|
|
@@ -33,6 +34,6 @@ import type { GameRankAndScoreEntity } from "./models";
|
|
|
33
34
|
* ```
|
|
34
35
|
*/
|
|
35
36
|
export declare const getGameRankAndScore: (authorization: AuthObject, payload: {
|
|
36
|
-
gameId:
|
|
37
|
+
gameId: ID;
|
|
37
38
|
type: "latest-masters" | "high-scores";
|
|
38
39
|
}) => Promise<GameRankAndScoreEntity[]>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ID } from "../utils/internal";
|
|
1
2
|
import type { AuthObject } from "../utils/public";
|
|
2
3
|
import type { GameRating } from "./models";
|
|
3
4
|
/**
|
|
@@ -34,5 +35,5 @@ import type { GameRating } from "./models";
|
|
|
34
35
|
* ```
|
|
35
36
|
*/
|
|
36
37
|
export declare const getGameRating: (authorization: AuthObject, payload: {
|
|
37
|
-
gameId:
|
|
38
|
+
gameId: ID;
|
|
38
39
|
}) => Promise<GameRating>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type GetAchievementDistributionResponse = Record<`${number}`, number>;
|
|
@@ -31,25 +31,25 @@ import type { DatedUserAchievement } from "./models";
|
|
|
31
31
|
* @returns An array containing metadata about the user
|
|
32
32
|
* achievements earned during the specified date range.
|
|
33
33
|
* ```
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
34
|
+
* [
|
|
35
|
+
* {
|
|
36
|
+
* date: '2022-10-12 07:58:05',
|
|
37
|
+
* hardcoreMode: true,
|
|
38
|
+
* achievementId: 173315,
|
|
39
|
+
* title: 'Your Puny Human Weapons',
|
|
40
|
+
* description: 'Collect all objects in the Weapons Category.',
|
|
41
|
+
* badgeName: '193756',
|
|
42
|
+
* points: 10,
|
|
43
|
+
* author: 'blendedsea',
|
|
44
|
+
* gameTitle: 'Me & My Katamari',
|
|
45
|
+
* gameIcon: '/Images/047357.png',
|
|
46
|
+
* gameId: 3571,
|
|
47
|
+
* consoleName: 'PlayStation Portable',
|
|
48
|
+
* cumulScore: 120,
|
|
49
|
+
* badgeUrl: '/Badge/193756.png',
|
|
50
|
+
* gameUrl: '/game/3571'
|
|
51
|
+
* }
|
|
52
|
+
* ]
|
|
53
53
|
* ```
|
|
54
54
|
*/
|
|
55
55
|
export declare const getAchievementsEarnedBetween: (authorization: AuthObject, payload: {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ID } from "../utils/internal";
|
|
1
2
|
import type { AuthObject } from "../utils/public";
|
|
2
3
|
import type { GameInfoAndUserProgress } from "./models";
|
|
3
4
|
/**
|
|
@@ -75,6 +76,6 @@ import type { GameInfoAndUserProgress } from "./models";
|
|
|
75
76
|
* ```
|
|
76
77
|
*/
|
|
77
78
|
export declare const getGameInfoAndUserProgress: (authorization: AuthObject, payload: {
|
|
78
|
-
gameId:
|
|
79
|
+
gameId: ID;
|
|
79
80
|
userName: string;
|
|
80
81
|
}) => Promise<GameInfoAndUserProgress>;
|
|
@@ -5,7 +5,7 @@ import type { UserCompletedGames } from "./models";
|
|
|
5
5
|
* about the games a given user has played. It returns two
|
|
6
6
|
* entries per each game: one for the softcore completion and
|
|
7
7
|
* one for the hardcore completion. These are designated by
|
|
8
|
-
* the `hardcoreMode` property on
|
|
8
|
+
* the `hardcoreMode` property on each completion object.
|
|
9
9
|
*
|
|
10
10
|
* @param authorization An object containing your userName and webApiKey.
|
|
11
11
|
* This can be constructed with `buildAuthorization()`.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ID } from "../utils/internal";
|
|
1
2
|
import type { AuthObject } from "../utils/public";
|
|
2
3
|
import type { UserGameRankAndScore } from "./models";
|
|
3
4
|
/**
|
|
@@ -39,6 +40,6 @@ import type { UserGameRankAndScore } from "./models";
|
|
|
39
40
|
* ```
|
|
40
41
|
*/
|
|
41
42
|
export declare const getUserGameRankAndScore: (authorization: AuthObject, payload: {
|
|
42
|
-
gameId:
|
|
43
|
+
gameId: ID;
|
|
43
44
|
userName: string;
|
|
44
45
|
}) => Promise<UserGameRankAndScore>;
|
|
@@ -7,7 +7,7 @@ import type { UserPoints } from "./models";
|
|
|
7
7
|
* @param authorization An object containing your userName and webApiKey.
|
|
8
8
|
* This can be constructed with `buildAuthorization()`.
|
|
9
9
|
*
|
|
10
|
-
* @param payload.userName The user for which to retrieve the
|
|
10
|
+
* @param payload.userName The user for which to retrieve the point totals for.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import type { ID } from "../utils/internal";
|
|
1
2
|
import type { AuthObject } from "../utils/public";
|
|
2
3
|
import type { UserProgress } from "./models";
|
|
3
4
|
/**
|
|
4
5
|
* A call to this function will retrieve a given user's
|
|
5
|
-
* progress on a given
|
|
6
|
+
* progress on a given list of games, targeted by game ID.
|
|
6
7
|
*
|
|
7
8
|
* @param authorization An object containing your userName and webApiKey.
|
|
8
9
|
* This can be constructed with `buildAuthorization()`.
|
|
9
10
|
*
|
|
10
11
|
* @param payload.userName The user for which to retrieve the progress for.
|
|
11
12
|
*
|
|
12
|
-
* @param payload.gameIds An array of RetroAchievements
|
|
13
|
+
* @param payload.gameIds An array of RetroAchievements game IDs. If you aren't
|
|
13
14
|
* sure of the game ID, visit the game's page on the website and copy the number
|
|
14
15
|
* at the end of the URL.
|
|
15
16
|
*
|
|
@@ -17,7 +18,7 @@ import type { UserProgress } from "./models";
|
|
|
17
18
|
* ```
|
|
18
19
|
* const userProgress = await getUserProgress(
|
|
19
20
|
* authorization,
|
|
20
|
-
* { userName: "xelnia", gameIds: [
|
|
21
|
+
* { userName: "xelnia", gameIds: [1, 14402] }
|
|
21
22
|
* );
|
|
22
23
|
* ```
|
|
23
24
|
*
|
|
@@ -45,5 +46,5 @@ import type { UserProgress } from "./models";
|
|
|
45
46
|
*/
|
|
46
47
|
export declare const getUserProgress: (authorization: AuthObject, payload: {
|
|
47
48
|
userName: string;
|
|
48
|
-
gameIds:
|
|
49
|
+
gameIds: ID[];
|
|
49
50
|
}) => Promise<UserProgress>;
|
|
@@ -15,5 +15,5 @@ interface DatedUserAchievementResponseEntity {
|
|
|
15
15
|
BadgeURL: string;
|
|
16
16
|
GameURL: string;
|
|
17
17
|
}
|
|
18
|
-
export
|
|
18
|
+
export type DatedUserAchievementsResponse = DatedUserAchievementResponseEntity[];
|
|
19
19
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GameExtended, GameExtendedAchievementEntity } from "../../game/models";
|
|
2
|
-
export
|
|
2
|
+
export type GameExtendedAchievementEntityWithUserProgress = GameExtendedAchievementEntity & {
|
|
3
3
|
dateEarned: string;
|
|
4
4
|
dateEarnedHardcore: string;
|
|
5
5
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GameExtendedRawAchievementEntity, GetGameExtendedResponse } from "../../game/models";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type GetGameExtendedResponseWithoutClaims = Omit<GetGameExtendedResponse, "Claims">;
|
|
3
|
+
type GameExtendedRawAchievementEntityWithUserProgress = GameExtendedRawAchievementEntity & {
|
|
4
4
|
DateEarned: string;
|
|
5
5
|
DateEarnedHardcore: string;
|
|
6
6
|
};
|
|
@@ -9,5 +9,5 @@ interface UserCompletedGamesResponseEntity {
|
|
|
9
9
|
PctWon: string;
|
|
10
10
|
HardcoreMode: "0" | "1";
|
|
11
11
|
}
|
|
12
|
-
export
|
|
12
|
+
export type GetUserCompletedGamesResponse = UserCompletedGamesResponseEntity[];
|
|
13
13
|
export {};
|
|
@@ -4,5 +4,5 @@ interface UserGameRankAndScoreResponseEntity {
|
|
|
4
4
|
LastAward: string;
|
|
5
5
|
UserRank: string;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
7
|
+
export type GetUserGameRankAndScoreResponse = UserGameRankAndScoreResponseEntity[];
|
|
8
8
|
export {};
|
|
@@ -6,5 +6,5 @@ interface UserProgressResponseEntity {
|
|
|
6
6
|
NumAchievedHardcore: number | string;
|
|
7
7
|
ScoreAchievedHardcore: number | string;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export type GetUserProgressResponse = Record<`${number}`, UserProgressResponseEntity>;
|
|
10
10
|
export {};
|
|
@@ -5,6 +5,7 @@ interface UserRecentlyPlayedGameResponseEntity {
|
|
|
5
5
|
Title: string;
|
|
6
6
|
ImageIcon: string;
|
|
7
7
|
LastPlayed: string;
|
|
8
|
+
MyVote: "1" | "2" | "3" | "4" | "5" | null;
|
|
8
9
|
NumPossibleAchievements: string;
|
|
9
10
|
PossibleScore: string;
|
|
10
11
|
NumAchieved: string | number;
|
|
@@ -12,5 +13,5 @@ interface UserRecentlyPlayedGameResponseEntity {
|
|
|
12
13
|
NumAchievedHardcore: string | number;
|
|
13
14
|
ScoreAchievedHardcore: string | number;
|
|
14
15
|
}
|
|
15
|
-
export
|
|
16
|
+
export type GetUserRecentlyPlayedGamesResponse = UserRecentlyPlayedGameResponseEntity[];
|
|
16
17
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
interface UserCompletedGame {
|
|
1
|
+
export interface UserCompletedGame {
|
|
2
2
|
gameId: number;
|
|
3
3
|
title: string;
|
|
4
4
|
imageIcon: string;
|
|
@@ -9,5 +9,4 @@ interface UserCompletedGame {
|
|
|
9
9
|
pctWon: number;
|
|
10
10
|
hardcoreMode: boolean;
|
|
11
11
|
}
|
|
12
|
-
export
|
|
13
|
-
export {};
|
|
12
|
+
export type UserCompletedGames = UserCompletedGame[];
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
interface UserGameRankAndScoreEntity {
|
|
1
|
+
export interface UserGameRankAndScoreEntity {
|
|
2
2
|
user: string;
|
|
3
3
|
totalScore: number;
|
|
4
4
|
lastAward: string;
|
|
5
5
|
userRank: number;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
8
|
-
export {};
|
|
7
|
+
export type UserGameRankAndScore = UserGameRankAndScoreEntity[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
interface UserProgressEntity {
|
|
1
|
+
export interface UserProgressEntity {
|
|
2
2
|
numPossibleAchievements: number;
|
|
3
3
|
possibleScore: number;
|
|
4
4
|
numAchieved: number;
|
|
@@ -6,5 +6,4 @@ interface UserProgressEntity {
|
|
|
6
6
|
numAchievedHardcore: number;
|
|
7
7
|
scoreAchievedHardcore: number;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
10
|
-
export {};
|
|
9
|
+
export type UserProgress = Record<`${number}`, UserProgressEntity>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
interface UserRecentlyPlayedGameEntity {
|
|
1
|
+
export interface UserRecentlyPlayedGameEntity {
|
|
2
2
|
gameId: number;
|
|
3
3
|
consoleId: number;
|
|
4
4
|
consoleName: string;
|
|
5
5
|
title: string;
|
|
6
6
|
imageIcon: string;
|
|
7
7
|
lastPlayed: string;
|
|
8
|
+
myVote: 1 | 2 | 3 | 4 | 5 | null;
|
|
8
9
|
numPossibleAchievements: number;
|
|
9
10
|
possibleScore: number;
|
|
10
11
|
numAchieved: number;
|
|
@@ -12,5 +13,4 @@ interface UserRecentlyPlayedGameEntity {
|
|
|
12
13
|
numAchievedHardcore: number;
|
|
13
14
|
scoreAchievedHardcore: number;
|
|
14
15
|
}
|
|
15
|
-
export
|
|
16
|
-
export {};
|
|
16
|
+
export type UserRecentlyPlayedGames = UserRecentlyPlayedGameEntity[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
interface RecentlyPlayedGameEntity {
|
|
1
|
+
export interface RecentlyPlayedGameEntity {
|
|
2
2
|
gameId: number;
|
|
3
3
|
consoleId: number;
|
|
4
4
|
consoleName: string;
|
|
@@ -6,7 +6,7 @@ interface RecentlyPlayedGameEntity {
|
|
|
6
6
|
imageIcon: string;
|
|
7
7
|
lastPlayed: string;
|
|
8
8
|
}
|
|
9
|
-
interface LastActivityEntity {
|
|
9
|
+
export interface LastActivityEntity {
|
|
10
10
|
id: number;
|
|
11
11
|
timestamp: string;
|
|
12
12
|
lastupdate: string;
|
|
@@ -15,7 +15,7 @@ interface LastActivityEntity {
|
|
|
15
15
|
data: string;
|
|
16
16
|
data2: string;
|
|
17
17
|
}
|
|
18
|
-
interface LastGameEntity {
|
|
18
|
+
export interface LastGameEntity {
|
|
19
19
|
id: number;
|
|
20
20
|
title: string;
|
|
21
21
|
consoleId: number;
|
|
@@ -33,7 +33,7 @@ interface LastGameEntity {
|
|
|
33
33
|
consoleName: string;
|
|
34
34
|
richPresencePatch: string;
|
|
35
35
|
}
|
|
36
|
-
interface AwardedGameEntity {
|
|
36
|
+
export interface AwardedGameEntity {
|
|
37
37
|
numPossibleAchievements: number;
|
|
38
38
|
possibleScore: number;
|
|
39
39
|
numAchieved: number;
|
|
@@ -41,7 +41,7 @@ interface AwardedGameEntity {
|
|
|
41
41
|
numAchievedHardcore: number;
|
|
42
42
|
scoreAchievedHardcore: number;
|
|
43
43
|
}
|
|
44
|
-
interface ExtendedRecentAchievementEntity {
|
|
44
|
+
export interface ExtendedRecentAchievementEntity {
|
|
45
45
|
id: number;
|
|
46
46
|
gameId: number;
|
|
47
47
|
gameTitle: string;
|
|
@@ -80,4 +80,3 @@ export interface UserSummary {
|
|
|
80
80
|
totalRanked: number;
|
|
81
81
|
status: string;
|
|
82
82
|
}
|
|
83
|
-
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ID = string | number;
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"raweb",
|
|
9
9
|
"retro gaming"
|
|
10
10
|
],
|
|
11
|
-
"version": "1.0.0-rc.
|
|
11
|
+
"version": "1.0.0-rc.2",
|
|
12
12
|
"main": "dist/index.js",
|
|
13
13
|
"module": "dist/api.esm.js",
|
|
14
14
|
"typings": "dist/index.d.ts",
|
|
@@ -36,42 +36,47 @@
|
|
|
36
36
|
"test:coverage": "jest --selectProjects UNIT --coverage",
|
|
37
37
|
"verify": "yarn format:check && yarn lint && yarn test:coverage && yarn build && yarn size",
|
|
38
38
|
"size": "size-limit",
|
|
39
|
-
"start": "dts watch"
|
|
39
|
+
"start": "dts watch",
|
|
40
|
+
"docs:dev": "vitepress dev docs",
|
|
41
|
+
"docs:build": "vitepress build docs",
|
|
42
|
+
"docs:preview": "vitepress preview docs"
|
|
40
43
|
},
|
|
41
44
|
"dependencies": {
|
|
42
45
|
"isomorphic-unfetch": "^3.1.0"
|
|
43
46
|
},
|
|
44
47
|
"peerDependencies": {},
|
|
45
48
|
"devDependencies": {
|
|
46
|
-
"@commitlint/cli": "^17.
|
|
47
|
-
"@commitlint/config-conventional": "^17.
|
|
48
|
-
"@digitak/esrun": "^3.2.
|
|
49
|
-
"@size-limit/preset-small-lib": "^8.1.
|
|
50
|
-
"@swc/core": "^1.3.
|
|
51
|
-
"@swc/jest": "^0.2.
|
|
52
|
-
"@tsconfig/recommended": "^1.0.
|
|
53
|
-
"@types/jest": "^29.
|
|
54
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
55
|
-
"@typescript-eslint/parser": "^5.
|
|
49
|
+
"@commitlint/cli": "^17.4.2",
|
|
50
|
+
"@commitlint/config-conventional": "^17.4.2",
|
|
51
|
+
"@digitak/esrun": "^3.2.19",
|
|
52
|
+
"@size-limit/preset-small-lib": "^8.1.2",
|
|
53
|
+
"@swc/core": "^1.3.30",
|
|
54
|
+
"@swc/jest": "^0.2.24",
|
|
55
|
+
"@tsconfig/recommended": "^1.0.2",
|
|
56
|
+
"@types/jest": "^29.4.0",
|
|
57
|
+
"@typescript-eslint/eslint-plugin": "^5.49.0",
|
|
58
|
+
"@typescript-eslint/parser": "^5.49.0",
|
|
56
59
|
"cz-conventional-changelog": "^3.3.0",
|
|
57
60
|
"dotenv-flow-cli": "^1.0.0",
|
|
58
|
-
"dts-cli": "^1.6.
|
|
59
|
-
"eslint": "^8.
|
|
60
|
-
"eslint-config-prettier": "^8.
|
|
61
|
-
"eslint-import-resolver-typescript": "^3.5.
|
|
62
|
-
"eslint-plugin-import": "^2.
|
|
63
|
-
"eslint-plugin-simple-import-sort": "^
|
|
64
|
-
"eslint-plugin-sonarjs": "^0.
|
|
65
|
-
"eslint-plugin-unicorn": "^
|
|
61
|
+
"dts-cli": "^1.6.3",
|
|
62
|
+
"eslint": "^8.33.0",
|
|
63
|
+
"eslint-config-prettier": "^8.6.0",
|
|
64
|
+
"eslint-import-resolver-typescript": "^3.5.3",
|
|
65
|
+
"eslint-plugin-import": "^2.27.5",
|
|
66
|
+
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
67
|
+
"eslint-plugin-sonarjs": "^0.18.0",
|
|
68
|
+
"eslint-plugin-unicorn": "^45.0.2",
|
|
66
69
|
"husky": "^4.3.8",
|
|
67
|
-
"jest": "^29.
|
|
68
|
-
"msw": "^0.
|
|
69
|
-
"prettier": "2.
|
|
70
|
+
"jest": "^29.4.1",
|
|
71
|
+
"msw": "^1.0.0",
|
|
72
|
+
"prettier": "2.8.3",
|
|
70
73
|
"pretty-quick": "3.1.3",
|
|
71
|
-
"size-limit": "^8.1.
|
|
72
|
-
"tslib": "^2.
|
|
73
|
-
"type-fest": "^3.
|
|
74
|
-
"typescript": "^4.
|
|
74
|
+
"size-limit": "^8.1.2",
|
|
75
|
+
"tslib": "^2.5.0",
|
|
76
|
+
"type-fest": "^3.5.3",
|
|
77
|
+
"typescript": "^4.9.4",
|
|
78
|
+
"vitepress": "^1.0.0-alpha.43",
|
|
79
|
+
"vue": "^3.2.45"
|
|
75
80
|
},
|
|
76
81
|
"size-limit": [
|
|
77
82
|
{
|
package/src/__playground.ts
CHANGED
|
@@ -3,27 +3,40 @@
|
|
|
3
3
|
* TO DIRECTLY IMPACT EVERY DEV WORKING ON THE PROJECT.
|
|
4
4
|
*
|
|
5
5
|
* Use this file to test and experiment with changes to the project.
|
|
6
|
+
* If changes to this file land in a PR, you probably did something wrong.
|
|
6
7
|
*/
|
|
7
8
|
|
|
8
|
-
//
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
// ---
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* "./index" is the library's single public-facing export.
|
|
13
|
+
* In other words, if you're not able to import what you want
|
|
14
|
+
* to use from "./index", no one who uses the package will be
|
|
15
|
+
* able to either.
|
|
16
|
+
*/
|
|
17
|
+
import { buildAuthorization, getAchievementCount } from "./index";
|
|
18
|
+
|
|
19
|
+
// MODIFY THESE VALUES.
|
|
20
|
+
const userName = "myUserName";
|
|
21
|
+
const webApiKey = "myWebApiKey";
|
|
11
22
|
|
|
12
23
|
const main = async () => {
|
|
13
|
-
console.log("retroachievements
|
|
14
|
-
console.log(""); // newline
|
|
24
|
+
console.log("🚀 @retroachievements/api playground is running.\n");
|
|
15
25
|
|
|
16
26
|
// -- Start testing stuff here --
|
|
17
27
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
28
|
+
if (userName === "myUserName" || webApiKey === "myWebApiKey") {
|
|
29
|
+
console.error(
|
|
30
|
+
"⛔️ ERROR: In __playground.ts, modify the userName and webApiKey variables to match your RA credentials.\n"
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const authorization = buildAuthorization({ userName, webApiKey });
|
|
23
35
|
|
|
24
|
-
const achievementCount = await getAchievementCount(authorization,
|
|
36
|
+
const achievementCount = await getAchievementCount(authorization, {
|
|
37
|
+
gameId: 14_402
|
|
38
|
+
});
|
|
25
39
|
console.log(achievementCount);
|
|
26
|
-
*/
|
|
27
40
|
};
|
|
28
41
|
|
|
29
42
|
main();
|