Skip to content

Commit

Permalink
fix(parser): event type literal for selfManagedKafka (#3325)
Browse files Browse the repository at this point in the history
  • Loading branch information
am29d authored Nov 18, 2024
1 parent de1ee89 commit 5350afe
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions packages/parser/src/schemas/kafka.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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":[
Expand Down Expand Up @@ -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'),
});

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/parser/tests/events/kafkaEventSelfManaged.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down

0 comments on commit 5350afe

Please sign in to comment.