1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

add password history and updated dates to responses

This commit is contained in:
Kyle Spearrin
2018-07-30 11:33:50 -04:00
parent 1486762f40
commit f47f100c0b
4 changed files with 37 additions and 1 deletions

2
jslib

Submodule jslib updated: 9df96a3288...557b2fc3f0

View File

@@ -3,11 +3,17 @@ import { CipherView } from 'jslib/models/view/cipherView';
import { Cipher } from '../cipher'; import { Cipher } from '../cipher';
import { AttachmentResponse } from './attachmentResponse'; import { AttachmentResponse } from './attachmentResponse';
import { BaseResponse } from './baseResponse'; import { BaseResponse } from './baseResponse';
import { LoginResponse } from './loginResponse';
import { PasswordHistoryResponse } from './passwordHistoryResponse';
import { CipherType } from 'jslib/enums';
export class CipherResponse extends Cipher implements BaseResponse { export class CipherResponse extends Cipher implements BaseResponse {
object: string; object: string;
id: string; id: string;
attachments: AttachmentResponse[]; attachments: AttachmentResponse[];
revisionDate: Date;
passwordHistory: PasswordHistoryResponse[];
constructor(o: CipherView) { constructor(o: CipherView) {
super(); super();
@@ -17,5 +23,12 @@ export class CipherResponse extends Cipher implements BaseResponse {
if (o.attachments != null) { if (o.attachments != null) {
this.attachments = o.attachments.map((a) => new AttachmentResponse(a)); this.attachments = o.attachments.map((a) => new AttachmentResponse(a));
} }
this.revisionDate = o.revisionDate;
if (o.passwordHistory != null) {
this.passwordHistory = o.passwordHistory.map((h) => new PasswordHistoryResponse(h));
}
if (o.type === CipherType.Login && o.login != null) {
this.login = new LoginResponse(o.login);
}
} }
} }

View File

@@ -0,0 +1,12 @@
import { Login } from '../login';
import { LoginView } from 'jslib/models/view';
export class LoginResponse extends Login {
passwordRevisionDate: Date;
constructor(o: LoginView) {
super(o);
this.passwordRevisionDate = o.passwordRevisionDate != null ? o.passwordRevisionDate : null;
}
}

View File

@@ -0,0 +1,11 @@
import { PasswordHistoryView } from 'jslib/models/view/passwordHistoryView';
export class PasswordHistoryResponse {
lastUsedDate: Date;
password: string;
constructor(o: PasswordHistoryView) {
this.lastUsedDate = o.lastUsedDate;
this.password = o.password;
}
}