1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +00:00

update abstraction

This commit is contained in:
Kyle Spearrin
2018-01-24 12:19:49 -05:00
parent 7e1c883f03
commit bb18729306

View File

@@ -4,19 +4,22 @@ import { Cipher } from '../models/domain/cipher';
import { Field } from '../models/domain/field'; import { Field } from '../models/domain/field';
import { SymmetricCryptoKey } from '../models/domain/symmetricCryptoKey'; import { SymmetricCryptoKey } from '../models/domain/symmetricCryptoKey';
import { CipherView } from '../models/view/cipherView';
import { FieldView } from '../models/view/fieldView';
export abstract class CipherService { export abstract class CipherService {
decryptedCipherCache: any[]; decryptedCipherCache: CipherView[];
clearCache: () => void; clearCache: () => void;
encrypt: (model: any) => Promise<Cipher>; encrypt: (model: CipherView) => Promise<Cipher>;
encryptFields: (fieldsModel: any[], key: SymmetricCryptoKey) => Promise<Field[]>; encryptFields: (fieldsModel: FieldView[], key: SymmetricCryptoKey) => Promise<Field[]>;
encryptField: (fieldModel: any, key: SymmetricCryptoKey) => Promise<Field>; encryptField: (fieldModel: FieldView, key: SymmetricCryptoKey) => Promise<Field>;
get: (id: string) => Promise<Cipher>; get: (id: string) => Promise<Cipher>;
getAll: () => Promise<Cipher[]>; getAll: () => Promise<Cipher[]>;
getAllDecrypted: () => Promise<any[]>; getAllDecrypted: () => Promise<CipherView[]>;
getAllDecryptedForGrouping: (groupingId: string, folder?: boolean) => Promise<any[]>; getAllDecryptedForGrouping: (groupingId: string, folder?: boolean) => Promise<CipherView[]>;
getAllDecryptedForDomain: (domain: string, includeOtherTypes?: any[]) => Promise<any[]>; getAllDecryptedForDomain: (domain: string, includeOtherTypes?: any[]) => Promise<CipherView[]>;
getLastUsedForDomain: (domain: string) => Promise<any>; getLastUsedForDomain: (domain: string) => Promise<CipherView>;
updateLastUsedDate: (id: string) => Promise<void>; updateLastUsedDate: (id: string) => Promise<void>;
saveNeverDomain: (domain: string) => Promise<void>; saveNeverDomain: (domain: string) => Promise<void>;
saveWithServer: (cipher: Cipher) => Promise<any>; saveWithServer: (cipher: Cipher) => Promise<any>;