mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2026-01-25 02:08:24 +00:00
change property names for custom speech
This commit is contained in:
@@ -54,6 +54,8 @@ const encryptCredential = (obj) => {
|
||||
stt_region,
|
||||
riva_server_uri,
|
||||
instance_id,
|
||||
custom_stt_url,
|
||||
custom_tts_url,
|
||||
auth_token = ''
|
||||
} = obj;
|
||||
|
||||
@@ -121,7 +123,7 @@ const encryptCredential = (obj) => {
|
||||
|
||||
default:
|
||||
if (vendor.startsWith('custom:')) {
|
||||
const customData = JSON.stringify({auth_token});
|
||||
const customData = JSON.stringify({auth_token, custom_stt_url, custom_tts_url});
|
||||
return encrypt(customData);
|
||||
}
|
||||
else assert(false, `invalid or missing vendor: ${vendor}`);
|
||||
@@ -237,7 +239,9 @@ router.get('/', async(req, res) => {
|
||||
}
|
||||
else if (obj.vendor.startsWith('custom:')) {
|
||||
const o = JSON.parse(decrypt(credential));
|
||||
return {...obj, ...o};
|
||||
obj.auth_token = obscureKey(o.auth_token);
|
||||
obj.custom_stt_url = o.custom_stt_url;
|
||||
obj.custom_tts_url = o.custom_tts_url;
|
||||
}
|
||||
return obj;
|
||||
}));
|
||||
@@ -307,6 +311,8 @@ router.get('/:sid', async(req, res) => {
|
||||
else if (obj.vendor.startsWith('custom:')) {
|
||||
const o = JSON.parse(decrypt(credential));
|
||||
obj.auth_token = obscureKey(o.auth_token);
|
||||
obj.custom_stt_url = o.custom_stt_url;
|
||||
obj.custom_tts_url = o.custom_tts_url;
|
||||
}
|
||||
res.status(200).json(obj);
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user