testit-api-client 1.0.5 → 1.0.6
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/LICENSE.md +1 -1
- package/{README.MD → README.md} +7 -7
- package/package.json +52 -52
- package/dist/client.d.ts +0 -23
- package/dist/client.js +0 -166
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -14
- package/dist/types/attachment.d.ts +0 -14
- package/dist/types/attachment.js +0 -2
- package/dist/types/autotest.d.ts +0 -97
- package/dist/types/autotest.js +0 -2
- package/dist/types/autotestResults.d.ts +0 -22
- package/dist/types/autotestResults.js +0 -2
- package/dist/types/autotestStep.d.ts +0 -5
- package/dist/types/autotestStep.js +0 -2
- package/dist/types/capabilities.d.ts +0 -1
- package/dist/types/capabilities.js +0 -2
- package/dist/types/client.d.ts +0 -15
- package/dist/types/client.js +0 -2
- package/dist/types/config.d.ts +0 -10
- package/dist/types/config.js +0 -2
- package/dist/types/configuration.d.ts +0 -16
- package/dist/types/configuration.js +0 -2
- package/dist/types/index.d.ts +0 -18
- package/dist/types/index.js +0 -30
- package/dist/types/label.d.ts +0 -7
- package/dist/types/label.js +0 -2
- package/dist/types/link.d.ts +0 -24
- package/dist/types/link.js +0 -2
- package/dist/types/outcome.d.ts +0 -1
- package/dist/types/outcome.js +0 -2
- package/dist/types/parameters.d.ts +0 -1
- package/dist/types/parameters.js +0 -2
- package/dist/types/properties.d.ts +0 -1
- package/dist/types/properties.js +0 -2
- package/dist/types/stepResults.d.ts +0 -14
- package/dist/types/stepResults.js +0 -2
- package/dist/types/tag.d.ts +0 -3
- package/dist/types/tag.js +0 -2
- package/dist/types/testPoint.d.ts +0 -9
- package/dist/types/testPoint.js +0 -2
- package/dist/types/testResult.d.ts +0 -31
- package/dist/types/testResult.js +0 -2
- package/dist/types/testRun.d.ts +0 -20
- package/dist/types/testRun.js +0 -2
- package/dist/types/workItem.d.ts +0 -3
- package/dist/types/workItem.js +0 -2
- package/dist/validation.d.ts +0 -2
- package/dist/validation.js +0 -15
package/LICENSE.md
CHANGED
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
same "printed page" as the copyright notice for easier
|
|
188
188
|
identification within third-party archives.
|
|
189
189
|
|
|
190
|
-
Copyright
|
|
190
|
+
Copyright 2022 TestGear
|
|
191
191
|
|
|
192
192
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
193
|
you may not use this file except in compliance with the License.
|
package/{README.MD → README.md}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
#
|
|
2
|
-

