feat(api, agents): add agent node profile retrieval and update functionality
Implemented new API functions to fetch and update agent node profiles, enhancing the management capabilities for agent data. This addition improves the overall functionality of the admin agents console, allowing for better user interaction with agent profiles. Updated related types for improved type safety and clarity in the codebase.
This commit is contained in:
13
src/api/admin-agent-lines.ts
Normal file
13
src/api/admin-agent-lines.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { adminRequest } from "@/lib/admin-http";
|
||||
import type {
|
||||
AdminAgentLineProvisionPayload,
|
||||
AdminAgentLineProvisionResult,
|
||||
} from "@/types/api/admin-agent-line";
|
||||
|
||||
const A = `/admin`;
|
||||
|
||||
export async function postAdminAgentLine(
|
||||
payload: AdminAgentLineProvisionPayload,
|
||||
): Promise<AdminAgentLineProvisionResult> {
|
||||
return adminRequest.post<AdminAgentLineProvisionResult>(`${A}/agent-lines`, payload);
|
||||
}
|
||||
@@ -8,6 +8,8 @@ import type {
|
||||
AgentNodeCreatePayload,
|
||||
AgentNodeRow,
|
||||
AgentNodeUpdatePayload,
|
||||
AgentProfilePayload,
|
||||
AgentProfileRow,
|
||||
AgentRoleCreatePayload,
|
||||
AgentRoleListData,
|
||||
AgentTreeData,
|
||||
@@ -39,6 +41,17 @@ export async function deleteAgentNode(agentNodeId: number): Promise<null> {
|
||||
return adminRequest.delete<null>(`${A}/agent-nodes/${agentNodeId}`);
|
||||
}
|
||||
|
||||
export async function getAgentNodeProfile(agentNodeId: number): Promise<AgentProfileRow> {
|
||||
return adminRequest.get<AgentProfileRow>(`${A}/agent-nodes/${agentNodeId}/profile`);
|
||||
}
|
||||
|
||||
export async function putAgentNodeProfile(
|
||||
agentNodeId: number,
|
||||
body: AgentProfilePayload,
|
||||
): Promise<AgentProfileRow> {
|
||||
return adminRequest.put<AgentProfileRow>(`${A}/agent-nodes/${agentNodeId}/profile`, body);
|
||||
}
|
||||
|
||||
export async function getAgentNodeRoles(agentNodeId: number): Promise<AgentRoleListData> {
|
||||
return adminRequest.get<AgentRoleListData>(`${A}/agent-nodes/${agentNodeId}/roles`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user