bump-cli 2.2.6 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli/index.d.ts +3 -3
- package/lib/command.d.ts +0 -5
- package/lib/command.js +0 -23
- package/lib/commands/deploy.js +4 -1
- package/lib/commands/diff.d.ts +1 -5
- package/lib/commands/diff.js +12 -63
- package/lib/commands/preview.js +4 -1
- package/lib/core/diff.d.ts +18 -0
- package/lib/core/diff.js +94 -0
- package/lib/definition.d.ts +2 -1
- package/lib/definition.js +12 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +7 -7
package/lib/cli/index.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import success from './styled/success';
|
|
|
2
2
|
declare const cli: {
|
|
3
3
|
styledSuccess: typeof success;
|
|
4
4
|
config: import("cli-ux").Config;
|
|
5
|
-
warn: typeof import("@oclif/errors").warn;
|
|
6
|
-
error: typeof import("@oclif/errors").error;
|
|
7
|
-
exit: typeof import("@oclif/errors").exit;
|
|
5
|
+
warn: typeof import("@oclif/core/lib/errors").warn;
|
|
6
|
+
error: typeof import("@oclif/core/lib/errors").error;
|
|
7
|
+
exit: typeof import("@oclif/core/lib/errors").exit;
|
|
8
8
|
prompt: typeof import("cli-ux/lib/prompt").prompt;
|
|
9
9
|
anykey: typeof import("cli-ux/lib/prompt").anykey;
|
|
10
10
|
confirm: typeof import("cli-ux/lib/prompt").confirm;
|
package/lib/command.d.ts
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import { Command as Base } from '@oclif/command';
|
|
2
2
|
import { BumpApi } from './api';
|
|
3
|
-
import { Reference } from './api/models';
|
|
4
3
|
export default abstract class Command extends Base {
|
|
5
4
|
private base;
|
|
6
5
|
_bump: BumpApi;
|
|
7
|
-
get pollingPeriod(): number;
|
|
8
6
|
get bump(): BumpApi;
|
|
9
7
|
catch(error?: Error): Promise<void>;
|
|
10
8
|
d(formatter: any, ...args: any[]): void;
|
|
11
|
-
pollingDelay(): Promise<void>;
|
|
12
|
-
private delay;
|
|
13
|
-
prepareDefinition(filepath: string): Promise<[string, Reference[]]>;
|
|
14
9
|
}
|
package/lib/command.js
CHANGED
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const command_1 = require("@oclif/command");
|
|
5
5
|
const debug_1 = (0, tslib_1.__importDefault)(require("debug"));
|
|
6
|
-
const definition_1 = require("./definition");
|
|
7
6
|
const api_1 = require("./api");
|
|
8
7
|
const package_json_1 = (0, tslib_1.__importDefault)(require("../package.json"));
|
|
9
8
|
class Command extends command_1.Command {
|
|
@@ -11,9 +10,6 @@ class Command extends command_1.Command {
|
|
|
11
10
|
super(...arguments);
|
|
12
11
|
this.base = `${package_json_1.default.name}@${package_json_1.default.version}`;
|
|
13
12
|
}
|
|
14
|
-
get pollingPeriod() {
|
|
15
|
-
return 1000;
|
|
16
|
-
}
|
|
17
13
|
get bump() {
|
|
18
14
|
if (!this._bump)
|
|
19
15
|
this._bump = new api_1.BumpApi(this.config);
|
|
@@ -31,24 +27,5 @@ class Command extends command_1.Command {
|
|
|
31
27
|
d(formatter, ...args) {
|
|
32
28
|
return (0, debug_1.default)(`bump-cli:command:${this.constructor.name.toLowerCase()}`)(formatter, ...args);
|
|
33
29
|
}
|
|
34
|
-
async pollingDelay() {
|
|
35
|
-
return await this.delay(this.pollingPeriod);
|
|
36
|
-
}
|
|
37
|
-
async delay(ms) {
|
|
38
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
39
|
-
}
|
|
40
|
-
async prepareDefinition(filepath) {
|
|
41
|
-
const api = await definition_1.API.loadAPI(filepath);
|
|
42
|
-
const references = [];
|
|
43
|
-
this.d(`${filepath} looks like an ${api.specName} spec version ${api.version}`);
|
|
44
|
-
for (let i = 0; i < api.references.length; i++) {
|
|
45
|
-
const reference = api.references[i];
|
|
46
|
-
references.push({
|
|
47
|
-
location: reference.location,
|
|
48
|
-
content: reference.content,
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
return [api.rawDefinition, references];
|
|
52
|
-
}
|
|
53
30
|
}
|
|
54
31
|
exports.default = Command;
|
package/lib/commands/deploy.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
const definition_1 = require("../definition");
|
|
4
5
|
const command_1 = (0, tslib_1.__importDefault)(require("../command"));
|
|
5
6
|
const flags = (0, tslib_1.__importStar)(require("../flags"));
|
|
6
7
|
const args_1 = require("../args");
|
|
@@ -14,10 +15,12 @@ class Deploy extends command_1.default {
|
|
|
14
15
|
*/
|
|
15
16
|
async run() {
|
|
16
17
|
const { args, flags } = this.parse(Deploy);
|
|
17
|
-
const
|
|
18
|
+
const api = await definition_1.API.load(args.FILE);
|
|
19
|
+
const [definition, references] = api.extractDefinition();
|
|
18
20
|
const action = flags['dry-run'] ? 'validate' : 'deploy';
|
|
19
21
|
/* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */
|
|
20
22
|
const [documentation, token] = [flags.doc, flags.token];
|
|
23
|
+
this.d(`${args.FILE} looks like an ${api.specName} spec version ${api.version}`);
|
|
21
24
|
cli_1.cli.action.start(`* Let's ${action} a new documentation version on Bump`);
|
|
22
25
|
const request = {
|
|
23
26
|
documentation,
|
package/lib/commands/diff.d.ts
CHANGED
|
@@ -16,9 +16,5 @@ export default class Diff extends Command {
|
|
|
16
16
|
description: string;
|
|
17
17
|
}[];
|
|
18
18
|
run(): Promise<VersionResponse | void>;
|
|
19
|
-
|
|
20
|
-
displayCompareResult(result: VersionResponse, token: string, open: boolean): Promise<void>;
|
|
21
|
-
waitChangesResult(versionId: string, token: string, opts: {
|
|
22
|
-
timeout: number;
|
|
23
|
-
}): Promise<VersionResponse>;
|
|
19
|
+
displayCompareResult(version: VersionResponse, open: boolean): Promise<void>;
|
|
24
20
|
}
|
package/lib/commands/diff.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const errors_1 = require("@oclif/errors");
|
|
5
4
|
const command_1 = (0, tslib_1.__importDefault)(require("../command"));
|
|
6
5
|
const flags = (0, tslib_1.__importStar)(require("../flags"));
|
|
6
|
+
const diff_1 = require("../core/diff");
|
|
7
7
|
const args_1 = require("../args");
|
|
8
8
|
const cli_1 = require("../cli");
|
|
9
9
|
class Diff extends command_1.default {
|
|
@@ -23,77 +23,26 @@ class Diff extends command_1.default {
|
|
|
23
23
|
else {
|
|
24
24
|
cli_1.cli.action.start("* Let's compare the given definition file with the currently deployed one");
|
|
25
25
|
}
|
|
26
|
-
const version = await this.
|
|
27
|
-
|
|
28
|
-
if (
|
|
29
|
-
|
|
26
|
+
const version = await new diff_1.Diff(this.config).run(args.FILE, args.FILE2, documentation, hub, token);
|
|
27
|
+
cli_1.cli.action.stop();
|
|
28
|
+
if (version) {
|
|
29
|
+
await this.displayCompareResult(version, flags.open);
|
|
30
30
|
}
|
|
31
31
|
else {
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
if (diffVersion) {
|
|
35
|
-
diffVersion = await this.waitChangesResult(diffVersion.id, token, {
|
|
36
|
-
timeout: 30,
|
|
37
|
-
});
|
|
38
|
-
await this.displayCompareResult(diffVersion, token, flags.open);
|
|
39
|
-
}
|
|
40
|
-
cli_1.cli.action.stop();
|
|
41
|
-
return diffVersion;
|
|
42
|
-
}
|
|
43
|
-
async createVersion(file, documentation, token, hub, previous_version_id = undefined) {
|
|
44
|
-
const [definition, references] = await this.prepareDefinition(file);
|
|
45
|
-
const request = {
|
|
46
|
-
documentation,
|
|
47
|
-
hub,
|
|
48
|
-
definition,
|
|
49
|
-
references,
|
|
50
|
-
unpublished: true,
|
|
51
|
-
previous_version_id,
|
|
52
|
-
};
|
|
53
|
-
const response = await this.bump.postVersion(request, token);
|
|
54
|
-
switch (response.status) {
|
|
55
|
-
case 201:
|
|
56
|
-
this.d(`Unpublished version created with ID ${response.data.id}`);
|
|
57
|
-
return response.data;
|
|
58
|
-
break;
|
|
59
|
-
case 204:
|
|
60
|
-
this.warn('Your documentation has not changed');
|
|
61
|
-
break;
|
|
32
|
+
await cli_1.cli.log('No changes detected.');
|
|
62
33
|
}
|
|
63
34
|
return;
|
|
64
35
|
}
|
|
65
|
-
async displayCompareResult(
|
|
66
|
-
if (
|
|
67
|
-
await cli_1.cli.log(
|
|
68
|
-
if (open &&
|
|
69
|
-
await cli_1.cli.open(
|
|
36
|
+
async displayCompareResult(version, open) {
|
|
37
|
+
if (version && version.diff_summary) {
|
|
38
|
+
await cli_1.cli.log(version.diff_summary);
|
|
39
|
+
if (open && version.diff_public_url) {
|
|
40
|
+
await cli_1.cli.open(version.diff_public_url);
|
|
70
41
|
}
|
|
71
42
|
}
|
|
72
43
|
else {
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
async waitChangesResult(versionId, token, opts) {
|
|
77
|
-
const diffResponse = await this.bump.getVersion(versionId, token);
|
|
78
|
-
if (opts.timeout <= 0) {
|
|
79
|
-
throw new errors_1.CLIError('We were unable to compute your documentation diff. Sorry about that. Please try again later');
|
|
80
|
-
}
|
|
81
|
-
switch (diffResponse.status) {
|
|
82
|
-
case 200:
|
|
83
|
-
const version = diffResponse.data;
|
|
84
|
-
this.d(`Received version:`);
|
|
85
|
-
this.d(version);
|
|
86
|
-
return version;
|
|
87
|
-
break;
|
|
88
|
-
case 202:
|
|
89
|
-
this.d('Waiting 1 sec before next pool');
|
|
90
|
-
await this.pollingDelay();
|
|
91
|
-
return await this.waitChangesResult(versionId, token, {
|
|
92
|
-
timeout: opts.timeout - 1,
|
|
93
|
-
});
|
|
94
|
-
break;
|
|
44
|
+
await cli_1.cli.log('No structural changes detected.');
|
|
95
45
|
}
|
|
96
|
-
return {};
|
|
97
46
|
}
|
|
98
47
|
}
|
|
99
48
|
exports.default = Diff;
|
package/lib/commands/preview.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
const definition_1 = require("../definition");
|
|
4
5
|
const command_1 = (0, tslib_1.__importDefault)(require("../command"));
|
|
5
6
|
const flags = (0, tslib_1.__importStar)(require("../flags"));
|
|
6
7
|
const args_1 = require("../args");
|
|
@@ -19,7 +20,9 @@ class Preview extends command_1.default {
|
|
|
19
20
|
return;
|
|
20
21
|
}
|
|
21
22
|
async preview(file, open = false, currentPreview = undefined) {
|
|
22
|
-
const
|
|
23
|
+
const api = await definition_1.API.load(file);
|
|
24
|
+
const [definition, references] = api.extractDefinition();
|
|
25
|
+
this.d(`${file} looks like an ${api.specName} spec version ${api.version}`);
|
|
23
26
|
if (!currentPreview) {
|
|
24
27
|
cli_1.cli.action.start("* Let's render a preview on Bump");
|
|
25
28
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as Config from '@oclif/config';
|
|
2
|
+
import { BumpApi } from '../api';
|
|
3
|
+
import { VersionResponse } from '../api/models';
|
|
4
|
+
export declare class Diff {
|
|
5
|
+
_bump: BumpApi;
|
|
6
|
+
_config: Config.IConfig;
|
|
7
|
+
constructor(config: Config.IConfig);
|
|
8
|
+
run(file1: string, file2: string | undefined, documentation: string, hub: string | undefined, token: string): Promise<VersionResponse | undefined>;
|
|
9
|
+
get bumpClient(): BumpApi;
|
|
10
|
+
get pollingPeriod(): number;
|
|
11
|
+
createVersion(file: string, documentation: string, token: string, hub: string | undefined, previous_version_id?: string | undefined): Promise<VersionResponse | undefined>;
|
|
12
|
+
waitResult(versionId: string, token: string, opts: {
|
|
13
|
+
timeout: number;
|
|
14
|
+
}): Promise<VersionResponse>;
|
|
15
|
+
pollingDelay(): Promise<void>;
|
|
16
|
+
private delay;
|
|
17
|
+
d(formatter: any, ...args: any[]): void;
|
|
18
|
+
}
|
package/lib/core/diff.js
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Diff = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const errors_1 = require("@oclif/errors");
|
|
6
|
+
const debug_1 = (0, tslib_1.__importDefault)(require("debug"));
|
|
7
|
+
const definition_1 = require("../definition");
|
|
8
|
+
const api_1 = require("../api");
|
|
9
|
+
class Diff {
|
|
10
|
+
constructor(config) {
|
|
11
|
+
this._config = config;
|
|
12
|
+
}
|
|
13
|
+
async run(file1, file2, documentation, hub, token) {
|
|
14
|
+
const version = await this.createVersion(file1, documentation, token, hub);
|
|
15
|
+
let diffVersion = undefined;
|
|
16
|
+
if (file2) {
|
|
17
|
+
diffVersion = await this.createVersion(file2, documentation, token, hub, version && version.id);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
diffVersion = version;
|
|
21
|
+
}
|
|
22
|
+
if (diffVersion) {
|
|
23
|
+
diffVersion = await this.waitResult(diffVersion.id, token, {
|
|
24
|
+
timeout: 30,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return diffVersion;
|
|
28
|
+
}
|
|
29
|
+
get bumpClient() {
|
|
30
|
+
if (!this._bump)
|
|
31
|
+
this._bump = new api_1.BumpApi(this._config);
|
|
32
|
+
return this._bump;
|
|
33
|
+
}
|
|
34
|
+
get pollingPeriod() {
|
|
35
|
+
return 1000;
|
|
36
|
+
}
|
|
37
|
+
async createVersion(file, documentation, token, hub, previous_version_id = undefined) {
|
|
38
|
+
const api = await definition_1.API.load(file);
|
|
39
|
+
const [definition, references] = api.extractDefinition();
|
|
40
|
+
const request = {
|
|
41
|
+
documentation,
|
|
42
|
+
hub,
|
|
43
|
+
definition,
|
|
44
|
+
references,
|
|
45
|
+
unpublished: true,
|
|
46
|
+
previous_version_id,
|
|
47
|
+
};
|
|
48
|
+
const response = await this.bumpClient.postVersion(request, token);
|
|
49
|
+
switch (response.status) {
|
|
50
|
+
case 201:
|
|
51
|
+
this.d(`Unpublished version created with ID ${response.data.id}`);
|
|
52
|
+
return response.data;
|
|
53
|
+
break;
|
|
54
|
+
case 204:
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
async waitResult(versionId, token, opts) {
|
|
60
|
+
const diffResponse = await this.bumpClient.getVersion(versionId, token);
|
|
61
|
+
if (opts.timeout <= 0) {
|
|
62
|
+
throw new errors_1.CLIError('We were unable to compute your documentation diff. Sorry about that. Please try again later');
|
|
63
|
+
}
|
|
64
|
+
switch (diffResponse.status) {
|
|
65
|
+
case 200:
|
|
66
|
+
const version = diffResponse.data;
|
|
67
|
+
this.d(`Received version:`);
|
|
68
|
+
this.d(version);
|
|
69
|
+
return version;
|
|
70
|
+
break;
|
|
71
|
+
case 202:
|
|
72
|
+
this.d('Waiting 1 sec before next pool');
|
|
73
|
+
await this.pollingDelay();
|
|
74
|
+
return await this.waitResult(versionId, token, {
|
|
75
|
+
timeout: opts.timeout - 1,
|
|
76
|
+
});
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
return {};
|
|
80
|
+
}
|
|
81
|
+
async pollingDelay() {
|
|
82
|
+
return await this.delay(this.pollingPeriod);
|
|
83
|
+
}
|
|
84
|
+
async delay(ms) {
|
|
85
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
86
|
+
}
|
|
87
|
+
// Function signature type taken from @types/debug
|
|
88
|
+
// Debugger(formatter: any, ...args: any[]): void;
|
|
89
|
+
/* eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any */
|
|
90
|
+
d(formatter, ...args) {
|
|
91
|
+
return (0, debug_1.default)(`bump-cli:core:diff`)(formatter, ...args);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.Diff = Diff;
|
package/lib/definition.d.ts
CHANGED
|
@@ -17,7 +17,8 @@ declare class API {
|
|
|
17
17
|
resolveContent($refs: $RefParser.$Refs): [string, APIDefinition];
|
|
18
18
|
static isOpenAPI(definition: JSONSchema4Object | JSONSchema6Object): definition is OpenAPI;
|
|
19
19
|
static isAsyncAPI(definition: JSONSchema4Object | JSONSchema6Object): definition is AsyncAPI;
|
|
20
|
-
|
|
20
|
+
extractDefinition(): [string, APIReference[]];
|
|
21
|
+
static load(path: string): Promise<API>;
|
|
21
22
|
}
|
|
22
23
|
declare type APIReference = {
|
|
23
24
|
location: string;
|
package/lib/definition.js
CHANGED
|
@@ -129,7 +129,18 @@ class API {
|
|
|
129
129
|
static isAsyncAPI(definition) {
|
|
130
130
|
return 'asyncapi' in definition;
|
|
131
131
|
}
|
|
132
|
-
|
|
132
|
+
extractDefinition() {
|
|
133
|
+
const references = [];
|
|
134
|
+
for (let i = 0; i < this.references.length; i++) {
|
|
135
|
+
const reference = this.references[i];
|
|
136
|
+
references.push({
|
|
137
|
+
location: reference.location,
|
|
138
|
+
content: reference.content,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
return [this.rawDefinition, references];
|
|
142
|
+
}
|
|
143
|
+
static async load(path) {
|
|
133
144
|
const JSONParser = options_1.defaults.parse.json;
|
|
134
145
|
const YAMLParser = options_1.defaults.parse.yaml;
|
|
135
146
|
const TextParser = options_1.defaults.parse.text;
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -4,8 +4,8 @@ exports.Preview = exports.Diff = exports.Deploy = exports.run = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const command_1 = require("@oclif/command");
|
|
6
6
|
Object.defineProperty(exports, "run", { enumerable: true, get: function () { return command_1.run; } });
|
|
7
|
-
const diff_1 =
|
|
8
|
-
exports
|
|
7
|
+
const diff_1 = require("./core/diff");
|
|
8
|
+
Object.defineProperty(exports, "Diff", { enumerable: true, get: function () { return diff_1.Diff; } });
|
|
9
9
|
const deploy_1 = (0, tslib_1.__importDefault)(require("./commands/deploy"));
|
|
10
10
|
exports.Deploy = deploy_1.default;
|
|
11
11
|
const preview_1 = (0, tslib_1.__importDefault)(require("./commands/preview"));
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"2.
|
|
1
|
+
{"version":"2.3.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"},"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.0 to 2.2) 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 * Let's compare 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 * Let's compare 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 * Let's compare 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 * Let's compare 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":true},"hub":{"name":"hub","type":"option","char":"b","description":"Hub id or slug. Can be provided via BUMP_HUB_ID environment variable"},"token":{"name":"token","type":"option","char":"t","description":"Documentation or Hub token. Can be provided via BUMP_TOKEN environment variable","required":true},"open":{"name":"open","type":"boolean","char":"o","description":"Open the visual diff 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.0 to 2.2) 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.0 to 2.2) specifications are currently supported.","required":true}]}}}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bump-cli",
|
|
3
3
|
"description": "The Bump CLI is used to interact with your API documentation hosted on Bump by using the API of developers.bump.sh",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.3.0",
|
|
5
5
|
"author": "Paul Bonaud <paulr@bump.sh>",
|
|
6
6
|
"bin": {
|
|
7
7
|
"bump": "./bin/run"
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"bugs": "https://github.com/bump-sh/cli/issues",
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"@oclif/dev-cli": "^1.26.0",
|
|
12
|
-
"@oclif/test": "^
|
|
12
|
+
"@oclif/test": "^2.0.3",
|
|
13
13
|
"@types/debug": "^4.1.5",
|
|
14
14
|
"@types/mocha": "^9.0.0",
|
|
15
|
-
"@types/node": "^
|
|
15
|
+
"@types/node": "^17.0.4",
|
|
16
16
|
"@typescript-eslint/eslint-plugin": "^4.21.0",
|
|
17
17
|
"@typescript-eslint/parser": "^4.21.0",
|
|
18
18
|
"chai": "^4.3.4",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"np": "^7.5.0",
|
|
27
27
|
"nyc": "^15.1.0",
|
|
28
28
|
"prettier": "^2.2.1",
|
|
29
|
-
"sinon": "^
|
|
29
|
+
"sinon": "^12.0.1",
|
|
30
30
|
"stdout-stderr": "^0.1.13",
|
|
31
31
|
"ts-node": "^10.0.0",
|
|
32
32
|
"typescript": "^4.3.3"
|
|
@@ -80,10 +80,10 @@
|
|
|
80
80
|
"@asyncapi/specs": "^2.9.0",
|
|
81
81
|
"@oclif/command": "^1.8.0",
|
|
82
82
|
"@oclif/config": "^1.17.0",
|
|
83
|
-
"@oclif/plugin-help": "^
|
|
83
|
+
"@oclif/plugin-help": "^5.1.10",
|
|
84
84
|
"async-mutex": "^0.3.2",
|
|
85
|
-
"axios": "^0.
|
|
86
|
-
"cli-ux": "^
|
|
85
|
+
"axios": "^0.24.0",
|
|
86
|
+
"cli-ux": "^6.0.7",
|
|
87
87
|
"debug": "^4.3.1",
|
|
88
88
|
"oas-schemas": "git+https://git@github.com/OAI/OpenAPI-Specification.git#0f9d3ec7c033fef184ec54e1ffc201b2d61ce023",
|
|
89
89
|
"tslib": "^2.3.0"
|