From 7c7d9e67b8925c076cd8c1e0841f7158c2f9bea0 Mon Sep 17 00:00:00 2001 From: sw-joelmut Date: Wed, 27 Apr 2022 11:39:33 -0300 Subject: [PATCH] Remove 'public' access modifier from botbuilder folder --- .../botbuilder/src/botFrameworkAdapter.ts | 88 +++++++++---------- .../botbuilder/src/botFrameworkHttpClient.ts | 4 +- .../src/channelServiceHandlerBase.ts | 24 ++--- .../botbuilder/src/channelServiceRoutes.ts | 2 +- libraries/botbuilder/src/cloudAdapter.ts | 2 +- libraries/botbuilder/src/eventFactory.ts | 4 +- .../botbuilder/src/fileTranscriptStore.ts | 8 +- libraries/botbuilder/src/handoffEventNames.ts | 4 +- .../botbuilder/src/inspectionMiddleware.ts | 22 ++--- libraries/botbuilder/src/routeConstants.ts | 18 ++-- .../src/skills/cloudSkillHandler.ts | 4 +- .../botbuilder/src/skills/skillHandler.ts | 4 +- .../botbuilder/src/skills/skillHttpClient.ts | 8 +- libraries/botbuilder/src/statusCodeError.ts | 2 +- .../src/streaming/streamingHttpClient.ts | 4 +- .../botbuilder/src/streaming/tokenResolver.ts | 2 +- .../botbuilder/src/teamsActivityHandler.ts | 28 +++--- libraries/botbuilder/src/teamsInfo.ts | 22 ++--- 18 files changed, 125 insertions(+), 125 deletions(-) diff --git a/libraries/botbuilder/src/botFrameworkAdapter.ts b/libraries/botbuilder/src/botFrameworkAdapter.ts index 3fdbe5a2e8..c69c7255a5 100644 --- a/libraries/botbuilder/src/botFrameworkAdapter.ts +++ b/libraries/botbuilder/src/botFrameworkAdapter.ts @@ -205,7 +205,7 @@ export class BotFrameworkAdapter // These keys are public to permit access to the keys from the adapter when it's a being // from library that does not have access to static properties off of BotFrameworkAdapter. // E.g. botbuilder-dialogs - public readonly TokenApiClientCredentialsKey: symbol = Symbol('TokenApiClientCredentials'); + readonly TokenApiClientCredentialsKey: symbol = Symbol('TokenApiClientCredentials'); protected readonly credentials: AppCredentials; protected readonly credentialsProvider: SimpleCredentialProvider; @@ -238,7 +238,7 @@ export class BotFrameworkAdapter * The [BotFrameworkAdapterSettings](xref:botbuilder.BotFrameworkAdapterSettings) class defines * the available adapter settings. */ - public constructor(settings?: Partial) { + constructor(settings?: Partial) { super(); this.settings = { appId: '', appPassword: '', ...settings }; @@ -314,7 +314,7 @@ export class BotFrameworkAdapter * * @returns True if the streaming connection is open, otherwise false. */ - public get isStreamingConnectionOpen(): boolean { + get isStreamingConnectionOpen(): boolean { return this.streamingServer?.isConnected ?? false; } @@ -364,7 +364,7 @@ export class BotFrameworkAdapter * }); * ``` */ - public async continueConversation( + async continueConversation( reference: Partial, logic: (context: TurnContext) => Promise ): Promise; @@ -376,7 +376,7 @@ export class BotFrameworkAdapter * @param oAuthScope The intended recipient of any sent activities or the function to call to continue the conversation. * @param logic Optional. The asynchronous method to call after the adapter middleware runs. */ - public async continueConversation( + async continueConversation( reference: Partial, oAuthScope: string, logic: (context: TurnContext) => Promise @@ -385,7 +385,7 @@ export class BotFrameworkAdapter /** * @internal */ - public async continueConversation( + async continueConversation( reference: Partial, oAuthScopeOrlogic: string | ((context: TurnContext) => Promise), maybeLogic?: (context: TurnContext) => Promise @@ -480,7 +480,7 @@ export class BotFrameworkAdapter * }); * ``` */ - public createConversation( + createConversation( reference: Partial, logic: (context: TurnContext) => Promise ): Promise; @@ -493,7 +493,7 @@ export class BotFrameworkAdapter * @param {(context: TurnContext) => Promise} logic The asynchronous method to call after the adapter middleware runs. * @returns {Promise} a promise representing the asynchronous operation */ - public createConversation( + createConversation( reference: Partial, parameters: Partial, logic: (context: TurnContext) => Promise @@ -502,7 +502,7 @@ export class BotFrameworkAdapter /** * @internal */ - public async createConversation( + async createConversation( reference: Partial, parametersOrLogic: Partial | ((context: TurnContext) => Promise), maybeLogic?: (context: TurnContext) => Promise @@ -581,7 +581,7 @@ export class BotFrameworkAdapter * @remarks * Not all channels support this operation. For channels that don't, this call may throw an exception. */ - public async deleteActivity(context: TurnContext, reference: Partial): Promise { + async deleteActivity(context: TurnContext, reference: Partial): Promise { if (!reference.serviceUrl) { throw new Error('BotFrameworkAdapter.deleteActivity(): missing serviceUrl'); } @@ -610,7 +610,7 @@ export class BotFrameworkAdapter * * Not all channels support this operation. For channels that don't, this call may throw an exception. */ - public async deleteConversationMember(context: TurnContext, memberId: string): Promise { + async deleteConversationMember(context: TurnContext, memberId: string): Promise { if (!context.activity.serviceUrl) { throw new Error('BotFrameworkAdapter.deleteConversationMember(): missing serviceUrl'); } @@ -639,7 +639,7 @@ export class BotFrameworkAdapter * This is different from [getConversationMembers](xref:botbuilder.BotFrameworkAdapter.getConversationMembers) * in that it will return only those users directly involved in the activity, not all members of the conversation. */ - public async getActivityMembers(context: TurnContext, activityId?: string): Promise { + async getActivityMembers(context: TurnContext, activityId?: string): Promise { if (!activityId) { activityId = context.activity.id; } @@ -676,7 +676,7 @@ export class BotFrameworkAdapter * This is different from [getActivityMembers](xref:botbuilder.BotFrameworkAdapter.getActivityMembers) * in that it will return all members of the conversation, not just those directly involved in a specific activity. */ - public async getConversationMembers(context: TurnContext): Promise { + async getConversationMembers(context: TurnContext): Promise { if (!context.activity.serviceUrl) { throw new Error('BotFrameworkAdapter.getConversationMembers(): missing serviceUrl'); } @@ -714,7 +714,7 @@ export class BotFrameworkAdapter * retrieved from * `contextOrServiceUrl`.[activity](xref:botbuilder-core.TurnContext.activity).[serviceUrl](xref:botframework-schema.Activity.serviceUrl). */ - public async getConversations( + async getConversations( contextOrServiceUrl: TurnContext | string, continuationToken?: string ): Promise { @@ -741,8 +741,8 @@ export class BotFrameworkAdapter * * @returns A [TokenResponse](xref:botframework-schema.TokenResponse) object that contains the user token. */ - public async getUserToken(context: TurnContext, connectionName: string, magicCode?: string): Promise; - public async getUserToken( + async getUserToken(context: TurnContext, connectionName: string, magicCode?: string): Promise; + async getUserToken( context: TurnContext, connectionName: string, magicCode?: string, @@ -758,7 +758,7 @@ export class BotFrameworkAdapter * * @returns A [TokenResponse](xref:botframework-schema.TokenResponse) object that contains the user token. */ - public async getUserToken( + async getUserToken( context: TurnContext, connectionName: string, magicCode?: string, @@ -796,8 +796,8 @@ export class BotFrameworkAdapter * @param userId The ID of user to sign out. * @param oAuthAppCredentials AppCredentials for OAuth. */ - public async signOutUser(context: TurnContext, connectionName?: string, userId?: string): Promise; - public async signOutUser( + async signOutUser(context: TurnContext, connectionName?: string, userId?: string): Promise; + async signOutUser( context: TurnContext, connectionName?: string, userId?: string, @@ -811,7 +811,7 @@ export class BotFrameworkAdapter * @param userId Optional. The ID of the user to sign out. * @param oAuthAppCredentials Optional. [AppCredentials](xref:botframework-connector.AppCredentials) for OAuth. */ - public async signOutUser( + async signOutUser( context: TurnContext, connectionName?: string, userId?: string, @@ -845,14 +845,14 @@ export class BotFrameworkAdapter * @param userId The user id that will be associated with the token. * @param finalRedirect The final URL that the OAuth flow will redirect to. */ - public async getSignInLink( + async getSignInLink( context: TurnContext, connectionName: string, oAuthAppCredentials?: AppCredentials, userId?: string, finalRedirect?: string ): Promise; - public async getSignInLink( + async getSignInLink( context: TurnContext, connectionName: string, oAuthAppCredentials?: CoreAppCredentials, @@ -870,7 +870,7 @@ export class BotFrameworkAdapter * @param finalRedirect Optional. The final URL that the OAuth flow will redirect to. * @returns The sign in link. */ - public async getSignInLink( + async getSignInLink( context: TurnContext, connectionName: string, oAuthAppCredentials?: AppCredentials, @@ -913,8 +913,8 @@ export class BotFrameworkAdapter * * @returns The [TokenStatus](xref:botframework-connector.TokenStatus) objects retrieved. */ - public async getTokenStatus(context: TurnContext, userId?: string, includeFilter?: string): Promise; - public async getTokenStatus( + async getTokenStatus(context: TurnContext, userId?: string, includeFilter?: string): Promise; + async getTokenStatus( context: TurnContext, userId?: string, includeFilter?: string, @@ -932,7 +932,7 @@ export class BotFrameworkAdapter * * @returns The [TokenStatus](xref:botframework-connector.TokenStatus) objects retrieved. */ - public async getTokenStatus( + async getTokenStatus( context: TurnContext, userId?: string, includeFilter?: string, @@ -965,12 +965,12 @@ export class BotFrameworkAdapter * * @returns A map of the [TokenResponse](xref:botframework-schema.TokenResponse) objects by resource URL. */ - public async getAadTokens( + async getAadTokens( context: TurnContext, connectionName: string, resourceUrls: string[] ): Promise<{ [propertyName: string]: TokenResponse }>; - public async getAadTokens( + async getAadTokens( context: TurnContext, connectionName: string, resourceUrls: string[], @@ -986,7 +986,7 @@ export class BotFrameworkAdapter * * @returns A map of the [TokenResponse](xref:botframework-schema.TokenResponse) objects by resource URL. */ - public async getAadTokens( + async getAadTokens( context: TurnContext, connectionName: string, resourceUrls: string[], @@ -1021,7 +1021,7 @@ export class BotFrameworkAdapter * @param appCredentials Optional. The CoreAppCredentials for OAuth. * @returns The [BotSignInGetSignInResourceResponse](xref:botframework-connector.BotSignInGetSignInResourceResponse) object. */ - public async getSignInResource( + async getSignInResource( context: TurnContext, connectionName: string, userId?: string, @@ -1069,7 +1069,7 @@ export class BotFrameworkAdapter * @param tokenExchangeRequest The exchange request details, either a token to exchange or a uri to exchange. * @param appCredentials Optional. The CoreAppCredentials for OAuth. */ - public async exchangeToken( + async exchangeToken( context: TurnContext, connectionName: string, userId: string, @@ -1086,7 +1086,7 @@ export class BotFrameworkAdapter * @param appCredentials Optional. [AppCredentials](xref:botframework-connector.AppCredentials) for OAuth. * @returns A `Promise` representing the exchanged [TokenResponse](xref:botframework-schema.TokenResponse). */ - public async exchangeToken( + async exchangeToken( context: TurnContext, connectionName: string, userId: string, @@ -1131,7 +1131,7 @@ export class BotFrameworkAdapter * @remarks * When testing a bot in the Bot Framework Emulator, this method can emulate the OAuth card interaction. */ - public async emulateOAuthCards(contextOrServiceUrl: TurnContext | string, emulate: boolean): Promise { + async emulateOAuthCards(contextOrServiceUrl: TurnContext | string, emulate: boolean): Promise { this.isEmulatingOAuthCards = emulate; const url: string = this.oauthApiUrl(contextOrServiceUrl); await EmulatorApiClient.emulateOAuthCards(this.credentials, url, emulate); @@ -1187,7 +1187,7 @@ export class BotFrameworkAdapter * }); * ``` */ - public async processActivity( + async processActivity( req: WebRequest, res: WebResponse, logic: (context: TurnContext) => Promise @@ -1302,7 +1302,7 @@ export class BotFrameworkAdapter * [middleware](https://docs.microsoft.com/azure/bot-service/bot-builder-concept-middleware) articles. * Use the adapter's [use](xref:botbuilder-core.BotAdapter.use) method to add middleware to the adapter. */ - public async processActivityDirect( + async processActivityDirect( activity: Activity, logic: (context: TurnContext) => Promise ): Promise { @@ -1343,7 +1343,7 @@ export class BotFrameworkAdapter * response object will be returned for each sent activity. For `message` activities this will * contain the ID of the delivered message. */ - public async sendActivities(context: TurnContext, activities: Partial[]): Promise { + async sendActivities(context: TurnContext, activities: Partial[]): Promise { const responses: ResourceResponse[] = []; for (let i = 0; i < activities.length; i++) { const activity: Partial = activities[i]; @@ -1409,7 +1409,7 @@ export class BotFrameworkAdapter * @remarks * Not all channels support this operation. For channels that don't, this call may throw an exception. */ - public async updateActivity(context: TurnContext, activity: Partial): Promise { + async updateActivity(context: TurnContext, activity: Partial): Promise { if (!activity.serviceUrl) { throw new Error('BotFrameworkAdapter.updateActivity(): missing serviceUrl'); } @@ -1432,7 +1432,7 @@ export class BotFrameworkAdapter * @remarks * Override this in a derived class to create a mock connector client for unit testing. */ - public createConnectorClient(serviceUrl: string): ConnectorClient { + createConnectorClient(serviceUrl: string): ConnectorClient { return this.createConnectorClientInternal(serviceUrl, this.credentials); } @@ -1445,7 +1445,7 @@ export class BotFrameworkAdapter * @param serviceUrl The client's service URL. * @param identity ClaimsIdentity */ - public async createConnectorClientWithIdentity( + async createConnectorClientWithIdentity( serviceUrl: string, identity: ClaimsIdentity ): Promise; @@ -1459,7 +1459,7 @@ export class BotFrameworkAdapter * @param identity ClaimsIdentity * @param audience The recipient of the ConnectorClient's messages. Normally the Bot Framework Channel Service or the AppId of another bot. */ - public async createConnectorClientWithIdentity( + async createConnectorClientWithIdentity( serviceUrl: string, identity: ClaimsIdentity, audience: string @@ -1475,7 +1475,7 @@ export class BotFrameworkAdapter * @param audience Optional. The recipient of the [ConnectorClient](xref:botbuilder-connector.ConnectorClient)'s messages. Normally the Bot Framework Channel Service or the AppId of another bot. * @returns The client. */ - public async createConnectorClientWithIdentity( + async createConnectorClientWithIdentity( serviceUrl: string, identity: ClaimsIdentity, audience?: string @@ -1796,7 +1796,7 @@ export class BotFrameworkAdapter * @param request A ReceiveRequest from the connected channel. * @returns A response created by the BotAdapter to be sent to the client that originated the request. */ - public async processRequest(request: IReceiveRequest): Promise { + async processRequest(request: IReceiveRequest): Promise { const response = new StreamingResponse(); if (!request) { @@ -1934,7 +1934,7 @@ export class BotFrameworkAdapter * @param retryCount Number of times to attempt to bind incoming and outgoing pipe * @param onListen Optional callback that fires once when server is listening on both incoming and outgoing pipe */ - public async useNamedPipe( + async useNamedPipe( logic: (context: TurnContext) => Promise, pipeName = defaultPipeName, retryCount = 7, @@ -1972,7 +1972,7 @@ export class BotFrameworkAdapter * @param head The first packet of the upgraded stream. * @param logic The logic that handles incoming streaming requests for the lifetime of the WebSocket connection. */ - public async useWebSocket( + async useWebSocket( req: WebRequest, socket: INodeSocket, head: INodeBuffer, diff --git a/libraries/botbuilder/src/botFrameworkHttpClient.ts b/libraries/botbuilder/src/botFrameworkHttpClient.ts index d76027a59e..fc2adebebe 100644 --- a/libraries/botbuilder/src/botFrameworkHttpClient.ts +++ b/libraries/botbuilder/src/botFrameworkHttpClient.ts @@ -41,7 +41,7 @@ export class BotFrameworkHttpClient implements BotFrameworkClient { * @param credentialProvider An instance of [ICredentialProvider](xref:botframework-connector.ICredentialProvider). * @param channelService Optional. The channel service. */ - public constructor(credentialProvider: ICredentialProvider, channelService?: string) { + constructor(credentialProvider: ICredentialProvider, channelService?: string) { if (!credentialProvider) { throw new Error('BotFrameworkHttpClient(): missing credentialProvider'); } @@ -63,7 +63,7 @@ export class BotFrameworkHttpClient implements BotFrameworkClient { * @param activity Activity to forward. * @returns {Promise>} A promise representing the asynchronous operation. */ - public async postActivity( + async postActivity( fromBotId: string, toBotId: string, toUrl: string, diff --git a/libraries/botbuilder/src/channelServiceHandlerBase.ts b/libraries/botbuilder/src/channelServiceHandlerBase.ts index bebf920fa0..747f2e9cf5 100644 --- a/libraries/botbuilder/src/channelServiceHandlerBase.ts +++ b/libraries/botbuilder/src/channelServiceHandlerBase.ts @@ -31,7 +31,7 @@ export abstract class ChannelServiceHandlerBase { * @param activity The [Activity](xref:botframework-schema.Activity) to send. * @returns A `Promise` representing the [ResourceResponse](xref:botframework-schema.ResourceResponse) for the operation. */ - public async handleSendToConversation( + async handleSendToConversation( authHeader: string, conversationId: string, activity: Activity @@ -49,7 +49,7 @@ export abstract class ChannelServiceHandlerBase { * @param activity The [Activity](xref:botframework-schema.Activity) to send. * @returns A `Promise` representing the [ResourceResponse](xref:botframework-schema.ResourceResponse) for the operation. */ - public async handleReplyToActivity( + async handleReplyToActivity( authHeader: string, conversationId: string, activityId: string, @@ -68,7 +68,7 @@ export abstract class ChannelServiceHandlerBase { * @param activity The replacement [Activity](xref:botframework-schema.Activity). * @returns A `Promise` representing the [ResourceResponse](xref:botframework-schema.ResourceResponse) for the operation. */ - public async handleUpdateActivity( + async handleUpdateActivity( authHeader: string, conversationId: string, activityId: string, @@ -85,7 +85,7 @@ export abstract class ChannelServiceHandlerBase { * @param conversationId The conversation Id. * @param activityId The activity Id to delete. */ - public async handleDeleteActivity(authHeader: string, conversationId: string, activityId: string): Promise { + async handleDeleteActivity(authHeader: string, conversationId: string, activityId: string): Promise { const claimsIdentity = await this.authenticate(authHeader); await this.onDeleteActivity(claimsIdentity, conversationId, activityId); } @@ -98,7 +98,7 @@ export abstract class ChannelServiceHandlerBase { * @param activityId The activity Id. * @returns The enumerated [ChannelAccount](xref:botframework-schema.ChannelAccount) list. */ - public async handleGetActivityMembers( + async handleGetActivityMembers( authHeader: string, conversationId: string, activityId: string @@ -114,7 +114,7 @@ export abstract class ChannelServiceHandlerBase { * @param parameters [ConversationParameters](xref:botbuilder-core.ConversationParameters) to create the conversation from. * @returns A `Promise` representation for the operation. */ - public async handleCreateConversation( + async handleCreateConversation( authHeader: string, parameters: ConversationParameters ): Promise { @@ -130,7 +130,7 @@ export abstract class ChannelServiceHandlerBase { * @param continuationToken A skip or continuation token. * @returns A `Promise` representation for the operation. */ - public async handleGetConversations( + async handleGetConversations( authHeader: string, conversationId: string, continuationToken?: string /* some default */ @@ -146,7 +146,7 @@ export abstract class ChannelServiceHandlerBase { * @param conversationId The conversation Id. * @returns The enumerated [ChannelAccount](xref:botframework-schema.ChannelAccount) list. */ - public async handleGetConversationMembers(authHeader: string, conversationId: string): Promise { + async handleGetConversationMembers(authHeader: string, conversationId: string): Promise { const claimsIdentity = await this.authenticate(authHeader); return this.onGetConversationMembers(claimsIdentity, conversationId); } @@ -160,7 +160,7 @@ export abstract class ChannelServiceHandlerBase { * @param continuationToken A continuation token. * @returns A `Promise` representing the [PagedMembersResult](xref:botframework-schema.PagedMembersResult) for the operation. */ - public async handleGetConversationPagedMembers( + async handleGetConversationPagedMembers( authHeader: string, conversationId: string, pageSize = -1, @@ -177,7 +177,7 @@ export abstract class ChannelServiceHandlerBase { * @param conversationId The conversation Id. * @param memberId Id of the member to delete from this conversation. */ - public async handleDeleteConversationMember( + async handleDeleteConversationMember( authHeader: string, conversationId: string, memberId: string @@ -194,7 +194,7 @@ export abstract class ChannelServiceHandlerBase { * @param transcript [Transcript](xref:botframework-schema.Transcript) of activities. * @returns A `Promise` representing the [ResourceResponse](xref:botframework-schema.ResourceResponse) for the operation. */ - public async handleSendConversationHistory( + async handleSendConversationHistory( authHeader: string, conversationId: string, transcript: Transcript @@ -211,7 +211,7 @@ export abstract class ChannelServiceHandlerBase { * @param attachmentUpload [AttachmentData](xref:botframework-schema.AttachmentData). * @returns A `Promise` representing the [ResourceResponse](xref:botframework-schema.ResourceResponse) for the operation. */ - public async handleUploadAttachment( + async handleUploadAttachment( authHeader: string, conversationId: string, attachmentUpload: AttachmentData diff --git a/libraries/botbuilder/src/channelServiceRoutes.ts b/libraries/botbuilder/src/channelServiceRoutes.ts index 8f8c8f2155..fcd76f9536 100644 --- a/libraries/botbuilder/src/channelServiceRoutes.ts +++ b/libraries/botbuilder/src/channelServiceRoutes.ts @@ -47,7 +47,7 @@ export class ChannelServiceRoutes { * @param server WebServer * @param basePath Optional basePath which is appended before the service's REST API is configured on the WebServer. */ - public register(server: WebServer, basePath = ''): void { + register(server: WebServer, basePath = ''): void { server.post(basePath + RouteConstants.Activities, this.processSendToConversation.bind(this)); server.post(basePath + RouteConstants.Activity, this.processReplyToActivity.bind(this)); server.put(basePath + RouteConstants.Activity, this.processUpdateActivity.bind(this)); diff --git a/libraries/botbuilder/src/cloudAdapter.ts b/libraries/botbuilder/src/cloudAdapter.ts index 3b5de6aaad..61f9349e67 100644 --- a/libraries/botbuilder/src/cloudAdapter.ts +++ b/libraries/botbuilder/src/cloudAdapter.ts @@ -236,7 +236,7 @@ export class CloudAdapter extends CloudAdapterBase implements BotFrameworkHttpAd * @internal */ class StreamingRequestHandler extends RequestHandler { - public server?: IStreamingTransportServer; + server?: IStreamingTransportServer; // Note: `processActivity` lambda is to work around the fact that CloudAdapterBase#processActivity // is protected, and we can't get around that by defining classes inside of other classes diff --git a/libraries/botbuilder/src/eventFactory.ts b/libraries/botbuilder/src/eventFactory.ts index 941aaaa27a..25b4b5244b 100644 --- a/libraries/botbuilder/src/eventFactory.ts +++ b/libraries/botbuilder/src/eventFactory.ts @@ -30,7 +30,7 @@ export class EventFactory { * @param transcript Transcript of the conversation. * @returns The handoff event activity. */ - public static createHandoffInitiation( + static createHandoffInitiation( context: TurnContext, handoffContext: T, transcript?: Transcript @@ -71,7 +71,7 @@ export class EventFactory { * @param message Additional message for failed handoff. * @returns The handoff event activity. */ - public static createHandoffStatus(conversation: ConversationAccount, state: string, message?: string): Activity { + static createHandoffStatus(conversation: ConversationAccount, state: string, message?: string): Activity { if (!conversation) { throw new TypeError('EventFactory.createHandoffStatus(): missing conversation.'); } diff --git a/libraries/botbuilder/src/fileTranscriptStore.ts b/libraries/botbuilder/src/fileTranscriptStore.ts index 9f4b5269a9..a721049f39 100644 --- a/libraries/botbuilder/src/fileTranscriptStore.ts +++ b/libraries/botbuilder/src/fileTranscriptStore.ts @@ -118,7 +118,7 @@ export class FileTranscriptStore implements TranscriptStore { * @param activity Activity being logged. * @returns {Promise} a promise representing the asynchronous operation. */ - public async logActivity(activity: Activity): Promise { + async logActivity(activity: Activity): Promise { if (!activity) { throw new Error('activity cannot be null for logActivity()'); } @@ -138,7 +138,7 @@ export class FileTranscriptStore implements TranscriptStore { * @param startDate (Optional) Earliest time to include. * @returns {Promise>} PagedResult of activities. */ - public async getTranscriptActivities( + async getTranscriptActivities( channelId: string, conversationId: string, continuationToken?: string, @@ -189,7 +189,7 @@ export class FileTranscriptStore implements TranscriptStore { * @param continuationToken (Optional) Continuation token to page through results. * @returns {Promise>} PagedResult of transcripts. */ - public async listTranscripts(channelId: string, continuationToken?: string): Promise> { + async listTranscripts(channelId: string, continuationToken?: string): Promise> { if (!channelId) { throw new Error('Missing channelId'); } @@ -221,7 +221,7 @@ export class FileTranscriptStore implements TranscriptStore { * @param conversationId Id of the conversation to delete. * @returns {Promise} A promise representing the asynchronous operation. */ - public async deleteTranscript(channelId: string, conversationId: string): Promise { + async deleteTranscript(channelId: string, conversationId: string): Promise { if (!channelId) { throw new Error('Missing channelId'); } diff --git a/libraries/botbuilder/src/handoffEventNames.ts b/libraries/botbuilder/src/handoffEventNames.ts index fd65510221..da4b6a8a09 100644 --- a/libraries/botbuilder/src/handoffEventNames.ts +++ b/libraries/botbuilder/src/handoffEventNames.ts @@ -7,7 +7,7 @@ * Defines values for handoff event names. */ export class HandoffEventNames { - public static readonly InitiateHandoff: string = 'handoff.initiate'; + static readonly InitiateHandoff: string = 'handoff.initiate'; - public static readonly HandoffStatus: string = 'handoff.status'; + static readonly HandoffStatus: string = 'handoff.status'; } diff --git a/libraries/botbuilder/src/inspectionMiddleware.ts b/libraries/botbuilder/src/inspectionMiddleware.ts index b3af0b721c..344584b4a7 100644 --- a/libraries/botbuilder/src/inspectionMiddleware.ts +++ b/libraries/botbuilder/src/inspectionMiddleware.ts @@ -23,7 +23,7 @@ import { teamsGetTeamId } from './teamsActivityHelpers'; /** @private */ class TraceActivity { - public static makeCommandActivity(command: string): Partial { + static makeCommandActivity(command: string): Partial { return { type: ActivityTypes.Trace, timestamp: new Date(), @@ -34,7 +34,7 @@ class TraceActivity { }; } - public static fromActivity(activity: Activity | Partial, name: string, label: string): Partial { + static fromActivity(activity: Activity | Partial, name: string, label: string): Partial { return { type: ActivityTypes.Trace, timestamp: new Date(), @@ -45,7 +45,7 @@ class TraceActivity { }; } - public static fromState(botState: BotState): Partial { + static fromState(botState: BotState): Partial { return { type: ActivityTypes.Trace, timestamp: new Date(), @@ -56,7 +56,7 @@ class TraceActivity { }; } - public static fromConversationReference(conversationReference: Partial): Partial { + static fromConversationReference(conversationReference: Partial): Partial { return { type: ActivityTypes.Trace, timestamp: new Date(), @@ -67,7 +67,7 @@ class TraceActivity { }; } - public static fromError(errorMessage: string): Partial { + static fromError(errorMessage: string): Partial { return { type: ActivityTypes.Trace, timestamp: new Date(), @@ -87,7 +87,7 @@ abstract class InterceptionMiddleware implements Middleware { * @param turnContext {TurnContext} An incoming TurnContext object. * @param next {function} The next delegate function. */ - public async onTurn(turnContext: TurnContext, next: () => Promise): Promise { + async onTurn(turnContext: TurnContext, next: () => Promise): Promise { const { shouldForwardToApplication, shouldIntercept } = await this.invokeInbound( turnContext, TraceActivity.fromActivity(turnContext.activity, 'ReceivedActivity', 'Received Activity') @@ -210,7 +210,7 @@ export class InspectionMiddleware extends InterceptionMiddleware { * @param turnContext The [TurnContext](xref:botbuilder-core.TurnContext) for this turn. * @returns True if the command is open or attached, otherwise false. */ - public async processCommand(turnContext: TurnContext): Promise { + async processCommand(turnContext: TurnContext): Promise { if (turnContext.activity.type == ActivityTypes.Message && turnContext.activity.text !== undefined) { const originalText = turnContext.activity.text; TurnContext.removeRecipientMention(turnContext.activity); @@ -417,7 +417,7 @@ class InspectionSession { this.connectorClient = new ConnectorClient(credentials, { baseUri: conversationReference.serviceUrl }); } - public async send(activity: Partial): Promise { + async send(activity: Partial): Promise { TurnContext.applyConversationReference(activity, this.conversationReference); try { @@ -432,11 +432,11 @@ class InspectionSession { /** @private */ class InspectionSessionsByStatus { - public static DefaultValue: InspectionSessionsByStatus = new InspectionSessionsByStatus(); + static DefaultValue: InspectionSessionsByStatus = new InspectionSessionsByStatus(); - public openedSessions: { [id: string]: Partial } = {}; + openedSessions: { [id: string]: Partial } = {}; - public attachedSessions: { [id: string]: Partial } = {}; + attachedSessions: { [id: string]: Partial } = {}; } /** diff --git a/libraries/botbuilder/src/routeConstants.ts b/libraries/botbuilder/src/routeConstants.ts index 0bbd7583bc..476924973e 100644 --- a/libraries/botbuilder/src/routeConstants.ts +++ b/libraries/botbuilder/src/routeConstants.ts @@ -17,45 +17,45 @@ export class RouteConstants { /** * Base API path for bot conversations. */ - public static readonly Conversations: string = '/v3/conversations'; + static readonly Conversations: string = '/v3/conversations'; /** * API path for conversation history. */ - public static readonly ConversationHistory: string = '/v3/conversations/:conversationId/activities/history'; + static readonly ConversationHistory: string = '/v3/conversations/:conversationId/activities/history'; /** * API path for all conversation members. */ - public static readonly ConversationMembers: string = '/v3/conversations/:conversationId/members'; + static readonly ConversationMembers: string = '/v3/conversations/:conversationId/members'; /** * API path for page(s) of all conversation members. */ - public static readonly ConversationPagedMembers: string = '/v3/conversations/:conversationId/pagedmembers'; + static readonly ConversationPagedMembers: string = '/v3/conversations/:conversationId/pagedmembers'; /** * API path for single conversation member. */ - public static readonly ConversationMember: string = '/v3/conversations/:conversationId/members/:memberId'; + static readonly ConversationMember: string = '/v3/conversations/:conversationId/members/:memberId'; /** * API path for conversation attachments. */ - public static readonly Attachments: string = '/v3/conversations/:conversationId/attachments'; + static readonly Attachments: string = '/v3/conversations/:conversationId/attachments'; /** * API path for all activities from conversation. */ - public static readonly Activities: string = '/v3/conversations/:conversationId/activities'; + static readonly Activities: string = '/v3/conversations/:conversationId/activities'; /** * API path for single activity from conversation. */ - public static readonly Activity: string = '/v3/conversations/:conversationId/activities/:activityId'; + static readonly Activity: string = '/v3/conversations/:conversationId/activities/:activityId'; /** * API path for all members from activity from conversation. */ - public static readonly ActivityMembers: string = '/v3/conversations/:conversationId/activities/:activityId/members'; + static readonly ActivityMembers: string = '/v3/conversations/:conversationId/activities/:activityId/members'; } diff --git a/libraries/botbuilder/src/skills/cloudSkillHandler.ts b/libraries/botbuilder/src/skills/cloudSkillHandler.ts index db0586dda5..75195a74a1 100644 --- a/libraries/botbuilder/src/skills/cloudSkillHandler.ts +++ b/libraries/botbuilder/src/skills/cloudSkillHandler.ts @@ -21,7 +21,7 @@ export class CloudSkillHandler extends CloudChannelServiceHandler { /** * Used to access the CovnersationReference sent from the Skill to the Parent. */ - public readonly SkillConversationReferenceKey = SkillConversationReferenceKey; + readonly SkillConversationReferenceKey = SkillConversationReferenceKey; // Delegate that implements actual logic private readonly inner: SkillHandlerImpl; @@ -34,7 +34,7 @@ export class CloudSkillHandler extends CloudChannelServiceHandler { * @param conversationIdFactory A SkillConversationIdFactoryBase to unpack the conversation ID and map it to the calling bot. * @param auth Bot Framework Authentication to use */ - public constructor( + constructor( adapter: BotAdapter, logic: (context: TurnContext) => Promise, conversationIdFactory: SkillConversationIdFactoryBase, diff --git a/libraries/botbuilder/src/skills/skillHandler.ts b/libraries/botbuilder/src/skills/skillHandler.ts index 7c736ed433..df81af5eb8 100644 --- a/libraries/botbuilder/src/skills/skillHandler.ts +++ b/libraries/botbuilder/src/skills/skillHandler.ts @@ -33,7 +33,7 @@ export class SkillHandler extends ChannelServiceHandler { * @remarks * The value is the same as the SkillConversationReferenceKey exported from botbuilder-core. */ - public readonly SkillConversationReferenceKey = SkillConversationReferenceKey; + readonly SkillConversationReferenceKey = SkillConversationReferenceKey; // Delegate that implements actual logic private readonly inner: SkillHandlerImpl; @@ -48,7 +48,7 @@ export class SkillHandler extends ChannelServiceHandler { * @param authConfig The authentication configuration. * @param channelService The string indicating if the bot is working in Public Azure or in Azure Government (https://aka.ms/AzureGovDocs). */ - public constructor( + constructor( adapter: BotAdapter, bot: ActivityHandlerBase, conversationIdFactory: SkillConversationIdFactoryBase, diff --git a/libraries/botbuilder/src/skills/skillHttpClient.ts b/libraries/botbuilder/src/skills/skillHttpClient.ts index c196329fe9..28c74bcb66 100644 --- a/libraries/botbuilder/src/skills/skillHttpClient.ts +++ b/libraries/botbuilder/src/skills/skillHttpClient.ts @@ -35,7 +35,7 @@ export class SkillHttpClient extends BotFrameworkHttpClient { * @param conversationIdFactory An instance of a class derived from [SkillConversationIdFactoryBase](xref:botbuilder-core.SkillConversationIdFactoryBase). * @param channelService Optional. The channel service. */ - public constructor( + constructor( credentialProvider: ICredentialProvider, conversationIdFactory: SkillConversationIdFactoryBase, channelService?: string @@ -58,7 +58,7 @@ export class SkillHttpClient extends BotFrameworkHttpClient { * @param callbackUrl The callback Url for the skill host. * @param activity The activity to send. */ - public async postToSkill( + async postToSkill( originatingAudience: string, fromBotId: string, toSkill: BotFrameworkSkill, @@ -74,7 +74,7 @@ export class SkillHttpClient extends BotFrameworkHttpClient { * @param callbackUrl The callback Url for the skill host. * @param activity The activity to send. */ - public async postToSkill( + async postToSkill( fromBotId: string, toSkill: BotFrameworkSkill, callbackUrl: string, @@ -90,7 +90,7 @@ export class SkillHttpClient extends BotFrameworkHttpClient { * @param activityToForward Optional. The [Activity](xref:botframework-schema.Activity) to forward. * @returns A `Promise` representing the [InvokeResponse](xref:botbuilder-core.InvokeResponse) for the operation. */ - public async postToSkill( + async postToSkill( audienceOrFromBotId: string, fromBotIdOrSkill: string | BotFrameworkSkill, toSkillOrCallbackUrl: BotFrameworkSkill | string, diff --git a/libraries/botbuilder/src/statusCodeError.ts b/libraries/botbuilder/src/statusCodeError.ts index febf106094..9c2e59d0d5 100644 --- a/libraries/botbuilder/src/statusCodeError.ts +++ b/libraries/botbuilder/src/statusCodeError.ts @@ -18,7 +18,7 @@ export class StatusCodeError extends Error { * @param statusCode The status code. * @param message Optional. The error message. */ - public constructor(public readonly statusCode: StatusCodes, message?: string) { + constructor(public readonly statusCode: StatusCodes, message?: string) { super(message); this.name = 'StatusCodeError'; diff --git a/libraries/botbuilder/src/streaming/streamingHttpClient.ts b/libraries/botbuilder/src/streaming/streamingHttpClient.ts index 26ed8ec167..53dbf3d664 100644 --- a/libraries/botbuilder/src/streaming/streamingHttpClient.ts +++ b/libraries/botbuilder/src/streaming/streamingHttpClient.ts @@ -20,7 +20,7 @@ export class StreamingHttpClient implements HttpClient { * * @param server Transport server implementation to be used. */ - public constructor(server: IStreamingTransportServer) { + constructor(server: IStreamingTransportServer) { if (!server) { throw new Error('StreamingHttpClient: Expected server.'); } @@ -35,7 +35,7 @@ export class StreamingHttpClient implements HttpClient { * @param httpRequest The outgoing request created by the BotframeworkAdapter. * @returns The streaming transport compatible response to send back to the client. */ - public async sendRequest(httpRequest: WebResource): Promise { + async sendRequest(httpRequest: WebResource): Promise { if (!httpRequest) { throw new Error('StreamingHttpClient.sendRequest(): missing "httpRequest" parameter'); } diff --git a/libraries/botbuilder/src/streaming/tokenResolver.ts b/libraries/botbuilder/src/streaming/tokenResolver.ts index c6c6e51883..0464b8244a 100644 --- a/libraries/botbuilder/src/streaming/tokenResolver.ts +++ b/libraries/botbuilder/src/streaming/tokenResolver.ts @@ -37,7 +37,7 @@ export class TokenResolver { * @param activity The [Activity](xref:botframework-schema.Activity) to be checked. * @param log Optional. The log to write on. */ - public static checkForOAuthCards( + static checkForOAuthCards( adapter: BotFrameworkAdapter, context: TurnContext, activity: Activity, diff --git a/libraries/botbuilder/src/teamsActivityHandler.ts b/libraries/botbuilder/src/teamsActivityHandler.ts index 6b5b3e00ce..f5233e2d06 100644 --- a/libraries/botbuilder/src/teamsActivityHandler.ts +++ b/libraries/botbuilder/src/teamsActivityHandler.ts @@ -796,7 +796,7 @@ export class TeamsActivityHandler extends ActivityHandler { * @param handler A callback to handle the teams members added event. * @returns A promise that represents the work queued. */ - public onTeamsMembersAddedEvent( + onTeamsMembersAddedEvent( handler: ( membersAdded: TeamsChannelAccount[], teamInfo: TeamInfo, @@ -817,7 +817,7 @@ export class TeamsActivityHandler extends ActivityHandler { * @param handler A callback to handle the teams members removed event. * @returns A promise that represents the work queued. */ - public onTeamsMembersRemovedEvent( + onTeamsMembersRemovedEvent( handler: ( membersRemoved: TeamsChannelAccount[], teamInfo: TeamInfo, @@ -837,7 +837,7 @@ export class TeamsActivityHandler extends ActivityHandler { * @param handler A callback to handle the teams channel created event. * @returns A promise that represents the work queued. */ - public onTeamsChannelCreatedEvent( + onTeamsChannelCreatedEvent( handler: ( channelInfo: ChannelInfo, teamInfo: TeamInfo, @@ -857,7 +857,7 @@ export class TeamsActivityHandler extends ActivityHandler { * @param handler A callback to handle the teams channel deleted event. * @returns A promise that represents the work queued. */ - public onTeamsChannelDeletedEvent( + onTeamsChannelDeletedEvent( handler: ( channelInfo: ChannelInfo, teamInfo: TeamInfo, @@ -877,7 +877,7 @@ export class TeamsActivityHandler extends ActivityHandler { * @param handler A callback to handle the teams channel renamed event. * @returns A promise that represents the work queued. */ - public onTeamsChannelRenamedEvent( + onTeamsChannelRenamedEvent( handler: ( channelInfo: ChannelInfo, teamInfo: TeamInfo, @@ -897,7 +897,7 @@ export class TeamsActivityHandler extends ActivityHandler { * @param handler A callback to handle the teams team archived event. * @returns A promise that represents the work queued. */ - public onTeamsTeamArchivedEvent( + onTeamsTeamArchivedEvent( handler: (teamInfo: TeamInfo, context: TurnContext, next: () => Promise) => Promise ): this { return this.on('TeamsTeamArchived', async (context, next) => { @@ -912,7 +912,7 @@ export class TeamsActivityHandler extends ActivityHandler { * @param handler A callback to handle the teams team deleted event. * @returns A promise that represents the work queued. */ - public onTeamsTeamDeletedEvent( + onTeamsTeamDeletedEvent( handler: (teamInfo: TeamInfo, context: TurnContext, next: () => Promise) => Promise ): this { return this.on('TeamsTeamDeleted', async (context, next) => { @@ -927,7 +927,7 @@ export class TeamsActivityHandler extends ActivityHandler { * @param handler A callback to handle the teams team hard deleted event. * @returns A promise that represents the work queued. */ - public onTeamsTeamHardDeletedEvent( + onTeamsTeamHardDeletedEvent( handler: (teamInfo: TeamInfo, context: TurnContext, next: () => Promise) => Promise ): this { return this.on('TeamsTeamHardDeleted', async (context, next) => { @@ -942,7 +942,7 @@ export class TeamsActivityHandler extends ActivityHandler { * @param handler A callback to handle the teams channel restored event. * @returns A promise that represents the work queued. */ - public onTeamsChannelRestoredEvent( + onTeamsChannelRestoredEvent( handler: ( channelInfo: ChannelInfo, teamInfo: TeamInfo, @@ -962,7 +962,7 @@ export class TeamsActivityHandler extends ActivityHandler { * @param handler A callback to handle the teams team renamed event. * @returns A promise that represents the work queued. */ - public onTeamsTeamRenamedEvent( + onTeamsTeamRenamedEvent( handler: (teamInfo: TeamInfo, context: TurnContext, next: () => Promise) => Promise ): this { return this.on('TeamsTeamRenamed', async (context, next) => { @@ -977,7 +977,7 @@ export class TeamsActivityHandler extends ActivityHandler { * @param handler A callback to handle the teams team restored event. * @returns A promise that represents the work queued. */ - public onTeamsTeamRestoredEvent( + onTeamsTeamRestoredEvent( handler: (teamInfo: TeamInfo, context: TurnContext, next: () => Promise) => Promise ): this { return this.on('TeamsTeamRestored', async (context, next) => { @@ -992,7 +992,7 @@ export class TeamsActivityHandler extends ActivityHandler { * @param handler A callback to handle the teams team unarchived event. * @returns A promise that represents the work queued. */ - public onTeamsTeamUnarchivedEvent( + onTeamsTeamUnarchivedEvent( handler: (teamInfo: TeamInfo, context: TurnContext, next: () => Promise) => Promise ): this { return this.on('TeamsTeamUnarchived', async (context, next) => { @@ -1054,7 +1054,7 @@ export class TeamsActivityHandler extends ActivityHandler { * @param handler A callback that handles Meeting Start events. * @returns A promise that represents the work queued. */ - public onTeamsMeetingStartEvent( + onTeamsMeetingStartEvent( handler: (meeting: MeetingStartEventDetails, context: TurnContext, next: () => Promise) => Promise ): this { return this.on('TeamsMeetingStart', async (context, next) => { @@ -1079,7 +1079,7 @@ export class TeamsActivityHandler extends ActivityHandler { * @param handler A callback that handles Meeting End events. * @returns A promise that represents the work queued. */ - public onTeamsMeetingEndEvent( + onTeamsMeetingEndEvent( handler: (meeting: MeetingEndEventDetails, context: TurnContext, next: () => Promise) => Promise ): this { return this.on('TeamsMeetingEnd', async (context, next) => { diff --git a/libraries/botbuilder/src/teamsInfo.ts b/libraries/botbuilder/src/teamsInfo.ts index 5106a68c70..303070466b 100644 --- a/libraries/botbuilder/src/teamsInfo.ts +++ b/libraries/botbuilder/src/teamsInfo.ts @@ -43,7 +43,7 @@ export class TeamsInfo { * @param tenantId The tenant ID to use when scoping the request * @returns The [TeamsMeetingParticipant](xref:botbuilder-core.TeamsMeetingParticipant) fetched */ - public static async getMeetingParticipant( + static async getMeetingParticipant( context: TurnContext, meetingId?: string, participantId?: string, @@ -92,7 +92,7 @@ export class TeamsInfo { * @param meetingId The BASE64-encoded id of the Teams meeting. * @returns The [TeamsMeetingInfo](xref:botbuilder-core.TeamsMeetingInfo) fetched */ - public static async getMeetingInfo(context: TurnContext, meetingId?: string): Promise { + static async getMeetingInfo(context: TurnContext, meetingId?: string): Promise { if (!context) { throw new Error('context is required.'); } @@ -118,7 +118,7 @@ export class TeamsInfo { * @param teamId The id of the Teams team. * @returns The [TeamDetails](xref:botbuilder-core.TeamDetails) fetched */ - public static async getTeamDetails(context: TurnContext, teamId?: string): Promise { + static async getTeamDetails(context: TurnContext, teamId?: string): Promise { const t = teamId || this.getTeamId(context); if (!t) { throw new Error('This method is only valid within the scope of a MS Teams Team.'); @@ -136,7 +136,7 @@ export class TeamsInfo { * @param botAppId The bot's appId. This is only used when context.adapter is an instance of CloudAdapter. * @returns The [ConversationReference](xref:botframework-schema.ConversationReference) and the id of the [Activity](xref:botframework-schema.Activity) (if sent). */ - public static async sendMessageToTeamsChannel( + static async sendMessageToTeamsChannel( context: TurnContext, activity: Activity, teamsChannelId: string, @@ -199,7 +199,7 @@ export class TeamsInfo { * @param teamId ID of the Teams team. * @returns The list of [ChannelInfo](xref:botframework-schema.ChannelInfo) objects with the conversations. */ - public static async getTeamChannels(context: TurnContext, teamId?: string): Promise { + static async getTeamChannels(context: TurnContext, teamId?: string): Promise { const t = teamId || this.getTeamId(context); if (!t) { throw new Error('This method is only valid within the scope of a MS Teams Team.'); @@ -217,7 +217,7 @@ export class TeamsInfo { * * @deprecated Use `getPagedTeamMembers` instead. */ - public static async getMembers(context: TurnContext): Promise { + static async getMembers(context: TurnContext): Promise { const teamId = this.getTeamId(context); if (teamId) { return await this.getTeamMembers(context, teamId); @@ -236,7 +236,7 @@ export class TeamsInfo { * @param continuationToken A continuation token. * @returns The [TeamsPagedMembersResult](xref:botframework-schema.TeamsPagedMembersResult) with the list of members. */ - public static async getPagedMembers( + static async getPagedMembers( context: TurnContext, pageSize?: number, continuationToken?: string @@ -262,7 +262,7 @@ export class TeamsInfo { * @param userId ID of the user in question. * @returns The [TeamsChannelAccount](xref:botframework-schema.TeamsChannelAccount) of the member. */ - public static async getMember(context: TurnContext, userId: string): Promise { + static async getMember(context: TurnContext, userId: string): Promise { const teamId = this.getTeamId(context); if (teamId) { return await this.getTeamMember(context, teamId, userId); @@ -282,7 +282,7 @@ export class TeamsInfo { * * @deprecated Use `getPagedTeamMembers` instead. */ - public static async getTeamMembers(context: TurnContext, teamId?: string): Promise { + static async getTeamMembers(context: TurnContext, teamId?: string): Promise { const t = teamId || this.getTeamId(context); if (!t) { throw new Error('This method is only valid within the scope of a MS Teams Team.'); @@ -299,7 +299,7 @@ export class TeamsInfo { * @param continuationToken The continuationToken token. * @returns A [TeamsPagedMembersResult](xref:botframework-schema.TeamsPagedMembersResult) with the list of members. */ - public static async getPagedTeamMembers( + static async getPagedTeamMembers( context: TurnContext, teamId?: string, pageSize?: number, @@ -325,7 +325,7 @@ export class TeamsInfo { * @param userId ID of the Teams user. * @returns The [TeamsChannelAccount](xref:botframework-schema.TeamsChannelAccount) of the member. */ - public static async getTeamMember( + static async getTeamMember( context: TurnContext, teamId?: string, userId?: string