/** * @bunkor/crypto — VaultClient * * Repository-pattern client for all Vault, File, Folder, Sharing, Upload Link, * Public Share, and Audit Log operations. * * Design patterns: * - Repository: clean CRUD interface over the Bunkor Vault API * - Template Method: inherits auth + error handling from BaseClient * * Usage: * ```ts * const vault = new VaultClient({ apiUrl: 'https://lockbox-app-…', apiToken: 'sk_…' }); * const list = await vault.listVaults(); * const files = await vault.listFiles(vaultId); * ``` * * Licensed under the Apache License, Version 2.0 */ import { BunkorConfig } from '../config'; import { BaseClient } from './base.client'; import { Vault, CreateVaultRequest, CreateVaultResponse, ListVaultsResponse, RenameVaultRequest, RenameVaultResponse, FileListResponse, FileUploadResponse, InitiateResumableUploadRequest, InitiateResumableUploadResponse, ConfirmResumableUploadRequest, InitiateProviderDownloadResponse, RenameFileRequest, RenameFileResponse, VaultFolder, CreateFolderRequest, FolderResponse, RenameFolderRequest, RenameFolderResponse, EncryptVaultRequest, UnlockVaultRequest, VaultSecurityResponse, ShareVaultRequest, ShareResponse, ShareListResponse, CreateUploadLinkRequest, UploadLinkResponse, UploadLinkListResponse, UploadLinkPublicInfo, SendUploadOtpRequest, SendUploadOtpResponse, VerifyUploadOtpRequest, VerifyUploadOtpResponse, StorageUsageResponse, CheckStorageQuotaRequest, QuotaCheckResponse, CreatePublicShareLinkRequest, PublicShareLinkResponse, PublicShareLinkListResponse, PublicAccessInfo, PublicShareContent, VerifyPasswordRequest, VerifyPasswordResponse, SendOTPRequest, SendOTPResponse, VerifyOTPRequest, VerifyOTPResponse, VerifyIdentityRequest, VerifyIdentityResponse, AuditLogsResponse, SecurityEventsResponse } from '../models/vault.models'; export { DEFAULT_BUNKOR_CONFIG } from '../config'; export declare class VaultClient extends BaseClient { private readonly base; constructor(config: BunkorConfig); /** List all vaults for the authenticated organisation. */ listVaults(): Promise; /** Create a new vault. */ createVault(request: CreateVaultRequest): Promise; /** Get a single vault by ID. */ getVault(vaultId: string): Promise; /** Rename a vault. */ renameVault(vaultId: string, request: RenameVaultRequest): Promise; /** Delete a vault. */ deleteVault(vaultId: string): Promise; /** List files and folders inside a vault (optionally scoped to a folder). */ listFiles(vaultId: string, folderId?: string): Promise; /** * Upload a file to the vault (multipart/form-data). * * For large files use `initiateResumableUpload` + `confirmResumableUpload` * with direct provider upload instead. */ uploadFile(vaultId: string, file: Blob, fileName: string, options?: { folderId?: string; encryptionAlgorithm?: string; encryptionIv?: string; encryptionSalt?: string; originalFilename?: string; }): Promise; /** Begin a resumable (chunked) upload. Returns a session URL for direct-to-provider upload. */ initiateResumableUpload(vaultId: string, request: InitiateResumableUploadRequest): Promise; /** Confirm that the resumable upload has finished and register the file in Bunkor. */ confirmResumableUpload(vaultId: string, request: ConfirmResumableUploadRequest): Promise; /** Get a provider-signed download URL for a file. */ initiateDownload(vaultId: string, fileId: string): Promise; /** Delete a file. */ deleteFile(vaultId: string, fileId: string): Promise; /** Rename a file. */ renameFile(vaultId: string, fileId: string, request: RenameFileRequest): Promise; /** Create a folder inside a vault. */ createFolder(vaultId: string, request: CreateFolderRequest): Promise; /** Get folder metadata. */ getFolder(vaultId: string, folderId: string): Promise; /** Rename a folder. */ renameFolder(vaultId: string, folderId: string, request: RenameFolderRequest): Promise; /** Delete a folder and all its contents. */ deleteFolder(vaultId: string, folderId: string): Promise; /** Enable password encryption on a vault. */ encryptVault(vaultId: string, request: EncryptVaultRequest): Promise; /** Unlock an encrypted vault for the session. */ unlockVault(vaultId: string, request: UnlockVaultRequest): Promise; /** Share a vault (or specific resource within it) with a user / group. */ shareVault(vaultId: string, request: ShareVaultRequest): Promise; /** List active shares for a vault. */ listShares(vaultId: string): Promise; /** Remove a share. */ removeShare(vaultId: string, shareId: string): Promise; /** Create an upload link that lets external users upload to this vault. */ createUploadLink(vaultId: string, request: CreateUploadLinkRequest): Promise; /** List upload links for a vault. */ listUploadLinks(vaultId: string): Promise; /** Deactivate an upload link. */ deleteUploadLink(vaultId: string, uploadLinkId: string): Promise; /** Fetch metadata for a public upload link (shown before upload). */ getUploadLinkPublicInfo(token: string): Promise; /** Send OTP to the uploader's email for identity verification. */ sendUploadOtp(token: string, request: SendUploadOtpRequest): Promise; /** Verify OTP code and receive a session token. */ verifyUploadOtp(token: string, request: VerifyUploadOtpRequest): Promise; /** Get storage usage statistics. */ getStorageUsage(): Promise; /** Pre-flight check: can the user upload a file of the given size? */ checkStorageQuota(request: CheckStorageQuotaRequest): Promise; /** Create a public (password-protected) share link for a resource. */ createShareLink(vaultId: string, request: CreatePublicShareLinkRequest): Promise; /** List share links for a vault. */ listShareLinks(vaultId: string): Promise; /** Revoke a share link. */ revokeShareLink(vaultId: string, linkId: string): Promise; /** Get public info about a share link (before authentication). */ getPublicAccessInfo(token: string): Promise; /** Verify the share link password (zero-knowledge — only the hash is sent). */ verifySharePassword(token: string, request: VerifyPasswordRequest): Promise; /** Send OTP to a whitelisted email for share link access. */ sendShareOtp(token: string, request: SendOTPRequest): Promise; /** Verify the share OTP. */ verifyShareOtp(token: string, request: VerifyOTPRequest): Promise; /** Verify identity (name + email) for account-restricted share links. */ verifyShareIdentity(token: string, request: VerifyIdentityRequest): Promise; /** Fetch the decrypted content (files / folder listing) for a share link. */ getPublicShareContent(token: string, accessToken?: string): Promise; /** Retrieve the audit log for a share link. */ getAuditLogs(vaultId: string, linkId: string, params?: { page?: number; page_size?: number; }): Promise; /** Retrieve security events for a share link. */ getSecurityEvents(vaultId: string, linkId: string, params?: { page?: number; page_size?: number; }): Promise; } //# sourceMappingURL=vault.client.d.ts.map