Skip to content

Commit

Permalink
* add getMessageType function (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dosexe authored Jun 19, 2024
1 parent b994795 commit 3745669
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions packages/schemas/lib/messages/baseMessageSchemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,9 @@ export function enrichMessageSchemaWithBase<
publisherSchema: publisherSchema,
}
}

export function getMessageType<T extends ZodObject<Y>, Y extends ZodRawShape, Z extends string>(
richMessageSchema: ReturnType<T, Y, Z>,
): Z {
return richMessageSchema.consumerSchema.shape.type.value
}
2 changes: 1 addition & 1 deletion packages/sns/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@aws-sdk/client-sns": "^3.569.0",
"@aws-sdk/client-sqs": "^3.569.0",
"@message-queue-toolkit/core": "*",
"@message-queue-toolkit/s3-payload-store": "^0.1.0",
"@message-queue-toolkit/s3-payload-store": "^1.0.0",
"@message-queue-toolkit/sqs": "*",
"@types/node": "^20.12.8",
"@typescript-eslint/eslint-plugin": "^7.7.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/sqs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@aws-sdk/client-s3": "^3.598.0",
"@aws-sdk/client-sqs": "^3.569.0",
"@message-queue-toolkit/core": "*",
"@message-queue-toolkit/s3-payload-store": "^0.1.0",
"@message-queue-toolkit/s3-payload-store": "^1.0.0",
"@types/node": "^20.12.8",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
Expand Down

0 comments on commit 3745669

Please sign in to comment.