@microsoft/teamsfx 2.2.3-alpha.dea6b9e8a.0 → 2.2.3-alpha.e432bab97.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.
@@ -773,8 +773,10 @@ class TeamsUserCredential {
773
773
 
774
774
  // Copyright (c) Microsoft Corporation.
775
775
  const defaultScope = "https://graph.microsoft.com/.default";
776
+ // eslint-disable-next-line no-secrets/no-secrets
776
777
  /**
777
778
  * Microsoft Graph auth provider for Teams Framework
779
+ * @deprecated Use `TokenCredentialAuthenticationProvider` from `@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials` instead.
778
780
  */
779
781
  class MsGraphAuthProvider {
780
782
  constructor(credentialOrTeamsFx, scopes) {
@@ -831,6 +833,14 @@ class MsGraphAuthProvider {
831
833
  // Copyright (c) Microsoft Corporation.
832
834
  /**
833
835
  * Get Microsoft graph client.
836
+ * @deprecated Use `TokenCredentialAuthenticationProvider` and `Client.initWithMiddleware` instead.
837
+ * ```typescript
838
+ * const authProvider = new TokenCredentialAuthenticationProvider(credential, { scopes: scope });
839
+ * const graph = Client.initWithMiddleware({
840
+ * authProvider: authProvider,
841
+ * });
842
+ * ```
843
+ *
834
844
  * @example
835
845
  * Get Microsoft graph client by TokenCredential
836
846
  * ```typescript
@@ -888,6 +898,14 @@ function createMicrosoftGraphClient(teamsfx, scopes) {
888
898
  // eslint-disable-next-line no-secrets/no-secrets
889
899
  /**
890
900
  * Get Microsoft graph client.
901
+ * @deprecated Use `TokenCredentialAuthenticationProvider` and `Client.initWithMiddleware` instead.
902
+ * ```typescript
903
+ * const authProvider = new TokenCredentialAuthenticationProvider(credential, { scopes: scope });
904
+ * const graph = Client.initWithMiddleware({
905
+ * authProvider: authProvider,
906
+ * });
907
+ * ```
908
+ *
891
909
  * @example
892
910
  * Get Microsoft graph client by TokenCredential
893
911
  * ```typescript
@@ -1787,6 +1805,8 @@ const ReservedKey = new Set([
1787
1805
  ]);
1788
1806
  /**
1789
1807
  * A class providing credential and configuration.
1808
+ * @deprecated Please use {@link TeamsUserCredential}
1809
+ * in browser environment and {@link OnBehalfOfUserCredential} or {@link AppCredential} in NodeJS.
1790
1810
  */
1791
1811
  class TeamsFx {
1792
1812
  /**
@@ -2467,6 +2487,7 @@ function cloneConversation(conversation) {
2467
2487
  */
2468
2488
  function getKey(reference) {
2469
2489
  var _a, _b;
2490
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
2470
2491
  return `_${(_a = reference.conversation) === null || _a === void 0 ? void 0 : _a.tenantId}_${(_b = reference.conversation) === null || _b === void 0 ? void 0 : _b.id}`;
2471
2492
  }
2472
2493
  /**
@@ -3608,8 +3629,7 @@ class DefaultBotSsoExecutionActivityHandler extends botbuilder.TeamsActivityHand
3608
3629
  timeout: (_h = (_g = ssoConfig.dialog) === null || _g === void 0 ? void 0 : _g.ssoPromptConfig) === null || _h === void 0 ? void 0 : _h.timeout,
3609
3630
  endOnInvalidMessage: (_k = (_j = ssoConfig.dialog) === null || _j === void 0 ? void 0 : _j.ssoPromptConfig) === null || _k === void 0 ? void 0 : _k.endOnInvalidMessage,
3610
3631
  };
3611
- const teamsfx = new TeamsFx(exports.IdentityType.User, Object.assign({}, customConfig));
3612
- this.ssoExecutionDialog = new BotSsoExecutionDialog(dedupStorage, settings, teamsfx);
3632
+ this.ssoExecutionDialog = new BotSsoExecutionDialog(dedupStorage, settings, customConfig, customConfig.initiateLoginEndpoint);
3613
3633
  this.conversationState = conversationState;
3614
3634
  this.dialogState = conversationState.createProperty("DialogState");
3615
3635
  this.userState = userState;
@@ -3779,9 +3799,12 @@ class ConversationBot$1 {
3779
3799
  // the default error handler
3780
3800
  adapter.onTurnError = (context, error) => tslib.__awaiter(this, void 0, void 0, function* () {
3781
3801
  // This check writes out errors to console.
3802
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
3782
3803
  console.error(`[onTurnError] unhandled error: ${error}`);
3783
3804
  // Send a trace activity, which will be displayed in Bot Framework Emulator
3784
- yield context.sendTraceActivity("OnTurnError Trace", `${error}`, "https://www.botframework.com/schemas/error", "TurnError");
3805
+ yield context.sendTraceActivity("OnTurnError Trace",
3806
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
3807
+ `${error}`, "https://www.botframework.com/schemas/error", "TurnError");
3785
3808
  // Send a message to the user
3786
3809
  yield context.sendActivity(`The bot encountered unhandled error: ${error.message}`);
3787
3810
  yield context.sendActivity("To continue to run this bot, please fix the bot source code.");
@@ -4064,6 +4087,7 @@ function executionWithTokenAndConfig(context, authConfig, initiateLoginEndpoint,
4064
4087
  }
4065
4088
  /**
4066
4089
  * execution in message extension with SSO token.
4090
+ * @deprecated Use {@link executionWithTokenAndConfig} instead.
4067
4091
  *
4068
4092
  * @param {TurnContext} context - The context object for the current turn.
4069
4093
  * @param {AuthenticationConfiguration} config - User custom the message extension authentication configuration.
@@ -4114,7 +4138,7 @@ function executionWithToken(context, config, scopes, logic) {
4114
4138
  // eslint-disable-next-line no-secrets/no-secrets
4115
4139
  /**
4116
4140
  * Users execute query in message extension with SSO or access token.
4117
- *
4141
+ * @deprecated Use {@link handleMessageExtensionQueryWithSSO} instead.
4118
4142
  *
4119
4143
  * @param {TurnContext} context - The context object for the current turn.
4120
4144
  * @param {AuthenticationConfiguration} config - User custom the message extension authentication configuration.