Skip to content

Commit

Permalink
devex: add and use self user object + add missing types
Browse files Browse the repository at this point in the history
  • Loading branch information
Looskie committed Feb 11, 2023
1 parent 43d31fe commit c7cd9e1
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions src/rest/types/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Endpoint} from '../endpoints.js';
import {MemberRole, Project} from './projects.js';

/**
* A user objct
* A user object
*/
export interface User {
/**
Expand All @@ -27,6 +27,36 @@ export interface User {
email: string;
}

/**
* Self User Object
*/
export interface SelfUser extends User {
/**
* If user has verified their email
*/
email_verified: boolean;

/**
* If user has enabled totp authentication
*/
totp_enabled: boolean;

/**
* If user has enabled webauthn authentication
*/
webauthn_enabled: boolean;

/**
* If user has enabled mfa authentication
*/
mfa_enabled: boolean;

/**
* If user is an admin
*/
admin: boolean;
}

export interface PAT {
/**
* The ID of the pat
Expand Down Expand Up @@ -57,7 +87,7 @@ export type UserEndpoints =
'/v1/users/@me',
{
projects: Project[];
user: User;
user: SelfUser;
project_member_role_map: Record<Id<'project'>, MemberRole>;
leap_token: string | null;
}
Expand Down

0 comments on commit c7cd9e1

Please sign in to comment.