refactor(schema): tighten public contracts (#33771)
This commit is contained in:
parent
5682371d0a
commit
9e9d405d7e
49 changed files with 759 additions and 897 deletions
|
|
@ -1195,7 +1195,7 @@ const scenarios: Scenario[] = [
|
|||
.seeded((ctx) =>
|
||||
Effect.gen(function* () {
|
||||
const session = yield* ctx.session({ title: "Todo session" })
|
||||
const todos = [{ content: "cover session todo", status: "pending", priority: "high" }]
|
||||
const todos = [{ content: "cover session todo", status: "pending" as const, priority: "high" as const }]
|
||||
yield* ctx.todos(session.id, todos)
|
||||
return { session, todos }
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -119,5 +119,9 @@ export type Result =
|
|||
| { status: "skip"; scenario: TodoScenario }
|
||||
|
||||
export type SessionInfo = { id: SessionID; title: string; parentID?: SessionID }
|
||||
export type TodoInfo = { content: string; status: string; priority: string }
|
||||
export type TodoInfo = {
|
||||
content: string
|
||||
status: "pending" | "in_progress" | "completed" | "cancelled"
|
||||
priority: "high" | "medium" | "low"
|
||||
}
|
||||
export type MessageSeed = { info: SessionV1.User; part: SessionV1.TextPart }
|
||||
|
|
|
|||
|
|
@ -44,26 +44,18 @@ describe("reference HttpApi", () => {
|
|||
{
|
||||
name: "docs",
|
||||
path: path.join(tmp.path, "docs"),
|
||||
description: null,
|
||||
hidden: null,
|
||||
source: {
|
||||
type: "local",
|
||||
path: path.join(tmp.path, "docs"),
|
||||
description: null,
|
||||
hidden: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "effect",
|
||||
path: path.join(Global.Path.repos, "github.com", "Effect-TS", "effect"),
|
||||
description: null,
|
||||
hidden: null,
|
||||
source: {
|
||||
type: "git",
|
||||
repository: "Effect-TS/effect",
|
||||
branch: "main",
|
||||
description: null,
|
||||
hidden: null,
|
||||
},
|
||||
},
|
||||
])
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ describe("Todo.Info", () => {
|
|||
const decode = decodeUnknown(Todo.Info)
|
||||
|
||||
test("three-field round-trip", () => {
|
||||
const input = { content: "do a thing", status: "pending", priority: "high" }
|
||||
const input = Todo.Info.make({ content: "do a thing", status: "pending", priority: "high" })
|
||||
expect(decode(input)).toEqual(input)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue