1
0
mirror of https://github.com/bitwarden/jslib synced 2025-12-17 16:53:20 +00:00

Rename FolderView to FolderDecrypted

This commit is contained in:
Hinton
2022-04-21 09:59:35 +02:00
parent 8112d3c530
commit a0f6150c09
21 changed files with 69 additions and 69 deletions

View File

@@ -11,7 +11,7 @@ import { ProviderData } from "../data/providerData";
import { SendData } from "../data/sendData";
import { CipherView } from "../view/cipherView";
import { CollectionView } from "../view/collectionView";
import { FolderView } from "../view/folderView";
import { FolderDecrypted } from "../view/folderDecrypted";
import { SendView } from "../view/sendView";
import { EncString } from "./encString";
@@ -35,9 +35,9 @@ export class AccountData {
CipherData,
CipherView
>();
folders?: DataEncryptionPair<FolderData, FolderView> = new DataEncryptionPair<
folders?: DataEncryptionPair<FolderData, FolderDecrypted> = new DataEncryptionPair<
FolderData,
FolderView
FolderDecrypted
>();
localData?: any;
sends?: DataEncryptionPair<SendData, SendView> = new DataEncryptionPair<SendData, SendView>();

View File

@@ -1,13 +1,13 @@
import { CipherView } from "../view/cipherView";
import { CollectionView } from "../view/collectionView";
import { FolderView } from "../view/folderView";
import { FolderDecrypted } from "../view/folderDecrypted";
export class ImportResult {
success = false;
missingPassword = false;
errorMessage: string;
ciphers: CipherView[] = [];
folders: FolderView[] = [];
folders: FolderDecrypted[] = [];
folderRelationships: [number, number][] = [];
collections: CollectionView[] = [];
collectionRelationships: [number, number][] = [];

View File

@@ -1,6 +1,6 @@
import { EncString } from "../domain/encString";
import { Folder as FolderDomain } from "../domain/folder";
import { FolderView } from "../view/folderView";
import { FolderDecrypted } from "../view/folderDecrypted";
export class FolderExport {
static template(): FolderExport {
@@ -9,7 +9,7 @@ export class FolderExport {
return req;
}
static toView(req: FolderExport, view = new FolderView()) {
static toView(req: FolderExport, view = new FolderDecrypted()) {
view.name = req.name;
return view;
}
@@ -22,8 +22,8 @@ export class FolderExport {
name: string;
// Use build method instead of ctor so that we can control order of JSON stringify for pretty print
build(o: FolderView | FolderDomain) {
if (o instanceof FolderView) {
build(o: FolderDecrypted | FolderDomain) {
if (o instanceof FolderDecrypted) {
this.name = o.name;
} else {
this.name = o.name?.encryptedString;

View File

@@ -1,5 +1,5 @@
import { Folder as FolderDomain } from "../domain/folder";
import { FolderView } from "../view/folderView";
import { FolderDecrypted } from "../view/folderDecrypted";
import { FolderExport } from "./folderExport";
@@ -7,7 +7,7 @@ export class FolderWithIdExport extends FolderExport {
id: string;
// Use build method instead of ctor so that we can control order of JSON stringify for pretty print
build(o: FolderView | FolderDomain) {
build(o: FolderDecrypted | FolderDomain) {
this.id = o.id;
super.build(o);
}

View File

@@ -3,7 +3,7 @@ import { CryptoService } from "jslib-common/abstractions/crypto.service";
import { Folder } from "../domain/folder";
import { ITreeNodeObject } from "../domain/treeNode";
export class FolderView implements ITreeNodeObject {
export class FolderDecrypted implements ITreeNodeObject {
id: string = null;
name: string = null;
revisionDate: Date = null;
@@ -16,8 +16,8 @@ export class FolderView implements ITreeNodeObject {
};
}
static async fromFolder(cryptoService: CryptoService, folder: Folder): Promise<FolderView> {
const view = new FolderView();
static async fromFolder(cryptoService: CryptoService, folder: Folder): Promise<FolderDecrypted> {
const view = new FolderDecrypted();
view.id = folder.id;
view.name = await folder.name.decryptWithCryptoService(cryptoService);
view.revisionDate = folder.revisionDate;