@microsoft/teamsfx 2.0.0-experimental.0 → 2.0.1-alpha.0d47bc042.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.
@@ -8,7 +8,6 @@ import axios from 'axios';
8
8
  // Licensed under the MIT license.
9
9
  /**
10
10
  * Error code to trace the error types.
11
- * @beta
12
11
  */
13
12
  var ErrorCode;
14
13
  (function (ErrorCode) {
@@ -32,6 +31,30 @@ var ErrorCode;
32
31
  * Channel is not supported error.
33
32
  */
34
33
  ErrorCode["ChannelNotSupported"] = "ChannelNotSupported";
34
+ /**
35
+ * Failed to retrieve sso token
36
+ */
37
+ ErrorCode["FailedToRetrieveSsoToken"] = "FailedToRetrieveSsoToken";
38
+ /**
39
+ * Failed to process sso handler
40
+ */
41
+ ErrorCode["FailedToProcessSsoHandler"] = "FailedToProcessSsoHandler";
42
+ /**
43
+ * Cannot find command
44
+ */
45
+ ErrorCode["CannotFindCommand"] = "CannotFindCommand";
46
+ /**
47
+ * Failed to run sso step
48
+ */
49
+ ErrorCode["FailedToRunSsoStep"] = "FailedToRunSsoStep";
50
+ /**
51
+ * Failed to run dedup step
52
+ */
53
+ ErrorCode["FailedToRunDedupStep"] = "FailedToRunDedupStep";
54
+ /**
55
+ * Sso activity handler is undefined
56
+ */
57
+ ErrorCode["SsoActivityHandlerIsUndefined"] = "SsoActivityHandlerIsUndefined";
35
58
  /**
36
59
  * Runtime is not supported error.
37
60
  */
@@ -87,6 +110,15 @@ ErrorMessage.NodejsRuntimeNotSupported = "{0} is not supported in Node.";
87
110
  ErrorMessage.FailToAcquireTokenOnBehalfOfUser = "Failed to acquire access token on behalf of user: {0}";
88
111
  // ChannelNotSupported Error
89
112
  ErrorMessage.OnlyMSTeamsChannelSupported = "{0} is only supported in MS Teams Channel";
113
+ ErrorMessage.FailedToProcessSsoHandler = "Failed to process sso handler: {0}";
114
+ // FailedToRetrieveSsoToken Error
115
+ ErrorMessage.FailedToRetrieveSsoToken = "Failed to retrieve sso token, user failed to finish the AAD consent flow.";
116
+ // CannotFindCommand Error
117
+ ErrorMessage.CannotFindCommand = "Cannot find command: {0}";
118
+ ErrorMessage.FailedToRunSsoStep = "Failed to run dialog to retrieve sso token: {0}";
119
+ ErrorMessage.FailedToRunDedupStep = "Failed to run dialog to remove duplicated messages: {0}";
120
+ // SsoActivityHandlerIsUndefined Error
121
+ ErrorMessage.SsoActivityHandlerIsNull = "Sso command can only be used or added when sso activity handler is not undefined";
90
122
  // IdentityTypeNotSupported Error
91
123
  ErrorMessage.IdentityTypeNotSupported = "{0} identity is not supported in {1}";
92
124
  // AuthorizationInfoError
@@ -97,10 +129,9 @@ ErrorMessage.EmptyParameter = "Parameter {0} is empty";
97
129
  ErrorMessage.DuplicateHttpsOptionProperty = "Axios HTTPS agent already defined value for property {0}";
98
130
  ErrorMessage.DuplicateApiKeyInHeader = "The request already defined api key in request header with name {0}.";
99
131
  ErrorMessage.DuplicateApiKeyInQueryParam = "The request already defined api key in query parameter with name {0}.";
132
+ ErrorMessage.OnlySupportInQueryActivity = "The handleMessageExtensionQueryWithToken only support in handleTeamsMessagingExtensionQuery with composeExtension/query type.";
100
133
  /**
101
134
  * Error class with code and message thrown by the SDK.
102
- *
103
- * @beta
104
135
  */
105
136
  class ErrorWithCode extends Error {
106
137
  /**
@@ -108,8 +139,6 @@ class ErrorWithCode extends Error {
108
139
  *
109
140
  * @param {string} message - error message.
110
141
  * @param {ErrorCode} code - error code.
111
- *
112
- * @beta
113
142
  */
114
143
  constructor(message, code) {
115
144
  if (!code) {
@@ -127,8 +156,6 @@ class ErrorWithCode extends Error {
127
156
  // Licensed under the MIT license.
128
157
  /**
129
158
  * Log level.
130
- *
131
- * @beta
132
159
  */
133
160
  var LogLevel;
134
161
  (function (LogLevel) {
@@ -153,8 +180,6 @@ var LogLevel;
153
180
  * Update log level helper.
154
181
  *
155
182
  * @param { LogLevel } level - log level in configuration
156
- *
157
- * @beta
158
183
  */
159
184
  function setLogLevel(level) {
160
185
  internalLogger.level = level;
@@ -163,8 +188,6 @@ function setLogLevel(level) {
163
188
  * Get log level.
164
189
  *
165
190
  * @returns Log level
166
- *
167
- * @beta
168
191
  */
169
192
  function getLogLevel() {
170
193
  return internalLogger.level;
@@ -239,8 +262,6 @@ const internalLogger = new InternalLogger();
239
262
  * error: console.error,
240
263
  * });
241
264
  * ```
242
- *
243
- * @beta
244
265
  */
245
266
  function setLogger(logger) {
246
267
  internalLogger.customLogger = logger;
@@ -258,8 +279,6 @@ function setLogger(logger) {
258
279
  * }
259
280
  * });
260
281
  * ```
261
- *
262
- * @beta
263
282
  */
264
283
  function setLogFunction(logFunction) {
265
284
  internalLogger.customLogFunction = logFunction;
@@ -302,6 +321,7 @@ function getUserInfoFromSsoToken(ssoToken) {
302
321
  const userInfo = {
303
322
  displayName: tokenObject.name,
304
323
  objectId: tokenObject.oid,
324
+ tenantId: tokenObject.tid,
305
325
  preferredUserName: "",
306
326
  };
307
327
  if (tokenObject.ver === "2.0") {
@@ -410,8 +430,6 @@ function validateScopesType(value) {
410
430
  *
411
431
  * @remarks
412
432
  * Only works in in server side.
413
- *
414
- * @beta
415
433
  */
416
434
  class AppCredential {
417
435
  /**
@@ -419,7 +437,6 @@ class AppCredential {
419
437
  *
420
438
  * @remarks
421
439
  * Only works in in server side.
422
- * @beta
423
440
  */
424
441
  constructor(authConfig) {
425
442
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "AppCredential"), ErrorCode.RuntimeNotSupported);
@@ -429,7 +446,6 @@ class AppCredential {
429
446
  *
430
447
  * @remarks
431
448
  * Only works in in server side.
432
- * @beta
433
449
  */
434
450
  async getToken(scopes, options) {
435
451
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "AppCredential"), ErrorCode.RuntimeNotSupported);
@@ -442,8 +458,6 @@ class AppCredential {
442
458
  *
443
459
  * @remarks
444
460
  * Can only be used in server side.
445
- *
446
- * @beta
447
461
  */
448
462
  class OnBehalfOfUserCredential {
449
463
  /**
@@ -451,7 +465,6 @@ class OnBehalfOfUserCredential {
451
465
  *
452
466
  * @remarks
453
467
  * Can Only works in in server side.
454
- * @beta
455
468
  */
456
469
  constructor(ssoToken, config) {
457
470
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "OnBehalfOfUserCredential"), ErrorCode.RuntimeNotSupported);
@@ -460,7 +473,6 @@ class OnBehalfOfUserCredential {
460
473
  * Get access token from credential.
461
474
  * @remarks
462
475
  * Can only be used in server side.
463
- * @beta
464
476
  */
465
477
  async getToken(scopes, options) {
466
478
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "OnBehalfOfUserCredential"), ErrorCode.RuntimeNotSupported);
@@ -469,7 +481,6 @@ class OnBehalfOfUserCredential {
469
481
  * Get basic user info from SSO token.
470
482
  * @remarks
471
483
  * Can only be used in server side.
472
- * @beta
473
484
  */
474
485
  getUserInfo() {
475
486
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "OnBehalfOfUserCredential"), ErrorCode.RuntimeNotSupported);
@@ -485,8 +496,6 @@ const loginPageHeight = 535;
485
496
  *
486
497
  * @remarks
487
498
  * Can only be used within Teams.
488
- *
489
- * @beta
490
499
  */
491
500
  class TeamsUserCredential {
492
501
  /**
@@ -510,8 +519,6 @@ class TeamsUserCredential {
510
519
  *
511
520
  * @throws {@link ErrorCode|InvalidConfiguration} when client id, initiate login endpoint or simple auth endpoint is not found in config.
512
521
  * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is nodeJS.
513
- *
514
- * @beta
515
522
  */
516
523
  constructor(authConfig) {
517
524
  internalLogger.info("Create teams user credential");
@@ -533,20 +540,19 @@ class TeamsUserCredential {
533
540
  * await credential.login("https://graph.microsoft.com/User.Read Calendars.Read"); // multiple scopes using string
534
541
  * ```
535
542
  * @param scopes - The list of scopes for which the token will have access, before that, we will request user to consent.
543
+ * @param { string[] } resources - The optional list of resources for full trust Teams apps.
536
544
  *
537
545
  * @throws {@link ErrorCode|InternalError} when failed to login with unknown error.
538
546
  * @throws {@link ErrorCode|ConsentFailed} when user canceled or failed to consent.
539
547
  * @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
540
548
  * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is nodeJS.
541
- *
542
- * @beta
543
549
  */
544
- async login(scopes) {
550
+ async login(scopes, resources) {
545
551
  validateScopesType(scopes);
546
552
  const scopesStr = typeof scopes === "string" ? scopes : scopes.join(" ");
547
553
  internalLogger.info(`Popup login page to get user's access token with scopes: ${scopesStr}`);
548
554
  if (!this.initialized) {
549
- await this.init();
555
+ await this.init(resources);
550
556
  }
551
557
  await app.initialize();
552
558
  let result;
@@ -595,6 +601,9 @@ class TeamsUserCredential {
595
601
  * Get access token from credential.
596
602
  *
597
603
  * Important: Access tokens are stored in sessionStorage, read more here: https://aka.ms/teamsfx-session-storage-notice
604
+ * Important: Full trust applications do not read the resource information from the webApplicationInfo section of the app
605
+ * manifest. Instead, this resource (along with any additional resources from which to request tokens) must be provided
606
+ * as a list of resources to the getToken() method through a GetTeamsUserTokenOptions object.
598
607
  *
599
608
  * @example
600
609
  * ```typescript
@@ -608,6 +617,9 @@ class TeamsUserCredential {
608
617
  * await credential.getToken("User.Read Application.Read.All") // Get Graph access token for multiple scopes using space-separated string
609
618
  * await credential.getToken("https://graph.microsoft.com/User.Read") // Get Graph access token with full resource URI
610
619
  * await credential.getToken(["https://outlook.office.com/Mail.Read"]) // Get Outlook access token
620
+ *
621
+ * const options: GetTeamsUserTokenOptions = { resources: ["https://domain.example.com"] }; // set up resources for full trust apps.
622
+ * await credential.getToken([], options) // Get sso token from teams client - only use this approach for full trust apps.
611
623
  * ```
612
624
  *
613
625
  * @param {string | string[]} scopes - The list of scopes for which the token will have access.
@@ -622,12 +634,12 @@ class TeamsUserCredential {
622
634
  * If scopes is empty string or array, it returns SSO token.
623
635
  * If scopes is non-empty, it returns access token for target scope.
624
636
  * Throw error if get access token failed.
625
- *
626
- * @beta
627
637
  */
628
638
  async getToken(scopes, options) {
639
+ var _a;
629
640
  validateScopesType(scopes);
630
- const ssoToken = await this.getSSOToken();
641
+ const resources = (_a = options) === null || _a === void 0 ? void 0 : _a.resources;
642
+ const ssoToken = await this.getSSOToken(resources);
631
643
  const scopeStr = typeof scopes === "string" ? scopes : scopes.join(" ");
632
644
  if (scopeStr === "") {
633
645
  internalLogger.info("Get SSO token");
@@ -636,7 +648,7 @@ class TeamsUserCredential {
636
648
  else {
637
649
  internalLogger.info("Get access token with scopes: " + scopeStr);
638
650
  if (!this.initialized) {
639
- await this.init();
651
+ await this.init(resources);
640
652
  }
641
653
  let tokenResponse;
642
654
  const scopesArray = typeof scopes === "string" ? scopes.split(" ") : scopes;
@@ -682,6 +694,8 @@ class TeamsUserCredential {
682
694
  /**
683
695
  * Get basic user info from SSO token
684
696
  *
697
+ * @param {string[]} resources - The optional list of resources for full trust Teams apps.
698
+ *
685
699
  * @example
686
700
  * ```typescript
687
701
  * const currentUser = await credential.getUserInfo();
@@ -692,16 +706,14 @@ class TeamsUserCredential {
692
706
  * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is nodeJS.
693
707
  *
694
708
  * @returns Basic user info with user displayName, objectId and preferredUserName.
695
- *
696
- * @beta
697
709
  */
698
- async getUserInfo() {
710
+ async getUserInfo(resources) {
699
711
  internalLogger.info("Get basic user info from SSO token");
700
- const ssoToken = await this.getSSOToken();
712
+ const ssoToken = await this.getSSOToken(resources);
701
713
  return getUserInfoFromSsoToken(ssoToken.token);
702
714
  }
703
- async init() {
704
- const ssoToken = await this.getSSOToken();
715
+ async init(resources) {
716
+ const ssoToken = await this.getSSOToken(resources);
705
717
  const info = getTenantIdAndLoginHintFromSsoToken(ssoToken.token);
706
718
  this.loginHint = info.loginHint;
707
719
  this.tid = info.tid;
@@ -720,19 +732,29 @@ class TeamsUserCredential {
720
732
  /**
721
733
  * Get SSO token using teams SDK
722
734
  * It will try to get SSO token from memory first, if SSO token doesn't exist or about to expired, then it will using teams SDK to get SSO token
735
+ *
736
+ * @param {string[]} resources - The optional list of resources for full trust Teams apps.
737
+ *
723
738
  * @returns SSO token
724
739
  */
725
- async getSSOToken() {
740
+ async getSSOToken(resources) {
726
741
  if (this.ssoToken) {
727
742
  if (this.ssoToken.expiresOnTimestamp - Date.now() > tokenRefreshTimeSpanInMillisecond) {
728
743
  internalLogger.verbose("Get SSO token from memory cache");
729
744
  return this.ssoToken;
730
745
  }
731
746
  }
732
- const params = {};
747
+ const params = { resources: resources !== null && resources !== void 0 ? resources : [] };
733
748
  let token;
734
749
  try {
735
750
  await app.initialize();
751
+ }
752
+ catch (err) {
753
+ const errorMsg = "Initialize teams sdk failed due to not running inside Teams environment";
754
+ internalLogger.error(errorMsg);
755
+ throw new ErrorWithCode(errorMsg, ErrorCode.InternalError);
756
+ }
757
+ try {
736
758
  token = await authentication.getAuthToken(params);
737
759
  }
738
760
  catch (err) {
@@ -796,24 +818,12 @@ class TeamsUserCredential {
796
818
  throw new ErrorWithCode(errorMessage, ErrorCode.InternalError);
797
819
  }
798
820
  }
799
- // Come from here: https://github.com/wictorwilen/msteams-react-base-component/blob/master/src/useTeams.ts
800
- checkInTeams() {
801
- if ((window.parent === window.self && window.nativeInterface) ||
802
- window.navigator.userAgent.includes("Teams/") ||
803
- window.name === "embedded-page-container" ||
804
- window.name === "extension-tab-frame") {
805
- return true;
806
- }
807
- return false;
808
- }
809
821
  }
810
822
 
811
823
  // Copyright (c) Microsoft Corporation.
812
824
  const defaultScope = "https://graph.microsoft.com/.default";
813
825
  /**
814
826
  * Microsoft Graph auth provider for Teams Framework
815
- *
816
- * @beta
817
827
  */
818
828
  class MsGraphAuthProvider {
819
829
  /**
@@ -825,8 +835,6 @@ class MsGraphAuthProvider {
825
835
  * @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
826
836
  *
827
837
  * @returns An instance of MsGraphAuthProvider.
828
- *
829
- * @beta
830
838
  */
831
839
  constructor(teamsfx, scopes) {
832
840
  this.teamsfx = teamsfx;
@@ -918,8 +926,6 @@ class MsGraphAuthProvider {
918
926
  * @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
919
927
  *
920
928
  * @returns Graph client with specified scopes.
921
- *
922
- * @beta
923
929
  */
924
930
  function createMicrosoftGraphClient(teamsfx, scopes) {
925
931
  internalLogger.info("Create Microsoft Graph Client");
@@ -935,7 +941,6 @@ function createMicrosoftGraphClient(teamsfx, scopes) {
935
941
  * Generate connection configuration consumed by tedious.
936
942
  * @remarks
937
943
  * Only works in in server side.
938
- * @beta
939
944
  */
940
945
  async function getTediousConnectionConfig(teamsfx, databaseName) {
941
946
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultTediousConnectionConfiguration"), ErrorCode.RuntimeNotSupported);
@@ -989,8 +994,6 @@ async function getTediousConnectionConfig(teamsfx, databaseName) {
989
994
  * }
990
995
  * ]));
991
996
  * ```
992
- *
993
- * @beta
994
997
  */
995
998
  class TeamsBotSsoPrompt {
996
999
  /**
@@ -1001,8 +1004,6 @@ class TeamsBotSsoPrompt {
1001
1004
  *
1002
1005
  * @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
1003
1006
  * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1004
- *
1005
- * @beta
1006
1007
  */
1007
1008
  constructor(teamsfx, dialogId, settings) {
1008
1009
  this.teamsfx = teamsfx;
@@ -1022,8 +1023,6 @@ class TeamsBotSsoPrompt {
1022
1023
  * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1023
1024
  *
1024
1025
  * @returns A `Promise` representing the asynchronous operation.
1025
- *
1026
- * @beta
1027
1026
  */
1028
1027
  async beginDialog(dc) {
1029
1028
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotSsoPrompt"), ErrorCode.RuntimeNotSupported);
@@ -1043,8 +1042,6 @@ class TeamsBotSsoPrompt {
1043
1042
  *
1044
1043
  * @throws {@link ErrorCode|ChannelNotSupported} when bot channel is not MS Teams.
1045
1044
  * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1046
- *
1047
- * @beta
1048
1045
  */
1049
1046
  async continueDialog(dc) {
1050
1047
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotSsoPrompt"), ErrorCode.RuntimeNotSupported);
@@ -1063,8 +1060,6 @@ class TeamsBotSsoPrompt {
1063
1060
  * ```typescript
1064
1061
  * const client = createApiClient("https://my-api-endpoint-base-url", new BasicAuthProvider("xxx","xxx"));
1065
1062
  * ```
1066
- *
1067
- * @beta
1068
1063
  */
1069
1064
  function createApiClient(apiEndpoint, authProvider) {
1070
1065
  // Add a request interceptor
@@ -1080,14 +1075,10 @@ function createApiClient(apiEndpoint, authProvider) {
1080
1075
  // Copyright (c) Microsoft Corporation.
1081
1076
  /**
1082
1077
  * Provider that handles Bearer Token authentication
1083
- *
1084
- * @beta
1085
1078
  */
1086
1079
  class BearerTokenAuthProvider {
1087
1080
  /**
1088
1081
  * @param { () => Promise<string> } getToken - Function that returns the content of bearer token used in http request
1089
- *
1090
- * @beta
1091
1082
  */
1092
1083
  constructor(getToken) {
1093
1084
  this.getToken = getToken;
@@ -1101,8 +1092,6 @@ class BearerTokenAuthProvider {
1101
1092
  * @returns Updated axios request config.
1102
1093
  *
1103
1094
  * @throws {@link ErrorCode|AuthorizationInfoAlreadyExists} - when Authorization header already exists in request configuration.
1104
- *
1105
- * @beta
1106
1095
  */
1107
1096
  async AddAuthenticationInfo(config) {
1108
1097
  const token = await this.getToken();
@@ -1120,8 +1109,6 @@ class BearerTokenAuthProvider {
1120
1109
  // Copyright (c) Microsoft Corporation.
1121
1110
  /**
1122
1111
  * Provider that handles Basic authentication
1123
- *
1124
- * @beta
1125
1112
  */
1126
1113
  class BasicAuthProvider {
1127
1114
  /**
@@ -1131,8 +1118,6 @@ class BasicAuthProvider {
1131
1118
  *
1132
1119
  * @throws {@link ErrorCode|InvalidParameter} - when username or password is empty.
1133
1120
  * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1134
- *
1135
- * @beta
1136
1121
  */
1137
1122
  constructor(userName, password) {
1138
1123
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "BasicAuthProvider"), ErrorCode.RuntimeNotSupported);
@@ -1147,8 +1132,6 @@ class BasicAuthProvider {
1147
1132
  *
1148
1133
  * @throws {@link ErrorCode|AuthorizationInfoAlreadyExists} - when Authorization header or auth property already exists in request configuration.
1149
1134
  * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1150
- *
1151
- * @beta
1152
1135
  */
1153
1136
  async AddAuthenticationInfo(config) {
1154
1137
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "BasicAuthProvider"), ErrorCode.RuntimeNotSupported);
@@ -1158,8 +1141,6 @@ class BasicAuthProvider {
1158
1141
  // Copyright (c) Microsoft Corporation.
1159
1142
  /**
1160
1143
  * Provider that handles API Key authentication
1161
- *
1162
- * @beta
1163
1144
  */
1164
1145
  class ApiKeyProvider {
1165
1146
  /**
@@ -1170,8 +1151,6 @@ class ApiKeyProvider {
1170
1151
  *
1171
1152
  * @throws {@link ErrorCode|InvalidParameter} - when key name or key value is empty.
1172
1153
  * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1173
- *
1174
- * @beta
1175
1154
  */
1176
1155
  constructor(keyName, keyValue, keyLocation) {
1177
1156
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "ApiKeyProvider"), ErrorCode.RuntimeNotSupported);
@@ -1186,8 +1165,6 @@ class ApiKeyProvider {
1186
1165
  *
1187
1166
  * @throws {@link ErrorCode|AuthorizationInfoAlreadyExists} - when API key already exists in request header or url query parameter.
1188
1167
  * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1189
- *
1190
- * @beta
1191
1168
  */
1192
1169
  async AddAuthenticationInfo(config) {
1193
1170
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "ApiKeyProvider"), ErrorCode.RuntimeNotSupported);
@@ -1195,8 +1172,6 @@ class ApiKeyProvider {
1195
1172
  }
1196
1173
  /**
1197
1174
  * Define available location for API Key location
1198
- *
1199
- * @beta
1200
1175
  */
1201
1176
  var ApiKeyLocation;
1202
1177
  (function (ApiKeyLocation) {
@@ -1213,15 +1188,11 @@ var ApiKeyLocation;
1213
1188
  // Copyright (c) Microsoft Corporation.
1214
1189
  /**
1215
1190
  * Provider that handles Certificate authentication
1216
- *
1217
- * @beta
1218
1191
  */
1219
1192
  class CertificateAuthProvider {
1220
1193
  /**
1221
1194
  *
1222
1195
  * @param { SecureContextOptions } certOption - information about the cert used in http requests
1223
- *
1224
- * @beta
1225
1196
  */
1226
1197
  constructor(certOption) {
1227
1198
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CertificateAuthProvider"), ErrorCode.RuntimeNotSupported);
@@ -1236,8 +1207,6 @@ class CertificateAuthProvider {
1236
1207
  *
1237
1208
  * @throws {@link ErrorCode|InvalidParameter} - when custom httpsAgent in the request has duplicate properties with certOption provided in constructor.
1238
1209
  * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1239
- *
1240
- * @beta
1241
1210
  */
1242
1211
  async AddAuthenticationInfo(config) {
1243
1212
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CertificateAuthProvider"), ErrorCode.RuntimeNotSupported);
@@ -1279,8 +1248,6 @@ function createPfxCertOption(pfx, options) {
1279
1248
  // Licensed under the MIT license.
1280
1249
  /**
1281
1250
  * Identity type to use in authentication.
1282
- *
1283
- * @beta
1284
1251
  */
1285
1252
  var IdentityType;
1286
1253
  (function (IdentityType) {
@@ -1297,7 +1264,6 @@ var IdentityType;
1297
1264
  // Copyright (c) Microsoft Corporation.
1298
1265
  /**
1299
1266
  * A class providing credential and configuration.
1300
- * @beta
1301
1267
  */
1302
1268
  class TeamsFx {
1303
1269
  constructor(identityType, customConfig) {
@@ -1310,8 +1276,9 @@ class TeamsFx {
1310
1276
  this.configuration = new Map();
1311
1277
  this.loadFromEnv();
1312
1278
  if (customConfig) {
1313
- for (const key of Object.keys(customConfig)) {
1314
- const value = customConfig[key];
1279
+ const myConfig = Object.assign({}, customConfig);
1280
+ for (const key of Object.keys(myConfig)) {
1281
+ const value = myConfig[key];
1315
1282
  if (value) {
1316
1283
  this.configuration.set(key, value);
1317
1284
  }
@@ -1359,11 +1326,11 @@ class TeamsFx {
1359
1326
  }
1360
1327
  return this.teamsUserCredential;
1361
1328
  }
1362
- async getUserInfo() {
1363
- return await this.getCredential().getUserInfo();
1329
+ async getUserInfo(resources) {
1330
+ return await this.getCredential().getUserInfo(resources);
1364
1331
  }
1365
- async login(scopes) {
1366
- await this.getCredential().login(scopes);
1332
+ async login(scopes, resources) {
1333
+ await this.getCredential().login(scopes, resources);
1367
1334
  }
1368
1335
  setSsoToken(ssoToken) {
1369
1336
  return this;
@@ -1391,6 +1358,65 @@ class TeamsFx {
1391
1358
  }
1392
1359
  }
1393
1360
 
1361
+ // Copyright (c) Microsoft Corporation.
1362
+ // Licensed under the MIT license.
1363
+ /**
1364
+ * The target type where the notification will be sent to.
1365
+ *
1366
+ * @remarks
1367
+ * - "Channel" means to a team channel. (By default, notification to a team will be sent to its "General" channel.)
1368
+ * - "Group" means to a group chat.
1369
+ * - "Person" means to a personal chat.
1370
+ */
1371
+ var NotificationTargetType;
1372
+ (function (NotificationTargetType) {
1373
+ /**
1374
+ * The notification will be sent to a team channel.
1375
+ * (By default, notification to a team will be sent to its "General" channel.)
1376
+ */
1377
+ NotificationTargetType["Channel"] = "Channel";
1378
+ /**
1379
+ * The notification will be sent to a group chat.
1380
+ */
1381
+ NotificationTargetType["Group"] = "Group";
1382
+ /**
1383
+ * The notification will be sent to a personal chat.
1384
+ */
1385
+ NotificationTargetType["Person"] = "Person";
1386
+ })(NotificationTargetType || (NotificationTargetType = {}));
1387
+ /**
1388
+ * Options used to control how the response card will be sent to users.
1389
+ */
1390
+ var AdaptiveCardResponse;
1391
+ (function (AdaptiveCardResponse) {
1392
+ /**
1393
+ * The response card will be replaced the current one for the interactor who trigger the action.
1394
+ */
1395
+ AdaptiveCardResponse[AdaptiveCardResponse["ReplaceForInteractor"] = 0] = "ReplaceForInteractor";
1396
+ /**
1397
+ * The response card will be replaced the current one for all users in the chat.
1398
+ */
1399
+ AdaptiveCardResponse[AdaptiveCardResponse["ReplaceForAll"] = 1] = "ReplaceForAll";
1400
+ /**
1401
+ * The response card will be sent as a new message for all users in the chat.
1402
+ */
1403
+ AdaptiveCardResponse[AdaptiveCardResponse["NewForAll"] = 2] = "NewForAll";
1404
+ })(AdaptiveCardResponse || (AdaptiveCardResponse = {}));
1405
+ /**
1406
+ * Status code for an `application/vnd.microsoft.error` invoke response.
1407
+ */
1408
+ var InvokeResponseErrorCode;
1409
+ (function (InvokeResponseErrorCode) {
1410
+ /**
1411
+ * Invalid request.
1412
+ */
1413
+ InvokeResponseErrorCode[InvokeResponseErrorCode["BadRequest"] = 400] = "BadRequest";
1414
+ /**
1415
+ * Internal server error.
1416
+ */
1417
+ InvokeResponseErrorCode[InvokeResponseErrorCode["InternalServerError"] = 500] = "InternalServerError";
1418
+ })(InvokeResponseErrorCode || (InvokeResponseErrorCode = {}));
1419
+
1394
1420
  // Copyright (c) Microsoft Corporation.
1395
1421
  /**
1396
1422
  * Provide utilities for bot conversation, including:
@@ -1399,8 +1425,6 @@ class TeamsFx {
1399
1425
  *
1400
1426
  * @remarks
1401
1427
  * Only work on server side.
1402
- *
1403
- * @beta
1404
1428
  */
1405
1429
  class ConversationBot {
1406
1430
  /**
@@ -1410,8 +1434,6 @@ class ConversationBot {
1410
1434
  *
1411
1435
  * @remarks
1412
1436
  * Only work on server side.
1413
- *
1414
- * @beta
1415
1437
  */
1416
1438
  constructor(options) {
1417
1439
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "ConversationBot"), ErrorCode.RuntimeNotSupported);
@@ -1425,14 +1447,53 @@ class ConversationBot {
1425
1447
  *
1426
1448
  * @remarks
1427
1449
  * Only work on server side.
1428
- *
1429
- * @beta
1430
1450
  */
1431
1451
  async requestHandler(req, res, logic) {
1432
1452
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "ConversationBot"), ErrorCode.RuntimeNotSupported);
1433
1453
  }
1434
1454
  }
1435
1455
 
1456
+ // Copyright (c) Microsoft Corporation.
1457
+ /*
1458
+ * Sso execution dialog, use to handle sso command
1459
+ */
1460
+ class BotSsoExecutionDialog {
1461
+ /**
1462
+ * Creates a new instance of the BotSsoExecutionDialog.
1463
+ * @param dedupStorage Helper storage to remove duplicated messages
1464
+ * @param requiredScopes The list of scopes for which the token will have access
1465
+ * @param teamsfx {@link TeamsFx} instance for authentication
1466
+ */
1467
+ constructor(dedupStorage, requiredScopes, teamsfx) {
1468
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "BotSsoExecutionDialog"), ErrorCode.RuntimeNotSupported);
1469
+ }
1470
+ /**
1471
+ * Add TeamsFxBotSsoCommandHandler instance
1472
+ * @param handler {@link BotSsoExecutionDialogHandler} callback function
1473
+ * @param triggerPatterns The trigger pattern
1474
+ */
1475
+ addCommand(handler, triggerPatterns) {
1476
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "BotSsoExecutionDialog"), ErrorCode.RuntimeNotSupported);
1477
+ }
1478
+ /**
1479
+ * The run method handles the incoming activity (in the form of a DialogContext) and passes it through the dialog system.
1480
+ *
1481
+ * @param context The context object for the current turn.
1482
+ * @param accessor The instance of StatePropertyAccessor for dialog system.
1483
+ */
1484
+ async run(context, accessor) {
1485
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "BotSsoExecutionDialog"), ErrorCode.RuntimeNotSupported);
1486
+ }
1487
+ /**
1488
+ * Called when the component is ending.
1489
+ *
1490
+ * @param context Context for the current turn of conversation.
1491
+ */
1492
+ async onEndDialog(context) {
1493
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "BotSsoExecutionDialog"), ErrorCode.RuntimeNotSupported);
1494
+ }
1495
+ }
1496
+
1436
1497
  // Copyright (c) Microsoft Corporation.
1437
1498
  /**
1438
1499
  * Send a plain text message to a notification target.
@@ -1442,11 +1503,10 @@ class ConversationBot {
1442
1503
  *
1443
1504
  * @param target - the notification target.
1444
1505
  * @param text - the plain text message.
1506
+ * @param onError - an optional error handler that can catch exceptions during message sending.
1445
1507
  * @returns A `Promise` representing the asynchronous operation.
1446
- *
1447
- * @beta
1448
1508
  */
1449
- function sendMessage(target, text) {
1509
+ function sendMessage(target, text, onError) {
1450
1510
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "sendMessage"), ErrorCode.RuntimeNotSupported);
1451
1511
  }
1452
1512
  /**
@@ -1457,11 +1517,10 @@ function sendMessage(target, text) {
1457
1517
  *
1458
1518
  * @param target - the notification target.
1459
1519
  * @param card - the adaptive card raw JSON.
1520
+ * @param onError - an optional error handler that can catch exceptions during adaptive card sending.
1460
1521
  * @returns A `Promise` representing the asynchronous operation.
1461
- *
1462
- * @beta
1463
1522
  */
1464
- function sendAdaptiveCard(target, card) {
1523
+ function sendAdaptiveCard(target, card, onError) {
1465
1524
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "sendAdaptiveCard"), ErrorCode.RuntimeNotSupported);
1466
1525
  }
1467
1526
  /**
@@ -1471,8 +1530,6 @@ function sendAdaptiveCard(target, card) {
1471
1530
  * Only work on server side.
1472
1531
  *
1473
1532
  * It's recommended to get channels from {@link TeamsBotInstallation.channels()}.
1474
- *
1475
- * @beta
1476
1533
  */
1477
1534
  class Channel {
1478
1535
  /**
@@ -1485,8 +1542,6 @@ class Channel {
1485
1542
  *
1486
1543
  * @param parent - The parent {@link TeamsBotInstallation} where this channel is created from.
1487
1544
  * @param info - Detailed channel information.
1488
- *
1489
- * @beta
1490
1545
  */
1491
1546
  constructor(parent, info) {
1492
1547
  /**
@@ -1494,10 +1549,8 @@ class Channel {
1494
1549
  *
1495
1550
  * @remarks
1496
1551
  * Only work on server side.
1497
- *
1498
- * @beta
1499
1552
  */
1500
- this.type = "Channel";
1553
+ this.type = NotificationTargetType.Channel;
1501
1554
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Channel"), ErrorCode.RuntimeNotSupported);
1502
1555
  }
1503
1556
  /**
@@ -1507,11 +1560,10 @@ class Channel {
1507
1560
  * Only work on server side.
1508
1561
  *
1509
1562
  * @param text - the plain text message.
1510
- * @returns A `Promise` representing the asynchronous operation.
1511
- *
1512
- * @beta
1563
+ * @param onError - an optional error handler that can catch exceptions during message sending.
1564
+ * @returns the response of sending message.
1513
1565
  */
1514
- sendMessage(text) {
1566
+ sendMessage(text, onError) {
1515
1567
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Channel"), ErrorCode.RuntimeNotSupported);
1516
1568
  }
1517
1569
  /**
@@ -1521,11 +1573,10 @@ class Channel {
1521
1573
  * Only work on server side.
1522
1574
  *
1523
1575
  * @param card - the adaptive card raw JSON.
1524
- * @returns A `Promise` representing the asynchronous operation.
1525
- *
1526
- * @beta
1576
+ * @param onError - an optional error handler that can catch exceptions during adaptive card sending.
1577
+ * @returns the response of sending adaptive card message.
1527
1578
  */
1528
- async sendAdaptiveCard(card) {
1579
+ async sendAdaptiveCard(card, onError) {
1529
1580
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Channel"), ErrorCode.RuntimeNotSupported);
1530
1581
  }
1531
1582
  }
@@ -1536,8 +1587,6 @@ class Channel {
1536
1587
  * Only work on server side.
1537
1588
  *
1538
1589
  * It's recommended to get members from {@link TeamsBotInstallation.members()}.
1539
- *
1540
- * @beta
1541
1590
  */
1542
1591
  class Member {
1543
1592
  /**
@@ -1550,8 +1599,6 @@ class Member {
1550
1599
  *
1551
1600
  * @param parent - The parent {@link TeamsBotInstallation} where this member is created from.
1552
1601
  * @param account - Detailed member account information.
1553
- *
1554
- * @beta
1555
1602
  */
1556
1603
  constructor(parent, account) {
1557
1604
  /**
@@ -1559,10 +1606,8 @@ class Member {
1559
1606
  *
1560
1607
  * @remarks
1561
1608
  * Only work on server side.
1562
- *
1563
- * @beta
1564
1609
  */
1565
- this.type = "Person";
1610
+ this.type = NotificationTargetType.Person;
1566
1611
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Member"), ErrorCode.RuntimeNotSupported);
1567
1612
  }
1568
1613
  /**
@@ -1572,11 +1617,10 @@ class Member {
1572
1617
  * Only work on server side.
1573
1618
  *
1574
1619
  * @param text - the plain text message.
1575
- * @returns A `Promise` representing the asynchronous operation.
1576
- *
1577
- * @beta
1620
+ * @param onError - an optional error handler that can catch exceptions during message sending.
1621
+ * @returns the response of sending message.
1578
1622
  */
1579
- sendMessage(text) {
1623
+ sendMessage(text, onError) {
1580
1624
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Member"), ErrorCode.RuntimeNotSupported);
1581
1625
  }
1582
1626
  /**
@@ -1586,11 +1630,10 @@ class Member {
1586
1630
  * Only work on server side.
1587
1631
  *
1588
1632
  * @param card - the adaptive card raw JSON.
1589
- * @returns A `Promise` representing the asynchronous operation.
1590
- *
1591
- * @beta
1633
+ * @param onError - an optional error handler that can catch exceptions during adaptive card sending.
1634
+ * @returns the response of sending adaptive card message.
1592
1635
  */
1593
- async sendAdaptiveCard(card) {
1636
+ async sendAdaptiveCard(card, onError) {
1594
1637
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Member"), ErrorCode.RuntimeNotSupported);
1595
1638
  }
1596
1639
  }
@@ -1604,8 +1647,6 @@ class Member {
1604
1647
  * Only work on server side.
1605
1648
  *
1606
1649
  * It's recommended to get bot installations from {@link ConversationBot.installations()}.
1607
- *
1608
- * @beta
1609
1650
  */
1610
1651
  class TeamsBotInstallation {
1611
1652
  /**
@@ -1618,8 +1659,6 @@ class TeamsBotInstallation {
1618
1659
  *
1619
1660
  * @param adapter - the bound `BotFrameworkAdapter`.
1620
1661
  * @param conversationReference - the bound `ConversationReference`.
1621
- *
1622
- * @beta
1623
1662
  */
1624
1663
  constructor(adapter, conversationReference) {
1625
1664
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
@@ -1631,11 +1670,10 @@ class TeamsBotInstallation {
1631
1670
  * Only work on server side.
1632
1671
  *
1633
1672
  * @param text - the plain text message.
1634
- * @returns A `Promise` representing the asynchronous operation.
1635
- *
1636
- * @beta
1673
+ * @param onError - an optional error handler that can catch exceptions during message sending.
1674
+ * @returns the response of sending message.
1637
1675
  */
1638
- sendMessage(text) {
1676
+ sendMessage(text, onError) {
1639
1677
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
1640
1678
  }
1641
1679
  /**
@@ -1645,11 +1683,10 @@ class TeamsBotInstallation {
1645
1683
  * Only work on server side.
1646
1684
  *
1647
1685
  * @param card - the adaptive card raw JSON.
1648
- * @returns A `Promise` representing the asynchronous operation.
1649
- *
1650
- * @beta
1686
+ * @param onError - an optional error handler that can catch exceptions during adaptive card sending.
1687
+ * @returns the response of sending adaptive card message.
1651
1688
  */
1652
- sendAdaptiveCard(card) {
1689
+ sendAdaptiveCard(card, onError) {
1653
1690
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
1654
1691
  }
1655
1692
  /**
@@ -1659,8 +1696,6 @@ class TeamsBotInstallation {
1659
1696
  * Only work on server side.
1660
1697
  *
1661
1698
  * @returns an array of channels if bot is installed into a team, otherwise returns an empty array.
1662
- *
1663
- * @beta
1664
1699
  */
1665
1700
  async channels() {
1666
1701
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
@@ -1672,12 +1707,18 @@ class TeamsBotInstallation {
1672
1707
  * Only work on server side.
1673
1708
  *
1674
1709
  * @returns an array of members from where the bot is installed.
1675
- *
1676
- * @beta
1677
1710
  */
1678
1711
  async members() {
1679
1712
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
1680
1713
  }
1714
+ /**
1715
+ * Get team details from this bot installation
1716
+ *
1717
+ * @returns the team details if bot is installed into a team, otherwise returns undefined.
1718
+ */
1719
+ async getTeamDetails() {
1720
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
1721
+ }
1681
1722
  }
1682
1723
  /**
1683
1724
  * Provide static utilities for bot notification.
@@ -1703,8 +1744,6 @@ class TeamsBotInstallation {
1703
1744
  * }
1704
1745
  * }
1705
1746
  * ```
1706
- *
1707
- * @beta
1708
1747
  */
1709
1748
  class NotificationBot {
1710
1749
  /**
@@ -1717,8 +1756,6 @@ class NotificationBot {
1717
1756
  *
1718
1757
  * @param adapter - the bound `BotFrameworkAdapter`
1719
1758
  * @param options - initialize options
1720
- *
1721
- * @beta
1722
1759
  */
1723
1760
  constructor(adapter, options) {
1724
1761
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
@@ -1732,13 +1769,91 @@ class NotificationBot {
1732
1769
  * The result is retrieving from the persisted storage.
1733
1770
  *
1734
1771
  * @returns - an array of {@link TeamsBotInstallation}.
1735
- *
1736
- * @beta
1737
1772
  */
1738
1773
  static async installations() {
1739
1774
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1740
1775
  }
1741
- }
1776
+ /**
1777
+ * Returns the first {@link Member} where predicate is true, and undefined otherwise.
1778
+ *
1779
+ * @remarks
1780
+ * Only work on server side.
1781
+ *
1782
+ * @param predicate find calls predicate once for each member of the installation,
1783
+ * until it finds one where predicate returns true. If such a member is found, find
1784
+ * immediately returns that member. Otherwise, find returns undefined.
1785
+ * @param scope the scope to find members from the installations
1786
+ * (personal chat, group chat, Teams channel).
1787
+ * @returns the first {@link Member} where predicate is true, and undefined otherwise.
1788
+ */
1789
+ async findMember(predicate, scope) {
1790
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1791
+ }
1792
+ /**
1793
+ * Returns the first {@link Channel} where predicate is true, and undefined otherwise.
1794
+ *
1795
+ * @remarks
1796
+ * Only work on server side.
1797
+ *
1798
+ * @param predicate find calls predicate once for each channel of the installation,
1799
+ * until it finds one where predicate returns true. If such a channel is found, find
1800
+ * immediately returns that channel. Otherwise, find returns undefined.
1801
+ * @returns the first {@link Channel} where predicate is true, and undefined otherwise.
1802
+ */
1803
+ async findChannel(predicate) {
1804
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1805
+ }
1806
+ /**
1807
+ * Returns all {@link Member} where predicate is true, and empty array otherwise.
1808
+ *
1809
+ * @remarks
1810
+ * Only work on server side.
1811
+ *
1812
+ * @param predicate find calls predicate for each member of the installation.
1813
+ * @param scope the scope to find members from the installations
1814
+ * (personal chat, group chat, Teams channel).
1815
+ * @returns an array of {@link Member} where predicate is true, and empty array otherwise.
1816
+ */
1817
+ async findAllMembers(predicate, scope) {
1818
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1819
+ }
1820
+ /**
1821
+ * Returns all {@link Channel} where predicate is true, and empty array otherwise.
1822
+ *
1823
+ * @remarks
1824
+ * Only work on server side.
1825
+ *
1826
+ * @param predicate find calls predicate for each channel of the installation.
1827
+ * @returns an array of {@link Channel} where predicate is true, and empty array otherwise.
1828
+ */
1829
+ async findAllChannels(predicate) {
1830
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1831
+ }
1832
+ }
1833
+ /**
1834
+ * The search scope when calling {@link NotificationBot.findMember} and {@link NotificationBot.findAllMembers}.
1835
+ * The search scope is a flagged enum and it can be combined with `|`.
1836
+ * For example, to search from personal chat and group chat, use `SearchScope.Person | SearchScope.Group`.
1837
+ */
1838
+ var SearchScope;
1839
+ (function (SearchScope) {
1840
+ /**
1841
+ * Search members from the installations in personal chat only.
1842
+ */
1843
+ SearchScope[SearchScope["Person"] = 1] = "Person";
1844
+ /**
1845
+ * Search members from the installations in group chat only.
1846
+ */
1847
+ SearchScope[SearchScope["Group"] = 2] = "Group";
1848
+ /**
1849
+ * Search members from the installations in Teams channel only.
1850
+ */
1851
+ SearchScope[SearchScope["Channel"] = 4] = "Channel";
1852
+ /**
1853
+ * Search members from all installations including personal chat, group chat and Teams channel.
1854
+ */
1855
+ SearchScope[SearchScope["All"] = 7] = "All";
1856
+ })(SearchScope || (SearchScope = {}));
1742
1857
 
1743
1858
  // Copyright (c) Microsoft Corporation.
1744
1859
  /**
@@ -1746,8 +1861,6 @@ class NotificationBot {
1746
1861
  *
1747
1862
  * @remarks
1748
1863
  * Only work on server side.
1749
- *
1750
- * @beta
1751
1864
  */
1752
1865
  class CommandBot {
1753
1866
  /**
@@ -1755,8 +1868,6 @@ class CommandBot {
1755
1868
  *
1756
1869
  * @param adapter The bound `BotFrameworkAdapter`.
1757
1870
  * @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.
1758
- *
1759
- * @beta
1760
1871
  */
1761
1872
  constructor(adapter, commands) {
1762
1873
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CommandBot"), ErrorCode.RuntimeNotSupported);
@@ -1768,8 +1879,6 @@ class CommandBot {
1768
1879
  *
1769
1880
  * @remarks
1770
1881
  * Only work on server side.
1771
- *
1772
- * @beta
1773
1882
  */
1774
1883
  registerCommand(command) {
1775
1884
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CommandBot"), ErrorCode.RuntimeNotSupported);
@@ -1781,13 +1890,74 @@ class CommandBot {
1781
1890
  *
1782
1891
  * @remarks
1783
1892
  * Only work on server side.
1784
- *
1785
- * @beta
1786
1893
  */
1787
1894
  registerCommands(commands) {
1788
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CommandnBot"), ErrorCode.RuntimeNotSupported);
1895
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CommandBot"), ErrorCode.RuntimeNotSupported);
1896
+ }
1897
+ /**
1898
+ * Registers a sso command into the command bot.
1899
+ *
1900
+ * @param command The command to register.
1901
+ */
1902
+ registerSsoCommand(ssoCommand) {
1903
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CommandBot"), ErrorCode.RuntimeNotSupported);
1904
+ }
1905
+ /**
1906
+ * Registers commands into the command bot.
1907
+ *
1908
+ * @param commands The commands to register.
1909
+ */
1910
+ registerSsoCommands(ssoCommands) {
1911
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CommandBot"), ErrorCode.RuntimeNotSupported);
1912
+ }
1913
+ }
1914
+
1915
+ /**
1916
+ * A card action bot to respond to adaptive card universal actions.
1917
+ *
1918
+ * @remarks
1919
+ * Only work on server side.
1920
+ */
1921
+ class CardActionBot {
1922
+ /**
1923
+ * Creates a new instance of the `CardActionBot`.
1924
+ *
1925
+ * @param adapter The bound `BotFrameworkAdapter`.
1926
+ * @param options - initialize options
1927
+ */
1928
+ constructor(adapter, options) {
1929
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CardActionBot"), ErrorCode.RuntimeNotSupported);
1789
1930
  }
1931
+ /**
1932
+ * Registers a card action handler to the bot.
1933
+ * @param actionHandler A card action handler to be registered.
1934
+ *
1935
+ * @remarks
1936
+ * Only work on server side.
1937
+ */
1938
+ registerHandler(actionHandler) {
1939
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CardActionBot"), ErrorCode.RuntimeNotSupported);
1940
+ }
1941
+ /**
1942
+ * Registers card action handlers to the bot.
1943
+ * @param actionHandlers A set of card action handlers to be registered.
1944
+ *
1945
+ * @remarks
1946
+ * Only work on server side.
1947
+ */
1948
+ registerHandlers(actionHandlers) {
1949
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CardActionBot"), ErrorCode.RuntimeNotSupported);
1950
+ }
1951
+ }
1952
+
1953
+ /**
1954
+ * Users execute query with SSO or Access Token.
1955
+ * @remarks
1956
+ * Only works in in server side.
1957
+ */
1958
+ async function handleMessageExtensionQueryWithToken(context, config, scopes, logic) {
1959
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "queryWithToken in message extension"), ErrorCode.RuntimeNotSupported);
1790
1960
  }
1791
1961
 
1792
- export { ApiKeyLocation, ApiKeyProvider, AppCredential, BasicAuthProvider, BearerTokenAuthProvider, CertificateAuthProvider, Channel, CommandBot, ConversationBot, ErrorCode, ErrorWithCode, IdentityType, LogLevel, Member, MsGraphAuthProvider, NotificationBot, OnBehalfOfUserCredential, TeamsBotInstallation, TeamsBotSsoPrompt, TeamsFx, TeamsUserCredential, createApiClient, createMicrosoftGraphClient, createPemCertOption, createPfxCertOption, getLogLevel, getTediousConnectionConfig, sendAdaptiveCard, sendMessage, setLogFunction, setLogLevel, setLogger };
1962
+ export { AdaptiveCardResponse, ApiKeyLocation, ApiKeyProvider, AppCredential, BasicAuthProvider, BearerTokenAuthProvider, BotSsoExecutionDialog, CardActionBot, CertificateAuthProvider, Channel, CommandBot, ConversationBot, ErrorCode, ErrorWithCode, IdentityType, InvokeResponseErrorCode, LogLevel, Member, MsGraphAuthProvider, NotificationBot, NotificationTargetType, OnBehalfOfUserCredential, TeamsBotInstallation, TeamsBotSsoPrompt, TeamsFx, TeamsUserCredential, createApiClient, createMicrosoftGraphClient, createPemCertOption, createPfxCertOption, getLogLevel, getTediousConnectionConfig, handleMessageExtensionQueryWithToken, sendAdaptiveCard, sendMessage, setLogFunction, setLogLevel, setLogger };
1793
1963
  //# sourceMappingURL=index.esm2017.js.map