complexqa_frontend_core 1.0.9 → 1.0.10

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.
Files changed (51) hide show
  1. package/package.json +3 -3
  2. package/publish/api/api_abstract_element_class.js +426 -0
  3. package/publish/api/functional_api.js +18 -0
  4. package/publish/api/index.js +114 -0
  5. package/publish/api/project_api.js +17 -0
  6. package/publish/api/service_api.js +20 -0
  7. package/publish/api/team_member_api.js +18 -0
  8. package/publish/api/test_case_api.js +18 -0
  9. package/publish/api/test_case_step_api.js +18 -0
  10. package/publish/api/test_plan_api.js +18 -0
  11. package/publish/api/test_run_api.js +13 -0
  12. package/publish/api/test_run_result_api.js +18 -0
  13. package/publish/api/test_suite_api.js +18 -0
  14. package/publish/exceptions/ApiException.js +69 -0
  15. package/publish/index.js +50 -0
  16. package/publish/services/UserService.js +129 -0
  17. package/publish/services/abstractService.js +36 -0
  18. package/publish/services/mock_data/MockUserService.js +30 -0
  19. package/publish/services/serviceTranslate.js +98 -0
  20. package/publish/types/family_elements/0_familyGeneralElement.js +439 -0
  21. package/publish/types/family_elements/mock_data/abstract_mock_data.js +13 -0
  22. package/publish/types/family_elements/mock_data/mock_data_typeProject.js +88 -0
  23. package/publish/types/family_elements/typeActionLog.js +9 -0
  24. package/publish/types/family_elements/typeFunctional.js +96 -0
  25. package/publish/types/family_elements/typeFunctionalGroup.js +95 -0
  26. package/publish/types/family_elements/typeMilestone.js +93 -0
  27. package/publish/types/family_elements/typeProject.js +114 -0
  28. package/publish/types/family_elements/typeProjectDocument.js +80 -0
  29. package/publish/types/family_elements/typeProjectTestAccount.js +59 -0
  30. package/publish/types/family_elements/typeProjectTestData.js +43 -0
  31. package/publish/types/family_elements/typeProjectUserRole.js +55 -0
  32. package/publish/types/family_elements/typeTask.js +78 -0
  33. package/publish/types/family_elements/typeTeam.js +105 -0
  34. package/publish/types/family_elements/typeTeamMember.js +58 -0
  35. package/publish/types/family_elements/typeTeamUserRole.js +56 -0
  36. package/publish/types/family_elements/typeTestCase.js +98 -0
  37. package/publish/types/family_elements/typeTestCaseStep.js +87 -0
  38. package/publish/types/family_elements/typeTestPlan.js +35 -0
  39. package/publish/types/family_elements/typeTestRun.js +56 -0
  40. package/publish/types/family_elements/typeTestRunResult.js +72 -0
  41. package/publish/types/family_elements/typeTestSuite.js +75 -0
  42. package/publish/types/family_elements/typeUser.js +56 -0
  43. package/publish/types/family_service/familyService.js +8 -0
  44. package/publish/types/family_service/typeAppConfiguration.js +39 -0
  45. package/publish/types/family_service/typeFOR.js +36 -0
  46. package/publish/types/family_service/typeFilter.js +38 -0
  47. package/publish/types/family_service/typeFunctionCallback.js +40 -0
  48. package/publish/types/family_service/typeNotification.js +36 -0
  49. package/publish/types/family_service/typeTableColumn.js +37 -0
  50. package/publish/types/family_service/typeTableConfiguration.js +56 -0
  51. package/publish/utils/utils.js +190 -0
@@ -0,0 +1,105 @@
1
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2
+ import { is_object } from "../../utils/utils";
3
+
4
+
5
+ /**
6
+ * @version v.0.1 (23/06/2024)
7
+ */
8
+ export class typeTeam extends familyGeneralElement
9
+ {
10
+ team_id; //
11
+ team_status; // enum
12
+ team_type; // enum
13
+ team_country_code; // (закон о перс данных и иные) как минимум статистика
14
+ team_name;
15
+ _team_price_id // foreign key (тариф)
16
+ team_root_user_id; // foreign key
17
+ created_at;
18
+ updated_at;
19
+ // тут где-то могут быть тарифы
20
+
21
+
22
+ primary_key = 'team_id';
23
+
24
+ structure_scheme = {
25
+ team_id : 'integer | require',
26
+ team_status : 'string | enum | require',
27
+ team_type : 'string | enum | require',
28
+ team_country_code: 'string | country_code | require',
29
+ team_name : 'string | require',
30
+ team_price_id : 'integer | require',
31
+ team_root_user_id: 'integer | require',
32
+ created_at : 'timestamp | require',
33
+ updated_at : 'timestamp | optional',
34
+ };
35
+
36
+
37
+ available_enum_values = {
38
+ team_status: [ 'PENDING', 'APPROVED', 'BANNED', 'FROZEN', 'TRIAL' ],
39
+ team_type : [ 'PERSONAL', 'ORGANIZATION', 'SCHOOL' ],
40
+ };
41
+
42
+
43
+ /**
44
+ *
45
+ * @param {object|false|undefined} data
46
+ */
47
+ constructor(data = false)
48
+ {
49
+ super();
50
+
51
+ if (data && is_object(data))
52
+ {
53
+ _.mapObject(data, (value, key) =>
54
+ {
55
+ if (this.hasOwnProperty(key))
56
+ {
57
+ this [ key ] = value;
58
+ }
59
+ });
60
+ }
61
+
62
+ return this;
63
+ }
64
+
65
+
66
+ /******************************************************************************************/
67
+ /*********************************** general **********************************************/
68
+
69
+ /******************************************************************************************/
70
+
71
+ /**
72
+ *
73
+ * @version v.0.1 (07/07/2024)
74
+ */
75
+ async create()
76
+ {}
77
+
78
+
79
+ /******************************************************************************************/
80
+ /*********************** работа с администраторами компании *******************************/
81
+
82
+ /******************************************************************************************/
83
+
84
+ adminstator_add() {}
85
+
86
+ adminstator_update() {}
87
+
88
+ adminstator_delete() {}
89
+
90
+ adminstators_get() {}
91
+
92
+
93
+ /******************************************************************************************/
94
+ /************************* работа с сотрудниками компании *********************************/
95
+
96
+ /******************************************************************************************/
97
+
98
+ user_add() {}
99
+
100
+ user_update() {}
101
+
102
+ user_delete() {}
103
+
104
+ users_get() {}
105
+ }
@@ -0,0 +1,58 @@
1
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2
+ import { is_object } from "../../utils/utils";
3
+
4
+
5
+ /**
6
+ * @version v.0.2 (11/11/2024)
7
+ */
8
+ export class typeTeamMember extends familyGeneralElement
9
+ {
10
+ team_member_id;
11
+ team_id;
12
+ user_id;
13
+ team_member_status;
14
+ member_role;
15
+ created_at;
16
+ updated_at;
17
+
18
+
19
+ primary_key = 'team_member_id';
20
+
21
+ structure_scheme = {
22
+ team_member_id : 'integer | require',
23
+ team_id : 'integer | require',
24
+ user_id : 'integer | require',
25
+ team_member_status: 'string | enum | require',
26
+ member_role: 'string | enum | require',
27
+ created_at : 'timestamp | require',
28
+ updated_at : 'timestamp | optional',
29
+ };
30
+
31
+ available_enum_values = {
32
+ team_member_status: [ 'PENDING', 'ACCEPTED', 'BANNED', 'REJECTED' ],
33
+ member_role : [ 'ROOT', 'ADMINISTRATOR', 'MEMBER' ]
34
+ };
35
+
36
+
37
+ /**
38
+ *
39
+ * @param {object|false|undefined} data
40
+ */
41
+ constructor(data = false)
42
+ {
43
+ super();
44
+
45
+ if (data && is_object(data))
46
+ {
47
+ _.mapObject(data, (value, key) =>
48
+ {
49
+ if (this.hasOwnProperty(key))
50
+ {
51
+ this [ key ] = value;
52
+ }
53
+ });
54
+ }
55
+
56
+ return this;
57
+ }
58
+ }
@@ -0,0 +1,56 @@
1
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2
+ import { is_object } from "../../utils/utils";
3
+
4
+ /**
5
+ * Роль пользователя в команде
6
+ * Должно стать часть team management
7
+ *
8
+ * Один пользователь может иметь много ролей (разработчик, тестировщик, ...)
9
+ *
10
+ * @version v.0.1 (07/07/2024)
11
+ */
12
+ export class typeTeamUserRole extends familyGeneralElement
13
+ {
14
+ // @todo - все не актуально, поменять
15
+ role_slug;
16
+ role_description;
17
+ team_id;
18
+ user_id;
19
+
20
+ primary_key = 'role_slug';
21
+
22
+ structure_scheme = {
23
+ role_slug : 'string | require',
24
+ role_description: 'string | optional',
25
+ team_id : 'integer | require',
26
+ user_id : 'integer | require',
27
+ };
28
+
29
+ /*available_enum_values = {
30
+ // эти роли вынесены
31
+ role_slug: [ 'ROOT', 'ADMINISTRATOR', 'MEMBER' ]
32
+ };
33
+ */
34
+
35
+ /**
36
+ *
37
+ * @param {object|false|undefined} data
38
+ */
39
+ constructor(data = false)
40
+ {
41
+ super();
42
+
43
+ if (data && is_object(data))
44
+ {
45
+ _.mapObject(data, (value, key) =>
46
+ {
47
+ if (this.hasOwnProperty(key))
48
+ {
49
+ this [ key ] = value;
50
+ }
51
+ });
52
+ }
53
+
54
+ return this;
55
+ }
56
+ }
@@ -0,0 +1,98 @@
1
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2
+ import { echo, is_object } from "../../utils/utils";
3
+
4
+
5
+ /**
6
+ *
7
+ * @version v.0.2 (10/12/2024)
8
+ */
9
+ export class typeTestCase extends familyGeneralElement
10
+ {
11
+ test_case_id;
12
+ test_suite_id; // foreign key
13
+ project_id; // foreign key
14
+ team_id; // foreign key // secure - access
15
+ functional_id; // foreign key
16
+ test_case_title; // text 90
17
+ test_case_preconditions; // text (взято у рельсов)
18
+ test_case_mission; // text (взято у рельсов)
19
+ test_case_goals; // text (взято у рельсов)
20
+ test_case_description; // text 250
21
+ test_case_time_to_execute; // время выполнения (в секундах) (оценочное) (для планирования работ)
22
+ test_case_complexity; // enum (для планирования работ)
23
+ test_case_importance; // enum (для планирования работ)
24
+ test_case_steps; // pseudo // foreign key - relations
25
+ test_case_presteps; // pseudo // foreign key - relations
26
+ _attachments; // typeAttachments - <relations>
27
+ preconditions; // text
28
+ excepted_result; // text // ?? <goals>
29
+ created_at;
30
+ updated_at;
31
+
32
+
33
+ primary_key = 'test_case_id';
34
+ api_key = 'test_case';
35
+
36
+ // @todo - довнести
37
+ structure_scheme = {
38
+ test_case_id : 'integer | require',
39
+ test_suite_id : 'integer | require',
40
+ project_id : 'integer | require',
41
+ team_id : 'integer | require',
42
+ functional_id : 'integer | optional',
43
+ test_case_title : 'string | require',
44
+ test_case_descriptions : 'string | require',
45
+ test_case_time_to_execute: 'integer | optional',
46
+ test_case_complexity : 'string | enum | optional',
47
+ test_case_importance : 'string | enum | optional',
48
+ created_at : 'timestamp | require',
49
+ updated_at : 'timestamp | optional',
50
+ };
51
+
52
+ available_enum_values = {
53
+ test_case_complexity: [ 'LOW', 'NORMAL', 'HIGH' ],
54
+ test_case_importance: [ 'LOW', 'NORMAL', 'HIGH' ],
55
+ };
56
+
57
+
58
+ /**
59
+ *
60
+ * @param {object|false|undefined} data
61
+ */
62
+ constructor(data = false)
63
+ {
64
+ super();
65
+
66
+ if (data && is_object(data))
67
+ {
68
+ _.mapObject(data, (value, key) =>
69
+ {
70
+ if (this.hasOwnProperty(key))
71
+ {
72
+ this [ key ] = value;
73
+ }
74
+ });
75
+ }
76
+
77
+ return this;
78
+ }
79
+
80
+
81
+ /******************************************************************************************/
82
+ /*********************************** general **********************************************/
83
+
84
+ /******************************************************************************************/
85
+
86
+ /**
87
+ *
88
+ * @version v.0.1 (05/06/2025)
89
+ *
90
+ * @returns {string}
91
+ */
92
+ get_element_name()
93
+ {
94
+ return this.test_case_title;
95
+ }
96
+
97
+
98
+ }
@@ -0,0 +1,87 @@
1
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2
+ import { is_object } from "../../utils/utils";
3
+
4
+
5
+ /**
6
+ *
7
+ * @version v.1.1 (26/05/2024)
8
+ */
9
+ export class typeTestCaseStep extends familyGeneralElement
10
+ {
11
+ test_case_step_id;
12
+ test_case_step_type;
13
+ team_id; // foreign key
14
+ test_case_id; // relations
15
+ sort_order;
16
+ step_text;
17
+ step_element;
18
+ step_element_action;
19
+ step_excepted_result;
20
+
21
+ primary_key = 'test_case_step_id';
22
+ api_key = 'test_case_step';
23
+
24
+ structure_scheme = {
25
+ test_case_step_id : 'integer | require',
26
+ test_case_step_type : 'string | enum | optional',
27
+ team_id : 'integer | require',
28
+ test_case_id : 'integer | require',
29
+ sort_order : 'integer | optional',
30
+ step_text : 'string | optional',
31
+ step_element : 'string | optional',
32
+ step_element_action : 'string | optional',
33
+ step_excepted_result: 'string | optional',
34
+ };
35
+
36
+
37
+ available_enum_values = {
38
+ test_case_step_type: [ 'TEST_CASE_STEP', 'TEST_CASE_PRESTEP' ],
39
+ };
40
+
41
+
42
+ /******************************************************************************************/
43
+ /******************************************************************************************/
44
+ /******************************************************************************************/
45
+
46
+
47
+ /**
48
+ *
49
+ * @param {object|false|undefined} data
50
+ */
51
+ constructor(data = false)
52
+ {
53
+ super();
54
+
55
+ if (data && is_object(data))
56
+ {
57
+ _.mapObject(data, (value, key) =>
58
+ {
59
+ if (this.hasOwnProperty(key))
60
+ {
61
+ this [ key ] = value;
62
+ }
63
+ });
64
+ }
65
+
66
+ return this;
67
+ }
68
+
69
+
70
+
71
+ /******************************************************************************************/
72
+ /******************************************************************************************/
73
+ /******************************************************************************************/
74
+
75
+
76
+
77
+ /**
78
+ *
79
+ * @version v.0.1 (05/06/2025)
80
+ *
81
+ * @returns {string}
82
+ */
83
+ get_element_name()
84
+ {
85
+ return this.test_suite_name;
86
+ }
87
+ }
@@ -0,0 +1,35 @@
1
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2
+ import { is_object } from "../../utils/utils";
3
+
4
+
5
+ /**
6
+ * Нужен ли этот тип?
7
+ *
8
+ * @version v.0.1 (26/05/2024)
9
+ */
10
+ export class typeTestPlan extends familyGeneralElement
11
+ {
12
+
13
+
14
+ /**
15
+ *
16
+ * @param {object|false|undefined} data
17
+ */
18
+ constructor(data = false)
19
+ {
20
+ super();
21
+
22
+ if (data && is_object(data))
23
+ {
24
+ _.mapObject(data, (value, key) =>
25
+ {
26
+ if (this.hasOwnProperty(key))
27
+ {
28
+ this [ key ] = value;
29
+ }
30
+ });
31
+ }
32
+
33
+ return this;
34
+ }
35
+ }
@@ -0,0 +1,56 @@
1
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2
+ import { is_object } from "../../utils/utils";
3
+
4
+ /**
5
+ * Коллекция тестов для работы, она же parent для typeTestRunResult
6
+ *
7
+ * Содержит ссылки на коллекцию тест кейсов
8
+ *
9
+ * @version v.0.2 (21/01/2025)
10
+ */
11
+ export class typeTestRun extends familyGeneralElement
12
+ {
13
+ test_run_id;
14
+ test_run_name;
15
+ test_run_description;
16
+ milestone_id; /// ??
17
+ assigned_to;
18
+ test_case_ids; // массив тестов на запуск
19
+ test_run_status;
20
+ test_case_summary_statistic; // массив [key->value] по статусам вложенных тест-кейсов для визуализации
21
+ // typeTestRunResult.test_result_status : 'PASSED', 'FAILED', 'SKIPPED', 'BLOCKED', 'RETEST'
22
+
23
+
24
+ created_at;
25
+ updated_at;
26
+ completed_at;
27
+
28
+ // логи запуска, окончания - отдельно
29
+ primary_key = 'test_run_id';
30
+
31
+ available_enum_values = {
32
+ test_run_status: [ 'PENDING', 'IN_PROGRESS', 'COMPLETED', 'CLOSED' ],
33
+ };
34
+
35
+ /**
36
+ *
37
+ * @param {object|false|undefined} data
38
+ */
39
+ constructor(data = false)
40
+ {
41
+ super();
42
+
43
+ if (data && is_object(data))
44
+ {
45
+ _.mapObject(data, (value, key) =>
46
+ {
47
+ if (this.hasOwnProperty(key))
48
+ {
49
+ this [ key ] = value;
50
+ }
51
+ });
52
+ }
53
+
54
+ return this;
55
+ }
56
+ }
@@ -0,0 +1,72 @@
1
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2
+ import { is_object } from "../../utils/utils";
3
+
4
+ /**
5
+ * 1 результат по каждому тест кейсу
6
+ *
7
+ * отчет смотрим по testRuns
8
+ *
9
+ * @version v.0.4 (10/12/2024)
10
+ */
11
+ export class typeTestRunResult extends familyGeneralElement
12
+ {
13
+ test_run_result_id;
14
+ test_case_id;
15
+ test_run_id;
16
+ test_result_status;
17
+ task_id; // надо ли?
18
+ project_id;
19
+ functional_id; // надо ли?
20
+ milestone_id;
21
+ elapsed_time; // фактическое время выполнения
22
+ reference_defects_ids; // list of IDs in user bug tracker / include sentry ids
23
+
24
+ created_at;
25
+ updated_at;
26
+ completed_at;
27
+
28
+
29
+ // тут нужен ещё контекст выполнения (банально список браузеров)
30
+
31
+ primary_key = 'test_run_result_id';
32
+
33
+ structure_scheme = {
34
+ test_result_id : 'integer | require',
35
+ test_case_id : 'integer | require',
36
+ test_run_id : 'integer | require',
37
+ test_result_status : 'string | enum | require',
38
+ task_id : 'integer | require',
39
+ project_id : 'integer | require',
40
+ functional_id : 'integer | optional',
41
+ milestone_id : 'integer | optional',
42
+ test_run_result_to_execute: 'time | optional',
43
+ reference_defects_ids : 'array | reference | optional',
44
+ };
45
+
46
+ available_enum_values = {
47
+ test_result_status: [ 'PASSED', 'FAILED', 'SKIPPED', 'BLOCKED', 'RETEST' ]
48
+ };
49
+
50
+
51
+ /**
52
+ *
53
+ * @param {object|false|undefined} data
54
+ */
55
+ constructor(data = false)
56
+ {
57
+ super();
58
+
59
+ if (data && is_object(data))
60
+ {
61
+ _.mapObject(data, (value, key) =>
62
+ {
63
+ if (this.hasOwnProperty(key))
64
+ {
65
+ this [ key ] = value;
66
+ }
67
+ });
68
+ }
69
+
70
+ return this;
71
+ }
72
+ }
@@ -0,0 +1,75 @@
1
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2
+ import { echo, is_object } from "../../utils/utils";
3
+
4
+ /**
5
+ * Структурная коллекция тестов
6
+ *
7
+ * @version v.1.1 (23/06/2024)
8
+ */
9
+ export class typeTestSuite extends familyGeneralElement
10
+ {
11
+ test_suite_id;
12
+ project_id;
13
+ //functional_id; // пока убрал, думаю, что можно без этого всё сделать
14
+ test_suite_name;
15
+ test_suite_description;
16
+ team_id;
17
+ created_at;
18
+ updated_at;
19
+
20
+ primary_key = 'test_suite_id';
21
+ api_key = 'test_suite';
22
+
23
+ structure_scheme = {
24
+ test_suite_id: 'integer | require',
25
+ project_id : 'integer | require',
26
+ //functional_id : 'integer | optional',
27
+ test_suite_name : 'string | protected | require',
28
+ test_suite_description: 'string | require',
29
+ team_id : 'integer | require',
30
+ created_at : 'timestamp | require',
31
+ updated_at : 'timestamp | optional',
32
+ };
33
+
34
+
35
+ /**
36
+ *
37
+ * @param {object|false|undefined} data
38
+ */
39
+ constructor(data = false)
40
+ {
41
+ super();
42
+
43
+ if (data && is_object(data))
44
+ {
45
+ _.mapObject(data, (value, key) =>
46
+ {
47
+ if (this.hasOwnProperty(key))
48
+ {
49
+ this [ key ] = value;
50
+ }
51
+ });
52
+ }
53
+
54
+ return this;
55
+ }
56
+
57
+
58
+ /******************************************************************************************/
59
+ /******************************************************************************************/
60
+
61
+ /******************************************************************************************/
62
+
63
+
64
+ /**
65
+ *
66
+ * @version v.0.1 (05/06/2025)
67
+ *
68
+ * @returns {string}
69
+ */
70
+ get_element_name()
71
+ {
72
+ return this.test_suite_name;
73
+ }
74
+
75
+ }
@@ -0,0 +1,56 @@
1
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2
+ import { is_object } from "../../utils/utils";
3
+
4
+
5
+ /**
6
+ * @version v.0.1 (23/06/2024)
7
+ */
8
+ export class typeUser extends familyGeneralElement
9
+ {
10
+ user_id;
11
+ country;
12
+ user_name;
13
+ user_password; // не доступно на фронте
14
+ user_status;
15
+ user_email;
16
+ user_phone;
17
+
18
+ primary_key = 'user_id';
19
+
20
+ structure_scheme = {
21
+ user_id : 'integer | require',
22
+ country : 'string | enum | require',
23
+ user_name : 'string | require',
24
+ user_password : 'string | protected | require',
25
+ user_status : 'string | enum| require',
26
+ user_email : 'string | email | require',
27
+ user_phone_number: 'string | phone_number | optional',
28
+ };
29
+
30
+ available_enum_values = {
31
+ user_status: [ 'PENDING', 'APPROVED', 'BANNED', 'FROZEN', 'BLOCKED' ]
32
+ };
33
+
34
+
35
+ /**
36
+ *
37
+ * @param {object|false|undefined} data
38
+ */
39
+ constructor(data = false)
40
+ {
41
+ super();
42
+
43
+ if (data && is_object(data))
44
+ {
45
+ _.mapObject(data, (value, key) =>
46
+ {
47
+ if (this.hasOwnProperty(key))
48
+ {
49
+ this [ key ] = value;
50
+ }
51
+ });
52
+ }
53
+
54
+ return this;
55
+ }
56
+ }