1.0.19 • Published 6 years ago

@moonthug/trello v1.0.19

Weekly downloads
-
License
ISC
Repository
github
Last release
6 years ago

@moonthug/trello

WARNING

At present, this client relies on a local Redis server running by default

The client interface attempts to map to the Trello API as tightly as possible, providing two methods per API resource.

i.e. Cards

API: GET https://api.trello.com/1/cards/{id}

Client: trello.getCard(id)

API: GET https://api.trello.com/1/cards/{id}/{field}

Client: trello.getCardField(id, field)

Usage

import Trello from '@moonthug/trello';

const trello = new Trello(API_KEY, API_SECRET);

To disable the cache

import Trello from '@moonthug/trello';

const trello = new Trello(API_KEY, API_SECRET, { 
  httpOptions: {
    cache: {
     enabled: false,
   }
  }
});

To configure the cache (see ../packagegs/http-cache)

import Trello from '@moonthug/trello';

const trello = new Trello(API_KEY, API_SECRET, { 
  // Defaults
  httpOptions: {
    cache: {
      // Cache
      enabled: true,
      ns: 'httpcache',
      ttl: 60 * 15,

      // Redis
      port: 6379,
      host: '127.0.0.1',
      db: 0
    }
  }
});

Examples

Get all the boards for a username

const usersBoards = await this.trello.getMemberField('username', 'boards');

Get a card by board ID

const cards = await this.trello.getBoardField(boardId, 'cards');
1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago