bump-cli
Advanced tools
Comparing version 2.4.1 to 2.5.0
@@ -50,2 +50,3 @@ export interface PingResponse { | ||
previous_references?: Reference[]; | ||
expires_at?: string; | ||
} | ||
@@ -52,0 +53,0 @@ export interface DiffResponse { |
@@ -29,4 +29,4 @@ import { CliUx } from '@oclif/core'; | ||
annotation(text: string, annotation: string): void; | ||
flush(): Promise<void>; | ||
flush(ms?: number | undefined): Promise<void>; | ||
}; | ||
export { cli }; |
@@ -15,2 +15,3 @@ import Command from '../command'; | ||
format: flags.IOptionFlag<string | undefined>; | ||
expires: flags.IOptionFlag<string | undefined>; | ||
}; | ||
@@ -17,0 +18,0 @@ static args: { |
@@ -21,3 +21,3 @@ "use strict"; | ||
* oclif types doesn't detect it */ | ||
const [documentation, hub, branch, token, format] = [ | ||
const [documentation, hub, branch, token, format, expires] = [ | ||
flags.doc, | ||
@@ -29,2 +29,3 @@ flags.hub, | ||
flags.format, | ||
flags.expires, | ||
]; | ||
@@ -42,3 +43,3 @@ if (format === 'text') { | ||
} | ||
const diff = await new diff_1.Diff(this.config).run(args.FILE, args.FILE2, documentation, hub, branch, token, format); | ||
const diff = await new diff_1.Diff(this.config).run(args.FILE, args.FILE2, documentation, hub, branch, token, format, expires); | ||
cli_1.cli.action.stop(); | ||
@@ -115,3 +116,4 @@ if (diff) { | ||
format: flags.format(), | ||
expires: flags.expires(), | ||
}; | ||
Diff.args = [args_1.fileArg, args_1.otherFileArg]; |
@@ -8,6 +8,6 @@ import * as Config from '@oclif/config'; | ||
constructor(config: Config.IConfig); | ||
run(file1: string, file2: string | undefined, documentation: string | undefined, hub: string | undefined, branch: string | undefined, token: string | undefined, format: string): Promise<DiffResponse | undefined>; | ||
run(file1: string, file2: string | undefined, documentation: string | undefined, hub: string | undefined, branch: string | undefined, token: string | undefined, format: string, expires: string | undefined): Promise<DiffResponse | undefined>; | ||
get bumpClient(): BumpApi; | ||
get pollingPeriod(): number; | ||
createDiff(file1: string, file2: string): Promise<DiffResponse | undefined>; | ||
createDiff(file1: string, file2: string, expires: string | undefined): Promise<DiffResponse | undefined>; | ||
createVersion(file: string, documentation: string, token: string, hub: string | undefined, branch_name: string | undefined, previous_version_id?: string | undefined): Promise<VersionResponse | undefined>; | ||
@@ -14,0 +14,0 @@ waitResult(result: VersionResponse | DiffResponse, token: string | undefined, opts: { |
@@ -13,6 +13,6 @@ "use strict"; | ||
} | ||
async run(file1, file2, documentation, hub, branch, token, format) { | ||
async run(file1, file2, documentation, hub, branch, token, format, expires) { | ||
let diffVersion = undefined; | ||
if (file2 && (!documentation || !token)) { | ||
diffVersion = await this.createDiff(file1, file2); | ||
diffVersion = await this.createDiff(file1, file2, expires); | ||
} | ||
@@ -46,3 +46,3 @@ else { | ||
} | ||
async createDiff(file1, file2) { | ||
async createDiff(file1, file2, expires) { | ||
const api = await definition_1.API.load(file1); | ||
@@ -57,2 +57,3 @@ const [previous_definition, previous_references] = api.extractDefinition(); | ||
references, | ||
expires_at: expires, | ||
}; | ||
@@ -59,0 +60,0 @@ const response = await this.bumpClient.postDiff(request); |
@@ -23,2 +23,3 @@ "use strict"; | ||
'2.4': specs_1.default['2.4.0'], | ||
'2.5': specs_1.default['2.5.0'], | ||
}; | ||
@@ -25,0 +26,0 @@ class UnsupportedFormat extends errors_1.CLIError { |
@@ -14,2 +14,3 @@ import { flags } from '@oclif/command'; | ||
declare const format: flags.Definition<string>; | ||
export { doc, docName, hub, branch, token, autoCreate, dryRun, open, live, format }; | ||
declare const expires: flags.Definition<string>; | ||
export { doc, docName, hub, branch, token, autoCreate, dryRun, open, live, format, expires, }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
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.open = exports.dryRun = exports.autoCreate = exports.token = exports.branch = exports.hub = exports.docName = exports.doc = void 0; | ||
const tslib_1 = require("tslib"); | ||
@@ -82,1 +82,6 @@ const command_1 = require("@oclif/command"); | ||
exports.format = format; | ||
const expires = command_1.flags.build({ | ||
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.", | ||
}); | ||
exports.expires = expires; |
@@ -1,1 +0,1 @@ | ||
{"version":"2.4.1","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"}},"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.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}]}}} |
{ | ||
"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.4.1", | ||
"version": "2.5.0", | ||
"author": "Paul Bonaud <paulr@bump.sh>", | ||
@@ -15,3 +15,3 @@ "bin": { | ||
"@types/mocha": "^10.0.0", | ||
"@types/node": "^17.0.4", | ||
"@types/node": "^18.11.18", | ||
"@typescript-eslint/eslint-plugin": "^4.21.0", | ||
@@ -81,3 +81,3 @@ "@typescript-eslint/parser": "^4.21.0", | ||
"@apidevtools/json-schema-ref-parser": "^9.0.7", | ||
"@asyncapi/specs": "^3.0.0", | ||
"@asyncapi/specs": "^4.0.1", | ||
"@oclif/command": "^1.8.16", | ||
@@ -84,0 +84,0 @@ "@oclif/config": "^1.17.0", |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 4 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
67985
1275
8
+ Added@asyncapi/specs@4.3.1(transitive)
- Removed@asyncapi/specs@3.2.1(transitive)
Updated@asyncapi/specs@^4.0.1