@tiledesk/tiledesk-tybot-connector 0.1.22 → 0.1.23

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
@@ -1,10 +1,16 @@
1
1
  # Tiledesk tybotRoute
2
2
 
3
- **npm @tiledesk/tiledesk-tybot-connector@0.1.22**
3
+ **npm @tiledesk/tiledesk-tybot-connector@0.1.23**
4
4
 
5
5
  available on:
6
6
  ▶️ https://www.npmjs.com/package/@tiledesk/tiledesk-tybot-connector
7
7
 
8
+ ### 0.1.23
9
+ - introduced new DirClose \_tdClose
10
+ - introduced new DirWhenOpen \_tdWhenOpen \_tdWhenClosed
11
+ - introduced DirDisableInputText \_tdDisableInputText
12
+ - fixed form intent-blocking bug
13
+
8
14
  ### 0.1.22
9
15
  - introduced new DirDepartment class
10
16
 
package/ExtApi.js CHANGED
@@ -66,6 +66,43 @@ class ExtApi {
66
66
  );
67
67
  }
68
68
 
69
+ /**
70
+ * A stub to send message to the "ext/botId" endpoint, hosted by tilebot on:
71
+ * /${TILEBOT_ROUTE}/ext/${botId}
72
+ *
73
+ * @param {Object} message. The message to send
74
+ * @param {string} botId. Tiledesk botId
75
+ * @param {string} token. User token
76
+ */
77
+ sendMessageToBot(message, botId, token, callback) {
78
+ const jwt_token = this.fixToken(token);
79
+ const url = `${this.ENDPOINT}/ext/${botId}`;
80
+ if (this.log) {console.log("sendMessageToBot URL", url);}
81
+ const HTTPREQUEST = {
82
+ url: url,
83
+ headers: {
84
+ 'Content-Type' : 'application/json',
85
+ 'Authorization': jwt_token
86
+ },
87
+ json: message,
88
+ method: 'POST'
89
+ };
90
+ this.myrequest(
91
+ HTTPREQUEST,
92
+ function(err, resbody) {
93
+ if (err) {
94
+ if (callback) {
95
+ callback(err);
96
+ }
97
+ }
98
+ else {
99
+ if (callback) {
100
+ callback(null, resbody);
101
+ }
102
+ }
103
+ }, this.log
104
+ );
105
+ }
69
106
 
70
107
  myrequest(options, callback, log) {
71
108
  if (this.log) {
package/ExtUtil.js CHANGED
@@ -16,7 +16,6 @@ const { WebhookChatbotPlug } = require('@tiledesk/tiledesk-chatbot-plugs/Webhook
16
16
  class ExtUtil {
17
17
 
18
18
  static async execPipelineExt(request, static_bot_answer, directivesPlug, tdcache, log) {
19
- console.log("Buuu")
20
19
  const messagePipeline = new MessagePipeline(static_bot_answer, null);
21
20
  //const webhookurl = bot.webhook_url;
22
21
  //messagePipeline.addPlug(new WebhookChatbotPlug(message.request, webhookurl, token));