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

retablejs

v1.0.0

Published

Retable API Client for Node

Downloads

1

Readme

ℹ️ Introduction

Official Node client for Retable API v1.

Note
For the API documentation, please visit API Document.

🚧Development Guide

To clone and run this application, you'll need Git and Node.js (which comes with npm) installed on your computer.

For building the package, from your command line:

# Clone this repository
$ git clone https://github.com/retable-io/retablejs
# Go into the repository
$ cd retablejs
# Install dependencies
$ npm install
# Build the package
$ npm run build

For testing, from your command line:

# Go into the repository
$ cd retablejs
# Run the test script
$ npm run test

💾Installation

npm install retablejs

⚡Client Usage

  • Authorization

    Warning
    Your API requests are authenticated using API keys. Any request that doesn't include an API key will return an error. You can generate an API Key from your User page at any time on Retable.io. This generated API Key is constant, when it is generated it never changes or is deleted. Though you can change its usable state on the same page. After obtaining your API Key (starts with RTBL-v1 prefix) you have to provide an apiKey header to every request. Otherwise, you will get an Unauthorized error.

    // CommonJS Import
    const Retable = require('retable');
    
    // ES6 Import
    // Using TypeScript? Pass `esModuleInterop` in tsconfig.json
    import Retable from 'retable';
    
    const client = new Retable({
        apiKey: "RTBLv1-xxxxxxxxxxxxxxxxxxx"
    });
  • Error Handling

    client.getWorkspace(workspace_id: string).then((p) => {
        // Do something
    }).catch(err => {
        err.detail; // Error detail
        err.status; // Error status code
    });
  • Function Detail

    Workspace

    | Function | Description |
    | :--------------------- | :---------------------------------------------------------------------------------- |
    | getWorkspace | Get a specific Workspace and its Projects | | getAllWorkspaces | Get user's all Workspaces | | createWorkspace | Create a new Workspace with a default Project | | deleteWorkspace | Delete a specific Workspace | | getWorkspaceProjects | Get all Projects that belong to a specific Workspace |

    Project

    | Function | Description |
    | :--------------------- | :--------------------------------------------------------------------------------------- |
    | createProject | Create a Project under the given Workspace with a default Retable |
    | getProject | Get a specific Project with Retables | | deleteProject | Delete a specific Project | | getProjectTables | Get all Retables that belong to a specific Project |

    Table

    | Function | Description |
    | :--------------------- | :----------------------------------------------------------------- |
    | createTable | Create a new Retable under a specific Project |
    | getTable | Get information about a specific Retable | | deleteColumn | Delete column from a specific Retable | | addColumn | Create a new column on the specific Retable | | getRow | Returns data of a specific Retable | | insertRow | Insert row to a specific Retable | | updateRow | Update row of a specific Retable | | deleteRow | Delete row from a specific Retable |

    Get a Workspace

    GET https://api.retable.io/v1/public/workspace/{workspace_id}

    client.getWorkspace(workspace_id: string).then(res => {
        res.data // workspace data object
    });

    Get All Workspaces

    GET https://api.retable.io/v1/public/workspace

    client.getAllWorkspaces().then(res => {
      res.data // workspace data object
    });

    Create a Workspace

    POST https://api.retable.io/v1/public/workspace

    client.createWorkspace(
      {
        name: 'string',
        description: 'string'
      }).then(res => {
      res.data // workspace data object
    });

    Delete a Workspace

    DELETE https://api.retable.io/v1/public/workspace/{workspace_id}

    client.deleteWorkspace(workspace_id: string).then(res => {
      res.data // workspace data object
    });

    Get Workspace's Projects

    GET https://api.retable.io/v1/public/workspace/{workspace_id}/project

    client.getWorkspaceProjects(workspace_id: string).then(res => {
     res.data // workspace data object
    });

    Create a Project

    POST https://api.retable.io/v1/public/workspace/{workspace_id}/project

    client.createProject(workspace_id: string,  {
        name: 'string',
        description: 'string',
        color: 'string';
      }).then(res => {
      res.data // project data object
    });

    Get a Project

    GET https://api.retable.io/v1/public/project/{project_id}

    client.getProject(project_id: string).then(res => {
      res.data // project data object
    });

    Delete a Project

    DELETE https://api.retable.io/v1/project/{project_id}

    client.deleteProject(project_id: string).then(res => {
      res.data //project data object
    });

    Get Project's Tables

    GET https://api.retable.io/v1/public/project/{project_id}/retable

    client.getProjectTables(project_id: string).then(res => {
      res.data // project data object
    });

    Create a Table

    POST https://api.retable.io/v1/public/project/{project_id}/retable

    client.createTable(project_id: string).then(res => {
       res.data // retable data object
    });

    Get a Table

    GET https://api.retable.io/v1/public/retable/{retable_id}

    client.getTable(retable_id: string).then(res => {
      res.data // retable data object
    });

    Delete Column

    DELETE https://api.retable.io/v1/public/retable/{retable_id}/column

    client.deleteColumn(retable_id: string,{
        column_ids: [
            "<column_id>",
            "<column_id>"
        ]
    }).then(res => {
      res.data // column data array
    });

    Add Column

    POST https://api.retable.io/v1/public/retable/{retable_id}/column

    client.addColumn(retable_id: string,{
        columns: [
            {
                title: "hello",
                type: "text"
            }
        ]
    }).then(res => {
      res.data // column data array
    });

    Get Row

    GET https://api.retable.io/v1/public/retable/{retable_id}/data

    client.getRow(retable_id: string).then(res => {
       res.data // row data object
    });

    Insert Row

    POST https://api.retable.io/v1/public/retable/{retable_id}/data

    client.insertRow(retable_id: string,{
        data: [
            {
                columns: [
                    {
                        column_id: "Bvt1FQhTyAPjmDx",
                        cell_value: "Isengard"
                    }
                ]
            },
            {
                columns: [
                    { 
                        column_id: "Bvt1FQhTyAPjmDx",
                        cell_value: "Rivendell"
                    }
                ]
            }
        ]
    }).then(res => {
      res.data // row data object
    });

    Update Row

    PUT https://api.retable.io/v1/public/retable/{retable_id}/data

    client.updateRow(retable_id: string,{
        rows: [
            {
                row_id: 2,
                columns: [
                    {
                        column_id: "Bvt1FtQhTyAPjmDx",
                        update_cell_value: "Mordor"
                    }
                ]
            },
        ]
    }).then(res => {
      res.data // row data array
    });

    Delete Row

    DELETE https://api.retable.io/v1/public/retable/{retable_id}/data

    client.deleteRow(retable_id: string,{
        row_ids: [
            1
        ]
    }).then(res => {
      res.data // row data object
    });