mirror of
https://github.com/GlueOps/autoglue.git
synced 2026-02-13 12:50:05 +01:00
feat: add credentials management
Signed-off-by: allanice001 <allanice001@gmail.com>
This commit is contained in:
32
ui/src/api/credentials.ts
Normal file
32
ui/src/api/credentials.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { withRefresh } from "@/api/with-refresh.ts"
|
||||
import type { DtoCreateCredentialRequest, DtoUpdateCredentialRequest } from "@/sdk"
|
||||
import { makeCredentialsApi } from "@/sdkClient.ts"
|
||||
|
||||
const credentials = makeCredentialsApi()
|
||||
|
||||
export const credentialsApi = {
|
||||
listCredentials: () =>
|
||||
withRefresh(async () => {
|
||||
return await credentials.listCredentials()
|
||||
}),
|
||||
createCredential: async (body: DtoCreateCredentialRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await credentials.createCredential({ body })
|
||||
}),
|
||||
getCredential: async (id: string) =>
|
||||
withRefresh(async () => {
|
||||
return await credentials.getCredential({ id })
|
||||
}),
|
||||
deleteCredential: async (id: string) =>
|
||||
withRefresh(async () => {
|
||||
await credentials.deleteCredential({ id })
|
||||
}),
|
||||
updateCredential: async (id: string, body: DtoUpdateCredentialRequest) =>
|
||||
withRefresh(async () => {
|
||||
return await credentials.updateCredential({ id, body })
|
||||
}),
|
||||
revealCredential: async (id: string) =>
|
||||
withRefresh(async () => {
|
||||
return await credentials.revealCredential({ id })
|
||||
}),
|
||||
}
|
||||
Reference in New Issue
Block a user