1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

get items attachment command

This commit is contained in:
Kyle Spearrin
2018-05-17 13:28:22 -04:00
parent 05535cc134
commit df024379c8
10 changed files with 167 additions and 40 deletions

View File

@@ -0,0 +1,19 @@
import { AttachmentView } from 'jslib/models/view/attachmentView';
import { Attachment } from '../attachment';
export class AttachmentResponse extends Attachment {
id: string;
size: number;
sizeName: string;
url: string;
constructor(o: AttachmentView) {
super();
this.id = o.id;
this.build(o);
this.size = o.size;
this.sizeName = o.sizeName;
this.url = o.url;
}
}

View File

@@ -1,17 +1,21 @@
import { CipherView } from 'jslib/models/view/cipherView';
import { BaseResponse } from './baseResponse';
import { Cipher } from '../cipher';
import { AttachmentResponse } from './attachmentResponse';
import { BaseResponse } from './baseResponse';
export class CipherResponse extends Cipher implements BaseResponse {
object: string;
id: string;
attachments: AttachmentResponse[];
constructor(o: CipherView) {
super();
this.object = 'item';
this.id = o.id;
this.build(o);
if (o.attachments != null) {
this.attachments = o.attachments.map((a) => new AttachmentResponse(a));
}
}
}