MediaUploadComplete media.upload-complete@1
Generated at from
openvibe-contracts v0.419.0 and
openvibe-sdk v0.161.0.
- Version
- 1.0.0
- Owner
- media
- Visibility
- public
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/media/upload-complete.v1.json
Complete an upload after all parts arrive. Media assembles the bytes, verifies the optional hashes and content type, and returns the ready object.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
content_hash | string |
| ||
parts | array of object |
| ||
parts[].part_number | integer | yes |
| |
parts[].sha256 | string | yes |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: basic
{
"parts": [
{
"part_number": 1,
"sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
]
}Rejected: basic
{
"parts": [
{}
]
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('media.upload-complete@1', value); // { valid, errors: [{ path, message }] }