-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessage-envelope.schema.json
More file actions
85 lines (85 loc) · 2.67 KB
/
Copy pathmessage-envelope.schema.json
File metadata and controls
85 lines (85 loc) · 2.67 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
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://bubblepilot.local/contracts/message-envelope.schema.json",
"title": "BubblePilot MessageEnvelope",
"type": "object",
"required": [
"schemaVersion",
"eventId",
"correlationId",
"provider",
"chat",
"message",
"metadata"
],
"properties": {
"schemaVersion": { "const": "1" },
"eventId": { "type": "string", "minLength": 1 },
"correlationId": { "type": "string", "format": "uuid" },
"provider": { "const": "bluebubbles" },
"chat": {
"type": "object",
"required": ["providerChatId", "type", "displayName"],
"properties": {
"providerChatId": { "type": "string", "minLength": 1 },
"type": { "enum": ["direct", "group", "unknown"] },
"displayName": { "type": ["string", "null"] }
},
"additionalProperties": false
},
"message": {
"type": "object",
"required": [
"providerMessageId",
"senderId",
"sentAt",
"text",
"contentType",
"isFromMe",
"attachments",
"contentHash"
],
"properties": {
"providerMessageId": { "type": "string", "minLength": 1 },
"senderId": { "type": ["string", "null"] },
"sentAt": { "type": "string", "format": "date-time" },
"text": { "type": ["string", "null"] },
"contentType": { "enum": ["text", "attachment", "mixed", "unknown"] },
"isFromMe": { "type": "boolean" },
"attachments": {
"type": "array",
"items": {
"type": "object",
"required": [
"providerAttachmentId",
"mimeType",
"fileName",
"sizeBytes"
],
"properties": {
"providerAttachmentId": { "type": "string", "minLength": 1 },
"mimeType": { "type": ["string", "null"] },
"fileName": { "type": ["string", "null"] },
"sizeBytes": { "type": ["integer", "null"], "minimum": 0 }
},
"additionalProperties": false
}
},
"contentHash": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
},
"additionalProperties": false
},
"metadata": {
"type": "object",
"required": ["isReplay", "payloadHash", "eventType", "adapterVersion"],
"properties": {
"isReplay": { "type": "boolean" },
"payloadHash": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
"eventType": { "type": "string" },
"adapterVersion": { "type": "string" }
},
"additionalProperties": false
}
},
"additionalProperties": false
}