-
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 pull request #994 from finos/fix-context-data-and-intents-conso…
…lidated-update-branch-2.1 Consolidated PR for Context Data & Intents (CD&I) updates for 2.1
- Loading branch information
Showing
48 changed files
with
1,543 additions
and
90 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,75 @@ | ||
--- | ||
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
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,51 @@ | ||
--- | ||
id: ChatMessage | ||
sidebar_label: ChatMessage | ||
title: ChatMessage | ||
hide_title: true | ||
--- | ||
# `ChatMessage` | ||
|
||
A context representing a chat message. Typically used to send the message or to pre-populate a message for sending. | ||
|
||
## Type | ||
|
||
`fdc3.chat.message` | ||
|
||
## Schema | ||
|
||
- https://fdc3.finos.org/schemas/next/chatMessage.schema.json | ||
|
||
## Details | ||
|
||
| Property | Type | Required | Example Value | | ||
|-------------|---------|----------|-------------------| | ||
| `type` | string | Yes | `'fdc3.chat.message'` | | ||
| `chatRoom` | ChatRoom | Yes | `{ type: 'fdc3.chat.room', providerName: 'Symphony', id:{ streamId: 'j75xqXy25NBOdacUI3FNBH'} }` | | ||
| `message` | [Message](https://fdc3.finos.org/schemas/next/message.schema.json) | Yes | `'A message to send'` | | ||
|
||
## Example | ||
|
||
```js | ||
const chatMessage = { | ||
type: "fdc3.chat.message", | ||
chatRoom: { | ||
type: 'fdc3.chat.room', | ||
providerName: "Symphony", | ||
id: { | ||
streamId: "j75xqXy25NBOdacUI3FNBH" | ||
} | ||
}, | ||
message: "A message to send" | ||
} | ||
``` | ||
|
||
## See Also | ||
|
||
Intents | ||
- [StartChat](../../intents/ref/StartChat) | ||
- [StartCall](../../intents/ref/StartCall) | ||
- [SendChatMessage](../../intents/ref/SendChatMessage) | ||
|
||
FINOS Financial Objects | ||
- [Contact](https://fo.finos.org/docs/objects/contact) |
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,64 @@ | ||
--- | ||
id: ChatRoom | ||
sidebar_label: ChatRoom | ||
title: Contact | ||
hide_title: true | ||
--- | ||
# `ChatRoom` | ||
|
||
Reference to the chat room(s) (which could be used later to send a message to the room(s)). | ||
|
||
## Type | ||
|
||
`fdc3.chat.room` | ||
|
||
## Schema | ||
|
||
https://fdc3.finos.org/schemas/next/chatRoom.schema.json | ||
|
||
## Details | ||
|
||
| Property | Type | Required | Example Value | | ||
|-------------|---------|----------|-------------------| | ||
| `type` | string | Yes | `'fdc3.chat.room'` | | ||
| `providerName` | string | Yes | `'Symphony'` | | ||
| `id` | object | Yes | `{ streamId: 'j75xqXy25NBOdacUI3FNBH', anyOtherKey: 'abcdef'}` | | ||
| `url` | string | No | `'http://symphony.com/ref/room/j75xqXy25NBOdacUI3FNBH___pqSsuJRdA'` | | ||
| `name` | string | No | `'My new room'` | | ||
|
||
The `url` is a universal url to access to the room. It could be opened from a browser, a mobile app, etc... | ||
|
||
## Example | ||
|
||
```js | ||
const chatRoom = { | ||
type: "fdc3.chat.room", | ||
providerName: "Symphony", | ||
id: { | ||
streamId: "j75xqXy25NBOdacUI3FNBH" | ||
} | ||
url: "http://symphony.com/ref/room/j75xqXy25NBOdacUI3FNBH___pqSsuJRdA", | ||
name: 'My new room' | ||
}; | ||
|
||
//Chat rooms are returned by the StartChat intent as a result | ||
const intentResolution = await fdc3.raiseIntent("StartChat", context); | ||
|
||
try { | ||
const chatRooms = await intentResolution.getResult(): | ||
} catch (error) { | ||
//chat room were not created... | ||
} | ||
``` | ||
|
||
## See Also | ||
|
||
Other Types | ||
* [ChatInitSettings](ChatInitSettings) | ||
|
||
Intents | ||
- [StartChat](../../intents/ref/StartChat) | ||
- [SendChatMessage](../../intents/ref/SendChatMessage) | ||
|
||
FINOS Financial Objects | ||
- [Contact](https://fo.finos.org/docs/objects/contact) |
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
Oops, something went wrong.