@asyncapi/cli 3.1.1 → 3.2.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.
@@ -125,12 +125,14 @@
125
125
  }
126
126
  },
127
127
  "node_modules/@babel/code-frame": {
128
- "version": "7.24.7",
129
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz",
130
- "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==",
128
+ "version": "7.27.1",
129
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz",
130
+ "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==",
131
+ "license": "MIT",
131
132
  "dependencies": {
132
- "@babel/highlight": "^7.24.7",
133
- "picocolors": "^1.0.0"
133
+ "@babel/helper-validator-identifier": "^7.27.1",
134
+ "js-tokens": "^4.0.0",
135
+ "picocolors": "^1.1.1"
134
136
  },
135
137
  "engines": {
136
138
  "node": ">=6.9.0"
@@ -394,17 +396,19 @@
394
396
  }
395
397
  },
396
398
  "node_modules/@babel/helper-string-parser": {
397
- "version": "7.24.8",
398
- "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz",
399
- "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==",
399
+ "version": "7.27.1",
400
+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz",
401
+ "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==",
402
+ "license": "MIT",
400
403
  "engines": {
401
404
  "node": ">=6.9.0"
402
405
  }
403
406
  },
404
407
  "node_modules/@babel/helper-validator-identifier": {
405
- "version": "7.24.7",
406
- "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz",
407
- "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==",
408
+ "version": "7.27.1",
409
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz",
410
+ "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==",
411
+ "license": "MIT",
408
412
  "engines": {
409
413
  "node": ">=6.9.0"
410
414
  }
@@ -431,37 +435,25 @@
431
435
  }
432
436
  },
433
437
  "node_modules/@babel/helpers": {
434
- "version": "7.25.0",
435
- "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.0.tgz",
436
- "integrity": "sha512-MjgLZ42aCm0oGjJj8CtSM3DB8NOOf8h2l7DCTePJs29u+v7yO/RBX9nShlKMgFnRks/Q4tBAe7Hxnov9VkGwLw==",
438
+ "version": "7.27.4",
439
+ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.4.tgz",
440
+ "integrity": "sha512-Y+bO6U+I7ZKaM5G5rDUZiYfUvQPUibYmAFe7EnKdnKBbVXDZxvp+MWOH5gYciY0EPk4EScsuFMQBbEfpdRKSCQ==",
441
+ "license": "MIT",
437
442
  "dependencies": {
438
- "@babel/template": "^7.25.0",
439
- "@babel/types": "^7.25.0"
440
- },
441
- "engines": {
442
- "node": ">=6.9.0"
443
- }
444
- },
445
- "node_modules/@babel/highlight": {
446
- "version": "7.24.7",
447
- "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz",
448
- "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==",
449
- "dependencies": {
450
- "@babel/helper-validator-identifier": "^7.24.7",
451
- "chalk": "^2.4.2",
452
- "js-tokens": "^4.0.0",
453
- "picocolors": "^1.0.0"
443
+ "@babel/template": "^7.27.2",
444
+ "@babel/types": "^7.27.3"
454
445
  },
455
446
  "engines": {
456
447
  "node": ">=6.9.0"
457
448
  }
458
449
  },
459
450
  "node_modules/@babel/parser": {
460
- "version": "7.25.3",
461
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.3.tgz",
462
- "integrity": "sha512-iLTJKDbJ4hMvFPgQwwsVoxtHyWpKKPBrxkANrSYewDPaPpT5py5yeVkgPIJ7XYXhndxJpaA3PyALSXQ7u8e/Dw==",
451
+ "version": "7.27.4",
452
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.4.tgz",
453
+ "integrity": "sha512-BRmLHGwpUqLFR2jzx9orBuX/ABDkj2jLKOXrHDTN2aOKL+jFDDKaRNo9nyYsIl9h/UE/7lMKdDjKQQyxKKDZ7g==",
454
+ "license": "MIT",
463
455
  "dependencies": {
464
- "@babel/types": "^7.25.2"
456
+ "@babel/types": "^7.27.3"
465
457
  },
466
458
  "bin": {
467
459
  "parser": "bin/babel-parser.js"
@@ -1729,13 +1721,14 @@
1729
1721
  }
1730
1722
  },
