feat(server): add v2 session API endpoints (#31822)
This commit is contained in:
parent
ff967e582c
commit
8bf0675997
11 changed files with 431 additions and 7 deletions
|
|
@ -646,6 +646,7 @@ const scenarios: Scenario[] = [
|
|||
object(body)
|
||||
check(body.healthy === true, "v2 server should report healthy")
|
||||
}),
|
||||
http.protected.get("/api/location", "v2.location.get").json(200, object),
|
||||
http.protected.get("/api/agent", "v2.agent.list").json(200, locationData(array)),
|
||||
http.protected.get("/api/model", "v2.model.list").json(200, locationData(array)),
|
||||
http.protected.get("/api/provider", "v2.provider.list").json(200, locationData(array)),
|
||||
|
|
@ -698,6 +699,14 @@ const scenarios: Scenario[] = [
|
|||
headers: ctx.headers(),
|
||||
}))
|
||||
.json(200, data(array)),
|
||||
http.protected
|
||||
.get("/api/session/{sessionID}/question", "v2.session.question.list")
|
||||
.seeded((ctx) => ctx.session({ title: "Question list owner" }))
|
||||
.at((ctx) => ({
|
||||
path: route("/api/session/{sessionID}/question", { sessionID: ctx.state.id }),
|
||||
headers: ctx.headers(),
|
||||
}))
|
||||
.json(200, data(array)),
|
||||
http.protected
|
||||
.post("/api/session/{sessionID}/permission/{requestID}/reply", "v2.session.permission.reply")
|
||||
.seeded((ctx) => ctx.session({ title: "Permission owner" }))
|
||||
|
|
@ -807,6 +816,22 @@ const scenarios: Scenario[] = [
|
|||
headers: ctx.headers(),
|
||||
}))
|
||||
.status(400, undefined, "none"),
|
||||
http.protected
|
||||
.post("/api/session", "v2.session.create")
|
||||
.at((ctx) => ({
|
||||
path: "/api/session",
|
||||
headers: { ...ctx.headers(), "content-type": "application/json" },
|
||||
body: {},
|
||||
}))
|
||||
.json(200, data(object)),
|
||||
http.protected
|
||||
.get("/api/session/{sessionID}", "v2.session.get")
|
||||
.seeded((ctx) => ctx.session({ title: "Session get" }))
|
||||
.at((ctx) => ({
|
||||
path: route("/api/session/{sessionID}", { sessionID: ctx.state.id }),
|
||||
headers: ctx.headers(),
|
||||
}))
|
||||
.json(200, data(object)),
|
||||
http.protected
|
||||
.get("/api/session/{sessionID}/context", "v2.session.context")
|
||||
.at((ctx) => ({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue