diff --git a/src/api/types.ts b/src/api/types.ts index e920072c..9fcaea71 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -63,11 +63,9 @@ export interface FetchError { } export interface UseApiData { - (apiPath: string): [ - Type | undefined, - () => void, - FetchError | undefined - ]; + ( + apiPath: string, + ): [Type | undefined, () => void, FetchError | undefined]; } /** API related interfaces */ diff --git a/src/containers/internal/views/speech-services/form.tsx b/src/containers/internal/views/speech-services/form.tsx index e481a28d..2f229f79 100644 --- a/src/containers/internal/views/speech-services/form.tsx +++ b/src/containers/internal/views/speech-services/form.tsx @@ -91,7 +91,7 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { const [initialSttCheck, setInitialSttCheck] = useState(false); const [sttCheck, setSttCheck] = useState(false); const [vendor, setVendor] = useState>( - "" as Lowercase + "" as Lowercase, ); const [region, setRegion] = useState(""); const [apiKey, setApiKey] = useState(""); @@ -223,13 +223,13 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { speech_credential_sid: credential.data?.speech_credential_sid, }); } - }) + }), ) .then(() => { toastSuccess("Speech credential updated successfully"); credential.refetch(); navigate( - `${ROUTE_INTERNAL_SPEECH}/${credential?.data?.speech_credential_sid}/edit` + `${ROUTE_INTERNAL_SPEECH}/${credential?.data?.speech_credential_sid}/edit`, ); }) .catch((error) => { @@ -241,13 +241,13 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { if (v.google_custom_voice_sid) { return deleteGoogleCustomVoice(v.google_custom_voice_sid); } - }) + }), ) .then(() => { toastSuccess("Speech credential updated successfully"); credential.refetch(); navigate( - `${ROUTE_INTERNAL_SPEECH}/${credential?.data?.speech_credential_sid}/edit` + `${ROUTE_INTERNAL_SPEECH}/${credential?.data?.speech_credential_sid}/edit`, ); }) .catch((error) => { @@ -257,7 +257,7 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { toastSuccess("Speech credential updated successfully"); credential.refetch(); navigate( - `${ROUTE_INTERNAL_SPEECH}/${credential.data.speech_credential_sid}/edit` + `${ROUTE_INTERNAL_SPEECH}/${credential.data.speech_credential_sid}/edit`, ); } }; @@ -267,7 +267,7 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { if (isUserAccountScope(accountSid, user)) { toastError( - "You do not have permissions to make changes to these Speech Credentials" + "You do not have permissions to make changes to these Speech Credentials", ); return; } @@ -343,7 +343,7 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { putSpeechService( currentServiceProvider.service_provider_sid, credential.data.speech_credential_sid, - payload + payload, ) .then(() => { if (credential && credential.data) { @@ -353,7 +353,7 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { toastSuccess("Speech credential updated successfully"); credential.refetch(); navigate( - `${ROUTE_INTERNAL_SPEECH}/${credential.data.speech_credential_sid}/edit` + `${ROUTE_INTERNAL_SPEECH}/${credential.data.speech_credential_sid}/edit`, ); } } @@ -394,8 +394,8 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { postGoogleCustomVoice({ ...v, speech_credential_sid: json.sid, - }) - ) + }), + ), ).then(() => { toastSuccess("Speech credential created successfully"); navigate(ROUTE_INTERNAL_SPEECH); @@ -423,7 +423,7 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { getSpeechSupportedLanguagesAndVoices( currentServiceProvider?.service_provider_sid, vendor, - "" + "", ).then(({ json }) => { if (json.models) { setTtsModels(json.models); @@ -562,13 +562,13 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { setInitialCheckCustomStt(isNotBlank(credential.data.custom_stt_endpoint)); setInitialCheckOnpremAzureService( isNotBlank(credential.data.custom_tts_endpoint_url) || - isNotBlank(credential.data.custom_stt_endpoint_url) + isNotBlank(credential.data.custom_stt_endpoint_url), ); setCustomVendorName( credential.data.vendor.startsWith(VENDOR_CUSTOM) ? credential.data.vendor.substring(VENDOR_CUSTOM.length + 1) - : credential.data.vendor + : credential.data.vendor, ); setCustomVendorAuthToken(credential.data.auth_token || ""); setCustomVendorSttUrl(credential.data.custom_stt_url || ""); @@ -603,7 +603,7 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { } if (credential?.data?.deepgram_stt_use_tls) { setDeepgramSttUseTls( - credential?.data?.deepgram_stt_use_tls > 0 ? true : false + credential?.data?.deepgram_stt_use_tls > 0 ? true : false, ); } setInitialDeepgramOnpremCheck(hasValue(credential?.data?.deepgram_stt_uri)); @@ -621,7 +621,7 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { const updateCustomVoices = ( index: number, key: string, - value: typeof customVoices[number][keyof GoogleCustomVoice] + value: (typeof customVoices)[number][keyof GoogleCustomVoice], ) => { setCustomVoices((prev) => prev.map((g, i) => @@ -630,8 +630,8 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { ...g, [key]: value, } - : g - ) + : g, + ), ); }; @@ -668,7 +668,7 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { ] .concat(vendors) .filter( - (v) => !DISABLE_CUSTOM_SPEECH || v.value !== VENDOR_CUSTOM + (v) => !DISABLE_CUSTOM_SPEECH || v.value !== VENDOR_CUSTOM, )} onChange={(e) => { setVendor(e.target.value as Lowercase); @@ -879,7 +879,7 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { {JSON.stringify( getObscuredGoogleServiceKey(googleServiceKey), null, - 2 + 2, )} @@ -954,7 +954,7 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { updateCustomVoices( i, "reported_usage", - e.target.value + e.target.value, ); }} /> @@ -981,7 +981,7 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { updateCustomVoices( i, "model", - e.target.value + e.target.value, ); }} /> @@ -996,19 +996,19 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { setCustomVoicesMessage(""); if (customVoices.length === 1) { setCustomVoicesMessage( - "You must provide at least one custom voice." + "You must provide at least one custom voice.", ); return; } if (v.google_custom_voice_sid) { deleteGoogleCustomVoice( - v.google_custom_voice_sid + v.google_custom_voice_sid, ).finally(() => { credential?.refetch(); }); } setCustomVoices((prev) => - prev.filter((_, idx) => idx !== i) + prev.filter((_, idx) => idx !== i), ); }} > @@ -1282,7 +1282,7 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { setOptions( tmpOptions ? tmpOptions - : JSON.stringify(getDefaultVendorOptions(), null, 2) + : JSON.stringify(getDefaultVendorOptions(), null, 2), ); } if (!e.target.checked) { diff --git a/src/vendor/index.tsx b/src/vendor/index.tsx index 76322a3c..5bfe5819 100644 --- a/src/vendor/index.tsx +++ b/src/vendor/index.tsx @@ -108,7 +108,7 @@ export const useRegionVendors = () => { ibm: ibmRegions, }); } - } + }, ); return function cleanup() {