-
Notifications
You must be signed in to change notification settings - Fork 0
/
interfaces.ts
51 lines (42 loc) · 1.11 KB
/
interfaces.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
import type Hapi from '@hapi/hapi'
import type { Tags } from '@jackdbd/hapi-request-event-predicates'
/**
* @public
*/
export type GiHubToken = string
export interface GitHubIssue {
title: string
body: string
assignees?: string[]
milestone?: number
labels?: string[]
}
/**
* Rule that controls which request matches, and which GitHub issue should be
* created.
*
* The rule `predicate` determines whether a request matches or not.
*
* @public
*/
export interface RequestEventMatcher {
title: (request: Hapi.Request, event: Hapi.RequestEvent, tags: Tags) => string
body: (request: Hapi.Request, event: Hapi.RequestEvent, tags: Tags) => string
assignees?: string[]
milestone?: number
labels?: string[]
predicate: (
request: Hapi.Request,
event: Hapi.RequestEvent,
tags: Tags
) => boolean
}
/**
* @public
*/
export interface Options {
owner?: string // TODO: is there a github environment variable for the repository owner?
repo?: string // TODO: is there a github environment variable for the repository?
request_event_matchers?: RequestEventMatcher[]
token?: GiHubToken
}