-
Notifications
You must be signed in to change notification settings - Fork 132
/
message.schema.json
120 lines (120 loc) · 4 KB
/
message.schema.json
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
108
109
110
111
112
113
114
115
116
117
118
119
120
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://fdc3.finos.org/schemas/next/context/message.schema.json",
"type": "object",
"title": "Message",
"description": "A chat message to be sent through an instant messaging application. Can contain one or several text bodies (organized by mime-type, plaintext or markdown), as well as attached entities (either arbitrary file attachments or FDC3 actions to be embedded in the message). To be put inside a ChatInitSettings object.",
"allOf": [
{
"type": "object",
"properties": {
"type": {
"const": "fdc3.message"
},
"text": {
"type": "object",
"title": "Message text",
"description": "A map of string mime-type to string content",
"properties": {
"text/plain": {
"type": "string",
"title": "Plain text",
"description": "Plain text encoded content."
},
"text/markdown": {
"title": "Markdown text",
"description": "Markdown encoded content",
"type": "string"
}
}
},
"entities": {
"type": "object",
"title": "Message entities",
"description": "A map of string IDs to entities that should be attached to the message, such as an action to perform, a file attachment, or other FDC3 context object.",
"additionalProperties": {
"anyOf": [
{
"$ref": "action.schema.json#"
},
{
"type": "object",
"title": "File attachment",
"description": "A File attachment encoded in the form of a data URI",
"properties": {
"type": {
"const": "fdc3.entity.fileAttachment"
},
"data": {
"type": "object",
"properties": {
"name": {
"type": "string",
"title": "File name",
"description": "The name of the attached file"
},
"dataUri": {
"type": "string",
"format": "uri",
"title": "",
"description": "A data URI encoding the content of the file to be attached"
}
},
"required": [
"name",
"dataUri"
]
}
},
"required": [
"type",
"data"
]
}
]
}
}
}
},
{ "$ref": "context.schema.json#/definitions/BaseContext" }
],
"examples": [
{
"type": "fdc3.message",
"text": {
"text/plain": "Hey all, can we discuss the issue together? I attached a screenshot and a link to the current exchange rate"
},
"entities": {
"picture1": {
"type": "fdc3.fileAttachment",
"data": {
"name": "myImage.png",
"dataUri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII"
}
},
"eurusd_action": {
"type": "fdc3.action",
"title": "Click to view Chart",
"intent": "ViewChart",
"context": {
"type": "fdc3.chart",
"instruments": [
{
"type": "fdc3.instrument",
"id": {
"ticker": "EURUSD"
}
}
],
"range": {
"type": "fdc3.dateRange",
"starttime": "2020-09-01T08:00:00.000Z",
"endtime": "2020-10-31T08:00:00.000Z"
},
"style": "candle"
}
}
}
}
]
}