bump-cli 2.3.3 → 2.4.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/README.md +27 -1
- package/lib/api/error.js +1 -1
- package/lib/api/index.d.ts +1 -1
- package/lib/api/index.js +4 -2
- package/lib/api/models.d.ts +3 -1
- package/lib/cli/index.d.ts +13 -12
- package/lib/cli/index.js +3 -3
- package/lib/commands/deploy.d.ts +1 -0
- package/lib/commands/deploy.js +2 -0
- package/lib/commands/diff.d.ts +1 -0
- package/lib/commands/diff.js +17 -7
- package/lib/core/diff.d.ts +3 -2
- package/lib/core/diff.js +8 -5
- package/lib/definition.js +1 -0
- package/lib/flags.d.ts +2 -1
- package/lib/flags.js +12 -2
- package/oclif.manifest.json +1 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -110,6 +110,32 @@ Please check `bump deploy --help` for more usage details
|
|
|
110
110
|
|
|
111
111
|
_If you want to receive automatic `bump diff` results on your Github Pull Requests you might be interested by [our Github Action](https://github.com/marketplace/actions/api-documentation-on-bump#api-diff-on-pull-requests) diff command._
|
|
112
112
|
|
|
113
|
+
#### Public API diffs
|
|
114
|
+
|
|
115
|
+
From any two definition files or URLs, you can retrieve a comprehensive changelog of what has changed between them.
|
|
116
|
+
|
|
117
|
+
```sh-session
|
|
118
|
+
$ bump diff path/to/your/file.yml path/to/your/second_file.yml
|
|
119
|
+
* Comparing the two given definition files... done
|
|
120
|
+
Modified: GET /consommations
|
|
121
|
+
Response modified: 200
|
|
122
|
+
[Breaking] Body attribute modified: energie
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Or from two URLs:
|
|
126
|
+
|
|
127
|
+
```sh-session
|
|
128
|
+
$ bump diff https://demo.bump.sh/doc/trips-books/changes/bfec0a43-b870-44da-9e07-60c8955e15d5.json https://demo.bump.sh/doc/trips-books.json
|
|
129
|
+
* Comparing the two given definition files... done
|
|
130
|
+
Modified: POST /books
|
|
131
|
+
Response modified: 200
|
|
132
|
+
[Breaking] Body attribute removed: cent
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
_Note: You can also test this feature in our dedicated web application at <https://api-diff.io/>._
|
|
136
|
+
|
|
137
|
+
#### Authenticated diffs attached to your Bump documentation
|
|
138
|
+
|
|
113
139
|
From a Bump documentation, the `diff` command will retrieve a comparaison changelog between your existing documentation and the given file or URL:
|
|
114
140
|
|
|
115
141
|
```sh-session
|
|
@@ -136,7 +162,7 @@ Please check `bump diff --help` for full usage details.
|
|
|
136
162
|
|
|
137
163
|
## Development
|
|
138
164
|
|
|
139
|
-
Make sure to have Node.js (At least
|
|
165
|
+
Make sure to have Node.js (At least v14) installed on your machine.
|
|
140
166
|
|
|
141
167
|
- Install node dependencies with
|
|
142
168
|
|
package/lib/api/error.js
CHANGED
|
@@ -26,7 +26,7 @@ class APIError extends errors_1.CLIError {
|
|
|
26
26
|
super(info.join('\n'));
|
|
27
27
|
}
|
|
28
28
|
else {
|
|
29
|
-
super(`Unhandled API error (status: ${status})`);
|
|
29
|
+
super(`Unhandled API error (status: ${status}) (error: ${httpError})`);
|
|
30
30
|
}
|
|
31
31
|
this.exitCode = exit;
|
|
32
32
|
this.http = httpError;
|
package/lib/api/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ declare class BumpApi {
|
|
|
12
12
|
putPreview: (versionId: string, body?: PreviewRequest | undefined) => Promise<AxiosResponse<PreviewResponse>>;
|
|
13
13
|
postVersion: (body: VersionRequest, token: string) => Promise<AxiosResponse<VersionResponse>>;
|
|
14
14
|
postDiff: (body: DiffRequest) => Promise<AxiosResponse<DiffResponse>>;
|
|
15
|
-
getDiff: (diffId: string) => Promise<AxiosResponse<DiffResponse>>;
|
|
15
|
+
getDiff: (diffId: string, format: string) => Promise<AxiosResponse<DiffResponse>>;
|
|
16
16
|
postValidation: (body: VersionRequest, token: string) => Promise<AxiosResponse<void>>;
|
|
17
17
|
private initializeResponseInterceptor;
|
|
18
18
|
private handleError;
|
package/lib/api/index.js
CHANGED
|
@@ -32,8 +32,10 @@ class BumpApi {
|
|
|
32
32
|
this.postDiff = (body) => {
|
|
33
33
|
return this.client.post('/diffs', body);
|
|
34
34
|
};
|
|
35
|
-
this.getDiff = (diffId) => {
|
|
36
|
-
return this.client.get(`/diffs/${diffId}
|
|
35
|
+
this.getDiff = (diffId, format) => {
|
|
36
|
+
return this.client.get(`/diffs/${diffId}`, {
|
|
37
|
+
params: { formats: [format] },
|
|
38
|
+
});
|
|
37
39
|
};
|
|
38
40
|
this.postValidation = (body, token) => {
|
|
39
41
|
return this.client.post('/validations', body, {
|
package/lib/api/models.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export interface VersionRequest {
|
|
|
29
29
|
references?: Reference[];
|
|
30
30
|
unpublished?: boolean;
|
|
31
31
|
previous_version_id?: string;
|
|
32
|
+
branch_name?: string;
|
|
32
33
|
}
|
|
33
34
|
export interface VersionResponse {
|
|
34
35
|
id: string;
|
|
@@ -50,10 +51,11 @@ export interface DiffRequest {
|
|
|
50
51
|
export interface DiffResponse {
|
|
51
52
|
id: string;
|
|
52
53
|
public_url?: string;
|
|
54
|
+
breaking?: boolean;
|
|
53
55
|
text?: string;
|
|
54
56
|
markdown?: string;
|
|
55
57
|
details?: DiffItem[];
|
|
56
|
-
|
|
58
|
+
html?: string;
|
|
57
59
|
}
|
|
58
60
|
export interface DiffItem {
|
|
59
61
|
id: string;
|
package/lib/cli/index.d.ts
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
+
import { CliUx } from '@oclif/core';
|
|
1
2
|
import success from './styled/success';
|
|
2
3
|
declare const cli: {
|
|
3
4
|
styledSuccess: typeof success;
|
|
4
|
-
config:
|
|
5
|
+
config: CliUx.Config;
|
|
5
6
|
warn: typeof import("@oclif/core/lib/errors").warn;
|
|
6
7
|
error: typeof import("@oclif/core/lib/errors").error;
|
|
7
8
|
exit: typeof import("@oclif/core/lib/errors").exit;
|
|
8
|
-
prompt: typeof import("cli-ux/
|
|
9
|
-
anykey: typeof import("cli-ux/
|
|
10
|
-
confirm: typeof import("cli-ux/
|
|
11
|
-
action:
|
|
12
|
-
prideAction:
|
|
9
|
+
prompt: typeof import("@oclif/core/lib/cli-ux/prompt").prompt;
|
|
10
|
+
anykey: typeof import("@oclif/core/lib/cli-ux/prompt").anykey;
|
|
11
|
+
confirm: typeof import("@oclif/core/lib/cli-ux/prompt").confirm;
|
|
12
|
+
action: CliUx.ActionBase;
|
|
13
|
+
prideAction: CliUx.ActionBase;
|
|
13
14
|
styledObject(obj: any, keys?: string[] | undefined): void;
|
|
14
|
-
styledHeader: typeof import("cli-ux/
|
|
15
|
-
styledJSON: typeof import("cli-ux/
|
|
16
|
-
table: typeof
|
|
17
|
-
tree: typeof import("cli-ux/
|
|
18
|
-
open: typeof import("cli-ux/
|
|
15
|
+
styledHeader: typeof import("@oclif/core/lib/cli-ux/styled/header").default;
|
|
16
|
+
styledJSON: typeof import("@oclif/core/lib/cli-ux/styled/json").default;
|
|
17
|
+
table: typeof CliUx.Table.table;
|
|
18
|
+
tree: typeof import("@oclif/core/lib/cli-ux/styled/tree").default;
|
|
19
|
+
open: typeof import("@oclif/core/lib/cli-ux/open").default;
|
|
19
20
|
wait: (ms?: number | undefined) => Promise<unknown>;
|
|
20
|
-
progress: typeof import("cli-ux/
|
|
21
|
+
progress: typeof import("@oclif/core/lib/cli-ux/styled/progress").default;
|
|
21
22
|
done(): Promise<void>;
|
|
22
23
|
trace(format: string, ...args: string[]): void;
|
|
23
24
|
debug(format: string, ...args: string[]): void;
|
package/lib/cli/index.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.cli = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
6
|
const success_1 = (0, tslib_1.__importDefault)(require("./styled/success"));
|
|
7
7
|
if (process.env.BUMP_LOG_LEVEL) {
|
|
8
8
|
const logLevel = process.env.BUMP_LOG_LEVEL;
|
|
9
|
-
|
|
9
|
+
core_1.CliUx.config['outputLevel'] = logLevel;
|
|
10
10
|
}
|
|
11
|
-
const cli = Object.assign(Object.assign({},
|
|
11
|
+
const cli = Object.assign(Object.assign({}, core_1.CliUx.ux), { get styledSuccess() {
|
|
12
12
|
return success_1.default;
|
|
13
13
|
} });
|
|
14
14
|
exports.cli = cli;
|
package/lib/commands/deploy.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export default class Deploy extends Command {
|
|
|
8
8
|
doc: flags.IOptionFlag<string | undefined>;
|
|
9
9
|
'doc-name': flags.IOptionFlag<string | undefined>;
|
|
10
10
|
hub: flags.IOptionFlag<string | undefined>;
|
|
11
|
+
branch: flags.IOptionFlag<string | undefined>;
|
|
11
12
|
token: flags.IOptionFlag<string | undefined>;
|
|
12
13
|
'auto-create': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
13
14
|
'dry-run': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
package/lib/commands/deploy.js
CHANGED
|
@@ -29,6 +29,7 @@ class Deploy extends command_1.default {
|
|
|
29
29
|
auto_create_documentation: flags['auto-create'] && !flags['dry-run'],
|
|
30
30
|
definition,
|
|
31
31
|
references,
|
|
32
|
+
branch_name: flags.branch,
|
|
32
33
|
};
|
|
33
34
|
const response = flags['dry-run']
|
|
34
35
|
? await this.bump.postValidation(request, token)
|
|
@@ -78,6 +79,7 @@ Deploy.flags = {
|
|
|
78
79
|
doc: flags.doc(),
|
|
79
80
|
'doc-name': flags.docName(),
|
|
80
81
|
hub: flags.hub(),
|
|
82
|
+
branch: flags.branch(),
|
|
81
83
|
token: flags.token(),
|
|
82
84
|
'auto-create': flags.autoCreate(),
|
|
83
85
|
'dry-run': flags.dryRun(),
|
package/lib/commands/diff.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export default class Diff extends Command {
|
|
|
8
8
|
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
|
|
9
9
|
doc: flags.IOptionFlag<string | undefined>;
|
|
10
10
|
hub: flags.IOptionFlag<string | undefined>;
|
|
11
|
+
branch: flags.IOptionFlag<string | undefined>;
|
|
11
12
|
token: flags.IOptionFlag<string | undefined>;
|
|
12
13
|
open: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
13
14
|
format: flags.IOptionFlag<string | undefined>;
|
package/lib/commands/diff.js
CHANGED
|
@@ -16,8 +16,17 @@ class Diff extends command_1.default {
|
|
|
16
16
|
*/
|
|
17
17
|
async run() {
|
|
18
18
|
const { args, flags } = this.parse(Diff);
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
/* Flags.format has a default value, so it's always defined. But
|
|
20
|
+
* oclif types doesn't detect it */
|
|
21
|
+
const [documentation, hub, branch, token, format] = [
|
|
22
|
+
flags.doc,
|
|
23
|
+
flags.hub,
|
|
24
|
+
flags.branch,
|
|
25
|
+
flags.token,
|
|
26
|
+
/* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */
|
|
27
|
+
flags.format,
|
|
28
|
+
];
|
|
29
|
+
if (format === 'text') {
|
|
21
30
|
if (args.FILE2) {
|
|
22
31
|
cli_1.cli.action.start('* Comparing the two given definition files');
|
|
23
32
|
}
|
|
@@ -28,13 +37,10 @@ class Diff extends command_1.default {
|
|
|
28
37
|
if (!args.FILE2 && (!documentation || !token)) {
|
|
29
38
|
throw new errors_1.CLIError('Please provide a second file argument or login with an existing token');
|
|
30
39
|
}
|
|
31
|
-
const diff = await new diff_1.Diff(this.config).run(args.FILE, args.FILE2, documentation, hub, token);
|
|
40
|
+
const diff = await new diff_1.Diff(this.config).run(args.FILE, args.FILE2, documentation, hub, branch, token, format);
|
|
32
41
|
cli_1.cli.action.stop();
|
|
33
42
|
if (diff) {
|
|
34
|
-
|
|
35
|
-
* oclif types can"t detect it */
|
|
36
|
-
/* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */
|
|
37
|
-
await this.displayCompareResult(diff, flags.format, flags.open);
|
|
43
|
+
await this.displayCompareResult(diff, format, flags.open);
|
|
38
44
|
}
|
|
39
45
|
else {
|
|
40
46
|
await cli_1.cli.log('No changes detected.');
|
|
@@ -51,6 +57,9 @@ class Diff extends command_1.default {
|
|
|
51
57
|
else if (format == 'json' && result.details) {
|
|
52
58
|
await cli_1.cli.log(JSON.stringify(result.details, null, 2));
|
|
53
59
|
}
|
|
60
|
+
else if (format == 'html' && result.html) {
|
|
61
|
+
await cli_1.cli.log(result.html);
|
|
62
|
+
}
|
|
54
63
|
else {
|
|
55
64
|
await cli_1.cli.log('No structural changes detected.');
|
|
56
65
|
}
|
|
@@ -96,6 +105,7 @@ Diff.flags = {
|
|
|
96
105
|
help: flags.help({ char: 'h' }),
|
|
97
106
|
doc: flags.doc({ required: false }),
|
|
98
107
|
hub: flags.hub(),
|
|
108
|
+
branch: flags.branch(),
|
|
99
109
|
token: flags.token({ required: false }),
|
|
100
110
|
open: flags.open({ description: 'Open the visual diff in your browser' }),
|
|
101
111
|
format: flags.format(),
|
package/lib/core/diff.d.ts
CHANGED
|
@@ -5,13 +5,14 @@ export declare class Diff {
|
|
|
5
5
|
_bump: BumpApi;
|
|
6
6
|
_config: Config.IConfig;
|
|
7
7
|
constructor(config: Config.IConfig);
|
|
8
|
-
run(file1: string, file2: string | undefined, documentation: string | undefined, hub: string | undefined, token: string | undefined): Promise<DiffResponse | undefined>;
|
|
8
|
+
run(file1: string, file2: string | undefined, documentation: string | undefined, hub: string | undefined, branch: string | undefined, token: string | undefined, format: string): Promise<DiffResponse | undefined>;
|
|
9
9
|
get bumpClient(): BumpApi;
|
|
10
10
|
get pollingPeriod(): number;
|
|
11
11
|
createDiff(file1: string, file2: string): Promise<DiffResponse | undefined>;
|
|
12
|
-
createVersion(file: string, documentation: string, token: string, hub: string | undefined, previous_version_id?: string | undefined): Promise<VersionResponse | undefined>;
|
|
12
|
+
createVersion(file: string, documentation: string, token: string, hub: string | undefined, branch_name: string | undefined, previous_version_id?: string | undefined): Promise<VersionResponse | undefined>;
|
|
13
13
|
waitResult(result: VersionResponse | DiffResponse, token: string | undefined, opts: {
|
|
14
14
|
timeout: number;
|
|
15
|
+
format: string;
|
|
15
16
|
}): Promise<DiffResponse>;
|
|
16
17
|
pollingDelay(): Promise<void>;
|
|
17
18
|
private delay;
|
package/lib/core/diff.js
CHANGED
|
@@ -10,7 +10,7 @@ class Diff {
|
|
|
10
10
|
constructor(config) {
|
|
11
11
|
this._config = config;
|
|
12
12
|
}
|
|
13
|
-
async run(file1, file2, documentation, hub, token) {
|
|
13
|
+
async run(file1, file2, documentation, hub, branch, token, format) {
|
|
14
14
|
let diffVersion = undefined;
|
|
15
15
|
if (file2 && (!documentation || !token)) {
|
|
16
16
|
diffVersion = await this.createDiff(file1, file2);
|
|
@@ -19,14 +19,15 @@ class Diff {
|
|
|
19
19
|
if (!documentation || !token) {
|
|
20
20
|
throw new Error('Please login to bump (with documentation & token) when using a single file argument');
|
|
21
21
|
}
|
|
22
|
-
diffVersion = await this.createVersion(file1, documentation, token, hub);
|
|
22
|
+
diffVersion = await this.createVersion(file1, documentation, token, hub, branch);
|
|
23
23
|
if (file2) {
|
|
24
|
-
diffVersion = await this.createVersion(file2, documentation, token, hub, diffVersion && diffVersion.id);
|
|
24
|
+
diffVersion = await this.createVersion(file2, documentation, token, hub, branch, diffVersion && diffVersion.id);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
if (diffVersion) {
|
|
28
28
|
return await this.waitResult(diffVersion, token, {
|
|
29
29
|
timeout: 30,
|
|
30
|
+
format,
|
|
30
31
|
});
|
|
31
32
|
}
|
|
32
33
|
else {
|
|
@@ -64,7 +65,7 @@ class Diff {
|
|
|
64
65
|
}
|
|
65
66
|
return;
|
|
66
67
|
}
|
|
67
|
-
async createVersion(file, documentation, token, hub, previous_version_id = undefined) {
|
|
68
|
+
async createVersion(file, documentation, token, hub, branch_name, previous_version_id = undefined) {
|
|
68
69
|
const api = await definition_1.API.load(file);
|
|
69
70
|
const [definition, references] = api.extractDefinition();
|
|
70
71
|
const request = {
|
|
@@ -74,6 +75,7 @@ class Diff {
|
|
|
74
75
|
references,
|
|
75
76
|
unpublished: true,
|
|
76
77
|
previous_version_id,
|
|
78
|
+
branch_name,
|
|
77
79
|
};
|
|
78
80
|
const response = await this.bumpClient.postVersion(request, token);
|
|
79
81
|
switch (response.status) {
|
|
@@ -92,7 +94,7 @@ class Diff {
|
|
|
92
94
|
pollingResponse = await this.bumpClient.getVersion(result.id, token);
|
|
93
95
|
}
|
|
94
96
|
else {
|
|
95
|
-
pollingResponse = await this.bumpClient.getDiff(result.id);
|
|
97
|
+
pollingResponse = await this.bumpClient.getDiff(result.id, opts.format);
|
|
96
98
|
}
|
|
97
99
|
if (opts.timeout <= 0) {
|
|
98
100
|
throw new errors_1.CLIError('We were unable to compute your documentation diff. Sorry about that. Please try again later');
|
|
@@ -112,6 +114,7 @@ class Diff {
|
|
|
112
114
|
await this.pollingDelay();
|
|
113
115
|
return await this.waitResult(result, token, {
|
|
114
116
|
timeout: opts.timeout - 1,
|
|
117
|
+
format: opts.format,
|
|
115
118
|
});
|
|
116
119
|
break;
|
|
117
120
|
}
|
package/lib/definition.js
CHANGED
|
@@ -19,6 +19,7 @@ SupportedFormat.asyncapi = {
|
|
|
19
19
|
'2.1': specs_1.default['2.1.0'],
|
|
20
20
|
'2.2': specs_1.default['2.2.0'],
|
|
21
21
|
'2.3': specs_1.default['2.3.0'],
|
|
22
|
+
'2.4': specs_1.default['2.4.0'],
|
|
22
23
|
};
|
|
23
24
|
class UnsupportedFormat extends errors_1.CLIError {
|
|
24
25
|
constructor(message = '') {
|
package/lib/flags.d.ts
CHANGED
|
@@ -4,10 +4,11 @@ export * from '@oclif/command/lib/flags';
|
|
|
4
4
|
declare const doc: flags.Definition<string>;
|
|
5
5
|
declare const docName: flags.Definition<string>;
|
|
6
6
|
declare const hub: flags.Definition<string>;
|
|
7
|
+
declare const branch: flags.Definition<string>;
|
|
7
8
|
declare const token: flags.Definition<string>;
|
|
8
9
|
declare const autoCreate: (options?: {}) => Parser.flags.IBooleanFlag<boolean>;
|
|
9
10
|
declare const dryRun: (options?: {}) => Parser.flags.IBooleanFlag<boolean>;
|
|
10
11
|
declare const open: (options?: {}) => Parser.flags.IBooleanFlag<boolean>;
|
|
11
12
|
declare const live: (options?: {}) => Parser.flags.IBooleanFlag<boolean>;
|
|
12
13
|
declare const format: flags.Definition<string>;
|
|
13
|
-
export { doc, docName, hub, token, autoCreate, dryRun, open, live, format };
|
|
14
|
+
export { doc, docName, hub, branch, token, autoCreate, dryRun, open, live, format };
|
package/lib/flags.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.format = exports.live = exports.open = exports.dryRun = exports.autoCreate = exports.token = exports.hub = exports.docName = exports.doc = void 0;
|
|
3
|
+
exports.format = exports.live = exports.open = exports.dryRun = exports.autoCreate = exports.token = exports.branch = exports.hub = exports.docName = exports.doc = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const command_1 = require("@oclif/command");
|
|
6
6
|
// Re-export oclif flags https://oclif.io/docs/flags
|
|
@@ -35,6 +35,16 @@ const hub = command_1.flags.build({
|
|
|
35
35
|
},
|
|
36
36
|
});
|
|
37
37
|
exports.hub = hub;
|
|
38
|
+
const branch = command_1.flags.build({
|
|
39
|
+
char: 'B',
|
|
40
|
+
description: 'Branch name. Can be provided via BUMP_BRANCH_NAME environment variable',
|
|
41
|
+
default: () => {
|
|
42
|
+
const envBranch = process.env.BUMP_BRANCH_NAME;
|
|
43
|
+
if (envBranch)
|
|
44
|
+
return envBranch;
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
exports.branch = branch;
|
|
38
48
|
const token = command_1.flags.build({
|
|
39
49
|
char: 't',
|
|
40
50
|
required: true,
|
|
@@ -66,6 +76,6 @@ const format = command_1.flags.build({
|
|
|
66
76
|
char: 'f',
|
|
67
77
|
description: 'Format in which to provide the diff result',
|
|
68
78
|
default: 'text',
|
|
69
|
-
options: ['text', 'markdown', 'json'],
|
|
79
|
+
options: ['text', 'markdown', 'json', 'html'],
|
|
70
80
|
});
|
|
71
81
|
exports.format = format;
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"2.
|
|
1
|
+
{"version":"2.4.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"}},"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}]}}}
|
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.4.0",
|
|
5
5
|
"author": "Paul Bonaud <paulr@bump.sh>",
|
|
6
6
|
"bin": {
|
|
7
7
|
"bump": "./bin/run"
|
|
@@ -21,18 +21,18 @@
|
|
|
21
21
|
"eslint-config-prettier": "^8.1.0",
|
|
22
22
|
"eslint-plugin-prettier": "^4.0.0",
|
|
23
23
|
"globby": "^11.0.3",
|
|
24
|
-
"mocha": "^
|
|
24
|
+
"mocha": "^10.0.0",
|
|
25
25
|
"nock": "^13.0.11",
|
|
26
26
|
"np": "^7.5.0",
|
|
27
27
|
"nyc": "^15.1.0",
|
|
28
28
|
"prettier": "^2.2.1",
|
|
29
|
-
"sinon": "^
|
|
29
|
+
"sinon": "^14.0.0",
|
|
30
30
|
"stdout-stderr": "^0.1.13",
|
|
31
31
|
"ts-node": "^10.0.0",
|
|
32
32
|
"typescript": "^4.3.3"
|
|
33
33
|
},
|
|
34
34
|
"engines": {
|
|
35
|
-
"node": ">=
|
|
35
|
+
"node": ">=14.0.0"
|
|
36
36
|
},
|
|
37
37
|
"files": [
|
|
38
38
|
"/bin",
|
|
@@ -77,13 +77,13 @@
|
|
|
77
77
|
"types": "lib/index.d.ts",
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"@apidevtools/json-schema-ref-parser": "^9.0.7",
|
|
80
|
-
"@asyncapi/specs": "^
|
|
81
|
-
"@oclif/command": "^1.8.
|
|
80
|
+
"@asyncapi/specs": "^3.0.0",
|
|
81
|
+
"@oclif/command": "^1.8.16",
|
|
82
82
|
"@oclif/config": "^1.17.0",
|
|
83
|
+
"@oclif/core": "^1.3.3",
|
|
83
84
|
"@oclif/plugin-help": "^5.1.10",
|
|
84
85
|
"async-mutex": "^0.3.2",
|
|
85
|
-
"axios": "^0.
|
|
86
|
-
"cli-ux": "^6.0.7",
|
|
86
|
+
"axios": "^0.27.2",
|
|
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"
|