@tiledesk/tiledesk-server 2.3.125 → 2.3.126
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/package.json
CHANGED
@@ -392,9 +392,12 @@
|
|
392
392
|
|
393
393
|
botEvent.on("faqbot.create", function(faq_kb) {
|
394
394
|
setImmediate(() => {
|
395
|
+
let clonedbot = Object.assign({}, faq_kb);
|
396
|
+
delete clonedbot.secret;
|
397
|
+
|
395
398
|
var key = faq_kb.id_project+":faq_kbs:id:"+faq_kb._id;
|
396
399
|
winston.verbose("Creating cache for faq_kb.create with key: " + key);
|
397
|
-
client.set(key,
|
400
|
+
client.set(key, clonedbot, cacheUtil.defaultTTL, (err, reply) => {
|
398
401
|
winston.debug("Created cache for faq_kb.create",reply);
|
399
402
|
winston.verbose("Created cache for faq_kb.create",{err:err});
|
400
403
|
});
|
@@ -639,6 +642,7 @@
|
|
639
642
|
subscriptionEvent.on('subscription.create', function(trigger) {
|
640
643
|
setImmediate(() => {
|
641
644
|
|
645
|
+
//TODO i think you must clone trigger and remove .secret before caching
|
642
646
|
var key =trigger.id_project+":subscriptions:*";
|
643
647
|
winston.verbose("Deleting cache for subscription.create with key: " + key);
|
644
648
|
client.del(key, function (err, reply) {
|
package/routes/faq_kb.js
CHANGED
@@ -826,7 +826,7 @@ router.post('/importjson/:id_faq_kb', upload.single('uploadFile'), async (req, r
|
|
826
826
|
|
827
827
|
router.get('/exportjson/:id_faq_kb', (req, res) => {
|
828
828
|
|
829
|
-
winston.
|
829
|
+
winston.debug("exporting bot...")
|
830
830
|
|
831
831
|
|
832
832
|
let id_faq_kb = req.params.id_faq_kb;
|
@@ -51,7 +51,14 @@ class BotSubscriptionNotifier {
|
|
51
51
|
};
|
52
52
|
|
53
53
|
// TODO metti bot_? a user._id
|
54
|
-
|
54
|
+
|
55
|
+
// tolgo description, attributes
|
56
|
+
let botPayload = bot.toObject();
|
57
|
+
delete botPayload.secret;
|
58
|
+
delete botPayload.description;
|
59
|
+
delete botPayload.attributes;
|
60
|
+
|
61
|
+
var token = jwt.sign(botPayload, botWithSecret.secret, signOptions);
|
55
62
|
json["token"] = token;
|
56
63
|
|
57
64
|
|