@microsoft/teamsfx 1.0.1-alpha.4edf8c10a.0 → 1.0.1-alpha.dbef2ba70.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 +0 -136
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm2017.mjs +0 -167
- package/dist/index.esm2017.mjs.map +1 -1
- package/dist/index.esm5.js +0 -136
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +0 -167
- package/dist/index.node.cjs.js.map +1 -1
- package/package.json +3 -3
- package/types/teamsfx.d.ts +0 -253
package/dist/index.esm5.js
CHANGED
|
@@ -9,7 +9,6 @@ import axios from 'axios';
|
|
|
9
9
|
// Licensed under the MIT license.
|
|
10
10
|
/**
|
|
11
11
|
* Error code to trace the error types.
|
|
12
|
-
* @beta
|
|
13
12
|
*/
|
|
14
13
|
var ErrorCode;
|
|
15
14
|
(function (ErrorCode) {
|
|
@@ -100,8 +99,6 @@ ErrorMessage.DuplicateApiKeyInHeader = "The request already defined api key in r
|
|
|
100
99
|
ErrorMessage.DuplicateApiKeyInQueryParam = "The request already defined api key in query parameter with name {0}.";
|
|
101
100
|
/**
|
|
102
101
|
* Error class with code and message thrown by the SDK.
|
|
103
|
-
*
|
|
104
|
-
* @beta
|
|
105
102
|
*/
|
|
106
103
|
class ErrorWithCode extends Error {
|
|
107
104
|
/**
|
|
@@ -109,8 +106,6 @@ class ErrorWithCode extends Error {
|
|
|
109
106
|
*
|
|
110
107
|
* @param {string} message - error message.
|
|
111
108
|
* @param {ErrorCode} code - error code.
|
|
112
|
-
*
|
|
113
|
-
* @beta
|
|
114
109
|
*/
|
|
115
110
|
constructor(message, code) {
|
|
116
111
|
if (!code) {
|
|
@@ -128,8 +123,6 @@ class ErrorWithCode extends Error {
|
|
|
128
123
|
// Licensed under the MIT license.
|
|
129
124
|
/**
|
|
130
125
|
* Log level.
|
|
131
|
-
*
|
|
132
|
-
* @beta
|
|
133
126
|
*/
|
|
134
127
|
var LogLevel;
|
|
135
128
|
(function (LogLevel) {
|
|
@@ -154,8 +147,6 @@ var LogLevel;
|
|
|
154
147
|
* Update log level helper.
|
|
155
148
|
*
|
|
156
149
|
* @param { LogLevel } level - log level in configuration
|
|
157
|
-
*
|
|
158
|
-
* @beta
|
|
159
150
|
*/
|
|
160
151
|
function setLogLevel(level) {
|
|
161
152
|
internalLogger.level = level;
|
|
@@ -164,8 +155,6 @@ function setLogLevel(level) {
|
|
|
164
155
|
* Get log level.
|
|
165
156
|
*
|
|
166
157
|
* @returns Log level
|
|
167
|
-
*
|
|
168
|
-
* @beta
|
|
169
158
|
*/
|
|
170
159
|
function getLogLevel() {
|
|
171
160
|
return internalLogger.level;
|
|
@@ -240,8 +229,6 @@ const internalLogger = new InternalLogger();
|
|
|
240
229
|
* error: console.error,
|
|
241
230
|
* });
|
|
242
231
|
* ```
|
|
243
|
-
*
|
|
244
|
-
* @beta
|
|
245
232
|
*/
|
|
246
233
|
function setLogger(logger) {
|
|
247
234
|
internalLogger.customLogger = logger;
|
|
@@ -259,8 +246,6 @@ function setLogger(logger) {
|
|
|
259
246
|
* }
|
|
260
247
|
* });
|
|
261
248
|
* ```
|
|
262
|
-
*
|
|
263
|
-
* @beta
|
|
264
249
|
*/
|
|
265
250
|
function setLogFunction(logFunction) {
|
|
266
251
|
internalLogger.customLogFunction = logFunction;
|
|
@@ -411,8 +396,6 @@ function validateScopesType(value) {
|
|
|
411
396
|
*
|
|
412
397
|
* @remarks
|
|
413
398
|
* Only works in in server side.
|
|
414
|
-
*
|
|
415
|
-
* @beta
|
|
416
399
|
*/
|
|
417
400
|
class AppCredential {
|
|
418
401
|
/**
|
|
@@ -420,7 +403,6 @@ class AppCredential {
|
|
|
420
403
|
*
|
|
421
404
|
* @remarks
|
|
422
405
|
* Only works in in server side.
|
|
423
|
-
* @beta
|
|
424
406
|
*/
|
|
425
407
|
constructor(authConfig) {
|
|
426
408
|
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "AppCredential"), ErrorCode.RuntimeNotSupported);
|
|
@@ -430,7 +412,6 @@ class AppCredential {
|
|
|
430
412
|
*
|
|
431
413
|
* @remarks
|
|
432
414
|
* Only works in in server side.
|
|
433
|
-
* @beta
|
|
434
415
|
*/
|
|
435
416
|
getToken(scopes, options) {
|
|
436
417
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -445,8 +426,6 @@ class AppCredential {
|
|
|
445
426
|
*
|
|
446
427
|
* @remarks
|
|
447
428
|
* Can only be used in server side.
|
|
448
|
-
*
|
|
449
|
-
* @beta
|
|
450
429
|
*/
|
|
451
430
|
class OnBehalfOfUserCredential {
|
|
452
431
|
/**
|
|
@@ -454,7 +433,6 @@ class OnBehalfOfUserCredential {
|
|
|
454
433
|
*
|
|
455
434
|
* @remarks
|
|
456
435
|
* Can Only works in in server side.
|
|
457
|
-
* @beta
|
|
458
436
|
*/
|
|
459
437
|
constructor(ssoToken, config) {
|
|
460
438
|
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "OnBehalfOfUserCredential"), ErrorCode.RuntimeNotSupported);
|
|
@@ -463,7 +441,6 @@ class OnBehalfOfUserCredential {
|
|
|
463
441
|
* Get access token from credential.
|
|
464
442
|
* @remarks
|
|
465
443
|
* Can only be used in server side.
|
|
466
|
-
* @beta
|
|
467
444
|
*/
|
|
468
445
|
getToken(scopes, options) {
|
|
469
446
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -474,7 +451,6 @@ class OnBehalfOfUserCredential {
|
|
|
474
451
|
* Get basic user info from SSO token.
|
|
475
452
|
* @remarks
|
|
476
453
|
* Can only be used in server side.
|
|
477
|
-
* @beta
|
|
478
454
|
*/
|
|
479
455
|
getUserInfo() {
|
|
480
456
|
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "OnBehalfOfUserCredential"), ErrorCode.RuntimeNotSupported);
|
|
@@ -490,8 +466,6 @@ const loginPageHeight = 535;
|
|
|
490
466
|
*
|
|
491
467
|
* @remarks
|
|
492
468
|
* Can only be used within Teams.
|
|
493
|
-
*
|
|
494
|
-
* @beta
|
|
495
469
|
*/
|
|
496
470
|
class TeamsUserCredential {
|
|
497
471
|
/**
|
|
@@ -515,8 +489,6 @@ class TeamsUserCredential {
|
|
|
515
489
|
*
|
|
516
490
|
* @throws {@link ErrorCode|InvalidConfiguration} when client id, initiate login endpoint or simple auth endpoint is not found in config.
|
|
517
491
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is nodeJS.
|
|
518
|
-
*
|
|
519
|
-
* @beta
|
|
520
492
|
*/
|
|
521
493
|
constructor(authConfig) {
|
|
522
494
|
internalLogger.info("Create teams user credential");
|
|
@@ -543,8 +515,6 @@ class TeamsUserCredential {
|
|
|
543
515
|
* @throws {@link ErrorCode|ConsentFailed} when user canceled or failed to consent.
|
|
544
516
|
* @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
|
|
545
517
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is nodeJS.
|
|
546
|
-
*
|
|
547
|
-
* @beta
|
|
548
518
|
*/
|
|
549
519
|
login(scopes) {
|
|
550
520
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -632,8 +602,6 @@ class TeamsUserCredential {
|
|
|
632
602
|
* If scopes is empty string or array, it returns SSO token.
|
|
633
603
|
* If scopes is non-empty, it returns access token for target scope.
|
|
634
604
|
* Throw error if get access token failed.
|
|
635
|
-
*
|
|
636
|
-
* @beta
|
|
637
605
|
*/
|
|
638
606
|
getToken(scopes, options) {
|
|
639
607
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -704,8 +672,6 @@ class TeamsUserCredential {
|
|
|
704
672
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is nodeJS.
|
|
705
673
|
*
|
|
706
674
|
* @returns Basic user info with user displayName, objectId and preferredUserName.
|
|
707
|
-
*
|
|
708
|
-
* @beta
|
|
709
675
|
*/
|
|
710
676
|
getUserInfo() {
|
|
711
677
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -841,8 +807,6 @@ class TeamsUserCredential {
|
|
|
841
807
|
const defaultScope = "https://graph.microsoft.com/.default";
|
|
842
808
|
/**
|
|
843
809
|
* Microsoft Graph auth provider for Teams Framework
|
|
844
|
-
*
|
|
845
|
-
* @beta
|
|
846
810
|
*/
|
|
847
811
|
class MsGraphAuthProvider {
|
|
848
812
|
/**
|
|
@@ -854,8 +818,6 @@ class MsGraphAuthProvider {
|
|
|
854
818
|
* @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
|
|
855
819
|
*
|
|
856
820
|
* @returns An instance of MsGraphAuthProvider.
|
|
857
|
-
*
|
|
858
|
-
* @beta
|
|
859
821
|
*/
|
|
860
822
|
constructor(teamsfx, scopes) {
|
|
861
823
|
this.teamsfx = teamsfx;
|
|
@@ -949,8 +911,6 @@ class MsGraphAuthProvider {
|
|
|
949
911
|
* @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
|
|
950
912
|
*
|
|
951
913
|
* @returns Graph client with specified scopes.
|
|
952
|
-
*
|
|
953
|
-
* @beta
|
|
954
914
|
*/
|
|
955
915
|
function createMicrosoftGraphClient(teamsfx, scopes) {
|
|
956
916
|
internalLogger.info("Create Microsoft Graph Client");
|
|
@@ -966,7 +926,6 @@ function createMicrosoftGraphClient(teamsfx, scopes) {
|
|
|
966
926
|
* Generate connection configuration consumed by tedious.
|
|
967
927
|
* @remarks
|
|
968
928
|
* Only works in in server side.
|
|
969
|
-
* @beta
|
|
970
929
|
*/
|
|
971
930
|
function getTediousConnectionConfig(teamsfx, databaseName) {
|
|
972
931
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1022,8 +981,6 @@ function getTediousConnectionConfig(teamsfx, databaseName) {
|
|
|
1022
981
|
* }
|
|
1023
982
|
* ]));
|
|
1024
983
|
* ```
|
|
1025
|
-
*
|
|
1026
|
-
* @beta
|
|
1027
984
|
*/
|
|
1028
985
|
class TeamsBotSsoPrompt {
|
|
1029
986
|
/**
|
|
@@ -1034,8 +991,6 @@ class TeamsBotSsoPrompt {
|
|
|
1034
991
|
*
|
|
1035
992
|
* @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
|
|
1036
993
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
1037
|
-
*
|
|
1038
|
-
* @beta
|
|
1039
994
|
*/
|
|
1040
995
|
constructor(teamsfx, dialogId, settings) {
|
|
1041
996
|
this.teamsfx = teamsfx;
|
|
@@ -1055,8 +1010,6 @@ class TeamsBotSsoPrompt {
|
|
|
1055
1010
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
1056
1011
|
*
|
|
1057
1012
|
* @returns A `Promise` representing the asynchronous operation.
|
|
1058
|
-
*
|
|
1059
|
-
* @beta
|
|
1060
1013
|
*/
|
|
1061
1014
|
beginDialog(dc) {
|
|
1062
1015
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1078,8 +1031,6 @@ class TeamsBotSsoPrompt {
|
|
|
1078
1031
|
*
|
|
1079
1032
|
* @throws {@link ErrorCode|ChannelNotSupported} when bot channel is not MS Teams.
|
|
1080
1033
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
1081
|
-
*
|
|
1082
|
-
* @beta
|
|
1083
1034
|
*/
|
|
1084
1035
|
continueDialog(dc) {
|
|
1085
1036
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1100,8 +1051,6 @@ class TeamsBotSsoPrompt {
|
|
|
1100
1051
|
* ```typescript
|
|
1101
1052
|
* const client = createApiClient("https://my-api-endpoint-base-url", new BasicAuthProvider("xxx","xxx"));
|
|
1102
1053
|
* ```
|
|
1103
|
-
*
|
|
1104
|
-
* @beta
|
|
1105
1054
|
*/
|
|
1106
1055
|
function createApiClient(apiEndpoint, authProvider) {
|
|
1107
1056
|
// Add a request interceptor
|
|
@@ -1119,14 +1068,10 @@ function createApiClient(apiEndpoint, authProvider) {
|
|
|
1119
1068
|
// Copyright (c) Microsoft Corporation.
|
|
1120
1069
|
/**
|
|
1121
1070
|
* Provider that handles Bearer Token authentication
|
|
1122
|
-
*
|
|
1123
|
-
* @beta
|
|
1124
1071
|
*/
|
|
1125
1072
|
class BearerTokenAuthProvider {
|
|
1126
1073
|
/**
|
|
1127
1074
|
* @param { () => Promise<string> } getToken - Function that returns the content of bearer token used in http request
|
|
1128
|
-
*
|
|
1129
|
-
* @beta
|
|
1130
1075
|
*/
|
|
1131
1076
|
constructor(getToken) {
|
|
1132
1077
|
this.getToken = getToken;
|
|
@@ -1140,8 +1085,6 @@ class BearerTokenAuthProvider {
|
|
|
1140
1085
|
* @returns Updated axios request config.
|
|
1141
1086
|
*
|
|
1142
1087
|
* @throws {@link ErrorCode|AuthorizationInfoAlreadyExists} - when Authorization header already exists in request configuration.
|
|
1143
|
-
*
|
|
1144
|
-
* @beta
|
|
1145
1088
|
*/
|
|
1146
1089
|
AddAuthenticationInfo(config) {
|
|
1147
1090
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1161,8 +1104,6 @@ class BearerTokenAuthProvider {
|
|
|
1161
1104
|
// Copyright (c) Microsoft Corporation.
|
|
1162
1105
|
/**
|
|
1163
1106
|
* Provider that handles Basic authentication
|
|
1164
|
-
*
|
|
1165
|
-
* @beta
|
|
1166
1107
|
*/
|
|
1167
1108
|
class BasicAuthProvider {
|
|
1168
1109
|
/**
|
|
@@ -1172,8 +1113,6 @@ class BasicAuthProvider {
|
|
|
1172
1113
|
*
|
|
1173
1114
|
* @throws {@link ErrorCode|InvalidParameter} - when username or password is empty.
|
|
1174
1115
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
1175
|
-
*
|
|
1176
|
-
* @beta
|
|
1177
1116
|
*/
|
|
1178
1117
|
constructor(userName, password) {
|
|
1179
1118
|
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "BasicAuthProvider"), ErrorCode.RuntimeNotSupported);
|
|
@@ -1188,8 +1127,6 @@ class BasicAuthProvider {
|
|
|
1188
1127
|
*
|
|
1189
1128
|
* @throws {@link ErrorCode|AuthorizationInfoAlreadyExists} - when Authorization header or auth property already exists in request configuration.
|
|
1190
1129
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
1191
|
-
*
|
|
1192
|
-
* @beta
|
|
1193
1130
|
*/
|
|
1194
1131
|
AddAuthenticationInfo(config) {
|
|
1195
1132
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1201,8 +1138,6 @@ class BasicAuthProvider {
|
|
|
1201
1138
|
// Copyright (c) Microsoft Corporation.
|
|
1202
1139
|
/**
|
|
1203
1140
|
* Provider that handles API Key authentication
|
|
1204
|
-
*
|
|
1205
|
-
* @beta
|
|
1206
1141
|
*/
|
|
1207
1142
|
class ApiKeyProvider {
|
|
1208
1143
|
/**
|
|
@@ -1213,8 +1148,6 @@ class ApiKeyProvider {
|
|
|
1213
1148
|
*
|
|
1214
1149
|
* @throws {@link ErrorCode|InvalidParameter} - when key name or key value is empty.
|
|
1215
1150
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
1216
|
-
*
|
|
1217
|
-
* @beta
|
|
1218
1151
|
*/
|
|
1219
1152
|
constructor(keyName, keyValue, keyLocation) {
|
|
1220
1153
|
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "ApiKeyProvider"), ErrorCode.RuntimeNotSupported);
|
|
@@ -1229,8 +1162,6 @@ class ApiKeyProvider {
|
|
|
1229
1162
|
*
|
|
1230
1163
|
* @throws {@link ErrorCode|AuthorizationInfoAlreadyExists} - when API key already exists in request header or url query parameter.
|
|
1231
1164
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
1232
|
-
*
|
|
1233
|
-
* @beta
|
|
1234
1165
|
*/
|
|
1235
1166
|
AddAuthenticationInfo(config) {
|
|
1236
1167
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1240,8 +1171,6 @@ class ApiKeyProvider {
|
|
|
1240
1171
|
}
|
|
1241
1172
|
/**
|
|
1242
1173
|
* Define available location for API Key location
|
|
1243
|
-
*
|
|
1244
|
-
* @beta
|
|
1245
1174
|
*/
|
|
1246
1175
|
var ApiKeyLocation;
|
|
1247
1176
|
(function (ApiKeyLocation) {
|
|
@@ -1258,15 +1187,11 @@ var ApiKeyLocation;
|
|
|
1258
1187
|
// Copyright (c) Microsoft Corporation.
|
|
1259
1188
|
/**
|
|
1260
1189
|
* Provider that handles Certificate authentication
|
|
1261
|
-
*
|
|
1262
|
-
* @beta
|
|
1263
1190
|
*/
|
|
1264
1191
|
class CertificateAuthProvider {
|
|
1265
1192
|
/**
|
|
1266
1193
|
*
|
|
1267
1194
|
* @param { SecureContextOptions } certOption - information about the cert used in http requests
|
|
1268
|
-
*
|
|
1269
|
-
* @beta
|
|
1270
1195
|
*/
|
|
1271
1196
|
constructor(certOption) {
|
|
1272
1197
|
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CertificateAuthProvider"), ErrorCode.RuntimeNotSupported);
|
|
@@ -1281,8 +1206,6 @@ class CertificateAuthProvider {
|
|
|
1281
1206
|
*
|
|
1282
1207
|
* @throws {@link ErrorCode|InvalidParameter} - when custom httpsAgent in the request has duplicate properties with certOption provided in constructor.
|
|
1283
1208
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
|
1284
|
-
*
|
|
1285
|
-
* @beta
|
|
1286
1209
|
*/
|
|
1287
1210
|
AddAuthenticationInfo(config) {
|
|
1288
1211
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1326,8 +1249,6 @@ function createPfxCertOption(pfx, options) {
|
|
|
1326
1249
|
// Licensed under the MIT license.
|
|
1327
1250
|
/**
|
|
1328
1251
|
* Identity type to use in authentication.
|
|
1329
|
-
*
|
|
1330
|
-
* @beta
|
|
1331
1252
|
*/
|
|
1332
1253
|
var IdentityType;
|
|
1333
1254
|
(function (IdentityType) {
|
|
@@ -1344,7 +1265,6 @@ var IdentityType;
|
|
|
1344
1265
|
// Copyright (c) Microsoft Corporation.
|
|
1345
1266
|
/**
|
|
1346
1267
|
* A class providing credential and configuration.
|
|
1347
|
-
* @beta
|
|
1348
1268
|
*/
|
|
1349
1269
|
class TeamsFx {
|
|
1350
1270
|
constructor(identityType, customConfig) {
|
|
@@ -1450,8 +1370,6 @@ class TeamsFx {
|
|
|
1450
1370
|
*
|
|
1451
1371
|
* @remarks
|
|
1452
1372
|
* Only work on server side.
|
|
1453
|
-
*
|
|
1454
|
-
* @beta
|
|
1455
1373
|
*/
|
|
1456
1374
|
class ConversationBot {
|
|
1457
1375
|
/**
|
|
@@ -1461,8 +1379,6 @@ class ConversationBot {
|
|
|
1461
1379
|
*
|
|
1462
1380
|
* @remarks
|
|
1463
1381
|
* Only work on server side.
|
|
1464
|
-
*
|
|
1465
|
-
* @beta
|
|
1466
1382
|
*/
|
|
1467
1383
|
constructor(options) {
|
|
1468
1384
|
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "ConversationBot"), ErrorCode.RuntimeNotSupported);
|
|
@@ -1476,8 +1392,6 @@ class ConversationBot {
|
|
|
1476
1392
|
*
|
|
1477
1393
|
* @remarks
|
|
1478
1394
|
* Only work on server side.
|
|
1479
|
-
*
|
|
1480
|
-
* @beta
|
|
1481
1395
|
*/
|
|
1482
1396
|
requestHandler(req, res, logic) {
|
|
1483
1397
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1496,8 +1410,6 @@ class ConversationBot {
|
|
|
1496
1410
|
* @param target - the notification target.
|
|
1497
1411
|
* @param text - the plain text message.
|
|
1498
1412
|
* @returns A `Promise` representing the asynchronous operation.
|
|
1499
|
-
*
|
|
1500
|
-
* @beta
|
|
1501
1413
|
*/
|
|
1502
1414
|
function sendMessage(target, text) {
|
|
1503
1415
|
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "sendMessage"), ErrorCode.RuntimeNotSupported);
|
|
@@ -1511,8 +1423,6 @@ function sendMessage(target, text) {
|
|
|
1511
1423
|
* @param target - the notification target.
|
|
1512
1424
|
* @param card - the adaptive card raw JSON.
|
|
1513
1425
|
* @returns A `Promise` representing the asynchronous operation.
|
|
1514
|
-
*
|
|
1515
|
-
* @beta
|
|
1516
1426
|
*/
|
|
1517
1427
|
function sendAdaptiveCard(target, card) {
|
|
1518
1428
|
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "sendAdaptiveCard"), ErrorCode.RuntimeNotSupported);
|
|
@@ -1524,8 +1434,6 @@ function sendAdaptiveCard(target, card) {
|
|
|
1524
1434
|
* Only work on server side.
|
|
1525
1435
|
*
|
|
1526
1436
|
* It's recommended to get channels from {@link TeamsBotInstallation.channels()}.
|
|
1527
|
-
*
|
|
1528
|
-
* @beta
|
|
1529
1437
|
*/
|
|
1530
1438
|
class Channel {
|
|
1531
1439
|
/**
|
|
@@ -1538,8 +1446,6 @@ class Channel {
|
|
|
1538
1446
|
*
|
|
1539
1447
|
* @param parent - The parent {@link TeamsBotInstallation} where this channel is created from.
|
|
1540
1448
|
* @param info - Detailed channel information.
|
|
1541
|
-
*
|
|
1542
|
-
* @beta
|
|
1543
1449
|
*/
|
|
1544
1450
|
constructor(parent, info) {
|
|
1545
1451
|
/**
|
|
@@ -1547,8 +1453,6 @@ class Channel {
|
|
|
1547
1453
|
*
|
|
1548
1454
|
* @remarks
|
|
1549
1455
|
* Only work on server side.
|
|
1550
|
-
*
|
|
1551
|
-
* @beta
|
|
1552
1456
|
*/
|
|
1553
1457
|
this.type = "Channel";
|
|
1554
1458
|
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Channel"), ErrorCode.RuntimeNotSupported);
|
|
@@ -1561,8 +1465,6 @@ class Channel {
|
|
|
1561
1465
|
*
|
|
1562
1466
|
* @param text - the plain text message.
|
|
1563
1467
|
* @returns A `Promise` representing the asynchronous operation.
|
|
1564
|
-
*
|
|
1565
|
-
* @beta
|
|
1566
1468
|
*/
|
|
1567
1469
|
sendMessage(text) {
|
|
1568
1470
|
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Channel"), ErrorCode.RuntimeNotSupported);
|
|
@@ -1575,8 +1477,6 @@ class Channel {
|
|
|
1575
1477
|
*
|
|
1576
1478
|
* @param card - the adaptive card raw JSON.
|
|
1577
1479
|
* @returns A `Promise` representing the asynchronous operation.
|
|
1578
|
-
*
|
|
1579
|
-
* @beta
|
|
1580
1480
|
*/
|
|
1581
1481
|
sendAdaptiveCard(card) {
|
|
1582
1482
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1591,8 +1491,6 @@ class Channel {
|
|
|
1591
1491
|
* Only work on server side.
|
|
1592
1492
|
*
|
|
1593
1493
|
* It's recommended to get members from {@link TeamsBotInstallation.members()}.
|
|
1594
|
-
*
|
|
1595
|
-
* @beta
|
|
1596
1494
|
*/
|
|
1597
1495
|
class Member {
|
|
1598
1496
|
/**
|
|
@@ -1605,8 +1503,6 @@ class Member {
|
|
|
1605
1503
|
*
|
|
1606
1504
|
* @param parent - The parent {@link TeamsBotInstallation} where this member is created from.
|
|
1607
1505
|
* @param account - Detailed member account information.
|
|
1608
|
-
*
|
|
1609
|
-
* @beta
|
|
1610
1506
|
*/
|
|
1611
1507
|
constructor(parent, account) {
|
|
1612
1508
|
/**
|
|
@@ -1614,8 +1510,6 @@ class Member {
|
|
|
1614
1510
|
*
|
|
1615
1511
|
* @remarks
|
|
1616
1512
|
* Only work on server side.
|
|
1617
|
-
*
|
|
1618
|
-
* @beta
|
|
1619
1513
|
*/
|
|
1620
1514
|
this.type = "Person";
|
|
1621
1515
|
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Member"), ErrorCode.RuntimeNotSupported);
|
|
@@ -1628,8 +1522,6 @@ class Member {
|
|
|
1628
1522
|
*
|
|
1629
1523
|
* @param text - the plain text message.
|
|
1630
1524
|
* @returns A `Promise` representing the asynchronous operation.
|
|
1631
|
-
*
|
|
1632
|
-
* @beta
|
|
1633
1525
|
*/
|
|
1634
1526
|
sendMessage(text) {
|
|
1635
1527
|
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Member"), ErrorCode.RuntimeNotSupported);
|
|
@@ -1642,8 +1534,6 @@ class Member {
|
|
|
1642
1534
|
*
|
|
1643
1535
|
* @param card - the adaptive card raw JSON.
|
|
1644
1536
|
* @returns A `Promise` representing the asynchronous operation.
|
|
1645
|
-
*
|
|
1646
|
-
* @beta
|
|
1647
1537
|
*/
|
|
1648
1538
|
sendAdaptiveCard(card) {
|
|
1649
1539
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1661,8 +1551,6 @@ class Member {
|
|
|
1661
1551
|
* Only work on server side.
|
|
1662
1552
|
*
|
|
1663
1553
|
* It's recommended to get bot installations from {@link ConversationBot.installations()}.
|
|
1664
|
-
*
|
|
1665
|
-
* @beta
|
|
1666
1554
|
*/
|
|
1667
1555
|
class TeamsBotInstallation {
|
|
1668
1556
|
/**
|
|
@@ -1675,8 +1563,6 @@ class TeamsBotInstallation {
|
|
|
1675
1563
|
*
|
|
1676
1564
|
* @param adapter - the bound `BotFrameworkAdapter`.
|
|
1677
1565
|
* @param conversationReference - the bound `ConversationReference`.
|
|
1678
|
-
*
|
|
1679
|
-
* @beta
|
|
1680
1566
|
*/
|
|
1681
1567
|
constructor(adapter, conversationReference) {
|
|
1682
1568
|
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
|
|
@@ -1689,8 +1575,6 @@ class TeamsBotInstallation {
|
|
|
1689
1575
|
*
|
|
1690
1576
|
* @param text - the plain text message.
|
|
1691
1577
|
* @returns A `Promise` representing the asynchronous operation.
|
|
1692
|
-
*
|
|
1693
|
-
* @beta
|
|
1694
1578
|
*/
|
|
1695
1579
|
sendMessage(text) {
|
|
1696
1580
|
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
|
|
@@ -1703,8 +1587,6 @@ class TeamsBotInstallation {
|
|
|
1703
1587
|
*
|
|
1704
1588
|
* @param card - the adaptive card raw JSON.
|
|
1705
1589
|
* @returns A `Promise` representing the asynchronous operation.
|
|
1706
|
-
*
|
|
1707
|
-
* @beta
|
|
1708
1590
|
*/
|
|
1709
1591
|
sendAdaptiveCard(card) {
|
|
1710
1592
|
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
|
|
@@ -1716,8 +1598,6 @@ class TeamsBotInstallation {
|
|
|
1716
1598
|
* Only work on server side.
|
|
1717
1599
|
*
|
|
1718
1600
|
* @returns an array of channels if bot is installed into a team, otherwise returns an empty array.
|
|
1719
|
-
*
|
|
1720
|
-
* @beta
|
|
1721
1601
|
*/
|
|
1722
1602
|
channels() {
|
|
1723
1603
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1731,8 +1611,6 @@ class TeamsBotInstallation {
|
|
|
1731
1611
|
* Only work on server side.
|
|
1732
1612
|
*
|
|
1733
1613
|
* @returns an array of members from where the bot is installed.
|
|
1734
|
-
*
|
|
1735
|
-
* @beta
|
|
1736
1614
|
*/
|
|
1737
1615
|
members() {
|
|
1738
1616
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1764,8 +1642,6 @@ class TeamsBotInstallation {
|
|
|
1764
1642
|
* }
|
|
1765
1643
|
* }
|
|
1766
1644
|
* ```
|
|
1767
|
-
*
|
|
1768
|
-
* @beta
|
|
1769
1645
|
*/
|
|
1770
1646
|
class NotificationBot {
|
|
1771
1647
|
/**
|
|
@@ -1778,8 +1654,6 @@ class NotificationBot {
|
|
|
1778
1654
|
*
|
|
1779
1655
|
* @param adapter - the bound `BotFrameworkAdapter`
|
|
1780
1656
|
* @param options - initialize options
|
|
1781
|
-
*
|
|
1782
|
-
* @beta
|
|
1783
1657
|
*/
|
|
1784
1658
|
constructor(adapter, options) {
|
|
1785
1659
|
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
|
|
@@ -1793,8 +1667,6 @@ class NotificationBot {
|
|
|
1793
1667
|
* The result is retrieving from the persisted storage.
|
|
1794
1668
|
*
|
|
1795
1669
|
* @returns - an array of {@link TeamsBotInstallation}.
|
|
1796
|
-
*
|
|
1797
|
-
* @beta
|
|
1798
1670
|
*/
|
|
1799
1671
|
static installations() {
|
|
1800
1672
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1809,8 +1681,6 @@ class NotificationBot {
|
|
|
1809
1681
|
*
|
|
1810
1682
|
* @remarks
|
|
1811
1683
|
* Only work on server side.
|
|
1812
|
-
*
|
|
1813
|
-
* @beta
|
|
1814
1684
|
*/
|
|
1815
1685
|
class CommandBot {
|
|
1816
1686
|
/**
|
|
@@ -1818,8 +1688,6 @@ class CommandBot {
|
|
|
1818
1688
|
*
|
|
1819
1689
|
* @param adapter The bound `BotFrameworkAdapter`.
|
|
1820
1690
|
* @param commands The commands to registered with the command bot. Each command should implement the interface {@link TeamsFxBotCommandHandler} so that it can be correctly handled by this command bot.
|
|
1821
|
-
*
|
|
1822
|
-
* @beta
|
|
1823
1691
|
*/
|
|
1824
1692
|
constructor(adapter, commands) {
|
|
1825
1693
|
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CommandBot"), ErrorCode.RuntimeNotSupported);
|
|
@@ -1831,8 +1699,6 @@ class CommandBot {
|
|
|
1831
1699
|
*
|
|
1832
1700
|
* @remarks
|
|
1833
1701
|
* Only work on server side.
|
|
1834
|
-
*
|
|
1835
|
-
* @beta
|
|
1836
1702
|
*/
|
|
1837
1703
|
registerCommand(command) {
|
|
1838
1704
|
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CommandBot"), ErrorCode.RuntimeNotSupported);
|
|
@@ -1844,8 +1710,6 @@ class CommandBot {
|
|
|
1844
1710
|
*
|
|
1845
1711
|
* @remarks
|
|
1846
1712
|
* Only work on server side.
|
|
1847
|
-
*
|
|
1848
|
-
* @beta
|
|
1849
1713
|
*/
|
|
1850
1714
|
registerCommands(commands) {
|
|
1851
1715
|
throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CommandnBot"), ErrorCode.RuntimeNotSupported);
|