delete_file
Deletes a file from the user’s storage canister. Arguments:file_id: The ID of the file to delete.
DeleteFileResponse: A response object indicating the result of the delete operation.
download_file
Downloads a file from the user’s storage canister. Arguments:file_id: The ID of the file to download.chunk: The chunk number to download.
FileDownloadResponse: A response object containing the file data and metadata.
get_alias_info
Returns information about a file alias that is being uploaded. Arguments:alias: The alias of the file to retrieve information for.
Result: A response object containing the result of the alias lookup, including the file ID and metadata if found.
get_requests
Returns a list of file requests made by the user. Returns:vec PublicFileMetadata: A vector of PublicFileMetadata objects containing information about the file requests.
get_shared_files
Returns a list of files shared with a specific user. Arguments:user_id: The user ID of the user to retrieve shared files for.
vec PublicFileMetadata: A vector of PublicFileMetadata objects containing information about the shared files.
public_key
Returns the public key of the user. Returns:blob: The public key of the user in binary format.
request_file
Creates a new file request for the user for uploading a file. Arguments:path: The path where the file will be uploaded.
RequestFileResponse: A response object containing the opreation result. In case of success, it contains the file alias (UUIDv7) that can be used to upload the file.
revoke_share
Revokes access to a shared file for a specific user. Arguments:user_id: The user ID of the user to revoke access from.file_id: The ID of the file to revoke access to.
set_public_key
Updates the public key of the user. Arguments:blob: The new public key of the user in binary format.
share_file (2)
Shares a file with a specific user. Arguments:user_id: The user ID of the user to share the file with.file_id: The ID of the file to share.blob: file key encrypted with the user’s public key.
share_file_with_users (2)
Shares a file with multiple users. Arguments:user_ids: A vector of user IDs to share the file with.file_id: The ID of the file to share.vec blob: A vector of file keys encrypted with the users’ public keys.
upload_file
Uploads the first chunk of a file to the user’s storage canister. Arguments:UploadFileRequest: An object containing the file data and metadata to upload.
upload_file_atomic
Uploads a file atomically to the user’s storage canister. This means that the file is either created and uploaded in one go, or not created at all. Arguments:UploadFileAtomicRequest: An object containing the file data and metadata to upload.
UploadFileAtomicResponse: A response object indicating the result of the atomic upload operation.
upload_file_continue
Upload any chunk after the first one of a file that was started withupload_file.
All chunks after the first one must be uploaded with this method.
Arguments:
UploadFileContinueRequest: An object containing the file data and metadata to continue the upload.
UploadFileContinueResponse: A response object indicating the result of the continued upload operation.