MediaFile media.file@1
Generated at from
openvibe-contracts v0.53.0 and
openvibe-sdk v0.11.0.
- Version
- 1.0.0
- Owner
- media
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/media/file.v1.json
media.file@1: one stored file of a tenant on OpenVibe.Media (server/files/routes.js filePublic): its key, owner, name, size, type and hash, and the URL it is served from (/f/<key>; a developer-project sandbox file gets a short-lived signed URL instead).
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
key | string | yes | ||
app_id | string | yes | ||
user_id | string | integer | null | |||
original_name | string | yes | ||
size | integer | yes |
| |
mime | string | yes | ||
sha256 | string | null | |||
url | string | yes | ||
sandbox | const |
| ||
url_expires_at | string | integer | |||
created_at | string | yes |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: png
{
"key": "f_9c1b2e7d",
"app_id": "live",
"user_id": 17,
"original_name": "overlay.png",
"size": 48213,
"mime": "image/png",
"sha256": "3f1c0b8e2a9d7c6b5a4f3e2d1c0b9a8f7e6d5c4b3a2f1e0d9c8b7a6f5e4d3c2b",
"url": "/f/f_9c1b2e7d",
"created_at": "2026-09-25 18:00:00"
}Rejected: negative-size
{
"key": "k",
"app_id": "live",
"original_name": "x",
"size": -1,
"mime": "image/png",
"url": "/f/k",
"created_at": "x"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('media.file@1', value); // { valid, errors: [{ path, message }] }