@microsoft/teamsfx 2.2.3-alpha.9b38c38b5.0 → 2.2.3-alpha.dea6b9e8a.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.
- package/dist/index.esm2017.js +62 -62
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm2017.mjs +57 -41
- package/dist/index.esm2017.mjs.map +1 -1
- package/dist/index.esm5.js +44 -108
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +99 -95
- package/dist/index.node.cjs.js.map +1 -1
- package/package.json +4 -4
- package/types/teamsfx.d.ts +8 -1
package/dist/index.esm5.js
CHANGED
@@ -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
|
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
|
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
|
-
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
/**
|
@@ -2056,9 +2018,7 @@ class CardActionBot$1 {
|
|
2056
2018
|
* Only works in in server side.
|
2057
2019
|
*/
|
2058
2020
|
function handleMessageExtensionQueryWithToken(context, config, scopes, logic) {
|
2059
|
-
|
2060
|
-
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "queryWithToken in message extension"), ErrorCode.RuntimeNotSupported);
|
2061
|
-
});
|
2021
|
+
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "queryWithToken in message extension"), ErrorCode.RuntimeNotSupported);
|
2062
2022
|
}
|
2063
2023
|
/**
|
2064
2024
|
* Users execute query with SSO or Access Token.
|
@@ -2066,9 +2026,7 @@ function handleMessageExtensionQueryWithToken(context, config, scopes, logic) {
|
|
2066
2026
|
* Only works in in server side.
|
2067
2027
|
*/
|
2068
2028
|
function handleMessageExtensionQueryWithSSO(context, config, initiateLoginEndpoint, scopes, logic) {
|
2069
|
-
|
2070
|
-
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "queryWithToken in message extension"), ErrorCode.RuntimeNotSupported);
|
2071
|
-
});
|
2029
|
+
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "queryWithToken in message extension"), ErrorCode.RuntimeNotSupported);
|
2072
2030
|
}
|
2073
2031
|
|
2074
2032
|
// Copyright (c) Microsoft Corporation.
|
@@ -2103,9 +2061,7 @@ class ConversationBot {
|
|
2103
2061
|
* Only work on server side.
|
2104
2062
|
*/
|
2105
2063
|
requestHandler(req, res, logic) {
|
2106
|
-
return
|
2107
|
-
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "ConversationBot"), ErrorCode.RuntimeNotSupported);
|
2108
|
-
});
|
2064
|
+
return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "ConversationBot"), ErrorCode.RuntimeNotSupported));
|
2109
2065
|
}
|
2110
2066
|
}
|
2111
2067
|
|
@@ -2123,7 +2079,7 @@ class ConversationBot {
|
|
2123
2079
|
* @returns A `Promise` representing the asynchronous operation.
|
2124
2080
|
*/
|
2125
2081
|
function sendMessage(target, text, onError) {
|
2126
|
-
|
2082
|
+
return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "sendMessage"), ErrorCode.RuntimeNotSupported));
|
2127
2083
|
}
|
2128
2084
|
/**
|
2129
2085
|
* Send an adaptive card message to a notification target.
|
@@ -2138,7 +2094,7 @@ function sendMessage(target, text, onError) {
|
|
2138
2094
|
* @returns A `Promise` representing the asynchronous operation.
|
2139
2095
|
*/
|
2140
2096
|
function sendAdaptiveCard(target, card, onError) {
|
2141
|
-
|
2097
|
+
return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "sendAdaptiveCard"), ErrorCode.RuntimeNotSupported));
|
2142
2098
|
}
|
2143
2099
|
/**
|
2144
2100
|
* A {@link NotificationTarget} that represents a team channel.
|
@@ -2182,7 +2138,7 @@ class Channel {
|
|
2182
2138
|
* @returns The response of sending message.
|
2183
2139
|
*/
|
2184
2140
|
sendMessage(text, onError) {
|
2185
|
-
|
2141
|
+
return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Channel"), ErrorCode.RuntimeNotSupported));
|
2186
2142
|
}
|
2187
2143
|
/**
|
2188
2144
|
* Send an adaptive card message.
|
@@ -2196,9 +2152,7 @@ class Channel {
|
|
2196
2152
|
* @returns The response of sending adaptive card message.
|
2197
2153
|
*/
|
2198
2154
|
sendAdaptiveCard(card, onError) {
|
2199
|
-
return
|
2200
|
-
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Channel"), ErrorCode.RuntimeNotSupported);
|
2201
|
-
});
|
2155
|
+
return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Channel"), ErrorCode.RuntimeNotSupported));
|
2202
2156
|
}
|
2203
2157
|
}
|
2204
2158
|
/**
|
@@ -2243,7 +2197,7 @@ class Member {
|
|
2243
2197
|
* @returns The response of sending message.
|
2244
2198
|
*/
|
2245
2199
|
sendMessage(text, onError) {
|
2246
|
-
|
2200
|
+
return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Member"), ErrorCode.RuntimeNotSupported));
|
2247
2201
|
}
|
2248
2202
|
/**
|
2249
2203
|
* Send an adaptive card message.
|
@@ -2257,9 +2211,7 @@ class Member {
|
|
2257
2211
|
* @returns The response of sending adaptive card message.
|
2258
2212
|
*/
|
2259
2213
|
sendAdaptiveCard(card, onError) {
|
2260
|
-
return
|
2261
|
-
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Member"), ErrorCode.RuntimeNotSupported);
|
2262
|
-
});
|
2214
|
+
return Promise.reject(Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Member"), ErrorCode.RuntimeNotSupported)));
|
2263
2215
|
}
|
2264
2216
|
}
|
2265
2217
|
/**
|
@@ -2300,7 +2252,7 @@ class TeamsBotInstallation {
|
|
2300
2252
|
* @returns The response of sending message.
|
2301
2253
|
*/
|
2302
2254
|
sendMessage(text, onError) {
|
2303
|
-
|
2255
|
+
return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported));
|
2304
2256
|
}
|
2305
2257
|
/**
|
2306
2258
|
* Send an adaptive card message.
|
@@ -2314,7 +2266,7 @@ class TeamsBotInstallation {
|
|
2314
2266
|
* @returns The response of sending adaptive card message.
|
2315
2267
|
*/
|
2316
2268
|
sendAdaptiveCard(card, onError) {
|
2317
|
-
|
2269
|
+
return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported));
|
2318
2270
|
}
|
2319
2271
|
/**
|
2320
2272
|
* Get channels from this bot installation.
|
@@ -2325,9 +2277,7 @@ class TeamsBotInstallation {
|
|
2325
2277
|
* @returns An array of channels if bot is installed into a team, otherwise returns an empty array.
|
2326
2278
|
*/
|
2327
2279
|
channels() {
|
2328
|
-
return
|
2329
|
-
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
|
2330
|
-
});
|
2280
|
+
return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported));
|
2331
2281
|
}
|
2332
2282
|
/**
|
2333
2283
|
* Get members from this bot installation.
|
@@ -2338,9 +2288,7 @@ class TeamsBotInstallation {
|
|
2338
2288
|
* @returns An array of members from where the bot is installed.
|
2339
2289
|
*/
|
2340
2290
|
members() {
|
2341
|
-
return
|
2342
|
-
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
|
2343
|
-
});
|
2291
|
+
return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported));
|
2344
2292
|
}
|
2345
2293
|
/**
|
2346
2294
|
* Get team details from this bot installation
|
@@ -2348,9 +2296,7 @@ class TeamsBotInstallation {
|
|
2348
2296
|
* @returns The team details if bot is installed into a team, otherwise returns undefined.
|
2349
2297
|
*/
|
2350
2298
|
getTeamDetails() {
|
2351
|
-
return
|
2352
|
-
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
|
2353
|
-
});
|
2299
|
+
return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported));
|
2354
2300
|
}
|
2355
2301
|
}
|
2356
2302
|
/**
|
@@ -2404,9 +2350,7 @@ class NotificationBot {
|
|
2404
2350
|
* @returns An array of {@link TeamsBotInstallation}.
|
2405
2351
|
*/
|
2406
2352
|
static installations() {
|
2407
|
-
return
|
2408
|
-
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
|
2409
|
-
});
|
2353
|
+
return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported));
|
2410
2354
|
}
|
2411
2355
|
/**
|
2412
2356
|
* Return the first {@link Member} where predicate is true, and undefined otherwise.
|
@@ -2422,9 +2366,7 @@ class NotificationBot {
|
|
2422
2366
|
* @returns The first {@link Member} where predicate is true, and undefined otherwise.
|
2423
2367
|
*/
|
2424
2368
|
findMember(predicate, scope) {
|
2425
|
-
return
|
2426
|
-
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
|
2427
|
-
});
|
2369
|
+
return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported));
|
2428
2370
|
}
|
2429
2371
|
/**
|
2430
2372
|
* Return the first {@link Channel} where predicate is true, and undefined otherwise.
|
@@ -2440,9 +2382,7 @@ class NotificationBot {
|
|
2440
2382
|
* @returns The first {@link Channel} where predicate is true, and `undefined` otherwise.
|
2441
2383
|
*/
|
2442
2384
|
findChannel(predicate) {
|
2443
|
-
return
|
2444
|
-
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
|
2445
|
-
});
|
2385
|
+
return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported));
|
2446
2386
|
}
|
2447
2387
|
/**
|
2448
2388
|
* Return all {@link Member} where predicate is true, and empty array otherwise.
|
@@ -2457,9 +2397,7 @@ class NotificationBot {
|
|
2457
2397
|
* @returns An array of {@link Member} where predicate is true, and empty array otherwise.
|
2458
2398
|
*/
|
2459
2399
|
findAllMembers(predicate, scope) {
|
2460
|
-
return
|
2461
|
-
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
|
2462
|
-
});
|
2400
|
+
return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported));
|
2463
2401
|
}
|
2464
2402
|
/**
|
2465
2403
|
* Return all {@link Channel} where predicate is true, and empty array otherwise.
|
@@ -2473,9 +2411,7 @@ class NotificationBot {
|
|
2473
2411
|
* @returns An array of {@link Channel} where predicate is true, and empty array otherwise.
|
2474
2412
|
*/
|
2475
2413
|
findAllChannels(predicate) {
|
2476
|
-
return
|
2477
|
-
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
|
2478
|
-
});
|
2414
|
+
return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported));
|
2479
2415
|
}
|
2480
2416
|
}
|
2481
2417
|
/**
|
@@ -2585,7 +2521,7 @@ class CardActionBot {
|
|
2585
2521
|
* Only work on server side.
|
2586
2522
|
*/
|
2587
2523
|
registerHandler(actionHandler) {
|
2588
|
-
|
2524
|
+
return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CardActionBot"), ErrorCode.RuntimeNotSupported));
|
2589
2525
|
}
|
2590
2526
|
/**
|
2591
2527
|
* Register card action handlers to the bot.
|
@@ -2596,7 +2532,7 @@ class CardActionBot {
|
|
2596
2532
|
* Only work on server side.
|
2597
2533
|
*/
|
2598
2534
|
registerHandlers(actionHandlers) {
|
2599
|
-
|
2535
|
+
return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CardActionBot"), ErrorCode.RuntimeNotSupported));
|
2600
2536
|
}
|
2601
2537
|
}
|
2602
2538
|
|