@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.
Files changed (85) hide show
  1. package/dist/__playground.d.ts +2 -1
  2. package/dist/achievement/getAchievementUnlocks.d.ts +2 -1
  3. package/dist/achievement/models/achievement-unlock-entity.model.d.ts +23 -0
  4. package/dist/achievement/models/get-achievement-unlocks-response.model.d.ts +23 -1
  5. package/dist/api.cjs.development.js +597 -853
  6. package/dist/api.cjs.development.js.map +1 -1
  7. package/dist/api.cjs.production.min.js +1 -1
  8. package/dist/api.cjs.production.min.js.map +1 -1
  9. package/dist/api.esm.js +597 -853
  10. package/dist/api.esm.js.map +1 -1
  11. package/dist/console/getGameList.d.ts +2 -1
  12. package/dist/console/models/game-list.model.d.ts +1 -1
  13. package/dist/console/models/get-console-ids-response.model.d.ts +1 -1
  14. package/dist/console/models/get-game-list-response.model.d.ts +1 -1
  15. package/dist/feed/getTicketData.d.ts +4 -3
  16. package/dist/feed/models/get-active-claims-response.model.d.ts +1 -1
  17. package/dist/feed/models/get-top-ten-users-response.model.d.ts +1 -1
  18. package/dist/feed/models/most-ticketed-games.model.d.ts +1 -2
  19. package/dist/feed/models/top-ten-users.model.d.ts +1 -1
  20. package/dist/game/getAchievementCount.d.ts +2 -1
  21. package/dist/game/getAchievementDistribution.d.ts +2 -1
  22. package/dist/game/getGame.d.ts +2 -1
  23. package/dist/game/getGameExtended.d.ts +2 -1
  24. package/dist/game/getGameRankAndScore.d.ts +2 -1
  25. package/dist/game/getGameRating.d.ts +2 -1
  26. package/dist/game/models/get-achievement-distribution-response.model.d.ts +1 -1
  27. package/dist/game/models/get-game-rank-and-score-response.model.d.ts +1 -1
  28. package/dist/user/getAchievementsEarnedBetween.d.ts +19 -19
  29. package/dist/user/getGameInfoAndUserProgress.d.ts +2 -1
  30. package/dist/user/getUserClaims.d.ts +1 -1
  31. package/dist/user/getUserCompletedGames.d.ts +1 -1
  32. package/dist/user/getUserGameRankAndScore.d.ts +2 -1
  33. package/dist/user/getUserPoints.d.ts +1 -1
  34. package/dist/user/getUserProgress.d.ts +5 -4
  35. package/dist/user/models/dated-user-achievement.model.d.ts +1 -1
  36. package/dist/user/models/dated-user-achievements-response.model.d.ts +1 -1
  37. package/dist/user/models/game-info-and-user-progress.model.d.ts +1 -1
  38. package/dist/user/models/get-game-info-and-user-progress-response.model.d.ts +2 -2
  39. package/dist/user/models/get-user-completed-games-response.model.d.ts +1 -1
  40. package/dist/user/models/get-user-game-rank-and-score-response.model.d.ts +1 -1
  41. package/dist/user/models/get-user-progress-response.model.d.ts +1 -1
  42. package/dist/user/models/get-user-recently-played-games-response.model.d.ts +2 -1
  43. package/dist/user/models/user-claims-response.model.d.ts +1 -1
  44. package/dist/user/models/user-claims.model.d.ts +1 -1
  45. package/dist/user/models/user-completed-games.model.d.ts +2 -3
  46. package/dist/user/models/user-game-rank-and-score.model.d.ts +2 -3
  47. package/dist/user/models/user-progress.model.d.ts +2 -3
  48. package/dist/user/models/user-recently-played-games.model.d.ts +3 -3
  49. package/dist/user/models/user-summary.model.d.ts +5 -6
  50. package/dist/utils/internal/id.model.d.ts +1 -0
  51. package/dist/utils/internal/index.d.ts +1 -0
  52. package/package.json +32 -27
  53. package/src/__playground.ts +25 -12
  54. package/src/achievement/getAchievementUnlocks.test.ts +48 -16
  55. package/src/achievement/getAchievementUnlocks.ts +4 -3
  56. package/src/achievement/models/achievement-unlock-entity.model.ts +19 -0
  57. package/src/achievement/models/get-achievement-unlocks-response.model.ts +17 -1
  58. package/src/console/getGameList.ts +2 -2
  59. package/src/feed/getTicketData.ts +4 -3
  60. package/src/feed/models/most-ticketed-games.model.ts +1 -1
  61. package/src/game/getAchievementCount.ts +2 -1
  62. package/src/game/getAchievementDistribution.test.ts +2 -4
  63. package/src/game/getAchievementDistribution.ts +2 -1
  64. package/src/game/getGame.ts +2 -1
  65. package/src/game/getGameExtended.ts +2 -1
  66. package/src/game/getGameRankAndScore.ts +2 -1
  67. package/src/game/getGameRating.ts +2 -1
  68. package/src/user/getAchievementsEarnedBetween.ts +19 -19
  69. package/src/user/getGameInfoAndUserProgress.ts +2 -1
  70. package/src/user/getUserClaims.ts +1 -1
  71. package/src/user/getUserCompletedGames.ts +1 -1
  72. package/src/user/getUserGameRankAndScore.ts +2 -1
  73. package/src/user/getUserPoints.ts +1 -1
  74. package/src/user/getUserProgress.ts +5 -4
  75. package/src/user/getUserRecentlyPlayedGames.test.ts +4 -2
  76. package/src/user/getUserRecentlyPlayedGames.ts +2 -1
  77. package/src/user/models/get-user-recently-played-games-response.model.ts +1 -0
  78. package/src/user/models/user-completed-games.model.ts +1 -1
  79. package/src/user/models/user-game-rank-and-score.model.ts +1 -1
  80. package/src/user/models/user-progress.model.ts +1 -1
  81. package/src/user/models/user-recently-played-games.model.ts +2 -1
  82. package/src/user/models/user-summary.model.ts +5 -5
  83. package/src/utils/internal/id.model.ts +1 -0
  84. package/src/utils/internal/index.ts +1 -0
  85. package/src/utils/internal/serializeProperties.ts +1 -1
