File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,32 @@ export type IntegrationEntity = {
4
4
source : string ;
5
5
} ;
6
6
7
- export type LabeledIntegrationEntity = IntegrationEntity & {
7
+ export type LabeledIntegrationEntity <
8
+ T extends IntegrationEntityType | unknown = unknown ,
9
+ > = {
10
+ id : string ;
11
+ type : T ;
12
+ source : string ;
8
13
label : string ;
14
+ additionalProperties ?: T extends keyof AdditionalProperties
15
+ ? AdditionalProperties [ T ]
16
+ : unknown ;
17
+ } ;
18
+
19
+ type AdditionalProperties = {
20
+ [ IntegrationEntityType . DEALS ] : {
21
+ isOpen ?: boolean ;
22
+ } ;
23
+ [ IntegrationEntityType . CONTACTS ] ?: never ;
24
+ [ IntegrationEntityType . COMPANIES ] ?: never ;
25
+ [ IntegrationEntityType . TICKETS ] ?: never ;
26
+ [ IntegrationEntityType . LEADS ] ?: never ;
27
+ [ IntegrationEntityType . ACCOUNTS ] ?: never ;
28
+ [ IntegrationEntityType . OPPORTUNITIES ] ?: never ;
29
+ [ IntegrationEntityType . CASES ] ?: never ;
30
+ [ IntegrationEntityType . CONTACTS_FOLDER ] ?: never ;
31
+ [ IntegrationEntityType . USERS ] ?: never ;
32
+ [ IntegrationEntityType . TASKS ] ?: never ;
9
33
} ;
10
34
11
35
export type LoggedIntegrationEntity = IntegrationEntity & {
You can’t perform that action at this time.
0 commit comments