complexqa_frontend_core 1.21.2 → 1.21.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "complexqa_frontend_core",
3
- "version": "1.21.2",
3
+ "version": "1.21.3",
4
4
  "description": "core of web ",
5
5
  "type": "module",
6
6
  "exports": {
@@ -21,6 +21,7 @@ import { ContextLocaleApi } from "./context/context_locale_api.js";
21
21
  import { ContextOsApi } from "./context/context_os_api.js";
22
22
  import { ContextScreenResolutionApi } from "./context/context_screen_resolution_api.js";
23
23
  import { BrowserToolsUtilExecutionApi } from "./util/browser_tools_util_execution_api.js";
24
+ import { BrowserToolsScreenshotMultiApi } from "./util/browser_tools_screenshot_multi_api.js";
24
25
 
25
26
  /**
26
27
  * Обертка над axios
@@ -158,7 +159,8 @@ export class Api
158
159
  this.bug = new BugApi(payload);
159
160
  this.bug_relation = new BugRelationApi(payload);
160
161
  this.execution_context = new ExecutionContextApi(payload);
161
- this.browser_tools_util_execution = new BrowserToolsUtilExecutionApi(payload);
162
+ this.browser_tools_util_execution = new BrowserToolsUtilExecutionApi(payload);
163
+ this.browser_tools_screenshot_multi = new BrowserToolsScreenshotMultiApi(payload);
162
164
 
163
165
  this.reference = this.bootstrap_reference(payload)
164
166
  }
@@ -0,0 +1,52 @@
1
+ import { ApiAbstractElementClass } from "../api_abstract_element_class.js";
2
+ import { typeUtilExecutionScreenshotMulti } from "../../types/family_utils/typeUtilExecutionScreenshotMulti.js";
3
+ import { typeUtilExecution } from "../../types/family_utils/typeUtilExecution.js";
4
+
5
+
6
+ /**
7
+ * Browser Tools — screenshot.multi util execution (create / details).
8
+ *
9
+ * Base path: /web_api/util/browser_tools/util_executions/screenshot.multi
10
+ *
11
+ * @version v.2.0 (26/06/2026)
12
+ */
13
+ export class BrowserToolsScreenshotMultiApi extends ApiAbstractElementClass
14
+ {
15
+ module_prefix = 'util/browser_tools/util_executions/screenshot.multi';
16
+
17
+
18
+ constructor(options)
19
+ {
20
+ super(options);
21
+ this.set_element_class_instance(typeUtilExecutionScreenshotMulti);
22
+ }
23
+
24
+
25
+ /**
26
+ * GET details/{util_execution_id}?project_id=
27
+ *
28
+ * @param {object} payload
29
+ *
30
+ * @returns {Promise<{payload, response: ReturnType<typeof typeUtilExecution.composeDetails>|false}>}
31
+ */
32
+ async details(payload)
33
+ {
34
+ let util_execution_id = payload?.util_execution_id;
35
+
36
+ if (!util_execution_id)
37
+ {
38
+ throw new Error('util_execution_id is required for details');
39
+ }
40
+
41
+ let url = `/${ this.api_prefix }/${ this.module_prefix }/details/${ util_execution_id }`;
42
+
43
+ payload = this.handle_request_payload(payload);
44
+ let response = this.api_request(url, payload);
45
+ response = this.handle_response(response, false);
46
+
47
+ return {
48
+ response: typeUtilExecution.composeDetails(response),
49
+ payload : payload,
50
+ };
51
+ }
52
+ }
@@ -4,11 +4,11 @@ import { typeUtilExecution } from "../../types/family_utils/typeUtilExecution.js
4
4
 
5
5
 
6
6
  /**
7
- * Browser Tools — util executions (screenshot.multi).
7
+ * Browser Tools — util execution lifecycle (listing, status, delete).
8
8
  *
9
9
  * Base path: /web_api/util/browser_tools/util_executions
10
10
  *
11
- * @version v.1.0 (24/06/2026)
11
+ * @version v.2.0 (26/06/2026)
12
12
  */
13
13
  export class BrowserToolsUtilExecutionApi extends ApiAbstractElementClass
14
14
  {
@@ -49,35 +49,6 @@ export class BrowserToolsUtilExecutionApi extends ApiAbstractElementClass
49
49
  }
50
50
 
51
51
 
52
- /**
53
- * GET details/{util_execution_id}?project_id=
54
- *
55
- * @param {object} payload
56
- *
57
- * @returns {Promise<{payload, response: typeUtilExecution|false}>}
58
- */
59
- async details(payload)
60
- {
61
- let util_execution_id = payload?.util_execution_id;
62
-
63
- if (!util_execution_id)
64
- {
65
- throw new Error('util_execution_id is required for details');
66
- }
67
-
68
- let url = `/${ this.api_prefix }/${ this.module_prefix }/details/${ util_execution_id }`;
69
-
70
- payload = this.handle_request_payload(payload);
71
- let response = this.api_request(url, payload);
72
- response = this.handle_response(response, false);
73
-
74
- return {
75
- response: typeUtilExecution.hydrateDetails(response),
76
- payload : payload,
77
- };
78
- }
79
-
80
-
81
52
  /**
82
53
  * GET status/{util_execution_id}?project_id=
83
54
  *
@@ -0,0 +1,42 @@
1
+ import { typeUtilExecution } from '../../../types/family_utils/typeUtilExecution.js';
2
+ import { UserService } from '../../../services/UserService.js';
3
+ import { createColumn, createGoToColumn, createPrimaryKeyColumn, createRowSelectColumn } from '../helpers/column_factory.js';
4
+ import { createListingFor, registerSection } from '../helpers/section_registry.js';
5
+
6
+ function build_util_execution_listing_columns(locale, { include_select = true } = {})
7
+ {
8
+ const model = new typeUtilExecution();
9
+ const columns = [];
10
+
11
+ if (include_select)
12
+ {
13
+ columns.push(createRowSelectColumn());
14
+ }
15
+
16
+ columns.push(createPrimaryKeyColumn(model, locale, { is_editable: false }));
17
+ columns.push(createColumn(model, locale, 'execution_status', { width: '150', is_editable: false, is_required: true }));
18
+ columns.push(createColumn(model, locale, 'page_url', { width: '360', is_editable: false, is_required: true }));
19
+ columns.push(createColumn(model, locale, 'screenshot_count', { width: '120', is_editable: false, is_required: true }));
20
+ columns.push(createColumn(model, locale, 'user_id', { width: '180', is_editable: false, is_required: true }));
21
+ columns.push(createColumn(model, locale, 'created_at', { width: '170', is_editable: false, is_required: true }));
22
+ columns.push(createColumn(model, locale, 'completed_at', { width: '170', is_editable: false, is_required: true }));
23
+ columns.push(createGoToColumn(model, locale));
24
+
25
+ return columns;
26
+ }
27
+
28
+
29
+ /**
30
+ * Секции `util_execution`: `listing`.
31
+ *
32
+ * @param {Object<string, Object<string, { config: import('../../../types/family_service/typeTableConfiguration.js').typeTableConfiguration }>>} config
33
+ * @returns {void}
34
+ */
35
+ export function bootstrap_util_execution(config)
36
+ {
37
+ const locale = UserService.get_current_language();
38
+
39
+ registerSection(config, 'util_execution', 'listing', build_util_execution_listing_columns(locale), {
40
+ for: createListingFor([ 'project_id' ]),
41
+ });
42
+ }
@@ -7,6 +7,7 @@ import { bootstrap_test_run } from './sections/test_run.js';
7
7
  import { bootstrap_test_run_result } from './sections/test_run_result.js';
8
8
  import { bootstrap_test_account } from './sections/test_account.js';
9
9
  import { bootstrap_execution_context } from './sections/execution_context.js';
10
+ import { bootstrap_util_execution } from './sections/util_execution.js';
10
11
  import { bootstrap_team_member } from './sections/team_member.js';
11
12
  import { bootstrap_user } from './sections/user.js';
12
13
  import { bootstrap_team } from './sections/team.js';
@@ -114,6 +115,7 @@ export class TableConfiguration extends abstractAppConfiguration
114
115
  bootstrap_test_run_result(this.config);
115
116
  bootstrap_test_account(this.config);
116
117
  bootstrap_execution_context(this.config);
118
+ bootstrap_util_execution(this.config);
117
119
  bootstrap_team_member(this.config);
118
120
  bootstrap_user(this.config);
119
121
  bootstrap_team(this.config);
@@ -9,6 +9,8 @@ export const typeUtilExecution_i18n = {
9
9
  attribute_name_translate_matrix: {
10
10
  en: {
11
11
  util_execution_id : 'ID',
12
+ util_action_id : 'Action ID',
13
+ util_action_key : 'Action',
12
14
  team_id : 'Team',
13
15
  project_id : 'Project',
14
16
  user_id : 'User',
@@ -26,6 +28,8 @@ export const typeUtilExecution_i18n = {
26
28
  },
27
29
  ru: {
28
30
  util_execution_id : 'ID',
31
+ util_action_id : 'ID действия',
32
+ util_action_key : 'Действие',
29
33
  team_id : 'Команда',
30
34
  project_id : 'Проект',
31
35
  user_id : 'Пользователь',
@@ -9,15 +9,19 @@ import { typeUtilExecutionEvent } from "./typeUtilExecutionEvent.js";
9
9
 
10
10
 
11
11
  /**
12
- * Корневая сущность util execution (Browser Tools screenshot.multi и др.).
12
+ * Корневая сущность util execution (lifecycle, listing, status, delete).
13
+ *
14
+ * Create / action payload — через typeUtilExecutionScreenshotMulti.
13
15
  *
14
16
  * @see docs/Utils Layer/browser-tools-util-execution-docs.MD
15
17
  *
16
- * @version v.1.0 (24/06/2026)
18
+ * @version v.2.0 (26/06/2026)
17
19
  */
18
20
  export class typeUtilExecution extends familyUtil
19
21
  {
20
22
  util_execution_id;
23
+ util_action_id;
24
+ util_action_key;
21
25
  team_id;
22
26
  project_id;
23
27
  user_id;
@@ -30,7 +34,7 @@ export class typeUtilExecution extends familyUtil
30
34
  completed_at;
31
35
  created_at;
32
36
 
33
- /** Поля listing (денормализация) */
37
+ /** Поля listing (денормализация screenshot.multi) */
34
38
  page_url;
35
39
  screenshot_count;
36
40
 
@@ -39,18 +43,13 @@ export class typeUtilExecution extends familyUtil
39
43
  captures_succeeded;
40
44
  captures_failed;
41
45
 
42
- /** Вложенные данные GET details */
43
- screenshot_multi;
44
- captures;
45
- screenshots;
46
- capture_errors;
47
- events;
48
-
49
46
  primary_key = 'util_execution_id';
50
47
  api_key = 'browser_tools_util_execution';
51
48
 
52
49
  structure_scheme = {
53
50
  util_execution_id : 'integer | require',
51
+ util_action_id : 'integer | optional',
52
+ util_action_key : 'string | max:120 | optional',
54
53
  team_id : 'integer | optional',
55
54
  project_id : 'integer | require',
56
55
  user_id : 'integer | optional',
@@ -67,16 +66,6 @@ export class typeUtilExecution extends familyUtil
67
66
  captures_failed : 'integer | optional',
68
67
  };
69
68
 
70
- create_scheme = [
71
- 'project_id',
72
- 'page_url',
73
- 'capture_matrix_preset',
74
- 'captures',
75
- 'wait_until',
76
- 'full_page',
77
- 'navigation_timeout_milliseconds',
78
- ];
79
-
80
69
  available_enum_values = {
81
70
  execution_status: familyUtil.get_execution_status_values(),
82
71
  };
@@ -105,27 +94,7 @@ export class typeUtilExecution extends familyUtil
105
94
  {
106
95
  _.mapObject(data, (value, key) =>
107
96
  {
108
- if (key === 'screenshot_multi' && value && is_object(value))
109
- {
110
- this.screenshot_multi = new typeUtilExecutionScreenshotMulti(value);
111
- }
112
- else if (key === 'captures' && Array.isArray(value))
113
- {
114
- this.captures = value.map((row) => new typeUtilExecutionScreenshotMultiCapture(row));
115
- }
116
- else if (key === 'screenshots' && Array.isArray(value))
117
- {
118
- this.screenshots = value.map((row) => new typeUtilExecutionScreenshotMultiScreenshot(row));
119
- }
120
- else if (key === 'capture_errors' && Array.isArray(value))
121
- {
122
- this.capture_errors = value.map((row) => new typeUtilExecutionScreenshotMultiCaptureError(row));
123
- }
124
- else if (key === 'events' && Array.isArray(value))
125
- {
126
- this.events = value.map((row) => new typeUtilExecutionEvent(row));
127
- }
128
- else if (this.hasOwnProperty(key))
97
+ if (this.hasOwnProperty(key))
129
98
  {
130
99
  this [ key ] = value;
131
100
  }
@@ -137,17 +106,43 @@ export class typeUtilExecution extends familyUtil
137
106
 
138
107
 
139
108
  /**
109
+ * Compose lifecycle root + screenshot.multi payload (GET details wire).
110
+ *
140
111
  * @param {object|false|undefined} data
141
112
  *
142
- * @returns {typeUtilExecution|false}
113
+ * @returns {{
114
+ * execution: typeUtilExecution,
115
+ * screenshot_multi: typeUtilExecutionScreenshotMulti|null,
116
+ * captures: typeUtilExecutionScreenshotMultiCapture[],
117
+ * screenshots: typeUtilExecutionScreenshotMultiScreenshot[],
118
+ * capture_errors: typeUtilExecutionScreenshotMultiCaptureError[],
119
+ * events: typeUtilExecutionEvent[],
120
+ * }|false}
143
121
  */
144
- static hydrateDetails(data)
122
+ static composeDetails(data)
145
123
  {
146
124
  if (!data || !is_object(data))
147
125
  {
148
126
  return false;
149
127
  }
150
128
 
151
- return new typeUtilExecution(data);
129
+ return {
130
+ execution : new typeUtilExecution(data),
131
+ screenshot_multi: data.screenshot_multi && is_object(data.screenshot_multi)
132
+ ? new typeUtilExecutionScreenshotMulti(data.screenshot_multi)
133
+ : null,
134
+ captures : Array.isArray(data.captures)
135
+ ? data.captures.map((row) => new typeUtilExecutionScreenshotMultiCapture(row))
136
+ : [],
137
+ screenshots : Array.isArray(data.screenshots)
138
+ ? data.screenshots.map((row) => new typeUtilExecutionScreenshotMultiScreenshot(row))
139
+ : [],
140
+ capture_errors : Array.isArray(data.capture_errors)
141
+ ? data.capture_errors.map((row) => new typeUtilExecutionScreenshotMultiCaptureError(row))
142
+ : [],
143
+ events : Array.isArray(data.events)
144
+ ? data.events.map((row) => new typeUtilExecutionEvent(row))
145
+ : [],
146
+ };
152
147
  }
153
148
  }
@@ -1,15 +1,19 @@
1
1
  import { familyUtil } from "./familyUtil.js";
2
2
  import { is_object } from "../../utils/utils.js";
3
3
  import { typeUtilExecutionScreenshotMulti_i18n } from "../element_translate/typeUtilExecutionScreenshotMulti.i18n.js";
4
+ import { typeUtilExecutionScreenshotMultiCapture } from "./typeUtilExecutionScreenshotMultiCapture.js";
4
5
 
5
6
 
6
7
  /**
7
- * Параметры и результат action screenshot.multi (1:1 к util_execution).
8
+ * Action screenshot.multi — entry point для create и typed payload (1:1 к util_execution).
8
9
  *
9
- * @version v.1.0 (24/06/2026)
10
+ * @version v.2.0 (26/06/2026)
10
11
  */
11
12
  export class typeUtilExecutionScreenshotMulti extends familyUtil
12
13
  {
14
+ static UTIL_ACTION_ID = 1;
15
+ static UTIL_ACTION_KEY = 'screenshot.multi';
16
+
13
17
  util_execution_id;
14
18
  page_url;
15
19
  wait_until;
@@ -22,10 +26,14 @@ export class typeUtilExecutionScreenshotMulti extends familyUtil
22
26
  captures_failed;
23
27
  duration_milliseconds;
24
28
 
29
+ /** Input matrix rows (create custom / details) */
30
+ captures;
31
+
25
32
  primary_key = 'util_execution_id';
33
+ api_key = 'browser_tools_screenshot_multi';
26
34
 
27
35
  structure_scheme = {
28
- util_execution_id : 'integer | require',
36
+ util_execution_id : 'integer | optional',
29
37
  page_url : 'string | max:2048 | require',
30
38
  wait_until : 'string | enum | optional',
31
39
  full_page : 'integer | optional',
@@ -38,6 +46,17 @@ export class typeUtilExecutionScreenshotMulti extends familyUtil
38
46
  duration_milliseconds : 'integer | optional',
39
47
  };
40
48
 
49
+ create_scheme = [
50
+ 'util_action_id',
51
+ 'project_id',
52
+ 'page_url',
53
+ 'capture_matrix_preset',
54
+ 'captures',
55
+ 'wait_until',
56
+ 'full_page',
57
+ 'navigation_timeout_milliseconds',
58
+ ];
59
+
41
60
  available_enum_values = {
42
61
  capture_matrix_preset: [ 'default', 'custom' ],
43
62
  wait_until : [ 'load', 'domcontentloaded', 'networkidle', 'commit' ],
@@ -60,7 +79,11 @@ export class typeUtilExecutionScreenshotMulti extends familyUtil
60
79
  {
61
80
  _.mapObject(data, (value, key) =>
62
81
  {
63
- if (this.hasOwnProperty(key))
82
+ if (key === 'captures' && Array.isArray(value))
83
+ {
84
+ this.captures = value.map((row) => new typeUtilExecutionScreenshotMultiCapture(row));
85
+ }
86
+ else if (this.hasOwnProperty(key))
64
87
  {
65
88
  this [ key ] = value;
66
89
  }
@@ -69,4 +92,30 @@ export class typeUtilExecutionScreenshotMulti extends familyUtil
69
92
 
70
93
  return this;
71
94
  }
95
+
96
+
97
+ /**
98
+ * @param {object} payload
99
+ *
100
+ * @returns {object}
101
+ */
102
+ static withDefaultActionId(payload = {})
103
+ {
104
+ return {
105
+ util_action_id: typeUtilExecutionScreenshotMulti.UTIL_ACTION_ID,
106
+ ...payload,
107
+ };
108
+ }
109
+
110
+
111
+ /**
112
+ * @param {object} payload
113
+ * @param {Function|false} [callback]
114
+ *
115
+ * @returns {Promise<*>}
116
+ */
117
+ async create(payload, callback = false)
118
+ {
119
+ return super.create(typeUtilExecutionScreenshotMulti.withDefaultActionId(payload), callback);
120
+ }
72
121
  }