@asyncapi-actions-test/trusted-publishing-test_asyncapi-cli 4.1.3

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 (257) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +117 -0
  3. package/assets/create-template/templates/default/asyncapi.yaml +34 -0
  4. package/assets/create-template/templates/default/package-lock.json +4062 -0
  5. package/assets/create-template/templates/default/package.json +10 -0
  6. package/assets/create-template/templates/default/readme.md +4 -0
  7. package/assets/create-template/templates/default/template/index.js +11 -0
  8. package/assets/examples/adeo-kafka-request-reply-asyncapi.yml +298 -0
  9. package/assets/examples/anyof-asyncapi.yml +36 -0
  10. package/assets/examples/application-headers-asyncapi.yml +86 -0
  11. package/assets/examples/correlation-id-asyncapi.yml +180 -0
  12. package/assets/examples/default-example.json +51 -0
  13. package/assets/examples/default-example.yaml +31 -0
  14. package/assets/examples/examples.json +82 -0
  15. package/assets/examples/gitter-streaming-asyncapi.yml +178 -0
  16. package/assets/examples/kraken-websocket-request-reply-message-filter-in-reply-asyncapi.yml +388 -0
  17. package/assets/examples/kraken-websocket-request-reply-multiple-channels-asyncapi.yml +394 -0
  18. package/assets/examples/mercure-asyncapi.yml +58 -0
  19. package/assets/examples/not-asyncapi.yml +29 -0
  20. package/assets/examples/oneof-asyncapi.yml +57 -0
  21. package/assets/examples/operation-security-asyncapi.yml +117 -0
  22. package/assets/examples/rpc-client-asyncapi.yml +72 -0
  23. package/assets/examples/rpc-server-asyncapi.yml +69 -0
  24. package/assets/examples/simple-asyncapi.yml +31 -0
  25. package/assets/examples/slack-rtm-asyncapi.yml +982 -0
  26. package/assets/examples/streetlights-kafka-asyncapi.yml +199 -0
  27. package/assets/examples/streetlights-mqtt-asyncapi.yml +253 -0
  28. package/assets/examples/streetlights-operation-security-asyncapi.yml +240 -0
  29. package/assets/examples/tutorial.yml +41 -0
  30. package/assets/examples/websocket-gemini-asyncapi.yml +301 -0
  31. package/assets/logo.png +0 -0
  32. package/assets/server-api.png +0 -0
  33. package/bin/dev +17 -0
  34. package/bin/dev.cmd +3 -0
  35. package/bin/run +12 -0
  36. package/bin/run.cmd +3 -0
  37. package/bin/run_bin +13 -0
  38. package/bin/run_bin.cmd +3 -0
  39. package/lib/apps/api/app.d.ts +15 -0
  40. package/lib/apps/api/app.js +91 -0
  41. package/lib/apps/api/configs/development.json +16 -0
  42. package/lib/apps/api/configs/production.json +16 -0
  43. package/lib/apps/api/configs/test.json +16 -0
  44. package/lib/apps/api/constants.d.ts +1 -0
  45. package/lib/apps/api/constants.js +4 -0
  46. package/lib/apps/api/controllers/bundle.controller.d.ts +7 -0
  47. package/lib/apps/api/controllers/bundle.controller.js +44 -0
  48. package/lib/apps/api/controllers/convert.controller.d.ts +11 -0
  49. package/lib/apps/api/controllers/convert.controller.js +69 -0
  50. package/lib/apps/api/controllers/diff.controller.d.ts +7 -0
  51. package/lib/apps/api/controllers/diff.controller.js +42 -0
  52. package/lib/apps/api/controllers/docs.controller.d.ts +6 -0
  53. package/lib/apps/api/controllers/docs.controller.js +24 -0
  54. package/lib/apps/api/controllers/generate.controller.d.ts +22 -0
  55. package/lib/apps/api/controllers/generate.controller.js +174 -0
  56. package/lib/apps/api/controllers/help.controller.d.ts +6 -0
  57. package/lib/apps/api/controllers/help.controller.js +101 -0
  58. package/lib/apps/api/controllers/parse.controller.d.ts +10 -0
  59. package/lib/apps/api/controllers/parse.controller.js +35 -0
  60. package/lib/apps/api/controllers/validate.controller.d.ts +10 -0
  61. package/lib/apps/api/controllers/validate.controller.js +50 -0
  62. package/lib/apps/api/controllers/version.controller.d.ts +8 -0
  63. package/lib/apps/api/controllers/version.controller.js +69 -0
  64. package/lib/apps/api/exceptions/problem.exception.d.ts +14 -0
  65. package/lib/apps/api/exceptions/problem.exception.js +10 -0
  66. package/lib/apps/api/index.d.ts +10 -0
  67. package/lib/apps/api/index.js +23 -0
  68. package/lib/apps/api/middlewares/logger.middleware.d.ts +2 -0
  69. package/lib/apps/api/middlewares/logger.middleware.js +12 -0
  70. package/lib/apps/api/middlewares/problem.middleware.d.ts +6 -0
  71. package/lib/apps/api/middlewares/problem.middleware.js +27 -0
  72. package/lib/apps/api/middlewares/validation.middleware.d.ts +12 -0
  73. package/lib/apps/api/middlewares/validation.middleware.js +245 -0
  74. package/lib/apps/api/server.d.ts +3 -0
  75. package/lib/apps/api/server.js +19 -0
  76. package/lib/apps/cli/commands/bundle.d.ts +15 -0
  77. package/lib/apps/cli/commands/bundle.js +75 -0
  78. package/lib/apps/cli/commands/config/analytics.d.ts +11 -0
  79. package/lib/apps/cli/commands/config/analytics.js +61 -0
  80. package/lib/apps/cli/commands/config/auth/add.d.ts +13 -0
  81. package/lib/apps/cli/commands/config/auth/add.js +68 -0
  82. package/lib/apps/cli/commands/config/context/add.d.ts +13 -0
  83. package/lib/apps/cli/commands/config/context/add.js +46 -0
  84. package/lib/apps/cli/commands/config/context/current.d.ts +8 -0
  85. package/lib/apps/cli/commands/config/context/current.js +37 -0
  86. package/lib/apps/cli/commands/config/context/edit.d.ts +12 -0
  87. package/lib/apps/cli/commands/config/context/edit.js +44 -0
  88. package/lib/apps/cli/commands/config/context/index.d.ts +5 -0
  89. package/lib/apps/cli/commands/config/context/index.js +16 -0
  90. package/lib/apps/cli/commands/config/context/init.d.ts +12 -0
  91. package/lib/apps/cli/commands/config/context/init.js +31 -0
  92. package/lib/apps/cli/commands/config/context/list.d.ts +8 -0
  93. package/lib/apps/cli/commands/config/context/list.js +36 -0
  94. package/lib/apps/cli/commands/config/context/remove.d.ts +11 -0
  95. package/lib/apps/cli/commands/config/context/remove.js +39 -0
  96. package/lib/apps/cli/commands/config/context/use.d.ts +11 -0
  97. package/lib/apps/cli/commands/config/context/use.js +40 -0
  98. package/lib/apps/cli/commands/config/index.d.ts +5 -0
  99. package/lib/apps/cli/commands/config/index.js +16 -0
  100. package/lib/apps/cli/commands/config/versions.d.ts +8 -0
  101. package/lib/apps/cli/commands/config/versions.js +56 -0
  102. package/lib/apps/cli/commands/convert.d.ts +21 -0
  103. package/lib/apps/cli/commands/convert.js +85 -0
  104. package/lib/apps/cli/commands/diff.d.ts +36 -0
  105. package/lib/apps/cli/commands/diff.js +335 -0
  106. package/lib/apps/cli/commands/format.d.ts +18 -0
  107. package/lib/apps/cli/commands/format.js +97 -0
  108. package/lib/apps/cli/commands/generate/client.d.ts +30 -0
  109. package/lib/apps/cli/commands/generate/client.js +94 -0
  110. package/lib/apps/cli/commands/generate/fromTemplate.d.ts +29 -0
  111. package/lib/apps/cli/commands/generate/fromTemplate.js +91 -0
  112. package/lib/apps/cli/commands/generate/index.d.ts +5 -0
  113. package/lib/apps/cli/commands/generate/index.js +15 -0
  114. package/lib/apps/cli/commands/generate/models.d.ts +16 -0
  115. package/lib/apps/cli/commands/generate/models.js +166 -0
  116. package/lib/apps/cli/commands/new/file.d.ts +16 -0
  117. package/lib/apps/cli/commands/new/file.js +180 -0
  118. package/lib/apps/cli/commands/new/index.d.ts +5 -0
  119. package/lib/apps/cli/commands/new/index.js +15 -0
  120. package/lib/apps/cli/commands/new/template.d.ts +18 -0
  121. package/lib/apps/cli/commands/new/template.js +102 -0
  122. package/lib/apps/cli/commands/optimize.d.ts +41 -0
  123. package/lib/apps/cli/commands/optimize.js +289 -0
  124. package/lib/apps/cli/commands/pretty.d.ts +12 -0
  125. package/lib/apps/cli/commands/pretty.js +70 -0
  126. package/lib/apps/cli/commands/start/api.d.ts +11 -0
  127. package/lib/apps/cli/commands/start/api.js +23 -0
  128. package/lib/apps/cli/commands/start/index.d.ts +5 -0
  129. package/lib/apps/cli/commands/start/index.js +15 -0
  130. package/lib/apps/cli/commands/start/preview.d.ts +17 -0
  131. package/lib/apps/cli/commands/start/preview.js +41 -0
  132. package/lib/apps/cli/commands/start/studio.d.ts +16 -0
  133. package/lib/apps/cli/commands/start/studio.js +94 -0
  134. package/lib/apps/cli/commands/validate.d.ts +23 -0
  135. package/lib/apps/cli/commands/validate.js +95 -0
  136. package/lib/apps/cli/internal/args/generate.args.d.ts +3 -0
  137. package/lib/apps/cli/internal/args/generate.args.js +10 -0
  138. package/lib/apps/cli/internal/base/BaseGeneratorCommand.d.ts +42 -0
  139. package/lib/apps/cli/internal/base/BaseGeneratorCommand.js +119 -0
  140. package/lib/apps/cli/internal/base.d.ts +20 -0
  141. package/lib/apps/cli/internal/base.js +173 -0
  142. package/lib/apps/cli/internal/flags/bundle.flags.d.ts +7 -0
  143. package/lib/apps/cli/internal/flags/bundle.flags.js +26 -0
  144. package/lib/apps/cli/internal/flags/config/analytics.flags.d.ts +6 -0
  145. package/lib/apps/cli/internal/flags/config/analytics.flags.js +24 -0
  146. package/lib/apps/cli/internal/flags/config/context.flags.d.ts +4 -0
  147. package/lib/apps/cli/internal/flags/config/context.flags.js +16 -0
  148. package/lib/apps/cli/internal/flags/convert.flags.d.ts +7 -0
  149. package/lib/apps/cli/internal/flags/convert.flags.js +32 -0
  150. package/lib/apps/cli/internal/flags/diff.flags.d.ts +13 -0
  151. package/lib/apps/cli/internal/flags/diff.flags.js +29 -0
  152. package/lib/apps/cli/internal/flags/format.flags.d.ts +6 -0
  153. package/lib/apps/cli/internal/flags/format.flags.js +22 -0
  154. package/lib/apps/cli/internal/flags/generate/clients.flags.d.ts +16 -0
  155. package/lib/apps/cli/internal/flags/generate/clients.flags.js +8 -0
  156. package/lib/apps/cli/internal/flags/generate/fromTemplate.flags.d.ts +16 -0
  157. package/lib/apps/cli/internal/flags/generate/fromTemplate.flags.js +8 -0
  158. package/lib/apps/cli/internal/flags/generate/models.flags.d.ts +1 -0
  159. package/lib/apps/cli/internal/flags/generate/models.flags.js +14 -0
  160. package/lib/apps/cli/internal/flags/generate/sharedFlags.d.ts +16 -0
  161. package/lib/apps/cli/internal/flags/generate/sharedFlags.js +57 -0
  162. package/lib/apps/cli/internal/flags/global.flags.d.ts +4 -0
  163. package/lib/apps/cli/internal/flags/global.flags.js +18 -0
  164. package/lib/apps/cli/internal/flags/new/file.flags.d.ts +8 -0
  165. package/lib/apps/cli/internal/flags/new/file.flags.js +20 -0
  166. package/lib/apps/cli/internal/flags/new/template.flags.d.ts +7 -0
  167. package/lib/apps/cli/internal/flags/new/template.flags.js +28 -0
  168. package/lib/apps/cli/internal/flags/optimize.flags.d.ts +21 -0
  169. package/lib/apps/cli/internal/flags/optimize.flags.js +51 -0
  170. package/lib/apps/cli/internal/flags/parser.flags.d.ts +10 -0
  171. package/lib/apps/cli/internal/flags/parser.flags.js +28 -0
  172. package/lib/apps/cli/internal/flags/pretty.flags.d.ts +3 -0
  173. package/lib/apps/cli/internal/flags/pretty.flags.js +13 -0
  174. package/lib/apps/cli/internal/flags/proxy.flags.d.ts +4 -0
  175. package/lib/apps/cli/internal/flags/proxy.flags.js +17 -0
  176. package/lib/apps/cli/internal/flags/start/api.flags.d.ts +5 -0
  177. package/lib/apps/cli/internal/flags/start/api.flags.js +20 -0
  178. package/lib/apps/cli/internal/flags/start/preview.flags.d.ts +9 -0
  179. package/lib/apps/cli/internal/flags/start/preview.flags.js +32 -0
  180. package/lib/apps/cli/internal/flags/start/studio.flags.d.ts +7 -0
  181. package/lib/apps/cli/internal/flags/start/studio.flags.js +25 -0
  182. package/lib/apps/cli/internal/flags/validate.flags.d.ts +11 -0
  183. package/lib/apps/cli/internal/flags/validate.flags.js +22 -0
  184. package/lib/apps/cli/internal/globals.d.ts +10 -0
  185. package/lib/apps/cli/internal/globals.js +46 -0
  186. package/lib/apps/cli/internal/hooks/command_not_found/myhook.d.ts +4 -0
  187. package/lib/apps/cli/internal/hooks/command_not_found/myhook.js +85 -0
  188. package/lib/domains/models/Context.d.ts +21 -0
  189. package/lib/domains/models/Context.js +321 -0
  190. package/lib/domains/models/Preview.d.ts +2 -0
  191. package/lib/domains/models/Preview.js +227 -0
  192. package/lib/domains/models/SpecificationFile.d.ts +40 -0
  193. package/lib/domains/models/SpecificationFile.js +295 -0
  194. package/lib/domains/models/Studio.d.ts +2 -0
  195. package/lib/domains/models/Studio.js +182 -0
  196. package/lib/domains/models/generate/ClientLanguages.d.ts +12 -0
  197. package/lib/domains/models/generate/ClientLanguages.js +17 -0
  198. package/lib/domains/models/generate/Flags.d.ts +9 -0
  199. package/lib/domains/models/generate/Flags.js +2 -0
  200. package/lib/domains/services/archiver.service.d.ts +17 -0
  201. package/lib/domains/services/archiver.service.js +53 -0
  202. package/lib/domains/services/base.service.d.ts +6 -0
  203. package/lib/domains/services/base.service.js +26 -0
  204. package/lib/domains/services/config.service.d.ts +42 -0
  205. package/lib/domains/services/config.service.js +95 -0
  206. package/lib/domains/services/convert.service.d.ts +12 -0
  207. package/lib/domains/services/convert.service.js +65 -0
  208. package/lib/domains/services/generator.service.d.ts +15 -0
  209. package/lib/domains/services/generator.service.js +75 -0
  210. package/lib/domains/services/validation.service.d.ts +54 -0
  211. package/lib/domains/services/validation.service.js +375 -0
  212. package/lib/errors/context-error.d.ts +26 -0
  213. package/lib/errors/context-error.js +71 -0
  214. package/lib/errors/diff-error.d.ts +9 -0
  215. package/lib/errors/diff-error.js +27 -0
  216. package/lib/errors/generator-error.d.ts +3 -0
  217. package/lib/errors/generator-error.js +11 -0
  218. package/lib/errors/specification-file.d.ts +18 -0
  219. package/lib/errors/specification-file.js +65 -0
  220. package/lib/errors/validation-error.d.ts +11 -0
  221. package/lib/errors/validation-error.js +55 -0
  222. package/lib/index.d.ts +1 -0
  223. package/lib/index.js +11 -0
  224. package/lib/interfaces/index.d.ts +87 -0
  225. package/lib/interfaces/index.js +7 -0
  226. package/lib/utils/ajv.d.ts +2 -0
  227. package/lib/utils/ajv.js +18 -0
  228. package/lib/utils/app-openapi.d.ts +4 -0
  229. package/lib/utils/app-openapi.js +28 -0
  230. package/lib/utils/generate/flags.d.ts +2 -0
  231. package/lib/utils/generate/flags.js +14 -0
  232. package/lib/utils/generate/mapBaseUrl.d.ts +6 -0
  233. package/lib/utils/generate/mapBaseUrl.js +34 -0
  234. package/lib/utils/generate/parseParams.d.ts +3 -0
  235. package/lib/utils/generate/parseParams.js +58 -0
  236. package/lib/utils/generate/prompts.d.ts +4 -0
  237. package/lib/utils/generate/prompts.js +77 -0
  238. package/lib/utils/generate/registry.d.ts +2 -0
  239. package/lib/utils/generate/registry.js +30 -0
  240. package/lib/utils/generate/watcher.d.ts +51 -0
  241. package/lib/utils/generate/watcher.js +230 -0
  242. package/lib/utils/logger.d.ts +6 -0
  243. package/lib/utils/logger.js +33 -0
  244. package/lib/utils/retrieve-language.d.ts +1 -0
  245. package/lib/utils/retrieve-language.js +9 -0
  246. package/lib/utils/scoreCalculator.d.ts +2 -0
  247. package/lib/utils/scoreCalculator.js +22 -0
  248. package/lib/utils/temp-dir.d.ts +2 -0
  249. package/lib/utils/temp-dir.js +26 -0
  250. package/oclif.manifest.json +2137 -0
  251. package/openapi.yaml +713 -0
  252. package/package.json +203 -0
  253. package/scripts/enableAutoComplete.js +160 -0
  254. package/scripts/fetch-asyncapi-example.js +126 -0
  255. package/scripts/generateTypesForGenerateCommand.js +40 -0
  256. package/scripts/releasePackagesRename.js +88 -0
  257. package/scripts/updateUsageDocs.js +73 -0
