diff --git a/.vscodeignore b/.vscodeignore index 93b146c6bd..593412c7f1 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -13,4 +13,5 @@ gulpfile.js tsd.json tslint.json team-extension.log -**/*.zip \ No newline at end of file +**/*.zip +.taskkey \ No newline at end of file diff --git a/package.json b/package.json index d3a4697841..3d011a20a2 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "team", "displayName": "Visual Studio Team Services", "description": "Connect to Team Services, monitor your builds and manage your pull requests and work items for your Git repositories", - "version": "1.104.1", + "version": "1.108.0", "publisher": "ms-vsts", "icon": "assets/team.png", "markdown": "standard", @@ -130,7 +130,7 @@ "mocha-junit-reporter": "^1.12.0", "should": "^8.1.1", "tslint": "^2.5.0", - "typescript": "^1.7.5", + "typescript": "^1.8.10", "vscode": "^0.11.x", "vsts-task-lib": "^0.9.18", "yargs": "^5.0.0" @@ -148,7 +148,7 @@ "readable-stream": "^2.1.4", "underscore": "^1.8.3", "url": "^0.11.0", - "vso-node-api": "^3.1.1", + "vso-node-api": "^5.1.1", "winston": "^2.1.1" } } diff --git a/src/clients/buildclient.ts b/src/clients/buildclient.ts index 2dc8eab1fc..0106a9f58f 100644 --- a/src/clients/buildclient.ts +++ b/src/clients/buildclient.ts @@ -5,7 +5,7 @@ "use strict"; import { StatusBarItem } from "vscode"; -import { BuildResult, BuildStatus } from "vso-node-api/interfaces/BuildInterfaces"; +import { Build, BuildBadge, BuildResult, BuildStatus } from "vso-node-api/interfaces/BuildInterfaces"; import { BaseClient } from "./baseclient"; import { Logger } from "../helpers/logger"; import { BuildService } from "../services/build"; @@ -17,10 +17,6 @@ import { VsCodeUtils } from "../helpers/vscodeutils"; import { TelemetryService } from "../services/telemetry"; import { GitContext } from "../contexts/gitcontext"; -/* tslint:disable:no-unused-variable */ -import Q = require("q"); -/* tslint:enable:no-unused-variable */ - export class BuildClient extends BaseClient { private _serverContext: TeamServerContext; private _statusBarItem: StatusBarItem; @@ -34,27 +30,24 @@ export class BuildClient extends BaseClient { } //Gets any available build status information and adds it to the status bar - public DisplayCurrentBranchBuildStatus(context: GitContext, polling: boolean): void { - let svc: BuildService = new BuildService(this._serverContext); - - Logger.LogInfo("Getting current build from badge..."); - svc.GetBuildBadge(this._serverContext.RepoInfo.TeamProject, WellKnownRepositoryTypes.TfsGit, this._serverContext.RepoInfo.RepositoryId, context.CurrentRef).then((buildBadge) => { + public async DisplayCurrentBranchBuildStatus(context: GitContext, polling: boolean): Promise { + try { + let svc: BuildService = new BuildService(this._serverContext); + Logger.LogInfo("Getting current build from badge..."); + let buildBadge: BuildBadge = await svc.GetBuildBadge(this._serverContext.RepoInfo.TeamProject, WellKnownRepositoryTypes.TfsGit, this._serverContext.RepoInfo.RepositoryId, context.CurrentRef); if (buildBadge.buildId !== undefined) { Logger.LogInfo("Found build id " + buildBadge.buildId.toString() + ". Getting build details..."); - svc.GetBuildById(buildBadge.buildId).then((build) => { - this._buildSummaryUrl = BuildService.GetBuildSummaryUrl(this._serverContext.RepoInfo.TeamProjectUrl, build.id.toString()); - Logger.LogInfo("Build summary info: " + build.id.toString() + " " + BuildStatus[build.status] + - " " + BuildResult[build.result] + " " + this._buildSummaryUrl); + let build: Build = await svc.GetBuildById(buildBadge.buildId); + this._buildSummaryUrl = BuildService.GetBuildSummaryUrl(this._serverContext.RepoInfo.TeamProjectUrl, build.id.toString()); + Logger.LogInfo("Build summary info: " + build.id.toString() + " " + BuildStatus[build.status] + + " " + BuildResult[build.result] + " " + this._buildSummaryUrl); - if (this._statusBarItem !== undefined) { - let icon: string = Utils.GetBuildResultIcon(build.result); - this._statusBarItem.command = CommandNames.OpenBuildSummaryPage; - this._statusBarItem.text = `$(icon octicon-package) ` + `$(icon ${icon})`; - this._statusBarItem.tooltip = "(" + BuildResult[build.result] + ") " + Strings.NavigateToBuildSummary + " " + build.buildNumber; - } - }).fail((reason) => { - this.handleError(reason, polling, "Failed to get build details by id"); - }); + if (this._statusBarItem !== undefined) { + let icon: string = Utils.GetBuildResultIcon(build.result); + this._statusBarItem.command = CommandNames.OpenBuildSummaryPage; + this._statusBarItem.text = `$(icon octicon-package) ` + `$(icon ${icon})`; + this._statusBarItem.tooltip = "(" + BuildResult[build.result] + ") " + Strings.NavigateToBuildSummary + " " + build.buildNumber; + } } else { Logger.LogInfo("No builds were found for team " + this._serverContext.RepoInfo.TeamProject.toString() + ", repo type git, " + "repo id " + this._serverContext.RepoInfo.RepositoryId.toString() + ", + branch " + (context.CurrentBranch === null ? "UNKNOWN" : context.CurrentBranch.toString())); @@ -64,9 +57,9 @@ export class BuildClient extends BaseClient { this._statusBarItem.tooltip = Strings.NoBuildsFound; } } - }).fail((reason) => { - this.handleError(reason, polling, "Failed to get current branch build status"); - }); + } catch (err) { + this.handleError(err, polling, "Failed to get current branch build status"); + } } public OpenBuildSummaryPage(): void { diff --git a/src/clients/feedbackclient.ts b/src/clients/feedbackclient.ts index 039930d60a..1a50c63f4c 100644 --- a/src/clients/feedbackclient.ts +++ b/src/clients/feedbackclient.ts @@ -24,46 +24,40 @@ export class FeedbackClient extends BaseClient { } //This feedback will go no matter whether Application Insights is enabled or not. - public SendFeedback(): void { - let self = this; - - let choices: Array = []; - choices.push({ label: Strings.SendASmile, description: undefined, id: TelemetryEvents.SendASmile }); - choices.push({ label: Strings.SendAFrown, description: undefined, id: TelemetryEvents.SendAFrown }); - - window.showQuickPick(choices, { matchOnDescription: false, placeHolder: Strings.SendFeedback }).then( - function (choice) { - if (choice) { - window.showInputBox({ value: undefined, prompt: Strings.SendFeedbackPrompt, placeHolder: undefined, password: false }).then((value) => { - if (value === undefined) { - let disposable = window.setStatusBarMessage(Strings.NoFeedbackSent); - setInterval(() => disposable.dispose(), 1000 * 5); - return; - } - - //User does not need to provide any feedback text - let providedEmail: string = ""; - window.showInputBox({ value: undefined, prompt: Strings.SendEmailPrompt, placeHolder: undefined, password: false }).then((email) => { - if (email === undefined) { - let disposable = window.setStatusBarMessage(Strings.NoFeedbackSent); - setInterval(() => disposable.dispose(), 1000 * 5); - return; - } - if (email) { - providedEmail = email; - } - //This feedback will go no matter whether Application Insights is enabled or not. - self.ReportFeedback(choice.id, { "VSCode.Feedback.Comment" : value, "VSCode.Feedback.Email" : providedEmail} ); + public async SendFeedback(): Promise { + try { + let choices: BaseQuickPickItem[] = []; + choices.push({ label: Strings.SendASmile, description: undefined, id: TelemetryEvents.SendASmile }); + choices.push({ label: Strings.SendAFrown, description: undefined, id: TelemetryEvents.SendAFrown }); + + let choice: BaseQuickPickItem = await window.showQuickPick(choices, { matchOnDescription: false, placeHolder: Strings.SendFeedback }); + if (choice) { + let value: string = await window.showInputBox({ value: undefined, prompt: Strings.SendFeedbackPrompt, placeHolder: undefined, password: false }); + if (value === undefined) { + let disposable = window.setStatusBarMessage(Strings.NoFeedbackSent); + setInterval(() => disposable.dispose(), 1000 * 5); + return; + } - let disposable = window.setStatusBarMessage(Strings.ThanksForFeedback); - setInterval(() => disposable.dispose(), 1000 * 5); - }); - }); + //User does not need to provide any feedback text + let providedEmail: string = ""; + let email: string = await window.showInputBox({ value: undefined, prompt: Strings.SendEmailPrompt, placeHolder: undefined, password: false }); + if (email === undefined) { + let disposable = window.setStatusBarMessage(Strings.NoFeedbackSent); + setInterval(() => disposable.dispose(), 1000 * 5); + return; + } + if (email) { + providedEmail = email; } - }, - function (err) { - self.ReportError(Utils.GetMessageForStatusCode(0, err.message, "Failed getting SendFeedback selection")); + //This feedback will go no matter whether Application Insights is enabled or not. + this.ReportFeedback(choice.id, { "VSCode.Feedback.Comment" : value, "VSCode.Feedback.Email" : providedEmail} ); + + let disposable = window.setStatusBarMessage(Strings.ThanksForFeedback); + setInterval(() => disposable.dispose(), 1000 * 5); } - ); + } catch (err) { + this.ReportError(Utils.GetMessageForStatusCode(0, err.message, "Failed getting SendFeedback selection")); + } } } diff --git a/src/clients/gitclient.ts b/src/clients/gitclient.ts index 9ab33f999c..709ea66a80 100644 --- a/src/clients/gitclient.ts +++ b/src/clients/gitclient.ts @@ -5,7 +5,7 @@ "use strict"; import { StatusBarItem, window } from "vscode"; -import { PullRequestStatus} from "vso-node-api/interfaces/GitInterfaces"; +import { GitPullRequest, PullRequestStatus} from "vso-node-api/interfaces/GitInterfaces"; import { BaseClient } from "./baseclient"; import { BaseQuickPickItem, VsCodeUtils } from "../helpers/vscodeutils"; import { CommandNames, TelemetryEvents } from "../helpers/constants"; @@ -17,10 +17,6 @@ import { TeamServerContext} from "../contexts/servercontext"; import { TelemetryService } from "../services/telemetry"; import { GitVcService, PullRequestScore } from "../services/gitvc"; -/* tslint:disable:no-unused-variable */ -import Q = require("q"); -/* tslint:enable:no-unused-variable */ - var path = require("path"); export class GitClient extends BaseClient { @@ -43,29 +39,25 @@ export class GitClient extends BaseClient { } //Initial method to display, select and navigate to my pull requests - public GetMyPullRequests(): void { - let self = this; + public async GetMyPullRequests(): Promise { this.ReportEvent(TelemetryEvents.ViewPullRequests); - window.showQuickPick(this.getMyPullRequests(false), { matchOnDescription: true, placeHolder: Strings.ChoosePullRequest }).then( - function (request) { - if (request) { - self.ReportEvent(TelemetryEvents.ViewPullRequest); - let discUrl: string = undefined; - if (request.id !== undefined) { - discUrl = GitVcService.GetPullRequestDiscussionUrl(self._serverContext.RepoInfo.RepositoryUrl, request.id); - } else { - discUrl = GitVcService.GetPullRequestsUrl(self._serverContext.RepoInfo.RepositoryUrl); - } - Logger.LogInfo("Pull Request Url: " + discUrl); - Utils.OpenUrl(discUrl); + try { + let request: BaseQuickPickItem = await window.showQuickPick(this.getMyPullRequests(), { matchOnDescription: true, placeHolder: Strings.ChoosePullRequest }); + if (request) { + this.ReportEvent(TelemetryEvents.ViewPullRequest); + let discUrl: string = undefined; + if (request.id !== undefined) { + discUrl = GitVcService.GetPullRequestDiscussionUrl(this._serverContext.RepoInfo.RepositoryUrl, request.id); + } else { + discUrl = GitVcService.GetPullRequestsUrl(this._serverContext.RepoInfo.RepositoryUrl); } - }, - function (err) { - let msg: string = Utils.GetMessageForStatusCode(0, err.message, "Error selecting pull request from QuickPick"); - self.ReportError(msg); + Logger.LogInfo("Pull Request Url: " + discUrl); + Utils.OpenUrl(discUrl); } - ); + } catch (err) { + this.handleError(err, "Error selecting pull request from QuickPick"); + } } //Opens the blame page for the currently active file @@ -132,65 +124,52 @@ export class GitClient extends BaseClient { Utils.OpenUrl(url); } - public PollMyPullRequests(): void { - this.getMyPullRequests(true).then((requests) => { + public async PollMyPullRequests(): Promise { + try { + let requests: BaseQuickPickItem[] = await this.getMyPullRequests(); this._statusBarItem.tooltip = Strings.BrowseYourPullRequests; //Remove the default Strings.BrowseYourPullRequests item from the calculation this._statusBarItem.text = GitClient.GetPullRequestStatusText(requests.length - 1); - }).catch((reason) => { - //Nothing to do - }); + } catch (err) { + this.handleError(err, "Attempting to poll my pull requests", true); + } } - private getMyPullRequests(polling: boolean): Q.Promise> { - let requestItems: Array = []; - let requestIds: Array = []; - - let promiseToReturn: Q.Promise>; - let deferred = Q.defer>(); - promiseToReturn = deferred.promise; + private async getMyPullRequests(): Promise { + let requestItems: BaseQuickPickItem[] = []; + let requestIds: number[] = []; Logger.LogInfo("Getting pull requests that I requested..."); let svc: GitVcService = new GitVcService(this._serverContext); - svc.GetPullRequests(this._serverContext.RepoInfo.RepositoryId, this._serverContext.UserInfo.Id, undefined, PullRequestStatus.Active).then((myPullRequests) => { - let icon: string = "octicon-search"; - let label: string = `$(icon ${icon}) `; - requestItems.push({ label: label + Strings.BrowseYourPullRequests, description: undefined, id: undefined }); - - myPullRequests.forEach(pr => { - let score: PullRequestScore = GitVcService.GetPullRequestScore(pr); + let myPullRequests: GitPullRequest[] = await svc.GetPullRequests(this._serverContext.RepoInfo.RepositoryId, this._serverContext.UserInfo.Id, undefined, PullRequestStatus.Active); + let icon: string = "octicon-search"; + let label: string = `$(icon ${icon}) `; + requestItems.push({ label: label + Strings.BrowseYourPullRequests, description: undefined, id: undefined }); + + myPullRequests.forEach(pr => { + let score: PullRequestScore = GitVcService.GetPullRequestScore(pr); + requestItems.push(this.getPullRequestLabel(pr.createdBy.displayName, pr.title, pr.description, pr.pullRequestId.toString(), score)); + requestIds.push(pr.pullRequestId); + }); + Logger.LogInfo("Retrieved " + myPullRequests.length + " pull requests that I requested"); + + Logger.LogInfo("Getting pull requests for which I'm a reviewer..."); + //Go get the active pull requests that I'm a reviewer for + let myReviewPullRequests: GitPullRequest[] = await svc.GetPullRequests(this._serverContext.RepoInfo.RepositoryId, undefined, this._serverContext.UserInfo.Id, PullRequestStatus.Active); + myReviewPullRequests.forEach(pr => { + let score: PullRequestScore = GitVcService.GetPullRequestScore(pr); + if (requestIds.indexOf(pr.pullRequestId) < 0) { requestItems.push(this.getPullRequestLabel(pr.createdBy.displayName, pr.title, pr.description, pr.pullRequestId.toString(), score)); - requestIds.push(pr.pullRequestId); - }); - Logger.LogInfo("Retrieved " + myPullRequests.length + " pull requests that I requested"); - - Logger.LogInfo("Getting pull requests for which I'm a reviewer..."); - //Go get the active pull requests that I'm a reviewer for - svc.GetPullRequests(this._serverContext.RepoInfo.RepositoryId, undefined, this._serverContext.UserInfo.Id, PullRequestStatus.Active).then((myReviewPullRequests) => { - myReviewPullRequests.forEach(pr => { - let score: PullRequestScore = GitVcService.GetPullRequestScore(pr); - if (requestIds.indexOf(pr.pullRequestId) < 0) { - requestItems.push(this.getPullRequestLabel(pr.createdBy.displayName, pr.title, pr.description, pr.pullRequestId.toString(), score)); - } - }); - Logger.LogInfo("Retrieved " + myReviewPullRequests.length + " pull requests that I'm the reviewer"); - - //Remove the default Strings.BrowseYourPullRequests item from the calculation - this._statusBarItem.text = GitClient.GetPullRequestStatusText(requestItems.length - 1); - this._statusBarItem.tooltip = Strings.BrowseYourPullRequests; - this._statusBarItem.command = CommandNames.GetPullRequests; - - deferred.resolve(requestItems); - }).catch((reason) => { - this.handleError(reason, polling, "Attempting to get pull requests that I'm the reviewer"); - deferred.reject(reason); - }); - }).catch((reason) => { - this.handleError(reason, polling, "Attempting to get pull requests that I requested"); - deferred.reject(reason); + } }); + Logger.LogInfo("Retrieved " + myReviewPullRequests.length + " pull requests that I'm the reviewer"); + + //Remove the default Strings.BrowseYourPullRequests item from the calculation + this._statusBarItem.text = GitClient.GetPullRequestStatusText(requestItems.length - 1); + this._statusBarItem.tooltip = Strings.BrowseYourPullRequests; + this._statusBarItem.command = CommandNames.GetPullRequests; - return promiseToReturn; + return requestItems; } private getPullRequestLabel(displayName: string, title: string, description: string, id: string, score: PullRequestScore): BaseQuickPickItem { @@ -209,7 +188,7 @@ export class GitClient extends BaseClient { return { label: scoreLabel + " (" + displayName + ") " + title, description: description, id: id }; } - private handleError(reason: any, polling: boolean, infoMessage?: string) : void { + private handleError(reason: any, infoMessage?: string, polling?: boolean) : void { let offline: boolean = Utils.IsOffline(reason); let msg: string = Utils.GetMessageForStatusCode(reason, reason.message); let logPrefix: string = (infoMessage === undefined) ? "" : infoMessage + " "; diff --git a/src/clients/teamservicesclient.ts b/src/clients/teamservicesclient.ts index b1c7cb5334..d00cf69738 100644 --- a/src/clients/teamservicesclient.ts +++ b/src/clients/teamservicesclient.ts @@ -6,38 +6,23 @@ import basem = require("vso-node-api/ClientApiBases"); import VsoBaseInterfaces = require("vso-node-api/interfaces/common/VsoBaseInterfaces"); -import Q = require("q"); - -// This class is not exported since we want to enforce the use of the Q-based class -class TeamServicesApi extends basem.ClientApiBase { - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]) { - super(baseUrl, handlers, "node-vsts-vscode-api"); - } - - getVstsInfo(onResult: (err: any, statusCode: number, obj: any) => void): void { - this.restClient.getJson(this.vsoClient.resolveUrl("/vsts/info"), "", null, null, onResult); - } -} - -export class QTeamServicesApi extends basem.QClientApiBase { - api: TeamServicesApi; - +export class TeamServicesApi extends basem.ClientApiBase { constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]) { - super(baseUrl, handlers, TeamServicesApi); - } - - public getVstsInfo(): Q.Promise { - let defer: Q.Deferred<{}> = Q.defer(); - - this.api.getVstsInfo((err: any, statusCode: number, obj: any) => { - if (err) { - err.statusCode = statusCode; - defer.reject(err); - } else { - defer.resolve(obj); - } + super(baseUrl, handlers, "node-vsts-vscode-api"); + } + + public async getVstsInfo(): Promise { + //Create an instance of Promise since we're calling a function with the callback pattern but want to return a Promise + let promise: Promise = new Promise((resolve, reject) => { + this.restClient.getJson(this.vsoClient.resolveUrl("/vsts/info"), "", null, null, function(err: any, statusCode: number, obj: any) { + if (err) { + err.statusCode = statusCode; + reject(err); + } else { + resolve(obj); + } + }); }); - - return defer.promise; + return promise; } } diff --git a/src/clients/witclient.ts b/src/clients/witclient.ts index c84227c69b..a8f9cc69e3 100644 --- a/src/clients/witclient.ts +++ b/src/clients/witclient.ts @@ -5,9 +5,10 @@ "use strict"; import { StatusBarItem, window } from "vscode"; +import { QueryHierarchyItem, WorkItemType } from "vso-node-api/interfaces/WorkItemTrackingInterfaces"; import { BaseClient } from "./baseclient"; import { Logger } from "../helpers/logger"; -import { WorkItemTrackingService } from "../services/workitemtracking"; +import { SimpleWorkItem, WorkItemTrackingService } from "../services/workitemtracking"; import { TeamServerContext} from "../contexts/servercontext"; import { BaseQuickPickItem, VsCodeUtils, WorkItemQueryQuickPickItem } from "../helpers/vscodeutils"; import { CommandNames, TelemetryEvents, WitQueries, WitTypes } from "../helpers/constants"; @@ -16,8 +17,6 @@ import { Utils } from "../helpers/utils"; import { TelemetryService } from "../services/telemetry"; import { IPinnedQuery } from "../helpers/settings"; -import Q = require("q"); - export class WitClient extends BaseClient { private _serverContext: TeamServerContext; private _statusBarItem: StatusBarItem; @@ -42,206 +41,168 @@ export class WitClient extends BaseClient { } //Creates a new work item based on a single line of selected text - public CreateNewWorkItem(taskTitle: string): void { - let self = this; - this.ReportEvent(TelemetryEvents.OpenNewWorkItem); - - window.showQuickPick(this.getWorkItemTypes(), { matchOnDescription: true, placeHolder: Strings.ChooseWorkItemType }).then( - function (selectedType) { - if (selectedType) { - self.ReportEvent(TelemetryEvents.OpenNewWorkItem); - - Logger.LogInfo("Selected work item type is " + selectedType.label); - let newItemUrl: string = WorkItemTrackingService.GetNewWorkItemUrl(self._serverContext.RepoInfo.TeamProjectUrl, selectedType.label, taskTitle, self.getUserName(self._serverContext)); - Logger.LogInfo("New Work Item Url: " + newItemUrl); - Utils.OpenUrl(newItemUrl); - } - }, - function (err) { - self.handleError(err, "Error selecting work item type from QuickPick"); + public async CreateNewWorkItem(taskTitle: string): Promise { + try { + this.ReportEvent(TelemetryEvents.OpenNewWorkItem); + let selectedType: BaseQuickPickItem = await window.showQuickPick(await this.getWorkItemTypes(), { matchOnDescription: true, placeHolder: Strings.ChooseWorkItemType }); + if (selectedType) { + this.ReportEvent(TelemetryEvents.OpenNewWorkItem); + + Logger.LogInfo("Selected work item type is " + selectedType.label); + let newItemUrl: string = WorkItemTrackingService.GetNewWorkItemUrl(this._serverContext.RepoInfo.TeamProjectUrl, selectedType.label, taskTitle, this.getUserName(this._serverContext)); + Logger.LogInfo("New Work Item Url: " + newItemUrl); + Utils.OpenUrl(newItemUrl); } - ); + } catch (err) { + this.handleError(err, "Error creating new work item"); + } } //Navigates to a work item chosen from the results of a user-selected "My Queries" work item query //This method first displays the queries under "My Queries" and, when one is chosen, displays the associated work items. //If a work item is chosen, it is opened in the web browser. - public ShowMyWorkItemQueries(): void { - let self = this; - this.ReportEvent(TelemetryEvents.ShowMyWorkItemQueries); - - window.showQuickPick(this.getMyWorkItemQueries(), { matchOnDescription: false, placeHolder: Strings.ChooseWorkItemQuery }).then( - function (query) { - if (query) { - self.ReportEvent(TelemetryEvents.ViewWorkItems); - Logger.LogInfo("Selected query is " + query.label); - Logger.LogInfo("Getting work items for query..."); - - window.showQuickPick(self.getMyWorkItems(self._serverContext.RepoInfo.TeamProject, query.wiql), { matchOnDescription: true, placeHolder: Strings.ChooseWorkItem }).then( - function (workItem) { - if (workItem) { - let url: string = undefined; - if (workItem.id === undefined) { - self.ReportEvent(TelemetryEvents.OpenAdditionalQueryResults); - url = WorkItemTrackingService.GetMyQueryResultsUrl(self._serverContext.RepoInfo.TeamProjectUrl, self._myQueriesFolder, query.label); - } else { - self.ReportEvent(TelemetryEvents.ViewWorkItem); - url = WorkItemTrackingService.GetEditWorkItemUrl(self._serverContext.RepoInfo.TeamProjectUrl, workItem.id); - } - Logger.LogInfo("Work Item Url: " + url); - Utils.OpenUrl(url); - } - }, - function (err) { - self.handleError(err, "Error selecting work item from QuickPick"); - } - ); - } - }, - function (err) { - self.handleError(err, "Error selecting work item query from QuickPick"); - } - ); - } - - public ShowPinnedQueryWorkItems(): void { - this.ReportEvent(TelemetryEvents.ViewPinnedQueryWorkItems); - this.getPinnedQueryText().then((queryText) => { - this.showWorkItems(queryText); - }); - } - - //Returns a Q.Promise containing an array of SimpleWorkItems that are "My" work items - public ShowMyWorkItems(): void { - this.ReportEvent(TelemetryEvents.ViewMyWorkItems); - this.showWorkItems(WitQueries.MyWorkItems); - } - - private showWorkItems(wiql: string): void { - let self = this; - Logger.LogInfo("Getting work items..."); - window.showQuickPick(self.getMyWorkItems(this._serverContext.RepoInfo.TeamProject, wiql), { matchOnDescription: true, placeHolder: Strings.ChooseWorkItem }).then( - function (workItem) { + public async ShowMyWorkItemQueries(): Promise { + try { + this.ReportEvent(TelemetryEvents.ShowMyWorkItemQueries); + let query: WorkItemQueryQuickPickItem = await window.showQuickPick(await this.getMyWorkItemQueries(), { matchOnDescription: false, placeHolder: Strings.ChooseWorkItemQuery }); + if (query) { + this.ReportEvent(TelemetryEvents.ViewWorkItems); + Logger.LogInfo("Selected query is " + query.label); + Logger.LogInfo("Getting work items for query..."); + + let workItem: BaseQuickPickItem = await window.showQuickPick(await this.getMyWorkItems(this._serverContext.RepoInfo.TeamProject, query.wiql), { matchOnDescription: true, placeHolder: Strings.ChooseWorkItem }); if (workItem) { let url: string = undefined; if (workItem.id === undefined) { - self.ReportEvent(TelemetryEvents.OpenAdditionalQueryResults); - url = WorkItemTrackingService.GetWorkItemsBaseUrl(self._serverContext.RepoInfo.TeamProjectUrl); + this.ReportEvent(TelemetryEvents.OpenAdditionalQueryResults); + url = WorkItemTrackingService.GetMyQueryResultsUrl(this._serverContext.RepoInfo.TeamProjectUrl, this._myQueriesFolder, query.label); } else { - self.ReportEvent(TelemetryEvents.ViewWorkItem); - url = WorkItemTrackingService.GetEditWorkItemUrl(self._serverContext.RepoInfo.TeamProjectUrl, workItem.id); + this.ReportEvent(TelemetryEvents.ViewWorkItem); + url = WorkItemTrackingService.GetEditWorkItemUrl(this._serverContext.RepoInfo.TeamProjectUrl, workItem.id); } Logger.LogInfo("Work Item Url: " + url); Utils.OpenUrl(url); } - }, - function (err) { - self.handleError(err, "Error selecting work item query from QuickPick"); } - ); + } catch (err) { + this.handleError(err, "Error showing work item queries"); + } } - public GetPinnedQueryResultCount() : Q.Promise { - let svc: WorkItemTrackingService = new WorkItemTrackingService(this._serverContext); - Logger.LogInfo("Running pinned work item query to get count..."); - Logger.LogInfo("TP: " + this._serverContext.RepoInfo.TeamProject); + public async ShowPinnedQueryWorkItems(): Promise { + this.ReportEvent(TelemetryEvents.ViewPinnedQueryWorkItems); - return this.getPinnedQueryText().then((queryText) => { - return svc.GetQueryResultCount(this._serverContext.RepoInfo.TeamProject, queryText); - }); + try { + let queryText: string = await this.getPinnedQueryText(); + await this.showWorkItems(queryText); + } catch (err) { + this.handleError(err, "Error showing pinned query work items"); + } } - private getPinnedQueryText(): Q.Promise { - let deferred = Q.defer(); - let promiseToReturn = deferred.promise; + public async ShowMyWorkItems(): Promise { + this.ReportEvent(TelemetryEvents.ViewMyWorkItems); - if (this._pinnedQuery.queryText && this._pinnedQuery.queryText.length > 0) { - deferred.resolve(this._pinnedQuery.queryText); - } else if (this._pinnedQuery.queryPath && this._pinnedQuery.queryPath.length > 0) { - Logger.LogInfo("Getting my work item query..."); - Logger.LogInfo("TP: " + this._serverContext.RepoInfo.TeamProject); - Logger.LogInfo("QueryPath: " + this._pinnedQuery.queryPath); - let svc: WorkItemTrackingService = new WorkItemTrackingService(this._serverContext); + try { + await this.showWorkItems(WitQueries.MyWorkItems); + } catch (err) { + this.handleError(err, "Error showing my work items"); + } + } - svc.GetWorkItemQuery(this._serverContext.RepoInfo.TeamProject, this._pinnedQuery.queryPath).then((queryItem) => { - deferred.resolve(queryItem.wiql); - }).catch((reason) => { - deferred.reject(reason); - }); - } else { - deferred.reject("No queryPath or queryText provided."); + private async showWorkItems(wiql: string): Promise { + Logger.LogInfo("Getting work items..."); + let workItem: BaseQuickPickItem = await window.showQuickPick(await this.getMyWorkItems(this._serverContext.RepoInfo.TeamProject, wiql), { matchOnDescription: true, placeHolder: Strings.ChooseWorkItem }); + if (workItem) { + let url: string = undefined; + if (workItem.id === undefined) { + this.ReportEvent(TelemetryEvents.OpenAdditionalQueryResults); + url = WorkItemTrackingService.GetWorkItemsBaseUrl(this._serverContext.RepoInfo.TeamProjectUrl); + } else { + this.ReportEvent(TelemetryEvents.ViewWorkItem); + url = WorkItemTrackingService.GetEditWorkItemUrl(this._serverContext.RepoInfo.TeamProjectUrl, workItem.id); + } + Logger.LogInfo("Work Item Url: " + url); + Utils.OpenUrl(url); } + } + + public async GetPinnedQueryResultCount() : Promise { + try { + Logger.LogInfo("Running pinned work item query to get count (" + this._serverContext.RepoInfo.TeamProject + ")..."); + let queryText: string = await this.getPinnedQueryText(); - return promiseToReturn; + let svc: WorkItemTrackingService = new WorkItemTrackingService(this._serverContext); + return svc.GetQueryResultCount(this._serverContext.RepoInfo.TeamProject, queryText); + } catch (err) { + this.handleError(err, "Error getting pinned query result count"); + } } - private getMyWorkItemQueries(): Q.Promise> { - let queries: Array = []; - let promiseToReturn: Q.Promise>; - let deferred = Q.defer>(); - promiseToReturn = deferred.promise; + private async getPinnedQueryText(): Promise { + let promise: Promise = new Promise(async (resolve, reject) => { + try { + if (this._pinnedQuery.queryText && this._pinnedQuery.queryText.length > 0) { + resolve(this._pinnedQuery.queryText); + } else if (this._pinnedQuery.queryPath && this._pinnedQuery.queryPath.length > 0) { + Logger.LogInfo("Getting my work item query (" + this._serverContext.RepoInfo.TeamProject + ")..."); + Logger.LogInfo("QueryPath: " + this._pinnedQuery.queryPath); + let svc: WorkItemTrackingService = new WorkItemTrackingService(this._serverContext); + + let queryItem: QueryHierarchyItem = await svc.GetWorkItemQuery(this._serverContext.RepoInfo.TeamProject, this._pinnedQuery.queryPath); + resolve(queryItem.wiql); + } + } catch (err) { + reject(err); + } + }); + return promise; + } + private async getMyWorkItemQueries(): Promise { + let queries: WorkItemQueryQuickPickItem[] = []; let svc: WorkItemTrackingService = new WorkItemTrackingService(this._serverContext); - Logger.LogInfo("Getting my work item queries..."); - Logger.LogInfo("TP: " + this._serverContext.RepoInfo.TeamProject); - svc.GetWorkItemHierarchyItems(this._serverContext.RepoInfo.TeamProject).then((hierarchyItems) => { - Logger.LogInfo("Retrieved " + hierarchyItems.length + " hierarchyItems"); - hierarchyItems.forEach(folder => { - if (folder && folder.isFolder === true && folder.isPublic === false) { - // Because "My Queries" is localized and there is no API to get the name of the localized - // folder, we need to save off the localized name when constructing URLs. - this._myQueriesFolder = folder.name; - if (folder.hasChildren === true) { - //Gets all of the queries under "My Queries" and gets their name and wiql - for (let index = 0; index < folder.children.length; index++) { - queries.push({ - id: folder.children[index].id, - label: folder.children[index].name, - description: "", - wiql: folder.children[index].wiql - }); - } + Logger.LogInfo("Getting my work item queries (" + this._serverContext.RepoInfo.TeamProject + ")..."); + let hierarchyItems: QueryHierarchyItem[] = await svc.GetWorkItemHierarchyItems(this._serverContext.RepoInfo.TeamProject); + Logger.LogInfo("Retrieved " + hierarchyItems.length + " hierarchyItems"); + hierarchyItems.forEach(folder => { + if (folder && folder.isFolder === true && folder.isPublic === false) { + // Because "My Queries" is localized and there is no API to get the name of the localized + // folder, we need to save off the localized name when constructing URLs. + this._myQueriesFolder = folder.name; + if (folder.hasChildren === true) { + //Gets all of the queries under "My Queries" and gets their name and wiql + for (let index = 0; index < folder.children.length; index++) { + queries.push({ + id: folder.children[index].id, + label: folder.children[index].name, + description: "", + wiql: folder.children[index].wiql + }); } } - }); - - deferred.resolve(queries); - }).catch((reason) => { - deferred.reject(reason); + } }); - - return promiseToReturn; + return queries; } - private getMyWorkItems(teamProject: string, wiql: string): Q.Promise> { - let workItems: Array = []; - let promiseToReturn: Q.Promise>; - let deferred = Q.defer>(); - promiseToReturn = deferred.promise; - + private async getMyWorkItems(teamProject: string, wiql: string): Promise { + let workItems: BaseQuickPickItem[] = []; let svc: WorkItemTrackingService = new WorkItemTrackingService(this._serverContext); - Logger.LogInfo("Getting my work items..."); - Logger.LogInfo("TP: " + this._serverContext.RepoInfo.TeamProject); - svc.GetWorkItems(teamProject, wiql).then((simpleWorkItems) => { - Logger.LogInfo("Retrieved " + simpleWorkItems.length + " work items"); - - simpleWorkItems.forEach(wi => { - workItems.push({ label: wi.label, description: wi.description, id: wi.id}); - }); - if (simpleWorkItems.length === WorkItemTrackingService.MaxResults) { - workItems.push({ - id: undefined, - label: Strings.BrowseAdditionalWorkItems, - description: Strings.BrowseAdditionalWorkItemsDescription - }); - } - - deferred.resolve(workItems); - }).catch((reason) => { - deferred.reject(reason); + Logger.LogInfo("Getting my work items (" + this._serverContext.RepoInfo.TeamProject + ")..."); + let simpleWorkItems: SimpleWorkItem[] = await svc.GetWorkItems(teamProject, wiql); + Logger.LogInfo("Retrieved " + simpleWorkItems.length + " work items"); + simpleWorkItems.forEach(wi => { + workItems.push({ label: wi.label, description: wi.description, id: wi.id}); }); - - return promiseToReturn; + if (simpleWorkItems.length === WorkItemTrackingService.MaxResults) { + workItems.push({ + id: undefined, + label: Strings.BrowseAdditionalWorkItems, + description: Strings.BrowseAdditionalWorkItemsDescription + }); + } + return workItems; } private getUserName(context: TeamServerContext): string { @@ -257,27 +218,17 @@ export class WitClient extends BaseClient { return userName; } - private getWorkItemTypes(): Q.Promise> { - let promiseToReturn: Q.Promise>; - let deferred = Q.defer>(); - promiseToReturn = deferred.promise; - + private async getWorkItemTypes(): Promise { let svc: WorkItemTrackingService = new WorkItemTrackingService(this._serverContext); - svc.GetWorkItemTypes(this._serverContext.RepoInfo.TeamProject).then((types) => { - let workItemTypes: Array = []; - types.forEach(type => { - workItemTypes.push({ label: type.name, description: type.description, id: undefined }); - }); - workItemTypes.sort((t1, t2) => { - return (t1.label.localeCompare(t2.label)); - }); - - deferred.resolve(workItemTypes); - }).catch((reason) => { - deferred.reject(reason); + let types: WorkItemType[] = await svc.GetWorkItemTypes(this._serverContext.RepoInfo.TeamProject); + let workItemTypes: BaseQuickPickItem[] = []; + types.forEach(type => { + workItemTypes.push({ label: type.name, description: type.description, id: undefined }); }); - - return promiseToReturn; + workItemTypes.sort((t1, t2) => { + return (t1.label.localeCompare(t2.label)); + }); + return workItemTypes; } private handleError(reason: any, infoMessage?: string, polling?: boolean) : void { diff --git a/src/helpers/logger.ts b/src/helpers/logger.ts index f54e751490..72b7576624 100644 --- a/src/helpers/logger.ts +++ b/src/helpers/logger.ts @@ -27,10 +27,14 @@ export class Logger { } } + private static addPid(message: string): string { + return " [" + Logger.addZero(process.pid, 10000) + "] " + message; + } + public static LogDebug(message: string) : void { Logger.initalize(); if (Logger.initialized === true && this.loggingLevel === LoggingLevel.Debug) { - winston.log("debug", message); + winston.log("debug", this.addPid(message)); console.log(Logger.getNow() + message); } } @@ -39,7 +43,7 @@ export class Logger { public static LogError(message: string) : void { Logger.initalize(); if (Logger.initialized === true && this.loggingLevel >= LoggingLevel.Error) { - winston.log("error", message); + winston.log("error", this.addPid(message)); console.log(Logger.getNow() + "ERROR: " + message); } //When displaying messages, don't add timestamp or our severity level prefix @@ -49,7 +53,7 @@ export class Logger { public static LogInfo(message: string) : void { Logger.initalize(); if (Logger.initialized === true && this.loggingLevel >= LoggingLevel.Info) { - winston.log("info", message); + winston.log("info", " " + this.addPid(message)); //five-wide console.log(Logger.getNow() + message); } } @@ -66,7 +70,7 @@ export class Logger { public static LogWarning(message: string) : void { Logger.initalize(); if (Logger.initialized === true && this.loggingLevel >= LoggingLevel.Warn) { - winston.log("warn", message); + winston.log("warn", " " + this.addPid(message)); //five-wide console.log(Logger.getNow() + "WARNING: " + message); } //When displaying messages, don't add timestamp or our severity level prefix diff --git a/src/helpers/settings.ts b/src/helpers/settings.ts index 60a975b856..10b390ee02 100644 --- a/src/helpers/settings.ts +++ b/src/helpers/settings.ts @@ -38,7 +38,7 @@ export class PinnedQuerySettings extends BaseSettings { } private getPinnedQuery(account: string) : IPinnedQuery { - let pinnedQueries = this.readSetting>(SettingNames.PinnedQueries, undefined); + let pinnedQueries = this.readSetting(SettingNames.PinnedQueries, undefined); if (pinnedQueries !== undefined) { Logger.LogDebug("Found pinned queries in user configuration settings."); let global: IPinnedQuery = undefined; @@ -75,7 +75,7 @@ export class AccountSettings extends BaseSettings { } private getAccessToken(account: string) : string { - let tokens: any = this.readSetting>(SettingNames.AccessTokens, undefined); + let tokens: any = this.readSetting(SettingNames.AccessTokens, undefined); if (tokens !== undefined) { Logger.LogDebug("Found access tokens in user configuration settings."); let global: string = undefined; diff --git a/src/helpers/strings.ts b/src/helpers/strings.ts index e188fde373..114083d67d 100644 --- a/src/helpers/strings.ts +++ b/src/helpers/strings.ts @@ -47,5 +47,6 @@ export class Strings { //Status codes static StatusCode401: string = "Unauthorized. Check your authentication credentials and try again."; static StatusCodeOffline: string = "It appears Visual Studio Code is offline. Please connect and try again."; + static ProxyUnreachable: string = "It appears the configured proxy is not reachable. Please check your connection and try again."; } /* tslint:enable:variable-name */ diff --git a/src/helpers/utils.ts b/src/helpers/utils.ts index 24eeba7fe4..9b2b343a42 100644 --- a/src/helpers/utils.ts +++ b/src/helpers/utils.ts @@ -81,6 +81,13 @@ export class Utils { case "EAI_AGAIN": msg = msg + Strings.StatusCodeOffline; break; + case "ECONNRESET": + case "ECONNREFUSED": + if (this.IsProxyEnabled()) { + msg = msg + Strings.ProxyUnreachable; + break; + } + return message; default: return message; } @@ -88,6 +95,33 @@ export class Utils { return msg; } + //Use some common error codes to indicate offline status + public static IsProxyEnabled(): boolean { + if (process.env.HTTPS_PROXY || process.env.HTTP_PROXY) { + return true; + } + return false; + } + + public static IsProxyIssue(reason: any): boolean { + // If the proxy isn't enabled/set, it can't be a proxy issue + if (!this.IsProxyEnabled()) { + return false; + } + + // If proxy is set, check for error codes + if (reason !== undefined) { + if (reason.code === "ECONNRESET" || reason.code === "ECONNREFUSED") { + return true; + } + if (reason.statusCode === "ECONNRESET" || reason.statusCode === "ECONNREFUSED") { + return true; + } + } + + return false; + } + //Use some common error codes to indicate offline status public static IsOffline(reason: any): boolean { if (reason !== undefined) { diff --git a/src/services/build.ts b/src/services/build.ts index 5b1c25d7df..c5c871dfbf 100644 --- a/src/services/build.ts +++ b/src/services/build.ts @@ -5,36 +5,39 @@ "use strict"; import { Build, BuildBadge, BuildQueryOrder, DefinitionReference, QueryDeletedOption } from "vso-node-api/interfaces/BuildInterfaces"; -import { IQBuildApi } from "vso-node-api/BuildApi"; +import { IBuildApi } from "vso-node-api/BuildApi"; import { WebApi } from "vso-node-api/WebApi"; import { TeamServerContext } from "../contexts/servercontext"; import { CredentialManager } from "../helpers/credentialmanager"; -import Q = require("q"); - export class BuildService { - private _buildApi: IQBuildApi; + private _buildApi: IBuildApi; constructor(context: TeamServerContext) { - this._buildApi = new WebApi(context.RepoInfo.CollectionUrl, CredentialManager.GetCredentialHandler()).getQBuildApi(); - } - - //Returns the build definitions (regardless of type) for the team project - public GetBuildDefinitions(teamProject: string): Q.Promise { - return this._buildApi.getDefinitions(teamProject); + this._buildApi = new WebApi(context.RepoInfo.CollectionUrl, CredentialManager.GetCredentialHandler()).getBuildApi(); } - //Returns the "latest"" build for this definition - public GetBuildsByDefinitionId(teamProject: string, definitionId: number): Q.Promise> { - return this._buildApi.getBuilds(teamProject, [ definitionId ], null, null, null, null, null, null, null, null, null, null, null, - 1, null, 1, QueryDeletedOption.ExcludeDeleted, BuildQueryOrder.FinishTimeDescending); + //Get the latest build id and badge of a build definition based on current project, repo and branch + public async GetBuildBadge(project: string, repoType: string, repoId: string, branchName: string) : Promise { + return await this._buildApi.getBuildBadge(project, repoType, repoId, branchName); } //Get extra details of a build based on the build id - public GetBuildById(buildId: number): Q.Promise { - return this._buildApi.getBuild(buildId); + public async GetBuildById(buildId: number): Promise { + return await this._buildApi.getBuild(buildId); }; + //Returns the build definitions (regardless of type) for the team project + public async GetBuildDefinitions(teamProject: string): Promise { + return await this._buildApi.getDefinitions(teamProject); + } + + //Returns the "latest" build for this definition + public async GetBuildsByDefinitionId(teamProject: string, definitionId: number): Promise { + return await this._buildApi.getBuilds(teamProject, [ definitionId ], null, null, null, null, null, null, null, null, null, null, + 1, null, 1, QueryDeletedOption.ExcludeDeleted, BuildQueryOrder.FinishTimeDescending); + } + //Construct the url to the individual build definition (completed view) //https://account.visualstudio.com/DefaultCollection/project/_build#_a=completed&definitionId=34 public static GetBuildDefinitionUrl(remoteUrl: string, definitionId: string) : string { @@ -58,8 +61,4 @@ export class BuildService { return remoteUrl + "/_build"; } - //Get the latest build id and badge of a build definition based on current project, repo and branch - public GetBuildBadge(project: string, repoType: string, repoId: string, branchName: string) : Q.Promise { - return this._buildApi.getBuildBadge(project, repoType, repoId, branchName); - } } diff --git a/src/services/gitvc.ts b/src/services/gitvc.ts index de3b54d5a7..e2c048fd31 100644 --- a/src/services/gitvc.ts +++ b/src/services/gitvc.ts @@ -6,13 +6,13 @@ import { GitPullRequest, GitPullRequestSearchCriteria, GitRepository, PullRequestAsyncStatus, PullRequestStatus} from "vso-node-api/interfaces/GitInterfaces"; -import { IQGitApi } from "vso-node-api/GitApi"; +import { IGitApi } from "vso-node-api/GitApi"; import { WebApi } from "vso-node-api/WebApi"; import { TeamServerContext } from "../contexts/servercontext"; import { CredentialManager } from "../helpers/credentialmanager"; export class GitVcService { - private _gitApi: IQGitApi; + private _gitApi: IGitApi; private static REVIEWER_VOTE_NO_RESPONSE: number = 0; private static REVIEWER_VOTE_APPROVED_WITH_SUGGESTIONS: number = 5; @@ -21,21 +21,20 @@ export class GitVcService { private static REVIEWER_VOTE_REJECTED: number = -10; constructor(context: TeamServerContext) { - this._gitApi = new WebApi(context.RepoInfo.CollectionUrl, CredentialManager.GetCredentialHandler()).getQGitApi(); + this._gitApi = new WebApi(context.RepoInfo.CollectionUrl, CredentialManager.GetCredentialHandler()).getGitApi(); } //Returns a Q.Promise containing an array of GitPullRequest objectss for the creator and repository //If creatorId is undefined, all pull requests will be returned - public GetPullRequests(repositoryId: string, creatorId?: string, reviewerId?: string, status?: PullRequestStatus) : Q.Promise> { + public async GetPullRequests(repositoryId: string, creatorId?: string, reviewerId?: string, status?: PullRequestStatus) : Promise { let criteria: GitPullRequestSearchCriteria = { creatorId: creatorId, includeLinks: false, repositoryId: repositoryId, reviewerId: reviewerId, - sourceRefName: undefined, status: status, targetRefName: undefined }; - - return this._gitApi.getPullRequests(repositoryId, criteria); + sourceRefName: undefined, status: status, targetRefName: undefined }; + return await this._gitApi.getPullRequests(repositoryId, criteria); } //Returns a Q.Promise containing an array of GitRepository objects for the project - public GetRepositories(project: string): Q.Promise> { - return this._gitApi.getRepositories(project, false); + public async GetRepositories(project: string): Promise { + return await this._gitApi.getRepositories(project, false); } //Construct the url to the file blame information diff --git a/src/services/telemetry.ts b/src/services/telemetry.ts index 5ea8c6d621..60563b01ac 100644 --- a/src/services/telemetry.ts +++ b/src/services/telemetry.ts @@ -16,7 +16,7 @@ export class TelemetryService { private _appInsightsClient: Client; private _serverContext: TeamServerContext; private _telemetryEnabled: boolean = true; - private _extensionVersion: string = "1.104.1"; + private _extensionVersion: string = "1.108.0"; private _collectionId: string = "UNKNOWN"; //Default to a new uuid in case the extension fails before being initialized private _userId: string = uuid.v1(); @@ -39,6 +39,8 @@ export class TelemetryService { .setAutoCollectRequests(false) .start(); this._appInsightsClient = appInsights.getClient(insightsKey); + //Need to use HTTPS with v0.15.16 of App Insights + this._appInsightsClient.config.endpointUrl = "https://dc.services.visualstudio.com/v2/track"; //Assign common properties to all telemetry sent from the default client this.setCommonProperties(); diff --git a/src/services/workitemtracking.ts b/src/services/workitemtracking.ts index ffb0b48763..1dad3f2331 100644 --- a/src/services/workitemtracking.ts +++ b/src/services/workitemtracking.ts @@ -6,122 +6,75 @@ import { TeamContext } from "vso-node-api/interfaces/CoreInterfaces"; import { WebApi } from "vso-node-api/WebApi"; -import { IQWorkItemTrackingApi } from "vso-node-api/WorkItemTrackingApi"; +import { IWorkItemTrackingApi } from "vso-node-api/WorkItemTrackingApi"; import { QueryExpand, QueryHierarchyItem, QueryResultType, Wiql, WorkItem, - WorkItemExpand, WorkItemType, WorkItemTypeReference } from "vso-node-api/interfaces/WorkItemTrackingInterfaces"; + WorkItemExpand, WorkItemQueryResult, WorkItemType, WorkItemTypeCategory, + WorkItemTypeReference } from "vso-node-api/interfaces/WorkItemTrackingInterfaces"; import { TeamServerContext } from "../contexts/servercontext"; import { CredentialManager } from "../helpers/credentialmanager"; -import Q = require("q"); - export class WorkItemTrackingService { - private _witApi: IQWorkItemTrackingApi; + private _witApi: IWorkItemTrackingApi; constructor(context: TeamServerContext) { - this._witApi = new WebApi(context.RepoInfo.CollectionUrl, CredentialManager.GetCredentialHandler()).getQWorkItemTrackingApi(); + this._witApi = new WebApi(context.RepoInfo.CollectionUrl, CredentialManager.GetCredentialHandler()).getWorkItemTrackingApi(); } - //Returns a Q.Promise containing the WorkItem that was created - public CreateWorkItem(context: TeamServerContext, itemType: string, taskTitle: string): Q.Promise { + //Returns a Promise containing the WorkItem that was created + public async CreateWorkItem(context: TeamServerContext, itemType: string, taskTitle: string): Promise { let newWorkItem = [{ op: "add", path: "/fields/" + WorkItemFields.Title, value: taskTitle }]; - - return this._witApi.createWorkItem(null, newWorkItem, context.RepoInfo.TeamProject, itemType, false, false); + return await this._witApi.createWorkItem(null, newWorkItem, context.RepoInfo.TeamProject, itemType, false, false); } - //Returns a Q.Promise containing an array of SimpleWorkItems based on the passed in wiql - public GetWorkItems(teamProject: string, wiql: string): Q.Promise> { - return this.execWorkItemQuery(teamProject, { query: wiql}); + //Returns a Promise containing an array of SimpleWorkItems based on the passed in wiql + public async GetWorkItems(teamProject: string, wiql: string): Promise { + return await this.execWorkItemQuery(teamProject, { query: wiql}); } - //Returns a Q.Promise containing an array of QueryHierarchyItems (either folders or work item queries) - public GetWorkItemHierarchyItems(teamProject: string): Q.Promise> { - let promiseToReturn: Q.Promise>; - let deferred = Q.defer>(); - promiseToReturn = deferred.promise; - - this._witApi.getQueries(teamProject, QueryExpand.Wiql, 1, false).then((queryHierarchy) => { - deferred.resolve(queryHierarchy); - }).fail((reason) => { - deferred.reject(reason); - }); - - return promiseToReturn; + //Returns a Promise containing an array of QueryHierarchyItems (either folders or work item queries) + public async GetWorkItemHierarchyItems(teamProject: string): Promise { + return await this._witApi.getQueries(teamProject, QueryExpand.Wiql, 1, false); } - //Returns a Q.Promise containing a specific query item - public GetWorkItemQuery(teamProject: string, queryPath: string): Q.Promise { - let promiseToReturn: Q.Promise; - let deferred = Q.defer(); - promiseToReturn = deferred.promise; - - this._witApi.getQuery(teamProject, queryPath, QueryExpand.Wiql, 1, false).then((queryHierarchy) => { - deferred.resolve(queryHierarchy); - }).fail((reason) => { - deferred.reject(reason); - }); - - return promiseToReturn; + //Returns a Promise containing a specific query item + public async GetWorkItemQuery(teamProject: string, queryPath: string): Promise { + return await this._witApi.getQuery(teamProject, queryPath, QueryExpand.Wiql, 1, false); } - //Returns a Q.Promise containing the array of work item types available for the team project - public GetWorkItemTypes(teamProject: string): Q.Promise> { - let promiseToReturn: Q.Promise>; - let deferred = Q.defer>(); - promiseToReturn = deferred.promise; - - let workItemTypes: Array = []; - let hiddenTypes: Array = []; - this._witApi.getWorkItemTypes(teamProject).then((types) => { - types.forEach(type => { - workItemTypes.push(type); - }); - this._witApi.getWorkItemTypeCategory(teamProject, "Microsoft.HiddenCategory").then((category) => { - category.workItemTypes.forEach(hiddenType => { - hiddenTypes.push(hiddenType); - }); - let types: Array = workItemTypes.filter(function (el) { - for (let index = 0; index < hiddenTypes.length; index++) { - if (el.name === hiddenTypes[index].name) { - return false; - } - } - return true; - }); - deferred.resolve(types); - }).fail((reason) => { - deferred.reject(reason); - }); - }).fail((reason) => { - deferred.reject(reason); + //Returns a Promise containing the array of work item types available for the team project + public async GetWorkItemTypes(teamProject: string): Promise { + let types: WorkItemType[] = await this._witApi.getWorkItemTypes(teamProject); + let workItemTypes: WorkItemType[] = []; + let hiddenTypes: WorkItemTypeReference[] = []; + types.forEach(type => { + workItemTypes.push(type); }); - - return promiseToReturn; - } - - //Returns a Q.Promise containing a SimpleWorkItem representing the work item specifid by teamProject and id - public GetWorkItemById(teamProject: string, id: string): Q.Promise { - let promiseToReturn: Q.Promise; - let deferred = Q.defer(); - promiseToReturn = deferred.promise; - - this._witApi.getWorkItem(parseInt(id), [WorkItemFields.Id, WorkItemFields.Title]).then((workItem) => { - let result: SimpleWorkItem = new SimpleWorkItem(); - result.id = workItem.id.toString(); - result.label = workItem.fields[WorkItemFields.Title]; - deferred.resolve(result); - }).fail((reason) => { - deferred.reject(reason); + let category: WorkItemTypeCategory = await this._witApi.getWorkItemTypeCategory(teamProject, "Microsoft.HiddenCategory"); + category.workItemTypes.forEach(hiddenType => { + hiddenTypes.push(hiddenType); }); - - return promiseToReturn; + let filteredTypes: WorkItemType[] = workItemTypes.filter(function (el) { + for (let index = 0; index < hiddenTypes.length; index++) { + if (el.name === hiddenTypes[index].name) { + return false; + } + } + return true; + }); + return filteredTypes; } - //Returns a Q.Promise containing an array of SimpleWorkItems that are the results of the passed in wiql - private execWorkItemQuery(teamProject: string, wiql: Wiql): Q.Promise> { - let promiseToReturn: Q.Promise>; - let deferred = Q.defer>(); - promiseToReturn = deferred.promise; + //Returns a Promise containing a SimpleWorkItem representing the work item specifid by teamProject and id + public async GetWorkItemById(teamProject: string, id: string): Promise { + let workItem: WorkItem = await this._witApi.getWorkItem(parseInt(id), [WorkItemFields.Id, WorkItemFields.Title]); + let result: SimpleWorkItem = new SimpleWorkItem(); + result.id = workItem.id.toString(); + result.label = workItem.fields[WorkItemFields.Title]; + return result; + } + //Returns a Promise containing an array of SimpleWorkItems that are the results of the passed in wiql + private async execWorkItemQuery(teamProject: string, wiql: Wiql): Promise { //Querying WIT requires a TeamContext let teamContext: TeamContext = { projectId: undefined, @@ -131,54 +84,40 @@ export class WorkItemTrackingService { }; // Execute the wiql and get the work item ids - this._witApi.queryByWiql(wiql, teamContext).then((queryResult) => { - let results: Array = []; - let workItemIds: Array = []; - if (queryResult.queryResultType === QueryResultType.WorkItem) { - workItemIds = queryResult.workItems.map(function(w) {return w.id; }); - } else if (queryResult.queryResultType === QueryResultType.WorkItemLink) { - workItemIds = queryResult.workItemRelations.map(function(w) {return w.target.id; }); - } - if (workItemIds.length === 0) { - deferred.resolve(results); - return promiseToReturn; - } - //Only request the maximum number of work items the API documents that we should - if (workItemIds.length >= WorkItemTrackingService.MaxResults) { - workItemIds = workItemIds.slice(0, WorkItemTrackingService.MaxResults); - } - - this._witApi.getWorkItems(workItemIds, - [WorkItemFields.Id, WorkItemFields.Title, WorkItemFields.WorkItemType], - null, - WorkItemExpand.None) - .then((workItems) => { - //Keep original sort order that wiql specified - for (let index = 0; index < workItemIds.length; index++) { - let item: WorkItem = workItems.find(i => i.id === workItemIds[index]); - results.push({ - id: item.fields[WorkItemFields.Id], - label: item.fields[WorkItemFields.Id] + " [" + item.fields[WorkItemFields.WorkItemType] + "]", - description: item.fields[WorkItemFields.Title] - }); - } + let queryResult: WorkItemQueryResult = await this._witApi.queryByWiql(wiql, teamContext); + let results: SimpleWorkItem[] = []; + let workItemIds: number[] = []; + if (queryResult.queryResultType === QueryResultType.WorkItem) { + workItemIds = queryResult.workItems.map(function(w) {return w.id; }); + } else if (queryResult.queryResultType === QueryResultType.WorkItemLink) { + workItemIds = queryResult.workItemRelations.map(function(w) {return w.target.id; }); + } + if (workItemIds.length === 0) { + return results; + } + //Only request the maximum number of work items the API documents that we should + if (workItemIds.length >= WorkItemTrackingService.MaxResults) { + workItemIds = workItemIds.slice(0, WorkItemTrackingService.MaxResults); + } - deferred.resolve(results); - }).fail((reason) => { - deferred.reject(reason); + let workItems: WorkItem[] = await this._witApi.getWorkItems(workItemIds, + [WorkItemFields.Id, WorkItemFields.Title, WorkItemFields.WorkItemType], + null, + WorkItemExpand.None); + //Keep original sort order that wiql specified + for (let index = 0; index < workItemIds.length; index++) { + let item: WorkItem = workItems.find(i => i.id === workItemIds[index]); + results.push({ + id: item.fields[WorkItemFields.Id], + label: item.fields[WorkItemFields.Id] + " [" + item.fields[WorkItemFields.WorkItemType] + "]", + description: item.fields[WorkItemFields.Title] }); - }).fail((reason) => { - deferred.reject(reason); - }); + } - return promiseToReturn; + return results; } - public GetQueryResultCount(teamProject: string, wiql: string): Q.Promise { - let promiseToReturn: Q.Promise; - let deferred = Q.defer(); - promiseToReturn = deferred.promise; - + public async GetQueryResultCount(teamProject: string, wiql: string): Promise { //Querying WIT requires a TeamContext let teamContext: TeamContext = { projectId: undefined, @@ -188,14 +127,10 @@ export class WorkItemTrackingService { }; // Execute the wiql and get count of results - this._witApi.queryByWiql({ query: wiql}, teamContext).then((queryResult) => { - deferred.resolve(queryResult.workItems.length); - return promiseToReturn; - }).fail((reason) => { - deferred.reject(reason); - }); - - return promiseToReturn; + let queryResult: WorkItemQueryResult = await this._witApi.queryByWiql({ query: wiql}, teamContext); + //If a Promise is returned here, then() will return that Promise + //If not, it will wrap the value within a Promise and return that + return queryResult.workItems.length; } //Construct the url to the individual work item edit page @@ -206,9 +141,10 @@ export class WorkItemTrackingService { //Construct the url to the creation page for new work item type public static GetNewWorkItemUrl(teamProjectUrl: string, issueType: string, title?: string, assignedTo?: string) : string { //This form will redirect to the form below so let's use this one - let url:string = this.GetWorkItemsBaseUrl(teamProjectUrl) + "/create/" + issueType; + let url: string = this.GetWorkItemsBaseUrl(teamProjectUrl) + "/create/" + issueType; let separator: string = "?"; if (title !== undefined) { + //title may need to be encoded (issues if first character is '#', for instance) url += separator + "[" + WorkItemFields.Title + "]=" + title; separator = "&"; } diff --git a/src/team-extension.ts b/src/team-extension.ts index bfb8779514..29c77ccc93 100644 --- a/src/team-extension.ts +++ b/src/team-extension.ts @@ -15,7 +15,7 @@ import { UrlMessageItem, VsCodeUtils } from "./helpers/vscodeutils"; import { GitContext } from "./contexts/gitcontext"; import { TeamServerContext} from "./contexts/servercontext"; import { TelemetryService } from "./services/telemetry"; -import { QTeamServicesApi } from "./clients/teamservicesclient"; +import { TeamServicesApi } from "./clients/teamservicesclient"; import { BuildClient } from "./clients/buildclient"; import { FeedbackClient } from "./clients/feedbackclient"; import { GitClient } from "./clients/gitclient"; @@ -87,44 +87,43 @@ export class TeamExtension { } } - public Login() { + public async Login() { // For Login, we just need to verify _serverContext and don't want to set this._errorMessage if (this._serverContext !== undefined && this._serverContext.RepoInfo !== undefined && this._serverContext.RepoInfo.IsTeamFoundation === true) { if (this._serverContext.RepoInfo.IsTeamFoundationServer === true) { let defaultUsername : string = this.getDefaultUsername(); - window.showInputBox({ value: defaultUsername || "", prompt: Strings.ProvideUsername + " (" + this._serverContext.RepoInfo.Account + ")", placeHolder: "", password: false }).then((username) => { - if (username !== undefined && username.length > 0) { - window.showInputBox({ value: "", prompt: Strings.ProvidePassword + " (" + username + ")", placeHolder: "", password: true }).then((password) => { - if (password !== undefined) { - Logger.LogInfo("Login: Username and Password provided as authentication."); - this._credentialManager.StoreCredentials(this._serverContext.RepoInfo.Host, username, password).then(() => { - // We don't test the credentials to make sure they're good here. Do so on the next command that's run. - this.Reinitialize(); - }).catch((reason) => { - // TODO: Should the message direct the user to open an issue? send feedback? - let msg: string = Strings.UnableToStoreCredentials + this._serverContext.RepoInfo.Host; - this.reportError(msg); - VsCodeUtils.ShowErrorMessage(msg); - }); - } - }); - } - }); - } else if (this._serverContext.RepoInfo.IsTeamServices === true) { - // Until Device Flow, we can prompt for the PAT for Team Services - window.showInputBox({ value: "", prompt: Strings.ProvideAccessToken + " (" + this._serverContext.RepoInfo.Account + ")", placeHolder: "", password: true }).then((token) => { - if (token !== undefined) { - Logger.LogInfo("Login: Personal Access Token provided as authentication."); - this._credentialManager.StoreCredentials(this._serverContext.RepoInfo.Host, Constants.OAuth, token).then(() => { + let username: string = await window.showInputBox({ value: defaultUsername || "", prompt: Strings.ProvideUsername + " (" + this._serverContext.RepoInfo.Account + ")", placeHolder: "", password: false }); + if (username !== undefined && username.length > 0) { + let password: string = await window.showInputBox({ value: "", prompt: Strings.ProvidePassword + " (" + username + ")", placeHolder: "", password: true }); + if (password !== undefined) { + Logger.LogInfo("Login: Username and Password provided as authentication."); + this._credentialManager.StoreCredentials(this._serverContext.RepoInfo.Host, username, password).then(() => { + // We don't test the credentials to make sure they're good here. Do so on the next command that's run. this.Reinitialize(); }).catch((reason) => { // TODO: Should the message direct the user to open an issue? send feedback? let msg: string = Strings.UnableToStoreCredentials + this._serverContext.RepoInfo.Host; - this.reportError(msg); + this._feedbackClient.ReportError(msg + " " + reason); + Logger.LogDebug(msg + " " + reason); VsCodeUtils.ShowErrorMessage(msg); }); } - }); + } + } else if (this._serverContext.RepoInfo.IsTeamServices === true) { + // Until Device Flow, we can prompt for the PAT for Team Services + let token: string = await window.showInputBox({ value: "", prompt: Strings.ProvideAccessToken + " (" + this._serverContext.RepoInfo.Account + ")", placeHolder: "", password: true }); + if (token !== undefined) { + Logger.LogInfo("Login: Personal Access Token provided as authentication."); + this._credentialManager.StoreCredentials(this._serverContext.RepoInfo.Host, Constants.OAuth, token).then(() => { + this.Reinitialize(); + }).catch((reason) => { + // TODO: Should the message direct the user to open an issue? send feedback? + let msg: string = Strings.UnableToStoreCredentials + this._serverContext.RepoInfo.Host; + this._feedbackClient.ReportError(msg + " " + reason); + Logger.LogDebug(msg + " " + reason); + VsCodeUtils.ShowErrorMessage(msg); + }); + } } } else { let messageItem : UrlMessageItem = { title : Strings.LearnMore, @@ -147,7 +146,8 @@ export class TeamExtension { this.Reinitialize(); }).catch((reason) => { let msg: string = Strings.UnableToRemoveCredentials + this._serverContext.RepoInfo.Host; - this.reportError(msg); + this._feedbackClient.ReportError(msg + " " + reason); + Logger.LogDebug(msg + " " + reason); VsCodeUtils.ShowErrorMessage(msg); }); } else { @@ -262,7 +262,7 @@ export class TeamExtension { //Prompts for either a smile or frown, feedback text and an optional email address public SendFeedback(): void { //SendFeedback doesn't need to ensure the extension is initialized - return this._feedbackClient.SendFeedback(); + this._feedbackClient.SendFeedback(); } //Returns the list of work items assigned directly to the current user @@ -366,7 +366,7 @@ export class TeamExtension { this._credentialManager = new CredentialManager(); let accountSettings = new AccountSettings(this._serverContext.RepoInfo.Account); - this._credentialManager.GetCredentialHandler(this._serverContext, accountSettings.TeamServicesPersonalAccessToken).then((requestHandler) => { + this._credentialManager.GetCredentialHandler(this._serverContext, accountSettings.TeamServicesPersonalAccessToken).then(async (requestHandler) => { if (requestHandler === undefined) { this.displayNoCredentialsMessage(); return; @@ -376,20 +376,22 @@ export class TeamExtension { Logger.LogDebug("Started ApplicationInsights telemetry"); //Go get the details about the repository - let repositoryClient: QTeamServicesApi = new QTeamServicesApi(this._gitContext.RemoteUrl, [CredentialManager.GetCredentialHandler()]); + let repositoryClient: TeamServicesApi = new TeamServicesApi(this._gitContext.RemoteUrl, [CredentialManager.GetCredentialHandler()]); Logger.LogInfo("Getting repository information (vsts/info) with repositoryClient"); Logger.LogDebug("RemoteUrl = " + this._gitContext.RemoteUrl); - repositoryClient.getVstsInfo().then((repoInfo) => { + try { + let repoInfo: any = await repositoryClient.getVstsInfo(); Logger.LogInfo("Retrieved repository info with repositoryClient"); Logger.LogObject(repoInfo); this._serverContext.RepoInfo = new RepositoryInfo(repoInfo); //Now we need to go and get the authorized user information let connectionUrl: string = (this._serverContext.RepoInfo.IsTeamServices === true ? this._serverContext.RepoInfo.AccountUrl : this._serverContext.RepoInfo.CollectionUrl); - let accountClient: QTeamServicesApi = new QTeamServicesApi(connectionUrl, [CredentialManager.GetCredentialHandler()]); + let accountClient: TeamServicesApi = new TeamServicesApi(connectionUrl, [CredentialManager.GetCredentialHandler()]); Logger.LogInfo("Getting connectionData with accountClient"); Logger.LogDebug("connectionUrl = " + connectionUrl); - accountClient.connect().then((settings) => { + try { + let settings: any = await accountClient.connect(); Logger.LogInfo("Retrieved connectionData with accountClient"); this.resetErrorStatus(); @@ -408,20 +410,20 @@ export class TeamExtension { this.logDebugInformation(); this.refreshPollingItems(); this.startPolling(); - }).fail((reason) => { - this.setErrorStatus(Utils.GetMessageForStatusCode(reason, reason.message), (reason.statusCode === 401 ? CommandNames.Login : undefined), false); - this.reportError(Utils.GetMessageForStatusCode(reason, reason.message, "Failed to get results with accountClient: "), reason); - }); - }).fail((reason) => { + } catch (err) { + this.setErrorStatus(Utils.GetMessageForStatusCode(err, err.message), (err.statusCode === 401 ? CommandNames.Login : undefined), false); + this.reportError(Utils.GetMessageForStatusCode(err, err.message, "Failed to get results with accountClient: "), err); + } + } catch (err) { // We get a 404 on-prem if we aren't Update 2 or later - if (this._serverContext.RepoInfo.IsTeamFoundationServer === true && reason.statusCode === 404) { + if (this._serverContext.RepoInfo.IsTeamFoundationServer === true && err.statusCode === 404) { this.setErrorStatus(Strings.UnsupportedServerVersion, undefined, false); Logger.LogError(Strings.UnsupportedServerVersion); } else { - this.setErrorStatus(Utils.GetMessageForStatusCode(reason, reason.message), (reason.statusCode === 401 ? CommandNames.Login : undefined), false); - this.reportError(Utils.GetMessageForStatusCode(reason, reason.message, "Failed (vsts/info) call with repositoryClient: "), reason); + this.setErrorStatus(Utils.GetMessageForStatusCode(err, err.message), (err.statusCode === 401 ? CommandNames.Login : undefined), false); + this.reportError(Utils.GetMessageForStatusCode(err, err.message, "Failed (vsts/info) call with repositoryClient: "), err); } - }); + } } }).fail((reason) => { this.setErrorStatus(Utils.GetMessageForStatusCode(reason, reason.message), (reason.statusCode === 401 ? CommandNames.Login : undefined), false); @@ -460,10 +462,10 @@ export class TeamExtension { } private logDebugInformation(): void { - Logger.LogDebug("Acct: " + this._serverContext.RepoInfo.Account + " " - + "TP: " + this._serverContext.RepoInfo.TeamProject + " " - + "Coll: " + this._serverContext.RepoInfo.CollectionName + " " - + "Repo: " + this._serverContext.RepoInfo.RepositoryName + " " + Logger.LogDebug("Account: " + this._serverContext.RepoInfo.Account + " " + + "Team Project: " + this._serverContext.RepoInfo.TeamProject + " " + + "Collection: " + this._serverContext.RepoInfo.CollectionName + " " + + "Repository: " + this._serverContext.RepoInfo.RepositoryName + " " + "UserCustomDisplayName: " + this._serverContext.UserInfo.CustomDisplayName + " " + "UserProviderDisplayName: " + this._serverContext.UserInfo.ProviderDisplayName + " " + "UserId: " + this._serverContext.UserInfo.Id + " "); @@ -473,6 +475,8 @@ export class TeamExtension { Logger.LogDebug("gitCurrentBranch: " + this._gitContext.CurrentBranch); Logger.LogDebug("gitCurrentRef: " + this._gitContext.CurrentRef); Logger.LogDebug("gitIsSsh: " + this._gitContext.IsSsh); + Logger.LogDebug("proxy: " + (Utils.IsProxyEnabled() ? "enabled" : "not enabled") + + ", team services: " + this._serverContext.RepoInfo.IsTeamServices.toString()); } private logStart(loggingLevel: string, rootPath: string): void { @@ -520,8 +524,12 @@ export class TeamExtension { //Logs an error to the logger and sends an exception to telemetry service private reportError(message: string, reason?: any): void { Logger.LogError(message); - if (reason !== undefined && (Utils.IsUnauthorized(reason) || Utils.IsOffline(reason))) { - //Don't log exceptions for Unauthorized or Offline scenarios + if (reason && reason.message) { + // Log additional information for debugging purposes + Logger.LogDebug(reason.message); + } + if (reason !== undefined && (Utils.IsUnauthorized(reason) || Utils.IsOffline(reason) || Utils.IsProxyIssue(reason))) { + //Don't log exceptions for Unauthorized, Offline or Proxy scenarios return; } this._telemetry.SendException(message); diff --git a/test-integration/clients/teamservicesclient.integration.test.ts b/test-integration/clients/teamservicesclient.integration.test.ts index 81e7ccd91b..a06529a914 100644 --- a/test-integration/clients/teamservicesclient.integration.test.ts +++ b/test-integration/clients/teamservicesclient.integration.test.ts @@ -9,7 +9,7 @@ import { TestSettings } from "../helpers-integration/testsettings"; import { CredentialManager } from "../../src/helpers/credentialmanager"; import { TeamServerContext } from "../../src/contexts/servercontext"; -import { QTeamServicesApi } from "../../src/clients/teamservicesclient"; +import { TeamServicesApi } from "../../src/clients/teamservicesclient"; var chai = require("chai"); /* tslint:disable:no-unused-variable */ @@ -35,61 +35,54 @@ describe("TeamServicesClient-Integration", function() { return credentialManager.RemoveCredentials(TestSettings.Account()); }); - it("should verify repositoryClient.getVstsInfo", function(done) { + it("should verify repositoryClient.getVstsInfo", async function(done) { this.timeout(TestSettings.TestTimeout()); //http://mochajs.org/#timeouts - let repositoryClient: QTeamServicesApi = new QTeamServicesApi(TestSettings.RemoteRepositoryUrl(), [CredentialManager.GetCredentialHandler()]); - repositoryClient.getVstsInfo().then( - function (repoInfo) { - //console.log(repoInfo); - assert.isNotNull(repoInfo, "repoInfo was null when it shouldn't have been"); - assert.equal(repoInfo.serverUrl, TestSettings.AccountUrl()); - assert.equal(repoInfo.collection.name, TestSettings.CollectionName()); - assert.equal(repoInfo.repository.remoteUrl, TestSettings.RemoteRepositoryUrl()); - assert.equal(repoInfo.repository.id, TestSettings.RepositoryId()); - expect(repoInfo.repository.name).to.equal(TestSettings.RepositoryName()); - done(); - }, - function (err) { - done(err); - } - ); + try { + let repositoryClient: TeamServicesApi = new TeamServicesApi(TestSettings.RemoteRepositoryUrl(), [CredentialManager.GetCredentialHandler()]); + let repoInfo: any = await repositoryClient.getVstsInfo(); + assert.isNotNull(repoInfo, "repoInfo was null when it shouldn't have been"); + assert.equal(repoInfo.serverUrl, TestSettings.AccountUrl()); + assert.equal(repoInfo.collection.name, TestSettings.CollectionName()); + assert.equal(repoInfo.repository.remoteUrl, TestSettings.RemoteRepositoryUrl()); + assert.equal(repoInfo.repository.id, TestSettings.RepositoryId()); + expect(repoInfo.repository.name).to.equal(TestSettings.RepositoryName()); + done(); + } catch (err) { + done(err); + } }); - it("should verify repositoryClient.getVstsInfo and 404", function(done) { + it("should verify repositoryClient.getVstsInfo and 404", async function(done) { this.timeout(TestSettings.TestTimeout()); //http://mochajs.org/#timeouts - let repositoryClient: QTeamServicesApi = new QTeamServicesApi(TestSettings.RemoteRepositoryUrl() + "1", [CredentialManager.GetCredentialHandler()]); - repositoryClient.getVstsInfo().then( - function (repoInfo) { - //console.log(repoInfo); - done(); - }, - function (err) { - assert.isNotNull(err, "err was null when it shouldn't have been"); - expect(err.statusCode).to.equal(404); - done(); - } - ); + try { + let repositoryClient: TeamServicesApi = new TeamServicesApi(TestSettings.RemoteRepositoryUrl() + "1", [CredentialManager.GetCredentialHandler()]); + let repoInfo: any = await repositoryClient.getVstsInfo(); + assert.isNull(repoInfo); + done(); + } catch (err) { + assert.isNotNull(err, "err was null when it shouldn't have been"); + expect(err.statusCode).to.equal(404); + done(); + } }); - it("should verify accountClient.connect", function(done) { + it("should verify accountClient.connect", async function(done) { this.timeout(TestSettings.TestTimeout()); //http://mochajs.org/#timeouts - let accountClient: QTeamServicesApi = new QTeamServicesApi(TestSettings.AccountUrl(), [CredentialManager.GetCredentialHandler()]); - accountClient.connect().then( - function (settings) { - //console.log(settings); - assert.isNotNull(settings, "settings was null when it shouldn't have been"); - assert.isNotNull(settings.providerDisplayName); - assert.isNotNull(settings.customDisplayName); - assert.isNotNull(settings.authorizedUser.providerDisplayName); - assert.isNotNull(settings.authorizedUser.customDisplayName); - done(); - }, - function (err) { - done(err); - } - ); + try { + let accountClient: TeamServicesApi = new TeamServicesApi(TestSettings.AccountUrl(), [CredentialManager.GetCredentialHandler()]); + let settings: any = await accountClient.connect(); + //console.log(settings); + assert.isNotNull(settings, "settings was null when it shouldn't have been"); + assert.isNotNull(settings.providerDisplayName); + assert.isNotNull(settings.customDisplayName); + assert.isNotNull(settings.authorizedUser.providerDisplayName); + assert.isNotNull(settings.authorizedUser.customDisplayName); + done(); + } catch (err) { + done(err); + } }); }); diff --git a/test-integration/services/build.integration.test.ts b/test-integration/services/build.integration.test.ts index 01c7065fc4..105cd6d98b 100644 --- a/test-integration/services/build.integration.test.ts +++ b/test-integration/services/build.integration.test.ts @@ -7,6 +7,8 @@ import { Mocks } from "../helpers-integration/mocks"; import { TestSettings } from "../helpers-integration/testsettings"; +import { Build, BuildBadge } from "vso-node-api/interfaces/BuildInterfaces"; + import { CredentialManager } from "../../src/helpers/credentialmanager"; import { TeamServerContext } from "../../src/contexts/servercontext"; import { BuildService } from "../../src/services/build"; @@ -36,7 +38,7 @@ describe("BuildService-Integration", function() { return credentialManager.RemoveCredentials(TestSettings.Account()); }); - it("should verify BuildService.GetBuildDefinitions", function(done) { + it("should verify BuildService.GetBuildDefinitions", async function(done) { this.timeout(TestSettings.TestTimeout()); //http://mochajs.org/#timeouts var ctx: TeamServerContext = Mocks.TeamServerContext(TestSettings.RemoteRepositoryUrl()); @@ -44,21 +46,19 @@ describe("BuildService-Integration", function() { ctx.RepoInfo = Mocks.RepositoryInfo(); ctx.UserInfo = undefined; - let svc: BuildService = new BuildService(ctx); - svc.GetBuildDefinitions(TestSettings.TeamProject()).then( - function (definitions) { - assert.isNotNull(definitions, "definitions was null when it shouldn't have been"); - //console.log(definitions.length); - expect(definitions.length).to.equal(1); - done(); - }, - function (err) { - done(err); - } - ); + try { + let svc: BuildService = new BuildService(ctx); + let definitions = await svc.GetBuildDefinitions(TestSettings.TeamProject()); + assert.isNotNull(definitions, "definitions was null when it shouldn't have been"); + //console.log(definitions.length); + expect(definitions.length).to.equal(1); + done(); + } catch (err) { + done (err); + } }); - it("should verify BuildService.GetBuildById", function(done) { + it("should verify BuildService.GetBuildById", async function(done) { this.timeout(TestSettings.TestTimeout()); //http://mochajs.org/#timeouts var ctx: TeamServerContext = Mocks.TeamServerContext(TestSettings.RemoteRepositoryUrl()); @@ -66,21 +66,19 @@ describe("BuildService-Integration", function() { ctx.RepoInfo = Mocks.RepositoryInfo(); ctx.UserInfo = undefined; - let svc: BuildService = new BuildService(ctx); - svc.GetBuildById(TestSettings.BuildId()).then( - function (build) { - assert.isNotNull(build, "build was null when it shouldn't have been"); - //console.log(definitions.length); - expect(build.buildNumber).to.equal(TestSettings.BuildId().toString()); - done(); - }, - function (err) { - done(err); - } - ); + try { + let svc: BuildService = new BuildService(ctx); + let build: Build = await svc.GetBuildById(TestSettings.BuildId()); + assert.isNotNull(build, "build was null when it shouldn't have been"); + //console.log(definitions.length); + expect(build.buildNumber).to.equal(TestSettings.BuildId().toString()); + done(); + } catch (err) { + done(err); + } }); - it("should verify BuildService.GetBuildsByDefinitionId", function(done) { + it("should verify BuildService.GetBuildsByDefinitionId", async function(done) { this.timeout(TestSettings.TestTimeout()); //http://mochajs.org/#timeouts var ctx: TeamServerContext = Mocks.TeamServerContext(TestSettings.RemoteRepositoryUrl()); @@ -88,21 +86,19 @@ describe("BuildService-Integration", function() { ctx.RepoInfo = Mocks.RepositoryInfo(); ctx.UserInfo = undefined; - let svc: BuildService = new BuildService(ctx); - svc.GetBuildsByDefinitionId(TestSettings.TeamProject(), TestSettings.BuildDefinitionId()).then( - function (builds) { - assert.isNotNull(builds, "builds was null when it shouldn't have been"); - //console.log(definitions.length); - expect(builds.length).to.equal(1); - done(); - }, - function (err) { - done(err); - } - ); + try { + let svc: BuildService = new BuildService(ctx); + let builds: Build[] = await svc.GetBuildsByDefinitionId(TestSettings.TeamProject(), TestSettings.BuildDefinitionId()); + assert.isNotNull(builds, "builds was null when it shouldn't have been"); + //console.log(definitions.length); + expect(builds.length).to.equal(1); + done(); + } catch (err) { + done(err); + } }); - it("should verify BuildService.GetBuildBadge", function(done) { + it("should verify BuildService.GetBuildBadge", async function(done) { this.timeout(TestSettings.TestTimeout()); //http://mochajs.org/#timeouts var ctx: TeamServerContext = Mocks.TeamServerContext(TestSettings.RemoteRepositoryUrl()); @@ -110,16 +106,14 @@ describe("BuildService-Integration", function() { ctx.RepoInfo = Mocks.RepositoryInfo(); ctx.UserInfo = undefined; - let svc: BuildService = new BuildService(ctx); - svc.GetBuildBadge(TestSettings.TeamProject(), WellKnownRepositoryTypes.TfsGit, TestSettings.RepositoryId(), "refs/heads/master").then( - function (badge) { - assert.isNotNull(badge, "badge was null when it shouldn't have been"); - done(); - }, - function (err) { - done(err); - } - ); + try { + let svc: BuildService = new BuildService(ctx); + let badge: BuildBadge = await svc.GetBuildBadge(TestSettings.TeamProject(), WellKnownRepositoryTypes.TfsGit, TestSettings.RepositoryId(), "refs/heads/master"); + assert.isNotNull(badge, "badge was null when it shouldn't have been"); + done(); + } catch (err) { + done(err); + } }); }); diff --git a/test-integration/services/gitvc.integration.test.ts b/test-integration/services/gitvc.integration.test.ts index 3506634edd..56b543f6d6 100644 --- a/test-integration/services/gitvc.integration.test.ts +++ b/test-integration/services/gitvc.integration.test.ts @@ -7,6 +7,8 @@ import { Mocks } from "../helpers-integration/mocks"; import { TestSettings } from "../helpers-integration/testsettings"; +import { GitPullRequest, GitRepository } from "vso-node-api/interfaces/GitInterfaces"; + import { CredentialManager } from "../../src/helpers/credentialmanager"; import { TeamServerContext } from "../../src/contexts/servercontext"; import { GitVcService, PullRequestScore } from "../../src/services/gitvc"; @@ -35,7 +37,7 @@ describe("GitVcService-Integration", function() { return credentialManager.RemoveCredentials(TestSettings.Account()); }); - it("should verify GitVcService.GetRepositories", function(done) { + it("should verify GitVcService.GetRepositories", async function(done) { this.timeout(TestSettings.TestTimeout()); //http://mochajs.org/#timeouts var ctx: TeamServerContext = Mocks.TeamServerContext(TestSettings.RemoteRepositoryUrl()); @@ -43,21 +45,19 @@ describe("GitVcService-Integration", function() { ctx.RepoInfo = Mocks.RepositoryInfo(); ctx.UserInfo = undefined; - let svc: GitVcService = new GitVcService(ctx); - svc.GetRepositories(TestSettings.TeamProject()).then( - function (repos) { - assert.isNotNull(repos, "repos was null when it shouldn't have been"); - //console.log(repos.length); - expect(repos.length).to.equal(2); - done(); - }, - function (err) { - done(err); - } - ); + try { + let svc: GitVcService = new GitVcService(ctx); + let repos: GitRepository[] = await svc.GetRepositories(TestSettings.TeamProject()); + assert.isNotNull(repos, "repos was null when it shouldn't have been"); + //console.log(repos.length); + expect(repos.length).to.equal(2); + done(); + } catch (err) { + done(err); + } }); - it("should verify GitVcService.GetPullRequests", function(done) { + it("should verify GitVcService.GetPullRequests", async function(done) { this.timeout(TestSettings.TestTimeout()); //http://mochajs.org/#timeouts var ctx: TeamServerContext = Mocks.TeamServerContext(TestSettings.RemoteRepositoryUrl()); @@ -65,21 +65,19 @@ describe("GitVcService-Integration", function() { ctx.RepoInfo = Mocks.RepositoryInfo(); ctx.UserInfo = undefined; - let svc: GitVcService = new GitVcService(ctx); - svc.GetPullRequests(ctx.RepoInfo.RepositoryId).then( - function (requests) { - assert.isNotNull(requests, "requests was null when it shouldn't have been"); - //console.log(requests.length); - expect(requests.length).to.equal(4); - done(); - }, - function (err) { - done(err); - } - ); + try { + let svc: GitVcService = new GitVcService(ctx); + let requests: GitPullRequest[] = await svc.GetPullRequests(ctx.RepoInfo.RepositoryId); + assert.isNotNull(requests, "requests was null when it shouldn't have been"); + //console.log(requests.length); + expect(requests.length).to.equal(4); + done(); + } catch (err) { + done(err); + } }); - it("should verify GitVcService.GetPullRequestScore", function(done) { + it("should verify GitVcService.GetPullRequestScore", async function(done) { this.timeout(TestSettings.TestTimeout()); //http://mochajs.org/#timeouts var ctx: TeamServerContext = Mocks.TeamServerContext(TestSettings.RemoteRepositoryUrl()); @@ -87,8 +85,9 @@ describe("GitVcService-Integration", function() { ctx.RepoInfo = Mocks.RepositoryInfo(); ctx.UserInfo = undefined; - let svc: GitVcService = new GitVcService(ctx); - svc.GetPullRequests(ctx.RepoInfo.RepositoryId).then((requests) => { + try { + let svc: GitVcService = new GitVcService(ctx); + let requests: GitPullRequest[] = await svc.GetPullRequests(ctx.RepoInfo.RepositoryId); let totals = []; requests.forEach(request => { totals.push({ "id" : request.pullRequestId, "score" : GitVcService.GetPullRequestScore(request) }); @@ -105,9 +104,9 @@ describe("GitVcService-Integration", function() { } } done(); - }).catch((err) => { + } catch (err) { done(err); - }); + } }); }); diff --git a/test-integration/services/workitemtracking.integration.test.ts b/test-integration/services/workitemtracking.integration.test.ts index a9495a8a1b..1bfddaad7b 100644 --- a/test-integration/services/workitemtracking.integration.test.ts +++ b/test-integration/services/workitemtracking.integration.test.ts @@ -7,10 +7,12 @@ import { Mocks } from "../helpers-integration/mocks"; import { TestSettings } from "../helpers-integration/testsettings"; +import { QueryHierarchyItem, WorkItem, WorkItemType } from "vso-node-api/interfaces/WorkItemTrackingInterfaces"; + import { WitQueries } from "../../src/helpers/constants"; import { CredentialManager } from "../../src/helpers/credentialmanager"; import { TeamServerContext } from "../../src/contexts/servercontext"; -import { WorkItemTrackingService } from "../../src/services/workitemtracking"; +import { SimpleWorkItem, WorkItemTrackingService } from "../../src/services/workitemtracking"; var chai = require("chai"); /* tslint:disable:no-unused-variable */ @@ -38,7 +40,7 @@ describe("WorkItemTrackingService-Integration", function() { //Even though CreateWorkItem isn't exposed in the extension, run it so we can get to 200, then 20,000 //work items in the team project. At that point, we can test other scenarios around WIT. - it("should verify WorkItemTrackingService.CreateWorkItem", function(done) { + it("should verify WorkItemTrackingService.CreateWorkItem", async function(done) { this.timeout(TestSettings.TestTimeout()); //http://mochajs.org/#timeouts var ctx: TeamServerContext = Mocks.TeamServerContext(TestSettings.RemoteRepositoryUrl()); @@ -46,44 +48,22 @@ describe("WorkItemTrackingService-Integration", function() { ctx.RepoInfo = Mocks.RepositoryInfo(); ctx.UserInfo = undefined; - // for (var index = 0; index < 250; index++) { - // let itemType : string = "Task"; - // let today: Date = new Date(); - // let title: string = "Task created by integration test (" + today.toLocaleString() + ")"; - // let svc: WorkItemTrackingService = new WorkItemTrackingService(ctx); - // svc.CreateWorkItem(ctx, itemType, title).then( - // function (item) { - // assert.isNotNull(item, "item was null when it shouldn't have been"); - // if (index === 250) { - // done(); - // } - // }, - // function (err) { - // //This will occur if the PAT used by the integration tests don't have RW on WIT - // //assert.contains(err, "401"); - // done(err); - // } - // ); - // } - - let itemType : string = "Bug"; - let today: Date = new Date(); - let title: string = "Work item created by integration test (" + today.toLocaleString() + ")"; - let svc: WorkItemTrackingService = new WorkItemTrackingService(ctx); - svc.CreateWorkItem(ctx, itemType, title).then( - function (item) { - assert.isNotNull(item, "item was null when it shouldn't have been"); - done(); - }, - function (err) { - //This will occur if the PAT used by the integration tests don't have RW on WIT - //assert.contains(err, "401"); - done(err); - } - ); + try { + let itemType : string = "Bug"; + let today: Date = new Date(); + let title: string = "Work item created by integration test (" + today.toLocaleString() + ")"; + let svc: WorkItemTrackingService = new WorkItemTrackingService(ctx); + let item: WorkItem = await svc.CreateWorkItem(ctx, itemType, title); + assert.isNotNull(item, "item was null when it shouldn't have been"); + done(); + } catch (err) { + //This will occur if the PAT used by the integration tests don't have RW on WIT + //assert.contains(err, "401"); + done(err); + } }); - it("should verify WorkItemTrackingService.GetWorkItems", function(done) { + it("should verify WorkItemTrackingService.GetWorkItems", async function(done) { this.timeout(TestSettings.TestTimeout()); //http://mochajs.org/#timeouts var ctx: TeamServerContext = Mocks.TeamServerContext(TestSettings.RemoteRepositoryUrl()); @@ -91,21 +71,18 @@ describe("WorkItemTrackingService-Integration", function() { ctx.RepoInfo = Mocks.RepositoryInfo(); ctx.UserInfo = undefined; - let svc: WorkItemTrackingService = new WorkItemTrackingService(ctx); - svc.GetWorkItems(TestSettings.TeamProject(), WitQueries.MyWorkItems).then( - function (items) { - assert.isNotNull(items, "items was null when it shouldn't have been"); - //console.log(items); - done(); - }, - function (err) { - //assert.contains(err, "401"); - done(err); - } - ); + try { + let svc: WorkItemTrackingService = new WorkItemTrackingService(ctx); + let items: SimpleWorkItem[] = await svc.GetWorkItems(TestSettings.TeamProject(), WitQueries.MyWorkItems); + assert.isNotNull(items, "items was null when it shouldn't have been"); + //console.log(items); + done(); + } catch (err) { + done(err); + } }); - it("should verify WorkItemTrackingService.GetQueryResultCount", function(done) { + it("should verify WorkItemTrackingService.GetQueryResultCount", async function(done) { this.timeout(TestSettings.TestTimeout()); //http://mochajs.org/#timeouts var ctx: TeamServerContext = Mocks.TeamServerContext(TestSettings.RemoteRepositoryUrl()); @@ -113,20 +90,18 @@ describe("WorkItemTrackingService-Integration", function() { ctx.RepoInfo = Mocks.RepositoryInfo(); ctx.UserInfo = undefined; - let svc: WorkItemTrackingService = new WorkItemTrackingService(ctx); - svc.GetQueryResultCount(TestSettings.TeamProject(), WitQueries.MyWorkItems).then( - function (count) { - //console.log("count = " + count); - expect(count).to.equal(0); - done(); - }, - function (err) { - done(err); - } - ); + try { + let svc: WorkItemTrackingService = new WorkItemTrackingService(ctx); + let count: number = await svc.GetQueryResultCount(TestSettings.TeamProject(), WitQueries.MyWorkItems); + //console.log("count = " + count); + expect(count).to.equal(0); + done(); + } catch (err) { + done(err); + } }); - it("should verify WorkItemTrackingService.GetWorkItemHierarchyItems", function(done) { + it("should verify WorkItemTrackingService.GetWorkItemHierarchyItems", async function(done) { this.timeout(TestSettings.TestTimeout()); //http://mochajs.org/#timeouts var ctx: TeamServerContext = Mocks.TeamServerContext(TestSettings.RemoteRepositoryUrl()); @@ -134,21 +109,19 @@ describe("WorkItemTrackingService-Integration", function() { ctx.RepoInfo = Mocks.RepositoryInfo(); ctx.UserInfo = undefined; - let svc: WorkItemTrackingService = new WorkItemTrackingService(ctx); - svc.GetWorkItemHierarchyItems(TestSettings.TeamProject()).then( - function (items) { - assert.isNotNull(items); - //console.log(items.length); - expect(items.length).to.equal(2); - done(); - }, - function (err) { - done(err); - } - ); + try { + let svc: WorkItemTrackingService = new WorkItemTrackingService(ctx); + let items: QueryHierarchyItem[] = await svc.GetWorkItemHierarchyItems(TestSettings.TeamProject()); + assert.isNotNull(items); + //console.log(items.length); + expect(items.length).to.equal(2); + done(); + } catch (err) { + done(err); + } }); - it("should verify WorkItemTrackingService.GetWorkItemQuery", function(done) { + it("should verify WorkItemTrackingService.GetWorkItemQuery", async function(done) { this.timeout(TestSettings.TestTimeout()); //http://mochajs.org/#timeouts var ctx: TeamServerContext = Mocks.TeamServerContext(TestSettings.RemoteRepositoryUrl()); @@ -156,26 +129,21 @@ describe("WorkItemTrackingService-Integration", function() { ctx.RepoInfo = Mocks.RepositoryInfo(); ctx.UserInfo = undefined; - let svc: WorkItemTrackingService = new WorkItemTrackingService(ctx); - svc.GetWorkItemQuery(TestSettings.TeamProject(), TestSettings.WorkItemQueryPath()).then( - function (query) { - assert.isNotNull(query); - //console.log(query); - expect(query.id).to.equal(TestSettings.WorkItemQueryId()); - svc.GetWorkItems(TestSettings.TeamProject(), query.wiql).then((items) => { - assert.isTrue(items.length > 0); - done(); - }).catch((err) => { - done(err); - }); - }, - function (err) { - done(err); - } - ); + try { + let svc: WorkItemTrackingService = new WorkItemTrackingService(ctx); + let query: QueryHierarchyItem = await svc.GetWorkItemQuery(TestSettings.TeamProject(), TestSettings.WorkItemQueryPath()); + assert.isNotNull(query); + //console.log(query); + expect(query.id).to.equal(TestSettings.WorkItemQueryId()); + let items: SimpleWorkItem[] = await svc.GetWorkItems(TestSettings.TeamProject(), query.wiql); + assert.isTrue(items.length > 0); + done(); + } catch (err) { + done(err); + } }); - it("should verify WorkItemTrackingService.GetWorkItemTypes", function(done) { + it("should verify WorkItemTrackingService.GetWorkItemTypes", async function(done) { this.timeout(TestSettings.TestTimeout()); //http://mochajs.org/#timeouts var ctx: TeamServerContext = Mocks.TeamServerContext(TestSettings.RemoteRepositoryUrl()); @@ -183,21 +151,19 @@ describe("WorkItemTrackingService-Integration", function() { ctx.RepoInfo = Mocks.RepositoryInfo(); ctx.UserInfo = undefined; - let svc: WorkItemTrackingService = new WorkItemTrackingService(ctx); - svc.GetWorkItemTypes(TestSettings.TeamProject()).then( - function (items) { - assert.isNotNull(items); - //console.log(items.length); - expect(items.length).to.equal(7); - done(); - }, - function (err) { - done(err); - } - ); + try { + let svc: WorkItemTrackingService = new WorkItemTrackingService(ctx); + let items: WorkItemType[] = await svc.GetWorkItemTypes(TestSettings.TeamProject()); + assert.isNotNull(items); + //console.log(items.length); + expect(items.length).to.equal(7); + done(); + } catch (err) { + done(err); + } }); - it("should verify WorkItemTrackingService.GetWorkItemById", function(done) { + it("should verify WorkItemTrackingService.GetWorkItemById", async function(done) { this.timeout(TestSettings.TestTimeout()); //http://mochajs.org/#timeouts var ctx: TeamServerContext = Mocks.TeamServerContext(TestSettings.RemoteRepositoryUrl()); @@ -205,18 +171,16 @@ describe("WorkItemTrackingService-Integration", function() { ctx.RepoInfo = Mocks.RepositoryInfo(); ctx.UserInfo = undefined; - let svc: WorkItemTrackingService = new WorkItemTrackingService(ctx); - svc.GetWorkItemById(TestSettings.TeamProject(), TestSettings.WorkItemId().toString()).then( - function (item) { - assert.isNotNull(item); - //console.log(items.length); - expect(item.id).to.equal(TestSettings.WorkItemId().toString()); - done(); - }, - function (err) { - done(err); - } - ); + try { + let svc: WorkItemTrackingService = new WorkItemTrackingService(ctx); + let item: SimpleWorkItem = await svc.GetWorkItemById(TestSettings.TeamProject(), TestSettings.WorkItemId().toString()); + assert.isNotNull(item); + //console.log(items.length); + expect(item.id).to.equal(TestSettings.WorkItemId().toString()); + done(); + } catch (err) { + done(err); + } }); it("should verify WorkItemTrackingService.GetWorkItemQuery with a Link query", function(done) { diff --git a/test/helpers/utils.test.ts b/test/helpers/utils.test.ts index 2ac58bf3d2..19c4287ded 100644 --- a/test/helpers/utils.test.ts +++ b/test/helpers/utils.test.ts @@ -108,4 +108,42 @@ describe("Utils", function() { expect(Utils.GetBuildResultIcon(undefined)).to.equal("octicon-question"); }); + it("should verify IsProxyEnabled", function() { + let httpProxy: string = process.env.HTTP_PROXY; + let httpsProxy: string = process.env.HTTPS_PROXY; + try { + process.env.HTTP_PROXY = "vsts-vscode unit tests"; + assert.isTrue(Utils.IsProxyEnabled()); + process.env.HTTP_PROXY = ""; + process.env.HTTPS_PROXY = "vsts-vscode unit tests"; + assert.isTrue(Utils.IsProxyEnabled()); + process.env.HTTPS_PROXY = ""; + } finally { + if (httpProxy) { + process.env.HTTP_PROXY = httpProxy; + } + if (httpsProxy) { + process.env.HTTPS_PROXY = httpsProxy; + } + } + }); + + it("should verify IsProxyIssue", function() { + let httpProxy: string = process.env.HTTP_PROXY; + try { + process.env.HTTP_PROXY = "vsts-vscode unit tests"; + let reason = { code: "ECONNRESET" }; + assert.isTrue(Utils.IsProxyIssue(reason)); + let reason2 = { statusCode: "ECONNRESET" }; + assert.isTrue(Utils.IsProxyIssue(reason2)); + let reason3 = { code: "ECONNREFUSED" }; + assert.isTrue(Utils.IsProxyIssue(reason3)); + let reason4 = { statusCode: "ECONNREFUSED" }; + assert.isTrue(Utils.IsProxyIssue(reason4)); + } finally { + if (httpProxy) { + process.env.HTTP_PROXY = httpProxy; + } + } + }); }); diff --git a/test/services/gitvc.test.ts b/test/services/gitvc.test.ts index 14349e8aed..f38be3613f 100644 --- a/test/services/gitvc.test.ts +++ b/test/services/gitvc.test.ts @@ -87,7 +87,10 @@ describe("GitVcService", function() { status: undefined, targetRefName: undefined, title: undefined, - upgraded: undefined, + autoCompleteSetBy: undefined, + closedBy: undefined, + artifactId: undefined, + supportsIterations: undefined, url: undefined, workItemRefs: undefined }; diff --git a/typings/vso-node-api/vso-node-api.d.ts b/typings/vso-node-api/vso-node-api.d.ts deleted file mode 100644 index a7feb8add8..0000000000 --- a/typings/vso-node-api/vso-node-api.d.ts +++ /dev/null @@ -1,18340 +0,0 @@ -/** originally "../node/node.d.ts"" */ -/// -/// -declare module 'vso-node-api/Serialization' { - /** - * Metadata for deserializing an enum field on a contract/type - */ - export interface ContractEnumMetadata { - enumValues?: { - [name: string]: number; - }; - } - export interface SerializationData { - requestTypeMetadata?: ContractMetadata; - responseTypeMetadata?: ContractMetadata; - responseIsCollection: boolean; - } - /** - * Metadata for deserializing a particular field on a contract/type - */ - export interface ContractFieldMetadata { - isArray?: boolean; - isDate?: boolean; - enumType?: ContractEnumMetadata; - typeInfo?: ContractMetadata; - isDictionary?: boolean; - dictionaryKeyIsDate?: boolean; - dictionaryValueIsDate?: boolean; - dictionaryKeyEnumType?: ContractEnumMetadata; - dictionaryValueEnumType?: ContractEnumMetadata; - dictionaryValueTypeInfo?: ContractMetadata; - dictionaryValueFieldInfo?: ContractFieldMetadata; - } - /** - * Metadata required for deserializing a given type - */ - export interface ContractMetadata { - fields?: { - [fieldName: string]: ContractFieldMetadata; - }; - } - export interface IWebApiArrayResult { - count: number; - value: any[]; - } - /** - * Module for handling serialization and deserialization of data contracts - * (contracts sent from the server using the VSO default REST api serialization settings) - */ - export module ContractSerializer { - /** - * Process a contract in its raw form (e.g. date fields are Dates, and Enums are numbers) and - * return a pure JSON object that can be posted to REST endpoint. - * - * @param data The object to serialize - * @param contractMetadata The type info/metadata for the contract type being serialized - * @param preserveOriginal If true, don't modify the original object. False modifies the original object (the return value points to the data argument). - */ - function serialize(data: any, contractMetadata: ContractMetadata, preserveOriginal?: boolean): any; - /** - * Process a pure JSON object (e.g. that came from a REST call) and transform it into a JS object - * where date strings are converted to Date objects and enum values are converted from strings into - * their numerical value. - * - * @param data The object to deserialize - * @param contractMetadata The type info/metadata for the contract type being deserialize - * @param preserveOriginal If true, don't modify the original object. False modifies the original object (the return value points to the data argument). - * @param unwrapWrappedCollections If true check for wrapped arrays (REST apis will not return arrays directly as the root result but will instead wrap them in a { values: [], count: 0 } object. - */ - function deserialize(data: any, contractMetadata: ContractMetadata, preserveOriginal?: boolean, unwrapWrappedCollections?: boolean): any; - } - -} -declare module 'vso-node-api/interfaces/common/VsoBaseInterfaces' { - import Serialization = require('vso-node-api/Serialization'); - /** - * Information about the location of a REST API resource - */ - export interface ApiResourceLocation { - /** - * Area name for this resource - */ - area: string; - /** - * Unique Identifier for this location - */ - id: string; - /** - * Maximum api version that this resource supports (current server version for this resource) - */ - maxVersion: string; - /** - * Minimum api version that this resource supports - */ - minVersion: string; - /** - * The latest version of this resource location that is in "Release" (non-preview) mode - */ - releasedVersion: string; - /** - * Resource name - */ - resourceName: string; - /** - * The current resource version supported by this resource location - */ - resourceVersion: number; - /** - * This location's route template (templated relative path) - */ - routeTemplate: string; - } - export interface IHeaders { - [key: string]: any; - } - export interface IBasicCredentials { - username: string; - password: string; - } - export interface IRequestHandler { - prepareRequest(options: any): void; - canHandleAuthentication(res: IHttpResponse): boolean; - handleAuthentication(httpClient: any, protocol: any, options: any, objs: any, finalCallback: any): void; - } - export interface IHttpResponse { - statusCode?: number; - headers: any; - } - export interface IQCoreApi { - connect(): Q.Promise; - } - export interface IHttpClient { - get(verb: string, requestUrl: string, headers: any, onResult: (err: any, res: IHttpResponse, contents: string) => void): void; - send(verb: string, requestUrl: string, objs: any, headers: any, onResult: (err: any, res: IHttpResponse, contents: string) => void): void; - sendFile(verb: string, requestUrl: string, content: NodeJS.ReadableStream, headers: any, onResult: (err: any, res: IHttpResponse, contents: string) => void): void; - getStream(requestUrl: string, apiVersion: string, headers: any, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - makeAcceptHeader(type: string, apiVersion: string): string; - request(protocol: any, options: any, body: any, onResult: (err: any, res: IHttpResponse, contents: string) => void): void; - } - export interface IRestClient { - baseUrl: string; - httpClient: IHttpClient; - getJson(relativeUrl: string, apiVersion: string, customHeaders: IHeaders, serializationData: Serialization.SerializationData, onResult: (err: any, statusCode: number, obj: any) => void): void; - options(requestUrl: string, onResult: (err: any, statusCode: number, obj: any) => void): void; - create(relativeUrl: string, apiVersion: string, resources: any, customHeaders: IHeaders, serializationData: Serialization.SerializationData, onResult: (err: any, statusCode: number, obj: any) => void): void; - update(relativeUrl: string, apiVersion: string, resources: any, customHeaders: IHeaders, serializationData: Serialization.SerializationData, onResult: (err: any, statusCode: number, obj: any) => void): void; - uploadFile(verb: string, relativeUrl: string, apiVersion: string, filePath: string, customHeaders: IHeaders, serializationData: Serialization.SerializationData, onResult: (err: any, statusCode: number, obj: any) => void): void; - uploadStream(verb: string, relativeUrl: string, apiVersion: string, contentStream: NodeJS.ReadableStream, customHeaders: IHeaders, serializationData: Serialization.SerializationData, onResult: (err: any, statusCode: number, obj: any) => void): void; - replace(relativeUrl: string, apiVersion: string, resources: any, customHeaders: IHeaders, serializationData: Serialization.SerializationData, onResult: (err: any, statusCode: number, obj: any) => void): void; - } - -} -declare module 'vso-node-api/HttpClient' { - /// - import http = require("http"); - import ifm = require('vso-node-api/interfaces/common/VsoBaseInterfaces'); - export class HttpClient implements ifm.IHttpClient { - userAgent: string; - handlers: ifm.IRequestHandler[]; - socketTimeout: number; - isSsl: boolean; - constructor(userAgent: string, handlers?: ifm.IRequestHandler[], socketTimeout?: number); - get(verb: string, requestUrl: string, headers: ifm.IHeaders, onResult: (err: any, res: http.ClientResponse, contents: string) => void): void; - send(verb: string, requestUrl: string, objs: any, headers: ifm.IHeaders, onResult: (err: any, res: http.ClientResponse, contents: string) => void): void; - sendFile(verb: string, requestUrl: string, content: NodeJS.ReadableStream, headers: ifm.IHeaders, onResult: (err: any, res: http.ClientResponse, contents: string) => void): void; - getStream(requestUrl: string, apiVersion: string, type: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - makeAcceptHeader(type: string, apiVersion: string): string; - _getOptions(method: string, requestUrl: string, headers: any): any; - request(protocol: any, options: any, objs: any, onResult: (err: any, res: http.ClientResponse, contents: string) => void): void; - requestInternal(protocol: any, options: any, objs: any, onResult: (err: any, res: http.ClientResponse, contents: string) => void): void; - } - -} -declare module 'vso-node-api/RestClient' { - /// - import ifm = require('vso-node-api/interfaces/common/VsoBaseInterfaces'); - import Serialization = require('vso-node-api/Serialization'); - export function processResponse(url: any, res: any, contents: any, serializationData: Serialization.SerializationData, onResult: any): void; - export function enumToString(enumType: any, enumValue: number, camelCase: boolean): any; - export class RestClient implements ifm.IRestClient { - baseUrl: string; - basePath: string; - httpClient: ifm.IHttpClient; - constructor(httpClient: ifm.IHttpClient); - getJson(url: string, apiVersion: string, customHeaders: ifm.IHeaders, serializationData: Serialization.SerializationData, onResult: (err: any, statusCode: number, obj: any) => void): void; - options(url: string, onResult: (err: any, statusCode: number, obj: any) => void): void; - delete(url: string, apiVersion: string, customHeaders: ifm.IHeaders, serializationData: Serialization.SerializationData, onResult: (err: any, statusCode: number, obj: any) => void): void; - create(url: string, apiVersion: string, resources: any, customHeaders: ifm.IHeaders, serializationData: Serialization.SerializationData, onResult: (err: any, statusCode: number, obj: any) => void): void; - update(url: string, apiVersion: string, resources: any, customHeaders: ifm.IHeaders, serializationData: Serialization.SerializationData, onResult: (err: any, statusCode: number, obj: any) => void): void; - uploadFile(verb: string, url: string, apiVersion: string, filePath: string, customHeaders: ifm.IHeaders, serializationData: Serialization.SerializationData, onResult: (err: any, statusCode: number, obj: any) => void): void; - uploadStream(verb: string, url: string, apiVersion: string, contentStream: NodeJS.ReadableStream, customHeaders: ifm.IHeaders, serializationData: Serialization.SerializationData, onResult: (err: any, statusCode: number, obj: any) => void): void; - replace(url: string, apiVersion: string, resources: any, customHeaders: ifm.IHeaders, serializationData: Serialization.SerializationData, onResult: (err: any, statusCode: number, obj: any) => void): void; - _getJson(verb: string, url: string, apiVersion: string, customHeaders: ifm.IHeaders, serializationData: Serialization.SerializationData, onResult: (err: any, statusCode: number, obj: any) => void): void; - _sendJson(verb: string, url: string, apiVersion: string, data: any, customHeaders: ifm.IHeaders, serializationData: Serialization.SerializationData, onResult: (err: any, statusCode: number, obj: any) => void): void; - } - -} -declare module 'vso-node-api/VsoClient' { - /// - import Q = require("q"); - import restm = require('vso-node-api/RestClient'); - import ifm = require('vso-node-api/interfaces/common/VsoBaseInterfaces'); - export interface ClientVersioningData { - /** - * The api version string to send in the request (e.g. "1.0" or "2.0-preview.2") - */ - apiVersion?: string; - /** - * The request path string to send the request to. Looked up via an options request with the location id. - */ - requestUrl?: string; - } - export class InvalidApiResourceVersionError implements Error { - name: string; - message: string; - constructor(message?: string); - } - /** - * Base class that should be used (derived from) to make requests to VSS REST apis - */ - export class VsoClient { - private static APIS_RELATIVE_PATH; - private static PREVIEW_INDICATOR; - private _locationsByAreaPromises; - private _initializationPromise; - restClient: ifm.IRestClient; - baseUrl: string; - basePath: string; - constructor(baseUrl: string, restClient: restm.RestClient); - /** - * Compares the version on the server (locationVersion) to the api version given by the client (apiVersion). - * Returns a negative value if the location version is older (less than) the api version - * Returns 0 if the two are equal - * Returns a positive value if the location version is newer (greater than) the api version - */ - private compareResourceVersions(locationVersion, apiVersion); - /** - * Gets the route template for a resource based on its location ID and negotiates the api version - */ - getVersioningData(apiVersion: string, area: string, locationId: string, routeValues: any, queryParams?: any): Q.Promise; - /** - * Sets a promise that is waited on before any requests are issued. Can be used to asynchronously - * set the request url and auth token manager. - */ - _setInitializationPromise(promise: Q.Promise): void; - /** - * Gets information about an API resource location (route template, supported versions, etc.) - * - * @param area resource area name - * @param locationId Guid of the location to get - */ - beginGetLocation(area: string, locationId: string): Q.Promise; - private beginGetAreaLocations(area); - resolveUrl(relativeUrl: string): string; - /** - * Issues an OPTIONS request to get location objects from a location id - */ - _issueOptionsRequest(requestUrl: string, onResult: (err: any, statusCode: number, locationsResult: any) => void): void; - private getSerializedObject(object); - protected getRequestUrl(routeTemplate: string, area: string, resource: string, routeValues: any, queryParams?: any): string; - private replaceRouteValues(routeTemplate, routeValues); -// _getLinkResponseHeaders(xhr: XMLHttpRequest): { -// [relName: string]: string; -// }; - } - -} -declare module 'vso-node-api/ClientApiBases' { - import Q = require('q'); - import restm = require('vso-node-api/RestClient'); - import httpm = require('vso-node-api/HttpClient'); - import vsom = require('vso-node-api/VsoClient'); - import VsoBaseInterfaces = require('vso-node-api/interfaces/common/VsoBaseInterfaces'); - export class ClientApiBase { - baseUrl: string; - userAgent: string; - httpClient: httpm.HttpClient; - restClient: restm.RestClient; - vsoClient: vsom.VsoClient; - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[], userAgent?: string); - setUserAgent(userAgent: string): void; - connect(onResult: (err: any, statusCode: number, obj: any) => void): void; - } - export class QClientApiBase { - api: ClientApiBase; - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[], api: typeof ClientApiBase); - connect(): Q.Promise; - } - -} -declare module 'vso-node-api/interfaces/common/VSSInterfaces' { - export interface IdentityRef { - displayName: string; - id: string; - imageUrl: string; - isAadIdentity: boolean; - isContainer: boolean; - profileUrl: string; - uniqueName: string; - url: string; - } - export interface JsonPatchDocument { - } - /** - * The JSON model for a JSON Patch operation - */ - export interface JsonPatchOperation { - /** - * The path to copy from for the Move/Copy operation. - */ - from: string; - /** - * The patch operation - */ - op: Operation; - /** - * The path for the operation - */ - path: string; - /** - * The value for the operation. This is either a primitive or a JToken. - */ - value: any; - } - export enum Operation { - Add = 0, - Remove = 1, - Replace = 2, - Move = 3, - Copy = 4, - Test = 5, - } - export interface ResourceRef { - id: string; - url: string; - } - export interface VssJsonCollectionWrapper extends VssJsonCollectionWrapperBase { - value: any[]; - } - export interface VssJsonCollectionWrapperV extends VssJsonCollectionWrapperBase { - value: T; - } - export interface VssJsonCollectionWrapperBase { - count: number; - } - export var TypeInfo: { - IdentityRef: { - fields: any; - }; - JsonPatchDocument: { - fields: any; - }; - JsonPatchOperation: { - fields: any; - }; - Operation: { - enumValues: { - "add": number; - "remove": number; - "replace": number; - "move": number; - "copy": number; - "test": number; - }; - }; - OperationReference: { - fields: any; - }; - ResourceRef: { - fields: any; - }; - VssJsonCollectionWrapper: { - fields: any; - }; - VssJsonCollectionWrapperV: { - fields: any; - }; - VssJsonCollectionWrapperBase: { - fields: any; - }; - }; - -} -declare module 'vso-node-api/interfaces/CoreInterfaces' { - import VSSInterfaces = require('vso-node-api/interfaces/common/VSSInterfaces'); - export enum ConnectedServiceKind { - /** - * Custom or unknown service - */ - Custom = 0, - /** - * Azure Subscription - */ - AzureSubscription = 1, - /** - * Chef Connection - */ - Chef = 2, - /** - * Generic Connection - */ - Generic = 3, - } - export interface IdentityData { - identityIds: string[]; - } - export interface Process extends ProcessReference { - _links: any; - description: string; - id: string; - isDefault: boolean; - type: ProcessType; - } - export interface ProcessReference { - name: string; - url: string; - } - export enum ProcessType { - System = 0, - Custom = 1, - Inherited = 2, - } - export enum ProjectChangeType { - Modified = 0, - Deleted = 1, - Added = 2, - } - /** - * Contains information of the project - */ - export interface ProjectInfo { - abbreviation: string; - description: string; - id: string; - lastUpdateTime: Date; - name: string; - properties: ProjectProperty[]; - /** - * Current revision of the project - */ - revision: number; - state: any; - uri: string; - version: number; - } - export interface ProjectMessage { - project: ProjectInfo; - projectChangeType: ProjectChangeType; - } - export interface ProjectProperty { - name: string; - value: string; - } - export interface Proxy { - /** - * This is a description string - */ - description: string; - /** - * The friendly name of the server - */ - friendlyName: string; - globalDefault: boolean; - /** - * This is a string representation of the site that the proxy server is located in (e.g. "NA-WA-RED") - */ - site: string; - siteDefault: boolean; - /** - * The URL of the proxy server - */ - url: string; - } - export enum SourceControlTypes { - Tfvc = 1, - Git = 2, - } - /** - * The Team Context for an operation. - */ - export interface TeamContext { - /** - * The team project Id or name. Ignored if ProjectId is set. - */ - project: string; - /** - * The Team Project ID. Required if Project is not set. - */ - projectId: string; - /** - * The Team Id or name. Ignored if TeamId is set. - */ - team: string; - /** - * The Team Id - */ - teamId: string; - } - /** - * Represents a Team Project object. - */ - export interface TeamProject extends TeamProjectReference { - /** - * The links to other objects related to this object. - */ - _links: any; - /** - * Set of capabilities this project has (such as process template & version control). - */ - capabilities: { - [key: string]: { - [key: string]: string; - }; - }; - /** - * The shallow ref to the default team. - */ - defaultTeam: WebApiTeamRef; - } - /** - * Data contract for a TeamProjectCollection. - */ - export interface TeamProjectCollection extends TeamProjectCollectionReference { - /** - * The links to other objects related to this object. - */ - _links: any; - /** - * Project collection description. - */ - description: string; - /** - * Project collection state. - */ - state: string; - } - /** - * Reference object for a TeamProjectCollection. - */ - export interface TeamProjectCollectionReference { - /** - * Collection Id. - */ - id: string; - /** - * Collection Name. - */ - name: string; - /** - * Collection REST Url. - */ - url: string; - } - /** - * Represents a shallow reference to a TeamProject. - */ - export interface TeamProjectReference { - /** - * Project abbreviation. - */ - abbreviation: string; - /** - * The project's description (if any). - */ - description: string; - /** - * Project identifier. - */ - id: string; - /** - * Project name. - */ - name: string; - /** - * Project revision. - */ - revision: number; - /** - * Project state. - */ - state: any; - /** - * Url to the full version of the object. - */ - url: string; - } - export interface WebApiConnectedService extends WebApiConnectedServiceRef { - /** - * The user who did the OAuth authentication to created this service - */ - authenticatedBy: VSSInterfaces.IdentityRef; - /** - * Extra description on the service. - */ - description: string; - /** - * Friendly Name of service connection - */ - friendlyName: string; - /** - * Id/Name of the connection service. For Ex: Subscription Id for Azure Connection - */ - id: string; - /** - * The kind of service. - */ - kind: string; - /** - * The project associated with this service - */ - project: TeamProjectReference; - /** - * Optional uri to connect directly to the service such as https://windows.azure.com - */ - serviceUri: string; - } - export interface WebApiConnectedServiceDetails extends WebApiConnectedServiceRef { - /** - * Meta data for service connection - */ - connectedServiceMetaData: WebApiConnectedService; - /** - * Credential info - */ - credentialsXml: string; - /** - * Optional uri to connect directly to the service such as https://windows.azure.com - */ - endPoint: string; - } - export interface WebApiConnectedServiceRef { - id: string; - url: string; - } - /** - * The representation of data needed to create a tag definition which is sent across the wire. - */ - export interface WebApiCreateTagRequestData { - name: string; - } - export interface WebApiProject extends TeamProjectReference { - /** - * Set of capabilities this project has - */ - capabilities: { - [key: string]: { - [key: string]: string; - }; - }; - /** - * Reference to collection which contains this project - */ - collection: WebApiProjectCollectionRef; - /** - * Default team for this project - */ - defaultTeam: WebApiTeamRef; - } - export interface WebApiProjectCollection extends WebApiProjectCollectionRef { - /** - * Project collection description - */ - description: string; - /** - * Project collection state - */ - state: string; - } - export interface WebApiProjectCollectionRef { - /** - * Collection Tfs Url (Host Url) - */ - collectionUrl: string; - /** - * Collection Guid - */ - id: string; - /** - * Collection Name - */ - name: string; - /** - * Collection REST Url - */ - url: string; - } - /** - * The representation of a tag definition which is sent across the wire. - */ - export interface WebApiTagDefinition { - active: boolean; - id: string; - name: string; - url: string; - } - export interface WebApiTeam extends WebApiTeamRef { - /** - * Team description - */ - description: string; - /** - * Identity REST API Url to this team - */ - identityUrl: string; - } - export interface WebApiTeamRef { - /** - * Team (Identity) Guid. A Team Foundation ID. - */ - id: string; - /** - * Team name - */ - name: string; - /** - * Team REST API Url - */ - url: string; - } - export var TypeInfo: { - ConnectedServiceKind: { - enumValues: { - "custom": number; - "azureSubscription": number; - "chef": number; - "generic": number; - }; - }; - IdentityData: { - fields: any; - }; - Process: { - fields: any; - }; - ProcessReference: { - fields: any; - }; - ProcessType: { - enumValues: { - "system": number; - "custom": number; - "inherited": number; - }; - }; - ProjectChangeType: { - enumValues: { - "modified": number; - "deleted": number; - "added": number; - }; - }; - ProjectInfo: { - fields: any; - }; - ProjectMessage: { - fields: any; - }; - ProjectProperty: { - fields: any; - }; - Proxy: { - fields: any; - }; - SourceControlTypes: { - enumValues: { - "tfvc": number; - "git": number; - }; - }; - TeamContext: { - fields: any; - }; - TeamProject: { - fields: any; - }; - TeamProjectCollection: { - fields: any; - }; - TeamProjectCollectionReference: { - fields: any; - }; - TeamProjectReference: { - fields: any; - }; - WebApiConnectedService: { - fields: any; - }; - WebApiConnectedServiceDetails: { - fields: any; - }; - WebApiConnectedServiceRef: { - fields: any; - }; - WebApiCreateTagRequestData: { - fields: any; - }; - WebApiProject: { - fields: any; - }; - WebApiProjectCollection: { - fields: any; - }; - WebApiProjectCollectionRef: { - fields: any; - }; - WebApiTagDefinition: { - fields: any; - }; - WebApiTeam: { - fields: any; - }; - WebApiTeamRef: { - fields: any; - }; - }; - -} -declare module 'vso-node-api/interfaces/BuildInterfaces' { - import TfsCoreInterfaces = require('vso-node-api/interfaces/CoreInterfaces'); - import VSSInterfaces = require('vso-node-api/interfaces/common/VSSInterfaces'); - export interface AgentPoolQueue extends ShallowReference { - _links: any; - /** - * The pool used by this queue. - */ - pool: TaskAgentPoolReference; - } - export enum AgentStatus { - /** - * Indicates that the build agent cannot be contacted. - */ - Unavailable = 0, - /** - * Indicates that the build agent is currently available. - */ - Available = 1, - /** - * Indicates that the build agent has taken itself offline. - */ - Offline = 2, - } - export interface ArtifactResource { - _links: any; - /** - * The type-specific resource data. For example, "#/10002/5/drop", "$/drops/5", "\\myshare\myfolder\mydrops\5" - */ - data: string; - /** - * Link to the resource. This might include things like query parameters to download as a zip file - */ - downloadUrl: string; - /** - * Properties of Artifact Resource - */ - properties: { - [key: string]: string; - }; - /** - * The type of the resource: File container, version control folder, UNC path, etc. - */ - type: string; - /** - * Link to the resource - */ - url: string; - } - export enum AuditAction { - Add = 1, - Update = 2, - Delete = 3, - } - /** - * Data representation of a build - */ - export interface Build { - _links: any; - /** - * Build number/name of the build - */ - buildNumber: string; - /** - * Build number revision - */ - buildNumberRevision: number; - /** - * The build controller. This should only be set if the definition type is Xaml. - */ - controller: BuildController; - /** - * The definition associated with the build - */ - definition: DefinitionReference; - /** - * Indicates whether the build has been deleted. - */ - deleted: boolean; - /** - * Demands - */ - demands: any[]; - /** - * Time that the build was completed - */ - finishTime: Date; - /** - * Id of the build - */ - id: number; - keepForever: boolean; - /** - * Process or person that last changed the build - */ - lastChangedBy: VSSInterfaces.IdentityRef; - /** - * Date the build was last changed - */ - lastChangedDate: Date; - /** - * Log location of the build - */ - logs: BuildLogReference; - /** - * Orchestration plan for the build - */ - orchestrationPlan: TaskOrchestrationPlanReference; - /** - * Parameters for the build - */ - parameters: string; - /** - * The build's priority - */ - priority: QueuePriority; - /** - * The team project - */ - project: TfsCoreInterfaces.TeamProjectReference; - properties: any; - /** - * Quality of the xaml build (good, bad, etc.) - */ - quality: string; - /** - * The queue. This should only be set if the definition type is Build. - */ - queue: AgentPoolQueue; - /** - * Queue option of the build. - */ - queueOptions: QueueOptions; - /** - * The current position of the build in the queue - */ - queuePosition: number; - /** - * Time that the build was queued - */ - queueTime: Date; - /** - * Reason that the build was created - */ - reason: BuildReason; - /** - * The repository - */ - repository: BuildRepository; - /** - * The identity that queued the build - */ - requestedBy: VSSInterfaces.IdentityRef; - /** - * The identity on whose behalf the build was queued - */ - requestedFor: VSSInterfaces.IdentityRef; - /** - * The build result - */ - result: BuildResult; - /** - * Source branch - */ - sourceBranch: string; - /** - * Source version - */ - sourceVersion: string; - /** - * Time that the build was started - */ - startTime: Date; - /** - * Status of the build - */ - status: BuildStatus; - tags: string[]; - /** - * Uri of the build - */ - uri: string; - /** - * REST url of the build - */ - url: string; - validationResults: BuildRequestValidationResult[]; - } - export interface BuildAgent { - buildDirectory: string; - controller: ShallowReference; - createdDate: Date; - description: string; - enabled: boolean; - id: number; - messageQueueUrl: string; - name: string; - reservedForBuild: string; - server: ShallowReference; - status: AgentStatus; - statusMessage: string; - updatedDate: Date; - uri: string; - url: string; - } - export interface BuildArtifact { - /** - * The artifact id - */ - id: number; - /** - * The name of the artifact - */ - name: string; - /** - * The actual resource - */ - resource: ArtifactResource; - } - export interface BuildArtifactAddedEvent extends BuildUpdatedEvent { - artifact: BuildArtifact; - } - export enum BuildAuthorizationScope { - /** - * The identity used should have build service account permissions scoped to the project collection. This is useful when resources for a single build are spread across multiple projects. - */ - ProjectCollection = 1, - /** - * The identity used should have build service account permissions scoped to the project in which the build definition resides. This is useful for isolation of build jobs to a particular team project to avoid any unintentional escalation of privilege attacks during a build. - */ - Project = 2, - } - /** - * Data representation of a build badge - */ - export interface BuildBadge { - /** - * Build id, if exists that this badge corresponds to - */ - buildId: number; - /** - * Self Url that generates SVG - */ - imageUrl: string; - } - export interface BuildChangesCalculatedEvent extends BuildUpdatedEvent { - changes: Change[]; - } - export interface BuildCompletedEvent extends BuildUpdatedEvent { - } - export interface BuildController extends ShallowReference { - _links: any; - /** - * The date the controller was created. - */ - createdDate: Date; - /** - * The description of the controller. - */ - description: string; - /** - * Indicates whether the controller is enabled. - */ - enabled: boolean; - /** - * The status of the controller. - */ - status: ControllerStatus; - /** - * The date the controller was last updated. - */ - updatedDate: Date; - /** - * The controller's URI. - */ - uri: string; - } - export interface BuildDefinition extends BuildDefinitionReference { - _links: any; - /** - * Indicates whether badges are enabled for this definition - */ - badgeEnabled: boolean; - build: BuildDefinitionStep[]; - /** - * The build number format - */ - buildNumberFormat: string; - /** - * The comment entered when saving the definition - */ - comment: string; - demands: any[]; - /** - * The description - */ - description: string; - /** - * The drop location for the definition - */ - dropLocation: string; - /** - * Gets or sets the job authorization scope for builds which are queued against this definition - */ - jobAuthorizationScope: BuildAuthorizationScope; - /** - * Gets or sets the job execution timeout in minutes for builds which are queued against this definition - */ - jobTimeoutInMinutes: number; - options: BuildOption[]; - properties: any; - /** - * The repository - */ - repository: BuildRepository; - retentionRules: RetentionPolicy[]; - triggers: BuildTrigger[]; - variables: { - [key: string]: BuildDefinitionVariable; - }; - } - export interface BuildDefinitionChangedEvent { - changeType: AuditAction; - definition: BuildDefinition; - } - export interface BuildDefinitionChangingEvent { - changeType: AuditAction; - newDefinition: BuildDefinition; - originalDefinition: BuildDefinition; - } - export interface BuildDefinitionReference extends DefinitionReference { - /** - * The author of the definition. - */ - authoredBy: VSSInterfaces.IdentityRef; - /** - * If this is a draft definition, it might have a parent - */ - draftOf: DefinitionReference; - /** - * The quality of the definition document (draft, etc.) - */ - quality: DefinitionQuality; - /** - * The default queue which should be used for requests. - */ - queue: AgentPoolQueue; - } - export interface BuildDefinitionRevision { - changedBy: VSSInterfaces.IdentityRef; - changedDate: Date; - changeType: AuditAction; - comment: string; - definitionUrl: string; - name: string; - revision: number; - } - export interface BuildDefinitionSourceProvider { - /** - * Uri of the associated definition - */ - definitionUri: string; - /** - * fields associated with this build definition - */ - fields: { - [key: string]: string; - }; - /** - * Id of this source provider - */ - id: number; - /** - * The lst time this source provider was modified - */ - lastModified: Date; - /** - * Name of the source provider - */ - name: string; - /** - * Which trigger types are supported by this definition source provider - */ - supportedTriggerTypes: DefinitionTriggerType; - } - export interface BuildDefinitionStep { - alwaysRun: boolean; - continueOnError: boolean; - displayName: string; - enabled: boolean; - inputs: { - [key: string]: string; - }; - task: TaskDefinitionReference; - } - export interface BuildDefinitionTemplate { - canDelete: boolean; - category: string; - description: string; - iconTaskId: string; - id: string; - name: string; - template: BuildDefinition; - } - export interface BuildDefinitionVariable { - allowOverride: boolean; - isSecret: boolean; - value: string; - } - export interface BuildDeletedEvent extends RealtimeBuildEvent { - build: Build; - } - export interface BuildDeployment { - deployment: BuildSummary; - sourceBuild: ShallowReference; - } - export interface BuildDestroyedEvent extends RealtimeBuildEvent { - build: Build; - } - /** - * Represents a build log. - */ - export interface BuildLog extends BuildLogReference { - /** - * The date the log was created. - */ - createdOn: Date; - /** - * The date the log was last changed. - */ - lastChangedOn: Date; - /** - * The number of lines in the log. - */ - lineCount: number; - } - /** - * Data representation of a build log reference - */ - export interface BuildLogReference { - /** - * The id of the log. - */ - id: number; - /** - * The type of the log location. - */ - type: string; - /** - * Full link to the log resource. - */ - url: string; - } - export interface BuildOption { - definition: BuildOptionDefinitionReference; - enabled: boolean; - inputs: { - [key: string]: string; - }; - } - export interface BuildOptionDefinition extends BuildOptionDefinitionReference { - description: string; - groups: BuildOptionGroupDefinition[]; - inputs: BuildOptionInputDefinition[]; - name: string; - ordinal: number; - } - export interface BuildOptionDefinitionReference { - id: string; - } - export interface BuildOptionGroupDefinition { - displayName: string; - isExpanded: boolean; - name: string; - } - export interface BuildOptionInputDefinition { - defaultValue: string; - groupName: string; - help: { - [key: string]: string; - }; - label: string; - name: string; - options: { - [key: string]: string; - }; - required: boolean; - type: BuildOptionInputType; - visibleRule: string; - } - export enum BuildOptionInputType { - String = 0, - Boolean = 1, - StringList = 2, - Radio = 3, - PickList = 4, - MultiLine = 5, - } - export enum BuildPhaseStatus { - /** - * The state is not known. - */ - Unknown = 0, - /** - * The build phase completed unsuccessfully. - */ - Failed = 1, - /** - * The build phase completed successfully. - */ - Succeeded = 2, - } - export interface BuildPollingSummaryEvent { - } - export interface BuildProcessTemplate { - description: string; - fileExists: boolean; - id: number; - parameters: string; - serverPath: string; - supportedReasons: BuildReason; - teamProject: string; - templateType: ProcessTemplateType; - url: string; - version: string; - } - export enum BuildQueryOrder { - /** - * Order by finish time ascending. - */ - FinishTimeAscending = 2, - /** - * Order by finish time descending. - */ - FinishTimeDescending = 3, - } - export interface BuildQueuedEvent extends BuildUpdatedEvent { - } - export enum BuildReason { - /** - * No reason. This value should not be used. - */ - None = 0, - /** - * The build was started manually. - */ - Manual = 1, - /** - * The build was started for the trigger TriggerType.ContinuousIntegration. - */ - IndividualCI = 2, - /** - * The build was started for the trigger TriggerType.BatchedContinuousIntegration. - */ - BatchedCI = 4, - /** - * The build was started for the trigger TriggerType.Schedule. - */ - Schedule = 8, - /** - * The build was created by a user. - */ - UserCreated = 32, - /** - * The build was started manually for private validation. - */ - ValidateShelveset = 64, - /** - * The build was started for the trigger ContinuousIntegrationType.Gated. - */ - CheckInShelveset = 128, - /** - * The build was triggered for retention policy purposes. - */ - Triggered = 175, - /** - * All reasons. - */ - All = 239, - } - export interface BuildReference { - _links: any; - /** - * Build number/name of the build - */ - buildNumber: string; - /** - * Time that the build was completed - */ - finishTime: Date; - /** - * Id of the build - */ - id: number; - /** - * Time that the build was queued - */ - queueTime: Date; - /** - * The build result - */ - result: BuildResult; - /** - * Time that the build was started - */ - startTime: Date; - /** - * Status of the build - */ - status: BuildStatus; - } - export interface BuildReportMetadata { - buildId: number; - content: string; - type: string; - } - export interface BuildRepository { - checkoutSubmodules: boolean; - /** - * Indicates whether to clean the target folder when getting code from the repository. This is a String so that it can reference variables. - */ - clean: string; - /** - * Gets or sets the name of the default branch. - */ - defaultBranch: string; - id: string; - /** - * Gets or sets the friendly name of the repository. - */ - name: string; - properties: { - [key: string]: string; - }; - /** - * Gets or sets the root folder. - */ - rootFolder: string; - /** - * Gets or sets the type of the repository. - */ - type: string; - /** - * Gets or sets the url of the repository. - */ - url: string; - } - export interface BuildRequestValidationResult { - message: string; - result: ValidationResult; - } - export interface BuildResourceUsage { - distributedTaskAgents: number; - totalUsage: number; - xamlControllers: number; - } - export enum BuildResult { - /** - * No result - */ - None = 0, - /** - * The build completed successfully. - */ - Succeeded = 2, - /** - * The build completed compilation successfully but had other errors. - */ - PartiallySucceeded = 4, - /** - * The build completed unsuccessfully. - */ - Failed = 8, - /** - * The build was canceled before starting. - */ - Canceled = 32, - } - export interface BuildServer { - agents: ShallowReference[]; - controller: ShallowReference; - id: number; - isVirtual: boolean; - messageQueueUrl: string; - name: string; - requireClientCertificates: boolean; - status: ServiceHostStatus; - statusChangedDate: Date; - uri: string; - url: string; - version: number; - } - export interface BuildSettings { - daysToKeepDeletedBuildsBeforeDestroy: number; - defaultRetentionPolicy: RetentionPolicy; - maximumRetentionPolicy: RetentionPolicy; - } - export interface BuildStartedEvent extends BuildUpdatedEvent { - } - export enum BuildStatus { - /** - * No status. - */ - None = 0, - /** - * The build is currently in progress. - */ - InProgress = 1, - /** - * The build has completed. - */ - Completed = 2, - /** - * The build is cancelling - */ - Cancelling = 4, - /** - * The build is inactive in the queue. - */ - Postponed = 8, - /** - * The build has not yet started. - */ - NotStarted = 32, - /** - * All status. - */ - All = 47, - } - export interface BuildSummary { - build: ShallowReference; - finishTime: Date; - keepForever: boolean; - quality: string; - reason: BuildReason; - requestedFor: VSSInterfaces.IdentityRef; - startTime: Date; - status: BuildStatus; - } - export interface BuildTrigger { - triggerType: DefinitionTriggerType; - } - export interface BuildUpdatedEvent extends RealtimeBuildEvent { - build: Build; - } - export interface BuildWorkspace { - mappings: MappingDetails[]; - } - /** - * Represents a change associated with a build. - */ - export interface Change { - /** - * The author of the change. - */ - author: VSSInterfaces.IdentityRef; - /** - * The location of a user-friendly representation of the resource. - */ - displayUri: string; - /** - * Something that identifies the change. For a commit, this would be the SHA1. For a TFVC changeset, this would be the changeset id. - */ - id: string; - /** - * The location of the full representation of the resource. - */ - location: string; - /** - * A description of the change. This might be a commit message or changeset description. - */ - message: string; - /** - * Indicates whether the message was truncated - */ - messageTruncated: boolean; - /** - * A timestamp for the change. - */ - timestamp: Date; - /** - * The type of change. "commit", "changeset", etc. - */ - type: string; - } - export interface ConsoleLogEvent extends RealtimeBuildEvent { - lines: string[]; - timelineId: string; - timelineRecordId: string; - } - export interface ContinuousDeploymentDefinition { - /** - * The connected service associated with the continuous deployment - */ - connectedService: TfsCoreInterfaces.WebApiConnectedServiceRef; - /** - * The definition associated with the continuous deployment - */ - definition: ShallowReference; - gitBranch: string; - hostedServiceName: string; - project: TfsCoreInterfaces.TeamProjectReference; - repositoryId: string; - storageAccountName: string; - subscriptionId: string; - website: string; - webspace: string; - } - export interface ContinuousIntegrationTrigger extends BuildTrigger { - batchChanges: boolean; - branchFilters: string[]; - maxConcurrentBuildsPerBranch: number; - /** - * The polling interval in seconds. - */ - pollingInterval: number; - /** - * This is the id of the polling job that polls the external repository. Once the build definition is saved/updated, this value is set. - */ - pollingJobId: string; - } - export enum ControllerStatus { - /** - * Indicates that the build controller cannot be contacted. - */ - Unavailable = 0, - /** - * Indicates that the build controller is currently available. - */ - Available = 1, - /** - * Indicates that the build controller has taken itself offline. - */ - Offline = 2, - } - export enum DefinitionQuality { - Definition = 1, - Draft = 2, - } - export enum DefinitionQueryOrder { - /** - * No order - */ - None = 0, - /** - * Order by created on/last modified time ascending. - */ - LastModifiedAscending = 1, - /** - * Order by created on/last modified time descending. - */ - LastModifiedDescending = 2, - /** - * Order by definition name ascending. - */ - DefinitionNameAscending = 3, - /** - * Order by definition name descending. - */ - DefinitionNameDescending = 4, - } - export enum DefinitionQueueStatus { - /** - * When enabled the definition queue allows builds to be queued by users, the system will queue scheduled, gated and continuous integration builds, and the queued builds will be started by the system. - */ - Enabled = 0, - /** - * When paused the definition queue allows builds to be queued by users and the system will queue scheduled, gated and continuous integration builds. Builds in the queue will not be started by the system. - */ - Paused = 1, - /** - * When disabled the definition queue will not allow builds to be queued by users and the system will not queue scheduled, gated or continuous integration builds. Builds already in the queue will not be started by the system. - */ - Disabled = 2, - } - /** - * A reference to a definition. - */ - export interface DefinitionReference extends ShallowReference { - /** - * The date the definition was created - */ - createdDate: Date; - /** - * The project. - */ - project: TfsCoreInterfaces.TeamProjectReference; - /** - * If builds can be queued from this definition - */ - queueStatus: DefinitionQueueStatus; - /** - * The definition revision number. - */ - revision: number; - /** - * The type of the definition. - */ - type: DefinitionType; - /** - * The Uri of the definition - */ - uri: string; - } - export enum DefinitionTriggerType { - /** - * Manual builds only. - */ - None = 1, - /** - * A build should be started for each changeset. - */ - ContinuousIntegration = 2, - /** - * A build should be started for multiple changesets at a time at a specified interval. - */ - BatchedContinuousIntegration = 4, - /** - * A build should be started on a specified schedule whether or not changesets exist. - */ - Schedule = 8, - /** - * A validation build should be started for each check-in. - */ - GatedCheckIn = 16, - /** - * A validation build should be started for each batch of check-ins. - */ - BatchedGatedCheckIn = 32, - /** - * All types. - */ - All = 63, - } - export enum DefinitionType { - Xaml = 1, - Build = 2, - } - export enum DeleteOptions { - /** - * No data should be deleted. This value should not be used. - */ - None = 0, - /** - * The drop location should be deleted. - */ - DropLocation = 1, - /** - * The test results should be deleted. - */ - TestResults = 2, - /** - * The version control label should be deleted. - */ - Label = 4, - /** - * The build should be deleted. - */ - Details = 8, - /** - * Published symbols should be deleted. - */ - Symbols = 16, - /** - * All data should be deleted. - */ - All = 31, - } - /** - * Represents the data from the build information nodes for type "DeploymentInformation" for xaml builds - */ - export interface Deployment { - type: string; - } - /** - * Deployment iformation for type "Build" - */ - export interface DeploymentBuild extends Deployment { - buildId: number; - } - /** - * Deployment iformation for type "Deploy" - */ - export interface DeploymentDeploy extends Deployment { - message: string; - } - /** - * Deployment iformation for type "Test" - */ - export interface DeploymentTest extends Deployment { - runId: number; - } - export interface GatedCheckInTrigger extends BuildTrigger { - pathFilters: string[]; - runContinuousIntegration: boolean; - } - export enum GetOption { - /** - * Use the latest changeset at the time the build is queued. - */ - LatestOnQueue = 0, - /** - * Use the latest changeset at the time the build is started. - */ - LatestOnBuild = 1, - /** - * A user-specified version has been supplied. - */ - Custom = 2, - } - /** - * Data representation of an information node associated with a build - */ - export interface InformationNode { - /** - * Fields of the information node - */ - fields: { - [key: string]: string; - }; - /** - * Process or person that last modified this node - */ - lastModifiedBy: string; - /** - * Date this node was last modified - */ - lastModifiedDate: Date; - /** - * Node Id of this information node - */ - nodeId: number; - /** - * Id of parent node (xml tree) - */ - parentId: number; - /** - * The type of the information node - */ - type: string; - } - export interface Issue { - category: string; - data: { - [key: string]: string; - }; - message: string; - type: IssueType; - } - export enum IssueType { - Error = 1, - Warning = 2, - } - export interface MappingDetails { - localPath: string; - mappingType: string; - serverPath: string; - } - export enum ProcessTemplateType { - /** - * Indicates a custom template. - */ - Custom = 0, - /** - * Indicates a default template. - */ - Default = 1, - /** - * Indicates an upgrade template. - */ - Upgrade = 2, - } - export interface PropertyValue { - /** - * Guid of identity that changed this property value - */ - changedBy: string; - /** - * The date this property value was changed - */ - changedDate: Date; - /** - * Name in the name value mapping - */ - propertyName: string; - /** - * Value in the name value mapping - */ - value: any; - } - export enum QueryDeletedOption { - /** - * Include only non-deleted builds. - */ - ExcludeDeleted = 0, - /** - * Include deleted and non-deleted builds. - */ - IncludeDeleted = 1, - /** - * Include only deleted builds. - */ - OnlyDeleted = 2, - } - export enum QueueOptions { - /** - * No queue options - */ - None = 0, - /** - * Create a plan Id for the build, do not run it - */ - DoNotRun = 1, - } - export enum QueuePriority { - /** - * Low priority. - */ - Low = 5, - /** - * Below normal priority. - */ - BelowNormal = 4, - /** - * Normal priority. - */ - Normal = 3, - /** - * Above normal priority. - */ - AboveNormal = 2, - /** - * High priority. - */ - High = 1, - } - export interface RealtimeBuildEvent { - buildId: number; - } - export interface RequestReference { - /** - * Id of the resource - */ - id: number; - /** - * Name of the requestor - */ - requestedFor: VSSInterfaces.IdentityRef; - /** - * Full http link to the resource - */ - url: string; - } - export interface RetentionPolicy { - artifacts: string[]; - branches: string[]; - daysToKeep: number; - deleteBuildRecord: boolean; - deleteTestResults: boolean; - minimumToKeep: number; - } - export interface Schedule { - branchFilters: string[]; - /** - * Days for a build (flags enum for days of the week) - */ - daysToBuild: ScheduleDays; - /** - * The Job Id of the Scheduled job that will queue the scheduled build. Since a single trigger can have multiple schedules and we want a single job to process a single schedule (since each schedule has a list of branches to build), the schedule itself needs to define the Job Id. This value will be filled in when a definition is added or updated. The UI does not provide it or use it. - */ - scheduleJobId: string; - /** - * Local timezone hour to start - */ - startHours: number; - /** - * Local timezone minute to start - */ - startMinutes: number; - /** - * Time zone of the build schedule (string representation of the time zone id) - */ - timeZoneId: string; - } - export enum ScheduleDays { - /** - * Do not run. - */ - None = 0, - /** - * Run on Monday. - */ - Monday = 1, - /** - * Run on Tuesday. - */ - Tuesday = 2, - /** - * Run on Wednesday. - */ - Wednesday = 4, - /** - * Run on Thursday. - */ - Thursday = 8, - /** - * Run on Friday. - */ - Friday = 16, - /** - * Run on Saturday. - */ - Saturday = 32, - /** - * Run on Sunday. - */ - Sunday = 64, - /** - * Run on all days of the week. - */ - All = 127, - } - export interface ScheduleTrigger extends BuildTrigger { - schedules: Schedule[]; - } - export enum ServiceHostStatus { - /** - * The service host is currently connected and accepting commands. - */ - Online = 1, - /** - * The service host is currently disconnected and not accepting commands. - */ - Offline = 2, - } - /** - * An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links. - */ - export interface ShallowReference { - /** - * Id of the resource - */ - id: number; - /** - * Name of the linked resource (definition name, controller name, etc.) - */ - name: string; - /** - * Full http link to the resource - */ - url: string; - } - export interface SvnMappingDetails { - depth: number; - ignoreExternals: boolean; - localPath: string; - revision: string; - serverPath: string; - } - export interface SvnWorkspace { - mappings: SvnMappingDetails[]; - } - export interface TaskAgentPoolReference { - id: number; - name: string; - } - export interface TaskDefinitionReference { - id: string; - versionSpec: string; - } - export interface TaskOrchestrationPlanReference { - planId: string; - } - export enum TaskResult { - Succeeded = 0, - SucceededWithIssues = 1, - Failed = 2, - Canceled = 3, - Skipped = 4, - Abandoned = 5, - } - export interface Timeline extends TimelineReference { - lastChangedBy: string; - lastChangedOn: Date; - records: TimelineRecord[]; - } - export interface TimelineRecord { - _links: any; - changeId: number; - currentOperation: string; - details: TimelineReference; - errorCount: number; - finishTime: Date; - id: string; - issues: Issue[]; - lastModified: Date; - log: BuildLogReference; - name: string; - order: number; - parentId: string; - percentComplete: number; - result: TaskResult; - resultCode: string; - startTime: Date; - state: TimelineRecordState; - type: string; - url: string; - warningCount: number; - workerName: string; - } - export enum TimelineRecordState { - Pending = 0, - InProgress = 1, - Completed = 2, - } - export interface TimelineRecordsUpdatedEvent extends RealtimeBuildEvent { - timelineRecords: TimelineRecord[]; - } - export interface TimelineReference { - changeId: number; - id: string; - url: string; - } - export enum ValidationResult { - OK = 0, - Warning = 1, - Error = 2, - } - /** - * Mapping for a workspace - */ - export interface WorkspaceMapping { - /** - * Uri of the associated definition - */ - definitionUri: string; - /** - * Depth of this mapping - */ - depth: number; - /** - * local location of the definition - */ - localItem: string; - /** - * type of workspace mapping - */ - mappingType: WorkspaceMappingType; - /** - * Server location of the definition - */ - serverItem: string; - /** - * Id of the workspace - */ - workspaceId: number; - } - export enum WorkspaceMappingType { - /** - * The path is mapped in the workspace. - */ - Map = 0, - /** - * The path is cloaked in the workspace. - */ - Cloak = 1, - } - export interface WorkspaceTemplate { - /** - * Uri of the associated definition - */ - definitionUri: string; - /** - * The identity that last modified this template - */ - lastModifiedBy: string; - /** - * The last time this template was modified - */ - lastModifiedDate: Date; - /** - * List of workspace mappings - */ - mappings: WorkspaceMapping[]; - /** - * Id of the workspace for this template - */ - workspaceId: number; - } - export interface XamlBuildDefinition extends DefinitionReference { - _links: any; - /** - * Batch size of the definition - */ - batchSize: number; - buildArgs: string; - /** - * The continuous integration quiet period - */ - continuousIntegrationQuietPeriod: number; - /** - * The build controller - */ - controller: BuildController; - /** - * The date this definition was created - */ - createdOn: Date; - /** - * Default drop location for builds from this definition - */ - defaultDropLocation: string; - /** - * Description of the definition - */ - description: string; - /** - * The last build on this definition - */ - lastBuild: ShallowReference; - /** - * The repository - */ - repository: BuildRepository; - /** - * The reasons supported by the template - */ - supportedReasons: BuildReason; - /** - * How builds are triggered from this definition - */ - triggerType: DefinitionTriggerType; - } - export var TypeInfo: { - AgentPoolQueue: { - fields: any; - }; - AgentStatus: { - enumValues: { - "unavailable": number; - "available": number; - "offline": number; - }; - }; - ArtifactResource: { - fields: any; - }; - AuditAction: { - enumValues: { - "add": number; - "update": number; - "delete": number; - }; - }; - Build: { - fields: any; - }; - BuildAgent: { - fields: any; - }; - BuildArtifact: { - fields: any; - }; - BuildArtifactAddedEvent: { - fields: any; - }; - BuildAuthorizationScope: { - enumValues: { - "projectCollection": number; - "project": number; - }; - }; - BuildBadge: { - fields: any; - }; - BuildChangesCalculatedEvent: { - fields: any; - }; - BuildCompletedEvent: { - fields: any; - }; - BuildController: { - fields: any; - }; - BuildDefinition: { - fields: any; - }; - BuildDefinitionChangedEvent: { - fields: any; - }; - BuildDefinitionChangingEvent: { - fields: any; - }; - BuildDefinitionReference: { - fields: any; - }; - BuildDefinitionRevision: { - fields: any; - }; - BuildDefinitionSourceProvider: { - fields: any; - }; - BuildDefinitionStep: { - fields: any; - }; - BuildDefinitionTemplate: { - fields: any; - }; - BuildDefinitionVariable: { - fields: any; - }; - BuildDeletedEvent: { - fields: any; - }; - BuildDeployment: { - fields: any; - }; - BuildDestroyedEvent: { - fields: any; - }; - BuildLog: { - fields: any; - }; - BuildLogReference: { - fields: any; - }; - BuildOption: { - fields: any; - }; - BuildOptionDefinition: { - fields: any; - }; - BuildOptionDefinitionReference: { - fields: any; - }; - BuildOptionGroupDefinition: { - fields: any; - }; - BuildOptionInputDefinition: { - fields: any; - }; - BuildOptionInputType: { - enumValues: { - "string": number; - "boolean": number; - "stringList": number; - "radio": number; - "pickList": number; - "multiLine": number; - }; - }; - BuildPhaseStatus: { - enumValues: { - "unknown": number; - "failed": number; - "succeeded": number; - }; - }; - BuildPollingSummaryEvent: { - fields: any; - }; - BuildProcessTemplate: { - fields: any; - }; - BuildQueryOrder: { - enumValues: { - "finishTimeAscending": number; - "finishTimeDescending": number; - }; - }; - BuildQueuedEvent: { - fields: any; - }; - BuildReason: { - enumValues: { - "none": number; - "manual": number; - "individualCI": number; - "batchedCI": number; - "schedule": number; - "userCreated": number; - "validateShelveset": number; - "checkInShelveset": number; - "triggered": number; - "all": number; - }; - }; - BuildReference: { - fields: any; - }; - BuildReportMetadata: { - fields: any; - }; - BuildRepository: { - fields: any; - }; - BuildRequestValidationResult: { - fields: any; - }; - BuildResourceUsage: { - fields: any; - }; - BuildResult: { - enumValues: { - "none": number; - "succeeded": number; - "partiallySucceeded": number; - "failed": number; - "canceled": number; - }; - }; - BuildServer: { - fields: any; - }; - BuildSettings: { - fields: any; - }; - BuildStartedEvent: { - fields: any; - }; - BuildStatus: { - enumValues: { - "none": number; - "inProgress": number; - "completed": number; - "cancelling": number; - "postponed": number; - "notStarted": number; - "all": number; - }; - }; - BuildSummary: { - fields: any; - }; - BuildTrigger: { - fields: any; - }; - BuildUpdatedEvent: { - fields: any; - }; - BuildWorkspace: { - fields: any; - }; - Change: { - fields: any; - }; - ConsoleLogEvent: { - fields: any; - }; - ContinuousDeploymentDefinition: { - fields: any; - }; - ContinuousIntegrationTrigger: { - fields: any; - }; - ControllerStatus: { - enumValues: { - "unavailable": number; - "available": number; - "offline": number; - }; - }; - DefinitionQuality: { - enumValues: { - "definition": number; - "draft": number; - }; - }; - DefinitionQueryOrder: { - enumValues: { - "none": number; - "lastModifiedAscending": number; - "lastModifiedDescending": number; - "definitionNameAscending": number; - "definitionNameDescending": number; - }; - }; - DefinitionQueueStatus: { - enumValues: { - "enabled": number; - "paused": number; - "disabled": number; - }; - }; - DefinitionReference: { - fields: any; - }; - DefinitionTriggerType: { - enumValues: { - "none": number; - "continuousIntegration": number; - "batchedContinuousIntegration": number; - "schedule": number; - "gatedCheckIn": number; - "batchedGatedCheckIn": number; - "all": number; - }; - }; - DefinitionType: { - enumValues: { - "xaml": number; - "build": number; - }; - }; - DeleteOptions: { - enumValues: { - "none": number; - "dropLocation": number; - "testResults": number; - "label": number; - "details": number; - "symbols": number; - "all": number; - }; - }; - Deployment: { - fields: any; - }; - DeploymentBuild: { - fields: any; - }; - DeploymentDeploy: { - fields: any; - }; - DeploymentTest: { - fields: any; - }; - GatedCheckInTrigger: { - fields: any; - }; - GetOption: { - enumValues: { - "latestOnQueue": number; - "latestOnBuild": number; - "custom": number; - }; - }; - InformationNode: { - fields: any; - }; - Issue: { - fields: any; - }; - IssueType: { - enumValues: { - "error": number; - "warning": number; - }; - }; - MappingDetails: { - fields: any; - }; - ProcessTemplateType: { - enumValues: { - "custom": number; - "default": number; - "upgrade": number; - }; - }; - PropertyValue: { - fields: any; - }; - QueryDeletedOption: { - enumValues: { - "excludeDeleted": number; - "includeDeleted": number; - "onlyDeleted": number; - }; - }; - QueueOptions: { - enumValues: { - "none": number; - "doNotRun": number; - }; - }; - QueuePriority: { - enumValues: { - "low": number; - "belowNormal": number; - "normal": number; - "aboveNormal": number; - "high": number; - }; - }; - RealtimeBuildEvent: { - fields: any; - }; - RequestReference: { - fields: any; - }; - RetentionPolicy: { - fields: any; - }; - Schedule: { - fields: any; - }; - ScheduleDays: { - enumValues: { - "none": number; - "monday": number; - "tuesday": number; - "wednesday": number; - "thursday": number; - "friday": number; - "saturday": number; - "sunday": number; - "all": number; - }; - }; - ScheduleTrigger: { - fields: any; - }; - ServiceHostStatus: { - enumValues: { - "online": number; - "offline": number; - }; - }; - ShallowReference: { - fields: any; - }; - SvnMappingDetails: { - fields: any; - }; - SvnWorkspace: { - fields: any; - }; - TaskAgentPoolReference: { - fields: any; - }; - TaskDefinitionReference: { - fields: any; - }; - TaskOrchestrationPlanReference: { - fields: any; - }; - TaskResult: { - enumValues: { - "succeeded": number; - "succeededWithIssues": number; - "failed": number; - "canceled": number; - "skipped": number; - "abandoned": number; - }; - }; - Timeline: { - fields: any; - }; - TimelineRecord: { - fields: any; - }; - TimelineRecordState: { - enumValues: { - "pending": number; - "inProgress": number; - "completed": number; - }; - }; - TimelineRecordsUpdatedEvent: { - fields: any; - }; - TimelineReference: { - fields: any; - }; - ValidationResult: { - enumValues: { - "oK": number; - "warning": number; - "error": number; - }; - }; - WorkspaceMapping: { - fields: any; - }; - WorkspaceMappingType: { - enumValues: { - "map": number; - "cloak": number; - }; - }; - WorkspaceTemplate: { - fields: any; - }; - XamlBuildDefinition: { - fields: any; - }; - }; - -} -declare module 'vso-node-api/BuildApi' { - /// - /// - import Q = require('q'); - import basem = require('vso-node-api/ClientApiBases'); - import VsoBaseInterfaces = require('vso-node-api/interfaces/common/VsoBaseInterfaces'); - import BuildInterfaces = require('vso-node-api/interfaces/BuildInterfaces'); - import VSSInterfaces = require('vso-node-api/interfaces/common/VSSInterfaces'); - export interface IBuildApi extends basem.ClientApiBase { - createArtifact(artifact: BuildInterfaces.BuildArtifact, buildId: number, project: string, onResult: (err: any, statusCode: number, artifact: BuildInterfaces.BuildArtifact) => void): void; - getArtifact(buildId: number, artifactName: string, project: string, onResult: (err: any, statusCode: number, artifact: BuildInterfaces.BuildArtifact) => void): void; - getArtifactContentZip(buildId: number, artifactName: string, project: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getArtifacts(buildId: number, project: string, onResult: (err: any, statusCode: number, artifacts: BuildInterfaces.BuildArtifact[]) => void): void; - getBadge(project: string, definitionId: number, branchName: string, onResult: (err: any, statusCode: number, badge: string) => void): void; - getBuildBadge(project: string, repoType: string, repoId: string, branchName: string, onResult: (err: any, statusCode: number, buildbadge: BuildInterfaces.BuildBadge) => void): void; - getBuildBadgeData(project: string, repoType: string, repoId: string, branchName: string, onResult: (err: any, statusCode: number, buildbadge: string) => void): void; - deleteBuild(buildId: number, project: string, onResult: (err: any, statusCode: number) => void): void; - getBuild(buildId: number, project: string, propertyFilters: string, onResult: (err: any, statusCode: number, build: BuildInterfaces.Build) => void): void; - getBuilds(project: string, definitions: number[], queues: number[], buildNumber: string, minFinishTime: Date, maxFinishTime: Date, requestedFor: string, reasonFilter: BuildInterfaces.BuildReason, statusFilter: BuildInterfaces.BuildStatus, resultFilter: BuildInterfaces.BuildResult, tagFilters: string[], properties: string[], type: BuildInterfaces.DefinitionType, top: number, continuationToken: string, maxBuildsPerDefinition: number, deletedFilter: BuildInterfaces.QueryDeletedOption, queryOrder: BuildInterfaces.BuildQueryOrder, branchName: string, onResult: (err: any, statusCode: number, builds: BuildInterfaces.Build[]) => void): void; - queueBuild(build: BuildInterfaces.Build, project: string, ignoreWarnings: boolean, checkInTicket: string, onResult: (err: any, statusCode: number, build: BuildInterfaces.Build) => void): void; - updateBuild(build: BuildInterfaces.Build, buildId: number, project: string, onResult: (err: any, statusCode: number, build: BuildInterfaces.Build) => void): void; - getBuildChanges(project: string, buildId: number, continuationToken: string, top: number, includeSourceChange: boolean, onResult: (err: any, statusCode: number, changes: BuildInterfaces.Change[]) => void): void; - getChangesBetweenBuilds(project: string, fromBuildId: number, toBuildId: number, top: number, onResult: (err: any, statusCode: number, changes: BuildInterfaces.Change[]) => void): void; - getBuildController(controllerId: number, onResult: (err: any, statusCode: number, Controller: BuildInterfaces.BuildController) => void): void; - getBuildControllers(name: string, onResult: (err: any, statusCode: number, Controllers: BuildInterfaces.BuildController[]) => void): void; - createDefinition(definition: BuildInterfaces.BuildDefinition, project: string, definitionToCloneId: number, definitionToCloneRevision: number, onResult: (err: any, statusCode: number, definition: BuildInterfaces.BuildDefinition) => void): void; - deleteDefinition(definitionId: number, project: string, onResult: (err: any, statusCode: number) => void): void; - getDefinition(definitionId: number, project: string, revision: number, propertyFilters: string[], onResult: (err: any, statusCode: number, definition: BuildInterfaces.DefinitionReference) => void): void; - getDefinitions(project: string, name: string, type: BuildInterfaces.DefinitionType, repositoryId: string, repositoryType: string, queryOrder: BuildInterfaces.DefinitionQueryOrder, top: number, continuationToken: string, onResult: (err: any, statusCode: number, definitions: BuildInterfaces.DefinitionReference[]) => void): void; - updateDefinition(definition: BuildInterfaces.BuildDefinition, definitionId: number, project: string, secretsSourceDefinitionId: number, secretsSourceDefinitionRevision: number, onResult: (err: any, statusCode: number, definition: BuildInterfaces.BuildDefinition) => void): void; - getBuildDeployments(project: string, buildId: number, onResult: (err: any, statusCode: number, deployments: BuildInterfaces.Deployment[]) => void): void; - getBuildLog(project: string, buildId: number, logId: number, startLine: number, endLine: number, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getBuildLogs(project: string, buildId: number, onResult: (err: any, statusCode: number, logs: BuildInterfaces.BuildLog[]) => void): void; - getBuildLogsZip(project: string, buildId: number, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getBuildOptionDefinitions(project: string, onResult: (err: any, statusCode: number, options: BuildInterfaces.BuildOptionDefinition[]) => void): void; - createQueue(queue: BuildInterfaces.AgentPoolQueue, onResult: (err: any, statusCode: number, queue: BuildInterfaces.AgentPoolQueue) => void): void; - deleteQueue(id: number, onResult: (err: any, statusCode: number) => void): void; - getAgentPoolQueue(controllerId: number, onResult: (err: any, statusCode: number, queue: BuildInterfaces.AgentPoolQueue) => void): void; - getQueues(name: string, onResult: (err: any, statusCode: number, queues: BuildInterfaces.AgentPoolQueue[]) => void): void; - getBuildReport(project: string, buildId: number, type: string, onResult: (err: any, statusCode: number, report: BuildInterfaces.BuildReportMetadata) => void): void; - getBuildReportHtmlContent(project: string, buildId: number, type: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getResourceUsage(onResult: (err: any, statusCode: number, ResourceUsage: BuildInterfaces.BuildResourceUsage) => void): void; - getDefinitionRevisions(project: string, definitionId: number, onResult: (err: any, statusCode: number, revisions: BuildInterfaces.BuildDefinitionRevision[]) => void): void; - getBuildSettings(onResult: (err: any, statusCode: number, setting: BuildInterfaces.BuildSettings) => void): void; - updateBuildSettings(settings: BuildInterfaces.BuildSettings, onResult: (err: any, statusCode: number, setting: BuildInterfaces.BuildSettings) => void): void; - addBuildTag(project: string, buildId: number, tag: string, onResult: (err: any, statusCode: number, tags: string[]) => void): void; - addBuildTags(tags: string[], project: string, buildId: number, onResult: (err: any, statusCode: number, tags: string[]) => void): void; - deleteBuildTag(project: string, buildId: number, tag: string, onResult: (err: any, statusCode: number, tags: string[]) => void): void; - getBuildTags(project: string, buildId: number, onResult: (err: any, statusCode: number, tags: string[]) => void): void; - getTags(project: string, onResult: (err: any, statusCode: number, tags: string[]) => void): void; - deleteTemplate(project: string, templateId: string, onResult: (err: any, statusCode: number) => void): void; - getTemplate(project: string, templateId: string, onResult: (err: any, statusCode: number, template: BuildInterfaces.BuildDefinitionTemplate) => void): void; - getTemplates(project: string, onResult: (err: any, statusCode: number, templates: BuildInterfaces.BuildDefinitionTemplate[]) => void): void; - saveTemplate(template: BuildInterfaces.BuildDefinitionTemplate, project: string, templateId: string, onResult: (err: any, statusCode: number, template: BuildInterfaces.BuildDefinitionTemplate) => void): void; - getBuildTimeline(project: string, buildId: number, timelineId: string, changeId: number, onResult: (err: any, statusCode: number, Timeline: BuildInterfaces.Timeline) => void): void; - getBuildWorkItemsRefs(project: string, buildId: number, top: number, onResult: (err: any, statusCode: number, workitems: VSSInterfaces.ResourceRef[]) => void): void; - getBuildWorkItemsRefsFromCommits(commitIds: string[], project: string, buildId: number, top: number, onResult: (err: any, statusCode: number, workitems: VSSInterfaces.ResourceRef[]) => void): void; - getWorkItemsBetweenBuilds(project: string, fromBuildId: number, toBuildId: number, top: number, onResult: (err: any, statusCode: number, workitems: VSSInterfaces.ResourceRef[]) => void): void; - } - export interface IQBuildApi extends basem.QClientApiBase { - createArtifact(artifact: BuildInterfaces.BuildArtifact, buildId: number, project?: string): Q.Promise; - getArtifact(buildId: number, artifactName: string, project?: string): Q.Promise; - getArtifactContentZip(buildId: number, artifactName: string, project?: string): Q.Promise; - getArtifacts(buildId: number, project?: string): Q.Promise; - getBadge(project: string, definitionId: number, branchName?: string): Q.Promise; - getBuildBadge(project: string, repoType: string, repoId?: string, branchName?: string): Q.Promise; - getBuildBadgeData(project: string, repoType: string, repoId?: string, branchName?: string): Q.Promise; - deleteBuild(buildId: number, project?: string): Q.Promise; - getBuild(buildId: number, project?: string, propertyFilters?: string): Q.Promise; - getBuilds(project?: string, definitions?: number[], queues?: number[], buildNumber?: string, minFinishTime?: Date, maxFinishTime?: Date, requestedFor?: string, reasonFilter?: BuildInterfaces.BuildReason, statusFilter?: BuildInterfaces.BuildStatus, resultFilter?: BuildInterfaces.BuildResult, tagFilters?: string[], properties?: string[], type?: BuildInterfaces.DefinitionType, top?: number, continuationToken?: string, maxBuildsPerDefinition?: number, deletedFilter?: BuildInterfaces.QueryDeletedOption, queryOrder?: BuildInterfaces.BuildQueryOrder, branchName?: string): Q.Promise; - queueBuild(build: BuildInterfaces.Build, project?: string, ignoreWarnings?: boolean, checkInTicket?: string): Q.Promise; - updateBuild(build: BuildInterfaces.Build, buildId: number, project?: string): Q.Promise; - getBuildChanges(project: string, buildId: number, continuationToken?: string, top?: number, includeSourceChange?: boolean): Q.Promise; - getChangesBetweenBuilds(project: string, fromBuildId?: number, toBuildId?: number, top?: number): Q.Promise; - getBuildController(controllerId: number): Q.Promise; - getBuildControllers(name?: string): Q.Promise; - createDefinition(definition: BuildInterfaces.BuildDefinition, project?: string, definitionToCloneId?: number, definitionToCloneRevision?: number): Q.Promise; - deleteDefinition(definitionId: number, project?: string): Q.Promise; - getDefinition(definitionId: number, project?: string, revision?: number, propertyFilters?: string[]): Q.Promise; - getDefinitions(project?: string, name?: string, type?: BuildInterfaces.DefinitionType, repositoryId?: string, repositoryType?: string, queryOrder?: BuildInterfaces.DefinitionQueryOrder, top?: number, continuationToken?: string): Q.Promise; - updateDefinition(definition: BuildInterfaces.BuildDefinition, definitionId: number, project?: string, secretsSourceDefinitionId?: number, secretsSourceDefinitionRevision?: number): Q.Promise; - getBuildDeployments(project: string, buildId: number): Q.Promise; - getBuildLog(project: string, buildId: number, logId: number, startLine?: number, endLine?: number): Q.Promise; - getBuildLogs(project: string, buildId: number): Q.Promise; - getBuildLogsZip(project: string, buildId: number): Q.Promise; - getBuildOptionDefinitions(project?: string): Q.Promise; - createQueue(queue: BuildInterfaces.AgentPoolQueue): Q.Promise; - deleteQueue(id: number): Q.Promise; - getAgentPoolQueue(controllerId: number): Q.Promise; - getQueues(name?: string): Q.Promise; - getBuildReport(project: string, buildId: number, type?: string): Q.Promise; - getBuildReportHtmlContent(project: string, buildId: number, type?: string): Q.Promise; - getResourceUsage(): Q.Promise; - getDefinitionRevisions(project: string, definitionId: number): Q.Promise; - getBuildSettings(): Q.Promise; - updateBuildSettings(settings: BuildInterfaces.BuildSettings): Q.Promise; - addBuildTag(project: string, buildId: number, tag: string): Q.Promise; - addBuildTags(tags: string[], project: string, buildId: number): Q.Promise; - deleteBuildTag(project: string, buildId: number, tag: string): Q.Promise; - getBuildTags(project: string, buildId: number): Q.Promise; - getTags(project: string): Q.Promise; - deleteTemplate(project: string, templateId: string): Q.Promise; - getTemplate(project: string, templateId: string): Q.Promise; - getTemplates(project: string): Q.Promise; - saveTemplate(template: BuildInterfaces.BuildDefinitionTemplate, project: string, templateId: string): Q.Promise; - getBuildTimeline(project: string, buildId: number, timelineId?: string, changeId?: number): Q.Promise; - getBuildWorkItemsRefs(project: string, buildId: number, top?: number): Q.Promise; - getBuildWorkItemsRefsFromCommits(commitIds: string[], project: string, buildId: number, top?: number): Q.Promise; - getWorkItemsBetweenBuilds(project: string, fromBuildId: number, toBuildId: number, top?: number): Q.Promise; - } - export class BuildApi extends basem.ClientApiBase implements IBuildApi { - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]); - /** - * Associates an artifact with a build - * - * @param {BuildInterfaces.BuildArtifact} artifact - * @param {number} buildId - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting BuildInterfaces.BuildArtifact - */ - createArtifact(artifact: BuildInterfaces.BuildArtifact, buildId: number, project: string, onResult: (err: any, statusCode: number, artifact: BuildInterfaces.BuildArtifact) => void): void; - /** - * Gets a specific artifact for a build - * - * @param {number} buildId - * @param {string} artifactName - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting BuildInterfaces.BuildArtifact - */ - getArtifact(buildId: number, artifactName: string, project: string, onResult: (err: any, statusCode: number, artifact: BuildInterfaces.BuildArtifact) => void): void; - /** - * Gets a specific artifact for a build - * - * @param {number} buildId - * @param {string} artifactName - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting ArrayBuffer - */ - getArtifactContentZip(buildId: number, artifactName: string, project: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * Gets all artifacts for a build - * - * @param {number} buildId - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting BuildInterfaces.BuildArtifact[] - */ - getArtifacts(buildId: number, project: string, onResult: (err: any, statusCode: number, artifacts: BuildInterfaces.BuildArtifact[]) => void): void; - /** - * @param {string} project - * @param {number} definitionId - * @param {string} branchName - * @param onResult callback function with the resulting string - */ - getBadge(project: string, definitionId: number, branchName: string, onResult: (err: any, statusCode: number, badge: string) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {string} repoType - * @param {string} repoId - * @param {string} branchName - * @param onResult callback function with the resulting BuildInterfaces.BuildBadge - */ - getBuildBadge(project: string, repoType: string, repoId: string, branchName: string, onResult: (err: any, statusCode: number, buildbadge: BuildInterfaces.BuildBadge) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {string} repoType - * @param {string} repoId - * @param {string} branchName - * @param onResult callback function with the resulting string - */ - getBuildBadgeData(project: string, repoType: string, repoId: string, branchName: string, onResult: (err: any, statusCode: number, buildbadge: string) => void): void; - /** - * Deletes a build - * - * @param {number} buildId - * @param {string} project - Project ID or project name - * @param onResult callback function - */ - deleteBuild(buildId: number, project: string, onResult: (err: any, statusCode: number) => void): void; - /** - * Gets a build - * - * @param {number} buildId - * @param {string} project - Project ID or project name - * @param {string} propertyFilters - A comma-delimited list of properties to include in the results - * @param onResult callback function with the resulting BuildInterfaces.Build - */ - getBuild(buildId: number, project: string, propertyFilters: string, onResult: (err: any, statusCode: number, build: BuildInterfaces.Build) => void): void; - /** - * Gets builds - * - * @param {string} project - Project ID or project name - * @param {number[]} definitions - A comma-delimited list of definition ids - * @param {number[]} queues - A comma-delimited list of queue ids - * @param {string} buildNumber - * @param {Date} minFinishTime - * @param {Date} maxFinishTime - * @param {string} requestedFor - * @param {BuildInterfaces.BuildReason} reasonFilter - * @param {BuildInterfaces.BuildStatus} statusFilter - * @param {BuildInterfaces.BuildResult} resultFilter - * @param {string[]} tagFilters - A comma-delimited list of tags - * @param {string[]} properties - A comma-delimited list of properties to include in the results - * @param {BuildInterfaces.DefinitionType} type - The definition type - * @param {number} top - The maximum number of builds to retrieve - * @param {string} continuationToken - * @param {number} maxBuildsPerDefinition - * @param {BuildInterfaces.QueryDeletedOption} deletedFilter - * @param {BuildInterfaces.BuildQueryOrder} queryOrder - * @param {string} branchName - * @param onResult callback function with the resulting BuildInterfaces.Build[] - */ - getBuilds(project: string, definitions: number[], queues: number[], buildNumber: string, minFinishTime: Date, maxFinishTime: Date, requestedFor: string, reasonFilter: BuildInterfaces.BuildReason, statusFilter: BuildInterfaces.BuildStatus, resultFilter: BuildInterfaces.BuildResult, tagFilters: string[], properties: string[], type: BuildInterfaces.DefinitionType, top: number, continuationToken: string, maxBuildsPerDefinition: number, deletedFilter: BuildInterfaces.QueryDeletedOption, queryOrder: BuildInterfaces.BuildQueryOrder, branchName: string, onResult: (err: any, statusCode: number, builds: BuildInterfaces.Build[]) => void): void; - /** - * Queues a build - * - * @param {BuildInterfaces.Build} build - * @param {string} project - Project ID or project name - * @param {boolean} ignoreWarnings - * @param {string} checkInTicket - * @param onResult callback function with the resulting BuildInterfaces.Build - */ - queueBuild(build: BuildInterfaces.Build, project: string, ignoreWarnings: boolean, checkInTicket: string, onResult: (err: any, statusCode: number, build: BuildInterfaces.Build) => void): void; - /** - * Updates a build - * - * @param {BuildInterfaces.Build} build - * @param {number} buildId - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting BuildInterfaces.Build - */ - updateBuild(build: BuildInterfaces.Build, buildId: number, project: string, onResult: (err: any, statusCode: number, build: BuildInterfaces.Build) => void): void; - /** - * Gets the changes associated with a build - * - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {string} continuationToken - * @param {number} top - The maximum number of changes to return - * @param {boolean} includeSourceChange - * @param onResult callback function with the resulting BuildInterfaces.Change[] - */ - getBuildChanges(project: string, buildId: number, continuationToken: string, top: number, includeSourceChange: boolean, onResult: (err: any, statusCode: number, changes: BuildInterfaces.Change[]) => void): void; - /** - * Gets the changes associated between given builds - * - * @param {string} project - Project ID or project name - * @param {number} fromBuildId - * @param {number} toBuildId - * @param {number} top - The maximum number of changes to return - * @param onResult callback function with the resulting BuildInterfaces.Change[] - */ - getChangesBetweenBuilds(project: string, fromBuildId: number, toBuildId: number, top: number, onResult: (err: any, statusCode: number, changes: BuildInterfaces.Change[]) => void): void; - /** - * Gets a controller - * - * @param {number} controllerId - * @param onResult callback function with the resulting BuildInterfaces.BuildController - */ - getBuildController(controllerId: number, onResult: (err: any, statusCode: number, Controller: BuildInterfaces.BuildController) => void): void; - /** - * Gets controller, optionally filtered by name - * - * @param {string} name - * @param onResult callback function with the resulting BuildInterfaces.BuildController[] - */ - getBuildControllers(name: string, onResult: (err: any, statusCode: number, Controllers: BuildInterfaces.BuildController[]) => void): void; - /** - * Creates a new definition - * - * @param {BuildInterfaces.BuildDefinition} definition - * @param {string} project - Project ID or project name - * @param {number} definitionToCloneId - * @param {number} definitionToCloneRevision - * @param onResult callback function with the resulting BuildInterfaces.BuildDefinition - */ - createDefinition(definition: BuildInterfaces.BuildDefinition, project: string, definitionToCloneId: number, definitionToCloneRevision: number, onResult: (err: any, statusCode: number, definition: BuildInterfaces.BuildDefinition) => void): void; - /** - * Deletes a definition and all associated builds - * - * @param {number} definitionId - * @param {string} project - Project ID or project name - * @param onResult callback function - */ - deleteDefinition(definitionId: number, project: string, onResult: (err: any, statusCode: number) => void): void; - /** - * Gets a definition, optionally at a specific revision - * - * @param {number} definitionId - * @param {string} project - Project ID or project name - * @param {number} revision - * @param {string[]} propertyFilters - * @param onResult callback function with the resulting BuildInterfaces.DefinitionReference - */ - getDefinition(definitionId: number, project: string, revision: number, propertyFilters: string[], onResult: (err: any, statusCode: number, definition: BuildInterfaces.DefinitionReference) => void): void; - /** - * Gets definitions, optionally filtered by name - * - * @param {string} project - Project ID or project name - * @param {string} name - * @param {BuildInterfaces.DefinitionType} type - * @param {string} repositoryId - * @param {string} repositoryType - * @param {BuildInterfaces.DefinitionQueryOrder} queryOrder - * @param {number} top - * @param {string} continuationToken - * @param onResult callback function with the resulting BuildInterfaces.DefinitionReference[] - */ - getDefinitions(project: string, name: string, type: BuildInterfaces.DefinitionType, repositoryId: string, repositoryType: string, queryOrder: BuildInterfaces.DefinitionQueryOrder, top: number, continuationToken: string, onResult: (err: any, statusCode: number, definitions: BuildInterfaces.DefinitionReference[]) => void): void; - /** - * Updates an existing definition - * - * @param {BuildInterfaces.BuildDefinition} definition - * @param {number} definitionId - * @param {string} project - Project ID or project name - * @param {number} secretsSourceDefinitionId - * @param {number} secretsSourceDefinitionRevision - * @param onResult callback function with the resulting BuildInterfaces.BuildDefinition - */ - updateDefinition(definition: BuildInterfaces.BuildDefinition, definitionId: number, project: string, secretsSourceDefinitionId: number, secretsSourceDefinitionRevision: number, onResult: (err: any, statusCode: number, definition: BuildInterfaces.BuildDefinition) => void): void; - /** - * Gets the deployment information associated with a build - * - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param onResult callback function with the resulting BuildInterfaces.Deployment[] - */ - getBuildDeployments(project: string, buildId: number, onResult: (err: any, statusCode: number, deployments: BuildInterfaces.Deployment[]) => void): void; - /** - * Gets a log - * - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {number} logId - * @param {number} startLine - * @param {number} endLine - * @param onResult callback function with the resulting ArrayBuffer - */ - getBuildLog(project: string, buildId: number, logId: number, startLine: number, endLine: number, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * Gets logs for a build - * - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param onResult callback function with the resulting BuildInterfaces.BuildLog[] - */ - getBuildLogs(project: string, buildId: number, onResult: (err: any, statusCode: number, logs: BuildInterfaces.BuildLog[]) => void): void; - /** - * Gets logs for a build - * - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param onResult callback function with the resulting ArrayBuffer - */ - getBuildLogsZip(project: string, buildId: number, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting BuildInterfaces.BuildOptionDefinition[] - */ - getBuildOptionDefinitions(project: string, onResult: (err: any, statusCode: number, options: BuildInterfaces.BuildOptionDefinition[]) => void): void; - /** - * Creates a build queue - * - * @param {BuildInterfaces.AgentPoolQueue} queue - * @param onResult callback function with the resulting BuildInterfaces.AgentPoolQueue - */ - createQueue(queue: BuildInterfaces.AgentPoolQueue, onResult: (err: any, statusCode: number, queue: BuildInterfaces.AgentPoolQueue) => void): void; - /** - * Deletes a build queue - * - * @param {number} id - * @param onResult callback function - */ - deleteQueue(id: number, onResult: (err: any, statusCode: number) => void): void; - /** - * Gets a queue - * - * @param {number} controllerId - * @param onResult callback function with the resulting BuildInterfaces.AgentPoolQueue - */ - getAgentPoolQueue(controllerId: number, onResult: (err: any, statusCode: number, queue: BuildInterfaces.AgentPoolQueue) => void): void; - /** - * Gets queues, optionally filtered by name - * - * @param {string} name - * @param onResult callback function with the resulting BuildInterfaces.AgentPoolQueue[] - */ - getQueues(name: string, onResult: (err: any, statusCode: number, queues: BuildInterfaces.AgentPoolQueue[]) => void): void; - /** - * Gets report for a build - * - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {string} type - * @param onResult callback function with the resulting BuildInterfaces.BuildReportMetadata - */ - getBuildReport(project: string, buildId: number, type: string, onResult: (err: any, statusCode: number, report: BuildInterfaces.BuildReportMetadata) => void): void; - /** - * Gets report for a build - * - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {string} type - * @param onResult callback function with the resulting any - */ - getBuildReportHtmlContent(project: string, buildId: number, type: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * @param onResult callback function with the resulting BuildInterfaces.BuildResourceUsage - */ - getResourceUsage(onResult: (err: any, statusCode: number, ResourceUsage: BuildInterfaces.BuildResourceUsage) => void): void; - /** - * Gets revisions of a definition - * - * @param {string} project - Project ID or project name - * @param {number} definitionId - * @param onResult callback function with the resulting BuildInterfaces.BuildDefinitionRevision[] - */ - getDefinitionRevisions(project: string, definitionId: number, onResult: (err: any, statusCode: number, revisions: BuildInterfaces.BuildDefinitionRevision[]) => void): void; - /** - * @param onResult callback function with the resulting BuildInterfaces.BuildSettings - */ - getBuildSettings(onResult: (err: any, statusCode: number, setting: BuildInterfaces.BuildSettings) => void): void; - /** - * Updates the build settings - * - * @param {BuildInterfaces.BuildSettings} settings - * @param onResult callback function with the resulting BuildInterfaces.BuildSettings - */ - updateBuildSettings(settings: BuildInterfaces.BuildSettings, onResult: (err: any, statusCode: number, setting: BuildInterfaces.BuildSettings) => void): void; - /** - * Adds a tag to a build - * - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {string} tag - * @param onResult callback function with the resulting string[] - */ - addBuildTag(project: string, buildId: number, tag: string, onResult: (err: any, statusCode: number, tags: string[]) => void): void; - /** - * Adds tag to a build - * - * @param {string[]} tags - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param onResult callback function with the resulting string[] - */ - addBuildTags(tags: string[], project: string, buildId: number, onResult: (err: any, statusCode: number, tags: string[]) => void): void; - /** - * Deletes a tag from a build - * - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {string} tag - * @param onResult callback function with the resulting string[] - */ - deleteBuildTag(project: string, buildId: number, tag: string, onResult: (err: any, statusCode: number, tags: string[]) => void): void; - /** - * Gets the tags for a build - * - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param onResult callback function with the resulting string[] - */ - getBuildTags(project: string, buildId: number, onResult: (err: any, statusCode: number, tags: string[]) => void): void; - /** - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting string[] - */ - getTags(project: string, onResult: (err: any, statusCode: number, tags: string[]) => void): void; - /** - * Deletes a definition template - * - * @param {string} project - Project ID or project name - * @param {string} templateId - * @param onResult callback function - */ - deleteTemplate(project: string, templateId: string, onResult: (err: any, statusCode: number) => void): void; - /** - * Gets definition template filtered by id - * - * @param {string} project - Project ID or project name - * @param {string} templateId - * @param onResult callback function with the resulting BuildInterfaces.BuildDefinitionTemplate - */ - getTemplate(project: string, templateId: string, onResult: (err: any, statusCode: number, template: BuildInterfaces.BuildDefinitionTemplate) => void): void; - /** - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting BuildInterfaces.BuildDefinitionTemplate[] - */ - getTemplates(project: string, onResult: (err: any, statusCode: number, templates: BuildInterfaces.BuildDefinitionTemplate[]) => void): void; - /** - * Saves a definition template - * - * @param {BuildInterfaces.BuildDefinitionTemplate} template - * @param {string} project - Project ID or project name - * @param {string} templateId - * @param onResult callback function with the resulting BuildInterfaces.BuildDefinitionTemplate - */ - saveTemplate(template: BuildInterfaces.BuildDefinitionTemplate, project: string, templateId: string, onResult: (err: any, statusCode: number, template: BuildInterfaces.BuildDefinitionTemplate) => void): void; - /** - * Gets details for a build - * - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {string} timelineId - * @param {number} changeId - * @param onResult callback function with the resulting BuildInterfaces.Timeline - */ - getBuildTimeline(project: string, buildId: number, timelineId: string, changeId: number, onResult: (err: any, statusCode: number, Timeline: BuildInterfaces.Timeline) => void): void; - /** - * Gets the work item ids associated with a build - * - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {number} top - The maximum number of workitems to return - * @param onResult callback function with the resulting VSSInterfaces.ResourceRef[] - */ - getBuildWorkItemsRefs(project: string, buildId: number, top: number, onResult: (err: any, statusCode: number, workitems: VSSInterfaces.ResourceRef[]) => void): void; - /** - * Gets the work item ids associated with build commits - * - * @param {string[]} commitIds - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {number} top - The maximum number of workitems to return, also number of commits to consider if commitids are not sent - * @param onResult callback function with the resulting VSSInterfaces.ResourceRef[] - */ - getBuildWorkItemsRefsFromCommits(commitIds: string[], project: string, buildId: number, top: number, onResult: (err: any, statusCode: number, workitems: VSSInterfaces.ResourceRef[]) => void): void; - /** - * Gets all the work item ids inbetween fromBuildId to toBuildId - * - * @param {string} project - Project ID or project name - * @param {number} fromBuildId - * @param {number} toBuildId - * @param {number} top - The maximum number of workitems to return - * @param onResult callback function with the resulting VSSInterfaces.ResourceRef[] - */ - getWorkItemsBetweenBuilds(project: string, fromBuildId: number, toBuildId: number, top: number, onResult: (err: any, statusCode: number, workitems: VSSInterfaces.ResourceRef[]) => void): void; - } - export class QBuildApi extends basem.QClientApiBase implements IQBuildApi { - api: BuildApi; - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]); - /** - * Associates an artifact with a build - * - * @param {BuildInterfaces.BuildArtifact} artifact - * @param {number} buildId - * @param {string} project - Project ID or project name - */ - createArtifact(artifact: BuildInterfaces.BuildArtifact, buildId: number, project?: string): Q.Promise; - /** - * Gets a specific artifact for a build - * - * @param {number} buildId - * @param {string} artifactName - * @param {string} project - Project ID or project name - */ - getArtifact(buildId: number, artifactName: string, project?: string): Q.Promise; - /** - * Gets a specific artifact for a build - * - * @param {number} buildId - * @param {string} artifactName - * @param {string} project - Project ID or project name - */ - getArtifactContentZip(buildId: number, artifactName: string, project?: string): Q.Promise; - /** - * Gets all artifacts for a build - * - * @param {number} buildId - * @param {string} project - Project ID or project name - */ - getArtifacts(buildId: number, project?: string): Q.Promise; - /** - * @param {string} project - * @param {number} definitionId - * @param {string} branchName - */ - getBadge(project: string, definitionId: number, branchName?: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {string} repoType - * @param {string} repoId - * @param {string} branchName - */ - getBuildBadge(project: string, repoType: string, repoId?: string, branchName?: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {string} repoType - * @param {string} repoId - * @param {string} branchName - */ - getBuildBadgeData(project: string, repoType: string, repoId?: string, branchName?: string): Q.Promise; - /** - * Deletes a build - * - * @param {number} buildId - * @param {string} project - Project ID or project name - */ - deleteBuild(buildId: number, project?: string): Q.Promise; - /** - * Gets a build - * - * @param {number} buildId - * @param {string} project - Project ID or project name - * @param {string} propertyFilters - A comma-delimited list of properties to include in the results - */ - getBuild(buildId: number, project?: string, propertyFilters?: string): Q.Promise; - /** - * Gets builds - * - * @param {string} project - Project ID or project name - * @param {number[]} definitions - A comma-delimited list of definition ids - * @param {number[]} queues - A comma-delimited list of queue ids - * @param {string} buildNumber - * @param {Date} minFinishTime - * @param {Date} maxFinishTime - * @param {string} requestedFor - * @param {BuildInterfaces.BuildReason} reasonFilter - * @param {BuildInterfaces.BuildStatus} statusFilter - * @param {BuildInterfaces.BuildResult} resultFilter - * @param {string[]} tagFilters - A comma-delimited list of tags - * @param {string[]} properties - A comma-delimited list of properties to include in the results - * @param {BuildInterfaces.DefinitionType} type - The definition type - * @param {number} top - The maximum number of builds to retrieve - * @param {string} continuationToken - * @param {number} maxBuildsPerDefinition - * @param {BuildInterfaces.QueryDeletedOption} deletedFilter - * @param {BuildInterfaces.BuildQueryOrder} queryOrder - * @param {string} branchName - */ - getBuilds(project?: string, definitions?: number[], queues?: number[], buildNumber?: string, minFinishTime?: Date, maxFinishTime?: Date, requestedFor?: string, reasonFilter?: BuildInterfaces.BuildReason, statusFilter?: BuildInterfaces.BuildStatus, resultFilter?: BuildInterfaces.BuildResult, tagFilters?: string[], properties?: string[], type?: BuildInterfaces.DefinitionType, top?: number, continuationToken?: string, maxBuildsPerDefinition?: number, deletedFilter?: BuildInterfaces.QueryDeletedOption, queryOrder?: BuildInterfaces.BuildQueryOrder, branchName?: string): Q.Promise; - /** - * Queues a build - * - * @param {BuildInterfaces.Build} build - * @param {string} project - Project ID or project name - * @param {boolean} ignoreWarnings - * @param {string} checkInTicket - */ - queueBuild(build: BuildInterfaces.Build, project?: string, ignoreWarnings?: boolean, checkInTicket?: string): Q.Promise; - /** - * Updates a build - * - * @param {BuildInterfaces.Build} build - * @param {number} buildId - * @param {string} project - Project ID or project name - */ - updateBuild(build: BuildInterfaces.Build, buildId: number, project?: string): Q.Promise; - /** - * Gets the changes associated with a build - * - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {string} continuationToken - * @param {number} top - The maximum number of changes to return - * @param {boolean} includeSourceChange - */ - getBuildChanges(project: string, buildId: number, continuationToken?: string, top?: number, includeSourceChange?: boolean): Q.Promise; - /** - * Gets the changes associated between given builds - * - * @param {string} project - Project ID or project name - * @param {number} fromBuildId - * @param {number} toBuildId - * @param {number} top - The maximum number of changes to return - */ - getChangesBetweenBuilds(project: string, fromBuildId?: number, toBuildId?: number, top?: number): Q.Promise; - /** - * Gets a controller - * - * @param {number} controllerId - */ - getBuildController(controllerId: number): Q.Promise; - /** - * Gets controller, optionally filtered by name - * - * @param {string} name - */ - getBuildControllers(name?: string): Q.Promise; - /** - * Creates a new definition - * - * @param {BuildInterfaces.BuildDefinition} definition - * @param {string} project - Project ID or project name - * @param {number} definitionToCloneId - * @param {number} definitionToCloneRevision - */ - createDefinition(definition: BuildInterfaces.BuildDefinition, project?: string, definitionToCloneId?: number, definitionToCloneRevision?: number): Q.Promise; - /** - * Deletes a definition and all associated builds - * - * @param {number} definitionId - * @param {string} project - Project ID or project name - */ - deleteDefinition(definitionId: number, project?: string): Q.Promise; - /** - * Gets a definition, optionally at a specific revision - * - * @param {number} definitionId - * @param {string} project - Project ID or project name - * @param {number} revision - * @param {string[]} propertyFilters - */ - getDefinition(definitionId: number, project?: string, revision?: number, propertyFilters?: string[]): Q.Promise; - /** - * Gets definitions, optionally filtered by name - * - * @param {string} project - Project ID or project name - * @param {string} name - * @param {BuildInterfaces.DefinitionType} type - * @param {string} repositoryId - * @param {string} repositoryType - * @param {BuildInterfaces.DefinitionQueryOrder} queryOrder - * @param {number} top - * @param {string} continuationToken - */ - getDefinitions(project?: string, name?: string, type?: BuildInterfaces.DefinitionType, repositoryId?: string, repositoryType?: string, queryOrder?: BuildInterfaces.DefinitionQueryOrder, top?: number, continuationToken?: string): Q.Promise; - /** - * Updates an existing definition - * - * @param {BuildInterfaces.BuildDefinition} definition - * @param {number} definitionId - * @param {string} project - Project ID or project name - * @param {number} secretsSourceDefinitionId - * @param {number} secretsSourceDefinitionRevision - */ - updateDefinition(definition: BuildInterfaces.BuildDefinition, definitionId: number, project?: string, secretsSourceDefinitionId?: number, secretsSourceDefinitionRevision?: number): Q.Promise; - /** - * Gets the deployment information associated with a build - * - * @param {string} project - Project ID or project name - * @param {number} buildId - */ - getBuildDeployments(project: string, buildId: number): Q.Promise; - /** - * Gets a log - * - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {number} logId - * @param {number} startLine - * @param {number} endLine - */ - getBuildLog(project: string, buildId: number, logId: number, startLine?: number, endLine?: number): Q.Promise; - /** - * Gets logs for a build - * - * @param {string} project - Project ID or project name - * @param {number} buildId - */ - getBuildLogs(project: string, buildId: number): Q.Promise; - /** - * Gets logs for a build - * - * @param {string} project - Project ID or project name - * @param {number} buildId - */ - getBuildLogsZip(project: string, buildId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - */ - getBuildOptionDefinitions(project?: string): Q.Promise; - /** - * Creates a build queue - * - * @param {BuildInterfaces.AgentPoolQueue} queue - */ - createQueue(queue: BuildInterfaces.AgentPoolQueue): Q.Promise; - /** - * Deletes a build queue - * - * @param {number} id - */ - deleteQueue(id: number): Q.Promise; - /** - * Gets a queue - * - * @param {number} controllerId - */ - getAgentPoolQueue(controllerId: number): Q.Promise; - /** - * Gets queues, optionally filtered by name - * - * @param {string} name - */ - getQueues(name?: string): Q.Promise; - /** - * Gets report for a build - * - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {string} type - */ - getBuildReport(project: string, buildId: number, type?: string): Q.Promise; - /** - * Gets report for a build - * - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {string} type - */ - getBuildReportHtmlContent(project: string, buildId: number, type?: string): Q.Promise; - /** - */ - getResourceUsage(): Q.Promise; - /** - * Gets revisions of a definition - * - * @param {string} project - Project ID or project name - * @param {number} definitionId - */ - getDefinitionRevisions(project: string, definitionId: number): Q.Promise; - /** - */ - getBuildSettings(): Q.Promise; - /** - * Updates the build settings - * - * @param {BuildInterfaces.BuildSettings} settings - */ - updateBuildSettings(settings: BuildInterfaces.BuildSettings): Q.Promise; - /** - * Adds a tag to a build - * - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {string} tag - */ - addBuildTag(project: string, buildId: number, tag: string): Q.Promise; - /** - * Adds tag to a build - * - * @param {string[]} tags - * @param {string} project - Project ID or project name - * @param {number} buildId - */ - addBuildTags(tags: string[], project: string, buildId: number): Q.Promise; - /** - * Deletes a tag from a build - * - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {string} tag - */ - deleteBuildTag(project: string, buildId: number, tag: string): Q.Promise; - /** - * Gets the tags for a build - * - * @param {string} project - Project ID or project name - * @param {number} buildId - */ - getBuildTags(project: string, buildId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - */ - getTags(project: string): Q.Promise; - /** - * Deletes a definition template - * - * @param {string} project - Project ID or project name - * @param {string} templateId - */ - deleteTemplate(project: string, templateId: string): Q.Promise; - /** - * Gets definition template filtered by id - * - * @param {string} project - Project ID or project name - * @param {string} templateId - */ - getTemplate(project: string, templateId: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - */ - getTemplates(project: string): Q.Promise; - /** - * Saves a definition template - * - * @param {BuildInterfaces.BuildDefinitionTemplate} template - * @param {string} project - Project ID or project name - * @param {string} templateId - */ - saveTemplate(template: BuildInterfaces.BuildDefinitionTemplate, project: string, templateId: string): Q.Promise; - /** - * Gets details for a build - * - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {string} timelineId - * @param {number} changeId - */ - getBuildTimeline(project: string, buildId: number, timelineId?: string, changeId?: number): Q.Promise; - /** - * Gets the work item ids associated with a build - * - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {number} top - The maximum number of workitems to return - */ - getBuildWorkItemsRefs(project: string, buildId: number, top?: number): Q.Promise; - /** - * Gets the work item ids associated with build commits - * - * @param {string[]} commitIds - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {number} top - The maximum number of workitems to return, also number of commits to consider if commitids are not sent - */ - getBuildWorkItemsRefsFromCommits(commitIds: string[], project: string, buildId: number, top?: number): Q.Promise; - /** - * Gets all the work item ids inbetween fromBuildId to toBuildId - * - * @param {string} project - Project ID or project name - * @param {number} fromBuildId - * @param {number} toBuildId - * @param {number} top - The maximum number of workitems to return - */ - getWorkItemsBetweenBuilds(project: string, fromBuildId: number, toBuildId: number, top?: number): Q.Promise; - } - -} -declare module 'vso-node-api/interfaces/common/OperationsInterfaces' { - /** - * Reference for an async operation. - */ - export interface OperationReference { - /** - * The identifier for this operation. - */ - id: string; - /** - * The current status of the operation. - */ - status: OperationStatus; - /** - * Url to get the full object. - */ - url: string; - } - export enum OperationStatus { - /** - * The operation object does not have the status set. - */ - NotSet = 0, - /** - * The operation has been queued. - */ - Queued = 1, - /** - * The operation is in progress. - */ - InProgress = 2, - /** - * The operation was cancelled by the user. - */ - Cancelled = 3, - /** - * The operation completed successfully. - */ - Succeeded = 4, - /** - * The operation completed with a failure. - */ - Failed = 5, - } - export var TypeInfo: { - OperationReference: { - fields: any; - }; - OperationStatus: { - enumValues: { - "notSet": number; - "queued": number; - "inProgress": number; - "cancelled": number; - "succeeded": number; - "failed": number; - }; - }; - }; - -} -declare module 'vso-node-api/CoreApi' { - /// - /// - import Q = require('q'); - import basem = require('vso-node-api/ClientApiBases'); - import VsoBaseInterfaces = require('vso-node-api/interfaces/common/VsoBaseInterfaces'); - import CoreInterfaces = require('vso-node-api/interfaces/CoreInterfaces'); - import OperationsInterfaces = require('vso-node-api/interfaces/common/OperationsInterfaces'); - import VSSInterfaces = require('vso-node-api/interfaces/common/VSSInterfaces'); - export interface ICoreApi extends basem.ClientApiBase { - createConnectedService(connectedServiceCreationData: CoreInterfaces.WebApiConnectedServiceDetails, projectId: string, onResult: (err: any, statusCode: number, connectedService: CoreInterfaces.WebApiConnectedService) => void): void; - getConnectedServiceDetails(projectId: string, name: string, onResult: (err: any, statusCode: number, connectedService: CoreInterfaces.WebApiConnectedServiceDetails) => void): void; - getConnectedServices(projectId: string, kind: CoreInterfaces.ConnectedServiceKind, onResult: (err: any, statusCode: number, connectedServices: CoreInterfaces.WebApiConnectedService[]) => void): void; - createIdentityMru(mruData: CoreInterfaces.IdentityData, mruName: string, onResult: (err: any, statusCode: number) => void): void; - deleteIdentityMru(mruData: CoreInterfaces.IdentityData, mruName: string, onResult: (err: any, statusCode: number) => void): void; - getIdentityMru(mruName: string, onResult: (err: any, statusCode: number, identityMru: VSSInterfaces.IdentityRef[]) => void): void; - updateIdentityMru(mruData: CoreInterfaces.IdentityData, mruName: string, onResult: (err: any, statusCode: number) => void): void; - getTeamMembers(projectId: string, teamId: string, top: number, skip: number, onResult: (err: any, statusCode: number, members: VSSInterfaces.IdentityRef[]) => void): void; - getProcessById(processId: string, onResult: (err: any, statusCode: number, processe: CoreInterfaces.Process) => void): void; - getProcesses(onResult: (err: any, statusCode: number, processes: CoreInterfaces.Process[]) => void): void; - getProjectCollection(collectionId: string, onResult: (err: any, statusCode: number, projectCollection: CoreInterfaces.TeamProjectCollection) => void): void; - getProjectCollections(top: number, skip: number, onResult: (err: any, statusCode: number, projectCollections: CoreInterfaces.TeamProjectCollectionReference[]) => void): void; - getProjectHistory(minRevision: number, onResult: (err: any, statusCode: number, projectHistory: CoreInterfaces.TeamProjectReference[]) => void): void; - getProject(projectId: string, includeCapabilities: boolean, includeHistory: boolean, onResult: (err: any, statusCode: number, project: CoreInterfaces.TeamProject) => void): void; - getProjects(stateFilter: any, top: number, skip: number, onResult: (err: any, statusCode: number, projects: CoreInterfaces.TeamProjectReference[]) => void): void; - queueCreateProject(projectToCreate: CoreInterfaces.TeamProject, onResult: (err: any, statusCode: number, project: OperationsInterfaces.OperationReference) => void): void; - queueDeleteProject(projectId: string, onResult: (err: any, statusCode: number, project: OperationsInterfaces.OperationReference) => void): void; - updateProject(projectUpdate: CoreInterfaces.TeamProject, projectId: string, onResult: (err: any, statusCode: number, project: OperationsInterfaces.OperationReference) => void): void; - getProxies(proxyUrl: string, onResult: (err: any, statusCode: number, proxies: CoreInterfaces.Proxy[]) => void): void; - createTeam(team: CoreInterfaces.WebApiTeam, projectId: string, onResult: (err: any, statusCode: number, team: CoreInterfaces.WebApiTeam) => void): void; - deleteTeam(projectId: string, teamId: string, onResult: (err: any, statusCode: number) => void): void; - getTeam(projectId: string, teamId: string, onResult: (err: any, statusCode: number, team: CoreInterfaces.WebApiTeam) => void): void; - getTeams(projectId: string, top: number, skip: number, onResult: (err: any, statusCode: number, teams: CoreInterfaces.WebApiTeam[]) => void): void; - updateTeam(teamData: CoreInterfaces.WebApiTeam, projectId: string, teamId: string, onResult: (err: any, statusCode: number, team: CoreInterfaces.WebApiTeam) => void): void; - } - export interface IQCoreApi extends basem.QClientApiBase { - createConnectedService(connectedServiceCreationData: CoreInterfaces.WebApiConnectedServiceDetails, projectId: string): Q.Promise; - getConnectedServiceDetails(projectId: string, name: string): Q.Promise; - getConnectedServices(projectId: string, kind?: CoreInterfaces.ConnectedServiceKind): Q.Promise; - createIdentityMru(mruData: CoreInterfaces.IdentityData, mruName: string): Q.Promise; - deleteIdentityMru(mruData: CoreInterfaces.IdentityData, mruName: string): Q.Promise; - getIdentityMru(mruName: string): Q.Promise; - updateIdentityMru(mruData: CoreInterfaces.IdentityData, mruName: string): Q.Promise; - getTeamMembers(projectId: string, teamId: string, top?: number, skip?: number): Q.Promise; - getProcessById(processId: string): Q.Promise; - getProcesses(): Q.Promise; - getProjectCollection(collectionId: string): Q.Promise; - getProjectCollections(top?: number, skip?: number): Q.Promise; - getProjectHistory(minRevision?: number): Q.Promise; - getProject(projectId: string, includeCapabilities?: boolean, includeHistory?: boolean): Q.Promise; - getProjects(stateFilter?: any, top?: number, skip?: number): Q.Promise; - queueCreateProject(projectToCreate: CoreInterfaces.TeamProject): Q.Promise; - queueDeleteProject(projectId: string): Q.Promise; - updateProject(projectUpdate: CoreInterfaces.TeamProject, projectId: string): Q.Promise; - getProxies(proxyUrl?: string): Q.Promise; - createTeam(team: CoreInterfaces.WebApiTeam, projectId: string): Q.Promise; - deleteTeam(projectId: string, teamId: string): Q.Promise; - getTeam(projectId: string, teamId: string): Q.Promise; - getTeams(projectId: string, top?: number, skip?: number): Q.Promise; - updateTeam(teamData: CoreInterfaces.WebApiTeam, projectId: string, teamId: string): Q.Promise; - } - export class CoreApi extends basem.ClientApiBase implements ICoreApi { - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]); - /** - * @param {CoreInterfaces.WebApiConnectedServiceDetails} connectedServiceCreationData - * @param {string} projectId - * @param onResult callback function with the resulting CoreInterfaces.WebApiConnectedService - */ - createConnectedService(connectedServiceCreationData: CoreInterfaces.WebApiConnectedServiceDetails, projectId: string, onResult: (err: any, statusCode: number, connectedService: CoreInterfaces.WebApiConnectedService) => void): void; - /** - * @param {string} projectId - * @param {string} name - * @param onResult callback function with the resulting CoreInterfaces.WebApiConnectedServiceDetails - */ - getConnectedServiceDetails(projectId: string, name: string, onResult: (err: any, statusCode: number, connectedService: CoreInterfaces.WebApiConnectedServiceDetails) => void): void; - /** - * @param {string} projectId - * @param {CoreInterfaces.ConnectedServiceKind} kind - * @param onResult callback function with the resulting CoreInterfaces.WebApiConnectedService[] - */ - getConnectedServices(projectId: string, kind: CoreInterfaces.ConnectedServiceKind, onResult: (err: any, statusCode: number, connectedServices: CoreInterfaces.WebApiConnectedService[]) => void): void; - /** - * @param {CoreInterfaces.IdentityData} mruData - * @param {string} mruName - * @param onResult callback function - */ - createIdentityMru(mruData: CoreInterfaces.IdentityData, mruName: string, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {CoreInterfaces.IdentityData} mruData - * @param {string} mruName - * @param onResult callback function - */ - deleteIdentityMru(mruData: CoreInterfaces.IdentityData, mruName: string, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} mruName - * @param onResult callback function with the resulting VSSInterfaces.IdentityRef[] - */ - getIdentityMru(mruName: string, onResult: (err: any, statusCode: number, identityMru: VSSInterfaces.IdentityRef[]) => void): void; - /** - * @param {CoreInterfaces.IdentityData} mruData - * @param {string} mruName - * @param onResult callback function - */ - updateIdentityMru(mruData: CoreInterfaces.IdentityData, mruName: string, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} projectId - * @param {string} teamId - * @param {number} top - * @param {number} skip - * @param onResult callback function with the resulting VSSInterfaces.IdentityRef[] - */ - getTeamMembers(projectId: string, teamId: string, top: number, skip: number, onResult: (err: any, statusCode: number, members: VSSInterfaces.IdentityRef[]) => void): void; - /** - * Retrieve process by id - * - * @param {string} processId - * @param onResult callback function with the resulting CoreInterfaces.Process - */ - getProcessById(processId: string, onResult: (err: any, statusCode: number, processe: CoreInterfaces.Process) => void): void; - /** - * @param onResult callback function with the resulting CoreInterfaces.Process[] - */ - getProcesses(onResult: (err: any, statusCode: number, processes: CoreInterfaces.Process[]) => void): void; - /** - * Get project collection with the specified id or name. - * - * @param {string} collectionId - * @param onResult callback function with the resulting CoreInterfaces.TeamProjectCollection - */ - getProjectCollection(collectionId: string, onResult: (err: any, statusCode: number, projectCollection: CoreInterfaces.TeamProjectCollection) => void): void; - /** - * Get project collection references for this application. - * - * @param {number} top - * @param {number} skip - * @param onResult callback function with the resulting CoreInterfaces.TeamProjectCollectionReference[] - */ - getProjectCollections(top: number, skip: number, onResult: (err: any, statusCode: number, projectCollections: CoreInterfaces.TeamProjectCollectionReference[]) => void): void; - /** - * @param {number} minRevision - * @param onResult callback function with the resulting CoreInterfaces.TeamProjectReference[] - */ - getProjectHistory(minRevision: number, onResult: (err: any, statusCode: number, projectHistory: CoreInterfaces.TeamProjectReference[]) => void): void; - /** - * Get project with the specified id or name, optionally including capabilities. - * - * @param {string} projectId - * @param {boolean} includeCapabilities - Include capabilities (such as source control) in the team project result (default: false). - * @param {boolean} includeHistory - Search within renamed projects (that had such name in the past). - * @param onResult callback function with the resulting CoreInterfaces.TeamProject - */ - getProject(projectId: string, includeCapabilities: boolean, includeHistory: boolean, onResult: (err: any, statusCode: number, project: CoreInterfaces.TeamProject) => void): void; - /** - * Get project references with the specified state - * - * @param {any} stateFilter - Filter on team projects in a specific team project state (default: WellFormed). - * @param {number} top - * @param {number} skip - * @param onResult callback function with the resulting CoreInterfaces.TeamProjectReference[] - */ - getProjects(stateFilter: any, top: number, skip: number, onResult: (err: any, statusCode: number, projects: CoreInterfaces.TeamProjectReference[]) => void): void; - /** - * Queue a project creation. - * - * @param {CoreInterfaces.TeamProject} projectToCreate - The project to create. - * @param onResult callback function with the resulting OperationsInterfaces.OperationReference - */ - queueCreateProject(projectToCreate: CoreInterfaces.TeamProject, onResult: (err: any, statusCode: number, project: OperationsInterfaces.OperationReference) => void): void; - /** - * Queue a project deletion. - * - * @param {string} projectId - The project id of the project to delete. - * @param onResult callback function with the resulting OperationsInterfaces.OperationReference - */ - queueDeleteProject(projectId: string, onResult: (err: any, statusCode: number, project: OperationsInterfaces.OperationReference) => void): void; - /** - * Update an existing project's name, abbreviation, or description. - * - * @param {CoreInterfaces.TeamProject} projectUpdate - The updates for the project. - * @param {string} projectId - The project id of the project to update. - * @param onResult callback function with the resulting OperationsInterfaces.OperationReference - */ - updateProject(projectUpdate: CoreInterfaces.TeamProject, projectId: string, onResult: (err: any, statusCode: number, project: OperationsInterfaces.OperationReference) => void): void; - /** - * @param {string} proxyUrl - * @param onResult callback function with the resulting CoreInterfaces.Proxy[] - */ - getProxies(proxyUrl: string, onResult: (err: any, statusCode: number, proxies: CoreInterfaces.Proxy[]) => void): void; - /** - * Creates a team - * - * @param {CoreInterfaces.WebApiTeam} team - The team data used to create the team. - * @param {string} projectId - The name or id (GUID) of the team project in which to create the team. - * @param onResult callback function with the resulting CoreInterfaces.WebApiTeam - */ - createTeam(team: CoreInterfaces.WebApiTeam, projectId: string, onResult: (err: any, statusCode: number, team: CoreInterfaces.WebApiTeam) => void): void; - /** - * Deletes a team - * - * @param {string} projectId - The name or id (GUID) of the team project containing the team to delete. - * @param {string} teamId - The name of id of the team to delete. - * @param onResult callback function - */ - deleteTeam(projectId: string, teamId: string, onResult: (err: any, statusCode: number) => void): void; - /** - * Gets a team - * - * @param {string} projectId - * @param {string} teamId - * @param onResult callback function with the resulting CoreInterfaces.WebApiTeam - */ - getTeam(projectId: string, teamId: string, onResult: (err: any, statusCode: number, team: CoreInterfaces.WebApiTeam) => void): void; - /** - * @param {string} projectId - * @param {number} top - * @param {number} skip - * @param onResult callback function with the resulting CoreInterfaces.WebApiTeam[] - */ - getTeams(projectId: string, top: number, skip: number, onResult: (err: any, statusCode: number, teams: CoreInterfaces.WebApiTeam[]) => void): void; - /** - * Updates a team's name and/or description - * - * @param {CoreInterfaces.WebApiTeam} teamData - * @param {string} projectId - The name or id (GUID) of the team project containing the team to update. - * @param {string} teamId - The name of id of the team to update. - * @param onResult callback function with the resulting CoreInterfaces.WebApiTeam - */ - updateTeam(teamData: CoreInterfaces.WebApiTeam, projectId: string, teamId: string, onResult: (err: any, statusCode: number, team: CoreInterfaces.WebApiTeam) => void): void; - } - export class QCoreApi extends basem.QClientApiBase implements IQCoreApi { - api: CoreApi; - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]); - /** - * @param {CoreInterfaces.WebApiConnectedServiceDetails} connectedServiceCreationData - * @param {string} projectId - */ - createConnectedService(connectedServiceCreationData: CoreInterfaces.WebApiConnectedServiceDetails, projectId: string): Q.Promise; - /** - * @param {string} projectId - * @param {string} name - */ - getConnectedServiceDetails(projectId: string, name: string): Q.Promise; - /** - * @param {string} projectId - * @param {CoreInterfaces.ConnectedServiceKind} kind - */ - getConnectedServices(projectId: string, kind?: CoreInterfaces.ConnectedServiceKind): Q.Promise; - /** - * @param {CoreInterfaces.IdentityData} mruData - * @param {string} mruName - */ - createIdentityMru(mruData: CoreInterfaces.IdentityData, mruName: string): Q.Promise; - /** - * @param {CoreInterfaces.IdentityData} mruData - * @param {string} mruName - */ - deleteIdentityMru(mruData: CoreInterfaces.IdentityData, mruName: string): Q.Promise; - /** - * @param {string} mruName - */ - getIdentityMru(mruName: string): Q.Promise; - /** - * @param {CoreInterfaces.IdentityData} mruData - * @param {string} mruName - */ - updateIdentityMru(mruData: CoreInterfaces.IdentityData, mruName: string): Q.Promise; - /** - * @param {string} projectId - * @param {string} teamId - * @param {number} top - * @param {number} skip - */ - getTeamMembers(projectId: string, teamId: string, top?: number, skip?: number): Q.Promise; - /** - * Retrieve process by id - * - * @param {string} processId - */ - getProcessById(processId: string): Q.Promise; - /** - */ - getProcesses(): Q.Promise; - /** - * Get project collection with the specified id or name. - * - * @param {string} collectionId - */ - getProjectCollection(collectionId: string): Q.Promise; - /** - * Get project collection references for this application. - * - * @param {number} top - * @param {number} skip - */ - getProjectCollections(top?: number, skip?: number): Q.Promise; - /** - * @param {number} minRevision - */ - getProjectHistory(minRevision?: number): Q.Promise; - /** - * Get project with the specified id or name, optionally including capabilities. - * - * @param {string} projectId - * @param {boolean} includeCapabilities - Include capabilities (such as source control) in the team project result (default: false). - * @param {boolean} includeHistory - Search within renamed projects (that had such name in the past). - */ - getProject(projectId: string, includeCapabilities?: boolean, includeHistory?: boolean): Q.Promise; - /** - * Get project references with the specified state - * - * @param {any} stateFilter - Filter on team projects in a specific team project state (default: WellFormed). - * @param {number} top - * @param {number} skip - */ - getProjects(stateFilter?: any, top?: number, skip?: number): Q.Promise; - /** - * Queue a project creation. - * - * @param {CoreInterfaces.TeamProject} projectToCreate - The project to create. - */ - queueCreateProject(projectToCreate: CoreInterfaces.TeamProject): Q.Promise; - /** - * Queue a project deletion. - * - * @param {string} projectId - The project id of the project to delete. - */ - queueDeleteProject(projectId: string): Q.Promise; - /** - * Update an existing project's name, abbreviation, or description. - * - * @param {CoreInterfaces.TeamProject} projectUpdate - The updates for the project. - * @param {string} projectId - The project id of the project to update. - */ - updateProject(projectUpdate: CoreInterfaces.TeamProject, projectId: string): Q.Promise; - /** - * @param {string} proxyUrl - */ - getProxies(proxyUrl?: string): Q.Promise; - /** - * Creates a team - * - * @param {CoreInterfaces.WebApiTeam} team - The team data used to create the team. - * @param {string} projectId - The name or id (GUID) of the team project in which to create the team. - */ - createTeam(team: CoreInterfaces.WebApiTeam, projectId: string): Q.Promise; - /** - * Deletes a team - * - * @param {string} projectId - The name or id (GUID) of the team project containing the team to delete. - * @param {string} teamId - The name of id of the team to delete. - */ - deleteTeam(projectId: string, teamId: string): Q.Promise; - /** - * Gets a team - * - * @param {string} projectId - * @param {string} teamId - */ - getTeam(projectId: string, teamId: string): Q.Promise; - /** - * @param {string} projectId - * @param {number} top - * @param {number} skip - */ - getTeams(projectId: string, top?: number, skip?: number): Q.Promise; - /** - * Updates a team's name and/or description - * - * @param {CoreInterfaces.WebApiTeam} teamData - * @param {string} projectId - The name or id (GUID) of the team project containing the team to update. - * @param {string} teamId - The name of id of the team to update. - */ - updateTeam(teamData: CoreInterfaces.WebApiTeam, projectId: string, teamId: string): Q.Promise; - } - -} -declare module 'vso-node-api/interfaces/FileContainerInterfaces' { - export enum ContainerItemStatus { - /** - * Item is created. - */ - Created = 1, - /** - * Item is a file pending for upload. - */ - PendingUpload = 2, - } - export enum ContainerItemType { - /** - * Any item type. - */ - Any = 0, - /** - * Item is a folder which can have child items. - */ - Folder = 1, - /** - * Item is a file which is stored in the file service. - */ - File = 2, - } - export enum ContainerOptions { - /** - * No option. - */ - None = 0, - } - /** - * Represents a container that encapsulates a hierarchical file system. - */ - export interface FileContainer { - /** - * Uri of the artifact associated with the container. - */ - artifactUri: string; - /** - * Download Url for the content of this item. - */ - contentLocation: string; - /** - * Owner. - */ - createdBy: string; - /** - * Creation date. - */ - dateCreated: Date; - /** - * Description. - */ - description: string; - /** - * Id. - */ - id: number; - /** - * Location of the item resource. - */ - itemLocation: string; - /** - * Name. - */ - name: string; - /** - * Options the container can have. - */ - options: ContainerOptions; - /** - * Project Id. - */ - scopeIdentifier: string; - /** - * Security token of the artifact associated with the container. - */ - securityToken: string; - /** - * Identifier of the optional encryption key. - */ - signingKeyId: string; - /** - * Total size of the files in bytes. - */ - size: number; - } - /** - * Represents an item in a container. - */ - export interface FileContainerItem { - /** - * Container Id. - */ - containerId: number; - contentId: number[]; - /** - * Download Url for the content of this item. - */ - contentLocation: string; - /** - * Creator. - */ - createdBy: string; - /** - * Creation date. - */ - dateCreated: Date; - /** - * Last modified date. - */ - dateLastModified: Date; - /** - * Encoding of the file. Zero if not a file. - */ - fileEncoding: number; - /** - * Hash value of the file. Null if not a file. - */ - fileHash: number[]; - /** - * Length of the file. Zero if not of a file. - */ - fileLength: number; - /** - * Type of the file. Zero if not a file. - */ - fileType: number; - /** - * Location of the item resource. - */ - itemLocation: string; - /** - * Type of the item: Folder, File or String. - */ - itemType: ContainerItemType; - /** - * Modifier. - */ - lastModifiedBy: string; - /** - * Unique path that identifies the item. - */ - path: string; - /** - * Project Id. - */ - scopeIdentifier: string; - /** - * Status of the item: Created or Pending Upload. - */ - status: ContainerItemStatus; - ticket: string; - } - export var TypeInfo: { - ContainerItemStatus: { - enumValues: { - "created": number; - "pendingUpload": number; - }; - }; - ContainerItemType: { - enumValues: { - "any": number; - "folder": number; - "file": number; - }; - }; - ContainerOptions: { - enumValues: { - "none": number; - }; - }; - FileContainer: { - fields: any; - }; - FileContainerItem: { - fields: any; - }; - }; - -} -declare module 'vso-node-api/FileContainerApiBase' { - /// - /// - import Q = require('q'); - import basem = require('vso-node-api/ClientApiBases'); - import VsoBaseInterfaces = require('vso-node-api/interfaces/common/VsoBaseInterfaces'); - import FileContainerInterfaces = require('vso-node-api/interfaces/FileContainerInterfaces'); - import VSSInterfaces = require('vso-node-api/interfaces/common/VSSInterfaces'); - export interface IFileContainerApiBase extends basem.ClientApiBase { - createItems(items: VSSInterfaces.VssJsonCollectionWrapperV, containerId: number, scope: string, onResult: (err: any, statusCode: number, Container: FileContainerInterfaces.FileContainerItem[]) => void): void; - deleteItem(containerId: number, itemPath: string, scope: string, onResult: (err: any, statusCode: number) => void): void; - getContainers(scope: string, artifactUris: string, onResult: (err: any, statusCode: number, Containers: FileContainerInterfaces.FileContainer[]) => void): void; - getItems(containerId: number, scope: string, itemPath: string, metadata: boolean, format: string, downloadFileName: string, includeDownloadTickets: boolean, isShallow: boolean, onResult: (err: any, statusCode: number, Containers: FileContainerInterfaces.FileContainerItem[]) => void): void; - browseItems(container: number, itemPath: string, onResult: (err: any, statusCode: number, Containers: FileContainerInterfaces.FileContainerItem[]) => void): void; - } - export interface IQFileContainerApiBase extends basem.QClientApiBase { - createItems(items: VSSInterfaces.VssJsonCollectionWrapperV, containerId: number, scope?: string): Q.Promise; - deleteItem(containerId: number, itemPath: string, scope?: string): Q.Promise; - getContainers(scope?: string, artifactUris?: string): Q.Promise; - getItems(containerId: number, scope?: string, itemPath?: string, metadata?: boolean, format?: string, downloadFileName?: string, includeDownloadTickets?: boolean, isShallow?: boolean): Q.Promise; - browseItems(container: number, itemPath?: string): Q.Promise; - } - export class FileContainerApiBase extends basem.ClientApiBase implements IFileContainerApiBase { - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]); - /** - * Creates the specified items in in the referenced container. - * - * @param {VSSInterfaces.VssJsonCollectionWrapperV} items - * @param {number} containerId - * @param {string} scope - A guid representing the scope of the container. This is often the project id. - * @param onResult callback function with the resulting FileContainerInterfaces.FileContainerItem[] - */ - createItems(items: VSSInterfaces.VssJsonCollectionWrapperV, containerId: number, scope: string, onResult: (err: any, statusCode: number, Container: FileContainerInterfaces.FileContainerItem[]) => void): void; - /** - * Deletes the specified items in a container. - * - * @param {number} containerId - Container Id. - * @param {string} itemPath - Path to delete. - * @param {string} scope - A guid representing the scope of the container. This is often the project id. - * @param onResult callback function - */ - deleteItem(containerId: number, itemPath: string, scope: string, onResult: (err: any, statusCode: number) => void): void; - /** - * Gets containers filtered by a comma separated list of artifact uris within the same scope, if not specified returns all containers - * - * @param {string} scope - A guid representing the scope of the container. This is often the project id. - * @param {string} artifactUris - * @param onResult callback function with the resulting FileContainerInterfaces.FileContainer[] - */ - getContainers(scope: string, artifactUris: string, onResult: (err: any, statusCode: number, Containers: FileContainerInterfaces.FileContainer[]) => void): void; - /** - * @param {number} containerId - * @param {string} scope - * @param {string} itemPath - * @param {boolean} metadata - * @param {string} format - * @param {string} downloadFileName - * @param {boolean} includeDownloadTickets - * @param {boolean} isShallow - * @param onResult callback function with the resulting FileContainerInterfaces.FileContainerItem[] - */ - getItems(containerId: number, scope: string, itemPath: string, metadata: boolean, format: string, downloadFileName: string, includeDownloadTickets: boolean, isShallow: boolean, onResult: (err: any, statusCode: number, Containers: FileContainerInterfaces.FileContainerItem[]) => void): void; - /** - * Allow browsing of file ,the contentDisposition is inline and Content-Type is determined by FileExtension - * - * @param {number} container - * @param {string} itemPath - The path to the item of interest - * @param onResult callback function with the resulting FileContainerInterfaces.FileContainerItem[] - */ - browseItems(container: number, itemPath: string, onResult: (err: any, statusCode: number, Containers: FileContainerInterfaces.FileContainerItem[]) => void): void; - } - export class QFileContainerApiBase extends basem.QClientApiBase implements IQFileContainerApiBase { - api: FileContainerApiBase; - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[], api: typeof basem.ClientApiBase); - /** - * Creates the specified items in in the referenced container. - * - * @param {VSSInterfaces.VssJsonCollectionWrapperV} items - * @param {number} containerId - * @param {string} scope - A guid representing the scope of the container. This is often the project id. - */ - createItems(items: VSSInterfaces.VssJsonCollectionWrapperV, containerId: number, scope?: string): Q.Promise; - /** - * Deletes the specified items in a container. - * - * @param {number} containerId - Container Id. - * @param {string} itemPath - Path to delete. - * @param {string} scope - A guid representing the scope of the container. This is often the project id. - */ - deleteItem(containerId: number, itemPath: string, scope?: string): Q.Promise; - /** - * Gets containers filtered by a comma separated list of artifact uris within the same scope, if not specified returns all containers - * - * @param {string} scope - A guid representing the scope of the container. This is often the project id. - * @param {string} artifactUris - */ - getContainers(scope?: string, artifactUris?: string): Q.Promise; - /** - * @param {number} containerId - * @param {string} scope - * @param {string} itemPath - * @param {boolean} metadata - * @param {string} format - * @param {string} downloadFileName - * @param {boolean} includeDownloadTickets - * @param {boolean} isShallow - */ - getItems(containerId: number, scope?: string, itemPath?: string, metadata?: boolean, format?: string, downloadFileName?: string, includeDownloadTickets?: boolean, isShallow?: boolean): Q.Promise; - /** - * Allow browsing of file ,the contentDisposition is inline and Content-Type is determined by FileExtension - * - * @param {number} container - * @param {string} itemPath - The path to the item of interest - */ - browseItems(container: number, itemPath?: string): Q.Promise; - } - -} -declare module 'vso-node-api/FileContainerApi' { - /// - /// - import Q = require('q'); - import VsoBaseInterfaces = require('vso-node-api/interfaces/common/VsoBaseInterfaces'); - import FileContainerApiBase = require('vso-node-api/FileContainerApiBase'); - import FileContainerInterfaces = require('vso-node-api/interfaces/FileContainerInterfaces'); - export interface IFileContainerApi extends FileContainerApiBase.IFileContainerApiBase { - createItem(contentStream: NodeJS.ReadableStream, uncompressedLength: number, containerId: number, itemPath: string, scope: string, options: any, onResult: (err: any, statusCode: number, Container: FileContainerInterfaces.FileContainerItem) => void): void; - } - export interface IQFileContainerApi extends FileContainerApiBase.IQFileContainerApiBase { - createItem(contentStream: NodeJS.ReadableStream, uncompressedLength: number, containerId: number, itemPath: string, scope: string, options: any): Q.Promise; - } - export class FileContainerApi extends FileContainerApiBase.FileContainerApiBase implements IFileContainerApi { - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]); - createItem(contentStream: NodeJS.ReadableStream, uncompressedLength: number, containerId: number, itemPath: string, scope: string, options: any, onResult: (err: any, statusCode: number, Container: FileContainerInterfaces.FileContainerItem) => void): void; - _createItem(customHeaders: VsoBaseInterfaces.IHeaders, contentStream: NodeJS.ReadableStream, containerId: number, itemPath: string, scope: string, onResult: (err: any, statusCode: number, Container: FileContainerInterfaces.FileContainerItem) => void): void; - } - export class QFileContainerApi extends FileContainerApiBase.QFileContainerApiBase implements IQFileContainerApi { - api: FileContainerApi; - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]); - createItem(contentStream: NodeJS.ReadableStream, uncompressedLength: number, containerId: number, itemPath: string, scope: string, options: any): Q.Promise; - } - -} -declare module 'vso-node-api/interfaces/GalleryInterfaces' { - export enum AcquisitionAssignmentType { - None = 0, - /** - * Just assign for me - */ - Me = 1, - /** - * Assign for all users in the account - */ - All = 2, - } - export interface AcquisitionOperation { - /** - * State of the the AcquisitionOperation for the current user - */ - operationState: AcquisitionOperationState; - /** - * AcquisitionOperationType: install, request, buy, etc... - */ - operationType: AcquisitionOperationType; - /** - * Optional reason to justify current state. Typically used with Disallow state. - */ - reason: string; - } - export enum AcquisitionOperationState { - /** - * Not allowed to use this AcquisitionOperation - */ - Disallow = 0, - /** - * Allowed to use this AcquisitionOperation - */ - Allow = 1, - /** - * Operation has already been completed and is no longer available - */ - Completed = 3, - } - export enum AcquisitionOperationType { - /** - * Not yet used - */ - Get = 0, - /** - * Install this extension into the host provided - */ - Install = 1, - /** - * Buy licenses for this extension and install into the host provided - */ - Buy = 2, - /** - * Not yet used - */ - Try = 3, - /** - * Not yet used - */ - Request = 4, - /** - * No action found - */ - None = 5, - } - /** - * Market item acquisition options (install, buy, etc) for an installation target. - */ - export interface AcquisitionOptions { - /** - * Default Operation for the ItemId in this target - */ - defaultOperation: AcquisitionOperation; - /** - * The item id that this options refer to - */ - itemId: string; - /** - * Operations allowed for the ItemId in this target - */ - operations: AcquisitionOperation[]; - /** - * The target that this options refer to - */ - target: string; - } - export enum ConcernCategory { - General = 1, - Abusive = 2, - Spam = 4, - } - /** - * Contract for handling the extension acquisition process - */ - export interface ExtensionAcquisitionRequest { - /** - * How the item is being assigned - */ - assignmentType: AcquisitionAssignmentType; - /** - * The id of the subscription used for purchase - */ - billingId: string; - /** - * The marketplace id (publisherName.extensionName) for the item - */ - itemId: string; - /** - * The type of operation, such as install, request, purchase - */ - operationType: AcquisitionOperationType; - /** - * Additional properties which can be added to the request. - */ - properties: any; - /** - * How many licenses should be purchased - */ - quantity: number; - /** - * A list of target guids where the item should be acquired (installed, requested, etc.), such as account id - */ - targets: string[]; - } - export interface ExtensionFile { - assetType: string; - contentType: string; - fileId: number; - isDefault: boolean; - isPublic: boolean; - language: string; - shortDescription: string; - source: string; - version: string; - } - /** - * The FilterResult is the set of extensions that matched a particular query filter. - */ - export interface ExtensionFilterResult { - /** - * This is the set of appplications that matched the query filter supplied. - */ - extensions: PublishedExtension[]; - /** - * The PagingToken is returned from a request when more records exist that match the result than were requested or could be returned. A follow-up query with this paging token can be used to retrieve more results. - */ - pagingToken: string; - /** - * This is the additional optional metadata for the given result. E.g. Total count of results which is useful in case of paged results - */ - resultMetadata: ExtensionFilterResultMetadata[]; - } - /** - * ExtensionFilterResultMetadata is one set of metadata for the result e.g. Total count. There can be multiple metadata items for one metadata. - */ - export interface ExtensionFilterResultMetadata { - /** - * The metadata items for the category - */ - metadataItems: MetadataItem[]; - /** - * Defines the category of metadata items - */ - metadataType: string; - } - /** - * Represents the component pieces of an extensions fully qualified name, along with the fully qualified name. - */ - export interface ExtensionIdentifier { - /** - * The ExtensionName component part of the fully qualified ExtensionIdentifier - */ - extensionName: string; - /** - * The PublisherName component part of the fully qualified ExtensionIdentifier - */ - publisherName: string; - } - /** - * Package that will be used to create or update a published extension - */ - export interface ExtensionPackage { - /** - * Base 64 encoded extension package - */ - extensionManifest: string; - } - /** - * Policy with a set of permissions on extension operations - */ - export interface ExtensionPolicy { - /** - * Permissions on 'Install' operation - */ - install: ExtensionPolicyFlags; - /** - * Permission on 'Request' operation - */ - request: ExtensionPolicyFlags; - } - export enum ExtensionPolicyFlags { - /** - * No permission - */ - None = 0, - /** - * Permission on private extensions - */ - Private = 1, - /** - * Permission on public extensions - */ - Public = 2, - /** - * Premission in extensions that are in preview - */ - Preview = 4, - /** - * Premission in relased extensions - */ - Released = 8, - /** - * Permission in 1st party extensions - */ - FirstParty = 16, - /** - * Mask that defines all permissions - */ - All = 31, - } - /** - * An ExtensionQuery is used to search the gallery for a set of extensions that match one of many filter values. - */ - export interface ExtensionQuery { - /** - * When retrieving extensions with a query; frequently the caller only needs a small subset of the assets. The caller may specify a list of asset types that should be returned if the extension contains it. All other assets will not be returned. - */ - assetTypes: string[]; - /** - * Each filter is a unique query and will have matching set of extensions returned from the request. Each result will have the same index in the resulting array that the filter had in the incoming query. - */ - filters: QueryFilter[]; - /** - * The Flags are used to deterine which set of information the caller would like returned for the matched extensions. - */ - flags: ExtensionQueryFlags; - } - export enum ExtensionQueryFilterType { - /** - * The values are used as tags. All tags are treated as "OR" conditions with each other. There may be some value put on the number of matched tags from the query. - */ - Tag = 1, - /** - * The Values are an ExtensionName or fragment that is used to match other extension names. - */ - DisplayName = 2, - /** - * The Filter is one or more tokens that define what scope to return private extensions for. - */ - Private = 3, - /** - * Retrieve a set of extensions based on their id's. The values should be the extension id's encoded as strings. - */ - Id = 4, - /** - * The catgeory is unlike other filters. It is AND'd with the other filters instead of being a seperate query. - */ - Category = 5, - /** - * Certain contribution types may be indexed to allow for query by type. User defined types can't be indexed at the moment. - */ - ContributionType = 6, - /** - * Retrieve an set extension based on the name based identifier. This differs from the internal id (which is being deprecated). - */ - Name = 7, - /** - * The InstallationTarget for an extension defines the target consumer for the extension. This may be something like VS, VSOnline, or VSCode - */ - InstallationTarget = 8, - /** - * Query for featured extensions, no value is allowed when using the query type. - */ - Featured = 9, - /** - * The SearchText provided by the user to search for extensions - */ - SearchText = 10, - } - export enum ExtensionQueryFlags { - /** - * None is used to retrieve only the basic extension details. - */ - None = 0, - /** - * IncludeVersions will return version information for extensions returned - */ - IncludeVersions = 1, - /** - * IncludeFiles will return information about which files were found within the extension that were stored independant of the manifest. When asking for files, versions will be included as well since files are returned as a property of the versions. These files can be retrieved using the path to the file without requiring the entire manifest be downloaded. - */ - IncludeFiles = 2, - /** - * Include the Categories and Tags that were added to the extension definition. - */ - IncludeCategoryAndTags = 4, - /** - * Include the details about which accounts the extension has been shared with if the extesion is a private extension. - */ - IncludeSharedAccounts = 8, - /** - * Include properties associated with versions of the extension - */ - IncludeVersionProperties = 16, - /** - * Excluding non-validated extensions will remove any extension versions that either are in the process of being validated or have failed validation. - */ - ExcludeNonValidated = 32, - /** - * Include the set of installation targets the extension has requested. - */ - IncludeInstallationTargets = 64, - /** - * Include the base uri for assets of this extension - */ - IncludeAssetUri = 128, - /** - * Include the statistics associated with this extension - */ - IncludeStatistics = 256, - /** - * When retrieving versions from a query, only include the latest version of the extensions that matched. This is useful when the caller doesn't need all the published versions. It will save a significant size in the returned payload. - */ - IncludeLatestVersionOnly = 512, - /** - * AllAttributes is designed to be a mask that defines all sub-elements of the extension should be returned. NOTE: This is not actually All flags. This is now locked to the set defined since changing this enum would be a breaking change and would change the behavior of anyone using it. Try not to use this value when making calls to the service, instead be explicit about the options required. - */ - AllAttributes = 479, - } - /** - * This is the set of extensions that matched a supplied query through the filters given. - */ - export interface ExtensionQueryResult { - /** - * For each filter supplied in the query, a filter result will be returned in the query result. - */ - results: ExtensionFilterResult[]; - } - export interface ExtensionShare { - id: string; - name: string; - type: string; - } - export interface ExtensionStatistic { - statisticName: string; - value: number; - } - export enum ExtensionStatisticOperation { - None = 0, - Set = 1, - Increment = 2, - Decrement = 3, - } - export interface ExtensionVersion { - assetUri: string; - files: ExtensionFile[]; - flags: ExtensionVersionFlags; - lastUpdated: Date; - properties: { - key: string; - value: string; - }[]; - validationResultMessage: string; - version: string; - versionDescription: string; - } - export enum ExtensionVersionFlags { - /** - * No flags exist for this version. - */ - None = 0, - /** - * The Validated flag for a version means the extension version has passed validation and can be used.. - */ - Validated = 1, - } - /** - * One condition in a QueryFilter. - */ - export interface FilterCriteria { - filterType: number; - /** - * The value used in the match based on the filter type. - */ - value: string; - } - export interface InstallationTarget { - target: string; - } - /** - * MetadataItem is one value of metadata under a given category of metadata - */ - export interface MetadataItem { - /** - * The count of the metadata item - */ - count: number; - /** - * The name of the metadata item - */ - name: string; - } - export enum PagingDirection { - /** - * Backward will return results from earlier in the resultset. - */ - Backward = 1, - /** - * Forward will return results from later in the resultset. - */ - Forward = 2, - } - export interface PublishedExtension { - categories: string[]; - displayName: string; - extensionId: string; - extensionName: string; - flags: PublishedExtensionFlags; - installationTargets: InstallationTarget[]; - lastUpdated: Date; - longDescription: string; - publisher: PublisherFacts; - sharedWith: ExtensionShare[]; - shortDescription: string; - statistics: ExtensionStatistic[]; - tags: string[]; - versions: ExtensionVersion[]; - } - export enum PublishedExtensionFlags { - /** - * No flags exist for this extension. - */ - None = 0, - /** - * The Disabled flag for an extension means the extension can't be changed and won't be used by consumers. The disabled flag is managed by the service and can't be supplied by the Extension Developers. - */ - Disabled = 1, - /** - * BuiltIn Extension are available to all Tenants. An explicit registration is not required. This attribute is reserved and can't be supplied by Extension Developers. BuiltIn extensions are by definition Public. There is no need to set the public flag for extensions marked BuiltIn. - */ - BuiltIn = 2, - /** - * This extension has been validated by the service. The extension meets the requirements specified. This attribute is reserved and can't be supplied by the Extension Developers. Validation is a process that ensures that all contributions are well formed. They meet the requirements defined by the contribution type they are extending. Note this attribute will be updated asynchronously as the extension is validated by the developer of the contribution type. There will be restricted access to the extension while this process is performed. - */ - Validated = 4, - /** - * Trusted extensions are ones that are given special capabilities. These tend to come from Microsoft and can't be published by the general public. Note: BuiltIn extensions are always trusted. - */ - Trusted = 8, - /** - * This extension registration is public, making its visibilty open to the public. This means all tenants have the ability to install this extension. Without this flag the extension will be private and will need to be shared with the tenants that can install it. - */ - Public = 256, - /** - * This extension has multiple versions active at one time and version discovery should be done usig the defined "Version Discovery" protocol to determine the version available to a specific user or tenant. @TODO: Link to Version Discovery Protocol. - */ - MultiVersion = 512, - /** - * The system flag is reserved, and cant be used by publishers. - */ - System = 1024, - /** - * The Preview flag indicates that the extension is still under preview (not yet of "release" quality). These extensions may be decorated differently in the gallery and may have different policies applied to them. - */ - Preview = 2048, - } - export interface Publisher { - displayName: string; - extensions: PublishedExtension[]; - flags: PublisherFlags; - lastUpdated: Date; - longDescription: string; - publisherId: string; - publisherName: string; - shortDescription: string; - } - /** - * High-level information about the publisher, like id's and names - */ - export interface PublisherFacts { - displayName: string; - flags: PublisherFlags; - publisherId: string; - publisherName: string; - } - /** - * The FilterResult is the set of publishers that matched a particular query filter. - */ - export interface PublisherFilterResult { - /** - * This is the set of appplications that matched the query filter supplied. - */ - publishers: Publisher[]; - } - export enum PublisherFlags { - /** - * This should never be returned, it is used to represent a publisher who's flags havent changed during update calls. - */ - UnChanged = 1073741824, - /** - * No flags exist for this publisher. - */ - None = 0, - /** - * The Disabled flag for a publisher means the publisher can't be changed and won't be used by consumers, this extends to extensions owned by the publisher as well. The disabled flag is managed by the service and can't be supplied by the Extension Developers. - */ - Disabled = 1, - /** - * A verified publisher is one that Microsoft has done some review of and ensured the publisher meets a set of requirements. The requirements to become a verified publisher are not listed here. They can be found in public documentation (TBD). - */ - Verified = 2, - /** - * This is the set of flags that can't be supplied by the developer and is managed by the service itself. - */ - ServiceFlags = 3, - } - export enum PublisherPermissions { - /** - * This gives the bearer the rights to read Publishers and Extensions. - */ - Read = 1, - /** - * This gives the bearer the rights to update, delete, and share Extensions (but not the ability to create them). - */ - UpdateExtension = 2, - /** - * This gives the bearer the rights to create new Publishers at the root of the namespace. - */ - CreatePublisher = 4, - /** - * This gives the bearer the rights to create new Extensions within a publisher. - */ - PublishExtension = 8, - /** - * Admin gives the bearer the rights to manage restricted attributes of Publishers and Extensions. - */ - Admin = 16, - /** - * TrustedPartner gives the bearer the rights to publish a extensions with restricted capabilities. - */ - TrustedPartner = 32, - /** - * PrivateRead is another form of read designed to allow higher privilege accessors the ability to read private extensions. - */ - PrivateRead = 64, - /** - * This gives the bearer the rights to delete any extension. - */ - DeleteExtension = 128, - /** - * This gives the bearer the rights edit the publisher settings. - */ - EditSettings = 256, - /** - * This gives the bearer the rights to see all permissions on the publisher. - */ - ViewPermissions = 512, - /** - * This gives the bearer the rights to assign permissions on the publisher. - */ - ManagePermissions = 1024, - /** - * This gives the bearer the rights to delete the publisher. - */ - DeletePublisher = 2048, - } - /** - * An PublisherQuery is used to search the gallery for a set of publishers that match one of many filter values. - */ - export interface PublisherQuery { - /** - * Each filter is a unique query and will have matching set of publishers returned from the request. Each result will have the same index in the resulting array that the filter had in the incoming query. - */ - filters: QueryFilter[]; - /** - * The Flags are used to deterine which set of information the caller would like returned for the matched publishers. - */ - flags: PublisherQueryFlags; - } - export enum PublisherQueryFilterType { - /** - * The values are used as tags. All tags are treated as "OR" conditions with each other. There may be some value put on the number of matched tags from the query. - */ - Tag = 1, - /** - * The Values are an PublisherName or fragment that is used to match other extension names. - */ - DisplayName = 2, - /** - * The My Query filter is used to retrieve the set of publishers that I have access to publish extesions into. All Values are ignored and the calling user is used as the filter in this case. - */ - My = 3, - } - export enum PublisherQueryFlags { - /** - * None is used to retrieve only the basic publisher details. - */ - None = 0, - /** - * Is used to include a list of basic extension details for all extensions published by the requested publisher. - */ - IncludeExtensions = 1, - } - /** - * This is the set of publishers that matched a supplied query through the filters given. - */ - export interface PublisherQueryResult { - /** - * For each filter supplied in the query, a filter result will be returned in the query result. - */ - results: PublisherFilterResult[]; - } - /** - * A filter used to define a set of extensions to return during a query. - */ - export interface QueryFilter { - /** - * The filter values define the set of values in this query. They are applied based on the QueryFilterType. - */ - criteria: FilterCriteria[]; - /** - * The PagingDirection is applied to a paging token if one exists. If not the direction is ignored, and Forward from the start of the resultset is used. Direction should be left out of the request unless a paging token is used to help prevent future issues. - */ - direction: PagingDirection; - /** - * The page number requested by the user. If not provided 1 is assumed by default. - */ - pageNumber: number; - /** - * The page size defines the number of results the caller wants for this filter. The count can't exceed the overall query size limits. - */ - pageSize: number; - /** - * The paging token is a distinct type of filter and the other filter fields are ignored. The paging token represents the continuation of a previously executed query. The information about where in the result and what fields are being filtered are embeded in the token. - */ - pagingToken: string; - /** - * Defines the type of sorting to be applied on the results. The page slice is cut of the sorted results only. - */ - sortBy: number; - /** - * Defines the order of sorting, 1 for Ascending, 2 for Descending, else default ordering based on the SortBy value - */ - sortOrder: number; - } - export interface Review { - /** - * Unique identifier of a review item - */ - id: number; - /** - * Flag for soft deletion - */ - isDeleted: boolean; - /** - * Version of the product for which review was submitted - */ - productVersion: string; - /** - * Rating procided by the user - */ - rating: number; - /** - * Text description of the review - */ - text: string; - /** - * Title of the review - */ - title: string; - /** - * Time when the review was edited/updated - */ - updatedDate: Date; - /** - * Id of the user who submitted the review - */ - userId: string; - } - export interface ReviewsResult { - /** - * Flag indicating if there are more reviews to be shown (for paging) - */ - hasMoreReviews: boolean; - /** - * List of reviews - */ - reviews: Review[]; - /** - * Count of total review items - */ - totalReviewCount: number; - } - export enum SigningKeyPermissions { - Read = 1, - Write = 2, - } - export enum SortByType { - /** - * The results will be sorted by relevance in case search query is given, if no search query resutls will be provided as is - */ - Relevance = 0, - /** - * The results will be sorted as per Last Updated date of the extensions with recently updated at the top - */ - LastUpdatedDate = 1, - /** - * Results will be sorted Alphabetically as per the title of the extension - */ - Title = 2, - /** - * Results will be sorted Alphabetically as per Publisher title - */ - Publisher = 3, - /** - * Results will be sorted by Install Count - */ - InstallCount = 4, - } - export enum SortOrderType { - /** - * Results will be sorted in the default order as per the sorting type defined. The default varies for each type, e.g. for Relevance, default is Descnding, for Title default is Ascending etc. - */ - Default = 0, - /** - * The results will be sorted in Ascending order - */ - Ascending = 1, - /** - * The results will be sorted in Descending order - */ - Descending = 2, - } - /** - * Represents the extension policy applied to a given user - */ - export interface UserExtensionPolicy { - /** - * User display name that this policy refers to - */ - displayName: string; - /** - * The extension policy applied to the user - */ - permissions: ExtensionPolicy; - /** - * User id that this policy refers to - */ - userId: string; - } - export interface UserReportedConcern { - /** - * Category of the concern - */ - category: ConcernCategory; - /** - * User comment associated with the report - */ - concernText: string; - /** - * Id of the review which was reported - */ - reviewId: number; - /** - * Date the report was submitted - */ - submittedDate: Date; - /** - * Id of the user who reported a review - */ - userId: string; - } - export var TypeInfo: { - AcquisitionAssignmentType: { - enumValues: { - "none": number; - "me": number; - "all": number; - }; - }; - AcquisitionOperation: { - fields: any; - }; - AcquisitionOperationState: { - enumValues: { - "disallow": number; - "allow": number; - "completed": number; - }; - }; - AcquisitionOperationType: { - enumValues: { - "get": number; - "install": number; - "buy": number; - "try": number; - "request": number; - "none": number; - }; - }; - AcquisitionOptions: { - fields: any; - }; - ConcernCategory: { - enumValues: { - "general": number; - "abusive": number; - "spam": number; - }; - }; - ExtensionAcquisitionRequest: { - fields: any; - }; - ExtensionFile: { - fields: any; - }; - ExtensionFilterResult: { - fields: any; - }; - ExtensionFilterResultMetadata: { - fields: any; - }; - ExtensionIdentifier: { - fields: any; - }; - ExtensionPackage: { - fields: any; - }; - ExtensionPolicy: { - fields: any; - }; - ExtensionPolicyFlags: { - enumValues: { - "none": number; - "private": number; - "public": number; - "preview": number; - "released": number; - "firstParty": number; - "all": number; - }; - }; - ExtensionQuery: { - fields: any; - }; - ExtensionQueryFilterType: { - enumValues: { - "tag": number; - "displayName": number; - "private": number; - "id": number; - "category": number; - "contributionType": number; - "name": number; - "installationTarget": number; - "featured": number; - "searchText": number; - }; - }; - ExtensionQueryFlags: { - enumValues: { - "none": number; - "includeVersions": number; - "includeFiles": number; - "includeCategoryAndTags": number; - "includeSharedAccounts": number; - "includeVersionProperties": number; - "excludeNonValidated": number; - "includeInstallationTargets": number; - "includeAssetUri": number; - "includeStatistics": number; - "includeLatestVersionOnly": number; - "allAttributes": number; - }; - }; - ExtensionQueryResult: { - fields: any; - }; - ExtensionShare: { - fields: any; - }; - ExtensionStatistic: { - fields: any; - }; - ExtensionStatisticOperation: { - enumValues: { - "none": number; - "set": number; - "increment": number; - "decrement": number; - }; - }; - ExtensionVersion: { - fields: any; - }; - ExtensionVersionFlags: { - enumValues: { - "none": number; - "validated": number; - }; - }; - FilterCriteria: { - fields: any; - }; - InstallationTarget: { - fields: any; - }; - MetadataItem: { - fields: any; - }; - PagingDirection: { - enumValues: { - "backward": number; - "forward": number; - }; - }; - PublishedExtension: { - fields: any; - }; - PublishedExtensionFlags: { - enumValues: { - "none": number; - "disabled": number; - "builtIn": number; - "validated": number; - "trusted": number; - "public": number; - "multiVersion": number; - "system": number; - "preview": number; - }; - }; - Publisher: { - fields: any; - }; - PublisherFacts: { - fields: any; - }; - PublisherFilterResult: { - fields: any; - }; - PublisherFlags: { - enumValues: { - "unChanged": number; - "none": number; - "disabled": number; - "verified": number; - "serviceFlags": number; - }; - }; - PublisherPermissions: { - enumValues: { - "read": number; - "updateExtension": number; - "createPublisher": number; - "publishExtension": number; - "admin": number; - "trustedPartner": number; - "privateRead": number; - "deleteExtension": number; - "editSettings": number; - "viewPermissions": number; - "managePermissions": number; - "deletePublisher": number; - }; - }; - PublisherQuery: { - fields: any; - }; - PublisherQueryFilterType: { - enumValues: { - "tag": number; - "displayName": number; - "my": number; - }; - }; - PublisherQueryFlags: { - enumValues: { - "none": number; - "includeExtensions": number; - }; - }; - PublisherQueryResult: { - fields: any; - }; - QueryFilter: { - fields: any; - }; - Review: { - fields: any; - }; - ReviewsResult: { - fields: any; - }; - SigningKeyPermissions: { - enumValues: { - "read": number; - "write": number; - }; - }; - SortByType: { - enumValues: { - "relevance": number; - "lastUpdatedDate": number; - "title": number; - "publisher": number; - "installCount": number; - }; - }; - SortOrderType: { - enumValues: { - "default": number; - "ascending": number; - "descending": number; - }; - }; - UserExtensionPolicy: { - fields: any; - }; - UserReportedConcern: { - fields: any; - }; - }; - -} -declare module 'vso-node-api/GalleryApi' { - /// - /// - import Q = require('q'); - import basem = require('vso-node-api/ClientApiBases'); - import VsoBaseInterfaces = require('vso-node-api/interfaces/common/VsoBaseInterfaces'); - import GalleryInterfaces = require('vso-node-api/interfaces/GalleryInterfaces'); - export interface IGalleryApi extends basem.ClientApiBase { - shareExtensionById(extensionId: string, accountName: string, onResult: (err: any, statusCode: number) => void): void; - unshareExtensionById(extensionId: string, accountName: string, onResult: (err: any, statusCode: number) => void): void; - shareExtension(publisherName: string, extensionName: string, accountName: string, onResult: (err: any, statusCode: number) => void): void; - unshareExtension(publisherName: string, extensionName: string, accountName: string, onResult: (err: any, statusCode: number) => void): void; - getAcquisitionOptions(itemId: string, installationTarget: string, onResult: (err: any, statusCode: number, acquisitionoption: GalleryInterfaces.AcquisitionOptions) => void): void; - requestAcquisition(acquisitionRequest: GalleryInterfaces.ExtensionAcquisitionRequest, onResult: (err: any, statusCode: number, acquisitionrequest: GalleryInterfaces.ExtensionAcquisitionRequest) => void): void; - getAssetByName(publisherName: string, extensionName: string, version: string, assetType: string, accountToken: string, acceptDefault: boolean, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getAsset(extensionId: string, version: string, assetType: string, accountToken: string, acceptDefault: boolean, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getCategories(languages: string, onResult: (err: any, statusCode: number, categories: string[]) => void): void; - getCertificate(publisherName: string, extensionName: string, version: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - queryExtensions(extensionQuery: GalleryInterfaces.ExtensionQuery, accountToken: string, onResult: (err: any, statusCode: number, extensionquery: GalleryInterfaces.ExtensionQueryResult) => void): void; - createExtension(extensionPackage: GalleryInterfaces.ExtensionPackage, onResult: (err: any, statusCode: number, extension: GalleryInterfaces.PublishedExtension) => void): void; - deleteExtensionById(extensionId: string, version: string, onResult: (err: any, statusCode: number) => void): void; - getExtensionById(extensionId: string, version: string, flags: GalleryInterfaces.ExtensionQueryFlags, onResult: (err: any, statusCode: number, extension: GalleryInterfaces.PublishedExtension) => void): void; - updateExtensionById(extensionPackage: GalleryInterfaces.ExtensionPackage, extensionId: string, onResult: (err: any, statusCode: number, extension: GalleryInterfaces.PublishedExtension) => void): void; - createExtensionWithPublisher(extensionPackage: GalleryInterfaces.ExtensionPackage, publisherName: string, onResult: (err: any, statusCode: number, extension: GalleryInterfaces.PublishedExtension) => void): void; - deleteExtension(publisherName: string, extensionName: string, version: string, onResult: (err: any, statusCode: number) => void): void; - getExtension(publisherName: string, extensionName: string, version: string, flags: GalleryInterfaces.ExtensionQueryFlags, accountToken: string, onResult: (err: any, statusCode: number, extension: GalleryInterfaces.PublishedExtension) => void): void; - updateExtension(extensionPackage: GalleryInterfaces.ExtensionPackage, publisherName: string, extensionName: string, onResult: (err: any, statusCode: number, extension: GalleryInterfaces.PublishedExtension) => void): void; - getPackage(publisherName: string, extensionName: string, version: string, accountToken: string, acceptDefault: boolean, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getAssetWithToken(publisherName: string, extensionName: string, version: string, assetType: string, assetToken: string, accountToken: string, acceptDefault: boolean, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - queryPublishers(publisherQuery: GalleryInterfaces.PublisherQuery, onResult: (err: any, statusCode: number, publisherquery: GalleryInterfaces.PublisherQueryResult) => void): void; - createPublisher(publisher: GalleryInterfaces.Publisher, onResult: (err: any, statusCode: number, publisher: GalleryInterfaces.Publisher) => void): void; - deletePublisher(publisherName: string, onResult: (err: any, statusCode: number) => void): void; - getPublisher(publisherName: string, flags: number, onResult: (err: any, statusCode: number, publisher: GalleryInterfaces.Publisher) => void): void; - updatePublisher(publisher: GalleryInterfaces.Publisher, publisherName: string, onResult: (err: any, statusCode: number, publisher: GalleryInterfaces.Publisher) => void): void; - createReview(review: GalleryInterfaces.Review, extensionId: string, onResult: (err: any, statusCode: number, review: GalleryInterfaces.Review) => void): void; - getReviews(extensionId: string, onResult: (err: any, statusCode: number, review: GalleryInterfaces.ReviewsResult) => void): void; - generateKey(keyType: string, expireCurrentSeconds: number, onResult: (err: any, statusCode: number) => void): void; - getSigningKey(keyType: string, onResult: (err: any, statusCode: number, signingkey: string) => void): void; - } - export interface IQGalleryApi extends basem.QClientApiBase { - shareExtensionById(extensionId: string, accountName: string): Q.Promise; - unshareExtensionById(extensionId: string, accountName: string): Q.Promise; - shareExtension(publisherName: string, extensionName: string, accountName: string): Q.Promise; - unshareExtension(publisherName: string, extensionName: string, accountName: string): Q.Promise; - getAcquisitionOptions(itemId: string, installationTarget: string): Q.Promise; - requestAcquisition(acquisitionRequest: GalleryInterfaces.ExtensionAcquisitionRequest): Q.Promise; - getAssetByName(publisherName: string, extensionName: string, version: string, assetType: string, accountToken?: string, acceptDefault?: boolean): Q.Promise; - getAsset(extensionId: string, version: string, assetType: string, accountToken?: string, acceptDefault?: boolean): Q.Promise; - getCategories(languages?: string): Q.Promise; - getCertificate(publisherName: string, extensionName: string, version?: string): Q.Promise; - queryExtensions(extensionQuery: GalleryInterfaces.ExtensionQuery, accountToken?: string): Q.Promise; - createExtension(extensionPackage: GalleryInterfaces.ExtensionPackage): Q.Promise; - deleteExtensionById(extensionId: string, version?: string): Q.Promise; - getExtensionById(extensionId: string, version?: string, flags?: GalleryInterfaces.ExtensionQueryFlags): Q.Promise; - updateExtensionById(extensionPackage: GalleryInterfaces.ExtensionPackage, extensionId: string): Q.Promise; - createExtensionWithPublisher(extensionPackage: GalleryInterfaces.ExtensionPackage, publisherName: string): Q.Promise; - deleteExtension(publisherName: string, extensionName: string, version?: string): Q.Promise; - getExtension(publisherName: string, extensionName: string, version?: string, flags?: GalleryInterfaces.ExtensionQueryFlags, accountToken?: string): Q.Promise; - updateExtension(extensionPackage: GalleryInterfaces.ExtensionPackage, publisherName: string, extensionName: string): Q.Promise; - getPackage(publisherName: string, extensionName: string, version: string, accountToken?: string, acceptDefault?: boolean): Q.Promise; - getAssetWithToken(publisherName: string, extensionName: string, version: string, assetType: string, assetToken?: string, accountToken?: string, acceptDefault?: boolean): Q.Promise; - queryPublishers(publisherQuery: GalleryInterfaces.PublisherQuery): Q.Promise; - createPublisher(publisher: GalleryInterfaces.Publisher): Q.Promise; - deletePublisher(publisherName: string): Q.Promise; - getPublisher(publisherName: string, flags?: number): Q.Promise; - updatePublisher(publisher: GalleryInterfaces.Publisher, publisherName: string): Q.Promise; - createReview(review: GalleryInterfaces.Review, extensionId: string): Q.Promise; - getReviews(extensionId: string): Q.Promise; - generateKey(keyType: string, expireCurrentSeconds?: number): Q.Promise; - getSigningKey(keyType: string): Q.Promise; - } - export class GalleryApi extends basem.ClientApiBase implements IGalleryApi { - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]); - /** - * @param {string} extensionId - * @param {string} accountName - * @param onResult callback function - */ - shareExtensionById(extensionId: string, accountName: string, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} extensionId - * @param {string} accountName - * @param onResult callback function - */ - unshareExtensionById(extensionId: string, accountName: string, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} publisherName - * @param {string} extensionName - * @param {string} accountName - * @param onResult callback function - */ - shareExtension(publisherName: string, extensionName: string, accountName: string, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} publisherName - * @param {string} extensionName - * @param {string} accountName - * @param onResult callback function - */ - unshareExtension(publisherName: string, extensionName: string, accountName: string, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} itemId - * @param {string} installationTarget - * @param onResult callback function with the resulting GalleryInterfaces.AcquisitionOptions - */ - getAcquisitionOptions(itemId: string, installationTarget: string, onResult: (err: any, statusCode: number, acquisitionoption: GalleryInterfaces.AcquisitionOptions) => void): void; - /** - * @param {GalleryInterfaces.ExtensionAcquisitionRequest} acquisitionRequest - * @param onResult callback function with the resulting GalleryInterfaces.ExtensionAcquisitionRequest - */ - requestAcquisition(acquisitionRequest: GalleryInterfaces.ExtensionAcquisitionRequest, onResult: (err: any, statusCode: number, acquisitionrequest: GalleryInterfaces.ExtensionAcquisitionRequest) => void): void; - /** - * @param {string} publisherName - * @param {string} extensionName - * @param {string} version - * @param {string} assetType - * @param {string} accountToken - * @param {boolean} acceptDefault - * @param onResult callback function with the resulting ArrayBuffer - */ - getAssetByName(publisherName: string, extensionName: string, version: string, assetType: string, accountToken: string, acceptDefault: boolean, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * @param {string} extensionId - * @param {string} version - * @param {string} assetType - * @param {string} accountToken - * @param {boolean} acceptDefault - * @param onResult callback function with the resulting ArrayBuffer - */ - getAsset(extensionId: string, version: string, assetType: string, accountToken: string, acceptDefault: boolean, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * @param {string} languages - * @param onResult callback function with the resulting string[] - */ - getCategories(languages: string, onResult: (err: any, statusCode: number, categories: string[]) => void): void; - /** - * @param {string} publisherName - * @param {string} extensionName - * @param {string} version - * @param onResult callback function with the resulting ArrayBuffer - */ - getCertificate(publisherName: string, extensionName: string, version: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * @param {GalleryInterfaces.ExtensionQuery} extensionQuery - * @param {string} accountToken - * @param onResult callback function with the resulting GalleryInterfaces.ExtensionQueryResult - */ - queryExtensions(extensionQuery: GalleryInterfaces.ExtensionQuery, accountToken: string, onResult: (err: any, statusCode: number, extensionquery: GalleryInterfaces.ExtensionQueryResult) => void): void; - /** - * @param {GalleryInterfaces.ExtensionPackage} extensionPackage - * @param onResult callback function with the resulting GalleryInterfaces.PublishedExtension - */ - createExtension(extensionPackage: GalleryInterfaces.ExtensionPackage, onResult: (err: any, statusCode: number, extension: GalleryInterfaces.PublishedExtension) => void): void; - /** - * @param {string} extensionId - * @param {string} version - * @param onResult callback function - */ - deleteExtensionById(extensionId: string, version: string, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} extensionId - * @param {string} version - * @param {GalleryInterfaces.ExtensionQueryFlags} flags - * @param onResult callback function with the resulting GalleryInterfaces.PublishedExtension - */ - getExtensionById(extensionId: string, version: string, flags: GalleryInterfaces.ExtensionQueryFlags, onResult: (err: any, statusCode: number, extension: GalleryInterfaces.PublishedExtension) => void): void; - /** - * @param {GalleryInterfaces.ExtensionPackage} extensionPackage - * @param {string} extensionId - * @param onResult callback function with the resulting GalleryInterfaces.PublishedExtension - */ - updateExtensionById(extensionPackage: GalleryInterfaces.ExtensionPackage, extensionId: string, onResult: (err: any, statusCode: number, extension: GalleryInterfaces.PublishedExtension) => void): void; - /** - * @param {GalleryInterfaces.ExtensionPackage} extensionPackage - * @param {string} publisherName - * @param onResult callback function with the resulting GalleryInterfaces.PublishedExtension - */ - createExtensionWithPublisher(extensionPackage: GalleryInterfaces.ExtensionPackage, publisherName: string, onResult: (err: any, statusCode: number, extension: GalleryInterfaces.PublishedExtension) => void): void; - /** - * @param {string} publisherName - * @param {string} extensionName - * @param {string} version - * @param onResult callback function - */ - deleteExtension(publisherName: string, extensionName: string, version: string, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} publisherName - * @param {string} extensionName - * @param {string} version - * @param {GalleryInterfaces.ExtensionQueryFlags} flags - * @param {string} accountToken - * @param onResult callback function with the resulting GalleryInterfaces.PublishedExtension - */ - getExtension(publisherName: string, extensionName: string, version: string, flags: GalleryInterfaces.ExtensionQueryFlags, accountToken: string, onResult: (err: any, statusCode: number, extension: GalleryInterfaces.PublishedExtension) => void): void; - /** - * @param {GalleryInterfaces.ExtensionPackage} extensionPackage - * @param {string} publisherName - * @param {string} extensionName - * @param onResult callback function with the resulting GalleryInterfaces.PublishedExtension - */ - updateExtension(extensionPackage: GalleryInterfaces.ExtensionPackage, publisherName: string, extensionName: string, onResult: (err: any, statusCode: number, extension: GalleryInterfaces.PublishedExtension) => void): void; - /** - * @param {string} publisherName - * @param {string} extensionName - * @param {string} version - * @param {string} accountToken - * @param {boolean} acceptDefault - * @param onResult callback function with the resulting ArrayBuffer - */ - getPackage(publisherName: string, extensionName: string, version: string, accountToken: string, acceptDefault: boolean, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * @param {string} publisherName - * @param {string} extensionName - * @param {string} version - * @param {string} assetType - * @param {string} assetToken - * @param {string} accountToken - * @param {boolean} acceptDefault - * @param onResult callback function with the resulting ArrayBuffer - */ - getAssetWithToken(publisherName: string, extensionName: string, version: string, assetType: string, assetToken: string, accountToken: string, acceptDefault: boolean, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * @param {GalleryInterfaces.PublisherQuery} publisherQuery - * @param onResult callback function with the resulting GalleryInterfaces.PublisherQueryResult - */ - queryPublishers(publisherQuery: GalleryInterfaces.PublisherQuery, onResult: (err: any, statusCode: number, publisherquery: GalleryInterfaces.PublisherQueryResult) => void): void; - /** - * @param {GalleryInterfaces.Publisher} publisher - * @param onResult callback function with the resulting GalleryInterfaces.Publisher - */ - createPublisher(publisher: GalleryInterfaces.Publisher, onResult: (err: any, statusCode: number, publisher: GalleryInterfaces.Publisher) => void): void; - /** - * @param {string} publisherName - * @param onResult callback function - */ - deletePublisher(publisherName: string, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} publisherName - * @param {number} flags - * @param onResult callback function with the resulting GalleryInterfaces.Publisher - */ - getPublisher(publisherName: string, flags: number, onResult: (err: any, statusCode: number, publisher: GalleryInterfaces.Publisher) => void): void; - /** - * @param {GalleryInterfaces.Publisher} publisher - * @param {string} publisherName - * @param onResult callback function with the resulting GalleryInterfaces.Publisher - */ - updatePublisher(publisher: GalleryInterfaces.Publisher, publisherName: string, onResult: (err: any, statusCode: number, publisher: GalleryInterfaces.Publisher) => void): void; - /** - * Creates a new review item - * - * @param {GalleryInterfaces.Review} review - Contains details about the review item to be created like rating, reviewText, productId - * @param {string} extensionId - * @param onResult callback function with the resulting GalleryInterfaces.Review - */ - createReview(review: GalleryInterfaces.Review, extensionId: string, onResult: (err: any, statusCode: number, review: GalleryInterfaces.Review) => void): void; - /** - * Returns all reviews associated with a product - * - * @param {string} extensionId - Guid of the extension whose reviews need to be retrieved - * @param onResult callback function with the resulting GalleryInterfaces.ReviewsResult - */ - getReviews(extensionId: string, onResult: (err: any, statusCode: number, review: GalleryInterfaces.ReviewsResult) => void): void; - /** - * @param {string} keyType - * @param {number} expireCurrentSeconds - * @param onResult callback function - */ - generateKey(keyType: string, expireCurrentSeconds: number, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} keyType - * @param onResult callback function with the resulting string - */ - getSigningKey(keyType: string, onResult: (err: any, statusCode: number, signingkey: string) => void): void; - } - export class QGalleryApi extends basem.QClientApiBase implements IQGalleryApi { - api: GalleryApi; - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]); - /** - * @param {string} extensionId - * @param {string} accountName - */ - shareExtensionById(extensionId: string, accountName: string): Q.Promise; - /** - * @param {string} extensionId - * @param {string} accountName - */ - unshareExtensionById(extensionId: string, accountName: string): Q.Promise; - /** - * @param {string} publisherName - * @param {string} extensionName - * @param {string} accountName - */ - shareExtension(publisherName: string, extensionName: string, accountName: string): Q.Promise; - /** - * @param {string} publisherName - * @param {string} extensionName - * @param {string} accountName - */ - unshareExtension(publisherName: string, extensionName: string, accountName: string): Q.Promise; - /** - * @param {string} itemId - * @param {string} installationTarget - */ - getAcquisitionOptions(itemId: string, installationTarget: string): Q.Promise; - /** - * @param {GalleryInterfaces.ExtensionAcquisitionRequest} acquisitionRequest - */ - requestAcquisition(acquisitionRequest: GalleryInterfaces.ExtensionAcquisitionRequest): Q.Promise; - /** - * @param {string} publisherName - * @param {string} extensionName - * @param {string} version - * @param {string} assetType - * @param {string} accountToken - * @param {boolean} acceptDefault - */ - getAssetByName(publisherName: string, extensionName: string, version: string, assetType: string, accountToken?: string, acceptDefault?: boolean): Q.Promise; - /** - * @param {string} extensionId - * @param {string} version - * @param {string} assetType - * @param {string} accountToken - * @param {boolean} acceptDefault - */ - getAsset(extensionId: string, version: string, assetType: string, accountToken?: string, acceptDefault?: boolean): Q.Promise; - /** - * @param {string} languages - */ - getCategories(languages?: string): Q.Promise; - /** - * @param {string} publisherName - * @param {string} extensionName - * @param {string} version - */ - getCertificate(publisherName: string, extensionName: string, version?: string): Q.Promise; - /** - * @param {GalleryInterfaces.ExtensionQuery} extensionQuery - * @param {string} accountToken - */ - queryExtensions(extensionQuery: GalleryInterfaces.ExtensionQuery, accountToken?: string): Q.Promise; - /** - * @param {GalleryInterfaces.ExtensionPackage} extensionPackage - */ - createExtension(extensionPackage: GalleryInterfaces.ExtensionPackage): Q.Promise; - /** - * @param {string} extensionId - * @param {string} version - */ - deleteExtensionById(extensionId: string, version?: string): Q.Promise; - /** - * @param {string} extensionId - * @param {string} version - * @param {GalleryInterfaces.ExtensionQueryFlags} flags - */ - getExtensionById(extensionId: string, version?: string, flags?: GalleryInterfaces.ExtensionQueryFlags): Q.Promise; - /** - * @param {GalleryInterfaces.ExtensionPackage} extensionPackage - * @param {string} extensionId - */ - updateExtensionById(extensionPackage: GalleryInterfaces.ExtensionPackage, extensionId: string): Q.Promise; - /** - * @param {GalleryInterfaces.ExtensionPackage} extensionPackage - * @param {string} publisherName - */ - createExtensionWithPublisher(extensionPackage: GalleryInterfaces.ExtensionPackage, publisherName: string): Q.Promise; - /** - * @param {string} publisherName - * @param {string} extensionName - * @param {string} version - */ - deleteExtension(publisherName: string, extensionName: string, version?: string): Q.Promise; - /** - * @param {string} publisherName - * @param {string} extensionName - * @param {string} version - * @param {GalleryInterfaces.ExtensionQueryFlags} flags - * @param {string} accountToken - */ - getExtension(publisherName: string, extensionName: string, version?: string, flags?: GalleryInterfaces.ExtensionQueryFlags, accountToken?: string): Q.Promise; - /** - * @param {GalleryInterfaces.ExtensionPackage} extensionPackage - * @param {string} publisherName - * @param {string} extensionName - */ - updateExtension(extensionPackage: GalleryInterfaces.ExtensionPackage, publisherName: string, extensionName: string): Q.Promise; - /** - * @param {string} publisherName - * @param {string} extensionName - * @param {string} version - * @param {string} accountToken - * @param {boolean} acceptDefault - */ - getPackage(publisherName: string, extensionName: string, version: string, accountToken?: string, acceptDefault?: boolean): Q.Promise; - /** - * @param {string} publisherName - * @param {string} extensionName - * @param {string} version - * @param {string} assetType - * @param {string} assetToken - * @param {string} accountToken - * @param {boolean} acceptDefault - */ - getAssetWithToken(publisherName: string, extensionName: string, version: string, assetType: string, assetToken?: string, accountToken?: string, acceptDefault?: boolean): Q.Promise; - /** - * @param {GalleryInterfaces.PublisherQuery} publisherQuery - */ - queryPublishers(publisherQuery: GalleryInterfaces.PublisherQuery): Q.Promise; - /** - * @param {GalleryInterfaces.Publisher} publisher - */ - createPublisher(publisher: GalleryInterfaces.Publisher): Q.Promise; - /** - * @param {string} publisherName - */ - deletePublisher(publisherName: string): Q.Promise; - /** - * @param {string} publisherName - * @param {number} flags - */ - getPublisher(publisherName: string, flags?: number): Q.Promise; - /** - * @param {GalleryInterfaces.Publisher} publisher - * @param {string} publisherName - */ - updatePublisher(publisher: GalleryInterfaces.Publisher, publisherName: string): Q.Promise; - /** - * Creates a new review item - * - * @param {GalleryInterfaces.Review} review - Contains details about the review item to be created like rating, reviewText, productId - * @param {string} extensionId - */ - createReview(review: GalleryInterfaces.Review, extensionId: string): Q.Promise; - /** - * Returns all reviews associated with a product - * - * @param {string} extensionId - Guid of the extension whose reviews need to be retrieved - */ - getReviews(extensionId: string): Q.Promise; - /** - * @param {string} keyType - * @param {number} expireCurrentSeconds - */ - generateKey(keyType: string, expireCurrentSeconds?: number): Q.Promise; - /** - * @param {string} keyType - */ - getSigningKey(keyType: string): Q.Promise; - } - -} -declare module 'vso-node-api/interfaces/GitInterfaces' { - import TfsCoreInterfaces = require('vso-node-api/interfaces/CoreInterfaces'); - import VSSInterfaces = require('vso-node-api/interfaces/common/VSSInterfaces'); - export interface AssociatedWorkItem { - assignedTo: string; - id: number; - state: string; - title: string; - /** - * REST url - */ - url: string; - webUrl: string; - workItemType: string; - } - export interface Change { - changeType: VersionControlChangeType; - item: T; - newContent: ItemContent; - sourceServerItem: string; - url: string; - } - export interface ChangeCountDictionary { - } - export interface ChangeList { - allChangesIncluded: boolean; - changeCounts: { - [key: number]: number; - }; - changes: Change[]; - comment: string; - commentTruncated: boolean; - creationDate: Date; - notes: CheckinNote[]; - owner: string; - ownerDisplayName: string; - ownerId: string; - sortDate: Date; - version: string; - } - /** - * Criteria used in a search for change lists - */ - export interface ChangeListSearchCriteria { - /** - * If provided, a version descriptor to compare against base - */ - compareVersion: string; - /** - * If true, don't include delete history entries - */ - excludeDeletes: boolean; - /** - * Whether or not to follow renames for the given item being queried - */ - followRenames: boolean; - /** - * If provided, only include history entries created after this date (string) - */ - fromDate: string; - /** - * If provided, a version descriptor for the earliest change list to include - */ - fromVersion: string; - /** - * Path of item to search under - */ - itemPath: string; - /** - * Version of the items to search - */ - itemVersion: string; - /** - * Number of results to skip (used when clicking more...) - */ - skip: number; - /** - * If provided, only include history entries created before this date (string) - */ - toDate: string; - /** - * If provided, the maximum number of history entries to return - */ - top: number; - /** - * If provided, a version descriptor for the latest change list to include - */ - toVersion: string; - /** - * Alias or display name of user who made the changes - */ - user: string; - } - export interface CheckinNote { - name: string; - value: string; - } - export interface FileContentMetadata { - contentType: string; - encoding: number; - extension: string; - fileName: string; - isBinary: boolean; - isImage: boolean; - vsLink: string; - } - export interface GitBaseVersionDescriptor extends GitVersionDescriptor { - /** - * Version string identifier (name of tag/branch, SHA1 of commit) - */ - baseVersion: string; - /** - * Version options - Specify additional modifiers to version (e.g Previous) - */ - baseVersionOptions: GitVersionOptions; - /** - * Version type (branch, tag, or commit). Determines how Id is interpreted - */ - baseVersionType: GitVersionType; - } - export interface GitBlobRef { - _links: any; - /** - * SHA1 hash of git object - */ - objectId: string; - /** - * Size of blob content (in bytes) - */ - size: number; - url: string; - } - export interface GitBranchStats { - aheadCount: number; - behindCount: number; - commit: GitCommitRef; - isBaseVersion: boolean; - name: string; - } - export interface GitChange extends Change { - } - export interface GitCommit extends GitCommitRef { - push: GitPushRef; - treeId: string; - } - export interface GitCommitChanges { - changeCounts: ChangeCountDictionary; - changes: GitChange[]; - } - export interface GitCommitDiffs { - aheadCount: number; - allChangesIncluded: boolean; - baseCommit: string; - behindCount: number; - changeCounts: { - [key: number]: number; - }; - changes: GitChange[]; - commonCommit: string; - targetCommit: string; - } - export interface GitCommitRef { - _links: any; - author: GitUserDate; - changeCounts: ChangeCountDictionary; - changes: GitChange[]; - comment: string; - commentTruncated: boolean; - commitId: string; - committer: GitUserDate; - parents: string[]; - remoteUrl: string; - url: string; - } - export interface GitCommitToCreate { - baseRef: GitRef; - comment: string; - pathActions: GitPathAction[]; - } - export interface GitDeletedRepository { - createdDate: Date; - deletedBy: VSSInterfaces.IdentityRef; - deletedDate: Date; - id: string; - name: string; - project: TfsCoreInterfaces.TeamProjectReference; - } - export interface GitHistoryQueryResults extends HistoryQueryResults { - /** - * Seed commit used for querying history. Used for skip feature. - */ - startingCommitId: string; - unpopulatedCount: number; - unprocessedCount: number; - } - export interface GitItem extends ItemModel { - /** - * SHA1 of commit item was fetched at - */ - commitId: string; - /** - * Type of object (Commit, Tree, Blob, Tag, ...) - */ - gitObjectType: GitObjectType; - /** - * Shallow ref to commit that last changed this item Only populated if latestProcessedChange is requested May not be accurate if latest change is not yet cached - */ - latestProcessedChange: GitCommitRef; - /** - * Git object id - */ - objectId: string; - /** - * Git object id - */ - originalObjectId: string; - } - export interface GitItemDescriptor { - /** - * Path to item - */ - path: string; - /** - * Specifies whether to include children (OneLevel), all descendants (Full), or None - */ - recursionLevel: VersionControlRecursionType; - /** - * Version string (interpretation based on VersionType defined in subclass - */ - version: string; - /** - * Version modifiers (e.g. previous) - */ - versionOptions: GitVersionOptions; - /** - * How to interpret version (branch,tag,commit) - */ - versionType: GitVersionType; - } - export interface GitItemRequestData { - /** - * Whether to include metadata for all items - */ - includeContentMetadata: boolean; - /** - * Whether to include the _links field on the shallow references - */ - includeLinks: boolean; - /** - * Collection of items to fetch, including path, version, and recursion level - */ - itemDescriptors: GitItemDescriptor[]; - /** - * Whether to include shallow ref to commit that last changed each item - */ - latestProcessedChange: boolean; - } - export enum GitObjectType { - Bad = 0, - Commit = 1, - Tree = 2, - Blob = 3, - Tag = 4, - Ext2 = 5, - OfsDelta = 6, - RefDelta = 7, - } - export interface GitPathAction { - action: GitPathActions; - base64Content: string; - path: string; - rawTextContent: string; - targetPath: string; - } - export enum GitPathActions { - None = 0, - Edit = 1, - Delete = 2, - Add = 3, - Rename = 4, - } - export enum GitPermissionScope { - Project = 0, - Repository = 1, - Branch = 2, - } - export interface GitPullRequest { - _links: any; - closedDate: Date; - codeReviewId: number; - commits: GitCommitRef[]; - completionOptions: GitPullRequestCompletionOptions; - completionQueueTime: Date; - createdBy: VSSInterfaces.IdentityRef; - creationDate: Date; - description: string; - lastMergeCommit: GitCommitRef; - lastMergeSourceCommit: GitCommitRef; - lastMergeTargetCommit: GitCommitRef; - mergeId: string; - mergeStatus: PullRequestAsyncStatus; - pullRequestId: number; - remoteUrl: string; - repository: GitRepository; - reviewers: IdentityRefWithVote[]; - sourceRefName: string; - status: PullRequestStatus; - targetRefName: string; - title: string; - upgraded: boolean; - url: string; - workItemRefs: VSSInterfaces.ResourceRef[]; - } - export interface GitPullRequestCompletionOptions { - deleteSourceBranch: boolean; - mergeCommitMessage: string; - squashMerge: boolean; - } - export interface GitPullRequestSearchCriteria { - creatorId: string; - /** - * Whether to include the _links field on the shallow references - */ - includeLinks: boolean; - repositoryId: string; - reviewerId: string; - sourceRefName: string; - status: PullRequestStatus; - targetRefName: string; - } - export interface GitPush extends GitPushRef { - commits: GitCommitRef[]; - refUpdates: GitRefUpdate[]; - repository: GitRepository; - } - export interface GitPushEventData { - afterId: string; - beforeId: string; - branch: string; - commits: GitCommit[]; - repository: GitRepository; - } - export interface GitPushRef { - _links: any; - date: Date; - pushCorrelationId: string; - pushedBy: VSSInterfaces.IdentityRef; - pushId: number; - url: string; - } - export interface GitPushSearchCriteria { - fromDate: Date; - /** - * Whether to include the _links field on the shallow references - */ - includeLinks: boolean; - includeRefUpdates: boolean; - pusherId: string; - refName: string; - toDate: Date; - } - export interface GitQueryCommitsCriteria { - /** - * Number of entries to skip - */ - $skip: number; - /** - * Maximum number of entries to retrieve - */ - $top: number; - /** - * Alias or display name of the author - */ - author: string; - /** - * If provided, the earliest commit in the graph to search - */ - compareVersion: GitVersionDescriptor; - /** - * If true, don't include delete history entries - */ - excludeDeletes: boolean; - /** - * If provided, a lower bound for filtering commits alphabetically - */ - fromCommitId: string; - /** - * If provided, only include history entries created after this date (string) - */ - fromDate: string; - /** - * If provided, specifies the exact commit ids of the commits to fetch. May not be combined with other parameters. - */ - ids: string[]; - /** - * Whether to include the _links field on the shallow references - */ - includeLinks: boolean; - /** - * Path of item to search under - */ - itemPath: string; - /** - * If provided, identifies the commit or branch to search - */ - itemVersion: GitVersionDescriptor; - /** - * If provided, an upper bound for filtering commits alphabetically - */ - toCommitId: string; - /** - * If provided, only include history entries created before this date (string) - */ - toDate: string; - /** - * Alias or display name of the committer - */ - user: string; - } - export interface GitRef { - _links: any; - isLockedBy: VSSInterfaces.IdentityRef; - name: string; - objectId: string; - statuses: GitStatus[]; - url: string; - } - export interface GitRefUpdate { - name: string; - newObjectId: string; - oldObjectId: string; - repositoryId: string; - } - export enum GitRefUpdateMode { - /** - * Indicates the Git protocol model where any refs that can be updated will be updated, but any failures will not prevent other updates from succeeding. - */ - BestEffort = 0, - /** - * Indicates that all ref updates must succeed or none will succeed. All ref updates will be atomically written. If any failure is encountered, previously successful updates will be rolled back and the entire operation will fail. - */ - AllOrNone = 1, - } - export interface GitRefUpdateResult { - /** - * Custom message for the result object For instance, Reason for failing. - */ - customMessage: string; - /** - * Ref name - */ - name: string; - /** - * New object ID - */ - newObjectId: string; - /** - * Old object ID - */ - oldObjectId: string; - /** - * Name of the plugin that rejected the updated. - */ - rejectedBy: string; - /** - * Repository ID - */ - repositoryId: string; - /** - * True if the ref update succeeded, false otherwise - */ - success: boolean; - /** - * Status of the update from the TFS server. - */ - updateStatus: GitRefUpdateStatus; - } - export interface GitRefUpdateResultSet { - countFailed: number; - countSucceeded: number; - pushCorrelationId: string; - pushIds: { - [key: string]: number; - }; - pushTime: Date; - results: GitRefUpdateResult[]; - } - export enum GitRefUpdateStatus { - /** - * Indicates that the ref update request was completed successfully. - */ - Succeeded = 0, - /** - * Indicates that the ref update request could not be completed because part of the graph would be disconnected by this change, and the caller does not have ForcePush permission on the repository. - */ - ForcePushRequired = 1, - /** - * Indicates that the ref update request could not be completed because the old object ID presented in the request was not the object ID of the ref when the database attempted the update. The most likely scenario is that the caller lost a race to update the ref. - */ - StaleOldObjectId = 2, - /** - * Indicates that the ref update request could not be completed because the ref name presented in the request was not valid. - */ - InvalidRefName = 3, - /** - * The request was not processed - */ - Unprocessed = 4, - /** - * The ref update request could not be completed because the new object ID for the ref could not be resolved to a commit object (potentially through any number of tags) - */ - UnresolvableToCommit = 5, - /** - * The ref update request could not be completed because the user lacks write permissions required to write this ref - */ - WritePermissionRequired = 6, - /** - * The ref update request could not be completed because the user lacks note creation permissions required to write this note - */ - ManageNotePermissionRequired = 7, - /** - * The ref update request could not be completed because the user lacks the permission to create a branch - */ - CreateBranchPermissionRequired = 8, - /** - * The ref update request could not be completed because the user lacks the permission to create a tag - */ - CreateTagPermissionRequired = 9, - /** - * The ref update could not be completed because it was rejected by the plugin. - */ - RejectedByPlugin = 10, - /** - * The ref update could not be completed because the ref is locked by another user. - */ - Locked = 11, - /** - * The ref update could not be completed because, in case-insensitive mode, the ref name conflicts with an existing, differently-cased ref name. - */ - RefNameConflict = 12, - /** - * The ref update could not be completed because it was rejected by policy. - */ - RejectedByPolicy = 13, - /** - * Indicates that the ref update request was completed successfully, but the ref doesn't actually exist so no changes were made. This should only happen during deletes. - */ - SucceededNonExistentRef = 14, - /** - * Indicates that the ref update request was completed successfully, but the passed-in ref was corrupt - as in, the old object ID was bad. This should only happen during deletes. - */ - SucceededCorruptRef = 15, - } - export interface GitRepository { - _links: any; - defaultBranch: string; - id: string; - name: string; - project: TfsCoreInterfaces.TeamProjectReference; - remoteUrl: string; - url: string; - } - export enum GitRepositoryPermissions { - None = 0, - Administer = 1, - GenericRead = 2, - GenericContribute = 4, - ForcePush = 8, - CreateBranch = 16, - CreateTag = 32, - ManageNote = 64, - PolicyExempt = 128, - /** - * This defines the set of bits that are valid for the git permission space. When reading or writing git permissions, these are the only bits paid attention too. - */ - All = 255, - BranchLevelPermissions = 141, - } - export interface GitStatus { - _links: any; - context: GitStatusContext; - createdBy: VSSInterfaces.IdentityRef; - creationDate: Date; - description: string; - state: GitStatusState; - targetUrl: string; - } - export interface GitStatusContext { - genre: string; - name: string; - } - export enum GitStatusState { - NotSet = 0, - Pending = 1, - Succeeded = 2, - Failed = 3, - Error = 4, - } - export interface GitSuggestion { - properties: { - [key: string]: any; - }; - type: string; - } - export interface GitTargetVersionDescriptor extends GitVersionDescriptor { - /** - * Version string identifier (name of tag/branch, SHA1 of commit) - */ - targetVersion: string; - /** - * Version options - Specify additional modifiers to version (e.g Previous) - */ - targetVersionOptions: GitVersionOptions; - /** - * Version type (branch, tag, or commit). Determines how Id is interpreted - */ - targetVersionType: GitVersionType; - } - export interface GitTreeEntryRef { - /** - * Blob or tree - */ - gitObjectType: GitObjectType; - /** - * Mode represented as octal string - */ - mode: string; - /** - * SHA1 hash of git object - */ - objectId: string; - /** - * Path relative to parent tree object - */ - relativePath: string; - /** - * Size of content - */ - size: number; - /** - * url to retrieve tree or blob - */ - url: string; - } - export interface GitTreeRef { - _links: any; - /** - * SHA1 hash of git object - */ - objectId: string; - /** - * Sum of sizes of all children - */ - size: number; - /** - * Blobs and trees under this tree - */ - treeEntries: GitTreeEntryRef[]; - /** - * Url to tree - */ - url: string; - } - export interface GitUserDate { - date: Date; - email: string; - name: string; - } - export interface GitVersionDescriptor { - /** - * Version string identifier (name of tag/branch/index, SHA1 of commit) - */ - version: string; - /** - * Version options - Specify additional modifiers to version (e.g Previous) - */ - versionOptions: GitVersionOptions; - /** - * Version type (branch, tag, commit, or index). Determines how Id is interpreted - */ - versionType: GitVersionType; - } - export enum GitVersionOptions { - /** - * Not specified - */ - None = 0, - /** - * Commit that changed item prior to the current version - */ - PreviousChange = 1, - /** - * First parent of commit (HEAD^) - */ - FirstParent = 2, - } - export enum GitVersionType { - /** - * Interpret the version as a branch name - */ - Branch = 0, - /** - * Interpret the version as a tag name - */ - Tag = 1, - /** - * Interpret the version as a commit ID (SHA1) - */ - Commit = 2, - /** - * Interpret the version as an index name - */ - Index = 3, - } - export interface HistoryEntry { - /** - * The Change list (changeset/commit/shelveset) for this point in history - */ - changeList: ChangeList; - /** - * The change made to the item from this change list (only relevant for File history, not folders) - */ - itemChangeType: VersionControlChangeType; - /** - * The path of the item at this point in history (only relevant for File history, not folders) - */ - serverItem: string; - } - export interface HistoryQueryResults { - /** - * True if there are more results available to fetch (we're returning the max # of items requested) A more RESTy solution would be to include a Link header - */ - moreResultsAvailable: boolean; - /** - * The history entries (results) from this query - */ - results: HistoryEntry[]; - } - export interface IdentityRefWithVote extends VSSInterfaces.IdentityRef { - isRequired: boolean; - reviewerUrl: string; - vote: number; - votedFor: IdentityRefWithVote[]; - } - export interface IncludedGitCommit { - commitId: string; - commitTime: Date; - parentCommitIds: string[]; - repositoryId: string; - } - export interface ItemContent { - content: string; - contentType: ItemContentType; - } - export enum ItemContentType { - RawText = 0, - Base64Encoded = 1, - } - /** - * Optional details to include when returning an item model - */ - export interface ItemDetailsOptions { - /** - * If true, include metadata about the file type - */ - includeContentMetadata: boolean; - /** - * Specifies whether to include children (OneLevel), all descendants (Full) or None for folder items - */ - recursionLevel: VersionControlRecursionType; - } - export interface ItemModel { - _links: any; - contentMetadata: FileContentMetadata; - isFolder: boolean; - isSymLink: boolean; - path: string; - url: string; - } - export enum PullRequestAsyncStatus { - NotSet = 0, - Queued = 1, - Conflicts = 2, - Succeeded = 3, - RejectedByPolicy = 4, - Failure = 5, - } - export enum PullRequestStatus { - NotSet = 0, - Active = 1, - Abandoned = 2, - Completed = 3, - All = 4, - } - export interface TfvcBranch extends TfvcBranchRef { - children: TfvcBranch[]; - mappings: TfvcBranchMapping[]; - parent: TfvcShallowBranchRef; - relatedBranches: TfvcShallowBranchRef[]; - } - export interface TfvcBranchMapping { - depth: string; - serverItem: string; - type: string; - } - export interface TfvcBranchRef extends TfvcShallowBranchRef { - _links: any; - createdDate: Date; - description: string; - isDeleted: boolean; - owner: VSSInterfaces.IdentityRef; - url: string; - } - export interface TfvcChange extends Change { - /** - * List of merge sources in case of rename or branch creation. - */ - mergeSources: TfvcMergeSource[]; - /** - * Version at which a (shelved) change was pended against - */ - pendingVersion: number; - } - export interface TfvcChangeset extends TfvcChangesetRef { - accountId: string; - changes: TfvcChange[]; - checkinNotes: CheckinNote[]; - collectionId: string; - hasMoreChanges: boolean; - policyOverride: TfvcPolicyOverrideInfo; - teamProjectIds: string[]; - workItems: AssociatedWorkItem[]; - } - export interface TfvcChangesetRef { - _links: any; - author: VSSInterfaces.IdentityRef; - changesetId: number; - checkedInBy: VSSInterfaces.IdentityRef; - comment: string; - commentTruncated: boolean; - createdDate: Date; - url: string; - } - /** - * Criteria used in a search for change lists - */ - export interface TfvcChangesetSearchCriteria { - /** - * Alias or display name of user who made the changes - */ - author: string; - /** - * Whether or not to follow renames for the given item being queried - */ - followRenames: boolean; - /** - * If provided, only include changesets created after this date (string) Think of a better name for this. - */ - fromDate: string; - /** - * If provided, only include changesets after this changesetID - */ - fromId: number; - /** - * Whether to include the _links field on the shallow references - */ - includeLinks: boolean; - /** - * Path of item to search under - */ - path: string; - /** - * If provided, only include changesets created before this date (string) Think of a better name for this. - */ - toDate: string; - /** - * If provided, a version descriptor for the latest change list to include - */ - toId: number; - } - export interface TfvcChangesetsRequestData { - changesetIds: number[]; - commentLength: number; - /** - * Whether to include the _links field on the shallow references - */ - includeLinks: boolean; - } - export interface TfvcCheckinEventData { - changeset: TfvcChangeset; - project: TfsCoreInterfaces.TeamProjectReference; - } - export interface TfvcHistoryEntry extends HistoryEntry { - /** - * The encoding of the item at this point in history (only relevant for File history, not folders) - */ - encoding: number; - /** - * The file id of the item at this point in history (only relevant for File history, not folders) - */ - fileId: number; - } - export interface TfvcItem extends ItemModel { - changeDate: Date; - deletionId: number; - /** - * MD5 hash as a base 64 string, applies to files only. - */ - hashValue: string; - isBranch: boolean; - isPendingChange: boolean; - /** - * The size of the file, if applicable. - */ - size: number; - version: number; - } - /** - * Item path and Version descriptor properties - */ - export interface TfvcItemDescriptor { - path: string; - recursionLevel: VersionControlRecursionType; - version: string; - versionOption: TfvcVersionOption; - versionType: TfvcVersionType; - } - export interface TfvcItemRequestData { - /** - * If true, include metadata about the file type - */ - includeContentMetadata: boolean; - /** - * Whether to include the _links field on the shallow references - */ - includeLinks: boolean; - itemDescriptors: TfvcItemDescriptor[]; - } - export interface TfvcLabel extends TfvcLabelRef { - items: TfvcItem[]; - } - export interface TfvcLabelRef { - _links: any; - description: string; - id: number; - labelScope: string; - modifiedDate: Date; - name: string; - owner: VSSInterfaces.IdentityRef; - url: string; - } - export interface TfvcLabelRequestData { - /** - * Whether to include the _links field on the shallow references - */ - includeLinks: boolean; - itemLabelFilter: string; - labelScope: string; - maxItemCount: number; - name: string; - owner: string; - } - export interface TfvcMergeSource { - /** - * Indicates if this a rename source. If false, it is a merge source. - */ - isRename: boolean; - /** - * The server item of the merge source - */ - serverItem: string; - /** - * Start of the version range - */ - versionFrom: number; - /** - * End of the version range - */ - versionTo: number; - } - export interface TfvcPolicyFailureInfo { - message: string; - policyName: string; - } - export interface TfvcPolicyOverrideInfo { - comment: string; - policyFailures: TfvcPolicyFailureInfo[]; - } - export interface TfvcShallowBranchRef { - path: string; - } - export interface TfvcShelveset extends TfvcShelvesetRef { - changes: TfvcChange[]; - notes: CheckinNote[]; - policyOverride: TfvcPolicyOverrideInfo; - workItems: AssociatedWorkItem[]; - } - export interface TfvcShelvesetRef { - _links: any; - comment: string; - commentTruncated: boolean; - createdDate: Date; - id: string; - name: string; - owner: VSSInterfaces.IdentityRef; - url: string; - } - export interface TfvcShelvesetRequestData { - /** - * Whether to include policyOverride and notes - */ - includeDetails: boolean; - /** - * Whether to include the _links field on the shallow references - */ - includeLinks: boolean; - /** - * Whether to include workItems - */ - includeWorkItems: boolean; - /** - * Max number of changes to include - */ - maxChangeCount: number; - /** - * Max length of comment - */ - maxCommentLength: number; - /** - * Shelveset's name - */ - name: string; - /** - * Owner's ID. Could be a name or a guid. - */ - owner: string; - } - export interface TfvcVersionDescriptor { - version: string; - versionOption: TfvcVersionOption; - versionType: TfvcVersionType; - } - export enum TfvcVersionOption { - None = 0, - Previous = 1, - UseRename = 2, - } - export enum TfvcVersionType { - None = 0, - Changeset = 1, - Shelveset = 2, - Change = 3, - Date = 4, - Latest = 5, - Tip = 6, - MergeSource = 7, - } - export interface UpdateRefsRequest { - refUpdateRequests: GitRefUpdate[]; - updateMode: GitRefUpdateMode; - } - export enum VersionControlChangeType { - None = 0, - Add = 1, - Edit = 2, - Encoding = 4, - Rename = 8, - Delete = 16, - Undelete = 32, - Branch = 64, - Merge = 128, - Lock = 256, - Rollback = 512, - SourceRename = 1024, - TargetRename = 2048, - Property = 4096, - All = 8191, - } - export interface VersionControlProjectInfo { - defaultSourceControlType: TfsCoreInterfaces.SourceControlTypes; - project: TfsCoreInterfaces.TeamProjectReference; - supportsGit: boolean; - supportsTFVC: boolean; - } - export enum VersionControlRecursionType { - /** - * Only return the specified item. - */ - None = 0, - /** - * Return the specified item and its direct children. - */ - OneLevel = 1, - /** - * Return the specified item and its direct children, as well as recursive chains of nested child folders that only contain a single folder. - */ - OneLevelPlusNestedEmptyFolders = 4, - /** - * Return specified item and all descendants - */ - Full = 120, - } - export var TypeInfo: { - AssociatedWorkItem: { - fields: any; - }; - Change: { - fields: any; - }; - ChangeCountDictionary: { - fields: any; - }; - ChangeList: { - fields: any; - }; - ChangeListSearchCriteria: { - fields: any; - }; - CheckinNote: { - fields: any; - }; - FileContentMetadata: { - fields: any; - }; - GitBaseVersionDescriptor: { - fields: any; - }; - GitBlobRef: { - fields: any; - }; - GitBranchStats: { - fields: any; - }; - GitChange: { - fields: any; - }; - GitCommit: { - fields: any; - }; - GitCommitChanges: { - fields: any; - }; - GitCommitDiffs: { - fields: any; - }; - GitCommitRef: { - fields: any; - }; - GitCommitToCreate: { - fields: any; - }; - GitDeletedRepository: { - fields: any; - }; - GitHistoryQueryResults: { - fields: any; - }; - GitItem: { - fields: any; - }; - GitItemDescriptor: { - fields: any; - }; - GitItemRequestData: { - fields: any; - }; - GitObjectType: { - enumValues: { - "bad": number; - "commit": number; - "tree": number; - "blob": number; - "tag": number; - "ext2": number; - "ofsDelta": number; - "refDelta": number; - }; - }; - GitPathAction: { - fields: any; - }; - GitPathActions: { - enumValues: { - "none": number; - "edit": number; - "delete": number; - "add": number; - "rename": number; - }; - }; - GitPermissionScope: { - enumValues: { - "project": number; - "repository": number; - "branch": number; - }; - }; - GitPullRequest: { - fields: any; - }; - GitPullRequestCompletionOptions: { - fields: any; - }; - GitPullRequestSearchCriteria: { - fields: any; - }; - GitPush: { - fields: any; - }; - GitPushEventData: { - fields: any; - }; - GitPushRef: { - fields: any; - }; - GitPushSearchCriteria: { - fields: any; - }; - GitQueryCommitsCriteria: { - fields: any; - }; - GitRef: { - fields: any; - }; - GitRefUpdate: { - fields: any; - }; - GitRefUpdateMode: { - enumValues: { - "bestEffort": number; - "allOrNone": number; - }; - }; - GitRefUpdateResult: { - fields: any; - }; - GitRefUpdateResultSet: { - fields: any; - }; - GitRefUpdateStatus: { - enumValues: { - "succeeded": number; - "forcePushRequired": number; - "staleOldObjectId": number; - "invalidRefName": number; - "unprocessed": number; - "unresolvableToCommit": number; - "writePermissionRequired": number; - "manageNotePermissionRequired": number; - "createBranchPermissionRequired": number; - "createTagPermissionRequired": number; - "rejectedByPlugin": number; - "locked": number; - "refNameConflict": number; - "rejectedByPolicy": number; - "succeededNonExistentRef": number; - "succeededCorruptRef": number; - }; - }; - GitRepository: { - fields: any; - }; - GitRepositoryPermissions: { - enumValues: { - "none": number; - "administer": number; - "genericRead": number; - "genericContribute": number; - "forcePush": number; - "createBranch": number; - "createTag": number; - "manageNote": number; - "policyExempt": number; - "all": number; - "branchLevelPermissions": number; - }; - }; - GitStatus: { - fields: any; - }; - GitStatusContext: { - fields: any; - }; - GitStatusState: { - enumValues: { - "notSet": number; - "pending": number; - "succeeded": number; - "failed": number; - "error": number; - }; - }; - GitSuggestion: { - fields: any; - }; - GitTargetVersionDescriptor: { - fields: any; - }; - GitTreeEntryRef: { - fields: any; - }; - GitTreeRef: { - fields: any; - }; - GitUserDate: { - fields: any; - }; - GitVersionDescriptor: { - fields: any; - }; - GitVersionOptions: { - enumValues: { - "none": number; - "previousChange": number; - "firstParent": number; - }; - }; - GitVersionType: { - enumValues: { - "branch": number; - "tag": number; - "commit": number; - "index": number; - }; - }; - HistoryEntry: { - fields: any; - }; - HistoryQueryResults: { - fields: any; - }; - IdentityRefWithVote: { - fields: any; - }; - IncludedGitCommit: { - fields: any; - }; - ItemContent: { - fields: any; - }; - ItemContentType: { - enumValues: { - "rawText": number; - "base64Encoded": number; - }; - }; - ItemDetailsOptions: { - fields: any; - }; - ItemModel: { - fields: any; - }; - PullRequestAsyncStatus: { - enumValues: { - "notSet": number; - "queued": number; - "conflicts": number; - "succeeded": number; - "rejectedByPolicy": number; - "failure": number; - }; - }; - PullRequestStatus: { - enumValues: { - "notSet": number; - "active": number; - "abandoned": number; - "completed": number; - "all": number; - }; - }; - TfvcBranch: { - fields: any; - }; - TfvcBranchMapping: { - fields: any; - }; - TfvcBranchRef: { - fields: any; - }; - TfvcChange: { - fields: any; - }; - TfvcChangeset: { - fields: any; - }; - TfvcChangesetRef: { - fields: any; - }; - TfvcChangesetSearchCriteria: { - fields: any; - }; - TfvcChangesetsRequestData: { - fields: any; - }; - TfvcCheckinEventData: { - fields: any; - }; - TfvcHistoryEntry: { - fields: any; - }; - TfvcItem: { - fields: any; - }; - TfvcItemDescriptor: { - fields: any; - }; - TfvcItemRequestData: { - fields: any; - }; - TfvcLabel: { - fields: any; - }; - TfvcLabelRef: { - fields: any; - }; - TfvcLabelRequestData: { - fields: any; - }; - TfvcMergeSource: { - fields: any; - }; - TfvcPolicyFailureInfo: { - fields: any; - }; - TfvcPolicyOverrideInfo: { - fields: any; - }; - TfvcShallowBranchRef: { - fields: any; - }; - TfvcShelveset: { - fields: any; - }; - TfvcShelvesetRef: { - fields: any; - }; - TfvcShelvesetRequestData: { - fields: any; - }; - TfvcVersionDescriptor: { - fields: any; - }; - TfvcVersionOption: { - enumValues: { - "none": number; - "previous": number; - "useRename": number; - }; - }; - TfvcVersionType: { - enumValues: { - "none": number; - "changeset": number; - "shelveset": number; - "change": number; - "date": number; - "latest": number; - "tip": number; - "mergeSource": number; - }; - }; - UpdateRefsRequest: { - fields: any; - }; - VersionControlChangeType: { - enumValues: { - "none": number; - "add": number; - "edit": number; - "encoding": number; - "rename": number; - "delete": number; - "undelete": number; - "branch": number; - "merge": number; - "lock": number; - "rollback": number; - "sourceRename": number; - "targetRename": number; - "property": number; - "all": number; - }; - }; - VersionControlProjectInfo: { - fields: any; - }; - VersionControlRecursionType: { - enumValues: { - "none": number; - "oneLevel": number; - "oneLevelPlusNestedEmptyFolders": number; - "full": number; - }; - }; - }; - -} -declare module 'vso-node-api/GitApi' { - /// - /// - import Q = require('q'); - import basem = require('vso-node-api/ClientApiBases'); - import VsoBaseInterfaces = require('vso-node-api/interfaces/common/VsoBaseInterfaces'); - import GitInterfaces = require('vso-node-api/interfaces/GitInterfaces'); - import VSSInterfaces = require('vso-node-api/interfaces/common/VSSInterfaces'); - export interface IGitApi extends basem.ClientApiBase { - getBlob(repositoryId: string, sha1: string, project: string, download: boolean, fileName: string, onResult: (err: any, statusCode: number, Blob: GitInterfaces.GitBlobRef) => void): void; - getBlobContent(repositoryId: string, sha1: string, project: string, download: boolean, fileName: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getBlobsZip(blobIds: string[], repositoryId: string, project: string, filename: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getBlobZip(repositoryId: string, sha1: string, project: string, download: boolean, fileName: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getBranch(repositoryId: string, name: string, project: string, baseVersionDescriptor: GitInterfaces.GitVersionDescriptor, onResult: (err: any, statusCode: number, BranchStat: GitInterfaces.GitBranchStats) => void): void; - getBranches(repositoryId: string, project: string, baseVersionDescriptor: GitInterfaces.GitVersionDescriptor, onResult: (err: any, statusCode: number, BranchStats: GitInterfaces.GitBranchStats[]) => void): void; - getChanges(commitId: string, repositoryId: string, project: string, top: number, skip: number, onResult: (err: any, statusCode: number, Change: GitInterfaces.GitCommitChanges) => void): void; - getCommit(commitId: string, repositoryId: string, project: string, changeCount: number, onResult: (err: any, statusCode: number, Commit: GitInterfaces.GitCommit) => void): void; - getCommits(repositoryId: string, searchCriteria: GitInterfaces.GitQueryCommitsCriteria, project: string, skip: number, top: number, onResult: (err: any, statusCode: number, Commits: GitInterfaces.GitCommitRef[]) => void): void; - getPushCommits(repositoryId: string, pushId: number, project: string, top: number, skip: number, includeLinks: boolean, onResult: (err: any, statusCode: number, Commits: GitInterfaces.GitCommitRef[]) => void): void; - getCommitsBatch(searchCriteria: GitInterfaces.GitQueryCommitsCriteria, repositoryId: string, project: string, skip: number, top: number, onResult: (err: any, statusCode: number, CommitsBatch: GitInterfaces.GitCommitRef[]) => void): void; - getDeletedRepositories(project: string, onResult: (err: any, statusCode: number, DeletedRepositories: GitInterfaces.GitDeletedRepository[]) => void): void; - getItem(repositoryId: string, path: string, project: string, scopePath: string, recursionLevel: GitInterfaces.VersionControlRecursionType, includeContentMetadata: boolean, latestProcessedChange: boolean, download: boolean, versionDescriptor: GitInterfaces.GitVersionDescriptor, onResult: (err: any, statusCode: number, Item: GitInterfaces.GitItem) => void): void; - getItemContent(repositoryId: string, path: string, project: string, scopePath: string, recursionLevel: GitInterfaces.VersionControlRecursionType, includeContentMetadata: boolean, latestProcessedChange: boolean, download: boolean, versionDescriptor: GitInterfaces.GitVersionDescriptor, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getItems(repositoryId: string, project: string, scopePath: string, recursionLevel: GitInterfaces.VersionControlRecursionType, includeContentMetadata: boolean, latestProcessedChange: boolean, download: boolean, includeLinks: boolean, versionDescriptor: GitInterfaces.GitVersionDescriptor, onResult: (err: any, statusCode: number, Items: GitInterfaces.GitItem[]) => void): void; - getItemText(repositoryId: string, path: string, project: string, scopePath: string, recursionLevel: GitInterfaces.VersionControlRecursionType, includeContentMetadata: boolean, latestProcessedChange: boolean, download: boolean, versionDescriptor: GitInterfaces.GitVersionDescriptor, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getItemZip(repositoryId: string, path: string, project: string, scopePath: string, recursionLevel: GitInterfaces.VersionControlRecursionType, includeContentMetadata: boolean, latestProcessedChange: boolean, download: boolean, versionDescriptor: GitInterfaces.GitVersionDescriptor, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getItemsBatch(requestData: GitInterfaces.GitItemRequestData, repositoryId: string, project: string, onResult: (err: any, statusCode: number, ItemsBatch: GitInterfaces.GitItem[][]) => void): void; - getPullRequestCommits(repositoryId: string, pullRequestId: number, project: string, onResult: (err: any, statusCode: number, PullRequestCommits: GitInterfaces.GitCommitRef[]) => void): void; - createPullRequestReviewer(reviewer: GitInterfaces.IdentityRefWithVote, repositoryId: string, pullRequestId: number, reviewerId: string, project: string, onResult: (err: any, statusCode: number, PullRequestReviewer: GitInterfaces.IdentityRefWithVote) => void): void; - createPullRequestReviewers(reviewers: VSSInterfaces.IdentityRef[], repositoryId: string, pullRequestId: number, project: string, onResult: (err: any, statusCode: number, PullRequestReviewers: GitInterfaces.IdentityRefWithVote[]) => void): void; - deletePullRequestReviewer(repositoryId: string, pullRequestId: number, reviewerId: string, project: string, onResult: (err: any, statusCode: number) => void): void; - getPullRequestReviewer(repositoryId: string, pullRequestId: number, reviewerId: string, project: string, onResult: (err: any, statusCode: number, PullRequestReviewer: GitInterfaces.IdentityRefWithVote) => void): void; - getPullRequestReviewers(repositoryId: string, pullRequestId: number, project: string, onResult: (err: any, statusCode: number, PullRequestReviewers: GitInterfaces.IdentityRefWithVote[]) => void): void; - getPullRequestsByProject(project: string, searchCriteria: GitInterfaces.GitPullRequestSearchCriteria, maxCommentLength: number, skip: number, top: number, onResult: (err: any, statusCode: number, PullRequests: GitInterfaces.GitPullRequest[]) => void): void; - createPullRequest(gitPullRequestToCreate: GitInterfaces.GitPullRequest, repositoryId: string, project: string, onResult: (err: any, statusCode: number, PullRequest: GitInterfaces.GitPullRequest) => void): void; - getPullRequest(repositoryId: string, pullRequestId: number, project: string, maxCommentLength: number, skip: number, top: number, includeCommits: boolean, onResult: (err: any, statusCode: number, PullRequest: GitInterfaces.GitPullRequest) => void): void; - getPullRequests(repositoryId: string, searchCriteria: GitInterfaces.GitPullRequestSearchCriteria, project: string, maxCommentLength: number, skip: number, top: number, onResult: (err: any, statusCode: number, PullRequests: GitInterfaces.GitPullRequest[]) => void): void; - updatePullRequest(gitPullRequestToUpdate: GitInterfaces.GitPullRequest, repositoryId: string, pullRequestId: number, project: string, onResult: (err: any, statusCode: number, PullRequest: GitInterfaces.GitPullRequest) => void): void; - getPullRequestWorkItems(repositoryId: string, pullRequestId: number, project: string, commitsTop: number, commitsSkip: number, onResult: (err: any, statusCode: number, PullRequestWorkItems: GitInterfaces.AssociatedWorkItem[]) => void): void; - createPush(push: GitInterfaces.GitPush, repositoryId: string, project: string, onResult: (err: any, statusCode: number, pushe: GitInterfaces.GitPush) => void): void; - getPush(repositoryId: string, pushId: number, project: string, includeCommits: number, includeRefUpdates: boolean, onResult: (err: any, statusCode: number, pushe: GitInterfaces.GitPush) => void): void; - getPushes(repositoryId: string, project: string, skip: number, top: number, searchCriteria: GitInterfaces.GitPushSearchCriteria, onResult: (err: any, statusCode: number, pushes: GitInterfaces.GitPush[]) => void): void; - getRefs(repositoryId: string, project: string, filter: string, includeLinks: boolean, onResult: (err: any, statusCode: number, refs: GitInterfaces.GitRef[]) => void): void; - updateRefs(refUpdates: GitInterfaces.GitRefUpdate[], repositoryId: string, project: string, projectId: string, onResult: (err: any, statusCode: number, refs: GitInterfaces.GitRefUpdateResult[]) => void): void; - createRepository(gitRepositoryToCreate: GitInterfaces.GitRepository, project: string, onResult: (err: any, statusCode: number, Repositorie: GitInterfaces.GitRepository) => void): void; - deleteRepository(repositoryId: string, project: string, onResult: (err: any, statusCode: number) => void): void; - getRepositories(project: string, includeLinks: boolean, onResult: (err: any, statusCode: number, Repositories: GitInterfaces.GitRepository[]) => void): void; - getRepository(repositoryId: string, project: string, onResult: (err: any, statusCode: number, Repositorie: GitInterfaces.GitRepository) => void): void; - updateRepository(newRepositoryInfo: GitInterfaces.GitRepository, repositoryId: string, project: string, onResult: (err: any, statusCode: number, Repositorie: GitInterfaces.GitRepository) => void): void; - createCommitStatus(gitCommitStatusToCreate: GitInterfaces.GitStatus, commitId: string, repositoryId: string, project: string, onResult: (err: any, statusCode: number, Statuse: GitInterfaces.GitStatus) => void): void; - getStatuses(commitId: string, repositoryId: string, project: string, top: number, skip: number, onResult: (err: any, statusCode: number, Statuses: GitInterfaces.GitStatus[]) => void): void; - getTree(repositoryId: string, sha1: string, project: string, projectId: string, recursive: boolean, fileName: string, onResult: (err: any, statusCode: number, Tree: GitInterfaces.GitTreeRef) => void): void; - getTreeZip(repositoryId: string, sha1: string, project: string, projectId: string, recursive: boolean, fileName: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - } - export interface IQGitApi extends basem.QClientApiBase { - getBlob(repositoryId: string, sha1: string, project?: string, download?: boolean, fileName?: string): Q.Promise; - getBlobContent(repositoryId: string, sha1: string, project?: string, download?: boolean, fileName?: string): Q.Promise; - getBlobsZip(blobIds: string[], repositoryId: string, project?: string, filename?: string): Q.Promise; - getBlobZip(repositoryId: string, sha1: string, project?: string, download?: boolean, fileName?: string): Q.Promise; - getBranch(repositoryId: string, name: string, project?: string, baseVersionDescriptor?: GitInterfaces.GitVersionDescriptor): Q.Promise; - getBranches(repositoryId: string, project?: string, baseVersionDescriptor?: GitInterfaces.GitVersionDescriptor): Q.Promise; - getChanges(commitId: string, repositoryId: string, project?: string, top?: number, skip?: number): Q.Promise; - getCommit(commitId: string, repositoryId: string, project?: string, changeCount?: number): Q.Promise; - getCommits(repositoryId: string, searchCriteria: GitInterfaces.GitQueryCommitsCriteria, project?: string, skip?: number, top?: number): Q.Promise; - getPushCommits(repositoryId: string, pushId: number, project?: string, top?: number, skip?: number, includeLinks?: boolean): Q.Promise; - getCommitsBatch(searchCriteria: GitInterfaces.GitQueryCommitsCriteria, repositoryId: string, project?: string, skip?: number, top?: number): Q.Promise; - getDeletedRepositories(project: string): Q.Promise; - getItem(repositoryId: string, path: string, project?: string, scopePath?: string, recursionLevel?: GitInterfaces.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, versionDescriptor?: GitInterfaces.GitVersionDescriptor): Q.Promise; - getItemContent(repositoryId: string, path: string, project?: string, scopePath?: string, recursionLevel?: GitInterfaces.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, versionDescriptor?: GitInterfaces.GitVersionDescriptor): Q.Promise; - getItems(repositoryId: string, project?: string, scopePath?: string, recursionLevel?: GitInterfaces.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, includeLinks?: boolean, versionDescriptor?: GitInterfaces.GitVersionDescriptor): Q.Promise; - getItemText(repositoryId: string, path: string, project?: string, scopePath?: string, recursionLevel?: GitInterfaces.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, versionDescriptor?: GitInterfaces.GitVersionDescriptor): Q.Promise; - getItemZip(repositoryId: string, path: string, project?: string, scopePath?: string, recursionLevel?: GitInterfaces.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, versionDescriptor?: GitInterfaces.GitVersionDescriptor): Q.Promise; - getItemsBatch(requestData: GitInterfaces.GitItemRequestData, repositoryId: string, project?: string): Q.Promise; - getPullRequestCommits(repositoryId: string, pullRequestId: number, project?: string): Q.Promise; - createPullRequestReviewer(reviewer: GitInterfaces.IdentityRefWithVote, repositoryId: string, pullRequestId: number, reviewerId: string, project?: string): Q.Promise; - createPullRequestReviewers(reviewers: VSSInterfaces.IdentityRef[], repositoryId: string, pullRequestId: number, project?: string): Q.Promise; - deletePullRequestReviewer(repositoryId: string, pullRequestId: number, reviewerId: string, project?: string): Q.Promise; - getPullRequestReviewer(repositoryId: string, pullRequestId: number, reviewerId: string, project?: string): Q.Promise; - getPullRequestReviewers(repositoryId: string, pullRequestId: number, project?: string): Q.Promise; - getPullRequestsByProject(project: string, searchCriteria: GitInterfaces.GitPullRequestSearchCriteria, maxCommentLength?: number, skip?: number, top?: number): Q.Promise; - createPullRequest(gitPullRequestToCreate: GitInterfaces.GitPullRequest, repositoryId: string, project?: string): Q.Promise; - getPullRequest(repositoryId: string, pullRequestId: number, project?: string, maxCommentLength?: number, skip?: number, top?: number, includeCommits?: boolean): Q.Promise; - getPullRequests(repositoryId: string, searchCriteria: GitInterfaces.GitPullRequestSearchCriteria, project?: string, maxCommentLength?: number, skip?: number, top?: number): Q.Promise; - updatePullRequest(gitPullRequestToUpdate: GitInterfaces.GitPullRequest, repositoryId: string, pullRequestId: number, project?: string): Q.Promise; - getPullRequestWorkItems(repositoryId: string, pullRequestId: number, project?: string, commitsTop?: number, commitsSkip?: number): Q.Promise; - createPush(push: GitInterfaces.GitPush, repositoryId: string, project?: string): Q.Promise; - getPush(repositoryId: string, pushId: number, project?: string, includeCommits?: number, includeRefUpdates?: boolean): Q.Promise; - getPushes(repositoryId: string, project?: string, skip?: number, top?: number, searchCriteria?: GitInterfaces.GitPushSearchCriteria): Q.Promise; - getRefs(repositoryId: string, project?: string, filter?: string, includeLinks?: boolean): Q.Promise; - updateRefs(refUpdates: GitInterfaces.GitRefUpdate[], repositoryId: string, project?: string, projectId?: string): Q.Promise; - createRepository(gitRepositoryToCreate: GitInterfaces.GitRepository, project?: string): Q.Promise; - deleteRepository(repositoryId: string, project?: string): Q.Promise; - getRepositories(project?: string, includeLinks?: boolean): Q.Promise; - getRepository(repositoryId: string, project?: string): Q.Promise; - updateRepository(newRepositoryInfo: GitInterfaces.GitRepository, repositoryId: string, project?: string): Q.Promise; - createCommitStatus(gitCommitStatusToCreate: GitInterfaces.GitStatus, commitId: string, repositoryId: string, project?: string): Q.Promise; - getStatuses(commitId: string, repositoryId: string, project?: string, top?: number, skip?: number): Q.Promise; - getTree(repositoryId: string, sha1: string, project?: string, projectId?: string, recursive?: boolean, fileName?: string): Q.Promise; - getTreeZip(repositoryId: string, sha1: string, project?: string, projectId?: string, recursive?: boolean, fileName?: string): Q.Promise; - } - export class GitApi extends basem.ClientApiBase implements IGitApi { - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]); - /** - * Gets a single blob. - * - * @param {string} repositoryId - * @param {string} sha1 - * @param {string} project - Project ID or project name - * @param {boolean} download - * @param {string} fileName - * @param onResult callback function with the resulting GitInterfaces.GitBlobRef - */ - getBlob(repositoryId: string, sha1: string, project: string, download: boolean, fileName: string, onResult: (err: any, statusCode: number, Blob: GitInterfaces.GitBlobRef) => void): void; - /** - * Gets a single blob. - * - * @param {string} repositoryId - * @param {string} sha1 - * @param {string} project - Project ID or project name - * @param {boolean} download - * @param {string} fileName - * @param onResult callback function with the resulting ArrayBuffer - */ - getBlobContent(repositoryId: string, sha1: string, project: string, download: boolean, fileName: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * Gets one or more blobs in a zip file download. - * - * @param {string[]} blobIds - * @param {string} repositoryId - * @param {string} project - Project ID or project name - * @param {string} filename - * @param onResult callback function with the resulting ArrayBuffer - */ - getBlobsZip(blobIds: string[], repositoryId: string, project: string, filename: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * Gets a single blob. - * - * @param {string} repositoryId - * @param {string} sha1 - * @param {string} project - Project ID or project name - * @param {boolean} download - * @param {string} fileName - * @param onResult callback function with the resulting ArrayBuffer - */ - getBlobZip(repositoryId: string, sha1: string, project: string, download: boolean, fileName: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * Retrieve statistics about a single branch. - * - * @param {string} repositoryId - Friendly name or guid of repository - * @param {string} name - Name of the branch - * @param {string} project - Project ID or project name - * @param {GitInterfaces.GitVersionDescriptor} baseVersionDescriptor - * @param onResult callback function with the resulting GitInterfaces.GitBranchStats - */ - getBranch(repositoryId: string, name: string, project: string, baseVersionDescriptor: GitInterfaces.GitVersionDescriptor, onResult: (err: any, statusCode: number, BranchStat: GitInterfaces.GitBranchStats) => void): void; - /** - * Retrieve statistics about all branches within a repository. - * - * @param {string} repositoryId - Friendly name or guid of repository - * @param {string} project - Project ID or project name - * @param {GitInterfaces.GitVersionDescriptor} baseVersionDescriptor - * @param onResult callback function with the resulting GitInterfaces.GitBranchStats[] - */ - getBranches(repositoryId: string, project: string, baseVersionDescriptor: GitInterfaces.GitVersionDescriptor, onResult: (err: any, statusCode: number, BranchStats: GitInterfaces.GitBranchStats[]) => void): void; - /** - * Retrieve changes for a particular commit. - * - * @param {string} commitId - The id of the commit. - * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - * @param {string} project - Project ID or project name - * @param {number} top - The maximum number of changes to return. - * @param {number} skip - The number of changes to skip. - * @param onResult callback function with the resulting GitInterfaces.GitCommitChanges - */ - getChanges(commitId: string, repositoryId: string, project: string, top: number, skip: number, onResult: (err: any, statusCode: number, Change: GitInterfaces.GitCommitChanges) => void): void; - /** - * Retrieve a particular commit. - * - * @param {string} commitId - The id of the commit. - * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - * @param {string} project - Project ID or project name - * @param {number} changeCount - The number of changes to include in the result. - * @param onResult callback function with the resulting GitInterfaces.GitCommit - */ - getCommit(commitId: string, repositoryId: string, project: string, changeCount: number, onResult: (err: any, statusCode: number, Commit: GitInterfaces.GitCommit) => void): void; - /** - * Retrieve git commits for a project - * - * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - * @param {GitInterfaces.GitQueryCommitsCriteria} searchCriteria - * @param {string} project - Project ID or project name - * @param {number} skip - * @param {number} top - * @param onResult callback function with the resulting GitInterfaces.GitCommitRef[] - */ - getCommits(repositoryId: string, searchCriteria: GitInterfaces.GitQueryCommitsCriteria, project: string, skip: number, top: number, onResult: (err: any, statusCode: number, Commits: GitInterfaces.GitCommitRef[]) => void): void; - /** - * Retrieve a list of commits associated with a particular push. - * - * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - * @param {number} pushId - The id of the push. - * @param {string} project - Project ID or project name - * @param {number} top - The maximum number of commits to return ("get the top x commits"). - * @param {number} skip - The number of commits to skip. - * @param {boolean} includeLinks - * @param onResult callback function with the resulting GitInterfaces.GitCommitRef[] - */ - getPushCommits(repositoryId: string, pushId: number, project: string, top: number, skip: number, includeLinks: boolean, onResult: (err: any, statusCode: number, Commits: GitInterfaces.GitCommitRef[]) => void): void; - /** - * Retrieve git commits for a project - * - * @param {GitInterfaces.GitQueryCommitsCriteria} searchCriteria - Search options - * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - * @param {string} project - Project ID or project name - * @param {number} skip - * @param {number} top - * @param onResult callback function with the resulting GitInterfaces.GitCommitRef[] - */ - getCommitsBatch(searchCriteria: GitInterfaces.GitQueryCommitsCriteria, repositoryId: string, project: string, skip: number, top: number, onResult: (err: any, statusCode: number, CommitsBatch: GitInterfaces.GitCommitRef[]) => void): void; - /** - * Retrieve deleted git repositories. - * - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting GitInterfaces.GitDeletedRepository[] - */ - getDeletedRepositories(project: string, onResult: (err: any, statusCode: number, DeletedRepositories: GitInterfaces.GitDeletedRepository[]) => void): void; - /** - * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. - * - * @param {string} repositoryId - * @param {string} path - * @param {string} project - Project ID or project name - * @param {string} scopePath - * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - * @param {boolean} includeContentMetadata - * @param {boolean} latestProcessedChange - * @param {boolean} download - * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - * @param onResult callback function with the resulting GitInterfaces.GitItem - */ - getItem(repositoryId: string, path: string, project: string, scopePath: string, recursionLevel: GitInterfaces.VersionControlRecursionType, includeContentMetadata: boolean, latestProcessedChange: boolean, download: boolean, versionDescriptor: GitInterfaces.GitVersionDescriptor, onResult: (err: any, statusCode: number, Item: GitInterfaces.GitItem) => void): void; - /** - * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. - * - * @param {string} repositoryId - * @param {string} path - * @param {string} project - Project ID or project name - * @param {string} scopePath - * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - * @param {boolean} includeContentMetadata - * @param {boolean} latestProcessedChange - * @param {boolean} download - * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - * @param onResult callback function with the resulting ArrayBuffer - */ - getItemContent(repositoryId: string, path: string, project: string, scopePath: string, recursionLevel: GitInterfaces.VersionControlRecursionType, includeContentMetadata: boolean, latestProcessedChange: boolean, download: boolean, versionDescriptor: GitInterfaces.GitVersionDescriptor, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * Get Item Metadata and/or Content for a collection of items. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. - * - * @param {string} repositoryId - * @param {string} project - Project ID or project name - * @param {string} scopePath - * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - * @param {boolean} includeContentMetadata - * @param {boolean} latestProcessedChange - * @param {boolean} download - * @param {boolean} includeLinks - * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - * @param onResult callback function with the resulting GitInterfaces.GitItem[] - */ - getItems(repositoryId: string, project: string, scopePath: string, recursionLevel: GitInterfaces.VersionControlRecursionType, includeContentMetadata: boolean, latestProcessedChange: boolean, download: boolean, includeLinks: boolean, versionDescriptor: GitInterfaces.GitVersionDescriptor, onResult: (err: any, statusCode: number, Items: GitInterfaces.GitItem[]) => void): void; - /** - * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. - * - * @param {string} repositoryId - * @param {string} path - * @param {string} project - Project ID or project name - * @param {string} scopePath - * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - * @param {boolean} includeContentMetadata - * @param {boolean} latestProcessedChange - * @param {boolean} download - * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - * @param onResult callback function with the resulting string - */ - getItemText(repositoryId: string, path: string, project: string, scopePath: string, recursionLevel: GitInterfaces.VersionControlRecursionType, includeContentMetadata: boolean, latestProcessedChange: boolean, download: boolean, versionDescriptor: GitInterfaces.GitVersionDescriptor, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. - * - * @param {string} repositoryId - * @param {string} path - * @param {string} project - Project ID or project name - * @param {string} scopePath - * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - * @param {boolean} includeContentMetadata - * @param {boolean} latestProcessedChange - * @param {boolean} download - * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - * @param onResult callback function with the resulting ArrayBuffer - */ - getItemZip(repositoryId: string, path: string, project: string, scopePath: string, recursionLevel: GitInterfaces.VersionControlRecursionType, includeContentMetadata: boolean, latestProcessedChange: boolean, download: boolean, versionDescriptor: GitInterfaces.GitVersionDescriptor, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * Post for retrieving a creating a batch out of a set of items in a repo / project given a list of paths or a long path - * - * @param {GitInterfaces.GitItemRequestData} requestData - * @param {string} repositoryId - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting GitInterfaces.GitItem[][] - */ - getItemsBatch(requestData: GitInterfaces.GitItemRequestData, repositoryId: string, project: string, onResult: (err: any, statusCode: number, ItemsBatch: GitInterfaces.GitItem[][]) => void): void; - /** - * Retrieve pull request's commits - * - * @param {string} repositoryId - * @param {number} pullRequestId - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting GitInterfaces.GitCommitRef[] - */ - getPullRequestCommits(repositoryId: string, pullRequestId: number, project: string, onResult: (err: any, statusCode: number, PullRequestCommits: GitInterfaces.GitCommitRef[]) => void): void; - /** - * Adds a reviewer to a git pull request - * - * @param {GitInterfaces.IdentityRefWithVote} reviewer - * @param {string} repositoryId - * @param {number} pullRequestId - * @param {string} reviewerId - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting GitInterfaces.IdentityRefWithVote - */ - createPullRequestReviewer(reviewer: GitInterfaces.IdentityRefWithVote, repositoryId: string, pullRequestId: number, reviewerId: string, project: string, onResult: (err: any, statusCode: number, PullRequestReviewer: GitInterfaces.IdentityRefWithVote) => void): void; - /** - * Adds reviewers to a git pull request - * - * @param {VSSInterfaces.IdentityRef[]} reviewers - * @param {string} repositoryId - * @param {number} pullRequestId - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting GitInterfaces.IdentityRefWithVote[] - */ - createPullRequestReviewers(reviewers: VSSInterfaces.IdentityRef[], repositoryId: string, pullRequestId: number, project: string, onResult: (err: any, statusCode: number, PullRequestReviewers: GitInterfaces.IdentityRefWithVote[]) => void): void; - /** - * Adds reviewers to a git pull request - * - * @param {string} repositoryId - * @param {number} pullRequestId - * @param {string} reviewerId - * @param {string} project - Project ID or project name - * @param onResult callback function - */ - deletePullRequestReviewer(repositoryId: string, pullRequestId: number, reviewerId: string, project: string, onResult: (err: any, statusCode: number) => void): void; - /** - * Retrieve a reviewer from a pull request - * - * @param {string} repositoryId - * @param {number} pullRequestId - * @param {string} reviewerId - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting GitInterfaces.IdentityRefWithVote - */ - getPullRequestReviewer(repositoryId: string, pullRequestId: number, reviewerId: string, project: string, onResult: (err: any, statusCode: number, PullRequestReviewer: GitInterfaces.IdentityRefWithVote) => void): void; - /** - * Retrieve a pull request reviewers - * - * @param {string} repositoryId - * @param {number} pullRequestId - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting GitInterfaces.IdentityRefWithVote[] - */ - getPullRequestReviewers(repositoryId: string, pullRequestId: number, project: string, onResult: (err: any, statusCode: number, PullRequestReviewers: GitInterfaces.IdentityRefWithVote[]) => void): void; - /** - * Query pull requests by project - * - * @param {string} project - Project ID or project name - * @param {GitInterfaces.GitPullRequestSearchCriteria} searchCriteria - * @param {number} maxCommentLength - * @param {number} skip - * @param {number} top - * @param onResult callback function with the resulting GitInterfaces.GitPullRequest[] - */ - getPullRequestsByProject(project: string, searchCriteria: GitInterfaces.GitPullRequestSearchCriteria, maxCommentLength: number, skip: number, top: number, onResult: (err: any, statusCode: number, PullRequests: GitInterfaces.GitPullRequest[]) => void): void; - /** - * Create a git pull request - * - * @param {GitInterfaces.GitPullRequest} gitPullRequestToCreate - * @param {string} repositoryId - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting GitInterfaces.GitPullRequest - */ - createPullRequest(gitPullRequestToCreate: GitInterfaces.GitPullRequest, repositoryId: string, project: string, onResult: (err: any, statusCode: number, PullRequest: GitInterfaces.GitPullRequest) => void): void; - /** - * Retrieve a pull request - * - * @param {string} repositoryId - * @param {number} pullRequestId - * @param {string} project - Project ID or project name - * @param {number} maxCommentLength - * @param {number} skip - * @param {number} top - * @param {boolean} includeCommits - * @param onResult callback function with the resulting GitInterfaces.GitPullRequest - */ - getPullRequest(repositoryId: string, pullRequestId: number, project: string, maxCommentLength: number, skip: number, top: number, includeCommits: boolean, onResult: (err: any, statusCode: number, PullRequest: GitInterfaces.GitPullRequest) => void): void; - /** - * Query for pull requests - * - * @param {string} repositoryId - * @param {GitInterfaces.GitPullRequestSearchCriteria} searchCriteria - * @param {string} project - Project ID or project name - * @param {number} maxCommentLength - * @param {number} skip - * @param {number} top - * @param onResult callback function with the resulting GitInterfaces.GitPullRequest[] - */ - getPullRequests(repositoryId: string, searchCriteria: GitInterfaces.GitPullRequestSearchCriteria, project: string, maxCommentLength: number, skip: number, top: number, onResult: (err: any, statusCode: number, PullRequests: GitInterfaces.GitPullRequest[]) => void): void; - /** - * Updates a pull request - * - * @param {GitInterfaces.GitPullRequest} gitPullRequestToUpdate - * @param {string} repositoryId - * @param {number} pullRequestId - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting GitInterfaces.GitPullRequest - */ - updatePullRequest(gitPullRequestToUpdate: GitInterfaces.GitPullRequest, repositoryId: string, pullRequestId: number, project: string, onResult: (err: any, statusCode: number, PullRequest: GitInterfaces.GitPullRequest) => void): void; - /** - * Retrieve a pull request work items - * - * @param {string} repositoryId - * @param {number} pullRequestId - * @param {string} project - Project ID or project name - * @param {number} commitsTop - * @param {number} commitsSkip - * @param onResult callback function with the resulting GitInterfaces.AssociatedWorkItem[] - */ - getPullRequestWorkItems(repositoryId: string, pullRequestId: number, project: string, commitsTop: number, commitsSkip: number, onResult: (err: any, statusCode: number, PullRequestWorkItems: GitInterfaces.AssociatedWorkItem[]) => void): void; - /** - * Push changes to the repository. - * - * @param {GitInterfaces.GitPush} push - * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, a project-scoped route must be used. - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting GitInterfaces.GitPush - */ - createPush(push: GitInterfaces.GitPush, repositoryId: string, project: string, onResult: (err: any, statusCode: number, pushe: GitInterfaces.GitPush) => void): void; - /** - * Retrieve a particular push. - * - * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - * @param {number} pushId - The id of the push. - * @param {string} project - Project ID or project name - * @param {number} includeCommits - The number of commits to include in the result. - * @param {boolean} includeRefUpdates - * @param onResult callback function with the resulting GitInterfaces.GitPush - */ - getPush(repositoryId: string, pushId: number, project: string, includeCommits: number, includeRefUpdates: boolean, onResult: (err: any, statusCode: number, pushe: GitInterfaces.GitPush) => void): void; - /** - * Retrieves pushes associated with the specified repository. - * - * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - * @param {string} project - Project ID or project name - * @param {number} skip - * @param {number} top - * @param {GitInterfaces.GitPushSearchCriteria} searchCriteria - * @param onResult callback function with the resulting GitInterfaces.GitPush[] - */ - getPushes(repositoryId: string, project: string, skip: number, top: number, searchCriteria: GitInterfaces.GitPushSearchCriteria, onResult: (err: any, statusCode: number, pushes: GitInterfaces.GitPush[]) => void): void; - /** - * Queries the provided repository for its refs and returns them. - * - * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - * @param {string} project - Project ID or project name - * @param {string} filter - [optional] A filter to apply to the refs. - * @param {boolean} includeLinks - [optional] Specifies if referenceLinks should be included in the result. default is false. - * @param onResult callback function with the resulting GitInterfaces.GitRef[] - */ - getRefs(repositoryId: string, project: string, filter: string, includeLinks: boolean, onResult: (err: any, statusCode: number, refs: GitInterfaces.GitRef[]) => void): void; - /** - * Creates or updates refs with the given information - * - * @param {GitInterfaces.GitRefUpdate[]} refUpdates - List of ref updates to attempt to perform - * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - * @param {string} project - Project ID or project name - * @param {string} projectId - The id of the project. - * @param onResult callback function with the resulting GitInterfaces.GitRefUpdateResult[] - */ - updateRefs(refUpdates: GitInterfaces.GitRefUpdate[], repositoryId: string, project: string, projectId: string, onResult: (err: any, statusCode: number, refs: GitInterfaces.GitRefUpdateResult[]) => void): void; - /** - * Create a git repository - * - * @param {GitInterfaces.GitRepository} gitRepositoryToCreate - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting GitInterfaces.GitRepository - */ - createRepository(gitRepositoryToCreate: GitInterfaces.GitRepository, project: string, onResult: (err: any, statusCode: number, Repositorie: GitInterfaces.GitRepository) => void): void; - /** - * Delete a git repository - * - * @param {string} repositoryId - * @param {string} project - Project ID or project name - * @param onResult callback function - */ - deleteRepository(repositoryId: string, project: string, onResult: (err: any, statusCode: number) => void): void; - /** - * Retrieve git repositories. - * - * @param {string} project - Project ID or project name - * @param {boolean} includeLinks - * @param onResult callback function with the resulting GitInterfaces.GitRepository[] - */ - getRepositories(project: string, includeLinks: boolean, onResult: (err: any, statusCode: number, Repositories: GitInterfaces.GitRepository[]) => void): void; - /** - * @param {string} repositoryId - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting GitInterfaces.GitRepository - */ - getRepository(repositoryId: string, project: string, onResult: (err: any, statusCode: number, Repositorie: GitInterfaces.GitRepository) => void): void; - /** - * Updates the Git repository with the single populated change in the specified repository information. - * - * @param {GitInterfaces.GitRepository} newRepositoryInfo - * @param {string} repositoryId - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting GitInterfaces.GitRepository - */ - updateRepository(newRepositoryInfo: GitInterfaces.GitRepository, repositoryId: string, project: string, onResult: (err: any, statusCode: number, Repositorie: GitInterfaces.GitRepository) => void): void; - /** - * @param {GitInterfaces.GitStatus} gitCommitStatusToCreate - * @param {string} commitId - * @param {string} repositoryId - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting GitInterfaces.GitStatus - */ - createCommitStatus(gitCommitStatusToCreate: GitInterfaces.GitStatus, commitId: string, repositoryId: string, project: string, onResult: (err: any, statusCode: number, Statuse: GitInterfaces.GitStatus) => void): void; - /** - * @param {string} commitId - * @param {string} repositoryId - * @param {string} project - Project ID or project name - * @param {number} top - * @param {number} skip - * @param onResult callback function with the resulting GitInterfaces.GitStatus[] - */ - getStatuses(commitId: string, repositoryId: string, project: string, top: number, skip: number, onResult: (err: any, statusCode: number, Statuses: GitInterfaces.GitStatus[]) => void): void; - /** - * @param {string} repositoryId - * @param {string} sha1 - * @param {string} project - Project ID or project name - * @param {string} projectId - * @param {boolean} recursive - * @param {string} fileName - * @param onResult callback function with the resulting GitInterfaces.GitTreeRef - */ - getTree(repositoryId: string, sha1: string, project: string, projectId: string, recursive: boolean, fileName: string, onResult: (err: any, statusCode: number, Tree: GitInterfaces.GitTreeRef) => void): void; - /** - * @param {string} repositoryId - * @param {string} sha1 - * @param {string} project - Project ID or project name - * @param {string} projectId - * @param {boolean} recursive - * @param {string} fileName - * @param onResult callback function with the resulting ArrayBuffer - */ - getTreeZip(repositoryId: string, sha1: string, project: string, projectId: string, recursive: boolean, fileName: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - } - export class QGitApi extends basem.QClientApiBase implements IQGitApi { - api: GitApi; - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]); - /** - * Gets a single blob. - * - * @param {string} repositoryId - * @param {string} sha1 - * @param {string} project - Project ID or project name - * @param {boolean} download - * @param {string} fileName - */ - getBlob(repositoryId: string, sha1: string, project?: string, download?: boolean, fileName?: string): Q.Promise; - /** - * Gets a single blob. - * - * @param {string} repositoryId - * @param {string} sha1 - * @param {string} project - Project ID or project name - * @param {boolean} download - * @param {string} fileName - */ - getBlobContent(repositoryId: string, sha1: string, project?: string, download?: boolean, fileName?: string): Q.Promise; - /** - * Gets one or more blobs in a zip file download. - * - * @param {string[]} blobIds - * @param {string} repositoryId - * @param {string} project - Project ID or project name - * @param {string} filename - */ - getBlobsZip(blobIds: string[], repositoryId: string, project?: string, filename?: string): Q.Promise; - /** - * Gets a single blob. - * - * @param {string} repositoryId - * @param {string} sha1 - * @param {string} project - Project ID or project name - * @param {boolean} download - * @param {string} fileName - */ - getBlobZip(repositoryId: string, sha1: string, project?: string, download?: boolean, fileName?: string): Q.Promise; - /** - * Retrieve statistics about a single branch. - * - * @param {string} repositoryId - Friendly name or guid of repository - * @param {string} name - Name of the branch - * @param {string} project - Project ID or project name - * @param {GitInterfaces.GitVersionDescriptor} baseVersionDescriptor - */ - getBranch(repositoryId: string, name: string, project?: string, baseVersionDescriptor?: GitInterfaces.GitVersionDescriptor): Q.Promise; - /** - * Retrieve statistics about all branches within a repository. - * - * @param {string} repositoryId - Friendly name or guid of repository - * @param {string} project - Project ID or project name - * @param {GitInterfaces.GitVersionDescriptor} baseVersionDescriptor - */ - getBranches(repositoryId: string, project?: string, baseVersionDescriptor?: GitInterfaces.GitVersionDescriptor): Q.Promise; - /** - * Retrieve changes for a particular commit. - * - * @param {string} commitId - The id of the commit. - * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - * @param {string} project - Project ID or project name - * @param {number} top - The maximum number of changes to return. - * @param {number} skip - The number of changes to skip. - */ - getChanges(commitId: string, repositoryId: string, project?: string, top?: number, skip?: number): Q.Promise; - /** - * Retrieve a particular commit. - * - * @param {string} commitId - The id of the commit. - * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - * @param {string} project - Project ID or project name - * @param {number} changeCount - The number of changes to include in the result. - */ - getCommit(commitId: string, repositoryId: string, project?: string, changeCount?: number): Q.Promise; - /** - * Retrieve git commits for a project - * - * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - * @param {GitInterfaces.GitQueryCommitsCriteria} searchCriteria - * @param {string} project - Project ID or project name - * @param {number} skip - * @param {number} top - */ - getCommits(repositoryId: string, searchCriteria: GitInterfaces.GitQueryCommitsCriteria, project?: string, skip?: number, top?: number): Q.Promise; - /** - * Retrieve a list of commits associated with a particular push. - * - * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - * @param {number} pushId - The id of the push. - * @param {string} project - Project ID or project name - * @param {number} top - The maximum number of commits to return ("get the top x commits"). - * @param {number} skip - The number of commits to skip. - * @param {boolean} includeLinks - */ - getPushCommits(repositoryId: string, pushId: number, project?: string, top?: number, skip?: number, includeLinks?: boolean): Q.Promise; - /** - * Retrieve git commits for a project - * - * @param {GitInterfaces.GitQueryCommitsCriteria} searchCriteria - Search options - * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - * @param {string} project - Project ID or project name - * @param {number} skip - * @param {number} top - */ - getCommitsBatch(searchCriteria: GitInterfaces.GitQueryCommitsCriteria, repositoryId: string, project?: string, skip?: number, top?: number): Q.Promise; - /** - * Retrieve deleted git repositories. - * - * @param {string} project - Project ID or project name - */ - getDeletedRepositories(project: string): Q.Promise; - /** - * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. - * - * @param {string} repositoryId - * @param {string} path - * @param {string} project - Project ID or project name - * @param {string} scopePath - * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - * @param {boolean} includeContentMetadata - * @param {boolean} latestProcessedChange - * @param {boolean} download - * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - */ - getItem(repositoryId: string, path: string, project?: string, scopePath?: string, recursionLevel?: GitInterfaces.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, versionDescriptor?: GitInterfaces.GitVersionDescriptor): Q.Promise; - /** - * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. - * - * @param {string} repositoryId - * @param {string} path - * @param {string} project - Project ID or project name - * @param {string} scopePath - * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - * @param {boolean} includeContentMetadata - * @param {boolean} latestProcessedChange - * @param {boolean} download - * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - */ - getItemContent(repositoryId: string, path: string, project?: string, scopePath?: string, recursionLevel?: GitInterfaces.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, versionDescriptor?: GitInterfaces.GitVersionDescriptor): Q.Promise; - /** - * Get Item Metadata and/or Content for a collection of items. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. - * - * @param {string} repositoryId - * @param {string} project - Project ID or project name - * @param {string} scopePath - * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - * @param {boolean} includeContentMetadata - * @param {boolean} latestProcessedChange - * @param {boolean} download - * @param {boolean} includeLinks - * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - */ - getItems(repositoryId: string, project?: string, scopePath?: string, recursionLevel?: GitInterfaces.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, includeLinks?: boolean, versionDescriptor?: GitInterfaces.GitVersionDescriptor): Q.Promise; - /** - * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. - * - * @param {string} repositoryId - * @param {string} path - * @param {string} project - Project ID or project name - * @param {string} scopePath - * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - * @param {boolean} includeContentMetadata - * @param {boolean} latestProcessedChange - * @param {boolean} download - * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - */ - getItemText(repositoryId: string, path: string, project?: string, scopePath?: string, recursionLevel?: GitInterfaces.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, versionDescriptor?: GitInterfaces.GitVersionDescriptor): Q.Promise; - /** - * Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. - * - * @param {string} repositoryId - * @param {string} path - * @param {string} project - Project ID or project name - * @param {string} scopePath - * @param {GitInterfaces.VersionControlRecursionType} recursionLevel - * @param {boolean} includeContentMetadata - * @param {boolean} latestProcessedChange - * @param {boolean} download - * @param {GitInterfaces.GitVersionDescriptor} versionDescriptor - */ - getItemZip(repositoryId: string, path: string, project?: string, scopePath?: string, recursionLevel?: GitInterfaces.VersionControlRecursionType, includeContentMetadata?: boolean, latestProcessedChange?: boolean, download?: boolean, versionDescriptor?: GitInterfaces.GitVersionDescriptor): Q.Promise; - /** - * Post for retrieving a creating a batch out of a set of items in a repo / project given a list of paths or a long path - * - * @param {GitInterfaces.GitItemRequestData} requestData - * @param {string} repositoryId - * @param {string} project - Project ID or project name - */ - getItemsBatch(requestData: GitInterfaces.GitItemRequestData, repositoryId: string, project?: string): Q.Promise; - /** - * Retrieve pull request's commits - * - * @param {string} repositoryId - * @param {number} pullRequestId - * @param {string} project - Project ID or project name - */ - getPullRequestCommits(repositoryId: string, pullRequestId: number, project?: string): Q.Promise; - /** - * Adds a reviewer to a git pull request - * - * @param {GitInterfaces.IdentityRefWithVote} reviewer - * @param {string} repositoryId - * @param {number} pullRequestId - * @param {string} reviewerId - * @param {string} project - Project ID or project name - */ - createPullRequestReviewer(reviewer: GitInterfaces.IdentityRefWithVote, repositoryId: string, pullRequestId: number, reviewerId: string, project?: string): Q.Promise; - /** - * Adds reviewers to a git pull request - * - * @param {VSSInterfaces.IdentityRef[]} reviewers - * @param {string} repositoryId - * @param {number} pullRequestId - * @param {string} project - Project ID or project name - */ - createPullRequestReviewers(reviewers: VSSInterfaces.IdentityRef[], repositoryId: string, pullRequestId: number, project?: string): Q.Promise; - /** - * Adds reviewers to a git pull request - * - * @param {string} repositoryId - * @param {number} pullRequestId - * @param {string} reviewerId - * @param {string} project - Project ID or project name - */ - deletePullRequestReviewer(repositoryId: string, pullRequestId: number, reviewerId: string, project?: string): Q.Promise; - /** - * Retrieve a reviewer from a pull request - * - * @param {string} repositoryId - * @param {number} pullRequestId - * @param {string} reviewerId - * @param {string} project - Project ID or project name - */ - getPullRequestReviewer(repositoryId: string, pullRequestId: number, reviewerId: string, project?: string): Q.Promise; - /** - * Retrieve a pull request reviewers - * - * @param {string} repositoryId - * @param {number} pullRequestId - * @param {string} project - Project ID or project name - */ - getPullRequestReviewers(repositoryId: string, pullRequestId: number, project?: string): Q.Promise; - /** - * Query pull requests by project - * - * @param {string} project - Project ID or project name - * @param {GitInterfaces.GitPullRequestSearchCriteria} searchCriteria - * @param {number} maxCommentLength - * @param {number} skip - * @param {number} top - */ - getPullRequestsByProject(project: string, searchCriteria: GitInterfaces.GitPullRequestSearchCriteria, maxCommentLength?: number, skip?: number, top?: number): Q.Promise; - /** - * Create a git pull request - * - * @param {GitInterfaces.GitPullRequest} gitPullRequestToCreate - * @param {string} repositoryId - * @param {string} project - Project ID or project name - */ - createPullRequest(gitPullRequestToCreate: GitInterfaces.GitPullRequest, repositoryId: string, project?: string): Q.Promise; - /** - * Retrieve a pull request - * - * @param {string} repositoryId - * @param {number} pullRequestId - * @param {string} project - Project ID or project name - * @param {number} maxCommentLength - * @param {number} skip - * @param {number} top - * @param {boolean} includeCommits - */ - getPullRequest(repositoryId: string, pullRequestId: number, project?: string, maxCommentLength?: number, skip?: number, top?: number, includeCommits?: boolean): Q.Promise; - /** - * Query for pull requests - * - * @param {string} repositoryId - * @param {GitInterfaces.GitPullRequestSearchCriteria} searchCriteria - * @param {string} project - Project ID or project name - * @param {number} maxCommentLength - * @param {number} skip - * @param {number} top - */ - getPullRequests(repositoryId: string, searchCriteria: GitInterfaces.GitPullRequestSearchCriteria, project?: string, maxCommentLength?: number, skip?: number, top?: number): Q.Promise; - /** - * Updates a pull request - * - * @param {GitInterfaces.GitPullRequest} gitPullRequestToUpdate - * @param {string} repositoryId - * @param {number} pullRequestId - * @param {string} project - Project ID or project name - */ - updatePullRequest(gitPullRequestToUpdate: GitInterfaces.GitPullRequest, repositoryId: string, pullRequestId: number, project?: string): Q.Promise; - /** - * Retrieve a pull request work items - * - * @param {string} repositoryId - * @param {number} pullRequestId - * @param {string} project - Project ID or project name - * @param {number} commitsTop - * @param {number} commitsSkip - */ - getPullRequestWorkItems(repositoryId: string, pullRequestId: number, project?: string, commitsTop?: number, commitsSkip?: number): Q.Promise; - /** - * Push changes to the repository. - * - * @param {GitInterfaces.GitPush} push - * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, a project-scoped route must be used. - * @param {string} project - Project ID or project name - */ - createPush(push: GitInterfaces.GitPush, repositoryId: string, project?: string): Q.Promise; - /** - * Retrieve a particular push. - * - * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - * @param {number} pushId - The id of the push. - * @param {string} project - Project ID or project name - * @param {number} includeCommits - The number of commits to include in the result. - * @param {boolean} includeRefUpdates - */ - getPush(repositoryId: string, pushId: number, project?: string, includeCommits?: number, includeRefUpdates?: boolean): Q.Promise; - /** - * Retrieves pushes associated with the specified repository. - * - * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - * @param {string} project - Project ID or project name - * @param {number} skip - * @param {number} top - * @param {GitInterfaces.GitPushSearchCriteria} searchCriteria - */ - getPushes(repositoryId: string, project?: string, skip?: number, top?: number, searchCriteria?: GitInterfaces.GitPushSearchCriteria): Q.Promise; - /** - * Queries the provided repository for its refs and returns them. - * - * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - * @param {string} project - Project ID or project name - * @param {string} filter - [optional] A filter to apply to the refs. - * @param {boolean} includeLinks - [optional] Specifies if referenceLinks should be included in the result. default is false. - */ - getRefs(repositoryId: string, project?: string, filter?: string, includeLinks?: boolean): Q.Promise; - /** - * Creates or updates refs with the given information - * - * @param {GitInterfaces.GitRefUpdate[]} refUpdates - List of ref updates to attempt to perform - * @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified. - * @param {string} project - Project ID or project name - * @param {string} projectId - The id of the project. - */ - updateRefs(refUpdates: GitInterfaces.GitRefUpdate[], repositoryId: string, project?: string, projectId?: string): Q.Promise; - /** - * Create a git repository - * - * @param {GitInterfaces.GitRepository} gitRepositoryToCreate - * @param {string} project - Project ID or project name - */ - createRepository(gitRepositoryToCreate: GitInterfaces.GitRepository, project?: string): Q.Promise; - /** - * Delete a git repository - * - * @param {string} repositoryId - * @param {string} project - Project ID or project name - */ - deleteRepository(repositoryId: string, project?: string): Q.Promise; - /** - * Retrieve git repositories. - * - * @param {string} project - Project ID or project name - * @param {boolean} includeLinks - */ - getRepositories(project?: string, includeLinks?: boolean): Q.Promise; - /** - * @param {string} repositoryId - * @param {string} project - Project ID or project name - */ - getRepository(repositoryId: string, project?: string): Q.Promise; - /** - * Updates the Git repository with the single populated change in the specified repository information. - * - * @param {GitInterfaces.GitRepository} newRepositoryInfo - * @param {string} repositoryId - * @param {string} project - Project ID or project name - */ - updateRepository(newRepositoryInfo: GitInterfaces.GitRepository, repositoryId: string, project?: string): Q.Promise; - /** - * @param {GitInterfaces.GitStatus} gitCommitStatusToCreate - * @param {string} commitId - * @param {string} repositoryId - * @param {string} project - Project ID or project name - */ - createCommitStatus(gitCommitStatusToCreate: GitInterfaces.GitStatus, commitId: string, repositoryId: string, project?: string): Q.Promise; - /** - * @param {string} commitId - * @param {string} repositoryId - * @param {string} project - Project ID or project name - * @param {number} top - * @param {number} skip - */ - getStatuses(commitId: string, repositoryId: string, project?: string, top?: number, skip?: number): Q.Promise; - /** - * @param {string} repositoryId - * @param {string} sha1 - * @param {string} project - Project ID or project name - * @param {string} projectId - * @param {boolean} recursive - * @param {string} fileName - */ - getTree(repositoryId: string, sha1: string, project?: string, projectId?: string, recursive?: boolean, fileName?: string): Q.Promise; - /** - * @param {string} repositoryId - * @param {string} sha1 - * @param {string} project - Project ID or project name - * @param {string} projectId - * @param {boolean} recursive - * @param {string} fileName - */ - getTreeZip(repositoryId: string, sha1: string, project?: string, projectId?: string, recursive?: boolean, fileName?: string): Q.Promise; - } - -} -declare module 'vso-node-api/interfaces/common/FormInputInterfaces' { - export enum InputDataType { - /** - * No data type is specified. - */ - None = 0, - /** - * Represents a textual value. - */ - String = 10, - /** - * Represents a numberic value. - */ - Number = 20, - /** - * Represents a value of true or false. - */ - Boolean = 30, - /** - * Represents a Guid. - */ - Guid = 40, - /** - * Represents a URI. - */ - Uri = 50, - } - /** - * Describes an input for subscriptions. - */ - export interface InputDescriptor { - /** - * The ids of all inputs that the value of this input is dependent on. - */ - dependencyInputIds: string[]; - /** - * Description of what this input is used for - */ - description: string; - /** - * The group localized name to which this input belongs and can be shown as a header for the container that will include all the inputs in the group. - */ - groupName: string; - /** - * If true, the value information for this input is dynamic and should be fetched when the value of dependency inputs change. - */ - hasDynamicValueInformation: boolean; - /** - * Identifier for the subscription input - */ - id: string; - /** - * Mode in which the value of this input should be entered - */ - inputMode: InputMode; - /** - * Gets whether this input is confidential, such as for a password or application key - */ - isConfidential: boolean; - /** - * Localized name which can be shown as a label for the subscription input - */ - name: string; - /** - * Gets whether this input is included in the default generated action description. - */ - useInDefaultDescription: boolean; - /** - * Information to use to validate this input's value - */ - validation: InputValidation; - /** - * A hint for input value. It can be used in the UI as the input placeholder. - */ - valueHint: string; - /** - * Information about possible values for this input - */ - values: InputValues; - } - /** - * Defines a filter for subscription inputs. The filter matches a set of inputs if any (one or more) of the groups evaluates to true. - */ - export interface InputFilter { - /** - * Groups of input filter expressions. This filter matches a set of inputs if any (one or more) of the groups evaluates to true. - */ - conditions: InputFilterCondition[]; - } - /** - * An expression which can be applied to filter a list of subscription inputs - */ - export interface InputFilterCondition { - /** - * Whether or not to do a case sensitive match - */ - caseSensitive: boolean; - /** - * The Id of the input to filter on - */ - inputId: string; - /** - * The "expected" input value to compare with the actual input value - */ - inputValue: string; - /** - * The operator applied between the expected and actual input value - */ - operator: InputFilterOperator; - } - export enum InputFilterOperator { - Equals = 0, - NotEquals = 1, - } - export enum InputMode { - /** - * This input should not be shown in the UI - */ - None = 0, - /** - * An input text box should be shown - */ - TextBox = 10, - /** - * An password input box should be shown - */ - PasswordBox = 20, - /** - * A select/combo control should be shown - */ - Combo = 30, - /** - * Radio buttons should be shown - */ - RadioButtons = 40, - /** - * Checkbox should be shown(for true/false values) - */ - CheckBox = 50, - /** - * A multi-line text area should be shown - */ - TextArea = 60, - } - /** - * Describes what values are valid for a subscription input - */ - export interface InputValidation { - dataType: InputDataType; - isRequired: boolean; - maxLength: number; - maxValue: number; - minLength: number; - minValue: number; - pattern: string; - patternMismatchErrorMessage: string; - } - /** - * Information about a single value for an input - */ - export interface InputValue { - /** - * Any other data about this input - */ - data: { - [key: string]: any; - }; - /** - * The text to show for the display of this value - */ - displayValue: string; - /** - * The value to store for this input - */ - value: string; - } - /** - * Information about the possible/allowed values for a given subscription input - */ - export interface InputValues { - /** - * The default value to use for this input - */ - defaultValue: string; - /** - * Errors encountered while computing dynamic values. - */ - error: InputValuesError; - /** - * The id of the input - */ - inputId: string; - /** - * Should this input be disabled - */ - isDisabled: boolean; - /** - * Should the value be restricted to one of the values in the PossibleValues (True) or are the values in PossibleValues just a suggestion (False) - */ - isLimitedToPossibleValues: boolean; - /** - * Should this input be made read-only - */ - isReadOnly: boolean; - /** - * Possible values that this input can take - */ - possibleValues: InputValue[]; - } - /** - * Error information related to a subscription input value. - */ - export interface InputValuesError { - /** - * The error message. - */ - message: string; - } - export interface InputValuesQuery { - currentValues: { - [key: string]: string; - }; - /** - * The input values to return on input, and the result from the consumer on output. - */ - inputValues: InputValues[]; - /** - * Subscription containing information about the publisher/consumer and the current input values - */ - resource: any; - } - export var TypeInfo: { - InputDataType: { - enumValues: { - "none": number; - "string": number; - "number": number; - "boolean": number; - "guid": number; - "uri": number; - }; - }; - InputDescriptor: { - fields: any; - }; - InputFilter: { - fields: any; - }; - InputFilterCondition: { - fields: any; - }; - InputFilterOperator: { - enumValues: { - "equals": number; - "notEquals": number; - }; - }; - InputMode: { - enumValues: { - "none": number; - "textBox": number; - "passwordBox": number; - "combo": number; - "radioButtons": number; - "checkBox": number; - "textArea": number; - }; - }; - InputValidation: { - fields: any; - }; - InputValue: { - fields: any; - }; - InputValues: { - fields: any; - }; - InputValuesError: { - fields: any; - }; - InputValuesQuery: { - fields: any; - }; - }; - -} -declare module 'vso-node-api/interfaces/TaskAgentInterfaces' { - import FormInputInterfaces = require('vso-node-api/interfaces/common/FormInputInterfaces'); - import VSSInterfaces = require('vso-node-api/interfaces/common/VSSInterfaces'); - export interface AgentPoolEvent { - eventType: string; - pool: TaskAgentPool; - } - export interface AgentQueueEvent { - eventType: string; - queue: TaskAgentQueue; - } - export interface AgentRefreshMessage { - agentId: number; - timeout: any; - } - export interface AuthorizationHeader { - name: string; - value: string; - } - export enum ConnectedServiceKind { - /** - * Custom or unknown service - */ - Custom = 0, - /** - * Azure Subscription - */ - AzureSubscription = 1, - /** - * Chef Connection - */ - Chef = 2, - /** - * Generic Connection - */ - Generic = 3, - /** - * GitHub Connection - */ - GitHub = 4, - } - export interface DataSource { - endpointUrl: string; - name: string; - resultSelector: string; - } - export interface DataSourceBinding { - dataSourceName: string; - endpointId: string; - parameters: { - [key: string]: string; - }; - resultTemplate: string; - target: string; - } - export interface EndpointAuthorization { - parameters: { - [key: string]: string; - }; - scheme: string; - } - export interface EndpointUrl { - displayName: string; - helpText: string; - value: string; - } - export interface HelpLink { - text: string; - url: string; - } - export interface Issue { - category: string; - data: { - [key: string]: string; - }; - message: string; - type: IssueType; - } - export enum IssueType { - Error = 1, - Warning = 2, - } - export interface JobAssignedEvent extends JobEvent { - request: TaskAgentJobRequest; - } - export interface JobCancelMessage { - jobId: string; - timeout: any; - } - export interface JobCompletedEvent extends JobEvent { - requestId: number; - result: TaskResult; - } - /** - * Represents the context of variables and vectors for a job request. - */ - export interface JobEnvironment { - endpoints: ServiceEndpoint[]; - mask: MaskHint[]; - options: { - [key: string]: JobOption; - }; - /** - * Gets or sets the endpoint used for communicating back to the calling service. - */ - systemConnection: ServiceEndpoint; - variables: { - [key: string]: string; - }; - } - export interface JobEvent { - jobId: string; - name: string; - } - /** - * Represents an option that may affect the way an agent runs the job. - */ - export interface JobOption { - data: { - [key: string]: string; - }; - /** - * Gets the id of the option. - */ - id: string; - } - export interface JobRequestMessage { - environment: JobEnvironment; - jobId: string; - jobName: string; - lockedUntil: Date; - lockToken: string; - plan: TaskOrchestrationPlanReference; - requestId: number; - tasks: TaskInstance[]; - timeline: TimelineReference; - } - export interface MaskHint { - type: MaskType; - value: string; - } - export enum MaskType { - Variable = 1, - Regex = 2, - } - export interface PlanEnvironment { - mask: MaskHint[]; - options: { - [key: string]: JobOption; - }; - variables: { - [key: string]: string; - }; - } - /** - * Represents an endpoint which may be used by an orchestration job. - */ - export interface ServiceEndpoint { - administratorsGroup: VSSInterfaces.IdentityRef; - /** - * Gets or sets the authorization data for talking to the endpoint. - */ - authorization: EndpointAuthorization; - /** - * The Gets or sets Identity reference for the user who created the Service endpoint - */ - createdBy: VSSInterfaces.IdentityRef; - data: { - [key: string]: string; - }; - /** - * Gets or Sets description of endpoint - */ - description: string; - groupScopeId: string; - /** - * Gets or sets the identifier of this endpoint. - */ - id: string; - /** - * Gets or sets the friendly name of the endpoint. - */ - name: string; - readersGroup: VSSInterfaces.IdentityRef; - /** - * Gets or sets the type of the endpoint. - */ - type: string; - /** - * Gets or sets the url of the endpoint. - */ - url: string; - } - export interface ServiceEndpointAuthenticationScheme { - authorizationHeaders: AuthorizationHeader[]; - displayName: string; - endpointHeaders: AuthorizationHeader[]; - inputDescriptors: FormInputInterfaces.InputDescriptor[]; - scheme: string; - } - export interface ServiceEndpointType { - authenticationSchemes: ServiceEndpointAuthenticationScheme[]; - dataSources: DataSource[]; - description: string; - displayName: string; - endpointUrl: EndpointUrl; - helpLink: HelpLink; - helpMarkDown: string; - name: string; - } - export interface TaskAgent extends TaskAgentReference { - /** - * Gets the request which is currently assigned to this agent. - */ - assignedRequest: TaskAgentJobRequest; - /** - * Gets the date on which this agent was created. - */ - createdOn: Date; - /** - * Gets or sets the maximum job parallelism allowed on this host. - */ - maxParallelism: number; - properties: any; - /** - * Gets the date on which the last connectivity status change occurred. - */ - statusChangedOn: Date; - systemCapabilities: { - [key: string]: string; - }; - userCapabilities: { - [key: string]: string; - }; - } - export interface TaskAgentJobRequest { - assignTime: Date; - definition: TaskOrchestrationOwner; - demands: any[]; - finishTime: Date; - hostId: string; - jobId: string; - lockedUntil: Date; - matchedAgents: TaskAgentReference[]; - owner: TaskOrchestrationOwner; - planId: string; - planType: string; - queueTime: Date; - receiveTime: Date; - requestId: number; - reservedAgent: TaskAgentReference; - result: TaskResult; - scopeId: string; - serviceOwner: string; - } - export interface TaskAgentMessage { - body: string; - messageId: number; - messageType: string; - } - export interface TaskAgentPool extends TaskAgentPoolReference { - /** - * Gets the administrators group for this agent pool. - */ - administratorsGroup: VSSInterfaces.IdentityRef; - /** - * Gets or sets a value indicating whether or not a queue should be automatically provisioned for each project collection or not. - */ - autoProvision: boolean; - /** - * Gets the identity who created this pool. The creator of the pool is automatically added into the administrators group for the pool on creation. - */ - createdBy: VSSInterfaces.IdentityRef; - /** - * Gets the date/time of the pool creation. - */ - createdOn: Date; - /** - * Gets the scope identifier for groups/roles which are owned by this pool. - */ - groupScopeId: string; - /** - * Gets or sets a value indicating whether or not this pool is managed by the service. - */ - isHosted: boolean; - properties: any; - /** - * Gets a value indicating whether or not roles have been provisioned for this pool. - */ - provisioned: boolean; - /** - * Gets the service accounts group for this agent pool. - */ - serviceAccountsGroup: VSSInterfaces.IdentityRef; - /** - * Gets the current size of the pool. - */ - size: number; - } - export interface TaskAgentPoolReference { - id: number; - name: string; - scope: string; - } - export interface TaskAgentQueue { - groupScopeId: string; - id: number; - name: string; - pool: TaskAgentPoolReference; - provisioned: boolean; - } - export enum TaskAgentQueueActionFilter { - None = 0, - Manage = 2, - Use = 16, - } - export interface TaskAgentReference { - _links: any; - /** - * Gets or sets a value indicating whether or not this agent should be enabled for job execution. - */ - enabled: boolean; - /** - * Gets the identifier of the agent. - */ - id: number; - /** - * Gets the name of the agent. - */ - name: string; - /** - * Gets the current connectivity status of the agent. - */ - status: TaskAgentStatus; - /** - * Gets the version of the agent. - */ - version: string; - } - export interface TaskAgentSession { - agent: TaskAgentReference; - ownerName: string; - sessionId: string; - systemCapabilities: { - [key: string]: string; - }; - } - export enum TaskAgentStatus { - Offline = 1, - Online = 2, - } - export interface TaskAttachment { - _links: any; - createdOn: Date; - lastChangedBy: string; - lastChangedOn: Date; - name: string; - recordId: string; - timelineId: string; - type: string; - } - export interface TaskChangeEvent { - } - export interface TaskDefinition { - agentExecution: TaskExecution; - author: string; - category: string; - contentsUploaded: boolean; - contributionIdentifier: string; - contributionVersion: string; - dataSourceBindings: DataSourceBinding[]; - demands: any[]; - description: string; - disabled: boolean; - friendlyName: string; - groups: TaskGroupDefinition[]; - helpMarkDown: string; - hostType: string; - iconUrl: string; - id: string; - inputs: TaskInputDefinition[]; - instanceNameFormat: string; - minimumAgentVersion: string; - name: string; - packageLocation: string; - packageType: string; - serverOwned: boolean; - sourceDefinitions: TaskSourceDefinition[]; - sourceLocation: string; - version: TaskVersion; - visibility: string[]; - } - export interface TaskDefinitionEndpoint { - /** - * An ID that identifies a service connection to be used for authenticating endpoint requests. - */ - connectionId: string; - /** - * An Json based keyselector to filter response returned by fetching the endpoint Url.A Json based keyselector must be prefixed with "jsonpath:". KeySelector can be used to specify the filter to get the keys for the values specified with Selector. The following keyselector defines an Json for extracting nodes named 'ServiceName'. endpoint.KeySelector = "jsonpath://ServiceName"; - */ - keySelector: string; - /** - * The scope as understood by Connected Services. Essentialy, a project-id for now. - */ - scope: string; - /** - * An XPath/Json based selector to filter response returned by fetching the endpoint Url. An XPath based selector must be prefixed with the string "xpath:". A Json based selector must be prefixed with "jsonpath:". The following selector defines an XPath for extracting nodes named 'ServiceName'. endpoint.Selector = "xpath://ServiceName"; - */ - selector: string; - /** - * TaskId that this endpoint belongs to. - */ - taskId: string; - /** - * URL to GET. - */ - url: string; - } - export interface TaskExecution { - /** - * The utility task to run. Specifying this means that this task definition is simply a meta task to call another task. This is useful for tasks that call utility tasks like powershell and commandline - */ - execTask: TaskReference; - /** - * If a task is going to run code, then this provides the type/script etc... information by platform. For example, it might look like. net45: { typeName: "Microsoft.TeamFoundation.Automation.Tasks.PowerShellTask", assemblyName: "Microsoft.TeamFoundation.Automation.Tasks.PowerShell.dll" } net20: { typeName: "Microsoft.TeamFoundation.Automation.Tasks.PowerShellTask", assemblyName: "Microsoft.TeamFoundation.Automation.Tasks.PowerShell.dll" } java: { jar: "powershelltask.tasks.automation.teamfoundation.microsoft.com", } node: { script: "powershellhost.js", } - */ - platformInstructions: { - [key: string]: { - [key: string]: string; - }; - }; - } - export interface TaskGroupDefinition { - displayName: string; - isExpanded: boolean; - name: string; - tags: string[]; - } - export interface TaskInputDefinition { - defaultValue: string; - groupName: string; - helpMarkDown: string; - label: string; - name: string; - options: { - [key: string]: string; - }; - properties: { - [key: string]: string; - }; - required: boolean; - type: string; - visibleRule: string; - } - export interface TaskInstance extends TaskReference { - alwaysRun: boolean; - continueOnError: boolean; - displayName: string; - enabled: boolean; - instanceId: string; - } - export interface TaskLog extends TaskLogReference { - createdOn: Date; - indexLocation: string; - lastChangedOn: Date; - lineCount: number; - path: string; - } - export interface TaskLogReference { - id: number; - location: string; - } - export interface TaskOrchestrationContainer extends TaskOrchestrationItem { - children: TaskOrchestrationItem[]; - continueOnError: boolean; - parallel: boolean; - rollback: TaskOrchestrationContainer; - } - export interface TaskOrchestrationItem { - itemType: TaskOrchestrationItemType; - } - export enum TaskOrchestrationItemType { - Container = 0, - Job = 1, - } - export interface TaskOrchestrationJob extends TaskOrchestrationItem { - demands: any[]; - executeAs: VSSInterfaces.IdentityRef; - executionTimeout: any; - instanceId: string; - name: string; - tasks: TaskInstance[]; - variables: { - [key: string]: string; - }; - } - export interface TaskOrchestrationOwner { - _links: any; - id: number; - name: string; - } - export interface TaskOrchestrationPlan extends TaskOrchestrationPlanReference { - environment: PlanEnvironment; - finishTime: Date; - implementation: TaskOrchestrationContainer; - requestedById: string; - requestedForId: string; - result: TaskResult; - resultCode: string; - startTime: Date; - state: TaskOrchestrationPlanState; - timeline: TimelineReference; - } - export interface TaskOrchestrationPlanReference { - artifactLocation: string; - artifactUri: string; - planId: string; - planType: string; - scopeIdentifier: string; - version: number; - } - export enum TaskOrchestrationPlanState { - InProgress = 1, - Queued = 2, - Completed = 4, - } - export interface TaskPackageMetadata { - /** - * Gets the name of the package. - */ - type: string; - /** - * Gets the url of the package. - */ - url: string; - /** - * Gets the version of the package. - */ - version: string; - } - export interface TaskReference { - id: string; - inputs: { - [key: string]: string; - }; - name: string; - version: string; - } - export enum TaskResult { - Succeeded = 0, - SucceededWithIssues = 1, - Failed = 2, - Canceled = 3, - Skipped = 4, - Abandoned = 5, - } - export interface TaskSourceDefinition { - authKey: string; - endpoint: string; - keySelector: string; - selector: string; - target: string; - } - export interface TaskVersion { - isTest: boolean; - major: number; - minor: number; - patch: number; - } - /** - * Represents a shallow reference to a TeamProject. - */ - export interface TeamProjectReference { - /** - * Project abbreviation. - */ - abbreviation: string; - /** - * The project's description (if any). - */ - description: string; - /** - * Project identifier. - */ - id: string; - /** - * Project name. - */ - name: string; - /** - * Project state. - */ - state: any; - /** - * Url to the full version of the object. - */ - url: string; - } - export interface Timeline extends TimelineReference { - lastChangedBy: string; - lastChangedOn: Date; - records: TimelineRecord[]; - } - export interface TimelineRecord { - changeId: number; - currentOperation: string; - details: TimelineReference; - errorCount: number; - finishTime: Date; - id: string; - issues: Issue[]; - lastModified: Date; - location: string; - log: TaskLogReference; - name: string; - order: number; - parentId: string; - percentComplete: number; - result: TaskResult; - resultCode: string; - startTime: Date; - state: TimelineRecordState; - type: string; - warningCount: number; - workerName: string; - } - export enum TimelineRecordState { - Pending = 0, - InProgress = 1, - Completed = 2, - } - export interface TimelineReference { - changeId: number; - id: string; - location: string; - } - export interface WebApiConnectedService extends WebApiConnectedServiceRef { - /** - * The user who did the OAuth authentication to created this service - */ - authenticatedBy: VSSInterfaces.IdentityRef; - /** - * Extra description on the service. - */ - description: string; - /** - * Friendly Name of service connection - */ - friendlyName: string; - /** - * Id/Name of the connection service. For Ex: Subscription Id for Azure Connection - */ - id: string; - /** - * The kind of service. - */ - kind: string; - /** - * The project associated with this service - */ - project: TeamProjectReference; - /** - * Optional uri to connect directly to the service such as https://windows.azure.com - */ - serviceUri: string; - } - export interface WebApiConnectedServiceDetails extends WebApiConnectedServiceRef { - /** - * Meta data for service connection - */ - connectedServiceMetaData: WebApiConnectedService; - /** - * Credential info - */ - credentialsXml: string; - /** - * Optional uri to connect directly to the service such as https://windows.azure.com - */ - endPoint: string; - } - export interface WebApiConnectedServiceRef { - id: string; - url: string; - } - export var TypeInfo: { - AgentPoolEvent: { - fields: any; - }; - AgentQueueEvent: { - fields: any; - }; - AgentRefreshMessage: { - fields: any; - }; - AuthorizationHeader: { - fields: any; - }; - ConnectedServiceKind: { - enumValues: { - "custom": number; - "azureSubscription": number; - "chef": number; - "generic": number; - "gitHub": number; - }; - }; - DataSource: { - fields: any; - }; - DataSourceBinding: { - fields: any; - }; - EndpointAuthorization: { - fields: any; - }; - EndpointUrl: { - fields: any; - }; - HelpLink: { - fields: any; - }; - Issue: { - fields: any; - }; - IssueType: { - enumValues: { - "error": number; - "warning": number; - }; - }; - JobAssignedEvent: { - fields: any; - }; - JobCancelMessage: { - fields: any; - }; - JobCompletedEvent: { - fields: any; - }; - JobEnvironment: { - fields: any; - }; - JobEvent: { - fields: any; - }; - JobOption: { - fields: any; - }; - JobRequestMessage: { - fields: any; - }; - MaskHint: { - fields: any; - }; - MaskType: { - enumValues: { - "variable": number; - "regex": number; - }; - }; - PlanEnvironment: { - fields: any; - }; - ServiceEndpoint: { - fields: any; - }; - ServiceEndpointAuthenticationScheme: { - fields: any; - }; - ServiceEndpointType: { - fields: any; - }; - TaskAgent: { - fields: any; - }; - TaskAgentJobRequest: { - fields: any; - }; - TaskAgentMessage: { - fields: any; - }; - TaskAgentPool: { - fields: any; - }; - TaskAgentPoolReference: { - fields: any; - }; - TaskAgentQueue: { - fields: any; - }; - TaskAgentQueueActionFilter: { - enumValues: { - "none": number; - "manage": number; - "use": number; - }; - }; - TaskAgentReference: { - fields: any; - }; - TaskAgentSession: { - fields: any; - }; - TaskAgentStatus: { - enumValues: { - "offline": number; - "online": number; - }; - }; - TaskAttachment: { - fields: any; - }; - TaskChangeEvent: { - fields: any; - }; - TaskDefinition: { - fields: any; - }; - TaskDefinitionEndpoint: { - fields: any; - }; - TaskExecution: { - fields: any; - }; - TaskGroupDefinition: { - fields: any; - }; - TaskInputDefinition: { - fields: any; - }; - TaskInstance: { - fields: any; - }; - TaskLog: { - fields: any; - }; - TaskLogReference: { - fields: any; - }; - TaskOrchestrationContainer: { - fields: any; - }; - TaskOrchestrationItem: { - fields: any; - }; - TaskOrchestrationItemType: { - enumValues: { - "container": number; - "job": number; - }; - }; - TaskOrchestrationJob: { - fields: any; - }; - TaskOrchestrationOwner: { - fields: any; - }; - TaskOrchestrationPlan: { - fields: any; - }; - TaskOrchestrationPlanReference: { - fields: any; - }; - TaskOrchestrationPlanState: { - enumValues: { - "inProgress": number; - "queued": number; - "completed": number; - }; - }; - TaskPackageMetadata: { - fields: any; - }; - TaskReference: { - fields: any; - }; - TaskResult: { - enumValues: { - "succeeded": number; - "succeededWithIssues": number; - "failed": number; - "canceled": number; - "skipped": number; - "abandoned": number; - }; - }; - TaskSourceDefinition: { - fields: any; - }; - TaskVersion: { - fields: any; - }; - TeamProjectReference: { - fields: any; - }; - Timeline: { - fields: any; - }; - TimelineRecord: { - fields: any; - }; - TimelineRecordState: { - enumValues: { - "pending": number; - "inProgress": number; - "completed": number; - }; - }; - TimelineReference: { - fields: any; - }; - WebApiConnectedService: { - fields: any; - }; - WebApiConnectedServiceDetails: { - fields: any; - }; - WebApiConnectedServiceRef: { - fields: any; - }; - }; - -} -declare module 'vso-node-api/TaskAgentApiBase' { - /// - /// - import Q = require('q'); - import basem = require('vso-node-api/ClientApiBases'); - import VsoBaseInterfaces = require('vso-node-api/interfaces/common/VsoBaseInterfaces'); - import TaskAgentInterfaces = require('vso-node-api/interfaces/TaskAgentInterfaces'); - import VSSInterfaces = require('vso-node-api/interfaces/common/VSSInterfaces'); - export interface ITaskAgentApiBase extends basem.ClientApiBase { - addAgent(agent: TaskAgentInterfaces.TaskAgent, poolId: number, onResult: (err: any, statusCode: number, agent: TaskAgentInterfaces.TaskAgent) => void): void; - deleteAgent(poolId: number, agentId: number, onResult: (err: any, statusCode: number) => void): void; - getAgent(poolId: number, agentId: number, includeCapabilities: boolean, includeAssignedRequest: boolean, propertyFilters: string[], onResult: (err: any, statusCode: number, agent: TaskAgentInterfaces.TaskAgent) => void): void; - getAgents(poolId: number, agentName: string, includeCapabilities: boolean, includeAssignedRequest: boolean, propertyFilters: string[], demands: string[], onResult: (err: any, statusCode: number, agents: TaskAgentInterfaces.TaskAgent[]) => void): void; - replaceAgent(agent: TaskAgentInterfaces.TaskAgent, poolId: number, agentId: number, onResult: (err: any, statusCode: number, agent: TaskAgentInterfaces.TaskAgent) => void): void; - updateAgent(agent: TaskAgentInterfaces.TaskAgent, poolId: number, agentId: number, onResult: (err: any, statusCode: number, agent: TaskAgentInterfaces.TaskAgent) => void): void; - queryEndpoint(endpoint: TaskAgentInterfaces.TaskDefinitionEndpoint, onResult: (err: any, statusCode: number, endpoint: string[]) => void): void; - deleteAgentRequest(poolId: number, requestId: number, lockToken: string, onResult: (err: any, statusCode: number) => void): void; - getAgentRequest(poolId: number, requestId: number, onResult: (err: any, statusCode: number, jobrequest: TaskAgentInterfaces.TaskAgentJobRequest) => void): void; - getAgentRequestsForAgent(poolId: number, agentId: number, completedRequestCount: number, onResult: (err: any, statusCode: number, jobrequests: TaskAgentInterfaces.TaskAgentJobRequest[]) => void): void; - getAgentRequestsForAgents(poolId: number, agentIds: number[], completedRequestCount: number, onResult: (err: any, statusCode: number, jobrequests: TaskAgentInterfaces.TaskAgentJobRequest[]) => void): void; - getAgentRequestsForPlan(poolId: number, planId: string, jobId: string, onResult: (err: any, statusCode: number, jobrequests: TaskAgentInterfaces.TaskAgentJobRequest[]) => void): void; - queueAgentRequest(request: TaskAgentInterfaces.TaskAgentJobRequest, poolId: number, onResult: (err: any, statusCode: number, jobrequest: TaskAgentInterfaces.TaskAgentJobRequest) => void): void; - updateAgentRequest(request: TaskAgentInterfaces.TaskAgentJobRequest, poolId: number, requestId: number, lockToken: string, onResult: (err: any, statusCode: number, jobrequest: TaskAgentInterfaces.TaskAgentJobRequest) => void): void; - deleteMessage(poolId: number, messageId: number, sessionId: string, onResult: (err: any, statusCode: number) => void): void; - getMessage(poolId: number, sessionId: string, lastMessageId: number, onResult: (err: any, statusCode: number, message: TaskAgentInterfaces.TaskAgentMessage) => void): void; - refreshAgent(poolId: number, agentId: number, onResult: (err: any, statusCode: number) => void): void; - refreshAgents(poolId: number, onResult: (err: any, statusCode: number) => void): void; - sendMessage(message: TaskAgentInterfaces.TaskAgentMessage, poolId: number, requestId: number, onResult: (err: any, statusCode: number) => void): void; - getPackage(packageType: string, onResult: (err: any, statusCode: number, _package: TaskAgentInterfaces.TaskPackageMetadata) => void): void; - getPackages(onResult: (err: any, statusCode: number, packages: TaskAgentInterfaces.TaskPackageMetadata[]) => void): void; - getPackageZip(packageType: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getAgentPoolRoles(poolId: number, onResult: (err: any, statusCode: number, poolroles: VSSInterfaces.IdentityRef[]) => void): void; - addAgentPool(pool: TaskAgentInterfaces.TaskAgentPool, onResult: (err: any, statusCode: number, pool: TaskAgentInterfaces.TaskAgentPool) => void): void; - deleteAgentPool(poolId: number, onResult: (err: any, statusCode: number) => void): void; - getAgentPool(poolId: number, properties: string[], onResult: (err: any, statusCode: number, pool: TaskAgentInterfaces.TaskAgentPool) => void): void; - getAgentPools(poolName: string, properties: string[], onResult: (err: any, statusCode: number, pools: TaskAgentInterfaces.TaskAgentPool[]) => void): void; - updateAgentPool(pool: TaskAgentInterfaces.TaskAgentPool, poolId: number, onResult: (err: any, statusCode: number, pool: TaskAgentInterfaces.TaskAgentPool) => void): void; - getAgentQueueRoles(queueId: number, onResult: (err: any, statusCode: number, queueroles: VSSInterfaces.IdentityRef[]) => void): void; - addAgentQueue(queue: TaskAgentInterfaces.TaskAgentQueue, onResult: (err: any, statusCode: number, queue: TaskAgentInterfaces.TaskAgentQueue) => void): void; - deleteAgentQueue(queueId: number, onResult: (err: any, statusCode: number) => void): void; - getAgentQueue(queueId: number, actionFilter: TaskAgentInterfaces.TaskAgentQueueActionFilter, onResult: (err: any, statusCode: number, queue: TaskAgentInterfaces.TaskAgentQueue) => void): void; - getAgentQueues(queueName: string, actionFilter: TaskAgentInterfaces.TaskAgentQueueActionFilter, onResult: (err: any, statusCode: number, queues: TaskAgentInterfaces.TaskAgentQueue[]) => void): void; - queryServiceEndpoint(binding: TaskAgentInterfaces.DataSourceBinding, scopeIdentifier: string, onResult: (err: any, statusCode: number, serviceendpointproxy: string[]) => void): void; - createServiceEndpoint(endpoint: TaskAgentInterfaces.ServiceEndpoint, scopeIdentifier: string, onResult: (err: any, statusCode: number, serviceendpoint: TaskAgentInterfaces.ServiceEndpoint) => void): void; - deleteServiceEndpoint(scopeIdentifier: string, endpointId: string, onResult: (err: any, statusCode: number) => void): void; - getServiceEndpointDetails(scopeIdentifier: string, endpointId: string, onResult: (err: any, statusCode: number, serviceendpoint: TaskAgentInterfaces.ServiceEndpoint) => void): void; - getServiceEndpoints(scopeIdentifier: string, type: string, authSchemes: string[], endpointIds: string[], onResult: (err: any, statusCode: number, serviceendpoints: TaskAgentInterfaces.ServiceEndpoint[]) => void): void; - updateServiceEndpoint(endpoint: TaskAgentInterfaces.ServiceEndpoint, scopeIdentifier: string, endpointId: string, onResult: (err: any, statusCode: number, serviceendpoint: TaskAgentInterfaces.ServiceEndpoint) => void): void; - getServiceEndpointTypes(scopeIdentifier: string, type: string, scheme: string, onResult: (err: any, statusCode: number, serviceendpointtypes: TaskAgentInterfaces.ServiceEndpointType[]) => void): void; - createAgentSession(session: TaskAgentInterfaces.TaskAgentSession, poolId: number, onResult: (err: any, statusCode: number, session: TaskAgentInterfaces.TaskAgentSession) => void): void; - deleteAgentSession(poolId: number, sessionId: string, onResult: (err: any, statusCode: number) => void): void; - deleteTaskDefinition(taskId: string, onResult: (err: any, statusCode: number) => void): void; - getTaskContentZip(taskId: string, versionString: string, visibility: string[], scopeLocal: boolean, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getTaskDefinition(taskId: string, versionString: string, visibility: string[], scopeLocal: boolean, onResult: (err: any, statusCode: number, task: TaskAgentInterfaces.TaskDefinition) => void): void; - getTaskDefinitions(taskId: string, visibility: string[], scopeLocal: boolean, onResult: (err: any, statusCode: number, tasks: TaskAgentInterfaces.TaskDefinition[]) => void): void; - updateAgentUserCapabilities(userCapabilities: { - [key: string]: string; - }, poolId: number, agentId: number, onResult: (err: any, statusCode: number, usercapabilitie: TaskAgentInterfaces.TaskAgent) => void): void; - } - export interface IQTaskAgentApiBase extends basem.QClientApiBase { - addAgent(agent: TaskAgentInterfaces.TaskAgent, poolId: number): Q.Promise; - deleteAgent(poolId: number, agentId: number): Q.Promise; - getAgent(poolId: number, agentId: number, includeCapabilities?: boolean, includeAssignedRequest?: boolean, propertyFilters?: string[]): Q.Promise; - getAgents(poolId: number, agentName?: string, includeCapabilities?: boolean, includeAssignedRequest?: boolean, propertyFilters?: string[], demands?: string[]): Q.Promise; - replaceAgent(agent: TaskAgentInterfaces.TaskAgent, poolId: number, agentId: number): Q.Promise; - updateAgent(agent: TaskAgentInterfaces.TaskAgent, poolId: number, agentId: number): Q.Promise; - queryEndpoint(endpoint: TaskAgentInterfaces.TaskDefinitionEndpoint): Q.Promise; - deleteAgentRequest(poolId: number, requestId: number, lockToken: string): Q.Promise; - getAgentRequest(poolId: number, requestId: number): Q.Promise; - getAgentRequestsForAgent(poolId: number, agentId: number, completedRequestCount?: number): Q.Promise; - getAgentRequestsForAgents(poolId: number, agentIds: number[], completedRequestCount?: number): Q.Promise; - getAgentRequestsForPlan(poolId: number, planId: string, jobId?: string): Q.Promise; - queueAgentRequest(request: TaskAgentInterfaces.TaskAgentJobRequest, poolId: number): Q.Promise; - updateAgentRequest(request: TaskAgentInterfaces.TaskAgentJobRequest, poolId: number, requestId: number, lockToken: string): Q.Promise; - deleteMessage(poolId: number, messageId: number, sessionId: string): Q.Promise; - getMessage(poolId: number, sessionId: string, lastMessageId?: number): Q.Promise; - refreshAgent(poolId: number, agentId: number): Q.Promise; - refreshAgents(poolId: number): Q.Promise; - sendMessage(message: TaskAgentInterfaces.TaskAgentMessage, poolId: number, requestId: number): Q.Promise; - getPackage(packageType: string): Q.Promise; - getPackages(): Q.Promise; - getPackageZip(packageType: string): Q.Promise; - getAgentPoolRoles(poolId?: number): Q.Promise; - addAgentPool(pool: TaskAgentInterfaces.TaskAgentPool): Q.Promise; - deleteAgentPool(poolId: number): Q.Promise; - getAgentPool(poolId: number, properties?: string[]): Q.Promise; - getAgentPools(poolName?: string, properties?: string[]): Q.Promise; - updateAgentPool(pool: TaskAgentInterfaces.TaskAgentPool, poolId: number): Q.Promise; - getAgentQueueRoles(queueId?: number): Q.Promise; - addAgentQueue(queue: TaskAgentInterfaces.TaskAgentQueue): Q.Promise; - deleteAgentQueue(queueId: number): Q.Promise; - getAgentQueue(queueId: number, actionFilter?: TaskAgentInterfaces.TaskAgentQueueActionFilter): Q.Promise; - getAgentQueues(queueName?: string, actionFilter?: TaskAgentInterfaces.TaskAgentQueueActionFilter): Q.Promise; - queryServiceEndpoint(binding: TaskAgentInterfaces.DataSourceBinding, scopeIdentifier: string): Q.Promise; - createServiceEndpoint(endpoint: TaskAgentInterfaces.ServiceEndpoint, scopeIdentifier: string): Q.Promise; - deleteServiceEndpoint(scopeIdentifier: string, endpointId: string): Q.Promise; - getServiceEndpointDetails(scopeIdentifier: string, endpointId: string): Q.Promise; - getServiceEndpoints(scopeIdentifier: string, type?: string, authSchemes?: string[], endpointIds?: string[]): Q.Promise; - updateServiceEndpoint(endpoint: TaskAgentInterfaces.ServiceEndpoint, scopeIdentifier: string, endpointId: string): Q.Promise; - getServiceEndpointTypes(scopeIdentifier: string, type?: string, scheme?: string): Q.Promise; - createAgentSession(session: TaskAgentInterfaces.TaskAgentSession, poolId: number): Q.Promise; - deleteAgentSession(poolId: number, sessionId: string): Q.Promise; - deleteTaskDefinition(taskId: string): Q.Promise; - getTaskContentZip(taskId: string, versionString: string, visibility?: string[], scopeLocal?: boolean): Q.Promise; - getTaskDefinition(taskId: string, versionString: string, visibility?: string[], scopeLocal?: boolean): Q.Promise; - getTaskDefinitions(taskId?: string, visibility?: string[], scopeLocal?: boolean): Q.Promise; - updateAgentUserCapabilities(userCapabilities: { - [key: string]: string; - }, poolId: number, agentId: number): Q.Promise; - } - export class TaskAgentApiBase extends basem.ClientApiBase implements ITaskAgentApiBase { - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]); - /** - * @param {TaskAgentInterfaces.TaskAgent} agent - * @param {number} poolId - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAgent - */ - addAgent(agent: TaskAgentInterfaces.TaskAgent, poolId: number, onResult: (err: any, statusCode: number, agent: TaskAgentInterfaces.TaskAgent) => void): void; - /** - * @param {number} poolId - * @param {number} agentId - * @param onResult callback function - */ - deleteAgent(poolId: number, agentId: number, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {number} poolId - * @param {number} agentId - * @param {boolean} includeCapabilities - * @param {boolean} includeAssignedRequest - * @param {string[]} propertyFilters - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAgent - */ - getAgent(poolId: number, agentId: number, includeCapabilities: boolean, includeAssignedRequest: boolean, propertyFilters: string[], onResult: (err: any, statusCode: number, agent: TaskAgentInterfaces.TaskAgent) => void): void; - /** - * @param {number} poolId - * @param {string} agentName - * @param {boolean} includeCapabilities - * @param {boolean} includeAssignedRequest - * @param {string[]} propertyFilters - * @param {string[]} demands - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAgent[] - */ - getAgents(poolId: number, agentName: string, includeCapabilities: boolean, includeAssignedRequest: boolean, propertyFilters: string[], demands: string[], onResult: (err: any, statusCode: number, agents: TaskAgentInterfaces.TaskAgent[]) => void): void; - /** - * @param {TaskAgentInterfaces.TaskAgent} agent - * @param {number} poolId - * @param {number} agentId - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAgent - */ - replaceAgent(agent: TaskAgentInterfaces.TaskAgent, poolId: number, agentId: number, onResult: (err: any, statusCode: number, agent: TaskAgentInterfaces.TaskAgent) => void): void; - /** - * @param {TaskAgentInterfaces.TaskAgent} agent - * @param {number} poolId - * @param {number} agentId - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAgent - */ - updateAgent(agent: TaskAgentInterfaces.TaskAgent, poolId: number, agentId: number, onResult: (err: any, statusCode: number, agent: TaskAgentInterfaces.TaskAgent) => void): void; - /** - * Proxy for a GET request defined by an 'endpoint'. The request is authorized using a service connection. The response is filtered using an XPath/Json based selector. - * - * @param {TaskAgentInterfaces.TaskDefinitionEndpoint} endpoint - Describes the URL to fetch. - * @param onResult callback function with the resulting string[] - */ - queryEndpoint(endpoint: TaskAgentInterfaces.TaskDefinitionEndpoint, onResult: (err: any, statusCode: number, endpoint: string[]) => void): void; - /** - * @param {number} poolId - * @param {number} requestId - * @param {string} lockToken - * @param onResult callback function - */ - deleteAgentRequest(poolId: number, requestId: number, lockToken: string, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {number} poolId - * @param {number} requestId - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAgentJobRequest - */ - getAgentRequest(poolId: number, requestId: number, onResult: (err: any, statusCode: number, jobrequest: TaskAgentInterfaces.TaskAgentJobRequest) => void): void; - /** - * @param {number} poolId - * @param {number} agentId - * @param {number} completedRequestCount - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAgentJobRequest[] - */ - getAgentRequestsForAgent(poolId: number, agentId: number, completedRequestCount: number, onResult: (err: any, statusCode: number, jobrequests: TaskAgentInterfaces.TaskAgentJobRequest[]) => void): void; - /** - * @param {number} poolId - * @param {number[]} agentIds - * @param {number} completedRequestCount - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAgentJobRequest[] - */ - getAgentRequestsForAgents(poolId: number, agentIds: number[], completedRequestCount: number, onResult: (err: any, statusCode: number, jobrequests: TaskAgentInterfaces.TaskAgentJobRequest[]) => void): void; - /** - * @param {number} poolId - * @param {string} planId - * @param {string} jobId - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAgentJobRequest[] - */ - getAgentRequestsForPlan(poolId: number, planId: string, jobId: string, onResult: (err: any, statusCode: number, jobrequests: TaskAgentInterfaces.TaskAgentJobRequest[]) => void): void; - /** - * @param {TaskAgentInterfaces.TaskAgentJobRequest} request - * @param {number} poolId - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAgentJobRequest - */ - queueAgentRequest(request: TaskAgentInterfaces.TaskAgentJobRequest, poolId: number, onResult: (err: any, statusCode: number, jobrequest: TaskAgentInterfaces.TaskAgentJobRequest) => void): void; - /** - * @param {TaskAgentInterfaces.TaskAgentJobRequest} request - * @param {number} poolId - * @param {number} requestId - * @param {string} lockToken - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAgentJobRequest - */ - updateAgentRequest(request: TaskAgentInterfaces.TaskAgentJobRequest, poolId: number, requestId: number, lockToken: string, onResult: (err: any, statusCode: number, jobrequest: TaskAgentInterfaces.TaskAgentJobRequest) => void): void; - /** - * @param {number} poolId - * @param {number} messageId - * @param {string} sessionId - * @param onResult callback function - */ - deleteMessage(poolId: number, messageId: number, sessionId: string, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {number} poolId - * @param {string} sessionId - * @param {number} lastMessageId - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAgentMessage - */ - getMessage(poolId: number, sessionId: string, lastMessageId: number, onResult: (err: any, statusCode: number, message: TaskAgentInterfaces.TaskAgentMessage) => void): void; - /** - * @param {number} poolId - * @param {number} agentId - * @param onResult callback function - */ - refreshAgent(poolId: number, agentId: number, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {number} poolId - * @param onResult callback function - */ - refreshAgents(poolId: number, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {TaskAgentInterfaces.TaskAgentMessage} message - * @param {number} poolId - * @param {number} requestId - * @param onResult callback function - */ - sendMessage(message: TaskAgentInterfaces.TaskAgentMessage, poolId: number, requestId: number, onResult: (err: any, statusCode: number) => void): void; - /** - * This method can return packages/{packageType} -- package stream OR TaskPackageMetadata if requested for json - * - * @param {string} packageType - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskPackageMetadata - */ - getPackage(packageType: string, onResult: (err: any, statusCode: number, _package: TaskAgentInterfaces.TaskPackageMetadata) => void): void; - /** - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskPackageMetadata[] - */ - getPackages(onResult: (err: any, statusCode: number, packages: TaskAgentInterfaces.TaskPackageMetadata[]) => void): void; - /** - * This method can return packages/{packageType} -- package stream OR TaskPackageMetadata if requested for json - * - * @param {string} packageType - * @param onResult callback function with the resulting ArrayBuffer - */ - getPackageZip(packageType: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * @param {number} poolId - * @param onResult callback function with the resulting VSSInterfaces.IdentityRef[] - */ - getAgentPoolRoles(poolId: number, onResult: (err: any, statusCode: number, poolroles: VSSInterfaces.IdentityRef[]) => void): void; - /** - * @param {TaskAgentInterfaces.TaskAgentPool} pool - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAgentPool - */ - addAgentPool(pool: TaskAgentInterfaces.TaskAgentPool, onResult: (err: any, statusCode: number, pool: TaskAgentInterfaces.TaskAgentPool) => void): void; - /** - * @param {number} poolId - * @param onResult callback function - */ - deleteAgentPool(poolId: number, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {number} poolId - * @param {string[]} properties - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAgentPool - */ - getAgentPool(poolId: number, properties: string[], onResult: (err: any, statusCode: number, pool: TaskAgentInterfaces.TaskAgentPool) => void): void; - /** - * @param {string} poolName - * @param {string[]} properties - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAgentPool[] - */ - getAgentPools(poolName: string, properties: string[], onResult: (err: any, statusCode: number, pools: TaskAgentInterfaces.TaskAgentPool[]) => void): void; - /** - * @param {TaskAgentInterfaces.TaskAgentPool} pool - * @param {number} poolId - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAgentPool - */ - updateAgentPool(pool: TaskAgentInterfaces.TaskAgentPool, poolId: number, onResult: (err: any, statusCode: number, pool: TaskAgentInterfaces.TaskAgentPool) => void): void; - /** - * @param {number} queueId - * @param onResult callback function with the resulting VSSInterfaces.IdentityRef[] - */ - getAgentQueueRoles(queueId: number, onResult: (err: any, statusCode: number, queueroles: VSSInterfaces.IdentityRef[]) => void): void; - /** - * @param {TaskAgentInterfaces.TaskAgentQueue} queue - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAgentQueue - */ - addAgentQueue(queue: TaskAgentInterfaces.TaskAgentQueue, onResult: (err: any, statusCode: number, queue: TaskAgentInterfaces.TaskAgentQueue) => void): void; - /** - * @param {number} queueId - * @param onResult callback function - */ - deleteAgentQueue(queueId: number, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {number} queueId - * @param {TaskAgentInterfaces.TaskAgentQueueActionFilter} actionFilter - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAgentQueue - */ - getAgentQueue(queueId: number, actionFilter: TaskAgentInterfaces.TaskAgentQueueActionFilter, onResult: (err: any, statusCode: number, queue: TaskAgentInterfaces.TaskAgentQueue) => void): void; - /** - * @param {string} queueName - * @param {TaskAgentInterfaces.TaskAgentQueueActionFilter} actionFilter - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAgentQueue[] - */ - getAgentQueues(queueName: string, actionFilter: TaskAgentInterfaces.TaskAgentQueueActionFilter, onResult: (err: any, statusCode: number, queues: TaskAgentInterfaces.TaskAgentQueue[]) => void): void; - /** - * Proxy for a GET request defined by an service endpoint. The request is authorized using a data source in service endpoint. The response is filtered using an XPath/Json based selector. - * - * @param {TaskAgentInterfaces.DataSourceBinding} binding - Describes the data source to fetch. - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param onResult callback function with the resulting string[] - */ - queryServiceEndpoint(binding: TaskAgentInterfaces.DataSourceBinding, scopeIdentifier: string, onResult: (err: any, statusCode: number, serviceendpointproxy: string[]) => void): void; - /** - * @param {TaskAgentInterfaces.ServiceEndpoint} endpoint - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param onResult callback function with the resulting TaskAgentInterfaces.ServiceEndpoint - */ - createServiceEndpoint(endpoint: TaskAgentInterfaces.ServiceEndpoint, scopeIdentifier: string, onResult: (err: any, statusCode: number, serviceendpoint: TaskAgentInterfaces.ServiceEndpoint) => void): void; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} endpointId - * @param onResult callback function - */ - deleteServiceEndpoint(scopeIdentifier: string, endpointId: string, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} endpointId - * @param onResult callback function with the resulting TaskAgentInterfaces.ServiceEndpoint - */ - getServiceEndpointDetails(scopeIdentifier: string, endpointId: string, onResult: (err: any, statusCode: number, serviceendpoint: TaskAgentInterfaces.ServiceEndpoint) => void): void; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} type - * @param {string[]} authSchemes - * @param {string[]} endpointIds - * @param onResult callback function with the resulting TaskAgentInterfaces.ServiceEndpoint[] - */ - getServiceEndpoints(scopeIdentifier: string, type: string, authSchemes: string[], endpointIds: string[], onResult: (err: any, statusCode: number, serviceendpoints: TaskAgentInterfaces.ServiceEndpoint[]) => void): void; - /** - * @param {TaskAgentInterfaces.ServiceEndpoint} endpoint - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} endpointId - * @param onResult callback function with the resulting TaskAgentInterfaces.ServiceEndpoint - */ - updateServiceEndpoint(endpoint: TaskAgentInterfaces.ServiceEndpoint, scopeIdentifier: string, endpointId: string, onResult: (err: any, statusCode: number, serviceendpoint: TaskAgentInterfaces.ServiceEndpoint) => void): void; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} type - * @param {string} scheme - * @param onResult callback function with the resulting TaskAgentInterfaces.ServiceEndpointType[] - */ - getServiceEndpointTypes(scopeIdentifier: string, type: string, scheme: string, onResult: (err: any, statusCode: number, serviceendpointtypes: TaskAgentInterfaces.ServiceEndpointType[]) => void): void; - /** - * @param {TaskAgentInterfaces.TaskAgentSession} session - * @param {number} poolId - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAgentSession - */ - createAgentSession(session: TaskAgentInterfaces.TaskAgentSession, poolId: number, onResult: (err: any, statusCode: number, session: TaskAgentInterfaces.TaskAgentSession) => void): void; - /** - * @param {number} poolId - * @param {string} sessionId - * @param onResult callback function - */ - deleteAgentSession(poolId: number, sessionId: string, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} taskId - * @param onResult callback function - */ - deleteTaskDefinition(taskId: string, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} taskId - * @param {string} versionString - * @param {string[]} visibility - * @param {boolean} scopeLocal - * @param onResult callback function with the resulting ArrayBuffer - */ - getTaskContentZip(taskId: string, versionString: string, visibility: string[], scopeLocal: boolean, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * @param {string} taskId - * @param {string} versionString - * @param {string[]} visibility - * @param {boolean} scopeLocal - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskDefinition - */ - getTaskDefinition(taskId: string, versionString: string, visibility: string[], scopeLocal: boolean, onResult: (err: any, statusCode: number, task: TaskAgentInterfaces.TaskDefinition) => void): void; - /** - * @param {string} taskId - * @param {string[]} visibility - * @param {boolean} scopeLocal - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskDefinition[] - */ - getTaskDefinitions(taskId: string, visibility: string[], scopeLocal: boolean, onResult: (err: any, statusCode: number, tasks: TaskAgentInterfaces.TaskDefinition[]) => void): void; - /** - * @param {{ [key: string] : string; }} userCapabilities - * @param {number} poolId - * @param {number} agentId - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAgent - */ - updateAgentUserCapabilities(userCapabilities: { - [key: string]: string; - }, poolId: number, agentId: number, onResult: (err: any, statusCode: number, usercapabilitie: TaskAgentInterfaces.TaskAgent) => void): void; - } - export class QTaskAgentApiBase extends basem.QClientApiBase implements IQTaskAgentApiBase { - api: TaskAgentApiBase; - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[], api: typeof basem.ClientApiBase); - /** - * @param {TaskAgentInterfaces.TaskAgent} agent - * @param {number} poolId - */ - addAgent(agent: TaskAgentInterfaces.TaskAgent, poolId: number): Q.Promise; - /** - * @param {number} poolId - * @param {number} agentId - */ - deleteAgent(poolId: number, agentId: number): Q.Promise; - /** - * @param {number} poolId - * @param {number} agentId - * @param {boolean} includeCapabilities - * @param {boolean} includeAssignedRequest - * @param {string[]} propertyFilters - */ - getAgent(poolId: number, agentId: number, includeCapabilities?: boolean, includeAssignedRequest?: boolean, propertyFilters?: string[]): Q.Promise; - /** - * @param {number} poolId - * @param {string} agentName - * @param {boolean} includeCapabilities - * @param {boolean} includeAssignedRequest - * @param {string[]} propertyFilters - * @param {string[]} demands - */ - getAgents(poolId: number, agentName?: string, includeCapabilities?: boolean, includeAssignedRequest?: boolean, propertyFilters?: string[], demands?: string[]): Q.Promise; - /** - * @param {TaskAgentInterfaces.TaskAgent} agent - * @param {number} poolId - * @param {number} agentId - */ - replaceAgent(agent: TaskAgentInterfaces.TaskAgent, poolId: number, agentId: number): Q.Promise; - /** - * @param {TaskAgentInterfaces.TaskAgent} agent - * @param {number} poolId - * @param {number} agentId - */ - updateAgent(agent: TaskAgentInterfaces.TaskAgent, poolId: number, agentId: number): Q.Promise; - /** - * Proxy for a GET request defined by an 'endpoint'. The request is authorized using a service connection. The response is filtered using an XPath/Json based selector. - * - * @param {TaskAgentInterfaces.TaskDefinitionEndpoint} endpoint - Describes the URL to fetch. - */ - queryEndpoint(endpoint: TaskAgentInterfaces.TaskDefinitionEndpoint): Q.Promise; - /** - * @param {number} poolId - * @param {number} requestId - * @param {string} lockToken - */ - deleteAgentRequest(poolId: number, requestId: number, lockToken: string): Q.Promise; - /** - * @param {number} poolId - * @param {number} requestId - */ - getAgentRequest(poolId: number, requestId: number): Q.Promise; - /** - * @param {number} poolId - * @param {number} agentId - * @param {number} completedRequestCount - */ - getAgentRequestsForAgent(poolId: number, agentId: number, completedRequestCount?: number): Q.Promise; - /** - * @param {number} poolId - * @param {number[]} agentIds - * @param {number} completedRequestCount - */ - getAgentRequestsForAgents(poolId: number, agentIds: number[], completedRequestCount?: number): Q.Promise; - /** - * @param {number} poolId - * @param {string} planId - * @param {string} jobId - */ - getAgentRequestsForPlan(poolId: number, planId: string, jobId?: string): Q.Promise; - /** - * @param {TaskAgentInterfaces.TaskAgentJobRequest} request - * @param {number} poolId - */ - queueAgentRequest(request: TaskAgentInterfaces.TaskAgentJobRequest, poolId: number): Q.Promise; - /** - * @param {TaskAgentInterfaces.TaskAgentJobRequest} request - * @param {number} poolId - * @param {number} requestId - * @param {string} lockToken - */ - updateAgentRequest(request: TaskAgentInterfaces.TaskAgentJobRequest, poolId: number, requestId: number, lockToken: string): Q.Promise; - /** - * @param {number} poolId - * @param {number} messageId - * @param {string} sessionId - */ - deleteMessage(poolId: number, messageId: number, sessionId: string): Q.Promise; - /** - * @param {number} poolId - * @param {string} sessionId - * @param {number} lastMessageId - */ - getMessage(poolId: number, sessionId: string, lastMessageId?: number): Q.Promise; - /** - * @param {number} poolId - * @param {number} agentId - */ - refreshAgent(poolId: number, agentId: number): Q.Promise; - /** - * @param {number} poolId - */ - refreshAgents(poolId: number): Q.Promise; - /** - * @param {TaskAgentInterfaces.TaskAgentMessage} message - * @param {number} poolId - * @param {number} requestId - */ - sendMessage(message: TaskAgentInterfaces.TaskAgentMessage, poolId: number, requestId: number): Q.Promise; - /** - * This method can return packages/{packageType} -- package stream OR TaskPackageMetadata if requested for json - * - * @param {string} packageType - */ - getPackage(packageType: string): Q.Promise; - /** - */ - getPackages(): Q.Promise; - /** - * This method can return packages/{packageType} -- package stream OR TaskPackageMetadata if requested for json - * - * @param {string} packageType - */ - getPackageZip(packageType: string): Q.Promise; - /** - * @param {number} poolId - */ - getAgentPoolRoles(poolId?: number): Q.Promise; - /** - * @param {TaskAgentInterfaces.TaskAgentPool} pool - */ - addAgentPool(pool: TaskAgentInterfaces.TaskAgentPool): Q.Promise; - /** - * @param {number} poolId - */ - deleteAgentPool(poolId: number): Q.Promise; - /** - * @param {number} poolId - * @param {string[]} properties - */ - getAgentPool(poolId: number, properties?: string[]): Q.Promise; - /** - * @param {string} poolName - * @param {string[]} properties - */ - getAgentPools(poolName?: string, properties?: string[]): Q.Promise; - /** - * @param {TaskAgentInterfaces.TaskAgentPool} pool - * @param {number} poolId - */ - updateAgentPool(pool: TaskAgentInterfaces.TaskAgentPool, poolId: number): Q.Promise; - /** - * @param {number} queueId - */ - getAgentQueueRoles(queueId?: number): Q.Promise; - /** - * @param {TaskAgentInterfaces.TaskAgentQueue} queue - */ - addAgentQueue(queue: TaskAgentInterfaces.TaskAgentQueue): Q.Promise; - /** - * @param {number} queueId - */ - deleteAgentQueue(queueId: number): Q.Promise; - /** - * @param {number} queueId - * @param {TaskAgentInterfaces.TaskAgentQueueActionFilter} actionFilter - */ - getAgentQueue(queueId: number, actionFilter?: TaskAgentInterfaces.TaskAgentQueueActionFilter): Q.Promise; - /** - * @param {string} queueName - * @param {TaskAgentInterfaces.TaskAgentQueueActionFilter} actionFilter - */ - getAgentQueues(queueName?: string, actionFilter?: TaskAgentInterfaces.TaskAgentQueueActionFilter): Q.Promise; - /** - * Proxy for a GET request defined by an service endpoint. The request is authorized using a data source in service endpoint. The response is filtered using an XPath/Json based selector. - * - * @param {TaskAgentInterfaces.DataSourceBinding} binding - Describes the data source to fetch. - * @param {string} scopeIdentifier - The project GUID to scope the request - */ - queryServiceEndpoint(binding: TaskAgentInterfaces.DataSourceBinding, scopeIdentifier: string): Q.Promise; - /** - * @param {TaskAgentInterfaces.ServiceEndpoint} endpoint - * @param {string} scopeIdentifier - The project GUID to scope the request - */ - createServiceEndpoint(endpoint: TaskAgentInterfaces.ServiceEndpoint, scopeIdentifier: string): Q.Promise; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} endpointId - */ - deleteServiceEndpoint(scopeIdentifier: string, endpointId: string): Q.Promise; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} endpointId - */ - getServiceEndpointDetails(scopeIdentifier: string, endpointId: string): Q.Promise; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} type - * @param {string[]} authSchemes - * @param {string[]} endpointIds - */ - getServiceEndpoints(scopeIdentifier: string, type?: string, authSchemes?: string[], endpointIds?: string[]): Q.Promise; - /** - * @param {TaskAgentInterfaces.ServiceEndpoint} endpoint - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} endpointId - */ - updateServiceEndpoint(endpoint: TaskAgentInterfaces.ServiceEndpoint, scopeIdentifier: string, endpointId: string): Q.Promise; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} type - * @param {string} scheme - */ - getServiceEndpointTypes(scopeIdentifier: string, type?: string, scheme?: string): Q.Promise; - /** - * @param {TaskAgentInterfaces.TaskAgentSession} session - * @param {number} poolId - */ - createAgentSession(session: TaskAgentInterfaces.TaskAgentSession, poolId: number): Q.Promise; - /** - * @param {number} poolId - * @param {string} sessionId - */ - deleteAgentSession(poolId: number, sessionId: string): Q.Promise; - /** - * @param {string} taskId - */ - deleteTaskDefinition(taskId: string): Q.Promise; - /** - * @param {string} taskId - * @param {string} versionString - * @param {string[]} visibility - * @param {boolean} scopeLocal - */ - getTaskContentZip(taskId: string, versionString: string, visibility?: string[], scopeLocal?: boolean): Q.Promise; - /** - * @param {string} taskId - * @param {string} versionString - * @param {string[]} visibility - * @param {boolean} scopeLocal - */ - getTaskDefinition(taskId: string, versionString: string, visibility?: string[], scopeLocal?: boolean): Q.Promise; - /** - * @param {string} taskId - * @param {string[]} visibility - * @param {boolean} scopeLocal - */ - getTaskDefinitions(taskId?: string, visibility?: string[], scopeLocal?: boolean): Q.Promise; - /** - * @param {{ [key: string] : string; }} userCapabilities - * @param {number} poolId - * @param {number} agentId - */ - updateAgentUserCapabilities(userCapabilities: { - [key: string]: string; - }, poolId: number, agentId: number): Q.Promise; - } - -} -declare module 'vso-node-api/TaskAgentApi' { - import taskagentbasem = require('vso-node-api/TaskAgentApiBase'); - import Q = require("q"); - import TaskAgentInterfaces = require('vso-node-api/interfaces/TaskAgentInterfaces'); - import VsoBaseInterfaces = require('vso-node-api/interfaces/common/VsoBaseInterfaces'); - export interface ITaskAgentApi extends taskagentbasem.ITaskAgentApiBase { - uploadTaskDefinition(customHeaders: VsoBaseInterfaces.IHeaders, contentStream: NodeJS.ReadableStream, taskId: string, overwrite: boolean, onResult: (err: any, statusCode: number, obj: any) => void): void; - } - export interface IQTaskAgentApi extends taskagentbasem.IQTaskAgentApiBase { - uploadTaskDefinition(customHeaders: VsoBaseInterfaces.IHeaders, contentStream: NodeJS.ReadableStream, taskId: string, overwrite: boolean): Q.Promise; - } - export class TaskAgentApi extends taskagentbasem.TaskAgentApiBase implements ITaskAgentApi { - private _handlers; - private _fallbackClient; - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]); - /** - * @param {string} taskId - * @param onResult callback function - */ - deleteTaskDefinition(taskId: string, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} taskId - * @param {string} versionString - * @param {string[]} visibility - * @param {boolean} scopeLocal - * @param onResult callback function with the resulting ArrayBuffer - */ - getTaskContentZip(taskId: string, versionString: string, visibility: string[], scopeLocal: boolean, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * @param {string} taskId - * @param {string} versionString - * @param {string[]} visibility - * @param {boolean} scopeLocal - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskDefinition - */ - getTaskDefinition(taskId: string, versionString: string, visibility: string[], scopeLocal: boolean, onResult: (err: any, statusCode: number, task: TaskAgentInterfaces.TaskDefinition) => void): void; - /** - * @param {string} taskId - * @param {string[]} visibility - * @param {boolean} scopeLocal - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskDefinition[] - */ - getTaskDefinitions(taskId: string, visibility: string[], scopeLocal: boolean, onResult: (err: any, statusCode: number, tasks: TaskAgentInterfaces.TaskDefinition[]) => void): void; - /** - * @param {NodeJS.ReadableStream} contentStream - * @param {string} taskId - * @param {boolean} overwrite - * @param onResult callback function - */ - uploadTaskDefinition(customHeaders: VsoBaseInterfaces.IHeaders, contentStream: NodeJS.ReadableStream, taskId: string, overwrite: boolean, onResult: (err: any, statusCode: number, obj: any) => void): void; - /** - * @param {NodeJS.ReadableStream} contentStream - * @param {string} taskId - * @param {boolean} overwrite - * @param onResult callback function - */ - private _uploadTaskDefinition(customHeaders, contentStream, taskId, overwrite, onResult); - private _getFallbackClient(baseUrl); - private _getAccountUrl(collectionUrl); - } - export class QTaskAgentApi extends taskagentbasem.QTaskAgentApiBase implements IQTaskAgentApi { - api: TaskAgentApi; - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]); - /** - * @param {NodeJS.ReadableStream} contentStream - * @param {string} taskId - * @param {boolean} overwrite - */ - uploadTaskDefinition(customHeaders: VsoBaseInterfaces.IHeaders, contentStream: NodeJS.ReadableStream, taskId: string, overwrite: boolean): Q.Promise; - } - -} -declare module 'vso-node-api/TaskApi' { - /// - /// - import Q = require('q'); - import basem = require('vso-node-api/ClientApiBases'); - import VsoBaseInterfaces = require('vso-node-api/interfaces/common/VsoBaseInterfaces'); - import TaskAgentInterfaces = require('vso-node-api/interfaces/TaskAgentInterfaces'); - import VSSInterfaces = require('vso-node-api/interfaces/common/VSSInterfaces'); - export interface ITaskApi extends basem.ClientApiBase { - getPlanAttachments(scopeIdentifier: string, hubName: string, planId: string, type: string, onResult: (err: any, statusCode: number, attachments: TaskAgentInterfaces.TaskAttachment[]) => void): void; - createAttachment(customHeaders: any, contentStream: NodeJS.ReadableStream, scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string, onResult: (err: any, statusCode: number, attachment: TaskAgentInterfaces.TaskAttachment) => void): void; - getAttachment(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string, onResult: (err: any, statusCode: number, attachment: TaskAgentInterfaces.TaskAttachment) => void): void; - getAttachmentContent(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getAttachments(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, onResult: (err: any, statusCode: number, attachments: TaskAgentInterfaces.TaskAttachment[]) => void): void; - appendTimelineRecordFeed(lines: VSSInterfaces.VssJsonCollectionWrapperV, scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, onResult: (err: any, statusCode: number) => void): void; - appendLogContent(customHeaders: any, contentStream: NodeJS.ReadableStream, scopeIdentifier: string, hubName: string, planId: string, logId: number, onResult: (err: any, statusCode: number, log: TaskAgentInterfaces.TaskLog) => void): void; - createLog(log: TaskAgentInterfaces.TaskLog, scopeIdentifier: string, hubName: string, planId: string, onResult: (err: any, statusCode: number, log: TaskAgentInterfaces.TaskLog) => void): void; - getLog(scopeIdentifier: string, hubName: string, planId: string, logId: number, startLine: number, endLine: number, onResult: (err: any, statusCode: number, logs: string[]) => void): void; - getLogs(scopeIdentifier: string, hubName: string, planId: string, onResult: (err: any, statusCode: number, logs: TaskAgentInterfaces.TaskLog[]) => void): void; - getPlan(scopeIdentifier: string, hubName: string, planId: string, onResult: (err: any, statusCode: number, plan: TaskAgentInterfaces.TaskOrchestrationPlan) => void): void; - getRecords(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, changeId: number, onResult: (err: any, statusCode: number, records: TaskAgentInterfaces.TimelineRecord[]) => void): void; - updateRecords(records: VSSInterfaces.VssJsonCollectionWrapperV, scopeIdentifier: string, hubName: string, planId: string, timelineId: string, onResult: (err: any, statusCode: number, record: TaskAgentInterfaces.TimelineRecord[]) => void): void; - createTimeline(timeline: TaskAgentInterfaces.Timeline, scopeIdentifier: string, hubName: string, planId: string, onResult: (err: any, statusCode: number, timeline: TaskAgentInterfaces.Timeline) => void): void; - deleteTimeline(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, onResult: (err: any, statusCode: number) => void): void; - getTimeline(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, changeId: number, includeRecords: boolean, onResult: (err: any, statusCode: number, timeline: TaskAgentInterfaces.Timeline) => void): void; - getTimelines(scopeIdentifier: string, hubName: string, planId: string, onResult: (err: any, statusCode: number, timelines: TaskAgentInterfaces.Timeline[]) => void): void; - } - export interface IQTaskApi extends basem.QClientApiBase { - getPlanAttachments(scopeIdentifier: string, hubName: string, planId: string, type: string): Q.Promise; - createAttachment(customHeaders: any, contentStream: NodeJS.ReadableStream, scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string): Q.Promise; - getAttachment(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string): Q.Promise; - getAttachmentContent(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string): Q.Promise; - getAttachments(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string): Q.Promise; - appendTimelineRecordFeed(lines: VSSInterfaces.VssJsonCollectionWrapperV, scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string): Q.Promise; - appendLogContent(customHeaders: any, contentStream: NodeJS.ReadableStream, scopeIdentifier: string, hubName: string, planId: string, logId: number): Q.Promise; - createLog(log: TaskAgentInterfaces.TaskLog, scopeIdentifier: string, hubName: string, planId: string): Q.Promise; - getLog(scopeIdentifier: string, hubName: string, planId: string, logId: number, startLine?: number, endLine?: number): Q.Promise; - getLogs(scopeIdentifier: string, hubName: string, planId: string): Q.Promise; - getPlan(scopeIdentifier: string, hubName: string, planId: string): Q.Promise; - getRecords(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, changeId?: number): Q.Promise; - updateRecords(records: VSSInterfaces.VssJsonCollectionWrapperV, scopeIdentifier: string, hubName: string, planId: string, timelineId: string): Q.Promise; - createTimeline(timeline: TaskAgentInterfaces.Timeline, scopeIdentifier: string, hubName: string, planId: string): Q.Promise; - deleteTimeline(scopeIdentifier: string, hubName: string, planId: string, timelineId: string): Q.Promise; - getTimeline(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, changeId?: number, includeRecords?: boolean): Q.Promise; - getTimelines(scopeIdentifier: string, hubName: string, planId: string): Q.Promise; - } - export class TaskApi extends basem.ClientApiBase implements ITaskApi { - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]); - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} type - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAttachment[] - */ - getPlanAttachments(scopeIdentifier: string, hubName: string, planId: string, type: string, onResult: (err: any, statusCode: number, attachments: TaskAgentInterfaces.TaskAttachment[]) => void): void; - /** - * @param {NodeJS.ReadableStream} contentStream - Content to upload - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param {string} recordId - * @param {string} type - * @param {string} name - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAttachment - */ - createAttachment(customHeaders: VsoBaseInterfaces.IHeaders, contentStream: NodeJS.ReadableStream, scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string, onResult: (err: any, statusCode: number, attachment: TaskAgentInterfaces.TaskAttachment) => void): void; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param {string} recordId - * @param {string} type - * @param {string} name - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAttachment - */ - getAttachment(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string, onResult: (err: any, statusCode: number, attachment: TaskAgentInterfaces.TaskAttachment) => void): void; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param {string} recordId - * @param {string} type - * @param {string} name - * @param onResult callback function with the resulting ArrayBuffer - */ - getAttachmentContent(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param {string} recordId - * @param {string} type - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskAttachment[] - */ - getAttachments(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, onResult: (err: any, statusCode: number, attachments: TaskAgentInterfaces.TaskAttachment[]) => void): void; - /** - * @param {VSSInterfaces.VssJsonCollectionWrapperV} lines - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param {string} recordId - * @param onResult callback function - */ - appendTimelineRecordFeed(lines: VSSInterfaces.VssJsonCollectionWrapperV, scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {NodeJS.ReadableStream} contentStream - Content to upload - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {number} logId - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskLog - */ - appendLogContent(customHeaders: VsoBaseInterfaces.IHeaders, contentStream: NodeJS.ReadableStream, scopeIdentifier: string, hubName: string, planId: string, logId: number, onResult: (err: any, statusCode: number, log: TaskAgentInterfaces.TaskLog) => void): void; - /** - * @param {TaskAgentInterfaces.TaskLog} log - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskLog - */ - createLog(log: TaskAgentInterfaces.TaskLog, scopeIdentifier: string, hubName: string, planId: string, onResult: (err: any, statusCode: number, log: TaskAgentInterfaces.TaskLog) => void): void; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {number} logId - * @param {number} startLine - * @param {number} endLine - * @param onResult callback function with the resulting string[] - */ - getLog(scopeIdentifier: string, hubName: string, planId: string, logId: number, startLine: number, endLine: number, onResult: (err: any, statusCode: number, logs: string[]) => void): void; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskLog[] - */ - getLogs(scopeIdentifier: string, hubName: string, planId: string, onResult: (err: any, statusCode: number, logs: TaskAgentInterfaces.TaskLog[]) => void): void; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param onResult callback function with the resulting TaskAgentInterfaces.TaskOrchestrationPlan - */ - getPlan(scopeIdentifier: string, hubName: string, planId: string, onResult: (err: any, statusCode: number, plan: TaskAgentInterfaces.TaskOrchestrationPlan) => void): void; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param {number} changeId - * @param onResult callback function with the resulting TaskAgentInterfaces.TimelineRecord[] - */ - getRecords(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, changeId: number, onResult: (err: any, statusCode: number, records: TaskAgentInterfaces.TimelineRecord[]) => void): void; - /** - * @param {VSSInterfaces.VssJsonCollectionWrapperV} records - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param onResult callback function with the resulting TaskAgentInterfaces.TimelineRecord[] - */ - updateRecords(records: VSSInterfaces.VssJsonCollectionWrapperV, scopeIdentifier: string, hubName: string, planId: string, timelineId: string, onResult: (err: any, statusCode: number, record: TaskAgentInterfaces.TimelineRecord[]) => void): void; - /** - * @param {TaskAgentInterfaces.Timeline} timeline - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param onResult callback function with the resulting TaskAgentInterfaces.Timeline - */ - createTimeline(timeline: TaskAgentInterfaces.Timeline, scopeIdentifier: string, hubName: string, planId: string, onResult: (err: any, statusCode: number, timeline: TaskAgentInterfaces.Timeline) => void): void; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param onResult callback function - */ - deleteTimeline(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param {number} changeId - * @param {boolean} includeRecords - * @param onResult callback function with the resulting TaskAgentInterfaces.Timeline - */ - getTimeline(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, changeId: number, includeRecords: boolean, onResult: (err: any, statusCode: number, timeline: TaskAgentInterfaces.Timeline) => void): void; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param onResult callback function with the resulting TaskAgentInterfaces.Timeline[] - */ - getTimelines(scopeIdentifier: string, hubName: string, planId: string, onResult: (err: any, statusCode: number, timelines: TaskAgentInterfaces.Timeline[]) => void): void; - } - export class QTaskApi extends basem.QClientApiBase implements IQTaskApi { - api: TaskApi; - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]); - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} type - */ - getPlanAttachments(scopeIdentifier: string, hubName: string, planId: string, type: string): Q.Promise; - /** - * @param {NodeJS.ReadableStream} contentStream - Content to upload - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param {string} recordId - * @param {string} type - * @param {string} name - */ - createAttachment(customHeaders: any, contentStream: NodeJS.ReadableStream, scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string): Q.Promise; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param {string} recordId - * @param {string} type - * @param {string} name - */ - getAttachment(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string): Q.Promise; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param {string} recordId - * @param {string} type - * @param {string} name - */ - getAttachmentContent(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string): Q.Promise; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param {string} recordId - * @param {string} type - */ - getAttachments(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string): Q.Promise; - /** - * @param {VSSInterfaces.VssJsonCollectionWrapperV} lines - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param {string} recordId - */ - appendTimelineRecordFeed(lines: VSSInterfaces.VssJsonCollectionWrapperV, scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string): Q.Promise; - /** - * @param {NodeJS.ReadableStream} contentStream - Content to upload - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {number} logId - */ - appendLogContent(customHeaders: any, contentStream: NodeJS.ReadableStream, scopeIdentifier: string, hubName: string, planId: string, logId: number): Q.Promise; - /** - * @param {TaskAgentInterfaces.TaskLog} log - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - */ - createLog(log: TaskAgentInterfaces.TaskLog, scopeIdentifier: string, hubName: string, planId: string): Q.Promise; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {number} logId - * @param {number} startLine - * @param {number} endLine - */ - getLog(scopeIdentifier: string, hubName: string, planId: string, logId: number, startLine?: number, endLine?: number): Q.Promise; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - */ - getLogs(scopeIdentifier: string, hubName: string, planId: string): Q.Promise; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - */ - getPlan(scopeIdentifier: string, hubName: string, planId: string): Q.Promise; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param {number} changeId - */ - getRecords(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, changeId?: number): Q.Promise; - /** - * @param {VSSInterfaces.VssJsonCollectionWrapperV} records - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - */ - updateRecords(records: VSSInterfaces.VssJsonCollectionWrapperV, scopeIdentifier: string, hubName: string, planId: string, timelineId: string): Q.Promise; - /** - * @param {TaskAgentInterfaces.Timeline} timeline - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - */ - createTimeline(timeline: TaskAgentInterfaces.Timeline, scopeIdentifier: string, hubName: string, planId: string): Q.Promise; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - */ - deleteTimeline(scopeIdentifier: string, hubName: string, planId: string, timelineId: string): Q.Promise; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - * @param {string} timelineId - * @param {number} changeId - * @param {boolean} includeRecords - */ - getTimeline(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, changeId?: number, includeRecords?: boolean): Q.Promise; - /** - * @param {string} scopeIdentifier - The project GUID to scope the request - * @param {string} hubName - The name of the server hub: "build" for the Build server or "rm" for the Release Management server - * @param {string} planId - */ - getTimelines(scopeIdentifier: string, hubName: string, planId: string): Q.Promise; - } - -} -declare module 'vso-node-api/interfaces/TestInterfaces' { - import TfsCoreInterfaces = require('vso-node-api/interfaces/CoreInterfaces'); - import VSSInterfaces = require('vso-node-api/interfaces/common/VSSInterfaces'); - export interface AggregatedDataForResultTrend { - /** - * This is tests execution duration. - */ - duration: any; - resultsByOutcome: { - [key: number]: AggregatedResultsByOutcome; - }; - testResultsContext: TestResultsContext; - } - export interface AggregatedResultsAnalysis { - duration: any; - previousContext: TestResultsContext; - resultsByOutcome: { - [key: number]: AggregatedResultsByOutcome; - }; - resultsDifference: AggregatedResultsDifference; - totalTests: number; - } - export interface AggregatedResultsByOutcome { - count: number; - duration: any; - outcome: TestOutcome; - } - export interface AggregatedResultsDifference { - increaseInDuration: any; - increaseInFailures: number; - increaseInPassedTests: number; - increaseInTotalTests: number; - } - export enum AttachmentType { - GeneralAttachment = 0, - AfnStrip = 1, - BugFilingData = 2, - CodeCoverage = 3, - IntermediateCollectorData = 4, - RunConfig = 5, - TestImpactDetails = 6, - TmiTestRunDeploymentFiles = 7, - TmiTestRunReverseDeploymentFiles = 8, - TmiTestResultDetail = 9, - TmiTestRunSummary = 10, - } - export interface BatchResponse { - error: string; - responses: Response[]; - status: string; - } - export interface BuildConfiguration { - branchName: string; - buildDefinitionId: number; - flavor: string; - id: number; - number: string; - platform: string; - project: ShallowReference; - repositoryId: number; - sourceVersion: string; - uri: string; - } - export interface BuildCoverage { - codeCoverageFileUrl: string; - configuration: BuildConfiguration; - lastError: string; - modules: ModuleCoverage[]; - state: string; - } - export interface BuildReference { - branchName: string; - buildSystem: string; - definitionId: number; - id: number; - number: string; - uri: string; - } - export interface CloneOperationInformation { - cloneStatistics: CloneStatistics; - /** - * If the operation is complete, the DateTime of completion. If operation is not complete, this is DateTime.MaxValue - */ - completionDate: Date; - /** - * DateTime when the operation was started - */ - creationDate: Date; - /** - * Shallow reference of the destination - */ - destinationObject: ShallowReference; - /** - * Shallow reference of the destination - */ - destinationPlan: ShallowReference; - /** - * Shallow reference of the destination - */ - destinationProject: ShallowReference; - /** - * If the operation has Failed, Message contains the reason for failure. Null otherwise. - */ - message: string; - /** - * The ID of the operation - */ - opId: number; - /** - * The type of the object generated as a result of the Clone operation - */ - resultObjectType: ResultObjectType; - /** - * Shallow reference of the source - */ - sourceObject: ShallowReference; - /** - * Shallow reference of the source - */ - sourcePlan: ShallowReference; - /** - * Shallow reference of the source - */ - sourceProject: ShallowReference; - /** - * Current state of the operation. When State reaches Suceeded or Failed, the operation is complete - */ - state: CloneOperationState; - /** - * Url for geting the clone information - */ - url: string; - } - export enum CloneOperationState { - Failed = 2, - InProgress = 1, - Queued = 0, - Succeeded = 3, - } - export interface CloneOptions { - /** - * If set to true requirements will be cloned - */ - cloneRequirements: boolean; - /** - * copy all suites from a source plan - */ - copyAllSuites: boolean; - /** - * copy ancestor hieracrchy - */ - copyAncestorHierarchy: boolean; - /** - * Name of the workitem type of the clone - */ - destinationWorkItemType: string; - /** - * Key value pairs where the key value is overridden by the value. - */ - overrideParameters: { - [key: string]: string; - }; - /** - * Comment on the link that will link the new clone test case to the original Set null for no comment - */ - relatedLinkComment: string; - } - export interface CloneStatistics { - /** - * Number of Requirments cloned so far. - */ - clonedRequirementsCount: number; - /** - * Number of shared steps cloned so far. - */ - clonedSharedStepsCount: number; - /** - * Number of test cases cloned so far - */ - clonedTestCasesCount: number; - /** - * Total number of requirements to be cloned - */ - totalRequirementsCount: number; - /** - * Total number of test cases to be cloned - */ - totalTestCasesCount: number; - } - /** - * Represents the build configuration (platform, flavor) and coverage data for the build - */ - export interface CodeCoverageData { - /** - * Flavor of build for which data is retrieved/published - */ - buildFlavor: string; - /** - * Platform of build for which data is retrieved/published - */ - buildPlatform: string; - /** - * List of coverage data for the build - */ - coverageStats: CodeCoverageStatistics[]; - } - /** - * Represents the code coverage statistics for a particular coverage label (modules, statements, blocks, etc.) - */ - export interface CodeCoverageStatistics { - /** - * Covered units - */ - covered: number; - /** - * Delta of coverage - */ - delta: number; - /** - * Is delta valid - */ - isDeltaAvailable: boolean; - /** - * Label of coverage data ("Blocks", "Statements", "Modules", etc.) - */ - label: string; - /** - * Position of label - */ - position: number; - /** - * Total units - */ - total: number; - } - /** - * Represents the code coverage summary results Used to publish or retrieve code coverage summary against a build - */ - export interface CodeCoverageSummary { - /** - * Uri of build for which data is retrieved/published - */ - build: ShallowReference; - /** - * List of coverage data and details for the build - */ - coverageData: CodeCoverageData[]; - /** - * Uri of build against which difference in coverage is computed - */ - deltaBuild: ShallowReference; - } - export enum CoverageQueryFlags { - /** - * If set, the Coverage.Modules property will be populated. - */ - Modules = 1, - /** - * If set, the ModuleCoverage.Functions properties will be populated. - */ - Functions = 2, - /** - * If set, the ModuleCoverage.CoverageData field will be populated. - */ - BlockData = 4, - } - export interface CoverageStatistics { - blocksCovered: number; - blocksNotCovered: number; - linesCovered: number; - linesNotCovered: number; - linesPartiallyCovered: number; - } - export interface CustomTestField { - fieldName: string; - value: any; - } - export interface CustomTestFieldDefinition { - fieldId: number; - fieldName: string; - fieldType: CustomTestFieldType; - scope: CustomTestFieldScope; - } - export enum CustomTestFieldScope { - None = 0, - TestRun = 1, - TestResult = 2, - System = 4, - All = 7, - } - export enum CustomTestFieldType { - Bit = 2, - DateTime = 4, - Int = 8, - Float = 6, - String = 12, - Guid = 14, - } - /** - * This is a temporary class to provide the details for the test run environment. - */ - export interface DtlEnvironmentDetails { - csmContent: string; - csmParameters: string; - subscriptionName: string; - } - export interface FailingSince { - build: BuildReference; - date: Date; - release: ReleaseReference; - } - export interface FunctionCoverage { - class: string; - name: string; - namespace: string; - sourceFile: string; - statistics: CoverageStatistics; - } - export enum GroupTestResultsBy { - None = 0, - AutomatedTestStorage = 1, - } - export interface LastResultDetails { - dateCompleted: Date; - duration: number; - runBy: VSSInterfaces.IdentityRef; - } - export interface ModuleCoverage { - blockCount: number; - blockData: number[]; - functions: FunctionCoverage[]; - name: string; - signature: string; - signatureAge: number; - statistics: CoverageStatistics; - } - export interface NameValuePair { - name: string; - value: string; - } - export interface PlanUpdateModel { - area: ShallowReference; - automatedTestEnvironment: TestEnvironment; - automatedTestSettings: TestSettings; - build: ShallowReference; - configurationIds: number[]; - description: string; - endDate: string; - iteration: string; - manualTestEnvironment: TestEnvironment; - manualTestSettings: TestSettings; - name: string; - owner: VSSInterfaces.IdentityRef; - startDate: string; - state: string; - status: string; - } - export interface PointAssignment { - configuration: ShallowReference; - tester: VSSInterfaces.IdentityRef; - } - export interface PointUpdateModel { - } - export interface PointWorkItemProperty { - workItem: { - key: string; - value: any; - }; - } - export interface QueryModel { - query: string; - } - export interface ReleaseReference { - definitionId: number; - environmentDefinitionId: number; - environmentId: number; - id: number; - } - export interface Response { - error: string; - id: string; - status: string; - url: string; - } - export enum ResultDetails { - None = 0, - Iterations = 1, - WorkItems = 2, - } - export enum ResultObjectType { - TestSuite = 0, - TestPlan = 1, - } - export enum ResultOutcome { - Pass = 1, - Fail = 2, - Pending = 3, - } - export interface ResultRetentionSettings { - automatedResultsRetentionDuration: number; - lastUpdatedBy: VSSInterfaces.IdentityRef; - lastUpdatedDate: Date; - manualResultsRetentionDuration: number; - } - export interface ResultUpdateRequestModel { - actionResultDeletes: TestActionResultModel[]; - actionResults: TestActionResultModel[]; - parameterDeletes: TestResultParameterModel[]; - parameters: TestResultParameterModel[]; - testCaseResult: TestCaseResultUpdateModel; - } - export interface ResultUpdateResponseModel { - revision: number; - } - export interface RunCreateModel { - automated: boolean; - build: ShallowReference; - buildDropLocation: string; - buildFlavor: string; - buildPlatform: string; - comment: string; - completeDate: string; - configurationIds: number[]; - controller: string; - customTestFields: CustomTestField[]; - dtlAutEnvironment: ShallowReference; - dtlTestEnvironment: ShallowReference; - dueDate: string; - environmentDetails: DtlEnvironmentDetails; - errorMessage: string; - filter: RunFilter; - iteration: string; - name: string; - owner: VSSInterfaces.IdentityRef; - plan: ShallowReference; - pointIds: number[]; - releaseEnvironmentUri: string; - releaseUri: string; - runTimeout: any; - sourceWorkflow: string; - startDate: string; - state: string; - testConfigurationsMapping: string; - testEnvironmentId: string; - testSettings: ShallowReference; - type: string; - } - /** - * This class is used to provide the filters used for discovery - */ - export interface RunFilter { - /** - * filter for the test case sources (test containers) - */ - sourceFilter: string; - /** - * filter for the test cases - */ - testCaseFilter: string; - } - export interface RunStatistic { - count: number; - outcome: string; - resolutionState: TestResolutionState; - state: string; - } - export interface RunUpdateModel { - build: ShallowReference; - comment: string; - completedDate: string; - controller: string; - deleteInProgressResults: boolean; - dtlAutEnvironment: ShallowReference; - dtlEnvironment: ShallowReference; - dtlEnvironmentDetails: DtlEnvironmentDetails; - dueDate: string; - errorMessage: string; - iteration: string; - logEntries: TestMessageLogDetails[]; - name: string; - startedDate: string; - state: string; - substate: TestRunSubstate; - testEnvironmentId: string; - testSettings: ShallowReference; - } - /** - * An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links. - */ - export interface ShallowReference { - /** - * Id of the resource - */ - id: string; - /** - * Name of the linked resource (definition name, controller name, etc.) - */ - name: string; - /** - * Full http link to the resource - */ - url: string; - } - export interface SharedStepModel { - id: number; - revision: number; - } - export interface SuiteCreateModel { - } - export interface SuiteTestCase { - pointAssignments: PointAssignment[]; - testCase: WorkItemReference; - } - export interface SuiteUpdateModel { - } - export interface TestActionResultModel extends TestResultModelBase { - actionPath: string; - iterationId: number; - sharedStepModel: SharedStepModel; - url: string; - } - export interface TestAttachmentReference { - id: number; - url: string; - } - export interface TestAttachmentRequestModel { - attachmentType: string; - comment: string; - fileName: string; - stream: string; - } - export interface TestCaseResult { - afnStripId: number; - area: ShallowReference; - associatedBugs: ShallowReference[]; - automatedTestId: string; - automatedTestName: string; - automatedTestStorage: string; - automatedTestType: string; - automatedTestTypeId: string; - build: ShallowReference; - buildReference: BuildReference; - comment: string; - completedDate: Date; - computerName: string; - configuration: ShallowReference; - createdDate: Date; - customFields: CustomTestField[]; - durationInMs: number; - errorMessage: string; - failingSince: FailingSince; - failureType: string; - id: number; - iterationDetails: TestIterationDetailsModel[]; - lastUpdatedBy: VSSInterfaces.IdentityRef; - lastUpdatedDate: Date; - outcome: string; - owner: VSSInterfaces.IdentityRef; - priority: number; - project: ShallowReference; - releaseReference: ReleaseReference; - resetCount: number; - resolutionState: string; - resolutionStateId: number; - revision: number; - runBy: VSSInterfaces.IdentityRef; - stackTrace: string; - startedDate: Date; - state: string; - testCase: ShallowReference; - testCaseTitle: string; - testPoint: ShallowReference; - testRun: ShallowReference; - url: string; - } - export interface TestCaseResult2 { - componentId: string; - custom: any; - endTime: Date; - exceptionStack: string; - externalArtifacts: string[]; - externalRunId: string; - externalSystem: string; - externalTestId: string; - failureReasons: string[]; - failureSummary: string; - investigationNotes: string; - isSuperseded: boolean; - isValid: boolean; - outcome: ResultOutcome; - resultCustomPropertiesTypeName: string; - resultId: string; - resultName: string; - runId: string; - startTime: Date; - testId: string; - tfsSecurityKey: string; - } - export interface TestCaseResultAttachmentModel { - id: number; - iterationId: number; - name: string; - size: number; - url: string; - } - export interface TestCaseResultIdentifier { - testResultId: number; - testRunId: number; - } - export interface TestCaseResultUpdateModel { - associatedWorkItems: number[]; - automatedTestTypeId: string; - comment: string; - completedDate: string; - computerName: string; - customFields: CustomTestField[]; - durationInMs: string; - errorMessage: string; - failureType: string; - outcome: string; - owner: VSSInterfaces.IdentityRef; - resolutionState: string; - runBy: VSSInterfaces.IdentityRef; - stackTrace: string; - startedDate: string; - state: string; - testCasePriority: string; - testResult: ShallowReference; - } - export interface TestConfiguration { - /** - * Area of the configuration - */ - area: ShallowReference; - /** - * Description of the configuration - */ - description: string; - /** - * Id of the configuration - */ - id: number; - /** - * Is the configuration a default for the test plans - */ - isDefault: boolean; - /** - * Last Updated By Reference - */ - lastUpdatedBy: VSSInterfaces.IdentityRef; - /** - * Last Updated Data - */ - lastUpdatedDate: Date; - /** - * Name of the configuration - */ - name: string; - /** - * Project to which the configuration belongs - */ - project: ShallowReference; - /** - * Revision of the the configuration - */ - revision: number; - /** - * State of the configuration - */ - state: TestConfigurationState; - /** - * Url of Configuration Resource - */ - url: string; - /** - * Dictionary of Test Variable, Selected Value - */ - values: NameValuePair[]; - } - export enum TestConfigurationState { - /** - * The configuration can be used for new test runs. - */ - Active = 1, - /** - * The configuration has been retired and should not be used for new test runs. - */ - Inactive = 2, - } - export interface TestEnvironment { - environmentId: string; - environmentName: string; - } - export interface TestFailureDetails { - count: number; - testResults: ShallowReference[]; - } - export interface TestFailuresAnalysis { - existingFailures: TestFailureDetails; - fixedTests: TestFailureDetails; - newFailures: TestFailureDetails; - previousContext: TestResultsContext; - } - export interface TestIterationDetailsModel { - actionResults: TestActionResultModel[]; - attachments: TestCaseResultAttachmentModel[]; - comment: string; - completedDate: Date; - durationInMs: number; - errorMessage: string; - id: number; - outcome: string; - parameters: TestResultParameterModel[]; - startedDate: Date; - url: string; - } - /** - * An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links. - */ - export interface TestMessageLogDetails { - /** - * Date when the resource is created - */ - dateCreated: Date; - /** - * Id of the resource - */ - entryId: number; - /** - * Message of the resource - */ - message: string; - } - export enum TestOutcome { - /** - * Only used during an update to preserve the existing value. - */ - Unspecified = 0, - /** - * Test has not been completed, or the test type does not report pass/failure. - */ - None = 1, - /** - * Test was executed w/o any issues. - */ - Passed = 2, - /** - * Test was executed, but there were issues. Issues may involve exceptions or failed assertions. - */ - Failed = 3, - /** - * Test has completed, but we can't say if it passed or failed. May be used for aborted tests... - */ - Inconclusive = 4, - /** - * The test timed out - */ - Timeout = 5, - /** - * Test was aborted. This was not caused by a user gesture, but rather by a framework decision. - */ - Aborted = 6, - /** - * Test had it chance for been executed but was not, as ITestElement.IsRunnable == false. - */ - Blocked = 7, - /** - * Test was not executed. This was caused by a user gesture - e.g. user hit stop button. - */ - NotExecuted = 8, - /** - * To be used by Run level results. This is not a failure. - */ - Warning = 9, - /** - * There was a system error while we were trying to execute a test. - */ - Error = 10, - /** - * Test is Not Applicable for execution. - */ - NotApplicable = 11, - /** - * Test is paused. - */ - Paused = 12, - /** - * Test is currently executing. Added this for TCM charts - */ - InProgress = 13, - MaxValue = 13, - } - export interface TestPlan { - area: ShallowReference; - automatedTestEnvironment: TestEnvironment; - automatedTestSettings: TestSettings; - build: ShallowReference; - clientUrl: string; - description: string; - endDate: Date; - id: number; - iteration: string; - manualTestEnvironment: TestEnvironment; - manualTestSettings: TestSettings; - name: string; - owner: VSSInterfaces.IdentityRef; - previousBuild: ShallowReference; - project: ShallowReference; - revision: number; - rootSuite: ShallowReference; - startDate: Date; - state: string; - updatedBy: VSSInterfaces.IdentityRef; - updatedDate: Date; - url: string; - } - export interface TestPlanCloneRequest { - cloneOptions: CloneOptions; - destinationTestPlan: TestPlan; - suiteIds: number[]; - } - export interface TestPlansWithSelection { - lastSelectedPlan: number; - lastSelectedSuite: number; - plans: TestPlan[]; - } - export interface TestPoint { - assignedTo: VSSInterfaces.IdentityRef; - automated: boolean; - comment: string; - configuration: ShallowReference; - failureType: string; - id: number; - lastResolutionStateId: number; - lastResult: ShallowReference; - lastResultDetails: LastResultDetails; - lastRunBuildNumber: string; - lastTestRun: ShallowReference; - lastUpdatedBy: VSSInterfaces.IdentityRef; - lastUpdatedDate: Date; - outcome: string; - revision: number; - state: string; - suite: ShallowReference; - testCase: WorkItemReference; - testPlan: ShallowReference; - url: string; - workItemProperties: any[]; - } - export interface TestResolutionState { - id: number; - name: string; - project: ShallowReference; - } - export interface TestResultCreateModel { - area: ShallowReference; - associatedWorkItems: number[]; - automatedTestId: string; - automatedTestName: string; - automatedTestStorage: string; - automatedTestType: string; - automatedTestTypeId: string; - comment: string; - completedDate: string; - computerName: string; - configuration: ShallowReference; - customFields: CustomTestField[]; - durationInMs: string; - errorMessage: string; - failureType: string; - outcome: string; - owner: VSSInterfaces.IdentityRef; - resolutionState: string; - runBy: VSSInterfaces.IdentityRef; - stackTrace: string; - startedDate: string; - state: string; - testCase: ShallowReference; - testCasePriority: string; - testCaseTitle: string; - testPoint: ShallowReference; - } - export interface TestResultModelBase { - comment: string; - completedDate: Date; - durationInMs: number; - errorMessage: string; - outcome: string; - startedDate: Date; - } - export interface TestResultParameterModel { - actionPath: string; - iterationId: number; - parameterName: string; - url: string; - value: string; - } - export interface TestResultsContext { - build: BuildReference; - contextType: TestResultsContextType; - release: ReleaseReference; - } - export enum TestResultsContextType { - Build = 1, - Release = 2, - } - export interface TestResultsDetails { - groupByField: string; - resultsForGroup: TestResultsDetailsForGroup[]; - } - export interface TestResultsDetailsForGroup { - groupByValue: any; - ids: TestCaseResultIdentifier[]; - resultsCountByOutcome: { - [key: number]: AggregatedResultsByOutcome; - }; - } - export interface TestResultSummary { - aggregatedResultsAnalysis: AggregatedResultsAnalysis; - teamProject: TfsCoreInterfaces.TeamProjectReference; - testFailures: TestFailuresAnalysis; - testResultsContext: TestResultsContext; - } - export interface TestResultTrendFilter { - branchNames: string[]; - buildCount: number; - definitionIds: number[]; - publishContext: string; - testRunTitles: string[]; - } - export interface TestRun { - build: ShallowReference; - buildConfiguration: BuildConfiguration; - comment: string; - completedDate: Date; - controller: string; - createdDate: Date; - customFields: CustomTestField[]; - dropLocation: string; - dtlAutEnvironment: ShallowReference; - dtlEnvironment: ShallowReference; - dtlEnvironmentCreationDetails: DtlEnvironmentDetails; - dueDate: Date; - errorMessage: string; - filter: RunFilter; - id: number; - incompleteTests: number; - isAutomated: boolean; - iteration: string; - lastUpdatedBy: VSSInterfaces.IdentityRef; - lastUpdatedDate: Date; - name: string; - notApplicableTests: number; - owner: VSSInterfaces.IdentityRef; - passedTests: number; - phase: string; - plan: ShallowReference; - postProcessState: string; - project: ShallowReference; - releaseEnvironmentUri: string; - releaseUri: string; - revision: number; - runStatistics: RunStatistic[]; - startedDate: Date; - state: string; - substate: TestRunSubstate; - testEnvironment: TestEnvironment; - testMessageLogId: number; - testSettings: ShallowReference; - totalTests: number; - unanalyzedTests: number; - url: string; - webAccessUrl: string; - } - export interface TestRunCoverage { - lastError: string; - modules: ModuleCoverage[]; - state: string; - testRun: ShallowReference; - } - export enum TestRunState { - /** - * Only used during an update to preserve the existing value. - */ - Unspecified = 0, - /** - * The run is still being created. No tests have started yet. - */ - NotStarted = 1, - /** - * Tests are running. - */ - InProgress = 2, - /** - * All tests have completed or been skipped. - */ - Completed = 3, - /** - * Run is stopped and remaing tests have been aborted - */ - Aborted = 4, - /** - * Run is currently initializing This is a legacy state and should not be used any more - */ - Waiting = 5, - /** - * Run requires investigation because of a test point failure This is a legacy state and should not be used any more - */ - NeedsInvestigation = 6, - } - export interface TestRunStatistic { - run: ShallowReference; - runStatistics: RunStatistic[]; - } - export enum TestRunSubstate { - None = 0, - CreatingEnvironment = 1, - RunningTests = 2, - CanceledByUser = 3, - AbortedBySystem = 4, - TimedOut = 5, - PendingAnalysis = 6, - Analyzed = 7, - CancellationInProgress = 8, - } - /** - * Represents the test settings of the run. Used to create test settings and fetch test settings - */ - export interface TestSettings { - /** - * Area path required to create test settings - */ - areaPath: string; - /** - * Description of the test settings. Used in create test settings. - */ - description: string; - /** - * Indicates if the tests settings is public or private.Used in create test settings. - */ - isPublic: boolean; - /** - * Xml string of machine roles. Used in create test settings. - */ - machineRoles: string; - /** - * Test settings content. - */ - testSettingsContent: string; - /** - * Test settings id. - */ - testSettingsId: number; - /** - * Test settings name. - */ - testSettingsName: string; - } - export interface TestSuite { - areaUri: string; - children: TestSuite[]; - defaultConfigurations: ShallowReference[]; - id: number; - inheritDefaultConfigurations: boolean; - lastError: string; - lastPopulatedDate: Date; - lastUpdatedBy: VSSInterfaces.IdentityRef; - lastUpdatedDate: Date; - name: string; - parent: ShallowReference; - plan: ShallowReference; - project: ShallowReference; - queryString: string; - requirementId: number; - revision: number; - state: string; - suites: ShallowReference[]; - suiteType: string; - testCaseCount: number; - testCasesUrl: string; - text: string; - url: string; - } - export interface TestSuiteCloneRequest { - cloneOptions: CloneOptions; - destinationSuiteId: number; - destinationSuiteProjectName: string; - } - export interface TestVariable { - /** - * Description of the test variable - */ - description: string; - /** - * Id of the test variable - */ - id: number; - /** - * Name of the test variable - */ - name: string; - /** - * Project to which the test variable belongs - */ - project: ShallowReference; - /** - * Revision - */ - revision: number; - /** - * Url of the test variable - */ - url: string; - /** - * List of allowed values - */ - values: string[]; - } - export interface WorkItemReference { - id: string; - name: string; - url: string; - webUrl: string; - } - export var TypeInfo: { - AggregatedDataForResultTrend: { - fields: any; - }; - AggregatedResultsAnalysis: { - fields: any; - }; - AggregatedResultsByOutcome: { - fields: any; - }; - AggregatedResultsDifference: { - fields: any; - }; - AttachmentType: { - enumValues: { - "generalAttachment": number; - "afnStrip": number; - "bugFilingData": number; - "codeCoverage": number; - "intermediateCollectorData": number; - "runConfig": number; - "testImpactDetails": number; - "tmiTestRunDeploymentFiles": number; - "tmiTestRunReverseDeploymentFiles": number; - "tmiTestResultDetail": number; - "tmiTestRunSummary": number; - }; - }; - BatchResponse: { - fields: any; - }; - BuildConfiguration: { - fields: any; - }; - BuildCoverage: { - fields: any; - }; - BuildReference: { - fields: any; - }; - CloneOperationInformation: { - fields: any; - }; - CloneOperationState: { - enumValues: { - "failed": number; - "inProgress": number; - "queued": number; - "succeeded": number; - }; - }; - CloneOptions: { - fields: any; - }; - CloneStatistics: { - fields: any; - }; - CodeCoverageData: { - fields: any; - }; - CodeCoverageStatistics: { - fields: any; - }; - CodeCoverageSummary: { - fields: any; - }; - CoverageQueryFlags: { - enumValues: { - "modules": number; - "functions": number; - "blockData": number; - }; - }; - CoverageStatistics: { - fields: any; - }; - CustomTestField: { - fields: any; - }; - CustomTestFieldDefinition: { - fields: any; - }; - CustomTestFieldScope: { - enumValues: { - "none": number; - "testRun": number; - "testResult": number; - "system": number; - "all": number; - }; - }; - CustomTestFieldType: { - enumValues: { - "bit": number; - "dateTime": number; - "int": number; - "float": number; - "string": number; - "guid": number; - }; - }; - DtlEnvironmentDetails: { - fields: any; - }; - FailingSince: { - fields: any; - }; - FunctionCoverage: { - fields: any; - }; - GroupTestResultsBy: { - enumValues: { - "none": number; - "automatedTestStorage": number; - }; - }; - LastResultDetails: { - fields: any; - }; - ModuleCoverage: { - fields: any; - }; - NameValuePair: { - fields: any; - }; - PlanUpdateModel: { - fields: any; - }; - PointAssignment: { - fields: any; - }; - PointUpdateModel: { - fields: any; - }; - PointWorkItemProperty: { - fields: any; - }; - QueryModel: { - fields: any; - }; - ReleaseReference: { - fields: any; - }; - Response: { - fields: any; - }; - ResultDetails: { - enumValues: { - "none": number; - "iterations": number; - "workItems": number; - }; - }; - ResultObjectType: { - enumValues: { - "testSuite": number; - "testPlan": number; - }; - }; - ResultOutcome: { - enumValues: { - "pass": number; - "fail": number; - "pending": number; - }; - }; - ResultRetentionSettings: { - fields: any; - }; - ResultUpdateRequestModel: { - fields: any; - }; - ResultUpdateResponseModel: { - fields: any; - }; - RunCreateModel: { - fields: any; - }; - RunFilter: { - fields: any; - }; - RunStatistic: { - fields: any; - }; - RunUpdateModel: { - fields: any; - }; - ShallowReference: { - fields: any; - }; - SharedStepModel: { - fields: any; - }; - SuiteCreateModel: { - fields: any; - }; - SuiteTestCase: { - fields: any; - }; - SuiteUpdateModel: { - fields: any; - }; - TestActionResultModel: { - fields: any; - }; - TestAttachmentReference: { - fields: any; - }; - TestAttachmentRequestModel: { - fields: any; - }; - TestCaseResult: { - fields: any; - }; - TestCaseResult2: { - fields: any; - }; - TestCaseResultAttachmentModel: { - fields: any; - }; - TestCaseResultIdentifier: { - fields: any; - }; - TestCaseResultUpdateModel: { - fields: any; - }; - TestConfiguration: { - fields: any; - }; - TestConfigurationState: { - enumValues: { - "active": number; - "inactive": number; - }; - }; - TestEnvironment: { - fields: any; - }; - TestFailureDetails: { - fields: any; - }; - TestFailuresAnalysis: { - fields: any; - }; - TestIterationDetailsModel: { - fields: any; - }; - TestMessageLogDetails: { - fields: any; - }; - TestOutcome: { - enumValues: { - "unspecified": number; - "none": number; - "passed": number; - "failed": number; - "inconclusive": number; - "timeout": number; - "aborted": number; - "blocked": number; - "notExecuted": number; - "warning": number; - "error": number; - "notApplicable": number; - "paused": number; - "inProgress": number; - "maxValue": number; - }; - }; - TestPlan: { - fields: any; - }; - TestPlanCloneRequest: { - fields: any; - }; - TestPlansWithSelection: { - fields: any; - }; - TestPoint: { - fields: any; - }; - TestResolutionState: { - fields: any; - }; - TestResultCreateModel: { - fields: any; - }; - TestResultModelBase: { - fields: any; - }; - TestResultParameterModel: { - fields: any; - }; - TestResultsContext: { - fields: any; - }; - TestResultsContextType: { - enumValues: { - "build": number; - "release": number; - }; - }; - TestResultsDetails: { - fields: any; - }; - TestResultsDetailsForGroup: { - fields: any; - }; - TestResultSummary: { - fields: any; - }; - TestResultTrendFilter: { - fields: any; - }; - TestRun: { - fields: any; - }; - TestRunCoverage: { - fields: any; - }; - TestRunState: { - enumValues: { - "unspecified": number; - "notStarted": number; - "inProgress": number; - "completed": number; - "aborted": number; - "waiting": number; - "needsInvestigation": number; - }; - }; - TestRunStatistic: { - fields: any; - }; - TestRunSubstate: { - enumValues: { - "none": number; - "creatingEnvironment": number; - "runningTests": number; - "canceledByUser": number; - "abortedBySystem": number; - "timedOut": number; - "pendingAnalysis": number; - "analyzed": number; - "cancellationInProgress": number; - }; - }; - TestSettings: { - fields: any; - }; - TestSuite: { - fields: any; - }; - TestSuiteCloneRequest: { - fields: any; - }; - TestVariable: { - fields: any; - }; - WorkItemReference: { - fields: any; - }; - }; - -} -declare module 'vso-node-api/TestApi' { - /// - /// - import Q = require('q'); - import basem = require('vso-node-api/ClientApiBases'); - import VsoBaseInterfaces = require('vso-node-api/interfaces/common/VsoBaseInterfaces'); - import TestInterfaces = require('vso-node-api/interfaces/TestInterfaces'); - export interface ITestApi extends basem.ClientApiBase { - createTestResultAttachment(attachmentRequestModel: TestInterfaces.TestAttachmentRequestModel, project: string, runId: number, testCaseResultId: number, onResult: (err: any, statusCode: number, Attachment: TestInterfaces.TestAttachmentReference) => void): void; - getTestResultAttachmentContent(project: string, runId: number, testCaseResultId: number, attachmentId: number, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getTestResultAttachmentZip(project: string, runId: number, testCaseResultId: number, attachmentId: number, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - createTestRunAttachment(attachmentRequestModel: TestInterfaces.TestAttachmentRequestModel, project: string, runId: number, onResult: (err: any, statusCode: number, Attachment: TestInterfaces.TestAttachmentReference) => void): void; - getTestRunAttachmentContent(project: string, runId: number, attachmentId: number, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getTestRunAttachmentZip(project: string, runId: number, attachmentId: number, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getBugsLinkedToTestResult(project: string, runId: number, testCaseResultId: number, onResult: (err: any, statusCode: number, Bugs: TestInterfaces.WorkItemReference[]) => void): void; - getBuildCodeCoverage(project: string, buildId: number, flags: number, onResult: (err: any, statusCode: number, CodeCoverage: TestInterfaces.BuildCoverage[]) => void): void; - getCodeCoverageSummary(project: string, buildId: number, deltaBuildId: number, onResult: (err: any, statusCode: number, CodeCoverage: TestInterfaces.CodeCoverageSummary) => void): void; - updateCodeCoverageSummary(coverageData: TestInterfaces.CodeCoverageData, project: string, buildId: number, onResult: (err: any, statusCode: number) => void): void; - getTestRunCodeCoverage(project: string, runId: number, flags: number, onResult: (err: any, statusCode: number, CodeCoverage: TestInterfaces.TestRunCoverage[]) => void): void; - createTestConfiguration(testConfiguration: TestInterfaces.TestConfiguration, project: string, onResult: (err: any, statusCode: number, Configuration: TestInterfaces.TestConfiguration) => void): void; - deleteTestConfiguration(project: string, testConfigurationId: number, onResult: (err: any, statusCode: number) => void): void; - getTestConfigurationById(project: string, testConfigurationId: number, onResult: (err: any, statusCode: number, Configuration: TestInterfaces.TestConfiguration) => void): void; - getTestConfigurations(project: string, skip: number, top: number, includeAllProperties: boolean, onResult: (err: any, statusCode: number, Configurations: TestInterfaces.TestConfiguration[]) => void): void; - updateTestConfiguration(testConfiguration: TestInterfaces.TestConfiguration, project: string, testConfigurationId: number, onResult: (err: any, statusCode: number, Configuration: TestInterfaces.TestConfiguration) => void): void; - addCustomFields(newFields: TestInterfaces.CustomTestFieldDefinition[], project: string, onResult: (err: any, statusCode: number, ExtensionFields: TestInterfaces.CustomTestFieldDefinition[]) => void): void; - queryCustomFields(project: string, scopeFilter: TestInterfaces.CustomTestFieldScope, onResult: (err: any, statusCode: number, ExtensionFields: TestInterfaces.CustomTestFieldDefinition[]) => void): void; - getTestRunLogs(project: string, runId: number, onResult: (err: any, statusCode: number, MessageLogs: TestInterfaces.TestMessageLogDetails[]) => void): void; - getPlanCloneInformation(project: string, operationId: number, includeDetails: boolean, onResult: (err: any, statusCode: number, Plan: TestInterfaces.CloneOperationInformation) => void): void; - createTestPlan(testPlan: TestInterfaces.PlanUpdateModel, project: string, onResult: (err: any, statusCode: number, Plan: TestInterfaces.TestPlan) => void): void; - deleteTestPlan(project: string, planId: number, onResult: (err: any, statusCode: number) => void): void; - getPlanById(project: string, planId: number, onResult: (err: any, statusCode: number, Plan: TestInterfaces.TestPlan) => void): void; - getPlans(project: string, owner: string, skip: number, top: number, includePlanDetails: boolean, filterActivePlans: boolean, onResult: (err: any, statusCode: number, Plans: TestInterfaces.TestPlan[]) => void): void; - updateTestPlan(planUpdateModel: TestInterfaces.PlanUpdateModel, project: string, planId: number, onResult: (err: any, statusCode: number, Plan: TestInterfaces.TestPlan) => void): void; - cloneTestPlan(cloneRequestBody: TestInterfaces.TestPlanCloneRequest, project: string, sourcePlanId: number, onResult: (err: any, statusCode: number, Plan: TestInterfaces.CloneOperationInformation) => void): void; - getPoint(project: string, planId: number, suiteId: number, pointIds: number, witFields: string, onResult: (err: any, statusCode: number, Point: TestInterfaces.TestPoint) => void): void; - getPoints(project: string, planId: number, suiteId: number, witFields: string, configurationId: string, testCaseId: string, testPointIds: string, includePointDetails: boolean, skip: number, top: number, onResult: (err: any, statusCode: number, Points: TestInterfaces.TestPoint[]) => void): void; - updateTestPoints(pointUpdateModel: TestInterfaces.PointUpdateModel, project: string, planId: number, suiteId: number, pointIds: string, onResult: (err: any, statusCode: number, Point: TestInterfaces.TestPoint[]) => void): void; - queryTestResultRecentBugs(project: string, testRunId: number, testResultId: number, recentDays: number, onResult: (err: any, statusCode: number, RecentBugs: TestInterfaces.WorkItemReference[]) => void): void; - getTestResultDetailsForBuild(project: string, buildId: number, publishContext: string, groupBy: string, filter: string, onResult: (err: any, statusCode: number, ResultDetailsByBuild: TestInterfaces.TestResultsDetails) => void): void; - getTestResultDetailsForRelease(project: string, releaseId: number, releaseEnvId: number, publishContext: string, groupBy: string, filter: string, onResult: (err: any, statusCode: number, ResultDetailsByRelease: TestInterfaces.TestResultsDetails) => void): void; - createResultRetentionSettings(retentionSettings: TestInterfaces.ResultRetentionSettings, project: string, onResult: (err: any, statusCode: number, ResultRetentionSetting: TestInterfaces.ResultRetentionSettings) => void): void; - deleteResultRetentionSettings(project: string, onResult: (err: any, statusCode: number) => void): void; - getResultRetentionSettings(project: string, onResult: (err: any, statusCode: number, ResultRetentionSetting: TestInterfaces.ResultRetentionSettings) => void): void; - updateResultRetentionSettings(retentionSettings: TestInterfaces.ResultRetentionSettings, project: string, onResult: (err: any, statusCode: number, ResultRetentionSetting: TestInterfaces.ResultRetentionSettings) => void): void; - getTestIteration(project: string, runId: number, testCaseResultId: number, iterationId: number, includeActionResults: boolean, onResult: (err: any, statusCode: number, Result: TestInterfaces.TestIterationDetailsModel) => void): void; - getTestIterations(project: string, runId: number, testCaseResultId: number, includeActionResults: boolean, onResult: (err: any, statusCode: number, Results: TestInterfaces.TestIterationDetailsModel[]) => void): void; - addTestResultsToTestRun(resultCreateModels: TestInterfaces.TestResultCreateModel[], project: string, runId: number, onResult: (err: any, statusCode: number, Results: TestInterfaces.TestCaseResult[]) => void): void; - bulkUpdateTestResults(resultUpdateModel: TestInterfaces.TestCaseResultUpdateModel, project: string, runId: number, resultIds: number[], onResult: (err: any, statusCode: number, Result: TestInterfaces.TestCaseResult[]) => void): void; - getTestCaseResultById(project: string, runId: number, testCaseResultId: number, includeIterationDetails: boolean, includeAssociatedBugs: boolean, onResult: (err: any, statusCode: number, Result: TestInterfaces.TestCaseResult) => void): void; - getTestCaseResults(project: string, runId: number, includeIterationDetails: boolean, onResult: (err: any, statusCode: number, Results: TestInterfaces.TestCaseResult[]) => void): void; - getTestResultById(project: string, runId: number, testCaseResultId: number, detailsToInclude: TestInterfaces.ResultDetails, onResult: (err: any, statusCode: number, Results: TestInterfaces.TestCaseResult[]) => void): void; - getTestResults(project: string, runId: number, detailsToInclude: TestInterfaces.ResultDetails, skip: number, top: number, onResult: (err: any, statusCode: number, Results: TestInterfaces.TestCaseResult[]) => void): void; - updateTestResults(resultUpdateModels: TestInterfaces.TestCaseResultUpdateModel[], project: string, runId: number, onResult: (err: any, statusCode: number, Results: TestInterfaces.TestCaseResult[]) => void): void; - getTestResultsByIds(ids: TestInterfaces.TestCaseResultIdentifier[], project: string, fields: string[], onResult: (err: any, statusCode: number, Results: TestInterfaces.TestCaseResult[]) => void): void; - getActionResults(project: string, runId: number, testCaseResultId: number, iterationId: number, actionPath: string, onResult: (err: any, statusCode: number, Results: TestInterfaces.TestActionResultModel[]) => void): void; - getResultParameters(project: string, runId: number, testCaseResultId: number, iterationId: number, paramName: string, onResult: (err: any, statusCode: number, Results: TestInterfaces.TestResultParameterModel[]) => void): void; - getTestResultsByQuery(query: TestInterfaces.QueryModel, project: string, includeResultDetails: boolean, includeIterationDetails: boolean, skip: number, top: number, onResult: (err: any, statusCode: number, Result: TestInterfaces.TestCaseResult[]) => void): void; - queryTestResultsReportForBuild(project: string, buildId: number, publishContext: string, includeFailureDetails: boolean, buildToCompare: TestInterfaces.BuildReference, onResult: (err: any, statusCode: number, ResultSummaryByBuild: TestInterfaces.TestResultSummary) => void): void; - queryTestResultsReportForRelease(project: string, releaseId: number, releaseEnvId: number, publishContext: string, includeFailureDetails: boolean, releaseToCompare: TestInterfaces.ReleaseReference, onResult: (err: any, statusCode: number, ResultSummaryByRelease: TestInterfaces.TestResultSummary) => void): void; - queryTestResultTrendReport(project: string, testRunId: number, testResultId: number, historyDays: number, top: number, onResult: (err: any, statusCode: number, ResultTrend: TestInterfaces.TestCaseResult[]) => void): void; - queryResultTrendForBuild(filter: TestInterfaces.TestResultTrendFilter, project: string, onResult: (err: any, statusCode: number, ResultTrendByBuild: TestInterfaces.AggregatedDataForResultTrend[]) => void): void; - getTestRunStatistics(project: string, runId: number, onResult: (err: any, statusCode: number, Run: TestInterfaces.TestRunStatistic) => void): void; - getTestRunsByQuery(query: TestInterfaces.QueryModel, project: string, includeRunDetails: boolean, skip: number, top: number, onResult: (err: any, statusCode: number, Run: TestInterfaces.TestRun[]) => void): void; - createTestRun(testRun: TestInterfaces.RunCreateModel, project: string, onResult: (err: any, statusCode: number, Run: TestInterfaces.TestRun) => void): void; - deleteTestRun(project: string, runId: number, onResult: (err: any, statusCode: number) => void): void; - getTestRunById(project: string, runId: number, onResult: (err: any, statusCode: number, Run: TestInterfaces.TestRun) => void): void; - getTestRuns(project: string, buildUri: string, owner: string, tmiRunId: string, planId: number, includeRunDetails: boolean, automated: boolean, skip: number, top: number, onResult: (err: any, statusCode: number, Runs: TestInterfaces.TestRun[]) => void): void; - updateTestRun(runUpdateModel: TestInterfaces.RunUpdateModel, project: string, runId: number, onResult: (err: any, statusCode: number, Run: TestInterfaces.TestRun) => void): void; - getSuiteCloneInformation(project: string, operationId: number, includeDetails: boolean, onResult: (err: any, statusCode: number, Suite: TestInterfaces.CloneOperationInformation) => void): void; - addTestCasesToSuite(project: string, planId: number, suiteId: number, testCaseIds: string, onResult: (err: any, statusCode: number, Suites: TestInterfaces.SuiteTestCase[]) => void): void; - getTestCaseById(project: string, planId: number, suiteId: number, testCaseIds: number, onResult: (err: any, statusCode: number, Suite: TestInterfaces.SuiteTestCase) => void): void; - getTestCases(project: string, planId: number, suiteId: number, onResult: (err: any, statusCode: number, Suites: TestInterfaces.SuiteTestCase[]) => void): void; - removeTestCasesFromSuiteUrl(project: string, planId: number, suiteId: number, testCaseIds: string, onResult: (err: any, statusCode: number) => void): void; - createTestSuite(testSuite: TestInterfaces.SuiteCreateModel, project: string, planId: number, suiteId: number, onResult: (err: any, statusCode: number, Suite: TestInterfaces.TestSuite[]) => void): void; - deleteTestSuite(project: string, planId: number, suiteId: number, onResult: (err: any, statusCode: number) => void): void; - getTestSuiteById(project: string, planId: number, suiteId: number, includeChildSuites: boolean, onResult: (err: any, statusCode: number, Suite: TestInterfaces.TestSuite) => void): void; - getTestSuitesForPlan(project: string, planId: number, includeSuites: boolean, skip: number, top: number, asTreeView: boolean, onResult: (err: any, statusCode: number, Suites: TestInterfaces.TestSuite[]) => void): void; - updateTestSuite(suiteUpdateModel: TestInterfaces.SuiteUpdateModel, project: string, planId: number, suiteId: number, onResult: (err: any, statusCode: number, Suite: TestInterfaces.TestSuite) => void): void; - cloneTestSuite(cloneRequestBody: TestInterfaces.TestSuiteCloneRequest, project: string, sourceSuiteId: number, planId: number, onResult: (err: any, statusCode: number, Suite: TestInterfaces.CloneOperationInformation) => void): void; - getSuitesByTestCaseId(testCaseId: number, onResult: (err: any, statusCode: number, Suites: TestInterfaces.TestSuite[]) => void): void; - createTestSettings(testSettings: TestInterfaces.TestSettings, project: string, onResult: (err: any, statusCode: number, TestSetting: number) => void): void; - deleteTestSettings(project: string, testSettingsId: number, onResult: (err: any, statusCode: number) => void): void; - getTestSettingsById(project: string, testSettingsId: number, onResult: (err: any, statusCode: number, TestSetting: TestInterfaces.TestSettings) => void): void; - createTestVariable(testVariable: TestInterfaces.TestVariable, project: string, onResult: (err: any, statusCode: number, Variable: TestInterfaces.TestVariable) => void): void; - deleteTestVariable(project: string, testVariableId: number, onResult: (err: any, statusCode: number) => void): void; - getTestVariable(project: string, testVariableId: number, onResult: (err: any, statusCode: number, Variable: TestInterfaces.TestVariable) => void): void; - getTestVariables(project: string, skip: number, top: number, onResult: (err: any, statusCode: number, Variables: TestInterfaces.TestVariable[]) => void): void; - updateTestVariable(testVariable: TestInterfaces.TestVariable, project: string, testVariableId: number, onResult: (err: any, statusCode: number, Variable: TestInterfaces.TestVariable) => void): void; - } - export interface IQTestApi extends basem.QClientApiBase { - createTestResultAttachment(attachmentRequestModel: TestInterfaces.TestAttachmentRequestModel, project: string, runId: number, testCaseResultId: number): Q.Promise; - getTestResultAttachmentContent(project: string, runId: number, testCaseResultId: number, attachmentId: number): Q.Promise; - getTestResultAttachmentZip(project: string, runId: number, testCaseResultId: number, attachmentId: number): Q.Promise; - createTestRunAttachment(attachmentRequestModel: TestInterfaces.TestAttachmentRequestModel, project: string, runId: number): Q.Promise; - getTestRunAttachmentContent(project: string, runId: number, attachmentId: number): Q.Promise; - getTestRunAttachmentZip(project: string, runId: number, attachmentId: number): Q.Promise; - getBugsLinkedToTestResult(project: string, runId: number, testCaseResultId: number): Q.Promise; - getBuildCodeCoverage(project: string, buildId: number, flags: number): Q.Promise; - getCodeCoverageSummary(project: string, buildId: number, deltaBuildId?: number): Q.Promise; - updateCodeCoverageSummary(coverageData: TestInterfaces.CodeCoverageData, project: string, buildId: number): Q.Promise; - getTestRunCodeCoverage(project: string, runId: number, flags: number): Q.Promise; - createTestConfiguration(testConfiguration: TestInterfaces.TestConfiguration, project: string): Q.Promise; - deleteTestConfiguration(project: string, testConfigurationId: number): Q.Promise; - getTestConfigurationById(project: string, testConfigurationId: number): Q.Promise; - getTestConfigurations(project: string, skip?: number, top?: number, includeAllProperties?: boolean): Q.Promise; - updateTestConfiguration(testConfiguration: TestInterfaces.TestConfiguration, project: string, testConfigurationId: number): Q.Promise; - addCustomFields(newFields: TestInterfaces.CustomTestFieldDefinition[], project: string): Q.Promise; - queryCustomFields(project: string, scopeFilter: TestInterfaces.CustomTestFieldScope): Q.Promise; - getTestRunLogs(project: string, runId: number): Q.Promise; - getPlanCloneInformation(project: string, operationId: number, includeDetails?: boolean): Q.Promise; - createTestPlan(testPlan: TestInterfaces.PlanUpdateModel, project: string): Q.Promise; - deleteTestPlan(project: string, planId: number): Q.Promise; - getPlanById(project: string, planId: number): Q.Promise; - getPlans(project: string, owner?: string, skip?: number, top?: number, includePlanDetails?: boolean, filterActivePlans?: boolean): Q.Promise; - updateTestPlan(planUpdateModel: TestInterfaces.PlanUpdateModel, project: string, planId: number): Q.Promise; - cloneTestPlan(cloneRequestBody: TestInterfaces.TestPlanCloneRequest, project: string, sourcePlanId: number): Q.Promise; - getPoint(project: string, planId: number, suiteId: number, pointIds: number, witFields?: string): Q.Promise; - getPoints(project: string, planId: number, suiteId: number, witFields?: string, configurationId?: string, testCaseId?: string, testPointIds?: string, includePointDetails?: boolean, skip?: number, top?: number): Q.Promise; - updateTestPoints(pointUpdateModel: TestInterfaces.PointUpdateModel, project: string, planId: number, suiteId: number, pointIds: string): Q.Promise; - queryTestResultRecentBugs(project: string, testRunId: number, testResultId: number, recentDays?: number): Q.Promise; - getTestResultDetailsForBuild(project: string, buildId: number, publishContext?: string, groupBy?: string, filter?: string): Q.Promise; - getTestResultDetailsForRelease(project: string, releaseId: number, releaseEnvId: number, publishContext?: string, groupBy?: string, filter?: string): Q.Promise; - createResultRetentionSettings(retentionSettings: TestInterfaces.ResultRetentionSettings, project: string): Q.Promise; - deleteResultRetentionSettings(project: string): Q.Promise; - getResultRetentionSettings(project: string): Q.Promise; - updateResultRetentionSettings(retentionSettings: TestInterfaces.ResultRetentionSettings, project: string): Q.Promise; - getTestIteration(project: string, runId: number, testCaseResultId: number, iterationId: number, includeActionResults?: boolean): Q.Promise; - getTestIterations(project: string, runId: number, testCaseResultId: number, includeActionResults?: boolean): Q.Promise; - addTestResultsToTestRun(resultCreateModels: TestInterfaces.TestResultCreateModel[], project: string, runId: number): Q.Promise; - bulkUpdateTestResults(resultUpdateModel: TestInterfaces.TestCaseResultUpdateModel, project: string, runId: number, resultIds: number[]): Q.Promise; - getTestCaseResultById(project: string, runId: number, testCaseResultId: number, includeIterationDetails: boolean, includeAssociatedBugs?: boolean): Q.Promise; - getTestCaseResults(project: string, runId: number, includeIterationDetails: boolean): Q.Promise; - getTestResultById(project: string, runId: number, testCaseResultId: number, detailsToInclude?: TestInterfaces.ResultDetails): Q.Promise; - getTestResults(project: string, runId: number, detailsToInclude?: TestInterfaces.ResultDetails, skip?: number, top?: number): Q.Promise; - updateTestResults(resultUpdateModels: TestInterfaces.TestCaseResultUpdateModel[], project: string, runId: number): Q.Promise; - getTestResultsByIds(ids: TestInterfaces.TestCaseResultIdentifier[], project: string, fields: string[]): Q.Promise; - getActionResults(project: string, runId: number, testCaseResultId: number, iterationId: number, actionPath?: string): Q.Promise; - getResultParameters(project: string, runId: number, testCaseResultId: number, iterationId: number, paramName?: string): Q.Promise; - getTestResultsByQuery(query: TestInterfaces.QueryModel, project: string, includeResultDetails?: boolean, includeIterationDetails?: boolean, skip?: number, top?: number): Q.Promise; - queryTestResultsReportForBuild(project: string, buildId: number, publishContext?: string, includeFailureDetails?: boolean, buildToCompare?: TestInterfaces.BuildReference): Q.Promise; - queryTestResultsReportForRelease(project: string, releaseId: number, releaseEnvId: number, publishContext?: string, includeFailureDetails?: boolean, releaseToCompare?: TestInterfaces.ReleaseReference): Q.Promise; - queryTestResultTrendReport(project: string, testRunId: number, testResultId: number, historyDays?: number, top?: number): Q.Promise; - queryResultTrendForBuild(filter: TestInterfaces.TestResultTrendFilter, project: string): Q.Promise; - getTestRunStatistics(project: string, runId: number): Q.Promise; - getTestRunsByQuery(query: TestInterfaces.QueryModel, project: string, includeRunDetails?: boolean, skip?: number, top?: number): Q.Promise; - createTestRun(testRun: TestInterfaces.RunCreateModel, project: string): Q.Promise; - deleteTestRun(project: string, runId: number): Q.Promise; - getTestRunById(project: string, runId: number): Q.Promise; - getTestRuns(project: string, buildUri?: string, owner?: string, tmiRunId?: string, planId?: number, includeRunDetails?: boolean, automated?: boolean, skip?: number, top?: number): Q.Promise; - updateTestRun(runUpdateModel: TestInterfaces.RunUpdateModel, project: string, runId: number): Q.Promise; - getSuiteCloneInformation(project: string, operationId: number, includeDetails?: boolean): Q.Promise; - addTestCasesToSuite(project: string, planId: number, suiteId: number, testCaseIds: string): Q.Promise; - getTestCaseById(project: string, planId: number, suiteId: number, testCaseIds: number): Q.Promise; - getTestCases(project: string, planId: number, suiteId: number): Q.Promise; - removeTestCasesFromSuiteUrl(project: string, planId: number, suiteId: number, testCaseIds: string): Q.Promise; - createTestSuite(testSuite: TestInterfaces.SuiteCreateModel, project: string, planId: number, suiteId: number): Q.Promise; - deleteTestSuite(project: string, planId: number, suiteId: number): Q.Promise; - getTestSuiteById(project: string, planId: number, suiteId: number, includeChildSuites?: boolean): Q.Promise; - getTestSuitesForPlan(project: string, planId: number, includeSuites?: boolean, skip?: number, top?: number, asTreeView?: boolean): Q.Promise; - updateTestSuite(suiteUpdateModel: TestInterfaces.SuiteUpdateModel, project: string, planId: number, suiteId: number): Q.Promise; - cloneTestSuite(cloneRequestBody: TestInterfaces.TestSuiteCloneRequest, project: string, sourceSuiteId: number, planId: number): Q.Promise; - getSuitesByTestCaseId(testCaseId: number): Q.Promise; - createTestSettings(testSettings: TestInterfaces.TestSettings, project: string): Q.Promise; - deleteTestSettings(project: string, testSettingsId: number): Q.Promise; - getTestSettingsById(project: string, testSettingsId: number): Q.Promise; - createTestVariable(testVariable: TestInterfaces.TestVariable, project: string): Q.Promise; - deleteTestVariable(project: string, testVariableId: number): Q.Promise; - getTestVariable(project: string, testVariableId: number): Q.Promise; - getTestVariables(project: string, skip?: number, top?: number): Q.Promise; - updateTestVariable(testVariable: TestInterfaces.TestVariable, project: string, testVariableId: number): Q.Promise; - } - export class TestApi extends basem.ClientApiBase implements ITestApi { - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]); - /** - * @param {TestInterfaces.TestAttachmentRequestModel} attachmentRequestModel - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} testCaseResultId - * @param onResult callback function with the resulting TestInterfaces.TestAttachmentReference - */ - createTestResultAttachment(attachmentRequestModel: TestInterfaces.TestAttachmentRequestModel, project: string, runId: number, testCaseResultId: number, onResult: (err: any, statusCode: number, Attachment: TestInterfaces.TestAttachmentReference) => void): void; - /** - * Returns a test result attachment - * - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} testCaseResultId - * @param {number} attachmentId - * @param onResult callback function with the resulting ArrayBuffer - */ - getTestResultAttachmentContent(project: string, runId: number, testCaseResultId: number, attachmentId: number, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * Returns a test result attachment - * - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} testCaseResultId - * @param {number} attachmentId - * @param onResult callback function with the resulting ArrayBuffer - */ - getTestResultAttachmentZip(project: string, runId: number, testCaseResultId: number, attachmentId: number, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * @param {TestInterfaces.TestAttachmentRequestModel} attachmentRequestModel - * @param {string} project - Project ID or project name - * @param {number} runId - * @param onResult callback function with the resulting TestInterfaces.TestAttachmentReference - */ - createTestRunAttachment(attachmentRequestModel: TestInterfaces.TestAttachmentRequestModel, project: string, runId: number, onResult: (err: any, statusCode: number, Attachment: TestInterfaces.TestAttachmentReference) => void): void; - /** - * Returns a test run attachment - * - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} attachmentId - * @param onResult callback function with the resulting ArrayBuffer - */ - getTestRunAttachmentContent(project: string, runId: number, attachmentId: number, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * Returns a test run attachment - * - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} attachmentId - * @param onResult callback function with the resulting ArrayBuffer - */ - getTestRunAttachmentZip(project: string, runId: number, attachmentId: number, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} testCaseResultId - * @param onResult callback function with the resulting TestInterfaces.WorkItemReference[] - */ - getBugsLinkedToTestResult(project: string, runId: number, testCaseResultId: number, onResult: (err: any, statusCode: number, Bugs: TestInterfaces.WorkItemReference[]) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {number} flags - * @param onResult callback function with the resulting TestInterfaces.BuildCoverage[] - */ - getBuildCodeCoverage(project: string, buildId: number, flags: number, onResult: (err: any, statusCode: number, CodeCoverage: TestInterfaces.BuildCoverage[]) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {number} deltaBuildId - * @param onResult callback function with the resulting TestInterfaces.CodeCoverageSummary - */ - getCodeCoverageSummary(project: string, buildId: number, deltaBuildId: number, onResult: (err: any, statusCode: number, CodeCoverage: TestInterfaces.CodeCoverageSummary) => void): void; - /** - * http://(tfsserver):8080/tfs/DefaultCollection/_apis/test/CodeCoverage?buildId=10 Request: Json of code coverage summary - * - * @param {TestInterfaces.CodeCoverageData} coverageData - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param onResult callback function - */ - updateCodeCoverageSummary(coverageData: TestInterfaces.CodeCoverageData, project: string, buildId: number, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} flags - * @param onResult callback function with the resulting TestInterfaces.TestRunCoverage[] - */ - getTestRunCodeCoverage(project: string, runId: number, flags: number, onResult: (err: any, statusCode: number, CodeCoverage: TestInterfaces.TestRunCoverage[]) => void): void; - /** - * @param {TestInterfaces.TestConfiguration} testConfiguration - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting TestInterfaces.TestConfiguration - */ - createTestConfiguration(testConfiguration: TestInterfaces.TestConfiguration, project: string, onResult: (err: any, statusCode: number, Configuration: TestInterfaces.TestConfiguration) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} testConfigurationId - * @param onResult callback function - */ - deleteTestConfiguration(project: string, testConfigurationId: number, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} testConfigurationId - * @param onResult callback function with the resulting TestInterfaces.TestConfiguration - */ - getTestConfigurationById(project: string, testConfigurationId: number, onResult: (err: any, statusCode: number, Configuration: TestInterfaces.TestConfiguration) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} skip - * @param {number} top - * @param {boolean} includeAllProperties - * @param onResult callback function with the resulting TestInterfaces.TestConfiguration[] - */ - getTestConfigurations(project: string, skip: number, top: number, includeAllProperties: boolean, onResult: (err: any, statusCode: number, Configurations: TestInterfaces.TestConfiguration[]) => void): void; - /** - * @param {TestInterfaces.TestConfiguration} testConfiguration - * @param {string} project - Project ID or project name - * @param {number} testConfigurationId - * @param onResult callback function with the resulting TestInterfaces.TestConfiguration - */ - updateTestConfiguration(testConfiguration: TestInterfaces.TestConfiguration, project: string, testConfigurationId: number, onResult: (err: any, statusCode: number, Configuration: TestInterfaces.TestConfiguration) => void): void; - /** - * @param {TestInterfaces.CustomTestFieldDefinition[]} newFields - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting TestInterfaces.CustomTestFieldDefinition[] - */ - addCustomFields(newFields: TestInterfaces.CustomTestFieldDefinition[], project: string, onResult: (err: any, statusCode: number, ExtensionFields: TestInterfaces.CustomTestFieldDefinition[]) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {TestInterfaces.CustomTestFieldScope} scopeFilter - * @param onResult callback function with the resulting TestInterfaces.CustomTestFieldDefinition[] - */ - queryCustomFields(project: string, scopeFilter: TestInterfaces.CustomTestFieldScope, onResult: (err: any, statusCode: number, ExtensionFields: TestInterfaces.CustomTestFieldDefinition[]) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param onResult callback function with the resulting TestInterfaces.TestMessageLogDetails[] - */ - getTestRunLogs(project: string, runId: number, onResult: (err: any, statusCode: number, MessageLogs: TestInterfaces.TestMessageLogDetails[]) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} operationId - * @param {boolean} includeDetails - * @param onResult callback function with the resulting TestInterfaces.CloneOperationInformation - */ - getPlanCloneInformation(project: string, operationId: number, includeDetails: boolean, onResult: (err: any, statusCode: number, Plan: TestInterfaces.CloneOperationInformation) => void): void; - /** - * @param {TestInterfaces.PlanUpdateModel} testPlan - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting TestInterfaces.TestPlan - */ - createTestPlan(testPlan: TestInterfaces.PlanUpdateModel, project: string, onResult: (err: any, statusCode: number, Plan: TestInterfaces.TestPlan) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} planId - * @param onResult callback function - */ - deleteTestPlan(project: string, planId: number, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} planId - * @param onResult callback function with the resulting TestInterfaces.TestPlan - */ - getPlanById(project: string, planId: number, onResult: (err: any, statusCode: number, Plan: TestInterfaces.TestPlan) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {string} owner - * @param {number} skip - * @param {number} top - * @param {boolean} includePlanDetails - * @param {boolean} filterActivePlans - * @param onResult callback function with the resulting TestInterfaces.TestPlan[] - */ - getPlans(project: string, owner: string, skip: number, top: number, includePlanDetails: boolean, filterActivePlans: boolean, onResult: (err: any, statusCode: number, Plans: TestInterfaces.TestPlan[]) => void): void; - /** - * @param {TestInterfaces.PlanUpdateModel} planUpdateModel - * @param {string} project - Project ID or project name - * @param {number} planId - * @param onResult callback function with the resulting TestInterfaces.TestPlan - */ - updateTestPlan(planUpdateModel: TestInterfaces.PlanUpdateModel, project: string, planId: number, onResult: (err: any, statusCode: number, Plan: TestInterfaces.TestPlan) => void): void; - /** - * @param {TestInterfaces.TestPlanCloneRequest} cloneRequestBody - * @param {string} project - Project ID or project name - * @param {number} sourcePlanId - * @param onResult callback function with the resulting TestInterfaces.CloneOperationInformation - */ - cloneTestPlan(cloneRequestBody: TestInterfaces.TestPlanCloneRequest, project: string, sourcePlanId: number, onResult: (err: any, statusCode: number, Plan: TestInterfaces.CloneOperationInformation) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} planId - * @param {number} suiteId - * @param {number} pointIds - * @param {string} witFields - * @param onResult callback function with the resulting TestInterfaces.TestPoint - */ - getPoint(project: string, planId: number, suiteId: number, pointIds: number, witFields: string, onResult: (err: any, statusCode: number, Point: TestInterfaces.TestPoint) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} planId - * @param {number} suiteId - * @param {string} witFields - * @param {string} configurationId - * @param {string} testCaseId - * @param {string} testPointIds - * @param {boolean} includePointDetails - * @param {number} skip - * @param {number} top - * @param onResult callback function with the resulting TestInterfaces.TestPoint[] - */ - getPoints(project: string, planId: number, suiteId: number, witFields: string, configurationId: string, testCaseId: string, testPointIds: string, includePointDetails: boolean, skip: number, top: number, onResult: (err: any, statusCode: number, Points: TestInterfaces.TestPoint[]) => void): void; - /** - * @param {TestInterfaces.PointUpdateModel} pointUpdateModel - * @param {string} project - Project ID or project name - * @param {number} planId - * @param {number} suiteId - * @param {string} pointIds - * @param onResult callback function with the resulting TestInterfaces.TestPoint[] - */ - updateTestPoints(pointUpdateModel: TestInterfaces.PointUpdateModel, project: string, planId: number, suiteId: number, pointIds: string, onResult: (err: any, statusCode: number, Point: TestInterfaces.TestPoint[]) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} testRunId - * @param {number} testResultId - * @param {number} recentDays - * @param onResult callback function with the resulting TestInterfaces.WorkItemReference[] - */ - queryTestResultRecentBugs(project: string, testRunId: number, testResultId: number, recentDays: number, onResult: (err: any, statusCode: number, RecentBugs: TestInterfaces.WorkItemReference[]) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {string} publishContext - * @param {string} groupBy - * @param {string} filter - * @param onResult callback function with the resulting TestInterfaces.TestResultsDetails - */ - getTestResultDetailsForBuild(project: string, buildId: number, publishContext: string, groupBy: string, filter: string, onResult: (err: any, statusCode: number, ResultDetailsByBuild: TestInterfaces.TestResultsDetails) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {number} releaseEnvId - * @param {string} publishContext - * @param {string} groupBy - * @param {string} filter - * @param onResult callback function with the resulting TestInterfaces.TestResultsDetails - */ - getTestResultDetailsForRelease(project: string, releaseId: number, releaseEnvId: number, publishContext: string, groupBy: string, filter: string, onResult: (err: any, statusCode: number, ResultDetailsByRelease: TestInterfaces.TestResultsDetails) => void): void; - /** - * @param {TestInterfaces.ResultRetentionSettings} retentionSettings - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting TestInterfaces.ResultRetentionSettings - */ - createResultRetentionSettings(retentionSettings: TestInterfaces.ResultRetentionSettings, project: string, onResult: (err: any, statusCode: number, ResultRetentionSetting: TestInterfaces.ResultRetentionSettings) => void): void; - /** - * @param {string} project - Project ID or project name - * @param onResult callback function - */ - deleteResultRetentionSettings(project: string, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting TestInterfaces.ResultRetentionSettings - */ - getResultRetentionSettings(project: string, onResult: (err: any, statusCode: number, ResultRetentionSetting: TestInterfaces.ResultRetentionSettings) => void): void; - /** - * @param {TestInterfaces.ResultRetentionSettings} retentionSettings - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting TestInterfaces.ResultRetentionSettings - */ - updateResultRetentionSettings(retentionSettings: TestInterfaces.ResultRetentionSettings, project: string, onResult: (err: any, statusCode: number, ResultRetentionSetting: TestInterfaces.ResultRetentionSettings) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} testCaseResultId - * @param {number} iterationId - * @param {boolean} includeActionResults - * @param onResult callback function with the resulting TestInterfaces.TestIterationDetailsModel - */ - getTestIteration(project: string, runId: number, testCaseResultId: number, iterationId: number, includeActionResults: boolean, onResult: (err: any, statusCode: number, Result: TestInterfaces.TestIterationDetailsModel) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} testCaseResultId - * @param {boolean} includeActionResults - * @param onResult callback function with the resulting TestInterfaces.TestIterationDetailsModel[] - */ - getTestIterations(project: string, runId: number, testCaseResultId: number, includeActionResults: boolean, onResult: (err: any, statusCode: number, Results: TestInterfaces.TestIterationDetailsModel[]) => void): void; - /** - * @param {TestInterfaces.TestResultCreateModel[]} resultCreateModels - * @param {string} project - Project ID or project name - * @param {number} runId - * @param onResult callback function with the resulting TestInterfaces.TestCaseResult[] - */ - addTestResultsToTestRun(resultCreateModels: TestInterfaces.TestResultCreateModel[], project: string, runId: number, onResult: (err: any, statusCode: number, Results: TestInterfaces.TestCaseResult[]) => void): void; - /** - * @param {TestInterfaces.TestCaseResultUpdateModel} resultUpdateModel - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number[]} resultIds - * @param onResult callback function with the resulting TestInterfaces.TestCaseResult[] - */ - bulkUpdateTestResults(resultUpdateModel: TestInterfaces.TestCaseResultUpdateModel, project: string, runId: number, resultIds: number[], onResult: (err: any, statusCode: number, Result: TestInterfaces.TestCaseResult[]) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} testCaseResultId - * @param {boolean} includeIterationDetails - * @param {boolean} includeAssociatedBugs - * @param onResult callback function with the resulting TestInterfaces.TestCaseResult - */ - getTestCaseResultById(project: string, runId: number, testCaseResultId: number, includeIterationDetails: boolean, includeAssociatedBugs: boolean, onResult: (err: any, statusCode: number, Result: TestInterfaces.TestCaseResult) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {boolean} includeIterationDetails - * @param onResult callback function with the resulting TestInterfaces.TestCaseResult[] - */ - getTestCaseResults(project: string, runId: number, includeIterationDetails: boolean, onResult: (err: any, statusCode: number, Results: TestInterfaces.TestCaseResult[]) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} testCaseResultId - * @param {TestInterfaces.ResultDetails} detailsToInclude - * @param onResult callback function with the resulting TestInterfaces.TestCaseResult[] - */ - getTestResultById(project: string, runId: number, testCaseResultId: number, detailsToInclude: TestInterfaces.ResultDetails, onResult: (err: any, statusCode: number, Results: TestInterfaces.TestCaseResult[]) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {TestInterfaces.ResultDetails} detailsToInclude - * @param {number} skip - * @param {number} top - * @param onResult callback function with the resulting TestInterfaces.TestCaseResult[] - */ - getTestResults(project: string, runId: number, detailsToInclude: TestInterfaces.ResultDetails, skip: number, top: number, onResult: (err: any, statusCode: number, Results: TestInterfaces.TestCaseResult[]) => void): void; - /** - * @param {TestInterfaces.TestCaseResultUpdateModel[]} resultUpdateModels - * @param {string} project - Project ID or project name - * @param {number} runId - * @param onResult callback function with the resulting TestInterfaces.TestCaseResult[] - */ - updateTestResults(resultUpdateModels: TestInterfaces.TestCaseResultUpdateModel[], project: string, runId: number, onResult: (err: any, statusCode: number, Results: TestInterfaces.TestCaseResult[]) => void): void; - /** - * @param {TestInterfaces.TestCaseResultIdentifier[]} ids - * @param {string} project - Project ID or project name - * @param {string[]} fields - * @param onResult callback function with the resulting TestInterfaces.TestCaseResult[] - */ - getTestResultsByIds(ids: TestInterfaces.TestCaseResultIdentifier[], project: string, fields: string[], onResult: (err: any, statusCode: number, Results: TestInterfaces.TestCaseResult[]) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} testCaseResultId - * @param {number} iterationId - * @param {string} actionPath - * @param onResult callback function with the resulting TestInterfaces.TestActionResultModel[] - */ - getActionResults(project: string, runId: number, testCaseResultId: number, iterationId: number, actionPath: string, onResult: (err: any, statusCode: number, Results: TestInterfaces.TestActionResultModel[]) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} testCaseResultId - * @param {number} iterationId - * @param {string} paramName - * @param onResult callback function with the resulting TestInterfaces.TestResultParameterModel[] - */ - getResultParameters(project: string, runId: number, testCaseResultId: number, iterationId: number, paramName: string, onResult: (err: any, statusCode: number, Results: TestInterfaces.TestResultParameterModel[]) => void): void; - /** - * @param {TestInterfaces.QueryModel} query - * @param {string} project - Project ID or project name - * @param {boolean} includeResultDetails - * @param {boolean} includeIterationDetails - * @param {number} skip - * @param {number} top - * @param onResult callback function with the resulting TestInterfaces.TestCaseResult[] - */ - getTestResultsByQuery(query: TestInterfaces.QueryModel, project: string, includeResultDetails: boolean, includeIterationDetails: boolean, skip: number, top: number, onResult: (err: any, statusCode: number, Result: TestInterfaces.TestCaseResult[]) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {string} publishContext - * @param {boolean} includeFailureDetails - * @param {TestInterfaces.BuildReference} buildToCompare - * @param onResult callback function with the resulting TestInterfaces.TestResultSummary - */ - queryTestResultsReportForBuild(project: string, buildId: number, publishContext: string, includeFailureDetails: boolean, buildToCompare: TestInterfaces.BuildReference, onResult: (err: any, statusCode: number, ResultSummaryByBuild: TestInterfaces.TestResultSummary) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {number} releaseEnvId - * @param {string} publishContext - * @param {boolean} includeFailureDetails - * @param {TestInterfaces.ReleaseReference} releaseToCompare - * @param onResult callback function with the resulting TestInterfaces.TestResultSummary - */ - queryTestResultsReportForRelease(project: string, releaseId: number, releaseEnvId: number, publishContext: string, includeFailureDetails: boolean, releaseToCompare: TestInterfaces.ReleaseReference, onResult: (err: any, statusCode: number, ResultSummaryByRelease: TestInterfaces.TestResultSummary) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} testRunId - * @param {number} testResultId - * @param {number} historyDays - * @param {number} top - * @param onResult callback function with the resulting TestInterfaces.TestCaseResult[] - */ - queryTestResultTrendReport(project: string, testRunId: number, testResultId: number, historyDays: number, top: number, onResult: (err: any, statusCode: number, ResultTrend: TestInterfaces.TestCaseResult[]) => void): void; - /** - * @param {TestInterfaces.TestResultTrendFilter} filter - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting TestInterfaces.AggregatedDataForResultTrend[] - */ - queryResultTrendForBuild(filter: TestInterfaces.TestResultTrendFilter, project: string, onResult: (err: any, statusCode: number, ResultTrendByBuild: TestInterfaces.AggregatedDataForResultTrend[]) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param onResult callback function with the resulting TestInterfaces.TestRunStatistic - */ - getTestRunStatistics(project: string, runId: number, onResult: (err: any, statusCode: number, Run: TestInterfaces.TestRunStatistic) => void): void; - /** - * @param {TestInterfaces.QueryModel} query - * @param {string} project - Project ID or project name - * @param {boolean} includeRunDetails - * @param {number} skip - * @param {number} top - * @param onResult callback function with the resulting TestInterfaces.TestRun[] - */ - getTestRunsByQuery(query: TestInterfaces.QueryModel, project: string, includeRunDetails: boolean, skip: number, top: number, onResult: (err: any, statusCode: number, Run: TestInterfaces.TestRun[]) => void): void; - /** - * @param {TestInterfaces.RunCreateModel} testRun - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting TestInterfaces.TestRun - */ - createTestRun(testRun: TestInterfaces.RunCreateModel, project: string, onResult: (err: any, statusCode: number, Run: TestInterfaces.TestRun) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param onResult callback function - */ - deleteTestRun(project: string, runId: number, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param onResult callback function with the resulting TestInterfaces.TestRun - */ - getTestRunById(project: string, runId: number, onResult: (err: any, statusCode: number, Run: TestInterfaces.TestRun) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {string} buildUri - * @param {string} owner - * @param {string} tmiRunId - * @param {number} planId - * @param {boolean} includeRunDetails - * @param {boolean} automated - * @param {number} skip - * @param {number} top - * @param onResult callback function with the resulting TestInterfaces.TestRun[] - */ - getTestRuns(project: string, buildUri: string, owner: string, tmiRunId: string, planId: number, includeRunDetails: boolean, automated: boolean, skip: number, top: number, onResult: (err: any, statusCode: number, Runs: TestInterfaces.TestRun[]) => void): void; - /** - * @param {TestInterfaces.RunUpdateModel} runUpdateModel - * @param {string} project - Project ID or project name - * @param {number} runId - * @param onResult callback function with the resulting TestInterfaces.TestRun - */ - updateTestRun(runUpdateModel: TestInterfaces.RunUpdateModel, project: string, runId: number, onResult: (err: any, statusCode: number, Run: TestInterfaces.TestRun) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} operationId - * @param {boolean} includeDetails - * @param onResult callback function with the resulting TestInterfaces.CloneOperationInformation - */ - getSuiteCloneInformation(project: string, operationId: number, includeDetails: boolean, onResult: (err: any, statusCode: number, Suite: TestInterfaces.CloneOperationInformation) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} planId - * @param {number} suiteId - * @param {string} testCaseIds - * @param onResult callback function with the resulting TestInterfaces.SuiteTestCase[] - */ - addTestCasesToSuite(project: string, planId: number, suiteId: number, testCaseIds: string, onResult: (err: any, statusCode: number, Suites: TestInterfaces.SuiteTestCase[]) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} planId - * @param {number} suiteId - * @param {number} testCaseIds - * @param onResult callback function with the resulting TestInterfaces.SuiteTestCase - */ - getTestCaseById(project: string, planId: number, suiteId: number, testCaseIds: number, onResult: (err: any, statusCode: number, Suite: TestInterfaces.SuiteTestCase) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} planId - * @param {number} suiteId - * @param onResult callback function with the resulting TestInterfaces.SuiteTestCase[] - */ - getTestCases(project: string, planId: number, suiteId: number, onResult: (err: any, statusCode: number, Suites: TestInterfaces.SuiteTestCase[]) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} planId - * @param {number} suiteId - * @param {string} testCaseIds - * @param onResult callback function - */ - removeTestCasesFromSuiteUrl(project: string, planId: number, suiteId: number, testCaseIds: string, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {TestInterfaces.SuiteCreateModel} testSuite - * @param {string} project - Project ID or project name - * @param {number} planId - * @param {number} suiteId - * @param onResult callback function with the resulting TestInterfaces.TestSuite[] - */ - createTestSuite(testSuite: TestInterfaces.SuiteCreateModel, project: string, planId: number, suiteId: number, onResult: (err: any, statusCode: number, Suite: TestInterfaces.TestSuite[]) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} planId - * @param {number} suiteId - * @param onResult callback function - */ - deleteTestSuite(project: string, planId: number, suiteId: number, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} planId - * @param {number} suiteId - * @param {boolean} includeChildSuites - * @param onResult callback function with the resulting TestInterfaces.TestSuite - */ - getTestSuiteById(project: string, planId: number, suiteId: number, includeChildSuites: boolean, onResult: (err: any, statusCode: number, Suite: TestInterfaces.TestSuite) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} planId - * @param {boolean} includeSuites - * @param {number} skip - * @param {number} top - * @param {boolean} asTreeView - * @param onResult callback function with the resulting TestInterfaces.TestSuite[] - */ - getTestSuitesForPlan(project: string, planId: number, includeSuites: boolean, skip: number, top: number, asTreeView: boolean, onResult: (err: any, statusCode: number, Suites: TestInterfaces.TestSuite[]) => void): void; - /** - * @param {TestInterfaces.SuiteUpdateModel} suiteUpdateModel - * @param {string} project - Project ID or project name - * @param {number} planId - * @param {number} suiteId - * @param onResult callback function with the resulting TestInterfaces.TestSuite - */ - updateTestSuite(suiteUpdateModel: TestInterfaces.SuiteUpdateModel, project: string, planId: number, suiteId: number, onResult: (err: any, statusCode: number, Suite: TestInterfaces.TestSuite) => void): void; - /** - * @param {TestInterfaces.TestSuiteCloneRequest} cloneRequestBody - * @param {string} project - Project ID or project name - * @param {number} sourceSuiteId - * @param {number} planId - * @param onResult callback function with the resulting TestInterfaces.CloneOperationInformation - */ - cloneTestSuite(cloneRequestBody: TestInterfaces.TestSuiteCloneRequest, project: string, sourceSuiteId: number, planId: number, onResult: (err: any, statusCode: number, Suite: TestInterfaces.CloneOperationInformation) => void): void; - /** - * @param {number} testCaseId - * @param onResult callback function with the resulting TestInterfaces.TestSuite[] - */ - getSuitesByTestCaseId(testCaseId: number, onResult: (err: any, statusCode: number, Suites: TestInterfaces.TestSuite[]) => void): void; - /** - * @param {TestInterfaces.TestSettings} testSettings - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting number - */ - createTestSettings(testSettings: TestInterfaces.TestSettings, project: string, onResult: (err: any, statusCode: number, TestSetting: number) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} testSettingsId - * @param onResult callback function - */ - deleteTestSettings(project: string, testSettingsId: number, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} testSettingsId - * @param onResult callback function with the resulting TestInterfaces.TestSettings - */ - getTestSettingsById(project: string, testSettingsId: number, onResult: (err: any, statusCode: number, TestSetting: TestInterfaces.TestSettings) => void): void; - /** - * @param {TestInterfaces.TestVariable} testVariable - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting TestInterfaces.TestVariable - */ - createTestVariable(testVariable: TestInterfaces.TestVariable, project: string, onResult: (err: any, statusCode: number, Variable: TestInterfaces.TestVariable) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} testVariableId - * @param onResult callback function - */ - deleteTestVariable(project: string, testVariableId: number, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} testVariableId - * @param onResult callback function with the resulting TestInterfaces.TestVariable - */ - getTestVariable(project: string, testVariableId: number, onResult: (err: any, statusCode: number, Variable: TestInterfaces.TestVariable) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} skip - * @param {number} top - * @param onResult callback function with the resulting TestInterfaces.TestVariable[] - */ - getTestVariables(project: string, skip: number, top: number, onResult: (err: any, statusCode: number, Variables: TestInterfaces.TestVariable[]) => void): void; - /** - * @param {TestInterfaces.TestVariable} testVariable - * @param {string} project - Project ID or project name - * @param {number} testVariableId - * @param onResult callback function with the resulting TestInterfaces.TestVariable - */ - updateTestVariable(testVariable: TestInterfaces.TestVariable, project: string, testVariableId: number, onResult: (err: any, statusCode: number, Variable: TestInterfaces.TestVariable) => void): void; - } - export class QTestApi extends basem.QClientApiBase implements IQTestApi { - api: TestApi; - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]); - /** - * @param {TestInterfaces.TestAttachmentRequestModel} attachmentRequestModel - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} testCaseResultId - */ - createTestResultAttachment(attachmentRequestModel: TestInterfaces.TestAttachmentRequestModel, project: string, runId: number, testCaseResultId: number): Q.Promise; - /** - * Returns a test result attachment - * - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} testCaseResultId - * @param {number} attachmentId - */ - getTestResultAttachmentContent(project: string, runId: number, testCaseResultId: number, attachmentId: number): Q.Promise; - /** - * Returns a test result attachment - * - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} testCaseResultId - * @param {number} attachmentId - */ - getTestResultAttachmentZip(project: string, runId: number, testCaseResultId: number, attachmentId: number): Q.Promise; - /** - * @param {TestInterfaces.TestAttachmentRequestModel} attachmentRequestModel - * @param {string} project - Project ID or project name - * @param {number} runId - */ - createTestRunAttachment(attachmentRequestModel: TestInterfaces.TestAttachmentRequestModel, project: string, runId: number): Q.Promise; - /** - * Returns a test run attachment - * - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} attachmentId - */ - getTestRunAttachmentContent(project: string, runId: number, attachmentId: number): Q.Promise; - /** - * Returns a test run attachment - * - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} attachmentId - */ - getTestRunAttachmentZip(project: string, runId: number, attachmentId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} testCaseResultId - */ - getBugsLinkedToTestResult(project: string, runId: number, testCaseResultId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {number} flags - */ - getBuildCodeCoverage(project: string, buildId: number, flags: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {number} deltaBuildId - */ - getCodeCoverageSummary(project: string, buildId: number, deltaBuildId?: number): Q.Promise; - /** - * http://(tfsserver):8080/tfs/DefaultCollection/_apis/test/CodeCoverage?buildId=10 Request: Json of code coverage summary - * - * @param {TestInterfaces.CodeCoverageData} coverageData - * @param {string} project - Project ID or project name - * @param {number} buildId - */ - updateCodeCoverageSummary(coverageData: TestInterfaces.CodeCoverageData, project: string, buildId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} flags - */ - getTestRunCodeCoverage(project: string, runId: number, flags: number): Q.Promise; - /** - * @param {TestInterfaces.TestConfiguration} testConfiguration - * @param {string} project - Project ID or project name - */ - createTestConfiguration(testConfiguration: TestInterfaces.TestConfiguration, project: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} testConfigurationId - */ - deleteTestConfiguration(project: string, testConfigurationId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} testConfigurationId - */ - getTestConfigurationById(project: string, testConfigurationId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} skip - * @param {number} top - * @param {boolean} includeAllProperties - */ - getTestConfigurations(project: string, skip?: number, top?: number, includeAllProperties?: boolean): Q.Promise; - /** - * @param {TestInterfaces.TestConfiguration} testConfiguration - * @param {string} project - Project ID or project name - * @param {number} testConfigurationId - */ - updateTestConfiguration(testConfiguration: TestInterfaces.TestConfiguration, project: string, testConfigurationId: number): Q.Promise; - /** - * @param {TestInterfaces.CustomTestFieldDefinition[]} newFields - * @param {string} project - Project ID or project name - */ - addCustomFields(newFields: TestInterfaces.CustomTestFieldDefinition[], project: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {TestInterfaces.CustomTestFieldScope} scopeFilter - */ - queryCustomFields(project: string, scopeFilter: TestInterfaces.CustomTestFieldScope): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - */ - getTestRunLogs(project: string, runId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} operationId - * @param {boolean} includeDetails - */ - getPlanCloneInformation(project: string, operationId: number, includeDetails?: boolean): Q.Promise; - /** - * @param {TestInterfaces.PlanUpdateModel} testPlan - * @param {string} project - Project ID or project name - */ - createTestPlan(testPlan: TestInterfaces.PlanUpdateModel, project: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} planId - */ - deleteTestPlan(project: string, planId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} planId - */ - getPlanById(project: string, planId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {string} owner - * @param {number} skip - * @param {number} top - * @param {boolean} includePlanDetails - * @param {boolean} filterActivePlans - */ - getPlans(project: string, owner?: string, skip?: number, top?: number, includePlanDetails?: boolean, filterActivePlans?: boolean): Q.Promise; - /** - * @param {TestInterfaces.PlanUpdateModel} planUpdateModel - * @param {string} project - Project ID or project name - * @param {number} planId - */ - updateTestPlan(planUpdateModel: TestInterfaces.PlanUpdateModel, project: string, planId: number): Q.Promise; - /** - * @param {TestInterfaces.TestPlanCloneRequest} cloneRequestBody - * @param {string} project - Project ID or project name - * @param {number} sourcePlanId - */ - cloneTestPlan(cloneRequestBody: TestInterfaces.TestPlanCloneRequest, project: string, sourcePlanId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} planId - * @param {number} suiteId - * @param {number} pointIds - * @param {string} witFields - */ - getPoint(project: string, planId: number, suiteId: number, pointIds: number, witFields?: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} planId - * @param {number} suiteId - * @param {string} witFields - * @param {string} configurationId - * @param {string} testCaseId - * @param {string} testPointIds - * @param {boolean} includePointDetails - * @param {number} skip - * @param {number} top - */ - getPoints(project: string, planId: number, suiteId: number, witFields?: string, configurationId?: string, testCaseId?: string, testPointIds?: string, includePointDetails?: boolean, skip?: number, top?: number): Q.Promise; - /** - * @param {TestInterfaces.PointUpdateModel} pointUpdateModel - * @param {string} project - Project ID or project name - * @param {number} planId - * @param {number} suiteId - * @param {string} pointIds - */ - updateTestPoints(pointUpdateModel: TestInterfaces.PointUpdateModel, project: string, planId: number, suiteId: number, pointIds: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} testRunId - * @param {number} testResultId - * @param {number} recentDays - */ - queryTestResultRecentBugs(project: string, testRunId: number, testResultId: number, recentDays?: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {string} publishContext - * @param {string} groupBy - * @param {string} filter - */ - getTestResultDetailsForBuild(project: string, buildId: number, publishContext?: string, groupBy?: string, filter?: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {number} releaseEnvId - * @param {string} publishContext - * @param {string} groupBy - * @param {string} filter - */ - getTestResultDetailsForRelease(project: string, releaseId: number, releaseEnvId: number, publishContext?: string, groupBy?: string, filter?: string): Q.Promise; - /** - * @param {TestInterfaces.ResultRetentionSettings} retentionSettings - * @param {string} project - Project ID or project name - */ - createResultRetentionSettings(retentionSettings: TestInterfaces.ResultRetentionSettings, project: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - */ - deleteResultRetentionSettings(project: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - */ - getResultRetentionSettings(project: string): Q.Promise; - /** - * @param {TestInterfaces.ResultRetentionSettings} retentionSettings - * @param {string} project - Project ID or project name - */ - updateResultRetentionSettings(retentionSettings: TestInterfaces.ResultRetentionSettings, project: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} testCaseResultId - * @param {number} iterationId - * @param {boolean} includeActionResults - */ - getTestIteration(project: string, runId: number, testCaseResultId: number, iterationId: number, includeActionResults?: boolean): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} testCaseResultId - * @param {boolean} includeActionResults - */ - getTestIterations(project: string, runId: number, testCaseResultId: number, includeActionResults?: boolean): Q.Promise; - /** - * @param {TestInterfaces.TestResultCreateModel[]} resultCreateModels - * @param {string} project - Project ID or project name - * @param {number} runId - */ - addTestResultsToTestRun(resultCreateModels: TestInterfaces.TestResultCreateModel[], project: string, runId: number): Q.Promise; - /** - * @param {TestInterfaces.TestCaseResultUpdateModel} resultUpdateModel - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number[]} resultIds - */ - bulkUpdateTestResults(resultUpdateModel: TestInterfaces.TestCaseResultUpdateModel, project: string, runId: number, resultIds: number[]): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} testCaseResultId - * @param {boolean} includeIterationDetails - * @param {boolean} includeAssociatedBugs - */ - getTestCaseResultById(project: string, runId: number, testCaseResultId: number, includeIterationDetails: boolean, includeAssociatedBugs?: boolean): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {boolean} includeIterationDetails - */ - getTestCaseResults(project: string, runId: number, includeIterationDetails: boolean): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} testCaseResultId - * @param {TestInterfaces.ResultDetails} detailsToInclude - */ - getTestResultById(project: string, runId: number, testCaseResultId: number, detailsToInclude?: TestInterfaces.ResultDetails): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {TestInterfaces.ResultDetails} detailsToInclude - * @param {number} skip - * @param {number} top - */ - getTestResults(project: string, runId: number, detailsToInclude?: TestInterfaces.ResultDetails, skip?: number, top?: number): Q.Promise; - /** - * @param {TestInterfaces.TestCaseResultUpdateModel[]} resultUpdateModels - * @param {string} project - Project ID or project name - * @param {number} runId - */ - updateTestResults(resultUpdateModels: TestInterfaces.TestCaseResultUpdateModel[], project: string, runId: number): Q.Promise; - /** - * @param {TestInterfaces.TestCaseResultIdentifier[]} ids - * @param {string} project - Project ID or project name - * @param {string[]} fields - */ - getTestResultsByIds(ids: TestInterfaces.TestCaseResultIdentifier[], project: string, fields: string[]): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} testCaseResultId - * @param {number} iterationId - * @param {string} actionPath - */ - getActionResults(project: string, runId: number, testCaseResultId: number, iterationId: number, actionPath?: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - * @param {number} testCaseResultId - * @param {number} iterationId - * @param {string} paramName - */ - getResultParameters(project: string, runId: number, testCaseResultId: number, iterationId: number, paramName?: string): Q.Promise; - /** - * @param {TestInterfaces.QueryModel} query - * @param {string} project - Project ID or project name - * @param {boolean} includeResultDetails - * @param {boolean} includeIterationDetails - * @param {number} skip - * @param {number} top - */ - getTestResultsByQuery(query: TestInterfaces.QueryModel, project: string, includeResultDetails?: boolean, includeIterationDetails?: boolean, skip?: number, top?: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} buildId - * @param {string} publishContext - * @param {boolean} includeFailureDetails - * @param {TestInterfaces.BuildReference} buildToCompare - */ - queryTestResultsReportForBuild(project: string, buildId: number, publishContext?: string, includeFailureDetails?: boolean, buildToCompare?: TestInterfaces.BuildReference): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {number} releaseEnvId - * @param {string} publishContext - * @param {boolean} includeFailureDetails - * @param {TestInterfaces.ReleaseReference} releaseToCompare - */ - queryTestResultsReportForRelease(project: string, releaseId: number, releaseEnvId: number, publishContext?: string, includeFailureDetails?: boolean, releaseToCompare?: TestInterfaces.ReleaseReference): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} testRunId - * @param {number} testResultId - * @param {number} historyDays - * @param {number} top - */ - queryTestResultTrendReport(project: string, testRunId: number, testResultId: number, historyDays?: number, top?: number): Q.Promise; - /** - * @param {TestInterfaces.TestResultTrendFilter} filter - * @param {string} project - Project ID or project name - */ - queryResultTrendForBuild(filter: TestInterfaces.TestResultTrendFilter, project: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - */ - getTestRunStatistics(project: string, runId: number): Q.Promise; - /** - * @param {TestInterfaces.QueryModel} query - * @param {string} project - Project ID or project name - * @param {boolean} includeRunDetails - * @param {number} skip - * @param {number} top - */ - getTestRunsByQuery(query: TestInterfaces.QueryModel, project: string, includeRunDetails?: boolean, skip?: number, top?: number): Q.Promise; - /** - * @param {TestInterfaces.RunCreateModel} testRun - * @param {string} project - Project ID or project name - */ - createTestRun(testRun: TestInterfaces.RunCreateModel, project: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - */ - deleteTestRun(project: string, runId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} runId - */ - getTestRunById(project: string, runId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {string} buildUri - * @param {string} owner - * @param {string} tmiRunId - * @param {number} planId - * @param {boolean} includeRunDetails - * @param {boolean} automated - * @param {number} skip - * @param {number} top - */ - getTestRuns(project: string, buildUri?: string, owner?: string, tmiRunId?: string, planId?: number, includeRunDetails?: boolean, automated?: boolean, skip?: number, top?: number): Q.Promise; - /** - * @param {TestInterfaces.RunUpdateModel} runUpdateModel - * @param {string} project - Project ID or project name - * @param {number} runId - */ - updateTestRun(runUpdateModel: TestInterfaces.RunUpdateModel, project: string, runId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} operationId - * @param {boolean} includeDetails - */ - getSuiteCloneInformation(project: string, operationId: number, includeDetails?: boolean): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} planId - * @param {number} suiteId - * @param {string} testCaseIds - */ - addTestCasesToSuite(project: string, planId: number, suiteId: number, testCaseIds: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} planId - * @param {number} suiteId - * @param {number} testCaseIds - */ - getTestCaseById(project: string, planId: number, suiteId: number, testCaseIds: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} planId - * @param {number} suiteId - */ - getTestCases(project: string, planId: number, suiteId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} planId - * @param {number} suiteId - * @param {string} testCaseIds - */ - removeTestCasesFromSuiteUrl(project: string, planId: number, suiteId: number, testCaseIds: string): Q.Promise; - /** - * @param {TestInterfaces.SuiteCreateModel} testSuite - * @param {string} project - Project ID or project name - * @param {number} planId - * @param {number} suiteId - */ - createTestSuite(testSuite: TestInterfaces.SuiteCreateModel, project: string, planId: number, suiteId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} planId - * @param {number} suiteId - */ - deleteTestSuite(project: string, planId: number, suiteId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} planId - * @param {number} suiteId - * @param {boolean} includeChildSuites - */ - getTestSuiteById(project: string, planId: number, suiteId: number, includeChildSuites?: boolean): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} planId - * @param {boolean} includeSuites - * @param {number} skip - * @param {number} top - * @param {boolean} asTreeView - */ - getTestSuitesForPlan(project: string, planId: number, includeSuites?: boolean, skip?: number, top?: number, asTreeView?: boolean): Q.Promise; - /** - * @param {TestInterfaces.SuiteUpdateModel} suiteUpdateModel - * @param {string} project - Project ID or project name - * @param {number} planId - * @param {number} suiteId - */ - updateTestSuite(suiteUpdateModel: TestInterfaces.SuiteUpdateModel, project: string, planId: number, suiteId: number): Q.Promise; - /** - * @param {TestInterfaces.TestSuiteCloneRequest} cloneRequestBody - * @param {string} project - Project ID or project name - * @param {number} sourceSuiteId - * @param {number} planId - */ - cloneTestSuite(cloneRequestBody: TestInterfaces.TestSuiteCloneRequest, project: string, sourceSuiteId: number, planId: number): Q.Promise; - /** - * @param {number} testCaseId - */ - getSuitesByTestCaseId(testCaseId: number): Q.Promise; - /** - * @param {TestInterfaces.TestSettings} testSettings - * @param {string} project - Project ID or project name - */ - createTestSettings(testSettings: TestInterfaces.TestSettings, project: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} testSettingsId - */ - deleteTestSettings(project: string, testSettingsId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} testSettingsId - */ - getTestSettingsById(project: string, testSettingsId: number): Q.Promise; - /** - * @param {TestInterfaces.TestVariable} testVariable - * @param {string} project - Project ID or project name - */ - createTestVariable(testVariable: TestInterfaces.TestVariable, project: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} testVariableId - */ - deleteTestVariable(project: string, testVariableId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} testVariableId - */ - getTestVariable(project: string, testVariableId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} skip - * @param {number} top - */ - getTestVariables(project: string, skip?: number, top?: number): Q.Promise; - /** - * @param {TestInterfaces.TestVariable} testVariable - * @param {string} project - Project ID or project name - * @param {number} testVariableId - */ - updateTestVariable(testVariable: TestInterfaces.TestVariable, project: string, testVariableId: number): Q.Promise; - } - -} -declare module 'vso-node-api/interfaces/TfvcInterfaces' { - import TfsCoreInterfaces = require('vso-node-api/interfaces/CoreInterfaces'); - import VSSInterfaces = require('vso-node-api/interfaces/common/VSSInterfaces'); - export interface AssociatedWorkItem { - assignedTo: string; - id: number; - state: string; - title: string; - /** - * REST url - */ - url: string; - webUrl: string; - workItemType: string; - } - export interface Change { - changeType: VersionControlChangeType; - item: T; - newContent: ItemContent; - sourceServerItem: string; - url: string; - } - export interface ChangeCountDictionary { - } - export interface ChangeList { - allChangesIncluded: boolean; - changeCounts: { - [key: number]: number; - }; - changes: Change[]; - comment: string; - commentTruncated: boolean; - creationDate: Date; - notes: CheckinNote[]; - owner: string; - ownerDisplayName: string; - ownerId: string; - sortDate: Date; - version: string; - } - /** - * Criteria used in a search for change lists - */ - export interface ChangeListSearchCriteria { - /** - * If provided, a version descriptor to compare against base - */ - compareVersion: string; - /** - * If true, don't include delete history entries - */ - excludeDeletes: boolean; - /** - * Whether or not to follow renames for the given item being queried - */ - followRenames: boolean; - /** - * If provided, only include history entries created after this date (string) - */ - fromDate: string; - /** - * If provided, a version descriptor for the earliest change list to include - */ - fromVersion: string; - /** - * Path of item to search under - */ - itemPath: string; - /** - * Version of the items to search - */ - itemVersion: string; - /** - * Number of results to skip (used when clicking more...) - */ - skip: number; - /** - * If provided, only include history entries created before this date (string) - */ - toDate: string; - /** - * If provided, the maximum number of history entries to return - */ - top: number; - /** - * If provided, a version descriptor for the latest change list to include - */ - toVersion: string; - /** - * Alias or display name of user who made the changes - */ - user: string; - } - export interface CheckinNote { - name: string; - value: string; - } - export interface FileContentMetadata { - contentType: string; - encoding: number; - extension: string; - fileName: string; - isBinary: boolean; - isImage: boolean; - vsLink: string; - } - export interface GitBaseVersionDescriptor extends GitVersionDescriptor { - /** - * Version string identifier (name of tag/branch, SHA1 of commit) - */ - baseVersion: string; - /** - * Version options - Specify additional modifiers to version (e.g Previous) - */ - baseVersionOptions: GitVersionOptions; - /** - * Version type (branch, tag, or commit). Determines how Id is interpreted - */ - baseVersionType: GitVersionType; - } - export interface GitBlobRef { - _links: any; - /** - * SHA1 hash of git object - */ - objectId: string; - /** - * Size of blob content (in bytes) - */ - size: number; - url: string; - } - export interface GitBranchStats { - aheadCount: number; - behindCount: number; - commit: GitCommitRef; - isBaseVersion: boolean; - name: string; - } - export interface GitChange extends Change { - } - export interface GitCommit extends GitCommitRef { - push: GitPushRef; - treeId: string; - } - export interface GitCommitChanges { - changeCounts: ChangeCountDictionary; - changes: GitChange[]; - } - export interface GitCommitDiffs { - aheadCount: number; - allChangesIncluded: boolean; - baseCommit: string; - behindCount: number; - changeCounts: { - [key: number]: number; - }; - changes: GitChange[]; - commonCommit: string; - targetCommit: string; - } - export interface GitCommitRef { - _links: any; - author: GitUserDate; - changeCounts: ChangeCountDictionary; - changes: GitChange[]; - comment: string; - commentTruncated: boolean; - commitId: string; - committer: GitUserDate; - parents: string[]; - remoteUrl: string; - url: string; - } - export interface GitCommitToCreate { - baseRef: GitRef; - comment: string; - pathActions: GitPathAction[]; - } - export interface GitDeletedRepository { - createdDate: Date; - deletedBy: VSSInterfaces.IdentityRef; - deletedDate: Date; - id: string; - name: string; - project: TfsCoreInterfaces.TeamProjectReference; - } - export interface GitHistoryQueryResults extends HistoryQueryResults { - /** - * Seed commit used for querying history. Used for skip feature. - */ - startingCommitId: string; - unpopulatedCount: number; - unprocessedCount: number; - } - export interface GitItem extends ItemModel { - /** - * SHA1 of commit item was fetched at - */ - commitId: string; - /** - * Type of object (Commit, Tree, Blob, Tag, ...) - */ - gitObjectType: GitObjectType; - /** - * Shallow ref to commit that last changed this item Only populated if latestProcessedChange is requested May not be accurate if latest change is not yet cached - */ - latestProcessedChange: GitCommitRef; - /** - * Git object id - */ - objectId: string; - /** - * Git object id - */ - originalObjectId: string; - } - export interface GitItemDescriptor { - /** - * Path to item - */ - path: string; - /** - * Specifies whether to include children (OneLevel), all descendants (Full), or None - */ - recursionLevel: VersionControlRecursionType; - /** - * Version string (interpretation based on VersionType defined in subclass - */ - version: string; - /** - * Version modifiers (e.g. previous) - */ - versionOptions: GitVersionOptions; - /** - * How to interpret version (branch,tag,commit) - */ - versionType: GitVersionType; - } - export interface GitItemRequestData { - /** - * Whether to include metadata for all items - */ - includeContentMetadata: boolean; - /** - * Whether to include the _links field on the shallow references - */ - includeLinks: boolean; - /** - * Collection of items to fetch, including path, version, and recursion level - */ - itemDescriptors: GitItemDescriptor[]; - /** - * Whether to include shallow ref to commit that last changed each item - */ - latestProcessedChange: boolean; - } - export interface GitLimitedRefCriteria { - _links: any; - refExactMatches: string[]; - refNamespaces: string[]; - url: string; - } - export enum GitObjectType { - Bad = 0, - Commit = 1, - Tree = 2, - Blob = 3, - Tag = 4, - Ext2 = 5, - OfsDelta = 6, - RefDelta = 7, - } - export interface GitPathAction { - action: GitPathActions; - base64Content: string; - path: string; - rawTextContent: string; - targetPath: string; - } - export enum GitPathActions { - None = 0, - Edit = 1, - Delete = 2, - Add = 3, - Rename = 4, - } - export enum GitPermissionScope { - Project = 0, - Repository = 1, - Branch = 2, - } - export interface GitPullRequest { - _links: any; - closedDate: Date; - codeReviewId: number; - commits: GitCommitRef[]; - completionOptions: GitPullRequestCompletionOptions; - completionQueueTime: Date; - createdBy: VSSInterfaces.IdentityRef; - creationDate: Date; - description: string; - lastMergeCommit: GitCommitRef; - lastMergeSourceCommit: GitCommitRef; - lastMergeTargetCommit: GitCommitRef; - mergeId: string; - mergeStatus: PullRequestAsyncStatus; - pullRequestId: number; - remoteUrl: string; - repository: GitRepository; - reviewers: IdentityRefWithVote[]; - sourceRefName: string; - status: PullRequestStatus; - targetRefName: string; - title: string; - upgraded: boolean; - url: string; - workItemRefs: VSSInterfaces.ResourceRef[]; - } - export interface GitPullRequestCompletionOptions { - deleteSourceBranch: boolean; - mergeCommitMessage: string; - squashMerge: boolean; - } - export interface GitPullRequestSearchCriteria { - creatorId: string; - /** - * Whether to include the _links field on the shallow references - */ - includeLinks: boolean; - repositoryId: string; - reviewerId: string; - sourceRefName: string; - status: PullRequestStatus; - targetRefName: string; - } - export interface GitPush extends GitPushRef { - commits: GitCommitRef[]; - refUpdates: GitRefUpdate[]; - repository: GitRepository; - } - export interface GitPushEventData { - afterId: string; - beforeId: string; - branch: string; - commits: GitCommit[]; - repository: GitRepository; - } - export interface GitPushRef { - _links: any; - date: Date; - pushCorrelationId: string; - pushedBy: VSSInterfaces.IdentityRef; - pushId: number; - url: string; - } - export interface GitPushSearchCriteria { - fromDate: Date; - /** - * Whether to include the _links field on the shallow references - */ - includeLinks: boolean; - includeRefUpdates: boolean; - pusherId: string; - refName: string; - toDate: Date; - } - export interface GitQueryCommitsCriteria { - /** - * Number of entries to skip - */ - $skip: number; - /** - * Maximum number of entries to retrieve - */ - $top: number; - /** - * Alias or display name of the author - */ - author: string; - /** - * If provided, the earliest commit in the graph to search - */ - compareVersion: GitVersionDescriptor; - /** - * If true, don't include delete history entries - */ - excludeDeletes: boolean; - /** - * If provided, a lower bound for filtering commits alphabetically - */ - fromCommitId: string; - /** - * If provided, only include history entries created after this date (string) - */ - fromDate: string; - /** - * If provided, specifies the exact commit ids of the commits to fetch. May not be combined with other parameters. - */ - ids: string[]; - /** - * Whether to include the _links field on the shallow references - */ - includeLinks: boolean; - /** - * Path of item to search under - */ - itemPath: string; - /** - * If provided, identifies the commit or branch to search - */ - itemVersion: GitVersionDescriptor; - /** - * If provided, an upper bound for filtering commits alphabetically - */ - toCommitId: string; - /** - * If provided, only include history entries created before this date (string) - */ - toDate: string; - /** - * Alias or display name of the committer - */ - user: string; - } - export interface GitRef { - _links: any; - isLockedBy: VSSInterfaces.IdentityRef; - name: string; - objectId: string; - statuses: GitStatus[]; - url: string; - } - export interface GitRefUpdate { - name: string; - newObjectId: string; - oldObjectId: string; - repositoryId: string; - } - export enum GitRefUpdateMode { - /** - * Indicates the Git protocol model where any refs that can be updated will be updated, but any failures will not prevent other updates from succeeding. - */ - BestEffort = 0, - /** - * Indicates that all ref updates must succeed or none will succeed. All ref updates will be atomically written. If any failure is encountered, previously successful updates will be rolled back and the entire operation will fail. - */ - AllOrNone = 1, - } - export interface GitRefUpdateResult { - /** - * Custom message for the result object For instance, Reason for failing. - */ - customMessage: string; - /** - * Ref name - */ - name: string; - /** - * New object ID - */ - newObjectId: string; - /** - * Old object ID - */ - oldObjectId: string; - /** - * Name of the plugin that rejected the updated. - */ - rejectedBy: string; - /** - * Repository ID - */ - repositoryId: string; - /** - * True if the ref update succeeded, false otherwise - */ - success: boolean; - /** - * Status of the update from the TFS server. - */ - updateStatus: GitRefUpdateStatus; - } - export interface GitRefUpdateResultSet { - countFailed: number; - countSucceeded: number; - pushCorrelationId: string; - pushIds: { - [key: string]: number; - }; - pushTime: Date; - results: GitRefUpdateResult[]; - } - export enum GitRefUpdateStatus { - /** - * Indicates that the ref update request was completed successfully. - */ - Succeeded = 0, - /** - * Indicates that the ref update request could not be completed because part of the graph would be disconnected by this change, and the caller does not have ForcePush permission on the repository. - */ - ForcePushRequired = 1, - /** - * Indicates that the ref update request could not be completed because the old object ID presented in the request was not the object ID of the ref when the database attempted the update. The most likely scenario is that the caller lost a race to update the ref. - */ - StaleOldObjectId = 2, - /** - * Indicates that the ref update request could not be completed because the ref name presented in the request was not valid. - */ - InvalidRefName = 3, - /** - * The request was not processed - */ - Unprocessed = 4, - /** - * The ref update request could not be completed because the new object ID for the ref could not be resolved to a commit object (potentially through any number of tags) - */ - UnresolvableToCommit = 5, - /** - * The ref update request could not be completed because the user lacks write permissions required to write this ref - */ - WritePermissionRequired = 6, - /** - * The ref update request could not be completed because the user lacks note creation permissions required to write this note - */ - ManageNotePermissionRequired = 7, - /** - * The ref update request could not be completed because the user lacks the permission to create a branch - */ - CreateBranchPermissionRequired = 8, - /** - * The ref update request could not be completed because the user lacks the permission to create a tag - */ - CreateTagPermissionRequired = 9, - /** - * The ref update could not be completed because it was rejected by the plugin. - */ - RejectedByPlugin = 10, - /** - * The ref update could not be completed because the ref is locked by another user. - */ - Locked = 11, - /** - * The ref update could not be completed because, in case-insensitive mode, the ref name conflicts with an existing, differently-cased ref name. - */ - RefNameConflict = 12, - /** - * The ref update could not be completed because it was rejected by policy. - */ - RejectedByPolicy = 13, - /** - * Indicates that the ref update request was completed successfully, but the ref doesn't actually exist so no changes were made. This should only happen during deletes. - */ - SucceededNonExistentRef = 14, - /** - * Indicates that the ref update request was completed successfully, but the passed-in ref was corrupt - as in, the old object ID was bad. This should only happen during deletes. - */ - SucceededCorruptRef = 15, - } - export interface GitRepository { - _links: any; - defaultBranch: string; - id: string; - name: string; - project: TfsCoreInterfaces.TeamProjectReference; - remoteUrl: string; - url: string; - } - export enum GitRepositoryPermissions { - None = 0, - Administer = 1, - GenericRead = 2, - GenericContribute = 4, - ForcePush = 8, - CreateBranch = 16, - CreateTag = 32, - ManageNote = 64, - PolicyExempt = 128, - /** - * This defines the set of bits that are valid for the git permission space. When reading or writing git permissions, these are the only bits paid attention too. - */ - All = 255, - BranchLevelPermissions = 141, - } - export interface GitStatus { - _links: any; - context: GitStatusContext; - createdBy: VSSInterfaces.IdentityRef; - creationDate: Date; - description: string; - state: GitStatusState; - targetUrl: string; - } - export interface GitStatusContext { - genre: string; - name: string; - } - export enum GitStatusState { - NotSet = 0, - Pending = 1, - Succeeded = 2, - Failed = 3, - Error = 4, - } - export interface GitSuggestion { - properties: { - [key: string]: any; - }; - type: string; - } - export interface GitTargetVersionDescriptor extends GitVersionDescriptor { - /** - * Version string identifier (name of tag/branch, SHA1 of commit) - */ - targetVersion: string; - /** - * Version options - Specify additional modifiers to version (e.g Previous) - */ - targetVersionOptions: GitVersionOptions; - /** - * Version type (branch, tag, or commit). Determines how Id is interpreted - */ - targetVersionType: GitVersionType; - } - export interface GitTreeEntryRef { - /** - * Blob or tree - */ - gitObjectType: GitObjectType; - /** - * Mode represented as octal string - */ - mode: string; - /** - * SHA1 hash of git object - */ - objectId: string; - /** - * Path relative to parent tree object - */ - relativePath: string; - /** - * Size of content - */ - size: number; - /** - * url to retrieve tree or blob - */ - url: string; - } - export interface GitTreeRef { - _links: any; - /** - * SHA1 hash of git object - */ - objectId: string; - /** - * Sum of sizes of all children - */ - size: number; - /** - * Blobs and trees under this tree - */ - treeEntries: GitTreeEntryRef[]; - /** - * Url to tree - */ - url: string; - } - export interface GitUserDate { - date: Date; - email: string; - name: string; - } - export interface GitVersionDescriptor { - /** - * Version string identifier (name of tag/branch/index, SHA1 of commit) - */ - version: string; - /** - * Version options - Specify additional modifiers to version (e.g Previous) - */ - versionOptions: GitVersionOptions; - /** - * Version type (branch, tag, commit, or index). Determines how Id is interpreted - */ - versionType: GitVersionType; - } - export enum GitVersionOptions { - /** - * Not specified - */ - None = 0, - /** - * Commit that changed item prior to the current version - */ - PreviousChange = 1, - /** - * First parent of commit (HEAD^) - */ - FirstParent = 2, - } - export enum GitVersionType { - /** - * Interpret the version as a branch name - */ - Branch = 0, - /** - * Interpret the version as a tag name - */ - Tag = 1, - /** - * Interpret the version as a commit ID (SHA1) - */ - Commit = 2, - /** - * Interpret the version as an index name - */ - Index = 3, - } - export interface HistoryEntry { - /** - * The Change list (changeset/commit/shelveset) for this point in history - */ - changeList: ChangeList; - /** - * The change made to the item from this change list (only relevant for File history, not folders) - */ - itemChangeType: VersionControlChangeType; - /** - * The path of the item at this point in history (only relevant for File history, not folders) - */ - serverItem: string; - } - export interface HistoryQueryResults { - /** - * True if there are more results available to fetch (we're returning the max # of items requested) A more RESTy solution would be to include a Link header - */ - moreResultsAvailable: boolean; - /** - * The history entries (results) from this query - */ - results: HistoryEntry[]; - } - export interface IdentityRefWithVote extends VSSInterfaces.IdentityRef { - isRequired: boolean; - reviewerUrl: string; - vote: number; - votedFor: IdentityRefWithVote[]; - } - export interface IncludedGitCommit { - commitId: string; - commitTime: Date; - parentCommitIds: string[]; - repositoryId: string; - } - export interface ItemContent { - content: string; - contentType: ItemContentType; - } - export enum ItemContentType { - RawText = 0, - Base64Encoded = 1, - } - /** - * Optional details to include when returning an item model - */ - export interface ItemDetailsOptions { - /** - * If true, include metadata about the file type - */ - includeContentMetadata: boolean; - /** - * Specifies whether to include children (OneLevel), all descendants (Full) or None for folder items - */ - recursionLevel: VersionControlRecursionType; - } - export interface ItemModel { - _links: any; - contentMetadata: FileContentMetadata; - isFolder: boolean; - isSymLink: boolean; - path: string; - url: string; - } - export enum PullRequestAsyncStatus { - NotSet = 0, - Queued = 1, - Conflicts = 2, - Succeeded = 3, - RejectedByPolicy = 4, - Failure = 5, - } - export enum PullRequestStatus { - NotSet = 0, - Active = 1, - Abandoned = 2, - Completed = 3, - All = 4, - } - export interface TfvcBranch extends TfvcBranchRef { - children: TfvcBranch[]; - mappings: TfvcBranchMapping[]; - parent: TfvcShallowBranchRef; - relatedBranches: TfvcShallowBranchRef[]; - } - export interface TfvcBranchMapping { - depth: string; - serverItem: string; - type: string; - } - export interface TfvcBranchRef extends TfvcShallowBranchRef { - _links: any; - createdDate: Date; - description: string; - isDeleted: boolean; - owner: VSSInterfaces.IdentityRef; - url: string; - } - export interface TfvcChange extends Change { - /** - * List of merge sources in case of rename or branch creation. - */ - mergeSources: TfvcMergeSource[]; - /** - * Version at which a (shelved) change was pended against - */ - pendingVersion: number; - } - export interface TfvcChangeset extends TfvcChangesetRef { - accountId: string; - changes: TfvcChange[]; - checkinNotes: CheckinNote[]; - collectionId: string; - hasMoreChanges: boolean; - policyOverride: TfvcPolicyOverrideInfo; - teamProjectIds: string[]; - workItems: AssociatedWorkItem[]; - } - export interface TfvcChangesetRef { - _links: any; - author: VSSInterfaces.IdentityRef; - changesetId: number; - checkedInBy: VSSInterfaces.IdentityRef; - comment: string; - commentTruncated: boolean; - createdDate: Date; - url: string; - } - /** - * Criteria used in a search for change lists - */ - export interface TfvcChangesetSearchCriteria { - /** - * Alias or display name of user who made the changes - */ - author: string; - /** - * Whether or not to follow renames for the given item being queried - */ - followRenames: boolean; - /** - * If provided, only include changesets created after this date (string) Think of a better name for this. - */ - fromDate: string; - /** - * If provided, only include changesets after this changesetID - */ - fromId: number; - /** - * Whether to include the _links field on the shallow references - */ - includeLinks: boolean; - /** - * Path of item to search under - */ - path: string; - /** - * If provided, only include changesets created before this date (string) Think of a better name for this. - */ - toDate: string; - /** - * If provided, a version descriptor for the latest change list to include - */ - toId: number; - } - export interface TfvcChangesetsRequestData { - changesetIds: number[]; - commentLength: number; - /** - * Whether to include the _links field on the shallow references - */ - includeLinks: boolean; - } - export interface TfvcCheckinEventData { - changeset: TfvcChangeset; - project: TfsCoreInterfaces.TeamProjectReference; - } - export interface TfvcHistoryEntry extends HistoryEntry { - /** - * The encoding of the item at this point in history (only relevant for File history, not folders) - */ - encoding: number; - /** - * The file id of the item at this point in history (only relevant for File history, not folders) - */ - fileId: number; - } - export interface TfvcItem extends ItemModel { - changeDate: Date; - deletionId: number; - /** - * MD5 hash as a base 64 string, applies to files only. - */ - hashValue: string; - isBranch: boolean; - isPendingChange: boolean; - /** - * The size of the file, if applicable. - */ - size: number; - version: number; - } - /** - * Item path and Version descriptor properties - */ - export interface TfvcItemDescriptor { - path: string; - recursionLevel: VersionControlRecursionType; - version: string; - versionOption: TfvcVersionOption; - versionType: TfvcVersionType; - } - export interface TfvcItemRequestData { - /** - * If true, include metadata about the file type - */ - includeContentMetadata: boolean; - /** - * Whether to include the _links field on the shallow references - */ - includeLinks: boolean; - itemDescriptors: TfvcItemDescriptor[]; - } - export interface TfvcLabel extends TfvcLabelRef { - items: TfvcItem[]; - } - export interface TfvcLabelRef { - _links: any; - description: string; - id: number; - labelScope: string; - modifiedDate: Date; - name: string; - owner: VSSInterfaces.IdentityRef; - url: string; - } - export interface TfvcLabelRequestData { - /** - * Whether to include the _links field on the shallow references - */ - includeLinks: boolean; - itemLabelFilter: string; - labelScope: string; - maxItemCount: number; - name: string; - owner: string; - } - export interface TfvcMergeSource { - /** - * Indicates if this a rename source. If false, it is a merge source. - */ - isRename: boolean; - /** - * The server item of the merge source - */ - serverItem: string; - /** - * Start of the version range - */ - versionFrom: number; - /** - * End of the version range - */ - versionTo: number; - } - export interface TfvcPolicyFailureInfo { - message: string; - policyName: string; - } - export interface TfvcPolicyOverrideInfo { - comment: string; - policyFailures: TfvcPolicyFailureInfo[]; - } - export interface TfvcShallowBranchRef { - path: string; - } - export interface TfvcShelveset extends TfvcShelvesetRef { - changes: TfvcChange[]; - notes: CheckinNote[]; - policyOverride: TfvcPolicyOverrideInfo; - workItems: AssociatedWorkItem[]; - } - export interface TfvcShelvesetRef { - _links: any; - comment: string; - commentTruncated: boolean; - createdDate: Date; - id: string; - name: string; - owner: VSSInterfaces.IdentityRef; - url: string; - } - export interface TfvcShelvesetRequestData { - /** - * Whether to include policyOverride and notes - */ - includeDetails: boolean; - /** - * Whether to include the _links field on the shallow references - */ - includeLinks: boolean; - /** - * Whether to include workItems - */ - includeWorkItems: boolean; - /** - * Max number of changes to include - */ - maxChangeCount: number; - /** - * Max length of comment - */ - maxCommentLength: number; - /** - * Shelveset's name - */ - name: string; - /** - * Owner's ID. Could be a name or a guid. - */ - owner: string; - } - export interface TfvcVersionDescriptor { - version: string; - versionOption: TfvcVersionOption; - versionType: TfvcVersionType; - } - export enum TfvcVersionOption { - None = 0, - Previous = 1, - UseRename = 2, - } - export enum TfvcVersionType { - None = 0, - Changeset = 1, - Shelveset = 2, - Change = 3, - Date = 4, - Latest = 5, - Tip = 6, - MergeSource = 7, - } - export interface UpdateRefsRequest { - refUpdateRequests: GitRefUpdate[]; - updateMode: GitRefUpdateMode; - } - export enum VersionControlChangeType { - None = 0, - Add = 1, - Edit = 2, - Encoding = 4, - Rename = 8, - Delete = 16, - Undelete = 32, - Branch = 64, - Merge = 128, - Lock = 256, - Rollback = 512, - SourceRename = 1024, - TargetRename = 2048, - Property = 4096, - All = 8191, - } - export interface VersionControlProjectInfo { - defaultSourceControlType: TfsCoreInterfaces.SourceControlTypes; - project: TfsCoreInterfaces.TeamProjectReference; - supportsGit: boolean; - supportsTFVC: boolean; - } - export enum VersionControlRecursionType { - /** - * Only return the specified item. - */ - None = 0, - /** - * Return the specified item and its direct children. - */ - OneLevel = 1, - /** - * Return the specified item and its direct children, as well as recursive chains of nested child folders that only contain a single folder. - */ - OneLevelPlusNestedEmptyFolders = 4, - /** - * Return specified item and all descendants - */ - Full = 120, - } - export var TypeInfo: { - AssociatedWorkItem: { - fields: any; - }; - Change: { - fields: any; - }; - ChangeCountDictionary: { - fields: any; - }; - ChangeList: { - fields: any; - }; - ChangeListSearchCriteria: { - fields: any; - }; - CheckinNote: { - fields: any; - }; - FileContentMetadata: { - fields: any; - }; - GitBaseVersionDescriptor: { - fields: any; - }; - GitBlobRef: { - fields: any; - }; - GitBranchStats: { - fields: any; - }; - GitChange: { - fields: any; - }; - GitCommit: { - fields: any; - }; - GitCommitChanges: { - fields: any; - }; - GitCommitDiffs: { - fields: any; - }; - GitCommitRef: { - fields: any; - }; - GitCommitToCreate: { - fields: any; - }; - GitDeletedRepository: { - fields: any; - }; - GitHistoryQueryResults: { - fields: any; - }; - GitItem: { - fields: any; - }; - GitItemDescriptor: { - fields: any; - }; - GitItemRequestData: { - fields: any; - }; - GitLimitedRefCriteria: { - fields: any; - }; - GitObjectType: { - enumValues: { - "bad": number; - "commit": number; - "tree": number; - "blob": number; - "tag": number; - "ext2": number; - "ofsDelta": number; - "refDelta": number; - }; - }; - GitPathAction: { - fields: any; - }; - GitPathActions: { - enumValues: { - "none": number; - "edit": number; - "delete": number; - "add": number; - "rename": number; - }; - }; - GitPermissionScope: { - enumValues: { - "project": number; - "repository": number; - "branch": number; - }; - }; - GitPullRequest: { - fields: any; - }; - GitPullRequestCompletionOptions: { - fields: any; - }; - GitPullRequestSearchCriteria: { - fields: any; - }; - GitPush: { - fields: any; - }; - GitPushEventData: { - fields: any; - }; - GitPushRef: { - fields: any; - }; - GitPushSearchCriteria: { - fields: any; - }; - GitQueryCommitsCriteria: { - fields: any; - }; - GitRef: { - fields: any; - }; - GitRefUpdate: { - fields: any; - }; - GitRefUpdateMode: { - enumValues: { - "bestEffort": number; - "allOrNone": number; - }; - }; - GitRefUpdateResult: { - fields: any; - }; - GitRefUpdateResultSet: { - fields: any; - }; - GitRefUpdateStatus: { - enumValues: { - "succeeded": number; - "forcePushRequired": number; - "staleOldObjectId": number; - "invalidRefName": number; - "unprocessed": number; - "unresolvableToCommit": number; - "writePermissionRequired": number; - "manageNotePermissionRequired": number; - "createBranchPermissionRequired": number; - "createTagPermissionRequired": number; - "rejectedByPlugin": number; - "locked": number; - "refNameConflict": number; - "rejectedByPolicy": number; - "succeededNonExistentRef": number; - "succeededCorruptRef": number; - }; - }; - GitRepository: { - fields: any; - }; - GitRepositoryPermissions: { - enumValues: { - "none": number; - "administer": number; - "genericRead": number; - "genericContribute": number; - "forcePush": number; - "createBranch": number; - "createTag": number; - "manageNote": number; - "policyExempt": number; - "all": number; - "branchLevelPermissions": number; - }; - }; - GitStatus: { - fields: any; - }; - GitStatusContext: { - fields: any; - }; - GitStatusState: { - enumValues: { - "notSet": number; - "pending": number; - "succeeded": number; - "failed": number; - "error": number; - }; - }; - GitSuggestion: { - fields: any; - }; - GitTargetVersionDescriptor: { - fields: any; - }; - GitTreeEntryRef: { - fields: any; - }; - GitTreeRef: { - fields: any; - }; - GitUserDate: { - fields: any; - }; - GitVersionDescriptor: { - fields: any; - }; - GitVersionOptions: { - enumValues: { - "none": number; - "previousChange": number; - "firstParent": number; - }; - }; - GitVersionType: { - enumValues: { - "branch": number; - "tag": number; - "commit": number; - "index": number; - }; - }; - HistoryEntry: { - fields: any; - }; - HistoryQueryResults: { - fields: any; - }; - IdentityRefWithVote: { - fields: any; - }; - IncludedGitCommit: { - fields: any; - }; - ItemContent: { - fields: any; - }; - ItemContentType: { - enumValues: { - "rawText": number; - "base64Encoded": number; - }; - }; - ItemDetailsOptions: { - fields: any; - }; - ItemModel: { - fields: any; - }; - PullRequestAsyncStatus: { - enumValues: { - "notSet": number; - "queued": number; - "conflicts": number; - "succeeded": number; - "rejectedByPolicy": number; - "failure": number; - }; - }; - PullRequestStatus: { - enumValues: { - "notSet": number; - "active": number; - "abandoned": number; - "completed": number; - "all": number; - }; - }; - TfvcBranch: { - fields: any; - }; - TfvcBranchMapping: { - fields: any; - }; - TfvcBranchRef: { - fields: any; - }; - TfvcChange: { - fields: any; - }; - TfvcChangeset: { - fields: any; - }; - TfvcChangesetRef: { - fields: any; - }; - TfvcChangesetSearchCriteria: { - fields: any; - }; - TfvcChangesetsRequestData: { - fields: any; - }; - TfvcCheckinEventData: { - fields: any; - }; - TfvcHistoryEntry: { - fields: any; - }; - TfvcItem: { - fields: any; - }; - TfvcItemDescriptor: { - fields: any; - }; - TfvcItemRequestData: { - fields: any; - }; - TfvcLabel: { - fields: any; - }; - TfvcLabelRef: { - fields: any; - }; - TfvcLabelRequestData: { - fields: any; - }; - TfvcMergeSource: { - fields: any; - }; - TfvcPolicyFailureInfo: { - fields: any; - }; - TfvcPolicyOverrideInfo: { - fields: any; - }; - TfvcShallowBranchRef: { - fields: any; - }; - TfvcShelveset: { - fields: any; - }; - TfvcShelvesetRef: { - fields: any; - }; - TfvcShelvesetRequestData: { - fields: any; - }; - TfvcVersionDescriptor: { - fields: any; - }; - TfvcVersionOption: { - enumValues: { - "none": number; - "previous": number; - "useRename": number; - }; - }; - TfvcVersionType: { - enumValues: { - "none": number; - "changeset": number; - "shelveset": number; - "change": number; - "date": number; - "latest": number; - "tip": number; - "mergeSource": number; - }; - }; - UpdateRefsRequest: { - fields: any; - }; - VersionControlChangeType: { - enumValues: { - "none": number; - "add": number; - "edit": number; - "encoding": number; - "rename": number; - "delete": number; - "undelete": number; - "branch": number; - "merge": number; - "lock": number; - "rollback": number; - "sourceRename": number; - "targetRename": number; - "property": number; - "all": number; - }; - }; - VersionControlProjectInfo: { - fields: any; - }; - VersionControlRecursionType: { - enumValues: { - "none": number; - "oneLevel": number; - "oneLevelPlusNestedEmptyFolders": number; - "full": number; - }; - }; - }; - -} -declare module 'vso-node-api/TfvcApi' { - /// - /// - import Q = require('q'); - import basem = require('vso-node-api/ClientApiBases'); - import VsoBaseInterfaces = require('vso-node-api/interfaces/common/VsoBaseInterfaces'); - import TfvcInterfaces = require('vso-node-api/interfaces/TfvcInterfaces'); - export interface ITfvcApi extends basem.ClientApiBase { - getBranch(path: string, project: string, includeParent: boolean, includeChildren: boolean, onResult: (err: any, statusCode: number, Branche: TfvcInterfaces.TfvcBranch) => void): void; - getBranches(project: string, includeParent: boolean, includeChildren: boolean, includeDeleted: boolean, includeLinks: boolean, onResult: (err: any, statusCode: number, Branches: TfvcInterfaces.TfvcBranch[]) => void): void; - getBranchRefs(scopePath: string, project: string, includeDeleted: boolean, includeLinks: boolean, onResult: (err: any, statusCode: number, Branches: TfvcInterfaces.TfvcBranchRef[]) => void): void; - getChangesetChanges(id: number, skip: number, top: number, onResult: (err: any, statusCode: number, ChangesetChanges: TfvcInterfaces.TfvcChange[]) => void): void; - createChangeset(changeset: TfvcInterfaces.TfvcChangeset, project: string, onResult: (err: any, statusCode: number, Changeset: TfvcInterfaces.TfvcChangesetRef) => void): void; - getChangeset(id: number, project: string, maxChangeCount: number, includeDetails: boolean, includeWorkItems: boolean, maxCommentLength: number, includeSourceRename: boolean, skip: number, top: number, orderby: string, searchCriteria: TfvcInterfaces.TfvcChangesetSearchCriteria, onResult: (err: any, statusCode: number, Changeset: TfvcInterfaces.TfvcChangeset) => void): void; - getChangesets(project: string, maxChangeCount: number, includeDetails: boolean, includeWorkItems: boolean, maxCommentLength: number, includeSourceRename: boolean, skip: number, top: number, orderby: string, searchCriteria: TfvcInterfaces.TfvcChangesetSearchCriteria, onResult: (err: any, statusCode: number, Changesets: TfvcInterfaces.TfvcChangesetRef[]) => void): void; - getBatchedChangesets(changesetsRequestData: TfvcInterfaces.TfvcChangesetsRequestData, onResult: (err: any, statusCode: number, ChangesetsBatch: TfvcInterfaces.TfvcChangesetRef[]) => void): void; - getChangesetWorkItems(id: number, onResult: (err: any, statusCode: number, ChangesetWorkItems: TfvcInterfaces.AssociatedWorkItem[]) => void): void; - getItemsBatch(itemRequestData: TfvcInterfaces.TfvcItemRequestData, project: string, onResult: (err: any, statusCode: number, ItemBatch: TfvcInterfaces.TfvcItem[][]) => void): void; - getItemsBatchZip(itemRequestData: TfvcInterfaces.TfvcItemRequestData, project: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getItem(path: string, project: string, fileName: string, download: boolean, scopePath: string, recursionLevel: TfvcInterfaces.VersionControlRecursionType, versionDescriptor: TfvcInterfaces.TfvcVersionDescriptor, onResult: (err: any, statusCode: number, Item: TfvcInterfaces.TfvcItem) => void): void; - getItemContent(path: string, project: string, fileName: string, download: boolean, scopePath: string, recursionLevel: TfvcInterfaces.VersionControlRecursionType, versionDescriptor: TfvcInterfaces.TfvcVersionDescriptor, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getItems(project: string, scopePath: string, recursionLevel: TfvcInterfaces.VersionControlRecursionType, includeLinks: boolean, versionDescriptor: TfvcInterfaces.TfvcVersionDescriptor, onResult: (err: any, statusCode: number, Items: TfvcInterfaces.TfvcItem[]) => void): void; - getItemText(path: string, project: string, fileName: string, download: boolean, scopePath: string, recursionLevel: TfvcInterfaces.VersionControlRecursionType, versionDescriptor: TfvcInterfaces.TfvcVersionDescriptor, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getItemZip(path: string, project: string, fileName: string, download: boolean, scopePath: string, recursionLevel: TfvcInterfaces.VersionControlRecursionType, versionDescriptor: TfvcInterfaces.TfvcVersionDescriptor, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getLabelItems(labelId: string, top: number, skip: number, onResult: (err: any, statusCode: number, LabelItems: TfvcInterfaces.TfvcItem[]) => void): void; - getLabel(labelId: string, requestData: TfvcInterfaces.TfvcLabelRequestData, project: string, onResult: (err: any, statusCode: number, Label: TfvcInterfaces.TfvcLabel) => void): void; - getLabels(requestData: TfvcInterfaces.TfvcLabelRequestData, project: string, top: number, skip: number, onResult: (err: any, statusCode: number, Labels: TfvcInterfaces.TfvcLabelRef[]) => void): void; - getShelvesetChanges(shelvesetId: string, top: number, skip: number, onResult: (err: any, statusCode: number, ShelvesetChanges: TfvcInterfaces.TfvcChange[]) => void): void; - getShelveset(shelvesetId: string, requestData: TfvcInterfaces.TfvcShelvesetRequestData, onResult: (err: any, statusCode: number, Shelveset: TfvcInterfaces.TfvcShelveset) => void): void; - getShelvesets(requestData: TfvcInterfaces.TfvcShelvesetRequestData, top: number, skip: number, onResult: (err: any, statusCode: number, Shelvesets: TfvcInterfaces.TfvcShelvesetRef[]) => void): void; - getShelvesetWorkItems(shelvesetId: string, onResult: (err: any, statusCode: number, ShelvesetWorkItems: TfvcInterfaces.AssociatedWorkItem[]) => void): void; - } - export interface IQTfvcApi extends basem.QClientApiBase { - getBranch(path: string, project?: string, includeParent?: boolean, includeChildren?: boolean): Q.Promise; - getBranches(project?: string, includeParent?: boolean, includeChildren?: boolean, includeDeleted?: boolean, includeLinks?: boolean): Q.Promise; - getBranchRefs(scopePath: string, project?: string, includeDeleted?: boolean, includeLinks?: boolean): Q.Promise; - getChangesetChanges(id?: number, skip?: number, top?: number): Q.Promise; - createChangeset(changeset: TfvcInterfaces.TfvcChangeset, project?: string): Q.Promise; - getChangeset(id: number, project?: string, maxChangeCount?: number, includeDetails?: boolean, includeWorkItems?: boolean, maxCommentLength?: number, includeSourceRename?: boolean, skip?: number, top?: number, orderby?: string, searchCriteria?: TfvcInterfaces.TfvcChangesetSearchCriteria): Q.Promise; - getChangesets(project?: string, maxChangeCount?: number, includeDetails?: boolean, includeWorkItems?: boolean, maxCommentLength?: number, includeSourceRename?: boolean, skip?: number, top?: number, orderby?: string, searchCriteria?: TfvcInterfaces.TfvcChangesetSearchCriteria): Q.Promise; - getBatchedChangesets(changesetsRequestData: TfvcInterfaces.TfvcChangesetsRequestData): Q.Promise; - getChangesetWorkItems(id?: number): Q.Promise; - getItemsBatch(itemRequestData: TfvcInterfaces.TfvcItemRequestData, project?: string): Q.Promise; - getItemsBatchZip(itemRequestData: TfvcInterfaces.TfvcItemRequestData, project?: string): Q.Promise; - getItem(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TfvcInterfaces.VersionControlRecursionType, versionDescriptor?: TfvcInterfaces.TfvcVersionDescriptor): Q.Promise; - getItemContent(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TfvcInterfaces.VersionControlRecursionType, versionDescriptor?: TfvcInterfaces.TfvcVersionDescriptor): Q.Promise; - getItems(project?: string, scopePath?: string, recursionLevel?: TfvcInterfaces.VersionControlRecursionType, includeLinks?: boolean, versionDescriptor?: TfvcInterfaces.TfvcVersionDescriptor): Q.Promise; - getItemText(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TfvcInterfaces.VersionControlRecursionType, versionDescriptor?: TfvcInterfaces.TfvcVersionDescriptor): Q.Promise; - getItemZip(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TfvcInterfaces.VersionControlRecursionType, versionDescriptor?: TfvcInterfaces.TfvcVersionDescriptor): Q.Promise; - getLabelItems(labelId: string, top?: number, skip?: number): Q.Promise; - getLabel(labelId: string, requestData: TfvcInterfaces.TfvcLabelRequestData, project?: string): Q.Promise; - getLabels(requestData: TfvcInterfaces.TfvcLabelRequestData, project?: string, top?: number, skip?: number): Q.Promise; - getShelvesetChanges(shelvesetId: string, top?: number, skip?: number): Q.Promise; - getShelveset(shelvesetId: string, requestData: TfvcInterfaces.TfvcShelvesetRequestData): Q.Promise; - getShelvesets(requestData: TfvcInterfaces.TfvcShelvesetRequestData, top?: number, skip?: number): Q.Promise; - getShelvesetWorkItems(shelvesetId: string): Q.Promise; - } - export class TfvcApi extends basem.ClientApiBase implements ITfvcApi { - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]); - /** - * Get a single branch hierarchy at the given path with parents or children (if specified) - * - * @param {string} path - * @param {string} project - Project ID or project name - * @param {boolean} includeParent - * @param {boolean} includeChildren - * @param onResult callback function with the resulting TfvcInterfaces.TfvcBranch - */ - getBranch(path: string, project: string, includeParent: boolean, includeChildren: boolean, onResult: (err: any, statusCode: number, Branche: TfvcInterfaces.TfvcBranch) => void): void; - /** - * Get a collection of branch roots -- first-level children, branches with no parents - * - * @param {string} project - Project ID or project name - * @param {boolean} includeParent - * @param {boolean} includeChildren - * @param {boolean} includeDeleted - * @param {boolean} includeLinks - * @param onResult callback function with the resulting TfvcInterfaces.TfvcBranch[] - */ - getBranches(project: string, includeParent: boolean, includeChildren: boolean, includeDeleted: boolean, includeLinks: boolean, onResult: (err: any, statusCode: number, Branches: TfvcInterfaces.TfvcBranch[]) => void): void; - /** - * Get branch hierarchies below the specified scopePath - * - * @param {string} scopePath - * @param {string} project - Project ID or project name - * @param {boolean} includeDeleted - * @param {boolean} includeLinks - * @param onResult callback function with the resulting TfvcInterfaces.TfvcBranchRef[] - */ - getBranchRefs(scopePath: string, project: string, includeDeleted: boolean, includeLinks: boolean, onResult: (err: any, statusCode: number, Branches: TfvcInterfaces.TfvcBranchRef[]) => void): void; - /** - * Retrieve Tfvc changes for a given changeset - * - * @param {number} id - * @param {number} skip - * @param {number} top - * @param onResult callback function with the resulting TfvcInterfaces.TfvcChange[] - */ - getChangesetChanges(id: number, skip: number, top: number, onResult: (err: any, statusCode: number, ChangesetChanges: TfvcInterfaces.TfvcChange[]) => void): void; - /** - * @param {TfvcInterfaces.TfvcChangeset} changeset - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting TfvcInterfaces.TfvcChangesetRef - */ - createChangeset(changeset: TfvcInterfaces.TfvcChangeset, project: string, onResult: (err: any, statusCode: number, Changeset: TfvcInterfaces.TfvcChangesetRef) => void): void; - /** - * Retrieve a Tfvc Changeset - * - * @param {number} id - * @param {string} project - Project ID or project name - * @param {number} maxChangeCount - * @param {boolean} includeDetails - * @param {boolean} includeWorkItems - * @param {number} maxCommentLength - * @param {boolean} includeSourceRename - * @param {number} skip - * @param {number} top - * @param {string} orderby - * @param {TfvcInterfaces.TfvcChangesetSearchCriteria} searchCriteria - * @param onResult callback function with the resulting TfvcInterfaces.TfvcChangeset - */ - getChangeset(id: number, project: string, maxChangeCount: number, includeDetails: boolean, includeWorkItems: boolean, maxCommentLength: number, includeSourceRename: boolean, skip: number, top: number, orderby: string, searchCriteria: TfvcInterfaces.TfvcChangesetSearchCriteria, onResult: (err: any, statusCode: number, Changeset: TfvcInterfaces.TfvcChangeset) => void): void; - /** - * Retrieve Tfvc changesets - * - * @param {string} project - Project ID or project name - * @param {number} maxChangeCount - * @param {boolean} includeDetails - * @param {boolean} includeWorkItems - * @param {number} maxCommentLength - * @param {boolean} includeSourceRename - * @param {number} skip - * @param {number} top - * @param {string} orderby - * @param {TfvcInterfaces.TfvcChangesetSearchCriteria} searchCriteria - * @param onResult callback function with the resulting TfvcInterfaces.TfvcChangesetRef[] - */ - getChangesets(project: string, maxChangeCount: number, includeDetails: boolean, includeWorkItems: boolean, maxCommentLength: number, includeSourceRename: boolean, skip: number, top: number, orderby: string, searchCriteria: TfvcInterfaces.TfvcChangesetSearchCriteria, onResult: (err: any, statusCode: number, Changesets: TfvcInterfaces.TfvcChangesetRef[]) => void): void; - /** - * @param {TfvcInterfaces.TfvcChangesetsRequestData} changesetsRequestData - * @param onResult callback function with the resulting TfvcInterfaces.TfvcChangesetRef[] - */ - getBatchedChangesets(changesetsRequestData: TfvcInterfaces.TfvcChangesetsRequestData, onResult: (err: any, statusCode: number, ChangesetsBatch: TfvcInterfaces.TfvcChangesetRef[]) => void): void; - /** - * @param {number} id - * @param onResult callback function with the resulting TfvcInterfaces.AssociatedWorkItem[] - */ - getChangesetWorkItems(id: number, onResult: (err: any, statusCode: number, ChangesetWorkItems: TfvcInterfaces.AssociatedWorkItem[]) => void): void; - /** - * Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path. - * - * @param {TfvcInterfaces.TfvcItemRequestData} itemRequestData - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting TfvcInterfaces.TfvcItem[][] - */ - getItemsBatch(itemRequestData: TfvcInterfaces.TfvcItemRequestData, project: string, onResult: (err: any, statusCode: number, ItemBatch: TfvcInterfaces.TfvcItem[][]) => void): void; - /** - * Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path. - * - * @param {TfvcInterfaces.TfvcItemRequestData} itemRequestData - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting ArrayBuffer - */ - getItemsBatchZip(itemRequestData: TfvcInterfaces.TfvcItemRequestData, project: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * Get Item Metadata and/or Content. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. - * - * @param {string} path - * @param {string} project - Project ID or project name - * @param {string} fileName - * @param {boolean} download - * @param {string} scopePath - * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor - * @param onResult callback function with the resulting TfvcInterfaces.TfvcItem - */ - getItem(path: string, project: string, fileName: string, download: boolean, scopePath: string, recursionLevel: TfvcInterfaces.VersionControlRecursionType, versionDescriptor: TfvcInterfaces.TfvcVersionDescriptor, onResult: (err: any, statusCode: number, Item: TfvcInterfaces.TfvcItem) => void): void; - /** - * Get Item Metadata and/or Content. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. - * - * @param {string} path - * @param {string} project - Project ID or project name - * @param {string} fileName - * @param {boolean} download - * @param {string} scopePath - * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor - * @param onResult callback function with the resulting ArrayBuffer - */ - getItemContent(path: string, project: string, fileName: string, download: boolean, scopePath: string, recursionLevel: TfvcInterfaces.VersionControlRecursionType, versionDescriptor: TfvcInterfaces.TfvcVersionDescriptor, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * Get a list of Tfvc items - * - * @param {string} project - Project ID or project name - * @param {string} scopePath - * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - * @param {boolean} includeLinks - * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor - * @param onResult callback function with the resulting TfvcInterfaces.TfvcItem[] - */ - getItems(project: string, scopePath: string, recursionLevel: TfvcInterfaces.VersionControlRecursionType, includeLinks: boolean, versionDescriptor: TfvcInterfaces.TfvcVersionDescriptor, onResult: (err: any, statusCode: number, Items: TfvcInterfaces.TfvcItem[]) => void): void; - /** - * Get Item Metadata and/or Content. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. - * - * @param {string} path - * @param {string} project - Project ID or project name - * @param {string} fileName - * @param {boolean} download - * @param {string} scopePath - * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor - * @param onResult callback function with the resulting string - */ - getItemText(path: string, project: string, fileName: string, download: boolean, scopePath: string, recursionLevel: TfvcInterfaces.VersionControlRecursionType, versionDescriptor: TfvcInterfaces.TfvcVersionDescriptor, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * Get Item Metadata and/or Content. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. - * - * @param {string} path - * @param {string} project - Project ID or project name - * @param {string} fileName - * @param {boolean} download - * @param {string} scopePath - * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor - * @param onResult callback function with the resulting ArrayBuffer - */ - getItemZip(path: string, project: string, fileName: string, download: boolean, scopePath: string, recursionLevel: TfvcInterfaces.VersionControlRecursionType, versionDescriptor: TfvcInterfaces.TfvcVersionDescriptor, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * Get items under a label. - * - * @param {string} labelId - Unique identifier of label - * @param {number} top - Max number of items to return - * @param {number} skip - Number of items to skip - * @param onResult callback function with the resulting TfvcInterfaces.TfvcItem[] - */ - getLabelItems(labelId: string, top: number, skip: number, onResult: (err: any, statusCode: number, LabelItems: TfvcInterfaces.TfvcItem[]) => void): void; - /** - * Get a single deep label. - * - * @param {string} labelId - Unique identifier of label - * @param {TfvcInterfaces.TfvcLabelRequestData} requestData - maxItemCount - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting TfvcInterfaces.TfvcLabel - */ - getLabel(labelId: string, requestData: TfvcInterfaces.TfvcLabelRequestData, project: string, onResult: (err: any, statusCode: number, Label: TfvcInterfaces.TfvcLabel) => void): void; - /** - * Get a collection of shallow label references. - * - * @param {TfvcInterfaces.TfvcLabelRequestData} requestData - labelScope, name, owner, and itemLabelFilter - * @param {string} project - Project ID or project name - * @param {number} top - Max number of labels to return - * @param {number} skip - Number of labels to skip - * @param onResult callback function with the resulting TfvcInterfaces.TfvcLabelRef[] - */ - getLabels(requestData: TfvcInterfaces.TfvcLabelRequestData, project: string, top: number, skip: number, onResult: (err: any, statusCode: number, Labels: TfvcInterfaces.TfvcLabelRef[]) => void): void; - /** - * Get changes included in a shelveset. - * - * @param {string} shelvesetId - Shelveset's unique ID - * @param {number} top - Max number of changes to return - * @param {number} skip - Number of changes to skip - * @param onResult callback function with the resulting TfvcInterfaces.TfvcChange[] - */ - getShelvesetChanges(shelvesetId: string, top: number, skip: number, onResult: (err: any, statusCode: number, ShelvesetChanges: TfvcInterfaces.TfvcChange[]) => void): void; - /** - * Get a single deep shelveset. - * - * @param {string} shelvesetId - Shelveset's unique ID - * @param {TfvcInterfaces.TfvcShelvesetRequestData} requestData - includeDetails, includeWorkItems, maxChangeCount, and maxCommentLength - * @param onResult callback function with the resulting TfvcInterfaces.TfvcShelveset - */ - getShelveset(shelvesetId: string, requestData: TfvcInterfaces.TfvcShelvesetRequestData, onResult: (err: any, statusCode: number, Shelveset: TfvcInterfaces.TfvcShelveset) => void): void; - /** - * Return a collection of shallow shelveset references. - * - * @param {TfvcInterfaces.TfvcShelvesetRequestData} requestData - name, owner, and maxCommentLength - * @param {number} top - Max number of shelvesets to return - * @param {number} skip - Number of shelvesets to skip - * @param onResult callback function with the resulting TfvcInterfaces.TfvcShelvesetRef[] - */ - getShelvesets(requestData: TfvcInterfaces.TfvcShelvesetRequestData, top: number, skip: number, onResult: (err: any, statusCode: number, Shelvesets: TfvcInterfaces.TfvcShelvesetRef[]) => void): void; - /** - * Get work items associated with a shelveset. - * - * @param {string} shelvesetId - Shelveset's unique ID - * @param onResult callback function with the resulting TfvcInterfaces.AssociatedWorkItem[] - */ - getShelvesetWorkItems(shelvesetId: string, onResult: (err: any, statusCode: number, ShelvesetWorkItems: TfvcInterfaces.AssociatedWorkItem[]) => void): void; - } - export class QTfvcApi extends basem.QClientApiBase implements IQTfvcApi { - api: TfvcApi; - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]); - /** - * Get a single branch hierarchy at the given path with parents or children (if specified) - * - * @param {string} path - * @param {string} project - Project ID or project name - * @param {boolean} includeParent - * @param {boolean} includeChildren - */ - getBranch(path: string, project?: string, includeParent?: boolean, includeChildren?: boolean): Q.Promise; - /** - * Get a collection of branch roots -- first-level children, branches with no parents - * - * @param {string} project - Project ID or project name - * @param {boolean} includeParent - * @param {boolean} includeChildren - * @param {boolean} includeDeleted - * @param {boolean} includeLinks - */ - getBranches(project?: string, includeParent?: boolean, includeChildren?: boolean, includeDeleted?: boolean, includeLinks?: boolean): Q.Promise; - /** - * Get branch hierarchies below the specified scopePath - * - * @param {string} scopePath - * @param {string} project - Project ID or project name - * @param {boolean} includeDeleted - * @param {boolean} includeLinks - */ - getBranchRefs(scopePath: string, project?: string, includeDeleted?: boolean, includeLinks?: boolean): Q.Promise; - /** - * Retrieve Tfvc changes for a given changeset - * - * @param {number} id - * @param {number} skip - * @param {number} top - */ - getChangesetChanges(id?: number, skip?: number, top?: number): Q.Promise; - /** - * @param {TfvcInterfaces.TfvcChangeset} changeset - * @param {string} project - Project ID or project name - */ - createChangeset(changeset: TfvcInterfaces.TfvcChangeset, project?: string): Q.Promise; - /** - * Retrieve a Tfvc Changeset - * - * @param {number} id - * @param {string} project - Project ID or project name - * @param {number} maxChangeCount - * @param {boolean} includeDetails - * @param {boolean} includeWorkItems - * @param {number} maxCommentLength - * @param {boolean} includeSourceRename - * @param {number} skip - * @param {number} top - * @param {string} orderby - * @param {TfvcInterfaces.TfvcChangesetSearchCriteria} searchCriteria - */ - getChangeset(id: number, project?: string, maxChangeCount?: number, includeDetails?: boolean, includeWorkItems?: boolean, maxCommentLength?: number, includeSourceRename?: boolean, skip?: number, top?: number, orderby?: string, searchCriteria?: TfvcInterfaces.TfvcChangesetSearchCriteria): Q.Promise; - /** - * Retrieve Tfvc changesets - * - * @param {string} project - Project ID or project name - * @param {number} maxChangeCount - * @param {boolean} includeDetails - * @param {boolean} includeWorkItems - * @param {number} maxCommentLength - * @param {boolean} includeSourceRename - * @param {number} skip - * @param {number} top - * @param {string} orderby - * @param {TfvcInterfaces.TfvcChangesetSearchCriteria} searchCriteria - */ - getChangesets(project?: string, maxChangeCount?: number, includeDetails?: boolean, includeWorkItems?: boolean, maxCommentLength?: number, includeSourceRename?: boolean, skip?: number, top?: number, orderby?: string, searchCriteria?: TfvcInterfaces.TfvcChangesetSearchCriteria): Q.Promise; - /** - * @param {TfvcInterfaces.TfvcChangesetsRequestData} changesetsRequestData - */ - getBatchedChangesets(changesetsRequestData: TfvcInterfaces.TfvcChangesetsRequestData): Q.Promise; - /** - * @param {number} id - */ - getChangesetWorkItems(id?: number): Q.Promise; - /** - * Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path. - * - * @param {TfvcInterfaces.TfvcItemRequestData} itemRequestData - * @param {string} project - Project ID or project name - */ - getItemsBatch(itemRequestData: TfvcInterfaces.TfvcItemRequestData, project?: string): Q.Promise; - /** - * Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path. - * - * @param {TfvcInterfaces.TfvcItemRequestData} itemRequestData - * @param {string} project - Project ID or project name - */ - getItemsBatchZip(itemRequestData: TfvcInterfaces.TfvcItemRequestData, project?: string): Q.Promise; - /** - * Get Item Metadata and/or Content. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. - * - * @param {string} path - * @param {string} project - Project ID or project name - * @param {string} fileName - * @param {boolean} download - * @param {string} scopePath - * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor - */ - getItem(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TfvcInterfaces.VersionControlRecursionType, versionDescriptor?: TfvcInterfaces.TfvcVersionDescriptor): Q.Promise; - /** - * Get Item Metadata and/or Content. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. - * - * @param {string} path - * @param {string} project - Project ID or project name - * @param {string} fileName - * @param {boolean} download - * @param {string} scopePath - * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor - */ - getItemContent(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TfvcInterfaces.VersionControlRecursionType, versionDescriptor?: TfvcInterfaces.TfvcVersionDescriptor): Q.Promise; - /** - * Get a list of Tfvc items - * - * @param {string} project - Project ID or project name - * @param {string} scopePath - * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - * @param {boolean} includeLinks - * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor - */ - getItems(project?: string, scopePath?: string, recursionLevel?: TfvcInterfaces.VersionControlRecursionType, includeLinks?: boolean, versionDescriptor?: TfvcInterfaces.TfvcVersionDescriptor): Q.Promise; - /** - * Get Item Metadata and/or Content. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. - * - * @param {string} path - * @param {string} project - Project ID or project name - * @param {string} fileName - * @param {boolean} download - * @param {string} scopePath - * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor - */ - getItemText(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TfvcInterfaces.VersionControlRecursionType, versionDescriptor?: TfvcInterfaces.TfvcVersionDescriptor): Q.Promise; - /** - * Get Item Metadata and/or Content. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. - * - * @param {string} path - * @param {string} project - Project ID or project name - * @param {string} fileName - * @param {boolean} download - * @param {string} scopePath - * @param {TfvcInterfaces.VersionControlRecursionType} recursionLevel - * @param {TfvcInterfaces.TfvcVersionDescriptor} versionDescriptor - */ - getItemZip(path: string, project?: string, fileName?: string, download?: boolean, scopePath?: string, recursionLevel?: TfvcInterfaces.VersionControlRecursionType, versionDescriptor?: TfvcInterfaces.TfvcVersionDescriptor): Q.Promise; - /** - * Get items under a label. - * - * @param {string} labelId - Unique identifier of label - * @param {number} top - Max number of items to return - * @param {number} skip - Number of items to skip - */ - getLabelItems(labelId: string, top?: number, skip?: number): Q.Promise; - /** - * Get a single deep label. - * - * @param {string} labelId - Unique identifier of label - * @param {TfvcInterfaces.TfvcLabelRequestData} requestData - maxItemCount - * @param {string} project - Project ID or project name - */ - getLabel(labelId: string, requestData: TfvcInterfaces.TfvcLabelRequestData, project?: string): Q.Promise; - /** - * Get a collection of shallow label references. - * - * @param {TfvcInterfaces.TfvcLabelRequestData} requestData - labelScope, name, owner, and itemLabelFilter - * @param {string} project - Project ID or project name - * @param {number} top - Max number of labels to return - * @param {number} skip - Number of labels to skip - */ - getLabels(requestData: TfvcInterfaces.TfvcLabelRequestData, project?: string, top?: number, skip?: number): Q.Promise; - /** - * Get changes included in a shelveset. - * - * @param {string} shelvesetId - Shelveset's unique ID - * @param {number} top - Max number of changes to return - * @param {number} skip - Number of changes to skip - */ - getShelvesetChanges(shelvesetId: string, top?: number, skip?: number): Q.Promise; - /** - * Get a single deep shelveset. - * - * @param {string} shelvesetId - Shelveset's unique ID - * @param {TfvcInterfaces.TfvcShelvesetRequestData} requestData - includeDetails, includeWorkItems, maxChangeCount, and maxCommentLength - */ - getShelveset(shelvesetId: string, requestData: TfvcInterfaces.TfvcShelvesetRequestData): Q.Promise; - /** - * Return a collection of shallow shelveset references. - * - * @param {TfvcInterfaces.TfvcShelvesetRequestData} requestData - name, owner, and maxCommentLength - * @param {number} top - Max number of shelvesets to return - * @param {number} skip - Number of shelvesets to skip - */ - getShelvesets(requestData: TfvcInterfaces.TfvcShelvesetRequestData, top?: number, skip?: number): Q.Promise; - /** - * Get work items associated with a shelveset. - * - * @param {string} shelvesetId - Shelveset's unique ID - */ - getShelvesetWorkItems(shelvesetId: string): Q.Promise; - } - -} -declare module 'vso-node-api/interfaces/WorkItemTrackingInterfaces' { - export interface AttachmentReference { - id: string; - url: string; - } - export interface FieldDependentRule extends WorkItemTrackingResource { - dependentFields: WorkItemFieldReference[]; - } - export interface FieldsToEvaluate { - fields: string[]; - fieldUpdates: { - [key: string]: any; - }; - fieldValues: { - [key: string]: any; - }; - rulesFrom: string[]; - } - export enum FieldType { - String = 0, - Integer = 1, - DateTime = 2, - PlainText = 3, - Html = 4, - TreePath = 5, - History = 6, - Double = 7, - Guid = 8, - Boolean = 9, - } - export enum FieldUsage { - None = 0, - WorkItem = 1, - WorkItemLink = 2, - Tree = 3, - WorkItemTypeExtension = 4, - } - export interface IdentityReference { - id: string; - name: string; - url: string; - } - export interface Link { - attributes: { - [key: string]: any; - }; - rel: string; - title: string; - url: string; - } - export enum LinkQueryMode { - WorkItems = 0, - LinksOneHopMustContain = 1, - LinksOneHopMayContain = 2, - LinksOneHopDoesNotContain = 3, - LinksRecursiveMustContain = 4, - LinksRecursiveMayContain = 5, - LinksRecursiveDoesNotContain = 6, - } - export enum LogicalOperation { - NONE = 0, - AND = 1, - OR = 2, - } - export interface ProjectReference { - id: string; - name: string; - url: string; - } - export enum ProvisioningActionType { - Import = 0, - Validate = 1, - } - export interface ProvisioningResult { - provisioningImportEvents: string[]; - } - export enum QueryExpand { - None = 0, - Wiql = 1, - Clauses = 2, - All = 3, - } - export interface QueryHierarchyItem extends WorkItemTrackingResource { - children: QueryHierarchyItem[]; - clauses: WorkItemQueryClause; - columns: WorkItemFieldReference[]; - filterOptions: LinkQueryMode; - hasChildren: boolean; - id: string; - isDeleted: boolean; - isFolder: boolean; - isInvalidSyntax: boolean; - isPublic: boolean; - linkClauses: WorkItemQueryClause; - name: string; - path: string; - queryType: QueryType; - sortColumns: WorkItemQuerySortColumn[]; - sourceClauses: WorkItemQueryClause; - targetClauses: WorkItemQueryClause; - wiql: string; - } - export enum QueryResultType { - WorkItem = 1, - WorkItemLink = 2, - } - export enum QueryType { - Flat = 1, - Tree = 2, - OneHop = 3, - } - export interface ReportingWorkItemLink { - changedDate: Date; - isActive: boolean; - rel: string; - sourceId: number; - targetId: number; - } - export interface ReportingWorkItemLinksBatch extends StreamedBatch { - } - export interface ReportingWorkItemRevisionsBatch extends StreamedBatch { - } - export interface ReportingWorkItemRevisionsFilter { - /** - * A list of fields to return in work item revisions. Omit this parameter to get all reportable fields. - */ - fields: string[]; - /** - * Return an identity reference instead of a string value for identity fields. - */ - includeIdentityRef: boolean; - /** - * A list of types to filter the results to specific work item types. Omit this parameter to get work item revisions of all work item types. - */ - types: string[]; - } - export interface StreamedBatch { - continuationToken: string; - isLastBatch: boolean; - nextLink: string; - values: T[]; - } - export enum TemplateType { - WorkItemType = 0, - GlobalWorkflow = 1, - } - export enum TreeNodeStructureType { - Area = 0, - Iteration = 1, - } - export enum TreeStructureGroup { - Areas = 0, - Iterations = 1, - } - export interface Wiql { - query: string; - } - export interface WitBatchRequest { - body: string; - headers: { - [key: string]: string; - }; - method: string; - uri: string; - } - export interface WitBatchResponse { - body: string; - code: number; - headers: { - [key: string]: string; - }; - } - export interface WorkItem extends WorkItemTrackingResource { - fields: { - [key: string]: any; - }; - id: number; - relations: WorkItemRelation[]; - rev: number; - } - export interface WorkItemClassificationNode extends WorkItemTrackingResource { - attributes: { - [key: string]: any; - }; - children: WorkItemClassificationNode[]; - id: number; - identifier: string; - name: string; - structureType: TreeNodeStructureType; - } - export interface WorkItemDelete extends WorkItemDeleteReference { - resource: WorkItem; - } - export interface WorkItemDeleteReference { - code: number; - deletedBy: string; - deletedDate: string; - id: number; - message: string; - name: string; - project: string; - type: string; - url: string; - } - export interface WorkItemDeleteUpdate { - isDeleted: boolean; - } - export enum WorkItemExpand { - None = 0, - Relations = 1, - Fields = 2, - All = 3, - } - export interface WorkItemField extends WorkItemTrackingResource { - name: string; - readOnly: boolean; - referenceName: string; - supportedOperations: WorkItemFieldOperation[]; - type: FieldType; - } - export interface WorkItemFieldOperation { - name: string; - referenceName: string; - } - export interface WorkItemFieldReference { - name: string; - referenceName: string; - url: string; - } - export interface WorkItemFieldUpdate { - newValue: any; - oldValue: any; - } - export interface WorkItemHistory extends WorkItemTrackingResource { - rev: number; - revisedBy: IdentityReference; - revisedDate: Date; - value: string; - } - export interface WorkItemLink { - rel: string; - source: WorkItemReference; - target: WorkItemReference; - } - export interface WorkItemQueryClause { - clauses: WorkItemQueryClause[]; - field: WorkItemFieldReference; - fieldValue: WorkItemFieldReference; - isFieldValue: boolean; - logicalOperator: LogicalOperation; - operator: WorkItemFieldOperation; - value: string; - } - export interface WorkItemQueryResult { - asOf: Date; - columns: WorkItemFieldReference[]; - queryResultType: QueryResultType; - queryType: QueryType; - sortColumns: WorkItemQuerySortColumn[]; - workItemRelations: WorkItemLink[]; - workItems: WorkItemReference[]; - } - export interface WorkItemQuerySortColumn { - descending: boolean; - field: WorkItemFieldReference; - } - export interface WorkItemReference { - id: number; - url: string; - } - export interface WorkItemRelation extends Link { - } - export interface WorkItemRelationType extends WorkItemTrackingReference { - attributes: { - [key: string]: any; - }; - } - export interface WorkItemRelationUpdates { - added: WorkItemRelation[]; - removed: WorkItemRelation[]; - updated: WorkItemRelation[]; - } - export interface WorkItemRevisionReference extends WorkItemReference { - rev: number; - } - export interface WorkItemTrackingReference extends WorkItemTrackingResource { - name: string; - referenceName: string; - } - export interface WorkItemTrackingResource extends WorkItemTrackingResourceReference { - _links: any; - } - export interface WorkItemTrackingResourceReference { - url: string; - } - export interface WorkItemType extends WorkItemTrackingResource { - description: string; - fields: WorkItemTypeFieldInstance[]; - name: string; - xmlForm: string; - } - export interface WorkItemTypeCategory extends WorkItemTrackingResource { - defaultWorkItemType: WorkItemTypeReference; - name: string; - referenceName: string; - workItemTypes: WorkItemTypeReference[]; - } - export interface WorkItemTypeFieldInstance { - field: WorkItemFieldReference; - helpText: string; - } - export interface WorkItemTypeReference extends WorkItemTrackingResourceReference { - name: string; - } - export interface WorkItemTypeTemplate { - template: string; - } - export interface WorkItemTypeTemplateUpdateModel { - actionType: ProvisioningActionType; - methodology: string; - template: string; - templateType: TemplateType; - } - export interface WorkItemUpdate extends WorkItemTrackingResourceReference { - fields: { - [key: string]: WorkItemFieldUpdate; - }; - id: number; - relations: WorkItemRelationUpdates; - rev: number; - revisedBy: IdentityReference; - revisedDate: Date; - workItemId: number; - } - export var TypeInfo: { - AttachmentReference: { - fields: any; - }; - FieldDependentRule: { - fields: any; - }; - FieldsToEvaluate: { - fields: any; - }; - FieldType: { - enumValues: { - "string": number; - "integer": number; - "dateTime": number; - "plainText": number; - "html": number; - "treePath": number; - "history": number; - "double": number; - "guid": number; - "boolean": number; - }; - }; - FieldUsage: { - enumValues: { - "none": number; - "workItem": number; - "workItemLink": number; - "tree": number; - "workItemTypeExtension": number; - }; - }; - IdentityReference: { - fields: any; - }; - Link: { - fields: any; - }; - LinkQueryMode: { - enumValues: { - "workItems": number; - "linksOneHopMustContain": number; - "linksOneHopMayContain": number; - "linksOneHopDoesNotContain": number; - "linksRecursiveMustContain": number; - "linksRecursiveMayContain": number; - "linksRecursiveDoesNotContain": number; - }; - }; - LogicalOperation: { - enumValues: { - "nONE": number; - "aND": number; - "oR": number; - }; - }; - ProjectReference: { - fields: any; - }; - ProvisioningActionType: { - enumValues: { - "import": number; - "validate": number; - }; - }; - ProvisioningResult: { - fields: any; - }; - QueryExpand: { - enumValues: { - "none": number; - "wiql": number; - "clauses": number; - "all": number; - }; - }; - QueryHierarchyItem: { - fields: any; - }; - QueryResultType: { - enumValues: { - "workItem": number; - "workItemLink": number; - }; - }; - QueryType: { - enumValues: { - "flat": number; - "tree": number; - "oneHop": number; - }; - }; - ReportingWorkItemLink: { - fields: any; - }; - ReportingWorkItemLinksBatch: { - fields: any; - }; - ReportingWorkItemRevisionsBatch: { - fields: any; - }; - ReportingWorkItemRevisionsFilter: { - fields: any; - }; - StreamedBatch: { - fields: any; - }; - TemplateType: { - enumValues: { - "workItemType": number; - "globalWorkflow": number; - }; - }; - TreeNodeStructureType: { - enumValues: { - "area": number; - "iteration": number; - }; - }; - TreeStructureGroup: { - enumValues: { - "areas": number; - "iterations": number; - }; - }; - Wiql: { - fields: any; - }; - WitBatchRequest: { - fields: any; - }; - WitBatchResponse: { - fields: any; - }; - WorkItem: { - fields: any; - }; - WorkItemClassificationNode: { - fields: any; - }; - WorkItemDelete: { - fields: any; - }; - WorkItemDeleteReference: { - fields: any; - }; - WorkItemDeleteUpdate: { - fields: any; - }; - WorkItemExpand: { - enumValues: { - "none": number; - "relations": number; - "fields": number; - "all": number; - }; - }; - WorkItemField: { - fields: any; - }; - WorkItemFieldOperation: { - fields: any; - }; - WorkItemFieldReference: { - fields: any; - }; - WorkItemFieldUpdate: { - fields: any; - }; - WorkItemHistory: { - fields: any; - }; - WorkItemLink: { - fields: any; - }; - WorkItemQueryClause: { - fields: any; - }; - WorkItemQueryResult: { - fields: any; - }; - WorkItemQuerySortColumn: { - fields: any; - }; - WorkItemReference: { - fields: any; - }; - WorkItemRelation: { - fields: any; - }; - WorkItemRelationType: { - fields: any; - }; - WorkItemRelationUpdates: { - fields: any; - }; - WorkItemRevisionReference: { - fields: any; - }; - WorkItemTrackingReference: { - fields: any; - }; - WorkItemTrackingResource: { - fields: any; - }; - WorkItemTrackingResourceReference: { - fields: any; - }; - WorkItemType: { - fields: any; - }; - WorkItemTypeCategory: { - fields: any; - }; - WorkItemTypeFieldInstance: { - fields: any; - }; - WorkItemTypeReference: { - fields: any; - }; - WorkItemTypeTemplate: { - fields: any; - }; - WorkItemTypeTemplateUpdateModel: { - fields: any; - }; - WorkItemUpdate: { - fields: any; - }; - }; - -} -declare module 'vso-node-api/WorkItemTrackingApi' { - /// - /// - import Q = require('q'); - import basem = require('vso-node-api/ClientApiBases'); - import VsoBaseInterfaces = require('vso-node-api/interfaces/common/VsoBaseInterfaces'); - import TfsCoreInterfaces = require('vso-node-api/interfaces/CoreInterfaces'); - import VSSInterfaces = require('vso-node-api/interfaces/common/VSSInterfaces'); - import WorkItemTrackingInterfaces = require('vso-node-api/interfaces/WorkItemTrackingInterfaces'); - export interface IWorkItemTrackingApi extends basem.ClientApiBase { - createAttachment(customHeaders: any, contentStream: NodeJS.ReadableStream, fileName: string, uploadType: string, onResult: (err: any, statusCode: number, attachment: WorkItemTrackingInterfaces.AttachmentReference) => void): void; - getAttachmentContent(id: string, fileName: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getAttachmentZip(id: string, fileName: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getRootNodes(project: string, depth: number, onResult: (err: any, statusCode: number, classificationNodes: WorkItemTrackingInterfaces.WorkItemClassificationNode[]) => void): void; - createOrUpdateClassificationNode(postedNode: WorkItemTrackingInterfaces.WorkItemClassificationNode, project: string, structureGroup: WorkItemTrackingInterfaces.TreeStructureGroup, path: string, onResult: (err: any, statusCode: number, classificationNode: WorkItemTrackingInterfaces.WorkItemClassificationNode) => void): void; - deleteClassificationNode(project: string, structureGroup: WorkItemTrackingInterfaces.TreeStructureGroup, path: string, reclassifyId: number, onResult: (err: any, statusCode: number) => void): void; - getClassificationNode(project: string, structureGroup: WorkItemTrackingInterfaces.TreeStructureGroup, path: string, depth: number, onResult: (err: any, statusCode: number, classificationNode: WorkItemTrackingInterfaces.WorkItemClassificationNode) => void): void; - updateClassificationNode(postedNode: WorkItemTrackingInterfaces.WorkItemClassificationNode, project: string, structureGroup: WorkItemTrackingInterfaces.TreeStructureGroup, path: string, onResult: (err: any, statusCode: number, classificationNode: WorkItemTrackingInterfaces.WorkItemClassificationNode) => void): void; - getField(field: string, onResult: (err: any, statusCode: number, field: WorkItemTrackingInterfaces.WorkItemField) => void): void; - getFields(onResult: (err: any, statusCode: number, fields: WorkItemTrackingInterfaces.WorkItemField[]) => void): void; - getHistory(id: number, top: number, skip: number, onResult: (err: any, statusCode: number, history: WorkItemTrackingInterfaces.WorkItemHistory[]) => void): void; - getHistoryById(id: number, revisionNumber: number, onResult: (err: any, statusCode: number, history: WorkItemTrackingInterfaces.WorkItemHistory) => void): void; - createQuery(postedQuery: WorkItemTrackingInterfaces.QueryHierarchyItem, project: string, query: string, onResult: (err: any, statusCode: number, querie: WorkItemTrackingInterfaces.QueryHierarchyItem) => void): void; - deleteQuery(project: string, query: string, onResult: (err: any, statusCode: number) => void): void; - getQueries(project: string, expand: WorkItemTrackingInterfaces.QueryExpand, depth: number, includeDeleted: boolean, onResult: (err: any, statusCode: number, queries: WorkItemTrackingInterfaces.QueryHierarchyItem[]) => void): void; - getQuery(project: string, query: string, expand: WorkItemTrackingInterfaces.QueryExpand, depth: number, includeDeleted: boolean, onResult: (err: any, statusCode: number, querie: WorkItemTrackingInterfaces.QueryHierarchyItem) => void): void; - updateQuery(queryUpdate: WorkItemTrackingInterfaces.QueryHierarchyItem, project: string, query: string, undeleteDescendants: boolean, onResult: (err: any, statusCode: number, querie: WorkItemTrackingInterfaces.QueryHierarchyItem) => void): void; - destroyWorkItem(id: number, project: string, onResult: (err: any, statusCode: number) => void): void; - getDeletedWorkItem(id: number, project: string, onResult: (err: any, statusCode: number, recyclebin: WorkItemTrackingInterfaces.WorkItemDelete) => void): void; - getDeletedWorkItems(project: string, ids: number[], onResult: (err: any, statusCode: number, recyclebin: WorkItemTrackingInterfaces.WorkItemDeleteReference[]) => void): void; - restoreWorkItem(payload: WorkItemTrackingInterfaces.WorkItemDeleteUpdate, id: number, project: string, onResult: (err: any, statusCode: number, recyclebin: WorkItemTrackingInterfaces.WorkItemDelete) => void): void; - getRevision(id: number, revisionNumber: number, expand: WorkItemTrackingInterfaces.WorkItemExpand, onResult: (err: any, statusCode: number, revision: WorkItemTrackingInterfaces.WorkItem) => void): void; - getRevisions(id: number, top: number, skip: number, expand: WorkItemTrackingInterfaces.WorkItemExpand, onResult: (err: any, statusCode: number, revisions: WorkItemTrackingInterfaces.WorkItem[]) => void): void; - evaluateRulesOnField(ruleEngineInput: WorkItemTrackingInterfaces.FieldsToEvaluate, onResult: (err: any, statusCode: number) => void): void; - getUpdate(id: number, updateNumber: number, onResult: (err: any, statusCode: number, update: WorkItemTrackingInterfaces.WorkItemUpdate) => void): void; - getUpdates(id: number, top: number, skip: number, onResult: (err: any, statusCode: number, updates: WorkItemTrackingInterfaces.WorkItemUpdate[]) => void): void; - queryByWiql(wiql: WorkItemTrackingInterfaces.Wiql, teamContext: TfsCoreInterfaces.TeamContext, timePrecision: boolean, onResult: (err: any, statusCode: number, wiql: WorkItemTrackingInterfaces.WorkItemQueryResult) => void): void; - queryById(id: string, teamContext: TfsCoreInterfaces.TeamContext, timePrecision: boolean, onResult: (err: any, statusCode: number, wiql: WorkItemTrackingInterfaces.WorkItemQueryResult) => void): void; - getReportingLinks(project: string, types: string[], continuationToken: string, startDateTime: Date, onResult: (err: any, statusCode: number, workItemLink: WorkItemTrackingInterfaces.ReportingWorkItemLinksBatch) => void): void; - getRelationType(relation: string, onResult: (err: any, statusCode: number, workItemRelationType: WorkItemTrackingInterfaces.WorkItemRelationType) => void): void; - getRelationTypes(onResult: (err: any, statusCode: number, workItemRelationTypes: WorkItemTrackingInterfaces.WorkItemRelationType[]) => void): void; - readReportingRevisionsGet(project: string, fields: string[], types: string[], continuationToken: string, startDateTime: Date, includeIdentityRef: boolean, includeDeleted: boolean, includeTagRef: boolean, onResult: (err: any, statusCode: number, workItemRevision: WorkItemTrackingInterfaces.ReportingWorkItemRevisionsBatch) => void): void; - readReportingRevisionsPost(filter: WorkItemTrackingInterfaces.ReportingWorkItemRevisionsFilter, project: string, continuationToken: string, startDateTime: Date, onResult: (err: any, statusCode: number, workItemRevision: WorkItemTrackingInterfaces.ReportingWorkItemRevisionsBatch) => void): void; - deleteWorkItem(id: number, destroy: boolean, onResult: (err: any, statusCode: number, workItem: WorkItemTrackingInterfaces.WorkItemDelete) => void): void; - getWorkItem(id: number, fields: string[], asOf: Date, expand: WorkItemTrackingInterfaces.WorkItemExpand, onResult: (err: any, statusCode: number, workItem: WorkItemTrackingInterfaces.WorkItem) => void): void; - getWorkItems(ids: number[], fields: string[], asOf: Date, expand: WorkItemTrackingInterfaces.WorkItemExpand, onResult: (err: any, statusCode: number, workItems: WorkItemTrackingInterfaces.WorkItem[]) => void): void; - updateWorkItem(customHeaders: any, document: VSSInterfaces.JsonPatchDocument, id: number, validateOnly: boolean, bypassRules: boolean, onResult: (err: any, statusCode: number, workItem: WorkItemTrackingInterfaces.WorkItem) => void): void; - createWorkItem(customHeaders: any, document: VSSInterfaces.JsonPatchDocument, project: string, type: string, validateOnly: boolean, bypassRules: boolean, onResult: (err: any, statusCode: number, workItem: WorkItemTrackingInterfaces.WorkItem) => void): void; - getWorkItemTemplate(project: string, type: string, fields: string, asOf: Date, expand: WorkItemTrackingInterfaces.WorkItemExpand, onResult: (err: any, statusCode: number, workItem: WorkItemTrackingInterfaces.WorkItem) => void): void; - getWorkItemTypeCategories(project: string, onResult: (err: any, statusCode: number, workItemTypeCategories: WorkItemTrackingInterfaces.WorkItemTypeCategory[]) => void): void; - getWorkItemTypeCategory(project: string, category: string, onResult: (err: any, statusCode: number, workItemTypeCategorie: WorkItemTrackingInterfaces.WorkItemTypeCategory) => void): void; - getWorkItemType(project: string, type: string, onResult: (err: any, statusCode: number, workItemType: WorkItemTrackingInterfaces.WorkItemType) => void): void; - getWorkItemTypes(project: string, onResult: (err: any, statusCode: number, workItemTypes: WorkItemTrackingInterfaces.WorkItemType[]) => void): void; - getDependentFields(project: string, type: string, field: string, onResult: (err: any, statusCode: number, workItemTypesField: WorkItemTrackingInterfaces.FieldDependentRule) => void): void; - exportWorkItemTypeDefinition(project: string, type: string, exportGlobalLists: boolean, onResult: (err: any, statusCode: number, workItemTypeTemplate: WorkItemTrackingInterfaces.WorkItemTypeTemplate) => void): void; - updateWorkItemTypeDefinition(updateModel: WorkItemTrackingInterfaces.WorkItemTypeTemplateUpdateModel, project: string, onResult: (err: any, statusCode: number, workItemTypeTemplate: WorkItemTrackingInterfaces.ProvisioningResult) => void): void; - } - export interface IQWorkItemTrackingApi extends basem.QClientApiBase { - createAttachment(customHeaders: any, contentStream: NodeJS.ReadableStream, fileName?: string, uploadType?: string): Q.Promise; - getAttachmentContent(id: string, fileName?: string): Q.Promise; - getAttachmentZip(id: string, fileName?: string): Q.Promise; - getRootNodes(project: string, depth?: number): Q.Promise; - createOrUpdateClassificationNode(postedNode: WorkItemTrackingInterfaces.WorkItemClassificationNode, project: string, structureGroup: WorkItemTrackingInterfaces.TreeStructureGroup, path?: string): Q.Promise; - deleteClassificationNode(project: string, structureGroup: WorkItemTrackingInterfaces.TreeStructureGroup, path?: string, reclassifyId?: number): Q.Promise; - getClassificationNode(project: string, structureGroup: WorkItemTrackingInterfaces.TreeStructureGroup, path?: string, depth?: number): Q.Promise; - updateClassificationNode(postedNode: WorkItemTrackingInterfaces.WorkItemClassificationNode, project: string, structureGroup: WorkItemTrackingInterfaces.TreeStructureGroup, path?: string): Q.Promise; - getField(field: string): Q.Promise; - getFields(): Q.Promise; - getHistory(id: number, top?: number, skip?: number): Q.Promise; - getHistoryById(id: number, revisionNumber: number): Q.Promise; - createQuery(postedQuery: WorkItemTrackingInterfaces.QueryHierarchyItem, project: string, query: string): Q.Promise; - deleteQuery(project: string, query: string): Q.Promise; - getQueries(project: string, expand?: WorkItemTrackingInterfaces.QueryExpand, depth?: number, includeDeleted?: boolean): Q.Promise; - getQuery(project: string, query: string, expand?: WorkItemTrackingInterfaces.QueryExpand, depth?: number, includeDeleted?: boolean): Q.Promise; - updateQuery(queryUpdate: WorkItemTrackingInterfaces.QueryHierarchyItem, project: string, query: string, undeleteDescendants?: boolean): Q.Promise; - destroyWorkItem(id: number, project?: string): Q.Promise; - getDeletedWorkItem(id: number, project?: string): Q.Promise; - getDeletedWorkItems(project?: string, ids?: number[]): Q.Promise; - restoreWorkItem(payload: WorkItemTrackingInterfaces.WorkItemDeleteUpdate, id: number, project?: string): Q.Promise; - getRevision(id: number, revisionNumber: number, expand?: WorkItemTrackingInterfaces.WorkItemExpand): Q.Promise; - getRevisions(id: number, top?: number, skip?: number, expand?: WorkItemTrackingInterfaces.WorkItemExpand): Q.Promise; - evaluateRulesOnField(ruleEngineInput: WorkItemTrackingInterfaces.FieldsToEvaluate): Q.Promise; - getUpdate(id: number, updateNumber: number): Q.Promise; - getUpdates(id: number, top?: number, skip?: number): Q.Promise; - queryByWiql(wiql: WorkItemTrackingInterfaces.Wiql, teamContext?: TfsCoreInterfaces.TeamContext, timePrecision?: boolean): Q.Promise; - queryById(id: string, teamContext?: TfsCoreInterfaces.TeamContext, timePrecision?: boolean): Q.Promise; - getReportingLinks(project?: string, types?: string[], continuationToken?: string, startDateTime?: Date): Q.Promise; - getRelationType(relation: string): Q.Promise; - getRelationTypes(): Q.Promise; - readReportingRevisionsGet(project?: string, fields?: string[], types?: string[], continuationToken?: string, startDateTime?: Date, includeIdentityRef?: boolean, includeDeleted?: boolean, includeTagRef?: boolean): Q.Promise; - readReportingRevisionsPost(filter: WorkItemTrackingInterfaces.ReportingWorkItemRevisionsFilter, project?: string, continuationToken?: string, startDateTime?: Date): Q.Promise; - deleteWorkItem(id: number, destroy?: boolean): Q.Promise; - getWorkItem(id: number, fields?: string[], asOf?: Date, expand?: WorkItemTrackingInterfaces.WorkItemExpand): Q.Promise; - getWorkItems(ids: number[], fields?: string[], asOf?: Date, expand?: WorkItemTrackingInterfaces.WorkItemExpand): Q.Promise; - updateWorkItem(customHeaders: any, document: VSSInterfaces.JsonPatchDocument, id: number, validateOnly?: boolean, bypassRules?: boolean): Q.Promise; - createWorkItem(customHeaders: any, document: VSSInterfaces.JsonPatchDocument, project: string, type: string, validateOnly?: boolean, bypassRules?: boolean): Q.Promise; - getWorkItemTemplate(project: string, type: string, fields?: string, asOf?: Date, expand?: WorkItemTrackingInterfaces.WorkItemExpand): Q.Promise; - getWorkItemTypeCategories(project: string): Q.Promise; - getWorkItemTypeCategory(project: string, category: string): Q.Promise; - getWorkItemType(project: string, type: string): Q.Promise; - getWorkItemTypes(project: string): Q.Promise; - getDependentFields(project: string, type: string, field: string): Q.Promise; - exportWorkItemTypeDefinition(project?: string, type?: string, exportGlobalLists?: boolean): Q.Promise; - updateWorkItemTypeDefinition(updateModel: WorkItemTrackingInterfaces.WorkItemTypeTemplateUpdateModel, project?: string): Q.Promise; - } - export class WorkItemTrackingApi extends basem.ClientApiBase implements IWorkItemTrackingApi { - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]); - /** - * Creates an attachment. - * - * @param {NodeJS.ReadableStream} contentStream - Content to upload - * @param {string} fileName - * @param {string} uploadType - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.AttachmentReference - */ - createAttachment(customHeaders: VsoBaseInterfaces.IHeaders, contentStream: NodeJS.ReadableStream, fileName: string, uploadType: string, onResult: (err: any, statusCode: number, attachment: WorkItemTrackingInterfaces.AttachmentReference) => void): void; - /** - * Returns an attachment - * - * @param {string} id - * @param {string} fileName - * @param onResult callback function with the resulting ArrayBuffer - */ - getAttachmentContent(id: string, fileName: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * Returns an attachment - * - * @param {string} id - * @param {string} fileName - * @param onResult callback function with the resulting ArrayBuffer - */ - getAttachmentZip(id: string, fileName: string, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} depth - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItemClassificationNode[] - */ - getRootNodes(project: string, depth: number, onResult: (err: any, statusCode: number, classificationNodes: WorkItemTrackingInterfaces.WorkItemClassificationNode[]) => void): void; - /** - * @param {WorkItemTrackingInterfaces.WorkItemClassificationNode} postedNode - * @param {string} project - Project ID or project name - * @param {WorkItemTrackingInterfaces.TreeStructureGroup} structureGroup - * @param {string} path - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItemClassificationNode - */ - createOrUpdateClassificationNode(postedNode: WorkItemTrackingInterfaces.WorkItemClassificationNode, project: string, structureGroup: WorkItemTrackingInterfaces.TreeStructureGroup, path: string, onResult: (err: any, statusCode: number, classificationNode: WorkItemTrackingInterfaces.WorkItemClassificationNode) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {WorkItemTrackingInterfaces.TreeStructureGroup} structureGroup - * @param {string} path - * @param {number} reclassifyId - * @param onResult callback function - */ - deleteClassificationNode(project: string, structureGroup: WorkItemTrackingInterfaces.TreeStructureGroup, path: string, reclassifyId: number, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {WorkItemTrackingInterfaces.TreeStructureGroup} structureGroup - * @param {string} path - * @param {number} depth - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItemClassificationNode - */ - getClassificationNode(project: string, structureGroup: WorkItemTrackingInterfaces.TreeStructureGroup, path: string, depth: number, onResult: (err: any, statusCode: number, classificationNode: WorkItemTrackingInterfaces.WorkItemClassificationNode) => void): void; - /** - * @param {WorkItemTrackingInterfaces.WorkItemClassificationNode} postedNode - * @param {string} project - Project ID or project name - * @param {WorkItemTrackingInterfaces.TreeStructureGroup} structureGroup - * @param {string} path - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItemClassificationNode - */ - updateClassificationNode(postedNode: WorkItemTrackingInterfaces.WorkItemClassificationNode, project: string, structureGroup: WorkItemTrackingInterfaces.TreeStructureGroup, path: string, onResult: (err: any, statusCode: number, classificationNode: WorkItemTrackingInterfaces.WorkItemClassificationNode) => void): void; - /** - * @param {string} field - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItemField - */ - getField(field: string, onResult: (err: any, statusCode: number, field: WorkItemTrackingInterfaces.WorkItemField) => void): void; - /** - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItemField[] - */ - getFields(onResult: (err: any, statusCode: number, fields: WorkItemTrackingInterfaces.WorkItemField[]) => void): void; - /** - * Returns history of all revision for a given work item ID - * - * @param {number} id - * @param {number} top - * @param {number} skip - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItemHistory[] - */ - getHistory(id: number, top: number, skip: number, onResult: (err: any, statusCode: number, history: WorkItemTrackingInterfaces.WorkItemHistory[]) => void): void; - /** - * Returns the history value of particular revision - * - * @param {number} id - * @param {number} revisionNumber - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItemHistory - */ - getHistoryById(id: number, revisionNumber: number, onResult: (err: any, statusCode: number, history: WorkItemTrackingInterfaces.WorkItemHistory) => void): void; - /** - * Creates a query, or moves a query. - * - * @param {WorkItemTrackingInterfaces.QueryHierarchyItem} postedQuery - The query to create. - * @param {string} project - Project ID or project name - * @param {string} query - The parent path for the query to create. - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.QueryHierarchyItem - */ - createQuery(postedQuery: WorkItemTrackingInterfaces.QueryHierarchyItem, project: string, query: string, onResult: (err: any, statusCode: number, querie: WorkItemTrackingInterfaces.QueryHierarchyItem) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {string} query - * @param onResult callback function - */ - deleteQuery(project: string, query: string, onResult: (err: any, statusCode: number) => void): void; - /** - * Retrieves all queries the user has access to in the current project - * - * @param {string} project - Project ID or project name - * @param {WorkItemTrackingInterfaces.QueryExpand} expand - * @param {number} depth - * @param {boolean} includeDeleted - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.QueryHierarchyItem[] - */ - getQueries(project: string, expand: WorkItemTrackingInterfaces.QueryExpand, depth: number, includeDeleted: boolean, onResult: (err: any, statusCode: number, queries: WorkItemTrackingInterfaces.QueryHierarchyItem[]) => void): void; - /** - * Retrieves a single query by project and either id or path - * - * @param {string} project - Project ID or project name - * @param {string} query - * @param {WorkItemTrackingInterfaces.QueryExpand} expand - * @param {number} depth - * @param {boolean} includeDeleted - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.QueryHierarchyItem - */ - getQuery(project: string, query: string, expand: WorkItemTrackingInterfaces.QueryExpand, depth: number, includeDeleted: boolean, onResult: (err: any, statusCode: number, querie: WorkItemTrackingInterfaces.QueryHierarchyItem) => void): void; - /** - * @param {WorkItemTrackingInterfaces.QueryHierarchyItem} queryUpdate - * @param {string} project - Project ID or project name - * @param {string} query - * @param {boolean} undeleteDescendants - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.QueryHierarchyItem - */ - updateQuery(queryUpdate: WorkItemTrackingInterfaces.QueryHierarchyItem, project: string, query: string, undeleteDescendants: boolean, onResult: (err: any, statusCode: number, querie: WorkItemTrackingInterfaces.QueryHierarchyItem) => void): void; - /** - * @param {number} id - * @param {string} project - Project ID or project name - * @param onResult callback function - */ - destroyWorkItem(id: number, project: string, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {number} id - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItemDelete - */ - getDeletedWorkItem(id: number, project: string, onResult: (err: any, statusCode: number, recyclebin: WorkItemTrackingInterfaces.WorkItemDelete) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number[]} ids - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItemDeleteReference[] - */ - getDeletedWorkItems(project: string, ids: number[], onResult: (err: any, statusCode: number, recyclebin: WorkItemTrackingInterfaces.WorkItemDeleteReference[]) => void): void; - /** - * @param {WorkItemTrackingInterfaces.WorkItemDeleteUpdate} payload - * @param {number} id - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItemDelete - */ - restoreWorkItem(payload: WorkItemTrackingInterfaces.WorkItemDeleteUpdate, id: number, project: string, onResult: (err: any, statusCode: number, recyclebin: WorkItemTrackingInterfaces.WorkItemDelete) => void): void; - /** - * Returns a fully hydrated work item for the requested revision - * - * @param {number} id - * @param {number} revisionNumber - * @param {WorkItemTrackingInterfaces.WorkItemExpand} expand - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItem - */ - getRevision(id: number, revisionNumber: number, expand: WorkItemTrackingInterfaces.WorkItemExpand, onResult: (err: any, statusCode: number, revision: WorkItemTrackingInterfaces.WorkItem) => void): void; - /** - * Returns the list of fully hydrated work item revisions, paged. - * - * @param {number} id - * @param {number} top - * @param {number} skip - * @param {WorkItemTrackingInterfaces.WorkItemExpand} expand - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItem[] - */ - getRevisions(id: number, top: number, skip: number, expand: WorkItemTrackingInterfaces.WorkItemExpand, onResult: (err: any, statusCode: number, revisions: WorkItemTrackingInterfaces.WorkItem[]) => void): void; - /** - * Validates the fields values. - * - * @param {WorkItemTrackingInterfaces.FieldsToEvaluate} ruleEngineInput - * @param onResult callback function - */ - evaluateRulesOnField(ruleEngineInput: WorkItemTrackingInterfaces.FieldsToEvaluate, onResult: (err: any, statusCode: number) => void): void; - /** - * Returns a single update for a work item - * - * @param {number} id - * @param {number} updateNumber - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItemUpdate - */ - getUpdate(id: number, updateNumber: number, onResult: (err: any, statusCode: number, update: WorkItemTrackingInterfaces.WorkItemUpdate) => void): void; - /** - * Returns a the deltas between work item revisions - * - * @param {number} id - * @param {number} top - * @param {number} skip - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItemUpdate[] - */ - getUpdates(id: number, top: number, skip: number, onResult: (err: any, statusCode: number, updates: WorkItemTrackingInterfaces.WorkItemUpdate[]) => void): void; - /** - * Gets the results of the query. - * - * @param {WorkItemTrackingInterfaces.Wiql} wiql - The query containing the wiql. - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {boolean} timePrecision - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItemQueryResult - */ - queryByWiql(wiql: WorkItemTrackingInterfaces.Wiql, teamContext: TfsCoreInterfaces.TeamContext, timePrecision: boolean, onResult: (err: any, statusCode: number, wiql: WorkItemTrackingInterfaces.WorkItemQueryResult) => void): void; - /** - * Gets the results of the query by id. - * - * @param {string} id - The query id. - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {boolean} timePrecision - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItemQueryResult - */ - queryById(id: string, teamContext: TfsCoreInterfaces.TeamContext, timePrecision: boolean, onResult: (err: any, statusCode: number, wiql: WorkItemTrackingInterfaces.WorkItemQueryResult) => void): void; - /** - * Get a batch of work item links - * - * @param {string} project - Project ID or project name - * @param {string[]} types - A list of types to filter the results to specific work item types. Omit this parameter to get work item links of all work item types. - * @param {string} continuationToken - Specifies the continuationToken to start the batch from. Omit this parameter to get the first batch of links. - * @param {Date} startDateTime - Date/time to use as a starting point for link changes. Only link changes that occurred after that date/time will be returned. Cannot be used in conjunction with 'watermark' parameter. - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.ReportingWorkItemLinksBatch - */ - getReportingLinks(project: string, types: string[], continuationToken: string, startDateTime: Date, onResult: (err: any, statusCode: number, workItemLink: WorkItemTrackingInterfaces.ReportingWorkItemLinksBatch) => void): void; - /** - * Gets the work item relation types. - * - * @param {string} relation - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItemRelationType - */ - getRelationType(relation: string, onResult: (err: any, statusCode: number, workItemRelationType: WorkItemTrackingInterfaces.WorkItemRelationType) => void): void; - /** - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItemRelationType[] - */ - getRelationTypes(onResult: (err: any, statusCode: number, workItemRelationTypes: WorkItemTrackingInterfaces.WorkItemRelationType[]) => void): void; - /** - * Get a batch of work item revisions with the option of including deleted items - * - * @param {string} project - Project ID or project name - * @param {string[]} fields - A list of fields to return in work item revisions. Omit this parameter to get all reportable fields. - * @param {string[]} types - A list of types to filter the results to specific work item types. Omit this parameter to get work item revisions of all work item types. - * @param {string} continuationToken - Specifies the watermark to start the batch from. Omit this parameter to get the first batch of revisions. - * @param {Date} startDateTime - Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter. - * @param {boolean} includeIdentityRef - Return an identity reference instead of a string value for identity fields. - * @param {boolean} includeDeleted - Specify if the deleted item should be returned. - * @param {boolean} includeTagRef - Specify if the tag objects should be returned for System.Tags field. - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.ReportingWorkItemRevisionsBatch - */ - readReportingRevisionsGet(project: string, fields: string[], types: string[], continuationToken: string, startDateTime: Date, includeIdentityRef: boolean, includeDeleted: boolean, includeTagRef: boolean, onResult: (err: any, statusCode: number, workItemRevision: WorkItemTrackingInterfaces.ReportingWorkItemRevisionsBatch) => void): void; - /** - * Get a batch of work item revisions - * - * @param {WorkItemTrackingInterfaces.ReportingWorkItemRevisionsFilter} filter - An object that contains request settings: field filter, type filter, identity format - * @param {string} project - Project ID or project name - * @param {string} continuationToken - Specifies the watermark to start the batch from. Omit this parameter to get the first batch of revisions. - * @param {Date} startDateTime - Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter. - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.ReportingWorkItemRevisionsBatch - */ - readReportingRevisionsPost(filter: WorkItemTrackingInterfaces.ReportingWorkItemRevisionsFilter, project: string, continuationToken: string, startDateTime: Date, onResult: (err: any, statusCode: number, workItemRevision: WorkItemTrackingInterfaces.ReportingWorkItemRevisionsBatch) => void): void; - /** - * @param {number} id - * @param {boolean} destroy - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItemDelete - */ - deleteWorkItem(id: number, destroy: boolean, onResult: (err: any, statusCode: number, workItem: WorkItemTrackingInterfaces.WorkItemDelete) => void): void; - /** - * Returns a single work item - * - * @param {number} id - * @param {string[]} fields - * @param {Date} asOf - * @param {WorkItemTrackingInterfaces.WorkItemExpand} expand - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItem - */ - getWorkItem(id: number, fields: string[], asOf: Date, expand: WorkItemTrackingInterfaces.WorkItemExpand, onResult: (err: any, statusCode: number, workItem: WorkItemTrackingInterfaces.WorkItem) => void): void; - /** - * Returns a list of work items - * - * @param {number[]} ids - * @param {string[]} fields - * @param {Date} asOf - * @param {WorkItemTrackingInterfaces.WorkItemExpand} expand - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItem[] - */ - getWorkItems(ids: number[], fields: string[], asOf: Date, expand: WorkItemTrackingInterfaces.WorkItemExpand, onResult: (err: any, statusCode: number, workItems: WorkItemTrackingInterfaces.WorkItem[]) => void): void; - /** - * @param {VSSInterfaces.JsonPatchDocument} document - * @param {number} id - * @param {boolean} validateOnly - * @param {boolean} bypassRules - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItem - */ - updateWorkItem(customHeaders: VsoBaseInterfaces.IHeaders, document: VSSInterfaces.JsonPatchDocument, id: number, validateOnly: boolean, bypassRules: boolean, onResult: (err: any, statusCode: number, workItem: WorkItemTrackingInterfaces.WorkItem) => void): void; - /** - * @param {VSSInterfaces.JsonPatchDocument} document - * @param {string} project - Project ID or project name - * @param {string} type - * @param {boolean} validateOnly - * @param {boolean} bypassRules - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItem - */ - createWorkItem(customHeaders: VsoBaseInterfaces.IHeaders, document: VSSInterfaces.JsonPatchDocument, project: string, type: string, validateOnly: boolean, bypassRules: boolean, onResult: (err: any, statusCode: number, workItem: WorkItemTrackingInterfaces.WorkItem) => void): void; - /** - * Returns a single work item from a template - * - * @param {string} project - Project ID or project name - * @param {string} type - * @param {string} fields - * @param {Date} asOf - * @param {WorkItemTrackingInterfaces.WorkItemExpand} expand - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItem - */ - getWorkItemTemplate(project: string, type: string, fields: string, asOf: Date, expand: WorkItemTrackingInterfaces.WorkItemExpand, onResult: (err: any, statusCode: number, workItem: WorkItemTrackingInterfaces.WorkItem) => void): void; - /** - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItemTypeCategory[] - */ - getWorkItemTypeCategories(project: string, onResult: (err: any, statusCode: number, workItemTypeCategories: WorkItemTrackingInterfaces.WorkItemTypeCategory[]) => void): void; - /** - * Returns a the deltas between work item revisions - * - * @param {string} project - Project ID or project name - * @param {string} category - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItemTypeCategory - */ - getWorkItemTypeCategory(project: string, category: string, onResult: (err: any, statusCode: number, workItemTypeCategorie: WorkItemTrackingInterfaces.WorkItemTypeCategory) => void): void; - /** - * Returns a the deltas between work item revisions - * - * @param {string} project - Project ID or project name - * @param {string} type - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItemType - */ - getWorkItemType(project: string, type: string, onResult: (err: any, statusCode: number, workItemType: WorkItemTrackingInterfaces.WorkItemType) => void): void; - /** - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItemType[] - */ - getWorkItemTypes(project: string, onResult: (err: any, statusCode: number, workItemTypes: WorkItemTrackingInterfaces.WorkItemType[]) => void): void; - /** - * Returns the dependent fields for the corresponding workitem type and fieldname - * - * @param {string} project - Project ID or project name - * @param {string} type - * @param {string} field - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.FieldDependentRule - */ - getDependentFields(project: string, type: string, field: string, onResult: (err: any, statusCode: number, workItemTypesField: WorkItemTrackingInterfaces.FieldDependentRule) => void): void; - /** - * Export work item type - * - * @param {string} project - Project ID or project name - * @param {string} type - * @param {boolean} exportGlobalLists - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.WorkItemTypeTemplate - */ - exportWorkItemTypeDefinition(project: string, type: string, exportGlobalLists: boolean, onResult: (err: any, statusCode: number, workItemTypeTemplate: WorkItemTrackingInterfaces.WorkItemTypeTemplate) => void): void; - /** - * Add/updates a work item type - * - * @param {WorkItemTrackingInterfaces.WorkItemTypeTemplateUpdateModel} updateModel - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting WorkItemTrackingInterfaces.ProvisioningResult - */ - updateWorkItemTypeDefinition(updateModel: WorkItemTrackingInterfaces.WorkItemTypeTemplateUpdateModel, project: string, onResult: (err: any, statusCode: number, workItemTypeTemplate: WorkItemTrackingInterfaces.ProvisioningResult) => void): void; - } - export class QWorkItemTrackingApi extends basem.QClientApiBase implements IQWorkItemTrackingApi { - api: WorkItemTrackingApi; - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]); - /** - * Creates an attachment. - * - * @param {NodeJS.ReadableStream} contentStream - Content to upload - * @param {string} fileName - * @param {string} uploadType - */ - createAttachment(customHeaders: any, contentStream: NodeJS.ReadableStream, fileName?: string, uploadType?: string): Q.Promise; - /** - * Returns an attachment - * - * @param {string} id - * @param {string} fileName - */ - getAttachmentContent(id: string, fileName?: string): Q.Promise; - /** - * Returns an attachment - * - * @param {string} id - * @param {string} fileName - */ - getAttachmentZip(id: string, fileName?: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} depth - */ - getRootNodes(project: string, depth?: number): Q.Promise; - /** - * @param {WorkItemTrackingInterfaces.WorkItemClassificationNode} postedNode - * @param {string} project - Project ID or project name - * @param {WorkItemTrackingInterfaces.TreeStructureGroup} structureGroup - * @param {string} path - */ - createOrUpdateClassificationNode(postedNode: WorkItemTrackingInterfaces.WorkItemClassificationNode, project: string, structureGroup: WorkItemTrackingInterfaces.TreeStructureGroup, path?: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {WorkItemTrackingInterfaces.TreeStructureGroup} structureGroup - * @param {string} path - * @param {number} reclassifyId - */ - deleteClassificationNode(project: string, structureGroup: WorkItemTrackingInterfaces.TreeStructureGroup, path?: string, reclassifyId?: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {WorkItemTrackingInterfaces.TreeStructureGroup} structureGroup - * @param {string} path - * @param {number} depth - */ - getClassificationNode(project: string, structureGroup: WorkItemTrackingInterfaces.TreeStructureGroup, path?: string, depth?: number): Q.Promise; - /** - * @param {WorkItemTrackingInterfaces.WorkItemClassificationNode} postedNode - * @param {string} project - Project ID or project name - * @param {WorkItemTrackingInterfaces.TreeStructureGroup} structureGroup - * @param {string} path - */ - updateClassificationNode(postedNode: WorkItemTrackingInterfaces.WorkItemClassificationNode, project: string, structureGroup: WorkItemTrackingInterfaces.TreeStructureGroup, path?: string): Q.Promise; - /** - * @param {string} field - */ - getField(field: string): Q.Promise; - /** - */ - getFields(): Q.Promise; - /** - * Returns history of all revision for a given work item ID - * - * @param {number} id - * @param {number} top - * @param {number} skip - */ - getHistory(id: number, top?: number, skip?: number): Q.Promise; - /** - * Returns the history value of particular revision - * - * @param {number} id - * @param {number} revisionNumber - */ - getHistoryById(id: number, revisionNumber: number): Q.Promise; - /** - * Creates a query, or moves a query. - * - * @param {WorkItemTrackingInterfaces.QueryHierarchyItem} postedQuery - The query to create. - * @param {string} project - Project ID or project name - * @param {string} query - The parent path for the query to create. - */ - createQuery(postedQuery: WorkItemTrackingInterfaces.QueryHierarchyItem, project: string, query: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {string} query - */ - deleteQuery(project: string, query: string): Q.Promise; - /** - * Retrieves all queries the user has access to in the current project - * - * @param {string} project - Project ID or project name - * @param {WorkItemTrackingInterfaces.QueryExpand} expand - * @param {number} depth - * @param {boolean} includeDeleted - */ - getQueries(project: string, expand?: WorkItemTrackingInterfaces.QueryExpand, depth?: number, includeDeleted?: boolean): Q.Promise; - /** - * Retrieves a single query by project and either id or path - * - * @param {string} project - Project ID or project name - * @param {string} query - * @param {WorkItemTrackingInterfaces.QueryExpand} expand - * @param {number} depth - * @param {boolean} includeDeleted - */ - getQuery(project: string, query: string, expand?: WorkItemTrackingInterfaces.QueryExpand, depth?: number, includeDeleted?: boolean): Q.Promise; - /** - * @param {WorkItemTrackingInterfaces.QueryHierarchyItem} queryUpdate - * @param {string} project - Project ID or project name - * @param {string} query - * @param {boolean} undeleteDescendants - */ - updateQuery(queryUpdate: WorkItemTrackingInterfaces.QueryHierarchyItem, project: string, query: string, undeleteDescendants?: boolean): Q.Promise; - /** - * @param {number} id - * @param {string} project - Project ID or project name - */ - destroyWorkItem(id: number, project?: string): Q.Promise; - /** - * @param {number} id - * @param {string} project - Project ID or project name - */ - getDeletedWorkItem(id: number, project?: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number[]} ids - */ - getDeletedWorkItems(project?: string, ids?: number[]): Q.Promise; - /** - * @param {WorkItemTrackingInterfaces.WorkItemDeleteUpdate} payload - * @param {number} id - * @param {string} project - Project ID or project name - */ - restoreWorkItem(payload: WorkItemTrackingInterfaces.WorkItemDeleteUpdate, id: number, project?: string): Q.Promise; - /** - * Returns a fully hydrated work item for the requested revision - * - * @param {number} id - * @param {number} revisionNumber - * @param {WorkItemTrackingInterfaces.WorkItemExpand} expand - */ - getRevision(id: number, revisionNumber: number, expand?: WorkItemTrackingInterfaces.WorkItemExpand): Q.Promise; - /** - * Returns the list of fully hydrated work item revisions, paged. - * - * @param {number} id - * @param {number} top - * @param {number} skip - * @param {WorkItemTrackingInterfaces.WorkItemExpand} expand - */ - getRevisions(id: number, top?: number, skip?: number, expand?: WorkItemTrackingInterfaces.WorkItemExpand): Q.Promise; - /** - * Validates the fields values. - * - * @param {WorkItemTrackingInterfaces.FieldsToEvaluate} ruleEngineInput - */ - evaluateRulesOnField(ruleEngineInput: WorkItemTrackingInterfaces.FieldsToEvaluate): Q.Promise; - /** - * Returns a single update for a work item - * - * @param {number} id - * @param {number} updateNumber - */ - getUpdate(id: number, updateNumber: number): Q.Promise; - /** - * Returns a the deltas between work item revisions - * - * @param {number} id - * @param {number} top - * @param {number} skip - */ - getUpdates(id: number, top?: number, skip?: number): Q.Promise; - /** - * Gets the results of the query. - * - * @param {WorkItemTrackingInterfaces.Wiql} wiql - The query containing the wiql. - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {boolean} timePrecision - */ - queryByWiql(wiql: WorkItemTrackingInterfaces.Wiql, teamContext?: TfsCoreInterfaces.TeamContext, timePrecision?: boolean): Q.Promise; - /** - * Gets the results of the query by id. - * - * @param {string} id - The query id. - * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation - * @param {boolean} timePrecision - */ - queryById(id: string, teamContext?: TfsCoreInterfaces.TeamContext, timePrecision?: boolean): Q.Promise; - /** - * Get a batch of work item links - * - * @param {string} project - Project ID or project name - * @param {string[]} types - A list of types to filter the results to specific work item types. Omit this parameter to get work item links of all work item types. - * @param {string} continuationToken - Specifies the continuationToken to start the batch from. Omit this parameter to get the first batch of links. - * @param {Date} startDateTime - Date/time to use as a starting point for link changes. Only link changes that occurred after that date/time will be returned. Cannot be used in conjunction with 'watermark' parameter. - */ - getReportingLinks(project?: string, types?: string[], continuationToken?: string, startDateTime?: Date): Q.Promise; - /** - * Gets the work item relation types. - * - * @param {string} relation - */ - getRelationType(relation: string): Q.Promise; - /** - */ - getRelationTypes(): Q.Promise; - /** - * Get a batch of work item revisions with the option of including deleted items - * - * @param {string} project - Project ID or project name - * @param {string[]} fields - A list of fields to return in work item revisions. Omit this parameter to get all reportable fields. - * @param {string[]} types - A list of types to filter the results to specific work item types. Omit this parameter to get work item revisions of all work item types. - * @param {string} continuationToken - Specifies the watermark to start the batch from. Omit this parameter to get the first batch of revisions. - * @param {Date} startDateTime - Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter. - * @param {boolean} includeIdentityRef - Return an identity reference instead of a string value for identity fields. - * @param {boolean} includeDeleted - Specify if the deleted item should be returned. - * @param {boolean} includeTagRef - Specify if the tag objects should be returned for System.Tags field. - */ - readReportingRevisionsGet(project?: string, fields?: string[], types?: string[], continuationToken?: string, startDateTime?: Date, includeIdentityRef?: boolean, includeDeleted?: boolean, includeTagRef?: boolean): Q.Promise; - /** - * Get a batch of work item revisions - * - * @param {WorkItemTrackingInterfaces.ReportingWorkItemRevisionsFilter} filter - An object that contains request settings: field filter, type filter, identity format - * @param {string} project - Project ID or project name - * @param {string} continuationToken - Specifies the watermark to start the batch from. Omit this parameter to get the first batch of revisions. - * @param {Date} startDateTime - Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter. - */ - readReportingRevisionsPost(filter: WorkItemTrackingInterfaces.ReportingWorkItemRevisionsFilter, project?: string, continuationToken?: string, startDateTime?: Date): Q.Promise; - /** - * @param {number} id - * @param {boolean} destroy - */ - deleteWorkItem(id: number, destroy?: boolean): Q.Promise; - /** - * Returns a single work item - * - * @param {number} id - * @param {string[]} fields - * @param {Date} asOf - * @param {WorkItemTrackingInterfaces.WorkItemExpand} expand - */ - getWorkItem(id: number, fields?: string[], asOf?: Date, expand?: WorkItemTrackingInterfaces.WorkItemExpand): Q.Promise; - /** - * Returns a list of work items - * - * @param {number[]} ids - * @param {string[]} fields - * @param {Date} asOf - * @param {WorkItemTrackingInterfaces.WorkItemExpand} expand - */ - getWorkItems(ids: number[], fields?: string[], asOf?: Date, expand?: WorkItemTrackingInterfaces.WorkItemExpand): Q.Promise; - /** - * @param {VSSInterfaces.JsonPatchDocument} document - * @param {number} id - * @param {boolean} validateOnly - * @param {boolean} bypassRules - */ - updateWorkItem(customHeaders: any, document: VSSInterfaces.JsonPatchDocument, id: number, validateOnly?: boolean, bypassRules?: boolean): Q.Promise; - /** - * @param {VSSInterfaces.JsonPatchDocument} document - * @param {string} project - Project ID or project name - * @param {string} type - * @param {boolean} validateOnly - * @param {boolean} bypassRules - */ - createWorkItem(customHeaders: any, document: VSSInterfaces.JsonPatchDocument, project: string, type: string, validateOnly?: boolean, bypassRules?: boolean): Q.Promise; - /** - * Returns a single work item from a template - * - * @param {string} project - Project ID or project name - * @param {string} type - * @param {string} fields - * @param {Date} asOf - * @param {WorkItemTrackingInterfaces.WorkItemExpand} expand - */ - getWorkItemTemplate(project: string, type: string, fields?: string, asOf?: Date, expand?: WorkItemTrackingInterfaces.WorkItemExpand): Q.Promise; - /** - * @param {string} project - Project ID or project name - */ - getWorkItemTypeCategories(project: string): Q.Promise; - /** - * Returns a the deltas between work item revisions - * - * @param {string} project - Project ID or project name - * @param {string} category - */ - getWorkItemTypeCategory(project: string, category: string): Q.Promise; - /** - * Returns a the deltas between work item revisions - * - * @param {string} project - Project ID or project name - * @param {string} type - */ - getWorkItemType(project: string, type: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - */ - getWorkItemTypes(project: string): Q.Promise; - /** - * Returns the dependent fields for the corresponding workitem type and fieldname - * - * @param {string} project - Project ID or project name - * @param {string} type - * @param {string} field - */ - getDependentFields(project: string, type: string, field: string): Q.Promise; - /** - * Export work item type - * - * @param {string} project - Project ID or project name - * @param {string} type - * @param {boolean} exportGlobalLists - */ - exportWorkItemTypeDefinition(project?: string, type?: string, exportGlobalLists?: boolean): Q.Promise; - /** - * Add/updates a work item type - * - * @param {WorkItemTrackingInterfaces.WorkItemTypeTemplateUpdateModel} updateModel - * @param {string} project - Project ID or project name - */ - updateWorkItemTypeDefinition(updateModel: WorkItemTrackingInterfaces.WorkItemTypeTemplateUpdateModel, project?: string): Q.Promise; - } - -} -declare module 'vso-node-api/interfaces/ReleaseInterfaces' { - import FormInputInterfaces = require('vso-node-api/interfaces/common/FormInputInterfaces'); - import VSSInterfaces = require('vso-node-api/interfaces/common/VSSInterfaces'); - export interface AgentArtifactDefinition { - alias: string; - artifactType: AgentArtifactType; - details: string; - name: string; - version: string; - } - export enum AgentArtifactType { - XamlBuild = 0, - Build = 1, - Jenkins = 2, - FileShare = 3, - Nuget = 4, - TfsOnPrem = 5, - GitHub = 6, - TFGit = 7, - ExternalTfsBuild = 8, - } - export interface ApprovalOptions { - releaseCreatorCanBeApprover: boolean; - requiredApproverCount: number; - } - export interface ApprovalPendingEvent { - } - export enum ApprovalStatus { - Undefined = 0, - Pending = 1, - Approved = 2, - Rejected = 4, - Reassigned = 6, - Canceled = 7, - Skipped = 8, - } - export enum ApprovalType { - Undefined = 0, - PreDeploy = 1, - PostDeploy = 2, - } - export interface Artifact { - alias: string; - definitionReference: { - [key: string]: ArtifactSourceReference; - }; - id: number; - isPrimary: boolean; - type: string; - } - export interface ArtifactInstanceData { - accountName: string; - authenticationToken: string; - tfsUrl: string; - version: string; - } - export interface ArtifactMetadata { - alias: string; - instanceReference: BuildVersion; - } - export interface ArtifactProvider { - id: number; - name: string; - sourceUri: string; - version: string; - } - export interface ArtifactSourceId { - artifactTypeId: string; - sourceIdInputs: SourceIdInput[]; - } - export interface ArtifactSourceIdsQueryResult { - artifactSourceIds: ArtifactSourceId[]; - } - export interface ArtifactSourceReference { - id: string; - name: string; - } - export interface ArtifactTypeDefinition { - inputDescriptors: FormInputInterfaces.InputDescriptor[]; - name: string; - } - export interface ArtifactVersion { - artifactSourceId: number; - errorMessage: string; - versions: BuildVersion[]; - } - export interface ArtifactVersionQueryResult { - artifactVersions: ArtifactVersion[]; - } - export enum AuditAction { - Add = 1, - Update = 2, - Delete = 3, - } - export interface BuildVersion { - id: string; - name: string; - sourceBranch: string; - } - /** - * Represents a change associated with a build. - */ - export interface Change { - /** - * The author of the change. - */ - author: VSSInterfaces.IdentityRef; - /** - * The type of change. "commit", "changeset", etc. - */ - changeType: string; - /** - * The location of a user-friendly representation of the resource. - */ - displayUri: string; - /** - * Something that identifies the change. For a commit, this would be the SHA1. For a TFVC changeset, this would be the changeset id. - */ - id: string; - /** - * The location of the full representation of the resource. - */ - location: string; - /** - * A description of the change. This might be a commit message or changeset description. - */ - message: string; - /** - * A timestamp for the change. - */ - timestamp: Date; - } - export interface Condition { - conditionType: ConditionType; - name: string; - value: string; - } - export enum ConditionType { - Undefined = 0, - Event = 1, - EnvironmentState = 2, - } - export interface ConfigurationVariableValue { - isSecret: boolean; - value: string; - } - export interface Consumer { - consumerId: number; - consumerName: string; - } - export interface DeploymentAttempt { - attempt: number; - /** - * Error log to show any unexpected error that occurred during executing deploy step - */ - errorLog: string; - id: number; - job: ReleaseTask; - runPlanId: string; - tasks: ReleaseTask[]; - } - /** - * Defines policy on environment queuing at Release Management side queue. We will send to Environment Runner [creating pre-deploy and other steps] only when the policies mentioned are satisfied. - */ - export interface EnvironmentExecutionPolicy { - /** - * This policy decides, how many environments would be with Environment Runner. - */ - concurrencyCount: number; - /** - * Queue depth in the EnvironmentQueue table, this table keeps the environment entries till Environment Runner is free [as per it's policy] to take another environment for running. - */ - queueDepthCount: number; - } - export enum EnvironmentStatus { - Undefined = 0, - NotStarted = 1, - Pending = 2, - Succeeded = 3, - Rejected = 4, - InProgress = 5, - Canceled = 6, - Queued = 7, - } - export interface Issue { - issueType: string; - message: string; - } - export interface RealtimeReleaseEvent { - projectId: string; - releaseId: number; - } - export interface Release { - artifacts: Artifact[]; - createdBy: VSSInterfaces.IdentityRef; - createdOn: Date; - description: string; - environments: ReleaseEnvironment[]; - id: number; - keepForever: boolean; - modifiedBy: VSSInterfaces.IdentityRef; - modifiedOn: Date; - name: string; - poolName: string; - reason: ReleaseReason; - releaseDefinition: ShallowReference; - releaseNameFormat: string; - status: ReleaseStatus; - variables: { - [key: string]: ConfigurationVariableValue; - }; - } - export interface ReleaseApproval { - approvalType: ApprovalType; - approvedBy: VSSInterfaces.IdentityRef; - approver: VSSInterfaces.IdentityRef; - attempt: number; - comments: string; - createdOn: Date; - history: ReleaseApprovalHistory[]; - id: number; - isAutomated: boolean; - isNotificationOn: boolean; - modifiedOn: Date; - rank: number; - release: ShallowReference; - releaseDefinition: ShallowReference; - releaseEnvironment: ShallowReference; - revision: number; - status: ApprovalStatus; - trialNumber: number; - } - export interface ReleaseApprovalHistory { - approver: VSSInterfaces.IdentityRef; - changedBy: VSSInterfaces.IdentityRef; - comments: string; - createdOn: Date; - modifiedOn: Date; - revision: number; - } - export interface ReleaseArtifact { - artifactProvider: ArtifactProvider; - artifactType: string; - definitionData: string; - definitionId: number; - description: string; - id: number; - name: string; - releaseId: number; - } - export interface ReleaseDefinition { - artifacts: Artifact[]; - createdBy: VSSInterfaces.IdentityRef; - createdOn: Date; - environments: ReleaseDefinitionEnvironment[]; - id: number; - modifiedBy: VSSInterfaces.IdentityRef; - modifiedOn: Date; - name: string; - releaseNameFormat: string; - retentionPolicy: RetentionPolicy; - revision: number; - triggers: ReleaseTrigger[]; - variables: { - [key: string]: ConfigurationVariableValue; - }; - } - export interface ReleaseDefinitionApprovals { - approvalOptions: ApprovalOptions; - approvals: ReleaseDefinitionApprovalStep[]; - } - export interface ReleaseDefinitionApprovalStep extends ReleaseDefinitionEnvironmentStep { - approver: VSSInterfaces.IdentityRef; - isAutomated: boolean; - isNotificationOn: boolean; - rank: number; - } - export interface ReleaseDefinitionDeployStep extends ReleaseDefinitionEnvironmentStep { - /** - * The list of steps for this definition. - */ - tasks: WorkflowTask[]; - } - export interface ReleaseDefinitionEnvironment { - conditions: Condition[]; - demands: any[]; - deployStep: ReleaseDefinitionDeployStep; - executionPolicy: EnvironmentExecutionPolicy; - id: number; - name: string; - owner: VSSInterfaces.IdentityRef; - postDeployApprovals: ReleaseDefinitionApprovals; - preDeployApprovals: ReleaseDefinitionApprovals; - queueId: number; - rank: number; - runOptions: { - [key: string]: string; - }; - variables: { - [key: string]: ConfigurationVariableValue; - }; - } - export interface ReleaseDefinitionEnvironmentStep { - id: number; - } - export interface ReleaseDefinitionEnvironmentSummary { - id: number; - lastReleases: ShallowReference[]; - name: string; - } - export interface ReleaseDefinitionEnvironmentTemplate { - canDelete: boolean; - category: string; - description: string; - environment: ReleaseDefinitionEnvironment; - iconTaskId: string; - id: string; - name: string; - } - export enum ReleaseDefinitionExpands { - None = 0, - Environments = 2, - Artifacts = 4, - } - export interface ReleaseDefinitionRevision { - changedBy: VSSInterfaces.IdentityRef; - changedDate: Date; - changeType: AuditAction; - definitionId: number; - definitionUrl: string; - revision: number; - } - export interface ReleaseDefinitionSummary { - environments: ReleaseDefinitionEnvironmentSummary[]; - releaseDefinition: ShallowReference; - releases: Release[]; - } - export interface ReleaseEnvironment { - conditions: Condition[]; - createdOn: Date; - definitionEnvironmentId: number; - demands: any[]; - deploySteps: DeploymentAttempt[]; - id: number; - modifiedOn: Date; - name: string; - owner: VSSInterfaces.IdentityRef; - postApprovalsSnapshot: ReleaseDefinitionApprovals; - postDeployApprovals: ReleaseApproval[]; - preApprovalsSnapshot: ReleaseDefinitionApprovals; - preDeployApprovals: ReleaseApproval[]; - queueId: number; - rank: number; - releaseId: number; - runOptions: { - [key: string]: string; - }; - scheduledDeploymentTime: Date; - status: EnvironmentStatus; - variables: { - [key: string]: ConfigurationVariableValue; - }; - workflowTasks: WorkflowTask[]; - } - export interface ReleaseEnvironmentCompletedEvent { - createdByName: string; - definitionName: string; - environment: ReleaseEnvironment; - projectName: string; - releaseCreatedBy: VSSInterfaces.IdentityRef; - releaseLogsUri: string; - releaseName: string; - status: string; - title: string; - webAccessUri: string; - } - export enum ReleaseExpands { - None = 0, - Environments = 2, - Artifacts = 4, - Approvals = 8, - } - export enum ReleaseQueryOrder { - Descending = 0, - Ascending = 1, - } - export enum ReleaseReason { - None = 0, - Manual = 1, - ContinuousIntegration = 2, - Schedule = 3, - } - export interface ReleaseSchedule { - /** - * Days of the week to release - */ - daysToRelease: ScheduleDays; - /** - * Team Foundation Job Definition Job Id - */ - jobId: string; - /** - * Local time zone hour to start - */ - startHours: number; - /** - * Local time zone minute to start - */ - startMinutes: number; - /** - * Time zone Id of release schedule, such as 'UTC' - */ - timeZoneId: string; - } - export interface ReleaseStartMetadata { - artifacts: ArtifactMetadata[]; - definitionId: number; - description: string; - isDraft: boolean; - reason: ReleaseReason; - } - export enum ReleaseStatus { - Undefined = 0, - Draft = 1, - Abandoned = 2, - Active = 3, - } - export interface ReleaseTask { - agentName: string; - dateEnded: Date; - dateStarted: Date; - id: number; - issues: Issue[]; - lineCount: number; - name: string; - rank: number; - status: TaskStatus; - timelineRecordId: string; - } - export interface ReleaseTaskLogUpdatedEvent extends RealtimeReleaseEvent { - environmentId: number; - lines: string[]; - timelineRecordId: string; - } - export interface ReleaseTasksUpdatedEvent extends RealtimeReleaseEvent { - environmentId: number; - job: ReleaseTask; - releaseStepId: number; - tasks: ReleaseTask[]; - } - export interface ReleaseTrigger { - /** - * Artifact source alias for ArtifactSource trigger type - value is null for all other trigger types - */ - artifactAlias: string; - /** - * Release schedule for Schedule trigger type - value is null for all other trigger types - */ - schedule: ReleaseSchedule; - triggerType: ReleaseTriggerType; - } - export enum ReleaseTriggerType { - Undefined = 0, - ArtifactSource = 1, - Schedule = 2, - } - export interface ReleaseUpdatedEvent extends RealtimeReleaseEvent { - release: Release; - } - export interface ReleaseUpdateMetadata { - keepForever: boolean; - status: ReleaseStatus; - } - export interface ReleaseWorkItemRef { - id: string; - url: string; - } - export interface RetentionPolicy { - daysToKeep: number; - } - export enum ScheduleDays { - None = 0, - Monday = 1, - Tuesday = 2, - Wednesday = 4, - Thursday = 8, - Friday = 16, - Saturday = 32, - Sunday = 64, - All = 127, - } - export interface ShallowReference { - id: number; - name: string; - url: string; - } - export interface SourceIdInput { - id: string; - name: string; - } - export enum TaskStatus { - Unknown = 0, - Pending = 1, - InProgress = 2, - Success = 3, - Failure = 4, - Canceled = 5, - Skipped = 6, - } - export interface TimeZone { - displayName: string; - id: string; - } - export interface TimeZoneList { - utcTimeZone: TimeZone; - validTimeZones: TimeZone[]; - } - export interface WorkflowTask { - alwaysRun: boolean; - continueOnError: boolean; - enabled: boolean; - inputs: { - [key: string]: string; - }; - name: string; - taskId: string; - version: string; - } - export var TypeInfo: { - AgentArtifactDefinition: { - fields: any; - }; - AgentArtifactType: { - enumValues: { - "xamlBuild": number; - "build": number; - "jenkins": number; - "fileShare": number; - "nuget": number; - "tfsOnPrem": number; - "gitHub": number; - "tFGit": number; - "externalTfsBuild": number; - }; - }; - ApprovalOptions: { - fields: any; - }; - ApprovalPendingEvent: { - fields: any; - }; - ApprovalStatus: { - enumValues: { - "undefined": number; - "pending": number; - "approved": number; - "rejected": number; - "reassigned": number; - "canceled": number; - "skipped": number; - }; - }; - ApprovalType: { - enumValues: { - "undefined": number; - "preDeploy": number; - "postDeploy": number; - }; - }; - Artifact: { - fields: any; - }; - ArtifactInstanceData: { - fields: any; - }; - ArtifactMetadata: { - fields: any; - }; - ArtifactProvider: { - fields: any; - }; - ArtifactSourceId: { - fields: any; - }; - ArtifactSourceIdsQueryResult: { - fields: any; - }; - ArtifactSourceReference: { - fields: any; - }; - ArtifactTypeDefinition: { - fields: any; - }; - ArtifactVersion: { - fields: any; - }; - ArtifactVersionQueryResult: { - fields: any; - }; - AuditAction: { - enumValues: { - "add": number; - "update": number; - "delete": number; - }; - }; - BuildVersion: { - fields: any; - }; - Change: { - fields: any; - }; - Condition: { - fields: any; - }; - ConditionType: { - enumValues: { - "undefined": number; - "event": number; - "environmentState": number; - }; - }; - ConfigurationVariableValue: { - fields: any; - }; - Consumer: { - fields: any; - }; - DeploymentAttempt: { - fields: any; - }; - EnvironmentExecutionPolicy: { - fields: any; - }; - EnvironmentStatus: { - enumValues: { - "undefined": number; - "notStarted": number; - "pending": number; - "succeeded": number; - "rejected": number; - "inProgress": number; - "canceled": number; - "queued": number; - }; - }; - Issue: { - fields: any; - }; - RealtimeReleaseEvent: { - fields: any; - }; - Release: { - fields: any; - }; - ReleaseApproval: { - fields: any; - }; - ReleaseApprovalHistory: { - fields: any; - }; - ReleaseArtifact: { - fields: any; - }; - ReleaseDefinition: { - fields: any; - }; - ReleaseDefinitionApprovals: { - fields: any; - }; - ReleaseDefinitionApprovalStep: { - fields: any; - }; - ReleaseDefinitionDeployStep: { - fields: any; - }; - ReleaseDefinitionEnvironment: { - fields: any; - }; - ReleaseDefinitionEnvironmentStep: { - fields: any; - }; - ReleaseDefinitionEnvironmentSummary: { - fields: any; - }; - ReleaseDefinitionEnvironmentTemplate: { - fields: any; - }; - ReleaseDefinitionExpands: { - enumValues: { - "none": number; - "environments": number; - "artifacts": number; - }; - }; - ReleaseDefinitionRevision: { - fields: any; - }; - ReleaseDefinitionSummary: { - fields: any; - }; - ReleaseEnvironment: { - fields: any; - }; - ReleaseEnvironmentCompletedEvent: { - fields: any; - }; - ReleaseExpands: { - enumValues: { - "none": number; - "environments": number; - "artifacts": number; - "approvals": number; - }; - }; - ReleaseQueryOrder: { - enumValues: { - "descending": number; - "ascending": number; - }; - }; - ReleaseReason: { - enumValues: { - "none": number; - "manual": number; - "continuousIntegration": number; - "schedule": number; - }; - }; - ReleaseSchedule: { - fields: any; - }; - ReleaseStartMetadata: { - fields: any; - }; - ReleaseStatus: { - enumValues: { - "undefined": number; - "draft": number; - "abandoned": number; - "active": number; - }; - }; - ReleaseTask: { - fields: any; - }; - ReleaseTaskLogUpdatedEvent: { - fields: any; - }; - ReleaseTasksUpdatedEvent: { - fields: any; - }; - ReleaseTrigger: { - fields: any; - }; - ReleaseTriggerType: { - enumValues: { - "undefined": number; - "artifactSource": number; - "schedule": number; - }; - }; - ReleaseUpdatedEvent: { - fields: any; - }; - ReleaseUpdateMetadata: { - fields: any; - }; - ReleaseWorkItemRef: { - fields: any; - }; - RetentionPolicy: { - fields: any; - }; - ScheduleDays: { - enumValues: { - "none": number; - "monday": number; - "tuesday": number; - "wednesday": number; - "thursday": number; - "friday": number; - "saturday": number; - "sunday": number; - "all": number; - }; - }; - ShallowReference: { - fields: any; - }; - SourceIdInput: { - fields: any; - }; - TaskStatus: { - enumValues: { - "unknown": number; - "pending": number; - "inProgress": number; - "success": number; - "failure": number; - "canceled": number; - "skipped": number; - }; - }; - TimeZone: { - fields: any; - }; - TimeZoneList: { - fields: any; - }; - WorkflowTask: { - fields: any; - }; - }; - -} -declare module 'vso-node-api/ReleaseApi' { - /// - /// - import Q = require('q'); - import basem = require('vso-node-api/ClientApiBases'); - import VsoBaseInterfaces = require('vso-node-api/interfaces/common/VsoBaseInterfaces'); - import FormInputInterfaces = require('vso-node-api/interfaces/common/FormInputInterfaces'); - import ReleaseInterfaces = require('vso-node-api/interfaces/ReleaseInterfaces'); - export interface IReleaseApi extends basem.ClientApiBase { - getAgentArtifactDefinitions(project: string, releaseId: number, onResult: (err: any, statusCode: number, agentartifacts: ReleaseInterfaces.AgentArtifactDefinition[]) => void): void; - getApprovals(project: string, assignedToFilter: string, statusFilter: ReleaseInterfaces.ApprovalStatus, releaseIdsFilter: number[], onResult: (err: any, statusCode: number, approvals: ReleaseInterfaces.ReleaseApproval[]) => void): void; - getApprovalHistory(project: string, approvalStepId: number, onResult: (err: any, statusCode: number, approval: ReleaseInterfaces.ReleaseApproval) => void): void; - updateReleaseApproval(approval: ReleaseInterfaces.ReleaseApproval, project: string, approvalId: number, onResult: (err: any, statusCode: number, approval: ReleaseInterfaces.ReleaseApproval) => void): void; - getReleaseChanges(project: string, releaseId: number, baseReleaseId: number, top: number, onResult: (err: any, statusCode: number, changes: ReleaseInterfaces.Change[]) => void): void; - createReleaseDefinition(releaseDefinition: ReleaseInterfaces.ReleaseDefinition, project: string, onResult: (err: any, statusCode: number, definition: ReleaseInterfaces.ReleaseDefinition) => void): void; - deleteReleaseDefinition(project: string, definitionId: number, onResult: (err: any, statusCode: number) => void): void; - getReleaseDefinition(project: string, definitionId: number, onResult: (err: any, statusCode: number, definition: ReleaseInterfaces.ReleaseDefinition) => void): void; - getReleaseDefinitions(project: string, searchText: string, artifactIdFilter: number, expand: ReleaseInterfaces.ReleaseDefinitionExpands, onResult: (err: any, statusCode: number, definitions: ReleaseInterfaces.ReleaseDefinition[]) => void): void; - getReleaseDefinitionsForArtifactSource(project: string, artifactType: string, artifactSourceId: string, expand: ReleaseInterfaces.ReleaseDefinitionExpands, onResult: (err: any, statusCode: number, definitions: ReleaseInterfaces.ReleaseDefinition[]) => void): void; - updateReleaseDefinition(releaseDefinition: ReleaseInterfaces.ReleaseDefinition, project: string, onResult: (err: any, statusCode: number, definition: ReleaseInterfaces.ReleaseDefinition) => void): void; - getReleaseEnvironment(project: string, releaseId: number, environmentId: number, onResult: (err: any, statusCode: number, environment: ReleaseInterfaces.ReleaseEnvironment) => void): void; - updateReleaseEnvironment(environmentUpdateData: any, project: string, releaseId: number, environmentId: number, onResult: (err: any, statusCode: number, environment: ReleaseInterfaces.ReleaseEnvironment) => void): void; - createDefinitionEnvironmentTemplate(template: ReleaseInterfaces.ReleaseDefinitionEnvironmentTemplate, project: string, onResult: (err: any, statusCode: number, environmenttemplate: ReleaseInterfaces.ReleaseDefinitionEnvironmentTemplate) => void): void; - deleteDefinitionEnvironmentTemplate(project: string, templateId: string, onResult: (err: any, statusCode: number) => void): void; - getDefinitionEnvironmentTemplate(project: string, templateId: string, onResult: (err: any, statusCode: number, environmenttemplate: ReleaseInterfaces.ReleaseDefinitionEnvironmentTemplate) => void): void; - listDefinitionEnvironmentTemplates(project: string, onResult: (err: any, statusCode: number, environmenttemplates: ReleaseInterfaces.ReleaseDefinitionEnvironmentTemplate[]) => void): void; - getInputValues(query: FormInputInterfaces.InputValuesQuery, project: string, onResult: (err: any, statusCode: number, inputvaluesquery: FormInputInterfaces.InputValuesQuery) => void): void; - getLogs(project: string, releaseId: number, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getLog(project: string, releaseId: number, environmentId: number, taskId: number, attemptId: number, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - createRelease(releaseStartMetadata: ReleaseInterfaces.ReleaseStartMetadata, project: string, onResult: (err: any, statusCode: number, release: ReleaseInterfaces.Release) => void): void; - deleteRelease(project: string, releaseId: number, onResult: (err: any, statusCode: number) => void): void; - getRelease(project: string, releaseId: number, includeAllApprovals: boolean, onResult: (err: any, statusCode: number, release: ReleaseInterfaces.Release) => void): void; - getReleaseDefinitionSummary(project: string, definitionId: number, releaseCount: number, includeArtifact: boolean, onResult: (err: any, statusCode: number, release: ReleaseInterfaces.ReleaseDefinitionSummary) => void): void; - getReleases(project: string, definitionId: number, definitionEnvironmentId: number, searchText: string, createdBy: string, statusFilter: ReleaseInterfaces.ReleaseStatus, minCreatedTime: Date, maxCreatedTime: Date, queryOrder: ReleaseInterfaces.ReleaseQueryOrder, top: number, continuationToken: number, expand: ReleaseInterfaces.ReleaseExpands, artifactTypeId: string, artifactSourceId: number, artifactVersionId: string, onResult: (err: any, statusCode: number, releases: ReleaseInterfaces.Release[]) => void): void; - updateRelease(release: ReleaseInterfaces.Release, project: string, releaseId: number, onResult: (err: any, statusCode: number, release: ReleaseInterfaces.Release) => void): void; - updateReleaseResource(releaseUpdateMetadata: ReleaseInterfaces.ReleaseUpdateMetadata, project: string, releaseId: number, onResult: (err: any, statusCode: number, release: ReleaseInterfaces.Release) => void): void; - getReleaseDefinitionHistory(project: string, definitionId: number, onResult: (err: any, statusCode: number, revisions: ReleaseInterfaces.ReleaseDefinitionRevision[]) => void): void; - getReleaseDefinitionRevision(project: string, definitionId: number, revision: number, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - getArtifactsSources(project: string, typeId: string, onResult: (err: any, statusCode: number, source: ReleaseInterfaces.ArtifactSourceIdsQueryResult) => void): void; - getTasks(project: string, releaseId: number, environmentId: number, attemptId: number, onResult: (err: any, statusCode: number, tasks: ReleaseInterfaces.ReleaseTask[]) => void): void; - getArtifactTypeDefinitions(project: string, onResult: (err: any, statusCode: number, types: ReleaseInterfaces.ArtifactTypeDefinition[]) => void): void; - getArtifactVersions(project: string, releaseDefinitionId: number, onResult: (err: any, statusCode: number, version: ReleaseInterfaces.ArtifactVersionQueryResult) => void): void; - getArtifactVersionsForSources(artifacts: ReleaseInterfaces.Artifact[], project: string, onResult: (err: any, statusCode: number, version: ReleaseInterfaces.ArtifactVersionQueryResult) => void): void; - getReleaseWorkItemsRefs(project: string, releaseId: number, baseReleaseId: number, top: number, onResult: (err: any, statusCode: number, workitems: ReleaseInterfaces.ReleaseWorkItemRef[]) => void): void; - } - export interface IQReleaseApi extends basem.QClientApiBase { - getAgentArtifactDefinitions(project: string, releaseId: number): Q.Promise; - getApprovals(project: string, assignedToFilter?: string, statusFilter?: ReleaseInterfaces.ApprovalStatus, releaseIdsFilter?: number[]): Q.Promise; - getApprovalHistory(project: string, approvalStepId: number): Q.Promise; - updateReleaseApproval(approval: ReleaseInterfaces.ReleaseApproval, project: string, approvalId: number): Q.Promise; - getReleaseChanges(project: string, releaseId: number, baseReleaseId?: number, top?: number): Q.Promise; - createReleaseDefinition(releaseDefinition: ReleaseInterfaces.ReleaseDefinition, project: string): Q.Promise; - deleteReleaseDefinition(project: string, definitionId: number): Q.Promise; - getReleaseDefinition(project: string, definitionId: number): Q.Promise; - getReleaseDefinitions(project: string, searchText?: string, artifactIdFilter?: number, expand?: ReleaseInterfaces.ReleaseDefinitionExpands): Q.Promise; - getReleaseDefinitionsForArtifactSource(project: string, artifactType: string, artifactSourceId: string, expand?: ReleaseInterfaces.ReleaseDefinitionExpands): Q.Promise; - updateReleaseDefinition(releaseDefinition: ReleaseInterfaces.ReleaseDefinition, project: string): Q.Promise; - getReleaseEnvironment(project: string, releaseId: number, environmentId: number): Q.Promise; - updateReleaseEnvironment(environmentUpdateData: any, project: string, releaseId: number, environmentId: number): Q.Promise; - createDefinitionEnvironmentTemplate(template: ReleaseInterfaces.ReleaseDefinitionEnvironmentTemplate, project: string): Q.Promise; - deleteDefinitionEnvironmentTemplate(project: string, templateId: string): Q.Promise; - getDefinitionEnvironmentTemplate(project: string, templateId: string): Q.Promise; - listDefinitionEnvironmentTemplates(project: string): Q.Promise; - getInputValues(query: FormInputInterfaces.InputValuesQuery, project: string): Q.Promise; - getLogs(project: string, releaseId: number): Q.Promise; - getLog(project: string, releaseId: number, environmentId: number, taskId: number, attemptId?: number): Q.Promise; - createRelease(releaseStartMetadata: ReleaseInterfaces.ReleaseStartMetadata, project: string): Q.Promise; - deleteRelease(project: string, releaseId: number): Q.Promise; - getRelease(project: string, releaseId: number, includeAllApprovals?: boolean): Q.Promise; - getReleaseDefinitionSummary(project: string, definitionId: number, releaseCount: number, includeArtifact?: boolean): Q.Promise; - getReleases(project: string, definitionId?: number, definitionEnvironmentId?: number, searchText?: string, createdBy?: string, statusFilter?: ReleaseInterfaces.ReleaseStatus, minCreatedTime?: Date, maxCreatedTime?: Date, queryOrder?: ReleaseInterfaces.ReleaseQueryOrder, top?: number, continuationToken?: number, expand?: ReleaseInterfaces.ReleaseExpands, artifactTypeId?: string, artifactSourceId?: number, artifactVersionId?: string): Q.Promise; - updateRelease(release: ReleaseInterfaces.Release, project: string, releaseId: number): Q.Promise; - updateReleaseResource(releaseUpdateMetadata: ReleaseInterfaces.ReleaseUpdateMetadata, project: string, releaseId: number): Q.Promise; - getReleaseDefinitionHistory(project: string, definitionId: number): Q.Promise; - getReleaseDefinitionRevision(project: string, definitionId: number, revision: number): Q.Promise; - getArtifactsSources(project: string, typeId?: string): Q.Promise; - getTasks(project: string, releaseId: number, environmentId: number, attemptId?: number): Q.Promise; - getArtifactTypeDefinitions(project: string): Q.Promise; - getArtifactVersions(project: string, releaseDefinitionId: number): Q.Promise; - getArtifactVersionsForSources(artifacts: ReleaseInterfaces.Artifact[], project: string): Q.Promise; - getReleaseWorkItemsRefs(project: string, releaseId: number, baseReleaseId?: number, top?: number): Q.Promise; - } - export class ReleaseApi extends basem.ClientApiBase implements IReleaseApi { - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]); - /** - * Returns the artifact details that automation agent requires - * - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param onResult callback function with the resulting ReleaseInterfaces.AgentArtifactDefinition[] - */ - getAgentArtifactDefinitions(project: string, releaseId: number, onResult: (err: any, statusCode: number, agentartifacts: ReleaseInterfaces.AgentArtifactDefinition[]) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {string} assignedToFilter - * @param {ReleaseInterfaces.ApprovalStatus} statusFilter - * @param {number[]} releaseIdsFilter - * @param onResult callback function with the resulting ReleaseInterfaces.ReleaseApproval[] - */ - getApprovals(project: string, assignedToFilter: string, statusFilter: ReleaseInterfaces.ApprovalStatus, releaseIdsFilter: number[], onResult: (err: any, statusCode: number, approvals: ReleaseInterfaces.ReleaseApproval[]) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} approvalStepId - * @param onResult callback function with the resulting ReleaseInterfaces.ReleaseApproval - */ - getApprovalHistory(project: string, approvalStepId: number, onResult: (err: any, statusCode: number, approval: ReleaseInterfaces.ReleaseApproval) => void): void; - /** - * @param {ReleaseInterfaces.ReleaseApproval} approval - * @param {string} project - Project ID or project name - * @param {number} approvalId - * @param onResult callback function with the resulting ReleaseInterfaces.ReleaseApproval - */ - updateReleaseApproval(approval: ReleaseInterfaces.ReleaseApproval, project: string, approvalId: number, onResult: (err: any, statusCode: number, approval: ReleaseInterfaces.ReleaseApproval) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {number} baseReleaseId - * @param {number} top - * @param onResult callback function with the resulting ReleaseInterfaces.Change[] - */ - getReleaseChanges(project: string, releaseId: number, baseReleaseId: number, top: number, onResult: (err: any, statusCode: number, changes: ReleaseInterfaces.Change[]) => void): void; - /** - * @param {ReleaseInterfaces.ReleaseDefinition} releaseDefinition - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting ReleaseInterfaces.ReleaseDefinition - */ - createReleaseDefinition(releaseDefinition: ReleaseInterfaces.ReleaseDefinition, project: string, onResult: (err: any, statusCode: number, definition: ReleaseInterfaces.ReleaseDefinition) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} definitionId - * @param onResult callback function - */ - deleteReleaseDefinition(project: string, definitionId: number, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} definitionId - * @param onResult callback function with the resulting ReleaseInterfaces.ReleaseDefinition - */ - getReleaseDefinition(project: string, definitionId: number, onResult: (err: any, statusCode: number, definition: ReleaseInterfaces.ReleaseDefinition) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {string} searchText - * @param {number} artifactIdFilter - * @param {ReleaseInterfaces.ReleaseDefinitionExpands} expand - * @param onResult callback function with the resulting ReleaseInterfaces.ReleaseDefinition[] - */ - getReleaseDefinitions(project: string, searchText: string, artifactIdFilter: number, expand: ReleaseInterfaces.ReleaseDefinitionExpands, onResult: (err: any, statusCode: number, definitions: ReleaseInterfaces.ReleaseDefinition[]) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {string} artifactType - * @param {string} artifactSourceId - * @param {ReleaseInterfaces.ReleaseDefinitionExpands} expand - * @param onResult callback function with the resulting ReleaseInterfaces.ReleaseDefinition[] - */ - getReleaseDefinitionsForArtifactSource(project: string, artifactType: string, artifactSourceId: string, expand: ReleaseInterfaces.ReleaseDefinitionExpands, onResult: (err: any, statusCode: number, definitions: ReleaseInterfaces.ReleaseDefinition[]) => void): void; - /** - * @param {ReleaseInterfaces.ReleaseDefinition} releaseDefinition - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting ReleaseInterfaces.ReleaseDefinition - */ - updateReleaseDefinition(releaseDefinition: ReleaseInterfaces.ReleaseDefinition, project: string, onResult: (err: any, statusCode: number, definition: ReleaseInterfaces.ReleaseDefinition) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {number} environmentId - * @param onResult callback function with the resulting ReleaseInterfaces.ReleaseEnvironment - */ - getReleaseEnvironment(project: string, releaseId: number, environmentId: number, onResult: (err: any, statusCode: number, environment: ReleaseInterfaces.ReleaseEnvironment) => void): void; - /** - * @param {any} environmentUpdateData - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {number} environmentId - * @param onResult callback function with the resulting ReleaseInterfaces.ReleaseEnvironment - */ - updateReleaseEnvironment(environmentUpdateData: any, project: string, releaseId: number, environmentId: number, onResult: (err: any, statusCode: number, environment: ReleaseInterfaces.ReleaseEnvironment) => void): void; - /** - * @param {ReleaseInterfaces.ReleaseDefinitionEnvironmentTemplate} template - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting ReleaseInterfaces.ReleaseDefinitionEnvironmentTemplate - */ - createDefinitionEnvironmentTemplate(template: ReleaseInterfaces.ReleaseDefinitionEnvironmentTemplate, project: string, onResult: (err: any, statusCode: number, environmenttemplate: ReleaseInterfaces.ReleaseDefinitionEnvironmentTemplate) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {string} templateId - * @param onResult callback function - */ - deleteDefinitionEnvironmentTemplate(project: string, templateId: string, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {string} templateId - * @param onResult callback function with the resulting ReleaseInterfaces.ReleaseDefinitionEnvironmentTemplate - */ - getDefinitionEnvironmentTemplate(project: string, templateId: string, onResult: (err: any, statusCode: number, environmenttemplate: ReleaseInterfaces.ReleaseDefinitionEnvironmentTemplate) => void): void; - /** - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting ReleaseInterfaces.ReleaseDefinitionEnvironmentTemplate[] - */ - listDefinitionEnvironmentTemplates(project: string, onResult: (err: any, statusCode: number, environmenttemplates: ReleaseInterfaces.ReleaseDefinitionEnvironmentTemplate[]) => void): void; - /** - * @param {FormInputInterfaces.InputValuesQuery} query - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting FormInputInterfaces.InputValuesQuery - */ - getInputValues(query: FormInputInterfaces.InputValuesQuery, project: string, onResult: (err: any, statusCode: number, inputvaluesquery: FormInputInterfaces.InputValuesQuery) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param onResult callback function with the resulting ArrayBuffer - */ - getLogs(project: string, releaseId: number, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {number} environmentId - * @param {number} taskId - * @param {number} attemptId - * @param onResult callback function with the resulting string - */ - getLog(project: string, releaseId: number, environmentId: number, taskId: number, attemptId: number, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * @param {ReleaseInterfaces.ReleaseStartMetadata} releaseStartMetadata - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting ReleaseInterfaces.Release - */ - createRelease(releaseStartMetadata: ReleaseInterfaces.ReleaseStartMetadata, project: string, onResult: (err: any, statusCode: number, release: ReleaseInterfaces.Release) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param onResult callback function - */ - deleteRelease(project: string, releaseId: number, onResult: (err: any, statusCode: number) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {boolean} includeAllApprovals - * @param onResult callback function with the resulting ReleaseInterfaces.Release - */ - getRelease(project: string, releaseId: number, includeAllApprovals: boolean, onResult: (err: any, statusCode: number, release: ReleaseInterfaces.Release) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} definitionId - * @param {number} releaseCount - * @param {boolean} includeArtifact - * @param onResult callback function with the resulting ReleaseInterfaces.ReleaseDefinitionSummary - */ - getReleaseDefinitionSummary(project: string, definitionId: number, releaseCount: number, includeArtifact: boolean, onResult: (err: any, statusCode: number, release: ReleaseInterfaces.ReleaseDefinitionSummary) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} definitionId - * @param {number} definitionEnvironmentId - * @param {string} searchText - * @param {string} createdBy - * @param {ReleaseInterfaces.ReleaseStatus} statusFilter - * @param {Date} minCreatedTime - * @param {Date} maxCreatedTime - * @param {ReleaseInterfaces.ReleaseQueryOrder} queryOrder - * @param {number} top - * @param {number} continuationToken - * @param {ReleaseInterfaces.ReleaseExpands} expand - * @param {string} artifactTypeId - * @param {number} artifactSourceId - * @param {string} artifactVersionId - * @param onResult callback function with the resulting ReleaseInterfaces.Release[] - */ - getReleases(project: string, definitionId: number, definitionEnvironmentId: number, searchText: string, createdBy: string, statusFilter: ReleaseInterfaces.ReleaseStatus, minCreatedTime: Date, maxCreatedTime: Date, queryOrder: ReleaseInterfaces.ReleaseQueryOrder, top: number, continuationToken: number, expand: ReleaseInterfaces.ReleaseExpands, artifactTypeId: string, artifactSourceId: number, artifactVersionId: string, onResult: (err: any, statusCode: number, releases: ReleaseInterfaces.Release[]) => void): void; - /** - * @param {ReleaseInterfaces.Release} release - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param onResult callback function with the resulting ReleaseInterfaces.Release - */ - updateRelease(release: ReleaseInterfaces.Release, project: string, releaseId: number, onResult: (err: any, statusCode: number, release: ReleaseInterfaces.Release) => void): void; - /** - * @param {ReleaseInterfaces.ReleaseUpdateMetadata} releaseUpdateMetadata - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param onResult callback function with the resulting ReleaseInterfaces.Release - */ - updateReleaseResource(releaseUpdateMetadata: ReleaseInterfaces.ReleaseUpdateMetadata, project: string, releaseId: number, onResult: (err: any, statusCode: number, release: ReleaseInterfaces.Release) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} definitionId - * @param onResult callback function with the resulting ReleaseInterfaces.ReleaseDefinitionRevision[] - */ - getReleaseDefinitionHistory(project: string, definitionId: number, onResult: (err: any, statusCode: number, revisions: ReleaseInterfaces.ReleaseDefinitionRevision[]) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} definitionId - * @param {number} revision - * @param onResult callback function with the resulting string - */ - getReleaseDefinitionRevision(project: string, definitionId: number, revision: number, onResult: (err: any, statusCode: number, res: NodeJS.ReadableStream) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {string} typeId - * @param onResult callback function with the resulting ReleaseInterfaces.ArtifactSourceIdsQueryResult - */ - getArtifactsSources(project: string, typeId: string, onResult: (err: any, statusCode: number, source: ReleaseInterfaces.ArtifactSourceIdsQueryResult) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {number} environmentId - * @param {number} attemptId - * @param onResult callback function with the resulting ReleaseInterfaces.ReleaseTask[] - */ - getTasks(project: string, releaseId: number, environmentId: number, attemptId: number, onResult: (err: any, statusCode: number, tasks: ReleaseInterfaces.ReleaseTask[]) => void): void; - /** - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting ReleaseInterfaces.ArtifactTypeDefinition[] - */ - getArtifactTypeDefinitions(project: string, onResult: (err: any, statusCode: number, types: ReleaseInterfaces.ArtifactTypeDefinition[]) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} releaseDefinitionId - * @param onResult callback function with the resulting ReleaseInterfaces.ArtifactVersionQueryResult - */ - getArtifactVersions(project: string, releaseDefinitionId: number, onResult: (err: any, statusCode: number, version: ReleaseInterfaces.ArtifactVersionQueryResult) => void): void; - /** - * @param {ReleaseInterfaces.Artifact[]} artifacts - * @param {string} project - Project ID or project name - * @param onResult callback function with the resulting ReleaseInterfaces.ArtifactVersionQueryResult - */ - getArtifactVersionsForSources(artifacts: ReleaseInterfaces.Artifact[], project: string, onResult: (err: any, statusCode: number, version: ReleaseInterfaces.ArtifactVersionQueryResult) => void): void; - /** - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {number} baseReleaseId - * @param {number} top - * @param onResult callback function with the resulting ReleaseInterfaces.ReleaseWorkItemRef[] - */ - getReleaseWorkItemsRefs(project: string, releaseId: number, baseReleaseId: number, top: number, onResult: (err: any, statusCode: number, workitems: ReleaseInterfaces.ReleaseWorkItemRef[]) => void): void; - } - export class QReleaseApi extends basem.QClientApiBase implements IQReleaseApi { - api: ReleaseApi; - constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[]); - /** - * Returns the artifact details that automation agent requires - * - * @param {string} project - Project ID or project name - * @param {number} releaseId - */ - getAgentArtifactDefinitions(project: string, releaseId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {string} assignedToFilter - * @param {ReleaseInterfaces.ApprovalStatus} statusFilter - * @param {number[]} releaseIdsFilter - */ - getApprovals(project: string, assignedToFilter?: string, statusFilter?: ReleaseInterfaces.ApprovalStatus, releaseIdsFilter?: number[]): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} approvalStepId - */ - getApprovalHistory(project: string, approvalStepId: number): Q.Promise; - /** - * @param {ReleaseInterfaces.ReleaseApproval} approval - * @param {string} project - Project ID or project name - * @param {number} approvalId - */ - updateReleaseApproval(approval: ReleaseInterfaces.ReleaseApproval, project: string, approvalId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {number} baseReleaseId - * @param {number} top - */ - getReleaseChanges(project: string, releaseId: number, baseReleaseId?: number, top?: number): Q.Promise; - /** - * @param {ReleaseInterfaces.ReleaseDefinition} releaseDefinition - * @param {string} project - Project ID or project name - */ - createReleaseDefinition(releaseDefinition: ReleaseInterfaces.ReleaseDefinition, project: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} definitionId - */ - deleteReleaseDefinition(project: string, definitionId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} definitionId - */ - getReleaseDefinition(project: string, definitionId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {string} searchText - * @param {number} artifactIdFilter - * @param {ReleaseInterfaces.ReleaseDefinitionExpands} expand - */ - getReleaseDefinitions(project: string, searchText?: string, artifactIdFilter?: number, expand?: ReleaseInterfaces.ReleaseDefinitionExpands): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {string} artifactType - * @param {string} artifactSourceId - * @param {ReleaseInterfaces.ReleaseDefinitionExpands} expand - */ - getReleaseDefinitionsForArtifactSource(project: string, artifactType: string, artifactSourceId: string, expand?: ReleaseInterfaces.ReleaseDefinitionExpands): Q.Promise; - /** - * @param {ReleaseInterfaces.ReleaseDefinition} releaseDefinition - * @param {string} project - Project ID or project name - */ - updateReleaseDefinition(releaseDefinition: ReleaseInterfaces.ReleaseDefinition, project: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {number} environmentId - */ - getReleaseEnvironment(project: string, releaseId: number, environmentId: number): Q.Promise; - /** - * @param {any} environmentUpdateData - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {number} environmentId - */ - updateReleaseEnvironment(environmentUpdateData: any, project: string, releaseId: number, environmentId: number): Q.Promise; - /** - * @param {ReleaseInterfaces.ReleaseDefinitionEnvironmentTemplate} template - * @param {string} project - Project ID or project name - */ - createDefinitionEnvironmentTemplate(template: ReleaseInterfaces.ReleaseDefinitionEnvironmentTemplate, project: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {string} templateId - */ - deleteDefinitionEnvironmentTemplate(project: string, templateId: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {string} templateId - */ - getDefinitionEnvironmentTemplate(project: string, templateId: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - */ - listDefinitionEnvironmentTemplates(project: string): Q.Promise; - /** - * @param {FormInputInterfaces.InputValuesQuery} query - * @param {string} project - Project ID or project name - */ - getInputValues(query: FormInputInterfaces.InputValuesQuery, project: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} releaseId - */ - getLogs(project: string, releaseId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {number} environmentId - * @param {number} taskId - * @param {number} attemptId - */ - getLog(project: string, releaseId: number, environmentId: number, taskId: number, attemptId?: number): Q.Promise; - /** - * @param {ReleaseInterfaces.ReleaseStartMetadata} releaseStartMetadata - * @param {string} project - Project ID or project name - */ - createRelease(releaseStartMetadata: ReleaseInterfaces.ReleaseStartMetadata, project: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} releaseId - */ - deleteRelease(project: string, releaseId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {boolean} includeAllApprovals - */ - getRelease(project: string, releaseId: number, includeAllApprovals?: boolean): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} definitionId - * @param {number} releaseCount - * @param {boolean} includeArtifact - */ - getReleaseDefinitionSummary(project: string, definitionId: number, releaseCount: number, includeArtifact?: boolean): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} definitionId - * @param {number} definitionEnvironmentId - * @param {string} searchText - * @param {string} createdBy - * @param {ReleaseInterfaces.ReleaseStatus} statusFilter - * @param {Date} minCreatedTime - * @param {Date} maxCreatedTime - * @param {ReleaseInterfaces.ReleaseQueryOrder} queryOrder - * @param {number} top - * @param {number} continuationToken - * @param {ReleaseInterfaces.ReleaseExpands} expand - * @param {string} artifactTypeId - * @param {number} artifactSourceId - * @param {string} artifactVersionId - */ - getReleases(project: string, definitionId?: number, definitionEnvironmentId?: number, searchText?: string, createdBy?: string, statusFilter?: ReleaseInterfaces.ReleaseStatus, minCreatedTime?: Date, maxCreatedTime?: Date, queryOrder?: ReleaseInterfaces.ReleaseQueryOrder, top?: number, continuationToken?: number, expand?: ReleaseInterfaces.ReleaseExpands, artifactTypeId?: string, artifactSourceId?: number, artifactVersionId?: string): Q.Promise; - /** - * @param {ReleaseInterfaces.Release} release - * @param {string} project - Project ID or project name - * @param {number} releaseId - */ - updateRelease(release: ReleaseInterfaces.Release, project: string, releaseId: number): Q.Promise; - /** - * @param {ReleaseInterfaces.ReleaseUpdateMetadata} releaseUpdateMetadata - * @param {string} project - Project ID or project name - * @param {number} releaseId - */ - updateReleaseResource(releaseUpdateMetadata: ReleaseInterfaces.ReleaseUpdateMetadata, project: string, releaseId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} definitionId - */ - getReleaseDefinitionHistory(project: string, definitionId: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} definitionId - * @param {number} revision - */ - getReleaseDefinitionRevision(project: string, definitionId: number, revision: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {string} typeId - */ - getArtifactsSources(project: string, typeId?: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {number} environmentId - * @param {number} attemptId - */ - getTasks(project: string, releaseId: number, environmentId: number, attemptId?: number): Q.Promise; - /** - * @param {string} project - Project ID or project name - */ - getArtifactTypeDefinitions(project: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} releaseDefinitionId - */ - getArtifactVersions(project: string, releaseDefinitionId: number): Q.Promise; - /** - * @param {ReleaseInterfaces.Artifact[]} artifacts - * @param {string} project - Project ID or project name - */ - getArtifactVersionsForSources(artifacts: ReleaseInterfaces.Artifact[], project: string): Q.Promise; - /** - * @param {string} project - Project ID or project name - * @param {number} releaseId - * @param {number} baseReleaseId - * @param {number} top - */ - getReleaseWorkItemsRefs(project: string, releaseId: number, baseReleaseId?: number, top?: number): Q.Promise; - } - -} -declare module 'vso-node-api/handlers/apiversion' { - /// - import VsoBaseInterfaces = require('vso-node-api/interfaces/common/VsoBaseInterfaces'); - export class ApiVersionHandler implements VsoBaseInterfaces.IRequestHandler { - apiVersion: string; - constructor(apiVersion: string); - prepareRequest(options: any): void; - canHandleAuthentication(res: VsoBaseInterfaces.IHttpResponse): boolean; - handleAuthentication(httpClient: any, protocol: any, options: any, objs: any, finalCallback: any): void; - } - -} -declare module 'vso-node-api/handlers/basiccreds' { - /// - import VsoBaseInterfaces = require('vso-node-api/interfaces/common/VsoBaseInterfaces'); - export class BasicCredentialHandler implements VsoBaseInterfaces.IRequestHandler { - username: string; - password: string; - constructor(username: string, password: string); - prepareRequest(options: any): void; - canHandleAuthentication(res: VsoBaseInterfaces.IHttpResponse): boolean; - handleAuthentication(httpClient: any, protocol: any, options: any, objs: any, finalCallback: any): void; - } - -} -declare module 'vso-node-api/handlers/bearertoken' { - /// - import VsoBaseInterfaces = require('vso-node-api/interfaces/common/VsoBaseInterfaces'); - export class BearerCredentialHandler implements VsoBaseInterfaces.IRequestHandler { - token: string; - constructor(token: string); - prepareRequest(options: any): void; - canHandleAuthentication(res: VsoBaseInterfaces.IHttpResponse): boolean; - handleAuthentication(httpClient: any, protocol: any, options: any, objs: any, finalCallback: any): void; - } - -} -declare module 'vso-node-api/handlers/ntlm' { - /// - import VsoBaseInterfaces = require('vso-node-api/interfaces/common/VsoBaseInterfaces'); - export class NtlmCredentialHandler implements VsoBaseInterfaces.IRequestHandler { - username: string; - password: string; - workstation: string; - domain: string; - constructor(username: string, password: string, domain?: string, workstation?: string); - prepareRequest(options: any): void; - canHandleAuthentication(res: VsoBaseInterfaces.IHttpResponse): boolean; - handleAuthentication(httpClient: any, protocol: any, options: any, objs: any, finalCallback: any): void; - private sendType1Message(httpClient, protocol, options, objs, keepaliveAgent, callback); - private sendType3Message(httpClient, protocol, options, objs, keepaliveAgent, res, callback); - } - -} -declare module 'vso-node-api/WebApi' { - import VsoBaseInterfaces = require('vso-node-api/interfaces/common/VsoBaseInterfaces'); - import buildm = require('vso-node-api/BuildApi'); - import corem = require('vso-node-api/CoreApi'); - import filecontainerm = require('vso-node-api/FileContainerApi'); - import gallerym = require('vso-node-api/GalleryApi'); - import gitm = require('vso-node-api/GitApi'); - import taskagentm = require('vso-node-api/TaskAgentApi'); - import taskm = require('vso-node-api/TaskApi'); - import testm = require('vso-node-api/TestApi'); - import tfvcm = require('vso-node-api/TfvcApi'); - import workitemtrackingm = require('vso-node-api/WorkItemTrackingApi'); - import releasem = require('vso-node-api/ReleaseApi'); - import apivm = require('vso-node-api/handlers/apiversion'); - import basicm = require('vso-node-api/handlers/basiccreds'); - import bearm = require('vso-node-api/handlers/bearertoken'); - import ntlmm = require('vso-node-api/handlers/ntlm'); - /** - * Methods to return handler objects (see handlers folder) - */ - export function getVersionHandler(apiVersion: string): apivm.ApiVersionHandler; - export function getBasicHandler(username: string, password: string): basicm.BasicCredentialHandler; - export function getNtlmHandler(username: string, password: string, workstation?: string, domain?: string): ntlmm.NtlmCredentialHandler; - export function getBearerHandler(token: any): bearm.BearerCredentialHandler; - export class WebApi { - serverUrl: string; - authHandler: VsoBaseInterfaces.IRequestHandler; - constructor(serverUrl: string, authHandler: VsoBaseInterfaces.IRequestHandler); - /** - * Each factory method can take a serverUrl and a list of handlers - * if these aren't provided, the default url and auth handler given to the constructor for this class will be used - */ - getBuildApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): buildm.IBuildApi; - /** - * Each API has a method here to create the "vanilla" API as well as one with a Q Promise wrapper. - */ - getQBuildApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): buildm.IQBuildApi; - getCoreApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): corem.ICoreApi; - getQCoreApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): corem.IQCoreApi; - getFileContainerApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): filecontainerm.IFileContainerApi; - getQFileContainerApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): filecontainerm.IQFileContainerApi; - getGalleryApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): gallerym.IGalleryApi; - getQGalleryApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): gallerym.IQGalleryApi; - getGitApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): gitm.IGitApi; - getQGitApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): gitm.IQGitApi; - getTaskApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): taskm.ITaskApi; - getQTaskApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): taskm.IQTaskApi; - getTaskAgentApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): taskagentm.ITaskAgentApi; - getQTaskAgentApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): taskagentm.IQTaskAgentApi; - getTestApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): testm.ITestApi; - getQTestApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): testm.IQTestApi; - getTfvcApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): tfvcm.ITfvcApi; - getQTfvcApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): tfvcm.IQTfvcApi; - getWorkItemTrackingApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): workitemtrackingm.IWorkItemTrackingApi; - getQWorkItemTrackingApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): workitemtrackingm.IQWorkItemTrackingApi; - getReleaseApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): releasem.IReleaseApi; - getQReleaseApi(serverUrl?: string, handlers?: VsoBaseInterfaces.IRequestHandler[]): releasem.IQReleaseApi; - } - -}