Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CommandListenerInvocation<PARAMS>

Context for a command

Type parameters

  • PARAMS = NoParameters

Hierarchy

Index

Properties

addressChannels

addressChannels: AddressChannels

Provides a way to address the channel(s) related to this action: usually, an event or command invocation. In an event handler, these are usually the channel(s) linked to a repo. In a command handler, the behavior will be the same as that of MessageClient.respond. In some cases, such as repo creation or a push to a repo where there is no linked channel, addressChannels will go to dev/null without error.

commandName

commandName: string

configuration

configuration: Configuration

context

context: HandlerContext

Context of the Atomist EventHandler invocation. Use to run GraphQL queries, use the messageClient directly and find the team and correlation id

credentials

credentials: ProjectOperationCredentials

Credentials for use with source control hosts such as GitHub

Optional ids

ids: RemoteRepoRef[]

The repos this command relates to, if available.

Optional matches

matches: RegExpExecArray

If the intent was a regular expression, the matches to the supplied intent are found here

Optional parameters

parameters: PARAMS

Parameters, if any were supplied

preferences

preferences: PreferenceStore

Store and retrieve preferences for this SDM or team

skill

Methods

promptFor

  • Prompt for additional parameters needed during execution of the command listener.

    Callers should wait for the returned Promise to resolve. It will resolve with the requested parameters if those have already been collected. If not, a parameter prompt request to the backend will be sent and the Promise will reject. Once the new parameters are collected, a new command invocation will be sent and the command listener will restart.

    This requires that any state that gets created before calling promptFor can be re-created when re-entering the listener function. Also any action taken before calling promptFor needs to be implemented using idempotency patterns.

    Type parameters

    • NEWPARAMS

    Parameters

    Returns Promise<NEWPARAMS>

Generated using TypeDoc