Misc
Misc protocol schemas
TypeScript Usage
import { CapabilityDeclarationSchema, TenancyPostureSchema } from '@objectstack/spec/security';
import type { CapabilityDeclaration, TenancyPosture } from '@objectstack/spec/security';
// Validate data
const result = CapabilityDeclarationSchema.parse(data);CapabilityDeclaration
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| name | string | ✅ | Stable capability key referenced by systemPermissions / requiredPermissions |
| label | string | optional | Human label shown in Setup |
| description | string | optional | What holding this capability permits |
| scope | Enum<'platform' | 'org'> | ✅ | platform = a platform-wide power; org = scoped to an organization |
| packageId | string | optional | [ADR-0086 D3] Owning package id (author-declared fallback; absent = registry-stamped) |
| _lock | Enum<'none' | 'no-overlay' | 'no-delete' | 'full'> | optional | Item-level lock — controls overlay & delete (ADR-0010). |
| _lockReason | string | optional | Human-readable reason shown when a write is refused by _lock. |
| _lockSource | Enum<'artifact' | 'package' | 'env-forced'> | optional | Layer that set _lock (artifact | package | env-forced). |
| _provenance | Enum<'package' | 'org' | 'env-forced'> | optional | Origin of the item (package | org | env-forced). |
| _packageId | string | optional | Owning package machine id. |
| _packageVersion | string | optional | Owning package version. |
| _lockDocsUrl | string | optional | Optional documentation link surfaced next to _lockReason. |
TenancyPosture
Allowed Values
singlegroupisolated