1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
12 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
13 | return new (P || (P = Promise))(function (resolve, reject) {
|
14 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
15 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
16 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
17 | step((generator = generator.apply(thisArg, _arguments || [])).next());
|
18 | });
|
19 | };
|
20 | Object.defineProperty(exports, "__esModule", { value: true });
|
21 | exports.PipelinesApi = void 0;
|
22 | const basem = require("./ClientApiBases");
|
23 | const PipelinesInterfaces = require("./interfaces/PipelinesInterfaces");
|
24 | class PipelinesApi extends basem.ClientApiBase {
|
25 | constructor(baseUrl, handlers, options) {
|
26 | super(baseUrl, handlers, 'node-Pipelines-api', options);
|
27 | }
|
28 | |
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 | getArtifact(project, pipelineId, runId, artifactName, expand) {
|
38 | return __awaiter(this, void 0, void 0, function* () {
|
39 | if (artifactName == null) {
|
40 | throw new TypeError('artifactName can not be null or undefined');
|
41 | }
|
42 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
43 | let routeValues = {
|
44 | project: project,
|
45 | pipelineId: pipelineId,
|
46 | runId: runId
|
47 | };
|
48 | let queryValues = {
|
49 | artifactName: artifactName,
|
50 | '$expand': expand,
|
51 | };
|
52 | try {
|
53 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "85023071-bd5e-4438-89b0-2a5bf362a19d", routeValues, queryValues);
|
54 | let url = verData.requestUrl;
|
55 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
56 | let res;
|
57 | res = yield this.rest.get(url, options);
|
58 | let ret = this.formatResponse(res.result, PipelinesInterfaces.TypeInfo.Artifact, false);
|
59 | resolve(ret);
|
60 | }
|
61 | catch (err) {
|
62 | reject(err);
|
63 | }
|
64 | }));
|
65 | });
|
66 | }
|
67 | |
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 | getLog(project, pipelineId, runId, logId, expand) {
|
77 | return __awaiter(this, void 0, void 0, function* () {
|
78 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
79 | let routeValues = {
|
80 | project: project,
|
81 | pipelineId: pipelineId,
|
82 | runId: runId,
|
83 | logId: logId
|
84 | };
|
85 | let queryValues = {
|
86 | '$expand': expand,
|
87 | };
|
88 | try {
|
89 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "fb1b6d27-3957-43d5-a14b-a2d70403e545", routeValues, queryValues);
|
90 | let url = verData.requestUrl;
|
91 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
92 | let res;
|
93 | res = yield this.rest.get(url, options);
|
94 | let ret = this.formatResponse(res.result, PipelinesInterfaces.TypeInfo.Log, false);
|
95 | resolve(ret);
|
96 | }
|
97 | catch (err) {
|
98 | reject(err);
|
99 | }
|
100 | }));
|
101 | });
|
102 | }
|
103 | |
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 |
|
111 | listLogs(project, pipelineId, runId, expand) {
|
112 | return __awaiter(this, void 0, void 0, function* () {
|
113 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
114 | let routeValues = {
|
115 | project: project,
|
116 | pipelineId: pipelineId,
|
117 | runId: runId
|
118 | };
|
119 | let queryValues = {
|
120 | '$expand': expand,
|
121 | };
|
122 | try {
|
123 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "fb1b6d27-3957-43d5-a14b-a2d70403e545", routeValues, queryValues);
|
124 | let url = verData.requestUrl;
|
125 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
126 | let res;
|
127 | res = yield this.rest.get(url, options);
|
128 | let ret = this.formatResponse(res.result, PipelinesInterfaces.TypeInfo.LogCollection, false);
|
129 | resolve(ret);
|
130 | }
|
131 | catch (err) {
|
132 | reject(err);
|
133 | }
|
134 | }));
|
135 | });
|
136 | }
|
137 | |
138 |
|
139 |
|
140 |
|
141 |
|
142 |
|
143 | createPipeline(inputParameters, project) {
|
144 | return __awaiter(this, void 0, void 0, function* () {
|
145 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
146 | let routeValues = {
|
147 | project: project
|
148 | };
|
149 | try {
|
150 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "28e1305e-2afe-47bf-abaf-cbb0e6a91988", routeValues);
|
151 | let url = verData.requestUrl;
|
152 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
153 | let res;
|
154 | res = yield this.rest.create(url, inputParameters, options);
|
155 | let ret = this.formatResponse(res.result, PipelinesInterfaces.TypeInfo.Pipeline, false);
|
156 | resolve(ret);
|
157 | }
|
158 | catch (err) {
|
159 | reject(err);
|
160 | }
|
161 | }));
|
162 | });
|
163 | }
|
164 | |
165 |
|
166 |
|
167 |
|
168 |
|
169 |
|
170 |
|
171 | getPipeline(project, pipelineId, pipelineVersion) {
|
172 | return __awaiter(this, void 0, void 0, function* () {
|
173 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
174 | let routeValues = {
|
175 | project: project,
|
176 | pipelineId: pipelineId
|
177 | };
|
178 | let queryValues = {
|
179 | pipelineVersion: pipelineVersion,
|
180 | };
|
181 | try {
|
182 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "28e1305e-2afe-47bf-abaf-cbb0e6a91988", routeValues, queryValues);
|
183 | let url = verData.requestUrl;
|
184 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
185 | let res;
|
186 | res = yield this.rest.get(url, options);
|
187 | let ret = this.formatResponse(res.result, PipelinesInterfaces.TypeInfo.Pipeline, false);
|
188 | resolve(ret);
|
189 | }
|
190 | catch (err) {
|
191 | reject(err);
|
192 | }
|
193 | }));
|
194 | });
|
195 | }
|
196 | |
197 |
|
198 |
|
199 |
|
200 |
|
201 |
|
202 |
|
203 |
|
204 | listPipelines(project, orderBy, top, continuationToken) {
|
205 | return __awaiter(this, void 0, void 0, function* () {
|
206 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
207 | let routeValues = {
|
208 | project: project
|
209 | };
|
210 | let queryValues = {
|
211 | orderBy: orderBy,
|
212 | '$top': top,
|
213 | continuationToken: continuationToken,
|
214 | };
|
215 | try {
|
216 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "28e1305e-2afe-47bf-abaf-cbb0e6a91988", routeValues, queryValues);
|
217 | let url = verData.requestUrl;
|
218 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
219 | let res;
|
220 | res = yield this.rest.get(url, options);
|
221 | let ret = this.formatResponse(res.result, PipelinesInterfaces.TypeInfo.Pipeline, true);
|
222 | resolve(ret);
|
223 | }
|
224 | catch (err) {
|
225 | reject(err);
|
226 | }
|
227 | }));
|
228 | });
|
229 | }
|
230 | |
231 |
|
232 |
|
233 |
|
234 |
|
235 |
|
236 |
|
237 |
|
238 | preview(runParameters, project, pipelineId, pipelineVersion) {
|
239 | return __awaiter(this, void 0, void 0, function* () {
|
240 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
241 | let routeValues = {
|
242 | project: project,
|
243 | pipelineId: pipelineId
|
244 | };
|
245 | let queryValues = {
|
246 | pipelineVersion: pipelineVersion,
|
247 | };
|
248 | try {
|
249 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "53df2d18-29ea-46a9-bee0-933540f80abf", routeValues, queryValues);
|
250 | let url = verData.requestUrl;
|
251 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
252 | let res;
|
253 | res = yield this.rest.create(url, runParameters, options);
|
254 | let ret = this.formatResponse(res.result, null, false);
|
255 | resolve(ret);
|
256 | }
|
257 | catch (err) {
|
258 | reject(err);
|
259 | }
|
260 | }));
|
261 | });
|
262 | }
|
263 | |
264 |
|
265 |
|
266 |
|
267 |
|
268 |
|
269 |
|
270 | getRun(project, pipelineId, runId) {
|
271 | return __awaiter(this, void 0, void 0, function* () {
|
272 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
273 | let routeValues = {
|
274 | project: project,
|
275 | pipelineId: pipelineId,
|
276 | runId: runId
|
277 | };
|
278 | try {
|
279 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "7859261e-d2e9-4a68-b820-a5d84cc5bb3d", routeValues);
|
280 | let url = verData.requestUrl;
|
281 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
282 | let res;
|
283 | res = yield this.rest.get(url, options);
|
284 | let ret = this.formatResponse(res.result, PipelinesInterfaces.TypeInfo.Run, false);
|
285 | resolve(ret);
|
286 | }
|
287 | catch (err) {
|
288 | reject(err);
|
289 | }
|
290 | }));
|
291 | });
|
292 | }
|
293 | |
294 |
|
295 |
|
296 |
|
297 |
|
298 |
|
299 | listRuns(project, pipelineId) {
|
300 | return __awaiter(this, void 0, void 0, function* () {
|
301 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
302 | let routeValues = {
|
303 | project: project,
|
304 | pipelineId: pipelineId
|
305 | };
|
306 | try {
|
307 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "7859261e-d2e9-4a68-b820-a5d84cc5bb3d", routeValues);
|
308 | let url = verData.requestUrl;
|
309 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
310 | let res;
|
311 | res = yield this.rest.get(url, options);
|
312 | let ret = this.formatResponse(res.result, PipelinesInterfaces.TypeInfo.Run, true);
|
313 | resolve(ret);
|
314 | }
|
315 | catch (err) {
|
316 | reject(err);
|
317 | }
|
318 | }));
|
319 | });
|
320 | }
|
321 | |
322 |
|
323 |
|
324 |
|
325 |
|
326 |
|
327 |
|
328 |
|
329 | runPipeline(runParameters, project, pipelineId, pipelineVersion) {
|
330 | return __awaiter(this, void 0, void 0, function* () {
|
331 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
332 | let routeValues = {
|
333 | project: project,
|
334 | pipelineId: pipelineId
|
335 | };
|
336 | let queryValues = {
|
337 | pipelineVersion: pipelineVersion,
|
338 | };
|
339 | try {
|
340 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "7859261e-d2e9-4a68-b820-a5d84cc5bb3d", routeValues, queryValues);
|
341 | let url = verData.requestUrl;
|
342 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
343 | let res;
|
344 | res = yield this.rest.create(url, runParameters, options);
|
345 | let ret = this.formatResponse(res.result, PipelinesInterfaces.TypeInfo.Run, false);
|
346 | resolve(ret);
|
347 | }
|
348 | catch (err) {
|
349 | reject(err);
|
350 | }
|
351 | }));
|
352 | });
|
353 | }
|
354 | }
|
355 | exports.PipelinesApi = PipelinesApi;
|