Skip to content

Commit b379e4c

Browse files
Refactor standard intents declaration to use union types instead of enums
Signed-off-by: Andrei Floricel <andrei.floricel@gmail.com>
1 parent f3e8d08 commit b379e4c

1 file changed

Lines changed: 28 additions & 20 deletions

File tree

src/intents/Intents.ts

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,31 @@
22
* SPDX-License-Identifier: Apache-2.0
33
* Copyright FINOS FDC3 contributors - see NOTICE file
44
*/
5-
export enum Intents {
6-
CreateInteraction = 'CreateInteraction',
7-
SendChatMessage = 'SendChatMessage',
8-
StartCall = 'StartCall',
9-
StartChat = 'StartChat',
10-
StartEmail = 'StartEmail',
11-
ViewAnalysis = 'ViewAnalysis',
12-
ViewChat = 'ViewChat',
13-
ViewChart = 'ViewChart',
14-
ViewContact = 'ViewContact',
15-
ViewHoldings = 'ViewHoldings',
16-
ViewInstrument = 'ViewInstrument',
17-
ViewInteractions = 'ViewInteractions',
18-
ViewMessages = 'ViewMessages',
19-
ViewNews = 'ViewNews',
20-
ViewOrders = 'ViewOrders',
21-
ViewProfile = 'ViewProfile',
22-
ViewQuote = 'ViewQuote',
23-
ViewResearch = 'ViewResearch',
24-
}
5+
6+
/**
7+
* @see https://fdc3.finos.org/docs/intents/spec#standard-intents
8+
*/
9+
export type StandardIntent =
10+
| 'CreateInteraction'
11+
| 'SendChatMessage'
12+
| 'StartCall'
13+
| 'StartChat'
14+
| 'StartEmail'
15+
| 'ViewAnalysis'
16+
| 'ViewChat'
17+
| 'ViewChart'
18+
| 'ViewContact'
19+
| 'ViewHoldings'
20+
| 'ViewInstrument'
21+
| 'ViewInteractions'
22+
| 'ViewMessages'
23+
| 'ViewNews'
24+
| 'ViewOrders'
25+
| 'ViewProfile'
26+
| 'ViewQuote'
27+
| 'ViewResearch';
28+
29+
/**
30+
* @see https://fdc3.finos.org/docs/intents/spec
31+
*/
32+
export type Intent = StandardIntent | (string & {});

0 commit comments

Comments
 (0)