From cc792d45e4a7ad38603b44c05864e00594a7f8ac Mon Sep 17 00:00:00 2001 From: serkani Date: Tue, 2 Feb 2016 04:13:22 -0500 Subject: [PATCH] Updating with M94 bits. --- lib/VSS.SDK.js | 21 +- lib/VSS.SDK.min.js | 3 +- package.json | 6 +- typings/tfs.d.ts | 2869 +++++++++++++++++++++++++++++++++++++-- typings/vss.d.ts | 3202 +++++++++++++++++++++++++++++++------------- 5 files changed, 5076 insertions(+), 1025 deletions(-) diff --git a/lib/VSS.SDK.js b/lib/VSS.SDK.js index 538614a..d1054d5 100644 --- a/lib/VSS.SDK.js +++ b/lib/VSS.SDK.js @@ -110,6 +110,12 @@ var XDM; if (!this._isRejected && !this._isResolved) { this._isRejected = true; this._rejectValue = reason; + if (this._rejectCallbacks.length === 0 && window.console && window.console.warn) { + console.warn("Rejected XDM promise with no reject callbacks"); + if (reason) { + console.warn(reason); + } + } } if (this._isRejected && this._rejectCallbacks.length > 0) { var rejectCallbacks = this._rejectCallbacks.splice(0); @@ -733,7 +739,7 @@ var VSS; } else { if (!initOptions) { - init({ setupModuleLoader: true }); + init({ usePlatformScripts: true }); } else if (!usingPlatformScripts) { usingPlatformScripts = true; @@ -955,6 +961,7 @@ var VSS; return; } var scripts = []; + var anyCoreScriptLoaded = false; // Add scripts and loader configuration if (hostPageContext.coreReferences.scripts) { hostPageContext.coreReferences.scripts.forEach(function (script) { @@ -967,14 +974,22 @@ var VSS; else if (script.identifier === "JQueryUI") { alreadyLoaded = !!(global.jQuery && global.jQuery.ui && global.jQuery.ui.version); } - else if (script.identifier === "MicrosoftAjax") { - alreadyLoaded = !!(global.Sys && global.Sys.Browser); + else if (script.identifier === "AMDLoader") { + alreadyLoaded = typeof global.define === "function" && !!global.define.amd; } if (!alreadyLoaded) { scripts.push({ source: getAbsoluteUrl(script.url, hostRootUri) }); } + else { + anyCoreScriptLoaded = true; + } } }); + if (hostPageContext.coreReferences.coreScriptsBundle && !anyCoreScriptLoaded) { + // If core scripts bundle exists and no core scripts already loaded by extension, + // we are free to add core bundle. otherwise, load core scripts individually. + scripts = [{ source: getAbsoluteUrl(hostPageContext.coreReferences.coreScriptsBundle.url, hostRootUri) }]; + } } // Define a new config for extension loader var newConfig = { diff --git a/lib/VSS.SDK.min.js b/lib/VSS.SDK.min.js index 6e45af8..c50de66 100644 --- a/lib/VSS.SDK.min.js +++ b/lib/VSS.SDK.min.js @@ -1,4 +1,5 @@ //---------------------------------------------------------- // Copyright (C) Microsoft Corporation. All rights reserved. //---------------------------------------------------------- -var XDM,VSS;(function(n){function u(){return new o}function s(){return Math.floor(Math.random()*(f-t)+t).toString(36)+Math.floor(Math.random()*(f-t)+t).toString(36)}var i,r,e;n.createDeferred=u;var o=function(){function n(){var n=this;this._resolveCallbacks=[];this._rejectCallbacks=[];this._isResolved=!1;this._isRejected=!1;this.resolve=function(t){n._resolve(t)};this.reject=function(t){n._reject(t)};this.promise={};this.promise.then=function(t,i){return n._then(t,i)}}return n.prototype._then=function(t,i){var u=this,r;return!t&&!i||this._isResolved&&!t||this._isRejected&&!i?this.promise:(r=new n,this._resolveCallbacks.push(function(n){u._wrapCallback(t,n,r,!1)}),this._rejectCallbacks.push(function(n){u._wrapCallback(i,n,r,!0)}),this._isResolved?this._resolve(this._resolvedValue):this._isRejected&&this._reject(this._rejectValue),r.promise)},n.prototype._wrapCallback=function(n,t,i,r){if(!n){r?i.reject(t):i.resolve(t);return}var u;try{u=n(t)}catch(f){i.reject(f);return}u===undefined?i.resolve(t):u&&typeof u.then=="function"?u.then(function(n){i.resolve(n)},function(n){i.reject(n)}):i.resolve(u)},n.prototype._resolve=function(n){if(this._isRejected||this._isResolved||(this._isResolved=!0,this._resolvedValue=n),this._isResolved&&this._resolveCallbacks.length>0){var t=this._resolveCallbacks.splice(0);window.setTimeout(function(){for(var i=0,r=t.length;i0){var t=this._rejectCallbacks.splice(0);window.setTimeout(function(){for(var i=0,r=t.length;it.MAX_XDM_DEPTH)||this._shouldSkipSerialization(n))return null;if(a=function(t,e,o){var s,c,l,a,v;try{s=t[o]}catch(y){}(c=typeof s,c!=="undefined")&&(l=-1,c==="object"&&(l=r.originalObjects.indexOf(s)),l>=0?(a=r.newObjects[l],a.__circularReferenceId||(a.__circularReferenceId=u++),e[o]={__circularReference:a.__circularReferenceId}):c==="function"?(v=h._nextProxyFunctionId++,e[o]={__proxyFunctionId:h._registerProxyFunction(s,n),__channelId:h._channelId}):c==="object"?e[o]=s&&s instanceof Date?{__proxyDate:s.getTime()}:h._customSerializeObject(s,i,r,u,f+1):o!=="__proxyFunctionId"&&(e[o]=s))},r||(r={newObjects:[],originalObjects:[]}),r.originalObjects.push(n),n instanceof Array)for(o=[],r.newObjects.push(o),e=0,c=n.length;e=t.length?n.substr(0,t.length).localeCompare(t)===0:!1}function l(n,t){var i=n||"";return i[i.length-1]!=="/"&&(i+="/"),t&&(i+=t[0]==="/"?t.substr(1):t),i}function gt(n,t,i){var r,u;if(n.paths){t.paths||(t.paths={});for(r in n.paths)n.paths.hasOwnProperty(r)&&(u=n.paths[r],i&&(u=i(r,n.paths[r])),u&&(t.paths[r]=u))}}function ft(n,t){if(n.shim){t.shim||(t.shim={});for(var i in n.shim)n.shim.hasOwnProperty(i)&&(t.shim[i]=n.shim[i])}}function ni(n){var r=n.account||n.host,t=r.uri,i=r.relativeUri;return t&&i&&(t[t.length-1]!=="/"&&(t+="/"),i[i.length-1]!=="/"&&(i+="/"),t=t.substr(0,t.length-i.length)),t}function a(n,t,i){var f=this,r,u;if(t>=n.length){i.call(this);return}r=document.createElement("script");r.type="text/javascript";n[t].source?(u=n[t].source,r.src=u,r.addEventListener("load",function(){a.call(f,n,t+1,i)}),r.addEventListener("error",function(){g("Failed to load script: "+u)}),v(r,"head")):n[t].content&&(r.textContent=n[t].content,v(r,"head"),a.call(this,n,t+1,i))}function v(n,t){var i=document.getElementsByTagName(t)[0];i||(i=document.createElement(t),document.appendChild(i));i.appendChild(n)}function et(n,t){var i=(n||"").toLowerCase();return i.substr(0,2)!=="//"&&i.substr(0,5)!=="http:"&&i.substr(0,6)!=="https:"&&(n=t+(i[0]==="/"?"":"/")+n),n}function y(){var t=this,n;o=!0;u&&(n=u,u=null,n.forEach(function(n){n.call(t)}))}n.VssSDKVersion=.1;n.VssSDKRestVersion="2.1";var e,p,t,s,w,b,i,h=!1,f,c,o=!1,u,r=XDM.XDMChannelManager.get().addChannel(window.parent),ot;(function(n){n.Dialog="ms.vss-web.dialog-service";n.Navigation="ms.vss-web.navigation-service";n.ExtensionData="ms.vss-web.data-service"})(ot=n.ServiceIds||(n.ServiceIds={}));n.init=k;n.require=st;n.ready=d;n.notifyLoadSucceeded=ht;n.notifyLoadFailed=g;n.getWebContext=nt;n.getConfiguration=ct;n.getExtensionContext=tt;n.getContribution=lt;n.getService=at;n.getServiceContribution=it;n.getServiceContributions=vt;n.register=yt;n.getRegisteredObject=pt;n.getAccessToken=wt;n.getAppToken=bt;n.resize=kt}(VSS||(VSS={})); \ No newline at end of file +var XDM,VSS;(function(n){function u(){return new o}function s(){return Math.floor(Math.random()*(f-t)+t).toString(36)+Math.floor(Math.random()*(f-t)+t).toString(36)}var i,r,e;n.createDeferred=u;var o=function(){function n(){var n=this;this._resolveCallbacks=[];this._rejectCallbacks=[];this._isResolved=!1;this._isRejected=!1;this.resolve=function(t){n._resolve(t)};this.reject=function(t){n._reject(t)};this.promise={};this.promise.then=function(t,i){return n._then(t,i)}}return n.prototype._then=function(t,i){var u=this,r;return!t&&!i||this._isResolved&&!t||this._isRejected&&!i?this.promise:(r=new n,this._resolveCallbacks.push(function(n){u._wrapCallback(t,n,r,!1)}),this._rejectCallbacks.push(function(n){u._wrapCallback(i,n,r,!0)}),this._isResolved?this._resolve(this._resolvedValue):this._isRejected&&this._reject(this._rejectValue),r.promise)},n.prototype._wrapCallback=function(n,t,i,r){if(!n){r?i.reject(t):i.resolve(t);return}var u;try{u=n(t)}catch(f){i.reject(f);return}u===undefined?i.resolve(t):u&&typeof u.then=="function"?u.then(function(n){i.resolve(n)},function(n){i.reject(n)}):i.resolve(u)},n.prototype._resolve=function(n){if(this._isRejected||this._isResolved||(this._isResolved=!0,this._resolvedValue=n),this._isResolved&&this._resolveCallbacks.length>0){var t=this._resolveCallbacks.splice(0);window.setTimeout(function(){for(var i=0,r=t.length;i0){var t=this._rejectCallbacks.splice(0);window.setTimeout(function(){for(var i=0,r=t.length;it.MAX_XDM_DEPTH)||this._shouldSkipSerialization(n))return null;if(a=function(t,e,o){var s,c,l,a,v;try{s=t[o]}catch(y){}(c=typeof s,c!=="undefined")&&(l=-1,c==="object"&&(l=r.originalObjects.indexOf(s)),l>=0?(a=r.newObjects[l],a.__circularReferenceId||(a.__circularReferenceId=u++),e[o]={__circularReference:a.__circularReferenceId}):c==="function"?(v=h._nextProxyFunctionId++,e[o]={__proxyFunctionId:h._registerProxyFunction(s,n),__channelId:h._channelId}):c==="object"?e[o]=s&&s instanceof Date?{__proxyDate:s.getTime()}:h._customSerializeObject(s,i,r,u,f+1):o!=="__proxyFunctionId"&&(e[o]=s))},r||(r={newObjects:[],originalObjects:[]}),r.originalObjects.push(n),n instanceof Array)for(o=[],r.newObjects.push(o),e=0,c=n.length;e=t.length?n.substr(0,t.length).localeCompare(t)===0:!1}function l(n,t){var i=n||"";return i[i.length-1]!=="/"&&(i+="/"),t&&(i+=t[0]==="/"?t.substr(1):t),i}function gt(n,t,i){var r,u;if(n.paths){t.paths||(t.paths={});for(r in n.paths)n.paths.hasOwnProperty(r)&&(u=n.paths[r],i&&(u=i(r,n.paths[r])),u&&(t.paths[r]=u))}}function et(n,t){if(n.shim){t.shim||(t.shim={});for(var i in n.shim)n.shim.hasOwnProperty(i)&&(t.shim[i]=n.shim[i])}}function ni(n){var r=n.account||n.host,t=r.uri,i=r.relativeUri;return t&&i&&(t[t.length-1]!=="/"&&(t+="/"),i[i.length-1]!=="/"&&(i+="/"),t=t.substr(0,t.length-i.length)),t}function a(n,t,i){var f=this,r,u;if(t>=n.length){i.call(this);return}r=document.createElement("script");r.type="text/javascript";n[t].source?(u=n[t].source,r.src=u,r.addEventListener("load",function(){a.call(f,n,t+1,i)}),r.addEventListener("error",function(){nt("Failed to load script: "+u)}),v(r,"head")):n[t].content&&(r.textContent=n[t].content,v(r,"head"),a.call(this,n,t+1,i))}function v(n,t){var i=document.getElementsByTagName(t)[0];i||(i=document.createElement(t),document.appendChild(i));i.appendChild(n)}function y(n,t){var i=(n||"").toLowerCase();return i.substr(0,2)!=="//"&&i.substr(0,5)!=="http:"&&i.substr(0,6)!=="https:"&&(n=t+(i[0]==="/"?"":"/")+n),n}function p(){var t=this,n;o=!0;u&&(n=u,u=null,n.forEach(function(n){n.call(t)}))}n.VssSDKVersion=.1;n.VssSDKRestVersion="2.1";var e,w,t,s,b,k,i,h=!1,f,c,o=!1,u,r=XDM.XDMChannelManager.get().addChannel(window.parent),ot;(function(n){n.Dialog="ms.vss-web.dialog-service";n.Navigation="ms.vss-web.navigation-service";n.ExtensionData="ms.vss-web.data-service"})(ot=n.ServiceIds||(n.ServiceIds={}));n.init=d;n.require=st;n.ready=g;n.notifyLoadSucceeded=ht;n.notifyLoadFailed=nt;n.getWebContext=tt;n.getConfiguration=ct;n.getExtensionContext=it;n.getContribution=lt;n.getService=at;n.getServiceContribution=rt;n.getServiceContributions=vt;n.register=yt;n.getRegisteredObject=pt;n.getAccessToken=wt;n.getAppToken=bt;n.resize=kt}(VSS||(VSS={})); +//dependencies= diff --git a/package.json b/package.json index 76f6161..240a376 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { "name": "vss-sdk", - "version": "0.92.0", + "version": "1.94.0", "description": "Visual Studio Services Client SDK. JavaScript library for Visual Studio Online extensions.", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git", - "url": "https://github.com/Microsoft/vss-sdk.git" + "url": "https://github.com/Microsoft/vss-web-extension-sdk.git" }, "keywords": [ "extensions", @@ -22,7 +22,7 @@ "author": "serkan-inci", "license": "ISC", "bugs": { - "url": "https://github.com/Microsoft/vss-sdk/issues" + "url": "https://github.com/Microsoft/vss-web-extension-sdk/issues" }, "homepage": "https://www.visualstudio.com/integrate/extensions/overview" } diff --git a/typings/tfs.d.ts b/typings/tfs.d.ts index 29f33e6..b46529b 100644 --- a/typings/tfs.d.ts +++ b/typings/tfs.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Microsoft Visual Studio Services v92.20151216.1133 +// Type definitions for Microsoft Visual Studio Services v94.20160202.0901 // Project: http://www.visualstudio.com/integrate/extensions/overview // Definitions by: Microsoft @@ -772,6 +772,7 @@ export interface ContinuousDeploymentDefinition { export interface ContinuousIntegrationTrigger extends BuildTrigger { batchChanges: boolean; branchFilters: string[]; + maxConcurrentBuildsPerBranch: number; /** * The polling interval in seconds. */ @@ -1107,6 +1108,7 @@ export interface RetentionPolicy { daysToKeep: number; deleteBuildRecord: boolean; deleteTestResults: boolean; + minimumToKeep: number; } export interface Schedule { branchFilters: string[]; @@ -2850,6 +2852,9 @@ 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; @@ -3543,26 +3548,2069 @@ export class CoreHttpClient2_1 extends VSS_WebApi.VssHttpClient { * @param {number} skip * @return IPromise */ - getTeams(projectId: string, top?: number, skip?: number): IPromise; + getTeams(projectId: string, top?: number, skip?: number): IPromise; + /** + * Updates a team's name and/or description + * + * @param {Contracts.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. + * @return IPromise + */ + updateTeam(teamData: Contracts.WebApiTeam, projectId: string, teamId: string): IPromise; +} +export class CoreHttpClient extends CoreHttpClient2_2 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return CoreHttpClient2_1 + */ +export function getClient(): CoreHttpClient2_1; +} +declare module "TFS/DistributedTask/Contracts" { +import VSS_Common_Contracts = require("VSS/WebApi/Contracts"); +import VSS_FormInput_Contracts = require("VSS/Common/Contracts/FormInput"); +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; + }; + 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: number]: 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: number]: JobOption; + }; + variables: { + [key: string]: string; + }; +} +/** + * Represents an endpoint which may be used by an orchestration job. + */ +export interface ServiceEndpoint { + administratorsGroup: VSS_Common_Contracts.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: VSS_Common_Contracts.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: VSS_Common_Contracts.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: VSS_FormInput_Contracts.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: VSS_Common_Contracts.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: VSS_Common_Contracts.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: VSS_Common_Contracts.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; +} +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: VSS_Common_Contracts.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: VSS_Common_Contracts.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 "TFS/DistributedTask/TaskAgentRestClient" { +import Contracts = require("TFS/DistributedTask/Contracts"); +import VSS_Common_Contracts = require("VSS/WebApi/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +/** + * @exemptedapi + */ +export class TaskAgentHttpClient2_2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {Contracts.TaskAgent} agent + * @param {number} poolId + * @return IPromise + */ + addAgent(agent: Contracts.TaskAgent, poolId: number): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + deleteAgent(poolId: number, agentId: number): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @param {number} agentId + * @param {boolean} includeCapabilities + * @param {boolean} includeAssignedRequest + * @param {string[]} propertyFilters + * @return IPromise + */ + getAgent(poolId: number, agentId: number, includeCapabilities?: boolean, includeAssignedRequest?: boolean, propertyFilters?: string[]): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @param {string} agentName + * @param {boolean} includeCapabilities + * @param {boolean} includeAssignedRequest + * @param {string[]} propertyFilters + * @param {string[]} demands + * @return IPromise + */ + getAgents(poolId: number, agentName?: string, includeCapabilities?: boolean, includeAssignedRequest?: boolean, propertyFilters?: string[], demands?: string[]): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TaskAgent} agent + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + replaceAgent(agent: Contracts.TaskAgent, poolId: number, agentId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TaskAgent} agent + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + updateAgent(agent: Contracts.TaskAgent, poolId: number, agentId: number): IPromise; + /** + * [Preview API] 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 {Contracts.TaskDefinitionEndpoint} endpoint - Describes the URL to fetch. + * @return IPromise + */ + queryEndpoint(endpoint: Contracts.TaskDefinitionEndpoint): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @param {number} requestId + * @param {string} lockToken + * @return IPromise + */ + deleteAgentRequest(poolId: number, requestId: number, lockToken: string): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @param {number} requestId + * @return IPromise + */ + getAgentRequest(poolId: number, requestId: number): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @param {number} agentId + * @param {number} completedRequestCount + * @return IPromise + */ + getAgentRequestsForAgent(poolId: number, agentId: number, completedRequestCount?: number): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @param {number[]} agentIds + * @param {number} completedRequestCount + * @return IPromise + */ + getAgentRequestsForAgents(poolId: number, agentIds: number[], completedRequestCount?: number): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @param {string} planId + * @param {string} jobId + * @return IPromise + */ + getAgentRequestsForPlan(poolId: number, planId: string, jobId?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TaskAgentJobRequest} request + * @param {number} poolId + * @return IPromise + */ + queueAgentRequest(request: Contracts.TaskAgentJobRequest, poolId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TaskAgentJobRequest} request + * @param {number} poolId + * @param {number} requestId + * @param {string} lockToken + * @return IPromise + */ + updateAgentRequest(request: Contracts.TaskAgentJobRequest, poolId: number, requestId: number, lockToken: string): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @param {number} messageId + * @param {string} sessionId + * @return IPromise + */ + deleteMessage(poolId: number, messageId: number, sessionId: string): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @param {string} sessionId + * @param {number} lastMessageId + * @return IPromise + */ + getMessage(poolId: number, sessionId: string, lastMessageId?: number): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + refreshAgent(poolId: number, agentId: number): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @return IPromise + */ + refreshAgents(poolId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TaskAgentMessage} message + * @param {number} poolId + * @param {number} requestId + * @return IPromise + */ + sendMessage(message: Contracts.TaskAgentMessage, poolId: number, requestId: number): IPromise; + /** + * [Preview API] This method can return packages/{packageType} -- package stream OR TaskPackageMetadata if requested for json + * + * @param {string} packageType + * @return IPromise + */ + getPackage(packageType: string): IPromise; + /** + * [Preview API] + * + * @return IPromise + */ + getPackages(): IPromise; + /** + * [Preview API] This method can return packages/{packageType} -- package stream OR TaskPackageMetadata if requested for json + * + * @param {string} packageType + * @return IPromise + */ + getPackageZip(packageType: string): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @return IPromise + */ + getAgentPoolRoles(poolId?: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TaskAgentPool} pool + * @return IPromise + */ + addAgentPool(pool: Contracts.TaskAgentPool): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @return IPromise + */ + deleteAgentPool(poolId: number): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @param {string[]} properties + * @return IPromise + */ + getAgentPool(poolId: number, properties?: string[]): IPromise; + /** + * [Preview API] + * + * @param {string} poolName + * @param {string[]} properties + * @return IPromise + */ + getAgentPools(poolName?: string, properties?: string[]): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TaskAgentPool} pool + * @param {number} poolId + * @return IPromise + */ + updateAgentPool(pool: Contracts.TaskAgentPool, poolId: number): IPromise; + /** + * [Preview API] + * + * @param {number} queueId + * @return IPromise + */ + getAgentQueueRoles(queueId?: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TaskAgentQueue} queue + * @return IPromise + */ + addAgentQueue(queue: Contracts.TaskAgentQueue): IPromise; + /** + * [Preview API] + * + * @param {number} queueId + * @return IPromise + */ + deleteAgentQueue(queueId: number): IPromise; + /** + * [Preview API] + * + * @param {number} queueId + * @param {Contracts.TaskAgentQueueActionFilter} actionFilter + * @return IPromise + */ + getAgentQueue(queueId: number, actionFilter?: Contracts.TaskAgentQueueActionFilter): IPromise; + /** + * [Preview API] + * + * @param {string} queueName + * @param {Contracts.TaskAgentQueueActionFilter} actionFilter + * @return IPromise + */ + getAgentQueues(queueName?: string, actionFilter?: Contracts.TaskAgentQueueActionFilter): IPromise; + /** + * [Preview API] 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 {Contracts.DataSourceBinding} binding - Describes the data source to fetch. + * @param {string} scopeIdentifier - The project GUID to scope the request + * @return IPromise + */ + queryServiceEndpoint(binding: Contracts.DataSourceBinding, scopeIdentifier: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.ServiceEndpoint} endpoint + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} endpointId + * @return IPromise + */ + createServiceEndpoint(endpoint: Contracts.ServiceEndpoint, scopeIdentifier: string, endpointId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} endpointId + * @return IPromise + */ + deleteServiceEndpoint(scopeIdentifier: string, endpointId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} endpointId + * @return IPromise + */ + getServiceEndpointDetails(scopeIdentifier: string, endpointId: string): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} type + * @param {string[]} authSchemes + * @param {string[]} endpointIds + * @return IPromise + */ + getServiceEndpoints(scopeIdentifier: string, type?: string, authSchemes?: string[], endpointIds?: string[]): IPromise; + /** + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} type + * @param {string} scheme + * @return IPromise + */ + getServiceEndpointTypes(scopeIdentifier: string, type?: string, scheme?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TaskAgentSession} session + * @param {number} poolId + * @return IPromise + */ + createAgentSession(session: Contracts.TaskAgentSession, poolId: number): IPromise; + /** + * [Preview API] + * + * @param {number} poolId + * @param {string} sessionId + * @return IPromise + */ + deleteAgentSession(poolId: number, sessionId: string): IPromise; + /** + * [Preview API] + * + * @param {string} taskId + * @return IPromise + */ + deleteTaskDefinition(taskId: string): IPromise; + /** + * [Preview API] + * + * @param {string} taskId + * @param {string} versionString + * @param {string[]} visibility + * @param {boolean} scopeLocal + * @return IPromise + */ + getTaskContentZip(taskId: string, versionString: string, visibility?: string[], scopeLocal?: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} taskId + * @param {string} versionString + * @param {string[]} visibility + * @param {boolean} scopeLocal + * @return IPromise + */ + getTaskDefinition(taskId: string, versionString: string, visibility?: string[], scopeLocal?: boolean): IPromise; + /** + * [Preview API] + * + * @param {string} taskId + * @param {string[]} visibility + * @param {boolean} scopeLocal + * @return IPromise + */ + getTaskDefinitions(taskId?: string, visibility?: string[], scopeLocal?: boolean): IPromise; + /** + * [Preview API] + * + * @param {{ [key: string] : string; }} userCapabilities + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + updateAgentUserCapabilities(userCapabilities: { + [key: string]: string; + }, poolId: number, agentId: number): IPromise; +} +export class TaskAgentHttpClient2_1 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * @param {Contracts.TaskAgent} agent + * @param {number} poolId + * @return IPromise + */ + addAgent(agent: Contracts.TaskAgent, poolId: number): IPromise; + /** + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + deleteAgent(poolId: number, agentId: number): IPromise; + /** + * @param {number} poolId + * @param {number} agentId + * @param {boolean} includeCapabilities + * @param {boolean} includeAssignedRequest + * @param {string[]} propertyFilters + * @return IPromise + */ + getAgent(poolId: number, agentId: number, includeCapabilities?: boolean, includeAssignedRequest?: boolean, propertyFilters?: string[]): IPromise; + /** + * @param {number} poolId + * @param {string} agentName + * @param {boolean} includeCapabilities + * @param {boolean} includeAssignedRequest + * @param {string[]} propertyFilters + * @param {string[]} demands + * @return IPromise + */ + getAgents(poolId: number, agentName?: string, includeCapabilities?: boolean, includeAssignedRequest?: boolean, propertyFilters?: string[], demands?: string[]): IPromise; + /** + * @param {Contracts.TaskAgent} agent + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + replaceAgent(agent: Contracts.TaskAgent, poolId: number, agentId: number): IPromise; + /** + * @param {Contracts.TaskAgent} agent + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + updateAgent(agent: Contracts.TaskAgent, poolId: number, agentId: number): IPromise; + /** + * 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 {Contracts.TaskDefinitionEndpoint} endpoint - Describes the URL to fetch. + * @return IPromise + */ + queryEndpoint(endpoint: Contracts.TaskDefinitionEndpoint): IPromise; + /** + * @param {number} poolId + * @param {number} requestId + * @param {string} lockToken + * @return IPromise + */ + deleteAgentRequest(poolId: number, requestId: number, lockToken: string): IPromise; + /** + * @param {number} poolId + * @param {number} requestId + * @return IPromise + */ + getAgentRequest(poolId: number, requestId: number): IPromise; + /** + * @param {number} poolId + * @param {number} agentId + * @param {number} completedRequestCount + * @return IPromise + */ + getAgentRequestsForAgent(poolId: number, agentId: number, completedRequestCount?: number): IPromise; + /** + * @param {number} poolId + * @param {number[]} agentIds + * @param {number} completedRequestCount + * @return IPromise + */ + getAgentRequestsForAgents(poolId: number, agentIds: number[], completedRequestCount?: number): IPromise; + /** + * @param {number} poolId + * @param {string} planId + * @param {string} jobId + * @return IPromise + */ + getAgentRequestsForPlan(poolId: number, planId: string, jobId?: string): IPromise; + /** + * @param {Contracts.TaskAgentJobRequest} request + * @param {number} poolId + * @return IPromise + */ + queueAgentRequest(request: Contracts.TaskAgentJobRequest, poolId: number): IPromise; + /** + * @param {Contracts.TaskAgentJobRequest} request + * @param {number} poolId + * @param {number} requestId + * @param {string} lockToken + * @return IPromise + */ + updateAgentRequest(request: Contracts.TaskAgentJobRequest, poolId: number, requestId: number, lockToken: string): IPromise; + /** + * @param {number} poolId + * @param {number} messageId + * @param {string} sessionId + * @return IPromise + */ + deleteMessage(poolId: number, messageId: number, sessionId: string): IPromise; + /** + * @param {number} poolId + * @param {string} sessionId + * @param {number} lastMessageId + * @return IPromise + */ + getMessage(poolId: number, sessionId: string, lastMessageId?: number): IPromise; + /** + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + refreshAgent(poolId: number, agentId: number): IPromise; + /** + * @param {number} poolId + * @return IPromise + */ + refreshAgents(poolId: number): IPromise; + /** + * @param {Contracts.TaskAgentMessage} message + * @param {number} poolId + * @param {number} requestId + * @return IPromise + */ + sendMessage(message: Contracts.TaskAgentMessage, poolId: number, requestId: number): IPromise; + /** + * This method can return packages/{packageType} -- package stream OR TaskPackageMetadata if requested for json + * + * @param {string} packageType + * @return IPromise + */ + getPackage(packageType: string): IPromise; + /** + * @return IPromise + */ + getPackages(): IPromise; + /** + * This method can return packages/{packageType} -- package stream OR TaskPackageMetadata if requested for json + * + * @param {string} packageType + * @return IPromise + */ + getPackageZip(packageType: string): IPromise; + /** + * @exemptedapi + * [Preview API] + * + * @param {number} poolId + * @return IPromise + */ + getAgentPoolRoles(poolId?: number): IPromise; + /** + * @param {Contracts.TaskAgentPool} pool + * @return IPromise + */ + addAgentPool(pool: Contracts.TaskAgentPool): IPromise; + /** + * @param {number} poolId + * @return IPromise + */ + deleteAgentPool(poolId: number): IPromise; + /** + * @param {number} poolId + * @param {string[]} properties + * @return IPromise + */ + getAgentPool(poolId: number, properties?: string[]): IPromise; + /** + * @param {string} poolName + * @param {string[]} properties + * @return IPromise + */ + getAgentPools(poolName?: string, properties?: string[]): IPromise; + /** + * @param {Contracts.TaskAgentPool} pool + * @param {number} poolId + * @return IPromise + */ + updateAgentPool(pool: Contracts.TaskAgentPool, poolId: number): IPromise; + /** + * @exemptedapi + * [Preview API] + * + * @param {number} queueId + * @return IPromise + */ + getAgentQueueRoles(queueId?: number): IPromise; + /** + * @exemptedapi + * [Preview API] + * + * @param {Contracts.TaskAgentQueue} queue + * @return IPromise + */ + addAgentQueue(queue: Contracts.TaskAgentQueue): IPromise; + /** + * @exemptedapi + * [Preview API] + * + * @param {number} queueId + * @return IPromise + */ + deleteAgentQueue(queueId: number): IPromise; + /** + * @exemptedapi + * [Preview API] + * + * @param {number} queueId + * @param {Contracts.TaskAgentQueueActionFilter} actionFilter + * @return IPromise + */ + getAgentQueue(queueId: number, actionFilter?: Contracts.TaskAgentQueueActionFilter): IPromise; + /** + * @exemptedapi + * [Preview API] + * + * @param {string} queueName + * @param {Contracts.TaskAgentQueueActionFilter} actionFilter + * @return IPromise + */ + getAgentQueues(queueName?: string, actionFilter?: Contracts.TaskAgentQueueActionFilter): IPromise; + /** + * @exemptedapi + * [Preview API] 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 {Contracts.DataSourceBinding} binding - Describes the data source to fetch. + * @param {string} scopeIdentifier - The project GUID to scope the request + * @return IPromise + */ + queryServiceEndpoint(binding: Contracts.DataSourceBinding, scopeIdentifier: string): IPromise; + /** + * @exemptedapi + * [Preview API] + * + * @param {Contracts.ServiceEndpoint} endpoint + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} endpointId + * @return IPromise + */ + createServiceEndpoint(endpoint: Contracts.ServiceEndpoint, scopeIdentifier: string, endpointId: string): IPromise; + /** + * @exemptedapi + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} endpointId + * @return IPromise + */ + deleteServiceEndpoint(scopeIdentifier: string, endpointId: string): IPromise; + /** + * @exemptedapi + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} endpointId + * @return IPromise + */ + getServiceEndpointDetails(scopeIdentifier: string, endpointId: string): IPromise; + /** + * @exemptedapi + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} type + * @param {string[]} authSchemes + * @param {string[]} endpointIds + * @return IPromise + */ + getServiceEndpoints(scopeIdentifier: string, type?: string, authSchemes?: string[], endpointIds?: string[]): IPromise; + /** + * @exemptedapi + * [Preview API] + * + * @param {string} scopeIdentifier - The project GUID to scope the request + * @param {string} type + * @param {string} scheme + * @return IPromise + */ + getServiceEndpointTypes(scopeIdentifier: string, type?: string, scheme?: string): IPromise; + /** + * @param {Contracts.TaskAgentSession} session + * @param {number} poolId + * @return IPromise + */ + createAgentSession(session: Contracts.TaskAgentSession, poolId: number): IPromise; + /** + * @param {number} poolId + * @param {string} sessionId + * @return IPromise + */ + deleteAgentSession(poolId: number, sessionId: string): IPromise; + /** + * @param {string} taskId + * @return IPromise + */ + deleteTaskDefinition(taskId: string): IPromise; + /** + * @param {string} taskId + * @param {string} versionString + * @param {string[]} visibility + * @param {boolean} scopeLocal + * @return IPromise + */ + getTaskContentZip(taskId: string, versionString: string, visibility?: string[], scopeLocal?: boolean): IPromise; + /** + * @param {string} taskId + * @param {string} versionString + * @param {string[]} visibility + * @param {boolean} scopeLocal + * @return IPromise + */ + getTaskDefinition(taskId: string, versionString: string, visibility?: string[], scopeLocal?: boolean): IPromise; + /** + * @param {string} taskId + * @param {string[]} visibility + * @param {boolean} scopeLocal + * @return IPromise + */ + getTaskDefinitions(taskId?: string, visibility?: string[], scopeLocal?: boolean): IPromise; + /** + * @param {{ [key: string] : string; }} userCapabilities + * @param {number} poolId + * @param {number} agentId + * @return IPromise + */ + updateAgentUserCapabilities(userCapabilities: { + [key: string]: string; + }, poolId: number, agentId: number): IPromise; +} +export class TaskAgentHttpClient extends TaskAgentHttpClient2_2 { + constructor(rootRequestPath: string); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return TaskAgentHttpClient2_1 + */ +export function getClient(): TaskAgentHttpClient2_1; +} +declare module "TFS/DistributedTask/TaskRestClient" { +import TFS_DistributedTask_Contracts = require("TFS/DistributedTask/Contracts"); +import VSS_Common_Contracts = require("VSS/WebApi/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +/** + * @exemptedapi + */ +export class TaskHttpClient2_2 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @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 + * @return IPromise + */ + getPlanAttachments(scopeIdentifier: string, hubName: string, planId: string, type: string): IPromise; + /** + * [Preview API] + * + * @param {string} content - 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 + * @return IPromise + */ + createAttachment(content: string, scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string): IPromise; + /** + * [Preview API] + * + * @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 + * @return IPromise + */ + getAttachment(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string): IPromise; + /** + * [Preview API] + * + * @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 + * @return IPromise + */ + getAttachmentContent(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string): IPromise; + /** + * [Preview API] + * + * @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 + * @return IPromise + */ + getAttachments(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string): IPromise; + /** + * [Preview API] + * + * @param {VSS_Common_Contracts.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 + * @return IPromise + */ + appendTimelineRecordFeed(lines: VSS_Common_Contracts.VssJsonCollectionWrapperV, scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string): IPromise; + /** + * [Preview API] + * + * @param {string} content - 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 + * @return IPromise + */ + appendLogContent(content: string, scopeIdentifier: string, hubName: string, planId: string, logId: number): IPromise; + /** + * [Preview API] + * + * @param {TFS_DistributedTask_Contracts.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 + * @return IPromise + */ + createLog(log: TFS_DistributedTask_Contracts.TaskLog, scopeIdentifier: string, hubName: string, planId: string): IPromise; + /** + * [Preview API] + * + * @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 + * @return IPromise + */ + getLog(scopeIdentifier: string, hubName: string, planId: string, logId: number, startLine?: number, endLine?: number): IPromise; + /** + * [Preview API] + * + * @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 + * @return IPromise + */ + getLogs(scopeIdentifier: string, hubName: string, planId: string): IPromise; + /** + * [Preview API] + * + * @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 + * @return IPromise + */ + getPlan(scopeIdentifier: string, hubName: string, planId: string): IPromise; + /** + * [Preview API] + * + * @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 + * @return IPromise + */ + getRecords(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, changeId?: number): IPromise; + /** + * [Preview API] + * + * @param {VSS_Common_Contracts.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 + * @return IPromise + */ + updateRecords(records: VSS_Common_Contracts.VssJsonCollectionWrapperV, scopeIdentifier: string, hubName: string, planId: string, timelineId: string): IPromise; + /** + * [Preview API] + * + * @param {TFS_DistributedTask_Contracts.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 + * @return IPromise + */ + createTimeline(timeline: TFS_DistributedTask_Contracts.Timeline, scopeIdentifier: string, hubName: string, planId: string): IPromise; + /** + * [Preview API] + * + * @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 + * @return IPromise + */ + deleteTimeline(scopeIdentifier: string, hubName: string, planId: string, timelineId: string): IPromise; + /** + * [Preview API] + * + * @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 + * @return IPromise + */ + getTimeline(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, changeId?: number, includeRecords?: boolean): IPromise; + /** + * [Preview API] + * + * @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 + * @return IPromise + */ + getTimelines(scopeIdentifier: string, hubName: string, planId: string): IPromise; +} +export class TaskHttpClient2_1 extends VSS_WebApi.VssHttpClient { + constructor(rootRequestPath: string); + /** + * @exemptedapi + * [Preview API] + * + * @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 + * @return IPromise + */ + getPlanAttachments(scopeIdentifier: string, hubName: string, planId: string, type: string): IPromise; + /** + * @exemptedapi + * [Preview API] + * + * @param {string} content - 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 + * @return IPromise + */ + createAttachment(content: string, scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string): IPromise; + /** + * @exemptedapi + * [Preview API] + * + * @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 + * @return IPromise + */ + getAttachment(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string): IPromise; + /** + * @exemptedapi + * [Preview API] + * + * @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 + * @return IPromise + */ + getAttachmentContent(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string): IPromise; + /** + * @exemptedapi + * [Preview API] + * + * @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 + * @return IPromise + */ + getAttachments(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string): IPromise; + /** + * @param {VSS_Common_Contracts.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 + * @return IPromise + */ + appendTimelineRecordFeed(lines: VSS_Common_Contracts.VssJsonCollectionWrapperV, scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string): IPromise; + /** + * @param {string} content - 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 + * @return IPromise + */ + appendLogContent(content: string, scopeIdentifier: string, hubName: string, planId: string, logId: number): IPromise; + /** + * @param {TFS_DistributedTask_Contracts.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 + * @return IPromise + */ + createLog(log: TFS_DistributedTask_Contracts.TaskLog, scopeIdentifier: string, hubName: string, planId: string): IPromise; + /** + * @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 + * @return IPromise + */ + getLog(scopeIdentifier: string, hubName: string, planId: string, logId: number, startLine?: number, endLine?: number): IPromise; + /** + * @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 + * @return IPromise + */ + getLogs(scopeIdentifier: string, hubName: string, planId: string): IPromise; + /** + * @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 + * @return IPromise + */ + getPlan(scopeIdentifier: string, hubName: string, planId: string): IPromise; + /** + * @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 + * @return IPromise + */ + getRecords(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, changeId?: number): IPromise; + /** + * @param {VSS_Common_Contracts.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 + * @return IPromise + */ + updateRecords(records: VSS_Common_Contracts.VssJsonCollectionWrapperV, scopeIdentifier: string, hubName: string, planId: string, timelineId: string): IPromise; + /** + * @param {TFS_DistributedTask_Contracts.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 + * @return IPromise + */ + createTimeline(timeline: TFS_DistributedTask_Contracts.Timeline, scopeIdentifier: string, hubName: string, planId: string): IPromise; + /** + * @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 + * @return IPromise + */ + deleteTimeline(scopeIdentifier: string, hubName: string, planId: string, timelineId: string): IPromise; /** - * Updates a team's name and/or description - * - * @param {Contracts.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. - * @return IPromise + * @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 + * @return IPromise */ - updateTeam(teamData: Contracts.WebApiTeam, projectId: string, teamId: string): IPromise; + getTimeline(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, changeId?: number, includeRecords?: boolean): IPromise; + /** + * @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 + * @return IPromise + */ + getTimelines(scopeIdentifier: string, hubName: string, planId: string): IPromise; } -export class CoreHttpClient extends CoreHttpClient2_2 { +export class TaskHttpClient extends TaskHttpClient2_2 { constructor(rootRequestPath: string); } /** * Gets an http client targeting the latest released version of the APIs. * - * @return CoreHttpClient2_1 + * @return TaskHttpClient2_1 */ -export function getClient(): CoreHttpClient2_1; +export function getClient(): TaskHttpClient2_1; } declare module "TFS/TestManagement/Contracts" { import TFS_Core_Contracts = require("TFS/Core/Contracts"); @@ -3587,6 +5635,16 @@ export interface AggregatedResultsDifference { increaseInPassedTests: number; increaseInTotalTests: number; } +export interface AggregatedResultsForBuild { + build: BuildReference; + /** + * This is tests execution duration in a build. + */ + duration: any; + resultsByOutcome: { + [key: number]: AggregatedResultsByOutcome; + }; +} export interface AggregatedResultsWithDetails { groupByField: string; resultsForGroup: TestResultsDetailsForGroup[]; @@ -3629,11 +5687,124 @@ export interface BuildCoverage { 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 */ @@ -3737,11 +5908,11 @@ export enum CustomTestFieldScope { } export enum CustomTestFieldType { Bit = 2, + DateTime = 4, Int = 8, Float = 6, - Guid = 14, - DateTime = 4, String = 12, + Guid = 14, } /** * This is a temporary class to provide the details for the test run environment. @@ -3823,6 +5994,10 @@ export enum ResultDetails { Iterations = 1, WorkItems = 2, } +export enum ResultObjectType { + TestSuite = 0, + TestPlan = 1, +} export enum ResultOutcome { Pass = 1, Fail = 2, @@ -4058,6 +6233,68 @@ export interface TestCaseResultUpdateModel { 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: VSS_Common_Contracts.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: { + [key: string]: string; + }; +} +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; @@ -4185,6 +6422,11 @@ export interface TestPlan { updatedDate: Date; url: string; } +export interface TestPlanCloneRequest { + cloneOptions: CloneOptions; + destinationTestPlan: TestPlan; + suiteIds: number[]; +} export interface TestPlansWithSelection { lastSelectedPlan: number; lastSelectedSuite: number; @@ -4269,8 +6511,16 @@ export interface TestResultParameterModel { } export interface TestResultsDetailsForGroup { groupByValue: string; - results: TestCaseResult[]; - resultsCountByOutcome: AggregatedResultsByOutcome[]; + ids: TestCaseResultIdentifier[]; + resultsCountByOutcome: { + [key: number]: AggregatedResultsByOutcome; + }; +} +export interface TestResultTrendFilter { + branchNames: string[]; + definitionIds: number[]; + sourceWorkflow: string; + testRunTitles: string[]; } export interface TestRun { build: ShallowReference; @@ -4423,6 +6673,41 @@ export interface TestSuite { testCasesUrl: 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; @@ -4439,6 +6724,9 @@ export var TypeInfo: { AggregatedResultsDifference: { fields: any; }; + AggregatedResultsForBuild: { + fields: any; + }; AggregatedResultsWithDetails: { fields: any; }; @@ -4469,6 +6757,23 @@ export var TypeInfo: { 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; }; @@ -4506,11 +6811,11 @@ export var TypeInfo: { CustomTestFieldType: { enumValues: { "bit": number; + "dateTime": number; "int": number; "float": number; - "guid": number; - "dateTime": number; "string": number; + "guid": number; }; }; DtlEnvironmentDetails: { @@ -4559,6 +6864,12 @@ export var TypeInfo: { "workItems": number; }; }; + ResultObjectType: { + enumValues: { + "testSuite": number; + "testPlan": number; + }; + }; ResultOutcome: { enumValues: { "pass": number; @@ -4626,6 +6937,15 @@ export var TypeInfo: { TestCaseResultUpdateModel: { fields: any; }; + TestConfiguration: { + fields: any; + }; + TestConfigurationState: { + enumValues: { + "active": number; + "inactive": number; + }; + }; TestEnvironment: { fields: any; }; @@ -4663,6 +6983,9 @@ export var TypeInfo: { TestPlan: { fields: any; }; + TestPlanCloneRequest: { + fields: any; + }; TestPlansWithSelection: { fields: any; }; @@ -4687,6 +7010,9 @@ export var TypeInfo: { TestResultsDetailsForGroup: { fields: any; }; + TestResultTrendFilter: { + fields: any; + }; TestRun: { fields: any; }; @@ -4726,6 +7052,12 @@ export var TypeInfo: { TestSuite: { fields: any; }; + TestSuiteCloneRequest: { + fields: any; + }; + TestVariable: { + fields: any; + }; WorkItemReference: { fields: any; }; @@ -4842,6 +7174,48 @@ export class TestHttpClient2_2 extends VSS_WebApi.VssHttpClient { * @return IPromise */ getTestRunCodeCoverage(project: string, runId: number, flags: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TestConfiguration} testConfiguration + * @param {string} project - Project ID or project name + * @return IPromise + */ + createTestConfiguration(testConfiguration: Contracts.TestConfiguration, project: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} testConfigurationId + * @return IPromise + */ + deleteTestConfiguration(project: string, testConfigurationId: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} testConfigurationId + * @return IPromise + */ + getTestConfigurationById(project: string, testConfigurationId: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getTestConfigurations(project: string, skip?: number, top?: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TestConfiguration} testConfiguration + * @param {string} project - Project ID or project name + * @param {number} testConfigurationId + * @return IPromise + */ + updateTestConfiguration(testConfiguration: Contracts.TestConfiguration, project: string, testConfigurationId: number): IPromise; /** * [Preview API] * @@ -4866,6 +7240,15 @@ export class TestHttpClient2_2 extends VSS_WebApi.VssHttpClient { * @return IPromise */ getTestRunLogs(project: string, runId: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} operationId + * @param {boolean} includeDetails + * @return IPromise + */ + getPlanCloneInformation(project: string, operationId: number, includeDetails?: boolean): IPromise; /** * [Preview API] * @@ -4903,6 +7286,15 @@ export class TestHttpClient2_2 extends VSS_WebApi.VssHttpClient { * @return IPromise */ updateTestPlan(planUpdateModel: Contracts.PlanUpdateModel, project: string, planId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TestPlanCloneRequest} cloneRequestBody + * @param {string} project - Project ID or project name + * @param {number} sourcePlanId + * @return IPromise + */ + cloneTestPlan(cloneRequestBody: Contracts.TestPlanCloneRequest, project: string, sourcePlanId: number): IPromise; /** * [Preview API] * @@ -5096,12 +7488,12 @@ export class TestHttpClient2_2 extends VSS_WebApi.VssHttpClient { /** * [Preview API] * - * @param {string} project - Project ID or project name * @param {Contracts.TestCaseResultIdentifier[]} ids + * @param {string} project - Project ID or project name * @param {string[]} fields * @return IPromise */ - getTestResultsByIds(project: string, ids: Contracts.TestCaseResultIdentifier[], fields?: string[]): IPromise; + getTestResultsByIds(ids: Contracts.TestCaseResultIdentifier[], project: string, fields: string[]): IPromise; /** * [Preview API] * @@ -5147,6 +7539,15 @@ export class TestHttpClient2_2 extends VSS_WebApi.VssHttpClient { * @return IPromise */ queryTestResultTrendReport(project: string, testRunId: number, testResultId: number, historyDays?: number, top?: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TestResultTrendFilter} filter + * @param {string} project - Project ID or project name + * @param {number} buildCount + * @return IPromise + */ + queryResultTrendForBuild(filter: Contracts.TestResultTrendFilter, project: string, buildCount?: number): IPromise; /** * [Preview API] * @@ -5214,6 +7615,15 @@ export class TestHttpClient2_2 extends VSS_WebApi.VssHttpClient { * @return IPromise */ updateTestRun(runUpdateModel: Contracts.RunUpdateModel, project: string, runId: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} operationId + * @param {boolean} includeDetails + * @return IPromise + */ + getSuiteCloneInformation(project: string, operationId: number, includeDetails?: boolean): IPromise; /** * [Preview API] * @@ -5296,13 +7706,23 @@ export class TestHttpClient2_2 extends VSS_WebApi.VssHttpClient { /** * [Preview API] * - * @param {Contracts.SuiteUpdateModel} suiteUpdateModel + * @param {Contracts.SuiteUpdateModel} suiteUpdateModel + * @param {string} project - Project ID or project name + * @param {number} planId + * @param {number} suiteId + * @return IPromise + */ + updateTestSuite(suiteUpdateModel: Contracts.SuiteUpdateModel, project: string, planId: number, suiteId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TestSuiteCloneRequest} cloneRequestBody * @param {string} project - Project ID or project name + * @param {number} sourceSuiteId * @param {number} planId - * @param {number} suiteId - * @return IPromise + * @return IPromise */ - updateTestSuite(suiteUpdateModel: Contracts.SuiteUpdateModel, project: string, planId: number, suiteId: number): IPromise; + cloneTestSuite(cloneRequestBody: Contracts.TestSuiteCloneRequest, project: string, sourceSuiteId: number, planId: number): IPromise; /** * [Preview API] * @@ -5352,6 +7772,48 @@ export class TestHttpClient2_2 extends VSS_WebApi.VssHttpClient { * @return IPromise */ getTestSettingsById(project: string, testSettingsId: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TestVariable} testVariable + * @param {string} project - Project ID or project name + * @return IPromise + */ + createTestVariable(testVariable: Contracts.TestVariable, project: string): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} testVariableId + * @return IPromise + */ + deleteTestVariable(project: string, testVariableId: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} testVariableId + * @return IPromise + */ + getTestVariable(project: string, testVariableId: number): IPromise; + /** + * [Preview API] + * + * @param {string} project - Project ID or project name + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getTestVariables(project: string, skip?: number, top?: number): IPromise; + /** + * [Preview API] + * + * @param {Contracts.TestVariable} testVariable + * @param {string} project - Project ID or project name + * @param {number} testVariableId + * @return IPromise + */ + updateTestVariable(testVariable: Contracts.TestVariable, project: string, testVariableId: number): IPromise; } export class TestHttpClient2_1 extends VSS_WebApi.VssHttpClient { static serviceInstanceId: string; @@ -5469,6 +7931,38 @@ export class TestHttpClient2_1 extends VSS_WebApi.VssHttpClient { * @return IPromise */ getTestRunCodeCoverage(project: string, runId: number, flags: number): IPromise; + /** + * @param {Contracts.TestConfiguration} testConfiguration + * @param {string} project - Project ID or project name + * @return IPromise + */ + createTestConfiguration(testConfiguration: Contracts.TestConfiguration, project: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} testConfigurationId + * @return IPromise + */ + deleteTestConfiguration(project: string, testConfigurationId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} testConfigurationId + * @return IPromise + */ + getTestConfigurationById(project: string, testConfigurationId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getTestConfigurations(project: string, skip?: number, top?: number): IPromise; + /** + * @param {Contracts.TestConfiguration} testConfiguration + * @param {string} project - Project ID or project name + * @param {number} testConfigurationId + * @return IPromise + */ + updateTestConfiguration(testConfiguration: Contracts.TestConfiguration, project: string, testConfigurationId: number): IPromise; /** * @exemptedapi * [Preview API] @@ -5496,6 +7990,13 @@ export class TestHttpClient2_1 extends VSS_WebApi.VssHttpClient { * @return IPromise */ getTestRunLogs(project: string, runId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} operationId + * @param {boolean} includeDetails + * @return IPromise + */ + getPlanCloneInformation(project: string, operationId: number, includeDetails?: boolean): IPromise; /** * @param {Contracts.PlanUpdateModel} testPlan * @param {string} project - Project ID or project name @@ -5525,6 +8026,13 @@ export class TestHttpClient2_1 extends VSS_WebApi.VssHttpClient { * @return IPromise */ updateTestPlan(planUpdateModel: Contracts.PlanUpdateModel, project: string, planId: number): IPromise; + /** + * @param {Contracts.TestPlanCloneRequest} cloneRequestBody + * @param {string} project - Project ID or project name + * @param {number} sourcePlanId + * @return IPromise + */ + cloneTestPlan(cloneRequestBody: Contracts.TestPlanCloneRequest, project: string, sourcePlanId: number): IPromise; /** * @param {string} project - Project ID or project name * @param {number} planId @@ -5694,12 +8202,12 @@ export class TestHttpClient2_1 extends VSS_WebApi.VssHttpClient { * @exemptedapi * [Preview API] * - * @param {string} project - Project ID or project name * @param {Contracts.TestCaseResultIdentifier[]} ids + * @param {string} project - Project ID or project name * @param {string[]} fields * @return IPromise */ - getTestResultsByIds(project: string, ids: Contracts.TestCaseResultIdentifier[], fields?: string[]): IPromise; + getTestResultsByIds(ids: Contracts.TestCaseResultIdentifier[], project: string, fields: string[]): IPromise; /** * @exemptedapi * [Preview API] @@ -5760,6 +8268,16 @@ export class TestHttpClient2_1 extends VSS_WebApi.VssHttpClient { * @return IPromise */ queryTestResultTrendReport(project: string, testRunId: number, testResultId: number, historyDays?: number, top?: number): IPromise; + /** + * @exemptedapi + * [Preview API] + * + * @param {Contracts.TestResultTrendFilter} filter + * @param {string} project - Project ID or project name + * @param {number} buildCount + * @return IPromise + */ + queryResultTrendForBuild(filter: Contracts.TestResultTrendFilter, project: string, buildCount?: number): IPromise; /** * @param {string} project - Project ID or project name * @param {number} runId @@ -5816,6 +8334,13 @@ export class TestHttpClient2_1 extends VSS_WebApi.VssHttpClient { * @return IPromise */ getTestRunsByQuery(query: Contracts.QueryModel, project: string, includeRunDetails?: boolean, skip?: number, top?: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} operationId + * @param {boolean} includeDetails + * @return IPromise + */ + getSuiteCloneInformation(project: string, operationId: number, includeDetails?: boolean): IPromise; /** * @param {string} project - Project ID or project name * @param {number} planId @@ -5887,6 +8412,14 @@ export class TestHttpClient2_1 extends VSS_WebApi.VssHttpClient { * @return IPromise */ updateTestSuite(suiteUpdateModel: Contracts.SuiteUpdateModel, project: string, planId: number, suiteId: number): IPromise; + /** + * @param {Contracts.TestSuiteCloneRequest} cloneRequestBody + * @param {string} project - Project ID or project name + * @param {number} sourceSuiteId + * @param {number} planId + * @return IPromise + */ + cloneTestSuite(cloneRequestBody: Contracts.TestSuiteCloneRequest, project: string, sourceSuiteId: number, planId: number): IPromise; /** * @param {number} testCaseId * @return IPromise @@ -5930,6 +8463,38 @@ export class TestHttpClient2_1 extends VSS_WebApi.VssHttpClient { * @return IPromise */ getTestSettingsById(project: string, testSettingsId: number): IPromise; + /** + * @param {Contracts.TestVariable} testVariable + * @param {string} project - Project ID or project name + * @return IPromise + */ + createTestVariable(testVariable: Contracts.TestVariable, project: string): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} testVariableId + * @return IPromise + */ + deleteTestVariable(project: string, testVariableId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} testVariableId + * @return IPromise + */ + getTestVariable(project: string, testVariableId: number): IPromise; + /** + * @param {string} project - Project ID or project name + * @param {number} skip + * @param {number} top + * @return IPromise + */ + getTestVariables(project: string, skip?: number, top?: number): IPromise; + /** + * @param {Contracts.TestVariable} testVariable + * @param {string} project - Project ID or project name + * @param {number} testVariableId + * @return IPromise + */ + updateTestVariable(testVariable: Contracts.TestVariable, project: string, testVariableId: number): IPromise; } export class TestHttpClient extends TestHttpClient2_2 { constructor(rootRequestPath: string); @@ -6245,6 +8810,7 @@ export interface GitPullRequest { codeReviewId: number; commits: GitCommitRef[]; completionOptions: GitPullRequestCompletionOptions; + completionQueueTime: Date; createdBy: VSS_Common_Contracts.IdentityRef; creationDate: Date; description: string; @@ -6263,6 +8829,7 @@ export interface GitPullRequest { title: string; upgraded: boolean; url: string; + workItemRefs: VSS_Common_Contracts.ResourceRef[]; } export interface GitPullRequestCompletionOptions { deleteSourceBranch: boolean; @@ -6549,6 +9116,12 @@ export enum GitStatusState { Failure = 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) @@ -6850,8 +9423,16 @@ export interface TfvcHistoryEntry extends HistoryEntry { 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; } /** @@ -7022,8 +9603,21 @@ export interface VersionControlProjectInfo { 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: { @@ -7209,6 +9803,9 @@ export var TypeInfo: { "error": number; }; }; + GitSuggestion: { + fields: any; + }; GitTargetVersionDescriptor: { fields: any; }; @@ -7405,6 +10002,7 @@ export var TypeInfo: { enumValues: { "none": number; "oneLevel": number; + "oneLevelPlusNestedEmptyFolders": number; "full": number; }; }; @@ -7737,9 +10335,10 @@ export class GitHttpClient2_2 extends VSS_WebApi.VssHttpClient { * @param {number} skip * @param {number} top * @param {boolean} includeCommits + * @param {boolean} includeWorkItemRefs * @return IPromise */ - getPullRequest(repositoryId: string, pullRequestId: number, project?: string, maxCommentLength?: number, skip?: number, top?: number, includeCommits?: boolean): IPromise; + getPullRequest(repositoryId: string, pullRequestId: number, project?: string, maxCommentLength?: number, skip?: number, top?: number, includeCommits?: boolean, includeWorkItemRefs?: boolean): IPromise; /** * [Preview API] Query for pull requests * @@ -7887,6 +10486,14 @@ export class GitHttpClient2_2 extends VSS_WebApi.VssHttpClient { * @return IPromise */ getStatuses(commitId: string, repositoryId: string, project?: string, top?: number, skip?: number): IPromise; + /** + * [Preview API] Retrieve a set of suggestions (including a pull request suggestion). + * + * @param {string} repositoryId + * @param {string} project - Project ID or project name + * @return IPromise + */ + getSuggestions(repositoryId: string, project?: string): IPromise; /** * [Preview API] * @@ -8195,9 +10802,10 @@ export class GitHttpClient2_1 extends VSS_WebApi.VssHttpClient { * @param {number} skip * @param {number} top * @param {boolean} includeCommits + * @param {boolean} includeWorkItemRefs * @return IPromise */ - getPullRequest(repositoryId: string, pullRequestId: number, project?: string, maxCommentLength?: number, skip?: number, top?: number, includeCommits?: boolean): IPromise; + getPullRequest(repositoryId: string, pullRequestId: number, project?: string, maxCommentLength?: number, skip?: number, top?: number, includeCommits?: boolean, includeWorkItemRefs?: boolean): IPromise; /** * Query for pull requests * @@ -8389,6 +10997,31 @@ export class GitHttpClient extends GitHttpClient2_2 { */ export function getClient(): GitHttpClient2_1; } +declare module "TFS/VersionControl/Services" { +import Contracts_Platform = require("VSS/Common/Contracts/Platform"); +/** +* Host service for common code actions +*/ +export interface IVersionControlActionService { + /** Launches create branch dialog + * @param workItemIds The work item ids to link to the newly created branch + */ + beginLaunchCreateBranchDialog(workItemIds: number[]): IPromise; + /** Features required for actions, the actions will not work as desired when users do not have license for the listed features. */ + requiredFeaturesForActions?: string[]; +} +/** +* Host service for version control actions +*/ +export module VersionControlActionService { + var contributionId: string; + var fullyQualifiedContributionId: string; + /** Get an instance of the code action service + * @param webContext Optional web context to scope the service to + */ + function getService(webContext?: Contracts_Platform.WebContext): IPromise; +} +} declare module "TFS/VersionControl/TfvcRestClient" { import TFS_VersionControl_Contracts = require("TFS/VersionControl/Contracts"); import VSS_WebApi = require("VSS/WebApi/RestClient"); @@ -8937,6 +11570,96 @@ export interface ChangeListSourceItemContext { changeList: VCContracts.ChangeList | VCContracts.ChangeList; } } +declare module "TFS/WorkItemTracking/BatchRestClient" { +import VSS_WebApi = require("VSS/WebApi/RestClient"); +/** +* Interface for the Json request message +*/ +export interface JsonHttpRequest { + /** + * HTTP verb. + */ + method: string; + /** + * Uri of the resource to be invoked. + */ + uri: string; + /** + * Dictionary of the headers to passed along. + */ + headers: IDictionaryStringTo; + /** + * Request body. + */ + body?: any; +} +/** +* Interface for the Json response message +*/ +export interface JsonHttpResponse { + /** + * Response code. + */ + code: number; + /** + * Dictionary of the headers to passed along. + */ + headers?: IDictionaryStringTo; + /** + * Request body. + */ + body?: any; +} +/** +* Interface for the Json response message +*/ +export interface JsonHttpBatchResponse { + /** + * The number of response objects batched together. + */ + count: number; + /** + * Collection of the responses. + */ + value: JsonHttpResponse[]; +} +/** + * @exemptedapi + */ +export class WorkItemTrackingHttpBatchClient extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {number[]} ids + * @return IPromise + */ + destroyWorkItemsBatch(ids: number[]): IPromise; + /** + * [Preview API] + * + * @param {number[]} ids + * @return IPromise + */ + restoreWorkItemsBatch(ids: number[]): IPromise; + /** + * [Preview API] + * + * @param {number[]} ids + * @return IPromise + */ + deleteWorkItemsBatch(ids: number[]): IPromise; + private _createBatchRequest(ids, httpMethod, resource, body?); + private _beginBatchRequest(requests); +} +/** + * Gets an http client targeting the latest released version of the APIs. + * + * @return WorkItemTrackingHttpBatchClient + */ +export function getClient(): WorkItemTrackingHttpBatchClient; +} declare module "TFS/WorkItemTracking/Contracts" { export interface AttachmentReference { id: string; @@ -9076,6 +11799,7 @@ export interface ReportingWorkItemRevisionsFilter { export interface StreamedBatch { isLastBatch: boolean; nextLink: string; + nextWatermark: number; values: T[]; } export enum TemplateType { @@ -9107,6 +11831,7 @@ export interface WorkItemClassificationNode extends WorkItemTrackingResource { }; children: WorkItemClassificationNode[]; id: number; + identifier: string; name: string; structureType: TreeNodeStructureType; } @@ -9722,6 +12447,14 @@ export class WorkItemTrackingHttpClient2_2 extends VSS_WebApi.VssHttpClient { * @return IPromise */ createField(field: ProcessDefinitionsContracts.FieldModel, processId: string): IPromise; + /** + * [Preview API] + * + * @param {string} processId + * @param {string} field + * @return IPromise + */ + deleteField(processId: string, field: string): IPromise; /** * [Preview API] * @@ -9840,6 +12573,14 @@ export class WorkItemTrackingHttpClient2_1 extends VSS_WebApi.VssHttpClient { * @return IPromise */ createField(field: ProcessDefinitionsContracts.FieldModel, processId: string): IPromise; + /** + * [Preview API] + * + * @param {string} processId + * @param {string} field + * @return IPromise + */ + deleteField(processId: string, field: string): IPromise; /** * [Preview API] * @@ -9941,15 +12682,21 @@ import VSS_WebApi = require("VSS/WebApi/RestClient"); export class WorkItemTrackingHttpClient2_2 extends VSS_WebApi.VssHttpClient { static serviceInstanceId: string; constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {string} processId + * @return IPromise + */ + getFields(processId: string): IPromise; /** * [Preview API] * * @param {string} processId * @param {string} witRefName - * @param {boolean} available * @return IPromise */ - getFields(processId: string, witRefName: string, available?: boolean): IPromise; + getWorkItemTypeFields(processId: string, witRefName: string): IPromise; } /** * @exemptedapi @@ -9957,15 +12704,21 @@ export class WorkItemTrackingHttpClient2_2 extends VSS_WebApi.VssHttpClient { export class WorkItemTrackingHttpClient2_1 extends VSS_WebApi.VssHttpClient { static serviceInstanceId: string; constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {string} processId + * @return IPromise + */ + getFields(processId: string): IPromise; /** * [Preview API] * * @param {string} processId * @param {string} witRefName - * @param {boolean} available * @return IPromise */ - getFields(processId: string, witRefName: string, available?: boolean): IPromise; + getWorkItemTypeFields(processId: string, witRefName: string): IPromise; } export class WorkItemTrackingHttpClient extends WorkItemTrackingHttpClient2_2 { constructor(rootRequestPath: string); @@ -10146,14 +12899,6 @@ export class WorkItemTrackingHttpClient2_2 extends VSS_WebApi.VssHttpClient { * @return IPromise */ destroyWorkItem(id: number, project?: string): IPromise; - /** - * [Preview API] - * - * @param {number[]} ids - * @param {string} project - Project ID or project name - * @return IPromise - */ - destroyWorkItems(ids: number[], project?: string): IPromise; /** * [Preview API] * @@ -10179,15 +12924,6 @@ export class WorkItemTrackingHttpClient2_2 extends VSS_WebApi.VssHttpClient { * @return IPromise */ restoreWorkItem(payload: Contracts.WorkItemDeleteUpdate, id: number, project?: string): IPromise; - /** - * [Preview API] - * - * @param {Contracts.WorkItemDeleteUpdate} payload - * @param {number[]} ids - * @param {string} project - Project ID or project name - * @return IPromise - */ - restoreWorkItems(payload: Contracts.WorkItemDeleteUpdate, ids: number[], project?: string): IPromise; /** * [Preview API] Returns a fully hydrated work item for the requested revision * @@ -10303,14 +13039,6 @@ export class WorkItemTrackingHttpClient2_2 extends VSS_WebApi.VssHttpClient { * @return IPromise */ deleteWorkItem(id: number, destroy?: boolean): IPromise; - /** - * [Preview API] - * - * @param {number[]} ids - * @param {boolean} destroy - * @return IPromise - */ - deleteWorkItems(ids: number[], destroy?: boolean): IPromise; /** * [Preview API] Returns a single work item * @@ -10565,15 +13293,6 @@ export class WorkItemTrackingHttpClient2_1 extends VSS_WebApi.VssHttpClient { * @return IPromise */ destroyWorkItem(id: number, project?: string): IPromise; - /** - * @exemptedapi - * [Preview API] - * - * @param {number[]} ids - * @param {string} project - Project ID or project name - * @return IPromise - */ - destroyWorkItems(ids: number[], project?: string): IPromise; /** * @exemptedapi * [Preview API] @@ -10602,16 +13321,6 @@ export class WorkItemTrackingHttpClient2_1 extends VSS_WebApi.VssHttpClient { * @return IPromise */ restoreWorkItem(payload: Contracts.WorkItemDeleteUpdate, id: number, project?: string): IPromise; - /** - * @exemptedapi - * [Preview API] - * - * @param {Contracts.WorkItemDeleteUpdate} payload - * @param {number[]} ids - * @param {string} project - Project ID or project name - * @return IPromise - */ - restoreWorkItems(payload: Contracts.WorkItemDeleteUpdate, ids: number[], project?: string): IPromise; /** * Returns a fully hydrated work item for the requested revision * @@ -10723,12 +13432,6 @@ export class WorkItemTrackingHttpClient2_1 extends VSS_WebApi.VssHttpClient { * @return IPromise */ deleteWorkItem(id: number, destroy?: boolean): IPromise; - /** - * @param {number[]} ids - * @param {boolean} destroy - * @return IPromise - */ - deleteWorkItems(ids: number[], destroy?: boolean): IPromise; /** * Returns a single work item * @@ -11166,7 +13869,7 @@ export interface TeamFieldValue { value: string; } /** - * Essentially a collection of tem field values + * Essentially a collection of team field values */ export interface TeamFieldValues extends TeamSettingsDataContractBase { /** diff --git a/typings/vss.d.ts b/typings/vss.d.ts index ccba06e..4e504a1 100644 --- a/typings/vss.d.ts +++ b/typings/vss.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Microsoft Visual Studio Services v92.20151216.1125 +// Type definitions for Microsoft Visual Studio Services v94.20160202.0901 // Project: http://www.visualstudio.com/integrate/extensions/overview // Definitions by: Microsoft @@ -109,8 +109,6 @@ interface IPromise { */ then(onFulfill: (value: T) => U | void, onReject?: (reason: any) => U | void): IPromise; } -declare var Sys; - interface EventTarget { checked: boolean; nodeType: number; @@ -169,10 +167,6 @@ interface Window { vsSdkOnLoad:() => void; } -interface MSAjaxError extends Error { - popStackFrame: () => void; -} - interface TfsError extends Error { status?: string; stack?: string; @@ -533,6 +527,75 @@ interface IExternalDialog { updateOkButton(enabled: boolean); } +/** + * Represents a button used in IHostDialogService.openMessageDialog(). + */ +interface IMessageDialogButton { + /** + * Used as HTML id of the button. + */ + id: string; + /** + * Text to display on the button. + */ + text: string; + /** + * When true, the dialog's promise is rejected instead of resolved when this button is clicked. + */ + reject?: boolean; + /** + * Specifies how the button should look. + * Possible values: + * (undefined) - Default + * "warning" - Red + */ + style?: string; +} + +/** + * Used by IHostDialogService.openMessageDialog(). + */ +interface IOpenMessageDialogOptions { + /** + * Array of buttons to show. Default is [Button.Ok, Button.Cancel] + */ + buttons?: IMessageDialogButton[]; + /** + * Button to use when the user presses the Esc key. Default is the last button. + */ + escapeButton?: IMessageDialogButton; + /** + * If this is set, the user will be presented with a text box. Non-rejecting buttons will be disabled until the user types in this string. + */ + requiredTypedConfirmation?: string; + /** + * Text for the title bar of the dialog. Default is "Confirm". + */ + title?: string; + /** + * Width of dialog in px. + */ + width?: number; + /** + * Height of dialog in px. + */ + height?: number; + /** + * Use Bowtie styling. Default is true. + */ + useBowtieStyle?: boolean; +} + +/** + * Result returned when a MessageDialog is closed. + */ +interface IMessageDialogResult { + /** + * Button that was clicked to dismiss the dialog. + */ + button: IMessageDialogButton; +} + /** * Service which manages showing dialogs in the parent frame */ @@ -547,6 +610,33 @@ interface IHostDialogService { * @param postContent Optional data to post to the contribution endpoint. If not specified, a GET request will be performed. */ openDialog(contributionId: string, dialogOptions: IHostDialogOptions, contributionConfig?: Object, postContent?: Object): IPromise; + + /** + * Open a modal dialog in the host frame which will display the supplied message. + * @param message the message to display in the dialog. + * @param methodOptions options affecting the dialog + * @returns a promise that is resolved when the user accepts the dialog (Ok, Yes, any button with Button.reject===false), or rejected if the user does not (Cancel, No, any button with Button.reject===true). + */ + openMessageDialog(message: string, options?: IOpenMessageDialogOptions): IPromise; + + buttons: { + /** + * Localized Ok button. + */ + ok: IMessageDialogButton; + /** + * Localized Cancel button. + */ + cancel: IMessageDialogButton; + /** + * Localized Yes button. + */ + yes: IMessageDialogButton; + /** + * Localized No button. + */ + no: IMessageDialogButton; + } } /** @@ -808,7 +898,7 @@ interface IContributedTab { // Generated data for the following assemblies: // Microsoft.TeamFoundation.Server.WebAccess.Platform -// Microsoft.VisualStudio.Services.WebApi +// Microsoft.VisualStudio.Services.ExtensionManagement.WebApi //---------------------------------------------------------- @@ -1234,6 +1324,10 @@ interface ContributionType { * Contains lists of script and css references that need to be included on the page in order for the controls used by the page to work. */ interface CoreReferencesContext { + /** + * Core javascript bundle + */ + coreScriptsBundle: JavascriptFileReference; /** * Core javascript files referenced on a page */ @@ -1244,6 +1338,44 @@ interface CoreReferencesContext { stylesheets: StylesheetReference[]; } +/** +* Contextual information that data providers can examine when populating their data +*/ +interface DataProviderContext { + /** + * Generic property bag that contains context-specific properties that data providers can use when populating their data dictionary + */ + properties: { [key: string]: number; }; +} + +/** +* A query that can be issued for data provider data +*/ +interface DataProviderQuery { + /** + * Contextual information to pass to the data providers + */ + context: DataProviderContext; + /** + * The contribution ids of the data providers to resolve + */ + contributionIds: string[]; +} + +/** +* Result structure from calls to GetDataProviderData +*/ +interface DataProviderResult { + /** + * Property bag of data keyed off of the data provider contribution id + */ + data: { [key: string]: number; }; + /** + * List of data providers resolved in the data-provider query + */ + resolvedProviders: ResolvedDataProvider[]; +} + interface DaylightSavingsAdjustmentEntry { /** * Millisecond adjustment from UTC @@ -1318,12 +1450,85 @@ interface Extension { */ registrationId: string; scopes: string[]; + serviceInstanceType: string; /** * Version of this extension */ version: string; } +/** +* Audit log for an extension +*/ +interface ExtensionAuditLog { + /** + * Collection of audit log entries + */ + entries: ExtensionAuditLogEntry[]; + /** + * Extension that the change was made for + */ + extensionName: string; + /** + * Publisher that the extension is part of + */ + publisherName: string; +} + +/** +* An audit log entry for an extension +*/ +interface ExtensionAuditLogEntry { + /** + * Change that was made to extension + */ + auditAction: string; + /** + * Date at which the change was made + */ + auditDate: Date; + /** + * Extra information about the change + */ + comment: string; + /** + * Represents the user who made the change + */ + updatedBy: any; +} + +/** +* Represents a single collection for extension data documents +*/ +interface ExtensionDataCollection { + /** + * The name of the collection + */ + collectionName: string; + /** + * A list of documents belonging to the collection + */ + documents: any[]; + /** + * The type of the collection's scope, such as Default or User + */ + scopeType: string; + /** + * The value of the collection's scope, such as Current or Me + */ + scopeValue: string; +} + +/** +* Represents a query to receive a set of extension data collections +*/ +interface ExtensionDataCollectionQuery { + /** + * A list of collections to query + */ + collections: ExtensionDataCollection[]; +} + /** * Base class for an event callback for an extension */ @@ -1338,6 +1543,30 @@ interface ExtensionEventCallback { * Collection of event callbacks - endpoints called when particular extension events occur. */ interface ExtensionEventCallbackCollection { + /** + * Optional. Defines an endpoint that gets called via a POST reqeust to notify that an extension disable has occurred. + */ + postDisable: ExtensionEventCallback; + /** + * Optional. Defines an endpoint that gets called via a POST reqeust to notify that an extension enable has occurred. + */ + postEnable: ExtensionEventCallback; + /** + * Optional. Defines an endpoint that gets called via a POST reqeust to notify that an extension install has completed. + */ + postInstall: ExtensionEventCallback; + /** + * Optional. Defines an endpoint that gets called via a POST reqeust to notify that an extension uninstall has occurred. + */ + postUninstall: ExtensionEventCallback; + /** + * Optional. Defines an endpoint that gets called via a POST reqeust to notify that an extension update has occurred. + */ + postUpdate: ExtensionEventCallback; + /** + * Optional. Defines an endpoint that gets called via a POST reqeust to notify that an extension install is about to occur. Response indicates whether to proceed or abort. + */ + preInstall: ExtensionEventCallback; /** * For multi-version extensions, defines an endpoint that gets called via an OPTIONS request to determine the particular version of the extension to be used */ @@ -1390,6 +1619,62 @@ interface ExtensionManifest { * List of all oauth scopes required by this extension */ scopes: string[]; + /** + * The ServiceInstanceType(Guid) of the VSTS service that must be available to an account in order for the extension to be installed + */ + serviceInstanceType: string; +} + +/** +* A request for an extension (to be installed or have a license assigned) +*/ +interface ExtensionRequest { + /** + * Required message supplied if the request is rejected + */ + rejectMessage: string; + /** + * Date at which the request was made + */ + requestDate: Date; + /** + * Represents the user who made the request + */ + requestedBy: any; + /** + * Optional message supplied by the requester justifying the request + */ + requestMessage: string; + /** + * Represents the state of the request + */ + requestState: ExtensionRequestState; + /** + * Date at which the request was resolved + */ + resolveDate: Date; + /** + * Represents the user who resolved the request + */ + resolvedBy: any; +} + +/** +* Represents the state of an extension request +*/ +declare enum ExtensionRequestState { + /** + * The request has been opened, but not yet responded to + */ + Open = 0, + /** + * The request was accepted (extension installed or license assigned) + */ + Accepted = 1, + /** + * The request was rejected (extension not installed or license not assigned) + */ + Rejected = 2, } /** @@ -1398,7 +1683,7 @@ interface ExtensionManifest { interface ExtensionState { extensionId: string; extensionName: string; - flags: any; + flags: ExtensionStateFlags; lastUpdated: Date; /** * The time at which the version was last checked @@ -1411,6 +1696,40 @@ interface ExtensionState { version: string; } +/** +* States of an extension +*/ +declare enum ExtensionStateFlags { + /** + * No flags set + */ + None = 0, + /** + * Extension is disabled + */ + Disabled = 1, + /** + * Extension is a built in + */ + BuiltIn = 2, + /** + * Extension has multiple versions + */ + MultiVersion = 4, + /** + * Extension is not installed. This is for builtin extensions only and can not otherwise be set. + */ + UnInstalled = 8, + /** + * Error performing version check + */ + VersionCheckError = 16, + /** + * 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 = 32, +} + interface FeatureAvailabilityContext { featureStates: { [key: string]: boolean; }; } @@ -1501,6 +1820,46 @@ interface IdentityModel { uniqueName: string; } +/** +* Represents a VSTS extension along with its installation state +*/ +interface InstalledExtension { + baseUri: string; + contributions: Contribution[]; + contributionTypes: ContributionType[]; + eventCallbacks: ExtensionEventCallbackCollection; + extensionId: string; + extensionName: string; + flags: ExtensionFlags; + id: string; + /** + * Information about this particular installation of the extension + */ + installState: InstalledExtensionState; + language: string; + manifestVersion: any; + publisherId: string; + publisherName: string; + registrationId: string; + scopes: string[]; + serviceInstanceType: string; + version: string; +} + +/** +* The state of an installed extension +*/ +interface InstalledExtensionState { + /** + * States of an installed extension + */ + flags: ExtensionStateFlags; + /** + * The time at which this installation was last updated + */ + lastUpdated: Date; +} + /** * Reference to a javascript file to include on a page */ @@ -1546,6 +1905,10 @@ interface ModuleLoaderConfiguration { contributionPaths: { [key: string]: ContributionPath; }; paths: { [key: string]: string; }; shim: { [key: string]: ModuleLoaderShimConfiguration; }; + /** + * The maximum amount of time (in seconds) the AMD loader will wait for scripts to load. + */ + waitSeconds: number; } /** @@ -1676,12 +2039,46 @@ interface PageContext { webContext: WebContext; } -interface Scope { - description: string; - title: string; - value: string; -} - +/** +* A request for an extension (to be installed or have a license assigned) +*/ +interface RequestedExtension { + /** + * THe unique name of the extensions + */ + extensionName: string; + /** + * A list of each request for the extension + */ + extensionRequests: ExtensionRequest[]; + /** + * DisplayName of the publisher that owns the extension being published. + */ + publisherDisplayName: string; + /** + * Represents the Publisher of the requested extension + */ + publisherName: string; + /** + * The total number of requests for an extension + */ + requestCount: number; +} + +/** +* Entry for a specific data provider's resulting data +*/ +interface ResolvedDataProvider { + error: string; + id: string; +} + +interface Scope { + description: string; + title: string; + value: string; +} + /** * Holds a lookup of urls for different services (at different host levels) */ @@ -1787,64 +2184,52 @@ interface UserContext { } /** -* Web Access configuration data. This information is used to process requests on the server. This data is also placed in a json island on each page in order for JavaScript to know key configuration data required to things like construct proper urls +* Context information for all web access requests */ -interface WebAccessConfiguration { - /** - * Optional name of the client (e.g. TEE) hosting the page - */ - clientHost: string; - /** - * Current mail settings for TFS - */ - mailSettings: TfsMailSettings; +interface WebContext { + account: HostContext; /** - * Relative path to the _content path of the web application + * Information about the Collection used in the current request (may be null) */ - resourcesPath: string; + collection: HostContext; /** - * Relative path to the root of the web application + * Information about the current request context's host */ - rootPath: string; + host: ExtendedHostContext; /** - * Relative path to unversioned 3rd party static content + * Information about the project used in the current request (may be null) */ - staticRoot3rdParty: string; + project: ContextIdentifier; /** - * Relative path to versioned static content + * Information about the team used in the current request (may be null) */ - staticRootTfs: string; + team: TeamContext; /** - * Api-version for legacy rpc-style web access api controllers See WebApiVersionClient for the version coming from the client/browser. The return value is a positive whole number >= 1. + * Information about the current user */ - webApiVersion: string; + user: UserContext; } /** -* Context information for all web access requests +* Contextual data for web-page-related data providers about the originating (host/source) page */ -interface WebContext { - account: HostContext; - /** - * Information about the Collection used in the current request (may be null) - */ - collection: HostContext; +interface WebPageDataProviderPageSource { /** - * Information about the current request context's host + * The navigation context for the host page that is loading the data provider */ - host: ExtendedHostContext; + navigation: NavigationContext; /** - * Information about the project used in the current request (may be null) + * The project context for the host page that is loading the data provider */ project: ContextIdentifier; /** - * Information about the team used in the current request (may be null) + * The team context for the host page that is loading the data provider */ team: TeamContext; /** - * Information about the current user + * The url of the host page that is loading the data provider */ - user: UserContext; + url: string; } declare module XDM { @@ -4597,6 +4982,10 @@ export enum ContributionPathType { * Contains lists of script and css references that need to be included on the page in order for the controls used by the page to work. */ export interface CoreReferencesContext { + /** + * Core javascript bundle + */ + coreScriptsBundle: JavascriptFileReference; /** * Core javascript files referenced on a page */ @@ -4606,21 +4995,6 @@ export interface CoreReferencesContext { */ stylesheets: StylesheetReference[]; } -/** -* Result structure from calls to GetDataProviderData -*/ -export interface DataProviderResult { - /** - * Property bag of data keyed off of the data provider contribution id - */ - data: { - [key: string]: number; - }; - /** - * List of data providers resolved in the data-provider query - */ - resolvedProviders: ResolvedDataProvider[]; -} export interface DaylightSavingsAdjustmentEntry { /** * Millisecond adjustment from UTC @@ -4786,6 +5160,10 @@ export interface ModuleLoaderConfiguration { shim: { [key: string]: ModuleLoaderShimConfiguration; }; + /** + * The maximum amount of time (in seconds) the AMD loader will wait for scripts to load. + */ + waitSeconds: number; } /** * AMD javascript module loader shim configuration @@ -4912,13 +5290,6 @@ export interface PageContext { webContext: WebContext; } /** -* Entry for a specific data provider's resulting data -*/ -export interface ResolvedDataProvider { - error: string; - id: string; -} -/** * Holds a lookup of urls for different services (at different host levels) */ export interface ServiceLocations { @@ -5001,39 +5372,6 @@ export interface UserContext { uniqueName: string; } /** -* Web Access configuration data. This information is used to process requests on the server. This data is also placed in a json island on each page in order for JavaScript to know key configuration data required to things like construct proper urls -*/ -export interface WebAccessConfiguration { - /** - * Optional name of the client (e.g. TEE) hosting the page - */ - clientHost: string; - /** - * Current mail settings for TFS - */ - mailSettings: TfsMailSettings; - /** - * Relative path to the _content path of the web application - */ - resourcesPath: string; - /** - * Relative path to the root of the web application - */ - rootPath: string; - /** - * Relative path to unversioned 3rd party static content - */ - staticRoot3rdParty: string; - /** - * Relative path to versioned static content - */ - staticRootTfs: string; - /** - * Api-version for legacy rpc-style web access api controllers See WebApiVersionClient for the version coming from the client/browser. The return value is a positive whole number >= 1. - */ - webApiVersion: string; -} -/** * Context information for all web access requests */ export interface WebContext { @@ -5059,6 +5397,27 @@ export interface WebContext { */ user: UserContext; } +/** +* Contextual data for web-page-related data providers about the originating (host/source) page +*/ +export interface WebPageDataProviderPageSource { + /** + * The navigation context for the host page that is loading the data provider + */ + navigation: NavigationContext; + /** + * The project context for the host page that is loading the data provider + */ + project: ContextIdentifier; + /** + * The team context for the host page that is loading the data provider + */ + team: TeamContext; + /** + * The url of the host page that is loading the data provider + */ + url: string; +} export var TypeInfo: { AccessPointModel: { fields: any; @@ -5110,9 +5469,6 @@ export var TypeInfo: { CoreReferencesContext: { fields: any; }; - DataProviderResult: { - fields: any; - }; DaylightSavingsAdjustmentEntry: { fields: any; }; @@ -5176,9 +5532,6 @@ export var TypeInfo: { PageContext: { fields: any; }; - ResolvedDataProvider: { - fields: any; - }; ServiceLocations: { fields: any; }; @@ -5203,10 +5556,10 @@ export var TypeInfo: { UserContext: { fields: any; }; - WebAccessConfiguration: { + WebContext: { fields: any; }; - WebContext: { + WebPageDataProviderPageSource: { fields: any; }; }; @@ -5476,7 +5829,7 @@ export function getCssModuleUrl(modulePrefix: string, cssModulePath: string): st export function processContributedServiceContext(context: Contracts_Platform.ContributedServiceContext): void; } declare module "VSS/Contributions/Contracts" { -import VSS_Identities_Contracts = require("VSS/Identities/Contracts"); +import VSS_Common_Contracts = require("VSS/WebApi/Contracts"); /** * An individual contribution made by an extension */ @@ -5639,6 +5992,45 @@ export interface ContributionType extends ContributionBase { [key: string]: ContributionPropertyDescription; }; } +/** + * Contextual information that data providers can examine when populating their data + */ +export interface DataProviderContext { + /** + * Generic property bag that contains context-specific properties that data providers can use when populating their data dictionary + */ + properties: { + [key: string]: any; + }; +} +/** + * A query that can be issued for data provider data + */ +export interface DataProviderQuery { + /** + * Contextual information to pass to the data providers + */ + context: DataProviderContext; + /** + * The contribution ids of the data providers to resolve + */ + contributionIds: string[]; +} +/** + * Result structure from calls to GetDataProviderData + */ +export interface DataProviderResult { + /** + * Property bag of data keyed off of the data provider contribution id + */ + data: { + [key: string]: any; + }; + /** + * List of data providers resolved in the data-provider query + */ + resolvedProviders: ResolvedDataProvider[]; +} /** * Represents a VSTS "extension" which is a container for contributions and contribution types */ @@ -5677,28 +6069,47 @@ export interface Extension extends ExtensionManifest { version: string; } /** - * Depending on the event type, some or all of the fields will have valid values. Created: All fields will be filled in with the appropriate values. Updated: All fields will be filled in with the appropriate values. Deleted: PublisherName, ExtensionName, ExtensionId, Version Shared/Unshared: The only type where the HostId field will be used will be supplied, null for version will mean all versions. Disabled: This will be event type when an extension is being disabled for everyone that has it installed. Enabled: This will be event type when a disabled extension is re-enabled. All fields will be filled in with the appropriate values. + * Represents the state of an extension request */ -export interface ExtensionChangeEvent { - eventType: ExtensionEventType; - extensionId: string; - extensionName: string; - flags: number; - hostId: string; - publisherName: string; - version: string; +export interface ExtensionAuditAction { } /** - * Depending on the event type, some or all of the fields will have valid values. Created: All fields will be filled in with the appropriate values. Updated: All fields will be filled in with the appropriate values. Deleted: PublisherName, ExtensionName, ExtensionId, Version will be supplied, null for version will mean all versions. + * Audit log for an extension */ -export interface ExtensionChangeNotification { - eventType: ExtensionEventType; - extensionId: string; +export interface ExtensionAuditLog { + /** + * Collection of audit log entries + */ + entries: ExtensionAuditLogEntry[]; + /** + * Extension that the change was made for + */ extensionName: string; - flags: number; - hostId: string; + /** + * Publisher that the extension is part of + */ publisherName: string; - version: string; +} +/** + * An audit log entry for an extension + */ +export interface ExtensionAuditLogEntry { + /** + * Change that was made to extension + */ + auditAction: string; + /** + * Date at which the change was made + */ + auditDate: Date; + /** + * Extra information about the change + */ + comment: string; + /** + * Represents the user who made the change + */ + updatedBy: VSS_Common_Contracts.IdentityRef; } /** * Represents a single collection for extension data documents @@ -5772,43 +6183,6 @@ export interface ExtensionEventCallbackCollection { */ versionCheck: ExtensionEventCallback; } -export interface ExtensionEventCallbackData { - /** - * The id of the extenstion whose state is chaning. - */ - extensionId: string; - /** - * The operation causing a state change (install, uninstall, update, enable, disable). - */ - operation: ExtensionOperation; - /** - * The id of the extenstion whose state is chaning. - */ - publisherId: string; - /** - * The target host of the extension operation. - */ - target: HostContext; -} -export interface ExtensionEventCallbackResult { - /** - * Indicates whether to continue with the state change or abort. - */ - allow: boolean; - /** - * Message indicating reason for abort. - */ - message: string; -} -export enum ExtensionEventType { - ExtensionCreated = 1, - ExtensionUpdated = 2, - ExtensionDeleted = 3, - ExtensionShared = 4, - ExtensionUnshared = 5, - ExtensionDisabled = 6, - ExtensionEnabled = 7, -} export enum ExtensionFlags { /** * A built-in extension is installed for all VSTS accounts by default @@ -5851,114 +6225,45 @@ export interface ExtensionManifest { * List of all oauth scopes required by this extension */ scopes: string[]; + /** + * The ServiceInstanceType(Guid) of the VSTS service that must be available to an account in order for the extension to be installed + */ + serviceInstanceType: string; } -export enum ExtensionOperation { +/** + * A request for an extension (to be installed or have a license assigned) + */ +export interface ExtensionRequest { /** - * Extension is being installed into an account. + * Required message supplied if the request is rejected */ - PreInstall = 0, + rejectMessage: string; /** - * Extension is being enabled on an account. + * Date at which the request was made */ - PreEnable = 1, + requestDate: Date; /** - * Extension was installed into an account. + * Represents the user who made the request */ - PostInstall = 2, + requestedBy: VSS_Common_Contracts.IdentityRef; /** - * Extension was uninstalled from an account. + * Optional message supplied by the requester justifying the request */ - PostUninstall = 3, + requestMessage: string; /** - * Extension was enabled on an account. + * Represents the state of the request */ - PostEnable = 4, + requestState: ExtensionRequestState; /** - * Extension was enabled on an account. + * Date at which the request was resolved */ - PostDisable = 5, + resolveDate: Date; /** - * Extension was updated on an account. + * Represents the user who resolved the request */ - PostUpdate = 6, + resolvedBy: VSS_Common_Contracts.IdentityRef; } -/** - * 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, -} -/** - * A request for an extension (to be installed or have a license assigned) - */ -export interface ExtensionRequest { - /** - * Required message supplied if the request is rejected - */ - rejectMessage: string; - /** - * Date at which the request was made - */ - requestDate: Date; - /** - * Represents the user who made the request - */ - requestedBy: VSS_Identities_Contracts.Identity; - /** - * Optional message supplied by the requester justifying the request - */ - requestMessage: string; - /** - * Represents the state of the request - */ - requestState: ExtensionRequestState; - /** - * Date at which the request was resolved - */ - resolveDate: Date; - /** - * Represents the user who resolved the request - */ - resolvedBy: VSS_Identities_Contracts.Identity; -} -export enum ExtensionRequestState { +export enum ExtensionRequestState { /** * The request has been opened, but not yet responded to */ @@ -6018,20 +6323,6 @@ export enum ExtensionStateFlags { */ Trusted = 32, } -export interface HostContext { - /** - * The host identifier. - */ - id: string; - /** - * The host name. - */ - name: string; - /** - * The host uri. - */ - uri: string; -} /** * Represents a VSTS extension along with its installation state */ @@ -6079,6 +6370,13 @@ export interface RequestedExtension { */ requestCount: number; } +/** + * Entry for a specific data provider's resulting data + */ +export interface ResolvedDataProvider { + error: string; + id: string; +} export interface Scope { description: string; title: string; @@ -6101,23 +6399,6 @@ export interface SupportedExtension { */ version: string; } -/** - * 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 var TypeInfo: { Contribution: { fields: any; @@ -6152,43 +6433,38 @@ export var TypeInfo: { ContributionType: { fields: any; }; - Extension: { + DataProviderContext: { fields: any; }; - ExtensionChangeEvent: { + DataProviderQuery: { fields: any; }; - ExtensionChangeNotification: { + DataProviderResult: { fields: any; }; - ExtensionDataCollection: { + Extension: { fields: any; }; - ExtensionDataCollectionQuery: { + ExtensionAuditAction: { fields: any; }; - ExtensionEventCallback: { + ExtensionAuditLog: { fields: any; }; - ExtensionEventCallbackCollection: { + ExtensionAuditLogEntry: { + fields: any; + }; + ExtensionDataCollection: { fields: any; }; - ExtensionEventCallbackData: { + ExtensionDataCollectionQuery: { fields: any; }; - ExtensionEventCallbackResult: { + ExtensionEventCallback: { fields: any; }; - ExtensionEventType: { - enumValues: { - "extensionCreated": number; - "extensionUpdated": number; - "extensionDeleted": number; - "extensionShared": number; - "extensionUnshared": number; - "extensionDisabled": number; - "extensionEnabled": number; - }; + ExtensionEventCallbackCollection: { + fields: any; }; ExtensionFlags: { enumValues: { @@ -6199,31 +6475,6 @@ export var TypeInfo: { ExtensionManifest: { fields: any; }; - ExtensionOperation: { - enumValues: { - "preInstall": number; - "preEnable": number; - "postInstall": number; - "postUninstall": number; - "postEnable": number; - "postDisable": number; - "postUpdate": number; - }; - }; - ExtensionPolicy: { - fields: any; - }; - ExtensionPolicyFlags: { - enumValues: { - "none": number; - "private": number; - "public": number; - "preview": number; - "released": number; - "firstParty": number; - "all": number; - }; - }; ExtensionRequest: { fields: any; }; @@ -6248,9 +6499,6 @@ export var TypeInfo: { "trusted": number; }; }; - HostContext: { - fields: any; - }; InstalledExtension: { fields: any; }; @@ -6260,13 +6508,13 @@ export var TypeInfo: { RequestedExtension: { fields: any; }; - Scope: { + ResolvedDataProvider: { fields: any; }; - SupportedExtension: { + Scope: { fields: any; }; - UserExtensionPolicy: { + SupportedExtension: { fields: any; }; }; @@ -6360,6 +6608,13 @@ import VSS_WebApi = require("VSS/WebApi/RestClient"); */ export class ContributionsHttpClient2_2 extends VSS_WebApi.VssHttpClient { constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {Contracts.DataProviderQuery} query + * @return IPromise + */ + queryDataProviders(query: Contracts.DataProviderQuery): IPromise; /** * [Preview API] * @@ -7267,6 +7522,10 @@ export interface IComboOptions { * Css class applied to drop button when hovered. */ dropButtonHoverCss?: string; + /** + * Set to 'true' to disable selecting all text in the combobox when it gets focus from another app + */ + disableTextSelectOnFocus?: boolean; /** * Called when the text of the combo changes. */ @@ -7292,6 +7551,7 @@ export class ComboO extends Controls.Control ex } export class ConfirmationDialog extends ConfirmationDialogO { } -export interface CopyContentDialogOptions extends IModalDialogOptions { - dialogLabel?: string; - dialogLabelExtend?: any; - excludeTextPanel?: boolean; - copyAsHtml?: boolean; - data?: any; - textAreaCopyClass?: string; - pageHtml?: string; -} -export class CopyContentDialog extends ModalDialogO { - static enhancementTypeName: string; - private _$textArea; - constructor(options?: any); +/** + * Represents a button used in MessageDialog. + * + * Mirrored in VSS.SDK.Interfaces. + */ +export interface IMessageDialogButton { /** - * @param options + * Used as HTML id of the button. */ - initializeOptions(options?: any): void; + id: string; /** - * Initializes the dialog. + * Text to display on the button. */ - initialize(): void; + text: string; /** - * Initializes the dialog UI. + * When true, the dialog's promise is rejected instead of resolved when this button is clicked. */ - private _decorate(); - private _initializeRichEditor($container); + reject?: boolean; /** - * Initializes the text area panel - * - * @param $container The text area panel container. + * Specifies how the button should look. + * Possible values: + * (undefined) - Default + * "warning" - Red */ - private _initializeTextPanel($container); + style?: string; } /** - * Shows the specified dialog type using specified options. + * Used by MessageDialogO.showDialog(). * - * @param dialogType Type of the dialog to show. - * @param options Options of the dialog. - * @returns {Dialog}. + * Mirrored in VSS.SDK.Interfaces as IOpenMessageDialogOptions. */ -export function show(dialogType: new (options: any) => TDialog, options?: any): TDialog; -} -declare module "VSS/Controls/EditableGrid" { -import Combos = require("VSS/Controls/Combos"); -import Controls = require("VSS/Controls"); -import Grids = require("VSS/Controls/Grids"); -export class CellEditor extends Controls.BaseControl { - constructor(options: any); - initialize(): void; +export interface IShowMessageDialogOptions { + /** + * Array of buttons to show. Default is [Button.Ok, Button.Cancel] + */ + buttons?: IMessageDialogButton[]; + /** + * Button to use when the user presses the Esc key. Default is the last button. + */ + escapeButton?: IMessageDialogButton; + /** + * If this is set, the user will be presented with a text box. Non-rejecting buttons will be disabled until the user types in this string. + */ + requiredTypedConfirmation?: string; + /** + * Text for the title bar of the dialog. + */ + title?: string; + /** + * Width of dialog in px. + */ + width?: number; + /** + * Height of dialog in px. + */ + height?: number; + /** + * Use Bowtie styling. Default is true. + */ + useBowtieStyle?: boolean; +} +/** + * Result returned when a MessageDialog is closed. + * + * Mirrored in VSS.SDK.Interfaces. + */ +export interface IMessageDialogResult { + /** + * Button that was clicked to dismiss the dialog. + */ + button: IMessageDialogButton; +} +/** + * Used internally by MessageDialogO. + */ +export interface IMessageDialogOptions extends IDialogOptions { + buttons?: IMessageDialogButton[] | any; + escapeButton?: IMessageDialogButton; + requiredTypedConfirmation?: string; +} +/** + * Class for creating simple dialog boxes. Use MessageDialog.showDialog(). + */ +export class MessageDialogO extends DialogO { + private _deferred; + private _textbox; + initializeOptions(options?: TOptions): void; + initialize(): void; + private initializeTypedConfirmation(); + /** + * Returns a promise that is resolved or rejected when the dialog is closed. + */ + getPromise(): Q.Promise; + /** + * Show a MessageDialog. + * @param message the message to display in the dialog. If it's a string, the message is displayed as plain text (no html). For HTML display, pass in a jQuery object. + * @param methodOptions options affecting the dialog + * @returns a promise that is resolved when the user accepts the dialog (Ok, Yes, any button with Button.reject===false), or rejected if the user does not (Cancel, No, any button with Button.reject===true). + */ + static showMessageDialog(message: string | JQuery, methodOptions?: IShowMessageDialogOptions): Q.Promise; + onClose(e?: JQueryEventObject): any; + /** + * Returns an object suitable for initializing the given button for our parent Dialog. + * @param button + */ + private getButtonOptions(button); + static buttons: { + ok: IMessageDialogButton; + cancel: IMessageDialogButton; + yes: IMessageDialogButton; + no: IMessageDialogButton; + }; +} +export class MessageDialog extends MessageDialogO { +} +export interface CopyContentDialogOptions extends IModalDialogOptions { + dialogLabel?: string; + dialogLabelExtend?: any; + excludeTextPanel?: boolean; + copyAsHtml?: boolean; + data?: any; + textAreaCopyClass?: string; + pageHtml?: string; +} +export class CopyContentDialog extends ModalDialogO { + static enhancementTypeName: string; + private _$textArea; + constructor(options?: any); + /** + * @param options + */ + initializeOptions(options?: any): void; + /** + * Initializes the dialog. + */ + initialize(): void; + /** + * Initializes the dialog UI. + */ + private _decorate(); + private _initializeRichEditor($container); + /** + * Initializes the text area panel + * + * @param $container The text area panel container. + */ + private _initializeTextPanel($container); +} +/** + * Shows the specified dialog type using specified options. + * + * @param dialogType Type of the dialog to show. + * @param options Options of the dialog. + * @returns {Dialog}. + */ +export function show(dialogType: new (options: any) => TDialog, options?: any): TDialog; +/** + * Show a MessageDialog. + * @param message the message to display in the dialog. If it's a string, the message is displayed as plain text (no html). For HTML display, pass in a jQuery object. + * @param methodOptions options affecting the dialog + * @returns a promise that is resolved when the user accepts the dialog (Ok, Yes, any button with Button.reject===false), or rejected if the user does not (Cancel, No, any button with Button.reject===true). + */ +export function showMessageDialog(message: string | JQuery, options?: IShowMessageDialogOptions): Q.Promise; +} +declare module "VSS/Controls/EditableGrid" { +import Combos = require("VSS/Controls/Combos"); +import Controls = require("VSS/Controls"); +import Grids = require("VSS/Controls/Grids"); +export class CellEditor extends Controls.BaseControl { + constructor(options: any); + initialize(): void; getValue(): string; getDisplayValue(): string; setValue(value: string, doNotSavePrevious?: boolean): void; @@ -8530,6 +8827,7 @@ export interface IFilterControlOptions extends Controls.EnhancementOptions { enableRowAddRemove?: boolean; hideLogicalOperator?: boolean; hideOperatorHeader?: boolean; + propogateControlBlur?: boolean; } export class FilterControlO extends Controls.Control { static enhancementTypeName: string; @@ -8630,6 +8928,7 @@ export class FilterControlO extends Cont */ private _ungroupClick(e?, clauseInfo?); private _handleFilterModified(); + private _onControlBlurred(); } export class FilterControl extends FilterControlO { } @@ -8948,6 +9247,11 @@ export interface IGridOptions { openRowDetail?: any; suppressRedraw?: boolean; keepSelection?: boolean; + /** + * Specifies whether to use the modern bowtie styling (bowtie styles are in preview and subject to change). + * @defaultvalue false + */ + useBowtieStyle?: boolean; /** * @privateapi * Type of the formatter which is used for retrieving the content from the grid @@ -8965,6 +9269,15 @@ export interface IGridContextMenu { */ executeAction?: (args: any) => any; contributionIds?: string[]; + /** + * Specifies whether to use the modern bowtie styling (bowtie styles are in preview and subject to change). + * @defaultvalue false + */ + useBowtieStyle?: boolean; + /** + * Column index for the context menu, if using bowtie styling + */ + columnIndex?: number | string; } export interface IGridGutterOptions { /** @@ -9173,6 +9486,7 @@ export class GridO extends Controls.Control extends Controls.Control extends Controls.Control extends Controls.Control extends Controls.Control extends Controls.Control extends Controls.Control extends Controls.Control extends Controls.Control private _header; private _content; private _$toggleIcon; + private _isDisabled; /** * @param options */ @@ -11709,6 +12067,8 @@ export class CollapsiblePanel extends Controls.Control expand(): void; collapse(): void; toggleExpandedState(): boolean; + setDisabled(isDisabled: boolean): void; + isCollapsiblePanelDisabled(): Boolean; } /** * @publicapi @@ -11854,6 +12214,7 @@ export class RichEditor extends Controls.Control { static RESTORE_COMMAND: string; static MAXIMIZE_COMMAND: string; static IMAGE_AUTOFIT_SCALE_FACTOR: number; + static WATERMARK_CSS_CLASS: string; private _iframe; private _window; private _textArea; @@ -11951,7 +12312,7 @@ export class RichEditor extends Controls.Control { private _onDblClick(e?); private _onDocumentReady(); private _trySettingWaterMark(val); - private _clearWaterMark(); + private _clearWaterMark(preventClearingValue?); /** * @param e * @return @@ -11963,6 +12324,7 @@ export class RichEditor extends Controls.Control { */ private _onFocusOut(e?); private _onPaste(e?); + private _doesStringItemExist(items); private _getImageItem(items); private _getRandomFileName(fileType?); private _onFileReadComplete(e, fileType?); @@ -12108,7 +12470,7 @@ export class SearchBoxControl extends Controls.Control /** * Removes the search box and shows the search button instead. */ - deactivateSearch(): void; + deactivateSearch(deactivateSearchHandler?: boolean): void; protected _displaySearchInputBox(isVisible: boolean): void; private _clearInput(); private _createSearchInput(); @@ -12128,11 +12490,16 @@ export class SearchBoxControl extends Controls.Control */ private _handleFocus(e?); } +export interface IToggleSearchBoxControlOptions extends ISearchBoxControlOptions { + isDataSetComplete?: Function; +} /** * A search icon control. When click, it expands to input box control for search or filter. */ export class ToggleSearchBoxControl extends SearchBoxControl { private _$searchIconContainer; + private _isDataSetComplete; + constructor(options?: IToggleSearchBoxControlOptions); initializeOptions(options?: any): void; initialize(): void; /** @@ -12883,6 +13250,11 @@ export interface ITreeOptions { * Defines "draggable" options for drag and drop (see jQuery UI draggable options) */ draggable?: any; + /** + * Specifies whether to use the modern bowtie styling (bowtie styles are in preview and subject to change). + * @defaultvalue false + */ + useBowtieStyle?: boolean; } /** * @publicapi @@ -13881,6 +14253,7 @@ export function measurePerformance(action: Function, message: string, logLevel?: * 3) While debugging will still have flexibility to see the logs depending on the Log level */ export class Debug { + private static _noDebugPrompts; /** * Sets whether or not to display callers in the stack on assert failures. * @@ -14243,7 +14616,18 @@ import Service = require("VSS/Service"); * A host can be tha browser, an IDE (e.g. Eclipse, Visual Studio) */ export interface RunningDocument { + /** + * Method which returns true if the document is currently in a dirty-state which should block (prompt) attempts to navigate-away. + */ isDirty(): boolean; + /** + * (Optional) Callback method called before a save operation is performed on the document service + */ + beginSave?: (successCallback: IResultCallback, errorCallback?: IErrorCallback) => void; + /** + * (Optional) Callback method called to get the titles of the currently dirty items. + */ + getDirtyDocumentTitles?: (maxTitle?: number) => string[]; } export interface RunningDocumentsTableEntry { document: RunningDocument; @@ -14308,6 +14692,105 @@ export class DocumentService implements Service.ILocalService { export function getService(): DocumentService; export function getRunningDocumentsTable(): RunningDocumentsTable; } +declare module "VSS/Events/Handlers" { +/** +* Represents a collection of named events that event listeners can attach to +*/ +export class NamedEventCollection { + private _namedHandlers; + /** + * Adds an event handler to the list of handlers for the given event + * + * @param eventName the name of the event to subscribe to + * @param handler Event handler method to register + */ + subscribe(eventName: string, handler: IFunctionPPR): void; + /** + * Removes an event handler from the list of handlers for the given event + * + * @param eventName The name of the event to unsubscribe to + * @param handler Event handler method to remove + */ + unsubscribe(eventName: string, handler: IFunctionPPR): void; + /** + * Invoke the handlers that have subscribed to this event + * + * @param eventName Name of the event whose handlers to invoke + * @param sender The source that is triggering the event + * @param eventArgs Event-specific arguments + * @param handlerResultFilter Optional callback method to be able to break out of the handler invocation loop based on the return value of a handler. The filter should return true to break out of the loop. + */ + invokeHandlers(eventName: string, sender?: TSender, eventArgs?: TEventArgs, handlerResultFilter?: (result: any) => boolean): void; + private _getOrCreateHandlerList(eventName); +} +/** +* Represents a specific event that event listeners can attach to +*/ +export class Event { + private _handlers; + /** + * The list of handlers for this event + */ + getHandlers(): EventHandlerList; + /** + * Invoke the handlers that have subscribed to this event + * + * @param sender The source that is triggering the event + * @param eventArgs Event-specific arguments + * @param handlerResultFilter Optional callback method to be able to break out of the handler invocation loop based on the return value of a handler. The filter should return true to break out of the loop. + */ + invokeHandlers(sender: TSender, eventArgs: TEventArgs, handlerResultFilter?: (result: any) => boolean): void; +} +/** +* A list of event handlers +*/ +export class EventHandlerList { + private _handlers; + /** + * Creates a new event handler list + * + * @param handlers Optional initial list of handlers + */ + constructor(handlers?: IFunctionPPR[]); + /** + * Adds an event handler to the list + * + * @param handler Event handler method to register + */ + subscribe(handler: IFunctionPPR): void; + /** + * Removes an event handler from the list + * + * @param handler Event handler method to remove + */ + unsubscribe(handler: IFunctionPPR): void; + /** + * Get the underlying list of handlers + */ + getHandlers(): IFunctionPPR[]; +} +/** +* Command Event Arguments data structure that can be used for "command" events +*/ +export class CommandEventArgs { + private _commandName; + private _commandArgument; + private _commandSource; + constructor(commandName: string, commandArgument?: any, commandSource?: any); + /** + * Get the name of the command + */ + get_commandName(): string; + /** + * Get arguments to the command + */ + get_commandArgument(): any; + /** + * Get the source that triggered the event + */ + get_commandSource(): any; +} +} declare module "VSS/Events/Services" { import Service = require("VSS/Service"); export class EventService implements Service.ILocalService { @@ -14339,7 +14822,8 @@ export class EventService implements Service.ILocalService { export function getService(): EventService; } declare module "VSS/ExtensionManagement/Contracts" { -import VSS_Identities_Contracts = require("VSS/Identities/Contracts"); +import VSS_Common_Contracts = require("VSS/WebApi/Contracts"); +import VSS_Gallery_Contracts = require("VSS/Gallery/Contracts"); /** * An individual contribution made by an extension */ @@ -14502,6 +14986,45 @@ export interface ContributionType extends ContributionBase { [key: string]: ContributionPropertyDescription; }; } +/** + * Contextual information that data providers can examine when populating their data + */ +export interface DataProviderContext { + /** + * Generic property bag that contains context-specific properties that data providers can use when populating their data dictionary + */ + properties: { + [key: string]: any; + }; +} +/** + * A query that can be issued for data provider data + */ +export interface DataProviderQuery { + /** + * Contextual information to pass to the data providers + */ + context: DataProviderContext; + /** + * The contribution ids of the data providers to resolve + */ + contributionIds: string[]; +} +/** + * Result structure from calls to GetDataProviderData + */ +export interface DataProviderResult { + /** + * Property bag of data keyed off of the data provider contribution id + */ + data: { + [key: string]: any; + }; + /** + * List of data providers resolved in the data-provider query + */ + resolvedProviders: ResolvedDataProvider[]; +} /** * Represents a VSTS "extension" which is a container for contributions and contribution types */ @@ -14540,28 +15063,47 @@ export interface Extension extends ExtensionManifest { version: string; } /** - * Depending on the event type, some or all of the fields will have valid values. Created: All fields will be filled in with the appropriate values. Updated: All fields will be filled in with the appropriate values. Deleted: PublisherName, ExtensionName, ExtensionId, Version Shared/Unshared: The only type where the HostId field will be used will be supplied, null for version will mean all versions. Disabled: This will be event type when an extension is being disabled for everyone that has it installed. Enabled: This will be event type when a disabled extension is re-enabled. All fields will be filled in with the appropriate values. + * Represents the state of an extension request */ -export interface ExtensionChangeEvent { - eventType: ExtensionEventType; - extensionId: string; - extensionName: string; - flags: number; - hostId: string; - publisherName: string; - version: string; +export interface ExtensionAuditAction { } /** - * Depending on the event type, some or all of the fields will have valid values. Created: All fields will be filled in with the appropriate values. Updated: All fields will be filled in with the appropriate values. Deleted: PublisherName, ExtensionName, ExtensionId, Version will be supplied, null for version will mean all versions. + * Audit log for an extension */ -export interface ExtensionChangeNotification { - eventType: ExtensionEventType; - extensionId: string; +export interface ExtensionAuditLog { + /** + * Collection of audit log entries + */ + entries: ExtensionAuditLogEntry[]; + /** + * Extension that the change was made for + */ extensionName: string; - flags: number; - hostId: string; + /** + * Publisher that the extension is part of + */ publisherName: string; - version: string; +} +/** + * An audit log entry for an extension + */ +export interface ExtensionAuditLogEntry { + /** + * Change that was made to extension + */ + auditAction: string; + /** + * Date at which the change was made + */ + auditDate: Date; + /** + * Extra information about the change + */ + comment: string; + /** + * Represents the user who made the change + */ + updatedBy: VSS_Common_Contracts.IdentityRef; } /** * Represents a single collection for extension data documents @@ -14635,81 +15177,34 @@ export interface ExtensionEventCallbackCollection { */ versionCheck: ExtensionEventCallback; } -export interface ExtensionEventCallbackData { +export enum ExtensionFlags { /** - * The id of the extenstion whose state is chaning. + * A built-in extension is installed for all VSTS accounts by default */ - extensionId: string; + BuiltIn = 1, /** - * The operation causing a state change (install, uninstall, update, enable, disable). + * The extension comes from a fully-trusted publisher */ - operation: ExtensionOperation; + Trusted = 2, +} +/** + * Base class for extension properties which are shared by the extension manifest and the extension model + */ +export interface ExtensionManifest { /** - * The id of the extenstion whose state is chaning. + * Uri used as base for other relative uri's defined in extension */ - publisherId: string; + baseUri: string; /** - * The target host of the extension operation. + * List of contributions made by this extension */ - target: HostContext; -} -export interface ExtensionEventCallbackResult { + contributions: Contribution[]; /** - * Indicates whether to continue with the state change or abort. + * List of contribution types defined by this extension */ - allow: boolean; + contributionTypes: ContributionType[]; /** - * Message indicating reason for abort. - */ - message: string; -} -export enum ExtensionEventType { - ExtensionCreated = 1, - ExtensionUpdated = 2, - ExtensionDeleted = 3, - ExtensionShared = 4, - ExtensionUnshared = 5, - ExtensionDisabled = 6, - ExtensionEnabled = 7, -} -export enum ExtensionFlags { - /** - * A built-in extension is installed for all VSTS accounts by default - */ - BuiltIn = 1, - /** - * The extension comes from a fully-trusted publisher - */ - Trusted = 2, -} -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; -} -/** - * Base class for extension properties which are shared by the extension manifest and the extension model - */ -export interface ExtensionManifest { - /** - * Uri used as base for other relative uri's defined in extension - */ - baseUri: string; - /** - * List of contributions made by this extension - */ - contributions: Contribution[]; - /** - * List of contribution types defined by this extension - */ - contributionTypes: ContributionType[]; - /** - * Collection of endpoints that get called when particular extension events occur + * Collection of endpoints that get called when particular extension events occur */ eventCallbacks: ExtensionEventCallbackCollection; /** @@ -14724,79 +15219,10 @@ export interface ExtensionManifest { * List of all oauth scopes required by this extension */ scopes: string[]; -} -export enum ExtensionOperation { - /** - * Extension is being installed into an account. - */ - PreInstall = 0, - /** - * Extension is being enabled on an account. - */ - PreEnable = 1, - /** - * Extension was installed into an account. - */ - PostInstall = 2, - /** - * Extension was uninstalled from an account. - */ - PostUninstall = 3, - /** - * Extension was enabled on an account. - */ - PostEnable = 4, - /** - * Extension was enabled on an account. - */ - PostDisable = 5, - /** - * Extension was updated on an account. - */ - PostUpdate = 6, -} -/** - * 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 + * The ServiceInstanceType(Guid) of the VSTS service that must be available to an account in order for the extension to be installed */ - All = 31, + serviceInstanceType: string; } /** * A request for an extension (to be installed or have a license assigned) @@ -14813,7 +15239,7 @@ export interface ExtensionRequest { /** * Represents the user who made the request */ - requestedBy: VSS_Identities_Contracts.Identity; + requestedBy: VSS_Common_Contracts.IdentityRef; /** * Optional message supplied by the requester justifying the request */ @@ -14829,7 +15255,7 @@ export interface ExtensionRequest { /** * Represents the user who resolved the request */ - resolvedBy: VSS_Identities_Contracts.Identity; + resolvedBy: VSS_Common_Contracts.IdentityRef; } export enum ExtensionRequestState { /** @@ -14891,20 +15317,6 @@ export enum ExtensionStateFlags { */ Trusted = 32, } -export interface HostContext { - /** - * The host identifier. - */ - id: string; - /** - * The host name. - */ - name: string; - /** - * The host uri. - */ - uri: string; -} /** * Represents a VSTS extension along with its installation state */ @@ -14915,7 +15327,7 @@ export interface InstalledExtension extends Extension { installState: InstalledExtensionState; } export interface InstalledExtensionQuery { - monikers: ExtensionIdentifier[]; + monikers: VSS_Gallery_Contracts.ExtensionIdentifier[]; } /** * The state of an installed extension @@ -14955,6 +15367,13 @@ export interface RequestedExtension { */ requestCount: number; } +/** + * Entry for a specific data provider's resulting data + */ +export interface ResolvedDataProvider { + error: string; + id: string; +} export interface Scope { description: string; title: string; @@ -14977,23 +15396,6 @@ export interface SupportedExtension { */ version: string; } -/** - * 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 var TypeInfo: { Contribution: { fields: any; @@ -15028,43 +15430,38 @@ export var TypeInfo: { ContributionType: { fields: any; }; - Extension: { + DataProviderContext: { fields: any; }; - ExtensionChangeEvent: { + DataProviderQuery: { fields: any; }; - ExtensionChangeNotification: { + DataProviderResult: { fields: any; }; - ExtensionDataCollection: { + Extension: { fields: any; }; - ExtensionDataCollectionQuery: { + ExtensionAuditAction: { fields: any; }; - ExtensionEventCallback: { + ExtensionAuditLog: { fields: any; }; - ExtensionEventCallbackCollection: { + ExtensionAuditLogEntry: { fields: any; }; - ExtensionEventCallbackData: { + ExtensionDataCollection: { fields: any; }; - ExtensionEventCallbackResult: { + ExtensionDataCollectionQuery: { fields: any; }; - ExtensionEventType: { - enumValues: { - "extensionCreated": number; - "extensionUpdated": number; - "extensionDeleted": number; - "extensionShared": number; - "extensionUnshared": number; - "extensionDisabled": number; - "extensionEnabled": number; - }; + ExtensionEventCallback: { + fields: any; + }; + ExtensionEventCallbackCollection: { + fields: any; }; ExtensionFlags: { enumValues: { @@ -15072,37 +15469,9 @@ export var TypeInfo: { "trusted": number; }; }; - ExtensionIdentifier: { - fields: any; - }; ExtensionManifest: { fields: any; }; - ExtensionOperation: { - enumValues: { - "preInstall": number; - "preEnable": number; - "postInstall": number; - "postUninstall": number; - "postEnable": number; - "postDisable": number; - "postUpdate": number; - }; - }; - ExtensionPolicy: { - fields: any; - }; - ExtensionPolicyFlags: { - enumValues: { - "none": number; - "private": number; - "public": number; - "preview": number; - "released": number; - "firstParty": number; - "all": number; - }; - }; ExtensionRequest: { fields: any; }; @@ -15127,9 +15496,6 @@ export var TypeInfo: { "trusted": number; }; }; - HostContext: { - fields: any; - }; InstalledExtension: { fields: any; }; @@ -15142,19 +15508,20 @@ export var TypeInfo: { RequestedExtension: { fields: any; }; - Scope: { + ResolvedDataProvider: { fields: any; }; - SupportedExtension: { + Scope: { fields: any; }; - UserExtensionPolicy: { + SupportedExtension: { fields: any; }; }; } declare module "VSS/ExtensionManagement/RestClient" { import Contracts = require("VSS/ExtensionManagement/Contracts"); +import VSS_Gallery_Contracts = require("VSS/Gallery/Contracts"); import VSS_WebApi = require("VSS/WebApi/RestClient"); /** * @exemptedapi @@ -15411,20 +15778,20 @@ export class ExtensionManagementHttpClient2_2 extends VSS_WebApi.VssHttpClient { * [Preview API] * * @param {string} userId - * @return IPromise + * @return IPromise */ - getPolicies(userId: string): IPromise; + getPolicies(userId: string): IPromise; /** * [Preview API] * + * @param {string} rejectMessage * @param {string} publisherName * @param {string} extensionName * @param {string} requesterId * @param {Contracts.ExtensionRequestState} state - * @param {string} rejectMessage * @return IPromise */ - resolveRequest(publisherName: string, extensionName: string, requesterId: string, state?: Contracts.ExtensionRequestState, rejectMessage?: string): IPromise; + resolveRequest(rejectMessage: string, publisherName: string, extensionName: string, requesterId: string, state: Contracts.ExtensionRequestState): IPromise; /** * [Preview API] * @@ -15434,13 +15801,13 @@ export class ExtensionManagementHttpClient2_2 extends VSS_WebApi.VssHttpClient { /** * [Preview API] * + * @param {string} rejectMessage * @param {string} publisherName * @param {string} extensionName * @param {Contracts.ExtensionRequestState} state - * @param {string} rejectMessage * @return IPromise */ - resolveAllRequests(publisherName: string, extensionName: string, state?: Contracts.ExtensionRequestState, rejectMessage?: string): IPromise; + resolveAllRequests(rejectMessage: string, publisherName: string, extensionName: string, state: Contracts.ExtensionRequestState): IPromise; /** * [Preview API] * @@ -15457,7 +15824,7 @@ export class ExtensionManagementHttpClient2_2 extends VSS_WebApi.VssHttpClient { * @param {string} requestMessage * @return IPromise */ - requestExtension(publisherName: string, extensionName: string, requestMessage?: string): IPromise; + requestExtension(publisherName: string, extensionName: string, requestMessage: string): IPromise; /** * [Preview API] * @@ -15710,14 +16077,14 @@ export class ExtensionManagementHttpClient2_1 extends VSS_WebApi.VssHttpClient { /** * [Preview API] * + * @param {string} rejectMessage * @param {string} publisherName * @param {string} extensionName * @param {string} requesterId * @param {Contracts.ExtensionRequestState} state - * @param {string} rejectMessage * @return IPromise */ - resolveRequest(publisherName: string, extensionName: string, requesterId: string, state?: Contracts.ExtensionRequestState, rejectMessage?: string): IPromise; + resolveRequest(rejectMessage: string, publisherName: string, extensionName: string, requesterId: string, state: Contracts.ExtensionRequestState): IPromise; /** * [Preview API] * @@ -15727,13 +16094,13 @@ export class ExtensionManagementHttpClient2_1 extends VSS_WebApi.VssHttpClient { /** * [Preview API] * + * @param {string} rejectMessage * @param {string} publisherName * @param {string} extensionName * @param {Contracts.ExtensionRequestState} state - * @param {string} rejectMessage * @return IPromise */ - resolveAllRequests(publisherName: string, extensionName: string, state?: Contracts.ExtensionRequestState, rejectMessage?: string): IPromise; + resolveAllRequests(rejectMessage: string, publisherName: string, extensionName: string, state: Contracts.ExtensionRequestState): IPromise; /** * [Preview API] * @@ -15750,7 +16117,7 @@ export class ExtensionManagementHttpClient2_1 extends VSS_WebApi.VssHttpClient { * @param {string} requestMessage * @return IPromise */ - requestExtension(publisherName: string, extensionName: string, requestMessage?: string): IPromise; + requestExtension(publisherName: string, extensionName: string, requestMessage: string): IPromise; /** * [Preview API] * @@ -15973,6 +16340,9 @@ export interface FileContainer { * Uri of the artifact associated with the container. */ artifactUri: string; + /** + * Download Url for the content of this item. + */ contentLocation: string; /** * Owner. @@ -16028,6 +16398,9 @@ export interface FileContainerItem { */ containerId: number; contentId: number[]; + /** + * Download Url for the content of this item. + */ contentLocation: string; /** * Creator. @@ -16302,16 +16675,20 @@ export interface AcquisitionOperation { * AcquisitionOperationType: install, request, buy, etc... */ operationType: AcquisitionOperationType; + /** + * Optional reason to justify current state. Typically used with Disallow state. + */ + reason: string; } export enum AcquisitionOperationState { /** - * Unable to use this AquisitionOperation + * Not allowed to use this AcquisitionOperation */ - Disabled = 0, + Disallow = 0, /** - * Able to use this AquisitionOperation + * Allowed to use this AcquisitionOperation */ - Enabled = 1, + Allow = 1, /** * Operation has already been completed and is no longer available */ @@ -16421,6 +16798,19 @@ export interface ExtensionFilterResult { */ pagingToken: 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 */ @@ -16430,10 +16820,57 @@ export interface ExtensionPackage { */ 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. */ @@ -16480,6 +16917,10 @@ export enum ExtensionQueryFilterType { * 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 { /** @@ -16523,7 +16964,11 @@ export enum ExtensionQueryFlags { */ IncludeStatistics = 256, /** - * AllAttributes is designed to be a mask that defines all sub-elements of the extension should be returned. + * 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, } @@ -16813,8 +17258,25 @@ export enum SigningKeyPermissions { Read = 1, Write = 2, } -export var TypeInfo: { - AcquisitionAssignmentType: { +/** + * 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 var TypeInfo: { + AcquisitionAssignmentType: { enumValues: { "none": number; "me": number; @@ -16826,8 +17288,8 @@ export var TypeInfo: { }; AcquisitionOperationState: { enumValues: { - "disabled": number; - "enabled": number; + "disallow": number; + "allow": number; "completed": number; }; }; @@ -16853,9 +17315,26 @@ export var TypeInfo: { ExtensionFilterResult: { 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; }; @@ -16870,6 +17349,7 @@ export var TypeInfo: { "name": number; "installationTarget": number; "featured": number; + "searchText": number; }; }; ExtensionQueryFlags: { @@ -16884,6 +17364,7 @@ export var TypeInfo: { "includeInstallationTargets": number; "includeAssetUri": number; "includeStatistics": number; + "includeLatestVersionOnly": number; "allAttributes": number; }; }; @@ -17003,6 +17484,9 @@ export var TypeInfo: { "write": number; }; }; + UserExtensionPolicy: { + fields: any; + }; }; } declare module "VSS/Gallery/RestClient" { @@ -17518,53 +18002,6 @@ export class GalleryHttpClient extends GalleryHttpClient2_2 { */ export function getClient(): GalleryHttpClient2_1; } -declare module "VSS/Host" { -import Events_Action = require("VSS/Events/Action"); -import Events_Document = require("VSS/Events/Document"); -import Events_Services = require("VSS/Navigation/Services"); -export var history: Events_Services.HistoryService; -export var notificationService: Events_Services.HistoryService; -export var runningDocumentsTable: Events_Document.RunningDocumentsTable; -export var ActionManager: { - MaxOrder: any; - registerActionWorker: (action: string, actionWorker: Events_Action.IActionWorker, order?: number) => void; - clearActionWorkers: () => void; - performAction: (action: string, actionArgs?: any) => any; - unregisterActionWorker: (action: string, actionWorker: Events_Action.IActionWorker) => void; -}; -export var CommonActions: { - ACTION_WINDOW_OPEN: string; - ACTION_WINDOW_NAVIGATE: string; - ACTION_WINDOW_RELOAD: string; - ACTION_WINDOW_UNLOAD: string; -}; -export var urlHelper: { - getFragmentActionLink: (action: string, data?: any) => string; - replaceUrlParam: (url: string, paramName: string, paramValue: string) => string; - isUrlWithinConstraints: (url: string) => boolean; - isSafeProtocol: (url: string) => boolean; -}; -export var hostServiceManager: { - getService(t: any): any; -}; -export enum NavigationContextLevels { - None = 0, - Deployment = 1, - Application = 2, - Collection = 4, - Project = 8, - Team = 16, - ApplicationAll = 15, - All = 31, -} -export enum TeamFoundationHostType { - Parent = -1, - Unknown = 0, - Deployment = 1, - Application = 2, - ProjectCollection = 4, -} -} declare module "VSS/Identities/Contracts" { /** * Container class for changed identities @@ -17725,10 +18162,6 @@ export interface IdentitySelf { id: string; tenants: TenantInfo[]; } -export enum IdentityServiceBehavior { - Default = 0, - NoMapping = 1, -} export interface IdentitySnapshot { groups: Identity[]; identityIds: string[]; @@ -17870,12 +18303,6 @@ export var TypeInfo: { IdentitySelf: { fields: any; }; - IdentityServiceBehavior: { - enumValues: { - "default": number; - "noMapping": number; - }; - }; IdentitySnapshot: { fields: any; }; @@ -18114,11 +18541,22 @@ export class TwoLayerCache implements ITwoLayerCache { * This method is optimistic **/ set(key: string, value: V, cacheTypeHint?: string): void; + private _queryCache(key, cacheTypeHint?); + private _telemetryOfCacheHitRatio(value); + private static FEATURE; private _config; private _redirectors; private _objectCache; } } +declare module "VSS/Identities/Picker/Constants" { +export class Constants { + /** + * For Telemetry, AREA field + */ + static AREA: string; +} +} declare module "VSS/Identities/Picker/Controls" { import Controls = require("VSS/Controls"); import Dialogs = require("VSS/Controls/Dialogs"); @@ -18204,7 +18642,6 @@ export class IdentityPickerDropdownControl extends Controls.Control; getIdentitySearchResult(): IdentitySearchResult; clear(): void; + /** + * Clears but does not recreate the watermark + **/ + private _clearSearchControl(); isDropdownVisible(): boolean; addIdentitiesToMru(identities: Identities_Picker_RestClient.IEntity[]): void; /** @@ -18522,32 +18967,45 @@ export class IdentityPickerSearchControl extends Controls.Control>; + getIdentities(prefix: string, operationScope: IOperationScope, identityType: IEntityType, options?: IIdentityServiceOptions, queryTypeHint?: IQueryTypeHint): IDictionaryStringTo>; /** * Get images of identities asynchronously, if available. Currently only supports AAD and profile images. * @param successCallback: This is called once all the images have been loaded for the identities supplied @@ -18942,6 +19418,7 @@ export class IdentityService extends Service.VssService implements IIdentityServ private static _ffClientPerformance; private _qtrCache; private _qtrRequestAggregator; + private _entityImageRequestAggregator; } export interface IMruServiceOptions { /** @@ -19938,33 +20415,122 @@ export class LocationsHttpClient extends LocationsHttpClient2_2 { } declare module "VSS/Navigation/Services" { import Service = require("VSS/Service"); +/** +* Local service to manage history and navigation state +*/ export class HistoryService implements Service.ILocalService { - private _events; + private _namedEvents; + private _usePushState; private _suppressNavigate; private _initialized; - private _currentHashString; + private _lastNavigatedHashString; + private _lastNavigatedQueryString; + private _ignoreQueryString; constructor(); + /** + * Gets the serialized version of the current navigation state. + */ + getCurrentFragment(): string; + /** + * Gets the current url's hash string + */ + getCurrentHashString(): string; + /** + * Gets the current url's query string + */ + getCurrentQueryString(): string; /** * Creates a fragment url to be used in flight navigation. + * This always returns a fragment link, regardless of the browser's capability to handle push state. * * @param action The action name * @param data Action parameters * @return fragment URL in the form of #_a=[action]&routevalue1=routevalue2... */ getFragmentActionLink(action: string, data?: any): string; - getCurrentFragment(): string; - deSerializeState(state: string): any; + /** + * Get the current navigation state dictionary. Uses query parameters and hash parameters. + */ getCurrentState(): any; - private checkCurrentState(); + /** + * Replace the current history entry with the given state. + * The back button will therefore not map to the current url (at the time this call is made), but rather to the previous history entry. + * + * @param action The "action" state parameter. This is the _a key in the url or "action" in the current state dictionary + * @param data The new full set of navigation/history entries. This set completely replaces the current set. + * @param windowTitle The new window title. A null or empty value indicates to leave the title unchanged. + * @param suppressNavigate If true, don't trigger any of the attached navigate event handlers due to this update. + */ replaceHistoryPoint(action: string, data: any, windowTitle?: string, suppressNavigate?: boolean): void; + /** + * Add a new history entry with the given state. Merges data with the current navigation data. + * + * @param action The "action" state parameter. This is the _a key in the url or "action" in the current state dictionary + * @param data New history entries to merge into the current navigation data. Set keys to null/undefined to remove them from the current state. + * @param windowTitle The new window title. A null or empty value indicates to leave the title unchanged. + * @param suppressNavigate If true, don't trigger any of the attached navigate event handlers due to this update. + */ addHistoryPoint(action: string, data?: any, windowTitle?: string, suppressNavigate?: boolean): void; + /** + * Update the current history entry + * + * @param action The "action" state parameter. This is the _a key in the url or "action" in the current state dictionary + * @param data The history entry's new state key/value pairs + * @param replaceHistoryEntry If true, replace the current history entry. Otherwise, add a new history entry. + * @param mergeWithCurrentState If true, the supplied data just modify the existing/current state. If false, they replace all existing key/value pairs. + * @param windowTitle The new window title. A null or empty value indicates to leave the title unchanged. + * @param suppressNavigate If true, don't trigger any of the attached navigate event handlers due to this update. + */ + updateHistoryEntry(action: string, data?: IDictionaryStringTo, replaceHistoryEntry?: boolean, mergeWithCurrentState?: boolean, windowTitle?: string, suppressNavigate?: boolean): void; + /** + * Serialize a navigation data lookup into a string that can be used as a hash or query string. + * + * @param state The navigation state dictionary to convert + */ + static serializeState(state: IDictionaryStringTo): string; + /** + * Deserialize a navigation state string into a navigation data lookup. + * + * @param state The serialized navigation state string (hash or query string) + */ + static deserializeState(state: string): IDictionaryStringTo; + /** + * Attach a new navigate handler + * + * @param handler The method called whenever a navigation event occurs + * @param checkCurrentState If true, immediately invoke the handler + */ attachNavigate(handler: IFunctionPPR, checkCurrentState?: boolean): void; + /** + * Attach a new navigate handler + * + * @param action The action that the handler applies to + * @param handler The method called whenever a navigation event occurs with the matching action value + * @param checkCurrentState If true, immediately invoke the handler if the current state is appropriate (has the matching action value) + */ attachNavigate(action: string, handler: IFunctionPPR, checkCurrentState?: boolean): void; - detachNavigate(action: IFunctionPPR): void; + /** + * Remove a navigate handler + * + * @param handler The global navigate handler method to remove + */ + detachNavigate(handler: IFunctionPPR): void; + /** + * Remove a navigate handler + * + * @param action The action that the handler applies to + * @param handler The method called whenever a navigation event occurs with the matching action value + */ detachNavigate(action: string, handler?: IFunctionPPR): void; - private _ensureInitialized(); + private _moveHashStateToQueryParams(); + private _onHashChanged(e); + private _onPopState(e); private _onNavigate(); + private _setLastNavigateState(); } +/** +* Gets the instance of the local History service +*/ export function getHistoryService(): HistoryService; } declare module "VSS/Operations/Contracts" { @@ -20168,136 +20734,574 @@ export interface IScenarioDescriptor { */ addData(data: any): void; /** - * Logs scenario data to the browser's console + * Logs scenario data to the browser's console + */ + log(): void; +} +export function getTimestamp(): number; +/** + * Returns navigation start timestamp, or 0 if browser doesn't support it + */ +export function getNavigationStartTimestamp(): number; +} +declare module "VSS/Profile/Contracts" { +export interface AttributeDescriptor { + attributeName: string; + containerName: string; +} +export interface AttributesContainer { + attributes: { + [key: string]: ProfileAttribute; + }; + containerName: string; + revision: number; +} +export enum AttributesScope { + Core = 1, + Application = 2, +} +export interface Avatar { + isAutoGenerated: boolean; + size: AvatarSize; + timeStamp: Date; + value: number[]; +} +export enum AvatarSize { + Small = 0, + Medium = 1, + Large = 2, +} +export interface CoreProfileAttribute extends ProfileAttributeBase { +} +export enum CoreProfileAttributes { + Minimal = 0, + Email = 1, + Avatar = 2, + DisplayName = 4, + All = 65535, +} +export interface Country { + code: string; + englishName: string; +} +export interface CreateProfileContext { + cIData: { + [key: string]: any; + }; + contactWithOffers: boolean; + countryName: string; + displayName: string; + emailAddress: string; + language: string; +} +export interface GeoRegion { + regionCode: string; +} +export interface Profile { + applicationContainer: AttributesContainer; + coreAttributes: { + [key: string]: CoreProfileAttribute; + }; + coreRevision: number; + id: string; + revision: number; + timeStamp: Date; +} +export interface ProfileAttribute extends ProfileAttributeBase { +} +export interface ProfileAttributeBase { + descriptor: AttributeDescriptor; + revision: number; + timeStamp: Date; + value: T; +} +export interface ProfileException { +} +export interface ProfileNotAuthorizedException extends ProfileException { +} +export enum ProfilePageType { + Update = 0, + Create = 1, + CreateIDE = 2, + Review = 3, + AvatarImageFormat = 4, +} +export enum ProfilePropertyType { + DisplayName = 0, + EmailAddress = 1, + PublicAlias = 2, + Country = 3, +} +export interface ProfileTermsOfService { + activatedDate: Date; + id: string; + lastModified: Date; + termsOfServiceUrl: string; + version: number; +} +export interface UserTermsOfService { + currentAcceptedTermsOfService: number; + currentAcceptedTermsOfServiceDate: Date; + latestTermsOfService: ProfileTermsOfService; +} +export interface VerifyPreferredEmailContext { + emailAddress: string; + hashCode: string; + id: string; +} +export var TypeInfo: { + AttributeDescriptor: { + fields: any; + }; + AttributesContainer: { + fields: any; + }; + AttributesScope: { + enumValues: { + "core": number; + "application": number; + }; + }; + Avatar: { + fields: any; + }; + AvatarSize: { + enumValues: { + "small": number; + "medium": number; + "large": number; + }; + }; + CoreProfileAttribute: { + fields: any; + }; + CoreProfileAttributes: { + enumValues: { + "minimal": number; + "email": number; + "avatar": number; + "displayName": number; + "all": number; + }; + }; + Country: { + fields: any; + }; + CreateProfileContext: { + fields: any; + }; + GeoRegion: { + fields: any; + }; + Profile: { + fields: any; + }; + ProfileAttribute: { + fields: any; + }; + ProfileAttributeBase: { + fields: any; + }; + ProfileException: { + fields: any; + }; + ProfileNotAuthorizedException: { + fields: any; + }; + ProfilePageType: { + enumValues: { + "update": number; + "create": number; + "createIDE": number; + "review": number; + "avatarImageFormat": number; + }; + }; + ProfilePropertyType: { + enumValues: { + "displayName": number; + "emailAddress": number; + "publicAlias": number; + "country": number; + }; + }; + ProfileTermsOfService: { + fields: any; + }; + UserTermsOfService: { + fields: any; + }; + VerifyPreferredEmailContext: { + fields: any; + }; +}; +} +declare module "VSS/Profile/Metrics" { +import Q = require("q"); +import Telemetry_RestClient = require("VSS/Telemetry/RestClient"); +import Telemetry_Services = require("VSS/Telemetry/Services"); +/** + * Service used to report telemetry via CI events and app insights, derived from VSS/Telemetry/Services + * @remark export for testing only, do not use it externally + */ +export class TelemetryAsyncHelper { + private static DelayMs; + private items; + private client; + private queue; + private pending; + constructor(client?: Telemetry_RestClient.CustomerIntelligenceHttpClient); + private queueEvent(eventData); + /** + * @param eventData + * @param publishImmediately flush all currently queueed events and publish them immediately + */ + publish(eventData: Telemetry_Services.TelemetryEventData, publishImmediately?: boolean): Q.Promise; + private publishEvents(); +} +export interface MetricsEvent { + setValue(key: string, value: T): any; + close(): Q.Promise; + inner(feature: string): MetricsEvent; +} +/** + * Base metrics event + * @remarks Should be abstract when compiler supports + */ +export class BaseMetricsEvent implements MetricsEvent { + protected isClosed: boolean; + protected area: string; + protected feature: string; + protected properties: IDictionaryStringTo; + protected publishOnClose: boolean; + private children; + /** + * Creates a MetricsEvent with specified area and feature + */ + constructor(area: string, feature: string, publishOnClose: boolean); + /** + * Set value for a metric field + */ + setValue(key: string, value: T): any; + /** + * Publishes data to telemetry services + * To be overriden for specific implementations + * @remarks Should be abstract when compiler supports + */ + protected closeThis(): Q.Promise; + /** + * Marks a MetricsEvent project as closed, once it is closed, it will not be updated with any new values + * invokes closeThis for specific implementations. + */ + close(): Q.Promise; + /** + * Create inner metrics by prefixing the keys with innerFeature + * @remarks Should be abstract when compiler supports, must be overriden + */ + protected newInnerMetrics(feature: string): T; + inner(feature: string): T; +} +/** + * Provides an easy-to-use tracking object for sending customer intelligence telemetries + */ +export class IntervalMetricsEvent extends BaseMetricsEvent { + protected startTime: number; + protected elapsedTime: number; + /** + * Set startTime for this metrics event to Date.now() + * @return set startTime + */ + begin(): number; + /** + * Set elapsedTime if the start timestamp has been set by Date.now() - startTime + * @return set elapsedTime + */ + end(): number; + /** + * Publishes data to telemetry services + * To be overriden for specific implementations + */ + protected closeThis(): Q.Promise; + /** + * Create inner metrics by prefixing the keys with innerFeature + */ + protected newInnerMetrics(innerFeature: string): IntervalMetricsEvent; +} +export class InstantMetricsEvent extends BaseMetricsEvent { + /** + * Publishes data to telemetry services + * To be overriden for specific implementations + */ + protected closeThis(): Q.Promise; + /** + * Create inner metrics by prefixing the keys with innerFeature + */ + newInnerMetrics(innerFeature: string): MetricsEvent; +} +/** + * Metrics event that does nothing + */ +export class NullMetricsEvent implements MetricsEvent { + setValue(key: string, value: T): void; + close(): Q.Promise; + inner(feature: string): MetricsEvent; +} +/** + * Interval metrics event that does nothing + */ +export class NullIntervalMetricsEvent extends IntervalMetricsEvent { + constructor(); + begin(): number; + end(): number; + setValue(key: string, value: T): void; + close(): Q.Promise; + inner(): NullIntervalMetricsEvent; +} +/** + * Convenient metrics event object that does nothing + */ +export var nullMetrics: NullMetricsEvent; +export var nullIntervalMetrics: NullIntervalMetricsEvent; +/** + * Create auto metered async action with StartTime and ElapsedTime automatially set for a new metrics + * @param action + * @param metricsArea + * @param metricsFeature + */ +export function meterAsyncAction(action: (metrics: IntervalMetricsEvent) => Q.Promise, metricsArea: string, metricsFeature: string, metricsPublishOnClose: boolean): Q.Promise; +/** + * Create auto metered async action with StartTime and ElapsedTime automatially set for a new inner metrics + * @param action + * @param parentMetrics + * @param innerFeature + */ +export function meterAsyncActionInner(action: (metrics: MetricsEvent) => Q.Promise, parentMetrics: IntervalMetricsEvent, innerFeature: string): Q.Promise; +/** + * Publish all metrics immediately + */ +export function publishAllImmediately(): Q.Promise; +/** + * Wrapped async action with metrics automatically logged for beginning and end + * Change to abstract class when using ts-api-checker supports it + */ +export class MeteredAsyncAction { + private parentMetrics; + private feature; + /** + * Create metered async action + * @param metrics parent metrics to put the metrics of this enaction into. + */ + constructor(metrics?: IntervalMetricsEvent, feature?: string); + /** + * Creates metrics to be consumed, no direct passing metrics object from outside of the class, so the metrics lives only in the scope of this class + * Creates child metrics if parent metrics and feature are specified + * Override with method returning arbitrary IntervalMetricsEvent + */ + protected createMetrics(): IntervalMetricsEvent; + /** + * Action implementation + * Abstract method, must be overriden + * @param metrics + */ + protected action(metrics: MetricsEvent): Q.Promise; + /** + * Enact action + */ + enact(): Q.Promise; +} +} +declare module "VSS/Profile/RestClient" { +import Contracts = require("VSS/Profile/Contracts"); +import VSS_Common_Contracts = require("VSS/WebApi/Contracts"); +import VSS_WebApi = require("VSS/WebApi/RestClient"); +/** + * @exemptedapi + */ +export class ProfileHttpClient2_2 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); + /** + * [Preview API] + * + * @param {string} id + * @param {string} descriptor + * @return IPromise + */ + deleteProfileAttribute(id: string, descriptor: string): IPromise; + /** + * [Preview API] + * + * @param {string} id + * @param {string} descriptor + * @return IPromise + */ + getProfileAttribute(id: string, descriptor: string): IPromise; + /** + * [Preview API] + * + * @param {any} container + * @param {string} id + * @param {string} descriptor + * @return IPromise + */ + setProfileAttribute(container: any, id: string, descriptor: string): IPromise; + /** + * [Preview API] + * + * @param {VSS_Common_Contracts.VssJsonCollectionWrapperV[]>} attributesCollection + * @param {string} id + * @return IPromise + */ + setProfileAttributes(attributesCollection: VSS_Common_Contracts.VssJsonCollectionWrapperV[]>, id: string): IPromise; + /** + * [Preview API] + * + * @param {string} id + * @param {string} size + * @param {string} format + * @return IPromise + */ + getAvatar(id: string, size?: string, format?: string): IPromise; + /** + * [Preview API] + * + * @param {string} id + * @return IPromise + */ + resetAvatar(id: string): IPromise; + /** + * [Preview API] + * + * @param {any} container + * @param {string} id + * @return IPromise + */ + setAvatar(container: any, id: string): IPromise; + /** + * [Preview API] + * + * @return IPromise + */ + getCountries(): IPromise; + /** + * [Preview API] + * + * @param {string} ipaddress + * @return IPromise + */ + getGeoRegion(ipaddress: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.CreateProfileContext} createProfileContext + * @return IPromise + */ + createProfile(createProfileContext: Contracts.CreateProfileContext): IPromise; + /** + * [Preview API] + * + * @param {string} id + * @param {boolean} details + * @param {boolean} withAttributes + * @param {string} partition + * @param {string} coreAttributes + * @return IPromise + */ + getProfile(id: string, details?: boolean, withAttributes?: boolean, partition?: string, coreAttributes?: string): IPromise; + /** + * [Preview API] + * + * @param {Contracts.Profile} profile + * @param {string} id + * @return IPromise */ - log(): void; -} -export function getTimestamp(): number; -} -declare module "VSS/Profile/Metrics" { -import Q = require("q"); -import Telemetry_RestClient = require("VSS/Telemetry/RestClient"); -import Telemetry_Services = require("VSS/Telemetry/Services"); -/** - * Service used to report telemetry via CI events and app insights, derived from VSS/Telemetry/Services - * @remark export for testing only, do not use it externally - */ -export class TelemetryAsyncHelper { - private static DelayMs; - private items; - private client; - private queue; - private pending; - constructor(client?: Telemetry_RestClient.CustomerIntelligenceHttpClient); - private queueEvent(eventData); - publish(eventData: Telemetry_Services.TelemetryEventData, publishImmediately?: boolean): Q.Promise; - private publishEvents(); -} -export interface MetricsEvent { - setValue(key: string, value: T): any; - close(): Q.Promise; - inner(feature: string): MetricsEvent; + updateProfile(profile: Contracts.Profile, id: string): IPromise; } -/** - * Base metrics event - * @remarks Should be abstract when compiler supports - */ -export class BaseMetricsEvent implements MetricsEvent { - protected isClosed: boolean; - protected area: string; - protected feature: string; - protected properties: IDictionaryStringTo; - protected publishOnClose: boolean; - private children; +export class ProfileHttpClient2_1 extends VSS_WebApi.VssHttpClient { + static serviceInstanceId: string; + constructor(rootRequestPath: string); /** - * Creates a MetricsEvent with specified area and feature + * @param {string} id + * @param {string} descriptor + * @return IPromise */ - constructor(area: string, feature: string, publishOnClose: boolean); + deleteProfileAttribute(id: string, descriptor: string): IPromise; /** - * Set value for a metric field + * @param {string} id + * @param {string} descriptor + * @return IPromise */ - setValue(key: string, value: T): any; + getProfileAttribute(id: string, descriptor: string): IPromise; /** - * Publishes data to telemetry services - * To be overriden for specific implementations - * @remarks Should be abstract when compiler supports + * @param {any} container + * @param {string} id + * @param {string} descriptor + * @return IPromise */ - protected closeThis(): Q.Promise; + setProfileAttribute(container: any, id: string, descriptor: string): IPromise; /** - * Marks a MetricsEvent project as closed, once it is closed, it will not be updated with any new values - * invokes closeThis for specific implementations. + * @param {VSS_Common_Contracts.VssJsonCollectionWrapperV[]>} attributesCollection + * @param {string} id + * @return IPromise */ - close(): Q.Promise; + setProfileAttributes(attributesCollection: VSS_Common_Contracts.VssJsonCollectionWrapperV[]>, id: string): IPromise; /** - * Create inner metrics by prefixing the keys with innerFeature - * @remarks Should be abstract when compiler supports, must be overriden + * @param {string} id + * @param {string} size + * @param {string} format + * @return IPromise */ - protected newInnerMetrics(feature: string): T; - inner(feature: string): T; -} -/** - * Provides an easy-to-use tracking object for sending customer intelligence telemetries - */ -export class IntervalMetricsEvent extends BaseMetricsEvent { - protected startTime: number; - protected elapsedTime: number; + getAvatar(id: string, size?: string, format?: string): IPromise; /** - * Set startTime for this metrics event to Date.now() - * @return set startTime + * @param {string} id + * @return IPromise */ - begin(): number; + resetAvatar(id: string): IPromise; /** - * Set elapsedTime if the start timestamp has been set by Date.now() - startTime - * @return set elapsedTime + * @param {any} container + * @param {string} id + * @return IPromise */ - end(): number; + setAvatar(container: any, id: string): IPromise; /** - * Publishes data to telemetry services - * To be overriden for specific implementations + * @return IPromise */ - protected closeThis(): Q.Promise; + getCountries(): IPromise; /** - * Create inner metrics by prefixing the keys with innerFeature + * @param {string} ipaddress + * @return IPromise */ - protected newInnerMetrics(innerFeature: string): IntervalMetricsEvent; -} -export class InstantMetricsEvent extends BaseMetricsEvent { + getGeoRegion(ipaddress: string): IPromise; /** - * Publishes data to telemetry services - * To be overriden for specific implementations + * @param {Contracts.CreateProfileContext} createProfileContext + * @return IPromise */ - protected closeThis(): Q.Promise; + createProfile(createProfileContext: Contracts.CreateProfileContext): IPromise; /** - * Create inner metrics by prefixing the keys with innerFeature + * @param {string} id + * @param {boolean} details + * @param {boolean} withAttributes + * @param {string} partition + * @param {string} coreAttributes + * @return IPromise */ - newInnerMetrics(innerFeature: string): MetricsEvent; + getProfile(id: string, details?: boolean, withAttributes?: boolean, partition?: string, coreAttributes?: string): IPromise; + /** + * @param {Contracts.Profile} profile + * @param {string} id + * @return IPromise + */ + updateProfile(profile: Contracts.Profile, id: string): IPromise; } -/** - * Metrics event that does nothing - */ -export class NullMetricsEvent implements MetricsEvent { - setValue(key: string, value: T): void; - close(): Q.Promise; - inner(feature: string): MetricsEvent; +export class ProfileHttpClient extends ProfileHttpClient2_2 { + constructor(rootRequestPath: string); } /** - * Convenient metrics event object that does nothing - */ -export var nullMetrics: NullMetricsEvent; -/** - * Create auto metered async action with StartTime and ElapsedTime automatially set for a new metrics - * @param action - * @param metricsArea - * @param metricsFeature - */ -export function meterAsyncAction(action: (metrics: IntervalMetricsEvent) => Q.Promise, metricsArea: string, metricsFeature: string, metricsPublishOnClose: boolean): Q.Promise; -/** - * Create auto metered async action with StartTime and ElapsedTime automatially set for a new inner metrics - * @param action - * @param parentMetrics - * @param innerFeature + * Gets an http client targeting the latest released version of the APIs. + * + * @return ProfileHttpClient2_1 */ -export function meterAsyncActionInner(action: (metrics: MetricsEvent) => Q.Promise, parentMetrics: IntervalMetricsEvent, innerFeature: string): Q.Promise; +export function getClient(): ProfileHttpClient2_1; } declare module "VSS/SDK/Services/Dialogs" { import Contracts_Platform = require("VSS/Common/Contracts/Platform"); @@ -20316,6 +21320,19 @@ export class HostDialogService implements IHostDialogService { * @param postContent Optional data to post to the contribution endpoint. If not specified, a GET request will be performed. */ openDialog(contributionId: string, dialogOptions: IHostDialogOptions, contributionConfig?: Object, postContent?: Object): IPromise; + /** + * Open a modal dialog in the host frame which will display the supplied message. + * @param message the message to display in the dialog. If it's a string, the message is displayed as plain text (no html). For HTML display, pass in a jQuery object. + * @param methodOptions options affecting the dialog + * @returns a promise that is resolved when the user accepts the dialog (Ok, Yes, any button with Button.reject===false), or rejected if the user does not (Cancel, No, any button with Button.reject===true). + */ + openMessageDialog(message: string | JQuery, options?: IOpenMessageDialogOptions): IPromise; + buttons: { + ok: Dialogs.IMessageDialogButton; + cancel: Dialogs.IMessageDialogButton; + yes: Dialogs.IMessageDialogButton; + no: Dialogs.IMessageDialogButton; + }; } export interface ExternalDialogOptions extends Dialogs.IModalDialogOptions { contributionId: string; @@ -20454,6 +21471,36 @@ import Q = require("q"); * @serviceId "ms.vss-web.navigation-service" */ export class HostNavigationService implements IHostNavigationService { + /** + * Update the current history entry + * + * @param action The "action" state parameter. This is the _a key in the url or "action" in the current state dictionary + * @param data The history entry's new state key/value pairs + * @param replaceHistoryEntry If true, replace the current history entry. Otherwise, add a new history entry. + * @param mergeWithCurrentState If true, the supplied data just modify the existing/current state. If false, they replace all existing key/value pairs. + * @param windowTitle The new window title. A null or empty value indicates to leave the title unchanged. + * @param suppressNavigate If true, don't trigger any of the attached navigate event handlers due to this update. + */ + updateHistoryEntry(action: string, data?: IDictionaryStringTo, replaceHistoryEntry?: boolean, mergeWithCurrentState?: boolean, windowTitle?: string, suppressNavigate?: boolean): void; + /** + * Get the current navigation state dictionary. Uses query parameters and hash parameters. + */ + getCurrentState(): any; + /** + * Attach a new navigate handler + * + * @param action The action that the handler applies to (or null to listen for all events) + * @param handler The method called whenever a navigation event occurs with the matching action value + * @param checkCurrentState If true, immediately invoke the handler if the current state is appropriate (has the matching action value) + */ + attachNavigate(action: string, handler: IFunctionPPR, checkCurrentState?: boolean): void; + /** + * Remove a navigate handler + * + * @param action The action that the handler applies to (or null for global handlers) + * @param handler The method called whenever a navigation event occurs with the matching action value + */ + detachNavigate(action: string, handler?: IFunctionPPR): void; /** * Add a callback to be invoked each time the hash navigation has changed * @@ -20915,6 +21962,9 @@ export interface SecurityNamespaceDescription { * This localized name for this namespace. */ displayName: string; + /** + * If the security tokens this namespace will be operating on need to be split on certain character lengths to determine its elements, that length should be specified here. If not, this value will be -1. + */ elementLength: number; /** * This is the type of the extension that should be loaded from the plugins directory for extending this security namespace. @@ -21753,7 +22803,6 @@ export function supportsNativeCopy(): boolean; export function supportsNativeHtmlCopy(): boolean; } declare module "VSS/Utils/Core" { -export var OperationCanceledException: string; /** * Wrap a function to ensure that a specific value of 'this' is passed to the function when it is invoked (regardless of the caller). * @@ -21883,7 +22932,7 @@ export class Cancelable { * @param action The action to wrap. * @return The cancellable action. */ - wrap(action: Function): IFunctionPR; + wrap(action: Function): Function; /** * Cancel the operation. */ @@ -21912,8 +22961,32 @@ export class DisposalManager implements IDisposable { */ dispose(): void; } -export function tryParseMSJSON(data: any, secure: boolean): any; -export function parseMSJSON(data: any, secure: boolean): any; +/** +* Deserialize an "MSJSON" formatted string into the corresponding JSON object. This converts a +* string like "\\/Date(1448375104308)\\/" into the corresponding Date object. +* +* Returns null if not a valid JSON string. +* +* @param data The JSON string to deserialize +* @param secure Unused parameter +*/ +export function tryParseMSJSON(data: any, secure?: boolean): any; +/** +* Deserialize an "MSJSON" formatted string into the corresponding JSON object. This converts a +* string like "\\/Date(1448375104308)\\/" into the corresponding Date object. +* +* Throws if not a valid JSON string. +* +* @param data The JSON string to deserialize +* @param secure Unused parameter +*/ +export function parseMSJSON(data: any, secure?: boolean): any; +/** +* Serialize a JSON object into "MSJSON" format which has date objects serialized in the +* format: "\\/Date(1448375104308)\\/" +* +* @param object The JSON object to serialize +*/ export function stringifyMSJSON(object: any): string; /** * Parse data from a JSON Island into an object @@ -21943,6 +23016,110 @@ export function parseXml(xml: string): any; export function equals(first: any, second: any): boolean; export var documentSelection: any; } +declare module "VSS/Utils/Culture" { +/** +* Culture-related settings +*/ +export interface ICultureInfo { + name: string; + numberFormat: INumberFormatSettings; + dateTimeFormat: IDateTimeFormatSettings; +} +/** +* Number formatting culture settings +*/ +export interface INumberFormatSettings { + CurrencyDecimalDigits: number; + CurrencyDecimalSeparator: string; + CurrencyGroupSizes: number[]; + NumberGroupSizes: number[]; + PercentGroupSizes: number[]; + CurrencyGroupSeparator: string; + CurrencySymbol: string; + NaNSymbol: string; + CurrencyNegativePattern: number; + NumberNegativePattern: number; + PercentPositivePattern: number; + PercentNegativePattern: number; + NegativeInfinitySymbol: string; + NegativeSign: string; + NumberDecimalDigits: number; + NumberDecimalSeparator: string; + NumberGroupSeparator: string; + CurrencyPositivePattern: number; + PositiveInfinitySymbol: string; + PositiveSign: string; + PercentDecimalDigits: number; + PercentDecimalSeparator: string; + PercentGroupSeparator: string; + PercentSymbol: string; + PerMilleSymbol: string; + NativeDigits: string[]; + DigitSubstitution: number; +} +/** +* DateTime-format related culture settings +*/ +export interface IDateTimeFormatSettings { + AMDesignator: string; + Calendar: { + MinSupportedDateTime: string; + MaxSupportedDateTime: string; + AlgorithmType: number; + CalendarType: number; + Eras: any[]; + TwoDigitYearMax: number; + convert?: { + fromGregorian: (date: Date) => number[]; + toGregorian: (year: number, month: number, day: number) => Date; + }; + }; + DateSeparator: string; + FirstDayOfWeek: number; + CalendarWeekRule: number; + FullDateTimePattern: string; + LongDatePattern: string; + LongTimePattern: string; + MonthDayPattern: string; + PMDesignator: string; + RFC1123Pattern: string; + ShortDatePattern: string; + ShortTimePattern: string; + SortableDateTimePattern: string; + TimeSeparator: string; + UniversalSortableDateTimePattern: string; + YearMonthPattern: string; + AbbreviatedDayNames: string[]; + ShortestDayNames: string[]; + DayNames: string[]; + AbbreviatedMonthNames: string[]; + MonthNames: string[]; + NativeCalendarName: string; + AbbreviatedMonthGenitiveNames: string[]; + MonthGenitiveNames: string[]; + eras: any[]; +} +/** +* Get culture settings for the invariant culture +*/ +export function getInvariantCulture(): ICultureInfo; +/** +* Get culture settings for the current user's preferred culture +*/ +export function getCurrentCulture(): ICultureInfo; +/** +* Get the name of the current culture being used on this page +*/ +export function getCurrentCultureName(): string; +/** +* Get the number format settings for the current culture +*/ +export function getNumberFormat(): INumberFormatSettings; +/** +* Get the DateTime format settings for the current culture +*/ +export function getDateTimeFormat(): IDateTimeFormatSettings; +} declare module "VSS/Utils/Date" { import Contracts_Platform = require("VSS/Common/Contracts/Platform"); export var utcOffset: number; @@ -21959,13 +23136,20 @@ export var DATETIME_MINDATE_UTC_MS: number; */ export function isMinDate(date: Date): boolean; /** - * Compares this date object with the given date object + * Compares two date objects. Returns a number: + * Less than 0 if date1 is earlier than date2 + * Zero if date1 is the same as date2 + * Greater than zero if date1 is later than date2 + * + * If an argument is not an instance of a Date then it is considered earlier than + * the other argument, or the same if the other argument is also not an instance of + * a Date * * @param date1 Date object to compare * @param date2 Date object to compare * @return */ -export function compare(date1: Date, date2: Date): number; +export function defaultComparer(date1: Date, date2: Date): number; /** * Compare two dates to see if they are equal - returning true if they are equal. * @@ -22251,6 +23435,7 @@ export class TemplateEngine { } } declare module "VSS/Utils/Number" { +import Culture = require("VSS/Utils/Culture"); /** * @param a * @param b @@ -22270,17 +23455,17 @@ export function defaultComparer(a: any, b: any): number; * @param cultureInfo Culture info (CurrentCulture if not specified) * @return */ -export function toDecimalLocaleString(num: number, includeGroupSeparators?: boolean, cultureInfo?: any): string; +export function toDecimalLocaleString(num: number, includeGroupSeparators?: boolean, cultureInfo?: Culture.ICultureInfo): string; /** * @param value * @return */ -export function parseLocale(value: string): number; +export function isPositiveNumber(value: any): boolean; /** * @param value * @return */ -export function isPositiveNumber(value: any): boolean; +export function parseLocale(value: string): number; /** * @param value * @return @@ -22294,6 +23479,7 @@ export function parseInvariant(value: string): number; export function localeFormat(value: number, format: string): string; } declare module "VSS/Utils/String" { +import Culture = require("VSS/Utils/Culture"); export var EmptyGuidString: string; export var empty: string; export var newLine: string; @@ -22418,6 +23604,9 @@ export function format(format: string, ...args: any[]): string; * @return */ export function localeFormat(format: string, ...args: any[]): string; +export function dateToString(value: Date, useLocale?: boolean, format?: string): string; +export function numberToString(value: number, useLocale?: boolean, format?: string): string; +export function parseDateString(value: string, cultureInfo?: Culture.ICultureInfo, formats?: string[]): Date; export function containsControlChars(str: string): boolean; export function containsMismatchedSurrogateChars(str: string): boolean; /** @@ -22430,18 +23619,50 @@ export function isGuid(str: string): boolean; export function isEmptyGuid(str: string): boolean; /** Returns a new, pseudo-random uid */ export function generateUID(): string; +/** +* Result from a singleSplit operation +*/ +export interface ISingleSplitResult { + /** + * The part of the string before the split (or the original string if no match) + */ + part1: string; + /** + * The segment of the string after the split + */ + part2: string; + /** + * Whether or not the separator was found in the string + */ + match: boolean; +} +/** +* Split a string into 2 parts by finding the first (or optionally, last) match of a given separator. +* This is close to the C# String.Split API using 2 as the "count". In javascript, supplying the count ignores everything +* in the string after that number of segments. For example calling "a b c".split(" ", 2) returns ["a", "b"] where in C# +* this would return ["a", "b c"]. This method works like the C# version where singleSplit("a b c", " ") will return +* { part1: "a", part2: "b c"}. +* +* @param value The string to split +* @param separator The separator string to split on +* @param ignoreCase Optional parameter to ignore case of the separator +* @param lastMatch If true, search in the reverse direction (find the last instance of the separator). By default, the first instance of the separator is used. +*/ +export function singleSplit(value: string, separator: string, ignoreCase?: boolean, lastMatch?: boolean): ISingleSplitResult; export class StringBuilder { private _textBuilder; /** * Utility class for building strings - similar to the System.Text.StringBuilder .NET class. + * + * @param initialText The initial text for the builder */ - constructor(); + constructor(initialText?: string); /** * Appends the specified text to the end of the string buffer. * * @param text The text to append. */ - append(text: string): void; + append(text: string | any): void; /** * Appends a new-line to the current text buffer. */ @@ -22515,13 +23736,19 @@ export enum KeyCode { T = 84, QUESTION_MARK = 191, } -/** - * Check if only the ctrl key modifier was pressed. - * - * @param e The event object. - */ export module KeyUtils { + /** + * Check if only the ctrl key modifier was pressed. + * + * @param e The event object. + */ function isExclusivelyCtrl(e: JQueryKeyEventObject): boolean; + /** + * Check if any modifier keys were pressed + * + * @param e The event object. + */ + function isModifierKey(e: JQueryKeyEventObject): boolean; } export module Constants { var HtmlNewLine: string; @@ -22761,7 +23988,6 @@ export function accessible(element: JQuery, handler?: Function): JQuery; export function Watermark(element: JQuery, ...args: any[]): JQuery; } declare module "VSS/Utils/Url" { -import Service = require("VSS/Service"); /** * Check if specified URL is safe - i.e. part of an approved list of URL schemes. * @@ -22786,7 +24012,7 @@ export function replaceUrlParam(url: string, paramName: string, paramValue: stri * @returns {boolean} */ export function isUrlWithinConstraints(url: string): boolean; -export class UrlTranslatorService implements Service.ILocalService { +export class UrlTranslatorService { private _urlTranslators; /** * Registers a URL translator function. @@ -22802,6 +24028,99 @@ export function getTranslatorService(): UrlTranslatorService; * Extract query parameters as a dictionary */ export function getQueryParameters(url: string): IDictionaryStringTo; +/** +* A single query parameter entry in a Uri +*/ +export interface IQueryParameter { + /** + * Unencoded name of the query parameter + */ + name: string; + /** + * Unencoded value of the query parameter + */ + value: string; +} +/** +* Options for parsing a Uri string +*/ +export interface IUriParseOptions { + /** + * If true, throw if the Uri is not absolute + */ + absoluteUriRequired?: boolean; +} +/** +* Class that represents a Uri and allows parsing/getting and setting of individual parts +*/ +export class Uri { + /** + * The uri scheme such as http or https + */ + scheme: string; + /** + * The uri hostname (does not include port or scheme) + */ + host: string; + /** + * The port number of the uri as supplied in the url. 0 if left out in the url (e.g. the default port for the scheme). + */ + port: number; + /** + * The relative path of the uri + */ + path: string; + /** + * The array of query parameters in the uri + */ + queryParameters: IQueryParameter[]; + /** + * The hash string of the uri + */ + hashString: string; + /** + * Parse a uri string into a Uri member + * + * @param uri Uri string to parse + * @param options Options for parsing the uri string + */ + static parse(uri: string, options?: IUriParseOptions): Uri; + /** + * Create a new Uri. + * + * @param uri Optional uri string to populate values with + */ + constructor(uri?: string); + private _setFromUriString(uriString, options?); + /** + * Get the absolute uri string for this Uri + */ + /** + * Set the absolute uri string for this Uri. Replaces all existing values + */ + absoluteUri: string; + /** + * Get the query string for this Uri. + */ + /** + * Set the query string for this Uri. Replaces existing value + */ + queryString: string; + /** + * Get the value of the query parameter with the given key + * + * @param name Query parameter name + */ + getQueryParam(name: string): string; + /** + * Adds a query string parameter to the current uri + * + * @param name The Query parameter name + * @param value The Query parameter value + * @param replaceExisting If true, replace all existing parameters with the same name + */ + addQueryParam(name: string, value: string, replaceExisting?: boolean): void; +} } declare module "VSS/VSS" { export var uiCulture: string; @@ -22887,6 +24206,7 @@ export class ErrorHandler { */ initialize(): void; private attachWindowErrorHandler(); + static ignoreRejectedPromiseTag: string; private attachQPromiseErrorHandler(); private publishError(error); /** @@ -23014,6 +24334,7 @@ export module CommonIdentityPickerResourceIds { var IdentitiesResource: string; } export module ContributionsResourceIds { + var DataProvidersQueryLocationId: string; var InstalledAppsLocationId: string; var InstalledAppsByNameLocationId: string; var VDiscId: string; @@ -23021,9 +24342,10 @@ export module ContributionsResourceIds { var VDiscCompatLocationId: string; var AreaId: string; var ContributionsAreaName: string; - var InstalledAppsLocationIdString: string; - var InstalledAppsByNameLocationIdString: string; var ExtensionsAreaName: string; + var DataProvidersQueryLocationIdString: string; + var InstalledExtensionsLocationIdString: string; + var InstalledExtensionsByNameLocationIdString: string; var VersionDiscoveryLocationIdString: string; var VDiscCompatLocationIdString: string; } @@ -23044,6 +24366,12 @@ export module DataImportLocationIds { var AreaName: string; var DataImportResource: string; } +/** +* Mustache items names available in replacement oject while resolving a mustache template +*/ +export module ExtensionTemplateContextItemNames { + var ServiceInstanceType: string; +} export module FeatureAvailabilityResourceIds { var FeatureFlagsLocationId: string; var AreaId: string; @@ -23447,6 +24775,7 @@ export class VssHttpClient { private static APIS_RELATIVE_PATH; private static DEFAULT_REQUEST_TIMEOUT; private static _legacyDateRegExp; + private static cacheFromJsonIslands; private _locationsByAreaPromises; _rootRequestPath: string; authTokenManager: IAuthTokenManager; @@ -23491,6 +24820,9 @@ export class VssHttpClient { * @param locationId Guid of the location to get */ _beginGetLocation(area: string, locationId: string): IPromise; + private static processOptionsRequestResponse(locationsResult?, textStatus?, jqXHR?); + private static initializeLocationsByAreaJsonIslandCacheIfNecessary(); + private static createLocationsByAreaPromisesCache(); private beginGetAreaLocations(area); protected getRequestUrl(routeTemplate: string, area: string, resource: string, routeValues: any, queryParams?: IDictionaryStringTo): string; private replaceRouteValues(routeTemplate, routeValues);