-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
574 StartChat: ChatInitSettings and ChatRoomRef #620
Changes from 2 commits
fec33de
395b610
e8ba0f8
04d31a3
8c850fd
4ca0635
d4fe059
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
--- | ||
id: ChatInitSettings | ||
sidebar_label: ChatInitSettings | ||
title: ChatInitSettings | ||
hide_title: true | ||
--- | ||
|
||
# `ChatInitSettings` | ||
|
||
A collection of settings to start a new chat conversation | ||
|
||
## Type | ||
|
||
`fdc3.chat.initSettings` | ||
|
||
## Schema | ||
|
||
https://fdc3.finos.org/schemas/next/chatInitSettings.schema.json | ||
|
||
## Details | ||
|
||
| Property | Type | Required | Example Value | | ||
| ------------------------------ | --------- | -------- | -------------------------------------------------------------------- | | ||
| `type` | string | Yes | `'fdc3.chat.initSettings'` | | ||
| `chatName` | string | No | `'Instrumet XYZ'` | | ||
| `members` | Contact[] | No | `[contact1, contact2]` | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we could use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes - I though of this option, but I realised that ContactList adds extra verbosity (type, sub-structure, etc.) this is why I preferred the Contact[] option There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bertrand-s we're due to have a conversation at some point about the list types and whether there should be an easier / generic way to create them so they don't have to be explicit type (has been raised in meetings a few times). I'd prefer The APIs need a context type currently and can't take an array of them. Although this is embedded inside another type, I think it might be confusing / awkward in some situations for us to have a mixed convention on this (e.g. if the members were pulled out to send on to a CRM in another intent and then had to be converted into a ContactList). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK - I will update the PR with Contact and ContactList then |
||
| `initMessage` | string | No | `'Hello!'` | | ||
| `options.groupRecipients` | boolean | No | `true`: if false a separate chat will be created for each member | | ||
| `options.public` | boolean | No | `true`: the room will be visible to everyone in the chat application | | ||
| `options.allowHistoryBrowsing` | boolean | No | `true`: members will be allowed to browser past messages | | ||
| `options.allowMessageCopy` | boolean | No | `true`: members will be allowed to copy/paste messages | | ||
| `options.allowAddUser` | boolean | No | `true`: members will be allowed to add other members to the chat | | ||
|
||
If _members_ or _chatName_ are not provided, the application executing this | ||
intent is expectd to provide a mean to enter such information. | ||
bertrand-s marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Example | ||
|
||
```js | ||
const initSettings = { | ||
type: 'fdc3.chat.initSettings', | ||
chatName: 'Issue #123', | ||
members: [{ | ||
type: 'fdc3.contact', | ||
name: 'Jane Doe', | ||
id: { | ||
email: 'jane@mail.com' | ||
} | ||
},{ | ||
type: 'fdc3.contact', | ||
name: 'John Doe', | ||
id: { | ||
email: 'john@mail.com' | ||
}, | ||
}], | ||
options: { | ||
groupRecipients: true, // one chat with both contacts | ||
public: false, // private chat room | ||
allowHistoryBrowsing: true, | ||
allowMessageCopy: true, | ||
allowAddUser: false, // Jane and John won't be able to add other users to the chat | ||
} | ||
initMessage: "Hello both!" | ||
} | ||
|
||
const res = fdc3.raiseIntent('StartChat', initSettings); | ||
const roomRefs = await res.getResult(); | ||
``` | ||
|
||
## See Also | ||
|
||
Other Types | ||
|
||
- [ContactList](ContactList) | ||
- [ChatRoomRef](ChatRoomRef) | ||
|
||
Intents | ||
|
||
- [StartChat](../../intents/ref/StartChat) | ||
- [StartCall](../../intents/ref/StartCall) | ||
- [ViewContact](../../intents/ref/ViewContact) | ||
|
||
FINOS Financial Objects | ||
|
||
- [Contact](https://fo.finos.org/docs/objects/contact) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
id: ChatRoomRef | ||
sidebar_label: ChatRoomRef | ||
title: ChatRoomRef | ||
hide_title: true | ||
--- | ||
# `ChatRoomRef` | ||
|
||
A room reference returned when a chat is created. | ||
|
||
## Type | ||
|
||
`fdc3.chat.roomRef` | ||
|
||
## Schema | ||
|
||
https://fdc3.finos.org/schemas/next/chatRoomRef.schema.json | ||
|
||
## Details | ||
|
||
| Property | Type | Required | Example Value | | ||
|-------------|--------------|----------|------------------------------------------------| | ||
| `type` | string | Yes | `'fdc3.chat.roomRef'` | | ||
| `app` | AppMetadata | Yes | AppMetadata corresponding to the application that generated the id | | ||
| `name` | string | No | `'Room #123'` | | ||
| `id` | string | No | `'JRwnsrwfWE23' - id for chat application xxx` | | ||
|
||
## Example | ||
|
||
```js | ||
const roomRefExample = { | ||
type: "fdc3.chat.roomRef", | ||
name: "FX", | ||
app: {/*...*/}, // AppMetadata object | ||
id: "ypCMgBms4mzpf77jLcP8M3///oYxkqpEdA==" | ||
} | ||
|
||
// Retrieving a ChatRoomRef from StartChat | ||
const newChat = await fdc3.raiseIntent('StartChat', { | ||
type: 'fdc3.chat.initSettings', | ||
chatName: 'Issue #123', | ||
members: [{ | ||
type: 'fdc3.contact', | ||
name: 'Jane Doe', | ||
id: { | ||
email: 'jane@mail.com' | ||
} | ||
}], | ||
initMessage: "Hello Jane" | ||
}); | ||
const roomRefs = await newChat.getResult(); | ||
``` | ||
|
||
## See Also | ||
|
||
Other Types | ||
- [ChatInitSettings](ChatInitSettings) | ||
|
||
Intents | ||
- [StartChat](../../intents/ref/StartChat) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,6 +80,13 @@ The identifier "foo" is proprietary, an application that can use it is free to d | |
The following are standard FDC3 context types. | ||
__Note:__ The specification for these types are shared with the [FINOS Financial Objects](https://fo.finos.org) definitions, JSON schemas are hosted with FDC3. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note for @greyseer256: this sentence is no longer correct once we merge in new types - and that group has changed focus/no longer maintains those definitions. Hence, its probably time to drop this |
||
|
||
- __fdc3.chat.initSettings__ | ||
- Initialization parameters to start a new chat | ||
- [Financial Objects Specification](https://fo.finos.org/docs/objects/chatInitSettings) | ||
- [schema](/schemas/next/chatInitSettings.schema.json) | ||
- __fdc3.chat.roomRef__ | ||
- Room reference object to specify a specific chat room | ||
- [schema](/schemas/next/chatRoomRef.schema.json) | ||
- __fdc3.contact__ | ||
- A person contact that can be engaged with through email, calling, messaging, CMS, etc. | ||
- [Financial Objects Specification](https://fo.finos.org/docs/objects/contact) | ||
|
@@ -120,6 +127,34 @@ __Note:__ The below examples show how the base context data interface can be use | |
|
||
### Examples | ||
|
||
#### ChatInitSettings | ||
```json | ||
{ | ||
"type": "fdc3.chat.initSettings", | ||
"chatName": "Issue #123", | ||
"members": [{ | ||
"type": "fdc3.contact", | ||
"name": "Jane Doe", | ||
"id": { | ||
"email": "jane@mail.com" | ||
} | ||
},{ | ||
"type": "fdc3.contact", | ||
"name": "John Doe", | ||
"id": { | ||
"email": "john@mail.com" | ||
}, | ||
}], | ||
"options": { | ||
"groupRecipients": true, | ||
"public": false, | ||
"allowHistoryBrowsing": true, | ||
"allowMessageCopy": true, | ||
"allowAddUser": false, | ||
} | ||
"initMessage": "Hello both!" | ||
} | ||
``` | ||
#### Contact | ||
```json | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://fdc3.finos.org/schemas/next/chatInitSettings.schema.json", | ||
"type": "object", | ||
"title": "ChatInitSettings", | ||
"properties": { | ||
"type": { | ||
"const": "fdc3.chat.initSettings" | ||
}, | ||
"chatName": { | ||
"type": "string" | ||
}, | ||
"members": { | ||
"$ref": "contact.schema.json#" | ||
}, | ||
"initMessage": { | ||
"type": "string" | ||
}, | ||
"options": { | ||
"groupRecipients": "boolean", | ||
"public": "boolean", | ||
"allowHistoryBrowsing": "boolean", | ||
"allowMessageCopy": "boolean", | ||
"allowAddUser": "boolean" | ||
} | ||
}, | ||
"required": [ | ||
"type" | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://fdc3.finos.org/schemas/next/chatRoomRef.schema.json", | ||
"type": "object", | ||
"title": "ChatRoomRef", | ||
"properties": { | ||
"type": { | ||
"const": "fdc3.chat.roomRef" | ||
}, | ||
"app": { | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"appId": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"id": { | ||
"type": "string" | ||
}, | ||
"name": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"type", | ||
"app", | ||
"id" | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest calling this ChatSettings? It seems like these settings would be relevant even after the chat had been created, and could be the basis for further, ongoing intents. e.g. EmailTranscript, CreateAppointment, RecordInCRM, etc. which could be handled by context listeners.