From 9116d4c10a37f3ea82df17b06e8a21284149f08a Mon Sep 17 00:00:00 2001 From: Bob Strahan Date: Thu, 6 Oct 2022 15:39:50 +0000 Subject: [PATCH 1/4] fixes #503 - Lex rebuild fails when there is any single character utterance --- lambda/lexv2-build/handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lambda/lexv2-build/handler.py b/lambda/lexv2-build/handler.py index 0e4f9efe9..014d4f53c 100644 --- a/lambda/lexv2-build/handler.py +++ b/lambda/lexv2-build/handler.py @@ -316,7 +316,7 @@ def translate_text(localeId, text): translatedText = text else: print(f"Utterance {text} too short to translate - using original.") - translatedUtterance = text + translatedText = text print(f"Translated utterance: {text} -> {translatedText}") return translatedText From f1c1ed12329ca660e9f88c6280165450fc4b0b06 Mon Sep 17 00:00:00 2001 From: Bob Strahan Date: Thu, 13 Oct 2022 01:57:24 +0000 Subject: [PATCH 2/4] fixes #506 - bot prompts 'What is the question?' when using ElicitResponse --- lambda/fulfillment/lib/middleware/lex.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lambda/fulfillment/lib/middleware/lex.js b/lambda/fulfillment/lib/middleware/lex.js index a7de2c2f9..79ea4efe1 100644 --- a/lambda/fulfillment/lib/middleware/lex.js +++ b/lambda/fulfillment/lib/middleware/lex.js @@ -28,7 +28,18 @@ function isConnectClientChat(req){ } function isElicitResponse(request, response){ - return _.get(response,'result.elicitResponse.responsebot_hook', undefined) !== undefined || _.get(request,'session.qnabotcontext.specialtyBot' ,undefined) !== undefined; + let result = false; + const qnabotcontextJSON = _.get(response,'session.qnabotcontext'); + if (qnabotcontextJSON) { + const qnabotcontext = JSON.parse(qnabotcontextJSON); + if (_.get(qnabotcontext,'elicitResponse.responsebot')) { + result = true; + } + if (_.get(qnabotcontext,'specialtyBot')) { + result = true; + } + } + return result; } function trapIgnoreWords(req, transcript) { @@ -395,9 +406,7 @@ function getV2ElicitTemplate(request, response){ sessionState: { sessionAttributes:_.get(response,'session',{}), dialogAction:{ - type:'ElicitSlot', - slotToElicit: 'qnaslot' - }, + type:'ElicitIntent' }, intent: { name: 'QnaIntent', }, From 9f82034b6062830c00615b3a865172949effacb4 Mon Sep 17 00:00:00 2001 From: Bob Strahan Date: Tue, 18 Oct 2022 17:16:53 +0000 Subject: [PATCH 3/4] limit concurrency of BotVersion creation to avoid stack failures caused by Lex API throttles. --- .../examples/examples/responsebots-lexv2.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/templates/examples/examples/responsebots-lexv2.js b/templates/examples/examples/responsebots-lexv2.js index 57255dd89..210d8c60b 100644 --- a/templates/examples/examples/responsebots-lexv2.js +++ b/templates/examples/examples/responsebots-lexv2.js @@ -61,6 +61,7 @@ exports.resources = { ] } }, + "ResponseBotQNAWageV2": { "Type": "AWS::Lex::Bot", "Condition": "CreateLexResponseBots", @@ -488,6 +489,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNAPinVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNAPinNoConfirmV2"}, @@ -617,6 +619,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNAPinVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNAYesNoV2"}, @@ -761,6 +764,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNAPinVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNAYesNoExitV2"}, @@ -871,6 +875,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNAYesNoExitVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNADateV2"}, @@ -969,6 +974,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNAYesNoExitVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNADateNoConfirmV2"}, @@ -1135,6 +1141,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNAYesNoExitVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNADayOfWeekV2"}, @@ -1326,6 +1333,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNADayOfWeekVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNAMonthV2"}, @@ -1504,6 +1512,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNADayOfWeekVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNAMonthNoConfirmV2"}, @@ -1610,6 +1619,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNADayOfWeekVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNANumberV2"}, @@ -1703,6 +1713,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNANumberVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNANumberNoConfirmV2"}, @@ -1817,6 +1828,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNANumberVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNAAgeV2"}, @@ -1918,6 +1930,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNANumberVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNAAgeNoConfirmV2"}, @@ -2024,6 +2037,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNAAgeNoConfirmVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNAPhoneNumberV2"}, @@ -2117,6 +2131,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNAAgeNoConfirmVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNAPhoneNumberNoConfirmV2"}, @@ -2224,6 +2239,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNAAgeNoConfirmVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNATimeV2"}, @@ -2329,6 +2345,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNATimeVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNAEmailAddressV2"}, @@ -2455,6 +2472,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNATimeVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNANameV2"}, From 02c96df98dccc1650e77069b4d1b2e193e933561 Mon Sep 17 00:00:00 2001 From: Ibrahim Mohamed Date: Mon, 24 Oct 2022 15:15:42 -0400 Subject: [PATCH 4/4] Update to version v5.2.2 --- CHANGELOG.md | 15 +++++ lambda/cfn-lambda-layer/package-lock.json | 14 ++--- lambda/cfn-lambda-layer/package.json | 5 +- lambda/cfn/package-lock.json | 55 +++-------------- lambda/cfn/package.json | 5 +- lambda/es-proxy-layer/lib/request.js | 59 +++++++++++++------ lambda/es-proxy-layer/package-lock.json | 18 +++--- lambda/es-proxy-layer/package.json | 2 +- lambda/fulfillment/lib/middleware/lex.js | 17 ++++-- lambda/import/index.js | 5 +- lambda/js_lambda_hook_sdk/package-lock.json | 14 ++--- lambda/js_lambda_hook_sdk/package.json | 5 +- lambda/lexv2-build/handler.py | 2 +- package-lock.json | 40 ++++++------- package.json | 7 ++- source/requirements-dev.txt | 4 +- source/requirements-test.txt | 6 +- .../examples/examples/responsebots-lexv2.js | 18 ++++++ website/js/components/connect/steps.js | 6 +- website/js/components/customTranslate.vue | 16 ++--- 20 files changed, 172 insertions(+), 141 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae3bf112b..36521c260 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [5.2.2] - 2022-10-24 + +### Updated + +- Security patches for npm and pip packages +- `axios` npm package removed from lambda/cfn +- Add retries for elasticsearch api requests with 5xx error codes to improve stability of initial stack deployment +- Split the creation of Lex Bot Versions in CF templates into batches of 3 to improve stability of initial stack deployment + + +### Fixed + +- Lex rebuild failures when there is any single character utterance (#503) +- ElicitResponse bug causing bot to prompt 'What is the question?' (#506) + ## [5.2.1] - 2022-09-15 ### Updated diff --git a/lambda/cfn-lambda-layer/package-lock.json b/lambda/cfn-lambda-layer/package-lock.json index 79892fbd7..307767049 100644 --- a/lambda/cfn-lambda-layer/package-lock.json +++ b/lambda/cfn-lambda-layer/package-lock.json @@ -459,9 +459,9 @@ "integrity": "sha1-SLtQiECfFvGCFmZkHETdGqrjzYg=" }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -909,7 +909,7 @@ "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", + "minimatch": "3.0.5", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } @@ -1021,9 +1021,9 @@ "integrity": "sha1-SLtQiECfFvGCFmZkHETdGqrjzYg=" }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", "requires": { "brace-expansion": "^1.1.7" } diff --git a/lambda/cfn-lambda-layer/package.json b/lambda/cfn-lambda-layer/package.json index 0d773b9b2..c5312cf9a 100644 --- a/lambda/cfn-lambda-layer/package.json +++ b/lambda/cfn-lambda-layer/package.json @@ -10,5 +10,8 @@ "license": "ISC", "dependencies": { "cfn-lambda": "^5.1.0" + }, + "overrides": { + "minimatch@<3.0.5": "3.0.5" } -} +} \ No newline at end of file diff --git a/lambda/cfn/package-lock.json b/lambda/cfn/package-lock.json index b35841d65..07e887ccc 100644 --- a/lambda/cfn/package-lock.json +++ b/lambda/cfn/package-lock.json @@ -10,7 +10,6 @@ "license": "ISC", "dependencies": { "aws-sdk": "^2.913.0", - "axios": "^0.21.1", "bluebird": "^3.5.0", "body-parser": "^1.18.2", "cfn-lambda": "^4.0.0", @@ -28,7 +27,7 @@ "devDependencies": { "diff": "^4.0.2", "tap": "^16.2.0", - "tap-mocha-reporter": "^5.0.1" + "tap-mocha-reporter": "^5.0.3" } }, "node_modules/@istanbuljs/load-nyc-config": { @@ -347,14 +346,6 @@ "optional": true, "peer": true }, - "node_modules/axios": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", - "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", - "dependencies": { - "follow-redirects": "^1.10.0" - } - }, "node_modules/balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -1002,25 +993,6 @@ "node": ">=4" } }, - "node_modules/follow-redirects": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", - "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, "node_modules/forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -2135,9 +2107,9 @@ } }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -5750,14 +5722,6 @@ "optional": true, "peer": true }, - "axios": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", - "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", - "requires": { - "follow-redirects": "^1.10.0" - } - }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -6301,11 +6265,6 @@ "vlq": "^0.2.1" } }, - "follow-redirects": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", - "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==" - }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -7211,9 +7170,9 @@ } }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", "requires": { "brace-expansion": "^1.1.7" } diff --git a/lambda/cfn/package.json b/lambda/cfn/package.json index 06b01540e..75a5e5569 100644 --- a/lambda/cfn/package.json +++ b/lambda/cfn/package.json @@ -11,7 +11,6 @@ "license": "ISC", "dependencies": { "aws-sdk": "^2.913.0", - "axios": "^0.21.1", "bluebird": "^3.5.0", "body-parser": "^1.18.2", "cfn-lambda": "^4.0.0", @@ -29,6 +28,6 @@ "devDependencies": { "diff": "^4.0.2", "tap": "^16.2.0", - "tap-mocha-reporter": "^5.0.1" + "tap-mocha-reporter": "^5.0.3" } -} +} \ No newline at end of file diff --git a/lambda/es-proxy-layer/lib/request.js b/lambda/es-proxy-layer/lib/request.js index 17f594c89..dc0ac2aeb 100644 --- a/lambda/es-proxy-layer/lib/request.js +++ b/lambda/es-proxy-layer/lib/request.js @@ -8,7 +8,7 @@ const qnabot = require("qnabot/logging") module.exports=function(opts){ - + const url=Url.parse(opts.url) const request={ host:url.hostname, @@ -19,15 +19,20 @@ module.exports=function(opts){ } request.headers['Host']=request.host; if(opts.body){ + //if the JSON body being passed to elasticsearch is an array, + //then let's convert it to a newline delmited JSON string (ndjson) if(Array.isArray(opts.body)){ opts.body=opts.body.map(JSON.stringify).join('\n')+'\n' - request.headers['content-type']='application/x-ndjson' - }else if(typeof opts.body === "string"){ - opts.body=opts.body - request.headers['content-type']='application/json' - }else{ + request.headers['Content-Type']='application/x-ndjson' + } + //stringify the body object into JSON if not already a string + else if(typeof opts.body !== "string"){ opts.body = JSON.stringify(opts.body) - request.headers['content-type']='application/json' + } + + //if content type is not set, default to application/json + if(!request.headers['Content-Type'] && !request.headers['content-type']){ + request.headers['Content-Type']='application/json' } request.body=opts.body request.data=opts.body @@ -39,22 +44,40 @@ module.exports=function(opts){ if(count>0){ qnabot.log("Tries left:"+count) var credentials=aws.config.credentials - var signed=sign(request,credentials) - Promise.resolve(axios(signed)) - .then(res) - .catch(error=>{ - if(error.code==="ECONNABORTED"){ - setTimeout(()=>next(--count),1000) - }else{ + var signed=sign(request,credentials) + axios(signed) + .then(res) + .catch(error=>{ + // if the server responded with an actual HTTP response then log and retry on 5xx codes + if (error.response) { + qnabot.log(error.response.data); + qnabot.log(error.response.status); + if(error.response.status >= 500){ + qnabot.log("Received 500 error code, retrying...") + setTimeout(()=>next(--count),1000) + } + else{ + //any non 5xx failure codes should be rejected as normal + rej(error) + } + } + //in some cases, the axios client does not return a fully formatted response object + //in those cases, the message property may contain useful debugging information + else if(error.message) { + qnabot.log(error.message); + rej(error) + } + else{ rej(error) } - }) - }else{ - rej("timeout") + }) + } + else{ + rej("Retry limits exceeded. See logs for additional information.") } } next(10) }) .tap(x=>qnabot.log(x.status)) .get('data') -} +} \ No newline at end of file diff --git a/lambda/es-proxy-layer/package-lock.json b/lambda/es-proxy-layer/package-lock.json index a81247f64..98e0eac1f 100644 --- a/lambda/es-proxy-layer/package-lock.json +++ b/lambda/es-proxy-layer/package-lock.json @@ -10,7 +10,7 @@ "license": "ISC", "dependencies": { "aws4": "^1.6.0", - "axios": "0.21.1", + "axios": "0.21.4", "handlebars": "^4.7.2", "linkifyjs": "^3.0.0-beta.3", "simple-encryptor": "^3.0.0", @@ -42,11 +42,11 @@ "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" }, "node_modules/axios": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", - "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", "dependencies": { - "follow-redirects": "^1.10.0" + "follow-redirects": "^1.14.0" } }, "node_modules/follow-redirects": { @@ -243,11 +243,11 @@ "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" }, "axios": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", - "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", "requires": { - "follow-redirects": "^1.10.0" + "follow-redirects": "^1.14.0" } }, "follow-redirects": { diff --git a/lambda/es-proxy-layer/package.json b/lambda/es-proxy-layer/package.json index 427d18f2c..805f339b4 100644 --- a/lambda/es-proxy-layer/package.json +++ b/lambda/es-proxy-layer/package.json @@ -7,7 +7,7 @@ "license": "ISC", "dependencies": { "aws4": "^1.6.0", - "axios": "0.21.1", + "axios": "0.21.4", "handlebars": "^4.7.2", "linkifyjs": "^3.0.0-beta.3", "simple-encryptor": "^3.0.0", diff --git a/lambda/fulfillment/lib/middleware/lex.js b/lambda/fulfillment/lib/middleware/lex.js index a7de2c2f9..79ea4efe1 100644 --- a/lambda/fulfillment/lib/middleware/lex.js +++ b/lambda/fulfillment/lib/middleware/lex.js @@ -28,7 +28,18 @@ function isConnectClientChat(req){ } function isElicitResponse(request, response){ - return _.get(response,'result.elicitResponse.responsebot_hook', undefined) !== undefined || _.get(request,'session.qnabotcontext.specialtyBot' ,undefined) !== undefined; + let result = false; + const qnabotcontextJSON = _.get(response,'session.qnabotcontext'); + if (qnabotcontextJSON) { + const qnabotcontext = JSON.parse(qnabotcontextJSON); + if (_.get(qnabotcontext,'elicitResponse.responsebot')) { + result = true; + } + if (_.get(qnabotcontext,'specialtyBot')) { + result = true; + } + } + return result; } function trapIgnoreWords(req, transcript) { @@ -395,9 +406,7 @@ function getV2ElicitTemplate(request, response){ sessionState: { sessionAttributes:_.get(response,'session',{}), dialogAction:{ - type:'ElicitSlot', - slotToElicit: 'qnaslot' - }, + type:'ElicitIntent' }, intent: { name: 'QnaIntent', }, diff --git a/lambda/import/index.js b/lambda/import/index.js index 9e8ab1831..9986f887e 100644 --- a/lambda/import/index.js +++ b/lambda/import/index.js @@ -64,7 +64,7 @@ exports.step = function (event, context, cb) { objects.push(questionStr) }) config.buffer = "" - } else { + } else { objects = config.buffer.split(/\n/) JSON.parse(objects[objects.length - 1]) config.buffer = "" @@ -140,7 +140,8 @@ exports.step = function (event, context, cb) { endpoint: process.env.ES_ENDPOINT, method: "POST", path: "/_bulk", - body: result + body: result, + headers: {'Content-Type': 'application/x-ndjson'} } return lambda.invoke({ diff --git a/lambda/js_lambda_hook_sdk/package-lock.json b/lambda/js_lambda_hook_sdk/package-lock.json index 4f3289759..b6d539e5b 100644 --- a/lambda/js_lambda_hook_sdk/package-lock.json +++ b/lambda/js_lambda_hook_sdk/package-lock.json @@ -3038,9 +3038,9 @@ } }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -7855,7 +7855,7 @@ "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", + "minimatch": "3.0.5", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } @@ -8747,9 +8747,9 @@ "dev": true }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", "dev": true, "requires": { "brace-expansion": "^1.1.7" diff --git a/lambda/js_lambda_hook_sdk/package.json b/lambda/js_lambda_hook_sdk/package.json index cb6f8cbd0..27d2159d7 100644 --- a/lambda/js_lambda_hook_sdk/package.json +++ b/lambda/js_lambda_hook_sdk/package.json @@ -18,5 +18,8 @@ "install": "^0.13.0", "jest": "^27.0.6", "npm": "^8.10.0" + }, + "overrides": { + "minimatch@<3.0.5": "3.0.5" } -} +} \ No newline at end of file diff --git a/lambda/lexv2-build/handler.py b/lambda/lexv2-build/handler.py index 0e4f9efe9..014d4f53c 100644 --- a/lambda/lexv2-build/handler.py +++ b/lambda/lexv2-build/handler.py @@ -316,7 +316,7 @@ def translate_text(localeId, text): translatedText = text else: print(f"Utterance {text} too short to translate - using original.") - translatedUtterance = text + translatedText = text print(f"Translated utterance: {text} -> {translatedText}") return translatedText diff --git a/package-lock.json b/package-lock.json index efdc5d1c6..84fd31198 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "qnabot-on-aws", - "version": "5.2.1", + "version": "5.2.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "qnabot-on-aws", - "version": "5.2.1", + "version": "5.2.2", "license": "SEE LICENSE IN LICENSE", "os": [ "darwin", @@ -17,7 +17,7 @@ "alexa-sdk": "^1.0.25", "async-mutex": "^0.1.3", "autosize": "^3.0.21", - "aws-lex-web-ui": "git+https://github.com/aws-samples/aws-lex-web-ui.git#semver:0.18.1", + "aws-lex-web-ui": "git+https://github.com/aws-samples/aws-lex-web-ui.git#semver:0.19.6", "aws-sdk": "^2.913.0", "aws4": "^1.7.0", "axios": "^0.21.4", @@ -2788,8 +2788,8 @@ "integrity": "sha1-8YL0DRd1fZeKE5pMnKQMTA5EhgM=" }, "node_modules/aws-lex-web-ui": { - "version": "0.18.1", - "resolved": "git+ssh://git@github.com/aws-samples/aws-lex-web-ui.git#53072529b77f0b89e8ae9e139987a63fef5ffc68", + "version": "0.19.6", + "resolved": "git+ssh://git@github.com/aws-samples/aws-lex-web-ui.git#a51d0b50b7980481e83c06a319cb4f4e28faddf4", "license": "SEE LICENSE IN LICENSE", "dependencies": { "amazon-cognito-auth-js": "^1.2.4", @@ -10529,9 +10529,9 @@ "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -17933,7 +17933,7 @@ "ignore": "^4.0.6", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", - "minimatch": "^3.0.4", + "minimatch": "3.0.5", "strip-json-comments": "^3.1.1" }, "dependencies": { @@ -17972,7 +17972,7 @@ "requires": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", - "minimatch": "^3.0.4" + "minimatch": "3.0.5" } }, "@humanwhocodes/object-schema": { @@ -18941,8 +18941,8 @@ "integrity": "sha1-8YL0DRd1fZeKE5pMnKQMTA5EhgM=" }, "aws-lex-web-ui": { - "version": "git+ssh://git@github.com/aws-samples/aws-lex-web-ui.git#53072529b77f0b89e8ae9e139987a63fef5ffc68", - "from": "aws-lex-web-ui@git+https://github.com/aws-samples/aws-lex-web-ui.git#semver:0.18.1", + "version": "git+ssh://git@github.com/aws-samples/aws-lex-web-ui.git#a51d0b50b7980481e83c06a319cb4f4e28faddf4", + "from": "aws-lex-web-ui@git+https://github.com/aws-samples/aws-lex-web-ui.git#semver:0.19.6", "requires": { "amazon-cognito-auth-js": "^1.2.4", "core-js": "^3.6.5", @@ -19070,7 +19070,7 @@ "debug": "^2.6.9", "json5": "^0.5.1", "lodash": "^4.17.4", - "minimatch": "^3.0.4", + "minimatch": "3.0.5", "path-is-absolute": "^1.0.1", "private": "^0.1.8", "slash": "^1.0.0", @@ -20451,7 +20451,7 @@ "google-cdn-data": "^0.1.6", "jsdelivr-cdn-data": "git://github.com/shahata/jsdelivr-cdn-data.git#d014a2ad1bdfb4c6e3d3cefc7f264435281b91e0", "lodash": "^4.17.11", - "minimatch": "^3.0.2" + "minimatch": "3.0.5" } }, "cdnjs-cdn-data": { @@ -22120,7 +22120,7 @@ "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "3.0.5", "natural-compare": "^1.4.0", "optionator": "^0.9.1", "progress": "^2.0.0", @@ -23149,7 +23149,7 @@ "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", + "minimatch": "3.0.5", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } @@ -25203,9 +25203,9 @@ "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", "requires": { "brace-expansion": "^1.1.7" } @@ -26724,7 +26724,7 @@ "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.2.tgz", "integrity": "sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg==", "requires": { - "minimatch": "3.0.4" + "minimatch": "3.0.5" } }, "redent": { diff --git a/package.json b/package.json index 31d67db70..7bc2fe712 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "qnabot-on-aws", - "version": "5.2.1", + "version": "5.2.2", "engines": { "node": ">=12.16.1", "npm": ">=7.8.0" @@ -49,7 +49,7 @@ "alexa-sdk": "^1.0.25", "async-mutex": "^0.1.3", "autosize": "^3.0.21", - "aws-lex-web-ui": "git+https://github.com/aws-samples/aws-lex-web-ui.git#semver:0.18.1", + "aws-lex-web-ui": "git+https://github.com/aws-samples/aws-lex-web-ui.git#semver:0.19.6", "aws-sdk": "^2.913.0", "aws4": "^1.7.0", "axios": "^0.21.4", @@ -169,6 +169,7 @@ }, "chokidar@2.1.8": { "glob-parent": "^5.1.2" - } + }, + "minimatch": "3.0.5" } } diff --git a/source/requirements-dev.txt b/source/requirements-dev.txt index 95af95312..afe644adc 100644 --- a/source/requirements-dev.txt +++ b/source/requirements-dev.txt @@ -1,5 +1,5 @@ autopep8==1.7.0 -black==22.8.0 +black==22.10.0 flake8==5.0.4 -mypy==0.971.0 +mypy==0.982.0 pylint==2.15.0 diff --git a/source/requirements-test.txt b/source/requirements-test.txt index 598a5a5c5..26d2abce4 100644 --- a/source/requirements-test.txt +++ b/source/requirements-test.txt @@ -1,7 +1,7 @@ docker==6.0.0 moto==4.0.1 pytest==7.1.1 -pytest-cov==3.0.0 -pytest-env==0.6.2 -pytest-mock==3.8.2 +pytest-cov==4.0.0 +pytest-env==0.8.1 +pytest-mock==3.10.0 pyyaml==6.0 diff --git a/templates/examples/examples/responsebots-lexv2.js b/templates/examples/examples/responsebots-lexv2.js index 57255dd89..210d8c60b 100644 --- a/templates/examples/examples/responsebots-lexv2.js +++ b/templates/examples/examples/responsebots-lexv2.js @@ -61,6 +61,7 @@ exports.resources = { ] } }, + "ResponseBotQNAWageV2": { "Type": "AWS::Lex::Bot", "Condition": "CreateLexResponseBots", @@ -488,6 +489,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNAPinVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNAPinNoConfirmV2"}, @@ -617,6 +619,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNAPinVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNAYesNoV2"}, @@ -761,6 +764,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNAPinVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNAYesNoExitV2"}, @@ -871,6 +875,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNAYesNoExitVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNADateV2"}, @@ -969,6 +974,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNAYesNoExitVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNADateNoConfirmV2"}, @@ -1135,6 +1141,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNAYesNoExitVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNADayOfWeekV2"}, @@ -1326,6 +1333,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNADayOfWeekVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNAMonthV2"}, @@ -1504,6 +1512,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNADayOfWeekVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNAMonthNoConfirmV2"}, @@ -1610,6 +1619,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNADayOfWeekVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNANumberV2"}, @@ -1703,6 +1713,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNANumberVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNANumberNoConfirmV2"}, @@ -1817,6 +1828,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNANumberVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNAAgeV2"}, @@ -1918,6 +1930,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNANumberVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNAAgeNoConfirmV2"}, @@ -2024,6 +2037,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNAAgeNoConfirmVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNAPhoneNumberV2"}, @@ -2117,6 +2131,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNAAgeNoConfirmVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNAPhoneNumberNoConfirmV2"}, @@ -2224,6 +2239,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNAAgeNoConfirmVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNATimeV2"}, @@ -2329,6 +2345,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNATimeVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNAEmailAddressV2"}, @@ -2455,6 +2472,7 @@ exports.resources = { "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Type": "AWS::Lex::BotVersion", + "DependsOn": ["ResponseBotQNATimeVersionV2"], "Condition": "CreateLexResponseBots", "Properties": { "BotId": {"Ref": "ResponseBotQNANameV2"}, diff --git a/website/js/components/connect/steps.js b/website/js/components/connect/steps.js index 4c024b71e..62a0cc883 100644 --- a/website/js/components/connect/steps.js +++ b/website/js/components/connect/steps.js @@ -4,7 +4,7 @@ module.exports=[ text:`
Start by completing all 3 steps below to setup your Amazon Connect instance: -
+
⁣1. Launch Amazon Connect
⁣2. Create an instance
⁣3. Claim a phone number
@@ -72,9 +72,9 @@ Now we must make the QnABot accessible to our new call center. Open the
⁣1. Choose IMPORT SAMPLE QUESTIONS AND ANSWERS below, it can take up to 2 minutes to finish this process.
-⁣2. When Status is Complete, enable the new interruptable reponse feature: (i) From the Designer Tools menu (☰) choose Settings, (ii) set CONNECT_ENABLE_VOICE_RESPONSE_INTERRUPT to true, and (iii) save changes.
+⁣2. When Status is Complete, enable the new interruptable reponse feature: (i) From the Designer Tools menu (☰) choose Settings, (ii) set CONNECT_ENABLE_VOICE_RESPONSE_INTERRUPT to true, and (iii) save changes.
⁣3. You are ready to try your Bot! Call your new contact center phone number and try some of the questions below.
-For more information see our blog post
Build an AI powered agent for Amazon Connect using AWS QnABot
+For more information see our blog post Build an AI powered agent for Amazon Connect using AWS QnABot