1731
1723
  "node_modules/@babel/template": {
1732
- "version": "7.25.0",
1733
- "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz",
1734
- "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==",
1724
+ "version": "7.27.2",
1725
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz",
1726
+ "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==",
1727
+ "license": "MIT",
1735
1728
  "dependencies": {
1736
- "@babel/code-frame": "^7.24.7",
1737
- "@babel/parser": "^7.25.0",
1738
- "@babel/types": "^7.25.0"
1729
+ "@babel/code-frame": "^7.27.1",
1730
+ "@babel/parser": "^7.27.2",
1731
+ "@babel/types": "^7.27.1"
1739
1732
  },
1740
1733
  "engines": {
1741
1734
  "node": ">=6.9.0"
@@ -1759,13 +1752,13 @@
1759
1752
  }
1760
1753
  },
1761
1754
  "node_modules/@babel/types": {
1762
- "version": "7.25.2",
1763
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.2.tgz",
1764
- "integrity": "sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==",
1755
+ "version": "7.27.3",
1756
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.3.tgz",
1757
+ "integrity": "sha512-Y1GkI4ktrtvmawoSq+4FCVHNryea6uR+qUQy0AGxLSsjCX0nVmkYQMBLHDkXZuo5hGx7eYdnIaslsdBFm7zbUw==",
1758
+ "license": "MIT",
1765
1759
  "dependencies": {
1766
- "@babel/helper-string-parser": "^7.24.8",
1767
- "@babel/helper-validator-identifier": "^7.24.7",
1768
- "to-fast-properties": "^2.0.0"
1760
+ "@babel/helper-string-parser": "^7.27.1",
1761
+ "@babel/helper-validator-identifier": "^7.27.1"
1769
1762
  },
1770
1763
  "engines": {
1771
1764
  "node": ">=6.9.0"
@@ -1980,9 +1973,9 @@
1980
1973
  }
1981
1974
  },
1982
1975
  "node_modules/@stoplight/spectral-core": {
1983
- "version": "1.19.4",
1984
- "resolved": "https://registry.npmjs.org/@stoplight/spectral-core/-/spectral-core-1.19.4.tgz",
1985
- "integrity": "sha512-8hnZXfssTlV99SKo8J8BwMt5LsiBFHkCh0V3P7j8IPcCNl//bpG92U4TpYy7AwmUms/zCLX7sxNQC6AZ+bkfzg==",
1976
+ "version": "1.20.0",
1977
+ "resolved": "https://registry.npmjs.org/@stoplight/spectral-core/-/spectral-core-1.20.0.tgz",
1978
+ "integrity": "sha512-5hBP81nCC1zn1hJXL/uxPNRKNcB+/pEIHgCjPRpl/w/qy9yC9ver04tw1W0l/PMiv0UeB5dYgozXVQ4j5a6QQQ==",
1986
1979
  "license": "Apache-2.0",
1987
1980
  "dependencies": {
1988
1981
  "@stoplight/better-ajv-errors": "1.0.3",
@@ -1996,9 +1989,9 @@
1996
1989
  "@types/json-schema": "^7.0.11",
1997
1990
  "ajv": "^8.17.1",
1998
1991
  "ajv-errors": "~3.0.0",
1999
- "ajv-formats": "~2.1.0",
1992
+ "ajv-formats": "~2.1.1",
2000
1993
  "es-aggregate-error": "^1.0.7",
2001
- "jsonpath-plus": "10.2.0",
1994
+ "jsonpath-plus": "^10.3.0",
2002
1995
  "lodash": "~4.17.21",
2003
1996
  "lodash.topath": "^4.5.2",
2004
1997
  "minimatch": "3.1.2",
@@ -2301,17 +2294,6 @@
2301
2294
  }
2302
2295
  }
2303
2296
  },
2304
- "node_modules/ansi-styles": {
2305
- "version": "3.2.1",
2306
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
2307
- "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
2308
- "dependencies": {
2309
- "color-convert": "^1.9.0"
2310
- },
2311
- "engines": {
2312
- "node": ">=4"
2313
- }
2314
- },
2315
2297
  "node_modules/argparse": {
2316
2298
  "version": "2.0.1",
2317
2299
  "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
@@ -2515,32 +2497,6 @@
2515
2497
  }
