From ac38cb91a67be4f5f5b35d2b0dd907cd2ada015a Mon Sep 17 00:00:00 2001 From: Samir AMZANI Date: Mon, 11 Dec 2023 16:29:57 +0100 Subject: [PATCH] feat: Support Avro schemas --- apps/studio/package.json | 1 + apps/studio/src/services/parser.service.ts | 2 ++ package-lock.json | 24 +++++++++++++++++++++- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/apps/studio/package.json b/apps/studio/package.json index 387bd170c..2cb05e916 100644 --- a/apps/studio/package.json +++ b/apps/studio/package.json @@ -27,6 +27,7 @@ "@asyncapi/converter": "^1.4.5", "@asyncapi/openapi-schema-parser": "^3.0.4", "@asyncapi/parser": "^3.0.1", + "@asyncapi/protobuf-schema-parser": "^3.0.4", "@asyncapi/react-component": "^1.2.2", "@asyncapi/specs": "^6.1.0", "@ebay/nice-modal-react": "^1.2.10", diff --git a/apps/studio/src/services/parser.service.ts b/apps/studio/src/services/parser.service.ts index 1ce683004..3797d48ca 100644 --- a/apps/studio/src/services/parser.service.ts +++ b/apps/studio/src/services/parser.service.ts @@ -3,6 +3,7 @@ import { AbstractService } from './abstract.service'; import { Parser, DiagnosticSeverity } from '@asyncapi/parser/cjs'; import { OpenAPISchemaParser } from '@asyncapi/openapi-schema-parser'; import { AvroSchemaParser } from '@asyncapi/avro-schema-parser'; +import { ProtoBuffSchemaParser } from '@asyncapi/protobuf-schema-parser'; import { untilde } from '@asyncapi/parser/cjs/utils'; import { isDeepEqual } from '../helpers'; @@ -21,6 +22,7 @@ export class ParserService extends AbstractService { // Temporary fix for TS error OpenAPISchemaParser() as SchemaParser, AvroSchemaParser() as SchemaParser, + ProtoBuffSchemaParser() as SchemaParser, ], __unstable: { resolver: { diff --git a/package-lock.json b/package-lock.json index eeb44da18..235e3fb23 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "fix-examples", + "name": "studio", "lockfileVersion": 2, "requires": true, "packages": { @@ -501,6 +501,7 @@ "@asyncapi/converter": "^1.4.5", "@asyncapi/openapi-schema-parser": "^3.0.4", "@asyncapi/parser": "^3.0.1", + "@asyncapi/protobuf-schema-parser": "^3.0.4", "@asyncapi/react-component": "^1.2.2", "@asyncapi/specs": "^6.1.0", "@ebay/nice-modal-react": "^1.2.10", @@ -632,6 +633,16 @@ "node-fetch": "2.6.7" } }, + "apps/studio/node_modules/@asyncapi/protobuf-schema-parser": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@asyncapi/protobuf-schema-parser/-/protobuf-schema-parser-3.0.4.tgz", + "integrity": "sha512-y48HjZqwEnR1b+N2pQd+8qyxXrTO8+u3mZlef5uNAHG0Bj8LeWl887+ZFa+0AQ7OEmUR/K4NITDpCSDgvK6OQw==", + "dependencies": { + "@asyncapi/parser": "^3.0.1", + "@types/protocol-buffers-schema": "^3.4.1", + "protocol-buffers-schema": "^3.6.0" + } + }, "apps/studio/node_modules/@asyncapi/specs": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.1.0.tgz", @@ -35821,6 +35832,7 @@ "@asyncapi/nodejs-ws-template": "^0.9.33", "@asyncapi/openapi-schema-parser": "^3.0.4", "@asyncapi/parser": "^3.0.1", + "@asyncapi/protobuf-schema-parser": "^3.0.4", "@asyncapi/python-paho-template": "^0.2.13", "@asyncapi/react-component": "^1.2.2", "@asyncapi/specs": "^6.1.0", @@ -35907,6 +35919,16 @@ "node-fetch": "2.6.7" } }, + "@asyncapi/protobuf-schema-parser": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@asyncapi/protobuf-schema-parser/-/protobuf-schema-parser-3.0.4.tgz", + "integrity": "sha512-y48HjZqwEnR1b+N2pQd+8qyxXrTO8+u3mZlef5uNAHG0Bj8LeWl887+ZFa+0AQ7OEmUR/K4NITDpCSDgvK6OQw==", + "requires": { + "@asyncapi/parser": "^3.0.1", + "@types/protocol-buffers-schema": "^3.4.1", + "protocol-buffers-schema": "^3.6.0" + } + }, "@asyncapi/specs": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.1.0.tgz",