@tiledesk/tiledesk-tybot-connector 0.3.5-rc3 → 0.3.5-rc4

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/CHANGELOG.md CHANGED
@@ -5,6 +5,9 @@
5
5
  available on:
6
6
  ▶️ https://www.npmjs.com/package/@tiledesk/tiledesk-tybot-connector
7
7
 
8
+ # v0.3.5-rc4
9
+ - added: webhook action (same as intent one)
10
+
8
11
  # v0.3.5-rc3
9
12
  - bug-fixed: jsonBody parse error in web-request-v2
10
13
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-tybot-connector",
3
- "version": "0.3.5-rc3",
3
+ "version": "0.3.5-rc4",
4
4
  "description": "Tiledesk Tybot connector",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -55,6 +55,7 @@ const { DirAddTags } = require('./directives/DirAddTags');
55
55
  const { DirSendWhatsapp } = require('./directives/DirSendWhatsapp');
56
56
  const { DirReplaceBotV3 } = require('./directives/DirReplaceBotV3');
57
57
  const { DirAiTask, DirAiPrompt } = require('./directives/DirAiPrompt');
58
+ const { DirConnectBlock } = require('./directives/DirConnectBlock');
58
59
  const { DirWebResponse } = require('./directives/DirWebResponse');
59
60
 
60
61
  class DirectivesChatbotPlug {
@@ -773,6 +774,19 @@ class DirectivesChatbotPlug {
773
774
  }
774
775
  });
775
776
  }
777
+ else if (directive_name === Directives.WEBHOOK) {
778
+ // console.log(".....DirIntent")
779
+ new DirIntent(context).execute(directive, async (stop) => {
780
+ if (stop) {
781
+ if (context.log) { console.log("Stopping Actions on:", JSON.stringify(directive));}
782
+ this.theend();
783
+ }
784
+ else {
785
+ let next_dir = await this.nextDirective(this.directives);
786
+ this.process(next_dir);
787
+ }
788
+ });
789
+ }
776
790
  else if (directive_name === Directives.WEB_RESPONSE) {
777
791
  new DirWebResponse(context).execute(directive, async () => {
778
792
  let next_dir = await this.nextDirective(this.directives);
@@ -179,4 +179,4 @@ class DirConnectBlock {
179
179
  }
180
180
  }
181
181
 
182
- module.exports = { DirIntent };
182
+ module.exports = { DirConnectBlock };
@@ -58,6 +58,7 @@ class Directives {
58
58
  static MOVE_TO_UNASSIGNED = "move_to_unassigned";
59
59
  static CONNECT_BLOCK = "connect_block";
60
60
  static ADD_TAGS = 'add_tags'
61
+ static WEBHOOK = 'webhook';
61
62
  static WEB_RESPONSE = "web_response";
62
63
 
63
64
  // static WHEN_ONLINE_MOVE_TO_AGENT = "whenonlinemovetoagent"; // DEPRECATED?