@microsoft/teamsfx 1.1.2-alpha.b18b9fae2.0 → 1.1.2-alpha.d61ffd7b2.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.
@@ -728,10 +728,13 @@ class TeamsUserCredential {
728
728
  }
729
729
  /**
730
730
  * Popup login page to get user's access token with specific scopes.
731
+ *
732
+ * @param {string[]} resources - The optional list of resources for full trust Teams apps.
733
+ *
731
734
  * @remarks
732
735
  * Can only be used within Teams.
733
736
  */
734
- login(scopes) {
737
+ login(scopes, resources) {
735
738
  return tslib.__awaiter(this, void 0, void 0, function* () {
736
739
  throw new ErrorWithCode(formatString(ErrorMessage.NodejsRuntimeNotSupported, "TeamsUserCredential"), exports.ErrorCode.RuntimeNotSupported);
737
740
  });
@@ -748,10 +751,13 @@ class TeamsUserCredential {
748
751
  }
749
752
  /**
750
753
  * Get basic user info from SSO token
754
+ *
755
+ * @param {string[]} resources - The optional list of resources for full trust Teams apps.
756
+ *
751
757
  * @remarks
752
758
  * Can only be used within Teams.
753
759
  */
754
- getUserInfo() {
760
+ getUserInfo(resources) {
755
761
  throw new ErrorWithCode(formatString(ErrorMessage.NodejsRuntimeNotSupported, "TeamsUserCredential"), exports.ErrorCode.RuntimeNotSupported);
756
762
  }
757
763
  }
@@ -1723,8 +1729,9 @@ class TeamsFx {
1723
1729
  this.configuration = new Map();
1724
1730
  this.loadFromEnv();
1725
1731
  if (customConfig) {
1726
- for (const key of Object.keys(customConfig)) {
1727
- const value = customConfig[key];
1732
+ const myConfig = Object.assign({}, customConfig);
1733
+ for (const key of Object.keys(myConfig)) {
1734
+ const value = myConfig[key];
1728
1735
  if (value) {
1729
1736
  this.configuration.set(key, value);
1730
1737
  }
@@ -1766,9 +1773,10 @@ class TeamsFx {
1766
1773
  }
1767
1774
  /**
1768
1775
  * Get user information.
1776
+ * @param {string[]} resources - The optional list of resources for full trust Teams apps.
1769
1777
  * @returns UserInfo object.
1770
1778
  */
1771
- getUserInfo() {
1779
+ getUserInfo(resources) {
1772
1780
  return tslib.__awaiter(this, void 0, void 0, function* () {
1773
1781
  if (this.identityType !== exports.IdentityType.User) {
1774
1782
  const errorMsg = formatString(ErrorMessage.IdentityTypeNotSupported, this.identityType.toString(), "TeamsFx");
@@ -1792,13 +1800,14 @@ class TeamsFx {
1792
1800
  * await teamsfx.login("https://graph.microsoft.com/User.Read Calendars.Read"); // multiple scopes using string
1793
1801
  * ```
1794
1802
  * @param scopes - The list of scopes for which the token will have access, before that, we will request user to consent.
1803
+ * @param {string[]} resources - The optional list of resources for full trust Teams apps.
1795
1804
  *
1796
1805
  * @throws {@link ErrorCode|InternalError} when failed to login with unknown error.
1797
1806
  * @throws {@link ErrorCode|ConsentFailed} when user canceled or failed to consent.
1798
1807
  * @throws {@link ErrorCode|InvalidParameter} when scopes is not a valid string or string array.
1799
1808
  * @throws {@link ErrorCode|RuntimeNotSupported} when runtime is nodeJS.
1800
1809
  */
1801
- login(scopes) {
1810
+ login(scopes, resources) {
1802
1811
  return tslib.__awaiter(this, void 0, void 0, function* () {
1803
1812
  throw new ErrorWithCode(formatString(ErrorMessage.NodejsRuntimeNotSupported, "login"), exports.ErrorCode.RuntimeNotSupported);
1804
1813
  });