complexqa_frontend_core 1.21.1 → 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 +1 -1
- package/publish/api/index.js +20 -16
- package/publish/api/util/browser_tools_screenshot_multi_api.js +52 -0
- package/publish/api/util/browser_tools_util_execution_api.js +79 -0
- package/publish/app_configuration/table/sections/util_execution.js +42 -0
- package/publish/app_configuration/table/table_configuration.js +2 -0
- package/publish/index.js +8 -0
- package/publish/types/element_translate/_familyUtil.i18n.js +68 -0
- package/publish/types/element_translate/typeUtilExecution.i18n.js +53 -0
- package/publish/types/element_translate/typeUtilExecutionScreenshotMulti.i18n.js +43 -0
- package/publish/types/family_utils/familyUtil.js +43 -0
- package/publish/types/family_utils/typeUtilExecution.js +148 -0
- package/publish/types/family_utils/typeUtilExecutionEvent.js +56 -0
- package/publish/types/family_utils/typeUtilExecutionScreenshotMulti.js +121 -0
- package/publish/types/family_utils/typeUtilExecutionScreenshotMultiCapture.js +57 -0
- package/publish/types/family_utils/typeUtilExecutionScreenshotMultiCaptureError.js +49 -0
- package/publish/types/family_utils/typeUtilExecutionScreenshotMultiScreenshot.js +57 -0
package/package.json
CHANGED
package/publish/api/index.js
CHANGED
|
@@ -20,6 +20,8 @@ import { ExecutionContextApi } from "./context/context_execution_general_api.js"
|
|
|
20
20
|
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
|
+
import { BrowserToolsUtilExecutionApi } from "./util/browser_tools_util_execution_api.js";
|
|
24
|
+
import { BrowserToolsScreenshotMultiApi } from "./util/browser_tools_screenshot_multi_api.js";
|
|
23
25
|
|
|
24
26
|
/**
|
|
25
27
|
* Обертка над axios
|
|
@@ -141,22 +143,24 @@ export class Api
|
|
|
141
143
|
|
|
142
144
|
//echo({payload});
|
|
143
145
|
|
|
144
|
-
this.team_management
|
|
145
|
-
this.team_member
|
|
146
|
-
this.test_plan
|
|
147
|
-
this.project
|
|
148
|
-
this.service
|
|
149
|
-
this.test_case
|
|
150
|
-
this.test_case_step
|
|
151
|
-
this.test_suite
|
|
152
|
-
this.test_run
|
|
153
|
-
this.test_run_result
|
|
154
|
-
this.user_profile
|
|
155
|
-
this.task
|
|
156
|
-
this.test_account
|
|
157
|
-
this.bug
|
|
158
|
-
this.bug_relation
|
|
159
|
-
this.execution_context
|
|
146
|
+
this.team_management = new TeamManagementApi(payload);
|
|
147
|
+
this.team_member = new TeamMemberApi(payload);
|
|
148
|
+
this.test_plan = new TestPlanApi(payload);
|
|
149
|
+
this.project = new ProjectApi(payload);
|
|
150
|
+
this.service = new ServiceApi(payload);
|
|
151
|
+
this.test_case = new TestCaseApi(payload);
|
|
152
|
+
this.test_case_step = new TestCaseStepApi(payload);
|
|
153
|
+
this.test_suite = new TestSuiteApi(payload);
|
|
154
|
+
this.test_run = new TestRunApi(payload);
|
|
155
|
+
this.test_run_result = new TestRunResultApi(payload);
|
|
156
|
+
this.user_profile = new UserProfileApi(payload);
|
|
157
|
+
this.task = new TaskApi(payload);
|
|
158
|
+
this.test_account = new TestAccountApi(payload);
|
|
159
|
+
this.bug = new BugApi(payload);
|
|
160
|
+
this.bug_relation = new BugRelationApi(payload);
|
|
161
|
+
this.execution_context = new ExecutionContextApi(payload);
|
|
162
|
+
this.browser_tools_util_execution = new BrowserToolsUtilExecutionApi(payload);
|
|
163
|
+
this.browser_tools_screenshot_multi = new BrowserToolsScreenshotMultiApi(payload);
|
|
160
164
|
|
|
161
165
|
this.reference = this.bootstrap_reference(payload)
|
|
162
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
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ApiAbstractElementClass } from "../api_abstract_element_class.js";
|
|
2
|
+
import { is_array } from "../../utils/utils.js";
|
|
3
|
+
import { typeUtilExecution } from "../../types/family_utils/typeUtilExecution.js";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Browser Tools — util execution lifecycle (listing, status, delete).
|
|
8
|
+
*
|
|
9
|
+
* Base path: /web_api/util/browser_tools/util_executions
|
|
10
|
+
*
|
|
11
|
+
* @version v.2.0 (26/06/2026)
|
|
12
|
+
*/
|
|
13
|
+
export class BrowserToolsUtilExecutionApi extends ApiAbstractElementClass
|
|
14
|
+
{
|
|
15
|
+
module_prefix = 'util/browser_tools/util_executions';
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
constructor(options)
|
|
19
|
+
{
|
|
20
|
+
super(options);
|
|
21
|
+
this.set_element_class_instance(typeUtilExecution);
|
|
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 status/{util_execution_id}?project_id=
|
|
54
|
+
*
|
|
55
|
+
* @param {object} payload
|
|
56
|
+
*
|
|
57
|
+
* @returns {Promise<{payload, response: typeUtilExecution}>}
|
|
58
|
+
*/
|
|
59
|
+
async status(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 status');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
let url = `/${ this.api_prefix }/${ this.module_prefix }/status/${ 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: new typeUtilExecution(response),
|
|
76
|
+
payload : payload,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -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);
|
package/publish/index.js
CHANGED
|
@@ -28,6 +28,14 @@ export { typeLocaleContext } from './types/family_context/typeLocaleContext.js';
|
|
|
28
28
|
export { typeDeploymentTargetContext } from './types/family_context/typeDeploymentTargetContext.js';
|
|
29
29
|
export { typeExecutionContext } from './types/family_context/typeExecutionContext.js';
|
|
30
30
|
|
|
31
|
+
export { familyUtil } from './types/family_utils/familyUtil.js';
|
|
32
|
+
export { typeUtilExecution } from './types/family_utils/typeUtilExecution.js';
|
|
33
|
+
export { typeUtilExecutionScreenshotMulti } from './types/family_utils/typeUtilExecutionScreenshotMulti.js';
|
|
34
|
+
export { typeUtilExecutionScreenshotMultiCapture } from './types/family_utils/typeUtilExecutionScreenshotMultiCapture.js';
|
|
35
|
+
export { typeUtilExecutionScreenshotMultiScreenshot } from './types/family_utils/typeUtilExecutionScreenshotMultiScreenshot.js';
|
|
36
|
+
export { typeUtilExecutionScreenshotMultiCaptureError } from './types/family_utils/typeUtilExecutionScreenshotMultiCaptureError.js';
|
|
37
|
+
export { typeUtilExecutionEvent } from './types/family_utils/typeUtilExecutionEvent.js';
|
|
38
|
+
|
|
31
39
|
export { typeUser } from './types/family_elements/typeUser.js';
|
|
32
40
|
export { typeTeam } from './types/family_elements/typeTeam.js';
|
|
33
41
|
export { typeTeamMember } from './types/family_elements/typeTeamMember.js';
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Общие переводы для family_utils.
|
|
3
|
+
*/
|
|
4
|
+
export const familyUtil_i18n = {
|
|
5
|
+
execution_status: {
|
|
6
|
+
en: {
|
|
7
|
+
pending : 'Pending',
|
|
8
|
+
submit_failed: 'Submit failed',
|
|
9
|
+
queued : 'Queued',
|
|
10
|
+
completed : 'Completed',
|
|
11
|
+
failed : 'Failed',
|
|
12
|
+
},
|
|
13
|
+
ru: {
|
|
14
|
+
pending : 'Ожидание',
|
|
15
|
+
submit_failed: 'Ошибка отправки',
|
|
16
|
+
queued : 'В очереди',
|
|
17
|
+
completed : 'Завершено',
|
|
18
|
+
failed : 'Ошибка',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
event_type: {
|
|
23
|
+
en: {
|
|
24
|
+
pending : 'Pending',
|
|
25
|
+
submit_failed : 'Submit failed',
|
|
26
|
+
queued : 'Queued',
|
|
27
|
+
completed : 'Completed',
|
|
28
|
+
failed : 'Failed',
|
|
29
|
+
callback_received: 'Callback received',
|
|
30
|
+
deleted : 'Deleted',
|
|
31
|
+
},
|
|
32
|
+
ru: {
|
|
33
|
+
pending : 'Ожидание',
|
|
34
|
+
submit_failed : 'Ошибка отправки',
|
|
35
|
+
queued : 'В очереди',
|
|
36
|
+
completed : 'Завершено',
|
|
37
|
+
failed : 'Ошибка',
|
|
38
|
+
callback_received: 'Получен callback',
|
|
39
|
+
deleted : 'Удалено',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
capture_matrix_preset: {
|
|
44
|
+
en: {
|
|
45
|
+
default: 'Default matrix',
|
|
46
|
+
custom : 'Custom matrix',
|
|
47
|
+
},
|
|
48
|
+
ru: {
|
|
49
|
+
default: 'Матрица по умолчанию',
|
|
50
|
+
custom : 'Своя матрица',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
wait_until: {
|
|
55
|
+
en: {
|
|
56
|
+
load : 'Load',
|
|
57
|
+
domcontentloaded: 'DOM content loaded',
|
|
58
|
+
networkidle : 'Network idle',
|
|
59
|
+
commit : 'Commit',
|
|
60
|
+
},
|
|
61
|
+
ru: {
|
|
62
|
+
load : 'Load',
|
|
63
|
+
domcontentloaded: 'DOM content loaded',
|
|
64
|
+
networkidle : 'Network idle',
|
|
65
|
+
commit : 'Commit',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { familyUtil_i18n } from './_familyUtil.i18n.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Переводы для typeUtilExecution.
|
|
5
|
+
*
|
|
6
|
+
* @see typeUtilExecution
|
|
7
|
+
*/
|
|
8
|
+
export const typeUtilExecution_i18n = {
|
|
9
|
+
attribute_name_translate_matrix: {
|
|
10
|
+
en: {
|
|
11
|
+
util_execution_id : 'ID',
|
|
12
|
+
util_action_id : 'Action ID',
|
|
13
|
+
util_action_key : 'Action',
|
|
14
|
+
team_id : 'Team',
|
|
15
|
+
project_id : 'Project',
|
|
16
|
+
user_id : 'User',
|
|
17
|
+
execution_status : 'Status',
|
|
18
|
+
external_job_id : 'External job',
|
|
19
|
+
error_message : 'Error',
|
|
20
|
+
submitted_at : 'Submitted at',
|
|
21
|
+
completed_at : 'Completed at',
|
|
22
|
+
created_at : 'Created at',
|
|
23
|
+
page_url : 'Page URL',
|
|
24
|
+
screenshot_count : 'Screenshots',
|
|
25
|
+
captures_total : 'Captures total',
|
|
26
|
+
captures_succeeded: 'Captures succeeded',
|
|
27
|
+
captures_failed : 'Captures failed',
|
|
28
|
+
},
|
|
29
|
+
ru: {
|
|
30
|
+
util_execution_id : 'ID',
|
|
31
|
+
util_action_id : 'ID действия',
|
|
32
|
+
util_action_key : 'Действие',
|
|
33
|
+
team_id : 'Команда',
|
|
34
|
+
project_id : 'Проект',
|
|
35
|
+
user_id : 'Пользователь',
|
|
36
|
+
execution_status : 'Статус',
|
|
37
|
+
external_job_id : 'Внешняя задача',
|
|
38
|
+
error_message : 'Ошибка',
|
|
39
|
+
submitted_at : 'Отправлено',
|
|
40
|
+
completed_at : 'Завершено',
|
|
41
|
+
created_at : 'Создано',
|
|
42
|
+
page_url : 'URL страницы',
|
|
43
|
+
screenshot_count : 'Скриншоты',
|
|
44
|
+
captures_total : 'Всего захватов',
|
|
45
|
+
captures_succeeded: 'Успешных захватов',
|
|
46
|
+
captures_failed : 'Ошибок захвата',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
enum_value_translate_matrix: {
|
|
51
|
+
execution_status: familyUtil_i18n.execution_status,
|
|
52
|
+
},
|
|
53
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { familyUtil_i18n } from './_familyUtil.i18n.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Переводы для typeUtilExecutionScreenshotMulti.
|
|
5
|
+
*
|
|
6
|
+
* @see typeUtilExecutionScreenshotMulti
|
|
7
|
+
*/
|
|
8
|
+
export const typeUtilExecutionScreenshotMulti_i18n = {
|
|
9
|
+
attribute_name_translate_matrix: {
|
|
10
|
+
en: {
|
|
11
|
+
util_execution_id : 'Execution',
|
|
12
|
+
page_url : 'Page URL',
|
|
13
|
+
wait_until : 'Wait until',
|
|
14
|
+
full_page : 'Full page',
|
|
15
|
+
navigation_timeout_milliseconds: 'Navigation timeout (ms)',
|
|
16
|
+
capture_matrix_preset : 'Capture matrix',
|
|
17
|
+
last_callback_status : 'Last callback status',
|
|
18
|
+
captures_total : 'Captures total',
|
|
19
|
+
captures_succeeded : 'Captures succeeded',
|
|
20
|
+
captures_failed : 'Captures failed',
|
|
21
|
+
duration_milliseconds : 'Duration (ms)',
|
|
22
|
+
},
|
|
23
|
+
ru: {
|
|
24
|
+
util_execution_id : 'Запуск',
|
|
25
|
+
page_url : 'URL страницы',
|
|
26
|
+
wait_until : 'Ожидание загрузки',
|
|
27
|
+
full_page : 'Полная страница',
|
|
28
|
+
navigation_timeout_milliseconds: 'Таймаут навигации (мс)',
|
|
29
|
+
capture_matrix_preset : 'Матрица захвата',
|
|
30
|
+
last_callback_status : 'Статус callback',
|
|
31
|
+
captures_total : 'Всего захватов',
|
|
32
|
+
captures_succeeded : 'Успешных захватов',
|
|
33
|
+
captures_failed : 'Ошибок захвата',
|
|
34
|
+
duration_milliseconds : 'Длительность (мс)',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
enum_value_translate_matrix: {
|
|
39
|
+
capture_matrix_preset: familyUtil_i18n.capture_matrix_preset,
|
|
40
|
+
wait_until : familyUtil_i18n.wait_until,
|
|
41
|
+
last_callback_status : familyUtil_i18n.execution_status,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { familyGeneralElement } from "../core/0_familyGeneralElement.js";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Базовый класс для Util Service layer (typed executions).
|
|
6
|
+
*
|
|
7
|
+
* @see docs/Utils Layer/browser-tools-util-execution-docs.MD
|
|
8
|
+
*
|
|
9
|
+
* @version v.1.0 (24/06/2026)
|
|
10
|
+
*/
|
|
11
|
+
export class familyUtil extends familyGeneralElement
|
|
12
|
+
{
|
|
13
|
+
/**
|
|
14
|
+
* @returns {string[]}
|
|
15
|
+
*/
|
|
16
|
+
static get_execution_status_values()
|
|
17
|
+
{
|
|
18
|
+
return [
|
|
19
|
+
'pending',
|
|
20
|
+
'submit_failed',
|
|
21
|
+
'queued',
|
|
22
|
+
'completed',
|
|
23
|
+
'failed',
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @returns {string[]}
|
|
30
|
+
*/
|
|
31
|
+
static get_event_type_values()
|
|
32
|
+
{
|
|
33
|
+
return [
|
|
34
|
+
'pending',
|
|
35
|
+
'submit_failed',
|
|
36
|
+
'queued',
|
|
37
|
+
'completed',
|
|
38
|
+
'failed',
|
|
39
|
+
'callback_received',
|
|
40
|
+
'deleted',
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { familyUtil } from "./familyUtil.js";
|
|
2
|
+
import { is_object } from "../../utils/utils.js";
|
|
3
|
+
import { typeUtilExecution_i18n } from "../element_translate/typeUtilExecution.i18n.js";
|
|
4
|
+
import { typeUtilExecutionScreenshotMulti } from "./typeUtilExecutionScreenshotMulti.js";
|
|
5
|
+
import { typeUtilExecutionScreenshotMultiCapture } from "./typeUtilExecutionScreenshotMultiCapture.js";
|
|
6
|
+
import { typeUtilExecutionScreenshotMultiScreenshot } from "./typeUtilExecutionScreenshotMultiScreenshot.js";
|
|
7
|
+
import { typeUtilExecutionScreenshotMultiCaptureError } from "./typeUtilExecutionScreenshotMultiCaptureError.js";
|
|
8
|
+
import { typeUtilExecutionEvent } from "./typeUtilExecutionEvent.js";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Корневая сущность util execution (lifecycle, listing, status, delete).
|
|
13
|
+
*
|
|
14
|
+
* Create / action payload — через typeUtilExecutionScreenshotMulti.
|
|
15
|
+
*
|
|
16
|
+
* @see docs/Utils Layer/browser-tools-util-execution-docs.MD
|
|
17
|
+
*
|
|
18
|
+
* @version v.2.0 (26/06/2026)
|
|
19
|
+
*/
|
|
20
|
+
export class typeUtilExecution extends familyUtil
|
|
21
|
+
{
|
|
22
|
+
util_execution_id;
|
|
23
|
+
util_action_id;
|
|
24
|
+
util_action_key;
|
|
25
|
+
team_id;
|
|
26
|
+
project_id;
|
|
27
|
+
user_id;
|
|
28
|
+
|
|
29
|
+
execution_status;
|
|
30
|
+
external_job_id;
|
|
31
|
+
error_message;
|
|
32
|
+
|
|
33
|
+
submitted_at;
|
|
34
|
+
completed_at;
|
|
35
|
+
created_at;
|
|
36
|
+
|
|
37
|
+
/** Поля listing (денормализация screenshot.multi) */
|
|
38
|
+
page_url;
|
|
39
|
+
screenshot_count;
|
|
40
|
+
|
|
41
|
+
/** Поля status (счётчики из screenshot_multi) */
|
|
42
|
+
captures_total;
|
|
43
|
+
captures_succeeded;
|
|
44
|
+
captures_failed;
|
|
45
|
+
|
|
46
|
+
primary_key = 'util_execution_id';
|
|
47
|
+
api_key = 'browser_tools_util_execution';
|
|
48
|
+
|
|
49
|
+
structure_scheme = {
|
|
50
|
+
util_execution_id : 'integer | require',
|
|
51
|
+
util_action_id : 'integer | optional',
|
|
52
|
+
util_action_key : 'string | max:120 | optional',
|
|
53
|
+
team_id : 'integer | optional',
|
|
54
|
+
project_id : 'integer | require',
|
|
55
|
+
user_id : 'integer | optional',
|
|
56
|
+
execution_status : 'string | enum | require',
|
|
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
|
+
page_url : 'string | max:2048 | optional',
|
|
63
|
+
screenshot_count : 'integer | optional',
|
|
64
|
+
captures_total : 'integer | optional',
|
|
65
|
+
captures_succeeded: 'integer | optional',
|
|
66
|
+
captures_failed : 'integer | optional',
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
available_enum_values = {
|
|
70
|
+
execution_status: familyUtil.get_execution_status_values(),
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
enum_value_translate_matrix = typeUtilExecution_i18n.enum_value_translate_matrix;
|
|
74
|
+
|
|
75
|
+
attribute_name_translate_matrix = typeUtilExecution_i18n.attribute_name_translate_matrix;
|
|
76
|
+
|
|
77
|
+
status_color = {
|
|
78
|
+
pending : '#4D92FA',
|
|
79
|
+
submit_failed: '#E66565',
|
|
80
|
+
queued : '#009688',
|
|
81
|
+
completed : '#009688',
|
|
82
|
+
failed : '#E66565',
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @param {object|false|undefined} data
|
|
88
|
+
*/
|
|
89
|
+
constructor(data = false)
|
|
90
|
+
{
|
|
91
|
+
super();
|
|
92
|
+
|
|
93
|
+
if (data && is_object(data))
|
|
94
|
+
{
|
|
95
|
+
_.mapObject(data, (value, key) =>
|
|
96
|
+
{
|
|
97
|
+
if (this.hasOwnProperty(key))
|
|
98
|
+
{
|
|
99
|
+
this [ key ] = value;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return this;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Compose lifecycle root + screenshot.multi payload (GET details wire).
|
|
110
|
+
*
|
|
111
|
+
* @param {object|false|undefined} data
|
|
112
|
+
*
|
|
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}
|
|
121
|
+
*/
|
|
122
|
+
static composeDetails(data)
|
|
123
|
+
{
|
|
124
|
+
if (!data || !is_object(data))
|
|
125
|
+
{
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
|
|
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
|
+
};
|
|
147
|
+
}
|
|
148
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { familyUtil } from "./familyUtil.js";
|
|
2
|
+
import { is_object } from "../../utils/utils.js";
|
|
3
|
+
import { familyUtil_i18n } from "../element_translate/_familyUtil.i18n.js";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Событие аудита util execution.
|
|
8
|
+
*
|
|
9
|
+
* @version v.1.0 (24/06/2026)
|
|
10
|
+
*/
|
|
11
|
+
export class typeUtilExecutionEvent extends familyUtil
|
|
12
|
+
{
|
|
13
|
+
util_execution_event_id;
|
|
14
|
+
util_execution_id;
|
|
15
|
+
event_type;
|
|
16
|
+
created_at;
|
|
17
|
+
|
|
18
|
+
primary_key = 'util_execution_event_id';
|
|
19
|
+
|
|
20
|
+
structure_scheme = {
|
|
21
|
+
util_execution_event_id: 'integer | optional',
|
|
22
|
+
util_execution_id : 'integer | optional',
|
|
23
|
+
event_type : 'string | enum | require',
|
|
24
|
+
created_at : 'timestamp | optional',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
available_enum_values = {
|
|
28
|
+
event_type: familyUtil.get_event_type_values(),
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
enum_value_translate_matrix = {
|
|
32
|
+
event_type: familyUtil_i18n.event_type,
|
|
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,121 @@
|
|
|
1
|
+
import { familyUtil } from "./familyUtil.js";
|
|
2
|
+
import { is_object } from "../../utils/utils.js";
|
|
3
|
+
import { typeUtilExecutionScreenshotMulti_i18n } from "../element_translate/typeUtilExecutionScreenshotMulti.i18n.js";
|
|
4
|
+
import { typeUtilExecutionScreenshotMultiCapture } from "./typeUtilExecutionScreenshotMultiCapture.js";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Action screenshot.multi — entry point для create и typed payload (1:1 к util_execution).
|
|
9
|
+
*
|
|
10
|
+
* @version v.2.0 (26/06/2026)
|
|
11
|
+
*/
|
|
12
|
+
export class typeUtilExecutionScreenshotMulti extends familyUtil
|
|
13
|
+
{
|
|
14
|
+
static UTIL_ACTION_ID = 1;
|
|
15
|
+
static UTIL_ACTION_KEY = 'screenshot.multi';
|
|
16
|
+
|
|
17
|
+
util_execution_id;
|
|
18
|
+
page_url;
|
|
19
|
+
wait_until;
|
|
20
|
+
full_page;
|
|
21
|
+
navigation_timeout_milliseconds;
|
|
22
|
+
capture_matrix_preset;
|
|
23
|
+
last_callback_status;
|
|
24
|
+
captures_total;
|
|
25
|
+
captures_succeeded;
|
|
26
|
+
captures_failed;
|
|
27
|
+
duration_milliseconds;
|
|
28
|
+
|
|
29
|
+
/** Input matrix rows (create custom / details) */
|
|
30
|
+
captures;
|
|
31
|
+
|
|
32
|
+
primary_key = 'util_execution_id';
|
|
33
|
+
api_key = 'browser_tools_screenshot_multi';
|
|
34
|
+
|
|
35
|
+
structure_scheme = {
|
|
36
|
+
util_execution_id : 'integer | optional',
|
|
37
|
+
page_url : 'string | max:2048 | require',
|
|
38
|
+
wait_until : 'string | enum | optional',
|
|
39
|
+
full_page : 'integer | optional',
|
|
40
|
+
navigation_timeout_milliseconds: 'integer | optional',
|
|
41
|
+
capture_matrix_preset : 'string | enum | require',
|
|
42
|
+
last_callback_status : 'string | enum | optional',
|
|
43
|
+
captures_total : 'integer | optional',
|
|
44
|
+
captures_succeeded : 'integer | optional',
|
|
45
|
+
captures_failed : 'integer | optional',
|
|
46
|
+
duration_milliseconds : 'integer | optional',
|
|
47
|
+
};
|
|
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
|
+
|
|
60
|
+
available_enum_values = {
|
|
61
|
+
capture_matrix_preset: [ 'default', 'custom' ],
|
|
62
|
+
wait_until : [ 'load', 'domcontentloaded', 'networkidle', 'commit' ],
|
|
63
|
+
last_callback_status : [ 'completed', 'failed' ],
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
enum_value_translate_matrix = typeUtilExecutionScreenshotMulti_i18n.enum_value_translate_matrix;
|
|
67
|
+
|
|
68
|
+
attribute_name_translate_matrix = typeUtilExecutionScreenshotMulti_i18n.attribute_name_translate_matrix;
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @param {object|false|undefined} data
|
|
73
|
+
*/
|
|
74
|
+
constructor(data = false)
|
|
75
|
+
{
|
|
76
|
+
super();
|
|
77
|
+
|
|
78
|
+
if (data && is_object(data))
|
|
79
|
+
{
|
|
80
|
+
_.mapObject(data, (value, key) =>
|
|
81
|
+
{
|
|
82
|
+
if (key === 'captures' && Array.isArray(value))
|
|
83
|
+
{
|
|
84
|
+
this.captures = value.map((row) => new typeUtilExecutionScreenshotMultiCapture(row));
|
|
85
|
+
}
|
|
86
|
+
else if (this.hasOwnProperty(key))
|
|
87
|
+
{
|
|
88
|
+
this [ key ] = value;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return this;
|
|
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
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { familyUtil } from "./familyUtil.js";
|
|
2
|
+
import { is_object } from "../../utils/utils.js";
|
|
3
|
+
import { register_type_class } from "../core/type_class_resolver.js";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Строка пользовательской матрицы захвата (browser + resolution).
|
|
8
|
+
*
|
|
9
|
+
* @version v.1.0 (24/06/2026)
|
|
10
|
+
*/
|
|
11
|
+
export class typeUtilExecutionScreenshotMultiCapture extends familyUtil
|
|
12
|
+
{
|
|
13
|
+
util_execution_screenshot_multi_capture_id;
|
|
14
|
+
util_execution_id;
|
|
15
|
+
sort_order;
|
|
16
|
+
browser_context_id;
|
|
17
|
+
screen_resolution_context_id;
|
|
18
|
+
|
|
19
|
+
primary_key = 'util_execution_screenshot_multi_capture_id';
|
|
20
|
+
|
|
21
|
+
structure_scheme = {
|
|
22
|
+
util_execution_screenshot_multi_capture_id: 'integer | optional',
|
|
23
|
+
util_execution_id : 'integer | optional',
|
|
24
|
+
sort_order : 'integer | optional',
|
|
25
|
+
browser_context_id : 'integer | typeBrowserContext | require',
|
|
26
|
+
screen_resolution_context_id : 'integer | typeScreenResolutionContext | require',
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
create_scheme = [
|
|
30
|
+
'browser_context_id',
|
|
31
|
+
'screen_resolution_context_id',
|
|
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
|
+
}
|
|
56
|
+
|
|
57
|
+
register_type_class('typeUtilExecutionScreenshotMultiCapture', typeUtilExecutionScreenshotMultiCapture);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { familyUtil } from "./familyUtil.js";
|
|
2
|
+
import { is_object } from "../../utils/utils.js";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Частичная ошибка захвата screenshot.multi.
|
|
7
|
+
*
|
|
8
|
+
* @version v.1.0 (24/06/2026)
|
|
9
|
+
*/
|
|
10
|
+
export class typeUtilExecutionScreenshotMultiCaptureError extends familyUtil
|
|
11
|
+
{
|
|
12
|
+
util_execution_screenshot_multi_capture_error_id;
|
|
13
|
+
util_execution_id;
|
|
14
|
+
capture_identifier;
|
|
15
|
+
error_message;
|
|
16
|
+
sort_order;
|
|
17
|
+
|
|
18
|
+
primary_key = 'util_execution_screenshot_multi_capture_error_id';
|
|
19
|
+
|
|
20
|
+
structure_scheme = {
|
|
21
|
+
util_execution_screenshot_multi_capture_error_id: 'integer | optional',
|
|
22
|
+
util_execution_id : 'integer | optional',
|
|
23
|
+
capture_identifier : 'string | max:255 | optional',
|
|
24
|
+
error_message : 'string | require',
|
|
25
|
+
sort_order : 'integer | optional',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @param {object|false|undefined} data
|
|
31
|
+
*/
|
|
32
|
+
constructor(data = false)
|
|
33
|
+
{
|
|
34
|
+
super();
|
|
35
|
+
|
|
36
|
+
if (data && is_object(data))
|
|
37
|
+
{
|
|
38
|
+
_.mapObject(data, (value, key) =>
|
|
39
|
+
{
|
|
40
|
+
if (this.hasOwnProperty(key))
|
|
41
|
+
{
|
|
42
|
+
this [ key ] = value;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { familyUtil } from "./familyUtil.js";
|
|
2
|
+
import { is_object } from "../../utils/utils.js";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Результирующий скриншот screenshot.multi.
|
|
7
|
+
*
|
|
8
|
+
* @version v.1.0 (24/06/2026)
|
|
9
|
+
*/
|
|
10
|
+
export class typeUtilExecutionScreenshotMultiScreenshot extends familyUtil
|
|
11
|
+
{
|
|
12
|
+
util_execution_screenshot_multi_screenshot_id;
|
|
13
|
+
util_execution_id;
|
|
14
|
+
capture_identifier;
|
|
15
|
+
file_uuid;
|
|
16
|
+
image_url;
|
|
17
|
+
width;
|
|
18
|
+
height;
|
|
19
|
+
duration_milliseconds;
|
|
20
|
+
sort_order;
|
|
21
|
+
|
|
22
|
+
primary_key = 'util_execution_screenshot_multi_screenshot_id';
|
|
23
|
+
|
|
24
|
+
structure_scheme = {
|
|
25
|
+
util_execution_screenshot_multi_screenshot_id: 'integer | optional',
|
|
26
|
+
util_execution_id : 'integer | optional',
|
|
27
|
+
capture_identifier : 'string | max:255 | require',
|
|
28
|
+
file_uuid : 'string | max:64 | optional',
|
|
29
|
+
image_url : 'string | max:2048 | optional',
|
|
30
|
+
width : 'integer | optional',
|
|
31
|
+
height : 'integer | optional',
|
|
32
|
+
duration_milliseconds : 'integer | optional',
|
|
33
|
+
sort_order : 'integer | optional',
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @param {object|false|undefined} data
|
|
39
|
+
*/
|
|
40
|
+
constructor(data = false)
|
|
41
|
+
{
|
|
42
|
+
super();
|
|
43
|
+
|
|
44
|
+
if (data && is_object(data))
|
|
45
|
+
{
|
|
46
|
+
_.mapObject(data, (value, key) =>
|
|
47
|
+
{
|
|
48
|
+
if (this.hasOwnProperty(key))
|
|
49
|
+
{
|
|
50
|
+
this [ key ] = value;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return this;
|
|
56
|
+
}
|
|
57
|
+
}
|