@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.
@@ -130,6 +130,7 @@ ErrorMessage.EmptyParameter = "Parameter {0} is empty";
130
130
  ErrorMessage.DuplicateHttpsOptionProperty = "Axios HTTPS agent already defined value for property {0}";
131
131
  ErrorMessage.DuplicateApiKeyInHeader = "The request already defined api key in request header with name {0}.";
132
132
  ErrorMessage.DuplicateApiKeyInQueryParam = "The request already defined api key in query parameter with name {0}.";
133
+ ErrorMessage.OnlySupportInQueryActivity = "The handleMessageExtensionQueryWithToken only support in handleTeamsMessagingExtensionQuery with composeExtension/query type.";
133
134
  /**
134
135
  * Error class with code and message thrown by the SDK.
135
136
  */
@@ -1553,72 +1554,6 @@ class BotSsoExecutionDialog {
1553
1554
  }
1554
1555
  }
1555
1556
 
1556
- // Copyright (c) Microsoft Corporation.
1557
- /**
1558
- * Default sso execution activity handler
1559
- */
1560
- class DefaultBotSsoExecutionActivityHandler {
1561
- /**
1562
- * Creates a new instance of the DefaultBotSsoExecutionActivityHandler.
1563
- * @param ssoConfig configuration for sso command bot
1564
- */
1565
- constructor(ssoConfig) {
1566
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultBotSsoExecutionActivityHandler"), ErrorCode.RuntimeNotSupported);
1567
- }
1568
- /**
1569
- * Add TeamsFxBotSsoCommandHandler instance to sso execution dialog
1570
- * @param handler {@link BotSsoExecutionDialogHandler} callback function
1571
- * @param triggerPatterns The trigger pattern
1572
- */
1573
- addCommand(handler, triggerPatterns) {
1574
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultBotSsoExecutionActivityHandler"), ErrorCode.RuntimeNotSupported);
1575
- }
1576
- /**
1577
- * Called to initiate the event emission process.
1578
- * @param context The context object for the current turn.
1579
- */
1580
- run(context) {
1581
- return __awaiter(this, void 0, void 0, function* () {
1582
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultBotSsoExecutionActivityHandler"), ErrorCode.RuntimeNotSupported);
1583
- });
1584
- }
1585
- /**
1586
- * Receives invoke activities with Activity name of 'signin/verifyState'.
1587
- * @param context A context object for this turn.
1588
- * @param query Signin state (part of signin action auth flow) verification invoke query.
1589
- * @returns A promise that represents the work queued.
1590
- */
1591
- handleTeamsSigninVerifyState(context, query) {
1592
- return __awaiter(this, void 0, void 0, function* () {
1593
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultBotSsoExecutionActivityHandler"), ErrorCode.RuntimeNotSupported);
1594
- });
1595
- }
1596
- /**
1597
- * Receives invoke activities with Activity name of 'signin/tokenExchange'
1598
- * @param context A context object for this turn.
1599
- * @param query Signin state (part of signin action auth flow) verification invoke query
1600
- * @returns A promise that represents the work queued.
1601
- */
1602
- handleTeamsSigninTokenExchange(context, query) {
1603
- return __awaiter(this, void 0, void 0, function* () {
1604
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultBotSsoExecutionActivityHandler"), ErrorCode.RuntimeNotSupported);
1605
- });
1606
- }
1607
- /**
1608
- * Handle signin invoke activity type.
1609
- *
1610
- * @param context The context object for the current turn.
1611
- *
1612
- * @remarks
1613
- * Override this method to support channel-specific behavior across multiple channels.
1614
- */
1615
- onSignInInvoke(context) {
1616
- return __awaiter(this, void 0, void 0, function* () {
1617
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "DefaultBotSsoExecutionActivityHandler"), ErrorCode.RuntimeNotSupported);
1618
- });
1619
- }
1620
- }
1621
-
1622
1557
  // Copyright (c) Microsoft Corporation.
1623
1558
  /**
1624
1559
  * Send a plain text message to a notification target.
@@ -1836,6 +1771,16 @@ class TeamsBotInstallation {
1836
1771
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
1837
1772
  });
1838
1773
  }
1774
+ /**
1775
+ * Get team details from this bot installation
1776
+ *
1777
+ * @returns the team details if bot is installed into a team, otherwise returns undefined.
1778
+ */
1779
+ getTeamDetails() {
1780
+ return __awaiter(this, void 0, void 0, function* () {
1781
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
1782
+ });
1783
+ }
1839
1784
  }
