@tiledesk/tiledesk-server 2.4.11 → 2.4.13

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,11 +1,73 @@
1
1
 
2
2
 
3
- 💥 TILEDESK SERVER v2.3.77 💥
3
+ 💥 TILEDESK SERVER v2.4.13 💥
4
4
  🚀 TAGGED AND PUBLISHED ON NPM 🚀
5
5
  🚀 IN PRODUCTION 🚀
6
- (https://www.npmjs.com/package/@tiledesk/tiledesk-server/v/2.3.77)
6
+ (https://www.npmjs.com/package/@tiledesk/tiledesk-server/v/2.4.13)
7
7
 
8
8
 
9
+ # 2.4.13
10
+ - "@tiledesk/tiledesk-tybot-connector": "^0.1.79"
11
+
12
+ # 2.4.12
13
+ - logfix
14
+ - givanni fix
15
+
16
+ # 2.4.11
17
+ - whatsapp connector aggiornata alla 0.1.48
18
+ - aggiunti campi title, certifiedTags e short_description nel modello faq_kb
19
+ - gestiti i campi title, certifiedTags e short_description in update faq_kb
20
+
21
+ # 2.4.10
22
+ - email template fix
23
+
24
+ # 2.4.9
25
+ - added trained field to bot entity
26
+ - added training endpoint
27
+ - skip has role verification for admin@td user
28
+ - bot websocket realtime endpoint
29
+ - added properties to lead model and patch endpoint
30
+ - @tiledesk/tiledesk-whatsapp-connector 0.1.46
31
+
32
+ # 2.4.8
33
+ - added webp image
34
+ - added description to user entity
35
+
36
+ # 2.4.7
37
+
38
+ # 2.4.6
39
+ - Added forcing message to bot.calling trigger action
40
+
41
+ # 2.4.5
42
+ - Custom subject for direct email. Also supported with trigger subject configuration (from DB). See Custom OCF trigger Open Ticket email
43
+
44
+ # 2.4.3
45
+ - tiledesk-ent/tiledesk-server-payments: 1.1.12 with node 16.20
46
+ # 2.4.2
47
+ - tiledesk-whatsapp-connector to 0.1.45
48
+ - bot.calling trigger added
49
+ - Endpoint to generate a jwt token for a chatbot
50
+ - tiledesk-ent/tiledesk-server-payments: 1.1.11 with node 16
51
+
52
+ # 2.4.1
53
+ - tiledesk/tiledesk-tybot-connector": "^0.1.77
54
+ - node 16 support for package.json and dockers files
55
+
56
+ # 2.3.132
57
+ - Added channel name to message attributes for chat21 engine
58
+
59
+ # 2.3.131
60
+ - update tiledesk-whatsapp-connector to 0.1.44
61
+ - update tiledesk-messenger-connector to 0.1.9
62
+
63
+ # 2.3.130
64
+ - cache invalidation for docker image
65
+
66
+ # 2.3.129
67
+ - ocf email fix
68
+
69
+ # 2.3.128
70
+ - email subject customization on project settings
9
71
 
10
72
  # 2.3.127
11
73
  - Added Google OAuth Strategy
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-server",
3
3
  "description": "The Tiledesk server module",
4
- "version": "2.4.11",
4
+ "version": "2.4.13",
5
5
  "scripts": {
6
6
  "start": "node ./bin/www",
7
7
  "pretest": "mongodb-runner start",
@@ -44,7 +44,7 @@
44
44
  "@tiledesk/tiledesk-kaleyra-proxy": "^0.1.7",
45
45
  "@tiledesk/tiledesk-messenger-connector": "0.1.9",
46
46
  "@tiledesk/tiledesk-rasa-connector": "^1.0.10",
47
- "@tiledesk/tiledesk-tybot-connector": "^0.1.78",
47
+ "@tiledesk/tiledesk-tybot-connector": "^0.1.79",
48
48
  "@tiledesk/tiledesk-whatsapp-connector": "^0.1.48",
49
49
  "amqplib": "^0.5.5",
50
50
  "app-root-path": "^3.0.0",
@@ -337,7 +337,7 @@ function listen() {
337
337
  setImmediate(() => {
338
338
  winston.debug("reconnect faqbot.update")
339
339
  publish(exchange, "faqbot_update", Buffer.from(JSON.stringify(bot)));
340
- winston.info("reconnect: "+ Buffer.from(JSON.stringify(bot)))
340
+ winston.debug("reconnect: "+ Buffer.from(JSON.stringify(bot)))
341
341
  });
342
342
  });
343
343
 
@@ -181,7 +181,7 @@ function work(msg, cb) {
181
181
  authEvent.emit('project_user.update.queue.pubsub', JSON.parse(message_string));
182
182
  }
183
183
  if (topic === 'faqbot_update') {
184
- winston.info("reconnectfanout here topic faqbot_update:" + topic);
184
+ winston.debug("reconnectfanout here topic faqbot_update:" + topic);
185
185
  botEvent.emit('faqbot.update.queue.pubsub', JSON.parse(message_string));
186
186
  }
187
187
  cb(true);
@@ -254,7 +254,7 @@ function listen() {
254
254
  setImmediate(() => {
255
255
  winston.debug("reconnect faqbot.update")
256
256
  publish(exchange, "faqbot_update", Buffer.from(JSON.stringify(bot)));
257
- winston.info("reconnect fan: "+ Buffer.from(JSON.stringify(bot)))
257
+ winston.debug("reconnect fan: "+ Buffer.from(JSON.stringify(bot)))
258
258
  });
259
259
  });
260
260
 
package/routes/faq_kb.js CHANGED
@@ -343,7 +343,33 @@ router.put('/:faq_kbid', function (req, res) {
343
343
  });
344
344
  });
345
345
 
346
+ router.put('/:faq_kbid/language/:language', (req, res) => {
347
+
348
+ winston.debug("update language: ", req.params);
349
+
350
+ let update = {};
351
+ if (req.params.language != undefined) {
352
+ update.language = req.params.language;
353
+ }
354
+
355
+ winston.debug("update", update);
356
+ Faq_kb.findByIdAndUpdate(req.params.faq_kbid, update, { new: true }, (err, updatedFaq_kb) => {
357
+ if (err) {
358
+ return res.status(500).send({ success: false, msg: 'Error updating object.' });
359
+ }
360
+
361
+ Faq.updateMany({ id_faq_kb: req.params.faq_kbid }, update, (err, result) => {
362
+ if (err) {
363
+ botEvent.emit('faqbot.update', updatedFaq_kb);
364
+ return res.status(500).send({ success: false, msg: 'Error updating multiple object.' });
365
+ }
366
+ console.log("updateMany intents result: ", result)
367
+ return res.status(200).send(updatedFaq_kb)
368
+ })
346
369
 
370
+ })
371
+
372
+ })
347
373
 
348
374
 
349
375
 
@@ -111,6 +111,75 @@ describe('FaqKBRoute', () => {
111
111
 
112
112
 
113
113
 
114
+ });
115
+ })
116
+ })
117
+ })
118
+
119
+ // mocha test/faqkbRoute.js --grep 'language'
120
+ it('update chatbot and intents language', (done) => {
121
+
122
+ var email = "test-signup-" + Date.now() + "@email.com";
123
+ var pwd = "pwd";
124
+
125
+ userService.signup(email, pwd, "Test Firstname", "Test Lastname").then((savedUser) => {
126
+ projectService.create("test-faqkb-create", savedUser._id).then((savedProject) => {
127
+
128
+ chai.request(server)
129
+ .post('/' + savedProject._id + '/faq_kb')
130
+ .auth(email, pwd)
131
+ .send({ "name": "testbot", type: "internal", template: "example", language: "en" })
132
+ .end((err, res) => {
133
+ if (log) {
134
+ console.log("res.body", res.body);
135
+ }
136
+ res.should.have.status(200);
137
+ res.body.should.be.a('object');
138
+ expect(res.body.name).to.equal("testbot");
139
+ var id_faq_kb = res.body._id;
140
+
141
+ chai.request(server)
142
+ .get('/' + savedProject._id + '/faq?id_faq_kb=' + id_faq_kb)
143
+ .auth(email, pwd)
144
+ .end((err, res) => {
145
+ if (log) {
146
+ console.log("faq_list: ", res.body);
147
+ }
148
+ res.should.have.status(200);
149
+ res.body.should.be.an('array').that.is.not.empty;
150
+
151
+
152
+ chai.request(server)
153
+ .put('/' + savedProject._id + '/faq_kb/' + id_faq_kb + '/language/it')
154
+ .auth(email, pwd)
155
+ .end((err, res) => {
156
+ if (log) {
157
+ console.log("res.body: ", res.body);
158
+ }
159
+ res.should.have.status(200);
160
+ res.body.should.be.a('object');
161
+ expect(res.body.name).to.equal("testbot");
162
+ expect(res.body.language).to.equal("it");
163
+
164
+ chai.request(server)
165
+ .get('/' + savedProject._id + '/faq?id_faq_kb=' + id_faq_kb)
166
+ .auth(email, pwd)
167
+ .end((err, res) => {
168
+ if (log) {
169
+ console.log("faq_list: ", res.body);
170
+ }
171
+ res.should.have.status(200);
172
+ res.body.should.be.an('array').that.is.not.empty;
173
+
174
+ done();
175
+ })
176
+
177
+ })
178
+
179
+ })
180
+
181
+
182
+
114
183
  });
115
184
  })
116
185
  })
@@ -299,7 +368,7 @@ describe('FaqKBRoute', () => {
299
368
  chai.request(server)
300
369
  .post('/' + savedProject._id + '/faq_kb')
301
370
  .auth(email, pwd)
302
- .send({ "name": "testbot", type: "tilebot", language: "en", template: "blank "})
371
+ .send({ "name": "testbot", type: "tilebot", language: "en", template: "blank " })
303
372
  .end((err, res) => {
304
373
  if (log) {
305
374
  console.log("res.body: ", res.body);