| 1 | { |
| 2 | "$schema" "https://json-schema.org/draft/2020-12/schema", |
| 3 | "$id" "https://cascade.dev/intercom-wire/v1/transport-envelope.schema.json", |
| 4 | "title" "IntercomTransportEventEnvelope", |
| 5 | "description" "Оболочка события на pluggable transport. Payload — по event_kind (см. event-kinds.json).", |
| 6 | "type" "object", |
| 7 | "required" [ |
| 8 | "schema_version", |
| 9 | "seq", |
| 10 | "team_id", |
| 11 | "topic_id", |
| 12 | "client_event_id", |
| 13 | "occurred_at_utc", |
| 14 | "event_kind", |
| 15 | "sender", |
| 16 | "payload" |
| 17 | ], |
| 18 | "properties" { |
| 19 | "schema_version" { |
| 20 | "type" "integer", |
| 21 | "const" 1, |
| 22 | "description" "Major wire version. Breaking → 2." |
| 23 | }, |
| 24 | "seq" { |
| 25 | "type" "integer", |
| 26 | "description" "Monotonic per team (transport assigns)." |
| 27 | }, |
| 28 | "team_id" { "type": "string" }, |
| 29 | "topic_id" { "type": "string" }, |
| 30 | "client_event_id" { |
| 31 | "type" "string", |
| 32 | "description" "Idempotency key; often equals local event UUID (N)." |
| 33 | }, |
| 34 | "occurred_at_utc" { "type": "string", "format": "date-time" }, |
| 35 | "event_kind" { |
| 36 | "type" "string", |
| 37 | "description" "See event-kinds.json" |
| 38 | }, |
| 39 | "sender" { "$ref": "#/$defs/sender" }, |
| 40 | "payload" { |
| 41 | "type" "object", |
| 42 | "description" "Shape per event_kind; validate with linked schema in event-kinds.json" |
| 43 | } |
| 44 | }, |
| 45 | "$defs" { |
| 46 | "sender" { |
| 47 | "type" "object", |
| 48 | "required" ["member_id", "display_name", "sender_role", "client_kind"], |
| 49 | "properties" { |
| 50 | "member_id" { "type": "string" }, |
| 51 | "display_name" { "type": "string" }, |
| 52 | "sender_role" { |
| 53 | "type" "string", |
| 54 | "enum" ["human", "agent", "system"] |
| 55 | }, |
| 56 | "client_kind" { |
| 57 | "type" "string", |
| 58 | "description" "cide | intercom-web | mcc | bridge-matrix | …" |
| 59 | } |
| 60 | }, |
| 61 | "additionalProperties" false |
| 62 | } |
| 63 | }, |
| 64 | "additionalProperties" false |
| 65 | } |
| 66 | |