@tiledesk/tiledesk-server 2.4.89 → 2.4.91
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 +6 -0
- package/package.json +2 -2
- package/routes/faq_kb.js +5 -0
- package/test/faqkbRoute.js +33 -21
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
🚀 IN PRODUCTION 🚀
|
|
6
6
|
(https://www.npmjs.com/package/@tiledesk/tiledesk-server/v/2.3.77)
|
|
7
7
|
|
|
8
|
+
# 2.4.91
|
|
9
|
+
- Bug fix: globals will no longer exported in chatbot export
|
|
10
|
+
|
|
11
|
+
# 2.4.90
|
|
12
|
+
- Updated tybot-connector to 0.2.45
|
|
13
|
+
|
|
8
14
|
# 2.4.89
|
|
9
15
|
- Updated whatsapp-connector to 0.1.60
|
|
10
16
|
|
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.
|
|
4
|
+
"version": "2.4.91",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "node ./bin/www",
|
|
7
7
|
"pretest": "mongodb-runner start",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@tiledesk/tiledesk-messenger-connector": "^0.1.13",
|
|
46
46
|
"@tiledesk/tiledesk-rasa-connector": "^1.0.10",
|
|
47
47
|
"@tiledesk/tiledesk-telegram-connector": "^0.1.10",
|
|
48
|
-
"@tiledesk/tiledesk-tybot-connector": "^0.2.
|
|
48
|
+
"@tiledesk/tiledesk-tybot-connector": "^0.2.45",
|
|
49
49
|
"@tiledesk/tiledesk-whatsapp-connector": "^0.1.60",
|
|
50
50
|
"@tiledesk/tiledesk-whatsapp-jobworker": "^0.0.7",
|
|
51
51
|
"@tiledesk/tiledesk-chatbot-templates": "^0.1.0",
|
package/routes/faq_kb.js
CHANGED
|
@@ -988,6 +988,10 @@ router.get('/exportjson/:id_faq_kb', (req, res) => {
|
|
|
988
988
|
// delete from exclude map intent_id
|
|
989
989
|
const intents = faqs.map(({ _id, id_project, topic, status, id_faq_kb, createdBy, createdAt, updatedAt, __v, ...keepAttrs }) => keepAttrs)
|
|
990
990
|
|
|
991
|
+
if (faq_kb.attributes) {
|
|
992
|
+
delete faq_kb.attributes.globals;
|
|
993
|
+
}
|
|
994
|
+
|
|
991
995
|
let json = {
|
|
992
996
|
webhook_enabled: faq_kb.webhook_enabled,
|
|
993
997
|
webhook_url: faq_kb.webhook_url,
|
|
@@ -1013,6 +1017,7 @@ router.get('/exportjson/:id_faq_kb', (req, res) => {
|
|
|
1013
1017
|
// return res.status(200).send(json);
|
|
1014
1018
|
// }
|
|
1015
1019
|
let json_string = JSON.stringify(json);
|
|
1020
|
+
console.log("json_string: ", json_string)
|
|
1016
1021
|
res.set({ "Content-Disposition": "attachment; filename=\"bot.json\"" });
|
|
1017
1022
|
return res.send(json_string);
|
|
1018
1023
|
}
|
package/test/faqkbRoute.js
CHANGED
|
@@ -766,7 +766,7 @@ describe('FaqKBRoute', () => {
|
|
|
766
766
|
})
|
|
767
767
|
|
|
768
768
|
|
|
769
|
-
it('
|
|
769
|
+
it('exportjson', (done) => {
|
|
770
770
|
|
|
771
771
|
|
|
772
772
|
// this.timeout();
|
|
@@ -795,28 +795,40 @@ describe('FaqKBRoute', () => {
|
|
|
795
795
|
}
|
|
796
796
|
|
|
797
797
|
chai.request(server)
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
798
|
+
.get('/' + savedProject._id + '/faq?id_faq_kb=' + id_faq_kb)
|
|
799
|
+
.auth(email, pwd)
|
|
800
|
+
.end((err, res) => {
|
|
801
|
+
if (log) {
|
|
802
|
+
console.log("faq_list: ", res.body);
|
|
803
|
+
}
|
|
804
|
+
res.should.have.status(200);
|
|
805
|
+
res.body.should.be.an('array').that.is.not.empty;
|
|
806
|
+
|
|
807
|
+
chai.request(server)
|
|
808
|
+
.get('/' + savedProject._id + '/faq_kb/exportjson/' + id_faq_kb)
|
|
809
|
+
.auth(email, pwd)
|
|
810
|
+
.end((err, res) => {
|
|
811
|
+
if (log) {
|
|
812
|
+
console.log("export json res: ", res.body);
|
|
813
|
+
}
|
|
812
814
|
console.log("export json res: ", res.body);
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
815
|
+
res.should.have.status(200);
|
|
816
|
+
//res.body.should.be.a('string');
|
|
817
|
+
|
|
818
|
+
done();
|
|
819
|
+
})
|
|
820
|
+
})
|
|
821
|
+
|
|
822
|
+
// chai.request(server)
|
|
823
|
+
// .patch('/' + savedProject._id + '/faq_kb/' + id_faq_kb + '/attributes')
|
|
824
|
+
// .auth(email, pwd)
|
|
825
|
+
// .send({ variables: { var1: "var1", var2: "var2" }, globals: [{ key: 'test', value: 'test]'}] })
|
|
826
|
+
// .end((err, res) => {
|
|
827
|
+
// console.log("res.body: ", res.body)
|
|
828
|
+
|
|
829
|
+
|
|
830
|
+
// })
|
|
816
831
|
|
|
817
|
-
done();
|
|
818
|
-
})
|
|
819
|
-
})
|
|
820
832
|
});
|
|
821
833
|
});
|
|
822
834
|
});
|