Socket
Socket
Sign inDemoInstall

bump-cli

Package Overview
Dependencies
162
Maintainers
2
Versions
40
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.5.0 to 2.6.0

2

lib/commands/deploy.js

@@ -56,3 +56,3 @@ "use strict";

exports.default = Deploy;
Deploy.description = 'create a new version of your documentation from the given file or URL';
Deploy.description = 'Create a new version of your documentation from the given file or URL.';
Deploy.examples = [

@@ -59,0 +59,0 @@ `Deploy a new version of an existing documentation

@@ -14,2 +14,3 @@ import Command from '../command';

open: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
'fail-on-breaking': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
format: flags.IOptionFlag<string | undefined>;

@@ -23,3 +24,3 @@ expires: flags.IOptionFlag<string | undefined>;

run(): Promise<void>;
displayCompareResult(result: DiffResponse, format: string, open: boolean): Promise<void>;
displayCompareResult(result: DiffResponse, format: string, open: boolean, failOnBreaking: boolean): Promise<void>;
}

@@ -44,3 +44,3 @@ "use strict";

if (diff) {
await this.displayCompareResult(diff, format, flags.open);
await this.displayCompareResult(diff, format, flags.open, flags['fail-on-breaking']);
}

@@ -52,3 +52,3 @@ else {

}
async displayCompareResult(result, format, open) {
async displayCompareResult(result, format, open, failOnBreaking) {
if (format == 'text' && result.text) {

@@ -72,6 +72,9 @@ await cli_1.cli.log(result.text);

}
if (failOnBreaking && result.breaking) {
this.exit(1);
}
}
}
exports.default = Diff;
Diff.description = 'Get a comparaison diff with your documentation from the given file or URL';
Diff.description = 'Get a comparison diff with your documentation from the given file or URL.';
Diff.examples = [

@@ -115,2 +118,3 @@ `Compare a potential new version with the currently published one:

open: flags.open({ description: 'Open the visual diff in your browser' }),
'fail-on-breaking': flags.failOnBreaking(),
format: flags.format(),

@@ -117,0 +121,0 @@ expires: flags.expires(),

@@ -71,3 +71,3 @@ "use strict";

exports.default = Preview;
Preview.description = 'create a documentation preview from the given file or URL';
Preview.description = 'Create a documentation preview from the given file or URL.';
Preview.examples = [

@@ -74,0 +74,0 @@ `$ bump preview FILE

@@ -24,2 +24,3 @@ "use strict";

'2.5': specs_1.default['2.5.0'],
'2.6': specs_1.default['2.6.0'],
};

@@ -26,0 +27,0 @@ class UnsupportedFormat extends errors_1.CLIError {

@@ -12,5 +12,6 @@ import { flags } from '@oclif/command';

declare const open: (options?: {}) => Parser.flags.IBooleanFlag<boolean>;
declare const failOnBreaking: (options?: {}) => Parser.flags.IBooleanFlag<boolean>;
declare const live: (options?: {}) => Parser.flags.IBooleanFlag<boolean>;
declare const format: flags.Definition<string>;
declare const expires: flags.Definition<string>;
export { doc, docName, hub, branch, token, autoCreate, dryRun, open, live, format, expires, };
export { doc, docName, hub, branch, token, autoCreate, dryRun, open, failOnBreaking, live, format, expires, };
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.expires = exports.format = exports.live = exports.open = exports.dryRun = exports.autoCreate = exports.token = exports.branch = exports.hub = exports.docName = exports.doc = void 0;
exports.expires = exports.format = exports.live = exports.failOnBreaking = exports.open = exports.dryRun = exports.autoCreate = exports.token = exports.branch = exports.hub = exports.docName = exports.doc = void 0;
const tslib_1 = require("tslib");

@@ -71,2 +71,14 @@ const command_1 = require("@oclif/command");

exports.open = open;
const failOnBreaking = (options = {}) => {
return command_1.flags.boolean(Object.assign({ char: 'F', description: 'Fail when diff contains a breaking change', default: () => {
const envCi = process.env.CI;
if (envCi) {
return true;
}
else {
return false;
}
} }, options));
};
exports.failOnBreaking = failOnBreaking;
const live = (options = {}) => {

@@ -73,0 +85,0 @@ return command_1.flags.boolean(Object.assign({ char: 'l', default: false }, options));

@@ -1,1 +0,1 @@

{"version":"2.5.0","commands":{"deploy":{"id":"deploy","description":"create a new version of your documentation from the given file or URL","pluginName":"bump-cli","pluginType":"core","aliases":[],"examples":["Deploy a new version of an existing documentation\n\n$ bump deploy FILE --doc <your_doc_id_or_slug> --token <your_doc_token>\n* Let's deploy a new documentation version on Bump... done\n* Your new documentation version will soon be ready\n","Deploy a new version of an existing documentation attached to a hub\n\n$ bump deploy FILE --doc <doc_slug> --hub <your_hub_id_or_slug> --token <your_doc_token>\n* Let's deploy a new documentation version on Bump... done\n* Your new documentation version will soon be ready\n","Validate a new documentation version before deploying it\n\n$ bump deploy FILE --dry-run --doc <doc_slug> --token <your_doc_token>\n* Let's validate a new documentation version on Bump... done\n* Definition is valid\n"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"doc":{"name":"doc","type":"option","char":"d","description":"Documentation public id or slug. Can be provided via BUMP_ID environment variable","required":true},"doc-name":{"name":"doc-name","type":"option","char":"n","description":"Documentation name. Used with --auto-create flag."},"hub":{"name":"hub","type":"option","char":"b","description":"Hub id or slug. Can be provided via BUMP_HUB_ID environment variable"},"branch":{"name":"branch","type":"option","char":"B","description":"Branch name. Can be provided via BUMP_BRANCH_NAME environment variable"},"token":{"name":"token","type":"option","char":"t","description":"Documentation or Hub token. Can be provided via BUMP_TOKEN environment variable","required":true},"auto-create":{"name":"auto-create","type":"boolean","description":"Automatically create the documentation if needed (only available with a --hub flag). Documentation name can be provided with --doc-name flag. Default: false","allowNo":false},"dry-run":{"name":"dry-run","type":"boolean","description":"Validate a new documentation version. Does everything a normal deploy would do except publishing the new version. Useful in automated environments such as test platforms or continuous integration. Default: false","allowNo":false}},"args":[{"name":"FILE","description":"Path or URL to your API documentation file. OpenAPI (2.0 to 3.1.0) and AsyncAPI (2.x) specifications are currently supported.","required":true}]},"diff":{"id":"diff","description":"Get a comparaison diff with your documentation from the given file or URL","pluginName":"bump-cli","pluginType":"core","aliases":[],"examples":["Compare a potential new version with the currently published one:\n\n $ bump diff FILE --doc <your_doc_id_or_slug> --token <your_doc_token>\n * Comparing the given definition file with the currently deployed one... done\n Removed: GET /compare\n Added: GET /versions/{versionId}\n","Store the diff in a dedicated file:\n\n $ bump diff FILE --doc <doc_slug> --token <doc_token> > /tmp/my-saved-diff\n * Comparing the given definition file with the currently deployed one... done\n\n $ cat /tmp/my-saved-diff\n Removed: GET /compare\n Added: GET /versions/{versionId}\n","In case of a non modified definition FILE compared to your existing documentation, no changes are output:\n\n $ bump diff FILE --doc <doc_slug> --token <your_doc_token>\n * Comparing the given definition file with the currently deployed one... done\n › Warning: Your documentation has not changed\n","Compare two different input files or URL independently to the one published on bump.sh\n\n $ bump diff FILE FILE2 --doc <doc_slug> --token <your_doc_token>\n * Comparing the two given definition files... done\n Updated: POST /versions\n Body attribute added: previous_version_id\n"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"doc":{"name":"doc","type":"option","char":"d","description":"Documentation public id or slug. Can be provided via BUMP_ID environment variable","required":false},"hub":{"name":"hub","type":"option","char":"b","description":"Hub id or slug. Can be provided via BUMP_HUB_ID environment variable"},"branch":{"name":"branch","type":"option","char":"B","description":"Branch name. Can be provided via BUMP_BRANCH_NAME environment variable"},"token":{"name":"token","type":"option","char":"t","description":"Documentation or Hub token. Can be provided via BUMP_TOKEN environment variable","required":false},"open":{"name":"open","type":"boolean","char":"o","description":"Open the visual diff in your browser","allowNo":false},"format":{"name":"format","type":"option","char":"f","description":"Format in which to provide the diff result","options":["text","markdown","json","html"],"default":"text"},"expires":{"name":"expires","type":"option","char":"e","description":"Specify a longer expiration date for public diffs (defaults to 1 day). Use iso8601 format to provide a date, or you can use `--expires 'never'` to keep the result live indefinitely."}},"args":[{"name":"FILE","description":"Path or URL to your API documentation file. OpenAPI (2.0 to 3.1.0) and AsyncAPI (2.x) specifications are currently supported.","required":true},{"name":"FILE2","description":"Path or URL to a second API documentation file to compute its diff"}]},"preview":{"id":"preview","description":"create a documentation preview from the given file or URL","pluginName":"bump-cli","pluginType":"core","aliases":[],"examples":["$ bump preview FILE\n* Your preview is visible at: https://bump.sh/preview/45807371-9a32-48a7-b6e4-1cb7088b5b9b\n"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"live":{"name":"live","type":"boolean","char":"l","description":"Generate a preview each time you save the given file","allowNo":false},"open":{"name":"open","type":"boolean","char":"o","description":"Open the generated preview URL in your browser","allowNo":false}},"args":[{"name":"FILE","description":"Path or URL to your API documentation file. OpenAPI (2.0 to 3.1.0) and AsyncAPI (2.x) specifications are currently supported.","required":true}]}}}
{"version":"2.6.0","commands":{"deploy":{"id":"deploy","description":"Create a new version of your documentation from the given file or URL.","pluginName":"bump-cli","pluginType":"core","aliases":[],"examples":["Deploy a new version of an existing documentation\n\n$ bump deploy FILE --doc <your_doc_id_or_slug> --token <your_doc_token>\n* Let's deploy a new documentation version on Bump... done\n* Your new documentation version will soon be ready\n","Deploy a new version of an existing documentation attached to a hub\n\n$ bump deploy FILE --doc <doc_slug> --hub <your_hub_id_or_slug> --token <your_doc_token>\n* Let's deploy a new documentation version on Bump... done\n* Your new documentation version will soon be ready\n","Validate a new documentation version before deploying it\n\n$ bump deploy FILE --dry-run --doc <doc_slug> --token <your_doc_token>\n* Let's validate a new documentation version on Bump... done\n* Definition is valid\n"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"doc":{"name":"doc","type":"option","char":"d","description":"Documentation public id or slug. Can be provided via BUMP_ID environment variable","required":true},"doc-name":{"name":"doc-name","type":"option","char":"n","description":"Documentation name. Used with --auto-create flag."},"hub":{"name":"hub","type":"option","char":"b","description":"Hub id or slug. Can be provided via BUMP_HUB_ID environment variable"},"branch":{"name":"branch","type":"option","char":"B","description":"Branch name. Can be provided via BUMP_BRANCH_NAME environment variable"},"token":{"name":"token","type":"option","char":"t","description":"Documentation or Hub token. Can be provided via BUMP_TOKEN environment variable","required":true},"auto-create":{"name":"auto-create","type":"boolean","description":"Automatically create the documentation if needed (only available with a --hub flag). Documentation name can be provided with --doc-name flag. Default: false","allowNo":false},"dry-run":{"name":"dry-run","type":"boolean","description":"Validate a new documentation version. Does everything a normal deploy would do except publishing the new version. Useful in automated environments such as test platforms or continuous integration. Default: false","allowNo":false}},"args":[{"name":"FILE","description":"Path or URL to your API documentation file. OpenAPI (2.0 to 3.1.0) and AsyncAPI (2.x) specifications are currently supported.","required":true}]},"diff":{"id":"diff","description":"Get a comparison diff with your documentation from the given file or URL.","pluginName":"bump-cli","pluginType":"core","aliases":[],"examples":["Compare a potential new version with the currently published one:\n\n $ bump diff FILE --doc <your_doc_id_or_slug> --token <your_doc_token>\n * Comparing the given definition file with the currently deployed one... done\n Removed: GET /compare\n Added: GET /versions/{versionId}\n","Store the diff in a dedicated file:\n\n $ bump diff FILE --doc <doc_slug> --token <doc_token> > /tmp/my-saved-diff\n * Comparing the given definition file with the currently deployed one... done\n\n $ cat /tmp/my-saved-diff\n Removed: GET /compare\n Added: GET /versions/{versionId}\n","In case of a non modified definition FILE compared to your existing documentation, no changes are output:\n\n $ bump diff FILE --doc <doc_slug> --token <your_doc_token>\n * Comparing the given definition file with the currently deployed one... done\n › Warning: Your documentation has not changed\n","Compare two different input files or URL independently to the one published on bump.sh\n\n $ bump diff FILE FILE2 --doc <doc_slug> --token <your_doc_token>\n * Comparing the two given definition files... done\n Updated: POST /versions\n Body attribute added: previous_version_id\n"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"doc":{"name":"doc","type":"option","char":"d","description":"Documentation public id or slug. Can be provided via BUMP_ID environment variable","required":false},"hub":{"name":"hub","type":"option","char":"b","description":"Hub id or slug. Can be provided via BUMP_HUB_ID environment variable"},"branch":{"name":"branch","type":"option","char":"B","description":"Branch name. Can be provided via BUMP_BRANCH_NAME environment variable"},"token":{"name":"token","type":"option","char":"t","description":"Documentation or Hub token. Can be provided via BUMP_TOKEN environment variable","required":false},"open":{"name":"open","type":"boolean","char":"o","description":"Open the visual diff in your browser","allowNo":false},"fail-on-breaking":{"name":"fail-on-breaking","type":"boolean","char":"F","description":"Fail when diff contains a breaking change","allowNo":false},"format":{"name":"format","type":"option","char":"f","description":"Format in which to provide the diff result","options":["text","markdown","json","html"],"default":"text"},"expires":{"name":"expires","type":"option","char":"e","description":"Specify a longer expiration date for public diffs (defaults to 1 day). Use iso8601 format to provide a date, or you can use `--expires 'never'` to keep the result live indefinitely."}},"args":[{"name":"FILE","description":"Path or URL to your API documentation file. OpenAPI (2.0 to 3.1.0) and AsyncAPI (2.x) specifications are currently supported.","required":true},{"name":"FILE2","description":"Path or URL to a second API documentation file to compute its diff"}]},"preview":{"id":"preview","description":"Create a documentation preview from the given file or URL.","pluginName":"bump-cli","pluginType":"core","aliases":[],"examples":["$ bump preview FILE\n* Your preview is visible at: https://bump.sh/preview/45807371-9a32-48a7-b6e4-1cb7088b5b9b\n"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"live":{"name":"live","type":"boolean","char":"l","description":"Generate a preview each time you save the given file","allowNo":false},"open":{"name":"open","type":"boolean","char":"o","description":"Open the generated preview URL in your browser","allowNo":false}},"args":[{"name":"FILE","description":"Path or URL to your API documentation file. OpenAPI (2.0 to 3.1.0) and AsyncAPI (2.x) specifications are currently supported.","required":true}]}}}
{
"name": "bump-cli",
"description": "The Bump CLI is used to interact with your API documentation hosted on Bump by using the API of developers.bump.sh",
"version": "2.5.0",
"version": "2.6.0",
"author": "Paul Bonaud <paulr@bump.sh>",

@@ -6,0 +6,0 @@ "bin": {

@@ -50,3 +50,3 @@ # Bump cli

VERSION
bump-cli/2.1.1 linux-x64 node-v15.12.0
bump-cli/2.5.0 linux-x64 node-v16.14.0

@@ -57,6 +57,6 @@ USAGE

COMMANDS
deploy create a new version of your documentation from the given file or URL
diff Get a comparaison diff with your documentation from the given file or URL
help display help for bump
preview create a documentation preview from the given file or URL
deploy Create a new version of your documentation from the given file or URL.
diff Get a comparison diff with your documentation from the given file or URL.
help Display help for bump.
preview Create a documentation preview from the given file or URL.
```

@@ -97,2 +97,8 @@

Deploy the definition file to the `staging` branch of the documentation:
```sh-session
$ bump deploy path/to/your/file.yml --doc DOC_ID_OR_SLUG --token DOC_TOKEN --branch staging
```
If you already have a hub in your [Bump.sh](https://bump.sh) account, you can automatically create a documentation inside it and deploy to it with:

@@ -142,3 +148,3 @@

From a Bump documentation, the `diff` command will retrieve a comparaison changelog between your existing documentation and the given file or URL:
From a Bump documentation, the `diff` command will retrieve a comparison changelog between your existing documentation and the given file or URL:

@@ -153,3 +159,3 @@ ```sh-session

If you want to compare two unpublished versions of your definition file, the `diff` command can retrieve a comparaison changelog between two given file or URL, “as simple as `git diff`”:
If you want to compare two unpublished versions of your definition file, the `diff` command can retrieve a comparison changelog between two given file or URL, “as simple as `git diff`”:

@@ -164,4 +170,2 @@ ```sh-session

_Note: you can use the `--open` flag to open the visual diff URL in your browser directly._
Please check `bump diff --help` for full usage details.

@@ -168,0 +172,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc