diff --git a/library/package-lock.json b/library/package-lock.json index 55367e685..0f5727a60 100644 --- a/library/package-lock.json +++ b/library/package-lock.json @@ -1,17 +1,17 @@ { "name": "@asyncapi/react-component", - "version": "1.0.1", + "version": "1.0.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@asyncapi/react-component", - "version": "1.0.1", + "version": "1.0.2", "license": "Apache-2.0", "dependencies": { "@asyncapi/avro-schema-parser": "3.0.3", "@asyncapi/openapi-schema-parser": "3.0.4", - "@asyncapi/parser": "^3.0.0-next-major-spec.1", + "@asyncapi/parser": "^3.0.0-next-major-spec.3", "@asyncapi/protobuf-schema-parser": "3.0.0", "highlight.js": "^10.7.2", "isomorphic-dompurify": "^0.13.0", @@ -227,9 +227,9 @@ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, "node_modules/@asyncapi/parser": { - "version": "3.0.0-next-major-spec.2", - "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.0-next-major-spec.2.tgz", - "integrity": "sha512-/gJgCYNYlUSDJhySK3IagjiyFfnwEsAZd5rTe396CB+HxJ6yDWDOZYdHzkFgU2RnCULSGzVOWZGx8t3PK+yuVg==", + "version": "3.0.0-next-major-spec.3", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.0-next-major-spec.3.tgz", + "integrity": "sha512-LCrAQqJpGxraMyU2k1Nh1X6Q1dz7a/YhTRRFFrQHOEo+TUT/kRdoUkRDP++e58dO7h9MBN+/hZK5TaqE+/jQiw==", "dependencies": { "@asyncapi/specs": "^6.0.0-next-major-spec.6", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", @@ -16627,9 +16627,9 @@ } }, "@asyncapi/parser": { - "version": "3.0.0-next-major-spec.2", - "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.0-next-major-spec.2.tgz", - "integrity": "sha512-/gJgCYNYlUSDJhySK3IagjiyFfnwEsAZd5rTe396CB+HxJ6yDWDOZYdHzkFgU2RnCULSGzVOWZGx8t3PK+yuVg==", + "version": "3.0.0-next-major-spec.3", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.0-next-major-spec.3.tgz", + "integrity": "sha512-LCrAQqJpGxraMyU2k1Nh1X6Q1dz7a/YhTRRFFrQHOEo+TUT/kRdoUkRDP++e58dO7h9MBN+/hZK5TaqE+/jQiw==", "requires": { "@asyncapi/specs": "^6.0.0-next-major-spec.6", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", diff --git a/library/package.json b/library/package.json index cd22108c7..d3adbd25d 100644 --- a/library/package.json +++ b/library/package.json @@ -1,6 +1,6 @@ { "name": "@asyncapi/react-component", - "version": "1.0.1", + "version": "1.0.2", "private": false, "description": "A React component for AsyncAPI specification.", "repository": { @@ -71,7 +71,7 @@ "@asyncapi/avro-schema-parser": "3.0.3", "@asyncapi/openapi-schema-parser": "3.0.4", "@asyncapi/protobuf-schema-parser": "3.0.0", - "@asyncapi/parser": "^3.0.0-next-major-spec.1", + "@asyncapi/parser": "^3.0.0-next-major-spec.3", "highlight.js": "^10.7.2", "isomorphic-dompurify": "^0.13.0", "marked": "^4.0.14", diff --git a/library/src/containers/AsyncApi/Standalone.tsx b/library/src/containers/AsyncApi/Standalone.tsx index c92027275..4f5d72fb6 100644 --- a/library/src/containers/AsyncApi/Standalone.tsx +++ b/library/src/containers/AsyncApi/Standalone.tsx @@ -32,7 +32,6 @@ class AsyncApiComponent extends Component { if (parsedSpec) { this.state = { asyncapi: parsedSpec }; } - return; } async componentDidMount() { diff --git a/library/src/containers/Servers/Security.tsx b/library/src/containers/Servers/Security.tsx index 2575c286b..21569a7d7 100644 --- a/library/src/containers/Servers/Security.tsx +++ b/library/src/containers/Servers/Security.tsx @@ -26,8 +26,7 @@ export const Security: React.FunctionComponent = ({ let renderedSecurities; if ( - !security || - !security.length || + !security?.length || !securitySchemes || !Object.keys(securitySchemes).length ) { @@ -276,7 +275,7 @@ const SecurityItem: React.FunctionComponent = ({ )} - {securitySchema && securitySchema.hasDescription() && ( + {securitySchema?.hasDescription() && (
{securitySchema.description()}
diff --git a/library/src/helpers/message.ts b/library/src/helpers/message.ts index 398700a80..5c7158853 100644 --- a/library/src/helpers/message.ts +++ b/library/src/helpers/message.ts @@ -53,10 +53,9 @@ export class MessageHelpers { } const payload = msg.payload(); - if (payload && payload.examples()) { + if (payload?.examples()) { return payload.examples()?.map(example => ({ example })); } - return; } @@ -84,10 +83,9 @@ export class MessageHelpers { } const headers = msg.headers(); - if (headers && headers.examples()) { + if (headers?.examples()) { return headers.examples()?.map(example => ({ example })); } - - return; + return undefined; } } diff --git a/playground/package-lock.json b/playground/package-lock.json index 938ba87f6..51eac88d9 100644 --- a/playground/package-lock.json +++ b/playground/package-lock.json @@ -1,14 +1,14 @@ { "name": "playground", - "version": "1.0.1", + "version": "1.0.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "playground", - "version": "1.0.1", + "version": "1.0.2", "dependencies": { - "@asyncapi/react-component": "^1.0.1", + "@asyncapi/react-component": "^1.0.2", "@fortawesome/fontawesome-svg-core": "^1.2.22", "@fortawesome/free-brands-svg-icons": "^5.10.2", "@fortawesome/free-solid-svg-icons": "^5.10.2", @@ -296,9 +296,9 @@ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, "node_modules/@asyncapi/parser": { - "version": "3.0.0-next-major-spec.2", - "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.0-next-major-spec.2.tgz", - "integrity": "sha512-/gJgCYNYlUSDJhySK3IagjiyFfnwEsAZd5rTe396CB+HxJ6yDWDOZYdHzkFgU2RnCULSGzVOWZGx8t3PK+yuVg==", + "version": "3.0.0-next-major-spec.3", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.0-next-major-spec.3.tgz", + "integrity": "sha512-LCrAQqJpGxraMyU2k1Nh1X6Q1dz7a/YhTRRFFrQHOEo+TUT/kRdoUkRDP++e58dO7h9MBN+/hZK5TaqE+/jQiw==", "dependencies": { "@asyncapi/specs": "^6.0.0-next-major-spec.6", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", @@ -450,13 +450,13 @@ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, "node_modules/@asyncapi/react-component": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@asyncapi/react-component/-/react-component-1.0.1.tgz", - "integrity": "sha512-9CIAMhs6nUw4F8PeU61zbxt02uqWHdfEkzOyTw+aTVyjQX6ayol/DwF7t7+p3gqfpIhNT4vuTUKUwvj5GvwLSw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@asyncapi/react-component/-/react-component-1.0.2.tgz", + "integrity": "sha512-Betb4RDEsATpKcpw5uG2PeNWViPJIlwGZKx3xPFBpreh9J4nB9SFb7WPddY4Myrbw79/PX6N/KBy+LyiETEDmA==", "dependencies": { "@asyncapi/avro-schema-parser": "3.0.3", "@asyncapi/openapi-schema-parser": "3.0.4", - "@asyncapi/parser": "^3.0.0-next-major-spec.1", + "@asyncapi/parser": "^3.0.0-next-major-spec.3", "@asyncapi/protobuf-schema-parser": "3.0.0", "highlight.js": "^10.7.2", "isomorphic-dompurify": "^0.13.0", @@ -470,9 +470,9 @@ } }, "node_modules/@asyncapi/specs": { - "version": "6.0.0-next-major-spec.7", - "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.0.0-next-major-spec.7.tgz", - "integrity": "sha512-rorau4qa1rjlIz4vGy3MuzQKSyKyJWuRa3DbFKopixDCjnAOIScVDc/M6/T8X9Ay+GQhebcYrbiPT4JUvWbFAA==", + "version": "6.0.0-next-major-spec.8", + "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.0.0-next-major-spec.8.tgz", + "integrity": "sha512-WVhzeJepkqO6abDprz9bk9zR/ESidanQncPP7jFRUJQ71ED4/XQMjaSKLE5MB09eUUZoY5EqoccUQJWfc54SMg==", "dependencies": { "@types/json-schema": "^7.0.11" } @@ -20790,9 +20790,9 @@ } }, "@asyncapi/parser": { - "version": "3.0.0-next-major-spec.2", - "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.0-next-major-spec.2.tgz", - "integrity": "sha512-/gJgCYNYlUSDJhySK3IagjiyFfnwEsAZd5rTe396CB+HxJ6yDWDOZYdHzkFgU2RnCULSGzVOWZGx8t3PK+yuVg==", + "version": "3.0.0-next-major-spec.3", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.0-next-major-spec.3.tgz", + "integrity": "sha512-LCrAQqJpGxraMyU2k1Nh1X6Q1dz7a/YhTRRFFrQHOEo+TUT/kRdoUkRDP++e58dO7h9MBN+/hZK5TaqE+/jQiw==", "requires": { "@asyncapi/specs": "^6.0.0-next-major-spec.6", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", @@ -20930,13 +20930,13 @@ } }, "@asyncapi/react-component": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@asyncapi/react-component/-/react-component-1.0.1.tgz", - "integrity": "sha512-9CIAMhs6nUw4F8PeU61zbxt02uqWHdfEkzOyTw+aTVyjQX6ayol/DwF7t7+p3gqfpIhNT4vuTUKUwvj5GvwLSw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@asyncapi/react-component/-/react-component-1.0.2.tgz", + "integrity": "sha512-Betb4RDEsATpKcpw5uG2PeNWViPJIlwGZKx3xPFBpreh9J4nB9SFb7WPddY4Myrbw79/PX6N/KBy+LyiETEDmA==", "requires": { "@asyncapi/avro-schema-parser": "3.0.3", "@asyncapi/openapi-schema-parser": "3.0.4", - "@asyncapi/parser": "^3.0.0-next-major-spec.1", + "@asyncapi/parser": "^3.0.0-next-major-spec.3", "@asyncapi/protobuf-schema-parser": "3.0.0", "highlight.js": "^10.7.2", "isomorphic-dompurify": "^0.13.0", @@ -20946,9 +20946,9 @@ } }, "@asyncapi/specs": { - "version": "6.0.0-next-major-spec.7", - "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.0.0-next-major-spec.7.tgz", - "integrity": "sha512-rorau4qa1rjlIz4vGy3MuzQKSyKyJWuRa3DbFKopixDCjnAOIScVDc/M6/T8X9Ay+GQhebcYrbiPT4JUvWbFAA==", + "version": "6.0.0-next-major-spec.8", + "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.0.0-next-major-spec.8.tgz", + "integrity": "sha512-WVhzeJepkqO6abDprz9bk9zR/ESidanQncPP7jFRUJQ71ED4/XQMjaSKLE5MB09eUUZoY5EqoccUQJWfc54SMg==", "requires": { "@types/json-schema": "^7.0.11" } diff --git a/playground/package.json b/playground/package.json index 2da657734..501cc6e6d 100644 --- a/playground/package.json +++ b/playground/package.json @@ -4,7 +4,7 @@ "description": "Playground app for AsyncApi React Component", "homepage": "https://asyncapi.github.io/asyncapi-react", "dependencies": { - "@asyncapi/react-component": "^1.0.1", + "@asyncapi/react-component": "^1.0.2", "@fortawesome/fontawesome-svg-core": "^1.2.22", "@fortawesome/free-brands-svg-icons": "^5.10.2", "@fortawesome/free-solid-svg-icons": "^5.10.2", @@ -45,5 +45,5 @@ "last 1 safari version" ] }, - "version": "1.0.1" + "version": "1.0.2" } diff --git a/web-component/package-lock.json b/web-component/package-lock.json index 04b9d3518..d39c087fb 100644 --- a/web-component/package-lock.json +++ b/web-component/package-lock.json @@ -1,15 +1,15 @@ { "name": "@asyncapi/web-component", - "version": "1.0.1", + "version": "1.0.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@asyncapi/web-component", - "version": "1.0.1", + "version": "1.0.2", "license": "Apache-2.0", "dependencies": { - "@asyncapi/react-component": "^1.0.1", + "@asyncapi/react-component": "^1.0.2", "react": "^16.8.0", "react-dom": "^16.8.0", "web-react-components": "^1.4.2" @@ -217,9 +217,9 @@ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, "node_modules/@asyncapi/parser": { - "version": "3.0.0-next-major-spec.2", - "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.0-next-major-spec.2.tgz", - "integrity": "sha512-/gJgCYNYlUSDJhySK3IagjiyFfnwEsAZd5rTe396CB+HxJ6yDWDOZYdHzkFgU2RnCULSGzVOWZGx8t3PK+yuVg==", + "version": "3.0.0-next-major-spec.3", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.0-next-major-spec.3.tgz", + "integrity": "sha512-LCrAQqJpGxraMyU2k1Nh1X6Q1dz7a/YhTRRFFrQHOEo+TUT/kRdoUkRDP++e58dO7h9MBN+/hZK5TaqE+/jQiw==", "dependencies": { "@asyncapi/specs": "^6.0.0-next-major-spec.6", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", @@ -339,13 +339,13 @@ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, "node_modules/@asyncapi/react-component": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@asyncapi/react-component/-/react-component-1.0.1.tgz", - "integrity": "sha512-9CIAMhs6nUw4F8PeU61zbxt02uqWHdfEkzOyTw+aTVyjQX6ayol/DwF7t7+p3gqfpIhNT4vuTUKUwvj5GvwLSw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@asyncapi/react-component/-/react-component-1.0.2.tgz", + "integrity": "sha512-Betb4RDEsATpKcpw5uG2PeNWViPJIlwGZKx3xPFBpreh9J4nB9SFb7WPddY4Myrbw79/PX6N/KBy+LyiETEDmA==", "dependencies": { "@asyncapi/avro-schema-parser": "3.0.3", "@asyncapi/openapi-schema-parser": "3.0.4", - "@asyncapi/parser": "^3.0.0-next-major-spec.1", + "@asyncapi/parser": "^3.0.0-next-major-spec.3", "@asyncapi/protobuf-schema-parser": "3.0.0", "highlight.js": "^10.7.2", "isomorphic-dompurify": "^0.13.0", @@ -371,9 +371,9 @@ } }, "node_modules/@asyncapi/specs": { - "version": "6.0.0-next-major-spec.7", - "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.0.0-next-major-spec.7.tgz", - "integrity": "sha512-rorau4qa1rjlIz4vGy3MuzQKSyKyJWuRa3DbFKopixDCjnAOIScVDc/M6/T8X9Ay+GQhebcYrbiPT4JUvWbFAA==", + "version": "6.0.0-next-major-spec.8", + "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.0.0-next-major-spec.8.tgz", + "integrity": "sha512-WVhzeJepkqO6abDprz9bk9zR/ESidanQncPP7jFRUJQ71ED4/XQMjaSKLE5MB09eUUZoY5EqoccUQJWfc54SMg==", "dependencies": { "@types/json-schema": "^7.0.11" } @@ -4132,9 +4132,9 @@ } }, "@asyncapi/parser": { - "version": "3.0.0-next-major-spec.2", - "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.0-next-major-spec.2.tgz", - "integrity": "sha512-/gJgCYNYlUSDJhySK3IagjiyFfnwEsAZd5rTe396CB+HxJ6yDWDOZYdHzkFgU2RnCULSGzVOWZGx8t3PK+yuVg==", + "version": "3.0.0-next-major-spec.3", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.0-next-major-spec.3.tgz", + "integrity": "sha512-LCrAQqJpGxraMyU2k1Nh1X6Q1dz7a/YhTRRFFrQHOEo+TUT/kRdoUkRDP++e58dO7h9MBN+/hZK5TaqE+/jQiw==", "requires": { "@asyncapi/specs": "^6.0.0-next-major-spec.6", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", @@ -4246,13 +4246,13 @@ } }, "@asyncapi/react-component": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@asyncapi/react-component/-/react-component-1.0.1.tgz", - "integrity": "sha512-9CIAMhs6nUw4F8PeU61zbxt02uqWHdfEkzOyTw+aTVyjQX6ayol/DwF7t7+p3gqfpIhNT4vuTUKUwvj5GvwLSw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@asyncapi/react-component/-/react-component-1.0.2.tgz", + "integrity": "sha512-Betb4RDEsATpKcpw5uG2PeNWViPJIlwGZKx3xPFBpreh9J4nB9SFb7WPddY4Myrbw79/PX6N/KBy+LyiETEDmA==", "requires": { "@asyncapi/avro-schema-parser": "3.0.3", "@asyncapi/openapi-schema-parser": "3.0.4", - "@asyncapi/parser": "^3.0.0-next-major-spec.1", + "@asyncapi/parser": "^3.0.0-next-major-spec.3", "@asyncapi/protobuf-schema-parser": "3.0.0", "highlight.js": "^10.7.2", "isomorphic-dompurify": "^0.13.0", @@ -4272,9 +4272,9 @@ } }, "@asyncapi/specs": { - "version": "6.0.0-next-major-spec.7", - "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.0.0-next-major-spec.7.tgz", - "integrity": "sha512-rorau4qa1rjlIz4vGy3MuzQKSyKyJWuRa3DbFKopixDCjnAOIScVDc/M6/T8X9Ay+GQhebcYrbiPT4JUvWbFAA==", + "version": "6.0.0-next-major-spec.8", + "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.0.0-next-major-spec.8.tgz", + "integrity": "sha512-WVhzeJepkqO6abDprz9bk9zR/ESidanQncPP7jFRUJQ71ED4/XQMjaSKLE5MB09eUUZoY5EqoccUQJWfc54SMg==", "requires": { "@types/json-schema": "^7.0.11" } diff --git a/web-component/package.json b/web-component/package.json index 6861a41cf..1da1e5687 100644 --- a/web-component/package.json +++ b/web-component/package.json @@ -1,6 +1,6 @@ { "name": "@asyncapi/web-component", - "version": "1.0.1", + "version": "1.0.2", "private": false, "description": "A web component for AsyncAPI specification. Based on @asyncapi/react-component.", "repository": { @@ -45,7 +45,7 @@ "install:reactcomp": "chmod +x ./bump-react-comp.sh && ./bump-react-comp.sh" }, "dependencies": { - "@asyncapi/react-component": "^1.0.1", + "@asyncapi/react-component": "^1.0.2", "react": "^16.8.0", "react-dom": "^16.8.0", "web-react-components": "^1.4.2"