n8n-nodes-local-ai-stack-dev 1.2.0 → 1.2.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceStudioStt.node.d.ts","sourceRoot":"","sources":["../../nodes/VoiceStudioStt.node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEnF,qBAAa,cAAe,YAAW,SAAS;IAC9C,WAAW,EAAE,oBAAoB,CAyC/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"VoiceStudioStt.node.d.ts","sourceRoot":"","sources":["../../nodes/VoiceStudioStt.node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEnF,qBAAa,cAAe,YAAW,SAAS;IAC9C,WAAW,EAAE,oBAAoB,CAyC/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CAkExE"}
|
|
@@ -53,21 +53,27 @@ class VoiceStudioStt {
|
|
|
53
53
|
try {
|
|
54
54
|
const serverUrl = this.getNodeParameter("serverUrl", i);
|
|
55
55
|
const binaryPropertyName = this.getNodeParameter("audioBinary", i);
|
|
56
|
+
// Verify binary data exists
|
|
57
|
+
const item = items[i];
|
|
58
|
+
if (!item.binary || !item.binary[binaryPropertyName]) {
|
|
59
|
+
throw new Error(`No binary data found for property "${binaryPropertyName}"`);
|
|
60
|
+
}
|
|
56
61
|
// Get binary data
|
|
57
|
-
|
|
58
|
-
const binaryData = items[i].binary[binaryPropertyName];
|
|
62
|
+
const binaryData = item.binary[binaryPropertyName];
|
|
59
63
|
const buffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
|
|
60
|
-
//
|
|
61
|
-
const fileName = binaryData.fileName || "audio.wav";
|
|
64
|
+
// Extract metadata with safe defaults
|
|
65
|
+
const fileName = binaryData.fileName || binaryData.fileExtension ? `audio.${binaryData.fileExtension}` : "audio.wav";
|
|
66
|
+
const mimeType = binaryData.mimeType || "audio/wav";
|
|
62
67
|
// Get language parameter (optional)
|
|
63
68
|
const languageRaw = this.getNodeParameter("language", i, "");
|
|
64
69
|
const language = languageRaw.trim();
|
|
65
70
|
// Prepare FormData
|
|
66
71
|
const FormData = require("form-data");
|
|
67
72
|
const formData = new FormData();
|
|
73
|
+
// Append buffer as file with explicit options object
|
|
68
74
|
formData.append("audio_file", buffer, {
|
|
69
75
|
filename: fileName,
|
|
70
|
-
contentType:
|
|
76
|
+
contentType: mimeType,
|
|
71
77
|
});
|
|
72
78
|
if (language) {
|
|
73
79
|
formData.append("language", language);
|
package/package.json
CHANGED