@retroachievements/api 1.3.0 → 1.4.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.
- package/README.md +2 -13
- package/dist/api.cjs +1 -1
- package/dist/api.cjs.map +1 -1
- package/dist/api.modern.js +1 -1
- package/dist/api.modern.js.map +1 -1
- package/dist/api.module.js +1 -1
- package/dist/api.module.js.map +1 -1
- package/dist/api.umd.js +1 -1
- package/dist/api.umd.js.map +1 -1
- package/dist/game/getGame.d.ts +1 -1
- package/dist/game/getGameExtended.d.ts +2 -1
- package/dist/game/models/game-extended.model.d.ts +1 -1
- package/dist/game/models/game.model.d.ts +1 -1
- package/dist/user/getUserCompletionProgress.d.ts +51 -0
- package/dist/user/getUserCompletionProgress.test.d.ts +1 -0
- package/dist/user/getUserProfile.d.ts +24 -0
- package/dist/user/getUserProfile.test.d.ts +1 -0
- package/dist/user/index.d.ts +2 -0
- package/dist/user/models/get-user-completion-progress-response.model.d.ts +19 -0
- package/dist/user/models/get-user-profile-response.model.d.ts +17 -0
- package/dist/user/models/index.d.ts +5 -0
- package/dist/user/models/user-completion-progress-entity.model.d.ts +13 -0
- package/dist/user/models/user-completion-progress.model.d.ts +6 -0
- package/dist/user/models/user-profile.model.d.ts +17 -0
- package/package.json +1 -1
- package/src/game/getGame.test.ts +1 -1
- package/src/game/getGame.ts +2 -8
- package/src/game/getGameExtended.test.ts +1 -1
- package/src/game/getGameExtended.ts +13 -8
- package/src/game/models/game-extended.model.ts +1 -1
- package/src/game/models/game.model.ts +1 -1
- package/src/user/getUserCompletionProgress.test.ts +81 -0
- package/src/user/getUserCompletionProgress.ts +83 -0
- package/src/user/getUserProfile.test.ts +79 -0
- package/src/user/getUserProfile.ts +55 -0
- package/src/user/index.ts +2 -0
- package/src/user/models/get-user-completion-progress-response.model.ts +25 -0
- package/src/user/models/get-user-profile-response.model.ts +17 -0
- package/src/user/models/index.ts +5 -0
- package/src/user/models/user-completion-progress-entity.model.ts +19 -0
- package/src/user/models/user-completion-progress.model.ts +7 -0
- package/src/user/models/user-profile.model.ts +17 -0
|
@@ -5,8 +5,10 @@ export * from "./game-info-and-user-progress.model";
|
|
|
5
5
|
export * from "./get-game-info-and-user-progress-response.model";
|
|
6
6
|
export * from "./get-user-awards-response.model";
|
|
7
7
|
export * from "./get-user-completed-games-response.model";
|
|
8
|
+
export * from "./get-user-completion-progress-response.model";
|
|
8
9
|
export * from "./get-user-game-rank-and-score-response.model";
|
|
9
10
|
export * from "./get-user-points-response.model";
|
|
11
|
+
export * from "./get-user-profile-response.model";
|
|
10
12
|
export * from "./get-user-progress-response.model";
|
|
11
13
|
export * from "./get-user-recent-achievements-response.model";
|
|
12
14
|
export * from "./get-user-recently-played-games-response.model";
|
|
@@ -15,8 +17,11 @@ export * from "./user-awards.model";
|
|
|
15
17
|
export * from "./user-claims.model";
|
|
16
18
|
export * from "./user-claims-response.model";
|
|
17
19
|
export * from "./user-completed-games.model";
|
|
20
|
+
export * from "./user-completion-progress.model";
|
|
21
|
+
export * from "./user-completion-progress-entity.model";
|
|
18
22
|
export * from "./user-game-rank-and-score.model";
|
|
19
23
|
export * from "./user-points.model";
|
|
24
|
+
export * from "./user-profile.model";
|
|
20
25
|
export * from "./user-progress.model";
|
|
21
26
|
export * from "./user-recent-achievement.model";
|
|
22
27
|
export * from "./user-recently-played-games.model";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface UserCompletionProgressEntity {
|
|
2
|
+
gameId: number;
|
|
3
|
+
title: string;
|
|
4
|
+
imageIcon: string;
|
|
5
|
+
consoleId: number;
|
|
6
|
+
consoleName: string;
|
|
7
|
+
maxPossible: number;
|
|
8
|
+
numAwarded: number;
|
|
9
|
+
numAwardedHardcore: number;
|
|
10
|
+
mostRecentAwardedDate?: string;
|
|
11
|
+
highestAwardKind?: "mastered" | "completed" | "beaten-hardcore" | "beaten-softcore" | null;
|
|
12
|
+
highestAwardDate?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface UserProfile {
|
|
2
|
+
user: string;
|
|
3
|
+
userPic: string;
|
|
4
|
+
memberSince: string;
|
|
5
|
+
richPresenceMsg: string;
|
|
6
|
+
lastGameId: number;
|
|
7
|
+
contribCount: number;
|
|
8
|
+
contribYield: number;
|
|
9
|
+
totalPoints: number;
|
|
10
|
+
totalSoftcorePoints: number;
|
|
11
|
+
totalTruePoints: number;
|
|
12
|
+
permissions: number;
|
|
13
|
+
untracked: boolean;
|
|
14
|
+
id: number;
|
|
15
|
+
userWallActive: boolean;
|
|
16
|
+
motto: string;
|
|
17
|
+
}
|
package/package.json
CHANGED
package/src/game/getGame.test.ts
CHANGED
package/src/game/getGame.ts
CHANGED
|
@@ -45,7 +45,7 @@ import type { Game, GetGameResponse } from "./models";
|
|
|
45
45
|
* publisher: "Activision",
|
|
46
46
|
* developer: "David Crane",
|
|
47
47
|
* genre: "Racing",
|
|
48
|
-
* released: 1980,
|
|
48
|
+
* released: "1980",
|
|
49
49
|
* gameTitle: "Dragster",
|
|
50
50
|
* console: "Atari 2600"
|
|
51
51
|
* }
|
|
@@ -64,12 +64,6 @@ export const getGame = async (
|
|
|
64
64
|
const rawResponse = await call<GetGameResponse>({ url });
|
|
65
65
|
|
|
66
66
|
return serializeProperties(rawResponse, {
|
|
67
|
-
shouldCastToNumbers: [
|
|
68
|
-
"ID",
|
|
69
|
-
"ForumTopicID",
|
|
70
|
-
"ConsoleID",
|
|
71
|
-
"Flags",
|
|
72
|
-
"Released"
|
|
73
|
-
]
|
|
67
|
+
shouldCastToNumbers: ["ID", "ForumTopicID", "ConsoleID", "Flags"]
|
|
74
68
|
});
|
|
75
69
|
};
|
|
@@ -91,7 +91,7 @@ describe("Function: getGameExtended", () => {
|
|
|
91
91
|
publisher: "Activision ",
|
|
92
92
|
developer: "David Crane",
|
|
93
93
|
genre: "Racing",
|
|
94
|
-
released: 1980,
|
|
94
|
+
released: "1980",
|
|
95
95
|
isFinal: false,
|
|
96
96
|
consoleName: "Atari 2600",
|
|
97
97
|
richPresencePatch: "2b92fa1bf9635c303b3b7f8feea3ed3c",
|
|
@@ -43,7 +43,7 @@ import type { GameExtended, GetGameExtendedResponse } from "./models";
|
|
|
43
43
|
* publisher: "Activision",
|
|
44
44
|
* developer: "David Crane",
|
|
45
45
|
* genre: "Racing",
|
|
46
|
-
* released: 1980,
|
|
46
|
+
* released: "1980",
|
|
47
47
|
* isFinal: false,
|
|
48
48
|
* consoleName: "Atari 2600",
|
|
49
49
|
* richPresencePatch: "2b92fa1bf9635c303b3b7f8feea3ed3c",
|
|
@@ -73,17 +73,23 @@ import type { GameExtended, GetGameExtendedResponse } from "./models";
|
|
|
73
73
|
*/
|
|
74
74
|
export const getGameExtended = async (
|
|
75
75
|
authorization: AuthObject,
|
|
76
|
-
payload: { gameId: ID }
|
|
76
|
+
payload: { gameId: ID; isRequestingUnofficialAchievements: boolean }
|
|
77
77
|
): Promise<GameExtended> => {
|
|
78
|
-
const { gameId } = payload;
|
|
78
|
+
const { gameId, isRequestingUnofficialAchievements } = payload;
|
|
79
|
+
|
|
80
|
+
const params: Record<string, string | number> = {
|
|
81
|
+
i: gameId
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
if (isRequestingUnofficialAchievements) {
|
|
85
|
+
params["f"] = 5;
|
|
86
|
+
}
|
|
79
87
|
|
|
80
88
|
const url = buildRequestUrl(
|
|
81
89
|
apiBaseUrl,
|
|
82
90
|
"/API_GetGameExtended.php",
|
|
83
91
|
authorization,
|
|
84
|
-
|
|
85
|
-
i: gameId
|
|
86
|
-
}
|
|
92
|
+
params
|
|
87
93
|
);
|
|
88
94
|
|
|
89
95
|
const rawResponse = await call<GetGameExtendedResponse>({ url });
|
|
@@ -97,8 +103,7 @@ export const getGameExtended = async (
|
|
|
97
103
|
"TrueRatio",
|
|
98
104
|
"DisplayOrder",
|
|
99
105
|
"NumDistinctPlayersCasual",
|
|
100
|
-
"NumDistinctPlayersHardcore"
|
|
101
|
-
"Released"
|
|
106
|
+
"NumDistinctPlayersHardcore"
|
|
102
107
|
]
|
|
103
108
|
});
|
|
104
109
|
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { http, HttpResponse } from "msw";
|
|
2
|
+
import { setupServer } from "msw/node";
|
|
3
|
+
|
|
4
|
+
import { apiBaseUrl } from "../utils/internal";
|
|
5
|
+
import { buildAuthorization } from "../utils/public";
|
|
6
|
+
import { getUserCompletionProgress } from "./getUserCompletionProgress";
|
|
7
|
+
import type { GetUserCompletionProgressResponse } from "./models";
|
|
8
|
+
|
|
9
|
+
const server = setupServer();
|
|
10
|
+
|
|
11
|
+
describe("Function: getUserCompletionProgress", () => {
|
|
12
|
+
// MSW Setup
|
|
13
|
+
beforeAll(() => server.listen());
|
|
14
|
+
afterEach(() => server.resetHandlers());
|
|
15
|
+
afterAll(() => server.close());
|
|
16
|
+
|
|
17
|
+
it("is defined #sanity", () => {
|
|
18
|
+
// ASSERT
|
|
19
|
+
expect(getUserCompletionProgress).toBeDefined();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("retrieves completion progress by username", async () => {
|
|
23
|
+
// ARRANGE
|
|
24
|
+
const authorization = buildAuthorization({
|
|
25
|
+
userName: "mockUserName",
|
|
26
|
+
webApiKey: "mockWebApiKey"
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const mockResponse: GetUserCompletionProgressResponse = {
|
|
30
|
+
Count: 1,
|
|
31
|
+
Total: 1,
|
|
32
|
+
Results: [
|
|
33
|
+
{
|
|
34
|
+
GameID: 680,
|
|
35
|
+
Title: "Game & Watch Gallery",
|
|
36
|
+
ImageIcon: "/Images/042952.png",
|
|
37
|
+
ConsoleID: 4,
|
|
38
|
+
ConsoleName: "Game Boy",
|
|
39
|
+
MaxPossible: 27,
|
|
40
|
+
NumAwarded: 8,
|
|
41
|
+
NumAwardedHardcore: 8,
|
|
42
|
+
MostRecentAwardedDate: "2022-07-26T23:56:15+00:00",
|
|
43
|
+
HighestAwardKind: null,
|
|
44
|
+
HighestAwardDate: null
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
server.use(
|
|
50
|
+
http.get(`${apiBaseUrl}/API_GetUserCompletionProgress.php`, () =>
|
|
51
|
+
HttpResponse.json(mockResponse)
|
|
52
|
+
)
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
// ACT
|
|
56
|
+
const response = await getUserCompletionProgress(authorization, {
|
|
57
|
+
userName: "xelnia"
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// ASSERT
|
|
61
|
+
expect(response).toEqual({
|
|
62
|
+
count: 1,
|
|
63
|
+
total: 1,
|
|
64
|
+
results: [
|
|
65
|
+
{
|
|
66
|
+
gameId: 680,
|
|
67
|
+
title: "Game & Watch Gallery",
|
|
68
|
+
imageIcon: "/Images/042952.png",
|
|
69
|
+
consoleId: 4,
|
|
70
|
+
consoleName: "Game Boy",
|
|
71
|
+
maxPossible: 27,
|
|
72
|
+
numAwarded: 8,
|
|
73
|
+
numAwardedHardcore: 8,
|
|
74
|
+
mostRecentAwardedDate: "2022-07-26T23:56:15+00:00",
|
|
75
|
+
highestAwardKind: null,
|
|
76
|
+
highestAwardDate: null
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import {
|
|
2
|
+
apiBaseUrl,
|
|
3
|
+
buildRequestUrl,
|
|
4
|
+
call,
|
|
5
|
+
serializeProperties
|
|
6
|
+
} from "../utils/internal";
|
|
7
|
+
import type { AuthObject } from "../utils/public";
|
|
8
|
+
import type {
|
|
9
|
+
GetUserCompletionProgressResponse,
|
|
10
|
+
UserCompletionProgress
|
|
11
|
+
} from "./models";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A call to this function will retrieve a given user's completion
|
|
15
|
+
* progress, targeted by their username.
|
|
16
|
+
*
|
|
17
|
+
* @param authorization An object containing your userName and webApiKey.
|
|
18
|
+
* This can be constructed with `buildAuthorization()`.
|
|
19
|
+
*
|
|
20
|
+
* @param payload.userName The user for which to retrieve the progress for.
|
|
21
|
+
*
|
|
22
|
+
* @param payload.offset Defaults to 0. The number of entries to skip.
|
|
23
|
+
*
|
|
24
|
+
* @param payload.count Defaults to 100, has a max of 500.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```
|
|
28
|
+
* const userCompletionProgress = await getUserCompletionProgress(
|
|
29
|
+
* authorization,
|
|
30
|
+
* { userName: "xelnia" }
|
|
31
|
+
* );
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @returns
|
|
35
|
+
* ```
|
|
36
|
+
* {
|
|
37
|
+
* "count": 100,
|
|
38
|
+
* "total": 752,
|
|
39
|
+
* "results": [
|
|
40
|
+
* {
|
|
41
|
+
gameId: 11406,
|
|
42
|
+
title: 'Mortal Kombat 4',
|
|
43
|
+
imageIcon: '/Images/042133.png',
|
|
44
|
+
consoleId: 12,
|
|
45
|
+
consoleName: 'PlayStation',
|
|
46
|
+
maxPossible: 131,
|
|
47
|
+
numAwarded: 131,
|
|
48
|
+
numAwardedHardcore: 131,
|
|
49
|
+
mostRecentAwardedDate: '2022-08-07T18:24:44+00:00',
|
|
50
|
+
highestAwardKind: 'mastered',
|
|
51
|
+
highestAwardDate: '2022-08-07T18:24:44+00:00'
|
|
52
|
+
* }
|
|
53
|
+
* ]
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export const getUserCompletionProgress = async (
|
|
58
|
+
authorization: AuthObject,
|
|
59
|
+
payload: { userName: string; offset?: number; count?: number }
|
|
60
|
+
): Promise<UserCompletionProgress> => {
|
|
61
|
+
const { userName, offset, count } = payload;
|
|
62
|
+
|
|
63
|
+
const params: Record<string, string | number> = {
|
|
64
|
+
u: userName
|
|
65
|
+
};
|
|
66
|
+
if (offset) {
|
|
67
|
+
params["o"] = offset;
|
|
68
|
+
}
|
|
69
|
+
if (count) {
|
|
70
|
+
params["c"] = count;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const url = buildRequestUrl(
|
|
74
|
+
apiBaseUrl,
|
|
75
|
+
"/API_GetUserCompletionProgress.php",
|
|
76
|
+
authorization,
|
|
77
|
+
params
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
const rawResponse = await call<GetUserCompletionProgressResponse>({ url });
|
|
81
|
+
|
|
82
|
+
return serializeProperties(rawResponse);
|
|
83
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { http, HttpResponse } from "msw";
|
|
2
|
+
import { setupServer } from "msw/node";
|
|
3
|
+
|
|
4
|
+
import { apiBaseUrl } from "../utils/internal";
|
|
5
|
+
import { buildAuthorization } from "../utils/public";
|
|
6
|
+
import { getUserProfile } from "./getUserProfile";
|
|
7
|
+
import type { GetUserProfileResponse } from "./models";
|
|
8
|
+
|
|
9
|
+
const server = setupServer();
|
|
10
|
+
|
|
11
|
+
describe("Function: getUserProfile", () => {
|
|
12
|
+
// MSW Setup
|
|
13
|
+
beforeAll(() => server.listen());
|
|
14
|
+
afterEach(() => server.resetHandlers());
|
|
15
|
+
afterAll(() => server.close());
|
|
16
|
+
|
|
17
|
+
it("is defined #sanity", () => {
|
|
18
|
+
// ASSERT
|
|
19
|
+
expect(getUserProfile).toBeDefined();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("given a username, retrieves minimal user profile information about the user", async () => {
|
|
23
|
+
// ARRANGE
|
|
24
|
+
const authorization = buildAuthorization({
|
|
25
|
+
userName: "mockUserName",
|
|
26
|
+
webApiKey: "mockWebApiKey"
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const mockResponse: GetUserProfileResponse = {
|
|
30
|
+
User: "MaxMilyin",
|
|
31
|
+
UserPic: "/UserPic/MaxMilyin.png",
|
|
32
|
+
MemberSince: "2016-01-02 00:43:04",
|
|
33
|
+
RichPresenceMsg:
|
|
34
|
+
"Playing ~Hack~ 11th Annual Vanilla Level Design Contest, The",
|
|
35
|
+
LastGameID: 19_504,
|
|
36
|
+
ContribCount: 0,
|
|
37
|
+
ContribYield: 0,
|
|
38
|
+
TotalPoints: 399_597,
|
|
39
|
+
TotalSoftcorePoints: 0,
|
|
40
|
+
TotalTruePoints: 1_599_212,
|
|
41
|
+
Permissions: 1,
|
|
42
|
+
Untracked: 0,
|
|
43
|
+
ID: 16_446,
|
|
44
|
+
UserWallActive: 1,
|
|
45
|
+
Motto: "Join me on Twitch! GameSquadSquad for live RA"
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
server.use(
|
|
49
|
+
http.get(`${apiBaseUrl}/API_GetUserProfile.php`, () =>
|
|
50
|
+
HttpResponse.json(mockResponse)
|
|
51
|
+
)
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
// ACT
|
|
55
|
+
const response = await getUserProfile(authorization, {
|
|
56
|
+
userName: "WCopeland"
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// ASSERT
|
|
60
|
+
expect(response).toEqual({
|
|
61
|
+
user: "MaxMilyin",
|
|
62
|
+
userPic: "/UserPic/MaxMilyin.png",
|
|
63
|
+
memberSince: "2016-01-02 00:43:04",
|
|
64
|
+
richPresenceMsg:
|
|
65
|
+
"Playing ~Hack~ 11th Annual Vanilla Level Design Contest, The",
|
|
66
|
+
lastGameId: 19_504,
|
|
67
|
+
contribCount: 0,
|
|
68
|
+
contribYield: 0,
|
|
69
|
+
totalPoints: 399_597,
|
|
70
|
+
totalSoftcorePoints: 0,
|
|
71
|
+
totalTruePoints: 1_599_212,
|
|
72
|
+
permissions: 1,
|
|
73
|
+
untracked: false,
|
|
74
|
+
id: 16_446,
|
|
75
|
+
userWallActive: true,
|
|
76
|
+
motto: "Join me on Twitch! GameSquadSquad for live RA"
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {
|
|
2
|
+
apiBaseUrl,
|
|
3
|
+
buildRequestUrl,
|
|
4
|
+
call,
|
|
5
|
+
serializeProperties
|
|
6
|
+
} from "../utils/internal";
|
|
7
|
+
import type { AuthObject } from "../utils/public";
|
|
8
|
+
import type { GetUserProfileResponse, UserProfile } from "./models";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A call to this function will retrieve summary information about
|
|
12
|
+
* a given user, targeted by username.
|
|
13
|
+
*
|
|
14
|
+
* @param authorization An object containing your userName and webApiKey.
|
|
15
|
+
* This can be constructed with `buildAuthorization()`.
|
|
16
|
+
*
|
|
17
|
+
* @param payload.userName The user for which to retrieve the summary for.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```
|
|
21
|
+
* const userSummary = await getUserProfile(
|
|
22
|
+
* authorization,
|
|
23
|
+
* { userName: "xelnia" }
|
|
24
|
+
* );
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @returns An object containing profile summary metadata about a target user.
|
|
28
|
+
*/
|
|
29
|
+
export const getUserProfile = async (
|
|
30
|
+
authorization: AuthObject,
|
|
31
|
+
payload: {
|
|
32
|
+
userName: string;
|
|
33
|
+
}
|
|
34
|
+
): Promise<UserProfile> => {
|
|
35
|
+
const { userName } = payload;
|
|
36
|
+
|
|
37
|
+
const url = buildRequestUrl(
|
|
38
|
+
apiBaseUrl,
|
|
39
|
+
"/API_GetUserProfile.php",
|
|
40
|
+
authorization,
|
|
41
|
+
{ u: userName }
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const rawResponse = await call<GetUserProfileResponse>({ url });
|
|
45
|
+
|
|
46
|
+
return serializeProperties(rawResponse, {
|
|
47
|
+
shouldCastToNumbers: [
|
|
48
|
+
"TotalPoints",
|
|
49
|
+
"TotalSoftcorePoints",
|
|
50
|
+
"TotalTruePoints",
|
|
51
|
+
"Permissions"
|
|
52
|
+
],
|
|
53
|
+
shouldMapToBooleans: ["Untracked", "UserWallActive"]
|
|
54
|
+
});
|
|
55
|
+
};
|
package/src/user/index.ts
CHANGED
|
@@ -4,8 +4,10 @@ export * from "./getGameInfoAndUserProgress";
|
|
|
4
4
|
export * from "./getUserAwards";
|
|
5
5
|
export * from "./getUserClaims";
|
|
6
6
|
export * from "./getUserCompletedGames";
|
|
7
|
+
export * from "./getUserCompletionProgress";
|
|
7
8
|
export * from "./getUserGameRankAndScore";
|
|
8
9
|
export * from "./getUserPoints";
|
|
10
|
+
export * from "./getUserProfile";
|
|
9
11
|
export * from "./getUserProgress";
|
|
10
12
|
export * from "./getUserRecentAchievements";
|
|
11
13
|
export * from "./getUserRecentlyPlayedGames";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
interface RawUserCompletionProgressEntity {
|
|
2
|
+
GameID: number;
|
|
3
|
+
Title: string;
|
|
4
|
+
ImageIcon: string;
|
|
5
|
+
ConsoleID: number;
|
|
6
|
+
ConsoleName: string;
|
|
7
|
+
MaxPossible: number;
|
|
8
|
+
NumAwarded: number;
|
|
9
|
+
NumAwardedHardcore: number;
|
|
10
|
+
|
|
11
|
+
MostRecentAwardedDate?: string;
|
|
12
|
+
HighestAwardKind?:
|
|
13
|
+
| "mastered"
|
|
14
|
+
| "completed"
|
|
15
|
+
| "beaten-hardcore"
|
|
16
|
+
| "beaten-softcore"
|
|
17
|
+
| null;
|
|
18
|
+
HighestAwardDate?: string | null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface GetUserCompletionProgressResponse {
|
|
22
|
+
Count: number;
|
|
23
|
+
Total: number;
|
|
24
|
+
Results: RawUserCompletionProgressEntity[];
|
|
25
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface GetUserProfileResponse {
|
|
2
|
+
User: string;
|
|
3
|
+
UserPic: string;
|
|
4
|
+
MemberSince: string;
|
|
5
|
+
RichPresenceMsg: string;
|
|
6
|
+
LastGameID: number;
|
|
7
|
+
ContribCount: number;
|
|
8
|
+
ContribYield: number;
|
|
9
|
+
TotalPoints: number;
|
|
10
|
+
TotalSoftcorePoints: number;
|
|
11
|
+
TotalTruePoints: number;
|
|
12
|
+
Permissions: number;
|
|
13
|
+
Untracked: number;
|
|
14
|
+
ID: number;
|
|
15
|
+
UserWallActive: number;
|
|
16
|
+
Motto: string;
|
|
17
|
+
}
|
package/src/user/models/index.ts
CHANGED
|
@@ -5,8 +5,10 @@ export * from "./game-info-and-user-progress.model";
|
|
|
5
5
|
export * from "./get-game-info-and-user-progress-response.model";
|
|
6
6
|
export * from "./get-user-awards-response.model";
|
|
7
7
|
export * from "./get-user-completed-games-response.model";
|
|
8
|
+
export * from "./get-user-completion-progress-response.model";
|
|
8
9
|
export * from "./get-user-game-rank-and-score-response.model";
|
|
9
10
|
export * from "./get-user-points-response.model";
|
|
11
|
+
export * from "./get-user-profile-response.model";
|
|
10
12
|
export * from "./get-user-progress-response.model";
|
|
11
13
|
export * from "./get-user-recent-achievements-response.model";
|
|
12
14
|
export * from "./get-user-recently-played-games-response.model";
|
|
@@ -15,8 +17,11 @@ export * from "./user-awards.model";
|
|
|
15
17
|
export * from "./user-claims.model";
|
|
16
18
|
export * from "./user-claims-response.model";
|
|
17
19
|
export * from "./user-completed-games.model";
|
|
20
|
+
export * from "./user-completion-progress.model";
|
|
21
|
+
export * from "./user-completion-progress-entity.model";
|
|
18
22
|
export * from "./user-game-rank-and-score.model";
|
|
19
23
|
export * from "./user-points.model";
|
|
24
|
+
export * from "./user-profile.model";
|
|
20
25
|
export * from "./user-progress.model";
|
|
21
26
|
export * from "./user-recent-achievement.model";
|
|
22
27
|
export * from "./user-recently-played-games.model";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface UserCompletionProgressEntity {
|
|
2
|
+
gameId: number;
|
|
3
|
+
title: string;
|
|
4
|
+
imageIcon: string;
|
|
5
|
+
consoleId: number;
|
|
6
|
+
consoleName: string;
|
|
7
|
+
maxPossible: number;
|
|
8
|
+
numAwarded: number;
|
|
9
|
+
numAwardedHardcore: number;
|
|
10
|
+
|
|
11
|
+
mostRecentAwardedDate?: string;
|
|
12
|
+
highestAwardKind?:
|
|
13
|
+
| "mastered"
|
|
14
|
+
| "completed"
|
|
15
|
+
| "beaten-hardcore"
|
|
16
|
+
| "beaten-softcore"
|
|
17
|
+
| null;
|
|
18
|
+
highestAwardDate?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface UserProfile {
|
|
2
|
+
user: string;
|
|
3
|
+
userPic: string;
|
|
4
|
+
memberSince: string;
|
|
5
|
+
richPresenceMsg: string;
|
|
6
|
+
lastGameId: number;
|
|
7
|
+
contribCount: number;
|
|
8
|
+
contribYield: number;
|
|
9
|
+
totalPoints: number;
|
|
10
|
+
totalSoftcorePoints: number;
|
|
11
|
+
totalTruePoints: number;
|
|
12
|
+
permissions: number;
|
|
13
|
+
untracked: boolean;
|
|
14
|
+
id: number;
|
|
15
|
+
userWallActive: boolean;
|
|
16
|
+
motto: string;
|
|
17
|
+
}
|