Skip to content

Commit

Permalink
Add ChatRoom
Browse files Browse the repository at this point in the history
  • Loading branch information
symphony-jean-michael committed Aug 5, 2022
1 parent 29ce01a commit df75169
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 3 deletions.
7 changes: 5 additions & 2 deletions docs/context/ref/ChatInitSettings.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,22 @@ const initSettings = {
}

const res = fdc3.raiseIntent('StartChat', initSettings);
const roomRefs = await res.getResult();

// Return a reference to the room
const chatRoom = await res.getResult();
```

## See Also

Other Types

- [ChatRoom](ChatRoom)
- [ContactList](ContactList)

Intents

- [StartChat](../../intents/ref/StartChat)
- [StartCall](../../intents/ref/StartCall)
- [SendChatMessage](../../intents/ref/StartChat)
- [ViewContact](../../intents/ref/ViewContact)

FINOS Financial Objects
Expand Down
66 changes: 66 additions & 0 deletions docs/context/ref/ChatRoom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
id: ChatRoom
sidebar_label: ChatRoom
title: Contact
hide_title: true
---
# `ChatRoom`

Reference to a chat room.

## 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 | `{ roomId: 'j75xqXy25NBOdacUI3FNBH', anyOtherKey: 'abcdef'}` |
| `uri` | string | No | `'http://symphony.com/ref/room/j75xqXy25NBOdacUI3FNBH___pqSsuJRdA'` |
| `name` | string | No | `'My new room'` |

The `uri` is an universal url to access to the room. It could be opened from a browser, a mobile app, etc...

## Example

```js
const intentResolution = await fdc3.raiseIntent("StartChat", context);

const chatRoom = intentResolution.getResult():

/* // The chatRoom will be like:
chatRoom = {
type: "fdc3.chat.room",
providerName: "Symphony",
id: {
roomId: "j75xqXy25NBOdacUI3FNBH"
}
uri: "http://symphony.com/ref/room/j75xqXy25NBOdacUI3FNBH___pqSsuJRdA",
name: 'My new room'
};
*/
```

## See Also

Other Types
- [ContactList](ContactList)

Intents
- [StartChat](../../intents/ref/StartChat)
- [StartCall](../../intents/ref/StartCall)
- [SendChatMessage](../../intents/ref/SendChatMessage)
- [ViewProfile](../../intents/ref/ViewProfile)
- [ViewResearch](../../intents/ref/ViewResearch)
- [ViewInteractions](../../intents/ref/ViewInteractions)
- [ViewOrders](../../intents/ref/ViewOrders)

FINOS Financial Objects
- [Contact](https://fo.finos.org/docs/objects/contact)
6 changes: 5 additions & 1 deletion docs/intents/ref/StartChat.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,20 @@ const initSettings = {
}

const resolution = fdc3.raiseIntent('StartChat', initSettings);
const chatRoomRefs = await resolution.getResult();

// Return a reference to the room
const chatRoom = await resolution.getResult();
```

## See Also

Context
- [ChatRoom](../../context/ref/ChatRoom)
- [Contact](../../context/ref/Contact)
- [ContactList](../../context/ref/ContactList)
- [ChatInitSettings](../../context/ref/ChatInitSettings)

Intents
* [SendChatMessage](SendChatMessage)
* [StartCall](StartCall)
* [StartEmail](StartEmail)
15 changes: 15 additions & 0 deletions website/static/schemas/next/chatRoom.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://fdc3.finos.org/schemas/next/chatRoom.schema.json",
"type": "object",
"title": "ChatRoom",
"allOf": [{ "$ref": "context.schema.json#" }],
"properties": {
"type": { "const": "fdc3.chat.room" },
"providerName": { "type": "string" },
"id": { "type": "object" },
"uri": { "type": "string" },
"name": { "type": "string" }
},
"required": ["type", "providerName", "id"]
}

0 comments on commit df75169

Please sign in to comment.