@deepgram/sdk 2.1.1 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +251 -360
  2. package/dist/billing.d.ts +4 -4
  3. package/dist/helpers/secondsToTimestamp.d.ts +1 -1
  4. package/dist/httpRequest.d.ts +1 -0
  5. package/dist/index.js +1 -1
  6. package/dist/invitation.d.ts +5 -5
  7. package/dist/keys.d.ts +3 -3
  8. package/dist/members.d.ts +5 -5
  9. package/dist/projects.d.ts +8 -8
  10. package/dist/scopes.d.ts +5 -5
  11. package/dist/transcription/index.d.ts +5 -5
  12. package/dist/transcription/liveTranscription.d.ts +1 -0
  13. package/dist/transcription/preRecordedTranscription.d.ts +1 -1
  14. package/dist/types/alternatives.d.ts +1 -1
  15. package/dist/types/balance.d.ts +3 -1
  16. package/dist/types/balanceList.d.ts +3 -1
  17. package/dist/types/channel.d.ts +1 -1
  18. package/dist/types/createKeyOptions.d.ts +1 -1
  19. package/dist/types/entity.d.ts +1 -1
  20. package/dist/types/error.d.ts +1 -1
  21. package/dist/types/hit.d.ts +1 -1
  22. package/dist/types/invitationList.d.ts +3 -1
  23. package/dist/types/invitationOptions.d.ts +1 -1
  24. package/dist/types/key.d.ts +3 -1
  25. package/dist/types/keyResponse.d.ts +3 -1
  26. package/dist/types/keyResponseObj.d.ts +1 -1
  27. package/dist/types/keyword.d.ts +1 -1
  28. package/dist/types/liveTranscriptionOptions.d.ts +15 -15
  29. package/dist/types/liveTranscriptionResponse.d.ts +1 -1
  30. package/dist/types/member.d.ts +1 -1
  31. package/dist/types/memberList.d.ts +3 -1
  32. package/dist/types/message.d.ts +3 -1
  33. package/dist/types/metadata.d.ts +11 -1
  34. package/dist/types/paragraph.d.ts +1 -1
  35. package/dist/types/paragraphGroup.d.ts +1 -1
  36. package/dist/types/prerecordedTranscriptionOptions.d.ts +16 -16
  37. package/dist/types/prerecordedTranscriptionResponse.d.ts +14 -10
  38. package/dist/types/project.d.ts +3 -1
  39. package/dist/types/projectPatchRequest.d.ts +1 -1
  40. package/dist/types/projectPatchResponse.d.ts +3 -1
  41. package/dist/types/projectResponse.d.ts +3 -1
  42. package/dist/types/requestFunction.d.ts +4 -3
  43. package/dist/types/scopeList.d.ts +3 -1
  44. package/dist/types/search.d.ts +1 -1
  45. package/dist/types/sentence.d.ts +1 -1
  46. package/dist/types/summary.d.ts +1 -1
  47. package/dist/types/toggleConfigOptions.d.ts +1 -1
  48. package/dist/types/topic.d.ts +1 -1
  49. package/dist/types/topicGroup.d.ts +1 -1
  50. package/dist/types/transcriptionSource.d.ts +5 -4
  51. package/dist/types/translation.d.ts +1 -1
  52. package/dist/types/usageCallback.d.ts +1 -1
  53. package/dist/types/usageField.d.ts +3 -1
  54. package/dist/types/usageFieldOptions.d.ts +1 -1
  55. package/dist/types/usageOptions.d.ts +2 -2
  56. package/dist/types/usageRequest.d.ts +3 -1
  57. package/dist/types/usageRequestDetail.d.ts +1 -1
  58. package/dist/types/usageRequestList.d.ts +3 -1
  59. package/dist/types/usageRequestListOptions.d.ts +1 -1
  60. package/dist/types/usageRequestMessage.d.ts +1 -1
  61. package/dist/types/usageResponse.d.ts +3 -1
  62. package/dist/types/usageResponseDetail.d.ts +1 -1
  63. package/dist/types/utterance.d.ts +1 -1
  64. package/dist/types/warning.d.ts +5 -0
  65. package/dist/types/wordBase.d.ts +1 -1
  66. package/dist/usage.d.ts +7 -7
  67. package/package.json +3 -2
@@ -9,32 +9,32 @@ export declare class Projects {
9
9
  * Returns all projects accessible by the API key.
10
10
  * @param {string} endpoint Custom API endpoint
11
11
  *
12
- * @returns {Promise<ProjectResponse | ErrorResponse>}
12
+ * @returns {Promise<ProjectResponse>}
13
13
  */
14
- list(endpoint?: string): Promise<ProjectResponse | ErrorResponse>;
14
+ list(endpoint?: string): Promise<ProjectResponse>;
15
15
  /**
16
16
  * Retrieves a specific project based on the provided project_id.
17
17
  * @param {string} projectId Unique identifier of the project
18
18
  * @param {string} endpoint Custom API endpoint
19
19
  *
20
- * @returns {Promise<Project | ErrorResponse>}
20
+ * @returns {Promise<Project>}
21
21
  */
22
- get(projectId: string, endpoint?: string): Promise<Project | ErrorResponse>;
22
+ get(projectId: string, endpoint?: string): Promise<Project>;
23
23
  /**
24
24
  * Update a project.
25
- * @param {Project} project Project to update
25
+ * @param {string | Project} project Project to update
26
26
  * @param {ProjectPatchRequest} payload Details to change as an object
27
27
  * @param {string} endpoint Custom API endpoint
28
28
  *
29
- * @returns {Promise<ProjectPatchResponse | ErrorResponse>}
29
+ * @returns {Promise<ProjectPatchResponse>}
30
30
  */
31
- update(project: Project, payload: ProjectPatchRequest, endpoint?: string): Promise<ProjectPatchResponse | ErrorResponse>;
31
+ update(project: string | Project, payload: ProjectPatchRequest, endpoint?: string): Promise<ProjectPatchResponse>;
32
32
  /**
33
33
  * Delete a project.
34
34
  * @param {string} projectId Unique identifier of the project
35
35
  * @param {string} endpoint Custom API endpoint
36
36
  *
37
- * @returns {Promise<Message | ErrorResponse>}
37
+ * @returns {Promise<void | ErrorResponse>}
38
38
  */
39
39
  delete(projectId: string, endpoint?: string): Promise<void | ErrorResponse>;
40
40
  }
package/dist/scopes.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ScopeList, Message, RequestFunction, ErrorResponse } from "./types";
1
+ import { ScopeList, Message, RequestFunction } from "./types";
2
2
  export declare class Scopes {
3
3
  private _credentials;
4
4
  private _apiUrl;
@@ -11,9 +11,9 @@ export declare class Scopes {
11
11
  * @param {string} memberId Unique identifier of the member
12
12
  * @param {string} endpoint Custom API endpoint
13
13
  *
14
- * @returns {Promise<ScopeList | ErrorResponse>}
14
+ * @returns {Promise<ScopeList>}
15
15
  */
16
- get(projectId: string, memberId: string, endpoint?: string): Promise<ScopeList | ErrorResponse>;
16
+ get(projectId: string, memberId: string, endpoint?: string): Promise<ScopeList>;
17
17
  /**
18
18
  * Updates the scope for the specified member in the specified project.
19
19
  * @param {string} projectId Unique identifier of the project
@@ -21,7 +21,7 @@ export declare class Scopes {
21
21
  * @param {string} scope Scope to update the member to
22
22
  * @param {string} endpoint Custom API endpoint
23
23
  *
24
- * @returns {Promise<Message | ErrorResponse>}
24
+ * @returns {Promise<Message>}
25
25
  */
26
- update(projectID: string, memberId: string, scope: string, endpoint?: string): Promise<Message | ErrorResponse>;
26
+ update(projectID: string, memberId: string, scope: string, endpoint?: string): Promise<Message>;
27
27
  }
@@ -1,4 +1,4 @@
1
- import { LiveTranscriptionOptions, PrerecordedTranscriptionOptions, PrerecordedTranscriptionResponse, TranscriptionSource, ErrorResponse } from "../types";
1
+ import { LiveTranscriptionOptions, PrerecordedTranscriptionOptions, PrerecordedTranscriptionResponse, TranscriptionSource } from "../types";
2
2
  import { LiveTranscription } from "./liveTranscription";
3
3
  export declare class Transcriber {
4
4
  private _credentials;
@@ -11,15 +11,15 @@ export declare class Transcriber {
11
11
  * @param {PrerecordedTranscriptionOptions} options Options used to toggle transcription features
12
12
  * @param {string} endpoint Custom API endpoint
13
13
  *
14
- * @returns {Promise<PrerecordedTranscriptionResponse | ErrorResponse>}
14
+ * @returns {Promise<PrerecordedTranscriptionResponse>}
15
15
  */
16
- preRecorded(source: TranscriptionSource, options?: PrerecordedTranscriptionOptions, endpoint?: string): Promise<PrerecordedTranscriptionResponse | ErrorResponse>;
16
+ preRecorded(source: TranscriptionSource, options?: PrerecordedTranscriptionOptions, endpoint?: string): Promise<PrerecordedTranscriptionResponse>;
17
17
  /**
18
18
  * Opens a websocket to Deepgram's API for live transcriptions
19
19
  * @param {LiveTranscriptionOptions} options Options used to toggle transcription features
20
20
  * @param {string} endpoint Custom API endpoint
21
21
  *
22
- * @returns {LiveTranscription | ErrorResponse}
22
+ * @returns {LiveTranscription}
23
23
  */
24
- live(options?: LiveTranscriptionOptions, endpoint?: string): LiveTranscription | ErrorResponse;
24
+ live(options?: LiveTranscriptionOptions, endpoint?: string): LiveTranscription;
25
25
  }
@@ -7,6 +7,7 @@ export declare class LiveTranscription extends EventEmitter {
7
7
  constructor(credentials: string, apiUrl: string, requireSSL: boolean, options?: LiveTranscriptionOptions, endpoint?: string);
8
8
  private _bindSocketEvents;
9
9
  configure(config: ToggleConfigOptions): void;
10
+ keepAlive(): void;
10
11
  /**
11
12
  * Returns the ready state of the websocket connection
12
13
  */
@@ -10,4 +10,4 @@ import { PrerecordedTranscriptionOptions, PrerecordedTranscriptionResponse, Tran
10
10
  * @param options string
11
11
  * @returns Promise<PrerecordedTranscriptionResponse>
12
12
  */
13
- export declare const preRecordedTranscription: (apiKey: string, apiUrl: string, requireSSL: boolean, source: TranscriptionSource, options?: PrerecordedTranscriptionOptions | undefined, endpoint?: string) => Promise<PrerecordedTranscriptionResponse>;
13
+ export declare const preRecordedTranscription: (apiKey: string, apiUrl: string, requireSSL: boolean, source: TranscriptionSource, options?: PrerecordedTranscriptionOptions, endpoint?: string) => Promise<PrerecordedTranscriptionResponse>;
@@ -4,7 +4,7 @@ import { Entity } from "./entity";
4
4
  import { Summary } from "./summary";
5
5
  import { Translation } from "./translation";
6
6
  import { TopicGroup } from "./topicGroup";
7
- export declare type Alternative = {
7
+ export type Alternative = {
8
8
  /**
9
9
  * Text of speech identified by API
10
10
  */
@@ -1,6 +1,8 @@
1
- export declare type Balance = {
1
+ export type Balance = {
2
2
  balance_id: string;
3
3
  amount: number;
4
4
  units: string;
5
5
  purchase: string;
6
+ err_code?: string;
7
+ err_msg?: string;
6
8
  };
@@ -1,4 +1,6 @@
1
1
  import { Balance } from "./balance";
2
- export declare type BalanceList = {
2
+ export type BalanceList = {
3
3
  balances?: Array<Balance>;
4
+ err_code?: string;
5
+ err_msg?: string;
4
6
  };
@@ -3,7 +3,7 @@ import { Search } from "./search";
3
3
  /**
4
4
  * Channel of speech identified by Deepgram
5
5
  */
6
- export declare type Channel = {
6
+ export type Channel = {
7
7
  /**
8
8
  * Searched terms & results
9
9
  */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Optional options used when creating an API key
3
3
  */
4
- export declare type CreateKeyOptions = {
4
+ export type CreateKeyOptions = {
5
5
  /**
6
6
  * Date on which the key you would like to create should expire.
7
7
  */
@@ -1,4 +1,4 @@
1
- export declare type Entity = {
1
+ export type Entity = {
2
2
  /**
3
3
  * This is the type of the entity.
4
4
  * Examples include: PER, ORG, DATE, etc.
@@ -1,4 +1,4 @@
1
- export declare type ErrorResponse = {
1
+ export type ErrorResponse = {
2
2
  err_code: string;
3
3
  err_msg: string;
4
4
  request_id: string;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Represents an identified search term in the transcript
3
3
  */
4
- export declare type Hit = {
4
+ export type Hit = {
5
5
  /**
6
6
  * Value between 0 and 1 that indicates the model's relative confidence in this hit.
7
7
  */
@@ -1,4 +1,6 @@
1
1
  import { InvitationOptions } from "./invitationOptions";
2
- export declare type InvitationList = {
2
+ export type InvitationList = {
3
3
  invites?: Array<InvitationOptions>;
4
+ err_code?: string;
5
+ err_msg?: string;
4
6
  };
@@ -1,4 +1,4 @@
1
- export declare type InvitationOptions = {
1
+ export type InvitationOptions = {
2
2
  email?: string;
3
3
  scope?: string;
4
4
  };
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * API key used for authenticating with the Deepgram API
3
3
  */
4
- export declare type Key = {
4
+ export type Key = {
5
5
  /**
6
6
  * Unique identifier of the key to use in API requests
7
7
  */
@@ -22,4 +22,6 @@ export declare type Key = {
22
22
  * Array of scopes assigned to the key
23
23
  */
24
24
  scopes: Array<string>;
25
+ err_code?: string;
26
+ err_msg?: string;
25
27
  };
@@ -2,9 +2,11 @@ import { KeyResponseObj } from "./keyResponseObj";
2
2
  /**
3
3
  * Response from the Deepgram API to list keys
4
4
  */
5
- export declare type KeyResponse = {
5
+ export type KeyResponse = {
6
6
  /**
7
7
  * Array of API keys associated with the project
8
8
  */
9
9
  api_keys: Array<KeyResponseObj>;
10
+ err_code?: string;
11
+ err_msg?: string;
10
12
  };
@@ -1,6 +1,6 @@
1
1
  import { Key } from "./key";
2
2
  import { Member } from "./member";
3
- export declare type KeyResponseObj = {
3
+ export type KeyResponseObj = {
4
4
  /**
5
5
  * Optional member associated with the API key
6
6
  */
@@ -1,4 +1,4 @@
1
- export declare type Keyword = {
1
+ export type Keyword = {
2
2
  keyword: string;
3
3
  boost?: number;
4
4
  };
@@ -2,7 +2,7 @@ import { Models } from "../enums";
2
2
  /**
3
3
  * Options for transcription
4
4
  */
5
- export declare type LiveTranscriptionOptions = {
5
+ export type LiveTranscriptionOptions = {
6
6
  /**
7
7
  * AI model used to process submitted audio.
8
8
  * @default general
@@ -24,12 +24,6 @@ export declare type LiveTranscriptionOptions = {
24
24
  * @see https://developers.deepgram.com/documentation/features/tier/
25
25
  */
26
26
  tier?: string;
27
- /**
28
- * Terms or phrases to search for in the submitted audio and replace
29
- * @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.
30
- * @see https://developers.deepgram.com/documentation/features/replace/
31
- */
32
- replace?: string;
33
27
  /**
34
28
  * BCP-47 language tag that hints at the primary spoken language.
35
29
  * @default en-US
@@ -103,13 +97,6 @@ export declare type LiveTranscriptionOptions = {
103
97
  * adds spaces between numbers in the transcript
104
98
  */
105
99
  numbers_spaces?: boolean;
106
- /**
107
- * Terms or phrases to search for in the submitted audio. Deepgram searches
108
- * for acoustic patterns in audio rather than text patterns in transcripts
109
- * because we have noticed that acoustic pattern matching is more performant.
110
- * @see https://developers.deepgram.com/documentation/features/search/
111
- */
112
- search?: Array<string>;
113
100
  /**
114
101
  * Callback URL to provide if you would like your submitted audio to be
115
102
  * processed asynchronously. When passed, Deepgram will immediately respond
@@ -120,6 +107,19 @@ export declare type LiveTranscriptionOptions = {
120
107
  * @see https://developers.deepgram.com/documentation/features/callback/
121
108
  */
122
109
  callback?: string;
110
+ /**
111
+ * Terms or phrases to search for in the submitted audio and replace
112
+ * @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.
113
+ * @see https://developers.deepgram.com/documentation/features/replace/
114
+ */
115
+ replace?: string[] | string;
116
+ /**
117
+ * Terms or phrases to search for in the submitted audio. Deepgram searches
118
+ * for acoustic patterns in audio rather than text patterns in transcripts
119
+ * because we have noticed that acoustic pattern matching is more performant.
120
+ * @see https://developers.deepgram.com/documentation/features/search/
121
+ */
122
+ search?: string[] | string;
123
123
  /**
124
124
  * Keywords to which the model should pay particular attention to boosting
125
125
  * or suppressing to help it understand context. Just like a human listener,
@@ -127,7 +127,7 @@ export declare type LiveTranscriptionOptions = {
127
127
  * hard-to-decipher speech when it knows the context of the conversation.
128
128
  * @see https://developers.deepgram.com/documentation/features/keywords/
129
129
  */
130
- keywords?: Array<string>;
130
+ keywords?: string[] | string;
131
131
  /**
132
132
  * Support for out-of-vocabulary (OOV) keyword boosting when processing streaming audio is
133
133
  * currently in beta; to fall back to previous keyword behavior append the query parameter
@@ -1,5 +1,5 @@
1
1
  import { Channel } from "./channel";
2
- export declare type LiveTranscriptionResponse = {
2
+ export type LiveTranscriptionResponse = {
3
3
  channel_index: Array<number>;
4
4
  duration: number;
5
5
  start: number;
@@ -1,4 +1,4 @@
1
- export declare type Member = {
1
+ export type Member = {
2
2
  member_id: string;
3
3
  first_name?: string;
4
4
  last_name?: string;
@@ -1,4 +1,6 @@
1
1
  import { Member } from "./member";
2
- export declare type MemberList = {
2
+ export type MemberList = {
3
3
  members?: Array<Member>;
4
+ err_code?: string;
5
+ err_msg?: string;
4
6
  };
@@ -1,3 +1,5 @@
1
- export declare type Message = {
1
+ export type Message = {
2
2
  message?: string;
3
+ err_code?: string;
4
+ err_msg?: string;
3
5
  };
@@ -1,8 +1,18 @@
1
- export declare type Metadata = {
1
+ import { Warning } from "./warning";
2
+ export type Metadata = {
2
3
  request_id: string;
3
4
  transaction_key: string;
4
5
  sha256: string;
5
6
  created: string;
6
7
  duration: number;
7
8
  channels: number;
9
+ model_info: {
10
+ [key: string]: {
11
+ name: string;
12
+ version: string;
13
+ arch: string;
14
+ };
15
+ };
16
+ warnings?: Array<Warning>;
17
+ models: Array<string>;
8
18
  };
@@ -1,5 +1,5 @@
1
1
  import { Sentence } from "./sentence";
2
- export declare type Paragraph = {
2
+ export type Paragraph = {
3
3
  /**
4
4
  * Sentences within the paragraph.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import { Paragraph } from "./paragraph";
2
- export declare type ParagraphGroup = {
2
+ export type ParagraphGroup = {
3
3
  /**
4
4
  * Full transcript
5
5
  */
@@ -2,7 +2,7 @@ import { Models } from "../enums";
2
2
  /**
3
3
  * Options for transcription
4
4
  */
5
- export declare type PrerecordedTranscriptionOptions = {
5
+ export type PrerecordedTranscriptionOptions = {
6
6
  /**
7
7
  * AI model used to process submitted audio.
8
8
  * @default general
@@ -24,12 +24,6 @@ export declare type PrerecordedTranscriptionOptions = {
24
24
  * @see https://developers.deepgram.com/documentation/features/tier/
25
25
  */
26
26
  tier?: string;
27
- /**
28
- * Terms or phrases to search for in the submitted audio and replace
29
- * @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.
30
- * @see https://developers.deepgram.com/documentation/features/replace/
31
- */
32
- replace?: string;
33
27
  /**
34
28
  * BCP-47 language tag that hints at the primary spoken language.
35
29
  * @default en-US
@@ -103,13 +97,6 @@ export declare type PrerecordedTranscriptionOptions = {
103
97
  * adds spaces between numbers in the transcript
104
98
  */
105
99
  numbers_spaces?: boolean;
106
- /**
107
- * Terms or phrases to search for in the submitted audio. Deepgram searches
108
- * for acoustic patterns in audio rather than text patterns in transcripts
109
- * because we have noticed that acoustic pattern matching is more performant.
110
- * @see https://developers.deepgram.com/documentation/features/search/
111
- */
112
- search?: Array<string>;
113
100
  /**
114
101
  * Callback URL to provide if you would like your submitted audio to be
115
102
  * processed asynchronously. When passed, Deepgram will immediately respond
@@ -120,6 +107,19 @@ export declare type PrerecordedTranscriptionOptions = {
120
107
  * @see https://developers.deepgram.com/documentation/features/callback/
121
108
  */
122
109
  callback?: string;
110
+ /**
111
+ * Terms or phrases to search for in the submitted audio and replace
112
+ * @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.
113
+ * @see https://developers.deepgram.com/documentation/features/replace/
114
+ */
115
+ replace?: string[] | string;
116
+ /**
117
+ * Terms or phrases to search for in the submitted audio. Deepgram searches
118
+ * for acoustic patterns in audio rather than text patterns in transcripts
119
+ * because we have noticed that acoustic pattern matching is more performant.
120
+ * @see https://developers.deepgram.com/documentation/features/search/
121
+ */
122
+ search?: string[] | string;
123
123
  /**
124
124
  * Keywords to which the model should pay particular attention to boosting
125
125
  * or suppressing to help it understand context. Just like a human listener,
@@ -127,7 +127,7 @@ export declare type PrerecordedTranscriptionOptions = {
127
127
  * hard-to-decipher speech when it knows the context of the conversation.
128
128
  * @see https://developers.deepgram.com/documentation/features/keywords/
129
129
  */
130
- keywords?: Array<string>;
130
+ keywords?: string[] | string;
131
131
  /**
132
132
  * Support for out-of-vocabulary (OOV) keyword boosting when processing streaming audio is
133
133
  * currently in beta; to fall back to previous keyword behavior append the query parameter
@@ -178,7 +178,7 @@ export declare type PrerecordedTranscriptionOptions = {
178
178
  /**
179
179
  * Indicates whether Deepgram should provide summarizations of sections of the provided audio.
180
180
  */
181
- summarize?: boolean;
181
+ summarize?: boolean | string;
182
182
  /**
183
183
  * Corresponds to the language code Deepgram will translate the results into
184
184
  * For example, 'es', 'fr', 'ja'
@@ -2,24 +2,28 @@ import { Metadata } from "./metadata";
2
2
  import { Channel } from "./channel";
3
3
  import { Utterance } from "./utterance";
4
4
  export declare class PrerecordedTranscriptionResponse {
5
+ err_code?: string;
6
+ err_msg?: string;
5
7
  request_id?: string;
6
8
  metadata?: Metadata;
7
9
  results?: {
8
10
  channels: Array<Channel>;
9
11
  utterances?: Array<Utterance>;
12
+ summary?: {
13
+ result: "success" | "failure";
14
+ short: string;
15
+ };
10
16
  };
11
17
  /**
12
- * Converts the transcription to the WebVTT format
13
- * @remarks In order to translate the transcription to WebVTT, the utterances
14
- * feature must be used.
15
- * @returns A string with the transcription in the WebVTT format
18
+ * Returns a VTT formatted string based on the transcription response.
19
+ * @param {number} lineLength The maximum line length. Default: 8
20
+ * @returns {string}
16
21
  */
17
- toWebVTT(): string;
22
+ toWebVTT(lineLength?: number): string;
18
23
  /**
19
- * Converts the transcription to the SRT format
20
- * @remarks In order to translate the transcription to SRT, the utterances
21
- * feature must be used.
22
- * @returns A string with the transcription in the SRT format
24
+ * Returns a SRT formatted string based on the transcription response.
25
+ * @param {number} lineLength The maximum line length. Default: 8
26
+ * @returns {string}
23
27
  */
24
- toSRT(): string;
28
+ toSRT(lineLength?: number): string;
25
29
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Deepgram project
3
3
  */
4
- export declare type Project = {
4
+ export type Project = {
5
5
  /**
6
6
  * Unique identifier of the project
7
7
  */
@@ -14,4 +14,6 @@ export declare type Project = {
14
14
  * Name of the company associated with the project. Optional.
15
15
  */
16
16
  company?: string;
17
+ err_code?: string;
18
+ err_msg?: string;
17
19
  };
@@ -1,4 +1,4 @@
1
- export declare type ProjectPatchRequest = {
1
+ export type ProjectPatchRequest = {
2
2
  name?: string;
3
3
  company?: string;
4
4
  };
@@ -1,6 +1,8 @@
1
- export declare type ProjectPatchResponse = {
1
+ export type ProjectPatchResponse = {
2
2
  /**
3
3
  * Success message.
4
4
  */
5
5
  message: string;
6
+ err_code?: string;
7
+ err_msg?: string;
6
8
  };
@@ -1,4 +1,6 @@
1
1
  import { Project } from "./project";
2
- export declare type ProjectResponse = {
2
+ export type ProjectResponse = {
3
3
  projects: Array<Project>;
4
+ err_code?: string;
5
+ err_msg?: string;
4
6
  };
@@ -1,5 +1,6 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  import { ReadStream } from "fs";
3
- export declare type RequestFunction = NodeRequest | BrowserRequest;
4
- export declare type NodeRequest = (method: string, apiKey: string, apiUrl: string, requireSSL: boolean, path: string, payload?: string | Buffer | ReadStream, options?: Object) => Promise<any>;
5
- export declare type BrowserRequest = (method: string, apiKey: string, apiUrl: string, requireSSL: boolean, path: string, payload?: string) => Promise<any>;
4
+ export type RequestFunction = NodeRequest | BrowserRequest;
5
+ export type NodeRequest = (method: string, apiKey: string, apiUrl: string, requireSSL: boolean, path: string, payload?: string | Buffer | ReadStream, options?: Object) => Promise<any>;
6
+ export type BrowserRequest = (method: string, apiKey: string, apiUrl: string, requireSSL: boolean, path: string, payload?: string) => Promise<any>;
@@ -1,3 +1,5 @@
1
- export declare type ScopeList = {
1
+ export type ScopeList = {
2
2
  scopes: Array<string>;
3
+ err_code?: string;
4
+ err_msg?: string;
3
5
  };
@@ -2,7 +2,7 @@ import { Hit } from "./hit";
2
2
  /**
3
3
  * Search result for a transcription
4
4
  */
5
- export declare type Search = {
5
+ export type Search = {
6
6
  /**
7
7
  * Term for which Deepgram is searching.
8
8
  */
@@ -1,4 +1,4 @@
1
- export declare type Sentence = {
1
+ export type Sentence = {
2
2
  /**
3
3
  * Text transcript of the sentence.
4
4
  */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Summary of a section of audio provided.
3
3
  */
4
- export declare type Summary = {
4
+ export type Summary = {
5
5
  /**
6
6
  * Summary of a section of the transcript
7
7
  */
@@ -1,3 +1,3 @@
1
- export declare type ToggleConfigOptions = {
1
+ export type ToggleConfigOptions = {
2
2
  numerals: boolean;
3
3
  };
@@ -1,4 +1,4 @@
1
- export declare type Topic = {
1
+ export type Topic = {
2
2
  /**
3
3
  * Topic detected.
4
4
  */
@@ -1,5 +1,5 @@
1
1
  import { Topic } from "./topic";
2
- export declare type TopicGroup = {
2
+ export type TopicGroup = {
3
3
  /**
4
4
  * Array of Topics identified.
5
5
  */
@@ -1,14 +1,15 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  import { Readable } from "stream";
3
- export declare type TranscriptionSource = UrlSource | BufferSource | ReadStreamSource;
4
- export declare type ReadStreamSource = {
4
+ export type TranscriptionSource = UrlSource | BufferSource | ReadStreamSource;
5
+ export type ReadStreamSource = {
5
6
  stream: Readable;
6
7
  mimetype: string;
7
8
  };
8
- export declare type UrlSource = {
9
+ export type UrlSource = {
9
10
  url: string;
10
11
  };
11
- export declare type BufferSource = {
12
+ export type BufferSource = {
12
13
  buffer: Buffer;
13
14
  mimetype: string;
14
15
  };
@@ -1,4 +1,4 @@
1
- export declare type Translation = {
1
+ export type Translation = {
2
2
  /**
3
3
  * Language code of the translation.
4
4
  */
@@ -1,4 +1,4 @@
1
- export declare type UsageCallback = {
1
+ export type UsageCallback = {
2
2
  code: number;
3
3
  completed: string;
4
4
  };