1840
1785
  /**
1841
1786
  * Provide static utilities for bot notification.
@@ -1892,7 +1837,95 @@ class NotificationBot {
1892
1837
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1893
1838
  });
1894
1839
  }
1895
- }
1840
+ /**
1841
+ * Returns the first {@link Member} where predicate is true, and undefined otherwise.
1842
+ *
1843
+ * @remarks
1844
+ * Only work on server side.
1845
+ *
1846
+ * @param predicate find calls predicate once for each member of the installation,
1847
+ * until it finds one where predicate returns true. If such a member is found, find
1848
+ * immediately returns that member. Otherwise, find returns undefined.
1849
+ * @param scope the scope to find members from the installations
1850
+ * (personal chat, group chat, Teams channel).
1851
+ * @returns the first {@link Member} where predicate is true, and undefined otherwise.
1852
+ */
1853
+ findMember(predicate, scope) {
1854
+ return __awaiter(this, void 0, void 0, function* () {
1855
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1856
+ });
1857
+ }
1858
+ /**
1859
+ * Returns the first {@link Channel} where predicate is true, and undefined otherwise.
1860
+ *
1861
+ * @remarks
1862
+ * Only work on server side.
1863
+ *
1864
+ * @param predicate find calls predicate once for each channel of the installation,
1865
+ * until it finds one where predicate returns true. If such a channel is found, find
1866
+ * immediately returns that channel. Otherwise, find returns undefined.
1867
+ * @returns the first {@link Channel} where predicate is true, and undefined otherwise.
1868
+ */
1869
+ findChannel(predicate) {
1870
+ return __awaiter(this, void 0, void 0, function* () {
1871
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1872
+ });
1873
+ }
1874
+ /**
1875
+ * Returns all {@link Member} where predicate is true, and empty array otherwise.
1876
+ *
1877
+ * @remarks
1878
+ * Only work on server side.
1879
+ *
1880
+ * @param predicate find calls predicate for each member of the installation.
1881
+ * @param scope the scope to find members from the installations
1882
+ * (personal chat, group chat, Teams channel).
1883
+ * @returns an array of {@link Member} where predicate is true, and empty array otherwise.
1884
+ */
1885
+ findAllMembers(predicate, scope) {
1886
+ return __awaiter(this, void 0, void 0, function* () {
1887
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1888
+ });
1889
+ }
1890
+ /**
1891
+ * Returns all {@link Channel} where predicate is true, and empty array otherwise.
1892
+ *
1893
+ * @remarks
1894
+ * Only work on server side.
1895
+ *
1896
+ * @param predicate find calls predicate for each channel of the installation.
1897
+ * @returns an array of {@link Channel} where predicate is true, and empty array otherwise.
1898
+ */
1899
+ findAllChannels(predicate) {
1900
+ return __awaiter(this, void 0, void 0, function* () {
1901
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1902
+ });
1903
+ }
1904
+ }
1905
+ /**
1906
+ * The search scope when calling {@link NotificationBot.findMember} and {@link NotificationBot.findAllMembers}.
1907
+ * The search scope is a flagged enum and it can be combined with `|`.
1908
+ * For example, to search from personal chat and group chat, use `SearchScope.Person | SearchScope.Group`.
1909
+ */
1910
+ var SearchScope;
1911
+ (function (SearchScope) {
1912
+ /**
1913
+ * Search members from the installations in personal chat only.
1914
+ */
1915
+ SearchScope[SearchScope["Person"] = 1] = "Person";
1916
+ /**
1917
+ * Search members from the installations in group chat only.
1918
+ */
1919
+ SearchScope[SearchScope["Group"] = 2] = "Group";
1920
+ /**
1921
+ * Search members from the installations in Teams channel only.
1922
+ */
1923
+ SearchScope[SearchScope["Channel"] = 4] = "Channel";
1924
+ /**
1925
+ * Search members from all installations including personal chat, group chat and Teams channel.
1926
+ */
1927
+ SearchScope[SearchScope["All"] = 7] = "All";
1928
+ })(SearchScope || (SearchScope = {}));
1896
1929
 
1897
1930
  // Copyright (c) Microsoft Corporation.
1898
1931
  /**
@@ -1989,5 +2022,16 @@ class CardActionBot {
1989
2022
  }
1990
2023
  }
1991
2024
 
1992
- 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 };
2025
+ /**
2026
+ * Users execute query with SSO or Access Token.
2027
+ * @remarks
2028
+ * Only works in in server side.
2029
+ */
2030
+ function handleMessageExtensionQueryWithToken(context, config, scopes, logic) {
2031
+ return __awaiter(this, void 0, void 0, function* () {
2032
+ throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "queryWithToken in message extension"), ErrorCode.RuntimeNotSupported);
2033
+ });
2034
+ }
2035
+
2036
+ 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 };
1993
2037
  //# sourceMappingURL=index.esm5.js.map