@retroachievements/api 1.5.1 → 1.5.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 (89) hide show
  1. package/dist/api.cjs.map +1 -1
  2. package/dist/api.modern.js.map +1 -1
  3. package/dist/api.module.js.map +1 -1
  4. package/dist/api.umd.js.map +1 -1
  5. package/dist/console/getConsoleIds.d.ts +6 -2
  6. package/dist/console/models/console-id.model.d.ts +1 -0
  7. package/dist/console/models/get-console-ids-response.model.d.ts +1 -0
  8. package/dist/user/models/achievement-type.model.d.ts +1 -0
  9. package/dist/user/models/dated-user-achievement.model.d.ts +2 -1
  10. package/dist/user/models/dated-user-achievements-response.model.d.ts +2 -1
  11. package/dist/user/models/index.d.ts +1 -0
  12. package/package.json +2 -4
  13. package/src/__playground.ts +1 -1
  14. package/src/achievement/getAchievementUnlocks.test.ts +10 -10
  15. package/src/achievement/getAchievementUnlocks.ts +3 -3
  16. package/src/console/getConsoleIds.test.ts +42 -10
  17. package/src/console/getConsoleIds.ts +8 -4
  18. package/src/console/getGameList.test.ts +8 -8
  19. package/src/console/getGameList.ts +4 -4
  20. package/src/console/models/console-id.model.ts +1 -0
  21. package/src/console/models/get-console-ids-response.model.ts +5 -1
  22. package/src/feed/getAchievementOfTheWeek.test.ts +19 -19
  23. package/src/feed/getAchievementOfTheWeek.ts +4 -4
  24. package/src/feed/getActiveClaims.test.ts +5 -5
  25. package/src/feed/getActiveClaims.ts +2 -2
  26. package/src/feed/getClaims.test.ts +5 -5
  27. package/src/feed/getClaims.ts +4 -4
  28. package/src/feed/getTopTenUsers.test.ts +12 -12
  29. package/src/feed/getTopTenUsers.ts +2 -2
  30. package/src/feed/models/claim-set-type.enum.ts +1 -1
  31. package/src/feed/models/claim-status.enum.ts +1 -1
  32. package/src/feed/models/claim-type.enum.ts +1 -1
  33. package/src/game/getAchievementCount.test.ts +3 -3
  34. package/src/game/getAchievementCount.ts +1 -1
  35. package/src/game/getAchievementDistribution.test.ts +12 -12
  36. package/src/game/getAchievementDistribution.ts +2 -2
  37. package/src/game/getGame.test.ts +3 -3
  38. package/src/game/getGame.ts +3 -3
  39. package/src/game/getGameExtended.test.ts +7 -7
  40. package/src/game/getGameExtended.ts +4 -4
  41. package/src/game/getGameRankAndScore.test.ts +6 -6
  42. package/src/game/getGameRankAndScore.ts +4 -4
  43. package/src/game/getGameRating.test.ts +5 -5
  44. package/src/game/getGameRating.ts +1 -1
  45. package/src/game/models/achievement-distribution-flags.enum.ts +1 -1
  46. package/src/game/models/get-game-extended-response.model.ts +1 -1
  47. package/src/ticket/getTicketData.test.ts +31 -31
  48. package/src/ticket/getTicketData.ts +5 -5
  49. package/src/user/getAchievementsEarnedBetween.test.ts +7 -7
  50. package/src/user/getAchievementsEarnedBetween.ts +4 -4
  51. package/src/user/getAchievementsEarnedOnDay.test.ts +7 -7
  52. package/src/user/getAchievementsEarnedOnDay.ts +4 -4
  53. package/src/user/getGameInfoAndUserProgress.test.ts +8 -8
  54. package/src/user/getGameInfoAndUserProgress.ts +5 -5
  55. package/src/user/getUserAwards.test.ts +7 -7
  56. package/src/user/getUserAwards.ts +1 -1
  57. package/src/user/getUserClaims.test.ts +6 -6
  58. package/src/user/getUserClaims.ts +3 -3
  59. package/src/user/getUserCompletedGames.test.ts +8 -8
  60. package/src/user/getUserCompletedGames.ts +4 -4
  61. package/src/user/getUserCompletionProgress.test.ts +8 -8
  62. package/src/user/getUserCompletionProgress.ts +3 -3
  63. package/src/user/getUserGameRankAndScore.test.ts +6 -6
  64. package/src/user/getUserGameRankAndScore.ts +3 -3
  65. package/src/user/getUserPoints.test.ts +3 -3
  66. package/src/user/getUserPoints.ts +1 -1
  67. package/src/user/getUserProfile.test.ts +4 -4
  68. package/src/user/getUserProfile.ts +3 -3
  69. package/src/user/getUserProgress.test.ts +8 -8
  70. package/src/user/getUserProgress.ts +3 -3
  71. package/src/user/getUserRecentAchievements.test.ts +6 -6
  72. package/src/user/getUserRecentAchievements.ts +3 -3
  73. package/src/user/getUserRecentlyPlayedGames.test.ts +6 -6
  74. package/src/user/getUserRecentlyPlayedGames.ts +4 -4
  75. package/src/user/getUserSummary.test.ts +27 -27
  76. package/src/user/getUserSummary.ts +4 -4
  77. package/src/user/models/achievement-type.model.ts +5 -0
  78. package/src/user/models/dated-user-achievement.model.ts +3 -1
  79. package/src/user/models/dated-user-achievements-response.model.ts +3 -1
  80. package/src/user/models/game-info-and-user-progress.model.ts +1 -1
  81. package/src/user/models/get-game-info-and-user-progress-response.model.ts +1 -1
  82. package/src/user/models/index.ts +1 -0
  83. package/src/utils/internal/buildRequestUrl.test.ts +2 -2
  84. package/src/utils/internal/buildRequestUrl.ts +1 -1
  85. package/src/utils/internal/call.test.ts +1 -1
  86. package/src/utils/internal/call.ts +1 -1
  87. package/src/utils/internal/serializeProperties.test.ts +20 -20
  88. package/src/utils/internal/serializeProperties.ts +1 -1
  89. package/src/utils/public/buildAuthorization.test.ts +1 -1
@@ -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
  DatedUserAchievement,
10
- DatedUserAchievementsResponse
10
+ DatedUserAchievementsResponse,
11
11
  } from "./models";
12
12
 
13
13
  /**
@@ -76,7 +76,7 @@ export const getAchievementsEarnedBetween = async (
76
76
  {
77
77
  u: userName,
78
78
  f: (fromDate.getTime() / 1000).toFixed(0),
79
- t: (toDate.getTime() / 1000).toFixed(0)
79
+ t: (toDate.getTime() / 1000).toFixed(0),
80
80
  }
81
81
  );
82
82
 
@@ -84,6 +84,6 @@ export const getAchievementsEarnedBetween = async (
84
84
 
85
85
  return serializeProperties(rawResponse, {
86
86
  shouldCastToNumbers: ["AchievementID", "Points", "GameID"],
87
- shouldMapToBooleans: ["HardcoreMode"]
87
+ shouldMapToBooleans: ["HardcoreMode"],
88
88
  });
89
89
  };
@@ -6,7 +6,7 @@ import { buildAuthorization } from "../utils/public";
6
6
  import { getAchievementsEarnedOnDay } from "./getAchievementsEarnedOnDay";
7
7
  import type {
8
8
  DatedUserAchievement,
9
- DatedUserAchievementsResponse
9
+ DatedUserAchievementsResponse,
10
10
  } from "./models";
11
11
 
12
12
  const server = setupServer();
@@ -26,7 +26,7 @@ describe("Function: getAchievementsEarnedOnDay", () => {
26
26
  // ARRANGE
27
27
  const authorization = buildAuthorization({
28
28
  userName: "mockUserName",
29
- webApiKey: "mockWebApiKey"
29
+ webApiKey: "mockWebApiKey",
30
30
  });
31
31
 
32
32
  const mockResponse: DatedUserAchievementsResponse = [
@@ -46,8 +46,8 @@ describe("Function: getAchievementsEarnedOnDay", () => {
46
46
  CumulScore: 40,
47
47
  BadgeURL: "/Badge/193797.png",
48
48
  GameURL: "/game/3571",
49
- Type: null
50
- }
49
+ Type: null,
50
+ },
51
51
  ];
52
52
 
53
53
  server.use(
@@ -59,7 +59,7 @@ describe("Function: getAchievementsEarnedOnDay", () => {
59
59
  // ACT
60
60
  const response = await getAchievementsEarnedOnDay(authorization, {
61
61
  userName: "xelnia",
62
- onDate: new Date("2022-10-12")
62
+ onDate: new Date("2022-10-12"),
63
63
  });
64
64
 
65
65
  const expectedResponse: DatedUserAchievement[] = [
@@ -79,8 +79,8 @@ describe("Function: getAchievementsEarnedOnDay", () => {
79
79
  cumulScore: 40,
80
80
  badgeUrl: "/Badge/193797.png",
81
81
  gameUrl: "/game/3571",
82
- type: null
83
- }
82
+ type: null,
83
+ },
84
84
  ];
85
85
 
86
86
  // ASSERT
@@ -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
  DatedUserAchievement,
10
- DatedUserAchievementsResponse
10
+ DatedUserAchievementsResponse,
11
11
  } from "./models";
12
12
 
13
13
  /**
@@ -75,7 +75,7 @@ export const getAchievementsEarnedOnDay = async (
75
75
  {
76
76
  u: userName,
77
77
  // YYYY-MM-DD
78
- d: `${onDate.getFullYear()}-${onDate.getMonth() + 1}-${onDate.getDate()}`
78
+ d: `${onDate.getFullYear()}-${onDate.getMonth() + 1}-${onDate.getDate()}`,
79
79
  }
80
80
  );
81
81
 
@@ -83,6 +83,6 @@ export const getAchievementsEarnedOnDay = async (
83
83
 
84
84
  return serializeProperties(rawResponse, {
85
85
  shouldCastToNumbers: ["AchievementID", "Points", "GameID"],
86
- shouldMapToBooleans: ["HardcoreMode"]
86
+ shouldMapToBooleans: ["HardcoreMode"],
87
87
  });
88
88
  };
@@ -25,7 +25,7 @@ describe("Function: getGameInfoAndUserProgress", () => {
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: GetGameInfoAndUserProgressResponse = {
@@ -64,13 +64,13 @@ describe("Function: getGameInfoAndUserProgress", () => {
64
64
  DisplayOrder: "0",
65
65
  MemAddr: "f5c41fa0b5fa0d5fbb8a74c598f18582",
66
66
  DateEarned: "2022-08-23 22:56:38",
67
- DateEarnedHardcore: "2022-08-23 22:56:38"
68
- }
67
+ DateEarnedHardcore: "2022-08-23 22:56:38",
68
+ },
69
69
  },
70
70
  NumAwardedToUser: 12,
71
71
  NumAwardedToUserHardcore: 12,
72
72
  UserCompletion: "100.00%",
73
- UserCompletionHardcore: "100.00%"
73
+ UserCompletionHardcore: "100.00%",
74
74
  };
75
75
 
76
76
  server.use(
@@ -82,7 +82,7 @@ describe("Function: getGameInfoAndUserProgress", () => {
82
82
  // ACT
83
83
  const response = await getGameInfoAndUserProgress(authorization, {
84
84
  gameId: 14_402,
85
- userName: "xelnia"
85
+ userName: "xelnia",
86
86
  });
87
87
 
88
88
  // ASSERT
@@ -122,13 +122,13 @@ describe("Function: getGameInfoAndUserProgress", () => {
122
122
  displayOrder: 0,
123
123
  memAddr: "f5c41fa0b5fa0d5fbb8a74c598f18582",
124
124
  dateEarned: "2022-08-23 22:56:38",
125
- dateEarnedHardcore: "2022-08-23 22:56:38"
126
- }
125
+ dateEarnedHardcore: "2022-08-23 22:56:38",
126
+ },
127
127
  },
128
128
  numAwardedToUser: 12,
129
129
  numAwardedToUserHardcore: 12,
130
130
  userCompletion: "100.00%",
131
- userCompletionHardcore: "100.00%"
131
+ userCompletionHardcore: "100.00%",
132
132
  });
133
133
  });
134
134
  });
@@ -3,12 +3,12 @@ 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 {
10
10
  GameInfoAndUserProgress,
11
- GetGameInfoAndUserProgressResponse
11
+ GetGameInfoAndUserProgressResponse,
12
12
  } from "./models";
13
13
 
14
14
  /**
@@ -97,7 +97,7 @@ export const getGameInfoAndUserProgress = async (
97
97
  authorization,
98
98
  {
99
99
  g: gameId,
100
- u: userName
100
+ u: userName,
101
101
  }
102
102
  );
103
103
 
@@ -113,7 +113,7 @@ export const getGameInfoAndUserProgress = async (
113
113
  "DisplayOrder",
114
114
  "NumDistinctPlayersCasual",
115
115
  "NumDistinctPlayersHardcore",
116
- "Released"
117
- ]
116
+ "Released",
117
+ ],
118
118
  });
119
119
  };
@@ -23,7 +23,7 @@ describe("Function: getUserAwards", () => {
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: GetUserAwardsResponse = {
@@ -45,9 +45,9 @@ describe("Function: getUserAwards", () => {
45
45
  Title: "WarioWare, Inc.: Mega Microgames!",
46
46
  ConsoleName: "Game Boy Advance",
47
47
  Flags: null,
48
- ImageIcon: "/Images/034678.png"
49
- }
50
- ]
48
+ ImageIcon: "/Images/034678.png",
49
+ },
50
+ ],
51
51
  };
52
52
 
53
53
  server.use(
@@ -79,9 +79,9 @@ describe("Function: getUserAwards", () => {
79
79
  title: "WarioWare, Inc.: Mega Microgames!",
80
80
  consoleName: "Game Boy Advance",
81
81
  flags: null,
82
- imageIcon: "/Images/034678.png"
83
- }
84
- ]
82
+ imageIcon: "/Images/034678.png",
83
+ },
84
+ ],
85
85
  });
86
86
  });
87
87
  });
@@ -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 { GetUserAwardsResponse, UserAwards } from "./models";
@@ -24,7 +24,7 @@ describe("Function: getUserClaims", () => {
24
24
  it("given a username, retrieves a list of achievement set claims for the user", async () => {
25
25
  const authorization = buildAuthorization({
26
26
  userName: "mockUserName",
27
- webApiKey: "mockWebApiKey"
27
+ webApiKey: "mockWebApiKey",
28
28
  });
29
29
 
30
30
  const mockResponse: GetUserClaimsResponse = [
@@ -43,8 +43,8 @@ describe("Function: getUserClaims", () => {
43
43
  Created: "2017-08-20 00:00:00",
44
44
  DoneTime: "2017-08-20 00:00:00",
45
45
  Updated: "2022-06-28 17:15:59",
46
- MinutesLeft: "-2862348"
47
- }
46
+ MinutesLeft: "-2862348",
47
+ },
48
48
  ];
49
49
 
50
50
  server.use(
@@ -55,7 +55,7 @@ describe("Function: getUserClaims", () => {
55
55
 
56
56
  // ACT
57
57
  const response = await getUserClaims(authorization, {
58
- userName: "Jamiras"
58
+ userName: "Jamiras",
59
59
  });
60
60
 
61
61
  // ASSERT
@@ -75,8 +75,8 @@ describe("Function: getUserClaims", () => {
75
75
  created: "2017-08-20 00:00:00",
76
76
  doneTime: "2017-08-20 00:00:00",
77
77
  updated: "2022-06-28 17:15:59",
78
- minutesLeft: -2_862_348
79
- }
78
+ minutesLeft: -2_862_348,
79
+ },
80
80
  ]);
81
81
  });
82
82
  });
@@ -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 { GetUserClaimsResponse, UserClaims } from "./models";
@@ -53,7 +53,7 @@ export const getUserClaims = async (
53
53
  "Status",
54
54
  "Extension",
55
55
  "Special",
56
- "MinutesLeft"
57
- ]
56
+ "MinutesLeft",
57
+ ],
58
58
  });
59
59
  };
@@ -25,7 +25,7 @@ describe("Function: getUserCompletedGames", () => {
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: GetUserCompletedGamesResponse = [
@@ -38,7 +38,7 @@ describe("Function: getUserCompletedGames", () => {
38
38
  MaxPossible: "26",
39
39
  NumAwarded: "12",
40
40
  PctWon: "0.4615",
41
- HardcoreMode: "0"
41
+ HardcoreMode: "0",
42
42
  },
43
43
  {
44
44
  GameID: "1881",
@@ -49,8 +49,8 @@ describe("Function: getUserCompletedGames", () => {
49
49
  MaxPossible: "26",
50
50
  NumAwarded: "12",
51
51
  PctWon: "0.4615",
52
- HardcoreMode: "1"
53
- }
52
+ HardcoreMode: "1",
53
+ },
54
54
  ];
55
55
 
56
56
  server.use(
@@ -61,7 +61,7 @@ describe("Function: getUserCompletedGames", () => {
61
61
 
62
62
  // ACT
63
63
  const response = await getUserCompletedGames(authorization, {
64
- userName: "xelnia"
64
+ userName: "xelnia",
65
65
  });
66
66
 
67
67
  // ASSERT
@@ -75,7 +75,7 @@ describe("Function: getUserCompletedGames", () => {
75
75
  maxPossible: 26,
76
76
  numAwarded: 12,
77
77
  pctWon: 0.4615,
78
- hardcoreMode: false
78
+ hardcoreMode: false,
79
79
  },
80
80
  {
81
81
  gameId: 1881,
@@ -86,8 +86,8 @@ describe("Function: getUserCompletedGames", () => {
86
86
  maxPossible: 26,
87
87
  numAwarded: 12,
88
88
  pctWon: 0.4615,
89
- hardcoreMode: true
90
- }
89
+ hardcoreMode: true,
90
+ },
91
91
  ]);
92
92
  });
93
93
  });
@@ -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
  GetUserCompletedGamesResponse,
10
- UserCompletedGames
10
+ UserCompletedGames,
11
11
  } from "./models";
12
12
 
13
13
  /**
@@ -82,8 +82,8 @@ export const getUserCompletedGames = async (
82
82
  "ConsoleID",
83
83
  "MaxPossible",
84
84
  "NumAwarded",
85
- "PctWon"
85
+ "PctWon",
86
86
  ],
87
- shouldMapToBooleans: ["HardcoreMode"]
87
+ shouldMapToBooleans: ["HardcoreMode"],
88
88
  });
89
89
  };
@@ -23,7 +23,7 @@ describe("Function: getUserCompletionProgress", () => {
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: GetUserCompletionProgressResponse = {
@@ -41,9 +41,9 @@ describe("Function: getUserCompletionProgress", () => {
41
41
  NumAwardedHardcore: 8,
42
42
  MostRecentAwardedDate: "2022-07-26T23:56:15+00:00",
43
43
  HighestAwardKind: null,
44
- HighestAwardDate: null
45
- }
46
- ]
44
+ HighestAwardDate: null,
45
+ },
46
+ ],
47
47
  };
48
48
 
49
49
  server.use(
@@ -54,7 +54,7 @@ describe("Function: getUserCompletionProgress", () => {
54
54
 
55
55
  // ACT
56
56
  const response = await getUserCompletionProgress(authorization, {
57
- userName: "xelnia"
57
+ userName: "xelnia",
58
58
  });
59
59
 
60
60
  // ASSERT
@@ -73,9 +73,9 @@ describe("Function: getUserCompletionProgress", () => {
73
73
  numAwardedHardcore: 8,
74
74
  mostRecentAwardedDate: "2022-07-26T23:56:15+00:00",
75
75
  highestAwardKind: null,
76
- highestAwardDate: null
77
- }
78
- ]
76
+ highestAwardDate: null,
77
+ },
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
  GetUserCompletionProgressResponse,
10
- UserCompletionProgress
10
+ UserCompletionProgress,
11
11
  } from "./models";
12
12
 
13
13
  /**
@@ -61,7 +61,7 @@ export const getUserCompletionProgress = async (
61
61
  const { userName, offset, count } = payload;
62
62
 
63
63
  const params: Record<string, string | number> = {
64
- u: userName
64
+ u: userName,
65
65
  };
66
66
  if (offset) {
67
67
  params["o"] = offset;
@@ -23,7 +23,7 @@ describe("Function: getUserGameRankAndScore", () => {
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: GetUserGameRankAndScoreResponse = [
@@ -31,8 +31,8 @@ describe("Function: getUserGameRankAndScore", () => {
31
31
  User: "xelnia",
32
32
  TotalScore: "1000",
33
33
  LastAward: "2022-09-01 21:51:23",
34
- UserRank: "4"
35
- }
34
+ UserRank: "4",
35
+ },
36
36
  ];
37
37
 
38
38
  server.use(
@@ -44,7 +44,7 @@ describe("Function: getUserGameRankAndScore", () => {
44
44
  // ACT
45
45
  const response = await getUserGameRankAndScore(authorization, {
46
46
  userName: "xelnia",
47
- gameId: 14_402
47
+ gameId: 14_402,
48
48
  });
49
49
 
50
50
  // ASSERT
@@ -53,8 +53,8 @@ describe("Function: getUserGameRankAndScore", () => {
53
53
  user: "xelnia",
54
54
  totalScore: 1000,
55
55
  lastAward: "2022-09-01 21:51:23",
56
- userRank: 4
57
- }
56
+ userRank: 4,
57
+ },
58
58
  ]);
59
59
  });
60
60
  });
@@ -3,12 +3,12 @@ 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 {
10
10
  GetUserGameRankAndScoreResponse,
11
- UserGameRankAndScore
11
+ UserGameRankAndScore,
12
12
  } from "./models";
13
13
 
14
14
  /**
@@ -65,6 +65,6 @@ export const getUserGameRankAndScore = async (
65
65
  const rawResponse = await call<GetUserGameRankAndScoreResponse>({ url });
66
66
 
67
67
  return serializeProperties(rawResponse, {
68
- shouldCastToNumbers: ["TotalScore", "UserRank"]
68
+ shouldCastToNumbers: ["TotalScore", "UserRank"],
69
69
  });
70
70
  };
@@ -23,12 +23,12 @@ describe("Function: getUserPoints", () => {
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: GetUserPointsResponse = {
30
30
  Points: 10_000,
31
- SoftcorePoints: 5400
31
+ SoftcorePoints: 5400,
32
32
  };
33
33
 
34
34
  server.use(
@@ -43,7 +43,7 @@ describe("Function: getUserPoints", () => {
43
43
  // ASSERT
44
44
  expect(response).toEqual({
45
45
  points: 10_000,
46
- softcorePoints: 5400
46
+ softcorePoints: 5400,
47
47
  });
48
48
  });
49
49
  });
@@ -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 { GetUserPointsResponse, UserPoints } from "./models";
@@ -23,7 +23,7 @@ describe("Function: getUserProfile", () => {
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: GetUserProfileResponse = {
@@ -42,7 +42,7 @@ describe("Function: getUserProfile", () => {
42
42
  Untracked: 0,
43
43
  ID: 16_446,
44
44
  UserWallActive: 1,
45
- Motto: "Join me on Twitch! GameSquadSquad for live RA"
45
+ Motto: "Join me on Twitch! GameSquadSquad for live RA",
46
46
  };
47
47
 
48
48
  server.use(
@@ -53,7 +53,7 @@ describe("Function: getUserProfile", () => {
53
53
 
54
54
  // ACT
55
55
  const response = await getUserProfile(authorization, {
56
- userName: "WCopeland"
56
+ userName: "WCopeland",
57
57
  });
58
58
 
59
59
  // ASSERT
@@ -73,7 +73,7 @@ describe("Function: getUserProfile", () => {
73
73
  untracked: false,
74
74
  id: 16_446,
75
75
  userWallActive: true,
76
- motto: "Join me on Twitch! GameSquadSquad for live RA"
76
+ motto: "Join me on Twitch! GameSquadSquad for live RA",
77
77
  });
78
78
  });
79
79
  });
@@ -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 { GetUserProfileResponse, UserProfile } from "./models";
@@ -48,8 +48,8 @@ export const getUserProfile = async (
48
48
  "TotalPoints",
49
49
  "TotalSoftcorePoints",
50
50
  "TotalTruePoints",
51
- "Permissions"
51
+ "Permissions",
52
52
  ],
53
- shouldMapToBooleans: ["Untracked", "UserWallActive"]
53
+ shouldMapToBooleans: ["Untracked", "UserWallActive"],
54
54
  });
55
55
  };
@@ -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
  });