mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-11 12:18:28 +00:00
25 lines
1.1 KiB
TypeScript
25 lines
1.1 KiB
TypeScript
// Generated by @opencode-ai/httpapi-codegen. Do not edit.
|
|
import { Effect, Schema } from "effect"
|
|
import { Sse } from "effect/unstable/encoding"
|
|
import { HttpClientError } from "effect/unstable/http"
|
|
import { HttpApiClient, HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi"
|
|
import { ClientError } from "./client-error"
|
|
|
|
const Endpoint0Success = Schema.String
|
|
|
|
export const Group2 = HttpApiGroup.make("system", { topLevel: true }).add(
|
|
HttpApiEndpoint.make("GET")("status", "/status", { success: Endpoint0Success }),
|
|
)
|
|
|
|
type RawGroup = HttpApiClient.Client<typeof Group2>
|
|
|
|
const Endpoint0DeclaredError = Schema.Never
|
|
const mapEndpoint0Error = (error: unknown) =>
|
|
HttpClientError.isHttpClientError(error) || Schema.isSchemaError(error) || Sse.Retry.is(error)
|
|
? new ClientError({ cause: error })
|
|
: Schema.is(Endpoint0DeclaredError)(error)
|
|
? error
|
|
: new ClientError({ cause: error })
|
|
const Endpoint0 = (raw: RawGroup) => () => raw["status"]({}).pipe(Effect.mapError(mapEndpoint0Error))
|
|
|
|
export const adaptGroup2 = (raw: RawGroup) => ({ status: Endpoint0(raw) })
|