Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

botbuilder-dialogs

Package Overview
Dependencies
Maintainers
1
Versions
543
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

botbuilder-dialogs - npm Package Compare versions

Comparing version 4.7.2 to 4.8.0-preview-109324

lib/choices/channel.d.ts.map

5

lib/choices/channel.d.ts

@@ -11,6 +11,2 @@ /**

* @private
*/
export declare const channels: any;
/**
* @private
* @param channelId the id of a channel

@@ -41,1 +37,2 @@ * @param buttonCnt count of buttons allowed

export declare function getChannelId(context: TurnContext): string;
//# sourceMappingURL=channel.d.ts.map

63

lib/choices/channel.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @private
* @module botbuilder-dialogs
*/
exports.channels = {
console: 'console',
cortana: 'cortana',
directline: 'directline',
email: 'email',
emulator: 'emulator',
facebook: 'facebook',
groupme: 'groupme',
kik: 'kik',
line: 'line',
msteams: 'msteams',
skype: 'skype',
skypeforbusiness: 'skypeforbusiness',
slack: 'slack',
sms: 'sms',
telegram: 'telegram',
webchat: 'webchat'
};
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
const botbuilder_core_1 = require("botbuilder-core");
/**
* @private

@@ -31,14 +18,14 @@ * @param channelId the id of a channel

switch (channelId) {
case exports.channels.facebook:
case exports.channels.skype:
case botbuilder_core_1.Channels.Facebook:
case botbuilder_core_1.Channels.Skype:
return (buttonCnt <= 10);
case exports.channels.line:
case botbuilder_core_1.Channels.Line:
return (buttonCnt <= 13);
case exports.channels.kik:
case botbuilder_core_1.Channels.Kik:
return (buttonCnt <= 20);
case exports.channels.slack:
case exports.channels.telegram:
case exports.channels.emulator:
case exports.channels.directline:
case exports.channels.webchat:
case botbuilder_core_1.Channels.Slack:
case botbuilder_core_1.Channels.Telegram:
case botbuilder_core_1.Channels.Emulator:
case botbuilder_core_1.Channels.Directline:
case botbuilder_core_1.Channels.Webchat:
return (buttonCnt <= 100);

@@ -57,13 +44,13 @@ default:

switch (channelId) {
case exports.channels.facebook:
case exports.channels.skype:
case exports.channels.msteams:
case botbuilder_core_1.Channels.Facebook:
case botbuilder_core_1.Channels.Skype:
case botbuilder_core_1.Channels.Msteams:
return (buttonCnt <= 3);
case exports.channels.line:
case botbuilder_core_1.Channels.Line:
return (buttonCnt <= 99);
case exports.channels.slack:
case exports.channels.emulator:
case exports.channels.directline:
case exports.channels.webchat:
case exports.channels.cortana:
case botbuilder_core_1.Channels.Slack:
case botbuilder_core_1.Channels.Emulator:
case botbuilder_core_1.Channels.Directline:
case botbuilder_core_1.Channels.Webchat:
case botbuilder_core_1.Channels.Cortana:
return (buttonCnt <= 100);

@@ -81,3 +68,3 @@ default:

switch (channelId) {
case exports.channels.cortana:
case botbuilder_core_1.Channels.Cortana:
return false;

@@ -84,0 +71,0 @@ default:

@@ -146,1 +146,2 @@ /**

}
//# sourceMappingURL=choiceFactory.d.ts.map

@@ -111,1 +111,2 @@ /**

export declare function findChoices(utterance: string, choices: (string | Choice)[], options?: FindChoicesOptions): ModelResult<FoundChoice>[];
//# sourceMappingURL=findChoices.d.ts.map

@@ -74,1 +74,2 @@ /**

export declare function findValues(utterance: string, values: SortedValue[], options?: FindValuesOptions): ModelResult<FoundValue>[];
//# sourceMappingURL=findValues.d.ts.map

@@ -8,2 +8,3 @@ /**

*/
export * from './channel';
export * from './choiceFactory';

@@ -15,1 +16,2 @@ export * from './findChoices';

export * from './tokenizer';
//# sourceMappingURL=index.d.ts.map

@@ -13,2 +13,3 @@ "use strict";

*/
__export(require("./channel"));
__export(require("./choiceFactory"));

@@ -15,0 +16,0 @@ __export(require("./findChoices"));

