Auto-Drive SDK Available Functions
Upload Operations
uploadFile(api, file, options): Promise<string>: Uploads a file (using a buffer,File, or a custom interface) with optional encryption and compression. Returns the resulting CID as a string.uploadFileFromFilepath(api, filePath, options): Promise<string>: Uploads a file from filepath with optional encryption and compression. Returns the resulting CID as a string.uploadFileFromInput(api, file, options): Promise<string>: Uploads a file obtained from a browser’sFileAPI.uploadFolderFromInput(api, fileList, options): Promise<string>: Uploads a folder from a browser’sFileList.uploadFileWithinFolderUpload(api, uploadId, file, options): Promise<string>: Uploads a file within an existing folder upload session.uploadObjectAsJSON(api, object, name?, options): Promise<string>: Serializes and uploads any object as a JSON file.
Download Operations
downloadFile(api, cid, password?): AsyncIterable<Buffer>: Downloads a file from its CID, with optional decryption using a password.getMyFiles(api, page, limit): Promise<PaginatedResult<ObjectSummary>>: Retrieves paginated list of user’s files.searchByNameOrCIDInMyFiles(api, value): Promise<ObjectSummary[]>: Searches for files by name or CID within user’s files.searchByNameOrCID(api, value): Promise<ObjectSummary[]>: Global search for files by name or CID.
Utility Functions
getPendingCredits(api): Promise<{ upload: number; download: number }>: Gets the current user’s pending upload and download credits.getSubscriptionInfo(api): Promise<SubscriptionInfo>: Retrieves the current user’s subscription information.