@microsoft/teamsfx 2.0.1-alpha.ba6cc7dba.0 → 2.0.1-alpha.f43656338.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -929,6 +929,8 @@ const defaultSQLScope = "https://database.windows.net/";
929
929
  /**
930
930
  * Generate connection configuration consumed by tedious.
931
931
  *
932
+ * @deprecated we recommend you compose your own Tedious configuration for better flexibility.
933
+ *
932
934
  * @param {TeamsFx} teamsfx - Used to provide configuration and auth
933
935
  * @param { string? } databaseName - specify database name to override default one if there are multiple databases.
934
936
  *
@@ -2441,8 +2443,17 @@ function getTargetType(conversationReference) {
2441
2443
  * @internal
2442
2444
  */
2443
2445
  function getTeamsBotInstallationId(context) {
2444
- var _a, _b, _c, _d;
2445
- return (_d = (_c = (_b = (_a = context.activity) === null || _a === void 0 ? void 0 : _a.channelData) === null || _b === void 0 ? void 0 : _b.team) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : context.activity.conversation.id;
2446
+ var _a, _b, _c;
2447
+ const teamId = (_c = (_b = (_a = context.activity) === null || _a === void 0 ? void 0 : _a.channelData) === null || _b === void 0 ? void 0 : _b.team) === null || _c === void 0 ? void 0 : _c.id;
2448
+ if (teamId) {
2449
+ return teamId;
2450
+ }
2451
+ // Fallback to use conversation id.
2452
+ // the conversation id is equal to team id only when the bot app is installed into the General channel.
2453
+ if (context.activity.conversation.name === undefined) {
2454
+ return context.activity.conversation.id;
2455
+ }
2456
+ return undefined;
2446
2457
  }
2447
2458
 
2448
2459
  // Copyright (c) Microsoft Corporation.
@@ -3137,6 +3148,7 @@ class NotificationBot {
3137
3148
  }
3138
3149
  /**
3139
3150
  * Returns the first {@link Channel} where predicate is true, and undefined otherwise.
3151
+ * (Ensure the bot app is installed into the `General` channel, otherwise undefined will be returned.)
3140
3152
  *
3141
3153
  * @param predicate find calls predicate once for each channel of the installation,
3142
3154
  * until it finds one where predicate returns true. If such a channel is found, find
@@ -3183,6 +3195,7 @@ class NotificationBot {
3183
3195
  }
3184
3196
  /**
3185
3197
  * Returns all {@link Channel} where predicate is true, and empty array otherwise.
3198
+ * (Ensure the bot app is installed into the `General` channel, otherwise empty array will be returned.)
3186
3199
  *
3187
3200
  * @param predicate find calls predicate for each channel of the installation.
3188
3201
  * @returns an array of {@link Channel} where predicate is true, and empty array otherwise.