n8n-nodes-local-ai-stack-dev 1.1.7 → 1.2.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.
|
@@ -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,
|
|
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;CA2DxE"}
|
|
@@ -16,23 +16,6 @@ class VoiceStudioStt {
|
|
|
16
16
|
inputs: ["main"],
|
|
17
17
|
outputs: ["main"],
|
|
18
18
|
properties: [
|
|
19
|
-
{
|
|
20
|
-
displayName: "Audio Source",
|
|
21
|
-
name: "audioSource",
|
|
22
|
-
type: "options",
|
|
23
|
-
options: [
|
|
24
|
-
{
|
|
25
|
-
name: "Binary",
|
|
26
|
-
value: "binary",
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: "Base64",
|
|
30
|
-
value: "base64",
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
default: "binary",
|
|
34
|
-
description: "Choose how the audio is provided",
|
|
35
|
-
},
|
|
36
19
|
{
|
|
37
20
|
displayName: "Audio Binary Property",
|
|
38
21
|
name: "audioBinary",
|
|
@@ -40,26 +23,8 @@ class VoiceStudioStt {
|
|
|
40
23
|
default: "data",
|
|
41
24
|
required: true,
|
|
42
25
|
description: "The input binary field containing the audio file",
|
|
43
|
-
displayOptions: {
|
|
44
|
-
show: {
|
|
45
|
-
audioSource: ["binary"],
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
26
|
hint: "The name of the binary property that contains the audio data",
|
|
49
27
|
},
|
|
50
|
-
{
|
|
51
|
-
displayName: "Audio Base64",
|
|
52
|
-
name: "audioBase64",
|
|
53
|
-
type: "string",
|
|
54
|
-
default: "",
|
|
55
|
-
required: true,
|
|
56
|
-
description: "Base64-encoded audio content",
|
|
57
|
-
displayOptions: {
|
|
58
|
-
show: {
|
|
59
|
-
audioSource: ["base64"],
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
28
|
{
|
|
64
29
|
displayName: "Language",
|
|
65
30
|
name: "language",
|
|
@@ -82,34 +47,39 @@ class VoiceStudioStt {
|
|
|
82
47
|
};
|
|
83
48
|
}
|
|
84
49
|
async execute() {
|
|
50
|
+
var _a;
|
|
85
51
|
const items = this.getInputData();
|
|
86
52
|
const returnData = [];
|
|
87
53
|
for (let i = 0; i < items.length; i++) {
|
|
88
54
|
try {
|
|
89
55
|
const serverUrl = this.getNodeParameter("serverUrl", i);
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
audioBase64 = this.getNodeParameter("audioBase64", i);
|
|
100
|
-
}
|
|
56
|
+
const binaryPropertyName = this.getNodeParameter("audioBinary", i);
|
|
57
|
+
// Get binary data
|
|
58
|
+
this.helpers.assertBinaryData(i, binaryPropertyName);
|
|
59
|
+
const buffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
|
|
60
|
+
// Get binary data metadata (may be null in some cases)
|
|
61
|
+
const binaryData = (_a = items[i].binary) === null || _a === void 0 ? void 0 : _a[binaryPropertyName];
|
|
62
|
+
const fileName = (binaryData === null || binaryData === void 0 ? void 0 : binaryData.fileName) || "audio.wav";
|
|
63
|
+
const mimeType = (binaryData === null || binaryData === void 0 ? void 0 : binaryData.mimeType) || "audio/wav";
|
|
64
|
+
// Get language parameter (optional)
|
|
101
65
|
const languageRaw = this.getNodeParameter("language", i, "");
|
|
102
|
-
const body = {
|
|
103
|
-
audio_base64: audioBase64,
|
|
104
|
-
};
|
|
105
66
|
const language = languageRaw.trim();
|
|
67
|
+
// Prepare FormData
|
|
68
|
+
const FormData = require("form-data");
|
|
69
|
+
const formData = new FormData();
|
|
70
|
+
formData.append("audio_file", buffer, {
|
|
71
|
+
filename: fileName,
|
|
72
|
+
contentType: mimeType,
|
|
73
|
+
});
|
|
106
74
|
if (language) {
|
|
107
|
-
|
|
75
|
+
formData.append("language", language);
|
|
108
76
|
}
|
|
77
|
+
// Send multipart/form-data request
|
|
109
78
|
const response = await this.helpers.request({
|
|
110
79
|
method: "POST",
|
|
111
80
|
uri: serverUrl,
|
|
112
|
-
body,
|
|
81
|
+
body: formData,
|
|
82
|
+
headers: formData.getHeaders(),
|
|
113
83
|
json: true,
|
|
114
84
|
});
|
|
115
85
|
returnData.push({ json: response });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-local-ai-stack-dev",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "n8n custom nodes for AI services including image captionning, OCR, face detection, and more AI-powered features",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n",
|
|
@@ -52,4 +52,4 @@
|
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"n8n-workflow": "*"
|
|
54
54
|
}
|
|
55
|
-
}
|
|
55
|
+
}
|