NetworkFriendSubjects network.friend-subjects@1

Generated at from openvibe-contracts v0.443.0 and openvibe-sdk v0.177.0.

Version
1.0.0
Owner
network
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/network/friend-subjects.v1.json

network.friend-subjects@1 (capability network.friends.read): a person's mutual friends as subjects only, for an owning service (Chat's contacts and DMs, Link's sharing with a friend). GET /internal/friends?subject=usr_… on OpenVibe.Network. Never names, never the one-sided requests.

Fields

FieldTypeRequiredDescriptionConstraints
subjectstringyes
  • pattern ^usr_[0-9A-HJKMNP-TV-Z]{26}$
friendsarray of stringyes
  • maxItems 5000
  • unique items
  • items: pattern ^usr_[0-9A-HJKMNP-TV-Z]{26}$

Examples

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

Valid: two
{
  "subject": "usr_01K9R2V6M8Q4T0B7C3D5E9F2GH",
  "friends": [
    "usr_01K9R2V6M8Q4T0B7C3D5E9F2GJ"
  ]
}
Rejected: names-a-person
{
  "subject": "usr_01K9R2V6M8Q4T0B7C3D5E9F2GH",
  "friends": [
    "ada"
  ]
}

Validate

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