@retroachievements/api 1.5.1 → 1.5.3

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 (93) hide show
  1. package/dist/achievement/models/achievement-type.model.d.ts +1 -0
  2. package/dist/achievement/models/index.d.ts +1 -0
  3. package/dist/api.cjs.map +1 -1
  4. package/dist/api.modern.js.map +1 -1
  5. package/dist/api.module.js.map +1 -1
  6. package/dist/api.umd.js.map +1 -1
  7. package/dist/console/getConsoleIds.d.ts +6 -2
  8. package/dist/console/models/console-id.model.d.ts +1 -0
  9. package/dist/console/models/get-console-ids-response.model.d.ts +1 -0
  10. package/dist/game/getGameExtended.d.ts +1 -1
  11. package/dist/game/models/game-extended-achievement-entity.model.d.ts +2 -0
  12. package/dist/user/models/achievement-type.model.d.ts +1 -0
  13. package/dist/user/models/dated-user-achievement.model.d.ts +2 -1
  14. package/dist/user/models/dated-user-achievements-response.model.d.ts +2 -1
  15. package/package.json +2 -4
  16. package/src/__playground.ts +1 -1
  17. package/src/achievement/getAchievementUnlocks.test.ts +10 -10
  18. package/src/achievement/getAchievementUnlocks.ts +3 -3
  19. package/src/achievement/models/achievement-type.model.ts +5 -0
  20. package/src/achievement/models/index.ts +1 -0
  21. package/src/console/getConsoleIds.test.ts +42 -10
  22. package/src/console/getConsoleIds.ts +8 -4
  23. package/src/console/getGameList.test.ts +8 -8
  24. package/src/console/getGameList.ts +4 -4
  25. package/src/console/models/console-id.model.ts +1 -0
  26. package/src/console/models/get-console-ids-response.model.ts +5 -1
  27. package/src/feed/getAchievementOfTheWeek.test.ts +19 -19
  28. package/src/feed/getAchievementOfTheWeek.ts +4 -4
  29. package/src/feed/getActiveClaims.test.ts +5 -5
  30. package/src/feed/getActiveClaims.ts +2 -2
  31. package/src/feed/getClaims.test.ts +5 -5
  32. package/src/feed/getClaims.ts +4 -4
  33. package/src/feed/getTopTenUsers.test.ts +12 -12
  34. package/src/feed/getTopTenUsers.ts +2 -2
  35. package/src/feed/models/claim-set-type.enum.ts +1 -1
  36. package/src/feed/models/claim-status.enum.ts +1 -1
  37. package/src/feed/models/claim-type.enum.ts +1 -1
  38. package/src/game/getAchievementCount.test.ts +3 -3
  39. package/src/game/getAchievementCount.ts +1 -1
  40. package/src/game/getAchievementDistribution.test.ts +12 -12
  41. package/src/game/getAchievementDistribution.ts +2 -2
  42. package/src/game/getGame.test.ts +3 -3
  43. package/src/game/getGame.ts +3 -3
  44. package/src/game/getGameExtended.test.ts +7 -7
  45. package/src/game/getGameExtended.ts +5 -5
  46. package/src/game/getGameRankAndScore.test.ts +6 -6
  47. package/src/game/getGameRankAndScore.ts +4 -4
  48. package/src/game/getGameRating.test.ts +5 -5
  49. package/src/game/getGameRating.ts +1 -1
  50. package/src/game/models/achievement-distribution-flags.enum.ts +1 -1
  51. package/src/game/models/game-extended-achievement-entity.model.ts +3 -0
  52. package/src/game/models/get-game-extended-response.model.ts +1 -1
  53. package/src/ticket/getTicketData.test.ts +31 -31
  54. package/src/ticket/getTicketData.ts +5 -5
  55. package/src/user/getAchievementsEarnedBetween.test.ts +7 -7
  56. package/src/user/getAchievementsEarnedBetween.ts +4 -4
  57. package/src/user/getAchievementsEarnedOnDay.test.ts +7 -7
  58. package/src/user/getAchievementsEarnedOnDay.ts +4 -4
  59. package/src/user/getGameInfoAndUserProgress.test.ts +8 -8
  60. package/src/user/getGameInfoAndUserProgress.ts +5 -5
  61. package/src/user/getUserAwards.test.ts +7 -7
  62. package/src/user/getUserAwards.ts +1 -1
  63. package/src/user/getUserClaims.test.ts +6 -6
  64. package/src/user/getUserClaims.ts +3 -3
  65. package/src/user/getUserCompletedGames.test.ts +8 -8
  66. package/src/user/getUserCompletedGames.ts +4 -4
  67. package/src/user/getUserCompletionProgress.test.ts +8 -8
  68. package/src/user/getUserCompletionProgress.ts +3 -3
  69. package/src/user/getUserGameRankAndScore.test.ts +6 -6
  70. package/src/user/getUserGameRankAndScore.ts +3 -3
  71. package/src/user/getUserPoints.test.ts +3 -3
  72. package/src/user/getUserPoints.ts +1 -1
  73. package/src/user/getUserProfile.test.ts +4 -4
  74. package/src/user/getUserProfile.ts +3 -3
  75. package/src/user/getUserProgress.test.ts +8 -8
  76. package/src/user/getUserProgress.ts +3 -3
  77. package/src/user/getUserRecentAchievements.test.ts +6 -6
  78. package/src/user/getUserRecentAchievements.ts +3 -3
  79. package/src/user/getUserRecentlyPlayedGames.test.ts +6 -6
  80. package/src/user/getUserRecentlyPlayedGames.ts +4 -4
  81. package/src/user/getUserSummary.test.ts +27 -27
  82. package/src/user/getUserSummary.ts +4 -4
  83. package/src/user/models/dated-user-achievement.model.ts +3 -1
  84. package/src/user/models/dated-user-achievements-response.model.ts +3 -1
  85. package/src/user/models/game-info-and-user-progress.model.ts +1 -1
  86. package/src/user/models/get-game-info-and-user-progress-response.model.ts +1 -1
  87. package/src/utils/internal/buildRequestUrl.test.ts +2 -2
  88. package/src/utils/internal/buildRequestUrl.ts +1 -1
  89. package/src/utils/internal/call.test.ts +1 -1
  90. package/src/utils/internal/call.ts +1 -1
  91. package/src/utils/internal/serializeProperties.test.ts +20 -20
  92. package/src/utils/internal/serializeProperties.ts +1 -1
  93. package/src/utils/public/buildAuthorization.test.ts +1 -1
