File size: 1,096 Bytes
eb1202c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// 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) })