mirror of
https://github.com/bitwarden/cli
synced 2025-12-16 16:23:30 +00:00
add password history and updated dates to responses
This commit is contained in:
@@ -3,11 +3,17 @@ import { CipherView } from 'jslib/models/view/cipherView';
|
||||
import { Cipher } from '../cipher';
|
||||
import { AttachmentResponse } from './attachmentResponse';
|
||||
import { BaseResponse } from './baseResponse';
|
||||
import { LoginResponse } from './loginResponse';
|
||||
import { PasswordHistoryResponse } from './passwordHistoryResponse';
|
||||
|
||||
import { CipherType } from 'jslib/enums';
|
||||
|
||||
export class CipherResponse extends Cipher implements BaseResponse {
|
||||
object: string;
|
||||
id: string;
|
||||
attachments: AttachmentResponse[];
|
||||
revisionDate: Date;
|
||||
passwordHistory: PasswordHistoryResponse[];
|
||||
|
||||
constructor(o: CipherView) {
|
||||
super();
|
||||
@@ -17,5 +23,12 @@ export class CipherResponse extends Cipher implements BaseResponse {
|
||||
if (o.attachments != null) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user