parent
edc52ebffd
commit
554080d193
@ -1,11 +1,13 @@ |
|||||||
"use strict"; |
"use strict"; |
||||||
|
|
||||||
|
import * as express from "express"; |
||||||
|
|
||||||
import artifact from "./artifact"; |
import artifact from "./artifact"; |
||||||
import * as manual from "./manual"; |
import * as manual from "./manual"; |
||||||
import postreceive from "./postreceive"; |
import postreceive from "./postreceive"; |
||||||
import release from "./release"; |
import release from "./release"; |
||||||
import * as status from "./status"; |
import * as status from "./status"; |
||||||
|
|
||||||
const index = (req, res) => res.render("index", { title: `Express<br/>\r\n${req}` }); |
const index: express.RequestHandler = (req, res) => res.render("index", { title: `Express<br/>\r\n${req}` }); |
||||||
|
|
||||||
export { index, postreceive, manual, status, artifact, release }; |
export { index, postreceive, manual, status, artifact, release }; |
||||||
|
@ -0,0 +1,50 @@ |
|||||||
|
interface IOwnerInfo { |
||||||
|
readonly name: string; |
||||||
|
readonly login: string; |
||||||
|
} |
||||||
|
|
||||||
|
interface IRepositoryInfo { |
||||||
|
readonly owner: IOwnerInfo; |
||||||
|
readonly name: string; |
||||||
|
readonly url: string; |
||||||
|
} |
||||||
|
|
||||||
|
interface ITargetInfo { |
||||||
|
readonly repo: IRepositoryInfo; |
||||||
|
readonly ref: string; |
||||||
|
readonly sha: string; |
||||||
|
} |
||||||
|
|
||||||
|
interface IPullRequestInfo { |
||||||
|
readonly head: ITargetInfo; |
||||||
|
readonly base: ITargetInfo; |
||||||
|
readonly merged: boolean; |
||||||
|
} |
||||||
|
|
||||||
|
export interface IHookPushPayload { |
||||||
|
readonly repository: IRepositoryInfo; |
||||||
|
readonly ref: string; |
||||||
|
readonly after: string; |
||||||
|
} |
||||||
|
|
||||||
|
export interface IHookPullRequestPayload { |
||||||
|
readonly action: "opened" | "reopened" | "closed" | "synchronize" | "other-unsupported-actions"; |
||||||
|
readonly number: number; |
||||||
|
readonly pull_request: IPullRequestInfo; |
||||||
|
} |
||||||
|
|
||||||
|
interface IHookPushParameters { |
||||||
|
readonly eventType: "push"; |
||||||
|
readonly payload: IHookPushPayload; |
||||||
|
} |
||||||
|
|
||||||
|
interface IHookPullRequestParameters { |
||||||
|
readonly eventType: "pull_request"; |
||||||
|
readonly payload: IHookPullRequestPayload; |
||||||
|
} |
||||||
|
|
||||||
|
interface IHookUnsupportedRequestParameters { |
||||||
|
readonly eventType: "other-unsupported-events"; |
||||||
|
} |
||||||
|
|
||||||
|
export type HookParameters = IHookPushParameters | IHookPullRequestParameters | IHookUnsupportedRequestParameters; |
@ -1,66 +1,66 @@ |
|||||||
import * as Github from "github"; |
import * as Github from "github"; |
||||||
|
|
||||||
interface IBuilderSettings { |
interface IBuilderSettings { |
||||||
builderExecutable: string; |
readonly builderExecutable: string; |
||||||
} |
} |
||||||
|
|
||||||
interface ICodeAnalysisSettingsUnsupported { |
interface ICodeAnalysisSettingsUnsupported { |
||||||
isCodeAnalysisUnsupported: true; |
readonly isCodeAnalysisUnsupported: true; |
||||||
} |
} |
||||||
|
|
||||||
interface ICodeAnalysisSettingsSupported { |
interface ICodeAnalysisSettingsSupported { |
||||||
eslintBrowserConfig: string; |
readonly eslintBrowserConfig: string; |
||||||
ignoreCodeAnalysisByDefault: boolean; |
readonly ignoreCodeAnalysisByDefault: boolean; |
||||||
isCodeAnalysisUnsupported: false; |
readonly isCodeAnalysisUnsupported: false; |
||||||
} |
} |
||||||
|
|
||||||
type CodeAnalysisSettings = ICodeAnalysisSettingsUnsupported | ICodeAnalysisSettingsSupported; |
type CodeAnalysisSettings = ICodeAnalysisSettingsUnsupported | ICodeAnalysisSettingsSupported; |
||||||
|
|
||||||
interface ICodeSigningSettingsUnsupported { |
interface ICodeSigningSettingsUnsupported { |
||||||
skipCodeSigning: true; |
readonly skipCodeSigning: true; |
||||||
} |
} |
||||||
|
|
||||||
interface ICodeSigningSettingsSupported { |
interface ICodeSigningSettingsSupported { |
||||||
codeSigningKeyFile: string; |
readonly codeSigningKeyFile: string; |
||||||
codeSigningPublicKey: string; |
readonly codeSigningPublicKey: string; |
||||||
skipCodeSigning: false; |
readonly skipCodeSigning: false; |
||||||
} |
} |
||||||
|
|
||||||
type CodeSigningSettings = ICodeSigningSettingsUnsupported | ICodeSigningSettingsSupported; |
type CodeSigningSettings = ICodeSigningSettingsUnsupported | ICodeSigningSettingsSupported; |
||||||
|
|
||||||
interface IStorageSettings { |
interface IStorageSettings { |
||||||
gitpath: string; |
readonly gitpath: string; |
||||||
releasepath: string; |
readonly releasepath: string; |
||||||
tmpcodepath: string; |
readonly tmpcodepath: string; |
||||||
} |
} |
||||||
|
|
||||||
interface INugetSettings { |
interface INugetSettings { |
||||||
nugetApiKey: string; |
readonly nugetApiKey: string; |
||||||
nugetHost: string; |
readonly nugetHost: string; |
||||||
} |
} |
||||||
|
|
||||||
interface ISmtpSettings { |
interface ISmtpSettings { |
||||||
smtp: { |
readonly smtp: { |
||||||
auth: { |
readonly auth: { |
||||||
pass: string; |
readonly pass: string; |
||||||
user: string; |
readonly user: string; |
||||||
}, |
}, |
||||||
host: string; |
readonly host: string; |
||||||
receiver: string; |
readonly receiver: string; |
||||||
sender: string; |
readonly sender: string; |
||||||
}; |
}; |
||||||
} |
} |
||||||
|
|
||||||
interface ISiteSettings { |
interface ISiteSettings { |
||||||
port: number | string; |
readonly port: number | string; |
||||||
siteRoot: string; |
readonly siteRoot: string; |
||||||
viewspath: string; |
readonly viewspath: string; |
||||||
faviconpath: string; |
readonly faviconpath: string; |
||||||
staticcontentpath: string; |
readonly staticcontentpath: string; |
||||||
} |
} |
||||||
|
|
||||||
interface IGithubSettings { |
interface IGithubSettings { |
||||||
createGithub: (repoOwner: string) => Github; |
readonly createGithub: (repoOwner: string) => Github; |
||||||
} |
} |
||||||
|
|
||||||
export type Settings = IBuilderSettings & CodeAnalysisSettings & CodeSigningSettings & IStorageSettings & INugetSettings & ISmtpSettings & ISiteSettings & IGithubSettings; |
export type Settings = IBuilderSettings & CodeAnalysisSettings & CodeSigningSettings & IStorageSettings & INugetSettings & ISmtpSettings & ISiteSettings & IGithubSettings; |
||||||
|
Loading…
Reference in new issue