import { CipherType } from "../enums/cipherType"; import { UriMatchType } from "../enums/uriMatchType"; import { CipherData } from "../models/data/cipherData"; import { Cipher } from "../models/domain/cipher"; import { Field } from "../models/domain/field"; import { SymmetricCryptoKey } from "../models/domain/symmetricCryptoKey"; import { CipherView } from "../models/view/cipherView"; import { FieldView } from "../models/view/fieldView"; export abstract class CipherService { clearCache: (userId?: string) => Promise; encrypt: ( model: CipherView, key?: SymmetricCryptoKey, originalCipher?: Cipher ) => Promise; encryptFields: (fieldsModel: FieldView[], key: SymmetricCryptoKey) => Promise; encryptField: (fieldModel: FieldView, key: SymmetricCryptoKey) => Promise; get: (id: string) => Promise; getAll: () => Promise; getAllDecrypted: () => Promise; getAllDecryptedForGrouping: (groupingId: string, folder?: boolean) => Promise; getAllDecryptedForUrl: ( url: string, includeOtherTypes?: CipherType[], defaultMatch?: UriMatchType ) => Promise; getAllFromApiForOrganization: (organizationId: string) => Promise; getLastUsedForUrl: (url: string, autofillOnPageLoad: boolean) => Promise; getLastLaunchedForUrl: (url: string, autofillOnPageLoad: boolean) => Promise; getNextCipherForUrl: (url: string) => Promise; updateLastUsedIndexForUrl: (url: string) => void; updateLastUsedDate: (id: string) => Promise; updateLastLaunchedDate: (id: string) => Promise; saveNeverDomain: (domain: string) => Promise; saveWithServer: (cipher: Cipher) => Promise; shareWithServer: ( cipher: CipherView, organizationId: string, collectionIds: string[] ) => Promise; shareManyWithServer: ( ciphers: CipherView[], organizationId: string, collectionIds: string[] ) => Promise; saveAttachmentWithServer: ( cipher: Cipher, unencryptedFile: any, admin?: boolean ) => Promise; saveAttachmentRawWithServer: ( cipher: Cipher, filename: string, data: ArrayBuffer, admin?: boolean ) => Promise; saveCollectionsWithServer: (cipher: Cipher) => Promise; upsert: (cipher: CipherData | CipherData[]) => Promise; replace: (ciphers: { [id: string]: CipherData }) => Promise; clear: (userId: string) => Promise; moveManyWithServer: (ids: string[], folderId: string) => Promise; delete: (id: string | string[]) => Promise; deleteWithServer: (id: string) => Promise; deleteManyWithServer: (ids: string[]) => Promise; deleteAttachment: (id: string, attachmentId: string) => Promise; deleteAttachmentWithServer: (id: string, attachmentId: string) => Promise; sortCiphersByLastUsed: (a: any, b: any) => number; sortCiphersByLastUsedThenName: (a: any, b: any) => number; getLocaleSortingFunction: () => (a: CipherView, b: CipherView) => number; softDelete: (id: string | string[]) => Promise; softDeleteWithServer: (id: string) => Promise; softDeleteManyWithServer: (ids: string[]) => Promise; restore: ( cipher: { id: string; revisionDate: string } | { id: string; revisionDate: string }[] ) => Promise; restoreWithServer: (id: string) => Promise; restoreManyWithServer: (ids: string[]) => Promise; }