25 lines
687 B
TypeScript
25 lines
687 B
TypeScript
import axios from "axios";
|
|
|
|
const SELENIUM_BASE = process.env.SELENIUM_SERVICE_URL ?? "http://localhost:5002";
|
|
|
|
/**
|
|
* POST /cca-eligibility
|
|
* Returns { status: "started", session_id: "<uuid>" }
|
|
*/
|
|
export async function forwardToSeleniumCCAEligibilityAgent(
|
|
data: Record<string, any>
|
|
): Promise<{ status: string; session_id: string }> {
|
|
const resp = await axios.post(`${SELENIUM_BASE}/cca-eligibility`, { data });
|
|
return resp.data;
|
|
}
|
|
|
|
/**
|
|
* GET /session/{sid}/status
|
|
*/
|
|
export async function getSeleniumCCASessionStatus(
|
|
sessionId: string
|
|
): Promise<Record<string, any>> {
|
|
const resp = await axios.get(`${SELENIUM_BASE}/session/${sessionId}/status`);
|
|
return resp.data;
|
|
}
|