mirror of
https://github.com/jambonz/jambonz-node.git
synced 2026-10-29 14:44:26 +00:00
initial support for messages and applications
This commit is contained in:
1 parent
0696fe0885
commit
d383629ba4
9 files changed
+353
-190
No files matched your search
+22
-2
@@ -106,9 +106,29 @@ const validateCallCreate = (opts) => {
|
||||
if (hookStatusUrl) assert.ok(/^https?:/.test(hookStatusUrl), 'call_status_hook must be an absolute url');
|
||||
};
|
||||
|
||||
const validateCallList = (opts) => {
|
||||
|
||||
};
|
||||
|
||||
const validateMessageCreate = (opts) => {
|
||||
const {from, to, text} = opts;
|
||||
assert.ok(from && typeof from === 'string', 'messages.create: from property is required');
|
||||
assert.ok(to && typeof to === 'object', 'message.create: to property is required');
|
||||
assert.ok(text && typeof text === 'object', 'message.create: text property is required');
|
||||
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
validate,
|
||||
specs,
|
||||
validateCallUpdate,
|
||||
validateCallCreate
|
||||
validators: {
|
||||
Calls: {
|
||||
create: validateCallCreate,
|
||||
update: validateCallUpdate,
|
||||
list: validateCallList
|
||||
},
|
||||
Messages: {
|
||||
validateMessageCreate
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user