n8n-nodes-local-ai-stack-dev 1.2.1 → 1.2.3
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"}
|
|
@@ -47,39 +47,44 @@ class VoiceStudioStt {
|
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
async execute() {
|
|
50
|
-
var _a;
|
|
51
50
|
const items = this.getInputData();
|
|
52
51
|
const returnData = [];
|
|
53
52
|
for (let i = 0; i < items.length; i++) {
|
|
54
53
|
try {
|
|
55
54
|
const serverUrl = this.getNodeParameter("serverUrl", i);
|
|
56
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
|
+
}
|
|
57
61
|
// Get binary data
|
|
58
|
-
|
|
62
|
+
const binaryData = item.binary[binaryPropertyName];
|
|
59
63
|
const buffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
|
|
60
|
-
//
|
|
61
|
-
const
|
|
62
|
-
const
|
|
63
|
-
const mimeType = (binaryData === null || binaryData === void 0 ? void 0 : binaryData.mimeType) || "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";
|
|
64
67
|
// Get language parameter (optional)
|
|
65
68
|
const languageRaw = this.getNodeParameter("language", i, "");
|
|
66
69
|
const language = languageRaw.trim();
|
|
67
|
-
// Prepare FormData
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
// Prepare FormData using n8n's approach
|
|
71
|
+
const formData = {
|
|
72
|
+
audio_file: {
|
|
73
|
+
value: buffer,
|
|
74
|
+
options: {
|
|
75
|
+
filename: fileName,
|
|
76
|
+
contentType: mimeType,
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
};
|
|
74
80
|
if (language) {
|
|
75
|
-
formData.
|
|
81
|
+
formData.language = language;
|
|
76
82
|
}
|
|
77
83
|
// Send multipart/form-data request
|
|
78
84
|
const response = await this.helpers.request({
|
|
79
85
|
method: "POST",
|
|
80
86
|
uri: serverUrl,
|
|
81
|
-
|
|
82
|
-
headers: formData.getHeaders(),
|
|
87
|
+
formData: formData,
|
|
83
88
|
json: true,
|
|
84
89
|
});
|
|
85
90
|
returnData.push({ json: response });
|
package/package.json
CHANGED