Skip to content

Commit

Permalink
r9 dependency updates (microsoft#2428)
Browse files Browse the repository at this point in the history
* update dependencies, fix lint errors

* update dependencies

- update all npm dependencies to be current
- fix any lint errors
- update README.md files to suggest Emulator 4.9.0
  • Loading branch information
sgellock authored May 26, 2020
1 parent dbd8efb commit baac278
Show file tree
Hide file tree
Showing 139 changed files with 587 additions and 559 deletions.
1 change: 1 addition & 0 deletions samples/javascript_nodejs/01.console-echo/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
module.exports = {
"extends": "standard",
"rules": {
Expand Down
56 changes: 28 additions & 28 deletions samples/javascript_nodejs/01.console-echo/consoleAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

// @ts-check

const botbuilderCore = require("botbuilder-core");
const botbuilderCore = require('botbuilder-core');
const { BotAdapter, TurnContext, ActivityTypes } = botbuilderCore;
const readline = require("readline");
const readline = require('readline');

/**
* Lets a user communicate with a bot from a console window.
Expand All @@ -34,11 +34,11 @@ class ConsoleAdapter extends BotAdapter {
super();
this.nextId = 0;
this.reference = {
channelId: "console",
user: { id: "user", name: "User1" },
bot: { id: "bot", name: "Bot" },
conversation: { id: "convo1", name: "", isGroup: false },
serviceUrl: "",
channelId: 'console',
user: { id: 'user', name: 'User1' },
bot: { id: 'bot', name: 'Bot' },
conversation: { id: 'convo1', name: '', isGroup: false },
serviceUrl: '',
...reference
};
}
Expand Down Expand Up @@ -77,7 +77,7 @@ class ConsoleAdapter extends BotAdapter {
output: process.stdout,
terminal: false
});
rl.on("line", line => {
rl.on('line', line => {
// Initialize activity
const activity = TurnContext.applyConversationReference(
{
Expand Down Expand Up @@ -153,26 +153,26 @@ class ConsoleAdapter extends BotAdapter {
responses.push({});

switch (activity.type) {
case "delay":
await this.sleep(activity.value);
break;
case ActivityTypes.Message:
if (
activity.attachments &&
activity.attachments.length > 0
) {
const append =
activity.attachments.length === 1
? `(1 attachment)`
: `(${activity.attachments.length} attachments)`;
this.print(`${activity.text} ${append}`);
} else {
this.print(activity.text || "");
}
break;
default:
this.print(`[${activity.type}]`);
break;
case 'delay':
await this.sleep(activity.value);
break;
case ActivityTypes.Message:
if (
activity.attachments &&
activity.attachments.length > 0
) {
const append =
activity.attachments.length === 1
? '(1 attachment)'
: `(${ activity.attachments.length } attachments)`;
this.print(`${ activity.text } ${ append }`);
} else {
this.print(activity.text || '');
}
break;
default:
this.print(`[${ activity.type }]`);
break;
}
}
return responses;
Expand Down
10 changes: 5 additions & 5 deletions samples/javascript_nodejs/01.console-echo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
"readline": "^1.3.0"
},
"devDependencies": {
"eslint": "^6.6.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-node": "^10.0.0",
"eslint": "^7.0.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"nodemon": "~1.19.4"
"nodemon": "~2.0.4"
}
}
1 change: 1 addition & 0 deletions samples/javascript_nodejs/03.welcome-users/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
module.exports = {
"extends": "standard",
"rules": {
Expand Down
2 changes: 1 addition & 1 deletion samples/javascript_nodejs/03.welcome-users/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ This bot has been created using [Bot Framework](https://dev.botframework.com), i

[Bot Framework Emulator](https://github.com/microsoft/botframework-emulator) is a desktop application that allows bot developers to test and debug their bots on localhost or running remotely through a tunnel.

- Install the Bot Framework Emulator version 4.3.0 or greater from [here](https://github.com/Microsoft/BotFramework-Emulator/releases)
- Install the Bot Framework Emulator version 4.9.0 or greater from [here](https://github.com/Microsoft/BotFramework-Emulator/releases)

### Connect to the bot using Bot Framework Emulator

Expand Down
12 changes: 6 additions & 6 deletions samples/javascript_nodejs/03.welcome-users/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
"dependencies": {
"botbuilder": "~4.9.0",
"dotenv": "^8.2.0",
"restify": "~8.4.0"
"restify": "~8.5.1"
},
"devDependencies": {
"eslint": "^6.6.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-node": "^10.0.0",
"eslint": "^7.0.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"nodemon": "~1.19.4"
"nodemon": "~2.0.4"
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
module.exports = {
"extends": "standard",
"rules": {
Expand Down
2 changes: 1 addition & 1 deletion samples/javascript_nodejs/05.multi-turn-prompt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ This bot has been created using [Bot Framework](https://dev.botframework.com), i

[Bot Framework Emulator](https://github.com/microsoft/botframework-emulator) is a desktop application that allows bot developers to test and debug their bots on localhost or running remotely through a tunnel.

- Install the Bot Framework Emulator version 4.3.0 or greater from [here](https://github.com/Microsoft/BotFramework-Emulator/releases)
- Install the Bot Framework Emulator version 4.9.0 or greater from [here](https://github.com/Microsoft/BotFramework-Emulator/releases)

### Connect to the bot using Bot Framework Emulator

Expand Down
12 changes: 6 additions & 6 deletions samples/javascript_nodejs/05.multi-turn-prompt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
"botbuilder-dialogs": "~4.9.0",
"dotenv": "^8.2.0",
"path": "^0.12.7",
"restify": "~8.4.0"
"restify": "~8.5.1"
},
"devDependencies": {
"eslint": "^6.6.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-node": "^10.0.0",
"eslint": "^7.0.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"nodemon": "~1.19.4"
"nodemon": "~2.0.4"
}
}
1 change: 1 addition & 0 deletions samples/javascript_nodejs/06.using-cards/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
module.exports = {
"extends": "standard",
"rules": {
Expand Down
2 changes: 1 addition & 1 deletion samples/javascript_nodejs/06.using-cards/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ This bot has been created using [Microsoft Bot Framework][1], it shows how to cr

[Bot Framework Emulator](https://github.com/microsoft/botframework-emulator) is a desktop application that allows bot developers to test and debug their bots on localhost or running remotely through a tunnel.

- Install the Bot Framework Emulator version 4.3.0 or greater from [here](https://github.com/Microsoft/BotFramework-Emulator/releases)
- Install the Bot Framework Emulator version 4.9.0 or greater from [here](https://github.com/Microsoft/BotFramework-Emulator/releases)

### Connect to the bot using Bot Framework Emulator

Expand Down
12 changes: 6 additions & 6 deletions samples/javascript_nodejs/06.using-cards/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
"botbuilder": "~4.9.0",
"botbuilder-dialogs": "~4.9.0",
"dotenv": "^8.2.0",
"restify": "~8.4.0"
"restify": "~8.5.1"
},
"devDependencies": {
"eslint": "^6.6.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-node": "^10.0.0",
"eslint": "^7.0.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"nodemon": "~1.19.4"
"nodemon": "~2.0.4"
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
module.exports = {
"extends": "standard",
"rules": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ This bot has been created using [Bot Framework](https://dev.botframework.com), i

[Bot Framework Emulator](https://github.com/microsoft/botframework-emulator) is a desktop application that allows bot developers to test and debug their bots on localhost or running remotely through a tunnel.

- Install the Bot Framework Emulator version 4.3.0 or greater from [here](https://github.com/Microsoft/BotFramework-Emulator/releases)
- Install the Bot Framework Emulator version 4.9.0 or greater from [here](https://github.com/Microsoft/BotFramework-Emulator/releases)

### Connect to the bot using Bot Framework Emulator

Expand Down
16 changes: 8 additions & 8 deletions samples/javascript_nodejs/07.using-adaptive-cards/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
},
"dependencies": {
"botbuilder": "~4.9.0",
"dotenv": "^8.0.0",
"restify": "~8.3.3"
"dotenv": "^8.2.0",
"restify": "~8.5.1"
},
"devDependencies": {
"eslint": "^6.0.1",
"eslint-config-standard": "^13.0.1",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-node": "^9.1.0",
"eslint": "^7.0.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.0",
"nodemon": "~1.19.1"
"eslint-plugin-standard": "^4.0.1",
"nodemon": "~2.0.4"
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
module.exports = {
"extends": "standard",
"rules": {
Expand Down
2 changes: 1 addition & 1 deletion samples/javascript_nodejs/08.suggested-actions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ This bot has been created using [Bot Framework](https://dev.botframework.com), i

[Bot Framework Emulator](https://github.com/microsoft/botframework-emulator) is a desktop application that allows bot developers to test and debug their bots on localhost or running remotely through a tunnel.

- Install the Bot Framework Emulator version 4.3.0 or greater from [here](https://github.com/Microsoft/BotFramework-Emulator/releases)
- Install the Bot Framework Emulator version 4.9.0 or greater from [here](https://github.com/Microsoft/BotFramework-Emulator/releases)

### Connect to the bot using Bot Framework Emulator

Expand Down
12 changes: 6 additions & 6 deletions samples/javascript_nodejs/08.suggested-actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
"dependencies": {
"botbuilder": "~4.9.0",
"dotenv": "^8.2.0",
"restify": "~8.4.0"
"restify": "~8.5.1"
},
"devDependencies": {
"eslint": "^6.6.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-node": "^10.0.0",
"eslint": "^7.0.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"nodemon": "~1.19.4"
"nodemon": "~2.0.4"
}
}
1 change: 1 addition & 0 deletions samples/javascript_nodejs/11.qnamaker/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
module.exports = {
"extends": "standard",
"rules": {
Expand Down
2 changes: 1 addition & 1 deletion samples/javascript_nodejs/11.qnamaker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ QnA knowledge base setup and application configuration steps can be found [here]

[Bot Framework Emulator](https://github.com/microsoft/botframework-emulator) is a desktop application that allows bot developers to test and debug their bots on localhost or running remotely through a tunnel.

- Install the Bot Framework Emulator version 4.3.0 or greater from [here](https://github.com/Microsoft/BotFramework-Emulator/releases)
- Install the Bot Framework Emulator version 4.9.0 or greater from [here](https://github.com/Microsoft/BotFramework-Emulator/releases)

### Connect to the bot using Bot Framework Emulator

Expand Down
18 changes: 8 additions & 10 deletions samples/javascript_nodejs/11.qnamaker/bots/QnABot.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,26 @@ class QnABot extends ActivityHandler {
// When a user sends a message, perform a call to the QnA Maker service to retrieve matching Question and Answer pairs.
this.onMessage(async (context, next) => {
if (!process.env.QnAKnowledgebaseId || !process.env.QnAEndpointKey || !process.env.QnAEndpointHostName) {
let unconfiguredQnaMessage = 'NOTE: \r\n' +
const unconfiguredQnaMessage = 'NOTE: \r\n' +
'QnA Maker is not configured. To enable all capabilities, add `QnAKnowledgebaseId`, `QnAEndpointKey` and `QnAEndpointHostName` to the .env file. \r\n' +
'You may visit www.qnamaker.ai to create a QnA Maker knowledge base.'
'You may visit www.qnamaker.ai to create a QnA Maker knowledge base.';

await context.sendActivity(unconfiguredQnaMessage)
}
else {
await context.sendActivity(unconfiguredQnaMessage);
} else {
console.log('Calling QnA Maker');

const qnaResults = await this.qnaMaker.getAnswers(context);

// If an answer was received from QnA Maker, send the answer back to the user.
if (qnaResults[0]) {
await context.sendActivity(qnaResults[0].answer);

// If no answers were returned from QnA Maker, reply with help.
} else {
await context.sendActivity('No QnA Maker answers were found.');
}

}

// By calling next() you ensure that the next BotHandler is run.
await next();
});
Expand Down
6 changes: 3 additions & 3 deletions samples/javascript_nodejs/11.qnamaker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ adapter.onTurnError = async (context, error) => {
await context.sendActivity(traceActivity);

// Send a message to the user
await context.sendActivity(`The bot encountered an error or bug.`);
await context.sendActivity(`To continue to run this bot, please fix the bot source code.`);
await context.sendActivity('The bot encountered an error or bug.');
await context.sendActivity('To continue to run this bot, please fix the bot source code.');
};

// Create the main dialog.
Expand All @@ -57,7 +57,7 @@ const bot = new QnABot();
const server = restify.createServer();
server.listen(process.env.port || process.env.PORT || 3978, function() {
console.log(`\n${ server.name } listening to ${ server.url }`);
console.log(`\nGet Bot Framework Emulator: https://aka.ms/botframework-emulator`);
console.log('\nGet Bot Framework Emulator: https://aka.ms/botframework-emulator');
});

// Listen for incoming activities and route them to your bot main dialog.
Expand Down
16 changes: 8 additions & 8 deletions samples/javascript_nodejs/11.qnamaker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
"dependencies": {
"botbuilder": "~4.9.0",
"botbuilder-ai": "~4.9.0",
"dotenv": "^8.0.0",
"restify": "~8.3.3"
"dotenv": "^8.2.0",
"restify": "~8.5.1"
},
"devDependencies": {
"eslint": "^6.0.1",
"eslint-config-standard": "^13.0.1",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-node": "^9.1.0",
"eslint": "^7.0.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.0",
"nodemon": "~1.19.1"
"eslint-plugin-standard": "^4.0.1",
"nodemon": "~2.0.4"
}
}
3 changes: 2 additions & 1 deletion samples/javascript_nodejs/14.nlp-with-dispatch/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable */
module.exports = {
"extends": "standard",
"rules": {
"rules": {
"semi": [2, "always"],
"indent": [2, 4],
"no-return-await": 0,
Expand Down
Loading

0 comments on commit baac278

Please sign in to comment.