@microsoft/teamsfx 1.2.1-alpha.cecbda807.0 → 1.2.1-rc.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/teamsfx",
3
- "version": "1.2.1-alpha.cecbda807.0",
3
+ "version": "1.2.1-rc.1",
4
4
  "description": "Microsoft Teams Framework for Node.js and browser.",
5
5
  "main": "dist/index.node.cjs.js",
6
6
  "browser": "dist/index.esm2017.js",
@@ -49,7 +49,7 @@
49
49
  "@azure/identity": "^2.0.1",
50
50
  "@azure/msal-browser": "^2.21.0",
51
51
  "@azure/msal-node": "~1.1.0",
52
- "@microsoft/adaptivecards-tools": "1.0.4-alpha.cecbda807.0",
52
+ "@microsoft/adaptivecards-tools": "^1.1.0-rc.0",
53
53
  "@microsoft/microsoft-graph-client": "^3.0.1",
54
54
  "axios": "^0.27.2",
55
55
  "botbuilder": ">=4.15.0 <5.0.0",
@@ -129,7 +129,7 @@
129
129
  "webpack": "^5.62.1",
130
130
  "yargs": "^17.2.1"
131
131
  },
132
- "gitHead": "1f26d824db654b005c7a4e86242a028b45be8c72",
132
+ "gitHead": "4a129d1ba158b94149387811fe2d58e6a2ef1801",
133
133
  "publishConfig": {
134
134
  "access": "public"
135
135
  },
