events-node: update EventParams type

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-05-22 14:25:31 +02:00
parent 6b148372c1
commit a90ce4aa39
4 changed files with 12 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-events-node': patch
---
The `EventParams` payload must now be a `JsonValue`, and the `metadata` type has been tweaked.
+2 -1
View File
@@ -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",
+4 -2
View File
@@ -14,10 +14,12 @@
* limitations under the License.
*/
import { JsonValue } from '@backstage/types';
/**
* @public
*/
export interface EventParams<TPayload = unknown> {
export interface EventParams<TPayload extends JsonValue = JsonValue> {
/**
* Topic for which this event should be published.
*/
@@ -29,5 +31,5 @@ export interface EventParams<TPayload = unknown> {
/**
* Metadata (e.g., HTTP headers and similar for events received from external).
*/
metadata?: Record<string, string | string[] | undefined>;
metadata?: { [name in string]?: string | string[] };
}
+1
View File
@@ -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