feat(signalwire): add dynamic data for nodes and attributes
This commit is contained in:
@@ -9,10 +9,20 @@ export default defineAction({
|
||||
{
|
||||
label: 'Node name',
|
||||
key: 'nodeName',
|
||||
type: 'string',
|
||||
required: false,
|
||||
type: 'dropdown',
|
||||
required: true,
|
||||
description: 'The name of the node to be added.',
|
||||
variables: true,
|
||||
source: {
|
||||
type: 'query',
|
||||
name: 'getDynamicData',
|
||||
arguments: [
|
||||
{
|
||||
name: 'key',
|
||||
value: 'listVoiceXmlNodes',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Node value',
|
||||
@@ -38,9 +48,23 @@ export default defineAction({
|
||||
{
|
||||
label: 'Attribute name',
|
||||
key: 'key',
|
||||
type: 'string',
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
variables: true,
|
||||
source: {
|
||||
type: 'query',
|
||||
name: 'getDynamicData',
|
||||
arguments: [
|
||||
{
|
||||
name: 'key',
|
||||
value: 'listVoiceXmlNodeAttributes',
|
||||
},
|
||||
{
|
||||
name: 'parameters.nodeName',
|
||||
value: '{parameters.nodeName}',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Attribute value',
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
import listIncomingSmsPhoneNumbers from './list-incoming-sms-phone-numbers/index.js';
|
||||
import listIncomingCallPhoneNumbers from './list-incoming-call-phone-numbers/index.js';
|
||||
import listIncomingSmsPhoneNumbers from './list-incoming-sms-phone-numbers/index.js';
|
||||
import listVoiceXmlNodeAttributes from './list-voice-xml-node-attributess/index.js';
|
||||
import listVoiceXmlNodes from './list-voice-xml-nodes/index.js';
|
||||
|
||||
export default [listIncomingCallPhoneNumbers, listIncomingSmsPhoneNumbers];
|
||||
export default [
|
||||
listIncomingCallPhoneNumbers,
|
||||
listIncomingSmsPhoneNumbers,
|
||||
listVoiceXmlNodeAttributes,
|
||||
listVoiceXmlNodes,
|
||||
];
|
||||
|
||||
@@ -0,0 +1,212 @@
|
||||
export default {
|
||||
name: 'List voice XML node attributes',
|
||||
key: 'listVoiceXmlNodeAttributes',
|
||||
|
||||
async run($) {
|
||||
const nodeName = $.step.parameters.nodeName;
|
||||
|
||||
const conferenceAttributes = [
|
||||
{ name: 'Beep', value: 'beep' },
|
||||
{ name: 'Coach', value: 'coach' },
|
||||
{ name: 'End Conference On Exit', value: 'endConferenceOnExit' },
|
||||
{ name: 'Event Callback URL', value: 'eventCallbackUrl' },
|
||||
{ name: 'Max Participants', value: 'maxParticipants' },
|
||||
{ name: 'Muted', value: 'muted' },
|
||||
{ name: 'Record', value: 'record' },
|
||||
{
|
||||
name: 'Recording Status Callback Event',
|
||||
value: 'recordingStatusCallbackEvent',
|
||||
},
|
||||
{
|
||||
name: 'Recording Status Callback Method',
|
||||
value: 'recordingStatusCallbackMethod',
|
||||
},
|
||||
{ name: 'Recording Status Callback', value: 'recordingStatusCallback' },
|
||||
{ name: 'Start Conference On Enter', value: 'startConferenceOnEnter' },
|
||||
{ name: 'Status Callback Event', value: 'statusCallbackEvent' },
|
||||
{ name: 'Status Callback Method', value: 'statusCallbackMethod' },
|
||||
{ name: 'Status Callback', value: 'statusCallback' },
|
||||
{ name: 'Trim', value: 'trim' },
|
||||
{ name: 'Wait Method', value: 'waitMethod' },
|
||||
{ name: 'Wait URL', value: 'waitUrl' },
|
||||
];
|
||||
|
||||
const connectAttributes = [
|
||||
{ name: 'Room', value: '<Room>' },
|
||||
{ name: 'Stream', value: '<Stream>' },
|
||||
{ name: 'Virtual Agent', value: '<VirtualAgent>' },
|
||||
];
|
||||
|
||||
const dialAttributes = [
|
||||
{ name: 'Action', value: 'action' },
|
||||
{ name: 'Answer On Bridge', value: 'answerOnBridge' },
|
||||
{ name: 'Caller ID', value: 'callerId' },
|
||||
{ name: 'Caller Name', value: 'callerName' },
|
||||
{ name: 'Hangup On Star', value: 'hangupOnStar' },
|
||||
{ name: 'Method', value: 'method' },
|
||||
{ name: 'Record', value: 'record' },
|
||||
{
|
||||
name: 'Recording Status Callback Event',
|
||||
value: 'recordingStatusCallbackEvent',
|
||||
},
|
||||
{
|
||||
name: 'Recording Status Callback Method',
|
||||
value: 'recordingStatusCallbackMethod',
|
||||
},
|
||||
{ name: 'Recording Status Callback', value: 'recordingStatusCallback' },
|
||||
{
|
||||
name: 'Recording Storage URL Method',
|
||||
value: 'recordingStorageUrlMethod',
|
||||
},
|
||||
{ name: 'Recording Storage URL', value: 'recordingStorageUrl' },
|
||||
{ name: 'Recording Track', value: 'recordingTrack' },
|
||||
{ name: 'Ring Tone', value: 'ringTone' },
|
||||
{ name: 'Time Limit', value: 'timeLimit' },
|
||||
{ name: 'Timeout', value: 'timeout' },
|
||||
{ name: 'Trim', value: 'trim' },
|
||||
];
|
||||
|
||||
const echoAttributes = [{ name: 'Timeout', value: 'timeout' }];
|
||||
|
||||
const enqueueAttributes = [
|
||||
{ name: 'Action', value: 'action' },
|
||||
{ name: 'Method', value: 'method' },
|
||||
{ name: 'Wait URL', value: 'waitUrl' },
|
||||
{ name: 'Wait URL Method', value: 'waitUrlMethod' },
|
||||
];
|
||||
|
||||
const gatherAttributes = [
|
||||
{ name: 'Action On Empty Result', value: 'actionOnEmptyResult' },
|
||||
{ name: 'Action', value: 'action' },
|
||||
{ name: 'Enhanced', value: 'enhanced' },
|
||||
{ name: 'Finish On Key', value: 'finishOnKey' },
|
||||
{ name: 'Hints', value: 'hints' },
|
||||
{ name: 'Input', value: 'input' },
|
||||
{ name: 'Language', value: 'language' },
|
||||
{ name: 'Method', value: 'method' },
|
||||
{ name: 'Num Digits', value: 'numDigits' },
|
||||
{
|
||||
name: 'Partial Result Callback Method',
|
||||
value: 'partialResultCallbackMethod',
|
||||
},
|
||||
{ name: 'Partial Result Callback', value: 'partialResultCallback' },
|
||||
{ name: 'Profanity Filter', value: 'profanityFilter' },
|
||||
{ name: 'Speech Model', value: 'speechModel' },
|
||||
{ name: 'Speech Timeout', value: 'speechTimeout' },
|
||||
{ name: 'Timeout', value: 'timeout' },
|
||||
];
|
||||
|
||||
const numberAttributes = [
|
||||
{ name: 'Method', value: 'method' },
|
||||
{ name: 'Send Digits', value: 'sendDigits' },
|
||||
{ name: 'Status Callback Event', value: 'statusCallbackEvent' },
|
||||
{ name: 'Status Callback Method', value: 'statusCallbackMethod' },
|
||||
{ name: 'Status Callback', value: 'statusCallback' },
|
||||
{ name: 'URL', value: 'url' },
|
||||
];
|
||||
|
||||
const pauseAttributes = [{ name: 'Length', value: 'length' }];
|
||||
|
||||
const playAttributes = [
|
||||
{ name: 'Digits', value: 'digits' },
|
||||
{ name: 'Loop', value: 'loop' },
|
||||
];
|
||||
|
||||
const queueAttributes = [
|
||||
{ name: 'Method', value: 'method' },
|
||||
{ name: 'URL', value: 'url' },
|
||||
];
|
||||
|
||||
const recordAttributes = [
|
||||
{ name: 'Action', value: 'action' },
|
||||
{ name: 'Finish On Key', value: 'finishOnKey' },
|
||||
{ name: 'Max Length', value: 'maxLength' },
|
||||
{ name: 'Method', value: 'method' },
|
||||
{ name: 'Play Beep', value: 'playBeep' },
|
||||
{
|
||||
name: 'Recording Status Callback Event',
|
||||
value: 'recordingStatusCallbackEvent',
|
||||
},
|
||||
{
|
||||
name: 'Recording Status Callback Method',
|
||||
value: 'recordingStatusCallbackMethod',
|
||||
},
|
||||
{ name: 'Recording Status Callback', value: 'recordingStatusCallback' },
|
||||
{ name: 'Storage URL Method', value: 'storageUrlMethod' },
|
||||
{ name: 'Storage URL', value: 'storageUrl' },
|
||||
{ name: 'Timeout', value: 'timeout' },
|
||||
{ name: 'Transcribe Callback', value: 'transcribeCallback' },
|
||||
{ name: 'Transcribe', value: 'transcribe' },
|
||||
{ name: 'Trim', value: 'trim' },
|
||||
];
|
||||
|
||||
const redirectAttributes = [{ name: 'Method', value: 'method' }];
|
||||
|
||||
const referAttributes = [
|
||||
{ name: 'Action', value: 'action' },
|
||||
{ name: 'Method', value: 'method' },
|
||||
];
|
||||
|
||||
const rejectAttributes = [{ name: 'Reason', value: 'reason' }];
|
||||
|
||||
const sayAttributes = [
|
||||
{ name: 'Language', value: 'language' },
|
||||
{ name: 'Loop', value: 'loop' },
|
||||
{ name: 'Voice', value: 'voice' },
|
||||
];
|
||||
|
||||
const sipAttributes = [
|
||||
{ name: 'Codecs', value: 'codecs' },
|
||||
{ name: 'Method', value: 'method' },
|
||||
{ name: 'Password', value: 'password' },
|
||||
{ name: 'Session Timeout', value: 'sessionTimeout' },
|
||||
{ name: 'Status Callback Event', value: 'statusCallbackEvent' },
|
||||
{ name: 'Status Callback Method', value: 'statusCallbackMethod' },
|
||||
{ name: 'Status Callback', value: 'statusCallback' },
|
||||
{ name: 'URL', value: 'url' },
|
||||
{ name: 'Username', value: 'username' },
|
||||
];
|
||||
|
||||
const smsAttributes = [
|
||||
{ name: 'Action', value: 'action' },
|
||||
{ name: 'From', value: 'from' },
|
||||
{ name: 'Method', value: 'method' },
|
||||
{ name: 'Status Callback', value: 'statusCallback' },
|
||||
{ name: 'To', value: 'to' },
|
||||
];
|
||||
|
||||
const virtualAgentAttributes = [
|
||||
{ name: 'Connector Name', value: 'connectorName' },
|
||||
];
|
||||
|
||||
const streamAttributes = [
|
||||
{ name: 'URL', value: 'url' },
|
||||
{ name: 'Name', value: 'name' },
|
||||
{ name: 'Track', value: 'track' },
|
||||
{ name: 'Status Callback', value: 'statusCallback' },
|
||||
{ name: 'Status Callback Method', value: 'statusCallbackMethod' },
|
||||
];
|
||||
|
||||
if (nodeName === 'Conference') return { data: conferenceAttributes };
|
||||
if (nodeName === 'Connect') return { data: connectAttributes };
|
||||
if (nodeName === 'Dial') return { data: dialAttributes };
|
||||
if (nodeName === 'Echo') return { data: echoAttributes };
|
||||
if (nodeName === 'Enqueue') return { data: enqueueAttributes };
|
||||
if (nodeName === 'Gather') return { data: gatherAttributes };
|
||||
if (nodeName === 'Number') return { data: numberAttributes };
|
||||
if (nodeName === 'Pause') return { data: pauseAttributes };
|
||||
if (nodeName === 'Play') return { data: playAttributes };
|
||||
if (nodeName === 'Queue') return { data: queueAttributes };
|
||||
if (nodeName === 'Record') return { data: recordAttributes };
|
||||
if (nodeName === 'Redirect') return { data: redirectAttributes };
|
||||
if (nodeName === 'Refer') return { data: referAttributes };
|
||||
if (nodeName === 'Reject') return { data: rejectAttributes };
|
||||
if (nodeName === 'Say') return { data: sayAttributes };
|
||||
if (nodeName === 'Sip') return { data: sipAttributes };
|
||||
if (nodeName === 'Sms') return { data: smsAttributes };
|
||||
if (nodeName === 'Stream') return { data: streamAttributes };
|
||||
if (nodeName === 'VirtualAgent') return { data: virtualAgentAttributes };
|
||||
|
||||
return { data: [] };
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,37 @@
|
||||
export default {
|
||||
name: 'List voice XML nodes',
|
||||
key: 'listVoiceXmlNodes',
|
||||
|
||||
async run() {
|
||||
const nodes = {
|
||||
data: [
|
||||
{ name: 'Conference', value: 'Conference' },
|
||||
{ name: 'Connect', value: 'Connect' },
|
||||
{ name: 'Denoise', value: 'Denoise' },
|
||||
{ name: 'Dial', value: 'Dial' },
|
||||
{ name: 'Echo', value: 'Echo' },
|
||||
{ name: 'Enqueue', value: 'Enqueue' },
|
||||
{ name: 'Gather', value: 'Gather' },
|
||||
{ name: 'Hangup', value: 'Hangup' },
|
||||
{ name: 'Leave', value: 'Leave' },
|
||||
{ name: 'Number', value: 'Number' },
|
||||
{ name: 'Pause', value: 'Pause' },
|
||||
{ name: 'Play', value: 'Play' },
|
||||
{ name: 'Queue', value: 'Queue' },
|
||||
{ name: 'Record', value: 'Record' },
|
||||
{ name: 'Redirect', value: 'Redirect' },
|
||||
{ name: 'Refer', value: 'Refer' },
|
||||
{ name: 'Reject', value: 'Reject' },
|
||||
{ name: 'Room', value: 'Room' },
|
||||
{ name: 'Say', value: 'Say' },
|
||||
{ name: 'Sip', value: 'Sip' },
|
||||
{ name: 'Sms', value: 'Sms' },
|
||||
{ name: 'Stream', value: 'Stream' },
|
||||
{ name: 'Verto', value: 'Verto' },
|
||||
{ name: 'VirtualAgent', value: 'VirtualAgent' },
|
||||
],
|
||||
};
|
||||
|
||||
return nodes;
|
||||
},
|
||||
};
|
||||
@@ -26,10 +26,20 @@ export default {
|
||||
{
|
||||
label: 'Node name',
|
||||
key: 'nodeName',
|
||||
type: 'string',
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description: 'The name of the node to be added.',
|
||||
variables: true,
|
||||
source: {
|
||||
type: 'query',
|
||||
name: 'getDynamicData',
|
||||
arguments: [
|
||||
{
|
||||
name: 'key',
|
||||
value: 'listVoiceXmlNodes',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Node value',
|
||||
|
||||
Reference in New Issue
Block a user