@retroachievements/api 2.7.0 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +2 -0
  2. package/dist/api.cjs +1 -1
  3. package/dist/api.cjs.map +1 -1
  4. package/dist/api.modern.js +1 -1
  5. package/dist/api.modern.js.map +1 -1
  6. package/dist/api.module.js +1 -1
  7. package/dist/api.module.js.map +1 -1
  8. package/dist/api.umd.js +1 -1
  9. package/dist/api.umd.js.map +1 -1
  10. package/dist/game/getGameProgression.d.ts +83 -0
  11. package/dist/game/getGameProgression.test.d.ts +1 -0
  12. package/dist/game/index.d.ts +1 -0
  13. package/dist/game/models/game-progression.model.d.ts +32 -0
  14. package/dist/game/models/get-game-progression-response.model.d.ts +32 -0
  15. package/dist/game/models/index.d.ts +2 -0
  16. package/dist/leaderboard/getUserGameLeaderboards.d.ts +1 -1
  17. package/dist/leaderboard/index.d.ts +1 -0
  18. package/dist/user/getUsersIFollow.d.ts +46 -0
  19. package/dist/user/getUsersIFollow.test.d.ts +1 -0
  20. package/dist/user/index.d.ts +1 -0
  21. package/dist/user/models/get-users-i-follow-response.model.d.ts +11 -0
  22. package/dist/user/models/index.d.ts +2 -0
  23. package/dist/user/models/users-i-follow.model.d.ts +11 -0
  24. package/package.json +1 -1
  25. package/src/game/getGameProgression.test.ts +114 -0
  26. package/src/game/getGameProgression.ts +112 -0
  27. package/src/game/index.ts +1 -0
  28. package/src/game/models/game-progression.model.ts +32 -0
  29. package/src/game/models/get-game-progression-response.model.ts +32 -0
  30. package/src/game/models/index.ts +2 -0
  31. package/src/leaderboard/getUserGameLeaderboards.ts +2 -4
  32. package/src/leaderboard/index.ts +1 -0
  33. package/src/user/getUsersIFollow.test.ts +124 -0
  34. package/src/user/getUsersIFollow.ts +75 -0
  35. package/src/user/index.ts +1 -0
  36. package/src/user/models/get-users-i-follow-response.model.ts +11 -0
  37. package/src/user/models/index.ts +2 -0
  38. package/src/user/models/users-i-follow.model.ts +11 -0
