feat: add driveItem versions API - #73
Open
dschmidt wants to merge 1 commit into
Open
Conversation
dschmidt
marked this pull request as ready for review
September 7, 2026 09:18
dschmidt
requested review from
butonic,
dragotin,
fschade,
kulmann,
micbar and
rhafer
as code owners
September 7, 2026 09:18
dschmidt
added a commit
to opencloud-eu/opencloud
that referenced
this pull request
Sep 7, 2026
Implements the MS Graph driveItemVersion operations on files:
- GET .../items/{id}/versions lists the versions, newest first
- GET .../versions/{version-id} returns one version, "current" describes the file itself
- GET .../versions/{version-id}/content redirects to a signed download url for the version
- POST .../versions/{version-id}/restoreVersion makes the version the current content
The operations map onto ListFileVersions and RestoreFileVersion of the
gateway. Version downloads point at the WebDAV meta endpoint, signed the
same way as the driveItem download url. The download url is only added
when requested via $select.
The driveItemVersion models are vendored from the regenerated client of
opencloud-eu/libre-graph-api#73 until that spec change is merged and the
dependency can be bumped.
dschmidt
added a commit
to opencloud-eu/opencloud
that referenced
this pull request
Sep 7, 2026
Implements the MS Graph driveItemVersion operations on files:
- GET .../items/{id}/versions lists the versions, newest first
- GET .../versions/{version-id} returns one version, "current" describes the file itself
- GET .../versions/{version-id}/content redirects to a signed download url for the version
- POST .../versions/{version-id}/restoreVersion makes the version the current content
The operations map onto ListFileVersions and RestoreFileVersion of the
gateway. Version downloads point at the WebDAV meta endpoint, signed the
same way as the driveItem download url. The download url is only added
when requested via $select.
The driveItemVersion models are vendored from the regenerated client of
opencloud-eu/libre-graph-api#73 until that spec change is merged and the
dependency can be bumped.
dschmidt
added a commit
to opencloud-eu/opencloud
that referenced
this pull request
Sep 7, 2026
Implements the MS Graph driveItemVersion operations on files:
- GET .../items/{id}/versions lists the versions, newest first
- GET .../versions/{version-id} returns one version, "current" describes the file itself
- GET .../versions/{version-id}/content redirects to a signed download url for the version
- POST .../versions/{version-id}/restoreVersion makes the version the current content
The operations map onto ListFileVersions and RestoreFileVersion of the
gateway. Version downloads point at the WebDAV meta endpoint, signed the
same way as the driveItem download url. The download url is only added
when requested via $select.
The driveItemVersion models are vendored from the regenerated client of
opencloud-eu/libre-graph-api#73 until that spec change is merged and the
dependency can be bumped.
dschmidt
added a commit
to opencloud-eu/opencloud
that referenced
this pull request
Sep 7, 2026
Implements the MS Graph driveItemVersion operations on files:
- GET .../items/{id}/versions lists the versions, newest first
- GET .../versions/{version-id} returns one version, "current" describes the file itself
- GET .../versions/{version-id}/content redirects to a signed download url for the version
- POST .../versions/{version-id}/restoreVersion makes the version the current content
The operations map onto ListFileVersions and RestoreFileVersion of the
gateway. Version downloads point at the WebDAV meta endpoint, signed the
same way as the driveItem download url. The download url is only added
when requested via $select.
The driveItemVersion models are vendored from the regenerated client of
opencloud-eu/libre-graph-api#73 until that spec change is merged and the
dependency can be bumped.
7 tasks
dschmidt
force-pushed
the
feat/driveitem-versions
branch
from
September 8, 2026 07:44
d6a2120 to
779085d
Compare
Model the MS Graph driveItemVersion resource and its operations: list, get, download content and restore a version.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Models the MS Graph driveItemVersion resource and its four operations under
/v1.0/drives/{drive-id}/items/{item-id}/versions:GET .../versionslists the versions of a file, newest first. Like MS Graph, no$orderby,$filter,$topor$skip.GET .../versions/{version-id}returns one version.currentis accepted as an alias for the current version, as in MS Graph.GET .../versions/{version-id}/contentanswers with a 302 to a pre-authenticated URL, same pattern as the driveItem/contentendpoint.POST .../versions/{version-id}/restoreVersionreturns 204. The previously current content is kept as a new version, the restored version leaves the collection. 423 if the file is locked.The
driveItemVersionschema carriesid,lastModifiedDateTime,size,contentand the@microsoft.graph.downloadUrlannotation, which is only populated when requested via$select.lastModifiedByis part of the schema for MS Graph compatibility but documented as omitted, since the storage does not record who created a version. The MS Graphpublicationfacet is left out.The operations map onto the existing CS3 calls
ListFileVersions,RestoreFileVersionand a revision-key download, so no storage changes are needed. The MS Graphversionsrelationship on driveItem and$expand=versionsare intentionally not included yet, as that would need a batched listing path in the storage provider.