GitInsights git.insights@1

Generated at from openvibe-contracts v0.419.0 and openvibe-sdk v0.161.0.

Version
1.0.0
Owner
git
Visibility
public
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/git/insights.v1.json

A repository's insights over a window: views, unique visitors, clones and stars per day, and commits per week. Public for a public repository, like GitHub's traffic but open. api/view/insights.

Fields

FieldTypeRequiredDescriptionConstraints
repostringyes
  • pattern ^[a-z0-9-]+/[a-z0-9][a-z0-9._-]{0,99}$
window_daysintegeryes
  • minimum 1
  • maximum 90
viewsintegeryesPage views of the repository in the window.
  • minimum 0
unique_visitorsintegeryesDistinct visitors per day, summed over the window.
  • minimum 0
clonesintegeryesSuccessful git clones and fetches served in the window.
  • minimum 0
starsobjectyes
  • no other fields
stars.totalintegeryes
  • minimum 0
stars.in_windowintegeryes
  • minimum 0
commits_per_weekarray of objectyesThe default branch's commits for each ISO week, oldest first.
  • items: no other fields
commits_per_week[].weekstringyesThe week's Monday, YYYY-MM-DD.
  • format date
commits_per_week[].commitsintegeryes
  • minimum 0
dailyarray of objectyesOne row per day of the window, oldest first.
  • items: no other fields
daily[].daystringyes
  • format date
daily[].viewsintegeryes
  • minimum 0
daily[].unique_visitorsintegeryes
  • minimum 0
daily[].clonesintegeryes
  • minimum 0
daily[].starsintegeryes
  • minimum 0

Examples

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

Valid: full
{
  "repo": "openvibers/openvibe.codes",
  "window_days": 30,
  "views": 2841,
  "unique_visitors": 412,
  "clones": 190,
  "stars": {
    "total": 12,
    "in_window": 3
  },
  "commits_per_week": [
    {
      "week": "2026-10-19",
      "commits": 18
    },
    {
      "week": "2026-10-26",
      "commits": 27
    },
    {
      "week": "2026-11-02",
      "commits": 31
    }
  ],
  "daily": [
    {
      "day": "2026-11-08",
      "views": 121,
      "unique_visitors": 18,
      "clones": 9,
      "stars": 1
    },
    {
      "day": "2026-11-09",
      "views": 96,
      "unique_visitors": 14,
      "clones": 7,
      "stars": 0
    }
  ]
}
Rejected: window-and-negative
{
  "repo": "openvibers/openvibe.codes",
  "window_days": 400,
  "views": -1,
  "unique_visitors": 0,
  "clones": 0,
  "stars": {
    "total": 0,
    "in_window": 0
  },
  "commits_per_week": [],
  "daily": [
    {
      "day": "2026-11-09",
      "views": 0,
      "unique_visitors": 0,
      "clones": 0,
      "stars": 0,
      "bots": 1
    }
  ]
}

Validate

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