@asyncapi/cli 0.35.0 → 0.37.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
@@ -70,6 +70,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
70
70
  <td align="center" valign="top" width="14.28%"><a href="https://samridhi-98.github.io/Portfolio"><img src="https://avatars.githubusercontent.com/u/54466041?v=4?s=100" width="100px;" alt="Samriddhi"/><br /><sub><b>Samriddhi</b></sub></a><br /><a href="https://github.com/asyncapi/cli/commits?author=Samridhi-98" title="Tests">⚠️</a></td>
71
71
  <td align="center" valign="top" width="14.28%"><a href="https://linktr.ee/KharabePranay"><img src="https://avatars.githubusercontent.com/u/68046838?v=4?s=100" width="100px;" alt="Pranay Kharabe"/><br /><sub><b>Pranay Kharabe</b></sub></a><br /><a href="https://github.com/asyncapi/cli/commits?author=pranay202" title="Code">💻</a></td>
72
72
  <td align="center" valign="top" width="14.28%"><a href="https://d-m-oladele.netlify.app/"><img src="https://avatars.githubusercontent.com/u/98895460?v=4?s=100" width="100px;" alt="Damilola Oladele"/><br /><sub><b>Damilola Oladele</b></sub></a><br /><a href="https://github.com/asyncapi/cli/commits?author=activus-d" title="Documentation">📖</a></td>
73
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/prayutsu"><img src="https://avatars.githubusercontent.com/u/54636525?v=4?s=100" width="100px;" alt="Abhay Garg"/><br /><sub><b>Abhay Garg</b></sub></a><br /><a href="https://github.com/asyncapi/cli/commits?author=prayutsu" title="Code">💻</a> <a href="https://github.com/asyncapi/cli/commits?author=prayutsu" title="Tests">⚠️</a></td>
73
74
  </tr>
74
75
  </tbody>
75
76
  </table>
@@ -0,0 +1,15 @@
1
+ import { Example } from '@oclif/core/lib/interfaces';
2
+ import Command from '../base';
3
+ export default class Bundle extends Command {
4
+ static description: string;
5
+ static strict: boolean;
6
+ static examples: Example[];
7
+ static flags: {
8
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
9
+ output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
10
+ 'reference-into-components': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ base: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
12
+ };
13
+ run(): Promise<void>;
14
+ loadFiles(filepaths: string[]): Promise<string[]>;
15
+ }
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const core_1 = require("@oclif/core");
5
+ const base_1 = tslib_1.__importDefault(require("../base"));
6
+ const bundler_1 = tslib_1.__importDefault(require("@asyncapi/bundler"));
7
+ const fs_1 = require("fs");
8
+ const path_1 = tslib_1.__importDefault(require("path"));
9
+ const SpecificationFile_1 = require("../models/SpecificationFile");
10
+ const { writeFile } = fs_1.promises;
11
+ class Bundle extends base_1.default {
12
+ run() {
13
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
14
+ const { argv, flags } = yield this.parse(Bundle);
15
+ const output = flags.output;
16
+ let baseFile;
17
+ const outputFormat = path_1.default.extname(argv[0]);
18
+ const AsyncAPIFiles = yield this.loadFiles(argv);
19
+ if (flags.base) {
20
+ baseFile = (yield (0, SpecificationFile_1.load)(flags.base)).text();
21
+ }
22
+ const document = yield (0, bundler_1.default)(AsyncAPIFiles, {
23
+ referenceIntoComponents: flags['reference-into-components'],
24
+ base: baseFile
25
+ });
26
+ if (!output) {
27
+ if (outputFormat === '.yaml' || outputFormat === '.yml') {
28
+ this.log(document.yml());
29
+ }
30
+ else {
31
+ this.log(JSON.stringify(document.json()));
32
+ }
33
+ }
34
+ else {
35
+ const format = path_1.default.extname(output);
36
+ if (format === '.yml' || format === '.yaml') {
37
+ yield writeFile(path_1.default.resolve(process.cwd(), output), document.yml(), {
38
+ encoding: 'utf-8',
39
+ });
40
+ }
41
+ if (format === '.json') {
42
+ yield writeFile(path_1.default.resolve(process.cwd(), output), document.json(), {
43
+ encoding: 'utf-8',
44
+ });
45
+ }
46
+ this.log(`Check out your shiny new bundled files at ${output}`);
47
+ }
48
+ });
49
+ }
50
+ loadFiles(filepaths) {
51
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
52
+ const files = [];
53
+ for (const filepath of filepaths) {
54
+ const file = yield (0, SpecificationFile_1.load)(filepath);
55
+ files.push(file.text());
56
+ }
57
+ return files;
58
+ });
59
+ }
60
+ }
61
+ exports.default = Bundle;
62
+ Bundle.description = 'bundle one or multiple asyncapi documents and their references together.';
63
+ Bundle.strict = false;
64
+ Bundle.examples = [
65
+ 'asyncapi bundle ./asyncapi.yaml > final-asyncapi.yaml',
66
+ 'asyncapi bundle ./asyncapi.yaml --output final-asyncapi.yaml',
67
+ 'asyncapi bundle ./asyncapi.yaml ./features.yaml --reference-into-components',
68
+ 'asyncapi bundle ./asyncapi.yaml ./features.yaml --base ./asyncapi.yaml --reference-into-components'
69
+ ];
70
+ Bundle.flags = {
71
+ help: core_1.Flags.help({ char: 'h' }),
72
+ output: core_1.Flags.string({ char: 'o', description: 'The output file name. Omitting this flag the result will be printed in the console.' }),
73
+ 'reference-into-components': core_1.Flags.boolean({ char: 'r', description: 'Bundle the message $refs into components object.' }),
74
+ base: core_1.Flags.string({ char: 'b', description: 'Path to the file which will act as a base. This is required when some properties are to needed to be overwritten.' }),
75
+ };
@@ -16,6 +16,7 @@ var Languages;
16
16
  Languages["dart"] = "dart";
