zone.stratos.sync.subscribeRecords

lexicon.northsky.app

Documentation

Subscribe to stratos events. When 'did' is provided, subscribes to record updates for that account. When omitted, subscribes to service-level events (enrollments). Callers must authenticate with a signed service JWT via the Authorization: Bearer header.

main subscription

Subscribe to stratos events. When 'did' is provided, subscribes to record updates for that account. When omitted, subscribes to service-level events (enrollments). Callers must authenticate with a signed service JWT via the Authorization: Bearer header.

Parameters

cursor integer Optional

The last known event sequence number to resume from.

did stringdid Optional

The DID of the account to subscribe to. If omitted, subscribes to service-level enrollment events.

domain string Optional

Optional domain filter. Only events for records with this domain in their boundary will be emitted.

Message Types

Errors

FutureCursor Cursor is in the future.
AuthRequired Authentication is required.
View raw schema
{
  "description": "Subscribe to stratos events. When 'did' is provided, subscribes to record updates for that account. When omitted, subscribes to service-level events (enrollments). Callers must authenticate with a signed service JWT via the Authorization: Bearer header.",
  "errors": [
    {
      "description": "Cursor is in the future.",
      "name": "FutureCursor"
    },
    {
      "description": "Authentication is required.",
      "name": "AuthRequired"
    }
  ],
  "message": {
    "schema": {
      "refs": [
        "#commit",
        "#enrollment",
        "#info"
      ],
      "type": "union"
    }
  },
  "parameters": {
    "properties": {
      "cursor": {
        "description": "The last known event sequence number to resume from.",
        "type": "integer"
      },
      "did": {
        "description": "The DID of the account to subscribe to. If omitted, subscribes to service-level enrollment events.",
        "format": "did",
        "type": "string"
      },
      "domain": {
        "description": "Optional domain filter. Only events for records with this domain in their boundary will be emitted.",
        "maxLength": 253,
        "type": "string"
      }
    },
    "type": "params"
  },
  "type": "subscription"
}
commit object

A commit event containing record operations.

Properties

did string did Required

The DID of the account.

ops array of ref#recordOp Required

List of record operations in this commit.

rev string tid Required

The repo revision.

seq integer Required

The sequence number of this event.

time string datetime Required

Timestamp of when the event was sequenced.

View raw schema
{
  "description": "A commit event containing record operations.",
  "properties": {
    "did": {
      "description": "The DID of the account.",
      "format": "did",
      "type": "string"
    },
    "ops": {
      "description": "List of record operations in this commit.",
      "items": {
        "ref": "#recordOp",
        "type": "ref"
      },
      "type": "array"
    },
    "rev": {
      "description": "The repo revision.",
      "format": "tid",
      "type": "string"
    },
    "seq": {
      "description": "The sequence number of this event.",
      "type": "integer"
    },
    "time": {
      "description": "Timestamp of when the event was sequenced.",
      "format": "datetime",
      "type": "string"
    }
  },
  "required": [
    "seq",
    "did",
    "time",
    "rev",
    "ops"
  ],
  "type": "object"
}
enrollment object

An enrollment event indicating a user has enrolled or unenrolled from the service.

Properties

action string Required

The enrollment action.

maxLength: 32 bytes
Known values: enroll, unenroll
boundaries array of string Optional

The boundaries assigned to the user.

did string did Required

The DID of the user.

service string uri Optional

The Stratos service endpoint URL.

time string datetime Required

Timestamp of the enrollment event.

View raw schema
{
  "description": "An enrollment event indicating a user has enrolled or unenrolled from the service.",
  "properties": {
    "action": {
      "description": "The enrollment action.",
      "knownValues": [
        "enroll",
        "unenroll"
      ],
      "maxLength": 32,
      "type": "string"
    },
    "boundaries": {
      "description": "The boundaries assigned to the user.",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "did": {
      "description": "The DID of the user.",
      "format": "did",
      "type": "string"
    },
    "service": {
      "description": "The Stratos service endpoint URL.",
      "format": "uri",
      "type": "string"
    },
    "time": {
      "description": "Timestamp of the enrollment event.",
      "format": "datetime",
      "type": "string"
    }
  },
  "required": [
    "did",
    "action",
    "time"
  ],
  "type": "object"
}
info object

An informational message about the subscription state.

Properties

message string Optional

Additional details about the info message.

maxLength: 1024 bytes
name string Required

The type of info message.

maxLength: 128 bytes
Known values: OutdatedCursor
View raw schema
{
  "description": "An informational message about the subscription state.",
  "properties": {
    "message": {
      "description": "Additional details about the info message.",
      "maxLength": 1024,
      "type": "string"
    },
    "name": {
      "description": "The type of info message.",
      "knownValues": [
        "OutdatedCursor"
      ],
      "maxLength": 128,
      "type": "string"
    }
  },
  "required": [
    "name"
  ],
  "type": "object"
}
recordOp object

A single record operation within a commit.

Properties

action string Required

The type of operation.

maxLength: 32 bytes
Known values: create, update, delete
cid cid-link Optional

The CID of the record. Present for create and update operations.

path string Required

The record path (collection/rkey).

maxLength: 512 bytes
record unknown Optional

The record content. Present for create and update operations.

View raw schema
{
  "description": "A single record operation within a commit.",
  "properties": {
    "action": {
      "description": "The type of operation.",
      "knownValues": [
        "create",
        "update",
        "delete"
      ],
      "maxLength": 32,
      "type": "string"
    },
    "cid": {
      "description": "The CID of the record. Present for create and update operations.",
      "type": "cid-link"
    },
    "path": {
      "description": "The record path (collection/rkey).",
      "maxLength": 512,
      "type": "string"
    },
    "record": {
      "description": "The record content. Present for create and update operations.",
      "type": "unknown"
    }
  },
  "required": [
    "action",
    "path"
  ],
  "type": "object"
}

Lexicon Garden

@