@cartesia/cartesia-js 2.2.5 → 2.2.7

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 (195) hide show
  1. package/Client.d.ts +3 -0
  2. package/Client.js +11 -6
  3. package/README.md +469 -144
  4. package/api/resources/apiStatus/client/Client.js +1 -1
  5. package/api/resources/auth/client/Client.d.ts +17 -0
  6. package/api/resources/auth/client/Client.js +18 -1
  7. package/api/resources/auth/types/TokenGrant.d.ts +3 -1
  8. package/api/resources/auth/types/TokenRequest.d.ts +2 -2
  9. package/api/resources/index.d.ts +1 -0
  10. package/api/resources/index.js +1 -0
  11. package/api/resources/infill/client/Client.js +1 -1
  12. package/api/resources/infill/client/requests/InfillBytesRequest.d.ts +3 -11
  13. package/api/resources/stt/client/Client.d.ts +43 -0
  14. package/api/resources/stt/client/Client.js +108 -0
  15. package/api/resources/stt/client/index.d.ts +1 -1
  16. package/api/resources/stt/client/index.js +15 -3
  17. package/api/resources/stt/client/requests/TranscriptionRequest.d.ts +147 -0
  18. package/api/resources/stt/client/requests/TranscriptionRequest.js +5 -0
  19. package/api/resources/stt/client/requests/index.d.ts +1 -0
  20. package/api/resources/stt/client/requests/index.js +2 -0
  21. package/api/resources/stt/index.d.ts +1 -0
  22. package/api/resources/stt/index.js +1 -0
  23. package/api/resources/stt/types/TimestampGranularity.d.ts +12 -0
  24. package/api/resources/stt/types/TimestampGranularity.js +9 -0
  25. package/api/resources/stt/types/TranscriptMessage.d.ts +1 -1
  26. package/api/resources/stt/types/TranscriptionResponse.d.ts +2 -2
  27. package/api/resources/stt/types/index.d.ts +1 -0
  28. package/api/resources/stt/types/index.js +1 -0
  29. package/api/resources/tts/client/Client.d.ts +7 -2
  30. package/api/resources/tts/client/Client.js +8 -8
  31. package/api/resources/tts/types/Controls.d.ts +1 -1
  32. package/api/resources/tts/types/Emotion.d.ts +2 -33
  33. package/api/resources/tts/types/Emotion.js +0 -28
  34. package/api/resources/tts/types/EmotionDeprecated.d.ts +38 -0
  35. package/api/resources/tts/types/EmotionDeprecated.js +33 -0
  36. package/api/resources/tts/types/GenerationConfig.d.ts +15 -0
  37. package/api/resources/tts/types/GenerationConfig.js +5 -0
  38. package/api/resources/tts/types/GenerationRequest.d.ts +5 -4
  39. package/api/resources/tts/types/Mp3OutputFormat.d.ts +1 -0
  40. package/api/resources/tts/types/RawOutputFormat.d.ts +1 -0
  41. package/api/resources/tts/types/SseOutputFormat.d.ts +10 -0
  42. package/api/resources/tts/types/SseOutputFormat.js +5 -0
  43. package/api/resources/tts/types/TtsRequest.d.ts +1 -0
  44. package/api/resources/tts/types/TtssseRequest.d.ts +27 -0
  45. package/api/resources/tts/types/TtssseRequest.js +5 -0
  46. package/api/resources/tts/types/WebSocketRawOutputFormat.d.ts +1 -0
  47. package/api/resources/tts/types/WebSocketRequest.d.ts +2 -4
  48. package/api/resources/tts/types/WebSocketTtsRequest.d.ts +4 -1
  49. package/api/resources/tts/types/index.d.ts +5 -1
  50. package/api/resources/tts/types/index.js +5 -1
  51. package/api/resources/voiceChanger/client/Client.d.ts +9 -4
  52. package/api/resources/voiceChanger/client/Client.js +24 -20
  53. package/api/resources/voiceChanger/client/requests/VoiceChangerBytesRequest.d.ts +3 -8
  54. package/api/resources/voiceChanger/client/requests/VoiceChangerSseRequest.d.ts +3 -8
  55. package/api/resources/voices/client/Client.js +8 -8
  56. package/api/resources/voices/client/requests/CloneVoiceRequest.d.ts +6 -24
  57. package/api/resources/voices/types/LocalizeDialect.d.ts +4 -8
  58. package/core/fetcher/Fetcher.d.ts +2 -2
  59. package/core/fetcher/Fetcher.js +4 -3
  60. package/core/fetcher/getResponseBody.js +3 -3
  61. package/dist/Client.d.ts +3 -0
  62. package/dist/Client.js +11 -6
  63. package/dist/api/resources/apiStatus/client/Client.js +1 -1
  64. package/dist/api/resources/auth/client/Client.d.ts +17 -0
  65. package/dist/api/resources/auth/client/Client.js +18 -1
  66. package/dist/api/resources/auth/types/TokenGrant.d.ts +3 -1
  67. package/dist/api/resources/auth/types/TokenRequest.d.ts +2 -2
  68. package/dist/api/resources/index.d.ts +1 -0
  69. package/dist/api/resources/index.js +1 -0
  70. package/dist/api/resources/infill/client/Client.js +1 -1
  71. package/dist/api/resources/infill/client/requests/InfillBytesRequest.d.ts +3 -11
  72. package/dist/api/resources/stt/client/Client.d.ts +43 -0
  73. package/dist/api/resources/stt/client/Client.js +108 -0
  74. package/dist/api/resources/stt/client/index.d.ts +1 -1
  75. package/dist/api/resources/stt/client/index.js +15 -3
  76. package/dist/api/resources/stt/client/requests/TranscriptionRequest.d.ts +147 -0
  77. package/dist/api/resources/stt/client/requests/TranscriptionRequest.js +5 -0
  78. package/dist/api/resources/stt/client/requests/index.d.ts +1 -0
  79. package/dist/api/resources/stt/client/requests/index.js +2 -0
  80. package/dist/api/resources/stt/index.d.ts +1 -0
  81. package/dist/api/resources/stt/index.js +1 -0
  82. package/dist/api/resources/stt/types/TimestampGranularity.d.ts +12 -0
  83. package/dist/api/resources/stt/types/TimestampGranularity.js +9 -0
  84. package/dist/api/resources/stt/types/TranscriptMessage.d.ts +1 -1
  85. package/dist/api/resources/stt/types/TranscriptionResponse.d.ts +2 -2
  86. package/dist/api/resources/stt/types/index.d.ts +1 -0
  87. package/dist/api/resources/stt/types/index.js +1 -0
  88. package/dist/api/resources/tts/client/Client.d.ts +7 -2
  89. package/dist/api/resources/tts/client/Client.js +8 -8
  90. package/dist/api/resources/tts/types/Controls.d.ts +1 -1
  91. package/dist/api/resources/tts/types/Emotion.d.ts +2 -33
  92. package/dist/api/resources/tts/types/Emotion.js +0 -28
  93. package/dist/api/resources/tts/types/EmotionDeprecated.d.ts +38 -0
  94. package/dist/api/resources/tts/types/EmotionDeprecated.js +33 -0
  95. package/dist/api/resources/tts/types/GenerationConfig.d.ts +15 -0
  96. package/dist/api/resources/tts/types/GenerationConfig.js +5 -0
  97. package/dist/api/resources/tts/types/GenerationRequest.d.ts +5 -4
  98. package/dist/api/resources/tts/types/Mp3OutputFormat.d.ts +1 -0
  99. package/dist/api/resources/tts/types/RawOutputFormat.d.ts +1 -0
  100. package/dist/api/resources/tts/types/SseOutputFormat.d.ts +10 -0
  101. package/dist/api/resources/tts/types/SseOutputFormat.js +5 -0
  102. package/dist/api/resources/tts/types/TtsRequest.d.ts +1 -0
  103. package/dist/api/resources/tts/types/TtssseRequest.d.ts +27 -0
  104. package/dist/api/resources/tts/types/TtssseRequest.js +5 -0
  105. package/dist/api/resources/tts/types/WebSocketRawOutputFormat.d.ts +1 -0
  106. package/dist/api/resources/tts/types/WebSocketRequest.d.ts +2 -4
  107. package/dist/api/resources/tts/types/WebSocketTtsRequest.d.ts +4 -1
  108. package/dist/api/resources/tts/types/index.d.ts +5 -1
  109. package/dist/api/resources/tts/types/index.js +5 -1
  110. package/dist/api/resources/voiceChanger/client/Client.d.ts +9 -4
  111. package/dist/api/resources/voiceChanger/client/Client.js +24 -20
  112. package/dist/api/resources/voiceChanger/client/requests/VoiceChangerBytesRequest.d.ts +3 -8
  113. package/dist/api/resources/voiceChanger/client/requests/VoiceChangerSseRequest.d.ts +3 -8
  114. package/dist/api/resources/voices/client/Client.js +8 -8
  115. package/dist/api/resources/voices/client/requests/CloneVoiceRequest.d.ts +6 -24
  116. package/dist/api/resources/voices/types/LocalizeDialect.d.ts +4 -8
  117. package/dist/core/fetcher/Fetcher.d.ts +2 -2
  118. package/dist/core/fetcher/Fetcher.js +4 -3
  119. package/dist/core/fetcher/getResponseBody.js +3 -3
  120. package/dist/index.d.ts +2 -0
  121. package/dist/index.js +8 -1
  122. package/dist/serialization/resources/auth/types/TokenGrant.d.ts +2 -1
  123. package/dist/serialization/resources/auth/types/TokenGrant.js +2 -1
  124. package/dist/serialization/resources/auth/types/TokenRequest.d.ts +1 -1
  125. package/dist/serialization/resources/auth/types/TokenRequest.js +1 -1
  126. package/dist/serialization/resources/stt/types/TimestampGranularity.d.ts +10 -0
  127. package/dist/serialization/resources/stt/types/TimestampGranularity.js +41 -0
  128. package/dist/serialization/resources/stt/types/index.d.ts +1 -0
  129. package/dist/serialization/resources/stt/types/index.js +1 -0
  130. package/dist/serialization/resources/tts/types/Controls.d.ts +2 -2
  131. package/dist/serialization/resources/tts/types/Controls.js +2 -2
  132. package/dist/serialization/resources/tts/types/Emotion.d.ts +1 -1
  133. package/dist/serialization/resources/tts/types/Emotion.js +1 -27
  134. package/dist/serialization/resources/tts/types/EmotionDeprecated.d.ts +10 -0
  135. package/dist/serialization/resources/tts/types/EmotionDeprecated.js +67 -0
  136. package/dist/serialization/resources/tts/types/GenerationConfig.d.ts +15 -0
  137. package/dist/serialization/resources/tts/types/GenerationConfig.js +46 -0
  138. package/dist/serialization/resources/tts/types/GenerationRequest.d.ts +3 -1
  139. package/dist/serialization/resources/tts/types/GenerationRequest.js +3 -1
  140. package/dist/serialization/resources/tts/types/SseOutputFormat.d.ts +15 -0
  141. package/dist/serialization/resources/tts/types/SseOutputFormat.js +46 -0
  142. package/dist/serialization/resources/tts/types/TtsRequest.d.ts +2 -0
  143. package/dist/serialization/resources/tts/types/TtsRequest.js +2 -0
  144. package/dist/serialization/resources/tts/types/TtssseRequest.d.ts +29 -0
  145. package/dist/serialization/resources/tts/types/TtssseRequest.js +60 -0
  146. package/dist/serialization/resources/tts/types/WebSocketTtsRequest.d.ts +3 -1
  147. package/dist/serialization/resources/tts/types/WebSocketTtsRequest.js +3 -1
  148. package/dist/serialization/resources/tts/types/index.d.ts +5 -1
  149. package/dist/serialization/resources/tts/types/index.js +5 -1
  150. package/dist/version.d.ts +1 -1
  151. package/dist/version.js +1 -1
  152. package/dist/wrapper/StreamingSTTClient.d.ts +22 -2
  153. package/dist/wrapper/StreamingSTTClient.js +124 -1
  154. package/dist/wrapper/SttWebsocket.d.ts +8 -3
  155. package/dist/wrapper/SttWebsocket.js +24 -3
  156. package/dist/wrapper/Websocket.js +1 -1
  157. package/index.d.ts +2 -0
  158. package/index.js +8 -1
  159. package/package.json +1 -1
  160. package/reference.md +89 -1
  161. package/serialization/resources/auth/types/TokenGrant.d.ts +2 -1
  162. package/serialization/resources/auth/types/TokenGrant.js +2 -1
  163. package/serialization/resources/auth/types/TokenRequest.d.ts +1 -1
  164. package/serialization/resources/auth/types/TokenRequest.js +1 -1
  165. package/serialization/resources/stt/types/TimestampGranularity.d.ts +10 -0
  166. package/serialization/resources/stt/types/TimestampGranularity.js +41 -0
  167. package/serialization/resources/stt/types/index.d.ts +1 -0
  168. package/serialization/resources/stt/types/index.js +1 -0
  169. package/serialization/resources/tts/types/Controls.d.ts +2 -2
  170. package/serialization/resources/tts/types/Controls.js +2 -2
  171. package/serialization/resources/tts/types/Emotion.d.ts +1 -1
  172. package/serialization/resources/tts/types/Emotion.js +1 -27
  173. package/serialization/resources/tts/types/EmotionDeprecated.d.ts +10 -0
  174. package/serialization/resources/tts/types/EmotionDeprecated.js +67 -0
  175. package/serialization/resources/tts/types/GenerationConfig.d.ts +15 -0
  176. package/serialization/resources/tts/types/GenerationConfig.js +46 -0
  177. package/serialization/resources/tts/types/GenerationRequest.d.ts +3 -1
  178. package/serialization/resources/tts/types/GenerationRequest.js +3 -1
  179. package/serialization/resources/tts/types/SseOutputFormat.d.ts +15 -0
  180. package/serialization/resources/tts/types/SseOutputFormat.js +46 -0
  181. package/serialization/resources/tts/types/TtsRequest.d.ts +2 -0
  182. package/serialization/resources/tts/types/TtsRequest.js +2 -0
  183. package/serialization/resources/tts/types/TtssseRequest.d.ts +29 -0
  184. package/serialization/resources/tts/types/TtssseRequest.js +60 -0
  185. package/serialization/resources/tts/types/WebSocketTtsRequest.d.ts +3 -1
  186. package/serialization/resources/tts/types/WebSocketTtsRequest.js +3 -1
  187. package/serialization/resources/tts/types/index.d.ts +5 -1
  188. package/serialization/resources/tts/types/index.js +5 -1
  189. package/version.d.ts +1 -1
  190. package/version.js +1 -1
  191. package/wrapper/StreamingSTTClient.d.ts +22 -2
  192. package/wrapper/StreamingSTTClient.js +124 -1
  193. package/wrapper/SttWebsocket.d.ts +8 -3
  194. package/wrapper/SttWebsocket.js +24 -3
  195. package/wrapper/Websocket.js +1 -1
package/Client.d.ts CHANGED
@@ -6,6 +6,7 @@ import * as core from "./core";
6
6
  import { ApiStatus } from "./api/resources/apiStatus/client/Client";
7
7
  import { Auth } from "./api/resources/auth/client/Client";
8
8
  import { Infill } from "./api/resources/infill/client/Client";
9
+ import { Stt } from "./api/resources/stt/client/Client";
9
10
  import { Tts } from "./api/resources/tts/client/Client";
10
11
  import { VoiceChanger } from "./api/resources/voiceChanger/client/Client";
11
12
  import { Voices } from "./api/resources/voices/client/Client";
@@ -37,6 +38,7 @@ export declare class CartesiaClient {
37
38
  protected _apiStatus: ApiStatus | undefined;
38
39
  protected _auth: Auth | undefined;
39
40
  protected _infill: Infill | undefined;
41
+ protected _stt: Stt | undefined;
40
42
  protected _tts: Tts | undefined;
41
43
  protected _voiceChanger: VoiceChanger | undefined;
42
44
  protected _voices: Voices | undefined;
@@ -44,6 +46,7 @@ export declare class CartesiaClient {
44
46
  get apiStatus(): ApiStatus;
45
47
  get auth(): Auth;
46
48
  get infill(): Infill;
49
+ get stt(): Stt;
47
50
  get tts(): Tts;
48
51
  get voiceChanger(): VoiceChanger;
49
52
  get voices(): Voices;
package/Client.js CHANGED
@@ -7,9 +7,10 @@ exports.CartesiaClient = void 0;
7
7
  const Client_1 = require("./api/resources/apiStatus/client/Client");
8
8
  const Client_2 = require("./api/resources/auth/client/Client");
9
9
  const Client_3 = require("./api/resources/infill/client/Client");
10
- const Client_4 = require("./api/resources/tts/client/Client");
11
- const Client_5 = require("./api/resources/voiceChanger/client/Client");
12
- const Client_6 = require("./api/resources/voices/client/Client");
10
+ const Client_4 = require("./api/resources/stt/client/Client");
11
+ const Client_5 = require("./api/resources/tts/client/Client");
12
+ const Client_6 = require("./api/resources/voiceChanger/client/Client");
13
+ const Client_7 = require("./api/resources/voices/client/Client");
13
14
  class CartesiaClient {
14
15
  constructor(_options = {}) {
15
16
  this._options = _options;
@@ -26,17 +27,21 @@ class CartesiaClient {
26
27
  var _a;
27
28
  return ((_a = this._infill) !== null && _a !== void 0 ? _a : (this._infill = new Client_3.Infill(this._options)));
28
29
  }
30
+ get stt() {
31
+ var _a;
32
+ return ((_a = this._stt) !== null && _a !== void 0 ? _a : (this._stt = new Client_4.Stt(this._options)));
33
+ }
29
34
  get tts() {
30
35
  var _a;
31
- return ((_a = this._tts) !== null && _a !== void 0 ? _a : (this._tts = new Client_4.Tts(this._options)));
36
+ return ((_a = this._tts) !== null && _a !== void 0 ? _a : (this._tts = new Client_5.Tts(this._options)));
32
37
  }
33
38
  get voiceChanger() {
34
39
  var _a;
35
- return ((_a = this._voiceChanger) !== null && _a !== void 0 ? _a : (this._voiceChanger = new Client_5.VoiceChanger(this._options)));
40
+ return ((_a = this._voiceChanger) !== null && _a !== void 0 ? _a : (this._voiceChanger = new Client_6.VoiceChanger(this._options)));
36
41
  }
37
42
  get voices() {
38
43
  var _a;
39
- return ((_a = this._voices) !== null && _a !== void 0 ? _a : (this._voices = new Client_6.Voices(this._options)));
44
+ return ((_a = this._voices) !== null && _a !== void 0 ? _a : (this._voices = new Client_7.Voices(this._options)));
40
45
  }
41
46
  }
42
47
  exports.CartesiaClient = CartesiaClient;