@@ -23,7 +23,7 @@ describe("Function: getUserProgress", () => {
23
23
  // ARRANGE
24
24
  const authorization = buildAuthorization({
25
25
  userName: "mockUserName",
26
- webApiKey: "mockWebApiKey"
26
+ webApiKey: "mockWebApiKey",
27
27
  });
28
28
 
29
29
  const mockResponse: GetUserProgressResponse = {
@@ -33,7 +33,7 @@ describe("Function: getUserProgress", () => {
33
33
  NumAchieved: "4",
34
34
  ScoreAchieved: "80",
35
35
  NumAchievedHardcore: "4",
36
- ScoreAchievedHardcore: "80"
36
+ ScoreAchievedHardcore: "80",
37
37
  },
38
38
  "14402": {
39
39
  NumPossibleAchievements: "10",
@@ -41,8 +41,8 @@ describe("Function: getUserProgress", () => {
41
41
  NumAchieved: "4",
42
42
  ScoreAchieved: "80",
43
43
  NumAchievedHardcore: "4",
44
- ScoreAchievedHardcore: "80"
45
- }
44
+ ScoreAchievedHardcore: "80",
45
+ },
46
46
  };
47
47
 
48
48
  server.use(
@@ -54,7 +54,7 @@ describe("Function: getUserProgress", () => {
54
54
  // ACT
55
55
  const response = await getUserProgress(authorization, {
56
56
  userName: "xelnia",
57
- gameIds: [1, 14_402]
57
+ gameIds: [1, 14_402],
58
58
  });
59
59
 
60
60
  // ASSERT
@@ -65,7 +65,7 @@ describe("Function: getUserProgress", () => {
65
65
  numAchieved: 4,
66
66
  scoreAchieved: 80,
67
67
  numAchievedHardcore: 4,
68
- scoreAchievedHardcore: 80
68
+ scoreAchievedHardcore: 80,
69
69
  },
70
70
  "14402": {
71
71
  numPossibleAchievements: 10,
@@ -73,8 +73,8 @@ describe("Function: getUserProgress", () => {
73
73
  numAchieved: 4,
74
74
  scoreAchieved: 80,
75
75
  numAchievedHardcore: 4,
76
- scoreAchievedHardcore: 80
77
- }
76
+ scoreAchievedHardcore: 80,
77
+ },
78
78
  });
79
79
  });
80
80
  });
@@ -3,7 +3,7 @@ import {
3
3
  apiBaseUrl,
4
4
  buildRequestUrl,
5
5
  call,
6
- serializeProperties
6
+ serializeProperties,
7
7
  } from "../utils/internal";
8
8
  import type { AuthObject } from "../utils/public";
9
9
  import type { GetUserProgressResponse, UserProgress } from "./models";
@@ -73,7 +73,7 @@ export const getUserProgress = async (
73
73
  "NumAchieved",
74
74
  "ScoreAchieved",
75
75
  "NumAchievedHardcore",
76
- "ScoreAchievedHardcore"
77
- ]
76
+ "ScoreAchievedHardcore",
77
+ ],
78
78
  });
79
79
  };
@@ -23,7 +23,7 @@ describe("Function: getUserRecentAchievements", () => {
23
23
  // ARRANGE
24
24
  const authorization = buildAuthorization({
25
25
  userName: "mockUserName",
26
- webApiKey: "mockWebApiKey"
26
+ webApiKey: "mockWebApiKey",
27
27
  });
28
28
 
29
29
  const mockResponse: GetUserRecentAchievementsResponse = [
@@ -42,8 +42,8 @@ describe("Function: getUserRecentAchievements", () => {
42
42
  GameID: 6316,
43
43
  ConsoleName: "Game Boy",
44
44
  BadgeURL: "/Badge/121991.png",
45
- GameURL: "/game/6316"
46
- }
45
+ GameURL: "/game/6316",
46
+ },
47
47
  ];
48
48
 
49
49
  server.use(
@@ -54,7 +54,7 @@ describe("Function: getUserRecentAchievements", () => {
54
54
 
55
55
  // ACT
56
56
  const response = await getUserRecentAchievements(authorization, {
57
- userName: "xelnia"
57
+ userName: "xelnia",
58
58
  });
59
59
 
60
60
  // ASSERT
@@ -74,8 +74,8 @@ describe("Function: getUserRecentAchievements", () => {
74
74
  gameId: 6316,
75
75
  consoleName: "Game Boy",
76
76
  badgeUrl: "/Badge/121991.png",
77
- gameUrl: "/game/6316"
78
- }
77
+ gameUrl: "/game/6316",
78
+ },
79
79
  ]);
80
80
  });
81
81
  });
@@ -2,12 +2,12 @@ import {
2
2
  apiBaseUrl,
3
3
  buildRequestUrl,
4
4
  call,
5
- serializeProperties
5
+ serializeProperties,
6
6
  } from "../utils/internal";
7
7
  import type { AuthObject } from "../utils/public";
8
8
  import type {
9
9
  GetUserRecentAchievementsResponse,
10
- UserRecentAchievement
10
+ UserRecentAchievement,
11
11
  } from "./models";
12
12
 
