UNPKG

botbuilder-dialogs-adaptive

Version:

Rule system for the Microsoft BotBuilder dialog system.

128 lines 5.1 kB
/** * @module botbuilder-dialogs-adaptive */ /** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import { InputDialog, InputDialogConfiguration, InputState } from './inputDialog'; import { IntProperty, StringProperty } from '../properties'; import { IntExpression, StringExpression } from 'adaptive-expressions'; import { TokenResponse } from 'botbuilder'; import { Converter, ConverterFactory, DialogContext, DialogTurnResult, PromptOptions } from 'botbuilder-dialogs'; export declare const channels: { console: string; cortana: string; directline: string; email: string; emulator: string; facebook: string; groupme: string; kik: string; line: string; msteams: string; skype: string; skypeforbusiness: string; slack: string; sms: string; telegram: string; webchat: string; }; export interface OAuthInputConfiguration extends InputDialogConfiguration { connectionName?: StringProperty; title?: StringProperty; text?: StringProperty; timeout?: IntProperty; } /** * OAuthInput prompts user to login. */ export declare class OAuthInput extends InputDialog implements OAuthInputConfiguration { static $kind: string; /** * Name of the OAuth connection being used. */ connectionName: StringExpression; /** * Title of the cards signin button. */ title: StringExpression; /** * (Optional) additional text to include on the signin card. */ text?: StringExpression; /** * (Optional) number of milliseconds the prompt will wait for the user to authenticate. * Defaults to a value `900,000` (15 minutes.) */ timeout?: IntExpression; /** * @param property The key of the conditional selector configuration. * @returns The converter for the selector configuration. */ getConverter(property: keyof OAuthInputConfiguration): Converter | ConverterFactory; /** * Initializes a new instance of the [OAuthInput](xref:botbuilder-dialogs-adaptive.OAuthInput) class * * @param connectionName Optional. Name of the OAuth connection being used. * @param title Optional. Title of the cards signin button. * @param text Optional. Additional text to include on the signin card. * @param timeout Optional. Number of milliseconds the prompt will wait for the user to authenticate. */ constructor(connectionName?: string, title?: string, text?: string, timeout?: number); /** * Called when a prompt [Dialog](xref:botbuilder-dialogs.Dialog) is pushed onto the dialog stack and is being activated. * * @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. * @param options Optional. Additional information to pass to the prompt being started. * @returns A [DialogTurnResult](xref:botbuilder-dialogs.DialogTurnResult) `Promise` representing the asynchronous operation. */ beginDialog(dc: DialogContext, options?: PromptOptions): Promise<DialogTurnResult>; /** * Called when a prompt [Dialog](xref:botbuilder-dialogs.Dialog) is the active dialog and the user replied with a new activity. * * @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. * @returns A [DialogTurnResult](xref:botbuilder-dialogs.DialogTurnResult) `Promise` representing the asynchronous operation. */ continueDialog(dc: DialogContext): Promise<DialogTurnResult>; /** * Attempts to retrieve the stored token for the current user. * * @param dc Context reference the user that's being looked up. * @param code (Optional) login code received from the user. * @returns A promise representing the asynchronous operation. */ getUserToken(dc: DialogContext, code?: string): Promise<TokenResponse | undefined>; /** * Signs the user out of the service. * * @remarks * This example shows creating an instance of the prompt and then signing out the user. * * ```JavaScript * const prompt = new OAuthPrompt({ * connectionName: 'GitConnection', * title: 'Login To GitHub' * }); * await prompt.signOutUser(context); * ``` * @param dc Context referencing the user that's being signed out. * @returns A promise representing the asynchronous operation. */ signOutUser(dc: DialogContext): Promise<void>; protected onComputeId(): string; /** * @protected * Called when input has been received. * @param _dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. */ protected onRecognizeInput(_dc: DialogContext): Promise<InputState>; private sendOAuthCard; private recognizeToken; private isTokenResponseEvent; private isTeamsVerificationInvoke; private isTokenExchangeRequestInvoke; private isTokenExchangeRequest; private sendInvokeResponse; } //# sourceMappingURL=oauthInput.d.ts.map