New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

insomnia-inso

Package Overview
Dependencies
Maintainers
3
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

insomnia-inso

A CLI for Insomnia Designer - the collaborative API design tool.

  • 2.2.17
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
3
Weekly downloads
 
Created
Source

inso

A CLI to accompany Insomnia Designer

npm i -g insomnia-inso

Data source

inso will first try to find a .insomnia directory in it's working directory. This directory is generated in a git repository when using git sync in Designer. When inso is used in a CI environment, it will always run against the .insomnia directory.

If inso cannot find the .insomnia directory, it will try to run against the Designer app data directory (if found). You can override both the working directory, and the app data directory, using the --working-dir and --app-data-dir global options.

The [identifier] argument

Typically, Insomnia database id's are quite long, for example: wrk_012d4860c7da418a85ffea7406e1292a. When specifying an identifier for inso, similar to Git hashes, you may choose to concatenate and use the first x characters (for example, wrk_012d486 ), which is very likely to be unique. If in the rare chance the short id is not unique against the data, inso will inform as such.

Additionally, if the [identifier] argument is ommitted from the command, inso will search in the database for the information it needs, and prompt the user. Prompts can be disabled with the --ci global option.

Commands

$ inso [global options] [command]

Global optionAliasDescription
--working-dir <dir>-wset working directory
--app-data-dir <dir>-aset the app data directory
--cirun in CI, disables all prompts
--version-voutput the version number
--help-hdisplay help for a command

$ inso generate config [options] [identifier]

Similar to the Kong Kubernetes and Declarative config plugins for Designer, this command can generate configuration from an API specification, using openapi-2-kong.

[identifier]: this can be a document name, id, or a file path relative to the working directory.

OptionAliasDescription
--type <type>-ttype of configuration to generate, options are kubernetes and declarative (default: declarative )
--output <path>-osave the generated config to a file in the working directory
Examples

When running in the git-repo directory

inso generate config

inso generate config spc_46c5a4 --type declarative

inso generate config spc_46c5a4 --type declarative > output.yaml

inso generate config "Sample Specification" --output output.yaml

inso generate config "Sample Specification" --type kubernetes

inso generate config spec.yaml --working-dir another/dir

$ inso lint spec [identifier]

Designer has the ability to lint and validate your OpenAPI specification as you write it. This command adds the same functionality to inso , in order to run linting during CI workflows. Lint results will be printed to the console, and inso will exit with an appropriate exit code.

[identifier]: this can be a document name, or id.

Examples

When running in the git-repo directory

inso lint spec

inso lint spec spc_46c5a4

inso lint spec "Sample Specification"

$ inso run test [options] [identifier]

API Unit Testing was introduced with Designer 2020.3.0, and this command adds the functionality to execute those unit tests via the command line, very useful for a CI environment. inso will report on test results, and exit with an appropriate exit code.

[identifier]: this can be the name or id of a workspace, document, or unit test suite.

The test runner is built on top of Mocha, thus many of the options behave as they would in Mocha. The options currently supported are:

OptionAliasDescription
--env <identifier>-ethe environment to use - an environment name or id
--reporter <value>-rreporter to use, options are dot, list, spec, min and progress (default: spec )
--test-name-pattern <regex>-trun tests that match the regex
--bail-babort ("bail") after the first test failure
--keep-filedo not delete the generated test file (useful for debugging)
Examples

When running in the git-repo directory.

inso run test

# By document
inso run test "Sample Specification" --env "OpenAPI env"
inso run test spc_46c5a4 --env env_env_ca046a

# By suite
inso run test "Math Suite" --env "OpenAPI env"
inso run test uts-7f0f85 --env env_env_ca046a

inso run test "Sample Specification" --test-name-pattern Math --env env_env_ca046a
inso run test spc_46c5a4 --reporter progress --bail --keep-file

More examples: #2338.

Development

  • Bootstrap: npm run bootstrap
  • Start the compiler in watch mode: npm run watch
  • Run: ./bin/inso -v

FAQs

Package last updated on 08 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc