From d74f4077e816f72ac2b1645deac62ab6c40e0d1c Mon Sep 17 00:00:00 2001 From: Paul Dyson Date: Wed, 8 Jun 2022 17:54:53 +0100 Subject: [PATCH] Interaction context added --- docs/context/ref/Interaction.md | 87 +++++++++++++++++++++ docs/context/spec.md | 1 + docs/intents/ref/CreateInteraction.md | 4 +- src/context/ContextTypes.ts | 11 +++ src/context/schemas.json | 1 + src/context/schemas/interaction.schema.json | 37 +++++++++ website/sidebars.json | 5 +- 7 files changed, 141 insertions(+), 5 deletions(-) create mode 100644 docs/context/ref/Interaction.md create mode 100644 src/context/schemas/interaction.schema.json diff --git a/docs/context/ref/Interaction.md b/docs/context/ref/Interaction.md new file mode 100644 index 000000000..6ae9d5283 --- /dev/null +++ b/docs/context/ref/Interaction.md @@ -0,0 +1,87 @@ +--- +id: Interaction +sidebar_label: Interaction +title: Interaction +hide_title: true +--- +# `Interaction` + +An interaction is a significant direct exchange of ideas or information between 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. + +Notes: + +- interactionType SHOULD be one of 'Instant Message', 'Email', 'Call', or 'Meeting' although other values can be provided +- origin indicates the application or service that the interaction was created from to aid in tracing the source of the interaction + +## 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` | + +## 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) + +Intents +- [CreateInteraction](../../intents/ref/CreateInteraction) \ No newline at end of file diff --git a/docs/context/spec.md b/docs/context/spec.md index d44d03503..146fa432e 100644 --- a/docs/context/spec.md +++ b/docs/context/spec.md @@ -146,6 +146,7 @@ The following are standard FDC3 context types: - [`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.interaction`](ref/Interaction) ([schema](/schemas/next/interaction.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)) diff --git a/docs/intents/ref/CreateInteraction.md b/docs/intents/ref/CreateInteraction.md index 349334f6b..84d5bd776 100644 --- a/docs/intents/ref/CreateInteraction.md +++ b/docs/intents/ref/CreateInteraction.md @@ -66,6 +66,4 @@ fdc3.raiseIntent('CreateInteraction', interaction) ## See Also Context -- [Contact](../../context/ref/Contact) -- [ContactList](../../context/ref/ContactList) -- [TimeRange](../../context/ref/TimeRange) +- [Interaction](../../context/ref/Interaction) \ No newline at end of file diff --git a/src/context/ContextTypes.ts b/src/context/ContextTypes.ts index 892095e05..fda18cf79 100644 --- a/src/context/ContextTypes.ts +++ b/src/context/ContextTypes.ts @@ -48,6 +48,17 @@ export interface Email { richTextBody?: object; } +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 InstrumentList { instruments: Instrument[]; type: string; diff --git a/src/context/schemas.json b/src/context/schemas.json index d3edd5515..6288341b8 100644 --- a/src/context/schemas.json +++ b/src/context/schemas.json @@ -9,6 +9,7 @@ "Country": ["https://fdc3.finos.org/schemas/next/country.schema.json"], "Currency": ["https://fdc3.finos.org/schemas/next/currency.schema.json"], "Email": ["https://fdc3.finos.org/schemas/next/email.schema.json"], + "Interaction": ["https://fdc3.finos.org/schemas/next/interaction.schema.json"], "Instrument": ["https://fdc3.finos.org/schemas/next/instrument.schema.json"], "InstrumentList": ["https://fdc3.finos.org/schemas/next/instrumentList.schema.json"], "Country": ["https://fdc3.finos.org/schemas/next/country.schema.json"], diff --git a/src/context/schemas/interaction.schema.json b/src/context/schemas/interaction.schema.json new file mode 100644 index 000000000..f0cc2d312 --- /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": ["contacts", "timeRange", "interactionType", "description"] +} \ No newline at end of file diff --git a/website/sidebars.json b/website/sidebars.json index 58fa97dc5..38ac9b792 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -52,8 +52,8 @@ "intents/ref/ViewProfile", "intents/ref/ViewQuote", "intents/ref/ViewResearch", - "intents/ref/ViewContact", - "intents/ref/CreateInteraction" + "intents/ref/CreateInteraction", + "intents/ref/ViewContact" ] }, { @@ -70,6 +70,7 @@ "context/ref/Country", "context/ref/Currency", "context/ref/Email", + "context/ref/Interaction", "context/ref/Instrument", "context/ref/InstrumentList", "context/ref/Nothing",