Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

AdditionalOptions

AdditionalOptions: { env: Record<string, string | undefined> }

Type declaration

  • env: Record<string, string | undefined>

ApplicationFunction

ApplicationFunction: (app: Probot, options: ApplicationFunctionOptions) => void

Type declaration

ApplicationFunctionOptions

ApplicationFunctionOptions: { getRouter?: undefined | ((path?: undefined | string) => express.Router) }

Type declaration

  • [key: string]: unknown
  • Optional getRouter?: undefined | ((path?: undefined | string) => express.Router)

Constructor

Constructor<T>: {}

Type parameters

  • T

Type declaration

CreateProbotOptions

CreateProbotOptions: { defaults?: Options; env?: NodeJS.ProcessEnv; overrides?: Options }

Type declaration

  • Optional defaults?: Options
  • Optional env?: NodeJS.ProcessEnv
  • Optional overrides?: Options

DeprecatedLogger

DeprecatedLogger: LogFn & Logger

FactoryOptions

FactoryOptions: { octokit: InstanceType<typeof ProbotOctokit>; octokitOptions: ConstructorParameters<typeof ProbotOctokit> & { auth?: Record<string, unknown>; throttle?: Record<string, unknown> } }

Type declaration

  • [key: string]: unknown
  • octokit: InstanceType<typeof ProbotOctokit>
  • octokitOptions: ConstructorParameters<typeof ProbotOctokit> & { auth?: Record<string, unknown>; throttle?: Record<string, unknown> }

GetLogOptions

GetLogOptions: { level?: LogLevel; logMessageKey?: undefined | string } & Options

MergeOptions

MergeOptions: merge.Options

MiddlewareOptions

MiddlewareOptions: { probot: Probot }

Type declaration

  • [key: string]: unknown
  • probot: Probot

Options

Options: { Octokit: typeof ProbotOctokit; appId?: undefined | number; baseUrl?: undefined | string; cache: LRUCache<number, string>; githubToken?: undefined | string; log: Logger; privateKey?: undefined | string; redisConfig?: Redis.RedisOptions | string }

Type declaration

  • Octokit: typeof ProbotOctokit
  • Optional appId?: undefined | number
  • Optional baseUrl?: undefined | string
  • cache: LRUCache<number, string>
  • Optional githubToken?: undefined | string
  • log: Logger
  • Optional privateKey?: undefined | string
  • Optional redisConfig?: Redis.RedisOptions | string

Optional Octokit

Octokit: typeof ProbotOctokit

Optional appId

appId: number | string

Optional baseUrl

baseUrl: undefined | string

Optional githubToken

githubToken: undefined | string

Optional host

host: undefined | string

Optional log

log: Logger

Optional logLevel

logLevel: "trace" | "debug" | "info" | "warn" | "error" | "fatal"

Optional logMessageKey

logMessageKey: undefined | string

Optional port

port: undefined | number

Optional privateKey

privateKey: undefined | string

Optional redisConfig

redisConfig: Redis.RedisOptions | string

Optional secret

secret: undefined | string

Optional webhookPath

webhookPath: undefined | string

ProbotWebhooks

ProbotWebhooks: Webhooks<WebhookEvent, Omit<Context, keyof WebhookEvent>>

Resolver

Resolver: (appFnId: string, opts: { basedir: string }) => string

Type declaration

    • (appFnId: string, opts: { basedir: string }): string
    • Parameters

      • appFnId: string
      • opts: { basedir: string }
        • basedir: string

      Returns string

ServerOptions

ServerOptions: { Probot: typeof Probot; host?: undefined | string; log?: Logger; port?: undefined | number; webhookPath?: undefined | string; webhookProxy?: undefined | string }

Type declaration

  • Probot: typeof Probot
  • Optional host?: undefined | string
  • Optional log?: Logger
  • Optional port?: undefined | number
  • Optional webhookPath?: undefined | string
  • Optional webhookProxy?: undefined | string

State

State: { Octokit: typeof ProbotOctokit; appId?: undefined | number; baseUrl?: undefined | string; cache?: LRUCache<number, string>; githubToken?: undefined | string; host?: undefined | string; log: Logger; octokit: InstanceType<typeof ProbotOctokit>; port?: undefined | number; privateKey?: undefined | string; webhooks: { path?: undefined | string; secret?: undefined | string } }

Type declaration

  • Octokit: typeof ProbotOctokit
  • Optional appId?: undefined | number
  • Optional baseUrl?: undefined | string
  • Optional cache?: LRUCache<number, string>
  • Optional githubToken?: undefined | string
  • Optional host?: undefined | string
  • log: Logger
  • octokit: InstanceType<typeof ProbotOctokit>
  • Optional port?: undefined | number
  • Optional privateKey?: undefined | string
  • webhooks: { path?: undefined | string; secret?: undefined | string }
    • Optional path?: undefined | string
    • Optional secret?: undefined | string

Variables

Const ProbotOctokit

ProbotOctokit: Octokit & Constructor<void & { paginate: PaginateInterface } & RestEndpointMethods & Api & API> = Octokit.plugin(throttling,retry,paginateRest,legacyRestEndpointMethods,enterpriseCompatibility,probotRequestLogging,config).defaults((instanceOptions: any) => {// merge throttle options deeplyconst options = Object.assign({}, defaultOptions, instanceOptions, {throttle: instanceOptions.throttle? Object.assign({}, defaultOptions.throttle, instanceOptions.throttle): defaultOptions.throttle,});return options;})

Const VERSION

VERSION: "0.0.0-development" = "0.0.0-development"

Const pkg

pkg: any = require("../../package")

Functions

aliasLog

auth

  • auth(state: State, installationId?: undefined | number, log?: Logger): Promise<InstanceType<typeof ProbotOctokit>>
  • Authenticate and get a GitHub client that can be used to make API calls.

    You'll probably want to use context.octokit instead.

    Note: app.auth is asynchronous, so it needs to be prefixed with a await to wait for the magic to happen.

     module.exports = (app) => {
       app.on('issues.opened', async context => {
         const octokit = await app.auth();
       });
     };
    

    Parameters

    • state: State
    • Optional installationId: undefined | number
    • Optional log: Logger

    Returns Promise<InstanceType<typeof ProbotOctokit>>

    An authenticated GitHub API client

createNodeMiddleware

createProbot

  • createProbot(__namedParameters?: { defaults: Options; env: ProcessEnv; overrides: Options }): Probot
  • Merges configuration from defaults/environment variables/overrides and returns a Probot instance. Finds private key using @probot/get-private-key.

    see

    https://probot.github.io/docs/configuration/

    Parameters

    • Default value __namedParameters: { defaults: Options; env: ProcessEnv; overrides: Options } = {}
      • defaults: Options

        default Options, will be overwritten if according environment variable is set

      • env: ProcessEnv

        defaults to process.env

      • overrides: Options

        overwrites defaults and according environment variables

    Returns Probot

Const createWebhookProxy

defaultApp

  • defaultApp(app: Probot, __namedParameters: { getRouter: undefined | ((path?: undefined | string) => express.Router) }): void
  • Parameters

    • app: Probot
    • __namedParameters: { getRouter: undefined | ((path?: undefined | string) => express.Router) }
      • getRouter: undefined | ((path?: undefined | string) => express.Router)

    Returns void

getAuthenticatedOctokit

  • getAuthenticatedOctokit(state: State, installationId?: undefined | number): Promise<Octokit & void & { paginate: PaginateInterface } & RestEndpointMethods & Api & API>

getBaseUrl

  • getBaseUrl(req: Request): string

getErrorHandler

  • getErrorHandler(log: Logger): (Anonymous function)

getLog

getLoggingMiddleware

  • getLoggingMiddleware(logger: Logger): HttpLogger

getOctokitThrottleOptions

  • getOctokitThrottleOptions(options: Options): undefined | { Bottleneck: Bottleneck; connection: IORedisConnection }

getProbotOctokitWithDefaults

  • getProbotOctokitWithDefaults(options: Options): Octokit & Constructor<void & { paginate: PaginateInterface } & RestEndpointMethods & Api & API>
  • Returns an Octokit instance with default settings for authentication. If a githubToken is passed explicitly, the Octokit instance will be pre-authenticated with that token when instantiated. Otherwise Octokit's app authentication strategy is used, and options.auth options are merged deeply when instantiated.

    Besides the authentication, the Octokit's baseUrl is set as well when run against a GitHub Enterprise Server with a custom domain.

    Parameters

    Returns Octokit & Constructor<void & { paginate: PaginateInterface } & RestEndpointMethods & Api & API>

getRedisClient

  • getRedisClient(__namedParameters: { log: Logger; redisConfig: undefined | string | RedisOptions }): Redis.Redis | void
  • Parameters

    • __namedParameters: { log: Logger; redisConfig: undefined | string | RedisOptions }
      • log: Logger
      • redisConfig: undefined | string | RedisOptions

    Returns Redis.Redis | void

getRouter

  • getRouter(router: Router, path?: undefined | string): Router
  • Get an express router that can be used to expose HTTP endpoints

    Parameters

    • router: Router
    • Optional path: undefined | string

      the prefix for the routes

    Returns Router

    an express.Router

getWebhooks

  • getWebhooks(state: State): Webhooks<WebhookEvent<any>, Context<any>>

main

  • main(): Promise<void>

printRestartMessage

  • printRestartMessage(app: Probot): void

printWelcomeMessage

  • printWelcomeMessage(app: Probot, host: string | undefined, port: number | undefined): void

probotRequestLogging

  • probotRequestLogging(octokit: Octokit): void

readCliOptions

  • readCliOptions(argv: string[]): Options & PinoOptions & { args: string[] }

readEnvOptions

  • readEnvOptions(env?: Record<string, string | undefined>): { appId: number; args: never[]; baseUrl: string; host: undefined | string; logFormat: undefined | "json" | "pretty"; logLevel: LogLevel; logLevelInString: boolean; logMessageKey: undefined | string; port: number; privateKey: undefined | string; redisConfig: undefined | string; secret: undefined | string; sentryDsn: undefined | string; webhookPath: undefined | string; webhookProxy: undefined | string }
  • Parameters

    • Default value env: Record<string, string | undefined> = process.env

    Returns { appId: number; args: never[]; baseUrl: string; host: undefined | string; logFormat: undefined | "json" | "pretty"; logLevel: LogLevel; logLevelInString: boolean; logMessageKey: undefined | string; port: number; privateKey: undefined | string; redisConfig: undefined | string; secret: undefined | string; sentryDsn: undefined | string; webhookPath: undefined | string; webhookProxy: undefined | string }

    • appId: number
    • args: never[]
    • baseUrl: string
    • host: undefined | string
    • logFormat: undefined | "json" | "pretty"
    • logLevel: LogLevel
    • logLevelInString: boolean
    • logMessageKey: undefined | string
    • port: number
    • privateKey: undefined | string
    • redisConfig: undefined | string
    • secret: undefined | string
    • sentryDsn: undefined | string
    • webhookPath: undefined | string
    • webhookProxy: undefined | string

Const resolveAppFunction

  • resolveAppFunction(appFnId: string, opts?: ResolveOptions): Promise<any>

run

Const setupAppFactory

  • setupAppFactory(host: string | undefined, port: number | undefined): setupApp
  • Parameters

    • host: string | undefined
    • port: number | undefined

    Returns setupApp

webhookTransform

  • webhookTransform(state: State, event: WebhookEvent): Promise<Context<any>>

Object literals

Const DEFAULTS

DEFAULTS: object

APP_ID

APP_ID: string = ""

GHE_HOST

GHE_HOST: string = ""

GHE_PROTOCOL

GHE_PROTOCOL: string = ""

LOG_FORMAT

LOG_FORMAT: string = ""

LOG_LEVEL

LOG_LEVEL: string = "warn"

LOG_LEVEL_IN_STRING

LOG_LEVEL_IN_STRING: string = ""

LOG_MESSAGE_KEY

LOG_MESSAGE_KEY: string = "msg"

REDIS_URL

REDIS_URL: string = ""

SENTRY_DSN

SENTRY_DSN: string = ""

WEBHOOK_SECRET

WEBHOOK_SECRET: string = ""

Const defaultOptions

defaultOptions: object

authStrategy

authStrategy: createProbotAuth = createProbotAuth

userAgent

userAgent: string = `probot/${VERSION}`

throttle

throttle: object

onAbuseLimit

  • onAbuseLimit(retryAfter: number, options: RequestOptions, octokit: Octokit): boolean

onRateLimit

  • onRateLimit(retryAfter: number, options: RequestOptions, octokit: Octokit): boolean

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Static property

Generated using TypeDoc