n8n-nodes-local-ai-stack-dev 1.1.7 → 1.2.0

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,CA4E/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CAmDxE"}
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;CA0DxE"}
@@ -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",
@@ -87,29 +52,32 @@ class VoiceStudioStt {
87
52
  for (let i = 0; i < items.length; i++) {
88
53
  try {
89
54
  const serverUrl = this.getNodeParameter("serverUrl", i);
90
- const audioSource = this.getNodeParameter("audioSource", i);
91
- let audioBase64;
92
- if (audioSource === "binary") {
93
- const binaryPropertyName = this.getNodeParameter("audioBinary", i);
94
- this.helpers.assertBinaryData(i, binaryPropertyName);
95
- const buffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
96
- audioBase64 = buffer.toString("base64");
97
- }
98
- else {
99
- audioBase64 = this.getNodeParameter("audioBase64", i);
100
- }
55
+ const binaryPropertyName = this.getNodeParameter("audioBinary", i);
56
+ // Get binary data
57
+ this.helpers.assertBinaryData(i, binaryPropertyName);
58
+ const binaryData = items[i].binary[binaryPropertyName];
59
+ const buffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
60
+ // Get filename with extension
61
+ const fileName = binaryData.fileName || "audio.wav";
62
+ // Get language parameter (optional)
101
63
  const languageRaw = this.getNodeParameter("language", i, "");
102
- const body = {
103
- audio_base64: audioBase64,
104
- };
105
64
  const language = languageRaw.trim();
65
+ // Prepare FormData
66
+ const FormData = require("form-data");
67
+ const formData = new FormData();
68
+ formData.append("audio_file", buffer, {
69
+ filename: fileName,
70
+ contentType: binaryData.mimeType || "audio/wav",
71
+ });
106
72
  if (language) {
107
- body.language = language;
73
+ formData.append("language", language);
108
74
  }
75
+ // Send multipart/form-data request
109
76
  const response = await this.helpers.request({
110
77
  method: "POST",
111
78
  uri: serverUrl,
112
- body,
79
+ body: formData,
80
+ headers: formData.getHeaders(),
113
81
  json: true,
114
82
  });
115
83
  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.7",
3
+ "version": "1.2.0",
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
+ }