diff --git a/__tests__/fixtures/services.ts b/__tests__/fixtures/services.ts index a2f346da..5584be68 100644 --- a/__tests__/fixtures/services.ts +++ b/__tests__/fixtures/services.ts @@ -136,12 +136,10 @@ export const FallibleServiceConstructor = () => throwError: Type.Boolean(), }), output: Type.Object({ response: Type.String() }), - errors: Type.Union([ - Type.Object({ - code: Type.Literal(STREAM_ERROR), - message: Type.String(), - }), - ]), + errors: Type.Object({ + code: Type.Literal(STREAM_ERROR), + message: Type.String(), + }), async handler(_ctx, msgStream, returnStream) { for await (const { msg, throwError, throwResult } of msgStream) { if (throwError) { diff --git a/package-lock.json b/package-lock.json index 8770b491..6903d98e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@replit/river", - "version": "0.10.2", + "version": "0.10.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@replit/river", - "version": "0.10.2", + "version": "0.10.3", "license": "MIT", "dependencies": { "@msgpack/msgpack": "^3.0.0-beta2", diff --git a/package.json b/package.json index e3178853..aeed1507 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@replit/river", "description": "It's like tRPC but... with JSON Schema Support, duplex streaming and support for service multiplexing. Transport agnostic!", - "version": "0.10.2", + "version": "0.10.3", "type": "module", "exports": { ".": { diff --git a/router/result.ts b/router/result.ts index e20f094b..1d9e2fe1 100644 --- a/router/result.ts +++ b/router/result.ts @@ -10,11 +10,11 @@ import { export type RiverErrorSchema = | TObject<{ - code: TLiteralString; + code: TLiteralString | TUnion; message: TLiteralString | TString; }> | TObject<{ - code: TLiteralString; + code: TLiteralString | TUnion; message: TLiteralString | TString; extras: TSchema; }>;