NetworkFriendCircle network.friend-circle@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-circle.v1.json

network.friend-circle@1 (plan §AB.51; the owner, 11-14: "implement the friend system so it can be used across sites … synced with your network account … SDK and API … send and request … make your own UIs"). GET /api/v1/me/friends on OpenVibe.Network: the person's friends in one read. Adding is one direction; two people are friends when both have added each other. mutual: friends; requests: they added you, you have not added them; asked: you added them, they have not added you. friends: whom you added (both mutual and asked), kept for older readers. Online people first in each list. A block on either side removes the person from every list.

Fields

FieldTypeRequiredDescriptionConstraints
subjectstringyesThe person reading.
  • pattern ^usr_[0-9A-HJKMNP-TV-Z]{26}$
friendsarray of objectyes
  • maxItems 5000
friends[].subjectstringyes
  • pattern ^usr_[0-9A-HJKMNP-TV-Z]{26}$
mutualarray of objectyes
  • maxItems 5000
  • items: no other fields
mutual[].subjectstringyes
  • pattern ^usr_[0-9A-HJKMNP-TV-Z]{26}$
mutual[].usernamestring | nullyes
  • maxLength 64
mutual[].display_namestring | nullyes
  • maxLength 128
mutual[].avatar_urlstring | null
  • pattern ^https://
  • format uri
  • maxLength 2048
mutual[].onlinebooleanyesSeen on an OpenVibe site in the last few minutes (Network's presence).
mutual[].sitestring | nullWhere they are, when online and they share it.
  • maxLength 80
mutual[].sincestring | nullWhen this side of the friendship last changed.
  • maxLength 40
requestsarray of objectyes
  • maxItems 5000
  • items: no other fields
requests[].subjectstringyes
  • pattern ^usr_[0-9A-HJKMNP-TV-Z]{26}$
requests[].usernamestring | nullyes
  • maxLength 64
requests[].display_namestring | nullyes
  • maxLength 128
requests[].avatar_urlstring | null
  • pattern ^https://
  • format uri
  • maxLength 2048
requests[].onlinebooleanyesSeen on an OpenVibe site in the last few minutes (Network's presence).
requests[].sitestring | nullWhere they are, when online and they share it.
  • maxLength 80
requests[].sincestring | nullWhen this side of the friendship last changed.
  • maxLength 40
askedarray of objectyes
  • maxItems 5000
  • items: no other fields
asked[].subjectstringyes
  • pattern ^usr_[0-9A-HJKMNP-TV-Z]{26}$
asked[].usernamestring | nullyes
  • maxLength 64
asked[].display_namestring | nullyes
  • maxLength 128
asked[].avatar_urlstring | null
  • pattern ^https://
  • format uri
  • maxLength 2048
asked[].onlinebooleanyesSeen on an OpenVibe site in the last few minutes (Network's presence).
asked[].sitestring | nullWhere they are, when online and they share it.
  • maxLength 80
asked[].sincestring | nullWhen this side of the friendship last changed.
  • maxLength 40

Examples

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

Valid: circle
{
  "subject": "usr_01K9R2V6M8Q4T0B7C3D5E9F2GH",
  "friends": [
    {
      "subject": "usr_01K9R2V6M8Q4T0B7C3D5E9F2GJ"
    }
  ],
  "mutual": [
    {
      "subject": "usr_01K9R2V6M8Q4T0B7C3D5E9F2GJ",
      "username": "ada",
      "display_name": "Ada",
      "avatar_url": "https://openvibe.network/avatar/ada?s=80",
      "online": true,
      "site": "openvibe.live",
      "since": "2026-11-14T08:00:00.000Z"
    }
  ],
  "requests": [],
  "asked": []
}
Rejected: no-mutual
{
  "subject": "usr_01K9R2V6M8Q4T0B7C3D5E9F2GH",
  "friends": [],
  "requests": [],
  "asked": []
}

Validate

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