Skip to content

Commit 61ee707

Browse files
authored
feat(user): add getAccountDevices function to retrieve user devices (#208)
1 parent 1b39bd1 commit 61ee707

9 files changed

Lines changed: 548 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ Click the function names to open their complete docs on the docs site.
117117
information.
118118
- [`getUserRegion()`](https://psn-api.achievements.app/api-docs/users#getuserregion) - Get a user's region information based on their username.
119119
- [`getProfileShareableLink()`](https://psn-api.achievements.app/api-docs/users#getprofileshareablelink) - Get a shareable link and QR code for a user's profile.
120+
- [`getAccountDevices()`](https://psn-api.achievements.app/api-docs/users#getaccountdevices) - Get a list of devices associated with the account (PS5, PS4, PS3, PSVita).
120121

121122
### Trophies
122123

src/models/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ export * from "./trophy-counts.model";
1919
export * from "./trophy-group-earnings.model";
2020
export * from "./trophy-rarity.model";
2121
export * from "./trophy-title.model";
22-
export * from "./trophy-title.model";
2322
export * from "./trophy-type.model";
2423
export * from "./universal-search-domains.model";
2524
export * from "./universal-search-response.model";
25+
export * from "./user-devices-response.model";
2626
export * from "./user-played-games-response.model";
2727
export * from "./user-region-info.model";
2828
export * from "./user-thin-trophy.model";
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
export interface AccountDevicesResponse {
2+
/** The user's account ID. */
3+
accountId: string;
4+
5+
/** List of devices the account is logged into. */
6+
accountDevices: Array<{
7+
/** The device ID */
8+
deviceId: string;
9+
10+
/**
11+
* The device type/platform.
12+
* @example "PS5" | "PS4" | "PS3" | "PSVita"
13+
*/
14+
deviceType: string;
15+
16+
/**
17+
* The activation type.
18+
* @example "PRIMARY" | "PSN_GAME_V3"
19+
*/
20+
activationType: string;
21+
22+
/** The device activation date in ISO format. */
23+
activationDate: string;
24+
25+
/** The account device vector. */
26+
accountDeviceVector: string;
27+
}>;
28+
}

src/user/USER_BASE_URL.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ export const USER_LEGACY_BASE_URL =
88
"https://us-prof.np.community.playstation.net/userProfile/v1/users";
99

1010
export const USER_CPSS_BASE_URL = "https://m.np.playstation.com/api/cpss";
11+
12+
export const USER_DMS_BASE_URL = "https://dms.api.playstation.com/api";

0 commit comments

Comments
 (0)