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,95 @@
1
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2
+ import { is_object } from "../../utils/utils";
3
+
4
+
5
+ /**
6
+ * @version v.0.2 (25/01/2025)
7
+ */
8
+ export class typeFunctionalGroup extends familyGeneralElement
9
+ {
10
+ functional_group_id;
11
+ project_id; // foreign key
12
+ team_id; // foreign key
13
+ parent_id; // для организации вложенности
14
+ functional_group_name;
15
+ functional_group_description;
16
+ //functional_group_status; // enum (active + archive ??)
17
+ created_at;
18
+ updated_at;
19
+
20
+ primary_key = 'functional_group_id';
21
+
22
+ structure_scheme = {
23
+ functional_group_id : 'integer | require',
24
+ functional_group_name : 'string | max:90 | require',
25
+ functional_group_description: 'string | max:250 | optional',
26
+ project_id : 'integer | require',
27
+ team_id : 'integer | require',
28
+ parent_id : 'integer | optional',
29
+ functional_group_status : 'integer | enum | require',
30
+ created_at : 'timestamp | require',
31
+ updated_at : 'timestamp | optional',
32
+ };
33
+
34
+ available_enum_values = {
35
+ functional_group_status: [ 'не идей. нужен ли тут статус' ]
36
+ };
37
+
38
+
39
+ /**
40
+ *
41
+ * @param {object|false|undefined} data
42
+ */
43
+ constructor(data = false)
44
+ {
45
+ super();
46
+
47
+ if (data && is_object(data))
48
+ {
49
+ _.mapObject(data, (value, key) =>
50
+ {
51
+ if (this.hasOwnProperty(key))
52
+ {
53
+ this [ key ] = value;
54
+ }
55
+ });
56
+ }
57
+
58
+ return this;
59
+ }
60
+
61
+
62
+ /******************************************************************************************/
63
+ /*********************************** general **********************************************/
64
+
65
+ /******************************************************************************************/
66
+
67
+ /**
68
+ *
69
+ * @version v.0.1 (07/07/2024)
70
+ */
71
+ async create()
72
+ {}
73
+
74
+
75
+ /**
76
+ *
77
+ * @version v.0.1 (07/07/2024)
78
+ */
79
+ async update()
80
+ {
81
+
82
+ }
83
+
84
+
85
+ /**
86
+ *
87
+ * @version v.0.1 (07/07/2024)
88
+ */
89
+ async delete()
90
+ {
91
+
92
+ }
93
+
94
+
95
+ }
@@ -0,0 +1,93 @@
1
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2
+ import { is_object } from "../../utils/utils";
3
+
4
+ /**
5
+ *
6
+ * @version v.0.2 (15/06/2024)
7
+ */
8
+ export class typeMilestone extends familyGeneralElement
9
+ {
10
+ milestone_id; // primary AI
11
+ milestone_name;
12
+ milestone_description;
13
+ milestone_status; // enum
14
+ milestone_start_date;
15
+ milestone_end_date;
16
+ team_id; // foreign key
17
+ project_id; // foreign key
18
+
19
+
20
+ primary_key = 'milestone_id';
21
+
22
+ structure_scheme = {
23
+ milestone_id : 'integer | require',
24
+ milestone_name : 'string | require',
25
+ milestone_description: 'string | optional',
26
+ milestone_status : 'string | enum | require',
27
+ company_id : 'integer | require',
28
+ milestone_start_date : 'date | require',
29
+ milestone_end_date : 'date | optional',
30
+ project_id : 'integer | require',
31
+ };
32
+
33
+ available_enum_values = {
34
+ milestone_status: [ 'ACTUAL', 'COMPLETED', 'PLANNED' ]
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
+
59
+
60
+ /******************************************************************************************/
61
+ /*********************************** general **********************************************/
62
+
63
+ /******************************************************************************************/
64
+
65
+ /**
66
+ *
67
+ * @version v.0.1 (07/07/2024)
68
+ */
69
+ async create()
70
+ {}
71
+
72
+
73
+ /**
74
+ *
75
+ * @version v.0.1 (07/07/2024)
76
+ */
77
+ async update()
78
+ {
79
+
80
+ }
81
+
82
+
83
+ /**
84
+ *
85
+ * @version v.0.1 (07/07/2024)
86
+ */
87
+ async delete()
88
+ {
89
+
90
+ }
91
+
92
+
93
+ }
@@ -0,0 +1,114 @@
1
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2
+ import { echo, is_object } from "../../utils/utils";
3
+ import { MockDataTypeProject } from "./mock_data/mock_data_typeProject";
4
+
5
+
6
+ /**
7
+ *
8
+ * @version v.0.2 (15/06/2024)
9
+ */
10
+ export class typeProject extends familyGeneralElement
11
+ {
12
+ project_id; // primary
13
+ project_name;
14
+ project_description; // some comment
15
+ project_status; // enum
16
+ team_id; // foreign key + owner
17
+ reference_document_ids; // IDS документов по функционалу (к примеру confluence)
18
+ // хосты/домены будут отдельно храниться, их может быть множество
19
+
20
+ primary_key = 'project_id';
21
+ api_key = 'project';
22
+
23
+ structure_scheme = {
24
+ project_id : 'integer | require',
25
+ project_name : 'string | require',
26
+ project_description : 'string | optional',
27
+ project_status : 'string | enum | require',
28
+ company_id : 'integer | require',
29
+ reference_document_ids: 'array | reference | optional',
30
+ };
31
+
32
+ available_enum_values = {
33
+ project_status: [ 'OPEN', 'CLOSED', 'PLANNED' ]
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
+
59
+
60
+ /**
61
+ *
62
+ * @version v.0.1 (02/07/2024)
63
+ * @returns {array<typeProject>}
64
+ * @param {number} count
65
+ */
66
+ get_random_demo_data(count)
67
+ {
68
+ // @todo validations
69
+ let response = [];
70
+
71
+ for (let i = 0; i < count; i++)
72
+ {
73
+ response.push(new MockDataTypeProject());
74
+ }
75
+
76
+
77
+ return response;
78
+ }
79
+
80
+
81
+ /******************************************************************************************/
82
+ /******************************************************************************************/
83
+
84
+ /******************************************************************************************/
85
+
86
+
87
+ /**
88
+ *
89
+ * @version v.0.1 (05/06/2025)
90
+ *
91
+ * @returns {string}
92
+ */
93
+ get_element_name()
94
+ {
95
+ return this.project_name;
96
+ }
97
+
98
+
99
+ /******************************************************************************************/
100
+ /**************************** работа с участниками проекта ********************************/
101
+ /******************************************************************************************/
102
+
103
+ // member = user + role
104
+
105
+ member_add() {}
106
+
107
+ member_update() {}
108
+
109
+ member_delete() {}
110
+
111
+ member_get() {}
112
+
113
+
114
+ }
@@ -0,0 +1,80 @@
1
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2
+ import { is_object } from "../../utils/utils";
3
+
4
+ /**
5
+ * (идея) - у проекта должна быть тестовая документация
6
+ *
7
+ * @see https://vladislaveremeev.gitbook.io/qa_bible/testovaya-dokumentaciya-i-artefakty-test-deliverablestest-artifacts/vidy-testovoi-dokumentacii
8
+ *
9
+ * @version v.0.2 (07/07/2024)
10
+ */
11
+ export class typeProjectDocument extends familyGeneralElement
12
+ {
13
+ project_document_id;
14
+ project_id;
15
+ project_document_type;
16
+ // где и как храним файлы?
17
+ // nextcloud integration?
18
+
19
+
20
+
21
+ available_enum_values = {
22
+ project_document_type: [ 'QUALITY_POLICY', 'TEST_POLICY', 'PROJECT_DESCRIPTION', 'TEST_PLAN', 'DOCUMENT' ],
23
+ };
24
+
25
+
26
+ /**
27
+ *
28
+ * @param {object|false|undefined} data
29
+ */
30
+ constructor(data = false)
31
+ {
32
+ super();
33
+
34
+ if (data && is_object(data))
35
+ {
36
+ _.mapObject(data, (value, key) =>
37
+ {
38
+ if (this.hasOwnProperty(key))
39
+ {
40
+ this [ key ] = value;
41
+ }
42
+ });
43
+ }
44
+
45
+ return this;
46
+ }
47
+
48
+
49
+ /******************************************************************************************/
50
+ /*********************************** general **********************************************/
51
+
52
+ /******************************************************************************************/
53
+
54
+ /**
55
+ *
56
+ * @version v.0.1 (07/07/2024)
57
+ */
58
+ async create()
59
+ {}
60
+
61
+
62
+ /**
63
+ *
64
+ * @version v.0.1 (07/07/2024)
65
+ */
66
+ async update()
67
+ {
68
+
69
+ }
70
+
71
+
72
+ /**
73
+ *
74
+ * @version v.0.1 (07/07/2024)
75
+ */
76
+ async delete()
77
+ {
78
+
79
+ }
80
+ }
@@ -0,0 +1,59 @@
1
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2
+ import { is_object } from "../../utils/utils";
3
+
4
+ /**
5
+ * Тестовые аккаунты
6
+ *
7
+ * У каждого проекта свои коллекции
8
+ * (идея)
9
+ *
10
+ * @version v.0.1 (30/06/2024)
11
+ */
12
+ export class typeProjectTestAccount extends familyGeneralElement
13
+ {
14
+ test_account_id;
15
+ project_id;
16
+ site;
17
+ authentication_type;
18
+ login;
19
+ password; // как будем хранить?
20
+ comment;
21
+
22
+ primary_key = 'test_account_id';
23
+
24
+ structure_scheme = {
25
+ test_account_id : 'integer | require',
26
+ project_id : 'integer | require',
27
+ authentication_type: 'enum | require',
28
+ site : 'string | require',
29
+ login : 'string | require',
30
+ password : 'string | optional',
31
+ comment : 'string | optional',
32
+ };
33
+
34
+ available_enum_values = {
35
+ authentication_type: [ 'FORMS' ] // другие пока нет автоматизации не особо нужны
36
+ };
37
+
38
+ /**
39
+ *
40
+ * @param {object|false|undefined} data
41
+ */
42
+ constructor(data = false)
43
+ {
44
+ super();
45
+
46
+ if (data && is_object(data))
47
+ {
48
+ _.mapObject(data, (value, key) =>
49
+ {
50
+ if (this.hasOwnProperty(key))
51
+ {
52
+ this [ key ] = value;
53
+ }
54
+ });
55
+ }
56
+
57
+ return this;
58
+ }
59
+ }
@@ -0,0 +1,43 @@
1
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2
+ import { is_object } from "../../utils/utils";
3
+
4
+ /**
5
+ * Тестовые данные
6
+ * Какая-то коллекция, созданная для тестирования и ввода
7
+ *
8
+ * У каждого проекта свои коллекции
9
+ *
10
+ * (идея)
11
+ * @version v.0.1 (30/06/2024)
12
+ */
13
+ export class typeProjectTestData extends familyGeneralElement
14
+ {
15
+ // как храним? json или какие-то структуры? [key->value] ?
16
+ test_data_id;
17
+ project_id;
18
+
19
+
20
+ primary_key = 'test_data_id';
21
+
22
+ /**
23
+ *
24
+ * @param {object|false|undefined} data
25
+ */
26
+ constructor(data = false)
27
+ {
28
+ super();
29
+
30
+ if (data && is_object(data))
31
+ {
32
+ _.mapObject(data, (value, key) =>
33
+ {
34
+ if (this.hasOwnProperty(key))
35
+ {
36
+ this [ key ] = value;
37
+ }
38
+ });
39
+ }
40
+
41
+ return this;
42
+ }
43
+ }
@@ -0,0 +1,55 @@
1
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2
+ import { is_object } from "../../utils/utils";
3
+
4
+ /**
5
+ * Роли в проекте
6
+ * @version v.0.1 (07/07/2024)
7
+ */
8
+ export class typeProjectUserRole extends familyGeneralElement
9
+ {
10
+ // строго определенный список
11
+ // без возможности создания иных
12
+ // если роль не указана - то ADMINISTRATOR
13
+
14
+ role_slug;
15
+ role_description;
16
+ project_id;
17
+ user_id;
18
+
19
+ primary_key = 'role_slug';
20
+
21
+ structure_scheme = {
22
+ role_slug : 'string | require',
23
+ role_description: 'string | optional',
24
+ project_id : 'integer | require',
25
+ user_id : 'integer | require',
26
+ };
27
+
28
+ available_enum_values = {
29
+ role_slug: [ 'ROOT', 'ADMINISTRATOR', 'LEAD', 'QA_ENGINEER' ]
30
+ // ?? Системные администраторы, Разработчики, Тестировщики
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
+ }
@@ -0,0 +1,78 @@
1
+ import { familyGeneralElement } from "./0_familyGeneralElement";
2
+ import { is_object } from "../../utils/utils";
3
+
4
+
5
+ /**
6
+ * @version v.2.0 (07/07/2024)
7
+ */
8
+ export class typeTask extends familyGeneralElement
9
+ {
10
+ task_id;
11
+ team_id; // foreign key
12
+ task_performer_id; // foreign key // @todo переименовать с общепринятой практикой
13
+ task_initiator_id; // foreign key // @todo переименовать с общепринятой практикой
14
+ task_type; // enum => сделать тест, выполнить тест, итд (!не дублирует предмет задания - тут тип + действие)
15
+ task_status; // enum
16
+ project_id; // foreign key (денормализация) (а надо ли)
17
+ task_subject_element_type; // предмет задания
18
+ task_subject_id; // ID предмета задания (изначально его может не быть)
19
+
20
+
21
+ primary_key = 'task_id';
22
+
23
+ structure_scheme = {
24
+ task_id : 'integer | require',
25
+ team_id : 'integer | require',
26
+ task_performer_id : 'integer | require',
27
+ task_initiator_id : 'integer | require',
28
+ task_type : 'string | enum | require',
29
+ task_status : 'string | enum | require',
30
+ project_id : 'integer | require',
31
+ task_subject_element_type: 'string | enum | require',
32
+ task_subject_id : 'integer | optional',
33
+ };
34
+
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
+
56
+
57
+ /**
58
+ *
59
+ * @param {object|false|undefined} data
60
+ */
61
+ constructor(data = false)
62
+ {
63
+ super();
64
+
65
+ if (data && is_object(data))
66
+ {
67
+ _.mapObject(data, (value, key) =>
68
+ {
69
+ if (this.hasOwnProperty(key))
70
+ {
71
+ this [ key ] = value;
72
+ }
73
+ });
74
+ }
75
+
76
+ return this;
77
+ }
78
+ }