@@ -39,1 +39,2 @@ /**

}
//# sourceMappingURL=modelResult.d.ts.map

@@ -42,1 +42,2 @@ /**

export declare function recognizeChoices(utterance: string, choices: (string | Choice)[], options?: FindChoicesOptions): ModelResult<FoundChoice>[];
//# sourceMappingURL=recognizeChoices.d.ts.map

@@ -68,1 +68,2 @@ /**

export declare function defaultTokenizer(text: string, locale?: string): Token[];
//# sourceMappingURL=tokenizer.d.ts.map

@@ -156,1 +156,2 @@ /**

}
//# sourceMappingURL=componentDialog.d.ts.map

@@ -18,1 +18,2 @@ /**

}
//# sourceMappingURL=configurable.d.ts.map
/**
* @module botbuilder-dialogs
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.

@@ -12,12 +9,32 @@ * Licensed under the MIT License.

/**
* Tracking information persisted for an instance of a dialog on the stack.
* @param T (Optional) type of state being persisted for the dialog.
* Contains state information for an instance of a dialog on the stack.
*
* @typeparam T Optional. The type that represents state information for the dialog.
*
* @remarks
* This contains information for a specific instance of a dialog on a dialog stack.
* The dialog stack is associated with a specific dialog context and dialog set.
* Information about the dialog stack as a whole is persisted to storage using a dialog state object.
*
* **See also**
* - [DialogState](xref:botbuilder-dialogs.DialogState)
* - [DialogContext](xref:botbuilder-dialogs.DialogContext)
* - [DialogSet](xref:botbuilder-dialogs.DialogSet)
* - [Dialog](xref:botbuilder-dialogs.Dialog)
*/
export interface DialogInstance<T = any> {
/**
* ID of the dialog this instance is for.
* ID of this dialog
*
* @remarks
* Dialog state is associated with a specific dialog set.
* This ID is the the dialog's [id](xref:botbuilder-dialogs.Dialog.id) within that dialog set.
*
* **See also**
* - [DialogState](xref:botbuilder-dialogs.DialogState)
* - [DialogSet](xref:botbuilder-dialogs.DialogSet)
*/
id: string;
/**
* The instances persisted state.
* The state information for this instance of this dialog.
*/

@@ -27,27 +44,44 @@ state: T;

/**
* Codes indicating why a waterfall step is being called.
* Indicates why a dialog method is being called.
*
* @remarks
* Use a dialog context to control the dialogs in a dialog set. The dialog context will pass a reference to itself
* to the dialog method it calls. It also passes in the _reason_ why the specific method is being called.
*
* **See also**
* - [DialogContext](xref:botbuilder-dialogs.DialogContext)
* - [DialogSet](xref:botbuilder-dialogs.DialogSet)
* - [Dialog](xref:botbuilder-dialogs.Dialog)
*/
export declare enum DialogReason {
/**
* A dialog is being started through a call to `DialogContext.beginDialog()`.
* The dialog is being started from
* [DialogContext.beginDialog](xref:botbuilder-dialogs.DialogContext.beginDialog) or
* [DialogContext.replaceDialog](xref:botbuilder-dialogs.DialogContext.replaceDialog).
*/
beginCalled = "beginCalled",
/**
* A dialog is being continued through a call to `DialogContext.continueDialog()`.
* The dialog is being continued from
* [DialogContext.continueDialog](xref:botbuilder-dialogs.DialogContext.continueDialog).
*/
continueCalled = "continueCalled",
/**
* A dialog ended normally through a call to `DialogContext.endDialog()`.
* The dialog is being ended from
* [DialogContext.endDialog](xref:botbuilder-dialogs.DialogContext.endDialog).
*/
endCalled = "endCalled",
/**
* A dialog is ending because its being replaced through a call to `DialogContext.replaceDialog()`.
* The dialog is being ended from
* [DialogContext.replaceDialog](xref:botbuilder-dialogs.DialogContext.replaceDialog).
*/
replaceCalled = "replaceCalled",
/**
* A dialog was cancelled as part of a call to `DialogContext.cancelAllDialogs()`.
* The dialog is being cancelled from
* [DialogContext.cancelAllDialogs](xref:botbuilder-dialogs.DialogContext.cancelAllDialogs).
*/
cancelCalled = "cancelCalled",
/**
* A step was advanced through a call to `WaterfallStepContext.next()`.
* A step in a [WaterfallDialog](xref:botbuilder-dialogs.WaterfallDialog) is being called
* because the previous step in the waterfall dialog called
* [WaterfallStepContext.next](xref:botbuilder-dialogs.WaterfallStepContext.next).
*/

@@ -57,21 +91,33 @@ nextCalled = "nextCalled"

/**
* Codes indicating the state of the dialog stack after a call to `DialogContext.continueDialog()`
* or `DialogContext.beginDialog()`.
* Represents the state of the dialog stack after a dialog context attempts to begin, continue,
* or otherwise manipulate one or more dialogs.
*
* **See also**
* - [DialogContext](xref:botbuilder-dialogs.DialogContext)
* - [Dialog](xref:botbuilder-dialogs.Dialog)
*/
export declare enum DialogTurnStatus {
/**
* Indicates that there is currently nothing on the dialog stack.
* The dialog stack is empty.
*
* @remarks
* Indicates that the dialog stack was initially empty when the operation was attempted.
*/
empty = "empty",
/**
* Indicates that the dialog on top is waiting for a response from the user.
* The active dialog on top of the stack is waiting for a response from the user.
*/
waiting = "waiting",
/**
* Indicates that the dialog completed successfully, the result is available, and the stack is
* empty.
* The last dialog on the stack completed successfully.
*
* @remarks
* Indicates that a result might be available and the stack is now empty.
*
* **See also**
* - [DialogTurnResult.result](xref:botbuilder-dialogs.DialogTurnResult.result)
*/
complete = "complete",
/**
* Indicates that the dialog was cancelled and the stack is empty.
* All dialogs on the stack were cancelled and the stack is empty.
*/

@@ -105,21 +151,16 @@ cancelled = "cancelled"

/**
* Returned by `Dialog.continueDialog()` and `DialogContext.beginDialog()` to indicate whether a
* dialog is still active after the turn has been processed by the dialog.
* Represents the result of a dialog context's attempt to begin, continue,
* or otherwise manipulate one or more dialogs.
*
* @typeparam T Optional. The type that represents a result returned by the active dialog when it
* successfully completes.
*
* @remarks
* This can be used to determine if the dialog stack is empty:
* This can be used to determine if a dialog completed and a result is available, or if the stack
* was initially empty and a dialog should be started.
*
* ```JavaScript
* const result = await dialogContext.continueDialog();
* const dc = await dialogs.createContext(turnContext);
* const result = await dc.continueDialog();
*
* if (result.status == DialogTurnStatus.empty) {
* await dialogContext.beginDialog('helpDialog');
* }
* ```
*
* Or to access the result of a dialog that just completed:
*
* ```JavaScript
* const result = await dialogContext.continueDialog();
*
* if (result.status == DialogTurnStatus.completed) {

@@ -129,14 +170,24 @@ * const survey = result.result;

* } else if (result.status == DialogTurnStatus.empty) {
* await dialogContext.beginDialog('surveyDialog');
* await dc.beginDialog('surveyDialog');
* }
* ```
* @param T (Optional) type of result returned by the active dialog when it calls `DialogContext.endDialog()`.
*
* **See also**
* - [DialogContext](xref:botbuilder-dialogs.DialogContext)
* - [DialogSet](xref:botbuilder-dialogs.DialogSet)
* - [Dialog](xref:botbuilder-dialogs.Dialog)
*/
export interface DialogTurnResult<T = any> {
/**
* Gets or sets the current status of the stack.
* The state of the dialog stack after a dialog context's attempt.
*/
status: DialogTurnStatus;
/**
* Final result returned by a dialog that just completed. Can be `undefined` even when [hasResult](#hasResult) is true.
* The result, if any, returned by the last dialog on the stack.
*
* @remarks
* A result value is available only if
* the stack is now empty,
* the last dialog on the stack completed normally,
* and the last dialog returned a result to the dialog context.
*/

@@ -146,3 +197,3 @@ result?: T;

/**
* Base class for all dialogs.
* Defines the core behavior for all dialogs.
*/

@@ -152,3 +203,7 @@ export declare abstract class Dialog<O extends object = {}> extends Configurable {

/**
* Signals the end of a turn by a dialog method or waterfall/sequence step.
* Gets a default end-of-turn result.
*
* @remarks
* This result indicates that a dialog (or a logical step within a dialog) has completed
* processing for the current turn, is still active, and is waiting for more input.
*/

@@ -162,3 +217,4 @@ static EndOfTurn: DialogTurnResult;

/**
* Creates a new Dialog instance.
* Creates a new instance of the [Dialog](xref:botbuilder-dialogs.Dialog) class.
*
* @param dialogId Optional. unique ID of the dialog.

@@ -175,59 +231,110 @@ */

/**
* Retrieve the telemetry client for this dialog.
* Gets the telemetry client for this dialog.
*/
/**
* Set the telemetry client for this dialog.
* Sets the telemetry client for this dialog.
*/
telemetryClient: BotTelemetryClient;
/**
* Called when a new instance of the dialog has been pushed onto the stack and is being
* activated.
* When overridden in a derived class, starts the dialog.
*
* @param dc The context for the current dialog turn.
* @param options Optional. Arguments to use when the dialog starts.
*
* @remarks
* MUST be overridden by derived class. Dialogs that only support single-turn conversations
* should call `return await DialogContext.endDialog();` at the end of their implementation.
* @param dc The dialog context for the current turn of conversation.
* @param options (Optional) arguments that were passed to the dialog in the call to `DialogContext.beginDialog()`.
* Derived dialogs must override this method.
*
* The [DialogContext](xref:botbuilder-dialogs.DialogContext) calls this method when it creates
* a new [DialogInstance](xref:botbuilder-dialogs.DialogInstance) for this dialog, pushes it
* onto the dialog stack, and starts the dialog.
*
* A dialog that represents a single-turn conversation should await
* [DialogContext.endDialog](xref:botbuilder-dialogs.DialogContext.endDialog) before exiting this method.
*
* **See also**
* - [DialogContext.beginDialog](xref:botbuilder-dialogs.DialogContext.beginDialog)
* - [DialogContext.replaceDialog](xref:botbuilder-dialogs.DialogContext.replaceDialog)
*/
abstract beginDialog(dc: DialogContext, options?: O): Promise<DialogTurnResult>;
/**
* Called when an instance of the dialog is the active dialog and a new activity is received.
* When overridden in a derived class, continues the dialog.
*
* @param dc The context for the current dialog turn.
*
* @remarks
* SHOULD be overridden by dialogs that support multi-turn conversations. The default
* implementation calls `DialogContext.endDialog()`.
* @param dc The dialog context for the current turn of conversation.
* Derived dialogs that support multiple-turn conversations should override this method.
* By default, this method signals that the dialog is complete and returns.
*
* The [DialogContext](xref:botbuilder-dialogs.DialogContext) calls this method when it continues
* the dialog.
*
* To signal to the dialog context that this dialog has completed, await
* [DialogContext.endDialog](xref:botbuilder-dialogs.DialogContext.endDialog) before exiting this method.
*
* **See also**
* - [DialogContext.continueDialog](xref:botbuilder-dialogs.DialogContext.continueDialog)
*/
continueDialog(dc: DialogContext): Promise<DialogTurnResult>;
/**
* Called when an instance of the dialog is being returned to from another dialog.
* When overridden in a derived class, resumes the dialog after the dialog above it on the stack completes.
*
* @param dc The context for the current dialog turn.
* @param reason The reason the dialog is resuming. This will typically be
* [DialogReason.endCalled](xref:botbuilder-dialogs.DialogReason.endCalled)
* @param result Optional. The return value, if any, from the dialog that ended.
*
* @remarks
* SHOULD be overridden by multi-turn dialogs that start other dialogs using
* `DialogContext.beginDialog()` or `DialogContext.prompt()`. The default implementation calls
* `DialogContext.endDialog()` with any results returned from the ending dialog.
* @param dc The dialog context for the current turn of conversation.
* @param reason The reason the dialog is being resumed. This will typically be a value of `DialogReason.endCalled`.
* @param result (Optional) value returned from the dialog that was called. The type of the value returned is dependant on the dialog that was called.
* Derived dialogs that support multiple-turn conversations should override this method.
* By default, this method signals that the dialog is complete and returns.
*
* The [DialogContext](xref:botbuilder-dialogs.DialogContext) calls this method when it resumes
* the dialog. If the previous dialog on the stack returned a value, that value is in the `result`
* parameter.
*
* To start a _child_ dialog, use [DialogContext.beginDialog](xref:botbuilder-dialogs.DialogContext.beginDialog)
* or [DialogContext.prompt](xref:botbuilder-dialogs.DialogContext.prompt); however, this dialog will not
* necessarily be the one that started the child dialog.
* To signal to the dialog context that this dialog has completed, await
* [DialogContext.endDialog](xref:botbuilder-dialogs.DialogContext.endDialog) before exiting this method.
*
* **See also**
* - [DialogContext.endDialog](xref:botbuilder-dialogs.DialogContext.endDialog)
*/
resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult>;
/**
* Called when the dialog has been requested to re-prompt the user for input.
* When overridden in a derived class, reprompts the user for input.
*
* @param context The context object for the turn.
* @param instance Current state information for this dialog.
*
* @remarks
* SHOULD be overridden by multi-turn dialogs that wish to provide custom re-prompt logic. The
* default implementation performs no action.
* @param context Context for the current turn of conversation.
* @param instance The instance of the current dialog.
* Derived dialogs that support validation and re-prompt logic should override this method.
* By default, this method has no effect.
*
* The [DialogContext](xref:botbuilder-dialogs.DialogContext) calls this method when the current
* dialog should re-request input from the user. This method is implemented for prompt dialogs.
*
* **See also**
* - [DialogContext.repromptDialog](xref:botbuilder-dialogs.DialogContext.repromptDialog)
* - [Prompt](xref:botbuilder-dialogs.Prompt)
*/
repromptDialog(context: TurnContext, instance: DialogInstance): Promise<void>;
/**
* Called when the dialog is ending.
* When overridden in a derived class, performs clean up for the dialog before it ends.
*
* @param context The context object for the turn.
* @param instance Current state information for this dialog.
* @param reason The reason the dialog is ending.
*
* @remarks
* SHOULD be overridden by dialogs that wish to perform some logging or cleanup action anytime
* the dialog ends.
* @param context Context for the current turn of conversation.
* @param instance The instance of the current dialog.
* @param reason The reason the dialog is ending.
* Derived dialogs that need to perform logging or cleanup before ending should override this method.
* By default, this method has no effect.
*
* The [DialogContext](xref:botbuilder-dialogs.DialogContext) calls this method when the current
* dialog is ending.
*
* **See also**
* - [DialogContext.cancelAllDialogs](xref:botbuilder-dialogs.DialogContext.cancelAllDialogs)
* - [DialogContext.endDialog](xref:botbuilder-dialogs.DialogContext.endDialog)
* - [DialogContext.replaceDialog](xref:botbuilder-dialogs.DialogContext.replaceDialog)
*/

@@ -280,1 +387,2 @@ endDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise<void>;

}
//# sourceMappingURL=dialog.d.ts.map

@@ -12,5 +12,2 @@ "use strict";

/**
* @module botbuilder-dialogs
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.

@@ -22,3 +19,12 @@ * Licensed under the MIT License.

/**
* Codes indicating why a waterfall step is being called.
* Indicates why a dialog method is being called.
*
* @remarks
* Use a dialog context to control the dialogs in a dialog set. The dialog context will pass a reference to itself
* to the dialog method it calls. It also passes in the _reason_ why the specific method is being called.
*
* **See also**
* - [DialogContext](xref:botbuilder-dialogs.DialogContext)
* - [DialogSet](xref:botbuilder-dialogs.DialogSet)
* - [Dialog](xref:botbuilder-dialogs.Dialog)
*/

@@ -28,23 +34,31 @@ var DialogReason;

/**
* A dialog is being started through a call to `DialogContext.beginDialog()`.
* The dialog is being started from
* [DialogContext.beginDialog](xref:botbuilder-dialogs.DialogContext.beginDialog) or
* [DialogContext.replaceDialog](xref:botbuilder-dialogs.DialogContext.replaceDialog).
*/
DialogReason["beginCalled"] = "beginCalled";
/**
* A dialog is being continued through a call to `DialogContext.continueDialog()`.
* The dialog is being continued from
* [DialogContext.continueDialog](xref:botbuilder-dialogs.DialogContext.continueDialog).
*/
DialogReason["continueCalled"] = "continueCalled";
/**
* A dialog ended normally through a call to `DialogContext.endDialog()`.
* The dialog is being ended from
* [DialogContext.endDialog](xref:botbuilder-dialogs.DialogContext.endDialog).
*/
DialogReason["endCalled"] = "endCalled";
/**
* A dialog is ending because its being replaced through a call to `DialogContext.replaceDialog()`.
* The dialog is being ended from
* [DialogContext.replaceDialog](xref:botbuilder-dialogs.DialogContext.replaceDialog).
*/
DialogReason["replaceCalled"] = "replaceCalled";
/**
* A dialog was cancelled as part of a call to `DialogContext.cancelAllDialogs()`.
* The dialog is being cancelled from
* [DialogContext.cancelAllDialogs](xref:botbuilder-dialogs.DialogContext.cancelAllDialogs).
*/
DialogReason["cancelCalled"] = "cancelCalled";
/**
* A step was advanced through a call to `WaterfallStepContext.next()`.
* A step in a [WaterfallDialog](xref:botbuilder-dialogs.WaterfallDialog) is being called
* because the previous step in the waterfall dialog called
* [WaterfallStepContext.next](xref:botbuilder-dialogs.WaterfallStepContext.next).
*/

@@ -54,4 +68,8 @@ DialogReason["nextCalled"] = "nextCalled";

/**
* Codes indicating the state of the dialog stack after a call to `DialogContext.continueDialog()`
* or `DialogContext.beginDialog()`.
* Represents the state of the dialog stack after a dialog context attempts to begin, continue,
* or otherwise manipulate one or more dialogs.
*
* **See also**
* - [DialogContext](xref:botbuilder-dialogs.DialogContext)
* - [Dialog](xref:botbuilder-dialogs.Dialog)
*/

@@ -61,16 +79,24 @@ var DialogTurnStatus;

/**
* Indicates that there is currently nothing on the dialog stack.
* The dialog stack is empty.
*
* @remarks
* Indicates that the dialog stack was initially empty when the operation was attempted.
*/
DialogTurnStatus["empty"] = "empty";
/**
* Indicates that the dialog on top is waiting for a response from the user.
* The active dialog on top of the stack is waiting for a response from the user.
*/
DialogTurnStatus["waiting"] = "waiting";
/**
* Indicates that the dialog completed successfully, the result is available, and the stack is
* empty.
* The last dialog on the stack completed successfully.
*
* @remarks
* Indicates that a result might be available and the stack is now empty.
*
* **See also**
* - [DialogTurnResult.result](xref:botbuilder-dialogs.DialogTurnResult.result)
*/
DialogTurnStatus["complete"] = "complete";
/**
* Indicates that the dialog was cancelled and the stack is empty.
* All dialogs on the stack were cancelled and the stack is empty.
*/

@@ -80,7 +106,8 @@ DialogTurnStatus["cancelled"] = "cancelled";

/**
* Base class for all dialogs.
* Defines the core behavior for all dialogs.
*/
class Dialog extends configurable_1.Configurable {
/**
* Creates a new Dialog instance.
* Creates a new instance of the [Dialog](xref:botbuilder-dialogs.Dialog) class.
*
* @param dialogId Optional. unique ID of the dialog.

@@ -113,3 +140,3 @@ */

/**
* Retrieve the telemetry client for this dialog.
* Gets the telemetry client for this dialog.
*/

@@ -120,3 +147,3 @@ get telemetryClient() {

/**
* Set the telemetry client for this dialog.
* Sets the telemetry client for this dialog.
*/

@@ -127,8 +154,18 @@ set telemetryClient(client) {

/**
* Called when an instance of the dialog is the active dialog and a new activity is received.
* When overridden in a derived class, continues the dialog.
*
* @param dc The context for the current dialog turn.
*
* @remarks
* SHOULD be overridden by dialogs that support multi-turn conversations. The default
* implementation calls `DialogContext.endDialog()`.
* @param dc The dialog context for the current turn of conversation.
* Derived dialogs that support multiple-turn conversations should override this method.
* By default, this method signals that the dialog is complete and returns.
*
* The [DialogContext](xref:botbuilder-dialogs.DialogContext) calls this method when it continues
* the dialog.
*
* To signal to the dialog context that this dialog has completed, await
* [DialogContext.endDialog](xref:botbuilder-dialogs.DialogContext.endDialog) before exiting this method.
*
* **See also**
* - [DialogContext.continueDialog](xref:botbuilder-dialogs.DialogContext.continueDialog)
*/

@@ -142,11 +179,25 @@ continueDialog(dc) {

/**
* Called when an instance of the dialog is being returned to from another dialog.
* When overridden in a derived class, resumes the dialog after the dialog above it on the stack completes.
*
* @param dc The context for the current dialog turn.
* @param reason The reason the dialog is resuming. This will typically be
* [DialogReason.endCalled](xref:botbuilder-dialogs.DialogReason.endCalled)
* @param result Optional. The return value, if any, from the dialog that ended.
*
* @remarks
* SHOULD be overridden by multi-turn dialogs that start other dialogs using
* `DialogContext.beginDialog()` or `DialogContext.prompt()`. The default implementation calls
* `DialogContext.endDialog()` with any results returned from the ending dialog.
* @param dc The dialog context for the current turn of conversation.
* @param reason The reason the dialog is being resumed. This will typically be a value of `DialogReason.endCalled`.
* @param result (Optional) value returned from the dialog that was called. The type of the value returned is dependant on the dialog that was called.
* Derived dialogs that support multiple-turn conversations should override this method.
* By default, this method signals that the dialog is complete and returns.
*
* The [DialogContext](xref:botbuilder-dialogs.DialogContext) calls this method when it resumes
* the dialog. If the previous dialog on the stack returned a value, that value is in the `result`
* parameter.
*
* To start a _child_ dialog, use [DialogContext.beginDialog](xref:botbuilder-dialogs.DialogContext.beginDialog)
* or [DialogContext.prompt](xref:botbuilder-dialogs.DialogContext.prompt); however, this dialog will not
* necessarily be the one that started the child dialog.
* To signal to the dialog context that this dialog has completed, await
* [DialogContext.endDialog](xref:botbuilder-dialogs.DialogContext.endDialog) before exiting this method.
*
* **See also**
* - [DialogContext.endDialog](xref:botbuilder-dialogs.DialogContext.endDialog)
*/

@@ -160,9 +211,17 @@ resumeDialog(dc, reason, result) {

/**
* Called when the dialog has been requested to re-prompt the user for input.
* When overridden in a derived class, reprompts the user for input.
*
* @param context The context object for the turn.
* @param instance Current state information for this dialog.
*
* @remarks
* SHOULD be overridden by multi-turn dialogs that wish to provide custom re-prompt logic. The
* default implementation performs no action.
* @param context Context for the current turn of conversation.
* @param instance The instance of the current dialog.
* Derived dialogs that support validation and re-prompt logic should override this method.
* By default, this method has no effect.
*
* The [DialogContext](xref:botbuilder-dialogs.DialogContext) calls this method when the current
* dialog should re-request input from the user. This method is implemented for prompt dialogs.
*
* **See also**
* - [DialogContext.repromptDialog](xref:botbuilder-dialogs.DialogContext.repromptDialog)
* - [Prompt](xref:botbuilder-dialogs.Prompt)
*/

@@ -175,10 +234,19 @@ repromptDialog(context, instance) {

/**
* Called when the dialog is ending.
* When overridden in a derived class, performs clean up for the dialog before it ends.
*
* @param context The context object for the turn.
* @param instance Current state information for this dialog.
* @param reason The reason the dialog is ending.
*
* @remarks
* SHOULD be overridden by dialogs that wish to perform some logging or cleanup action anytime
* the dialog ends.
* @param context Context for the current turn of conversation.
* @param instance The instance of the current dialog.
* @param reason The reason the dialog is ending.
* Derived dialogs that need to perform logging or cleanup before ending should override this method.
* By default, this method has no effect.
*
* The [DialogContext](xref:botbuilder-dialogs.DialogContext) calls this method when the current
* dialog is ending.
*
* **See also**
* - [DialogContext.cancelAllDialogs](xref:botbuilder-dialogs.DialogContext.cancelAllDialogs)
* - [DialogContext.endDialog](xref:botbuilder-dialogs.DialogContext.endDialog)
* - [DialogContext.replaceDialog](xref:botbuilder-dialogs.DialogContext.replaceDialog)
*/

@@ -279,3 +347,7 @@ endDialog(context, instance, reason) {

/**
* Signals the end of a turn by a dialog method or waterfall/sequence step.
* Gets a default end-of-turn result.
*
* @remarks
* This result indicates that a dialog (or a logical step within a dialog) has completed
* processing for the current turn, is still active, and is waiting for more input.
*/

@@ -282,0 +354,0 @@ Dialog.EndOfTurn = { status: DialogTurnStatus.waiting };

@@ -28,1 +28,2 @@ /**

}
//# sourceMappingURL=dialogContainer.d.ts.map

@@ -34,5 +34,7 @@ /**

*
* Use a dialog set's [createContext](xref:botbuilder-dialogs.DialogSet.createContext) method to create the dialog context.
* Use the methods of the dialog context to manage the progression of dialogs in the set.
* From code outside of a dialog in the set, use [DialogSet.createContext](xref:botbuilder-dialogs.DialogSet.createContext)
* to create the dialog context. Then use the methods of the dialog context to manage the progression of dialogs in the set.
*
* When you implement a dialog, the dialog context is a parameter available to the various methods you override or implement.
*
* For example:

@@ -199,3 +201,4 @@ * ```JavaScript

* @param result Optional. A result to pass to the parent logic. This might be the next dialog
* on the stack, or it might be the bot's turn handler, if this was the last dialog on the stack.
* on the stack, or if this was the last dialog on the stack, a parent dialog context or
* the bot's turn handler.
*

@@ -262,1 +265,2 @@ * @remarks

}
//# sourceMappingURL=dialogContext.d.ts.map

@@ -25,5 +25,7 @@ "use strict";

*
* Use a dialog set's [createContext](xref:botbuilder-dialogs.DialogSet.createContext) method to create the dialog context.
* Use the methods of the dialog context to manage the progression of dialogs in the set.
* From code outside of a dialog in the set, use [DialogSet.createContext](xref:botbuilder-dialogs.DialogSet.createContext)
* to create the dialog context. Then use the methods of the dialog context to manage the progression of dialogs in the set.
*
* When you implement a dialog, the dialog context is a parameter available to the various methods you override or implement.
*
* For example:

@@ -263,3 +265,4 @@ * ```JavaScript

* @param result Optional. A result to pass to the parent logic. This might be the next dialog
* on the stack, or it might be the bot's turn handler, if this was the last dialog on the stack.
* on the stack, or if this was the last dialog on the stack, a parent dialog context or
* the bot's turn handler.
*

@@ -266,0 +269,0 @@ * @remarks

@@ -15,1 +15,2 @@ /**

}
//# sourceMappingURL=dialogEvents.d.ts.map

@@ -116,1 +116,2 @@ /**

}
//# sourceMappingURL=dialogSet.d.ts.map

@@ -10,2 +10,3 @@ /**

declare const English: any;
declare const French: any;
declare const German: any;

@@ -18,2 +19,3 @@ declare const Dutch: any;

declare const Spanish: any;
export { Chinese, English, German, Dutch, Japanese, LikelySubtags, NumberingSystem, Portuguese, Spanish };
export { Chinese, English, French, German, Dutch, Japanese, LikelySubtags, NumberingSystem, Portuguese, Spanish };
//# sourceMappingURL=i18n.d.ts.map

@@ -14,2 +14,4 @@ "use strict";

exports.English = English;
const French = require('../vendor/cldr-data/main/fr/numbers.json');
exports.French = French;
const German = require('../vendor/cldr-data/main/de/numbers.json');

@@ -16,0 +18,0 @@ exports.German = German;

@@ -20,1 +20,2 @@ /**

export * from './waterfallStepContext';
//# sourceMappingURL=index.d.ts.map

@@ -108,1 +108,2 @@ /**

}
//# sourceMappingURL=dialogStateManager.d.ts.map

@@ -11,1 +11,2 @@ /**

export * from './dialogStateManager';
//# sourceMappingURL=index.d.ts.map

@@ -19,1 +19,2 @@ /**

}
//# sourceMappingURL=aliasPathResolver.d.ts.map

@@ -15,1 +15,2 @@ /**

}
//# sourceMappingURL=atAtPathResolver.d.ts.map

@@ -16,1 +16,2 @@ /**

}
//# sourceMappingURL=atPathResolver.d.ts.map

@@ -15,1 +15,2 @@ /**

}
//# sourceMappingURL=dollarPathResolver.d.ts.map

@@ -15,1 +15,2 @@ /**

}
//# sourceMappingURL=hashPathResolver.d.ts.map

@@ -15,1 +15,2 @@ /**

export * from './percentPathResolver';
//# sourceMappingURL=index.d.ts.map

@@ -16,1 +16,2 @@ /**

}
//# sourceMappingURL=pathResolver.d.ts.map

@@ -15,1 +15,2 @@ /**

}
//# sourceMappingURL=percentPathResolver.d.ts.map

@@ -24,1 +24,2 @@ /**

}
//# sourceMappingURL=botStateMemoryScope.d.ts.map

@@ -17,1 +17,2 @@ /**

}
//# sourceMappingURL=classMemoryScope.d.ts.map

@@ -16,1 +16,2 @@ /**

}
//# sourceMappingURL=conversationMemoryScope.d.ts.map

@@ -19,1 +19,2 @@ /**

}
//# sourceMappingURL=dialogMemoryScope.d.ts.map

@@ -17,1 +17,2 @@ /**

export * from './userMemoryScope';
//# sourceMappingURL=index.d.ts.map

@@ -50,1 +50,2 @@ /**

}
//# sourceMappingURL=memoryScope.d.ts.map

@@ -17,1 +17,2 @@ /**

}
//# sourceMappingURL=scopePath.d.ts.map

@@ -17,1 +17,2 @@ /**

}
//# sourceMappingURL=settingsMemoryScope.d.ts.map

@@ -18,1 +18,2 @@ /**

}
//# sourceMappingURL=thisMemoryScope.d.ts.map

@@ -18,1 +18,2 @@ /**

}
//# sourceMappingURL=turnMemoryScope.d.ts.map

@@ -16,1 +16,2 @@ /**

}
//# sourceMappingURL=userMemoryScope.d.ts.map

@@ -35,1 +35,2 @@ /**

}
//# sourceMappingURL=activityPrompt.d.ts.map

@@ -26,1 +26,2 @@ /**

}
//# sourceMappingURL=attachmentPrompt.d.ts.map

@@ -61,1 +61,2 @@ /**

export {};
//# sourceMappingURL=choicePrompt.d.ts.map

@@ -56,1 +56,2 @@ import { TurnContext } from 'botbuilder-core';

export {};
//# sourceMappingURL=confirmPrompt.d.ts.map

@@ -43,1 +43,2 @@ import { TurnContext } from 'botbuilder-core';

}
//# sourceMappingURL=datetimePrompt.d.ts.map

@@ -18,1 +18,2 @@ /**

export * from './promptCultureModels';
//# sourceMappingURL=index.d.ts.map

@@ -25,1 +25,2 @@ import { TurnContext } from 'botbuilder-core';

}
//# sourceMappingURL=numberPrompt.d.ts.map

@@ -23,3 +23,3 @@ "use strict";

const Globalize = require("globalize");
Globalize.load(i18n_1.Chinese, i18n_1.English, i18n_1.Dutch, i18n_1.German, i18n_1.Japanese, i18n_1.LikelySubtags, i18n_1.NumberingSystem, i18n_1.Portuguese, i18n_1.Spanish);
Globalize.load(i18n_1.Chinese, i18n_1.English, i18n_1.Dutch, i18n_1.French, i18n_1.German, i18n_1.Japanese, i18n_1.LikelySubtags, i18n_1.NumberingSystem, i18n_1.Portuguese, i18n_1.Spanish);
/**

@@ -26,0 +26,0 @@ * Prompts a user to enter a number.

@@ -141,1 +141,2 @@ /**

}
//# sourceMappingURL=oauthPrompt.d.ts.map

@@ -20,3 +20,2 @@ "use strict";

const dialog_1 = require("../dialog");
const channel_1 = require("../choices/channel");
const skillsHelpers_1 = require("./skillsHelpers");

@@ -311,6 +310,6 @@ /**

switch (channelId) {
case channel_1.channels.msteams:
case channel_1.channels.cortana:
case channel_1.channels.skype:
case channel_1.channels.skypeforbusiness:
case botbuilder_core_1.Channels.Msteams:
case botbuilder_core_1.Channels.Cortana:
case botbuilder_core_1.Channels.Skype:
case botbuilder_core_1.Channels.Skypeforbusiness:
return false;

@@ -317,0 +316,0 @@ default:

@@ -188,1 +188,2 @@ /**

}
//# sourceMappingURL=prompt.d.ts.map

@@ -48,2 +48,3 @@ export interface PromptCultureModel {

static German: PromptCultureModel;
static Italian: PromptCultureModel;
static Japanese: PromptCultureModel;

@@ -63,1 +64,2 @@ static Portuguese: PromptCultureModel;

}
//# sourceMappingURL=promptCultureModels.d.ts.map

@@ -74,2 +74,10 @@ "use strict";

};
PromptCultureModels.Italian = {
locale: recognizers_text_suite_1.Culture.Italian,
separator: ', ',
inlineOr: ' o ',
inlineOrMore: ' o ',
yesInLanguage: 'Si',
noInLanguage: 'No',
};
PromptCultureModels.Japanese = {

@@ -105,2 +113,3 @@ locale: recognizers_text_suite_1.Culture.Japanese,

PromptCultureModels.German,
PromptCultureModels.Italian,
PromptCultureModels.Japanese,

@@ -107,0 +116,0 @@ PromptCultureModels.Portuguese,

@@ -49,1 +49,2 @@ /**

}[]): string;
//# sourceMappingURL=skillsHelpers.d.ts.map

@@ -26,1 +26,2 @@ /**

}
//# sourceMappingURL=textPrompt.d.ts.map

@@ -132,3 +132,3 @@ import { TurnContext } from 'botbuilder-core';

protected onStep(step: WaterfallStepContext<O>): Promise<DialogTurnResult>;
private runStep;
protected runStep(dc: DialogContext, index: number, reason: DialogReason, result?: any): Promise<DialogTurnResult>;
/**

@@ -144,1 +144,2 @@ * Called when the dialog is ending.

}
//# sourceMappingURL=waterfallDialog.d.ts.map

@@ -237,3 +237,3 @@ "use strict";

else if (reason === dialog_1.DialogReason.cancelCalled) {
var index = instance.state[state.stepIndex];
var index = state.stepIndex;
var stepName = this.waterfallStepName(index);

@@ -240,0 +240,0 @@ this.telemetryClient.trackEvent({ name: 'WaterfallCancel', properties: {

@@ -86,1 +86,2 @@ /**

}
//# sourceMappingURL=waterfallStepContext.d.ts.map

@@ -5,3 +5,3 @@ {

"description": "A dialog stack based conversation manager for Microsoft BotBuilder.",
"version": "4.7.2",
"version": "4.8.0-preview-109324",
"license": "MIT",

@@ -29,3 +29,3 @@ "keywords": [

"@types/node": "^10.12.18",
"botbuilder-core": "4.7.2",
"botbuilder-core": "4.8.0-preview-109324",
"globalize": "^1.4.2"

@@ -47,3 +47,3 @@ },

"clean": "erase /q /s .\\lib",
"set-version": "npm version --allow-same-version 4.7.2"
"set-version": "npm version --allow-same-version 4.8.0-preview-109324"
},

@@ -50,0 +50,0 @@ "files": [

@@ -8,28 +8,6 @@ /**

*/
import { TurnContext } from 'botbuilder-core';
import { Channels, TurnContext } from 'botbuilder-core';
/**
* @private
*/
export const channels: any = {
console: 'console',
cortana: 'cortana',
directline: 'directline',
email: 'email',
emulator: 'emulator',
facebook: 'facebook',
groupme: 'groupme',
kik: 'kik',
line: 'line',
msteams: 'msteams',
skype: 'skype',
skypeforbusiness: 'skypeforbusiness',
slack: 'slack',
sms: 'sms',
telegram: 'telegram',
webchat: 'webchat'
};
/**
* @private
* @param channelId the id of a channel

@@ -40,14 +18,14 @@ * @param buttonCnt count of buttons allowed

switch (channelId) {
case channels.facebook:
case channels.skype:
case Channels.Facebook:
case Channels.Skype:
return (buttonCnt <= 10);
case channels.line:
case Channels.Line:
return (buttonCnt <= 13);
case channels.kik:
case Channels.Kik:
return (buttonCnt <= 20);
case channels.slack:
case channels.telegram:
case channels.emulator:
case channels.directline:
case channels.webchat:
case Channels.Slack:
case Channels.Telegram:
case Channels.Emulator:
case Channels.Directline:
case Channels.Webchat:
return (buttonCnt <= 100);

@@ -66,13 +44,13 @@ default:

switch (channelId) {
case channels.facebook:
case channels.skype:
case channels.msteams:
case Channels.Facebook:
case Channels.Skype:
case Channels.Msteams:
return (buttonCnt <= 3);
case channels.line:
case Channels.Line:
return (buttonCnt <= 99);
case channels.slack:
case channels.emulator:
case channels.directline:
case channels.webchat:
case channels.cortana:
case Channels.Slack:
case Channels.Emulator:
case Channels.Directline:
case Channels.Webchat:
case Channels.Cortana:
return (buttonCnt <= 100);

@@ -90,3 +68,3 @@ default:

switch (channelId) {
case channels.cortana:
case Channels.Cortana:
return false;

@@ -93,0 +71,0 @@ default:

@@ -8,2 +8,3 @@ /**

*/
export * from './channel';
export * from './choiceFactory';

@@ -10,0 +11,0 @@ export * from './findChoices';

/**
* @module botbuilder-dialogs
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.

@@ -13,8 +10,28 @@ * Licensed under the MIT License.

/**
* Tracking information persisted for an instance of a dialog on the stack.
* @param T (Optional) type of state being persisted for the dialog.
* Contains state information for an instance of a dialog on the stack.
*
* @typeparam T Optional. The type that represents state information for the dialog.
*
* @remarks
* This contains information for a specific instance of a dialog on a dialog stack.
* The dialog stack is associated with a specific dialog context and dialog set.
* Information about the dialog stack as a whole is persisted to storage using a dialog state object.
*
* **See also**
* - [DialogState](xref:botbuilder-dialogs.DialogState)
* - [DialogContext](xref:botbuilder-dialogs.DialogContext)
* - [DialogSet](xref:botbuilder-dialogs.DialogSet)
* - [Dialog](xref:botbuilder-dialogs.Dialog)
*/
export interface DialogInstance<T = any> {
/**
* ID of the dialog this instance is for.
* ID of this dialog
*
* @remarks
* Dialog state is associated with a specific dialog set.
* This ID is the the dialog's [id](xref:botbuilder-dialogs.Dialog.id) within that dialog set.
*
* **See also**
* - [DialogState](xref:botbuilder-dialogs.DialogState)
* - [DialogSet](xref:botbuilder-dialogs.DialogSet)
*/

@@ -24,3 +41,3 @@ id: string;

/**
* The instances persisted state.
* The state information for this instance of this dialog.
*/

@@ -31,7 +48,18 @@ state: T;

/**
* Codes indicating why a waterfall step is being called.
* Indicates why a dialog method is being called.
*
* @remarks
* Use a dialog context to control the dialogs in a dialog set. The dialog context will pass a reference to itself
* to the dialog method it calls. It also passes in the _reason_ why the specific method is being called.
*
* **See also**
* - [DialogContext](xref:botbuilder-dialogs.DialogContext)
* - [DialogSet](xref:botbuilder-dialogs.DialogSet)
* - [Dialog](xref:botbuilder-dialogs.Dialog)
*/
export enum DialogReason {
/**
* A dialog is being started through a call to `DialogContext.beginDialog()`.
* The dialog is being started from
* [DialogContext.beginDialog](xref:botbuilder-dialogs.DialogContext.beginDialog) or
* [DialogContext.replaceDialog](xref:botbuilder-dialogs.DialogContext.replaceDialog).
*/

@@ -41,3 +69,4 @@ beginCalled = 'beginCalled',

/**
* A dialog is being continued through a call to `DialogContext.continueDialog()`.
* The dialog is being continued from
* [DialogContext.continueDialog](xref:botbuilder-dialogs.DialogContext.continueDialog).
*/

@@ -47,3 +76,4 @@ continueCalled = 'continueCalled',

/**
* A dialog ended normally through a call to `DialogContext.endDialog()`.
* The dialog is being ended from
* [DialogContext.endDialog](xref:botbuilder-dialogs.DialogContext.endDialog).
*/

@@ -53,3 +83,4 @@ endCalled = 'endCalled',

/**
* A dialog is ending because its being replaced through a call to `DialogContext.replaceDialog()`.
* The dialog is being ended from
* [DialogContext.replaceDialog](xref:botbuilder-dialogs.DialogContext.replaceDialog).
*/

@@ -59,3 +90,4 @@ replaceCalled = 'replaceCalled',

/**
* A dialog was cancelled as part of a call to `DialogContext.cancelAllDialogs()`.
* The dialog is being cancelled from
* [DialogContext.cancelAllDialogs](xref:botbuilder-dialogs.DialogContext.cancelAllDialogs).
*/

@@ -65,3 +97,5 @@ cancelCalled = 'cancelCalled',

/**
* A step was advanced through a call to `WaterfallStepContext.next()`.
* A step in a [WaterfallDialog](xref:botbuilder-dialogs.WaterfallDialog) is being called
* because the previous step in the waterfall dialog called
* [WaterfallStepContext.next](xref:botbuilder-dialogs.WaterfallStepContext.next).
*/

@@ -72,8 +106,15 @@ nextCalled = 'nextCalled'

/**
* Codes indicating the state of the dialog stack after a call to `DialogContext.continueDialog()`
* or `DialogContext.beginDialog()`.
* Represents the state of the dialog stack after a dialog context attempts to begin, continue,
* or otherwise manipulate one or more dialogs.
*
* **See also**
* - [DialogContext](xref:botbuilder-dialogs.DialogContext)
* - [Dialog](xref:botbuilder-dialogs.Dialog)
*/
export enum DialogTurnStatus {
/**
* Indicates that there is currently nothing on the dialog stack.
* The dialog stack is empty.
*
* @remarks
* Indicates that the dialog stack was initially empty when the operation was attempted.
*/

@@ -83,3 +124,3 @@ empty = 'empty',

/**
* Indicates that the dialog on top is waiting for a response from the user.
* The active dialog on top of the stack is waiting for a response from the user.
*/

@@ -89,4 +130,9 @@ waiting = 'waiting',

/**
* Indicates that the dialog completed successfully, the result is available, and the stack is
* empty.
* The last dialog on the stack completed successfully.
*
* @remarks
* Indicates that a result might be available and the stack is now empty.
*
* **See also**
* - [DialogTurnResult.result](xref:botbuilder-dialogs.DialogTurnResult.result)
*/

@@ -96,3 +142,3 @@ complete = 'complete',

/**
* Indicates that the dialog was cancelled and the stack is empty.
* All dialogs on the stack were cancelled and the stack is empty.
*/

@@ -132,21 +178,16 @@ cancelled = 'cancelled'

/**
* Returned by `Dialog.continueDialog()` and `DialogContext.beginDialog()` to indicate whether a
* dialog is still active after the turn has been processed by the dialog.
* Represents the result of a dialog context's attempt to begin, continue,
* or otherwise manipulate one or more dialogs.
*
* @typeparam T Optional. The type that represents a result returned by the active dialog when it
* successfully completes.
*
* @remarks
* This can be used to determine if the dialog stack is empty:
* This can be used to determine if a dialog completed and a result is available, or if the stack
* was initially empty and a dialog should be started.
*
* ```JavaScript
* const result = await dialogContext.continueDialog();
* const dc = await dialogs.createContext(turnContext);
* const result = await dc.continueDialog();
*
* if (result.status == DialogTurnStatus.empty) {
* await dialogContext.beginDialog('helpDialog');
* }
* ```
*
* Or to access the result of a dialog that just completed:
*
* ```JavaScript
* const result = await dialogContext.continueDialog();
*
* if (result.status == DialogTurnStatus.completed) {

@@ -156,10 +197,14 @@ * const survey = result.result;

* } else if (result.status == DialogTurnStatus.empty) {
* await dialogContext.beginDialog('surveyDialog');
* await dc.beginDialog('surveyDialog');
* }
* ```
* @param T (Optional) type of result returned by the active dialog when it calls `DialogContext.endDialog()`.
*
* **See also**
* - [DialogContext](xref:botbuilder-dialogs.DialogContext)
* - [DialogSet](xref:botbuilder-dialogs.DialogSet)
* - [Dialog](xref:botbuilder-dialogs.Dialog)
*/
export interface DialogTurnResult<T = any> {
/**
* Gets or sets the current status of the stack.
* The state of the dialog stack after a dialog context's attempt.
*/

@@ -169,3 +214,9 @@ status: DialogTurnStatus;

/**
* Final result returned by a dialog that just completed. Can be `undefined` even when [hasResult](#hasResult) is true.
* The result, if any, returned by the last dialog on the stack.
*
* @remarks
* A result value is available only if
* the stack is now empty,
* the last dialog on the stack completed normally,
* and the last dialog returned a result to the dialog context.
*/

@@ -176,3 +227,3 @@ result?: T;

/**
* Base class for all dialogs.
* Defines the core behavior for all dialogs.
*/

@@ -183,3 +234,7 @@ export abstract class Dialog<O extends object = {}> extends Configurable {

/**
* Signals the end of a turn by a dialog method or waterfall/sequence step.
* Gets a default end-of-turn result.
*
* @remarks
* This result indicates that a dialog (or a logical step within a dialog) has completed
* processing for the current turn, is still active, and is waiting for more input.
*/

@@ -195,3 +250,4 @@ public static EndOfTurn: DialogTurnResult = { status: DialogTurnStatus.waiting };

/**
* Creates a new Dialog instance.
* Creates a new instance of the [Dialog](xref:botbuilder-dialogs.Dialog) class.
*
* @param dialogId Optional. unique ID of the dialog.

@@ -222,3 +278,3 @@ */

/**
* Retrieve the telemetry client for this dialog.
* Gets the telemetry client for this dialog.
*/

@@ -230,3 +286,3 @@ public get telemetryClient(): BotTelemetryClient {

/**
* Set the telemetry client for this dialog.
* Sets the telemetry client for this dialog.
*/

@@ -237,12 +293,21 @@ public set telemetryClient(client: BotTelemetryClient) {

/**
* Called when a new instance of the dialog has been pushed onto the stack and is being
* activated.
* When overridden in a derived class, starts the dialog.
*
* @param dc The context for the current dialog turn.
* @param options Optional. Arguments to use when the dialog starts.
*
* @remarks
* MUST be overridden by derived class. Dialogs that only support single-turn conversations
* should call `return await DialogContext.endDialog();` at the end of their implementation.
* @param dc The dialog context for the current turn of conversation.
* @param options (Optional) arguments that were passed to the dialog in the call to `DialogContext.beginDialog()`.
* Derived dialogs must override this method.
*
* The [DialogContext](xref:botbuilder-dialogs.DialogContext) calls this method when it creates
* a new [DialogInstance](xref:botbuilder-dialogs.DialogInstance) for this dialog, pushes it
* onto the dialog stack, and starts the dialog.
*
* A dialog that represents a single-turn conversation should await
* [DialogContext.endDialog](xref:botbuilder-dialogs.DialogContext.endDialog) before exiting this method.
*
* **See also**
* - [DialogContext.beginDialog](xref:botbuilder-dialogs.DialogContext.beginDialog)
* - [DialogContext.replaceDialog](xref:botbuilder-dialogs.DialogContext.replaceDialog)
*/

@@ -252,8 +317,18 @@ public abstract beginDialog(dc: DialogContext, options?: O): Promise<DialogTurnResult>;

/**
* Called when an instance of the dialog is the active dialog and a new activity is received.
* When overridden in a derived class, continues the dialog.
*
* @param dc The context for the current dialog turn.
*
* @remarks
* SHOULD be overridden by dialogs that support multi-turn conversations. The default
* implementation calls `DialogContext.endDialog()`.
* @param dc The dialog context for the current turn of conversation.
* Derived dialogs that support multiple-turn conversations should override this method.
* By default, this method signals that the dialog is complete and returns.
*
* The [DialogContext](xref:botbuilder-dialogs.DialogContext) calls this method when it continues
* the dialog.
*
* To signal to the dialog context that this dialog has completed, await
* [DialogContext.endDialog](xref:botbuilder-dialogs.DialogContext.endDialog) before exiting this method.
*
* **See also**
* - [DialogContext.continueDialog](xref:botbuilder-dialogs.DialogContext.continueDialog)
*/

@@ -266,11 +341,25 @@ public async continueDialog(dc: DialogContext): Promise<DialogTurnResult> {

/**
* Called when an instance of the dialog is being returned to from another dialog.
* When overridden in a derived class, resumes the dialog after the dialog above it on the stack completes.
*
* @param dc The context for the current dialog turn.
* @param reason The reason the dialog is resuming. This will typically be
* [DialogReason.endCalled](xref:botbuilder-dialogs.DialogReason.endCalled)
* @param result Optional. The return value, if any, from the dialog that ended.
*
* @remarks
* SHOULD be overridden by multi-turn dialogs that start other dialogs using
* `DialogContext.beginDialog()` or `DialogContext.prompt()`. The default implementation calls
* `DialogContext.endDialog()` with any results returned from the ending dialog.
* @param dc The dialog context for the current turn of conversation.
* @param reason The reason the dialog is being resumed. This will typically be a value of `DialogReason.endCalled`.
* @param result (Optional) value returned from the dialog that was called. The type of the value returned is dependant on the dialog that was called.
* Derived dialogs that support multiple-turn conversations should override this method.
* By default, this method signals that the dialog is complete and returns.
*
* The [DialogContext](xref:botbuilder-dialogs.DialogContext) calls this method when it resumes
* the dialog. If the previous dialog on the stack returned a value, that value is in the `result`
* parameter.
*
* To start a _child_ dialog, use [DialogContext.beginDialog](xref:botbuilder-dialogs.DialogContext.beginDialog)
* or [DialogContext.prompt](xref:botbuilder-dialogs.DialogContext.prompt); however, this dialog will not
* necessarily be the one that started the child dialog.
* To signal to the dialog context that this dialog has completed, await
* [DialogContext.endDialog](xref:botbuilder-dialogs.DialogContext.endDialog) before exiting this method.
*
* **See also**
* - [DialogContext.endDialog](xref:botbuilder-dialogs.DialogContext.endDialog)
*/

@@ -283,9 +372,17 @@ public async resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult> {

/**
* Called when the dialog has been requested to re-prompt the user for input.
* When overridden in a derived class, reprompts the user for input.
*
* @param context The context object for the turn.
* @param instance Current state information for this dialog.
*
* @remarks
* SHOULD be overridden by multi-turn dialogs that wish to provide custom re-prompt logic. The
* default implementation performs no action.
* @param context Context for the current turn of conversation.
* @param instance The instance of the current dialog.
* Derived dialogs that support validation and re-prompt logic should override this method.
* By default, this method has no effect.
*
* The [DialogContext](xref:botbuilder-dialogs.DialogContext) calls this method when the current
* dialog should re-request input from the user. This method is implemented for prompt dialogs.
*
* **See also**
* - [DialogContext.repromptDialog](xref:botbuilder-dialogs.DialogContext.repromptDialog)
* - [Prompt](xref:botbuilder-dialogs.Prompt)
*/

@@ -297,10 +394,19 @@ public async repromptDialog(context: TurnContext, instance: DialogInstance): Promise<void> {

/**
* Called when the dialog is ending.
* When overridden in a derived class, performs clean up for the dialog before it ends.
*
* @param context The context object for the turn.
* @param instance Current state information for this dialog.
* @param reason The reason the dialog is ending.
*
* @remarks
* SHOULD be overridden by dialogs that wish to perform some logging or cleanup action anytime
* the dialog ends.
* @param context Context for the current turn of conversation.
* @param instance The instance of the current dialog.
* @param reason The reason the dialog is ending.
* Derived dialogs that need to perform logging or cleanup before ending should override this method.
* By default, this method has no effect.
*
* The [DialogContext](xref:botbuilder-dialogs.DialogContext) calls this method when the current
* dialog is ending.
*
* **See also**
* - [DialogContext.cancelAllDialogs](xref:botbuilder-dialogs.DialogContext.cancelAllDialogs)
* - [DialogContext.endDialog](xref:botbuilder-dialogs.DialogContext.endDialog)
* - [DialogContext.replaceDialog](xref:botbuilder-dialogs.DialogContext.replaceDialog)
*/

@@ -307,0 +413,0 @@ public async endDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise<void> {

@@ -43,4 +43,6 @@ /**

*
* Use a dialog set's [createContext](xref:botbuilder-dialogs.DialogSet.createContext) method to create the dialog context.
* Use the methods of the dialog context to manage the progression of dialogs in the set.
* From code outside of a dialog in the set, use [DialogSet.createContext](xref:botbuilder-dialogs.DialogSet.createContext)
* to create the dialog context. Then use the methods of the dialog context to manage the progression of dialogs in the set.
*
* When you implement a dialog, the dialog context is a parameter available to the various methods you override or implement.
*

@@ -338,3 +340,4 @@ * For example:

* @param result Optional. A result to pass to the parent logic. This might be the next dialog
* on the stack, or it might be the bot's turn handler, if this was the last dialog on the stack.
* on the stack, or if this was the last dialog on the stack, a parent dialog context or
* the bot's turn handler.
*

@@ -341,0 +344,0 @@ * @remarks

@@ -10,2 +10,3 @@ /**

const English = require('../vendor/cldr-data/main/en/numbers.json');
const French = require('../vendor/cldr-data/main/fr/numbers.json');
const German = require('../vendor/cldr-data/main/de/numbers.json');

@@ -19,2 +20,2 @@ const Dutch = require('../vendor/cldr-data/main/nl/numbers.json');

export { Chinese, English, German, Dutch, Japanese, LikelySubtags, NumberingSystem, Portuguese, Spanish }
export { Chinese, English, French, German, Dutch, Japanese, LikelySubtags, NumberingSystem, Portuguese, Spanish }

@@ -12,7 +12,7 @@ /**

import { Chinese, Dutch, English, German, Japanese, LikelySubtags, NumberingSystem, Portuguese, Spanish } from "../i18n";
import { Chinese, Dutch, English, French, German, Japanese, LikelySubtags, NumberingSystem, Portuguese, Spanish } from "../i18n";
import * as Globalize from 'globalize';
Globalize.load(
Chinese, English, Dutch, German, Japanese, LikelySubtags, NumberingSystem, Portuguese, Spanish
Chinese, English, Dutch, French, German, Japanese, LikelySubtags, NumberingSystem, Portuguese, Spanish
);

@@ -19,0 +19,0 @@

@@ -8,7 +8,6 @@ /**

*/
import { Activity, ActivityTypes, Attachment, CardFactory, InputHints, MessageFactory, OAuthLoginTimeoutKey, TokenResponse, TurnContext, IUserTokenProvider, OAuthCard, ActionTypes, } from 'botbuilder-core';
import { Activity, ActivityTypes, Attachment, CardFactory, Channels, InputHints, MessageFactory, OAuthLoginTimeoutKey, TokenResponse, TurnContext, IUserTokenProvider, OAuthCard, ActionTypes, } from 'botbuilder-core';
import { Dialog, DialogTurnResult } from '../dialog';
import { DialogContext } from '../dialogContext';
import { PromptOptions, PromptRecognizerResult, PromptValidator } from './prompt';
import { channels } from '../choices/channel';
import { isSkillClaim } from './skillsHelpers';

@@ -349,6 +348,6 @@

switch (channelId) {
case channels.msteams:
case channels.cortana:
case channels.skype:
case channels.skypeforbusiness:
case Channels.Msteams:
case Channels.Cortana:
case Channels.Skype:
case Channels.Skypeforbusiness:
return false;

@@ -355,0 +354,0 @@ default:

@@ -46,2 +46,3 @@ import { Culture } from '@microsoft/recognizers-text-suite';

export class PromptCultureModels {
public static Chinese: PromptCultureModel = {

@@ -92,2 +93,11 @@ locale: Culture.Chinese,

public static Italian: PromptCultureModel = {
locale: Culture.Italian,
separator: ', ',
inlineOr: ' o ',
inlineOrMore: ' o ',
yesInLanguage: 'Si',
noInLanguage: 'No',
}
public static Japanese: PromptCultureModel = {

@@ -157,2 +167,3 @@ locale: Culture.Japanese,

PromptCultureModels.German,
PromptCultureModels.Italian,
PromptCultureModels.Japanese,

@@ -159,0 +170,0 @@ PromptCultureModels.Portuguese,

@@ -201,3 +201,3 @@ /**

private async runStep(dc: DialogContext, index: number, reason: DialogReason, result?: any): Promise<DialogTurnResult> {
protected async runStep(dc: DialogContext, index: number, reason: DialogReason, result?: any): Promise<DialogTurnResult> {
if (index < this.steps.length) {

@@ -240,4 +240,3 @@ // Update persisted step index

*/
public async endDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason) {
public async endDialog(context: TurnContext, instance: DialogInstance, reason: DialogReason): Promise<void> {
const state: WaterfallDialogState = instance.state as WaterfallDialogState;

@@ -251,3 +250,3 @@ const instanceId = state.values['instanceId'];

} else if (reason === DialogReason.cancelCalled) {
var index = instance.state[state.stepIndex];
var index = state.stepIndex;
var stepName = this.waterfallStepName(index);

@@ -262,3 +261,3 @@ this.telemetryClient.trackEvent({name: 'WaterfallCancel', properties: {

private waterfallStepName(index) {
private waterfallStepName(index: number): string {
// Log Waterfall Step event. Each event has a distinct name to hook up

@@ -295,4 +294,4 @@ // to the Application Insights funnel.

*/
function generate_guid() {
function s4() {
function generate_guid(): string {
function s4(): string {
return Math.floor((1 + Math.random()) * 0x10000)

@@ -299,0 +298,0 @@ .toString(16)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc