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,8 @@
1
+ /**
2
+ * базовый тип для всех служебных типов
3
+ * @version v.0.1 (26/05/2024)
4
+ */
5
+ export class familyService
6
+ {
7
+ //
8
+ }
@@ -0,0 +1,39 @@
1
+ import { familyService } from "./familyService";
2
+
3
+ /**
4
+ * Общее конфигурирование приложений
5
+ *
6
+ * @version v.0.1 (26/04/2025)
7
+ */
8
+ export class typeAppConfiguration extends familyService
9
+ {
10
+ /**
11
+ *
12
+ * @type {false|array<'PROTOTYPE','DEVELOPMENT','DEPRECATED','TESTING','PRODUCTION'>}
13
+ */
14
+ app_stage = false;
15
+
16
+ /**
17
+ *
18
+ * @type {false|number}
19
+ */
20
+ app_id = false;
21
+
22
+
23
+ constructor(data = false)
24
+ {
25
+ super();
26
+ if (data && typeof data === 'object')
27
+ {
28
+ _.mapObject(data, (value, key) =>
29
+ {
30
+ if (this.hasOwnProperty(key))
31
+ {
32
+ this [ key ] = value;
33
+ }
34
+ });
35
+ }
36
+
37
+ return this;
38
+ }
39
+ }
@@ -0,0 +1,36 @@
1
+ import { familyService } from "./familyService";
2
+
3
+ /**
4
+ *
5
+ * @version v.0.1 (26/01/2025)
6
+ */
7
+ export class typeFOR extends familyService
8
+ {
9
+ filters;
10
+ options;
11
+ response;
12
+
13
+ /**
14
+ *
15
+ * @version v.0.1 (26/01/2025)
16
+ * @param data
17
+ * @returns {typeFOR}
18
+ */
19
+ constructor(data = false)
20
+ {
21
+ super();
22
+
23
+ if (data && typeof data === 'object')
24
+ {
25
+ _.mapObject(data, (value, key) =>
26
+ {
27
+ if (this.hasOwnProperty(key))
28
+ {
29
+ this [ key ] = value;
30
+ }
31
+ });
32
+ }
33
+
34
+ return this;
35
+ }
36
+ }
@@ -0,0 +1,38 @@
1
+ import { familyService } from "./familyService";
2
+
3
+ /**
4
+ *
5
+ * @version v.1.0 (25/05/2025)
6
+ */
7
+ export class typeFilter extends familyService
8
+ {
9
+ object = {
10
+ attribute : false,
11
+ };
12
+ operator;
13
+ value;
14
+
15
+ /**
16
+ *
17
+ * @version v.1.0 (25/05/2025)
18
+ * @param {any} data
19
+ * @param {boolean} normalize
20
+ * @return {typeFilter}
21
+ */
22
+ constructor(data = null, normalize = false)
23
+ {
24
+ super();
25
+ if (data && typeof data === 'object')
26
+ {
27
+ _.mapObject(data, (value, key) =>
28
+ {
29
+ if (this.hasOwnProperty(key))
30
+ {
31
+ this [ key ] = value;
32
+ }
33
+ });
34
+ }
35
+
36
+ return this;
37
+ }
38
+ }
@@ -0,0 +1,40 @@
1
+ import { familyService } from "./familyService";
2
+
3
+ /**
4
+ * Описание стандартного колбека типового для методов
5
+ *
6
+ * @version v.0.1 (26/05/2024)
7
+ */
8
+ export class typeFunctionCallback extends familyService
9
+ {
10
+ before;
11
+ success;
12
+ error;
13
+ final;
14
+ destroy;
15
+
16
+
17
+ /**
18
+ *
19
+ * @version v.0.1 (26/05/2024)
20
+ * @param {object|false} data
21
+ * @return {typeFunctionCallback}
22
+ */
23
+ constructor(data = false)
24
+ {
25
+ super();
26
+
27
+ if (data && typeof data === 'object')
28
+ {
29
+ _.mapObject(data, (value, key) =>
30
+ {
31
+ if (this.hasOwnProperty(key))
32
+ {
33
+ this [ key ] = value;
34
+ }
35
+ });
36
+ }
37
+
38
+ return this;
39
+ }
40
+ }
@@ -0,0 +1,36 @@
1
+ import { familyService } from "./familyService";
2
+ import { is_object } from "../../utils/utils";
3
+
4
+ /**
5
+ * Уведомления
6
+ * Как будто это абстрактный интерфейс
7
+ * А внутри уже разные настроенные пользователем методы
8
+ *
9
+ */
10
+ export class typeNotification extends familyService
11
+ {
12
+
13
+ // пока не понятно
14
+
15
+ /**
16
+ *
17
+ * @param {object|false|undefined} data
18
+ */
19
+ constructor(data = false)
20
+ {
21
+ super();
22
+
23
+ if (data && is_object(data))
24
+ {
25
+ _.mapObject(data, (value, key) =>
26
+ {
27
+ if (this.hasOwnProperty(key))
28
+ {
29
+ this [ key ] = value;
30
+ }
31
+ });
32
+ }
33
+
34
+ return this;
35
+ }
36
+ }
@@ -0,0 +1,37 @@
1
+ import { familyService } from "./familyService";
2
+
3
+ /**
4
+ *
5
+ * @version v.0.1 (26/04/2025)
6
+ */
7
+ export class typeTableColumn extends familyService
8
+ {
9
+ header_name;
10
+ field;
11
+ width;
12
+ sort_order;
13
+ cell_classes;
14
+ default_sort;
15
+ is_sortable;
16
+ is_filter;
17
+ is_hide;
18
+ is_editable;
19
+
20
+
21
+ constructor(data = false)
22
+ {
23
+ super();
24
+ if (data && typeof data === 'object')
25
+ {
26
+ _.mapObject(data, (value, key) =>
27
+ {
28
+ if (this.hasOwnProperty(key))
29
+ {
30
+ this [ key ] = value;
31
+ }
32
+ });
33
+ }
34
+
35
+ return this;
36
+ }
37
+ }
@@ -0,0 +1,56 @@
1
+ import { typeAppConfiguration } from "./typeAppConfiguration";
2
+
3
+ /**
4
+ * Настройки таблиц (aggrid)
5
+ *
6
+ * @version v.0.1 (26/04/2025)
7
+ */
8
+ export class typeTableConfiguration extends typeAppConfiguration
9
+ {
10
+ /**
11
+ * @type {array<typeTableColumn>}
12
+ */
13
+ columns;
14
+
15
+ /**
16
+ * @type {array<typeFOR>}
17
+ */
18
+ for;
19
+
20
+
21
+ /**
22
+ * Элемент, в составе
23
+ * надо ли
24
+ */
25
+ contained_element_type;
26
+
27
+
28
+
29
+ /**
30
+ * под развитие
31
+ * @type {{link: false|string, description: false|string}}
32
+ */
33
+ documentation = {
34
+ description: false,
35
+ link : false,
36
+ };
37
+
38
+
39
+
40
+ constructor(data = false)
41
+ {
42
+ super();
43
+ if (data && typeof data === 'object')
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,190 @@
1
+ /**
2
+ *
3
+ * @param {object} object
4
+ * @returns {object}
5
+ */
6
+ export function clone_object(object)
7
+ {
8
+ // @todo use deep clone
9
+ // @todo add validation
10
+ return JSON.parse(JSON.stringify(object));
11
+ }
12
+
13
+ /**
14
+ *
15
+ * @param {string|number|array|object} text
16
+ */
17
+ export function echo(text)
18
+ {
19
+ console.log(text);
20
+ }
21
+
22
+
23
+ /**
24
+ *
25
+ * @param {string|number|array|object} data
26
+ */
27
+ export function echo_table(...data)
28
+ {
29
+ if (is_array(data))
30
+ {
31
+ data.map((row) =>
32
+ {
33
+ console.table(row);
34
+ });
35
+ }
36
+ else
37
+ {
38
+ echo(data);
39
+ }
40
+ }
41
+
42
+ /**
43
+ *
44
+ *
45
+ * @param {*} data
46
+ * @param {boolean} strict_mode
47
+ * @returns {boolean}
48
+ */
49
+ export function is_array(data, strict_mode = false)
50
+ {
51
+ if (strict_mode)
52
+ {
53
+ if (data instanceof Array)
54
+ {
55
+ return true;
56
+ }
57
+ else
58
+ {
59
+ return false;
60
+ }
61
+ }
62
+ else
63
+ {
64
+ if (data instanceof Array && data?.length > 0)
65
+ {
66
+ return true;
67
+ }
68
+ else
69
+ {
70
+ return false;
71
+ }
72
+ }
73
+ }
74
+
75
+
76
+ /**
77
+ *
78
+ *
79
+ * @param {*} value
80
+ * @returns {boolean}
81
+ */
82
+ export function is_object(value)
83
+ {
84
+ return _.isObject(value);
85
+ }
86
+
87
+
88
+ /**
89
+ *
90
+ *
91
+ * @param {*} value
92
+ * @returns {boolean}
93
+ */
94
+ export function is_string(value)
95
+ {
96
+ let response = false;
97
+ if (typeof value === 'string')
98
+ {
99
+ response = true;
100
+ }
101
+
102
+ return response;
103
+ }
104
+
105
+
106
+ /**
107
+ * Проверяем на число, не строго (!)
108
+ * @param {*} value
109
+ * @returns {boolean}
110
+ */
111
+ export function is_number(value)
112
+ {
113
+ let response = false;
114
+
115
+ if (typeof ( value ) === 'number')
116
+ {
117
+ response = true;
118
+ }
119
+ else if (value === false)
120
+ {
121
+ response = false;
122
+ }
123
+ else if (typeof ( value ) === "string" && (!isNaN( value )))
124
+ {
125
+ response = true;
126
+ }
127
+
128
+ return response
129
+ }
130
+
131
+
132
+ /**
133
+ * Возвращает количество элементов массива или false, если передан не массив
134
+ *
135
+ * @param {array} array массив
136
+ * @returns {number|false} количество элементов массива
137
+ */
138
+ export function count(array)
139
+ {
140
+ let response = false;
141
+ if (array instanceof Array)
142
+ {
143
+ response = array?.length;
144
+ }
145
+ else
146
+ {
147
+ response = false;
148
+ }
149
+
150
+ return response;
151
+ }
152
+
153
+
154
+ /**
155
+ *
156
+ * @param {string|number} value
157
+ * @param {array} array
158
+ * @param {boolean} strict
159
+ * @returns {boolean}
160
+ */
161
+ export function in_array(value, array, strict = false)
162
+ {
163
+ if (!is_array(array))
164
+ {
165
+ return false;
166
+ }
167
+ let response = false;
168
+
169
+ if (strict)
170
+ {
171
+ response = array.find(element =>
172
+ {
173
+ return element === value;
174
+ });
175
+ }
176
+ else
177
+ {
178
+ response = array.find(element =>
179
+ {
180
+ return element == value;
181
+ });
182
+ }
183
+
184
+ return Boolean(response);
185
+ }
186
+
187
+ export function cls()
188
+ {
189
+ console.clear();
190
+ }