UNPKG

teamcity-service-messages

Version:
157 lines (156 loc) 5.32 kB
import { Message as MessageClass } from './message'; declare class ServiceMessages { Message: typeof MessageClass; get stdout(): boolean; set stdout(value: boolean); get autoFlowId(): boolean; set autoFlowId(value: boolean); /** * Build a message and either print it (chainable API) or return the string, * depending on `stdout`. The chainable return type is preserved for the * common (stdout enabled) case; when stdout is disabled the generated string * is returned at runtime instead. */ private emit; blockClosed(args: tsm.BlockClosedArgs): this; blockOpened(args: tsm.BlockOpenedArgs): this; buildNumber(number: string | number): this; buildProblem(args: tsm.BuildProblemArgs): this; buildStatisticValue(args: tsm.BuildStatisticValueArgs): this; buildStatus(args: tsm.BuildStatusArgs): this; compilationFinished(args: tsm.CompilationArgs): this; compilationStarted(args: tsm.CompilationArgs): this; disableServiceMessages(): this; enableServiceMessages(): this; importData(args: tsm.ImportDataArgs | tsm.ImportFindBugsDataArgs | tsm.ImportDotNetCoverageDataArgs): this; inspectionType(args: tsm.InspectionTypeArgs): this; inspection(args: tsm.InspectionArgs): this; message(args: tsm.MessageArgs | tsm.ErrorMessageArgs): this; progressFinish(message: string): this; progressMessage(message: string): this; progressStart(message: string): this; publishArtifacts(path: string): this; setParameter(args: tsm.SetParameterArgs): this; testFailed(args: tsm.TestFailedArgs | tsm.TestComparisonFailureArgs): this; testFinished(args: tsm.TestFinishedArgs): this; testIgnored(args: tsm.TestIgnoredArgs): this; testMetadata(args: tsm.NumberTestMetadataArgs | tsm.StringTestMetadataArgs): this; testStarted(args: tsm.TestStartedArgs): this; testStdErr(args: tsm.TestStdOutArgs): this; testStdOut(args: tsm.TestStdOutArgs): this; testSuiteFinished(args: tsm.TestSuiteArgs): this; testSuiteStarted(args: tsm.TestSuiteArgs): this; } declare const tsm: ServiceMessages; declare namespace tsm { interface Args { timestamp?: string; flowId?: string; } interface BlockClosedArgs extends Args { name: string; description?: string; } interface BlockOpenedArgs extends Args { name: string; description?: string; } interface BuildProblemArgs extends Args { description: string; identity?: string; } interface BuildStatisticValueArgs extends Args { key: string; value: number; } interface BuildStatusArgs extends Args { status?: 'SUCCESS' | 'FAILURE'; text: string; } interface CompilationArgs extends Args { compiler: string; } interface ImportDataArgs extends Args { type: 'junit' | 'surefire' | 'nunit' | 'mstest' | 'vstest' | 'gtest' | 'intellij-inspections' | 'checkstyle' | 'jslint' | 'FxCop1' | 'pmd' | 'pmdCpd' | 'DotNetDupFinder'; path: string; } interface ImportFindBugsDataArgs extends Args { type: 'findBugs'; path: string; findBugsHome: string; } interface ImportDotNetCoverageDataArgs extends Args { type: 'dotNetCoverage'; path: string; tool: 'dotcover' | 'partcover' | 'ncover' | 'ncover3'; } interface InspectionTypeArgs extends Args { id: string; name: string; category: string; description: string; } interface InspectionArgs extends Args { typeId: string; message?: string; file: string; line?: string; SEVERITY?: 'INFO' | 'ERROR' | 'WARNING' | 'WEAK WARNING'; [key: string]: unknown; } interface MessageArgs extends Args { text: string; status?: 'NORMAL' | 'WARNING' | 'FAILURE'; } interface ErrorMessageArgs extends Args { text: string; status: 'ERROR'; errorDetails?: string; } interface SetParameterArgs extends Args { name: string; value: string | number | boolean; } interface TestFailedArgs extends Args { name: string; message?: string; details?: string; } interface TestComparisonFailureArgs extends TestFailedArgs { type: 'comparisonFailure'; expected: unknown; actual: unknown; } interface TestFinishedArgs extends Args { name: string; duration?: number; } interface TestIgnoredArgs extends Args { name: string; message?: string; } interface TestMetadataArgs extends Args { name?: string; testName?: string; } interface NumberTestMetadataArgs extends TestMetadataArgs { type: 'number'; value: number; } interface StringTestMetadataArgs extends TestMetadataArgs { type?: 'text' | 'link' | 'artifact' | 'image' | 'video'; value: string; } interface TestStartedArgs extends Args { name: string; captureStandardOutput?: boolean; } interface TestStdOutArgs extends Args { name: string; out: string; } interface TestSuiteArgs extends Args { name: string; } } export = tsm;