@@ -0,0 +1,83 @@
1
+ import type { ID } from "../utils/internal";
2
+ import type { AuthObject } from "../utils/public";
3
+ import type { GameProgression } from "./models";
4
+ /**
5
+ * A call to this function will retrieve information about the average time to unlock achievements in a game.
6
+ *
7
+ * @param authorization An object containing your username and webApiKey.
8
+ * This can be constructed with `buildAuthorization()`.
9
+ *
10
+ * @param payload.gameId The unique game ID. If you are unsure, open the
11
+ * game's page on the RetroAchievements.org website. For example, Dragster's
12
+ * URL is https://retroachievements.org/game/14402. We can see from the
13
+ * URL that the game ID is "14402".
14
+ *
15
+ * @param payload.hardcore Optional. If set to true, the player sampling
16
+ * for median calculations will prefer players based on their hardcore
17
+ * unlock count rather than their total unlock count.
18
+ *
19
+ * @example
20
+ * ```
21
+ * const game = await getGameProgression(
22
+ * authorization,
23
+ * { gameId: 14402, hardcore: true }
24
+ * );
25
+ * ```
26
+ *
27
+ * @returns An object containing information about the average time to unlock achievements in a game.
28
+ * ```json
29
+ * {
30
+ * "id": 228,
31
+ * "title": "Super Mario World",
32
+ * "consoleId": 3,
33
+ * "consoleName": "SNES/Super Famicom",
34
+ * "imageIcon": "/Images/112443.png",
35
+ * "numDistinctPlayers": 79281,
36
+ * "timesUsedInBeatMedian": 4493,
37
+ * "timesUsedInHardcoreBeatMedian": 8249,
38
+ * "medianTimeToBeat": 17878,
39
+ * "medianTimeToBeatHardcore": 19224,
40
+ * "timesUsedInCompletionMedian": 155,
41
+ * "timesUsedInMasteryMedian": 1091,
42
+ * "medianTimeToComplete": 67017,
43
+ * "medianTimeToMaster": 79744,
44
+ * "numAchievements": 89,
45
+ * "achievements": [
46
+ * {
47
+ * "id": 342,
48
+ * "title": "Giddy Up!",
49
+ * "description": "Catch a ride with a friend",
50
+ * "points": 1,
51
+ * "trueRatio": 1,
52
+ * "type": null,
53
+ * "badgeName": "46580",
54
+ * "numAwarded": 75168,
55
+ * "numAwardedHardcore": 37024,
56
+ * "timesUsedInUnlockMedian": 63,
57
+ * "timesUsedInHardcoreUnlockMedian": 69,
58
+ * "medianTimeToUnlock": 274,
59
+ * "medianTimeToUnlockHardcore": 323
60
+ * },
61
+ * {
62
+ * "id": 341,
63
+ * "title": "Unleash The Dragon",
64
+ * "description": "Collect 5 Dragon Coins in a level",
65
+ * "points": 2,
66
+ * "trueRatio": 2,
67
+ * "type": null,
68
+ * "badgeName": "46591",
69
+ * "numAwarded": 66647,
70
+ * "numAwardedHardcore": 34051,
71
+ * "timesUsedInUnlockMedian": 66,
72
+ * "timesUsedInHardcoreUnlockMedian": 70,
73
+ * "medianTimeToUnlock": 290,
74
+ * "medianTimeToUnlockHardcore": 333
75
+ * }
76
+ * ]
77
+ * }
78
+ * ```
79
+ */
80
+ export declare const getGameProgression: (authorization: AuthObject, payload: {
81
+ gameId: ID;
82
+ hardcore?: boolean;
83
+ }) => Promise<GameProgression>;
@@ -0,0 +1 @@
1
+ export {};
@@ -3,6 +3,7 @@ export * from "./getAchievementDistribution";
3
3
  export * from "./getGame";
4
4
  export * from "./getGameExtended";
5
5
  export * from "./getGameHashes";
6
+ export * from "./getGameProgression";
6
7
  export * from "./getGameRankAndScore";
7
8
  export * from "./getGameRating";
8
9
  export * from "./models";
@@ -0,0 +1,32 @@
1
+ export interface GameProgression {
2
+ id: number;
3
+ title: string;
4
+ consoleId: number;
5
+ consoleName: string;
6
+ imageIcon: string;
7
+ numDistinctPlayers: number;
8
+ timesUsedInBeatMedian: number;
9
+ timesUsedInHardcoreBeatMedian: number;
10
+ medianTimeToBeat: number | null;
11
+ medianTimeToBeatHardcore: number | null;
12
+ timesUsedInCompletionMedian: number;
13
+ timesUsedInMasteryMedian: number;
14
+ medianTimeToComplete: number | null;
15
+ medianTimeToMaster: number | null;
16
+ numAchievements: number;
17
+ achievements: Array<{
18
+ id: number;
19
+ title: string;
20
+ description: string;
21
+ points: number;
22
+ trueRatio: number;
23
+ type: string | null;
24
+ badgeName: string;
25
+ numAwarded: number;
26
+ numAwardedHardcore: number;
27
+ timesUsedInUnlockMedian: number;
28
+ timesUsedInHardcoreUnlockMedian: number;
29
+ medianTimeToUnlock: number;
30
+ medianTimeToUnlockHardcore: number;
31
+ }>;
32
+ }
@@ -0,0 +1,32 @@
1
+ export interface GetGameProgressionResponse {
2
+ ID: number;
3
+ Title: string;
4
+ ConsoleID: number;
5
+ ConsoleName: string;
6
+ ImageIcon: string;
7
+ NumDistinctPlayers: number;
8
+ TimesUsedInBeatMedian: number;
9
+ TimesUsedInHardcoreBeatMedian: number;
10
+ MedianTimeToBeat: number | null;
11
+ MedianTimeToBeatHardcore: number | null;
12
+ TimesUsedInCompletionMedian: number;
13
+ TimesUsedInMasteryMedian: number;
14
+ MedianTimeToComplete: number | null;
15
+ MedianTimeToMaster: number | null;
16
+ NumAchievements: number;
17
+ Achievements: Array<{
18
+ ID: number;
19
+ Title: string;
20
+ Description: string;
21
+ Points: number;
22
+ TrueRatio: number;
23
+ Type: string | null;
24
+ BadgeName: string;
25
+ NumAwarded: number;
26
+ NumAwardedHardcore: number;
27
+ TimesUsedInUnlockMedian: number;
28
+ TimesUsedInHardcoreUnlockMedian: number;
29
+ MedianTimeToUnlock: number;
30
+ MedianTimeToUnlockHardcore: number;
31
+ }>;
32
+ }
@@ -5,12 +5,14 @@ export * from "./game-extended.model";
5
5
  export * from "./game-extended-achievement-entity.model";
