diff --git a/lib/routes/api/speech-credentials.js b/lib/routes/api/speech-credentials.js index d68cff9..6a6f3a5 100644 --- a/lib/routes/api/speech-credentials.js +++ b/lib/routes/api/speech-credentials.js @@ -158,6 +158,7 @@ const encryptCredential = (obj) => { user_id, voice_engine, engine_version, + service_version, options } = obj; @@ -292,7 +293,7 @@ const encryptCredential = (obj) => { case 'assemblyai': assert(api_key, 'invalid assemblyai speech credential: api_key is required'); - const assemblyaiData = JSON.stringify({api_key}); + const assemblyaiData = JSON.stringify({api_key, service_version}); return encrypt(assemblyaiData); case 'voxist': @@ -516,6 +517,7 @@ router.put('/:sid', async(req, res) => { deepgram_tts_uri, playht_tts_uri, engine_version, + service_version, speechmatics_stt_uri } = req.body; @@ -548,6 +550,7 @@ router.put('/:sid', async(req, res) => { deepgram_tts_uri, playht_tts_uri, engine_version, + service_version, speechmatics_stt_uri }; logger.info({o, newCred}, 'updating speech credential with this new credential'); diff --git a/lib/utils/speech-utils.js b/lib/utils/speech-utils.js index e323d6e..064de86 100644 --- a/lib/utils/speech-utils.js +++ b/lib/utils/speech-utils.js @@ -726,6 +726,7 @@ function decryptCredential(obj, credential, logger, isObscureKey = true) { } else if ('assemblyai' === obj.vendor) { const o = JSON.parse(decrypt(credential)); obj.api_key = isObscureKey ? obscureKey(o.api_key) : o.api_key; + obj.service_version = o.service_version; } else if ('voxist' === obj.vendor) { const o = JSON.parse(decrypt(credential)); obj.api_key = isObscureKey ? obscureKey(o.api_key) : o.api_key; diff --git a/package-lock.json b/package-lock.json index 1040f84..096df91 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "@jambonz/realtimedb-helpers": "^0.8.14", "@jambonz/speech-utils": "^0.2.13", "@jambonz/time-series": "^0.2.8", - "@jambonz/verb-specifications": "^0.0.104", + "@jambonz/verb-specifications": "^0.0.106", "@soniox/soniox-node": "^1.2.2", "ajv": "^8.17.1", "argon2": "^0.40.1", @@ -4270,9 +4270,9 @@ } }, "node_modules/@jambonz/verb-specifications": { - "version": "0.0.104", - "resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.104.tgz", - "integrity": "sha512-G1LjK6ISujdg0zALudtUvdaPXmvA4FU6x3s8S9MwUbWbFo2WERMUcNOgQAutDZwOMrLH9DnbPL8ZIdnTCKnlkA==", + "version": "0.0.106", + "resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.106.tgz", + "integrity": "sha512-xBCGKKW5QC7ItZyeF22esytpG2yIhkGWIvBgTaf97CilQmUdLGo3rWG3i7qnRvU9MPXFCtVCMt/aaMt1Ep6V2g==", "license": "MIT", "dependencies": { "debug": "^4.3.4", diff --git a/package.json b/package.json index d7ca285..3268728 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "@jambonz/realtimedb-helpers": "^0.8.14", "@jambonz/speech-utils": "^0.2.13", "@jambonz/time-series": "^0.2.8", - "@jambonz/verb-specifications": "^0.0.104", + "@jambonz/verb-specifications": "^0.0.106", "@soniox/soniox-node": "^1.2.2", "ajv": "^8.17.1", "argon2": "^0.40.1", diff --git a/test/speech-credentials.js b/test/speech-credentials.js index cf06da0..653f1c7 100644 --- a/test/speech-credentials.js +++ b/test/speech-credentials.js @@ -791,7 +791,8 @@ test('speech credentials tests', async(t) => { body: { vendor: 'assemblyai', use_for_stt: true, - api_key: "APIKEY" + api_key: "APIKEY", + service_version: 'v2' } }); t.ok(result.statusCode === 201, 'successfully added speech credential for assemblyai');