1 | import express from "express";
|
2 | import { WebhookEvent, Webhooks } from "@octokit/webhooks";
|
3 | import LRUCache from "lru-cache";
|
4 | import Redis from "ioredis";
|
5 | import { Probot } from "./index";
|
6 | import { Context } from "./context";
|
7 | import { ProbotOctokit } from "./octokit/probot-octokit";
|
8 | import type { Logger, LogFn } from "pino";
|
9 | export interface Options {
|
10 | privateKey?: string;
|
11 | githubToken?: string;
|
12 | appId?: number | string;
|
13 | Octokit?: typeof ProbotOctokit;
|
14 | log?: Logger;
|
15 | redisConfig?: Redis.RedisOptions | string;
|
16 | secret?: string;
|
17 | webhookPath?: string;
|
18 | logLevel?: "trace" | "debug" | "info" | "warn" | "error" | "fatal";
|
19 | port?: number;
|
20 | host?: string;
|
21 | baseUrl?: string;
|
22 | }
|
23 | export declare type State = {
|
24 | appId?: number;
|
25 | privateKey?: string;
|
26 | githubToken?: string;
|
27 | log: Logger;
|
28 | Octokit: typeof ProbotOctokit;
|
29 | octokit: InstanceType<typeof ProbotOctokit>;
|
30 | cache?: LRUCache<number, string>;
|
31 | webhooks: {
|
32 | path?: string;
|
33 | secret?: string;
|
34 | };
|
35 | port?: number;
|
36 | host?: string;
|
37 | baseUrl?: string;
|
38 | };
|
39 | export declare type ProbotWebhooks = Webhooks<WebhookEvent, Omit<Context, keyof WebhookEvent>>;
|
40 | export declare type DeprecatedLogger = LogFn & Logger;
|
41 | export declare type ApplicationFunctionOptions = {
|
42 | getRouter?: (path?: string) => express.Router;
|
43 | [key: string]: unknown;
|
44 | };
|
45 | export declare type ApplicationFunction = (app: Probot, options: ApplicationFunctionOptions) => void;
|
46 | export declare type ServerOptions = {
|
47 | log?: Logger;
|
48 | port?: number;
|
49 | host?: string;
|
50 | webhookPath?: string;
|
51 | webhookProxy?: string;
|
52 | Probot: typeof Probot;
|
53 | };
|
54 | export declare type MiddlewareOptions = {
|
55 | probot: Probot;
|
56 | [key: string]: unknown;
|
57 | };
|