@microsoft/teamsfx-core 3.0.5-alpha.e092ea0a6.0 → 3.0.5-alpha.e2e0fdf1c.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.
Files changed (107) hide show
  1. package/build/client/graphClient.d.ts +8 -4
  2. package/build/client/graphClient.d.ts.map +1 -1
  3. package/build/client/graphClient.js +35 -8
  4. package/build/client/graphClient.js.map +1 -1
  5. package/build/client/interfaces/GetGroupResponse.d.ts +6 -0
  6. package/build/client/interfaces/GetGroupResponse.d.ts.map +1 -0
  7. package/build/client/interfaces/GetGroupResponse.js +5 -0
  8. package/build/client/interfaces/GetGroupResponse.js.map +1 -0
  9. package/build/client/interfaces/GetUserResponse.d.ts +7 -0
  10. package/build/client/interfaces/GetUserResponse.d.ts.map +1 -0
  11. package/build/client/interfaces/GetUserResponse.js +5 -0
  12. package/build/client/interfaces/GetUserResponse.js.map +1 -0
  13. package/build/common/constants.d.ts +1 -0
  14. package/build/common/constants.d.ts.map +1 -1
  15. package/build/common/constants.js +2 -1
  16. package/build/common/constants.js.map +1 -1
  17. package/build/common/permissionInterface.d.ts +6 -0
  18. package/build/common/permissionInterface.d.ts.map +1 -1
  19. package/build/common/templates-config.json +1 -1
  20. package/build/component/deps-checker/internal/testToolChecker.js +1 -1
  21. package/build/component/deps-checker/internal/testToolChecker.js.map +1 -1
  22. package/build/component/driver/teamsApp/utils/PluginManifestUtils.d.ts +1 -1
  23. package/build/component/driver/teamsApp/utils/PluginManifestUtils.d.ts.map +1 -1
  24. package/build/component/driver/teamsApp/utils/PluginManifestUtils.js +5 -2
  25. package/build/component/driver/teamsApp/utils/PluginManifestUtils.js.map +1 -1
  26. package/build/component/feature/collaboration.d.ts +7 -1
  27. package/build/component/feature/collaboration.d.ts.map +1 -1
  28. package/build/component/feature/collaboration.js +84 -1
  29. package/build/component/feature/collaboration.js.map +1 -1
  30. package/build/component/generator/combinedProject/generator.d.ts.map +1 -1
  31. package/build/component/generator/combinedProject/generator.js +2 -1
  32. package/build/component/generator/combinedProject/generator.js.map +1 -1
  33. package/build/component/generator/declarativeAgent/generator.d.ts.map +1 -1
  34. package/build/component/generator/declarativeAgent/generator.js +2 -1
  35. package/build/component/generator/declarativeAgent/generator.js.map +1 -1
  36. package/build/component/generator/generator.d.ts +1 -1
  37. package/build/component/generator/generator.d.ts.map +1 -1
  38. package/build/component/generator/generator.js +2 -1
  39. package/build/component/generator/generator.js.map +1 -1
  40. package/build/component/generator/openApiSpec/common.d.ts.map +1 -1
  41. package/build/component/generator/openApiSpec/common.js +2 -1
  42. package/build/component/generator/openApiSpec/common.js.map +1 -1
  43. package/build/component/generator/other/ssrTabGenerator.d.ts.map +1 -1
  44. package/build/component/generator/other/ssrTabGenerator.js +2 -1
  45. package/build/component/generator/other/ssrTabGenerator.js.map +1 -1
  46. package/build/component/generator/other/tdpGenerator.d.ts.map +1 -1
  47. package/build/component/generator/other/tdpGenerator.js +2 -1
  48. package/build/component/generator/other/tdpGenerator.js.map +1 -1
  49. package/build/component/generator/templates/templateReplaceMap.d.ts.map +1 -1
  50. package/build/component/generator/templates/templateReplaceMap.js +8 -6
  51. package/build/component/generator/templates/templateReplaceMap.js.map +1 -1
  52. package/build/component/m365/packageService.d.ts +6 -1
  53. package/build/component/m365/packageService.d.ts.map +1 -1
  54. package/build/component/m365/packageService.js +28 -5
  55. package/build/component/m365/packageService.js.map +1 -1
  56. package/build/core/FxCore.d.ts.map +1 -1
  57. package/build/core/FxCore.js +1 -29
  58. package/build/core/FxCore.js.map +1 -1
  59. package/build/core/collaborator.d.ts +1 -0
  60. package/build/core/collaborator.d.ts.map +1 -1
  61. package/build/core/collaborator.js +55 -29
  62. package/build/core/collaborator.js.map +1 -1
  63. package/build/core/share.d.ts.map +1 -1
  64. package/build/core/share.js +16 -2
  65. package/build/core/share.js.map +1 -1
  66. package/build/question/collaborator.d.ts +6 -0
  67. package/build/question/collaborator.d.ts.map +1 -0
  68. package/build/question/collaborator.js +166 -0
  69. package/build/question/collaborator.js.map +1 -0
  70. package/build/question/index.d.ts.map +1 -1
  71. package/build/question/index.js +3 -2
  72. package/build/question/index.js.map +1 -1
  73. package/build/question/inputs/ShareInputs.d.ts +2 -2
  74. package/build/question/inputs/ShareInputs.d.ts.map +1 -1
  75. package/build/question/options/ShareOptions.js +1 -1
  76. package/build/question/options/ShareOptions.js.map +1 -1
  77. package/build/question/other.d.ts +1 -4
  78. package/build/question/other.d.ts.map +1 -1
  79. package/build/question/other.js +2 -145
  80. package/build/question/other.js.map +1 -1
  81. package/build/question/questionNames.d.ts +1 -0
  82. package/build/question/questionNames.d.ts.map +1 -1
  83. package/build/question/questionNames.js +1 -0
  84. package/build/question/questionNames.js.map +1 -1
  85. package/build/question/share.d.ts +1 -3
  86. package/build/question/share.d.ts.map +1 -1
  87. package/build/question/share.js +2 -14
  88. package/build/question/share.js.map +1 -1
  89. package/build/tsconfig.tsbuildinfo +1 -1
  90. package/package.json +4 -4
  91. package/resource/package.nls.json +7 -4
  92. package/templates/fallback/common.zip +0 -0
  93. package/templates/fallback/csharp.zip +0 -0
  94. package/templates/fallback/js.zip +0 -0
  95. package/templates/fallback/python.zip +0 -0
  96. package/templates/fallback/ts.zip +0 -0
  97. package/templates/plugins/resource/aad/auth/V3/Bot/SSO/BotAuthenticationOptions.cs +44 -0
  98. package/templates/plugins/resource/aad/auth/V3/Bot/SSO/IIdentityClientAdapter.cs +21 -0
  99. package/templates/plugins/resource/aad/auth/V3/Bot/SSO/ITeamsInfo.cs +24 -0
  100. package/templates/plugins/resource/aad/auth/V3/Bot/SSO/IdentityClientAdapter.cs +30 -0
  101. package/templates/plugins/resource/aad/auth/V3/Bot/SSO/SsoDialog.cs +12 -9
  102. package/templates/plugins/resource/aad/auth/V3/Bot/SSO/SsoOperations.cs +2 -2
  103. package/templates/plugins/resource/aad/auth/V3/Bot/SSO/TeamsBotSsoPrompt.cs +423 -0
  104. package/templates/plugins/resource/aad/auth/V3/Bot/SSO/TeamsBotSsoPromptSettings.cs +41 -0
  105. package/templates/plugins/resource/aad/auth/V3/Bot/SSO/TeamsBotSsoPromptTokenResponse.cs +21 -0
  106. package/templates/plugins/resource/aad/auth/V3/Bot/SSO/TeamsInfoWrapper.cs +20 -0
  107. package/templates/plugins/resource/aad/auth/V3/Bot/SSO/TeamsSsoBot.cs +6 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/teamsfx-core",
