Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(getUserAwards): add types and logic for beaten awards #51

Merged
merged 1 commit into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/v1/users/get-user-awards.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const userAwards = await getUserAwards(authorization, { userName: "xelnia" });
"hiddenAwardsCount": 2,
"masteryAwardsCount": 6,
"completionAwardsCount": 0,
"beatenHardcoreAwardsCount": 24,
"beatenSoftcoreAwardsCount": 7,
"eventAwardsCount": 0,
"siteAwardsCount": 2,
"visibleUserAwards": [
Expand Down
4 changes: 4 additions & 0 deletions src/user/getUserAwards.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ describe("Function: getUserAwards", () => {
HiddenAwardsCount: 5,
MasteryAwardsCount: 5,
CompletionAwardsCount: 0,
BeatenHardcoreAwardsCount: 24,
BeatenSoftcoreAwardsCount: 7,
EventAwardsCount: 0,
SiteAwardsCount: 0,
VisibleUserAwards: [
Expand Down Expand Up @@ -63,6 +65,8 @@ describe("Function: getUserAwards", () => {
hiddenAwardsCount: 5,
masteryAwardsCount: 5,
completionAwardsCount: 0,
beatenHardcoreAwardsCount: 24,
beatenSoftcoreAwardsCount: 7,
eventAwardsCount: 0,
siteAwardsCount: 0,
visibleUserAwards: [
Expand Down
2 changes: 2 additions & 0 deletions src/user/getUserAwards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import type { GetUserAwardsResponse, UserAwards } from "./models";
* hiddenAwardsCount: 2,
* masteryAwardsCount: 6,
* completionAwardsCount: 0,
* beatenHardcoreAwardsCount: 24,
* beatenSoftcoreAwardsCount: 7,
* eventAwardsCount: 0,
* siteAwardsCount: 2,
* visibleUserAwards: [
Expand Down
9 changes: 5 additions & 4 deletions src/user/models/award-type.model.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
export type AwardType =
| "Mastery/Completion"
| "Achievement Unlocks Yield"
| "Achievement Points Yield"
| "Patreon Supporter"
| "Achievement Unlocks Yield"
| "Certified Legend"
| "Invalid or deprecated award type";
| "Game Beaten"
| "Invalid or deprecated award type"
| "Mastery/Completion"
| "Patreon Supporter";
2 changes: 2 additions & 0 deletions src/user/models/get-user-awards-response.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export interface GetUserAwardsResponse {
HiddenAwardsCount: number;
MasteryAwardsCount: number;
CompletionAwardsCount: number;
BeatenHardcoreAwardsCount: number;
BeatenSoftcoreAwardsCount: number;
EventAwardsCount: number;
SiteAwardsCount: number;
VisibleUserAwards: GetUserAwardsEntity[];
Expand Down
2 changes: 2 additions & 0 deletions src/user/models/user-awards.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export interface UserAwards {
hiddenAwardsCount: number;
masteryAwardsCount: number;
completionAwardsCount: number;
beatenHardcoreAwardsCount: number;
beatenSoftcoreAwardsCount: number;
eventAwardsCount: number;
siteAwardsCount: number;
visibleUserAwards: UserAward[];
Expand Down