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.CixApi = void 0;
|
22 | const basem = require("./ClientApiBases");
|
23 | class CixApi extends basem.ClientApiBase {
|
24 | constructor(baseUrl, handlers, options) {
|
25 | super(baseUrl, handlers, 'node-Pipelines-api', options);
|
26 | }
|
27 | |
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | getConfigurations(project, repositoryType, repositoryId, branch, serviceConnectionId) {
|
37 | return __awaiter(this, void 0, void 0, function* () {
|
38 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
39 | let routeValues = {
|
40 | project: project
|
41 | };
|
42 | let queryValues = {
|
43 | repositoryType: repositoryType,
|
44 | repositoryId: repositoryId,
|
45 | branch: branch,
|
46 | serviceConnectionId: serviceConnectionId,
|
47 | };
|
48 | try {
|
49 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "8fc87684-9ebc-4c37-ab92-f4ac4a58cb3a", routeValues, queryValues);
|
50 | let url = verData.requestUrl;
|
51 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
52 | let res;
|
53 | res = yield this.rest.get(url, options);
|
54 | let ret = this.formatResponse(res.result, null, true);
|
55 | resolve(ret);
|
56 | }
|
57 | catch (err) {
|
58 | reject(err);
|
59 | }
|
60 | }));
|
61 | });
|
62 | }
|
63 | |
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 | createProjectConnection(createConnectionInputs, project) {
|
70 | return __awaiter(this, void 0, void 0, function* () {
|
71 | if (project == null) {
|
72 | throw new TypeError('project can not be null or undefined');
|
73 | }
|
74 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
75 | let routeValues = {};
|
76 | let queryValues = {
|
77 | project: project,
|
78 | };
|
79 | try {
|
80 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "00df4879-9216-45d5-b38d-4a487b626b2c", routeValues, queryValues);
|
81 | let url = verData.requestUrl;
|
82 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
83 | let res;
|
84 | res = yield this.rest.create(url, createConnectionInputs, options);
|
85 | let ret = this.formatResponse(res.result, null, false);
|
86 | resolve(ret);
|
87 | }
|
88 | catch (err) {
|
89 | reject(err);
|
90 | }
|
91 | }));
|
92 | });
|
93 | }
|
94 | |
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 | getDetectedBuildFrameworks(project, repositoryType, repositoryId, branch, detectionType, serviceConnectionId) {
|
105 | return __awaiter(this, void 0, void 0, function* () {
|
106 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
107 | let routeValues = {
|
108 | project: project
|
109 | };
|
110 | let queryValues = {
|
111 | repositoryType: repositoryType,
|
112 | repositoryId: repositoryId,
|
113 | branch: branch,
|
114 | detectionType: detectionType,
|
115 | serviceConnectionId: serviceConnectionId,
|
116 | };
|
117 | try {
|
118 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "29a30bab-9efb-4652-bf1b-9269baca0980", routeValues, queryValues);
|
119 | let url = verData.requestUrl;
|
120 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
121 | let res;
|
122 | res = yield this.rest.get(url, options);
|
123 | let ret = this.formatResponse(res.result, null, true);
|
124 | resolve(ret);
|
125 | }
|
126 | catch (err) {
|
127 | reject(err);
|
128 | }
|
129 | }));
|
130 | });
|
131 | }
|
132 | |
133 |
|
134 |
|
135 |
|
136 | createResources(creationParameters, project) {
|
137 | return __awaiter(this, void 0, void 0, function* () {
|
138 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
139 | let routeValues = {
|
140 | project: project
|
141 | };
|
142 | try {
|
143 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "pipelines", "43201899-7690-4870-9c79-ab69605f21ed", routeValues);
|
144 | let url = verData.requestUrl;
|
145 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
146 | let res;
|
147 | res = yield this.rest.create(url, creationParameters, options);
|
148 | let ret = this.formatResponse(res.result, null, false);
|
149 | resolve(ret);
|
150 | }
|
151 | catch (err) {
|
152 | reject(err);
|
153 | }
|
154 | }));
|
155 | });
|
156 | }
|
157 | }
|
158 | exports.CixApi = CixApi;
|