app.core.revisions
Revisions API router - full CRUD for Kumiho revisions including tagging.
Functions
|
Create a new revision for an item. |
|
Delete a revision. |
|
Deprecate or restore a revision. |
|
Get the latest revision of an item. |
|
Get a specific revision by kref with optional revision/tag resolution. |
|
Get the revision that had a specific tag at a given point in time. |
|
Check if a revision has a specific tag. |
|
List all revisions of an item. |
|
Get the next revision number that would be assigned. |
|
Apply a tag to a revision. |
|
Remove a tag from a revision. |
|
Update a revision's metadata. |
|
Check if a revision was ever tagged with a specific tag. |
- async app.core.revisions.list_revisions(item_kref=Query(PydanticUndefined), client=Depends(dependency=<function get_kumiho_client>, use_cache=True, scope=None))[source]
List all revisions of an item.
- Parameters:
item_kref (str)
client (Any)
- async app.core.revisions.create_revision(request, client=Depends(dependency=<function get_kumiho_client>, use_cache=True, scope=None))[source]
Create a new revision for an item.
- Parameters:
request (RevisionCreate)
client (Any)
- async app.core.revisions.get_revision(kref=Query(PydanticUndefined), r=Query(None), t=Query(None), client=Depends(dependency=<function get_kumiho_client>, use_cache=True, scope=None))[source]
Get a specific revision by kref with optional revision/tag resolution.
- Parameters:
kref (str)
r (int | None)
t (str | None)
client (Any)
- async app.core.revisions.get_latest_revision(item_kref=Query(PydanticUndefined), client=Depends(dependency=<function get_kumiho_client>, use_cache=True, scope=None))[source]
Get the latest revision of an item.
- Parameters:
item_kref (str)
client (Any)
- async app.core.revisions.peek_next_revision(item_kref=Query(PydanticUndefined), client=Depends(dependency=<function get_kumiho_client>, use_cache=True, scope=None))[source]
Get the next revision number that would be assigned.
- Parameters:
item_kref (str)
client (Any)
- async app.core.revisions.update_revision_metadata(kref=Query(PydanticUndefined), r=Query(None), request=None, client=Depends(dependency=<function get_kumiho_client>, use_cache=True, scope=None))[source]
Update a revision’s metadata.
- Parameters:
kref (str)
r (int | None)
request (RevisionUpdate | None)
client (Any)
- async app.core.revisions.delete_revision(kref=Query(PydanticUndefined), r=Query(None), force=Query(False), client=Depends(dependency=<function get_kumiho_client>, use_cache=True, scope=None))[source]
Delete a revision.
- Parameters:
kref (str)
r (int | None)
force (bool)
client (Any)
- async app.core.revisions.deprecate_revision(kref=Query(PydanticUndefined), r=Query(None), deprecated=Query(True), client=Depends(dependency=<function get_kumiho_client>, use_cache=True, scope=None))[source]
Deprecate or restore a revision.
- Parameters:
kref (str)
r (int | None)
deprecated (bool)
client (Any)
- async app.core.revisions.tag_revision(kref=Query(PydanticUndefined), r=Query(None), request=None, client=Depends(dependency=<function get_kumiho_client>, use_cache=True, scope=None))[source]
Apply a tag to a revision.
- Parameters:
kref (str)
r (int | None)
request (TagRequest | None)
client (Any)
- async app.core.revisions.untag_revision(kref=Query(PydanticUndefined), tag=Query(PydanticUndefined), r=Query(None), client=Depends(dependency=<function get_kumiho_client>, use_cache=True, scope=None))[source]
Remove a tag from a revision.
- Parameters:
kref (str)
tag (str)
r (int | None)
client (Any)
- async app.core.revisions.has_tag(kref=Query(PydanticUndefined), tag=Query(PydanticUndefined), r=Query(None), client=Depends(dependency=<function get_kumiho_client>, use_cache=True, scope=None))[source]
Check if a revision has a specific tag.
- Parameters:
kref (str)
tag (str)
r (int | None)
client (Any)
- async app.core.revisions.was_tagged(kref=Query(PydanticUndefined), tag=Query(PydanticUndefined), r=Query(None), client=Depends(dependency=<function get_kumiho_client>, use_cache=True, scope=None))[source]
Check if a revision was ever tagged with a specific tag.
- Parameters:
kref (str)
tag (str)
r (int | None)
client (Any)
- async app.core.revisions.get_revision_as_of(item_kref=Query(PydanticUndefined), tag=Query(PydanticUndefined), time=Query(PydanticUndefined), client=Depends(dependency=<function get_kumiho_client>, use_cache=True, scope=None))[source]
Get the revision that had a specific tag at a given point in time.
This endpoint enables time-travel queries for reproducible builds and historical analysis. It answers questions like: “What was the published revision on June 1st, 2025?”
The query finds the revision that had the specified tag active at the given timestamp, using the tag history time-ranges stored by Kumiho.
- Parameters:
item_kref (
str) – The item reference (e.g., ‘MyProject/Assets/Hero.model’)tag (
str) – The tag to query (commonly ‘published’, ‘approved’, ‘latest’)time (
str) – The point in time to query. Supports two formats: - YYYYMMDDHHMM: e.g., ‘202506011430’ for June 1, 2025 at 14:30 - ISO 8601: e.g., ‘2025-06-01T14:30:00Z’client (Any)
- Returns:
The revision that had the tag at that time.
- Return type:
RevisionResponse
- Raises:
404 – If no revision had the specified tag at that time.
400 – If the time format is invalid.
Example
GET /api/v1/revisions/as-of?item_kref=MyProject/Assets/Hero.model&tag=published&time=202506011430