-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge Yannick-Symphony:message_container
- Loading branch information
Showing
10 changed files
with
301 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
--- | ||
id: Action | ||
sidebar_label: Action | ||
title: Action | ||
hide_title: true | ||
--- | ||
# `Action` | ||
|
||
A representation of an FDC3 Action (specified via a Context or Context & Intent) that can be inserted inside another object, | ||
for example a chat message. | ||
|
||
The action may be completed by calling `fdc3.raiseIntent()` with the specified Intent and Context, or, if only a context is specified, by calling `fdc3.raiseIntentForContext()` (which the Desktop Agent will resolve by presenting the user with a list of available Intents for the Context). | ||
|
||
Accepts an optional `app` parameter in order to specify a certain app. | ||
|
||
## Type | ||
|
||
`fdc3.action` | ||
|
||
## Schema | ||
|
||
https://fdc3.finos.org/schemas/next/action.schema.json | ||
|
||
## Details | ||
|
||
| Property | Type | Required | Example Value | | ||
|-------------------|-------------------------------------------|----------|-------------------------| | ||
| `type` | string | Yes | `'fdc3.action'` | | ||
| `title` | string | Yes | `'Click to view Chart'` | | ||
| `intent` | string | No | `'ViewChart'` | | ||
| `context` | string | Yes | See Below | | ||
| `app` | object | No | `'myApp'` | | ||
| `app.appId` | string | Yes | `'app1'` | | ||
| `app.instanceId` | string | No | `'instance1'` | | ||
|
||
|
||
|
||
## Example | ||
|
||
```js | ||
const 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' | ||
}, | ||
app { | ||
appId: 'MyChartViewingApp', | ||
instanceId: 'instance1' | ||
} | ||
} | ||
|
||
## See Also | ||
|
||
Other Types | ||
* [Message](Message) | ||
|
||
Intents | ||
* [StartChat](../../intents/ref/StartChat) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--- | ||
id: Message | ||
sidebar_label: Message | ||
title: Message | ||
hide_title: true | ||
--- | ||
# `Message` | ||
|
||
A chat message to be sent through an instant messaging application. Can contain one or several text bodies (organised 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. | ||
|
||
## Type | ||
|
||
`fdc3.message` | ||
|
||
## Schema | ||
|
||
https://fdc3.finos.org/schemas/next/message.schema.json | ||
|
||
## Details | ||
|
||
| Property | Type | Required | Example Value | | ||
|-------------------|-------------------------------------------|----------|-------------------------| | ||
| `type` | string | Yes | `'fdc3.message'` | | ||
| `text` | map of string mime-type to string content | No | { text/plain: 'Hello' } | | ||
| `entities` | map of json entity to string id | No | See Below | | ||
|
||
## Example | ||
|
||
```js | ||
const message = { | ||
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' | ||
} | ||
} | ||
} | ||
} | ||
|
||
## See Also | ||
|
||
Other Types | ||
* [ChatInitSettings](ChatInitSettings) | ||
* [Action](Action) | ||
|
||
Intents | ||
* [StartChat](../../intents/ref/StartChat) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://fdc3.finos.org/schemas/next/action.schema.json", | ||
"type": "object", | ||
"title": "Action", | ||
"allOf": [{ "$ref": "context.schema.json#" }], | ||
"properties": { | ||
"type": { "const": "fdc3.action" }, | ||
"title": { | ||
"type": "string" | ||
}, | ||
"intent": { | ||
"type": "string", | ||
"$comment": "Should reference an intent type name, such as those defined in the FDC3 Standard'" | ||
}, | ||
"context": { | ||
"type": "object", | ||
"$ref": "context.schema.json#" | ||
}, | ||
"app": { | ||
"type": "object", | ||
"properties": { | ||
"appId": { "type": "string" }, | ||
"instanceId": { "type": "string" } | ||
}, | ||
"required": ["appId"] | ||
}, | ||
"customConfig": { | ||
"type": "object" | ||
} | ||
}, | ||
"required": [ | ||
"title", "context" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.