@jambonz/schema 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/validator.js
CHANGED
|
@@ -87,9 +87,20 @@ function validateVerb(name, data, logger) {
|
|
|
87
87
|
const valid = validate(verbObj);
|
|
88
88
|
if (!valid) {
|
|
89
89
|
const errors = validate.errors || [];
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
const details = errors.map((e) => {
|
|
91
|
+
const path = e.instancePath || '/';
|
|
92
|
+
const prop = path.split('/').filter(Boolean).pop() || '(root)';
|
|
93
|
+
let msg = `property '${prop}': ${e.message}`;
|
|
94
|
+
if (e.params) {
|
|
95
|
+
if (e.params.type) msg += ` (expected ${e.params.type})`;
|
|
96
|
+
if (e.params.allowedValues) msg += ` (allowed: ${e.params.allowedValues.join(', ')})`;
|
|
97
|
+
if (e.params.missingProperty) msg += ` (missing: ${e.params.missingProperty})`;
|
|
98
|
+
}
|
|
99
|
+
return msg;
|
|
100
|
+
}).join('; ');
|
|
101
|
+
const errMsg = `verb '${name}' validation failed — ${details}. Schema: ${schemaId}`;
|
|
102
|
+
debug(errMsg);
|
|
103
|
+
throw new Error(errMsg);
|
|
93
104
|
}
|
|
94
105
|
}
|
|
95
106
|
|
package/package.json
CHANGED
package/verbs/config.schema.json
CHANGED
|
@@ -69,16 +69,19 @@
|
|
|
69
69
|
"additionalProperties": true
|
|
70
70
|
},
|
|
71
71
|
"listen": {
|
|
72
|
-
"
|
|
73
|
-
"description": "
|
|
72
|
+
"type": "object",
|
|
73
|
+
"description": "Session-level audio streaming configuration defaults. Properties match the listen verb but no fields are required here.",
|
|
74
|
+
"additionalProperties": true
|
|
74
75
|
},
|
|
75
76
|
"stream": {
|
|
76
|
-
"
|
|
77
|
-
"description": "
|
|
77
|
+
"type": "object",
|
|
78
|
+
"description": "Session-level audio streaming configuration defaults. Alias for 'listen'.",
|
|
79
|
+
"additionalProperties": true
|
|
78
80
|
},
|
|
79
81
|
"transcribe": {
|
|
80
|
-
"
|
|
81
|
-
"description": "
|
|
82
|
+
"type": "object",
|
|
83
|
+
"description": "Session-level transcription configuration defaults.",
|
|
84
|
+
"additionalProperties": true
|
|
82
85
|
},
|
|
83
86
|
"amd": {
|
|
84
87
|
"$ref": "../components/amd",
|
package/verbs/dial.schema.json
CHANGED
|
@@ -108,16 +108,19 @@
|
|
|
108
108
|
]
|
|
109
109
|
},
|
|
110
110
|
"listen": {
|
|
111
|
-
"
|
|
112
|
-
"description": "Nested listen
|
|
111
|
+
"type": "object",
|
|
112
|
+
"description": "Nested listen configuration for streaming audio of the bridged call.",
|
|
113
|
+
"additionalProperties": true
|
|
113
114
|
},
|
|
114
115
|
"stream": {
|
|
115
|
-
"
|
|
116
|
-
"description": "Nested stream
|
|
116
|
+
"type": "object",
|
|
117
|
+
"description": "Nested stream configuration for streaming audio of the bridged call. Alias for 'listen'.",
|
|
118
|
+
"additionalProperties": true
|
|
117
119
|
},
|
|
118
120
|
"transcribe": {
|
|
119
|
-
"
|
|
120
|
-
"description": "Nested transcribe
|
|
121
|
+
"type": "object",
|
|
122
|
+
"description": "Nested transcribe configuration for real-time transcription of the bridged call.",
|
|
123
|
+
"additionalProperties": true
|
|
121
124
|
},
|
|
122
125
|
"timeLimit": {
|
|
123
126
|
"type": "number",
|
package/verbs/gather.schema.json
CHANGED
|
@@ -117,12 +117,14 @@
|
|
|
117
117
|
"description": "Override the session-level STT configuration for this gather."
|
|
118
118
|
},
|
|
119
119
|
"say": {
|
|
120
|
-
"
|
|
121
|
-
"description": "A nested
|
|
120
|
+
"type": "object",
|
|
121
|
+
"description": "A nested say prompt played to the caller while listening for input. Accepts the same properties as the say verb (text, synthesizer, etc.) but no fields are required.",
|
|
122
|
+
"additionalProperties": true
|
|
122
123
|
},
|
|
123
124
|
"play": {
|
|
124
|
-
"
|
|
125
|
-
"description": "A nested
|
|
125
|
+
"type": "object",
|
|
126
|
+
"description": "A nested play prompt played to the caller while listening for input. Accepts the same properties as the play verb (url, etc.) but no fields are required.",
|
|
127
|
+
"additionalProperties": true
|
|
126
128
|
},
|
|
127
129
|
"fillerNoise": {
|
|
128
130
|
"$ref": "../components/fillerNoise",
|