@@ -6,5 +6,5 @@ interface TopTenUsersResponseEntity {
6
6
  /** Total ratio (white) points earned by the user */
7
7
  "3": string;
8
8
  }
9
- export declare type GetTopTenUsersResponse = TopTenUsersResponseEntity[];
9
+ export type GetTopTenUsersResponse = TopTenUsersResponseEntity[];
10
10
  export {};
@@ -1,4 +1,4 @@
1
- interface ReportedGameEntity {
1
+ export interface ReportedGameEntity {
2
2
  gameId: number;
3
3
  gameTitle: string;
4
4
  gameIcon: string;
@@ -9,4 +9,3 @@ export interface MostTicketedGames {
9
9
  mostReportedGames: ReportedGameEntity[];
10
10
  url: string;
11
11
  }
12
- export {};
@@ -1,2 +1,2 @@
1
1
  import type { TopTenUsersEntity } from "./top-ten-users-entity.model";
2
- export declare type TopTenUsers = TopTenUsersEntity[];
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: number;
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: number;
55
+ gameId: ID;
55
56
  flags?: AchievementDistributionFlags;
56
57
  hardcore?: boolean;
57
58
  }) => Promise<GetAchievementDistributionResponse>;
@@ -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: number;
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: number;
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: number;
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: number;
38
+ gameId: ID;
38
39
  }) => Promise<GameRating>;
@@ -1 +1 @@
1
- export declare type GetAchievementDistributionResponse = Record<`${number}`, number>;
1
+ export type GetAchievementDistributionResponse = Record<`${number}`, number>;
@@ -4,5 +4,5 @@ interface RawGameRankAndScoreEntity {
4
4
  LastAward: string;
5
5
  Rank: number;
6
6
  }
7
- export declare type GetGameRankAndScoreResponse = RawGameRankAndScoreEntity[];
7
+ export type GetGameRankAndScoreResponse = RawGameRankAndScoreEntity[];
8
8
  export {};
@@ -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
- * 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
- * ]
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: number;
79
+ gameId: ID;
79
80
  userName: string;
80
81
  }) => Promise<GameInfoAndUserProgress>;
@@ -15,7 +15,7 @@ import type { UserClaims } from "./models";
15
15
  * ```
16
16
  * const userClaims = await getUserClaims(
17
17
  * authorization,
18
- * { userName: "xelnia" }
18
+ * { userName: "Jamiras" }
19
19
  * );
20
20
  * ```
21
21
  *
@@ -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 the completion object.
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: number;
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 points for.
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 set of games, targeted by game ID.
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 Game IDs. If you aren't
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: [14402, 1] }
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: Array<number | string>;
49
+ gameIds: ID[];
49
50
  }) => Promise<UserProgress>;
