File tree Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,25 @@ export type Card = {
8
8
badges : {
9
9
attachments : number
10
10
}
11
+ customFieldItems ?: CustomFieldItem [ ]
11
12
attachments ?: Attachment [ ]
12
13
}
13
14
15
+ // https://developers.trello.com/docs/getting-started-custom-fields#section-custom-field-values-on-cards
16
+ export type CustomFieldItem = {
17
+ id : string
18
+ value : {
19
+ text ?: string
20
+ number ?: string
21
+ date ?: string
22
+ checked ?: 'true'
23
+ list ?: string [ ]
24
+ }
25
+ idCustomField : string
26
+ idModel : string
27
+ modelType : 'card' | 'board'
28
+ }
29
+
14
30
export type Attachment = {
15
31
id : string
16
32
bytes : number
@@ -59,7 +75,8 @@ export const trelloApi = ({
59
75
options ,
60
76
)
61
77
62
- const query = ( args : { res : string } ) => f ( args ) . then ( res => res . json ( ) )
78
+ const query = ( args : { res : string ; query ?: { [ key : string ] : any } } ) =>
79
+ f ( args ) . then ( res => res . json ( ) )
63
80
64
81
const del = ( args : { res : string } ) =>
65
82
f ( {
@@ -75,7 +92,12 @@ export const trelloApi = ({
75
92
return {
76
93
lists : {
77
94
cards : ( { list } : { list : string } ) =>
78
- query ( { res : `lists/${ list } /cards` } ) as Promise < Card [ ] > ,
95
+ query ( {
96
+ res : `lists/${ list } /cards` ,
97
+ query : {
98
+ customFieldItems : true ,
99
+ } ,
100
+ } ) as Promise < Card [ ] > ,
79
101
} ,
80
102
tokens : {
81
103
token : ( { token } : { token : string } ) => ( {
You can’t perform that action at this time.
0 commit comments