Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

592 771 context proposal TransactionResult #761

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
9f6294f
add-create-interaction-intent
milindchidrawar Jun 7, 2022
6accbc1
add-create-interaction-intent
milindchidrawar Jun 7, 2022
10f1e44
add-create-interaction-intent
milindchidrawar Jun 7, 2022
d74f407
Interaction context added
pauldyson Jun 8, 2022
6abb14d
update CreateInteraction to use origin instead of source
milindchidrawar Jun 9, 2022
1c37ad0
partial implementation of transaction results
milindchidrawar Jun 22, 2022
2213c26
Example code for TransactionResult
pauldyson Jun 22, 2022
c05af21
complete implementation of transaction result
milindchidrawar Jun 22, 2022
c1a30b8
update transaction result based on feedback
milindchidrawar Jul 6, 2022
003fb7d
resolve alphabetical sorting for create interaction
milindchidrawar Aug 3, 2022
0db3dfa
updated transactionresult schema and context description
milindchidrawar Aug 3, 2022
453f61d
Merge branch 'master' into 592-intent-proposal-create-transaction-result
milindchidrawar Aug 4, 2022
aca7d8b
Merge branch 'finos:master' into 592-intent-proposal-create-transacti…
milindchidrawar Aug 4, 2022
76d57a5
resolve alphabetical sort
milindchidrawar Aug 4, 2022
48f0de0
transaction result context field should be of type Context
milindchidrawar Aug 4, 2022
af6ccfb
update transaction result description
milindchidrawar Aug 4, 2022
b601840
Adjusting definition of TransactionResult
kriswest Sep 1, 2022
5b0ccbf
Adding note about intents that return data and TransactionResult to I…
kriswest Sep 1, 2022
c5fc7cf
Merge pull request #8 from kriswest/592-create-transaction-result-KW-…
milindchidrawar Sep 22, 2022
bc8b160
Merge branch 'finos:master' into 592-intent-proposal-create-transacti…
milindchidrawar Sep 22, 2022
6178a3e
Merge branch 'finos:master' into 592-intent-proposal-create-transacti…
milindchidrawar Oct 18, 2022
3d27bbc
updates to context and intent descriptions and cleanup ContextTypes.ts
milindchidrawar Oct 18, 2022
ff18e75
Merge branch 'finos:master' into 592-intent-proposal-create-transacti…
milindchidrawar Oct 27, 2022
849d350
include an example transactionresult for create interaction with an id
milindchidrawar Oct 27, 2022
d77fc27
Merge branch 'finos:master' into 592-intent-proposal-create-transacti…
milindchidrawar Nov 1, 2022
2799e39
support new id types for interaction
milindchidrawar Nov 1, 2022
f1aec8a
full upper case for sourced id types
milindchidrawar Nov 1, 2022
70e83a8
Update docs/intents/ref/CreateInteraction.md
milindchidrawar Nov 22, 2022
0b898eb
Update docs/context/ref/Interaction.md
milindchidrawar Nov 22, 2022
2054efb
Update docs/context/ref/Interaction.md
milindchidrawar Nov 22, 2022
2b27c99
Update docs/intents/ref/CreateInteraction.md
milindchidrawar Nov 22, 2022
5a2246c
Update docs/context/ref/Interaction.md
milindchidrawar Nov 22, 2022
a7a0631
Update docs/intents/ref/CreateInteraction.md
milindchidrawar Nov 22, 2022
c43c6a0
Update src/context/schemas/interaction.schema.json
milindchidrawar Nov 22, 2022
f34e5fa
Merge branch 'finos:master' into 592-intent-proposal-create-transacti…
milindchidrawar Nov 22, 2022
9d8d14a
added change log item and updated incorrect contacts label. removed l…
milindchidrawar Nov 22, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]

### Added
* 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))


### Changed

Expand Down
1 change: 1 addition & 0 deletions docs/context/ref/Contact.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Other Types
- [ContactList](ContactList)

Intents
- [CreateInteraction](../../intents/ref/CreateInteraction)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR contains the CreateInteraction PR as well (#747)... but as we'll likely considate the PRs as the next step that probably won't matter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just be sure to update this one with any changes to the other ;-)

- [StartChat](../../intents/ref/StartChat)
- [StartCall](../../intents/ref/StartCall)
- [ViewProfile](../../intents/ref/ViewProfile)
Expand Down
1 change: 1 addition & 0 deletions docs/context/ref/ContactList.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Other Types
- [Contact](Contact)

Intents
- [CreateInteraction](../../intents/ref/CreateInteraction)
- [StartChat](../../intents/ref/StartChat)
- [StartCall](../../intents/ref/StartCall)

Expand Down
96 changes: 96 additions & 0 deletions docs/context/ref/Interaction.md
Original file line number Diff line number Diff line change
@@ -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)
milindchidrawar marked this conversation as resolved.
Show resolved Hide resolved
- [TransactionResult](TransactionResult]

Intents
- [CreateInteraction](../../intents/ref/CreateInteraction)
- [ViewInteractions](../../intents/ref/ViewInteractions)
3 changes: 3 additions & 0 deletions docs/context/ref/TimeRange.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,6 @@ const timeRange = {
Other Types

- [Chart](Chart)

Intents
- [CreateInteraction](../../intents/ref/CreateInteraction)
59 changes: 59 additions & 0 deletions docs/context/ref/TransactionResult.md
Original file line number Diff line number Diff line change
@@ -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"
}
```
36 changes: 19 additions & 17 deletions docs/context/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,23 +157,25 @@ 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.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.interaction`](ref/Interaction) ([schema](/schemas/next/interaction.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

Expand Down
126 changes: 126 additions & 0 deletions docs/intents/ref/CreateInteraction.md
Original file line number Diff line number Diff line change
@@ -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)
kriswest marked this conversation as resolved.
Show resolved Hide resolved
* [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)
8 changes: 8 additions & 0 deletions docs/intents/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,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**:
Expand All @@ -137,6 +143,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**:

Expand All @@ -148,6 +155,7 @@ 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)
Expand Down
Loading