VisionUiCheckRequest vision.ui-check-request@1

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

Version
1.0.0
Owner
vision
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/vision/ui-check-request.v1.json

vision.ui-check-request@1: the JSON body of POST /api/v1/ui-check on OpenVibe.Vision (Design's Arena and signed-in people; HTML, URL and screenshot checks also work anonymously). Send exactly one source: `html` with the markup, `url` with a public http(s) page, `image` with a data URL, or `image_url` with a public image URL. The multipart form field `image` is the same screenshot source. `viewport` defaults to 1280x800 and is clamped to 160..10000; the check executes no JavaScript and fetches only a public URL through the SSRF guard.

Fields

FieldTypeRequiredDescriptionConstraints
htmlstringThe HTML to check, including any inline CSS.
  • maxLength 5000000
urlstringA public page to fetch and check.
  • pattern ^https?://
  • format uri
imagestringA screenshot as an image data URL.
  • pattern ^data:image/
image_urlstringA public screenshot URL.
  • pattern ^https?://
  • format uri
viewportobject
  • no other fields
viewport.wintegeryes
  • minimum 160
  • maximum 10000
viewport.hintegeryes
  • minimum 160
  • maximum 10000

Examples

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

Valid: html
{
  "html": "<!doctype html><style>.card{width:1400px}</style><div class=\"card\">x</div>",
  "viewport": {
    "w": 390,
    "h": 844
  }
}
Rejected: no-source
{
  "viewport": {
    "w": 390,
    "h": 844
  }
}

Validate

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