1+ const apiKey = process . env . TRELLO_API_KEY || 'YOUR_API_KEY' ;
2+ const oauthToken = process . env . TRELLO_OAUTH_TOKEN || 'OAUTH_TOKEN' ;
3+
4+ import * as TrelloNodeAPI from 'trello-node-api' ;
5+
6+ const Trello = new TrelloNodeAPI ( ) ;
7+ Trello . setApiKey ( apiKey ) ;
8+ Trello . setOauthToken ( oauthToken ) ;
9+ import { mocha } from 'mocha'
10+ /* tslint:disable:no-string-literal */
11+ describe ( 'Board' , ( ) => {
12+
13+ it ( 'It should create the Board' , async ( ) => {
14+ let data = {
15+ name : 'BOARD_NAME_1' , // REQUIRED
16+ defaultLabels : false ,
17+ defaultLists : false ,
18+ desc : 'Board description.' ,
19+ idOrganization : 'ORGANIZATION_ID' ,
20+ keepFromSource : 'none' ,
21+ powerUps : 'all' ,
22+ prefs_permissionLevel : 'private' ,
23+ prefs_voting : 'disabled' ,
24+ prefs_comments : 'members' ,
25+ prefs_invitations : 'members' ,
26+ prefs_selfJoin : true ,
27+ prefs_cardCovers : true ,
28+ prefs_background : 'blue' ,
29+ prefs_cardAging : 'regular'
30+ } ;
31+ let response = await Trello . board . create ( data ) . catch ( error => {
32+ if ( error ) {
33+ console . log ( 'error ' , error ) ;
34+ return ;
35+ }
36+ } ) ;
37+ console . log ( 'response' , response ) ;
38+ } ) ;
39+
40+ } ) ;
0 commit comments