Compare commits

..

6 Commits

Author SHA1 Message Date
EgleH
a8d28da221 add soniox as speech provider (#211)
Co-authored-by: EgleHelms <e.helms@cognigy.com>
2023-03-03 18:53:46 -05:00
EgleH
e3855e83f7 conditional required causing issue with focusable fields (#210)
Co-authored-by: EgleHelms <e.helms@cognigy.com>
2023-02-23 12:18:01 -05:00
Dave Horton
446b6e76e2 update dockerfile 2023-02-23 08:21:09 -05:00
EgleH
0b55cdcf85 add env VITE_APP_DISABLE_DEFAULT_TRUNK_ROUTING (#209)
Co-authored-by: EgleHelms <e.helms@cognigy.com>
2023-02-22 14:05:56 -05:00
Snyk bot
f1743a9129 fix: Dockerfile to reduce vulnerabilities (#208)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-ALPINE316-OPENSSL-3314624
- https://snyk.io/vuln/SNYK-ALPINE316-OPENSSL-3314641
- https://snyk.io/vuln/SNYK-ALPINE316-OPENSSL-3314641
- https://snyk.io/vuln/SNYK-ALPINE316-OPENSSL-3314643
- https://snyk.io/vuln/SNYK-ALPINE316-OPENSSL-3314643
2023-02-22 07:32:42 -05:00
EgleH
ec46121696 upgrade node image (#206)
Co-authored-by: EgleHelms <e.helms@cognigy.com>
2023-02-20 10:31:07 -05:00
10 changed files with 64 additions and 44 deletions

5
.env
View File

@@ -2,4 +2,7 @@ VITE_API_BASE_URL=http://127.0.0.1:3000/v1
VITE_DEV_BASE_URL=http://127.0.0.1:3000/v1
## enables choosing units and lisenced account call limits
# VITE_APP_ENABLE_ACCOUNT_LIMITS_ALL=true
# VITE_APP_ENABLE_ACCOUNT_LIMITS_ALL=true
# disables controls for default application routing to carrier for SP and account level users
#VITE_APP_DISABLE_DEFAULT_TRUNK_ROUTING=true

View File

@@ -1,4 +1,4 @@
FROM node:18.14.0-alpine3.16 as builder
FROM node:18.14.1-alpine3.16 as builder
RUN apk update && apk add --no-cache python3 make g++
COPY . /opt/app
WORKDIR /opt/app/
@@ -6,7 +6,7 @@ RUN npm install
RUN npm run build
RUN npm prune
FROM node:18.9.0-alpine as webapp
FROM node:18.14.1-alpine as webapp
RUN apk add curl
WORKDIR /opt/app
COPY . /opt/app

View File

@@ -418,11 +418,6 @@ export const AccountForm = ({ apps, limits, account }: AccountFormProps) => {
username: e.target.value,
});
}}
required={
webhook.stateVal.password && !webhook.stateVal.username
? true
: false
}
/>
<label htmlFor={`${webhook.prefix}_password`}>
Password
@@ -438,11 +433,6 @@ export const AccountForm = ({ apps, limits, account }: AccountFormProps) => {
password: e.target.value,
});
}}
required={
webhook.stateVal.username && !webhook.stateVal.password
? true
: false
}
/>
</Checkzone>
</div>

View File

