@veloxts/events 0.6.101 → 0.6.103

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/dist/schemas.d.ts CHANGED
@@ -10,13 +10,7 @@ import { z } from 'zod';
10
10
  export declare const PresenceMemberSchema: z.ZodObject<{
11
11
  id: z.ZodString;
12
12
  info: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
13
- }, "strip", z.ZodTypeAny, {
14
- id: string;
15
- info?: Record<string, unknown> | undefined;
16
- }, {
17
- id: string;
18
- info?: Record<string, unknown> | undefined;
19
- }>;
13
+ }, z.core.$strip>;
20
14
  /**
21
15
  * Schema for SSE subscribe endpoint.
22
16
  * POST /events/subscribe
@@ -27,28 +21,8 @@ export declare const SseSubscribeBodySchema: z.ZodObject<{
27
21
  member: z.ZodOptional<z.ZodObject<{
28
22
  id: z.ZodString;
29
23
  info: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
30
- }, "strip", z.ZodTypeAny, {
31
- id: string;
32
- info?: Record<string, unknown> | undefined;
33
- }, {
34
- id: string;
35
- info?: Record<string, unknown> | undefined;
36
- }>>;
37
- }, "strip", z.ZodTypeAny, {
38
- connectionId: string;
39
- channel: string;
40
- member?: {
41
- id: string;
42
- info?: Record<string, unknown> | undefined;
43
- } | undefined;
44
- }, {
45
- connectionId: string;
46
- channel: string;
47
- member?: {
48
- id: string;
49
- info?: Record<string, unknown> | undefined;
50
- } | undefined;
51
- }>;
24
+ }, z.core.$strip>>;
25
+ }, z.core.$strip>;
52
26
  export type SseSubscribeBody = z.infer<typeof SseSubscribeBodySchema>;
53
27
  /**
54
28
  * Schema for SSE unsubscribe endpoint.
@@ -57,13 +31,7 @@ export type SseSubscribeBody = z.infer<typeof SseSubscribeBodySchema>;
57
31
  export declare const SseUnsubscribeBodySchema: z.ZodObject<{
58
32
  connectionId: z.ZodString;
59
33
  channel: z.ZodString;
60
- }, "strip", z.ZodTypeAny, {
61
- connectionId: string;
62
- channel: string;
63
- }, {
64
- connectionId: string;
65
- channel: string;
66
- }>;
34
+ }, z.core.$strip>;
67
35
  export type SseUnsubscribeBody = z.infer<typeof SseUnsubscribeBodySchema>;
68
36
  /**
69
37
  * Schema for WebSocket auth endpoint.
@@ -72,19 +40,13 @@ export type SseUnsubscribeBody = z.infer<typeof SseUnsubscribeBodySchema>;
72
40
  export declare const WsAuthBodySchema: z.ZodObject<{
73
41
  socketId: z.ZodString;
74
42
  channel: z.ZodString;
75
- }, "strip", z.ZodTypeAny, {
76
- channel: string;
77
- socketId: string;
78
- }, {
79
- channel: string;
80
- socketId: string;
81
- }>;
43
+ }, z.core.$strip>;
82
44
  export type WsAuthBody = z.infer<typeof WsAuthBodySchema>;
83
45
  /**
84
46
  * Schema for WebSocket client messages.
85
47
  * Uses discriminated union for type-safe message handling.
86
48
  */
87
- export declare const ClientMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
49
+ export declare const ClientMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
88
50
  type: z.ZodLiteral<"subscribe">;
89
51
  channel: z.ZodString;
90
52
  auth: z.ZodOptional<z.ZodString>;
