Revision class

A specific iteration of an item in the Kumiho system.

Revisions are immutable snapshots of an item at a point in time. Each revision can have multiple artifacts (file references), tags for categorization, and edges to other revisions for dependency tracking. The class presents these capabilities through first-class Dart models so the API surface remains stable even if the underlying protobuf schema evolves.

final revision = await kumiho.getRevision('kref://project/models/hero.model?r=1');

// Add artifacts
await revision.createArtifact('mesh', '/assets/hero.fbx');
await revision.createArtifact('textures', '/assets/hero_tex.zip');

// Tag the revision
await revision.tag('approved');

// Create edges to dependencies
final texture = await kumiho.getRevision('kref://project/tex/skin.texture?r=3');
await revision.createEdge(texture, EdgeType.dependsOn);
Inheritance

Constructors

Revision(RevisionResponse response, dynamic client)
Creates a Revision from a protobuf response.

Properties

author String
The user ID who created the revision.
latefinal
client → dynamic
The client instance for making API calls.
finalinherited
createdAt String?
ISO timestamp when the revision was created.
latefinal
defaultArtifact String?
Name of the default artifact.
latefinal
deprecated bool
Whether the revision is deprecated.
latefinal
hashCode int
The hash code for this object.
no setterinherited
item Future
Gets the parent item of this revision.
no setter
itemKref Kref
Reference to the parent item.
latefinal
kref Kref
The unique reference URI for this revision.
latefinal
latest bool
Whether this is currently the latest revision.
latefinal
metadata Map<String, String>
Custom metadata key-value pairs.
latefinal
number int
The revision number (1-based).
latefinal
published bool
Whether the revision is published.
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tags List<String>
Gets the tags for this revision.
no setter
username String
Display name of the creator.
latefinal

Methods

analyzeImpact({List<String>? edgeTypes, int maxDepth = 10}) Future<ImpactAnalysisResponse>
Analyzes the impact of changes to this revision.
createArtifact(String name, String location, {Map<String, String>? metadata}) Future<Artifact>
Creates a new artifact for this revision.
createEdge(Revision target, String edgeType, {Map<String, String>? metadata}) Future<void>
Creates an edge from this revision to another revision.
createEdgeTo(String targetKref, String edgeType, {Map<String, String>? metadata}) Future<void>
Creates an edge from this revision to a target kref.
getArtifact(String name) Future<Artifact>
Gets an artifact by name.
getArtifacts() Future<List<Artifact>>
Gets all artifacts for this revision.
getEdges({String? edgeTypeFilter, EdgeDirection? direction}) Future<List<Edge>>
Gets all edges from this revision.
getItem() Future
Gets the parent item of this revision.
hasTag(String tag) Future<bool>
Checks if this revision has a specific tag.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setDefaultArtifact(String artifactName) Future<void>
Sets the default artifact for this revision.
setMetadata(Map<String, String> metadata) Future<void>
Sets metadata for this revision.
tag(String tag) Future<void>
Tags this revision with the given tag.
toString() String
A string representation of this object.
override
traverseEdges({String direction = 'outgoing', List<String>? edgeTypes, int maxDepth = 10}) Future<List<Kref>>
Traverses edges starting from this revision.
untag(String tag) Future<void>
Removes a tag from this revision.
wasTagged(String tag) Future<bool>
Checks if this revision has ever had a specific tag.

Operators

operator ==(Object other) bool
The equality operator.
inherited