@microsoft/teamsfx 2.2.3-alpha.0c7c513de.0 → 2.2.3-alpha.13d1e618d.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 CHANGED
@@ -535,13 +535,12 @@ You can pass custom config when creating `TeamsFx` instance to override default
535
535
 
536
536
  If you are using the version of SDK that has `loadConfiguration()`, you can follow these steps to upgrade to the latest SDK version.
537
537
 
538
- 1. Remove `loadConfiguration()` and pass customized settings using `new TeamsFx(IdentityType.User, { ...customConfig })`.
539
- 2. Replace `new TeamsUserCredential()` with `new TeamsFx()`.
540
- 3. Replace `new M365TenantCredential()` with `new TeamsFx(IdentityType.App)`.
541
- 4. Replace `new OnBehalfOfUserCredential(ssoToken)` with `new TeamsFx().setSsoToken(ssoToken)`.
542
- 5. Pass the instance of `TeamsFx` to helper functions to replace credential instance.
538
+ 1. Instead of calling `loadConfiguration()`, use the specific auth config classes to customize the settings for each credential type. For example, use `AppCredentialAuthConfig` for `AppCredential`, `OnBehalfOfUserCredentialAuthConfig` for `OnBehalfOfUserCredential`, and `TeamsUserCredentialAuthConfig` for `TeamsUserCredential`.
539
+ 2. Replace `new TeamsUserCredential()` with `new TeamsUserCredential(authConfig)`.
540
+ 3. Replace `new M365TenantCredential()` with `new AppCredential(authConfig)`.
541
+ 4. Replace `new OnBehalfOfUserCredential(ssoToken)` with `new OnBehalfOfUserCredential(authConfig)`.
543
542
 
544
- Also see [TeamsFx class](#teamsfx-class) for furthur description.
543
+ Also see [Credential](#Credential) for furthur description.
545
544
 
546
545
  ## How to use SDK implemented with `CloudAdapter`
547
546
 
@@ -864,7 +864,7 @@ class MsGraphAuthProvider {
864
864
  * };
865
865
  * const prompt = new TeamsBotSsoPrompt(dialogId, {
866
866
  * config: config
867
- * scopes: '["User.Read"],
867
+ * scopes: ["User.Read"],
868
868
  * });
869
869
  * this.addDialog(prompt);
870
870
  *
@@ -1159,8 +1159,8 @@ class BasicAuthProvider {
1159
1159
  * @throws {@link ErrorCode|AuthorizationInfoAlreadyExists} - when Authorization header or auth property already exists in request configuration.
1160
1160
  * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1161
1161
  */
1162
- async AddAuthenticationInfo(config) {
1163
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "BasicAuthProvider"), ErrorCode.RuntimeNotSupported);
1162
+ AddAuthenticationInfo(config) {
1163
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "BasicAuthProvider"), ErrorCode.RuntimeNotSupported));
1164
1164
  }
1165
1165
  }
1166
1166
 
@@ -1192,8 +1192,8 @@ class ApiKeyProvider {
1192
1192
  * @throws {@link ErrorCode|AuthorizationInfoAlreadyExists} - when API key already exists in request header or url query parameter.
1193
1193
  * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1194
1194
  */
1195
- async AddAuthenticationInfo(config) {
1196
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "ApiKeyProvider"), ErrorCode.RuntimeNotSupported);
1195
+ AddAuthenticationInfo(config) {
1196
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "ApiKeyProvider"), ErrorCode.RuntimeNotSupported));
1197
1197
  }
1198
1198
  }
1199
1199
  /**
@@ -1234,8 +1234,8 @@ class CertificateAuthProvider {
1234
1234
  * @throws {@link ErrorCode|InvalidParameter} - when custom httpsAgent in the request has duplicate properties with certOption provided in constructor.
1235
1235
  * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is browser.
1236
1236
  */
1237
- async AddAuthenticationInfo(config) {
1238
- throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CertificateAuthProvider"), ErrorCode.RuntimeNotSupported);
1237
+ AddAuthenticationInfo(config) {
1238
+ return Promise.reject(new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "CertificateAuthProvider"), ErrorCode.RuntimeNotSupported));
1239
1239
  }
1240
1240
  }
1241
1241
  /**
@@ -1477,7 +1477,7 @@ class ConversationBot$1 {
1477
1477
  * @remarks
1478
1478
  * Only work on server side.
1479
1479
  */
1480
- async requestHandler(req, res, logic) {
1480
+ requestHandler(req, res, logic) {
1481
1481
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "ConversationBot"), ErrorCode.RuntimeNotSupported);
1482
1482
  }
1483
1483
  }
@@ -1599,7 +1599,7 @@ class Channel$1 {
1599
1599
  * @param onError - an optional error handler that can catch exceptions during adaptive card sending.
1600
1600
  * @returns the response of sending adaptive card message.
1601
1601
  */
1602
- async sendAdaptiveCard(card, onError) {
1602
+ sendAdaptiveCard(card, onError) {
1603
1603
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Channel"), ErrorCode.RuntimeNotSupported);
1604
1604
  }
1605
1605
  }
@@ -1656,7 +1656,7 @@ class Member$1 {
1656
1656
  * @param onError - an optional error handler that can catch exceptions during adaptive card sending.
1657
1657
  * @returns the response of sending adaptive card message.
1658
1658
  */
1659
- async sendAdaptiveCard(card, onError) {
1659
+ sendAdaptiveCard(card, onError) {
1660
1660
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "Member"), ErrorCode.RuntimeNotSupported);
1661
1661
  }
1662
1662
  }
@@ -1723,7 +1723,7 @@ class TeamsBotInstallation$1 {
1723
1723
  *
1724
1724
  * @returns an array of channels if bot is installed into a team, otherwise returns an empty array.
1725
1725
  */
1726
- async channels() {
1726
+ channels() {
1727
1727
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
1728
1728
  }
1729
1729
  /**
@@ -1734,7 +1734,7 @@ class TeamsBotInstallation$1 {
1734
1734
  *
1735
1735
  * @returns an array of members from where the bot is installed.
1736
1736
  */
1737
- async members() {
1737
+ members() {
1738
1738
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
1739
1739
  }
1740
1740
  /**
@@ -1742,7 +1742,7 @@ class TeamsBotInstallation$1 {
1742
1742
  *
1743
1743
  * @returns the team details if bot is installed into a team, otherwise returns undefined.
1744
1744
  */
1745
- async getTeamDetails() {
1745
+ getTeamDetails() {
1746
1746
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "TeamsBotInstallation"), ErrorCode.RuntimeNotSupported);
1747
1747
  }
1748
1748
  }
@@ -1799,7 +1799,7 @@ class NotificationBot$1 {
1799
1799
  *
1800
1800
  * @returns - an array of {@link TeamsBotInstallation}.
1801
1801
  */
1802
- static async installations() {
1802
+ static installations() {
1803
1803
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1804
1804
  }
1805
1805
  /**
@@ -1815,7 +1815,7 @@ class NotificationBot$1 {
1815
1815
  * (personal chat, group chat, Teams channel).
1816
1816
  * @returns the first {@link Member} where predicate is true, and undefined otherwise.
1817
1817
  */
1818
- async findMember(predicate, scope) {
1818
+ findMember(predicate, scope) {
1819
1819
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1820
1820
  }
1821
1821
  /**
@@ -1830,7 +1830,7 @@ class NotificationBot$1 {
1830
1830
  * immediately returns that channel. Otherwise, find returns undefined.
1831
1831
  * @returns the first {@link Channel} where predicate is true, and undefined otherwise.
1832
1832
  */
1833
- async findChannel(predicate) {
1833
+ findChannel(predicate) {
1834
1834
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1835
1835
  }
1836
1836
  /**
@@ -1844,7 +1844,7 @@ class NotificationBot$1 {
1844
1844
  * (personal chat, group chat, Teams channel).
1845
1845
  * @returns an array of {@link Member} where predicate is true, and empty array otherwise.
1846
1846
  */
1847
- async findAllMembers(predicate, scope) {
1847
+ findAllMembers(predicate, scope) {
1848
1848
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1849
1849
  }
1850
1850
  /**
@@ -1857,7 +1857,7 @@ class NotificationBot$1 {
1857
1857
  * @param predicate find calls predicate for each channel of the installation.
1858
1858
  * @returns an array of {@link Channel} where predicate is true, and empty array otherwise.
1859
1859
  */
1860
- async findAllChannels(predicate) {
1860
+ findAllChannels(predicate) {
1861
1861
  throw new ErrorWithCode(formatString(ErrorMessage.BrowserRuntimeNotSupported, "NotificationBot"), ErrorCode.RuntimeNotSupported);
1862
1862
  }
1863
1863
  }