SourcesSourceReadResult sources.source-read-result@1

Generated at from openvibe-contracts v0.53.0 and openvibe-sdk v0.11.0.

Version
1.0.0
Owner
sources
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/sources/source-read-result.v1.json

sources.source-read-result@1: answers of sources.source.read on OpenVibe.Sources. GET /api/v1/sources → { sources }; GET /api/v1/sources/:key → { source } (sources.source@1 with health); GET /api/v1/sources/:key/runs?before=&limit= → { runs, next_before } (newest first); GET /api/v1/runs?after=&source=&state=&limit= → { runs, next_after } (every source's fetch runs in order; state failed means any failure); GET /api/v1/health → { counts, attention } (sources by health status, and the failing, stale or never fetched ones).

Fields

This schema has no named fields.

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: health
{
  "counts": {
    "healthy": 11,
    "stale": 1
  },
  "attention": [
    {
      "key": "example-deals",
      "category": "deals",
      "type": "api",
      "status": "stale"
    }
  ]
}
Valid: list
{
  "sources": [
    {
      "key": "nasa-news",
      "name": "NASA news releases",
      "type": "rss",
      "category": "news",
      "homepage_url": "https://www.nasa.gov/",
      "endpoints": [
        {
          "url": "https://www.nasa.gov/news-release/feed/"
        }
      ],
      "auth": {
        "mode": "none"
      },
      "robots_note": "robots.txt allows the feed path (checked 2026-09-23)",
      "terms_note": "US government work; verify before enabling",
      "license_note": null,
      "min_interval_ms": 60000,
      "poll_interval_sec": 3600,
      "stale_after_sec": 172800,
      "max_items": 200,
      "enabled": false,
      "review_required": true,
      "sensitivity": "none",
      "default_indexability": "noindex"
    }
  ]
}
Valid: runs
{
  "runs": [
    {
      "id": "run_1",
      "source_key": "example-news",
      "endpoint_url": "https://news.example.com/feed.xml",
      "trigger": "schedule",
      "started_at": "2026-09-25T18:00:00.000Z",
      "finished_at": "2026-09-25T18:00:01.000Z",
      "state": "ok",
      "http_status": 200,
      "error_code": null,
      "detail": null,
      "bytes": 18234,
      "raw_body_hash": null,
      "parser_version": "rss@1",
      "items": {
        "seen": 20,
        "created": 2
      },
      "seq": 991
    }
  ],
  "next_after": 991
}
Rejected: runs-without-cursor
{
  "runs": []
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('sources.source-read-result@1', value);   // { valid, errors: [{ path, message }] }