@microsoft/teamsfx 2.2.3-alpha.9b38c38b5.0 → 2.2.3-alpha.a2e05e20c.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.
@@ -441,8 +441,8 @@ class AppCredential {
441
441
  * @remarks
442
442
  * Only works in in server side.
443
443
  */
444
- async getToken(scopes, options) {
445
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "AppCredential"), ErrorCode.RuntimeNotSupported);
444
+ getToken(scopes, options) {
445
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "AppCredential"), ErrorCode.RuntimeNotSupported));
446
446
  }
447
447
  }
448
448
 
@@ -462,8 +462,8 @@ class OnBehalfOfUserCredential {
462
462
  * @remarks
463
463
  * Can only be used in server side.
464
464
  */
465
- async getToken(scopes, options) {
466
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "OnBehalfOfUserCredential"), ErrorCode.RuntimeNotSupported);
465
+ getToken(scopes, options) {
466
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "OnBehalfOfUserCredential"), ErrorCode.RuntimeNotSupported));
467
467
  }
468
468
  /**
469
469
  * Get basic user info from SSO token.
@@ -471,7 +471,7 @@ class OnBehalfOfUserCredential {
471
471
  * Can only be used in server side.
472
472
  */
473
473
  getUserInfo() {
474
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "OnBehalfOfUserCredential"), ErrorCode.RuntimeNotSupported);
474
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "OnBehalfOfUserCredential"), ErrorCode.RuntimeNotSupported));
475
475
  }
476
476
  }
477
477
 
