@asyncapi/cli 1.13.0 → 1.14.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.
Files changed (36) hide show
  1. package/bin/dev +0 -1
  2. package/bin/run +0 -1
  3. package/bin/run_bin +0 -1
  4. package/lib/commands/bundle.d.ts +4 -5
  5. package/lib/commands/bundle.js +1 -0
  6. package/lib/commands/config/context/add.d.ts +3 -4
  7. package/lib/commands/config/context/add.js +4 -8
  8. package/lib/commands/config/context/edit.d.ts +3 -4
  9. package/lib/commands/config/context/edit.js +4 -8
  10. package/lib/commands/config/context/init.d.ts +2 -4
  11. package/lib/commands/config/context/init.js +3 -7
  12. package/lib/commands/config/context/remove.d.ts +2 -4
  13. package/lib/commands/config/context/remove.js +3 -7
  14. package/lib/commands/config/context/use.d.ts +2 -4
  15. package/lib/commands/config/context/use.js +3 -7
  16. package/lib/commands/convert.d.ts +4 -6
  17. package/lib/commands/convert.js +3 -3
  18. package/lib/commands/diff.d.ts +9 -10
  19. package/lib/commands/diff.js +4 -12
  20. package/lib/commands/generate/fromTemplate.d.ts +12 -13
  21. package/lib/commands/generate/fromTemplate.js +4 -4
  22. package/lib/commands/generate/models.d.ts +14 -19
  23. package/lib/commands/generate/models.js +5 -9
  24. package/lib/commands/new/file.d.ts +3 -3
  25. package/lib/commands/new/glee.d.ts +3 -3
  26. package/lib/commands/optimize.d.ts +5 -8
  27. package/lib/commands/optimize.js +3 -3
  28. package/lib/commands/start/studio.d.ts +2 -3
  29. package/lib/commands/start/studio.js +0 -1
  30. package/lib/commands/validate.d.ts +4 -6
  31. package/lib/commands/validate.js +3 -3
  32. package/lib/hooks/command_not_found/myhook.js +2 -2
  33. package/lib/parser.d.ts +3 -3
  34. package/lib/parser.js +4 -4
  35. package/oclif.manifest.json +11 -12
  36. package/package.json +3 -2
package/bin/dev CHANGED
@@ -15,4 +15,3 @@ oclif.settings.debug = true;
15
15
 
16
16
  // Start the CLI
17
17
  oclif.run().then(oclif.flush).catch(oclif.Errors.handle)
18
-
package/bin/run CHANGED
@@ -10,4 +10,3 @@ oclif.run()
10
10
  const oclifHandler = require('@oclif/core/handle');
11
11
  return oclifHandler(err.message);
12
12
  });
13
-
package/bin/run_bin CHANGED
@@ -11,4 +11,3 @@ oclif.run()
11
11
  const oclifHandler = require('@oclif/core/handle');
12
12
  return oclifHandler(err.message);
13
13
  });
14
-
@@ -1,14 +1,13 @@
1
- import { Example } from '@oclif/core/lib/interfaces';
2
1
  import Command from '../base';
3
2
  export default class Bundle extends Command {
4
3
  static readonly description = "Bundle one or multiple AsyncAPI Documents and their references together.";
5
4
  static strict: boolean;
6
- static examples: Example[];
5
+ static examples: string[];
7
6
  static flags: {
8
7
  help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
9
- output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
10
- base: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
11
- baseDir: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
8
+ output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ base: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ baseDir: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
11
  xOrigin: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
12
  };
14
13
  run(): Promise<void>;
@@ -65,6 +65,7 @@ exports.default = Bundle;
65
65
  Bundle.description = 'Bundle one or multiple AsyncAPI Documents and their references together.';
66
66
  Bundle.strict = false;
67
67
  Bundle.examples = [
68
+ 'asyncapi bundle ./asyncapi.yaml > final-asyncapi.yaml',
68
69
  'asyncapi bundle ./asyncapi.yaml --output final-asyncapi.yaml',
69
70
  'asyncapi bundle ./asyncapi.yaml ./features.yaml',
70
71
  'asyncapi bundle ./asyncapi.yaml ./features.yaml --base ./main.yaml',
@@ -6,9 +6,8 @@ export default class ContextAdd extends Command {
6
6
  'set-current': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
7
  };
8
8
  static args: {
9
- name: string;
10
- description: string;
11
- required: boolean;
12
- }[];
9
+ 'context-name': import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
10
+ 'spec-file-path': import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
11
+ };
13
12
  run(): Promise<void>;
14
13
  }
