1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 01:03:35 +00:00

[PM-328] Move Send to Tools (#5104)

* Move send in libs/common

* Move send in libs/angular

* Move send in browser

* Move send in cli

* Move send in desktop

* Move send in web
This commit is contained in:
Daniel James Smith
2023-03-29 16:23:37 +02:00
committed by GitHub
parent e645688f8a
commit e238ea20a9
105 changed files with 328 additions and 321 deletions

View File

@@ -0,0 +1,39 @@
import { Observable } from "rxjs";
import { EncArrayBuffer } from "../../../models/domain/enc-array-buffer";
import { SymmetricCryptoKey } from "../../../models/domain/symmetric-crypto-key";
import { SendData } from "../models/data/send.data";
import { Send } from "../models/domain/send";
import { SendView } from "../models/view/send.view";
export abstract class SendService {
sends$: Observable<Send[]>;
sendViews$: Observable<SendView[]>;
encrypt: (
model: SendView,
file: File | ArrayBuffer,
password: string,
key?: SymmetricCryptoKey
) => Promise<[Send, EncArrayBuffer]>;
get: (id: string) => Send;
/**
* @deprecated Do not call this, use the sends$ observable collection
*/
getAll: () => Promise<Send[]>;
/**
* @deprecated Only use in CLI
*/
getFromState: (id: string) => Promise<Send>;
/**
* @deprecated Only use in CLI
*/
getAllDecryptedFromState: () => Promise<SendView[]>;
}
export abstract class InternalSendService extends SendService {
upsert: (send: SendData | SendData[]) => Promise<any>;
replace: (sends: { [id: string]: SendData }) => Promise<void>;
clear: (userId: string) => Promise<any>;
delete: (id: string | string[]) => Promise<any>;
}