feat(signalwire/dynamic-data): introduce children nodes
This commit is contained in:
@@ -2,6 +2,7 @@ import listIncomingCallPhoneNumbers from './list-incoming-call-phone-numbers/ind
|
||||
import listIncomingSmsPhoneNumbers from './list-incoming-sms-phone-numbers/index.js';
|
||||
import listVoiceXmlNodeAttributes from './list-voice-xml-node-attributes/index.js';
|
||||
import listVoiceXmlNodeAttributeValues from './list-voice-xml-node-attribute-values/index.js';
|
||||
import listVoiceXmlChildrenNodes from './list-voice-xml-children-nodes/index.js';
|
||||
import listVoiceXmlNodes from './list-voice-xml-nodes/index.js';
|
||||
|
||||
export default [
|
||||
@@ -10,4 +11,5 @@ export default [
|
||||
listVoiceXmlNodeAttributes,
|
||||
listVoiceXmlNodeAttributeValues,
|
||||
listVoiceXmlNodes,
|
||||
listVoiceXmlChildrenNodes,
|
||||
];
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
export default {
|
||||
name: 'List voice XML children nodes',
|
||||
key: 'listVoiceXmlChildrenNodes',
|
||||
|
||||
async run($) {
|
||||
const parentNodeName = $.step.parameters.parentNodeName;
|
||||
|
||||
const parentChildrenNodeMap = {
|
||||
Dial: [
|
||||
{ name: 'Number', value: 'Number' },
|
||||
{ name: 'Conference', value: 'Conference' },
|
||||
{ name: 'Queue', value: 'Queue' },
|
||||
{ name: 'Sip', value: 'Sip' },
|
||||
{ name: 'Verto', value: 'Verto' },
|
||||
],
|
||||
Gather: [
|
||||
{ name: 'Say', value: 'Say' },
|
||||
{ name: 'Play', value: 'Play' },
|
||||
{ name: 'Pause', value: 'Pause' },
|
||||
],
|
||||
Refer: [{ name: 'Sip', value: 'Sip' }],
|
||||
Connect: [
|
||||
{ name: 'Room', value: 'Room' },
|
||||
{ name: 'Stream', value: 'Stream' },
|
||||
{ name: 'VirtualAgent', value: 'VirtualAgent' },
|
||||
],
|
||||
};
|
||||
|
||||
const childrenNodes = parentChildrenNodeMap[parentNodeName] || [];
|
||||
|
||||
const nodes = {
|
||||
data: childrenNodes,
|
||||
};
|
||||
|
||||
return nodes;
|
||||
},
|
||||
};
|
||||
@@ -36,7 +36,11 @@ export default {
|
||||
arguments: [
|
||||
{
|
||||
name: 'key',
|
||||
value: 'listVoiceXmlNodes',
|
||||
value: 'listVoiceXmlChildrenNodes',
|
||||
},
|
||||
{
|
||||
name: 'parameters.parentNodeName',
|
||||
value: '{parameters.nodeName}',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user