Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Utilities

Hierarchy

Index

Properties

Abstract performanceNow

performanceNow: any

Accessors

namespace

  • get namespace(): string
  • Returns the current UUID representing the namespace of the package

    Returns string

Methods

buildFullUrl

  • buildFullUrl(action: string, params: string, baseUrl: string): string
  • Builds the url that'll trigger desired action

    Parameters

    • action: string
    • params: string
    • baseUrl: string

    Returns string

Abstract callBetterTouchTool

  • callBetterTouchTool(action: string, data: Types.BttPayload, config: AppConfig, translate: boolean): Promise<CallResult>
  • Sends a request to real BTT built in webserver with given data translated as GET query params

    Parameters

    • action: string
    • data: Types.BttPayload
    • config: AppConfig
    • translate: boolean

    Returns Promise<CallResult>

Abstract deleteTrigger

  • deleteTrigger(uuid: string): void

Abstract fetch

  • fetch(path: string, options?: any): Promise<any>
  • Parameters

    • path: string
    • Optional options: any

    Returns Promise<any>

generateUuidForString

  • generateUuidForString(text: string, namespace?: string): string
  • Takes a namespace as a parameter and a text, to generate an UUID (uuidv5)

    Parameters

    • text: string
    • Default value namespace: string = NAMESPACE

    Returns string

getBaseUrl

  • getBaseUrl(config: Partial<AppConfig>): string

Abstract getMdlsName

  • getMdlsName(applicationPath: string): string

Abstract getNodeBinaryPath

  • getNodeBinaryPath(): string

getUrl

keyToBttNotation

  • keyToBttNotation(key: string): string
  • Maps given string to btt JSON key notation

    example

    'triggerName' => 'BTTTriggerName'

    Parameters

    • key: string

    Returns string

mapClassNameToMethodName

params

  • params(data: Record<string, string>, sharedKey?: string, sharedSecret?: string): string
  • Parses given list of params (key-value object) and converts it to query parameters

    Parameters

    • data: Record<string, string>
    • Optional sharedKey: string
    • Optional sharedSecret: string

    Returns string

simpleCase

  • simpleCase(value: string): string
  • Parses given string to simplified lower case

    Parameters

    • value: string

    Returns string

translateObjectKeysToBttNotation

  • translateObjectKeysToBttNotation(object: Partial<Types.AppPayload> | Partial<Types.BttPayload>): object
  • Maps each key in the passed object to btt notation (BTTWhateverPassed)

    Parameters

    • object: Partial<Types.AppPayload> | Partial<Types.BttPayload>

    Returns object