@cartesia/cartesia-js 3.0.0-b5 → 3.0.0-b7

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.
Files changed (70) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/backcompat/errors.d.mts +16 -0
  3. package/backcompat/errors.d.mts.map +1 -0
  4. package/backcompat/errors.d.ts +16 -0
  5. package/backcompat/errors.d.ts.map +1 -0
  6. package/backcompat/errors.js +46 -0
  7. package/backcompat/errors.js.map +1 -0
  8. package/backcompat/errors.mjs +40 -0
  9. package/backcompat/errors.mjs.map +1 -0
  10. package/backcompat/index.d.mts +17 -31
  11. package/backcompat/index.d.mts.map +1 -1
  12. package/backcompat/index.d.ts +17 -31
  13. package/backcompat/index.d.ts.map +1 -1
  14. package/backcompat/index.js +26 -254
  15. package/backcompat/index.js.map +1 -1
  16. package/backcompat/index.mjs +25 -253
  17. package/backcompat/index.mjs.map +1 -1
  18. package/backcompat/tts-wrapper.d.mts +69 -0
  19. package/backcompat/tts-wrapper.d.mts.map +1 -0
  20. package/backcompat/tts-wrapper.d.ts +69 -0
  21. package/backcompat/tts-wrapper.d.ts.map +1 -0
  22. package/backcompat/tts-wrapper.js +264 -0
  23. package/backcompat/tts-wrapper.js.map +1 -0
  24. package/backcompat/tts-wrapper.mjs +258 -0
  25. package/backcompat/tts-wrapper.mjs.map +1 -0
  26. package/backcompat/types.d.mts +18 -0
  27. package/backcompat/types.d.mts.map +1 -0
  28. package/backcompat/types.d.ts +18 -0
  29. package/backcompat/types.d.ts.map +1 -0
  30. package/backcompat/types.js +3 -0
  31. package/backcompat/types.js.map +1 -0
  32. package/backcompat/types.mjs +2 -0
  33. package/backcompat/types.mjs.map +1 -0
  34. package/backcompat/voice-changer-wrapper.d.mts +19 -0
  35. package/backcompat/voice-changer-wrapper.d.mts.map +1 -0
  36. package/backcompat/voice-changer-wrapper.d.ts +19 -0
  37. package/backcompat/voice-changer-wrapper.d.ts.map +1 -0
  38. package/backcompat/voice-changer-wrapper.js +49 -0
  39. package/backcompat/voice-changer-wrapper.js.map +1 -0
  40. package/backcompat/voice-changer-wrapper.mjs +45 -0
  41. package/backcompat/voice-changer-wrapper.mjs.map +1 -0
  42. package/backcompat/voices-wrapper.d.mts +36 -0
  43. package/backcompat/voices-wrapper.d.mts.map +1 -0
  44. package/backcompat/voices-wrapper.d.ts +36 -0
  45. package/backcompat/voices-wrapper.d.ts.map +1 -0
  46. package/backcompat/voices-wrapper.js +82 -0
  47. package/backcompat/voices-wrapper.js.map +1 -0
  48. package/backcompat/voices-wrapper.mjs +78 -0
  49. package/backcompat/voices-wrapper.mjs.map +1 -0
  50. package/index.d.mts +1 -1
  51. package/index.d.mts.map +1 -1
  52. package/index.d.ts +1 -1
  53. package/index.d.ts.map +1 -1
  54. package/index.js +3 -3
  55. package/index.js.map +1 -1
  56. package/index.mjs +1 -1
  57. package/index.mjs.map +1 -1
  58. package/package.json +1 -1
  59. package/src/backcompat/errors.ts +52 -0
  60. package/src/backcompat/index.ts +31 -291
  61. package/src/backcompat/tts-wrapper.ts +328 -0
  62. package/src/backcompat/types.ts +19 -0
  63. package/src/backcompat/voice-changer-wrapper.ts +70 -0
  64. package/src/backcompat/voices-wrapper.ts +163 -0
  65. package/src/index.ts +1 -1
  66. package/src/version.ts +1 -1
  67. package/version.d.mts +1 -1
  68. package/version.d.ts +1 -1
  69. package/version.js +1 -1
  70. package/version.mjs +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.0.0-b7 (2026-01-13)
