Skip to content

Conversation

@dgoerdes
Copy link
Contributor

@dgoerdes dgoerdes commented Jun 4, 2025

No description provided.

Copilot AI review requested due to automatic review settings June 4, 2025 07:57

This comment was marked as outdated.

@dgoerdes dgoerdes requested a review from Copilot June 4, 2025 08:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for the CloudEvents specification across the Nimbus core package and example apps by introducing validation schemas, updating exports, and aligning handlers and workflows with the new envelope shape.

  • Introduce Zod schemas (mediaType, absoluteUri, CloudEvent) to validate CloudEvent fields.
  • Update core exports and example handlers/routers to consume and emit CloudEvents envelopes.
  • Bump Deno versions, add ulid for event IDs, and refresh example imports and README examples.

Reviewed Changes

Copilot reviewed 41 out of 41 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/core/src/lib/cloudEvent/mediaType.ts Add mediaType Zod schema for MIME type validation
packages/core/src/lib/cloudEvent/absoluteUri.ts Add absoluteUri Zod schema for URI validation
packages/core/src/lib/cloudEvent/cloudEvent.ts Implement generic CloudEvent Zod schema and type alias
packages/core/src/index.ts Export new CloudEvent APIs
packages/core/README.md Add quickstart examples using CloudEvent envelopes
examples/the-expense/src/account/shell/queries/listAccounts.handler.ts Read pagination/filter from data.payload and data.authContext
examples/the-expense/src/account/shell/queries/getAccount.handler.ts Read query ID and authContext from data.payload
examples/the-expense/src/account/shell/events/accountAdded.handler.ts Access event.data.payload and return payload
examples/the-expense/src/account/shell/commands/deleteAccount.handler.ts Use command.data.payload and command.data.authContext
examples/the-expense/src/account/shell/commands/addAccount.handler.ts Generate CloudEvent envelope with ulid, specversion, and data.payload
examples/the-expense/src/account/shell/account.router.ts Rename routes to use CloudEvent type strings
examples/the-expense/src/account/shell/account.eventBus.ts Update subscription key to CloudEvent type
examples/the-expense/src/account/core/queries/listAccounts.ts Change query literal and pass AuthContext directly
examples/the-expense/src/account/core/queries/getAccount.ts Change query literal and pass AuthContext directly
examples/the-expense/src/account/core/events/accountAdded.ts Change event literal and remove metadata wrapper
examples/the-expense/src/account/core/commands/deleteAccount.ts Change command literal and pass AuthContext directly
examples/the-expense/src/account/core/commands/addAccount.ts Change command literal and pass AuthContext directly
examples/the-expense/deno.json Add @std/ulid import for ID generation
.github/workflows/publish.yaml Bump Deno version to v2.3.x
.github/workflows/checks.yaml Bump Deno version to v2.3.x
Comments suppressed due to low confidence (3)

packages/core/src/lib/cloudEvent/mediaType.ts:16

  • Add unit tests for the mediaType schema to cover a variety of valid and invalid MIME types, including edge cases like single-character tokens and quoted parameters.
export const mediaType = z.string().refine((value) => {

packages/core/src/lib/cloudEvent/absoluteUri.ts:7

  • Introduce unit tests for the absoluteUri schema using valid and invalid URIs (e.g., missing scheme, invalid characters) to ensure full RFC-compliance coverage.
export const absoluteUri = z.string().refine((value) => {

packages/core/src/lib/cloudEvent/cloudEvent.ts:53

  • [nitpick] The CloudEvent type alias name conflicts with the CloudEvent factory function. Consider renaming the type alias (e.g., CloudEventType) to avoid shadowing and improve clarity.
export type CloudEvent<TType, TData> = z.infer<

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 4, 2025

Quality Gate Passed Quality Gate passed

Issues
2 New issues
1 Accepted issue

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@dgoerdes dgoerdes merged commit 62f7191 into main Jun 4, 2025
2 checks passed
@dgoerdes dgoerdes deleted the feature/cloudevents branch June 4, 2025 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants