Skip to content

Commit d5a10bc

Browse files
Merge pull request #15 from Microsoft/users/scdallam/collectiontasks
new TaskAgentApi to support collection-level tasks
2 parents d5e6b87 + 7d4a742 commit d5a10bc

6 files changed

Lines changed: 2835 additions & 1762 deletions

File tree

api/HttpClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export class HttpClient implements ifm.IHttpClient {
100100
prot = proxyUrl.protocol === 'https:' ? https: http;
101101
}
102102

103-
var options = { headers: {}};
103+
var options: any = { headers: {}};
104104

105105
var useProxy = proxyUrl && proxyUrl.hostname;
106106
if (useProxy) {

api/TaskAgentApi.ts

Lines changed: 227 additions & 1749 deletions
Large diffs are not rendered by default.

api/TaskAgentApiBase.ts

Lines changed: 2508 additions & 0 deletions
Large diffs are not rendered by default.

api/VsoClient.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,12 @@ export class VsoClient {
9595
var requestUrl;
9696
var deferred = Q.defer<ClientVersioningData>();
9797

98-
this._beginGetLocation(area, locationId)
98+
this.beginGetLocation(area, locationId)
9999
.then((location: ifm.ApiResourceLocation) => {
100+
if (!location) {
101+
throw new Error("Failed to find api location for area: " + area + " id: " + locationId);
102+
}
103+
100104
if (!apiVersion) {
101105
// Use the latest version of the resource if the api version was not specified in the request.
102106
apiVersion = location.maxVersion + VsoClient.PREVIEW_INDICATOR + location.resourceVersion;
@@ -136,23 +140,19 @@ export class VsoClient {
136140
this._initializationPromise = promise;
137141
}
138142
}
139-
143+
140144
/**
141145
* Gets information about an API resource location (route template, supported versions, etc.)
142146
*
143147
* @param area resource area name
144148
* @param locationId Guid of the location to get
145149
*/
146-
public _beginGetLocation(area: string, locationId: string): Q.Promise<ifm.ApiResourceLocation> {
150+
public beginGetLocation(area: string, locationId: string): Q.Promise<ifm.ApiResourceLocation> {
147151
return this._initializationPromise.then(() => {
148-
return this.beginGetAreaLocations(area);
149-
}).then((areaLocations: VssApiResourceLocationLookup) => {
150-
var location = areaLocations[(locationId || "").toLowerCase()];
151-
if (!location) {
152-
throw new Error("Failed to find api location for area: " + area + " id: " + locationId);
153-
}
154-
return location;
155-
});
152+
return this.beginGetAreaLocations(area);
153+
}).then((areaLocations: VssApiResourceLocationLookup) => {
154+
return areaLocations[(locationId || "").toLowerCase()];
155+
});
156156
}
157157

158158
private beginGetAreaLocations(area: string): Q.Promise<VssApiResourceLocationLookup> {

api/interfaces/TaskAgentInterfaces.ts

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
"use strict";
1212

13+
import FormInputInterfaces = require("../interfaces/common/FormInputInterfaces");
1314
import VSSInterfaces = require("../interfaces/common/VSSInterfaces");
1415

1516

@@ -51,6 +52,18 @@ export enum ConnectedServiceKind {
5152
GitHub = 4,
5253
}
5354

55+
export interface DataSource {
56+
endpointUrl: string;
57+
name: string;
58+
resultSelector: string;
59+
}
60+
61+
export interface DataSourceBinding {
62+
dataSourceName: string;
63+
endpointId: string;
64+
parameters: { [key: string] : string; };
65+
}
66+
5467
export interface EndpointAuthorization {
5568
parameters: { [key: string] : string; };
5669
scheme: string;
@@ -177,6 +190,21 @@ export interface ServiceEndpoint {
177190
url: string;
178191
}
179192

193+
export interface ServiceEndpointAuthenticationScheme {
194+
displayName: string;
195+
inputDescriptors: FormInputInterfaces.InputDescriptor[];
196+
scheme: string;
197+
}
198+
199+
export interface ServiceEndpointType {
200+
authenticationSchemes: ServiceEndpointAuthenticationScheme[];
201+
dataSources: DataSource[];
202+
description: string;
203+
displayName: string;
204+
imageUrl: string;
205+
name: string;
206+
}
207+
180208
export interface TaskAgent extends TaskAgentReference {
181209
/**
182210
* Gets the date on which this agent was created.
@@ -253,6 +281,10 @@ export interface TaskAgentPool extends TaskAgentPoolReference {
253281
*/
254282
isHosted: boolean;
255283
properties: any;
284+
/**
285+
* Gets a value indicating whether or not roles have been provisioned for this pool.
286+
*/
287+
provisioned: boolean;
256288
/**
257289
* Gets the service accounts group for this agent pool.
258290
*/
@@ -270,9 +302,17 @@ export interface TaskAgentPoolReference {
270302
}
271303

272304
export interface TaskAgentQueue {
305+
groupScopeId: string;
273306
id: number;
274307
name: string;
275308
pool: TaskAgentPoolReference;
309+
provisioned: boolean;
310+
}
311+
312+
export enum TaskAgentQueueActionFilter {
313+
None = 0,
314+
Manage = 2,
315+
Use = 16,
276316
}
277317

278318
export interface TaskAgentReference {
@@ -308,6 +348,8 @@ export interface TaskAttachment {
308348
lastChangedBy: string;
309349
lastChangedOn: Date;
310350
name: string;
351+
recordId: string;
352+
timelineId: string;
311353
type: string;
312354
}
313355

@@ -444,6 +486,8 @@ export interface TaskOrchestrationPlan extends TaskOrchestrationPlanReference {
444486
environment: PlanEnvironment;
445487
finishTime: Date;
446488
implementation: TaskOrchestrationContainer;
489+
requestedById: string;
490+
requestedForId: string;
447491
result: TaskResult;
448492
resultCode: string;
449493
startTime: Date;
@@ -653,6 +697,12 @@ export var TypeInfo = {
653697
"gitHub": 4,
654698
}
655699
},
700+
DataSource: {
701+
fields: <any>null
702+
},
703+
DataSourceBinding: {
704+
fields: <any>null
705+
},
656706
EndpointAuthorization: {
657707
fields: <any>null
658708
},
@@ -701,6 +751,12 @@ export var TypeInfo = {
701751
ServiceEndpoint: {
702752
fields: <any>null
703753
},
754+
ServiceEndpointAuthenticationScheme: {
755+
fields: <any>null
756+
},
757+
ServiceEndpointType: {
758+
fields: <any>null
759+
},
704760
TaskAgent: {
705761
fields: <any>null
706762
},
@@ -719,6 +775,13 @@ export var TypeInfo = {
719775
TaskAgentQueue: {
720776
fields: <any>null
721777
},
778+
TaskAgentQueueActionFilter: {
779+
enumValues: {
780+
"none": 0,
781+
"manage": 2,
782+
"use": 16,
783+
}
784+
},
722785
TaskAgentReference: {
723786
fields: <any>null
724787
},
@@ -856,6 +919,12 @@ TypeInfo.AgentQueueEvent.fields = {
856919
TypeInfo.AgentRefreshMessage.fields = {
857920
};
858921

922+
TypeInfo.DataSource.fields = {
923+
};
924+
925+
TypeInfo.DataSourceBinding.fields = {
926+
};
927+
859928
TypeInfo.EndpointAuthorization.fields = {
860929
};
861930

@@ -955,6 +1024,24 @@ TypeInfo.ServiceEndpoint.fields = {
9551024
},
9561025
};
9571026

1027+
TypeInfo.ServiceEndpointAuthenticationScheme.fields = {
1028+
inputDescriptors: {
1029+
isArray: true,
1030+
typeInfo: FormInputInterfaces.TypeInfo.InputDescriptor
1031+
},
1032+
};
1033+
1034+
TypeInfo.ServiceEndpointType.fields = {
1035+
authenticationSchemes: {
1036+
isArray: true,
1037+
typeInfo: TypeInfo.ServiceEndpointAuthenticationScheme
1038+
},
1039+
dataSources: {
1040+
isArray: true,
1041+
typeInfo: TypeInfo.DataSource
1042+
},
1043+
};
1044+
9581045
TypeInfo.TaskAgent.fields = {
9591046
createdOn: {
9601047
isDate: true,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vso-node-api",
33
"description": "Node client for Visual Studio Online/TFS REST APIs",
4-
"version": "0.4.2",
4+
"version": "0.4.3",
55
"main": "./WebApi.js",
66
"repository": {
77
"type": "git",

0 commit comments

Comments
 (0)