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