Compare commits

...

13 Commits

Author SHA1 Message Date
Dave Horton
146f691890 bump version 2023-04-11 20:18:12 -04:00
Dave Horton
283512e765 Merge pull request #6 from jambonz/feat/dial_caller_name
feat: update callerName to dial
2023-04-11 20:17:27 -04:00
Quan HL
d7219b990b feat: update callerName to rest 2023-04-12 06:38:16 +07:00
Quan HL
68b3c7de01 feat: update callerName to dial 2023-04-12 06:30:29 +07:00
Dave Horton
dff94d3ac5 add anchorMedia option to dial verb 2023-04-07 14:05:37 -04:00
Dave Horton
70f7c5ab96 another fix for wakeupWord 2023-03-03 09:16:51 -05:00
Dave Horton
403766cd4d fix wakeupWord syntax 2023-03-03 09:08:50 -05:00
Dave Horton
10c7f60bad fix json error 2023-03-02 14:52:10 -05:00
Dave Horton
32f63759db add options for custom speech 2023-03-02 14:45:12 -05:00
Dave Horton
825130348b remove enum on speech vendor since we want to allow custom 2023-03-02 13:21:00 -05:00
Dave Horton
f99b94a405 add soniox storage options 2023-02-24 14:35:18 -05:00
Dave Horton
6c40dda566 add options for soniox 2023-02-23 14:19:34 -05:00
Dave Horton
899f55a272 remove logging statements 2023-02-23 10:54:46 -05:00
5 changed files with 55 additions and 23 deletions

View File

@@ -1,4 +1,5 @@
const assert = require('assert');
const debug = require('debug')('jambonz:app-json-validation');
const _specData = require('./specs');
const specs = new Map();
for (const key in _specData) { specs.set(key, _specData[key]); }
@@ -30,7 +31,7 @@ function normalizeJambones(logger, obj) {
throw new Error('malformed jambonz payload: missing verb property');
}
}
logger.debug({ document }, `normalizeJambones: returning document with ${document.length} tasks`);
debug({ document }, `normalizeJambones: returning document with ${document.length} tasks`);
return document;
}
@@ -44,7 +45,7 @@ function validate(logger, obj) {
}
function validateVerb(name, data, logger) {
logger.debug(`validating ${name} with data ${JSON.stringify(data)}`);
debug(`validating ${name} with data ${JSON.stringify(data)}`);
// validate the instruction is supported
if (!specs.has(name)) throw new Error(`invalid instruction: ${name}`);
@@ -55,7 +56,7 @@ function validateVerb(name, data, logger) {
if (dKey in specData.properties) {
const dVal = data[dKey];
const dSpec = specData.properties[dKey];
logger.debug(`Task:validate validating property ${dKey} with value ${JSON.stringify(dVal)}`);
debug(`Task:validate validating property ${dKey} with value ${JSON.stringify(dVal)}`);
if (typeof dSpec === 'string' && dSpec === 'array') {
if (!Array.isArray(dVal)) throw new Error(`${name}: property ${dKey} is not an array`);

13
package-lock.json generated
View File

@@ -1,14 +1,15 @@
{
"name": "@jambonz/verb-specifications",
"version": "0.0.3",
"version": "0.0.14",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@jambonz/verb-specifications",
"version": "0.0.3",
"version": "0.0.14",
"license": "MIT",
"dependencies": {
"debug": "^4.3.4",
"pino": "^8.8.0"
},
"devDependencies": {
@@ -435,7 +436,6 @@
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
"dev": true,
"dependencies": {
"ms": "2.1.2"
},
@@ -1671,8 +1671,7 @@
"node_modules/ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
"dev": true
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"node_modules/natural-compare": {
"version": "1.4.0",
@@ -2771,7 +2770,6 @@
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
"dev": true,
"requires": {
"ms": "2.1.2"
}
@@ -3671,8 +3669,7 @@
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
"dev": true
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"natural-compare": {
"version": "1.4.0",

View File

@@ -1,12 +1,11 @@
{
"name": "@jambonz/verb-specifications",
"version": "0.0.3",
"version": "0.0.14",
"description": "Jambonz Verb Specification Utilities",
"main": "index.js",
"scripts": {
"test": "node test/",
"jslint": "eslint index.js"
},
"repository": {
"type": "git",
@@ -24,6 +23,7 @@
"tape": "^5.6.1"
},
"dependencies": {
"debug": "^4.3.4",
"pino": "^8.8.0"
}
}

View File

@@ -196,12 +196,14 @@
"actionHook": "object|string",
"answerOnBridge": "boolean",
"callerId": "string",
"callerName": "string",
"confirmHook": "object|string",
"referHook": "object|string",
"dialMusic": "string",
"dtmfCapture": "object",
"dtmfHook": "object|string",
"headers": "object",
"anchorMedia": "boolean",
"listen": "#listen",
"target": ["#target"],
"timeLimit": "number",
@@ -382,6 +384,7 @@
"call_hook": "object|string",
"call_status_hook": "object|string",
"from": "string",
"callerName": "string",
"fromHost": "string",
"speech_synthesis_vendor": "string",
"speech_synthesis_voice": "string",
@@ -465,10 +468,7 @@
},
"synthesizer": {
"properties": {
"vendor": {
"type": "string",
"enum": ["google", "aws", "polly", "microsoft", "nuance", "ibm", "nvidia", "default"]
},
"vendor": "string",
"language": "string",
"voice": "string",
"engine": {
@@ -486,10 +486,7 @@
},
"recognizer": {
"properties": {
"vendor": {
"type": "string",
"enum": ["google", "aws", "microsoft", "nuance", "deepgram", "ibm", "nvidia", "default"]
},
"vendor": "string",
"language": "string",
"vad": "#vad",
"hints": "array",
@@ -556,12 +553,23 @@
"nuanceOptions": "#nuanceOptions",
"deepgramOptions": "#deepgramOptions",
"ibmOptions": "#ibmOptions",
"nvidiaOptions": "#nvidiaOptions"
"nvidiaOptions": "#nvidiaOptions",
"sonioxOptions": "#sonioxOptions",
"customOptions": "#customOptions"
},
"required": [
"vendor"
]
},
"customOptions": {
"properties": {
"authToken": "string",
"uri": "string",
"options": "object"
},
"required": [
]
},
"nvidiaOptions": {
"properties": {
"rivaUri": "string",
@@ -642,6 +650,31 @@
"tag": "string"
}
},
"sonioxOptions": {
"properties": {
"apiKey": "string",
"model": "string",
"endpointDetection": "boolean",
"profanityFilter": "boolean",
"speechContext": "string",
"clientRequestReference": "string",
"storage": "#sonioxStorage"
},
"required": [
]
},
"sonioxStorage": {
"properties": {
"id": "string",
"title": "string",
"disableStoreAudio": "boolean",
"disableStoreTranscript": "boolean",
"disableSearch": "boolean",
"metadata": "object"
},
"required": [
]
},
"nuanceOptions": {
"properties": {
"clientId": "string",
@@ -693,7 +726,7 @@
"inlineWordset": "string",
"builtin": "string",
"inlineGrammar": "string",
"wakeupWord": "[string]",
"wakeupWord": "array",
"weightName": {
"type": "string",
"enum": [

View File

@@ -46,6 +46,7 @@ test("validate correct verbs", async (t) => {
"verb": "dial",
"actionHook": "/outdial",
"callerId": "+16173331212",
"callerName": "Tom",
"answerOnBridge": true,
"dtmfCapture": ["*2", "*3"],
"dtmfHook": {