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.
@@ -0,0 +1,7 @@
1
+ import type { JSONSchema7 } from 'json-schema';
2
+ declare const _default: {
3
+ schemas: {
4
+ '0.1': JSONSchema7;
5
+ };
6
+ };
7
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import schemaV01 from './v0.1/schema.json' with { type: 'json' };
2
+ export default {
3
+ schemas: {
4
+ '0.1': schemaV01,
5
+ },
6
+ };
@@ -0,0 +1,267 @@
1
+ {
2
+ "title": "Flower 0.1 schema",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "type": "object",
5
+ "required": [
6
+ "flower",
7
+ "id",
8
+ "flows"
9
+ ],
10
+ "additionalProperties": false,
11
+ "patternProperties": {
12
+ "^x-[\\w\\d\\.\\-\\_]+$": {
13
+ "$ref": "#/definitions/specificationExtension"
14
+ }
15
+ },
16
+ "properties": {
17
+ "flower": {
18
+ "type": [
19
+ "string"
20
+ ],
21
+ "enum": [
22
+ "0.1"
23
+ ],
24
+ "description": "The Flower specification version of this document."
25
+ },
26
+ "id": {
27
+ "type": "string",
28
+ "description": "A unique id representing the workflow set."
29
+ },
30
+ "title": {
31
+ "type": "string"
32
+ },
33
+ "description": {
34
+ "type": "string"
35
+ },
36
+ "flows": {
37
+ "type": "array",
38
+ "items": {
39
+ "$ref": "#/definitions/flow"
40
+ }
41
+ }
42
+ },
43
+ "definitions": {
44
+ "flow": {
45
+ "type": "object",
46
+ "properties": {
47
+ "id": {
48
+ "type": "string"
49
+ },
50
+ "description": {
51
+ "type": "string"
52
+ },
53
+ "inputs": {
54
+ "$ref": "#/definitions/schema"
55
+ },
56
+ "outputs": {
57
+ "$ref": "#/definitions/expressionMap"
58
+ },
59
+ "steps": {
60
+ "type": "array",
61
+ "items": {
62
+ "$ref": "#/definitions/step"
63
+ }
64
+ }
65
+ },
66
+ "required": [
67
+ "id",
68
+ "steps"
69
+ ]
70
+ },
71
+ "step": {
72
+ "type": "object",
73
+ "properties": {
74
+ "id": {
75
+ "type": "string"
76
+ },
77
+ "outputs": {
78
+ "$ref": "#/definitions/expressionMap"
79
+ },
80
+ "request": {
81
+ "type": "object",
82
+ "properties": {
83
+ "method": {
84
+ "type": "string"
85
+ },
86
+ "url": {
87
+ "type": "string"
88
+ },
89
+ "headers": {
90
+ "$ref": "#/definitions/expressionMap"
91
+ },
92
+ "query": {
93
+ "$ref": "#/definitions/expressionMap"
94
+ },
95
+ "body": {
96
+ "$ref": "#/definitions/expressionMap"
97
+ }
98
+ }
99
+ },
100
+ "actions": {
101
+ "type": "array",
102
+ "items": {
103
+ "oneOf": [
104
+ {
105
+ "$ref": "#/definitions/next"
106
+ },
107
+ {
108
+ "$ref": "#/definitions/retry"
109
+ },
110
+ {
111
+ "$ref": "#/definitions/goto"
112
+ },
113
+ {
114
+ "$ref": "#/definitions/end"
115
+ }
116
+ ]
117
+ }
118
+ }
119
+ },
120
+ "required": [
121
+ "id",
122
+ "request"
123
+ ]
124
+ },
125
+ "action": {
126
+ "type": "object",
127
+ "required": [
128
+ "do"
129
+ ],
130
+ "properties": {
131
+ "id": {
132
+ "type": "string"
133
+ },
134
+ "when": {
135
+ "type": "string",
136
+ "description": "A runtime expression conditioning this action"
137
+ },
138
+ "do": {
139
+ "type": "string"
140
+ }
141
+ },
142
+ "discriminator": {
143
+ "propertyName": "do",
144
+ "mapping": {
145
+ "next": "#/definitions/next",
146
+ "retry": "#/definitions/retry",
147
+ "goto": "#/definitions/goto",
148
+ "end": "#/definitions/end"
149
+ }
150
+ }
151
+ },
152
+ "next": {
153
+ "allOf": [
154
+ {
155
+ "$ref": "#/definitions/action"
156
+ },
157
+ {
158
+ "type": "object",
159
+ "properties": {
160
+ "do": {
161
+ "type": "string",
162
+ "const": "next"
163
+ }
164
+ }
165
+ }
166
+ ]
167
+ },
168
+ "retry": {
169
+ "allOf": [
170
+ {
171
+ "$ref": "#/definitions/action"
172
+ },
173
+ {
174
+ "type": "object",
175
+ "properties": {
176
+ "do": {
177
+ "type": "string",
178
+ "const": "retry"
179
+ },
180
+ "wait": {
181
+ "type": "integer",
182
+ "description": "Number of seconds to wait",
183
+ "default": 5
184
+ },
185
+ "max_retry": {
186
+ "type": "integer",
187
+ "description": "Maximum number of subsequent retries to execute",
188
+ "default": 5
189
+ }
190
+ }
191
+ }
192
+ ]
193
+ },
194
+ "goto": {
195
+ "allOf": [
196
+ {
197
+ "$ref": "#/definitions/action"
198
+ },
199
+ {
200
+ "type": "object",
201
+ "required": [
202
+ "step"
203
+ ],
204
+ "properties": {
205
+ "do": {
206
+ "type": "string",
207
+ "const": "goto"
208
+ },
209
+ "step": {
210
+ "type": "string",
211
+ "description": "The target step ID to jump to"
212
+ }
213
+ }
214
+ }
215
+ ]
216
+ },
217
+ "end": {
218
+ "allOf": [
219
+ {
220
+ "$ref": "#/definitions/action"
221
+ },
222
+ {
223
+ "type": "object",
224
+ "properties": {
225
+ "do": {
226
+ "type": "string",
227
+ "const": "end"
228
+ }
229
+ }
230
+ }
231
+ ]
232
+ },
233
+ "expressionMap": {
234
+ "type": "object",
235
+ "description": "A map of names to runtime expressions.",
236
+ "additionalProperties": {
237
+ "type": "string",
238
+ "description": "A runtime expression."
239
+ }
240
+ },
241
+ "schema": {
242
+ "allOf": [
243
+ {
244
+ "$ref": "http://json-schema.org/draft-07/schema#"
245
+ },
246
+ {
247
+ "type": "object",
248
+ "patternProperties": {
249
+ "^x-[\\w\\d\\.\\-\\_]+$": {
250
+ "$ref": "#/definitions/specificationExtension"
251
+ }
252
+ }
253
+ }
254
+ ]
255
+ },
256
+ "specificationExtension": {
257
+ "oneOf": [
258
+ {
259
+ "type": "object",
260
+ "description": "Any property starting with x- is valid.",
261
+ "additionalProperties": true
262
+ },
263
+ {}
264
+ ]
265
+ }
266
+ }
267
+ }
@@ -0,0 +1,10 @@
1
+ import { BumpApi } from '../api/index.js';
2
+ import { WorkflowVersionRequest, WorkflowVersionResponse } from '../api/models.js';
3
+ import { API } from '../definition.js';
4
+ export declare class WorkflowDeploy {
5
+ private _bump;
6
+ constructor(bumpClient: BumpApi);
7
+ protected createWorkflowVersion(mcpServer: string, request: WorkflowVersionRequest, token: string): Promise<WorkflowVersionResponse | undefined>;
8
+ d(formatter: any, ...args: any[]): void;
9
+ run(workflowDefinition: API, mcpServer: string, token: string): Promise<WorkflowVersionResponse | undefined>;
10
+ }
@@ -0,0 +1,37 @@
1
+ import debug from 'debug';
2
+ export class WorkflowDeploy {
3
+ _bump;
4
+ constructor(bumpClient) {
5
+ this._bump = bumpClient;
6
+ }
7
+ async createWorkflowVersion(mcpServer, request, token) {
8
+ const response = await this._bump.postMCPServerDeploy(mcpServer, request, token);
9
+ let version;
10
+ switch (response.status) {
11
+ case 204: {
12
+ break; // MCP server workflow document already exists
13
+ }
14
+ case 201: {
15
+ version = response.data;
16
+ break;
17
+ }
18
+ default: {
19
+ this.d(`API status response was ${response.status}. Expected 201 or 204.`);
20
+ throw new Error('Unexpected server response. Please contact support at https://bump.sh if this error persists');
21
+ }
22
+ }
23
+ return version;
24
+ }
25
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
26
+ d(formatter, ...args) {
27
+ return debug(`bump-cli:core:deploy`)(formatter, ...args);
28
+ }
29
+ async run(workflowDefinition, mcpServer, token) {
30
+ let version;
31
+ const [definition, references] = await workflowDefinition.extractDefinition();
32
+ const request = { definition, references };
33
+ // eslint-disable-next-line prefer-const
34
+ version = await this.createWorkflowVersion(mcpServer, request, token);
35
+ return version;
36
+ }
37
+ }
@@ -1,8 +1,10 @@
1
1
  import { JSONSchema4, JSONSchema4Array, JSONSchema4Object, JSONSchema6, JSONSchema6Object, JSONSchema7 } from 'json-schema';
