@microsoft/teams-ai
Version:
SDK focused on building AI based applications for Microsoft Teams.
65 lines • 3.32 kB
TypeScript
import { DialogTurnResult } from 'botbuilder-dialogs';
import { Storage, TeamsSSOTokenExchangeMiddleware, TurnContext, TokenResponse } from 'botbuilder';
import { BotAuthenticationBase } from './BotAuthenticationBase';
import { Application } from '../Application';
import { TurnState } from '../TurnState';
import { OAuthSettings } from './Authentication';
/**
* @internal
*
* Handles authentication for Teams bots.
* @template TState - The type of the turn state object.
*/
export declare class OAuthBotAuthentication<TState extends TurnState> extends BotAuthenticationBase<TState> {
private _oauthPrompt;
private _oauthSettings;
/**
* Initializes a new instance of the OAuthBotAuthentication class.
* @param {Application} app - The application object.
* @param {OAuthSettings} oauthSettings - The settings for OAuthPrompt.
* @param {string} settingName - The name of the setting.
* @param {Storage} storage - The storage object for storing state.
*/
constructor(app: Application<TState>, oauthSettings: OAuthSettings, // Child classes will have different types for this
settingName: string, storage?: Storage);
/**
* Run or continue the OAuthPrompt dialog and returns the result.
* @param {TurnContext} context - The turn context object.
* @param {TState} state - The turn state object.
* @param {string} dialogStateProperty - The name of the dialog state property.
* @returns {Promise<DialogTurnResult<TokenResponse>>} A promise that resolves to the dialog turn result containing the token response.
*/
runDialog(context: TurnContext, state: TState, dialogStateProperty: string): Promise<DialogTurnResult<TokenResponse>>;
/**
* Continue the OAuthPrompt dialog and returns the result.
* @param {TurnContext} context - The turn context object.
* @param {TState} state - The turn state object.
* @param {string} dialogStateProperty - The name of the dialog state property.
* @returns {Promise<DialogTurnResult<TokenResponse>>} A promise that resolves to the dialog turn result containing the token response.
*/
continueDialog(context: TurnContext, state: TState, dialogStateProperty: string): Promise<DialogTurnResult<TokenResponse>>;
/**
* Creates a new DialogContext for OAuthPrompt.
* @param {TurnContext} context - The turn context object.
* @param {TState} state - The turn state object.
* @param {string} dialogStateProperty - The name of the dialog state property.
* @returns {Promise<DialogContext>} A promise that resolves to the dialog context.
*/
private createDialogContext;
/**
* Creates an OAuthCard that will be sent to the user.
* @param {TurnContext} context - The turn context.
* @returns {Promise<Attachment>} The OAuthCard.
*/
private createOAuthCard;
}
/**
* @internal
* SSO Token Exchange Middleware for Teams that filters based on the connection name.
*/
export declare class FilteredTeamsSSOTokenExchangeMiddleware extends TeamsSSOTokenExchangeMiddleware {
private readonly _oauthConnectionName;
constructor(storage: Storage, oauthConnectionName: string);
onTurn(context: TurnContext, next: () => Promise<void>): Promise<void>;
}
//# sourceMappingURL=OAuthBotAuthentication.d.ts.map