SpaceAppClaimedPayload space.app.claimed@1

Generated at from openvibe-contracts v0.419.0 and openvibe-sdk v0.161.0.

Version
1.0.0
Owner
space
Visibility
first-party
Status
active
Compatibility
backward
Decision
ADR-004
Schema
https://openvibe.network/contracts/events/payloads/space.app.claimed.v1.json

space.app.claimed v1 (OpenVibe.Space, subject space spc_…, visibility internal): a guest draft (a space with no owner, edited with a secret link) was claimed by a signed-in person. The draft is that person's space now and its secret is gone. No secret, no file contents.

Fields

FieldTypeRequiredDescriptionConstraints
space_idstringyesthe space that was claimed
  • pattern ^spc_[0-9A-HJKMNP-TV-Z]{26}$
slugstringyesthe address it now has (one DNS label; the space is served at <slug>.openvibe.website once it is published)
  • pattern ^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9])){2,39}$
namestringyesthe space's name
  • minLength 1
  • maxLength 40
templatestringthe template it started from, when it started from one
  • maxLength 40

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: from-template
{
  "space_id": "spc_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "slug": "my-bakery-ab12",
  "name": "Business site",
  "template": "site-bakery"
}
Valid: no-template
{
  "space_id": "spc_01JAB2C3D4E5F6G7H8J9K0MNPR",
  "slug": "my-bakery-ab12",
  "name": "Untitled site"
}
Rejected: no-space-id
{
  "slug": "my-bakery-ab12",
  "name": "Business site"
}
Rejected: secret-in-payload
{
  "space_id": "spc_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "slug": "my-bakery-ab12",
  "name": "Business site",
  "key": "the-draft-secret"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('space.app.claimed@1', value);   // { valid, errors: [{ path, message }] }