@@ -1,4 +1,4 @@
1
- export declare type DatedUserAchievement = {
1
+ export type DatedUserAchievement = {
2
2
  date: string;
3
3
  hardcoreMode: boolean;
4
4
  achievementId: number;
@@ -15,5 +15,5 @@ interface DatedUserAchievementResponseEntity {
15
15
  BadgeURL: string;
16
16
  GameURL: string;
17
17
  }
18
- export declare type DatedUserAchievementsResponse = DatedUserAchievementResponseEntity[];
18
+ export type DatedUserAchievementsResponse = DatedUserAchievementResponseEntity[];
19
19
  export {};
@@ -1,5 +1,5 @@
1
1
  import type { GameExtended, GameExtendedAchievementEntity } from "../../game/models";
2
- export declare type GameExtendedAchievementEntityWithUserProgress = GameExtendedAchievementEntity & {
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
- declare type GetGameExtendedResponseWithoutClaims = Omit<GetGameExtendedResponse, "Claims">;
3
- declare type GameExtendedRawAchievementEntityWithUserProgress = GameExtendedRawAchievementEntity & {
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 declare type GetUserCompletedGamesResponse = UserCompletedGamesResponseEntity[];
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 declare type GetUserGameRankAndScoreResponse = UserGameRankAndScoreResponseEntity[];
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 declare type GetUserProgressResponse = Record<`${number}`, UserProgressResponseEntity>;
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 declare type GetUserRecentlyPlayedGamesResponse = UserRecentlyPlayedGameResponseEntity[];
16
+ export type GetUserRecentlyPlayedGamesResponse = UserRecentlyPlayedGameResponseEntity[];
16
17
  export {};
@@ -15,5 +15,5 @@ interface UserClaimsResponseEntity {
15
15
  Updated: string;
16
16
  MinutesLeft: string;
17
17
  }
18
- export declare type GetUserClaimsResponse = UserClaimsResponseEntity[];
18
+ export type GetUserClaimsResponse = UserClaimsResponseEntity[];
19
19
  export {};
@@ -15,5 +15,5 @@ interface UserClaim {
15
15
  updated: string;
16
16
  minutesLeft: number;
17
17
  }
18
- export declare type UserClaims = UserClaim[];
18
+ export type UserClaims = UserClaim[];
19
19
  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 declare type UserCompletedGames = UserCompletedGame[];
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 declare type UserGameRankAndScore = UserGameRankAndScoreEntity[];
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 declare type UserProgress = Record<`${number}`, UserProgressEntity>;
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 declare type UserRecentlyPlayedGames = UserRecentlyPlayedGameEntity[];
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;
@@ -1,4 +1,5 @@
1
1
  export * from "./apiBaseUrl";
2
2
  export * from "./buildRequestUrl";
3
3
  export * from "./call";
4
+ export * from "./id.model";
4
5
  export * from "./serializeProperties";
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "raweb",
9
9
  "retro gaming"
10
10
  ],
11
- "version": "1.0.0-rc.0",
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.1.2",
47
- "@commitlint/config-conventional": "^17.1.0",
48
- "@digitak/esrun": "^3.2.13",
49
- "@size-limit/preset-small-lib": "^8.1.0",
50
- "@swc/core": "^1.3.10",
51
- "@swc/jest": "^0.2.23",
52
- "@tsconfig/recommended": "^1.0.1",
53
- "@types/jest": "^29.2.0",
54
- "@typescript-eslint/eslint-plugin": "^5.41.0",
55
- "@typescript-eslint/parser": "^5.41.0",
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.0",
59
- "eslint": "^8.26.0",
60
- "eslint-config-prettier": "^8.5.0",
61
- "eslint-import-resolver-typescript": "^3.5.2",
62
- "eslint-plugin-import": "^2.26.0",
63
- "eslint-plugin-simple-import-sort": "^8.0.0",
64
- "eslint-plugin-sonarjs": "^0.16.0",
65
- "eslint-plugin-unicorn": "^44.0.2",
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.2.1",
68
- "msw": "^0.47.4",
69
- "prettier": "2.7.1",
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.0",
72
- "tslib": "^2.4.0",
73
- "type-fest": "^3.1.0",
74
- "typescript": "^4.8.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
  {
@@ -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
- // If you can't import what you want from "./index", users won't
9
- // be able to import it either.
10
- // import { buildAuthorization, getAchievementCount } from "./index";
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-api-js playground is running.");
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
- const authorization = buildAuthorization({
20
- userName: 'myUserName',
21
- webApiKey: 'myWebApiKey'
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, 14_402);
36
+ const achievementCount = await getAchievementCount(authorization, {
37
+ gameId: 14_402
38
+ });
25
39
  console.log(achievementCount);
26
- */
27
40
  };
28
41
 
29
42
  main();