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

@keboola/storage-api-js-client

v2.9.1

Published

Javascript client for Keboola Storage API

Downloads

1

Readme

Javascript client for Keboola Storage API

Build Maintainability

Javascript client for Keboola Connection Storage API. This API client provides client methods to get data from KBC and store data in KBC. The endpoints for working with buckets and tables are covered.

Tables import and export is processed in-memory so it is suitable rather for smaller tables.

Installation

  1. Install npm package: yarn add @keboola/storage-api-js-client

Usage

You can use ES6 imports (import Storage from '@keboola/storage-api-js-client';) or require (const Storage = require('@keboola/storage-api-js-client').default;).

const Storage = require('@keboola/storage-api-js-client').default;
const storage = new Storage('https://connection.keboola.com', 'TOKEN');

// You can call any request directly
storage.request('get', 'buckets/bucket_id/tables')
  .then(res => _.map(res, item => console.log(item.id)));

// Or use helper methods
storage.Buckets.create(stage: "in" | "out", name: string, options: Object = {}): Promise<any>;
storage.Buckets.get(id: string): Promise<any>;
storage.Buckets.list(include: ?Array<"attributes" | "metadata" | "linkedBuckets">): Promise<any>;
storage.Buckets.delete(id: string, force: boolean = false): Promise<any>;

storage.Configurations.create(componentName: string, name: string, options: ?{ configurationId: ?string, description: ?string, configuration: ?Object, state: ?Object, changeDescription: ?string }): Promise<string>;
storage.Configurations.get(componentName: string, id: string): Promise<any>;
storage.Configurations.delete(componentName: string, id: string): Promise<any>;
storage.Configurations.listComponents(componentType: ?string, include: ?Array<'configuration' | 'rows'>, isDeleted: ?boolean);
storage.Configurations.list(component: string, isDeleted: ?boolean);

storage.Files.prepare(name: string, options: Object = {}): Promise<any>;
storage.Files.get(id: string, federationToken: boolean = false): Promise<any>;

storage.Tables.create(bucket: string, name: string, filePath: string, options: Object = {}): Promise<void>;
storage.Tables.get(id: string): Promise<any>;
storage.Tables.list(bucket: string, include: ?Array<"attributes" | "columns">): Promise<any>;
storage.Tables.import(tableId: string, filePath: string, options: Object = {}): Promise<void>;
storage.Tables.export(tableId: string, options: Object = {}): Promise<any>;
storage.Tables.exportToFile(tableId: string, options: Object = {}, path: string): Promise<any>;
storage.Tables.delete(id: string): Promise<any>;

Tests and development

You need to set some env variables for the tests:

  • KBC_URL
  • KBC_TOKEN - a master token to a testing project. Please note that the project will be wiped out during the tests.
  • KBC_COMPONENT - name of some component used for Components Configurations API tests Tests can be run using yarn test.

The repository requires conforming to a set of coding standards based on AirBnB code standard checked by ESlint. You can run the check using yarn lint.

Deployment

Deployment to NPM compiles the code from src directory to dist directory. TypeScript files are compiled to ES6 Javascript.