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 { Application } from "./application";
|
9 | import type { Logger, LogFn } from "pino";
|
10 | export interface Options {
|
11 | privateKey?: string;
|
12 | githubToken?: string;
|
13 | id?: number;
|
14 | Octokit?: typeof ProbotOctokit;
|
15 | log?: Logger;
|
16 | redisConfig?: Redis.RedisOptions | string;
|
17 | secret?: string;
|
18 | webhookPath?: string;
|
19 | logLevel?: "trace" | "debug" | "info" | "warn" | "error" | "fatal";
|
20 | port?: number;
|
21 | host?: string;
|
22 | webhookProxy?: string;
|
23 | baseUrl?: string;
|
24 | |
25 |
|
26 |
|
27 | cert?: string;
|
28 | |
29 |
|
30 |
|
31 | throttleOptions?: any;
|
32 | }
|
33 | export declare type State = {
|
34 | id?: number;
|
35 | privateKey?: string;
|
36 | githubToken?: string;
|
37 | log: Logger;
|
38 | Octokit: typeof ProbotOctokit;
|
39 | octokit: InstanceType<typeof ProbotOctokit>;
|
40 | cache?: LRUCache<number, string>;
|
41 | webhooks: {
|
42 | path?: string;
|
43 | secret?: string;
|
44 | };
|
45 | port?: number;
|
46 | host?: string;
|
47 | webhookProxy?: string;
|
48 | webhookPath?: string;
|
49 | baseUrl?: string;
|
50 | };
|
51 | export declare type ProbotWebhooks = Webhooks<WebhookEvent, Omit<Context, keyof WebhookEvent>>;
|
52 | export declare type DeprecatedLogger = LogFn & Logger;
|
53 | declare type deprecatedKeys = "router" | "log" | "on" | "receive" | "load" | "route" | "auth";
|
54 | export declare type ApplicationFunctionOptions = {
|
55 | [K in deprecatedKeys]: Application[K];
|
56 | } & {
|
57 | app: Probot;
|
58 | getRouter: (path?: string) => express.Router;
|
59 | };
|
60 | export declare type ApplicationFunction = (options: ApplicationFunctionOptions) => void;
|
61 | export {};
|