botbuilder-dialogs
Advanced tools
Comparing version 4.4.0 to 4.5.0
@@ -23,3 +23,3 @@ /** | ||
* ```JavaScript | ||
* const { ComponentDialog, WaterfallDialog, TextPrompt, NumberPrompt } = require('botbuilder-dialogs); | ||
* const { ComponentDialog, WaterfallDialog, TextPrompt, NumberPrompt } = require('botbuilder-dialogs'); | ||
* | ||
@@ -26,0 +26,0 @@ * class FillProfileDialog extends ComponentDialog { |
@@ -27,3 +27,3 @@ "use strict"; | ||
* ```JavaScript | ||
* const { ComponentDialog, WaterfallDialog, TextPrompt, NumberPrompt } = require('botbuilder-dialogs); | ||
* const { ComponentDialog, WaterfallDialog, TextPrompt, NumberPrompt } = require('botbuilder-dialogs'); | ||
* | ||
@@ -86,9 +86,12 @@ * class FillProfileDialog extends ComponentDialog { | ||
if (turnResult.status !== dialog_1.DialogTurnStatus.waiting) { | ||
if (turnResult.status === dialog_1.DialogTurnStatus.cancelled) { | ||
await this.endComponent(outerDC, turnResult.result); | ||
const cancelledTurnResult = { status: dialog_1.DialogTurnStatus.cancelled, result: turnResult.result }; | ||
return cancelledTurnResult; | ||
} | ||
// Return result to calling dialog | ||
return await this.endComponent(outerDC, turnResult.result); | ||
} | ||
else { | ||
// Just signal end of turn | ||
return dialog_1.Dialog.EndOfTurn; | ||
} | ||
// Just signal end of turn | ||
return dialog_1.Dialog.EndOfTurn; | ||
} | ||
@@ -103,2 +106,7 @@ async continueDialog(outerDC) { | ||
if (turnResult.status !== dialog_1.DialogTurnStatus.waiting) { | ||
if (turnResult.status === dialog_1.DialogTurnStatus.cancelled) { | ||
await this.endComponent(outerDC, turnResult.result); | ||
const cancelledTurnResult = { status: dialog_1.DialogTurnStatus.cancelled, result: turnResult.result }; | ||
return cancelledTurnResult; | ||
} | ||
// Return result to calling dialog | ||
@@ -105,0 +113,0 @@ return await this.endComponent(outerDC, turnResult.result); |
@@ -88,6 +88,6 @@ "use strict"; | ||
if (o.prompt && typeof o.prompt === 'object' && typeof o.prompt.inputHint !== 'string') { | ||
o.prompt.inputHint = botbuilder_core_1.InputHints.ExpectingInput; | ||
o.prompt.inputHint = botbuilder_core_1.InputHints.AcceptingInput; | ||
} | ||
if (o.retryPrompt && typeof o.retryPrompt === 'object' && typeof o.retryPrompt.inputHint !== 'string') { | ||
o.retryPrompt.inputHint = botbuilder_core_1.InputHints.ExpectingInput; | ||
o.retryPrompt.inputHint = botbuilder_core_1.InputHints.AcceptingInput; | ||
} | ||
@@ -197,3 +197,3 @@ // Initialize prompt state | ||
// Initialize outgoing message | ||
const msg = typeof prompt === 'object' ? { ...prompt } : botbuilder_core_1.MessageFactory.text(prompt, undefined, botbuilder_core_1.InputHints.ExpectingInput); | ||
const msg = typeof prompt === 'object' ? { ...prompt } : botbuilder_core_1.MessageFactory.text(prompt, undefined, botbuilder_core_1.InputHints.AcceptingInput); | ||
if (!Array.isArray(msg.attachments)) { | ||
@@ -228,4 +228,14 @@ msg.attachments = []; | ||
const code = context.activity.value.state; | ||
await context.sendActivity({ type: 'invokeResponse', value: { status: 200 } }); | ||
token = await this.getUserToken(context, code); | ||
try { | ||
token = await this.getUserToken(context, code); | ||
if (token !== undefined) { | ||
await context.sendActivity({ type: 'invokeResponse', value: { status: 200 } }); | ||
} | ||
else { | ||
await context.sendActivity({ type: 'invokeResponse', value: { status: 404 } }); | ||
} | ||
} | ||
catch { | ||
await context.sendActivity({ type: 'invokeResponse', value: { status: 500 } }); | ||
} | ||
} | ||
@@ -232,0 +242,0 @@ else if (context.activity.type === botbuilder_core_1.ActivityTypes.Message) { |
@@ -5,3 +5,3 @@ { | ||
"description": "A dialog stack based conversation manager for Microsoft BotBuilder.", | ||
"version": "4.4.0", | ||
"version": "4.5.0", | ||
"license": "MIT", | ||
@@ -29,3 +29,3 @@ "keywords": [ | ||
"@types/node": "^10.12.18", | ||
"botbuilder-core": "^4.4.0" | ||
"botbuilder-core": "^4.5.0" | ||
}, | ||
@@ -45,3 +45,3 @@ "devDependencies": { | ||
"clean": "erase /q /s .\\lib", | ||
"set-version": "npm version --allow-same-version 4.4.0" | ||
"set-version": "npm version --allow-same-version 4.5.0" | ||
}, | ||
@@ -48,0 +48,0 @@ "files": [ |
@@ -27,3 +27,3 @@ /** | ||
* ```JavaScript | ||
* const { ComponentDialog, WaterfallDialog, TextPrompt, NumberPrompt } = require('botbuilder-dialogs); | ||
* const { ComponentDialog, WaterfallDialog, TextPrompt, NumberPrompt } = require('botbuilder-dialogs'); | ||
* | ||
@@ -93,8 +93,12 @@ * class FillProfileDialog extends ComponentDialog { | ||
if (turnResult.status !== DialogTurnStatus.waiting) { | ||
if (turnResult.status === DialogTurnStatus.cancelled) { | ||
await this.endComponent(outerDC, turnResult.result); | ||
const cancelledTurnResult: DialogTurnResult = { status: DialogTurnStatus.cancelled, result: turnResult.result } | ||
return cancelledTurnResult; | ||
} | ||
// Return result to calling dialog | ||
return await this.endComponent(outerDC, turnResult.result); | ||
} else { | ||
// Just signal end of turn | ||
return Dialog.EndOfTurn; | ||
} | ||
} | ||
// Just signal end of turn | ||
return Dialog.EndOfTurn; | ||
} | ||
@@ -111,2 +115,7 @@ | ||
if (turnResult.status !== DialogTurnStatus.waiting) { | ||
if (turnResult.status === DialogTurnStatus.cancelled) { | ||
await this.endComponent(outerDC, turnResult.result); | ||
const cancelledTurnResult: DialogTurnResult = { status: DialogTurnStatus.cancelled, result: turnResult.result } | ||
return cancelledTurnResult; | ||
} | ||
// Return result to calling dialog | ||
@@ -113,0 +122,0 @@ return await this.endComponent(outerDC, turnResult.result); |
@@ -123,6 +123,6 @@ /** | ||
if (o.prompt && typeof o.prompt === 'object' && typeof o.prompt.inputHint !== 'string') { | ||
o.prompt.inputHint = InputHints.ExpectingInput; | ||
o.prompt.inputHint = InputHints.AcceptingInput; | ||
} | ||
if (o.retryPrompt && typeof o.retryPrompt === 'object' && typeof o.retryPrompt.inputHint !== 'string') { | ||
o.retryPrompt.inputHint = InputHints.ExpectingInput; | ||
o.retryPrompt.inputHint = InputHints.AcceptingInput; | ||
} | ||
@@ -246,3 +246,3 @@ | ||
const msg: Partial<Activity> = | ||
typeof prompt === 'object' ? {...prompt} : MessageFactory.text(prompt, undefined, InputHints.ExpectingInput); | ||
typeof prompt === 'object' ? {...prompt} : MessageFactory.text(prompt, undefined, InputHints.AcceptingInput); | ||
if (!Array.isArray(msg.attachments)) { msg.attachments = []; } | ||
@@ -284,4 +284,14 @@ | ||
const code: any = context.activity.value.state; | ||
await context.sendActivity({ type: 'invokeResponse', value: { status: 200 }}); | ||
token = await this.getUserToken(context, code); | ||
try { | ||
token = await this.getUserToken(context, code); | ||
if (token !== undefined) { | ||
await context.sendActivity({ type: 'invokeResponse', value: { status: 200 }}); | ||
} else { | ||
await context.sendActivity({ type: 'invokeResponse', value: { status: 404 }}); | ||
} | ||
} | ||
catch | ||
{ | ||
await context.sendActivity({ type: 'invokeResponse', value: { status: 500 }}); | ||
} | ||
} else if (context.activity.type === ActivityTypes.Message) { | ||
@@ -288,0 +298,0 @@ const matched: RegExpExecArray = /(\d{6})/.exec(context.activity.text); |
Sorry, the diff of this file is not supported yet
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
407304
8364
Updatedbotbuilder-core@^4.5.0