@@ -4,7 +4,7 @@ import events from "../common/events.mjs";
44export default {
55 ...common ,
66 key : "trello-custom-webhook-events" ,
7- name : "Custom Webhook Events (Instant)" ,
7+ name : "Custom Webhook Events (Instant)" , /* eslint-disable-line pipedream/source-name */
88 description : "Emit new events for activity matching a board, event types, lists and/or cards." ,
99 version : "0.1.0" ,
1010 type : "source" ,
@@ -60,16 +60,8 @@ export default {
6060 } ,
6161 methods : {
6262 ...common . methods ,
63- getCardList ( {
64- cardId, ...args
65- } = { } ) {
66- return this . app . _makeRequest ( {
67- path : `/cards/${ cardId } /list` ,
68- ...args ,
69- } ) ;
70- } ,
7163 async getSampleEvents ( ) {
72- const eventTypes = this . eventTypes && this . eventTypes . length > 0
64+ const eventTypes = this . eventTypes ? .length > 0
7365 ? this . eventTypes . join ( "," )
7466 : null ;
7567 const actions = await this . app . getBoardActivity ( {
@@ -87,8 +79,7 @@ export default {
8779 const eventType = event . body ?. action ?. type ;
8880 return (
8981 ( eventType ) &&
90- ( ! this . eventTypes ||
91- this . eventTypes . length === 0 ||
82+ ( ! this . eventTypes ?. length ||
9283 this . eventTypes . includes ( eventType ) )
9384 ) ;
9485 } ,
@@ -106,22 +97,21 @@ export default {
10697 listId = res . id ;
10798 }
10899 return (
109- ( ! this . lists ||
110- this . lists . length === 0 ||
100+ ( ! this . lists ?. length ||
111101 ! listId ||
112102 this . lists . includes ( listId ) ) &&
113- ( ! this . cards || this . cards . length === 0 || ! cardId || this . cards . includes ( cardId ) )
103+ ( ! this . cards ?. length || ! cardId || this . cards . includes ( cardId ) )
114104 ) ;
115105 } ,
116106 generateMeta ( { action } ) {
117107 const {
118108 id,
119- type : summary ,
109+ type,
120110 date,
121111 } = action ;
122112 return {
123113 id,
124- summary,
114+ summary : `New ${ type } event` ,
125115 ts : Date . parse ( date ) ,
126116 } ;
127117 } ,
0 commit comments