2516
2498
  ]
2517
2499
  },
2518
- "node_modules/chalk": {
2519
- "version": "2.4.2",
2520
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
2521
- "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
2522
- "dependencies": {
2523
- "ansi-styles": "^3.2.1",
2524
- "escape-string-regexp": "^1.0.5",
2525
- "supports-color": "^5.3.0"
2526
- },
2527
- "engines": {
2528
- "node": ">=4"
2529
- }
2530
- },
2531
- "node_modules/color-convert": {
2532
- "version": "1.9.3",
2533
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
2534
- "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
2535
- "dependencies": {
2536
- "color-name": "1.1.3"
2537
- }
2538
- },
2539
- "node_modules/color-name": {
2540
- "version": "1.1.3",
2541
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
2542
- "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="
2543
- },
2544
2500
  "node_modules/concat-map": {
2545
2501
  "version": "0.0.1",
2546
2502
  "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
@@ -2820,14 +2776,6 @@
2820
2776
  "node": ">=6"
2821
2777
  }
2822
2778
  },
2823
- "node_modules/escape-string-regexp": {
2824
- "version": "1.0.5",
2825
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
2826
- "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
2827
- "engines": {
2828
- "node": ">=0.8.0"
2829
- }
2830
- },
2831
2779
  "node_modules/estree-walker": {
2832
2780
  "version": "1.0.1",
2833
2781
  "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz",
@@ -3002,14 +2950,6 @@
3002
2950
  "url": "https://github.com/sponsors/ljharb"
3003
2951
  }
3004
2952
  },
3005
- "node_modules/has-flag": {
3006
- "version": "3.0.0",
3007
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
3008
- "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
3009
- "engines": {
3010
- "node": ">=4"
3011
- }
3012
- },
3013
2953
  "node_modules/has-property-descriptors": {
3014
2954
  "version": "1.0.2",
3015
2955
  "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz",
@@ -3354,9 +3294,9 @@
3354
3294
  "integrity": "sha512-o6/yDBYccGvTz1+QFevz6l6OBZ2+fMVu2JZ9CIhzsYRX4mjaK5IyX9eldUdCmga16zlgQxyrj5pt9kzuj2C02w=="
3355
3295
  },
3356
3296
  "node_modules/jsonpath-plus": {
3357
- "version": "10.2.0",
3358
- "resolved": "https://registry.npmjs.org/jsonpath-plus/-/jsonpath-plus-10.2.0.tgz",
3359
- "integrity": "sha512-T9V+8iNYKFL2n2rF+w02LBOT2JjDnTjioaNFrxRy0Bv1y/hNsqR/EBK7Ojy2ythRHwmz2cRIls+9JitQGZC/sw==",
3297
+ "version": "10.3.0",
3298
+ "resolved": "https://registry.npmjs.org/jsonpath-plus/-/jsonpath-plus-10.3.0.tgz",
3299
+ "integrity": "sha512-8TNmfeTCk2Le33A3vRRwtuworG/L5RrgMvdjhKZxvyShO+mBu2fP50OWUjRLNtvw344DdDarFh9buFAZs5ujeA==",
3360
3300
  "license": "MIT",
3361
3301
  "dependencies": {
3362
3302
  "@jsep-plugin/assignment": "^1.3.0",
@@ -3531,9 +3471,10 @@
3531
3471
  "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
3532
3472
  },
3533
3473
  "node_modules/picocolors": {
3534
- "version": "1.0.1",
3535
- "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz",
3536
- "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew=="
3474
+ "version": "1.1.1",
3475
+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
3476
+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
3477
+ "license": "ISC"
3537
3478
  },
3538
3479
  "node_modules/picomatch": {
3539
3480
  "version": "2.3.1",
@@ -3876,17 +3817,6 @@
3876
3817
  "url": "https://github.com/sponsors/ljharb"
3877
3818
  }
3878
3819
  },