@@ -41,11 +41,7 @@ ContextAdd.flags = {
41
41
  required: false,
42
42
  })
43
43
  };
44
- ContextAdd.args = [
45
- { name: 'context-name', description: 'context name', required: true },
46
- {
47
- name: 'spec-file-path',
48
- description: 'file path of the spec file',
49
- required: true,
50
- },
51
- ];
44
+ ContextAdd.args = {
45
+ 'context-name': core_1.Args.string({ description: 'context name', required: true }),
46
+ 'spec-file-path': core_1.Args.string({ description: 'file path of the spec file', required: true }),
47
+ };
@@ -5,9 +5,8 @@ export default class ContextEdit extends Command {
5
5
  help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
6
6
  };
7
7
  static args: {
8
- name: string;
9
- description: string;
10
- required: boolean;
11
- }[];
8
+ 'context-name': import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
9
+ 'new-spec-file-path': import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
10
+ };
12
11
  run(): Promise<void>;
13
12
  }
@@ -34,11 +34,7 @@ ContextEdit.description = 'Edit a context in the store';
34
34
  ContextEdit.flags = {
35
35
  help: core_1.Flags.help({ char: 'h' }),
36
36
  };
37
- ContextEdit.args = [
38
- { name: 'context-name', description: 'context name', required: true },
39
- {
40
- name: 'new-spec-file-path',
41
- description: 'new file path of the spec file',
42
- required: true,
43
- },
44
- ];
37
+ ContextEdit.args = {
38
+ 'context-name': core_1.Args.string({ description: 'context name', required: true }),
39
+ 'new-spec-file-path': core_1.Args.string({ description: 'file path of the spec file', required: true }),
40
+ };
@@ -6,9 +6,7 @@ export default class ContextInit extends Command {
6
6
  };
7
7
  static contextFilePathMessage: string;
8
8
  static args: {
9
- name: string;
10
- description: string;
11
- required: boolean;
12
- }[];
9
+ 'context-file-path': import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
10
+ };
13
11
  run(): Promise<void>;
14
12
  }
@@ -23,10 +23,6 @@ ContextInit.contextFilePathMessage = `Specify directory in which context file sh
23
23
  - current directory : asyncapi config context init . (default)
24
24
  - root of current repository : asyncapi config context init ./
25
25
  - user's home directory : asyncapi config context init ~`;
26
- ContextInit.args = [
27
- {
28
- name: 'context-file-path',
29
- description: `${ContextInit.contextFilePathMessage}`,
30
- required: false,
31
- },
32
- ];
26
+ ContextInit.args = {
27
+ 'context-file-path': core_1.Args.string({ description: `${ContextInit.contextFilePathMessage}`, required: false })
28
+ };
@@ -5,9 +5,7 @@ export default class ContextRemove extends Command {
5
5
  help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
6
6
  };
7
7
  static args: {
8
- name: string;
9
- description: string;
10
- required: boolean;
11
- }[];
8
+ 'context-name': import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
9
+ };
12
10
  run(): Promise<void>;
13
11
  }
@@ -33,10 +33,6 @@ ContextRemove.description = 'Delete a context from the store';
33
33
  ContextRemove.flags = {
34
34
  help: core_1.Flags.help({ char: 'h' }),
35
35
  };
36
- ContextRemove.args = [
37
- {
38
- name: 'context-name',
39
- description: 'Name of the context to delete',
40
- required: true,
41
- },
42
- ];
36
+ ContextRemove.args = {
37
+ 'context-name': core_1.Args.string({ description: 'Name of the context to delete', required: true }),
38
+ };
@@ -5,9 +5,7 @@ export default class ContextUse extends Command {
5
5
  help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
6
6
  };
7
7
  static args: {
8
- name: string;
9
- description: string;
10
- required: boolean;
11
- }[];
8
+ 'context-name': import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
9
+ };
12
10
  run(): Promise<void>;
