n8n-nodes-soniox-api 0.5.4 → 0.6.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.
- package/LICENSE +21 -21
- package/README.md +227 -226
- package/dist/credentials/SonioxApi.credentials.js +36 -38
- package/dist/credentials/soniox.svg +10 -10
- package/dist/nodes/Soniox/GenericFunctions.js +2 -3
- package/dist/nodes/Soniox/Soniox.node.js +98 -464
- package/dist/nodes/Soniox/descriptions/TranscriptionDescription.js +57 -2
- package/dist/nodes/Soniox/handlers/FileHandler.d.ts +2 -0
- package/dist/nodes/Soniox/handlers/FileHandler.js +100 -0
- package/dist/nodes/Soniox/handlers/ModelHandler.d.ts +2 -0
- package/dist/nodes/Soniox/handlers/ModelHandler.js +15 -0
- package/dist/nodes/Soniox/handlers/TranscriptionHandler.d.ts +2 -0
- package/dist/nodes/Soniox/handlers/TranscriptionHandler.js +348 -0
- package/dist/nodes/Soniox/soniox.svg +10 -10
- package/index.js +2 -2
- package/package.json +71 -66
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Konstantin
|
|
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.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Konstantin
|
|
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
CHANGED
|
@@ -1,226 +1,227 @@
|
|
|
1
|
-
# n8n-nodes-soniox-api
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
[
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
**
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
24
|
-
[
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
npm
|
|
59
|
-
npm
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
|
|
75
|
-
- **
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
- **
|
|
80
|
-
- **Get** —
|
|
81
|
-
- **
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
- **Create** → use **Transcribe** instead
|
|
90
|
-
- **
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
- **API
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
-
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
-
|
|
123
|
-
-
|
|
124
|
-
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
"
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
"
|
|
137
|
-
"
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
- ✅ **
|
|
161
|
-
- ✅ **
|
|
162
|
-
- ✅ **
|
|
163
|
-
- ✅ **
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
- [
|
|
169
|
-
- [Soniox
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
npm
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
npm run
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
n8n
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
1
|
+
# n8n-nodes-soniox-api
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/n8n-nodes-soniox-api)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://docs.n8n.io/integrations/community-nodes/)
|
|
6
|
+
|
|
7
|
+
This is an n8n community node that integrates [Soniox Speech-to-Text API](https://soniox.com/) — a high-accuracy, multilingual speech recognition system.
|
|
8
|
+
|
|
9
|
+
**Features:**
|
|
10
|
+
- 🎯 **One-node transcription** (like Whisper node)
|
|
11
|
+
- 🌊 **Streaming Uploads** — Efficiently handle large files without memory issues
|
|
12
|
+
- 🧹 **Auto-Cleanup** — Options to automatically delete files and transcriptions from Soniox servers
|
|
13
|
+
- 🌍 **60+ languages supported**
|
|
14
|
+
- 🎭 **Speaker diarization**
|
|
15
|
+
- 🔄 **Real-time translations**
|
|
16
|
+
- ⚡ **Async processing with auto-polling**
|
|
17
|
+
|
|
18
|
+
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
|
|
19
|
+
|
|
20
|
+
[Installation](#installation) ·
|
|
21
|
+
[Operations](#operations) ·
|
|
22
|
+
[Credentials](#credentials) ·
|
|
23
|
+
[Usage](#usage) ·
|
|
24
|
+
[Resources](#resources)
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
### n8n Community Nodes
|
|
29
|
+
|
|
30
|
+
1. Go to **Settings → Community Nodes** in your n8n instance
|
|
31
|
+
2. Click **Install** and enter: `n8n-nodes-soniox-api`
|
|
32
|
+
3. Click **Install**
|
|
33
|
+
4. Restart n8n to load the node
|
|
34
|
+
|
|
35
|
+
### Manual Installation
|
|
36
|
+
|
|
37
|
+
To get started locally, install the node in your n8n root directory:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
cd ~/.n8n
|
|
41
|
+
npm install n8n-nodes-soniox-api
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
For Docker-based n8n installations, add the package to your n8n installation:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
docker exec -it n8n npm install n8n-nodes-soniox-api
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Development
|
|
51
|
+
|
|
52
|
+
For local development and testing:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
git clone https://github.com/mazixs/n8n-nodes-soniox-api.git
|
|
56
|
+
cd n8n-nodes-soniox-api
|
|
57
|
+
npm install
|
|
58
|
+
npm run build
|
|
59
|
+
npm link
|
|
60
|
+
|
|
61
|
+
# Link to your n8n installation
|
|
62
|
+
cd ~/.n8n
|
|
63
|
+
npm link n8n-nodes-soniox-api
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Operations
|
|
67
|
+
|
|
68
|
+
### Transcription Operations (Recommended)
|
|
69
|
+
- **Transcribe** 🆕 — All-in-one audio transcription (like Whisper node)
|
|
70
|
+
- Input: Binary audio data
|
|
71
|
+
- Output: Complete transcript with text + tokens + metadata
|
|
72
|
+
- Automatically handles: upload → create → wait → get transcript
|
|
73
|
+
- Configurable: model, language, speaker diarization, translations, timeout
|
|
74
|
+
- **Get** — Retrieve existing transcription result by ID
|
|
75
|
+
- **List** — List all transcriptions (with pagination)
|
|
76
|
+
|
|
77
|
+
### File Operations (Advanced)
|
|
78
|
+
- **Upload** — Upload audio files (multipart/form-data support)
|
|
79
|
+
- **Get** — Retrieve file by ID
|
|
80
|
+
- **Get All** — List all files (with pagination)
|
|
81
|
+
- **Delete** — Delete a file
|
|
82
|
+
|
|
83
|
+
### Model Operations
|
|
84
|
+
- **Get All** — List available speech recognition models
|
|
85
|
+
|
|
86
|
+
### Deprecated Operations
|
|
87
|
+
The following operations still work but will be removed in v1.0.0:
|
|
88
|
+
- **Create** → use **Transcribe** instead
|
|
89
|
+
- **Create and Wait** → use **Transcribe** instead
|
|
90
|
+
- **Get By File** → use **Get** instead
|
|
91
|
+
|
|
92
|
+
## Credentials
|
|
93
|
+
|
|
94
|
+
### Setting up Credentials
|
|
95
|
+
|
|
96
|
+
1. In n8n, navigate to **Credentials → Add Credential → Soniox API**
|
|
97
|
+
2. Enter your credentials:
|
|
98
|
+
- **API Key**: Get your API key from [console.soniox.com](https://console.soniox.com/)
|
|
99
|
+
- **API URL**: `https://api.soniox.com/v1` (default)
|
|
100
|
+
3. Click **Save**
|
|
101
|
+
|
|
102
|
+
## Usage
|
|
103
|
+
|
|
104
|
+
### Quick Start (Recommended)
|
|
105
|
+
|
|
106
|
+
The simplest way to transcribe audio - just **one node**:
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
[Read Binary File] → [Soniox: Transcribe] → Done!
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Node Configuration:**
|
|
113
|
+
|
|
114
|
+
**Soniox: Transcribe**
|
|
115
|
+
- Resource: `Transcription`
|
|
116
|
+
- Operation: `Transcribe`
|
|
117
|
+
- Binary Property: `data`
|
|
118
|
+
- Model: `Realtime or Async` (or any model from dropdown)
|
|
119
|
+
- Additional Fields:
|
|
120
|
+
- Language: `en` (optional, auto-detected if not specified)
|
|
121
|
+
- Context: Domain-specific terms (optional)
|
|
122
|
+
- Translation Languages: `ru,es,fr` (optional)
|
|
123
|
+
- Enable Speaker Diarization: `true` (optional)
|
|
124
|
+
- Delete Audio File: `true` (default: true) - Clean up file after transcription
|
|
125
|
+
- Delete Transcription: `true` (default: false) - Delete transcription from server after retrieval
|
|
126
|
+
|
|
127
|
+
**Output:**
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"transcript": {
|
|
131
|
+
"text": "Full transcribed text here",
|
|
132
|
+
"tokens": [
|
|
133
|
+
{"text": "Hello", "start_ms": 10, "confidence": 0.95}
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
"status": "completed",
|
|
137
|
+
"model": "stt-async-v3",
|
|
138
|
+
"audio_duration_ms": 16079
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Advanced Workflow (Multiple Nodes)
|
|
143
|
+
|
|
144
|
+
For more control, use separate nodes:
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
[Read Binary File]
|
|
148
|
+
↓
|
|
149
|
+
[Soniox: File Upload]
|
|
150
|
+
↓
|
|
151
|
+
[Soniox: Create and Wait]
|
|
152
|
+
↓
|
|
153
|
+
[Process Result]
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
**Note:** The advanced workflow requires 2-3 nodes. We recommend using **Transcribe** for simplicity.
|
|
157
|
+
|
|
158
|
+
## Features
|
|
159
|
+
|
|
160
|
+
- ✅ **Retry Logic** — Automatic retry with exponential backoff for failed requests
|
|
161
|
+
- ✅ **Rate Limiting** — Smart handling of 429 responses with Retry-After headers
|
|
162
|
+
- ✅ **Timeout Control** — Configurable timeouts for API and file upload operations
|
|
163
|
+
- ✅ **Type Safety** — Full TypeScript implementation with n8n-workflow types
|
|
164
|
+
- ✅ **Error Handling** — Comprehensive error messages for debugging
|
|
165
|
+
|
|
166
|
+
## Resources
|
|
167
|
+
|
|
168
|
+
- [n8n community nodes documentation](https://docs.n8n.io/integrations/community-nodes/)
|
|
169
|
+
- [Soniox API Documentation](https://soniox.com/docs/stt/api-reference)
|
|
170
|
+
- [Soniox Console](https://console.soniox.com/)
|
|
171
|
+
|
|
172
|
+
## Development
|
|
173
|
+
|
|
174
|
+
### Build
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
npm install
|
|
178
|
+
npm run build
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Lint
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
npm run lint
|
|
185
|
+
npm run lintfix # Auto-fix issues
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Testing
|
|
189
|
+
|
|
190
|
+
Link the node to your n8n installation:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
npm run build && npm link
|
|
194
|
+
cd ~/.n8n && npm link n8n-nodes-soniox-api
|
|
195
|
+
n8n start
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Then test the node in your n8n workflows.
|
|
199
|
+
|
|
200
|
+
## Version History
|
|
201
|
+
|
|
202
|
+
See [CHANGELOG.md](./CHANGELOG.md) for detailed release notes.
|
|
203
|
+
|
|
204
|
+
## License
|
|
205
|
+
|
|
206
|
+
[MIT](LICENSE.md)
|
|
207
|
+
|
|
208
|
+
## Contributing
|
|
209
|
+
|
|
210
|
+
Contributions are welcome! Please read [CONTRIBUTING.md](./CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.
|
|
211
|
+
|
|
212
|
+
## Author
|
|
213
|
+
|
|
214
|
+
**mazix**
|
|
215
|
+
- GitHub: [@mazixs](https://github.com/mazixs)
|
|
216
|
+
- npm: [n8n-nodes-soniox-api](https://www.npmjs.com/package/n8n-nodes-soniox-api)
|
|
217
|
+
|
|
218
|
+
## Support
|
|
219
|
+
|
|
220
|
+
If you encounter issues or have questions:
|
|
221
|
+
1. Check the [documentation](./docs)
|
|
222
|
+
2. Search [existing issues](https://github.com/mazixs/n8n-nodes-soniox-api/issues)
|
|
223
|
+
3. Create a [new issue](https://github.com/mazixs/n8n-nodes-soniox-api/issues/new) if needed
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
**Made with ❤️ for the n8n community**
|
|
@@ -2,44 +2,42 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SonioxApi = void 0;
|
|
4
4
|
class SonioxApi {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
name = 'sonioxApi';
|
|
6
|
+
displayName = 'Soniox API';
|
|
7
|
+
documentationUrl = 'https://soniox.com/docs/stt/get-started';
|
|
8
|
+
icon = 'file:soniox.svg';
|
|
9
|
+
properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'API Key',
|
|
12
|
+
name: 'apiKey',
|
|
13
|
+
type: 'string',
|
|
14
|
+
typeOptions: { password: true },
|
|
15
|
+
default: '',
|
|
16
|
+
required: true,
|
|
17
|
+
description: 'The Soniox API key for authentication',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
displayName: 'API URL',
|
|
21
|
+
name: 'apiUrl',
|
|
22
|
+
type: 'string',
|
|
23
|
+
default: 'https://api.soniox.com/v1',
|
|
24
|
+
description: 'The base URL for Soniox API',
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
authenticate = {
|
|
28
|
+
type: 'generic',
|
|
29
|
+
properties: {
|
|
30
|
+
headers: {
|
|
31
|
+
'Authorization': '={{`Bearer ${$credentials.apiKey}`}}',
|
|
19
32
|
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
type: 'generic',
|
|
30
|
-
properties: {
|
|
31
|
-
headers: {
|
|
32
|
-
'Authorization': '={{`Bearer ${$credentials.apiKey}`}}',
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
this.test = {
|
|
37
|
-
request: {
|
|
38
|
-
baseURL: '={{$credentials.apiUrl}}',
|
|
39
|
-
url: '/models',
|
|
40
|
-
method: 'GET',
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
}
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
test = {
|
|
36
|
+
request: {
|
|
37
|
+
baseURL: '={{$credentials.apiUrl}}',
|
|
38
|
+
url: '/models',
|
|
39
|
+
method: 'GET',
|
|
40
|
+
},
|
|
41
|
+
};
|
|
44
42
|
}
|
|
45
43
|
exports.SonioxApi = SonioxApi;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
<svg viewBox="-5 -15 110 50" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<title>Soniox</title>
|
|
3
|
-
<g fill="#FFFFFF">
|
|
4
|
-
<path d="m0 14.866 2.1606-3.5214c1.8927 1.2576 3.9669 1.8995 5.6694 1.8995 1.0025 0 1.4606-0.3036 1.4606-0.8847v-0.0607c0-0.6419-0.9161-0.9194-2.6532-1.4138-3.2582-0.8587-5.8509-1.9602-5.8509-5.2995v-0.06938c0-3.5214 2.8088-5.4903 6.6114-5.4903 2.4112 0 4.9089 0.70255 6.8016 1.9342l-1.9791 3.6775c-1.7112-0.95408-3.5693-1.5352-4.8744-1.5352-0.88152 0-1.3396 0.33827-1.3396 0.79796v0.06071c0 0.64184 0.94202 0.95409 2.6792 1.4745 3.2582 0.91939 5.8509 2.0556 5.8509 5.2735v0.0607c0 3.6515-2.7137 5.551-6.741 5.551-2.7656-0.0087-5.5052-0.798-7.7955-2.4546z"/>
|
|
5
|
-
<path d="m16.135 8.7342v-0.06071c0-4.7184 3.8372-8.6735 9.1436-8.6735 5.2719 0 9.0832 3.8944 9.0832 8.6127v0.06072c0 4.7184-3.8372 8.6735-9.1437 8.6735-5.2718 0-9.0831-3.8944-9.0831-8.6128zm12.583 0v-0.06071c0-2.0209-1.4606-3.7383-3.5088-3.7383-2.1001 0-3.4483 1.6826-3.4483 3.6775v0.06072c0 2.0209 1.4605 3.7383 3.5088 3.7383 2.1087 0 3.4483-1.6827 3.4483-3.6776z"/>
|
|
6
|
-
<path d="m36.877 0.36428h5.7904v2.3332c1.063-1.3791 2.5927-2.6974 4.9348-2.6974 3.5089 0 5.609 2.3332 5.609 6.0974v10.85h-5.7905v-8.977c0-1.8041-0.942-2.7929-2.3161-2.7929-1.4001 0-2.4372 0.9801-2.4372 2.7929v8.977h-5.7904z"/>
|
|
7
|
-
<path d="m55.951 0.36426h5.7904v16.584h-5.7904z"/>
|
|
8
|
-
<path d="m64.29 8.7342v-0.06071c0-4.7184 3.8373-8.6735 9.1437-8.6735 5.2719 0 9.0832 3.8944 9.0832 8.6127v0.06072c0 4.7184-3.8372 8.6735-9.1437 8.6735-5.2719 0-9.0832-3.8944-9.0832-8.6128zm12.592 0v-0.06071c0-2.0209-1.4605-3.7383-3.5088-3.7383-2.1001 0-3.4483 1.6826-3.4483 3.6775v0.06072c0 2.0209 1.4606 3.7383 3.5088 3.7383 2.1088 0 3.4483-1.6827 3.4483-3.6776z"/>
|
|
9
|
-
<path d="m88.082 8.578-5.4533-8.2138h6.2484l2.4372 4.0765 2.4371-4.0765h6.1275l-5.4274 8.1791 5.5484 8.3959h-6.2225l-2.5582-4.2587-2.5927 4.2587h-6.0929z"/>
|
|
10
|
-
</g>
|
|
1
|
+
<svg viewBox="-5 -15 110 50" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<title>Soniox</title>
|
|
3
|
+
<g fill="#FFFFFF">
|
|
4
|
+
<path d="m0 14.866 2.1606-3.5214c1.8927 1.2576 3.9669 1.8995 5.6694 1.8995 1.0025 0 1.4606-0.3036 1.4606-0.8847v-0.0607c0-0.6419-0.9161-0.9194-2.6532-1.4138-3.2582-0.8587-5.8509-1.9602-5.8509-5.2995v-0.06938c0-3.5214 2.8088-5.4903 6.6114-5.4903 2.4112 0 4.9089 0.70255 6.8016 1.9342l-1.9791 3.6775c-1.7112-0.95408-3.5693-1.5352-4.8744-1.5352-0.88152 0-1.3396 0.33827-1.3396 0.79796v0.06071c0 0.64184 0.94202 0.95409 2.6792 1.4745 3.2582 0.91939 5.8509 2.0556 5.8509 5.2735v0.0607c0 3.6515-2.7137 5.551-6.741 5.551-2.7656-0.0087-5.5052-0.798-7.7955-2.4546z"/>
|
|
5
|
+
<path d="m16.135 8.7342v-0.06071c0-4.7184 3.8372-8.6735 9.1436-8.6735 5.2719 0 9.0832 3.8944 9.0832 8.6127v0.06072c0 4.7184-3.8372 8.6735-9.1437 8.6735-5.2718 0-9.0831-3.8944-9.0831-8.6128zm12.583 0v-0.06071c0-2.0209-1.4606-3.7383-3.5088-3.7383-2.1001 0-3.4483 1.6826-3.4483 3.6775v0.06072c0 2.0209 1.4605 3.7383 3.5088 3.7383 2.1087 0 3.4483-1.6827 3.4483-3.6776z"/>
|
|
6
|
+
<path d="m36.877 0.36428h5.7904v2.3332c1.063-1.3791 2.5927-2.6974 4.9348-2.6974 3.5089 0 5.609 2.3332 5.609 6.0974v10.85h-5.7905v-8.977c0-1.8041-0.942-2.7929-2.3161-2.7929-1.4001 0-2.4372 0.9801-2.4372 2.7929v8.977h-5.7904z"/>
|
|
7
|
+
<path d="m55.951 0.36426h5.7904v16.584h-5.7904z"/>
|
|
8
|
+
<path d="m64.29 8.7342v-0.06071c0-4.7184 3.8373-8.6735 9.1437-8.6735 5.2719 0 9.0832 3.8944 9.0832 8.6127v0.06072c0 4.7184-3.8372 8.6735-9.1437 8.6735-5.2719 0-9.0832-3.8944-9.0832-8.6128zm12.592 0v-0.06071c0-2.0209-1.4605-3.7383-3.5088-3.7383-2.1001 0-3.4483 1.6826-3.4483 3.6775v0.06072c0 2.0209 1.4606 3.7383 3.5088 3.7383 2.1088 0 3.4483-1.6827 3.4483-3.6776z"/>
|
|
9
|
+
<path d="m88.082 8.578-5.4533-8.2138h6.2484l2.4372 4.0765 2.4371-4.0765h6.1275l-5.4274 8.1791 5.5484 8.3959h-6.2225l-2.5582-4.2587-2.5927 4.2587h-6.0929z"/>
|
|
10
|
+
</g>
|
|
11
11
|
</svg>
|
|
@@ -12,7 +12,6 @@ async function delay(attempt) {
|
|
|
12
12
|
return new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
13
13
|
}
|
|
14
14
|
async function sonioxApiRequest(method, endpoint, body = {}, qs = {}, uri, option = {}) {
|
|
15
|
-
var _a, _b;
|
|
16
15
|
const credentials = await this.getCredentials('sonioxApi');
|
|
17
16
|
const options = {
|
|
18
17
|
method,
|
|
@@ -41,7 +40,7 @@ async function sonioxApiRequest(method, endpoint, body = {}, qs = {}, uri, optio
|
|
|
41
40
|
}
|
|
42
41
|
catch (error) {
|
|
43
42
|
lastError = error;
|
|
44
|
-
const statusCode = error.statusCode ||
|
|
43
|
+
const statusCode = error.statusCode || error.response?.statusCode;
|
|
45
44
|
// Проверяем, нужен ли retry
|
|
46
45
|
const shouldRetry = attempt < constants_1.RETRY_CONFIG.MAX_RETRIES &&
|
|
47
46
|
(constants_1.RETRYABLE_STATUS_CODES.includes(statusCode) || error.code === 'ETIMEDOUT' || error.code === 'ECONNRESET');
|
|
@@ -50,7 +49,7 @@ async function sonioxApiRequest(method, endpoint, body = {}, qs = {}, uri, optio
|
|
|
50
49
|
}
|
|
51
50
|
// Обработка rate limiting (429)
|
|
52
51
|
if (statusCode === 429) {
|
|
53
|
-
const retryAfter =
|
|
52
|
+
const retryAfter = error.response?.headers['retry-after'];
|
|
54
53
|
if (retryAfter) {
|
|
55
54
|
const waitMs = parseInt(retryAfter, 10) * 1000;
|
|
56
55
|
await new Promise((resolve) => setTimeout(resolve, waitMs));
|