@microsoft/teamsfx 2.2.3-alpha.5a3b8a763.0 → 2.2.3-alpha.952007dba.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.
@@ -1,5 +1,5 @@
1
- import { __awaiter } from 'tslib';
2
1
  import jwt_decode from 'jwt-decode';
2
+ import { __awaiter } from 'tslib';
3
3
  import { app, authentication } from '@microsoft/teams-js';
4
4
  import { PublicClientApplication } from '@azure/msal-browser';
5
5
  import { Client } from '@microsoft/microsoft-graph-client';
@@ -443,9 +443,7 @@ class AppCredential {
443
443
  * Only works in in server side.
444
444
  */
445
445
  getToken(scopes, options) {
446
- return __awaiter(this, void 0, void 0, function* () {
447
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "AppCredential"), ErrorCode.RuntimeNotSupported);
448
- });
446
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "AppCredential"), ErrorCode.RuntimeNotSupported));
449
447
  }
450
448
  }
451
449
 
@@ -466,9 +464,7 @@ class OnBehalfOfUserCredential {
466
464
  * Can only be used in server side.
467
465
  */
468
466
  getToken(scopes, options) {
469
- return __awaiter(this, void 0, void 0, function* () {
470
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "OnBehalfOfUserCredential"), ErrorCode.RuntimeNotSupported);
471
- });
467
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "OnBehalfOfUserCredential"), ErrorCode.RuntimeNotSupported));
472
468
  }
473
469
  /**
474
470
  * Get basic user info from SSO token.
@@ -476,7 +472,7 @@ class OnBehalfOfUserCredential {
476
472
  * Can only be used in server side.
477
473
  */
478
474
  getUserInfo() {
479
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "OnBehalfOfUserCredential"), ErrorCode.RuntimeNotSupported);
475
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "OnBehalfOfUserCredential"), ErrorCode.RuntimeNotSupported));
480
476
  }
481
477
  }
482
478
 
@@ -530,7 +526,7 @@ class TeamsUserCredential {
530
526
  let result;
531
527
  try {
532
528
  const params = {
533
- url: `${this.config.initiateLoginEndpoint}?clientId=${this.config.clientId}&scope=${encodeURI(scopesStr)}&loginHint=${this.loginHint}`,
529
+ url: `${this.config.initiateLoginEndpoint ? this.config.initiateLoginEndpoint : ""}?clientId=${this.config.clientId ? this.config.clientId : ""}&scope=${encodeURI(scopesStr)}&loginHint=${this.loginHint ? this.loginHint : ""}`,
534
530
  width: loginPageWidth,
535
531
  height: loginPageHeight,
536
532
  };
@@ -834,7 +830,7 @@ class MsGraphAuthProvider {
834
830
  */
835
831
  getAccessToken() {
836
832
  return __awaiter(this, void 0, void 0, function* () {
837
- internalLogger.info(`Get Graph Access token with scopes: '${this.scopes}'`);
833
+ internalLogger.info(`Get Graph Access token with scopes: '${this.scopes.toString()}'`);
838
834
  let accessToken;
839
835
  if (this.credentialOrTeamsFx.getCredential) {
840
836
  accessToken = yield this.credentialOrTeamsFx
@@ -986,9 +982,7 @@ function createMicrosoftGraphClientWithCredential(credential, scopes) {
986
982
  * Only works in in server side.
987
983
  */
988
984
  function getTediousConnectionConfig(teamsfx, databaseName) {
989
- return __awaiter(this, void 0, void 0, function* () {
990
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultTediousConnectionConfiguration"), ErrorCode.RuntimeNotSupported);
991
- });
985
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultTediousConnectionConfiguration"), ErrorCode.RuntimeNotSupported));
992
986
  }
993
987
 
994
988
  // Copyright (c) Microsoft Corporation.
@@ -1070,9 +1064,7 @@ class TeamsBotSsoPrompt {
1070
1064
  * @returns A `Promise` representing the asynchronous operation.
1071
1065
  */
1072
1066
  beginDialog(dc) {
1073
- return __awaiter(this, void 0, void 0, function* () {
1074
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotSsoPrompt"), ErrorCode.RuntimeNotSupported);
1075
- });
1067
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotSsoPrompt"), ErrorCode.RuntimeNotSupported));
1076
1068
  }
1077
1069
  /**
1078
1070
  * Called when a prompt dialog is the active dialog and the user replied with a new activity.
@@ -1091,9 +1083,7 @@ class TeamsBotSsoPrompt {
1091
1083
  * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1092
1084
  */
1093
1085
  continueDialog(dc) {
1094
- return __awaiter(this, void 0, void 0, function* () {
1095
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotSsoPrompt"), ErrorCode.RuntimeNotSupported);
1096
- });
1086
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotSsoPrompt"), ErrorCode.RuntimeNotSupported));
1097
1087
  }
1098
1088
  }
1099
1089
 
@@ -1187,9 +1177,7 @@ class BasicAuthProvider {
1187
1177
  * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1188
1178
  */
1189
1179
  AddAuthenticationInfo(config) {
1190
- return __awaiter(this, void 0, void 0, function* () {
1191
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "BasicAuthProvider"), ErrorCode.RuntimeNotSupported);
1192
- });
1180
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "BasicAuthProvider"), ErrorCode.RuntimeNotSupported));
1193
1181
  }
1194
1182
  }
1195
1183
 
@@ -1222,9 +1210,7 @@ class ApiKeyProvider {
1222
1210
  * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1223
1211
  */
1224
1212
  AddAuthenticationInfo(config) {
1225
- return __awaiter(this, void 0, void 0, function* () {
1226
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "ApiKeyProvider"), ErrorCode.RuntimeNotSupported);
1227
- });
1213
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "ApiKeyProvider"), ErrorCode.RuntimeNotSupported));
1228
1214
  }
