events-node: restore behavior of top-level DefaltEventsService methods

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-05-27 15:07:34 +02:00
parent 1e8e3f9283
commit 2c9ea899c7
2 changed files with 9 additions and 11 deletions
+4 -4
View File
@@ -23,10 +23,10 @@ export class DefaultEventsService implements EventsService {
lifecycle: LifecycleService;
},
): EventsService;
// @deprecated (undocumented)
publish(_params: EventParams): Promise<void>;
// @deprecated (undocumented)
subscribe(_options: EventsServiceSubscribeOptions): Promise<void>;
// (undocumented)
publish(params: EventParams): Promise<void>;
// (undocumented)
subscribe(options: EventsServiceSubscribeOptions): Promise<void>;
}
// @public @deprecated
@@ -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<void> {
throw new NotImplementedError();
async publish(params: EventParams): Promise<void> {
await this.localBus.publish(params);
}
/** @deprecated this method should not be called */
async subscribe(_options: EventsServiceSubscribeOptions): Promise<void> {
throw new NotImplementedError();
async subscribe(options: EventsServiceSubscribeOptions): Promise<void> {
this.localBus.subscribe(options);
}
}