From 25111e952c4f935cd08e656e3ca8f3f4e5e1cdb4 Mon Sep 17 00:00:00 2001 From: Luke Oliff Date: Tue, 6 Feb 2024 16:07:58 +0000 Subject: [PATCH] fix: incorrect typing on extra metadata in schema (#247) --- src/lib/types/AnalyzeSchema.ts | 13 ++++++++++++- src/lib/types/TranscriptionSchema.ts | 6 +++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/lib/types/AnalyzeSchema.ts b/src/lib/types/AnalyzeSchema.ts index 093a41a3..a15f9604 100644 --- a/src/lib/types/AnalyzeSchema.ts +++ b/src/lib/types/AnalyzeSchema.ts @@ -2,9 +2,15 @@ * Options for read analysis */ interface AnalyzeSchema extends Record { + /** + * @see https://developers.deepgram.com/docs/callback + */ callback?: string; - callback_method?: string; + /** + * @see https://developers.deepgram.com/docs/callback#results + */ + callback_method?: "put" | "post"; custom_intent?: string | string[]; @@ -23,6 +29,11 @@ interface AnalyzeSchema extends Record { sentiment?: boolean; topics?: boolean; + + /** + * @see https://developers.deepgram.com/docs/extra-metadata + */ + extra?: string[] | string; } export type { AnalyzeSchema }; diff --git a/src/lib/types/TranscriptionSchema.ts b/src/lib/types/TranscriptionSchema.ts index dfef4167..1ff2aaca 100644 --- a/src/lib/types/TranscriptionSchema.ts +++ b/src/lib/types/TranscriptionSchema.ts @@ -87,7 +87,7 @@ interface TranscriptionSchema extends Record { /** * @see https://developers.deepgram.com/docs/callback#results */ - callback_method?: string; + callback_method?: "put" | "post"; /** * @see https://developers.deepgram.com/docs/keywords @@ -135,9 +135,9 @@ interface TranscriptionSchema extends Record { custom_topic_mode?: "strict" | "extended"; /** - * @see https://developers.deepgram.com/docs/extra + * @see https://developers.deepgram.com/docs/extra-metadata */ - extra?: boolean; + extra?: string[] | string; [key: string]: unknown; }