UNPKG

17.6 kBTypeScriptView Raw
1/// <reference types="node" />
2import basem = require('./ClientApiBases');
3import VsoBaseInterfaces = require('./interfaces/common/VsoBaseInterfaces');
4import TaskAgentInterfaces = require("./interfaces/TaskAgentInterfaces");
5import VSSInterfaces = require("./interfaces/common/VSSInterfaces");
6export interface ITaskApi extends basem.ClientApiBase {
7 getPlanAttachments(scopeIdentifier: string, hubName: string, planId: string, type: string): Promise<TaskAgentInterfaces.TaskAttachment[]>;
8 createAttachment(customHeaders: any, contentStream: NodeJS.ReadableStream, scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string): Promise<TaskAgentInterfaces.TaskAttachment>;
9 createAttachmentFromArtifact(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string, artifactHash: string, length: number): Promise<TaskAgentInterfaces.TaskAttachment>;
10 getAttachment(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string): Promise<TaskAgentInterfaces.TaskAttachment>;
11 getAttachmentContent(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string): Promise<NodeJS.ReadableStream>;
12 getAttachments(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string): Promise<TaskAgentInterfaces.TaskAttachment[]>;
13 appendTimelineRecordFeed(lines: TaskAgentInterfaces.TimelineRecordFeedLinesWrapper, scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string): Promise<void>;
14 getLines(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, stepId: string, endLine?: number, takeCount?: number, continuationToken?: string): Promise<TaskAgentInterfaces.TimelineRecordFeedLinesWrapper>;
15 getJobInstance(scopeIdentifier: string, hubName: string, orchestrationId: string): Promise<TaskAgentInterfaces.TaskAgentJob>;
16 appendLogContent(customHeaders: any, contentStream: NodeJS.ReadableStream, scopeIdentifier: string, hubName: string, planId: string, logId: number): Promise<TaskAgentInterfaces.TaskLog>;
17 associateLog(scopeIdentifier: string, hubName: string, planId: string, logId: number, serializedBlobId: string, lineCount: number): Promise<TaskAgentInterfaces.TaskLog>;
18 createLog(log: TaskAgentInterfaces.TaskLog, scopeIdentifier: string, hubName: string, planId: string): Promise<TaskAgentInterfaces.TaskLog>;
19 getLog(scopeIdentifier: string, hubName: string, planId: string, logId: number, startLine?: number, endLine?: number): Promise<string[]>;
20 getLogs(scopeIdentifier: string, hubName: string, planId: string): Promise<TaskAgentInterfaces.TaskLog[]>;
21 getPlanGroupsQueueMetrics(scopeIdentifier: string, hubName: string): Promise<TaskAgentInterfaces.TaskOrchestrationPlanGroupsQueueMetrics[]>;
22 createOidcToken(claims: {
23 [key: string]: string;
24 }, scopeIdentifier: string, hubName: string, planId: string, jobId: string, serviceConnectionId?: string): Promise<TaskAgentInterfaces.TaskHubOidcToken>;
25 getQueuedPlanGroups(scopeIdentifier: string, hubName: string, statusFilter?: TaskAgentInterfaces.PlanGroupStatus, count?: number): Promise<TaskAgentInterfaces.TaskOrchestrationQueuedPlanGroup[]>;
26 getQueuedPlanGroup(scopeIdentifier: string, hubName: string, planGroup: string): Promise<TaskAgentInterfaces.TaskOrchestrationQueuedPlanGroup>;
27 getPlan(scopeIdentifier: string, hubName: string, planId: string): Promise<TaskAgentInterfaces.TaskOrchestrationPlan>;
28 getRecords(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, changeId?: number): Promise<TaskAgentInterfaces.TimelineRecord[]>;
29 updateRecords(records: VSSInterfaces.VssJsonCollectionWrapperV<TaskAgentInterfaces.TimelineRecord[]>, scopeIdentifier: string, hubName: string, planId: string, timelineId: string): Promise<TaskAgentInterfaces.TimelineRecord[]>;
30 createTimeline(timeline: TaskAgentInterfaces.Timeline, scopeIdentifier: string, hubName: string, planId: string): Promise<TaskAgentInterfaces.Timeline>;
31 deleteTimeline(scopeIdentifier: string, hubName: string, planId: string, timelineId: string): Promise<void>;
32 getTimeline(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, changeId?: number, includeRecords?: boolean): Promise<TaskAgentInterfaces.Timeline>;
33 getTimelines(scopeIdentifier: string, hubName: string, planId: string): Promise<TaskAgentInterfaces.Timeline[]>;
34}
35export declare class TaskApi extends basem.ClientApiBase implements ITaskApi {
36 constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[], options?: VsoBaseInterfaces.IRequestOptions);
37 /**
38 * @param {string} scopeIdentifier - The project GUID to scope the request
39 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
40 * @param {string} planId
41 * @param {string} type
42 */
43 getPlanAttachments(scopeIdentifier: string, hubName: string, planId: string, type: string): Promise<TaskAgentInterfaces.TaskAttachment[]>;
44 /**
45 * @param {NodeJS.ReadableStream} contentStream - Content to upload
46 * @param {string} scopeIdentifier - The project GUID to scope the request
47 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
48 * @param {string} planId
49 * @param {string} timelineId
50 * @param {string} recordId
51 * @param {string} type
52 * @param {string} name
53 */
54 createAttachment(customHeaders: any, contentStream: NodeJS.ReadableStream, scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string): Promise<TaskAgentInterfaces.TaskAttachment>;
55 /**
56 * @param {string} scopeIdentifier - The project GUID to scope the request
57 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
58 * @param {string} planId
59 * @param {string} timelineId
60 * @param {string} recordId
61 * @param {string} type
62 * @param {string} name
63 * @param {string} artifactHash
64 * @param {number} length
65 */
66 createAttachmentFromArtifact(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string, artifactHash: string, length: number): Promise<TaskAgentInterfaces.TaskAttachment>;
67 /**
68 * @param {string} scopeIdentifier - The project GUID to scope the request
69 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
70 * @param {string} planId
71 * @param {string} timelineId
72 * @param {string} recordId
73 * @param {string} type
74 * @param {string} name
75 */
76 getAttachment(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string): Promise<TaskAgentInterfaces.TaskAttachment>;
77 /**
78 * @param {string} scopeIdentifier - The project GUID to scope the request
79 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
80 * @param {string} planId
81 * @param {string} timelineId
82 * @param {string} recordId
83 * @param {string} type
84 * @param {string} name
85 */
86 getAttachmentContent(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string, name: string): Promise<NodeJS.ReadableStream>;
87 /**
88 * @param {string} scopeIdentifier - The project GUID to scope the request
89 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
90 * @param {string} planId
91 * @param {string} timelineId
92 * @param {string} recordId
93 * @param {string} type
94 */
95 getAttachments(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, type: string): Promise<TaskAgentInterfaces.TaskAttachment[]>;
96 /**
97 * Append content to timeline record feed.
98 *
99 * @param {TaskAgentInterfaces.TimelineRecordFeedLinesWrapper} lines - Content to be appended to the timeline record feed.
100 * @param {string} scopeIdentifier - The project GUID to scope the request
101 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
102 * @param {string} planId - ID of the plan.
103 * @param {string} timelineId - ID of the task's timeline.
104 * @param {string} recordId - ID of the timeline record.
105 */
106 appendTimelineRecordFeed(lines: TaskAgentInterfaces.TimelineRecordFeedLinesWrapper, scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string): Promise<void>;
107 /**
108 * @param {string} scopeIdentifier - The project GUID to scope the request
109 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
110 * @param {string} planId
111 * @param {string} timelineId
112 * @param {string} recordId
113 * @param {string} stepId
114 * @param {number} endLine
115 * @param {number} takeCount
116 * @param {string} continuationToken
117 */
118 getLines(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, recordId: string, stepId: string, endLine?: number, takeCount?: number, continuationToken?: string): Promise<TaskAgentInterfaces.TimelineRecordFeedLinesWrapper>;
119 /**
120 * @param {string} scopeIdentifier - The project GUID to scope the request
121 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
122 * @param {string} orchestrationId
123 */
124 getJobInstance(scopeIdentifier: string, hubName: string, orchestrationId: string): Promise<TaskAgentInterfaces.TaskAgentJob>;
125 /**
126 * Append a log to a task's log. The log should be sent in the body of the request as a TaskLog object stream.
127 *
128 * @param {NodeJS.ReadableStream} contentStream - Content to upload
129 * @param {string} scopeIdentifier - The project GUID to scope the request
130 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
131 * @param {string} planId - The ID of the plan.
132 * @param {number} logId - The ID of the log.
133 */
134 appendLogContent(customHeaders: any, contentStream: NodeJS.ReadableStream, scopeIdentifier: string, hubName: string, planId: string, logId: number): Promise<TaskAgentInterfaces.TaskLog>;
135 /**
136 * @param {string} scopeIdentifier - The project GUID to scope the request
137 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
138 * @param {string} planId
139 * @param {number} logId
140 * @param {string} serializedBlobId
141 * @param {number} lineCount
142 */
143 associateLog(scopeIdentifier: string, hubName: string, planId: string, logId: number, serializedBlobId: string, lineCount: number): Promise<TaskAgentInterfaces.TaskLog>;
144 /**
145 * Create a log and connect it to a pipeline run's execution plan.
146 *
147 * @param {TaskAgentInterfaces.TaskLog} log - An object that contains information about log's path.
148 * @param {string} scopeIdentifier - The project GUID to scope the request
149 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
150 * @param {string} planId - The ID of the plan.
151 */
152 createLog(log: TaskAgentInterfaces.TaskLog, scopeIdentifier: string, hubName: string, planId: string): Promise<TaskAgentInterfaces.TaskLog>;
153 /**
154 * @param {string} scopeIdentifier - The project GUID to scope the request
155 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
156 * @param {string} planId
157 * @param {number} logId
158 * @param {number} startLine
159 * @param {number} endLine
160 */
161 getLog(scopeIdentifier: string, hubName: string, planId: string, logId: number, startLine?: number, endLine?: number): Promise<string[]>;
162 /**
163 * @param {string} scopeIdentifier - The project GUID to scope the request
164 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
165 * @param {string} planId
166 */
167 getLogs(scopeIdentifier: string, hubName: string, planId: string): Promise<TaskAgentInterfaces.TaskLog[]>;
168 /**
169 * @param {string} scopeIdentifier - The project GUID to scope the request
170 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
171 */
172 getPlanGroupsQueueMetrics(scopeIdentifier: string, hubName: string): Promise<TaskAgentInterfaces.TaskOrchestrationPlanGroupsQueueMetrics[]>;
173 /**
174 * @param {{ [key: string] : string; }} claims
175 * @param {string} scopeIdentifier - The project GUID to scope the request
176 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
177 * @param {string} planId
178 * @param {string} jobId
179 * @param {string} serviceConnectionId
180 */
181 createOidcToken(claims: {
182 [key: string]: string;
183 }, scopeIdentifier: string, hubName: string, planId: string, jobId: string, serviceConnectionId?: string): Promise<TaskAgentInterfaces.TaskHubOidcToken>;
184 /**
185 * @param {string} scopeIdentifier - The project GUID to scope the request
186 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
187 * @param {TaskAgentInterfaces.PlanGroupStatus} statusFilter
188 * @param {number} count
189 */
190 getQueuedPlanGroups(scopeIdentifier: string, hubName: string, statusFilter?: TaskAgentInterfaces.PlanGroupStatus, count?: number): Promise<TaskAgentInterfaces.TaskOrchestrationQueuedPlanGroup[]>;
191 /**
192 * @param {string} scopeIdentifier - The project GUID to scope the request
193 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
194 * @param {string} planGroup
195 */
196 getQueuedPlanGroup(scopeIdentifier: string, hubName: string, planGroup: string): Promise<TaskAgentInterfaces.TaskOrchestrationQueuedPlanGroup>;
197 /**
198 * @param {string} scopeIdentifier - The project GUID to scope the request
199 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
200 * @param {string} planId
201 */
202 getPlan(scopeIdentifier: string, hubName: string, planId: string): Promise<TaskAgentInterfaces.TaskOrchestrationPlan>;
203 /**
204 * @param {string} scopeIdentifier - The project GUID to scope the request
205 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
206 * @param {string} planId
207 * @param {string} timelineId
208 * @param {number} changeId
209 */
210 getRecords(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, changeId?: number): Promise<TaskAgentInterfaces.TimelineRecord[]>;
211 /**
212 * Update timeline records if they already exist, otherwise create new ones for the same timeline.
213 *
214 * @param {VSSInterfaces.VssJsonCollectionWrapperV<TaskAgentInterfaces.TimelineRecord[]>} records - The array of timeline records to be updated.
215 * @param {string} scopeIdentifier - The project GUID to scope the request
216 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
217 * @param {string} planId - The ID of the plan.
218 * @param {string} timelineId - The ID of the timeline.
219 */
220 updateRecords(records: VSSInterfaces.VssJsonCollectionWrapperV<TaskAgentInterfaces.TimelineRecord[]>, scopeIdentifier: string, hubName: string, planId: string, timelineId: string): Promise<TaskAgentInterfaces.TimelineRecord[]>;
221 /**
222 * @param {TaskAgentInterfaces.Timeline} timeline
223 * @param {string} scopeIdentifier - The project GUID to scope the request
224 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
225 * @param {string} planId
226 */
227 createTimeline(timeline: TaskAgentInterfaces.Timeline, scopeIdentifier: string, hubName: string, planId: string): Promise<TaskAgentInterfaces.Timeline>;
228 /**
229 * @param {string} scopeIdentifier - The project GUID to scope the request
230 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
231 * @param {string} planId
232 * @param {string} timelineId
233 */
234 deleteTimeline(scopeIdentifier: string, hubName: string, planId: string, timelineId: string): Promise<void>;
235 /**
236 * @param {string} scopeIdentifier - The project GUID to scope the request
237 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
238 * @param {string} planId
239 * @param {string} timelineId
240 * @param {number} changeId
241 * @param {boolean} includeRecords
242 */
243 getTimeline(scopeIdentifier: string, hubName: string, planId: string, timelineId: string, changeId?: number, includeRecords?: boolean): Promise<TaskAgentInterfaces.Timeline>;
244 /**
245 * @param {string} scopeIdentifier - The project GUID to scope the request
246 * @param {string} hubName - The name of the server hub. Common examples: "build", "rm", "checks"
247 * @param {string} planId
248 */
249 getTimelines(scopeIdentifier: string, hubName: string, planId: string): Promise<TaskAgentInterfaces.Timeline[]>;
250}