mirror of
https://github.com/langgenius/dify.git
synced 2026-07-14 17:07:03 +08:00
24 lines
585 B
TypeScript
24 lines
585 B
TypeScript
import { createApiContext, expectApiResponseOK } from './api'
|
|
|
|
export async function deleteBuiltinToolCredential(
|
|
provider: string,
|
|
credentialId: string,
|
|
): Promise<void> {
|
|
const ctx = await createApiContext()
|
|
try {
|
|
const response = await ctx.post(
|
|
`/console/api/workspaces/current/tool-provider/builtin/${provider}/delete`,
|
|
{
|
|
data: { credential_id: credentialId },
|
|
},
|
|
)
|
|
await expectApiResponseOK(
|
|
response,
|
|
`Delete built-in tool credential ${credentialId} for ${provider}`,
|
|
)
|
|
}
|
|
finally {
|
|
await ctx.dispose()
|
|
}
|
|
}
|