complexqa_frontend_core 1.21.2 → 1.21.4
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 +3 -1
- package/publish/api/util/browser_tools_screenshot_multi_api.js +55 -0
- package/publish/api/util/browser_tools_util_execution_api.js +12 -63
- package/publish/app_configuration/table/helpers/table_element_models.js +2 -0
- package/publish/app_configuration/table/sections/util_execution.js +42 -0
- package/publish/app_configuration/table/table_configuration.js +2 -0
- package/publish/types/element_translate/typeUtilExecution.i18n.js +4 -0
- package/publish/types/element_translate/typeUtilExecutionScreenshotMulti.i18n.js +22 -0
- package/publish/types/family_utils/typeUtilExecution.js +39 -44
- package/publish/types/family_utils/typeUtilExecutionScreenshotMulti.js +92 -5
package/package.json
CHANGED
package/publish/api/index.js
CHANGED
|
@@ -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
|
|
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,55 @@
|
|
|
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
|
+
const prev_method = this.method;
|
|
45
|
+
this.method = 'get';
|
|
46
|
+
let response = this.api_request(url, payload, 'GET');
|
|
47
|
+
this.method = prev_method;
|
|
48
|
+
response = await this.handle_response(response, false);
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
response: typeUtilExecution.composeDetails(response),
|
|
52
|
+
payload : payload,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { ApiAbstractElementClass } from "../api_abstract_element_class.js";
|
|
2
|
-
import { is_array } from "../../utils/utils.js";
|
|
3
2
|
import { typeUtilExecution } from "../../types/family_utils/typeUtilExecution.js";
|
|
3
|
+
import { typeUtilExecutionScreenshotMulti } from "../../types/family_utils/typeUtilExecutionScreenshotMulti.js";
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Browser Tools — util
|
|
7
|
+
* Browser Tools — util execution lifecycle (search, status, delete).
|
|
8
8
|
*
|
|
9
9
|
* Base path: /web_api/util/browser_tools/util_executions
|
|
10
10
|
*
|
|
11
|
-
*
|
|
11
|
+
* Search rows — typeUtilExecutionScreenshotMulti (inherited search()).
|
|
12
|
+
*
|
|
13
|
+
* @version v.2.1 (28/06/2026)
|
|
12
14
|
*/
|
|
13
15
|
export class BrowserToolsUtilExecutionApi extends ApiAbstractElementClass
|
|
14
16
|
{
|
|
@@ -18,63 +20,7 @@ export class BrowserToolsUtilExecutionApi extends ApiAbstractElementClass
|
|
|
18
20
|
constructor(options)
|
|
19
21
|
{
|
|
20
22
|
super(options);
|
|
21
|
-
this.set_element_class_instance(
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* GET listing?project_id=
|
|
27
|
-
*
|
|
28
|
-
* @param {object} payload
|
|
29
|
-
*
|
|
30
|
-
* @returns {Promise<{payload, response: object}>}
|
|
31
|
-
*/
|
|
32
|
-
async listing(payload)
|
|
33
|
-
{
|
|
34
|
-
let url = `/${ this.api_prefix }/${ this.module_prefix }/listing`;
|
|
35
|
-
|
|
36
|
-
payload = this.handle_request_payload(payload);
|
|
37
|
-
let response = this.api_request(url, payload);
|
|
38
|
-
response = this.handle_response(response, false);
|
|
39
|
-
|
|
40
|
-
if (response?.items && is_array(response.items))
|
|
41
|
-
{
|
|
42
|
-
response.items = response.items.map((row) => new typeUtilExecution(row));
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return {
|
|
46
|
-
response: response,
|
|
47
|
-
payload : payload,
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
|
|
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
|
-
};
|
|
23
|
+
this.set_element_class_instance(typeUtilExecutionScreenshotMulti);
|
|
78
24
|
}
|
|
79
25
|
|
|
80
26
|
|
|
@@ -96,9 +42,12 @@ export class BrowserToolsUtilExecutionApi extends ApiAbstractElementClass
|
|
|
96
42
|
|
|
97
43
|
let url = `/${ this.api_prefix }/${ this.module_prefix }/status/${ util_execution_id }`;
|
|
98
44
|
|
|
99
|
-
payload
|
|
100
|
-
|
|
101
|
-
|
|
45
|
+
payload = this.handle_request_payload(payload);
|
|
46
|
+
const prev_method = this.method;
|
|
47
|
+
this.method = 'get';
|
|
48
|
+
let response = this.api_request(url, payload, 'GET');
|
|
49
|
+
this.method = prev_method;
|
|
50
|
+
response = await this.handle_response(response, false);
|
|
102
51
|
|
|
103
52
|
return {
|
|
104
53
|
response: new typeUtilExecution(response),
|
|
@@ -10,6 +10,7 @@ import { typeTeamMember } from '../../../types/family_elements/typeTeamMember.js
|
|
|
10
10
|
import { typeTestCaseStep } from '../../../types/family_elements/typeTestCaseStep.js';
|
|
11
11
|
import { typeUser } from '../../../types/family_elements/typeUser.js';
|
|
12
12
|
import { typeTeam } from '../../../types/family_elements/typeTeam.js';
|
|
13
|
+
import { typeUtilExecutionScreenshotMulti } from '../../../types/family_utils/typeUtilExecutionScreenshotMulti.js';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Реестр классов моделей по ключу `element_type`.
|
|
@@ -35,4 +36,5 @@ export const TABLE_ELEMENT_MODELS = {
|
|
|
35
36
|
test_case_step : typeTestCaseStep,
|
|
36
37
|
user : typeUser,
|
|
37
38
|
team : typeTeam,
|
|
39
|
+
util_execution : typeUtilExecutionScreenshotMulti,
|
|
38
40
|
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { typeUtilExecutionScreenshotMulti } from '../../../types/family_utils/typeUtilExecutionScreenshotMulti.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 typeUtilExecutionScreenshotMulti();
|
|
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,6 +9,17 @@ export const typeUtilExecutionScreenshotMulti_i18n = {
|
|
|
9
9
|
attribute_name_translate_matrix: {
|
|
10
10
|
en: {
|
|
11
11
|
util_execution_id : 'Execution',
|
|
12
|
+
util_action_id : 'Action ID',
|
|
13
|
+
util_action_key : 'Action',
|
|
14
|
+
project_id : 'Project',
|
|
15
|
+
user_id : 'User',
|
|
16
|
+
execution_status : 'Status',
|
|
17
|
+
external_job_id : 'External job',
|
|
18
|
+
error_message : 'Error',
|
|
19
|
+
submitted_at : 'Submitted at',
|
|
20
|
+
completed_at : 'Completed at',
|
|
21
|
+
created_at : 'Created at',
|
|
22
|
+
screenshot_count : 'Screenshots',
|
|
12
23
|
page_url : 'Page URL',
|
|
13
24
|
wait_until : 'Wait until',
|
|
14
25
|
full_page : 'Full page',
|
|
@@ -22,6 +33,17 @@ export const typeUtilExecutionScreenshotMulti_i18n = {
|
|
|
22
33
|
},
|
|
23
34
|
ru: {
|
|
24
35
|
util_execution_id : 'Запуск',
|
|
36
|
+
util_action_id : 'ID действия',
|
|
37
|
+
util_action_key : 'Действие',
|
|
38
|
+
project_id : 'Проект',
|
|
39
|
+
user_id : 'Пользователь',
|
|
40
|
+
execution_status : 'Статус',
|
|
41
|
+
external_job_id : 'Внешняя задача',
|
|
42
|
+
error_message : 'Ошибка',
|
|
43
|
+
submitted_at : 'Отправлено',
|
|
44
|
+
completed_at : 'Завершено',
|
|
45
|
+
created_at : 'Создано',
|
|
46
|
+
screenshot_count : 'Скриншоты',
|
|
25
47
|
page_url : 'URL страницы',
|
|
26
48
|
wait_until : 'Ожидание загрузки',
|
|
27
49
|
full_page : 'Полная страница',
|
|
@@ -9,15 +9,19 @@ import { typeUtilExecutionEvent } from "./typeUtilExecutionEvent.js";
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* Корневая сущность util execution (
|
|
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.
|
|
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
|
|
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 {
|
|
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
|
|
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
|
|
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,16 +1,35 @@
|
|
|
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";
|
|
5
|
+
import { familyUtil_i18n } from "../element_translate/_familyUtil.i18n.js";
|
|
4
6
|
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
|
-
*
|
|
9
|
+
* Action screenshot.multi — entry point для create и typed payload (1:1 к util_execution).
|
|
8
10
|
*
|
|
9
|
-
*
|
|
11
|
+
* Listing row = lifecycle + action fields (flat wire для таблицы).
|
|
12
|
+
*
|
|
13
|
+
* @version v.2.1 (28/06/2026)
|
|
10
14
|
*/
|
|
11
15
|
export class typeUtilExecutionScreenshotMulti extends familyUtil
|
|
12
16
|
{
|
|
17
|
+
static UTIL_ACTION_ID = 1;
|
|
18
|
+
static UTIL_ACTION_KEY = 'screenshot.multi';
|
|
19
|
+
|
|
13
20
|
util_execution_id;
|
|
21
|
+
util_action_id;
|
|
22
|
+
util_action_key;
|
|
23
|
+
project_id;
|
|
24
|
+
user_id;
|
|
25
|
+
execution_status;
|
|
26
|
+
external_job_id;
|
|
27
|
+
error_message;
|
|
28
|
+
submitted_at;
|
|
29
|
+
completed_at;
|
|
30
|
+
created_at;
|
|
31
|
+
screenshot_count;
|
|
32
|
+
|
|
14
33
|
page_url;
|
|
15
34
|
wait_until;
|
|
16
35
|
full_page;
|
|
@@ -22,10 +41,25 @@ export class typeUtilExecutionScreenshotMulti extends familyUtil
|
|
|
22
41
|
captures_failed;
|
|
23
42
|
duration_milliseconds;
|
|
24
43
|
|
|
44
|
+
/** Input matrix rows (create custom / details) */
|
|
45
|
+
captures;
|
|
46
|
+
|
|
25
47
|
primary_key = 'util_execution_id';
|
|
48
|
+
api_key = 'browser_tools_screenshot_multi';
|
|
26
49
|
|
|
27
50
|
structure_scheme = {
|
|
28
|
-
util_execution_id : 'integer |
|
|
51
|
+
util_execution_id : 'integer | optional',
|
|
52
|
+
util_action_id : 'integer | optional',
|
|
53
|
+
util_action_key : 'string | max:120 | optional',
|
|
54
|
+
project_id : 'integer | optional',
|
|
55
|
+
user_id : 'integer | optional',
|
|
56
|
+
execution_status : 'string | enum | optional',
|
|
57
|
+
external_job_id : 'string | max:120 | optional',
|
|
58
|
+
error_message : 'string | optional',
|
|
59
|
+
submitted_at : 'timestamp | optional',
|
|
60
|
+
completed_at : 'timestamp | optional',
|
|
61
|
+
created_at : 'timestamp | optional',
|
|
62
|
+
screenshot_count : 'integer | optional',
|
|
29
63
|
page_url : 'string | max:2048 | require',
|
|
30
64
|
wait_until : 'string | enum | optional',
|
|
31
65
|
full_page : 'integer | optional',
|
|
@@ -38,16 +72,39 @@ export class typeUtilExecutionScreenshotMulti extends familyUtil
|
|
|
38
72
|
duration_milliseconds : 'integer | optional',
|
|
39
73
|
};
|
|
40
74
|
|
|
75
|
+
create_scheme = [
|
|
76
|
+
'util_action_id',
|
|
77
|
+
'project_id',
|
|
78
|
+
'page_url',
|
|
79
|
+
'capture_matrix_preset',
|
|
80
|
+
'captures',
|
|
81
|
+
'wait_until',
|
|
82
|
+
'full_page',
|
|
83
|
+
'navigation_timeout_milliseconds',
|
|
84
|
+
];
|
|
85
|
+
|
|
41
86
|
available_enum_values = {
|
|
87
|
+
execution_status : familyUtil.get_execution_status_values(),
|
|
42
88
|
capture_matrix_preset: [ 'default', 'custom' ],
|
|
43
89
|
wait_until : [ 'load', 'domcontentloaded', 'networkidle', 'commit' ],
|
|
44
90
|
last_callback_status : [ 'completed', 'failed' ],
|
|
45
91
|
};
|
|
46
92
|
|
|
47
|
-
enum_value_translate_matrix =
|
|
93
|
+
enum_value_translate_matrix = {
|
|
94
|
+
...typeUtilExecutionScreenshotMulti_i18n.enum_value_translate_matrix,
|
|
95
|
+
execution_status: familyUtil_i18n.execution_status,
|
|
96
|
+
};
|
|
48
97
|
|
|
49
98
|
attribute_name_translate_matrix = typeUtilExecutionScreenshotMulti_i18n.attribute_name_translate_matrix;
|
|
50
99
|
|
|
100
|
+
status_color = {
|
|
101
|
+
pending : '#4D92FA',
|
|
102
|
+
submit_failed: '#E66565',
|
|
103
|
+
queued : '#009688',
|
|
104
|
+
completed : '#009688',
|
|
105
|
+
failed : '#E66565',
|
|
106
|
+
};
|
|
107
|
+
|
|
51
108
|
|
|
52
109
|
/**
|
|
53
110
|
* @param {object|false|undefined} data
|
|
@@ -60,7 +117,11 @@ export class typeUtilExecutionScreenshotMulti extends familyUtil
|
|
|
60
117
|
{
|
|
61
118
|
_.mapObject(data, (value, key) =>
|
|
62
119
|
{
|
|
63
|
-
if (
|
|
120
|
+
if (key === 'captures' && Array.isArray(value))
|
|
121
|
+
{
|
|
122
|
+
this.captures = value.map((row) => new typeUtilExecutionScreenshotMultiCapture(row));
|
|
123
|
+
}
|
|
124
|
+
else if (this.hasOwnProperty(key))
|
|
64
125
|
{
|
|
65
126
|
this [ key ] = value;
|
|
66
127
|
}
|
|
@@ -69,4 +130,30 @@ export class typeUtilExecutionScreenshotMulti extends familyUtil
|
|
|
69
130
|
|
|
70
131
|
return this;
|
|
71
132
|
}
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* @param {object} payload
|
|
137
|
+
*
|
|
138
|
+
* @returns {object}
|
|
139
|
+
*/
|
|
140
|
+
static withDefaultActionId(payload = {})
|
|
141
|
+
{
|
|
142
|
+
return {
|
|
143
|
+
util_action_id: typeUtilExecutionScreenshotMulti.UTIL_ACTION_ID,
|
|
144
|
+
...payload,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* @param {object} payload
|
|
151
|
+
* @param {Function|false} [callback]
|
|
152
|
+
*
|
|
153
|
+
* @returns {Promise<*>}
|
|
154
|
+
*/
|
|
155
|
+
async create(payload, callback = false)
|
|
156
|
+
{
|
|
157
|
+
return super.create(typeUtilExecutionScreenshotMulti.withDefaultActionId(payload), callback);
|
|
158
|
+
}
|
|
72
159
|
}
|