bump-cli 2.9.11 → 2.10.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 CHANGED
@@ -9,15 +9,21 @@
9
9
  <a href="https://bump.sh/users/sign_up">Sign up</a>
10
10
  </p>
11
11
 
12
- The Bump.sh CLI is used to interact with API documentation and hubs hosted on Bump.sh from your choice of popular API description formats: OpenAPI, Swagger, or AsyncAPI.
12
+ The Bump.sh CLI is used to interact with API documentation, hubs and workflows hosted on Bump.sh from your choice of popular API description formats: OpenAPI, Swagger, or AsyncAPI for API documentation. Flower or Arazzo for API workflows.
13
13
 
14
14
  Using [OpenAPI](https://github.com/OAI/OpenAPI-Specification) (v3.x and v2.0) or [AsyncAPI](https://www.asyncapi.com/docs/reference/specification/latest) (2.x), you can do any of the following:
15
15
 
16
16
  - Validate an API document before publishing to your documentation.
17
- - Publish an API document to your Bump.sh documentation or hubs.
18
- - Compare two API documents to generate a human-readable diff from your API definition.
17
+ - [Publish an API document](#the-deploy-command) to your Bump.sh documentation or hubs.
18
+ - [Compare two API documents](#the-diff-command) to generate a human-readable diff from your API definition.
19
19
  Under the hood, it uses the API of [developers.bump.sh](https://developers.bump.sh). And is built with the [`oclif`](https://oclif.io) framework in Typescript.
20
20
 
21
+ Using [Flower](https://docs.bump.sh/help/mcp-servers/specification-support/flower-support/) or [Arazzo](https://docs.bump.sh/arazzo/v1.0/), you can:
22
+
23
+ - [Deploy a workflow document](#deploy-a-workflow-document-on-your-mcp-server) to your Bump.sh MCP server
24
+
25
+ Have fun designing APIs ✨.
26
+
21
27
  [![Version](https://img.shields.io/npm/v/bump-cli.svg)](https://npmjs.org/package/bump-cli)
22
28
  [![Tests](https://github.com/bump-sh/cli/actions/workflows/checks.yml/badge.svg)](https://github.com/bump-sh/cli/actions/workflows/checks.yml)
23
29
  [![License](https://img.shields.io/npm/l/bump-cli.svg)](https://github.com/bump-sh/cli/blob/master/package.json)
@@ -37,9 +43,9 @@ The Bump.sh CLI is a node package currently distributed via NPM. This means you
37
43
 
38
44
  _If you are looking to use Bump.sh in a continuous integration environment you might be interested by [our Github Action](https://github.com/marketplace/actions/bump-sh-api-documentation-changelog)._
39
45
 
46
+ > [!NOTE]
40
47
  > You can download a standalone package directly from the latest
41
48
  > Github release assets if you don’t use Node.
42
- {: .info}
43
49
 
44
50
  ### Global installation
45
51
 
@@ -124,8 +130,8 @@ When an API is updated, the documentation should be updated at the same time. Th
124
130
  bump deploy path/to/api-document.yml --doc my-documentation --token $DOC_TOKEN
125
131
  ```
126
132
 
127
- > You can find your own `my-documentation` slug and `$DOC_TOKEN` api key from your [documentation settings](https://bump.sh/docs).
128
- {: .info}
133
+ > [!TIP]
134
+ > You can find your own `my-documentation` slug and `$DOC_TOKEN` api key from your [documentation settings](https://bump.sh/dashboard).
129
135
 
130
136
  You can also deploy a given API document to a different branch of your documentation with the `--branch <branch-name>` parameter. Please note the branch will be created if it doesn’t exist. More details about the branching feature are available on [this dedicated help page](https://docs.bump.sh/help/branching). E.g. deploy the API document to the `staging` branch of the documentation:
131
137
 
@@ -141,8 +147,8 @@ If you already have a hub in your [Bump.sh](https://bump.sh) account, you can au
141
147
  bump deploy dir/path/to/apis/ --auto-create --hub my-hub --token $HUB_TOKEN
142
148
  ```
143
149
 
150
+ > [!TIP]
144
151
  > You can find your own `my-hub` slug and `$HUB_TOKEN` api key from your [hub settings](https://bump.sh/hubs).
145
- {: .info}
146
152
 
147
153
  Please note, by default, only files named `{slug}-api.[format]` are published. Where `{slug}` is a name for your API and `[format]` is either `yaml` or `json`. Adjust to your file naming convention using the `--filename-pattern <pattern>` option.
148
154
 
@@ -175,6 +181,30 @@ bump deploy path/to/api-document.yml --dry-run --doc my-documentation --token $D
175
181
 
176
182
  Please check `bump deploy --help` for more usage details.
177
183
 
184
+ #### Deploy a workflow document on your MCP server
185
+
186
+ Use the `bump deploy` command with the `--mcp-server` flag to push a
187
+ workflow definition to your MCP server.
188
+
189
+ Documents following either [Arazzo](https://docs.bump.sh/arazzo/v1.0/)
190
+ or
191
+ [Flower](https://docs.bump.sh/help/mcp-servers/specification-support/flower-support/)
192
+ specification are supported.
193
+
194
+
195
+ ```shell
196
+ bump deploy path/to/flower-or-arazzo-document.yml --mcp-server my-mcp-server-id-or-slug --token $BUMP_TOKEN
197
+ ```
198
+
199
+ > [!NOTE]
200
+ > You can find your own `mcp-server-id-or-slug` and `$BUMP_TOKEN` api key from your [MCP server settings](https://bump.sh/dashboard) at 'https://bump.sh/{your-organization}/workflow/set/{mcp-server-id}/tokens'.
201
+
202
+ More details about the MCP server feature are available on [this
203
+ dedicated help section](https://docs.bump.sh/help/mcp-servers/).
204
+
205
+ This feature is currently in closed beta.
206
+ Request an early access at hello@bump.sh
207
+
178
208
  ### The `diff` command
179
209
 
180
210
  Using the `diff` command can help to spot differences between the local API
@@ -271,14 +301,14 @@ bump preview --live --open api-document.yaml
271
301
  - Watch the live preview being updated each time you save your file.
272
302
  - The additional `--open` flag helps to automatically open the preview URL in your browser.
273
303
 
304
+ > [!NOTE]
274
305
  > You can create as many previews as you like without being authenticated. This is a **free and unlimited service**.
275
- {: .info}
276
306
 
277
307
  Please check `bump preview --help` for more usage details
278
308
 
279
309
  ### The `overlay` command
280
310
 
281
- The [Overlay Specification](https://spec.openapis.org/overlay/v1.0.0.html) from the OpenAPI Initiative makes it possible to modify the content of an API definition by adding a layer on top of it. That layer helps adding, removing or changing some or all of the content of the original definition.
311
+ The [Overlay Specification](https://spec.openapis.org/overlay/v1.0.0.html) from the OpenAPI Initiative makes it possible to modify the content of an API definition by adding a layer on top of it. That layer helps adding, removing or changing some or all of the content of the original definition.
282
312
 
283
313
  The `bump overlay` command takes an original API document, applies the changes from the overlay document, and outputs a modified version. No changes are made directly to the original document.
284
314
 
@@ -1,6 +1,6 @@
1
1
  import { Config } from '@oclif/core';
2
2
  import { AxiosInstance, AxiosResponse } from 'axios';
3
- import { DiffRequest, DiffResponse, PingResponse, PreviewRequest, PreviewResponse, VersionRequest, VersionResponse, WithDiff } from './models.js';
3
+ import { DiffRequest, DiffResponse, PingResponse, PreviewRequest, PreviewResponse, VersionRequest, VersionResponse, WithDiff, WorkflowVersionRequest, WorkflowVersionResponse } from './models.js';
4
4
  declare class BumpApi {
5
5
  protected config?: Config | undefined;
6
6
  protected readonly client: AxiosInstance;
@@ -8,6 +8,7 @@ declare class BumpApi {
8
8
  getPing: () => Promise<AxiosResponse<PingResponse>>;
9
9
  getVersion: (versionId: string, token: string) => Promise<AxiosResponse<VersionResponse & WithDiff>>;
10
10
  postDiff: (body: DiffRequest) => Promise<AxiosResponse<DiffResponse>>;
11
+ postMCPServerDeploy: (mcpServerIdOrSlug: string, body: WorkflowVersionRequest, token: string) => Promise<AxiosResponse<WorkflowVersionResponse>>;
11
12
  postPreview: (body?: PreviewRequest) => Promise<AxiosResponse<PreviewResponse>>;
12
13
  postValidation: (body: VersionRequest, token: string) => Promise<AxiosResponse<void>>;
13
14
  postVersion: (body: VersionRequest, token: string) => Promise<AxiosResponse<VersionResponse>>;
package/dist/api/index.js CHANGED
@@ -12,6 +12,9 @@ class BumpApi {
12
12
  headers: this.authorizationHeader(token),
13
13
  });
14
14
  postDiff = (body) => this.client.post('/diffs', body);
15
+ postMCPServerDeploy = (mcpServerIdOrSlug, body, token) => this.client.post(`/mcp_servers/${mcpServerIdOrSlug}/deploy`, body, {
16
+ headers: this.authorizationHeader(token),
17
+ });
15
18
  postPreview = (body) => this.client.post('/previews', body);
16
19
  postValidation = (body, token) => this.client.post('/validations', body, {
17
20
  headers: this.authorizationHeader(token),
@@ -17,8 +17,9 @@ export interface PreviewRequest {
17
17
  references?: Reference[];
18
18
  }
19
19
  export interface Reference {
20
- content?: string;
21
- location?: string;
20
+ content: string;
21
+ location: string;
22
+ name?: string;
22
23
  }
23
24
  export interface VersionRequest {
24
25
  auto_create_documentation?: boolean;
@@ -67,3 +68,11 @@ export interface DiffItem {
67
68
  status: string;
68
69
  type: string;
69
70
  }
71
+ export interface WorkflowVersionRequest {
72
+ definition: string;
73
+ references?: Reference[];
74
+ }
75
+ export interface WorkflowVersionResponse {
76
+ id: string;
77
+ mcp_server_id: string;
78
+ }
@@ -15,11 +15,13 @@ export default class Deploy extends BaseCommand<typeof Deploy> {
15
15
  'filename-pattern': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
16
16
  hub: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
17
17
  interactive: import("@oclif/core/interfaces").BooleanFlag<boolean>;
18
+ 'mcp-server': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
19
  overlay: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
20
  preview: import("@oclif/core/interfaces").BooleanFlag<boolean>;
20
21
  token: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
21
22
  };
22
23
  protected deployDirectory(dir: string, dryRun: boolean, token: string, hub: string, autoCreate: boolean, interactive: boolean, filenamePattern: string, documentationName: string | undefined, branch: string | undefined, overlays?: string[] | undefined): Promise<void>;
23
24
  protected deploySingleFile(api: API, dryRun: boolean, documentation: string, token: string, hub: string | undefined, autoCreate: boolean, documentationName: string | undefined, branch: string | undefined, overlay?: string[] | undefined, temporary?: boolean | undefined): Promise<void>;
25
+ protected deploySingleWorkflowFile(workflowDefinition: API, mcpServer: string, token: string): Promise<void>;
24
26
  run(): Promise<void>;
25
27
  }
@@ -7,6 +7,7 @@ import { DefinitionDirectory } from '../core/definition-directory.js';
7
7
  import { Deploy as CoreDeploy } from '../core/deploy.js';
8
8
  import { isDir } from '../core/utils/file.js';
9
9
  import { confirm as promptConfirm } from '../core/utils/prompts.js';
10
+ import { WorkflowDeploy as CoreWorkflowDeploy } from '../core/workflow-deploy.js';
10
11
  import { API } from '../definition.js';
11
12
  import * as flagsBuilder from '../flags.js';
12
13
  export default class Deploy extends BaseCommand {
@@ -46,6 +47,12 @@ Let's deploy a new version to your my-jobs-service documentation on Bump.sh... d
46
47
  ${chalk.dim('$ bump deploy FILE --dry-run --doc <doc_slug> --token <your_doc_token>')}
47
48
  * Let's validate on Bump.sh... done
48
49
  * Definition is valid
50
+ `,
51
+ `Deploy a new workflow document of ${chalk.underline('an existing MCP server')}
52
+
53
+ ${chalk.dim('$ bump deploy FILE --mcp-server <your_mcp_server_id_or_slug> --token <your_organization_token>')}
54
+ * Let's deploy on Bump.sh... done
55
+ * Your <your_mcp_server_id_or_slug> MCP server... has received a new workflow definition which will soon be ready.
49
56
  `,
50
57
  ];
51
58
  static flags = {
@@ -57,6 +64,7 @@ ${chalk.dim('$ bump deploy FILE --dry-run --doc <doc_slug> --token <your_doc_tok
57
64
  'filename-pattern': flagsBuilder.filenamePattern(),
58
65
  hub: flagsBuilder.hub(),
59
66
  interactive: flagsBuilder.interactive(),
67
+ 'mcp-server': flagsBuilder.mcpServer(),
60
68
  overlay: flagsBuilder.overlay(),
61
69
  preview: flagsBuilder.preview(),
62
70
  token: flagsBuilder.token(),
@@ -114,6 +122,17 @@ ${chalk.dim('$ bump deploy FILE --dry-run --doc <doc_slug> --token <your_doc_tok
114
122
  ux.warn(`Your ${documentation} documentation has not changed`);
115
123
  }
116
124
  }
125
+ async deploySingleWorkflowFile(workflowDefinition, mcpServer, token) {
126
+ ux.action.status = `...a new workflow definition to your ${mcpServer} MCP server`;
127
+ const response = await new CoreWorkflowDeploy(this.bump).run(workflowDefinition, mcpServer, token);
128
+ if (response) {
129
+ process.stdout.write(ux.colorize('green', `Your ${mcpServer} MCP server...`));
130
+ ux.stdout(ux.colorize('green', `has received a new workflow definition which will soon be ready.`));
131
+ }
132
+ else {
133
+ ux.warn(`Your ${mcpServer} MCP server has not changed.`);
134
+ }
135
+ }
117
136
  /*
118
137
  Oclif doesn't type parsed args & flags correctly and especially
119
138
  required-ness which is not known by the compiler, thus the use of
@@ -122,7 +141,7 @@ ${chalk.dim('$ bump deploy FILE --dry-run --doc <doc_slug> --token <your_doc_tok
122
141
  */
123
142
  async run() {
124
143
  const { args, flags } = await this.parse(Deploy);
125
- const [dryRun, documentation, token, hub, autoCreate, interactive, filenamePattern, documentationName, branch, overlay, temporary,] = [
144
+ const [dryRun, documentation, token, hub, autoCreate, interactive, filenamePattern, documentationName, branch, overlay, temporary, mcpServer,] = [
126
145
  flags['dry-run'],
127
146
  flags.doc,
128
147
  flags.token,
@@ -137,6 +156,7 @@ ${chalk.dim('$ bump deploy FILE --dry-run --doc <doc_slug> --token <your_doc_tok
137
156
  flags.overlay,
138
157
  /* when --preview is provided, generate temporary version */
139
158
  flags.preview,
159
+ flags['mcp-server'],
140
160
  ];
141
161
  const action = dryRun ? 'validate' : temporary ? 'preview' : 'deploy';
142
162
  ux.action.start(`Let's ${action} on Bump.sh`);
@@ -153,8 +173,12 @@ ${chalk.dim('$ bump deploy FILE --dry-run --doc <doc_slug> --token <your_doc_tok
153
173
  this.d(`${args.file} looks like an ${api.specName} spec version ${api.version}`);
154
174
  await this.deploySingleFile(api, dryRun, documentation, token, hub, autoCreate, documentationName, branch, overlay, temporary);
155
175
  }
176
+ else if (mcpServer) {
177
+ const workflowDefinition = await API.load(args.file);
178
+ await this.deploySingleWorkflowFile(workflowDefinition, mcpServer, token);
179
+ }
156
180
  else {
157
- throw new CLIError('Missing required flag --doc=<slug>');
181
+ throw new CLIError('Missing required flag --doc=<slug> or --mcp-server=<slug>');
158
182
  }
159
183
  ux.action.stop();
160
184
  }
@@ -119,7 +119,7 @@ export class Overlay {
119
119
  update(spec, parent, update, property_or_index) {
120
120
  try {
121
121
  // Deep merge objects using a module (built-in spread operator is only shallow)
122
- const merger = mergician({ appendArrays: true });
122
+ const merger = mergician({ appendArrays: true, dedupArrays: true });
123
123
  if (property_or_index === '$') {
124
124
  // You can't actually merge an update on a root object
125
125
  // target with the jsonpathly lib, this is just us merging
@@ -0,0 +1,7 @@
1
+ import type { JSONSchema7 } from 'json-schema';
2
+ declare const _default: {
3
+ schemas: {
4
+ '1.0': JSONSchema7;
5
+ };
6
+ };
7
+ export default _default;
@@ -0,0 +1,8 @@
1
+ // Spec definitions are copied from the official
2
+ // spec repo https://spec.openapis.org/arazzo/
3
+ import schemaV10 from './v1.0/schema.json' with { type: 'json' };
4
+ export default {
5
+ schemas: {
6
+ '1.0': schemaV10,
7
+ },
8
+ };