n8n-nodes-soniox-api 0.5.2 → 0.5.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.
|
@@ -195,6 +195,9 @@ class Soniox {
|
|
|
195
195
|
const model = this.getNodeParameter('model', i, '');
|
|
196
196
|
const additionalFields = this.getNodeParameter('additionalFields', i, {});
|
|
197
197
|
const options = this.getNodeParameter('options', i, {});
|
|
198
|
+
// CRITICAL: Remove audio_url from additionalFields if somehow present
|
|
199
|
+
delete additionalFields.audio_url;
|
|
200
|
+
delete additionalFields.audioUrl;
|
|
198
201
|
// Get binary data
|
|
199
202
|
const binaryData = items[i].binary;
|
|
200
203
|
if (!binaryData || !binaryData[binaryPropertyName]) {
|
|
@@ -241,8 +244,15 @@ class Soniox {
|
|
|
241
244
|
if (additionalFields.includeNonFinal) {
|
|
242
245
|
body.include_nonfinal = additionalFields.includeNonFinal;
|
|
243
246
|
}
|
|
244
|
-
// Ensure
|
|
247
|
+
// CRITICAL: Ensure NO audio_url is sent (API requires ONLY file_id OR audio_url, not both)
|
|
248
|
+
// Delete from body in all possible forms
|
|
245
249
|
delete body.audio_url;
|
|
250
|
+
delete body.audioUrl;
|
|
251
|
+
delete body[' audio_url'];
|
|
252
|
+
// Also ensure file_id is present and valid
|
|
253
|
+
if (!body.file_id) {
|
|
254
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `file_id is missing from request body. File upload may have failed.`, { itemIndex: i });
|
|
255
|
+
}
|
|
246
256
|
const createResponse = await GenericFunctions_1.sonioxApiRequest.call(this, 'POST', '/transcriptions', body);
|
|
247
257
|
const transcriptionId = createResponse.transcription_id || createResponse.id;
|
|
248
258
|
if (!transcriptionId) {
|
|
@@ -287,6 +297,9 @@ class Soniox {
|
|
|
287
297
|
const fileId = this.getNodeParameter('fileId', i);
|
|
288
298
|
const model = this.getNodeParameter('model', i, '');
|
|
289
299
|
const additionalFields = this.getNodeParameter('additionalFields', i, {});
|
|
300
|
+
// CRITICAL: Remove audio_url from additionalFields if somehow present
|
|
301
|
+
delete additionalFields.audio_url;
|
|
302
|
+
delete additionalFields.audioUrl;
|
|
290
303
|
// Validate fileId (must be UUID)
|
|
291
304
|
if (!fileId || !fileId.trim()) {
|
|
292
305
|
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'File ID is required', { itemIndex: i });
|
|
@@ -326,8 +339,10 @@ class Soniox {
|
|
|
326
339
|
if (additionalFields.includeNonFinal) {
|
|
327
340
|
body.include_nonfinal = additionalFields.includeNonFinal;
|
|
328
341
|
}
|
|
329
|
-
// Ensure
|
|
342
|
+
// CRITICAL: Ensure NO audio_url is sent (API requires ONLY file_id OR audio_url, not both)
|
|
330
343
|
delete body.audio_url;
|
|
344
|
+
delete body.audioUrl;
|
|
345
|
+
delete body[' audio_url'];
|
|
331
346
|
const response = await GenericFunctions_1.sonioxApiRequest.call(this, 'POST', '/transcriptions', body);
|
|
332
347
|
returnData.push({ json: response });
|
|
333
348
|
}
|
|
@@ -336,6 +351,9 @@ class Soniox {
|
|
|
336
351
|
const model = this.getNodeParameter('model', i, '');
|
|
337
352
|
const additionalFields = this.getNodeParameter('additionalFields', i, {});
|
|
338
353
|
const options = this.getNodeParameter('options', i, {});
|
|
354
|
+
// CRITICAL: Remove audio_url from additionalFields if somehow present
|
|
355
|
+
delete additionalFields.audio_url;
|
|
356
|
+
delete additionalFields.audioUrl;
|
|
339
357
|
const maxWaitTime = options.maxWaitTime || 300;
|
|
340
358
|
const checkInterval = options.checkInterval || 5;
|
|
341
359
|
if (!fileId || !fileId.trim()) {
|
|
@@ -362,8 +380,15 @@ class Soniox {
|
|
|
362
380
|
body.enable_speaker_diarization = additionalFields.enableSpeakerDiarization;
|
|
363
381
|
if (additionalFields.includeNonFinal)
|
|
364
382
|
body.include_nonfinal = additionalFields.includeNonFinal;
|
|
365
|
-
// Ensure
|
|
383
|
+
// CRITICAL: Ensure NO audio_url is sent (API requires ONLY file_id OR audio_url, not both)
|
|
384
|
+
// Delete from body in all possible forms
|
|
366
385
|
delete body.audio_url;
|
|
386
|
+
delete body.audioUrl;
|
|
387
|
+
delete body[' audio_url'];
|
|
388
|
+
// Also ensure file_id is present and valid
|
|
389
|
+
if (!body.file_id) {
|
|
390
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `file_id is missing from request body. Upload may have failed.`, { itemIndex: i });
|
|
391
|
+
}
|
|
367
392
|
const createResponse = await GenericFunctions_1.sonioxApiRequest.call(this, 'POST', '/transcriptions', body);
|
|
368
393
|
const transcriptionId = createResponse.transcription_id || createResponse.id;
|
|
369
394
|
if (!transcriptionId) {
|