Freigeben über


BotSsoExecutionDialog class

Sso execution dialog, use to handle sso command

Extends

ComponentDialog

Constructors

BotSsoExecutionDialog(Storage, TeamsBotSsoPromptSettings, OnBehalfOfCredentialAuthConfig, string, string)

Creates a new instance of the BotSsoExecutionDialog.

BotSsoExecutionDialog(Storage, TeamsBotSsoPromptSettings, TeamsFx, string)

Creates a new instance of the BotSsoExecutionDialog.

Properties

id

Unique ID of the dialog.

telemetryClient

Get the current telemetry client.

Inherited Properties

dialogs

The containers dialog set.

EndOfTurn

Gets a default end-of-turn result.

Methods

addCommand(BotSsoExecutionDialogHandler, TriggerPatterns)

Add TeamsFxBotSsoCommandHandler instance

run(TurnContext, StatePropertyAccessor<any>)

The run method handles the incoming activity (in the form of a DialogContext) and passes it through the dialog system.

Inherited Methods

addDialog(Dialog<{}>)

Adds a child Dialog or prompt to the components internal DialogSet.

beginDialog(DialogContext, {})

Called when the dialog is started and pushed onto the parent's dialog stack. By default, this calls the Dialog.BeginDialogAsync(DialogContext, object, CancellationToken) method of the component dialog's initial dialog, as defined by InitialDialogId. Override this method in a derived class to implement interrupt logic.

configure(Record<string, unknown>)

Fluent method for configuring the object.

continueDialog(DialogContext)

Called when the dialog is continued, where it is the active dialog and the user replies with a new Activity. If this method is not overridden, the dialog automatically ends when the user replies.

createChildContext(DialogContext)

Creates the inner dialog context

endDialog(TurnContext, DialogInstance<any>, DialogReason)

Called when the Dialog is ending.

findDialog(string)

Finds a child dialog that was previously added to the container.

getConverter(string)
getVersion()

An encoded string used to aid in the detection of bot changes on re-deployment.

onDialogEvent(DialogContext, DialogEvent)

Called when an event has been raised, using DialogContext.emitEvent(), by either the current dialog or a dialog that the current dialog started.

repromptDialog(TurnContext, DialogInstance<any>)

Called when the dialog should re-prompt the user for input.

resumeDialog(DialogContext, DialogReason, any)

Called when a child dialog on the parent's dialog stack completed this turn, returning control to this dialog component.

Constructor Details

BotSsoExecutionDialog(Storage, TeamsBotSsoPromptSettings, OnBehalfOfCredentialAuthConfig, string, string)

Creates a new instance of the BotSsoExecutionDialog.

new BotSsoExecutionDialog(dedupStorage: Storage, ssoPromptSettings: TeamsBotSsoPromptSettings, authConfig: OnBehalfOfCredentialAuthConfig, initiateLoginEndpoint: string, dialogName?: string)

Parameters

dedupStorage

Storage

ssoPromptSettings
TeamsBotSsoPromptSettings
initiateLoginEndpoint

string

Login URL for Teams to redirect to. *

dialogName

string

custom dialog name

BotSsoExecutionDialog(Storage, TeamsBotSsoPromptSettings, TeamsFx, string)

Creates a new instance of the BotSsoExecutionDialog.

new BotSsoExecutionDialog(dedupStorage: Storage, ssoPromptSettings: TeamsBotSsoPromptSettings, teamsfx: TeamsFx, dialogName?: string)

Parameters

dedupStorage

Storage

ssoPromptSettings
TeamsBotSsoPromptSettings
teamsfx
TeamsFx
dialogName

string

custom dialog name

Property Details

id

Unique ID of the dialog.

string id

Property Value

string

The Id for the dialog.

telemetryClient

Get the current telemetry client.

BotTelemetryClient telemetryClient

Property Value

BotTelemetryClient

The BotTelemetryClient to use for logging.

Inherited Property Details

dialogs

The containers dialog set.

dialogs: DialogSet

Property Value

DialogSet

Inherited From ComponentDialog.dialogs

EndOfTurn

Gets a default end-of-turn result.

static EndOfTurn: DialogTurnResult<any>

Property Value

DialogTurnResult<any>

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.

Inherited From ComponentDialog.EndOfTurn

Method Details

addCommand(BotSsoExecutionDialogHandler, TriggerPatterns)

Add TeamsFxBotSsoCommandHandler instance

function addCommand(handler: BotSsoExecutionDialogHandler, triggerPatterns: TriggerPatterns)

Parameters

triggerPatterns
TriggerPatterns

The trigger pattern

run(TurnContext, StatePropertyAccessor<any>)

The run method handles the incoming activity (in the form of a DialogContext) and passes it through the dialog system.

function run(context: TurnContext, accessor: StatePropertyAccessor<any>): Promise<void>

Parameters

context

TurnContext

The context object for the current turn.

accessor

StatePropertyAccessor<any>

The instance of StatePropertyAccessor for dialog system.

Returns

Promise<void>

Inherited Method Details

addDialog(Dialog<{}>)

Adds a child Dialog or prompt to the components internal DialogSet.

function addDialog(dialog: Dialog<{}>): BotSsoExecutionDialog

Parameters

dialog

Dialog<{}>

The child Dialog or prompt to add.

Returns

The ComponentDialog after the operation is complete.

Remarks

The Dialog.id of the first child added to the component will be assigned to the initialDialogId property.

Inherited From ComponentDialog.addDialog

beginDialog(DialogContext, {})

Called when the dialog is started and pushed onto the parent's dialog stack. By default, this calls the Dialog.BeginDialogAsync(DialogContext, object, CancellationToken) method of the component dialog's initial dialog, as defined by InitialDialogId. Override this method in a derived class to implement interrupt logic.

function beginDialog(outerDC: DialogContext, options?: {}): Promise<DialogTurnResult<any>>

Parameters

outerDC

DialogContext

The parent DialogContext for the current turn of conversation.

options

{}

Optional, initial information to pass to the dialog.

Returns

Promise<DialogTurnResult<any>>

A Promise representing the asynchronous operation.

Remarks

If the task is successful, the result indicates whether the dialog is still active after the turn has been processed by the dialog.

Inherited From ComponentDialog.beginDialog

configure(Record<string, unknown>)

Fluent method for configuring the object.

function configure(config: Record<string, unknown>): BotSsoExecutionDialog

Parameters

config

Record<string, unknown>

Configuration settings to apply.

Returns

The Configurable after the operation is complete.

Inherited From ComponentDialog.configure

continueDialog(DialogContext)

Called when the dialog is continued, where it is the active dialog and the user replies with a new Activity. If this method is not overridden, the dialog automatically ends when the user replies.

function continueDialog(outerDC: DialogContext): Promise<DialogTurnResult<any>>

Parameters

outerDC

DialogContext

The parent DialogContext for the current turn of conversation.

Returns

Promise<DialogTurnResult<any>>

A Promise representing the asynchronous operation.

Remarks

If the task is successful, the result indicates whether the dialog is still active after the turn has been processed by the dialog. The result may also contain a return value.

Inherited From ComponentDialog.continueDialog

createChildContext(DialogContext)

Creates the inner dialog context

function createChildContext(outerDC: DialogContext): DialogContext

Parameters

outerDC

DialogContext

the outer dialog context

Returns

DialogContext

The created Dialog Context.

Inherited From ComponentDialog.createChildContext

endDialog(TurnContext, DialogInstance<any>, DialogReason)

Called when the Dialog is ending.

function endDialog(context: TurnContext, instance: DialogInstance<any>, reason: DialogReason): Promise<void>

Parameters

context

TurnContext

The TurnContext object for this turn.

instance

DialogInstance<any>

State information associated with the instance of this component Dialog on its parent's dialog stack.

reason

DialogReason

Reason why the Dialog ended.

Returns

Promise<void>

A Promise representing the asynchronous operation.

Remarks

When this method is called from the parent dialog's context, the component Dialog cancels all of the dialogs on its inner dialog stack before ending.

Inherited From ComponentDialog.endDialog

findDialog(string)

Finds a child dialog that was previously added to the container.

function findDialog(dialogId: string): undefined | Dialog<{}>

Parameters

dialogId

string

ID of the dialog to lookup.

Returns

undefined | Dialog<{}>

The Dialog if found; otherwise null.

Inherited From ComponentDialog.findDialog

getConverter(string)

function getConverter(_property: string): Converter<unknown, unknown> | ConverterFactory<unknown, unknown>

Parameters

_property

string

The key of the conditional selector configuration.

Returns

Converter<unknown, unknown> | ConverterFactory<unknown, unknown>

The converter for the selector configuration.

Inherited From ComponentDialog.getConverter

getVersion()

An encoded string used to aid in the detection of bot changes on re-deployment.

function getVersion(): string

Returns

string

Unique string which should only change when dialog has changed in a way that should restart the dialog.

Remarks

This defaults to returning the dialogs id but can be overridden to provide more precise change detection logic. Any dialog on the stack that has its version change will result in a versionChanged event will be raised. If this event is not handled by the bot, an error will be thrown resulting in the bots error handler logic being run.

Returning an empty string will disable version tracking for the component all together.

Inherited From ComponentDialog.getVersion

onDialogEvent(DialogContext, DialogEvent)

Called when an event has been raised, using DialogContext.emitEvent(), by either the current dialog or a dialog that the current dialog started.

function onDialogEvent(dc: DialogContext, e: DialogEvent): Promise<boolean>

Parameters

dc

DialogContext

The dialog context for the current turn of conversation.

e

DialogEvent

The event being raised.

Returns

Promise<boolean>

True if the event is handled by the current dialog and bubbling should stop.

Inherited From ComponentDialog.onDialogEvent

repromptDialog(TurnContext, DialogInstance<any>)

Called when the dialog should re-prompt the user for input.

function repromptDialog(context: TurnContext, instance: DialogInstance<any>): Promise<void>

Parameters

context

TurnContext

The TurnContext object for this turn.

instance

DialogInstance<any>

State information for this dialog.

Returns

Promise<void>

A Promise representing the asynchronous operation.

Inherited From ComponentDialog.repromptDialog

resumeDialog(DialogContext, DialogReason, any)

Called when a child dialog on the parent's dialog stack completed this turn, returning control to this dialog component.

function resumeDialog(outerDC: DialogContext, _reason: DialogReason, _result?: any): Promise<DialogTurnResult<any>>

Parameters

outerDC

DialogContext

The DialogContext for the current turn of conversation.

_reason

DialogReason

Reason why the dialog resumed.

_result

any

Optional, value returned from the dialog that was called. The type of the value returned is dependent on the child dialog.

Returns

Promise<DialogTurnResult<any>>

A Promise representing the asynchronous operation.

Remarks

If the task is successful, the result indicates whether this dialog is still active after this dialog turn has been processed. Generally, the child dialog was started with a call to beginDialog(DialogContext, object) in the parent's context. However, if the DialogContext.replaceDialog(string, object) method is called, the logical child dialog may be different than the original. If this method is not overridden, the dialog automatically calls its RepromptDialog(ITurnContext, DialogInstance) when the user replies.

Inherited From ComponentDialog.resumeDialog