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

botmock-api

v1.0.0

Published

Javascript module for interacting with Botmock API

Downloads

6

Readme

Botmock JS Client

=========

A thin client around the botmock API.

Installation

npm install botmock

Getting Started

In order to get started with this client, you'll need to get your access token from https://botmock.com. After you sign in, go to the Account Settings page by clicking on your profile picture on the top right. Then click on API from the left side menu. Give your token a name, and hit Create. Remember to note down your token since it will not be shown after it is generated.

Usage

// Import the botmock js library
const Botmock = require('botmock-js');

// Create a client
const client = new Botmock({
    "api_token": API_TOKEN, // fill in your API_TOKEN instead.
    "debug": false // this flag is optional.
});

In general, the client acts like a thin wrapper around the REST API. You can read about the API here: http://docs.botmock.com/

The client allows easy access to 3 types of resources.

Teams

client.teams(team_id)

Where team_id is optional. If not given, this will return all of the teams.

Example Response:

[
    {
        "id": 38881,
        "name": "First Team",
        "photo": "https://www.gravatar.com/avatar/00f062fb089de61b9a7e8033bc40109a.jpg?s=200&d=identicon",
        "created_at": {
            "date": "2017-01-10 20:45:21.000000",
            "timezone_type": 3,
            "timezone": "UTC"
        }
    },
    {
        "id": 133244,
        "name": "Second team",
        "photo": "https://www.gravatar.com/avatar/1c5a10ff164629b4da3be8ef5f7fe18d.jpg?s=200&d=identicon",
        "created_at": {
            "date": "2017-07-07 19:22:50.000000",
            "timezone_type": 3,
            "timezone": "UTC"
        }
    },
    {
        "id": 183331,
        "name": "Third Team",
        "photo": "https://www.gravatar.com/avatar/7c507a4e30c13b100a7175f494647e83.jpg?s=200&d=identicon",
        "created_at": {
            "date": "2017-08-12 03:38:19.000000",
            "timezone_type": 3,
            "timezone": "UTC"
        }
    }
]

Projects

client.projects(team_id, project_id)

Where team_id is required, and project_id is optional. If project_id is omitted, it will return all of the projects for the given team.

Example Response:

{
    "id": "16f1c520-05c6-11e7-bc31-5554df9b496b",
    "name": "Kindly",
    "created_at": "2017-03-10 19:16:40",
    "updated_at": "2017-09-15 14:15:59",
    "type": "mock",
    "platform": "facebook"
}

Boards

client.boards(team_id, project_id, board_id)

Where team_id, project_id are required, and board_id is optional. If board_id is omitted, it will return all of the boards for the given team and project.

Example Response:

{
    "board": {
        "root_messages": [
            "6af54577-593a-436a-866f-11be95c55b64"
        ],
        "messages": [
            {
                "message_id": "6af54577-593a-436a-866f-11be95c55b64",
                "message_type": "user_reply",
                "next_message_ids": [
                    "c728f3be-218f-40d0-bc83-d92bfca96022"
                ],
                "previous_message_ids": [],
                "is_root": true,
                "payload": {
                    "text": "Search Flights"
                }
            },
            {
                "message_id": "c728f3be-218f-40d0-bc83-d92bfca96022",
                "message_type": "text",
                "next_message_ids": [
                    "e18708cb-2dcf-4545-8c14-7f8c39a7f9f0"
                ],
                "previous_message_ids": [
                    "6af54577-593a-436a-866f-11be95c55b64"
                ],
                "is_root": false,
                "payload": {
                    "text": "Sweet! I love finding people the least agonizing flights! Say something like \"non-stop flight on United from SFO to YOW 10/02 to 10/09\""
                }
            },
            ...
        ]
    },
    "created_at": {
        "date": "2017-09-20 23:47:47.000000",
        "timezone_type": 3,
        "timezone": "UTC"
    },
    "updated_at": {
        "date": "2017-09-20 23:47:47.000000",
        "timezone_type": 3,
        "timezone": "UTC"
    }
}

Tests

npm test

Contributing

👍🎉 First off, thanks for taking the time to contribute! 🎉👍

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Licensing

We adopt ISC.