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

@go1/apim-cli

v2.0.0

Published

Generate APIM deployment files from your openapi doc

Downloads

161

Readme

⚡️ Installation

First of all, make sure you have node v20 or higher installed. Then install the CLI and run the initialise command with:

npm i @go1/apim-cli -g

@go1/apim-cli init

You can alternatively use npx to install and initialise together

npx @go1/apim-cli init

This will kick off a wizard asking a few configuration questions including where to find the openapi.yml file. Afer the wizard has successfully finished, you should see a new folder called apim with all the required files for your service inside.

  • /apim
    • openapi.yml
    • config.yml
    • auth.policy.xml
    • /policies
      • endpoint_1.xml
      • endpoint_...xml

You're ready to push those files with your next commit and let the CI/CD pipeline handle the rest for you.

📖 Project Wiki

You can find more information about APIM here [Add link here]

⚙️ Commands & Options

init

CLI command for creating a new apim directory

@go1/apim-cli init [OPTION]

| Option | Description | Type | Default | Required? | | --------- | --------------------------------------------------------------------------------------------------------- | -------- | ------- | --------- | | openapi | Pass the openapi.yml file, this will try to use configuration from the swagger doc to populate the wizard | string | null | No | | name | Pass the display name of your service | string | null | No | | path | Pass the public path for your service | string | null | No | | backend | Pass the internal path for your service | string | null | No |

update

CLI command for updating an existing apim directory so that you don't need to input the wizard again

@go1/apim-cli update

validate

CLI command for validating an open api doc follows the standard schema, you can also optionally pass a --master flag to validate against a source api to check if any breaking changes have been added. Input OpenAPI files can be either JSON or YAML format. There is also a --skip flag to still show breaking changes but don't throw an error in the console.

@go1/apim-cli validate <openapi.yml> [OPTION]

@go1/apim-cli validate openapi.yml --master=source.json --skip=true

| Option | Description | Type | Default | Required? | | --------- | --------------------------------------------------------------------- | --------- | ------- | --------- | | openapi | Pass the incoming openapi.yml file that you want to validate | string | null | Yes | | master | Pass the source openapi.yml file to compare the incoming changes with | string | null | No | | skip | Whether you want to skip any breaking changes from throwing an error | boolean | false | No |

merge

CLI command for merging two openapi docs into a single file. This is useful for merging individual services into a master open api doc.

@go1/apim-cli merge changes.yml source.yml output.json

Local Development

Clone this repo and run the following commands to setup and test locally

npm install
npm run build

chmod +x ./build
./build/cli.js init
npm run test

⚠️ License

Go1 APIM CLI is free and open-source software licensed under the Apache 2.0 License.