Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

Properties

Protected _botname

_botname: string

Private environments

environments: Environments

Environments available.

Private expressApp

expressApp: express.Application

Instance of express.

Private githubApi

githubApi: GithubApi

Instance of Github SDK API in use.

Private githubEmitter

githubEmitter: GithubService

Github ServiceEmitter.

Private githubEmitterName

githubEmitterName: string

Github ServiceEmitter name.

Private githubListenerName

githubListenerName: string

Github ServiceListener name.

Protected logger

logger: Logger = new Logger()

Private productRepo

productRepo: string

Product repo.

Methods

Protected addServiceEmitter

  • addServiceEmitter(name: string, data?: any): ServiceEmitter | void
  • Add a new type of ServiceEmitter to the client. Should the ServiceEmitter already exist on the client with the handle/name, this will do nothing.

    Parameters

    • name: string

      The name of the ServiceEmitter to add.

    • Optional data: any

    Returns ServiceEmitter | void

    The constructed or pre-existing ServiceEmitter or void on failure.

Protected addServiceListener

  • addServiceListener(name: string, data?: any): ServiceListener | void
  • Add a new type of ServiceListener to the client. Should the ServiceListener already exist on the client with the handle/name, this will do nothing.

    Parameters

    • name: string

      The name of the ServiceListener to add.

    • Optional data: any

    Returns ServiceListener | void

    The constructed or pre-existing ServiceListener or void on failure.

Private createNewEnvironmentBranchCommit

  • createNewEnvironmentBranchCommit(branchDetails: DeploymentDetails): Promise<string>
  • Creates a new branch on the specified environment for a given keyframe.

    Parameters

    Returns Promise<string>

    A string naming the branch created on fulfilment.

Private deployKeyframe

  • deployKeyframe(req: express.Request, res: express.Response): void
  • Deployment route method, hanging off an Express server. When a valid keyframe version and environment is passed, this will verify the product keyframe, and then create a new branch in the environment. The keyframe will be committed to this branch and a new PR will be based off it. This will automatically be linted by the process.

    Parameters

    • req: express.Request

      The HTTP request.

    • res: express.Response

      The HTTP response.

    Returns void

Protected dispatchToAllEmitters

  • dispatchToAllEmitters(data: ServiceEmitRequest): Promise<any[]>
  • Dispatch to the specified emitter. This method exists as a shortcut to avoid having to retrieve a specific emitter before sending to it.

    Parameters

    • data: ServiceEmitRequest

      The ServiceEmitRequest to use. This will be dispatched to all ServiceEmitters.

    Returns Promise<any[]>

    An array of ServiceEmitResponses from all the ServiceEmitters.

Protected dispatchToEmitter

  • dispatchToEmitter(handle: string, data: any): Promise<any>
  • Dispatch to a specific ServiceEmitter. This method exists as a shortcut to avoid having to retrieve a specific emitter before sending to it.

    throws

    Any error returned from the service represented by the ServiceEmitter.

    Parameters

    • handle: string

      The handle of the ServiceEmitter to dispatch to.

    • data: any

      Emitter appropriate data to send.

    Returns Promise<any>

    Data returned from the service represented by the ServiceEmitter.

Protected getEmitter

  • getEmitter(handle: string): ServiceEmitter | void
  • Find a particular attached ServiceEmitter based upon its name.

    Parameters

    • handle: string

      Handle of the ServiceEmitter instance to find (name if no handle was set).

    Returns ServiceEmitter | void

    Instance of the ServiceEmitter found, or void if not found.

Protected getListener

  • getListener(handle: string): ServiceListener | void
  • Find a particular attached ServiceListener based upon its handle.

    Parameters

    • handle: string

      Handle of the ServiceListener instance to find (name if no handle was set).

    Returns ServiceListener | void

    Instance of the ServiceListener found, or void if not found.

getNodeBinPath

  • getNodeBinPath(): Promise<string>

Protected lintKeyframe

  • lintKeyframe(_registration: GithubRegistration, event: ServiceEvent): Promise<void>
  • Lints a keyframe when the Github ServiceListener sees a PR open or synchronised.

    Parameters

    • _registration: GithubRegistration

      Registration object for the event.

    • event: ServiceEvent

      The Github event.

    Returns Promise<void>

    Void Promise fulfilled when the method has finished processing the event.

Protected processConfiguration

  • processConfiguration(configFile: string): ProcBotConfiguration | void
  • Process a configuration file from YAML into a nested object.

    Parameters

    • configFile: string

      The configuration file as a string.

    Returns ProcBotConfiguration | void

    The configuration object or void.

Private reportError

Protected retrieveConfiguration

  • retrieveConfiguration(details: ConfigurationLocation): Promise<ProcBotConfiguration | void>
  • Retrieve a ProcBotConfiguration file from a ServiceEmitter or inbuilt route.

    Parameters

    • details: ConfigurationLocation

      An object detailing the service to retrieve the configuration file from, and its location.

    Returns Promise<ProcBotConfiguration | void>

    A Promise containing configuration object should one have been found, or void.

Generated using TypeDoc