From 2c9ea899c7c07857e98ba42deb40607b7f8388e9 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 27 May 2024 15:07:34 +0200 Subject: [PATCH] events-node: restore behavior of top-level DefaltEventsService methods Signed-off-by: Patrik Oldsberg --- plugins/events-node/api-report.md | 8 ++++---- plugins/events-node/src/api/DefaultEventsService.ts | 12 +++++------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/plugins/events-node/api-report.md b/plugins/events-node/api-report.md index a735007e3b..9ebaf1a536 100644 --- a/plugins/events-node/api-report.md +++ b/plugins/events-node/api-report.md @@ -23,10 +23,10 @@ export class DefaultEventsService implements EventsService { lifecycle: LifecycleService; }, ): EventsService; - // @deprecated (undocumented) - publish(_params: EventParams): Promise; - // @deprecated (undocumented) - subscribe(_options: EventsServiceSubscribeOptions): Promise; + // (undocumented) + publish(params: EventParams): Promise; + // (undocumented) + subscribe(options: EventsServiceSubscribeOptions): Promise; } // @public @deprecated diff --git a/plugins/events-node/src/api/DefaultEventsService.ts b/plugins/events-node/src/api/DefaultEventsService.ts index 5a2712fc89..9e2509539a 100644 --- a/plugins/events-node/src/api/DefaultEventsService.ts +++ b/plugins/events-node/src/api/DefaultEventsService.ts @@ -23,7 +23,7 @@ import { import { EventParams } from './EventParams'; import { EventsService, EventsServiceSubscribeOptions } from './EventsService'; import { DefaultApiClient } from '../generated'; -import { NotImplementedError, ResponseError } from '@backstage/errors'; +import { ResponseError } from '@backstage/errors'; const POLL_BACKOFF_START_MS = 1_000; const POLL_BACKOFF_MAX_MS = 60_000; @@ -386,13 +386,11 @@ export class DefaultEventsService implements EventsService { return service; } - /** @deprecated this method should not be called */ - async publish(_params: EventParams): Promise { - throw new NotImplementedError(); + async publish(params: EventParams): Promise { + await this.localBus.publish(params); } - /** @deprecated this method should not be called */ - async subscribe(_options: EventsServiceSubscribeOptions): Promise { - throw new NotImplementedError(); + async subscribe(options: EventsServiceSubscribeOptions): Promise { + this.localBus.subscribe(options); } }