@microsoft/teamsfx 1.1.2-alpha.18494658a.0 → 1.1.2-alpha.7eddd6cf4.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.
@@ -694,10 +694,13 @@ class TeamsUserCredential {
694
694
  }
695
695
  /**
696
696
  * Popup login page to get user's access token with specific scopes.
697
+ *
698
+ * @param {string[]} resources - The optional list of resources for full trust Teams apps.
699
+ *
697
700
  * @remarks
698
701
  * Can only be used within Teams.
699
702
  */
700
- async login(scopes) {
703
+ async login(scopes, resources) {
701
704
  throw new ErrorWithCode(formatString(ErrorMessage.NodejsRuntimeNotSupported, "TeamsUserCredential"), ErrorCode.RuntimeNotSupported);
702
705
  }
703
706
  /**
@@ -710,10 +713,13 @@ class TeamsUserCredential {
710
713
  }
711
714
  /**
712
715
  * Get basic user info from SSO token
716
+ *
717
+ * @param {string[]} resources - The optional list of resources for full trust Teams apps.
718
+ *
713
719
  * @remarks
714
720
  * Can only be used within Teams.
715
721
  */
716
- getUserInfo() {
722
+ getUserInfo(resources) {
717
723
  throw new ErrorWithCode(formatString(ErrorMessage.NodejsRuntimeNotSupported, "TeamsUserCredential"), ErrorCode.RuntimeNotSupported);
718
724
  }
719
725
  }
@@ -1661,8 +1667,9 @@ class TeamsFx {
1661
1667
  this.configuration = new Map();
1662
1668
  this.loadFromEnv();
1663
1669
  if (customConfig) {
1664
- for (const key of Object.keys(customConfig)) {
1665
- const value = customConfig[key];
1670
+ const myConfig = Object.assign({}, customConfig);
1671
+ for (const key of Object.keys(myConfig)) {
1672
+ const value = myConfig[key];
1666
1673
  if (value) {
1667
1674
  this.configuration.set(key, value);
1668
1675
  }
@@ -1704,9 +1711,10 @@ class TeamsFx {
1704
1711
  }
1705
1712
  /**
1706
1713
  * Get user information.
1714
+ * @param {string[]} resources - The optional list of resources for full trust Teams apps.
1707
1715
  * @returns UserInfo object.
1708
1716
  */
1709
- async getUserInfo() {
1717
+ async getUserInfo(resources) {
1710
1718
  if (this.identityType !== IdentityType.User) {
1711
1719
  const errorMsg = formatString(ErrorMessage.IdentityTypeNotSupported, this.identityType.toString(), "TeamsFx");
1712
1720
  internalLogger.error(errorMsg);
@@ -1728,13 +1736,14 @@ class TeamsFx {
1728
1736
  * await teamsfx.login("https://graph.microsoft.com/User.Read Calendars.Read"); // multiple scopes using string
1729
1737
  * ```
1730
1738
  * @param scopes - The list of scopes for which the token will have access, before that, we will request user to consent.
1739
+ * @param {string[]} resources - The optional list of resources for full trust Teams apps.
1731
1740
  *
1732
1741
  * @throws {@link ErrorCode|InternalError} when failed to login with unknown error.
1733
1742
  * @throws {@link ErrorCode|ConsentFailed} when user canceled or failed to consent.
1734
1743
  * @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
1735
1744
  * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is nodeJS.
1736
1745
  */
1737
- async login(scopes) {
1746
+ async login(scopes, resources) {
1738
1747
  throw new ErrorWithCode(formatString(ErrorMessage.NodejsRuntimeNotSupported, "login"), ErrorCode.RuntimeNotSupported);
1739
1748
  }
1740
1749
  /**