UNPKG

@atomist/sdm-core

Version:

Atomist Software Delivery Machine - Implementation

43 lines 2.06 kB
import { MessageOptions } from "@atomist/automation-client"; import { Destination } from "@atomist/automation-client/lib/spi/message/MessageClient"; import { CommandHandlerRegistration, ExtensionPack, GoalCompletionListener, GoalCompletionListenerInvocation, SdmContext, SdmGoalEvent } from "@atomist/sdm"; /** * Factory to create message destinations for goal notifications */ export declare type DestinationFactory = (goal: SdmGoalEvent, context: SdmContext) => Promise<Destination | Destination[] | undefined>; /** * Factory to create notification messages */ export declare type NotificationFactory = (gi: GoalCompletionListenerInvocation) => Promise<{ message: any; options: MessageOptions; }>; /** * Options to configure the notification support */ export interface NotificationOptions { destination?: DestinationFactory | DestinationFactory[]; notification?: NotificationFactory; } /** * Extension pack to send notifications on certain conditions. * Recipients and notification messages can be customized by providing options * with DestinationFactory and NotificationFactory. * @param options */ export declare function notificationSupport(options?: NotificationOptions): ExtensionPack; /** * Default DestinationFactory that would send every commit author a direct message in Slack / MS Teams. */ export declare function defaultDestinationFactory(goal: SdmGoalEvent): Promise<Destination | Destination[] | undefined>; /** * Default NotificationFactory that sends messages with restart, start and approve buttons where appropriate. */ export declare function defaultNotificationFactory(updateGoalCommand: CommandHandlerRegistration<any>): NotificationFactory; /** * GoalCompletionListener that delegates to the NotificationFactory and DestinationFactory to * create notifications and send them out. */ export declare function notifyGoalCompletionListener(options: NotificationOptions): GoalCompletionListener; export declare function truncateCommitMessage(message: string): string; //# sourceMappingURL=notification.d.ts.map