@asyncapi/cli 3.4.1 → 3.4.2
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.
|
Binary file
|
|
@@ -169,6 +169,15 @@ function validationMiddleware(options) {
|
|
|
169
169
|
if (Array.isArray(body)) {
|
|
170
170
|
const results = yield validateListDocuments(body, resolveURL, validationService);
|
|
171
171
|
const parsedDocuments = results.map((result) => result.document);
|
|
172
|
+
if (!parsedDocuments.every(doc => doc !== undefined)) {
|
|
173
|
+
throw new problem_exception_1.ProblemException({
|
|
174
|
+
type: 'invalid-asyncapi-document-parse',
|
|
175
|
+
title: 'Invalid AsyncAPI Document (Parse Error)',
|
|
176
|
+
status: 422,
|
|
177
|
+
detail: 'One or more provided AsyncAPI documents are invalid.',
|
|
178
|
+
diagnostics: results.flatMap(result => result.diagnostics || []),
|
|
179
|
+
});
|
|
180
|
+
}
|
|
172
181
|
req.asyncapi.parsedDocuments = parsedDocuments;
|
|
173
182
|
req.asyncapi.validationResults = results;
|
|
174
183
|
}
|
package/lib/utils/logger.js
CHANGED
|
@@ -6,7 +6,7 @@ const config_1 = tslib_1.__importDefault(require("config"));
|
|
|
6
6
|
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
7
7
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
8
8
|
const winston_1 = tslib_1.__importDefault(require("winston"));
|
|
9
|
-
const logDir = path_1.default.join(__dirname, config_1.default.get('log.dir'));
|
|
9
|
+
const logDir = path_1.default.join(__dirname, config_1.default.has('log.dir') ? config_1.default.get('log.dir') : 'logs');
|
|
10
10
|
if (!fs_1.default.existsSync(logDir)) {
|
|
11
11
|
fs_1.default.mkdirSync(logDir);
|
|
12
12
|
}
|
package/oclif.manifest.json
CHANGED
package/openapi.yaml
ADDED
|
@@ -0,0 +1,583 @@
|
|
|
1
|
+
openapi: 3.1.0
|
|
2
|
+
info:
|
|
3
|
+
version: 0.1.0
|
|
4
|
+
title: AsyncAPI Server API
|
|
5
|
+
description: Server API providing official AsyncAPI tools
|
|
6
|
+
contact:
|
|
7
|
+
name: AsyncAPI Initiative
|
|
8
|
+
email: info@asyncapi.io
|
|
9
|
+
url: https://asyncapi.com/
|
|
10
|
+
license:
|
|
11
|
+
name: Apache 2.0
|
|
12
|
+
url: https://www.apache.org/licenses/LICENSE-2.0.html
|
|
13
|
+
|
|
14
|
+
servers:
|
|
15
|
+
- url: https://api.asyncapi.com/v1
|
|
16
|
+
|
|
17
|
+
paths:
|
|
18
|
+
/validate:
|
|
19
|
+
post:
|
|
20
|
+
summary: Validate the given AsyncAPI document.
|
|
21
|
+
operationId: validate
|
|
22
|
+
tags:
|
|
23
|
+
- validate
|
|
24
|
+
- parser
|
|
25
|
+
externalDocs:
|
|
26
|
+
name: Github Repository for the AsyncAPI Parser
|
|
27
|
+
url: https://github.com/asyncapi/parser-js
|
|
28
|
+
requestBody:
|
|
29
|
+
description: Validate the given AsyncAPI document.
|
|
30
|
+
required: true
|
|
31
|
+
content:
|
|
32
|
+
application/json:
|
|
33
|
+
schema:
|
|
34
|
+
$ref: '#/components/schemas/ValidateRequest'
|
|
35
|
+
responses:
|
|
36
|
+
"204":
|
|
37
|
+
description: The given AsyncAPI document is valid.
|
|
38
|
+
"400":
|
|
39
|
+
description: The given AsyncAPI document is not valid.
|
|
40
|
+
content:
|
|
41
|
+
application/json:
|
|
42
|
+
schema:
|
|
43
|
+
$ref: "#/components/schemas/Problem"
|
|
44
|
+
"422":
|
|
45
|
+
description: The given AsyncAPI document is not valid due to invalid parameters in the request.
|
|
46
|
+
content:
|
|
47
|
+
application/json:
|
|
48
|
+
schema:
|
|
49
|
+
$ref: "#/components/schemas/Problem"
|
|
50
|
+
default:
|
|
51
|
+
description: Unexpected problem.
|
|
52
|
+
content:
|
|
53
|
+
application/json:
|
|
54
|
+
schema:
|
|
55
|
+
$ref: "#/components/schemas/Problem"
|
|
56
|
+
|
|
57
|
+
/parse:
|
|
58
|
+
post:
|
|
59
|
+
summary: Parse the given AsyncAPI document.
|
|
60
|
+
operationId: parse
|
|
61
|
+
tags:
|
|
62
|
+
- parse
|
|
63
|
+
- parser
|
|
64
|
+
externalDocs:
|
|
65
|
+
name: Github Repository for the AsyncAPI Parser
|
|
66
|
+
url: https://github.com/asyncapi/parser-js
|
|
67
|
+
requestBody:
|
|
68
|
+
description: Parse the given AsyncAPI document.
|
|
69
|
+
required: true
|
|
70
|
+
content:
|
|
71
|
+
application/json:
|
|
72
|
+
schema:
|
|
73
|
+
$ref: '#/components/schemas/ParseRequest'
|
|
74
|
+
responses:
|
|
75
|
+
"200":
|
|
76
|
+
description: AsyncAPI document successfully parsed.
|
|
77
|
+
content:
|
|
78
|
+
application/json:
|
|
79
|
+
schema:
|
|
80
|
+
$ref: "#/components/schemas/ParseResponse"
|
|
81
|
+
"400":
|
|
82
|
+
description: The given AsyncAPI document is not valid.
|
|
83
|
+
content:
|
|
84
|
+
application/json:
|
|
85
|
+
schema:
|
|
86
|
+
$ref: "#/components/schemas/Problem"
|
|
87
|
+
"422":
|
|
88
|
+
description: The given AsyncAPI document is not valid due to invalid parameters in the request.
|
|
89
|
+
content:
|
|
90
|
+
application/json:
|
|
91
|
+
schema:
|
|
92
|
+
$ref: "#/components/schemas/Problem"
|
|
93
|
+
default:
|
|
94
|
+
description: Unexpected problem.
|
|
95
|
+
content:
|
|
96
|
+
application/json:
|
|
97
|
+
schema:
|
|
98
|
+
$ref: "#/components/schemas/Problem"
|
|
99
|
+
|
|
100
|
+
/generate:
|
|
101
|
+
post:
|
|
102
|
+
summary: Generate the given AsyncAPI template.
|
|
103
|
+
operationId: generate
|
|
104
|
+
tags:
|
|
105
|
+
- generate
|
|
106
|
+
- generator
|
|
107
|
+
externalDocs:
|
|
108
|
+
name: Github Repository for the AsyncAPI Generator
|
|
109
|
+
url: https://github.com/asyncapi/generator
|
|
110
|
+
requestBody:
|
|
111
|
+
description: Template details to be generated.
|
|
112
|
+
required: true
|
|
113
|
+
content:
|
|
114
|
+
application/json:
|
|
115
|
+
schema:
|
|
116
|
+
$ref: '#/components/schemas/GenerateRequest'
|
|
117
|
+
responses:
|
|
118
|
+
"200":
|
|
119
|
+
description: Template successfully generated.
|
|
120
|
+
content:
|
|
121
|
+
application/zip:
|
|
122
|
+
schema:
|
|
123
|
+
$ref: '#/components/schemas/GenerateResponse'
|
|
124
|
+
'400':
|
|
125
|
+
description: Failed to generate the given template due to invalid AsyncAPI document.
|
|
126
|
+
content:
|
|
127
|
+
application/json:
|
|
128
|
+
schema:
|
|
129
|
+
$ref: "#/components/schemas/Problem"
|
|
130
|
+
"422":
|
|
131
|
+
description: Failed to generate the given template due to invalid parameters.
|
|
132
|
+
content:
|
|
133
|
+
application/json:
|
|
134
|
+
schema:
|
|
135
|
+
$ref: "#/components/schemas/Problem"
|
|
136
|
+
default:
|
|
137
|
+
description: Unexpected problem.
|
|
138
|
+
content:
|
|
139
|
+
application/json:
|
|
140
|
+
schema:
|
|
141
|
+
$ref: "#/components/schemas/Problem"
|
|
142
|
+
|
|
143
|
+
/convert:
|
|
144
|
+
post:
|
|
145
|
+
summary: Convert the given AsyncAPI/OpenAPI/Postman Collection document to AsyncAPI document with the specified version.
|
|
146
|
+
operationId: convert
|
|
147
|
+
tags:
|
|
148
|
+
- convert
|
|
149
|
+
- converter
|
|
150
|
+
externalDocs:
|
|
151
|
+
name: Github Repository for the AsyncAPI Converter
|
|
152
|
+
url: https://github.com/asyncapi/converter-js
|
|
153
|
+
requestBody:
|
|
154
|
+
description: Parameters to convert the spec.
|
|
155
|
+
required: true
|
|
156
|
+
content:
|
|
157
|
+
application/json:
|
|
158
|
+
schema:
|
|
159
|
+
$ref: '#/components/schemas/ConvertRequest'
|
|
160
|
+
responses:
|
|
161
|
+
'200':
|
|
162
|
+
description: AsyncAPI document successfully converted.
|
|
163
|
+
content:
|
|
164
|
+
application/json:
|
|
165
|
+
schema:
|
|
166
|
+
$ref: '#/components/schemas/ConvertResponse'
|
|
167
|
+
'400':
|
|
168
|
+
description: Failed to convert due to invalid AsyncAPI document.
|
|
169
|
+
content:
|
|
170
|
+
application/json:
|
|
171
|
+
schema:
|
|
172
|
+
$ref: '#/components/schemas/Problem'
|
|
173
|
+
'422':
|
|
174
|
+
description: Failed to convert the given document due to invalid parameters.
|
|
175
|
+
content:
|
|
176
|
+
application/json:
|
|
177
|
+
schema:
|
|
178
|
+
$ref: '#/components/schemas/Problem'
|
|
179
|
+
default:
|
|
180
|
+
description: Unexpected problem.
|
|
181
|
+
content:
|
|
182
|
+
application/json:
|
|
183
|
+
schema:
|
|
184
|
+
$ref: '#/components/schemas/Problem'
|
|
185
|
+
|
|
186
|
+
/bundle:
|
|
187
|
+
post:
|
|
188
|
+
summary: Bundle the given AsyncAPI document(s).
|
|
189
|
+
operationId: bundle
|
|
190
|
+
tags:
|
|
191
|
+
- bundle
|
|
192
|
+
- bundler
|
|
193
|
+
externalDocs:
|
|
194
|
+
name: Github Repository for the AsyncAPI Bundler
|
|
195
|
+
url: https://github.com/asyncapi/bundler
|
|
196
|
+
requestBody:
|
|
197
|
+
description: Bundle the given AsyncAPI document(s) to single one.
|
|
198
|
+
required: true
|
|
199
|
+
content:
|
|
200
|
+
application/json:
|
|
201
|
+
schema:
|
|
202
|
+
$ref: "#/components/schemas/BundleRequest"
|
|
203
|
+
responses:
|
|
204
|
+
"200":
|
|
205
|
+
description: AsyncAPI document(s) successfully bundled.
|
|
206
|
+
content:
|
|
207
|
+
application/json:
|
|
208
|
+
schema:
|
|
209
|
+
$ref: "#/components/schemas/BundleResponse"
|
|
210
|
+
"400":
|
|
211
|
+
description: The given AsyncAPI document(s) is/are not valid.
|
|
212
|
+
content:
|
|
213
|
+
application/json:
|
|
214
|
+
schema:
|
|
215
|
+
$ref: "#/components/schemas/Problem"
|
|
216
|
+
"422":
|
|
217
|
+
description: The given AsyncAPI document(s) is/are not valid due to invalid parameters in the request.
|
|
218
|
+
content:
|
|
219
|
+
application/json:
|
|
220
|
+
schema:
|
|
221
|
+
$ref: "#/components/schemas/Problem"
|
|
222
|
+
default:
|
|
223
|
+
description: Unexpected problem.
|
|
224
|
+
content:
|
|
225
|
+
application/json:
|
|
226
|
+
schema:
|
|
227
|
+
$ref: '#/components/schemas/Problem'
|
|
228
|
+
|
|
229
|
+
/help:
|
|
230
|
+
get:
|
|
231
|
+
summary: Retrieve help information for the given command.
|
|
232
|
+
operationId: help
|
|
233
|
+
tags:
|
|
234
|
+
- help
|
|
235
|
+
parameters:
|
|
236
|
+
- name: command
|
|
237
|
+
in: query
|
|
238
|
+
style: form
|
|
239
|
+
explode: true
|
|
240
|
+
description: The command for which help information is needed.
|
|
241
|
+
required: true
|
|
242
|
+
schema:
|
|
243
|
+
type: string
|
|
244
|
+
responses:
|
|
245
|
+
"200":
|
|
246
|
+
description: Help information retrieved successfully.
|
|
247
|
+
content:
|
|
248
|
+
application/json:
|
|
249
|
+
schema:
|
|
250
|
+
oneOf:
|
|
251
|
+
- $ref: '#/components/schemas/HelpListResponse'
|
|
252
|
+
- $ref: '#/components/schemas/HelpCommandResponse'
|
|
253
|
+
"400":
|
|
254
|
+
description: Bad request
|
|
255
|
+
content:
|
|
256
|
+
application/json:
|
|
257
|
+
schema:
|
|
258
|
+
$ref: '#/components/schemas/Problem'
|
|
259
|
+
"404":
|
|
260
|
+
description: Command not found
|
|
261
|
+
content:
|
|
262
|
+
application/problem+json:
|
|
263
|
+
schema:
|
|
264
|
+
$ref: '#/components/schemas/Problem'
|
|
265
|
+
default:
|
|
266
|
+
description: Unexpected problem.
|
|
267
|
+
content:
|
|
268
|
+
application/json:
|
|
269
|
+
schema:
|
|
270
|
+
$ref: "#/components/schemas/Problem"
|
|
271
|
+
|
|
272
|
+
/diff:
|
|
273
|
+
post:
|
|
274
|
+
summary: Compare the given AsyncAPI documents.
|
|
275
|
+
operationId: diff
|
|
276
|
+
tags:
|
|
277
|
+
- diff
|
|
278
|
+
- differ
|
|
279
|
+
externalDocs:
|
|
280
|
+
name: Github Repository for the AsyncAPI Diff
|
|
281
|
+
url: https://github.com/asyncapi/diff
|
|
282
|
+
requestBody:
|
|
283
|
+
description: Compare the given AsyncAPI documents.
|
|
284
|
+
required: true
|
|
285
|
+
content:
|
|
286
|
+
application/json:
|
|
287
|
+
schema:
|
|
288
|
+
$ref: '#/components/schemas/DiffRequest'
|
|
289
|
+
responses:
|
|
290
|
+
'200':
|
|
291
|
+
description: Successfully received changes between two AsyncAPI documents.
|
|
292
|
+
content:
|
|
293
|
+
application/json:
|
|
294
|
+
schema:
|
|
295
|
+
$ref: '#/components/schemas/DiffResponse'
|
|
296
|
+
'400':
|
|
297
|
+
description: One of the AsyncAPI documents is not valid.
|
|
298
|
+
content:
|
|
299
|
+
application/json:
|
|
300
|
+
schema:
|
|
301
|
+
$ref: '#/components/schemas/Problem'
|
|
302
|
+
'422':
|
|
303
|
+
description: Failed to retrieve changes between two AsyncAPI documents due to invalid parameters.
|
|
304
|
+
content:
|
|
305
|
+
application/json:
|
|
306
|
+
schema:
|
|
307
|
+
$ref: '#/components/schemas/Problem'
|
|
308
|
+
default:
|
|
309
|
+
description: Unexpected problem.
|
|
310
|
+
content:
|
|
311
|
+
application/json:
|
|
312
|
+
schema:
|
|
313
|
+
$ref: '#/components/schemas/Problem'
|
|
314
|
+
|
|
315
|
+
components:
|
|
316
|
+
schemas:
|
|
317
|
+
AsyncAPIDocument:
|
|
318
|
+
description: AsyncAPI document in JSON or YAML.
|
|
319
|
+
oneOf:
|
|
320
|
+
- type: string # can be in YAML format
|
|
321
|
+
- $ref: https://raw.githubusercontent.com/asyncapi/spec-json-schemas/master/schemas/2.0.0.json
|
|
322
|
+
- $ref: https://raw.githubusercontent.com/asyncapi/spec-json-schemas/master/schemas/2.1.0.json
|
|
323
|
+
- $ref: https://raw.githubusercontent.com/asyncapi/spec-json-schemas/master/schemas/2.2.0.json
|
|
324
|
+
- $ref: https://raw.githubusercontent.com/asyncapi/spec-json-schemas/master/schemas/2.3.0.json
|
|
325
|
+
- $ref: https://raw.githubusercontent.com/asyncapi/spec-json-schemas/master/schemas/2.4.0.json
|
|
326
|
+
- $ref: https://raw.githubusercontent.com/asyncapi/spec-json-schemas/master/schemas/2.5.0.json
|
|
327
|
+
- $ref: https://raw.githubusercontent.com/asyncapi/spec-json-schemas/master/schemas/2.6.0.json
|
|
328
|
+
- $ref: https://raw.githubusercontent.com/asyncapi/spec-json-schemas/master/schemas/3.0.0.json
|
|
329
|
+
AsyncAPIDocuments:
|
|
330
|
+
type: array
|
|
331
|
+
description: AsyncAPI documents in JSON or YAML.
|
|
332
|
+
minItems: 1
|
|
333
|
+
items:
|
|
334
|
+
$ref: '#/components/schemas/AsyncAPIDocument'
|
|
335
|
+
OpenAPIDocument:
|
|
336
|
+
type: string
|
|
337
|
+
description: OpenAPI document in JSON or YAML.
|
|
338
|
+
oneOf:
|
|
339
|
+
- type: string # can be in YAML format
|
|
340
|
+
- $ref: https://spec.openapis.org/oas/3.0/schema/2024-10-18
|
|
341
|
+
PostmanCollectionDocument:
|
|
342
|
+
type: string
|
|
343
|
+
description: Postman Collection document in JSON or YAML.
|
|
344
|
+
oneOf:
|
|
345
|
+
- type: string # can be in YAML format
|
|
346
|
+
- $ref: https://schema.getpostman.com/json/collection/v2.1.0/collection.json
|
|
347
|
+
- $ref: https://schema.getpostman.com/json/collection/v2.0.0/collection.json
|
|
348
|
+
- $ref: https://schema.getpostman.com/json/collection/v1.0.0/collection.json
|
|
349
|
+
SpecVersions:
|
|
350
|
+
type: string
|
|
351
|
+
description: Valid specification versions for the AsyncAPI document.
|
|
352
|
+
default: latest
|
|
353
|
+
enum:
|
|
354
|
+
- '2.0.0'
|
|
355
|
+
- '2.1.0'
|
|
356
|
+
- '2.2.0'
|
|
357
|
+
- '2.3.0'
|
|
358
|
+
- '2.4.0'
|
|
359
|
+
- '2.5.0'
|
|
360
|
+
- '2.6.0'
|
|
361
|
+
- '3.0.0'
|
|
362
|
+
- 'latest'
|
|
363
|
+
|
|
364
|
+
ValidateRequest:
|
|
365
|
+
type: object
|
|
366
|
+
required:
|
|
367
|
+
- asyncapi
|
|
368
|
+
properties:
|
|
369
|
+
asyncapi:
|
|
370
|
+
$ref: '#/components/schemas/AsyncAPIDocument'
|
|
371
|
+
|
|
372
|
+
ValidateResponse:
|
|
373
|
+
type: object
|
|
374
|
+
required:
|
|
375
|
+
- status
|
|
376
|
+
properties:
|
|
377
|
+
status:
|
|
378
|
+
type: string
|
|
379
|
+
description: Validation status of the AsyncAPI document.
|
|
380
|
+
enum:
|
|
381
|
+
- valid
|
|
382
|
+
- invalid
|
|
383
|
+
diagnostics:
|
|
384
|
+
type: array
|
|
385
|
+
description: List of validation diagnostics.
|
|
386
|
+
items:
|
|
387
|
+
type: object
|
|
388
|
+
asyncapi:
|
|
389
|
+
$ref: '#/components/schemas/AsyncAPIDocument'
|
|
390
|
+
score:
|
|
391
|
+
type: number
|
|
392
|
+
description: Score of the AsyncAPI document based on validation.
|
|
393
|
+
minimum: 0
|
|
394
|
+
maximum: 100
|
|
395
|
+
ParseRequest:
|
|
396
|
+
type: object
|
|
397
|
+
required:
|
|
398
|
+
- asyncapi
|
|
399
|
+
properties:
|
|
400
|
+
asyncapi:
|
|
401
|
+
$ref: '#/components/schemas/AsyncAPIDocument'
|
|
402
|
+
ParseResponse:
|
|
403
|
+
type: object
|
|
404
|
+
required:
|
|
405
|
+
- parsed
|
|
406
|
+
properties:
|
|
407
|
+
parsed:
|
|
408
|
+
type: string
|
|
409
|
+
|
|
410
|
+
GenerateRequest:
|
|
411
|
+
type: object
|
|
412
|
+
required:
|
|
413
|
+
- asyncapi
|
|
414
|
+
- template
|
|
415
|
+
properties:
|
|
416
|
+
asyncapi:
|
|
417
|
+
$ref: "#/components/schemas/AsyncAPIDocument"
|
|
418
|
+
template:
|
|
419
|
+
type: string
|
|
420
|
+
description: Template name to be generated.
|
|
421
|
+
enum:
|
|
422
|
+
# TODO add more templates
|
|
423
|
+
- "@asyncapi/dotnet-nats-template"
|
|
424
|
+
- "@asyncapi/go-watermill-template"
|
|
425
|
+
- "@asyncapi/html-template"
|
|
426
|
+
- "@asyncapi/java-spring-cloud-stream-template"
|
|
427
|
+
- "@asyncapi/java-spring-template"
|
|
428
|
+
- "@asyncapi/java-template"
|
|
429
|
+
- "@asyncapi/markdown-template"
|
|
430
|
+
- "@asyncapi/nodejs-template"
|
|
431
|
+
- "@asyncapi/nodejs-ws-template"
|
|
432
|
+
- "@asyncapi/python-paho-template"
|
|
433
|
+
- "@asyncapi/ts-nats-template"
|
|
434
|
+
- "@asyncapi/minimaltemplate"
|
|
435
|
+
- "@asyncapi/dotnet-rabbitmq-template"
|
|
436
|
+
use-fallback-generator:
|
|
437
|
+
type: boolean
|
|
438
|
+
description: Use generator version 1.17.25
|
|
439
|
+
default: false
|
|
440
|
+
# TODO parameter validation
|
|
441
|
+
parameters:
|
|
442
|
+
type: object
|
|
443
|
+
description: |
|
|
444
|
+
Template parameters to be generated. Each template has different parameters that you should check in the documentation,
|
|
445
|
+
which is usually located in the template's repository.
|
|
446
|
+
This field is optional but may be required for some templates.
|
|
447
|
+
additionalProperties: true
|
|
448
|
+
GenerateResponse:
|
|
449
|
+
type: string
|
|
450
|
+
format: binary
|
|
451
|
+
|
|
452
|
+
ConvertRequest:
|
|
453
|
+
type: object
|
|
454
|
+
required:
|
|
455
|
+
- source
|
|
456
|
+
- format
|
|
457
|
+
properties:
|
|
458
|
+
source:
|
|
459
|
+
description: The source document to be converted.
|
|
460
|
+
oneOf:
|
|
461
|
+
- $ref: '#/components/schemas/AsyncAPIDocument'
|
|
462
|
+
- $ref: '#/components/schemas/OpenAPIDocument'
|
|
463
|
+
- $ref: '#/components/schemas/PostmanCollectionDocument'
|
|
464
|
+
target-version:
|
|
465
|
+
description: The version of the AsyncAPI document to be converted to (only applicable for AsyncAPI documents).
|
|
466
|
+
$ref: '#/components/schemas/SpecVersions'
|
|
467
|
+
perspective:
|
|
468
|
+
type: string
|
|
469
|
+
description: The perspective of the conversion, e.g. "server", "client".
|
|
470
|
+
default: server
|
|
471
|
+
enum:
|
|
472
|
+
- server
|
|
473
|
+
- client
|
|
474
|
+
format:
|
|
475
|
+
type: string
|
|
476
|
+
description: The format of the source document to be converted.
|
|
477
|
+
enum:
|
|
478
|
+
- asyncapi
|
|
479
|
+
- openapi
|
|
480
|
+
- postman-collection
|
|
481
|
+
ConvertResponse:
|
|
482
|
+
type: object
|
|
483
|
+
properties:
|
|
484
|
+
converted:
|
|
485
|
+
$ref: '#/components/schemas/AsyncAPIDocument'
|
|
486
|
+
|
|
487
|
+
BundleRequest:
|
|
488
|
+
type: object
|
|
489
|
+
required:
|
|
490
|
+
- asyncapis
|
|
491
|
+
properties:
|
|
492
|
+
asyncapis:
|
|
493
|
+
$ref: "#/components/schemas/AsyncAPIDocuments"
|
|
494
|
+
base:
|
|
495
|
+
$ref: "#/components/schemas/AsyncAPIDocument"
|
|
496
|
+
BundleResponse:
|
|
497
|
+
type: object
|
|
498
|
+
required:
|
|
499
|
+
- bundled
|
|
500
|
+
properties:
|
|
501
|
+
bundled:
|
|
502
|
+
$ref: "#/components/schemas/AsyncAPIDocument"
|
|
503
|
+
|
|
504
|
+
DiffRequest:
|
|
505
|
+
type: object
|
|
506
|
+
required:
|
|
507
|
+
- asyncapis
|
|
508
|
+
properties:
|
|
509
|
+
asyncapis:
|
|
510
|
+
type: array
|
|
511
|
+
minItems: 2
|
|
512
|
+
maxItems: 2
|
|
513
|
+
items:
|
|
514
|
+
$ref: '#/components/schemas/AsyncAPIDocument'
|
|
515
|
+
DiffResponse:
|
|
516
|
+
type: object
|
|
517
|
+
properties:
|
|
518
|
+
diff:
|
|
519
|
+
type: [object, string]
|
|
520
|
+
description: The diff between the two AsyncAPI documents.
|
|
521
|
+
|
|
522
|
+
HelpListResponse:
|
|
523
|
+
type: object
|
|
524
|
+
properties:
|
|
525
|
+
commands:
|
|
526
|
+
type: array
|
|
527
|
+
items:
|
|
528
|
+
type: string
|
|
529
|
+
description: A list of all available commands.
|
|
530
|
+
HelpCommandResponse:
|
|
531
|
+
type: object
|
|
532
|
+
description: Detailed help information for a specific command.
|
|
533
|
+
properties:
|
|
534
|
+
command:
|
|
535
|
+
type: string
|
|
536
|
+
description: The name of the command.
|
|
537
|
+
description:
|
|
538
|
+
type: string
|
|
539
|
+
description: Detailed description of the command.
|
|
540
|
+
|
|
541
|
+
Problem:
|
|
542
|
+
type: object
|
|
543
|
+
properties:
|
|
544
|
+
type:
|
|
545
|
+
type: string
|
|
546
|
+
format: uri
|
|
547
|
+
description: |
|
|
548
|
+
An absolute URI that identifies the problem type. When dereferenced,
|
|
549
|
+
it SHOULD provide human-readable documentation for the problem type
|
|
550
|
+
(e.g., using HTML).
|
|
551
|
+
default: "about:blank"
|
|
552
|
+
example: "https://api.asyncapi.com/problem/invalid-template-parameters"
|
|
553
|
+
title:
|
|
554
|
+
type: string
|
|
555
|
+
description: |
|
|
556
|
+
A short, summary of the problem type. Written in english and readable.
|
|
557
|
+
example: Invalid AsyncAPI document.
|
|
558
|
+
status:
|
|
559
|
+
type: integer
|
|
560
|
+
format: int32
|
|
561
|
+
description: |
|
|
562
|
+
The HTTP status code generated by the origin server for this occurrence
|
|
563
|
+
of the problem.
|
|
564
|
+
minimum: 100
|
|
565
|
+
maximum: 600
|
|
566
|
+
exclusiveMaximum: true
|
|
567
|
+
example: 422
|
|
568
|
+
detail:
|
|
569
|
+
type: string
|
|
570
|
+
description: |
|
|
571
|
+
A human readable explanation specific to this occurrence of the problem.
|
|
572
|
+
example: Connection to database timed out
|
|
573
|
+
instance:
|
|
574
|
+
type: string
|
|
575
|
+
format: uri
|
|
576
|
+
description: |
|
|
577
|
+
An absolute URI that identifies the specific occurrence of the problem.
|
|
578
|
+
It may or may not yield further information if dereferenced.
|
|
579
|
+
required:
|
|
580
|
+
- type
|
|
581
|
+
- title
|
|
582
|
+
- status
|
|
583
|
+
additionalProperties: true
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asyncapi/cli",
|
|
3
3
|
"description": "All in one CLI for all AsyncAPI tools",
|
|
4
|
-
"version": "3.4.
|
|
4
|
+
"version": "3.4.2",
|
|
5
5
|
"author": "@asyncapi",
|
|
6
6
|
"bin": {
|
|
7
7
|
"asyncapi": "./bin/run_bin"
|
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
"@types/mocha": "^10.0.2",
|
|
75
75
|
"@types/node": "^22.13.10",
|
|
76
76
|
"@types/rimraf": "^3.0.2",
|
|
77
|
+
"@types/supertest": "^6.0.3",
|
|
77
78
|
"@types/uuid": "^10.0.0",
|
|
78
79
|
"@types/ws": "^8.2.0",
|
|
79
80
|
"@typescript-eslint/eslint-plugin": "^5.38.1",
|
|
@@ -93,6 +94,7 @@
|
|
|
93
94
|
"nyc": "^15.1.0",
|
|
94
95
|
"rimraf": "^3.0.2",
|
|
95
96
|
"simple-git": "^3.16.0",
|
|
97
|
+
"supertest": "^7.1.4",
|
|
96
98
|
"ts-node": "^10.9.1",
|
|
97
99
|
"tsc-alias": "^1.8.16",
|
|
98
100
|
"tsconfig-paths": "^4.2.0",
|
|
@@ -107,6 +109,7 @@
|
|
|
107
109
|
"/assets",
|
|
108
110
|
"/scripts",
|
|
109
111
|
"/npm-shrinkwrap.json",
|
|
112
|
+
"/openapi.yaml",
|
|
110
113
|
"/oclif.manifest.json"
|
|
111
114
|
],
|
|
112
115
|
"homepage": "https://github.com/asyncapi/cli",
|
|
@@ -182,15 +185,19 @@
|
|
|
182
185
|
"posttest": "rimraf ./test.asyncapi-cli",
|
|
183
186
|
"postinstall": "node ./scripts/enableAutoComplete.js",
|
|
184
187
|
"test": "npm run cli:test && npm run action:test",
|
|
185
|
-
"cli:test": "cross-env NODE_ENV=development TEST=1 CUSTOM_CONTEXT_FILENAME=\"test.asyncapi-cli\" CUSTOM_CONTEXT_FILE_LOCATION=\"\" nyc --extension .ts mocha --require ts-node/register --require tsconfig-paths/register --require test/helpers/init.js --reporter spec --timeout 100000 \"test/**/*.test.ts\"",
|
|
186
|
-
"test
|
|
188
|
+
"cli:test": "cross-env NODE_ENV=development TEST=1 CUSTOM_CONTEXT_FILENAME=\"test.asyncapi-cli\" CUSTOM_CONTEXT_FILE_LOCATION=\"\" NODE_CONFIG_DIR=\"./src/apps/api/configs\" nyc --extension .ts mocha --require ts-node/register --require tsconfig-paths/register --require test/helpers/init.js --reporter spec --timeout 100000 \"test/**/*.test.ts\"",
|
|
189
|
+
"unit:test": "cross-env NODE_ENV=development TEST=1 CUSTOM_CONTEXT_FILENAME=\"test.asyncapi-cli\" CUSTOM_CONTEXT_FILE_LOCATION=\"\" NODE_CONFIG_DIR=\"./src/apps/api/configs\" nyc --extension .ts mocha --require ts-node/register --require tsconfig-paths/register --require test/helpers/init.js --reporter spec --timeout 100000 \"test/unit/**/*.test.ts\"",
|
|
190
|
+
"test:one": "cross-env NODE_ENV=development TEST=1 CUSTOM_CONTEXT_FILENAME=\"test.asyncapi-cli\" CUSTOM_CONTEXT_FILE_LOCATION=\"\" NODE_CONFIG_DIR=\"./src/apps/api/configs\" nyc --extension .ts mocha --require ts-node/register --require tsconfig-paths/register --require test/helpers/init.js --reporter spec --timeout 100000",
|
|
187
191
|
"get-version": "echo $npm_package_version",
|
|
188
192
|
"createhook": "oclif generate hook myhook --event=command_not_found",
|
|
189
193
|
"createhookinit": "oclif generate hook inithook --event=init",
|
|
190
194
|
"action:docker:build": "docker build -f github-action/Dockerfile -t asyncapi/github-action-for-cli:latest .",
|
|
191
195
|
"action:test": "npm run build && cd github-action && make test",
|
|
192
196
|
"api:dev": "cross-env NODE_ENV=development PORT=3000 nodemon",
|
|
193
|
-
"api:
|
|
197
|
+
"api:prod": "npm run api:build && cross-env NODE_ENV=production PORT=80 node lib/apps/api/server.js",
|
|
198
|
+
"api:docker": "docker run -it -p 80:80 asyncapi/server-api",
|
|
199
|
+
"api:build:docker": "docker build -t asyncapi/server-api -f ./src/apps/api/Dockerfile .",
|
|
200
|
+
"api:build": "rimraf lib && tsc && tsc-alias --project tsconfig.json",
|
|
194
201
|
"api:test": ""
|
|
195
202
|
},
|
|
196
203
|
"types": "lib/index.d.ts"
|