File size: 634 Bytes
0b9dc2e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { client } from './client';
import type {
	AgentListResponse,
	AgentRecord,
	AgentSchemaResponse,
	CreateAgentRequest,
	CreateAgentResponse,
	UpdateAgentRequest,
} from './types';

export const agentApi = {
	list: () => client.get<AgentListResponse>('/agent/'),

	getSchema: () => client.get<AgentSchemaResponse>('/agent/schema'),

	create: (body: CreateAgentRequest) => client.post<CreateAgentResponse>('/agent/', body),

	update: (agentId: string, body: UpdateAgentRequest) =>
		client.patch<AgentRecord>(`/agent/${agentId}`, body),

	delete: (agentId: string) => client.delete(`/agent/${agentId}`),
};