-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.d.ts
79 lines (79 loc) · 5.16 KB
/
index.d.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
import * as buildApi from "azure-devops-node-api/BuildApi";
import * as buildInterfaces from "azure-devops-node-api/interfaces/BuildInterfaces";
import * as testInterfaces from "azure-devops-node-api/interfaces/TestInterfaces";
import * as testApi from "azure-devops-node-api/TestApi";
import * as taskAgentApi from "azure-devops-node-api/TaskAgentApi";
import * as coreApi from "azure-devops-node-api/CoreApi";
import * as baseInterfaces from "azure-devops-node-api/interfaces/common/VsoBaseInterfaces";
import { IRequestHandler } from "typed-rest-client/Interfaces";
import common = require("./generalfunctions");
export declare const TeamFoundationCollectionUri: string;
export declare const TeamProject: string;
export declare const TeamProjectId: string;
export declare const RequestedForUsername: string;
export declare const RequestedForUserId: string;
export declare const ReleaseRequestedForUsername: string;
export declare const ReleaseRequestedForId: string;
export declare const SourceVersion: string;
export declare const SourceBranch: string;
export declare const CurrentBuildDefinition: string;
export declare const OAuthAccessToken: string;
export declare const RepositoryType: string;
export declare const TfsRepositoryType: string;
export declare const AuthenticationMethodOAuthToken: string;
export declare const AuthenticationMethodBasicAuthentication: string;
export declare const AuthenticationMethodPersonalAccessToken: string;
export interface ITfsRestService {
initialize(authenticationMethod: string, username: string, password: string, tfsServer: string, teamProject: string, ignoreSslError: boolean): Promise<void>;
getBuildsByStatus(buildDefinitionName: string, statusFilter?: buildInterfaces.BuildStatus): Promise<buildInterfaces.Build[]>;
triggerBuild(buildDefinitionName: string, branch: string, requestedFor: string, sourceVersion: string, demands: string[], queueId: number, buildParameters: string, templateParameters: string): Promise<buildInterfaces.Build>;
downloadArtifacts(buildId: number, downloadDirectory: string): Promise<void>;
getQueueIdByName(buildQueue: string): Promise<number>;
getBuildInfo(buildId: number): Promise<buildInterfaces.Build>;
areBuildsFinished(triggeredBuilds: number[], failIfNotSuccessful: boolean, failIfPartiallySucceeded: boolean): Promise<boolean>;
isBuildFinished(buildId: number): Promise<boolean>;
wasBuildSuccessful(buildId: number): Promise<boolean>;
getBuildDefinitionId(buildDefinitionName: string): Promise<number>;
getTestRuns(testRunName: string, numberOfRunsToFetch: number): Promise<testInterfaces.TestRun[]>;
getAssociatedChanges(build: buildInterfaces.Build): Promise<buildInterfaces.Change[]>;
cancelBuild(buildId: number): Promise<void>;
}
export interface IAzureDevOpsWebApi {
getBearerHandler(bearerToken: string): IRequestHandler;
getBasicHandler(username: string, password: string): IRequestHandler;
getHandlerFromToken(token: string): IRequestHandler;
initializeConnection(tfsServer: string, authHandler: IRequestHandler, requestOptions: baseInterfaces.IRequestOptions): void;
getBuildApi(): Promise<buildApi.IBuildApi>;
getTestApi(): Promise<testApi.ITestApi>;
getTaskAgentApi(): Promise<taskAgentApi.ITaskAgentApi>;
getCoreApi(): Promise<coreApi.ICoreApi>;
}
export declare class TfsRestService implements ITfsRestService {
vstsBuildApi: buildApi.IBuildApi;
vstsTestApi: testApi.ITestApi;
taskAgentApi: taskAgentApi.ITaskAgentApi;
teamProjectId: string;
azureDevOpsWebApi: IAzureDevOpsWebApi;
genralFunctions: common.IGeneralFunctions;
constructor(azureDevOpsWebApi?: IAzureDevOpsWebApi, generalFunctions?: common.IGeneralFunctions);
initialize(authenticationMethod: string, username: string, password: string, tfsServer: string, teamProject: string, ignoreSslError: boolean): Promise<void>;
getBuildsByStatus(buildDefinitionName: string, statusFilter?: buildInterfaces.BuildStatus): Promise<buildInterfaces.Build[]>;
triggerBuild(buildDefinitionName: string, branch: string, requestedForUserID: string, sourceVersion: string, demands: string[], queueId: number, buildParameters: string, templateParameters: string): Promise<buildInterfaces.Build>;
areBuildsFinished(triggeredBuilds: number[], failIfNotSuccessful: boolean, treatPartiallySucceededBuildAsSuccessful: boolean): Promise<boolean>;
cancelBuild(buildId: number): Promise<void>;
downloadArtifacts(buildId: number, downloadDirectory: string): Promise<void>;
getTestRuns(testRunName: string, numberOfRunsToFetch: number): Promise<testInterfaces.TestRun[]>;
getQueueIdByName(buildQueue: string): Promise<number>;
isBuildFinished(buildId: number): Promise<boolean>;
wasBuildSuccessful(buildId: number): Promise<boolean>;
getBuildDefinitionId(buildDefinitionName: string): Promise<number>;
getAssociatedChanges(build: buildInterfaces.Build): Promise<buildInterfaces.Change[]>;
getBuildInfo(buildId: number): Promise<buildInterfaces.Build>;
private parseParameterString;
private createBuildParameterObject;
private updateCurlyBracesStack;
private cleanValue;
private setTeamProjectId;
private verifyAuthenticationMethod;
private makeRequest;
}