2
- type SpecSchema = JSONSchema4 | JSONSchema6 | JSONSchema7;
2
+ type JSONSchema = JSONSchema4 | JSONSchema6 | JSONSchema7;
3
3
  declare class SupportedFormat {
4
- static readonly asyncapi: Record<string, SpecSchema>;
5
- static readonly openapi: Record<string, SpecSchema>;
4
+ static readonly arazzo: Record<string, JSONSchema>;
5
+ static readonly asyncapi: Record<string, JSONSchema>;
6
+ static readonly flower: Record<string, JSONSchema>;
7
+ static readonly openapi: Record<string, JSONSchema>;
6
8
  }
7
9
  declare class API {
8
10
  readonly definition: APIDefinition;
@@ -10,32 +12,40 @@ declare class API {
10
12
  overlayedDefinition: APIDefinition | undefined;
11
13
  readonly rawDefinition: string;
12
14
  readonly references: APIReference[];
13
- readonly spec?: SpecSchema;
14
- readonly specName: string;
15
- readonly version: string;
16
- constructor(location: string, values: SpecSchema);
15
+ readonly specName?: string;
16
+ readonly version?: string;
17
+ constructor(location: string, data: Record<string, JSONSchemaWithRaw>);
18
+ static isArazzo(definition: JSONSchema4Object | JSONSchema6Object): definition is Arazzo;
17
19
  static isAsyncAPI(definition: JSONSchema4Object | JSONSchema6Object): definition is AsyncAPI;
20
+ static isFlower(definition: JSONSchema4Object | JSONSchema6Object): definition is Flower;
18
21
  static isOpenAPI(definition: JSONSchema4Object | JSONSchema6Object): definition is OpenAPI;
19
22
  static isOpenAPIOverlay(definition: JSONSchema4Object | JSONSchema6Object): definition is OpenAPIOverlay;
23
+ static isSupportedFormat(definition: JSONSchema4Object | JSONSchema6Object): definition is APIDefinition;
20
24
  static load(path: string): Promise<API>;
21
25
  applyOverlay(overlayPath: string): Promise<void>;
22
26
  extractDefinition(outputPath?: string, overlays?: string[] | undefined): Promise<[string, APIReference[]]>;
23
- getSpec(definition: APIDefinition): SpecSchema;
24
- getSpecName(definition: APIDefinition): string;
25
- getVersion(definition: APIDefinition): string;
27
+ getSpec(definition: APIDefinition): JSONSchema | undefined;
28
+ getSpecName(definition: APIDefinition): string | undefined;
29
+ getVersion(definition: APIDefinition): string | undefined;
26
30
  guessFormat(output?: string): string;
27
31
  isMainRefPath(path: string): boolean;
28
- resolveContent(values: SpecSchema): [string, APIDefinition];
29
- resolveRelativeLocation(absPath: string): string;
30
32
  serializeDefinition(outputPath?: string): string;
31
33
  versionWithoutPatch(): string;
34
+ private _resolveArazzoSourceDescriptions;
35
+ private _resolveContentFrom;
36
+ private _resolveRelativeLocation;
32
37
  private url;
33
38
  }
39
+ type JSONSchemaWithRaw = {
40
+ readonly parsed?: JSONSchema4 | JSONSchema4Object | JSONSchema6 | JSONSchema6Object | string;
41
+ readonly raw?: string;
42
+ };
34
43
  type APIReference = {
35
44
  content: string;
36
45
  location: string;
46
+ name?: string;
37
47
  };
38
- type APIDefinition = AsyncAPI | OpenAPI | OpenAPIOverlay;
48
+ type APIDefinition = Arazzo | AsyncAPI | Flower | OpenAPI | OpenAPIOverlay;
39
49
  type InfoObject = {
40
50
  readonly description?: string;
41
51
  readonly title: string;
@@ -55,4 +65,11 @@ type AsyncAPI = {
55
65
  readonly asyncapi: string;
56
66
  readonly info: InfoObject;
57
67
  } & JSONSchema4Object;
58
- export { API, APIDefinition, OpenAPIOverlay, SupportedFormat };
68
+ type Flower = {
69
+ readonly flower: string;
70
+ } & JSONSchema4Object;
71
+ type Arazzo = {
72
+ readonly arazzo: string;
73
+ readonly info: InfoObject;
74
+ } & JSONSchema4Object;
75
+ export { API, APIDefinition, OpenAPI, OpenAPIOverlay, SupportedFormat };