Capability capabilities.capability@1
Generated at from
openvibe-contracts v0.33.0 and
openvibe-sdk v0.5.0.
- Version
- 1.0.0
- Owner
- network
- Visibility
- public
- Status
- active
- Compatibility
- backward
- Decision
- ADR-003
- Schema
https://openvibe.network/contracts/capabilities/capability.v1.json
An action a principal may invoke. Authorization is checked at the owner's boundary against the grant, never inferred from the caller's route.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
id | string | yes |
| |
version | string | yes |
| |
owner | string | yes |
| |
status | enum | yes |
| |
visibility | enum | yes |
| |
description | string | |||
inputSchema | string | |||
outputSchema | string | |||
permissions | array of string | yes | ||
resourceConstraints | array of enum | yes |
| |
quotaClass | string | yes | ||
events | array of string | yes | ||
implementedBy | array of string | Current route(s) that perform this action today, e.g. 'POST /api/v1/:app/files'. |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: upload
{
"id": "media.object.upload",
"version": "1.0",
"owner": "media",
"status": "active",
"visibility": "public",
"description": "Upload a file object into an app namespace.",
"outputSchema": "media.media-ref@1",
"permissions": [
"media:write"
],
"resourceConstraints": [
"namespace",
"owner"
],
"quotaClass": "media-upload",
"events": [
"media.object.uploaded"
],
"implementedBy": [
"POST /api/v1/:app/files"
]
}Rejected: two-segment-id
{
"id": "media.upload",
"version": "1.0",
"owner": "media",
"status": "active",
"visibility": "public",
"permissions": [],
"resourceConstraints": [],
"quotaClass": "x",
"events": []
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('capabilities.capability@1', value); // { valid, errors: [{ path, message }] }