@@ -524,7 +524,7 @@ class TeamsUserCredential {
524
524
  let result;
525
525
  try {
526
526
  const params = {
527
- url: `${this.config.initiateLoginEndpoint}?clientId=${this.config.clientId}&scope=${encodeURI(scopesStr)}&loginHint=${this.loginHint}`,
527
+ url: `${this.config.initiateLoginEndpoint ? this.config.initiateLoginEndpoint : ""}?clientId=${this.config.clientId ? this.config.clientId : ""}&scope=${encodeURI(scopesStr)}&loginHint=${this.loginHint ? this.loginHint : ""}`,
528
528
  width: loginPageWidth,
529
529
  height: loginPageHeight,
530
530
  };
@@ -788,8 +788,10 @@ class TeamsUserCredential {
788
788
 
789
789
  // Copyright (c) Microsoft Corporation.
790
790
  const defaultScope = "https://graph.microsoft.com/.default";
791
+ // eslint-disable-next-line no-secrets/no-secrets
791
792
  /**
792
793
  * Microsoft Graph auth provider for Teams Framework
794
+ * @deprecated Use `TokenCredentialAuthenticationProvider` from `@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials` instead.
793
795
  */
794
796
  class MsGraphAuthProvider {
795
797
  constructor(credentialOrTeamsFx, scopes) {
@@ -818,7 +820,7 @@ class MsGraphAuthProvider {
818
820
  *
819
821
  */
820
822
  async getAccessToken() {
821
- internalLogger.info(`Get Graph Access token with scopes: '${this.scopes}'`);
823
+ internalLogger.info(`Get Graph Access token with scopes: '${this.scopes.toString()}'`);
822
824
  let accessToken;
823
825
  if (this.credentialOrTeamsFx.getCredential) {
824
826
  accessToken = await this.credentialOrTeamsFx
@@ -844,6 +846,14 @@ class MsGraphAuthProvider {
844
846
  // Copyright (c) Microsoft Corporation.
845
847
  /**
846
848
  * Get Microsoft graph client.
849
+ * @deprecated Use `TokenCredentialAuthenticationProvider` and `Client.initWithMiddleware` instead.
850
+ * ```typescript
851
+ * const authProvider = new TokenCredentialAuthenticationProvider(credential, { scopes: scope });
852
+ * const graph = Client.initWithMiddleware({
853
+ * authProvider: authProvider,
854
+ * });
855
+ * ```
856
+ *
847
857
  * @example
848
858
  * Get Microsoft graph client by TokenCredential
849
859
  * ```typescript
@@ -901,6 +911,14 @@ function createMicrosoftGraphClient(teamsfx, scopes) {
901
911
  // eslint-disable-next-line no-secrets/no-secrets
902
912
  /**
903
913
  * Get Microsoft graph client.
914
+ * @deprecated Use `TokenCredentialAuthenticationProvider` and `Client.initWithMiddleware` instead.
915
+ * ```typescript
916
+ * const authProvider = new TokenCredentialAuthenticationProvider(credential, { scopes: scope });
917
+ * const graph = Client.initWithMiddleware({
918
+ * authProvider: authProvider,
919
+ * });
920
+ * ```
921
+ *
904
922
  * @example
905
923
  * Get Microsoft graph client by TokenCredential
906
924
  * ```typescript
@@ -968,8 +986,8 @@ function createMicrosoftGraphClientWithCredential(credential, scopes) {
968
986
  * @remarks
969
987
  * Only works in in server side.
970
988
  */
971
- async function getTediousConnectionConfig(teamsfx, databaseName) {
972
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultTediousConnectionConfiguration"), ErrorCode.RuntimeNotSupported);
989
+ function getTediousConnectionConfig(teamsfx, databaseName) {
990
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultTediousConnectionConfiguration"), ErrorCode.RuntimeNotSupported));
973
991
  }
974
992
 
975
993
  // Copyright (c) Microsoft Corporation.
@@ -1050,8 +1068,8 @@ class TeamsBotSsoPrompt {
1050
1068
  *
1051
1069
  * @returns A `Promise` representing the asynchronous operation.
1052
1070
  */
1053
- async beginDialog(dc) {
1054
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotSsoPrompt"), ErrorCode.RuntimeNotSupported);
1071
+ beginDialog(dc) {
1072
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotSsoPrompt"), ErrorCode.RuntimeNotSupported));
1055
1073
  }
1056
1074
  /**
1057
1075
  * Called when a prompt dialog is the active dialog and the user replied with a new activity.
@@ -1069,8 +1087,8 @@ class TeamsBotSsoPrompt {
1069
1087
  * @throws {@link ErrorCode|ChannelNotSupported} when bot channel is not MS Teams.
1070
1088
  * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1071
1089
  */
1072
- async continueDialog(dc) {
1073
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotSsoPrompt"), ErrorCode.RuntimeNotSupported);
1090
+ continueDialog(dc) {
1091
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotSsoPrompt"), ErrorCode.RuntimeNotSupported));
1074
1092
  }
1075
1093
  }
1076
1094
 
@@ -1159,8 +1177,8 @@ class BasicAuthProvider {
1159
1177
  * @throws {@link ErrorCode|AuthorizationInfoAlreadyExists} - when Authorization header or auth property already exists in request configuration.
1160
1178
  * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1161
1179
  */
1162
- async AddAuthenticationInfo(config) {
1163
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "BasicAuthProvider"), ErrorCode.RuntimeNotSupported);
1180
+ AddAuthenticationInfo(config) {
1181
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "BasicAuthProvider"), ErrorCode.RuntimeNotSupported));
1164
1182
  }
1165
1183
  }
1166
1184
 
@@ -1192,8 +1210,8 @@ class ApiKeyProvider {
1192
1210
  * @throws {@link ErrorCode|AuthorizationInfoAlreadyExists} - when API key already exists in request header or url query parameter.
1193
1211
  * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1194
1212
  */
1195
- async AddAuthenticationInfo(config) {
1196
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "ApiKeyProvider"), ErrorCode.RuntimeNotSupported);
1213
+ AddAuthenticationInfo(config) {
1214
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "ApiKeyProvider"), ErrorCode.RuntimeNotSupported));
1197
1215
  }
1198
1216
  }
1199
1217
  /**
@@ -1234,8 +1252,8 @@ class CertificateAuthProvider {
1234
1252
  * @throws {@link ErrorCode|InvalidParameter} - when custom httpsAgent in the request has duplicate properties with certOption provided in constructor.
1235
1253
  * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1236
1254
  */
1237
- async AddAuthenticationInfo(config) {
1238
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CertificateAuthProvider"), ErrorCode.RuntimeNotSupported);
1255
+ AddAuthenticationInfo(config) {
1256
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CertificateAuthProvider"), ErrorCode.RuntimeNotSupported));
1239
1257
  }
1240
1258
  }
1241
1259
  /**
@@ -1290,6 +1308,8 @@ var IdentityType;
1290
1308
  // Copyright (c) Microsoft Corporation.
1291
1309
  /**
1292
1310
  * A class providing credential and configuration.
1311
+ * @deprecated Please use {@link TeamsUserCredential}
1312
+ * in browser environment and {@link OnBehalfOfUserCredential} or {@link AppCredential} in NodeJS.
1293
1313
  */
1294
1314
  class TeamsFx {
1295
1315
  constructor(identityType, customConfig) {
@@ -1477,7 +1497,7 @@ class ConversationBot$1 {
1477
1497
  * @remarks
1478
1498
  * Only work on server side.
1479
1499
  */
1480
- async requestHandler(req, res, logic) {
1500
+ requestHandler(req, res, logic) {
1481
1501
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "ConversationBot"), ErrorCode.RuntimeNotSupported);
1482
1502
  }
1483
1503
  }
@@ -1599,7 +1619,7 @@ class Channel$1 {
1599
1619
  * @param onError - an optional error handler that can catch exceptions during adaptive card sending.
1600
1620
  * @returns the response of sending adaptive card message.
1601
1621
  */
1602
- async sendAdaptiveCard(card, onError) {
1622
+ sendAdaptiveCard(card, onError) {
1603
1623
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Channel"), ErrorCode.RuntimeNotSupported);
1604
1624
  }
1605
1625
  }
@@ -1656,7 +1676,7 @@ class Member$1 {
1656
1676
  * @param onError - an optional error handler that can catch exceptions during adaptive card sending.
1657
1677
  * @returns the response of sending adaptive card message.
1658
1678
  */
1659
- async sendAdaptiveCard(card, onError) {
1679
+ sendAdaptiveCard(card, onError) {
1660
1680
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Member"), ErrorCode.RuntimeNotSupported);
1661
1681
  }
1662
1682
  }
@@ -1723,7 +1743,7 @@ class TeamsBotInstallation$1 {
1723
1743
  *
1724
1744
  * @returns an array of channels if bot is installed into a team, otherwise returns an empty array.
1725
1745
  */
1726
- async channels() {
1746
+ channels() {
1727
1747
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
1728
1748
  }
1729
1749
  /**
@@ -1734,7 +1754,7 @@ class TeamsBotInstallation$1 {
1734
1754
  *
1735
1755
  * @returns an array of members from where the bot is installed.
1736
1756
  */
1737
- async members() {
1757
+ members() {
1738
1758
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
1739
1759
  }
1740
1760
  /**
@@ -1742,7 +1762,7 @@ class TeamsBotInstallation$1 {
1742
1762
  *
1743
1763
  * @returns the team details if bot is installed into a team, otherwise returns undefined.
1744
1764
  */
1745
- async getTeamDetails() {
1765
+ getTeamDetails() {
1746
1766
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
1747
1767
  }
1748
1768
  }
@@ -1799,7 +1819,7 @@ class NotificationBot$1 {
1799
1819
  *
1800
1820
  * @returns - an array of {@link TeamsBotInstallation}.
1801
1821
  */
1802
- static async installations() {
1822
+ static installations() {
1803
1823
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1804
1824
  }
1805
1825
  /**
@@ -1815,7 +1835,7 @@ class NotificationBot$1 {
1815
1835
  * (personal chat, group chat, Teams channel).
1816
1836
  * @returns the first {@link Member} where predicate is true, and undefined otherwise.
1817
1837
  */
1818
- async findMember(predicate, scope) {
1838
+ findMember(predicate, scope) {
1819
1839
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1820
1840
  }
1821
1841
  /**
@@ -1830,7 +1850,7 @@ class NotificationBot$1 {
1830
1850
  * immediately returns that channel. Otherwise, find returns undefined.
1831
1851
  * @returns the first {@link Channel} where predicate is true, and undefined otherwise.
1832
1852
  */
1833
- async findChannel(predicate) {
1853
+ findChannel(predicate) {
1834
1854
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1835
1855
  }
1836
1856
  /**
@@ -1844,7 +1864,7 @@ class NotificationBot$1 {
1844
1864
  * (personal chat, group chat, Teams channel).
1845
1865
  * @returns an array of {@link Member} where predicate is true, and empty array otherwise.
1846
1866
  */
1847
- async findAllMembers(predicate, scope) {
1867
+ findAllMembers(predicate, scope) {
1848
1868
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1849
1869
  }
1850
1870
  /**
@@ -1857,7 +1877,7 @@ class NotificationBot$1 {
1857
1877
  * @param predicate find calls predicate for each channel of the installation.
1858
1878
  * @returns an array of {@link Channel} where predicate is true, and empty array otherwise.
1859
1879
  */
1860
- async findAllChannels(predicate) {
1880
+ findAllChannels(predicate) {
1861
1881
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1862
1882
  }
1863
1883
  }
@@ -1987,12 +2007,14 @@ class CardActionBot$1 {
1987
2007
  }
1988
2008
  }
1989
2009
 
2010
+ // eslint-disable-next-line no-secrets/no-secrets
1990
2011
  /**
1991
2012
  * Users execute query with SSO or Access Token.
2013
+ * @deprecated
1992
2014
  * @remarks
1993
2015
  * Only works in in server side.
1994
2016
  */
1995
- async function handleMessageExtensionQueryWithToken(context, config, scopes, logic) {
2017
+ function handleMessageExtensionQueryWithToken(context, config, scopes, logic) {
1996
2018
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "queryWithToken in message extension"), ErrorCode.RuntimeNotSupported);
1997
2019
  }
1998
2020
  /**
@@ -2000,7 +2022,7 @@ async function handleMessageExtensionQueryWithToken(context, config, scopes, log
2000
2022
  * @remarks
2001
2023
  * Only works in in server side.
2002
2024
  */
2003
- async function handleMessageExtensionQueryWithSSO(context, config, initiateLoginEndpoint, scopes, logic) {
2025
+ function handleMessageExtensionQueryWithSSO(context, config, initiateLoginEndpoint, scopes, logic) {
2004
2026
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "queryWithToken in message extension"), ErrorCode.RuntimeNotSupported);
2005
2027
  }
2006
2028
 
@@ -2035,8 +2057,8 @@ class ConversationBot {
2035
2057
  * @remarks
2036
2058
  * Only work on server side.
2037
2059
  */
2038
- async requestHandler(req, res, logic) {
2039
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "ConversationBot"), ErrorCode.RuntimeNotSupported);
2060
+ requestHandler(req, res, logic) {
2061
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "ConversationBot"), ErrorCode.RuntimeNotSupported));
2040
2062
  }
2041
2063
  }
2042
2064
 
@@ -2054,7 +2076,7 @@ class ConversationBot {
2054
2076
  * @returns A `Promise` representing the asynchronous operation.
2055
2077
  */
2056
2078
  function sendMessage(target, text, onError) {
2057
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "sendMessage"), ErrorCode.RuntimeNotSupported);
2079
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "sendMessage"), ErrorCode.RuntimeNotSupported));
2058
2080
  }
2059
2081
  /**
2060
2082
  * Send an adaptive card message to a notification target.
@@ -2069,7 +2091,7 @@ function sendMessage(target, text, onError) {
2069
2091
  * @returns A `Promise` representing the asynchronous operation.
2070
2092
  */
2071
2093
  function sendAdaptiveCard(target, card, onError) {
2072
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "sendAdaptiveCard"), ErrorCode.RuntimeNotSupported);
2094
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "sendAdaptiveCard"), ErrorCode.RuntimeNotSupported));
2073
2095
  }
