mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 15:23:33 +00:00
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
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) {
|
|
for (const org of response.Organizations) {
|
|
this.organizations.push(new ProfileOrganizationResponse(org));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
export { ProfileResponse };
|
|
(window as any).ProfileResponse = ProfileResponse;
|