4
+
5
+ Full Changelog: [v3.0.0-b6...v3.0.0-b7](https://github.com/cartesia-ai/cartesia-js-internal/compare/v3.0.0-b6...v3.0.0-b7)
6
+
7
+ ## 3.0.0-b6 (2026-01-09)
8
+
9
+ Full Changelog: [v3.0.0-b5...v3.0.0-b6](https://github.com/cartesia-ai/cartesia-js-internal/compare/v3.0.0-b5...v3.0.0-b6)
10
+
3
11
  ## 3.0.0-b5 (2026-01-07)
4
12
 
5
13
  Full Changelog: [v3.0.0-b4...v3.0.0-b5](https://github.com/cartesia-ai/cartesia-js-internal/compare/v3.0.0-b4...v3.0.0-b5)
@@ -0,0 +1,16 @@
1
+ /** @deprecated Use {@link CartesiaError} or specialized error classes from core/error instead. */
2
+ export declare class CartesiaClientError extends Error {
3
+ readonly statusCode?: number;
4
+ readonly body?: unknown;
5
+ constructor({ message, statusCode, body, }: {
6
+ message?: string;
7
+ statusCode?: number;
8
+ body?: unknown;
9
+ });
10
+ }
11
+ /** @deprecated Use {@link APIConnectionTimeoutError} instead. */
12
+ export declare class CartesiaTimeoutError extends Error {
13
+ constructor(message: string);
14
+ }
15
+ export declare function wrap<T>(promise: Promise<T>): Promise<T>;
16
+ //# sourceMappingURL=errors.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.mts","sourceRoot":"","sources":["../src/backcompat/errors.ts"],"names":[],"mappings":"AAEA,kGAAkG;AAClG,qBAAa,mBAAoB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;gBAEZ,EACX,OAAO,EACP,UAAU,EACV,IAAI,GACJ,EAAE;QACF,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,IAAI,CAAC,EAAE,OAAO,CAAC;KACf;CAUD;AAED,iEAAiE;AACjE,qBAAa,oBAAqB,SAAQ,KAAK;gBAClC,OAAO,EAAE,MAAM;CAI3B;AAED,wBAAsB,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAgB7D"}
@@ -0,0 +1,16 @@
1
+ /** @deprecated Use {@link CartesiaError} or specialized error classes from core/error instead. */
2
+ export declare class CartesiaClientError extends Error {
3
+ readonly statusCode?: number;
4
+ readonly body?: unknown;
5
+ constructor({ message, statusCode, body, }: {
6
+ message?: string;
7
+ statusCode?: number;
8
+ body?: unknown;
9
+ });
10
+ }
11
+ /** @deprecated Use {@link APIConnectionTimeoutError} instead. */
12
+ export declare class CartesiaTimeoutError extends Error {
13
+ constructor(message: string);
14
+ }
15
+ export declare function wrap<T>(promise: Promise<T>): Promise<T>;
16
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/backcompat/errors.ts"],"names":[],"mappings":"AAEA,kGAAkG;AAClG,qBAAa,mBAAoB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;gBAEZ,EACX,OAAO,EACP,UAAU,EACV,IAAI,GACJ,EAAE;QACF,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,IAAI,CAAC,EAAE,OAAO,CAAC;KACf;CAUD;AAED,iEAAiE;AACjE,qBAAa,oBAAqB,SAAQ,KAAK;gBAClC,OAAO,EAAE,MAAM;CAI3B;AAED,wBAAsB,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAgB7D"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CartesiaTimeoutError = exports.CartesiaClientError = void 0;
4
+ exports.wrap = wrap;
5
+ const error_1 = require("../core/error.js");
6
+ /** @deprecated Use {@link CartesiaError} or specialized error classes from core/error instead. */
7
+ class CartesiaClientError extends Error {
8
+ constructor({ message, statusCode, body, }) {
9
+ super(message);
10
+ Object.setPrototypeOf(this, CartesiaClientError.prototype);
11
+ if (statusCode != null) {
12
+ this.statusCode = statusCode;
13
+ }
14
+ if (body !== undefined) {
15
+ this.body = body;
16
+ }
17
+ }
18
+ }
19
+ exports.CartesiaClientError = CartesiaClientError;
20
+ /** @deprecated Use {@link APIConnectionTimeoutError} instead. */
21
+ class CartesiaTimeoutError extends Error {
22
+ constructor(message) {
23
+ super(message);
24
+ Object.setPrototypeOf(this, CartesiaTimeoutError.prototype);
25
+ }
26
+ }
27
+ exports.CartesiaTimeoutError = CartesiaTimeoutError;
28
+ async function wrap(promise) {
29
+ try {
30
+ return await promise;
31
+ }
32
+ catch (e) {
33
+ if (e instanceof error_1.APIConnectionTimeoutError) {
34
+ throw new CartesiaTimeoutError(e.message);
35
+ }
36
+ if (e instanceof error_1.APIError) {
37
+ throw new CartesiaClientError({
38
+ message: e.message,
39
+ statusCode: e.status,
40
+ body: e.error,
41
+ });
42
+ }
43
+ throw e;
44
+ }
45
+ }
46
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/backcompat/errors.ts"],"names":[],"mappings":";;;AAmCA,oBAgBC;AAnDD,4CAAoE;AAEpE,kGAAkG;AAClG,MAAa,mBAAoB,SAAQ,KAAK;IAI7C,YAAY,EACX,OAAO,EACP,UAAU,EACV,IAAI,GAKJ;QACA,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;QAC3D,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;YACxB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC9B,CAAC;QACD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACxB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAClB,CAAC;IACF,CAAC;CACD;AAtBD,kDAsBC;AAED,iEAAiE;AACjE,MAAa,oBAAqB,SAAQ,KAAK;IAC9C,YAAY,OAAe;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC;CACD;AALD,oDAKC;AAEM,KAAK,UAAU,IAAI,CAAI,OAAmB;IAChD,IAAI,CAAC;QACJ,OAAO,MAAM,OAAO,CAAC;IACtB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACZ,IAAI,CAAC,YAAY,iCAAyB,EAAE,CAAC;YAC5C,MAAM,IAAI,oBAAoB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QAC3C,CAAC;QACD,IAAI,CAAC,YAAY,gBAAQ,EAAE,CAAC;YAC3B,MAAM,IAAI,mBAAmB,CAAC;gBAC7B,OAAO,EAAE,CAAC,CAAC,OAAO;gBAClB,UAAU,EAAE,CAAC,CAAC,MAAM;gBACpB,IAAI,EAAE,CAAC,CAAC,KAAK;aACb,CAAC,CAAC;QACJ,CAAC;QACD,MAAM,CAAC,CAAC;IACT,CAAC;AACF,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { APIConnectionTimeoutError, APIError } from "../core/error.mjs";
2
+ /** @deprecated Use {@link CartesiaError} or specialized error classes from core/error instead. */
3
+ export class CartesiaClientError extends Error {
4
+ constructor({ message, statusCode, body, }) {
5
+ super(message);
6
+ Object.setPrototypeOf(this, CartesiaClientError.prototype);
7
+ if (statusCode != null) {
8
+ this.statusCode = statusCode;
9
+ }
10
+ if (body !== undefined) {
11
+ this.body = body;
12
+ }
13
+ }
14
+ }
15
+ /** @deprecated Use {@link APIConnectionTimeoutError} instead. */
16
+ export class CartesiaTimeoutError extends Error {
17
+ constructor(message) {
18
+ super(message);
19
+ Object.setPrototypeOf(this, CartesiaTimeoutError.prototype);
20
+ }
21
+ }
22
+ export async function wrap(promise) {
23
+ try {
24
+ return await promise;
25
+ }
26
+ catch (e) {
27
+ if (e instanceof APIConnectionTimeoutError) {
28
+ throw new CartesiaTimeoutError(e.message);
29
+ }
30
+ if (e instanceof APIError) {
31
+ throw new CartesiaClientError({
32
+ message: e.message,
33
+ statusCode: e.status,
34
+ body: e.error,
35
+ });
36
+ }
37
+ throw e;
38
+ }
39
+ }
40
+ //# sourceMappingURL=errors.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.mjs","sourceRoot":"","sources":["../src/backcompat/errors.ts"],"names":[],"mappings":"OAAO,EAAE,yBAAyB,EAAE,QAAQ,EAAE;AAE9C,kGAAkG;AAClG,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAI7C,YAAY,EACX,OAAO,EACP,UAAU,EACV,IAAI,GAKJ;QACA,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;QAC3D,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;YACxB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC9B,CAAC;QACD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACxB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAClB,CAAC;IACF,CAAC;CACD;AAED,iEAAiE;AACjE,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC9C,YAAY,OAAe;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC;CACD;AAED,MAAM,CAAC,KAAK,UAAU,IAAI,CAAI,OAAmB;IAChD,IAAI,CAAC;QACJ,OAAO,MAAM,OAAO,CAAC;IACtB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACZ,IAAI,CAAC,YAAY,yBAAyB,EAAE,CAAC;YAC5C,MAAM,IAAI,oBAAoB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QAC3C,CAAC;QACD,IAAI,CAAC,YAAY,QAAQ,EAAE,CAAC;YAC3B,MAAM,IAAI,mBAAmB,CAAC;gBAC7B,OAAO,EAAE,CAAC,CAAC,OAAO;gBAClB,UAAU,EAAE,CAAC,CAAC,MAAM;gBACpB,IAAI,EAAE,CAAC,CAAC,KAAK;aACb,CAAC,CAAC;QACJ,CAAC;QACD,MAAM,CAAC,CAAC;IACT,CAAC;AACF,CAAC"}
@@ -1,36 +1,22 @@
1
- import { Cartesia } from "../client.mjs";
2
- declare class AudioSource {
3
- private buffers;
4
- private waiter;
5
- isDone: boolean;
6
- push(data: Buffer): void;
7
- markDone(): void;
8
- read(outBuffer: Float32Array): Promise<number>;
9
- }
10
- declare class WebSocketWrapper {
11
- private client;
12
- private config;
13
- private socket;
14
- private sources;
15
- private defaultSource;
16
- constructor(client: Cartesia, config: any);
17
- connect(): Promise<void>;
18
- private handleMessage;
19
- send(request: any): Promise<{
20
- source: AudioSource;
21
- }>;
22
- disconnect(): void;
23
- }
24
- declare class TTSWrapper {
25
- private client;
26
- constructor(client: Cartesia);
27
- websocket(config: any): WebSocketWrapper;
28
- bytes(request: any, requestOptions?: any): Promise<any>;
29
- }
1
+ import { TTSWrapper } from "./tts-wrapper.mjs";
2
+ import { VoicesWrapper } from "./voices-wrapper.mjs";
3
+ import { VoiceChangerWrapper } from "./voice-changer-wrapper.mjs";
4
+ import type { CartesiaClientOptions } from "./types.mjs";
5
+ /**
6
+ * @deprecated Use the {@link Cartesia} class directly instead.
7
+ *
8
+ * This class is provided for backward compatibility with the legacy SDK and may be removed in a future release.
9
+ */
30
10
  export declare class CartesiaClient {
31
11
  private client;
32
12
  tts: TTSWrapper;
33
- constructor(options: any);
13
+ voices: VoicesWrapper;
14
+ voiceChanger: VoiceChangerWrapper;
15
+ constructor(options?: CartesiaClientOptions);
34
16
  }
35
- export {};
17
+ export * from "./tts-wrapper.mjs";
18
+ export * from "./voices-wrapper.mjs";
19
+ export * from "./voice-changer-wrapper.mjs";
20
+ export * from "./types.mjs";
21
+ export * from "./errors.mjs";
36
22
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/backcompat/index.ts"],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AAO,GAAE,qBAA0B;CAkB/C"}
@@ -1,36 +1,22 @@
1
- import { Cartesia } from "../client.js";
2
- declare class AudioSource {
3
- private buffers;
4
- private waiter;
5
- isDone: boolean;
6
- push(data: Buffer): void;
7
- markDone(): void;
8
- read(outBuffer: Float32Array): Promise<number>;
9
- }
10
- declare class WebSocketWrapper {
11
- private client;
12
- private config;
13
- private socket;
14
- private sources;
15
- private defaultSource;
16
- constructor(client: Cartesia, config: any);
17
- connect(): Promise<void>;
18
- private handleMessage;
19
- send(request: any): Promise<{
20
- source: AudioSource;
21
- }>;
22
- disconnect(): void;
23
- }
24
- declare class TTSWrapper {
25
- private client;
26
- constructor(client: Cartesia);
27
- websocket(config: any): WebSocketWrapper;
28
- bytes(request: any, requestOptions?: any): Promise<any>;
29
- }
1
+ import { TTSWrapper } from "./tts-wrapper.js";
2
+ import { VoicesWrapper } from "./voices-wrapper.js";
3
+ import { VoiceChangerWrapper } from "./voice-changer-wrapper.js";
4
+ import type { CartesiaClientOptions } from "./types.js";
5
+ /**
6
+ * @deprecated Use the {@link Cartesia} class directly instead.
7
+ *
8
+ * This class is provided for backward compatibility with the legacy SDK and may be removed in a future release.
9
+ */
30
10
  export declare class CartesiaClient {
31
11
  private client;
32
12
  tts: TTSWrapper;
33
- constructor(options: any);
13
+ voices: VoicesWrapper;
14
+ voiceChanger: VoiceChangerWrapper;
15
+ constructor(options?: CartesiaClientOptions);
34
16
  }
35
- export {};
17
+ export * from "./tts-wrapper.js";
18
+ export * from "./voices-wrapper.js";
19
+ export * from "./voice-changer-wrapper.js";
20
+ export * from "./types.js";
21
+ export * from "./errors.js";
36
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/backcompat/index.ts"],"names":[],"mappings":"OACO,EAAE,QAAQ,EAAE;AAEnB,cAAM,WAAW;IAChB,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,MAAM,CAAsC;IAC7C,MAAM,UAAS;IAEtB,IAAI,CAAC,IAAI,EAAE,MAAM;IAQjB,QAAQ;IAQF,IAAI,CAAC,SAAS,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;CAkDpD;AAED,cAAM,gBAAgB;IACrB,OAAO,CAAC,MAAM,CAAW;IACzB,OAAO,CAAC,MAAM,CAAM;IACpB,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,OAAO,CAAuC;IAItD,OAAO,CAAC,aAAa,CAA4B;gBAErC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG;IAKnC,OAAO;IAiDb,OAAO,CAAC,aAAa;IA2Bf,IAAI,CAAC,OAAO,EAAE,GAAG;;;IA4DvB,UAAU;CAKV;AAED,cAAM,UAAU;IACf,OAAO,CAAC,MAAM,CAAW;gBAEb,MAAM,EAAE,QAAQ;IAI5B,SAAS,CAAC,MAAM,EAAE,GAAG;IAIf,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,cAAc,CAAC,EAAE,GAAG;CAiC9C;AAMD,qBAAa,cAAc;IAC1B,OAAO,CAAC,MAAM,CAAW;IAClB,GAAG,EAAE,UAAU,CAAC;gBAEX,OAAO,EAAE,GAAG;CAIxB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/backcompat/index.ts"],"names":[],"mappings":"OACO,EAAE,UAAU,EAAE;OACd,EAAE,aAAa,EAAE;OACjB,EAAE,mBAAmB,EAAE;OACvB,KAAK,EAAE,qBAAqB,EAAE;AAErC;;;;GAIG;AACH,qBAAa,cAAc;IAC1B,OAAO,CAAC,MAAM,CAAW;IAClB,GAAG,EAAE,UAAU,CAAC;IAChB,MAAM,EAAE,aAAa,CAAC;IACtB,YAAY,EAAE,mBAAmB,CAAC;gBAE7B,OAAO,GAAE,qBAA0B;CAkB/C"}
@@ -2,265 +2,37 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CartesiaClient = void 0;
4
4
  const tslib_1 = require("../internal/tslib.js");
5
- const ws_1 = tslib_1.__importDefault(require("ws"));
6
5
  const client_1 = require("../client.js");
7
- class AudioSource {
8
- constructor() {
9
- this.buffers = [];
10
- this.waiter = null;
11
- this.isDone = false;
12
- }
13
- push(data) {
14
- this.buffers.push(data);
15
- if (this.waiter) {
16
- this.waiter();
17
- this.waiter = null;
18
- }
19
- }
20
- markDone() {
21
- this.isDone = true;
22
- if (this.waiter) {
23
- this.waiter();
24
- this.waiter = null;
25
- }
26
- }
27
- async read(outBuffer) {
28
- if (this.buffers.length === 0 && !this.isDone) {
29
- await new Promise((resolve) => { this.waiter = resolve; });
30
- }
31
- if (this.buffers.length === 0 && this.isDone) {
32
- return 0;
33
- }
34
- let totalFloatsRead = 0;
35
- let outOffset = 0;
36
- const maxFloats = outBuffer.length;
37
- while (this.buffers.length > 0 && totalFloatsRead < maxFloats) {
38
- const buf = this.buffers[0]; // ts not smart enough to check loop condition
39
- const floatsInBuf = buf.length / 4;
40
- const floatsNeeded = maxFloats - totalFloatsRead;
41
- const floatsToCopy = Math.min(floatsInBuf, floatsNeeded);
42
- const bytesToCopy = floatsToCopy * 4;
43
- // Copy to outBuffer.
44
- // Create a view on the buffer to read floats.
45
- // We need to ensure byteOffset is a multiple of 4.
46
- // If not, we must copy the buffer to a new one.
47
- let srcFloats;
48
- if (buf.byteOffset % 4 === 0) {
49
- srcFloats = new Float32Array(buf.buffer, buf.byteOffset, floatsInBuf);
50
- }
51
- else {
52
- const alignedBuf = new Uint8Array(buf);
53
- srcFloats = new Float32Array(alignedBuf.buffer, alignedBuf.byteOffset, floatsInBuf);
54
- }
55
- outBuffer.set(srcFloats.subarray(0, floatsToCopy), outOffset);
56
- totalFloatsRead += floatsToCopy;
57
- outOffset += floatsToCopy;
58
- if (floatsToCopy < floatsInBuf) {
59
- // We didn't use the whole buffer. Update it.
60
- this.buffers[0] = buf.subarray(bytesToCopy);
61
- }
62
- else {
63
- // We used the whole buffer. Remove it.
64
- this.buffers.shift();
65
- }
66
- }
67
- return totalFloatsRead;
68
- }
69
- }
70
- class WebSocketWrapper {
71
- constructor(client, config) {
72
- this.socket = null;
73
- this.sources = new Map();
74
- // Fallback source for messages without context_id or if we just want to capture everything (legacy behavior?)
75
- // The original test didn't use context_id explicitly in send() but expected a response source.
76
- // We'll map context_id to source.
77
- this.defaultSource = null;
78
- this.client = client;
79
- this.config = config;
80
- }
81
- async connect() {
82
- const baseURL = this.client.baseURL;
83
- // Construct WebSocket URL
84
- // baseURL is like https://api.cartesia.ai
85
- let urlStr = baseURL.replace(/^http/, "ws");
86
- if (!urlStr.includes("/tts/websocket")) {
87
- if (urlStr.endsWith("/")) {
88
- urlStr += "tts/websocket";
89
- }
90
- else {
91
- urlStr += "/tts/websocket";
92
- }
93
- }
94
- const url = new URL(urlStr);
95
- const headers = {
96
- "cartesia-version": "2025-04-16",
97
- };
98
- if (this.client.apiKey) {
99
- headers["Authorization"] = `Bearer ${this.client.apiKey}`;
100
- }
101
- this.socket = new ws_1.default(url.toString(), {
102
- headers: headers,
103
- });
104
- return new Promise((resolve, reject) => {
105
- this.socket.on("open", () => {
106
- console.log("WebSocket connected.");
107
- resolve();
108
- });
109
- this.socket.on("error", (err) => {
110
- console.error("WebSocket error:", err);
111
- reject(err);
112
- });
113
- this.socket.on("message", (data) => {
114
- this.handleMessage(data);
115
- });
116
- this.socket.on("close", () => {
117
- console.log("WebSocket closed.");
118
- this.sources.forEach((s) => { s.markDone(); });
119
- if (this.defaultSource)
120
- this.defaultSource.markDone();
121
- });
122
- });
123
- }
124
- handleMessage(data) {
125
- try {
126
- const str = data.toString();
127
- const msg = JSON.parse(str);
128
- const contextId = msg.context_id;
129
- let source = contextId ? this.sources.get(contextId) : this.defaultSource;
130
- // If we received a message for a context we don't know about, and we have a default source, use it
131
- if (!source && this.defaultSource) {
132
- source = this.defaultSource;
133
- }
134
- if (msg.type === "chunk" && msg.data) {
135
- const audioData = Buffer.from(msg.data, "base64");
136
- if (source)
137
- source.push(audioData);
138
- }
139
- else if (msg.type === "done") {
140
- if (source)
141
- source.markDone();
142
- }
143
- else if (msg.type === "error") {
144
- console.error("Server error:", msg);
145
- if (source)
146
- source.markDone(); // Fail the stream?
147
- }
148
- }
149
- catch (e) {
150
- console.error("Error parsing message:", e);
151
- }
152
- }
153
- async send(request) {
154
- if (!this.socket) {
155
- throw new Error("WebSocket not connected");
156
- }
157
- // Ensure request has a context_id so we can route the response
158
- if (!request.context_id) {
159
- request.context_id = uuidv4();
160
- }
161
- const source = new AudioSource();
162
- this.sources.set(request.context_id, source);
163
- // Also set as default source if none exists, for compatibility with simple tests
164
- if (!this.defaultSource) {
165
- this.defaultSource = source;
6
+ const tts_wrapper_1 = require("./tts-wrapper.js");
7
+ const voices_wrapper_1 = require("./voices-wrapper.js");
8
+ const voice_changer_wrapper_1 = require("./voice-changer-wrapper.js");
9
+ /**
10
+ * @deprecated Use the {@link Cartesia} class directly instead.
11
+ *
12
+ * This class is provided for backward compatibility with the legacy SDK and may be removed in a future release.
13
+ */
14
+ class CartesiaClient {
15
+ constructor(options = {}) {
16
+ const newOptions = {};
17
+ if (options.apiKey) {
18
+ newOptions.apiKey = options.apiKey;
166
19
  }
167
- // Add output format from config if not present
168
- if (!request.output_format && this.config) {
169
- request.output_format = {
170
- container: this.config.container,
171
- encoding: this.config.encoding,
172
- sample_rate: this.config.sampleRate,
173
- };
20
+ if (options.baseUrl) {
21
+ newOptions.baseURL = options.baseUrl;
174
22
  }
175
- // Fix camelCase to snake_case for output_format if needed
176
- // The new API expects snake_case keys in JSON usually, but let's check.
177
- // The GenerationRequest interface has `output_format`.
178
- // The config passed to .websocket() uses `sampleRate`.
179
- // We might need to map it.
180
- if (request.output_format) {
181
- // Ensure sample_rate is set (mapping from sampleRate)
182
- if (request.output_format.sampleRate && !request.output_format.sample_rate) {
183
- request.output_format.sample_rate = request.output_format.sampleRate;
184
- delete request.output_format.sampleRate;
185
- }
186
- }
187
- // Map camelCase request fields to snake_case if necessary?
188
- // The old test uses `modelId`, `generationConfig`.
189
- // The new API expects `model_id`, `generation_config`.
190
- const payload = {
191
- ...request,
192
- model_id: request.modelId || request.model_id,
193
- generation_config: request.generationConfig || request.generation_config,
194
- context_id: request.context_id,
195
- };
196
- // Remove camelCase keys if they persist?
197
- // JSON.stringify handles it, but we should clean up if we want to be strict.
198
- // Also `voice` object. Old test: `voice: { mode: 'id', id: ... }`. New API: same.
199
- this.socket.send(JSON.stringify(payload));
200
- return {
201
- source: source
202
- };
203
- }
204
- disconnect() {
205
- if (this.socket) {
206
- this.socket.close();
23
+ else if (options.environment) {
24
+ newOptions.baseURL = options.environment;
207
25
  }
208
- }
209
- }
210
- class TTSWrapper {
211
- constructor(client) {
212
- this.client = client;
213
- }
214
- websocket(config) {
215
- return new WebSocketWrapper(this.client, config);
216
- }
217
- async bytes(request, requestOptions) {
218
- const params = {
219
- model_id: request.modelId,
220
- transcript: request.transcript,
221
- voice: request.voice,
222
- generation_config: request.generationConfig,
223
- context_id: request.contextId,
224
- };
225
- if (request.outputFormat) {
226
- params.output_format = {
227
- ...request.outputFormat,
228
- sample_rate: request.outputFormat.sampleRate,
229
- bit_rate: request.outputFormat.bitRate,
230
- };
231
- // Remove camelCase keys
232
- delete params.output_format.sampleRate;
233
- delete params.output_format.bitRate;
234
- }
235
- const options = {};
236
- if (requestOptions) {
237
- if (requestOptions.timeoutInSeconds) {
238
- options.timeout = requestOptions.timeoutInSeconds * 1000;
239
- }
240
- options.maxRetries = requestOptions.maxRetries;
241
- options.headers = requestOptions.headers;
242
- options.signal = requestOptions.abortSignal;
243
- }
244
- // @ts-ignore
245
- return this.client.tts.synthesizeBytes(params, options);
246
- }
247
- }
248
- /*
249
- * CartesiaClient - deprecated backcompat class.
250
- * New code should use Cartesia class directly instead.
251
- */
252
- class CartesiaClient {
253
- constructor(options) {
254
- this.client = new client_1.Cartesia(options);
255
- this.tts = new TTSWrapper(this.client);
26
+ this.client = new client_1.Cartesia(newOptions);
27
+ this.tts = new tts_wrapper_1.TTSWrapper(this.client);
28
+ this.voices = new voices_wrapper_1.VoicesWrapper(this.client);
29
+ this.voiceChanger = new voice_changer_wrapper_1.VoiceChangerWrapper(this.client);
256
30
  }
257
31
  }
258
32
  exports.CartesiaClient = CartesiaClient;
259
- // Helper for generating UUIDs. Not cryptographically secure.
260
- function uuidv4() {
261
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
262
- var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
263
- return v.toString(16);
264
- });
265
- }
33
+ tslib_1.__exportStar(require("./tts-wrapper.js"), exports);
34
+ tslib_1.__exportStar(require("./voices-wrapper.js"), exports);
35
+ tslib_1.__exportStar(require("./voice-changer-wrapper.js"), exports);
36
+ tslib_1.__exportStar(require("./types.js"), exports);
37
+ tslib_1.__exportStar(require("./errors.js"), exports);
266
38
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/backcompat/index.ts"],"names":[],"mappings":";;;;AAAA,oDAA2B;AAC3B,yCAAqC;AAErC,MAAM,WAAW;IAAjB;QACS,YAAO,GAAa,EAAE,CAAC;QACvB,WAAM,GAAiC,IAAI,CAAC;QAC7C,WAAM,GAAG,KAAK,CAAC;IAoEvB,CAAC;IAlEA,IAAI,CAAC,IAAY;QAChB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxB,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,IAAI,CAAC,MAAM,EAAE,CAAC;YACd,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACpB,CAAC;IACF,CAAC;IAED,QAAQ;QACP,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,IAAI,CAAC,MAAM,EAAE,CAAC;YACd,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACpB,CAAC;IACF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