@kaaiot/services
Version:
Type definitions for KaaIoT platform REST API service communication
19 lines (18 loc) • 1.99 kB
TypeScript
import { CEXCommandTypeQueryParams, CommandsHistoryResponsePayload, DeleteCommandUrlParams, SendCommandUrlParams, EndpointsBatchRegistrationResponse, EndpointsBatchStatusResponse, BatchCommandHistoryResponse, BatchCommandHistoryRequestOptions, SendCommandBatchByEndpointsPayload, LastExecutedCommandParams, CommandResponce, GetCommandParams, GetLastCommandsPayload, EndpointLastCommands } from "./CEXClient.types";
import { ServiceRequester, FetchResponse } from "../service-requester";
export declare const DEFAULT_WAIT_TIMEOUT = 5;
export declare const DEFAULT_RETENTION_TTL = 60000;
export declare class CEXClient {
private http;
constructor(urlPrefix: string, serviceRequester?: ServiceRequester);
sendCommand(urlParams: SendCommandUrlParams, requestBody: Record<string, any> | string, query?: CEXCommandTypeQueryParams): Promise<FetchResponse<any>>;
getLastExecutedCommand(urlParams: LastExecutedCommandParams): Promise<FetchResponse<CommandResponce>>;
getCommand(urlParams: GetCommandParams): Promise<FetchResponse<CommandResponce>>;
deleteCommand(urlParams: DeleteCommandUrlParams): Promise<FetchResponse<void>>;
getCommandsHistory(endpointId: string | string[], commandType?: string | string[]): Promise<FetchResponse<CommandsHistoryResponsePayload[]>>;
getLastCommands(data: GetLastCommandsPayload): Promise<FetchResponse<EndpointLastCommands[]>>;
sendCommandBatchByFilter(commandType: string, requestBody: Record<string, any> | string, query: CEXCommandTypeQueryParams): Promise<FetchResponse<EndpointsBatchRegistrationResponse>>;
sendCommandBatchByEndpoints(commandType: string, data: SendCommandBatchByEndpointsPayload, commandTtl?: number): Promise<FetchResponse<EndpointsBatchRegistrationResponse>>;
batchStatus(taskId: string, appName: string): Promise<FetchResponse<EndpointsBatchStatusResponse>>;
getCommandsBatchHistory(options: BatchCommandHistoryRequestOptions): Promise<FetchResponse<BatchCommandHistoryResponse>>;
}