` diff --git a/website/js/components/customTranslate.vue b/website/js/components/customTranslate.vue index 64511ffe3..2bb6a6266 100644 --- a/website/js/components/customTranslate.vue +++ b/website/js/components/customTranslate.vue @@ -5,12 +5,12 @@ v-card v-card-title.display-1.pa-2 Import Translate Custom Terminologies v-card-text - h3 For more information about Amazon Translate custom terminologies, see here + h3 For more information about Amazon Translate custom terminologies, see here v-card-text(v-if="!IsCustomTerminologyEnabled") p Set ENABLE_CUSTOM_TERMINOLOGY to true in settings to enable the use of terminology files for Amazon Translate - v-card-text(v-if="IsCustomTerminologyEnabled") - p {{importWarning}} + v-card-text(v-if="IsCustomTerminologyEnabled") + p {{importWarning}} p.title From File Description:
@@ -18,9 +18,9 @@
div.ml-4.mb-2 input( - type="file" + type="file" name="file" - id="upload-file" + id="upload-file" v-on:change="Getfile" ref="file" ) @@ -101,7 +101,7 @@ module.exports={ console.log(JSON.stringify(settings)); return _.get(settings[2],"ENABLE_CUSTOM_TERMINOLOGY")=="true" }, - + close:function(){ this.loading=false this.error=false @@ -115,7 +115,7 @@ module.exports={ .then(result=>{ self.jobs = result }) - + } }, Getfile:function(event){ @@ -130,7 +130,7 @@ module.exports={ var name=file.name return new Promise(function(res,rej){ var reader = new FileReader(); - reader.onload = function(e){ + reader.onload = function(e){ try { res({ name:file.name,