@deepgram/sdk 5.0.0-alpha.2 → 5.0.0-beta.1

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 (191) hide show
  1. package/LICENSE +1 -1
  2. package/dist/browser/index.global.js +674 -1135
  3. package/dist/cjs/BaseClient.d.ts +7 -7
  4. package/dist/cjs/BaseClient.js +2 -2
  5. package/dist/cjs/Client.d.ts +1 -2
  6. package/dist/cjs/CustomClient.d.ts +9 -1
  7. package/dist/cjs/CustomClient.js +346 -232
  8. package/dist/cjs/api/resources/agent/client/Client.d.ts +1 -2
  9. package/dist/cjs/api/resources/agent/resources/v1/client/Client.d.ts +1 -2
  10. package/dist/cjs/api/resources/agent/resources/v1/client/Socket.d.ts +8 -8
  11. package/dist/cjs/api/resources/agent/resources/v1/client/Socket.js +9 -9
  12. package/dist/cjs/api/resources/agent/resources/v1/resources/settings/client/Client.d.ts +1 -2
  13. package/dist/cjs/api/resources/agent/resources/v1/resources/settings/resources/think/client/Client.d.ts +1 -2
  14. package/dist/cjs/api/resources/agent/resources/v1/resources/settings/resources/think/resources/models/client/Client.d.ts +1 -2
  15. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1Settings.d.ts +3 -43
  16. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.d.ts +26 -0
  17. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.js +3 -0
  18. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentSpeakEndpointProvider.d.ts +28 -13
  19. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentSpeakEndpointProvider.js +19 -17
  20. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentSpeakOneItemProvider.d.ts +28 -13
  21. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentSpeakOneItemProvider.js +19 -17
  22. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentThinkProvider.d.ts +115 -0
  23. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentThinkProvider.js +57 -0
  24. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1UpdateSpeakSpeakProvider.d.ts +18 -3
  25. package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1UpdateSpeakSpeakProvider.js +2 -0
  26. package/dist/cjs/api/resources/agent/resources/v1/types/index.d.ts +2 -0
  27. package/dist/cjs/api/resources/agent/resources/v1/types/index.js +2 -0
  28. package/dist/cjs/api/resources/auth/client/Client.d.ts +1 -2
  29. package/dist/cjs/api/resources/auth/resources/v1/client/Client.d.ts +1 -2
  30. package/dist/cjs/api/resources/auth/resources/v1/resources/tokens/client/Client.d.ts +1 -2
  31. package/dist/cjs/api/resources/listen/client/Client.d.ts +1 -2
  32. package/dist/cjs/api/resources/listen/resources/v1/client/Client.d.ts +1 -2
  33. package/dist/cjs/api/resources/listen/resources/v1/client/Client.js +29 -80
  34. package/dist/cjs/api/resources/listen/resources/v1/client/Socket.d.ts +4 -4
  35. package/dist/cjs/api/resources/listen/resources/v1/client/Socket.js +5 -5
  36. package/dist/cjs/api/resources/listen/resources/v1/resources/media/client/Client.d.ts +1 -2
  37. package/dist/cjs/api/resources/listen/resources/v1/resources/media/client/Client.js +76 -298
  38. package/dist/cjs/api/resources/listen/resources/v1/types/ListenV1Results.d.ts +3 -3
  39. package/dist/cjs/api/resources/listen/resources/v2/client/Client.d.ts +1 -2
  40. package/dist/cjs/api/resources/listen/resources/v2/client/Client.js +11 -26
  41. package/dist/cjs/api/resources/listen/resources/v2/client/Socket.d.ts +2 -2
  42. package/dist/cjs/api/resources/listen/resources/v2/client/Socket.js +3 -3
  43. package/dist/cjs/api/resources/manage/client/Client.d.ts +1 -2
  44. package/dist/cjs/api/resources/manage/resources/v1/client/Client.d.ts +1 -2
  45. package/dist/cjs/api/resources/manage/resources/v1/resources/models/client/Client.d.ts +1 -2
  46. package/dist/cjs/api/resources/manage/resources/v1/resources/models/client/Client.js +3 -4
  47. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/client/Client.d.ts +1 -2
  48. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/client/Client.js +4 -7
  49. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/client/Client.d.ts +1 -2
  50. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/balances/client/Client.d.ts +1 -2
  51. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/client/Client.d.ts +1 -2
  52. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/client/Client.js +9 -27
  53. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/fields/client/Client.d.ts +1 -2
  54. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/fields/client/Client.js +4 -7
  55. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/purchases/client/Client.d.ts +1 -2
  56. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/purchases/client/Client.js +3 -4
  57. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.d.ts +1 -2
  58. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.js +3 -4
  59. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/members/client/Client.d.ts +1 -2
  60. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/members/resources/invites/client/Client.d.ts +1 -2
  61. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/members/resources/scopes/client/Client.d.ts +1 -2
  62. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/models/client/Client.d.ts +1 -2
  63. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/models/client/Client.js +3 -4
  64. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/requests/client/Client.d.ts +1 -2
  65. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/requests/client/Client.js +12 -31
  66. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/client/Client.d.ts +1 -2
  67. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/client/Client.js +46 -133
  68. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/breakdown/client/Client.d.ts +1 -2
  69. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/breakdown/client/Client.js +47 -136
  70. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/fields/client/Client.d.ts +1 -2
  71. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/fields/client/Client.js +4 -7
  72. package/dist/cjs/api/resources/read/client/Client.d.ts +1 -2
  73. package/dist/cjs/api/resources/read/resources/v1/client/Client.d.ts +1 -2
  74. package/dist/cjs/api/resources/read/resources/v1/resources/text/client/Client.d.ts +1 -2
  75. package/dist/cjs/api/resources/read/resources/v1/resources/text/client/Client.js +14 -52
  76. package/dist/cjs/api/resources/selfHosted/client/Client.d.ts +1 -2
  77. package/dist/cjs/api/resources/selfHosted/resources/v1/client/Client.d.ts +1 -2
  78. package/dist/cjs/api/resources/selfHosted/resources/v1/resources/distributionCredentials/client/Client.d.ts +1 -2
  79. package/dist/cjs/api/resources/selfHosted/resources/v1/resources/distributionCredentials/client/Client.js +4 -12
  80. package/dist/cjs/api/resources/speak/client/Client.d.ts +1 -2
  81. package/dist/cjs/api/resources/speak/resources/v1/client/Client.d.ts +1 -2
  82. package/dist/cjs/api/resources/speak/resources/v1/client/Client.js +6 -13
  83. package/dist/cjs/api/resources/speak/resources/v1/client/Socket.d.ts +4 -4
  84. package/dist/cjs/api/resources/speak/resources/v1/client/Socket.js +4 -4
  85. package/dist/cjs/api/resources/speak/resources/v1/resources/audio/client/Client.d.ts +1 -2
  86. package/dist/cjs/api/resources/speak/resources/v1/resources/audio/client/Client.js +11 -33
  87. package/dist/cjs/api/types/SpeakV1SampleRate.d.ts +1 -1
  88. package/dist/cjs/api/types/SpeakV1SampleRate.js +1 -1
  89. package/dist/cjs/auth/HeaderAuthProvider.d.ts +14 -8
  90. package/dist/cjs/auth/HeaderAuthProvider.js +19 -9
  91. package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +2 -2
  92. package/dist/cjs/core/fetcher/Fetcher.d.ts +1 -2
  93. package/dist/cjs/core/headers.d.ts +2 -2
  94. package/dist/cjs/core/websocket/ws.d.ts +1 -1
  95. package/dist/cjs/version.d.ts +1 -1
  96. package/dist/cjs/version.js +1 -1
  97. package/dist/esm/BaseClient.d.mts +7 -7
  98. package/dist/esm/BaseClient.mjs +2 -2
  99. package/dist/esm/Client.d.mts +1 -2
  100. package/dist/esm/CustomClient.d.mts +9 -1
  101. package/dist/esm/CustomClient.mjs +347 -233
  102. package/dist/esm/api/resources/agent/client/Client.d.mts +1 -2
  103. package/dist/esm/api/resources/agent/resources/v1/client/Client.d.mts +1 -2
  104. package/dist/esm/api/resources/agent/resources/v1/client/Socket.d.mts +8 -8
  105. package/dist/esm/api/resources/agent/resources/v1/client/Socket.mjs +9 -9
  106. package/dist/esm/api/resources/agent/resources/v1/resources/settings/client/Client.d.mts +1 -2
  107. package/dist/esm/api/resources/agent/resources/v1/resources/settings/resources/think/client/Client.d.mts +1 -2
  108. package/dist/esm/api/resources/agent/resources/v1/resources/settings/resources/think/resources/models/client/Client.d.mts +1 -2
  109. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1Settings.d.mts +3 -43
  110. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.d.mts +26 -0
  111. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.mjs +2 -0
  112. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentSpeakEndpointProvider.d.mts +28 -13
  113. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentSpeakEndpointProvider.mjs +19 -17
  114. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentSpeakOneItemProvider.d.mts +28 -13
  115. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentSpeakOneItemProvider.mjs +19 -17
  116. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentThinkProvider.d.mts +115 -0
  117. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentThinkProvider.mjs +54 -0
  118. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1UpdateSpeakSpeakProvider.d.mts +18 -3
  119. package/dist/esm/api/resources/agent/resources/v1/types/AgentV1UpdateSpeakSpeakProvider.mjs +2 -0
  120. package/dist/esm/api/resources/agent/resources/v1/types/index.d.mts +2 -0
  121. package/dist/esm/api/resources/agent/resources/v1/types/index.mjs +2 -0
  122. package/dist/esm/api/resources/auth/client/Client.d.mts +1 -2
  123. package/dist/esm/api/resources/auth/resources/v1/client/Client.d.mts +1 -2
  124. package/dist/esm/api/resources/auth/resources/v1/resources/tokens/client/Client.d.mts +1 -2
  125. package/dist/esm/api/resources/listen/client/Client.d.mts +1 -2
  126. package/dist/esm/api/resources/listen/resources/v1/client/Client.d.mts +1 -2
  127. package/dist/esm/api/resources/listen/resources/v1/client/Client.mjs +29 -80
  128. package/dist/esm/api/resources/listen/resources/v1/client/Socket.d.mts +4 -4
  129. package/dist/esm/api/resources/listen/resources/v1/client/Socket.mjs +5 -5
  130. package/dist/esm/api/resources/listen/resources/v1/resources/media/client/Client.d.mts +1 -2
  131. package/dist/esm/api/resources/listen/resources/v1/resources/media/client/Client.mjs +76 -298
  132. package/dist/esm/api/resources/listen/resources/v1/types/ListenV1Results.d.mts +3 -3
  133. package/dist/esm/api/resources/listen/resources/v2/client/Client.d.mts +1 -2
  134. package/dist/esm/api/resources/listen/resources/v2/client/Client.mjs +11 -26
  135. package/dist/esm/api/resources/listen/resources/v2/client/Socket.d.mts +2 -2
  136. package/dist/esm/api/resources/listen/resources/v2/client/Socket.mjs +3 -3
  137. package/dist/esm/api/resources/manage/client/Client.d.mts +1 -2
  138. package/dist/esm/api/resources/manage/resources/v1/client/Client.d.mts +1 -2
  139. package/dist/esm/api/resources/manage/resources/v1/resources/models/client/Client.d.mts +1 -2
  140. package/dist/esm/api/resources/manage/resources/v1/resources/models/client/Client.mjs +3 -4
  141. package/dist/esm/api/resources/manage/resources/v1/resources/projects/client/Client.d.mts +1 -2
  142. package/dist/esm/api/resources/manage/resources/v1/resources/projects/client/Client.mjs +4 -7
  143. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/client/Client.d.mts +1 -2
  144. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/balances/client/Client.d.mts +1 -2
  145. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/client/Client.d.mts +1 -2
  146. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/client/Client.mjs +9 -27
  147. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/fields/client/Client.d.mts +1 -2
  148. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/fields/client/Client.mjs +4 -7
  149. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/purchases/client/Client.d.mts +1 -2
  150. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/purchases/client/Client.mjs +3 -4
  151. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.d.mts +1 -2
  152. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.mjs +3 -4
  153. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/members/client/Client.d.mts +1 -2
  154. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/members/resources/invites/client/Client.d.mts +1 -2
  155. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/members/resources/scopes/client/Client.d.mts +1 -2
  156. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/models/client/Client.d.mts +1 -2
  157. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/models/client/Client.mjs +3 -4
  158. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/requests/client/Client.d.mts +1 -2
  159. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/requests/client/Client.mjs +12 -31
  160. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/client/Client.d.mts +1 -2
  161. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/client/Client.mjs +46 -133
  162. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/breakdown/client/Client.d.mts +1 -2
  163. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/breakdown/client/Client.mjs +47 -136
  164. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/fields/client/Client.d.mts +1 -2
  165. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/fields/client/Client.mjs +4 -7
  166. package/dist/esm/api/resources/read/client/Client.d.mts +1 -2
  167. package/dist/esm/api/resources/read/resources/v1/client/Client.d.mts +1 -2
  168. package/dist/esm/api/resources/read/resources/v1/resources/text/client/Client.d.mts +1 -2
  169. package/dist/esm/api/resources/read/resources/v1/resources/text/client/Client.mjs +14 -52
  170. package/dist/esm/api/resources/selfHosted/client/Client.d.mts +1 -2
  171. package/dist/esm/api/resources/selfHosted/resources/v1/client/Client.d.mts +1 -2
  172. package/dist/esm/api/resources/selfHosted/resources/v1/resources/distributionCredentials/client/Client.d.mts +1 -2
  173. package/dist/esm/api/resources/selfHosted/resources/v1/resources/distributionCredentials/client/Client.mjs +4 -12
  174. package/dist/esm/api/resources/speak/client/Client.d.mts +1 -2
  175. package/dist/esm/api/resources/speak/resources/v1/client/Client.d.mts +1 -2
  176. package/dist/esm/api/resources/speak/resources/v1/client/Client.mjs +6 -13
  177. package/dist/esm/api/resources/speak/resources/v1/client/Socket.d.mts +4 -4
  178. package/dist/esm/api/resources/speak/resources/v1/client/Socket.mjs +4 -4
  179. package/dist/esm/api/resources/speak/resources/v1/resources/audio/client/Client.d.mts +1 -2
  180. package/dist/esm/api/resources/speak/resources/v1/resources/audio/client/Client.mjs +11 -33
  181. package/dist/esm/api/types/SpeakV1SampleRate.d.mts +1 -1
  182. package/dist/esm/api/types/SpeakV1SampleRate.mjs +1 -1
  183. package/dist/esm/auth/HeaderAuthProvider.d.mts +14 -8
  184. package/dist/esm/auth/HeaderAuthProvider.mjs +19 -9
  185. package/dist/esm/core/fetcher/EndpointSupplier.d.mts +2 -2
  186. package/dist/esm/core/fetcher/Fetcher.d.mts +1 -2
  187. package/dist/esm/core/headers.d.mts +2 -2
  188. package/dist/esm/core/websocket/ws.d.mts +1 -1
  189. package/dist/esm/version.d.mts +1 -1
  190. package/dist/esm/version.mjs +1 -1
  191. package/package.json +11 -10
