@soniox/node 2.0.1 → 2.0.3
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/dist/index.cjs +7 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -8
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +21 -8
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +7 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1731,7 +1731,7 @@ function getCommonValue(values) {
|
|
|
1731
1731
|
* Uses only `globalThis.fetch` — no Node-specific dependencies.
|
|
1732
1732
|
* Shared by both `@soniox/node` and `@soniox/client`.
|
|
1733
1733
|
*/
|
|
1734
|
-
const DEFAULT_MODEL = "tts-rt-v1
|
|
1734
|
+
const DEFAULT_MODEL = "tts-rt-v1";
|
|
1735
1735
|
const DEFAULT_LANGUAGE = "en";
|
|
1736
1736
|
const DEFAULT_AUDIO_FORMAT = "wav";
|
|
1737
1737
|
function buildPayload(options) {
|
|
@@ -1875,11 +1875,14 @@ var SonioxAuthAPI = class {
|
|
|
1875
1875
|
* const ttsKey = await client.auth.createTemporaryKey({
|
|
1876
1876
|
* usage_type: 'tts_rt',
|
|
1877
1877
|
* expires_in_seconds: 300,
|
|
1878
|
+
* single_use: true,
|
|
1879
|
+
* max_session_duration_seconds: 600,
|
|
1878
1880
|
* });
|
|
1879
1881
|
* ```
|
|
1880
1882
|
*/
|
|
1881
1883
|
async createTemporaryKey(request, signal) {
|
|
1882
1884
|
if (!Number.isFinite(request.expires_in_seconds) || request.expires_in_seconds < 1 || request.expires_in_seconds > 3600) throw new Error("expires_in_seconds must be a finite number between 1 and 3600");
|
|
1885
|
+
if (request.max_session_duration_seconds !== void 0 && (!Number.isFinite(request.max_session_duration_seconds) || request.max_session_duration_seconds < 1 || request.max_session_duration_seconds > 18e3)) throw new Error("max_session_duration_seconds must be a finite number between 1 and 18000");
|
|
1883
1886
|
return (await this.http.request({
|
|
1884
1887
|
method: "POST",
|
|
1885
1888
|
path: "/v1/auth/temporary-api-key",
|
|
@@ -4274,7 +4277,7 @@ function combineAbortSignals(...signals) {
|
|
|
4274
4277
|
* @example TTS (single stream)
|
|
4275
4278
|
* ```typescript
|
|
4276
4279
|
* const stream = await client.realtime.tts({
|
|
4277
|
-
* model: 'tts-rt-v1
|
|
4280
|
+
* model: 'tts-rt-v1',
|
|
4278
4281
|
* voice: 'Adrian',
|
|
4279
4282
|
* language: 'en',
|
|
4280
4283
|
* audio_format: 'wav',
|
|
@@ -4288,7 +4291,7 @@ function combineAbortSignals(...signals) {
|
|
|
4288
4291
|
* ```typescript
|
|
4289
4292
|
* const conn = await client.realtime.tts.multiStream();
|
|
4290
4293
|
* const stream = await conn.stream({
|
|
4291
|
-
* model: 'tts-rt-v1
|
|
4294
|
+
* model: 'tts-rt-v1',
|
|
4292
4295
|
* voice: 'Adrian',
|
|
4293
4296
|
* language: 'en',
|
|
4294
4297
|
* audio_format: 'wav',
|
|
@@ -4359,7 +4362,7 @@ var SonioxRealtimeApi = class {
|
|
|
4359
4362
|
*
|
|
4360
4363
|
* // WebSocket TTS
|
|
4361
4364
|
* const stream = await client.realtime.tts({
|
|
4362
|
-
* model: 'tts-rt-v1
|
|
4365
|
+
* model: 'tts-rt-v1',
|
|
4363
4366
|
* voice: 'Adrian',
|
|
4364
4367
|
* language: 'en',
|
|
4365
4368
|
* audio_format: 'wav',
|