diff --git a/src/index.ts b/src/index.ts index fb6ceb7aa..0d6cd42b7 100755 --- a/src/index.ts +++ b/src/index.ts @@ -59,7 +59,7 @@ export default async function GleeAppInitializer() { await registerAuth(GLEE_AUTH_DIR) const parsedAsyncAPI = await getParsedAsyncAPI() - const channelNames = parsedAsyncAPI.channels().map(e => e.address()) + const channelNames = parsedAsyncAPI.channels().all().map(e => e.address()) const app = new Glee(config) diff --git a/src/lib/asyncapiFile.ts b/src/lib/asyncapiFile.ts index 70d12c3cb..c647b294f 100644 --- a/src/lib/asyncapiFile.ts +++ b/src/lib/asyncapiFile.ts @@ -6,5 +6,6 @@ export async function getParsedAsyncAPI(): Promise { const { ASYNCAPI_FILE_PATH } = getConfigs() const asyncapiFileContent = await readFile(ASYNCAPI_FILE_PATH, 'utf-8') const parser = new Parser() - return toAsyncAPIDocument(parser.parse(asyncapiFileContent)) + const {document} = await parser.parse(asyncapiFileContent) + return toAsyncAPIDocument(document) } diff --git a/src/lib/servers.ts b/src/lib/servers.ts index a64ba3690..947d9b50a 100644 --- a/src/lib/servers.ts +++ b/src/lib/servers.ts @@ -4,7 +4,7 @@ export async function getSelectedServerNames(): Promise { const parsedAsyncAPI = await getParsedAsyncAPI() if (!process.env.GLEE_SERVER_NAMES) { - return parsedAsyncAPI.servers().all().map(e => e.url()) + return parsedAsyncAPI.servers().all().map(e => e.id()) } const arrayOfNames = process.env.GLEE_SERVER_NAMES.split(',') diff --git a/src/registerAdapters.ts b/src/registerAdapters.ts index 3ac2e0241..c31a20ef2 100644 --- a/src/registerAdapters.ts +++ b/src/registerAdapters.ts @@ -41,7 +41,7 @@ function registerAdapterForServer( config: GleeConfig ) { const protocol = server.protocol() - const remoteServers = parsedAsyncAPI.extensions().get('x-remoteServers').value() + const remoteServers = parsedAsyncAPI.extensions().get('x-remoteServers')?.value() if (['mqtt', 'mqtts', 'secure-mqtt'].includes(protocol)) { app.addAdapter(MqttAdapter, { serverName,