@atomist/automation-client
Version:
Atomist API for software low-level client
43 lines • 3.17 kB
TypeScript
import { Configuration } from "../../configuration";
import { EventFired } from "../../HandleEvent";
import { AutomationContextAware, HandlerContext } from "../../HandlerContext";
import { HandlerResult } from "../../HandlerResult";
import { AutomationEventListener } from "../../server/AutomationEventListener";
import { AutomationServer } from "../../server/AutomationServer";
import { GraphClient } from "../../spi/graph/GraphClient";
import { MessageClient, SlackMessageClient } from "../../spi/message/MessageClient";
import { CommandInvocation } from "../invoker/Payload";
import { CommandIncoming, EventIncoming, RequestProcessor } from "./RequestProcessor";
export declare abstract class AbstractRequestProcessor implements RequestProcessor {
protected automations: AutomationServer;
protected configuration: Configuration;
protected listeners: AutomationEventListener[];
constructor(automations: AutomationServer, configuration: Configuration, listeners?: AutomationEventListener[]);
processCommand(command: CommandIncoming, callback?: (result: Promise<HandlerResult>) => void): void;
processEvent(event: EventIncoming, callback?: (results: Promise<HandlerResult[]>) => void): void;
sendCommandStatus(success: boolean, code: number, request: CommandIncoming, ctx: HandlerContext & AutomationContextAware): Promise<any>;
sendEventStatus(success: boolean, request: EventFired<any>, event: EventIncoming, ctx: HandlerContext & AutomationContextAware): Promise<any>;
protected invokeCommand(ci: CommandInvocation, ctx: HandlerContext & AutomationContextAware, command: CommandIncoming, callback: (result: Promise<HandlerResult>) => void): void;
protected invokeEvent(ef: EventFired<any>, ctx: HandlerContext & AutomationContextAware, event: EventIncoming, callback: (results: Promise<HandlerResult[]>) => void): void;
protected createAndWrapMessageClient(event: EventIncoming | CommandIncoming, context: HandlerContext & AutomationContextAware): MessageClient & SlackMessageClient;
protected setupNamespace(request: any, automations: AutomationServer, invocationId?: string, ts?: number): {
correlationId: any;
workspaceId: any;
workspaceName: any;
operation: any;
name: string;
version: string;
invocationId: string;
ts: number;
};
protected clearNamespace(): void;
protected abstract sendStatusMessage(payload: any, ctx: HandlerContext & AutomationContextAware): Promise<any>;
protected abstract createGraphClient(event: EventIncoming | CommandIncoming, context: HandlerContext & AutomationContextAware): GraphClient;
protected abstract createMessageClient(event: EventIncoming | CommandIncoming, context: AutomationContextAware): MessageClient;
private handleCommandError;
private handleEventError;
}
export declare function defaultResult(context: AutomationContextAware): HandlerResult;
export declare function defaultErrorResult(context: AutomationContextAware): HandlerResult;
export declare function possibleAxiosObjectReplacer(key: string, value: any): any;
//# sourceMappingURL=AbstractRequestProcessor.d.ts.map