Download packages/protocol/src/groups/credential.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 1.34 kB
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/protocol/src/groups/credential.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/protocol/src/groups/credential.ts
-
curl -L -o credential.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/protocol/src/groups/credential.ts
1.34 kB
| import { Credential } from "@opencode-ai/schema/credential" | |
| import { Schema } from "effect" | |
| import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/unstable/httpapi" | |
| import { LocationQuery, locationQueryOpenApi } from "./location" | |
| export const CredentialGroup = HttpApiGroup.make("server.credential") | |
| .add( | |
| HttpApiEndpoint.patch("credential.update", "/api/credential/:credentialID", { | |
| params: { credentialID: Credential.ID }, | |
| query: LocationQuery, | |
| payload: Schema.Struct({ label: Schema.String }), | |
| success: HttpApiSchema.NoContent, | |
| }) | |
| .annotateMerge(locationQueryOpenApi) | |
| .annotateMerge( | |
| OpenApi.annotations({ | |
| identifier: "v2.credential.update", | |
| summary: "Update credential", | |
| description: "Update a stored credential label.", | |
| }), | |
| ), | |
| ) | |
| .add( | |
| HttpApiEndpoint.delete("credential.remove", "/api/credential/:credentialID", { | |
| params: { credentialID: Credential.ID }, | |
| query: LocationQuery, | |
| success: HttpApiSchema.NoContent, | |
| }) | |
| .annotateMerge(locationQueryOpenApi) | |
| .annotateMerge( | |
| OpenApi.annotations({ | |
| identifier: "v2.credential.remove", | |
| summary: "Remove credential", | |
| description: "Remove a stored integration credential.", | |
| }), | |
| ), | |
| ) | |