@elevenlabs/elevenlabs-js 2.4.0 → 2.5.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.
Files changed (378) hide show
  1. package/Client.d.ts +3 -3
  2. package/Client.js +15 -15
  3. package/api/errors/BadRequestError.d.ts +2 -1
  4. package/api/resources/audioIsolation/client/requests/BodyAudioIsolationStreamV1AudioIsolationStreamPost.d.ts +2 -2
  5. package/api/resources/audioIsolation/client/requests/BodyAudioIsolationV1AudioIsolationPost.d.ts +2 -2
  6. package/api/resources/audioNative/client/requests/BodyCreatesAudioNativeEnabledProjectV1AudioNativePost.d.ts +2 -2
  7. package/api/resources/audioNative/client/requests/BodyUpdateAudioNativeProjectContentV1AudioNativeProjectIdContentPost.d.ts +2 -2
  8. package/api/resources/conversationalAi/client/Client.js +5 -0
  9. package/api/resources/conversationalAi/client/requests/BodyAddToKnowledgeBaseV1ConvaiKnowledgeBasePost.d.ts +3 -2
  10. package/api/resources/conversationalAi/resources/agents/resources/widget/resources/avatar/client/requests/BodyPostAgentAvatarV1ConvaiAgentsAgentIdAvatarPost.d.ts +2 -2
  11. package/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/Client.d.ts +2 -1
  12. package/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/Client.js +11 -4
  13. package/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/requests/BodyCreateFileDocumentV1ConvaiKnowledgeBaseFilePost.d.ts +2 -2
  14. package/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/requests/DocumentsGetRequest.d.ts +10 -0
  15. package/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/requests/index.d.ts +1 -0
  16. package/api/resources/conversationalAi/resources/phoneNumbers/client/Client.js +2 -2
  17. package/api/resources/dubbing/client/requests/BodyDubAVideoOrAnAudioFileV1DubbingPost.d.ts +5 -5
  18. package/api/resources/forcedAlignment/client/requests/BodyCreateForcedAlignmentV1ForcedAlignmentPost.d.ts +2 -2
  19. package/api/resources/history/client/Client.js +6 -1
  20. package/api/resources/index.d.ts +0 -1
  21. package/api/resources/index.js +0 -1
  22. package/api/resources/pronunciationDictionaries/client/Client.js +4 -4
  23. package/api/resources/pronunciationDictionaries/client/requests/BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromFilePost.d.ts +2 -2
  24. package/api/resources/speechToSpeech/client/requests/BodySpeechToSpeechStreamingV1SpeechToSpeechVoiceIdStreamPost.d.ts +2 -2
  25. package/api/resources/speechToSpeech/client/requests/BodySpeechToSpeechV1SpeechToSpeechVoiceIdPost.d.ts +2 -2
  26. package/api/resources/speechToText/client/Client.d.ts +3 -1
  27. package/api/resources/speechToText/client/Client.js +10 -7
  28. package/api/resources/speechToText/client/requests/BodySpeechToTextV1SpeechToTextPost.d.ts +4 -2
  29. package/api/resources/studio/resources/projects/client/requests/BodyCreateStudioProjectV1StudioProjectsPost.d.ts +9 -3
  30. package/api/resources/studio/resources/projects/resources/content/client/Client.js +3 -0
  31. package/api/resources/studio/resources/projects/resources/content/client/requests/BodyUpdateStudioProjectContentV1StudioProjectsProjectIdContentPost.d.ts +10 -2
  32. package/api/resources/studio/resources/projects/types/ProjectsCreateRequestSourceType.d.ts +2 -1
  33. package/api/resources/studio/resources/projects/types/ProjectsCreateRequestSourceType.js +1 -0
  34. package/api/resources/voices/client/requests/BodyEditVoiceV1VoicesVoiceIdEditPost.d.ts +2 -2
  35. package/api/resources/voices/client/requests/BodyGetSimilarLibraryVoicesV1SimilarVoicesPost.d.ts +2 -2
  36. package/api/resources/voices/resources/ivc/client/requests/BodyAddVoiceV1VoicesAddPost.d.ts +2 -2
  37. package/api/resources/voices/resources/pvc/resources/samples/client/requests/BodyAddSamplesToPvcVoiceV1VoicesPvcVoiceIdSamplesPost.d.ts +2 -2
  38. package/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/Client.d.ts +5 -2
  39. package/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/Client.js +14 -5
  40. package/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/index.d.ts +1 -0
  41. package/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/index.js +15 -0
  42. package/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/requests/AudioGetRequest.d.ts +15 -0
  43. package/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/requests/index.d.ts +1 -0
  44. package/api/resources/voices/resources/pvc/resources/samples/resources/index.d.ts +1 -0
  45. package/api/resources/voices/resources/pvc/resources/samples/resources/index.js +4 -0
  46. package/api/resources/voices/resources/pvc/resources/verification/client/requests/BodyRequestManualVerificationV1VoicesPvcVoiceIdVerificationPost.d.ts +2 -2
  47. package/api/resources/voices/resources/pvc/resources/verification/resources/captcha/client/requests/BodyVerifyPvcVoiceCaptchaV1VoicesPvcVoiceIdCaptchaPost.d.ts +2 -2
  48. package/api/resources/workspace/client/Client.d.ts +0 -67
  49. package/api/resources/workspace/client/Client.js +0 -326
  50. package/api/resources/workspace/client/index.d.ts +0 -1
  51. package/api/resources/workspace/client/index.js +0 -15
  52. package/api/types/AddProjectRequest.d.ts +7 -1
  53. package/api/types/AuthConnectionLocator.d.ts +9 -0
  54. package/api/types/BadRequestErrorBody.d.ts +7 -0
  55. package/api/types/BodyAddProjectV1ProjectsAddPostSourceType.d.ts +2 -1
  56. package/api/types/BodyAddProjectV1ProjectsAddPostSourceType.js +1 -0
  57. package/api/types/BodyEditProjectContentV1ProjectsProjectIdContentPost.d.ts +8 -0
  58. package/api/types/BreakdownTypes.d.ts +3 -1
  59. package/api/types/BreakdownTypes.js +2 -0
  60. package/api/types/BuiltInToolsInput.d.ts +2 -0
  61. package/api/types/BuiltInToolsOutput.d.ts +2 -0
  62. package/api/types/ChapterResponse.d.ts +2 -0
  63. package/api/types/ChapterWithContentResponseModel.d.ts +2 -0
  64. package/api/types/ForcedAlignmentResponseModel.d.ts +2 -0
  65. package/api/types/ForcedAlignmentWordResponseModel.d.ts +2 -0
  66. package/api/types/MetricType.d.ts +2 -1
  67. package/api/types/MetricType.js +1 -0
  68. package/api/types/PlayDtmfToolConfig.d.ts +11 -0
  69. package/api/types/ProjectExtendedResponse.d.ts +2 -2
  70. package/api/types/ProjectExtendedResponseModelSourceType.d.ts +2 -1
  71. package/api/types/ProjectExtendedResponseModelSourceType.js +1 -0
  72. package/api/types/ProjectResponseModelSourceType.d.ts +2 -1
  73. package/api/types/ProjectResponseModelSourceType.js +1 -0
  74. package/api/types/SystemToolConfigInputParams.d.ts +4 -1
  75. package/api/types/SystemToolConfigOutputParams.d.ts +4 -1
  76. package/api/types/WebhookToolApiSchemaConfigInput.d.ts +2 -0
  77. package/api/types/WebhookToolApiSchemaConfigOutput.d.ts +2 -0
  78. package/api/types/WorkspaceResourceType.d.ts +2 -1
  79. package/api/types/WorkspaceResourceType.js +1 -0
  80. package/api/types/index.d.ts +3 -4
  81. package/api/types/index.js +3 -4
  82. package/core/fetcher/BinaryResponse.d.ts +17 -0
  83. package/core/fetcher/BinaryResponse.js +14 -0
  84. package/core/fetcher/Fetcher.d.ts +1 -1
  85. package/core/fetcher/ResponseWithBody.d.ts +4 -0
  86. package/core/fetcher/ResponseWithBody.js +6 -0
  87. package/core/fetcher/getFetchFn.js +3 -3
  88. package/core/fetcher/getResponseBody.js +33 -32
  89. package/core/fetcher/index.d.ts +1 -0
  90. package/core/file.d.ts +1 -0
  91. package/core/form-data-utils/FormDataWrapper.d.ts +5 -52
  92. package/core/form-data-utils/FormDataWrapper.js +104 -124
  93. package/core/index.d.ts +1 -0
  94. package/core/index.js +1 -0
  95. package/dist/Client.d.ts +3 -3
  96. package/dist/Client.js +15 -15
  97. package/dist/api/errors/BadRequestError.d.ts +2 -1
  98. package/dist/api/resources/audioIsolation/client/requests/BodyAudioIsolationStreamV1AudioIsolationStreamPost.d.ts +2 -2
  99. package/dist/api/resources/audioIsolation/client/requests/BodyAudioIsolationV1AudioIsolationPost.d.ts +2 -2
  100. package/dist/api/resources/audioNative/client/requests/BodyCreatesAudioNativeEnabledProjectV1AudioNativePost.d.ts +2 -2
  101. package/dist/api/resources/audioNative/client/requests/BodyUpdateAudioNativeProjectContentV1AudioNativeProjectIdContentPost.d.ts +2 -2
  102. package/dist/api/resources/conversationalAi/client/Client.js +5 -0
  103. package/dist/api/resources/conversationalAi/client/requests/BodyAddToKnowledgeBaseV1ConvaiKnowledgeBasePost.d.ts +3 -2
  104. package/dist/api/resources/conversationalAi/resources/agents/resources/widget/resources/avatar/client/requests/BodyPostAgentAvatarV1ConvaiAgentsAgentIdAvatarPost.d.ts +2 -2
  105. package/dist/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/Client.d.ts +2 -1
  106. package/dist/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/Client.js +11 -4
  107. package/dist/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/requests/BodyCreateFileDocumentV1ConvaiKnowledgeBaseFilePost.d.ts +2 -2
  108. package/dist/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/requests/DocumentsGetRequest.d.ts +10 -0
  109. package/dist/api/resources/conversationalAi/resources/knowledgeBase/resources/documents/client/requests/index.d.ts +1 -0
  110. package/dist/api/resources/conversationalAi/resources/phoneNumbers/client/Client.js +2 -2
  111. package/dist/api/resources/dubbing/client/requests/BodyDubAVideoOrAnAudioFileV1DubbingPost.d.ts +5 -5
  112. package/dist/api/resources/forcedAlignment/client/requests/BodyCreateForcedAlignmentV1ForcedAlignmentPost.d.ts +2 -2
  113. package/dist/api/resources/history/client/Client.js +6 -1
  114. package/dist/api/resources/index.d.ts +0 -1
  115. package/dist/api/resources/index.js +0 -1
  116. package/dist/api/resources/pronunciationDictionaries/client/Client.js +4 -4
  117. package/dist/api/resources/pronunciationDictionaries/client/requests/BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromFilePost.d.ts +2 -2
  118. package/dist/api/resources/speechToSpeech/client/requests/BodySpeechToSpeechStreamingV1SpeechToSpeechVoiceIdStreamPost.d.ts +2 -2
  119. package/dist/api/resources/speechToSpeech/client/requests/BodySpeechToSpeechV1SpeechToSpeechVoiceIdPost.d.ts +2 -2
  120. package/dist/api/resources/speechToText/client/Client.d.ts +3 -1
  121. package/dist/api/resources/speechToText/client/Client.js +10 -7
  122. package/dist/api/resources/speechToText/client/requests/BodySpeechToTextV1SpeechToTextPost.d.ts +4 -2
  123. package/dist/api/resources/studio/resources/projects/client/requests/BodyCreateStudioProjectV1StudioProjectsPost.d.ts +9 -3
  124. package/dist/api/resources/studio/resources/projects/resources/content/client/Client.js +3 -0
  125. package/dist/api/resources/studio/resources/projects/resources/content/client/requests/BodyUpdateStudioProjectContentV1StudioProjectsProjectIdContentPost.d.ts +10 -2
  126. package/dist/api/resources/studio/resources/projects/types/ProjectsCreateRequestSourceType.d.ts +2 -1
  127. package/dist/api/resources/studio/resources/projects/types/ProjectsCreateRequestSourceType.js +1 -0
  128. package/dist/api/resources/voices/client/requests/BodyEditVoiceV1VoicesVoiceIdEditPost.d.ts +2 -2
  129. package/dist/api/resources/voices/client/requests/BodyGetSimilarLibraryVoicesV1SimilarVoicesPost.d.ts +2 -2
  130. package/dist/api/resources/voices/resources/ivc/client/requests/BodyAddVoiceV1VoicesAddPost.d.ts +2 -2
  131. package/dist/api/resources/voices/resources/pvc/resources/samples/client/requests/BodyAddSamplesToPvcVoiceV1VoicesPvcVoiceIdSamplesPost.d.ts +2 -2
  132. package/dist/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/Client.d.ts +5 -2
  133. package/dist/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/Client.js +14 -5
  134. package/dist/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/index.d.ts +1 -0
  135. package/dist/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/index.js +15 -0
  136. package/dist/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/requests/AudioGetRequest.d.ts +15 -0
  137. package/dist/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/requests/index.d.ts +1 -0
  138. package/dist/api/resources/voices/resources/pvc/resources/samples/resources/audio/client/requests/index.js +2 -0
  139. package/dist/api/resources/voices/resources/pvc/resources/samples/resources/index.d.ts +1 -0
  140. package/dist/api/resources/voices/resources/pvc/resources/samples/resources/index.js +4 -0
  141. package/dist/api/resources/voices/resources/pvc/resources/verification/client/requests/BodyRequestManualVerificationV1VoicesPvcVoiceIdVerificationPost.d.ts +2 -2
  142. package/dist/api/resources/voices/resources/pvc/resources/verification/resources/captcha/client/requests/BodyVerifyPvcVoiceCaptchaV1VoicesPvcVoiceIdCaptchaPost.d.ts +2 -2
  143. package/dist/api/resources/workspace/client/Client.d.ts +0 -67
  144. package/dist/api/resources/workspace/client/Client.js +0 -326
  145. package/dist/api/resources/workspace/client/index.d.ts +0 -1
  146. package/dist/api/resources/workspace/client/index.js +0 -15
  147. package/dist/api/types/AddProjectRequest.d.ts +7 -1
  148. package/dist/api/types/AuthConnectionLocator.d.ts +9 -0
  149. package/dist/api/types/BadRequestErrorBody.d.ts +7 -0
  150. package/dist/api/types/BodyAddProjectV1ProjectsAddPostSourceType.d.ts +2 -1
  151. package/dist/api/types/BodyAddProjectV1ProjectsAddPostSourceType.js +1 -0
  152. package/dist/api/types/BodyEditProjectContentV1ProjectsProjectIdContentPost.d.ts +8 -0
  153. package/dist/api/types/BreakdownTypes.d.ts +3 -1
  154. package/dist/api/types/BreakdownTypes.js +2 -0
  155. package/dist/api/types/BuiltInToolsInput.d.ts +2 -0
  156. package/dist/api/types/BuiltInToolsOutput.d.ts +2 -0
  157. package/dist/api/types/ChapterResponse.d.ts +2 -0
  158. package/dist/api/types/ChapterWithContentResponseModel.d.ts +2 -0
  159. package/dist/api/types/ForcedAlignmentResponseModel.d.ts +2 -0
  160. package/dist/api/types/ForcedAlignmentWordResponseModel.d.ts +2 -0
  161. package/dist/api/types/MetricType.d.ts +2 -1
  162. package/dist/api/types/MetricType.js +1 -0
  163. package/dist/api/types/PlayDtmfToolConfig.d.ts +11 -0
  164. package/dist/api/types/ProjectExtendedResponse.d.ts +2 -2
  165. package/dist/api/types/ProjectExtendedResponseModelSourceType.d.ts +2 -1
  166. package/dist/api/types/ProjectExtendedResponseModelSourceType.js +1 -0
  167. package/dist/api/types/ProjectResponseModelSourceType.d.ts +2 -1
  168. package/dist/api/types/ProjectResponseModelSourceType.js +1 -0
  169. package/dist/api/types/SystemToolConfigInputParams.d.ts +4 -1
  170. package/dist/api/types/SystemToolConfigOutputParams.d.ts +4 -1
  171. package/dist/api/types/WebhookToolApiSchemaConfigInput.d.ts +2 -0
  172. package/dist/api/types/WebhookToolApiSchemaConfigOutput.d.ts +2 -0
  173. package/dist/api/types/WorkspaceResourceType.d.ts +2 -1
  174. package/dist/api/types/WorkspaceResourceType.js +1 -0
  175. package/dist/api/types/index.d.ts +3 -4
  176. package/dist/api/types/index.js +3 -4
  177. package/dist/core/fetcher/BinaryResponse.d.ts +17 -0
  178. package/dist/core/fetcher/BinaryResponse.js +14 -0
  179. package/dist/core/fetcher/Fetcher.d.ts +1 -1
  180. package/dist/core/fetcher/ResponseWithBody.d.ts +4 -0
  181. package/dist/core/fetcher/ResponseWithBody.js +6 -0
  182. package/dist/core/fetcher/getFetchFn.js +3 -3
  183. package/dist/core/fetcher/getResponseBody.js +33 -32
  184. package/dist/core/fetcher/index.d.ts +1 -0
  185. package/dist/core/file.d.ts +1 -0
  186. package/dist/core/file.js +2 -0
  187. package/dist/core/form-data-utils/FormDataWrapper.d.ts +5 -52
  188. package/dist/core/form-data-utils/FormDataWrapper.js +104 -124
  189. package/dist/core/index.d.ts +1 -0
  190. package/dist/core/index.js +1 -0
  191. package/dist/environments.d.ts +5 -1
  192. package/dist/environments.js +4 -0
  193. package/dist/serialization/resources/index.d.ts +0 -1
  194. package/dist/serialization/resources/index.js +0 -1
  195. package/dist/serialization/resources/studio/resources/projects/types/ProjectsCreateRequestSourceType.d.ts +1 -1
  196. package/dist/serialization/resources/studio/resources/projects/types/ProjectsCreateRequestSourceType.js +1 -1
  197. package/dist/serialization/resources/workspace/index.d.ts +0 -1
  198. package/dist/serialization/resources/workspace/index.js +0 -1
  199. package/dist/serialization/types/AuthConnectionLocator.d.ts +12 -0
  200. package/dist/serialization/{resources/workspace/client/getShareOptions.js → types/AuthConnectionLocator.js} +5 -4
  201. package/dist/serialization/types/BadRequestErrorBody.d.ts +13 -0
  202. package/{serialization/resources/workspace/client/getShareOptions.js → dist/serialization/types/BadRequestErrorBody.js} +6 -4
  203. package/dist/serialization/types/BodyAddProjectV1ProjectsAddPostSourceType.d.ts +1 -1
  204. package/dist/serialization/types/BodyAddProjectV1ProjectsAddPostSourceType.js +1 -1
  205. package/dist/serialization/types/BodyEditProjectContentV1ProjectsProjectIdContentPost.d.ts +1 -0
  206. package/dist/serialization/types/BodyEditProjectContentV1ProjectsProjectIdContentPost.js +1 -0
  207. package/dist/serialization/types/BreakdownTypes.d.ts +1 -1
  208. package/dist/serialization/types/BreakdownTypes.js +2 -0
  209. package/dist/serialization/types/BuiltInToolsInput.d.ts +1 -0
  210. package/dist/serialization/types/BuiltInToolsInput.js +1 -0
  211. package/dist/serialization/types/BuiltInToolsOutput.d.ts +1 -0
  212. package/dist/serialization/types/BuiltInToolsOutput.js +1 -0
  213. package/dist/serialization/types/ChapterResponse.d.ts +1 -0
  214. package/dist/serialization/types/ChapterResponse.js +1 -0
  215. package/dist/serialization/types/ChapterWithContentResponseModel.d.ts +1 -0
  216. package/dist/serialization/types/ChapterWithContentResponseModel.js +1 -0
  217. package/dist/serialization/types/ForcedAlignmentResponseModel.d.ts +1 -0
  218. package/dist/serialization/types/ForcedAlignmentResponseModel.js +1 -0
  219. package/dist/serialization/types/ForcedAlignmentWordResponseModel.d.ts +1 -0
  220. package/dist/serialization/types/ForcedAlignmentWordResponseModel.js +1 -0
  221. package/dist/serialization/types/MetricType.d.ts +1 -1
  222. package/dist/serialization/types/MetricType.js +9 -1
  223. package/dist/serialization/types/PlayDtmfToolConfig.d.ts +11 -0
  224. package/dist/serialization/types/PlayDtmfToolConfig.js +41 -0
  225. package/dist/serialization/types/ProjectExtendedResponse.d.ts +1 -1
  226. package/dist/serialization/types/ProjectExtendedResponse.js +1 -1
  227. package/dist/serialization/types/ProjectExtendedResponseModelSourceType.d.ts +1 -1
  228. package/dist/serialization/types/ProjectExtendedResponseModelSourceType.js +1 -1
  229. package/dist/serialization/types/ProjectResponseModelSourceType.d.ts +1 -1
  230. package/dist/serialization/types/ProjectResponseModelSourceType.js +1 -1
  231. package/dist/serialization/types/SystemToolConfigInputParams.d.ts +5 -1
  232. package/dist/serialization/types/SystemToolConfigInputParams.js +2 -0
  233. package/dist/serialization/types/SystemToolConfigOutputParams.d.ts +5 -1
  234. package/dist/serialization/types/SystemToolConfigOutputParams.js +2 -0
  235. package/dist/serialization/types/WebhookToolApiSchemaConfigInput.d.ts +2 -0
  236. package/dist/serialization/types/WebhookToolApiSchemaConfigInput.js +2 -0
  237. package/dist/serialization/types/WebhookToolApiSchemaConfigOutput.d.ts +2 -0
  238. package/dist/serialization/types/WebhookToolApiSchemaConfigOutput.js +2 -0
  239. package/dist/serialization/types/WorkspaceResourceType.d.ts +1 -1
  240. package/dist/serialization/types/WorkspaceResourceType.js +1 -0
  241. package/dist/serialization/types/index.d.ts +3 -4
  242. package/dist/serialization/types/index.js +3 -4
  243. package/dist/version.d.ts +1 -1
  244. package/dist/version.js +1 -1
  245. package/dist/wrapper/play.d.ts +1 -2
  246. package/dist/wrapper/play.js +69 -36
  247. package/dist/wrapper/stream.d.ts +1 -2
  248. package/dist/wrapper/stream.js +64 -37
  249. package/dist/wrapper/utils.d.ts +2 -0
  250. package/dist/wrapper/utils.js +41 -0
  251. package/environments.d.ts +5 -1
  252. package/environments.js +4 -0
  253. package/jest.browser.config.mjs +10 -0
  254. package/jest.config.mjs +4 -1
  255. package/package.json +7 -10
  256. package/reference.md +23 -247
  257. package/serialization/resources/index.d.ts +0 -1
  258. package/serialization/resources/index.js +0 -1
  259. package/serialization/resources/studio/resources/projects/types/ProjectsCreateRequestSourceType.d.ts +1 -1
  260. package/serialization/resources/studio/resources/projects/types/ProjectsCreateRequestSourceType.js +1 -1
  261. package/serialization/resources/workspace/index.d.ts +0 -1
  262. package/serialization/resources/workspace/index.js +0 -1
  263. package/serialization/types/AuthConnectionLocator.d.ts +12 -0
  264. package/serialization/{resources/workspace/client/requests/BodyUpdateUserAutoProvisioningV1WorkspaceUserAutoProvisioningPost.js → types/AuthConnectionLocator.js} +4 -4
  265. package/serialization/types/BadRequestErrorBody.d.ts +13 -0
  266. package/{dist/serialization/resources/workspace/client/requests/BodyUpdateUserAutoProvisioningV1WorkspaceUserAutoProvisioningPost.js → serialization/types/BadRequestErrorBody.js} +5 -4
  267. package/serialization/types/BodyAddProjectV1ProjectsAddPostSourceType.d.ts +1 -1
  268. package/serialization/types/BodyAddProjectV1ProjectsAddPostSourceType.js +1 -1
  269. package/serialization/types/BodyEditProjectContentV1ProjectsProjectIdContentPost.d.ts +1 -0
  270. package/serialization/types/BodyEditProjectContentV1ProjectsProjectIdContentPost.js +1 -0
  271. package/serialization/types/BreakdownTypes.d.ts +1 -1
  272. package/serialization/types/BreakdownTypes.js +2 -0
  273. package/serialization/types/BuiltInToolsInput.d.ts +1 -0
  274. package/serialization/types/BuiltInToolsInput.js +1 -0
  275. package/serialization/types/BuiltInToolsOutput.d.ts +1 -0
  276. package/serialization/types/BuiltInToolsOutput.js +1 -0
  277. package/serialization/types/ChapterResponse.d.ts +1 -0
  278. package/serialization/types/ChapterResponse.js +1 -0
  279. package/serialization/types/ChapterWithContentResponseModel.d.ts +1 -0
  280. package/serialization/types/ChapterWithContentResponseModel.js +1 -0
  281. package/serialization/types/ForcedAlignmentResponseModel.d.ts +1 -0
  282. package/serialization/types/ForcedAlignmentResponseModel.js +1 -0
  283. package/serialization/types/ForcedAlignmentWordResponseModel.d.ts +1 -0
  284. package/serialization/types/ForcedAlignmentWordResponseModel.js +1 -0
  285. package/serialization/types/MetricType.d.ts +1 -1
  286. package/serialization/types/MetricType.js +9 -1
  287. package/serialization/types/PlayDtmfToolConfig.d.ts +11 -0
  288. package/serialization/types/PlayDtmfToolConfig.js +41 -0
  289. package/serialization/types/ProjectExtendedResponse.d.ts +1 -1
  290. package/serialization/types/ProjectExtendedResponse.js +1 -1
  291. package/serialization/types/ProjectExtendedResponseModelSourceType.d.ts +1 -1
  292. package/serialization/types/ProjectExtendedResponseModelSourceType.js +1 -1
  293. package/serialization/types/ProjectResponseModelSourceType.d.ts +1 -1
  294. package/serialization/types/ProjectResponseModelSourceType.js +1 -1
  295. package/serialization/types/SystemToolConfigInputParams.d.ts +5 -1
  296. package/serialization/types/SystemToolConfigInputParams.js +2 -0
  297. package/serialization/types/SystemToolConfigOutputParams.d.ts +5 -1
  298. package/serialization/types/SystemToolConfigOutputParams.js +2 -0
  299. package/serialization/types/WebhookToolApiSchemaConfigInput.d.ts +2 -0
  300. package/serialization/types/WebhookToolApiSchemaConfigInput.js +2 -0
  301. package/serialization/types/WebhookToolApiSchemaConfigOutput.d.ts +2 -0
  302. package/serialization/types/WebhookToolApiSchemaConfigOutput.js +2 -0
  303. package/serialization/types/WorkspaceResourceType.d.ts +1 -1
  304. package/serialization/types/WorkspaceResourceType.js +1 -0
  305. package/serialization/types/index.d.ts +3 -4
  306. package/serialization/types/index.js +3 -4
  307. package/version.d.ts +1 -1
  308. package/version.js +1 -1
  309. package/wrapper/play.d.ts +1 -2
  310. package/wrapper/play.js +69 -36
  311. package/wrapper/stream.d.ts +1 -2
  312. package/wrapper/stream.js +64 -37
  313. package/wrapper/utils.d.ts +2 -0
  314. package/wrapper/utils.js +41 -0
  315. package/api/resources/workspace/client/requests/BodyUpdateDefaultSharingPreferencesV1WorkspaceDefaultSharingPreferencesPost.d.ts +0 -13
  316. package/api/resources/workspace/client/requests/BodyUpdateUserAutoProvisioningV1WorkspaceUserAutoProvisioningPost.d.ts +0 -12
  317. package/api/resources/workspace/client/requests/index.d.ts +0 -2
  318. package/api/types/BodyRetrieveVoiceSampleAudioV1VoicesPvcVoiceIdSamplesSampleIdAudioGet.d.ts +0 -7
  319. package/api/types/DefaultSharingPreferencesResponseModel.d.ts +0 -8
  320. package/api/types/WorkspaceGroupPermission.d.ts +0 -22
  321. package/api/types/WorkspaceGroupPermission.js +0 -24
  322. package/api/types/WorkspaceGroupResponseModel.d.ts +0 -10
  323. package/core/form-data-utils/toReadableStream.d.ts +0 -1
  324. package/core/form-data-utils/toReadableStream.js +0 -28
  325. package/dist/api/resources/workspace/client/requests/BodyUpdateDefaultSharingPreferencesV1WorkspaceDefaultSharingPreferencesPost.d.ts +0 -13
  326. package/dist/api/resources/workspace/client/requests/BodyUpdateUserAutoProvisioningV1WorkspaceUserAutoProvisioningPost.d.ts +0 -12
  327. package/dist/api/resources/workspace/client/requests/index.d.ts +0 -2
  328. package/dist/api/types/BodyRetrieveVoiceSampleAudioV1VoicesPvcVoiceIdSamplesSampleIdAudioGet.d.ts +0 -7
  329. package/dist/api/types/DefaultSharingPreferencesResponseModel.d.ts +0 -8
  330. package/dist/api/types/WorkspaceGroupPermission.d.ts +0 -22
  331. package/dist/api/types/WorkspaceGroupPermission.js +0 -24
  332. package/dist/api/types/WorkspaceGroupResponseModel.d.ts +0 -10
  333. package/dist/core/form-data-utils/toReadableStream.d.ts +0 -1
  334. package/dist/core/form-data-utils/toReadableStream.js +0 -28
  335. package/dist/serialization/resources/workspace/client/getShareOptions.d.ts +0 -11
  336. package/dist/serialization/resources/workspace/client/index.d.ts +0 -2
  337. package/dist/serialization/resources/workspace/client/index.js +0 -41
  338. package/dist/serialization/resources/workspace/client/requests/BodyUpdateDefaultSharingPreferencesV1WorkspaceDefaultSharingPreferencesPost.d.ts +0 -12
  339. package/dist/serialization/resources/workspace/client/requests/BodyUpdateDefaultSharingPreferencesV1WorkspaceDefaultSharingPreferencesPost.js +0 -43
  340. package/dist/serialization/resources/workspace/client/requests/BodyUpdateUserAutoProvisioningV1WorkspaceUserAutoProvisioningPost.d.ts +0 -12
  341. package/dist/serialization/resources/workspace/client/requests/index.d.ts +0 -2
  342. package/dist/serialization/resources/workspace/client/requests/index.js +0 -7
  343. package/dist/serialization/types/BodyRetrieveVoiceSampleAudioV1VoicesPvcVoiceIdSamplesSampleIdAudioGet.d.ts +0 -12
  344. package/dist/serialization/types/BodyRetrieveVoiceSampleAudioV1VoicesPvcVoiceIdSamplesSampleIdAudioGet.js +0 -43
  345. package/dist/serialization/types/DefaultSharingPreferencesResponseModel.d.ts +0 -13
  346. package/dist/serialization/types/DefaultSharingPreferencesResponseModel.js +0 -44
  347. package/dist/serialization/types/WorkspaceGroupPermission.d.ts +0 -10
  348. package/dist/serialization/types/WorkspaceGroupPermission.js +0 -58
  349. package/dist/serialization/types/WorkspaceGroupResponseModel.d.ts +0 -16
  350. package/dist/serialization/types/WorkspaceGroupResponseModel.js +0 -47
  351. package/serialization/resources/workspace/client/getShareOptions.d.ts +0 -11
  352. package/serialization/resources/workspace/client/index.d.ts +0 -2
  353. package/serialization/resources/workspace/client/index.js +0 -41
  354. package/serialization/resources/workspace/client/requests/BodyUpdateDefaultSharingPreferencesV1WorkspaceDefaultSharingPreferencesPost.d.ts +0 -12
  355. package/serialization/resources/workspace/client/requests/BodyUpdateDefaultSharingPreferencesV1WorkspaceDefaultSharingPreferencesPost.js +0 -43
  356. package/serialization/resources/workspace/client/requests/BodyUpdateUserAutoProvisioningV1WorkspaceUserAutoProvisioningPost.d.ts +0 -12
  357. package/serialization/resources/workspace/client/requests/index.d.ts +0 -2
  358. package/serialization/resources/workspace/client/requests/index.js +0 -7
  359. package/serialization/types/BodyRetrieveVoiceSampleAudioV1VoicesPvcVoiceIdSamplesSampleIdAudioGet.d.ts +0 -12
  360. package/serialization/types/BodyRetrieveVoiceSampleAudioV1VoicesPvcVoiceIdSamplesSampleIdAudioGet.js +0 -43
  361. package/serialization/types/DefaultSharingPreferencesResponseModel.d.ts +0 -13
  362. package/serialization/types/DefaultSharingPreferencesResponseModel.js +0 -44
  363. package/serialization/types/WorkspaceGroupPermission.d.ts +0 -10
  364. package/serialization/types/WorkspaceGroupPermission.js +0 -58
  365. package/serialization/types/WorkspaceGroupResponseModel.d.ts +0 -16
  366. package/serialization/types/WorkspaceGroupResponseModel.js +0 -47
  367. /package/api/resources/{workspace/client/requests/BodyUpdateDefaultSharingPreferencesV1WorkspaceDefaultSharingPreferencesPost.js → conversationalAi/resources/knowledgeBase/resources/documents/client/requests/DocumentsGetRequest.js} +0 -0
  368. /package/api/resources/{workspace/client/requests/BodyUpdateUserAutoProvisioningV1WorkspaceUserAutoProvisioningPost.js → voices/resources/pvc/resources/samples/resources/audio/client/requests/AudioGetRequest.js} +0 -0
  369. /package/api/resources/{workspace → voices/resources/pvc/resources/samples/resources/audio}/client/requests/index.js +0 -0
  370. /package/api/types/{BodyRetrieveVoiceSampleAudioV1VoicesPvcVoiceIdSamplesSampleIdAudioGet.js → AuthConnectionLocator.js} +0 -0
  371. /package/api/types/{DefaultSharingPreferencesResponseModel.js → BadRequestErrorBody.js} +0 -0
  372. /package/api/types/{WorkspaceGroupResponseModel.js → PlayDtmfToolConfig.js} +0 -0
  373. /package/{dist/api/resources/workspace/client/requests/index.js → core/file.js} +0 -0
  374. /package/dist/api/resources/{workspace/client/requests/BodyUpdateDefaultSharingPreferencesV1WorkspaceDefaultSharingPreferencesPost.js → conversationalAi/resources/knowledgeBase/resources/documents/client/requests/DocumentsGetRequest.js} +0 -0
  375. /package/dist/api/resources/{workspace/client/requests/BodyUpdateUserAutoProvisioningV1WorkspaceUserAutoProvisioningPost.js → voices/resources/pvc/resources/samples/resources/audio/client/requests/AudioGetRequest.js} +0 -0
  376. /package/dist/api/types/{BodyRetrieveVoiceSampleAudioV1VoicesPvcVoiceIdSamplesSampleIdAudioGet.js → AuthConnectionLocator.js} +0 -0
  377. /package/dist/api/types/{DefaultSharingPreferencesResponseModel.js → BadRequestErrorBody.js} +0 -0
  378. /package/dist/api/types/{WorkspaceGroupResponseModel.js → PlayDtmfToolConfig.js} +0 -0
