@open-operational-state/types
v0.2.2
Published
Canonical TypeScript interfaces for the Open Operational State core model
Downloads
621
Readme
@open-operational-state/types
Canonical TypeScript interfaces for the Open Operational State core model.
This package is the shared contract surface for all tooling packages. It contains zero runtime logic — only type declarations, constants, and type guards.
Installation
bun add @open-operational-state/typesAPI
Core Interfaces
| Interface | Description |
|---|---|
| Snapshot | Root operational-state document |
| Subject | Identity and metadata for the observed service |
| Timing | Observation, reporting, and state-change timestamps |
| Evidence | Supporting data for a condition assessment |
| Scope | Geographic or environmental scope |
| CheckEntry | Flat check (used in health-response format) |
| ComponentEntry | Nested component (used in service-status format) |
| DependencyEntry | Nested dependency (used in service-status format) |
| DiscoveryDocument | /.well-known/operational-state document |
| ResourceEntry | Single resource in a discovery document |
| ValidationResult | Validation output with errors and warnings |
| ConformanceResult | Conformance level assessment |
Condition Vocabulary
import { LIVENESS_CONDITIONS, READINESS_CONDITIONS, HEALTH_CONDITIONS } from '@open-operational-state/types';
import { isHealthCondition, isExtensionCondition, conditionSeverity } from '@open-operational-state/types';
isHealthCondition( 'operational' ); // true
isExtensionCondition( 'x-acme-drain' ); // true
conditionSeverity( 'operational' ); // 1 (lowest orderable)
conditionSeverity( 'down' ); // 5 (highest orderable)Profile Helpers
import { PROFILE_REQUIREMENTS, isProfileId, satisfiedProfiles } from '@open-operational-state/types';
isProfileId( 'health' ); // true
isProfileId( 'custom' ); // false
satisfiedProfiles( 'status' ); // ['liveness', 'readiness', 'health', 'status']Dependencies
None. This package has zero external dependencies.
