diff --git a/claim.capnp b/claim.capnp index 8459f33..00d3622 100644 --- a/claim.capnp +++ b/claim.capnp @@ -12,6 +12,7 @@ using import "utils.capnp".OID; using import "utils.capnp".Map; using import "utils.capnp".SturdyRef; using import "projects.capnp".Project; +using import "traits.capnp".Hint; interface Claimable { claim @0 ( project :Project ) -> Fallible(Claim, ClaimError); diff --git a/interest.capnp b/interest.capnp index b068b1d..c35e352 100644 --- a/interest.capnp +++ b/interest.capnp @@ -25,8 +25,20 @@ interface Interestable { interface Interest extends (Owned) { resource @0 () -> ( resource :Resource, dummy :UInt8 ); describe @1 () -> Description; - drop @2 (); - upgrade @3 () -> ( claim :Claim ); + + drop @2 () -> Fallible(DropOk, DropError); + struct DropOk { + + } + struct DropError { + + } + + upgrade @3 () -> ( claim :Fallible(Claim, UpgradeError) ); + + struct UpgradeError { + + } } struct InterestKind { diff --git a/resource.capnp b/resource.capnp index 484dc49..02fc9ec 100644 --- a/resource.capnp +++ b/resource.capnp @@ -16,6 +16,8 @@ using import "utils.capnp".OID; using import "utils.capnp".L10NString; using import "utils.capnp".Map; +using import "traits.capnp".Hint; + using import "cache.capnp".Cache; struct RestoredResource { @@ -54,6 +56,8 @@ struct Resource { # does not support claiming or locking. audit @6 :Auditable; + + hint @7 :Hint; } struct Description { diff --git a/traits.capnp b/traits.capnp index a1b0204..c99545f 100644 --- a/traits.capnp +++ b/traits.capnp @@ -1,7 +1,9 @@ @0xc0542f62613a5c5e; using CSharp = import "programming_language/csharp.capnp"; -$CSharp.namespace("FabAccessAPI.Schema"); +$CSharp.namespace("FabAccessAPI.Schema"); + +using OID = import "utils.capnp".OID; interface TraitSuper { getName @0 () -> ( name :Text ); @@ -13,3 +15,9 @@ struct TraitError(ConstraintError) { constraintViolation @1 :ConstraintError; } } + +interface Hint { + getOid @0 () -> ( oid :OID ); + getAbstract @1 () -> ( abstract :List(Hint) ); + # Sorted least to most abstract. abstract[0] is the next less specific Hint. +} diff --git a/utils.capnp b/utils.capnp index 231e043..492792f 100644 --- a/utils.capnp +++ b/utils.capnp @@ -99,3 +99,8 @@ struct When { start @0 :Timestamp; end @1 :Timestamp; } + +struct TreeNode(Value) { + value @0 :Value; + children @1 :List(TreeNode(Value)); +}