From 5350afed92d02b7b8d47f387705f70c59deeeb65 Mon Sep 17 00:00:00 2001 From: Alexander Schueren Date: Mon, 18 Nov 2024 12:44:15 +0100 Subject: [PATCH] fix(parser): event type literal for selfManagedKafka (#3325) --- .husky/pre-push | 1 - packages/parser/src/schemas/kafka.ts | 4 ++-- packages/parser/tests/events/kafkaEventSelfManaged.json | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.husky/pre-push b/.husky/pre-push index dbfd4143b0..c1b04d1bf3 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -4,5 +4,4 @@ npm t \ npx vitest --run \ --exclude tests/unit/layer-publisher.test.ts \ --coverage --coverage.thresholds.100 \ - --changed="$(git merge-base HEAD main)" \ tests/unit diff --git a/packages/parser/src/schemas/kafka.ts b/packages/parser/src/schemas/kafka.ts index 89a9b7e56a..bab669f448 100644 --- a/packages/parser/src/schemas/kafka.ts +++ b/packages/parser/src/schemas/kafka.ts @@ -40,7 +40,7 @@ const KafkaBaseEventSchema = z.object({ * @example * ```json * { - * "eventSource":"aws:SelfManagedKafka", + * "eventSource":"SelfManagedKafka", * "bootstrapServers":"b-2.demo-cluster-1.a1bcde.c1.kafka.us-east-1.amazonaws.com:9092,b-1.demo-cluster-1.a1bcde.c1.kafka.us-east-1.amazonaws.com:9092", * "records":{ * "mytopic-0":[ @@ -79,7 +79,7 @@ const KafkaBaseEventSchema = z.object({ * @see {@link https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html} */ const KafkaSelfManagedEventSchema = KafkaBaseEventSchema.extend({ - eventSource: z.literal('aws:SelfManagedKafka'), + eventSource: z.literal('SelfManagedKafka'), }); /** diff --git a/packages/parser/tests/events/kafkaEventSelfManaged.json b/packages/parser/tests/events/kafkaEventSelfManaged.json index 4dcd8c73c5..775f58cd8c 100644 --- a/packages/parser/tests/events/kafkaEventSelfManaged.json +++ b/packages/parser/tests/events/kafkaEventSelfManaged.json @@ -1,5 +1,5 @@ { - "eventSource": "aws:SelfManagedKafka", + "eventSource": "SelfManagedKafka", "bootstrapServers": "b-2.demo-cluster-1.a1bcde.c1.kafka.us-east-1.amazonaws.com:9092,b-1.demo-cluster-1.a1bcde.c1.kafka.us-east-1.amazonaws.com:9092", "records": { "mytopic-0": [