From a5cef2d242eb951363e703042c4af7f12b73caa5 Mon Sep 17 00:00:00 2001 From: Ganapathi Diddi Date: Mon, 6 May 2024 12:26:12 +0530 Subject: [PATCH] Addressing review comments --- README.md | 3 ++- .../42.scale-out/bots/{dialogBot.js => scaleoutBot.js} | 6 +++--- samples/javascript_nodejs/42.scale-out/index.js | 4 ++-- samples/javascript_nodejs/42.scale-out/memoryStore.js | 2 ++ samples/javascript_nodejs/42.scale-out/package.json | 3 +-- 5 files changed, 10 insertions(+), 8 deletions(-) rename samples/javascript_nodejs/42.scale-out/bots/{dialogBot.js => scaleoutBot.js} (91%) diff --git a/README.md b/README.md index faa8edd72e..8ea7be811f 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ Samples are designed to illustrate functionality you'll need to implement to bui |19|Custom dialogs | Demonstrates complex conversation flow using the Dialogs library. |[.NET Core][cs#19]|[JavaScript][js#19]|[Python][py#19]|[Java][java#19] |21|Application Insights | Demonstrates how to add telemetry logging to your bot, storing telemetry within Application Insights.|[.NET Core][cs#21] |[JavaScript][js#21] ||[Java][java#21] |23|Facebook events | Integrate and consume Facebook specific payloads, such as post-backs, quick replies and opt-in events.|[.NET Core][cs#23] |[JavaScript][js#23] |[Python][py#23]|[Java][java#23] -|42|Scale out | Demonstrates how you can build your own state solution from the ground up that supports scaled out deployment with ETag based optimistic locking. |[.NET Core][cs#42] | |[Python][py#42]|[Java][java#42] +|42|Scale out | Demonstrates how you can build your own state solution from the ground up that supports scaled out deployment with ETag based optimistic locking. |[.NET Core][cs#42] |[JavaScript][js#42] |[Python][py#42]|[Java][java#42] |44|Basic custom prompts | Demonstrates how to implement your own _basic_ prompts to ask the user for information. |[.NET Core][cs#44]|[JavaScript][js#44]|[Python][py#44]|[Java][java#44] |47|Inspection middleware | Demonstrates how to use middleware to allow the Bot Framework Emulator to debug traffic into and out of the bot in addition to looking at the current state of the bot. | [.NET Core][cs#47] | [JavaScript][js#47] |[Python][py#47]|[Java][java#47] |70|Styling webchat | This sample shows how to create a web page with custom Web Chat component.| | [ECMAScript 6][es#70] | @@ -179,6 +179,7 @@ A [collection of **experimental** samples](./experimental) exist, intended to pr [js#23]:samples/javascript_nodejs/23.facebook-events [js#24]:samples/javascript_nodejs/24.bot-authentication-msgraph [js#40]:samples/javascript_nodejs/40.timex-resolution +[js#42]:samples/javascript_nodejs/42.scale-out [js#43]:samples/javascript_nodejs/43.complex-dialog [js#44]:samples/javascript_nodejs/44.prompt-for-user-input [js#45]:samples/javascript_nodejs/45.state-management diff --git a/samples/javascript_nodejs/42.scale-out/bots/dialogBot.js b/samples/javascript_nodejs/42.scale-out/bots/scaleoutBot.js similarity index 91% rename from samples/javascript_nodejs/42.scale-out/bots/dialogBot.js rename to samples/javascript_nodejs/42.scale-out/bots/scaleoutBot.js index 323c6c5481..dd5413a3be 100644 --- a/samples/javascript_nodejs/42.scale-out/bots/dialogBot.js +++ b/samples/javascript_nodejs/42.scale-out/bots/scaleoutBot.js @@ -5,14 +5,14 @@ const { ActivityHandler } = require('botbuilder'); const { MemoryStore } = require('../memoryStore'); const { DialogHost } = require('../dialogHost'); -class DialogBot extends ActivityHandler { +class ScaleoutBot extends ActivityHandler { /** * * @param {Dialog} dialog */ constructor(dialog) { super(); - if (!dialog) throw new Error('[DialogBot]: Missing parameter. dialog is required'); + if (!dialog) throw new Error('[ScaleoutBot]: Missing parameter. dialog is required'); this.dialog = dialog; @@ -51,4 +51,4 @@ class DialogBot extends ActivityHandler { } } -module.exports.DialogBot = DialogBot; +module.exports.ScaleoutBot = ScaleoutBot; diff --git a/samples/javascript_nodejs/42.scale-out/index.js b/samples/javascript_nodejs/42.scale-out/index.js index 2f9355ebf3..89ab2a190f 100644 --- a/samples/javascript_nodejs/42.scale-out/index.js +++ b/samples/javascript_nodejs/42.scale-out/index.js @@ -18,7 +18,7 @@ const { } = require('botbuilder'); const { MemoryStore } = require('./memoryStore'); -const { DialogBot } = require('./bots/dialogBot'); +const { ScaleoutBot } = require('./bots/scaleoutBot'); const { RootDialog } = require('./dialogs/rootDialog'); // Create HTTP server. @@ -49,7 +49,7 @@ const userState = new UserState(memoryStorage); const dialog = new RootDialog(userState); // Create the bot's main handler. -const bot = new DialogBot(conversationState, userState, dialog); +const bot = new ScaleoutBot(conversationState, userState, dialog); // Listen for incoming requests. server.post('/api/messages', async (req, res) => { diff --git a/samples/javascript_nodejs/42.scale-out/memoryStore.js b/samples/javascript_nodejs/42.scale-out/memoryStore.js index 45a9354ca9..1ecde7931b 100644 --- a/samples/javascript_nodejs/42.scale-out/memoryStore.js +++ b/samples/javascript_nodejs/42.scale-out/memoryStore.js @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. class MemoryStore { constructor() { diff --git a/samples/javascript_nodejs/42.scale-out/package.json b/samples/javascript_nodejs/42.scale-out/package.json index 6cd567f989..5992803772 100644 --- a/samples/javascript_nodejs/42.scale-out/package.json +++ b/samples/javascript_nodejs/42.scale-out/package.json @@ -13,10 +13,9 @@ }, "repository": { "type": "git", - "url": "https://github.com" + "url": "https://github.com/Microsoft/BotBuilder-Samples.git" }, "dependencies": { - "@microsoft/recognizers-text-data-types-timex-expression": "1.1.4", "botbuilder": "~4.22.1", "botbuilder-ai": "~4.22.1", "botbuilder-dialogs": "~4.22.1",