@breeze.blue/sdk 0.8.0 → 0.10.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/CHANGELOG.md CHANGED
@@ -1,6 +1,16 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
3
+ ## 0.10.0
4
+
5
+ - Added typed Voice Metadata codes and camelCase response fields for gender,
6
+ age, tone, and accent. `voices.edit(...)` uses `null` or an empty tone array
7
+ to clear metadata, and `voices.savePreview(...)` accepts metadata when saving
8
+ a preview.
9
+
10
+ ## 0.9.0
11
+
12
+ - Added language-aware voice search and language metadata for voice results,
13
+ preview saves, and saved-voice edits.
4
14
 
5
15
  ## 0.8.0
6
16
 
package/README.md CHANGED
@@ -449,17 +449,32 @@ await save(audio, "preview.mp3");
449
449
  const saved = await client.voices.savePreview({
450
450
  generatedVoiceId,
451
451
  voiceName: "Documentary narrator",
452
+ languageCode: "en",
453
+ gender: "neutral",
454
+ age: "middle_aged",
455
+ tone: ["warm", "articulate"],
456
+ accent: "american",
452
457
  });
453
458
  ```
454
459
 
455
460
  Edit, tune settings, or delete a saved voice:
456
461
 
457
462
  ```ts
458
- await client.voices.edit(saved.voiceId, { name: "Renamed narrator" });
463
+ await client.voices.edit(saved.voiceId, {
464
+ name: "Renamed narrator",
465
+ languageCode: "en",
466
+ tone: ["calm", "measured"],
467
+ });
468
+ // null clears nullable metadata; [] clears tone. Omitted fields remain unchanged.
469
+ await client.voices.edit(saved.voiceId, { accent: null, tone: [] });
459
470
  await client.voices.editSettings(saved.voiceId, { guidanceScale: 1.2 });
460
471
  await client.voices.delete(saved.voiceId);
461
472
  ```
462
473
 
474
+ Voice Metadata uses stable code values. `gender`, `age`, and `accent` may be
475
+ `null`; `tone` contains up to three distinct codes. English and Chinese use
476
+ different accent code sets, and other languages require `accent: null`.
477
+
463
478
  ## History, Models, and Account
464
479
 
465
480
  ```ts
package/dist/client.js CHANGED
@@ -1546,6 +1546,11 @@ class VoicesResource {
1546
1546
  primaryCategoryCode: request.primaryCategoryCode,
1547
1547
  visibility: request.visibility,
1548
1548
  playedNotSelectedVoiceIds: request.playedNotSelectedVoiceIds,
1549
+ languageCode: request.languageCode,
1550
+ gender: request.gender,
1551
+ age: request.age,
1552
+ tone: request.tone,
1553
+ accent: request.accent,
1549
1554
  }, options);
1550
1555
  }
1551
1556
  }
@@ -1694,11 +1699,29 @@ function voiceEditForm(request) {
1694
1699
  appendOptional(form, "labels", request.labels ? JSON.stringify(request.labels) : undefined);
1695
1700
  appendOptional(form, "primary_category_code", request.primaryCategoryCode);
1696
1701
  appendOptional(form, "visibility", request.visibility);
1702
+ appendOptional(form, "language_code", request.languageCode);
1703
+ appendNullable(form, "gender", request.gender);
1704
+ appendNullable(form, "age", request.age);
1705
+ if (request.tone !== undefined) {
1706
+ if (request.tone.length === 0) {
1707
+ form.append("tone", "");
1708
+ }
1709
+ else {
1710
+ for (const tone of request.tone)
1711
+ form.append("tone", tone);
1712
+ }
1713
+ }
1714
+ appendNullable(form, "accent", request.accent);
1697
1715
  for (const file of normalizeFiles(request.file, request.files, { required: false })) {
1698
1716
  appendFile(form, "files", file);
1699
1717
  }
1700
1718
  return form;
1701
1719
  }
