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

@twilio/flex-plugins-api-client

v7.1.0

Published

Flex Plugins API Client

Downloads

13,514

Readme

Version Download License

Flex Plugins API Client

This package provides a NodeJS HTTP client for using the Public API endpoints.

Installation

Install this package using:

# Using npm
npm i -S flex-plugins-api-client

# Using yarn
yarn add flex-plugins-api-client

Usage

Instantiate a PluginServiceHttpClient client by providing username/password (AccountSid/AuthToken, API Key/Secret, or JWE token). Then instantiate each client (corresponding to different resources) by passing this HTTP client to it:

import {
    PluginServiceHttpClient,
    PluginsClient,
    PluginVersionsClient
} from '@twilio/flex-plugins-api-client';

// Instantiate the HTTP client
const httpClient = new PluginServiceHttpClient(process.env.USERNAME, process.env.PASSWORD);

// Now instantiate each endpoint client you want to use
const pluginsClient = new PluginsClient(httpClient);
const pluginsVersionClient = new PluginVersionsClient(httpClient);

Clients

The available clients are listed below. All endpoints return a promise.

Note: If you are using the JWE token for authentication, then all identifiers (such as pluginId, versionId, etc) must be the sid of the resource only.

PluginsClient

This is the HTTP client for plugins endpoints. Available endpoints are:

list(pagination?: Pagination)

This endpoint lists all plugins.

get(pluginId)

This endpoint fetches the provided plugin. The pluginId can either be the unique name or the plugin sid.

create(requestObject)

This endpoint creates a new plugin.

update(pluginId, updateObject)

This endpoint updates a plugin. The pluginId can either be the unique name or the plugin sid.

upsert(upsertObject)

This endpoint tries to find the plugin by uniqueName. If it is found, then it updates the plugin; otherwise, it creates a new plugin.

PluginVersionsClient

This is the HTTP client for plugin versions endpoints. Available endpoints are:

list(pluginId, pagination?: Pagination)

This endpoint lists all plugin versions of the given plugin. The pluginId can either be the unique name or the plugin sid.

latest(pluginId)

This endpoint returns the latest plugin version (by the date created) of the given plugin. The pluginId can either be the unique name or the plugin sid.

get(pluginId, versionId)

This endpoint fetches the provided plugin version. The pluginId can either be the unique name or the plugin sid and the versionId can either be the version or the plugin version sid.

create(pluginId, requestObject)

This endpoint creates a new plugin version. The pluginId can either be the unique name or the plugin sid.

ConfigurationsClient

This is the HTTP client for configurations endpoints. Available endpoints are:

list(pagination?: Pagination)

This endpoint lists all configurations.

get(configId)

This endpoint fetches the provided configuration. The configId can either be version of the configuration sid.

create(requestObject)

This endpoint creates a new configuration.

ConfiguredPluginsClient

This is the HTTP client for configured plugins endpoints. Available endpoints are:

list(configId)

This endpoint lists all configured plugins. The configId can either be version of the configuration sid.

get(configId, pluginId)

This endpoint fetches the provided configured plugins. The configId can either be version of the configuration sid and the pluginId can either be the unique name or the plugin sid.

ReleasesClient

This is the HTTP client for releases endpoints. Available endpoints are:

list(pagination?: Pagination)

This endpoint lists all releases.

active()

This endpoint returns the currently active release.

get(releaseId)

This endpoint fetches the provided release. The releaseId is the release sid.

create(requestObject)

This endpoint creates a new release.

Pagination

The list endpoints can taken an optional pagination parameter. The interface for this parameter is and it follows the regular Twilio pagination format:

interface Pagination {
  pageSize?: number;
  page?: number;
  pageToken?: string;
}

The list endpoints return data in the format of:

interface PaginationMeta {
  meta: {
    page: number;
    page_size: number;
    first_page_url: string;
    previous_page_url: string;
    url: string;
    next_page_url?: string;
    key: string;
    next_token?: string;
    previous_token?: string;
  };
}

The next_token and previous_token will be parsed from the next_page_url and previous_page_url if available and can be used to be passed as Pagination parameter to the next list call.