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 = {
88 badges : {
99 attachments : number
1010 }
11+ customFieldItems ?: CustomFieldItem [ ]
1112 attachments ?: Attachment [ ]
1213}
1314
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+
1430export type Attachment = {
1531 id : string
1632 bytes : number
@@ -59,7 +75,8 @@ export const trelloApi = ({
5975 options ,
6076 )
6177
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 ( ) )
6380
6481 const del = ( args : { res : string } ) =>
6582 f ( {
@@ -75,7 +92,12 @@ export const trelloApi = ({
7592 return {
7693 lists : {
7794 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 [ ] > ,
79101 } ,
80102 tokens : {
81103 token : ( { token } : { token : string } ) => ( {
You can’t perform that action at this time.
0 commit comments