Skip to content

Commit

Permalink
feat(getUserAwards): add types and logic for beaten awards (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
wescopeland authored Dec 2, 2023
1 parent 51d972d commit 5d72a79
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 4 deletions.
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

0 comments on commit 5d72a79

Please sign in to comment.