Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Latest commit

 

History

History
517 lines (360 loc) · 16.9 KB

api.md

File metadata and controls

517 lines (360 loc) · 16.9 KB

Classes

TrelloBoards
TrelloCards
TrelloLists
TrelloOrganizations
TrelloClient

Functions

validateConfig(config)Array.<String>

Validates the configuration object.

TrelloBoards

Kind: global class

new TrelloBoards(trelloClient)

Params

trelloBoards.searchFor(searchTerm)

Kind: instance method of TrelloBoards
Params

  • searchTerm String

trelloBoards.create(data, force) ⇒ Promise.<Array.<{name:String, idOrganization:String, id:String, lists:Array}>>

Create a board if it does not exist.

Kind: instance method of TrelloBoards
Params

  • data object
    • .name String
    • .idOrganization String
    • .lists Array
  • force Boolean - force list creation

trelloBoards.delete(boardId)

TODO: Delete an existing board

Kind: instance method of TrelloBoards
Params

  • boardId string

trelloBoards.clone(fromBoard, toBoard)

TODO: Delete an existing board

Kind: instance method of TrelloBoards
Params

  • fromBoard object
    • [.name] string - This must be set if id is not defined
    • [.id] string - This must be set if name is not defined
  • toBoard object
    • .name String
    • .lists Array

trelloBoards.getById(idBoard)

Get board by ID

Kind: instance method of TrelloBoards
Params

  • idBoard string

trelloBoards.update(board) ⇒ Promise.<*>

This method allow us to update a board definition. If the board id is not present or not valid properties exist to be updated, an error is thrown.

Kind: instance method of TrelloBoards
Params

  • board object - Board object to be updated
    • [.id] string
    • [.name] string

trelloBoards.getLists(idBoards)

Create a board if it does not exist.

Kind: instance method of TrelloBoards
Params

  • idBoards String

trelloBoards.getCustomFields(idBoards)

Get custom fields assigned to a board.

Kind: instance method of TrelloBoards
Params

  • idBoards String

trelloBoards.getByName(idOrganization, boardName)

Get a board by name

Kind: instance method of TrelloBoards
Params

  • idOrganization String
  • boardName String

TrelloCards

Kind: global class

new TrelloCards(trelloClient)

Params

trelloCards.updateCard(idCard, parameters)

Update a card

Kind: instance method of TrelloCards
Params

trelloCards.getCardDetails(idCard, options)

Get a cards details

Kind: instance method of TrelloCards
Params

trelloCards.getCardCustomDataByName(idCard, customFieldName)

Get a custom field on a card by name

Kind: instance method of TrelloCards
Params

  • idCard String
  • customFieldName String

TrelloLists

Kind: global class

new TrelloLists(trelloClient)

Params

trelloLists.create(data, force) ⇒ Promise.<{name:String, idBoard:String, id:String}>

Create a list if it does not exist.

Kind: instance method of TrelloLists
Params

  • data object
    • .name string
    • .idBoard string
    • [.pos] String | Number - The position to place the list, possible values are "top", "bottom", or a positive floating point number
  • force Boolean - force list creation

trelloLists.setPosition(idList, position) ⇒ Promise.<*>

This method sets a list position.

Kind: instance method of TrelloLists
Params

  • idList String - List Id.
  • position String | Number - List Position

trelloLists.getByName(idBoard, listName, allowMultiple) ⇒ PromiseLike.<T>

This method is used to search for a list By name in a Board. The board is identified by a idBoard.

Kind: instance method of TrelloLists
Params

  • idBoard String - Board Identifier
  • listName String - List Name to search for
  • allowMultiple Boolean - If this is set to true, an array of lists will be returned, otherwise only one list will be returned or an error thown if the number of found list !==1

trelloLists.rotateLeft(idBoard, count)

Apply a Rotate Left Operation to all lists inside a board.

Operation:

  +------------------------------------+
  |   +---+---+---+---+---+---+---+    |
  +-- | 1 | 2 | 3 | . | . | . | n | <--+
      +---+---+---+---+---+---+---+

Outcome:

       +---+---+---+---+---+---+---+
       | 2 | 3 | . | . | . | n | 1 |
       +---+---+---+---+---+---+---+

Kind: instance method of TrelloLists
Params

  • idBoard String - Board Identifier
  • count Number - number of items to be rotated

trelloLists.rotateRight(idBoard, count)

Apply a Rotate Right Operation to all lists inside a board.

Operation:

  +------------------------------------+
  |    +---+---+---+---+---+---+---+   |
  +--> | 1 | 2 | 3 | . | . | . | n | --+
       +---+---+---+---+---+---+---+

Outcome:

       +---+---+---+---+---+---+---+
       | n | 1 | 2 | . | . | . |n-1|
       +---+---+---+---+---+---+---+

Kind: instance method of TrelloLists
Params

  • idBoard String - Board Identifier
  • count Number - number of items to be rotated

trelloLists.archiveAllCardsOnList(listId)

Archive all cards on a list

Kind: instance method of TrelloLists
Params

  • listId String

trelloLists.archiveList(listId, options)

Archive a list

Kind: instance method of TrelloLists
Params

  • listId String
  • options Object
    • .archiveCards Boolean - If this is set to true, all cards on the list will be archived before the list is archived

trelloLists.moveList(toBoardId, fromListId, toListName, pos)

Move a list

Kind: instance method of TrelloLists
Params

  • toBoardId String - Board Identifier to move the list to
  • fromListId String - ID of the list to be moved
  • toListName String - New name of the list
  • pos String | Number = bottom - The position to place the list, possible values are "top", "bottom", or a positive floating point number

trelloLists.copyList(toBoardId, fromListId, toListName, pos)

copy a list

Kind: instance method of TrelloLists
Params

  • toBoardId String - Board Identifier to copy the list to
  • fromListId String - ID of the list to be copied
  • toListName String - Name of the cloned list
  • pos String | Number = bottom - The position to place the list, possible values are "top", "bottom", or a positive floating point number

trelloLists.moveCards(toBoardId, listId, toListId)

Move all cards to list

Kind: instance method of TrelloLists
Params

  • toBoardId String - Board Identifier of the board containing the list to move the cards to
  • listId String - ID of the list cards should be move to
  • toListId String - ID of the list to move the cards to

trelloLists.update(list) ⇒ Promise.<*>

This method allow us to update a list definition. If the list id is not present or not valid properties exist to be updated, an error is thrown.

Kind: instance method of TrelloLists
Params

  • list object - List object to be updated
    • [.id] string
    • [.name] string

TrelloOrganizations

Kind: global class

new TrelloOrganizations(trelloClient)

Params

trelloOrganizations.searchFor(searchTerm) ⇒ Promise.<Array.<Object>>

This method allow us to search for an organization given a 'searchTerm' String

Kind: instance method of TrelloOrganizations
Returns: Promise.<Array.<Object>> - Array containing organizations
Params

  • searchTerm String

trelloOrganizations.create(data, force) ⇒ Promise.<*>

This method allow us to create an organization if it doesn't exist or force the creation of it if another organization with the same name already exists. If the organization contains boards, then they are created.

Kind: instance method of TrelloOrganizations
Params

  • data Object
  • force Boolean = false - Force the organization creation even if it already exists another with the same name.

trelloOrganizations.delete(data, deleteBoards) ⇒ Promise.<*>

Deletes an organization and inner structure (boards) if the deleteBoards is set to true. At least the organization id or name must be provided.

Kind: instance method of TrelloOrganizations
Params

  • data Object
  • deleteBoards Boolean = false - When true, deletes all inner boards.

trelloOrganizations.getById(idOrganization) ⇒ Promise.<{*}>

Gets an organization for a given Id

Kind: instance method of TrelloOrganizations
Returns: Promise.<{*}> - Object that describes an organization wrapped inside a promise
Params

  • idOrganization String

TrelloClient

Kind: global class

new TrelloClient(config)

Params

  • config Object
    • .key String
    • .token String
    • .baseUrl String

trelloClient.board ⇒ TrelloBoards

Returns a board object containing all board operations

Kind: instance property of TrelloClient
Lazy:

trelloClient.organization ⇒ TrelloOrganizations

Returns a organization object containing all organization operations

Kind: instance property of TrelloClient
Lazy:

trelloClient.card ⇒ TrelloCards

Returns a card object containing all card operations

Kind: instance property of TrelloClient
Lazy:

trelloClient.list ⇒ TrelloLists

Returns a list object containing all list operations

Kind: instance property of TrelloClient
Lazy:

validateConfig(config) ⇒ Array.<String>

Validates the configuration object.

Kind: global function
Params

  • config Object
    • .key String
    • .token String