refactor: move and rename the interfaces/classes (#290)

closes #272
This commit is contained in:
Geoffrey Testelin
2021-02-13 12:09:37 +01:00
committed by GitHub
parent 9d6f46564a
commit e96f31f877
16 changed files with 282 additions and 275 deletions

View File

@@ -0,0 +1,5 @@
import {IUser} from './user';
export interface IComment {
user: IUser;
}

View File

@@ -0,0 +1,7 @@
import {ILabel} from './label';
export interface IIssueEvent {
created_at: string;
event: string;
label: ILabel;
}

View File

@@ -1,5 +1,5 @@
import {Label} from '../IssueProcessor';
import {IsoDateString} from '../types/iso-date-string';
import {ILabel} from './label';
import {IMilestone} from './milestone';
export interface IIssue {
@@ -7,7 +7,7 @@ export interface IIssue {
number: number;
created_at: IsoDateString;
updated_at: IsoDateString;
labels: Label[];
labels: ILabel[];
pull_request: Object | null | undefined;
state: string;
locked: boolean;

View File

@@ -0,0 +1,33 @@
import {IsoOrRfcDateString} from '../types/iso-or-rfc-date-string';
export interface IIssuesProcessorOptions {
repoToken: string;
staleIssueMessage: string;
stalePrMessage: string;
closeIssueMessage: string;
closePrMessage: string;
daysBeforeStale: number;
daysBeforeIssueStale: number; // Could be NaN
daysBeforePrStale: number; // Could be NaN
daysBeforeClose: number;
daysBeforeIssueClose: number; // Could be NaN
daysBeforePrClose: number; // Could be NaN
staleIssueLabel: string;
closeIssueLabel: string;
exemptIssueLabels: string;
stalePrLabel: string;
closePrLabel: string;
exemptPrLabels: string;
onlyLabels: string;
operationsPerRun: number;
removeStaleWhenUpdated: boolean;
debugOnly: boolean;
ascending: boolean;
skipStaleIssueMessage: boolean;
skipStalePrMessage: boolean;
deleteBranch: boolean;
startDate: IsoOrRfcDateString | undefined; // Should be ISO 8601 or RFC 2822
exemptMilestones: string;
exemptIssueMilestones: string;
exemptPrMilestones: string;
}

3
src/interfaces/label.ts Normal file
View File

@@ -0,0 +1,3 @@
export interface ILabel {
name: string;
}

View File

@@ -0,0 +1,6 @@
export interface IPullRequest {
number: number;
head: {
ref: string;
};
}

4
src/interfaces/user.ts Normal file
View File

@@ -0,0 +1,4 @@
export interface IUser {
type: string;
login: string;
}