@microsoft/teamsfx 1.1.2-alpha.9bd0cb559.0 → 1.1.2-alpha.9d488528e.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.
@@ -129,6 +129,7 @@ ErrorMessage.EmptyParameter = "Parameter {0} is empty";
129
129
  ErrorMessage.DuplicateHttpsOptionProperty = "Axios HTTPS agent already defined value for property {0}";
130
130
  ErrorMessage.DuplicateApiKeyInHeader = "The request already defined api key in request header with name {0}.";
131
131
  ErrorMessage.DuplicateApiKeyInQueryParam = "The request already defined api key in query parameter with name {0}.";
132
+ ErrorMessage.OnlySupportInQueryActivity = "The handleMessageExtensionQueryWithToken only support in handleTeamsMessagingExtensionQuery with composeExtension/query type.";
132
133
  /**
133
134
  * Error class with code and message thrown by the SDK.
134
135
  */
@@ -1512,64 +1513,6 @@ class BotSsoExecutionDialog {
1512
1513
  }
1513
1514
  }
1514
1515
 
1515
- // Copyright (c) Microsoft Corporation.
1516
- /**
1517
- * Default sso execution activity handler
1518
- */
1519
- class DefaultBotSsoExecutionActivityHandler {
1520
- /**
1521
- * Creates a new instance of the DefaultBotSsoExecutionActivityHandler.
1522
- * @param ssoConfig configuration for sso command bot
1523
- */
1524
- constructor(ssoConfig) {
1525
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultBotSsoExecutionActivityHandler"), ErrorCode.RuntimeNotSupported);
1526
- }
1527
- /**
1528
- * Add TeamsFxBotSsoCommandHandler instance to sso execution dialog
1529
- * @param handler {@link BotSsoExecutionDialogHandler} callback function
1530
- * @param triggerPatterns The trigger pattern
1531
- */
1532
- addCommand(handler, triggerPatterns) {
1533
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultBotSsoExecutionActivityHandler"), ErrorCode.RuntimeNotSupported);
1534
- }
1535
- /**
1536
- * Called to initiate the event emission process.
1537
- * @param context The context object for the current turn.
1538
- */
1539
- async run(context) {
1540
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultBotSsoExecutionActivityHandler"), ErrorCode.RuntimeNotSupported);
1541
- }
1542
- /**
1543
- * Receives invoke activities with Activity name of 'signin/verifyState'.
1544
- * @param context A context object for this turn.
1545
- * @param query Signin state (part of signin action auth flow) verification invoke query.
1546
- * @returns A promise that represents the work queued.
1547
- */
1548
- async handleTeamsSigninVerifyState(context, query) {
1549
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultBotSsoExecutionActivityHandler"), ErrorCode.RuntimeNotSupported);
1550
- }
1551
- /**
1552
- * Receives invoke activities with Activity name of 'signin/tokenExchange'
1553
- * @param context A context object for this turn.
1554
- * @param query Signin state (part of signin action auth flow) verification invoke query
1555
- * @returns A promise that represents the work queued.
1556
- */
1557
- async handleTeamsSigninTokenExchange(context, query) {
1558
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultBotSsoExecutionActivityHandler"), ErrorCode.RuntimeNotSupported);
1559
- }
1560
- /**
1561
- * Handle signin invoke activity type.
1562
- *
1563
- * @param context The context object for the current turn.
1564
- *
1565
- * @remarks
1566
- * Override this method to support channel-specific behavior across multiple channels.
1567
- */
1568
- async onSignInInvoke(context) {
1569
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultBotSsoExecutionActivityHandler"), ErrorCode.RuntimeNotSupported);
1570
- }
1571
- }
1572
-
1573
1516
  // Copyright (c) Microsoft Corporation.
1574
1517
  /**
1575
1518
  * Send a plain text message to a notification target.
@@ -1779,6 +1722,14 @@ class TeamsBotInstallation {
1779
1722
  async members() {
1780
1723
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
1781
1724
  }
1725
+ /**
1726
+ * Get team details from this bot installation
1727
+ *
1728
+ * @returns the team details if bot is installed into a team, otherwise returns undefined.
1729
+ */
1730
+ async getTeamDetails() {
1731
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
1732
+ }
1782
1733
  }
