npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

reshuffle-teamwork-connectors

v0.0.2

Published

A Reshuffle Teamwork connectors

Downloads

4

Readme

reshuffle-teamwork-connectors

Code | npm |

npm install reshuffle-teamwork-connectors

Reshuffle Teamwork Connector

This package contains a Reshuffle connector to connect Teamwork Online app APIs.

The following example exposes an endpoint to return the data of a Task after an Update action.

const { Reshuffle } = require('reshuffle')
const { TeamworkConnector } = require('reshuffle-teamwork-connectors')

const app = new Reshuffle()

const connector = new TeamworkConnector(app,  {
  apiKey: YOUR_API_KEY,
  subdomain: YOUR_SUB_DOMAIN,
  webhookPath: '/webhooks/teamwork'
})

connector.on({ type: 'TASK.UPDATED' }, async (event, app) => {
  console.log('Task updated on Teamwork YOUR_SUB_DOMAIN')
  console.log(event.eventCreator.id)
  console.log(event.taskList.name)
  console.log(event.task)
})

app.start()

Table of Contents

Configuration Options

Connector Events

Listening to Teamwork events

Connector Actions

SDK - Retrieve a full Teamwork sdk object

Configuration options

const app = new Reshuffle()
const connector = new TeamworkConnector(app, {
  apiKey: YOUR_API_KEY, 
  subdomain: YOUR_SUB_DOMAIN, 
  webhookPath: WEBHOOK_PATH 
})
  • apiKey - How to find the API key
  • subdomain - https://[subdomain].teamwork.com/
  • webhookPath - The path component of the Webhook Endpoint URI for this project. The default value is '/webhooks/teamwork'.

More details about the fields are described in teamwork-api

You can use the webhookPath to configure the url that Teamwork hits when it makes its calls to Reshuffle. For example - having the Reshuffle runtime URL https://my-reshuffle.com and webhookPath=/webhook will result in a complete webhook path of https://my-reshuffle.com/webhook. If you do not provide a webhookPath, Reshuffle will use the default webhook path for the connector which is /webhooks/teamwork. You will need to register this webhook with Teamwork. See instructions.

Events

Listening to Teamwork events

To listen to events happening in Teamwork, you'll need to capture them with the connector's on function, providing a TeamworkConnectorEventOptions to it.

interface TeamworkConnectorEventOptions {
  type: TeamworkEventType // See bellow 
}

