Skip to content

Commit

Permalink
Merge branch 'main' into fdc3-for-web
Browse files Browse the repository at this point in the history
  • Loading branch information
kriswest authored Oct 15, 2024
2 parents c94e694 + 93685d9 commit 1a21b02
Show file tree
Hide file tree
Showing 16 changed files with 784 additions and 418 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
* Typescript definitions for getAgent() and related types
* Typescript definitions for Browser Communication Protocol (BCP). These constitute the internal "wire protocol" that the "@finos/fdc3" library uses to communicate with Browser-Resident DAs.
* Typescript definitions for Web Connection Protocol (WCP). These constitute the messages used to establish connectivity between "@finos/fdc3" and a Browser-Resident DA.
* Added support for broadcast actions to the `fdc3.action` context type, allowing an Action to represent the broadcast of a specified context to an app or user channel. ([#1368](https://github.com/finos/FDC3/pull/1368))

### Changed

Expand Down
6 changes: 3 additions & 3 deletions docs/intents/ref/CreateInteraction.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ Create a record documenting an interaction (calls, meetings, etc.) between a lis

## Possible Contexts

* [ContactList](../../context/ref/ContactList)
* [Interaction](../../context/ref/Interaction)
- [ContactList](../../context/ref/ContactList)
- [Interaction](../../context/ref/Interaction)

SHOULD return context as a result:

* [TransactionResult](../../context/ref/TransactionResult)
- [TransactionResult](../../context/ref/TransactionResult)

## Example

Expand Down
69 changes: 69 additions & 0 deletions docs/intents/ref/CreateOrUpdateProfile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
id: CreateOrUpdateProfile
sidebar_label: CreateOrUpdateProfile
title: CreateOrUpdateProfile
hide_title: true
---
# `CreateOrUpdateProfile`

Create a record or update an existing profile record with information for the individual or organization provided as context.

## Intent Name

`CreateOrUpdateProfile`

## Display Name

`Create or Update Profile`

## Possible Contexts

- [Contact](../../context/ref/Contact)
- [Organization](../../context/ref/Organization)

SHOULD return context as a result:

- [TransactionResult](../../context/ref/TransactionResult)

## Example

```js
const organization = {
"type": "fdc3.organization",
"name": "Cargill, Incorporated",
"id": {
"LEI": "QXZYQNMR4JZ5RIRN4T31",
"FDS_ID": "00161G-E"
}
};

const intentResolution = await fdc3.raiseIntent('CreateOrUpdateProfile', organization);
const result = await intentResolution.getResult();
console.log(result);
```

Console log might display:

```js
{
type: 'fdc3.transactionResult',
status: 'Created',
context: {
"type": "fdc3.organization",
"name": "Cargill, Incorporated",
"id": {
"LEI": "QXZYQNMR4JZ5RIRN4T31",
"FDS_ID": "00161G-E",
"internalId": "al983020303a_23"
}
},
message: 'record with id "al983020303a_23" was created'
}
```

## See Also

- [ViewProfile](../../intents/ref/ViewProfile)
- [Contact](../../context/ref/Contact)
- [Organization](../../context/ref/Organisation)
- [TransactionResult](../../context/ref/TransactionResult)
8 changes: 4 additions & 4 deletions docs/intents/ref/SendChatMessage.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Send a message to an existing chat room.

## Possible Contexts

* [ChatMessage](../../context/ref/ChatMessage)
- [ChatMessage](../../context/ref/ChatMessage)

## Example

Expand Down Expand Up @@ -59,6 +59,6 @@ Context
- [ChatRoom](../../context/ref/ChatRoom)

Intents
* [StartChat](StartChat)
* [StartCall](StartCall)
* [StartEmail](StartEmail)
- [StartChat](StartChat)
- [StartCall](StartCall)
- [StartEmail](StartEmail)
20 changes: 10 additions & 10 deletions docs/intents/ref/ViewChat.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ Open an existing chat room.

## 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.
- [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
- 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

Expand Down Expand Up @@ -94,10 +94,10 @@ const chatRoom = intentResolution.getResult(): // A chatRoom will be returned as

Context

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

Intents

* [StartChat](StartChat)
- [StartChat](StartChat)
33 changes: 17 additions & 16 deletions docs/intents/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,22 +158,23 @@ 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)
* [`ViewQuote`](ref/ViewQuote)
* [`ViewResearch`](ref/ViewResearch)
- [`CreateInteraction`](ref/CreateInteraction)
- [`CreateOrUpdateProfile`](ref/CreateOrUpdateProfile)
- [`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)
- [`ViewQuote`](ref/ViewQuote)
- [`ViewResearch`](ref/ViewResearch)

### Deprecated Intents

Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 40 additions & 2 deletions schemas/context/action.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://fdc3.finos.org/schemas/next/context/action.schema.json",
"title": "Action",
"description": "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.\n\nThe 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).\n\nAccepts an optional `app` parameter in order to specify a specific app.",
"description": "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.\n\nThe action may be completed by calling:\n- `fdc3.raiseIntent()` with the specified Intent and Context\n- `fdc3.raiseIntentForContext()` if only a context is specified, (which the Desktop Agent will resolve by presenting the user with a list of available Intents for the Context).\n- `channel.broadcast()` with the specified Context, if the `broadcast` action has been defined.\n\nAccepts an optional `app` parameter in order to specify a specific app.",
"allOf": [{
"type": "object",
"properties": {
"type": { "const": "fdc3.action" },
"action": {
"title": "Action Type",
"description": "The **action** field indicates the type of action:\n- **raiseIntent** : If no action or `raiseIntent` is specified, then `fdc3.raiseIntent` or `fdc3.raiseIntentForContext` will be called with the specified context (and intent if given).\n- **broadcast** : If `broadcast` and a `channelId` are specified then `fdc3.getOrCreateChannel(channelId)` is called to retrieve the channel and broadcast the context to it with `channel.broadcast(context)`. If no `channelId` has been specified, the context should be broadcast to the current channel (`fdc3.broadcast()`)",
"type": "string",
"enum": [
"broadcast",
"raiseIntent"
]
},
"title": {
"title": "Action Title",
"description": "A human readable display name for the action",
Expand All @@ -22,9 +31,14 @@
"description": "A context object with which the action will be performed",
"$ref": "context.schema.json#"
},
"channelId": {
"title": "Channel ID",
"description": "Optional channel on which to broadcast the context. The `channelId` property is ignored unless the `action` is broadcast.",
"type": "string"
},
"app": {
"title": "Action Target App",
"description": "An optional target application identifier that should perform the action",
"description": "An optional target application identifier that should perform the action. The `app` property is ignored unless the action is raiseIntent.",
"$ref": "../api/api.schema.json#/definitions/AppIdentifier"
}
},
Expand All @@ -37,6 +51,7 @@
"examples": [
{
"type": "fdc3.action",
"action": "raiseIntent",
"title": "Click to view Chart",
"intent": "ViewChart",
"context": {
Expand All @@ -60,6 +75,29 @@
"appId": "MyChartViewingApp",
"instanceId": "instance1"
}
},
{
"type": "fdc3.action",
"action": "broadcast",
"channelId": "Channel 1",
"title": "Click to view Chart",
"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"
}
}
]
}
Loading

0 comments on commit 1a21b02

Please sign in to comment.