17
17
  Languages["python"] = "python";
18
18
  Languages["rust"] = "rust";
19
+ Languages["kotlin"] = "kotlin";
19
20
  })(Languages || (Languages = {}));
20
21
  const possibleLanguageValues = Object.values(Languages).join(', ');
21
22
  class Models extends base_1.default {
@@ -121,6 +122,15 @@ class Models extends base_1.default {
121
122
  packageName
122
123
  };
123
124
  break;
125
+ case Languages.kotlin:
126
+ if (packageName === undefined) {
127
+ throw new Error('In order to generate models to Kotlin, we need to know which package they are under. Add `--packageName=PACKAGENAME` to set the desired package name.');
128
+ }
129
+ fileGenerator = new modelina_1.KotlinFileGenerator();
130
+ fileOptions = {
131
+ packageName
132
+ };
133
+ break;
124
134
  default:
125
135
  throw new Error(`Could not determine generator for language ${language}, are you using one of the following values ${possibleLanguageValues}?`);
126
136
  }
@@ -193,7 +203,7 @@ Models.flags = Object.assign({ help: core_1.Flags.help({ char: 'h' }), output: c
193
203
  * Go and Java specific package name to use for the generated models
194
204
  */
195
205
  packageName: core_1.Flags.string({
196
- description: 'Go and Java specific, define the package to use for the generated models. This is required when language is `go` or `java`.',
206
+ description: 'Go, Java and Kotlin specific, define the package to use for the generated models. This is required when language is `go`, `java` or `kotlin`.',
197
207
  required: false
198
208
  }),
199
209
  /**
@@ -1 +1 @@
1
- {"version":"0.35.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.6.0"}},"args":[{"name":"spec-file","description":"spec path, url, or context-name","required":false}]},"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},"log-diagnostics":{"name":"log-diagnostics","type":"boolean","description":"log validation diagnostics or not","allowNo":true},"diagnostics-format":{"name":"diagnostics-format","type":"option","description":"format to use for validation diagnostics","helpValue":"(json|stylish|junit|html|text|teamcity|pretty)","multiple":false,"options":["json","stylish","junit","html","text","teamcity","pretty"],"default":"stylish"},"fail-severity":{"name":"fail-severity","type":"option","description":"diagnostics of this level or above will trigger a failure exit code","helpValue":"(error|warn|info|hint)","multiple":false,"options":["error","warn","info","hint"],"default":"error"}},"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}]},"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":[]},"optimize":{"id":"optimize","description":"optimize asyncapi specification file","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"examples":["asyncapi optimize ./asyncapi.yaml","asyncapi optimize ./asyncapi.yaml --no-tty","asyncapi optimize ./asyncapi.yaml --optimization=remove-components,reuse-components,move-to-components --no-tty","asyncapi optimize ./asyncapi.yaml --optimization=remove-components,reuse-components,move-to-components --output=terminal --no-tty"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"optimization":{"name":"optimization","type":"option","char":"p","description":"select the type of optimizations that you want to apply.","multiple":true,"options":["remove-components","reuse-components","move-to-components"],"default":["remove-components","reuse-components","move-to-components"]},"output":{"name":"output","type":"option","char":"o","description":"select where you want the output.","multiple":false,"options":["terminal","new-file","overwrite"],"default":"terminal"},"no-tty":{"name":"no-tty","type":"boolean","description":"do not use an interactive terminal","allowNo":false}},"args":[{"name":"spec-file","description":"spec path, url, or context-name","required":false}]},"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},"log-diagnostics":{"name":"log-diagnostics","type":"boolean","description":"log validation diagnostics or not","allowNo":true},"diagnostics-format":{"name":"diagnostics-format","type":"option","description":"format to use for validation diagnostics","helpValue":"(json|stylish|junit|html|text|teamcity|pretty)","multiple":false,"options":["json","stylish","junit","html","text","teamcity","pretty"],"default":"stylish"},"fail-severity":{"name":"fail-severity","type":"option","description":"diagnostics of this level or above will trigger a failure exit code","helpValue":"(error|warn|info|hint)","multiple":false,"options":["error","warn","info","hint"],"default":"error"}},"args":[{"name":"spec-file","description":"spec path, url, or context-name","required":false}]},"config":{"id":"config","description":"CLI config settings","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"generate:fromTemplate":{"id":"generate:fromTemplate","description":"Generates whatever you want using templates compatible with AsyncAPI Generator.","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"examples":["asyncapi generate fromTemplate asyncapi.yaml @asyncapi/html-template --param version=1.0.0 singleFile=true --output ./docs --force-write"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"disable-hook":{"name":"disable-hook","type":"option","char":"d","description":"Disable a specific hook type or hooks from a given hook type","multiple":true},"install":{"name":"install","type":"boolean","char":"i","description":"Installs the template and its dependencies (defaults to false)","allowNo":false},"debug":{"name":"debug","type":"boolean","description":"Enable more specific errors in the console","allowNo":false},"no-overwrite":{"name":"no-overwrite","type":"option","char":"n","description":"Glob or path of the file(s) to skip when regenerating","multiple":true},"output":{"name":"output","type":"option","char":"o","description":"Directory where to put the generated files (defaults to current directory)","multiple":false},"force-write":{"name":"force-write","type":"boolean","description":"Force writing of the generated files to given directory even if it is a git repo with unstaged files or not empty dir (defaults to false)","allowNo":false},"watch":{"name":"watch","type":"boolean","char":"w","description":"Watches the template directory and the AsyncAPI document, and re-generate the files when changes occur. Ignores the output directory.","allowNo":false},"param":{"name":"param","type":"option","char":"p","description":"Additional param to pass to templates","multiple":true},"map-base-url":{"name":"map-base-url","type":"option","description":"Maps all schema references from base url to local folder","multiple":false}},"args":[{"name":"asyncapi","description":"- Local path, url or context-name pointing to AsyncAPI file","required":true},{"name":"template","description":"- Name of the generator template like for example @asyncapi/html-template or https://github.com/asyncapi/html-template","required":true}]},"generate":{"id":"generate","description":"Generate typed models or other things like clients, applications or docs using AsyncAPI Generator templates.","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},"tsModelType":{"name":"tsModelType","type":"option","description":"TypeScript specific, define which type of model needs to be generated.","required":false,"multiple":false,"options":["class","interface"],"default":"class"},"tsEnumType":{"name":"tsEnumType","type":"option","description":"TypeScript specific, define which type of enums needs to be generated.","required":false,"multiple":false,"options":["enum","union"],"default":"enum"},"tsModuleSystem":{"name":"tsModuleSystem","type":"option","description":"TypeScript specific, define the module system to be used.","required":false,"multiple":false,"options":["ESM","CJS"],"default":"ESM"},"tsExportType":{"name":"tsExportType","type":"option","description":"TypeScript specific, define which type of export needs to be generated.","required":false,"multiple":false,"options":["default","named"],"default":"default"},"tsJsonBinPack":{"name":"tsJsonBinPack","type":"boolean","description":"TypeScript specific, define basic support for serializing to and from binary with jsonbinpack.","required":false,"allowNo":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},"csharpAutoImplement":{"name":"csharpAutoImplement","type":"boolean","description":"C# specific, define whether to generate auto-implemented properties or not.","required":false,"allowNo":false},"csharpArrayType":{"name":"csharpArrayType","type":"option","description":"C# specific, define which type of array needs to be generated.","required":false,"multiple":false,"options":["Array","List"],"default":"Array"},"log-diagnostics":{"name":"log-diagnostics","type":"boolean","description":"log validation diagnostics or not","allowNo":true},"diagnostics-format":{"name":"diagnostics-format","type":"option","description":"format to use for validation diagnostics","helpValue":"(json|stylish|junit|html|text|teamcity|pretty)","multiple":false,"options":["json","stylish","junit","html","text","teamcity","pretty"],"default":"stylish"},"fail-severity":{"name":"fail-severity","type":"option","description":"diagnostics of this level or above will trigger a failure exit code","helpValue":"(error|warn|info|hint)","multiple":false,"options":["error","warn","info","hint"],"default":"error"}},"args":[{"name":"language","description":"The language you want the typed models generated for.","required":true,"options":["typescript","csharp","golang","java","javascript","dart","python","rust"]},{"name":"file","description":"Path or URL to the AsyncAPI document, or context-name","required":true}]},"start":{"id":"start","description":"Start asyncapi studio","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":[]},"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}]},"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":[]},"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":[]},"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}]},"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}]}}}
1
+ {"version":"0.37.0","commands":{"bundle":{"id":"bundle","description":"bundle one or multiple asyncapi documents and their references together.","strict":false,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"examples":["asyncapi bundle ./asyncapi.yaml > final-asyncapi.yaml","asyncapi bundle ./asyncapi.yaml --output final-asyncapi.yaml","asyncapi bundle ./asyncapi.yaml ./features.yaml --reference-into-components","asyncapi bundle ./asyncapi.yaml ./features.yaml --base ./asyncapi.yaml --reference-into-components"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"output":{"name":"output","type":"option","char":"o","description":"The output file name. Omitting this flag the result will be printed in the console.","multiple":false},"reference-into-components":{"name":"reference-into-components","type":"boolean","char":"r","description":"Bundle the message $refs into components object.","allowNo":false},"base":{"name":"base","type":"option","char":"b","description":"Path to the file which will act as a base. This is required when some properties are to needed to be overwritten.","multiple":false}},"args":[]},"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.6.0"}},"args":[{"name":"spec-file","description":"spec path, url, or context-name","required":false}]},"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},"log-diagnostics":{"name":"log-diagnostics","type":"boolean","description":"log validation diagnostics or not","allowNo":true},"diagnostics-format":{"name":"diagnostics-format","type":"option","description":"format to use for validation diagnostics","helpValue":"(json|stylish|junit|html|text|teamcity|pretty)","multiple":false,"options":["json","stylish","junit","html","text","teamcity","pretty"],"default":"stylish"},"fail-severity":{"name":"fail-severity","type":"option","description":"diagnostics of this level or above will trigger a failure exit code","helpValue":"(error|warn|info|hint)","multiple":false,"options":["error","warn","info","hint"],"default":"error"}},"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}]},"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":[]},"optimize":{"id":"optimize","description":"optimize asyncapi specification file","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"examples":["asyncapi optimize ./asyncapi.yaml","asyncapi optimize ./asyncapi.yaml --no-tty","asyncapi optimize ./asyncapi.yaml --optimization=remove-components,reuse-components,move-to-components --no-tty","asyncapi optimize ./asyncapi.yaml --optimization=remove-components,reuse-components,move-to-components --output=terminal --no-tty"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"optimization":{"name":"optimization","type":"option","char":"p","description":"select the type of optimizations that you want to apply.","multiple":true,"options":["remove-components","reuse-components","move-to-components"],"default":["remove-components","reuse-components","move-to-components"]},"output":{"name":"output","type":"option","char":"o","description":"select where you want the output.","multiple":false,"options":["terminal","new-file","overwrite"],"default":"terminal"},"no-tty":{"name":"no-tty","type":"boolean","description":"do not use an interactive terminal","allowNo":false}},"args":[{"name":"spec-file","description":"spec path, url, or context-name","required":false}]},"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},"log-diagnostics":{"name":"log-diagnostics","type":"boolean","description":"log validation diagnostics or not","allowNo":true},"diagnostics-format":{"name":"diagnostics-format","type":"option","description":"format to use for validation diagnostics","helpValue":"(json|stylish|junit|html|text|teamcity|pretty)","multiple":false,"options":["json","stylish","junit","html","text","teamcity","pretty"],"default":"stylish"},"fail-severity":{"name":"fail-severity","type":"option","description":"diagnostics of this level or above will trigger a failure exit code","helpValue":"(error|warn|info|hint)","multiple":false,"options":["error","warn","info","hint"],"default":"error"}},"args":[{"name":"spec-file","description":"spec path, url, or context-name","required":false}]},"config":{"id":"config","description":"CLI config settings","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"generate:fromTemplate":{"id":"generate:fromTemplate","description":"Generates whatever you want using templates compatible with AsyncAPI Generator.","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"examples":["asyncapi generate fromTemplate asyncapi.yaml @asyncapi/html-template --param version=1.0.0 singleFile=true --output ./docs --force-write"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"disable-hook":{"name":"disable-hook","type":"option","char":"d","description":"Disable a specific hook type or hooks from a given hook type","multiple":true},"install":{"name":"install","type":"boolean","char":"i","description":"Installs the template and its dependencies (defaults to false)","allowNo":false},"debug":{"name":"debug","type":"boolean","description":"Enable more specific errors in the console","allowNo":false},"no-overwrite":{"name":"no-overwrite","type":"option","char":"n","description":"Glob or path of the file(s) to skip when regenerating","multiple":true},"output":{"name":"output","type":"option","char":"o","description":"Directory where to put the generated files (defaults to current directory)","multiple":false},"force-write":{"name":"force-write","type":"boolean","description":"Force writing of the generated files to given directory even if it is a git repo with unstaged files or not empty dir (defaults to false)","allowNo":false},"watch":{"name":"watch","type":"boolean","char":"w","description":"Watches the template directory and the AsyncAPI document, and re-generate the files when changes occur. Ignores the output directory.","allowNo":false},"param":{"name":"param","type":"option","char":"p","description":"Additional param to pass to templates","multiple":true},"map-base-url":{"name":"map-base-url","type":"option","description":"Maps all schema references from base url to local folder","multiple":false}},"args":[{"name":"asyncapi","description":"- Local path, url or context-name pointing to AsyncAPI file","required":true},{"name":"template","description":"- Name of the generator template like for example @asyncapi/html-template or https://github.com/asyncapi/html-template","required":true}]},"generate":{"id":"generate","description":"Generate typed models or other things like clients, applications or docs using AsyncAPI Generator templates.","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},"tsModelType":{"name":"tsModelType","type":"option","description":"TypeScript specific, define which type of model needs to be generated.","required":false,"multiple":false,"options":["class","interface"],"default":"class"},"tsEnumType":{"name":"tsEnumType","type":"option","description":"TypeScript specific, define which type of enums needs to be generated.","required":false,"multiple":false,"options":["enum","union"],"default":"enum"},"tsModuleSystem":{"name":"tsModuleSystem","type":"option","description":"TypeScript specific, define the module system to be used.","required":false,"multiple":false,"options":["ESM","CJS"],"default":"ESM"},"tsExportType":{"name":"tsExportType","type":"option","description":"TypeScript specific, define which type of export needs to be generated.","required":false,"multiple":false,"options":["default","named"],"default":"default"},"tsJsonBinPack":{"name":"tsJsonBinPack","type":"boolean","description":"TypeScript specific, define basic support for serializing to and from binary with jsonbinpack.","required":false,"allowNo":false},"packageName":{"name":"packageName","type":"option","description":"Go, Java and Kotlin specific, define the package to use for the generated models. This is required when language is `go`, `java` or `kotlin`.","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},"csharpAutoImplement":{"name":"csharpAutoImplement","type":"boolean","description":"C# specific, define whether to generate auto-implemented properties or not.","required":false,"allowNo":false},"csharpArrayType":{"name":"csharpArrayType","type":"option","description":"C# specific, define which type of array needs to be generated.","required":false,"multiple":false,"options":["Array","List"],"default":"Array"},"log-diagnostics":{"name":"log-diagnostics","type":"boolean","description":"log validation diagnostics or not","allowNo":true},"diagnostics-format":{"name":"diagnostics-format","type":"option","description":"format to use for validation diagnostics","helpValue":"(json|stylish|junit|html|text|teamcity|pretty)","multiple":false,"options":["json","stylish","junit","html","text","teamcity","pretty"],"default":"stylish"},"fail-severity":{"name":"fail-severity","type":"option","description":"diagnostics of this level or above will trigger a failure exit code","helpValue":"(error|warn|info|hint)","multiple":false,"options":["error","warn","info","hint"],"default":"error"}},"args":[{"name":"language","description":"The language you want the typed models generated for.","required":true,"options":["typescript","csharp","golang","java","javascript","dart","python","rust","kotlin"]},{"name":"file","description":"Path or URL to the AsyncAPI document, or context-name","required":true}]},"start":{"id":"start","description":"Start asyncapi studio","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":[]},"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}]},"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":[]},"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":[]},"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}]},"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}]}}}
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.35.0",
4
+ "version": "0.37.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/bundler": "^0.3.8",
11
12
  "@asyncapi/converter": "^1.2.0",
12
13
  "@asyncapi/diff": "^0.4.1",
13
14
  "@asyncapi/generator": "^1.9.17",