@deepgram/sdk 5.0.0-alpha.3 → 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 (157) hide show
  1. package/LICENSE +1 -1
  2. package/dist/browser/index.global.js +496 -1104
  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.js +253 -249
  7. package/dist/cjs/api/resources/agent/client/Client.d.ts +1 -2
  8. package/dist/cjs/api/resources/agent/resources/v1/client/Client.d.ts +1 -2
  9. package/dist/cjs/api/resources/agent/resources/v1/client/Socket.d.ts +8 -8
  10. package/dist/cjs/api/resources/agent/resources/v1/client/Socket.js +9 -9
  11. package/dist/cjs/api/resources/agent/resources/v1/resources/settings/client/Client.d.ts +1 -2
  12. package/dist/cjs/api/resources/agent/resources/v1/resources/settings/resources/think/client/Client.d.ts +1 -2
  13. package/dist/cjs/api/resources/agent/resources/v1/resources/settings/resources/think/resources/models/client/Client.d.ts +1 -2
  14. package/dist/cjs/api/resources/auth/client/Client.d.ts +1 -2
  15. package/dist/cjs/api/resources/auth/resources/v1/client/Client.d.ts +1 -2
  16. package/dist/cjs/api/resources/auth/resources/v1/resources/tokens/client/Client.d.ts +1 -2
  17. package/dist/cjs/api/resources/listen/client/Client.d.ts +1 -2
  18. package/dist/cjs/api/resources/listen/resources/v1/client/Client.d.ts +1 -2
  19. package/dist/cjs/api/resources/listen/resources/v1/client/Client.js +29 -80
  20. package/dist/cjs/api/resources/listen/resources/v1/client/Socket.d.ts +4 -4
  21. package/dist/cjs/api/resources/listen/resources/v1/client/Socket.js +5 -5
  22. package/dist/cjs/api/resources/listen/resources/v1/resources/media/client/Client.d.ts +1 -2
  23. package/dist/cjs/api/resources/listen/resources/v1/resources/media/client/Client.js +76 -298
  24. package/dist/cjs/api/resources/listen/resources/v2/client/Client.d.ts +1 -2
  25. package/dist/cjs/api/resources/listen/resources/v2/client/Client.js +11 -26
  26. package/dist/cjs/api/resources/listen/resources/v2/client/Socket.d.ts +2 -2
  27. package/dist/cjs/api/resources/listen/resources/v2/client/Socket.js +3 -3
  28. package/dist/cjs/api/resources/manage/client/Client.d.ts +1 -2
  29. package/dist/cjs/api/resources/manage/resources/v1/client/Client.d.ts +1 -2
  30. package/dist/cjs/api/resources/manage/resources/v1/resources/models/client/Client.d.ts +1 -2
  31. package/dist/cjs/api/resources/manage/resources/v1/resources/models/client/Client.js +3 -4
  32. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/client/Client.d.ts +1 -2
  33. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/client/Client.js +4 -7
  34. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/client/Client.d.ts +1 -2
  35. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/balances/client/Client.d.ts +1 -2
  36. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/client/Client.d.ts +1 -2
  37. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/client/Client.js +9 -27
  38. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/fields/client/Client.d.ts +1 -2
  39. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/fields/client/Client.js +4 -7
  40. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/purchases/client/Client.d.ts +1 -2
  41. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/purchases/client/Client.js +3 -4
  42. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.d.ts +1 -2
  43. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.js +3 -4
  44. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/members/client/Client.d.ts +1 -2
  45. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/members/resources/invites/client/Client.d.ts +1 -2
  46. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/members/resources/scopes/client/Client.d.ts +1 -2
  47. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/models/client/Client.d.ts +1 -2
  48. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/models/client/Client.js +3 -4
  49. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/requests/client/Client.d.ts +1 -2
  50. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/requests/client/Client.js +12 -31
  51. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/client/Client.d.ts +1 -2
  52. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/client/Client.js +46 -133
  53. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/breakdown/client/Client.d.ts +1 -2
  54. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/breakdown/client/Client.js +47 -136
  55. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/fields/client/Client.d.ts +1 -2
  56. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/fields/client/Client.js +4 -7
  57. package/dist/cjs/api/resources/read/client/Client.d.ts +1 -2
  58. package/dist/cjs/api/resources/read/resources/v1/client/Client.d.ts +1 -2
  59. package/dist/cjs/api/resources/read/resources/v1/resources/text/client/Client.d.ts +1 -2
  60. package/dist/cjs/api/resources/read/resources/v1/resources/text/client/Client.js +14 -52
  61. package/dist/cjs/api/resources/selfHosted/client/Client.d.ts +1 -2
  62. package/dist/cjs/api/resources/selfHosted/resources/v1/client/Client.d.ts +1 -2
  63. package/dist/cjs/api/resources/selfHosted/resources/v1/resources/distributionCredentials/client/Client.d.ts +1 -2
  64. package/dist/cjs/api/resources/selfHosted/resources/v1/resources/distributionCredentials/client/Client.js +4 -12
  65. package/dist/cjs/api/resources/speak/client/Client.d.ts +1 -2
  66. package/dist/cjs/api/resources/speak/resources/v1/client/Client.d.ts +1 -2
  67. package/dist/cjs/api/resources/speak/resources/v1/client/Client.js +6 -13
  68. package/dist/cjs/api/resources/speak/resources/v1/client/Socket.d.ts +4 -4
  69. package/dist/cjs/api/resources/speak/resources/v1/client/Socket.js +4 -4
  70. package/dist/cjs/api/resources/speak/resources/v1/resources/audio/client/Client.d.ts +1 -2
  71. package/dist/cjs/api/resources/speak/resources/v1/resources/audio/client/Client.js +11 -33
  72. package/dist/cjs/auth/HeaderAuthProvider.d.ts +14 -8
  73. package/dist/cjs/auth/HeaderAuthProvider.js +19 -9
  74. package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +2 -2
  75. package/dist/cjs/core/fetcher/Fetcher.d.ts +1 -2
  76. package/dist/cjs/core/headers.d.ts +2 -2
  77. package/dist/cjs/core/websocket/ws.d.ts +1 -1
  78. package/dist/cjs/version.d.ts +1 -1
  79. package/dist/cjs/version.js +1 -1
  80. package/dist/esm/BaseClient.d.mts +7 -7
  81. package/dist/esm/BaseClient.mjs +2 -2
  82. package/dist/esm/Client.d.mts +1 -2
  83. package/dist/esm/CustomClient.mjs +254 -250
  84. package/dist/esm/api/resources/agent/client/Client.d.mts +1 -2
  85. package/dist/esm/api/resources/agent/resources/v1/client/Client.d.mts +1 -2
  86. package/dist/esm/api/resources/agent/resources/v1/client/Socket.d.mts +8 -8
  87. package/dist/esm/api/resources/agent/resources/v1/client/Socket.mjs +9 -9
  88. package/dist/esm/api/resources/agent/resources/v1/resources/settings/client/Client.d.mts +1 -2
  89. package/dist/esm/api/resources/agent/resources/v1/resources/settings/resources/think/client/Client.d.mts +1 -2
  90. package/dist/esm/api/resources/agent/resources/v1/resources/settings/resources/think/resources/models/client/Client.d.mts +1 -2
  91. package/dist/esm/api/resources/auth/client/Client.d.mts +1 -2
  92. package/dist/esm/api/resources/auth/resources/v1/client/Client.d.mts +1 -2
  93. package/dist/esm/api/resources/auth/resources/v1/resources/tokens/client/Client.d.mts +1 -2
  94. package/dist/esm/api/resources/listen/client/Client.d.mts +1 -2
  95. package/dist/esm/api/resources/listen/resources/v1/client/Client.d.mts +1 -2
  96. package/dist/esm/api/resources/listen/resources/v1/client/Client.mjs +29 -80
  97. package/dist/esm/api/resources/listen/resources/v1/client/Socket.d.mts +4 -4
  98. package/dist/esm/api/resources/listen/resources/v1/client/Socket.mjs +5 -5
  99. package/dist/esm/api/resources/listen/resources/v1/resources/media/client/Client.d.mts +1 -2
  100. package/dist/esm/api/resources/listen/resources/v1/resources/media/client/Client.mjs +76 -298
  101. package/dist/esm/api/resources/listen/resources/v2/client/Client.d.mts +1 -2
  102. package/dist/esm/api/resources/listen/resources/v2/client/Client.mjs +11 -26
  103. package/dist/esm/api/resources/listen/resources/v2/client/Socket.d.mts +2 -2
  104. package/dist/esm/api/resources/listen/resources/v2/client/Socket.mjs +3 -3
  105. package/dist/esm/api/resources/manage/client/Client.d.mts +1 -2
  106. package/dist/esm/api/resources/manage/resources/v1/client/Client.d.mts +1 -2
  107. package/dist/esm/api/resources/manage/resources/v1/resources/models/client/Client.d.mts +1 -2
  108. package/dist/esm/api/resources/manage/resources/v1/resources/models/client/Client.mjs +3 -4
  109. package/dist/esm/api/resources/manage/resources/v1/resources/projects/client/Client.d.mts +1 -2
  110. package/dist/esm/api/resources/manage/resources/v1/resources/projects/client/Client.mjs +4 -7
  111. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/client/Client.d.mts +1 -2
  112. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/balances/client/Client.d.mts +1 -2
  113. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/client/Client.d.mts +1 -2
  114. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/client/Client.mjs +9 -27
  115. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/fields/client/Client.d.mts +1 -2
  116. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/fields/client/Client.mjs +4 -7
  117. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/purchases/client/Client.d.mts +1 -2
  118. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/purchases/client/Client.mjs +3 -4
  119. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.d.mts +1 -2
  120. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.mjs +3 -4
  121. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/members/client/Client.d.mts +1 -2
  122. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/members/resources/invites/client/Client.d.mts +1 -2
  123. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/members/resources/scopes/client/Client.d.mts +1 -2
  124. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/models/client/Client.d.mts +1 -2
  125. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/models/client/Client.mjs +3 -4
  126. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/requests/client/Client.d.mts +1 -2
  127. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/requests/client/Client.mjs +12 -31
  128. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/client/Client.d.mts +1 -2
  129. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/client/Client.mjs +46 -133
  130. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/breakdown/client/Client.d.mts +1 -2
  131. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/breakdown/client/Client.mjs +47 -136
  132. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/fields/client/Client.d.mts +1 -2
  133. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/fields/client/Client.mjs +4 -7
  134. package/dist/esm/api/resources/read/client/Client.d.mts +1 -2
  135. package/dist/esm/api/resources/read/resources/v1/client/Client.d.mts +1 -2
  136. package/dist/esm/api/resources/read/resources/v1/resources/text/client/Client.d.mts +1 -2
  137. package/dist/esm/api/resources/read/resources/v1/resources/text/client/Client.mjs +14 -52
  138. package/dist/esm/api/resources/selfHosted/client/Client.d.mts +1 -2
  139. package/dist/esm/api/resources/selfHosted/resources/v1/client/Client.d.mts +1 -2
  140. package/dist/esm/api/resources/selfHosted/resources/v1/resources/distributionCredentials/client/Client.d.mts +1 -2
  141. package/dist/esm/api/resources/selfHosted/resources/v1/resources/distributionCredentials/client/Client.mjs +4 -12
  142. package/dist/esm/api/resources/speak/client/Client.d.mts +1 -2
  143. package/dist/esm/api/resources/speak/resources/v1/client/Client.d.mts +1 -2
  144. package/dist/esm/api/resources/speak/resources/v1/client/Client.mjs +6 -13
  145. package/dist/esm/api/resources/speak/resources/v1/client/Socket.d.mts +4 -4
  146. package/dist/esm/api/resources/speak/resources/v1/client/Socket.mjs +4 -4
  147. package/dist/esm/api/resources/speak/resources/v1/resources/audio/client/Client.d.mts +1 -2
  148. package/dist/esm/api/resources/speak/resources/v1/resources/audio/client/Client.mjs +11 -33
  149. package/dist/esm/auth/HeaderAuthProvider.d.mts +14 -8
  150. package/dist/esm/auth/HeaderAuthProvider.mjs +19 -9
  151. package/dist/esm/core/fetcher/EndpointSupplier.d.mts +2 -2
  152. package/dist/esm/core/fetcher/Fetcher.d.mts +1 -2
  153. package/dist/esm/core/headers.d.mts +2 -2
  154. package/dist/esm/core/websocket/ws.d.mts +1 -1
  155. package/dist/esm/version.d.mts +1 -1
  156. package/dist/esm/version.mjs +1 -1
  157. package/package.json +10 -7
@@ -85,155 +85,44 @@ export class MediaClient {
85
85
  return __awaiter(this, void 0, void 0, function* () {
86
86
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
87
87
  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"]);
88
- const _queryParams = {};
89
- if (callback != null) {
90
- _queryParams.callback = callback;
91
- }
92
- if (callbackMethod != null) {
93
- _queryParams.callback_method = callbackMethod;
94
- }
95
- if (extra != null) {
96
- if (Array.isArray(extra)) {
97
- _queryParams.extra = extra.map((item) => item);
98
- }
99
- else {
100
- _queryParams.extra = extra;
101
- }
102
- }
103
- if (sentiment != null) {
104
- _queryParams.sentiment = sentiment.toString();
105
- }
106
- if (summarize != null) {
107
- _queryParams.summarize = summarize;
108
- }
109
- if (tag != null) {
110
- if (Array.isArray(tag)) {
111
- _queryParams.tag = tag.map((item) => item);
112
- }
113
- else {
114
- _queryParams.tag = tag;
115
- }
116
- }
117
- if (topics != null) {
118
- _queryParams.topics = topics.toString();
119
- }
120
- if (customTopic != null) {
121
- if (Array.isArray(customTopic)) {
122
- _queryParams.custom_topic = customTopic.map((item) => item);
123
- }
124
- else {
125
- _queryParams.custom_topic = customTopic;
126
- }
127
- }
128
- if (customTopicMode != null) {
129
- _queryParams.custom_topic_mode = customTopicMode;
130
- }
131
- if (intents != null) {
132
- _queryParams.intents = intents.toString();
133
- }
134
- if (customIntent != null) {
135
- if (Array.isArray(customIntent)) {
136
- _queryParams.custom_intent = customIntent.map((item) => item);
137
- }
138
- else {
139
- _queryParams.custom_intent = customIntent;
140
- }
141
- }
142
- if (customIntentMode != null) {
143
- _queryParams.custom_intent_mode = customIntentMode;
144
- }
145
- if (detectEntities != null) {
146
- _queryParams.detect_entities = detectEntities.toString();
147
- }
148
- if (detectLanguage != null) {
149
- _queryParams.detect_language = detectLanguage.toString();
150
- }
151
- if (diarize != null) {
152
- _queryParams.diarize = diarize.toString();
153
- }
154
- if (dictation != null) {
155
- _queryParams.dictation = dictation.toString();
156
- }
157
- if (encoding != null) {
158
- _queryParams.encoding = encoding;
159
- }
160
- if (fillerWords != null) {
161
- _queryParams.filler_words = fillerWords.toString();
162
- }
163
- if (keyterm != null) {
164
- if (Array.isArray(keyterm)) {
165
- _queryParams.keyterm = keyterm.map((item) => item);
166
- }
167
- else {
168
- _queryParams.keyterm = keyterm;
169
- }
170
- }
171
- if (keywords != null) {
172
- if (Array.isArray(keywords)) {
173
- _queryParams.keywords = keywords.map((item) => item);
174
- }
175
- else {
176
- _queryParams.keywords = keywords;
177
- }
178
- }
179
- if (language != null) {
180
- _queryParams.language = language;
181
- }
182
- if (measurements != null) {
183
- _queryParams.measurements = measurements.toString();
184
- }
185
- if (model != null) {
186
- _queryParams.model = model;
187
- }
188
- if (multichannel != null) {
189
- _queryParams.multichannel = multichannel.toString();
190
- }
191
- if (numerals != null) {
192
- _queryParams.numerals = numerals.toString();
193
- }
194
- if (paragraphs != null) {
195
- _queryParams.paragraphs = paragraphs.toString();
196
- }
197
- if (profanityFilter != null) {
198
- _queryParams.profanity_filter = profanityFilter.toString();
199
- }
200
- if (punctuate != null) {
201
- _queryParams.punctuate = punctuate.toString();
202
- }
203
- if (redact != null) {
204
- _queryParams.redact = redact;
205
- }
206
- if (replace != null) {
207
- if (Array.isArray(replace)) {
208
- _queryParams.replace = replace.map((item) => item);
209
- }
210
- else {
211
- _queryParams.replace = replace;
212
- }
213
- }
214
- if (search != null) {
215
- if (Array.isArray(search)) {
216
- _queryParams.search = search.map((item) => item);
217
- }
218
- else {
219
- _queryParams.search = search;
220
- }
221
- }
222
- if (smartFormat != null) {
223
- _queryParams.smart_format = smartFormat.toString();
224
- }
225
- if (utterances != null) {
226
- _queryParams.utterances = utterances.toString();
227
- }
228
- if (uttSplit != null) {
229
- _queryParams.utt_split = uttSplit.toString();
230
- }
231
- if (version != null) {
232
- _queryParams.version = version;
233
- }
234
- if (mipOptOut != null) {
235
- _queryParams.mip_opt_out = mipOptOut.toString();
236
- }
88
+ const _queryParams = {
89
+ callback,
90
+ callback_method: callbackMethod != null ? callbackMethod : undefined,
91
+ extra,
92
+ sentiment,
93
+ summarize: summarize != null ? summarize : undefined,
94
+ tag,
95
+ topics,
96
+ custom_topic: customTopic,
97
+ custom_topic_mode: customTopicMode != null ? customTopicMode : undefined,
98
+ intents,
99
+ custom_intent: customIntent,
100
+ custom_intent_mode: customIntentMode != null ? customIntentMode : undefined,
101
+ detect_entities: detectEntities,
102
+ detect_language: detectLanguage,
103
+ diarize,
104
+ dictation,
105
+ encoding: encoding != null ? encoding : undefined,
106
+ filler_words: fillerWords,
107
+ keyterm,
108
+ keywords,
109
+ language,
110
+ measurements,
111
+ model: model != null ? model : undefined,
112
+ multichannel,
113
+ numerals,
114
+ paragraphs,
115
+ profanity_filter: profanityFilter,
116
+ punctuate,
117
+ redact,
118
+ replace,
119
+ search,
120
+ smart_format: smartFormat,
121
+ utterances,
122
+ utt_split: uttSplit,
123
+ version: version != null ? version : undefined,
124
+ mip_opt_out: mipOptOut,
125
+ };
237
126
  const _authRequest = yield this._options.authProvider.getAuthRequest();
238
127
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
239
128
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -290,155 +179,44 @@ export class MediaClient {
290
179
  __transcribeFile(uploadable, request, requestOptions) {
291
180
  return __awaiter(this, void 0, void 0, function* () {
292
181
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
293
- const _queryParams = {};
294
- if (request.callback != null) {
295
- _queryParams.callback = request.callback;
296
- }
297
- if (request.callback_method != null) {
298
- _queryParams.callback_method = request.callback_method;
299
- }
300
- if (request.extra != null) {
301
- if (Array.isArray(request.extra)) {
302
- _queryParams.extra = request.extra.map((item) => item);
303
- }
304
- else {
305
- _queryParams.extra = request.extra;
306
- }
307
- }
308
- if (request.sentiment != null) {
309
- _queryParams.sentiment = request.sentiment.toString();
310
- }
311
- if (request.summarize != null) {
312
- _queryParams.summarize = request.summarize;
313
- }
314
- if (request.tag != null) {
315
- if (Array.isArray(request.tag)) {
316
- _queryParams.tag = request.tag.map((item) => item);
317
- }
318
- else {
319
- _queryParams.tag = request.tag;
320
- }
321
- }
322
- if (request.topics != null) {
323
- _queryParams.topics = request.topics.toString();
324
- }
325
- if (request.custom_topic != null) {
326
- if (Array.isArray(request.custom_topic)) {
327
- _queryParams.custom_topic = request.custom_topic.map((item) => item);
328
- }
329
- else {
330
- _queryParams.custom_topic = request.custom_topic;
331
- }
332
- }
333
- if (request.custom_topic_mode != null) {
334
- _queryParams.custom_topic_mode = request.custom_topic_mode;
335
- }
336
- if (request.intents != null) {
337
- _queryParams.intents = request.intents.toString();
338
- }
339
- if (request.custom_intent != null) {
340
- if (Array.isArray(request.custom_intent)) {
341
- _queryParams.custom_intent = request.custom_intent.map((item) => item);
342
- }
343
- else {
344
- _queryParams.custom_intent = request.custom_intent;
345
- }
346
- }
347
- if (request.custom_intent_mode != null) {
348
- _queryParams.custom_intent_mode = request.custom_intent_mode;
349
- }
350
- if (request.detect_entities != null) {
351
- _queryParams.detect_entities = request.detect_entities.toString();
352
- }
353
- if (request.detect_language != null) {
354
- _queryParams.detect_language = request.detect_language.toString();
355
- }
356
- if (request.diarize != null) {
357
- _queryParams.diarize = request.diarize.toString();
358
- }
359
- if (request.dictation != null) {
360
- _queryParams.dictation = request.dictation.toString();
361
- }
362
- if (request.encoding != null) {
363
- _queryParams.encoding = request.encoding;
364
- }
365
- if (request.filler_words != null) {
366
- _queryParams.filler_words = request.filler_words.toString();
367
- }
368
- if (request.keyterm != null) {
369
- if (Array.isArray(request.keyterm)) {
370
- _queryParams.keyterm = request.keyterm.map((item) => item);
371
- }
372
- else {
373
- _queryParams.keyterm = request.keyterm;
374
- }
375
- }
376
- if (request.keywords != null) {
377
- if (Array.isArray(request.keywords)) {
378
- _queryParams.keywords = request.keywords.map((item) => item);
379
- }
380
- else {
381
- _queryParams.keywords = request.keywords;
382
- }
383
- }
384
- if (request.language != null) {
385
- _queryParams.language = request.language;
386
- }
387
- if (request.measurements != null) {
388
- _queryParams.measurements = request.measurements.toString();
389
- }
390
- if (request.model != null) {
391
- _queryParams.model = request.model;
392
- }
393
- if (request.multichannel != null) {
394
- _queryParams.multichannel = request.multichannel.toString();
395
- }
396
- if (request.numerals != null) {
397
- _queryParams.numerals = request.numerals.toString();
398
- }
399
- if (request.paragraphs != null) {
400
- _queryParams.paragraphs = request.paragraphs.toString();
401
- }
402
- if (request.profanity_filter != null) {
403
- _queryParams.profanity_filter = request.profanity_filter.toString();
404
- }
405
- if (request.punctuate != null) {
406
- _queryParams.punctuate = request.punctuate.toString();
407
- }
408
- if (request.redact != null) {
409
- _queryParams.redact = request.redact;
410
- }
411
- if (request.replace != null) {
412
- if (Array.isArray(request.replace)) {
413
- _queryParams.replace = request.replace.map((item) => item);
414
- }
415
- else {
416
- _queryParams.replace = request.replace;
417
- }
418
- }
419
- if (request.search != null) {
420
- if (Array.isArray(request.search)) {
421
- _queryParams.search = request.search.map((item) => item);
422
- }
423
- else {
424
- _queryParams.search = request.search;
425
- }
426
- }
427
- if (request.smart_format != null) {
428
- _queryParams.smart_format = request.smart_format.toString();
429
- }
430
- if (request.utterances != null) {
431
- _queryParams.utterances = request.utterances.toString();
432
- }
433
- if (request.utt_split != null) {
434
- _queryParams.utt_split = request.utt_split.toString();
435
- }
436
- if (request.version != null) {
437
- _queryParams.version = request.version;
438
- }
439
- if (request.mip_opt_out != null) {
440
- _queryParams.mip_opt_out = request.mip_opt_out.toString();
441
- }
182
+ const _queryParams = {
183
+ callback: request.callback,
184
+ callback_method: request.callback_method != null ? request.callback_method : undefined,
185
+ extra: request.extra,
186
+ sentiment: request.sentiment,
187
+ summarize: request.summarize != null ? request.summarize : undefined,
188
+ tag: request.tag,
189
+ topics: request.topics,
190
+ custom_topic: request.custom_topic,
191
+ custom_topic_mode: request.custom_topic_mode != null ? request.custom_topic_mode : undefined,
192
+ intents: request.intents,
193
+ custom_intent: request.custom_intent,
194
+ custom_intent_mode: request.custom_intent_mode != null ? request.custom_intent_mode : undefined,
195
+ detect_entities: request.detect_entities,
196
+ detect_language: request.detect_language,
197
+ diarize: request.diarize,
198
+ dictation: request.dictation,
199
+ encoding: request.encoding != null ? request.encoding : undefined,
200
+ filler_words: request.filler_words,
201
+ keyterm: request.keyterm,
202
+ keywords: request.keywords,
203
+ language: request.language,
204
+ measurements: request.measurements,
205
+ model: request.model != null ? request.model : undefined,
206
+ multichannel: request.multichannel,
207
+ numerals: request.numerals,
208
+ paragraphs: request.paragraphs,
209
+ profanity_filter: request.profanity_filter,
210
+ punctuate: request.punctuate,
211
+ redact: request.redact,
212
+ replace: request.replace,
213
+ search: request.search,
214
+ smart_format: request.smart_format,
215
+ utterances: request.utterances,
216
+ utt_split: request.utt_split,
217
+ version: request.version != null ? request.version : undefined,
218
+ mip_opt_out: request.mip_opt_out,
219
+ };
442
220
  const _binaryUploadRequest = yield core.file.toBinaryUploadRequest(uploadable);
443
221
  const _authRequest = yield this._options.authProvider.getAuthRequest();
444
222
  const _headers = 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);
@@ -2,8 +2,7 @@ import type { BaseClientOptions } from "../../../../../../BaseClient.mjs";
2
2
  import { type NormalizedClientOptions } from "../../../../../../BaseClient.mjs";
3
3
  import { V2Socket } from "./Socket.mjs";
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;
@@ -21,32 +21,17 @@ export class V2Client {
21
21
  return __awaiter(this, void 0, void 0, function* () {
22
22
  var _a, _b;
23
23
  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;
24
- const _queryParams = {};
25
- _queryParams.model = model;
26
- if (encoding != null) {
27
- _queryParams.encoding = encoding;
28
- }
29
- if (sampleRate != null) {
30
- _queryParams.sample_rate = sampleRate;
31
- }
32
- if (eagerEotThreshold != null) {
33
- _queryParams.eager_eot_threshold = eagerEotThreshold;
34
- }
35
- if (eotThreshold != null) {
36
- _queryParams.eot_threshold = eotThreshold;
37
- }
38
- if (eotTimeoutMs != null) {
39
- _queryParams.eot_timeout_ms = eotTimeoutMs;
40
- }
41
- if (keyterm != null) {
42
- _queryParams.keyterm = keyterm;
43
- }
44
- if (mipOptOut != null) {
45
- _queryParams.mip_opt_out = mipOptOut;
46
- }
47
- if (tag != null) {
48
- _queryParams.tag = tag;
49
- }
24
+ const _queryParams = {
25
+ model,
26
+ encoding,
27
+ sample_rate: sampleRate,
28
+ eager_eot_threshold: eagerEotThreshold,
29
+ eot_threshold: eotThreshold,
30
+ eot_timeout_ms: eotTimeoutMs,
31
+ keyterm,
32
+ mip_opt_out: mipOptOut,
33
+ tag,
34
+ };
50
35
  const _headers = mergeHeaders(mergeOnlyDefinedHeaders({ Authorization: args.Authorization }), headers);
51
36
  const socket = new core.ReconnectingWebSocket({
52
37
  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. */
@@ -54,11 +54,11 @@ export class V2Socket {
54
54
  on(event, callback) {
55
55
  this.eventHandlers[event] = callback;
56
56
  }
57
- sendListenV2Media(message) {
57
+ sendMedia(message) {
58
58
  this.assertSocketIsOpen();
59
- this.sendJson(message);
59
+ this.sendBinary(message);
60
60
  }
61
- sendListenV2CloseStream(message) {
61
+ sendCloseStream(message) {
62
62
  this.assertSocketIsOpen();
63
63
  this.sendJson(message);
64
64
  }
@@ -2,8 +2,7 @@ import type { BaseClientOptions } from "../../../../BaseClient.mjs";
2
2
  import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
3
3
  import { V1Client } from "../resources/v1/client/Client.mjs";
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.mjs";
4
4
  import { ProjectsClient } from "../resources/projects/client/Client.mjs";
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.mjs";
4
4
  import * as Deepgram from "../../../../../../../index.mjs";
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
  }
@@ -39,10 +39,9 @@ export class ModelsClient {
39
39
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
40
40
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
41
41
  const { include_outdated: includeOutdated } = request;
42
- const _queryParams = {};
43
- if (includeOutdated != null) {
44
- _queryParams.include_outdated = includeOutdated.toString();
45
- }
42
+ const _queryParams = {
43
+ include_outdated: includeOutdated,
44
+ };
46
45
  const _authRequest = yield this._options.authProvider.getAuthRequest();
47
46
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
48
47
  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.mjs";
9
9
  import { RequestsClient } from "../resources/requests/client/Client.mjs";
10
10
  import { UsageClient } from "../resources/usage/client/Client.mjs";
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
  }
@@ -118,13 +118,10 @@ export class ProjectsClient {
118
118
  return __awaiter(this, arguments, void 0, function* (project_id, request = {}, requestOptions) {
119
119
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
120
120
  const { limit, page } = request;
121
- const _queryParams = {};
122
- if (limit != null) {
123
- _queryParams.limit = limit.toString();
124
- }
125
- if (page != null) {
126
- _queryParams.page = page.toString();
127
- }
121
+ const _queryParams = {
122
+ limit,
123
+ page,
124
+ };
128
125
  const _authRequest = yield this._options.authProvider.getAuthRequest();
129
126
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
130
127
  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.mjs";
5
5
  import { FieldsClient } from "../resources/fields/client/Client.mjs";
6
6
  import { PurchasesClient } from "../resources/purchases/client/Client.mjs";
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.mjs";
4
4
  import * as Deepgram from "../../../../../../../../../../../index.mjs";
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.mjs";
4
4
  import * as Deepgram from "../../../../../../../../../../../index.mjs";
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
  }
@@ -45,33 +45,15 @@ export class BreakdownClient {
45
45
  return __awaiter(this, arguments, void 0, function* (project_id, request = {}, requestOptions) {
46
46
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
47
47
  const { start, end, accessor, deployment, tag, line_item: lineItem, grouping } = request;
48
- const _queryParams = {};
49
- if (start != null) {
50
- _queryParams.start = start;
51
- }
52
- if (end != null) {
53
- _queryParams.end = end;
54
- }
55
- if (accessor != null) {
56
- _queryParams.accessor = accessor;
57
- }
58
- if (deployment != null) {
59
- _queryParams.deployment = deployment;
60
- }
61
- if (tag != null) {
62
- _queryParams.tag = tag;
63
- }
64
- if (lineItem != null) {
65
- _queryParams.line_item = lineItem;
66
- }
67
- if (grouping != null) {
68
- if (Array.isArray(grouping)) {
69
- _queryParams.grouping = grouping.map((item) => item);
70
- }
71
- else {
72
- _queryParams.grouping = grouping;
73
- }
74
- }
48
+ const _queryParams = {
49
+ start,
50
+ end,
51
+ accessor,
52
+ deployment: deployment != null ? deployment : undefined,
53
+ tag,
54
+ line_item: lineItem,
55
+ grouping: Array.isArray(grouping) ? grouping.map((item) => item) : grouping != null ? grouping : undefined,
56
+ };
75
57
  const _authRequest = yield this._options.authProvider.getAuthRequest();
76
58
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
77
59
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../../../../../..
3
3
  import * as core from "../../../../../../../../../../../../core/index.mjs";
4
4
  import * as Deepgram from "../../../../../../../../../../../index.mjs";
5
5
  export declare namespace FieldsClient {
6
- interface Options extends BaseClientOptions {
7
- }
6
+ type Options = BaseClientOptions;
8
7
  interface RequestOptions extends BaseRequestOptions {
9
8
  }
10
9
  }