Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Implements

  • ServiceListener
  • ServiceEmitter
  • ServiceEmitter
  • ServiceListener
  • DataHub

Index

Constructors

constructor

  • new FlowdockService(data: FlowdockConstructor, listen?: boolean): FlowdockService

Properties

Private data

data: FlowdockConstructor

Private receivedPostIds

receivedPostIds: Set<number> = new Set<number>()

Private session

session: Session

Protected workers

workers: WorkerMap<string | null> = new Map<T, Worker<T>>()

Static Private _serviceName

_serviceName: string = path.basename(__filename.split('.')[0])

Static Protected logger

logger: Logger = new Logger()

A place to put output for debug and reference.

Accessors

apiHandle

  • get apiHandle(): FlowdockHandle

serviceName

  • get serviceName(): string

Static Protected expressApp

  • get expressApp(): express.Express

Methods

Protected activateMessageListener

  • activateMessageListener(): void

Private fetchFromSession

  • fetchFromSession(path: string, search?: undefined | string): Promise<any>
  • Utility function to structure the flowdock session as a promise a little.

    Parameters

    • path: string

      Endpoint to retrieve.

    • Optional search: undefined | string

      Optional, some words which may be used to shortlist the results.

    Returns Promise<any>

    Response from the session.

fetchNotes

  • fetchNotes(thread: string, room: string, filter: RegExp, search?: undefined | string): Promise<string[]>
  • Promise to find the comment history of a particular thread.

    Parameters

    • thread: string

      id of the thread to search.

    • room: string

      id of the room in which the thread resides.

    • filter: RegExp

      Criteria to match.

    • Optional search: undefined | string

      Optional, some words which may be used to shortlist the results.

    Returns Promise<string[]>

Private fetchPrivateMessages

  • fetchPrivateMessages(username: string, filter: RegExp): Promise<string[]>
  • Search for recent private messages with our account that match on username and regex.

    Parameters

    • username: string

      Scope of the private messages to search.

    • filter: RegExp

      Narrow our search to just matches.

    Returns Promise<string[]>

    Promise that resolves to the message strings.

Private fetchUserId

  • fetchUserId(username: string): Promise<string | undefined>
  • Fetch a user's id from their username.

    Parameters

    • username: string

      Username to search for.

    Returns Promise<string | undefined>

    id of the user.

fetchValue

  • fetchValue(user: string, key: string): Promise<string>
  • Search for the specified value associated with a user.

    Parameters

    • user: string

      Username to search associated with.

    • key: string

      Name of the value to retrieve.

    Returns Promise<string>

    Promise that resolves to the value.

Protected getWorker

Protected handleEvent

listen

  • listen(): void

makeGeneric

makeSpecific

  • Promise to turn the generic message format into a specific form to be emitted.

    Parameters

    Returns Promise<FlowdockEmitContext>

    Promise that resolves to the emit suitable form.

makeTagUpdate

  • Promise to turn the generic message format into a tag update to be emitted.

    Parameters

    Returns Promise<FlowdockEmitContext>

    Promise that resolves to the tag update object.

queueEvent

registerEvent

  • registerEvent(registration: ServiceRegistration): void
  • Store an event of interest, so that the method gets triggered appropriately.

    Parameters

    • registration: ServiceRegistration

      Registration object with event trigger and other details.

    Returns void

Protected removeWorker

  • removeWorker(context: string | null): void

sendData

Protected sendPayload

translateEventName

  • translateEventName(eventType: string): string
  • Turns the generic, messenger, name for an event into a specific trigger name for this class.

    Parameters

    • eventType: string

      Name of the event to translate, eg 'message'.

    Returns string

    This class's equivalent, eg 'post'.

Static Protected extractMetadata

  • extractMetadata(message: string, format: string): Metadata
  • Given a basic string this will extract a more rich context for the event, if embedded.

    Parameters

    • message: string

      Basic string that may contain metadata.

    • format: string

      Format of the metadata encoding.

    Returns Metadata

    Object of content, genesis and hidden.

Static Protected getIndicatorArrays

  • getIndicatorArrays(): object

Static initInterimContext

Static Protected messageOfTheDay

  • messageOfTheDay(): string

Static Protected stringifyMetadata

Generated using TypeDoc