@crossdelta/cloudevents 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ bun add @crossdelta/cloudevents zod@4
|
|
|
33
33
|
> - **Development**: Use [NATS CLI](https://docs.nats.io/running-a-nats-service/nats_admin/jetstream_admin/streams) or [Platform SDK](https://www.npmjs.com/package/@crossdelta/platform-sdk) (`pf dev` auto-creates from contracts)
|
|
34
34
|
> - **Production**: Use infrastructure-as-code (Pulumi, Terraform) or the [Stream Setup](#stream-setup) function below
|
|
35
35
|
|
|
36
|
-
**1. Create an event handler** (`src/events/
|
|
36
|
+
**1. Create an event handler** (`src/events/order-created.handler.ts`):
|
|
37
37
|
|
|
38
38
|
```typescript
|
|
39
39
|
import { handleEvent } from '@crossdelta/cloudevents'
|
|
@@ -422,7 +422,7 @@ export const LegacyContract = createContract({
|
|
|
422
422
|
When multiple services consume the same event, use `createContract` to create shared event contracts:
|
|
423
423
|
|
|
424
424
|
```typescript
|
|
425
|
-
// packages/contracts/src/events/orders
|
|
425
|
+
// packages/contracts/src/events/orders/created.ts
|
|
426
426
|
import { createContract } from '@crossdelta/cloudevents'
|
|
427
427
|
import { z } from 'zod'
|
|
428
428
|
|