6
6
  export * from "./game-extended-claim-entity.model";
7
7
  export * from "./game-hashes.model";
8
+ export * from "./game-progression.model";
8
9
  export * from "./game-rank-and-score-entity.model";
9
10
  export * from "./game-rating.model";
10
11
  export * from "./get-achievement-count-response.model";
11
12
  export * from "./get-achievement-distribution-response.model";
12
13
  export * from "./get-game-extended-response.model";
13
14
  export * from "./get-game-hashes-response.model";
15
+ export * from "./get-game-progression-response.model";
14
16
  export * from "./get-game-rank-and-score-response.model";
15
17
  export * from "./get-game-rating-response.model";
16
18
  export * from "./get-game-response.model";
@@ -48,7 +48,7 @@ import type { UserGameLeaderboards } from "./models";
48
48
  */
49
49
  export declare const getUserGameLeaderboards: (authorization: AuthObject, payload: {
50
50
  gameId: ID;
51
- username?: string;
51
+ username: string;
52
52
  offset?: number;
53
53
  count?: number;
54
54
  }) => Promise<UserGameLeaderboards>;
@@ -1,2 +1,3 @@
1
1
  export * from "./getLeaderboardEntries";
2
+ export * from "./getUserGameLeaderboards";
2
3
  export * from "./models";
@@ -0,0 +1,46 @@
1
+ import type { AuthObject } from "../utils/public";
2
+ import type { UsersIFollow } from "./models";
3
+ /**
4
+ * A call to this function will retrieve the list of users that the
5
+ * caller is following.
6
+ *
7
+ * @param authorization An object containing your username and webApiKey.
8
+ * This can be constructed with `buildAuthorization()`.
9
+ *
10
+ * @param payload.offset The number of entries to skip. The API will default
11
+ * to 0 if the parameter is not specified.
12
+ *
13
+ * @param payload.count The number of entries to return. The API will
14
+ * default to 100 if the parameter is not specified. The max number
15
+ * of entries that can be returned is 500.
16
+ *
17
+ * @example
18
+ * ```
19
+ * const usersIFollow = await getUsersIFollow(authorization);
20
+ * ```
21
+ *
22
+ * @returns An object containing a list of users that the caller is
23
+ * following.
24
+ * ```json
25
+ * {
26
+ * "count": 1,
27
+ * "total": 1,
28
+ * "results": [
29
+ * {
30
+ * "user": "Example",
31
+ * "ulid": "0123456789ABCDEFGHIJKLMNO",
32
+ * "points": 9001,
33
+ * "pointsSoftcore": 101,
34
+ * "isFollowingMe": false
35
+ * }
36
+ * ]
37
+ * }
38
+ * ```
39
+ *
40
+ * @throws If the API was given invalid parameters (422) or if the
41
+ * API is currently down (503).
42
+ */
43
+ export declare const getUsersIFollow: (authorization: AuthObject, payload?: {
44
+ offset?: number;
45
+ count?: number;
46
+ }) => Promise<UsersIFollow>;
@@ -0,0 +1 @@
1
+ export {};
@@ -11,6 +11,7 @@ export * from "./getUserProfile";
11
11
  export * from "./getUserProgress";
12
12
  export * from "./getUserRecentAchievements";
13
13
  export * from "./getUserRecentlyPlayedGames";
14
+ export * from "./getUsersIFollow";
14
15
  export * from "./getUserSummary";
15
16
  export * from "./getUserWantToPlayList";
16
17
  export * from "./models";
@@ -0,0 +1,11 @@
1
+ export interface GetUsersIFollowResponse {
2
+ Count: number;
3
+ Total: number;
4
+ Results: Array<{
5
+ User: string;
6
+ ULID: string;
7
+ Points: number;
8
+ PointsSoftcore: number;
9
+ IsFollowingMe: boolean;
10
+ }>;
11
+ }
@@ -14,6 +14,7 @@ export * from "./get-user-recent-achievements-response.model";
14
14
  export * from "./get-user-recently-played-games-response.model";
15
15
  export * from "./get-user-summary-response.model";
16
16
  export * from "./get-user-want-to-play-list-response.model";
17
+ export * from "./get-users-i-follow-response.model";
17
18
  export * from "./user-awards.model";
18
19
  export * from "./user-claims.model";
19
20
  export * from "./user-claims-response.model";
@@ -28,3 +29,4 @@ export * from "./user-recent-achievement.model";
28
29
  export * from "./user-recently-played-games.model";
29
30
  export * from "./user-summary.model";
30
31
  export * from "./user-want-to-play-list.model";
32
+ export * from "./users-i-follow.model";
@@ -0,0 +1,11 @@
1
+ export interface UsersIFollow {
2
+ count: number;
3
+ total: number;
4
+ results: Array<{
5
+ user: string;
6
+ ulid: string;
7
+ points: number;
8
+ pointsSoftcore: number;
9
+ isFollowingMe: boolean;
10
+ }>;
11
+ }
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "raweb",
11
11
  "retro gaming"
12
12
  ],
13
- "version": "2.7.0",
13
+ "version": "2.9.0",
14
14
  "typings": "dist/index.d.ts",