1229
1215
  }
1230
1216
  /**
@@ -1266,9 +1252,7 @@ class CertificateAuthProvider {
1266
1252
  * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1267
1253
  */
1268
1254
  AddAuthenticationInfo(config) {
1269
- return __awaiter(this, void 0, void 0, function* () {
1270
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CertificateAuthProvider"), ErrorCode.RuntimeNotSupported);
1271
- });
1255
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CertificateAuthProvider"), ErrorCode.RuntimeNotSupported));
1272
1256
  }
1273
1257
  }
1274
1258
  /**
@@ -1515,9 +1499,7 @@ class ConversationBot$1 {
1515
1499
  * Only work on server side.
1516
1500
  */
1517
1501
  requestHandler(req, res, logic) {
1518
- return __awaiter(this, void 0, void 0, function* () {
1519
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "ConversationBot"), ErrorCode.RuntimeNotSupported);
1520
- });
1502
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "ConversationBot"), ErrorCode.RuntimeNotSupported);
1521
1503
  }
1522
1504
  }
1523
1505
 
@@ -1643,9 +1625,7 @@ class Channel$1 {
1643
1625
  * @returns the response of sending adaptive card message.
1644
1626
  */
1645
1627
  sendAdaptiveCard(card, onError) {
1646
- return __awaiter(this, void 0, void 0, function* () {
1647
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Channel"), ErrorCode.RuntimeNotSupported);
1648
- });
1628
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Channel"), ErrorCode.RuntimeNotSupported);
1649
1629
  }
1650
1630
  }
1651
1631
  /**
@@ -1702,9 +1682,7 @@ class Member$1 {
1702
1682
  * @returns the response of sending adaptive card message.
1703
1683
  */
1704
1684
  sendAdaptiveCard(card, onError) {
1705
- return __awaiter(this, void 0, void 0, function* () {
1706
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Member"), ErrorCode.RuntimeNotSupported);
1707
- });
1685
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Member"), ErrorCode.RuntimeNotSupported);
1708
1686
  }
1709
1687
  }