2074
2096
  /**
2075
2097
  * A {@link NotificationTarget} that represents a team channel.
@@ -2113,7 +2135,7 @@ class Channel {
2113
2135
  * @returns The response of sending message.
2114
2136
  */
2115
2137
  sendMessage(text, onError) {
2116
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Channel"), ErrorCode.RuntimeNotSupported);
2138
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Channel"), ErrorCode.RuntimeNotSupported));
2117
2139
  }
2118
2140
  /**
2119
2141
  * Send an adaptive card message.
@@ -2126,8 +2148,8 @@ class Channel {
2126
2148
  *
2127
2149
  * @returns The response of sending adaptive card message.
2128
2150
  */
2129
- async sendAdaptiveCard(card, onError) {
2130
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Channel"), ErrorCode.RuntimeNotSupported);
2151
+ sendAdaptiveCard(card, onError) {
2152
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Channel"), ErrorCode.RuntimeNotSupported));
2131
2153
  }
2132
2154
  }
2133
2155
  /**
@@ -2172,7 +2194,7 @@ class Member {
2172
2194
  * @returns The response of sending message.
2173
2195
  */
2174
2196
  sendMessage(text, onError) {
2175
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Member"), ErrorCode.RuntimeNotSupported);
2197
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Member"), ErrorCode.RuntimeNotSupported));
2176
2198
  }
