@zap-socket/server 0.0.13 → 0.0.15

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/events.d.ts CHANGED
@@ -6,7 +6,7 @@ export type Context = {
6
6
  id: string;
7
7
  buffer: MiddlwareContext;
8
8
  };
9
- export declare const zapEvent: <T extends EventInput, R, E>(eventObj: T extends z.ZodTypeAny ? {
9
+ export declare const zapEvent: <T extends EventInput, R, E = never>(eventObj: T extends z.ZodTypeAny ? {
10
10
  input: T;
11
11
  middleware?: MiddlewareType[];
12
12
  process: (input: z.infer<T>, ctx: Context) => R;
@@ -15,7 +15,7 @@ export declare const zapEvent: <T extends EventInput, R, E>(eventObj: T extends
15
15
  middleware?: MiddlewareType[];
16
16
  process: (ctx: Context) => R;
17
17
  emitType?: E;
18
- }) => ZapEvent<T, R>;
18
+ }) => ZapEvent<T, R, E extends never ? undefined : E>;
19
19
  export declare const zapStream: <T extends EventInput, R>(eventObj: T extends z.ZodTypeAny ? {
20
20
  input: T;
21
21
  middleware?: MiddlewareType[];
package/dist/events.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import { z } from "zod";
2
2
  export const zapEvent = (eventObj) => {
3
3
  if ("input" in eventObj) {
4
- // Explicitly construct the return object to match ZapEvent structure
5
4
  return {
6
5
  input: eventObj.input,
7
6
  middleware: eventObj.middleware,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zap-socket/server",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "description": "A fully typesafe tRPC-inspired WebSocket library with Zod validation, req-res model, and native subscriptions.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "vitest": "^3.0.9"
24
24
  },
25
25
  "dependencies": {
26
- "@zap-socket/types": "^0.0.6",
26
+ "@zap-socket/types": "^0.0.7",
27
27
  "zod": "^3.24.2"
28
28
  }
29
29
  }