| 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.", |
| }), |
| ), |
| ) |
|
|