3
- "version": "3.0.5-alpha.e092ea0a6.0",
3
+ "version": "3.0.5-alpha.e2e0fdf1c.0",
4
4
  "main": "build/index.js",
5
5
  "types": "build/index.d.ts",
6
6
  "license": "MIT",
@@ -107,8 +107,8 @@
107
107
  "@microsoft/dev-tunnels-contracts": "1.1.9",
108
108
  "@microsoft/dev-tunnels-management": "1.1.9",
109
109
  "@microsoft/kiota": "1.26.1",
110
- "@microsoft/m365-spec-parser": "^0.2.9-alpha.e092ea0a6.0",
111
- "@microsoft/teamsfx-api": "0.23.9-alpha.e092ea0a6.0",
110
+ "@microsoft/m365-spec-parser": "^0.2.9-alpha.e2e0fdf1c.0",
111
+ "@microsoft/teamsfx-api": "0.23.9-alpha.e2e0fdf1c.0",
112
112
  "adm-zip": "^0.5.10",
113
113
  "ajv": "^8.5.0",
114
114
  "axios": "^1.8.3",
@@ -231,7 +231,7 @@
231
231
  "resource/**/*",
232
232
  "templates/**/*"
233
233
  ],
234
- "gitHead": "b8351437d320da07286345328de693d772128075",
234
+ "gitHead": "e3a2ace37772f74633496d6313a22dd946751c48",
235
235
  "publishConfig": {
236
236
  "access": "public"
237
237
  },
