File version history: list versions, read one, download its content, and restore it as the current version. Versions are kept for files in OneDrive for work or school and SharePoint libraries (subject to the library's version limit) and in personal OneDrive.
Permissions. Files.Read / Files.Read.All to read;
Files.ReadWrite / Files.ReadWrite.All to restore.
Functions
download-version
fn (item: Any, version-id: Str): ::microsoft::onedrive/FileContent
fn (item: Any, version-id: Str, opts: Map): ::microsoft::onedrive/FileContent
GET {item}/versions/{version-id}/content - the bytes of one version as a FileContent (source: "version").
get-version
fn (item: Any, version-id: Str): Map
fn (item: Any, version-id: Str, opts: Map): Map
GET {item}/versions/{version-id}.
list-versions
fn (item: Any): Vec
fn (item: Any, opts: Map): Vec
GET {item}/versions - every version (id such as "3.0",
lastModifiedDateTime, lastModifiedBy, size), newest first.
versions ::microsoft::onedrive::versions/list-versions("/Contracts/MSA.docx")
restore-version
fn (item: Any, version-id: Str): Bool
fn (item: Any, version-id: Str, opts: Map): Bool
POST {item}/versions/{version-id}/restoreVersion - make an earlier version current (creates a new version). Returns true.
version-path
fn (item: Any, version-id: Str, opts: Map): Str