13
11
  }
@@ -33,10 +33,6 @@ ContextUse.description = 'Set a context as current';
33
33
  ContextUse.flags = {
34
34
  help: core_1.Flags.help({ char: 'h' }),
35
35
  };
36
- ContextUse.args = [
37
- {
38
- name: 'context-name',
39
- description: 'name of the saved context',
40
- required: true,
41
- },
42
- ];
36
+ ContextUse.args = {
37
+ 'context-name': core_1.Args.string({ description: 'name of the saved context', required: true }),
38
+ };
@@ -3,13 +3,11 @@ export default class Convert extends Command {
3
3
  static description: string;
4
4
  static flags: {
5
5
  help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
6
- output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
7
- 'target-version': import("@oclif/core/lib/interfaces").OptionFlag<string>;
6
+ output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ 'target-version': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
8
8
  };
9
9
  static args: {
10
- name: string;
11
- description: string;
12
- required: boolean;
13
- }[];
10
+ 'spec-file': import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
11
+ };
14
12
  run(): Promise<void>;
15
13
  }
@@ -73,6 +73,6 @@ Convert.flags = {
73
73
  output: core_1.Flags.string({ char: 'o', description: 'path to the file where the result is saved' }),
74
74
  'target-version': core_1.Flags.string({ char: 't', description: 'asyncapi version to convert to', default: latestVersion })
75
75
  };
76
- Convert.args = [
77
- { name: 'spec-file', description: 'spec path, url, or context-name', required: false },
78
- ];
76
+ Convert.args = {
77
+ 'spec-file': core_1.Args.string({ description: 'spec path, url, or context-name', required: false }),
78
+ };
@@ -4,21 +4,20 @@ export default class Diff extends Command {
4
4
  static description: string;
5
5
  static flags: {
6
6
  'log-diagnostics': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
- 'diagnostics-format': import("@oclif/core/lib/interfaces").OptionFlag<import("@stoplight/spectral-cli/dist/services/config").OutputFormat>;
8
- 'fail-severity': import("@oclif/core/lib/interfaces").OptionFlag<import("../parser").SeverityKind>;
7
+ 'diagnostics-format': import("@oclif/core/lib/interfaces").OptionFlag<import("@stoplight/spectral-cli/dist/services/config").OutputFormat, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ 'fail-severity': import("@oclif/core/lib/interfaces").OptionFlag<"error" | "warn" | "info" | "hint", import("@oclif/core/lib/interfaces").CustomOptions>;
9
9
  help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
10
- format: import("@oclif/core/lib/interfaces").OptionFlag<string>;
11
- type: import("@oclif/core/lib/interfaces").OptionFlag<string>;
12
- markdownSubtype: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
13
- overrides: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
10
+ format: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ type: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ markdownSubtype: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ overrides: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
14
  'no-error': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
15
  watch: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
16
  };
17
17
  static args: {
18
- name: string;
19
- description: string;
20
- required: boolean;
21
- }[];
18
+ old: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
19
+ new: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
20
+ };
22
21
  run(): Promise<void>;
23
22
  outputJSON(diffOutput: AsyncAPIDiff, outputType: string): void;
24
23
  outputYAML(diffOutput: AsyncAPIDiff, outputType: string): void;
@@ -167,18 +167,10 @@ Diff.flags = Object.assign({ help: core_1.Flags.help({ char: 'h' }), format: cor
167
167
  }), 'no-error': core_1.Flags.boolean({
168
168
  description: 'don\'t show error on breaking changes',
169
169
  }), watch: (0, flags_1.watchFlag)() }, (0, parser_1.validationFlags)({ logDiagnostics: false }));
