diff --git a/src/httpRequest.ts b/src/httpRequest.ts index 0122193f..a599dff2 100644 --- a/src/httpRequest.ts +++ b/src/httpRequest.ts @@ -77,7 +77,11 @@ export function _request( } if (dgRes.statusCode && dgRes.statusCode >= 400) { - reject(`DG: ${dgResponse.error}: ${dgResponse.reason}`); + if (dgResponse.error) { + reject(`DG: ${dgResponse.error}: ${dgResponse.reason}`); + } else { + reject(`DG: ${dgResponse.err_msg}`); + } } if (dgResponse.error) { diff --git a/src/projects.ts b/src/projects.ts index 834e4104..d27d158d 100644 --- a/src/projects.ts +++ b/src/projects.ts @@ -60,4 +60,18 @@ export class Projects { JSON.stringify(payload) ); } + + /** + * Delete a specific project + * @param project project to delete + * */ + async delete(projectId: string): Promise { + return this._request( + "DELETE", + this._credentials, + this._apiUrl, + this._requireSSL, + `${this.apiPath}/${projectId}` + ); + } } diff --git a/src/types/createKeyOptions.ts b/src/types/createKeyOptions.ts index 6c2344ab..e77cf0d4 100644 --- a/src/types/createKeyOptions.ts +++ b/src/types/createKeyOptions.ts @@ -10,4 +10,9 @@ export type CreateKeyOptions = { * Length of time (in seconds) during which the key you would like to create will remain valid. */ timeToLive?: number; + + /** + * Tags associated with the key you would like to create + * */ + tags?: string[]; }; diff --git a/src/types/liveTranscriptionOptions.ts b/src/types/liveTranscriptionOptions.ts index 32f88317..d391f1e0 100644 --- a/src/types/liveTranscriptionOptions.ts +++ b/src/types/liveTranscriptionOptions.ts @@ -231,4 +231,11 @@ export type LiveTranscriptionOptions = { * tracking numbers, and more. * */ smart_format?: boolean; + + /** + * allows you to label your API requests for the purpose of identification during usage reporting. + * You can also apply tags to API Keys; if you do, any tags applied to the API Key running the API request + * will also be applied to the request itself. + * */ + tag?: Array; }; diff --git a/src/types/prerecordedTranscriptionOptions.ts b/src/types/prerecordedTranscriptionOptions.ts index 43f9db4a..ba3e0dee 100644 --- a/src/types/prerecordedTranscriptionOptions.ts +++ b/src/types/prerecordedTranscriptionOptions.ts @@ -189,6 +189,7 @@ export type PrerecordedTranscriptionOptions = { /** * Indicates whether Deepgram will Identify and detect entities in the transcript + * This is a beta feature and is is subject to change. Right now, pass in the string "latest" instead of a boolean value */ detect_entities?: boolean; @@ -251,11 +252,17 @@ export type PrerecordedTranscriptionOptions = { * */ measurements?: boolean; - /** * Indicates whether to use Smart Format on the transcript. When enabled, * Smart Format will add punctuation and formatting to entities like dates, times, * tracking numbers, and more. * */ smart_format?: boolean; + + /** + * allows you to label your API requests for the purpose of identification during usage reporting. + * You can also apply tags to API Keys; if you do, any tags applied to the API Key running the API request + * will also be applied to the request itself. + * */ + tag?: Array; };