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

rock.so-sdk

v1.0.10

Published

## BASIC USAGE

Downloads

13

Readme

ROCK.SO API SDK

BASIC USAGE

import { RockAPi } from 'rock.so-sdk'

const rockApi = new RockApi(process.env.ROCK_BOT_TOKEN)

rockApi.sendMessage('Hello!')

This SDK is highly typed, with all methods from Rock.so Public Api being mapped and exported!

METHODS

All methods available on Rock.so Public Api are available on the SDK, i.e.:

| Method | Description | | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | sendMessage | The sendMessage method allows you to send a new message. | | createNote | Create note. | | createTask | Create a new task. | | getBotInfo | Allows you to retrieve basic information about the public API bot. | | getCustomFields | Allows you to retrieve information about custom fields defined for the tasks in bot’s space. | | getTaskLists | Allows you to retrieve information about tasks lists defined in the bot’s space. | | listLabels | The listLabels method can be used to retrieve the list of labels assigned to tasks. Note that labels are created and deleted "on the fly"; when there are no more tasks with a given label (either the label was removed from all tasks, or all tasks with the label were deleted), that label is deleted. | | listSpaceMembers | The listSpaceMembers method can be used to retrieve a list of space members, including both people and bots. | | listSprints | The listSprints method can be used to retrieve a list of sprints defined in the space. |

USING ALL METHODS

Send Message

await rockApi.sendMessage('Hello')

Create note

await rockApi.createNote({
  body: [{ text: "hello world" }],
  labels: ["label"], //Optional
  watchersIds: ["abcd123"], //Optional
});

Create a task

import { ListIdStatusEnum, PriorityEnum } from "rock.so-sdk";

await rockApi.createTask({
  body: [{ text: "hello world" }],
  listId: ListIdStatusEnum.TO_DO,
  priority: PriorityEnum.HIGH,
  title: "hello world",
  start: 123456789, //Optional
  due: 123456789, //Optional
  owners: ["abcd123"], //Optional
  checkList: ["abcd123"], //Optional
  severity: 1, //Optional
  sprint: 1, //Optional
  customFields: ["abcd123"], //Optional
  labels: ["abcd123"], //Optional
  recurringSchedule: { //Optional
    dayOfMonth: 1,
    daysOfWeek: {
      monday: true,
      tuesday: true,
      wednesday: true,
      thursday: true,
      friday: true,
      saturday: true,
      sunday: true,
    },
    targetListId: "abcd123",
    type: 1,
    workdaysOnly: true,
  },
  watchersIds: ["abcd123"], //Optional,
});

Get Bot Info

const { data } = await rockApi.getBotInfo();

Get Custom Fields

const { data } = await rockApi.getCustomFields();

Get Task Lists

const { data } = await rockApi.getTaskLists();

List Labels

const { data } = await rockApi.listLabels();

List Space Members

const { data } = await rockApi.listSpaceMembers();

List Sprints

const { data } = await rockApi.listSprints();