@@ -41,51 +41,110 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
41
41
  step((generator = generator.apply(thisArg, _arguments || [])).next());
42
42
  });
43
43
  };
44
+ var __asyncValues = (this && this.__asyncValues) || function (o) {
45
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
46
+ var m = o[Symbol.asyncIterator], i;
47
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
48
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
49
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
50
+ };
44
51
  Object.defineProperty(exports, "__esModule", { value: true });
45
- exports.WebFormData = exports.Node16FormData = exports.Node18FormData = void 0;
52
+ exports.FormDataWrapper = void 0;
46
53
  exports.newFormData = newFormData;
54
+ const json_js_1 = require("../../core/json.js");
47
55
  const index_js_1 = require("../runtime/index.js");
48
- const toReadableStream_js_1 = require("./toReadableStream.js");
49
56
  function isNamedValue(value) {
50
57
  return typeof value === "object" && value != null && "name" in value;
51
58
  }
52
59
  function isPathedValue(value) {
53
60
  return typeof value === "object" && value != null && "path" in value;
54
61
  }
62
+ function isStreamLike(value) {
63
+ return typeof value === "object" && value != null && ("read" in value || "pipe" in value);
64
+ }
65
+ function isReadableStream(value) {
66
+ return typeof value === "object" && value != null && "getReader" in value;
67
+ }
68
+ function isBuffer(value) {
69
+ return typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(value);
70
+ }
71
+ function isArrayBufferView(value) {
72
+ return ArrayBuffer.isView(value);
73
+ }
55
74
  function getLastPathSegment(pathStr) {
56
75
  const lastForwardSlash = pathStr.lastIndexOf("/");
57
76
  const lastBackSlash = pathStr.lastIndexOf("\\");
58
77
  const lastSlashIndex = Math.max(lastForwardSlash, lastBackSlash);
59
78
  return lastSlashIndex >= 0 ? pathStr.substring(lastSlashIndex + 1) : pathStr;
60
79
  }
61
- function newFormData() {
80
+ function streamToBuffer(stream) {
62
81
  return __awaiter(this, void 0, void 0, function* () {
63
- let formdata;
64
- if (index_js_1.RUNTIME.type === "node" && index_js_1.RUNTIME.parsedVersion != null && index_js_1.RUNTIME.parsedVersion >= 18) {
65
- formdata = new Node18FormData();
66
- }
67
- else if (index_js_1.RUNTIME.type === "node") {
68
- formdata = new Node16FormData();
82
+ var _a, stream_1, stream_1_1;
83
+ var _b, e_1, _c, _d;
84
+ if (index_js_1.RUNTIME.type === "node") {
85
+ const { Readable } = yield Promise.resolve().then(() => __importStar(require("stream")));
86
+ if (stream instanceof Readable) {
87
+ const chunks = [];
88
+ try {
89
+ for (_a = true, stream_1 = __asyncValues(stream); stream_1_1 = yield stream_1.next(), _b = stream_1_1.done, !_b; _a = true) {
90
+ _d = stream_1_1.value;
91
+ _a = false;
92
+ const chunk = _d;
93
+ chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
94
+ }
95
+ }
96
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
97
+ finally {
98
+ try {
99
+ if (!_a && !_b && (_c = stream_1.return)) yield _c.call(stream_1);
100
+ }
101
+ finally { if (e_1) throw e_1.error; }
102
+ }
103
+ return Buffer.concat(chunks);
104
+ }
69
105
  }
70
- else {
71
- formdata = new WebFormData();
106
+ if (isReadableStream(stream)) {
107
+ const reader = stream.getReader();
108
+ const chunks = [];
109
+ try {
110
+ while (true) {
111
+ const { done, value } = yield reader.read();
112
+ if (done)
113
+ break;
114
+ chunks.push(value);
115
+ }
116
+ }
117
+ finally {
118
+ reader.releaseLock();
119
+ }
120
+ const totalLength = chunks.reduce((sum, chunk) => sum + chunk.length, 0);
121
+ const result = new Uint8Array(totalLength);
122
+ let offset = 0;
123
+ for (const chunk of chunks) {
124
+ result.set(chunk, offset);
125
+ offset += chunk.length;
126
+ }
127
+ return Buffer.from(result);
72
128
  }
73
- yield formdata.setup();
74
- return formdata;
129
+ throw new Error("Unsupported stream type: " + typeof stream + ". Expected Node.js Readable stream or Web ReadableStream.");
130
+ });
131
+ }
132
+ function newFormData() {
133
+ return __awaiter(this, void 0, void 0, function* () {
134
+ return new FormDataWrapper();
75
135
  });
76
136
  }
77
- /**
78
- * Form Data Implementation for Node.js 18+
79
- */
80
- class Node18FormData {
137
+ class FormDataWrapper {
138
+ constructor() {
139
+ this.fd = new FormData();
140
+ }
81
141
  setup() {
82
142
  return __awaiter(this, void 0, void 0, function* () {
83
- this.fd = new (yield Promise.resolve().then(() => __importStar(require("formdata-node")))).FormData();
143
+ // noop
84
144
  });
85
145
  }
86
146
  append(key, value) {
87
- var _a;
88
- (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, value);
147
+ this.fd.append(key, String(value));
89
148
  }
90
149
  getFileName(value, filename) {
91
150
  if (filename != null) {
@@ -99,130 +158,51 @@ class Node18FormData {
99
158
  }
100
159
  return undefined;
101
160
  }
102
- appendFile(key, value, fileName) {
161
+ convertToBlob(value) {
103
162
  return __awaiter(this, void 0, void 0, function* () {
104
- var _a, _b;
105
- fileName = this.getFileName(value, fileName);
163
+ if (isStreamLike(value) || isReadableStream(value)) {
164
+ const buffer = yield streamToBuffer(value);
165
+ return new Blob([buffer]);
166
+ }
106
167
  if (value instanceof Blob) {
107
- (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, value, fileName);
168
+ return value;
108
169
  }
109
- else {
110
- (_b = this.fd) === null || _b === void 0 ? void 0 : _b.append(key, {
111
- type: undefined,
112
- name: fileName,
113
- [Symbol.toStringTag]: "File",
114
- stream() {
115
- return value;
116
- },
117
- });
170
+ if (isBuffer(value)) {
171
+ return new Blob([value]);
118
172
  }
119
- });
120
- }
121
- getRequest() {
122
- return __awaiter(this, void 0, void 0, function* () {
123
- const encoder = new (yield Promise.resolve().then(() => __importStar(require("form-data-encoder")))).FormDataEncoder(this.fd);
124
- return {
125
- body: yield (0, toReadableStream_js_1.toReadableStream)(encoder),
126
- headers: encoder.headers,
127
- duplex: "half",
128
- };
129
- });
130
- }
131
- }
132
- exports.Node18FormData = Node18FormData;
133
- /**
134
- * Form Data Implementation for Node.js 16-18
135
- */
136
- class Node16FormData {
137
- setup() {
138
- return __awaiter(this, void 0, void 0, function* () {
139
- this.fd = new (yield Promise.resolve().then(() => __importStar(require("form-data")))).default();
140
- });
141
- }
142
- append(key, value) {
143
- var _a;
144
- (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, value);
145
- }
146
- getFileName(value, filename) {
147
- if (filename != null) {
148
- return filename;
149
- }
150
- if (isNamedValue(value)) {
151
- return value.name;
152
- }
153
- if (isPathedValue(value) && value.path) {
154
- return getLastPathSegment(value.path.toString());
155
- }
156
- return undefined;
157
- }
158
- appendFile(key, value, fileName) {
159
- return __awaiter(this, void 0, void 0, function* () {
160
- var _a, _b;
161
- fileName = this.getFileName(value, fileName);
162
- let bufferedValue;
163
- if (value instanceof Blob) {
164
- bufferedValue = Buffer.from(yield value.arrayBuffer());
173
+ if (value instanceof ArrayBuffer) {
174
+ return new Blob([value]);
165
175
  }
166
- else {
167
- bufferedValue = value;
176
+ if (isArrayBufferView(value)) {
177
+ return new Blob([value]);
168
178
  }
169
- if (fileName == null) {
170
- (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, bufferedValue);
179
+ if (typeof value === "string") {
180
+ return new Blob([value]);
171
181
  }
172
- else {
173
- (_b = this.fd) === null || _b === void 0 ? void 0 : _b.append(key, bufferedValue, { filename: fileName });
182
+ if (typeof value === "object" && value !== null) {
183
+ return new Blob([(0, json_js_1.toJson)(value)], { type: "application/json" });
174
184
  }
185
+ return new Blob([String(value)]);
175
186
  });
176
187
  }
177
- getRequest() {
178
- return {
179
- body: this.fd,
180
- headers: this.fd ? this.fd.getHeaders() : {},
181
- };
182
- }
183
- }
184
- exports.Node16FormData = Node16FormData;
185
- /**
186
- * Form Data Implementation for Web
187
- */
188
- class WebFormData {
189
- setup() {
190
- return __awaiter(this, void 0, void 0, function* () {
191
- this.fd = new FormData();
192
- });
193
- }
194
- append(key, value) {
195
- var _a;
196
- (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, value);
197
- }
198
- getFileName(value, filename) {
199
- if (filename != null) {
200
- return filename;
201
- }
202
- if (isNamedValue(value)) {
203
- return value.name;
204
- }
205
- if (isPathedValue(value) && value.path) {
206
- return getLastPathSegment(value.path.toString());
207
- }
208
- return undefined;
209
- }
210
188
  appendFile(key, value, fileName) {
211
189
  return __awaiter(this, void 0, void 0, function* () {
212
- var _a, _b;
213
190
  fileName = this.getFileName(value, fileName);
214
- if (value instanceof Blob) {
215
- (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, value, fileName);
216
- return;
191
+ const blob = yield this.convertToBlob(value);
192
+ if (fileName) {
193
+ this.fd.append(key, blob, fileName);
194
+ }
195
+ else {
196
+ this.fd.append(key, blob);
217
197
  }
218
- (_b = this.fd) === null || _b === void 0 ? void 0 : _b.append(key, new Blob([value]), fileName);
219
198
  });
220
199
  }
221
200
  getRequest() {
222
201
  return {
223
202
  body: this.fd,
224
203
  headers: {},
204
+ duplex: "half",
225
205
  };
226
206
  }
227
207
  }
228
- exports.WebFormData = WebFormData;
208
+ exports.FormDataWrapper = FormDataWrapper;
package/core/index.d.ts CHANGED
@@ -2,4 +2,5 @@ export * from "./fetcher";
2
2
  export * from "./runtime";
3
3
  export * from "./form-data-utils";
4
4
  export * from "./stream";
5
+ export * from "./file";
5
6
  export * as serialization from "./schemas";
package/core/index.js CHANGED
@@ -41,4 +41,5 @@ __exportStar(require("./fetcher"), exports);
41
41
  __exportStar(require("./runtime"), exports);
42
42
  __exportStar(require("./form-data-utils"), exports);
43
43
  __exportStar(require("./stream"), exports);
44
+ __exportStar(require("./file"), exports);
44
45
  exports.serialization = __importStar(require("./schemas"));
package/dist/Client.d.ts CHANGED
@@ -19,11 +19,11 @@ import { Models } from "./api/resources/models/client/Client";
19
19
  import { AudioNative } from "./api/resources/audioNative/client/Client";
20
20
  import { Usage } from "./api/resources/usage/client/Client";
21
21
  import { PronunciationDictionaries } from "./api/resources/pronunciationDictionaries/client/Client";
22
- import { Workspace } from "./api/resources/workspace/client/Client";
23
22
  import { Webhooks } from "./api/resources/webhooks/client/Client";
24
23
  import { SpeechToText } from "./api/resources/speechToText/client/Client";
25
24
  import { ForcedAlignment } from "./api/resources/forcedAlignment/client/Client";
26
25
  import { ConversationalAi } from "./api/resources/conversationalAi/client/Client";
26
+ import { Workspace } from "./api/resources/workspace/client/Client";
27
27
  export declare namespace ElevenLabsClient {
28
28
  interface Options {
29
29
  environment?: core.Supplier<environments.ElevenLabsEnvironment | environments.ElevenLabsEnvironmentUrls>;
@@ -65,11 +65,11 @@ export declare class ElevenLabsClient {
65
65
  protected _audioNative: AudioNative | undefined;
66
66
  protected _usage: Usage | undefined;
67
67
  protected _pronunciationDictionaries: PronunciationDictionaries | undefined;
68
- protected _workspace: Workspace | undefined;
69
68
  protected _webhooks: Webhooks | undefined;
70
69
  protected _speechToText: SpeechToText | undefined;
71
70
  protected _forcedAlignment: ForcedAlignment | undefined;
72
71
  protected _conversationalAi: ConversationalAi | undefined;
72
+ protected _workspace: Workspace | undefined;
73
73
  constructor(_options?: ElevenLabsClient.Options);
74
74
  get history(): History;
75
75
  get textToSoundEffects(): TextToSoundEffects;
@@ -87,9 +87,9 @@ export declare class ElevenLabsClient {
87
87
  get audioNative(): AudioNative;
88
88
  get usage(): Usage;
89
89
  get pronunciationDictionaries(): PronunciationDictionaries;
90
- get workspace(): Workspace;
91
90
  get webhooks(): Webhooks;
92
91
  get speechToText(): SpeechToText;
93
92
  get forcedAlignment(): ForcedAlignment;
94
93
  get conversationalAi(): ConversationalAi;
94
+ get workspace(): Workspace;
95
95
  }
package/dist/Client.js CHANGED
@@ -55,19 +55,19 @@ const Client_13 = require("./api/resources/models/client/Client");
55
55
  const Client_14 = require("./api/resources/audioNative/client/Client");
56
56
  const Client_15 = require("./api/resources/usage/client/Client");
57
57
  const Client_16 = require("./api/resources/pronunciationDictionaries/client/Client");
58
- const Client_17 = require("./api/resources/workspace/client/Client");
59
- const Client_18 = require("./api/resources/webhooks/client/Client");
60
- const Client_19 = require("./api/resources/speechToText/client/Client");
61
- const Client_20 = require("./api/resources/forcedAlignment/client/Client");
62
- const Client_21 = require("./api/resources/conversationalAi/client/Client");
58
+ const Client_17 = require("./api/resources/webhooks/client/Client");
59
+ const Client_18 = require("./api/resources/speechToText/client/Client");
60
+ const Client_19 = require("./api/resources/forcedAlignment/client/Client");
61
+ const Client_20 = require("./api/resources/conversationalAi/client/Client");
62
+ const Client_21 = require("./api/resources/workspace/client/Client");
63
63
  class ElevenLabsClient {
64
64
  constructor(_options = {}) {
65
65
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
66
66
  "xi-api-key": _options === null || _options === void 0 ? void 0 : _options.apiKey,
67
67
  "X-Fern-Language": "JavaScript",
68
68
  "X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js",
69
- "X-Fern-SDK-Version": "v2.4.0",
70
- "User-Agent": "@elevenlabs/elevenlabs-js/v2.4.0",
69
+ "X-Fern-SDK-Version": "v2.5.0",
70
+ "User-Agent": "@elevenlabs/elevenlabs-js/v2.5.0",
71
71
  "X-Fern-Runtime": core.RUNTIME.type,
72
72
  "X-Fern-Runtime-Version": core.RUNTIME.version,
73
73
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -136,25 +136,25 @@ class ElevenLabsClient {
136
136
  var _a;
137
137
  return ((_a = this._pronunciationDictionaries) !== null && _a !== void 0 ? _a : (this._pronunciationDictionaries = new Client_16.PronunciationDictionaries(this._options)));
138
138
  }
139
- get workspace() {
140
- var _a;
141
- return ((_a = this._workspace) !== null && _a !== void 0 ? _a : (this._workspace = new Client_17.Workspace(this._options)));
142
- }
143
139
  get webhooks() {
144
140
  var _a;
145
- return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_18.Webhooks(this._options)));
141
+ return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_17.Webhooks(this._options)));
146
142
  }
147
143
  get speechToText() {
148
144
  var _a;
149
- return ((_a = this._speechToText) !== null && _a !== void 0 ? _a : (this._speechToText = new Client_19.SpeechToText(this._options)));
145
+ return ((_a = this._speechToText) !== null && _a !== void 0 ? _a : (this._speechToText = new Client_18.SpeechToText(this._options)));
150
146
  }
151
147
  get forcedAlignment() {
152
148
  var _a;
153
- return ((_a = this._forcedAlignment) !== null && _a !== void 0 ? _a : (this._forcedAlignment = new Client_20.ForcedAlignment(this._options)));
149
+ return ((_a = this._forcedAlignment) !== null && _a !== void 0 ? _a : (this._forcedAlignment = new Client_19.ForcedAlignment(this._options)));
154
150
  }
155
151
  get conversationalAi() {
156
152
  var _a;
157
- return ((_a = this._conversationalAi) !== null && _a !== void 0 ? _a : (this._conversationalAi = new Client_21.ConversationalAi(this._options)));
153
+ return ((_a = this._conversationalAi) !== null && _a !== void 0 ? _a : (this._conversationalAi = new Client_20.ConversationalAi(this._options)));
154
+ }
155
+ get workspace() {
156
+ var _a;
157
+ return ((_a = this._workspace) !== null && _a !== void 0 ? _a : (this._workspace = new Client_21.Workspace(this._options)));
158
158
  }
159
159
  }
160
160
  exports.ElevenLabsClient = ElevenLabsClient;
@@ -2,7 +2,8 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as errors from "../../errors/index";
5
+ import * as ElevenLabs from "../index";
5
6
  import * as core from "../../core";
6
7
  export declare class BadRequestError extends errors.ElevenLabsError {
7
- constructor(body?: unknown, rawResponse?: core.RawResponse);
8
+ constructor(body: ElevenLabs.BadRequestErrorBody, rawResponse?: core.RawResponse);
8
9
  }
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as fs from "fs";
4
+ import * as core from "../../../../../core";
5
5
  import * as ElevenLabs from "../../../../index";
6
6
  export interface BodyAudioIsolationStreamV1AudioIsolationStreamPost {
7
- audio: File | fs.ReadStream | Blob;
7
+ audio: core.FileLike;
8
8
  /** The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform. */
9
9
  fileFormat?: ElevenLabs.AudioIsolationStreamRequestFileFormat;
10
10
  }
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as fs from "fs";
4
+ import * as core from "../../../../../core";
5
5
  import * as ElevenLabs from "../../../../index";
6
6
  export interface BodyAudioIsolationV1AudioIsolationPost {
7
- audio: File | fs.ReadStream | Blob;
7
+ audio: core.FileLike;
8
8
  /** The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform. */
9
9
  fileFormat?: ElevenLabs.AudioIsolationConvertRequestFileFormat;
10
10
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as fs from "fs";
4
+ import * as core from "../../../../../core";
5
5
  /**
6
6
  * @example
7
7
  * {
@@ -29,7 +29,7 @@ export interface BodyCreatesAudioNativeEnabledProjectV1AudioNativePost {
29
29
  voiceId?: string;
30
30
  /** TTS Model ID used in the player. If not provided, default model ID set in the Player settings is used. */
31
31
  modelId?: string;
32
- file?: File | fs.ReadStream | Blob | undefined;
32
+ file?: core.FileLike | undefined;
33
33
  /** Whether to auto convert the project to audio or not. */
34
34
  autoConvert?: boolean;
35
35
  }
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as fs from "fs";
4
+ import * as core from "../../../../../core";
5
5
  /**
6
6
  * @example
7
7
  * {}
8
8
  */
9
9
  export interface BodyUpdateAudioNativeProjectContentV1AudioNativeProjectIdContentPost {
10
- file?: File | fs.ReadStream | Blob | undefined;
10
+ file?: core.FileLike | undefined;
11
11
  /** Whether to auto convert the project to audio or not. */
12
12
  autoConvert?: boolean;
13
13
  /** Whether to auto publish the new project snapshot after it's converted. */
@@ -142,6 +142,10 @@ class ConversationalAi {
142
142
  __addToKnowledgeBase(request, requestOptions) {
143
143
  return __awaiter(this, void 0, void 0, function* () {
144
144
  var _a, _b, _c;
145
+ const _queryParams = {};
146
+ if (request.agentId != null) {
147
+ _queryParams["agent_id"] = request.agentId;
148
+ }
145
149
  const _request = yield core.newFormData();
146
150
  if (request.name != null) {
147
151
  _request.append("name", request.name);
@@ -157,6 +161,7 @@ class ConversationalAi {
157
161
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production).base, "v1/convai/knowledge-base"),
158
162
  method: "POST",
159
163
  headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
164
+ queryParameters: _queryParams,
160
165
  requestType: "file",
161
166
  duplex: _maybeEncodedRequest.duplex,
162
167
  body: _maybeEncodedRequest.body,
@@ -1,15 +1,16 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as fs from "fs";
4
+ import * as core from "../../../../../core";
5
5
  /**
6
6
  * @example
7
7
  * {}
8
8
  */
9
9
  export interface BodyAddToKnowledgeBaseV1ConvaiKnowledgeBasePost {
10
+ agentId?: string;
10
11
  /** A custom, human-readable name for the document. */
11
12
  name?: string;
12
13
  /** URL to a page of documentation that the agent will have access to in order to interact with users. */
13
14
  url?: string;
14
- file?: File | fs.ReadStream | Blob | undefined;
15
+ file?: core.FileLike | undefined;
15
16
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as fs from "fs";
4
+ import * as core from "../../../../../../../../../../../core";
5
5
  /**
6
6
  * @example
7
7
  * {
@@ -9,5 +9,5 @@ import * as fs from "fs";
9
9
  * }
10
10
  */
11
11
  export interface BodyPostAgentAvatarV1ConvaiAgentsAgentIdAvatarPost {
12
- avatarFile: File | fs.ReadStream | Blob;
12
+ avatarFile: core.FileLike;
13
13
  }
@@ -82,6 +82,7 @@ export declare class Documents {
82
82
  * Get details about a specific documentation making up the agent's knowledge base
83
83
  *
84
84
  * @param {string} documentationId - The id of a document from the knowledge base. This is returned on document addition.
85
+ * @param {ElevenLabs.conversationalAi.knowledgeBase.DocumentsGetRequest} request
85
86
  * @param {Documents.RequestOptions} requestOptions - Request-specific configuration.
86
87
  *
87
88
  * @throws {@link ElevenLabs.UnprocessableEntityError}
@@ -89,7 +90,7 @@ export declare class Documents {
89
90
  * @example
90
91
  * await client.conversationalAi.knowledgeBase.documents.get("21m00Tcm4TlvDq8ikWAM")
91
92
  */
92
- get(documentationId: string, requestOptions?: Documents.RequestOptions): core.HttpResponsePromise<ElevenLabs.conversationalAi.knowledgeBase.DocumentsGetResponse>;
93
+ get(documentationId: string, request?: ElevenLabs.conversationalAi.knowledgeBase.DocumentsGetRequest, requestOptions?: Documents.RequestOptions): core.HttpResponsePromise<ElevenLabs.conversationalAi.knowledgeBase.DocumentsGetResponse>;
93
94
  private __get;
94
95
  /**
95
96
  * Delete a document from the knowledge base
@@ -300,6 +300,7 @@ class Documents {
300
300
  * Get details about a specific documentation making up the agent's knowledge base
301
301
  *
302
302
  * @param {string} documentationId - The id of a document from the knowledge base. This is returned on document addition.
303
+ * @param {ElevenLabs.conversationalAi.knowledgeBase.DocumentsGetRequest} request
303
304
  * @param {Documents.RequestOptions} requestOptions - Request-specific configuration.
304
305
  *
305
306
  * @throws {@link ElevenLabs.UnprocessableEntityError}
@@ -307,16 +308,22 @@ class Documents {
307
308
  * @example
308
309
  * await client.conversationalAi.knowledgeBase.documents.get("21m00Tcm4TlvDq8ikWAM")
309
310
  */
310
- get(documentationId, requestOptions) {
311
- return core.HttpResponsePromise.fromPromise(this.__get(documentationId, requestOptions));
311
+ get(documentationId, request = {}, requestOptions) {
312
+ return core.HttpResponsePromise.fromPromise(this.__get(documentationId, request, requestOptions));
312
313
  }
313
- __get(documentationId, requestOptions) {
314
- return __awaiter(this, void 0, void 0, function* () {
314
+ __get(documentationId_1) {
315
+ return __awaiter(this, arguments, void 0, function* (documentationId, request = {}, requestOptions) {
315
316
  var _a, _b, _c;
317
+ const { agentId } = request;
318
+ const _queryParams = {};
319
+ if (agentId != null) {
320
+ _queryParams["agent_id"] = agentId;
321
+ }
316
322
  const _response = yield core.fetcher({
317
323
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production).base, `v1/convai/knowledge-base/${encodeURIComponent(documentationId)}`),
318
324
  method: "GET",
319
325
  headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
326
+ queryParameters: _queryParams,
320
327
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
321
328
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
322
329
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as fs from "fs";
4
+ import * as core from "../../../../../../../../../core";
5
5
  /**
6
6
  * @example
7
7
  * {
@@ -9,7 +9,7 @@ import * as fs from "fs";
9
9
  * }
10
10
  */
11
11
  export interface BodyCreateFileDocumentV1ConvaiKnowledgeBaseFilePost {
12
- file: File | fs.ReadStream | Blob;
12
+ file: core.FileLike;
13
13
  /** A custom, human-readable name for the document. */
14
14
  name?: string;
15
15
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {}
7
+ */
8
+ export interface DocumentsGetRequest {
9
+ agentId?: string;
10
+ }
@@ -1,6 +1,7 @@
1
1
  export { type BodyCreateUrlDocumentV1ConvaiKnowledgeBaseUrlPost } from "./BodyCreateUrlDocumentV1ConvaiKnowledgeBaseUrlPost";
2
2
  export { type BodyCreateFileDocumentV1ConvaiKnowledgeBaseFilePost } from "./BodyCreateFileDocumentV1ConvaiKnowledgeBaseFilePost";
3
3
  export { type BodyCreateTextDocumentV1ConvaiKnowledgeBaseTextPost } from "./BodyCreateTextDocumentV1ConvaiKnowledgeBaseTextPost";
4
+ export { type DocumentsGetRequest } from "./DocumentsGetRequest";
4
5
  export { type DocumentsDeleteRequest } from "./DocumentsDeleteRequest";
5
6
  export { type BodyUpdateDocumentV1ConvaiKnowledgeBaseDocumentationIdPatch } from "./BodyUpdateDocumentV1ConvaiKnowledgeBaseDocumentationIdPatch";
6
7
  export { type DocumentsGetAgentsRequest } from "./DocumentsGetAgentsRequest";
@@ -366,7 +366,7 @@ class PhoneNumbers {
366
366
  return __awaiter(this, void 0, void 0, function* () {
367
367
  var _a, _b, _c;
368
368
  const _response = yield core.fetcher({
369
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production).base, "v1/convai/phone-numbers/"),
369
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production).base, "v1/convai/phone-numbers"),
370
370
  method: "GET",
371
371
  headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
372
372
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
@@ -409,7 +409,7 @@ class PhoneNumbers {
409
409
  rawResponse: _response.rawResponse,
410
410
  });
411
411
  case "timeout":
412
- throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling GET /v1/convai/phone-numbers/.");
412
+ throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling GET /v1/convai/phone-numbers.");
413
413
  case "unknown":
414
414
  throw new errors.ElevenLabsError({
415
415
  message: _response.error.errorMessage,