diff --git a/docs/intents/ref/CreateInteraction.md b/docs/intents/ref/CreateInteraction.md index 041b663a4..342ef9029 100644 --- a/docs/intents/ref/CreateInteraction.md +++ b/docs/intents/ref/CreateInteraction.md @@ -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 diff --git a/docs/intents/ref/CreateOrUpdateProfile.md b/docs/intents/ref/CreateOrUpdateProfile.md new file mode 100644 index 000000000..1328c8202 --- /dev/null +++ b/docs/intents/ref/CreateOrUpdateProfile.md @@ -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) \ No newline at end of file diff --git a/docs/intents/ref/SendChatMessage.md b/docs/intents/ref/SendChatMessage.md index 154a6037c..fcfd331ad 100644 --- a/docs/intents/ref/SendChatMessage.md +++ b/docs/intents/ref/SendChatMessage.md @@ -18,7 +18,7 @@ Send a message to an existing chat room. ## Possible Contexts -* [ChatMessage](../../context/ref/ChatMessage) +- [ChatMessage](../../context/ref/ChatMessage) ## Example @@ -59,6 +59,6 @@ Context - [ChatRoom](../../context/ref/ChatRoom) Intents -* [StartChat](StartChat) -* [StartCall](StartCall) -* [StartEmail](StartEmail) +- [StartChat](StartChat) +- [StartCall](StartCall) +- [StartEmail](StartEmail) diff --git a/docs/intents/ref/ViewChat.md b/docs/intents/ref/ViewChat.md index 4a6973bd6..b393cc664 100644 --- a/docs/intents/ref/ViewChat.md +++ b/docs/intents/ref/ViewChat.md @@ -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 @@ -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) \ No newline at end of file +- [StartChat](StartChat) \ No newline at end of file diff --git a/docs/intents/spec.md b/docs/intents/spec.md index 5ca6e0025..f2979778a 100644 --- a/docs/intents/spec.md +++ b/docs/intents/spec.md @@ -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 diff --git a/src/intents/Intents.ts b/src/intents/Intents.ts index 8e15e1002..281ec2ebc 100644 --- a/src/intents/Intents.ts +++ b/src/intents/Intents.ts @@ -8,6 +8,7 @@ */ export type StandardIntent = | 'CreateInteraction' + | 'CreateOrUpdateProfile' | 'SendChatMessage' | 'StartCall' | 'StartChat' @@ -38,6 +39,7 @@ export type Intent = StandardIntent | (string & {}); */ export enum Intents { CreateInteraction = 'CreateInteraction', + CreateOrUpdateProfile = 'CreateOrUpdateProfile', SendChatMessage = 'SendChatMessage', StartCall = 'StartCall', StartChat = 'StartChat', diff --git a/src/intents/standard intents.json b/src/intents/standard intents.json index c670f3a7e..3f2c07144 100644 --- a/src/intents/standard intents.json +++ b/src/intents/standard intents.json @@ -1,6 +1,7 @@ { "intents": [ "CreateInteraction", + "CreateOrUpdateProfile", "SendChatMessage", "StartCall", "StartChat", diff --git a/src/internal/intentConfiguration.ts b/src/internal/intentConfiguration.ts index 1e94c0173..35ee8da4a 100644 --- a/src/internal/intentConfiguration.ts +++ b/src/internal/intentConfiguration.ts @@ -3,6 +3,7 @@ import { exhaustiveStringTuple } from './typeHelpers'; const STANDARD_INTENTS = exhaustiveStringTuple()( 'CreateInteraction', + 'CreateOrUpdateProfile', 'SendChatMessage', 'StartCall', 'StartChat', diff --git a/website/sidebars.json b/website/sidebars.json index e21d1cdb0..9f3e0d1c6 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -39,13 +39,15 @@ "items": [ "intents/spec", "intents/ref/CreateInteraction", + "intents/ref/CreateOrUpdateProfile", + "intents/ref/SendChatMessage", "intents/ref/StartCall", "intents/ref/StartChat", "intents/ref/StartEmail", - "intents/ref/SendChatMessage", "intents/ref/ViewAnalysis", - "intents/ref/ViewChat", "intents/ref/ViewChart", + "intents/ref/ViewChat", + "intents/ref/ViewContact", "intents/ref/ViewHoldings", "intents/ref/ViewInstrument", "intents/ref/ViewInteractions", @@ -54,8 +56,7 @@ "intents/ref/ViewOrders", "intents/ref/ViewProfile", "intents/ref/ViewQuote", - "intents/ref/ViewResearch", - "intents/ref/ViewContact" + "intents/ref/ViewResearch" ] }, {