3879
- "node_modules/supports-color": {
3880
- "version": "5.5.0",
3881
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
3882
- "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
3883
- "dependencies": {
3884
- "has-flag": "^3.0.0"
3885
- },
3886
- "engines": {
3887
- "node": ">=4"
3888
- }
3889
- },
3890
3820
  "node_modules/supports-preserve-symlinks-flag": {
3891
3821
  "version": "1.0.0",
3892
3822
  "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
@@ -3898,14 +3828,6 @@
3898
3828
  "url": "https://github.com/sponsors/ljharb"
3899
3829
  }
3900
3830
  },
3901
- "node_modules/to-fast-properties": {
3902
- "version": "2.0.0",
3903
- "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
3904
- "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==",
3905
- "engines": {
3906
- "node": ">=4"
3907
- }
3908
- },
3909
3831
  "node_modules/tr46": {
3910
3832
  "version": "0.0.3",
3911
3833
  "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
@@ -5,6 +5,8 @@ export default class Validate extends Command {
5
5
  proxyHost: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
6
6
  proxyPort: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
7
7
  score: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ suppressWarnings: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ suppressAllWarnings: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
10
  'log-diagnostics': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
11
  'diagnostics-format': import("@oclif/core/lib/interfaces").OptionFlag<import("@stoplight/spectral-cli/dist/services/config").OutputFormat, import("@oclif/core/lib/interfaces").CustomOptions>;
10
12
  'fail-severity': import("@oclif/core/lib/interfaces").OptionFlag<"info" | "error" | "warn" | "hint", import("@oclif/core/lib/interfaces").CustomOptions>;
@@ -29,7 +29,9 @@ class Validate extends base_1.default {
29
29
  if (watchMode) {
30
30
  (0, globals_1.specWatcher)({ spec: this.specFile, handler: this, handlerName: 'validate' });
31
31
  }
32
- const result = yield (0, parser_1.validate)(this, this.specFile, flags);
32
+ // Prepare validate options
33
+ const validateOptions = Object.assign(Object.assign({}, flags), { suppressWarnings: flags['suppressWarnings'], suppressAllWarnings: flags['suppressAllWarnings'] });
34
+ const result = yield (0, parser_1.validate)(this, this.specFile, validateOptions);
33
35
  this.metricsMetadata.validation_result = result;
34
36
  if (result === parser_1.ValidationStatus.INVALID) {
35
37
  process.exitCode = 1;
@@ -1,5 +1,7 @@
1
1
  export declare const validateFlags: () => {
2
2
  score: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
3
+ suppressWarnings: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
4
+ suppressAllWarnings: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
3
5
  'log-diagnostics': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
4
6
  'diagnostics-format': import("@oclif/core/lib/interfaces").OptionFlag<import("@stoplight/spectral-cli/dist/services/config").OutputFormat, import("@oclif/core/lib/interfaces").CustomOptions>;
5
7
  'fail-severity': import("@oclif/core/lib/interfaces").OptionFlag<"info" | "error" | "warn" | "hint", import("@oclif/core/lib/interfaces").CustomOptions>;
@@ -8,7 +8,15 @@ const validateFlags = () => {
8
8
  return Object.assign(Object.assign({ help: core_1.Flags.help({ char: 'h' }), watch: (0, global_flags_1.watchFlag)() }, (0, parser_1.validationFlags)()), { score: core_1.Flags.boolean({
9
9
  description: 'Compute the score of the AsyncAPI document. Scoring is based on whether the document has description, license, server and/or channels.',
10
10
  required: false,
11
- default: false
11
+ default: false,
12
+ }), suppressWarnings: core_1.Flags.string({
13
+ description: 'List of warning codes to suppress from the validation output.',
14
+ required: false,
15
+ multiple: true,
16
+ }), suppressAllWarnings: core_1.Flags.boolean({
17
+ description: 'Suppress all warnings from the validation output.',
18
+ required: false,
19
+ default: false,
12
20
  }) });
13
21
  };
14
22
  exports.validateFlags = validateFlags;
@@ -23,6 +23,8 @@ export interface ValidateOptions {
23
23
  'diagnostics-format'?: `${OutputFormat}`;
24
24
  'fail-severity'?: SeverityKind;
25
25
  'output'?: string;
26
+ suppressWarnings?: string[];
27
+ suppressAllWarnings?: boolean;
26
28
  }
27
29
  export declare function validate(command: Command, specFile: Specification, options?: ValidateOptions): Promise<"invalid" | "valid">;
28
30
  export declare function parse(command: Command, specFile: Specification, options?: ValidateOptions): Promise<{
@@ -35,7 +35,7 @@ const parser = new cjs_1.Parser({
35
35
  resolver: {
36
36
  cache: false,
37
37
  }
38
- }
38
+ },
39
39
  });
40
40
  parser.registerSchemaParser((0, avro_schema_parser_1.AvroSchemaParser)());
41
41
  parser.registerSchemaParser((0, openapi_schema_parser_1.OpenAPISchemaParser)());
@@ -71,7 +71,61 @@ function validationFlags({ logDiagnostics = true } = {}) {
71
71
  }
72
72
  function validate(command_1, specFile_1) {
73
73
  return tslib_1.__awaiter(this, arguments, void 0, function* (command, specFile, options = {}) {
74
- const diagnostics = yield parser.validate(specFile.text(), { source: specFile.getSource() });
74
+ var _a, _b;
75
+ const suppressAllWarnings = (_a = options.suppressAllWarnings) !== null && _a !== void 0 ? _a : false;
76
+ const suppressedWarnings = (_b = options.suppressWarnings) !== null && _b !== void 0 ? _b : [];
77
+ let activeParser;
78
+ // Helper to build a parser with given rules turned off
79
+ const buildCustomParser = (rulesToSuppress) => new cjs_1.Parser({
80
+ ruleset: {
81
+ extends: [],
82
+ rules: Object.fromEntries(rulesToSuppress.map(rule => [rule, 'off'])),
83
+ },
84
+ __unstable: {
85
+ resolver: {
86
+ cache: false,
87
+ },
88
+ },
89
+ });
90
+ if (suppressAllWarnings) {
91
+ // Run the default parser to discover all rule codes
92
+ const diagnostics = yield parser.validate(specFile.text(), {
93
+ source: specFile.getSource(),
94
+ });
95
+ const allRuleNames = Array.from(new Set(diagnostics.map(d => d.code).filter((c) => typeof c === 'string')));
96
+ activeParser = buildCustomParser(allRuleNames);
97
+ }
98
+ else if (suppressedWarnings.length === 0) {
99
+ activeParser = parser;
100
+ }
101
+ else {
102
+ try {
103
+ activeParser = buildCustomParser(suppressedWarnings);
104
+ }
105
+ catch (e) {
106
+ const msg = e.message || '';
107
+ const matches = [...msg.matchAll(/Cannot extend non-existing rule: "([^"]+)"/g)];
108
+ const invalidRules = matches.map(m => m[1]);
109
+ if (invalidRules.length > 0) {
110
+ for (const rule of invalidRules) {
111
+ command.log(`Warning: '${rule}' is not a known rule and will be ignored.`);
112
+ }
113
+ const validRules = suppressedWarnings.filter(rule => !invalidRules.includes(rule));
114
+ activeParser = buildCustomParser(validRules);
115
+ }
116
+ else {
117
+ throw e;
118
+ }
119
+ }
120
+ }
121
+ // Register schema parsers
122
+ activeParser.registerSchemaParser((0, avro_schema_parser_1.AvroSchemaParser)());
123
+ activeParser.registerSchemaParser((0, openapi_schema_parser_1.OpenAPISchemaParser)());
124
+ activeParser.registerSchemaParser((0, raml_dt_schema_parser_1.RamlDTSchemaParser)());
125
+ activeParser.registerSchemaParser((0, protobuf_schema_parser_1.ProtoBuffSchemaParser)());
126
+ const diagnostics = yield activeParser.validate(specFile.text(), {
127
+ source: specFile.getSource(),
128
+ });
75
129
  return logDiagnostics(diagnostics, command, specFile, options);
76
130
  });
77
131
  }
@@ -587,6 +587,21 @@
587
587
  "allowNo": false,
588
588
  "type": "boolean"
589
589
  },
590
+ "suppressWarnings": {
591
+ "description": "List of warning codes to suppress from the validation output.",
592
+ "name": "suppressWarnings",
593
+ "required": false,
594
+ "hasDynamicHelp": false,
595
+ "multiple": true,
596
+ "type": "option"
597
+ },
598
+ "suppressAllWarnings": {
599
+ "description": "Suppress all warnings from the validation output.",
600
+ "name": "suppressAllWarnings",
601
+ "required": false,
602
+ "allowNo": false,
603
+ "type": "boolean"
604
+ },
590
605
  "proxyHost": {
591
606
  "description": "Name of the ProxyHost",
592
607
  "name": "proxyHost",
@@ -1855,5 +1870,5 @@
1855
1870
  ]
1856
1871
  }
1857
1872
  },
1858
- "version": "3.1.1"
1873
+ "version": "3.2.0"
1859
1874
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@asyncapi/cli",
3
3
  "description": "All in one CLI for all AsyncAPI tools",
4
- "version": "3.1.1",
4
+ "version": "3.2.0",
5
5
  "author": "@asyncapi",
6
6
  "bin": {
7
7
  "asyncapi": "./bin/run_bin"
@@ -34,14 +34,10 @@
34
34
  "https-proxy-agent": "^7.0.6",
35
35
  "inquirer": "^8.2.0",
36
36
  "js-yaml": "^4.1.0",
37
- "next": "^14.2.24",
38
- "node-fetch": "^2.0.0",
37
+ "next": "^15.2.4",
39
38
  "oclif": "^4.17.34",
40
39
  "open": "^8.4.0",
41
40
  "picocolors": "^1.0.0",
42
- "reflect-metadata": "^0.1.13",
43
- "serve-handler": "^6.1.3",
44
- "strip-ansi": "^6.0.0",
45
41
  "unzipper": "^0.10.11",
46
42
  "uuid": "^11.1.0",
47
43
  "ws": "^8.2.3",
@@ -50,7 +46,6 @@
50
46
  "devDependencies": {
51
47
  "@asyncapi/minimaltemplate": "./test/fixtures/minimaltemplate",
52
48
  "@asyncapi/newtemplate": "./test/fixtures/newtemplate",
53
- "@babel/core": "^7.19.3",
54
49
  "@oclif/test": "^2",
55
50
  "@swc/core": "^1.3.2",
56
51
  "@types/chai": "^4.3.6",
@@ -60,15 +55,11 @@
60
55
  "@types/js-yaml": "^4.0.5",
61
56
  "@types/mocha": "^10.0.2",
62
57
  "@types/node": "^22.13.10",
63
- "@types/node-fetch": "^2.5.12",
64
58
  "@types/rimraf": "^3.0.2",
65
- "@types/serve-handler": "^6.1.1",
66
59
  "@types/uuid": "^10.0.0",
67
- "@types/wrap-ansi": "^8.0.1",
68
60
  "@types/ws": "^8.2.0",
69
61
  "@typescript-eslint/eslint-plugin": "^5.38.1",
70
62
  "@typescript-eslint/parser": "^5.38.1",
71
- "acorn": "^8.5.0",
72
63
  "chai": "^4.3.6",
73
64
  "cross-env": "^7.0.3",
74
65
  "eslint": "^8.24.0",
@@ -77,14 +68,12 @@
77
68
  "eslint-plugin-github": "^4.3.7",
78
69
  "eslint-plugin-security": "^1.4.0",
79
70
  "eslint-plugin-sonarjs": "^0.15.0",
80
- "globby": "^10.0.2",
81
71
  "markdown-toc": "^1.2.0",
82
72
  "mocha": "^10.2.0",
83
73
  "nyc": "^15.1.0",
84
74
  "rimraf": "^3.0.2",
85
75
  "simple-git": "^3.16.0",
86
76
  "ts-node": "^10.9.1",
87
- "tslib": "^2.3.1",
88
77
  "typescript": "^5.8.2"
89
78
  },
90
79
  "engines": {