1783
1734
  /**
1784
1735
  * Provide static utilities for bot notification.
@@ -1833,7 +1784,87 @@ class NotificationBot {
1833
1784
  static async installations() {
1834
1785
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1835
1786
  }
1836
- }
1787
+ /**
1788
+ * Returns the first {@link Member} where predicate is true, and undefined otherwise.
1789
+ *
1790
+ * @remarks
1791
+ * Only work on server side.
1792
+ *
1793
+ * @param predicate find calls predicate once for each member of the installation,
1794
+ * until it finds one where predicate returns true. If such a member is found, find
1795
+ * immediately returns that member. Otherwise, find returns undefined.
1796
+ * @param scope the scope to find members from the installations
1797
+ * (personal chat, group chat, Teams channel).
1798
+ * @returns the first {@link Member} where predicate is true, and undefined otherwise.
1799
+ */
1800
+ async findMember(predicate, scope) {
1801
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1802
+ }
1803
+ /**
1804
+ * Returns the first {@link Channel} where predicate is true, and undefined otherwise.
1805
+ *
1806
+ * @remarks
1807
+ * Only work on server side.
1808
+ *
1809
+ * @param predicate find calls predicate once for each channel of the installation,
1810
+ * until it finds one where predicate returns true. If such a channel is found, find
1811
+ * immediately returns that channel. Otherwise, find returns undefined.
1812
+ * @returns the first {@link Channel} where predicate is true, and undefined otherwise.
1813
+ */
1814
+ async findChannel(predicate) {
1815
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1816
+ }
1817
+ /**
1818
+ * Returns all {@link Member} where predicate is true, and empty array otherwise.
1819
+ *
1820
+ * @remarks
1821
+ * Only work on server side.
1822
+ *
1823
+ * @param predicate find calls predicate for each member of the installation.
1824
+ * @param scope the scope to find members from the installations
1825
+ * (personal chat, group chat, Teams channel).
1826
+ * @returns an array of {@link Member} where predicate is true, and empty array otherwise.
1827
+ */
1828
+ async findAllMembers(predicate, scope) {
1829
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1830
+ }
1831
+ /**
1832
+ * Returns all {@link Channel} where predicate is true, and empty array otherwise.
1833
+ *
1834
+ * @remarks
1835
+ * Only work on server side.
1836
+ *
1837
+ * @param predicate find calls predicate for each channel of the installation.
1838
+ * @returns an array of {@link Channel} where predicate is true, and empty array otherwise.
1839
+ */
1840
+ async findAllChannels(predicate) {
1841
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1842
+ }
1843
+ }
1844
+ /**
1845
+ * The search scope when calling {@link NotificationBot.findMember} and {@link NotificationBot.findAllMembers}.
1846
+ * The search scope is a flagged enum and it can be combined with `|`.
1847
+ * For example, to search from personal chat and group chat, use `SearchScope.Person | SearchScope.Group`.
1848
+ */
1849
+ var SearchScope;
1850
+ (function (SearchScope) {
1851
+ /**
1852
+ * Search members from the installations in personal chat only.
1853
+ */
1854
+ SearchScope[SearchScope["Person"] = 1] = "Person";
1855
+ /**
1856
+ * Search members from the installations in group chat only.
1857
+ */
1858
+ SearchScope[SearchScope["Group"] = 2] = "Group";
1859
+ /**
1860
+ * Search members from the installations in Teams channel only.
1861
+ */
1862
+ SearchScope[SearchScope["Channel"] = 4] = "Channel";
1863
+ /**
1864
+ * Search members from all installations including personal chat, group chat and Teams channel.
1865
+ */
1866
+ SearchScope[SearchScope["All"] = 7] = "All";
1867
+ })(SearchScope || (SearchScope = {}));
1837
1868
 
1838
1869
  // Copyright (c) Microsoft Corporation.
1839
1870
  /**
@@ -1930,5 +1961,14 @@ class CardActionBot {
1930
1961
  }
1931
1962
  }
1932
1963
 
1933
- export { AdaptiveCardResponse, ApiKeyLocation, ApiKeyProvider, AppCredential, BasicAuthProvider, BearerTokenAuthProvider, BotSsoExecutionDialog, CardActionBot, CertificateAuthProvider, Channel, CommandBot, ConversationBot, DefaultBotSsoExecutionActivityHandler, ErrorCode, ErrorWithCode, IdentityType, InvokeResponseErrorCode, LogLevel, Member, MsGraphAuthProvider, NotificationBot, NotificationTargetType, OnBehalfOfUserCredential, TeamsBotInstallation, TeamsBotSsoPrompt, TeamsFx, TeamsUserCredential, createApiClient, createMicrosoftGraphClient, createPemCertOption, createPfxCertOption, getLogLevel, getTediousConnectionConfig, sendAdaptiveCard, sendMessage, setLogFunction, setLogLevel, setLogger };
1964
+ /**
1965
+ * Users execute query with SSO or Access Token.
1966
+ * @remarks
1967
+ * Only works in in server side.
1968
+ */
1969
+ async function handleMessageExtensionQueryWithToken(context, config, scopes, logic) {
1970
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "queryWithToken in message extension"), ErrorCode.RuntimeNotSupported);
1971
+ }
1972
+
1973
+ export { AdaptiveCardResponse, ApiKeyLocation, ApiKeyProvider, AppCredential, BasicAuthProvider, BearerTokenAuthProvider, BotSsoExecutionDialog, CardActionBot, CertificateAuthProvider, Channel, CommandBot, ConversationBot, ErrorCode, ErrorWithCode, IdentityType, InvokeResponseErrorCode, LogLevel, Member, MsGraphAuthProvider, NotificationBot, NotificationTargetType, OnBehalfOfUserCredential, TeamsBotInstallation, TeamsBotSsoPrompt, TeamsFx, TeamsUserCredential, createApiClient, createMicrosoftGraphClient, createPemCertOption, createPfxCertOption, getLogLevel, getTediousConnectionConfig, handleMessageExtensionQueryWithToken, sendAdaptiveCard, sendMessage, setLogFunction, setLogLevel, setLogger };
1934
1974
  //# sourceMappingURL=index.esm2017.js.map