1720
+ function appendNullable(form, key, value) {
1721
+ if (value === undefined)
1722
+ return;
1723
+ form.set(key, value ?? "");
1724
+ }
1702
1725
  function appendOptional(form, key, value) {
1703
1726
  if (value === undefined)
1704
1727
  return;
package/dist/index.d.ts CHANGED
@@ -3,3 +3,4 @@ export { BreezeBlueAPIError, BreezeBlueAuthenticationError, BreezeBlueBadRequest
3
3
  export { BreezeBlueClient, ManagedRealtimeTextToSpeechConnection, RealtimeTextToSpeechConnection, } from "./client.js";
4
4
  export { SDK_NAME, SDK_VERSION } from "./version.js";
5
5
  export type * from "./types.js";
6
+ export * from "./voice-metadata.js";
package/dist/index.js CHANGED
@@ -2,3 +2,4 @@ export { AudioResponse } from "./audio.js";
2
2
  export { BreezeBlueAPIError, BreezeBlueAuthenticationError, BreezeBlueBadRequestError, BreezeBlueConfigurationError, BreezeBlueConflictError, BreezeBlueError, BreezeBlueForbiddenError, BreezeBlueGenerationNotReadyError, BreezeBlueInsufficientCreditsError, BreezeBlueNotFoundError, BreezeBlueRateLimitError, BreezeBlueRealtimeError, BreezeBlueServiceUnavailableError, BreezeBlueUpstreamError, BreezeBlueValidationError, } from "./errors.js";
3
3
  export { BreezeBlueClient, ManagedRealtimeTextToSpeechConnection, RealtimeTextToSpeechConnection, } from "./client.js";
4
4
  export { SDK_NAME, SDK_VERSION } from "./version.js";
5
+ export * from "./voice-metadata.js";
package/dist/types.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { VoiceAccent, VoiceAge, VoiceGender, VoiceTone } from "./voice-metadata.js";
1
2
  export type JsonObject = Record<string, unknown>;
2
3
  export type BreezeBlueFetch = typeof fetch;
3
4
  export interface BreezeBlueClientOptions {
@@ -309,6 +310,11 @@ export interface Voice {
309
310
  createdAtUnix?: number | null;
310
311
  primaryCategoryCode?: string | null;
311
312
  visibility?: string | null;
313
+ languageCode: string;
314
+ gender: VoiceGender | null;
315
+ age: VoiceAge | null;
316
+ tone: VoiceTone[];
317
+ accent: VoiceAccent | null;
312
318
  [key: string]: unknown;
313
319
  }
314
320
  export interface SavedVoice {
@@ -320,6 +326,11 @@ export interface SavedVoice {
320
326
  createdAtUnix?: number | null;
321
327
  primaryCategoryCode?: string | null;
322
328
  visibility?: string | null;
329
+ languageCode: string;
330
+ gender: VoiceGender | null;
331
+ age: VoiceAge | null;
332
+ tone: VoiceTone[];
333
+ accent: VoiceAccent | null;
323
334
  }
324
335
  export interface VoiceList {
325
336
  voices: Voice[];
@@ -331,6 +342,7 @@ export interface VoiceList {
331
342
  }
332
343
  export interface VoiceSearchParams {
333
344
  search?: string;
345
+ languageCode?: string;
334
346
  origin?: "designed" | "cloned" | string;
335
347
  voiceType?: "all" | "default" | "personal" | string;
336
348
  sort?: "created_at_unix" | "name" | string;
@@ -368,6 +380,11 @@ export interface VoiceEditRequest {
368
380
  labels?: Record<string, string>;
369
381
  primaryCategoryCode?: string;
370
382
  visibility?: "private" | "public" | string;
383
+ languageCode?: string;
384
+ gender?: VoiceGender | null;
385
+ age?: VoiceAge | null;
386
+ tone?: VoiceTone[];
387
+ accent?: VoiceAccent | null;
371
388
  file?: UploadData | UploadFile;
372
389
  files?: Array<UploadData | UploadFile>;
373
390
  }
@@ -401,6 +418,11 @@ export interface SaveVoiceRequest {
401
418
  primaryCategoryCode?: string;
402
419
  visibility?: "private" | "public" | string;
403
420
  playedNotSelectedVoiceIds?: string[];
421
+ languageCode?: string;
422
+ gender?: VoiceGender | null;
423
+ age?: VoiceAge | null;
424
+ tone?: VoiceTone[];
425
+ accent?: VoiceAccent | null;
404
426
  }
405
427
  export interface HistoryItem {
406
428
  historyItemId: string;
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION = "0.8.0";
1
+ export declare const SDK_VERSION = "0.10.0";
2
2
  export declare const SDK_NAME = "@breeze.blue/sdk";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const SDK_VERSION = "0.8.0";
1
+ export const SDK_VERSION = "0.10.0";
2
2
  export const SDK_NAME = "@breeze.blue/sdk";
@@ -0,0 +1,11 @@
1
+ export declare const VOICE_GENDER_CODES: readonly ["male", "female", "neutral"];
2
+ export declare const VOICE_AGE_CODES: readonly ["child", "young", "middle_aged", "old"];
3
+ export declare const VOICE_TONE_CODES: readonly ["warm", "calm", "bright", "gentle", "energetic", "authoritative", "sincere", "weary", "precise", "refined", "urgent", "friendly", "articulate", "steady", "playful", "compassionate", "reflective", "measured", "rhythmic", "passionate"];
4
+ export declare const VOICE_ACCENT_CODES_BY_LANGUAGE: {
5
+ readonly en: readonly ["american", "british", "scottish", "irish", "australian", "canadian", "us_southern", "us_new_york", "indian", "south_african", "russian", "japanese", "korean", "chinese"];
6
+ readonly zh: readonly ["mandarin_guangdong", "mandarin_northeastern", "mandarin_shaanxi", "mandarin_shanghai", "mandarin_sichuan", "mandarin_yunnan", "mandarin_henan", "cantonese"];
7
+ };
8
+ export type VoiceGender = (typeof VOICE_GENDER_CODES)[number];
9
+ export type VoiceAge = (typeof VOICE_AGE_CODES)[number];
10
+ export type VoiceTone = (typeof VOICE_TONE_CODES)[number];
11
+ export type VoiceAccent = (typeof VOICE_ACCENT_CODES_BY_LANGUAGE)[keyof typeof VOICE_ACCENT_CODES_BY_LANGUAGE][number];
@@ -0,0 +1,8 @@
1
+ // Generated from contracts/voice-metadata.json. Do not edit manually.
2
+ export const VOICE_GENDER_CODES = ["male", "female", "neutral"];
3
+ export const VOICE_AGE_CODES = ["child", "young", "middle_aged", "old"];
4
+ export const VOICE_TONE_CODES = ["warm", "calm", "bright", "gentle", "energetic", "authoritative", "sincere", "weary", "precise", "refined", "urgent", "friendly", "articulate", "steady", "playful", "compassionate", "reflective", "measured", "rhythmic", "passionate"];
5
+ export const VOICE_ACCENT_CODES_BY_LANGUAGE = {
6
+ en: ["american", "british", "scottish", "irish", "australian", "canadian", "us_southern", "us_new_york", "indian", "south_african", "russian", "japanese", "korean", "chinese"],
7
+ zh: ["mandarin_guangdong", "mandarin_northeastern", "mandarin_shaanxi", "mandarin_shanghai", "mandarin_sichuan", "mandarin_yunnan", "mandarin_henan", "cantonese"],
8
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@breeze.blue/sdk",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "description": "ESM-first TypeScript SDK for the Breeze Blue Developer API.",
5
5
  "license": "MIT",
6
6
  "author": "Breeze Blue <support@breeze.blue>",