n8n-nodes-daytona-tool 0.1.7 → 0.1.8

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.
@@ -66,15 +66,14 @@ const getSandboxByName = async (client, name) => {
66
66
  };
67
67
  exports.getSandboxByName = getSandboxByName;
68
68
  const runNodeCode = async (sandbox, code, timeoutMs) => {
69
- var _a, _b, _c;
69
+ var _a;
70
70
  const processApi = (_a = sandbox === null || sandbox === void 0 ? void 0 : sandbox.process) !== null && _a !== void 0 ? _a : sandbox;
71
- const executeFn = (_c = (_b = processApi === null || processApi === void 0 ? void 0 : processApi.executeCommand) !== null && _b !== void 0 ? _b : processApi === null || processApi === void 0 ? void 0 : processApi.runCommand) !== null && _c !== void 0 ? _c : processApi === null || processApi === void 0 ? void 0 : processApi.run;
72
- if (!executeFn) {
73
- throw new Error('Daytona SDK: execute command method not found.');
71
+ const codeRunFn = processApi === null || processApi === void 0 ? void 0 : processApi.codeRun;
72
+ if (!codeRunFn) {
73
+ throw new Error('Daytona SDK: codeRun method not found.');
74
74
  }
75
- const command = `node -e ${JSON.stringify(code)}`;
76
- const options = timeoutMs ? { timeoutMs } : undefined;
77
- return executeFn.call(processApi, command, options);
75
+ const timeoutSeconds = timeoutMs ? Math.ceil(timeoutMs / 1000) : undefined;
76
+ return codeRunFn.call(processApi, code, undefined, timeoutSeconds);
78
77
  };
79
78
  exports.runNodeCode = runNodeCode;
80
79
  const disposeSandbox = async (sandbox) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-daytona-tool",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "n8n community nodes for running code in Daytona sandboxes.",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",