@stubber/virtual-worker 1.4.0 → 1.4.2
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.
|
@@ -102,12 +102,12 @@ export const upload_files = async (params, _stubber) => {
|
|
|
102
102
|
|
|
103
103
|
if (payload.uploaded_files) {
|
|
104
104
|
attachments = payload.uploaded_files;
|
|
105
|
+
payload.attachments = attachments;
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
return create_success({
|
|
108
109
|
message: "Files uploaded successfully",
|
|
109
110
|
payload,
|
|
110
|
-
attachments,
|
|
111
111
|
});
|
|
112
112
|
} catch (error) {
|
|
113
113
|
return create_error_technical(error);
|
|
@@ -71,6 +71,17 @@ export const run_commands = async (task, _stubber) => {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
// move command attachments to the task level
|
|
75
|
+
const command_attachments = payload.commands[command_name]?.payload?.attachments;
|
|
76
|
+
if (command_attachments && Array.isArray(command_attachments)) {
|
|
77
|
+
if (!payload.attachments) {
|
|
78
|
+
payload.attachments = [];
|
|
79
|
+
}
|
|
80
|
+
payload.attachments.push(...command_attachments);
|
|
81
|
+
// remove attachments from command payload
|
|
82
|
+
delete payload.commands[command_name].payload.attachments;
|
|
83
|
+
}
|
|
84
|
+
|
|
74
85
|
if (!payload.commands[command_name].success && !command.continue_on_error) {
|
|
75
86
|
important_command_failed = true;
|
|
76
87
|
break; // Stop execution if continue_on_error is falsy
|
|
@@ -22,9 +22,15 @@ export const get_chromium_page = async (params, stubber_context) => {
|
|
|
22
22
|
return create_error_conceptual({ message: "session_id is required to get a Chromium page." });
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
let slow_mo = params?.slow_mo || process.env.SLOW_MO || 0;
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
slow_mo = Number(slow_mo);
|
|
28
|
+
|
|
29
|
+
if (!isNaN(slow_mo) && slow_mo < 0) {
|
|
30
|
+
slow_mo = 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// console.log(`get_chromium_page: session_id=${session_id}, slow_mo=${slow_mo}`);
|
|
28
34
|
|
|
29
35
|
// Launch the browser once and reuse it
|
|
30
36
|
if (!browser) {
|