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-dialogs-adaptive - Part 1 #4221

Merged
merged 2 commits into from
Jun 16, 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
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,21 @@ export class ActionScope<O extends object = {}>
*
* @param actions The actions for the scope.
*/
public constructor(actions: Dialog[] = []) {
constructor(actions: Dialog[] = []) {
super();
this.actions = actions;
}

/**
* The actions to execute.
*/
public actions: Dialog[] = [];
actions: Dialog[] = [];

/**
* @param property The key of the conditional selector configuration.
* @returns The converter for the selector configuration.
*/
public getConverter(property: keyof ActionScopeConfiguration): Converter | ConverterFactory {
getConverter(property: keyof ActionScopeConfiguration): Converter | ConverterFactory {
switch (property) {
case 'actions':
return DialogListConverter;
Expand All @@ -78,7 +78,7 @@ export class ActionScope<O extends object = {}>
* @returns Unique `string` which should only change when dialog has changed in a
* way that should restart the dialog.
*/
public getVersion(): string {
getVersion(): string {
const versions = this.actions.map((action): string => action.getVersion() || '').join('');
return StringUtils.hash(versions);
}
Expand All @@ -88,7 +88,7 @@ export class ActionScope<O extends object = {}>
*
* @returns The child [Dialog](xref:botbuilder-dialogs.Dialog) dependencies.
*/
public getDependencies(): Dialog[] {
getDependencies(): Dialog[] {
return this.actions;
}

Expand All @@ -99,7 +99,7 @@ export class ActionScope<O extends object = {}>
* @param _options Optional. Initial information to pass to the dialog.
* @returns A `Promise` representing the asynchronous operation.
*/
public async beginDialog(dc: DialogContext, _options?: O): Promise<DialogTurnResult> {
async beginDialog(dc: DialogContext, _options?: O): Promise<DialogTurnResult> {
if (this.actions && this.actions.length > 0) {
return await this.beginAction(dc, 0);
} else {
Expand All @@ -114,7 +114,7 @@ export class ActionScope<O extends object = {}>
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation.
* @returns A `Promise` representing the asynchronous operation.
*/
public async continueDialog(dc: DialogContext): Promise<DialogTurnResult> {
async continueDialog(dc: DialogContext): Promise<DialogTurnResult> {
return await this.onNextAction(dc);
}

Expand All @@ -127,7 +127,7 @@ export class ActionScope<O extends object = {}>
* of the value returned is dependent on the child dialog.
* @returns A `Promise` representing the asynchronous operation.
*/
public async resumeDialog(dc: DialogContext, _reason: DialogReason, result?: any): Promise<DialogTurnResult> {
async resumeDialog(dc: DialogContext, _reason: DialogReason, result?: any): Promise<DialogTurnResult> {
if (result && typeof result === 'object' && Object.hasOwnProperty.call(result, 'actionScopeCommand')) {
return await this.onActionScopeResult(dc, result as ActionScopeResult);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class BaseInvokeDialog<O extends object = {}>
* @param dialogIdToCall The dialog id.
* @param bindingOptions (optional) Binding options.
*/
public constructor(dialogIdToCall?: string, bindingOptions?: O) {
constructor(dialogIdToCall?: string, bindingOptions?: O) {
super();
if (dialogIdToCall) {
this.dialog = new DialogExpression(dialogIdToCall);
Expand All @@ -58,23 +58,23 @@ export class BaseInvokeDialog<O extends object = {}>
/**
* Configurable options for the dialog.
*/
public options: ObjectExpression<object> = new ObjectExpression<object>();
options: ObjectExpression<object> = new ObjectExpression<object>();

/**
* The dialog to call.
*/
public dialog: DialogExpression;
dialog: DialogExpression;

/**
* A value indicating whether to have the new dialog should process the activity.
*/
public activityProcessed: BoolExpression = new BoolExpression(true);
activityProcessed: BoolExpression = new BoolExpression(true);

/**
* @param property The key of the conditional selector configuration.
* @returns The converter for the selector configuration.
*/
public getConverter(property: keyof BaseInvokeDialogConfiguration): Converter | ConverterFactory {
getConverter(property: keyof BaseInvokeDialogConfiguration): Converter | ConverterFactory {
switch (property) {
case 'options':
return new ObjectExpressionConverter<object>();
Expand All @@ -94,7 +94,7 @@ export class BaseInvokeDialog<O extends object = {}>
* @param _dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation.
* @param _options Optional. Initial information to pass to the dialog.
*/
public beginDialog(_dc: DialogContext, _options?: O): Promise<DialogTurnResult<any>> {
beginDialog(_dc: DialogContext, _options?: O): Promise<DialogTurnResult<any>> {
throw new Error('Method not implemented.');
}

Expand All @@ -103,7 +103,7 @@ export class BaseInvokeDialog<O extends object = {}>
*
* @returns The child [Dialog](xref:botbuilder-dialogs.Dialog) dependencies.
*/
public getDependencies(): Dialog<{}>[] {
getDependencies(): Dialog<{}>[] {
if (this.dialog && this.dialog.value) {
return [this.dialog.value];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,41 +33,41 @@ export interface BeginDialogConfiguration extends BaseInvokeDialogConfiguration
* Action which begins executing another [Dialog](xref:botbuilder-dialogs.Dialog), when it is done, it will return to the caller.
*/
export class BeginDialog<O extends object = {}> extends BaseInvokeDialog<O> implements BeginDialogConfiguration {
public static $kind = 'Microsoft.BeginDialog';
static $kind = 'Microsoft.BeginDialog';

/**
* Creates a new `BeginDialog` instance.
*
* @param dialogIdToCall ID of the dialog to call.
* @param options (Optional) static options to pass the called dialog.
*/
public constructor(dialogIdToCall: string, options?: O);
constructor(dialogIdToCall: string, options?: O);

/**
* Creates a new [BeginDialog](xref:botbuilder-dialogs-adaptive.BeginDialog) instance.
*
* @param dialogIdToCall Optional. ID of the [Dialog](xref:botbuilder-dialogs.Dialog) to call.
* @param options Optional. Static options to pass the called dialog.
*/
public constructor(dialogIdToCall?: string, options?: O) {
constructor(dialogIdToCall?: string, options?: O) {
super(dialogIdToCall, options);
}

/**
* (Optional) property path to store the dialog result in.
*/
public resultProperty?: StringExpression;
resultProperty?: StringExpression;

/**
* An optional expression which if is true will disable this action.
*/
public disabled?: BoolExpression;
disabled?: BoolExpression;

/**
* @param property The key of the conditional selector configuration.
* @returns The converter for the selector configuration.
*/
public getConverter(property: keyof BeginDialogConfiguration): Converter | ConverterFactory {
getConverter(property: keyof BeginDialogConfiguration): Converter | ConverterFactory {
switch (property) {
case 'resultProperty':
return new StringExpressionConverter();
Expand All @@ -85,7 +85,7 @@ export class BeginDialog<O extends object = {}> extends BaseInvokeDialog<O> impl
* @param options Optional. Initial information to pass to the dialog.
* @returns A `Promise` representing the asynchronous operation.
*/
public async beginDialog(dc: DialogContext, options?: O): Promise<DialogTurnResult> {
async beginDialog(dc: DialogContext, options?: O): Promise<DialogTurnResult> {
if (this.disabled && this.disabled.getValue(dc.state)) {
return await dc.endDialog();
}
Expand All @@ -109,7 +109,7 @@ export class BeginDialog<O extends object = {}> extends BaseInvokeDialog<O> impl
* of the value returned is dependent on the child dialog.
* @returns A `Promise` representing the asynchronous operation.
*/
public async resumeDialog(dc: DialogContext, reason: DialogReason, result: any = null): Promise<DialogTurnResult> {
async resumeDialog(dc: DialogContext, reason: DialogReason, result: any = null): Promise<DialogTurnResult> {
if (this.resultProperty) {
dc.state.setValue(this.resultProperty.getValue(dc.state), result);
}
Expand Down
34 changes: 17 additions & 17 deletions libraries/botbuilder-dialogs-adaptive/src/actions/beginSkill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ export interface BeginSkillConfiguration extends DialogConfiguration {
* Begin a Skill.
*/
export class BeginSkill extends SkillDialog implements BeginSkillConfiguration {
public static $kind = 'Microsoft.BeginSkill';
static $kind = 'Microsoft.BeginSkill';

/**
* Optional expression which if is true will disable this action.
*/
public disabled?: BoolExpression;
disabled?: BoolExpression;

/**
* Value indicating whether the new dialog should process the activity.
Expand All @@ -68,59 +68,59 @@ export class BeginSkill extends SkillDialog implements BeginSkillConfiguration {
* The default for this will be true, which means the new dialog should not look at the activity.
* You can set this to false to dispatch the activity to the new dialog.
*/
public activityProcessed = new BoolExpression(true);
activityProcessed = new BoolExpression(true);

/**
* Optional property path to store the dialog result in.
*/
public resultProperty?: StringExpression;
resultProperty?: StringExpression;

/**
* The Microsoft App ID that will be calling the skill.
*
* @remarks
* Defauls to a value of `=settings.MicrosoftAppId` which retrievs the bots ID from settings.
*/
public botId = new StringExpression('=settings.MicrosoftAppId');
botId = new StringExpression('=settings.MicrosoftAppId');

/**
* The callback Url for the skill host.
*
* @remarks
* Defauls to a value of `=settings.SkillHostEndpoint` which retrieves the endpoint from settings.
*/
public skillHostEndpoint = new StringExpression('=settings.SkillHostEndpoint');
skillHostEndpoint = new StringExpression('=settings.SkillHostEndpoint');

/**
* The Microsoft App ID for the skill.
*/
public skillAppId: StringExpression;
skillAppId: StringExpression;

/**
* The `/api/messages` endpoint for the skill.
*/
public skillEndpoint: StringExpression;
skillEndpoint: StringExpression;

/**
* Template for the activity.
*/
public activity: TemplateInterface<Partial<Activity>, DialogStateManager>;
activity: TemplateInterface<Partial<Activity>, DialogStateManager>;

/**
* Optional. The OAuth Connection Name for the Parent Bot.
*/
public connectionName: StringExpression;
connectionName: StringExpression;

/**
* The interruption policy.
*/
public allowInterruptions: BoolExpression;
allowInterruptions: BoolExpression;

/**
* @param property The key of the conditional selector configuration.
* @returns The converter for the selector configuration.
*/
public getConverter(property: keyof BeginSkillConfiguration): Converter | ConverterFactory {
getConverter(property: keyof BeginSkillConfiguration): Converter | ConverterFactory {
switch (property) {
case 'disabled':
return new BoolExpressionConverter();
Expand Down Expand Up @@ -166,7 +166,7 @@ export class BeginSkill extends SkillDialog implements BeginSkillConfiguration {
* @param options Optional. Initial information to pass to the dialog.
* @returns A `Promise` representing the asynchronous operation.
*/
public async beginDialog(dc: DialogContext, options?: BeginSkillDialogOptions): Promise<DialogTurnResult> {
async beginDialog(dc: DialogContext, options?: BeginSkillDialogOptions): Promise<DialogTurnResult> {
const dcState = dc.state;
if (this.disabled && this.disabled.getValue(dcState)) {
return await dc.endDialog();
Expand Down Expand Up @@ -234,7 +234,7 @@ export class BeginSkill extends SkillDialog implements BeginSkillConfiguration {
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation.
* @returns A `Promise` representing the asynchronous operation.
*/
public async continueDialog(dc: DialogContext): Promise<DialogTurnResult> {
async continueDialog(dc: DialogContext): Promise<DialogTurnResult> {
this.loadDialogOptions(dc.context, dc.activeDialog);
const activity = dc.context.activity;
if (activity.type == ActivityTypes.EndOfConversation) {
Expand All @@ -255,7 +255,7 @@ export class BeginSkill extends SkillDialog implements BeginSkillConfiguration {
* @param instance [DialogInstance](xref:botbuilder-dialogs.DialogInstance), state information for this dialog.
* @returns A `Promise` representing the asynchronous operation.
*/
public async repromptDialog(turnContext: TurnContext, instance: DialogInstance): Promise<void> {
async repromptDialog(turnContext: TurnContext, instance: DialogInstance): Promise<void> {
this.loadDialogOptions(turnContext, instance);
return await super.repromptDialog(turnContext, instance);
}
Expand All @@ -269,7 +269,7 @@ export class BeginSkill extends SkillDialog implements BeginSkillConfiguration {
* of the value returned is dependent on the child dialog.
* @returns A `Promise` representing the asynchronous operation.
*/
public async resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult<any>> {
async resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult<any>> {
this.loadDialogOptions(dc.context, dc.activeDialog);
return await super.resumeDialog(dc, reason, result);
}
Expand All @@ -282,7 +282,7 @@ export class BeginSkill extends SkillDialog implements BeginSkillConfiguration {
* @param reason [DialogReason](xref:botbuilder-dialogs.DialogReason), reason why the dialog ended.
* @returns A `Promise` representing the asynchronous operation.
*/
public async endDialog(turnContext: TurnContext, instance: DialogInstance, reason: DialogReason): Promise<void> {
async endDialog(turnContext: TurnContext, instance: DialogInstance, reason: DialogReason): Promise<void> {
this.loadDialogOptions(turnContext, instance);
return await super.endDialog(turnContext, instance, reason);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ export interface BreakLoopConfiguration extends DialogConfiguration {
* Break out of a loop.
*/
export class BreakLoop<O extends object = {}> extends Dialog<O> implements BreakLoopConfiguration {
public static $kind = 'Microsoft.BreakLoop';
static $kind = 'Microsoft.BreakLoop';

/**
* An optional expression which if is true will disable this action.
*/
public disabled?: BoolExpression;
disabled?: BoolExpression;

/**
* @param property The key of the conditional selector configuration.
* @returns The converter for the selector configuration.
*/
public getConverter(property: keyof BreakLoopConfiguration): Converter | ConverterFactory {
getConverter(property: keyof BreakLoopConfiguration): Converter | ConverterFactory {
switch (property) {
case 'disabled':
return new BoolExpressionConverter();
Expand All @@ -53,7 +53,7 @@ export class BreakLoop<O extends object = {}> extends Dialog<O> implements Break
* @param _options Optional. Initial information to pass to the dialog.
* @returns A `Promise` representing the asynchronous operation.
*/
public async beginDialog(dc: DialogContext, _options?: O): Promise<DialogTurnResult> {
async beginDialog(dc: DialogContext, _options?: O): Promise<DialogTurnResult> {
if (this.disabled && this.disabled.getValue(dc.state)) {
return await dc.endDialog();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@ import { CancelAllDialogsBase } from './cancelAllDialogsBase';
* Command to cancel all of the current [Dialogs](xref:botbuilder-dialogs.Dialog) by emitting an event that must be caught to prevent cancellation from propagating.
*/
export class CancelAllDialogs<O extends object = {}> extends CancelAllDialogsBase<O> {
public static $kind = 'Microsoft.CancelAllDialogs';
static $kind = 'Microsoft.CancelAllDialogs';

public constructor();
constructor();

/**
* Initializes a new instance of the [CancelAllDialogs](xref:botbuilder-dialogs-adaptive.CancelAllDialogs) class.
*
* @param eventName Expression for event name.
* @param eventValue Optional. Expression for event value.
*/
public constructor(eventName: string, eventValue?: string);
constructor(eventName: string, eventValue?: string);

/**
* Initializes a new instance of the [CancelAllDialogs](xref:botbuilder-dialogs-adaptive.CancelAllDialogs) class.
*
* @param eventName Optional. Expression for event name.
* @param eventValue Optional. Expression for event value.
*/
public constructor(eventName?: string, eventValue?: string) {
constructor(eventName?: string, eventValue?: string) {
super(eventName, eventValue, true);
}
}
Loading