refactor(core): move v1 schemas into core (#30473)
This commit is contained in:
parent
0543fd29c8
commit
83452558f7
129 changed files with 1578 additions and 1227 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { PermissionLegacy } from "@opencode-ai/core/permission/legacy"
|
||||
import { PermissionV1 } from "@opencode-ai/core/v1/permission"
|
||||
import { afterEach, describe, expect } from "bun:test"
|
||||
import { NodeHttpServer, NodeServices } from "@effect/platform-node"
|
||||
import { SessionLegacy } from "@opencode-ai/core/session/legacy"
|
||||
import { SessionV1 } from "@opencode-ai/core/v1/session"
|
||||
import { mkdir } from "node:fs/promises"
|
||||
import path from "node:path"
|
||||
import { Cause, Config, Effect, Exit, Layer } from "effect"
|
||||
|
|
@ -362,7 +362,7 @@ describe("session HttpApi", () => {
|
|||
const messages = yield* request(`${pathFor(SessionPaths.messages, { sessionID: parent.id })}?limit=1`, {
|
||||
headers,
|
||||
})
|
||||
const messagePage = yield* json<SessionLegacy.WithParts[]>(messages)
|
||||
const messagePage = yield* json<SessionV1.WithParts[]>(messages)
|
||||
const nextCursor = messages.headers["x-next-cursor"]
|
||||
expect(nextCursor).toBeTruthy()
|
||||
expect(messagePage[0]?.parts[0]).toMatchObject({ type: "text" })
|
||||
|
|
@ -379,7 +379,7 @@ describe("session HttpApi", () => {
|
|||
).toBe(400)
|
||||
|
||||
expect(
|
||||
yield* requestJson<SessionLegacy.WithParts>(
|
||||
yield* requestJson<SessionV1.WithParts>(
|
||||
pathFor(SessionPaths.message, { sessionID: parent.id, messageID: message.info.id }),
|
||||
{ headers },
|
||||
),
|
||||
|
|
@ -829,7 +829,7 @@ describe("session HttpApi", () => {
|
|||
const first = yield* createTextMessage(session.id, "first")
|
||||
const second = yield* createTextMessage(session.id, "second")
|
||||
|
||||
const updated = yield* requestJson<SessionLegacy.Part>(
|
||||
const updated = yield* requestJson<SessionV1.Part>(
|
||||
pathFor(SessionPaths.updatePart, {
|
||||
sessionID: session.id,
|
||||
messageID: first.info.id,
|
||||
|
|
@ -913,7 +913,7 @@ describe("session HttpApi", () => {
|
|||
}),
|
||||
).toMatchObject({ id: session.id })
|
||||
|
||||
const permissionID = String(PermissionLegacy.ID.ascending())
|
||||
const permissionID = String(PermissionV1.ID.ascending())
|
||||
const permission = yield* request(
|
||||
pathFor(SessionPaths.permissions, {
|
||||
sessionID: session.id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue