Download packages/server/src/handlers/credential.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 778 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/server/src/handlers/credential.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/server/src/handlers/credential.ts
-
curl -L -o credential.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/server/src/handlers/credential.ts
778 Bytes
| import { Integration } from "@opencode-ai/core/integration" | |
| import { Effect } from "effect" | |
| import { HttpApiBuilder, HttpApiSchema } from "effect/unstable/httpapi" | |
| import { Api } from "../api" | |
| export const CredentialHandler = HttpApiBuilder.group(Api, "server.credential", (handlers) => | |
| handlers | |
| .handle( | |
| "credential.update", | |
| Effect.fn(function* (ctx) { | |
| yield* (yield* Integration.Service).connection.update(ctx.params.credentialID, { label: ctx.payload.label }) | |
| return HttpApiSchema.NoContent.make() | |
| }), | |
| ) | |
| .handle( | |
| "credential.remove", | |
| Effect.fn(function* (ctx) { | |
| yield* (yield* Integration.Service).connection.remove(ctx.params.credentialID) | |
| return HttpApiSchema.NoContent.make() | |
| }), | |
| ), | |
| ) | |