From c70d169c9834821ca1c429a1db8511d9c7c1927f Mon Sep 17 00:00:00 2001 From: JhontSouth Date: Fri, 2 Feb 2024 13:35:05 -0500 Subject: [PATCH 1/2] include optional properties in channelAccount --- .../src/connectorApi/models/mappers.ts | 11 +++++++++++ libraries/botframework-schema/src/index.ts | 7 ++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/libraries/botframework-connector/src/connectorApi/models/mappers.ts b/libraries/botframework-connector/src/connectorApi/models/mappers.ts index 559bb2a97b..31f81d6df9 100644 --- a/libraries/botframework-connector/src/connectorApi/models/mappers.ts +++ b/libraries/botframework-connector/src/connectorApi/models/mappers.ts @@ -158,6 +158,17 @@ export const ChannelAccount: CompositeMapper = { type: { name: "String" } + }, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { + type: { + name: "any" + } + } + } } } } diff --git a/libraries/botframework-schema/src/index.ts b/libraries/botframework-schema/src/index.ts index 019813f808..2abf95a3af 100644 --- a/libraries/botframework-schema/src/index.ts +++ b/libraries/botframework-schema/src/index.ts @@ -155,6 +155,11 @@ export interface ChannelAccount { * 'user', 'bot', 'skill' */ role?: RoleTypes | string; + + /** + * Properties not represented in a defined type + */ + properties: { [key: string]: any }; } const channelAccount = z.object({ @@ -2456,7 +2461,7 @@ export interface SearchInvokeOptions { * Name of 'application/search'. */ // eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface SearchInvokeResponse extends AdaptiveCardInvokeResponse {} +export interface SearchInvokeResponse extends AdaptiveCardInvokeResponse { } /** * Represents a response returned by a bot when it receives an `invoke` activity. From 5935599312e0a11fc7704905484c7d6d6682301a Mon Sep 17 00:00:00 2001 From: JhontSouth Date: Fri, 2 Feb 2024 14:27:13 -0500 Subject: [PATCH 2/2] use object type for properties --- .../src/connectorApi/models/mappers.ts | 7 +------ .../botframework-schema/etc/botframework-schema.api.md | 1 + libraries/botframework-schema/src/index.ts | 6 +++--- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/libraries/botframework-connector/src/connectorApi/models/mappers.ts b/libraries/botframework-connector/src/connectorApi/models/mappers.ts index 31f81d6df9..b6b104410b 100644 --- a/libraries/botframework-connector/src/connectorApi/models/mappers.ts +++ b/libraries/botframework-connector/src/connectorApi/models/mappers.ts @@ -162,12 +162,7 @@ export const ChannelAccount: CompositeMapper = { properties: { serializedName: "properties", type: { - name: "Dictionary", - value: { - type: { - name: "any" - } - } + name: "Object" } } } diff --git a/libraries/botframework-schema/etc/botframework-schema.api.md b/libraries/botframework-schema/etc/botframework-schema.api.md index f790bdef6c..f41816f47e 100644 --- a/libraries/botframework-schema/etc/botframework-schema.api.md +++ b/libraries/botframework-schema/etc/botframework-schema.api.md @@ -579,6 +579,7 @@ export interface ChannelAccount { aadObjectId?: string; id: string; name: string; + properties?: any; role?: RoleTypes | string; } diff --git a/libraries/botframework-schema/src/index.ts b/libraries/botframework-schema/src/index.ts index 2abf95a3af..f98e101ec7 100644 --- a/libraries/botframework-schema/src/index.ts +++ b/libraries/botframework-schema/src/index.ts @@ -157,9 +157,9 @@ export interface ChannelAccount { role?: RoleTypes | string; /** - * Properties not represented in a defined type + * Custom properties object (optional) */ - properties: { [key: string]: any }; + properties?: any; // eslint-disable-line @typescript-eslint/no-explicit-any } const channelAccount = z.object({ @@ -2461,7 +2461,7 @@ export interface SearchInvokeOptions { * Name of 'application/search'. */ // eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface SearchInvokeResponse extends AdaptiveCardInvokeResponse { } +export interface SearchInvokeResponse extends AdaptiveCardInvokeResponse {} /** * Represents a response returned by a bot when it receives an `invoke` activity.