Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: [#3518] Remove public access modifier from botbuilder #4215

Merged
merged 2 commits into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 44 additions & 44 deletions libraries/botbuilder/src/botFrameworkAdapter.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions libraries/botbuilder/src/botFrameworkHttpClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand All @@ -63,7 +63,7 @@ export class BotFrameworkHttpClient implements BotFrameworkClient {
* @param activity Activity to forward.
* @returns {Promise<InvokeResponse<T>>} A promise representing the asynchronous operation.
*/
public async postActivity<T = any>(
async postActivity<T = any>(
fromBotId: string,
toBotId: string,
toUrl: string,
Expand Down
24 changes: 12 additions & 12 deletions libraries/botbuilder/src/channelServiceHandlerBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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<void> {
async handleDeleteActivity(authHeader: string, conversationId: string, activityId: string): Promise<void> {
const claimsIdentity = await this.authenticate(authHeader);
await this.onDeleteActivity(claimsIdentity, conversationId, activityId);
}
Expand All @@ -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
Expand All @@ -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<ConversationResourceResponse> {
Expand All @@ -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 */
Expand All @@ -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<ChannelAccount[]> {
async handleGetConversationMembers(authHeader: string, conversationId: string): Promise<ChannelAccount[]> {
const claimsIdentity = await this.authenticate(authHeader);
return this.onGetConversationMembers(claimsIdentity, conversationId);
}
Expand All @@ -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,
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion libraries/botbuilder/src/channelServiceRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion libraries/botbuilder/src/cloudAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions libraries/botbuilder/src/eventFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class EventFactory {
* @param transcript Transcript of the conversation.
* @returns The handoff event activity.
*/
public static createHandoffInitiation<T = unknown>(
static createHandoffInitiation<T = unknown>(
context: TurnContext,
handoffContext: T,
transcript?: Transcript
Expand Down Expand Up @@ -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.');
}
Expand Down
8 changes: 4 additions & 4 deletions libraries/botbuilder/src/fileTranscriptStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class FileTranscriptStore implements TranscriptStore {
* @param activity Activity being logged.
* @returns {Promise<void>} a promise representing the asynchronous operation.
*/
public async logActivity(activity: Activity): Promise<void> {
async logActivity(activity: Activity): Promise<void> {
if (!activity) {
throw new Error('activity cannot be null for logActivity()');
}
Expand All @@ -138,7 +138,7 @@ export class FileTranscriptStore implements TranscriptStore {
* @param startDate (Optional) Earliest time to include.
* @returns {Promise<PagedResult<Activity>>} PagedResult of activities.
*/
public async getTranscriptActivities(
async getTranscriptActivities(
channelId: string,
conversationId: string,
continuationToken?: string,
Expand Down Expand Up @@ -189,7 +189,7 @@ export class FileTranscriptStore implements TranscriptStore {
* @param continuationToken (Optional) Continuation token to page through results.
* @returns {Promise<PagedResult<TranscriptInfo>>} PagedResult of transcripts.
*/
public async listTranscripts(channelId: string, continuationToken?: string): Promise<PagedResult<TranscriptInfo>> {
async listTranscripts(channelId: string, continuationToken?: string): Promise<PagedResult<TranscriptInfo>> {
if (!channelId) {
throw new Error('Missing channelId');
}
Expand Down Expand Up @@ -221,7 +221,7 @@ export class FileTranscriptStore implements TranscriptStore {
* @param conversationId Id of the conversation to delete.
* @returns {Promise<void>} A promise representing the asynchronous operation.
*/
public async deleteTranscript(channelId: string, conversationId: string): Promise<void> {
async deleteTranscript(channelId: string, conversationId: string): Promise<void> {
if (!channelId) {
throw new Error('Missing channelId');
}
Expand Down
4 changes: 2 additions & 2 deletions libraries/botbuilder/src/handoffEventNames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
22 changes: 11 additions & 11 deletions libraries/botbuilder/src/inspectionMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { teamsGetTeamId } from './teamsActivityHelpers';

/** @private */
class TraceActivity {
public static makeCommandActivity(command: string): Partial<Activity> {
static makeCommandActivity(command: string): Partial<Activity> {
return {
type: ActivityTypes.Trace,
timestamp: new Date(),
Expand All @@ -34,7 +34,7 @@ class TraceActivity {
};
}

public static fromActivity(activity: Activity | Partial<Activity>, name: string, label: string): Partial<Activity> {
static fromActivity(activity: Activity | Partial<Activity>, name: string, label: string): Partial<Activity> {
return {
type: ActivityTypes.Trace,
timestamp: new Date(),
Expand All @@ -45,7 +45,7 @@ class TraceActivity {
};
}

public static fromState(botState: BotState): Partial<Activity> {
static fromState(botState: BotState): Partial<Activity> {
return {
type: ActivityTypes.Trace,
timestamp: new Date(),
Expand All @@ -56,7 +56,7 @@ class TraceActivity {
};
}

public static fromConversationReference(conversationReference: Partial<ConversationReference>): Partial<Activity> {
static fromConversationReference(conversationReference: Partial<ConversationReference>): Partial<Activity> {
return {
type: ActivityTypes.Trace,
timestamp: new Date(),
Expand All @@ -67,7 +67,7 @@ class TraceActivity {
};
}

public static fromError(errorMessage: string): Partial<Activity> {
static fromError(errorMessage: string): Partial<Activity> {
return {
type: ActivityTypes.Trace,
timestamp: new Date(),
Expand All @@ -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<void>): Promise<void> {
async onTurn(turnContext: TurnContext, next: () => Promise<void>): Promise<void> {
const { shouldForwardToApplication, shouldIntercept } = await this.invokeInbound(
turnContext,
TraceActivity.fromActivity(turnContext.activity, 'ReceivedActivity', 'Received Activity')
Expand Down Expand Up @@ -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<any> {
async processCommand(turnContext: TurnContext): Promise<any> {
if (turnContext.activity.type == ActivityTypes.Message && turnContext.activity.text !== undefined) {
const originalText = turnContext.activity.text;
TurnContext.removeRecipientMention(turnContext.activity);
Expand Down Expand Up @@ -417,7 +417,7 @@ class InspectionSession {
this.connectorClient = new ConnectorClient(credentials, { baseUri: conversationReference.serviceUrl });
}

public async send(activity: Partial<Activity>): Promise<any> {
async send(activity: Partial<Activity>): Promise<any> {
TurnContext.applyConversationReference(activity, this.conversationReference);

try {
Expand All @@ -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<ConversationReference> } = {};
openedSessions: { [id: string]: Partial<ConversationReference> } = {};

public attachedSessions: { [id: string]: Partial<ConversationReference> } = {};
attachedSessions: { [id: string]: Partial<ConversationReference> } = {};
}

/**
Expand Down
18 changes: 9 additions & 9 deletions libraries/botbuilder/src/routeConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
4 changes: 2 additions & 2 deletions libraries/botbuilder/src/skills/cloudSkillHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<void>,
conversationIdFactory: SkillConversationIdFactoryBase,
Expand Down
4 changes: 2 additions & 2 deletions libraries/botbuilder/src/skills/skillHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down
Loading