You've already forked AstralRinth
feat: new user badges, ui consistency pass (#6262)
* feat: new user badges, ui consistency pass * prepr * fix: align with backend * fix: lint --------- Co-authored-by: Calum H. (IMB11) <contact@cal.engineer>
This commit is contained in:
@@ -1298,6 +1298,16 @@ export namespace Labrinth {
|
||||
export type AuthProvider = Common.AuthProvider
|
||||
export type UserPayoutData = Common.UserPayoutData
|
||||
|
||||
export type Pride26CampaignDonation = {
|
||||
last_donated_at: string
|
||||
has_badge: boolean
|
||||
has_midas: boolean
|
||||
}
|
||||
|
||||
export type UserCampaigns = {
|
||||
pride_26: Pride26CampaignDonation | null
|
||||
}
|
||||
|
||||
export type User = {
|
||||
id: string
|
||||
username: string
|
||||
@@ -1314,6 +1324,7 @@ export namespace Labrinth {
|
||||
payout_data?: UserPayoutData
|
||||
stripe_customer_id?: string
|
||||
allow_friend_requests?: boolean
|
||||
campaigns: UserCampaigns
|
||||
github_id?: number
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,25 @@ export class LabrinthUsersV3Module extends AbstractModule {
|
||||
return 'labrinth_users_v3'
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a user by ID or username
|
||||
*
|
||||
* @param idOrUsername - The user's ID or username
|
||||
* @returns Promise resolving to the user data
|
||||
*
|
||||
* GET /v3/user/{id}
|
||||
*/
|
||||
public async get(idOrUsername: string): Promise<Labrinth.Users.v3.User> {
|
||||
return this.client.request<Labrinth.Users.v3.User>(
|
||||
`/user/${encodeURIComponent(idOrUsername)}`,
|
||||
{
|
||||
api: 'labrinth',
|
||||
version: 3,
|
||||
method: 'GET',
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all projects the authenticated user can access directly or through
|
||||
* their organizations.
|
||||
|
||||
Reference in New Issue
Block a user