@open-operational-state/oos
v0.3.0
Published
Open Operational State — serve and probe operational state endpoints
Readme
@open-operational-state/oos
The developer-facing package for Open Operational State. Install this one package to get the CLI and the programmatic API.
Install
npm install @open-operational-state/oosCLI
After local install, the oos binary is available:
npx oos probe https://api.example.com/health
npx oos validate snapshot.json
npx oos fixtures ./conformance-fixtures --format=table
npx oos inspect snapshot.jsonOr run without installing:
npx @open-operational-state/oos probe https://api.example.com/healthOr install globally:
npm i -g @open-operational-state/oos
oos probe https://api.example.com/healthCommands
| Command | Description |
|---|---|
| probe <url> | Fetch a URL, auto-detect format, parse to core model |
| validate <file> | Validate a JSON file against conformance levels |
| fixtures <dir> | Run all conformance fixtures in a directory |
| inspect <file> | Parse a JSON file, pretty-print core model |
Options
| Option | Description |
|---|---|
| --format=json\|table | Output format (default: json) |
| --help | Show help |
Programmatic API
import { probe } from '@open-operational-state/oos';
const result = await probe( 'https://api.example.com/health' );
console.log( result.snapshot.condition ); // 'operational'
console.log( result.httpStatus ); // 200
console.log( result.validation.valid ); // trueWhat this package includes
@open-operational-state/oos is an umbrella package that bundles:
probe— programmatic endpoint probingvalidator— conformance validation, fixture runner, CLI implementation
You don't need to install the lower-level packages separately.
License
Licensed under Apache 2.0.
