Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob Potterveld committed Dec 30, 2020
2 parents f3bedf1 + 04d2240 commit 2edc44b
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [4.4.1]
- Fix for Designer UI from breaking change in highlight.js due to dependabot alert / change.
- Added support for setting 'profile' as an identity attribute from cognito federation.
- Fix syntax error introduced in 4.4.0 QNAPin and QNAPinNoConfirm bots that prevents updates from succeeding.
## [4.4.0]
- Preview VPC support - [readme](./VPCSupportREADME.md)
- Preview BotRouter support - [read](./BotRoutingREADME.md)
Expand Down
21 changes: 20 additions & 1 deletion lambda/cfn/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,26 @@ function dispatch(event,context,cb){
if(_.get(Lextype,1)==='Alias') Lextype[1]='BotAlias'
console.log(targets[type[1]])

if(Lextype){
if(Lextype){
/* change to fix 4.4.0 installs where QNAPin and QNAPinNoConfirm elicit response bots inadvertently included a
* bad character in clarificationPrompt and rejectionStatement which would break further updates.
*/
if (_.has(event,"OldResourceProperties.clarificationPrompt.messages[0].content")) {
let v = _.get(event, "OldResourceProperties.clarificationPrompt.messages[0].content", "");
if (v.includes("I’m")) {
console.log('found bad apostrophe and replacing');
v = v.replace("I’m", "I'm");
_.set(event, "OldResourceProperties.clarificationPrompt.messages[0].content", v);
}
}
if (_.has(event,"OldResourceProperties.rejectionStatement.messages[0].content")) {
let v =_.get(event, "OldResourceProperties.rejectionStatement.messages[0].content", "");
if (v.includes("I’m")) {
console.log('found bad apostrophe and replacing');
v = v.replace("I’m","I'm");
_.set(event, "OldResourceProperties.rejectionStatement.messages[0].content", v);
}
}
cfnLambda(new Lex(Lextype[1]))(event,context,cb)
}else if(targets[type[1]]){
return cfnLambda(new targets[type[1]])(event,context,cb)
Expand Down
3 changes: 3 additions & 0 deletions lambda/fulfillment/lib/middleware/2_preprocess.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ async function get_userInfo(userId, idattrs) {
if (_.get(idattrs,'verifiedIdentity')) {
_.set(req_userInfo, 'isVerifiedIdentity', _.get(idattrs,'verifiedIdentity'));
}
if (_.get(idattrs, 'profile')) {
_.set(req_userInfo, 'Profile', _.get(idattrs, 'profile'));
}
// append time since last seen
var now = new Date();
var lastSeen = Date.parse(req_userInfo.LastSeen || "1970/1/1 12:00:00");
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aws-ai-qna-bot",
"version": "4.4.0",
"version": "4.4.1",
"engines": {
"node": ">=8.9.4",
"npm": ">=5.0.0"
Expand Down
6 changes: 3 additions & 3 deletions templates/examples/examples/responsebots.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ exports.resources={
"messages": [
{
"contentType": "PlainText",
"content": "Im sorry I did not get all the digits, please re-enter all digits."
"content": "I'm sorry I did not get all the digits, please re-enter all digits."
}
],
"maxAttempts": 3
Expand Down Expand Up @@ -345,7 +345,7 @@ exports.resources={
rejectionStatement: {
messages: [
{
content: "Im sorry I did not get all the digits, please re-enter all digits.",
content: "I'm sorry I did not get all the digits, please re-enter all digits.",
contentType: "PlainText"
}
]
Expand Down Expand Up @@ -402,7 +402,7 @@ exports.resources={
"messages": [
{
"contentType": "PlainText",
"content": "Im sorry I did not get all the digits, please re-enter all digits."
"content": "I'm sorry I did not get all the digits, please re-enter all digits."
}
],
"maxAttempts": 3
Expand Down
2 changes: 1 addition & 1 deletion website/js/components/hooks/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var Vuex=require('vuex')
var Promise=require('bluebird')
var markdown=require('marked')
import hljs from 'highlight.js/lib/highlight';
import hljs from 'highlight.js/lib/core';
import javascriptlang from 'highlight.js/lib/languages/javascript';
import pythonlang from 'highlight.js/lib/languages/python';
import jsonlang from 'highlight.js/lib/languages/json';
Expand Down

0 comments on commit 2edc44b

Please sign in to comment.