/** * SendSafely Bubble Utility Functions * * Promise wrappers around the callback-based @sendsafely/sendsafely SDK * and credential parsing helpers. */ import SendSafely from '@sendsafely/sendsafely'; export interface SendSafelyCredentials { host: string; apiKey: string; apiSecret: string; } /** * Parse a multi-field credential value into typed SendSafely fields. * Uses the shared decodeMultiFieldCredential() which handles both * base64 (injection path) and raw JSON (validator path). */ export declare function parseSendSafelyCredential(value: string): SendSafelyCredentials; /** * Create a SendSafely client instance from credentials */ export declare function createClient(creds: SendSafelyCredentials): SendSafely; /** * Verify credentials by requesting the authenticated user email */ export declare function verifyCredentials(client: SendSafely): Promise; /** * Create a new empty package */ export declare function createPackage(client: SendSafely): Promise<{ packageId: string; serverSecret: string; packageCode: string; keyCode: string; }>; /** * Add a recipient to a package */ export declare function addRecipient(client: SendSafely, packageId: string, email: string): Promise; /** * Add multiple recipients to a package in a single API call. * Also accepts a single email string for convenience. */ export declare function addRecipients(client: SendSafely, packageId: string, emails: string | string[]): Promise; /** * Encrypt and upload a file to a package */ export declare function encryptAndUploadFile(client: SendSafely, packageId: string, packageCode: string, serverSecret: string, fileName: string, fileData: Buffer): Promise<{ fileId: string; }>; /** * Encrypt a message client-side. Returns the encrypted text which must * then be saved to the server via saveMessage(). */ export declare function encryptMessage(client: SendSafely, packageId: string, packageCode: string, serverSecret: string, message: string): Promise; /** * Finalize a package (triggers notification to recipients). * * Uses the standard `finalizePackage` SDK method which: * 1. Gets public keys for all recipients * 2. Encrypts the keyCode with each recipient's public key * 3. Uploads encrypted keycodes to the server * 4. Calls the finalize HTTP endpoint * * Note: Requires a patched `keyGeneratorWorker.js` that exposes * `self.send = send;` — otherwise the keycode encryption callback * never fires because `self.send` is undefined in eval'd context. */ export declare function finalizePackage(client: SendSafely, packageId: string, packageCode: string, keyCode: string): Promise; /** * Save an encrypted message to a package on the server. * Must be called after encryptMessage() to persist the encrypted text. */ export declare function saveMessage(client: SendSafely, packageId: string, encryptedMessage: string): Promise; /** * Update a package (e.g. set expiration via { life: N }) */ export declare function updatePackage(client: SendSafely, packageId: string, data: { life: number; }): Promise>; /** * Get package information by package ID */ export declare function getPackageInfo(client: SendSafely, packageId: string): Promise>; //# sourceMappingURL=sendsafely.utils.d.ts.map