diff --git a/circuit/circuit.js b/circuit/circuit.js index b97ce1b..cdbb852 100644 --- a/circuit/circuit.js +++ b/circuit/circuit.js @@ -92,7 +92,7 @@ module.exports = RED => { ['renewAccessTokenFailed', 'renewSessionTokenFailed'].forEach(elem => node.client.addEventListener(elem, evt => node.error(util.inspect(evt, { showHidden: true, depth: null })))); // event listeners for all events that need to be "broadcasted" to all nodes. ['callStatus', 'callIncoming', 'callEnded', 'conversationUpdated', 'conversationCreated', 'itemUpdated', 'itemAdded', - 'userSettingsChanged', 'userUpdated', 'userPresenceChanged', 'basicSearchResults'] + 'userSettingsChanged', 'userUpdated', 'userPresenceChanged', 'basicSearchResults', 'formSubmission'] .forEach(elem => node.client.addEventListener(elem, evt => node.broadcast(elem, evt))); // subscribe and unsubscribe handling diff --git a/circuit/events.html b/circuit/events.html index 35360b3..94fcce9 100644 --- a/circuit/events.html +++ b/circuit/events.html @@ -23,6 +23,11 @@ +
+ + + +
@@ -37,6 +42,7 @@
  • Conversation Events conversationUpdated, conversationCreated
  • Item Events itemUpdated, itemAdded
  • User Events userSettingsChanged, userUpdated
  • +
  • Form Events formSubmission
  • You can check details about events on https://circuitsandbox.net/sdk

    @@ -52,6 +58,7 @@ convEvent: {value: true}, itemEvent: {value: true}, userEvent: {value: true}, + formEvent: {value: true}, name: {value: '', required: false}, }, color: '#88C540', diff --git a/circuit/events.js b/circuit/events.js index 444d955..75e500c 100644 --- a/circuit/events.js +++ b/circuit/events.js @@ -7,6 +7,7 @@ module.exports = RED => { node.convEvent = n.convEvent; node.itemEvent = n.itemEvent; node.userEvent = n.userEvent; + node.formEvent = n.formEvent; node.server.subscribe(node.id, 'state', state => node.status(state)); if (node.callEvent) { @@ -26,6 +27,9 @@ module.exports = RED => { node.server.subscribe(node.id, 'userSettingsChanged', evt => node.send({ payload: evt.text })); node.server.subscribe(node.id, 'userUpdated', evt => node.send({ payload: evt.text })); } + if (node.formEvent) { + node.server.subscribe(node.id, 'formSubmission', evt => node.send({payload: evt.text})); + } } RED.nodes.registerType('Events', Events); }