Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#535: Fix install packages for Node.js 6 #536

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions api/TaskApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export interface ITaskApi extends basem.ClientApiBase {
deleteTimeline(scopeIdentifier: string, hubName: string, planId: string, timelineId: string): Promise<void>;
getTimeline(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, changeId?: number, includeRecords?: boolean): Promise<TaskAgentInterfaces.Timeline>;
getTimelines(scopeIdentifier: string, hubName: string, planId: string): Promise<TaskAgentInterfaces.Timeline[]>;
updateEvents(records: TaskAgentInterfaces.TaskCompletedEvent, scopeIdentifier: string, hubName: string, planId: string, timelineId: string): Promise<void>;
}

export class TaskApi extends basem.ClientApiBase implements ITaskApi {
Expand Down Expand Up @@ -1318,4 +1319,54 @@ export class TaskApi extends basem.ClientApiBase implements ITaskApi {
});
}

/**
* @param {TaskAgentInterfaces.TaskCompletedEvent} event
* @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
*/
public async updateEvents(
event: TaskAgentInterfaces.TaskCompletedEvent,
scopeIdentifier: string,
hubName: string,
planId: string,
timelineId: string
): Promise<void> {

return new Promise<void>(async (resolve, reject) => {
let routeValues: any = {
scopeIdentifier: scopeIdentifier,
hubName: hubName,
planId: planId,
timelineId: timelineId
};

try {
let verData: vsom.ClientVersioningData = await this.vsoClient.getVersioningData(
"7.1-preview.1",
"distributedtask",
"557624af-b29e-4c20-8ab0-0399d2204f3f",
routeValues);

let url: string = verData.requestUrl!;
let options: restm.IRequestOptions = this.createRequestOptions('application/json',
verData.apiVersion);

let res: restm.IRestResponse<TaskAgentInterfaces.TaskAttachment[]>;
res = await this.rest.create<TaskAgentInterfaces.TaskAttachment[]>(url, event, options);

let ret = this.formatResponse(res.result,
null,
true);

resolve(ret);

}
catch (err) {
reject(err);
}
});
}

}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
"typed-rest-client": "^1.8.4"
},
"devDependencies": {
"@types/glob": "5.0.35",
"@types/minimatch": "3.0.3",
"@types/mocha": "^2.2.44",
"@types/shelljs": "0.7.8",
"mocha": "^3.5.3",
Expand Down