@stubber/virtual-worker 1.4.0 → 1.4.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.
@@ -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
@@ -24,7 +24,7 @@ export const get_chromium_page = async (params, stubber_context) => {
24
24
 
25
25
  const slow_mo = params?.slow_mo || process.env.SLOW_MO || 0;
26
26
 
27
- console.log(`get_chromium_page: session_id=${session_id}, slow_mo=${slow_mo}`);
27
+ // console.log(`get_chromium_page: session_id=${session_id}, slow_mo=${slow_mo}`);
28
28
 
29
29
  // Launch the browser once and reuse it
30
30
  if (!browser) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stubber/virtual-worker",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Template to easily create a node app and keep development standards",
5
5
  "main": "app.js",
6
6
  "directories": {