n8n-nodes-soniox-api 0.4.0 → 0.4.2

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/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # n8n-nodes-soniox-api
2
2
 
3
+ WIP VERSION! NOT FOR PRODUCTION USE!
4
+ Has not working yet!
5
+
3
6
  [![npm version](https://img.shields.io/npm/v/n8n-nodes-soniox-api.svg)](https://www.npmjs.com/package/n8n-nodes-soniox-api)
4
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
8
  [![n8n Community Node](https://img.shields.io/badge/n8n-Community%20Node-blue)](https://docs.n8n.io/integrations/community-nodes/)
@@ -266,9 +266,9 @@ class Soniox {
266
266
  if (additionalFields.includeNonFinal)
267
267
  body.include_nonfinal = additionalFields.includeNonFinal;
268
268
  const createResponse = await GenericFunctions_1.sonioxApiRequest.call(this, 'POST', '/transcriptions', body);
269
- const transcriptionId = createResponse.transcription_id;
269
+ const transcriptionId = createResponse.transcription_id || createResponse.id;
270
270
  if (!transcriptionId) {
271
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Failed to create transcription', { itemIndex: i });
271
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Failed to create transcription: API did not return transcription_id or id. Response: ${JSON.stringify(createResponse)}`, { itemIndex: i });
272
272
  }
273
273
  const startTime = Date.now();
274
274
  const maxWaitMs = maxWaitTime * 1000;
@@ -279,12 +279,13 @@ class Soniox {
279
279
  await new Promise(resolve => setTimeout(resolve, checkIntervalMs));
280
280
  const statusResponse = await GenericFunctions_1.sonioxApiRequest.call(this, 'GET', `/transcriptions/${transcriptionId}`);
281
281
  lastStatus = statusResponse.status || '';
282
- if (lastStatus === 'completed' || lastStatus === 'COMPLETED') {
282
+ if (lastStatus === 'completed' || lastStatus === 'COMPLETED' || lastStatus === 'success' || lastStatus === 'SUCCESS') {
283
283
  transcriptionResult = statusResponse;
284
284
  break;
285
285
  }
286
- if (lastStatus === 'failed' || lastStatus === 'FAILED') {
287
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Transcription failed: ${lastStatus}`, { itemIndex: i });
286
+ if (lastStatus === 'failed' || lastStatus === 'FAILED' || lastStatus === 'error' || lastStatus === 'ERROR') {
287
+ const errorMsg = statusResponse.error_message || statusResponse.error_type || 'Unknown error';
288
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Transcription failed: ${lastStatus}. ${errorMsg}`, { itemIndex: i });
288
289
  }
289
290
  }
290
291
  if (!transcriptionResult) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-soniox-api",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "n8n node for Soniox Speech-to-Text API",
5
5
  "main": "index.js",
6
6
  "scripts": {