1710
1688
  /**
@@ -1771,9 +1749,7 @@ class TeamsBotInstallation$1 {
1771
1749
  * @returns an array of channels if bot is installed into a team, otherwise returns an empty array.
1772
1750
  */
1773
1751
  channels() {
1774
- return __awaiter(this, void 0, void 0, function* () {
1775
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
1776
- });
1752
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
1777
1753
  }
1778
1754
  /**
1779
1755
  * Get members from this bot installation.
@@ -1784,9 +1760,7 @@ class TeamsBotInstallation$1 {
1784
1760
  * @returns an array of members from where the bot is installed.
1785
1761
  */
1786
1762
  members() {
1787
- return __awaiter(this, void 0, void 0, function* () {
1788
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
1789
- });
1763
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
1790
1764
  }
1791
1765
  /**
1792
1766
  * Get team details from this bot installation
@@ -1794,9 +1768,7 @@ class TeamsBotInstallation$1 {
1794
1768
  * @returns the team details if bot is installed into a team, otherwise returns undefined.
1795
1769
  */
1796
1770
  getTeamDetails() {
1797
- return __awaiter(this, void 0, void 0, function* () {
1798
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
1799
- });
1771
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
1800
1772
  }
1801
1773
  }
1802
1774
  /**
@@ -1853,9 +1825,7 @@ class NotificationBot$1 {
1853
1825
  * @returns - an array of {@link TeamsBotInstallation}.
1854
1826
  */
1855
1827
  static installations() {
1856
- return __awaiter(this, void 0, void 0, function* () {
1857
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1858
- });
1828
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1859
1829
  }
1860
1830
  /**
1861
1831
  * Returns the first {@link Member} where predicate is true, and undefined otherwise.
@@ -1871,9 +1841,7 @@ class NotificationBot$1 {
1871
1841
  * @returns the first {@link Member} where predicate is true, and undefined otherwise.
1872
1842
  */
1873
1843
  findMember(predicate, scope) {
1874
- return __awaiter(this, void 0, void 0, function* () {
1875
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1876
- });
1844
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1877
1845
  }
1878
1846
  /**
1879
1847
  * Returns the first {@link Channel} where predicate is true, and undefined otherwise.
@@ -1888,9 +1856,7 @@ class NotificationBot$1 {
1888
1856
  * @returns the first {@link Channel} where predicate is true, and undefined otherwise.
1889
1857
  */
1890
1858
  findChannel(predicate) {
1891
- return __awaiter(this, void 0, void 0, function* () {
1892
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1893
- });
1859
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1894
1860
  }
1895
1861
  /**
1896
1862
  * Returns all {@link Member} where predicate is true, and empty array otherwise.
@@ -1904,9 +1870,7 @@ class NotificationBot$1 {
1904
1870
  * @returns an array of {@link Member} where predicate is true, and empty array otherwise.
1905
1871
  */
1906
1872
  findAllMembers(predicate, scope) {
1907
- return __awaiter(this, void 0, void 0, function* () {
1908
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1909
- });
1873
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1910
1874
  }
1911
1875
  /**
1912
1876
  * Returns all {@link Channel} where predicate is true, and empty array otherwise.
@@ -1919,9 +1883,7 @@ class NotificationBot$1 {
1919
1883
  * @returns an array of {@link Channel} where predicate is true, and empty array otherwise.
1920
1884
  */
1921
1885
  findAllChannels(predicate) {
1922
- return __awaiter(this, void 0, void 0, function* () {
1923
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1924
- });
1886
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1925
1887
  }
1926
1888
  }
1927
1889
  /**
@@ -2103,9 +2065,7 @@ class ConversationBot {
2103
2065
  * Only work on server side.
2104
2066
  */
2105
2067
  requestHandler(req, res, logic) {
2106
- return __awaiter(this, void 0, void 0, function* () {
2107
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "ConversationBot"), ErrorCode.RuntimeNotSupported);
2108
- });
2068
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "ConversationBot"), ErrorCode.RuntimeNotSupported));
2109
2069
  }
2110
2070
  }
2111
2071
 
