@elisra-devops/docgen-data-provider 0.4.6 → 0.4.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/sonar-project.properties +4 -4
- package/.github/workflows/ci.yml +21 -21
- package/.github/workflows/release.yml +45 -40
- package/LICENSE +21 -21
- package/README.md +39 -38
- package/bin/helpers/helper.d.ts +37 -0
- package/bin/helpers/helper.js +83 -0
- package/bin/helpers/helper.js.map +1 -0
- package/bin/helpers/tfs.d.ts +5 -0
- package/bin/helpers/tfs.js +100 -0
- package/bin/helpers/tfs.js.map +1 -0
- package/bin/index.d.ts +16 -0
- package/bin/index.js +53 -0
- package/bin/index.js.map +1 -0
- package/bin/models/tfs-data.d.ts +86 -0
- package/bin/models/tfs-data.js +63 -0
- package/bin/models/tfs-data.js.map +1 -0
- package/bin/modules/GitDataProvider.d.ts +26 -0
- package/bin/modules/GitDataProvider.js +301 -0
- package/bin/modules/GitDataProvider.js.map +1 -0
- package/bin/modules/MangementDataProvider.d.ts +9 -0
- package/bin/modules/MangementDataProvider.js +62 -0
- package/bin/modules/MangementDataProvider.js.map +1 -0
- package/bin/modules/PipelinesDataProvider.d.ts +13 -0
- package/bin/modules/PipelinesDataProvider.js +103 -0
- package/bin/modules/PipelinesDataProvider.js.map +1 -0
- package/bin/modules/TestDataProvider.d.ts +24 -0
- package/bin/modules/TestDataProvider.js +294 -0
- package/bin/modules/TestDataProvider.js.map +1 -0
- package/bin/modules/TicketsDataProvider.d.ts +26 -0
- package/bin/modules/TicketsDataProvider.js +385 -0
- package/bin/modules/TicketsDataProvider.js.map +1 -0
- package/bin/modules/test/gitDataProvider.test.d.ts +1 -0
- package/bin/modules/test/gitDataProvider.test.js +138 -0
- package/bin/modules/test/gitDataProvider.test.js.map +1 -0
- package/bin/modules/test/managmentDataProvider.test.d.ts +1 -0
- package/bin/modules/test/managmentDataProvider.test.js +40 -0
- package/bin/modules/test/managmentDataProvider.test.js.map +1 -0
- package/bin/modules/test/pipelineDataProvider.test.d.ts +1 -0
- package/bin/modules/test/pipelineDataProvider.test.js +62 -0
- package/bin/modules/test/pipelineDataProvider.test.js.map +1 -0
- package/bin/modules/test/testDataProvider.test.d.ts +1 -0
- package/bin/modules/test/testDataProvider.test.js +103 -0
- package/bin/modules/test/testDataProvider.test.js.map +1 -0
- package/bin/modules/test/ticketsDataProvider.test.d.ts +1 -0
- package/bin/modules/test/ticketsDataProvider.test.js +103 -0
- package/bin/modules/test/ticketsDataProvider.test.js.map +1 -0
- package/bin/utils/logger.d.ts +3 -0
- package/bin/utils/logger.js +33 -0
- package/bin/utils/logger.js.map +1 -0
- package/enviroment.d.ts +12 -12
- package/package.json +53 -53
- package/src/helpers/helper.ts +117 -117
- package/src/helpers/tfs.ts +92 -92
- package/src/index.ts +36 -36
- package/src/models/tfs-data.ts +136 -136
- package/src/modules/GitDataProvider.ts +446 -446
- package/src/modules/MangementDataProvider.ts +59 -59
- package/src/modules/PipelinesDataProvider.ts +142 -142
- package/src/modules/TestDataProvider.ts +423 -423
- package/src/modules/TicketsDataProvider.ts +435 -435
- package/src/modules/test/gitDataProvider.test.ts +207 -207
- package/src/modules/test/managmentDataProvider.test.ts +33 -33
- package/src/modules/test/pipelineDataProvider.test.ts +79 -79
- package/src/modules/test/testDataProvider.test.ts +139 -139
- package/src/modules/test/ticketsDataProvider.test.ts +138 -138
- package/src/utils/logger.ts +37 -37
- package/tsconfig.json +27 -27
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { suiteData } from "../helpers/helper";
|
|
2
|
+
import { TestSteps } from "../models/tfs-data";
|
|
3
|
+
export default class TestDataProvider {
|
|
4
|
+
orgUrl: string;
|
|
5
|
+
token: string;
|
|
6
|
+
constructor(orgUrl: string, token: string);
|
|
7
|
+
GetTestSuiteByTestCase(testCaseId: string): Promise<any>;
|
|
8
|
+
GetTestPlans(project: string): Promise<string>;
|
|
9
|
+
GetTestSuites(project: string, planId: string): Promise<any>;
|
|
10
|
+
GetTestSuitesForPlan(project: string, planid: string): Promise<any>;
|
|
11
|
+
GetTestSuitesByPlan(project: string, planId: string, recursive: boolean): Promise<any>;
|
|
12
|
+
GetTestSuiteById(project: string, planId: string, suiteId: string, recursive: boolean): Promise<any>;
|
|
13
|
+
GetTestCasesBySuites(project: string, planId: string, suiteId: string, recursiv: boolean): Promise<Array<any>>;
|
|
14
|
+
StructureTestCase(project: string, testCases: any, suite: suiteData): Promise<Array<any>>;
|
|
15
|
+
ParseSteps(steps: string): TestSteps[];
|
|
16
|
+
GetTestCases(project: string, planId: string, suiteId: string): Promise<any>;
|
|
17
|
+
GetTestPoint(project: string, planId: string, suiteId: string, testCaseId: string): Promise<any>;
|
|
18
|
+
CreateTestRun(projectName: string, testRunName: string, testPlanId: string, testPointId: string): Promise<any>;
|
|
19
|
+
UpdateTestRun(projectName: string, runId: string, state: string): Promise<any>;
|
|
20
|
+
UpdateTestCase(projectName: string, runId: string, state: number): Promise<any>;
|
|
21
|
+
UploadTestAttachment(runID: string, projectName: string, stream: any, fileName: string, comment: string, attachmentType: string): Promise<any>;
|
|
22
|
+
GetTestRunById(projectName: string, runId: string): Promise<any>;
|
|
23
|
+
GetTestPointByTestCaseId(projectName: string, testCaseId: string): Promise<any>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const tfs_1 = require("../helpers/tfs");
|
|
13
|
+
const helper_1 = require("../helpers/helper");
|
|
14
|
+
const tfs_data_1 = require("../models/tfs-data");
|
|
15
|
+
const tfs_data_2 = require("../models/tfs-data");
|
|
16
|
+
const xml2js = require("xml2js");
|
|
17
|
+
const logger_1 = require("../utils/logger");
|
|
18
|
+
class TestDataProvider {
|
|
19
|
+
constructor(orgUrl, token) {
|
|
20
|
+
this.orgUrl = "";
|
|
21
|
+
this.token = "";
|
|
22
|
+
this.orgUrl = orgUrl;
|
|
23
|
+
this.token = token;
|
|
24
|
+
}
|
|
25
|
+
GetTestSuiteByTestCase(testCaseId) {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
let url = `${this.orgUrl}/_apis/testplan/suites?testCaseId=${testCaseId}`;
|
|
28
|
+
let testCaseData = yield tfs_1.TFSServices.getItemContent(url, this.token);
|
|
29
|
+
return testCaseData;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//get all test plans in the project
|
|
33
|
+
GetTestPlans(project) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
let testPlanUrl = `${this.orgUrl}${project}/_apis/test/plans`;
|
|
36
|
+
return tfs_1.TFSServices.getItemContent(testPlanUrl, this.token);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
// get all test suits in projct test plan
|
|
40
|
+
GetTestSuites(project, planId) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
let testsuitesUrl = this.orgUrl + project + "/_apis/test/Plans/" + planId + "/suites";
|
|
43
|
+
try {
|
|
44
|
+
let testSuites = yield tfs_1.TFSServices.getItemContent(testsuitesUrl, this.token);
|
|
45
|
+
return testSuites;
|
|
46
|
+
}
|
|
47
|
+
catch (e) { }
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
GetTestSuitesForPlan(project, planid) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
let url = this.orgUrl +
|
|
53
|
+
"/" +
|
|
54
|
+
project +
|
|
55
|
+
"/_api/_testManagement/GetTestSuitesForPlan?__v=5&planId=" +
|
|
56
|
+
planid;
|
|
57
|
+
let suites = yield tfs_1.TFSServices.getItemContent(url, this.token);
|
|
58
|
+
return suites;
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
GetTestSuitesByPlan(project, planId, recursive) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
let suiteId = Number(planId) + 1;
|
|
64
|
+
let suites = yield this.GetTestSuiteById(project, planId, suiteId.toString(), recursive);
|
|
65
|
+
return suites;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
//gets all testsuits recorsivly under test suite
|
|
69
|
+
GetTestSuiteById(project, planId, suiteId, recursive) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
let testSuites = yield this.GetTestSuitesForPlan(project, planId);
|
|
72
|
+
// GetTestSuites(project, planId);
|
|
73
|
+
helper_1.Helper.suitList = [];
|
|
74
|
+
helper_1.Helper.level = 1;
|
|
75
|
+
let dataSuites = helper_1.Helper.findSuitesRecursive(planId, this.orgUrl, project, testSuites.testSuites, suiteId, recursive);
|
|
76
|
+
helper_1.Helper.first = true;
|
|
77
|
+
// let levledSuites: any = Helper.buildSuiteslevel(dataSuites);
|
|
78
|
+
return dataSuites;
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
//gets all testcase under test suite acording to recursive flag
|
|
82
|
+
GetTestCasesBySuites(project, planId, suiteId, recursiv) {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
let testCasesList = new Array();
|
|
85
|
+
let suitesTestCasesList = yield this.GetTestSuiteById(project, planId, suiteId, recursiv);
|
|
86
|
+
for (let i = 0; i < suitesTestCasesList.length; i++) {
|
|
87
|
+
let testCases = yield this.GetTestCases(project, planId, suitesTestCasesList[i].id);
|
|
88
|
+
let testCseseWithSteps = yield this.StructureTestCase(project, testCases, suitesTestCasesList[i]);
|
|
89
|
+
if (testCseseWithSteps.length > 0)
|
|
90
|
+
testCasesList = [...testCasesList, ...testCseseWithSteps];
|
|
91
|
+
}
|
|
92
|
+
return testCasesList;
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
StructureTestCase(project, testCases, suite) {
|
|
96
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
97
|
+
let url = this.orgUrl + project + "/_workitems/edit/";
|
|
98
|
+
let testCasesUrlList = new Array();
|
|
99
|
+
//let tesrCase:TestCase;
|
|
100
|
+
for (let i = 0; i < testCases.count; i++) {
|
|
101
|
+
try {
|
|
102
|
+
let test = yield tfs_1.TFSServices.getItemContent(testCases.value[i].testCase.url, this.token);
|
|
103
|
+
let testCase = new tfs_data_2.TestCase();
|
|
104
|
+
testCase.title = test.fields["System.Title"];
|
|
105
|
+
testCase.area = test.fields["System.AreaPath"];
|
|
106
|
+
testCase.description = test.fields["System.Description"];
|
|
107
|
+
testCase.url = url + test.id;
|
|
108
|
+
//testCase.steps = test.fields["Microsoft.VSTS.TCM.Steps"];
|
|
109
|
+
testCase.id = test.id;
|
|
110
|
+
testCase.suit = suite.id;
|
|
111
|
+
if (test.fields["Microsoft.VSTS.TCM.Steps"] != null) {
|
|
112
|
+
let steps = this.ParseSteps(test.fields["Microsoft.VSTS.TCM.Steps"]);
|
|
113
|
+
testCase.steps = steps;
|
|
114
|
+
}
|
|
115
|
+
testCasesUrlList.push(testCase);
|
|
116
|
+
}
|
|
117
|
+
catch (_a) {
|
|
118
|
+
logger_1.default.error(`ran into an issue while retriving testCase ${testCases.value[i].testCase.id}`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return testCasesUrlList;
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
ParseSteps(steps) {
|
|
125
|
+
let stepsLsist = new Array();
|
|
126
|
+
const start = ";P>";
|
|
127
|
+
const end = "</P";
|
|
128
|
+
let totalString = steps;
|
|
129
|
+
xml2js.parseString(steps, function (err, result) {
|
|
130
|
+
if (err)
|
|
131
|
+
console.log(err);
|
|
132
|
+
if (result.steps.step != null)
|
|
133
|
+
for (let i = 0; i < result.steps.step.length; i++) {
|
|
134
|
+
let step = new tfs_data_1.TestSteps();
|
|
135
|
+
try {
|
|
136
|
+
if (result.steps.step[i].parameterizedString[0]._ != null)
|
|
137
|
+
step.action = result.steps.step[i].parameterizedString[0]._;
|
|
138
|
+
}
|
|
139
|
+
catch (e) {
|
|
140
|
+
logger_1.default.warn(`No test step action data to parse for testcase `);
|
|
141
|
+
}
|
|
142
|
+
try {
|
|
143
|
+
if (result.steps.step[i].parameterizedString[1]._ != null)
|
|
144
|
+
step.expected = result.steps.step[i].parameterizedString[1]._;
|
|
145
|
+
}
|
|
146
|
+
catch (e) {
|
|
147
|
+
logger_1.default.warn(`No test step expected data to parse for testcase `);
|
|
148
|
+
}
|
|
149
|
+
stepsLsist.push(step);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
return stepsLsist;
|
|
153
|
+
}
|
|
154
|
+
GetTestCases(project, planId, suiteId) {
|
|
155
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
156
|
+
let testCaseUrl = this.orgUrl +
|
|
157
|
+
project +
|
|
158
|
+
"/_apis/test/Plans/" +
|
|
159
|
+
planId +
|
|
160
|
+
"/suites/" +
|
|
161
|
+
suiteId +
|
|
162
|
+
"/testcases/";
|
|
163
|
+
let testCases = yield tfs_1.TFSServices.getItemContent(testCaseUrl, this.token);
|
|
164
|
+
return testCases;
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
//gets all test point in a test case
|
|
168
|
+
GetTestPoint(project, planId, suiteId, testCaseId) {
|
|
169
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
+
let testPointUrl = `${this.orgUrl}${project}/_apis/test/Plans/${planId}/Suites/${suiteId}/points?testCaseId=${testCaseId}`;
|
|
171
|
+
let testPoints = yield tfs_1.TFSServices.getItemContent(testPointUrl, this.token);
|
|
172
|
+
return testPoints;
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
CreateTestRun(projectName, testRunName, testPlanId, testPointId) {
|
|
176
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
177
|
+
try {
|
|
178
|
+
logger_1.default.info(`Create test run op test point ${testPointId} ,test planId : ${testPlanId}`);
|
|
179
|
+
let Url = `${this.orgUrl}${projectName}/_apis/test/runs`;
|
|
180
|
+
let data = {
|
|
181
|
+
name: testRunName,
|
|
182
|
+
plan: {
|
|
183
|
+
id: testPlanId,
|
|
184
|
+
},
|
|
185
|
+
pointIds: [testPointId],
|
|
186
|
+
};
|
|
187
|
+
let res = yield tfs_1.TFSServices.postRequest(Url, this.token, "Post", data, null);
|
|
188
|
+
return res;
|
|
189
|
+
}
|
|
190
|
+
catch (err) {
|
|
191
|
+
logger_1.default.error(`Error : ${err}`);
|
|
192
|
+
throw new Error(String(err));
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
UpdateTestRun(projectName, runId, state) {
|
|
197
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
198
|
+
logger_1.default.info(`Update runId : ${runId} to state : ${state}`);
|
|
199
|
+
let Url = `${this.orgUrl}${projectName}/_apis/test/Runs/${runId}?api-version=5.0`;
|
|
200
|
+
let data = {
|
|
201
|
+
state: state,
|
|
202
|
+
};
|
|
203
|
+
let res = yield tfs_1.TFSServices.postRequest(Url, this.token, "PATCH", data, null);
|
|
204
|
+
return res;
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
UpdateTestCase(projectName, runId, state) {
|
|
208
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
209
|
+
let data;
|
|
210
|
+
logger_1.default.info(`Update test case, runId : ${runId} to state : ${state}`);
|
|
211
|
+
let Url = `${this.orgUrl}${projectName}/_apis/test/Runs/${runId}/results?api-version=5.0`;
|
|
212
|
+
switch (state) {
|
|
213
|
+
case 0:
|
|
214
|
+
logger_1.default.info(`Reset test case to Active state `);
|
|
215
|
+
data = [
|
|
216
|
+
{
|
|
217
|
+
id: 100000,
|
|
218
|
+
outcome: "0",
|
|
219
|
+
},
|
|
220
|
+
];
|
|
221
|
+
break;
|
|
222
|
+
case 1:
|
|
223
|
+
logger_1.default.info(`Update test case to complite state `);
|
|
224
|
+
data = [
|
|
225
|
+
{
|
|
226
|
+
id: 100000,
|
|
227
|
+
state: "Completed",
|
|
228
|
+
outcome: "1",
|
|
229
|
+
},
|
|
230
|
+
];
|
|
231
|
+
break;
|
|
232
|
+
case 2:
|
|
233
|
+
logger_1.default.info(`Update test case to passed state `);
|
|
234
|
+
data = [
|
|
235
|
+
{
|
|
236
|
+
id: 100000,
|
|
237
|
+
state: "Completed",
|
|
238
|
+
outcome: "2",
|
|
239
|
+
},
|
|
240
|
+
];
|
|
241
|
+
break;
|
|
242
|
+
case 3:
|
|
243
|
+
logger_1.default.info(`Update test case to failed state `);
|
|
244
|
+
data = [
|
|
245
|
+
{
|
|
246
|
+
id: 100000,
|
|
247
|
+
state: "Completed",
|
|
248
|
+
outcome: "3",
|
|
249
|
+
},
|
|
250
|
+
];
|
|
251
|
+
break;
|
|
252
|
+
}
|
|
253
|
+
let res = yield tfs_1.TFSServices.postRequest(Url, this.token, "PATCH", data, null);
|
|
254
|
+
return res;
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
UploadTestAttachment(runID, projectName, stream, fileName, comment, attachmentType) {
|
|
258
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
259
|
+
logger_1.default.info(`Upload attachment to test run : ${runID}`);
|
|
260
|
+
let Url = `${this.orgUrl}${projectName}/_apis/test/Runs/${runID}/attachments?api-version=5.0-preview.1`;
|
|
261
|
+
let data = {
|
|
262
|
+
stream: stream,
|
|
263
|
+
fileName: fileName,
|
|
264
|
+
comment: comment,
|
|
265
|
+
attachmentType: attachmentType,
|
|
266
|
+
};
|
|
267
|
+
let res = yield tfs_1.TFSServices.postRequest(Url, this.token, "Post", data, null);
|
|
268
|
+
return res;
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
GetTestRunById(projectName, runId) {
|
|
272
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
273
|
+
logger_1.default.info(`getting test run id: ${runId}`);
|
|
274
|
+
let url = `${this.orgUrl}${projectName}/_apis/test/Runs/${runId}`;
|
|
275
|
+
let res = yield tfs_1.TFSServices.getItemContent(url, this.token, "get", null, null);
|
|
276
|
+
return res;
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
GetTestPointByTestCaseId(projectName, testCaseId) {
|
|
280
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
281
|
+
logger_1.default.info(`get test points at project ${projectName} , of testCaseId : ${testCaseId}`);
|
|
282
|
+
let url = `${this.orgUrl}${projectName}/_apis/test/points`;
|
|
283
|
+
let data = {
|
|
284
|
+
PointsFilter: {
|
|
285
|
+
TestcaseIds: [testCaseId],
|
|
286
|
+
},
|
|
287
|
+
};
|
|
288
|
+
let res = yield tfs_1.TFSServices.postRequest(url, this.token, "Post", data, null);
|
|
289
|
+
return res;
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
exports.default = TestDataProvider;
|
|
294
|
+
//# sourceMappingURL=TestDataProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TestDataProvider.js","sourceRoot":"","sources":["../../src/modules/TestDataProvider.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,wCAA6C;AAE7C,8CAA+E;AAC/E,iDAAsD;AAKtD,iDAA8C;AAC9C,iCAAiC;AAEjC,4CAAqC;AAErC,MAAqB,gBAAgB;IAInC,YAAY,MAAc,EAAE,KAAa;QAHzC,WAAM,GAAW,EAAE,CAAC;QACpB,UAAK,GAAW,EAAE,CAAC;QAGjB,IAAI,CAAC,MAAM,GAAG,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@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Links, Trace, Relations } from "../helpers/helper";
|
|
2
|
+
import { Query } from "../models/tfs-data";
|
|
3
|
+
export default class TicketsDataProvider {
|
|
4
|
+
orgUrl: string;
|
|
5
|
+
token: string;
|
|
6
|
+
queriesList: Array<any>;
|
|
7
|
+
constructor(orgUrl: string, token: string);
|
|
8
|
+
GetWorkItem(project: string, id: string): Promise<any>;
|
|
9
|
+
GetLinksByIds(project: string, ids: any): Promise<Trace[]>;
|
|
10
|
+
GetParentLink(project: string, wi: any): Promise<Trace>;
|
|
11
|
+
GetRelationsIds(ids: any): Promise<Map<string, Relations>>;
|
|
12
|
+
GetLinks(project: string, wi: any, links: any): Promise<Links[]>;
|
|
13
|
+
GetSharedQueries(project: string, path: string): Promise<any>;
|
|
14
|
+
GetModeledQuery(list: Array<any>): Array<any>;
|
|
15
|
+
GetQueryResultsByWiqlHref(wiqlHref: string, project: string): Promise<any>;
|
|
16
|
+
GetQueryResultsByWiqlString(wiql: string, projectName: string): Promise<any>;
|
|
17
|
+
GetQueryResultById(query: string, project: string): Promise<any>;
|
|
18
|
+
PopulateWorkItemsByIds(workItemsArray?: any[], projectName?: string): Promise<any[]>;
|
|
19
|
+
GetModeledQueryResults(results: any, project: string): Promise<Query>;
|
|
20
|
+
BuildColumns(results: any, queryResult: Query): void;
|
|
21
|
+
GetIterationsByTeamName(projectName: string, teamName: string): Promise<any[]>;
|
|
22
|
+
CreateNewWorkItem(projectName: string, wiBody: any, wiType: string, byPass: boolean): Promise<any>;
|
|
23
|
+
GetWorkitemAttachments(project: string, id: string): Promise<string[]>;
|
|
24
|
+
GetWorkitemAttachmentsJSONData(project: string, attachmentId: string): Promise<any>;
|
|
25
|
+
UpdateWorkItem(projectName: string, wiBody: any, workItemId: number, byPass: boolean): Promise<any>;
|
|
26
|
+
}
|