@@ -538,16 +538,20 @@ export declare class Channel implements NotificationTarget {
538
538
  * Send a plain text message.
539
539
  *
540
540
  * @param text - the plain text message.
541
+ * @param onError - an optional error handler that can catch exceptions during message sending.
542
+ * If not defined, error will be handled by `BotAdapter.onTurnError`.
541
543
  * @returns the response of sending message.
542
544
  */
543
- sendMessage(text: string): Promise<MessageResponse>;
545
+ sendMessage(text: string, onError?: (context: TurnContext, error: Error) => Promise<void>): Promise<MessageResponse>;
544
546
  /**
545
547
  * Send an adaptive card message.
546
548
  *
547
549
  * @param card - the adaptive card raw JSON.
550
+ * @param onError - an optional error handler that can catch exceptions during adaptive card sending.
551
+ * If not defined, error will be handled by `BotAdapter.onTurnError`.
548
552
  * @returns the response of sending adaptive card message.
549
553
  */
550
- sendAdaptiveCard(card: unknown): Promise<MessageResponse>;
554
+ sendAdaptiveCard(card: unknown, onError?: (context: TurnContext, error: Error) => Promise<void>): Promise<MessageResponse>;
551
555
  /**
552
556
  * @internal
553
557
  */
@@ -1215,16 +1219,20 @@ export declare class Member implements NotificationTarget {
1215
1219
  * Send a plain text message.
1216
1220
  *
1217
1221
  * @param text - the plain text message.
1222
+ * @param onError - an optional error handler that can catch exceptions during message sending.
1223
+ * If not defined, error will be handled by `BotAdapter.onTurnError`.
1218
1224
  * @returns the response of sending message.
1219
1225
  */
1220
- sendMessage(text: string): Promise<MessageResponse>;
1226
+ sendMessage(text: string, onError?: (context: TurnContext, error: Error) => Promise<void>): Promise<MessageResponse>;
1221
1227
  /**
1222
1228
  * Send an adaptive card message.
1223
1229
  *
1224
1230
  * @param card - the adaptive card raw JSON.
1231
+ * @param onError - an optional error handler that can catch exceptions during adaptive card sending.
1232
+ * If not defined, error will be handled by `BotAdapter.onTurnError`.
1225
1233
  * @returns the response of sending adaptive card message.
1226
1234
  */
1227
- sendAdaptiveCard(card: unknown): Promise<MessageResponse>;
1235
+ sendAdaptiveCard(card: unknown, onError?: (context: TurnContext, error: Error) => Promise<void>): Promise<MessageResponse>;
1228
1236
  /**
1229
1237
  * @internal
1230
1238
  */
@@ -1438,6 +1446,7 @@ export declare class NotificationBot {
1438
1446
  findMember(predicate: (member: Member) => Promise<boolean>, scope?: SearchScope): Promise<Member | undefined>;
1439
1447
  /**
1440
1448
  * Returns the first {@link Channel} where predicate is true, and undefined otherwise.
1449
+ * (Ensure the bot app is installed into the `General` channel, otherwise undefined will be returned.)
1441
1450
  *
1442
1451
  * @param predicate find calls predicate once for each channel of the installation,
1443
1452
  * until it finds one where predicate returns true. If such a channel is found, find
@@ -1456,6 +1465,7 @@ export declare class NotificationBot {
1456
1465
  findAllMembers(predicate: (member: Member) => Promise<boolean>, scope?: SearchScope): Promise<Member[]>;
1457
1466
  /**
1458
1467
  * Returns all {@link Channel} where predicate is true, and empty array otherwise.
1468
+ * (Ensure the bot app is installed into the `General` channel, otherwise empty array will be returned.)
1459
1469
  *
1460
1470
  * @param predicate find calls predicate for each channel of the installation.
1461
1471
  * @returns an array of {@link Channel} where predicate is true, and empty array otherwise.
@@ -1495,18 +1505,22 @@ export declare interface NotificationTarget {
1495
1505
  * Send a plain text message.
1496
1506
  *
1497
1507
  * @param text - the plain text message.
1508
+ * @param onError - an optional error handler that can catch exceptions during message sending.
1509
+ * If not defined, error will be handled by `BotAdapter.onTurnError`.
1498
1510
  *
1499
1511
  * @returns the response of sending message.
1500
1512
  */
1501
- sendMessage(text: string): Promise<MessageResponse>;
1513
+ sendMessage(text: string, onError?: (context: TurnContext, error: Error) => Promise<void>): Promise<MessageResponse>;
1502
1514
  /**
1503
1515
  * Send an adaptive card message.
1504
1516
  *
1505
1517
  * @param card - the adaptive card raw JSON.
1518
+ * @param onError - an optional error handler that can catch exceptions during adaptive card sending.
1519
+ * If not defined, error will be handled by `BotAdapter.onTurnError`.
1506
1520
  *
1507
1521
  * @returns the response of sending adaptive card message.
1508
1522
  */
1509
- sendAdaptiveCard(card: unknown): Promise<MessageResponse>;
1523
+ sendAdaptiveCard(card: unknown, onError?: (context: TurnContext, error: Error) => Promise<void>): Promise<MessageResponse>;
1510
1524
  }
1511
1525
 
1512
1526
  /**
@@ -1680,18 +1694,22 @@ export declare enum SearchScope {
1680
1694
  *
1681
1695
  * @param target - the notification target.
1682
1696
  * @param card - the adaptive card raw JSON.
1697
+ * @param onError - an optional error handler that can catch exceptions during adaptive card sending.
1698
+ * If not defined, error will be handled by `BotAdapter.onTurnError`.
1683
1699
  * @returns the response of sending adaptive card message.
1684
1700
  */
1685
- export declare function sendAdaptiveCard(target: NotificationTarget, card: unknown): Promise<MessageResponse>;
1701
+ export declare function sendAdaptiveCard(target: NotificationTarget, card: unknown, onError?: (context: TurnContext, error: Error) => Promise<void>): Promise<MessageResponse>;
1686
1702
 
1687
1703
  /**
1688
1704
  * Send a plain text message to a notification target.
1689
1705
  *
1690
1706
  * @param target - the notification target.
1691
1707
  * @param text - the plain text message.
1708
+ * @param onError - an optional error handler that can catch exceptions during message sending.
1709
+ * If not defined, error will be handled by `BotAdapter.onTurnError`.
1692
1710
  * @returns the response of sending message.
1693
1711
  */
1694
- export declare function sendMessage(target: NotificationTarget, text: string): Promise<MessageResponse>;
1712
+ export declare function sendMessage(target: NotificationTarget, text: string, onError?: (context: TurnContext, error: Error) => Promise<void>): Promise<MessageResponse>;
1695
1713
 
1696
1714
  /**
1697
1715
  * Set custom log function. Use the function if it's set. Priority is lower than setLogger.
@@ -1774,16 +1792,20 @@ export declare class TeamsBotInstallation implements NotificationTarget {
1774
1792
  * Send a plain text message.
1775
1793
  *
1776
1794
  * @param text - the plain text message.
1795
+ * @param onError - an optional error handler that can catch exceptions during message sending.
1796
+ * If not defined, error will be handled by `BotAdapter.onTurnError`.
1777
1797
  * @returns the response of sending message.
1778
1798
  */
1779
- sendMessage(text: string): Promise<MessageResponse>;
1799
+ sendMessage(text: string, onError?: (context: TurnContext, error: Error) => Promise<void>): Promise<MessageResponse>;
1780
1800
  /**
1781
1801
  * Send an adaptive card message.
1782
1802
  *
1783
1803
  * @param card - the adaptive card raw JSON.
1804
+ * @param onError - an optional error handler that can catch exceptions during adaptive card sending.
1805
+ * If not defined, error will be handled by `BotAdapter.onTurnError`.
1784
1806
  * @returns the response of sending adaptive card message.
1785
1807
  */
1786
- sendAdaptiveCard(card: unknown): Promise<MessageResponse>;
1808
+ sendAdaptiveCard(card: unknown, onError?: (context: TurnContext, error: Error) => Promise<void>): Promise<MessageResponse>;
1787
1809
  /**
1788
1810
  * Get channels from this bot installation.
1789
1811
  *