13
13
  /**
@@ -75,6 +75,6 @@ export const getUserRecentAchievements = async (
75
75
  const rawResponse = await call<GetUserRecentAchievementsResponse>({ url });
76
76
 
77
77
  return serializeProperties(rawResponse, {
78
- shouldMapToBooleans: ["HardcoreMode"]
78
+ shouldMapToBooleans: ["HardcoreMode"],
79
79
  });
80
80
  };
@@ -23,7 +23,7 @@ describe("Function: getUserRecentlyPlayedGames", () => {
23
23
  // ARRANGE
24
24
  const authorization = buildAuthorization({
25
25
  userName: "mockUserName",
26
- webApiKey: "mockWebApiKey"
26
+ webApiKey: "mockWebApiKey",
27
27
  });
28
28
 
29
29
  const mockResponse: GetUserRecentlyPlayedGamesResponse = [
@@ -40,8 +40,8 @@ describe("Function: getUserRecentlyPlayedGames", () => {
40
40
  ScoreAchieved: 0,
41
41
  NumAchievedHardcore: 0,
42
42
  ScoreAchievedHardcore: 0,
43
- MyVote: "2"
44
- }
43
+ MyVote: "2",
44
+ },
45
45
  ];
46
46
 
47
47
  server.use(
@@ -52,7 +52,7 @@ describe("Function: getUserRecentlyPlayedGames", () => {
52
52
 
53
53
  // ACT
54
54
  const response = await getUserRecentlyPlayedGames(authorization, {
55
- userName: "xelnia"
55
+ userName: "xelnia",
56
56
  });
57
57
 
58
58
  // ASSERT
@@ -70,8 +70,8 @@ describe("Function: getUserRecentlyPlayedGames", () => {
70
70
  scoreAchieved: 0,
71
71
  numAchievedHardcore: 0,
72
72
  scoreAchievedHardcore: 0,
73
- myVote: 2
74
- }
73
+ myVote: 2,
74
+ },
75
75
  ]);
76
76
  });
77
77
  });
@@ -2,12 +2,12 @@ import {
2
2
  apiBaseUrl,
3
3
  buildRequestUrl,
4
4
  call,
5
- serializeProperties
5
+ serializeProperties,
6
6
  } from "../utils/internal";
7
7
  import type { AuthObject } from "../utils/public";
8
8
  import type {
9
9
  GetUserRecentlyPlayedGamesResponse,
10
- UserRecentlyPlayedGames
10
+ UserRecentlyPlayedGames,
11
11
  } from "./models";
12
12
 
13
13
  /**
@@ -88,7 +88,7 @@ export const getUserRecentlyPlayedGames = async (
88
88
  "ScoreAchieved",
89
89
  "NumAchievedHardcore",
90
90
  "ScoreAchievedHardcore",
91
- "MyVote"
92
- ]
91
+ "MyVote",
92
+ ],
93
93
  });
94
94
  };
@@ -25,7 +25,7 @@ describe("Function: getUserSummary", () => {
25
25
  // ARRANGE
26
26
  const authorization = buildAuthorization({
27
27
  userName: "mockUserName",
28
- webApiKey: "mockWebApiKey"
28
+ webApiKey: "mockWebApiKey",
29
29
  });
30
30
 
31
31
  const mockResponse = mockGetUserSummaryResponse;
@@ -38,7 +38,7 @@ describe("Function: getUserSummary", () => {
38
38
 
39
39
  // ACT
40
40
  const response = await getUserSummary(authorization, {
41
- userName: "WCopeland"
41
+ userName: "WCopeland",
42
42
  });
43
43
 
44
44
  // ASSERT
@@ -49,7 +49,7 @@ describe("Function: getUserSummary", () => {
49
49
  // ARRANGE
50
50
  const authorization = buildAuthorization({
51
51
  userName: "mockUserName",
52
- webApiKey: "mockWebApiKey"
52
+ webApiKey: "mockWebApiKey",
53
53
  });
54
54
 
55
55
  const mockResponse = "<html><body>the api is down</body></html>";
@@ -76,7 +76,7 @@ const mockGetUserSummaryResponse: GetUserSummaryResponse = {
76
76
  ConsoleName: "PlayStation 2",
77
77
  Title: "Mortal Kombat: Deadly Alliance",
78
78
  ImageIcon: "/Images/064938.png",
79
- LastPlayed: "2023-01-27 02:05:02"
79
+ LastPlayed: "2023-01-27 02:05:02",
80
80
  },
81
81
  {
82
82
  GameID: "15922",
@@ -84,8 +84,8 @@ const mockGetUserSummaryResponse: GetUserSummaryResponse = {
84
84
  ConsoleName: "NES",
85
85
  Title: "~Hack~ Mega Man 3 Revamped",
86
86
  ImageIcon: "/Images/061792.png",
87
- LastPlayed: "2022-11-07 21:49:09"
88
- }
87
+ LastPlayed: "2022-11-07 21:49:09",
88
+ },
89
89
  ],
90
90
  MemberSince: "2020-02-02 20:10:35",
91
91
  LastActivity: {
@@ -95,7 +95,7 @@ const mockGetUserSummaryResponse: GetUserSummaryResponse = {
95
95
  activitytype: "1",
96
96
  User: "WCopeland",
97
97
  data: "281263",
98
- data2: "1"
98
+ data2: "1",
99
99
  },
100
100
  RichPresenceMsg: "Arcade [Match 2] - Nitara vs Drahmin (Novice difficulty)",
101
101
  LastGameID: "19020",
@@ -115,7 +115,7 @@ const mockGetUserSummaryResponse: GetUserSummaryResponse = {
115
115
  Released: "November 16, 2002",
116
116
  IsFinal: false,
117
117
  ConsoleName: "PlayStation 2",
118
- RichPresencePatch: "MockRichPresencePatch"
118
+ RichPresencePatch: "MockRichPresencePatch",
119
119
  },
120
120
  ContribCount: "0",
121
121
  ContribYield: "0",
@@ -135,7 +135,7 @@ const mockGetUserSummaryResponse: GetUserSummaryResponse = {
135
135
  NumAchieved: "16",
136
136
  ScoreAchieved: "95",
137
137
  NumAchievedHardcore: "16",
138
- ScoreAchievedHardcore: "95"
138
+ ScoreAchievedHardcore: "95",
139
139
  },
140
140
  "6278": {
141
141
  NumPossibleAchievements: "42",
@@ -143,8 +143,8 @@ const mockGetUserSummaryResponse: GetUserSummaryResponse = {
143
143
  NumAchieved: 0,
144
144
  ScoreAchieved: 0,
145
145
  NumAchievedHardcore: 0,
146
- ScoreAchievedHardcore: 0
147
- }
146
+ ScoreAchievedHardcore: 0,
147
+ },
148
148
  },
149
149
  RecentAchievements: {
150
150
  "19020": {
@@ -158,15 +158,15 @@ const mockGetUserSummaryResponse: GetUserSummaryResponse = {
158
158
  BadgeName: "311063",
159
159
  IsAwarded: "1",
160
160
  DateAwarded: "2023-01-27 02:04:36",
161
- HardcoreAchieved: "0"
162
- }
163
- }
161
+ HardcoreAchieved: "0",
162
+ },
163
+ },
164
164
  },
165
165
  Points: "18817",
166
166
  SoftcorePoints: "25",
167
167
  UserPic: "/UserPic/WCopeland.png",
168
168
  TotalRanked: 34_572,
169
- Status: "Offline"
169
+ Status: "Offline",
170
170
  };
171
171
 
172
172
  const mockExpectedSummaryValue: UserSummary = {
@@ -178,7 +178,7 @@ const mockExpectedSummaryValue: UserSummary = {
178
178
  consoleName: "PlayStation 2",
179
179
  title: "Mortal Kombat: Deadly Alliance",
180
180
  imageIcon: "/Images/064938.png",
181
- lastPlayed: "2023-01-27 02:05:02"
181
+ lastPlayed: "2023-01-27 02:05:02",
182
182
  },
183
183
  {
184
184
  gameId: 15_922,
@@ -186,8 +186,8 @@ const mockExpectedSummaryValue: UserSummary = {
186
186
  consoleName: "NES",
187
187
  title: "~Hack~ Mega Man 3 Revamped",
188
188
  imageIcon: "/Images/061792.png",
189
- lastPlayed: "2022-11-07 21:49:09"
190
- }
189
+ lastPlayed: "2022-11-07 21:49:09",
190
+ },
191
191
  ],
192
192
  memberSince: "2020-02-02 20:10:35",
193
193
  lastActivity: {
@@ -197,7 +197,7 @@ const mockExpectedSummaryValue: UserSummary = {
197
197
  activitytype: 1,
198
198
  user: "WCopeland",
199
199
  data: "281263",
200
- data2: "1"
200
+ data2: "1",
201
201
  },
202
202
  richPresenceMsg: "Arcade [Match 2] - Nitara vs Drahmin (Novice difficulty)",
203
203
  lastGameId: 19_020,
@@ -217,7 +217,7 @@ const mockExpectedSummaryValue: UserSummary = {
217
217
  released: "November 16, 2002",
218
218
  isFinal: false,
219
219
  consoleName: "PlayStation 2",
220
- richPresencePatch: "MockRichPresencePatch"
220
+ richPresencePatch: "MockRichPresencePatch",
221
221
  },
222
222
  contribCount: 0,
223
223
  contribYield: 0,
@@ -237,7 +237,7 @@ const mockExpectedSummaryValue: UserSummary = {
237
237
  numAchieved: 16,
238
238
  scoreAchieved: 95,
239
239
  numAchievedHardcore: 16,
240
- scoreAchievedHardcore: 95
240
+ scoreAchievedHardcore: 95,
241
241
  },
242
242
  "6278": {
243
243
  numPossibleAchievements: 42,
@@ -245,8 +245,8 @@ const mockExpectedSummaryValue: UserSummary = {
245
245
  numAchieved: 0,
246
246
  scoreAchieved: 0,
247
247
  numAchievedHardcore: 0,
248
- scoreAchievedHardcore: 0
249
- }
248
+ scoreAchievedHardcore: 0,
249
+ },
250
250
  },
251
251
  recentAchievements: {
252
252
  19_020: {
@@ -260,13 +260,13 @@ const mockExpectedSummaryValue: UserSummary = {
260
260
  badgeName: "311063",
261
261
  isAwarded: true,
262
262
  dateAwarded: "2023-01-27 02:04:36",
263
- hardcoreAchieved: false
264
- }
265
- }
263
+ hardcoreAchieved: false,
264
+ },
265
+ },
266
266
  },
267
267
  points: 18_817,
268
268
  softcorePoints: 25,
269
269
  userPic: "/UserPic/WCopeland.png",
270
270
  totalRanked: 34_572,
271
- status: "Offline"
271
+ status: "Offline",
272
272
  };
@@ -2,7 +2,7 @@ import {
2
2
  apiBaseUrl,
3
3
  buildRequestUrl,
4
4
  call,
5
- serializeProperties
5
+ serializeProperties,
6
6
  } from "../utils/internal";
7
7
  import type { AuthObject } from "../utils/public";
8
8
  import type { GetUserSummaryResponse, UserSummary } from "./models";
@@ -82,13 +82,13 @@ export const getUserSummary = async (
82
82
  "NumAchievedHardcore",
83
83
  "ScoreAchievedHardcore",
84
84
  "Points",
85
- "SoftcorePoints"
85
+ "SoftcorePoints",
86
86
  ],
87
87
  shouldMapToBooleans: [
88
88
  "Untracked",
89
89
  "UserWallActive",
90
90
  "IsAwarded",
91
- "HardcoreAchieved"
92
- ]
91
+ "HardcoreAchieved",
92
+ ],
93
93
  });
94
94
  };
@@ -1,3 +1,5 @@
1
+ import type { AchievementType } from "../../achievement";
2
+
1
3
  export type DatedUserAchievement = {
2
4
  date: string;
3
5
  hardcoreMode: boolean;
@@ -14,5 +16,5 @@ export type DatedUserAchievement = {
14
16
  cumulScore: number;
15
17
  badgeUrl: string;
16
18
  gameUrl: string;
17
- type: "progression" | "win_condition" | "missable" | null;
19
+ type: AchievementType;
18
20
  };
@@ -1,3 +1,5 @@
1
+ import type { AchievementType } from "../../achievement";
2
+
1
3
  interface DatedUserAchievementResponseEntity {
2
4
  Date: string;
3
5
  HardcoreMode: string;
@@ -14,7 +16,7 @@ interface DatedUserAchievementResponseEntity {
14
16
  CumulScore: number;
15
17
  BadgeURL: string;
16
18
  GameURL: string;
17
- Type: "progression" | "win_condition" | "missable" | null;
19
+ Type: AchievementType;
18
20
  }
19
21
 
20
22
  export type DatedUserAchievementsResponse =
@@ -1,6 +1,6 @@
1
1
  import type {
2
2
  GameExtended,
3
- GameExtendedAchievementEntity
3
+ GameExtendedAchievementEntity,
4
4
  } from "../../game/models";
5
5
 
6
6
  export type GameExtendedAchievementEntityWithUserProgress =
@@ -1,6 +1,6 @@
1
1
  import type {
2
2
  GameExtendedRawAchievementEntity,
3
- GetGameExtendedResponse
3
+ GetGameExtendedResponse,
4
4
  } from "../../game/models";
5
5
 
6
6
  type GetGameExtendedResponseWithoutClaims = Omit<
@@ -15,7 +15,7 @@ describe("Util: buildRequestUrl", () => {
15
15
  baz: "myBazValue",
16
16
  limit: 10,
17
17
  offset: 2,
18
- notDefined: undefined
18
+ notDefined: undefined,
19
19
  };
20
20
 
21
21
  // ACT
@@ -40,7 +40,7 @@ describe("Util: buildRequestUrl", () => {
40
40
  // ACT
41
41
  const requestUrl = buildRequestUrl(baseUrl, endpointUrl, {
42
42
  userName: "TestUser",
43
- webApiKey: "mockWebApiKey"
43
+ webApiKey: "mockWebApiKey",
44
44
  });
45
45
 
46
46
  // ASSERT
@@ -15,7 +15,7 @@ export const buildRequestUrl = (
15
15
  // Authentication is handled purely by query params.
16
16
  const queryParamValues: Record<string, string> = {
17
17
  z: authObject.userName,
18
- y: authObject.webApiKey
18
+ y: authObject.webApiKey,
19
19
  };
20
20
 
21
21
  for (const [argKey, argValue] of Object.entries(args)) {
@@ -44,7 +44,7 @@ describe("Util: call", () => {
44
44
  server.use(
45
45
  http.get(mockRequestUrl, () =>
46
46
  HttpResponse.text("<HTML><BODY>something bad happened</BODY></HTML>", {
47
- status: 503
47
+ status: 503,
48
48
  })
49
49
  )
50
50
  );
@@ -16,7 +16,7 @@ export const call = async <
16
16
  const { url } = config;
17
17
 
18
18
  const headers = new Headers({
19
- "User-Agent": `RetroAchievements-api-js/${packageVersion}`
19
+ "User-Agent": `RetroAchievements-api-js/${packageVersion}`,
20
20
  });
21
21
 
22
22
  const rawResponse = await fetch(url, { headers });
@@ -15,7 +15,7 @@ describe("Util: serializeProperties", () => {
15
15
  GameID: 100,
16
16
  AchievementIDs: [1, 2, 3, 4, 5],
17
17
  RAPoints: 100,
18
- ConsoleName: "PlayStation Portable"
18
+ ConsoleName: "PlayStation Portable",
19
19
  };
20
20
 
21
21
  // ACT
@@ -27,7 +27,7 @@ describe("Util: serializeProperties", () => {
27
27
  gameId: 100,
28
28
  achievementIds: [1, 2, 3, 4, 5],
29
29
  raPoints: 100,
30
- consoleName: "PlayStation Portable"
30
+ consoleName: "PlayStation Portable",
31
31
  });
32
32
  });
33
33
 
@@ -39,8 +39,8 @@ describe("Util: serializeProperties", () => {
39
39
  GameID: 100,
40
40
  AchievementIDs: [1, 2, 3, 4, 5],
41
41
  RAPoints: 100,
42
- ConsoleName: "PlayStation Portable"
43
- }
42
+ ConsoleName: "PlayStation Portable",
43
+ },
44
44
  ];
45
45
 
46
46
  // ACT
@@ -53,8 +53,8 @@ describe("Util: serializeProperties", () => {
53
53
  gameId: 100,
54
54
  achievementIds: [1, 2, 3, 4, 5],
55
55
  raPoints: 100,
56
- consoleName: "PlayStation Portable"
57
- }
56
+ consoleName: "PlayStation Portable",
57
+ },
58
58
  ]);
59
59
  });
60
60
 
@@ -68,8 +68,8 @@ describe("Util: serializeProperties", () => {
68
68
  ConsoleName: "PlayStation Portable",
69
69
  UserMeta: {
70
70
  Name: "xelnia",
71
- Points: 100
72
- }
71
+ Points: 100,
72
+ },
73
73
  };
74
74
 
75
75
  // ACT
@@ -84,8 +84,8 @@ describe("Util: serializeProperties", () => {
84
84
  consoleName: "PlayStation Portable",
85
85
  userMeta: {
86
86
  name: "xelnia",
87
- points: 100
88
- }
87
+ points: 100,
88
+ },
89
89
  });
90
90
  });
91
91
 
@@ -95,13 +95,13 @@ describe("Util: serializeProperties", () => {
95
95
  UserName: "xelnia",
96
96
  Points: "500",
97
97
  Metadata: {
98
- TitleID: "100"
99
- }
98
+ TitleID: "100",
99
+ },
100
100
  };
101
101
 
102
102
  // ACT
103
103
  const sanitizedObject = serializeProperties(originalObject, {
104
- shouldCastToNumbers: ["TitleID", "Points"]
104
+ shouldCastToNumbers: ["TitleID", "Points"],
105
105
  });
106
106
 
107
107
  // ASSERT
@@ -109,8 +109,8 @@ describe("Util: serializeProperties", () => {
109
109
  userName: "xelnia",
110
110
  points: 500,
111
111
  metadata: {
112
- titleId: 100
113
- }
112
+ titleId: 100,
113
+ },
114
114
  });
115
115
  });
116
116
 
@@ -120,13 +120,13 @@ describe("Util: serializeProperties", () => {
120
120
  UserName: "xelnia",
121
121
  HardcoreMode: "0",
122
122
  Metadata: {
123
- IsCoolGuy: "1"
124
- }
123
+ IsCoolGuy: "1",
124
+ },
125
125
  };
126
126
 
127
127
  // ACT
128
128
  const sanitizedObject = serializeProperties(originalObject, {
129
- shouldMapToBooleans: ["HardcoreMode", "IsCoolGuy"]
129
+ shouldMapToBooleans: ["HardcoreMode", "IsCoolGuy"],
130
130
  });
131
131
 
132
132
  // ASSERT
@@ -134,8 +134,8 @@ describe("Util: serializeProperties", () => {
134
134
  userName: "xelnia",
135
135
  hardcoreMode: false,
136
136
  metadata: {
137
- isCoolGuy: true
138
- }
137
+ isCoolGuy: true,
138
+ },
139
139
  });
140
140
  });
141
141
  });
@@ -42,7 +42,7 @@ export const serializeProperties = (
42
42
  [naiveCamelCase(originalKey)]: serializeProperties(
43
43
  sanitizedValue,
44
44
  options
45
- )
45
+ ),
46
46
  };
47
47
  }
48
48
 
@@ -10,7 +10,7 @@ describe("Util: buildAuthorization", () => {
10
10
  // ARRANGE
11
11
  const myAuth = {
12
12
  userName: "myUserName",
13
- webApiKey: "myWebApiKey"
13
+ webApiKey: "myWebApiKey",
14
14
  };
15
15
 
16
16
  // ACT