complexqa_frontend_core 1.10.11 → 1.11.1
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/package.json +1 -1
- package/publish/api/index.js +6 -0
- package/publish/api/task_api.js +39 -0
- package/publish/api/team_management_api.js +21 -0
- package/publish/api/test_account_api.js +17 -0
- package/publish/types/family_elements/typeTask.js +15 -21
- package/publish/types/family_elements/typeTeam.js +14 -3
- package/publish/types/family_elements/typeTestAccount.js +55 -0
package/package.json
CHANGED
package/publish/api/index.js
CHANGED
|
@@ -9,6 +9,8 @@ import { TeamMemberApi } from "./team_member_api.js";
|
|
|
9
9
|
import { TestRunApi } from "./test_run_api.js";
|
|
10
10
|
import { TestRunResultApi } from "./test_run_result_api.js";
|
|
11
11
|
import { UserProfileApi } from "./user_profile_api.js";
|
|
12
|
+
import { TaskApi } from "./task_api.js";
|
|
13
|
+
import { TestAccountApi } from "./test_account_api.js";
|
|
12
14
|
|
|
13
15
|
/**
|
|
14
16
|
* Обертка над axios
|
|
@@ -141,5 +143,9 @@ export class Api
|
|
|
141
143
|
this.test_run = new TestRunApi(payload);
|
|
142
144
|
this.test_run_result = new TestRunResultApi(payload);
|
|
143
145
|
this.user_profile = new UserProfileApi(payload);
|
|
146
|
+
this.task = new TaskApi(payload);
|
|
147
|
+
this.test_account = new TestAccountApi(payload);
|
|
148
|
+
|
|
149
|
+
|
|
144
150
|
}
|
|
145
151
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ApiAbstractElementClass } from "./api_abstract_element_class.js";
|
|
2
|
+
import { typeTeam } from "../types/family_elements/typeTeam.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @version v.0.1 (21/03/2026)
|
|
7
|
+
*/
|
|
8
|
+
export class TaskApi extends ApiAbstractElementClass
|
|
9
|
+
{
|
|
10
|
+
module_prefix = 'task';
|
|
11
|
+
|
|
12
|
+
constructor(options)
|
|
13
|
+
{
|
|
14
|
+
super(options);
|
|
15
|
+
this.set_element_class_instance(typeTeam);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @version v.0.1 (21/03/2026)
|
|
23
|
+
* @param payload
|
|
24
|
+
* @returns {Promise<{payload: (*|{}), response: Promise<*>}>}
|
|
25
|
+
*/
|
|
26
|
+
async get_current_user_tasks(payload = {})
|
|
27
|
+
{
|
|
28
|
+
let url = `/${ this.api_prefix }/${ this.module_prefix }/get_current_user_tasks`;
|
|
29
|
+
|
|
30
|
+
payload = this.handle_request_payload(payload);
|
|
31
|
+
let response = this.api_request(url, payload);
|
|
32
|
+
response = this.handle_response(response);
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
response: response,
|
|
36
|
+
payload : payload
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -35,4 +35,25 @@ export class TeamManagementApi extends ApiAbstractElementClass
|
|
|
35
35
|
payload : payload
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @version v.0.1 (21/03/2026)
|
|
43
|
+
* @param payload
|
|
44
|
+
* @returns {Promise<{payload: (*|{}), response: Promise<*>}>}
|
|
45
|
+
*/
|
|
46
|
+
async get_team_total_statistic(payload = {})
|
|
47
|
+
{
|
|
48
|
+
let url = `/${ this.api_prefix }/${ this.module_prefix }/get_team_total_statistic`;
|
|
49
|
+
|
|
50
|
+
payload = this.handle_request_payload(payload);
|
|
51
|
+
let response = this.api_request(url, payload);
|
|
52
|
+
response = this.handle_response(response);
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
response: response,
|
|
56
|
+
payload : payload
|
|
57
|
+
};
|
|
58
|
+
}
|
|
38
59
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ApiAbstractElementClass } from "./api_abstract_element_class.js";
|
|
2
|
+
import { typeTestAccount } from "../types/family_elements/typeTestAccount.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @version v.0.1 (21/03/2026)
|
|
7
|
+
*/
|
|
8
|
+
export class TestAccountApi extends ApiAbstractElementClass
|
|
9
|
+
{
|
|
10
|
+
module_prefix = 'test_account';
|
|
11
|
+
|
|
12
|
+
constructor(options)
|
|
13
|
+
{
|
|
14
|
+
super(options);
|
|
15
|
+
this.set_element_class_instance(typeTestAccount);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -3,6 +3,8 @@ import { is_object } from "../../utils/utils";
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
+
* Надо пересмотреть тут всё
|
|
7
|
+
*
|
|
6
8
|
* @version v.2.0 (07/07/2024)
|
|
7
9
|
*/
|
|
8
10
|
export class typeTask extends familyGeneralElement
|
|
@@ -11,7 +13,6 @@ export class typeTask extends familyGeneralElement
|
|
|
11
13
|
team_id; // foreign key
|
|
12
14
|
task_performer_id; // foreign key // @todo переименовать с общепринятой практикой
|
|
13
15
|
task_initiator_id; // foreign key // @todo переименовать с общепринятой практикой
|
|
14
|
-
task_type; // enum => сделать тест, выполнить тест, итд (!не дублирует предмет задания - тут тип + действие)
|
|
15
16
|
task_status; // enum
|
|
16
17
|
project_id; // foreign key (денормализация) (а надо ли)
|
|
17
18
|
task_subject_element_type; // предмет задания
|
|
@@ -19,6 +20,7 @@ export class typeTask extends familyGeneralElement
|
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
primary_key = 'task_id';
|
|
23
|
+
api_key = 'task';
|
|
22
24
|
|
|
23
25
|
structure_scheme = {
|
|
24
26
|
task_id : 'integer | require',
|
|
@@ -32,26 +34,6 @@ export class typeTask extends familyGeneralElement
|
|
|
32
34
|
task_subject_id : 'integer | optional',
|
|
33
35
|
};
|
|
34
36
|
|
|
35
|
-
available_enum_values = {
|
|
36
|
-
task_status: [ 'OPEN', 'IN_PROGRESS', 'DONE', 'CANCELLED' ],
|
|
37
|
-
// тут будет много, все надо перечислить, чтобы просто по каждой описать свой код
|
|
38
|
-
// и не все комбинации action + element доступны и могут существовать
|
|
39
|
-
task_type : [
|
|
40
|
-
'CREATE_PROJECT_DOCUMENT',
|
|
41
|
-
'CREATE_FUNCTIONAL',
|
|
42
|
-
'CREATE_TESTCASE',
|
|
43
|
-
'CREATE_TEST_RUN',
|
|
44
|
-
'RUN_TEST_RUN'
|
|
45
|
-
],
|
|
46
|
-
task_subject_element_type: [
|
|
47
|
-
'PROJECT',
|
|
48
|
-
'PROJECT_DOCUMENT',
|
|
49
|
-
'TEST_SUITE',
|
|
50
|
-
'TEST_CASE',
|
|
51
|
-
'TEST_RUN',
|
|
52
|
-
'TEST_RESULT',
|
|
53
|
-
],
|
|
54
|
-
};
|
|
55
37
|
|
|
56
38
|
|
|
57
39
|
/**
|
|
@@ -75,4 +57,16 @@ export class typeTask extends familyGeneralElement
|
|
|
75
57
|
|
|
76
58
|
return this;
|
|
77
59
|
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Return collection grouped elements (search by assigned_to)
|
|
64
|
+
*
|
|
65
|
+
* @version v.0.1 (21/03/2026)
|
|
66
|
+
* @returns {Promise<*>}
|
|
67
|
+
*/
|
|
68
|
+
async get_current_user_tasks()
|
|
69
|
+
{
|
|
70
|
+
return ApiService[ this.api_key ].get_current_user_tasks();
|
|
71
|
+
}
|
|
78
72
|
}
|
|
@@ -28,7 +28,7 @@ export class typeTeam extends familyGeneralElement
|
|
|
28
28
|
team_id : 'integer | require',
|
|
29
29
|
team_status : 'string | enum | require',
|
|
30
30
|
team_type : 'string | enum | require',
|
|
31
|
-
price_id
|
|
31
|
+
price_id : 'integer | enum | require',
|
|
32
32
|
team_country_code: 'string | country_code | require',
|
|
33
33
|
team_name : 'string | unique | require',
|
|
34
34
|
team_slug : 'string | unique | require',
|
|
@@ -68,7 +68,6 @@ export class typeTeam extends familyGeneralElement
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
|
|
71
|
-
|
|
72
71
|
/**
|
|
73
72
|
*
|
|
74
73
|
* @version v.0.1 (03/02/2026)
|
|
@@ -81,7 +80,7 @@ export class typeTeam extends familyGeneralElement
|
|
|
81
80
|
/**
|
|
82
81
|
* {Api} ApiService
|
|
83
82
|
*/
|
|
84
|
-
return ApiService[this.api_key].is_team_slug_available(payload).then((response) =>
|
|
83
|
+
return ApiService[ this.api_key ].is_team_slug_available(payload).then((response) =>
|
|
85
84
|
{
|
|
86
85
|
if (typeof callback?.success === 'function')
|
|
87
86
|
{
|
|
@@ -102,4 +101,16 @@ export class typeTeam extends familyGeneralElement
|
|
|
102
101
|
}
|
|
103
102
|
});
|
|
104
103
|
}
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Return {"project":1,"test_suite":1,"test_case":1,"test_case_step":1,"test_runs":1,"team_member":1}
|
|
108
|
+
*
|
|
109
|
+
* @version v.0.1 (21/03/2026)
|
|
110
|
+
* @returns {Promise<object>}
|
|
111
|
+
*/
|
|
112
|
+
async get_team_total_statistic()
|
|
113
|
+
{
|
|
114
|
+
return ApiService[ this.api_key ].get_team_total_statistic();
|
|
115
|
+
}
|
|
105
116
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { familyGeneralElement } from "./0_familyGeneralElement";
|
|
2
|
+
import { is_object } from "../../utils/utils";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Тестовые аккаунты
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* @version v.0.1 (21/03/2026)
|
|
9
|
+
*/
|
|
10
|
+
export class typeTestAccount extends familyGeneralElement
|
|
11
|
+
{
|
|
12
|
+
test_account_id;
|
|
13
|
+
team_id;
|
|
14
|
+
project_id;
|
|
15
|
+
resource;
|
|
16
|
+
login;
|
|
17
|
+
password;
|
|
18
|
+
test_account_description;
|
|
19
|
+
|
|
20
|
+
primary_key = 'test_account_id';
|
|
21
|
+
api_key = 'test_account';
|
|
22
|
+
|
|
23
|
+
structure_scheme = {
|
|
24
|
+
test_account_id : 'integer | require',
|
|
25
|
+
project_id : 'integer | require',
|
|
26
|
+
team_id : 'integer | require',
|
|
27
|
+
resource : 'string | require',
|
|
28
|
+
login : 'string | require',
|
|
29
|
+
password : 'string | optional',
|
|
30
|
+
test_account_description: 'string | optional',
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @param {object|false|undefined} data
|
|
37
|
+
*/
|
|
38
|
+
constructor(data = false)
|
|
39
|
+
{
|
|
40
|
+
super();
|
|
41
|
+
|
|
42
|
+
if (data && is_object(data))
|
|
43
|
+
{
|
|
44
|
+
_.mapObject(data, (value, key) =>
|
|
45
|
+
{
|
|
46
|
+
if (this.hasOwnProperty(key))
|
|
47
|
+
{
|
|
48
|
+
this [ key ] = value;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
}
|