refactor(tui): migrate v2 calls to new client
This commit is contained in:
parent
9ff7ef3fb0
commit
e2eed76101
17 changed files with 2834 additions and 3590 deletions
|
|
@ -513,6 +513,24 @@ describe("HttpApiCodegen.generate", () => {
|
|||
)
|
||||
})
|
||||
|
||||
test("emits mutable Promise outputs without restricting inputs", () => {
|
||||
const output = emitPromise(
|
||||
compileContract(
|
||||
api(
|
||||
HttpApiEndpoint.post("create", "/session", {
|
||||
payload: Schema.Struct({ values: Schema.Array(Schema.String) }),
|
||||
success: Schema.Struct({ data: Schema.Array(Schema.Struct({ values: Schema.Array(Schema.String) })) }),
|
||||
}),
|
||||
),
|
||||
),
|
||||
{ mutableOutputs: true },
|
||||
)
|
||||
const types = output.files.find((file) => file.path === "types.ts")?.content
|
||||
|
||||
expect(types).toContain('readonly "values": ReadonlyArray<string>')
|
||||
expect(types).toContain('export type SessionCreateOutput = ({ "data": Array<{ "values": Array<string> }> })["data"]')
|
||||
})
|
||||
|
||||
test("expands Promise references only at identifier boundaries", () => {
|
||||
const Session = Schema.Struct({ name: Schema.Literal("Session"), id: Schema.String }).annotate({
|
||||
identifier: "Session",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue