From 4577b9d51e4d22ce5531d4898adc5fd5c324739f Mon Sep 17 00:00:00 2001 From: Brian Barrow Date: Fri, 13 Jan 2023 12:25:28 -0700 Subject: [PATCH 1/2] added tag to transcription endpoints. Added Delete endpoint to projects --- src/projects.ts | 14 ++++++++++++++ src/types/createKeyOptions.ts | 5 +++++ src/types/liveTranscriptionOptions.ts | 7 +++++++ src/types/prerecordedTranscriptionOptions.ts | 8 +++++++- 4 files changed, 33 insertions(+), 1 deletion(-) 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..2d7b4a77 100644 --- a/src/types/prerecordedTranscriptionOptions.ts +++ b/src/types/prerecordedTranscriptionOptions.ts @@ -251,11 +251,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; }; From 3450cf1837c7860e0afe319ed55c6374de3a0b11 Mon Sep 17 00:00:00 2001 From: Brian Barrow Date: Mon, 23 Jan 2023 13:34:10 -0700 Subject: [PATCH 2/2] updated errors, added clarification on detect_entities --- src/httpRequest.ts | 6 +++++- src/types/prerecordedTranscriptionOptions.ts | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) 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/types/prerecordedTranscriptionOptions.ts b/src/types/prerecordedTranscriptionOptions.ts index 2d7b4a77..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;