// Where...
type TeamworkEventType =
  | 'CALENDAREVENT.CREATED'
  | 'CALENDAREVENT.DELETED'
  | 'CALENDAREVENT.REMINDER'
  | 'CALENDAREVENT.UPDATED'
  | 'CARD.CREATED'
  | 'CARD.DELETED'
  | 'CARD.UPDATED'
  | 'COLUMN.CREATED'
  | 'COLUMN.DELETED'
  | 'COLUMN.UPDATED'
  | 'COMMENT.CREATED'
  | 'COMMENT.DELETED'
  | 'COMMENT.UPDATED'
  | 'COMPANY.CREATED'
  | 'COMPANY.DELETED'
  | 'COMPANY.UPDATED'
  | 'EXPENSE.CREATED'
  | 'EXPENSE.DELETED'
  | 'EXPENSE.UPDATED'
  | 'FILE.CREATED'
  | 'FILE.DELETED'
  | 'FILE.DOWNLOADED'
  | 'FILE.TAGGED'
  | 'FILE.UNTAGGED'
  | 'FILE.UPDATED'
  | 'INVOICE.COMPLETED'
  | 'INVOICE.CREATED'
  | 'INVOICE.DELETED'
  | 'INVOICE.REOPENED'
  | 'INVOICE.UPDATED'
  | 'LINK.CREATED'
  | 'LINK.DELETED'
  | 'LINK.TAGGED'
  | 'LINK.UNTAGGED'
  | 'LINK.UPDATED'
  | 'MESSAGE.CREATED'
  | 'MESSAGE.DELETED'
  | 'MESSAGE.TAGGED'
  | 'MESSAGE.UNTAGGED'
  | 'MESSAGE.UPDATED'
  | 'MESSAGEREPLY.CREATED'
  | 'MESSAGEREPLY.DELETED'
  | 'MESSAGEREPLY.UPDATED'
  | 'MILESTONE.COMPLETED'
  | 'MILESTONE.CREATED'
  | 'MILESTONE.DELETED'
  | 'MILESTONE.REMINDER'
  | 'MILESTONE.REOPENED'
  | 'MILESTONE.TAGGED'
  | 'MILESTONE.UNTAGGED'
  | 'MILESTONE.UPDATED'
  | 'NOTEBOOK.CREATED'
  | 'NOTEBOOK.DELETED'
  | 'NOTEBOOK.TAGGED'
  | 'NOTEBOOK.UNTAGGED'
  | 'NOTEBOOK.UPDATED'
  | 'PORTFOLIOBOARD.CREATED'
  | 'PORTFOLIOBOARD.DELETED'
  | 'PORTFOLIOBOARD.UPDATED'
  | 'PORTFOLIOCARD.CREATED'
  | 'PORTFOLIOCARD.DELETED'
  | 'PORTFOLIOCARD.MOVED'
  | 'PORTFOLIOCARD.REOPENED'
  | 'PORTFOLIOCARD.UPDATED'
  | 'PORTFOLIOCOLUMN.CREATED'
  | 'PORTFOLIOCOLUMN.DELETED'
  | 'PORTFOLIOCOLUMN.UPDATED'
  | 'PROJECT.ARCHIVED'
  | 'PROJECT.COMPLETED'
  | 'PROJECT.COPIED'
  | 'PROJECT.CREATED'
  | 'PROJECT.DELETED'
  | 'PROJECT.REOPENED'
  | 'PROJECT.TAGGED'
  | 'PROJECT.UNTAGGED'
  | 'PROJECT.UPDATED'
  | 'PROJECTUPDATE.CREATED'
  | 'PROJECTUPDATE.DELETED'
  | 'PROJECTUPDATE.UPDATED'
  | 'RISK.CREATED'
  | 'RISK.DELETED'
  | 'RISK.UPDATED'
  | 'ROLE.CREATED'
  | 'ROLE.DELETED'
  | 'ROLE.UPDATED'
  | 'STATUS.CREATED'
  | 'STATUS.DELETED'
  | 'STATUS.UPDATED'
  | 'TASK.COMPLETED'
  | 'TASK.CREATED'
  | 'TASK.DELETED'
  | 'TASK.MOVED'
  | 'TASK.REMINDER'
  | 'TASK.REOPENED'
  | 'TASK.TAGGED'
  | 'TASK.UNTAGGED'
  | 'TASK.UPDATED'
  | 'TASKLIST.COMPLETED'
  | 'TASKLIST.CREATED'
  | 'TASKLIST.CREATEDFROMTEMPLATE'
  | 'TASKLIST.DELETED'
  | 'TASKLIST.REOPENED'
  | 'TASKLIST.UPDATED'
  | 'TIME.CREATED'
  | 'TIME.DELETED'
  | 'TIME.TAGGED'
  | 'TIME.UNTAGGED'
  | 'TIME.UPDATED'
  | 'USER.CREATED'
  | 'USER.DELETED'
  | 'USER.UPDATED'

Events require that an integration webhook is configured in Teamwork.

The connector triggers events of many types, you can get more details about them here

Example:

connector.on({ type: 'TASK.UPDATED' }, async (event, app) => {
  console.log('Task updated on Teamwork YOUR_SUB_DOMAIN')
  console.log(event.eventCreator.id)
  console.log(event.taskList.name)
  console.log(event.task)
})

The description of fields and events can be found here

Actions

The actions are provided via the sdk.

sdk

Returns an object providing full access to the Teamwork APIs. Full list of available actions, requests and responses can be found here

const sdk = await connector.sdk()

Example:

const sdk = await connector.sdk()
const taskLists = await sdk.tasklist.get()
console.log('Tasklists:', JSON.stringify(taskLists))
const task = await sdk.tasks.get({}, YOUR_TASK_ID))
console.log('Task YOUR_TASK_ID:', JSON.stringify(task))