diff --git a/CHANGELOG.md b/CHANGELOG.md
index dc71142ad..fa4f947d3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,11 +8,26 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added
+* Added `CreateInteraction` intent. To be used when a user wants to record an interaction into a system. New context `Interaction` also introduced. An interaction might be a call, IM, email, a meeting (physical or virtual) or the preparation of some specialist data. ([#747](https://github.com/finos/FDC3/pull/747))
+* Added `TransactionResult` context. A context type representing the result of a transaction initiated via FDC3. Its purpose is to provide a status and message (where needed) for the transaction and MAY wrap a returned context object. ([#761](https://github.com/finos/FDC3/pull/761))
+* Added `Order` (`fdc3.order`) context type representing the details of an order, which may be used to transmit a new order to a third party or share details of an existing order. ([#824](https://github.com/finos/FDC3/pull/824))
+
+* Added a `SendChatMessage` intent to be used when a user wants to send a message to an existing chat room. ([#794](https://github.com/finos/FDC3/pull/794))
+* Added a context type representing a chat message (`fdc3.chat.message`). ([#794](https://github.com/finos/FDC3/pull/794))
+* Added a context type representing a chat room (`fdc3.chat.room`). ([#794](https://github.com/finos/FDC3/pull/794))
+* Added a chat `Message` type in order to describe messages with rich content and attachments. ([#779](https://github.com/finos/FDC3/pull/779))
+* Added an `Action` type, encapsulating either a `Context` or the association of a `Context` with an `Intent` inside another object. ([#779](https://github.com/finos/FDC3/pull/779))
+* Added a `ViewChat` Intent to be used when a user wants to open an existing chat room. ([#796](https://github.com/finos/FDC3/pull/796))
+* Added a `ViewMessages` intent to be used when a user wants to search and see a list of messages. ([#797](https://github.com/finos/FDC3/pull/797))
+* Added a context type representing a ChatSearchCriteria (`fdc3.chat.searchCriteria`). ([#797](https://github.com/finos/FDC3/pull/797))
+
* Added error examples to the /v2 App Directory API routes ([#973](https://github.com/finos/FDC3/pull/973))
### Changed
+* Updated definition of the `ChatInitSettings` context type to use the new `Message` type. ([#779](https://github.com/finos/FDC3/pull/779))
* Updated definition of the `Instrument` context type to include optional market identifiers ([#819](https://github.com/finos/FDC3/pull/819))
+* Updated the `StartChat` intent to return a reference to the room. ([#794](https://github.com/finos/FDC3/pull/794))
* Corrected API functions and object types to always use `string` instead of `String` ([#924](https://github.com/finos/FDC3/pull/924))
### Deprecated
diff --git a/docs/context/ref/Action.md b/docs/context/ref/Action.md
new file mode 100644
index 000000000..179aea950
--- /dev/null
+++ b/docs/context/ref/Action.md
@@ -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)
diff --git a/docs/context/ref/ChatInitSettings.md b/docs/context/ref/ChatInitSettings.md
index f24fe207c..acf60a5dc 100644
--- a/docs/context/ref/ChatInitSettings.md
+++ b/docs/context/ref/ChatInitSettings.md
@@ -22,12 +22,12 @@ https://fdc3.finos.org/schemas/next/chatInitSettings.schema.json
| Property | Type | Required | Example Value |
| ------------------------------ | ----------- | -------- | -------------------------------------------------------------------- |
| `type` | string | Yes | `'fdc3.chat.initSettings'` |
-| `chatName` | string | No | `'Instrument XYZ'` |
+| `chatName` | string | No | `'Instrument XYZ'` |
| `members` | ContactList | No | ContactList - cf. below |
-| `initMessage` | string | No | `'Hello!'` |
+| `message` | Message | No | Message - cf. below |
| `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 browse past messages |
+| `options.isPublic` | boolean | No | `true`: the room will be visible to everyone in the chat application |
+| `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 |
@@ -58,27 +58,45 @@ const initSettings = {
},
options: {
groupRecipients: true, // one chat with both contacts
- public: false, // private chat room
+ isPublic: false, // private chat room
allowHistoryBrowsing: true,
allowMessageCopy: true
}
- initMessage: 'Hello both!'
+ message: {
+ type: 'fdc3.message',
+ text: {
+ 'text/plain': 'Hey all, can we discuss the issue together? I attached a screenshot'
+ },
+ entities: {
+ '0': {
+ type: 'fdc3.fileAttachment',
+ data: {
+ name: 'myImage.png',
+ dataUri: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII'
+ }
+ }
+ }
+ }
}
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)
+- [Message](Message)
Intents
-
- [StartChat](../../intents/ref/StartChat)
- [StartCall](../../intents/ref/StartCall)
+- [SendChatMessage](../../intents/ref/StartChat)
- [ViewContact](../../intents/ref/ViewContact)
FINOS Financial Objects
diff --git a/docs/context/ref/ChatMessage.md b/docs/context/ref/ChatMessage.md
new file mode 100644
index 000000000..5d8483854
--- /dev/null
+++ b/docs/context/ref/ChatMessage.md
@@ -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)
diff --git a/docs/context/ref/ChatRoom.md b/docs/context/ref/ChatRoom.md
new file mode 100644
index 000000000..db69b07d6
--- /dev/null
+++ b/docs/context/ref/ChatRoom.md
@@ -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 an 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)
diff --git a/docs/context/ref/Contact.md b/docs/context/ref/Contact.md
index ff25878d8..34843e1ca 100644
--- a/docs/context/ref/Contact.md
+++ b/docs/context/ref/Contact.md
@@ -46,6 +46,7 @@ Other Types
- [ContactList](ContactList)
Intents
+- [CreateInteraction](../../intents/ref/CreateInteraction)
- [StartChat](../../intents/ref/StartChat)
- [StartCall](../../intents/ref/StartCall)
- [ViewProfile](../../intents/ref/ViewProfile)
diff --git a/docs/context/ref/ContactList.md b/docs/context/ref/ContactList.md
index d0082c659..d03bd83b5 100644
--- a/docs/context/ref/ContactList.md
+++ b/docs/context/ref/ContactList.md
@@ -62,6 +62,7 @@ Other Types
- [Contact](Contact)
Intents
+- [CreateInteraction](../../intents/ref/CreateInteraction)
- [StartChat](../../intents/ref/StartChat)
- [StartCall](../../intents/ref/StartCall)
diff --git a/docs/context/ref/Interaction.md b/docs/context/ref/Interaction.md
new file mode 100644
index 000000000..76eac9e42
--- /dev/null
+++ b/docs/context/ref/Interaction.md
@@ -0,0 +1,96 @@
+---
+id: Interaction
+sidebar_label: Interaction
+title: Interaction
+hide_title: true
+---
+# `Interaction`
+
+An `Interaction` is a significant direct exchange of ideas or information between a number of participants, e.g. a Sell Side party and one or more Buy Side parties. An `Interaction` might be a call, a meeting (physical or virtual), an IM or the preparation of some specialist data, such as financial data for a given company or sector.
+
+Notes:
+
+- `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or `'Meeting'` although other string values are permitted.
+- `origin` is used to represent the application or service that the interaction was created from to aid in tracing the source of an interaction.
+- `id` does not need to be populated by the originating application, however the target application could store it for future reference and SHOULD return it in a `TransactionResult`.
+- `id` can be used by a target application to pass an identifier back to the originating application after an interaction record has been created, updated or deleted.
+- `id.URI` can be used by a target application to pass a record's link back to the originating application. This offers the originating application a way to open the record for a user to view.
+
+## Type
+
+`fdc3.interaction`
+
+## Schema
+
+https://fdc3.finos.org/schemas/next/interaction.schema.json
+
+## Details
+
+| Property | Type | Required | Example Value |
+|--------------------|------------------|-----------|-------------------------------------------------|
+| `type` | string | Yes | `fdc3.interaction` |
+| `participants` | fdc3.contactList | Yes | See below |
+| `timeRange` | fdc3.timeRange | Yes | See below |
+| `interactionType` | string | Yes | `Instant Message` |
+| `description` | string | Yes | `Blah, blah, blah` |
+| `initiator` | fdc3.contact | No | See below |
+| `origin` | string | No | `Outlook` |
+| `id.SINGLETRACK` | string | No | `a0S8d000000uO05EAE` |
+| `id.SALESFORCE` | string | No | `a0S8d000000uO05EAE` |
+| `id.URI` | string | No | `https://example.com/record/a0S8d000000uO05EAE` |
+
+
+## Example
+
+```js
+const interaction = {
+ type: 'fdc3.interaction',
+ participants: {
+ type: 'fdc3.contactList',
+ contacts: [
+ {
+ type: 'fdc3.contact',
+ name: 'Jane Doe',
+ id: {
+ email: 'jane.doe@mail.com'
+ }
+ },
+ {
+ type: 'fdc3.contact',
+ name: 'John Doe',
+ id: {
+ email: 'john.doe@mail.com'
+ }
+ },
+ ]
+ },
+ interactionType: 'Instant Message',
+ timeRange: {
+ type: 'fdc3.timeRange',
+ startTime: '2022-02-10T15:12:00Z'
+ },
+ description: 'Laboris libero dapibus fames elit adipisicing eu, fermentum, dignissimos laboriosam, erat, risus qui deserunt. Praesentium! Reiciendis. Hic harum nostrud, harum potenti amet? Mauris. Pretium aliquid animi, eget eiusmod integer proident. Architecto ipsum blandit ducimus, possimus illum sunt illum necessitatibus ab litora sed, nonummy integer minus corrupti ducimus iste senectus accumsan, fugiat nostrud? Pede vero dictumst excepturi, iure earum consequuntur voluptatum',
+ initiator: {
+ type: 'fdc3.contact',
+ name: 'Jane Doe',
+ id: {
+ email: 'jane.doe@mail.com'
+ }
+ },
+ origin: 'Outlook'
+}
+
+fdc3.raiseIntent('CreateInteraction', interaction)
+```
+
+## See Also
+
+Other Types
+- [Contact](Contact)
+- [ContactList](ContactList)
+- [TimeRange](TimeRange)
+- [TransactionResult](TransactionResult]
+
+Intents
+- [CreateInteraction](../../intents/ref/CreateInteraction)
+- [ViewInteractions](../../intents/ref/ViewInteractions)
\ No newline at end of file
diff --git a/docs/context/ref/Message.md b/docs/context/ref/Message.md
new file mode 100644
index 000000000..a313f0bd0
--- /dev/null
+++ b/docs/context/ref/Message.md
@@ -0,0 +1,77 @@
+---
+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)
diff --git a/docs/context/ref/Order.md b/docs/context/ref/Order.md
new file mode 100644
index 000000000..1769c01ac
--- /dev/null
+++ b/docs/context/ref/Order.md
@@ -0,0 +1,42 @@
+---
+id: Order
+sidebar_label: Order
+title: Order
+hide_title: true
+---
+# `Order`
+
+:::caution Experimental
+
+**Note:** This feature has been designated as experimental to indicate that its design may change in the future. To read more about the FDC3 experimental policy pleae visit our [Experimental Features](https://fdc3.finos.org/docs/fdc3-compliance#experimental-features) page.
+
+:::
+
+A context type representing the details of an order, which may be used to transmit a new order to a third party or share details of an existing order.
+
+When the intent is to create an Order in a downstream system at least one OrderLeg MUST be populated.
+
+When the intent is to lookup an Order in a downstream system at least one entry MUST be populated in the id field and other fields are not required.
+
+## Type
+
+`fdc3.order`
+
+## Schema
+
+https://fdc3.finos.org/scehmas/next/order.schema.json
+
+## Details
+
+| Property| Type| Required| Example
+| -| -| -| -
+| `id` | object | Yes | `{'OMS': '123456789'}`
+| `id.OMS` | string | No | `'123456789'`
+| `id.EMS` | string | No | `'EMSID1234'`
+| `id.PMS` | string | No | `'PMS12345'`
+| `sendingTime` | string | Yes | `'2022-03-30T15:44:44+00:00'`
+| `timeInForce` | fdc3.timeRange| No | `{type: "fdc3.timeRange", startTime: "2020-09-01T08:00:00.000Z", endTime: "2020-10-31T08:00:00.000Z"}`
+| `orderLegs` | fdc3.orderLeg[] | Yes |
+| `notes` | String | No
+
+
diff --git a/docs/context/ref/OrderLeg.md b/docs/context/ref/OrderLeg.md
new file mode 100644
index 000000000..121000e14
--- /dev/null
+++ b/docs/context/ref/OrderLeg.md
@@ -0,0 +1,56 @@
+---
+id: OrderLeg
+sidebar_label: OrderLeg
+title: OrderLeg
+hide_title: true
+---
+# `OrderLeg`
+
+:::caution Experimental
+
+**Note:** This feature has been designated as experimental to indicate that its design may change in the future. To read more about the FDC3 experimental policy pleae visit our [Experimental Features](https://fdc3.finos.org/docs/fdc3-compliance#experimental-features) page.
+
+:::
+
+A context type representing the details of an individual order leg, which MAY be used as part of an Order context when creating a new Order and MAY be transmitted separately to look up details of an existing OrderLeg.
+
+When the OrderLeg is part of an Order context with the intent to CREATE a new Order fields MUST be populated as indicated.
+
+When the intent is to lookup an OrderLeg in a downstream system at least one entry MUST be populated in the id field and other fields are NOT required.
+
+## Type
+
+`fdc3.orderLeg`
+
+## Schema
+
+https://fdc3.finos.org/scehmas/next/orderLeg.schema.json
+
+| Property| Type| Required| Example
+| -| -| -| -
+| `type` | String | Yes | `fdc3.orderLeg`
+| `id` | object | Yes | `{'OMS': '123456789-leg1'}`
+| `product` | object | Yes | `{'instrument': {'ticker':'MSFT'}} \| {'productDefinition': '...'}`
+| `product.instrument` | fdc3.Instrument | No | `{'instrument': {'ticker':'MSFT'}}`
+| `product.productDefinition` | object | No | `{'productDefinition': '...'}`
+| `quantity` | object | Yes | `{'units': 100000.00}`
+| `quantity.units` | double | No | `1000000.00`
+| `quantity.cashValue` | double | No | `5000000.00`
+| `quantity.proceedsFrom` | string | No | `{'OMS': '123456789-leg2'}`
+| `currency` | fdc3.currency | No | `{type: 'fdc3.currency', name: 'US Dollar', id: {CURRENCY_ISOCODE: "USD"}}`
+| `side` | string | Yes | `'B' \| 'S' \| 'P' \| 'R'...`
+| `price` | object | Yes | `{'orderType': 'limit', 'limitPrice': 123.45}`
+| `price.priceType` | string | No | `'absolute' \| 'percentage' \| 'yield' \| 'spread'...`
+| `price.orderType` | string | Yes | `'limit' \| 'market' \| 'stopMarket' \| 'stopLimit'...`
+| `price.limitPrice` | double | No | `1.15`
+| `price.stopPrice` | double | No | `1.20`
+| `settlement` | object | No | `{currency: {type: 'fdc3.currency', name: 'Pound Sterling', id: {CURRENCY_ISOCODE: "GBP"}, 'date': '2022-03-30T15:44:44+00:00'}`
+| `settlement.currency` | fdc3.currency | No | `{type: 'fdc3.currency', name: 'Pound Sterling', id: {CURRENCY_ISOCODE: "GBP"}`
+| `settlement.date` | string | No | `'2022-03-30T15:44:44+00:00'`
+| `allocations` | object[] | No | `[{'account': 'TRADEACCOUNT1', 'quantity': 1000000.00, 'positionEffect': 'O'}]`
+| `allocations[i].account` | string | Yes | `TRADEACCOUNT1`
+| `allocations[i].quantity` | double | No | `1000000.00`
+| `allocations[i].positionEffect` | string | No | `'O' \| 'C'`
+| `partyIdentifiers` | object[] | No | `[{'role': 'executingFirm', 'id': {'LEI': '549300UO56I4KIWC0U51'}]`
+| `partyIdentifiers[i].role` | string | Yes | `'executingFirm'`
+| `partyIdentifiers[i].id` | string | Yes | `{'LEI': '549300UO56I4KIWC0U51'}`
diff --git a/docs/context/ref/SearchCriteria.md b/docs/context/ref/SearchCriteria.md
new file mode 100644
index 000000000..13b06ad64
--- /dev/null
+++ b/docs/context/ref/SearchCriteria.md
@@ -0,0 +1,64 @@
+---
+id: ChatSearchCriteria
+sidebar_label: ChatSearchCriteria
+title: ChatSearchCriteria
+hide_title: true
+---
+# `ChatSearchCriteria`
+
+A context type that represents a simple search criterion, based on a list of other context objects, that can be used to search or filter messages in a chat application.
+
+## Type
+
+`fdc3.chat.searchCriteria`
+
+## Schema
+
+https://fdc3.finos.org/schemas/next/chatSearchCriteria.schema.json
+
+## Details
+
+| Property | Type | Required | Example Value |
+|------------------|-----------------|----------|----------------------|
+| `type` | string | Yes | `'fdc3.chat.searchCriteria'` |
+| `criteria` | (Instrument |
Contact |
Organization |
string)[] | Yes |
[| + +⚠️ Operators (and/or/not) are not defined in `fdc3.chat.searchCriteria`. It is up to the application that processes the FDC3 Intent to choose and apply the operators between the criteria. + +Empty search criteria can be supported to allow resetting of filters. + +## Example + +```js +const searchCriteria = { + type: "fdc3.chat.searchCriteria", + criteria: [ + { + type: "fdc3.instrument", + id: { + ticker: "AAPL" + } + }, + { + type: "fdc3.contact", + name: "Jane Doe", + id: { + email: "jane.doe@mail.com" + } + }, + { + type: "fdc3.organization", + name: "Symphony" + }, + "#OrderID45788422" + ] +} + +fdc3.raiseIntent('ViewMessages', searchCriteria); +``` + +## See Also + +Intents + +* [ViewMessages](../../intents/ref/ViewMessages) diff --git a/docs/context/ref/TimeRange.md b/docs/context/ref/TimeRange.md index a82f3099d..b64321bf3 100644 --- a/docs/context/ref/TimeRange.md +++ b/docs/context/ref/TimeRange.md @@ -80,3 +80,6 @@ const timeRange = { Other Types - [Chart](Chart) + +Intents +- [CreateInteraction](../../intents/ref/CreateInteraction) \ No newline at end of file diff --git a/docs/context/ref/TransactionResult.md b/docs/context/ref/TransactionResult.md new file mode 100644 index 000000000..3428feb20 --- /dev/null +++ b/docs/context/ref/TransactionResult.md @@ -0,0 +1,59 @@ +--- +id: TransactionResult +sidebar_label: TransactionResult +title: TransactionResult +hide_title: true +--- +# `TransactionResult` + +A context type representing the result of a transaction initiated via FDC3, which SHOULD be returned as an [`IntentResult`](../../api/Types#intentresult) by intents that create, retrieve, update or delete content or records in another application. Its purpose is to provide a status and message (where needed) for the transaction and MAY wrap a returned context object. + +## Type + +`fdc3.transactionResult` + +## Schema + +https://fdc3.finos.org/schemas/next/transactionresult.schema.json + +## Details + +| Property | Type | Required | Example Value | +|------------|---------|----------|-------------------| +| `type` | string | Yes | 'fdc3.transactionResult' | +| `status` | string | Yes | `"Created" | "Deleted" | "Updated" | "Failed"` | +| `context` | Context | No | See Below | +| `message` | string | No | See Below | + +## Example + +```js +const contact = { + type: "fdc3.contact", + name: "Jane Doe", + id: { + email: "jane.doe@mail.com" + } +} + +const resolution = await window.fdc3.raiseIntent('CreateOrUpdateProfile', contact); +const result = await resolution.getResult(); +console.log(JSON.stringify(result)); +``` + +Console log will display: + +```json +{ + "type": "fdc3.transactionResult", + "status": "Updated", + "context": { + "type": "fdc3.contact", + "name": "Jane Doe", + "id": { + "email": "jane.doe@mail.com" + } + }, + "message": "record with id 'jane.doe@mail.com' was updated" +} +``` diff --git a/docs/context/spec.md b/docs/context/spec.md index 436f22136..542a490da 100644 --- a/docs/context/spec.md +++ b/docs/context/spec.md @@ -159,23 +159,30 @@ For more details on FDC3 Standards compliance (including the versioning, depreca The following are standard FDC3 context types: -* [`fdc3.chart`](ref/Chart) ([schema](/schemas/next/chart.schema.json)) -* [`fdc3.chat.initSettings`](ref/ChatInitSettings) ([schema](/schemas/next/chatInitSettings.schema.json)) -* [`fdc3.contact`](ref/Contact) ([schema](/schemas/next/contact.schema.json)) -* [`fdc3.contactList`](ref/ContactList) ([schema](/schemas/next/contactList.schema.json)) -* [`fdc3.country`](ref/Country) ([schema](/schemas/next/country.schema.json)) -* [`fdc3.currency`](ref/Currency) ([schema](/schemas/next/currency.schema.json)) -* [`fdc3.email`](ref/Email) ([schema](/schemas/next/email.schema.json)) -* [`fdc3.instrument`](ref/Instrument) ([schema](/schemas/next/instrument.schema.json)) -* [`fdc3.instrumentList`](ref/InstrumentList) ([schema](/schemas/next/instrumentList.schema.json)) -* [`fdc3.organization`](ref/Organization) ([schema](/schemas/next/organization.schema.json)) -* [`fdc3.portfolio`](ref/Portfolio) ([schema](/schemas/next/portfolio.schema.json)) -* [`fdc3.position`](ref/Position) ([schema](/schemas/next/position.schema.json)) -* [`fdc3.nothing`](ref/Nothing) ([schema](/schemas/next/nothing.schema.json)) -* [`fdc3.timerange`](ref/TimeRange) ([schema](/schemas/next/timerange.schema.json)) -* [`fdc3.valuation`](ref/Valuation) ([schema](/schemas/next/valuation.schema.json)) - -**Note:** The below examples show how the base context data interface can be used to define specific context data objects. +- [`fdc3.action`](ref/Action) ([schema](/schemas/next/action.schema.json)) +- [`fdc3.chart`](ref/Chart) ([schema](/schemas/next/chart.schema.json)) +- [`fdc3.chat.initSettings`](ref/ChatInitSettings) ([schema](/schemas/next/chatInitSettings.schema.json)) +- [`fdc3.chat.message`](ref/ChatMessage) ([schema](/schemas/next/chatMessage.schema.json)) +- [`fdc3.chat.room`](ref/ChatRoom) ([schema](/schemas/next/chatRoom.schema.json)) +- [`fdc3.chat.searchCriteria`](ref/ChatSearchCriteria) ([schema](/schemas/next/chatSearchCriteria.schema.json)) +- [`fdc3.contact`](ref/Contact) ([schema](/schemas/next/contact.schema.json)) +- [`fdc3.contactList`](ref/ContactList) ([schema](/schemas/next/contactList.schema.json)) +- [`fdc3.country`](ref/Country) ([schema](/schemas/next/country.schema.json)) +- [`fdc3.currency`](ref/Currency) ([schema](/schemas/next/currency.schema.json)) +- [`fdc3.email`](ref/Email) ([schema](/schemas/next/email.schema.json)) +- [`fdc3.instrument`](ref/Instrument) ([schema](/schemas/next/instrument.schema.json)) +- [`fdc3.instrumentList`](ref/InstrumentList) ([schema](/schemas/next/instrumentList.schema.json)) +- [`fdc3.interaction`](ref/Interaction) ([schema](/schemas/next/interaction.schema.json)) +- [`fdc3.message`](ref/Message) ([schema](/schemas/next/message.schema.json)) +- [`fdc3.organization`](ref/Organization) ([schema](/schemas/next/organization.schema.json)) +- [`fdc3.portfolio`](ref/Portfolio) ([schema](/schemas/next/portfolio.schema.json)) +- [`fdc3.position`](ref/Position) ([schema](/schemas/next/position.schema.json)) +- [`fdc3.nothing`](ref/Nothing) ([schema](/schemas/next/nothing.schema.json)) +- [`fdc3.timerange`](ref/TimeRange) ([schema](/schemas/next/timerange.schema.json)) +- [`fdc3.transactionResult`](ref/TransactionResult) ([schema](/schemas/next/transactionresult.schema.json)) +- [`fdc3.valuation`](ref/Valuation) ([schema](/schemas/next/valuation.schema.json)) + +__Note:__ The below examples show how the base context data interface can be used to define specific context data objects. ### Examples diff --git a/docs/intents/ref/CreateInteraction.md b/docs/intents/ref/CreateInteraction.md new file mode 100644 index 000000000..041b663a4 --- /dev/null +++ b/docs/intents/ref/CreateInteraction.md @@ -0,0 +1,126 @@ +--- +id: CreateInteraction +sidebar_label: CreateInteraction +title: CreateInteraction +hide_title: true +--- +# `CreateInteraction` + +Create a record documenting an interaction (calls, meetings, etc.) between a list of contacts. + +## Intent Name + +`CreateInteraction` + +## Display Name + +`Create Interaction` + +## Possible Contexts + +* [ContactList](../../context/ref/ContactList) +* [Interaction](../../context/ref/Interaction) + +SHOULD return context as a result: + +* [TransactionResult](../../context/ref/TransactionResult) + +## Example + +```js +const interaction = { + type: 'fdc3.interaction', + participants: { + type: 'fdc3.contactList', + contacts: [ + { + type: 'fdc3.contact', + name: 'Jane Doe', + id: { + email: 'jane.doe@mail.com' + } + }, + { + type: 'fdc3.contact', + name: 'John Doe', + id: { + email: 'john.doe@mail.com' + } + }, + ] + }, + interactionType: 'Instant Message', + timeRange: { + type: 'fdc3.timeRange', + startTime: '2022-02-10T15:12:00Z' + }, + description: 'Laboris libero dapibus fames elit adipisicing eu, fermentum, dignissimos laboriosam, erat, risus qui deserunt. Praesentium! Reiciendis. Hic harum nostrud, harum potenti amet? Mauris. Pretium aliquid animi, eget eiusmod integer proident. Architecto ipsum blandit ducimus, possimus illum sunt illum necessitatibus ab litora sed, nonummy integer minus corrupti ducimus iste senectus accumsan, fugiat nostrud? Pede vero dictumst excepturi, iure earum consequuntur voluptatum', + initiator: { + type: 'fdc3.contact', + name: 'Jane Doe', + id: { + email: 'jane.doe@mail.com' + } + }, + origin: 'Outlook' +} + +const intentResolution = await fdc3.raiseIntent('CreateInteraction', interaction); +const result = await intentResolution.getResult(); +console.log(result); +``` + +Console log will display: + +```js +{ + type: 'fdc3.transactionResult', + status: 'Created', + context: { + type: 'fdc3.interaction', + participants: { + type: 'fdc3.contactList', + contacts: [ + { + type: 'fdc3.contact', + name: 'Jane Doe', + id: { + email: 'jane.doe@mail.com' + } + }, + { + type: 'fdc3.contact', + name: 'John Doe', + id: { + email: 'john.doe@mail.com' + } + }, + ] + }, + interactionType: 'Instant Message', + timeRange: { + type: 'fdc3.timeRange', + startTime: '2022-02-10T15:12:00Z' + }, + description: 'Laboris libero dapibus fames elit adipisicing eu, fermentum, dignissimos laboriosam, erat, risus qui deserunt. Praesentium! Reiciendis. Hic harum nostrud, harum potenti amet? Mauris. Pretium aliquid animi, eget eiusmod integer proident. Architecto ipsum blandit ducimus, possimus illum sunt illum necessitatibus ab litora sed, nonummy integer minus corrupti ducimus iste senectus accumsan, fugiat nostrud? Pede vero dictumst excepturi, iure earum consequuntur voluptatum', + initiator: { + type: 'fdc3.contact', + name: 'Jane Doe', + id: { + email: 'jane.doe@mail.com' + } + }, + origin: 'Outlook' + id: { + Singletrack: 'a0S8d000000uO05EAE' + } + }, + message: 'record with id "a0S8d000000uO05EAE" was created' +} +``` + +## See Also + +Context +- [Interaction](../../context/ref/Interaction) +- [TransactionResult](../../context/ref/TransactionResult) \ No newline at end of file diff --git a/docs/intents/ref/SendChatMessage.md b/docs/intents/ref/SendChatMessage.md new file mode 100644 index 000000000..e34673333 --- /dev/null +++ b/docs/intents/ref/SendChatMessage.md @@ -0,0 +1,50 @@ +--- +id: SendChatMessage +sidebar_label: SendChatMessage +title: SendChatMessage +hide_title: true +--- +# `SendChatMessage` + +Send a message to an existing chat room. + +## Intent Name + +`SendChatMessage` + +## Display Name + +`Send Chat Message` + +## Possible Contexts + +* [ChatMessage](../../context/ref/ChatMessage) + +## Example + +```js +// Start a chat and retrieve a reference to the chat room created +const intentResolution = await fdc3.raiseIntent("StartChat", context); +const chatRoom = intentResolution.getResult(); + +//Some time later + +let chatMessage: ChatMessage = { + type: "fdc3.chat.message", + chatRoom, + message: "Another message to send in the room" +} + +await fdc3.raiseIntent("SendChatMessage", context, intentResolution.source); +``` + +## See Also + +Context +- [ChatMessage](../../context/ref/ChatMessage) +- [ChatRoom](../../context/ref/ChatRoom) + +Intents +* [StartChat](StartChat) +* [StartCall](StartCall) +* [StartEmail](StartEmail) diff --git a/docs/intents/ref/StartChat.md b/docs/intents/ref/StartChat.md index fcb4243f7..1fd9a4d39 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, a list of contacts or detailed initialization settings. +Initiate a chat with a contact, a list of contacts or detailed initialization settings. This could be launched from within another application. For example initiating a chat from a research or OMS application. ## Intent Name @@ -38,10 +38,16 @@ fdc3.raiseIntent('StartChat', contact) // chat with initialization settings const initSettings = { type: 'fdc3.chat.initSettings', - chatName: 'Issue #123', + 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: { @@ -51,25 +57,42 @@ const initSettings = { }, options: { groupRecipients: true, // one chat with both contacts - public: false, // private chat room + isPublic: false, // private chat room allowHistoryBrowsing: true, - allowMessageCopy: true, - allowAddUser: false, // John won't be authorized to add other users to the chat + allowMessageCopy: true + } + message: { + type: 'fdc3.message', + text: { + 'text/plain': 'Hey all, can we discuss the issue together? I attached a screenshot' + }, + entities: { + '0': { + type: 'fdc3.fileAttachment', + data: { + name: 'myImage.png', + dataUri: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII' + } + } + } } - initMessage: 'Hello John!' } 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) diff --git a/docs/intents/ref/ViewChat.md b/docs/intents/ref/ViewChat.md new file mode 100644 index 000000000..4a6973bd6 --- /dev/null +++ b/docs/intents/ref/ViewChat.md @@ -0,0 +1,103 @@ +--- +id: ViewChat +sidebar_label: ViewChat +title: ViewChat +hide_title: true +--- +# `ViewChat` + +Open an existing chat room. + +## Intent Name + +`ViewChat` + +## Display Name + +`View Chat` + +## Possible Contexts + +* [ChatRoom](../../context/ref/ChatRoom) +* [Contact](../../context/ref/Contact): It will open the **direct** chat where there is the current user and the contact +* [ContactList](../../context/ref/ContactList): It will open the **room** where there is the current user and the listed contacts. Contact List may need to display search results if there are multiple matches. + +## Output + +This intent returns as output: +* If the chat doesn't exist, will display a modal to create a chat +* if the chat gets created, return its ChatRoom context +* if none is created return void + +## Example: ChatRoom + +```js +const chatRoom = { + type: 'fdc3.chat.room', + providerName: "Symphony", + id: { + streamId: "j75xqXy25NBOdacUI3FNBH" + } +} + +const intentResolution = await fdc3.raiseIntent('ViewChat', chatRoom); + +const chatRoom = intentResolution.getResult(): // A chatRoom will be returned as context if the room was found +``` + +## Example: Contact + +```js +const contact = { + type: 'fdc3.contact', + name: 'Jane Doe', + id: { + email: 'jane@mail.com' + } +} + +const intentResolution = await fdc3.raiseIntent('ViewChat', contact); + +const chatRoom = intentResolution.getResult(): // A chatRoom will be returned as context if the direct chat was found +``` + +## Example: ContactList + +```js +const contacts = { + type: 'fdc3.contactList', + contacts: [ + { + type: 'fdc3.contact', + name: 'Jane Doe', + id: { + email: 'jane.doe@mail.com' + } + }, + { + type: 'fdc3.contact', + name: 'John Doe', + id: { + email: 'john.doe@mail.com' + } + }, + ] +} + + +const intentResolution = await fdc3.raiseIntent('ViewChat', contacts); + +const chatRoom = intentResolution.getResult(): // A chatRoom will be returned as context if the room was found +``` + +## See Also + +Context + +* [ChatRoom](../../context/ref/ChatRoom) +* [Contact](../../context/ref/Contact) +* [ContactList](../../context/ref/ContactList) + +Intents + +* [StartChat](StartChat) \ No newline at end of file diff --git a/docs/intents/ref/ViewMessages.md b/docs/intents/ref/ViewMessages.md new file mode 100644 index 000000000..fa3c28459 --- /dev/null +++ b/docs/intents/ref/ViewMessages.md @@ -0,0 +1,124 @@ +--- +id: ViewMessages +sidebar_label: ViewMessages +title: ViewMessages +hide_title: true +--- +# `ViewMessages` + +Search and display a list of messages (for example in a chat application or CRM) to the user. + +## Intent Name + +`ViewMessages` + +## Display Name + +`View Messages` + +## Possible Contexts + +* [ChatSearchCriteria](../../context/ref/ChatSearchCriteria) + +## Example + +Request display of messages relating to a specific `fdc3.instrument` (representing a ticker): +```js +const searchCriteria = { + type: "fdc3.chat.searchCriteria", + criteria: [ + { + type: "fdc3.instrument", + id: { + ticker: "AAPL" + } + } + ] +} + +fdc3.raiseIntent('ViewMessages', searchCriteria); +``` + +Request display of messages relating to a specific `fdc3.contact`: + +```js +const searchCriteria = { + type: "fdc3.chat.searchCriteria", + criteria: [ + { + type: "fdc3.contact", + name: "Jane Doe", + id: { + email: "jane.doe@mail.com" + } + } + ] +} + +fdc3.raiseIntent('ViewMessages', searchCriteria); +``` + +Request display of messages relating to a specific `fdc3.organization`: + +```js +const searchCriteria = { + type: "fdc3.chat.searchCriteria", + criteria: [ + { + type: "fdc3.organization", + name: "Symphony" + } + ] +} + +fdc3.raiseIntent('ViewMessages', searchCriteria); +``` + +Request display of messages relating to a specific **phrase**: + +```js +const searchCriteria = { + type: "fdc3.chat.searchCriteria", + criteria: [ + "#OrderID45788422" + ] +} + +fdc3.raiseIntent('ViewMessages', searchCriteria); +``` + +Request display of messages matching _multiple_ criteria: +```js +const searchCriteria = { + type: "fdc3.chat.searchCriteria", + criteria: [ + { + type: "fdc3.contact", + name: "Jane Doe", + id: { + email: "jane.doe@mail.com" + } + }, + { + type: "fdc3.organization", + name: "Symphony" + }, + "#OrderID45788422" + ] +} + +fdc3.raiseIntent('ViewMessages', searchCriteria); +``` + +## See Also + +Context + +* [ChatSearchCriteria](../../context/ref/ChatSearchCriteria) +* [Instrument](../../context/ref/Instrument) +* [Contact](../../context/ref/Contact) +* [Organization](../../context/ref/Organization) + +Intents + +* [ViewChat](ViewChat) \ No newline at end of file diff --git a/docs/intents/spec.md b/docs/intents/spec.md index a021dbad5..bf606de94 100644 --- a/docs/intents/spec.md +++ b/docs/intents/spec.md @@ -127,6 +127,12 @@ const intentsAndApps = await fdc3.findIntentsByContext({ }); ``` +## Intents that return data + +From FDC3 2.0, intents raised through the Desktop Agent API may return results in the form of a `Context` object or a `Channel`. Where an intent implements a transaction with another application, for example for a CRUD operation, the [`fdc3.transactionResult` context type](../context/ref/TransactionResult) SHOULD be used to provide a result status for the transaction and may wrap a context object that would otherwise be returned. + +For more details on retrieving a result from a raised intent, see the [documentation for `raiseIntent`](../api/ref/DesktopAgent#raiseintent). + ## Intents Standard Compliance An FDC3 Standard compliant application that supports intents **MUST**: @@ -139,6 +145,7 @@ An FDC3 Standard compliant application that supports intents **SHOULD**: * Prefer FDC3-defined standard intents over proprietary intents, where a suitable standardized intent is available. * Ensure that proprietary intents follow the recommended naming conventions in the specification. * Apply [namespacing](#namespaces) to proprietary intent names, where it is necessary to avoid collision with those created by other applications. +* Use the `fdc3.transactionResult` context type to return a status for any transactions relating to CRUD operations. An FDC3 Standard compliant application that supports intents **MAY**: @@ -150,14 +157,17 @@ For more details on FDC3 Standards compliance (including the versioning, depreca A list of standardized intents are defined in the following pages: +* [`CreateInteraction`](ref/CreateInteraction) * [`StartCall`](ref/StartCall) * [`StartChat`](ref/StartChat) * [`StartEmail`](ref/StartEmail) * [`ViewAnalysis`](ref/ViewAnalysis) +* [`ViewChat`](ref/ViewChat) * [`ViewChart`](ref/ViewChart) * [`ViewHoldings`](ref/ViewHoldings) * [`ViewInstrument`](ref/ViewInstrument) * [`ViewInteractions`](ref/ViewInteractions) +* [`ViewMessages`](ref/ViewMessages) * [`ViewNews`](ref/ViewNews) * [`ViewOrders`](ref/ViewOrders) * [`ViewProfile`](ref/ViewProfile) diff --git a/src/context/ContextType.ts b/src/context/ContextType.ts index 5f31fb843..27269dbb9 100644 --- a/src/context/ContextType.ts +++ b/src/context/ContextType.ts @@ -1,6 +1,7 @@ export enum ContextTypes { Chart = 'fdc3.chart', ChatInitSettings = 'fdc3.chat.initSettings', + ChatRoom = 'fdc3.chat.room', Contact = 'fdc3.contact', ContactList = 'fdc3.contactList', Country = 'fdc3.country', @@ -8,11 +9,14 @@ export enum ContextTypes { Email = 'fdc3.email', Instrument = 'fdc3.instrument', InstrumentList = 'fdc3.instrumentList', + Interaction = 'fdc3.interaction', + Nothing = 'fdc3.nothing', Organization = 'fdc3.organization', Portfolio = 'fdc3.portfolio', Position = 'fdc3.position', - Nothing = 'fdc3.nothing', + ChatSearchCriteria = 'fdc3.chat.searchCriteria', TimeRange = 'fdc3.timerange', + TransactionResult = 'fdc3.transactionResult', Valuation = 'fdc3.valuation', } diff --git a/src/context/ContextTypes.ts b/src/context/ContextTypes.ts index b02c22a60..feb3e5d8a 100644 --- a/src/context/ContextTypes.ts +++ b/src/context/ContextTypes.ts @@ -230,6 +230,17 @@ export interface InstrumentList { [property: string]: any; } +export interface Interaction { + id?: { [key: string]: string }; + type: string; + participants: ContactList; + timeRange: TimeRange; + interactionType: ('Instant Message' | 'Email' | 'Call' | 'Meeting') | string; + description: string; + initiator?: Contact; + origin?: string; +} + export interface Nothing { type: string; id?: { [key: string]: any }; @@ -286,6 +297,11 @@ export interface TimeRange { [property: string]: any; } +export interface ChatSearchCriteria { + criteria: (Instrument | Organization | Contact | string)[]; + type: string; +} + export interface Valuation { CURRENCY_ISOCODE: string; expiryTime?: Date; @@ -298,6 +314,13 @@ export interface Valuation { [property: string]: any; } +export interface TransactionResult { + status: ('Created' | 'Deleted' | 'Updated' | 'Failed') | string; + type: string; + context?: Context; + message?: string; +} + // Converts JSON strings to/from your types // and asserts the results of JSON.parse at runtime export class Convert { diff --git a/src/context/schemas.json b/src/context/schemas.json index 4310f348d..45f9dfed2 100644 --- a/src/context/schemas.json +++ b/src/context/schemas.json @@ -1,7 +1,10 @@ { + "Action": ["https://fdc3.finos.org/schemas/next/action.schema.json"], "Context": ["https://fdc3.finos.org/schemas/next/context.schema.json"], "Chart": ["https://fdc3.finos.org/schemas/next/chart.schema.json"], "ChatInitSettings": ["https://fdc3.finos.org/schemas/next/chatInitSettings.schema.json"], + "ChatMessage": ["https://fdc3.finos.org/schemas/next/chatMessage.schema.json"], + "ChatRoom": ["https://fdc3.finos.org/schemas/next/chatRoom.schema.json"], "Contact": ["https://fdc3.finos.org/schemas/next/contact.schema.json"], "ContactList": ["https://fdc3.finos.org/schemas/next/contactList.schema.json"], "Country": ["https://fdc3.finos.org/schemas/next/country.schema.json"], @@ -9,10 +12,16 @@ "Email": ["https://fdc3.finos.org/schemas/next/email.schema.json"], "Instrument": ["https://fdc3.finos.org/schemas/next/instrument.schema.json"], "InstrumentList": ["https://fdc3.finos.org/schemas/next/instrumentList.schema.json"], + "Interaction": ["https://fdc3.finos.org/schemas/next/interaction.schema.json"], + "Message": ["https://fdc3.finos.org/schemas/next/message.schema.json"], "Nothing": ["https://fdc3.finos.org/schemas/next/nothing.schema.json"], + "Order": ["https://fdc3.finos.org/schemas/next/order.schema.json"], + "OrderLeg": ["https://fdc3.finos.org/schemas/next/orderLeg.schema.json"], "Organization": ["https://fdc3.finos.org/schemas/next/organization.schema.json"], "Portfolio": ["https://fdc3.finos.org/schemas/next/portfolio.schema.json"], "Position": ["https://fdc3.finos.org/schemas/next/position.schema.json"], + "ChatSearchCriteria": ["https://fdc3.finos.org/schemas/next/chatSearchCriteria.schema.json"], "TimeRange": ["https://fdc3.finos.org/schemas/next/timerange.schema.json"], + "TransactionResult": ["https://fdc3.finos.org/schemas/next/transactionresult.schema.json"], "Valuation": ["https://fdc3.finos.org/schemas/next/valuation.schema.json"] } diff --git a/src/context/schemas/action.schema.json b/src/context/schemas/action.schema.json new file mode 100644 index 000000000..553631232 --- /dev/null +++ b/src/context/schemas/action.schema.json @@ -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" + ] +} diff --git a/src/context/schemas/chatInitSettings.schema.json b/src/context/schemas/chatInitSettings.schema.json index 044068dbd..7f1c5b8c2 100644 --- a/src/context/schemas/chatInitSettings.schema.json +++ b/src/context/schemas/chatInitSettings.schema.json @@ -3,28 +3,34 @@ "$id": "https://fdc3.finos.org/schemas/next/chatInitSettings.schema.json", "type": "object", "title": "ChatInitSettings", + "allOf": [{ "$ref": "context.schema.json#" }], "properties": { - "type": { - "const": "fdc3.chat.initSettings" - }, + "type": { "const": "fdc3.chat.initSettings" }, "chatName": { "type": "string" }, "members": { "$ref": "contactList.schema.json#" }, - "initMessage": { - "type": "string" + "message": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "message.schema.json#" + } + ] }, "options": { - "groupRecipients": "boolean", - "public": "boolean", - "allowHistoryBrowsing": "boolean", - "allowMessageCopy": "boolean", - "allowAddUser": "boolean" + "type": "object", + "properties": { + "groupRecipients": {"type": "boolean"}, + "isPublic": {"type": "boolean"}, + "allowHistoryBrowsing": {"type": "boolean"}, + "allowMessageCopy": {"type": "boolean"}, + "allowAddUser": {"type": "boolean"} + } } - }, - "required": [ - "type" - ] -} \ No newline at end of file + } +} diff --git a/src/context/schemas/chatMessage.schema.json b/src/context/schemas/chatMessage.schema.json new file mode 100644 index 000000000..72171d832 --- /dev/null +++ b/src/context/schemas/chatMessage.schema.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/chatMessage.schema.json", + "type": "object", + "title": "ChatMessage", + "allOf": [{ "$ref": "context.schema.json#" }], + "properties": { + "type": { "const": "fdc3.chat.message" }, + "chatRoom": { "$ref": "chatRoom.schema.json#" }, + "message": { "$ref": "message.schema.json#" } + }, + "required": ["type", "chatRoom", "message"] +} diff --git a/src/context/schemas/chatRoom.schema.json b/src/context/schemas/chatRoom.schema.json new file mode 100644 index 000000000..a5a430a6b --- /dev/null +++ b/src/context/schemas/chatRoom.schema.json @@ -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" }, + "url": { "type": "string" }, + "name": { "type": "string" } + }, + "required": ["providerName", "id"] +} diff --git a/src/context/schemas/chatSearchCriteria.schema.json b/src/context/schemas/chatSearchCriteria.schema.json new file mode 100644 index 000000000..932418859 --- /dev/null +++ b/src/context/schemas/chatSearchCriteria.schema.json @@ -0,0 +1,22 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/chatSearchCriteria.schema.json", + "type": "object", + "title": "ChatSearchCriteria", + "allOf": [{ "$ref": "context.schema.json#" }], + "properties": { + "type": { "const": "fdc3.chat.searchCriteria" }, + "criteria": { + "type": "array", + "items": { + "anyOf": [ + { "$ref":"instrument.schema.json#" }, + { "$ref": "organization.schema.json#" }, + { "$ref": "contact.schema.json#" }, + { "type": "string" } + ] + } + } + }, + "required": ["criteria"] +} diff --git a/src/context/schemas/interaction.schema.json b/src/context/schemas/interaction.schema.json new file mode 100644 index 000000000..ed32dfbc0 --- /dev/null +++ b/src/context/schemas/interaction.schema.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/interaction.schema.json", + "type": "object", + "title": "Interaction", + "allOf": [{ "$ref": "context.schema.json#" }], + "properties": { + "type": { "const": "fdc3.interaction" }, + "participants": { + "$ref": "contactList.schema.json#" + }, + "timeRange": { + "$ref": "timerange.schema.json#" + }, + "interactionType": { + "anyOf": [ + { + "type": "string", + "enum": ["Instant Message", "Email", "Call", "Meeting"] + }, + { + "type": "string" + } + ] + }, + "description": { + "type": "string" + }, + "initiator": { + "$ref": "contact.schema.json#" + }, + "origin": { + "type": "string" + } + }, + "required": ["participants", "timeRange", "interactionType", "description"] +} \ No newline at end of file diff --git a/src/context/schemas/message.schema.json b/src/context/schemas/message.schema.json new file mode 100644 index 000000000..05d44205d --- /dev/null +++ b/src/context/schemas/message.schema.json @@ -0,0 +1,55 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/message.schema.json", + "type": "object", + "title": "Message", + "allOf": [{ "$ref": "context.schema.json#" }], + "properties": { + "type": { "const": "fdc3.message" }, + "text": { + "type": "object", + "properties": { + "text/plain": { + "type": "string" + }, + "text/markdown": { + "type": "string" + } + } + }, + "entities": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "$ref": "action.schema.json#" + }, + { + "type": "object", + "properties": { + "type": { + "const": "fdc3.entity.fileAttachment" + }, + "data": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "dataUri": { + "type": "string" + } + }, + "required": [ + "name", + "dataUri" + ] + } + }, + "required": ["type", "data"] + } + ] + } + } + } +} diff --git a/src/context/schemas/order.schema.json b/src/context/schemas/order.schema.json new file mode 100644 index 000000000..ccbf58ad5 --- /dev/null +++ b/src/context/schemas/order.schema.json @@ -0,0 +1,44 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/order.schema.json", + "type": "object", + "title": "Order", + "allOf": [ + { + "$ref": "context.schema.json#" + } + ], + "properties": { + "type": { + "const": "fdc3.order" + }, + "id": { + "properties": { + "EMS": { + "type": "string" + }, + "OMS": { + "type": "string" + }, + "PMS": { + "type": "string" + } + } + }, + "sendingTime": { + "type": "string" + }, + "timeInForce": { + "$ref": "timerange.schema.json#" + }, + "orderLegs": { + "type": "array", + "items": { + "$ref": "orderLeg.schema.json#" + } + }, + "notes": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/src/context/schemas/orderLeg.schema.json b/src/context/schemas/orderLeg.schema.json new file mode 100644 index 000000000..f4642eba2 --- /dev/null +++ b/src/context/schemas/orderLeg.schema.json @@ -0,0 +1,166 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/orderLeg.schema.json", + "type": "object", + "title": "orderLeg", + "allOf": [ + { + "$ref": "context.schema.json#" + } + ], + "properties": { + "type": { + "const": "fdc3.orderLeg" + }, + "id": { + "properties": { + "EMS": { + "type": "string" + }, + "OMS": { + "type": "string" + }, + "PMS": { + "type": "string" + } + } + }, + "product": { + "type": "object", + "properties": { + "oneof": { + "instrument": { + "$ref": "instrument.schema.json#" + }, + "productDefinition": { + "type": "object" + } + } + } + }, + "quantity": { + "type": "object", + "properties": { + "oneof": { + "units": { + "type": "number" + }, + "cashValue": { + "type": "number" + }, + "proceedsFrom": { + "type": "string" + } + } + } + }, + "currency": { + "$ref": "currency.schema.json#" + }, + "side": { + "type": "string", + "enum": [ + "B", + "S", + "P", + "R", + "BS", + "SS" + ] + }, + "price": { + "type": "object", + "properties": { + "orderType": { + "type": "string", + "enum": [ + "limit", + "market", + "stopMarket", + "stopLimit" + ] + }, + "limitPrice": { + "type": "number" + }, + "stopPrice": { + "type": "number" + }, + "priceType": { + "type": "string", + "enum": [ + "absolute", + "percentage", + "yield", + "spread" + ] + } + }, + "required": [ + "orderType" + ] + }, + "settlement": { + "type": "object", + "properties": { + "currency": { + "$ref": "currency.schema.json#" + }, + "date": { + "type": "string" + } + } + }, + "allocations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "account": { + "type": "string" + }, + "quantity": { + "type": "number" + }, + "positionEffect": { + "type": "string", + "enum": [ + "O", + "C" + ] + } + }, + "required": [ + "account" + ] + } + }, + "partyIdentifiers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "role": { + "type": "string" + }, + "id": { + "type": "object", + "properties": { + "LEI": { + "type": "string" + } + } + } + } + } + } + }, + "required": [ + "type", + "id", + "price", + "side", + "product", + "quantity" + ] +} \ No newline at end of file diff --git a/src/context/schemas/transactionresult.schema.json b/src/context/schemas/transactionresult.schema.json new file mode 100644 index 000000000..a2db6370d --- /dev/null +++ b/src/context/schemas/transactionresult.schema.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/transactionresult.schema.json", + "type": "object", + "title": "TransactionResult", + "allOf": [{ "$ref": "context.schema.json#" }], + "properties": { + "type": { "const": "fdc3.transactionResult" }, + "status": { + "type": "string", + "enum": ["Created", "Deleted", "Updated", "Failed"] + }, + "context": { "$ref": "context.schema.json#" } + }, + "message": { + "type": "string" + }, + "required": ["type", "status"] +} \ No newline at end of file diff --git a/src/intents/Intents.ts b/src/intents/Intents.ts index 09141c0cb..fdf7e297d 100644 --- a/src/intents/Intents.ts +++ b/src/intents/Intents.ts @@ -1,13 +1,17 @@ export enum Intents { + CreateInteraction = 'CreateInteraction', + SendChatMessage = 'SendChatMessage', StartCall = 'StartCall', StartChat = 'StartChat', StartEmail = 'StartEmail', ViewAnalysis = 'ViewAnalysis', + ViewChat = 'ViewChat', ViewChart = 'ViewChart', ViewContact = 'ViewContact', ViewHoldings = 'ViewHoldings', ViewInstrument = 'ViewInstrument', ViewInteractions = 'ViewInteractions', + ViewMessages = 'ViewMessages', ViewNews = 'ViewNews', ViewOrders = 'ViewOrders', ViewProfile = 'ViewProfile', diff --git a/src/intents/standard intents.json b/src/intents/standard intents.json index 8110a5df8..6397ee9a4 100644 --- a/src/intents/standard intents.json +++ b/src/intents/standard intents.json @@ -1,5 +1,9 @@ { "intents": [ + { + "name": "CreateInteraction", + "displayName": "Create Interaction" + }, { "name": "StartCall", "displayName": "Call" diff --git a/website/sidebars.json b/website/sidebars.json index cc3fe6972..f9aae7d5c 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -38,14 +38,18 @@ "label": "Intents Part", "items": [ "intents/spec", + "intents/ref/CreateInteraction", "intents/ref/StartCall", "intents/ref/StartChat", "intents/ref/StartEmail", + "intents/ref/SendChatMessage", "intents/ref/ViewAnalysis", + "intents/ref/ViewChat", "intents/ref/ViewChart", "intents/ref/ViewHoldings", "intents/ref/ViewInstrument", "intents/ref/ViewInteractions", + "intents/ref/ViewMessages", "intents/ref/ViewNews", "intents/ref/ViewOrders", "intents/ref/ViewProfile", @@ -62,6 +66,8 @@ "context/ref/Context", "context/ref/Chart", "context/ref/ChatInitSettings", + "context/ref/ChatMessage", + "context/ref/ChatRoom", "context/ref/Contact", "context/ref/ContactList", "context/ref/Country", @@ -69,11 +75,16 @@ "context/ref/Email", "context/ref/Instrument", "context/ref/InstrumentList", + "context/ref/Interaction", "context/ref/Nothing", + "context/ref/Order", + "context/ref/OrderLeg", "context/ref/Organization", "context/ref/Portfolio", "context/ref/Position", + "context/ref/ChatSearchCriteria", "context/ref/TimeRange", + "context/ref/TransactionResult", "context/ref/Valuation" ] } diff --git a/website/static/schemas/2.0/chatInitSettings.schema.json b/website/static/schemas/2.0/chatInitSettings.schema.json index 093cb4051..c28eac9f9 100644 --- a/website/static/schemas/2.0/chatInitSettings.schema.json +++ b/website/static/schemas/2.0/chatInitSettings.schema.json @@ -17,11 +17,14 @@ "type": "string" }, "options": { - "groupRecipients": "boolean", - "public": "boolean", - "allowHistoryBrowsing": "boolean", - "allowMessageCopy": "boolean", - "allowAddUser": "boolean" + "type": "object", + "properties": { + "groupRecipients": {"type": "boolean"}, + "public": {"type": "boolean"}, + "allowHistoryBrowsing": {"type": "boolean"}, + "allowMessageCopy": {"type": "boolean"}, + "allowAddUser": {"type": "boolean"} + } } }, "required": [ diff --git a/website/static/schemas/next/chatInitSettings.schema.json b/website/static/schemas/next/chatInitSettings.schema.json index 044068dbd..e3498bfc3 100644 --- a/website/static/schemas/next/chatInitSettings.schema.json +++ b/website/static/schemas/next/chatInitSettings.schema.json @@ -17,11 +17,14 @@ "type": "string" }, "options": { - "groupRecipients": "boolean", - "public": "boolean", - "allowHistoryBrowsing": "boolean", - "allowMessageCopy": "boolean", - "allowAddUser": "boolean" + "type": "object", + "properties": { + "groupRecipients": {"type": "boolean"}, + "public": {"type": "boolean"}, + "allowHistoryBrowsing": {"type": "boolean"}, + "allowMessageCopy": {"type": "boolean"}, + "allowAddUser": {"type": "boolean"} + } } }, "required": [ diff --git a/website/static/schemas/next/chatMessage.schema.json b/website/static/schemas/next/chatMessage.schema.json new file mode 100644 index 000000000..72171d832 --- /dev/null +++ b/website/static/schemas/next/chatMessage.schema.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/chatMessage.schema.json", + "type": "object", + "title": "ChatMessage", + "allOf": [{ "$ref": "context.schema.json#" }], + "properties": { + "type": { "const": "fdc3.chat.message" }, + "chatRoom": { "$ref": "chatRoom.schema.json#" }, + "message": { "$ref": "message.schema.json#" } + }, + "required": ["type", "chatRoom", "message"] +} diff --git a/website/static/schemas/next/chatRoom.schema.json b/website/static/schemas/next/chatRoom.schema.json new file mode 100644 index 000000000..a5a430a6b --- /dev/null +++ b/website/static/schemas/next/chatRoom.schema.json @@ -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" }, + "url": { "type": "string" }, + "name": { "type": "string" } + }, + "required": ["providerName", "id"] +} diff --git a/website/static/schemas/next/chatSearchCriteria.schema.json b/website/static/schemas/next/chatSearchCriteria.schema.json new file mode 100644 index 000000000..932418859 --- /dev/null +++ b/website/static/schemas/next/chatSearchCriteria.schema.json @@ -0,0 +1,22 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/chatSearchCriteria.schema.json", + "type": "object", + "title": "ChatSearchCriteria", + "allOf": [{ "$ref": "context.schema.json#" }], + "properties": { + "type": { "const": "fdc3.chat.searchCriteria" }, + "criteria": { + "type": "array", + "items": { + "anyOf": [ + { "$ref":"instrument.schema.json#" }, + { "$ref": "organization.schema.json#" }, + { "$ref": "contact.schema.json#" }, + { "type": "string" } + ] + } + } + }, + "required": ["criteria"] +} diff --git a/website/static/schemas/next/interaction.schema.json b/website/static/schemas/next/interaction.schema.json new file mode 100644 index 000000000..ed32dfbc0 --- /dev/null +++ b/website/static/schemas/next/interaction.schema.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/interaction.schema.json", + "type": "object", + "title": "Interaction", + "allOf": [{ "$ref": "context.schema.json#" }], + "properties": { + "type": { "const": "fdc3.interaction" }, + "participants": { + "$ref": "contactList.schema.json#" + }, + "timeRange": { + "$ref": "timerange.schema.json#" + }, + "interactionType": { + "anyOf": [ + { + "type": "string", + "enum": ["Instant Message", "Email", "Call", "Meeting"] + }, + { + "type": "string" + } + ] + }, + "description": { + "type": "string" + }, + "initiator": { + "$ref": "contact.schema.json#" + }, + "origin": { + "type": "string" + } + }, + "required": ["participants", "timeRange", "interactionType", "description"] +} \ No newline at end of file diff --git a/website/static/schemas/next/order.schema.json b/website/static/schemas/next/order.schema.json new file mode 100644 index 000000000..ccbf58ad5 --- /dev/null +++ b/website/static/schemas/next/order.schema.json @@ -0,0 +1,44 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/order.schema.json", + "type": "object", + "title": "Order", + "allOf": [ + { + "$ref": "context.schema.json#" + } + ], + "properties": { + "type": { + "const": "fdc3.order" + }, + "id": { + "properties": { + "EMS": { + "type": "string" + }, + "OMS": { + "type": "string" + }, + "PMS": { + "type": "string" + } + } + }, + "sendingTime": { + "type": "string" + }, + "timeInForce": { + "$ref": "timerange.schema.json#" + }, + "orderLegs": { + "type": "array", + "items": { + "$ref": "orderLeg.schema.json#" + } + }, + "notes": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/website/static/schemas/next/orderLeg.schema.json b/website/static/schemas/next/orderLeg.schema.json new file mode 100644 index 000000000..f4642eba2 --- /dev/null +++ b/website/static/schemas/next/orderLeg.schema.json @@ -0,0 +1,166 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/orderLeg.schema.json", + "type": "object", + "title": "orderLeg", + "allOf": [ + { + "$ref": "context.schema.json#" + } + ], + "properties": { + "type": { + "const": "fdc3.orderLeg" + }, + "id": { + "properties": { + "EMS": { + "type": "string" + }, + "OMS": { + "type": "string" + }, + "PMS": { + "type": "string" + } + } + }, + "product": { + "type": "object", + "properties": { + "oneof": { + "instrument": { + "$ref": "instrument.schema.json#" + }, + "productDefinition": { + "type": "object" + } + } + } + }, + "quantity": { + "type": "object", + "properties": { + "oneof": { + "units": { + "type": "number" + }, + "cashValue": { + "type": "number" + }, + "proceedsFrom": { + "type": "string" + } + } + } + }, + "currency": { + "$ref": "currency.schema.json#" + }, + "side": { + "type": "string", + "enum": [ + "B", + "S", + "P", + "R", + "BS", + "SS" + ] + }, + "price": { + "type": "object", + "properties": { + "orderType": { + "type": "string", + "enum": [ + "limit", + "market", + "stopMarket", + "stopLimit" + ] + }, + "limitPrice": { + "type": "number" + }, + "stopPrice": { + "type": "number" + }, + "priceType": { + "type": "string", + "enum": [ + "absolute", + "percentage", + "yield", + "spread" + ] + } + }, + "required": [ + "orderType" + ] + }, + "settlement": { + "type": "object", + "properties": { + "currency": { + "$ref": "currency.schema.json#" + }, + "date": { + "type": "string" + } + } + }, + "allocations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "account": { + "type": "string" + }, + "quantity": { + "type": "number" + }, + "positionEffect": { + "type": "string", + "enum": [ + "O", + "C" + ] + } + }, + "required": [ + "account" + ] + } + }, + "partyIdentifiers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "role": { + "type": "string" + }, + "id": { + "type": "object", + "properties": { + "LEI": { + "type": "string" + } + } + } + } + } + } + }, + "required": [ + "type", + "id", + "price", + "side", + "product", + "quantity" + ] +} \ No newline at end of file diff --git a/website/versioned_docs/version-2.0/context/ref/ChatInitSettings.md b/website/versioned_docs/version-2.0/context/ref/ChatInitSettings.md index 9fadecd26..f9d13fba2 100644 --- a/website/versioned_docs/version-2.0/context/ref/ChatInitSettings.md +++ b/website/versioned_docs/version-2.0/context/ref/ChatInitSettings.md @@ -26,7 +26,7 @@ https://fdc3.finos.org/schemas/2.0/chatInitSettings.schema.json | `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.isPublic` | boolean | No | `true`: the room will be visible to everyone in the chat application | | `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 | @@ -58,7 +58,7 @@ const initSettings = { }, options: { groupRecipients: true, // one chat with both contacts - public: false, // private chat room + isPublic: false, // private chat room allowHistoryBrowsing: true, allowMessageCopy: true } diff --git a/website/versioned_docs/version-2.0/intents/ref/StartChat.md b/website/versioned_docs/version-2.0/intents/ref/StartChat.md index 0701de7c2..ba6876dfa 100644 --- a/website/versioned_docs/version-2.0/intents/ref/StartChat.md +++ b/website/versioned_docs/version-2.0/intents/ref/StartChat.md @@ -6,7 +6,7 @@ original_id: StartChat --- # `StartChat` -Initiate a chat with a contact, a list of contacts or detailed initialization settings. +Initiate a chat with a contact, a list of contacts or detailed initialization settings. This could be launched from within another application. For example initiating a chat from a research or OMS application. ## Intent Name @@ -51,7 +51,7 @@ const initSettings = { }, options: { groupRecipients: true, // one chat with both contacts - public: false, // private chat room + isPublic: false, // private chat room allowHistoryBrowsing: true, allowMessageCopy: true, allowAddUser: false, // John won't be authorized to add other users to the chat @@ -60,7 +60,7 @@ const initSettings = { } const resolution = fdc3.raiseIntent('StartChat', initSettings); -const chatRoomRefs = await resolution.getResult(); +const chatRooms = await resolution.getResult(); ``` ## See Also
{
"type": "fdc3.instrument",
"id": {
"ticker": "AAPL"
}
},
{
"type": "fdc3.contact",
"name":"Jane Doe",
"id": {
"email": "jane.doe@mail.com"
}
},
{
"type": "fdc3.organization",
"name":"Symphony",
},
"#OrderID45788422",
]