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 | appId?: number | string;
|
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 | id?: number | string;
|
28 | |
29 |
|
30 |
|
31 | cert?: string;
|
32 | |
33 |
|
34 |
|
35 | throttleOptions?: any;
|
36 | }
|
37 | export declare type State = {
|
38 | appId?: number;
|
39 | privateKey?: string;
|
40 | githubToken?: string;
|
41 | log: Logger;
|
42 | Octokit: typeof ProbotOctokit;
|
43 | octokit: InstanceType<typeof ProbotOctokit>;
|
44 | cache?: LRUCache<number, string>;
|
45 | webhooks: {
|
46 | path?: string;
|
47 | secret?: string;
|
48 | };
|
49 | port?: number;
|
50 | host?: string;
|
51 | webhookProxy?: string;
|
52 | baseUrl?: string;
|
53 | };
|
54 | export declare type ProbotWebhooks = Webhooks<WebhookEvent, Omit<Context, keyof WebhookEvent>>;
|
55 | export declare type DeprecatedLogger = LogFn & Logger;
|
56 | declare type deprecatedKeys = "router" | "log" | "on" | "receive" | "load" | "route" | "auth";
|
57 | export declare type ApplicationFunctionOptions = {
|
58 | [K in deprecatedKeys]: Application[K];
|
59 | } & {
|
60 | app: Probot;
|
61 | getRouter: (path?: string) => express.Router;
|
62 | };
|
63 | export declare type ApplicationFunction = (options: ApplicationFunctionOptions) => void;
|
64 | export declare type ServerOptions = {
|
65 | log?: Logger;
|
66 | port?: number;
|
67 | host?: string;
|
68 | webhookPath?: string;
|
69 | webhookProxy?: string;
|
70 | Probot: typeof Probot;
|
71 | };
|
72 | export declare type MiddlewareOptions = {
|
73 | probot: Probot;
|
74 | [key: string]: unknown;
|
75 | |
76 |
|
77 |
|
78 | Probot?: typeof Probot;
|
79 | };
|
80 | export {};
|