diff --git a/.changeset/stale-roses-serve.md b/.changeset/stale-roses-serve.md new file mode 100644 index 0000000000..dc1ab50f88 --- /dev/null +++ b/.changeset/stale-roses-serve.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-events-node': patch +--- + +The `EventParams` payload must now be a `JsonValue`, and the `metadata` type has been tweaked. diff --git a/plugins/events-node/package.json b/plugins/events-node/package.json index 6795c13441..9f822c7a94 100644 --- a/plugins/events-node/package.json +++ b/plugins/events-node/package.json @@ -51,7 +51,8 @@ "test": "backstage-cli package test" }, "dependencies": { - "@backstage/backend-plugin-api": "workspace:^" + "@backstage/backend-plugin-api": "workspace:^", + "@backstage/types": "workspace:^" }, "devDependencies": { "@backstage/backend-common": "^0.25.0", diff --git a/plugins/events-node/src/api/EventParams.ts b/plugins/events-node/src/api/EventParams.ts index 19a562aee0..9cd88b160f 100644 --- a/plugins/events-node/src/api/EventParams.ts +++ b/plugins/events-node/src/api/EventParams.ts @@ -14,10 +14,12 @@ * limitations under the License. */ +import { JsonValue } from '@backstage/types'; + /** * @public */ -export interface EventParams { +export interface EventParams { /** * Topic for which this event should be published. */ @@ -29,5 +31,5 @@ export interface EventParams { /** * Metadata (e.g., HTTP headers and similar for events received from external). */ - metadata?: Record; + metadata?: { [name in string]?: string | string[] }; } diff --git a/yarn.lock b/yarn.lock index 8f93a53290..f6a430f9af 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6166,6 +6166,7 @@ __metadata: "@backstage/backend-plugin-api": "workspace:^" "@backstage/backend-test-utils": "workspace:^" "@backstage/cli": "workspace:^" + "@backstage/types": "workspace:^" languageName: unknown linkType: soft