MediaUploadPart media.upload-part@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-part.v1.json
A verified part received by Media. PUT the raw bytes to the presigned URL; X-Content-SHA256 is optional.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
part_number | integer | yes |
| |
size_bytes | integer | yes |
| |
sha256 | string | yes |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: basic
{
"part_number": 1,
"size_bytes": 8388608,
"sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}Rejected: basic
{
"part_number": 0,
"size_bytes": 0,
"sha256": "bad"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('media.upload-part@1', value); // { valid, errors: [{ path, message }] }