2177
2199
  /**
2178
2200
  * Send an adaptive card message.
@@ -2185,8 +2207,8 @@ class Member {
2185
2207
  *
2186
2208
  * @returns The response of sending adaptive card message.
2187
2209
  */
2188
- async sendAdaptiveCard(card, onError) {
2189
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Member"), ErrorCode.RuntimeNotSupported);
2210
+ sendAdaptiveCard(card, onError) {
2211
+ return Promise.reject(Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Member"), ErrorCode.RuntimeNotSupported)));
2190
2212
  }
2191
2213
  }
2192
2214
  /**
@@ -2227,7 +2249,7 @@ class TeamsBotInstallation {
2227
2249
  * @returns The response of sending message.
2228
2250
  */
2229
2251
  sendMessage(text, onError) {
2230
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
2252
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported));
2231
2253
  }
2232
2254
  /**
2233
2255
  * Send an adaptive card message.
@@ -2241,7 +2263,7 @@ class TeamsBotInstallation {
2241
2263
  * @returns The response of sending adaptive card message.
2242
2264
  */
2243
2265
  sendAdaptiveCard(card, onError) {
2244
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
2266
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported));
2245
2267
  }
2246
2268
  /**
2247
2269
  * Get channels from this bot installation.
@@ -2251,8 +2273,8 @@ class TeamsBotInstallation {
2251
2273
  *
2252
2274
  * @returns An array of channels if bot is installed into a team, otherwise returns an empty array.
2253
2275
  */
