mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
added models, crypto, and constants services
This commit is contained in:
39
src/models/response/profileResponse.ts
Normal file
39
src/models/response/profileResponse.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { ProfileOrganizationResponse } from './profileOrganizationResponse';
|
||||
|
||||
class ProfileResponse {
|
||||
id: string;
|
||||
name: string;
|
||||
email: string;
|
||||
emailVerified: boolean;
|
||||
masterPasswordHint: string;
|
||||
premium: boolean;
|
||||
culture: string;
|
||||
twoFactorEnabled: boolean;
|
||||
key: string;
|
||||
privateKey: string;
|
||||
securityStamp: string;
|
||||
organizations: ProfileOrganizationResponse[] = [];
|
||||
|
||||
constructor(response: any) {
|
||||
this.id = response.Id;
|
||||
this.name = response.Name;
|
||||
this.email = response.Email;
|
||||
this.emailVerified = response.EmailVerified;
|
||||
this.masterPasswordHint = response.MasterPasswordHint;
|
||||
this.premium = response.Premium;
|
||||
this.culture = response.Culture;
|
||||
this.twoFactorEnabled = response.TwoFactorEnabled;
|
||||
this.key = response.Key;
|
||||
this.privateKey = response.PrivateKey;
|
||||
this.securityStamp = response.SecurityStamp;
|
||||
|
||||
if (response.Organizations) {
|
||||
response.Organizations.forEach((org: any) => {
|
||||
this.organizations.push(new ProfileOrganizationResponse(org));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export { ProfileResponse };
|
||||
(window as any).ProfileResponse = ProfileResponse;
|
||||
Reference in New Issue
Block a user