diff --git a/config/tools-automated.json b/config/tools-automated.json index d47ded36fd25..0075295a0291 100644 --- a/config/tools-automated.json +++ b/config/tools-automated.json @@ -1 +1 @@ -{"Code-first tools":{"description":"The following is a list of tools that generate AsyncAPI documents from your code.","toolsList":[]},"Code Generators":{"description":"The following is a list of tools that generate code from an AsyncAPI document; not the other way around.","toolsList":[{"title":"Sample Tool","description":"Tool for testing","links":{"websiteUrl":"https://akshatnema.netlify.app","docsUrl":"","repoUrl":"https://github.com/akshatnema/Login-Registration-project"},"filters":{"language":"javascript","technology":["react"],"categories":["code generator"],"hasCommercial":false,"isAsyncAPIOwner":false}}]},"Converters":{"description":"The following is a list of tools that do not yet belong to any specific category but are also useful for the community.","toolsList":[]},"Directories":{"description":"The following is a list of directories that index public AsyncAPI documents.","toolsList":[]},"Documentation Generators":{"description":"The following is a list of tools that generate human-readable documentation from an AsyncAPI document.","toolsList":[]},"UI components":{"description":"The following is a list of UI components to view AsyncAPI documents.","toolsList":[]},"DSL":{"description":"Writing YAML by hand is no fun, and maybe you don't want a GUI, so use a Domain Specific Language to write AsyncAPI in your language of choice.","toolsList":[]},"Frameworks":{"description":"The following is a list of API/application frameworks that make use of AsyncAPI.","toolsList":[]},"GitHub Actions":{"description":"The following is a list of GitHub Actions that you can use in your workflows","toolsList":[]},"Mocking and Testing":{"description":"The tools below take specification documents as input, then publish fake messages to broker destinations for simulation purposes. They may also check that publisher messages are compliant with schemas.","toolsList":[]},"Validators":{"description":"The following is a list of tools that validate AsyncAPI documents.","toolsList":[]},"Compare tools":{"description":"The following is a list of tools that compare AsyncAPI documents.","toolsList":[]},"Others":{"description":"The following is a list of tools that comes under Other category","toolsList":[]}} \ No newline at end of file +{"Code-first tools":{"description":"The following is a list of tools that generate AsyncAPI documents from your code.","toolsList":[]},"Code Generators":{"description":"The following is a list of tools that generate code from an AsyncAPI document; not the other way around.","toolsList":[{"title":"Sample Tool","description":"Tool for testing","links":{"websiteUrl":"https://akshatnema.netlify.app","docsUrl":"","repoUrl":"https://github.com/akshatnema/Login-Registration-project"},"filters":{"language":"javascript","technology":["react"],"categories":["code generator"],"hasCommercial":false,"isAsyncAPIOwner":false}}]},"Converters":{"description":"The following is a list of tools that do not yet belong to any specific category but are also useful for the community.","toolsList":[]},"Directories":{"description":"The following is a list of directories that index public AsyncAPI documents.","toolsList":[]},"Documentation Generators":{"description":"The following is a list of tools that generate human-readable documentation from an AsyncAPI document.","toolsList":[]},"UI components":{"description":"The following is a list of UI components to view AsyncAPI documents.","toolsList":[]},"DSL":{"description":"Writing YAML by hand is no fun, and maybe you don't want a GUI, so use a Domain Specific Language to write AsyncAPI in your language of choice.","toolsList":[]},"Frameworks":{"description":"The following is a list of API/application frameworks that make use of AsyncAPI.","toolsList":[]},"GitHub Actions":{"description":"The following is a list of GitHub Actions that you can use in your workflows","toolsList":[]},"Mocking and Testing":{"description":"The tools below take specification documents as input, then publish fake messages to broker destinations for simulation purposes. They may also check that publisher messages are compliant with schemas.","toolsList":[]},"Validators":{"description":"The following is a list of tools that validate AsyncAPI documents.","toolsList":[]},"Compare tools":{"description":"The following is a list of tools that compare AsyncAPI documents.","toolsList":[]},"Others":{"description":"The following is a list of tools that comes under Other category","toolsList":[{"title":"AsyncAPI CLI","description":"One CLI to rule them all. \nThis is a CLI that aims to integrate all AsyncAPI tools that you need while AsyncAPI document development and maintainance. \nYou can use it to generate docs or code, validate AsyncAPI document and event create new documents.\n","links":{"websiteUrl":"https://www.asyncapi.com/tools/cli","repoUrl":"https://github.com/asyncapi/cli"},"filters":{"technology":["TypeScript"],"categories":["others","cli"],"hasCommercial":false,"isAsyncAPIOwner":true}}]},"CLIs":{"description":"The following is a list of tools that you can work with in terminal or do some CI/CD automation","toolsList":[{"title":"AsyncAPI CLI","description":"One CLI to rule them all. \nThis is a CLI that aims to integrate all AsyncAPI tools that you need while AsyncAPI document development and maintainance. \nYou can use it to generate docs or code, validate AsyncAPI document and event create new documents.\n","links":{"websiteUrl":"https://www.asyncapi.com/tools/cli","repoUrl":"https://github.com/asyncapi/cli"},"filters":{"technology":["TypeScript"],"categories":["others","cli"],"hasCommercial":false,"isAsyncAPIOwner":true}}]}} \ No newline at end of file diff --git a/config/tools-manual.json b/config/tools-manual.json index cd94e25a01e2..4b7fc2e7e8d9 100644 --- a/config/tools-manual.json +++ b/config/tools-manual.json @@ -69,5 +69,9 @@ "Others": { "description": "The following is a list of tools that comes under Other category", "toolsList": [] + }, + "CLIs": { + "description": "The following is a list of tools that you can work with in terminal or do some CI/CD automation", + "toolsList": [] } } \ No newline at end of file diff --git a/config/tools.json b/config/tools.json index 2a90c8ab78f4..6bf94c7ce9c7 100644 --- a/config/tools.json +++ b/config/tools.json @@ -1 +1 @@ -{"Code-first tools":{"description":"The following is a list of tools that generate AsyncAPI documents from your code.","toolsList":[]},"Code Generators":{"description":"The following is a list of tools that generate code from an AsyncAPI document; not the other way around.","toolsList":[{"title":"Sample Tool","description":"Tool for testing","links":{"websiteUrl":"https://akshatnema.netlify.app","docsUrl":"","repoUrl":"https://github.com/akshatnema/Login-Registration-project"},"filters":{"language":{"name":"Javascript","color":"#F2F1C7","borderColor":"#BFBE86"},"technology":[],"categories":["code generator"],"hasCommercial":false,"isAsyncAPIOwner":false}}]},"Converters":{"description":"The following is a list of tools that do not yet belong to any specific category but are also useful for the community.","toolsList":[]},"Directories":{"description":"The following is a list of directories that index public AsyncAPI documents.","toolsList":[]},"Documentation Generators":{"description":"The following is a list of tools that generate human-readable documentation from an AsyncAPI document.","toolsList":[{"title":"asyncapi-asciidoc-template","description":"Asciidoc template for the asyncapi generator","links":{"repoUrl":"https://gitlab.com/djencks/asyncapi-asciidoc-template"},"filters":{"language":{"name":"Javascript","color":"#F2F1C7","borderColor":"#BFBE86"},"technology":[],"categories":["documentation generator"],"hasCommercial":false,"isAsyncAPIOwner":false}}]},"UI components":{"description":"The following is a list of UI components to view AsyncAPI documents.","toolsList":[]},"DSL":{"description":"Writing YAML by hand is no fun, and maybe you don't want a GUI, so use a Domain Specific Language to write AsyncAPI in your language of choice.","toolsList":[]},"Frameworks":{"description":"The following is a list of API/application frameworks that make use of AsyncAPI.","toolsList":[]},"GitHub Actions":{"description":"The following is a list of GitHub Actions that you can use in your workflows","toolsList":[]},"Mocking and Testing":{"description":"The tools below take specification documents as input, then publish fake messages to broker destinations for simulation purposes. They may also check that publisher messages are compliant with schemas.","toolsList":[]},"Validators":{"description":"The following is a list of tools that validate AsyncAPI documents.","toolsList":[]},"Compare tools":{"description":"The following is a list of tools that compare AsyncAPI documents.","toolsList":[]},"Others":{"description":"The following is a list of tools that comes under Other category","toolsList":[]}} \ No newline at end of file +{"Code-first tools":{"description":"The following is a list of tools that generate AsyncAPI documents from your code.","toolsList":[]},"Code Generators":{"description":"The following is a list of tools that generate code from an AsyncAPI document; not the other way around.","toolsList":[{"title":"Sample Tool","description":"Tool for testing","links":{"websiteUrl":"https://akshatnema.netlify.app","docsUrl":"","repoUrl":"https://github.com/akshatnema/Login-Registration-project"},"filters":{"language":{"name":"Javascript","color":"#F2F1C7","borderColor":"#BFBE86"},"technology":[],"categories":["code generator"],"hasCommercial":false,"isAsyncAPIOwner":false}}]},"Converters":{"description":"The following is a list of tools that do not yet belong to any specific category but are also useful for the community.","toolsList":[]},"Directories":{"description":"The following is a list of directories that index public AsyncAPI documents.","toolsList":[]},"Documentation Generators":{"description":"The following is a list of tools that generate human-readable documentation from an AsyncAPI document.","toolsList":[{"title":"asyncapi-asciidoc-template","description":"Asciidoc template for the asyncapi generator","links":{"repoUrl":"https://gitlab.com/djencks/asyncapi-asciidoc-template"},"filters":{"language":{"name":"Javascript","color":"#F2F1C7","borderColor":"#BFBE86"},"technology":[],"categories":["documentation generator"],"hasCommercial":false,"isAsyncAPIOwner":false}}]},"UI components":{"description":"The following is a list of UI components to view AsyncAPI documents.","toolsList":[]},"DSL":{"description":"Writing YAML by hand is no fun, and maybe you don't want a GUI, so use a Domain Specific Language to write AsyncAPI in your language of choice.","toolsList":[]},"Frameworks":{"description":"The following is a list of API/application frameworks that make use of AsyncAPI.","toolsList":[]},"GitHub Actions":{"description":"The following is a list of GitHub Actions that you can use in your workflows","toolsList":[]},"Mocking and Testing":{"description":"The tools below take specification documents as input, then publish fake messages to broker destinations for simulation purposes. They may also check that publisher messages are compliant with schemas.","toolsList":[]},"Validators":{"description":"The following is a list of tools that validate AsyncAPI documents.","toolsList":[]},"Compare tools":{"description":"The following is a list of tools that compare AsyncAPI documents.","toolsList":[]},"Others":{"description":"The following is a list of tools that comes under Other category","toolsList":[{"title":"AsyncAPI CLI","description":"One CLI to rule them all. \nThis is a CLI that aims to integrate all AsyncAPI tools that you need while AsyncAPI document development and maintainance. \nYou can use it to generate docs or code, validate AsyncAPI document and event create new documents.\n","links":{"websiteUrl":"https://www.asyncapi.com/tools/cli","repoUrl":"https://github.com/asyncapi/cli"},"filters":{"technology":[],"categories":["others","cli"],"hasCommercial":false,"isAsyncAPIOwner":true}}]},"CLIs":{"description":"The following is a list of tools that you can work with in terminal or do some CI/CD automation","toolsList":[{"title":"AsyncAPI CLI","description":"One CLI to rule them all. \nThis is a CLI that aims to integrate all AsyncAPI tools that you need while AsyncAPI document development and maintainance. \nYou can use it to generate docs or code, validate AsyncAPI document and event create new documents.\n","links":{"websiteUrl":"https://www.asyncapi.com/tools/cli","repoUrl":"https://github.com/asyncapi/cli"},"filters":{"technology":[],"categories":["others","cli"],"hasCommercial":false,"isAsyncAPIOwner":true}}]}} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index eea6cf00f84f..9c4e2da810a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -62,7 +62,8 @@ "remark-slug": "^6.0.0", "swiper": "^8.3.2", "tailwind-merge": "^1.3.0", - "tailwindcss": "^3.1.4" + "tailwindcss": "^3.1.4", + "yaml": "^2.1.3" }, "devDependencies": { "dedent": "^0.7.0", @@ -223,6 +224,22 @@ "js-yaml": "^4.1.0" } }, + "node_modules/@apidevtools/json-schema-ref-parser/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/@apidevtools/openapi-schemas": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/@apidevtools/openapi-schemas/-/openapi-schemas-2.1.0.tgz", @@ -289,23 +306,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/@asyncapi/parser/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/@asyncapi/parser/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, "node_modules/@asyncapi/parser/node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -686,15 +686,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/@eslint/eslintrc/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, "node_modules/@eslint/eslintrc/node_modules/globals": { "version": "13.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", @@ -704,16 +695,6 @@ "type-fest": "^0.20.2" } }, - "node_modules/@eslint/eslintrc/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -1542,9 +1523,12 @@ "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==" }, "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dependencies": { + "sprintf-js": "~1.0.2" + } }, "node_modules/aria-hidden": { "version": "1.2.1", @@ -2281,14 +2265,6 @@ "parse-json": "^4.0.0" } }, - "node_modules/cosmiconfig/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, "node_modules/cosmiconfig/node_modules/import-fresh": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", @@ -2298,15 +2274,6 @@ "resolve-from": "^3.0.0" } }, - "node_modules/cosmiconfig/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, "node_modules/cosmiconfig/node_modules/resolve-from": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", @@ -2550,6 +2517,14 @@ "postcss": "^8.2.15" } }, + "node_modules/cssnano/node_modules/yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "engines": { + "node": ">= 6" + } + }, "node_modules/csso": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz", @@ -3773,15 +3748,6 @@ "color-convert": "^2.0.1" } }, - "node_modules/eslint/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, "node_modules/eslint/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -3828,16 +3794,6 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "node_modules/eslint/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, "node_modules/eslint/node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -4377,23 +4333,6 @@ "strip-bom-string": "^1.0.0" } }, - "node_modules/gray-matter/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/gray-matter/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, "node_modules/gtoken": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-5.3.2.tgz", @@ -5159,11 +5098,15 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dependencies": { - "argparse": "^2.0.1" + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" } }, "node_modules/jsesc": { @@ -5546,14 +5489,6 @@ "strip-color": "^0.1.0" } }, - "node_modules/markdown-toc/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, "node_modules/markdown-toc/node_modules/gray-matter": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/gray-matter/-/gray-matter-2.1.1.tgz", @@ -5566,15 +5501,6 @@ "toml": "^2.3.2" } }, - "node_modules/markdown-toc/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, "node_modules/marked": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/marked/-/marked-4.1.1.tgz", @@ -7601,14 +7527,6 @@ "autolinker": "~0.28.0" } }, - "node_modules/remarkable/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, "node_modules/repeat-element": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", @@ -8323,6 +8241,14 @@ } } }, + "node_modules/tailwindcss/node_modules/yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "engines": { + "node": ">= 6" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -8834,11 +8760,11 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.3.tgz", + "integrity": "sha512-AacA8nRULjKMX2DvWvOAdBZMOfQlypSFkjcOcu9FalllIDJ1kvlREzcdIZmidQUqqeMv7jorHjq2HlLv/+c2lg==", "engines": { - "node": ">= 6" + "node": ">= 14" } }, "node_modules/yaml-ast-parser": { @@ -9021,6 +8947,21 @@ "@types/json-schema": "^7.0.6", "call-me-maybe": "^1.0.1", "js-yaml": "^4.1.0" + }, + "dependencies": { + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "requires": { + "argparse": "^2.0.1" + } + } } }, "@apidevtools/openapi-schemas": { @@ -9085,23 +9026,6 @@ "uri-js": "^4.2.2" } }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -9385,15 +9309,6 @@ "uri-js": "^4.2.2" } }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, "globals": { "version": "13.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", @@ -9403,16 +9318,6 @@ "type-fest": "^0.20.2" } }, - "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -10062,9 +9967,12 @@ "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==" }, "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "~1.0.2" + } }, "aria-hidden": { "version": "1.2.1", @@ -10710,14 +10618,6 @@ "parse-json": "^4.0.0" }, "dependencies": { - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "requires": { - "sprintf-js": "~1.0.2" - } - }, "import-fresh": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", @@ -10727,15 +10627,6 @@ "resolve-from": "^3.0.0" } }, - "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, "resolve-from": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", @@ -10897,6 +10788,13 @@ "cssnano-preset-default": "^5.2.12", "lilconfig": "^2.0.3", "yaml": "^1.10.2" + }, + "dependencies": { + "yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==" + } } }, "cssnano-preset-default": { @@ -11907,15 +11805,6 @@ "color-convert": "^2.0.1" } }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -11962,16 +11851,6 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -12563,25 +12442,6 @@ "kind-of": "^6.0.2", "section-matter": "^1.0.0", "strip-bom-string": "^1.0.0" - }, - "dependencies": { - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - } } }, "gtoken": { @@ -13256,11 +13116,12 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "requires": { - "argparse": "^2.0.1" + "argparse": "^1.0.7", + "esprima": "^4.0.0" } }, "jsesc": { @@ -13619,14 +13480,6 @@ "strip-color": "^0.1.0" }, "dependencies": { - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "requires": { - "sprintf-js": "~1.0.2" - } - }, "gray-matter": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/gray-matter/-/gray-matter-2.1.1.tgz", @@ -13638,15 +13491,6 @@ "js-yaml": "^3.8.1", "toml": "^2.3.2" } - }, - "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } } } }, @@ -15310,16 +15154,6 @@ "requires": { "argparse": "^1.0.10", "autolinker": "~0.28.0" - }, - "dependencies": { - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "requires": { - "sprintf-js": "~1.0.2" - } - } } }, "repeat-element": { @@ -15918,6 +15752,11 @@ "lilconfig": "^2.0.5", "yaml": "^1.10.2" } + }, + "yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==" } } }, @@ -16344,9 +16183,9 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.1.3.tgz", + "integrity": "sha512-AacA8nRULjKMX2DvWvOAdBZMOfQlypSFkjcOcu9FalllIDJ1kvlREzcdIZmidQUqqeMv7jorHjq2HlLv/+c2lg==" }, "yaml-ast-parser": { "version": "0.0.43", diff --git a/package.json b/package.json index f65940b54e66..337f7a7ebe5e 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,8 @@ "remark-slug": "^6.0.0", "swiper": "^8.3.2", "tailwind-merge": "^1.3.0", - "tailwindcss": "^3.1.4" + "tailwindcss": "^3.1.4", + "yaml": "^2.1.3" }, "devDependencies": { "dedent": "^0.7.0", diff --git a/scripts/build-tools.js b/scripts/build-tools.js index e5c8f8600446..5da52d06607a 100644 --- a/scripts/build-tools.js +++ b/scripts/build-tools.js @@ -1,18 +1,20 @@ const { getData } = require('./tools/extract-tools-github'); const { convertTools } = require('./tools/tools-object'); const { combineTools } = require('./tools/combine-tools'); +const manualTools = require('../config/tools-manual.json') + const fs = require('fs'); const { resolve } = require('path'); const buildTools = async () => { try { let githubExtractData = await getData(); - let toolsData = await convertTools(githubExtractData); + let automatedTools = await convertTools(githubExtractData); fs.writeFileSync( resolve(__dirname, '../config', 'tools-automated.json'), - JSON.stringify(toolsData) + JSON.stringify(automatedTools) ); - await combineTools(toolsData); + await combineTools(automatedTools, manualTools); } catch (err) { console.log(err); throw err diff --git a/scripts/tools/categorylist.js b/scripts/tools/categorylist.js index b74ba582f7c0..f46a8d7cef99 100644 --- a/scripts/tools/categorylist.js +++ b/scripts/tools/categorylist.js @@ -1,5 +1,3 @@ -// const categoryList = ["generator", "code-first", "converters", "validators", "directories", "documentation generators", "dls", "frameworks", "ui components", "mocking and testing", "diff", "ci&cd", "editors"] - const categoryList = [ { name: "Code-first tools", @@ -66,6 +64,11 @@ const categoryList = [ tag: "other", description: "The following is a list of tools that comes under Other category" }, + { + name: "CLIs", + tag: "cli", + description: "The following is a list of tools that you can work with in terminal or do some CI/CD automation" + } ] module.exports = {categoryList} \ No newline at end of file diff --git a/scripts/tools/combine-tools.js b/scripts/tools/combine-tools.js index 019598e3050b..98c8437dccac 100644 --- a/scripts/tools/combine-tools.js +++ b/scripts/tools/combine-tools.js @@ -1,4 +1,3 @@ -const manualTools = require("../../config/tools-manual.json") const { languages, technologies } = require("./tags-color") const { categoryList } = require("./categorylist.js") const fs = require('fs') @@ -25,9 +24,14 @@ const fuse = new Fuse(list, options) const getFinalTool = async (toolObject) => { let finalObject = toolObject; - const languageSearch = await fuse.search(toolObject.filters.language) - if (languageSearch.length) { - finalObject.filters.language = languageSearch[0].item; + + //there might be a tool without language + if(toolObject.filters.language) { + + const languageSearch = await fuse.search(toolObject.filters.language) + if (languageSearch.length) { + finalObject.filters.language = languageSearch[0].item; + } } let technologyArray = []; for (const technology of toolObject.filters.technology) { @@ -41,7 +45,7 @@ const getFinalTool = async (toolObject) => { } -const combineTools = async (automatedTools) => { +const combineTools = async (automatedTools, manualTools) => { for (const key in automatedTools) { let finalToolsList = []; if (automatedTools[key].toolsList.length) { @@ -49,7 +53,7 @@ const combineTools = async (automatedTools) => { finalToolsList.push(await getFinalTool(tool)) } } - if (manualTools[key].toolsList.length) { + if (manualTools[key] && manualTools[key].toolsList.length) { for (const tool of manualTools[key].toolsList) { finalToolsList.push(await getFinalTool(tool)) } diff --git a/scripts/tools/tools-object.js b/scripts/tools/tools-object.js index 55c378f83b56..5b05aa735152 100644 --- a/scripts/tools/tools-object.js +++ b/scripts/tools/tools-object.js @@ -2,6 +2,7 @@ const schema = require("./tools-schema.json"); const axios = require('axios') const Ajv = require("ajv") const Fuse = require("fuse.js") +const yaml = require('yaml'); const { categoryList } = require("./categorylist") const ajv = new Ajv() const validate = ajv.compile(schema) @@ -33,46 +34,75 @@ const createToolObject = (toolFile, repositoryUrl, isAsyncAPIrepo) => { async function convertTools(data) { let appendData = {}; - for(var index in categoryList){ + const dataArray = data.items; + + for (var index in categoryList) { appendData[categoryList[index].name] = { description: categoryList[index].description, toolsList: [] }; } - const dataArray = data.items; + for (let tool of dataArray) { - if (tool.name === '.asyncapi-tool') { - // extracting the reference id of the repository which will be used to extract the path of the .asyncapi-tool file in the Tools repository - // ex: for a url = "https://api.github.com/repositories/351453552/contents/.asyncapi-tool?ref=61855e7365a881e98c2fe667a658a0005753d873" - // the text (id) present after '=' gives us a reference id for the repo - let reference_id = tool.url.split("=")[1]; - let download_url = `https://raw.githubusercontent.com/${tool.repository.full_name}/${reference_id}/${tool.path}`; - const { data: toolFileContent } = await axios.get(download_url); - const valid = validate(toolFileContent) - if (valid) { - let repositoryUrl = tool.repository.html_url; - let isAsyncAPIrepo = tool.repository.owner.login === "asyncapi"; - let toolObject = createToolObject(toolFileContent, repositoryUrl, isAsyncAPIrepo); - toolFileContent.filters.categories.forEach((category) => { - const categorySearch = fuse.search(category); - if (categorySearch.length) { - let searchedCategoryName = categorySearch[0].item.name - if (!appendData[searchedCategoryName].toolsList.find((element => element === toolObject))) - appendData[searchedCategoryName].toolsList.push(toolObject); - } else { - if (!appendData['Others'].toolsList.find((element => element === toolObject))) - appendData['Others'].toolsList.push(toolObject); - } - }); - } else { - console.error('Invalid .asyncapi-tool file.'); - console.error(`Located in: ${tool.html_url}`); - console.error('Validation errors:', JSON.stringify(validate.errors, null, 2)); - console.error('Not failing, dropping errors for further investigation'); + try { + if (tool.name === '.asyncapi-tool') { + // extracting the reference id of the repository which will be used to extract the path of the .asyncapi-tool file in the Tools repository + // ex: for a url = "https://api.github.com/repositories/351453552/contents/.asyncapi-tool?ref=61855e7365a881e98c2fe667a658a0005753d873" + // the text (id) present after '=' gives us a reference id for the repo + let reference_id = tool.url.split("=")[1]; + let download_url = `https://raw.githubusercontent.com/${tool.repository.full_name}/${reference_id}/${tool.path}`; + + const { data: toolFileContent } = await axios.get(download_url); + + //some stuff can be YAML + const jsonToolFileContent = convertToJson(toolFileContent) + + //validating against JSON Schema for tools file + const isValid = validate(jsonToolFileContent) + + if (isValid) { + let repositoryUrl = tool.repository.html_url; + let isAsyncAPIrepo = tool.repository.owner.login === "asyncapi"; + let toolObject = createToolObject(jsonToolFileContent, repositoryUrl, isAsyncAPIrepo); + + jsonToolFileContent.filters.categories.forEach((category) => { + const categorySearch = fuse.search(category); + + if (categorySearch.length) { + let searchedCategoryName = categorySearch[0].item.name + if (!appendData[searchedCategoryName].toolsList.find((element => element === toolObject))) + appendData[searchedCategoryName].toolsList.push(toolObject); + } else { + if (!appendData['Others'].toolsList.find((element => element === toolObject))) + appendData['Others'].toolsList.push(toolObject); + } + }); + } else { + console.error('Invalid .asyncapi-tool file.'); + console.error(`Located in: ${tool.html_url}`); + console.error('Validation errors:', JSON.stringify(validate.errors, null, 2)); + console.error('Not failing, dropping errors for further investigation'); + } } + } catch (err) { + console.error(err) + throw err; } } return appendData; } +function convertToJson(contentYAMLorJSON) { + + //Axios handles conversion to JSON by default, if data returned for the server allows it + //So if returned content is not string (not YAML) we just return JSON back + if (typeof contentYAMLorJSON !== "string") return contentYAMLorJSON; + + //in some cases json can be passed here as string as it failed parsing to json because of json related error + //instead of passint it to yaml parser, return same stuff that came in so it fails on JSON Schema validation later + if (contentYAMLorJSON.trimLeft().startsWith('{')) return contentYAMLorJSON + + return yaml.parse(contentYAMLorJSON); +} + module.exports = { convertTools } diff --git a/scripts/tools/tools-schema.json b/scripts/tools/tools-schema.json index e98dd3b622d0..8e1d2956dbbf 100644 --- a/scripts/tools/tools-schema.json +++ b/scripts/tools/tools-schema.json @@ -2,7 +2,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "title": "JSON Schema for AsyncAPI tool discovery file.", "type": "object", - "required": ["title", "description", "maintainers", "links", "filters"], + "required": ["title", "description", "links", "filters"], "properties": { "title": { "type": "string", @@ -25,7 +25,7 @@ }, "filters": { "type": "object", - "required": ["language", "technology", "categories"], + "required": ["technology", "categories"], "properties": { "language": { "type": "string"