mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 17:23:37 +00:00
Move CLI to apps/cli
This commit is contained in:
33
apps/cli/src/models/response/cipherResponse.ts
Normal file
33
apps/cli/src/models/response/cipherResponse.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { CipherType } from "jslib-common/enums/cipherType";
|
||||
import { CipherWithIdExport } from "jslib-common/models/export/cipherWithIdsExport";
|
||||
import { CipherView } from "jslib-common/models/view/cipherView";
|
||||
import { BaseResponse } from "jslib-node/cli/models/response/baseResponse";
|
||||
|
||||
import { AttachmentResponse } from "./attachmentResponse";
|
||||
import { LoginResponse } from "./loginResponse";
|
||||
import { PasswordHistoryResponse } from "./passwordHistoryResponse";
|
||||
|
||||
export class CipherResponse extends CipherWithIdExport implements BaseResponse {
|
||||
object: string;
|
||||
attachments: AttachmentResponse[];
|
||||
revisionDate: Date;
|
||||
deletedDate: Date;
|
||||
passwordHistory: PasswordHistoryResponse[];
|
||||
|
||||
constructor(o: CipherView) {
|
||||
super();
|
||||
this.object = "item";
|
||||
this.build(o);
|
||||
if (o.attachments != null) {
|
||||
this.attachments = o.attachments.map((a) => new AttachmentResponse(a));
|
||||
}
|
||||
this.revisionDate = o.revisionDate;
|
||||
this.deletedDate = o.deletedDate;
|
||||
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