@@ -2123,7 +2083,7 @@ class ConversationBot {
2123
2083
  * @returns A `Promise` representing the asynchronous operation.
2124
2084
  */
2125
2085
  function sendMessage(target, text, onError) {
2126
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "sendMessage"), ErrorCode.RuntimeNotSupported);
2086
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "sendMessage"), ErrorCode.RuntimeNotSupported));
2127
2087
  }
2128
2088
  /**
2129
2089
  * Send an adaptive card message to a notification target.
@@ -2138,7 +2098,7 @@ function sendMessage(target, text, onError) {
2138
2098
  * @returns A `Promise` representing the asynchronous operation.
2139
2099
  */
2140
2100
  function sendAdaptiveCard(target, card, onError) {
2141
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "sendAdaptiveCard"), ErrorCode.RuntimeNotSupported);
2101
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "sendAdaptiveCard"), ErrorCode.RuntimeNotSupported));
2142
2102
  }
2143
2103
  /**
2144
2104
  * A {@link NotificationTarget} that represents a team channel.
@@ -2182,7 +2142,7 @@ class Channel {
2182
2142
  * @returns The response of sending message.
2183
2143
  */
2184
2144
  sendMessage(text, onError) {
2185
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Channel"), ErrorCode.RuntimeNotSupported);
2145
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Channel"), ErrorCode.RuntimeNotSupported));
2186
2146
  }
2187
2147
  /**
2188
2148
  * Send an adaptive card message.
@@ -2196,9 +2156,7 @@ class Channel {
2196
2156
  * @returns The response of sending adaptive card message.
2197
2157
  */
2198
2158
  sendAdaptiveCard(card, onError) {
2199
- return __awaiter(this, void 0, void 0, function* () {
2200
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Channel"), ErrorCode.RuntimeNotSupported);
2201
- });
2159
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Channel"), ErrorCode.RuntimeNotSupported));
2202
2160
  }
2203
2161
  }
2204
2162
  /**
@@ -2243,7 +2201,7 @@ class Member {
2243
2201
  * @returns The response of sending message.
2244
2202
  */
2245
2203
  sendMessage(text, onError) {
2246
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Member"), ErrorCode.RuntimeNotSupported);
2204
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Member"), ErrorCode.RuntimeNotSupported));
2247
2205
  }
2248
2206
  /**
2249
2207
  * Send an adaptive card message.
@@ -2257,9 +2215,7 @@ class Member {
2257
2215
  * @returns The response of sending adaptive card message.
2258
2216
  */
2259
2217
  sendAdaptiveCard(card, onError) {
2260
- return __awaiter(this, void 0, void 0, function* () {
2261
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Member"), ErrorCode.RuntimeNotSupported);
2262
- });
2218
+ return Promise.reject(Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Member"), ErrorCode.RuntimeNotSupported)));
2263
2219
  }
2264
2220
  }
2265
2221
  /**
@@ -2300,7 +2256,7 @@ class TeamsBotInstallation {
2300
2256
  * @returns The response of sending message.
2301
2257
  */
2302
2258
  sendMessage(text, onError) {
2303
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
2259
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported));
2304
2260
  }
2305
2261
  /**
2306
2262
  * Send an adaptive card message.
@@ -2314,7 +2270,7 @@ class TeamsBotInstallation {
2314
2270
  * @returns The response of sending adaptive card message.
2315
2271
  */
2316
2272
  sendAdaptiveCard(card, onError) {
2317
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
2273
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported));
2318
2274
  }
2319
2275
  /**
2320
2276
  * Get channels from this bot installation.
@@ -2325,9 +2281,7 @@ class TeamsBotInstallation {
2325
2281
  * @returns An array of channels if bot is installed into a team, otherwise returns an empty array.
2326
2282
  */
2327
2283
  channels() {
2328
- return __awaiter(this, void 0, void 0, function* () {
2329
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
2330
- });
2284
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported));
2331
2285
  }