@@ -20,6 +20,7 @@ import {
VENDOR_WELLSAID,
useSpeechVendors,
VENDOR_DEEPGRAM,
VENDOR_SONIOX,
} from "src/vendor";
import {
postApplication,
@@ -356,13 +357,6 @@ export const ApplicationForm = ({ application }: ApplicationFormProps) => {
username: e.target.value,
});
}}
required={
webhook.required &&
!webhook.stateVal.username &&
webhook.stateVal.password
? true
: false
}
/>
<label htmlFor={`${webhook.prefix}_password`}>Password</label>
<Passwd
@@ -376,13 +370,6 @@ export const ApplicationForm = ({ application }: ApplicationFormProps) => {
password: e.target.value,
});
}}
required={
webhook.required &&
webhook.stateVal.username &&
!webhook.stateVal.password
? true
: false
}
/>
</Checkzone>
</fieldset>
@@ -396,7 +383,9 @@ export const ApplicationForm = ({ application }: ApplicationFormProps) => {
name="synthesis_vendor"
value={synthVendor}
options={vendors.filter(
(vendor) => vendor.value != VENDOR_DEEPGRAM
(vendor) =>
vendor.value != VENDOR_DEEPGRAM &&
vendor.value != VENDOR_SONIOX
)}
onChange={(e) => {
const vendor = e.target.value as keyof SynthesisVendors;

View File

@@ -45,6 +45,7 @@ import {
isUserAccountScope,
hasLength,
isValidPort,
disableDefaultTrunkRouting,
} from "src/utils";
import type {
@@ -725,18 +726,21 @@ export const CarrierForm = ({
: false
}
/>
{accountSid && hasLength(applications) && (
<>
<ApplicationSelect
label="Default Application"
defaultOption="None"
application={[applicationSid, setApplicationSid]}
applications={applications.filter(
(application) => application.account_sid === accountSid
)}
/>
</>
)}
{user &&
disableDefaultTrunkRouting(user?.scope) &&
accountSid &&
hasLength(applications) && (
<>
<ApplicationSelect
label="Default Application"
defaultOption="None"
application={[applicationSid, setApplicationSid]}
applications={applications.filter(
(application) => application.account_sid === accountSid
)}
/>
</>
)}
</fieldset>
<fieldset>
<Checkzone

View File

@@ -27,6 +27,7 @@ import {
VENDOR_DEEPGRAM,
VENDOR_IBM,
VENDOR_NVIDIA,
VENDOR_SONIOX,
} from "src/vendor";
import { MSG_REQUIRED_FIELDS } from "src/constants";
import {
@@ -173,7 +174,8 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => {
api_key:
vendor === VENDOR_MICROSOFT ||
vendor === VENDOR_WELLSAID ||
vendor === VENDOR_DEEPGRAM
vendor === VENDOR_DEEPGRAM ||
vendor === VENDOR_SONIOX
? apiKey
: null,
client_id: vendor === VENDOR_NUANCE ? clientId : null,
@@ -327,7 +329,7 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => {
</fieldset>
{vendor && (
<fieldset>
{vendor !== VENDOR_DEEPGRAM && (
{vendor !== VENDOR_DEEPGRAM && vendor !== VENDOR_SONIOX && (
<label htmlFor="use_for_tts" className="chk">
<input
id="use_for_tts"
@@ -448,7 +450,8 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => {
)}
{(vendor === VENDOR_MICROSOFT ||
vendor === VENDOR_WELLSAID ||
vendor === VENDOR_DEEPGRAM) && (
vendor === VENDOR_DEEPGRAM ||
vendor === VENDOR_SONIOX) && (
<fieldset>
<label htmlFor={`${vendor}_apikey`}>
API key<span>*</span>

View File

@@ -225,6 +225,17 @@ export const createFilterString = (filterValue: string, label: string) => {
return filterString.join("/");
};
export const disableDefaultTrunkRouting = (userScope: UserData["scope"]) => {
if (import.meta.env.VITE_APP_DISABLE_DEFAULT_TRUNK_ROUTING) {
if (userScope === USER_ADMIN) {
return true;
} else {
return false;
}
}
return true;
};
export {
withSuspense,
useMobileMedia,

View File

@@ -17,6 +17,7 @@ export const VENDOR_NUANCE = "nuance";
export const VENDOR_DEEPGRAM = "deepgram";
export const VENDOR_IBM = "ibm";
export const VENDOR_NVIDIA = "nvidia";
export const VENDOR_SONIOX = "soniox";
export const vendors: VendorOptions[] = [
{
@@ -51,6 +52,10 @@ export const vendors: VendorOptions[] = [
name: "WellSaid",
value: VENDOR_WELLSAID,
},
{
name: "Soniox",
value: VENDOR_SONIOX,
},
];
export const useRegionVendors = () => {
@@ -104,6 +109,7 @@ export const useSpeechVendors = () => {
import("./speech-recognizer/deepgram-speech-recognizer-lang"),
import("./speech-recognizer/ibm-speech-recognizer-lang"),
import("./speech-recognizer/nvidia-speech-recognizer-lang"),
import("./speech-recognizer/soniox-speech-recognizer-lang"),
import("./speech-synthesis/aws-speech-synthesis-lang"),
import("./speech-synthesis/google-speech-synthesis-lang"),
import("./speech-synthesis/ms-speech-synthesis-lang"),
@@ -120,6 +126,7 @@ export const useSpeechVendors = () => {
{ default: deepgramRecognizer },
{ default: ibmRecognizer },
{ default: nvidiaRecognizer },
{ default: sonioxRecognizer },
{ default: awsSynthesis },
{ default: googleSynthesis },
{ default: msSynthesis },
@@ -147,6 +154,7 @@ export const useSpeechVendors = () => {
deepgram: deepgramRecognizer,
ibm: ibmRecognizer,
nvidia: nvidiaRecognizer,
soniox: sonioxRecognizer,
},
});
}

View File

@@ -0,0 +1,10 @@
import type { Language } from "../types";
export const languages: Language[] = [
{
name: "English (United States)",
code: "en-US",
},
];
export default languages;

4
src/vendor/types.ts vendored
View File

@@ -6,7 +6,8 @@ export type Vendor =
| "Nuance"
| "Deepgram"
| "IBM"
| "Nvidia";
| "Nvidia"
| "Soniox";
export interface VendorOptions {
name: Vendor;
@@ -62,6 +63,7 @@ export interface RecognizerVendors {
deepgram: Language[];
ibm: Language[];
nvidia: Language[];
soniox: Language[];
}
export interface SynthesisVendors {