Skip to content

Commit

Permalink
Refactor standard intents declaration to use union types instead of e…
Browse files Browse the repository at this point in the history
…nums

Signed-off-by: Andrei Floricel <andrei.floricel@gmail.com>
  • Loading branch information
andreifloricel committed Feb 16, 2024
1 parent f3e8d08 commit b379e4c
Showing 1 changed file with 28 additions and 20 deletions.
48 changes: 28 additions & 20 deletions src/intents/Intents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,31 @@
* SPDX-License-Identifier: Apache-2.0
* Copyright FINOS FDC3 contributors - see NOTICE file
*/
export enum Intents {
CreateInteraction = 'CreateInteraction',
SendChatMessage = 'SendChatMessage',
StartCall = 'StartCall',
StartChat = 'StartChat',
StartEmail = 'StartEmail',
ViewAnalysis = 'ViewAnalysis',
ViewChat = 'ViewChat',
ViewChart = 'ViewChart',
ViewContact = 'ViewContact',
ViewHoldings = 'ViewHoldings',
ViewInstrument = 'ViewInstrument',
ViewInteractions = 'ViewInteractions',
ViewMessages = 'ViewMessages',
ViewNews = 'ViewNews',
ViewOrders = 'ViewOrders',
ViewProfile = 'ViewProfile',
ViewQuote = 'ViewQuote',
ViewResearch = 'ViewResearch',
}

/**
* @see https://fdc3.finos.org/docs/intents/spec#standard-intents
*/
export type StandardIntent =
| 'CreateInteraction'
| 'SendChatMessage'
| 'StartCall'
| 'StartChat'
| 'StartEmail'
| 'ViewAnalysis'
| 'ViewChat'
| 'ViewChart'
| 'ViewContact'
| 'ViewHoldings'
| 'ViewInstrument'
| 'ViewInteractions'
| 'ViewMessages'
| 'ViewNews'
| 'ViewOrders'
| 'ViewProfile'
| 'ViewQuote'
| 'ViewResearch';

/**
* @see https://fdc3.finos.org/docs/intents/spec
*/
export type Intent = StandardIntent | (string & {});

0 comments on commit b379e4c

Please sign in to comment.