2332
2286
  /**
2333
2287
  * Get members from this bot installation.
@@ -2338,9 +2292,7 @@ class TeamsBotInstallation {
2338
2292
  * @returns An array of members from where the bot is installed.
2339
2293
  */
2340
2294
  members() {
2341
- return __awaiter(this, void 0, void 0, function* () {
2342
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
2343
- });
2295
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported));
2344
2296
  }
2345
2297
  /**
2346
2298
  * Get team details from this bot installation
@@ -2348,9 +2300,7 @@ class TeamsBotInstallation {
2348
2300
  * @returns The team details if bot is installed into a team, otherwise returns undefined.
2349
2301
  */
2350
2302
  getTeamDetails() {
2351
- return __awaiter(this, void 0, void 0, function* () {
2352
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
2353
- });
2303
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported));
2354
2304
  }
2355
2305
  }
2356
2306
  /**
@@ -2404,9 +2354,7 @@ class NotificationBot {
2404
2354
  * @returns An array of {@link TeamsBotInstallation}.
2405
2355
  */
2406
2356
  static installations() {
2407
- return __awaiter(this, void 0, void 0, function* () {
2408
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
2409
- });
2357
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported));
2410
2358
  }
2411
2359
  /**
2412
2360
  * Return the first {@link Member} where predicate is true, and undefined otherwise.
@@ -2422,9 +2370,7 @@ class NotificationBot {
2422
2370
  * @returns The first {@link Member} where predicate is true, and undefined otherwise.
2423
2371
  */
2424
2372
  findMember(predicate, scope) {
2425
- return __awaiter(this, void 0, void 0, function* () {
2426
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
2427
- });
2373
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported));
2428
2374
  }
2429
2375
  /**
2430
2376
  * Return the first {@link Channel} where predicate is true, and undefined otherwise.
@@ -2440,9 +2386,7 @@ class NotificationBot {
2440
2386
  * @returns The first {@link Channel} where predicate is true, and `undefined` otherwise.
2441
2387
  */
2442
2388
  findChannel(predicate) {
2443
- return __awaiter(this, void 0, void 0, function* () {
2444
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
2445
- });
2389
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported));
2446
2390
  }
2447
2391
  /**
2448
2392
  * Return all {@link Member} where predicate is true, and empty array otherwise.
@@ -2457,9 +2401,7 @@ class NotificationBot {
2457
2401
  * @returns An array of {@link Member} where predicate is true, and empty array otherwise.
2458
2402
  */
2459
2403
  findAllMembers(predicate, scope) {
2460
- return __awaiter(this, void 0, void 0, function* () {
2461
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
2462
- });
2404
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported));
2463
2405
  }
2464
2406
  /**
2465
2407
  * Return all {@link Channel} where predicate is true, and empty array otherwise.
@@ -2473,9 +2415,7 @@ class NotificationBot {
2473
2415
  * @returns An array of {@link Channel} where predicate is true, and empty array otherwise.
2474
2416
  */
2475
2417
  findAllChannels(predicate) {
2476
- return __awaiter(this, void 0, void 0, function* () {
2477
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
2478
- });
2418
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported));
2479
2419
  }
2480
2420
  }
2481
2421
  /**
@@ -2585,7 +2525,7 @@ class CardActionBot {
2585
2525
  * Only work on server side.
2586
2526
  */
2587
2527
  registerHandler(actionHandler) {
2588
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CardActionBot"), ErrorCode.RuntimeNotSupported);
2528
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CardActionBot"), ErrorCode.RuntimeNotSupported));
2589
2529
  }
2590
2530
  /**
2591
2531
  * Register card action handlers to the bot.
@@ -2596,7 +2536,7 @@ class CardActionBot {
2596
2536
  * Only work on server side.
2597
2537
  */
2598
2538
  registerHandlers(actionHandlers) {
2599
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CardActionBot"), ErrorCode.RuntimeNotSupported);
2539
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CardActionBot"), ErrorCode.RuntimeNotSupported));
2600
2540
  }
2601
2541
  }
2602
2542