@@ -64,15 +64,20 @@
64
64
  "core.collaboration.AccountUsedToCheck": "Account used to check: ",
65
65
  "core.collaboration.StartingListAllTeamsAppOwners": "\nStarting to list all app owners for environment: ",
66
66
  "core.collaboration.StartingListAllAadAppOwners": "\nStarting to list all Microsoft Entra app owners for environment: ",
67
+ "core.collaboration.StartingListAllAgentOwners": "\nStarting to list all agent owners for environment: ",
67
68
  "core.collaboration.M365TeamsAppId": "App (ID: ",
68
69
  "core.collaboration.SsoAadAppId": "SSO Microsoft Entra App (ID: ",
70
+ "core.collaboration.AgentTitleId": "Agent (ID: ",
69
71
  "core.collaboration.TeamsAppOwner": "App Owner: ",
70
72
  "core.collaboration.AadAppOwner": "Microsoft Entra App Owner: ",
73
+ "core.collaboration.AgentOwner": "Agent Owner: ",
71
74
  "core.collaboration.StaringCheckPermission": "Starting to check permission for environment: ",
72
75
  "core.collaboration.CheckPermissionResourceId": "Resource ID: ",
73
76
  "core.collaboration.Undefined": "undefined",
74
77
  "core.collaboration.ResourceName": ", Resource Name: ",
75
78
  "core.collaboration.Permission": ", Permission: ",
79
+ "core.collaboration.agent.label": "Agent",
80
+ "core.collaboration.agent.description": "Microsoft 365 Agent",
76
81
  "core.developerPortal.scaffold.CannotFindManifest": "Manifest not found from the downloaded package for app %s.",
77
82
  "plugins.spfx.questions.framework.title": "Framework",
78
83
  "plugins.spfx.questions.webpartName": "Name for SharePoint Framework Web Part",
@@ -641,7 +646,6 @@
641
646
  "core.common.ReceiveApiResponse": "Received API response: %s.",
642
647
  "core.common.shareWithTenant.success": "Agent successfully shared with tenant.",
643
648
  "core.common.shareWithUser.success": "Agent successfully shared with users: %s.",
644
- "core.common.shareWithOwner.success": "Agent successfully shared with owners: %s.",
645
649
  "core.common.removeOwnership.success": "Shared agent ownership removed from the users: %s.",
646
650
  "core.common.removeShareAccess.success": "Shared access successfully removed from users: %s.",
647
651
  "core.envFunc.unsupportedFile.errorLog": "\"%s\" is an invalid file. Supported format: %s.",
@@ -702,11 +706,10 @@
702
706
  "core.share.removeAccess.operator": "Cannot remove permission of the operator. Email: %s.",
703
707
  "core.shareOperationQuestion.option.removeShareAccessFromUsers": "Remove access for selected user(s)",
704
708
  "core.shareOperationQuestion.option.shareWithUsers": "Share access with selected user(s)",
705
- "core.shareOptionQuestion.option.shareWithOwners": "Share agent ownership with selected user(s)",
706
709
  "core.shareOptionQuestion.placeholder": "Select how to share the agent",
707
710
  "core.shareOptionQuestion.title": "Share the agent",
708
- "core.shareOptionQuestion.unshare.emails.title": "Email addresses of users for agent access removal",
709
- "core.shareScopeQuestion.emails.title": "Email addresses of users for agent sharing",
711
+ "core.shareOptionQuestion.unshare.emails.title": "Email addresses of users or groups for agent access removal",
712
+ "core.shareScopeQuestion.emails.title": "Email addresses of users or groups for agent sharing",
710
713
  "core.shareScopeQuestion.option.shareWithTenant": "Share the agent with all tenant users",
711
714
  "core.shareScopeQuestion.option.shareWithUsers": "Share the agent with selected user(s)",
712
715
  "core.shareScopeQuestion.placeholder": "Select a sharing scope",
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,44 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+
4
+ using System.ComponentModel.DataAnnotations;
5
+
6
+ namespace {{YOUR_NAMESPACE}}.Configuration;
7
+
8
+ /// <summary>
9
+ /// Bot related authentication configuration.
10
+ /// </summary>
11
+ public class BotAuthenticationOptions
12
+ {
13
+ /// <summary>
14
+ /// The client (application) ID of an App Registration in the tenant.
15
+ /// </summary>
16
+ [Required(ErrorMessage = "Client id is required")]
17
+ [RegularExpression(@"^[0-9A-Fa-f\-]{36}$")]
18
+ public string ClientId { get; set; }
19
+
20
+ /// <summary>
21
+ /// The client (application) Secret of an App Registration in the tenant.
22
+ /// </summary>
23
+ [Required(ErrorMessage = "Client secret is required")]
24
+ public string ClientSecret { get; set; }
25
+
26
+ /// <summary>
27
+ /// Authority URL that is used in OAuth On-behalf-of flow.
28
+ /// </summary>
29
+ [Required(ErrorMessage = "OAuth authority is required")]
30
+ [RegularExpression(@"^http(s)?://[-a-zA-Z0-9@:%._\+~#=/]{1,100}$")]
31
+ public string OAuthAuthority { get; set; }
32
+
33
+ /// <summary>
34
+ /// Application ID URI.
35
+ /// </summary>
36
+ [Required(ErrorMessage = "Application id uri is required")]
37
+ public string ApplicationIdUri { get; set; }
38
+
39
+ /// <summary>
40
+ /// Login authentication start page endpoint.
41
+ /// </summary>
42
+ [Required(ErrorMessage = "Login authentication start page endpoint is required")]
43
+ public string InitiateLoginEndpoint { get; set; }
44
+ }
@@ -0,0 +1,21 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+
4
+ using Microsoft.Identity.Client;
5
+
6
+ namespace {{YOUR_NAMESPACE}}.SSO
7
+ {
8
+ /// <summary>
9
+ /// Adapter of IConfidentialClientApplication On-behalf-of flow.
10
+ /// </summary>
11
+ public interface IIdentityClientAdapter
12
+ {
13
+ /// <summary>
14
+ /// Use On-behalf-of flow to exchange access token.
15
+ /// </summary>
16
+ /// <param name="ssoToken">token from Teams client</param>
17
+ /// <param name="scopes">required scopes</param>
18
+ /// <returns></returns>
19
+ Task<AuthenticationResult> GetAccessToken(string ssoToken, IEnumerable<string> scopes);
20
+ }
21
+ }
@@ -0,0 +1,24 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+
4
+ using Microsoft.Agents.Builder;
5
+ using Microsoft.Agents.Extensions.Teams.Models;
6
+
7
+ namespace {{YOUR_NAMESPACE}}.SSO
8
+ {
9
+ /// <summary>
10
+ /// provides utility methods for interactions that occur within Microsoft Teams.
11
+ /// </summary>
12
+ public interface ITeamsInfo
13
+ {
14
+ /// <summary>
15
+ /// Gets the account of a single conversation member.
16
+ /// This works in one-on-one, group, and teams scoped conversations.
17
+ /// </summary>
18
+ /// <param name="context"> Turn context. </param>
19
+ /// <param name="userId"> ID of the user in question. </param>
20
+ /// <param name="cancellationToken"> cancellation token. </param>
21
+ /// <returns>Team Account Details.</returns>
22
+ Task<TeamsChannelAccount> GetTeamsMemberAsync(ITurnContext context, string userId, CancellationToken cancellationToken = default);
23
+ }
24
+ }
@@ -0,0 +1,30 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+
4
+ using Microsoft.Identity.Client;
5
+
6
+ namespace {{YOUR_NAMESPACE}}.SSO
7
+ {
8
+ /// <summary>
9
+ /// Helper class used to simplify unit test.
10
+ /// https://stackoverflow.com/questions/65334284/how-to-mock-moq-iconfidentialclientapplication-which-has-sealed-setup-abstract
11
+ /// </summary>
12
+ internal class IdentityClientAdapter : IIdentityClientAdapter
13
+ {
14
+ private readonly IConfidentialClientApplication _confidentialClientApplication;
15
+
16
+ public IdentityClientAdapter(IConfidentialClientApplication confidentialClientApplication)
17
+ {
18
+ _confidentialClientApplication = confidentialClientApplication;
19
+ }
20
+
21
+ public async Task<AuthenticationResult> GetAccessToken(string ssoToken, IEnumerable<string> scopes)
22
+ {
23
+ var userAssertion = new UserAssertion(ssoToken);
24
+ return await _confidentialClientApplication
25
+ .AcquireTokenOnBehalfOf(scopes, userAssertion)
26
+ .ExecuteAsync()
27
+ .ConfigureAwait(false);
28
+ }
29
+ }
30
+ }
@@ -1,9 +1,11 @@
1
- using Microsoft.Bot.Builder;
2
- using Microsoft.Bot.Builder.Dialogs;
3
- using Microsoft.Bot.Schema;
1
+ using {{YOUR_NAMESPACE}}.Configuration;
2
+ using Json.More;
3
+ using Microsoft.Agents.Builder;
4
+ using Microsoft.Agents.Builder.Dialogs;
5
+ using Microsoft.Agents.Builder.State;
6
+ using Microsoft.Agents.Core.Models;
7
+ using Microsoft.Agents.Storage;
4
8
  using Microsoft.Extensions.Options;