170
- Diff.args = [
171
- {
172
- name: 'old',
173
- description: 'old spec path, URL or context-name',
174
- required: true,
175
- },
176
- {
177
- name: 'new',
178
- description: 'new spec path, URL or context-name',
179
- required: true,
180
- },
181
- ];
170
+ Diff.args = {
171
+ old: core_1.Args.string({ description: 'old spec path, URL or context-name', required: true }),
172
+ new: core_1.Args.string({ description: 'new spec path, URL or context-name', required: true }),
173
+ };
182
174
  /**
183
175
  * A generic output function for diff output
184
176
  * @param diffOutput The diff output data
@@ -1,29 +1,28 @@
1
1
  import Command from '../../base';
2
2
  import { Parser } from '@asyncapi/parser';
3
- import type { Example } from '@oclif/core/lib/interfaces';
4
3
  export default class Template extends Command {
5
4
  static description: string;
6
- static examples: Example[];
5
+ static examples: string[];
7
6
  static flags: {
8
7
  help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
9
- 'disable-hook': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined>;
8
+ 'disable-hook': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
9
  'no-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
10
  install: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
11
  debug: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
- 'no-overwrite': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined>;
14
- output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
12
+ 'no-overwrite': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
15
14
  'force-write': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
15
  watch: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
17
- param: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined>;
18
- 'map-base-url': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
19
- 'registry-url': import("@oclif/core/lib/interfaces").OptionFlag<string>;
20
- 'registry-auth': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
21
- 'registry-token': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
16
+ param: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
17
+ 'map-base-url': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
18
+ 'registry-url': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
19
+ 'registry-auth': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
20
+ 'registry-token': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
22
21
  };
23
22
  static args: {
24
- name: string;
25
- description: string;
26
- }[];
23
+ asyncapi: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
24
+ template: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
25
+ };
27
26
  parser: Parser;
28
27
  run(): Promise<void>;
29
28
  private parseArgs;
@@ -399,7 +399,7 @@ Template.flags = {
399
399
  description: 'The npm registry authentication token, that can be passed instead of base64 encoded username and password'
400
400
  })
401
401
  };
402
- Template.args = [
403
- { name: 'asyncapi', description: '- Local path, url or context-name pointing to AsyncAPI file' },
404
- { name: 'template', description: '- Name of the generator template like for example @asyncapi/html-template or https://github.com/asyncapi/html-template' },
405
- ];
402
+ Template.args = {
403
+ asyncapi: core_1.Args.string({ description: '- Local path, url or context-name pointing to AsyncAPI file', required: true }),
404
+ template: core_1.Args.string({ description: '- Name of the generator template like for example @asyncapi/html-template or https://github.com/asyncapi/html-template', required: true }),
405
+ };
@@ -1,37 +1,32 @@
1
1
  import Command from '../../base';
2
2
  export default class Models extends Command {
3
3
  static description: string;
4
- static args: ({
5
- name: string;
6
- description: string;
7
- options: string[];
8
- } | {
9
- name: string;
10
- description: string;
11
- options?: undefined;
12
- })[];
4
+ static args: {
5
+ language: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
6
+ file: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
13
8
  static flags: {
14
9
  'log-diagnostics': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
- 'diagnostics-format': import("@oclif/core/lib/interfaces").OptionFlag<import("@stoplight/spectral-cli/dist/services/config").OutputFormat>;
16
- 'fail-severity': import("@oclif/core/lib/interfaces").OptionFlag<import("../../parser").SeverityKind>;
10
+ 'diagnostics-format': import("@oclif/core/lib/interfaces").OptionFlag<import("@stoplight/spectral-cli/dist/services/config").OutputFormat, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ 'fail-severity': import("@oclif/core/lib/interfaces").OptionFlag<"error" | "warn" | "info" | "hint", import("@oclif/core/lib/interfaces").CustomOptions>;
17
12
  help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
18
13
  'no-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
19
- output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
14
+ output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
20
15
  /**
21
16
  * TypeScript specific options
22
17
  */
23
- tsModelType: import("@oclif/core/lib/interfaces").OptionFlag<string>;
24
- tsEnumType: import("@oclif/core/lib/interfaces").OptionFlag<string>;
25
- tsModuleSystem: import("@oclif/core/lib/interfaces").OptionFlag<string>;
18
+ tsModelType: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
19
+ tsEnumType: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
20
+ tsModuleSystem: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
26
21
  tsIncludeComments: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
27
- tsExportType: import("@oclif/core/lib/interfaces").OptionFlag<string>;
22
+ tsExportType: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
28
23
  tsJsonBinPack: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
29
24
  tsMarshalling: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
