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-smartsheet-connector

v0.0.1

Published

Reshuffle connectors for Smartsheet

Downloads

3

Readme

SmartSheet Connector

This package contains a Resshufle connector to access to online spreadsheets at smartsheet.com.

All actions throw in case of an error.

Actions:

deleteRow Delete one row

getImage Get image from a sheet cell

getSheetById Get sheet data by sheet id

getSheetIdByName Find sheet id by its name

getSheetByName Get sheet data by sheet name

getSimpleSheetById Get a simple sheet object by ID

getSimpleSheetByName Get a simple sheet object by name

getRow Get row information

listSheets List all sheets

listRows List rows in a sheet

update Update a sheet

SDK:

sdk Get direct SDK access

Construction

const app = new Reshuffle()
const smartsheetConnector = new SmaetsheetConnector(app, {
  apiKey: process.env.SMARTSHEET_API_KEY,
})

Action Details

Delete Row action

Definition:

(
  sheetId: number | string,
  rowId: number | string,
) => void

Usage:

await smartsheetConnector.deleteRow(4583173393803140, 1234567890123456)

Delete a single row from the specified sheet.

Get Image action

Definition:

(
  sheetId: number | string,
  rowId: number | string,
  columnIdOrIndex: number | string,
  width?: number, // optional
  height?: number, // optional
) => object

Usage:

const img = await smartsheetConnector.getImage(
  4583173393803140,
  000000000000000,
  3,
)
console.log(img.id, img.text, img.url)

Get an image stored in a sheet cell. sheetId and rowId specify the specific row to query. columnIdOrIndex is treated as an index if it is a number smaller than 1024, otherwise it is treated as a column id.

The returned image include a unique ID, the alternative text (uaully the original file name) and a download URL. The URL is valid for half an hour.

Use the optional width and height arguments to get a link to a resized image.

Get Sheet By ID action

Definition:

(
  sheetId: number | string,
) => object

Usage:

const sheetData = await smartsheetConnector.getSheetById(4583173393803140)

Get full sheet data for the sheet with the specified id.

Get Sheet ID By Name action

Definition:

(
  name: string,
) => number

Usage:

const sheetId = await smartsheetConnector.getSheetIdByName('My Sheet')

Get a sheet ID number for the sheet with the specified name. If a sheet with that name is not found then an Error is thrown.

Get Sheet By Name action

Definition:

(
  name: string,
) => object

Usage:

const sheetData = await smartsheetConnector.getSheetByName('My Sheet')

Get full sheet data for the sheet with the specified name. If a sheet with that name is not found then an Error is thrown.

Get Simple Sheet By ID action

Definition:

(
  sheetId: number | string,
) => object

Usage:

const sheet = await smartsheetConnector.getSimpleSheetById(4583173393803140)
const updater = sheet.getUpdater()
updater.addUpdate('My Column', 000000000000000, 'New Value')
await smartsheetConnector.update(updater.getSheetId(), updater.getUpdates())

Get a SimpleSheet object to representing the sheet with the specified id. This object provides the following methods:

getColumnIdByTitle(
  columnTitle: string,
): number // Get column ID by column title
getUpdater(): object // Create an updater object
pivot(
  pivotColumn: string,
  property: string,
  matchColumns: string[],
  includeRowIDs?: boolean,
): object // Build a pivot table
toSCV(): string // Create a CSV representation

An updater object provides the following methods:

addUpdate(
  columnTitle: string,
  rowId: number | string,
  value: string,
) // Add a cell value to be updated
getSheetId(): number // Get the sheet ID
getUpdates(): object // Get the updates for using with the update action

Get Simple Sheet By Name action

Definition:

(
  name: string,
) => object

Get a SimpleSheet object representing the sheet the the specified name. See getSimpleSheetById for details.

Get Row action

Definition:

(
  sheetId: number | string,
  rowId: number | string,
) => object

Usage:

const row = await smartsheetConnector.getRow(
  4583173393803140,
  1234567890123456,
)

Get information about the specified row in the specified sheet. Row information is detailed here.

List Rows action

Definition:

(
  sheetId: number | string,
) => number[]

Usage:

const rowIds = await smartsheetConnector.listRows(4583173393803140)

Get a list of row IDs in the specified sheet.

List Sheets action

Definition:

() => object[]

Usage:

const sheets = await smartsheetConnector.listSheets()

Get a list of all sheets in the connected Smartsheet account. For each sheet, the following information is returned:

  • id - Sheet ID
  • name - Sheet name
  • accessLevel - Usually 'OWNER'
  • permalink - Link to sheet online page
  • createdAt - Cretion time stamp
  • modifiedAt - Modification time stamp

Update action

Definition:

(
  sheetId: number | string,
  rows: object[],
) => void

Usage:

await smartsheetConnector.update(
  4583173393803140,
  [
    {
      id: '0000000000000000',
      cells: [
        {
          columnId: '0000000000000000',
          value: 'My Value',
        },
      ],
    },
  ],
)

Update the data in a sheet. The update object uses the format defined here . You can use the Simple Sheet objet to create an updater object that will construct the rows array.

SDK Details

SDK action

Definition:

() => object

Usage:

const client = await smartsheetConnector.sdk()

Get the underlying SDK object.