feat(sdk): expose live event stream (#34098)
This commit is contained in:
parent
2c02f8bace
commit
42e6b7db32
19 changed files with 395 additions and 56 deletions
|
|
@ -48,6 +48,24 @@ describe("HttpApiCodegen.generate", () => {
|
|||
)
|
||||
})
|
||||
|
||||
test("allows Promise outputs to use an authoritative imported wire type", () => {
|
||||
const contract = compileContract(
|
||||
api(HttpApiEndpoint.get("events", "/event", { success: HttpApiSchema.StreamSse({ data: Schema.Unknown }) })),
|
||||
)
|
||||
const output = emitPromise(contract, {
|
||||
outputTypes: {
|
||||
"session.events": {
|
||||
name: "EventWire",
|
||||
import: 'import type { EventWire } from "./event-wire"',
|
||||
},
|
||||
},
|
||||
})
|
||||
const types = output.files.find((file) => file.path === "types.ts")?.content
|
||||
|
||||
expect(types).toContain('import type { EventWire } from "./event-wire"')
|
||||
expect(types).toContain("export type SessionEventsOutput = EventWire")
|
||||
})
|
||||
|
||||
test("emits an Effect client against an imported authoritative API", () => {
|
||||
const output = emitEffectImported(
|
||||
compileContract(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue