forked from bryanmacfarlane/project-reports-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterfaces.ts
102 lines (86 loc) · 2.24 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import {GitHubClient} from './github'
import {IssueList, ProjectIssue} from './project-reports-lib'
export interface GeneratorConfiguration {
name: string
// can be inlined or provide a relative path to another file
targets: string | CrawlingConfig
filter: string
output: string
processing: ProcessingSection[]
reports: ReportConfig[]
}
export interface CrawlingTarget {
type: 'project' | 'repo'
htmlUrl: string
columnMap: {[key: string]: string[]}
// only needed for type project
projectId?: number
stages: boolean
}
export type CrawlingConfig = {[name: string]: CrawlingTarget}
export interface ProcessingSection {
name: string
target: string
config: any
}
export interface ReportConfig {
name: string
title: string
kind: 'markdown' | ''
timezoneOffset: number
targets: string[]
sections: ReportSection[]
details: ReportDetails
}
export interface ReportSection {
name: string
targets: string[]
config: any
}
export interface ReportDetails {
time: string
fullPath: string
rootPath: string
dataPath: string
}
export interface ReportSnapshotData {
name: string
contents: string
}
export interface ReportSnapshot {
datetime: Date
datetimeString: string
rootPath: string
config: GeneratorConfiguration
}
export interface ProjectData {
id: number
html_url: string
name: string
// TODO: should go away in favor of DistinctSet
// stages: { [key: string]: ProjectIssue[] }
}
export interface IssueParameters {
state: string
milestone: string
labels: string
}
export interface RuntimeModule {
getDefaultConfiguration(): any
}
// process a list of issues from a target
export interface ProjectProcessor extends RuntimeModule {
targetType: 'project' | 'repo' | 'any'
// async
process(target: CrawlingTarget, config: any, data: IssueList, github: GitHubClient): Promise<void>
}
export interface ProjectReportBuilder extends RuntimeModule {
reportType: 'project' | 'repo' | 'any'
// a report accepts project data (and it's stages) or a list of issues from a repo (and it's stages)
process(
config: any,
data: IssueList,
drillIn: (identifier: string, title: string, cards: ProjectIssue[]) => void
): any
renderMarkdown(targets: CrawlingTarget[], processedData?: any): string
}