@cs-chatbots/router-masterbot-tools
Advanced tools
Comparing version 0.1.3 to 0.1.4
{ | ||
"name": "@cs-chatbots/router-masterbot-tools", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -28,2 +28,3 @@ # Router Masterbot Tools | ||
3. Overrides `Responder.trackAsSkill()` to store the skill not only in the | ||
conversation state but also in the shared context. | ||
conversation state but also in the shared context. Additionally, it saves appId | ||
in shared context every time a skill is stored. |
@@ -57,5 +57,9 @@ 'use strict'; | ||
_overrideTrackAsSkill (req, res) { | ||
const { appId } = res.data; | ||
res._trackAsSkillOrig = res._trackAsSkillOrig || res.trackAsSkill; | ||
res.trackAsSkill = (skill) => { | ||
res.setSharedContext({ trackAsSkill: skill }); | ||
res.setSharedContext({ | ||
trackAsSkill: skill, | ||
appId | ||
}); | ||
return res._trackAsSkillOrig(req, req); | ||
@@ -62,0 +66,0 @@ }; |
@@ -82,3 +82,3 @@ 'use strict'; | ||
expect(data.setSharedContext).toStrictEqual( | ||
{ trackAsSkill: 's' } | ||
{ trackAsSkill: 's', appId: 'bot' } | ||
); | ||
@@ -89,3 +89,5 @@ _send.call(res, data); | ||
}); | ||
await this._getTester(bot).postBack('/track'); | ||
const t = this._getTester(bot); | ||
t.testData = { appId: 'bot' }; | ||
await t.postBack('/track'); | ||
}); | ||
@@ -92,0 +94,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
2752
30
6
1304705