( declaration: HttpApiSchema.StreamSse<Sse.EventCodec, Schema.Constraint, unknown>, parseOptions: SchemaAST.ParseOptions | undefined )
| 1479 | ) |
| 1480 | |
| 1481 | function makeSseDecoder( |
| 1482 | declaration: HttpApiSchema.StreamSse<Sse.EventCodec, Schema.Constraint, unknown>, |
| 1483 | parseOptions: SchemaAST.ParseOptions | undefined |
| 1484 | ) { |
| 1485 | const Event = Schema.Union([ |
| 1486 | Schema.Struct({ |
| 1487 | id: Schema.optional(Schema.String), |
| 1488 | event: Schema.Literal(reservedStreamFailureEvent), |
| 1489 | data: Schema.fromJsonString(Schema.toCodecJson(Schema.Cause(declaration.error, Schema.Defect()))) |
| 1490 | }), |
| 1491 | declaration.events |
| 1492 | ]) |
| 1493 | const defaultDecoder = Sse.decodeSchema(Event, undefined, parseOptions) |
| 1494 | return (options?: Sse.DecodeOptions) => |
| 1495 | options === undefined ? defaultDecoder : Sse.decodeSchema(Event, options, parseOptions) |
| 1496 | } |
| 1497 | |
| 1498 | function decodeSseStream( |
| 1499 | stream: Stream.Stream<Uint8Array, HttpClientError.HttpClientError>, |
no test coverage detected