VipEntitlementCheckRequest vip.entitlement-check-request@1

Generated at from openvibe-contracts v0.53.0 and openvibe-sdk v0.11.0.

Version
1.0.0
Owner
vip
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/vip/entitlement-check-request.v1.json

vip.entitlement-check-request@1: the question of vip.entitlement.check on OpenVibe.VIP. POST /api/v1/entitlements/check: { creator, subject?, mode?, product? }; GET /api/v1/entitlements/check takes the same fields in its query string and no body. creator is a user SubjectRef, usr_ id (asked of Billing even when VIP has never seen the creator) or VIP username; subject is the member (required for services; a person asks about themselves). mode auto (default: the projection when fresh, else Billing), projection (never asks Billing) or authoritative (always asks Billing). product (a service id such as chat or blog) adds what the membership means there. Refusals are problem+json: 422 vip.invalid_input (no creator VIP can resolve, a bad product) or vip.invalid_subject; 403 capability.denied or vip.not_yours. Unknown fields are ignored.

Fields

This schema has no named fields.

Examples

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

Valid: get
{}
Valid: post
{
  "creator": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "subject": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
  },
  "mode": "auto",
  "product": "chat"
}
Rejected: bad-product
{
  "creator": "moosefan",
  "product": "Chat!"
}

Validate

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