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

the-missing-sdk-for-aws-api-gateway

v1.0.4

Published

The AWS SDK can be clunky, particularly when dealing with API keys, usage plans, and usage data.

Downloads

3

Readme

The-Missing-SDK-For-AWS-API-Gateway

The AWS SDK can be clunky, particularly when dealing with API keys, usage plans, and usage data.

The goal of this package is to create functionality that is currently required to be built manually by developers.

Install

npm i the-missing-sdk-for-aws-api-gateway

Example Client

const  UsagePlanManager  = require("the-missing-sdk-for-aws-api-gateway");

var config = {
    region: 'us-east-1' //or whatever your region is 
}
const gate = new UsagePlanManager(config);

A full list of config variables can be found in the AWS docs under the constructor property section.

Methods

getApiKeysByEnabled

returns list of all enabled or disabled keys

await gate.getApiKeysByEnabled(true);

getApiKeyObjectsByPartialName

Accepts a single string, returns all key objects matching part of the string

await gate.getApiKeyObjectsByPartialName("part_of_a_key_name")

getApiKeyObjectsByPartialName

inputs single string, returns all key objects matching the name according to aws apigateway search

await gate.getApiKeyObjectsByName("full_key_name")

getApiKeyById

inputs a single keyId as string value, returns an api key object

await gate.getApiKeyById("keyID")

getApiKeyValueById

inputs a single keyId as string value, returns an api key as a String

await gate.getApiKeyValueById("keyID")

createApiKeyByParams

creates an api key based on a set of passed in parameters

let params = {
    name : "Key-Name", //required
    value : "ValueOfApiKey",
    description : "Description",
    enabled : "true",
}

await gate.createApiKeyByParams(params)

createApiKeyByName

creates an api key based on a set of passed in parameters

await gate.createApiKeyByName("key-Name")

getUsagePlanObjectById

Gets usage plan object from a usage plan id

await gate.getUsagePlanObjectById("UsagePlanId")

getAllUsagePlanObjects

gets all usage plan objects on account

await gate.getAllUsagePlanObjects()

subscribeKeyToPlanWithIds

subscribe key to plan by passing in api key id and usage plan id

await gate.subscribeKeyToPlanWithIds("planId","keyId")

getUsageDataForPlan

Get usage data for a plan by plan id The first date should be the start date for timeframe, the last date should be one day after the end of your timeframe.

await gate.getUsageDataForPlan("planId","YYYY-MM-DD","YYYY-MM-DD")

getUsageDataForPlanByKey

Get usage data for a plan and specific key by plan and key id The first date should be the start date for timeframe, the last date should be one day after the end of your timeframe.

await gate.getUsageDataForPlanByKey("planId","keyId","YYYY-MM-DD","YYYY-MM-DD")

TODO

  • Unsubscribe key from plan
  • Extend usage of key
  • Add more test cases