Skip to content

Commit

Permalink
Cleanup types for Teams config fetch & submit
Browse files Browse the repository at this point in the history
  • Loading branch information
Corina Gum committed Nov 14, 2023
1 parent e0e656b commit be3010e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
14 changes: 3 additions & 11 deletions libraries/botbuilder/src/teamsActivityHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
import {
ActivityHandler,
AppBasedLinkQuery,
BotConfigAuth,
ChannelInfo,
Channels,
ConfigResponse,
ConfigTaskResponse,
FileConsentCardResponse,
InvokeResponse,
MeetingEndEventDetails,
MeetingParticipantsEventDetails,
MeetingStartEventDetails,
MessagingExtensionAction,
MessagingExtensionActionResponse,
Expand All @@ -35,7 +34,6 @@ import {
tokenExchangeOperationName,
TurnContext,
verifyStateOperationName,
MeetingParticipantsEventDetails,
} from 'botbuilder-core';
import { ReadReceiptInfo } from 'botframework-connector';
import { TeamsInfo } from './teamsInfo';
Expand Down Expand Up @@ -212,10 +210,7 @@ export class TeamsActivityHandler extends ActivityHandler {
* @param _configData The object representing the configuration.
* @returns A Config Response for the activity.
*/
protected async handleTeamsConfigFetch(
_context: TurnContext,
_configData: any
): Promise<ConfigResponse<BotConfigAuth | ConfigTaskResponse>> {
protected async handleTeamsConfigFetch(_context: TurnContext, _configData: any): Promise<ConfigResponse> {
throw new Error('NotImplemented');
}

Expand All @@ -226,10 +221,7 @@ export class TeamsActivityHandler extends ActivityHandler {
* @param _configData The object representing the configuration.
* @returns A Config Response for the activity.
*/
protected async handleTeamsConfigSubmit(
_context: TurnContext,
_configData: any
): Promise<ConfigResponse<BotConfigAuth | ConfigTaskResponse>> {
protected async handleTeamsConfigSubmit(_context: TurnContext, _configData: any): Promise<ConfigResponse> {
throw new Error('NotImplemented');
}

Expand Down
12 changes: 4 additions & 8 deletions libraries/botframework-schema/src/teams/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@ export interface BotConfigAuth {
type: 'auth';
}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface ConfigAuthResponse extends ConfigResponse<BotConfigAuth> {}
export type ConfigResponseConfig = BotConfigAuth | TaskModuleResponse;

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface ConfigTaskResponse extends ConfigResponse<TaskModuleResponse> {}
/**
* @interface
* An interface representing ChannelInfo.
Expand All @@ -53,16 +50,15 @@ export interface ChannelInfo {
* @interface
* An interface container for the Config response payload
*/
export interface ConfigResponse<T> {
export interface ConfigResponse {
/**
* @member {CacheInfo} [cacheInfo] The data of the ConfigResponse cache, including cache type and cache duration.
*/
cacheInfo?: CacheInfo;
/**
* @template T
* @member {T} [config] The response to a configuration message.
* @member {ConfigResponseConfig} [config] The ConfigResponse config of BotConfigAuth or TaskModuleResponse
*/
config: T;
config: ConfigResponseConfig;
/**
* @member {string} [responseType] The type of response 'config'.
*/
Expand Down

0 comments on commit be3010e

Please sign in to comment.