@atomist/automation-client
Version:
Atomist API for software low-level client
63 lines • 2.38 kB
TypeScript
import { SlackMessage } from "@atomist/slack-messages/SlackMessages";
import * as WebSocket from "ws";
import { Destination, MessageOptions } from "../../../spi/message/MessageClient";
import { MessageClientSupport } from "../../../spi/message/MessageClientSupport";
import { CommandIncoming, EventIncoming, Source } from "../RequestProcessor";
export declare abstract class AbstractWebSocketMessageClient extends MessageClientSupport {
private ws;
private request;
private correlationId;
private team;
private source;
constructor(ws: WebSocket, request: CommandIncoming | EventIncoming, correlationId: string, team: {
id: string;
name?: string;
}, source: Source);
protected doSend(msg: string | SlackMessage, destinations: Destination | Destination[], options?: MessageOptions): Promise<any>;
private ts;
}
export declare class WebSocketCommandMessageClient extends AbstractWebSocketMessageClient {
constructor(request: CommandIncoming, ws: WebSocket);
protected doSend(msg: string | SlackMessage, destinations: Destination | Destination[], options?: MessageOptions): Promise<any>;
}
export declare class WebSocketEventMessageClient extends AbstractWebSocketMessageClient {
constructor(request: EventIncoming, ws: WebSocket);
protected doSend(msg: string | SlackMessage, destinations: Destination | Destination[], options?: MessageOptions): Promise<any>;
}
export declare function mapActions(msg: SlackMessage): Action[];
export declare function sendMessage(message: any, ws: WebSocket, log?: boolean): void;
export declare function clean(addresses: string[] | string): string[];
export interface HandlerResponse {
api_version: "1";
correlation_id: any;
team: {
id: string;
name?: string;
};
command?: string;
event?: string;
status?: {
code: number;
reason: string;
};
source?: Source;
destinations?: any[];
content_type?: string;
body?: string;
id?: string;
timestamp?: number;
ttl?: number;
post_mode?: "ttl" | "always" | "update_only";
actions?: Action[];
}
export interface Action {
id: string;
parameter_name?: string;
command: string;
parameters: Parameter[];
}
export interface Parameter {
name: string;
value: string;
}
//# sourceMappingURL=WebSocketMessageClient.d.ts.map