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

@anvilco/types

v1.1.0

Published

TypeScript types generated from the Anvil OpenAPI spec and GraphQL schema

Readme

@anvilco/types

TypeScript types generated from the Anvil OpenAPI spec and GraphQL schema. Consumed internally by @anvilco/browser and @anvilco/react.

The one place for the Anvil SDK's TypeScript types:

  • REST: paths, components and operations, generated from the OpenAPI spec, plus the fill-PDF request types (FillPdfPayload, FillPdfData, FillPdfOptions).
  • Etch: CreateEtchPacketArgs, the createEtchPacket mutation's arguments with the ones the GraphQL schema calls JSON typed: signers (EtchSigner), signaturePageOptions (EtchSignaturePageOptions) and finishPageOptions (EtchFinishPageOptions). The OpenAPI spec publishes their shapes.
  • GraphQL: the GraphQL namespace, generated from the schema.
  • The SDK's own types: AnvilOptions, GraphQLResponse, RESTResponse, ResponseError, ResponseErrorField, RuntimeError and Abortable.
import type { GraphQL } from '@anvilco/types'

type Packet = GraphQL.Type<'EtchPacket'> // any type in the schema, by name
type WeldFile = GraphQL.Type<'WeldFile'> // input types too: nullable fields are optional
type Args = GraphQL.MutationArgs<'createEtchPacket'> // the arguments of any mutation
type PacketArgs = GraphQL.QueryArgs<'etchPacket'> // …or query

Object types describe the whole object as the schema defines it. A query returns only the fields it selects, so for data you fetched, use the type of your query's result instead.

Custom scalars are typed by GraphQL.Scalars: Date is an ISO 8601 string, JSON is unknown, and Upload is Blob | { data: string; mimetype: string; filename: string } | { url: string; filename?: string }.

GraphQL operations

To run queries and mutations, use @anvilco/core. Its graphql documents are typed against this schema.

The specs these types are generated from also ship with the package, for build tooling: the GraphQL schema at @anvilco/types/schema.graphql and the OpenAPI spec at @anvilco/types/openapi.json. The other Anvil API clients (python-anvil, dotnet-anvil) generate their types from them, so every client describes the same API. Importing @anvilco/types never loads them at runtime.

Versioning

The package mirrors the live API, so its version tracks what the API did, by semver:

  • major: a type, field or argument was removed or renamed; an argument became required; an output field became nullable; an input field became required. Anything typed against the old shape may no longer compile.
  • minor: additions: new types, fields, arguments, enum values and endpoints, and other changes that only widen what can be sent or received.
  • patch: only descriptions changed.

The sync PR's changeset is chosen by diffing the specs (scripts/spec-bump.js: graphql-js's findBreakingChanges and findDangerousChanges for the schema, oasdiff for the OpenAPI spec), with the highest bump across both. A major sync PR lists each breaking change and is reviewed before it merges. @anvilco/core re-exports these types, so it takes the same bump.

Regenerating

Types are regenerated from production after every Anvil production deploy (.github/workflows/sync-api-types.yml), which opens a PR when they change, with a changeset at the bump the change warrants (see Versioning). To regenerate by hand:

  • REST: yarn workspace @anvilco/types generate:rest refreshes schema/openapi.json from production and rebuilds src/rest.ts from it.
  • GraphQL: ANVIL_API_KEY_PROD_BASE64=... yarn workspace @anvilco/types fetch:schema refreshes schema/anvil-schema.graphql from production, then yarn workspace @anvilco/types generate:graphql rebuilds src/graphql/generated/ from it. The second step needs no network access or key, which is what CI checks.