(definitions: Definitions)
| 27 | ]).annotate({ identifier: "V2Event" }) |
| 28 | |
| 29 | const make = <const Definitions extends ReadonlyArray<Definition>>(definitions: Definitions) => { |
| 30 | const EventSchema = schema(definitions) |
| 31 | return { |
| 32 | schema: EventSchema, |
| 33 | group: HttpApiGroup.make("server.event") |
| 34 | .add( |
| 35 | HttpApiEndpoint.get("event.subscribe", "/api/event", { |
| 36 | success: HttpApiSchema.StreamSse({ data: EventSchema }), |
| 37 | }).annotateMerge( |
| 38 | OpenApi.annotations({ |
| 39 | identifier: "v2.event.subscribe", |
| 40 | summary: "Subscribe to events", |
| 41 | description: "Subscribe to native event payloads for the server.", |
| 42 | }), |
| 43 | ), |
| 44 | ) |
| 45 | .annotateMerge(OpenApi.annotations({ title: "events", description: "Experimental event stream route." })), |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | export const makeEventGroup = <const Definitions extends ReadonlyArray<Definition>>(definitions: Definitions) => |
| 50 | make(definitions).group |
no test coverage detected