@asyncapi/cli 0.20.1 → 0.21.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 +11 -3
- package/lib/commands/config/context/add.js +1 -1
- package/lib/commands/config/context/current.js +1 -1
- package/lib/commands/config/context/index.js +1 -1
- package/lib/commands/config/context/list.js +1 -1
- package/lib/commands/config/context/remove.js +1 -1
- package/lib/commands/config/context/use.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/convert.js +2 -2
- package/lib/commands/diff.js +3 -3
- package/lib/commands/generate/models.d.ts +28 -0
- package/lib/commands/generate/models.js +120 -0
- package/lib/commands/new.js +2 -2
- package/lib/commands/start/index.js +1 -1
- package/lib/commands/start/studio.js +1 -1
- package/lib/commands/validate.js +2 -2
- package/lib/globals.js +2 -2
- package/lib/models/Context.js +2 -2
- package/lib/models/SpecificationFile.js +2 -2
- package/lib/models/Studio.js +3 -3
- package/oclif.manifest.json +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -87,10 +87,18 @@ USAGE
|
|
|
87
87
|
|
|
88
88
|
COMMANDS
|
|
89
89
|
config access configs
|
|
90
|
-
diff find diff between two
|
|
91
|
-
new creates a new
|
|
90
|
+
diff find diff between two AsyncAPI files
|
|
91
|
+
new creates a new AsyncAPI file
|
|
92
92
|
start starts a new local instance of Studio
|
|
93
|
-
validate validate
|
|
93
|
+
validate validate an AsyncAPI file
|
|
94
|
+
generate generate all kinds of stuff
|
|
95
|
+
models generate all the typed models for the message payloads defined in the AsyncAPI file
|
|
96
|
+
typescript generate the models for TypeScript
|
|
97
|
+
csharp generate the models for C#
|
|
98
|
+
golang generate the models for Go
|
|
99
|
+
java generate the models for Java
|
|
100
|
+
javascript generate the models for JavaScript
|
|
101
|
+
dart generate the models for Dart
|
|
94
102
|
```
|
|
95
103
|
|
|
96
104
|
## Contributing
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
-
const base_1 =
|
|
5
|
+
const base_1 = tslib_1.__importDefault(require("../../../base"));
|
|
6
6
|
const Context_1 = require("../../../models/Context");
|
|
7
7
|
class ContextAdd extends base_1.default {
|
|
8
8
|
async run() {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
-
const base_1 =
|
|
5
|
+
const base_1 = tslib_1.__importDefault(require("../../../base"));
|
|
6
6
|
const Context_1 = require("../../../models/Context");
|
|
7
7
|
class ContextCurrent extends base_1.default {
|
|
8
8
|
async run() {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
-
const base_1 =
|
|
5
|
+
const base_1 = tslib_1.__importDefault(require("../../../base"));
|
|
6
6
|
class Context extends base_1.default {
|
|
7
7
|
async run() {
|
|
8
8
|
const Help = await (0, core_1.loadHelpClass)(this.config);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
-
const base_1 =
|
|
5
|
+
const base_1 = tslib_1.__importDefault(require("../../../base"));
|
|
6
6
|
const Context_1 = require("../../../models/Context");
|
|
7
7
|
class ContextList extends base_1.default {
|
|
8
8
|
async run() {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
-
const base_1 =
|
|
5
|
+
const base_1 = tslib_1.__importDefault(require("../../../base"));
|
|
6
6
|
const Context_1 = require("../../../models/Context");
|
|
7
7
|
class ContextRemove extends base_1.default {
|
|
8
8
|
async run() {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
-
const base_1 =
|
|
5
|
+
const base_1 = tslib_1.__importDefault(require("../../../base"));
|
|
6
6
|
const Context_1 = require("../../../models/Context");
|
|
7
7
|
class ContextUse extends base_1.default {
|
|
8
8
|
async run() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const base_1 =
|
|
4
|
+
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
6
|
class Config extends base_1.default {
|
|
7
7
|
async run() {
|
package/lib/commands/convert.js
CHANGED
|
@@ -4,13 +4,13 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
6
|
const core_1 = require("@oclif/core");
|
|
7
|
-
const base_1 =
|
|
7
|
+
const base_1 = tslib_1.__importDefault(require("../base"));
|
|
8
8
|
const validation_error_1 = require("../errors/validation-error");
|
|
9
9
|
const SpecificationFile_1 = require("../models/SpecificationFile");
|
|
10
10
|
const specification_file_1 = require("../errors/specification-file");
|
|
11
11
|
const converter_1 = require("@asyncapi/converter");
|
|
12
12
|
// @ts-ignore
|
|
13
|
-
const specs_1 =
|
|
13
|
+
const specs_1 = tslib_1.__importDefault(require("@asyncapi/specs"));
|
|
14
14
|
const latestVersion = Object.keys(specs_1.default).pop();
|
|
15
15
|
class Convert extends base_1.default {
|
|
16
16
|
async run() {
|
package/lib/commands/diff.js
CHANGED
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
/* eslint-disable sonarjs/no-duplicate-string */
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
|
-
const diff =
|
|
7
|
-
const parser =
|
|
6
|
+
const diff = tslib_1.__importStar(require("@asyncapi/diff"));
|
|
7
|
+
const parser = tslib_1.__importStar(require("@asyncapi/parser"));
|
|
8
8
|
const fs_1 = require("fs");
|
|
9
9
|
const SpecificationFile_1 = require("../models/SpecificationFile");
|
|
10
|
-
const base_1 =
|
|
10
|
+
const base_1 = tslib_1.__importDefault(require("../base"));
|
|
11
11
|
const validation_error_1 = require("../errors/validation-error");
|
|
12
12
|
const specification_file_1 = require("../errors/specification-file");
|
|
13
13
|
const diff_error_1 = require("../errors/diff-error");
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import Command from '../../base';
|
|
2
|
+
export default class Models extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: ({
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
options: string[];
|
|
8
|
+
required: boolean;
|
|
9
|
+
} | {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
required: boolean;
|
|
13
|
+
options?: undefined;
|
|
14
|
+
})[];
|
|
15
|
+
static flags: {
|
|
16
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
17
|
+
output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
18
|
+
/**
|
|
19
|
+
* Go and Java specific package name to use for the generated models
|
|
20
|
+
*/
|
|
21
|
+
packageName: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
22
|
+
/**
|
|
23
|
+
* C# specific options
|
|
24
|
+
*/
|
|
25
|
+
namespace: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
26
|
+
};
|
|
27
|
+
run(): Promise<void>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const modelina_1 = require("@asyncapi/modelina");
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
|
+
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
7
|
+
const SpecificationFile_1 = require("../../models/SpecificationFile");
|
|
8
|
+
const parser_1 = require("@asyncapi/parser");
|
|
9
|
+
var Languages;
|
|
10
|
+
(function (Languages) {
|
|
11
|
+
Languages["typescript"] = "typescript";
|
|
12
|
+
Languages["csharp"] = "csharp";
|
|
13
|
+
Languages["golang"] = "golang";
|
|
14
|
+
Languages["java"] = "java";
|
|
15
|
+
Languages["javascript"] = "javascript";
|
|
16
|
+
Languages["dart"] = "dart";
|
|
17
|
+
})(Languages || (Languages = {}));
|
|
18
|
+
const possibleLanguageValues = Object.values(Languages).join(', ');
|
|
19
|
+
class Models extends base_1.default {
|
|
20
|
+
async run() {
|
|
21
|
+
const passedArguments = await this.parse(Models);
|
|
22
|
+
const { namespace, packageName, output } = passedArguments.flags;
|
|
23
|
+
const { language, file } = passedArguments.args;
|
|
24
|
+
const inputFile = await (0, SpecificationFile_1.load)(file) || await (0, SpecificationFile_1.load)();
|
|
25
|
+
const parsedInput = await (0, parser_1.parse)(inputFile.text());
|
|
26
|
+
modelina_1.Logger.setLogger({
|
|
27
|
+
info: this.log,
|
|
28
|
+
debug: this.debug,
|
|
29
|
+
warn: this.warn,
|
|
30
|
+
error: this.error,
|
|
31
|
+
});
|
|
32
|
+
let fileGenerator;
|
|
33
|
+
let fileOptions = {};
|
|
34
|
+
switch (language) {
|
|
35
|
+
case Languages.typescript:
|
|
36
|
+
fileGenerator = new modelina_1.TypeScriptFileGenerator();
|
|
37
|
+
break;
|
|
38
|
+
case Languages.csharp:
|
|
39
|
+
if (namespace === undefined) {
|
|
40
|
+
throw new Error('In order to generate models to C#, we need to know which namespace they are under. Add `--namespace=NAMESPACE` to set the desired namespace.');
|
|
41
|
+
}
|
|
42
|
+
fileGenerator = new modelina_1.CSharpFileGenerator();
|
|
43
|
+
fileOptions = {
|
|
44
|
+
namespace
|
|
45
|
+
};
|
|
46
|
+
break;
|
|
47
|
+
case Languages.golang:
|
|
48
|
+
if (packageName === undefined) {
|
|
49
|
+
throw new Error('In order to generate models to Go, we need to know which package they are under. Add `--packageName=PACKAGENAME` to set the desired package name.');
|
|
50
|
+
}
|
|
51
|
+
fileGenerator = new modelina_1.GoFileGenerator();
|
|
52
|
+
fileOptions = {
|
|
53
|
+
packageName
|
|
54
|
+
};
|
|
55
|
+
break;
|
|
56
|
+
case Languages.java:
|
|
57
|
+
if (packageName === undefined) {
|
|
58
|
+
throw new Error('In order to generate models to Java, we need to know which package they are under. Add `--packageName=PACKAGENAME` to set the desired package name.');
|
|
59
|
+
}
|
|
60
|
+
fileGenerator = new modelina_1.JavaFileGenerator();
|
|
61
|
+
fileOptions = {
|
|
62
|
+
packageName
|
|
63
|
+
};
|
|
64
|
+
break;
|
|
65
|
+
case Languages.javascript:
|
|
66
|
+
fileGenerator = new modelina_1.JavaScriptFileGenerator();
|
|
67
|
+
break;
|
|
68
|
+
case Languages.dart:
|
|
69
|
+
if (packageName === undefined) {
|
|
70
|
+
throw new Error('In order to generate models to Dart, we need to know which package they are under. Add `--packageName=PACKAGENAME` to set the desired package name.');
|
|
71
|
+
}
|
|
72
|
+
fileGenerator = new modelina_1.DartFileGenerator();
|
|
73
|
+
fileOptions = {
|
|
74
|
+
packageName
|
|
75
|
+
};
|
|
76
|
+
break;
|
|
77
|
+
default:
|
|
78
|
+
throw new Error(`Could not determine generator for language ${language}, are you using one of the following values ${possibleLanguageValues}?`);
|
|
79
|
+
}
|
|
80
|
+
let models;
|
|
81
|
+
if (output) {
|
|
82
|
+
models = await fileGenerator.generateToFiles(parsedInput, output, { ...fileOptions, });
|
|
83
|
+
const generatedModels = models.map((model) => { return model.modelName; });
|
|
84
|
+
this.log(`Successfully generated the following models: ${generatedModels.join(', ')}`);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
models = await fileGenerator.generateCompleteModels(parsedInput, { ...fileOptions });
|
|
88
|
+
const generatedModels = models.map((model) => {
|
|
89
|
+
return `
|
|
90
|
+
## Model name: ${model.modelName}
|
|
91
|
+
${model.result}
|
|
92
|
+
`;
|
|
93
|
+
});
|
|
94
|
+
this.log(`Successfully generated the following models: ${generatedModels.join('\n')}`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.default = Models;
|
|
99
|
+
Models.description = 'Generates typed models';
|
|
100
|
+
Models.args = [
|
|
101
|
+
{
|
|
102
|
+
name: 'language',
|
|
103
|
+
description: 'The language you want the typed models generated for.',
|
|
104
|
+
options: Object.keys(Languages),
|
|
105
|
+
required: true
|
|
106
|
+
},
|
|
107
|
+
{ name: 'file', description: 'Path or URL to the AsyncAPI document, or context-name', required: true },
|
|
108
|
+
];
|
|
109
|
+
Models.flags = {
|
|
110
|
+
help: core_1.Flags.help({ char: 'h' }),
|
|
111
|
+
output: core_1.Flags.string({ char: 'o', description: 'The output directory where the models should be written to. Omitting this flag will write the models to `stdout`.', required: false }),
|
|
112
|
+
/**
|
|
113
|
+
* Go and Java specific package name to use for the generated models
|
|
114
|
+
*/
|
|
115
|
+
packageName: core_1.Flags.string({ description: 'Go and Java specific, define the package to use for the generated models. This is required when language is `go` or `java`.', required: false }),
|
|
116
|
+
/**
|
|
117
|
+
* C# specific options
|
|
118
|
+
*/
|
|
119
|
+
namespace: core_1.Flags.string({ description: 'C# specific, define the namespace to use for the generated models. This is required when language is `csharp`.', required: false }),
|
|
120
|
+
};
|
package/lib/commands/new.js
CHANGED
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
|
-
const base_1 =
|
|
7
|
-
const inquirer =
|
|
6
|
+
const base_1 = tslib_1.__importDefault(require("../base"));
|
|
7
|
+
const inquirer = tslib_1.__importStar(require("inquirer"));
|
|
8
8
|
const Studio_1 = require("../models/Studio");
|
|
9
9
|
const path_1 = require("path");
|
|
10
10
|
const { writeFile, readFile } = fs_1.promises;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const base_1 =
|
|
4
|
+
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
6
|
class Start extends base_1.default {
|
|
7
7
|
async run() {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
-
const base_1 =
|
|
5
|
+
const base_1 = tslib_1.__importDefault(require("../../base"));
|
|
6
6
|
const Studio_1 = require("../../models/Studio");
|
|
7
7
|
const SpecificationFile_1 = require("../../models/SpecificationFile");
|
|
8
8
|
class StartStudio extends base_1.default {
|
package/lib/commands/validate.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
-
const parser =
|
|
6
|
-
const base_1 =
|
|
5
|
+
const parser = tslib_1.__importStar(require("@asyncapi/parser"));
|
|
6
|
+
const base_1 = tslib_1.__importDefault(require("../base"));
|
|
7
7
|
const validation_error_1 = require("../errors/validation-error");
|
|
8
8
|
const SpecificationFile_1 = require("../models/SpecificationFile");
|
|
9
9
|
const globals_1 = require("../globals");
|
package/lib/globals.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.specWatcher = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const chokidar_1 =
|
|
6
|
-
const chalk_1 =
|
|
5
|
+
const chokidar_1 = tslib_1.__importDefault(require("chokidar"));
|
|
6
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
7
|
const GreenLog = chalk_1.default.hex('#00FF00');
|
|
8
8
|
const OrangeLog = chalk_1.default.hex('#FFA500');
|
|
9
9
|
const CHOKIDAR_CONFIG = {
|
package/lib/models/Context.js
CHANGED
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.loadContextFile = exports.setCurrentContext = exports.getCurrentContext = exports.removeContext = exports.addContext = exports.loadContext = exports.DEFAULT_CONTEXT_FILE_PATH = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
|
-
const path =
|
|
7
|
-
const os =
|
|
6
|
+
const path = tslib_1.__importStar(require("path"));
|
|
7
|
+
const os = tslib_1.__importStar(require("os"));
|
|
8
8
|
const context_error_1 = require("../errors/context-error");
|
|
9
9
|
const { readFile, writeFile } = fs_1.promises;
|
|
10
10
|
const CONTEXT_FILENAME = process.env.CONTEXT_FILENAME || '.asyncapi';
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.fileExists = exports.isURL = exports.nameType = exports.load = exports.Specification = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
|
-
const path =
|
|
7
|
-
const node_fetch_1 =
|
|
6
|
+
const path = tslib_1.__importStar(require("path"));
|
|
7
|
+
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
8
8
|
const Context_1 = require("./Context");
|
|
9
9
|
const specification_file_1 = require("../errors/specification-file");
|
|
10
10
|
const context_error_1 = require("../errors/context-error");
|
package/lib/models/Studio.js
CHANGED
|
@@ -6,10 +6,10 @@ const fs_1 = require("fs");
|
|
|
6
6
|
const specification_file_1 = require("../errors/specification-file");
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const http_1 = require("http");
|
|
9
|
-
const serve_handler_1 =
|
|
9
|
+
const serve_handler_1 = tslib_1.__importDefault(require("serve-handler"));
|
|
10
10
|
const ws_1 = require("ws");
|
|
11
|
-
const chokidar_1 =
|
|
12
|
-
const open_1 =
|
|
11
|
+
const chokidar_1 = tslib_1.__importDefault(require("chokidar"));
|
|
12
|
+
const open_1 = tslib_1.__importDefault(require("open"));
|
|
13
13
|
const { readFile, writeFile } = fs_1.promises;
|
|
14
14
|
const sockets = [];
|
|
15
15
|
const messageQueue = [];
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.
|
|
1
|
+
{"version":"0.21.0","commands":{"convert":{"id":"convert","description":"convert asyncapi documents older to newer versions","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"output":{"name":"output","type":"option","char":"o","description":"path to the file where the result is saved","multiple":false},"target-version":{"name":"target-version","type":"option","char":"t","description":"asyncapi version to convert to","multiple":false,"default":"2.4.0"}},"args":[{"name":"spec-file","description":"spec path, url, or context-name","required":false}],"_globalFlags":{}},"diff":{"id":"diff","description":"find diff between two asyncapi files","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"format":{"name":"format","type":"option","char":"f","description":"format of the output","multiple":false,"options":["json","yaml","yml"],"default":"yaml"},"type":{"name":"type","type":"option","char":"t","description":"type of the output","multiple":false,"options":["breaking","non-breaking","unclassified","all"],"default":"all"},"overrides":{"name":"overrides","type":"option","char":"o","description":"path to JSON file containing the override properties","multiple":false},"watch":{"name":"watch","type":"boolean","char":"w","description":"Enable watch mode","allowNo":false}},"args":[{"name":"old","description":"old spec path, URL or context-name","required":true},{"name":"new","description":"new spec path, URL or context-name","required":true}],"_globalFlags":{}},"new":{"id":"new","description":"creates a new asyncapi file","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"file-name":{"name":"file-name","type":"option","char":"n","description":"name of the file","multiple":false},"example":{"name":"example","type":"option","char":"e","description":"name of the example to use","multiple":false},"studio":{"name":"studio","type":"boolean","char":"s","description":"open in Studio","allowNo":false},"port":{"name":"port","type":"option","char":"p","description":"port in which to start Studio","multiple":false},"no-tty":{"name":"no-tty","type":"boolean","description":"do not use an interactive terminal","allowNo":false}},"args":[],"_globalFlags":{}},"validate":{"id":"validate","description":"validate asyncapi file","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"watch":{"name":"watch","type":"boolean","char":"w","description":"Enable watch mode","allowNo":false}},"args":[{"name":"spec-file","description":"spec path, url, or context-name","required":false}],"_globalFlags":{}},"config":{"id":"config","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"generate:models":{"id":"generate:models","description":"Generates typed models","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"output":{"name":"output","type":"option","char":"o","description":"The output directory where the models should be written to. Omitting this flag will write the models to `stdout`.","required":false,"multiple":false},"packageName":{"name":"packageName","type":"option","description":"Go and Java specific, define the package to use for the generated models. This is required when language is `go` or `java`.","required":false,"multiple":false},"namespace":{"name":"namespace","type":"option","description":"C# specific, define the namespace to use for the generated models. This is required when language is `csharp`.","required":false,"multiple":false}},"args":[{"name":"language","description":"The language you want the typed models generated for.","required":true,"options":["typescript","csharp","golang","java","javascript","dart"]},{"name":"file","description":"Path or URL to the AsyncAPI document, or context-name","required":true}],"_globalFlags":{}},"start":{"id":"start","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"start:studio":{"id":"start:studio","description":"starts a new local instance of Studio","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"file":{"name":"file","type":"option","char":"f","description":"path to the AsyncAPI file to link with Studio","multiple":false},"port":{"name":"port","type":"option","char":"p","description":"port in which to start Studio","multiple":false}},"args":[],"_globalFlags":{}},"config:context:add":{"id":"config:context:add","description":"Add or modify a context in the store","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"context-name","description":"context name","required":true},{"name":"spec-file-path","description":"file path of the spec file","required":true}],"_globalFlags":{}},"config:context:current":{"id":"config:context:current","description":"Shows the current context that is being used","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[],"_globalFlags":{}},"config:context":{"id":"config:context","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"config:context:list":{"id":"config:context:list","description":"List all the stored context in the store","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[],"_globalFlags":{}},"config:context:remove":{"id":"config:context:remove","description":"Delete a context from the store","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"context-name","description":"Name of the context to delete","required":true}],"_globalFlags":{}},"config:context:use":{"id":"config:context:use","description":"Set a context as current","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"context-name","description":"name of the saved context","required":true}],"_globalFlags":{}}}}
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asyncapi/cli",
|
|
3
3
|
"description": "All in one CLI for all AsyncAPI tools",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.21.0",
|
|
5
5
|
"author": "@asyncapi",
|
|
6
6
|
"bin": {
|
|
7
7
|
"asyncapi": "./bin/run"
|
|
8
8
|
},
|
|
9
9
|
"bugs": "https://github.com/asyncapi/cli/issues",
|
|
10
10
|
"dependencies": {
|
|
11
|
+
"@asyncapi/modelina": "^0.59.2",
|
|
11
12
|
"@asyncapi/converter": "^1.0.0",
|
|
12
13
|
"@asyncapi/diff": "^0.4.0",
|
|
13
14
|
"@asyncapi/parser": "^1.15.1",
|
|
@@ -41,7 +42,7 @@
|
|
|
41
42
|
"@types/lodash.template": "^4.4.4",
|
|
42
43
|
"@types/mocha": "^5.2.7",
|
|
43
44
|
"@types/node": "^10.17.60",
|
|
44
|
-
"@types/node-fetch": "^2.
|
|
45
|
+
"@types/node-fetch": "^2.5.12",
|
|
45
46
|
"@types/serve-handler": "^6.1.1",
|
|
46
47
|
"@types/wrap-ansi": "^8.0.1",
|
|
47
48
|
"@typescript-eslint/eslint-plugin": "^4.28.4",
|