@@ -121,155 +121,44 @@ class MediaClient {
121
121
  return __awaiter(this, void 0, void 0, function* () {
122
122
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
123
123
  const { callback, callback_method: callbackMethod, extra, sentiment, summarize, tag, topics, custom_topic: customTopic, custom_topic_mode: customTopicMode, intents, custom_intent: customIntent, custom_intent_mode: customIntentMode, detect_entities: detectEntities, detect_language: detectLanguage, diarize, dictation, encoding, filler_words: fillerWords, keyterm, keywords, language, measurements, model, multichannel, numerals, paragraphs, profanity_filter: profanityFilter, punctuate, redact, replace, search, smart_format: smartFormat, utterances, utt_split: uttSplit, version, mip_opt_out: mipOptOut } = request, _body = __rest(request, ["callback", "callback_method", "extra", "sentiment", "summarize", "tag", "topics", "custom_topic", "custom_topic_mode", "intents", "custom_intent", "custom_intent_mode", "detect_entities", "detect_language", "diarize", "dictation", "encoding", "filler_words", "keyterm", "keywords", "language", "measurements", "model", "multichannel", "numerals", "paragraphs", "profanity_filter", "punctuate", "redact", "replace", "search", "smart_format", "utterances", "utt_split", "version", "mip_opt_out"]);
124
- const _queryParams = {};
125
- if (callback != null) {
126
- _queryParams.callback = callback;
127
- }
128
- if (callbackMethod != null) {
129
- _queryParams.callback_method = callbackMethod;
130
- }
131
- if (extra != null) {
132
- if (Array.isArray(extra)) {
133
- _queryParams.extra = extra.map((item) => item);
134
- }
135
- else {
136
- _queryParams.extra = extra;
137
- }
138
- }
139
- if (sentiment != null) {
140
- _queryParams.sentiment = sentiment.toString();
141
- }
142
- if (summarize != null) {
143
- _queryParams.summarize = summarize;
144
- }
145
- if (tag != null) {
146
- if (Array.isArray(tag)) {
147
- _queryParams.tag = tag.map((item) => item);
148
- }
149
- else {
150
- _queryParams.tag = tag;
151
- }
152
- }
153
- if (topics != null) {
154
- _queryParams.topics = topics.toString();
155
- }
156
- if (customTopic != null) {
157
- if (Array.isArray(customTopic)) {
158
- _queryParams.custom_topic = customTopic.map((item) => item);
159
- }
160
- else {
161
- _queryParams.custom_topic = customTopic;
162
- }
163
- }
164
- if (customTopicMode != null) {
165
- _queryParams.custom_topic_mode = customTopicMode;
166
- }
167
- if (intents != null) {
168
- _queryParams.intents = intents.toString();
169
- }
170
- if (customIntent != null) {
171
- if (Array.isArray(customIntent)) {
172
- _queryParams.custom_intent = customIntent.map((item) => item);
173
- }
174
- else {
175
- _queryParams.custom_intent = customIntent;
176
- }
177
- }
178
- if (customIntentMode != null) {
179
- _queryParams.custom_intent_mode = customIntentMode;
180
- }
181
- if (detectEntities != null) {
182
- _queryParams.detect_entities = detectEntities.toString();
183
- }
184
- if (detectLanguage != null) {
185
- _queryParams.detect_language = detectLanguage.toString();
186
- }
187
- if (diarize != null) {
188
- _queryParams.diarize = diarize.toString();
189
- }
190
- if (dictation != null) {
191
- _queryParams.dictation = dictation.toString();
192
- }
193
- if (encoding != null) {
194
- _queryParams.encoding = encoding;
195
- }
196
- if (fillerWords != null) {
197
- _queryParams.filler_words = fillerWords.toString();
198
- }
199
- if (keyterm != null) {
200
- if (Array.isArray(keyterm)) {
201
- _queryParams.keyterm = keyterm.map((item) => item);
202
- }
203
- else {
204
- _queryParams.keyterm = keyterm;
205
- }
206
- }
207
- if (keywords != null) {
208
- if (Array.isArray(keywords)) {
209
- _queryParams.keywords = keywords.map((item) => item);
210
- }
211
- else {
212
- _queryParams.keywords = keywords;
213
- }
214
- }
215
- if (language != null) {
216
- _queryParams.language = language;
217
- }
218
- if (measurements != null) {
219
- _queryParams.measurements = measurements.toString();
220
- }
221
- if (model != null) {
222
- _queryParams.model = model;
223
- }
224
- if (multichannel != null) {
225
- _queryParams.multichannel = multichannel.toString();
226
- }
227
- if (numerals != null) {
228
- _queryParams.numerals = numerals.toString();
229
- }
230
- if (paragraphs != null) {
231
- _queryParams.paragraphs = paragraphs.toString();
232
- }
233
- if (profanityFilter != null) {
234
- _queryParams.profanity_filter = profanityFilter.toString();
235
- }
236
- if (punctuate != null) {
237
- _queryParams.punctuate = punctuate.toString();
238
- }
239
- if (redact != null) {
240
- _queryParams.redact = redact;
241
- }
242
- if (replace != null) {
243
- if (Array.isArray(replace)) {
244
- _queryParams.replace = replace.map((item) => item);
245
- }
246
- else {
247
- _queryParams.replace = replace;
248
- }
249
- }
250
- if (search != null) {
251
- if (Array.isArray(search)) {
252
- _queryParams.search = search.map((item) => item);
253
- }
254
- else {
255
- _queryParams.search = search;
256
- }
257
- }
258
- if (smartFormat != null) {
259
- _queryParams.smart_format = smartFormat.toString();
260
- }
261
- if (utterances != null) {
262
- _queryParams.utterances = utterances.toString();
263
- }
264
- if (uttSplit != null) {
265
- _queryParams.utt_split = uttSplit.toString();
266
- }
267
- if (version != null) {
268
- _queryParams.version = version;
269
- }
270
- if (mipOptOut != null) {
271
- _queryParams.mip_opt_out = mipOptOut.toString();
272
- }
124
+ const _queryParams = {
125
+ callback,
126
+ callback_method: callbackMethod != null ? callbackMethod : undefined,
127
+ extra,
128
+ sentiment,
129
+ summarize: summarize != null ? summarize : undefined,
130
+ tag,
131
+ topics,
132
+ custom_topic: customTopic,
133
+ custom_topic_mode: customTopicMode != null ? customTopicMode : undefined,
134
+ intents,
135
+ custom_intent: customIntent,
136
+ custom_intent_mode: customIntentMode != null ? customIntentMode : undefined,
137
+ detect_entities: detectEntities,
138
+ detect_language: detectLanguage,
139
+ diarize,
140
+ dictation,
141
+ encoding: encoding != null ? encoding : undefined,
142
+ filler_words: fillerWords,
143
+ keyterm,
144
+ keywords,
145
+ language,
146
+ measurements,
147
+ model: model != null ? model : undefined,
148
+ multichannel,
149
+ numerals,
150
+ paragraphs,
151
+ profanity_filter: profanityFilter,
152
+ punctuate,
153
+ redact,
154
+ replace,
155
+ search,
156
+ smart_format: smartFormat,
157
+ utterances,
158
+ utt_split: uttSplit,
159
+ version: version != null ? version : undefined,
160
+ mip_opt_out: mipOptOut,
161
+ };
273
162
  const _authRequest = yield this._options.authProvider.getAuthRequest();
274
163
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
275
164
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -326,155 +215,44 @@ class MediaClient {
326
215
  __transcribeFile(uploadable, request, requestOptions) {
327
216
  return __awaiter(this, void 0, void 0, function* () {
328
217
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
329
- const _queryParams = {};
330
- if (request.callback != null) {
331
- _queryParams.callback = request.callback;
332
- }
333
- if (request.callback_method != null) {
334
- _queryParams.callback_method = request.callback_method;
335
- }
336
- if (request.extra != null) {
337
- if (Array.isArray(request.extra)) {
338
- _queryParams.extra = request.extra.map((item) => item);
339
- }
340
- else {
341
- _queryParams.extra = request.extra;
342
- }
343
- }
344
- if (request.sentiment != null) {
345
- _queryParams.sentiment = request.sentiment.toString();
346
- }
347
- if (request.summarize != null) {
348
- _queryParams.summarize = request.summarize;
349
- }
350
- if (request.tag != null) {
351
- if (Array.isArray(request.tag)) {
352
- _queryParams.tag = request.tag.map((item) => item);
353
- }
354
- else {
355
- _queryParams.tag = request.tag;
356
- }
357
- }
358
- if (request.topics != null) {
359
- _queryParams.topics = request.topics.toString();
360
- }
361
- if (request.custom_topic != null) {
362
- if (Array.isArray(request.custom_topic)) {
363
- _queryParams.custom_topic = request.custom_topic.map((item) => item);
364
- }
365
- else {
366
- _queryParams.custom_topic = request.custom_topic;
367
- }
368
- }
369
- if (request.custom_topic_mode != null) {
370
- _queryParams.custom_topic_mode = request.custom_topic_mode;
371
- }
372
- if (request.intents != null) {
373
- _queryParams.intents = request.intents.toString();
374
- }
375
- if (request.custom_intent != null) {
376
- if (Array.isArray(request.custom_intent)) {
377
- _queryParams.custom_intent = request.custom_intent.map((item) => item);
378
- }
379
- else {
380
- _queryParams.custom_intent = request.custom_intent;
381
- }
382
- }
383
- if (request.custom_intent_mode != null) {
384
- _queryParams.custom_intent_mode = request.custom_intent_mode;
385
- }
386
- if (request.detect_entities != null) {
387
- _queryParams.detect_entities = request.detect_entities.toString();
388
- }
389
- if (request.detect_language != null) {
390
- _queryParams.detect_language = request.detect_language.toString();
391
- }
392
- if (request.diarize != null) {
393
- _queryParams.diarize = request.diarize.toString();
394
- }
395
- if (request.dictation != null) {
396
- _queryParams.dictation = request.dictation.toString();
397
- }
398
- if (request.encoding != null) {
399
- _queryParams.encoding = request.encoding;
400
- }
401
- if (request.filler_words != null) {
402
- _queryParams.filler_words = request.filler_words.toString();
403
- }
404
- if (request.keyterm != null) {
405
- if (Array.isArray(request.keyterm)) {
406
- _queryParams.keyterm = request.keyterm.map((item) => item);
407
- }
408
- else {
409
- _queryParams.keyterm = request.keyterm;
410
- }
411
- }
412
- if (request.keywords != null) {
413
- if (Array.isArray(request.keywords)) {
414
- _queryParams.keywords = request.keywords.map((item) => item);
415
- }
416
- else {
417
- _queryParams.keywords = request.keywords;
418
- }
419
- }
420
- if (request.language != null) {
421
- _queryParams.language = request.language;
422
- }
423
- if (request.measurements != null) {
424
- _queryParams.measurements = request.measurements.toString();
425
- }
426
- if (request.model != null) {
427
- _queryParams.model = request.model;
428
- }
429
- if (request.multichannel != null) {
430
- _queryParams.multichannel = request.multichannel.toString();
431
- }
432
- if (request.numerals != null) {
433
- _queryParams.numerals = request.numerals.toString();
434
- }
435
- if (request.paragraphs != null) {
436
- _queryParams.paragraphs = request.paragraphs.toString();
437
- }
438
- if (request.profanity_filter != null) {
439
- _queryParams.profanity_filter = request.profanity_filter.toString();
440
- }
441
- if (request.punctuate != null) {
442
- _queryParams.punctuate = request.punctuate.toString();
443
- }
444
- if (request.redact != null) {
445
- _queryParams.redact = request.redact;
446
- }
447
- if (request.replace != null) {
448
- if (Array.isArray(request.replace)) {
449
- _queryParams.replace = request.replace.map((item) => item);
450
- }
451
- else {
452
- _queryParams.replace = request.replace;
453
- }
454
- }
455
- if (request.search != null) {
456
- if (Array.isArray(request.search)) {
457
- _queryParams.search = request.search.map((item) => item);
458
- }
459
- else {
460
- _queryParams.search = request.search;
461
- }
462
- }
463
- if (request.smart_format != null) {
464
- _queryParams.smart_format = request.smart_format.toString();
465
- }
466
- if (request.utterances != null) {
467
- _queryParams.utterances = request.utterances.toString();
468
- }
469
- if (request.utt_split != null) {
470
- _queryParams.utt_split = request.utt_split.toString();
471
- }
472
- if (request.version != null) {
473
- _queryParams.version = request.version;
474
- }
475
- if (request.mip_opt_out != null) {
476
- _queryParams.mip_opt_out = request.mip_opt_out.toString();
477
- }
218
+ const _queryParams = {
219
+ callback: request.callback,
220
+ callback_method: request.callback_method != null ? request.callback_method : undefined,
221
+ extra: request.extra,
222
+ sentiment: request.sentiment,
223
+ summarize: request.summarize != null ? request.summarize : undefined,
224
+ tag: request.tag,
225
+ topics: request.topics,
226
+ custom_topic: request.custom_topic,
227
+ custom_topic_mode: request.custom_topic_mode != null ? request.custom_topic_mode : undefined,
228
+ intents: request.intents,
229
+ custom_intent: request.custom_intent,
230
+ custom_intent_mode: request.custom_intent_mode != null ? request.custom_intent_mode : undefined,
231
+ detect_entities: request.detect_entities,
232
+ detect_language: request.detect_language,
233
+ diarize: request.diarize,
234
+ dictation: request.dictation,
235
+ encoding: request.encoding != null ? request.encoding : undefined,
236
+ filler_words: request.filler_words,
237
+ keyterm: request.keyterm,
238
+ keywords: request.keywords,
239
+ language: request.language,
240
+ measurements: request.measurements,
241
+ model: request.model != null ? request.model : undefined,
242
+ multichannel: request.multichannel,
243
+ numerals: request.numerals,
244
+ paragraphs: request.paragraphs,
245
+ profanity_filter: request.profanity_filter,
246
+ punctuate: request.punctuate,
247
+ redact: request.redact,
248
+ replace: request.replace,
249
+ search: request.search,
250
+ smart_format: request.smart_format,
251
+ utterances: request.utterances,
252
+ utt_split: request.utt_split,
253
+ version: request.version != null ? request.version : undefined,
254
+ mip_opt_out: request.mip_opt_out,
255
+ };
478
256
  const _binaryUploadRequest = yield core.file.toBinaryUploadRequest(uploadable);
479
257
  const _authRequest = yield this._options.authProvider.getAuthRequest();
480
258
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, _binaryUploadRequest.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
@@ -28,7 +28,7 @@ export declare namespace ListenV1Results {
28
28
  transcript: string;
29
29
  /** The confidence of the transcription */
30
30
  confidence: number;
31
- languages: string[];
31
+ languages?: string[];
32
32
  words: Item.Words.Item[];
33
33
  }
34
34
  namespace Item {
@@ -44,9 +44,9 @@ export declare namespace ListenV1Results {
44
44
  /** The confidence of the word */
45
45
  confidence: number;
46
46
  /** The language of the word */
47
- language: string;
47
+ language?: string;
48
48
  /** The punctuated word of the word */
49
- punctuated_word: string;
49
+ punctuated_word?: string;
50
50
  /** The speaker of the word */
51
51
  speaker?: number;
52
52
  }
@@ -2,8 +2,7 @@ import type { BaseClientOptions } from "../../../../../../BaseClient.js";
2
2
  import { type NormalizedClientOptions } from "../../../../../../BaseClient.js";
3
3
  import { V2Socket } from "./Socket.js";
4
4
  export declare namespace V2Client {
5
- interface Options extends BaseClientOptions {
6
- }
5
+ type Options = BaseClientOptions;
7
6
  interface ConnectArgs {
8
7
  model: string;
9
8
  encoding?: string;
@@ -57,32 +57,17 @@ class V2Client {
57
57
  return __awaiter(this, void 0, void 0, function* () {
58
58
  var _a, _b;
59
59
  const { model, encoding, sample_rate: sampleRate, eager_eot_threshold: eagerEotThreshold, eot_threshold: eotThreshold, eot_timeout_ms: eotTimeoutMs, keyterm, mip_opt_out: mipOptOut, tag, headers, debug, reconnectAttempts, } = args;
60
- const _queryParams = {};
61
- _queryParams.model = model;
62
- if (encoding != null) {
63
- _queryParams.encoding = encoding;
64
- }
65
- if (sampleRate != null) {
66
- _queryParams.sample_rate = sampleRate;
67
- }
68
- if (eagerEotThreshold != null) {
69
- _queryParams.eager_eot_threshold = eagerEotThreshold;
70
- }
71
- if (eotThreshold != null) {
72
- _queryParams.eot_threshold = eotThreshold;
73
- }
74
- if (eotTimeoutMs != null) {
75
- _queryParams.eot_timeout_ms = eotTimeoutMs;
76
- }
77
- if (keyterm != null) {
78
- _queryParams.keyterm = keyterm;
79
- }
80
- if (mipOptOut != null) {
81
- _queryParams.mip_opt_out = mipOptOut;
82
- }
83
- if (tag != null) {
84
- _queryParams.tag = tag;
85
- }
60
+ const _queryParams = {
61
+ model,
62
+ encoding,
63
+ sample_rate: sampleRate,
64
+ eager_eot_threshold: eagerEotThreshold,
65
+ eot_threshold: eotThreshold,
66
+ eot_timeout_ms: eotTimeoutMs,
67
+ keyterm,
68
+ mip_opt_out: mipOptOut,
69
+ tag,
70
+ };
86
71
  const _headers = (0, headers_js_1.mergeHeaders)((0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: args.Authorization }), headers);
87
72
  const socket = new core.ReconnectingWebSocket({
88
73
  url: core.url.join((_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.DeepgramEnvironment.Production).production, "/v2/listen"),
@@ -33,8 +33,8 @@ export declare class V2Socket {
33
33
  * ```
34
34
  */
35
35
  on<T extends keyof V2Socket.EventHandlers>(event: T, callback: V2Socket.EventHandlers[T]): void;
36
- sendListenV2Media(message: string): void;
37
- sendListenV2CloseStream(message: Deepgram.listen.ListenV2CloseStream): void;
36
+ sendMedia(message: ArrayBufferLike | Blob | ArrayBufferView): void;
37
+ sendCloseStream(message: Deepgram.listen.ListenV2CloseStream): void;
38
38
  /** Connect to the websocket and register event handlers. */
39
39
  connect(): V2Socket;
40
40
  /** Close the websocket and unregister event handlers. */
@@ -90,11 +90,11 @@ class V2Socket {
90
90
  on(event, callback) {
91
91
  this.eventHandlers[event] = callback;
92
92
  }
93
- sendListenV2Media(message) {
93
+ sendMedia(message) {
94
94
  this.assertSocketIsOpen();
95
- this.sendJson(message);
95
+ this.sendBinary(message);
96
96
  }
97
- sendListenV2CloseStream(message) {
97
+ sendCloseStream(message) {
98
98
  this.assertSocketIsOpen();
99
99
  this.sendJson(message);
100
100
  }
@@ -2,8 +2,7 @@ import type { BaseClientOptions } from "../../../../BaseClient.js";
2
2
  import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
3
  import { V1Client } from "../resources/v1/client/Client.js";
4
4
  export declare namespace ManageClient {
5
- interface Options extends BaseClientOptions {
6
- }
5
+ type Options = BaseClientOptions;
7
6
  }
8
7
  export declare class ManageClient {
9
8
  protected readonly _options: NormalizedClientOptionsWithAuth<ManageClient.Options>;
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClie
3
3
  import { ModelsClient } from "../resources/models/client/Client.js";
4
4
  import { ProjectsClient } from "../resources/projects/client/Client.js";
5
5
  export declare namespace V1Client {
6
- interface Options extends BaseClientOptions {
7
- }
6
+ type Options = BaseClientOptions;
8
7
  }
9
8
  export declare class V1Client {
10
9
  protected readonly _options: NormalizedClientOptionsWithAuth<V1Client.Options>;
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../../../../../Ba
3
3
  import * as core from "../../../../../../../../core/index.js";
4
4
  import * as Deepgram from "../../../../../../../index.js";
5
5
  export declare namespace ModelsClient {
6
- interface Options extends BaseClientOptions {
7
- }
6
+ type Options = BaseClientOptions;
8
7
  interface RequestOptions extends BaseRequestOptions {
9
8
  }
10
9
  }
@@ -75,10 +75,9 @@ class ModelsClient {
75
75
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
76
76
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
77
77
  const { include_outdated: includeOutdated } = request;
78
- const _queryParams = {};
79
- if (includeOutdated != null) {
80
- _queryParams.include_outdated = includeOutdated.toString();
81
- }
78
+ const _queryParams = {
79
+ include_outdated: includeOutdated,
80
+ };
82
81
  const _authRequest = yield this._options.authProvider.getAuthRequest();
83
82
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
84
83
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -9,8 +9,7 @@ import { ModelsClient } from "../resources/models/client/Client.js";
9
9
  import { RequestsClient } from "../resources/requests/client/Client.js";
10
10
  import { UsageClient } from "../resources/usage/client/Client.js";
11
11
  export declare namespace ProjectsClient {
12
- interface Options extends BaseClientOptions {
13
- }
12
+ type Options = BaseClientOptions;
14
13
  interface RequestOptions extends BaseRequestOptions {
15
14
  }
16
15
  }
@@ -154,13 +154,10 @@ class ProjectsClient {
154
154
  return __awaiter(this, arguments, void 0, function* (project_id, request = {}, requestOptions) {
155
155
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
156
156
  const { limit, page } = request;
157
- const _queryParams = {};
158
- if (limit != null) {
159
- _queryParams.limit = limit.toString();
160
- }
161
- if (page != null) {
162
- _queryParams.page = page.toString();
163
- }
157
+ const _queryParams = {
158
+ limit,
159
+ page,
160
+ };
164
161
  const _authRequest = yield this._options.authProvider.getAuthRequest();
165
162
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
166
163
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -5,8 +5,7 @@ import { BreakdownClient } from "../resources/breakdown/client/Client.js";
5
5
  import { FieldsClient } from "../resources/fields/client/Client.js";
6
6
  import { PurchasesClient } from "../resources/purchases/client/Client.js";
7
7
  export declare namespace BillingClient {
8
- interface Options extends BaseClientOptions {
9
- }
8
+ type Options = BaseClientOptions;
10
9
  }
11
10
  export declare class BillingClient {
12
11
  protected readonly _options: NormalizedClientOptionsWithAuth<BillingClient.Options>;
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../../../../../..
3
3
  import * as core from "../../../../../../../../../../../../core/index.js";
4
4
  import * as Deepgram from "../../../../../../../../../../../index.js";
5
5
  export declare namespace BalancesClient {
6
- interface Options extends BaseClientOptions {
7
- }
6
+ type Options = BaseClientOptions;
8
7
  interface RequestOptions extends BaseRequestOptions {
9
8
  }
10
9
  }
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../../../../../..
3
3
  import * as core from "../../../../../../../../../../../../core/index.js";
4
4
  import * as Deepgram from "../../../../../../../../../../../index.js";
5
5
  export declare namespace BreakdownClient {
6
- interface Options extends BaseClientOptions {
7
- }
6
+ type Options = BaseClientOptions;
8
7
  interface RequestOptions extends BaseRequestOptions {
9
8
  }
10
9
  }