mirror of
https://github.com/bitwarden/browser
synced 2025-12-24 04:04:24 +00:00
33 lines
798 B
TypeScript
33 lines
798 B
TypeScript
import { FolderData } from '../data/folderData';
|
|
|
|
import { FolderView } from '../view/folderView';
|
|
|
|
import { CipherString } from './cipherString';
|
|
import Domain from './domainBase';
|
|
|
|
export class Folder extends Domain {
|
|
id: string;
|
|
name: CipherString;
|
|
revisionDate: Date;
|
|
|
|
constructor(obj?: FolderData, alreadyEncrypted: boolean = false) {
|
|
super();
|
|
if (obj == null) {
|
|
return;
|
|
}
|
|
|
|
this.buildDomainModel(this, obj, {
|
|
id: null,
|
|
name: null,
|
|
}, alreadyEncrypted, ['id']);
|
|
|
|
this.revisionDate = obj.revisionDate != null ? new Date(obj.revisionDate) : null;
|
|
}
|
|
|
|
decrypt(): Promise<FolderView> {
|
|
return this.decryptObj(new FolderView(this), {
|
|
name: null,
|
|
}, null);
|
|
}
|
|
}
|