@microsoft/teamsfx 2.2.3-alpha.5925cbfed.0 → 2.2.3-alpha.6ac884bef.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.
@@ -10,7 +10,6 @@ import axios from 'axios';
10
10
  import { Agent } from 'https';
11
11
  import * as path from 'path';
12
12
  import * as fs from 'fs';
13
- import { __rest } from 'tslib';
14
13
  import { AdaptiveCards } from '@microsoft/adaptivecards-tools';
15
14
 
16
15
  // Copyright (c) Microsoft Corporation.
@@ -1985,6 +1984,7 @@ var InvokeResponseErrorCode;
1985
1984
  InvokeResponseErrorCode[InvokeResponseErrorCode["InternalServerError"] = 500] = "InternalServerError";
1986
1985
  })(InvokeResponseErrorCode || (InvokeResponseErrorCode = {}));
1987
1986
 
1987
+ // Copyright (c) Microsoft Corporation.
1988
1988
  /**
1989
1989
  * Available response type for an adaptive card invoke response.
1990
1990
  * @internal
@@ -1999,7 +1999,7 @@ var InvokeResponseType;
1999
1999
  * Provides methods for formatting various invoke responses a bot can send to respond to an invoke request.
2000
2000
  *
2001
2001
  * @remarks
2002
- * All of these functions return an {@link InvokeResponse} object, which can be
2002
+ * All of these functions return an `InvokeResponse` object, which can be
2003
2003
  * passed as input to generate a new `invokeResponse` activity.
2004
2004
  *
2005
2005
  * This example sends an invoke response that contains an adaptive card.
@@ -2424,6 +2424,7 @@ function cloneConversation(conversation) {
2424
2424
  */
2425
2425
  function getKey(reference) {
2426
2426
  var _a, _b;
2427
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
2427
2428
  return `_${(_a = reference.conversation) === null || _a === void 0 ? void 0 : _a.tenantId}_${(_b = reference.conversation) === null || _b === void 0 ? void 0 : _b.id}`;
2428
2429
  }
2429
2430
  /**
@@ -3222,6 +3223,38 @@ var SearchScope$1;
3222
3223
  SearchScope[SearchScope["All"] = 7] = "All";
3223
3224
  })(SearchScope$1 || (SearchScope$1 = {}));
3224
3225
 
3226
+ /******************************************************************************
3227
+ Copyright (c) Microsoft Corporation.
3228
+
3229
+ Permission to use, copy, modify, and/or distribute this software for any
3230
+ purpose with or without fee is hereby granted.
3231
+
3232
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
3233
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
3234
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
3235
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
3236
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
3237
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
3238
+ PERFORMANCE OF THIS SOFTWARE.
3239
+ ***************************************************************************** */
3240
+
3241
+ function __rest(s, e) {
3242
+ var t = {};
3243
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
3244
+ t[p] = s[p];
3245
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
3246
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
3247
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
3248
+ t[p[i]] = s[p[i]];
3249
+ }
3250
+ return t;
3251
+ }
3252
+
3253
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
3254
+ var e = new Error(message);
3255
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
3256
+ };
3257
+
3225
3258
  // Copyright (c) Microsoft Corporation.
3226
3259
  let DIALOG_NAME = "BotSsoExecutionDialog";
3227
3260
  let TEAMS_SSO_PROMPT_ID = "TeamsFxSsoPrompt";
@@ -3503,8 +3536,7 @@ class DefaultBotSsoExecutionActivityHandler extends TeamsActivityHandler {
3503
3536
  timeout: (_h = (_g = ssoConfig.dialog) === null || _g === void 0 ? void 0 : _g.ssoPromptConfig) === null || _h === void 0 ? void 0 : _h.timeout,
3504
3537
  endOnInvalidMessage: (_k = (_j = ssoConfig.dialog) === null || _j === void 0 ? void 0 : _j.ssoPromptConfig) === null || _k === void 0 ? void 0 : _k.endOnInvalidMessage,
3505
3538
  };
3506
- const teamsfx = new TeamsFx(IdentityType.User, Object.assign({}, customConfig));
3507
- this.ssoExecutionDialog = new BotSsoExecutionDialog(dedupStorage, settings, teamsfx);
3539
+ this.ssoExecutionDialog = new BotSsoExecutionDialog(dedupStorage, settings, customConfig, customConfig.initiateLoginEndpoint);
3508
3540
  this.conversationState = conversationState;
3509
3541
  this.dialogState = conversationState.createProperty("DialogState");
3510
3542
  this.userState = userState;
@@ -3555,7 +3587,7 @@ class DefaultBotSsoExecutionActivityHandler extends TeamsActivityHandler {
3555
3587
  * @param query Signin state (part of signin action auth flow) verification invoke query
3556
3588
  * @returns A promise that represents the work queued.
3557
3589
  *
3558
- * @remark
3590
+ * @remarks
3559
3591
  * It should trigger {@link BotSsoExecutionDialog} instance to handle signin process
3560
3592
  */
3561
3593
  async handleTeamsSigninTokenExchange(context, query) {
@@ -3665,9 +3697,12 @@ class ConversationBot$1 {
3665
3697
  // the default error handler
3666
3698
  adapter.onTurnError = async (context, error) => {
3667
3699
  // This check writes out errors to console.
3700
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
3668
3701
  console.error(`[onTurnError] unhandled error: ${error}`);
3669
3702
  // Send a trace activity, which will be displayed in Bot Framework Emulator
3670
- await context.sendTraceActivity("OnTurnError Trace", `${error}`, "https://www.botframework.com/schemas/error", "TurnError");
3703
+ await context.sendTraceActivity("OnTurnError Trace",
3704
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
3705
+ `${error}`, "https://www.botframework.com/schemas/error", "TurnError");
3671
3706
  // Send a message to the user
3672
3707
  await context.sendActivity(`The bot encountered unhandled error: ${error.message}`);
3673
3708
  await context.sendActivity("To continue to run this bot, please fix the bot source code.");