-
Notifications
You must be signed in to change notification settings - Fork 950
/
types.ts
73 lines (63 loc) · 1.6 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import express from "express";
import { WebhookEvent, Webhooks } from "@octokit/webhooks";
import LRUCache from "lru-cache";
import Redis from "ioredis";
import { Probot } from "./index";
import { Context } from "./context";
import { ProbotOctokit } from "./octokit/probot-octokit";
import type { Logger, LogFn } from "pino";
export interface Options {
privateKey?: string;
githubToken?: string;
appId?: number | string;
Octokit?: typeof ProbotOctokit;
log?: Logger;
redisConfig?: Redis.RedisOptions | string;
secret?: string;
webhookPath?: string;
logLevel?: "trace" | "debug" | "info" | "warn" | "error" | "fatal";
port?: number;
host?: string;
baseUrl?: string;
}
export type State = {
appId?: number;
privateKey?: string;
githubToken?: string;
log: Logger;
Octokit: typeof ProbotOctokit;
octokit: InstanceType<typeof ProbotOctokit>;
cache?: LRUCache<number, string>;
webhooks: {
path?: string;
secret?: string;
};
port?: number;
host?: string;
baseUrl?: string;
};
export type ProbotWebhooks = Webhooks<
WebhookEvent,
Omit<Context, keyof WebhookEvent>
>;
export type DeprecatedLogger = LogFn & Logger;
export type ApplicationFunctionOptions = {
getRouter?: (path?: string) => express.Router;
[key: string]: unknown;
};
export type ApplicationFunction = (
app: Probot,
options: ApplicationFunctionOptions
) => void;
export type ServerOptions = {
log?: Logger;
port?: number;
host?: string;
webhookPath?: string;
webhookProxy?: string;
Probot: typeof Probot;
};
export type MiddlewareOptions = {
probot: Probot;
[key: string]: unknown;
};