@microsoft/teamsfx 2.2.3-alpha.81508f111.0 → 2.2.3-alpha.8b06251e7.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/README.md +162 -113
- package/dist/index.esm2017.js +84 -62
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm2017.mjs +85 -45
- package/dist/index.esm2017.mjs.map +1 -1
- package/dist/index.esm5.js +66 -108
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +127 -99
- package/dist/index.node.cjs.js.map +1 -1
- package/package.json +3 -4
- package/types/teamsfx.d.ts +32 -2
package/dist/index.node.cjs.js
CHANGED
@@ -425,6 +425,7 @@ function getAuthority(authorityHost, tenantId) {
|
|
425
425
|
return normalizedAuthorityHost + "/" + tenantId;
|
426
426
|
}
|
427
427
|
|
428
|
+
// Copyright (c) Microsoft Corporation.
|
428
429
|
/**
|
429
430
|
* @internal
|
430
431
|
*/
|
@@ -747,9 +748,7 @@ class TeamsUserCredential {
|
|
747
748
|
* Can only be used within Teams.
|
748
749
|
*/
|
749
750
|
login(scopes, resources) {
|
750
|
-
return
|
751
|
-
throw new ErrorWithCode(formatString(ErrorMessage.NodejsRuntimeNotSupported, "TeamsUserCredential"), exports.ErrorCode.RuntimeNotSupported);
|
752
|
-
});
|
751
|
+
return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.NodejsRuntimeNotSupported, "TeamsUserCredential"), exports.ErrorCode.RuntimeNotSupported));
|
753
752
|
}
|
754
753
|
/**
|
755
754
|
* Get access token from credential.
|
@@ -757,9 +756,7 @@ class TeamsUserCredential {
|
|
757
756
|
* Can only be used within Teams.
|
758
757
|
*/
|
759
758
|
getToken(scopes, options) {
|
760
|
-
return
|
761
|
-
throw new ErrorWithCode(formatString(ErrorMessage.NodejsRuntimeNotSupported, "TeamsUserCredential"), exports.ErrorCode.RuntimeNotSupported);
|
762
|
-
});
|
759
|
+
return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.NodejsRuntimeNotSupported, "TeamsUserCredential"), exports.ErrorCode.RuntimeNotSupported));
|
763
760
|
}
|
764
761
|
/**
|
765
762
|
* Get basic user info from SSO token
|
@@ -770,14 +767,16 @@ class TeamsUserCredential {
|
|
770
767
|
* Can only be used within Teams.
|
771
768
|
*/
|
772
769
|
getUserInfo(resources) {
|
773
|
-
|
770
|
+
return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.NodejsRuntimeNotSupported, "TeamsUserCredential"), exports.ErrorCode.RuntimeNotSupported));
|
774
771
|
}
|
775
772
|
}
|
776
773
|
|
777
774
|
// Copyright (c) Microsoft Corporation.
|
778
775
|
const defaultScope = "https://graph.microsoft.com/.default";
|
776
|
+
// eslint-disable-next-line no-secrets/no-secrets
|
779
777
|
/**
|
780
778
|
* Microsoft Graph auth provider for Teams Framework
|
779
|
+
* @deprecated Use `TokenCredentialAuthenticationProvider` from `@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials` instead.
|
781
780
|
*/
|
782
781
|
class MsGraphAuthProvider {
|
783
782
|
constructor(credentialOrTeamsFx, scopes) {
|
@@ -807,7 +806,7 @@ class MsGraphAuthProvider {
|
|
807
806
|
*/
|
808
807
|
getAccessToken() {
|
809
808
|
return tslib.__awaiter(this, void 0, void 0, function* () {
|
810
|
-
internalLogger.info(`Get Graph Access token with scopes: '${this.scopes}'`);
|
809
|
+
internalLogger.info(`Get Graph Access token with scopes: '${this.scopes.toString()}'`);
|
811
810
|
let accessToken;
|
812
811
|
if (this.credentialOrTeamsFx.getCredential) {
|
813
812
|
accessToken = yield this.credentialOrTeamsFx
|
@@ -834,6 +833,14 @@ class MsGraphAuthProvider {
|
|
834
833
|
// Copyright (c) Microsoft Corporation.
|
835
834
|
/**
|
836
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
|
+
*
|
837
844
|
* @example
|
838
845
|
* Get Microsoft graph client by TokenCredential
|
839
846
|
* ```typescript
|
@@ -891,6 +898,14 @@ function createMicrosoftGraphClient(teamsfx, scopes) {
|
|
891
898
|
// eslint-disable-next-line no-secrets/no-secrets
|
892
899
|
/**
|
893
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
|
+
*
|
894
909
|
* @example
|
895
910
|
* Get Microsoft graph client by TokenCredential
|
896
911
|
* ```typescript
|
@@ -1048,7 +1063,7 @@ function isMsiAuthentication(teamsfx) {
|
|
1048
1063
|
function generateDefaultConfig(teamsfx, databaseName) {
|
1049
1064
|
internalLogger.verbose(`SQL server ${teamsfx.getConfig("sqlServerEndpoint")}
|
1050
1065
|
, user name ${teamsfx.getConfig("sqlUsername")}
|
1051
|
-
, database name ${databaseName}`);
|
1066
|
+
, database name ${databaseName ? databaseName : ""}`);
|
1052
1067
|
const config = {
|
1053
1068
|
server: teamsfx.getConfig("sqlServerEndpoint"),
|
1054
1069
|
authentication: {
|
@@ -1102,7 +1117,7 @@ function generateTokenConfig(teamsfx, databaseName) {
|
|
1102
1117
|
};
|
1103
1118
|
internalLogger.verbose(`Generate token configuration success
|
1104
1119
|
, server endpoint is ${teamsfx.getConfig("sqlServerEndpoint")}
|
1105
|
-
, database name is ${databaseName}`);
|
1120
|
+
, database name is ${databaseName ? databaseName : ""}`);
|
1106
1121
|
return config;
|
1107
1122
|
}
|
1108
1123
|
internalLogger.error(`Generate token configuration
|
@@ -1376,7 +1391,8 @@ class TeamsBotSsoPrompt extends botbuilderDialogs.Dialog {
|
|
1376
1391
|
return tslib.__awaiter(this, void 0, void 0, function* () {
|
1377
1392
|
internalLogger.verbose("Send OAuth card to get SSO token");
|
1378
1393
|
const account = yield botbuilder.TeamsInfo.getMember(context, context.activity.from.id);
|
1379
|
-
internalLogger.verbose("Get Teams member account user principal name: " +
|
1394
|
+
internalLogger.verbose("Get Teams member account user principal name: " +
|
1395
|
+
(account.userPrincipalName ? account.userPrincipalName : ""));
|
1380
1396
|
const loginHint = account.userPrincipalName ? account.userPrincipalName : "";
|
1381
1397
|
const signInResource = this.getSignInResource(loginHint);
|
1382
1398
|
const card = botbuilder.CardFactory.oauthCard("", "Teams SSO Sign In", "Sign In", signInResource.signInLink, signInResource.tokenExchangeResource);
|
@@ -1584,19 +1600,17 @@ class BasicAuthProvider {
|
|
1584
1600
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
1585
1601
|
*/
|
1586
1602
|
AddAuthenticationInfo(config) {
|
1587
|
-
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
1593
|
-
|
1594
|
-
|
1595
|
-
|
1596
|
-
|
1597
|
-
|
1598
|
-
return config;
|
1599
|
-
});
|
1603
|
+
if (config.headers && config.headers["Authorization"]) {
|
1604
|
+
return Promise.reject(new ErrorWithCode(ErrorMessage.AuthorizationHeaderAlreadyExists, exports.ErrorCode.AuthorizationInfoAlreadyExists));
|
1605
|
+
}
|
1606
|
+
if (config.auth) {
|
1607
|
+
return Promise.reject(new ErrorWithCode(ErrorMessage.BasicCredentialAlreadyExists, exports.ErrorCode.AuthorizationInfoAlreadyExists));
|
1608
|
+
}
|
1609
|
+
config.auth = {
|
1610
|
+
username: this.userName,
|
1611
|
+
password: this.password,
|
1612
|
+
};
|
1613
|
+
return Promise.resolve(config);
|
1600
1614
|
}
|
1601
1615
|
}
|
1602
1616
|
|
@@ -1637,34 +1651,32 @@ class ApiKeyProvider {
|
|
1637
1651
|
* @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
|
1638
1652
|
*/
|
1639
1653
|
AddAuthenticationInfo(config) {
|
1640
|
-
|
1641
|
-
|
1642
|
-
|
1643
|
-
|
1644
|
-
|
1645
|
-
|
1646
|
-
|
1647
|
-
|
1648
|
-
|
1649
|
-
|
1650
|
-
|
1651
|
-
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1655
|
-
|
1656
|
-
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
1661
|
-
|
1662
|
-
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1666
|
-
return config;
|
1667
|
-
});
|
1654
|
+
switch (this.keyLocation) {
|
1655
|
+
case exports.ApiKeyLocation.Header:
|
1656
|
+
if (!config.headers) {
|
1657
|
+
config.headers = {};
|
1658
|
+
}
|
1659
|
+
if (config.headers[this.keyName]) {
|
1660
|
+
return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.DuplicateApiKeyInHeader, this.keyName), exports.ErrorCode.AuthorizationInfoAlreadyExists));
|
1661
|
+
}
|
1662
|
+
config.headers[this.keyName] = this.keyValue;
|
1663
|
+
break;
|
1664
|
+
case exports.ApiKeyLocation.QueryParams:
|
1665
|
+
if (!config.params) {
|
1666
|
+
config.params = {};
|
1667
|
+
}
|
1668
|
+
let urlHasDefinedApiKey = false;
|
1669
|
+
if (config.url) {
|
1670
|
+
const url = new URL(config.url, config.baseURL);
|
1671
|
+
urlHasDefinedApiKey = url.searchParams.has(this.keyName);
|
1672
|
+
}
|
1673
|
+
if (config.params[this.keyName] || urlHasDefinedApiKey) {
|
1674
|
+
return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.DuplicateApiKeyInQueryParam, this.keyName), exports.ErrorCode.AuthorizationInfoAlreadyExists));
|
1675
|
+
}
|
1676
|
+
config.params[this.keyName] = this.keyValue;
|
1677
|
+
break;
|
1678
|
+
}
|
1679
|
+
return Promise.resolve(config);
|
1668
1680
|
}
|
1669
1681
|
}
|
1670
1682
|
/**
|
@@ -1712,21 +1724,19 @@ class CertificateAuthProvider {
|
|
1712
1724
|
* @throws {@link ErrorCode|InvalidParameter} - when custom httpsAgent in the request has duplicate properties with certOption provided in constructor.
|
1713
1725
|
*/
|
1714
1726
|
AddAuthenticationInfo(config) {
|
1715
|
-
|
1716
|
-
|
1717
|
-
|
1718
|
-
|
1719
|
-
|
1720
|
-
|
1721
|
-
|
1722
|
-
|
1723
|
-
throw new ErrorWithCode(formatString(ErrorMessage.DuplicateHttpsOptionProperty, property), exports.ErrorCode.InvalidParameter);
|
1724
|
-
}
|
1727
|
+
if (!config.httpsAgent) {
|
1728
|
+
config.httpsAgent = new https.Agent(this.certOption);
|
1729
|
+
}
|
1730
|
+
else {
|
1731
|
+
const existingProperties = new Set(Object.keys(config.httpsAgent.options));
|
1732
|
+
for (const property of Object.keys(this.certOption)) {
|
1733
|
+
if (existingProperties.has(property)) {
|
1734
|
+
return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.DuplicateHttpsOptionProperty, property), exports.ErrorCode.InvalidParameter));
|
1725
1735
|
}
|
1726
|
-
Object.assign(config.httpsAgent.options, this.certOption);
|
1727
1736
|
}
|
1728
|
-
|
1729
|
-
}
|
1737
|
+
Object.assign(config.httpsAgent.options, this.certOption);
|
1738
|
+
}
|
1739
|
+
return Promise.resolve(config);
|
1730
1740
|
}
|
1731
1741
|
}
|
1732
1742
|
/**
|
@@ -1795,6 +1805,8 @@ const ReservedKey = new Set([
|
|
1795
1805
|
]);
|
1796
1806
|
/**
|
1797
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.
|
1798
1810
|
*/
|
1799
1811
|
class TeamsFx {
|
1800
1812
|
/**
|
@@ -2475,6 +2487,7 @@ function cloneConversation(conversation) {
|
|
2475
2487
|
*/
|
2476
2488
|
function getKey(reference) {
|
2477
2489
|
var _a, _b;
|
2490
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
2478
2491
|
return `_${(_a = reference.conversation) === null || _a === void 0 ? void 0 : _a.tenantId}_${(_b = reference.conversation) === null || _b === void 0 ? void 0 : _b.id}`;
|
2479
2492
|
}
|
2480
2493
|
/**
|
@@ -2813,7 +2826,7 @@ class Channel$1 {
|
|
2813
2826
|
return tslib.__awaiter(this, void 0, void 0, function* () {
|
2814
2827
|
const response = {};
|
2815
2828
|
yield this.parent.adapter.continueConversation(this.parent.conversationReference, (context) => tslib.__awaiter(this, void 0, void 0, function* () {
|
2816
|
-
const conversation =
|
2829
|
+
const conversation = this.newConversation(context);
|
2817
2830
|
yield this.parent.adapter.continueConversation(conversation, (ctx) => tslib.__awaiter(this, void 0, void 0, function* () {
|
2818
2831
|
try {
|
2819
2832
|
const res = yield ctx.sendActivity(text);
|
@@ -2844,7 +2857,7 @@ class Channel$1 {
|
|
2844
2857
|
return tslib.__awaiter(this, void 0, void 0, function* () {
|
2845
2858
|
const response = {};
|
2846
2859
|
yield this.parent.adapter.continueConversation(this.parent.conversationReference, (context) => tslib.__awaiter(this, void 0, void 0, function* () {
|
2847
|
-
const conversation =
|
2860
|
+
const conversation = this.newConversation(context);
|
2848
2861
|
yield this.parent.adapter.continueConversation(conversation, (ctx) => tslib.__awaiter(this, void 0, void 0, function* () {
|
2849
2862
|
try {
|
2850
2863
|
const res = yield ctx.sendActivity({
|
@@ -2869,12 +2882,10 @@ class Channel$1 {
|
|
2869
2882
|
* @internal
|
2870
2883
|
*/
|
2871
2884
|
newConversation(context) {
|
2872
|
-
|
2873
|
-
|
2874
|
-
|
2875
|
-
|
2876
|
-
return channelConversation;
|
2877
|
-
});
|
2885
|
+
const reference = botbuilder.TurnContext.getConversationReference(context.activity);
|
2886
|
+
const channelConversation = cloneConversation(reference);
|
2887
|
+
channelConversation.conversation.id = this.info.id || "";
|
2888
|
+
return channelConversation;
|
2878
2889
|
}
|
2879
2890
|
}
|
2880
2891
|
/**
|
@@ -3618,8 +3629,7 @@ class DefaultBotSsoExecutionActivityHandler extends botbuilder.TeamsActivityHand
|
|
3618
3629
|
timeout: (_h = (_g = ssoConfig.dialog) === null || _g === void 0 ? void 0 : _g.ssoPromptConfig) === null || _h === void 0 ? void 0 : _h.timeout,
|
3619
3630
|
endOnInvalidMessage: (_k = (_j = ssoConfig.dialog) === null || _j === void 0 ? void 0 : _j.ssoPromptConfig) === null || _k === void 0 ? void 0 : _k.endOnInvalidMessage,
|
3620
3631
|
};
|
3621
|
-
|
3622
|
-
this.ssoExecutionDialog = new BotSsoExecutionDialog(dedupStorage, settings, teamsfx);
|
3632
|
+
this.ssoExecutionDialog = new BotSsoExecutionDialog(dedupStorage, settings, customConfig, customConfig.initiateLoginEndpoint);
|
3623
3633
|
this.conversationState = conversationState;
|
3624
3634
|
this.dialogState = conversationState.createProperty("DialogState");
|
3625
3635
|
this.userState = userState;
|
@@ -3789,9 +3799,12 @@ class ConversationBot$1 {
|
|
3789
3799
|
// the default error handler
|
3790
3800
|
adapter.onTurnError = (context, error) => tslib.__awaiter(this, void 0, void 0, function* () {
|
3791
3801
|
// This check writes out errors to console.
|
3802
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
3792
3803
|
console.error(`[onTurnError] unhandled error: ${error}`);
|
3793
3804
|
// Send a trace activity, which will be displayed in Bot Framework Emulator
|
3794
|
-
yield context.sendTraceActivity("OnTurnError Trace",
|
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");
|
3795
3808
|
// Send a message to the user
|
3796
3809
|
yield context.sendActivity(`The bot encountered unhandled error: ${error.message}`);
|
3797
3810
|
yield context.sendActivity("To continue to run this bot, please fix the bot source code.");
|
@@ -4074,6 +4087,7 @@ function executionWithTokenAndConfig(context, authConfig, initiateLoginEndpoint,
|
|
4074
4087
|
}
|
4075
4088
|
/**
|
4076
4089
|
* execution in message extension with SSO token.
|
4090
|
+
* @deprecated Use {@link executionWithTokenAndConfig} instead.
|
4077
4091
|
*
|
4078
4092
|
* @param {TurnContext} context - The context object for the current turn.
|
4079
4093
|
* @param {AuthenticationConfiguration} config - User custom the message extension authentication configuration.
|
@@ -4124,7 +4138,7 @@ function executionWithToken(context, config, scopes, logic) {
|
|
4124
4138
|
// eslint-disable-next-line no-secrets/no-secrets
|
4125
4139
|
/**
|
4126
4140
|
* Users execute query in message extension with SSO or access token.
|
4127
|
-
*
|
4141
|
+
* @deprecated Use {@link handleMessageExtensionQueryWithSSO} instead.
|
4128
4142
|
*
|
4129
4143
|
* @param {TurnContext} context - The context object for the current turn.
|
4130
4144
|
* @param {AuthenticationConfiguration} config - User custom the message extension authentication configuration.
|
@@ -4406,12 +4420,10 @@ class Channel {
|
|
4406
4420
|
* @internal
|
4407
4421
|
*/
|
4408
4422
|
newConversation(context) {
|
4409
|
-
|
4410
|
-
|
4411
|
-
|
4412
|
-
|
4413
|
-
return channelConversation;
|
4414
|
-
});
|
4423
|
+
const reference = botbuilder.TurnContext.getConversationReference(context.activity);
|
4424
|
+
const channelConversation = cloneConversation(reference);
|
4425
|
+
channelConversation.conversation.id = this.info.id || "";
|
4426
|
+
return Promise.resolve(channelConversation);
|
4415
4427
|
}
|
4416
4428
|
}
|
4417
4429
|
/**
|
@@ -4736,6 +4748,29 @@ class NotificationBot {
|
|
4736
4748
|
}
|
4737
4749
|
return new TeamsBotInstallation(this.adapter, conversationReference, this.botAppId);
|
4738
4750
|
}
|
4751
|
+
/**
|
4752
|
+
* Validate the installation by getting paged memebers.
|
4753
|
+
*
|
4754
|
+
* @param conversationReference The bound `ConversationReference`.
|
4755
|
+
* @returns Returns false if recieves `BotNotInConversationRoster` error, otherwise returns true.
|
4756
|
+
*/
|
4757
|
+
validateInstallation(conversationReference) {
|
4758
|
+
return tslib.__awaiter(this, void 0, void 0, function* () {
|
4759
|
+
let isValid = true;
|
4760
|
+
yield this.adapter.continueConversationAsync(this.botAppId, conversationReference, (context) => tslib.__awaiter(this, void 0, void 0, function* () {
|
4761
|
+
try {
|
4762
|
+
// try get member to see if the installation is still valid
|
4763
|
+
yield botbuilder.TeamsInfo.getPagedMembers(context, 1);
|
4764
|
+
}
|
4765
|
+
catch (error) {
|
4766
|
+
if (error.code === "BotNotInConversationRoster") {
|
4767
|
+
isValid = false;
|
4768
|
+
}
|
4769
|
+
}
|
4770
|
+
}));
|
4771
|
+
return isValid;
|
4772
|
+
});
|
4773
|
+
}
|
4739
4774
|
/**
|
4740
4775
|
* Gets a pagined list of targets where the bot is installed.
|
4741
4776
|
*
|
@@ -4747,7 +4782,7 @@ class NotificationBot {
|
|
4747
4782
|
*
|
4748
4783
|
* @returns An array of {@link TeamsBotInstallation} with paged data and continuation token.
|
4749
4784
|
*/
|
4750
|
-
getPagedInstallations(pageSize, continuationToken) {
|
4785
|
+
getPagedInstallations(pageSize, continuationToken, validationEnabled = true) {
|
4751
4786
|
return tslib.__awaiter(this, void 0, void 0, function* () {
|
4752
4787
|
if (this.conversationReferenceStore === undefined || this.adapter === undefined) {
|
4753
4788
|
throw new Error("NotificationBot has not been initialized.");
|
@@ -4756,19 +4791,12 @@ class NotificationBot {
|
|
4756
4791
|
const targets = [];
|
4757
4792
|
for (const reference of references.data) {
|
4758
4793
|
// validate connection
|
4759
|
-
let valid
|
4760
|
-
|
4761
|
-
try
|
4762
|
-
|
4763
|
-
|
4764
|
-
|
4765
|
-
catch (error) {
|
4766
|
-
if (error.code === "BotNotInConversationRoster") {
|
4767
|
-
valid = false;
|
4768
|
-
}
|
4769
|
-
}
|
4770
|
-
}));
|
4771
|
-
if (valid) {
|
4794
|
+
let valid;
|
4795
|
+
if (validationEnabled) {
|
4796
|
+
// try get member to see if the installation is still valid
|
4797
|
+
valid = yield this.validateInstallation(reference);
|
4798
|
+
}
|
4799
|
+
if (!validationEnabled || (validationEnabled && valid)) {
|
4772
4800
|
targets.push(new TeamsBotInstallation(this.adapter, reference, this.botAppId));
|
4773
4801
|
}
|
4774
4802
|
else {
|
@@ -5041,9 +5069,9 @@ class ConversationBot {
|
|
5041
5069
|
// the default error handler
|
5042
5070
|
adapter.onTurnError = (context, error) => tslib.__awaiter(this, void 0, void 0, function* () {
|
5043
5071
|
// This check writes out errors to console.
|
5044
|
-
console.error(`[onTurnError] unhandled error
|
5072
|
+
console.error(`[onTurnError] unhandled error`, error);
|
5045
5073
|
// Send a trace activity, which will be displayed in Bot Framework Emulator
|
5046
|
-
yield context.sendTraceActivity("OnTurnError Trace",
|
5074
|
+
yield context.sendTraceActivity("OnTurnError Trace", error instanceof Error ? error.message : error, "https://www.botframework.com/schemas/error", "TurnError");
|
5047
5075
|
// Send a message to the user
|
5048
5076
|
yield context.sendActivity(`The bot encountered unhandled error: ${error.message}`);
|
5049
5077
|
yield context.sendActivity("To continue to run this bot, please fix the bot source code.");
|