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

591 - Adding CreateOrUpdateProfile intent #1359

Merged
merged 2 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
2 changes: 2 additions & 0 deletions src/intents/Intents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/
export type StandardIntent =
| 'CreateInteraction'
| 'CreateOrUpdateProfile'
| 'SendChatMessage'
| 'StartCall'
| 'StartChat'
Expand Down Expand Up @@ -38,6 +39,7 @@ export type Intent = StandardIntent | (string & {});
*/
export enum Intents {
CreateInteraction = 'CreateInteraction',
CreateOrUpdateProfile = 'CreateOrUpdateProfile',
SendChatMessage = 'SendChatMessage',
StartCall = 'StartCall',
StartChat = 'StartChat',
Expand Down
1 change: 1 addition & 0 deletions src/intents/standard intents.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"intents": [
"CreateInteraction",
"CreateOrUpdateProfile",
"SendChatMessage",
"StartCall",
"StartChat",
Expand Down
1 change: 1 addition & 0 deletions src/internal/intentConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { exhaustiveStringTuple } from './typeHelpers';

const STANDARD_INTENTS = exhaustiveStringTuple<StandardIntent>()(
'CreateInteraction',
'CreateOrUpdateProfile',
'SendChatMessage',
'StartCall',
'StartChat',
Expand Down
9 changes: 5 additions & 4 deletions website/sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -54,8 +56,7 @@
"intents/ref/ViewOrders",
"intents/ref/ViewProfile",
"intents/ref/ViewQuote",
"intents/ref/ViewResearch",
"intents/ref/ViewContact"
"intents/ref/ViewResearch"
]
},
{
Expand Down