complexqa_frontend_core 1.25.1 → 1.26.1

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.
@@ -0,0 +1,172 @@
1
+ import { familyGeneralElement } from "../core/0_familyGeneralElement.js";
2
+ import { echo, is_object } from "../../utils/utils.js";
3
+ import { typeTeamDomain_i18n } from "../element_translate/typeTeamDomain.i18n.js";
4
+
5
+
6
+ /**
7
+ * Team-owned domain (cqa_team.team_domains). Shared across projects of the team.
8
+ * Verify/revoke via ApiService.team_domain; url.inspect requires VERIFIED.
9
+ * Backend: test_site/docs/team/team-domains.md
10
+ *
11
+ * @version v.0.1 (14/08/2026)
12
+ */
13
+ export class typeTeamDomain extends familyGeneralElement
14
+ {
15
+ team_domain_id;
16
+ team_id;
17
+ domain_canon;
18
+ display_name;
19
+ verification_method;
20
+ domain_status;
21
+ verification_token;
22
+ last_error_message;
23
+ verified_at;
24
+ created_at;
25
+ updated_at;
26
+ file_url_https;
27
+ file_url_http;
28
+ file_body;
29
+ dns_host;
30
+ dns_txt_value;
31
+ instruction;
32
+
33
+ primary_key = 'team_domain_id';
34
+ api_key = 'team_domain';
35
+
36
+ structure_scheme = {
37
+ team_domain_id : 'integer | optional',
38
+ team_id : 'integer | optional',
39
+ domain_canon : 'string | max:255 | require',
40
+ display_name : 'string | max:255 | optional',
41
+ verification_method: 'string | enum | require',
42
+ domain_status : 'string | enum | optional',
43
+ verification_token : 'string | optional',
44
+ last_error_message : 'string | optional',
45
+ verified_at : 'timestamp | optional',
46
+ created_at : 'timestamp | optional',
47
+ updated_at : 'timestamp | optional',
48
+ file_url_https : 'string | optional',
49
+ file_url_http : 'string | optional',
50
+ file_body : 'string | optional',
51
+ dns_host : 'string | optional',
52
+ dns_txt_value : 'string | optional',
53
+ instruction : 'string | optional',
54
+ };
55
+
56
+ create_scheme = [
57
+ 'domain_canon',
58
+ 'display_name',
59
+ 'verification_method',
60
+ ];
61
+
62
+ available_enum_values = {
63
+ verification_method: [ 'FILE', 'DNS_TXT' ],
64
+ domain_status : [ 'PENDING', 'VERIFIED', 'FAILED', 'REVOKED' ],
65
+ };
66
+
67
+ enum_value_translate_matrix = typeTeamDomain_i18n.enum_value_translate_matrix;
68
+ attribute_name_translate_matrix = typeTeamDomain_i18n.attribute_name_translate_matrix;
69
+
70
+ status_color = {
71
+ PENDING : '#4D92FA',
72
+ VERIFIED: '#009688',
73
+ FAILED : '#E66565',
74
+ REVOKED : '#9E9E9E',
75
+ };
76
+
77
+ clone_element = false;
78
+ delete_mass = false;
79
+ update_properties = false;
80
+ update = false;
81
+ clone_element_mass = false;
82
+
83
+
84
+ /**
85
+ * @param {object|false|undefined} data
86
+ */
87
+ constructor(data = false)
88
+ {
89
+ super();
90
+
91
+ if (data && is_object(data))
92
+ {
93
+ _.mapObject(data, (value, key) =>
94
+ {
95
+ if (this.hasOwnProperty(key))
96
+ {
97
+ this [ key ] = value;
98
+ }
99
+ });
100
+ }
101
+
102
+ return this;
103
+ }
104
+
105
+
106
+ /**
107
+ * @param {object} payload
108
+ * @param {object} callback
109
+ */
110
+ verify(payload, callback)
111
+ {
112
+ if (typeof callback?.before === 'function')
113
+ {
114
+ callback?.before({ payload });
115
+ }
116
+
117
+ return ApiService[ this.api_key ].verify(payload).then((response) =>
118
+ {
119
+ if (typeof callback?.success === 'function')
120
+ {
121
+ callback?.success({ response, payload });
122
+ }
123
+ }).catch((error) =>
124
+ {
125
+ echo({ error });
126
+ if (typeof callback?.error === 'function')
127
+ {
128
+ callback?.error({ error, payload });
129
+ }
130
+ }).finally((response) =>
131
+ {
132
+ if (typeof callback?.final === 'function')
133
+ {
134
+ callback?.final({ response, payload });
135
+ }
136
+ });
137
+ }
138
+
139
+
140
+ /**
141
+ * @param {object} payload
142
+ * @param {object} callback
143
+ */
144
+ revoke(payload, callback)
145
+ {
146
+ if (typeof callback?.before === 'function')
147
+ {
148
+ callback?.before({ payload });
149
+ }
150
+
151
+ return ApiService[ this.api_key ].revoke(payload).then((response) =>
152
+ {
153
+ if (typeof callback?.success === 'function')
154
+ {
155
+ callback?.success({ response, payload });
156
+ }
157
+ }).catch((error) =>
158
+ {
159
+ echo({ error });
160
+ if (typeof callback?.error === 'function')
161
+ {
162
+ callback?.error({ error, payload });
163
+ }
164
+ }).finally((response) =>
165
+ {
166
+ if (typeof callback?.final === 'function')
167
+ {
168
+ callback?.final({ response, payload });
169
+ }
170
+ });
171
+ }
172
+ }
@@ -0,0 +1,199 @@
1
+ import { familyUtil } from "./familyUtil.js";
2
+ import { is_object } from "../../utils/utils.js";
3
+ import { typeUtilExecutionUrlInspect_i18n } from "../element_translate/typeUtilExecutionUrlInspect.i18n.js";
4
+ import { typeUtilExecutionUrlInspectCheck } from "./typeUtilExecutionUrlInspectCheck.js";
5
+ import { familyUtil_i18n } from "../element_translate/_familyUtil.i18n.js";
6
+ import { create_type_file_from_wire } from "../family_files/typeFileFactory.js";
7
+
8
+
9
+ /**
10
+ * url.inspect suite — one "Check now" run (family of probes). Always has project_id.
11
+ * Create/details/search via ApiService.url_inspect, not browser_tools_* APIs.
12
+ * Backend: test_site/docs/util_service/api-url-inspect.md
13
+ *
14
+ * @version v.0.1 (14/08/2026)
15
+ */
16
+ export class typeUtilExecutionUrlInspect extends familyUtil
17
+ {
18
+ util_execution_id;
19
+ util_action_id;
20
+ util_action_key;
21
+ project_id;
22
+ user_id;
23
+ team_id;
24
+ execution_status;
25
+ error_message;
26
+ submitted_at;
27
+ completed_at;
28
+ created_at;
29
+ team_domain_id;
30
+ domain_canon;
31
+ page_path;
32
+ suite_status;
33
+ checks;
34
+ browser;
35
+
36
+ primary_key = 'util_execution_id';
37
+ api_key = 'url_inspect';
38
+
39
+ structure_scheme = {
40
+ util_execution_id: 'integer | optional',
41
+ util_action_id : 'integer | optional',
42
+ util_action_key : 'string | optional',
43
+ project_id : 'integer | require',
44
+ user_id : 'integer | optional',
45
+ team_id : 'integer | optional',
46
+ execution_status : 'string | enum | optional',
47
+ error_message : 'string | optional',
48
+ submitted_at : 'timestamp | optional',
49
+ completed_at : 'timestamp | optional',
50
+ created_at : 'timestamp | optional',
51
+ team_domain_id : 'integer | require',
52
+ domain_canon : 'string | optional',
53
+ page_path : 'string | optional',
54
+ suite_status : 'string | enum | optional',
55
+ };
56
+
57
+ create_scheme = [
58
+ 'project_id',
59
+ 'team_domain_id',
60
+ 'page_path',
61
+ ];
62
+
63
+ available_enum_values = {
64
+ execution_status: familyUtil.get_execution_status_values(),
65
+ suite_status : [ 'CREATED', 'QUEUED', 'RUNNING', 'COMPLETED', 'PARTIAL', 'FAILED', 'SUBMIT_FAILED' ],
66
+ };
67
+
68
+ enum_value_translate_matrix = {
69
+ ...typeUtilExecutionUrlInspect_i18n.enum_value_translate_matrix,
70
+ execution_status: familyUtil_i18n.execution_status,
71
+ };
72
+
73
+ attribute_name_translate_matrix = typeUtilExecutionUrlInspect_i18n.attribute_name_translate_matrix;
74
+
75
+ status_color = {
76
+ CREATED : '#4D92FA',
77
+ QUEUED : '#009688',
78
+ RUNNING : '#4D92FA',
79
+ COMPLETED : '#009688',
80
+ PARTIAL : '#F0A202',
81
+ FAILED : '#E66565',
82
+ SUBMIT_FAILED: '#E66565',
83
+ };
84
+
85
+ clone_element = false;
86
+ delete_mass = false;
87
+ update_properties = false;
88
+ update = false;
89
+ clone_element_mass = false;
90
+
91
+
92
+ /**
93
+ * @param {object|false|undefined} data
94
+ */
95
+ constructor(data = false)
96
+ {
97
+ super();
98
+
99
+ if (data && is_object(data))
100
+ {
101
+ _.mapObject(data, (value, key) =>
102
+ {
103
+ if (key === 'checks' && Array.isArray(value))
104
+ {
105
+ this.checks = value.map((row) => new typeUtilExecutionUrlInspectCheck(row));
106
+ }
107
+ else if (key === 'browser')
108
+ {
109
+ this.browser = typeUtilExecutionUrlInspect.hydrateBrowser(value);
110
+ }
111
+ else if (this.hasOwnProperty(key))
112
+ {
113
+ this [ key ] = value;
114
+ }
115
+ });
116
+ }
117
+
118
+ return this;
119
+ }
120
+
121
+
122
+ /**
123
+ * @param {object|false|undefined} data
124
+ *
125
+ * @returns {typeUtilExecutionUrlInspect|false}
126
+ */
127
+ static composeDetails(data)
128
+ {
129
+ if (!data || !is_object(data))
130
+ {
131
+ return false;
132
+ }
133
+
134
+ return new typeUtilExecutionUrlInspect(data);
135
+ }
136
+
137
+
138
+ /**
139
+ * @param {object|null|undefined} value
140
+ *
141
+ * @returns {object|null}
142
+ */
143
+ static hydrateBrowser(value)
144
+ {
145
+ if (!value || !is_object(value))
146
+ {
147
+ return null;
148
+ }
149
+
150
+ return {
151
+ ...value,
152
+ screenshot_file: value.screenshot_file
153
+ ? create_type_file_from_wire(value.screenshot_file)
154
+ : false,
155
+ har_file: value.har_file
156
+ ? create_type_file_from_wire(value.har_file)
157
+ : false,
158
+ console: Array.isArray(value.console) ? value.console : [],
159
+ mixed_content: Array.isArray(value.mixed_content) ? value.mixed_content : [],
160
+ screenshots: Array.isArray(value.screenshots)
161
+ ? value.screenshots.map((row) => ({
162
+ ...row,
163
+ file: row?.file ? create_type_file_from_wire(row.file) : false,
164
+ }))
165
+ : [],
166
+ };
167
+ }
168
+
169
+
170
+ /**
171
+ * @param {object} payload
172
+ * @param {Function|false} [callback]
173
+ *
174
+ * @returns {Promise<*>}
175
+ */
176
+ async details(payload, callback = false)
177
+ {
178
+ if (typeof callback?.before === 'function')
179
+ {
180
+ callback?.before({ payload });
181
+ }
182
+
183
+ return ApiService[ this.api_key ].details(payload).then((response) =>
184
+ {
185
+ if (typeof callback?.success === 'function')
186
+ {
187
+ callback?.success({ response, payload });
188
+ }
189
+ return response;
190
+ }).catch((error) =>
191
+ {
192
+ if (typeof callback?.error === 'function')
193
+ {
194
+ callback?.error({ error, payload });
195
+ }
196
+ throw error;
197
+ });
198
+ }
199
+ }
@@ -0,0 +1,100 @@
1
+ import { familyUtil } from "./familyUtil.js";
2
+ import { is_object } from "../../utils/utils.js";
3
+ import { typeUtilExecutionUrlInspectCheck_i18n } from "../element_translate/typeUtilExecutionUrlInspectCheck.i18n.js";
4
+
5
+
6
+ /**
7
+ * One probe inside url.inspect suite (check_kind + check_status + finding_code).
8
+ * finding_code is not a status. Viewport screenshots live on suite.browser, not on this type.
9
+ *
10
+ * @version v.0.1 (14/08/2026)
11
+ */
12
+ export class typeUtilExecutionUrlInspectCheck extends familyUtil
13
+ {
14
+ url_inspect_check_id;
15
+ util_execution_id;
16
+ sort_order;
17
+ check_kind;
18
+ check_status;
19
+ finding_code;
20
+ summary_message;
21
+ detail_message;
22
+
23
+ primary_key = 'url_inspect_check_id';
24
+ api_key = 'url_inspect';
25
+
26
+ structure_scheme = {
27
+ url_inspect_check_id: 'integer | optional',
28
+ util_execution_id : 'integer | optional',
29
+ sort_order : 'integer | optional',
30
+ check_kind : 'string | enum | optional',
31
+ check_status : 'string | enum | optional',
32
+ finding_code : 'string | enum | optional',
33
+ summary_message : 'string | optional',
34
+ detail_message : 'string | optional',
35
+ };
36
+
37
+ available_enum_values = {
38
+ check_kind : [ 'DNS', 'TCP_80', 'TCP_443', 'TLS', 'HTTP', 'HTTPS', 'SECURITY_HEADERS', 'BROWSER' ],
39
+ check_status: [ 'PENDING', 'QUEUED', 'RUNNING', 'COMPLETED', 'SKIPPED', 'ERROR' ],
40
+ finding_code: [
41
+ 'SUCCESS',
42
+ 'ERR_NAME_NOT_RESOLVED',
43
+ 'ERR_CONNECTION_REFUSED',
44
+ 'ERR_CONNECTION_TIMED_OUT',
45
+ 'ERR_CERT_DATE_INVALID',
46
+ 'ERR_CERT_AUTHORITY_INVALID',
47
+ 'ERR_CERT_COMMON_NAME_INVALID',
48
+ 'ERR_SSL_PROTOCOL_ERROR',
49
+ 'ERR_TOO_MANY_REDIRECTS',
50
+ 'HTTP_STATUS',
51
+ 'NO_TLS',
52
+ 'EMPTY_BODY',
53
+ 'PROTOTYPE_BROWSER_SKIPPED',
54
+ 'NO_PUBLIC_ADDRESS',
55
+ 'UNKNOWN_CHECK_KIND',
56
+ 'BROWSER_FAILED',
57
+ 'BROWSER_SUBMIT_FAILED',
58
+ ],
59
+ };
60
+
61
+ enum_value_translate_matrix = typeUtilExecutionUrlInspectCheck_i18n.enum_value_translate_matrix;
62
+ attribute_name_translate_matrix = typeUtilExecutionUrlInspectCheck_i18n.attribute_name_translate_matrix;
63
+
64
+ status_color = {
65
+ PENDING : '#4D92FA',
66
+ QUEUED : '#009688',
67
+ RUNNING : '#4D92FA',
68
+ COMPLETED: '#009688',
69
+ SKIPPED : '#9E9E9E',
70
+ ERROR : '#E66565',
71
+ };
72
+
73
+ clone_element = false;
74
+ delete_mass = false;
75
+ update_properties = false;
76
+ update = false;
77
+ clone_element_mass = false;
78
+
79
+
80
+ /**
81
+ * @param {object|false|undefined} data
82
+ */
83
+ constructor(data = false)
84
+ {
85
+ super();
86
+
87
+ if (data && is_object(data))
88
+ {
89
+ _.mapObject(data, (value, key) =>
90
+ {
91
+ if (this.hasOwnProperty(key))
92
+ {
93
+ this [ key ] = value;
94
+ }
95
+ });
96
+ }
97
+
98
+ return this;
99
+ }
100
+ }