@@ -92,62 +54,18 @@ export declare const ClientMessageSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
92
54
  data: z.ZodOptional<z.ZodObject<{
93
55
  id: z.ZodString;
94
56
  info: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
95
- }, "strip", z.ZodTypeAny, {
96
- id: string;
97
- info?: Record<string, unknown> | undefined;
98
- }, {
99
- id: string;
100
- info?: Record<string, unknown> | undefined;
101
- }>>;
102
- }, "strip", z.ZodTypeAny, {
103
- type: "subscribe";
104
- channel: string;
105
- auth?: string | undefined;
106
- channelData?: string | undefined;
107
- data?: {
108
- id: string;
109
- info?: Record<string, unknown> | undefined;
110
- } | undefined;
111
- }, {
112
- type: "subscribe";
113
- channel: string;
114
- auth?: string | undefined;
115
- channelData?: string | undefined;
116
- data?: {
117
- id: string;
118
- info?: Record<string, unknown> | undefined;
119
- } | undefined;
120
- }>, z.ZodObject<{
57
+ }, z.core.$strip>>;
58
+ }, z.core.$strip>, z.ZodObject<{
121
59
  type: z.ZodLiteral<"unsubscribe">;
122
60
  channel: z.ZodString;
123
- }, "strip", z.ZodTypeAny, {
124
- type: "unsubscribe";
125
- channel: string;
126
- }, {
127
- type: "unsubscribe";
128
- channel: string;
129
- }>, z.ZodObject<{
61
+ }, z.core.$strip>, z.ZodObject<{
130
62
  type: z.ZodLiteral<"ping">;
131
- }, "strip", z.ZodTypeAny, {
132
- type: "ping";
133
- }, {
134
- type: "ping";
135
- }>, z.ZodObject<{
63
+ }, z.core.$strip>, z.ZodObject<{
136
64
  type: z.ZodLiteral<"message">;
137
65
  channel: z.ZodString;
138
66
  event: z.ZodString;
139
67
  data: z.ZodOptional<z.ZodUnknown>;
140
- }, "strip", z.ZodTypeAny, {
141
- type: "message";
142
- channel: string;
143
- event: string;
144
- data?: unknown;
145
- }, {
146
- type: "message";
147
- channel: string;
148
- event: string;
149
- data?: unknown;
150
- }>]>;
68
+ }, z.core.$strip>], "type">;
151
69
  export type ValidatedClientMessage = z.infer<typeof ClientMessageSchema>;
152
70
  /**
153
71
  * Validation result type - discriminated union for type-safe error handling.
@@ -165,7 +83,7 @@ export type ValidationResult<T> = {
165
83
  *
166
84
  * @template TSchema - The Zod schema type
167
85
  */
168
- export declare function validateBody<TSchema extends z.ZodTypeAny>(body: unknown, schema: TSchema): ValidationResult<z.infer<TSchema>>;
86
+ export declare function validateBody<TSchema extends z.ZodType>(body: unknown, schema: TSchema): ValidationResult<z.infer<TSchema>>;
169
87
  /**
170
88
  * Format Zod validation errors for API response.
171
89
  */
package/dist/schemas.js CHANGED
@@ -12,7 +12,7 @@ import { z } from 'zod';
12
12
  */
13
13
  export const PresenceMemberSchema = z.object({
14
14
  id: z.string().min(1, 'Member ID is required'),
15
- info: z.record(z.unknown()).optional(),
15
+ info: z.record(z.string(), z.unknown()).optional(),
16
16
  });
17
17
  // =============================================================================
18
18
  // SSE Endpoint Schemas
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veloxts/events",
3
- "version": "0.6.101",
3
+ "version": "0.6.103",
4
4
  "description": "Real-time event broadcasting for VeloxTS framework",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -29,11 +29,11 @@
29
29
  "fastify-plugin": "5.1.0",
30
30
  "superjson": "2.2.6",
31
31
  "ws": "8.19.0",
32
- "zod": "3.25.76",
33
- "@veloxts/core": "0.6.101"
32
+ "zod": "4.3.6",
33
+ "@veloxts/core": "0.6.103"
34
34
  },
35
35
  "peerDependencies": {
36
- "fastify": "^5.0.0",
36
+ "fastify": "^5.7.4",
37
37
  "ioredis": ">=5.0.0"
38
38
  },
39
39
  "peerDependenciesMeta": {
@@ -45,11 +45,11 @@
45
45
  "@types/node": "25.1.0",
46
46
  "@types/ws": "8.18.1",
47
47
  "@vitest/coverage-v8": "4.0.18",
48
- "fastify": "5.7.2",
48
+ "fastify": "5.7.4",
49
49
  "ioredis": "5.9.2",
50
50
  "typescript": "5.9.3",
51
51
  "vitest": "4.0.18",
52
- "@veloxts/testing": "0.6.101"
52
+ "@veloxts/testing": "0.6.103"
53
53
  },
54
54
  "publishConfig": {
55
55
  "access": "public"