@deepgram/sdk 1.4.0 → 1.4.4

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 (220) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/browser/index.js +1 -0
  3. package/dist/index.d.ts +1342 -0
  4. package/dist/index.js +1 -0
  5. package/package.json +9 -6
  6. package/tsconfig-es6.json +16 -0
  7. package/webpack.config.js +21 -1
  8. package/bundle/billing.d.ts +0 -19
  9. package/bundle/billing.js +0 -73
  10. package/bundle/billing.js.map +0 -1
  11. package/bundle/browser/httpFetch.d.ts +0 -1
  12. package/bundle/browser/httpFetch.js +0 -75
  13. package/bundle/browser/httpFetch.js.map +0 -1
  14. package/bundle/browser/index.d.ts +0 -21
  15. package/bundle/browser/index.js +0 -35
  16. package/bundle/browser/index.js.map +0 -1
  17. package/bundle/browser/transcription/index.d.ts +0 -17
  18. package/bundle/browser/transcription/index.js +0 -75
  19. package/bundle/browser/transcription/index.js.map +0 -1
  20. package/bundle/browser/transcription/preRecordedTranscription.d.ts +0 -9
  21. package/bundle/browser/transcription/preRecordedTranscription.js +0 -87
  22. package/bundle/browser/transcription/preRecordedTranscription.js.map +0 -1
  23. package/bundle/constants/defaultOptions.d.ts +0 -6
  24. package/bundle/constants/defaultOptions.js +0 -10
  25. package/bundle/constants/defaultOptions.js.map +0 -1
  26. package/bundle/constants/index.d.ts +0 -1
  27. package/bundle/constants/index.js +0 -18
  28. package/bundle/constants/index.js.map +0 -1
  29. package/bundle/enums/alternatives.d.ts +0 -4
  30. package/bundle/enums/alternatives.js +0 -3
  31. package/bundle/enums/alternatives.js.map +0 -1
  32. package/bundle/enums/connectionState.d.ts +0 -6
  33. package/bundle/enums/connectionState.js +0 -11
  34. package/bundle/enums/connectionState.js.map +0 -1
  35. package/bundle/enums/diarization.d.ts +0 -4
  36. package/bundle/enums/diarization.js +0 -3
  37. package/bundle/enums/diarization.js.map +0 -1
  38. package/bundle/enums/index.d.ts +0 -7
  39. package/bundle/enums/index.js +0 -24
  40. package/bundle/enums/index.js.map +0 -1
  41. package/bundle/enums/liveTranscriptionEvents.d.ts +0 -6
  42. package/bundle/enums/liveTranscriptionEvents.js +0 -3
  43. package/bundle/enums/liveTranscriptionEvents.js.map +0 -1
  44. package/bundle/enums/models.d.ts +0 -5
  45. package/bundle/enums/models.js +0 -3
  46. package/bundle/enums/models.js.map +0 -1
  47. package/bundle/enums/punctuation.d.ts +0 -4
  48. package/bundle/enums/punctuation.js +0 -3
  49. package/bundle/enums/punctuation.js.map +0 -1
  50. package/bundle/enums/searchKind.d.ts +0 -4
  51. package/bundle/enums/searchKind.js +0 -3
  52. package/bundle/enums/searchKind.js.map +0 -1
  53. package/bundle/helpers/index.d.ts +0 -2
  54. package/bundle/helpers/index.js +0 -19
  55. package/bundle/helpers/index.js.map +0 -1
  56. package/bundle/helpers/secondsToTimestamp.d.ts +0 -1
  57. package/bundle/helpers/secondsToTimestamp.js +0 -8
  58. package/bundle/helpers/secondsToTimestamp.js.map +0 -1
  59. package/bundle/helpers/validateOptions.d.ts +0 -1
  60. package/bundle/helpers/validateOptions.js +0 -13
  61. package/bundle/helpers/validateOptions.js.map +0 -1
  62. package/bundle/httpRequest.d.ts +0 -3
  63. package/bundle/httpRequest.js +0 -91
  64. package/bundle/httpRequest.js.map +0 -1
  65. package/bundle/index.d.ts +0 -21
  66. package/bundle/index.js +0 -35
  67. package/bundle/index.js.map +0 -1
  68. package/bundle/invitation.d.ts +0 -30
  69. package/bundle/invitation.js +0 -99
  70. package/bundle/invitation.js.map +0 -1
  71. package/bundle/keys.d.ts +0 -33
  72. package/bundle/keys.js +0 -132
  73. package/bundle/keys.js.map +0 -1
  74. package/bundle/members.d.ts +0 -19
  75. package/bundle/members.js +0 -73
  76. package/bundle/members.js.map +0 -1
  77. package/bundle/projects.d.ts +0 -22
  78. package/bundle/projects.js +0 -82
  79. package/bundle/projects.js.map +0 -1
  80. package/bundle/scopes.d.ts +0 -21
  81. package/bundle/scopes.js +0 -77
  82. package/bundle/scopes.js.map +0 -1
  83. package/bundle/transcription/index.d.ts +0 -18
  84. package/bundle/transcription/index.js +0 -72
  85. package/bundle/transcription/index.js.map +0 -1
  86. package/bundle/transcription/liveTranscription.d.ts +0 -23
  87. package/bundle/transcription/liveTranscription.js +0 -83
  88. package/bundle/transcription/liveTranscription.js.map +0 -1
  89. package/bundle/transcription/preRecordedTranscription.d.ts +0 -8
  90. package/bundle/transcription/preRecordedTranscription.js +0 -114
  91. package/bundle/transcription/preRecordedTranscription.js.map +0 -1
  92. package/bundle/types/balance.d.ts +0 -6
  93. package/bundle/types/balance.js +0 -3
  94. package/bundle/types/balance.js.map +0 -1
  95. package/bundle/types/balanceList.d.ts +0 -4
  96. package/bundle/types/balanceList.js +0 -3
  97. package/bundle/types/balanceList.js.map +0 -1
  98. package/bundle/types/channel.d.ts +0 -25
  99. package/bundle/types/channel.js +0 -3
  100. package/bundle/types/channel.js.map +0 -1
  101. package/bundle/types/createKeyOptions.d.ts +0 -13
  102. package/bundle/types/createKeyOptions.js +0 -3
  103. package/bundle/types/createKeyOptions.js.map +0 -1
  104. package/bundle/types/hit.d.ts +0 -21
  105. package/bundle/types/hit.js +0 -3
  106. package/bundle/types/hit.js.map +0 -1
  107. package/bundle/types/index.d.ts +0 -38
  108. package/bundle/types/index.js +0 -55
  109. package/bundle/types/index.js.map +0 -1
  110. package/bundle/types/invitationList.d.ts +0 -4
  111. package/bundle/types/invitationList.js +0 -3
  112. package/bundle/types/invitationList.js.map +0 -1
  113. package/bundle/types/invitationOptions.d.ts +0 -4
  114. package/bundle/types/invitationOptions.js +0 -3
  115. package/bundle/types/invitationOptions.js.map +0 -1
  116. package/bundle/types/key.d.ts +0 -25
  117. package/bundle/types/key.js +0 -3
  118. package/bundle/types/key.js.map +0 -1
  119. package/bundle/types/keyResponse.d.ts +0 -10
  120. package/bundle/types/keyResponse.js +0 -3
  121. package/bundle/types/keyResponse.js.map +0 -1
  122. package/bundle/types/keyResponseObj.d.ts +0 -42
  123. package/bundle/types/keyResponseObj.js +0 -3
  124. package/bundle/types/keyResponseObj.js.map +0 -1
  125. package/bundle/types/keyword.d.ts +0 -4
  126. package/bundle/types/keyword.js +0 -3
  127. package/bundle/types/keyword.js.map +0 -1
  128. package/bundle/types/liveTranscriptionOptions.d.ts +0 -148
  129. package/bundle/types/liveTranscriptionOptions.js +0 -3
  130. package/bundle/types/liveTranscriptionOptions.js.map +0 -1
  131. package/bundle/types/liveTranscriptionResponse.d.ts +0 -9
  132. package/bundle/types/liveTranscriptionResponse.js +0 -3
  133. package/bundle/types/liveTranscriptionResponse.js.map +0 -1
  134. package/bundle/types/member.d.ts +0 -7
  135. package/bundle/types/member.js +0 -3
  136. package/bundle/types/member.js.map +0 -1
  137. package/bundle/types/memberList.d.ts +0 -4
  138. package/bundle/types/memberList.js +0 -3
  139. package/bundle/types/memberList.js.map +0 -1
  140. package/bundle/types/message.d.ts +0 -3
  141. package/bundle/types/message.js +0 -3
  142. package/bundle/types/message.js.map +0 -1
  143. package/bundle/types/metadata.d.ts +0 -8
  144. package/bundle/types/metadata.js +0 -3
  145. package/bundle/types/metadata.js.map +0 -1
  146. package/bundle/types/prerecordedTranscriptionOptions.d.ts +0 -126
  147. package/bundle/types/prerecordedTranscriptionOptions.js +0 -3
  148. package/bundle/types/prerecordedTranscriptionOptions.js.map +0 -1
  149. package/bundle/types/prerecordedTranscriptionResponse.d.ts +0 -25
  150. package/bundle/types/prerecordedTranscriptionResponse.js +0 -51
  151. package/bundle/types/prerecordedTranscriptionResponse.js.map +0 -1
  152. package/bundle/types/project.d.ts +0 -17
  153. package/bundle/types/project.js +0 -3
  154. package/bundle/types/project.js.map +0 -1
  155. package/bundle/types/projectPatchRequest.d.ts +0 -4
  156. package/bundle/types/projectPatchRequest.js +0 -3
  157. package/bundle/types/projectPatchRequest.js.map +0 -1
  158. package/bundle/types/projectPatchResponse.d.ts +0 -6
  159. package/bundle/types/projectPatchResponse.js +0 -3
  160. package/bundle/types/projectPatchResponse.js.map +0 -1
  161. package/bundle/types/projectResponse.d.ts +0 -4
  162. package/bundle/types/projectResponse.js +0 -3
  163. package/bundle/types/projectResponse.js.map +0 -1
  164. package/bundle/types/requestFunction.d.ts +0 -5
  165. package/bundle/types/requestFunction.js +0 -3
  166. package/bundle/types/requestFunction.js.map +0 -1
  167. package/bundle/types/scopeList.d.ts +0 -3
  168. package/bundle/types/scopeList.js +0 -3
  169. package/bundle/types/scopeList.js.map +0 -1
  170. package/bundle/types/search.d.ts +0 -14
  171. package/bundle/types/search.js +0 -3
  172. package/bundle/types/search.js.map +0 -1
  173. package/bundle/types/transcriptionSource.d.ts +0 -14
  174. package/bundle/types/transcriptionSource.js +0 -3
  175. package/bundle/types/transcriptionSource.js.map +0 -1
  176. package/bundle/types/usageCallback.d.ts +0 -4
  177. package/bundle/types/usageCallback.js +0 -3
  178. package/bundle/types/usageCallback.js.map +0 -1
  179. package/bundle/types/usageField.d.ts +0 -7
  180. package/bundle/types/usageField.js +0 -3
  181. package/bundle/types/usageField.js.map +0 -1
  182. package/bundle/types/usageFieldOptions.d.ts +0 -4
  183. package/bundle/types/usageFieldOptions.js +0 -3
  184. package/bundle/types/usageFieldOptions.js.map +0 -1
  185. package/bundle/types/usageOptions.d.ts +0 -23
  186. package/bundle/types/usageOptions.js +0 -3
  187. package/bundle/types/usageOptions.js.map +0 -1
  188. package/bundle/types/usageRequest.d.ts +0 -11
  189. package/bundle/types/usageRequest.js +0 -3
  190. package/bundle/types/usageRequest.js.map +0 -1
  191. package/bundle/types/usageRequestDetail.d.ts +0 -30
  192. package/bundle/types/usageRequestDetail.js +0 -3
  193. package/bundle/types/usageRequestDetail.js.map +0 -1
  194. package/bundle/types/usageRequestList.d.ts +0 -6
  195. package/bundle/types/usageRequestList.js +0 -3
  196. package/bundle/types/usageRequestList.js.map +0 -1
  197. package/bundle/types/usageRequestListOptions.d.ts +0 -7
  198. package/bundle/types/usageRequestListOptions.js +0 -3
  199. package/bundle/types/usageRequestListOptions.js.map +0 -1
  200. package/bundle/types/usageRequestMessage.d.ts +0 -3
  201. package/bundle/types/usageRequestMessage.js +0 -3
  202. package/bundle/types/usageRequestMessage.js.map +0 -1
  203. package/bundle/types/usageResponse.d.ts +0 -10
  204. package/bundle/types/usageResponse.js +0 -3
  205. package/bundle/types/usageResponse.js.map +0 -1
  206. package/bundle/types/usageResponseDetail.d.ts +0 -6
  207. package/bundle/types/usageResponseDetail.js +0 -3
  208. package/bundle/types/usageResponseDetail.js.map +0 -1
  209. package/bundle/types/utterance.d.ts +0 -39
  210. package/bundle/types/utterance.js +0 -3
  211. package/bundle/types/utterance.js.map +0 -1
  212. package/bundle/types/wordBase.d.ts +0 -8
  213. package/bundle/types/wordBase.js +0 -3
  214. package/bundle/types/wordBase.js.map +0 -1
  215. package/bundle/usage.d.ts +0 -35
  216. package/bundle/usage.js +0 -122
  217. package/bundle/usage.js.map +0 -1
  218. package/bundle/userAgent.d.ts +0 -1
  219. package/bundle/userAgent.js +0 -20
  220. package/bundle/userAgent.js.map +0 -1
@@ -0,0 +1,1342 @@
1
+ declare module 'types/balance' {
2
+ export type Balance = {
3
+ balance_id: string;
4
+ amount: number;
5
+ units: string;
6
+ purchase: string;
7
+ };
8
+
9
+ }
10
+ declare module 'types/balanceList' {
11
+ import { Balance } from 'types/balance';
12
+ export type BalanceList = {
13
+ balances?: Array<Balance>;
14
+ };
15
+
16
+ }
17
+ declare module 'types/hit' {
18
+ /**
19
+ * Represents an identified search term in the transcript
20
+ */
21
+ export type Hit = {
22
+ /**
23
+ * Value between 0 and 1 that indicates the model's relative confidence in this hit.
24
+ */
25
+ confidence: number;
26
+ /**
27
+ * Offset in seconds from the start of the audio to where the hit occurs.
28
+ */
29
+ start: number;
30
+ /**
31
+ * Offset in seconds from the start of the audio to where the hit ends.
32
+ */
33
+ end: number;
34
+ /**
35
+ * Transcript that corresponds to the time between start and end.
36
+ */
37
+ snippet: string;
38
+ };
39
+
40
+ }
41
+ declare module 'types/search' {
42
+ import { Hit } from 'types/hit';
43
+ /**
44
+ * Search result for a transcription
45
+ */
46
+ export type Search = {
47
+ /**
48
+ * Term for which Deepgram is searching.
49
+ */
50
+ query: string;
51
+ /**
52
+ * Instances of query found in transcript
53
+ */
54
+ hits: Array<Hit>;
55
+ };
56
+
57
+ }
58
+ declare module 'types/wordBase' {
59
+ export type WordBase = {
60
+ word: string;
61
+ start: number;
62
+ end: number;
63
+ confidence: number;
64
+ punctuated_word?: string;
65
+ speaker?: number;
66
+ };
67
+
68
+ }
69
+ declare module 'types/channel' {
70
+ import { Search } from 'types/search';
71
+ import { WordBase } from 'types/wordBase';
72
+ /**
73
+ * Channel of speech identified by Deepgram
74
+ */
75
+ export type Channel = {
76
+ /**
77
+ * Searched terms & results
78
+ */
79
+ search?: Array<Search>;
80
+ alternatives: Array<{
81
+ /**
82
+ * Text of speech identified by API
83
+ */
84
+ transcript: string;
85
+ /**
86
+ * Confidence in transcript generated
87
+ */
88
+ confidence: number;
89
+ /**
90
+ * Array of words included in the transcript
91
+ */
92
+ words: Array<WordBase>;
93
+ }>;
94
+ };
95
+
96
+ }
97
+ declare module 'types/createKeyOptions' {
98
+ /**
99
+ * Optional options used when creating an API key
100
+ */
101
+ export type CreateKeyOptions = {
102
+ /**
103
+ * Date on which the key you would like to create should expire.
104
+ */
105
+ expirationDate?: Date;
106
+ /**
107
+ * Length of time (in seconds) during which the key you would like to create will remain valid.
108
+ */
109
+ timeToLive?: number;
110
+ };
111
+
112
+ }
113
+ declare module 'types/invitationOptions' {
114
+ export type InvitationOptions = {
115
+ email?: string;
116
+ scope?: string;
117
+ };
118
+
119
+ }
120
+ declare module 'types/invitationList' {
121
+ import { InvitationOptions } from 'types/invitationOptions';
122
+ export type InvitationList = {
123
+ invites?: Array<InvitationOptions>;
124
+ };
125
+
126
+ }
127
+ declare module 'types/key' {
128
+ /**
129
+ * API key used for authenticating with the Deepgram API
130
+ */
131
+ export type Key = {
132
+ /**
133
+ * Unique identifier of the key to use in API requests
134
+ */
135
+ api_key_id: string;
136
+ /**
137
+ * API key to send in API requests (Only displayed when first created)
138
+ */
139
+ key?: string;
140
+ /**
141
+ * Comment for user reference
142
+ */
143
+ comment: string;
144
+ /**
145
+ * Timestamp of the date/time the key was created
146
+ */
147
+ created: string;
148
+ /**
149
+ * Array of scopes assigned to the key
150
+ */
151
+ scopes: Array<string>;
152
+ };
153
+
154
+ }
155
+ declare module 'types/member' {
156
+ export type Member = {
157
+ member_id: string;
158
+ first_name?: string;
159
+ last_name?: string;
160
+ scopes?: Array<string>;
161
+ email: string;
162
+ };
163
+
164
+ }
165
+ declare module 'types/keyResponseObj' {
166
+ import { Key } from 'types/key';
167
+ import { Member } from 'types/member';
168
+ export type KeyResponseObj = {
169
+ /**
170
+ * Optional member associated with the API key
171
+ */
172
+ member?: Member;
173
+ /**
174
+ * API key
175
+ */
176
+ api_key: Key;
177
+ /**
178
+ * Unique identifier of the key to use in API requests
179
+ * @deprecated This property has moved to api_key.api_key_id and will
180
+ * be removed in future versions.
181
+ */
182
+ api_key_id: string;
183
+ /**
184
+ * API key to send in API requests (Only displayed when first created)
185
+ * @deprecated This property has moved to api_key.key and will
186
+ * be removed in future versions.
187
+ */
188
+ key?: string;
189
+ /**
190
+ * Comment for user reference
191
+ * @deprecated This property has moved to api_key.comment and will
192
+ * be removed in future versions.
193
+ */
194
+ comment: string;
195
+ /**
196
+ * Timestamp of the date/time the key was created
197
+ * @deprecated This property has moved to api_key.created and will
198
+ * be removed in future versions.
199
+ */
200
+ created: string;
201
+ /**
202
+ * Array of scopes assigned to the key
203
+ * @deprecated This property has moved to api_key.scopes and will
204
+ * be removed in future versions.
205
+ */
206
+ scopes: Array<string>;
207
+ };
208
+
209
+ }
210
+ declare module 'types/keyResponse' {
211
+ import { KeyResponseObj } from 'types/keyResponseObj';
212
+ /**
213
+ * Response from the Deepgram API to list keys
214
+ */
215
+ export type KeyResponse = {
216
+ /**
217
+ * Array of API keys associated with the project
218
+ */
219
+ api_keys: Array<KeyResponseObj>;
220
+ };
221
+
222
+ }
223
+ declare module 'enums/alternatives' {
224
+ export const enum Alternatives {
225
+ One = "one-alternative",
226
+ Multiple = "multiple-alternatives"
227
+ }
228
+
229
+ }
230
+ declare module 'enums/connectionState' {
231
+ export enum ConnectionState {
232
+ CONNECTING = 0,
233
+ OPEN = 1,
234
+ CLOSING = 2,
235
+ CLOSED = 3
236
+ }
237
+
238
+ }
239
+ declare module 'enums/diarization' {
240
+ export const enum Diarization {
241
+ Diarized = "diarized",
242
+ NonDiarized = "non-diarized"
243
+ }
244
+
245
+ }
246
+ declare module 'enums/liveTranscriptionEvents' {
247
+ export const enum LiveTranscriptionEvents {
248
+ Open = "open",
249
+ Close = "close",
250
+ TranscriptReceived = "transcriptReceived",
251
+ Error = "error"
252
+ }
253
+
254
+ }
255
+ declare module 'enums/models' {
256
+ export const enum Models {
257
+ General = "general",
258
+ Meeting = "meeting",
259
+ PhoneCall = "phonecall"
260
+ }
261
+
262
+ }
263
+ declare module 'enums/punctuation' {
264
+ export const enum Punctuation {
265
+ NonPunctuated = "non-punctuated",
266
+ Punctuated = "punctuated"
267
+ }
268
+
269
+ }
270
+ declare module 'enums/searchKind' {
271
+ export const enum SearchKind {
272
+ NoSearch = "no-search",
273
+ WithSearch = "with-search"
274
+ }
275
+
276
+ }
277
+ declare module 'enums/index' {
278
+ export * from 'enums/alternatives';
279
+ export * from 'enums/connectionState';
280
+ export * from 'enums/diarization';
281
+ export * from 'enums/liveTranscriptionEvents';
282
+ export * from 'enums/models';
283
+ export * from 'enums/punctuation';
284
+ export * from 'enums/searchKind';
285
+
286
+ }
287
+ declare module 'types/liveTranscriptionOptions' {
288
+ import { Models } from 'enums';
289
+ /**
290
+ * Options for transcription
291
+ */
292
+ export type LiveTranscriptionOptions = {
293
+ /**
294
+ * AI model used to process submitted audio.
295
+ * @default general
296
+ * @remarks Possible values are general, phonecall, meeting or a custom string
297
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/model
298
+ */
299
+ model?: Models | string;
300
+ /**
301
+ * Version of the model to use.
302
+ * @default latest
303
+ * @remarks latest OR <version_id>
304
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/version
305
+ */
306
+ version?: string;
307
+ /**
308
+ * Tier of the model to use.
309
+ * @default base
310
+ * @remarks Possible values are base or enhanced
311
+ * @see https://developers.deepgram.com/documentation/features/tier/
312
+ */
313
+ tier?: string;
314
+ /**
315
+ * Terms or phrases to search for in the submitted audio and replace
316
+ * @remarks Can send multiple instances in query string replace=this:that&replace=thisalso:thatalso. Replacing a term or phrase with nothing will remove the term or phrase from the audio transcript.
317
+ * @see https://developers.deepgram.com/documentation/features/replace/
318
+ */
319
+ replace?: string;
320
+ /**
321
+ * BCP-47 language tag that hints at the primary spoken language.
322
+ * @default en-US
323
+ * @remarks Possible values are en-GB, en-IN, en-NZ, en-US, es, fr, ko, pt,
324
+ * pt-BR, ru, tr or null
325
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/language
326
+ */
327
+ language?: string;
328
+ /**
329
+ * Indicates whether to add punctuation and capitalization to the transcript.
330
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/punctuate
331
+ */
332
+ punctuate?: boolean;
333
+ /**
334
+ * Indicates whether to remove profanity from the transcript.
335
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/profanity_filter
336
+ */
337
+ profanity_filter?: boolean;
338
+ /**
339
+ * Indicates whether to redact sensitive information, replacing redacted content with asterisks (*).
340
+ * @remarks Options include:
341
+ * `pci`: Redacts sensitive credit card information, including credit card number, expiration date, and CVV
342
+ * `numbers` (or `true)`: Aggressively redacts strings of numerals
343
+ * `ssn` (*beta*): Redacts social security numbers
344
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/redact
345
+ */
346
+ redact?: Array<string>;
347
+ /**
348
+ * Indicates whether to recognize speaker changes. When set to true, each word
349
+ * in the transcript will be assigned a speaker number starting at 0.
350
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/diarize
351
+ */
352
+ diarize?: boolean;
353
+ /**
354
+ * Indicates whether to transcribe each audio channel independently. When set
355
+ * to true, you will receive one transcript for each channel, which means you
356
+ * can apply a different model to each channel using the model parameter (e.g.,
357
+ * set model to general:phonecall, which applies the general model to channel
358
+ * 0 and the phonecall model to channel 1).
359
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/multichannel
360
+ */
361
+ multichannel?: boolean;
362
+ /**
363
+ * Maximum number of transcript alternatives to return. Just like a human listener,
364
+ * Deepgram can provide multiple possible interpretations of what it hears.
365
+ * @default 1
366
+ */
367
+ alternatives?: number;
368
+ /**
369
+ * Indicates whether to convert numbers from written format (e.g., one) to
370
+ * numerical format (e.g., 1). Deepgram can format numbers up to 999,999.
371
+ * @remarks Converted numbers do not include punctuation. For example,
372
+ * 999,999 would be transcribed as 999999.
373
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/numerals
374
+ */
375
+ numerals?: boolean;
376
+ /**
377
+ * Terms or phrases to search for in the submitted audio. Deepgram searches
378
+ * for acoustic patterns in audio rather than text patterns in transcripts
379
+ * because we have noticed that acoustic pattern matching is more performant.
380
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/search
381
+ */
382
+ search?: Array<string>;
383
+ /**
384
+ * Callback URL to provide if you would like your submitted audio to be
385
+ * processed asynchronously. When passed, Deepgram will immediately respond
386
+ * with a request_id. When it has finished analyzing the audio, it will send
387
+ * a POST request to the provided URL with an appropriate HTTP status code.
388
+ * @remarks You may embed basic authentication credentials in the callback URL.
389
+ * Only ports 80, 443, 8080, and 8443 can be used for callbacks.
390
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/callback
391
+ */
392
+ callback?: string;
393
+ /**
394
+ * Keywords to which the model should pay particular attention to boosting
395
+ * or suppressing to help it understand context. Just like a human listener,
396
+ * Deepgram can better understand mumbled, distorted, or otherwise
397
+ * hard-to-decipher speech when it knows the context of the conversation.
398
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/keywords
399
+ */
400
+ keywords?: Array<string>;
401
+ /**
402
+ * Indicates whether the streaming endpoint should send you updates to its
403
+ * transcription as more audio becomes available. By default, the streaming
404
+ * endpoint returns regular updates, which means transcription results will
405
+ * likely change for a period of time. You can avoid receiving these updates
406
+ * by setting this flag to false.
407
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeStreamingAudio/properties/interim_results
408
+ */
409
+ interim_results?: boolean;
410
+ /**
411
+ * Indicates whether Deepgram will detect whether a speaker has finished
412
+ * speaking (or paused for a significant period of time, indicating the
413
+ * completion of an idea). When Deepgram detects an endpoint, it assumes
414
+ * that no additional data will improve its prediction, so it immediately
415
+ * finalizes the result for the processed time range and returns the
416
+ * transcript with a speech_final parameter set to true.
417
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeStreamingAudio/properties/endpointing
418
+ */
419
+ endpointing?: boolean;
420
+ /**
421
+ * Length of time in milliseconds of silence that voice activation detection
422
+ * (VAD) will use to detect that a speaker has finished speaking. Used when
423
+ * endpointing is enabled. Defaults to 10 ms. Deepgram customers may configure
424
+ * a value between 10 ms and 500 ms; on-premise customers may remove this
425
+ * restriction.
426
+ * @default 10
427
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeStreamingAudio/properties/vad_turnoff
428
+ */
429
+ vad_turnoff?: number;
430
+ /**
431
+ * Expected encoding of the submitted streaming audio.
432
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeStreamingAudio/properties/encoding
433
+ */
434
+ encoding?: string;
435
+ /**
436
+ * Number of independent audio channels contained in submitted streaming
437
+ * audio. Only read when a value is provided for encoding.
438
+ * @default 1
439
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeStreamingAudio/properties/channels
440
+ */
441
+ channels?: number;
442
+ /**
443
+ * Sample rate of submitted streaming audio. Required (and only read)
444
+ * when a value is provided for encoding.
445
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeStreamingAudio/properties/sample_rate
446
+ */
447
+ sample_rate?: number;
448
+ };
449
+
450
+ }
451
+ declare module 'types/liveTranscriptionResponse' {
452
+ import { Channel } from 'types/channel';
453
+ export type LiveTranscriptionResponse = {
454
+ channel_index: Array<number>;
455
+ duration: number;
456
+ start: number;
457
+ is_final: boolean;
458
+ speech_final: boolean;
459
+ channel: Channel;
460
+ };
461
+
462
+ }
463
+ declare module 'types/memberList' {
464
+ import { Member } from 'types/member';
465
+ export type MemberList = {
466
+ members?: Array<Member>;
467
+ };
468
+
469
+ }
470
+ declare module 'types/message' {
471
+ export type Message = {
472
+ message?: string;
473
+ };
474
+
475
+ }
476
+ declare module 'types/metadata' {
477
+ export type Metadata = {
478
+ request_id: string;
479
+ transaction_key: string;
480
+ sha256: string;
481
+ created: string;
482
+ duration: number;
483
+ channels: number;
484
+ };
485
+
486
+ }
487
+ declare module 'types/prerecordedTranscriptionOptions' {
488
+ import { Models } from 'enums';
489
+ /**
490
+ * Options for transcription
491
+ */
492
+ export type PrerecordedTranscriptionOptions = {
493
+ /**
494
+ * AI model used to process submitted audio.
495
+ * @default general
496
+ * @remarks Possible values are general, phonecall, meeting or a custom string
497
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/model
498
+ */
499
+ model?: Models | string;
500
+ /**
501
+ * Version of the model to use.
502
+ * @default latest
503
+ * @remarks latest OR <version_id>
504
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/version
505
+ */
506
+ version?: string;
507
+ /**
508
+ * Tier of the model to use.
509
+ * @default base
510
+ * @remarks Possible values are base or enhanced
511
+ * @see https://developers.deepgram.com/documentation/features/tier/
512
+ */
513
+ tier?: string;
514
+ /**
515
+ * Terms or phrases to search for in the submitted audio and replace
516
+ * @remarks Can send multiple instances in query string replace=this:that&replace=thisalso:thatalso. Replacing a term or phrase with nothing will remove the term or phrase from the audio transcript.
517
+ * @see https://developers.deepgram.com/documentation/features/replace/
518
+ */
519
+ replace?: string;
520
+ /**
521
+ * BCP-47 language tag that hints at the primary spoken language.
522
+ * @default en-US
523
+ * @remarks Possible values are en-GB, en-IN, en-NZ, en-US, es, fr, ko, pt,
524
+ * pt-BR, ru, tr or null
525
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/language
526
+ */
527
+ language?: string;
528
+ /**
529
+ * Indicates whether to add punctuation and capitalization to the transcript.
530
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/punctuate
531
+ */
532
+ punctuate?: boolean;
533
+ /**
534
+ * Indicates whether to remove profanity from the transcript.
535
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/profanity_filter
536
+ */
537
+ profanity_filter?: boolean;
538
+ /**
539
+ * Indicates whether to redact sensitive information, replacing redacted content with asterisks (*).
540
+ * @remarks Options include:
541
+ * `pci`: Redacts sensitive credit card information, including credit card number, expiration date, and CVV
542
+ * `numbers` (or `true)`: Aggressively redacts strings of numerals
543
+ * `ssn` (*beta*): Redacts social security numbers
544
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/redact
545
+ */
546
+ redact?: Array<string>;
547
+ /**
548
+ * Indicates whether to recognize speaker changes. When set to true, each word
549
+ * in the transcript will be assigned a speaker number starting at 0.
550
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/diarize
551
+ */
552
+ diarize?: boolean;
553
+ /**
554
+ * Indicates whether to transcribe each audio channel independently. When set
555
+ * to true, you will receive one transcript for each channel, which means you
556
+ * can apply a different model to each channel using the model parameter (e.g.,
557
+ * set model to general:phonecall, which applies the general model to channel
558
+ * 0 and the phonecall model to channel 1).
559
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/multichannel
560
+ */
561
+ multichannel?: boolean;
562
+ /**
563
+ * Maximum number of transcript alternatives to return. Just like a human listener,
564
+ * Deepgram can provide multiple possible interpretations of what it hears.
565
+ * @default 1
566
+ */
567
+ alternatives?: number;
568
+ /**
569
+ * Indicates whether to convert numbers from written format (e.g., one) to
570
+ * numerical format (e.g., 1). Deepgram can format numbers up to 999,999.
571
+ * @remarks Converted numbers do not include punctuation. For example,
572
+ * 999,999 would be transcribed as 999999.
573
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/numerals
574
+ */
575
+ numerals?: boolean;
576
+ /**
577
+ * Terms or phrases to search for in the submitted audio. Deepgram searches
578
+ * for acoustic patterns in audio rather than text patterns in transcripts
579
+ * because we have noticed that acoustic pattern matching is more performant.
580
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/search
581
+ */
582
+ search?: Array<string>;
583
+ /**
584
+ * Callback URL to provide if you would like your submitted audio to be
585
+ * processed asynchronously. When passed, Deepgram will immediately respond
586
+ * with a request_id. When it has finished analyzing the audio, it will send
587
+ * a POST request to the provided URL with an appropriate HTTP status code.
588
+ * @remarks You may embed basic authentication credentials in the callback URL.
589
+ * Only ports 80, 443, 8080, and 8443 can be used for callbacks.
590
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/callback
591
+ */
592
+ callback?: string;
593
+ /**
594
+ * Keywords to which the model should pay particular attention to boosting
595
+ * or suppressing to help it understand context. Just like a human listener,
596
+ * Deepgram can better understand mumbled, distorted, or otherwise
597
+ * hard-to-decipher speech when it knows the context of the conversation.
598
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/keywords
599
+ */
600
+ keywords?: Array<string>;
601
+ /**
602
+ * Indicates whether Deepgram will segment speech into meaningful semantic
603
+ * units, which allows the model to interact more naturally and effectively
604
+ * with speakers' spontaneous speech patterns. For example, when humans
605
+ * speak to each other conversationally, they often pause mid-sentence to
606
+ * reformulate their thoughts, or stop and restart a badly-worded sentence.
607
+ * When utterances is set to true, these utterances are identified and
608
+ * returned in the transcript results.
609
+ *
610
+ * By default, when utterances is enabled, it starts a new utterance after
611
+ * 0.8 s of silence. You can customize the length of time used to determine
612
+ * where to split utterances by submitting the utt_split parameter.
613
+ * @remarks **BETA FEATURE**
614
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/utterances
615
+ */
616
+ utterances?: boolean;
617
+ /**
618
+ * Length of time in seconds of silence between words that Deepgram will
619
+ * use when determining where to split utterances. Used when utterances
620
+ * is enabled.
621
+ * @default 0.8 seconds
622
+ * @remarks **BETA FEATURE**
623
+ * @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/utt_split
624
+ */
625
+ utt_split?: number;
626
+ };
627
+
628
+ }
629
+ declare module 'types/utterance' {
630
+ import { WordBase } from 'types/wordBase';
631
+ export type Utterance = {
632
+ /**
633
+ * Start time (in seconds) from the beginning of the audio stream.
634
+ */
635
+ start: number;
636
+ /**
637
+ * End time (in seconds) from the beginning of the audio stream.
638
+ */
639
+ end: number;
640
+ /**
641
+ * Floating point value between 0 and 1 that indicates overall transcript
642
+ * reliability. Larger values indicate higher confidence.
643
+ */
644
+ confidence: number;
645
+ /**
646
+ * Audio channel to which the utterance belongs. When using multichannel audio,
647
+ * utterances are chronologically ordered by channel.
648
+ */
649
+ channel: number;
650
+ /**
651
+ * Transcript for the audio segment being processed.
652
+ */
653
+ transcript: string;
654
+ /**
655
+ * Object containing each word in the transcript, along with its start time
656
+ * and end time (in seconds) from the beginning of the audio stream, and a confidence value.
657
+ */
658
+ words: Array<WordBase>;
659
+ /**
660
+ * Integer indicating the predicted speaker of the majority of words
661
+ * in the utterance who is saying the words being processed.
662
+ */
663
+ speaker?: number;
664
+ /**
665
+ * Unique identifier of the utterance
666
+ */
667
+ id: string;
668
+ };
669
+
670
+ }
671
+ declare module 'helpers/secondsToTimestamp' {
672
+ export function secondsToTimestamp(seconds: number): string;
673
+
674
+ }
675
+ declare module 'helpers/validateOptions' {
676
+ export function validateOptions(apiKey: string, apiUrl: string): void;
677
+
678
+ }
679
+ declare module 'helpers/index' {
680
+ export * from 'helpers/secondsToTimestamp';
681
+ export * from 'helpers/validateOptions';
682
+
683
+ }
684
+ declare module 'types/prerecordedTranscriptionResponse' {
685
+ import { Metadata } from 'types/metadata';
686
+ import { Channel } from 'types/channel';
687
+ import { Utterance } from 'types/utterance';
688
+ export class PrerecordedTranscriptionResponse {
689
+ request_id?: string;
690
+ metadata?: Metadata;
691
+ results?: {
692
+ channels: Array<Channel>;
693
+ utterances?: Array<Utterance>;
694
+ };
695
+ /**
696
+ * Converts the transcription to the WebVTT format
697
+ * @remarks In order to translate the transcription to WebVTT, the utterances
698
+ * feature must be used.
699
+ * @returns A string with the transcription in the WebVTT format
700
+ */
701
+ toWebVTT(): string;
702
+ /**
703
+ * Converts the transcription to the SRT format
704
+ * @remarks In order to translate the transcription to SRT, the utterances
705
+ * feature must be used.
706
+ * @returns A string with the transcription in the SRT format
707
+ */
708
+ toSRT(): string;
709
+ }
710
+
711
+ }
712
+ declare module 'types/project' {
713
+ /**
714
+ * Deepgram project
715
+ */
716
+ export type Project = {
717
+ /**
718
+ * Unique identifier of the project
719
+ */
720
+ project_id: string;
721
+ /**
722
+ * User provided name of the project
723
+ */
724
+ name?: string;
725
+ /**
726
+ * Name of the company associated with the project. Optional.
727
+ */
728
+ company?: string;
729
+ };
730
+
731
+ }
732
+ declare module 'types/projectPatchResponse' {
733
+ export type ProjectPatchResponse = {
734
+ /**
735
+ * Success message.
736
+ */
737
+ message: string;
738
+ };
739
+
740
+ }
741
+ declare module 'types/projectResponse' {
742
+ import { Project } from 'types/project';
743
+ export type ProjectResponse = {
744
+ projects: Array<Project>;
745
+ };
746
+
747
+ }
748
+ declare module 'types/scopeList' {
749
+ export type ScopeList = {
750
+ scopes: Array<string>;
751
+ };
752
+
753
+ }
754
+ declare module 'types/transcriptionSource' {
755
+ /// <reference types="node" />
756
+ import { ReadStream } from 'fs';
757
+ export type TranscriptionSource = UrlSource | BufferSource | ReadStreamSource;
758
+ export type ReadStreamSource = {
759
+ stream: ReadStream;
760
+ mimetype: string;
761
+ };
762
+ export type UrlSource = {
763
+ url: string;
764
+ };
765
+ export type BufferSource = {
766
+ buffer: Buffer;
767
+ mimetype: string;
768
+ };
769
+
770
+ }
771
+ declare module 'types/usageCallback' {
772
+ export type UsageCallback = {
773
+ code: number;
774
+ completed: string;
775
+ };
776
+
777
+ }
778
+ declare module 'types/usageField' {
779
+ export type UsageField = {
780
+ tags: Array<string>;
781
+ models: Array<string>;
782
+ processing_methods: Array<string>;
783
+ languages: Array<string>;
784
+ features: Array<string>;
785
+ };
786
+
787
+ }
788
+ declare module 'types/usageFieldOptions' {
789
+ export type UsageFieldOptions = {
790
+ start?: string;
791
+ end?: string;
792
+ };
793
+
794
+ }
795
+ declare module 'types/usageOptions' {
796
+ export type UsageOptions = {
797
+ start?: string;
798
+ end?: string;
799
+ accessor?: string;
800
+ tag?: Array<string>;
801
+ method?: "sync" | "async" | "streaming";
802
+ model?: string;
803
+ multichannel?: boolean;
804
+ interim_results?: boolean;
805
+ punctuate?: boolean;
806
+ ner?: boolean;
807
+ utterances?: boolean;
808
+ replace?: boolean;
809
+ profanity_filter?: boolean;
810
+ keywords?: boolean;
811
+ sentiment?: boolean;
812
+ diarize?: boolean;
813
+ detect_language?: boolean;
814
+ search?: boolean;
815
+ redact?: boolean;
816
+ alternatives?: boolean;
817
+ numerals?: boolean;
818
+ };
819
+
820
+ }
821
+ declare module 'types/usageRequestDetail' {
822
+ export type UsageRequestDetail = {
823
+ details: {
824
+ usd: number;
825
+ duration: number;
826
+ total_audio: number;
827
+ channels: number;
828
+ streams: number;
829
+ model: string;
830
+ method: "sync" | "async" | "streaming";
831
+ tags: Array<string>;
832
+ features: Array<string>;
833
+ config: {
834
+ multichannel?: boolean;
835
+ interim_results?: boolean;
836
+ punctuate?: boolean;
837
+ ner?: boolean;
838
+ utterances?: boolean;
839
+ replace?: boolean;
840
+ profanity_filter?: boolean;
841
+ keywords?: boolean;
842
+ sentiment?: boolean;
843
+ diarize?: boolean;
844
+ detect_language?: boolean;
845
+ search?: boolean;
846
+ redact?: boolean;
847
+ alternatives?: boolean;
848
+ numerals?: boolean;
849
+ };
850
+ };
851
+ };
852
+
853
+ }
854
+ declare module 'types/usageRequestMessage' {
855
+ export type UsageRequestMessage = {
856
+ message?: string;
857
+ };
858
+
859
+ }
860
+ declare module 'types/usageRequest' {
861
+ import { UsageCallback } from 'types/usageCallback';
862
+ import { UsageRequestDetail } from 'types/usageRequestDetail';
863
+ import { UsageRequestMessage } from 'types/usageRequestMessage';
864
+ export type UsageRequest = {
865
+ request_id: string;
866
+ created: string;
867
+ path: string;
868
+ accessor: string;
869
+ response?: UsageRequestDetail | UsageRequestMessage;
870
+ callback?: UsageCallback;
871
+ };
872
+
873
+ }
874
+ declare module 'types/usageRequestList' {
875
+ import { UsageRequest } from 'types/usageRequest';
876
+ export type UsageRequestList = {
877
+ page: number;
878
+ limit: number;
879
+ requests?: Array<UsageRequest>;
880
+ };
881
+
882
+ }
883
+ declare module 'types/usageRequestListOptions' {
884
+ export type UsageRequestListOptions = {
885
+ start?: string;
886
+ end?: string;
887
+ page?: number;
888
+ limit?: number;
889
+ status?: "succeeded" | "failed";
890
+ };
891
+
892
+ }
893
+ declare module 'types/usageResponseDetail' {
894
+ export type UsageResponseDetail = {
895
+ start: string;
896
+ end: string;
897
+ hours: number;
898
+ requests: number;
899
+ };
900
+
901
+ }
902
+ declare module 'types/usageResponse' {
903
+ import { UsageResponseDetail } from 'types/usageResponseDetail';
904
+ export type UsageResponse = {
905
+ start: string;
906
+ end: string;
907
+ resolution: {
908
+ units: string;
909
+ amount: number;
910
+ };
911
+ results: Array<UsageResponseDetail>;
912
+ };
913
+
914
+ }
915
+ declare module 'types/projectPatchRequest' {
916
+ export type ProjectPatchRequest = {
917
+ name?: string;
918
+ company?: string;
919
+ };
920
+
921
+ }
922
+ declare module 'types/requestFunction' {
923
+ /// <reference types="node" />
924
+ import { ReadStream } from 'fs';
925
+ export type RequestFunction = NodeRequest | BrowserRequest;
926
+ export type NodeRequest = (method: string, api_key: string, apiUrl: string, path: string, payload?: string | Buffer | ReadStream, options?: Object) => Promise<any>;
927
+ export type BrowserRequest = (method: string, api_key: string, apiUrl: string, path: string, payload?: string) => Promise<any>;
928
+
929
+ }
930
+ declare module 'types/index' {
931
+ export * from 'types/balance';
932
+ export * from 'types/balanceList';
933
+ export * from 'types/channel';
934
+ export * from 'types/createKeyOptions';
935
+ export * from 'types/hit';
936
+ export * from 'types/invitationList';
937
+ export * from 'types/invitationOptions';
938
+ export * from 'types/key';
939
+ export * from 'types/keyResponse';
940
+ export * from 'types/liveTranscriptionOptions';
941
+ export * from 'types/liveTranscriptionResponse';
942
+ export * from 'types/member';
943
+ export * from 'types/memberList';
944
+ export * from 'types/message';
945
+ export * from 'types/metadata';
946
+ export * from 'types/prerecordedTranscriptionOptions';
947
+ export * from 'types/prerecordedTranscriptionResponse';
948
+ export * from 'types/project';
949
+ export * from 'types/projectPatchResponse';
950
+ export * from 'types/projectResponse';
951
+ export * from 'types/scopeList';
952
+ export * from 'types/search';
953
+ export * from 'types/transcriptionSource';
954
+ export * from 'types/usageCallback';
955
+ export * from 'types/usageField';
956
+ export * from 'types/usageFieldOptions';
957
+ export * from 'types/usageOptions';
958
+ export * from 'types/usageRequest';
959
+ export * from 'types/usageRequestDetail';
960
+ export * from 'types/usageRequestList';
961
+ export * from 'types/usageRequestListOptions';
962
+ export * from 'types/usageResponse';
963
+ export * from 'types/usageResponseDetail';
964
+ export * from 'types/utterance';
965
+ export * from 'types/wordBase';
966
+ export * from 'types/keyResponseObj';
967
+ export * from 'types/projectPatchRequest';
968
+ export * from 'types/requestFunction';
969
+
970
+ }
971
+ declare module 'billing' {
972
+ import { BalanceList, Balance, RequestFunction } from 'types';
973
+ export class Billing {
974
+ private _credentials;
975
+ private _apiUrl;
976
+ private _request;
977
+ constructor(_credentials: string, _apiUrl: string, _request: RequestFunction);
978
+ private apiPath;
979
+ /**
980
+ * Retrieves list of balance info of the specified project.
981
+ * @param projectId Unique identifier of the project
982
+ */
983
+ listBalances(projectId: string): Promise<BalanceList>;
984
+ /**
985
+ * Retrieves balance info of a specified balance_id in the specified project.
986
+ * @param projectId Unique identifier of the project
987
+ * @param balanceId Unique identifier of the balance
988
+ */
989
+ getBalance(projectId: string, balanceId: string): Promise<Balance>;
990
+ }
991
+
992
+ }
993
+ declare module 'userAgent' {
994
+ export function userAgent(): string;
995
+
996
+ }
997
+ declare module 'httpRequest' {
998
+ /// <reference types="node" />
999
+ import { ReadStream } from 'fs';
1000
+ export function _request<T>(method: string, api_key: string, apiUrl: string, path: string, payload?: string | Buffer | ReadStream, options?: Object): Promise<T>;
1001
+
1002
+ }
1003
+ declare module 'constants/defaultOptions' {
1004
+ /**
1005
+ * Default SDK options
1006
+ */
1007
+ export const DefaultOptions: {
1008
+ apiUrl: string;
1009
+ };
1010
+
1011
+ }
1012
+ declare module 'constants/index' {
1013
+ export * from 'constants/defaultOptions';
1014
+
1015
+ }
1016
+ declare module 'keys' {
1017
+ import { CreateKeyOptions, KeyResponse, Key, RequestFunction } from 'types';
1018
+ export class Keys {
1019
+ private _credentials;
1020
+ private _apiUrl;
1021
+ private _request;
1022
+ constructor(_credentials: string, _apiUrl: string, _request: RequestFunction);
1023
+ private apiPath;
1024
+ /**
1025
+ * Retrieves all keys associated with the provided projectId
1026
+ * @param projectId Unique identifier of the project containing API keys
1027
+ */
1028
+ list(projectId: string): Promise<KeyResponse>;
1029
+ /**
1030
+ * Retrieves a specific key associated with the provided projectId
1031
+ * @param projectId Unique identifier of the project containing API keys
1032
+ * @param keyId Unique identifier for the key to retrieve
1033
+ */
1034
+ get(projectId: string, keyId: string): Promise<Key>;
1035
+ /**
1036
+ * Creates an API key with the provided scopes
1037
+ * @param projectId Unique identifier of the project to create an API key under
1038
+ * @param comment Comment to describe the key
1039
+ * @param scopes Permission scopes associated with the API key
1040
+ * @param options Optional options used when creating API keys
1041
+ */
1042
+ create(projectId: string, comment: string, scopes: Array<string>, options?: CreateKeyOptions): Promise<Key>;
1043
+ /**
1044
+ * Deletes an API key
1045
+ * @param projectId Unique identifier of the project to create an API key under
1046
+ * @param keyId Unique identifier for the key to delete
1047
+ */
1048
+ delete(projectId: string, keyId: string): Promise<void>;
1049
+ }
1050
+
1051
+ }
1052
+ declare module 'projects' {
1053
+ import { Project, ProjectPatchResponse, ProjectResponse, ProjectPatchRequest, RequestFunction } from 'types';
1054
+ export class Projects {
1055
+ private _credentials;
1056
+ private _apiUrl;
1057
+ private _request;
1058
+ constructor(_credentials: string, _apiUrl: string, _request: RequestFunction);
1059
+ private apiPath;
1060
+ /**
1061
+ * Returns all projects accessible by the API key
1062
+ */
1063
+ list(): Promise<ProjectResponse>;
1064
+ /**
1065
+ * Retrieves a specific project based on the provided projectId
1066
+ * @param projectId Unique identifier of the project to retrieve
1067
+ */
1068
+ get(projectId: string): Promise<Project>;
1069
+ /**
1070
+ * Update a specific project
1071
+ * @param project project to update
1072
+ */
1073
+ update(project: Project, payload: ProjectPatchRequest): Promise<ProjectPatchResponse>;
1074
+ }
1075
+
1076
+ }
1077
+ declare module 'transcription/liveTranscription' {
1078
+ /// <reference types="node" />
1079
+ import EventEmitter from 'events';
1080
+ import { ConnectionState } from 'enums';
1081
+ import { LiveTranscriptionOptions } from 'types';
1082
+ export class LiveTranscription extends EventEmitter {
1083
+ private _socket;
1084
+ constructor(credentials: string, apiUrl: string, options?: LiveTranscriptionOptions);
1085
+ private _bindSocketEvents;
1086
+ /**
1087
+ * Returns the ready state of the websocket connection
1088
+ */
1089
+ getReadyState(): ConnectionState;
1090
+ /**
1091
+ * Sends data to the Deepgram API via websocket connection
1092
+ * @param data Audio data to send to Deepgram
1093
+ */
1094
+ send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void;
1095
+ /**
1096
+ * Denote that you are finished sending audio and close
1097
+ * the websocket connection when transcription is finished
1098
+ */
1099
+ finish(): void;
1100
+ }
1101
+
1102
+ }
1103
+ declare module 'transcription/preRecordedTranscription' {
1104
+ import { PrerecordedTranscriptionOptions, PrerecordedTranscriptionResponse, TranscriptionSource } from 'types';
1105
+ /**
1106
+ * Transcribes audio from a file or buffer
1107
+ * @param credentials Base64 encoded API key & secret
1108
+ * @param source Url or Buffer of file to transcribe
1109
+ * @param options Options to modify transcriptions
1110
+ */
1111
+ export const preRecordedTranscription: (apiKey: string, apiUrl: string, source: TranscriptionSource, options?: PrerecordedTranscriptionOptions | undefined) => Promise<PrerecordedTranscriptionResponse>;
1112
+
1113
+ }
1114
+ declare module 'transcription/index' {
1115
+ import { LiveTranscriptionOptions, PrerecordedTranscriptionOptions, PrerecordedTranscriptionResponse, TranscriptionSource } from 'types';
1116
+ import { LiveTranscription } from 'transcription/liveTranscription';
1117
+ export class Transcriber {
1118
+ private _credentials;
1119
+ private _apiUrl;
1120
+ constructor(_credentials: string, _apiUrl: string);
1121
+ /**
1122
+ * Transcribes prerecorded audio from a file or buffer
1123
+ * @param source Url or Buffer of file to transcribe
1124
+ * @param options Options to modify transcriptions
1125
+ */
1126
+ preRecorded(source: TranscriptionSource, options?: PrerecordedTranscriptionOptions): Promise<PrerecordedTranscriptionResponse>;
1127
+ /**
1128
+ * Opens a websocket to Deepgram's API for live transcriptions
1129
+ * @param options Options to modify transcriptions
1130
+ */
1131
+ live(options?: LiveTranscriptionOptions): LiveTranscription;
1132
+ }
1133
+
1134
+ }
1135
+ declare module 'usage' {
1136
+ import { RequestFunction, UsageField, UsageFieldOptions, UsageOptions, UsageRequest, UsageRequestList, UsageRequestListOptions, UsageResponse } from 'types';
1137
+ export class Usage {
1138
+ private _credentials;
1139
+ private _apiUrl;
1140
+ private _request;
1141
+ constructor(_credentials: string, _apiUrl: string, _request: RequestFunction);
1142
+ private apiPath;
1143
+ /**
1144
+ * Retrieves all requests associated with the provided projectId based
1145
+ * on the provided options
1146
+ * @param projectId Unique identifier of the project
1147
+ * @param options Additional filter options
1148
+ */
1149
+ listRequests(projectId: string, options?: UsageRequestListOptions): Promise<UsageRequestList>;
1150
+ /**
1151
+ * Retrieves a specific request associated with the provided projectId
1152
+ * @param projectId Unique identifier of the project
1153
+ * @param requestId Unique identifier for the request to retrieve
1154
+ */
1155
+ getRequest(projectId: string, requestId: string): Promise<UsageRequest>;
1156
+ /**
1157
+ * Retrieves usage associated with the provided projectId based
1158
+ * on the provided options
1159
+ * @param projectId Unique identifier of the project
1160
+ * @param options Options to filter usage
1161
+ */
1162
+ getUsage(projectId: string, options?: UsageOptions): Promise<UsageResponse>;
1163
+ /**
1164
+ * Retrieves features used by the provided projectId based
1165
+ * on the provided options
1166
+ * @param projectId Unique identifier of the project
1167
+ * @param options Options to filter usage
1168
+ */
1169
+ getFields(projectId: string, options?: UsageFieldOptions): Promise<UsageField>;
1170
+ }
1171
+
1172
+ }
1173
+ declare module 'members' {
1174
+ import { MemberList, Message, RequestFunction } from 'types';
1175
+ export class Members {
1176
+ private _credentials;
1177
+ private _apiUrl;
1178
+ private _request;
1179
+ constructor(_credentials: string, _apiUrl: string, _request: RequestFunction);
1180
+ private apiPath;
1181
+ /**
1182
+ * Retrieves account objects for all of the accounts in the specified project.
1183
+ * @param projectId Unique identifier of the project
1184
+ */
1185
+ listMembers(projectId: string): Promise<MemberList>;
1186
+ /**
1187
+ * Retrieves account objects for all of the accounts in the specified project.
1188
+ * @param projectId Unique identifier of the project
1189
+ * @param memberId Unique identifier of the member
1190
+ */
1191
+ removeMember(projectId: string, memberId: string): Promise<Message>;
1192
+ }
1193
+
1194
+ }
1195
+ declare module 'invitation' {
1196
+ import { Message, InvitationOptions, InvitationList, RequestFunction } from 'types';
1197
+ export class Invitation {
1198
+ private _credentials;
1199
+ private _apiUrl;
1200
+ private _request;
1201
+ constructor(_credentials: string, _apiUrl: string, _request: RequestFunction);
1202
+ private apiPath;
1203
+ /**
1204
+ * Lists all the current invites of a specified project.
1205
+ * @param projectId Unique identifier of the project
1206
+ */
1207
+ list(projectId: string): Promise<InvitationList>;
1208
+ /**
1209
+ * Sends an invitation to join the specified project.
1210
+ * @param projectId Unique identifier of the project
1211
+ */
1212
+ send(projectId: string, options: InvitationOptions): Promise<Message>;
1213
+ /**
1214
+ * Removes the authenticated account from the specified project.
1215
+ * @param projectId Unique identifier of the project
1216
+ */
1217
+ leave(projectId: string): Promise<Message>;
1218
+ /**
1219
+ * Removes the specified email from the invitations on the specified project.
1220
+ * @param projectId Unique identifier of the project
1221
+ * @param email email address of the invitee
1222
+ * NOTE: This will return successful even if the email does not have an invite on the project.
1223
+ */
1224
+ delete(projectId: string, email: string): Promise<Message>;
1225
+ }
1226
+
1227
+ }
1228
+ declare module 'scopes' {
1229
+ import { ScopeList, Message, RequestFunction } from 'types';
1230
+ export class Scopes {
1231
+ private _credentials;
1232
+ private _apiUrl;
1233
+ private _request;
1234
+ constructor(_credentials: string, _apiUrl: string, _request: RequestFunction);
1235
+ private apiPath;
1236
+ /**
1237
+ * Retrieves scopes of the specified member in the specified project.
1238
+ * @param projectId Unique identifier of the project
1239
+ * @param memberId Unique identifier of the member
1240
+ */
1241
+ get(projectId: string, memberId: string): Promise<ScopeList>;
1242
+ /**
1243
+ * Updates the scope for the specified member in the specified project.
1244
+ * @param projectId Unique identifier of the project
1245
+ * @param memberId Unique identifier of the member being updated
1246
+ * @param scope string of the scope to update to
1247
+ */
1248
+ update(projectID: string, memberId: string, scope: string): Promise<Message>;
1249
+ }
1250
+
1251
+ }
1252
+ declare module 'index' {
1253
+ import { Keys } from 'keys';
1254
+ import { Projects } from 'projects';
1255
+ import { Transcriber } from 'transcription';
1256
+ import { Usage } from 'usage';
1257
+ import { Members } from 'members';
1258
+ import { Invitation } from 'invitation';
1259
+ import { Billing } from 'billing';
1260
+ import { Scopes } from 'scopes';
1261
+ export class Deepgram {
1262
+ private _apiUrl;
1263
+ private _apiKey;
1264
+ keys: Keys;
1265
+ projects: Projects;
1266
+ transcription: Transcriber;
1267
+ usage: Usage;
1268
+ members: Members;
1269
+ invitation: Invitation;
1270
+ billing: Billing;
1271
+ scopes: Scopes;
1272
+ constructor(apiKey: string, apiUrl?: string);
1273
+ }
1274
+
1275
+ }
1276
+ declare module 'browser/httpFetch' {
1277
+ export function _request<T>(method: string, api_key: string, apiUrl: string, path: string, payload?: string): Promise<T>;
1278
+
1279
+ }
1280
+ declare module 'browser/transcription/preRecordedTranscription' {
1281
+ import { PrerecordedTranscriptionOptions, PrerecordedTranscriptionResponse, UrlSource } from 'types';
1282
+ /**
1283
+ * Transcribes audio from a url
1284
+ * @param credentials Base64 encoded API key & secret
1285
+ * @param apiUrl url string of Deepgram's API
1286
+ * @param source Url or Buffer of file to transcribe
1287
+ * @param options Options to modify transcriptions
1288
+ */
1289
+ export const preRecordedTranscription: (apiKey: string, apiUrl: string, source: UrlSource, options?: PrerecordedTranscriptionOptions | undefined) => Promise<PrerecordedTranscriptionResponse>;
1290
+
1291
+ }
1292
+ declare module 'browser/transcription/index' {
1293
+ import { LiveTranscriptionOptions, PrerecordedTranscriptionOptions, PrerecordedTranscriptionResponse, UrlSource } from 'types';
1294
+ export class Transcriber {
1295
+ private _credentials;
1296
+ private _apiUrl;
1297
+ constructor(_credentials: string, _apiUrl: string);
1298
+ /**
1299
+ * Transcribes prerecorded audio from a file or buffer
1300
+ * @param source Url or Buffer of file to transcribe
1301
+ * @param options Options to modify transcriptions
1302
+ */
1303
+ preRecorded(source: UrlSource, options?: PrerecordedTranscriptionOptions): Promise<PrerecordedTranscriptionResponse>;
1304
+ /**
1305
+ * Opens a websocket to Deepgram's API for live transcriptions
1306
+ * @param options Options to modify transcriptions
1307
+ */
1308
+ live(options?: LiveTranscriptionOptions): WebSocket;
1309
+ }
1310
+
1311
+ }
1312
+ declare module 'browser/index' {
1313
+ import { Transcriber } from 'browser/transcription';
1314
+ import { Projects } from 'projects';
1315
+ import { Keys } from 'keys';
1316
+ import { Usage } from 'usage';
1317
+ import { Members } from 'members';
1318
+ import { Invitation } from 'invitation';
1319
+ import { Billing } from 'billing';
1320
+ import { Scopes } from 'scopes';
1321
+ export class Deepgram {
1322
+ private _apiUrl;
1323
+ private _apiKey;
1324
+ transcription: Transcriber;
1325
+ projects: Projects;
1326
+ keys: Keys;
1327
+ usage: Usage;
1328
+ members: Members;
1329
+ invitation: Invitation;
1330
+ billing: Billing;
1331
+ scopes: Scopes;
1332
+ constructor(apiKey: string, apiUrl?: string);
1333
+ }
1334
+
1335
+ }
1336
+ declare module 'types/keyword' {
1337
+ export type Keyword = {
1338
+ keyword: string;
1339
+ boost?: number;
1340
+ };
1341
+
1342
+ }