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

FieldTypeRequiredDescriptionConstraints
kindenumyes
  • one of "vod", "clip", "file", "thumbnail", "screenshot", "avatar", "asset"
size_bytesintegeryes
  • minimum 1
multipartconstyes
  • = true
part_sizeintegerUse 8388608 for 8 MiB parts; the service may increase it to stay below 10000 parts.
  • minimum 5242880
visibilityenum
  • one of "public", "unlisted", "private"
mime_typestring
filenamestring
content_hashstring
  • pattern ^[a-fA-F0-9]{64}$
namespacestring
user_idstring | integer
metadataobject

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 }] }