n8n-nodes-leanvox 0.1.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.
- package/LICENSE +21 -0
- package/README.md +60 -0
- package/dist/credentials/LeanvoxApi.credentials.d.ts +9 -0
- package/dist/credentials/LeanvoxApi.credentials.js +38 -0
- package/dist/credentials/LeanvoxApi.credentials.js.map +1 -0
- package/dist/nodes/Leanvox/Leanvox.node.d.ts +5 -0
- package/dist/nodes/Leanvox/Leanvox.node.js +457 -0
- package/dist/nodes/Leanvox/Leanvox.node.js.map +1 -0
- package/dist/nodes/Leanvox/leanvox.svg +5 -0
- package/package.json +53 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 LeanVox
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# n8n-nodes-leanvox
|
|
2
|
+
|
|
3
|
+
n8n community node for the [LeanVox](https://leanvox.com) TTS & STT API.
|
|
4
|
+
|
|
5
|
+
Convert text to speech, transcribe audio, and manage voices directly from your n8n workflows.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
In your n8n instance, go to **Settings > Community Nodes** and install:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
n8n-nodes-leanvox
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Or install manually:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install n8n-nodes-leanvox
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Credentials
|
|
22
|
+
|
|
23
|
+
1. Sign up at [LeanVox](https://leanvox.com) and obtain an API key (starts with `lvx_`).
|
|
24
|
+
2. In n8n, create a new **LeanVox API** credential and paste your API key.
|
|
25
|
+
|
|
26
|
+
## Resources & Operations
|
|
27
|
+
|
|
28
|
+
### Speech
|
|
29
|
+
| Operation | Description |
|
|
30
|
+
|---|---|
|
|
31
|
+
| **Generate** | Synchronous text-to-speech — returns audio binary |
|
|
32
|
+
| **Generate Async** | Asynchronous text-to-speech — returns a job ID |
|
|
33
|
+
| **Check Job** | Check the status of an async TTS job |
|
|
34
|
+
| **Dialogue** | Multi-speaker dialogue generation |
|
|
35
|
+
|
|
36
|
+
### Audio
|
|
37
|
+
| Operation | Description |
|
|
38
|
+
|---|---|
|
|
39
|
+
| **Transcribe** | Transcribe audio to text (supports summary & diarization) |
|
|
40
|
+
|
|
41
|
+
### Voices
|
|
42
|
+
| Operation | Description |
|
|
43
|
+
|---|---|
|
|
44
|
+
| **List** | List available voices |
|
|
45
|
+
| **List Curated** | List curated voices with preview URLs |
|
|
46
|
+
|
|
47
|
+
### Account
|
|
48
|
+
| Operation | Description |
|
|
49
|
+
|---|---|
|
|
50
|
+
| **Check Balance** | Check your credit balance |
|
|
51
|
+
|
|
52
|
+
## Notes
|
|
53
|
+
|
|
54
|
+
- The `voice_instructions` parameter is only available when using the **max** model.
|
|
55
|
+
- The synchronous **Generate** operation returns binary audio data that can be connected to downstream nodes (e.g., write to file, send via email).
|
|
56
|
+
- **Transcribe** accepts binary audio input and supports optional features: `summary` and `diarization`.
|
|
57
|
+
|
|
58
|
+
## License
|
|
59
|
+
|
|
60
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class LeanvoxApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
properties: INodeProperties[];
|
|
7
|
+
authenticate: IAuthenticateGeneric;
|
|
8
|
+
test: ICredentialTestRequest;
|
|
9
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LeanvoxApi = void 0;
|
|
4
|
+
class LeanvoxApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'leanvoxApi';
|
|
7
|
+
this.displayName = 'LeanVox API';
|
|
8
|
+
this.documentationUrl = 'https://docs.leanvox.com';
|
|
9
|
+
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'API Key',
|
|
12
|
+
name: 'apiKey',
|
|
13
|
+
type: 'string',
|
|
14
|
+
typeOptions: { password: true },
|
|
15
|
+
default: '',
|
|
16
|
+
placeholder: 'lvx_...',
|
|
17
|
+
description: 'Your LeanVox API key (starts with lvx_)',
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
this.authenticate = {
|
|
21
|
+
type: 'generic',
|
|
22
|
+
properties: {
|
|
23
|
+
headers: {
|
|
24
|
+
Authorization: '=Bearer {{$credentials.apiKey}}',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
this.test = {
|
|
29
|
+
request: {
|
|
30
|
+
baseURL: 'https://api.leanvox.com',
|
|
31
|
+
url: '/v1/balance',
|
|
32
|
+
method: 'GET',
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.LeanvoxApi = LeanvoxApi;
|
|
38
|
+
//# sourceMappingURL=LeanvoxApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LeanvoxApi.credentials.js","sourceRoot":"","sources":["../../credentials/LeanvoxApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,UAAU;IAAvB;QACC,SAAI,GAAG,YAAY,CAAC;QACpB,gBAAW,GAAG,aAAa,CAAC;QAC5B,qBAAgB,GAAG,0BAA0B,CAAC;QAE9C,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,SAAS;gBACtB,WAAW,EAAE,yCAAyC;aACtD;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,iCAAiC;iBAChD;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,yBAAyB;gBAClC,GAAG,EAAE,aAAa;gBAClB,MAAM,EAAE,KAAK;aACb;SACD,CAAC;IACH,CAAC;CAAA;AAjCD,gCAiCC"}
|
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Leanvox = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
class Leanvox {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.description = {
|
|
8
|
+
displayName: 'LeanVox',
|
|
9
|
+
name: 'leanvox',
|
|
10
|
+
icon: 'file:leanvox.svg',
|
|
11
|
+
group: ['transform'],
|
|
12
|
+
version: 1,
|
|
13
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
14
|
+
description: 'LeanVox TTS & STT API',
|
|
15
|
+
defaults: {
|
|
16
|
+
name: 'LeanVox',
|
|
17
|
+
},
|
|
18
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
19
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
20
|
+
credentials: [
|
|
21
|
+
{
|
|
22
|
+
name: 'leanvoxApi',
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
properties: [
|
|
27
|
+
// ------ Resource ------
|
|
28
|
+
{
|
|
29
|
+
displayName: 'Resource',
|
|
30
|
+
name: 'resource',
|
|
31
|
+
type: 'options',
|
|
32
|
+
noDataExpression: true,
|
|
33
|
+
options: [
|
|
34
|
+
{ name: 'Speech', value: 'speech' },
|
|
35
|
+
{ name: 'Audio', value: 'audio' },
|
|
36
|
+
{ name: 'Voices', value: 'voices' },
|
|
37
|
+
{ name: 'Account', value: 'account' },
|
|
38
|
+
],
|
|
39
|
+
default: 'speech',
|
|
40
|
+
},
|
|
41
|
+
// ------ Operations ------
|
|
42
|
+
// Speech operations
|
|
43
|
+
{
|
|
44
|
+
displayName: 'Operation',
|
|
45
|
+
name: 'operation',
|
|
46
|
+
type: 'options',
|
|
47
|
+
noDataExpression: true,
|
|
48
|
+
displayOptions: { show: { resource: ['speech'] } },
|
|
49
|
+
options: [
|
|
50
|
+
{
|
|
51
|
+
name: 'Generate',
|
|
52
|
+
value: 'generate',
|
|
53
|
+
description: 'Generate speech from text (synchronous)',
|
|
54
|
+
action: 'Generate speech from text',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'Generate Async',
|
|
58
|
+
value: 'generateAsync',
|
|
59
|
+
description: 'Generate speech from text (asynchronous)',
|
|
60
|
+
action: 'Generate speech asynchronously',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'Check Job',
|
|
64
|
+
value: 'checkJob',
|
|
65
|
+
description: 'Check the status of an async TTS job',
|
|
66
|
+
action: 'Check async job status',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'Dialogue',
|
|
70
|
+
value: 'dialogue',
|
|
71
|
+
description: 'Generate multi-speaker dialogue',
|
|
72
|
+
action: 'Generate multi speaker dialogue',
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
default: 'generate',
|
|
76
|
+
},
|
|
77
|
+
// Audio operations
|
|
78
|
+
{
|
|
79
|
+
displayName: 'Operation',
|
|
80
|
+
name: 'operation',
|
|
81
|
+
type: 'options',
|
|
82
|
+
noDataExpression: true,
|
|
83
|
+
displayOptions: { show: { resource: ['audio'] } },
|
|
84
|
+
options: [
|
|
85
|
+
{
|
|
86
|
+
name: 'Transcribe',
|
|
87
|
+
value: 'transcribe',
|
|
88
|
+
description: 'Transcribe audio to text',
|
|
89
|
+
action: 'Transcribe audio to text',
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
default: 'transcribe',
|
|
93
|
+
},
|
|
94
|
+
// Voices operations
|
|
95
|
+
{
|
|
96
|
+
displayName: 'Operation',
|
|
97
|
+
name: 'operation',
|
|
98
|
+
type: 'options',
|
|
99
|
+
noDataExpression: true,
|
|
100
|
+
displayOptions: { show: { resource: ['voices'] } },
|
|
101
|
+
options: [
|
|
102
|
+
{
|
|
103
|
+
name: 'List',
|
|
104
|
+
value: 'list',
|
|
105
|
+
description: 'List available voices',
|
|
106
|
+
action: 'List available voices',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: 'List Curated',
|
|
110
|
+
value: 'listCurated',
|
|
111
|
+
description: 'List curated voices with previews',
|
|
112
|
+
action: 'List curated voices with previews',
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
default: 'list',
|
|
116
|
+
},
|
|
117
|
+
// Account operations
|
|
118
|
+
{
|
|
119
|
+
displayName: 'Operation',
|
|
120
|
+
name: 'operation',
|
|
121
|
+
type: 'options',
|
|
122
|
+
noDataExpression: true,
|
|
123
|
+
displayOptions: { show: { resource: ['account'] } },
|
|
124
|
+
options: [
|
|
125
|
+
{
|
|
126
|
+
name: 'Check Balance',
|
|
127
|
+
value: 'checkBalance',
|
|
128
|
+
description: 'Check credit balance',
|
|
129
|
+
action: 'Check credit balance',
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
default: 'checkBalance',
|
|
133
|
+
},
|
|
134
|
+
// ------ Fields ------
|
|
135
|
+
// Speech > Generate / Generate Async shared fields
|
|
136
|
+
{
|
|
137
|
+
displayName: 'Text',
|
|
138
|
+
name: 'text',
|
|
139
|
+
type: 'string',
|
|
140
|
+
typeOptions: { rows: 4 },
|
|
141
|
+
required: true,
|
|
142
|
+
default: '',
|
|
143
|
+
description: 'The text to convert to speech',
|
|
144
|
+
displayOptions: {
|
|
145
|
+
show: {
|
|
146
|
+
resource: ['speech'],
|
|
147
|
+
operation: ['generate', 'generateAsync'],
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
displayName: 'Model',
|
|
153
|
+
name: 'model',
|
|
154
|
+
type: 'options',
|
|
155
|
+
required: true,
|
|
156
|
+
options: [
|
|
157
|
+
{ name: 'Max', value: 'max' },
|
|
158
|
+
{ name: 'Turbo', value: 'turbo' },
|
|
159
|
+
],
|
|
160
|
+
default: 'turbo',
|
|
161
|
+
description: 'The TTS model to use',
|
|
162
|
+
displayOptions: {
|
|
163
|
+
show: {
|
|
164
|
+
resource: ['speech'],
|
|
165
|
+
operation: ['generate', 'generateAsync'],
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
displayName: 'Voice',
|
|
171
|
+
name: 'voice',
|
|
172
|
+
type: 'string',
|
|
173
|
+
required: true,
|
|
174
|
+
default: '',
|
|
175
|
+
description: 'The voice ID to use for synthesis',
|
|
176
|
+
displayOptions: {
|
|
177
|
+
show: {
|
|
178
|
+
resource: ['speech'],
|
|
179
|
+
operation: ['generate', 'generateAsync'],
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
displayName: 'Language',
|
|
185
|
+
name: 'language',
|
|
186
|
+
type: 'string',
|
|
187
|
+
default: '',
|
|
188
|
+
description: 'Optional language code (e.g. en, es, fr)',
|
|
189
|
+
displayOptions: {
|
|
190
|
+
show: {
|
|
191
|
+
resource: ['speech'],
|
|
192
|
+
operation: ['generate', 'generateAsync'],
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
displayName: 'Voice Instructions',
|
|
198
|
+
name: 'voiceInstructions',
|
|
199
|
+
type: 'string',
|
|
200
|
+
typeOptions: { rows: 3 },
|
|
201
|
+
default: '',
|
|
202
|
+
description: 'Custom voice instructions (only valid with model "max")',
|
|
203
|
+
displayOptions: {
|
|
204
|
+
show: {
|
|
205
|
+
resource: ['speech'],
|
|
206
|
+
operation: ['generate', 'generateAsync'],
|
|
207
|
+
model: ['max'],
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
// Speech > Check Job
|
|
212
|
+
{
|
|
213
|
+
displayName: 'Job ID',
|
|
214
|
+
name: 'jobId',
|
|
215
|
+
type: 'string',
|
|
216
|
+
required: true,
|
|
217
|
+
default: '',
|
|
218
|
+
description: 'The async job ID to check',
|
|
219
|
+
displayOptions: {
|
|
220
|
+
show: {
|
|
221
|
+
resource: ['speech'],
|
|
222
|
+
operation: ['checkJob'],
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
// Speech > Dialogue
|
|
227
|
+
{
|
|
228
|
+
displayName: 'Lines',
|
|
229
|
+
name: 'lines',
|
|
230
|
+
type: 'fixedCollection',
|
|
231
|
+
typeOptions: { multipleValues: true },
|
|
232
|
+
required: true,
|
|
233
|
+
default: {},
|
|
234
|
+
description: 'Dialogue lines with text and voice',
|
|
235
|
+
displayOptions: {
|
|
236
|
+
show: {
|
|
237
|
+
resource: ['speech'],
|
|
238
|
+
operation: ['dialogue'],
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
options: [
|
|
242
|
+
{
|
|
243
|
+
name: 'lineValues',
|
|
244
|
+
displayName: 'Line',
|
|
245
|
+
values: [
|
|
246
|
+
{
|
|
247
|
+
displayName: 'Text',
|
|
248
|
+
name: 'text',
|
|
249
|
+
type: 'string',
|
|
250
|
+
default: '',
|
|
251
|
+
description: 'The dialogue line text',
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
displayName: 'Voice',
|
|
255
|
+
name: 'voice',
|
|
256
|
+
type: 'string',
|
|
257
|
+
default: '',
|
|
258
|
+
description: 'The voice ID for this line',
|
|
259
|
+
},
|
|
260
|
+
],
|
|
261
|
+
},
|
|
262
|
+
],
|
|
263
|
+
},
|
|
264
|
+
// Audio > Transcribe
|
|
265
|
+
{
|
|
266
|
+
displayName: 'Input Data Field Name',
|
|
267
|
+
name: 'binaryPropertyName',
|
|
268
|
+
type: 'string',
|
|
269
|
+
required: true,
|
|
270
|
+
default: 'data',
|
|
271
|
+
description: 'The name of the input field containing the binary audio data',
|
|
272
|
+
displayOptions: {
|
|
273
|
+
show: {
|
|
274
|
+
resource: ['audio'],
|
|
275
|
+
operation: ['transcribe'],
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
displayName: 'Features',
|
|
281
|
+
name: 'features',
|
|
282
|
+
type: 'multiOptions',
|
|
283
|
+
default: [],
|
|
284
|
+
description: 'Additional transcription features to enable',
|
|
285
|
+
options: [
|
|
286
|
+
{ name: 'Diarization', value: 'diarization' },
|
|
287
|
+
{ name: 'Summary', value: 'summary' },
|
|
288
|
+
],
|
|
289
|
+
displayOptions: {
|
|
290
|
+
show: {
|
|
291
|
+
resource: ['audio'],
|
|
292
|
+
operation: ['transcribe'],
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
],
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
async execute() {
|
|
300
|
+
var _a, _b, _c, _d;
|
|
301
|
+
const items = this.getInputData();
|
|
302
|
+
const returnData = [];
|
|
303
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
304
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
305
|
+
for (let i = 0; i < items.length; i++) {
|
|
306
|
+
try {
|
|
307
|
+
let responseData;
|
|
308
|
+
// ---- Speech ----
|
|
309
|
+
if (resource === 'speech') {
|
|
310
|
+
if (operation === 'generate' || operation === 'generateAsync') {
|
|
311
|
+
const text = this.getNodeParameter('text', i);
|
|
312
|
+
const model = this.getNodeParameter('model', i);
|
|
313
|
+
const voice = this.getNodeParameter('voice', i);
|
|
314
|
+
const language = this.getNodeParameter('language', i);
|
|
315
|
+
const body = { text, model, voice };
|
|
316
|
+
if (language) {
|
|
317
|
+
body.language = language;
|
|
318
|
+
}
|
|
319
|
+
if (model === 'max') {
|
|
320
|
+
const voiceInstructions = this.getNodeParameter('voiceInstructions', i, '');
|
|
321
|
+
if (voiceInstructions) {
|
|
322
|
+
body.voice_instructions = voiceInstructions;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
const endpoint = operation === 'generate'
|
|
326
|
+
? '/v1/tts/generate'
|
|
327
|
+
: '/v1/tts/generate/async';
|
|
328
|
+
if (operation === 'generate') {
|
|
329
|
+
// Sync TTS returns audio binary
|
|
330
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'leanvoxApi', {
|
|
331
|
+
method: 'POST',
|
|
332
|
+
url: `https://api.leanvox.com${endpoint}`,
|
|
333
|
+
body,
|
|
334
|
+
json: true,
|
|
335
|
+
returnFullResponse: true,
|
|
336
|
+
encoding: 'arraybuffer',
|
|
337
|
+
});
|
|
338
|
+
const contentType = (_b = (_a = response.headers) === null || _a === void 0 ? void 0 : _a['content-type']) !== null && _b !== void 0 ? _b : 'audio/mpeg';
|
|
339
|
+
// If response is JSON (e.g. error or metadata), return as JSON
|
|
340
|
+
if (contentType.includes('application/json')) {
|
|
341
|
+
const jsonStr = response.body instanceof Buffer
|
|
342
|
+
? response.body.toString('utf8')
|
|
343
|
+
: String(response.body);
|
|
344
|
+
responseData = JSON.parse(jsonStr);
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
// Binary audio response
|
|
348
|
+
const binaryData = await this.helpers.prepareBinaryData(Buffer.from(response.body), 'output.mp3', contentType);
|
|
349
|
+
returnData.push({
|
|
350
|
+
json: { success: true },
|
|
351
|
+
binary: { data: binaryData },
|
|
352
|
+
});
|
|
353
|
+
continue;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
else {
|
|
357
|
+
responseData = await this.helpers.httpRequestWithAuthentication.call(this, 'leanvoxApi', {
|
|
358
|
+
method: 'POST',
|
|
359
|
+
url: `https://api.leanvox.com${endpoint}`,
|
|
360
|
+
body,
|
|
361
|
+
json: true,
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
else if (operation === 'checkJob') {
|
|
366
|
+
const jobId = this.getNodeParameter('jobId', i);
|
|
367
|
+
responseData = await this.helpers.httpRequestWithAuthentication.call(this, 'leanvoxApi', {
|
|
368
|
+
method: 'GET',
|
|
369
|
+
url: `https://api.leanvox.com/v1/tts/jobs/${jobId}`,
|
|
370
|
+
json: true,
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
else if (operation === 'dialogue') {
|
|
374
|
+
const linesData = this.getNodeParameter('lines.lineValues', i, []);
|
|
375
|
+
responseData = await this.helpers.httpRequestWithAuthentication.call(this, 'leanvoxApi', {
|
|
376
|
+
method: 'POST',
|
|
377
|
+
url: 'https://api.leanvox.com/v1/tts/dialogue',
|
|
378
|
+
body: { lines: linesData },
|
|
379
|
+
json: true,
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
// ---- Audio ----
|
|
384
|
+
if (resource === 'audio' && operation === 'transcribe') {
|
|
385
|
+
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
|
|
386
|
+
const features = this.getNodeParameter('features', i);
|
|
387
|
+
const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
|
|
388
|
+
const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
|
|
389
|
+
const formData = {
|
|
390
|
+
file: {
|
|
391
|
+
value: dataBuffer,
|
|
392
|
+
options: {
|
|
393
|
+
filename: (_c = binaryData.fileName) !== null && _c !== void 0 ? _c : 'audio.wav',
|
|
394
|
+
contentType: (_d = binaryData.mimeType) !== null && _d !== void 0 ? _d : 'audio/wav',
|
|
395
|
+
},
|
|
396
|
+
},
|
|
397
|
+
};
|
|
398
|
+
if (features.length > 0) {
|
|
399
|
+
formData.features = features.join(',');
|
|
400
|
+
}
|
|
401
|
+
responseData = await this.helpers.httpRequestWithAuthentication.call(this, 'leanvoxApi', {
|
|
402
|
+
method: 'POST',
|
|
403
|
+
url: 'https://api.leanvox.com/v1/audio/transcribe',
|
|
404
|
+
formData,
|
|
405
|
+
});
|
|
406
|
+
// Parse if string
|
|
407
|
+
if (typeof responseData === 'string') {
|
|
408
|
+
try {
|
|
409
|
+
responseData = JSON.parse(responseData);
|
|
410
|
+
}
|
|
411
|
+
catch {
|
|
412
|
+
// leave as string
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
// ---- Voices ----
|
|
417
|
+
if (resource === 'voices') {
|
|
418
|
+
const endpoint = operation === 'listCurated' ? '/v1/voices/curated' : '/v1/voices';
|
|
419
|
+
responseData = await this.helpers.httpRequestWithAuthentication.call(this, 'leanvoxApi', {
|
|
420
|
+
method: 'GET',
|
|
421
|
+
url: `https://api.leanvox.com${endpoint}`,
|
|
422
|
+
json: true,
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
// ---- Account ----
|
|
426
|
+
if (resource === 'account' && operation === 'checkBalance') {
|
|
427
|
+
responseData = await this.helpers.httpRequestWithAuthentication.call(this, 'leanvoxApi', {
|
|
428
|
+
method: 'GET',
|
|
429
|
+
url: 'https://api.leanvox.com/v1/balance',
|
|
430
|
+
json: true,
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
// Push JSON result
|
|
434
|
+
if (Array.isArray(responseData)) {
|
|
435
|
+
for (const item of responseData) {
|
|
436
|
+
returnData.push({ json: item });
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
else {
|
|
440
|
+
returnData.push({ json: (responseData !== null && responseData !== void 0 ? responseData : {}) });
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
catch (error) {
|
|
444
|
+
if (this.continueOnFail()) {
|
|
445
|
+
returnData.push({
|
|
446
|
+
json: { error: error.message },
|
|
447
|
+
});
|
|
448
|
+
continue;
|
|
449
|
+
}
|
|
450
|
+
throw error;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
return [returnData];
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
exports.Leanvox = Leanvox;
|
|
457
|
+
//# sourceMappingURL=Leanvox.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Leanvox.node.js","sourceRoot":"","sources":["../../../nodes/Leanvox/Leanvox.node.ts"],"names":[],"mappings":";;;AAQA,+CAAmD;AAEnD,MAAa,OAAO;IAApB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,SAAS;YACtB,IAAI,EAAE,SAAS;YACf,IAAI,EAA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,EAAE,CAAC;gBAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC3B,UAAU,CAAC,IAAI,CAAC;wBACf,IAAI,EAAE,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE;qBACzC,CAAC,CAAC;oBACH,SAAS;gBACV,CAAC;gBACD,MAAM,KAAK,CAAC;YACb,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AA5fD,0BA4fC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60" fill="none">
|
|
2
|
+
<rect width="60" height="60" rx="12" fill="#6C3AED"/>
|
|
3
|
+
<path d="M15 30c0-1.5 1-2.5 2-3.5 1.5-1.5 3-3 3-6.5 0-2.5 2-4 4-4s4 1.5 4 4c0 3.5 1.5 5 3 6.5 1 1 2 2 2 3.5s-1 2.5-2 3.5c-1.5 1.5-3 3-3 6.5 0 2.5-2 4-4 4s-4-1.5-4-4c0-3.5-1.5-5-3-6.5-1-1-2-2-2-3.5z" fill="#fff" opacity=".9"/>
|
|
4
|
+
<path d="M35 30c0-1 .7-1.7 1.3-2.3 1-1 2-2.1 2-4.5 0-1.7 1.4-2.7 2.7-2.7s2.7 1 2.7 2.7c0 2.4 1 3.5 2 4.5.6.6 1.3 1.3 1.3 2.3s-.7 1.7-1.3 2.3c-1 1-2 2.1-2 4.5 0 1.7-1.4 2.7-2.7 2.7S38.3 38.5 38.3 36.8c0-2.4-1-3.5-2-4.5-.6-.6-1.3-1.3-1.3-2.3z" fill="#C4B5FD"/>
|
|
5
|
+
</svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-leanvox",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "n8n community node for LeanVox TTS & STT API",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"n8n-community-node-package",
|
|
7
|
+
"n8n",
|
|
8
|
+
"leanvox",
|
|
9
|
+
"tts",
|
|
10
|
+
"stt",
|
|
11
|
+
"text-to-speech",
|
|
12
|
+
"speech-to-text",
|
|
13
|
+
"transcription"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"homepage": "",
|
|
17
|
+
"author": {
|
|
18
|
+
"name": "LeanVox"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/leanvox/n8n-nodes-leanvox.git"
|
|
23
|
+
},
|
|
24
|
+
"main": "index.js",
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsc && gulp build:icons",
|
|
27
|
+
"dev": "tsc --watch",
|
|
28
|
+
"format": "prettier nodes credentials --write",
|
|
29
|
+
"lint": "tsc --noEmit",
|
|
30
|
+
"prepublishOnly": "npm run build"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist"
|
|
34
|
+
],
|
|
35
|
+
"n8n": {
|
|
36
|
+
"n8nNodesApiVersion": 1,
|
|
37
|
+
"credentials": [
|
|
38
|
+
"dist/credentials/LeanvoxApi.credentials.js"
|
|
39
|
+
],
|
|
40
|
+
"nodes": [
|
|
41
|
+
"dist/nodes/Leanvox/Leanvox.node.js"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/node": "^20.11.0",
|
|
46
|
+
"gulp": "^4.0.2",
|
|
47
|
+
"n8n-workflow": "^1.27.0",
|
|
48
|
+
"typescript": "^5.3.0"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"n8n-workflow": "*"
|
|
52
|
+
}
|
|
53
|
+
}
|