n8n-nodes-soniox-api 0.2.0 → 0.2.1

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,5 +1,10 @@
1
- import { IExecuteFunctions, INodeType, INodeTypeDescription, INodeExecutionData } from 'n8n-workflow';
1
+ import { IExecuteFunctions, ILoadOptionsFunctions, INodeType, INodeTypeDescription, INodeExecutionData, INodePropertyOptions } from 'n8n-workflow';
2
2
  export declare class Soniox implements INodeType {
3
3
  description: INodeTypeDescription;
4
+ methods: {
5
+ loadOptions: {
6
+ getModels(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
7
+ };
8
+ };
4
9
  execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
10
  }
@@ -58,6 +58,28 @@ class Soniox {
58
58
  ...ModelDescription_1.modelFields,
59
59
  ],
60
60
  };
61
+ this.methods = {
62
+ loadOptions: {
63
+ async getModels() {
64
+ try {
65
+ const response = await GenericFunctions_1.sonioxApiRequest.call(this, 'GET', '/models');
66
+ const models = Array.isArray(response) ? response : response.models || [];
67
+ return models.map((model) => ({
68
+ name: model.name || model.model_id || String(model),
69
+ value: model.model_id || model.name || String(model),
70
+ description: model.description,
71
+ }));
72
+ }
73
+ catch {
74
+ // Fallback if API fails
75
+ return [
76
+ { name: 'en_v2_lowlatency', value: 'en_v2_lowlatency', description: 'English v2 Low Latency' },
77
+ { name: 'en_v2', value: 'en_v2', description: 'English v2' },
78
+ ];
79
+ }
80
+ },
81
+ },
82
+ };
61
83
  }
62
84
  async execute() {
63
85
  const items = this.getInputData();
@@ -55,7 +55,10 @@ exports.transcriptionFields = [
55
55
  {
56
56
  displayName: 'Model',
57
57
  name: 'model',
58
- type: 'string',
58
+ type: 'options',
59
+ typeOptions: {
60
+ loadOptionsMethod: 'getModels',
61
+ },
59
62
  default: '',
60
63
  displayOptions: {
61
64
  show: {
@@ -63,8 +66,7 @@ exports.transcriptionFields = [
63
66
  operation: ['create'],
64
67
  },
65
68
  },
66
- description: 'The model to use for transcription',
67
- placeholder: 'e.g., en_v2_lowlatency',
69
+ description: 'The model to use for transcription (loaded from API)',
68
70
  },
69
71
  {
70
72
  displayName: 'Additional Fields',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-soniox-api",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "n8n node for Soniox Speech-to-Text API",
5
5
  "main": "index.js",
6
6
  "scripts": {