mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-17 12:42:17 +00:00
chore: generate
This commit is contained in:
parent
ebe6087e8f
commit
a9ccb0804f
3 changed files with 20 additions and 11 deletions
|
|
@ -36,9 +36,7 @@ export const errorLayer = HttpRouter.middleware<{ handles: unknown }>()((effect)
|
|||
}),
|
||||
Effect.map(normalizeEmptyBadRequest),
|
||||
Effect.catchCause((cause) => {
|
||||
const schemaError = cause.reasons
|
||||
.filter(Cause.isDieReason)
|
||||
.find((reason) => HttpApiSchemaError.is(reason.defect))
|
||||
const schemaError = cause.reasons.filter(Cause.isDieReason).find((reason) => HttpApiSchemaError.is(reason.defect))
|
||||
if (schemaError) return Effect.succeed(badRequestResponse())
|
||||
|
||||
const defect = cause.reasons.filter(Cause.isDieReason).find((reason) => {
|
||||
|
|
@ -63,7 +61,7 @@ export const errorLayer = HttpRouter.middleware<{ handles: unknown }>()((effect)
|
|||
return 500
|
||||
}),
|
||||
}),
|
||||
)
|
||||
)
|
||||
}
|
||||
if (error instanceof Session.BusyError) {
|
||||
return Effect.succeed(
|
||||
|
|
|
|||
|
|
@ -137,8 +137,14 @@ describe("instance HttpApi", () => {
|
|||
)
|
||||
const [permission, questionReply, questionReject] = yield* Effect.all(
|
||||
[
|
||||
request("/permission/invalid-permission-id/reply", { method: "POST", body: JSON.stringify({ reply: "once" }) }),
|
||||
request("/question/invalid-question-id/reply", { method: "POST", body: JSON.stringify({ answers: [["Yes"]] }) }),
|
||||
request("/permission/invalid-permission-id/reply", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ reply: "once" }),
|
||||
}),
|
||||
request("/question/invalid-question-id/reply", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ answers: [["Yes"]] }),
|
||||
}),
|
||||
request("/question/invalid-question-id/reject", { method: "POST" }),
|
||||
],
|
||||
{ concurrency: "unbounded" },
|
||||
|
|
|
|||
|
|
@ -9057,7 +9057,8 @@
|
|||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"pattern": "^per"
|
||||
},
|
||||
"sessionID": {
|
||||
"type": "string"
|
||||
|
|
@ -9355,7 +9356,8 @@
|
|||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"pattern": "^que"
|
||||
},
|
||||
"sessionID": {
|
||||
"type": "string"
|
||||
|
|
@ -9387,7 +9389,8 @@
|
|||
"type": "string"
|
||||
},
|
||||
"requestID": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"pattern": "^que"
|
||||
},
|
||||
"answers": {
|
||||
"type": "array",
|
||||
|
|
@ -9406,7 +9409,8 @@
|
|||
"type": "string"
|
||||
},
|
||||
"requestID": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"pattern": "^que"
|
||||
}
|
||||
},
|
||||
"required": ["sessionID", "requestID"],
|
||||
|
|
@ -15815,7 +15819,8 @@
|
|||
"type": "string"
|
||||
},
|
||||
"requestID": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"pattern": "^per"
|
||||
},
|
||||
"reply": {
|
||||
"type": "string",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue