Add new endpoint for the agent status

This commit is contained in:
2025-07-30 22:36:49 +07:00
parent 4b0da0e864
commit c454e87d7a
6 changed files with 174 additions and 0 deletions

View File

@@ -2059,6 +2059,41 @@ export class DataClient extends AuthorizedApiBase {
}
return Promise.resolve<BestAgentsResponse>(null as any);
}
data_GetAgentStatuses(): Promise<AgentStatusResponse[]> {
let url_ = this.baseUrl + "/Data/GetAgentStatuses";
url_ = url_.replace(/[?&]$/, "");
let options_: RequestInit = {
method: "GET",
headers: {
"Accept": "application/json"
}
};
return this.transformOptions(options_).then(transformedOptions_ => {
return this.http.fetch(url_, transformedOptions_);
}).then((_response: Response) => {
return this.processData_GetAgentStatuses(_response);
});
}
protected processData_GetAgentStatuses(response: Response): Promise<AgentStatusResponse[]> {
const status = response.status;
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
if (status === 200) {
return response.text().then((_responseText) => {
let result200: any = null;
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as AgentStatusResponse[];
return result200;
});
} else if (status !== 200 && status !== 204) {
return response.text().then((_responseText) => {
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
});
}
return Promise.resolve<AgentStatusResponse[]>(null as any);
}
}
export class MoneyManagementClient extends AuthorizedApiBase {
@@ -4498,6 +4533,16 @@ export interface BestAgentsResponse {
totalPages?: number;
}
export interface AgentStatusResponse {
agentName?: string | null;
status?: AgentStatus;
}
export enum AgentStatus {
Offline = "Offline",
Online = "Online",
}
export interface ScenarioViewModel {
name: string;
indicators: IndicatorViewModel[];

View File

@@ -1023,6 +1023,16 @@ export interface BestAgentsResponse {
totalPages?: number;
}
export interface AgentStatusResponse {
agentName?: string | null;
status?: AgentStatus;
}
export enum AgentStatus {
Offline = "Offline",
Online = "Online",
}
export interface ScenarioViewModel {
name: string;
indicators: IndicatorViewModel[];