@crossdelta/cloudevents 0.1.10 → 0.1.12

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 CHANGED
@@ -40,6 +40,18 @@ Event-driven microservices are hard: messages get lost when services restart, ha
40
40
  bun add @crossdelta/cloudevents
41
41
  ```
42
42
 
43
+ ## Configuration
44
+
45
+ ### NATS Connection
46
+
47
+ All NATS functions use this fallback chain for the server URL:
48
+
49
+ 1. **`servers` option** (explicit) → `{ servers: 'nats://my-server:4222' }`
50
+ 2. **`NATS_URL` env var** → `export NATS_URL=nats://my-server:4222`
51
+ 3. **Default** → `nats://localhost:4222`
52
+
53
+ For most deployments, just set the `NATS_URL` environment variable — no code changes needed.
54
+
43
55
  ## Getting Started
44
56
 
45
57
  A minimal example: `orders-service` publishes an event, `notifications-service` consumes it.
@@ -17,8 +17,4 @@ export declare function eventSchema<T extends Record<string, ZodTypeAny>>(schema
17
17
  type: ZodTypeAny;
18
18
  }): z.ZodObject<T & {
19
19
  type: ZodTypeAny;
20
- }, "strip", ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T & {
21
- type: ZodTypeAny;
22
- }>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<T & {
23
- type: ZodTypeAny;
24
- }> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
20
+ } extends infer T_1 ? { -readonly [P in keyof T_1]: T_1[P]; } : never, z.core.$strip>;
@@ -10,7 +10,7 @@ export declare const createValidationDetails: (error: {
10
10
  issues: Array<{
11
11
  code: string;
12
12
  message: string;
13
- path: Array<string | number>;
13
+ path: PropertyKey[];
14
14
  expected?: unknown;
15
15
  received?: unknown;
16
16
  }>;
@@ -5,7 +5,7 @@ import { createValidationError } from '../infrastructure';
5
5
  export const createValidationDetails = (error) => error.issues.map((issue) => ({
6
6
  code: issue.code,
7
7
  message: issue.message,
8
- path: issue.path,
8
+ path: issue.path.filter((p) => typeof p !== 'symbol'),
9
9
  expected: String(issue.expected),
10
10
  received: String(issue.received),
11
11
  }));
@@ -29,7 +29,7 @@ export async function publishNatsEvent(subjectName, schema, eventData, options)
29
29
  const validationDetails = validationResult.error.issues.map((issue) => ({
30
30
  code: issue.code,
31
31
  message: issue.message,
32
- path: issue.path,
32
+ path: issue.path.filter((p) => typeof p !== 'symbol'),
33
33
  expected: 'expected' in issue ? String(issue.expected) : undefined,
34
34
  received: 'received' in issue ? String(issue.received) : undefined,
35
35
  }));
@@ -31,7 +31,7 @@ export async function publishEvent(topicName, schema, eventData, options) {
31
31
  const validationDetails = validationResult.error.issues.map((issue) => ({
32
32
  code: issue.code,
33
33
  message: issue.message,
34
- path: issue.path,
34
+ path: issue.path.filter((p) => typeof p !== 'symbol'),
35
35
  expected: 'expected' in issue ? String(issue.expected) : undefined,
36
36
  received: 'received' in issue ? String(issue.received) : undefined,
37
37
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossdelta/cloudevents",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "CloudEvents toolkit for TypeScript - handler discovery, DLQ-safe processing, NATS streaming",
5
5
  "author": "crossdelta",
6
6
  "license": "MIT",
@@ -54,7 +54,7 @@
54
54
  },
55
55
  "peerDependencies": {
56
56
  "hono": "^4.6.0",
57
- "zod": "^3.23.0"
57
+ "zod": "^3.23.0 || ^4.0.0"
58
58
  },
59
59
  "trustedDependencies": [],
60
60
  "devDependencies": {