forked from nightscout/cgm-remote-monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevent-envelope.schema.json
More file actions
107 lines (107 loc) · 3.2 KB
/
event-envelope.schema.json
File metadata and controls
107 lines (107 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://nightscout.github.io/schemas/event-envelope.schema.json",
"title": "EventEnvelope",
"description": "Wrapper for all control plane events, providing consistent ordering, audit, and replay capabilities",
"type": "object",
"required": ["eventId", "eventType", "issuer", "timestamp", "payload"],
"properties": {
"eventId": {
"type": "string",
"format": "uuid",
"description": "Stable UUID for this event"
},
"eventType": {
"type": "string",
"description": "Dot-notation event type",
"enum": [
"profile.definition.created",
"profile.definition.updated",
"profile.selection.changed",
"override.definition.created",
"override.definition.updated",
"override.instance.activated",
"override.instance.ended",
"override.instance.canceled",
"override.instance.superseded",
"policy.composition.computed",
"delivery.requested",
"delivery.observed",
"delivery.reconciled",
"controller.registered",
"controller.deregistered",
"capability.snapshot.updated"
]
},
"cursor": {
"type": "integer",
"minimum": 0,
"description": "Server-assigned monotonic global ordering"
},
"issuer": {
"type": "string",
"description": "Identifier for the entity that issued this event (controller, user, agent)"
},
"issuerSeq": {
"type": "integer",
"minimum": 0,
"description": "Monotonic sequence number per issuer for ordering"
},
"idempotencyKey": {
"type": "string",
"description": "Client-provided key for retry deduplication"
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "ISO 8601 timestamp when event was created"
},
"refs": {
"type": "array",
"description": "References to related objects",
"items": {
"type": "object",
"required": ["refType", "refId"],
"properties": {
"refType": {
"type": "string",
"description": "Type of referenced object",
"enum": [
"profileDefinition",
"profileSelection",
"overrideDefinition",
"overrideInstance",
"policyComposition",
"deliveryRequest",
"deliveryObservation",
"controllerInstance",
"capabilitySnapshot"
]
},
"refId": {
"type": "string",
"description": "ID or content hash of referenced object"
}
}
}
},
"payload": {
"type": "object",
"description": "The actual event data (schema depends on eventType)"
},
"metadata": {
"type": "object",
"description": "Optional extensible metadata",
"properties": {
"bridgeSource": {
"type": "string",
"description": "If synthesized from legacy data, the source collection"
},
"bridgeSourceId": {
"type": "string",
"description": "If synthesized, the source document ID"
}
}
}
}
}