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

move export models to jslib

This commit is contained in:
Kyle Spearrin
2018-12-17 10:30:06 -05:00
parent 9888f699ec
commit 33deb4cda6
17 changed files with 25 additions and 453 deletions

View File

@@ -1,6 +1,6 @@
import { CipherWithIds } from 'jslib/models/export/cipherWithIds';
import { CipherView } from 'jslib/models/view/cipherView';
import { Cipher } from '../cipher';
import { AttachmentResponse } from './attachmentResponse';
import { BaseResponse } from './baseResponse';
import { LoginResponse } from './loginResponse';
@@ -8,23 +8,19 @@ import { PasswordHistoryResponse } from './passwordHistoryResponse';
import { CipherType } from 'jslib/enums';
export class CipherResponse extends Cipher implements BaseResponse {
export class CipherResponse extends CipherWithIds implements BaseResponse {
object: string;
id: string;
attachments: AttachmentResponse[];
revisionDate: Date;
passwordHistory: PasswordHistoryResponse[];
collectionIds: string[];
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));
}
this.collectionIds = o.collectionIds;
this.revisionDate = o.revisionDate;
if (o.passwordHistory != null) {
this.passwordHistory = o.passwordHistory.map((h) => new PasswordHistoryResponse(h));

View File

@@ -1,17 +1,14 @@
import { CollectionWithId } from 'jslib/models/export/collectionWithId';
import { CollectionView } from 'jslib/models/view/collectionView';
import { BaseResponse } from './baseResponse';
import { Collection } from '../collection';
export class CollectionResponse extends Collection implements BaseResponse {
export class CollectionResponse extends CollectionWithId implements BaseResponse {
object: string;
id: string;
constructor(o: CollectionView) {
super();
this.object = 'collection';
this.id = o.id;
this.build(o);
}
}

View File

@@ -1,17 +1,14 @@
import { FolderWithId } from 'jslib/models/export/folderWithId';
import { FolderView } from 'jslib/models/view/folderView';
import { BaseResponse } from './baseResponse';
import { Folder } from '../folder';
export class FolderResponse extends Folder implements BaseResponse {
export class FolderResponse extends FolderWithId implements BaseResponse {
object: string;
id: string;
constructor(o: FolderView) {
super();
this.object = 'folder';
this.id = o.id;
this.build(o);
}
}

View File

@@ -1,6 +1,5 @@
import { Login } from '../login';
import { LoginView } from 'jslib/models/view';
import { Login } from 'jslib/models/export/login';
import { LoginView } from 'jslib/models/view/loginView';
export class LoginResponse extends Login {
passwordRevisionDate: Date;