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 +3 -0
- package/dist/nodes/Soniox/Soniox.node.js +6 -5
- package/package.json +1 -1
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
|
[](https://www.npmjs.com/package/n8n-nodes-soniox-api)
|
|
4
7
|
[](https://opensource.org/licenses/MIT)
|
|
5
8
|
[](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(),
|
|
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
|
-
|
|
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) {
|