@loonylabs/tts-middleware 0.2.0 → 0.3.0
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 +240 -200
- package/dist/middleware/services/tts/providers/edenai-provider.d.ts.map +1 -1
- package/dist/middleware/services/tts/providers/edenai-provider.js +9 -9
- package/dist/middleware/services/tts/providers/edenai-provider.js.map +1 -1
- package/dist/middleware/services/tts/types/provider-options.types.d.ts +12 -1
- package/dist/middleware/services/tts/types/provider-options.types.d.ts.map +1 -1
- package/dist/middleware/services/tts/types/provider-options.types.js.map +1 -1
- package/package.json +102 -102
package/README.md
CHANGED
|
@@ -1,201 +1,241 @@
|
|
|
1
|
-
# @loonylabs/tts-middleware
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@loonylabs/tts-middleware)
|
|
4
|
-
[](https://opensource.org/licenses/MIT)
|
|
5
|
-
[]()
|
|
6
|
-
[]()
|
|
7
|
-
|
|
8
|
-
**Provider-agnostic Text-to-Speech (TTS) middleware infrastructure.**
|
|
9
|
-
|
|
10
|
-
Build voice-enabled applications that switch seamlessly between Azure, EdenAI, OpenAI, ElevenLabs, and more without changing your application logic. Includes standardized error handling, accurate character counting for billing, and uniform audio output.
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## ✨ Key Features
|
|
15
|
-
|
|
16
|
-
- **🔌 Provider Agnostic:** Unified API for all TTS providers. Switch providers by changing one config parameter.
|
|
17
|
-
- **☁️ Multi-Provider Support:**
|
|
18
|
-
- **Azure Speech Services:** Full support for Neural voices, emotions, and speaking styles.
|
|
19
|
-
- **EdenAI:** Access to 6+ providers (Google, OpenAI, Amazon, IBM, etc.) via a single aggregator API.
|
|
20
|
-
- **Ready for:** OpenAI, ElevenLabs, Google, Deepgram (interfaces prepared).
|
|
21
|
-
- **📝 SSML Abstraction:** Auto-generates provider-specific SSML markup (e.g., for Azure prosody/styles) from simple JSON options.
|
|
22
|
-
- **💰 Character Counting:** Precise character counting logic for billing estimation.
|
|
23
|
-
- **🛡️ Robust Error Handling:** Standardized error types (`InvalidConfigError`, `QuotaExceededError`, `NetworkError`) across all providers.
|
|
24
|
-
- **📐 TypeScript First:** Fully typed request/response objects and provider options.
|
|
25
|
-
- **🇪🇺 GDPR/DSGVO Ready:** Configurable region support (e.g., Azure Germany/Europe regions).
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## 📦 Installation
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
npm install @loonylabs/tts-middleware
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## 🚀 Quick Start
|
|
36
|
-
|
|
37
|
-
### 1. Configure Environment
|
|
38
|
-
|
|
39
|
-
Create a `.env` file in your project root:
|
|
40
|
-
|
|
41
|
-
```env
|
|
42
|
-
# Default Provider
|
|
43
|
-
TTS_DEFAULT_PROVIDER=azure
|
|
44
|
-
|
|
45
|
-
# Azure Speech Services
|
|
46
|
-
AZURE_SPEECH_KEY=your_azure_key
|
|
47
|
-
AZURE_SPEECH_REGION=germanywestcentral
|
|
48
|
-
|
|
49
|
-
# EdenAI (Optional)
|
|
50
|
-
EDENAI_API_KEY=your_edenai_key
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### 2. Basic Usage
|
|
54
|
-
|
|
55
|
-
```typescript
|
|
56
|
-
import { ttsService, TTSProvider } from '@loonylabs/tts-middleware';
|
|
57
|
-
import fs from 'fs';
|
|
58
|
-
|
|
59
|
-
async function generateSpeech() {
|
|
60
|
-
try {
|
|
61
|
-
// Synthesize speech
|
|
62
|
-
const response = await ttsService.synthesize({
|
|
63
|
-
text: "Hello! This is a test of the LoonyLabs TTS middleware.",
|
|
64
|
-
voice: { id: "en-US-JennyNeural" }, // Provider-specific voice ID
|
|
65
|
-
audio: {
|
|
66
|
-
format: "mp3",
|
|
67
|
-
speed: 1.0
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
// Save to file
|
|
72
|
-
fs.writeFileSync('output.mp3', response.audio);
|
|
73
|
-
|
|
74
|
-
console.log(`Generated audio: ${response.metadata.duration}ms`);
|
|
75
|
-
console.log(`Billed characters: ${response.billing.characters}`);
|
|
76
|
-
|
|
77
|
-
} catch (error) {
|
|
78
|
-
console.error("Synthesis failed:", error);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
generateSpeech();
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
---
|
|
86
|
-
|
|
87
|
-
## 🛠️ Advanced Usage
|
|
88
|
-
|
|
89
|
-
### Using Provider-Specific Features (e.g., Azure Emotions)
|
|
90
|
-
|
|
91
|
-
```typescript
|
|
92
|
-
const response = await ttsService.synthesize({
|
|
93
|
-
text: "I am so excited to tell you this!",
|
|
94
|
-
provider: TTSProvider.AZURE,
|
|
95
|
-
voice: { id: "en-US-JennyNeural" },
|
|
96
|
-
providerOptions: {
|
|
97
|
-
emotion: "cheerful", // Azure-specific
|
|
98
|
-
style: "chat", // Azure-specific
|
|
99
|
-
styleDegree: 1.5
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### Switching Providers Dynamically
|
|
105
|
-
|
|
106
|
-
```typescript
|
|
107
|
-
// Use EdenAI to access Google's TTS engine
|
|
108
|
-
const response = await ttsService.synthesize({
|
|
109
|
-
text: "Hello from Google via EdenAI",
|
|
110
|
-
provider: TTSProvider.EDENAI,
|
|
111
|
-
voice: { id: "en-US" },
|
|
112
|
-
providerOptions: {
|
|
113
|
-
provider: "google" // Select underlying provider
|
|
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
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
1
|
+
# @loonylabs/tts-middleware
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@loonylabs/tts-middleware)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[]()
|
|
6
|
+
[]()
|
|
7
|
+
|
|
8
|
+
**Provider-agnostic Text-to-Speech (TTS) middleware infrastructure.**
|
|
9
|
+
|
|
10
|
+
Build voice-enabled applications that switch seamlessly between Azure, EdenAI, OpenAI, ElevenLabs, and more without changing your application logic. Includes standardized error handling, accurate character counting for billing, and uniform audio output.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## ✨ Key Features
|
|
15
|
+
|
|
16
|
+
- **🔌 Provider Agnostic:** Unified API for all TTS providers. Switch providers by changing one config parameter.
|
|
17
|
+
- **☁️ Multi-Provider Support:**
|
|
18
|
+
- **Azure Speech Services:** Full support for Neural voices, emotions, and speaking styles.
|
|
19
|
+
- **EdenAI:** Access to 6+ providers (Google, OpenAI, Amazon, IBM, etc.) via a single aggregator API.
|
|
20
|
+
- **Ready for:** OpenAI, ElevenLabs, Google, Deepgram (interfaces prepared).
|
|
21
|
+
- **📝 SSML Abstraction:** Auto-generates provider-specific SSML markup (e.g., for Azure prosody/styles) from simple JSON options.
|
|
22
|
+
- **💰 Character Counting:** Precise character counting logic for billing estimation.
|
|
23
|
+
- **🛡️ Robust Error Handling:** Standardized error types (`InvalidConfigError`, `QuotaExceededError`, `NetworkError`) across all providers.
|
|
24
|
+
- **📐 TypeScript First:** Fully typed request/response objects and provider options.
|
|
25
|
+
- **🇪🇺 GDPR/DSGVO Ready:** Configurable region support (e.g., Azure Germany/Europe regions).
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 📦 Installation
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm install @loonylabs/tts-middleware
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## 🚀 Quick Start
|
|
36
|
+
|
|
37
|
+
### 1. Configure Environment
|
|
38
|
+
|
|
39
|
+
Create a `.env` file in your project root:
|
|
40
|
+
|
|
41
|
+
```env
|
|
42
|
+
# Default Provider
|
|
43
|
+
TTS_DEFAULT_PROVIDER=azure
|
|
44
|
+
|
|
45
|
+
# Azure Speech Services
|
|
46
|
+
AZURE_SPEECH_KEY=your_azure_key
|
|
47
|
+
AZURE_SPEECH_REGION=germanywestcentral
|
|
48
|
+
|
|
49
|
+
# EdenAI (Optional)
|
|
50
|
+
EDENAI_API_KEY=your_edenai_key
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 2. Basic Usage
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import { ttsService, TTSProvider } from '@loonylabs/tts-middleware';
|
|
57
|
+
import fs from 'fs';
|
|
58
|
+
|
|
59
|
+
async function generateSpeech() {
|
|
60
|
+
try {
|
|
61
|
+
// Synthesize speech
|
|
62
|
+
const response = await ttsService.synthesize({
|
|
63
|
+
text: "Hello! This is a test of the LoonyLabs TTS middleware.",
|
|
64
|
+
voice: { id: "en-US-JennyNeural" }, // Provider-specific voice ID
|
|
65
|
+
audio: {
|
|
66
|
+
format: "mp3",
|
|
67
|
+
speed: 1.0
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
// Save to file
|
|
72
|
+
fs.writeFileSync('output.mp3', response.audio);
|
|
73
|
+
|
|
74
|
+
console.log(`Generated audio: ${response.metadata.duration}ms`);
|
|
75
|
+
console.log(`Billed characters: ${response.billing.characters}`);
|
|
76
|
+
|
|
77
|
+
} catch (error) {
|
|
78
|
+
console.error("Synthesis failed:", error);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
generateSpeech();
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 🛠️ Advanced Usage
|
|
88
|
+
|
|
89
|
+
### Using Provider-Specific Features (e.g., Azure Emotions)
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
const response = await ttsService.synthesize({
|
|
93
|
+
text: "I am so excited to tell you this!",
|
|
94
|
+
provider: TTSProvider.AZURE,
|
|
95
|
+
voice: { id: "en-US-JennyNeural" },
|
|
96
|
+
providerOptions: {
|
|
97
|
+
emotion: "cheerful", // Azure-specific
|
|
98
|
+
style: "chat", // Azure-specific
|
|
99
|
+
styleDegree: 1.5
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Switching Providers Dynamically
|
|
105
|
+
|
|
106
|
+
```typescript
|
|
107
|
+
// Use EdenAI to access Google's TTS engine
|
|
108
|
+
const response = await ttsService.synthesize({
|
|
109
|
+
text: "Hello from Google via EdenAI",
|
|
110
|
+
provider: TTSProvider.EDENAI,
|
|
111
|
+
voice: { id: "en-US" },
|
|
112
|
+
providerOptions: {
|
|
113
|
+
provider: "google" // Select underlying provider
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Using OpenAI Voices via EdenAI
|
|
119
|
+
|
|
120
|
+
Access OpenAI's TTS voices (alloy, echo, fable, onyx, nova, shimmer) through EdenAI with specific voice selection:
|
|
121
|
+
|
|
122
|
+
```typescript
|
|
123
|
+
// German with OpenAI "nova" voice (female)
|
|
124
|
+
const response = await ttsService.synthesize({
|
|
125
|
+
text: "Hallo Welt! Das ist ein Test.",
|
|
126
|
+
provider: TTSProvider.EDENAI,
|
|
127
|
+
voice: { id: "de" }, // Language code
|
|
128
|
+
providerOptions: {
|
|
129
|
+
provider: "openai",
|
|
130
|
+
settings: { openai: "de_nova" } // Voice: {lang}_{voice}
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
// English with OpenAI "onyx" voice (male, deep)
|
|
135
|
+
const response = await ttsService.synthesize({
|
|
136
|
+
text: "Hello World! This is a test.",
|
|
137
|
+
provider: TTSProvider.EDENAI,
|
|
138
|
+
voice: { id: "en" },
|
|
139
|
+
providerOptions: {
|
|
140
|
+
provider: "openai",
|
|
141
|
+
settings: { openai: "en_onyx" }
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Available OpenAI Voices:**
|
|
147
|
+
| Voice | Character |
|
|
148
|
+
|-------|-----------|
|
|
149
|
+
| `alloy` | Neutral |
|
|
150
|
+
| `echo` | Male |
|
|
151
|
+
| `fable` | Expressive |
|
|
152
|
+
| `onyx` | Male, deep |
|
|
153
|
+
| `nova` | Female |
|
|
154
|
+
| `shimmer` | Female, warm |
|
|
155
|
+
|
|
156
|
+
Format: `{language}_{voice}` (e.g., `de_nova`, `en_alloy`, `fr_shimmer`)
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## 🏗️ Architecture
|
|
161
|
+
|
|
162
|
+
The middleware uses a singleton orchestrator pattern to manage provider instances.
|
|
163
|
+
|
|
164
|
+
```mermaid
|
|
165
|
+
graph TD
|
|
166
|
+
App[Your Application] -->|synthesize()| Service[TTSService]
|
|
167
|
+
Service -->|getProvider()| Registry{Provider Registry}
|
|
168
|
+
|
|
169
|
+
Registry -->|Select| Azure[AzureProvider]
|
|
170
|
+
Registry -->|Select| Eden[EdenAIProvider]
|
|
171
|
+
|
|
172
|
+
Azure -->|SSML/SDK| AzureAPI[Azure Speech API]
|
|
173
|
+
Eden -->|REST| EdenAPI[EdenAI API]
|
|
174
|
+
|
|
175
|
+
EdenAPI -.-> Google[Google TTS]
|
|
176
|
+
EdenAPI -.-> OpenAI[OpenAI TTS]
|
|
177
|
+
EdenAPI -.-> Amazon[Amazon Polly]
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## 🧩 Supported Providers
|
|
183
|
+
|
|
184
|
+
| Provider | Status | Key Features |
|
|
185
|
+
|----------|--------|--------------|
|
|
186
|
+
| **Azure** | ✅ Stable | Neural Voices, Emotions, Styles, SSML, Visemes (planned) |
|
|
187
|
+
| **EdenAI** | ✅ Stable | Aggregator for Google, OpenAI, Amazon, IBM, Microsoft |
|
|
188
|
+
| **OpenAI** | 🔮 Planned | HD Audio, Simple API |
|
|
189
|
+
| **ElevenLabs** | 🔮 Planned | Voice Cloning, High Expressivity |
|
|
190
|
+
| **Google** | 🔮 Planned | WaveNet Voices, Pitch/Volume control |
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## 🔧 Logging Configuration
|
|
195
|
+
|
|
196
|
+
The middleware includes a pluggable logger interface. By default, it uses `console`, but you can replace it with any logger (Winston, Pino, etc.).
|
|
197
|
+
|
|
198
|
+
```typescript
|
|
199
|
+
import { setLogger, silentLogger, setLogLevel } from '@loonylabs/tts-middleware';
|
|
200
|
+
|
|
201
|
+
// Disable all logging (useful for tests)
|
|
202
|
+
setLogger(silentLogger);
|
|
203
|
+
|
|
204
|
+
// Set minimum log level (debug, info, warn, error)
|
|
205
|
+
setLogLevel('warn'); // Only show warnings and errors
|
|
206
|
+
|
|
207
|
+
// Use custom logger (e.g., Winston)
|
|
208
|
+
setLogger({
|
|
209
|
+
info: (msg, meta) => winston.info(msg, meta),
|
|
210
|
+
warn: (msg, meta) => winston.warn(msg, meta),
|
|
211
|
+
error: (msg, meta) => winston.error(msg, meta),
|
|
212
|
+
debug: (msg, meta) => winston.debug(msg, meta),
|
|
213
|
+
});
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## 🧪 Testing
|
|
219
|
+
|
|
220
|
+
The project maintains high code coverage (>94%) using Jest.
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
# Run unit & integration tests
|
|
224
|
+
npm test
|
|
225
|
+
|
|
226
|
+
# Run manual verification script (requires .env)
|
|
227
|
+
npx ts-node scripts/manual-test-edenai.ts
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## 🤝 Contributing
|
|
231
|
+
|
|
232
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
|
|
233
|
+
|
|
234
|
+
Contributions are welcome! Please ensure:
|
|
235
|
+
1. **Tests:** Add tests for new features.
|
|
236
|
+
2. **Linting:** Run `npm run lint` before committing.
|
|
237
|
+
3. **Conventions:** Follow the existing project structure.
|
|
238
|
+
|
|
239
|
+
## 📄 License
|
|
240
|
+
|
|
201
241
|
[MIT](LICENSE) © 2026 LoonyLabs Team
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edenai-provider.d.ts","sourceRoot":"","sources":["../../../../../src/middleware/services/tts/providers/edenai-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAElE,OAAO,EACL,eAAe,EAEhB,MAAM,qBAAqB,CAAC;AAG7B;;GAEG;AACH,UAAU,YAAY;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAeD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,cAAe,SAAQ,eAAe;IACjD,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAEhC;;;;;OAKG;gBACS,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;IAqB1C;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IAS5B;;;;;;;;;OASG;IACG,UAAU,CACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,WAAW,CAAC;IA2DvB;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,kBAAkB;
|
|
1
|
+
{"version":3,"file":"edenai-provider.d.ts","sourceRoot":"","sources":["../../../../../src/middleware/services/tts/providers/edenai-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAElE,OAAO,EACL,eAAe,EAEhB,MAAM,qBAAqB,CAAC;AAG7B;;GAEG;AACH,UAAU,YAAY;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAeD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,cAAe,SAAQ,eAAe;IACjD,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAEhC;;;;;OAKG;gBACS,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;IAqB1C;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IAS5B;;;;;;;;;OASG;IACG,UAAU,CACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,WAAW,CAAC;IA2DvB;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,kBAAkB;IA+C1B;;;;;;;OAOG;YACW,aAAa;IAmC3B;;;;;;OAMG;YACW,wBAAwB;IA2CtC;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,eAAe;CAWxB"}
|
|
@@ -166,16 +166,16 @@ class EdenAIProvider extends base_tts_provider_1.BaseTTSProvider {
|
|
|
166
166
|
// Default to FEMALE - EdenAI requires this field
|
|
167
167
|
edenaiRequest.option = 'FEMALE';
|
|
168
168
|
}
|
|
169
|
-
// Build settings object for
|
|
170
|
-
//
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
settings.model = options.model;
|
|
169
|
+
// Build settings object for provider-specific model/voice selection
|
|
170
|
+
// Format: { "provider_name": "model_or_voice_id" }
|
|
171
|
+
// Example: { "openai": "de_nova" } or { "google": "Neural" }
|
|
172
|
+
if (options.settings) {
|
|
173
|
+
edenaiRequest.settings = options.settings;
|
|
175
174
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
175
|
+
else if (options.model) {
|
|
176
|
+
// Legacy: if model is specified without settings, build settings object
|
|
177
|
+
const providerName = (options.provider || 'google').split('/')[0];
|
|
178
|
+
edenaiRequest.settings = { [providerName]: options.model };
|
|
179
179
|
}
|
|
180
180
|
// Fallback providers (top-level)
|
|
181
181
|
if (options.fallback_providers && options.fallback_providers.length > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edenai-provider.js","sourceRoot":"","sources":["../../../../../src/middleware/services/tts/providers/edenai-provider.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAGH,oCAAuC;AACvC,2DAG6B;A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H,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACK,kBAAkB,CACxB,IAAY,EACZ,OAAe,EACf,QAA8B,EAC9B,OAA8B;QAE9B,4FAA4F;QAC5F,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAE/C,yCAAyC;QACzC,oEAAoE;QACpE,MAAM,aAAa,GAA4B;YAC7C,IAAI;YACJ,QAAQ;YACR,SAAS,EAAE,OAAO,CAAC,QAAQ,IAAI,QAAQ,EAAE,wBAAwB;SAClE,CAAC;QAEF,+DAA+D;QAC/D,yFAAyF;QACzF,gFAAgF;QAChF,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YACnB,0DAA0D;YAC1D,aAAa,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QACxC,CAAC;aAAM,CAAC;YACN,iDAAiD;YACjD,aAAa,CAAC,MAAM,GAAG,QAAQ,CAAC;QAClC,CAAC;QAED,
|
|
1
|
+
{"version":3,"file":"edenai-provider.js","sourceRoot":"","sources":["../../../../../src/middleware/services/tts/providers/edenai-provider.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAGH,oCAAuC;AACvC,2DAG6B;AAwB7B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAa,cAAe,SAAQ,mCAAe;IAIjD;;;;;OAKG;IACH,YAAY,MAA8B;QACxC,KAAK,CAAC,mBAAW,CAAC,MAAM,CAAC,CAAC;QAE1B,yDAAyD;QACzD,IAAI,CAAC,MAAM,GAAG;YACZ,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE;YAC1D,MAAM,EAAE,MAAM,EAAE,MAAM;SACvB,CAAC;QAEF,IAAI,CAAC,MAAM;YACT,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,gDAAgD,CAAC;QAEzE,yBAAyB;QACzB,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAE5B,IAA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,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;YACrD,CAAC;YAED,sBAAsB;YACtB,IAAI,cAAc,CAAC,kBAAkB,EAAE,CAAC;gBACtC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,yCAAyC,YAAY,GAAG,CAAC,CAAC;gBAC5E,MAAM,aAAa,GAAG,MAAM,KAAK,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC;gBAErE,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC;oBACtB,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,mCAAmC,EAAE;wBACpD,QAAQ,EAAE,YAAY;wBACtB,GAAG,EAAE,cAAc,CAAC,kBAAkB;qBACvC,CAAC,CAAC;oBACH,SAAS;gBACX,CAAC;gBAED,MAAM,WAAW,GAAG,MAAM,aAAa,CAAC,WAAW,EAAE,CAAC;gBACtD,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAClC,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;;;;OAYG;IACK,eAAe,CAAC,OAAe;QACrC,mDAAmD;QACnD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAEvD,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,0DAA0D;QAC1D,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AA9SD,wCA8SC"}
|
|
@@ -316,13 +316,24 @@ export interface EdenAIProviderOptions {
|
|
|
316
316
|
*/
|
|
317
317
|
provider?: 'amazon' | 'google' | 'ibm' | 'microsoft' | 'openai' | 'elevenlabs';
|
|
318
318
|
/**
|
|
319
|
-
* Model/quality tier to use
|
|
319
|
+
* Model/quality tier to use (legacy)
|
|
320
320
|
*
|
|
321
321
|
* @description Provider-specific model selection (e.g., 'Neural', 'Standard', 'Wavenet')
|
|
322
|
+
* @deprecated Use `settings` instead for provider-specific voice/model selection
|
|
322
323
|
*
|
|
323
324
|
* @example 'Neural'
|
|
324
325
|
*/
|
|
325
326
|
model?: string;
|
|
327
|
+
/**
|
|
328
|
+
* Provider-specific settings for model/voice selection
|
|
329
|
+
*
|
|
330
|
+
* @description Object mapping provider names to their model/voice IDs.
|
|
331
|
+
* This is the correct way to specify OpenAI voices via EdenAI.
|
|
332
|
+
*
|
|
333
|
+
* @example { "openai": "de_nova" }
|
|
334
|
+
* @example { "google": "Neural" }
|
|
335
|
+
*/
|
|
336
|
+
settings?: Record<string, string>;
|
|
326
337
|
/**
|
|
327
338
|
* Voice option/gender
|
|
328
339
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-options.types.d.ts","sourceRoot":"","sources":["../../../../../src/middleware/services/tts/types/provider-options.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,EACJ,KAAK,GACL,OAAO,GACP,UAAU,GACV,UAAU,GACV,WAAW,GACX,UAAU,GACV,YAAY,GACZ,SAAS,GACT,QAAQ,GACR,SAAS,GACT,YAAY,GACZ,MAAM,GACN,SAAS,GACT,aAAa,GACb,SAAS,GACT,WAAW,GACX,aAAa,CAAC;IAElB;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,EACF,MAAM,GACN,iBAAiB,GACjB,UAAU,GACV,WAAW,GACX,iBAAiB,GACjB,iBAAiB,GACjB,aAAa,GACb,SAAS,GACT,sBAAsB,GACtB,wBAAwB,GACxB,mBAAmB,GACnB,mBAAmB,GACnB,2BAA2B,CAAC;IAEhC;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACp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;IAEjB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,EACL,QAAQ,GACR,QAAQ,GACR,KAAK,GACL,WAAW,GACX,QAAQ,GACR,YAAY,CAAC;IAEjB
|
|
1
|
+
{"version":3,"file":"provider-options.types.d.ts","sourceRoot":"","sources":["../../../../../src/middleware/services/tts/types/provider-options.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,EACJ,KAAK,GACL,OAAO,GACP,UAAU,GACV,UAAU,GACV,WAAW,GACX,UAAU,GACV,YAAY,GACZ,SAAS,GACT,QAAQ,GACR,SAAS,GACT,YAAY,GACZ,MAAM,GACN,SAAS,GACT,aAAa,GACb,SAAS,GACT,WAAW,GACX,aAAa,CAAC;IAElB;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,EACF,MAAM,GACN,iBAAiB,GACjB,UAAU,GACV,WAAW,GACX,iBAAiB,GACjB,iBAAiB,GACjB,aAAa,GACb,SAAS,GACT,sBAAsB,GACtB,wBAAwB,GACxB,mBAAmB,GACnB,mBAAmB,GACnB,2BAA2B,CAAC;IAEhC;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;;;;;;;OAUG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,iBAAiB,CAAC;IAEjD;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;CAClD;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,y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O,EAAE,OAAO,GACf,OAAO,IAAI,uBAAuB,CAMpC;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,OAAO,GACf,OAAO,IAAI,qBAAqB,CAUlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-options.types.js","sourceRoot":"","sources":["../../../../../src/middleware/services/tts/types/provider-options.types.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;
|
|
1
|
+
{"version":3,"file":"provider-options.types.js","sourceRoot":"","sources":["../../../../../src/middleware/services/tts/types/provider-options.types.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAyeH,wCAQC;AAKD,0CASC;AAKD,kDAQC;AAKD,oDAQC;AAKD,8CAQC;AAKD,0CAYC;AAjFD;;GAEG;AACH,SAAgB,cAAc,CAC5B,OAAgB;IAEhB,OAAO,CACL,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,KAAK,IAAI;QAChB,CAAC,SAAS,IAAI,OAAO,IAAI,OAAO,IAAI,OAAO,CAAC,CAC7C,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,eAAe,CAC7B,OAAgB;IAEhB,OAAO,CACL,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,KAAK,IAAI;QAChB,OAAO,IAAI,OAAO;QAClB,OAAQ,OAA8B,CAAC,KAAK,KAAK,QAAQ,CAC1D,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,mBAAmB,CACjC,OAAgB;IAEhB,OAAO,CACL,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,KAAK,IAAI;QAChB,CAAC,WAAW,IAAI,OAAO,IAAI,kBAAkB,IAAI,OAAO,CAAC,CAC1D,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,oBAAoB,CAClC,OAAgB;IAEhB,OAAO,CACL,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,KAAK,IAAI;QAChB,CAAC,kBAAkB,IAAI,OAAO,IAAI,gBAAgB,IAAI,OAAO,CAAC,CAC/D,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,iBAAiB,CAC/B,OAAgB;IAEhB,OAAO,CACL,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,KAAK,IAAI;QAChB,CAAC,UAAU,IAAI,OAAO,IAAI,WAAW,IAAI,OAAO,CAAC,CAClD,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,eAAe,CAC7B,OAAgB;IAEhB,OAAO,CACL,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,KAAK,IAAI;QAChB,CAAC,eAAe,IAAI,OAAO;YACzB,gBAAgB,IAAI,OAAO;YAC3B,iBAAiB,IAAI,OAAO;YAC5B,oBAAoB,IAAI,OAAO;YAC/B,aAAa,IAAI,OAAO,CAAC,CAC5B,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@loonylabs/tts-middleware",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Provider-agnostic Text-to-Speech middleware for Azure, OpenAI, ElevenLabs, Google Cloud, and Deepgram",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"files": [
|
|
8
|
-
"dist",
|
|
9
|
-
"LICENSE",
|
|
10
|
-
"README.md"
|
|
11
|
-
],
|
|
12
|
-
"scripts": {
|
|
13
|
-
"build": "tsc",
|
|
14
|
-
"test": "jest",
|
|
15
|
-
"test:unit": "jest --testPathPattern=tests/unit",
|
|
16
|
-
"test:integration": "jest --testPathPattern=tests/integration",
|
|
17
|
-
"test:e2e": "jest --testPathPattern=tests/e2e --testPathIgnorePatterns=[]",
|
|
18
|
-
"test:watch": "jest --watch",
|
|
19
|
-
"test:coverage": "jest --coverage",
|
|
20
|
-
"test:ci": "jest --ci --coverage --maxWorkers=2",
|
|
21
|
-
"lint": "eslint src --ext .ts",
|
|
22
|
-
"format": "prettier --write \"src/**/*.ts\"",
|
|
23
|
-
"clean": "rm -rf dist coverage",
|
|
24
|
-
"prepare": "npm run build",
|
|
25
|
-
"prepublishOnly": "npm run test:ci && npm run lint"
|
|
26
|
-
},
|
|
27
|
-
"keywords": [
|
|
28
|
-
"tts",
|
|
29
|
-
"text-to-speech",
|
|
30
|
-
"azure",
|
|
31
|
-
"openai",
|
|
32
|
-
"elevenlabs",
|
|
33
|
-
"google-cloud",
|
|
34
|
-
"deepgram",
|
|
35
|
-
"middleware",
|
|
36
|
-
"provider-agnostic",
|
|
37
|
-
"speech-synthesis",
|
|
38
|
-
"voice-generation",
|
|
39
|
-
"ai-speech"
|
|
40
|
-
],
|
|
41
|
-
"author": "LoonyLabs Team",
|
|
42
|
-
"license": "MIT",
|
|
43
|
-
"repository": {
|
|
44
|
-
"type": "git",
|
|
45
|
-
"url": "git+https://github.com/loonylabs-dev/tts-middleware.git"
|
|
46
|
-
},
|
|
47
|
-
"bugs": {
|
|
48
|
-
"url": "https://github.com/loonylabs-dev/tts-middleware/issues"
|
|
49
|
-
},
|
|
50
|
-
"homepage": "https://github.com/loonylabs-dev/tts-middleware#readme",
|
|
51
|
-
"dependencies": {
|
|
52
|
-
"microsoft-cognitiveservices-speech-sdk": "^1.38.0"
|
|
53
|
-
},
|
|
54
|
-
"devDependencies": {
|
|
55
|
-
"@types/jest": "^29.5.8",
|
|
56
|
-
"@types/node": "^20.10.0",
|
|
57
|
-
"@typescript-eslint/eslint-plugin": "^6.13.0",
|
|
58
|
-
"@typescript-eslint/parser": "^6.13.0",
|
|
59
|
-
"eslint": "^8.54.0",
|
|
60
|
-
"jest": "^29.7.0",
|
|
61
|
-
"prettier": "^3.1.0",
|
|
62
|
-
"ts-jest": "^29.1.1",
|
|
63
|
-
"typescript": "^5.3.2"
|
|
64
|
-
},
|
|
65
|
-
"engines": {
|
|
66
|
-
"node": ">=18.0.0"
|
|
67
|
-
},
|
|
68
|
-
"jest": {
|
|
69
|
-
"preset": "ts-jest",
|
|
70
|
-
"testEnvironment": "node",
|
|
71
|
-
"roots": [
|
|
72
|
-
"<rootDir>/tests",
|
|
73
|
-
"<rootDir>/src"
|
|
74
|
-
],
|
|
75
|
-
"testMatch": [
|
|
76
|
-
"<rootDir>/tests/**/*.test.ts"
|
|
77
|
-
],
|
|
78
|
-
"testPathIgnorePatterns": [
|
|
79
|
-
"/node_modules/",
|
|
80
|
-
"<rootDir>/tests/e2e/"
|
|
81
|
-
],
|
|
82
|
-
"collectCoverageFrom": [
|
|
83
|
-
"src/**/*.ts",
|
|
84
|
-
"!src/**/*.d.ts",
|
|
85
|
-
"!src/**/index.ts"
|
|
86
|
-
],
|
|
87
|
-
"coverageDirectory": "coverage",
|
|
88
|
-
"coverageReporters": [
|
|
89
|
-
"text",
|
|
90
|
-
"html",
|
|
91
|
-
"lcov"
|
|
92
|
-
],
|
|
93
|
-
"coverageThreshold": {
|
|
94
|
-
"global": {
|
|
95
|
-
"branches": 85,
|
|
96
|
-
"functions": 90,
|
|
97
|
-
"lines": 90,
|
|
98
|
-
"statements": 90
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@loonylabs/tts-middleware",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Provider-agnostic Text-to-Speech middleware for Azure, OpenAI, ElevenLabs, Google Cloud, and Deepgram",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"LICENSE",
|
|
10
|
+
"README.md"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"test": "jest",
|
|
15
|
+
"test:unit": "jest --testPathPattern=tests/unit",
|
|
16
|
+
"test:integration": "jest --testPathPattern=tests/integration",
|
|
17
|
+
"test:e2e": "jest --testPathPattern=tests/e2e --testPathIgnorePatterns=[]",
|
|
18
|
+
"test:watch": "jest --watch",
|
|
19
|
+
"test:coverage": "jest --coverage",
|
|
20
|
+
"test:ci": "jest --ci --coverage --maxWorkers=2",
|
|
21
|
+
"lint": "eslint src --ext .ts",
|
|
22
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
23
|
+
"clean": "rm -rf dist coverage",
|
|
24
|
+
"prepare": "npm run build",
|
|
25
|
+
"prepublishOnly": "npm run test:ci && npm run lint"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"tts",
|
|
29
|
+
"text-to-speech",
|
|
30
|
+
"azure",
|
|
31
|
+
"openai",
|
|
32
|
+
"elevenlabs",
|
|
33
|
+
"google-cloud",
|
|
34
|
+
"deepgram",
|
|
35
|
+
"middleware",
|
|
36
|
+
"provider-agnostic",
|
|
37
|
+
"speech-synthesis",
|
|
38
|
+
"voice-generation",
|
|
39
|
+
"ai-speech"
|
|
40
|
+
],
|
|
41
|
+
"author": "LoonyLabs Team",
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"repository": {
|
|
44
|
+
"type": "git",
|
|
45
|
+
"url": "git+https://github.com/loonylabs-dev/tts-middleware.git"
|
|
46
|
+
},
|
|
47
|
+
"bugs": {
|
|
48
|
+
"url": "https://github.com/loonylabs-dev/tts-middleware/issues"
|
|
49
|
+
},
|
|
50
|
+
"homepage": "https://github.com/loonylabs-dev/tts-middleware#readme",
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"microsoft-cognitiveservices-speech-sdk": "^1.38.0"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@types/jest": "^29.5.8",
|
|
56
|
+
"@types/node": "^20.10.0",
|
|
57
|
+
"@typescript-eslint/eslint-plugin": "^6.13.0",
|
|
58
|
+
"@typescript-eslint/parser": "^6.13.0",
|
|
59
|
+
"eslint": "^8.54.0",
|
|
60
|
+
"jest": "^29.7.0",
|
|
61
|
+
"prettier": "^3.1.0",
|
|
62
|
+
"ts-jest": "^29.1.1",
|
|
63
|
+
"typescript": "^5.3.2"
|
|
64
|
+
},
|
|
65
|
+
"engines": {
|
|
66
|
+
"node": ">=18.0.0"
|
|
67
|
+
},
|
|
68
|
+
"jest": {
|
|
69
|
+
"preset": "ts-jest",
|
|
70
|
+
"testEnvironment": "node",
|
|
71
|
+
"roots": [
|
|
72
|
+
"<rootDir>/tests",
|
|
73
|
+
"<rootDir>/src"
|
|
74
|
+
],
|
|
75
|
+
"testMatch": [
|
|
76
|
+
"<rootDir>/tests/**/*.test.ts"
|
|
77
|
+
],
|
|
78
|
+
"testPathIgnorePatterns": [
|
|
79
|
+
"/node_modules/",
|
|
80
|
+
"<rootDir>/tests/e2e/"
|
|
81
|
+
],
|
|
82
|
+
"collectCoverageFrom": [
|
|
83
|
+
"src/**/*.ts",
|
|
84
|
+
"!src/**/*.d.ts",
|
|
85
|
+
"!src/**/index.ts"
|
|
86
|
+
],
|
|
87
|
+
"coverageDirectory": "coverage",
|
|
88
|
+
"coverageReporters": [
|
|
89
|
+
"text",
|
|
90
|
+
"html",
|
|
91
|
+
"lcov"
|
|
92
|
+
],
|
|
93
|
+
"coverageThreshold": {
|
|
94
|
+
"global": {
|
|
95
|
+
"branches": 85,
|
|
96
|
+
"functions": 90,
|
|
97
|
+
"lines": 90,
|
|
98
|
+
"statements": 90
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|