From a40868ae24c9d6586b38a37641a6df88b52058ac Mon Sep 17 00:00:00 2001 From: JhontSouth Date: Thu, 17 Oct 2024 12:49:26 -0500 Subject: [PATCH 1/7] fix lint issues in bobuilder-core --- libraries/botbuilder-core/eslint.config.cjs | 8 +- libraries/botbuilder-core/package.json | 1 + .../botbuilder-core/src/activityFactory.ts | 4 - .../botbuilder-core/src/activityHandler.ts | 94 ++------------ .../src/activityHandlerBase.ts | 46 +------ .../botbuilder-core/src/adapterExtensions.ts | 1 - .../src/autoSaveStateMiddleware.ts | 4 - libraries/botbuilder-core/src/botAdapter.ts | 34 +---- libraries/botbuilder-core/src/botComponent.ts | 1 - libraries/botbuilder-core/src/botState.ts | 13 +- .../src/botStatePropertyAccessor.ts | 22 ++-- libraries/botbuilder-core/src/botStateSet.ts | 6 +- .../botbuilder-core/src/botTelemetryClient.ts | 9 +- .../botbuilder-core/src/browserStorage.ts | 2 - libraries/botbuilder-core/src/cardFactory.ts | 47 ++----- .../botbuilder-core/src/cloudAdapterBase.ts | 46 +++---- .../src/componentRegistration.ts | 2 - ...configurationBotFrameworkAuthentication.ts | 20 +-- ...igurationServiceClientCredentialFactory.ts | 22 ++-- .../botbuilder-core/src/conversationState.ts | 8 +- .../botbuilder-core/src/coreAppCredentials.ts | 2 - .../src/extendedUserTokenProvider.ts | 31 ++--- libraries/botbuilder-core/src/internal.ts | 2 +- .../botbuilder-core/src/invokeException.ts | 6 +- .../botbuilder-core/src/memoryStorage.ts | 5 - .../src/memoryTranscriptStore.ts | 11 +- .../botbuilder-core/src/messageFactory.ts | 19 +-- .../botbuilder-core/src/middlewareSet.ts | 6 - .../src/privateConversationState.ts | 8 +- .../botbuilder-core/src/propertyManager.ts | 3 +- libraries/botbuilder-core/src/queueStorage.ts | 3 +- .../botbuilder-core/src/recognizerResult.ts | 1 - .../src/registerClassMiddleware.ts | 2 - .../src/showTypingMiddleware.ts | 10 +- .../src/skills/skillConversationIdFactory.ts | 8 +- .../skills/skillConversationIdFactoryBase.ts | 5 - .../src/skypeMentionNormalizeMiddleware.ts | 3 - libraries/botbuilder-core/src/storage.ts | 10 +- libraries/botbuilder-core/src/stringUtils.ts | 4 - .../src/telemetryLoggerMiddleware.ts | 30 ++--- libraries/botbuilder-core/src/testAdapter.ts | 121 +++++++----------- .../botbuilder-core/src/transcriptLogger.ts | 19 +-- libraries/botbuilder-core/src/turnContext.ts | 48 ++----- .../src/turnContextStateCollection.ts | 6 - libraries/botbuilder-core/src/userState.ts | 8 +- .../botbuilder-core/src/userTokenProvider.ts | 10 +- .../tests/ActivityHandler.test.js | 10 +- .../tests/activityHandlerBase.test.js | 2 +- .../tests/autoSaveStateMiddleware.test.js | 2 +- .../botbuilder-core/tests/botAdapter.test.js | 8 +- .../botbuilder-core/tests/botState.test.js | 4 +- .../tests/botStatePropertyAccessor.test.js | 2 +- .../tests/botTelemetryClient.test.js | 4 +- .../tests/cloudAdapterBase.test.js | 30 ++--- ...tionServiceClientCredentialFactory.test.js | 2 +- .../tests/conversationState.test.js | 2 +- .../tests/messageFactory.test.js | 12 +- .../tests/middlewareSet.test.js | 4 +- .../tests/privateConversationState.test.js | 2 +- .../botbuilder-core/tests/storageBaseTests.js | 15 +-- .../botbuilder-core/tests/testAdapter.test.js | 10 +- .../tests/transcriptStoreBaseTest.js | 53 ++++---- .../tests/transcriptUtilities.js | 4 - .../botbuilder-core/tests/turnContext.test.js | 10 +- .../botbuilder-core/tests/userState.test.js | 2 +- 65 files changed, 289 insertions(+), 660 deletions(-) diff --git a/libraries/botbuilder-core/eslint.config.cjs b/libraries/botbuilder-core/eslint.config.cjs index 63647b52cc..9a63fa69c2 100644 --- a/libraries/botbuilder-core/eslint.config.cjs +++ b/libraries/botbuilder-core/eslint.config.cjs @@ -3,8 +3,12 @@ const sharedConfig = require("../../eslint.config.cjs") module.exports = [ ...sharedConfig, + { + files: ['**/*.js, **/*.ts'], + }, { plugins: { - "only-warn": onlyWarn, + 'only-warn': onlyWarn, }, - }]; + }, +]; diff --git a/libraries/botbuilder-core/package.json b/libraries/botbuilder-core/package.json index ecd8145966..9710105120 100644 --- a/libraries/botbuilder-core/package.json +++ b/libraries/botbuilder-core/package.json @@ -27,6 +27,7 @@ } }, "dependencies": { + "@eslint/js": "^9.12.0", "botbuilder-dialogs-adaptive-runtime-core": "4.1.6", "botbuilder-stdlib": "4.1.6", "botframework-connector": "4.1.6", diff --git a/libraries/botbuilder-core/src/activityFactory.ts b/libraries/botbuilder-core/src/activityFactory.ts index 827c0d2523..e0b1700ba3 100644 --- a/libraries/botbuilder-core/src/activityFactory.ts +++ b/libraries/botbuilder-core/src/activityFactory.ts @@ -115,7 +115,6 @@ export class ActivityFactory { /** * Generate the activity. - * * @param lgResult string result from languageGenerator. * @returns The generated MessageActivity. */ @@ -137,7 +136,6 @@ export class ActivityFactory { /** * Given a lg result, create a text activity. This method will create a MessageActivity from text. - * * @param text lg text output. * @returns The created MessageActivity. */ @@ -156,7 +154,6 @@ export class ActivityFactory { /** * Given a structured lg result, create an activity. This method will create an MessageActivity from object - * * @param lgValue lg output. * @returns The created MessageActivity. */ @@ -177,7 +174,6 @@ export class ActivityFactory { /** * Builds an [Activity](xref:botframework-schema.Activity) with a given message. - * * @param messageValue Message value on which to base the activity. * @returns [Activity](xref:botframework-schema.Activity) with the given message. */ diff --git a/libraries/botbuilder-core/src/activityHandler.ts b/libraries/botbuilder-core/src/activityHandler.ts index b553cf2adc..f11b931678 100644 --- a/libraries/botbuilder-core/src/activityHandler.ts +++ b/libraries/botbuilder-core/src/activityHandler.ts @@ -22,7 +22,6 @@ import { /** * Describes a bot activity event handler, for use with an [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. - * * @remarks * **Parameters** * @@ -44,7 +43,6 @@ export type BotHandler = (context: TurnContext, next: () => Promise) => Pr /** * Event-emitting activity handler for bots. Extends [ActivityHandlerBase](xref:botbuilder-core.ActivityHandlerBase). - * * @remarks * This provides an extensible class for handling incoming activities in an event-driven way. * You can register an arbitrary set of handlers for each event type. @@ -96,7 +94,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _turn_ event, emitted for every incoming activity, regardless of type. - * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. */ @@ -106,7 +103,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _message_ event, emitted for every incoming message activity. - * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -121,7 +117,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _message update_ event, emitted for every incoming message activity. - * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -138,7 +133,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _message delete_ event, emitted for every incoming message activity. - * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -155,7 +149,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _conversation update_ event, emitted for every incoming * conversation update activity. - * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -173,7 +166,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _members added_ event, emitted for any incoming * conversation update activity that includes members added to the conversation. - * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -190,7 +182,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _members removed_ event, emitted for any incoming * conversation update activity that includes members removed from the conversation. - * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -207,7 +198,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _message reaction_ event, emitted for every incoming * message reaction activity. - * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -228,7 +218,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _reactions added_ event, emitted for any incoming * message reaction activity that describes reactions added to a message. - * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -245,7 +234,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _reactions removed_ event, emitted for any incoming * message reaction activity that describes reactions removed from a message. - * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -261,7 +249,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _event_ event, emitted for every incoming event activity. - * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -282,7 +269,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _end of conversation_ activity. - * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -297,7 +283,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _typing_ activity. - * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -310,7 +295,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _installationupdate_ activity. - * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -323,7 +307,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _installationupdate add_ activity. - * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * To handle a InstallationUpdateAdd event, use the @@ -335,7 +318,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _installationupdate remove_ activity. - * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -349,7 +331,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _tokens-response_ event, emitted for any incoming * `tokens/response` event activity. These are generated as part of the OAuth authentication flow. - * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -367,7 +348,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _command_ activity. - * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -380,7 +360,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _CommandResult_ activity. - * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -395,7 +374,6 @@ export class ActivityHandler extends ActivityHandlerBase { * Registers an activity event handler for the _unrecognized activity type_ event, emitted for an * incoming activity with a type for which the [ActivityHandler](xref:botbuilder-core.ActivityHandler) * doesn't provide an event handler. - * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -412,7 +390,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _dialog_ event, emitted as the last event for an incoming activity. - * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. */ @@ -422,9 +399,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Called to initiate the event emission process. - * * @param context The context object for the current turn. - * * @remarks * Typically, you would provide this method as the function handler that the adapter calls * to perform the bot's logic after the received activity has been pre-processed by the adapter @@ -449,9 +424,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Called at the start of the event emission process. - * * @param context The context object for the current turn. - * * @remarks * Override this method to use custom logic for emitting events. * @@ -466,9 +439,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _message_ handlers and then continues the event emission process. - * * @param context The context object for the current turn. - * * @remarks * Override this method to support channel-specific behavior across multiple channels. * @@ -482,9 +453,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _message update_ handlers and then continues the event emission process. - * * @param context The context object for the current turn. - * * @remarks * Override this method to support channel-specific behavior across multiple channels. * @@ -500,9 +469,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _message delete_ handlers and then continues the event emission process. - * * @param context The context object for the current turn. - * * @remarks * Override this method to support channel-specific behavior across multiple channels. * @@ -518,7 +485,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Provides default behavior for invoke activities. - * * @param context The context object for the current turn. * @returns {Promise} An Invoke Response for the activity. * @remarks @@ -566,9 +532,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Handle _signin invoke activity type_. - * * @param _context The context object for the current turn. - * * @remarks * Override this method to support channel-specific behavior across multiple channels. */ @@ -578,21 +542,19 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Invoked when the bot is sent an Adaptive Card Action Execute. - * * @param _context the context object for the current turn * @param _invokeValue incoming activity value * @returns {Promise} An Adaptive Card Invoke Response for the activity. */ protected onAdaptiveCardInvoke( _context: TurnContext, - _invokeValue: AdaptiveCardInvokeValue + _invokeValue: AdaptiveCardInvokeValue, ): Promise { return Promise.reject(new InvokeException(StatusCodes.NOT_IMPLEMENTED)); } /** * Invoked when the bot is sent an invoke activity with name of 'application/search'. - * * @param _context the context object for the current turn. * @param _invokeValue incoming activity value. * @returns {Promise} A Search Invoke Response for the activity. @@ -603,9 +565,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _endOfConversation_ handlers and then continues the event emission process. - * * @param context The context object for the current turn. - * * @remarks * Override this method to support channel-specific behavior across multiple channels. * @@ -619,9 +579,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _typing_ handlers and then continues the event emission process. - * * @param context The context object for the current turn. - * * @remarks * Override this method to support channel-specific behavior across multiple channels. * @@ -635,9 +593,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _instllationupdate_ handlers and then continues the event emission process. - * * @param context The context object for the current turn. - * * @remarks * Override this method to support channel-specific behavior across multiple channels. * @@ -653,7 +609,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _command_ handlers and then continues the event emission process. - * * @param context The context object for the current turn. */ protected async onCommandActivity(context: TurnContext): Promise { @@ -662,7 +617,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _commandresult_ handlers and then continues the event emission process. - * * @param context The context object for the current turn. */ protected async onCommandResultActivity(context: TurnContext): Promise { @@ -671,9 +625,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs the _installation update_ sub-type handlers, as appropriate, and then continues the event emission process. - * * @param context The context object for the current turn. - * * @remarks * Override this method to support channel-specific behavior across multiple channels or to add * custom conversation update sub-type events. @@ -698,9 +650,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _installation update add_ handlers and then continues the event emission process. - * * @param context The context object for the current turn. - * * @remarks * Override this method to support channel-specific behavior across multiple channels. * @@ -714,9 +664,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _installation update remove_ handlers and then continues the event emission process. - * * @param context The context object for the current turn. - * * @remarks * Override this method to support channel-specific behavior across multiple channels. * @@ -730,9 +678,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _unrecognized activity type_ handlers and then continues the event emission process. - * * @param context The context object for the current turn. - * * @remarks * Override this method to support channel-specific behavior across multiple channels. * @@ -750,7 +696,7 @@ export class ActivityHandler extends ActivityHandlerBase { const response = this.createAdaptiveCardInvokeErrorResponse( StatusCodes.BAD_REQUEST, 'BadRequest', - 'Missing value property for search' + 'Missing value property for search', ); throw new InvokeException(StatusCodes.BAD_REQUEST, response); @@ -763,7 +709,7 @@ export class ActivityHandler extends ActivityHandlerBase { const response = this.createAdaptiveCardInvokeErrorResponse( StatusCodes.BAD_REQUEST, 'BadRequest', - 'Missing kind property for search.' + 'Missing kind property for search.', ); throw new InvokeException(StatusCodes.BAD_REQUEST, response); @@ -774,7 +720,7 @@ export class ActivityHandler extends ActivityHandlerBase { const response = this.createAdaptiveCardInvokeErrorResponse( StatusCodes.BAD_REQUEST, 'BadRequest', - 'Missing queryText for search.' + 'Missing queryText for search.', ); throw new InvokeException(StatusCodes.BAD_REQUEST, response); @@ -789,7 +735,7 @@ export class ActivityHandler extends ActivityHandlerBase { const response = this.createAdaptiveCardInvokeErrorResponse( StatusCodes.BAD_REQUEST, 'BadRequest', - 'Missing value property' + 'Missing value property', ); throw new InvokeException(StatusCodes.BAD_REQUEST, response); @@ -799,7 +745,7 @@ export class ActivityHandler extends ActivityHandlerBase { const response = this.createAdaptiveCardInvokeErrorResponse( StatusCodes.BAD_REQUEST, 'NotSupported', - `The action '${value.action.type}' is not supported.` + `The action '${value.action.type}' is not supported.`, ); throw new InvokeException(StatusCodes.BAD_REQUEST, response); @@ -828,7 +774,7 @@ export class ActivityHandler extends ActivityHandlerBase { private createAdaptiveCardInvokeErrorResponse( statusCode: StatusCodes, code: string, - message: string + message: string, ): AdaptiveCardInvokeResponse { return { statusCode, @@ -839,9 +785,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _conversation update_ handlers and then continues the event emission process. - * * @param context The context object for the current turn. - * * @remarks * Override this method to support channel-specific behavior across multiple channels. * @@ -858,9 +802,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs the _conversation update_ sub-type handlers, as appropriate, and then continues the event emission process. - * * @param context The context object for the current turn. - * * @remarks * Override this method to support channel-specific behavior across multiple channels or to add * custom conversation update sub-type events. @@ -882,9 +824,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs the _message update_ sub-type handlers, as appropriate, and then continues the event emission process. - * * @param context The context object for the current turn. - * * @remarks * Override this method to support channel-specific behavior across multiple channels or to add * custom conversation update sub-type events. @@ -897,9 +837,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs the _message delete_ sub-type handlers, as appropriate, and then continues the event emission process. - * * @param context The context object for the current turn. - * * @remarks * Override this method to support channel-specific behavior across multiple channels or to add * custom conversation update sub-type events. @@ -911,9 +849,7 @@ export class ActivityHandler extends ActivityHandlerBase { } /** * Runs all registered _message reaction_ handlers and then continues the event emission process. - * * @param context The context object for the current turn. - * * @remarks * Override this method to support channel-specific behavior across multiple channels. * @@ -930,10 +866,8 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _reactions added_ handlers and then continues the event emission process. - * * @param reactionsAdded The list of reactions added. * @param context The context object for the current turn. - * * @remarks * Override this method to support channel-specific behavior across multiple channels. * @@ -947,10 +881,8 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _reactions removed_ handlers and then continues the event emission process. - * * @param reactionsRemoved The list of reactions removed. * @param context The context object for the current turn. - * * @remarks * Override this method to support channel-specific behavior across multiple channels. * @@ -960,16 +892,14 @@ export class ActivityHandler extends ActivityHandlerBase { */ protected async onReactionsRemovedActivity( reactionsRemoved: MessageReaction[], - context: TurnContext + context: TurnContext, ): Promise { await this.handle(context, 'ReactionsRemoved', this.defaultNextEvent(context)); } /** * Runs the _message reaction_ sub-type handlers, as appropriate, and then continues the event emission process. - * * @param context The context object for the current turn. - * * @remarks * Override this method to support channel-specific behavior across multiple channels or to add * custom message reaction sub-type events. @@ -989,9 +919,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered event_ handlers and then continues the event emission process. - * * @param context The context object for the current turn. - * * @remarks * Override this method to support channel-specific behavior across multiple channels. * @@ -1008,9 +936,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs the _event_ sub-type handlers, as appropriate, and then continues the event emission process. - * * @param context The context object for the current turn. - * * @remarks * Override this method to support channel-specific behavior across multiple channels or to add custom event sub-type events. * For certain channels, such as Web Chat and custom Direct Line clients, developers can emit custom event activities from the client. @@ -1030,7 +956,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Called at the end of the event emission process. - * * @param context The context object for the current turn. * @returns {Promise} A promise representing the async operation. * @remarks @@ -1050,7 +975,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers a bot event handler to receive a specific event. - * * @param type The identifier for the event type. * @param handler The event handler to register. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. @@ -1066,7 +990,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Emits an event and executes any registered handlers. - * * @param context The context object for the current turn. * @param type The identifier for the event type. * @param onNext The continuation function to call after all registered handlers for this event complete. @@ -1104,7 +1027,6 @@ export class ActivityHandler extends ActivityHandlerBase { /** * An [InvokeResponse](xref:botbuilder.InvokeResponse) factory that initializes the body to the parameter passed and status equal to OK. - * * @param body JSON serialized content from a POST response. * @returns A new [InvokeResponse](xref:botbuilder.InvokeResponse) object. */ diff --git a/libraries/botbuilder-core/src/activityHandlerBase.ts b/libraries/botbuilder-core/src/activityHandlerBase.ts index 7358527323..a3b6a89053 100644 --- a/libraries/botbuilder-core/src/activityHandlerBase.ts +++ b/libraries/botbuilder-core/src/activityHandlerBase.ts @@ -11,7 +11,6 @@ export const INVOKE_RESPONSE_KEY = Symbol('invokeResponse'); /** * Defines the core behavior for event-emitting activity handlers for bots. - * * @remarks * This provides an extensible class for handling incoming activities in an event-driven way. * You can register an arbitrary set of handlers for each event type. @@ -33,9 +32,7 @@ export const INVOKE_RESPONSE_KEY = Symbol('invokeResponse'); export class ActivityHandlerBase { /** * Called at the start of the event emission process. - * * @param context The context object for the current turn. - * * @remarks * Override this method to use custom logic for emitting events. * @@ -100,9 +97,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _message_ event. - * * @param _context The context object for the current turn. - * * @remarks * Override this method to run registered _message_ handlers and then continue the event * emission process. @@ -113,9 +108,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _message update_ event. - * * @param _context The context object for the current turn. - * * @remarks * Override this method to run registered _message update_ handlers and then continue the event * emission process. @@ -126,9 +119,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _message delete_ event. - * * @param _context The context object for the current turn. - * * @remarks * Override this method to run registered _message delete_ handlers and then continue the event * emission process. @@ -139,9 +130,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _conversation update_ event. - * * @param context The context object for the current turn. - * * @remarks * Override this method to run registered _conversation update_ handlers and then continue the event * emission process. @@ -156,7 +145,7 @@ export class ActivityHandlerBase { if (context.activity.membersAdded && context.activity.membersAdded.length > 0) { if ( context.activity.membersAdded.filter( - (m) => context.activity.recipient && context.activity.recipient.id !== m.id + (m) => context.activity.recipient && context.activity.recipient.id !== m.id, ).length ) { await this.onMembersAddedActivity(context.activity.membersAdded, context); @@ -164,7 +153,7 @@ export class ActivityHandlerBase { } else if (context.activity.membersRemoved && context.activity.membersRemoved.length > 0) { if ( context.activity.membersRemoved.filter( - (m) => context.activity.recipient && context.activity.recipient.id !== m.id + (m) => context.activity.recipient && context.activity.recipient.id !== m.id, ).length ) { await this.onMembersRemovedActivity(context.activity.membersRemoved, context); @@ -174,9 +163,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _message reaction_ event. - * * @param context The context object for the current turn. - * * @remarks * Override this method to run registered _message reaction_ handlers and then continue the event * emission process. @@ -199,9 +186,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _event_ event. - * * @param _context The context object for the current turn. - * * @remarks * Override this method to run registered _event_ handlers and then continue the event * emission process. @@ -212,7 +197,6 @@ export class ActivityHandlerBase { /** * Provides a hook for invoke calls. - * * @param _context The context object for the current turn. * @returns {Promise} An Invoke Response for the activity. * @remarks @@ -224,9 +208,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _end of conversation_ event. - * * @param _context The context object for the current turn. - * * @remarks * Override this method to run registered _end of conversation_ handlers and then continue the event * emission process. @@ -237,9 +219,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _typing_ event. - * * @param _context The context object for the current turn. - * * @remarks * Override this method to run registered _typing_ handlers and then continue the event * emission process. @@ -250,9 +230,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _installationupdate_ event. - * * @param context The context object for the current turn. - * * @remarks * Override this method to run registered _installationupdate_ handlers and then continue the event * emission process. @@ -272,9 +250,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _installationupdateadd_ event. - * * @param _context The context object for the current turn. - * * @remarks * Override this method to run registered _installationupdateadd_ handlers and then continue the event * emission process. @@ -285,9 +261,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _installationupdateremove_ event. - * * @param _context The context object for the current turn. - * * @remarks * Override this method to run registered _installationupdateremove_ handlers and then continue the event * emission process. @@ -298,9 +272,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _unrecognized_ event. - * * @param _context The context object for the current turn. - * * @remarks * Override this method to run registered _unrecognized_ handlers and then continue the event * emission process. @@ -312,10 +284,8 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _members added_ event, * a sub-type of the _conversation update_ event. - * * @param _membersAdded An array of the members added to the conversation. * @param _context The context object for the current turn. - * * @remarks * Override this method to run registered _members added_ handlers and then continue the event * emission process. @@ -327,10 +297,8 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _members removed_ event, * a sub-type of the _conversation update_ event. - * * @param _membersRemoved An array of the members removed from the conversation. * @param _context The context object for the current turn. - * * @remarks * Override this method to run registered _members removed_ handlers and then continue the event * emission process. @@ -342,10 +310,8 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _reactions added_ event, * a sub-type of the _message reaction_ event. - * * @param _reactionsAdded An array of the reactions added to a message. * @param _context The context object for the current turn. - * * @remarks * Override this method to run registered _reactions added_ handlers and then continue the event * emission process. @@ -357,17 +323,15 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _reactions removed_ event, * a sub-type of the _message reaction_ event. - * * @param _reactionsRemoved An array of the reactions removed from a message. * @param _context The context object for the current turn. - * * @remarks * Override this method to run registered _reactions removed_ handlers and then continue the event * emission process. */ protected async onReactionsRemovedActivity( _reactionsRemoved: MessageReaction[], - _context: TurnContext + _context: TurnContext, ): Promise { return; } @@ -378,7 +342,6 @@ export class ActivityHandlerBase { * Commands are requests to perform an action and receivers typically respond with * one or more commandResult activities. Receivers are also expected to explicitly * reject unsupported command activities. - * * @param _context A context object for this turn. * @returns A promise that represents the work queued to execute. */ @@ -390,7 +353,6 @@ export class ActivityHandlerBase { * Invoked when a commandResult activity is received when the base behavior of * `onTurn()` is used. * CommandResult activity can be used to communicate the result of a command execution. - * * @param _context A context object for this turn. * @returns A promise that represents the work queued to execute. */ @@ -400,9 +362,7 @@ export class ActivityHandlerBase { /** * Called to initiate the event emission process. - * * @param context The context object for the current turn. - * * @remarks * Typically, you would provide this method as the function handler that the adapter calls * to perform the bot's logic after the received activity has been pre-processed by the adapter diff --git a/libraries/botbuilder-core/src/adapterExtensions.ts b/libraries/botbuilder-core/src/adapterExtensions.ts index b4f6b86d4e..107b4f4d7d 100644 --- a/libraries/botbuilder-core/src/adapterExtensions.ts +++ b/libraries/botbuilder-core/src/adapterExtensions.ts @@ -13,7 +13,6 @@ import { RegisterClassMiddleware } from './registerClassMiddleware'; /** * Adds middleware to the adapter to register one or more BotState objects on the turn context. * The middleware registers the state objects on the turn context at the start of each turn. - * * @param botAdapter The adapter on which to register the state objects. * @param botStates The state objects to register. * @returns The updated adapter. diff --git a/libraries/botbuilder-core/src/autoSaveStateMiddleware.ts b/libraries/botbuilder-core/src/autoSaveStateMiddleware.ts index f9992d069e..d2db3ff180 100644 --- a/libraries/botbuilder-core/src/autoSaveStateMiddleware.ts +++ b/libraries/botbuilder-core/src/autoSaveStateMiddleware.ts @@ -12,7 +12,6 @@ import { TurnContext } from './turnContext'; /** * Middleware that will automatically save any state changes at the end of the turn. - * * @remarks * The `AutoSaveStateMiddleware` class should be added towards the top of your bot's middleware * stack, before any other components that use state. Any `BotState` plugins passed to the @@ -50,7 +49,6 @@ export class AutoSaveStateMiddleware implements Middleware { botStateSet: BotStateSet; /** * Creates a new AutoSaveStateMiddleware instance. - * * @param botStates One or more BotState plugins to automatically save at the end of the turn. */ constructor(...botStates: BotState[]) { @@ -60,7 +58,6 @@ export class AutoSaveStateMiddleware implements Middleware { /** * Called by the adapter (for example, a `BotFrameworkAdapter`) at runtime in order to process an inbound [Activity](xref:botframework-schema.Activity). - * * @param context The context object for this turn. * @param next {function} The next delegate function. */ @@ -71,7 +68,6 @@ export class AutoSaveStateMiddleware implements Middleware { /** * Adds additional `BotState` plugins to be saved. - * * @param botStates One or more BotState plugins to add. * @returns The updated BotStateSet object. */ diff --git a/libraries/botbuilder-core/src/botAdapter.ts b/libraries/botbuilder-core/src/botAdapter.ts index 214064d942..e88a76f1ca 100644 --- a/libraries/botbuilder-core/src/botAdapter.ts +++ b/libraries/botbuilder-core/src/botAdapter.ts @@ -10,7 +10,6 @@ import { TurnContext } from './turnContext'; /** * Defines the core behavior of a bot adapter that can connect a bot to a service endpoint. - * * @remarks * The bot adapter encapsulates authentication processes and sends activities to and receives * activities from the Bot Connector Service. When your bot receives an activity, the adapter @@ -42,12 +41,9 @@ export abstract class BotAdapter { * This method supports the framework and is not intended to be called directly for your code. * Use the turn context's [sendActivity](xref:botbuilder-core.TurnContext.sendActivity) or * [sendActivities](xref:botbuilder-core.TurnContext.sendActivities) method from your bot code. - * * @param context The context object for the turn. * @param activities The activities to send. - * * @returns An array of [ResourceResponse](xref:) - * * @remarks * The activities will be sent one after another in the order in which they're received. A * response object will be returned for each sent activity. For `message` activities this will @@ -61,10 +57,8 @@ export abstract class BotAdapter { * This interface supports the framework and is not intended to be called directly for your code. * Use [TurnContext.updateActivity](xref:botbuilder-core.TurnContext.updateActivity) to update * an activity from your bot code. - * * @param context The context object for the turn. * @param activity The updated version of the activity to replace. - * * @remarks * Not all channels support this operation. For channels that don't, this call may throw an exception. */ @@ -76,10 +70,8 @@ export abstract class BotAdapter { * This interface supports the framework and is not intended to be called directly for your code. * Use [TurnContext.deleteActivity](xref:botbuilder-core.TurnContext.deleteActivity) to delete * an activity from your bot code. - * * @param context The context object for the turn. * @param reference Conversation reference information for the activity to delete. - * * @remarks * Not all channels support this operation. For channels that don't, this call may throw an exception. */ @@ -87,10 +79,8 @@ export abstract class BotAdapter { /** * Asynchronously resumes a conversation with a user, possibly after some time has gone by. - * * @param reference A reference to the conversation to continue. * @param logic The asynchronous method to call after the adapter middleware runs. - * * @remarks * This is often referred to as a _proactive notification_, the bot can proactively * send a message to a conversation or user without waiting for an incoming message. @@ -98,12 +88,11 @@ export abstract class BotAdapter { */ abstract continueConversation( reference: Partial, - logic: (revocableContext: TurnContext) => Promise + logic: (revocableContext: TurnContext) => Promise, ): Promise; /** * Asynchronously resumes a conversation with a user, possibly after some time has gone by. - * * @param botAppId The application ID of the bot. This parameter is ignored in single tenant the Adapters (Console,Test, etc) but is critical to the BotFrameworkAdapter which is multi-tenant aware. * @param reference A partial [ConversationReference](xref:botframework-schema.ConversationReference) to the conversation to continue. * @param logic The asynchronous method to call after the adapter middleware runs. @@ -112,12 +101,11 @@ export abstract class BotAdapter { continueConversationAsync( botAppId: string, reference: Partial, - logic: (context: TurnContext) => Promise + logic: (context: TurnContext) => Promise, ): Promise; /** * Asynchronously resumes a conversation with a user, possibly after some time has gone by. - * * @param claimsIdentity A [ClaimsIdentity](xref:botframework-connector) for the conversation. * @param reference A partial [ConversationReference](xref:botframework-schema.ConversationReference) to the conversation to continue. * @param logic The asynchronous method to call after the adapter middleware runs. @@ -126,12 +114,11 @@ export abstract class BotAdapter { continueConversationAsync( claimsIdentity: ClaimsIdentity, reference: Partial, - logic: (context: TurnContext) => Promise + logic: (context: TurnContext) => Promise, ): Promise; /** * Asynchronously resumes a conversation with a user, possibly after some time has gone by. - * * @param claimsIdentity A [ClaimsIdentity](xref:botframework-connector) for the conversation. * @param reference A partial [ConversationReference](xref:botframework-schema.ConversationReference) to the conversation to continue. * @param audience A value signifying the recipient of the proactive message. @@ -142,7 +129,7 @@ export abstract class BotAdapter { claimsIdentity: ClaimsIdentity, reference: Partial, audience: string, - logic: (context: TurnContext) => Promise + logic: (context: TurnContext) => Promise, ): Promise; /** @@ -152,14 +139,13 @@ export abstract class BotAdapter { _botAppIdOrClaimsIdentity: string | ClaimsIdentity, _reference: Partial, _logicOrAudience: ((context: TurnContext) => Promise) | string, - _maybeLogic?: (context: TurnContext) => Promise + _maybeLogic?: (context: TurnContext) => Promise, ): Promise { throw new Error('NotImplemented'); } /** * Creates a conversation on the specified channel. - * * @param _botAppId The application ID of the bot. * @param _channelId The ID for the channel. * @param _serviceUrl The ID for the channel. @@ -168,7 +154,6 @@ export abstract class BotAdapter { * @param _conversationParameters The conversation information to use to create the conversation * @param _logic The method to call for the resulting bot turn. * @returns A promise that represents the asynchronous operation - * * @remarks * To start a conversation, your bot must know its account information and the user's account information on that * channel. Most _channels only support initiating a direct message (non-group) conversation. @@ -185,14 +170,13 @@ export abstract class BotAdapter { _serviceUrl: string, _audience: string, _conversationParameters: ConversationParameters, - _logic: (context: TurnContext) => Promise + _logic: (context: TurnContext) => Promise, ): Promise { throw new Error('NotImplemented'); } /** * Gets or sets an error handler that can catch exceptions in the middleware or application. - * * @remarks * The error handler is called with these parameters: * @@ -208,7 +192,6 @@ export abstract class BotAdapter { /** * Sets an error handler that can catch exceptions in the middleware or application. - * * @remarks * The error handler is called with these parameters: * @@ -223,7 +206,6 @@ export abstract class BotAdapter { /** * Adds middleware to the adapter's pipeline. - * * @param {...any} middlewares The middleware or middleware handlers to add. * @returns The updated adapter object. * @remarks Middleware is added to the adapter at initialization time. @@ -237,11 +219,9 @@ export abstract class BotAdapter { /** * Starts activity processing for the current bot turn. - * * @param context The context object for the turn. * @param next A callback method to run at the end of the pipeline. * @returns A promise that resolves when the middleware chain is finished - * * @remarks * The adapter creates a revokable proxy for the turn context and then calls its middleware in * the order in which you added it. If the middleware chain completes without short circuiting, @@ -258,7 +238,7 @@ export abstract class BotAdapter { */ protected async runMiddleware( context: TurnContext, - next: (revocableContext: TurnContext) => Promise + next: (revocableContext: TurnContext) => Promise, ): Promise { if (context && context.activity && context.activity.locale) { context.locale = context.activity.locale; diff --git a/libraries/botbuilder-core/src/botComponent.ts b/libraries/botbuilder-core/src/botComponent.ts index 3273bfc184..f14809fc16 100644 --- a/libraries/botbuilder-core/src/botComponent.ts +++ b/libraries/botbuilder-core/src/botComponent.ts @@ -12,7 +12,6 @@ import { Configuration, ServiceCollection } from 'botbuilder-dialogs-adaptive-ru * gets called automatically on the components by the bot runtime, as long as the components are registered in the configuration. */ export abstract class BotComponent { - // eslint-disable-next-line @typescript-eslint/no-explicit-any static z = z.custom((val: any) => typeof val.configureServices === 'function', { message: 'BotComponent', }); diff --git a/libraries/botbuilder-core/src/botState.ts b/libraries/botbuilder-core/src/botState.ts index cf05501305..84cc56b069 100644 --- a/libraries/botbuilder-core/src/botState.ts +++ b/libraries/botbuilder-core/src/botState.ts @@ -27,7 +27,6 @@ export interface CachedBotState { /** * Base class for the frameworks state persistance scopes. - * * @remarks * This class will read and write state, to a provided storage provider, for each turn of * conversation with a user. Derived classes, like `ConversationState` and `UserState`, provide a @@ -41,16 +40,17 @@ export class BotState implements PropertyManager { /** * Creates a new BotState instance. - * * @param storage Storage provider to persist the state object to. * @param storageKey Function called anytime the storage key for a given turn needs to be calculated. */ - constructor(protected storage: Storage, protected storageKey: StorageKeyFactory) {} + constructor( + protected storage: Storage, + protected storageKey: StorageKeyFactory, + ) {} /** * Creates a new property accessor for reading and writing an individual property to the bot * states storage object. - * * @template T The type of property to create. Defaults to `any` type. * @param name Name of the property to add. * @returns An accessor for the property. @@ -62,7 +62,6 @@ export class BotState implements PropertyManager { /** * Reads in and caches the backing state object for a turn. - * * @remarks * Subsequent reads will return the cached object unless the `force` flag is passed in which * will force the state object to be re-read. @@ -95,7 +94,6 @@ export class BotState implements PropertyManager { /** * Saves the cached state object if it's been changed. - * * @remarks * If the `force` flag is passed in the cached state object will be saved regardless of * whether its been changed or not and if no object has been cached, an empty object will be @@ -132,7 +130,6 @@ export class BotState implements PropertyManager { /** * Clears the current state object for a turn. - * * @remarks * The cleared state object will not be persisted until [saveChanges()](#savechanges) has * been called. @@ -153,7 +150,6 @@ export class BotState implements PropertyManager { /** * Delete the backing state object for the current turn. - * * @remarks * The state object will be removed from storage if it exists. If the state object has been * read in and cached, the cache will be cleared. @@ -174,7 +170,6 @@ export class BotState implements PropertyManager { /** * Returns a cached state object or undefined if not cached. - * * @remarks * This example shows how to synchronously get an already loaded and cached state object: * diff --git a/libraries/botbuilder-core/src/botStatePropertyAccessor.ts b/libraries/botbuilder-core/src/botStatePropertyAccessor.ts index b6b1db2f1f..13f283c352 100644 --- a/libraries/botbuilder-core/src/botStatePropertyAccessor.ts +++ b/libraries/botbuilder-core/src/botStatePropertyAccessor.ts @@ -11,9 +11,7 @@ import { TurnContext } from './turnContext'; /** * Defines methods for accessing a state property created in a * [BotState](xref:botbuilder-core.BotState) object. - * * @template T The type of the state property to access. Default type is `any`. - * * @remarks * To create a state property in a state management objet, use the * [createProperty\](xref:botbuilder-core.BotState.createProperty) method. @@ -21,7 +19,6 @@ import { TurnContext } from './turnContext'; export interface StatePropertyAccessor { /** * Deletes the persisted property from its backing storage object. - * * @remarks * The properties backing storage object SHOULD be loaded into memory on first access. * @@ -34,7 +31,6 @@ export interface StatePropertyAccessor { /** * Reads a persisted property from its backing storage object. - * * @remarks * The properties backing storage object SHOULD be loaded into memory on first access. * @@ -46,14 +42,17 @@ export interface StatePropertyAccessor { * const value = await myProperty.get(context, { count: 0 }); * ``` * @param context Context for the current turn of conversation with the user. - * @param defaultValue (Optional) default value to copy to the backing storage object if the property isn't found. */ get(context: TurnContext): Promise; + + /** + * @param context Context for the current turn of conversation with the user. + * @param defaultValue (Optional) default value to copy to the backing storage object if the property isn't found. + */ get(context: TurnContext, defaultValue: T): Promise; /** * Assigns a new value to the properties backing storage object. - * * @remarks * The properties backing storage object SHOULD be loaded into memory on first access. * @@ -71,7 +70,6 @@ export interface StatePropertyAccessor { /** * A `BotState` specific implementation of the `StatePropertyAccessor` interface. - * * @remarks * Properties can be defined for a given `BotState` instance using `createProperty()`. * @@ -84,15 +82,16 @@ export interface StatePropertyAccessor { export class BotStatePropertyAccessor implements StatePropertyAccessor { /** * Creates a new BotStatePropertyAccessor instance. - * * @param state Parent BotState instance. * @param name Unique name of the property for the parent BotState. */ - constructor(protected readonly state: BotState, public readonly name: string) {} + constructor( + protected readonly state: BotState, + public readonly name: string, + ) {} /** * Deletes the persisted property from its backing storage object. - * * @param context [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. */ async delete(context: TurnContext): Promise { @@ -104,7 +103,6 @@ export class BotStatePropertyAccessor implements StatePropertyAccessor< /** * Reads a persisted property from its backing storage object. - * * @param context [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. * @returns A JSON representation of the cached state. */ @@ -112,7 +110,6 @@ export class BotStatePropertyAccessor implements StatePropertyAccessor< async get(context: TurnContext, defaultValue: T): Promise; /** * Reads a persisted property from its backing storage object. - * * @param context [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. * @param defaultValue Optional. Default value for the property. * @returns A JSON representation of the cached state. @@ -132,7 +129,6 @@ export class BotStatePropertyAccessor implements StatePropertyAccessor< /** * Assigns a new value to the properties backing storage object. - * * @param context [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. * @param value Value to set on the property. */ diff --git a/libraries/botbuilder-core/src/botStateSet.ts b/libraries/botbuilder-core/src/botStateSet.ts index e8e4027e78..6b619990bb 100644 --- a/libraries/botbuilder-core/src/botStateSet.ts +++ b/libraries/botbuilder-core/src/botStateSet.ts @@ -20,7 +20,6 @@ export class BotStateSet { /** * Creates a new BotStateSet instance. - * * @param botStates One or more BotState plugins to register. */ constructor(...botStates: BotState[]) { @@ -29,7 +28,6 @@ export class BotStateSet { /** * Registers one or more `BotState` plugins with the set. - * * @param botStates One or more BotState plugins to register. * @returns The updated BotStateSet. */ @@ -47,7 +45,6 @@ export class BotStateSet { /** * Calls `BotState.load()` on all of the BotState plugins in the set. - * * @remarks * This will trigger all of the plugins to read in their state in parallel. * @@ -67,7 +64,6 @@ export class BotStateSet { /** * Calls `BotState.saveChanges()` on all of the BotState plugins in the set. - * * @remarks * This will trigger all of the plugins to write out their state in parallel. * @@ -79,7 +75,7 @@ export class BotStateSet { */ async saveAllChanges(context: TurnContext, force = false): Promise { const promises: Promise[] = this.botStates.map((botstate: BotState) => - botstate.saveChanges(context, force) + botstate.saveChanges(context, force), ); await Promise.all(promises); diff --git a/libraries/botbuilder-core/src/botTelemetryClient.ts b/libraries/botbuilder-core/src/botTelemetryClient.ts index 916215da7a..9173b6da42 100644 --- a/libraries/botbuilder-core/src/botTelemetryClient.ts +++ b/libraries/botbuilder-core/src/botTelemetryClient.ts @@ -76,7 +76,6 @@ export interface TelemetryPageView { export class NullTelemetryClient implements BotTelemetryClient, BotPageViewTelemetryClient { /** * Creates a new instance of the [NullTelemetryClient](xref:botbuilder-core.NullTelemetryClient) class. - * * @param _settings Optional. Settings for the telemetry client. */ constructor(_settings?: any) { @@ -85,7 +84,6 @@ export class NullTelemetryClient implements BotTelemetryClient, BotPageViewTelem /** * Logs an Application Insights page view. - * * @param _telemetry An object implementing [TelemetryPageView](xref:botbuilder-core.TelemetryPageView). */ trackPageView(_telemetry: TelemetryPageView) { @@ -94,7 +92,6 @@ export class NullTelemetryClient implements BotTelemetryClient, BotPageViewTelem /** * Sends information about an external dependency (outgoing call) in the application. - * * @param _telemetry An object implementing [TelemetryDependency](xref:botbuilder-core.TelemetryDependency). */ trackDependency(_telemetry: TelemetryDependency) { @@ -103,7 +100,6 @@ export class NullTelemetryClient implements BotTelemetryClient, BotPageViewTelem /** * Logs custom events with extensible named fields. - * * @param _telemetry An object implementing [TelemetryEvent](xref:botbuilder-core.TelemetryEvent). */ trackEvent(_telemetry: TelemetryEvent) { @@ -112,7 +108,6 @@ export class NullTelemetryClient implements BotTelemetryClient, BotPageViewTelem /** * Logs a system exception. - * * @param _telemetry An object implementing [TelemetryException](xref:botbuilder-core.TelemetryException). */ trackException(_telemetry: TelemetryException) { @@ -121,7 +116,6 @@ export class NullTelemetryClient implements BotTelemetryClient, BotPageViewTelem /** * Sends a trace message. - * * @param _telemetry An object implementing [TelemetryTrace](xref:botbuilder-core.TelemetryTrace). */ trackTrace(_telemetry: TelemetryTrace) { @@ -139,7 +133,6 @@ export class NullTelemetryClient implements BotTelemetryClient, BotPageViewTelem /** * Logs a DialogView using the [trackPageView](xref:botbuilder-core.BotTelemetryClient.trackPageView) method on the [BotTelemetryClient](xref:botbuilder-core.BotTelemetryClient) if [BotPageViewTelemetryClient](xref:botbuilder-core.BotPageViewTelemetryClient) has been implemented. * Alternatively logs the information out via TrackTrace. - * * @param telemetryClient TelemetryClient that implements [BotTelemetryClient](xref:botbuilder-core.BotTelemetryClient). * @param dialogName Name of the dialog to log the entry / start for. * @param properties Named string values you can use to search and classify events. @@ -149,7 +142,7 @@ export function telemetryTrackDialogView( telemetryClient: BotTelemetryClient, dialogName: string, properties?: { [key: string]: any }, - metrics?: { [key: string]: number } + metrics?: { [key: string]: number }, ): void { if (!clientSupportsTrackDialogView(telemetryClient)) { throw new TypeError('"telemetryClient" parameter does not have methods trackPageView() or trackTrace()'); diff --git a/libraries/botbuilder-core/src/browserStorage.ts b/libraries/botbuilder-core/src/browserStorage.ts index f958145aa3..1551861df7 100644 --- a/libraries/botbuilder-core/src/browserStorage.ts +++ b/libraries/botbuilder-core/src/browserStorage.ts @@ -9,7 +9,6 @@ import { MemoryStorage } from './memoryStorage'; /** * Storage provider that uses browser local storage. - * * @remarks * Anything written to the store will remain persisted until the user manually flushes their * browsers cookies and other site data. @@ -31,7 +30,6 @@ export class BrowserLocalStorage extends MemoryStorage { /** * Storage provider that uses browser session storage. - * * @remarks * Anything written to the store will only be persisted for the lifetime of a single page within a * browser tab. The storage will survive page reloads but closing the tab will delete anything diff --git a/libraries/botbuilder-core/src/cardFactory.ts b/libraries/botbuilder-core/src/cardFactory.ts index 68b2b4e356..d58fbe685e 100644 --- a/libraries/botbuilder-core/src/cardFactory.ts +++ b/libraries/botbuilder-core/src/cardFactory.ts @@ -23,7 +23,6 @@ import { /** * Provides methods for formatting the various card types a bot can return. - * * @remarks * All of these functions return an [Attachment](xref:botframework-schema.Attachment) object, * which can be added to an existing activity's [attachments](xref:botframework-schema.Activity.attachments) collection directly or @@ -62,10 +61,8 @@ export class CardFactory { /** * Returns an attachment for an Adaptive Card. - * * @param card A description of the Adaptive Card to return. * @returns An [Attachment](xref:botframework-schema.Attachment). - * * @remarks * Adaptive Cards are an open card exchange format enabling developers to exchange UI content in a common and consistent way. * For channels that don't yet support Adaptive Cards natively, the Bot Framework will @@ -103,7 +100,6 @@ export class CardFactory { /** * Returns an attachment for an animation card. - * * @param title The card title. * @param media The media URLs for the card. * @param buttons Optional. The array of buttons to include on the card. Each `string` in the array @@ -115,14 +111,13 @@ export class CardFactory { title: string, media: (MediaUrl | string)[], buttons?: (CardAction | string)[], - other?: Partial + other?: Partial, ): Attachment { return mediaCard(CardFactory.contentTypes.animationCard, title, media, buttons, other); } /** * Returns an attachment for an audio card. - * * @param title The card title. * @param media The media URL for the card. * @param buttons Optional. The array of buttons to include on the card. Each `string` in the array @@ -134,14 +129,13 @@ export class CardFactory { title: string, media: (MediaUrl | string)[], buttons?: (CardAction | string)[], - other?: Partial + other?: Partial, ): Attachment { return mediaCard(CardFactory.contentTypes.audioCard, title, media, buttons, other); } /** * Returns an attachment for a hero card. - * * @param title The card title. * @param images Optional. The array of images to include on the card. Each element can be a * [CardImage](ref:botframework-schema.CardImage) or the URL of the image to include. @@ -149,7 +143,6 @@ export class CardFactory { * is converted to an `imBack` button with a title and value set to the value of the string. * @param other Optional. Any additional properties to include on the card. * @returns An [Attachment](xref:botframework-schema.Attachment). - * * @remarks * Hero cards tend to have one dominant, full-width image. * Channels typically render the card's text and buttons below the image. @@ -167,11 +160,10 @@ export class CardFactory { title: string, images?: (CardImage | string)[], buttons?: (CardAction | string)[], - other?: Partial + other?: Partial, ): Attachment; /** * Returns an attachment for a hero card. - * * @param title The card title. * @param text The card text. * @param images Optional. The array of images to include on the card. Each element can be a @@ -180,7 +172,6 @@ export class CardFactory { * is converted to an `imBack` button with a title and value set to the value of the string. * @param other Optional. Any additional properties to include on the card. * @returns An [Attachment](xref:botframework-schema.Attachment). - * * @remarks * Hero cards tend to have one dominant, full-width image. * Channels typically render the card's text and buttons below the image. @@ -198,11 +189,10 @@ export class CardFactory { text: string, images?: (CardImage | string)[], buttons?: (CardAction | string)[], - other?: Partial + other?: Partial, ): Attachment; /** * Returns an attachment for a hero card. - * * @param title The card title. * @param text Optional. The card text. * @param images Optional. The array of images to include on the card. Each element can be a @@ -211,7 +201,6 @@ export class CardFactory { * is converted to an `imBack` button with a title and value set to the value of the string. * @param other Optional. Any additional properties to include on the card. * @returns An [Attachment](xref:botframework-schema.Attachment). - * * @remarks * Hero cards tend to have one dominant, full-width image. * Channels typically render the card's text and buttons below the image. @@ -232,7 +221,6 @@ export class CardFactory { /** * Returns an attachment for an OAuth card. - * * @param connectionName The name of the OAuth connection to use. * @param title The title for the card's sign-in button. * @param text Optional. Additional text to include on the card. @@ -248,7 +236,7 @@ export class CardFactory { text?: string, link?: string, tokenExchangeResource?: TokenExchangeResource, - tokenPostResource?: TokenPostResource + tokenPostResource?: TokenPostResource, ): Attachment { const card: Partial = { buttons: [{ type: ActionTypes.Signin, title: title, value: link, channelData: undefined }], @@ -265,10 +253,8 @@ export class CardFactory { /** * Returns an attachment for an Office 365 connector card. - * * @param card a description of the Office 365 connector card to return. * @returns An [Attachment](xref:botframework-schema.Attachment). - * * @remarks * For example: * ```JavaScript @@ -293,7 +279,6 @@ export class CardFactory { /** * Returns an attachment for a receipt card. - * * @param card A description of the receipt card to return. * @returns An [Attachment](xref:botframework-schema.Attachment). */ @@ -303,12 +288,10 @@ export class CardFactory { /** * Returns an attachment for a sign-in card. - * * @param title The title for the card's sign-in button. * @param url The URL of the sign-in page to use. * @param text Optional. Additional text to include on the card. * @returns An [Attachment](xref:botframework-schema.Attachment). - * * @remarks * For channels that don't natively support sign-in cards, an alternative message is rendered. */ @@ -325,7 +308,6 @@ export class CardFactory { /** * Returns an attachment for a thumbnail card. - * * @param title The card title. * @param images Optional. The array of images to include on the card. Each element can be a * [CardImage](ref:botframework-schema.CardImage) or the URL of the image to include. @@ -333,7 +315,6 @@ export class CardFactory { * is converted to an `imBack` button with a title and value set to the value of the string. * @param other Optional. Any additional properties to include on the card. * @returns An [Attachment](xref:botframework-schema.Attachment). - * * @remarks * Thumbnail cards are similar to hero cards but instead of a full width image, * they're typically rendered with a smaller thumbnail version of the image. @@ -344,11 +325,10 @@ export class CardFactory { title: string, images?: (CardImage | string)[], buttons?: (CardAction | string)[], - other?: Partial + other?: Partial, ): Attachment; /** * Returns an attachment for a thumbnail card. - * * @param title The card title. * @param text The card text. * @param images Optional. The array of images to include on the card. Each element can be a @@ -357,7 +337,6 @@ export class CardFactory { * is converted to an `imBack` button with a title and value set to the value of the string. * @param other Optional. Any additional properties to include on the card. * @returns An [Attachment](xref:botframework-schema.Attachment). - * * @remarks * Thumbnail cards are similar to hero cards but instead of a full width image, * they're typically rendered with a smaller thumbnail version of the image. @@ -369,11 +348,10 @@ export class CardFactory { text: string, images?: (CardImage | string)[], buttons?: (CardAction | string)[], - other?: Partial + other?: Partial, ): Attachment; /** * Returns an attachment for a thumbnail card. - * * @param title The card title. * @param text Optional. The card text. * @param images Optional. The array of images to include on the card. Each element can be a @@ -382,7 +360,6 @@ export class CardFactory { * is converted to an `imBack` button with a title and value set to the value of the string. * @param other Optional. Any additional properties to include on the card. * @returns An [Attachment](xref:botframework-schema.Attachment). - * * @remarks * Thumbnail cards are similar to hero cards but instead of a full width image, * they're typically rendered with a smaller thumbnail version of the image. @@ -394,7 +371,7 @@ export class CardFactory { text?: any, images?: any, buttons?: any, - other?: Partial + other?: Partial, ): Attachment { if (typeof text !== 'string') { other = buttons; @@ -421,7 +398,6 @@ export class CardFactory { /** * Returns an attachment for a video card. - * * @param title The card title. * @param media The media URLs for the card. * @param buttons Optional. The array of buttons to include on the card. Each `string` in the array @@ -433,14 +409,13 @@ export class CardFactory { title: string, media: (MediaUrl | string)[], buttons?: (CardAction | string)[], - other?: Partial + other?: Partial, ): Attachment { return mediaCard(CardFactory.contentTypes.videoCard, title, media, buttons, other); } /** * Returns a properly formatted array of actions. - * * @param actions The array of action to include on the card. Each `string` in the array * is converted to an `imBack` button with a title and value set to the value of the string. * @returns A properly formatted array of actions. @@ -465,7 +440,6 @@ export class CardFactory { /** * Returns a properly formatted array of card images. - * * @param images The array of images to include on the card. Each element can be a * [CardImage](ref:botframework-schema.CardImage) or the URL of the image to include. * @returns A properly formatted array of card images. @@ -485,7 +459,6 @@ export class CardFactory { /** * Returns a properly formatted array of media URL objects. - * * @param links The media URLs. Each `string` is converted to a media URL object. * @returns A properly formatted array of media URL objects. */ @@ -511,7 +484,7 @@ function mediaCard( title: string, media: (MediaUrl | string)[], buttons?: (CardAction | string)[], - other?: any + other?: any, ): Attachment { const card: VideoCard = { ...other }; if (title) { diff --git a/libraries/botbuilder-core/src/cloudAdapterBase.ts b/libraries/botbuilder-core/src/cloudAdapterBase.ts index 362f9dc158..e329aa6329 100644 --- a/libraries/botbuilder-core/src/cloudAdapterBase.ts +++ b/libraries/botbuilder-core/src/cloudAdapterBase.ts @@ -40,7 +40,6 @@ export abstract class CloudAdapterBase extends BotAdapter { /** * Create a new [CloudAdapterBase](xref:botbuilder.CloudAdapterBase) instance. - * * @param botFrameworkAuthentication A [BotFrameworkAuthentication](xref:botframework-connector.BotFrameworkAuthentication) used for validating and creating tokens. */ constructor(protected readonly botFrameworkAuthentication: BotFrameworkAuthentication) { @@ -88,12 +87,12 @@ export abstract class CloudAdapterBase extends BotAdapter { response = await connectorClient.conversations.replyToActivity( activity.conversation.id, activity.replyToId, - activity + activity, ); } else { response = await connectorClient.conversations.sendToConversation( activity.conversation.id, - activity + activity, ); } } @@ -128,7 +127,7 @@ export abstract class CloudAdapterBase extends BotAdapter { const response = await connectorClient.conversations.updateActivity( activity.conversation.id, activity.id, - activity + activity, ); return response?.id ? { id: response.id } : undefined; @@ -156,15 +155,14 @@ export abstract class CloudAdapterBase extends BotAdapter { /** * @inheritdoc - * * @deprecated */ async continueConversation( _reference: Partial, - _logic: (context: TurnContext) => Promise + _logic: (context: TurnContext) => Promise, ): Promise { throw new Error( - '`CloudAdapterBase.continueConversation` is deprecated, please use `CloudAdapterBase.continueConversationAsync`' + '`CloudAdapterBase.continueConversation` is deprecated, please use `CloudAdapterBase.continueConversationAsync`', ); } @@ -175,7 +173,7 @@ export abstract class CloudAdapterBase extends BotAdapter { botAppIdOrClaimsIdentity: string | ClaimsIdentity, reference: Partial, logicOrAudience: ((context: TurnContext) => Promise) | string, - maybeLogic?: (context: TurnContext) => Promise + maybeLogic?: (context: TurnContext) => Promise, ): Promise { const botAppId = typeof botAppIdOrClaimsIdentity === 'string' ? botAppIdOrClaimsIdentity : undefined; @@ -200,7 +198,7 @@ export abstract class CloudAdapterBase extends BotAdapter { serviceUrl: string, audience: string, conversationParameters: ConversationParameters, - logic: (context: TurnContext) => Promise + logic: (context: TurnContext) => Promise, ): Promise { if (typeof serviceUrl !== 'string' || !serviceUrl) { throw new TypeError('`serviceUrl` must be a non-empty string'); @@ -227,7 +225,7 @@ export abstract class CloudAdapterBase extends BotAdapter { createConversationResult.id, channelId, serviceUrl, - conversationParameters + conversationParameters, ); // Create a UserTokenClient instance for the application to use. (For example, in the OAuthPrompt.) @@ -241,7 +239,7 @@ export abstract class CloudAdapterBase extends BotAdapter { connectorClient, userTokenClient, logic, - connectorFactory + connectorFactory, ); // Run the pipeline. @@ -252,7 +250,7 @@ export abstract class CloudAdapterBase extends BotAdapter { createdConversationId: string | undefined, channelId: string, serviceUrl: string, - conversationParameters: ConversationParameters + conversationParameters: ConversationParameters, ): Partial { // Create a conversation update activity to represent the result. const activity = ActivityEx.createEventActivity(); @@ -276,7 +274,6 @@ export abstract class CloudAdapterBase extends BotAdapter { /** * The implementation for continue conversation. - * * @param claimsIdentity The [ClaimsIdentity](xref:botframework-connector.ClaimsIdentity) for the conversation. * @param continuationActivity The continuation [Activity](xref:botframework-schema.Activity) used to create the [TurnContext](xref:botbuilder-core.TurnContext). * @param audience The audience for the call. @@ -287,7 +284,7 @@ export abstract class CloudAdapterBase extends BotAdapter { claimsIdentity: ClaimsIdentity, continuationActivity: Partial, audience: string | undefined, - logic: (context: TurnContext) => Promise + logic: (context: TurnContext) => Promise, ): Promise { // Create the connector factory and the inbound request, extracting parameters and then create a connector for outbound requests. const connectorFactory = this.botFrameworkAuthentication.createConnectorFactory(claimsIdentity); @@ -306,7 +303,7 @@ export abstract class CloudAdapterBase extends BotAdapter { connectorClient, userTokenClient, logic, - connectorFactory + connectorFactory, ); // Run the pipeline. @@ -315,7 +312,6 @@ export abstract class CloudAdapterBase extends BotAdapter { /** * The implementation for processing an Activity sent to this bot. - * * @param authHeader The authorization header from the http request. * @param activity The [Activity](xref:botframework-schema.Activity) to process. * @param logic The function to call for the resulting bot turn. @@ -324,12 +320,11 @@ export abstract class CloudAdapterBase extends BotAdapter { protected processActivity( authHeader: string, activity: Activity, - logic: (context: TurnContext) => Promise + logic: (context: TurnContext) => Promise, ): Promise; /** * The implementation for processing an Activity sent to this bot. - * * @param authenticateRequestResult The [AuthenticateRequestResult](xref:botframework-connector.AuthenticateRequestResult) for this turn. * @param activity The [Activity](xref:botframework-schema.Activity) to process. * @param logic The function to call for the resulting bot turn. @@ -338,7 +333,7 @@ export abstract class CloudAdapterBase extends BotAdapter { protected processActivity( authenticateRequestResult: AuthenticateRequestResult, activity: Activity, - logic: (context: TurnContext) => Promise + logic: (context: TurnContext) => Promise, ): Promise; /** @@ -347,14 +342,14 @@ export abstract class CloudAdapterBase extends BotAdapter { protected async processActivity( authHeaderOrAuthenticateRequestResult: string | AuthenticateRequestResult, activity: Activity, - logic: (context: TurnContext) => Promise + logic: (context: TurnContext) => Promise, ): Promise { // Authenticate the inbound request, extracting parameters and create a ConnectorFactory for creating a Connector for outbound requests. const authenticateRequestResult = typeof authHeaderOrAuthenticateRequestResult === 'string' ? await this.botFrameworkAuthentication.authenticateRequest( activity, - authHeaderOrAuthenticateRequestResult + authHeaderOrAuthenticateRequestResult, ) : authHeaderOrAuthenticateRequestResult; @@ -364,7 +359,7 @@ export abstract class CloudAdapterBase extends BotAdapter { // Create the connector client to use for outbound requests. const connectorClient = await authenticateRequestResult.connectorFactory?.create( activity.serviceUrl, - authenticateRequestResult.audience + authenticateRequestResult.audience, ); if (!connectorClient) { @@ -373,7 +368,7 @@ export abstract class CloudAdapterBase extends BotAdapter { // Create a UserTokenClient instance for the application to use. (For example, it would be used in a sign-in prompt.) const userTokenClient = await this.botFrameworkAuthentication.createUserTokenClient( - authenticateRequestResult.claimsIdentity + authenticateRequestResult.claimsIdentity, ); // Create a turn context and run the pipeline. @@ -384,7 +379,7 @@ export abstract class CloudAdapterBase extends BotAdapter { connectorClient, userTokenClient, logic, - authenticateRequestResult.connectorFactory + authenticateRequestResult.connectorFactory, ); // Run the pipeline. @@ -397,7 +392,6 @@ export abstract class CloudAdapterBase extends BotAdapter { /** * This is a helper to create the ClaimsIdentity structure from an appId that will be added to the TurnContext. * It is intended for use in proactive and named-pipe scenarios. - * * @param botAppId The bot's application id. * @returns a [ClaimsIdentity](xref:botframework-connector.ClaimsIdentity) with the audience and appId claims set to the botAppId. */ @@ -421,7 +415,7 @@ export abstract class CloudAdapterBase extends BotAdapter { connectorClient: ConnectorClient, userTokenClient: UserTokenClient, logic: (context: TurnContext) => Promise, - connectorFactory: ConnectorFactory + connectorFactory: ConnectorFactory, ): TurnContext { const context = new TurnContext(this, activity); diff --git a/libraries/botbuilder-core/src/componentRegistration.ts b/libraries/botbuilder-core/src/componentRegistration.ts index 7dee887bdd..53a5d149fc 100644 --- a/libraries/botbuilder-core/src/componentRegistration.ts +++ b/libraries/botbuilder-core/src/componentRegistration.ts @@ -14,7 +14,6 @@ export class ComponentRegistration { /** * Gets list of all ComponentRegistration objects registered. - * * @returns A list of ComponentRegistration objects. */ static get components(): ComponentRegistration[] { @@ -23,7 +22,6 @@ export class ComponentRegistration { /** * Add a component, only one instance per type is allowed for components. - * * @param componentRegistration The component to be registered. */ static add(componentRegistration: ComponentRegistration): void { diff --git a/libraries/botbuilder-core/src/configurationBotFrameworkAuthentication.ts b/libraries/botbuilder-core/src/configurationBotFrameworkAuthentication.ts index f80d6a62e4..7db1829465 100644 --- a/libraries/botbuilder-core/src/configurationBotFrameworkAuthentication.ts +++ b/libraries/botbuilder-core/src/configurationBotFrameworkAuthentication.ts @@ -49,7 +49,6 @@ const TypedOptions = z /** * A string used to indicate if which cloud the bot is operating in (e.g. Public Azure or US Government). - * * @remarks * A `null` or `''` value indicates Public Azure, whereas [GovernmentConstants.ChannelService](xref:botframework-connector.GovernmentConstants.ChannelService) indicates the bot is operating in the US Government cloud. * @@ -69,7 +68,6 @@ const TypedOptions = z /** * The Oauth scope to request. - * * @remarks * This value is used when fetching a token to indicate the ultimate recipient or `audience` of an activity sent using these credentials. */ @@ -125,7 +123,6 @@ export class ConfigurationBotFrameworkAuthentication extends BotFrameworkAuthent /** * Initializes a new instance of the [ConfigurationBotFrameworkAuthentication](xref:botbuilder-core.ConfigurationBotFrameworkAuthentication) class. - * * @param botFrameworkAuthConfig A [ConfigurationBotFrameworkAuthenticationOptions](xref:botbuilder-core.ConfigurationBotFrameworkAuthenticationOptions) object. * @param credentialsFactory A [ServiceClientCredentialsFactory](xref:botframework-connector.ServiceClientCredentialsFactory) instance. * @param authConfiguration A [Configuration](xref:botframework-connector.AuthenticationConfiguration) object. @@ -137,7 +134,7 @@ export class ConfigurationBotFrameworkAuthentication extends BotFrameworkAuthent credentialsFactory?: ServiceClientCredentialsFactory, authConfiguration?: AuthenticationConfiguration, botFrameworkClientFetch?: (input: RequestInfo, init?: RequestInit) => Promise, - connectorClientOptions: ConnectorClientOptions = {} + connectorClientOptions: ConnectorClientOptions = {}, ) { super(); @@ -177,11 +174,11 @@ export class ConfigurationBotFrameworkAuthentication extends BotFrameworkAuthent CallerId, credentialsFactory ?? new ConfigurationServiceClientCredentialFactory( - typedBotFrameworkAuthConfig as ConfigurationServiceClientCredentialFactoryOptions + typedBotFrameworkAuthConfig as ConfigurationServiceClientCredentialFactoryOptions, ), authConfiguration ?? { requiredEndorsements: [] }, botFrameworkClientFetch, - connectorClientOptions + connectorClientOptions, ); } catch (err) { // Throw a new error with the validation details prominently featured. @@ -194,7 +191,6 @@ export class ConfigurationBotFrameworkAuthentication extends BotFrameworkAuthent /** * Authenticate Bot Framework Protocol requests to Skills. - * * @param authHeader The http auth header received in the skill request. * @returns {Promise} A [ClaimsIdentity](xref:botframework-connector.ClaimsIdentity). */ @@ -204,7 +200,6 @@ export class ConfigurationBotFrameworkAuthentication extends BotFrameworkAuthent /** * Validate Bot Framework Protocol requests. - * * @param activity The inbound Activity. * @param authHeader The HTTP auth header. * @returns {Promise} An [AuthenticateRequestResult](xref:botframework-connector.AuthenticateRequestResult). @@ -215,7 +210,6 @@ export class ConfigurationBotFrameworkAuthentication extends BotFrameworkAuthent /** * Validate Bot Framework Protocol requests. - * * @param authHeader The HTTP auth header. * @param channelIdHeader The channel ID HTTP header. * @returns {Promise} An [AuthenticateRequestResult](xref:botframework-connector.AuthenticateRequestResult). @@ -226,7 +220,6 @@ export class ConfigurationBotFrameworkAuthentication extends BotFrameworkAuthent /** * Creates a BotFrameworkClient for calling Skills. - * * @returns A [BotFrameworkClient](xref:botframework-connector.BotFrameworkClient). */ createBotFrameworkClient(): BotFrameworkClient { @@ -235,7 +228,6 @@ export class ConfigurationBotFrameworkAuthentication extends BotFrameworkAuthent /** * Creates a ConnectorFactory that can be used to create ConnectorClients that can use credentials from this particular Cloud Environment. - * * @param claimsIdentity The inbound Activity's ClaimsIdentity. * @returns A [ConnectorFactory](xref:botframework-connector.ConnectorFactory). */ @@ -245,7 +237,6 @@ export class ConfigurationBotFrameworkAuthentication extends BotFrameworkAuthent /** * Creates the appropriate UserTokenClient instance. - * * @param claimsIdentity The inbound Activity's ClaimsIdentity. * @returns {Promise} An [UserTokenClient](xref:botframework-connector.UserTokenClient). */ @@ -256,7 +247,6 @@ export class ConfigurationBotFrameworkAuthentication extends BotFrameworkAuthent /** * Creates a new instance of the [ConfigurationBotFrameworkAuthentication](xref:botbuilder-core.ConfigurationBotFrameworkAuthentication) class. - * * @remarks * The [Configuration](xref:botbuilder-dialogs-adaptive-runtime-core.Configuration) instance provided to the constructor should * have the desired authentication values available at the root, using the properties of [ConfigurationBotFrameworkAuthenticationOptions](xref:botbuilder-core.ConfigurationBotFrameworkAuthenticationOptions) as its keys. @@ -272,7 +262,7 @@ export function createBotFrameworkAuthenticationFromConfiguration( credentialsFactory?: ServiceClientCredentialsFactory, authConfiguration?: AuthenticationConfiguration, botFrameworkClientFetch?: (input: RequestInfo, init?: RequestInit) => Promise, - connectorClientOptions: ConnectorClientOptions = {} + connectorClientOptions: ConnectorClientOptions = {}, ): BotFrameworkAuthentication { const botFrameworkAuthConfig = configuration?.get(); @@ -281,6 +271,6 @@ export function createBotFrameworkAuthenticationFromConfiguration( credentialsFactory, authConfiguration, botFrameworkClientFetch, - connectorClientOptions + connectorClientOptions, ); } diff --git a/libraries/botbuilder-core/src/configurationServiceClientCredentialFactory.ts b/libraries/botbuilder-core/src/configurationServiceClientCredentialFactory.ts index 29000496fe..d226636854 100644 --- a/libraries/botbuilder-core/src/configurationServiceClientCredentialFactory.ts +++ b/libraries/botbuilder-core/src/configurationServiceClientCredentialFactory.ts @@ -65,7 +65,6 @@ export class ConfigurationServiceClientCredentialFactory extends PasswordService /** * Initializes a new instance of the [ConfigurationServiceClientCredentialFactory](xref:botbuilder-core.ConfigurationServiceClientCredentialFactory) class. - * * @param factoryOptions A [ConfigurationServiceClientCredentialFactoryOptions](xref:botbuilder-core.ConfigurationServiceClientCredentialFactoryOptions) object. */ constructor(factoryOptions: ConfigurationServiceClientCredentialFactoryOptions = {}) { @@ -85,11 +84,11 @@ export class ConfigurationServiceClientCredentialFactory extends PasswordService if (withCertificate) { ok( CertificateThumbprint?.trim(), - 'CertificateThumbprint is required when using a Certificate in configuration.' + 'CertificateThumbprint is required when using a Certificate in configuration.', ); ok( CertificatePrivateKey?.trim(), - 'CertificatePrivateKey is required when using a Certificate in configuration.' + 'CertificatePrivateKey is required when using a Certificate in configuration.', ); } @@ -101,7 +100,7 @@ export class ConfigurationServiceClientCredentialFactory extends PasswordService this.inner = new ManagedIdentityServiceClientCredentialsFactory( MicrosoftAppId, - new JwtTokenProviderFactory() + new JwtTokenProviderFactory(), ); break; case SingleTenant.toLocaleLowerCase(): @@ -113,18 +112,18 @@ export class ConfigurationServiceClientCredentialFactory extends PasswordService MicrosoftAppId, CertificateThumbprint, CertificatePrivateKey, - MicrosoftAppTenantId + MicrosoftAppTenantId, ); } else { ok( MicrosoftAppPassword?.trim(), - 'MicrosoftAppPassword is required for SingleTenant in configuration.' + 'MicrosoftAppPassword is required for SingleTenant in configuration.', ); this.inner = new PasswordServiceClientCredentialFactory( MicrosoftAppId, MicrosoftAppPassword, - MicrosoftAppTenantId + MicrosoftAppTenantId, ); } break; @@ -133,13 +132,13 @@ export class ConfigurationServiceClientCredentialFactory extends PasswordService if (withCertificate) { ok( MicrosoftAppId?.trim(), - 'MicrosoftAppId is required for MultiTenant when using a Certificate in configuration.' + 'MicrosoftAppId is required for MultiTenant when using a Certificate in configuration.', ); this.inner = new CertificateServiceClientCredentialsFactory( MicrosoftAppId, CertificateThumbprint, - CertificatePrivateKey + CertificatePrivateKey, ); } else { this.inner = new PasswordServiceClientCredentialFactory(MicrosoftAppId, MicrosoftAppPassword, ''); @@ -169,7 +168,7 @@ export class ConfigurationServiceClientCredentialFactory extends PasswordService microsoftAppId: string, audience: string, loginEndpoint: string, - validateAuthority: boolean + validateAuthority: boolean, ): Promise { return this.inner.createCredentials(microsoftAppId, audience, loginEndpoint, validateAuthority); } @@ -177,7 +176,6 @@ export class ConfigurationServiceClientCredentialFactory extends PasswordService /** * Creates a new instance of the [ConfigurationServiceClientCredentialFactory](xref:botbuilder-core.ConfigurationServiceClientCredentialFactory) class. - * * @remarks * The [Configuration](xref:botbuilder-dialogs-adaptive-runtime-core.Configuration) instance provided to the constructor should * have the desired authentication values available at the root, using the properties of [ConfigurationServiceClientCredentialFactoryOptions](xref:botbuilder-core.ConfigurationServiceClientCredentialFactoryOptions) as its keys. @@ -185,7 +183,7 @@ export class ConfigurationServiceClientCredentialFactory extends PasswordService * @returns A [ConfigurationServiceClientCredentialFactory](xref:botbuilder-core.ConfigurationServiceClientCredentialFactory) instance. */ export function createServiceClientCredentialFactoryFromConfiguration( - configuration: Configuration + configuration: Configuration, ): ConfigurationServiceClientCredentialFactory { const factoryOptions = configuration.get(); return new ConfigurationServiceClientCredentialFactory(factoryOptions); diff --git a/libraries/botbuilder-core/src/conversationState.ts b/libraries/botbuilder-core/src/conversationState.ts index 241e69aeb6..c2baa5f5f0 100644 --- a/libraries/botbuilder-core/src/conversationState.ts +++ b/libraries/botbuilder-core/src/conversationState.ts @@ -14,7 +14,6 @@ const NO_KEY = 'ConversationState: overridden getStorageKey method did not retur /** * Reads and writes conversation state for your bot to storage. - * * @remarks * Each conversation your bot has with a user or group will have its own isolated storage object * that can be used to persist conversation tracking information between turns of the conversation. @@ -29,11 +28,13 @@ const NO_KEY = 'ConversationState: overridden getStorageKey method did not retur export class ConversationState extends BotState { /** * Creates a new ConversationState instance. - * * @param storage Storage provider to persist conversation state to. * @param namespace (Optional) namespace to append to storage keys. Defaults to an empty string. */ - constructor(storage: Storage, private namespace: string = '') { + constructor( + storage: Storage, + private namespace: string = '', + ) { super(storage, (context: TurnContext) => { // Calculate storage key const key: string = this.getStorageKey(context); @@ -44,7 +45,6 @@ export class ConversationState extends BotState { /** * Returns the storage key for the current conversation state. - * * @param context Context for current turn of conversation with the user. * @returns The storage key for the current conversation state. */ diff --git a/libraries/botbuilder-core/src/coreAppCredentials.ts b/libraries/botbuilder-core/src/coreAppCredentials.ts index 8d7d63c46f..a91ec899a7 100644 --- a/libraries/botbuilder-core/src/coreAppCredentials.ts +++ b/libraries/botbuilder-core/src/coreAppCredentials.ts @@ -18,14 +18,12 @@ interface CoreWebResource { /** * CoreAppCredentials - * * @remarks * Runtime-agnostic interface representing "ServiceClientCredentials" from @azure/ms-rest-js */ export interface CoreAppCredentials { /** * Signs a request with the Authentication header. - * * @param {CoreWebResource} webResource The CoreWebResource/request to be signed. * @returns {Promise} The signed request object; */ diff --git a/libraries/botbuilder-core/src/extendedUserTokenProvider.ts b/libraries/botbuilder-core/src/extendedUserTokenProvider.ts index 8373f01936..2d2a180212 100644 --- a/libraries/botbuilder-core/src/extendedUserTokenProvider.ts +++ b/libraries/botbuilder-core/src/extendedUserTokenProvider.ts @@ -13,13 +13,11 @@ import { SignInUrlResponse, TokenResponse, TokenExchangeRequest } from 'botframe /** * Interface for User Token OAuth Single Sign On and Token Exchange APIs for BotAdapters - * * @deprecated Use `UserTokenClient` instead. */ export interface ExtendedUserTokenProvider extends IUserTokenProvider { /** * Retrieves the OAuth token for a user that is in a sign-in flow. - * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param magicCode (Optional) Optional user entered code to validate. @@ -28,52 +26,49 @@ export interface ExtendedUserTokenProvider extends IUserTokenProvider { context: TurnContext, connectionName: string, magicCode?: string, - appCredentials?: CoreAppCredentials + appCredentials?: CoreAppCredentials, ): Promise; /** * Signs the user out with the token server. - * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param userId User id of user to sign out. - * @param oAuthAppCredentials AppCredentials for OAuth. + * @param appCredentials AppCredentials for OAuth. */ signOutUser( context: TurnContext, connectionName: string, userId?: string, - appCredentials?: CoreAppCredentials + appCredentials?: CoreAppCredentials, ): Promise; /** * Gets a signin link from the token server that can be sent as part of a SigninCard. - * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. - * @param oAuthAppCredentials AppCredentials for OAuth. + * @param appCredentials AppCredentials for OAuth. */ getSignInLink(context: TurnContext, connectionName: string, appCredentials?: CoreAppCredentials): Promise; /** * Signs the user out with the token server. - * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. - * @param oAuthAppCredentials AppCredentials for OAuth. + * @param resourceUrls Array with the resource Urls. + * @param appCredentials AppCredentials for OAuth. */ getAadTokens( context: TurnContext, connectionName: string, resourceUrls: string[], - appCredentials?: CoreAppCredentials + appCredentials?: CoreAppCredentials, ): Promise<{ [propertyName: string]: TokenResponse; }>; /** * Get the raw signin resource to be sent to the user for signin for a connection name. - * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. */ @@ -81,7 +76,6 @@ export interface ExtendedUserTokenProvider extends IUserTokenProvider { /** * Get the raw signin resource to be sent to the user for signin for a connection name. - * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param userId The user id that will be associated with the token. @@ -91,12 +85,11 @@ export interface ExtendedUserTokenProvider extends IUserTokenProvider { context: TurnContext, connectionName: string, userId: string, - finalRedirect?: string + finalRedirect?: string, ): Promise; /** * Get the raw signin resource to be sent to the user for signin for a connection name. - * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param userId The user id that will be associated with the token. @@ -107,12 +100,11 @@ export interface ExtendedUserTokenProvider extends IUserTokenProvider { connectionName: string, userId: string, finalRedirect?: string, - appCredentials?: CoreAppCredentials + appCredentials?: CoreAppCredentials, ): Promise; /** * Performs a token exchange operation such as for single sign-on. - * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param userId The user id that will be associated with the token. @@ -122,12 +114,11 @@ export interface ExtendedUserTokenProvider extends IUserTokenProvider { context: TurnContext, connectionName: string, userId: string, - tokenExchangeRequest: TokenExchangeRequest + tokenExchangeRequest: TokenExchangeRequest, ): Promise; /** * Performs a token exchange operation such as for single sign-on. - * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param userId The user id that will be associated with the token. @@ -138,6 +129,6 @@ export interface ExtendedUserTokenProvider extends IUserTokenProvider { connectionName: string, userId: string, tokenExchangeRequest: TokenExchangeRequest, - appCredentials: CoreAppCredentials + appCredentials: CoreAppCredentials, ): Promise; } diff --git a/libraries/botbuilder-core/src/internal.ts b/libraries/botbuilder-core/src/internal.ts index 3c16d1595a..d088345ed3 100644 --- a/libraries/botbuilder-core/src/internal.ts +++ b/libraries/botbuilder-core/src/internal.ts @@ -24,7 +24,7 @@ export function shallowCopy(value: T): T { */ export function makeRevocable>( target: T, - handler?: ProxyHandler + handler?: ProxyHandler, ): { proxy: T; revoke(): void } { // Ensure proxy supported (some browsers don't) if (typeof Proxy !== 'undefined' && Proxy.revocable) { diff --git a/libraries/botbuilder-core/src/invokeException.ts b/libraries/botbuilder-core/src/invokeException.ts index 8ef46eb159..3ad951735c 100644 --- a/libraries/botbuilder-core/src/invokeException.ts +++ b/libraries/botbuilder-core/src/invokeException.ts @@ -12,7 +12,10 @@ export class InvokeException extends Error { * @param status The Http status code of the error. * @param response optional. The body of the exception. Default is null. */ - constructor(private readonly status: StatusCodes, private readonly response?: T) { + constructor( + private readonly status: StatusCodes, + private readonly response?: T, + ) { super(); this.name = 'InvokeException'; @@ -20,7 +23,6 @@ export class InvokeException extends Error { /** * A factory method that creates a new [InvokeResponse](xref:botbuilder-core.InvokeResponse) object with the status code and body of the current object. - * * @returns A new [InvokeResponse](xref:botbuilder-core.InvokeResponse) object. */ createInvokeResponse(): InvokeResponse { diff --git a/libraries/botbuilder-core/src/memoryStorage.ts b/libraries/botbuilder-core/src/memoryStorage.ts index 778f5fc398..98bac9cb77 100644 --- a/libraries/botbuilder-core/src/memoryStorage.ts +++ b/libraries/botbuilder-core/src/memoryStorage.ts @@ -9,7 +9,6 @@ import { Storage, StoreItems } from './storage'; /** * Memory based storage provider for a bot. - * * @remarks * This provider is most useful for simulating production storage when running locally against the * emulator or as part of a unit test. It has the following characteristics: @@ -31,7 +30,6 @@ export class MemoryStorage implements Storage { protected etag: number; /** * Creates a new MemoryStorage instance. - * * @param memory (Optional) memory to use for storing items. By default it will create an empty JSON object `{}`. */ constructor(protected memory: { [k: string]: string } = {}) { @@ -40,7 +38,6 @@ export class MemoryStorage implements Storage { /** * Reads storage items from storage. - * * @param keys Keys of the [StoreItems](xref:botbuilder-core.StoreItems) objects to read. * @returns The read items. */ @@ -62,7 +59,6 @@ export class MemoryStorage implements Storage { /** * Writes storage items to storage. - * * @param changes The [StoreItems](xref:botbuilder-core.StoreItems) to write, indexed by key. * @returns {Promise} A promise representing the async operation. */ @@ -97,7 +93,6 @@ export class MemoryStorage implements Storage { /** * Deletes storage items from storage. - * * @param keys Keys of the [StoreItems](xref:botbuilder-core.StoreItems) objects to delete. * @returns {Promise} A promise representing the async operation. */ diff --git a/libraries/botbuilder-core/src/memoryTranscriptStore.ts b/libraries/botbuilder-core/src/memoryTranscriptStore.ts index 51f2894757..fe22de5000 100644 --- a/libraries/botbuilder-core/src/memoryTranscriptStore.ts +++ b/libraries/botbuilder-core/src/memoryTranscriptStore.ts @@ -11,7 +11,6 @@ import { PagedResult, TranscriptInfo, TranscriptStore } from './transcriptLogger /** * The memory transcript store stores transcripts in volatile memory in a Map. - * * @remarks * Because this uses an unbounded volatile dictionary this should only be used for unit tests or * non-production environments. @@ -23,7 +22,6 @@ export class MemoryTranscriptStore implements TranscriptStore { /** * Log an activity to the transcript. - * * @param activity Activity to log. * @returns {Promise} A promise representing the async operation. */ @@ -57,7 +55,6 @@ export class MemoryTranscriptStore implements TranscriptStore { /** * Get activities from the memory transcript store. - * * @param channelId Channel Id. * @param conversationId Conversation Id. * @param continuationToken Continuation token to page through results. @@ -68,7 +65,7 @@ export class MemoryTranscriptStore implements TranscriptStore { channelId: string, conversationId: string, continuationToken?: string, - startDate?: Date + startDate?: Date, ): Promise> { if (!channelId) { throw new Error('Missing channelId'); @@ -107,7 +104,6 @@ export class MemoryTranscriptStore implements TranscriptStore { /** * List conversations in the channelId. - * * @param channelId Channel Id. * @param continuationToken Continuation token to page through results. * @returns {Promise>} A page of conversations for a channel from the store. @@ -152,7 +148,6 @@ export class MemoryTranscriptStore implements TranscriptStore { /** * Delete a specific conversation and all of it's activities. - * * @param channelId Channel Id where conversation took place. * @param conversationId Id of the conversation to delete. * @returns {Promise} A promise representing the async operation. @@ -182,7 +177,7 @@ export class MemoryTranscriptStore implements TranscriptStore { */ const createdSorter: (a: TranscriptInfo, b: TranscriptInfo) => number = ( a: TranscriptInfo, - b: TranscriptInfo + b: TranscriptInfo, ): number => a.created.getTime() - b.created.getTime(); /** @@ -195,7 +190,7 @@ const timestampSorter: (a: Activity, b: Activity) => number = (a: Activity, b: A * @private */ const skipWhileExpression: (expression: any) => (item: any) => boolean = ( - expression: any + expression: any, ): ((item: any) => boolean) => { let skipping = true; diff --git a/libraries/botbuilder-core/src/messageFactory.ts b/libraries/botbuilder-core/src/messageFactory.ts index 68e122ee41..75bf419b95 100644 --- a/libraries/botbuilder-core/src/messageFactory.ts +++ b/libraries/botbuilder-core/src/messageFactory.ts @@ -19,7 +19,6 @@ import { CardFactory } from './cardFactory'; /** * A set of utility functions to assist with the formatting of the various message types a bot can * return. - * * @remarks * The following example shows sending a message containing a single hero card: * @@ -38,7 +37,6 @@ import { CardFactory } from './cardFactory'; export class MessageFactory { /** * Returns a simple text message. - * * @remarks * This example shows sending a simple text message: * @@ -65,7 +63,6 @@ export class MessageFactory { /** * Returns a message that includes a set of suggested actions and optional text. - * * @remarks * This example shows creating a message with suggested actions: * @@ -82,7 +79,7 @@ export class MessageFactory { actions: (CardAction | string)[], text?: string, speak?: string, - inputHint?: InputHints | string + inputHint?: InputHints | string, ): Partial { const msg: Partial = { type: ActivityTypes.Message, @@ -103,7 +100,6 @@ export class MessageFactory { /** * Returns a single message activity containing an attachment. - * * @remarks * This example shows creating a message with a hero card attachment: * @@ -126,14 +122,13 @@ export class MessageFactory { attachment: Attachment, text?: string, speak?: string, - inputHint?: InputHints | string + inputHint?: InputHints | string, ): Partial { return attachmentActivity(AttachmentLayoutTypes.List, [attachment], text, speak, inputHint); } /** * Returns a message that will display a set of attachments in list form. - * * @remarks * This example shows creating a message with a list of hero cards: * @@ -154,14 +149,13 @@ export class MessageFactory { attachments: Attachment[], text?: string, speak?: string, - inputHint?: InputHints | string + inputHint?: InputHints | string, ): Partial { return attachmentActivity(AttachmentLayoutTypes.List, attachments, text, speak, inputHint); } /** * Returns a message that will display a set of attachments using a carousel layout. - * * @remarks * This example shows creating a message with a carousel of hero cards: * @@ -182,14 +176,13 @@ export class MessageFactory { attachments: Attachment[], text?: string, speak?: string, - inputHint?: InputHints | string + inputHint?: InputHints | string, ): Partial { return attachmentActivity(AttachmentLayoutTypes.Carousel, attachments, text, speak, inputHint); } /** * Returns a message that will display a single image or video to a user. - * * @remarks * This example shows sending an image to the user: * @@ -210,7 +203,7 @@ export class MessageFactory { name?: string, text?: string, speak?: string, - inputHint?: InputHints | string + inputHint?: InputHints | string, ): Partial { const a: Attachment = { contentType: contentType, contentUrl: url }; if (name) { @@ -234,7 +227,7 @@ function attachmentActivity( attachments: Attachment[], text?: string, speak?: string, - inputHint?: InputHints | string + inputHint?: InputHints | string, ): Partial { const msg: Partial = { type: ActivityTypes.Message, diff --git a/libraries/botbuilder-core/src/middlewareSet.ts b/libraries/botbuilder-core/src/middlewareSet.ts index 9e1536a318..9e98ac77b1 100644 --- a/libraries/botbuilder-core/src/middlewareSet.ts +++ b/libraries/botbuilder-core/src/middlewareSet.ts @@ -13,7 +13,6 @@ import { TurnContext } from './turnContext'; export interface Middleware { /** * Called each time the bot receives a new request. - * * @remarks * Calling `await next();` will cause execution to continue to either the next piece of * middleware in the chain or the bots main logic if you are the last piece of middleware. @@ -49,7 +48,6 @@ export type MiddlewareHandler = (context: TurnContext, next: () => Promise /** * A set of `Middleware` plugins. - * * @remarks * The set itself is middleware so you can easily package up a set of middleware that can be composed * into an adapter with a single `adapter.use(mySet)` call or even into another middleware set using @@ -71,7 +69,6 @@ export class MiddlewareSet implements Middleware { /** * Creates a new MiddlewareSet instance. - * * @param {...any} middlewares One or more middleware handlers(s) to register. */ constructor(...middlewares: (MiddlewareHandler | Middleware)[]) { @@ -80,7 +77,6 @@ export class MiddlewareSet implements Middleware { /** * Processes an incoming activity. - * * @param context [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. * @param next Delegate to call to continue the bot middleware pipeline. * @returns {Promise} A Promise representing the async operation. @@ -91,7 +87,6 @@ export class MiddlewareSet implements Middleware { /** * Registers middleware handlers(s) with the set. - * * @remarks This example adds a new piece of middleware to a set: * ```JavaScript * set.use(async (context, next) => { @@ -119,7 +114,6 @@ export class MiddlewareSet implements Middleware { /** * Executes a set of middleware in series. - * * @param context Context for the current turn of conversation with the user. * @param next Function to invoke at the end of the middleware chain. * @returns A promise that resolves after the handler chain is complete. diff --git a/libraries/botbuilder-core/src/privateConversationState.ts b/libraries/botbuilder-core/src/privateConversationState.ts index f15fae8181..1419e96a80 100644 --- a/libraries/botbuilder-core/src/privateConversationState.ts +++ b/libraries/botbuilder-core/src/privateConversationState.ts @@ -14,7 +14,6 @@ const NO_KEY = 'PrivateConversationState: overridden getStorageKey method did no /** * Reads and writes PrivateConversation state for your bot to storage. - * * @remarks * Each PrivateConversation your bot has with a user or group will have its own isolated storage object * that can be used to persist PrivateConversation tracking information between turns of the PrivateConversation. @@ -29,11 +28,13 @@ const NO_KEY = 'PrivateConversationState: overridden getStorageKey method did no export class PrivateConversationState extends BotState { /** * Creates a new PrivateConversationState instance. - * * @param storage Storage provider to persist PrivateConversation state to. * @param namespace (Optional) namespace to append to storage keys. Defaults to an empty string. */ - constructor(storage: Storage, private namespace: string = '') { + constructor( + storage: Storage, + private namespace: string = '', + ) { super(storage, (context: TurnContext) => { // Calculate storage key const key: string = this.getStorageKey(context); @@ -44,7 +45,6 @@ export class PrivateConversationState extends BotState { /** * Returns the storage key for the current PrivateConversation state. - * * @param context Context for current turn of PrivateConversation with the user. * @returns The storage key for the current PrivateConversation state. */ diff --git a/libraries/botbuilder-core/src/propertyManager.ts b/libraries/botbuilder-core/src/propertyManager.ts index ec7ac92eec..21074d0caa 100644 --- a/libraries/botbuilder-core/src/propertyManager.ts +++ b/libraries/botbuilder-core/src/propertyManager.ts @@ -14,8 +14,7 @@ export interface PropertyManager { /** * Creates a new property accessor for reading and writing an individual property to the bots * state management system. - * - * @param T (Optional) type of property to create. Defaults to `any` type. + * @template T (Optional) type of property to create. Defaults to `any` type. * @param name Name of the property being created. */ createProperty(name: string): StatePropertyAccessor; diff --git a/libraries/botbuilder-core/src/queueStorage.ts b/libraries/botbuilder-core/src/queueStorage.ts index cbb70cedf8..51a60b348a 100644 --- a/libraries/botbuilder-core/src/queueStorage.ts +++ b/libraries/botbuilder-core/src/queueStorage.ts @@ -15,7 +15,6 @@ export abstract class QueueStorage { /** * Enqueues an Activity for later processing. The visibility timeout specifies how long the message should be visible * to Dequeue and Peek operations. - * * @param {Partial} activity The [Activity](xref:botframework-schema.Activity) to be queued for later processing. * @param {number} visibilityTimeout Visibility timeout in seconds. Optional with a default value of 0. Cannot be larger than 7 days. * @param {number} timeToLive Specifies the time-to-live interval for the message in seconds. @@ -23,6 +22,6 @@ export abstract class QueueStorage { abstract queueActivity( activity: Partial, visibilityTimeout?: number, - timeToLive?: number + timeToLive?: number, ): Promise; } diff --git a/libraries/botbuilder-core/src/recognizerResult.ts b/libraries/botbuilder-core/src/recognizerResult.ts index a54aee7066..cbdc43c856 100644 --- a/libraries/botbuilder-core/src/recognizerResult.ts +++ b/libraries/botbuilder-core/src/recognizerResult.ts @@ -24,7 +24,6 @@ export interface RecognizerResult { /** * Intents recognized for the utterance. - * * @remarks * A map of intent names to an object with score is returned. */ diff --git a/libraries/botbuilder-core/src/registerClassMiddleware.ts b/libraries/botbuilder-core/src/registerClassMiddleware.ts index ccc76b7a6d..2e6eea3324 100644 --- a/libraries/botbuilder-core/src/registerClassMiddleware.ts +++ b/libraries/botbuilder-core/src/registerClassMiddleware.ts @@ -17,7 +17,6 @@ export class RegisterClassMiddleware implements Middleware { /** * Initialize a new instance of the RegisterClassMiddleware class. - * * @param service The object or service to add. * @param key The key for service object in turn state. */ @@ -33,7 +32,6 @@ export class RegisterClassMiddleware implements Middleware { /** * Adds the associated object or service to the current turn context. - * * @param turnContext The context object for this turn. * @param next The delegate to call to continue the bot middleware pipeline. */ diff --git a/libraries/botbuilder-core/src/showTypingMiddleware.ts b/libraries/botbuilder-core/src/showTypingMiddleware.ts index e73bf77694..35328f58e5 100644 --- a/libraries/botbuilder-core/src/showTypingMiddleware.ts +++ b/libraries/botbuilder-core/src/showTypingMiddleware.ts @@ -12,7 +12,6 @@ import { TurnContext } from './turnContext'; /** * Middleware that will send a typing indicator automatically for each message. - * * @remarks * When added, this middleware will send typing activities back to the user when a Message activity * is received to let them know that the bot has received the message and is working on the response. @@ -23,11 +22,13 @@ import { TurnContext } from './turnContext'; export class ShowTypingMiddleware implements Middleware { /** * Create the SendTypingIndicator middleware - * * @param delay {number} Number of milliseconds to wait before sending the first typing indicator. * @param period {number} Number of milliseconds to wait before sending each following indicator. */ - constructor(private readonly delay: number = 500, private readonly period: number = 2000) { + constructor( + private readonly delay: number = 500, + private readonly period: number = 2000, + ) { if (delay < 0) { throw new Error('Delay must be greater than or equal to zero'); } @@ -39,7 +40,6 @@ export class ShowTypingMiddleware implements Middleware { /** * Processes an incoming activity. - * * @param context {TurnContext} An incoming TurnContext object. * @param next {function} The next delegate function. */ @@ -97,7 +97,7 @@ export class ShowTypingMiddleware implements Middleware { type: ActivityTypes.Typing, relatesTo: context.activity.relatesTo, }, - conversationReference + conversationReference, ); await context.adapter.sendActivities(context, [typingActivity]); diff --git a/libraries/botbuilder-core/src/skills/skillConversationIdFactory.ts b/libraries/botbuilder-core/src/skills/skillConversationIdFactory.ts index 03999fee33..2e2494c2cd 100644 --- a/libraries/botbuilder-core/src/skills/skillConversationIdFactory.ts +++ b/libraries/botbuilder-core/src/skills/skillConversationIdFactory.ts @@ -15,7 +15,6 @@ import { v4 as uuid } from 'uuid'; export class SkillConversationIdFactory extends SkillConversationIdFactoryBase { /** * Creates a new instance of the SkillConversationIdFactory class. - * * @param storage The storage for the [ConversationReference](xref:botframework-schema:ConversationReference) instances. */ constructor(private readonly storage: Storage) { @@ -24,7 +23,6 @@ export class SkillConversationIdFactory extends SkillConversationIdFactoryBase { /** * Creates a conversation ID for a skill conversation based on the caller's [ConversationReference](xref:botframework-schema:ConversationReference). - * * @param options The [SkillConversationIdFactoryOptions](xref:botbuilder-core.SkillConversationIdFactoryOptions) to use. * @returns {Promise} A unique conversation ID used to communicate with the skill. */ @@ -45,19 +43,18 @@ export class SkillConversationIdFactory extends SkillConversationIdFactoryBase { /** * Gets the ConversationReference created using createSkillConversationId() for a skillConversationId. - * * @param skillConversationId A skill conversationId created using createSkillConversationId(). * @returns {Promise} The caller's ConversationReference for a skillConversationId. Null if not found. */ async getSkillConversationReference(skillConversationId: string): Promise { const skillConversationInfo = await this.storage.read([skillConversationId]); if (!skillConversationInfo) { - return undefined!; // eslint-disable-line @typescript-eslint/no-non-null-assertion + return undefined!; } const skillConversationReference = skillConversationInfo[skillConversationId]; if (!skillConversationReference) { - return undefined!; // eslint-disable-line @typescript-eslint/no-non-null-assertion + return undefined!; } return skillConversationReference as SkillConversationReference; @@ -65,7 +62,6 @@ export class SkillConversationIdFactory extends SkillConversationIdFactoryBase { /** * Deletes the [SkillConversationReference](xref:botbuilder-core.SkillConversationReference) from the storage. - * * @param skillConversationId The skill conversation id to use as key for the delete. * @returns {Promise} A promise representing the asynchronous operation. */ diff --git a/libraries/botbuilder-core/src/skills/skillConversationIdFactoryBase.ts b/libraries/botbuilder-core/src/skills/skillConversationIdFactoryBase.ts index 3f3c6bcbba..eb6b892df3 100644 --- a/libraries/botbuilder-core/src/skills/skillConversationIdFactoryBase.ts +++ b/libraries/botbuilder-core/src/skills/skillConversationIdFactoryBase.ts @@ -16,7 +16,6 @@ import { SkillConversationReference } from './skillConversationReference'; export abstract class SkillConversationIdFactoryBase { /** * Creates a conversation ID for a skill conversation based on the caller's ConversationReference. - * * @param _options The [SkillConversationIdFactoryOptions](xref:botbuilder-core.SkillConversationIdFactoryOptions) to use. * @remarks It should be possible to use the returned string on a request URL and it should not contain special characters. * Returns A unique conversation ID used to communicate with the skill. @@ -27,7 +26,6 @@ export abstract class SkillConversationIdFactoryBase { /** * Creates a conversation ID for a skill conversation based on the caller's ConversationReference. - * * @deprecated Method is deprecated, please use createSkillConversationIdWithOptions() with SkillConversationIdFactoryOptions instead. * @param _conversationReference The skill's caller ConversationReference. * @remarks It should be possible to use the returned string on a request URL and it should not contain special characters. @@ -39,7 +37,6 @@ export abstract class SkillConversationIdFactoryBase { /** * Gets the ConversationReference created using createSkillConversationId() for a skillConversationId. - * * @deprecated Method is deprecated, please use getSkillConversationReference() instead. * @param _skillConversationId A skill conversationId created using createSkillConversationId(). * @remarks Returns The caller's ConversationReference for a skillConversationId. null if not found. @@ -50,7 +47,6 @@ export abstract class SkillConversationIdFactoryBase { /** * Gets the SkillConversationReference created using createSkillConversationId() for a skillConversationId. - * * @param _skillConversationId Gets the SkillConversationReference used during createSkillConversationId for a skillConversationId. */ getSkillConversationReference(_skillConversationId: string): Promise { @@ -59,7 +55,6 @@ export abstract class SkillConversationIdFactoryBase { /** * Deletes a ConversationReference. - * * @param skillConversationId A skill conversationId created using createSkillConversationId(). */ abstract deleteConversationReference(skillConversationId: string): Promise; diff --git a/libraries/botbuilder-core/src/skypeMentionNormalizeMiddleware.ts b/libraries/botbuilder-core/src/skypeMentionNormalizeMiddleware.ts index 4b5aae6914..a70d56eaf1 100644 --- a/libraries/botbuilder-core/src/skypeMentionNormalizeMiddleware.ts +++ b/libraries/botbuilder-core/src/skypeMentionNormalizeMiddleware.ts @@ -12,7 +12,6 @@ import { TurnContext } from './turnContext'; /** * Middleware to patch mention Entities from Skype since they don't conform to expected values. * Bots that interact with Skype should use this middleware if mentions are used. - * * @remarks * A Skype mention "text" field is of the format: * botname @@ -23,7 +22,6 @@ import { TurnContext } from './turnContext'; export class SkypeMentionNormalizeMiddleware implements Middleware { /** * Performs the normalization of Skype mention Entities. - * * @param activity [Activity](xref:botframework-schema.Activity) containing the mentions to normalize. */ static normalizeSkypeMentionText(activity: Activity): void { @@ -43,7 +41,6 @@ export class SkypeMentionNormalizeMiddleware implements Middleware { /** * Middleware implementation which corrects the Entity text of type [Mention](xref:botframework-schema.Mention) to a value that [removeMentionText](xref:botbuilder-core.TurnContext.removeMentionText) can work with. - * * @param turnContext [TurnContext](xref:botbuilder-core.TurnContext) for the current turn of conversation. * @param next Delegate to call to continue the bot middleware pipeline. */ diff --git a/libraries/botbuilder-core/src/storage.ts b/libraries/botbuilder-core/src/storage.ts index 2c772ca654..e11b25f1cf 100644 --- a/libraries/botbuilder-core/src/storage.ts +++ b/libraries/botbuilder-core/src/storage.ts @@ -17,7 +17,6 @@ import { TurnContext } from './turnContext'; * ```TypeScript * type StorageKeyFactory = (context: TurnContext) => Promise; * ``` - * * @param StorageKeyFactory.context Context for the current turn of conversation with a user. * @returns A promise resolving to the storage key string */ @@ -29,7 +28,6 @@ export type StorageKeyFactory = (context: TurnContext) => Promise; export interface Storage { /** * Loads store items from storage - * * @remarks * This example reads in a single object from storage: * @@ -43,7 +41,6 @@ export interface Storage { /** * Saves store items to storage. - * * @remarks * This example writes an object to storage after its been modified: * @@ -57,7 +54,6 @@ export interface Storage { /** * Removes store items from storage - * * @remarks * This example deletes an object from storage: * @@ -76,7 +72,7 @@ export interface StoreItem { /** * Key/value pairs. */ - [key: string]: any; // eslint-disable-line @typescript-eslint/no-explicit-any + [key: string]: any; /** * (Optional) eTag field for stores that support optimistic concurrency. @@ -91,7 +87,7 @@ export interface StoreItems { /** * List of store items indexed by key. */ - [key: string]: any; // eslint-disable-line @typescript-eslint/no-explicit-any + [key: string]: any; } const storeItems = z.record(z.unknown()); @@ -107,7 +103,6 @@ export function assertStoreItems(val: unknown, ..._args: unknown[]): asserts val /** * Utility function to calculate a change hash for a `StoreItem`. - * * @remarks * This example calculates a change hash for an object that's been read in and then only writes it * back out if it's been modified: @@ -124,7 +119,6 @@ export function assertStoreItems(val: unknown, ..._args: unknown[]): asserts val * await storage.write({ 'botState': state }); * } * ``` - * * @param item Item to calculate the change hash for. * @returns change hash string */ diff --git a/libraries/botbuilder-core/src/stringUtils.ts b/libraries/botbuilder-core/src/stringUtils.ts index 24a2c8406e..c000d86744 100644 --- a/libraries/botbuilder-core/src/stringUtils.ts +++ b/libraries/botbuilder-core/src/stringUtils.ts @@ -12,7 +12,6 @@ export class StringUtils { /** * Truncate string with ... - * * @param text Text. * @param length Length to truncate text. * @returns Original string modified. @@ -28,12 +27,10 @@ export class StringUtils { /** * UniqueHash - create a unique hash from a string. - * * @remarks * The source for this function was derived from the following article: * * https://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/ - * * @param text Text to hash. * @returns A string which is an unique hash. */ @@ -50,7 +47,6 @@ export class StringUtils { /** * EllipsisHash - create truncated string with unique hash for the truncated part. - * * @param text Text to truncate. * @param length Length to truncate at. * @returns The truncated string with unique hash for the truncated part. diff --git a/libraries/botbuilder-core/src/telemetryLoggerMiddleware.ts b/libraries/botbuilder-core/src/telemetryLoggerMiddleware.ts index ed579355e9..1dc648e60a 100644 --- a/libraries/botbuilder-core/src/telemetryLoggerMiddleware.ts +++ b/libraries/botbuilder-core/src/telemetryLoggerMiddleware.ts @@ -50,7 +50,6 @@ export class TelemetryLoggerMiddleware implements Middleware { /** * Initializes a new instance of the TelemetryLoggerMiddleware class. - * * @param telemetryClient The BotTelemetryClient used for logging. * @param logPersonalInformation (Optional) Enable/Disable logging original message name within Application Insights. */ @@ -61,7 +60,6 @@ export class TelemetryLoggerMiddleware implements Middleware { /** * Gets a value indicating whether to log personal information that came from the user. - * * @returns A value indicating whether to log personal information or not. */ get logPersonalInformation(): boolean { @@ -70,7 +68,6 @@ export class TelemetryLoggerMiddleware implements Middleware { /** * Gets the currently configured botTelemetryClient that logs the events. - * * @returns The currently configured [BotTelemetryClient](xref:botbuilder-core.BotTelemetryClient) that logs the events. */ get telemetryClient(): BotTelemetryClient { @@ -79,7 +76,6 @@ export class TelemetryLoggerMiddleware implements Middleware { /** * Logs events based on incoming and outgoing activities using the botTelemetryClient class. - * * @param context The context object for this turn. * @param next The delegate to call to continue the bot middleware pipeline */ @@ -102,7 +98,7 @@ export class TelemetryLoggerMiddleware implements Middleware { async ( ctx: TurnContext, activities: Partial[], - nextSend: () => Promise + nextSend: () => Promise, ): Promise => { // run full pipeline const responses: ResourceResponse[] = await nextSend(); @@ -111,7 +107,7 @@ export class TelemetryLoggerMiddleware implements Middleware { }); return responses; - } + }, ); // hook up update activity pipeline @@ -123,7 +119,7 @@ export class TelemetryLoggerMiddleware implements Middleware { await this.onUpdateActivity(activity); return response; - } + }, ); // hook up delete activity pipeline @@ -138,10 +134,10 @@ export class TelemetryLoggerMiddleware implements Middleware { id: reference.activityId, }, reference, - false + false, ); await this.onDeleteActivity(deletedActivity); - } + }, ); if (next !== null) { @@ -153,7 +149,6 @@ export class TelemetryLoggerMiddleware implements Middleware { * Invoked when a message is received from the user. * Performs logging of telemetry data using the IBotTelemetryClient.TrackEvent() method. * The event name logged is "BotMessageReceived". - * * @param activity Current activity sent from user. */ protected async onReceiveActivity(activity: Activity): Promise { @@ -167,7 +162,6 @@ export class TelemetryLoggerMiddleware implements Middleware { * Invoked when the bot sends a message to the user. * Performs logging of telemetry data using the botTelemetryClient.trackEvent() method. * The event name logged is "BotMessageSend". - * * @param activity Last activity sent from user. */ protected async onSendActivity(activity: Activity): Promise { @@ -181,7 +175,6 @@ export class TelemetryLoggerMiddleware implements Middleware { * Invoked when the bot updates a message. * Performs logging of telemetry data using the botTelemetryClient.trackEvent() method. * The event name used is "BotMessageUpdate". - * * @param activity Current activity sent from user. */ protected async onUpdateActivity(activity: Activity): Promise { @@ -195,7 +188,6 @@ export class TelemetryLoggerMiddleware implements Middleware { * Invoked when the bot deletes a message. * Performs logging of telemetry data using the botTelemetryClient.trackEvent() method. * The event name used is "BotMessageDelete". - * * @param activity Current activity sent from user. */ protected async onDeleteActivity(activity: Activity): Promise { @@ -208,14 +200,13 @@ export class TelemetryLoggerMiddleware implements Middleware { /** * Fills the Application Insights Custom Event properties for BotMessageReceived. * These properties are logged in the custom event when a new message is received from the user. - * * @param activity Last activity sent from user. * @param telemetryProperties Additional properties to add to the event. * @returns A dictionary that is sent as "Properties" to botTelemetryClient.trackEvent method. */ protected async fillReceiveEventProperties( activity: Activity, - telemetryProperties?: Record + telemetryProperties?: Record, ): Promise> { const properties: Record = {}; @@ -266,14 +257,13 @@ export class TelemetryLoggerMiddleware implements Middleware { /** * Fills the Application Insights Custom Event properties for BotMessageSend. * These properties are logged in the custom event when a response message is sent by the Bot to the user. - * * @param activity - Last activity sent from user. * @param telemetryProperties Additional properties to add to the event. * @returns A dictionary that is sent as "Properties" to botTelemetryClient.trackEvent method. */ protected async fillSendEventProperties( activity: Activity, - telemetryProperties?: Record + telemetryProperties?: Record, ): Promise> { const properties: Record = {}; @@ -322,14 +312,13 @@ export class TelemetryLoggerMiddleware implements Middleware { * These properties are logged when an activity message is updated by the Bot. * For example, if a card is interacted with by the use, and the card needs to be updated to reflect * some interaction. - * * @param activity - Last activity sent from user. * @param telemetryProperties Additional properties to add to the event. * @returns A dictionary that is sent as "Properties" to botTelemetryClient.trackEvent method. */ protected async fillUpdateEventProperties( activity: Activity, - telemetryProperties?: Record + telemetryProperties?: Record, ): Promise> { const properties: Record = {}; @@ -361,14 +350,13 @@ export class TelemetryLoggerMiddleware implements Middleware { /** * Fills the Application Insights Custom Event properties for BotMessageDelete. * These properties are logged in the custom event when an activity message is deleted by the Bot. This is a relatively rare case. - * * @param activity - Last activity sent from user. * @param telemetryProperties Additional properties to add to the event. * @returns A dictionary that is sent as "Properties" to botTelemetryClient.trackEvent method. */ protected async fillDeleteEventProperties( activity: Activity, - telemetryProperties?: Record + telemetryProperties?: Record, ): Promise> { const properties: Record = {}; diff --git a/libraries/botbuilder-core/src/testAdapter.ts b/libraries/botbuilder-core/src/testAdapter.ts index 4136751f5a..420e621a44 100644 --- a/libraries/botbuilder-core/src/testAdapter.ts +++ b/libraries/botbuilder-core/src/testAdapter.ts @@ -33,7 +33,6 @@ import { TurnContext } from './turnContext'; * ```TypeScript * type TestActivityInspector = (activity: Partial, description: string) => void; * ``` - * * @param TestActivityInspector.activity The activity being inspected. * @param TestActivityInspector.description Text to log in the event of an error. */ @@ -42,7 +41,6 @@ export type TestActivityInspector = (activity: Partial, description?: /** * Test adapter used for unit tests. This adapter can be used to simulate sending messages from the * user to the bot. - * * @remarks * The following example sets up the test adapter and then executes a simple test: * @@ -60,7 +58,6 @@ export type TestActivityInspector = (activity: Partial, description?: export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider { /** * Creates a new TestAdapter instance. - * * @param logicOrConversation The bots logic that's under test. * @param template (Optional) activity containing default values to assign to all test messages received. * @param sendTraceActivity Indicates whether the adapter should add to its queue any trace activities generated by the bot. @@ -68,7 +65,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider constructor( logicOrConversation?: ((context: TurnContext) => Promise) | ConversationReference, template?: Partial, - sendTraceActivity = false + sendTraceActivity = false, ) { super(); this._sendTraceActivity = sendTraceActivity; @@ -103,7 +100,6 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Gets a value indicating whether to send trace activities. - * * @returns A value indicating whether to send trace activities. */ get enableTrace(): boolean { @@ -134,7 +130,6 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Create a ConversationReference. - * * @param name name of the conversation (also id). * @param user name of the user (also id) default: User1. * @param bot name of the bot (also id) default: Bot. @@ -154,7 +149,6 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Dequeues and returns the next bot response from the activeQueue. - * * @returns The next activity in the queue; or undefined, if the queue is empty. */ getNextReply(): Partial { @@ -166,7 +160,6 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Creates a message activity from text and the current conversational context. - * * @param text The message text. * @returns An appropriate message activity. */ @@ -186,7 +179,6 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Processes a message activity from a user. - * * @param userSays The text of the user's message. * @param callback The bot logic to invoke. * @returns {Promise} A promise representing the async operation. @@ -208,14 +200,13 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Receives an activity and runs it through the middleware pipeline. - * * @param activity The activity to process. * @param callback The bot logic to invoke. * @returns {Promise} A promise representing the async operation. */ async processActivity( activity: string | Partial, - callback?: (context: TurnContext) => Promise + callback?: (context: TurnContext) => Promise, ): Promise { const request: Partial = typeof activity === 'string' ? { type: ActivityTypes.Message, text: activity } : activity; @@ -339,21 +330,19 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * The `TestAdapter` doesn't implement `continueConversation()` and will return an error if it's * called. - * * @param _reference A reference to the conversation to continue. * @param _logic The asynchronous method to call after the adapter middleware runs. * @returns {Promise} A promise representing the async operation. */ continueConversation( _reference: Partial, - _logic: (revocableContext: TurnContext) => Promise + _logic: (revocableContext: TurnContext) => Promise, ): Promise { return Promise.reject(new Error('not implemented')); } /** * Creates a turn context. - * * @param request An incoming request body. * @returns The created [TurnContext](xref:botbuilder-core.TurnContext). * @remarks @@ -366,7 +355,6 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Sends something to the bot. This returns a new `TestFlow` instance which can be used to add * additional steps for inspecting the bots reply and then sending additional activities. - * * @remarks * This example shows how to send a message and then verify that the response was as expected: * @@ -385,7 +373,6 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Send something to the bot and expects the bot to return with a given reply. - * * @remarks * This is simply a wrapper around calls to `send()` and `assertReply()`. This is such a * common pattern that a helper is provided. @@ -404,14 +391,13 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider userSays: string | Partial, expected: string | Partial | ((activity: Partial, description?: string) => void), description?: string, - _timeout?: number + _timeout?: number, ): TestFlow { return this.send(userSays).assertReply(expected, description); } /** * Test a list of activities. - * * @remarks * Each activity with the "bot" role will be processed with assertReply() and every other * activity will be processed as a user message with send(). @@ -425,20 +411,23 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider throw new Error('Missing array of activities'); } - const activityInspector: any = (expected: Partial): TestActivityInspector => ( - actual: Partial, - description2: string - ): any => validateTranscriptActivity(actual, expected, description2); + const activityInspector: any = + (expected: Partial): TestActivityInspector => + (actual: Partial, description2: string): any => + validateTranscriptActivity(actual, expected, description2); // Chain all activities in a TestFlow, check if its a user message (send) or a bot reply (assert) - return activities.reduce((flow: TestFlow, activity: Partial) => { - // tslint:disable-next-line:prefer-template - const assertDescription = `reply ${description ? ' from ' + description : ''}`; - - return this.isReply(activity) - ? flow.assertReply(activityInspector(activity, description), assertDescription, timeout) - : flow.send(activity); - }, new TestFlow(Promise.resolve(), this)); + return activities.reduce( + (flow: TestFlow, activity: Partial) => { + // tslint:disable-next-line:prefer-template + const assertDescription = `reply ${description ? ' from ' + description : ''}`; + + return this.isReply(activity) + ? flow.assertReply(activityInspector(activity, description), assertDescription, timeout) + : flow.send(activity); + }, + new TestFlow(Promise.resolve(), this), + ); } private _userTokens: UserToken[] = []; @@ -446,7 +435,6 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Adds a fake user token so it can later be retrieved. - * * @param connectionName The connection name. * @param channelId The channel id. * @param userId The user id. @@ -473,20 +461,18 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Asynchronously retrieves the token status for each configured connection for the given user. * In testAdapter, retrieves tokens which were previously added via addUserToken. - * * @param context The context object for the turn. * @param userId The ID of the user to retrieve the token status for. * @param includeFilter Optional. A comma-separated list of connection's to include. If present, * the `includeFilter` parameter limits the tokens this method returns. * @param _oAuthAppCredentials AppCredentials for OAuth. - * * @returns The [TokenStatus](xref:botframework-connector.TokenStatus) objects retrieved. */ async getTokenStatus( context: TurnContext, userId: string, includeFilter?: string, - _oAuthAppCredentials?: any + _oAuthAppCredentials?: any, ): Promise { if (!context || !context.activity) { throw new Error('testAdapter.getTokenStatus(): context with activity is required'); @@ -506,7 +492,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider (x) => x.channelId === context.activity.channelId && x.userId === userId && - (!filter || filter.includes(x.connectionName)) + (!filter || filter.includes(x.connectionName)), ) .map((token) => ({ ConnectionName: token.connectionName, @@ -517,7 +503,6 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Retrieves the OAuth token for a user that is in a sign-in flow. - * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param magicCode (Optional) Optional user entered code to validate. @@ -531,7 +516,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider if (magicCode) { const magicCodeRecord = this._magicCodes.find( - (item) => key.equalsKey(item.key) && item.magicCode === magicCode + (item) => key.equalsKey(item.key) && item.magicCode === magicCode, ); if (magicCodeRecord) { // move the token to long term dictionary @@ -549,7 +534,6 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Signs the user out with the token server. - * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param userId User ID to sign out. @@ -560,13 +544,12 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider this._userTokens = this._userTokens.filter( (token) => connectionName && - (connectionName !== token.connectionName || channelId !== token.channelId || userId !== token.userId) + (connectionName !== token.connectionName || channelId !== token.channelId || userId !== token.userId), ); } /** * Gets a signin link from the token server that can be sent as part of a SigninCard. - * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @returns A signin link from the token server that can be sent as part of a SigninCard. @@ -577,7 +560,6 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Signs the user out with the token server. - * * @param _context Context for the current turn of conversation with the user. * @param _connectionName Name of the auth connection to use. * @param _resourceUrls The list of resource URLs to retrieve tokens for. @@ -586,7 +568,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider async getAadTokens( _context: TurnContext, _connectionName: string, - _resourceUrls: string[] + _resourceUrls: string[], ): Promise<{ [propertyName: string]: TokenResponse; }> { @@ -597,7 +579,6 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Adds a fake exchangeable token so it can be exchanged later. - * * @param connectionName Name of the auth connection to use. * @param channelId Channel ID. * @param userId User ID. @@ -609,7 +590,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider channelId: string, userId: string, exchangeableItem: string, - token: string + token: string, ) { const key: ExchangeableToken = new ExchangeableToken(); key.channelId = channelId; @@ -622,7 +603,6 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Gets a sign-in resource. - * * @param context [TurnContext](xref:botbuilder-core.TurnContext) for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param userId User ID @@ -633,7 +613,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider context: TurnContext, connectionName: string, userId?: string, - _finalRedirect?: string + _finalRedirect?: string, ): Promise { return { signInLink: `https://botframeworktestadapter.com/oauthsignin/${connectionName}/${context.activity.channelId}/${userId}`, @@ -647,7 +627,6 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Performs a token exchange operation such as for single sign-on. - * * @param context [TurnContext](xref:botbuilder-core.TurnContext) for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param userId User id associated with the token. @@ -658,7 +637,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider context: TurnContext, connectionName: string, userId: string, - tokenExchangeRequest: TokenExchangeRequest + tokenExchangeRequest: TokenExchangeRequest, ): Promise { const exchangeableValue: string = tokenExchangeRequest.token ? tokenExchangeRequest.token @@ -686,7 +665,6 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Adds an instruction to throw an exception during exchange requests. - * * @param connectionName The connection name. * @param channelId The channel id. * @param userId The user id. @@ -706,7 +684,6 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Indicates if the activity is a reply from the bot (role == 'bot') - * * @remarks * Checks to see if the from property and if from.role exists on the Activity before * checking to see who the activity is from. Otherwise returns false by default. @@ -757,7 +734,6 @@ class ExchangeableToken extends UserToken { /** * Support class for `TestAdapter` that allows for the simple construction of a sequence of tests. - * * @remarks * Calling `adapter.send()` or `adapter.test()` will create a new test flow which you can chain * together additional tests using a fluent syntax. @@ -789,14 +765,13 @@ export class TestFlow { constructor( public previous: Promise, private adapter: TestAdapter, - private callback?: (turnContext: TurnContext) => Promise + private callback?: (turnContext: TurnContext) => Promise, ) {} /** * Send something to the bot and expects the bot to return with a given reply. This is simply a * wrapper around calls to `send()` and `assertReply()`. This is such a common pattern that a * helper is provided. - * * @param userSays Text or activity simulating user input. * @param expected Expected text or activity of the reply sent by the bot. * @param description (Optional) Description of the test case. If not provided one will be generated. @@ -807,14 +782,13 @@ export class TestFlow { userSays: string | Partial, expected: string | Partial | ((activity: Partial, description?: string) => void), description?: string, - timeout?: number + timeout?: number, ): TestFlow { return this.send(userSays).assertReply(expected, description || `test("${userSays}", "${expected}")`, timeout); } /** * Sends something to the bot. - * * @param userSays Text or activity simulating user input. * @returns A new [TestFlow](xref:botbuilder-core.TestFlow) object that appends this exchange to the modeled exchange. */ @@ -822,13 +796,12 @@ export class TestFlow { return new TestFlow( this.previous.then(() => this.adapter.processActivity(userSays, this.callback)), this.adapter, - this.callback + this.callback, ); } /** * Creates a conversation update activity and process the activity. - * * @returns {TestFlow} A new TestFlow object. */ sendConversationUpdate(): TestFlow { @@ -840,13 +813,12 @@ export class TestFlow { return this.adapter.processActivity(cu, this.callback); }), this.adapter, - this.callback + this.callback, ); } /** * Generates an assertion if the bots response doesn't match the expected text/activity. - * * @param expected Expected text or activity from the bot. Can be a callback to inspect the response using custom logic. * @param description (Optional) Description of the test case. If not provided one will be generated. * @param timeout (Optional) number of milliseconds to wait for a response from bot. Defaults to a value of `3000`. @@ -855,7 +827,7 @@ export class TestFlow { assertReply( expected: string | Partial | TestActivityInspector, description?: string, - timeout?: number + timeout?: number, ): TestFlow { function defaultInspector(reply: Partial, description2?: string): void { if (typeof expected === 'object') { @@ -902,8 +874,8 @@ export class TestFlow { new Error( `TestAdapter.assertReply(${expecting}): ${description} Timed out after ${ current - start - }ms.` - ) + }ms.`, + ), ); } else if (adapter.activeQueue.length > 0) { // Activity received @@ -922,13 +894,12 @@ export class TestFlow { }); }), this.adapter, - this.callback + this.callback, ); } /** * Generates an assertion that the turn processing logic did not generate a reply from the bot, as expected. - * * @param description (Optional) Description of the test case. If not provided one will be generated. * @param timeout (Optional) number of milliseconds to wait for a response from bot. Defaults to a value of `3000`. * @returns A new [TestFlow](xref:botbuilder-core.TestFlow) object that appends this exchange to the modeled exchange. @@ -955,7 +926,7 @@ export class TestFlow { assert.strictEqual( reply, undefined, - `${JSON.stringify(reply)} is responded when waiting for no reply: '${description}'` + `${JSON.stringify(reply)} is responded when waiting for no reply: '${description}'`, ); resolve(); } else { @@ -966,13 +937,12 @@ export class TestFlow { }); }), this.adapter, - this.callback + this.callback, ); } /** * Generates an assertion if the bots response is not one of the candidate strings. - * * @param candidates List of candidate responses. * @param description (Optional) Description of the test case. If not provided one will be generated. * @param timeout (Optional) number of milliseconds to wait for a response from bot. Defaults to a value of `3000`. @@ -988,18 +958,17 @@ export class TestFlow { } assert.fail( `TestAdapter.assertReplyOneOf(): ${description2 || ''} FAILED, Expected one of :${JSON.stringify( - candidates - )}` + candidates, + )}`, ); }, description, - timeout + timeout, ); } /** * Inserts a delay before continuing. - * * @param ms ms to wait. * @returns A new [TestFlow](xref:botbuilder-core.TestFlow) object that appends this exchange to the modeled exchange. */ @@ -1011,13 +980,12 @@ export class TestFlow { }); }), this.adapter, - this.callback + this.callback, ); } /** * Adds a `then()` step to the tests promise chain. - * * @param onFulfilled Code to run if the test is currently passing. * @param onRejected Code to run if the test has thrown an error. * @returns A new [TestFlow](xref:botbuilder-core.TestFlow) object that appends this exchange to the modeled exchange. @@ -1028,7 +996,6 @@ export class TestFlow { /** * Adds a finally clause. Note that you can't keep chaining afterwards. - * * @param onFinally Code to run after the test chain. * @returns {Promise} A promise representing the async operation. */ @@ -1038,7 +1005,6 @@ export class TestFlow { /** * Adds a `catch()` clause to the tests promise chain. - * * @param onRejected Code to run if the test has thrown an error. * @returns A new [TestFlow](xref:botbuilder-core.TestFlow) object that appends this exchange to the modeled exchange. */ @@ -1048,7 +1014,6 @@ export class TestFlow { /** * Start the test sequence, returning a promise to await. - * * @returns {Promise} A promise representing the async operation. */ startTest(): Promise { @@ -1079,7 +1044,7 @@ function validateActivity(activity: Partial, expected: Partial, expected: Partial, - description: string + description: string, ): void { assert.equal(activity.type, expected.type, `failed "type" assert on ${description}`); assert.equal(activity.text, expected.text, `failed "text" assert on ${description}`); @@ -1087,6 +1052,6 @@ function validateTranscriptActivity( assert.deepEqual( activity.suggestedActions, expected.suggestedActions, - `failed "suggestedActions" assert on ${description}` + `failed "suggestedActions" assert on ${description}`, ); } diff --git a/libraries/botbuilder-core/src/transcriptLogger.ts b/libraries/botbuilder-core/src/transcriptLogger.ts index 58497c9141..0e4b046cff 100644 --- a/libraries/botbuilder-core/src/transcriptLogger.ts +++ b/libraries/botbuilder-core/src/transcriptLogger.ts @@ -25,7 +25,6 @@ export class TranscriptLoggerMiddleware implements Middleware { /** * Middleware for logging incoming and outgoing activities to a transcript store. - * * @param logger Transcript logger */ constructor(logger: TranscriptLogger) { @@ -38,7 +37,6 @@ export class TranscriptLoggerMiddleware implements Middleware { /** * Initialization for middleware turn. - * * @param context Context for the current turn of conversation with the user. * @param next Function to call at the end of the middleware chain. */ @@ -81,7 +79,7 @@ export class TranscriptLoggerMiddleware implements Middleware { }); return responses; - } + }, ); // hook up update activity pipeline @@ -111,11 +109,11 @@ export class TranscriptLoggerMiddleware implements Middleware { id: reference.activityId, }, reference, - false + false, ); this.logActivity(transcript, this.cloneActivity(deleteActivity)); - } + }, ); // process bot logic @@ -147,7 +145,6 @@ export class TranscriptLoggerMiddleware implements Middleware { /** * Logs the Activity. - * * @param transcript Array where the activity will be pushed. * @param activity Activity to log. */ @@ -164,7 +161,6 @@ export class TranscriptLoggerMiddleware implements Middleware { /** * Clones the Activity entity. - * * @param activity Activity to clone. * @returns The cloned activity. */ @@ -174,7 +170,6 @@ export class TranscriptLoggerMiddleware implements Middleware { /** * Error logging helper function. - * * @param err Error or object to console.error out. */ private transcriptLoggerErrorHandler(err: Error | any): void { @@ -195,7 +190,6 @@ export class TranscriptLoggerMiddleware implements Middleware { export class ConsoleTranscriptLogger implements TranscriptLogger { /** * Log an activity to the transcript. - * * @param activity Activity being logged. */ logActivity(activity: Activity): void | Promise { @@ -214,7 +208,6 @@ export class ConsoleTranscriptLogger implements TranscriptLogger { export interface TranscriptLogger { /** * Log an activity to the transcript. - * * @param activity Activity being logged. */ logActivity(activity: Activity): void | Promise; @@ -226,7 +219,6 @@ export interface TranscriptLogger { export interface TranscriptStore extends TranscriptLogger { /** * Get activities for a conversation (Aka the transcript) - * * @param channelId Channel Id. * @param conversationId Conversation Id. * @param continuationToken Continuation token to page through results. @@ -236,12 +228,11 @@ export interface TranscriptStore extends TranscriptLogger { channelId: string, conversationId: string, continuationToken?: string, - startDate?: Date + startDate?: Date, ): Promise>; /** * List conversations in the channelId. - * * @param channelId Channel Id. * @param continuationToken Continuation token to page through results. */ @@ -249,7 +240,6 @@ export interface TranscriptStore extends TranscriptLogger { /** * Delete a specific conversation and all of its activities. - * * @param channelId Channel Id where conversation took place. * @param conversationId Id of the conversation to delete. */ @@ -278,7 +268,6 @@ export interface TranscriptInfo { /** * Page of results. - * * @param T type of items being paged in. */ // tslint:disable-next-line:max-classes-per-file diff --git a/libraries/botbuilder-core/src/turnContext.ts b/libraries/botbuilder-core/src/turnContext.ts index ec9f81ec3b..a906a3cda2 100644 --- a/libraries/botbuilder-core/src/turnContext.ts +++ b/libraries/botbuilder-core/src/turnContext.ts @@ -21,7 +21,6 @@ import { /** * A handler that can participate in send activity events for the current turn. - * * @remarks * **Parameters** * @@ -53,12 +52,11 @@ import { export type SendActivitiesHandler = ( context: TurnContext, activities: Partial[], - next: () => Promise + next: () => Promise, ) => Promise; /** * A handler that can participate in update activity events for the current turn. - * * @remarks * **Parameters** * @@ -85,12 +83,11 @@ export type SendActivitiesHandler = ( export type UpdateActivityHandler = ( context: TurnContext, activity: Partial, - next: () => Promise + next: () => Promise, ) => Promise; /** * A handler that can participate in delete activity events for the current turn. - * * @remarks * **Parameters** * @@ -117,7 +114,7 @@ export type UpdateActivityHandler = ( export type DeleteActivityHandler = ( context: TurnContext, reference: Partial, - next: () => Promise + next: () => Promise, ) => Promise; export const BotCallbackHandlerKey = 'botCallbackHandler'; @@ -133,16 +130,16 @@ function getAppropriateReplyToId(source: Partial): string | undefined return undefined; } -// eslint-disable-next-line @typescript-eslint/no-empty-interface +// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging, @typescript-eslint/no-empty-object-type export interface TurnContext {} /** * Provides context for a turn of a bot. - * * @remarks * Context provides information needed to process an incoming activity. The context object is * created by a [BotAdapter](xref:botbuilder-core.BotAdapter) and persists for the length of the turn. */ +// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging export class TurnContext { private _adapter?: BotAdapter; private _activity?: Activity; @@ -160,20 +157,17 @@ export class TurnContext { /** * Creates an new instance of the [TurnContext](xref:xref:botbuilder-core.TurnContext) class. - * * @param adapterOrContext The adapter creating the context. * @param request The incoming activity for the turn. */ constructor(adapterOrContext: BotAdapter, request: Partial); /** * Creates an new instance of the [TurnContext](xref:xref:botbuilder-core.TurnContext) class. - * * @param adapterOrContext The context object to clone. */ constructor(adapterOrContext: TurnContext); /** * Creates an new instance of the [TurnContext](xref:xref:botbuilder-core.TurnContext) class. - * * @param adapterOrContext The adapter creating the context or the context object to clone. * @param request Optional. The incoming activity for the turn. */ @@ -190,7 +184,6 @@ export class TurnContext { * Removes at mentions for the activity's [recipient](xref:botframework-schema.Activity.recipient) * from the text of an activity and returns the updated text. * Use with caution; this function alters the activity's [text](xref:botframework-schema.Activity.text) property. - * * @param activity The activity to remove at mentions from. * @returns The updated activity's text. * @remarks @@ -214,7 +207,6 @@ export class TurnContext { /** * Removes at mentions for a given ID from the text of an activity and returns the updated text. * Use with caution; this function alters the activity's [text](xref:botframework-schema.Activity.text) property. - * * @param activity The activity to remove at mentions from. * @param id The ID of the user or bot to remove at mentions for. * @returns The updated activity's text. @@ -252,7 +244,6 @@ export class TurnContext { /** * Gets all at-mention entities included in an activity. - * * @param activity The activity. * @returns All the at-mention entities included in an activity. * @remarks @@ -280,7 +271,6 @@ export class TurnContext { /** * Copies conversation reference information from an activity. - * * @param activity The activity to get the information from. * @returns A conversation reference for the conversation that contains this activity. * @remarks @@ -309,7 +299,6 @@ export class TurnContext { /** * Updates an activity with the delivery information from an existing conversation reference. - * * @param activity The activity to update. * @param reference The conversation reference to copy delivery information from. * @param isIncoming Optional. `true` to treat the activity as an incoming activity, where the @@ -324,7 +313,7 @@ export class TurnContext { static applyConversationReference( activity: Partial, reference: Partial, - isIncoming = false + isIncoming = false, ): Partial { activity.channelId = reference.channelId; activity.locale ??= reference.locale; @@ -349,7 +338,6 @@ export class TurnContext { /** * Copies conversation reference information from a resource response for a sent activity. - * * @param activity The sent activity. * @param reply The resource response for the activity, returned by the * [sendActivity](xref:botbuilder-core.TurnContext.sendActivity) or @@ -371,7 +359,7 @@ export class TurnContext { */ static getReplyConversationReference( activity: Partial, - reply: ResourceResponse + reply: ResourceResponse, ): Partial { const reference: Partial = TurnContext.getConversationReference(activity); @@ -388,7 +376,6 @@ export class TurnContext { /** * Asynchronously sends an activity to the sender of the incoming activity. - * * @param name The activity or text to send. * @param value Optional. The text to be spoken by your bot on a speech-enabled channel. * @param valueType Optional. Indicates whether your bot is accepting, expecting, or ignoring user @@ -410,7 +397,7 @@ export class TurnContext { name: string, value?: any, valueType?: string, - label?: string + label?: string, ): Promise { const traceActivity: Partial = { type: ActivityTypes.Trace, @@ -425,7 +412,6 @@ export class TurnContext { /** * Asynchronously sends an activity to the sender of the incoming activity. - * * @param activityOrText The activity or text to send. * @param speak Optional. The text to be spoken by your bot on a speech-enabled channel. * @param inputHint Optional. Indicates whether your bot is accepting, expecting, or ignoring user @@ -456,7 +442,7 @@ export class TurnContext { async sendActivity( activityOrText: string | Partial, speak?: string, - inputHint?: string + inputHint?: string, ): Promise { let a: Partial; if (typeof activityOrText === 'string') { @@ -474,7 +460,6 @@ export class TurnContext { /** * Asynchronously sends a set of activities to the sender of the incoming activity. - * * @param activities The activities to send. * @returns A promise with a ResourceResponse. * @remarks @@ -563,7 +548,6 @@ export class TurnContext { /** * Asynchronously updates a previously sent activity. - * * @param activity The replacement for the original activity. * @returns A promise with a ResourceResponse. * @remarks @@ -593,7 +577,6 @@ export class TurnContext { /** * Asynchronously deletes a previously sent activity. - * * @param idOrReference ID or conversation reference for the activity to delete. * @returns A promise representing the async operation. * @remarks @@ -629,7 +612,6 @@ export class TurnContext { /** * Adds a response handler for send activity operations. - * * @param handler The handler to add to the context object. * @returns The updated context object. * @remarks @@ -660,7 +642,6 @@ export class TurnContext { /** * Adds a response handler for update activity operations. - * * @param handler The handler to add to the context object. * @returns The updated context object. * @remarks @@ -690,7 +671,6 @@ export class TurnContext { /** * Adds a response handler for delete activity operations. - * * @param handler The handler to add to the context object. * @returns The updated context object. * @remarks @@ -720,9 +700,7 @@ export class TurnContext { /** * Called when this turn context object is passed into the constructor for a new turn context. - * * @param context The new turn context object. - * * @remarks * This copies private members from this object to the new object. * All property values are copied by reference. @@ -744,7 +722,6 @@ export class TurnContext { /** * Gets the bot adapter that created this context object. - * * @returns The bot adapter that created this context object. */ get adapter(): BotAdapter { @@ -753,7 +730,6 @@ export class TurnContext { /** * Gets the activity associated with this turn. - * * @returns The activity associated with this turn. * @remarks * This example shows how to get the users trimmed utterance from the activity: @@ -768,7 +744,6 @@ export class TurnContext { /** * Indicates whether the bot has replied to the user this turn. - * * @returns True if at least one response was sent for the current turn; otherwise, false. * @remarks * **true** if at least one response was sent for the current turn; otherwise, **false**. @@ -790,7 +765,6 @@ export class TurnContext { /** * Sets the response flag on the current turn context. - * * @remarks * The [sendActivity](xref:botbuilder-core.TurnContext.sendActivity) and * [sendActivities](xref:botbuilder-core.TurnContext.sendActivities) methods call this method to @@ -806,7 +780,6 @@ export class TurnContext { /** * Gets the locale stored in the turnState. - * * @returns The locale stored in the turnState. */ get locale(): string | undefined { @@ -833,7 +806,6 @@ export class TurnContext { /** * Gets the services registered on this context object. - * * @returns The services registered on this context object. * @remarks * Middleware, other components, and services will typically use this to cache information @@ -862,7 +834,7 @@ export class TurnContext { private emit( handlers: Array<(context: TurnContext, arg: A, next: () => Promise) => Promise>, arg: A, - next: () => Promise + next: () => Promise, ): Promise { const runHandlers = ([handler, ...remaining]: typeof handlers): Promise => { try { diff --git a/libraries/botbuilder-core/src/turnContextStateCollection.ts b/libraries/botbuilder-core/src/turnContextStateCollection.ts index b6a12fef57..6ea4a5a490 100644 --- a/libraries/botbuilder-core/src/turnContextStateCollection.ts +++ b/libraries/botbuilder-core/src/turnContextStateCollection.ts @@ -7,28 +7,24 @@ const TURN_STATE_SCOPE_CACHE = Symbol('turnStateScopeCache'); /** * Values persisted for the lifetime of the turn as part of the [TurnContext](xref:botbuilder-core.TurnContext). - * * @remarks Typical values stored here are objects which are needed for the lifetime of a turn, such * as [Storage](xref:botbuilder-core.Storage), [BotState](xref:botbuilder-core.BotState), [ConversationState](xref:botbuilder-core.ConversationState), [LanguageGenerator](xref:botbuilder-dialogs-adaptive.LanguageGenerator), [ResourceExplorer](xref:botbuilder-dialogs-declarative.ResourceExplorer), etc. */ export class TurnContextStateCollection extends Map { /** * Gets a typed value from the [TurnContextStateCollection](xref:botbuilder-core.TurnContextStateCollection). - * * @param key The values key. */ get(key: any): T; /** * Gets a value from the [TurnContextStateCollection](xref:botbuilder-core.TurnContextStateCollection). - * * @param key The values key. */ get(key: any): any; /** * Gets a value from the [TurnContextStateCollection](xref:botbuilder-core.TurnContextStateCollection). - * * @param key The values key. * @returns The object; or null if no service is registered by the key. */ @@ -38,7 +34,6 @@ export class TurnContextStateCollection extends Map { /** * Push a value by key to the turn's context. - * * @remarks * The keys current value (if any) will be saved and can be restored by calling [pop()](#pop). * @param key The values key. @@ -64,7 +59,6 @@ export class TurnContextStateCollection extends Map { /** * Restores a keys previous value, and returns the value that was removed. - * * @param key The values key. * @returns The removed value. */ diff --git a/libraries/botbuilder-core/src/userState.ts b/libraries/botbuilder-core/src/userState.ts index 5533f32fd8..9bb8e781d8 100644 --- a/libraries/botbuilder-core/src/userState.ts +++ b/libraries/botbuilder-core/src/userState.ts @@ -14,7 +14,6 @@ const NO_KEY = 'UserState: overridden getStorageKey method did not return a key. /** * Reads and writes user state for your bot to storage. - * * @remarks * Each user your bot communicates with will have its own isolated storage object that can be used * to persist information about the user across all of the conversation you have with that user. @@ -28,11 +27,13 @@ const NO_KEY = 'UserState: overridden getStorageKey method did not return a key. export class UserState extends BotState { /** * Creates a new UserState instance. - * * @param storage Storage provider to persist user state to. * @param namespace (Optional) namespace to append to storage keys. Defaults to an empty string. */ - constructor(storage: Storage, private namespace: string = '') { + constructor( + storage: Storage, + private namespace: string = '', + ) { super(storage, (context: TurnContext) => { // Calculate storage key const key: string = this.getStorageKey(context); @@ -43,7 +44,6 @@ export class UserState extends BotState { /** * Returns the storage key for the current user state. - * * @param context Context for current turn of conversation with the user. * @returns The storage key for the current user state. */ diff --git a/libraries/botbuilder-core/src/userTokenProvider.ts b/libraries/botbuilder-core/src/userTokenProvider.ts index 15a542a3b2..b07ebd3705 100644 --- a/libraries/botbuilder-core/src/userTokenProvider.ts +++ b/libraries/botbuilder-core/src/userTokenProvider.ts @@ -11,13 +11,11 @@ import { TokenResponse } from 'botframework-schema'; /** * Interface for User Token OAuth APIs for BotAdapters - * * @deprecated Use `UserTokenClient` instead. */ export interface IUserTokenProvider { /** * Retrieves the OAuth token for a user that is in a sign-in flow. - * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param magicCode (Optional) Optional user entered code to validate. @@ -26,7 +24,6 @@ export interface IUserTokenProvider { /** * Signs the user out with the token server. - * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param userId User id of user to sign out. @@ -35,7 +32,6 @@ export interface IUserTokenProvider { /** * Retrieves the token status for each configured connection for the given user, using the bot's AppCredentials. - * * @param context Context for the current turn of conversation with the user. * @param userId The user Id for which token status is retrieved. * @param includeFilter Comma separated list of connection's to include. Blank will return token status for all configured connections. @@ -45,12 +41,11 @@ export interface IUserTokenProvider { context: TurnContext, userId: string, includeFilter?: string, - oAuthAppCredentials?: any + oAuthAppCredentials?: any, ): Promise; /** * Gets a signin link from the token server that can be sent as part of a SigninCard. - * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. */ @@ -58,14 +53,13 @@ export interface IUserTokenProvider { /** * Signs the user out with the token server. - * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. */ getAadTokens( context: TurnContext, connectionName: string, - resourceUrls: string[] + resourceUrls: string[], ): Promise<{ [propertyName: string]: TokenResponse; }>; diff --git a/libraries/botbuilder-core/tests/ActivityHandler.test.js b/libraries/botbuilder-core/tests/ActivityHandler.test.js index 0598ff8224..995b351ced 100644 --- a/libraries/botbuilder-core/tests/ActivityHandler.test.js +++ b/libraries/botbuilder-core/tests/ActivityHandler.test.js @@ -340,7 +340,7 @@ describe('ActivityHandler', function () { }, }, }, - bot + bot, ); assert(onAdpativeCardInvokeCalled); }); @@ -637,7 +637,7 @@ describe('ActivityHandler', function () { assertFalseFlag( dispatchMessageUpdateActivityCalled, 'dispatchMessageUpdateActivity', - 'onMessageUpdate' + 'onMessageUpdate', ); dispatchMessageUpdateActivityCalled = true; } @@ -689,7 +689,7 @@ describe('ActivityHandler', function () { assertFalseFlag( dispatchMessageDeleteActivityCalled, 'dispatchMessageDeleteActivity', - 'onMessageDelete' + 'onMessageDelete', ); dispatchMessageDeleteActivityCalled = true; } @@ -922,7 +922,7 @@ describe('ActivityHandler', function () { assertFalseFlag(onTokenResponseEventCalled, 'onTokenResponseEvent', 'onTurn', 'onEvent'); assert( !onTokenResponseEventCalled, - 'onEvent should not be true before onTurn and onEvent handlers complete.' + 'onEvent should not be true before onTurn and onEvent handlers complete.', ); onTokenResponseEventCalled = true; await next(); @@ -950,7 +950,7 @@ describe('ActivityHandler', function () { assertFalseFlag(onUnrecognizedActivityTypeCalled, 'onUnrecognizedActivityType', 'onTurn'); assert( !onUnrecognizedActivityTypeCalled, - 'onUnrecognizedActivityType should not be true before onTurn and onUnrecognizedActivityType handlers complete.' + 'onUnrecognizedActivityType should not be true before onTurn and onUnrecognizedActivityType handlers complete.', ); onUnrecognizedActivityTypeCalled = true; await next(); diff --git a/libraries/botbuilder-core/tests/activityHandlerBase.test.js b/libraries/botbuilder-core/tests/activityHandlerBase.test.js index 0cebf89a68..090e533e48 100644 --- a/libraries/botbuilder-core/tests/activityHandlerBase.test.js +++ b/libraries/botbuilder-core/tests/activityHandlerBase.test.js @@ -290,7 +290,7 @@ describe('ActivityHandlerBase', function () { assert(reactionsRemoved, 'reactionsRemoved not found'); assert( reactionsRemoved.length === 1, - `unexpected number of reactionsRemoved: ${reactionsRemoved.length}` + `unexpected number of reactionsRemoved: ${reactionsRemoved.length}`, ); onReactionsRemovedActivityCalled = true; } diff --git a/libraries/botbuilder-core/tests/autoSaveStateMiddleware.test.js b/libraries/botbuilder-core/tests/autoSaveStateMiddleware.test.js index 93c7bcdc29..af3f3f9daa 100644 --- a/libraries/botbuilder-core/tests/autoSaveStateMiddleware.test.js +++ b/libraries/botbuilder-core/tests/autoSaveStateMiddleware.test.js @@ -90,7 +90,7 @@ describe('AutoSaveStateMiddleware', function () { it('should throw exception if invalid plugin passed in.', function () { assert.throws( () => new AutoSaveStateMiddleware(fooState, { read: () => {} }), - new Error("BotStateSet: a object was added that isn't an instance of BotState.") + new Error("BotStateSet: a object was added that isn't an instance of BotState."), ); }); diff --git a/libraries/botbuilder-core/tests/botAdapter.test.js b/libraries/botbuilder-core/tests/botAdapter.test.js index 3ac1eca9ff..264c2c1323 100644 --- a/libraries/botbuilder-core/tests/botAdapter.test.js +++ b/libraries/botbuilder-core/tests/botAdapter.test.js @@ -50,7 +50,7 @@ describe('BotAdapter', function () { assert( middlewares.every((middleware) => middleware.called), - 'every middleware was called' + 'every middleware was called', ); assert(handler.called, 'handler was called'); }); @@ -105,7 +105,7 @@ describe('BotAdapter', function () { await assert.rejects( adapter.processRequest(testMessage, handler), - 'unhandled handler error should yield promise rejection' + 'unhandled handler error should yield promise rejection', ); assert(handler.called, 'handler was called'); @@ -124,7 +124,7 @@ describe('BotAdapter', function () { await assert.rejects( adapter.processRequest(testMessage, handler), - 'unhandled onTurnError error should yield promise rejection' + 'unhandled onTurnError error should yield promise rejection', ); assert(adapter.onTurnError.called, 'onTurnError was called'); @@ -171,7 +171,7 @@ describe('BotAdapter', function () { await assert.rejects( adapter.processRequest(testMessage, handler), - 'unhandled handler error should yield promise rejection' + 'unhandled handler error should yield promise rejection', ); assert(handler.called, 'handler was called'); diff --git a/libraries/botbuilder-core/tests/botState.test.js b/libraries/botbuilder-core/tests/botState.test.js index 983cc605d6..3b7af13bed 100644 --- a/libraries/botbuilder-core/tests/botState.test.js +++ b/libraries/botbuilder-core/tests/botState.test.js @@ -40,7 +40,7 @@ describe('BotState', function () { await botState.load(context); const state = cachedState(context, botState.stateKey); assert(state.test === 'foo', 'invalid initial state'); - delete state.test === 'foo'; + delete state.test; await botState.load(context, true); assert(cachedState(context, botState.stateKey).test === 'foo', 'state not reloaded'); }); @@ -51,7 +51,7 @@ describe('BotState', function () { await botState.clear(context); assert( !Object.prototype.hasOwnProperty.call(cachedState(context, botState.stateKey), 'test'), - 'state not cleared on context.' + 'state not cleared on context.', ); await botState.saveChanges(context); diff --git a/libraries/botbuilder-core/tests/botStatePropertyAccessor.test.js b/libraries/botbuilder-core/tests/botStatePropertyAccessor.test.js index be6c462bc6..8817fc2c17 100644 --- a/libraries/botbuilder-core/tests/botStatePropertyAccessor.test.js +++ b/libraries/botbuilder-core/tests/botStatePropertyAccessor.test.js @@ -124,7 +124,7 @@ describe('BotStatePropertyAccessor', function () { assert(typeof addressValue === 'object', 'default value for PropertyAccessor was not properly set.'); assert( addressValue.street === '1 Microsoft Way', - 'default value for PropertyAccessor was not properly set.' + 'default value for PropertyAccessor was not properly set.', ); assert(addressValue.zipCode === 98052, 'default value for PropertyAccessor was not properly set.'); assert(addressValue.state === 'WA', 'default value for PropertyAccessor was not properly set.'); diff --git a/libraries/botbuilder-core/tests/botTelemetryClient.test.js b/libraries/botbuilder-core/tests/botTelemetryClient.test.js index 0fd5a3d537..85bd7cd840 100644 --- a/libraries/botbuilder-core/tests/botTelemetryClient.test.js +++ b/libraries/botbuilder-core/tests/botTelemetryClient.test.js @@ -31,12 +31,12 @@ describe('BotTelemetryClient', function () { it('should throw TypeError if trackTrace and trackPageView do not exist', function () { assert.throws( () => telemetryTrackDialogView(undefined, 'dialogName'), - TypeError('"telemetryClient" parameter does not have methods trackPageView() or trackTrace()') + TypeError('"telemetryClient" parameter does not have methods trackPageView() or trackTrace()'), ); assert.throws( () => telemetryTrackDialogView({}, 'dialogName'), - TypeError('"telemetryClient" parameter does not have methods trackPageView() or trackTrace()') + TypeError('"telemetryClient" parameter does not have methods trackPageView() or trackTrace()'), ); }); }); diff --git a/libraries/botbuilder-core/tests/cloudAdapterBase.test.js b/libraries/botbuilder-core/tests/cloudAdapterBase.test.js index 3529858472..2b627c9c62 100644 --- a/libraries/botbuilder-core/tests/cloudAdapterBase.test.js +++ b/libraries/botbuilder-core/tests/cloudAdapterBase.test.js @@ -270,7 +270,7 @@ describe('CloudAdapterBase', function () { activity: { name: 'ContinueConversation', }, - }) + }), ); }); @@ -289,7 +289,7 @@ describe('CloudAdapterBase', function () { const { logic, verify } = bootstrap( sinon.match({ claims: sinon.match.some(sinon.match({ type: AuthenticationConstants.AppIdClaim, value: appId })), - }) + }), ); await adapter.continueConversationAsync(appId, {}, undefined, logic); @@ -303,13 +303,13 @@ describe('CloudAdapterBase', function () { const { logic, verify } = bootstrap( sinon.match({ claims: sinon.match.some(sinon.match({ type: AuthenticationConstants.AppIdClaim, value: appId })), - }) + }), ); await adapter.continueConversationAsync( new ClaimsIdentity([{ type: AuthenticationConstants.AppIdClaim, value: appId }]), {}, - logic + logic, ); verify(); @@ -321,7 +321,7 @@ describe('CloudAdapterBase', function () { const { logic } = bootstrap( sinon.match({ claims: sinon.match.some(sinon.match({ type: AuthenticationConstants.AppIdClaim, value: appId })), - }) + }), ); const error = new Error('oh no'); @@ -332,7 +332,7 @@ describe('CloudAdapterBase', function () { throw error; }), - error + error, ); }); }); @@ -372,7 +372,7 @@ describe('CloudAdapterBase', function () { activity: { name: 'CreateConversation', }, - }) + }), ); }); @@ -389,12 +389,12 @@ describe('CloudAdapterBase', function () { it('throws for bad args', async function () { await assert.rejects( adapter.createConversationAsync('botAppId', 'channelId', undefined, 'audience', {}, () => null), - { name: 'TypeError' } + { name: 'TypeError' }, ); await assert.rejects( adapter.createConversationAsync('botAppId', 'channelId', '', 'audience', {}, () => null), - { name: 'TypeError' } + { name: 'TypeError' }, ); await assert.rejects( @@ -404,14 +404,14 @@ describe('CloudAdapterBase', function () { 'serviceUrl', 'audience', undefined, - () => null + () => null, ), - { name: 'TypeError' } + { name: 'TypeError' }, ); await assert.rejects( adapter.createConversationAsync('botAppId', 'channelId', 'serviceUrl', 'audience', {}, undefined), - { name: 'TypeError' } + { name: 'TypeError' }, ); }); @@ -425,7 +425,7 @@ describe('CloudAdapterBase', function () { [serviceUrl, audience], sinon.match({ claims: sinon.match.some(sinon.match({ type: AuthenticationConstants.AppIdClaim, value: appId })), - }) + }), ); mockedConnectorClient.expects('createConversation').withArgs(parameters).once().resolves({ id: 'id' }); @@ -445,7 +445,7 @@ describe('CloudAdapterBase', function () { [serviceUrl, audience], sinon.match({ claims: sinon.match.some(sinon.match({ type: AuthenticationConstants.AppIdClaim, value: appId })), - }) + }), ); const error = new Error('oh no'); @@ -454,7 +454,7 @@ describe('CloudAdapterBase', function () { await assert.rejects( adapter.createConversationAsync(appId, 'channelId', serviceUrl, audience, parameters, logic), - error + error, ); }); }); diff --git a/libraries/botbuilder-core/tests/configurationServiceClientCredentialFactory.test.js b/libraries/botbuilder-core/tests/configurationServiceClientCredentialFactory.test.js index 6bbfec8f17..ce82ec9f25 100644 --- a/libraries/botbuilder-core/tests/configurationServiceClientCredentialFactory.test.js +++ b/libraries/botbuilder-core/tests/configurationServiceClientCredentialFactory.test.js @@ -77,7 +77,7 @@ describe('ConfigurationServiceClientCredentialFactory', function () { assert(err.message.includes('MicrosoftAppId')); assert(err.message.includes('MicrosoftAppPassword')); return true; - } + }, ); }); diff --git a/libraries/botbuilder-core/tests/conversationState.test.js b/libraries/botbuilder-core/tests/conversationState.test.js index 2578afe802..f5326417a9 100644 --- a/libraries/botbuilder-core/tests/conversationState.test.js +++ b/libraries/botbuilder-core/tests/conversationState.test.js @@ -53,7 +53,7 @@ describe('ConversationState', function () { conversationState.getStorageKey = (_turnContext) => undefined; await assert.rejects( conversationState.load(context, true), - new Error('ConversationState: overridden getStorageKey method did not return a key.') + new Error('ConversationState: overridden getStorageKey method did not return a key.'), ); }); }); diff --git a/libraries/botbuilder-core/tests/messageFactory.test.js b/libraries/botbuilder-core/tests/messageFactory.test.js index 765e2ff1b9..dd5670ac9f 100644 --- a/libraries/botbuilder-core/tests/messageFactory.test.js +++ b/libraries/botbuilder-core/tests/messageFactory.test.js @@ -129,7 +129,7 @@ describe('MessageFactory', function () { [{ contentType: 'a' }, { contentType: 'b' }], 'foo', 'bar', - InputHints.IgnoringInput + InputHints.IgnoringInput, ); assertMessage(activity); assertAttachments(activity, 2, ['a', 'b']); @@ -151,7 +151,7 @@ describe('MessageFactory', function () { [{ contentType: 'a' }, { contentType: 'b' }], 'foo', 'bar', - InputHints.IgnoringInput + InputHints.IgnoringInput, ); assertMessage(activity); assertAttachments(activity, 2, ['a', 'b']); @@ -167,7 +167,7 @@ describe('MessageFactory', function () { assertAttachments(activity, 1, ['content-type']); assert( activity.attachments[0].contentUrl === 'https://example.com/content', - 'invalid attachment[0].contentUrl.' + 'invalid attachment[0].contentUrl.', ); }); @@ -177,7 +177,7 @@ describe('MessageFactory', function () { assertAttachments(activity, 1, ['content-type']); assert( activity.attachments[0].contentUrl === 'https://example.com/content', - 'invalid attachment[0].contentUrl.' + 'invalid attachment[0].contentUrl.', ); assert(activity.attachments[0].name === 'file name', 'invalid attachment[0].name.'); }); @@ -189,13 +189,13 @@ describe('MessageFactory', function () { 'file name', 'foo', 'bar', - InputHints.IgnoringInput + InputHints.IgnoringInput, ); assertMessage(activity); assertAttachments(activity, 1, ['content-type']); assert( activity.attachments[0].contentUrl === 'https://example.com/content', - 'invalid attachment[0].contentUrl.' + 'invalid attachment[0].contentUrl.', ); assert(activity.attachments[0].name === 'file name', 'invalid attachment[0].name.'); assert(activity.text === 'foo', 'invalid text field.'); diff --git a/libraries/botbuilder-core/tests/middlewareSet.test.js b/libraries/botbuilder-core/tests/middlewareSet.test.js index c30aba9a33..3d8a70f0a9 100644 --- a/libraries/botbuilder-core/tests/middlewareSet.test.js +++ b/libraries/botbuilder-core/tests/middlewareSet.test.js @@ -135,7 +135,7 @@ describe('MiddlewareSet', function () { } }, () => Promise.reject(new Error('rejected')), - middleware(4) + middleware(4), ); await assert.rejects(set.run(context, noop), (err) => { @@ -163,7 +163,7 @@ describe('MiddlewareSet', function () { assert.strictEqual(err.message, 'rejected'); assert.deepStrictEqual(stack, [1]); return true; - } + }, ); }); }); diff --git a/libraries/botbuilder-core/tests/privateConversationState.test.js b/libraries/botbuilder-core/tests/privateConversationState.test.js index 2b2d033ff6..182dd4dce4 100644 --- a/libraries/botbuilder-core/tests/privateConversationState.test.js +++ b/libraries/botbuilder-core/tests/privateConversationState.test.js @@ -65,7 +65,7 @@ describe('PrivateConversationState', function () { privateConversationState.getStorageKey = (_turnContext) => undefined; await assert.rejects( privateConversationState.load(context, true), - new Error('PrivateConversationState: overridden getStorageKey method did not return a key.') + new Error('PrivateConversationState: overridden getStorageKey method did not return a key.'), ); }); }); diff --git a/libraries/botbuilder-core/tests/storageBaseTests.js b/libraries/botbuilder-core/tests/storageBaseTests.js index 039cc4c28d..f0b4ef5489 100644 --- a/libraries/botbuilder-core/tests/storageBaseTests.js +++ b/libraries/botbuilder-core/tests/storageBaseTests.js @@ -9,7 +9,6 @@ const { BlobStorage, CosmosDbPartitionedStorage } = require('../../botbuilder-az * * All tests return true if assertions pass to indicate that the code ran to completion, passing internal assertions. * Therefore, all tests using theses static tests should strictly check that the method returns true. - * * @example * const testRan = await StorageBaseTests.returnEmptyObjectWhenReadingUnknownKey(storage); * assert.strictEqual(testRan, true); @@ -33,12 +32,12 @@ class StorageBaseTests { if (storage instanceof BlobStorage) { await assert.rejects( async () => await storage.read(null), - new Error('Please provide at least one key to read from storage.') + new Error('Please provide at least one key to read from storage.'), ); } else if (storage instanceof CosmosDbPartitionedStorage || storage instanceof MemoryStorage) { await assert.rejects( async () => await storage.read(null), - ReferenceError('Keys are required when reading.') + ReferenceError('Keys are required when reading.'), ); // CosmosDbStorage and catch-all } else { @@ -53,12 +52,12 @@ class StorageBaseTests { if (storage instanceof BlobStorage) { await assert.rejects( async () => await storage.write(null), - new Error('Please provide a StoreItems with changes to persist.') + new Error('Please provide a StoreItems with changes to persist.'), ); } else if (storage instanceof CosmosDbPartitionedStorage || storage instanceof MemoryStorage) { await assert.rejects( async () => await storage.write(null), - ReferenceError('Changes are required when writing.') + ReferenceError('Changes are required when writing.'), ); // CosmosDbStorage and catch-all } else { @@ -261,18 +260,18 @@ class StorageBaseTests { const result = promptContext.recognized.value; if (result.length > 3) { const succeededMessage = MessageFactory.text( - `You got it at the ${promptContext.attemptCount}th try!` + `You got it at the ${promptContext.attemptCount}th try!`, ); await promptContext.context.sendActivity(succeededMessage); return true; } const reply = MessageFactory.text( - `Please send a name that is longer than 3 characters. ${promptContext.attemptCount}` + `Please send a name that is longer than 3 characters. ${promptContext.attemptCount}`, ); await promptContext.context.sendActivity(reply); return false; - }) + }), ); const steps = [ diff --git a/libraries/botbuilder-core/tests/testAdapter.test.js b/libraries/botbuilder-core/tests/testAdapter.test.js index 54dc83cd13..355606e6d0 100644 --- a/libraries/botbuilder-core/tests/testAdapter.test.js +++ b/libraries/botbuilder-core/tests/testAdapter.test.js @@ -199,7 +199,7 @@ describe('TestAdapter', function () { }); await assert.rejects( async () => await adapter.send('test').assertReply('received', 'received failed', 500).startTest(), - /.*Timed out after.*/ + /.*Timed out after.*/, ); }); @@ -212,7 +212,7 @@ describe('TestAdapter', function () { await assert.rejects( async () => await adapter.send('test').assertReply({ text: 'received' }, 'received failed', 500).startTest(), - /.*Timed out after.*/ + /.*Timed out after.*/, ); }); @@ -228,7 +228,7 @@ describe('TestAdapter', function () { .send('test') .assertReply(() => assert(false, "inspector shouldn't be called."), 'received failed', 500) .startTest(), - /.*Timed out after.*/ + /.*Timed out after.*/, ); }); @@ -239,7 +239,7 @@ describe('TestAdapter', function () { }); }); await assert.doesNotReject( - async () => await adapter.send('test').assertNoReply('no message received', 500).startTest() + async () => await adapter.send('test').assertNoReply('no message received', 500).startTest(), ); }); @@ -266,7 +266,7 @@ describe('TestAdapter', function () { .assertReply({ text: 'received' }) .assertNoReply('should be no additional replies') .startTest(), - /.*should be no additional replies.*/ + /.*should be no additional replies.*/, ); }); diff --git a/libraries/botbuilder-core/tests/transcriptStoreBaseTest.js b/libraries/botbuilder-core/tests/transcriptStoreBaseTest.js index cea2a7887a..4199fbaae0 100644 --- a/libraries/botbuilder-core/tests/transcriptStoreBaseTest.js +++ b/libraries/botbuilder-core/tests/transcriptStoreBaseTest.js @@ -84,23 +84,23 @@ exports._badArgs = function _badArgs(store) { assertPromise(() => store.logActivity(null), 'logActivity should have thrown error about missing activity'), assertPromise( () => store.getTranscriptActivities(null, null), - 'getTranscriptActivities should have thrown error about missing channelId' + 'getTranscriptActivities should have thrown error about missing channelId', ), assertPromise( () => store.getTranscriptActivities('foo', null), - 'getTranscriptActivities should have thrown error about missing conversationId' + 'getTranscriptActivities should have thrown error about missing conversationId', ), assertPromise( () => store.listTranscripts(null), - 'listTranscripts should have thrown error about missing channelId' + 'listTranscripts should have thrown error about missing channelId', ), assertPromise( () => store.deleteTranscript(null, null), - 'deleteTranscript should have thrown error about missing channelId' + 'deleteTranscript should have thrown error about missing channelId', ), assertPromise( () => store.deleteTranscript('foo', null), - 'deleteTranscript should have thrown error about missing conversationId' + 'deleteTranscript should have thrown error about missing conversationId', ), ]); }; @@ -207,12 +207,13 @@ exports._getTranscriptActivities = function _getTranscriptActivities(store, useP // log in parallel batches of 10 const groups = group(activities, 10); return promiseSeq( - groups.map((group) => () => - resolvePromises( - group.map((item) => () => store.logActivity(item)), - useParallel - ) - ) + groups.map( + (group) => () => + resolvePromises( + group.map((item) => () => store.logActivity(item)), + useParallel, + ), + ), ) .then(async () => { let actualPageSize = 0; @@ -222,7 +223,7 @@ exports._getTranscriptActivities = function _getTranscriptActivities(store, useP pagedResult = await store.getTranscriptActivities( 'test', conversationId, - pagedResult.continuationToken + pagedResult.continuationToken, ); assert(pagedResult); assert(pagedResult.items); @@ -253,12 +254,13 @@ exports._getTranscriptActivitiesStartDate = function _getTranscriptActivitiesSta // log in parallel batches of 10 const groups = group(activities, 10); return promiseSeq( - groups.map((group) => () => - resolvePromises( - group.map((item) => () => store.logActivity(item)), - useParallel - ) - ) + groups.map( + (group) => () => + resolvePromises( + group.map((item) => () => store.logActivity(item)), + useParallel, + ), + ), ) .then(async () => { let actualPageSize = 0; @@ -270,7 +272,7 @@ exports._getTranscriptActivitiesStartDate = function _getTranscriptActivitiesSta 'test', conversationId, pagedResult.continuationToken, - referenceDate + referenceDate, ); assert(pagedResult); assert(pagedResult.items); @@ -311,12 +313,13 @@ exports._listTranscripts = function _listTranscripts(store, useParallel = true) // log in parallel batches of 10 const groups = group(activities, 10); return promiseSeq( - groups.map((group) => () => - resolvePromises( - group.map((item) => () => store.logActivity(item)), - useParallel - ) - ) + groups.map( + (group) => () => + resolvePromises( + group.map((item) => () => store.logActivity(item)), + useParallel, + ), + ), ) .then(async () => { let actualPageSize = 0; diff --git a/libraries/botbuilder-core/tests/transcriptUtilities.js b/libraries/botbuilder-core/tests/transcriptUtilities.js index 2ac8da67d4..46f907a50e 100644 --- a/libraries/botbuilder-core/tests/transcriptUtilities.js +++ b/libraries/botbuilder-core/tests/transcriptUtilities.js @@ -27,7 +27,6 @@ module.exports = { /** * Loads a list of activities from a .transcript file. - * * @param {string} transcriptFilePath Relative or absolute path to .transcript file. */ function getActivitiesFromTranscript(transcriptFilePath) { @@ -36,7 +35,6 @@ function getActivitiesFromTranscript(transcriptFilePath) { /** * Loads a list of activities from a .chat file. - * * @param {string} chatFilePath Relative or absolute path to .chat file. */ async function getActivitiesFromChat(chatFilePath) { @@ -48,7 +46,6 @@ async function getActivitiesFromChat(chatFilePath) { /** * Creates a Mocha Test definition (Mocha.ITestDefinition) that will use the TestAdapter to test a bot logic against the specified transcript file. * Optionally, pass a third parameter (as function) to register middleware into the TestAdapter. - * * @param {string} relativeTranscriptPath Path to the transcript file. Can be a .chat or .transcript file. * @param {Function} botLogicFactoryFun Function which accepts conversationState and userState and should return the bots logic to test. * @param {Function} middlewareRegistrationFun (Optional) Function which accepts the testAdapter, conversationState and userState. @@ -64,7 +61,6 @@ function assertBotLogicWithBotBuilderTranscript(relativeTranscriptPath, botLogic /** * Creates a Mocha Test definition (Mocha.ITestDefinition) that will use the TestAdapter to test a bot logic against the specified transcript file. * Optionally, pass a third parameter (as function) to register middleware into the TestAdapter. - * * @param {string} transcriptPath Path to the transcript file. Can be a .chat or .transcript file. * @param {Function} botLogicFactoryFun Function which accepts conversationState and userState and should return the bots logic to test. * @param {Function} middlewareRegistrationFun (Optional) Function which accepts the testAdapter, conversationState and userState. diff --git a/libraries/botbuilder-core/tests/turnContext.test.js b/libraries/botbuilder-core/tests/turnContext.test.js index 596c2cad6d..f065ad12d5 100644 --- a/libraries/botbuilder-core/tests/turnContext.test.js +++ b/libraries/botbuilder-core/tests/turnContext.test.js @@ -47,7 +47,7 @@ class SimpleAdapter extends BotAdapter { assert(reference, 'SimpleAdapter.deleteActivity: missing reference.'); assert( reference.activityId === '1234', - `SimpleAdapter.deleteActivity: invalid activityId of "${reference.activityId}".` + `SimpleAdapter.deleteActivity: invalid activityId of "${reference.activityId}".`, ); return Promise.resolve(); } @@ -127,7 +127,7 @@ describe('TurnContext', function () { context.turnState.set('foo', 'bar'); assert( context.turnState.get('foo') === 'bar', - `invalid value of "${context.turnState.get('foo')}" after set().` + `invalid value of "${context.turnState.get('foo')}" after set().`, ); }); @@ -156,7 +156,7 @@ describe('TurnContext', function () { context.turnState.push('foo', 'b'); assert( context.turnState.get('foo') === 'b', - `invalid value of "${context.turnState.get('foo')}" after push().` + `invalid value of "${context.turnState.get('foo')}" after push().`, ); const old = context.turnState.pop('foo'); assert(old == 'b', 'popped value not returned.'); @@ -340,7 +340,7 @@ describe('TurnContext', function () { const activity2 = TurnContext.applyConversationReference( { text: 'foo', type: 'message', locale: 'es-ES' }, reference, - true + true, ); assert(activity2.id, 'activity2 missing id'); assert(activity2.from, 'activity2 missing from'); @@ -350,7 +350,7 @@ describe('TurnContext', function () { assert(activity2.locale, 'activity2 missing locale.'); assert( activity2.locale !== testMessageWithLocale.locale, - 'the activity2 locale is being overwritten by the reference locale' + 'the activity2 locale is being overwritten by the reference locale', ); // Round trip outgoing activity without a replyToId diff --git a/libraries/botbuilder-core/tests/userState.test.js b/libraries/botbuilder-core/tests/userState.test.js index 1a43f30afa..4820124650 100644 --- a/libraries/botbuilder-core/tests/userState.test.js +++ b/libraries/botbuilder-core/tests/userState.test.js @@ -43,7 +43,7 @@ describe('UserState', function () { userState.getStorageKey = (_turnContext) => undefined; await assert.rejects( userState.load(context, true), - new Error('UserState: overridden getStorageKey method did not return a key.') + new Error('UserState: overridden getStorageKey method did not return a key.'), ); }); }); From 8e288e2c1d567ae6c0634ae5a26ee9d2bda4efad Mon Sep 17 00:00:00 2001 From: JhontSouth Date: Mon, 21 Oct 2024 14:24:50 -0500 Subject: [PATCH 2/7] Merge branch 'southworks/update/eslint-packages' into southworks/fix/eslint-issues-botbuilder-core --- libraries/botbuilder-azure/package.json | 2 +- libraries/botbuilder-core/eslint.config.cjs | 7 ++----- libraries/botbuilder-core/package.json | 4 ++-- libraries/botbuilder-dialogs-adaptive-testing/package.json | 2 +- libraries/botbuilder-dialogs/package.json | 1 + libraries/botbuilder/package.json | 2 +- libraries/botframework-config/package.json | 2 +- 7 files changed, 9 insertions(+), 11 deletions(-) diff --git a/libraries/botbuilder-azure/package.json b/libraries/botbuilder-azure/package.json index 6cb5aec105..1375a6471b 100644 --- a/libraries/botbuilder-azure/package.json +++ b/libraries/botbuilder-azure/package.json @@ -38,7 +38,7 @@ "lodash": "^4.17.20", "p-map": "^4.0.0" }, - "devDependencies": { + "devDependencies": { "fs-extra": "^11.2.0", "nock": "^13.5.5", "node-fetch": "^2.7.0" diff --git a/libraries/botbuilder-core/eslint.config.cjs b/libraries/botbuilder-core/eslint.config.cjs index 9a63fa69c2..66c34beb4b 100644 --- a/libraries/botbuilder-core/eslint.config.cjs +++ b/libraries/botbuilder-core/eslint.config.cjs @@ -1,11 +1,8 @@ -const onlyWarn = require("eslint-plugin-only-warn"); -const sharedConfig = require("../../eslint.config.cjs") +const onlyWarn = require('eslint-plugin-only-warn'); +const sharedConfig = require('../../eslint.config.cjs'); module.exports = [ ...sharedConfig, - { - files: ['**/*.js, **/*.ts'], - }, { plugins: { 'only-warn': onlyWarn, diff --git a/libraries/botbuilder-core/package.json b/libraries/botbuilder-core/package.json index 9710105120..28c7e70c28 100644 --- a/libraries/botbuilder-core/package.json +++ b/libraries/botbuilder-core/package.json @@ -37,7 +37,7 @@ "zod": "^3.23.8" }, "devDependencies": { - "axios": "^1.7.7", + "axios": "^1.7.7", "mime-types": "^2.1.35", "unzipper": "^0.12.3" }, @@ -47,7 +47,7 @@ "build:rollup": "yarn clean && yarn build && api-extractor run --verbose --local", "clean": "rimraf _ts3.4 lib tsconfig.tsbuildinfo", "depcheck": "depcheck --config ../../.depcheckrc", - "lint": "eslint .", + "lint": "eslint . ", "postbuild": "downlevel-dts lib _ts3.4/lib --checksum", "test": "npm-run-all build test:mocha", "test:compat": "api-extractor run --verbose", diff --git a/libraries/botbuilder-dialogs-adaptive-testing/package.json b/libraries/botbuilder-dialogs-adaptive-testing/package.json index c152be89b8..736ac3c113 100644 --- a/libraries/botbuilder-dialogs-adaptive-testing/package.json +++ b/libraries/botbuilder-dialogs-adaptive-testing/package.json @@ -39,7 +39,7 @@ "zod": "^3.23.8" }, "devDependencies": { - "botbuilder": "4.1.6", + "botbuilder": "4.1.6", "@microsoft/recognizers-text-suite": "1.1.4" }, "author": "Microsoft", diff --git a/libraries/botbuilder-dialogs/package.json b/libraries/botbuilder-dialogs/package.json index 7e996fa365..fb480ed8be 100644 --- a/libraries/botbuilder-dialogs/package.json +++ b/libraries/botbuilder-dialogs/package.json @@ -42,6 +42,7 @@ }, "devDependencies": { "@types/globalize": "^1.5.5", + "line-reader": "^0.4.0" }, "scripts": { diff --git a/libraries/botbuilder/package.json b/libraries/botbuilder/package.json index 18775a5582..a77cac2347 100644 --- a/libraries/botbuilder/package.json +++ b/libraries/botbuilder/package.json @@ -45,7 +45,7 @@ "zod": "^3.23.8" }, "devDependencies": { - "chai": "^4.5.0", + "chai": "^4.5.0", "lodash": "^4.17.20", "nock": "^13.5.5", "node-mocks-http": "^1.16.0" diff --git a/libraries/botframework-config/package.json b/libraries/botframework-config/package.json index e747074b11..c253fe3d66 100644 --- a/libraries/botframework-config/package.json +++ b/libraries/botframework-config/package.json @@ -39,7 +39,7 @@ "uuid": "^10.0.0" }, "devDependencies": { - "@types/uuid": "^10.0.0" + "@types/uuid": "^10.0.0" }, "scripts": { "build": "tsc -b", From 3382e409887160ea763db124f18ed81818edd196 Mon Sep 17 00:00:00 2001 From: JhontSouth Date: Mon, 21 Oct 2024 14:33:07 -0500 Subject: [PATCH 3/7] remove useless config file --- libraries/botbuilder-core/eslint.config.cjs | 11 ----------- libraries/botbuilder-core/package.json | 2 +- 2 files changed, 1 insertion(+), 12 deletions(-) delete mode 100644 libraries/botbuilder-core/eslint.config.cjs diff --git a/libraries/botbuilder-core/eslint.config.cjs b/libraries/botbuilder-core/eslint.config.cjs deleted file mode 100644 index 66c34beb4b..0000000000 --- a/libraries/botbuilder-core/eslint.config.cjs +++ /dev/null @@ -1,11 +0,0 @@ -const onlyWarn = require('eslint-plugin-only-warn'); -const sharedConfig = require('../../eslint.config.cjs'); - -module.exports = [ - ...sharedConfig, - { - plugins: { - 'only-warn': onlyWarn, - }, - }, -]; diff --git a/libraries/botbuilder-core/package.json b/libraries/botbuilder-core/package.json index 28c7e70c28..64f6928e35 100644 --- a/libraries/botbuilder-core/package.json +++ b/libraries/botbuilder-core/package.json @@ -47,7 +47,7 @@ "build:rollup": "yarn clean && yarn build && api-extractor run --verbose --local", "clean": "rimraf _ts3.4 lib tsconfig.tsbuildinfo", "depcheck": "depcheck --config ../../.depcheckrc", - "lint": "eslint . ", + "lint": "eslint . --config ../../eslint.config.cjs", "postbuild": "downlevel-dts lib _ts3.4/lib --checksum", "test": "npm-run-all build test:mocha", "test:compat": "api-extractor run --verbose", From 1f7e5b4c2b764eb954220b6537d1859e28666ff6 Mon Sep 17 00:00:00 2001 From: JhontSouth Date: Thu, 24 Oct 2024 10:38:23 -0500 Subject: [PATCH 4/7] Merge branch 'southworks/update/eslint-packages' into southworks/fix/eslint-issues-botbuilder-core --- libraries/botbuilder-azure/package.json | 2 +- libraries/botbuilder-core/package.json | 2 +- .../botbuilder-core/src/activityFactory.ts | 4 ++ .../botbuilder-core/src/activityHandler.ts | 55 +++++++++++++++++++ .../src/activityHandlerBase.ts | 22 ++++++++ .../botbuilder-core/src/adapterExtensions.ts | 1 + .../src/autoSaveStateMiddleware.ts | 4 ++ libraries/botbuilder-core/src/botAdapter.ts | 13 +++++ libraries/botbuilder-core/src/botState.ts | 8 +++ .../src/botStatePropertyAccessor.ts | 12 +++- libraries/botbuilder-core/src/botStateSet.ts | 4 ++ .../botbuilder-core/src/botTelemetryClient.ts | 7 +++ .../botbuilder-core/src/browserStorage.ts | 2 + libraries/botbuilder-core/src/cardFactory.ts | 18 ++++++ .../botbuilder-core/src/cloudAdapterBase.ts | 5 ++ .../src/componentRegistration.ts | 2 + ...configurationBotFrameworkAuthentication.ts | 10 ++++ ...igurationServiceClientCredentialFactory.ts | 2 + .../botbuilder-core/src/conversationState.ts | 3 + .../botbuilder-core/src/coreAppCredentials.ts | 2 + .../src/extendedUserTokenProvider.ts | 10 ++++ .../botbuilder-core/src/invokeException.ts | 1 + .../botbuilder-core/src/memoryStorage.ts | 5 ++ .../src/memoryTranscriptStore.ts | 5 ++ .../botbuilder-core/src/messageFactory.ts | 7 +++ .../botbuilder-core/src/middlewareSet.ts | 6 ++ .../src/privateConversationState.ts | 3 + .../botbuilder-core/src/propertyManager.ts | 1 + libraries/botbuilder-core/src/queueStorage.ts | 1 + .../botbuilder-core/src/recognizerResult.ts | 1 + .../src/registerClassMiddleware.ts | 2 + .../src/showTypingMiddleware.ts | 3 + .../src/skills/skillConversationIdFactory.ts | 4 ++ .../skills/skillConversationIdFactoryBase.ts | 5 ++ .../src/skypeMentionNormalizeMiddleware.ts | 3 + libraries/botbuilder-core/src/storage.ts | 5 ++ libraries/botbuilder-core/src/stringUtils.ts | 3 + .../src/telemetryLoggerMiddleware.ts | 12 ++++ libraries/botbuilder-core/src/testAdapter.ts | 37 +++++++++++++ .../botbuilder-core/src/transcriptLogger.ts | 11 ++++ libraries/botbuilder-core/src/turnContext.ts | 28 ++++++++++ .../src/turnContextStateCollection.ts | 6 ++ libraries/botbuilder-core/src/userState.ts | 3 + .../botbuilder-core/src/userTokenProvider.ts | 6 ++ .../tests/activityHandlerBase.test.js | 1 + .../botbuilder-core/tests/botAdapter.test.js | 1 + .../botbuilder-core/tests/botState.test.js | 1 + .../tests/browserStorage.test.js | 16 ++++-- .../tests/cloudAdapterBase.test.js | 1 + .../tests/conversationState.test.js | 1 + .../tests/memoryStorage.test.js | 22 ++++---- .../tests/privateConversationState.test.js | 1 + .../botbuilder-core/tests/storageBaseTests.js | 1 + .../tests/telemetryMiddleware.test.js | 1 + .../tests/transcriptMiddleware.test.js | 1 + .../tests/transcriptUtilities.js | 4 ++ .../botbuilder-core/tests/userState.test.js | 1 + .../package.json | 2 +- libraries/botbuilder-dialogs/package.json | 1 - libraries/botbuilder/package.json | 2 +- libraries/botframework-config/package.json | 2 +- yarn.lock | 20 ++++++- 62 files changed, 400 insertions(+), 25 deletions(-) diff --git a/libraries/botbuilder-azure/package.json b/libraries/botbuilder-azure/package.json index 1375a6471b..6cb5aec105 100644 --- a/libraries/botbuilder-azure/package.json +++ b/libraries/botbuilder-azure/package.json @@ -38,7 +38,7 @@ "lodash": "^4.17.20", "p-map": "^4.0.0" }, - "devDependencies": { + "devDependencies": { "fs-extra": "^11.2.0", "nock": "^13.5.5", "node-fetch": "^2.7.0" diff --git a/libraries/botbuilder-core/package.json b/libraries/botbuilder-core/package.json index 64f6928e35..68b149d810 100644 --- a/libraries/botbuilder-core/package.json +++ b/libraries/botbuilder-core/package.json @@ -37,7 +37,7 @@ "zod": "^3.23.8" }, "devDependencies": { - "axios": "^1.7.7", + "axios": "^1.7.7", "mime-types": "^2.1.35", "unzipper": "^0.12.3" }, diff --git a/libraries/botbuilder-core/src/activityFactory.ts b/libraries/botbuilder-core/src/activityFactory.ts index e0b1700ba3..827c0d2523 100644 --- a/libraries/botbuilder-core/src/activityFactory.ts +++ b/libraries/botbuilder-core/src/activityFactory.ts @@ -115,6 +115,7 @@ export class ActivityFactory { /** * Generate the activity. + * * @param lgResult string result from languageGenerator. * @returns The generated MessageActivity. */ @@ -136,6 +137,7 @@ export class ActivityFactory { /** * Given a lg result, create a text activity. This method will create a MessageActivity from text. + * * @param text lg text output. * @returns The created MessageActivity. */ @@ -154,6 +156,7 @@ export class ActivityFactory { /** * Given a structured lg result, create an activity. This method will create an MessageActivity from object + * * @param lgValue lg output. * @returns The created MessageActivity. */ @@ -174,6 +177,7 @@ export class ActivityFactory { /** * Builds an [Activity](xref:botframework-schema.Activity) with a given message. + * * @param messageValue Message value on which to base the activity. * @returns [Activity](xref:botframework-schema.Activity) with the given message. */ diff --git a/libraries/botbuilder-core/src/activityHandler.ts b/libraries/botbuilder-core/src/activityHandler.ts index f11b931678..004e37e9b5 100644 --- a/libraries/botbuilder-core/src/activityHandler.ts +++ b/libraries/botbuilder-core/src/activityHandler.ts @@ -22,6 +22,7 @@ import { /** * Describes a bot activity event handler, for use with an [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. + * * @remarks * **Parameters** * @@ -43,6 +44,7 @@ export type BotHandler = (context: TurnContext, next: () => Promise) => Pr /** * Event-emitting activity handler for bots. Extends [ActivityHandlerBase](xref:botbuilder-core.ActivityHandlerBase). + * * @remarks * This provides an extensible class for handling incoming activities in an event-driven way. * You can register an arbitrary set of handlers for each event type. @@ -94,6 +96,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _turn_ event, emitted for every incoming activity, regardless of type. + * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. */ @@ -103,6 +106,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _message_ event, emitted for every incoming message activity. + * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -117,6 +121,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _message update_ event, emitted for every incoming message activity. + * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -133,6 +138,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _message delete_ event, emitted for every incoming message activity. + * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -149,6 +155,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _conversation update_ event, emitted for every incoming * conversation update activity. + * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -166,6 +173,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _members added_ event, emitted for any incoming * conversation update activity that includes members added to the conversation. + * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -182,6 +190,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _members removed_ event, emitted for any incoming * conversation update activity that includes members removed from the conversation. + * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -198,6 +207,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _message reaction_ event, emitted for every incoming * message reaction activity. + * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -218,6 +228,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _reactions added_ event, emitted for any incoming * message reaction activity that describes reactions added to a message. + * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -234,6 +245,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _reactions removed_ event, emitted for any incoming * message reaction activity that describes reactions removed from a message. + * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -249,6 +261,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _event_ event, emitted for every incoming event activity. + * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -269,6 +282,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _end of conversation_ activity. + * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -283,6 +297,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _typing_ activity. + * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -295,6 +310,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _installationupdate_ activity. + * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -307,6 +323,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _installationupdate add_ activity. + * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * To handle a InstallationUpdateAdd event, use the @@ -318,6 +335,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _installationupdate remove_ activity. + * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -331,6 +349,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _tokens-response_ event, emitted for any incoming * `tokens/response` event activity. These are generated as part of the OAuth authentication flow. + * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -348,6 +367,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _command_ activity. + * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -360,6 +380,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _CommandResult_ activity. + * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -374,6 +395,7 @@ export class ActivityHandler extends ActivityHandlerBase { * Registers an activity event handler for the _unrecognized activity type_ event, emitted for an * incoming activity with a type for which the [ActivityHandler](xref:botbuilder-core.ActivityHandler) * doesn't provide an event handler. + * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. * @remarks @@ -390,6 +412,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers an activity event handler for the _dialog_ event, emitted as the last event for an incoming activity. + * * @param handler The event handler. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. */ @@ -399,6 +422,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Called to initiate the event emission process. + * * @param context The context object for the current turn. * @remarks * Typically, you would provide this method as the function handler that the adapter calls @@ -424,6 +448,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Called at the start of the event emission process. + * * @param context The context object for the current turn. * @remarks * Override this method to use custom logic for emitting events. @@ -439,6 +464,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _message_ handlers and then continues the event emission process. + * * @param context The context object for the current turn. * @remarks * Override this method to support channel-specific behavior across multiple channels. @@ -453,6 +479,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _message update_ handlers and then continues the event emission process. + * * @param context The context object for the current turn. * @remarks * Override this method to support channel-specific behavior across multiple channels. @@ -469,6 +496,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _message delete_ handlers and then continues the event emission process. + * * @param context The context object for the current turn. * @remarks * Override this method to support channel-specific behavior across multiple channels. @@ -485,6 +513,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Provides default behavior for invoke activities. + * * @param context The context object for the current turn. * @returns {Promise} An Invoke Response for the activity. * @remarks @@ -532,6 +561,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Handle _signin invoke activity type_. + * * @param _context The context object for the current turn. * @remarks * Override this method to support channel-specific behavior across multiple channels. @@ -542,6 +572,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Invoked when the bot is sent an Adaptive Card Action Execute. + * * @param _context the context object for the current turn * @param _invokeValue incoming activity value * @returns {Promise} An Adaptive Card Invoke Response for the activity. @@ -555,6 +586,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Invoked when the bot is sent an invoke activity with name of 'application/search'. + * * @param _context the context object for the current turn. * @param _invokeValue incoming activity value. * @returns {Promise} A Search Invoke Response for the activity. @@ -565,6 +597,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _endOfConversation_ handlers and then continues the event emission process. + * * @param context The context object for the current turn. * @remarks * Override this method to support channel-specific behavior across multiple channels. @@ -579,6 +612,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _typing_ handlers and then continues the event emission process. + * * @param context The context object for the current turn. * @remarks * Override this method to support channel-specific behavior across multiple channels. @@ -593,6 +627,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _instllationupdate_ handlers and then continues the event emission process. + * * @param context The context object for the current turn. * @remarks * Override this method to support channel-specific behavior across multiple channels. @@ -609,6 +644,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _command_ handlers and then continues the event emission process. + * * @param context The context object for the current turn. */ protected async onCommandActivity(context: TurnContext): Promise { @@ -617,6 +653,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _commandresult_ handlers and then continues the event emission process. + * * @param context The context object for the current turn. */ protected async onCommandResultActivity(context: TurnContext): Promise { @@ -625,6 +662,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs the _installation update_ sub-type handlers, as appropriate, and then continues the event emission process. + * * @param context The context object for the current turn. * @remarks * Override this method to support channel-specific behavior across multiple channels or to add @@ -650,6 +688,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _installation update add_ handlers and then continues the event emission process. + * * @param context The context object for the current turn. * @remarks * Override this method to support channel-specific behavior across multiple channels. @@ -664,6 +703,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _installation update remove_ handlers and then continues the event emission process. + * * @param context The context object for the current turn. * @remarks * Override this method to support channel-specific behavior across multiple channels. @@ -678,6 +718,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _unrecognized activity type_ handlers and then continues the event emission process. + * * @param context The context object for the current turn. * @remarks * Override this method to support channel-specific behavior across multiple channels. @@ -785,6 +826,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _conversation update_ handlers and then continues the event emission process. + * * @param context The context object for the current turn. * @remarks * Override this method to support channel-specific behavior across multiple channels. @@ -802,6 +844,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs the _conversation update_ sub-type handlers, as appropriate, and then continues the event emission process. + * * @param context The context object for the current turn. * @remarks * Override this method to support channel-specific behavior across multiple channels or to add @@ -824,6 +867,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs the _message update_ sub-type handlers, as appropriate, and then continues the event emission process. + * * @param context The context object for the current turn. * @remarks * Override this method to support channel-specific behavior across multiple channels or to add @@ -837,6 +881,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs the _message delete_ sub-type handlers, as appropriate, and then continues the event emission process. + * * @param context The context object for the current turn. * @remarks * Override this method to support channel-specific behavior across multiple channels or to add @@ -849,6 +894,7 @@ export class ActivityHandler extends ActivityHandlerBase { } /** * Runs all registered _message reaction_ handlers and then continues the event emission process. + * * @param context The context object for the current turn. * @remarks * Override this method to support channel-specific behavior across multiple channels. @@ -866,6 +912,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _reactions added_ handlers and then continues the event emission process. + * * @param reactionsAdded The list of reactions added. * @param context The context object for the current turn. * @remarks @@ -881,6 +928,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered _reactions removed_ handlers and then continues the event emission process. + * * @param reactionsRemoved The list of reactions removed. * @param context The context object for the current turn. * @remarks @@ -899,6 +947,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs the _message reaction_ sub-type handlers, as appropriate, and then continues the event emission process. + * * @param context The context object for the current turn. * @remarks * Override this method to support channel-specific behavior across multiple channels or to add @@ -919,6 +968,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs all registered event_ handlers and then continues the event emission process. + * * @param context The context object for the current turn. * @remarks * Override this method to support channel-specific behavior across multiple channels. @@ -936,6 +986,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Runs the _event_ sub-type handlers, as appropriate, and then continues the event emission process. + * * @param context The context object for the current turn. * @remarks * Override this method to support channel-specific behavior across multiple channels or to add custom event sub-type events. @@ -956,6 +1007,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Called at the end of the event emission process. + * * @param context The context object for the current turn. * @returns {Promise} A promise representing the async operation. * @remarks @@ -975,6 +1027,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Registers a bot event handler to receive a specific event. + * * @param type The identifier for the event type. * @param handler The event handler to register. * @returns A reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. @@ -990,6 +1043,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * Emits an event and executes any registered handlers. + * * @param context The context object for the current turn. * @param type The identifier for the event type. * @param onNext The continuation function to call after all registered handlers for this event complete. @@ -1027,6 +1081,7 @@ export class ActivityHandler extends ActivityHandlerBase { /** * An [InvokeResponse](xref:botbuilder.InvokeResponse) factory that initializes the body to the parameter passed and status equal to OK. + * * @param body JSON serialized content from a POST response. * @returns A new [InvokeResponse](xref:botbuilder.InvokeResponse) object. */ diff --git a/libraries/botbuilder-core/src/activityHandlerBase.ts b/libraries/botbuilder-core/src/activityHandlerBase.ts index a3b6a89053..b6363902e9 100644 --- a/libraries/botbuilder-core/src/activityHandlerBase.ts +++ b/libraries/botbuilder-core/src/activityHandlerBase.ts @@ -11,6 +11,7 @@ export const INVOKE_RESPONSE_KEY = Symbol('invokeResponse'); /** * Defines the core behavior for event-emitting activity handlers for bots. + * * @remarks * This provides an extensible class for handling incoming activities in an event-driven way. * You can register an arbitrary set of handlers for each event type. @@ -32,6 +33,7 @@ export const INVOKE_RESPONSE_KEY = Symbol('invokeResponse'); export class ActivityHandlerBase { /** * Called at the start of the event emission process. + * * @param context The context object for the current turn. * @remarks * Override this method to use custom logic for emitting events. @@ -97,6 +99,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _message_ event. + * * @param _context The context object for the current turn. * @remarks * Override this method to run registered _message_ handlers and then continue the event @@ -108,6 +111,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _message update_ event. + * * @param _context The context object for the current turn. * @remarks * Override this method to run registered _message update_ handlers and then continue the event @@ -119,6 +123,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _message delete_ event. + * * @param _context The context object for the current turn. * @remarks * Override this method to run registered _message delete_ handlers and then continue the event @@ -130,6 +135,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _conversation update_ event. + * * @param context The context object for the current turn. * @remarks * Override this method to run registered _conversation update_ handlers and then continue the event @@ -163,6 +169,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _message reaction_ event. + * * @param context The context object for the current turn. * @remarks * Override this method to run registered _message reaction_ handlers and then continue the event @@ -186,6 +193,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _event_ event. + * * @param _context The context object for the current turn. * @remarks * Override this method to run registered _event_ handlers and then continue the event @@ -197,6 +205,7 @@ export class ActivityHandlerBase { /** * Provides a hook for invoke calls. + * * @param _context The context object for the current turn. * @returns {Promise} An Invoke Response for the activity. * @remarks @@ -208,6 +217,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _end of conversation_ event. + * * @param _context The context object for the current turn. * @remarks * Override this method to run registered _end of conversation_ handlers and then continue the event @@ -219,6 +229,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _typing_ event. + * * @param _context The context object for the current turn. * @remarks * Override this method to run registered _typing_ handlers and then continue the event @@ -230,6 +241,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _installationupdate_ event. + * * @param context The context object for the current turn. * @remarks * Override this method to run registered _installationupdate_ handlers and then continue the event @@ -250,6 +262,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _installationupdateadd_ event. + * * @param _context The context object for the current turn. * @remarks * Override this method to run registered _installationupdateadd_ handlers and then continue the event @@ -261,6 +274,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _installationupdateremove_ event. + * * @param _context The context object for the current turn. * @remarks * Override this method to run registered _installationupdateremove_ handlers and then continue the event @@ -272,6 +286,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _unrecognized_ event. + * * @param _context The context object for the current turn. * @remarks * Override this method to run registered _unrecognized_ handlers and then continue the event @@ -284,6 +299,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _members added_ event, * a sub-type of the _conversation update_ event. + * * @param _membersAdded An array of the members added to the conversation. * @param _context The context object for the current turn. * @remarks @@ -297,6 +313,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _members removed_ event, * a sub-type of the _conversation update_ event. + * * @param _membersRemoved An array of the members removed from the conversation. * @param _context The context object for the current turn. * @remarks @@ -310,6 +327,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _reactions added_ event, * a sub-type of the _message reaction_ event. + * * @param _reactionsAdded An array of the reactions added to a message. * @param _context The context object for the current turn. * @remarks @@ -323,6 +341,7 @@ export class ActivityHandlerBase { /** * Provides a hook for emitting the _reactions removed_ event, * a sub-type of the _message reaction_ event. + * * @param _reactionsRemoved An array of the reactions removed from a message. * @param _context The context object for the current turn. * @remarks @@ -342,6 +361,7 @@ export class ActivityHandlerBase { * Commands are requests to perform an action and receivers typically respond with * one or more commandResult activities. Receivers are also expected to explicitly * reject unsupported command activities. + * * @param _context A context object for this turn. * @returns A promise that represents the work queued to execute. */ @@ -353,6 +373,7 @@ export class ActivityHandlerBase { * Invoked when a commandResult activity is received when the base behavior of * `onTurn()` is used. * CommandResult activity can be used to communicate the result of a command execution. + * * @param _context A context object for this turn. * @returns A promise that represents the work queued to execute. */ @@ -362,6 +383,7 @@ export class ActivityHandlerBase { /** * Called to initiate the event emission process. + * * @param context The context object for the current turn. * @remarks * Typically, you would provide this method as the function handler that the adapter calls diff --git a/libraries/botbuilder-core/src/adapterExtensions.ts b/libraries/botbuilder-core/src/adapterExtensions.ts index 107b4f4d7d..b4f6b86d4e 100644 --- a/libraries/botbuilder-core/src/adapterExtensions.ts +++ b/libraries/botbuilder-core/src/adapterExtensions.ts @@ -13,6 +13,7 @@ import { RegisterClassMiddleware } from './registerClassMiddleware'; /** * Adds middleware to the adapter to register one or more BotState objects on the turn context. * The middleware registers the state objects on the turn context at the start of each turn. + * * @param botAdapter The adapter on which to register the state objects. * @param botStates The state objects to register. * @returns The updated adapter. diff --git a/libraries/botbuilder-core/src/autoSaveStateMiddleware.ts b/libraries/botbuilder-core/src/autoSaveStateMiddleware.ts index d2db3ff180..f9992d069e 100644 --- a/libraries/botbuilder-core/src/autoSaveStateMiddleware.ts +++ b/libraries/botbuilder-core/src/autoSaveStateMiddleware.ts @@ -12,6 +12,7 @@ import { TurnContext } from './turnContext'; /** * Middleware that will automatically save any state changes at the end of the turn. + * * @remarks * The `AutoSaveStateMiddleware` class should be added towards the top of your bot's middleware * stack, before any other components that use state. Any `BotState` plugins passed to the @@ -49,6 +50,7 @@ export class AutoSaveStateMiddleware implements Middleware { botStateSet: BotStateSet; /** * Creates a new AutoSaveStateMiddleware instance. + * * @param botStates One or more BotState plugins to automatically save at the end of the turn. */ constructor(...botStates: BotState[]) { @@ -58,6 +60,7 @@ export class AutoSaveStateMiddleware implements Middleware { /** * Called by the adapter (for example, a `BotFrameworkAdapter`) at runtime in order to process an inbound [Activity](xref:botframework-schema.Activity). + * * @param context The context object for this turn. * @param next {function} The next delegate function. */ @@ -68,6 +71,7 @@ export class AutoSaveStateMiddleware implements Middleware { /** * Adds additional `BotState` plugins to be saved. + * * @param botStates One or more BotState plugins to add. * @returns The updated BotStateSet object. */ diff --git a/libraries/botbuilder-core/src/botAdapter.ts b/libraries/botbuilder-core/src/botAdapter.ts index e88a76f1ca..7f0ee0c6df 100644 --- a/libraries/botbuilder-core/src/botAdapter.ts +++ b/libraries/botbuilder-core/src/botAdapter.ts @@ -10,6 +10,7 @@ import { TurnContext } from './turnContext'; /** * Defines the core behavior of a bot adapter that can connect a bot to a service endpoint. + * * @remarks * The bot adapter encapsulates authentication processes and sends activities to and receives * activities from the Bot Connector Service. When your bot receives an activity, the adapter @@ -41,6 +42,7 @@ export abstract class BotAdapter { * This method supports the framework and is not intended to be called directly for your code. * Use the turn context's [sendActivity](xref:botbuilder-core.TurnContext.sendActivity) or * [sendActivities](xref:botbuilder-core.TurnContext.sendActivities) method from your bot code. + * * @param context The context object for the turn. * @param activities The activities to send. * @returns An array of [ResourceResponse](xref:) @@ -57,6 +59,7 @@ export abstract class BotAdapter { * This interface supports the framework and is not intended to be called directly for your code. * Use [TurnContext.updateActivity](xref:botbuilder-core.TurnContext.updateActivity) to update * an activity from your bot code. + * * @param context The context object for the turn. * @param activity The updated version of the activity to replace. * @remarks @@ -70,6 +73,7 @@ export abstract class BotAdapter { * This interface supports the framework and is not intended to be called directly for your code. * Use [TurnContext.deleteActivity](xref:botbuilder-core.TurnContext.deleteActivity) to delete * an activity from your bot code. + * * @param context The context object for the turn. * @param reference Conversation reference information for the activity to delete. * @remarks @@ -79,6 +83,7 @@ export abstract class BotAdapter { /** * Asynchronously resumes a conversation with a user, possibly after some time has gone by. + * * @param reference A reference to the conversation to continue. * @param logic The asynchronous method to call after the adapter middleware runs. * @remarks @@ -93,6 +98,7 @@ export abstract class BotAdapter { /** * Asynchronously resumes a conversation with a user, possibly after some time has gone by. + * * @param botAppId The application ID of the bot. This parameter is ignored in single tenant the Adapters (Console,Test, etc) but is critical to the BotFrameworkAdapter which is multi-tenant aware. * @param reference A partial [ConversationReference](xref:botframework-schema.ConversationReference) to the conversation to continue. * @param logic The asynchronous method to call after the adapter middleware runs. @@ -106,6 +112,7 @@ export abstract class BotAdapter { /** * Asynchronously resumes a conversation with a user, possibly after some time has gone by. + * * @param claimsIdentity A [ClaimsIdentity](xref:botframework-connector) for the conversation. * @param reference A partial [ConversationReference](xref:botframework-schema.ConversationReference) to the conversation to continue. * @param logic The asynchronous method to call after the adapter middleware runs. @@ -119,6 +126,7 @@ export abstract class BotAdapter { /** * Asynchronously resumes a conversation with a user, possibly after some time has gone by. + * * @param claimsIdentity A [ClaimsIdentity](xref:botframework-connector) for the conversation. * @param reference A partial [ConversationReference](xref:botframework-schema.ConversationReference) to the conversation to continue. * @param audience A value signifying the recipient of the proactive message. @@ -146,6 +154,7 @@ export abstract class BotAdapter { /** * Creates a conversation on the specified channel. + * * @param _botAppId The application ID of the bot. * @param _channelId The ID for the channel. * @param _serviceUrl The ID for the channel. @@ -177,6 +186,7 @@ export abstract class BotAdapter { /** * Gets or sets an error handler that can catch exceptions in the middleware or application. + * * @remarks * The error handler is called with these parameters: * @@ -192,6 +202,7 @@ export abstract class BotAdapter { /** * Sets an error handler that can catch exceptions in the middleware or application. + * * @remarks * The error handler is called with these parameters: * @@ -206,6 +217,7 @@ export abstract class BotAdapter { /** * Adds middleware to the adapter's pipeline. + * * @param {...any} middlewares The middleware or middleware handlers to add. * @returns The updated adapter object. * @remarks Middleware is added to the adapter at initialization time. @@ -219,6 +231,7 @@ export abstract class BotAdapter { /** * Starts activity processing for the current bot turn. + * * @param context The context object for the turn. * @param next A callback method to run at the end of the pipeline. * @returns A promise that resolves when the middleware chain is finished diff --git a/libraries/botbuilder-core/src/botState.ts b/libraries/botbuilder-core/src/botState.ts index 84cc56b069..6d78ed932d 100644 --- a/libraries/botbuilder-core/src/botState.ts +++ b/libraries/botbuilder-core/src/botState.ts @@ -27,6 +27,7 @@ export interface CachedBotState { /** * Base class for the frameworks state persistance scopes. + * * @remarks * This class will read and write state, to a provided storage provider, for each turn of * conversation with a user. Derived classes, like `ConversationState` and `UserState`, provide a @@ -40,6 +41,7 @@ export class BotState implements PropertyManager { /** * Creates a new BotState instance. + * * @param storage Storage provider to persist the state object to. * @param storageKey Function called anytime the storage key for a given turn needs to be calculated. */ @@ -51,6 +53,7 @@ export class BotState implements PropertyManager { /** * Creates a new property accessor for reading and writing an individual property to the bot * states storage object. + * * @template T The type of property to create. Defaults to `any` type. * @param name Name of the property to add. * @returns An accessor for the property. @@ -62,6 +65,7 @@ export class BotState implements PropertyManager { /** * Reads in and caches the backing state object for a turn. + * * @remarks * Subsequent reads will return the cached object unless the `force` flag is passed in which * will force the state object to be re-read. @@ -94,6 +98,7 @@ export class BotState implements PropertyManager { /** * Saves the cached state object if it's been changed. + * * @remarks * If the `force` flag is passed in the cached state object will be saved regardless of * whether its been changed or not and if no object has been cached, an empty object will be @@ -130,6 +135,7 @@ export class BotState implements PropertyManager { /** * Clears the current state object for a turn. + * * @remarks * The cleared state object will not be persisted until [saveChanges()](#savechanges) has * been called. @@ -150,6 +156,7 @@ export class BotState implements PropertyManager { /** * Delete the backing state object for the current turn. + * * @remarks * The state object will be removed from storage if it exists. If the state object has been * read in and cached, the cache will be cleared. @@ -170,6 +177,7 @@ export class BotState implements PropertyManager { /** * Returns a cached state object or undefined if not cached. + * * @remarks * This example shows how to synchronously get an already loaded and cached state object: * diff --git a/libraries/botbuilder-core/src/botStatePropertyAccessor.ts b/libraries/botbuilder-core/src/botStatePropertyAccessor.ts index 13f283c352..4e6cc1d3a6 100644 --- a/libraries/botbuilder-core/src/botStatePropertyAccessor.ts +++ b/libraries/botbuilder-core/src/botStatePropertyAccessor.ts @@ -11,6 +11,7 @@ import { TurnContext } from './turnContext'; /** * Defines methods for accessing a state property created in a * [BotState](xref:botbuilder-core.BotState) object. + * * @template T The type of the state property to access. Default type is `any`. * @remarks * To create a state property in a state management objet, use the @@ -19,6 +20,7 @@ import { TurnContext } from './turnContext'; export interface StatePropertyAccessor { /** * Deletes the persisted property from its backing storage object. + * * @remarks * The properties backing storage object SHOULD be loaded into memory on first access. * @@ -31,6 +33,7 @@ export interface StatePropertyAccessor { /** * Reads a persisted property from its backing storage object. + * * @remarks * The properties backing storage object SHOULD be loaded into memory on first access. * @@ -53,6 +56,7 @@ export interface StatePropertyAccessor { /** * Assigns a new value to the properties backing storage object. + * * @remarks * The properties backing storage object SHOULD be loaded into memory on first access. * @@ -70,6 +74,7 @@ export interface StatePropertyAccessor { /** * A `BotState` specific implementation of the `StatePropertyAccessor` interface. + * * @remarks * Properties can be defined for a given `BotState` instance using `createProperty()`. * @@ -82,16 +87,18 @@ export interface StatePropertyAccessor { export class BotStatePropertyAccessor implements StatePropertyAccessor { /** * Creates a new BotStatePropertyAccessor instance. + * * @param state Parent BotState instance. * @param name Unique name of the property for the parent BotState. */ constructor( protected readonly state: BotState, - public readonly name: string, + readonly name: string, ) {} /** * Deletes the persisted property from its backing storage object. + * * @param context [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. */ async delete(context: TurnContext): Promise { @@ -103,6 +110,7 @@ export class BotStatePropertyAccessor implements StatePropertyAccessor< /** * Reads a persisted property from its backing storage object. + * * @param context [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. * @returns A JSON representation of the cached state. */ @@ -110,6 +118,7 @@ export class BotStatePropertyAccessor implements StatePropertyAccessor< async get(context: TurnContext, defaultValue: T): Promise; /** * Reads a persisted property from its backing storage object. + * * @param context [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. * @param defaultValue Optional. Default value for the property. * @returns A JSON representation of the cached state. @@ -129,6 +138,7 @@ export class BotStatePropertyAccessor implements StatePropertyAccessor< /** * Assigns a new value to the properties backing storage object. + * * @param context [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. * @param value Value to set on the property. */ diff --git a/libraries/botbuilder-core/src/botStateSet.ts b/libraries/botbuilder-core/src/botStateSet.ts index 6b619990bb..1b73f9f7c8 100644 --- a/libraries/botbuilder-core/src/botStateSet.ts +++ b/libraries/botbuilder-core/src/botStateSet.ts @@ -20,6 +20,7 @@ export class BotStateSet { /** * Creates a new BotStateSet instance. + * * @param botStates One or more BotState plugins to register. */ constructor(...botStates: BotState[]) { @@ -28,6 +29,7 @@ export class BotStateSet { /** * Registers one or more `BotState` plugins with the set. + * * @param botStates One or more BotState plugins to register. * @returns The updated BotStateSet. */ @@ -45,6 +47,7 @@ export class BotStateSet { /** * Calls `BotState.load()` on all of the BotState plugins in the set. + * * @remarks * This will trigger all of the plugins to read in their state in parallel. * @@ -64,6 +67,7 @@ export class BotStateSet { /** * Calls `BotState.saveChanges()` on all of the BotState plugins in the set. + * * @remarks * This will trigger all of the plugins to write out their state in parallel. * diff --git a/libraries/botbuilder-core/src/botTelemetryClient.ts b/libraries/botbuilder-core/src/botTelemetryClient.ts index 9173b6da42..a715ae87d5 100644 --- a/libraries/botbuilder-core/src/botTelemetryClient.ts +++ b/libraries/botbuilder-core/src/botTelemetryClient.ts @@ -76,6 +76,7 @@ export interface TelemetryPageView { export class NullTelemetryClient implements BotTelemetryClient, BotPageViewTelemetryClient { /** * Creates a new instance of the [NullTelemetryClient](xref:botbuilder-core.NullTelemetryClient) class. + * * @param _settings Optional. Settings for the telemetry client. */ constructor(_settings?: any) { @@ -84,6 +85,7 @@ export class NullTelemetryClient implements BotTelemetryClient, BotPageViewTelem /** * Logs an Application Insights page view. + * * @param _telemetry An object implementing [TelemetryPageView](xref:botbuilder-core.TelemetryPageView). */ trackPageView(_telemetry: TelemetryPageView) { @@ -92,6 +94,7 @@ export class NullTelemetryClient implements BotTelemetryClient, BotPageViewTelem /** * Sends information about an external dependency (outgoing call) in the application. + * * @param _telemetry An object implementing [TelemetryDependency](xref:botbuilder-core.TelemetryDependency). */ trackDependency(_telemetry: TelemetryDependency) { @@ -100,6 +103,7 @@ export class NullTelemetryClient implements BotTelemetryClient, BotPageViewTelem /** * Logs custom events with extensible named fields. + * * @param _telemetry An object implementing [TelemetryEvent](xref:botbuilder-core.TelemetryEvent). */ trackEvent(_telemetry: TelemetryEvent) { @@ -108,6 +112,7 @@ export class NullTelemetryClient implements BotTelemetryClient, BotPageViewTelem /** * Logs a system exception. + * * @param _telemetry An object implementing [TelemetryException](xref:botbuilder-core.TelemetryException). */ trackException(_telemetry: TelemetryException) { @@ -116,6 +121,7 @@ export class NullTelemetryClient implements BotTelemetryClient, BotPageViewTelem /** * Sends a trace message. + * * @param _telemetry An object implementing [TelemetryTrace](xref:botbuilder-core.TelemetryTrace). */ trackTrace(_telemetry: TelemetryTrace) { @@ -133,6 +139,7 @@ export class NullTelemetryClient implements BotTelemetryClient, BotPageViewTelem /** * Logs a DialogView using the [trackPageView](xref:botbuilder-core.BotTelemetryClient.trackPageView) method on the [BotTelemetryClient](xref:botbuilder-core.BotTelemetryClient) if [BotPageViewTelemetryClient](xref:botbuilder-core.BotPageViewTelemetryClient) has been implemented. * Alternatively logs the information out via TrackTrace. + * * @param telemetryClient TelemetryClient that implements [BotTelemetryClient](xref:botbuilder-core.BotTelemetryClient). * @param dialogName Name of the dialog to log the entry / start for. * @param properties Named string values you can use to search and classify events. diff --git a/libraries/botbuilder-core/src/browserStorage.ts b/libraries/botbuilder-core/src/browserStorage.ts index 1551861df7..f958145aa3 100644 --- a/libraries/botbuilder-core/src/browserStorage.ts +++ b/libraries/botbuilder-core/src/browserStorage.ts @@ -9,6 +9,7 @@ import { MemoryStorage } from './memoryStorage'; /** * Storage provider that uses browser local storage. + * * @remarks * Anything written to the store will remain persisted until the user manually flushes their * browsers cookies and other site data. @@ -30,6 +31,7 @@ export class BrowserLocalStorage extends MemoryStorage { /** * Storage provider that uses browser session storage. + * * @remarks * Anything written to the store will only be persisted for the lifetime of a single page within a * browser tab. The storage will survive page reloads but closing the tab will delete anything diff --git a/libraries/botbuilder-core/src/cardFactory.ts b/libraries/botbuilder-core/src/cardFactory.ts index d58fbe685e..4b34bfbcee 100644 --- a/libraries/botbuilder-core/src/cardFactory.ts +++ b/libraries/botbuilder-core/src/cardFactory.ts @@ -23,6 +23,7 @@ import { /** * Provides methods for formatting the various card types a bot can return. + * * @remarks * All of these functions return an [Attachment](xref:botframework-schema.Attachment) object, * which can be added to an existing activity's [attachments](xref:botframework-schema.Activity.attachments) collection directly or @@ -61,6 +62,7 @@ export class CardFactory { /** * Returns an attachment for an Adaptive Card. + * * @param card A description of the Adaptive Card to return. * @returns An [Attachment](xref:botframework-schema.Attachment). * @remarks @@ -100,6 +102,7 @@ export class CardFactory { /** * Returns an attachment for an animation card. + * * @param title The card title. * @param media The media URLs for the card. * @param buttons Optional. The array of buttons to include on the card. Each `string` in the array @@ -118,6 +121,7 @@ export class CardFactory { /** * Returns an attachment for an audio card. + * * @param title The card title. * @param media The media URL for the card. * @param buttons Optional. The array of buttons to include on the card. Each `string` in the array @@ -136,6 +140,7 @@ export class CardFactory { /** * Returns an attachment for a hero card. + * * @param title The card title. * @param images Optional. The array of images to include on the card. Each element can be a * [CardImage](ref:botframework-schema.CardImage) or the URL of the image to include. @@ -164,6 +169,7 @@ export class CardFactory { ): Attachment; /** * Returns an attachment for a hero card. + * * @param title The card title. * @param text The card text. * @param images Optional. The array of images to include on the card. Each element can be a @@ -193,6 +199,7 @@ export class CardFactory { ): Attachment; /** * Returns an attachment for a hero card. + * * @param title The card title. * @param text Optional. The card text. * @param images Optional. The array of images to include on the card. Each element can be a @@ -221,6 +228,7 @@ export class CardFactory { /** * Returns an attachment for an OAuth card. + * * @param connectionName The name of the OAuth connection to use. * @param title The title for the card's sign-in button. * @param text Optional. Additional text to include on the card. @@ -253,6 +261,7 @@ export class CardFactory { /** * Returns an attachment for an Office 365 connector card. + * * @param card a description of the Office 365 connector card to return. * @returns An [Attachment](xref:botframework-schema.Attachment). * @remarks @@ -279,6 +288,7 @@ export class CardFactory { /** * Returns an attachment for a receipt card. + * * @param card A description of the receipt card to return. * @returns An [Attachment](xref:botframework-schema.Attachment). */ @@ -288,6 +298,7 @@ export class CardFactory { /** * Returns an attachment for a sign-in card. + * * @param title The title for the card's sign-in button. * @param url The URL of the sign-in page to use. * @param text Optional. Additional text to include on the card. @@ -308,6 +319,7 @@ export class CardFactory { /** * Returns an attachment for a thumbnail card. + * * @param title The card title. * @param images Optional. The array of images to include on the card. Each element can be a * [CardImage](ref:botframework-schema.CardImage) or the URL of the image to include. @@ -329,6 +341,7 @@ export class CardFactory { ): Attachment; /** * Returns an attachment for a thumbnail card. + * * @param title The card title. * @param text The card text. * @param images Optional. The array of images to include on the card. Each element can be a @@ -352,6 +365,7 @@ export class CardFactory { ): Attachment; /** * Returns an attachment for a thumbnail card. + * * @param title The card title. * @param text Optional. The card text. * @param images Optional. The array of images to include on the card. Each element can be a @@ -398,6 +412,7 @@ export class CardFactory { /** * Returns an attachment for a video card. + * * @param title The card title. * @param media The media URLs for the card. * @param buttons Optional. The array of buttons to include on the card. Each `string` in the array @@ -416,6 +431,7 @@ export class CardFactory { /** * Returns a properly formatted array of actions. + * * @param actions The array of action to include on the card. Each `string` in the array * is converted to an `imBack` button with a title and value set to the value of the string. * @returns A properly formatted array of actions. @@ -440,6 +456,7 @@ export class CardFactory { /** * Returns a properly formatted array of card images. + * * @param images The array of images to include on the card. Each element can be a * [CardImage](ref:botframework-schema.CardImage) or the URL of the image to include. * @returns A properly formatted array of card images. @@ -459,6 +476,7 @@ export class CardFactory { /** * Returns a properly formatted array of media URL objects. + * * @param links The media URLs. Each `string` is converted to a media URL object. * @returns A properly formatted array of media URL objects. */ diff --git a/libraries/botbuilder-core/src/cloudAdapterBase.ts b/libraries/botbuilder-core/src/cloudAdapterBase.ts index e329aa6329..4c5e97812a 100644 --- a/libraries/botbuilder-core/src/cloudAdapterBase.ts +++ b/libraries/botbuilder-core/src/cloudAdapterBase.ts @@ -40,6 +40,7 @@ export abstract class CloudAdapterBase extends BotAdapter { /** * Create a new [CloudAdapterBase](xref:botbuilder.CloudAdapterBase) instance. + * * @param botFrameworkAuthentication A [BotFrameworkAuthentication](xref:botframework-connector.BotFrameworkAuthentication) used for validating and creating tokens. */ constructor(protected readonly botFrameworkAuthentication: BotFrameworkAuthentication) { @@ -274,6 +275,7 @@ export abstract class CloudAdapterBase extends BotAdapter { /** * The implementation for continue conversation. + * * @param claimsIdentity The [ClaimsIdentity](xref:botframework-connector.ClaimsIdentity) for the conversation. * @param continuationActivity The continuation [Activity](xref:botframework-schema.Activity) used to create the [TurnContext](xref:botbuilder-core.TurnContext). * @param audience The audience for the call. @@ -312,6 +314,7 @@ export abstract class CloudAdapterBase extends BotAdapter { /** * The implementation for processing an Activity sent to this bot. + * * @param authHeader The authorization header from the http request. * @param activity The [Activity](xref:botframework-schema.Activity) to process. * @param logic The function to call for the resulting bot turn. @@ -325,6 +328,7 @@ export abstract class CloudAdapterBase extends BotAdapter { /** * The implementation for processing an Activity sent to this bot. + * * @param authenticateRequestResult The [AuthenticateRequestResult](xref:botframework-connector.AuthenticateRequestResult) for this turn. * @param activity The [Activity](xref:botframework-schema.Activity) to process. * @param logic The function to call for the resulting bot turn. @@ -392,6 +396,7 @@ export abstract class CloudAdapterBase extends BotAdapter { /** * This is a helper to create the ClaimsIdentity structure from an appId that will be added to the TurnContext. * It is intended for use in proactive and named-pipe scenarios. + * * @param botAppId The bot's application id. * @returns a [ClaimsIdentity](xref:botframework-connector.ClaimsIdentity) with the audience and appId claims set to the botAppId. */ diff --git a/libraries/botbuilder-core/src/componentRegistration.ts b/libraries/botbuilder-core/src/componentRegistration.ts index 53a5d149fc..7dee887bdd 100644 --- a/libraries/botbuilder-core/src/componentRegistration.ts +++ b/libraries/botbuilder-core/src/componentRegistration.ts @@ -14,6 +14,7 @@ export class ComponentRegistration { /** * Gets list of all ComponentRegistration objects registered. + * * @returns A list of ComponentRegistration objects. */ static get components(): ComponentRegistration[] { @@ -22,6 +23,7 @@ export class ComponentRegistration { /** * Add a component, only one instance per type is allowed for components. + * * @param componentRegistration The component to be registered. */ static add(componentRegistration: ComponentRegistration): void { diff --git a/libraries/botbuilder-core/src/configurationBotFrameworkAuthentication.ts b/libraries/botbuilder-core/src/configurationBotFrameworkAuthentication.ts index 7db1829465..f6053ff236 100644 --- a/libraries/botbuilder-core/src/configurationBotFrameworkAuthentication.ts +++ b/libraries/botbuilder-core/src/configurationBotFrameworkAuthentication.ts @@ -49,6 +49,7 @@ const TypedOptions = z /** * A string used to indicate if which cloud the bot is operating in (e.g. Public Azure or US Government). + * * @remarks * A `null` or `''` value indicates Public Azure, whereas [GovernmentConstants.ChannelService](xref:botframework-connector.GovernmentConstants.ChannelService) indicates the bot is operating in the US Government cloud. * @@ -68,6 +69,7 @@ const TypedOptions = z /** * The Oauth scope to request. + * * @remarks * This value is used when fetching a token to indicate the ultimate recipient or `audience` of an activity sent using these credentials. */ @@ -123,6 +125,7 @@ export class ConfigurationBotFrameworkAuthentication extends BotFrameworkAuthent /** * Initializes a new instance of the [ConfigurationBotFrameworkAuthentication](xref:botbuilder-core.ConfigurationBotFrameworkAuthentication) class. + * * @param botFrameworkAuthConfig A [ConfigurationBotFrameworkAuthenticationOptions](xref:botbuilder-core.ConfigurationBotFrameworkAuthenticationOptions) object. * @param credentialsFactory A [ServiceClientCredentialsFactory](xref:botframework-connector.ServiceClientCredentialsFactory) instance. * @param authConfiguration A [Configuration](xref:botframework-connector.AuthenticationConfiguration) object. @@ -191,6 +194,7 @@ export class ConfigurationBotFrameworkAuthentication extends BotFrameworkAuthent /** * Authenticate Bot Framework Protocol requests to Skills. + * * @param authHeader The http auth header received in the skill request. * @returns {Promise} A [ClaimsIdentity](xref:botframework-connector.ClaimsIdentity). */ @@ -200,6 +204,7 @@ export class ConfigurationBotFrameworkAuthentication extends BotFrameworkAuthent /** * Validate Bot Framework Protocol requests. + * * @param activity The inbound Activity. * @param authHeader The HTTP auth header. * @returns {Promise} An [AuthenticateRequestResult](xref:botframework-connector.AuthenticateRequestResult). @@ -210,6 +215,7 @@ export class ConfigurationBotFrameworkAuthentication extends BotFrameworkAuthent /** * Validate Bot Framework Protocol requests. + * * @param authHeader The HTTP auth header. * @param channelIdHeader The channel ID HTTP header. * @returns {Promise} An [AuthenticateRequestResult](xref:botframework-connector.AuthenticateRequestResult). @@ -220,6 +226,7 @@ export class ConfigurationBotFrameworkAuthentication extends BotFrameworkAuthent /** * Creates a BotFrameworkClient for calling Skills. + * * @returns A [BotFrameworkClient](xref:botframework-connector.BotFrameworkClient). */ createBotFrameworkClient(): BotFrameworkClient { @@ -228,6 +235,7 @@ export class ConfigurationBotFrameworkAuthentication extends BotFrameworkAuthent /** * Creates a ConnectorFactory that can be used to create ConnectorClients that can use credentials from this particular Cloud Environment. + * * @param claimsIdentity The inbound Activity's ClaimsIdentity. * @returns A [ConnectorFactory](xref:botframework-connector.ConnectorFactory). */ @@ -237,6 +245,7 @@ export class ConfigurationBotFrameworkAuthentication extends BotFrameworkAuthent /** * Creates the appropriate UserTokenClient instance. + * * @param claimsIdentity The inbound Activity's ClaimsIdentity. * @returns {Promise} An [UserTokenClient](xref:botframework-connector.UserTokenClient). */ @@ -247,6 +256,7 @@ export class ConfigurationBotFrameworkAuthentication extends BotFrameworkAuthent /** * Creates a new instance of the [ConfigurationBotFrameworkAuthentication](xref:botbuilder-core.ConfigurationBotFrameworkAuthentication) class. + * * @remarks * The [Configuration](xref:botbuilder-dialogs-adaptive-runtime-core.Configuration) instance provided to the constructor should * have the desired authentication values available at the root, using the properties of [ConfigurationBotFrameworkAuthenticationOptions](xref:botbuilder-core.ConfigurationBotFrameworkAuthenticationOptions) as its keys. diff --git a/libraries/botbuilder-core/src/configurationServiceClientCredentialFactory.ts b/libraries/botbuilder-core/src/configurationServiceClientCredentialFactory.ts index d226636854..edee37fa16 100644 --- a/libraries/botbuilder-core/src/configurationServiceClientCredentialFactory.ts +++ b/libraries/botbuilder-core/src/configurationServiceClientCredentialFactory.ts @@ -65,6 +65,7 @@ export class ConfigurationServiceClientCredentialFactory extends PasswordService /** * Initializes a new instance of the [ConfigurationServiceClientCredentialFactory](xref:botbuilder-core.ConfigurationServiceClientCredentialFactory) class. + * * @param factoryOptions A [ConfigurationServiceClientCredentialFactoryOptions](xref:botbuilder-core.ConfigurationServiceClientCredentialFactoryOptions) object. */ constructor(factoryOptions: ConfigurationServiceClientCredentialFactoryOptions = {}) { @@ -176,6 +177,7 @@ export class ConfigurationServiceClientCredentialFactory extends PasswordService /** * Creates a new instance of the [ConfigurationServiceClientCredentialFactory](xref:botbuilder-core.ConfigurationServiceClientCredentialFactory) class. + * * @remarks * The [Configuration](xref:botbuilder-dialogs-adaptive-runtime-core.Configuration) instance provided to the constructor should * have the desired authentication values available at the root, using the properties of [ConfigurationServiceClientCredentialFactoryOptions](xref:botbuilder-core.ConfigurationServiceClientCredentialFactoryOptions) as its keys. diff --git a/libraries/botbuilder-core/src/conversationState.ts b/libraries/botbuilder-core/src/conversationState.ts index c2baa5f5f0..8e16efb212 100644 --- a/libraries/botbuilder-core/src/conversationState.ts +++ b/libraries/botbuilder-core/src/conversationState.ts @@ -14,6 +14,7 @@ const NO_KEY = 'ConversationState: overridden getStorageKey method did not retur /** * Reads and writes conversation state for your bot to storage. + * * @remarks * Each conversation your bot has with a user or group will have its own isolated storage object * that can be used to persist conversation tracking information between turns of the conversation. @@ -28,6 +29,7 @@ const NO_KEY = 'ConversationState: overridden getStorageKey method did not retur export class ConversationState extends BotState { /** * Creates a new ConversationState instance. + * * @param storage Storage provider to persist conversation state to. * @param namespace (Optional) namespace to append to storage keys. Defaults to an empty string. */ @@ -45,6 +47,7 @@ export class ConversationState extends BotState { /** * Returns the storage key for the current conversation state. + * * @param context Context for current turn of conversation with the user. * @returns The storage key for the current conversation state. */ diff --git a/libraries/botbuilder-core/src/coreAppCredentials.ts b/libraries/botbuilder-core/src/coreAppCredentials.ts index a91ec899a7..8d7d63c46f 100644 --- a/libraries/botbuilder-core/src/coreAppCredentials.ts +++ b/libraries/botbuilder-core/src/coreAppCredentials.ts @@ -18,12 +18,14 @@ interface CoreWebResource { /** * CoreAppCredentials + * * @remarks * Runtime-agnostic interface representing "ServiceClientCredentials" from @azure/ms-rest-js */ export interface CoreAppCredentials { /** * Signs a request with the Authentication header. + * * @param {CoreWebResource} webResource The CoreWebResource/request to be signed. * @returns {Promise} The signed request object; */ diff --git a/libraries/botbuilder-core/src/extendedUserTokenProvider.ts b/libraries/botbuilder-core/src/extendedUserTokenProvider.ts index 2d2a180212..f1b0c19181 100644 --- a/libraries/botbuilder-core/src/extendedUserTokenProvider.ts +++ b/libraries/botbuilder-core/src/extendedUserTokenProvider.ts @@ -13,11 +13,13 @@ import { SignInUrlResponse, TokenResponse, TokenExchangeRequest } from 'botframe /** * Interface for User Token OAuth Single Sign On and Token Exchange APIs for BotAdapters + * * @deprecated Use `UserTokenClient` instead. */ export interface ExtendedUserTokenProvider extends IUserTokenProvider { /** * Retrieves the OAuth token for a user that is in a sign-in flow. + * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param magicCode (Optional) Optional user entered code to validate. @@ -31,6 +33,7 @@ export interface ExtendedUserTokenProvider extends IUserTokenProvider { /** * Signs the user out with the token server. + * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param userId User id of user to sign out. @@ -45,6 +48,7 @@ export interface ExtendedUserTokenProvider extends IUserTokenProvider { /** * Gets a signin link from the token server that can be sent as part of a SigninCard. + * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param appCredentials AppCredentials for OAuth. @@ -53,6 +57,7 @@ export interface ExtendedUserTokenProvider extends IUserTokenProvider { /** * Signs the user out with the token server. + * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param resourceUrls Array with the resource Urls. @@ -69,6 +74,7 @@ export interface ExtendedUserTokenProvider extends IUserTokenProvider { /** * Get the raw signin resource to be sent to the user for signin for a connection name. + * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. */ @@ -76,6 +82,7 @@ export interface ExtendedUserTokenProvider extends IUserTokenProvider { /** * Get the raw signin resource to be sent to the user for signin for a connection name. + * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param userId The user id that will be associated with the token. @@ -90,6 +97,7 @@ export interface ExtendedUserTokenProvider extends IUserTokenProvider { /** * Get the raw signin resource to be sent to the user for signin for a connection name. + * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param userId The user id that will be associated with the token. @@ -105,6 +113,7 @@ export interface ExtendedUserTokenProvider extends IUserTokenProvider { /** * Performs a token exchange operation such as for single sign-on. + * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param userId The user id that will be associated with the token. @@ -119,6 +128,7 @@ export interface ExtendedUserTokenProvider extends IUserTokenProvider { /** * Performs a token exchange operation such as for single sign-on. + * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param userId The user id that will be associated with the token. diff --git a/libraries/botbuilder-core/src/invokeException.ts b/libraries/botbuilder-core/src/invokeException.ts index 3ad951735c..593ccde39d 100644 --- a/libraries/botbuilder-core/src/invokeException.ts +++ b/libraries/botbuilder-core/src/invokeException.ts @@ -23,6 +23,7 @@ export class InvokeException extends Error { /** * A factory method that creates a new [InvokeResponse](xref:botbuilder-core.InvokeResponse) object with the status code and body of the current object. + * * @returns A new [InvokeResponse](xref:botbuilder-core.InvokeResponse) object. */ createInvokeResponse(): InvokeResponse { diff --git a/libraries/botbuilder-core/src/memoryStorage.ts b/libraries/botbuilder-core/src/memoryStorage.ts index 98bac9cb77..778f5fc398 100644 --- a/libraries/botbuilder-core/src/memoryStorage.ts +++ b/libraries/botbuilder-core/src/memoryStorage.ts @@ -9,6 +9,7 @@ import { Storage, StoreItems } from './storage'; /** * Memory based storage provider for a bot. + * * @remarks * This provider is most useful for simulating production storage when running locally against the * emulator or as part of a unit test. It has the following characteristics: @@ -30,6 +31,7 @@ export class MemoryStorage implements Storage { protected etag: number; /** * Creates a new MemoryStorage instance. + * * @param memory (Optional) memory to use for storing items. By default it will create an empty JSON object `{}`. */ constructor(protected memory: { [k: string]: string } = {}) { @@ -38,6 +40,7 @@ export class MemoryStorage implements Storage { /** * Reads storage items from storage. + * * @param keys Keys of the [StoreItems](xref:botbuilder-core.StoreItems) objects to read. * @returns The read items. */ @@ -59,6 +62,7 @@ export class MemoryStorage implements Storage { /** * Writes storage items to storage. + * * @param changes The [StoreItems](xref:botbuilder-core.StoreItems) to write, indexed by key. * @returns {Promise} A promise representing the async operation. */ @@ -93,6 +97,7 @@ export class MemoryStorage implements Storage { /** * Deletes storage items from storage. + * * @param keys Keys of the [StoreItems](xref:botbuilder-core.StoreItems) objects to delete. * @returns {Promise} A promise representing the async operation. */ diff --git a/libraries/botbuilder-core/src/memoryTranscriptStore.ts b/libraries/botbuilder-core/src/memoryTranscriptStore.ts index fe22de5000..5d6c4cc7f1 100644 --- a/libraries/botbuilder-core/src/memoryTranscriptStore.ts +++ b/libraries/botbuilder-core/src/memoryTranscriptStore.ts @@ -11,6 +11,7 @@ import { PagedResult, TranscriptInfo, TranscriptStore } from './transcriptLogger /** * The memory transcript store stores transcripts in volatile memory in a Map. + * * @remarks * Because this uses an unbounded volatile dictionary this should only be used for unit tests or * non-production environments. @@ -22,6 +23,7 @@ export class MemoryTranscriptStore implements TranscriptStore { /** * Log an activity to the transcript. + * * @param activity Activity to log. * @returns {Promise} A promise representing the async operation. */ @@ -55,6 +57,7 @@ export class MemoryTranscriptStore implements TranscriptStore { /** * Get activities from the memory transcript store. + * * @param channelId Channel Id. * @param conversationId Conversation Id. * @param continuationToken Continuation token to page through results. @@ -104,6 +107,7 @@ export class MemoryTranscriptStore implements TranscriptStore { /** * List conversations in the channelId. + * * @param channelId Channel Id. * @param continuationToken Continuation token to page through results. * @returns {Promise>} A page of conversations for a channel from the store. @@ -148,6 +152,7 @@ export class MemoryTranscriptStore implements TranscriptStore { /** * Delete a specific conversation and all of it's activities. + * * @param channelId Channel Id where conversation took place. * @param conversationId Id of the conversation to delete. * @returns {Promise} A promise representing the async operation. diff --git a/libraries/botbuilder-core/src/messageFactory.ts b/libraries/botbuilder-core/src/messageFactory.ts index 75bf419b95..34ecac4557 100644 --- a/libraries/botbuilder-core/src/messageFactory.ts +++ b/libraries/botbuilder-core/src/messageFactory.ts @@ -19,6 +19,7 @@ import { CardFactory } from './cardFactory'; /** * A set of utility functions to assist with the formatting of the various message types a bot can * return. + * * @remarks * The following example shows sending a message containing a single hero card: * @@ -37,6 +38,7 @@ import { CardFactory } from './cardFactory'; export class MessageFactory { /** * Returns a simple text message. + * * @remarks * This example shows sending a simple text message: * @@ -63,6 +65,7 @@ export class MessageFactory { /** * Returns a message that includes a set of suggested actions and optional text. + * * @remarks * This example shows creating a message with suggested actions: * @@ -100,6 +103,7 @@ export class MessageFactory { /** * Returns a single message activity containing an attachment. + * * @remarks * This example shows creating a message with a hero card attachment: * @@ -129,6 +133,7 @@ export class MessageFactory { /** * Returns a message that will display a set of attachments in list form. + * * @remarks * This example shows creating a message with a list of hero cards: * @@ -156,6 +161,7 @@ export class MessageFactory { /** * Returns a message that will display a set of attachments using a carousel layout. + * * @remarks * This example shows creating a message with a carousel of hero cards: * @@ -183,6 +189,7 @@ export class MessageFactory { /** * Returns a message that will display a single image or video to a user. + * * @remarks * This example shows sending an image to the user: * diff --git a/libraries/botbuilder-core/src/middlewareSet.ts b/libraries/botbuilder-core/src/middlewareSet.ts index 9e98ac77b1..9e1536a318 100644 --- a/libraries/botbuilder-core/src/middlewareSet.ts +++ b/libraries/botbuilder-core/src/middlewareSet.ts @@ -13,6 +13,7 @@ import { TurnContext } from './turnContext'; export interface Middleware { /** * Called each time the bot receives a new request. + * * @remarks * Calling `await next();` will cause execution to continue to either the next piece of * middleware in the chain or the bots main logic if you are the last piece of middleware. @@ -48,6 +49,7 @@ export type MiddlewareHandler = (context: TurnContext, next: () => Promise /** * A set of `Middleware` plugins. + * * @remarks * The set itself is middleware so you can easily package up a set of middleware that can be composed * into an adapter with a single `adapter.use(mySet)` call or even into another middleware set using @@ -69,6 +71,7 @@ export class MiddlewareSet implements Middleware { /** * Creates a new MiddlewareSet instance. + * * @param {...any} middlewares One or more middleware handlers(s) to register. */ constructor(...middlewares: (MiddlewareHandler | Middleware)[]) { @@ -77,6 +80,7 @@ export class MiddlewareSet implements Middleware { /** * Processes an incoming activity. + * * @param context [TurnContext](xref:botbuilder-core.TurnContext) object for this turn. * @param next Delegate to call to continue the bot middleware pipeline. * @returns {Promise} A Promise representing the async operation. @@ -87,6 +91,7 @@ export class MiddlewareSet implements Middleware { /** * Registers middleware handlers(s) with the set. + * * @remarks This example adds a new piece of middleware to a set: * ```JavaScript * set.use(async (context, next) => { @@ -114,6 +119,7 @@ export class MiddlewareSet implements Middleware { /** * Executes a set of middleware in series. + * * @param context Context for the current turn of conversation with the user. * @param next Function to invoke at the end of the middleware chain. * @returns A promise that resolves after the handler chain is complete. diff --git a/libraries/botbuilder-core/src/privateConversationState.ts b/libraries/botbuilder-core/src/privateConversationState.ts index 1419e96a80..8347c8231a 100644 --- a/libraries/botbuilder-core/src/privateConversationState.ts +++ b/libraries/botbuilder-core/src/privateConversationState.ts @@ -14,6 +14,7 @@ const NO_KEY = 'PrivateConversationState: overridden getStorageKey method did no /** * Reads and writes PrivateConversation state for your bot to storage. + * * @remarks * Each PrivateConversation your bot has with a user or group will have its own isolated storage object * that can be used to persist PrivateConversation tracking information between turns of the PrivateConversation. @@ -28,6 +29,7 @@ const NO_KEY = 'PrivateConversationState: overridden getStorageKey method did no export class PrivateConversationState extends BotState { /** * Creates a new PrivateConversationState instance. + * * @param storage Storage provider to persist PrivateConversation state to. * @param namespace (Optional) namespace to append to storage keys. Defaults to an empty string. */ @@ -45,6 +47,7 @@ export class PrivateConversationState extends BotState { /** * Returns the storage key for the current PrivateConversation state. + * * @param context Context for current turn of PrivateConversation with the user. * @returns The storage key for the current PrivateConversation state. */ diff --git a/libraries/botbuilder-core/src/propertyManager.ts b/libraries/botbuilder-core/src/propertyManager.ts index 21074d0caa..22c3f2118a 100644 --- a/libraries/botbuilder-core/src/propertyManager.ts +++ b/libraries/botbuilder-core/src/propertyManager.ts @@ -14,6 +14,7 @@ export interface PropertyManager { /** * Creates a new property accessor for reading and writing an individual property to the bots * state management system. + * * @template T (Optional) type of property to create. Defaults to `any` type. * @param name Name of the property being created. */ diff --git a/libraries/botbuilder-core/src/queueStorage.ts b/libraries/botbuilder-core/src/queueStorage.ts index 51a60b348a..45457dfdc6 100644 --- a/libraries/botbuilder-core/src/queueStorage.ts +++ b/libraries/botbuilder-core/src/queueStorage.ts @@ -15,6 +15,7 @@ export abstract class QueueStorage { /** * Enqueues an Activity for later processing. The visibility timeout specifies how long the message should be visible * to Dequeue and Peek operations. + * * @param {Partial} activity The [Activity](xref:botframework-schema.Activity) to be queued for later processing. * @param {number} visibilityTimeout Visibility timeout in seconds. Optional with a default value of 0. Cannot be larger than 7 days. * @param {number} timeToLive Specifies the time-to-live interval for the message in seconds. diff --git a/libraries/botbuilder-core/src/recognizerResult.ts b/libraries/botbuilder-core/src/recognizerResult.ts index cbdc43c856..a54aee7066 100644 --- a/libraries/botbuilder-core/src/recognizerResult.ts +++ b/libraries/botbuilder-core/src/recognizerResult.ts @@ -24,6 +24,7 @@ export interface RecognizerResult { /** * Intents recognized for the utterance. + * * @remarks * A map of intent names to an object with score is returned. */ diff --git a/libraries/botbuilder-core/src/registerClassMiddleware.ts b/libraries/botbuilder-core/src/registerClassMiddleware.ts index 2e6eea3324..ccc76b7a6d 100644 --- a/libraries/botbuilder-core/src/registerClassMiddleware.ts +++ b/libraries/botbuilder-core/src/registerClassMiddleware.ts @@ -17,6 +17,7 @@ export class RegisterClassMiddleware implements Middleware { /** * Initialize a new instance of the RegisterClassMiddleware class. + * * @param service The object or service to add. * @param key The key for service object in turn state. */ @@ -32,6 +33,7 @@ export class RegisterClassMiddleware implements Middleware { /** * Adds the associated object or service to the current turn context. + * * @param turnContext The context object for this turn. * @param next The delegate to call to continue the bot middleware pipeline. */ diff --git a/libraries/botbuilder-core/src/showTypingMiddleware.ts b/libraries/botbuilder-core/src/showTypingMiddleware.ts index 35328f58e5..447bb0593b 100644 --- a/libraries/botbuilder-core/src/showTypingMiddleware.ts +++ b/libraries/botbuilder-core/src/showTypingMiddleware.ts @@ -12,6 +12,7 @@ import { TurnContext } from './turnContext'; /** * Middleware that will send a typing indicator automatically for each message. + * * @remarks * When added, this middleware will send typing activities back to the user when a Message activity * is received to let them know that the bot has received the message and is working on the response. @@ -22,6 +23,7 @@ import { TurnContext } from './turnContext'; export class ShowTypingMiddleware implements Middleware { /** * Create the SendTypingIndicator middleware + * * @param delay {number} Number of milliseconds to wait before sending the first typing indicator. * @param period {number} Number of milliseconds to wait before sending each following indicator. */ @@ -40,6 +42,7 @@ export class ShowTypingMiddleware implements Middleware { /** * Processes an incoming activity. + * * @param context {TurnContext} An incoming TurnContext object. * @param next {function} The next delegate function. */ diff --git a/libraries/botbuilder-core/src/skills/skillConversationIdFactory.ts b/libraries/botbuilder-core/src/skills/skillConversationIdFactory.ts index 2e2494c2cd..8b78b47baa 100644 --- a/libraries/botbuilder-core/src/skills/skillConversationIdFactory.ts +++ b/libraries/botbuilder-core/src/skills/skillConversationIdFactory.ts @@ -15,6 +15,7 @@ import { v4 as uuid } from 'uuid'; export class SkillConversationIdFactory extends SkillConversationIdFactoryBase { /** * Creates a new instance of the SkillConversationIdFactory class. + * * @param storage The storage for the [ConversationReference](xref:botframework-schema:ConversationReference) instances. */ constructor(private readonly storage: Storage) { @@ -23,6 +24,7 @@ export class SkillConversationIdFactory extends SkillConversationIdFactoryBase { /** * Creates a conversation ID for a skill conversation based on the caller's [ConversationReference](xref:botframework-schema:ConversationReference). + * * @param options The [SkillConversationIdFactoryOptions](xref:botbuilder-core.SkillConversationIdFactoryOptions) to use. * @returns {Promise} A unique conversation ID used to communicate with the skill. */ @@ -43,6 +45,7 @@ export class SkillConversationIdFactory extends SkillConversationIdFactoryBase { /** * Gets the ConversationReference created using createSkillConversationId() for a skillConversationId. + * * @param skillConversationId A skill conversationId created using createSkillConversationId(). * @returns {Promise} The caller's ConversationReference for a skillConversationId. Null if not found. */ @@ -62,6 +65,7 @@ export class SkillConversationIdFactory extends SkillConversationIdFactoryBase { /** * Deletes the [SkillConversationReference](xref:botbuilder-core.SkillConversationReference) from the storage. + * * @param skillConversationId The skill conversation id to use as key for the delete. * @returns {Promise} A promise representing the asynchronous operation. */ diff --git a/libraries/botbuilder-core/src/skills/skillConversationIdFactoryBase.ts b/libraries/botbuilder-core/src/skills/skillConversationIdFactoryBase.ts index eb6b892df3..3f3c6bcbba 100644 --- a/libraries/botbuilder-core/src/skills/skillConversationIdFactoryBase.ts +++ b/libraries/botbuilder-core/src/skills/skillConversationIdFactoryBase.ts @@ -16,6 +16,7 @@ import { SkillConversationReference } from './skillConversationReference'; export abstract class SkillConversationIdFactoryBase { /** * Creates a conversation ID for a skill conversation based on the caller's ConversationReference. + * * @param _options The [SkillConversationIdFactoryOptions](xref:botbuilder-core.SkillConversationIdFactoryOptions) to use. * @remarks It should be possible to use the returned string on a request URL and it should not contain special characters. * Returns A unique conversation ID used to communicate with the skill. @@ -26,6 +27,7 @@ export abstract class SkillConversationIdFactoryBase { /** * Creates a conversation ID for a skill conversation based on the caller's ConversationReference. + * * @deprecated Method is deprecated, please use createSkillConversationIdWithOptions() with SkillConversationIdFactoryOptions instead. * @param _conversationReference The skill's caller ConversationReference. * @remarks It should be possible to use the returned string on a request URL and it should not contain special characters. @@ -37,6 +39,7 @@ export abstract class SkillConversationIdFactoryBase { /** * Gets the ConversationReference created using createSkillConversationId() for a skillConversationId. + * * @deprecated Method is deprecated, please use getSkillConversationReference() instead. * @param _skillConversationId A skill conversationId created using createSkillConversationId(). * @remarks Returns The caller's ConversationReference for a skillConversationId. null if not found. @@ -47,6 +50,7 @@ export abstract class SkillConversationIdFactoryBase { /** * Gets the SkillConversationReference created using createSkillConversationId() for a skillConversationId. + * * @param _skillConversationId Gets the SkillConversationReference used during createSkillConversationId for a skillConversationId. */ getSkillConversationReference(_skillConversationId: string): Promise { @@ -55,6 +59,7 @@ export abstract class SkillConversationIdFactoryBase { /** * Deletes a ConversationReference. + * * @param skillConversationId A skill conversationId created using createSkillConversationId(). */ abstract deleteConversationReference(skillConversationId: string): Promise; diff --git a/libraries/botbuilder-core/src/skypeMentionNormalizeMiddleware.ts b/libraries/botbuilder-core/src/skypeMentionNormalizeMiddleware.ts index a70d56eaf1..4b5aae6914 100644 --- a/libraries/botbuilder-core/src/skypeMentionNormalizeMiddleware.ts +++ b/libraries/botbuilder-core/src/skypeMentionNormalizeMiddleware.ts @@ -12,6 +12,7 @@ import { TurnContext } from './turnContext'; /** * Middleware to patch mention Entities from Skype since they don't conform to expected values. * Bots that interact with Skype should use this middleware if mentions are used. + * * @remarks * A Skype mention "text" field is of the format: * botname @@ -22,6 +23,7 @@ import { TurnContext } from './turnContext'; export class SkypeMentionNormalizeMiddleware implements Middleware { /** * Performs the normalization of Skype mention Entities. + * * @param activity [Activity](xref:botframework-schema.Activity) containing the mentions to normalize. */ static normalizeSkypeMentionText(activity: Activity): void { @@ -41,6 +43,7 @@ export class SkypeMentionNormalizeMiddleware implements Middleware { /** * Middleware implementation which corrects the Entity text of type [Mention](xref:botframework-schema.Mention) to a value that [removeMentionText](xref:botbuilder-core.TurnContext.removeMentionText) can work with. + * * @param turnContext [TurnContext](xref:botbuilder-core.TurnContext) for the current turn of conversation. * @param next Delegate to call to continue the bot middleware pipeline. */ diff --git a/libraries/botbuilder-core/src/storage.ts b/libraries/botbuilder-core/src/storage.ts index e11b25f1cf..f799946b05 100644 --- a/libraries/botbuilder-core/src/storage.ts +++ b/libraries/botbuilder-core/src/storage.ts @@ -17,6 +17,7 @@ import { TurnContext } from './turnContext'; * ```TypeScript * type StorageKeyFactory = (context: TurnContext) => Promise; * ``` + * * @param StorageKeyFactory.context Context for the current turn of conversation with a user. * @returns A promise resolving to the storage key string */ @@ -28,6 +29,7 @@ export type StorageKeyFactory = (context: TurnContext) => Promise; export interface Storage { /** * Loads store items from storage + * * @remarks * This example reads in a single object from storage: * @@ -41,6 +43,7 @@ export interface Storage { /** * Saves store items to storage. + * * @remarks * This example writes an object to storage after its been modified: * @@ -54,6 +57,7 @@ export interface Storage { /** * Removes store items from storage + * * @remarks * This example deletes an object from storage: * @@ -103,6 +107,7 @@ export function assertStoreItems(val: unknown, ..._args: unknown[]): asserts val /** * Utility function to calculate a change hash for a `StoreItem`. + * * @remarks * This example calculates a change hash for an object that's been read in and then only writes it * back out if it's been modified: diff --git a/libraries/botbuilder-core/src/stringUtils.ts b/libraries/botbuilder-core/src/stringUtils.ts index c000d86744..30df65d040 100644 --- a/libraries/botbuilder-core/src/stringUtils.ts +++ b/libraries/botbuilder-core/src/stringUtils.ts @@ -12,6 +12,7 @@ export class StringUtils { /** * Truncate string with ... + * * @param text Text. * @param length Length to truncate text. * @returns Original string modified. @@ -27,6 +28,7 @@ export class StringUtils { /** * UniqueHash - create a unique hash from a string. + * * @remarks * The source for this function was derived from the following article: * @@ -47,6 +49,7 @@ export class StringUtils { /** * EllipsisHash - create truncated string with unique hash for the truncated part. + * * @param text Text to truncate. * @param length Length to truncate at. * @returns The truncated string with unique hash for the truncated part. diff --git a/libraries/botbuilder-core/src/telemetryLoggerMiddleware.ts b/libraries/botbuilder-core/src/telemetryLoggerMiddleware.ts index 1dc648e60a..e71cdd23fc 100644 --- a/libraries/botbuilder-core/src/telemetryLoggerMiddleware.ts +++ b/libraries/botbuilder-core/src/telemetryLoggerMiddleware.ts @@ -50,6 +50,7 @@ export class TelemetryLoggerMiddleware implements Middleware { /** * Initializes a new instance of the TelemetryLoggerMiddleware class. + * * @param telemetryClient The BotTelemetryClient used for logging. * @param logPersonalInformation (Optional) Enable/Disable logging original message name within Application Insights. */ @@ -60,6 +61,7 @@ export class TelemetryLoggerMiddleware implements Middleware { /** * Gets a value indicating whether to log personal information that came from the user. + * * @returns A value indicating whether to log personal information or not. */ get logPersonalInformation(): boolean { @@ -68,6 +70,7 @@ export class TelemetryLoggerMiddleware implements Middleware { /** * Gets the currently configured botTelemetryClient that logs the events. + * * @returns The currently configured [BotTelemetryClient](xref:botbuilder-core.BotTelemetryClient) that logs the events. */ get telemetryClient(): BotTelemetryClient { @@ -76,6 +79,7 @@ export class TelemetryLoggerMiddleware implements Middleware { /** * Logs events based on incoming and outgoing activities using the botTelemetryClient class. + * * @param context The context object for this turn. * @param next The delegate to call to continue the bot middleware pipeline */ @@ -149,6 +153,7 @@ export class TelemetryLoggerMiddleware implements Middleware { * Invoked when a message is received from the user. * Performs logging of telemetry data using the IBotTelemetryClient.TrackEvent() method. * The event name logged is "BotMessageReceived". + * * @param activity Current activity sent from user. */ protected async onReceiveActivity(activity: Activity): Promise { @@ -162,6 +167,7 @@ export class TelemetryLoggerMiddleware implements Middleware { * Invoked when the bot sends a message to the user. * Performs logging of telemetry data using the botTelemetryClient.trackEvent() method. * The event name logged is "BotMessageSend". + * * @param activity Last activity sent from user. */ protected async onSendActivity(activity: Activity): Promise { @@ -175,6 +181,7 @@ export class TelemetryLoggerMiddleware implements Middleware { * Invoked when the bot updates a message. * Performs logging of telemetry data using the botTelemetryClient.trackEvent() method. * The event name used is "BotMessageUpdate". + * * @param activity Current activity sent from user. */ protected async onUpdateActivity(activity: Activity): Promise { @@ -188,6 +195,7 @@ export class TelemetryLoggerMiddleware implements Middleware { * Invoked when the bot deletes a message. * Performs logging of telemetry data using the botTelemetryClient.trackEvent() method. * The event name used is "BotMessageDelete". + * * @param activity Current activity sent from user. */ protected async onDeleteActivity(activity: Activity): Promise { @@ -200,6 +208,7 @@ export class TelemetryLoggerMiddleware implements Middleware { /** * Fills the Application Insights Custom Event properties for BotMessageReceived. * These properties are logged in the custom event when a new message is received from the user. + * * @param activity Last activity sent from user. * @param telemetryProperties Additional properties to add to the event. * @returns A dictionary that is sent as "Properties" to botTelemetryClient.trackEvent method. @@ -257,6 +266,7 @@ export class TelemetryLoggerMiddleware implements Middleware { /** * Fills the Application Insights Custom Event properties for BotMessageSend. * These properties are logged in the custom event when a response message is sent by the Bot to the user. + * * @param activity - Last activity sent from user. * @param telemetryProperties Additional properties to add to the event. * @returns A dictionary that is sent as "Properties" to botTelemetryClient.trackEvent method. @@ -312,6 +322,7 @@ export class TelemetryLoggerMiddleware implements Middleware { * These properties are logged when an activity message is updated by the Bot. * For example, if a card is interacted with by the use, and the card needs to be updated to reflect * some interaction. + * * @param activity - Last activity sent from user. * @param telemetryProperties Additional properties to add to the event. * @returns A dictionary that is sent as "Properties" to botTelemetryClient.trackEvent method. @@ -350,6 +361,7 @@ export class TelemetryLoggerMiddleware implements Middleware { /** * Fills the Application Insights Custom Event properties for BotMessageDelete. * These properties are logged in the custom event when an activity message is deleted by the Bot. This is a relatively rare case. + * * @param activity - Last activity sent from user. * @param telemetryProperties Additional properties to add to the event. * @returns A dictionary that is sent as "Properties" to botTelemetryClient.trackEvent method. diff --git a/libraries/botbuilder-core/src/testAdapter.ts b/libraries/botbuilder-core/src/testAdapter.ts index 420e621a44..c847449138 100644 --- a/libraries/botbuilder-core/src/testAdapter.ts +++ b/libraries/botbuilder-core/src/testAdapter.ts @@ -33,6 +33,7 @@ import { TurnContext } from './turnContext'; * ```TypeScript * type TestActivityInspector = (activity: Partial, description: string) => void; * ``` + * * @param TestActivityInspector.activity The activity being inspected. * @param TestActivityInspector.description Text to log in the event of an error. */ @@ -41,6 +42,7 @@ export type TestActivityInspector = (activity: Partial, description?: /** * Test adapter used for unit tests. This adapter can be used to simulate sending messages from the * user to the bot. + * * @remarks * The following example sets up the test adapter and then executes a simple test: * @@ -58,6 +60,7 @@ export type TestActivityInspector = (activity: Partial, description?: export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider { /** * Creates a new TestAdapter instance. + * * @param logicOrConversation The bots logic that's under test. * @param template (Optional) activity containing default values to assign to all test messages received. * @param sendTraceActivity Indicates whether the adapter should add to its queue any trace activities generated by the bot. @@ -100,6 +103,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Gets a value indicating whether to send trace activities. + * * @returns A value indicating whether to send trace activities. */ get enableTrace(): boolean { @@ -130,6 +134,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Create a ConversationReference. + * * @param name name of the conversation (also id). * @param user name of the user (also id) default: User1. * @param bot name of the bot (also id) default: Bot. @@ -149,6 +154,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Dequeues and returns the next bot response from the activeQueue. + * * @returns The next activity in the queue; or undefined, if the queue is empty. */ getNextReply(): Partial { @@ -160,6 +166,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Creates a message activity from text and the current conversational context. + * * @param text The message text. * @returns An appropriate message activity. */ @@ -179,6 +186,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Processes a message activity from a user. + * * @param userSays The text of the user's message. * @param callback The bot logic to invoke. * @returns {Promise} A promise representing the async operation. @@ -200,6 +208,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Receives an activity and runs it through the middleware pipeline. + * * @param activity The activity to process. * @param callback The bot logic to invoke. * @returns {Promise} A promise representing the async operation. @@ -330,6 +339,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * The `TestAdapter` doesn't implement `continueConversation()` and will return an error if it's * called. + * * @param _reference A reference to the conversation to continue. * @param _logic The asynchronous method to call after the adapter middleware runs. * @returns {Promise} A promise representing the async operation. @@ -343,6 +353,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Creates a turn context. + * * @param request An incoming request body. * @returns The created [TurnContext](xref:botbuilder-core.TurnContext). * @remarks @@ -355,6 +366,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Sends something to the bot. This returns a new `TestFlow` instance which can be used to add * additional steps for inspecting the bots reply and then sending additional activities. + * * @remarks * This example shows how to send a message and then verify that the response was as expected: * @@ -373,6 +385,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Send something to the bot and expects the bot to return with a given reply. + * * @remarks * This is simply a wrapper around calls to `send()` and `assertReply()`. This is such a * common pattern that a helper is provided. @@ -398,6 +411,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Test a list of activities. + * * @remarks * Each activity with the "bot" role will be processed with assertReply() and every other * activity will be processed as a user message with send(). @@ -435,6 +449,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Adds a fake user token so it can later be retrieved. + * * @param connectionName The connection name. * @param channelId The channel id. * @param userId The user id. @@ -461,6 +476,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Asynchronously retrieves the token status for each configured connection for the given user. * In testAdapter, retrieves tokens which were previously added via addUserToken. + * * @param context The context object for the turn. * @param userId The ID of the user to retrieve the token status for. * @param includeFilter Optional. A comma-separated list of connection's to include. If present, @@ -503,6 +519,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Retrieves the OAuth token for a user that is in a sign-in flow. + * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param magicCode (Optional) Optional user entered code to validate. @@ -534,6 +551,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Signs the user out with the token server. + * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param userId User ID to sign out. @@ -550,6 +568,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Gets a signin link from the token server that can be sent as part of a SigninCard. + * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @returns A signin link from the token server that can be sent as part of a SigninCard. @@ -560,6 +579,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Signs the user out with the token server. + * * @param _context Context for the current turn of conversation with the user. * @param _connectionName Name of the auth connection to use. * @param _resourceUrls The list of resource URLs to retrieve tokens for. @@ -579,6 +599,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Adds a fake exchangeable token so it can be exchanged later. + * * @param connectionName Name of the auth connection to use. * @param channelId Channel ID. * @param userId User ID. @@ -603,6 +624,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Gets a sign-in resource. + * * @param context [TurnContext](xref:botbuilder-core.TurnContext) for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param userId User ID @@ -627,6 +649,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Performs a token exchange operation such as for single sign-on. + * * @param context [TurnContext](xref:botbuilder-core.TurnContext) for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param userId User id associated with the token. @@ -665,6 +688,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Adds an instruction to throw an exception during exchange requests. + * * @param connectionName The connection name. * @param channelId The channel id. * @param userId The user id. @@ -684,6 +708,7 @@ export class TestAdapter extends BotAdapter implements ExtendedUserTokenProvider /** * Indicates if the activity is a reply from the bot (role == 'bot') + * * @remarks * Checks to see if the from property and if from.role exists on the Activity before * checking to see who the activity is from. Otherwise returns false by default. @@ -734,6 +759,7 @@ class ExchangeableToken extends UserToken { /** * Support class for `TestAdapter` that allows for the simple construction of a sequence of tests. + * * @remarks * Calling `adapter.send()` or `adapter.test()` will create a new test flow which you can chain * together additional tests using a fluent syntax. @@ -772,6 +798,7 @@ export class TestFlow { * Send something to the bot and expects the bot to return with a given reply. This is simply a * wrapper around calls to `send()` and `assertReply()`. This is such a common pattern that a * helper is provided. + * * @param userSays Text or activity simulating user input. * @param expected Expected text or activity of the reply sent by the bot. * @param description (Optional) Description of the test case. If not provided one will be generated. @@ -789,6 +816,7 @@ export class TestFlow { /** * Sends something to the bot. + * * @param userSays Text or activity simulating user input. * @returns A new [TestFlow](xref:botbuilder-core.TestFlow) object that appends this exchange to the modeled exchange. */ @@ -802,6 +830,7 @@ export class TestFlow { /** * Creates a conversation update activity and process the activity. + * * @returns {TestFlow} A new TestFlow object. */ sendConversationUpdate(): TestFlow { @@ -819,6 +848,7 @@ export class TestFlow { /** * Generates an assertion if the bots response doesn't match the expected text/activity. + * * @param expected Expected text or activity from the bot. Can be a callback to inspect the response using custom logic. * @param description (Optional) Description of the test case. If not provided one will be generated. * @param timeout (Optional) number of milliseconds to wait for a response from bot. Defaults to a value of `3000`. @@ -900,6 +930,7 @@ export class TestFlow { /** * Generates an assertion that the turn processing logic did not generate a reply from the bot, as expected. + * * @param description (Optional) Description of the test case. If not provided one will be generated. * @param timeout (Optional) number of milliseconds to wait for a response from bot. Defaults to a value of `3000`. * @returns A new [TestFlow](xref:botbuilder-core.TestFlow) object that appends this exchange to the modeled exchange. @@ -943,6 +974,7 @@ export class TestFlow { /** * Generates an assertion if the bots response is not one of the candidate strings. + * * @param candidates List of candidate responses. * @param description (Optional) Description of the test case. If not provided one will be generated. * @param timeout (Optional) number of milliseconds to wait for a response from bot. Defaults to a value of `3000`. @@ -969,6 +1001,7 @@ export class TestFlow { /** * Inserts a delay before continuing. + * * @param ms ms to wait. * @returns A new [TestFlow](xref:botbuilder-core.TestFlow) object that appends this exchange to the modeled exchange. */ @@ -986,6 +1019,7 @@ export class TestFlow { /** * Adds a `then()` step to the tests promise chain. + * * @param onFulfilled Code to run if the test is currently passing. * @param onRejected Code to run if the test has thrown an error. * @returns A new [TestFlow](xref:botbuilder-core.TestFlow) object that appends this exchange to the modeled exchange. @@ -996,6 +1030,7 @@ export class TestFlow { /** * Adds a finally clause. Note that you can't keep chaining afterwards. + * * @param onFinally Code to run after the test chain. * @returns {Promise} A promise representing the async operation. */ @@ -1005,6 +1040,7 @@ export class TestFlow { /** * Adds a `catch()` clause to the tests promise chain. + * * @param onRejected Code to run if the test has thrown an error. * @returns A new [TestFlow](xref:botbuilder-core.TestFlow) object that appends this exchange to the modeled exchange. */ @@ -1014,6 +1050,7 @@ export class TestFlow { /** * Start the test sequence, returning a promise to await. + * * @returns {Promise} A promise representing the async operation. */ startTest(): Promise { diff --git a/libraries/botbuilder-core/src/transcriptLogger.ts b/libraries/botbuilder-core/src/transcriptLogger.ts index 0e4b046cff..b1745e3b6c 100644 --- a/libraries/botbuilder-core/src/transcriptLogger.ts +++ b/libraries/botbuilder-core/src/transcriptLogger.ts @@ -25,6 +25,7 @@ export class TranscriptLoggerMiddleware implements Middleware { /** * Middleware for logging incoming and outgoing activities to a transcript store. + * * @param logger Transcript logger */ constructor(logger: TranscriptLogger) { @@ -37,6 +38,7 @@ export class TranscriptLoggerMiddleware implements Middleware { /** * Initialization for middleware turn. + * * @param context Context for the current turn of conversation with the user. * @param next Function to call at the end of the middleware chain. */ @@ -145,6 +147,7 @@ export class TranscriptLoggerMiddleware implements Middleware { /** * Logs the Activity. + * * @param transcript Array where the activity will be pushed. * @param activity Activity to log. */ @@ -161,6 +164,7 @@ export class TranscriptLoggerMiddleware implements Middleware { /** * Clones the Activity entity. + * * @param activity Activity to clone. * @returns The cloned activity. */ @@ -170,6 +174,7 @@ export class TranscriptLoggerMiddleware implements Middleware { /** * Error logging helper function. + * * @param err Error or object to console.error out. */ private transcriptLoggerErrorHandler(err: Error | any): void { @@ -190,6 +195,7 @@ export class TranscriptLoggerMiddleware implements Middleware { export class ConsoleTranscriptLogger implements TranscriptLogger { /** * Log an activity to the transcript. + * * @param activity Activity being logged. */ logActivity(activity: Activity): void | Promise { @@ -208,6 +214,7 @@ export class ConsoleTranscriptLogger implements TranscriptLogger { export interface TranscriptLogger { /** * Log an activity to the transcript. + * * @param activity Activity being logged. */ logActivity(activity: Activity): void | Promise; @@ -219,6 +226,7 @@ export interface TranscriptLogger { export interface TranscriptStore extends TranscriptLogger { /** * Get activities for a conversation (Aka the transcript) + * * @param channelId Channel Id. * @param conversationId Conversation Id. * @param continuationToken Continuation token to page through results. @@ -233,6 +241,7 @@ export interface TranscriptStore extends TranscriptLogger { /** * List conversations in the channelId. + * * @param channelId Channel Id. * @param continuationToken Continuation token to page through results. */ @@ -240,6 +249,7 @@ export interface TranscriptStore extends TranscriptLogger { /** * Delete a specific conversation and all of its activities. + * * @param channelId Channel Id where conversation took place. * @param conversationId Id of the conversation to delete. */ @@ -268,6 +278,7 @@ export interface TranscriptInfo { /** * Page of results. + * * @param T type of items being paged in. */ // tslint:disable-next-line:max-classes-per-file diff --git a/libraries/botbuilder-core/src/turnContext.ts b/libraries/botbuilder-core/src/turnContext.ts index a906a3cda2..0073c42d81 100644 --- a/libraries/botbuilder-core/src/turnContext.ts +++ b/libraries/botbuilder-core/src/turnContext.ts @@ -21,6 +21,7 @@ import { /** * A handler that can participate in send activity events for the current turn. + * * @remarks * **Parameters** * @@ -57,6 +58,7 @@ export type SendActivitiesHandler = ( /** * A handler that can participate in update activity events for the current turn. + * * @remarks * **Parameters** * @@ -88,6 +90,7 @@ export type UpdateActivityHandler = ( /** * A handler that can participate in delete activity events for the current turn. + * * @remarks * **Parameters** * @@ -135,6 +138,7 @@ export interface TurnContext {} /** * Provides context for a turn of a bot. + * * @remarks * Context provides information needed to process an incoming activity. The context object is * created by a [BotAdapter](xref:botbuilder-core.BotAdapter) and persists for the length of the turn. @@ -157,17 +161,20 @@ export class TurnContext { /** * Creates an new instance of the [TurnContext](xref:xref:botbuilder-core.TurnContext) class. + * * @param adapterOrContext The adapter creating the context. * @param request The incoming activity for the turn. */ constructor(adapterOrContext: BotAdapter, request: Partial); /** * Creates an new instance of the [TurnContext](xref:xref:botbuilder-core.TurnContext) class. + * * @param adapterOrContext The context object to clone. */ constructor(adapterOrContext: TurnContext); /** * Creates an new instance of the [TurnContext](xref:xref:botbuilder-core.TurnContext) class. + * * @param adapterOrContext The adapter creating the context or the context object to clone. * @param request Optional. The incoming activity for the turn. */ @@ -184,6 +191,7 @@ export class TurnContext { * Removes at mentions for the activity's [recipient](xref:botframework-schema.Activity.recipient) * from the text of an activity and returns the updated text. * Use with caution; this function alters the activity's [text](xref:botframework-schema.Activity.text) property. + * * @param activity The activity to remove at mentions from. * @returns The updated activity's text. * @remarks @@ -207,6 +215,7 @@ export class TurnContext { /** * Removes at mentions for a given ID from the text of an activity and returns the updated text. * Use with caution; this function alters the activity's [text](xref:botframework-schema.Activity.text) property. + * * @param activity The activity to remove at mentions from. * @param id The ID of the user or bot to remove at mentions for. * @returns The updated activity's text. @@ -244,6 +253,7 @@ export class TurnContext { /** * Gets all at-mention entities included in an activity. + * * @param activity The activity. * @returns All the at-mention entities included in an activity. * @remarks @@ -271,6 +281,7 @@ export class TurnContext { /** * Copies conversation reference information from an activity. + * * @param activity The activity to get the information from. * @returns A conversation reference for the conversation that contains this activity. * @remarks @@ -299,6 +310,7 @@ export class TurnContext { /** * Updates an activity with the delivery information from an existing conversation reference. + * * @param activity The activity to update. * @param reference The conversation reference to copy delivery information from. * @param isIncoming Optional. `true` to treat the activity as an incoming activity, where the @@ -338,6 +350,7 @@ export class TurnContext { /** * Copies conversation reference information from a resource response for a sent activity. + * * @param activity The sent activity. * @param reply The resource response for the activity, returned by the * [sendActivity](xref:botbuilder-core.TurnContext.sendActivity) or @@ -376,6 +389,7 @@ export class TurnContext { /** * Asynchronously sends an activity to the sender of the incoming activity. + * * @param name The activity or text to send. * @param value Optional. The text to be spoken by your bot on a speech-enabled channel. * @param valueType Optional. Indicates whether your bot is accepting, expecting, or ignoring user @@ -412,6 +426,7 @@ export class TurnContext { /** * Asynchronously sends an activity to the sender of the incoming activity. + * * @param activityOrText The activity or text to send. * @param speak Optional. The text to be spoken by your bot on a speech-enabled channel. * @param inputHint Optional. Indicates whether your bot is accepting, expecting, or ignoring user @@ -460,6 +475,7 @@ export class TurnContext { /** * Asynchronously sends a set of activities to the sender of the incoming activity. + * * @param activities The activities to send. * @returns A promise with a ResourceResponse. * @remarks @@ -548,6 +564,7 @@ export class TurnContext { /** * Asynchronously updates a previously sent activity. + * * @param activity The replacement for the original activity. * @returns A promise with a ResourceResponse. * @remarks @@ -577,6 +594,7 @@ export class TurnContext { /** * Asynchronously deletes a previously sent activity. + * * @param idOrReference ID or conversation reference for the activity to delete. * @returns A promise representing the async operation. * @remarks @@ -612,6 +630,7 @@ export class TurnContext { /** * Adds a response handler for send activity operations. + * * @param handler The handler to add to the context object. * @returns The updated context object. * @remarks @@ -642,6 +661,7 @@ export class TurnContext { /** * Adds a response handler for update activity operations. + * * @param handler The handler to add to the context object. * @returns The updated context object. * @remarks @@ -671,6 +691,7 @@ export class TurnContext { /** * Adds a response handler for delete activity operations. + * * @param handler The handler to add to the context object. * @returns The updated context object. * @remarks @@ -700,6 +721,7 @@ export class TurnContext { /** * Called when this turn context object is passed into the constructor for a new turn context. + * * @param context The new turn context object. * @remarks * This copies private members from this object to the new object. @@ -722,6 +744,7 @@ export class TurnContext { /** * Gets the bot adapter that created this context object. + * * @returns The bot adapter that created this context object. */ get adapter(): BotAdapter { @@ -730,6 +753,7 @@ export class TurnContext { /** * Gets the activity associated with this turn. + * * @returns The activity associated with this turn. * @remarks * This example shows how to get the users trimmed utterance from the activity: @@ -744,6 +768,7 @@ export class TurnContext { /** * Indicates whether the bot has replied to the user this turn. + * * @returns True if at least one response was sent for the current turn; otherwise, false. * @remarks * **true** if at least one response was sent for the current turn; otherwise, **false**. @@ -765,6 +790,7 @@ export class TurnContext { /** * Sets the response flag on the current turn context. + * * @remarks * The [sendActivity](xref:botbuilder-core.TurnContext.sendActivity) and * [sendActivities](xref:botbuilder-core.TurnContext.sendActivities) methods call this method to @@ -780,6 +806,7 @@ export class TurnContext { /** * Gets the locale stored in the turnState. + * * @returns The locale stored in the turnState. */ get locale(): string | undefined { @@ -806,6 +833,7 @@ export class TurnContext { /** * Gets the services registered on this context object. + * * @returns The services registered on this context object. * @remarks * Middleware, other components, and services will typically use this to cache information diff --git a/libraries/botbuilder-core/src/turnContextStateCollection.ts b/libraries/botbuilder-core/src/turnContextStateCollection.ts index 6ea4a5a490..b6a12fef57 100644 --- a/libraries/botbuilder-core/src/turnContextStateCollection.ts +++ b/libraries/botbuilder-core/src/turnContextStateCollection.ts @@ -7,24 +7,28 @@ const TURN_STATE_SCOPE_CACHE = Symbol('turnStateScopeCache'); /** * Values persisted for the lifetime of the turn as part of the [TurnContext](xref:botbuilder-core.TurnContext). + * * @remarks Typical values stored here are objects which are needed for the lifetime of a turn, such * as [Storage](xref:botbuilder-core.Storage), [BotState](xref:botbuilder-core.BotState), [ConversationState](xref:botbuilder-core.ConversationState), [LanguageGenerator](xref:botbuilder-dialogs-adaptive.LanguageGenerator), [ResourceExplorer](xref:botbuilder-dialogs-declarative.ResourceExplorer), etc. */ export class TurnContextStateCollection extends Map { /** * Gets a typed value from the [TurnContextStateCollection](xref:botbuilder-core.TurnContextStateCollection). + * * @param key The values key. */ get(key: any): T; /** * Gets a value from the [TurnContextStateCollection](xref:botbuilder-core.TurnContextStateCollection). + * * @param key The values key. */ get(key: any): any; /** * Gets a value from the [TurnContextStateCollection](xref:botbuilder-core.TurnContextStateCollection). + * * @param key The values key. * @returns The object; or null if no service is registered by the key. */ @@ -34,6 +38,7 @@ export class TurnContextStateCollection extends Map { /** * Push a value by key to the turn's context. + * * @remarks * The keys current value (if any) will be saved and can be restored by calling [pop()](#pop). * @param key The values key. @@ -59,6 +64,7 @@ export class TurnContextStateCollection extends Map { /** * Restores a keys previous value, and returns the value that was removed. + * * @param key The values key. * @returns The removed value. */ diff --git a/libraries/botbuilder-core/src/userState.ts b/libraries/botbuilder-core/src/userState.ts index 9bb8e781d8..2f641b473f 100644 --- a/libraries/botbuilder-core/src/userState.ts +++ b/libraries/botbuilder-core/src/userState.ts @@ -14,6 +14,7 @@ const NO_KEY = 'UserState: overridden getStorageKey method did not return a key. /** * Reads and writes user state for your bot to storage. + * * @remarks * Each user your bot communicates with will have its own isolated storage object that can be used * to persist information about the user across all of the conversation you have with that user. @@ -27,6 +28,7 @@ const NO_KEY = 'UserState: overridden getStorageKey method did not return a key. export class UserState extends BotState { /** * Creates a new UserState instance. + * * @param storage Storage provider to persist user state to. * @param namespace (Optional) namespace to append to storage keys. Defaults to an empty string. */ @@ -44,6 +46,7 @@ export class UserState extends BotState { /** * Returns the storage key for the current user state. + * * @param context Context for current turn of conversation with the user. * @returns The storage key for the current user state. */ diff --git a/libraries/botbuilder-core/src/userTokenProvider.ts b/libraries/botbuilder-core/src/userTokenProvider.ts index b07ebd3705..5136c4424e 100644 --- a/libraries/botbuilder-core/src/userTokenProvider.ts +++ b/libraries/botbuilder-core/src/userTokenProvider.ts @@ -11,11 +11,13 @@ import { TokenResponse } from 'botframework-schema'; /** * Interface for User Token OAuth APIs for BotAdapters + * * @deprecated Use `UserTokenClient` instead. */ export interface IUserTokenProvider { /** * Retrieves the OAuth token for a user that is in a sign-in flow. + * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param magicCode (Optional) Optional user entered code to validate. @@ -24,6 +26,7 @@ export interface IUserTokenProvider { /** * Signs the user out with the token server. + * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. * @param userId User id of user to sign out. @@ -32,6 +35,7 @@ export interface IUserTokenProvider { /** * Retrieves the token status for each configured connection for the given user, using the bot's AppCredentials. + * * @param context Context for the current turn of conversation with the user. * @param userId The user Id for which token status is retrieved. * @param includeFilter Comma separated list of connection's to include. Blank will return token status for all configured connections. @@ -46,6 +50,7 @@ export interface IUserTokenProvider { /** * Gets a signin link from the token server that can be sent as part of a SigninCard. + * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. */ @@ -53,6 +58,7 @@ export interface IUserTokenProvider { /** * Signs the user out with the token server. + * * @param context Context for the current turn of conversation with the user. * @param connectionName Name of the auth connection to use. */ diff --git a/libraries/botbuilder-core/tests/activityHandlerBase.test.js b/libraries/botbuilder-core/tests/activityHandlerBase.test.js index 090e533e48..770f47a392 100644 --- a/libraries/botbuilder-core/tests/activityHandlerBase.test.js +++ b/libraries/botbuilder-core/tests/activityHandlerBase.test.js @@ -72,6 +72,7 @@ describe('ActivityHandlerBase', function () { super.onTurnActivity(context); } } + it('should call onActivity from run()', async function () { const bot = new OverrideOnTurnActivity(); await processActivity({ type: 'any' }, bot); diff --git a/libraries/botbuilder-core/tests/botAdapter.test.js b/libraries/botbuilder-core/tests/botAdapter.test.js index 264c2c1323..ef068d5f0b 100644 --- a/libraries/botbuilder-core/tests/botAdapter.test.js +++ b/libraries/botbuilder-core/tests/botAdapter.test.js @@ -13,6 +13,7 @@ class SimpleAdapter extends BotAdapter { describe('BotAdapter', function () { let sandbox; + beforeEach(function () { sandbox = sinon.createSandbox(); }); diff --git a/libraries/botbuilder-core/tests/botState.test.js b/libraries/botbuilder-core/tests/botState.test.js index 3b7af13bed..a70df49643 100644 --- a/libraries/botbuilder-core/tests/botState.test.js +++ b/libraries/botbuilder-core/tests/botState.test.js @@ -19,6 +19,7 @@ describe('BotState', function () { assert(context, 'context not passed into storage stateKey factory.'); return storageKey; }); + it('should return undefined from get() if nothing cached.', async function () { const state = botState.get(context); assert(state === undefined, 'state returned.'); diff --git a/libraries/botbuilder-core/tests/browserStorage.test.js b/libraries/botbuilder-core/tests/browserStorage.test.js index c48c76840b..1f4be9d639 100644 --- a/libraries/botbuilder-core/tests/browserStorage.test.js +++ b/libraries/botbuilder-core/tests/browserStorage.test.js @@ -110,11 +110,15 @@ function testStorage(storage) { } global.localStorage = {}; -describe('BrowserLocalStorage', function () { - testStorage(new BrowserLocalStorage()); -}); -global.sessionStorage = {}; -describe('BrowserSessionStorage', function () { - testStorage(new BrowserSessionStorage()); +describe('Browser Storage Tests', function () { + describe('BrowserLocalStorage', function () { + testStorage(new BrowserLocalStorage()); + }); + + global.sessionStorage = {}; + + describe('BrowserSessionStorage', function () { + testStorage(new BrowserSessionStorage()); + }); }); diff --git a/libraries/botbuilder-core/tests/cloudAdapterBase.test.js b/libraries/botbuilder-core/tests/cloudAdapterBase.test.js index 2b627c9c62..146e44636e 100644 --- a/libraries/botbuilder-core/tests/cloudAdapterBase.test.js +++ b/libraries/botbuilder-core/tests/cloudAdapterBase.test.js @@ -17,6 +17,7 @@ const noop = () => null; describe('CloudAdapterBase', function () { let sandbox; + beforeEach(function () { sandbox = sinon.createSandbox({ useFakeTimers: true }); }); diff --git a/libraries/botbuilder-core/tests/conversationState.test.js b/libraries/botbuilder-core/tests/conversationState.test.js index f5326417a9..cb902e92db 100644 --- a/libraries/botbuilder-core/tests/conversationState.test.js +++ b/libraries/botbuilder-core/tests/conversationState.test.js @@ -12,6 +12,7 @@ describe('ConversationState', function () { const adapter = new TestAdapter(); const context = new TurnContext(adapter, receivedMessage); const conversationState = new ConversationState(storage); + it('should load and save state from storage.', async function () { // Simulate a "Turn" in a conversation by loading the state, // changing it and then saving the changes to state. diff --git a/libraries/botbuilder-core/tests/memoryStorage.test.js b/libraries/botbuilder-core/tests/memoryStorage.test.js index 6379657a3d..05a11738c7 100644 --- a/libraries/botbuilder-core/tests/memoryStorage.test.js +++ b/libraries/botbuilder-core/tests/memoryStorage.test.js @@ -70,18 +70,20 @@ function testStorage(storage) { }); } -describe('MemoryStorage - Empty', function () { - testStorage(new MemoryStorage()); -}); +describe('Memory Storage Tests', function () { + describe('MemoryStorage - Empty', function () { + testStorage(new MemoryStorage()); + }); -describe('MemoryStorage - PreExisting', function () { - const dictionary = { test: JSON.stringify({ counter: 12 }) }; - const storage = new MemoryStorage(dictionary); - testStorage(storage); + describe('MemoryStorage - PreExisting', function () { + const dictionary = { test: JSON.stringify({ counter: 12 }) }; + const storage = new MemoryStorage(dictionary); + testStorage(storage); - it('should still have test', function () { - return storage.read(['test']).then((result) => { - assert(result.test.counter == 12, 'read() test.counter should be 12'); + it('should still have test', function () { + return storage.read(['test']).then((result) => { + assert(result.test.counter == 12, 'read() test.counter should be 12'); + }); }); }); }); diff --git a/libraries/botbuilder-core/tests/privateConversationState.test.js b/libraries/botbuilder-core/tests/privateConversationState.test.js index 182dd4dce4..4018f2f70a 100644 --- a/libraries/botbuilder-core/tests/privateConversationState.test.js +++ b/libraries/botbuilder-core/tests/privateConversationState.test.js @@ -19,6 +19,7 @@ describe('PrivateConversationState', function () { const adapter = new TestAdapter(); const context = new TurnContext(adapter, receivedMessage); const privateConversationState = new PrivateConversationState(storage); + it('should load and save state from storage.', async function () { // Simulate a "Turn" in a conversation by loading the state, // changing it and then saving the changes to state. diff --git a/libraries/botbuilder-core/tests/storageBaseTests.js b/libraries/botbuilder-core/tests/storageBaseTests.js index f0b4ef5489..45f557f459 100644 --- a/libraries/botbuilder-core/tests/storageBaseTests.js +++ b/libraries/botbuilder-core/tests/storageBaseTests.js @@ -9,6 +9,7 @@ const { BlobStorage, CosmosDbPartitionedStorage } = require('../../botbuilder-az * * All tests return true if assertions pass to indicate that the code ran to completion, passing internal assertions. * Therefore, all tests using theses static tests should strictly check that the method returns true. + * * @example * const testRan = await StorageBaseTests.returnEmptyObjectWhenReadingUnknownKey(storage); * assert.strictEqual(testRan, true); diff --git a/libraries/botbuilder-core/tests/telemetryMiddleware.test.js b/libraries/botbuilder-core/tests/telemetryMiddleware.test.js index c6a4a6deb2..437123b36a 100644 --- a/libraries/botbuilder-core/tests/telemetryMiddleware.test.js +++ b/libraries/botbuilder-core/tests/telemetryMiddleware.test.js @@ -23,6 +23,7 @@ const createReply = (activity, text, locale = null) => ({ describe('TelemetryMiddleware', function () { let sandbox; + beforeEach(function () { sandbox = sinon.createSandbox(); }); diff --git a/libraries/botbuilder-core/tests/transcriptMiddleware.test.js b/libraries/botbuilder-core/tests/transcriptMiddleware.test.js index 2c0b41f266..2bcb832287 100644 --- a/libraries/botbuilder-core/tests/transcriptMiddleware.test.js +++ b/libraries/botbuilder-core/tests/transcriptMiddleware.test.js @@ -316,6 +316,7 @@ describe('TranscriptLoggerMiddleware', function () { describe("'s error handling", function () { let sandbox; + beforeEach(function () { sandbox = sinon.createSandbox(); }); diff --git a/libraries/botbuilder-core/tests/transcriptUtilities.js b/libraries/botbuilder-core/tests/transcriptUtilities.js index 46f907a50e..2ac8da67d4 100644 --- a/libraries/botbuilder-core/tests/transcriptUtilities.js +++ b/libraries/botbuilder-core/tests/transcriptUtilities.js @@ -27,6 +27,7 @@ module.exports = { /** * Loads a list of activities from a .transcript file. + * * @param {string} transcriptFilePath Relative or absolute path to .transcript file. */ function getActivitiesFromTranscript(transcriptFilePath) { @@ -35,6 +36,7 @@ function getActivitiesFromTranscript(transcriptFilePath) { /** * Loads a list of activities from a .chat file. + * * @param {string} chatFilePath Relative or absolute path to .chat file. */ async function getActivitiesFromChat(chatFilePath) { @@ -46,6 +48,7 @@ async function getActivitiesFromChat(chatFilePath) { /** * Creates a Mocha Test definition (Mocha.ITestDefinition) that will use the TestAdapter to test a bot logic against the specified transcript file. * Optionally, pass a third parameter (as function) to register middleware into the TestAdapter. + * * @param {string} relativeTranscriptPath Path to the transcript file. Can be a .chat or .transcript file. * @param {Function} botLogicFactoryFun Function which accepts conversationState and userState and should return the bots logic to test. * @param {Function} middlewareRegistrationFun (Optional) Function which accepts the testAdapter, conversationState and userState. @@ -61,6 +64,7 @@ function assertBotLogicWithBotBuilderTranscript(relativeTranscriptPath, botLogic /** * Creates a Mocha Test definition (Mocha.ITestDefinition) that will use the TestAdapter to test a bot logic against the specified transcript file. * Optionally, pass a third parameter (as function) to register middleware into the TestAdapter. + * * @param {string} transcriptPath Path to the transcript file. Can be a .chat or .transcript file. * @param {Function} botLogicFactoryFun Function which accepts conversationState and userState and should return the bots logic to test. * @param {Function} middlewareRegistrationFun (Optional) Function which accepts the testAdapter, conversationState and userState. diff --git a/libraries/botbuilder-core/tests/userState.test.js b/libraries/botbuilder-core/tests/userState.test.js index 4820124650..94e97b4a8b 100644 --- a/libraries/botbuilder-core/tests/userState.test.js +++ b/libraries/botbuilder-core/tests/userState.test.js @@ -12,6 +12,7 @@ describe('UserState', function () { const adapter = new TestAdapter(); const context = new TurnContext(adapter, receivedMessage); const userState = new UserState(storage); + it('should load and save state from storage.', async function () { // Simulate a "Turn" in a conversation by loading the state, // changing it and then saving the changes to state. diff --git a/libraries/botbuilder-dialogs-adaptive-testing/package.json b/libraries/botbuilder-dialogs-adaptive-testing/package.json index 736ac3c113..c152be89b8 100644 --- a/libraries/botbuilder-dialogs-adaptive-testing/package.json +++ b/libraries/botbuilder-dialogs-adaptive-testing/package.json @@ -39,7 +39,7 @@ "zod": "^3.23.8" }, "devDependencies": { - "botbuilder": "4.1.6", + "botbuilder": "4.1.6", "@microsoft/recognizers-text-suite": "1.1.4" }, "author": "Microsoft", diff --git a/libraries/botbuilder-dialogs/package.json b/libraries/botbuilder-dialogs/package.json index fb480ed8be..7e996fa365 100644 --- a/libraries/botbuilder-dialogs/package.json +++ b/libraries/botbuilder-dialogs/package.json @@ -42,7 +42,6 @@ }, "devDependencies": { "@types/globalize": "^1.5.5", - "line-reader": "^0.4.0" }, "scripts": { diff --git a/libraries/botbuilder/package.json b/libraries/botbuilder/package.json index a77cac2347..18775a5582 100644 --- a/libraries/botbuilder/package.json +++ b/libraries/botbuilder/package.json @@ -45,7 +45,7 @@ "zod": "^3.23.8" }, "devDependencies": { - "chai": "^4.5.0", + "chai": "^4.5.0", "lodash": "^4.17.20", "nock": "^13.5.5", "node-mocks-http": "^1.16.0" diff --git a/libraries/botframework-config/package.json b/libraries/botframework-config/package.json index c253fe3d66..e747074b11 100644 --- a/libraries/botframework-config/package.json +++ b/libraries/botframework-config/package.json @@ -39,7 +39,7 @@ "uuid": "^10.0.0" }, "devDependencies": { - "@types/uuid": "^10.0.0" + "@types/uuid": "^10.0.0" }, "scripts": { "build": "tsc -b", diff --git a/yarn.lock b/yarn.lock index be3977e8c6..eb2f441884 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14481,7 +14481,14 @@ stringify-entities@^4.0.0: character-entities-html4 "^2.0.0" character-entities-legacy "^3.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@6.0.1, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@6.0.1, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -15915,7 +15922,7 @@ workerpool@^6.5.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.5.1.tgz#060f73b39d0caf97c6db64da004cd01b4c099544" integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -15942,6 +15949,15 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From c1557810e53c610d2434d18c48fbb2ee09643792 Mon Sep 17 00:00:00 2001 From: JhontSouth Date: Mon, 28 Oct 2024 09:58:57 -0500 Subject: [PATCH 5/7] remove unnecesary packages --- libraries/botbuilder-core/package.json | 2 -- libraries/botbuilder-core/src/botStatePropertyAccessor.ts | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/botbuilder-core/package.json b/libraries/botbuilder-core/package.json index 68b149d810..dc220e3534 100644 --- a/libraries/botbuilder-core/package.json +++ b/libraries/botbuilder-core/package.json @@ -27,12 +27,10 @@ } }, "dependencies": { - "@eslint/js": "^9.12.0", "botbuilder-dialogs-adaptive-runtime-core": "4.1.6", "botbuilder-stdlib": "4.1.6", "botframework-connector": "4.1.6", "botframework-schema": "4.1.6", - "eslint-plugin-only-warn": "^1.1.0", "uuid": "^10.0.0", "zod": "^3.23.8" }, diff --git a/libraries/botbuilder-core/src/botStatePropertyAccessor.ts b/libraries/botbuilder-core/src/botStatePropertyAccessor.ts index 4e6cc1d3a6..f05e2f3860 100644 --- a/libraries/botbuilder-core/src/botStatePropertyAccessor.ts +++ b/libraries/botbuilder-core/src/botStatePropertyAccessor.ts @@ -49,6 +49,8 @@ export interface StatePropertyAccessor { get(context: TurnContext): Promise; /** + * Reads a persisted property from its backing storage object. + * * @param context Context for the current turn of conversation with the user. * @param defaultValue (Optional) default value to copy to the backing storage object if the property isn't found. */ From 414cdc15ae9544d9adc70243bb8dc642057c4973 Mon Sep 17 00:00:00 2001 From: JhontSouth Date: Thu, 14 Nov 2024 11:46:04 -0500 Subject: [PATCH 6/7] update yarn.lock --- yarn.lock | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/yarn.lock b/yarn.lock index eb2f441884..be3977e8c6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14481,14 +14481,7 @@ stringify-entities@^4.0.0: character-entities-html4 "^2.0.0" character-entities-legacy "^3.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@6.0.1, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@6.0.1, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -15922,7 +15915,7 @@ workerpool@^6.5.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.5.1.tgz#060f73b39d0caf97c6db64da004cd01b4c099544" integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -15949,15 +15942,6 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From e2cb9d37c85494efbc3caf0e477c49bd9e108a8f Mon Sep 17 00:00:00 2001 From: JhontSouth Date: Fri, 20 Dec 2024 11:08:18 -0500 Subject: [PATCH 7/7] update API signature --- libraries/botbuilder-core/etc/botbuilder-core.api.md | 1 - 1 file changed, 1 deletion(-) diff --git a/libraries/botbuilder-core/etc/botbuilder-core.api.md b/libraries/botbuilder-core/etc/botbuilder-core.api.md index a551446d4b..425beadb03 100644 --- a/libraries/botbuilder-core/etc/botbuilder-core.api.md +++ b/libraries/botbuilder-core/etc/botbuilder-core.api.md @@ -624,7 +624,6 @@ export class SkypeMentionNormalizeMiddleware implements Middleware { export interface StatePropertyAccessor { delete(context: TurnContext): Promise; get(context: TurnContext): Promise; - // (undocumented) get(context: TurnContext, defaultValue: T): Promise; set(context: TurnContext, value: T): Promise; }