5
- using Microsoft.TeamsFx.Bot;
6
- using Microsoft.TeamsFx.Configuration;
7
9
 
8
10
  namespace {{YOUR_NAMESPACE}}.SSO;
9
11
 
@@ -173,9 +175,10 @@ public class SsoDialog : ComponentDialog
173
175
 
174
176
  private async Task<bool> ShouldDedup(ITurnContext context)
175
177
  {
178
+ var tokenResponseObject = context.Activity.Value.ToJsonDocument();
176
179
  var storeItem = new StoreItem()
177
180
  {
178
- eTag = (context.Activity.Value as dynamic).id,
181
+ eTag = tokenResponseObject.RootElement.GetProperty("id").ToString(),
179
182
  };
180
183
  var key = GetStorageKey(context);
181
184
  var storeItems = new Dictionary<string, object>()
@@ -209,13 +212,13 @@ public class SsoDialog : ComponentDialog
209
212
  throw new Exception("TokenExchangeState can only be used with Invokes of signin/tokenExchange.");
210
213
  }
211
214
 
212
- var value = activity.Value;
213
- if (value == null || (value as dynamic).id == null)
215
+ var value = activity.Value.ToJsonDocument();
216
+ if (value == null || value.RootElement.GetProperty("id").ToString() == null)
214
217
  {
215
218
  throw new Exception("Invalid signin/tokenExchange. Missing activity.value.id.");
216
219
  }
217
220
 
218
- return $"{channelId}/{conversationId}/{(value as dynamic).id}";
221
+ return $"{channelId}/{conversationId}/{value.RootElement.GetProperty("id").ToString()}";
219
222
  }
220
223
 
221
224
  private string MatchCommands(string text)
@@ -1,7 +1,7 @@
1
- using Microsoft.Bot.Builder;
1
+ using {{YOUR_NAMESPACE}}.Configuration;
2
+ using Microsoft.Agents.Builder;
2
3
  using Microsoft.Graph;
3
4
  using Microsoft.Kiota.Abstractions.Authentication;
4
- using Microsoft.TeamsFx.Configuration;
5
5
 
6
6
  namespace {{YOUR_NAMESPACE}}.SSO;
7
7