NetworkFollowWriteRequest network.follow-write-request@1

Generated at from openvibe-contracts v0.76.0 and openvibe-sdk v0.20.1.

Version
1.0.0
Owner
network
Visibility
first-party
Status
active
Compatibility
backward
Decision
ADR-030
Schema
https://openvibe.network/contracts/network/follow-write-request.v1.json

network.follow-write-request@1 (ADR-030 step 4; capability network.follows.write): a first-party product records a follow or unfollow on a person's behalf, where they pressed the button. PUT /internal/follows/:type/:target { follower, notify_email?, notify_push? } follows (idempotent; flags change a follow). DELETE /internal/follows/:type/:target?follower=usr_… unfollows (idempotent). Answers network.follow-status-result@1 for the follower. Network emits network.follow.* as for a person's own change.

Fields

FieldTypeRequiredDescriptionConstraints
followerstringyes
  • pattern ^usr_[0-9A-HJKMNP-TV-Z]{26}$
notify_emailboolean
notify_pushboolean

Examples

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

Valid: follow
{
  "follower": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "notify_push": true
}
Rejected: live-id
{
  "follower": "42"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('network.follow-write-request@1', value);   // { valid, errors: [{ path, message }] }