From 474455b6daed704575d664c5809c66308bf6c99b Mon Sep 17 00:00:00 2001 From: Joel Mut Date: Tue, 11 Feb 2025 10:49:37 +0000 Subject: [PATCH 1/3] Fix config options type to support process.env --- .../src/configurationBotFrameworkAuthentication.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/botbuilder-core/src/configurationBotFrameworkAuthentication.ts b/libraries/botbuilder-core/src/configurationBotFrameworkAuthentication.ts index f6053ff236..9fb154fd79 100644 --- a/libraries/botbuilder-core/src/configurationBotFrameworkAuthentication.ts +++ b/libraries/botbuilder-core/src/configurationBotFrameworkAuthentication.ts @@ -115,7 +115,10 @@ const TypedOptions = z /** * Contains settings used to configure a [ConfigurationBotFrameworkAuthentication](xref:botbuilder-core.ConfigurationBotFrameworkAuthentication) instance. */ -export type ConfigurationBotFrameworkAuthenticationOptions = z.infer; +export interface ConfigurationBotFrameworkAuthenticationOptions extends z.infer { + [key: string]: string | boolean | undefined; +} + /** * Creates a [BotFrameworkAuthentication](xref:botframework-connector.BotFrameworkAuthentication) instance from an object with the authentication values or a [Configuration](xref:botbuilder-dialogs-adaptive-runtime-core.Configuration) instance. From ecbe9ab27e399b23d34192b71ebcf9e242a6c90e Mon Sep 17 00:00:00 2001 From: Joel Mut Date: Tue, 11 Feb 2025 13:39:46 +0000 Subject: [PATCH 2/3] Fix eslint --- .../etc/botbuilder-core.api.md | 25 ++++++++++++++----- ...configurationBotFrameworkAuthentication.ts | 5 ++-- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/libraries/botbuilder-core/etc/botbuilder-core.api.md b/libraries/botbuilder-core/etc/botbuilder-core.api.md index cde4b222af..465a927960 100644 --- a/libraries/botbuilder-core/etc/botbuilder-core.api.md +++ b/libraries/botbuilder-core/etc/botbuilder-core.api.md @@ -343,7 +343,13 @@ export class ComponentRegistration { // @public export class ConfigurationBotFrameworkAuthentication extends BotFrameworkAuthentication { - constructor(botFrameworkAuthConfig?: ConfigurationBotFrameworkAuthenticationOptions, credentialsFactory?: ServiceClientCredentialsFactory, authConfiguration?: AuthenticationConfiguration, botFrameworkClientFetch?: (input: RequestInfo, init?: RequestInit) => Promise, connectorClientOptions?: ConnectorClientOptions); + constructor( + botFrameworkAuthConfig?: ConfigurationBotFrameworkAuthenticationOptions, + credentialsFactory?: ServiceClientCredentialsFactory, + authConfiguration?: AuthenticationConfiguration, + botFrameworkClientFetch?: (input: RequestInfo, init?: RequestInit) => Promise, + connectorClientOptions?: ConnectorClientOptions, + ); authenticateChannelRequest(authHeader: string): Promise; authenticateRequest(activity: Activity, authHeader: string): Promise; authenticateStreamingRequest(authHeader: string, channelIdHeader: string): Promise; @@ -355,7 +361,10 @@ export class ConfigurationBotFrameworkAuthentication extends BotFrameworkAuthent // Warning: (ae-forgotten-export) The symbol "TypedOptions" needs to be exported by the entry point index.d.ts // // @public -export type ConfigurationBotFrameworkAuthenticationOptions = z.infer; +export interface ConfigurationBotFrameworkAuthenticationOptions extends z.infer { + // (undocumented) + [key: string]: string | boolean | undefined; +} // @public export class ConfigurationServiceClientCredentialFactory extends PasswordServiceClientCredentialFactory { @@ -391,7 +400,13 @@ export interface CoreAppCredentials { } // @public -export function createBotFrameworkAuthenticationFromConfiguration(configuration: Configuration, credentialsFactory?: ServiceClientCredentialsFactory, authConfiguration?: AuthenticationConfiguration, botFrameworkClientFetch?: (input: RequestInfo, init?: RequestInit) => Promise, connectorClientOptions?: ConnectorClientOptions): BotFrameworkAuthentication; +export function createBotFrameworkAuthenticationFromConfiguration( +configuration: Configuration, +credentialsFactory?: ServiceClientCredentialsFactory, +authConfiguration?: AuthenticationConfiguration, +botFrameworkClientFetch?: (input: RequestInfo, init?: RequestInit) => Promise, +connectorClientOptions?: ConnectorClientOptions, +): BotFrameworkAuthentication; // @public export function createServiceClientCredentialFactoryFromConfiguration(configuration: Configuration): ConfigurationServiceClientCredentialFactory; @@ -570,9 +585,6 @@ export enum Severity { Warning = 2 } -// @public (undocumented) -export const sharePointTokenExchange = "cardExtension/token"; - // @public export class ShowTypingMiddleware implements Middleware { constructor(delay?: number, period?: number); @@ -627,6 +639,7 @@ 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; } diff --git a/libraries/botbuilder-core/src/configurationBotFrameworkAuthentication.ts b/libraries/botbuilder-core/src/configurationBotFrameworkAuthentication.ts index 9fb154fd79..abffe2954f 100644 --- a/libraries/botbuilder-core/src/configurationBotFrameworkAuthentication.ts +++ b/libraries/botbuilder-core/src/configurationBotFrameworkAuthentication.ts @@ -112,14 +112,15 @@ const TypedOptions = z }) .partial(); +type ZodOptions = z.infer; + /** * Contains settings used to configure a [ConfigurationBotFrameworkAuthentication](xref:botbuilder-core.ConfigurationBotFrameworkAuthentication) instance. */ -export interface ConfigurationBotFrameworkAuthenticationOptions extends z.infer { +export interface ConfigurationBotFrameworkAuthenticationOptions extends ZodOptions { [key: string]: string | boolean | undefined; } - /** * Creates a [BotFrameworkAuthentication](xref:botframework-connector.BotFrameworkAuthentication) instance from an object with the authentication values or a [Configuration](xref:botbuilder-dialogs-adaptive-runtime-core.Configuration) instance. */ From bf47c1f10ffba72bd87b871fd5c275249b63db2d Mon Sep 17 00:00:00 2001 From: Joel Mut Date: Tue, 11 Feb 2025 14:24:54 +0000 Subject: [PATCH 3/3] Fix test:compat --- .../etc/botbuilder-core.api.md | 24 ++++++------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/libraries/botbuilder-core/etc/botbuilder-core.api.md b/libraries/botbuilder-core/etc/botbuilder-core.api.md index 465a927960..389ba8fe85 100644 --- a/libraries/botbuilder-core/etc/botbuilder-core.api.md +++ b/libraries/botbuilder-core/etc/botbuilder-core.api.md @@ -343,13 +343,7 @@ export class ComponentRegistration { // @public export class ConfigurationBotFrameworkAuthentication extends BotFrameworkAuthentication { - constructor( - botFrameworkAuthConfig?: ConfigurationBotFrameworkAuthenticationOptions, - credentialsFactory?: ServiceClientCredentialsFactory, - authConfiguration?: AuthenticationConfiguration, - botFrameworkClientFetch?: (input: RequestInfo, init?: RequestInit) => Promise, - connectorClientOptions?: ConnectorClientOptions, - ); + constructor(botFrameworkAuthConfig?: ConfigurationBotFrameworkAuthenticationOptions, credentialsFactory?: ServiceClientCredentialsFactory, authConfiguration?: AuthenticationConfiguration, botFrameworkClientFetch?: (input: RequestInfo, init?: RequestInit) => Promise, connectorClientOptions?: ConnectorClientOptions); authenticateChannelRequest(authHeader: string): Promise; authenticateRequest(activity: Activity, authHeader: string): Promise; authenticateStreamingRequest(authHeader: string, channelIdHeader: string): Promise; @@ -358,10 +352,10 @@ export class ConfigurationBotFrameworkAuthentication extends BotFrameworkAuthent createUserTokenClient(claimsIdentity: ClaimsIdentity): Promise; } -// Warning: (ae-forgotten-export) The symbol "TypedOptions" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "ZodOptions" needs to be exported by the entry point index.d.ts // // @public -export interface ConfigurationBotFrameworkAuthenticationOptions extends z.infer { +export interface ConfigurationBotFrameworkAuthenticationOptions extends ZodOptions { // (undocumented) [key: string]: string | boolean | undefined; } @@ -400,13 +394,7 @@ export interface CoreAppCredentials { } // @public -export function createBotFrameworkAuthenticationFromConfiguration( -configuration: Configuration, -credentialsFactory?: ServiceClientCredentialsFactory, -authConfiguration?: AuthenticationConfiguration, -botFrameworkClientFetch?: (input: RequestInfo, init?: RequestInit) => Promise, -connectorClientOptions?: ConnectorClientOptions, -): BotFrameworkAuthentication; +export function createBotFrameworkAuthenticationFromConfiguration(configuration: Configuration, credentialsFactory?: ServiceClientCredentialsFactory, authConfiguration?: AuthenticationConfiguration, botFrameworkClientFetch?: (input: RequestInfo, init?: RequestInit) => Promise, connectorClientOptions?: ConnectorClientOptions): BotFrameworkAuthentication; // @public export function createServiceClientCredentialFactoryFromConfiguration(configuration: Configuration): ConfigurationServiceClientCredentialFactory; @@ -585,6 +573,9 @@ export enum Severity { Warning = 2 } +// @public (undocumented) +export const sharePointTokenExchange = "cardExtension/token"; + // @public export class ShowTypingMiddleware implements Middleware { constructor(delay?: number, period?: number); @@ -639,7 +630,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; }