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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@suss/contract-aws-apigateway

v0.38.2

Published

Turn an AWS API Gateway REST or HTTP API into a suss contract and check it against the Lambda handlers and clients that use it.

Readme

@suss/contract-aws-apigateway

Part of suss, which reads both sides of every call in a repository and reports where the two disagree.

This package builds suss BehavioralSummary[] for AWS API Gateway resources (REST and HTTP API), however they were deployed.

What this package is

@suss/contract-aws-apigateway is a resource-semantics stub. Given a normalized configuration, it works out what an API Gateway endpoint does: its status codes, authorizer behavior, CORS preflight and throttling. It does not read the configuration as someone wrote it. A manifest reader does that: @suss/contract-cloudformation today, and @suss/contract-serverless through it. The reader parses its own source format and passes a normalized config to this package. @suss/contract-terraform exists, but it does not read API Gateway resources yet, and there is no CDK reader.

Because of that split, an API configured in CloudFormation, SAM or a serverless.yml gets the same resource semantics and the same summary. A CDK or Terraform reader would pass its config to the same code.

Where it fits

packages/contract/
  openapi/              # Spec → summaries (declares what the API claims to be)
  aws-apigateway/       # Resource semantics: what AWS API Gateway actually does
  cloudformation/       # Manifest reader: walks CFN/SAM, builds configs, delegates here
  serverless/           # Rewrites serverless.yml as SAM and hands it to cloudformation/
  terraform/            # Reads Terraform; does not read API Gateway resources yet
  (future) cdk-synth/   # Same delegation pattern

Why configuration matters

A handler that only returns 200 can respond in many more ways once it is deployed behind API Gateway. An authorizer adds 401/403, request validation adds 400, throttling adds 429, integration timeouts add 504, and CORS adds an OPTIONS preflight endpoint. If suss did not model these, a consumer that handles 429 would look like it had a dead branch, when the platform does produce 429 even though the handler never does.

These transitions come out with confidence.source: "derived" and an opaque Predicate of the form platform:apiGateway:<contract>. Each transition's metadata records which configuration field introduced it, for inspect/diff output, so consumers do not have to work out the platform cause themselves.

More

Coverage

coverage

License

Licensed under Apache 2.0. See LICENSE.