15
15
  "exports": {
16
16
  ".": {
@@ -0,0 +1,114 @@
1
+ /* eslint-disable sonarjs/no-duplicate-string */
2
+
3
+ import { http, HttpResponse } from "msw";
4
+ import { setupServer } from "msw/node";
5
+
6
+ import { apiBaseUrl } from "../utils/internal";
7
+ import { buildAuthorization } from "../utils/public";
8
+ import { getGameProgression } from "./getGameProgression";
9
+ import type { GetGameProgressionResponse } from "./models";
10
+
11
+ const server = setupServer();
12
+
13
+ describe("Function: getGameProgression", () => {
14
+ // MSW Setup
15
+ beforeAll(() => server.listen());
16
+ afterEach(() => server.resetHandlers());
17
+ afterAll(() => server.close());
18
+
19
+ it("is defined #sanity", () => {
20
+ // ASSERT
21
+ expect(getGameProgression).toBeDefined();
22
+ });
23
+
24
+ it("given a game ID, retrieves information about the average time to unlock achievements in a game", async () => {
25
+ // ARRANGE
26
+ const authorization = buildAuthorization({
27
+ username: "mockUserName",
28
+ webApiKey: "mockWebApiKey",
29
+ });
30
+
31
+ const mockResponse: GetGameProgressionResponse = {
32
+ ID: 228,
33
+ Title: "Super Mario World",
34
+ ConsoleID: 3,
35
+ ConsoleName: "SNES/Super Famicom",
36
+ ImageIcon: "/Images/112443.png",
37
+ NumDistinctPlayers: 79_281,
38
+ TimesUsedInBeatMedian: 4493,
39
+ TimesUsedInHardcoreBeatMedian: 8249,
40
+ MedianTimeToBeat: 17_878,
41
+ MedianTimeToBeatHardcore: 19_224,
42
+ TimesUsedInCompletionMedian: 155,
43
+ TimesUsedInMasteryMedian: 1091,
44
+ MedianTimeToComplete: 67_017,
45
+ MedianTimeToMaster: 79_744,
46
+ NumAchievements: 89,
47
+ Achievements: [
48
+ {
49
+ ID: 342,
50
+ Title: "Giddy Up!",
51
+ Description: "Catch a ride with a friend",
52
+ Points: 1,
53
+ TrueRatio: 1,
54
+ Type: null,
55
+ BadgeName: "46580",
56
+ NumAwarded: 75_168,
57
+ NumAwardedHardcore: 37_024,
58
+ TimesUsedInUnlockMedian: 63,
59
+ TimesUsedInHardcoreUnlockMedian: 69,
60
+ MedianTimeToUnlock: 274,
61
+ MedianTimeToUnlockHardcore: 323,
62
+ },
63
+ ],
64
+ };
65
+
66
+ server.use(
67
+ http.get(`${apiBaseUrl}/API_GetGameProgression.php`, () =>
68
+ HttpResponse.json(mockResponse)
69
+ )
70
+ );
71
+
72
+ // ACT
73
+ const response = await getGameProgression(authorization, {
74
+ gameId: 104_370,
75
+ hardcore: true,
76
+ });
77
+
78
+ // ASSERT
79
+ expect(response).toEqual({
80
+ id: 228,
81
+ title: "Super Mario World",
82
+ consoleId: 3,
83
+ consoleName: "SNES/Super Famicom",
84
+ imageIcon: "/Images/112443.png",
85
+ numDistinctPlayers: 79_281,
86
+ timesUsedInBeatMedian: 4493,
87
+ timesUsedInHardcoreBeatMedian: 8249,
88
+ medianTimeToBeat: 17_878,
89
+ medianTimeToBeatHardcore: 19_224,
90
+ timesUsedInCompletionMedian: 155,
91
+ timesUsedInMasteryMedian: 1091,
92
+ medianTimeToComplete: 67_017,
93
+ medianTimeToMaster: 79_744,
94
+ numAchievements: 89,
95
+ achievements: [
96
+ {
97
+ id: 342,
98
+ title: "Giddy Up!",
99
+ description: "Catch a ride with a friend",
100
+ points: 1,
101
+ trueRatio: 1,
102
+ type: null,
103
+ badgeName: "46580",
104
+ numAwarded: 75_168,
105
+ numAwardedHardcore: 37_024,
106
+ timesUsedInUnlockMedian: 63,
107
+ timesUsedInHardcoreUnlockMedian: 69,
108
+ medianTimeToUnlock: 274,
109
+ medianTimeToUnlockHardcore: 323,
110
+ },
111
+ ],
112
+ });
113
+ });
114
+ });
@@ -0,0 +1,112 @@
1
+ import type { ID } from "../utils/internal";
2
+ import {
3
+ apiBaseUrl,
4
+ buildRequestUrl,
5
+ call,
6
+ serializeProperties,
7
+ } from "../utils/internal";
8
+ import type { AuthObject } from "../utils/public";
9
+ import type { GameProgression, GetGameProgressionResponse } from "./models";
10
+
11
+ /**
12
+ * A call to this function will retrieve information about the average time to unlock achievements in a game.
13
+ *
14
+ * @param authorization An object containing your username and webApiKey.
15
+ * This can be constructed with `buildAuthorization()`.
16
+ *
17
+ * @param payload.gameId The unique game ID. If you are unsure, open the
18
+ * game's page on the RetroAchievements.org website. For example, Dragster's
19
+ * URL is https://retroachievements.org/game/14402. We can see from the
20
+ * URL that the game ID is "14402".
21
+ *
22
+ * @param payload.hardcore Optional. If set to true, the player sampling
23
+ * for median calculations will prefer players based on their hardcore
24
+ * unlock count rather than their total unlock count.
25
+ *
26
+ * @example
27
+ * ```
28
+ * const game = await getGameProgression(
29
+ * authorization,
30
+ * { gameId: 14402, hardcore: true }
31
+ * );
32
+ * ```
33
+ *
34
+ * @returns An object containing information about the average time to unlock achievements in a game.
35
+ * ```json
36
+ * {
37
+ * "id": 228,
38
+ * "title": "Super Mario World",
39
+ * "consoleId": 3,
40
+ * "consoleName": "SNES/Super Famicom",
41
+ * "imageIcon": "/Images/112443.png",
42
+ * "numDistinctPlayers": 79281,
43
+ * "timesUsedInBeatMedian": 4493,
44
+ * "timesUsedInHardcoreBeatMedian": 8249,
45
+ * "medianTimeToBeat": 17878,
46
+ * "medianTimeToBeatHardcore": 19224,
47
+ * "timesUsedInCompletionMedian": 155,
48
+ * "timesUsedInMasteryMedian": 1091,
49
+ * "medianTimeToComplete": 67017,
50
+ * "medianTimeToMaster": 79744,
51
+ * "numAchievements": 89,
52
+ * "achievements": [
53
+ * {
54
+ * "id": 342,
55
+ * "title": "Giddy Up!",
56
+ * "description": "Catch a ride with a friend",
57
+ * "points": 1,
58
+ * "trueRatio": 1,
59
+ * "type": null,
60
+ * "badgeName": "46580",
61
+ * "numAwarded": 75168,
62
+ * "numAwardedHardcore": 37024,
63
+ * "timesUsedInUnlockMedian": 63,
64
+ * "timesUsedInHardcoreUnlockMedian": 69,
65
+ * "medianTimeToUnlock": 274,
66
+ * "medianTimeToUnlockHardcore": 323
67
+ * },
68
+ * {
69
+ * "id": 341,
70
+ * "title": "Unleash The Dragon",
71
+ * "description": "Collect 5 Dragon Coins in a level",
72
+ * "points": 2,
73
+ * "trueRatio": 2,
74
+ * "type": null,
75
+ * "badgeName": "46591",
76
+ * "numAwarded": 66647,
77
+ * "numAwardedHardcore": 34051,
78
+ * "timesUsedInUnlockMedian": 66,
79
+ * "timesUsedInHardcoreUnlockMedian": 70,
80
+ * "medianTimeToUnlock": 290,
81
+ * "medianTimeToUnlockHardcore": 333
82
+ * }
83
+ * ]
84
+ * }
85
+ * ```
86
+ */
87
+ export const getGameProgression = async (
88
+ authorization: AuthObject,
89
+ payload: {
90
+ gameId: ID;
91
+ hardcore?: boolean;
92
+ }
93
+ ): Promise<GameProgression> => {
94
+ const { gameId, hardcore } = payload;
95
+
96
+ const queryParams: Record<string, any> = { i: gameId };
97
+
98
+ if (hardcore !== undefined) {
99
+ queryParams["h"] = hardcore === true ? 1 : 0;
100
+ }
101
+
102
+ const url = buildRequestUrl(
103
+ apiBaseUrl,
104
+ "/API_GetGameProgression.php",
105
+ authorization,
106
+ queryParams
107
+ );
108
+
109
+ const rawResponse = await call<GetGameProgressionResponse>({ url });
110
+
111
+ return serializeProperties(rawResponse);
112
+ };
package/src/game/index.ts CHANGED
@@ -3,6 +3,7 @@ export * from "./getAchievementDistribution";
3
3
  export * from "./getGame";
4
4
  export * from "./getGameExtended";
5
5
  export * from "./getGameHashes";
6
+ export * from "./getGameProgression";
6
7
  export * from "./getGameRankAndScore";
7
8
  export * from "./getGameRating";
8
9
  export * from "./models";
@@ -0,0 +1,32 @@
1
+ export interface GameProgression {
2
+ id: number;
3
+ title: string;
4
+ consoleId: number;
5
+ consoleName: string;
6
+ imageIcon: string;
7
+ numDistinctPlayers: number;
8
+ timesUsedInBeatMedian: number;
9
+ timesUsedInHardcoreBeatMedian: number;
10
+ medianTimeToBeat: number | null;
11
+ medianTimeToBeatHardcore: number | null;
12
+ timesUsedInCompletionMedian: number;
13
+ timesUsedInMasteryMedian: number;
14
+ medianTimeToComplete: number | null;
15
+ medianTimeToMaster: number | null;
16
+ numAchievements: number;
17
+ achievements: Array<{
18
+ id: number;
19
+ title: string;
20
+ description: string;
21
+ points: number;
22
+ trueRatio: number;
23
+ type: string | null;
24
+ badgeName: string;
25
+ numAwarded: number;
26
+ numAwardedHardcore: number;
27
+ timesUsedInUnlockMedian: number;
28
+ timesUsedInHardcoreUnlockMedian: number;
29
+ medianTimeToUnlock: number;
30
+ medianTimeToUnlockHardcore: number;
31
+ }>;
32
+ }
@@ -0,0 +1,32 @@
1
+ export interface GetGameProgressionResponse {
2
+ ID: number;
3
+ Title: string;
4
+ ConsoleID: number;
5
+ ConsoleName: string;
6
+ ImageIcon: string;
7
+ NumDistinctPlayers: number;
8
+ TimesUsedInBeatMedian: number;
9
+ TimesUsedInHardcoreBeatMedian: number;
10
+ MedianTimeToBeat: number | null;
11
+ MedianTimeToBeatHardcore: number | null;
12
+ TimesUsedInCompletionMedian: number;
13
+ TimesUsedInMasteryMedian: number;
14
+ MedianTimeToComplete: number | null;
15
+ MedianTimeToMaster: number | null;
16
+ NumAchievements: number;
17
+ Achievements: Array<{
18
+ ID: number;
19
+ Title: string;
20
+ Description: string;
21
+ Points: number;
22
+ TrueRatio: number;
23
+ Type: string | null;
24
+ BadgeName: string;
25
+ NumAwarded: number;
26
+ NumAwardedHardcore: number;
27
+ TimesUsedInUnlockMedian: number;
28
+ TimesUsedInHardcoreUnlockMedian: number;
29
+ MedianTimeToUnlock: number;
30
+ MedianTimeToUnlockHardcore: number;
31
+ }>;
32
+ }
@@ -5,12 +5,14 @@ export * from "./game-extended.model";
5
5
  export * from "./game-extended-achievement-entity.model";
6
6
  export * from "./game-extended-claim-entity.model";
7
7
  export * from "./game-hashes.model";
8
+ export * from "./game-progression.model";
8
9
  export * from "./game-rank-and-score-entity.model";
9
10
  export * from "./game-rating.model";
10
11
  export * from "./get-achievement-count-response.model";
11
12
  export * from "./get-achievement-distribution-response.model";
12
13
  export * from "./get-game-extended-response.model";
13
14
  export * from "./get-game-hashes-response.model";
15
+ export * from "./get-game-progression-response.model";
14
16
  export * from "./get-game-rank-and-score-response.model";
15
17
  export * from "./get-game-rating-response.model";
16
18
  export * from "./get-game-response.model";
@@ -58,13 +58,11 @@ import type {
58
58
  */
59
59
  export const getUserGameLeaderboards = async (
60
60
  authorization: AuthObject,
61
- payload: { gameId: ID; username?: string; offset?: number; count?: number }
61
+ payload: { gameId: ID; username: string; offset?: number; count?: number }
62
62
  ): Promise<UserGameLeaderboards> => {
63
63
  const queryParams: Record<string, any> = {};
64
64
  queryParams.i = payload.gameId;
65
- if (payload?.username) {
66
- queryParams.u = payload.username;
67
- }
65
+ queryParams.u = payload.username;
68
66
  if (payload?.offset) {
69
67
  queryParams.o = payload.offset;
70
68
  }
@@ -1,2 +1,3 @@
1
1
  export * from "./getLeaderboardEntries";
2
+ export * from "./getUserGameLeaderboards";
2
3
  export * from "./models";