@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.
@@ -740,8 +740,10 @@ class TeamsUserCredential {
740
740
 
741
741
  // Copyright (c) Microsoft Corporation.
742
742
  const defaultScope = "https://graph.microsoft.com/.default";
743
+ // eslint-disable-next-line no-secrets/no-secrets
743
744
  /**
744
745
  * Microsoft Graph auth provider for Teams Framework
746
+ * @deprecated Use `TokenCredentialAuthenticationProvider` from `@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials` instead.
745
747
  */
746
748
  class MsGraphAuthProvider {
747
749
  constructor(credentialOrTeamsFx, scopes) {
@@ -796,6 +798,14 @@ class MsGraphAuthProvider {
796
798
  // Copyright (c) Microsoft Corporation.
797
799
  /**
798
800
  * Get Microsoft graph client.
801
+ * @deprecated Use `TokenCredentialAuthenticationProvider` and `Client.initWithMiddleware` instead.
802
+ * ```typescript
803
+ * const authProvider = new TokenCredentialAuthenticationProvider(credential, { scopes: scope });
804
+ * const graph = Client.initWithMiddleware({
805
+ * authProvider: authProvider,
806
+ * });
807
+ * ```
808
+ *
799
809
  * @example
800
810
  * Get Microsoft graph client by TokenCredential
801
811
  * ```typescript
@@ -853,6 +863,14 @@ function createMicrosoftGraphClient(teamsfx, scopes) {
853
863
  // eslint-disable-next-line no-secrets/no-secrets
854
864
  /**
855
865
  * Get Microsoft graph client.
866
+ * @deprecated Use `TokenCredentialAuthenticationProvider` and `Client.initWithMiddleware` instead.
867
+ * ```typescript
868
+ * const authProvider = new TokenCredentialAuthenticationProvider(credential, { scopes: scope });
869
+ * const graph = Client.initWithMiddleware({
870
+ * authProvider: authProvider,
871
+ * });
872
+ * ```
873
+ *
856
874
  * @example
857
875
  * Get Microsoft graph client by TokenCredential
858
876
  * ```typescript
@@ -1736,6 +1754,8 @@ const ReservedKey = new Set([
1736
1754
  ]);
1737
1755
  /**
1738
1756
  * A class providing credential and configuration.
1757
+ * @deprecated Please use {@link TeamsUserCredential}
1758
+ * in browser environment and {@link OnBehalfOfUserCredential} or {@link AppCredential} in NodeJS.
1739
1759
  */
1740
1760
  class TeamsFx {
1741
1761
  /**
@@ -2404,6 +2424,7 @@ function cloneConversation(conversation) {
2404
2424
  */
2405
2425
  function getKey(reference) {
2406
2426
  var _a, _b;
2427
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
2407
2428
  return `_${(_a = reference.conversation) === null || _a === void 0 ? void 0 : _a.tenantId}_${(_b = reference.conversation) === null || _b === void 0 ? void 0 : _b.id}`;
2408
2429
  }
2409
2430
  /**
@@ -3483,8 +3504,7 @@ class DefaultBotSsoExecutionActivityHandler extends TeamsActivityHandler {
3483
3504
  timeout: (_h = (_g = ssoConfig.dialog) === null || _g === void 0 ? void 0 : _g.ssoPromptConfig) === null || _h === void 0 ? void 0 : _h.timeout,
3484
3505
  endOnInvalidMessage: (_k = (_j = ssoConfig.dialog) === null || _j === void 0 ? void 0 : _j.ssoPromptConfig) === null || _k === void 0 ? void 0 : _k.endOnInvalidMessage,
3485
3506
  };
3486
- const teamsfx = new TeamsFx(IdentityType.User, Object.assign({}, customConfig));
3487
- this.ssoExecutionDialog = new BotSsoExecutionDialog(dedupStorage, settings, teamsfx);
3507
+ this.ssoExecutionDialog = new BotSsoExecutionDialog(dedupStorage, settings, customConfig, customConfig.initiateLoginEndpoint);
3488
3508
  this.conversationState = conversationState;
3489
3509
  this.dialogState = conversationState.createProperty("DialogState");
3490
3510
  this.userState = userState;
@@ -3645,9 +3665,12 @@ class ConversationBot$1 {
3645
3665
  // the default error handler
3646
3666
  adapter.onTurnError = async (context, error) => {
3647
3667
  // This check writes out errors to console.
3668
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
3648
3669
  console.error(`[onTurnError] unhandled error: ${error}`);
3649
3670
  // Send a trace activity, which will be displayed in Bot Framework Emulator
3650
- await context.sendTraceActivity("OnTurnError Trace", `${error}`, "https://www.botframework.com/schemas/error", "TurnError");
3671
+ await context.sendTraceActivity("OnTurnError Trace",
3672
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
3673
+ `${error}`, "https://www.botframework.com/schemas/error", "TurnError");
3651
3674
  // Send a message to the user
3652
3675
  await context.sendActivity(`The bot encountered unhandled error: ${error.message}`);
3653
3676
  await context.sendActivity("To continue to run this bot, please fix the bot source code.");
@@ -3926,6 +3949,7 @@ async function executionWithTokenAndConfig(context, authConfig, initiateLoginEnd
3926
3949
  }
3927
3950
  /**
3928
3951
  * execution in message extension with SSO token.
3952
+ * @deprecated Use {@link executionWithTokenAndConfig} instead.
3929
3953
  *
3930
3954
  * @param {TurnContext} context - The context object for the current turn.
3931
3955
  * @param {AuthenticationConfiguration} config - User custom the message extension authentication configuration.
@@ -3974,7 +3998,7 @@ async function executionWithToken(context, config, scopes, logic) {
3974
3998
  // eslint-disable-next-line no-secrets/no-secrets
3975
3999
  /**
3976
4000
  * Users execute query in message extension with SSO or access token.
3977
- *
4001
+ * @deprecated Use {@link handleMessageExtensionQueryWithSSO} instead.
3978
4002
  *
3979
4003
  * @param {TurnContext} context - The context object for the current turn.
3980
4004
  * @param {AuthenticationConfiguration} config - User custom the message extension authentication configuration.