@@ -0,0 +1,46 @@
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("../../../internal/base"));
6
+ const Context_1 = require("../../../../../domains/models/Context");
7
+ const context_error_1 = require("../../../../../errors/context-error");
8
+ const context_flags_1 = require("../../../internal/flags/config/context.flags");
9
+ const picocolors_1 = require("picocolors");
10
+ class ContextAdd extends base_1.default {
11
+ run() {
12
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
13
+ const { args, flags } = yield this.parse(ContextAdd);
14
+ const contextName = args['context-name'];
15
+ const specFilePath = args['spec-file-path'];
16
+ const setAsCurrent = flags['set-current'];
17
+ try {
18
+ yield (0, Context_1.addContext)(contextName, specFilePath);
19
+ this.log(`🎉 Context ${(0, picocolors_1.blueBright)(contextName)} added successfully!\nYou can set it as your current context:\n ${(0, picocolors_1.blueBright)('asyncapi')} ${(0, picocolors_1.blueBright)('config')} ${(0, picocolors_1.blueBright)('context')} ${(0, picocolors_1.blueBright)('use')} ${(0, picocolors_1.blueBright)(contextName)}\nYou can use this context when needed by passing ${(0, picocolors_1.blueBright)(contextName)} as a parameter:\n ${(0, picocolors_1.blueBright)('asyncapi')} ${(0, picocolors_1.blueBright)('validate')} ${(0, picocolors_1.blueBright)(contextName)}`);
20
+ if (setAsCurrent) {
21
+ yield (0, Context_1.setCurrentContext)(contextName);
22
+ this.log(`\nThe newly added context, ${(0, picocolors_1.blueBright)(contextName)}, is set as your current context!`);
23
+ }
24
+ }
25
+ catch (e) {
26
+ if (e instanceof (context_error_1.MissingContextFileError || context_error_1.ContextFileWrongFormatError)) {
27
+ this.error(`Unable to add context. You have no context file configured.\nRun ${(0, picocolors_1.blueBright)('asyncapi config context init')} to initialize it.`);
28
+ }
29
+ throw e;
30
+ }
31
+ });
32
+ }
33
+ }
34
+ ContextAdd.description = 'Add a context to the store';
35
+ ContextAdd.flags = (0, context_flags_1.addFlags)();
36
+ ContextAdd.args = {
37
+ 'context-name': core_1.Args.string({
38
+ description: 'context name',
39
+ required: true,
40
+ }),
41
+ 'spec-file-path': core_1.Args.string({
42
+ description: 'file path of the spec file',
43
+ required: true,
44
+ }),
45
+ };
46
+ exports.default = ContextAdd;
@@ -0,0 +1,8 @@
1
+ import Command from '../../../internal/base';
2
+ export default class ContextCurrent extends Command {
3
+ static description: string;
4
+ static flags: {
5
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
6
+ };
7
+ run(): Promise<void>;
8
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const base_1 = tslib_1.__importDefault(require("../../../internal/base"));
5
+ const Context_1 = require("../../../../../domains/models/Context");
6
+ const context_error_1 = require("../../../../../errors/context-error");
7
+ const global_flags_1 = require("../../../internal/flags/global.flags");
8
+ const picocolors_1 = require("picocolors");
9
+ class ContextCurrent extends base_1.default {
10
+ run() {
11
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
12
+ let fileContent;
13
+ try {
14
+ fileContent = yield (0, Context_1.getCurrentContext)();
15
+ }
16
+ catch (e) {
17
+ if (e instanceof (context_error_1.MissingContextFileError || context_error_1.ContextFileWrongFormatError)) {
18
+ this.error(`Unable to show current context. You have no context file configured.\nRun ${(0, picocolors_1.blueBright)('asyncapi config context init')} to initialize it.`);
19
+ }
20
+ else if (e instanceof context_error_1.ContextFileEmptyError) {
21
+ this.error(`Context file ${(0, picocolors_1.blueBright)(Context_1.CONTEXT_FILE_PATH)} is empty.`);
22
+ }
23
+ else if (e instanceof context_error_1.ContextNotFoundError ||
24
+ (fileContent && !fileContent.current)) {
25
+ this.error(`No context is set as current.\nRun ${(0, picocolors_1.blueBright)('asyncapi config context')} to see all available options.`);
26
+ }
27
+ throw e;
28
+ }
29
+ if (fileContent) {
30
+ this.log(`${(0, picocolors_1.blueBright)(fileContent.current)}: ${fileContent.context}`);
31
+ }
32
+ });
33
+ }
34
+ }
35
+ ContextCurrent.description = 'Shows the current context that is being used';
36
+ ContextCurrent.flags = (0, global_flags_1.helpFlag)();
37
+ exports.default = ContextCurrent;
@@ -0,0 +1,12 @@
1
+ import Command from '../../../internal/base';
2
+ export default class ContextEdit extends Command {
3
+ static description: string;
4
+ static flags: {
5
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
6
+ };
7
+ static args: {
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
+ };
11
+ run(): Promise<void>;
12
+ }
@@ -0,0 +1,44 @@
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("../../../internal/base"));
6
+ const Context_1 = require("../../../../../domains/models/Context");
7
+ const context_error_1 = require("../../../../../errors/context-error");
8
+ const global_flags_1 = require("../../../internal/flags/global.flags");
9
+ const picocolors_1 = require("picocolors");
10
+ class ContextEdit extends base_1.default {
11
+ run() {
12
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
13
+ const { args } = yield this.parse(ContextEdit);
14
+ const contextName = args['context-name'];
15
+ const newSpecFilePath = args['new-spec-file-path'];
16
+ try {
17
+ yield (0, Context_1.editContext)(contextName, newSpecFilePath);
18
+ this.log(`🎉 Context ${(0, picocolors_1.blueBright)(contextName)} edited successfully!\nYou can set it as your current context:\n ${(0, picocolors_1.blueBright)('asyncapi')} ${(0, picocolors_1.blueBright)('config')} ${(0, picocolors_1.blueBright)('context')} ${(0, picocolors_1.blueBright)('use')} ${(0, picocolors_1.blueBright)(contextName)}\nYou can use this context when needed by passing ${(0, picocolors_1.blueBright)(contextName)} as a parameter:\n ${(0, picocolors_1.blueBright)('asyncapi')} ${(0, picocolors_1.blueBright)('validate')} ${(0, picocolors_1.blueBright)(contextName)}`);
19
+ }
20
+ catch (e) {
21
+ if (e instanceof (context_error_1.MissingContextFileError || context_error_1.ContextFileWrongFormatError)) {
22
+ this.error(`Unable to edit context. You have no context file configured.\nRun ${(0, picocolors_1.blueBright)('asyncapi config context init')} to initialize it.`);
23
+ }
24
+ else if (e instanceof context_error_1.ContextFileEmptyError) {
25
+ this.error(`Context file ${(0, picocolors_1.blueBright)(Context_1.CONTEXT_FILE_PATH)} is empty.`);
26
+ }
27
+ throw e;
28
+ }
29
+ });
30
+ }
31
+ }
32
+ ContextEdit.description = 'Edit a context in the store';
33
+ ContextEdit.flags = (0, global_flags_1.helpFlag)();
34
+ ContextEdit.args = {
35
+ 'context-name': core_1.Args.string({
36
+ description: 'context name',
37
+ required: true,
38
+ }),
39
+ 'new-spec-file-path': core_1.Args.string({
40
+ description: 'file path of the spec file',
41
+ required: true,
42
+ }),
43
+ };
44
+ exports.default = ContextEdit;
@@ -0,0 +1,5 @@
1
+ import Command from '../../../internal/base';
2
+ export default class Context extends Command {
3
+ static description: string;
4
+ run(): Promise<void>;
5
+ }
@@ -0,0 +1,16 @@
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("../../../internal/base"));
6
+ class Context extends base_1.default {
7
+ run() {
8
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
9
+ const Help = yield (0, core_1.loadHelpClass)(this.config);
10
+ const help = new Help(this.config);
11
+ help.showHelp(['config', 'context', '--help']);
12
+ });
13
+ }
14
+ }
15
+ Context.description = 'Manage short aliases for full paths to AsyncAPI documents';
16
+ exports.default = Context;
@@ -0,0 +1,12 @@
1
+ import Command from '../../../internal/base';
2
+ export default class ContextInit extends Command {
3
+ static description: string;
4
+ static flags: {
5
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
6
+ };
7
+ static contextFilePathMessage: string;
8
+ static args: {
9
+ 'context-file-path': import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
10
+ };
11
+ run(): Promise<void>;
12
+ }
@@ -0,0 +1,31 @@
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("../../../internal/base"));
6
+ const Context_1 = require("../../../../../domains/models/Context");
7
+ const global_flags_1 = require("../../../internal/flags/global.flags");
8
+ const picocolors_1 = require("picocolors");
9
+ class ContextInit extends base_1.default {
10
+ run() {
11
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
12
+ const { args } = yield this.parse(ContextInit);
13
+ const contextFilePath = args['context-file-path'];
14
+ const contextWritePath = yield (0, Context_1.initContext)(contextFilePath);
15
+ this.log(`🎉 Context initialized at ${(0, picocolors_1.blueBright)(contextWritePath)}`);
16
+ });
17
+ }
18
+ }
19
+ ContextInit.description = 'Initialize context';
20
+ ContextInit.flags = (0, global_flags_1.helpFlag)();
21
+ ContextInit.contextFilePathMessage = `Specify directory in which context file should be created:
22
+ - current directory : ${(0, picocolors_1.blueBright)('asyncapi config context init .')}(default)
23
+ - root of current repository : ${(0, picocolors_1.blueBright)('asyncapi config context init ./ ')}
24
+ - user's home directory : ${(0, picocolors_1.blueBright)('asyncapi config context init ~`')}`;
25
+ ContextInit.args = {
26
+ 'context-file-path': core_1.Args.string({
27
+ description: `${ContextInit.contextFilePathMessage}`,
28
+ required: false,
29
+ }),
30
+ };
31
+ exports.default = ContextInit;
@@ -0,0 +1,8 @@
1
+ import Command from '../../../internal/base';
2
+ export default class ContextList extends Command {
3
+ static description: string;
4
+ static flags: {
5
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
6
+ };
7
+ run(): Promise<void>;
8
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const base_1 = tslib_1.__importDefault(require("../../../internal/base"));
5
+ const Context_1 = require("../../../../../domains/models/Context");
6
+ const context_error_1 = require("../../../../../errors/context-error");
7
+ const global_flags_1 = require("../../../internal/flags/global.flags");
8
+ const picocolors_1 = require("picocolors");
9
+ class ContextList extends base_1.default {
10
+ run() {
11
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
12
+ try {
13
+ const fileContent = yield (0, Context_1.loadContextFile)();
14
+ if (yield (0, Context_1.isContextFileEmpty)(fileContent)) {
15
+ this.log(`Context file ${(0, picocolors_1.blueBright)(Context_1.CONTEXT_FILE_PATH)} is empty.`);
16
+ return;
17
+ }
18
+ if (fileContent) {
19
+ for (const [contextName, filePath] of Object.entries(fileContent.store)) {
20
+ this.log(`${(0, picocolors_1.blueBright)(contextName)}: ${filePath}`);
21
+ }
22
+ }
23
+ }
24
+ catch (e) {
25
+ if (e instanceof (context_error_1.MissingContextFileError || context_error_1.ContextFileWrongFormatError)) {
26
+ this.log(`Unable to list contexts. You have no context file configured.\nRun ${(0, picocolors_1.blueBright)('asyncapi config context init')} to initialize it.\n`);
27
+ return;
28
+ }
29
+ throw e;
30
+ }
31
+ });
32
+ }
33
+ }
34
+ ContextList.description = 'List all the stored contexts in the store';
35
+ ContextList.flags = (0, global_flags_1.helpFlag)();
36
+ exports.default = ContextList;
@@ -0,0 +1,11 @@
1
+ import Command from '../../../internal/base';
2
+ export default class ContextRemove extends Command {
3
+ static description: string;
4
+ static flags: {
5
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
6
+ };
7
+ static args: {
8
+ 'context-name': import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,39 @@
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("../../../internal/base"));
6
+ const Context_1 = require("../../../../../domains/models/Context");
7
+ const context_error_1 = require("../../../../../errors/context-error");
8
+ const global_flags_1 = require("../../../internal/flags/global.flags");
9
+ const picocolors_1 = require("picocolors");
10
+ class ContextRemove extends base_1.default {
11
+ run() {
12
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
13
+ const { args } = yield this.parse(ContextRemove);
14
+ const contextName = args['context-name'];
15
+ try {
16
+ yield (0, Context_1.removeContext)(contextName);
17
+ this.log(`Context ${(0, picocolors_1.blueBright)(contextName)} removed successfully!\n`);
18
+ }
19
+ catch (e) {
20
+ if (e instanceof (context_error_1.MissingContextFileError || context_error_1.ContextFileWrongFormatError)) {
21
+ this.error(`Unable to remove context. You have no context file configured.\nRun ${(0, picocolors_1.blueBright)('asyncapi config context init')} to initialize it.`);
22
+ }
23
+ else if (e instanceof context_error_1.ContextFileEmptyError) {
24
+ this.error(`Context file ${(0, picocolors_1.blueBright)(Context_1.CONTEXT_FILE_PATH)} is empty.`);
25
+ }
26
+ throw e;
27
+ }
28
+ });
29
+ }
30
+ }
31
+ ContextRemove.description = 'Delete a context from the store';
32
+ ContextRemove.flags = (0, global_flags_1.helpFlag)();
33
+ ContextRemove.args = {
34
+ 'context-name': core_1.Args.string({
35
+ description: 'Name of the context to delete',
36
+ required: true,
37
+ }),
38
+ };
39
+ exports.default = ContextRemove;
@@ -0,0 +1,11 @@
1
+ import Command from '../../../internal/base';
2
+ export default class ContextUse extends Command {
3
+ static description: string;
4
+ static flags: {
5
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
6
+ };
7
+ static args: {
8
+ 'context-name': import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,40 @@
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("../../../internal/base"));
6
+ const Context_1 = require("../../../../../domains/models/Context");
7
+ const context_error_1 = require("../../../../../errors/context-error");
8
+ const global_flags_1 = require("../../../internal/flags/global.flags");
9
+ const picocolors_1 = require("picocolors");
10
+ class ContextUse extends base_1.default {
11
+ run() {
12
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
13
+ const { args } = yield this.parse(ContextUse);
14
+ const contextName = args['context-name'];
15
+ try {
16
+ yield (0, Context_1.setCurrentContext)(contextName);
17
+ this.log(`Context ${(0, picocolors_1.blueBright)(contextName)} is now set as current.`);
18
+ }
19
+ catch (e) {
20
+ if (e instanceof (context_error_1.MissingContextFileError || context_error_1.ContextFileWrongFormatError)) {
21
+ this.error(`Unable to set the current context. You have no context file configured.\nRun ${(0, picocolors_1.blueBright)('asyncapi config context init')} to initialize it.`);
22
+ }
23
+ else if (e instanceof context_error_1.ContextFileEmptyError) {
24
+ this.error(`Context file ${(0, picocolors_1.blueBright)(Context_1.CONTEXT_FILE_PATH)} is empty.`);
25
+ return;
26
+ }
27
+ throw e;
28
+ }
29
+ });
30
+ }
31
+ }
32
+ ContextUse.description = 'Set a context as current';
33
+ ContextUse.flags = (0, global_flags_1.helpFlag)();
34
+ ContextUse.args = {
35
+ 'context-name': core_1.Args.string({
36
+ description: 'name of the saved context',
37
+ required: true,
38
+ }),
39
+ };
40
+ exports.default = ContextUse;
@@ -0,0 +1,5 @@
1
+ import Command from '../../internal/base';
2
+ export default class Config extends Command {
3
+ static description: string;
4
+ run(): Promise<void>;
5
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const base_1 = tslib_1.__importDefault(require("../../internal/base"));
5
+ const core_1 = require("@oclif/core");
6
+ class Config extends base_1.default {
7
+ run() {
8
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
9
+ const Help = yield (0, core_1.loadHelpClass)(this.config);
10
+ const help = new Help(this.config);
11
+ help.showHelp(['config', '--help']);
12
+ });
13
+ }
14
+ }
15
+ Config.description = 'CLI config settings';
16
+ exports.default = Config;
@@ -0,0 +1,8 @@
1
+ import Command from '../../internal/base';
2
+ export default class Versions extends Command {
3
+ static description: string;
4
+ static flags: {
5
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
6
+ };
7
+ run(): Promise<void>;
8
+ }
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const base_1 = tslib_1.__importDefault(require("../../internal/base"));
5
+ const global_flags_1 = require("../../internal/flags/global.flags");
6
+ const picocolors_1 = require("picocolors");
7
+ class Versions extends base_1.default {
8
+ run() {
9
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
10
+ const dependencies = [];
11
+ let dependency = '';
12
+ // Preparation of the array with all dependencies '@asyncapi/*' along with
13
+ // their versions.
14
+ for (const key in this.config.pjson.dependencies) {
15
+ // Making sure with .indexOf() that only package names which START with
16
+ // string '@asyncapi' are considered.
17
+ if (key.indexOf('@asyncapi', 0) === 0) {
18
+ // Avoiding obvious crash on manual removal or alteration of an
19
+ // '@asyncapi' package.
20
+ try {
21
+ // Goofy name `importedPJSON` is chosen to distinguish from name `pjson`
22
+ // used in `@oclif` source code.
23
+ const importedPJSON = yield Promise.resolve(`${`${key}/package.json`}`).then(s => tslib_1.__importStar(require(s)));
24
+ dependencies.push(`${key}/${importedPJSON.default.version}`);
25
+ }
26
+ catch (e) {
27
+ dependencies.push(`${key}/` + '`package.json` not found');
28
+ }
29
+ }
30
+ }
31
+ // Showing information available with `--version` flag.
32
+ this.log((0, picocolors_1.gray)(`\n${this.config.userAgent}\n`));
33
+ // Iteration through the array containing all dependencies '@asyncapi/*'
34
+ // along with their versions.
35
+ for (let i = 0; i < dependencies.length; i++) {
36
+ // Minimization of the theoretical possibility of a Generic Object
37
+ // Injection Sink, at the same time disabling eslint parsing for this
38
+ // line since it is actually a false positive.
39
+ // https://github.com/eslint-community/eslint-plugin-security/issues/21#issuecomment-530184612
40
+ // https://github.com/eslint-community/eslint-plugin-security/issues/21#issuecomment-1157887653
41
+ // https://web.archive.org/web/20150430062816/https://blog.liftsecurity.io/2015/01/15/the-dangers-of-square-bracket-notation
42
+ dependency = dependencies[i]; // eslint-disable-line
43
+ if (i !== dependencies.length - 1) {
44
+ this.log(` ├${dependency}`);
45
+ }
46
+ else {
47
+ this.log(` └${dependency}\n`);
48
+ }
49
+ }
50
+ this.log(`Repository: ${(0, picocolors_1.blueBright)(this.config.pjson.homepage)}`);
51
+ });
52
+ }
53
+ }
54
+ Versions.description = 'Show versions of AsyncAPI tools used';
55
+ Versions.flags = (0, global_flags_1.helpFlag)();
56
+ exports.default = Versions;
@@ -0,0 +1,21 @@
1
+ import Command from '../internal/base';
2
+ export default class Convert extends Command {
3
+ static specFile: any;
4
+ static metricsMetadata: any;
5
+ static description: string;
6
+ private conversionService;
7
+ static flags: {
8
+ proxyHost: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ proxyPort: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
11
+ output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ format: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ 'target-version': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ perspective: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ };
16
+ static args: {
17
+ 'spec-file': import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
18
+ };
19
+ run(): Promise<void>;
20
+ private handleError;
21
+ }
@@ -0,0 +1,85 @@
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("../internal/base"));
6
+ const validation_error_1 = require("../../../errors/validation-error");
7
+ const SpecificationFile_1 = require("../../../domains/models/SpecificationFile");
8
+ const specification_file_1 = require("../../../errors/specification-file");
9
+ const picocolors_1 = require("picocolors");
10
+ const proxy_flags_1 = require("../internal/flags/proxy.flags");
11
+ const specs_1 = tslib_1.__importDefault(require("@asyncapi/specs"));
12
+ const convert_flags_1 = require("../internal/flags/convert.flags");
13
+ const convert_service_1 = require("../../../domains/services/convert.service");
14
+ const latestVersion = Object.keys(specs_1.default.schemas).pop();
15
+ class Convert extends base_1.default {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.conversionService = new convert_service_1.ConversionService();
19
+ }
20
+ run() {
21
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
22
+ const { args, flags } = yield this.parse(Convert);
23
+ let filePath = args['spec-file'];
24
+ const proxyHost = flags['proxyHost'];
25
+ const proxyPort = flags['proxyPort'];
26
+ if (proxyHost && proxyPort) {
27
+ const proxyUrl = `http://${proxyHost}:${proxyPort}`;
28
+ filePath = `${filePath}+${proxyUrl}`; // Update filePath with proxyUrl
29
+ }
30
+ try {
31
+ // LOAD FILE
32
+ this.specFile = yield (0, SpecificationFile_1.load)(filePath);
33
+ // eslint-disable-next-line sonarjs/no-duplicate-string
34
+ this.metricsMetadata.to_version = flags['target-version'];
35
+ const conversionOptions = {
36
+ format: flags.format,
37
+ 'target-version': (flags['target-version'] ||
38
+ latestVersion),
39
+ perspective: flags['perspective'],
40
+ };
41
+ const result = yield this.conversionService.convertDocument(this.specFile, conversionOptions);
42
+ if (!result.success || !result.data) {
43
+ this.error(result.error || 'Conversion failed', { exit: 1 });
44
+ }
45
+ this.metricsMetadata.conversion_result = result;
46
+ this.log(this.conversionService.handleLogging(this.specFile, conversionOptions));
47
+ if (flags['output']) {
48
+ yield this.conversionService.handleOutput(flags['output'], result.data.convertedDocument);
49
+ }
50
+ else {
51
+ this.log(result.data.convertedDocument);
52
+ }
53
+ }
54
+ catch (err) {
55
+ this.handleError(err, filePath !== null && filePath !== void 0 ? filePath : 'unknown', flags);
56
+ }
57
+ });
58
+ }
59
+ // Helper function to handle errors
60
+ handleError(err, filePath, flags) {
61
+ var _a;
62
+ if (err instanceof specification_file_1.SpecificationFileNotFound) {
63
+ this.error(new validation_error_1.ValidationError({
64
+ type: 'invalid-file',
65
+ filepath: filePath,
66
+ }));
67
+ }
68
+ else if (((_a = this.specFile) === null || _a === void 0 ? void 0 : _a.toJson().asyncapi) > flags['target-version']) {
69
+ this.error(`The ${(0, picocolors_1.cyan)(filePath)} file cannot be converted to an older version. Downgrading is not supported.`);
70
+ }
71
+ else {
72
+ this.error(err);
73
+ }
74
+ }
75
+ }
76
+ Convert.metricsMetadata = {};
77
+ Convert.description = 'Convert asyncapi documents older to newer versions or OpenAPI/postman-collection documents to AsyncAPI';
78
+ Convert.flags = Object.assign(Object.assign({}, (0, convert_flags_1.convertFlags)(latestVersion)), (0, proxy_flags_1.proxyFlags)());
79
+ Convert.args = {
80
+ 'spec-file': core_1.Args.string({
81
+ description: 'spec path, url, or context-name',
82
+ required: false,
83
+ }),
84
+ };
85
+ exports.default = Convert;
@@ -0,0 +1,36 @@
1
+ import AsyncAPIDiff from '@asyncapi/diff/lib/asyncapidiff';
2
+ import { Specification } from '../../../domains/models/SpecificationFile';
3
+ import Command from '../internal/base';
4
+ import { ValidationStatus } from '../../../domains/services/validation.service';
5
+ import { Diagnostic } from '@asyncapi/parser/cjs';
6
+ export default class Diff extends Command {
7
+ static description: string;
8
+ private validationService;
9
+ static flags: {
10
+ 'log-diagnostics': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ 'diagnostics-format': import("@oclif/core/lib/interfaces").OptionFlag<import("@stoplight/spectral-cli/dist/services/config").OutputFormat, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ 'fail-severity': import("@oclif/core/lib/interfaces").OptionFlag<"error" | "warn" | "info" | "hint", import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ 'save-output': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
15
+ format: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
16
+ type: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
17
+ markdownSubtype: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
18
+ overrides: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
19
+ 'no-error': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
20
+ watch: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
21
+ };
22
+ static args: {
23
+ old: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
24
+ new: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
25
+ };
26
+ run(): Promise<void>;
27
+ outputJSON(diffOutput: AsyncAPIDiff, outputType: string): void;
28
+ writeOutputToFile(diffOutput: AsyncAPIDiff, outputType: string, filePath: string, outputFormat: string): Promise<void>;
29
+ outputYAML(diffOutput: AsyncAPIDiff, outputType: string): void;
30
+ outputMarkdown(diffOutput: AsyncAPIDiff, outputType: string): void;
31
+ parseDocuments(command: Command, firstDocument: Specification, secondDocument: Specification, flags: Record<string, any>): Promise<{
32
+ firstDocumentParsed: import("@asyncapi/parser/cjs").AsyncAPIDocumentInterface;
33
+ secondDocumentParsed: import("@asyncapi/parser/cjs").AsyncAPIDocumentInterface;
34
+ } | undefined>;
35
+ handleGovernanceMessage(document: Specification, diagnostics: Diagnostic[], status: ValidationStatus): Promise<void>;
36
+ }