MediaUploadCreate media.upload-create@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-create.v1.json
Create a Media object with a multipart upload session. The caller needs media.object.upload for the tenant namespace; the upload token then authorizes parts and completion.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
kind | enum | yes |
| |
size_bytes | integer | yes |
| |
multipart | const | yes |
| |
part_size | integer | Use 8388608 for 8 MiB parts; the service may increase it to stay below 10000 parts. |
| |
visibility | enum |
| ||
mime_type | string | |||
filename | string | |||
content_hash | string |
| ||
namespace | string | |||
user_id | string | integer | |||
metadata | object |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: basic
{
"kind": "file",
"size_bytes": 8388608,
"multipart": true,
"part_size": 8388608,
"visibility": "private"
}Rejected: basic
{
"kind": "file",
"size_bytes": 0,
"multipart": false
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('media.upload-create@1', value); // { valid, errors: [{ path, message }] }