|
|
3
3
|
|
|
4
4
|
# Getting Started
|
|
5
5
|
|
|
6
6
|
## Installation
|
|
7
7
|
```
|
|
8
|
-
npm install
|
|
8
|
+
npm install testgear-api-client
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
# Usage
|
|
@@ -23,7 +23,7 @@ const client = new Client({
|
|
|
23
23
|
});
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
After configuration is done you can access different clients from `Client` object and then use methods to control
|
|
26
|
+
After configuration is done you can access different clients from `Client` object and then use methods to control TestGear.
|
|
27
27
|
|
|
28
28
|
## Examples
|
|
29
29
|
```ts
|
|
@@ -40,12 +40,12 @@ await client.completeTestRun(testRunId);
|
|
|
40
40
|
|
|
41
41
|
You can help to develop the project. Any contributions are **greatly appreciated**.
|
|
42
42
|
|
|
43
|
-
* If you have suggestions for adding or removing projects, feel free to [open an issue](https://github.com/
|
|
43
|
+
* If you have suggestions for adding or removing projects, feel free to [open an issue](https://github.com/testgear-tms/api-client-js/issues/new) to discuss it, or directly create a pull request after you edit the *README.md* file with necessary changes.
|
|
44
44
|
* Please make sure you check your spelling and grammar.
|
|
45
45
|
* Create individual PR for each suggestion.
|
|
46
|
-
* Please also read through the [Code Of Conduct](https://github.com/
|
|
46
|
+
* Please also read through the [Code Of Conduct](https://github.com/testgear-tms/api-client-js/blob/master/CODE_OF_CONDUCT.md) before posting your first idea as well.
|
|
47
47
|
|
|
48
48
|
# License
|
|
49
49
|
|
|
50
|
-
Distributed under the Apache-2.0 License. See [LICENSE](https://github.com/
|
|
50
|
+
Distributed under the Apache-2.0 License. See [LICENSE](https://github.com/testgear-tms/api-client-js/blob/master/LICENSE.md) for more information.
|
|
51
51
|
|
package/package.json
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "testit-api-client",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Client provides methods for communication with
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "jest",
|
|
8
|
-
"build": "tsc",
|
|
9
|
-
"prebuild": "rimraf dist"
|
|
10
|
-
},
|
|
11
|
-
"keywords": [],
|
|
12
|
-
"author": "
|
|
13
|
-
"license": "Apache-2.0",
|
|
14
|
-
"devDependencies": {
|
|
15
|
-
"@babel/core": "^7.15.8",
|
|
16
|
-
"@babel/preset-env": "^7.15.8",
|
|
17
|
-
"@babel/preset-typescript": "^7.15.0",
|
|
18
|
-
"@types/jest": "^27.0.2",
|
|
19
|
-
"@types/minimist": "^1.2.2",
|
|
20
|
-
"@types/node": "^16.10.2",
|
|
21
|
-
"@types/uuid": "^8.3.1",
|
|
22
|
-
"babel-jest": "^27.2.5",
|
|
23
|
-
"jest": "^27.2.5",
|
|
24
|
-
"rimraf": "^3.0.2",
|
|
25
|
-
"ts-node": "^10.2.1",
|
|
26
|
-
"typescript": "^4.5.5",
|
|
27
|
-
"uuid": "^8.3.2"
|
|
28
|
-
},
|
|
29
|
-
"dependencies": {
|
|
30
|
-
"axios": "^0.22.0",
|
|
31
|
-
"form-data": "^4.0.0",
|
|
32
|
-
"minimist": "^1.2.5",
|
|
33
|
-
"querystring": "^0.2.1",
|
|
34
|
-
"zod": "^3.11.6",
|
|
35
|
-
"xmlhttprequest": "^1.8.0"
|
|
36
|
-
},
|
|
37
|
-
"files": [
|
|
38
|
-
"dist"
|
|
39
|
-
],
|
|
40
|
-
"bugs": {
|
|
41
|
-
"url": "https://github.com/testit-tms/api-client-js/issues"
|
|
42
|
-
},
|
|
43
|
-
"homepage": "https://github.com/testit-tms/api-client-js",
|
|
44
|
-
"repository": {
|
|
45
|
-
"type": "git",
|
|
46
|
-
"url": "git+https://github.com/testit-tms/api-client-js.git"
|
|
47
|
-
},
|
|
48
|
-
"types": "./dist\\index.d.ts",
|
|
49
|
-
"directories": {
|
|
50
|
-
"test": "test"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "testit-api-client",
|
|
3
|
+
"version": "1.0.6",
|
|
4
|
+
"description": "Client provides methods for communication with TMS API.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "jest",
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"prebuild": "rimraf dist"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [],
|
|
12
|
+
"author": "Integration team",
|
|
13
|
+
"license": "Apache-2.0",
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@babel/core": "^7.15.8",
|
|
16
|
+
"@babel/preset-env": "^7.15.8",
|
|
17
|
+
"@babel/preset-typescript": "^7.15.0",
|
|
18
|
+
"@types/jest": "^27.0.2",
|
|
19
|
+
"@types/minimist": "^1.2.2",
|
|
20
|
+
"@types/node": "^16.10.2",
|
|
21
|
+
"@types/uuid": "^8.3.1",
|
|
22
|
+
"babel-jest": "^27.2.5",
|
|
23
|
+
"jest": "^27.2.5",
|
|
24
|
+
"rimraf": "^3.0.2",
|
|
25
|
+
"ts-node": "^10.2.1",
|
|
26
|
+
"typescript": "^4.5.5",
|
|
27
|
+
"uuid": "^8.3.2"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"axios": "^0.22.0",
|
|
31
|
+
"form-data": "^4.0.0",
|
|
32
|
+
"minimist": "^1.2.5",
|
|
33
|
+
"querystring": "^0.2.1",
|
|
34
|
+
"zod": "^3.11.6",
|
|
35
|
+
"xmlhttprequest": "^1.8.0"
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist"
|
|
39
|
+
],
|
|
40
|
+
"bugs": {
|
|
41
|
+
"url": "https://github.com/testit-tms/api-client-js/issues"
|
|
42
|
+
},
|
|
43
|
+
"homepage": "https://github.com/testit-tms/api-client-js",
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": "git+https://github.com/testit-tms/api-client-js.git"
|
|
47
|
+
},
|
|
48
|
+
"types": "./dist\\index.d.ts",
|
|
49
|
+
"directories": {
|
|
50
|
+
"test": "test"
|
|
51
|
+
}
|
|
52
|
+
}
|
package/dist/client.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Attachment, Autotest, AutotestPost, AutotestPut, AutotestQuery, AutotestResultsForTestRun, ClientConfig, ClientConfigWithFile, IClient, TestRunGet, TestRunPost, WorkItemId } from './types';
|
|
2
|
-
export declare class Client implements IClient {
|
|
3
|
-
private readonly axios;
|
|
4
|
-
private config;
|
|
5
|
-
private readonly request;
|
|
6
|
-
constructor(config: Partial<ClientConfigWithFile>);
|
|
7
|
-
checkConnection(): Promise<void>;
|
|
8
|
-
getAutotest(query: AutotestQuery): Promise<Autotest[]>;
|
|
9
|
-
createAutotest(autotest: AutotestPost): Promise<Autotest>;
|
|
10
|
-
updateAutotest(autotest: AutotestPut): Promise<void>;
|
|
11
|
-
linkToWorkItem(autotestId: string, workItem: WorkItemId): Promise<void>;
|
|
12
|
-
getTestRun(testRunId: string): TestRunGet;
|
|
13
|
-
createTestRun(testRun: TestRunPost): Promise<TestRunGet>;
|
|
14
|
-
startTestRun(testRunId: string): Promise<void>;
|
|
15
|
-
loadTestRunResults(testRunId: string, results: AutotestResultsForTestRun[]): Promise<string[]>;
|
|
16
|
-
completeTestRun(testRunId: string): Promise<void>;
|
|
17
|
-
getConfig(): ClientConfig;
|
|
18
|
-
loadAttachment(filePath: string): Promise<Attachment>;
|
|
19
|
-
private readCliConfig;
|
|
20
|
-
private readEnvConfig;
|
|
21
|
-
private readConfigFile;
|
|
22
|
-
static mergeConfig(oldConfig: Partial<ClientConfig>, newConfig: Partial<ClientConfig>): Partial<ClientConfig>;
|
|
23
|
-
}
|
package/dist/client.js
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.Client = void 0;
|
|
18
|
-
const axios_1 = __importDefault(require("axios"));
|
|
19
|
-
const minimist_1 = __importDefault(require("minimist"));
|
|
20
|
-
const fs_1 = require("fs");
|
|
21
|
-
const form_data_1 = __importDefault(require("form-data"));
|
|
22
|
-
const path_1 = require("path");
|
|
23
|
-
const validation_1 = require("./validation");
|
|
24
|
-
// TODO: implement via the base client
|
|
25
|
-
const XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
|
|
26
|
-
class Client {
|
|
27
|
-
constructor(config) {
|
|
28
|
-
const { configFile } = config, restConfig = __rest(config, ["configFile"]);
|
|
29
|
-
let finalConfig = restConfig;
|
|
30
|
-
if (configFile) {
|
|
31
|
-
finalConfig = Client.mergeConfig(finalConfig, this.readConfigFile(configFile));
|
|
32
|
-
}
|
|
33
|
-
finalConfig = Client.mergeConfig(finalConfig, this.readEnvConfig());
|
|
34
|
-
finalConfig = Client.mergeConfig(finalConfig, this.readCliConfig());
|
|
35
|
-
this.config = (0, validation_1.validateConfig)(finalConfig);
|
|
36
|
-
const baseURL = new URL('/api/v2', this.config.url).toString();
|
|
37
|
-
this.axios = axios_1.default.create({
|
|
38
|
-
baseURL,
|
|
39
|
-
headers: {
|
|
40
|
-
Authorization: `PrivateToken ${this.config.privateToken}`,
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
// TODO: implement via the base client
|
|
44
|
-
this.request = new XMLHttpRequest();
|
|
45
|
-
}
|
|
46
|
-
async checkConnection() {
|
|
47
|
-
try {
|
|
48
|
-
await axios_1.default.get(new URL('version.json', this.config.url).toString());
|
|
49
|
-
}
|
|
50
|
-
catch (err) {
|
|
51
|
-
throw new Error('Cannot connect to TestIt');
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
// TODO: add query object
|
|
55
|
-
async getAutotest(query) {
|
|
56
|
-
const params = new URLSearchParams();
|
|
57
|
-
Object.keys(query).forEach((key) => {
|
|
58
|
-
const value = query[key];
|
|
59
|
-
if (value === undefined) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
if (Array.isArray(value)) {
|
|
63
|
-
value.forEach((v) => params.append(key, v));
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
params.append(key, value.toString());
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
return this.axios
|
|
70
|
-
.get(`/autoTests?${params.toString()}`)
|
|
71
|
-
.then((res) => res.data);
|
|
72
|
-
}
|
|
73
|
-
async createAutotest(autotest) {
|
|
74
|
-
return this.axios.post('/autoTests', autotest).then((res) => res.data);
|
|
75
|
-
}
|
|
76
|
-
async updateAutotest(autotest) {
|
|
77
|
-
return this.axios.put('/autoTests', autotest);
|
|
78
|
-
}
|
|
79
|
-
async linkToWorkItem(autotestId, workItem) {
|
|
80
|
-
return this.axios.post(`/autoTests/${autotestId}/workItems`, workItem);
|
|
81
|
-
}
|
|
82
|
-
// TODO: implement via the base client
|
|
83
|
-
getTestRun(testRunId) {
|
|
84
|
-
const baseURL = new URL('/api/v2', this.config.url).toString();
|
|
85
|
-
this.request.open("GET", `${baseURL}/testRuns/${testRunId}`, false);
|
|
86
|
-
this.request.setRequestHeader('Authorization', `PrivateToken ${this.config.privateToken}`);
|
|
87
|
-
this.request.send(null);
|
|
88
|
-
return JSON.parse(this.request.responseText);
|
|
89
|
-
}
|
|
90
|
-
async createTestRun(testRun) {
|
|
91
|
-
return this.axios
|
|
92
|
-
.post('/testRuns', testRun)
|
|
93
|
-
.then((res) => res.data);
|
|
94
|
-
}
|
|
95
|
-
async startTestRun(testRunId) {
|
|
96
|
-
return this.axios.post(`/testRuns/${testRunId}/start`);
|
|
97
|
-
}
|
|
98
|
-
async loadTestRunResults(testRunId, results) {
|
|
99
|
-
return await this.axios
|
|
100
|
-
.post(`/testRuns/${testRunId}/testResults`, results)
|
|
101
|
-
.then((res) => res.data);
|
|
102
|
-
}
|
|
103
|
-
async completeTestRun(testRunId) {
|
|
104
|
-
return this.axios.post(`/testRuns/${testRunId}/complete`);
|
|
105
|
-
}
|
|
106
|
-
getConfig() {
|
|
107
|
-
return this.config;
|
|
108
|
-
}
|
|
109
|
-
async loadAttachment(filePath) {
|
|
110
|
-
const form = new form_data_1.default();
|
|
111
|
-
form.append('file', (0, fs_1.readFileSync)(filePath), (0, path_1.basename)(filePath));
|
|
112
|
-
return this.axios
|
|
113
|
-
.post('/Attachments', form, {
|
|
114
|
-
headers: form.getHeaders(),
|
|
115
|
-
})
|
|
116
|
-
.then((res) => res.data);
|
|
117
|
-
}
|
|
118
|
-
readCliConfig() {
|
|
119
|
-
const args = (0, minimist_1.default)(process.argv.slice(2));
|
|
120
|
-
let config = {};
|
|
121
|
-
if (args['testitConfig']) {
|
|
122
|
-
config = this.readConfigFile(args['testitConfig']);
|
|
123
|
-
}
|
|
124
|
-
return Client.mergeConfig(config, {
|
|
125
|
-
url: args['testitUrl'],
|
|
126
|
-
privateToken: args['testitPrivateToken'],
|
|
127
|
-
projectId: args['testitProjectId'],
|
|
128
|
-
configurationId: args['testitConfigurationId'],
|
|
129
|
-
testRunId: args['testitTestRunId'],
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
readEnvConfig() {
|
|
133
|
-
let config = {};
|
|
134
|
-
if (process.env['TESTIT_CONFIG_FILE']) {
|
|
135
|
-
config = this.readConfigFile(process.env['TESTIT_CONFIG_FILE']);
|
|
136
|
-
}
|
|
137
|
-
return Client.mergeConfig(config, {
|
|
138
|
-
url: process.env['TESTIT_URL'],
|
|
139
|
-
privateToken: process.env['TESTIT_PRIVATE_TOKEN'],
|
|
140
|
-
projectId: process.env['TESTIT_PROJECT_ID'],
|
|
141
|
-
configurationId: process.env['TESTIT_CONFIGURATION_ID'],
|
|
142
|
-
testRunId: process.env['TESTIT_TEST_RUN_ID'],
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
readConfigFile(path) {
|
|
146
|
-
if (!(0, fs_1.existsSync)(path)) {
|
|
147
|
-
throw new Error('Config file not found');
|
|
148
|
-
}
|
|
149
|
-
const config = JSON.parse((0, fs_1.readFileSync)(path, { encoding: 'utf8' }));
|
|
150
|
-
if (config.privateToken) {
|
|
151
|
-
console.warn('Private token is in config file, it is not secure');
|
|
152
|
-
}
|
|
153
|
-
return config;
|
|
154
|
-
}
|
|
155
|
-
static mergeConfig(oldConfig, newConfig) {
|
|
156
|
-
var _a, _b, _c, _d, _e;
|
|
157
|
-
return {
|
|
158
|
-
url: (_a = newConfig.url) !== null && _a !== void 0 ? _a : oldConfig.url,
|
|
159
|
-
privateToken: (_b = newConfig.privateToken) !== null && _b !== void 0 ? _b : oldConfig.privateToken,
|
|
160
|
-
projectId: (_c = newConfig.projectId) !== null && _c !== void 0 ? _c : oldConfig.projectId,
|
|
161
|
-
configurationId: (_d = newConfig.configurationId) !== null && _d !== void 0 ? _d : oldConfig.configurationId,
|
|
162
|
-
testRunId: (_e = newConfig.testRunId) !== null && _e !== void 0 ? _e : oldConfig.testRunId,
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
exports.Client = Client;
|
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./client"), exports);
|
|
14
|
-
__exportStar(require("./types"), exports);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface AttachmentPut {
|
|
2
|
-
id: string;
|
|
3
|
-
}
|
|
4
|
-
export interface Attachment {
|
|
5
|
-
fileId: string;
|
|
6
|
-
type: string;
|
|
7
|
-
size: number;
|
|
8
|
-
name: string;
|
|
9
|
-
createDate?: string;
|
|
10
|
-
modifiedDate?: string;
|
|
11
|
-
createdById?: string;
|
|
12
|
-
modifiedById?: string;
|
|
13
|
-
id?: string;
|
|
14
|
-
}
|
package/dist/types/attachment.js
DELETED
package/dist/types/autotest.d.ts
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { LabelPost, LabelShort } from './label';
|
|
2
|
-
import { Link, LinkPost, LinkPut } from './link';
|
|
3
|
-
import { AutotestStep } from './autotestStep';
|
|
4
|
-
export interface AutotestPost {
|
|
5
|
-
globalId?: number;
|
|
6
|
-
isDeleted?: boolean;
|
|
7
|
-
id?: string;
|
|
8
|
-
createdDate?: string;
|
|
9
|
-
modifiedDate?: string;
|
|
10
|
-
createdById?: string;
|
|
11
|
-
modifiedById?: string;
|
|
12
|
-
mustBeApproved?: boolean;
|
|
13
|
-
externalId: string;
|
|
14
|
-
links?: LinkPost[];
|
|
15
|
-
projectId: string;
|
|
16
|
-
name: string;
|
|
17
|
-
namespace?: string;
|
|
18
|
-
classname?: string;
|
|
19
|
-
steps?: AutotestStep[];
|
|
20
|
-
setup?: AutotestStep[];
|
|
21
|
-
teardown?: AutotestStep[];
|
|
22
|
-
title?: string;
|
|
23
|
-
description?: string;
|
|
24
|
-
labels?: LabelPost[];
|
|
25
|
-
}
|
|
26
|
-
export interface AutotestPut {
|
|
27
|
-
id?: string;
|
|
28
|
-
externalId: string;
|
|
29
|
-
links?: LinkPost[];
|
|
30
|
-
projectId: string;
|
|
31
|
-
name: string;
|
|
32
|
-
namespace?: string;
|
|
33
|
-
classname?: string;
|
|
34
|
-
steps?: AutotestStep[];
|
|
35
|
-
setup?: AutotestStep[];
|
|
36
|
-
teardown?: AutotestStep[];
|
|
37
|
-
title?: string;
|
|
38
|
-
description?: string;
|
|
39
|
-
labels?: LabelPost[];
|
|
40
|
-
}
|
|
41
|
-
export interface Autotest {
|
|
42
|
-
globalId?: number;
|
|
43
|
-
isDeleted?: boolean;
|
|
44
|
-
id?: string;
|
|
45
|
-
createdDate?: string;
|
|
46
|
-
modifiedDate?: string;
|
|
47
|
-
createdById?: string;
|
|
48
|
-
modifiedById?: string;
|
|
49
|
-
mustBeApproved?: boolean;
|
|
50
|
-
externalId: string;
|
|
51
|
-
links?: LinkPut[];
|
|
52
|
-
projectId: string;
|
|
53
|
-
name: string;
|
|
54
|
-
namespace?: string;
|
|
55
|
-
classname?: string;
|
|
56
|
-
steps?: AutotestStep[];
|
|
57
|
-
setup?: AutotestStep[];
|
|
58
|
-
teardown?: AutotestStep[];
|
|
59
|
-
title?: string;
|
|
60
|
-
description?: string;
|
|
61
|
-
labels?: LabelPost[];
|
|
62
|
-
}
|
|
63
|
-
export interface AutotestGet {
|
|
64
|
-
externalId?: string;
|
|
65
|
-
links?: Link[];
|
|
66
|
-
projectId?: string;
|
|
67
|
-
name?: string;
|
|
68
|
-
namespace?: string;
|
|
69
|
-
classname?: string;
|
|
70
|
-
steps?: AutotestStep[];
|
|
71
|
-
setup?: AutotestStep[];
|
|
72
|
-
teardown: AutotestStep[];
|
|
73
|
-
global?: number;
|
|
74
|
-
createdDate?: string;
|
|
75
|
-
modifiedDate?: string;
|
|
76
|
-
createdById?: string;
|
|
77
|
-
modifiedById?: string;
|
|
78
|
-
labels?: LabelShort[];
|
|
79
|
-
id?: string;
|
|
80
|
-
isDeleted?: boolean;
|
|
81
|
-
}
|
|
82
|
-
export interface AutotestQuery {
|
|
83
|
-
projectId?: string;
|
|
84
|
-
externalId?: string;
|
|
85
|
-
globalId?: number;
|
|
86
|
-
namespace?: string;
|
|
87
|
-
isNamespaceNull?: boolean;
|
|
88
|
-
classname?: string;
|
|
89
|
-
isClassnameNull?: boolean;
|
|
90
|
-
isDeleted?: boolean;
|
|
91
|
-
labels?: string[];
|
|
92
|
-
skip?: number;
|
|
93
|
-
take?: number;
|
|
94
|
-
orderBy?: string;
|
|
95
|
-
searchField?: string;
|
|
96
|
-
searchValue?: string;
|
|
97
|
-
}
|
package/dist/types/autotest.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { AttachmentPut } from './attachment';
|
|
2
|
-
import { LinkPost } from './link';
|
|
3
|
-
import { OutcomeType } from './outcome';
|
|
4
|
-
import { Parameters } from './parameters';
|
|
5
|
-
import { AttachmentPutModelAutotestStepResults } from './stepResults';
|
|
6
|
-
export interface AutotestResultsForTestRun {
|
|
7
|
-
configurationId: string;
|
|
8
|
-
links?: LinkPost[];
|
|
9
|
-
failureReasonName?: string;
|
|
10
|
-
autotestExternalId: string;
|
|
11
|
-
outcome: OutcomeType;
|
|
12
|
-
message?: string;
|
|
13
|
-
traces?: string;
|
|
14
|
-
startedOn?: string;
|
|
15
|
-
completeOn?: string;
|
|
16
|
-
duration?: number;
|
|
17
|
-
attachments?: AttachmentPut[];
|
|
18
|
-
parameters?: Parameters;
|
|
19
|
-
stepResults?: AttachmentPutModelAutotestStepResults[];
|
|
20
|
-
setupResults?: AttachmentPutModelAutotestStepResults[];
|
|
21
|
-
teardownResults?: AttachmentPutModelAutotestStepResults[];
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare type Capabilities = Record<string, string>;
|
package/dist/types/client.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Attachment, Autotest, AutotestPost, AutotestPut, AutotestQuery, AutotestResultsForTestRun, ClientConfig, TestRunGet, TestRunPost, WorkItemId } from '.';
|
|
2
|
-
export interface IClient {
|
|
3
|
-
checkConnection(): Promise<void>;
|
|
4
|
-
getAutotest(query: AutotestQuery): Promise<Autotest[]>;
|
|
5
|
-
createAutotest(autotest: AutotestPost): Promise<Autotest>;
|
|
6
|
-
updateAutotest(autotest: AutotestPut): Promise<void>;
|
|
7
|
-
linkToWorkItem(autotestId: string, workItem: WorkItemId): Promise<void>;
|
|
8
|
-
getTestRun(testRunId: string): TestRunGet;
|
|
9
|
-
createTestRun(testRun: TestRunPost): Promise<TestRunGet>;
|
|
10
|
-
startTestRun(testRunId: string): Promise<void>;
|
|
11
|
-
loadTestRunResults(testRunId: string, results: AutotestResultsForTestRun[]): Promise<string[]>;
|
|
12
|
-
completeTestRun(testRunId: string): Promise<void>;
|
|
13
|
-
getConfig(): ClientConfig;
|
|
14
|
-
loadAttachment(fileName: string): Promise<Attachment>;
|
|
15
|
-
}
|
package/dist/types/client.js
DELETED
package/dist/types/config.d.ts
DELETED
package/dist/types/config.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Capabilities } from './capabilities';
|
|
2
|
-
export interface Configuration {
|
|
3
|
-
description?: string;
|
|
4
|
-
isActive?: boolean;
|
|
5
|
-
capabilities: Capabilities;
|
|
6
|
-
projectId?: string;
|
|
7
|
-
isDefault?: boolean;
|
|
8
|
-
name?: string;
|
|
9
|
-
createdDate?: string;
|
|
10
|
-
modifiedDate?: string;
|
|
11
|
-
createdById?: string;
|
|
12
|
-
modifiedById?: string;
|
|
13
|
-
globalId?: number;
|
|
14
|
-
id?: number;
|
|
15
|
-
isDeleted?: boolean;
|
|
16
|
-
}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export * from './attachment';
|
|
2
|
-
export * from './autotest';
|
|
3
|
-
export * from './autotestResults';
|
|
4
|
-
export * from './autotestStep';
|
|
5
|
-
export * from './capabilities';
|
|
6
|
-
export * from './client';
|
|
7
|
-
export * from './config';
|
|
8
|
-
export * from './configuration';
|
|
9
|
-
export * from './label';
|
|
10
|
-
export * from './link';
|
|
11
|
-
export * from './outcome';
|
|
12
|
-
export * from './parameters';
|
|
13
|
-
export * from './properties';
|
|
14
|
-
export * from './stepResults';
|
|
15
|
-
export * from './tag';
|
|
16
|
-
export * from './testResult';
|
|
17
|
-
export * from './testRun';
|
|
18
|
-
export * from './workItem';
|
package/dist/types/index.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./attachment"), exports);
|
|
14
|
-
__exportStar(require("./autotest"), exports);
|
|
15
|
-
__exportStar(require("./autotestResults"), exports);
|
|
16
|
-
__exportStar(require("./autotestStep"), exports);
|
|
17
|
-
__exportStar(require("./capabilities"), exports);
|
|
18
|
-
__exportStar(require("./client"), exports);
|
|
19
|
-
__exportStar(require("./config"), exports);
|
|
20
|
-
__exportStar(require("./configuration"), exports);
|
|
21
|
-
__exportStar(require("./label"), exports);
|
|
22
|
-
__exportStar(require("./link"), exports);
|
|
23
|
-
__exportStar(require("./outcome"), exports);
|
|
24
|
-
__exportStar(require("./parameters"), exports);
|
|
25
|
-
__exportStar(require("./properties"), exports);
|
|
26
|
-
__exportStar(require("./stepResults"), exports);
|
|
27
|
-
__exportStar(require("./tag"), exports);
|
|
28
|
-
__exportStar(require("./testResult"), exports);
|
|
29
|
-
__exportStar(require("./testRun"), exports);
|
|
30
|
-
__exportStar(require("./workItem"), exports);
|
package/dist/types/label.d.ts
DELETED
package/dist/types/label.js
DELETED
package/dist/types/link.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export declare type LinkType = 'Related' | 'BlockedBy' | 'Defect' | 'Issue' | 'Requirement' | 'Repository';
|
|
2
|
-
export interface LinkPost {
|
|
3
|
-
title?: string;
|
|
4
|
-
url: string;
|
|
5
|
-
description?: string;
|
|
6
|
-
type?: LinkType;
|
|
7
|
-
hasInfo?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export interface LinkPut {
|
|
10
|
-
id?: string;
|
|
11
|
-
title?: string;
|
|
12
|
-
url: string;
|
|
13
|
-
description?: string;
|
|
14
|
-
type?: LinkType;
|
|
15
|
-
hasInfo?: boolean;
|
|
16
|
-
}
|
|
17
|
-
export interface Link {
|
|
18
|
-
id?: string;
|
|
19
|
-
title?: string;
|
|
20
|
-
url: string;
|
|
21
|
-
description?: string;
|
|
22
|
-
type?: LinkType;
|
|
23
|
-
hasInfo?: boolean;
|
|
24
|
-
}
|
package/dist/types/link.js
DELETED
package/dist/types/outcome.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare type OutcomeType = 'Passed' | 'Failed' | 'Pending' | 'Blocked' | 'Skipped';
|
package/dist/types/outcome.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare type Parameters = Record<string, string>;
|
package/dist/types/parameters.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare type Properties = Record<string, string>;
|
package/dist/types/properties.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AttachmentPut } from './attachment';
|
|
2
|
-
import { OutcomeType } from './outcome';
|
|
3
|
-
import { Parameters } from './parameters';
|
|
4
|
-
export interface AttachmentPutModelAutotestStepResults {
|
|
5
|
-
title?: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
startedOn?: string;
|
|
8
|
-
completedOn?: string;
|
|
9
|
-
duration?: number;
|
|
10
|
-
outcome?: OutcomeType;
|
|
11
|
-
stepResults?: AttachmentPutModelAutotestStepResults[];
|
|
12
|
-
attachments?: AttachmentPut[];
|
|
13
|
-
parameters?: Parameters;
|
|
14
|
-
}
|
package/dist/types/tag.d.ts
DELETED
package/dist/types/tag.js
DELETED
package/dist/types/testPoint.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Attachment } from './attachment';
|
|
2
|
-
import { AutotestGet } from './autotest';
|
|
3
|
-
import { Configuration } from './configuration';
|
|
4
|
-
import { Link } from './link';
|
|
5
|
-
import { OutcomeType } from './outcome';
|
|
6
|
-
import { Parameters } from './parameters';
|
|
7
|
-
import { Properties } from './properties';
|
|
8
|
-
import { TestPointShort } from './testPoint';
|
|
9
|
-
export interface TestResultGet {
|
|
10
|
-
configuration?: Configuration;
|
|
11
|
-
autoTest?: AutotestGet;
|
|
12
|
-
is?: string;
|
|
13
|
-
configurationId?: string;
|
|
14
|
-
workItemVersionId?: string;
|
|
15
|
-
autotestId?: string;
|
|
16
|
-
message?: string;
|
|
17
|
-
traces?: string;
|
|
18
|
-
startedOn?: string;
|
|
19
|
-
completedOn?: string;
|
|
20
|
-
runByUserId?: string;
|
|
21
|
-
stoppedByUserId?: string;
|
|
22
|
-
testPointId?: string;
|
|
23
|
-
testPoint?: TestPointShort;
|
|
24
|
-
testRunId?: string;
|
|
25
|
-
outcome?: OutcomeType;
|
|
26
|
-
comment?: string;
|
|
27
|
-
links?: Link[];
|
|
28
|
-
attachments?: Attachment[];
|
|
29
|
-
parameters?: Parameters;
|
|
30
|
-
properties?: Properties;
|
|
31
|
-
}
|
package/dist/types/testResult.js
DELETED
package/dist/types/testRun.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { TestResultGet } from './testResult';
|
|
2
|
-
export declare type TestRunStateType = 'NotStarted' | 'InProgress' | 'Stopped' | 'Completed';
|
|
3
|
-
export interface TestRunPost {
|
|
4
|
-
projectId: string;
|
|
5
|
-
name?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface TestRunGet {
|
|
8
|
-
startedOn?: string;
|
|
9
|
-
completedOn?: string;
|
|
10
|
-
stateName?: TestRunStateType;
|
|
11
|
-
projectId?: string;
|
|
12
|
-
testPlanId?: string;
|
|
13
|
-
testResults?: TestResultGet[];
|
|
14
|
-
createdDate?: string;
|
|
15
|
-
modifiedDate?: string;
|
|
16
|
-
createById?: string;
|
|
17
|
-
modifiedById?: string;
|
|
18
|
-
id: string;
|
|
19
|
-
name: string;
|
|
20
|
-
}
|
package/dist/types/testRun.js
DELETED
package/dist/types/workItem.d.ts
DELETED
package/dist/types/workItem.js
DELETED
package/dist/validation.d.ts
DELETED
package/dist/validation.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateConfig = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const configSchema = zod_1.z.object({
|
|
6
|
-
configurationId: zod_1.z.string().uuid(),
|
|
7
|
-
privateToken: zod_1.z.string(),
|
|
8
|
-
projectId: zod_1.z.string().uuid(),
|
|
9
|
-
url: zod_1.z.string().url(),
|
|
10
|
-
testRunId: zod_1.z.string().uuid().optional(),
|
|
11
|
-
});
|
|
12
|
-
function validateConfig(config) {
|
|
13
|
-
return configSchema.parse(config);
|
|
14
|
-
}
|
|
15
|
-
exports.validateConfig = validateConfig;
|