30
25
  tsExampleInstance: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
31
26
  /**
32
27
  * Go and Java specific package name to use for the generated models
33
28
  */
34
- packageName: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
29
+ packageName: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
35
30
  /**
36
31
  * Java specific options
37
32
  */
@@ -41,13 +36,13 @@ export default class Models extends Command {
41
36
  /**
42
37
  * C++ and C# and PHP specific namespace to use for the generated models
43
38
  */
44
- namespace: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
39
+ namespace: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
45
40
  /**
46
41
  * C# specific options
47
42
  */
48
43
  csharpAutoImplement: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
49
44
  csharpNewtonsoft: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
50
- csharpArrayType: import("@oclif/core/lib/interfaces").OptionFlag<string>;
45
+ csharpArrayType: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
51
46
  csharpHashcode: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
52
47
  csharpEqual: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
53
48
  csharpSystemJson: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
@@ -50,7 +50,7 @@ class Models extends base_1.default {
50
50
  this.log(`Input is not a correct AsyncAPI document so it cannot be processed.${(0, parser_1.formatOutput)(severityErrors, 'stylish', 'error')}`);
51
51
  return;
52
52
  }
53
- // Modelina, atm, is not using @asyncapi/parser@v3.x but @asyncapi/parser@v2.x, so it still uses Parser-API v1.0.0.
53
+ // Modelina, atm, is not using @asyncapi/parser@v3.x but @asyncapi/parser@v2.x, so it still uses Parser-API v1.0.0.
54
54
  // This call converts the parsed document object using @asyncapi/parser@v3.x (Parser-API v2) to a document compatible with the Parser-API version in use in @asyncapi/parser@v2.x (v1)
55
55
  // This is needed until https://github.com/asyncapi/modelina/issues/1493 gets fixed.
56
56
  const convertedDoc = (0, multi_parser_1.ConvertDocumentParserAPIVersion)(document.json(), 1);
@@ -276,14 +276,10 @@ class Models extends base_1.default {
276
276
  }
277
277
  exports.default = Models;
278
278
  Models.description = 'Generates typed models';
279
- Models.args = [
280
- {
281
- name: 'language',
282
- description: 'The language you want the typed models generated for.',
283
- options: Object.keys(Languages),
284
- },
285
- { name: 'file', description: 'Path or URL to the AsyncAPI document, or context-name' },
286
- ];
279
+ Models.args = {
280
+ language: core_1.Args.string({ description: 'The language you want the typed models generated for.', options: Object.keys(Languages), required: true }),
281
+ file: core_1.Args.string({ description: 'Path or URL to the AsyncAPI document, or context-name', required: true }),
282
+ };
287
283
  Models.flags = Object.assign({ help: core_1.Flags.help({ char: 'h' }), 'no-interactive': core_1.Flags.boolean({
288
284
  description: 'Disable interactive mode and run with the provided flags.',
289
285
  required: false,
@@ -3,10 +3,10 @@ export default class NewFile extends Command {
3
3
  static description: string;
4
4
  static flags: {
5
5
  help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
6
- 'file-name': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
7
- example: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
6
+ 'file-name': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ example: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
8
  studio: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
- port: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
9
+ port: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
10
  'no-tty': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
11
  };
12
12
  static examples: string[];
@@ -10,9 +10,9 @@ export default class NewGlee extends Command {
10
10
  };
11
11
  static flags: {
12
12
  help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
13
- name: import("@oclif/core/lib/interfaces").OptionFlag<string>;
14
- template: import("@oclif/core/lib/interfaces").OptionFlag<string>;
15
- file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
13
+ name: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ template: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
16
  'force-write': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
17
17
  };
18
18
  getFilteredServers(serversObject: any): Promise<string[]>;
@@ -1,5 +1,4 @@
1
1
  import Command from '../base';
2
- import { Example } from '@oclif/core/lib/interfaces';
3
2
  import { Parser } from '@asyncapi/parser';
4
3
  export declare enum Optimizations {
5
4
  REMOVE_COMPONENTS = "remove-components",
@@ -17,18 +16,16 @@ export default class Optimize extends Command {
17
16
  isInteractive: boolean;
18
17
  selectedOptimizations?: Optimizations[];
19
18
  outputMethod?: Outputs;
20
- static examples: Example[];
19
+ static examples: string[];
21
20
  static flags: {
22
21
  help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
23
- optimization: import("@oclif/core/lib/interfaces").OptionFlag<string[]>;
24
- output: import("@oclif/core/lib/interfaces").OptionFlag<string>;
22
+ optimization: import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
23
+ output: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
25
24
  'no-tty': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
26
25
  };
27
26
  static args: {
28
- name: string;
29
- description: string;
30
- required: boolean;
31
- }[];
27
+ 'spec-file': import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
28
+ };
32
29
  parser: Parser;
33
30
  run(): Promise<void>;
34
31
  private showOptimizations;
@@ -201,6 +201,6 @@ Optimize.flags = {
201
201
  output: core_1.Flags.string({ char: 'o', default: Outputs.TERMINAL, options: Object.values(Outputs), description: 'select where you want the output.' }),
202
202
  'no-tty': core_1.Flags.boolean({ description: 'do not use an interactive terminal', default: false }),
203
203
  };
204
- Optimize.args = [
205
- { name: 'spec-file', description: 'spec path, url, or context-name', required: false },
206
- ];
204
+ Optimize.args = {
205
+ 'spec-file': core_1.Args.string({ description: 'spec path, url, or context-name', required: false }),
206
+ };
@@ -3,9 +3,8 @@ export default class StartStudio extends Command {
3
3
  static description: string;
4
4
  static flags: {
5
5
  help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
6
- file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
7
- port: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
6
+ file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ port: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
8
  };
9
- static args: never[];
10
9
  run(): Promise<void>;
11
10
  }
@@ -22,4 +22,3 @@ StartStudio.flags = {
22
22
  file: core_1.Flags.string({ char: 'f', description: 'path to the AsyncAPI file to link with Studio' }),
23
23
  port: core_1.Flags.integer({ char: 'p', description: 'port in which to start Studio' }),
24
24
  };
25
- StartStudio.args = [];
@@ -3,15 +3,13 @@ export default class Validate extends Command {
3
3
  static description: string;
4
4
  static flags: {
5
5
  'log-diagnostics': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
6
- 'diagnostics-format': import("@oclif/core/lib/interfaces").OptionFlag<import("@stoplight/spectral-cli/dist/services/config").OutputFormat>;
7
- 'fail-severity': import("@oclif/core/lib/interfaces").OptionFlag<import("../parser").SeverityKind>;
6
+ 'diagnostics-format': import("@oclif/core/lib/interfaces").OptionFlag<import("@stoplight/spectral-cli/dist/services/config").OutputFormat, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ 'fail-severity': import("@oclif/core/lib/interfaces").OptionFlag<"error" | "warn" | "info" | "hint", import("@oclif/core/lib/interfaces").CustomOptions>;
8
8
  help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
9
9
  watch: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
10
  };
11
11
  static args: {
12
- name: string;
13
- description: string;
14
- required: boolean;
15
- }[];
12
+ 'spec-file': import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
13
+ };
16
14
  run(): Promise<void>;
17
15
  }
@@ -28,6 +28,6 @@ class Validate extends base_1.default {
28
28
  exports.default = Validate;
29
29
  Validate.description = 'validate asyncapi file';
30
30
  Validate.flags = Object.assign({ help: core_1.Flags.help({ char: 'h' }), watch: (0, flags_1.watchFlag)() }, (0, parser_1.validationFlags)());
31
- Validate.args = [
32
- { name: 'spec-file', description: 'spec path, url, or context-name', required: false },
33
- ];
31
+ Validate.args = {
32
+ 'spec-file': core_1.Args.string({ description: 'spec path, url, or context-name', required: false }),
33
+ };
@@ -32,7 +32,7 @@ const hook = function (opts) {
32
32
  // if valid topic, update binHelp with topic
33
33
  binHelp = `${binHelp} ${idSplit[0]}`;
34
34
  }
35
- //if there is a topic in the opts we just upgrade the our commnad like
35
+ //if there is a topic in the opts we just upgrade the our commnad like
36
36
  // alter the suggestion in the help scenario so that help is the first command
37
37
  // otherwise the user will be presented 'did you mean 'help'?' instead of 'did you mean "help <command>"?'
38
38
  let suggestion = (/:?help:?/).test(opts.id)
@@ -46,7 +46,7 @@ const hook = function (opts) {
46
46
  if (opts.id === 'help') {
47
47
  readableSuggestion = '--help';
48
48
  }
49
- response = yield core_1.CliUx.ux.prompt(`Did you mean ${chalk_1.default.blueBright(readableSuggestion)}? [y/n]`, { timeout: 10000 });
49
+ response = yield core_1.ux.prompt(`Did you mean ${chalk_1.default.blueBright(readableSuggestion)}? [y/n]`, { timeout: 10000 });
50
50
  }
51
51
  catch (error) {
52
52
  this.log('');
package/lib/parser.d.ts CHANGED
@@ -14,10 +14,10 @@ export declare enum ValidationStatus {
14
14
  }
15
15
  export declare function validationFlags({ logDiagnostics }?: ValidationFlagsOptions): {
16
16
  'log-diagnostics': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
17
- 'diagnostics-format': import("@oclif/core/lib/interfaces").OptionFlag<OutputFormat>;
18
- 'fail-severity': import("@oclif/core/lib/interfaces").OptionFlag<SeverityKind>;
17
+ 'diagnostics-format': import("@oclif/core/lib/interfaces").OptionFlag<OutputFormat, import("@oclif/core/lib/interfaces").CustomOptions>;
18
+ 'fail-severity': import("@oclif/core/lib/interfaces").OptionFlag<"error" | "warn" | "info" | "hint", import("@oclif/core/lib/interfaces").CustomOptions>;
19
19
  };
20
- interface ValidateOptions {
20
+ export interface ValidateOptions {
21
21
  'log-diagnostics'?: boolean;
22
22
  'diagnostics-format'?: `${OutputFormat}`;
23
23
  'fail-severity'?: SeverityKind;
package/lib/parser.js CHANGED
@@ -36,16 +36,16 @@ function validationFlags({ logDiagnostics = true } = {}) {
36
36
  default: logDiagnostics,
37
37
  allowNo: true,
38
38
  }),
39
- 'diagnostics-format': core_1.Flags.enum({
39
+ 'diagnostics-format': core_1.Flags.option({
40
40
  description: 'format to use for validation diagnostics',
41
41
  options: Object.values(config_1.OutputFormat),
42
42
  default: config_1.OutputFormat.STYLISH,
43
- }),
44
- 'fail-severity': core_1.Flags.enum({
43
+ })(),
44
+ 'fail-severity': core_1.Flags.option({
45
45
  description: 'diagnostics of this level or above will trigger a failure exit code',
46
46
  options: ['error', 'warn', 'info', 'hint'],
47
47
  default: 'error',
48
- }),
48
+ })(),
49
49
  };
50
50
  }
51
51
  exports.validationFlags = validationFlags;
@@ -5,6 +5,7 @@
5
5
  "args": {},
6
6
  "description": "Bundle one or multiple AsyncAPI Documents and their references together.",
7
7
  "examples": [
8
+ "asyncapi bundle ./asyncapi.yaml > final-asyncapi.yaml",
8
9
  "asyncapi bundle ./asyncapi.yaml --output final-asyncapi.yaml",
9
10
  "asyncapi bundle ./asyncapi.yaml ./features.yaml",
10
11
  "asyncapi bundle ./asyncapi.yaml ./features.yaml --base ./main.yaml",
@@ -212,7 +213,6 @@
212
213
  "name": "diagnostics-format",
213
214
  "default": "stylish",
214
215
  "hasDynamicHelp": false,
215
- "helpValue": "(json|stylish|junit|html|text|teamcity|pretty)",
216
216
  "multiple": false,
217
217
  "options": [
218
218
  "json",
@@ -230,7 +230,6 @@
230
230
  "name": "fail-severity",
231
231
  "default": "error",
232
232
  "hasDynamicHelp": false,
233
- "helpValue": "(error|warn|info|hint)",
234
233
  "multiple": false,
235
234
  "options": [
236
235
  "error",
@@ -370,7 +369,6 @@
370
369
  "name": "diagnostics-format",
371
370
  "default": "stylish",
372
371
  "hasDynamicHelp": false,
373
- "helpValue": "(json|stylish|junit|html|text|teamcity|pretty)",
374
372
  "multiple": false,
375
373
  "options": [
376
374
  "json",
@@ -388,7 +386,6 @@
388
386
  "name": "fail-severity",
389
387
  "default": "error",
390
388
  "hasDynamicHelp": false,
391
- "helpValue": "(error|warn|info|hint)",
392
389
  "multiple": false,
393
390
  "options": [
394
391
  "error",
@@ -515,11 +512,13 @@
515
512
  "args": {
516
513
  "asyncapi": {
517
514
  "description": "- Local path, url or context-name pointing to AsyncAPI file",
518
- "name": "asyncapi"
515
+ "name": "asyncapi",
516
+ "required": true
519
517
  },
520
518
  "template": {
521
519
  "description": "- Name of the generator template like for example @asyncapi/html-template or https://github.com/asyncapi/html-template",
522
- "name": "template"
520
+ "name": "template",
521
+ "required": true
523
522
  }
524
523
  },
525
524
  "description": "Generates whatever you want using templates compatible with AsyncAPI Generator.",
@@ -682,11 +681,13 @@
682
681
  "kotlin",
683
682
  "php",
684
683
  "cplusplus"
685
- ]
684
+ ],
685
+ "required": true
686
686
  },
687
687
  "file": {
688
688
  "description": "Path or URL to the AsyncAPI document, or context-name",
689
- "name": "file"
689
+ "name": "file",
690
+ "required": true
690
691
  }
691
692
  },
692
693
  "description": "Generates typed models",
@@ -890,7 +891,6 @@
890
891
  "name": "diagnostics-format",
891
892
  "default": "stylish",
892
893
  "hasDynamicHelp": false,
893
- "helpValue": "(json|stylish|junit|html|text|teamcity|pretty)",
894
894
  "multiple": false,
895
895
  "options": [
896
896
  "json",
@@ -908,7 +908,6 @@
908
908
  "name": "fail-severity",
909
909
  "default": "error",
910
910
  "hasDynamicHelp": false,
911
- "helpValue": "(error|warn|info|hint)",
912
911
  "multiple": false,
913
912
  "options": [
914
913
  "error",
@@ -1282,7 +1281,7 @@
1282
1281
  "required": true
1283
1282
  },
1284
1283
  "new-spec-file-path": {
1285
- "description": "new file path of the spec file",
1284
+ "description": "file path of the spec file",
1286
1285
  "name": "new-spec-file-path",
1287
1286
  "required": true
1288
1287
  }
@@ -1470,5 +1469,5 @@
1470
1469
  ]
1471
1470
  }
1472
1471
  },
1473
- "version": "1.13.0"
1472
+ "version": "1.14.0"
1474
1473
  }
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": "1.13.0",
4
+ "version": "1.14.0",
5
5
  "author": "@asyncapi",
6
6
  "bin": {
7
7
  "asyncapi": "./bin/run_bin"
@@ -21,7 +21,7 @@
21
21
  "@asyncapi/raml-dt-schema-parser": "^4.0.22",
22
22
  "@asyncapi/studio": "^0.20.0",
23
23
  "@clack/prompts": "^0.7.0",
24
- "@oclif/core": "^1.26.2",
24
+ "@oclif/core": "^3",
25
25
  "@oclif/errors": "^1.3.6",
26
26
  "@oclif/plugin-not-found": "^2.3.22",
27
27
  "@smoya/asyncapi-adoption-metrics": "^2.4.7",
@@ -169,6 +169,7 @@
169
169
  "release": "semantic-release",
170
170
  "test": "npm run test:unit",
171
171
  "test:unit": "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 test/helpers/init.js --reporter spec --timeout 100000 \"test/**/*.test.ts\"",
172
+ "test:one": "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 test/helpers/init.js --reporter spec --timeout 100000",
172
173
  "get-version": "echo $npm_package_version",
173
174
  "createhook": "oclif generate hook myhook --event=command_not_found",
174
175
  "createhookinit": "oclif generate hook inithook --event=init"