mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 01:33:33 +00:00
* Specify enc string decryption key and service. * Fix issue with identifying `this` type within extended classes * Folder decryption example * Test enc string changes * Fix test name * test decrypt with key
27 lines
767 B
TypeScript
27 lines
767 B
TypeScript
import { Jsonify } from "type-fest";
|
|
|
|
import { View } from "../../../models/view/view";
|
|
import { DecryptedObject } from "../../../platform/models/domain/domain-base";
|
|
import { Folder } from "../domain/folder";
|
|
import { ITreeNodeObject } from "../domain/tree-node";
|
|
|
|
export class FolderView implements View, ITreeNodeObject {
|
|
id: string = null;
|
|
name: string = null;
|
|
revisionDate: Date = null;
|
|
|
|
constructor(f?: Folder | DecryptedObject<Folder, "name">) {
|
|
if (!f) {
|
|
return;
|
|
}
|
|
|
|
this.id = f.id;
|
|
this.revisionDate = f.revisionDate;
|
|
}
|
|
|
|
static fromJSON(obj: Jsonify<FolderView>) {
|
|
const revisionDate = obj.revisionDate == null ? null : new Date(obj.revisionDate);
|
|
return Object.assign(new FolderView(), obj, { revisionDate });
|
|
}
|
|
}
|