From fec33def49caac5bcca2a6b532630914d91512d0 Mon Sep 17 00:00:00 2001 From: Bertrand Laporte Date: Tue, 8 Mar 2022 13:17:26 +0100 Subject: [PATCH 1/7] 574 StartChat: ChatInitSettings and ChatRoomRef --- docs/context/ref/ChatInitSettings.md | 85 +++++++++++++++++++ docs/context/ref/ChatRoomRef.md | 60 +++++++++++++ docs/context/spec.md | 35 ++++++++ docs/intents/ref/StartChat.md | 38 ++++++++- docs/intents/spec.md | 5 +- src/context/schemas.json | 2 + .../schemas/chatInitSettings.schema.json | 30 +++++++ src/context/schemas/chatRoomRef.schema.json | 33 +++++++ website/sidebars.json | 8 +- 9 files changed, 290 insertions(+), 6 deletions(-) create mode 100644 docs/context/ref/ChatInitSettings.md create mode 100644 docs/context/ref/ChatRoomRef.md create mode 100644 src/context/schemas/chatInitSettings.schema.json create mode 100644 src/context/schemas/chatRoomRef.schema.json diff --git a/docs/context/ref/ChatInitSettings.md b/docs/context/ref/ChatInitSettings.md new file mode 100644 index 000000000..2efdfb0cd --- /dev/null +++ b/docs/context/ref/ChatInitSettings.md @@ -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]` | +| `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. + +## 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 roomRef = 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) diff --git a/docs/context/ref/ChatRoomRef.md b/docs/context/ref/ChatRoomRef.md new file mode 100644 index 000000000..0220a4615 --- /dev/null +++ b/docs/context/ref/ChatRoomRef.md @@ -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 roomRef = await newChat.getResult(); +``` + +## See Also + +Other Types +- [ChatInitSettings](ChatInitSettings) + +Intents +- [StartChat](../../intents/ref/StartChat) diff --git a/docs/context/spec.md b/docs/context/spec.md index f17be7ea3..49b448e08 100644 --- a/docs/context/spec.md +++ b/docs/context/spec.md @@ -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. +- __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 { diff --git a/docs/intents/ref/StartChat.md b/docs/intents/ref/StartChat.md index c88a8f328..5a3787216 100644 --- a/docs/intents/ref/StartChat.md +++ b/docs/intents/ref/StartChat.md @@ -6,7 +6,7 @@ hide_title: true --- # `StartChat` -Initiate a chat with a contact or list of contacts. +Initiate a chat with a contact, a list of contacts or detailed initialization settings. ## Intent Name @@ -20,7 +20,11 @@ Initiate a chat with a contact or list of contacts. * [Contact](../../context/ref/Contact) * [ContactList](../../context/ref/ContactList) +* [ChatInitSettings](../../context/ref/ChatInitSettings) +## Result Context + +* [ChatRoomRef](../../context/ref/ChatRoomRef) ## Example ```js @@ -33,6 +37,36 @@ const contact = { } fdc3.raiseIntent('StartChat', contact) + +// chat with initialization settigns +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 resolution = fdc3.raiseIntent('StartChat', initSettings); +const chatRoomRef = await resolution.getResult(); ``` ## See Also @@ -40,6 +74,8 @@ fdc3.raiseIntent('StartChat', contact) Context - [Contact](../../context/ref/Contact) - [ContactList](../../context/ref/ContactList) +- [ChatInitSettings](../../context/ref/ChatInitSettings) +- [ChatRoomRef](../../context/ref/ChatRoomRef) Intents - [StartCall](StartCall) \ No newline at end of file diff --git a/docs/intents/spec.md b/docs/intents/spec.md index b615346df..4ca91856f 100644 --- a/docs/intents/spec.md +++ b/docs/intents/spec.md @@ -37,8 +37,9 @@ However, there is a need for applications to ensure that their intents avoid col * Expected context: Contact * Expected behavior: initiate call with contact(s) ### StartChat - * Expected context: Contact - * Expected behavior: initiate chat with contact(s) + * Expected context: Contact or ContactList or ChatInitSettings + * Expected behavior: initiate chat with contact(s) or initialization settings + * Result context: ChatRoomRef ### ViewChart * Expected context: Instrument * Expected behavior: display a chart for the context diff --git a/src/context/schemas.json b/src/context/schemas.json index 9bc83226c..c72d6f6be 100644 --- a/src/context/schemas.json +++ b/src/context/schemas.json @@ -1,4 +1,6 @@ { + "ChatInitSettings": ["https://fdc3.finos.org/schemas/next/chatInitSettings.schema.json"], + "ChatRoomRef": ["https://fdc3.finos.org/schemas/next/chatRoomRef.schema.json"], "Context": ["https://fdc3.finos.org/schemas/next/context.schema.json"], "Contact": ["https://fdc3.finos.org/schemas/next/contact.schema.json"], "ContactList": ["https://fdc3.finos.org/schemas/next/contactList.schema.json"], diff --git a/src/context/schemas/chatInitSettings.schema.json b/src/context/schemas/chatInitSettings.schema.json new file mode 100644 index 000000000..9828560d2 --- /dev/null +++ b/src/context/schemas/chatInitSettings.schema.json @@ -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" + ] +} \ No newline at end of file diff --git a/src/context/schemas/chatRoomRef.schema.json b/src/context/schemas/chatRoomRef.schema.json new file mode 100644 index 000000000..3edcdccd9 --- /dev/null +++ b/src/context/schemas/chatRoomRef.schema.json @@ -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" + ] +} \ No newline at end of file diff --git a/website/sidebars.json b/website/sidebars.json index 0538b6f85..545579554 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -53,15 +53,17 @@ "label": "Reference", "ids": [ "context/ref/Context", + "context/ref/ChatInitSettings", + "context/ref/ChatRoomRef", "context/ref/Contact", "context/ref/ContactList", + "context/ref/Country", "context/ref/Instrument", "context/ref/InstrumentList", + "context/ref/Nothing", "context/ref/Organization", - "context/ref/Country", - "context/ref/Position", "context/ref/Portfolio", - "context/ref/Nothing" + "context/ref/Position" ] } ], From 395b6109c15e48a700d85c4f6c14eb86a4f7f7d2 Mon Sep 17 00:00:00 2001 From: Bertrand Laporte Date: Tue, 8 Mar 2022 13:29:35 +0100 Subject: [PATCH 2/7] 574 StartChat: ChatInitSettings and ChatRoomRef --- docs/context/ref/ChatInitSettings.md | 2 +- docs/context/ref/ChatRoomRef.md | 2 +- docs/intents/ref/StartChat.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/context/ref/ChatInitSettings.md b/docs/context/ref/ChatInitSettings.md index 2efdfb0cd..58cc88065 100644 --- a/docs/context/ref/ChatInitSettings.md +++ b/docs/context/ref/ChatInitSettings.md @@ -64,7 +64,7 @@ const initSettings = { } const res = fdc3.raiseIntent('StartChat', initSettings); -const roomRef = await res.getResult(); +const roomRefs = await res.getResult(); ``` ## See Also diff --git a/docs/context/ref/ChatRoomRef.md b/docs/context/ref/ChatRoomRef.md index 0220a4615..569cd3e39 100644 --- a/docs/context/ref/ChatRoomRef.md +++ b/docs/context/ref/ChatRoomRef.md @@ -48,7 +48,7 @@ const newChat = await fdc3.raiseIntent('StartChat', { }], initMessage: "Hello Jane" }); -const roomRef = await newChat.getResult(); +const roomRefs = await newChat.getResult(); ``` ## See Also diff --git a/docs/intents/ref/StartChat.md b/docs/intents/ref/StartChat.md index 5a3787216..f4e193e91 100644 --- a/docs/intents/ref/StartChat.md +++ b/docs/intents/ref/StartChat.md @@ -24,7 +24,7 @@ Initiate a chat with a contact, a list of contacts or detailed initialization se ## Result Context -* [ChatRoomRef](../../context/ref/ChatRoomRef) +* Array of [ChatRoomRef](../../context/ref/ChatRoomRef) ## Example ```js @@ -66,7 +66,7 @@ const initSettings = { } const resolution = fdc3.raiseIntent('StartChat', initSettings); -const chatRoomRef = await resolution.getResult(); +const chatRoomRefs = await resolution.getResult(); ``` ## See Also From e8ba0f80e35725bf0b0cc0ff8b47f66dc5735551 Mon Sep 17 00:00:00 2001 From: Bertrand Laporte Date: Tue, 22 Mar 2022 15:32:19 +0100 Subject: [PATCH 3/7] 574: change ChatInitSettings member type to ContactList --- docs/context/ref/ChatInitSettings.md | 58 ++++++++++--------- docs/context/ref/ChatRoomRef.md | 7 --- docs/intents/ref/StartChat.md | 27 ++++----- .../schemas/chatInitSettings.schema.json | 2 +- 4 files changed, 43 insertions(+), 51 deletions(-) diff --git a/docs/context/ref/ChatInitSettings.md b/docs/context/ref/ChatInitSettings.md index 58cc88065..3ed11444b 100644 --- a/docs/context/ref/ChatInitSettings.md +++ b/docs/context/ref/ChatInitSettings.md @@ -19,17 +19,17 @@ 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]` | -| `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 | +| Property | Type | Required | Example Value | +| ------------------------------ | ----------- | -------- | -------------------------------------------------------------------- | +| `type` | string | Yes | `'fdc3.chat.initSettings'` | +| `chatName` | string | No | `'Instrumet XYZ'` | +| `members` | ContactList | No | ContactList - cf. below | +| `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. @@ -39,28 +39,30 @@ intent is expectd to provide a mean to enter such information. ```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' - }, - }], + chatName: 'Chat ABCD', + members: { + type: 'fdc3.contactList', + contacts: [{ + 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 + allowMessageCopy: true } - initMessage: "Hello both!" + initMessage: 'Hello both!' } const res = fdc3.raiseIntent('StartChat', initSettings); diff --git a/docs/context/ref/ChatRoomRef.md b/docs/context/ref/ChatRoomRef.md index 569cd3e39..b5257cd0c 100644 --- a/docs/context/ref/ChatRoomRef.md +++ b/docs/context/ref/ChatRoomRef.md @@ -39,13 +39,6 @@ const roomRefExample = { 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(); diff --git a/docs/intents/ref/StartChat.md b/docs/intents/ref/StartChat.md index f4e193e91..53d6c3845 100644 --- a/docs/intents/ref/StartChat.md +++ b/docs/intents/ref/StartChat.md @@ -42,27 +42,24 @@ fdc3.raiseIntent('StartChat', contact) 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' - }, - }], + members: { + type: 'fdc3.contactList', + contacts: [{ + 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 + allowAddUser: false, // John won't be auhtorized to add other users to the chat } - initMessage: "Hello both!" + initMessage: 'Hello John!' } const resolution = fdc3.raiseIntent('StartChat', initSettings); diff --git a/src/context/schemas/chatInitSettings.schema.json b/src/context/schemas/chatInitSettings.schema.json index 9828560d2..044068dbd 100644 --- a/src/context/schemas/chatInitSettings.schema.json +++ b/src/context/schemas/chatInitSettings.schema.json @@ -11,7 +11,7 @@ "type": "string" }, "members": { - "$ref": "contact.schema.json#" + "$ref": "contactList.schema.json#" }, "initMessage": { "type": "string" From 04d31a39329310ac61a06c0bfaa5c608d1c6d364 Mon Sep 17 00:00:00 2001 From: Bertrand Laporte <66629144+bertrand-s@users.noreply.github.com> Date: Thu, 31 Mar 2022 15:05:56 +0200 Subject: [PATCH 4/7] Update docs/context/ref/ChatInitSettings.md Co-authored-by: Hugh Troeger --- docs/context/ref/ChatInitSettings.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/context/ref/ChatInitSettings.md b/docs/context/ref/ChatInitSettings.md index 3ed11444b..442d65d09 100644 --- a/docs/context/ref/ChatInitSettings.md +++ b/docs/context/ref/ChatInitSettings.md @@ -27,7 +27,7 @@ https://fdc3.finos.org/schemas/next/chatInitSettings.schema.json | `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.allowHistoryBrowsing` | boolean | No | `true`: members will be allowed to browse 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 | From 8c850fdea21f61451834d7a612fb6b5b4f1a3490 Mon Sep 17 00:00:00 2001 From: Bertrand Laporte <66629144+bertrand-s@users.noreply.github.com> Date: Thu, 31 Mar 2022 15:06:10 +0200 Subject: [PATCH 5/7] Update docs/context/ref/ChatInitSettings.md Co-authored-by: Hugh Troeger --- docs/context/ref/ChatInitSettings.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/context/ref/ChatInitSettings.md b/docs/context/ref/ChatInitSettings.md index 442d65d09..f430da6fc 100644 --- a/docs/context/ref/ChatInitSettings.md +++ b/docs/context/ref/ChatInitSettings.md @@ -32,7 +32,7 @@ https://fdc3.finos.org/schemas/next/chatInitSettings.schema.json | `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. +intent is expected to provide a means to enter such information. ## Example From 4ca063552265717c06adb13890e14ac5b9957a11 Mon Sep 17 00:00:00 2001 From: Bertrand Laporte <66629144+bertrand-s@users.noreply.github.com> Date: Thu, 31 Mar 2022 15:06:21 +0200 Subject: [PATCH 6/7] Update docs/intents/ref/StartChat.md Co-authored-by: Hugh Troeger --- docs/intents/ref/StartChat.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/intents/ref/StartChat.md b/docs/intents/ref/StartChat.md index 53d6c3845..b403d87d3 100644 --- a/docs/intents/ref/StartChat.md +++ b/docs/intents/ref/StartChat.md @@ -38,7 +38,7 @@ const contact = { fdc3.raiseIntent('StartChat', contact) -// chat with initialization settigns +// chat with initialization settings const initSettings = { type: 'fdc3.chat.initSettings', chatName: 'Issue #123', From d4fe0591d89ebc1b6552fe7eb562a16655946ee0 Mon Sep 17 00:00:00 2001 From: Bertrand Laporte Date: Fri, 1 Apr 2022 17:51:00 +0200 Subject: [PATCH 7/7] Remove ChatRoomRef references --- docs/context/ref/ChatInitSettings.md | 1 - docs/context/ref/ChatRoomRef.md | 53 --------------------- docs/intents/ref/StartChat.md | 4 -- docs/intents/spec.md | 1 - src/context/schemas.json | 5 +- src/context/schemas/chatRoomRef.schema.json | 33 ------------- website/sidebars.json | 1 - 7 files changed, 3 insertions(+), 95 deletions(-) delete mode 100644 docs/context/ref/ChatRoomRef.md delete mode 100644 src/context/schemas/chatRoomRef.schema.json diff --git a/docs/context/ref/ChatInitSettings.md b/docs/context/ref/ChatInitSettings.md index f430da6fc..8401e1850 100644 --- a/docs/context/ref/ChatInitSettings.md +++ b/docs/context/ref/ChatInitSettings.md @@ -74,7 +74,6 @@ const roomRefs = await res.getResult(); Other Types - [ContactList](ContactList) -- [ChatRoomRef](ChatRoomRef) Intents diff --git a/docs/context/ref/ChatRoomRef.md b/docs/context/ref/ChatRoomRef.md deleted file mode 100644 index b5257cd0c..000000000 --- a/docs/context/ref/ChatRoomRef.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -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', - initMessage: "Hello Jane" -}); -const roomRefs = await newChat.getResult(); -``` - -## See Also - -Other Types -- [ChatInitSettings](ChatInitSettings) - -Intents -- [StartChat](../../intents/ref/StartChat) diff --git a/docs/intents/ref/StartChat.md b/docs/intents/ref/StartChat.md index b403d87d3..fd6f83861 100644 --- a/docs/intents/ref/StartChat.md +++ b/docs/intents/ref/StartChat.md @@ -22,9 +22,6 @@ Initiate a chat with a contact, a list of contacts or detailed initialization se * [ContactList](../../context/ref/ContactList) * [ChatInitSettings](../../context/ref/ChatInitSettings) -## Result Context - -* Array of [ChatRoomRef](../../context/ref/ChatRoomRef) ## Example ```js @@ -72,7 +69,6 @@ Context - [Contact](../../context/ref/Contact) - [ContactList](../../context/ref/ContactList) - [ChatInitSettings](../../context/ref/ChatInitSettings) -- [ChatRoomRef](../../context/ref/ChatRoomRef) Intents - [StartCall](StartCall) \ No newline at end of file diff --git a/docs/intents/spec.md b/docs/intents/spec.md index 4ca91856f..1c19f3915 100644 --- a/docs/intents/spec.md +++ b/docs/intents/spec.md @@ -39,7 +39,6 @@ However, there is a need for applications to ensure that their intents avoid col ### StartChat * Expected context: Contact or ContactList or ChatInitSettings * Expected behavior: initiate chat with contact(s) or initialization settings - * Result context: ChatRoomRef ### ViewChart * Expected context: Instrument * Expected behavior: display a chart for the context diff --git a/src/context/schemas.json b/src/context/schemas.json index c72d6f6be..f5be86abc 100644 --- a/src/context/schemas.json +++ b/src/context/schemas.json @@ -1,6 +1,7 @@ { - "ChatInitSettings": ["https://fdc3.finos.org/schemas/next/chatInitSettings.schema.json"], - "ChatRoomRef": ["https://fdc3.finos.org/schemas/next/chatRoomRef.schema.json"], + "ChatInitSettings": [ + "https://fdc3.finos.org/schemas/next/chatInitSettings.schema.json" + ], "Context": ["https://fdc3.finos.org/schemas/next/context.schema.json"], "Contact": ["https://fdc3.finos.org/schemas/next/contact.schema.json"], "ContactList": ["https://fdc3.finos.org/schemas/next/contactList.schema.json"], diff --git a/src/context/schemas/chatRoomRef.schema.json b/src/context/schemas/chatRoomRef.schema.json deleted file mode 100644 index 3edcdccd9..000000000 --- a/src/context/schemas/chatRoomRef.schema.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "$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" - ] -} \ No newline at end of file diff --git a/website/sidebars.json b/website/sidebars.json index 545579554..201cbc250 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -54,7 +54,6 @@ "ids": [ "context/ref/Context", "context/ref/ChatInitSettings", - "context/ref/ChatRoomRef", "context/ref/Contact", "context/ref/ContactList", "context/ref/Country",