Skip to content

Commit b3e2b8a

Browse files
authored
fix(getUserRecentAchievements): update types (#126)
* fix(getUserRecentAchievements): update types * chore: bump version to 2.7.0
1 parent c4eee9f commit b3e2b8a

File tree

6 files changed

+21
-2
lines changed

6 files changed

+21
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"raweb",
1111
"retro gaming"
1212
],
13-
"version": "2.6.0",
13+
"version": "2.7.0",
1414
"typings": "dist/index.d.ts",
1515
"exports": {
1616
".": {

src/game/models/get-game-hashes-response.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ interface GameHashResult {
22
MD5: string;
33
Name: string;
44
Labels: string[];
5-
PatchUrl: string;
5+
PatchUrl: string | null;
66
}
77

88
export interface GetGameHashesResponse {

src/user/getUserRecentAchievements.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ describe("Function: getUserRecentAchievements", () => {
3636
"Win the Tournament as [You] on Hard with 1 attribute on max. and 1 attribute on min.",
3737
BadgeName: "121991",
3838
Points: 25,
39+
TrueRatio: 50,
40+
Type: "missable",
3941
Author: "Som1",
42+
AuthorULID: "01F13ZKAPPEZ90K3JK82QWYRN2",
4043
GameTitle: "WWF King of the Ring",
4144
GameIcon: "/Images/062599.png",
4245
GameID: 6316,
@@ -68,7 +71,10 @@ describe("Function: getUserRecentAchievements", () => {
6871
"Win the Tournament as [You] on Hard with 1 attribute on max. and 1 attribute on min.",
6972
badgeName: "121991",
7073
points: 25,
74+
trueRatio: 50,
75+
type: "missable",
7176
author: "Som1",
77+
authorUlid: "01F13ZKAPPEZ90K3JK82QWYRN2",
7278
gameTitle: "WWF King of the Ring",
7379
gameIcon: "/Images/062599.png",
7480
gameId: 6316,

src/user/models/get-user-recent-achievements-response.model.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { AchievementType } from "../../achievement";
2+
13
interface GetUserRecentAchievementsEntity {
24
Date: string;
35
HardcoreMode: 0 | 1;
@@ -6,7 +8,10 @@ interface GetUserRecentAchievementsEntity {
68
Description: string;
79
BadgeName: string;
810
Points: number;
11+
TrueRatio: number;
12+
Type: AchievementType;
913
Author: string;
14+
AuthorULID: string;
1015
GameTitle: string;
1116
GameIcon: string;
1217
GameID: number;

src/user/models/user-recent-achievement.model.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { AchievementType } from "../../achievement";
2+
13
export interface UserRecentAchievement {
24
date: string;
35
hardcoreMode: boolean;
@@ -6,7 +8,10 @@ export interface UserRecentAchievement {
68
description: string;
79
badgeName: string;
810
points: number;
11+
trueRatio: number;
12+
type: AchievementType;
913
author: string;
14+
authorUlid: string;
1015
gameTitle: string;
1116
gameIcon: string;
1217
gameId: number;

src/utils/internal/serializeProperties.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ const naiveCamelCase = (originalValue: string) => {
6262
let camelCased =
6363
originalValue.charAt(0).toLowerCase() + originalValue.slice(1);
6464

65+
// "authorULId" -> "authorUlid"
66+
camelCased = camelCased.replaceAll("ULID", "Ulid");
67+
6568
// "gameID" -> "gameId"
6669
camelCased = camelCased.replaceAll("ID", "Id");
6770

0 commit comments

Comments
 (0)