2254
- async channels() {
2255
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
2276
+ channels() {
2277
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported));
2256
2278
  }
2257
2279
  /**
2258
2280
  * Get members from this bot installation.
@@ -2262,16 +2284,16 @@ class TeamsBotInstallation {
2262
2284
  *
2263
2285
  * @returns An array of members from where the bot is installed.
2264
2286
  */
2265
- async members() {
2266
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
2287
+ members() {
2288
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported));
2267
2289
  }
2268
2290
  /**
2269
2291
  * Get team details from this bot installation
2270
2292
  *
2271
2293
  * @returns The team details if bot is installed into a team, otherwise returns undefined.
2272
2294
  */
2273
- async getTeamDetails() {
2274
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
2295
+ getTeamDetails() {
2296
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported));
2275
2297
  }
2276
2298
  }
2277
2299
  /**
@@ -2324,8 +2346,8 @@ class NotificationBot {
2324
2346
  *
2325
2347
  * @returns An array of {@link TeamsBotInstallation}.
2326
2348
  */
2327
- static async installations() {
2328
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
2349
+ static installations() {
2350
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported));
2329
2351
  }
2330
2352
  /**
2331
2353
  * Return the first {@link Member} where predicate is true, and undefined otherwise.
@@ -2340,8 +2362,8 @@ class NotificationBot {
2340
2362
  *
2341
2363
  * @returns The first {@link Member} where predicate is true, and undefined otherwise.
2342
2364
  */
2343
- async findMember(predicate, scope) {
2344
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
2365
+ findMember(predicate, scope) {
2366
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported));
2345
2367
  }
2346
2368
  /**
2347
2369
  * Return the first {@link Channel} where predicate is true, and undefined otherwise.
@@ -2356,8 +2378,8 @@ class NotificationBot {
2356
2378
  *
2357
2379
  * @returns The first {@link Channel} where predicate is true, and `undefined` otherwise.
2358
2380
  */
2359
- async findChannel(predicate) {
2360
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
2381
+ findChannel(predicate) {
2382
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported));
2361
2383
  }
2362
2384
  /**
2363
2385
  * Return all {@link Member} where predicate is true, and empty array otherwise.
@@ -2371,8 +2393,8 @@ class NotificationBot {
2371
2393
  *
2372
2394
  * @returns An array of {@link Member} where predicate is true, and empty array otherwise.
2373
2395
  */
2374
- async findAllMembers(predicate, scope) {
2375
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
2396
+ findAllMembers(predicate, scope) {
2397
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported));
2376
2398
  }
2377
2399
  /**
2378
2400
  * Return all {@link Channel} where predicate is true, and empty array otherwise.
@@ -2385,8 +2407,8 @@ class NotificationBot {
2385
2407
  *
2386
2408
  * @returns An array of {@link Channel} where predicate is true, and empty array otherwise.
2387
2409
  */
2388
- async findAllChannels(predicate) {
2389
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
2410
+ findAllChannels(predicate) {
2411
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported));
2390
2412
  }
2391
2413
  }
2392
2414
  /**
@@ -2496,7 +2518,7 @@ class CardActionBot {
2496
2518
  * Only work on server side.
2497
2519
  */
2498
2520
  registerHandler(actionHandler) {
2499
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CardActionBot"), ErrorCode.RuntimeNotSupported);
2521
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CardActionBot"), ErrorCode.RuntimeNotSupported));
2500
2522
  }
2501
2523
  /**
2502
2524
  * Register card action handlers to the bot.
@@ -2507,7 +2529,7 @@ class CardActionBot {
2507
2529
  * Only work on server side.
2508
2530
  */
2509
2531
  registerHandlers(actionHandlers) {
2510
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CardActionBot"), ErrorCode.RuntimeNotSupported);
2532
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CardActionBot"), ErrorCode.RuntimeNotSupported));
2511
2533
  }
2512
2534
  }
2513
2535